From: support Date: Tue, 21 Jun 2022 07:41:30 +0000 (+0000) Subject: Built motion from commit ee312f6f.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=9b7ef19a7c1a83cdb9973025e521630988c31163;p=motion2.git Built motion from commit ee312f6f.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6a453cc..15c992c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-20T15:33:31.928Z", + "time": "2022-06-21T07:33:12.595Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index bb4d5ef..ea2b315 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-20T15:33:31.928Z", + "time": "2022-06-21T07:33:12.595Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/@grpc/proto-loader/package.json b/legacy-libs/@grpc/proto-loader/package.json index f2f6658..0322287 100644 --- a/legacy-libs/@grpc/proto-loader/package.json +++ b/legacy-libs/@grpc/proto-loader/package.json @@ -1,28 +1,4 @@ { - "_from": "@grpc/proto-loader@^0.4.0", - "_id": "@grpc/proto-loader@0.4.0", - "_inBundle": false, - "_integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==", - "_location": "/@grpc/proto-loader", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@grpc/proto-loader@^0.4.0", - "name": "@grpc/proto-loader", - "escapedName": "@grpc%2fproto-loader", - "scope": "@grpc", - "rawSpec": "^0.4.0", - "saveSpec": null, - "fetchSpec": "^0.4.0" - }, - "_requiredBy": [ - "/google-gax" - ], - "_resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz", - "_shasum": "a823a51eb2fde58369bef1deb5445fd808d70901", - "_spec": "@grpc/proto-loader@^0.4.0", - "_where": "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/dfnode8/node_modules/google-gax", "author": { "name": "Google Inc." }, diff --git a/legacy-libs/@protobufjs/aspromise/package.json b/legacy-libs/@protobufjs/aspromise/package.json index e8f1b6f..ea1ec8f 100644 --- a/legacy-libs/@protobufjs/aspromise/package.json +++ b/legacy-libs/@protobufjs/aspromise/package.json @@ -1,51 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/aspromise@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2faspromise", - "name": "@protobufjs/aspromise", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/aspromise@>=1.1.2 <2.0.0", - "_id": "@protobufjs/aspromise@1.1.2", - "_inCache": true, - "_location": "/@protobufjs/aspromise", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/aspromise-1.1.2.tgz_1493030312365_0.014110192423686385" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/aspromise@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2faspromise", - "name": "@protobufjs/aspromise", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/@protobufjs/fetch", - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "_shasum": "9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf", - "_shrinkwrap": null, - "_spec": "@protobufjs/aspromise@^1.1.2", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/base64/package.json b/legacy-libs/@protobufjs/base64/package.json index 22b27e7..82e4167 100644 --- a/legacy-libs/@protobufjs/base64/package.json +++ b/legacy-libs/@protobufjs/base64/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/base64@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fbase64", - "name": "@protobufjs/base64", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/base64@>=1.1.2 <2.0.0", - "_id": "@protobufjs/base64@1.1.2", - "_inCache": true, - "_location": "/@protobufjs/base64", - "_nodeVersion": "8.0.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/base64-1.1.2.tgz_1497000720755_0.053681070916354656" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "5.0.1", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/base64@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fbase64", - "name": "@protobufjs/base64", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "_shasum": "4c85730e59b9a1f1f349047dbf24296034bb2735", - "_shrinkwrap": null, - "_spec": "@protobufjs/base64@^1.1.2", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/codegen/package.json b/legacy-libs/@protobufjs/codegen/package.json index dde2069..3e800ea 100644 --- a/legacy-libs/@protobufjs/codegen/package.json +++ b/legacy-libs/@protobufjs/codegen/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/codegen@^2.0.4", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fcodegen", - "name": "@protobufjs/codegen", - "rawSpec": "^2.0.4", - "spec": ">=2.0.4 <3.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/codegen@>=2.0.4 <3.0.0", - "_id": "@protobufjs/codegen@2.0.4", - "_inCache": true, - "_location": "/@protobufjs/codegen", - "_nodeVersion": "8.0.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/codegen-2.0.4.tgz_1497041777758_0.900342388311401" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "5.0.1", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/codegen@^2.0.4", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fcodegen", - "name": "@protobufjs/codegen", - "rawSpec": "^2.0.4", - "spec": ">=2.0.4 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "_shasum": "7ef37f0d010fb028ad1ad59722e506d9262815cb", - "_shrinkwrap": null, - "_spec": "@protobufjs/codegen@^2.0.4", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/eventemitter/package.json b/legacy-libs/@protobufjs/eventemitter/package.json index 4abce6b..dd23e64 100644 --- a/legacy-libs/@protobufjs/eventemitter/package.json +++ b/legacy-libs/@protobufjs/eventemitter/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/eventemitter@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2feventemitter", - "name": "@protobufjs/eventemitter", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/eventemitter@>=1.1.0 <2.0.0", - "_id": "@protobufjs/eventemitter@1.1.0", - "_inCache": true, - "_location": "/@protobufjs/eventemitter", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/eventemitter-1.1.0.tgz_1485367943950_0.18555008037947118" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/eventemitter@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2feventemitter", - "name": "@protobufjs/eventemitter", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "_shasum": "355cbc98bafad5978f9ed095f397621f1d066b70", - "_shrinkwrap": null, - "_spec": "@protobufjs/eventemitter@^1.1.0", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/fetch/package.json b/legacy-libs/@protobufjs/fetch/package.json index 5b1214d..26781bf 100644 --- a/legacy-libs/@protobufjs/fetch/package.json +++ b/legacy-libs/@protobufjs/fetch/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/fetch@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2ffetch", - "name": "@protobufjs/fetch", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/fetch@>=1.1.0 <2.0.0", - "_id": "@protobufjs/fetch@1.1.0", - "_inCache": true, - "_location": "/@protobufjs/fetch", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/fetch-1.1.0.tgz_1485532253082_0.3777743794489652" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/fetch@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2ffetch", - "name": "@protobufjs/fetch", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "_shasum": "ba99fb598614af65700c1619ff06d454b0d84c45", - "_shrinkwrap": null, - "_spec": "@protobufjs/fetch@^1.1.0", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/float/package.json b/legacy-libs/@protobufjs/float/package.json index 7ee37d1..9cf9766 100644 --- a/legacy-libs/@protobufjs/float/package.json +++ b/legacy-libs/@protobufjs/float/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/float@^1.0.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2ffloat", - "name": "@protobufjs/float", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/float@>=1.0.2 <2.0.0", - "_id": "@protobufjs/float@1.0.2", - "_inCache": true, - "_location": "/@protobufjs/float", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/float-1.0.2.tgz_1491129941022_0.6265034212265164" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/float@^1.0.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2ffloat", - "name": "@protobufjs/float", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "_shasum": "5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1", - "_shrinkwrap": null, - "_spec": "@protobufjs/float@^1.0.2", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/inquire/package.json b/legacy-libs/@protobufjs/inquire/package.json index a91b63f..f5bbe1a 100644 --- a/legacy-libs/@protobufjs/inquire/package.json +++ b/legacy-libs/@protobufjs/inquire/package.json @@ -1,51 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/inquire@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2finquire", - "name": "@protobufjs/inquire", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/inquire@>=1.1.0 <2.0.0", - "_id": "@protobufjs/inquire@1.1.0", - "_inCache": true, - "_location": "/@protobufjs/inquire", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/inquire-1.1.0.tgz_1485367981156_0.06349746254272759" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/inquire@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2finquire", - "name": "@protobufjs/inquire", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/@protobufjs/fetch", - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "_shasum": "ff200e3e7cf2429e2dcafc1140828e8cc638f089", - "_shrinkwrap": null, - "_spec": "@protobufjs/inquire@^1.1.0", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/path/package.json b/legacy-libs/@protobufjs/path/package.json index a699e67..43236f4 100644 --- a/legacy-libs/@protobufjs/path/package.json +++ b/legacy-libs/@protobufjs/path/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/path@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fpath", - "name": "@protobufjs/path", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/path@>=1.1.2 <2.0.0", - "_id": "@protobufjs/path@1.1.2", - "_inCache": true, - "_location": "/@protobufjs/path", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/path-1.1.2.tgz_1487868856921_0.727851988747716" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/path@^1.1.2", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fpath", - "name": "@protobufjs/path", - "rawSpec": "^1.1.2", - "spec": ">=1.1.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "_shasum": "6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d", - "_shrinkwrap": null, - "_spec": "@protobufjs/path@^1.1.2", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/pool/package.json b/legacy-libs/@protobufjs/pool/package.json index 119d282..6885887 100644 --- a/legacy-libs/@protobufjs/pool/package.json +++ b/legacy-libs/@protobufjs/pool/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/pool@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fpool", - "name": "@protobufjs/pool", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/pool@>=1.1.0 <2.0.0", - "_id": "@protobufjs/pool@1.1.0", - "_inCache": true, - "_location": "/@protobufjs/pool", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/pool-1.1.0.tgz_1485367998862_0.3938121625687927" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/pool@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2fpool", - "name": "@protobufjs/pool", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "_shasum": "09fd15f2d6d3abfa9b65bc366506d6ad7846ff54", - "_shrinkwrap": null, - "_spec": "@protobufjs/pool@^1.1.0", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/@protobufjs/utf8/package.json b/legacy-libs/@protobufjs/utf8/package.json index 916a7c6..57784c7 100644 --- a/legacy-libs/@protobufjs/utf8/package.json +++ b/legacy-libs/@protobufjs/utf8/package.json @@ -1,50 +1,4 @@ { - "_args": [ - [ - { - "raw": "@protobufjs/utf8@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2futf8", - "name": "@protobufjs/utf8", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/protobufjs" - ] - ], - "_from": "@protobufjs/utf8@>=1.1.0 <2.0.0", - "_id": "@protobufjs/utf8@1.1.0", - "_inCache": true, - "_location": "/@protobufjs/utf8", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/utf8-1.1.0.tgz_1485368134514_0.7150300552602857" - }, - "_npmUser": { - "name": "dcode", - "email": "dcode+npm@dcode.io" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "@protobufjs/utf8@^1.1.0", - "scope": "@protobufjs", - "escapedName": "@protobufjs%2futf8", - "name": "@protobufjs/utf8", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/protobufjs" - ], - "_resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "_shasum": "a777360b5b39a1a2e5106f8e858f2fd2d060c570", - "_shrinkwrap": null, - "_spec": "@protobufjs/utf8@^1.1.0", - "_where": "/var/opt/motion2/node_modules/protobufjs", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/legacy-libs/google-proto-files/package.json b/legacy-libs/google-proto-files/package.json index 96141ec..26ad205 100644 --- a/legacy-libs/google-proto-files/package.json +++ b/legacy-libs/google-proto-files/package.json @@ -1,51 +1,4 @@ { - "_args": [ - [ - { - "raw": "google-proto-files@^0.20.0", - "scope": null, - "escapedName": "google-proto-files", - "name": "google-proto-files", - "rawSpec": "^0.20.0", - "spec": ">=0.20.0 <0.21.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/google-gax" - ] - ], - "_from": "google-proto-files@>=0.20.0 <0.21.0", - "_hasShrinkwrap": false, - "_id": "google-proto-files@0.20.0", - "_inCache": true, - "_location": "/google-proto-files", - "_nodeVersion": "8.15.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/google-proto-files_0.20.0_1552683029562_0.24857841381622836" - }, - "_npmUser": { - "name": "google-node-team", - "email": "node-team-npm@google.com" - }, - "_npmVersion": "6.4.1", - "_phantomChildren": {}, - "_requested": { - "raw": "google-proto-files@^0.20.0", - "scope": null, - "escapedName": "google-proto-files", - "name": "google-proto-files", - "rawSpec": "^0.20.0", - "spec": ">=0.20.0 <0.21.0", - "type": "range" - }, - "_requiredBy": [ - "/google-gax" - ], - "_resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.20.0.tgz", - "_shasum": "dfcd1635a0c3f00f49ca057462cf369108ff4b5e", - "_shrinkwrap": null, - "_spec": "google-proto-files@^0.20.0", - "_where": "/var/opt/motion2/node_modules/google-gax", "author": { "name": "google-proto-files project authors" }, diff --git a/legacy-libs/grpc-cloned/package.json b/legacy-libs/grpc-cloned/package.json index 64a79e3..c5b692f 100644 --- a/legacy-libs/grpc-cloned/package.json +++ b/legacy-libs/grpc-cloned/package.json @@ -1,63 +1,4 @@ { - "_args": [ - [ - { - "raw": "grpc@1.24.6", - "scope": null, - "escapedName": "grpc", - "name": "grpc", - "rawSpec": "1.24.6", - "spec": "1.24.6", - "type": "version" - }, - "/var/opt/motion2" - ] - ], - "_from": "grpc@1.24.6", - "_hasShrinkwrap": false, - "_id": "grpc@1.24.6", - "_inCache": true, - "_location": "/grpc", - "_nodeVersion": "12.18.1", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/grpc_1.24.6_1615411862636_0.20920405911456452" - }, - "_npmUser": { - "name": "murgatroid99", - "email": "mlumish@google.com" - }, - "_npmVersion": "6.14.5", - "_phantomChildren": { - "ascli": "1.0.1", - "bytebuffer": "5.0.1", - "decamelize": "1.2.0", - "glob": "7.0.6", - "os-locale": "1.4.0", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0", - "y18n": "3.2.1" - }, - "_requested": { - "raw": "grpc@1.24.6", - "scope": null, - "escapedName": "grpc", - "name": "grpc", - "rawSpec": "1.24.6", - "spec": "1.24.6", - "type": "version" - }, - "_requiredBy": [ - "/", - "/google-gax", - "/grpc-gcp" - ], - "_resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.6.tgz", - "_shasum": "1862a9d990f79cfa20b962d77f090000d915469c", - "_shrinkwrap": null, - "_spec": "grpc@1.24.6", - "_where": "/var/opt/motion2", "author": { "name": "Google Inc." }, diff --git a/legacy-libs/grpc/package.json b/legacy-libs/grpc/package.json index 9d191ad..93916c7 100644 --- a/legacy-libs/grpc/package.json +++ b/legacy-libs/grpc/package.json @@ -1,52 +1,4 @@ { - "_args": [ - [ - { - "raw": "grpc@1.22", - "scope": null, - "escapedName": "grpc", - "name": "grpc", - "rawSpec": "1.22", - "spec": ">=1.22.0 <1.23.0", - "type": "range" - }, - "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/test" - ] - ], - "_from": "grpc@>=1.22.0 <1.23.0", - "_hasShrinkwrap": false, - "_id": "grpc@1.22.3", - "_inCache": true, - "_location": "/grpc", - "_nodeVersion": "10.12.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/grpc_1.22.3_1566244154383_0.07155258037766044" - }, - "_npmUser": { - "name": "murgatroid99", - "email": "mlumish@google.com" - }, - "_npmVersion": "6.4.1", - "_phantomChildren": {}, - "_requested": { - "raw": "grpc@1.22", - "scope": null, - "escapedName": "grpc", - "name": "grpc", - "rawSpec": "1.22", - "spec": ">=1.22.0 <1.23.0", - "type": "range" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/grpc/-/grpc-1.22.3.tgz", - "_shasum": "19eb6f9308e793ecc57d6d9b534369ce98b0a137", - "_shrinkwrap": null, - "_spec": "grpc@1.22", - "_where": "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/test", "author": { "name": "Google Inc." }, diff --git a/legacy-libs/json-bigint/package.json b/legacy-libs/json-bigint/package.json index 6d3e2c7..a7818f6 100644 --- a/legacy-libs/json-bigint/package.json +++ b/legacy-libs/json-bigint/package.json @@ -1,51 +1,4 @@ { - "_args": [ - [ - { - "raw": "json-bigint@^0.3.0", - "scope": null, - "escapedName": "json-bigint", - "name": "json-bigint", - "rawSpec": "^0.3.0", - "spec": ">=0.3.0 <0.4.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/gcp-metadata" - ] - ], - "_from": "json-bigint@>=0.3.0 <0.4.0", - "_hasShrinkwrap": false, - "_id": "json-bigint@0.3.1", - "_inCache": true, - "_location": "/json-bigint", - "_nodeVersion": "12.13.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/json-bigint_0.3.1_1592365825784_0.15984931652351175" - }, - "_npmUser": { - "name": "sidorares", - "email": "sidorares@yandex.com" - }, - "_npmVersion": "6.12.0", - "_phantomChildren": {}, - "_requested": { - "raw": "json-bigint@^0.3.0", - "scope": null, - "escapedName": "json-bigint", - "name": "json-bigint", - "rawSpec": "^0.3.0", - "spec": ">=0.3.0 <0.4.0", - "type": "range" - }, - "_requiredBy": [ - "/gcp-metadata" - ], - "_resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", - "_shasum": "0c1729d679f580d550899d6a2226c228564afe60", - "_shrinkwrap": null, - "_spec": "json-bigint@^0.3.0", - "_where": "/var/opt/motion2/node_modules/gcp-metadata", "author": { "name": "Andrey Sidorov", "email": "sidorares@yandex.ru" diff --git a/legacy-libs/protobufjs/package.json b/legacy-libs/protobufjs/package.json index ce8fb29..d9d7169 100644 --- a/legacy-libs/protobufjs/package.json +++ b/legacy-libs/protobufjs/package.json @@ -1,55 +1,4 @@ { - "_args": [ - [ - { - "raw": "protobufjs@^6.8.0", - "scope": null, - "escapedName": "protobufjs", - "name": "protobufjs", - "rawSpec": "^6.8.0", - "spec": ">=6.8.0 <7.0.0", - "type": "range" - }, - "/var/opt/motion2/node_modules/dialogflow" - ] - ], - "_from": "protobufjs@>=6.8.0 <7.0.0", - "_hasShrinkwrap": false, - "_id": "protobufjs@6.10.2", - "_inCache": true, - "_location": "/protobufjs", - "_nodeVersion": "10.22.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/protobufjs_6.10.2_1605561394120_0.8578340673118987" - }, - "_npmUser": { - "name": "google-wombot", - "email": "node-team-npm+wombot@google.com" - }, - "_npmVersion": "6.14.6", - "_phantomChildren": {}, - "_requested": { - "raw": "protobufjs@^6.8.0", - "scope": null, - "escapedName": "protobufjs", - "name": "protobufjs", - "rawSpec": "^6.8.0", - "spec": ">=6.8.0 <7.0.0", - "type": "range" - }, - "_requiredBy": [ - "/@grpc/proto-loader", - "/dialogflow", - "/google-gax", - "/google-proto-files", - "/grpc-gcp" - ], - "_resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "_shasum": "b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b", - "_shrinkwrap": null, - "_spec": "protobufjs@^6.8.0", - "_where": "/var/opt/motion2/node_modules/dialogflow", "author": { "name": "Daniel Wirtz", "email": "dcode+protobufjs@dcode.io" diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6a3ffd9..224f778 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -22,11 +22,6 @@ "from": "@types/body-parser@*", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz" }, - "@types/bytebuffer": { - "version": "5.0.43", - "from": "@types/bytebuffer@>=5.0.40 <6.0.0", - "resolved": "https://registry.npmjs.org/@types/bytebuffer/-/bytebuffer-5.0.43.tgz" - }, "@types/connect": { "version": "3.4.35", "from": "@types/connect@*", @@ -47,11 +42,6 @@ "from": "@types/geojson@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz" }, - "@types/long": { - "version": "4.0.2", - "from": "@types/long@*", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" - }, "@types/mime": { "version": "1.3.2", "from": "@types/mime@>=1.0.0 <2.0.0", @@ -82,11 +72,6 @@ "from": "abab@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" }, - "abbrev": { - "version": "1.1.1", - "from": "abbrev@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" - }, "abort-controller": { "version": "3.0.0", "from": "abort-controller@>=3.0.0 <4.0.0", @@ -205,11 +190,6 @@ "from": "append-field@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz" }, - "aproba": { - "version": "1.2.0", - "from": "aproba@>=1.0.3 <2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" - }, "archiver": { "version": "2.1.1", "from": "archiver@2.1.1", @@ -227,11 +207,6 @@ "from": "archiver-utils@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz" }, - "are-we-there-yet": { - "version": "1.1.7", - "from": "are-we-there-yet@>=1.1.2 <1.2.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" - }, "argparse": { "version": "1.0.10", "from": "argparse@>=1.0.7 <2.0.0", @@ -289,11 +264,6 @@ "from": "asap@*", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" }, - "ascli": { - "version": "1.0.1", - "from": "ascli@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz" - }, "asn1": { "version": "0.2.6", "from": "asn1@>=0.2.4 <0.3.0", @@ -637,11 +607,6 @@ } } }, - "bytebuffer": { - "version": "5.0.1", - "from": "bytebuffer@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz" - }, "bytes": { "version": "3.1.0", "from": "bytes@3.1.0", @@ -663,9 +628,9 @@ "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz" }, "camelcase": { - "version": "2.1.1", - "from": "camelcase@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz" + "version": "1.2.1", + "from": "camelcase@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz" }, "caseless": { "version": "0.12.0", @@ -721,11 +686,6 @@ } } }, - "chownr": { - "version": "1.1.4", - "from": "chownr@>=1.1.4 <2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" - }, "class-utils": { "version": "0.3.6", "from": "class-utils@>=0.3.5 <0.4.0", @@ -771,14 +731,14 @@ } }, "cliui": { - "version": "3.2.0", - "from": "cliui@>=3.0.3 <4.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "version": "2.1.0", + "from": "cliui@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "dependencies": { - "strip-ansi": { - "version": "3.0.1", - "from": "strip-ansi@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "wordwrap": { + "version": "0.0.2", + "from": "wordwrap@0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" } } }, @@ -832,11 +792,6 @@ "from": "colors@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz" }, - "colour": { - "version": "0.7.1", - "from": "colour@>=0.7.1 <0.8.0", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz" - }, "combined-stream": { "version": "1.0.8", "from": "combined-stream@>=1.0.5 <1.1.0", @@ -914,11 +869,6 @@ } } }, - "console-control-strings": { - "version": "1.1.0", - "from": "console-control-strings@>=1.1.0 <1.2.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" - }, "constantinople": { "version": "3.1.2", "from": "constantinople@>=3.1.2 <4.0.0", @@ -1091,7 +1041,29 @@ "data-urls": { "version": "1.1.0", "from": "data-urls@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz" + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "dependencies": { + "punycode": { + "version": "2.1.1", + "from": "punycode@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" + }, + "tr46": { + "version": "1.0.1", + "from": "tr46@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" + }, + "webidl-conversions": { + "version": "4.0.2", + "from": "webidl-conversions@>=4.0.2 <5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + }, + "whatwg-url": { + "version": "7.1.0", + "from": "whatwg-url@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" + } + } }, "datauri": { "version": "2.0.0", @@ -1110,7 +1082,7 @@ }, "decamelize": { "version": "1.2.0", - "from": "decamelize@>=1.1.1 <2.0.0", + "from": "decamelize@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" }, "decode-uri-component": { @@ -1182,11 +1154,6 @@ "from": "delayed-stream@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" }, - "delegates": { - "version": "1.0.0", - "from": "delegates@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" - }, "denque": { "version": "1.5.1", "from": "denque@>=1.1.0 <2.0.0", @@ -1219,11 +1186,6 @@ "from": "destroy@>=1.0.4 <1.1.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" }, - "detect-libc": { - "version": "1.0.3", - "from": "detect-libc@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" - }, "dfa": { "version": "1.2.0", "from": "dfa@>=1.2.0 <2.0.0", @@ -1281,7 +1243,14 @@ "domexception": { "version": "1.0.1", "from": "domexception@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz" + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "dependencies": { + "webidl-conversions": { + "version": "4.0.2", + "from": "webidl-conversions@>=4.0.2 <5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + } + } }, "domhandler": { "version": "2.4.2", @@ -1309,6 +1278,11 @@ "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", "optional": true }, + "duplexify": { + "version": "3.6.0", + "from": "duplexify@3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz" + }, "ecc-jsbn": { "version": "0.1.2", "from": "ecc-jsbn@>=0.1.1 <0.2.0", @@ -1676,9 +1650,9 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" }, "fast-text-encoding": { - "version": "1.0.0", - "from": "fast-text-encoding@1.0.0", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz" + "version": "1.0.3", + "from": "fast-text-encoding@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz" }, "faye": { "version": "1.4.0", @@ -1794,11 +1768,6 @@ "from": "fs-extra@8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz" }, - "fs-minipass": { - "version": "1.2.7", - "from": "fs-minipass@>=1.2.7 <2.0.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz" - }, "fs.realpath": { "version": "1.0.0", "from": "fs.realpath@>=1.0.0 <2.0.0", @@ -1819,18 +1788,6 @@ "from": "functions-have-names@>=1.2.2 <2.0.0", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" }, - "gauge": { - "version": "2.7.4", - "from": "gauge@>=2.7.3 <2.8.0", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "dependencies": { - "strip-ansi": { - "version": "3.0.1", - "from": "strip-ansi@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - } - } - }, "gaxios": { "version": "1.8.4", "from": "gaxios@>=1.0.4 <2.0.0", @@ -1840,21 +1797,6 @@ "version": "2.6.7", "from": "node-fetch@>=2.3.0 <3.0.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - }, - "tr46": { - "version": "0.0.3", - "from": "tr46@>=0.0.3 <0.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - }, - "webidl-conversions": { - "version": "3.0.1", - "from": "webidl-conversions@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - }, - "whatwg-url": { - "version": "5.0.0", - "from": "whatwg-url@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" } } }, @@ -1914,14 +1856,7 @@ "google-p12-pem": { "version": "1.0.5", "from": "google-p12-pem@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.5.tgz", - "dependencies": { - "pify": { - "version": "4.0.1", - "from": "pify@^4.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" - } - } + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.5.tgz" }, "google-tts-api": { "version": "0.0.3", @@ -1933,25 +1868,15 @@ "from": "graceful-fs@>=4.1.0 <5.0.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" }, - "grpc": { - "version": "1.24.6", - "from": "grpc@1.24.6", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.6.tgz" - }, "gtoken": { - "version": "2.3.2", - "from": "gtoken@2.3.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz", + "version": "2.3.3", + "from": "gtoken@>=2.3.2 <3.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz", "dependencies": { "mime": { "version": "2.6.0", "from": "mime@>=2.2.0 <3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz" - }, - "pify": { - "version": "4.0.1", - "from": "pify@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" } } }, @@ -2022,11 +1947,6 @@ "from": "has-tostringtag@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" }, - "has-unicode": { - "version": "2.0.1", - "from": "has-unicode@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" - }, "has-value": { "version": "1.0.0", "from": "has-value@>=1.0.0 <2.0.0", @@ -2119,9 +2039,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" }, "https-proxy-agent": { - "version": "2.2.1", - "from": "https-proxy-agent@2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "version": "2.2.4", + "from": "https-proxy-agent@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", "dependencies": { "debug": { "version": "3.2.7", @@ -2150,11 +2070,6 @@ "from": "ieee754@>=1.1.13 <2.0.0", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" }, - "ignore-walk": { - "version": "3.0.4", - "from": "ignore-walk@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz" - }, "image-size": { "version": "0.7.5", "from": "image-size@>=0.7.3 <0.8.0", @@ -2202,11 +2117,6 @@ "from": "inherits@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" }, - "ini": { - "version": "1.3.8", - "from": "ini@>=1.3.0 <1.4.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" - }, "internal-slot": { "version": "1.0.3", "from": "internal-slot@>=1.0.3 <2.0.0", @@ -2408,6 +2318,11 @@ "from": "is-stream@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" }, + "is-stream-ended": { + "version": "0.1.4", + "from": "is-stream-ended@0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz" + }, "is-string": { "version": "1.0.7", "from": "is-string@>=1.0.5 <2.0.0", @@ -2587,6 +2502,21 @@ "from": "tough-cookie@>=2.4.3 <3.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" }, + "tr46": { + "version": "1.0.1", + "from": "tr46@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" + }, + "webidl-conversions": { + "version": "4.0.2", + "from": "webidl-conversions@>=4.0.2 <5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + }, + "whatwg-url": { + "version": "7.1.0", + "from": "whatwg-url@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" + }, "ws": { "version": "6.2.2", "from": "ws@>=6.0.0 <7.0.0", @@ -2699,19 +2629,7 @@ "kue": { "version": "0.11.6", "from": "kue@0.11.6", - "resolved": "https://registry.npmjs.org/kue/-/kue-0.11.6.tgz", - "dependencies": { - "window-size": { - "version": "0.2.0", - "from": "window-size@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz" - }, - "yargs": { - "version": "4.8.1", - "from": "yargs@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz" - } - } + "resolved": "https://registry.npmjs.org/kue/-/kue-0.11.6.tgz" }, "lazy": { "version": "1.0.11", @@ -2790,7 +2708,14 @@ "load-json-file": { "version": "1.1.0", "from": "load-json-file@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "dependencies": { + "pify": { + "version": "2.3.0", + "from": "pify@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + } + } }, "locate-path": { "version": "5.0.0", @@ -2812,6 +2737,11 @@ "from": "lodash.assignin@>=4.0.9 <5.0.0", "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz" }, + "lodash.at": { + "version": "4.6.0", + "from": "lodash.at@4.6.0", + "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz" + }, "lodash.bind": { "version": "4.2.1", "from": "lodash.bind@>=4.1.4 <5.0.0", @@ -2819,12 +2749,12 @@ }, "lodash.camelcase": { "version": "4.3.0", - "from": "lodash.camelcase@>=4.3.0 <5.0.0", + "from": "lodash.camelcase@4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" }, "lodash.clone": { "version": "4.5.0", - "from": "lodash.clone@>=4.5.0 <5.0.0", + "from": "lodash.clone@4.5.0", "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz" }, "lodash.defaults": { @@ -2857,6 +2787,11 @@ "from": "lodash.get@>=4.4.2 <4.5.0", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz" }, + "lodash.has": { + "version": "4.5.2", + "from": "lodash.has@4.5.2", + "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz" + }, "lodash.includes": { "version": "4.3.0", "from": "lodash.includes@>=4.3.0 <5.0.0", @@ -2942,11 +2877,6 @@ "from": "lodash.unescape@>=4.0.1 <5.0.0", "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz" }, - "long": { - "version": "3.2.0", - "from": "long@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz" - }, "longest": { "version": "1.0.1", "from": "longest@>=1.0.1 <2.0.0", @@ -3093,16 +3023,6 @@ "from": "minimist@>=1.2.6 <2.0.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" }, - "minipass": { - "version": "2.9.0", - "from": "minipass@>=2.9.0 <3.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz" - }, - "minizlib": { - "version": "1.3.3", - "from": "minizlib@>=1.3.3 <2.0.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" - }, "mixin-deep": { "version": "1.3.2", "from": "mixin-deep@>=1.2.0 <2.0.0", @@ -3194,7 +3114,7 @@ }, "nan": { "version": "2.16.0", - "from": "nan@>=2.13.2 <3.0.0", + "from": "nan@>=2.14.0 <3.0.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz" }, "nanomatch": { @@ -3223,7 +3143,7 @@ }, "needle": { "version": "2.9.1", - "from": "needle@>=2.5.0 <3.0.0", + "from": "needle@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", "dependencies": { "debug": { @@ -3295,11 +3215,6 @@ "from": "node-forge@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz" }, - "node-pre-gyp": { - "version": "0.16.0", - "from": "node-pre-gyp@>=0.16.0 <0.17.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.16.0.tgz" - }, "node-redis-scripty": { "version": "0.0.5", "from": "node-redis-scripty@0.0.5", @@ -3436,11 +3351,6 @@ "from": "nodemailer-plugin-inline-base64@2.1.1", "resolved": "https://registry.npmjs.org/nodemailer-plugin-inline-base64/-/nodemailer-plugin-inline-base64-2.1.1.tgz" }, - "nopt": { - "version": "4.0.3", - "from": "nopt@>=4.0.1 <5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz" - }, "normalize-package-data": { "version": "2.5.0", "from": "normalize-package-data@>=2.3.2 <3.0.0", @@ -3456,26 +3366,6 @@ "from": "notepack.io@>=2.1.0 <2.2.0", "resolved": "https://registry.npmjs.org/notepack.io/-/notepack.io-2.1.3.tgz" }, - "npm-bundled": { - "version": "1.1.2", - "from": "npm-bundled@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz" - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "from": "npm-normalize-package-bin@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz" - }, - "npm-packlist": { - "version": "1.4.8", - "from": "npm-packlist@>=1.1.6 <2.0.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz" - }, - "npmlog": { - "version": "4.1.2", - "from": "npmlog@>=4.0.2 <5.0.0", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" - }, "nssocket": { "version": "0.6.0", "from": "nssocket@0.6.0", @@ -3607,31 +3497,11 @@ "from": "optionator@>=0.8.1 <0.9.0", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" }, - "optjs": { - "version": "3.2.2", - "from": "optjs@>=3.2.2 <3.3.0", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz" - }, - "os-homedir": { - "version": "1.0.2", - "from": "os-homedir@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" - }, "os-locale": { "version": "1.4.0", "from": "os-locale@>=1.4.0 <2.0.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz" }, - "os-tmpdir": { - "version": "1.0.2", - "from": "os-tmpdir@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" - }, - "osenv": { - "version": "0.1.5", - "from": "osenv@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz" - }, "p-limit": { "version": "2.3.0", "from": "p-limit@>=2.2.0 <3.0.0", @@ -3745,7 +3615,14 @@ "path-type": { "version": "1.1.0", "from": "path-type@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "dependencies": { + "pify": { + "version": "2.3.0", + "from": "pify@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + } + } }, "pause": { "version": "0.0.1", @@ -3785,9 +3662,9 @@ "resolved": "https://registry.npmjs.org/pidusage/-/pidusage-1.2.0.tgz" }, "pify": { - "version": "2.3.0", - "from": "pify@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + "version": "4.0.1", + "from": "pify@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" }, "pinkie": { "version": "2.0.4", @@ -3979,11 +3856,6 @@ "from": "promptly@2.2.0", "resolved": "https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz" }, - "protobufjs": { - "version": "5.0.3", - "from": "protobufjs@>=5.0.3 <6.0.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz" - }, "proxy-addr": { "version": "2.0.7", "from": "proxy-addr@>=2.0.5 <2.1.0", @@ -4094,11 +3966,6 @@ "from": "raw-body@2.4.0", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz" }, - "rc": { - "version": "1.2.8", - "from": "rc@>=1.2.7 <2.0.0", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" - }, "read": { "version": "1.0.7", "from": "read@>=1.0.4 <2.0.0", @@ -4267,6 +4134,11 @@ "from": "retry-as-promised@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.2.tgz" }, + "retry-request": { + "version": "4.0.0", + "from": "retry-request@4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz" + }, "right-align": { "version": "0.1.3", "from": "right-align@>=0.1.1 <0.2.0", @@ -4381,7 +4253,7 @@ }, "set-blocking": { "version": "2.0.0", - "from": "set-blocking@>=2.0.0 <2.1.0", + "from": "set-blocking@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" }, "set-value": { @@ -4426,11 +4298,6 @@ "from": "side-channel@>=1.0.3 <2.0.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" }, - "signal-exit": { - "version": "3.0.7", - "from": "signal-exit@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" - }, "simple-git": { "version": "1.132.0", "from": "simple-git@1.132.0", @@ -4780,6 +4647,11 @@ "from": "sticky-session@1.1.2", "resolved": "https://registry.npmjs.org/sticky-session/-/sticky-session-1.1.2.tgz" }, + "stream-shift": { + "version": "1.0.1", + "from": "stream-shift@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" + }, "streamsearch": { "version": "0.1.2", "from": "streamsearch@0.1.2", @@ -4827,11 +4699,6 @@ "from": "strip-bom@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" }, - "strip-json-comments": { - "version": "2.0.1", - "from": "strip-json-comments@>=2.0.1 <2.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - }, "stylus": { "version": "0.54.8", "from": "stylus@>=0.54.5 <0.55.0", @@ -4904,18 +4771,6 @@ "from": "systeminformation@3.54.0", "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-3.54.0.tgz" }, - "tar": { - "version": "4.4.19", - "from": "tar@>=4.4.2 <5.0.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "from": "safe-buffer@>=5.2.1 <6.0.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - } - } - }, "tar-stream": { "version": "1.6.2", "from": "tar-stream@>=1.5.0 <2.0.0", @@ -4936,6 +4791,11 @@ "from": "through@>=2.2.7 <3.0.0", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" }, + "through2": { + "version": "2.0.5", + "from": "through2@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + }, "tiff2pdf": { "version": "1.0.2", "from": "tiff2pdf@1.0.2", @@ -5026,16 +4886,9 @@ } }, "tr46": { - "version": "1.0.1", - "from": "tr46@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "dependencies": { - "punycode": { - "version": "2.1.1", - "from": "punycode@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" - } - } + "version": "0.0.3", + "from": "tr46@>=0.0.3 <0.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" }, "tslib": { "version": "2.4.0", @@ -5119,31 +4972,11 @@ "from": "uglify-js@>=2.6.1 <3.0.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "dependencies": { - "camelcase": { - "version": "1.2.1", - "from": "camelcase@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz" - }, - "cliui": { - "version": "2.1.0", - "from": "cliui@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz" - }, "source-map": { "version": "0.5.7", "from": "source-map@>=0.5.1 <0.6.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" }, - "window-size": { - "version": "0.1.0", - "from": "window-size@0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz" - }, - "wordwrap": { - "version": "0.0.2", - "from": "wordwrap@0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" - }, "yargs": { "version": "3.10.0", "from": "yargs@>=3.10.0 <3.11.0", @@ -5487,9 +5320,9 @@ } }, "webidl-conversions": { - "version": "4.0.2", - "from": "webidl-conversions@>=4.0.2 <5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + "version": "3.0.1", + "from": "webidl-conversions@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" }, "websocket-driver": { "version": "0.7.4", @@ -5517,9 +5350,9 @@ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" }, "whatwg-url": { - "version": "7.1.0", - "from": "whatwg-url@>=7.0.0 <8.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" + "version": "5.0.0", + "from": "whatwg-url@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" }, "which": { "version": "1.3.1", @@ -5546,15 +5379,10 @@ "from": "which-typed-array@>=1.1.2 <2.0.0", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz" }, - "wide-align": { - "version": "1.1.5", - "from": "wide-align@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" - }, "window-size": { - "version": "0.1.4", - "from": "window-size@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz" + "version": "0.1.0", + "from": "window-size@0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz" }, "winston": { "version": "2.4.5", @@ -5702,23 +5530,35 @@ }, "y18n": { "version": "3.2.2", - "from": "y18n@>=3.2.0 <4.0.0", + "from": "y18n@>=3.2.1 <4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" }, - "yallist": { - "version": "3.1.1", - "from": "yallist@>=3.1.1 <4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" - }, "yamljs": { "version": "0.3.0", "from": "yamljs@>=0.3.0 <0.4.0", "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz" }, "yargs": { - "version": "3.32.0", - "from": "yargs@>=3.10.0 <4.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz" + "version": "4.8.1", + "from": "yargs@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "dependencies": { + "cliui": { + "version": "3.2.0", + "from": "cliui@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz" + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + }, + "window-size": { + "version": "0.2.0", + "from": "window-size@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz" + } + } }, "yargs-parser": { "version": "2.4.1", diff --git a/package.json b/package.json index 55df9e2..2465c10 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "cron-job-manager": "1.0.7", "crypto-js": "3.1.9-1", "desk.js": "0.1.4", + "duplexify": "^3.6.0", "ejs": "2.7.4", "eml-format": "0.5.0", "entities": "1.1.2", @@ -79,7 +80,6 @@ "fast-text-encoding": "^1.0.0", "fs-extra": "8.1.0", "google-tts-api": "git+https://github.com/xmdevelop/google-tts.git", - "grpc": "1.24.6", "gtoken": "^2.3.2", "html-entities": "2.3.2", "html-to-pdfmake": "2.1.7", @@ -89,6 +89,7 @@ "imap": "0.8.19", "ioredis": "4.17.3", "ipaddr.js": "1.9.1", + "is-stream-ended": "^0.1.4", "jayson": "2.1.2", "jsdom": "12.0.0", "jsforce": "1.9.3", @@ -98,6 +99,10 @@ "juice": "6.0.0", "kue": "0.11.6", "lodash": "4.17.20", + "lodash.at": "^4.6.0", + "lodash.camelcase": "^4.3.0", + "lodash.clone": "^4.5.0", + "lodash.has": "^4.5.2", "lusca": "1.6.1", "mailparser": "2.7.5", "md5": "2.3.0", @@ -121,6 +126,7 @@ "pm2": "2.10.4", "randomstring": "1.1.5", "request-promise": "4.2.6", + "retry-request": "^4.0.0", "rimraf": "2.7.1", "rr": "0.1.0", "seq-queue": "0.0.5", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 502b63c..51f357d 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 _0x2c75=['browser','script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x2c75,0x127));var _0x52c7=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x2c75[_0xfc406a];return _0x395473;};'use strict';var Sequelize=require(_0x52c7('0x0'));module[_0x52c7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xa17760){return this[_0x52c7('0x2')](_0x52c7('0x3'));}},'action':{'type':Sequelize[_0x52c7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x52c7('0x5'),_0x52c7('0x6'),_0x52c7('0x7'),_0x52c7('0x8'),_0x52c7('0x9'),'bot',_0x52c7('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x52c7('0xb')},'data4':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comments':_0x52c7('0xc')},'data5':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comments':_0x52c7('0xd')},'data6':{'type':Sequelize[_0x52c7('0x4')],'comments':_0x52c7('0xe')},'data7':{'type':Sequelize[_0x52c7('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x6722=['contactManager','integration','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0xb38b0,_0x312844){var _0x1f6b89=function(_0x34ccf1){while(--_0x34ccf1){_0xb38b0['push'](_0xb38b0['shift']());}};_0x1f6b89(++_0x312844);}(_0x6722,0x12d));var _0x2672=function(_0x47e80f,_0x38f1f6){_0x47e80f=_0x47e80f-0x0;var _0x4a7fe2=_0x6722[_0x47e80f];return _0x4a7fe2;};'use strict';var Sequelize=require(_0x2672('0x0'));module[_0x2672('0x1')]={'name':{'type':Sequelize[_0x2672('0x2')],'get':function(_0x372687){return this[_0x2672('0x3')]('action');}},'action':{'type':Sequelize[_0x2672('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2672('0x5'),_0x2672('0x6'),_0x2672('0x7'),_0x2672('0x8'),'urlForward',_0x2672('0x9'),_0x2672('0xa'),'script']],'msg':_0x2672('0xb')}},'comment':_0x2672('0xb')},'data1':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xc')},'data2':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xd')},'data3':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xe')},'data4':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':_0x2672('0xf')},'data5':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x2672('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x2672('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3da5555..cc9e7f8 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 _0x4ee1=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','body','destroy','catch'];(function(_0x40af8d,_0x4ba09d){var _0x39d1a9=function(_0x322d56){while(--_0x322d56){_0x40af8d['push'](_0x40af8d['shift']());}};_0x39d1a9(++_0x4ba09d);}(_0x4ee1,0x1ae));var _0x14ee=function(_0x4946b9,_0x4ca322){_0x4946b9=_0x4946b9-0x0;var _0x9cce5e=_0x4ee1[_0x4946b9];return _0x9cce5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14ee('0x0'));var zipdir=require(_0x14ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14ee('0x2'));var moment=require(_0x14ee('0x3'));var BPromise=require(_0x14ee('0x4'));var Mustache=require(_0x14ee('0x5'));var util=require(_0x14ee('0x6'));var path=require(_0x14ee('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14ee('0x8'));var fs=require('fs');var fs_extra=require(_0x14ee('0x9'));var _=require(_0x14ee('0xa'));var squel=require(_0x14ee('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x14ee('0xc'));var toCsv=require(_0x14ee('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x14ee('0xe'));var hardwareService=require(_0x14ee('0xf'));var logger=require(_0x14ee('0x10'))(_0x14ee('0x11'));var utils=require(_0x14ee('0x12'));var config=require(_0x14ee('0x13'));var licenseUtil=require(_0x14ee('0x14'));var db=require(_0x14ee('0x15'))['db'];function respondWithStatusCode(_0x1683af,_0x20564c){_0x20564c=_0x20564c||0xcc;return function(_0x5a68da){if(_0x5a68da){return _0x1683af[_0x14ee('0x16')](_0x20564c);}return _0x1683af[_0x14ee('0x17')](_0x20564c)[_0x14ee('0x18')]();};}function respondWithResult(_0x2d1e52,_0x5d1521){_0x5d1521=_0x5d1521||0xc8;return function(_0x47a755){if(_0x47a755){return _0x2d1e52['status'](_0x5d1521)[_0x14ee('0x19')](_0x47a755);}};}function respondWithFilteredResult(_0x4882c8,_0x40ab08){return function(_0x4cbe4f){if(_0x4cbe4f){var _0x37361b=typeof _0x40ab08['offset']===_0x14ee('0x1a')&&typeof _0x40ab08[_0x14ee('0x1b')]===_0x14ee('0x1a');var _0x184607=_0x4cbe4f[_0x14ee('0x1c')];var _0x3fa71c=_0x37361b?0x0:_0x40ab08[_0x14ee('0x1d')];var _0x2b5983=_0x37361b?_0x4cbe4f[_0x14ee('0x1c')]:_0x40ab08[_0x14ee('0x1d')]+_0x40ab08[_0x14ee('0x1b')];var _0x4758a5;if(_0x2b5983>=_0x184607){_0x2b5983=_0x184607;_0x4758a5=0xc8;}else{_0x4758a5=0xce;}_0x4882c8[_0x14ee('0x17')](_0x4758a5);return _0x4882c8[_0x14ee('0x1e')](_0x14ee('0x1f'),_0x3fa71c+'-'+_0x2b5983+'/'+_0x184607)[_0x14ee('0x19')](_0x4cbe4f);}return null;};}function patchUpdates(_0x530acb){return function(_0x38bc16){try{jsonpatch[_0x14ee('0x20')](_0x38bc16,_0x530acb,!![]);}catch(_0x34d3f7){return BPromise[_0x14ee('0x21')](_0x34d3f7);}return _0x38bc16[_0x14ee('0x22')]();};}function saveUpdates(_0x2afc82,_0x29a392){return function(_0x46bdac){if(_0x46bdac){return _0x46bdac[_0x14ee('0x23')](_0x2afc82)['then'](function(_0x4379be){return _0x4379be;});}return null;};}function removeEntity(_0x116c45,_0x154b45){return function(_0x52315d){if(_0x52315d){return _0x52315d['destroy']()[_0x14ee('0x24')](function(){_0x116c45[_0x14ee('0x17')](0xcc)[_0x14ee('0x18')]();});}};}function handleEntityNotFound(_0x5b5fd2,_0x2083f3){return function(_0x4fd41b){if(!_0x4fd41b){_0x5b5fd2[_0x14ee('0x16')](0x194);}return _0x4fd41b;};}function handleError(_0x397d88,_0x283711){_0x283711=_0x283711||0x1f4;return function(_0x4c3c2d){logger[_0x14ee('0x25')](_0x4c3c2d['stack']);if(_0x4c3c2d[_0x14ee('0x26')]){delete _0x4c3c2d['name'];}_0x397d88[_0x14ee('0x17')](_0x283711)[_0x14ee('0x27')](_0x4c3c2d);};}exports['update']=function(_0x108bac,_0x455744){if(_0x108bac[_0x14ee('0x28')]['id']){delete _0x108bac[_0x14ee('0x28')]['id'];}return db['Action']['find']({'where':{'id':_0x108bac['params']['id']}})['then'](handleEntityNotFound(_0x455744,null))[_0x14ee('0x24')](saveUpdates(_0x108bac[_0x14ee('0x28')],null))[_0x14ee('0x24')](respondWithResult(_0x455744,null))['catch'](handleError(_0x455744,null));};exports[_0x14ee('0x29')]=function(_0x4a2590,_0x54cd6b){return db['Action']['find']({'where':{'id':_0x4a2590['params']['id']}})[_0x14ee('0x24')](handleEntityNotFound(_0x54cd6b,null))[_0x14ee('0x24')](removeEntity(_0x54cd6b,null))[_0x14ee('0x2a')](handleError(_0x54cd6b,null));}; \ No newline at end of file +var _0xc65c=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x424a50,_0x1fd66d){var _0x1427b2=function(_0x35f2a0){while(--_0x35f2a0){_0x424a50['push'](_0x424a50['shift']());}};_0x1427b2(++_0x1fd66d);}(_0xc65c,0x124));var _0xcc65=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xc65c[_0x4ea413];return _0x51cf25;};'use strict';var emlformat=require(_0xcc65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc65('0x1'));var moment=require(_0xcc65('0x2'));var BPromise=require(_0xcc65('0x3'));var Mustache=require(_0xcc65('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcc65('0x5'));var ejs=require(_0xcc65('0x6'));var fs=require('fs');var fs_extra=require(_0xcc65('0x7'));var _=require(_0xcc65('0x8'));var squel=require(_0xcc65('0x9'));var crypto=require(_0xcc65('0xa'));var jsforce=require(_0xcc65('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcc65('0x5'));var querystring=require(_0xcc65('0xc'));var Papa=require(_0xcc65('0xd'));var Redis=require(_0xcc65('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcc65('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc65('0x10'));var logger=require(_0xcc65('0x11'))('api');var utils=require(_0xcc65('0x12'));var config=require(_0xcc65('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc65('0x14'))['db'];function respondWithStatusCode(_0x1fb428,_0xf105aa){_0xf105aa=_0xf105aa||0xcc;return function(_0x1a4aee){if(_0x1a4aee){return _0x1fb428[_0xcc65('0x15')](_0xf105aa);}return _0x1fb428[_0xcc65('0x16')](_0xf105aa)[_0xcc65('0x17')]();};}function respondWithResult(_0x212a2d,_0x3bfd84){_0x3bfd84=_0x3bfd84||0xc8;return function(_0x37c403){if(_0x37c403){return _0x212a2d[_0xcc65('0x16')](_0x3bfd84)['json'](_0x37c403);}};}function respondWithFilteredResult(_0xbc44cf,_0x1d0612){return function(_0x56bb39){if(_0x56bb39){var _0x2ce91e=typeof _0x1d0612[_0xcc65('0x18')]===_0xcc65('0x19')&&typeof _0x1d0612['limit']===_0xcc65('0x19');var _0xe676f7=_0x56bb39[_0xcc65('0x1a')];var _0x16bb3f=_0x2ce91e?0x0:_0x1d0612['offset'];var _0x541eef=_0x2ce91e?_0x56bb39['count']:_0x1d0612['offset']+_0x1d0612[_0xcc65('0x1b')];var _0x104fd8;if(_0x541eef>=_0xe676f7){_0x541eef=_0xe676f7;_0x104fd8=0xc8;}else{_0x104fd8=0xce;}_0xbc44cf[_0xcc65('0x16')](_0x104fd8);return _0xbc44cf[_0xcc65('0x1c')]('Content-Range',_0x16bb3f+'-'+_0x541eef+'/'+_0xe676f7)[_0xcc65('0x1d')](_0x56bb39);}return null;};}function patchUpdates(_0xac8918){return function(_0x456dbe){try{jsonpatch['apply'](_0x456dbe,_0xac8918,!![]);}catch(_0x4ee09c){return BPromise[_0xcc65('0x1e')](_0x4ee09c);}return _0x456dbe[_0xcc65('0x1f')]();};}function saveUpdates(_0x6b36b7,_0x296e71){return function(_0x4c99da){if(_0x4c99da){return _0x4c99da[_0xcc65('0x20')](_0x6b36b7)['then'](function(_0x347d87){return _0x347d87;});}return null;};}function removeEntity(_0x5168d8,_0x37ea5f){return function(_0x5dfd4e){if(_0x5dfd4e){return _0x5dfd4e[_0xcc65('0x21')]()['then'](function(){_0x5168d8[_0xcc65('0x16')](0xcc)[_0xcc65('0x17')]();});}};}function handleEntityNotFound(_0x2d9374,_0x190137){return function(_0x2afc46){if(!_0x2afc46){_0x2d9374[_0xcc65('0x15')](0x194);}return _0x2afc46;};}function handleError(_0x39d57d,_0x1d9b11){_0x1d9b11=_0x1d9b11||0x1f4;return function(_0x2949ec){logger[_0xcc65('0x22')](_0x2949ec[_0xcc65('0x23')]);if(_0x2949ec[_0xcc65('0x24')]){delete _0x2949ec['name'];}_0x39d57d[_0xcc65('0x16')](_0x1d9b11)[_0xcc65('0x25')](_0x2949ec);};}exports[_0xcc65('0x20')]=function(_0x411823,_0x45f444){if(_0x411823[_0xcc65('0x26')]['id']){delete _0x411823[_0xcc65('0x26')]['id'];}return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x411823[_0xcc65('0x29')]['id']}})[_0xcc65('0x2a')](handleEntityNotFound(_0x45f444,null))[_0xcc65('0x2a')](saveUpdates(_0x411823[_0xcc65('0x26')],null))[_0xcc65('0x2a')](respondWithResult(_0x45f444,null))[_0xcc65('0x2b')](handleError(_0x45f444,null));};exports[_0xcc65('0x21')]=function(_0x366c27,_0x63510){return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x366c27[_0xcc65('0x29')]['id']}})['then'](handleEntityNotFound(_0x63510,null))[_0xcc65('0x2a')](removeEntity(_0x63510,null))[_0xcc65('0x2b')](handleError(_0x63510,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index fb43fe0..3a0cdf4 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 _0x1113=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','request-promise','path'];(function(_0x113f61,_0x2d3081){var _0x1e8cf6=function(_0x3dc374){while(--_0x3dc374){_0x113f61['push'](_0x113f61['shift']());}};_0x1e8cf6(++_0x2d3081);}(_0x1113,0x16f));var _0x3111=function(_0x5aedea,_0xf4a7f){_0x5aedea=_0x5aedea-0x0;var _0xe35173=_0x1113[_0x5aedea];return _0xe35173;};'use strict';var _=require('lodash');var util=require(_0x3111('0x0'));var logger=require(_0x3111('0x1'))(_0x3111('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3111('0x3'));var fs=require('fs');var path=require(_0x3111('0x4'));var rimraf=require(_0x3111('0x5'));var config=require(_0x3111('0x6'));var attributes=require(_0x3111('0x7'));module[_0x3111('0x8')]=function(_0x482746,_0x48ba8a){return _0x482746[_0x3111('0x9')](_0x3111('0xa'),attributes,{'tableName':_0x3111('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad58=['exports','Action','lodash','util','../../config/logger','moment','request-promise','rimraf','./action.attributes'];(function(_0x26df5a,_0xda2483){var _0x4e6eee=function(_0x488ddb){while(--_0x488ddb){_0x26df5a['push'](_0x26df5a['shift']());}};_0x4e6eee(++_0xda2483);}(_0xad58,0x1df));var _0x8ad5=function(_0x217832,_0x34fdea){_0x217832=_0x217832-0x0;var _0x5c0a8b=_0xad58[_0x217832];return _0x5c0a8b;};'use strict';var _=require(_0x8ad5('0x0'));var util=require(_0x8ad5('0x1'));var logger=require(_0x8ad5('0x2'))('api');var moment=require(_0x8ad5('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ad5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ad5('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ad5('0x6'));module[_0x8ad5('0x7')]=function(_0x288f6a,_0x46af87){return _0x288f6a['define'](_0x8ad5('0x8'),attributes,{'tableName':'tools_actions','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 a195ef9..21344da 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4975,0x86));var _0x5497=function(_0x2f59c9,_0x1b8c20){_0x2f59c9=_0x2f59c9-0x0;var _0x31c216=_0x4975[_0x2f59c9];return _0x31c216;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2cceac,_0x4f089c){var _0x15ed38=function(_0x326c89){while(--_0x326c89){_0x2cceac['push'](_0x2cceac['shift']());}};_0x15ed38(++_0x4f089c);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 96bde74..2b2d842 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 _0x2218=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x2218,0x1cb));var _0x8221=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x2218[_0x5e1e25];return _0x548e5f;};'use strict';var multer=require(_0x8221('0x0'));var util=require(_0x8221('0x1'));var path=require(_0x8221('0x2'));var timeout=require(_0x8221('0x3'));var express=require(_0x8221('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8221('0x5'));var interaction=require(_0x8221('0x6'));var config=require(_0x8221('0x7'));var controller=require(_0x8221('0x8'));router[_0x8221('0x9')](_0x8221('0xa'),auth[_0x8221('0xb')](),controller[_0x8221('0xc')]);router[_0x8221('0xd')](_0x8221('0xa'),auth[_0x8221('0xb')](),controller[_0x8221('0xe')]);module[_0x8221('0xf')]=router; \ No newline at end of file +var _0x53d9=['fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','multer','path','express','Router'];(function(_0x77d76e,_0x106ed2){var _0x5620c8=function(_0x481b37){while(--_0x481b37){_0x77d76e['push'](_0x77d76e['shift']());}};_0x5620c8(++_0x106ed2);}(_0x53d9,0x188));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x953d('0x0'));var util=require('util');var path=require(_0x953d('0x1'));var timeout=require('connect-timeout');var express=require(_0x953d('0x2'));var router=express[_0x953d('0x3')]();var fs_extra=require(_0x953d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x953d('0x5'));var controller=require(_0x953d('0x6'));router[_0x953d('0x7')](_0x953d('0x8'),auth[_0x953d('0x9')](),controller['update']);router[_0x953d('0xa')](_0x953d('0x8'),auth['isAuthenticated'](),controller[_0x953d('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d06c46a..358e36b 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 _0xda19=['exports','STRING','TEXT'];(function(_0x72ad60,_0x2392a3){var _0x3ebc2e=function(_0x3b6905){while(--_0x3b6905){_0x72ad60['push'](_0x72ad60['shift']());}};_0x3ebc2e(++_0x2392a3);}(_0xda19,0xd5));var _0x9da1=function(_0xcc4dfc,_0x296d80){_0xcc4dfc=_0xcc4dfc-0x0;var _0x377146=_0xda19[_0xcc4dfc];return _0x377146;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1c28a6,_0x5c2381){var _0x5d622e=function(_0x1f39a9){while(--_0x1f39a9){_0x1c28a6['push'](_0x1c28a6['shift']());}};_0x5d622e(++_0x5c2381);}(_0x5fc3,0xa8));var _0x35fc=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x5fc3[_0x211fef];return _0x5447bf;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index db34426..23997a0 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 _0x8254=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','CustomReports','UserProfileResource','destroy','error','name','send','index','AnalyticCustomReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','catch','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','value','parentKey','web','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','MAX(%s)','metric','%s.%s\x20=\x20%s.%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4b817c,_0x8099e3){var _0x5ccf31=function(_0x5c37c5){while(--_0x5c37c5){_0x4b817c['push'](_0x4b817c['shift']());}};_0x5ccf31(++_0x8099e3);}(_0x8254,0x95));var _0x4825=function(_0xb12148,_0xe8d5c1){_0xb12148=_0xb12148-0x0;var _0x4570fd=_0x8254[_0xb12148];return _0x4570fd;};'use strict';var emlformat=require(_0x4825('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4825('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4825('0x2'));var moment=require(_0x4825('0x3'));var BPromise=require(_0x4825('0x4'));var Mustache=require('mustache');var util=require(_0x4825('0x5'));var path=require(_0x4825('0x6'));var sox=require(_0x4825('0x7'));var csv=require(_0x4825('0x8'));var ejs=require(_0x4825('0x9'));var fs=require('fs');var fs_extra=require(_0x4825('0xa'));var _=require('lodash');var squel=require(_0x4825('0xb'));var crypto=require(_0x4825('0xc'));var jsforce=require(_0x4825('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4825('0x8'));var querystring=require(_0x4825('0xe'));var Papa=require(_0x4825('0xf'));var Redis=require(_0x4825('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4825('0x11'));var as=require(_0x4825('0x12'));var hardwareService=require(_0x4825('0x13'));var logger=require('../../config/logger')(_0x4825('0x14'));var utils=require(_0x4825('0x15'));var config=require(_0x4825('0x16'));var licenseUtil=require(_0x4825('0x17'));var db=require(_0x4825('0x18'))['db'];var dbH=require('../../mysqldb')[_0x4825('0x19')];function respondWithStatusCode(_0x37cb62,_0x3d544d){_0x3d544d=_0x3d544d||0xcc;return function(_0x3bc633){if(_0x3bc633){return _0x37cb62[_0x4825('0x1a')](_0x3d544d);}return _0x37cb62[_0x4825('0x1b')](_0x3d544d)[_0x4825('0x1c')]();};}function respondWithResult(_0x1c903c,_0x7ac2e2){_0x7ac2e2=_0x7ac2e2||0xc8;return function(_0x483d0e){if(_0x483d0e){return _0x1c903c[_0x4825('0x1b')](_0x7ac2e2)[_0x4825('0x1d')](_0x483d0e);}};}function respondWithFilteredResult(_0x264845,_0x29628e){return function(_0x5b63d0){if(_0x5b63d0){var _0x52101e=typeof _0x29628e['offset']===_0x4825('0x1e')&&typeof _0x29628e[_0x4825('0x1f')]===_0x4825('0x1e');var _0xfe92ce=_0x5b63d0[_0x4825('0x20')];var _0x3b3a52=_0x52101e?0x0:_0x29628e[_0x4825('0x21')];var _0x1de7ae=_0x52101e?_0x5b63d0['count']:_0x29628e[_0x4825('0x21')]+_0x29628e[_0x4825('0x1f')];var _0xdf1083;if(_0x1de7ae>=_0xfe92ce){_0x1de7ae=_0xfe92ce;_0xdf1083=0xc8;}else{_0xdf1083=0xce;}_0x264845[_0x4825('0x1b')](_0xdf1083);return _0x264845[_0x4825('0x22')](_0x4825('0x23'),_0x3b3a52+'-'+_0x1de7ae+'/'+_0xfe92ce)[_0x4825('0x1d')](_0x5b63d0);}return null;};}function patchUpdates(_0x843363){return function(_0x147b7c){try{jsonpatch[_0x4825('0x24')](_0x147b7c,_0x843363,!![]);}catch(_0x147b1a){return BPromise[_0x4825('0x25')](_0x147b1a);}return _0x147b7c['save']();};}function saveUpdates(_0x53b6cd,_0x45a011){return function(_0x3abcf6){if(_0x3abcf6){return _0x3abcf6[_0x4825('0x26')](_0x53b6cd)[_0x4825('0x27')](function(_0x13bbb6){return _0x13bbb6;});}return null;};}function removeEntity(_0x185d41,_0x2a6890){return function(_0xb9c7cc){if(_0xb9c7cc){return _0xb9c7cc['destroy']()[_0x4825('0x27')](function(){var _0x5027d6=_0xb9c7cc['get']({'plain':!![]});var _0x5585c7=_0x4825('0x28');return db[_0x4825('0x29')][_0x4825('0x2a')]({'where':{'type':_0x5585c7,'resourceId':_0x5027d6['id']}})[_0x4825('0x27')](function(){return _0xb9c7cc;});})[_0x4825('0x27')](function(){_0x185d41[_0x4825('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce5ef,_0x348cea){return function(_0x505a8e){if(!_0x505a8e){_0x5ce5ef[_0x4825('0x1a')](0x194);}return _0x505a8e;};}function handleError(_0x36b5a5,_0x5d0812){_0x5d0812=_0x5d0812||0x1f4;return function(_0x3344d8){logger[_0x4825('0x2b')](_0x3344d8['stack']);if(_0x3344d8['name']){delete _0x3344d8[_0x4825('0x2c')];}_0x36b5a5['status'](_0x5d0812)[_0x4825('0x2d')](_0x3344d8);};}exports[_0x4825('0x2e')]=function(_0x278e61,_0x805e85){var _0x3a2801={},_0x365484={},_0x4b5ba8={'count':0x0,'rows':[]};var _0x310a83=_['map'](db[_0x4825('0x2f')][_0x4825('0x30')],function(_0x22aa67){return{'name':_0x22aa67['fieldName'],'type':_0x22aa67['type']['key']};});_0x365484[_0x4825('0x31')]=_['map'](_0x310a83,'name');_0x365484[_0x4825('0x32')]=_[_0x4825('0x33')](_0x278e61[_0x4825('0x32')]);_0x365484['filters']=_[_0x4825('0x34')](_0x365484[_0x4825('0x31')],_0x365484[_0x4825('0x32')]);_0x3a2801[_0x4825('0x35')]=_[_0x4825('0x34')](_0x365484[_0x4825('0x31')],qs['fields'](_0x278e61['query'][_0x4825('0x36')]));_0x3a2801[_0x4825('0x35')]=_0x3a2801['attributes'][_0x4825('0x37')]?_0x3a2801['attributes']:_0x365484[_0x4825('0x31')];if(!_0x278e61[_0x4825('0x32')][_0x4825('0x38')]('nolimit')){_0x3a2801[_0x4825('0x1f')]=qs[_0x4825('0x1f')](_0x278e61[_0x4825('0x32')]['limit']);_0x3a2801[_0x4825('0x21')]=qs[_0x4825('0x21')](_0x278e61['query'][_0x4825('0x21')]);}_0x3a2801[_0x4825('0x39')]=qs[_0x4825('0x3a')](_0x278e61[_0x4825('0x32')][_0x4825('0x3a')]);_0x3a2801[_0x4825('0x3b')]=qs[_0x4825('0x3c')](_[_0x4825('0x3d')](_0x278e61[_0x4825('0x32')],_0x365484[_0x4825('0x3c')]),_0x310a83);if(_0x278e61[_0x4825('0x32')][_0x4825('0x3e')]){_0x3a2801[_0x4825('0x3b')]=_[_0x4825('0x3f')](_0x3a2801[_0x4825('0x3b')],{'$or':_[_0x4825('0x40')](_0x310a83,function(_0x313ea8){if(_0x313ea8[_0x4825('0x41')]!==_0x4825('0x42')){var _0x39d285={};_0x39d285[_0x313ea8[_0x4825('0x2c')]]={'$like':'%'+_0x278e61[_0x4825('0x32')][_0x4825('0x3e')]+'%'};return _0x39d285;}})});}_0x3a2801=_[_0x4825('0x3f')]({},_0x3a2801,_0x278e61[_0x4825('0x43')]);var _0xbbd5f0={'where':_0x3a2801[_0x4825('0x3b')]};return db[_0x4825('0x2f')][_0x4825('0x20')](_0xbbd5f0)[_0x4825('0x27')](function(_0x4133b9){_0x4b5ba8[_0x4825('0x20')]=_0x4133b9;if(_0x278e61[_0x4825('0x32')][_0x4825('0x44')]){_0x3a2801['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4825('0x45')](_0x3a2801);})[_0x4825('0x27')](function(_0x439f5e){_0x4b5ba8[_0x4825('0x46')]=_0x439f5e;return _0x4b5ba8;})['then'](respondWithFilteredResult(_0x805e85,_0x3a2801))['catch'](handleError(_0x805e85,null));};exports[_0x4825('0x47')]=function(_0x3fa83b,_0xb480f){var _0x44eeb8={'raw':![],'where':{'id':_0x3fa83b[_0x4825('0x48')]['id']}},_0x7c57d9={};_0x7c57d9[_0x4825('0x31')]=_[_0x4825('0x33')](db['AnalyticCustomReport'][_0x4825('0x30')]);_0x7c57d9[_0x4825('0x32')]=_[_0x4825('0x33')](_0x3fa83b[_0x4825('0x32')]);_0x7c57d9['filters']=_['intersection'](_0x7c57d9[_0x4825('0x31')],_0x7c57d9[_0x4825('0x32')]);_0x44eeb8['attributes']=_['intersection'](_0x7c57d9[_0x4825('0x31')],qs[_0x4825('0x36')](_0x3fa83b[_0x4825('0x32')][_0x4825('0x36')]));_0x44eeb8[_0x4825('0x35')]=_0x44eeb8['attributes'][_0x4825('0x37')]?_0x44eeb8[_0x4825('0x35')]:_0x7c57d9[_0x4825('0x31')];if(_0x3fa83b[_0x4825('0x32')][_0x4825('0x44')]){_0x44eeb8[_0x4825('0x49')]=[{'all':!![]}];}_0x44eeb8=_[_0x4825('0x3f')]({},_0x44eeb8,_0x3fa83b['options']);return db[_0x4825('0x2f')][_0x4825('0x4a')](_0x44eeb8)[_0x4825('0x27')](handleEntityNotFound(_0xb480f,null))['then'](respondWithResult(_0xb480f,null))['catch'](handleError(_0xb480f,null));};exports['create']=function(_0x769163,_0x13ccb1){return db[_0x4825('0x2f')][_0x4825('0x4b')](_0x769163['body'],{})['then'](function(_0x84358a){var _0x31cdde=_0x769163[_0x4825('0x4c')][_0x4825('0x4d')]({'plain':!![]});if(!_0x31cdde)throw new Error(_0x4825('0x4e'));if(_0x31cdde[_0x4825('0x4f')]===_0x4825('0x4c')){var _0x4fa7b3=_0x84358a[_0x4825('0x4d')]({'plain':!![]});var _0xf8eaf1=_0x4825('0x50');return db['UserProfileSection'][_0x4825('0x4a')]({'where':{'name':_0xf8eaf1,'userProfileId':_0x31cdde[_0x4825('0x51')]},'raw':!![]})[_0x4825('0x27')](function(_0x337d63){if(_0x337d63&&_0x337d63['autoAssociation']===0x0){return db[_0x4825('0x29')][_0x4825('0x4b')]({'name':_0x4fa7b3[_0x4825('0x2c')],'resourceId':_0x4fa7b3['id'],'type':_0x4825('0x28'),'sectionId':_0x337d63['id']},{})[_0x4825('0x27')](function(){return _0x84358a;});}else{return _0x84358a;}})['catch'](function(_0x52d70d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52d70d);throw _0x52d70d;});}return _0x84358a;})[_0x4825('0x27')](respondWithResult(_0x13ccb1,0xc9))[_0x4825('0x52')](handleError(_0x13ccb1,null));};exports[_0x4825('0x26')]=function(_0x1dbe4a,_0x32dd8e){if(_0x1dbe4a[_0x4825('0x53')]['id']){delete _0x1dbe4a['body']['id'];}return db[_0x4825('0x2f')][_0x4825('0x4a')]({'where':{'id':_0x1dbe4a[_0x4825('0x48')]['id']}})[_0x4825('0x27')](handleEntityNotFound(_0x32dd8e,null))[_0x4825('0x27')](saveUpdates(_0x1dbe4a['body'],null))[_0x4825('0x27')](respondWithResult(_0x32dd8e,null))[_0x4825('0x52')](handleError(_0x32dd8e,null));};exports['destroy']=function(_0x39dc7e,_0x163464){return db[_0x4825('0x2f')][_0x4825('0x4a')]({'where':{'id':_0x39dc7e['params']['id']}})[_0x4825('0x27')](handleEntityNotFound(_0x163464,null))[_0x4825('0x27')](removeEntity(_0x163464,null))[_0x4825('0x52')](handleError(_0x163464,null));};exports[_0x4825('0x54')]=function(_0x4bd836,_0x28a474){var _0x14834f=0xa;var _0x29b98b=[_0x4825('0x55'),'left_join',_0x4825('0x56'),_0x4825('0x57')];var _0x54882f={'SUM':_0x4825('0x58'),'COUNT':_0x4825('0x59'),'COUNT DISTINCT':_0x4825('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4825('0x5d')};var _0x31aec7={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x427b9b=function(_0x2f2405){return!_[_0x4825('0x63')](['IS\x20NULL',_0x4825('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2f2405);};var _0x3e5d3f=function(_0xac2ab6){if(!_0xac2ab6||!_0xac2ab6[_0x4825('0x65')][_0x4825('0x37')]){return'';}for(var _0x3bb0f3='(',_0x1d2a4d=0x0;_0x1d2a4d<_0xac2ab6[_0x4825('0x65')][_0x4825('0x37')];_0x1d2a4d+=0x1){_0x1d2a4d>0x0&&(_0x3bb0f3+='\x20'+_0xac2ab6[_0x4825('0x66')]+'\x20');_0x3bb0f3+=_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x67')]?_0x3e5d3f(_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['group']):_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x68')]+'\x20'+_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x69')]+(_0x427b9b(_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['condition'])?'\x20'+_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['value']:'');}return _0x3bb0f3+')';};var _0x25b04c={'where':{'id':_0x4bd836[_0x4825('0x48')]['id']}},_0x16e9e2,_0x321136,_0xf1edb1,_0x193ac0,_0x25509a;_0x25b04c=_[_0x4825('0x3f')]({},_0x25b04c,_0x4bd836[_0x4825('0x43')]);return db[_0x4825('0x2f')]['find'](_0x25b04c)['then'](function(_0x42854a){if(_0x42854a){_0x16e9e2=_0x42854a;return _0x42854a[_0x4825('0x6a')]();}return null;})[_0x4825('0x27')](function(_0x53e86d){if(_0x53e86d){if(!_0x53e86d['length']){throw new db[(_0x4825('0x6b'))][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x321136=_0x53e86d;return db[_0x4825('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x5a3178){if(_0x5a3178){_0xf1edb1=_[_0x4825('0x6f')](_0x5a3178,'id');var _0x51ec41;var _0x4a6b1f=squel[_0x4825('0x70')]();_0x4a6b1f[_0x4825('0x71')](_0x16e9e2[_0x4825('0x72')]);for(var _0x5b6b03=0x0;_0x5b6b03<_0x321136[_0x4825('0x37')];_0x5b6b03+=0x1){_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x73')]?_0xf1edb1[_0x321136[_0x5b6b03]['MetricId']]['metric']:_0x321136[_0x5b6b03]['field'];_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x74')]?_['replace'](_0x54882f[_0x321136[_0x5b6b03][_0x4825('0x74')]],'%s',_0x51ec41):_0x51ec41;_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x75')]?_[_0x4825('0x76')](_0x31aec7[_0x321136[_0x5b6b03][_0x4825('0x75')]],'%s',_0x51ec41):_0x51ec41;if(_0x321136[_0x5b6b03][_0x4825('0x77')]){_0x4a6b1f[_0x4825('0x67')](_0x51ec41);}_0x321136[_0x5b6b03][_0x4825('0x78')]&&_0x4a6b1f[_0x4825('0x39')](_0x51ec41,_0x321136[_0x5b6b03][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x4a6b1f['field'](_0x51ec41,_0x321136[_0x5b6b03][_0x4825('0x7a')]||_0x51ec41);}if(_0x16e9e2['joins']){_0x16e9e2[_0x4825('0x7b')]=JSON[_0x4825('0x7c')](_0x16e9e2[_0x4825('0x7b')]);for(var _0x3cec21=0x0;_0x3cec21<_0x16e9e2['joins'][_0x4825('0x37')];_0x3cec21+=0x1){if(_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x29b98b,_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['type'])&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['parentKey']&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x7d')]&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['foreignKey']){_0x4a6b1f[_0x16e9e2['joins'][_0x3cec21][_0x4825('0x41')]](_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x16e9e2['table'],_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['parentKey'],_0x16e9e2['joins'][_0x3cec21][_0x4825('0x7d')],_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x7e')]));}}}if(_0x16e9e2[_0x4825('0x7f')]){_0x16e9e2[_0x4825('0x7f')]=JSON['parse'](_0x16e9e2[_0x4825('0x7f')]);_0x4a6b1f['where'](_0x3e5d3f(_0x16e9e2[_0x4825('0x7f')]['group']));}_0x25509a=_0x4a6b1f[_0x4825('0x80')]();_0x4a6b1f[_0x4825('0x1f')](_0x14834f);_0x4a6b1f[_0x4825('0x21')](0x0);logger[_0x4825('0x81')](_0x4825('0x82'),_0x4a6b1f[_0x4825('0x83')]());return dbH['sequelize'][_0x4825('0x32')](_0x4a6b1f[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')]['QueryTypes'][_0x4825('0x85')]});}})[_0x4825('0x27')](respondWithResult(_0x28a474,null))[_0x4825('0x52')](handleError(_0x28a474,null));};function runReport(_0x664198,_0x44f8a1,_0xf9487b){var _0x5e703e=_0x44f8a1[_0x4825('0x2c')];var _0x257248=0xa;var _0x5ca46f=[_0x4825('0x55'),_0x4825('0x86'),_0x4825('0x56'),_0x4825('0x57')];var _0x2025a0={'SUM':_0x4825('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4825('0x5a'),'MAX':'MAX(%s)','MIN':_0x4825('0x87'),'AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':_0x4825('0x88'),'GROUP_CONCAT DESC':_0x4825('0x5d')};var _0x2cccf2={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x4284fc=function(_0x567c86){return!_['includes']([_0x4825('0x89'),_0x4825('0x64'),_0x4825('0x8a'),_0x4825('0x8b')],_0x567c86);};var _0x44a7a5=function(_0x113aec){if(!_0x113aec||!_0x113aec['rules'][_0x4825('0x37')]){return'';}for(var _0x51e687='(',_0x4c803c=0x0;_0x4c803c<_0x113aec[_0x4825('0x65')][_0x4825('0x37')];_0x4c803c+=0x1){_0x4c803c>0x0&&(_0x51e687+='\x20'+_0x113aec[_0x4825('0x66')]+'\x20');_0x51e687+=_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x67')]?_0x44a7a5(_0x113aec[_0x4825('0x65')][_0x4c803c]['group']):_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x68')]+'\x20'+_0x113aec['rules'][_0x4c803c][_0x4825('0x69')]+(_0x4284fc(_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x69')])?'\x20'+_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x8c')]:'');}return _0x51e687+')';};var _0x2e2ae9={'where':{'id':_0x664198['id']}},_0x24c83b,_0x221de7,_0x5055c5,_0x4bd0a2,_0x11356d;_0x2e2ae9=_[_0x4825('0x3f')]({},_0x2e2ae9,_0xf9487b);return db[_0x4825('0x2f')]['find'](_0x2e2ae9)[_0x4825('0x27')](function(_0x1b83dd){if(_0x1b83dd){_0x24c83b=_0x1b83dd;return _0x1b83dd['getFields']();}return null;})['then'](function(_0x13c874){if(_0x13c874){if(!_0x13c874[_0x4825('0x37')]){throw new db[(_0x4825('0x6b'))][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x221de7=_0x13c874;return db['AnalyticMetric'][_0x4825('0x45')]({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x583cd1){if(_0x583cd1){_0x5055c5=_[_0x4825('0x6f')](_0x583cd1,'id');var _0x2784ba;var _0x5c2164=squel[_0x4825('0x70')]();_0x5c2164[_0x4825('0x71')](_0x24c83b['table']);for(var _0x1c8ce1=0x0;_0x1c8ce1<_0x221de7[_0x4825('0x37')];_0x1c8ce1+=0x1){_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x73')]?_0x5055c5[_0x221de7[_0x1c8ce1][_0x4825('0x73')]]['metric']:_0x221de7[_0x1c8ce1][_0x4825('0x68')];_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x74')]?_['replace'](_0x2025a0[_0x221de7[_0x1c8ce1][_0x4825('0x74')]],'%s',_0x2784ba):_0x2784ba;_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x75')]?_['replace'](_0x2cccf2[_0x221de7[_0x1c8ce1]['format']],'%s',_0x2784ba):_0x2784ba;if(_0x221de7[_0x1c8ce1][_0x4825('0x77')]){_0x5c2164['group'](_0x2784ba);}_0x221de7[_0x1c8ce1][_0x4825('0x78')]&&_0x5c2164[_0x4825('0x39')](_0x2784ba,_0x221de7[_0x1c8ce1][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x5c2164['field'](_0x2784ba,_0x221de7[_0x1c8ce1][_0x4825('0x7a')]||_0x2784ba);}if(_0x24c83b['joins']){_0x24c83b['joins']=JSON[_0x4825('0x7c')](_0x24c83b[_0x4825('0x7b')]);for(var _0x580585=0x0;_0x580585<_0x24c83b[_0x4825('0x7b')][_0x4825('0x37')];_0x580585+=0x1){if(_0x24c83b['joins'][_0x580585][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x5ca46f,_0x24c83b['joins'][_0x580585][_0x4825('0x41')])&&_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x8d')]&&_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7d')]&&_0x24c83b[_0x4825('0x7b')][_0x580585]['foreignKey']){_0x5c2164[_0x24c83b[_0x4825('0x7b')][_0x580585]['type']](_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7d')],null,util[_0x4825('0x75')]('%s.%s\x20=\x20%s.%s',_0x24c83b[_0x4825('0x72')],_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x8d')],_0x24c83b['joins'][_0x580585][_0x4825('0x7d')],_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7e')]));}}}if(_0x24c83b[_0x4825('0x7f')]){_0x24c83b[_0x4825('0x7f')]=JSON['parse'](_0x24c83b['conditions']);_0x5c2164['where'](_0x44a7a5(_0x24c83b[_0x4825('0x7f')][_0x4825('0x67')]));}_0x11356d=_0x5c2164[_0x4825('0x80')]();_0x5c2164['limit'](_0x257248);_0x5c2164['offset'](0x0);return;}})[_0x4825('0x27')](function(){if(_0x44f8a1['output']===_0x4825('0x8e')){return null;}var _0x2dc4df=_[_0x4825('0x3f')](_0x44f8a1,{'name':_0x44f8a1['fullPath']||_0x44f8a1['name']||_0x24c83b[_0x4825('0x2c')],'basename':_0x5e703e,'savename':util[_0x4825('0x75')](_0x4825('0x8f'),_0x44f8a1[_0x4825('0x2c')]||_0x24c83b[_0x4825('0x2c')],require(_0x4825('0x90'))[_0x4825('0x91')](0x4),_0x44f8a1[_0x4825('0x92')]||_0x4825('0x93')),'reportId':_0x24c83b['id'],'reportType':_0x4825('0x94')});return db[_0x4825('0x95')][_0x4825('0x4b')](_0x2dc4df,{'raw':!![]});})[_0x4825('0x27')](function(_0x1ae768){if(_0x24c83b[_0x4825('0x72')]===_0x4825('0x96')){_0x11356d[_0x4825('0x3b')](_0x24c83b[_0x4825('0x72')]+_0x4825('0x97'),_0x44f8a1[_0x4825('0x98')],_0x44f8a1[_0x4825('0x99')]);}else{_0x11356d['where'](_0x24c83b[_0x4825('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x44f8a1[_0x4825('0x98')],_0x44f8a1[_0x4825('0x99')]);}if(_0x1ae768){logger[_0x4825('0x9a')]('Run\x20Query:',_0x11356d['toString']());require(_0x4825('0x9b'))[_0x4825('0x9c')](path[_0x4825('0x55')](__dirname,_0x4825('0x9d'),_0x1ae768[_0x4825('0x92')]),[_0x1ae768['id'],_0x11356d[_0x4825('0x83')](),path[_0x4825('0x55')](__dirname,_0x4825('0x9e'),_0x1ae768[_0x4825('0x9f')]),_0x5e703e]);return _0x1ae768;}else{var _0x1a63c7=squel['select']();_0x1a63c7[_0x4825('0x71')]('('+_0x11356d['toString']()+')',_0x4825('0xa0'));_0x1a63c7[_0x4825('0x68')](_0x4825('0xa1'),_0x4825('0x20'));_0x11356d['limit'](_0x44f8a1[_0x4825('0x1f')]||_0x257248);_0x11356d[_0x4825('0x21')](_0x44f8a1['offset']||0x0);return dbH[_0x4825('0x84')]['query'](_0x1a63c7[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')]['QueryTypes'][_0x4825('0x85')]})['then'](function(_0xe3bba){if(!_0xe3bba['length']){_0x4bd0a2=0x0;}else{_0x4bd0a2=_0xe3bba[0x0][_0x4825('0x20')]||0x0;}return dbH[_0x4825('0x84')][_0x4825('0x32')](_0x11356d[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')][_0x4825('0xa2')][_0x4825('0x85')]});})[_0x4825('0x27')](function(_0x4073cf){return{'rows':_0x4073cf||[],'count':_0x4bd0a2};});}});}exports[_0x4825('0xa3')]=function(_0x3d6e76,_0xaf1048){return runReport(_0x3d6e76['params'],_0x3d6e76[_0x4825('0x32')],_0x3d6e76[_0x4825('0x43')])[_0x4825('0x27')](respondWithResult(_0xaf1048,null))[_0x4825('0x52')](handleError(_0xaf1048,null));};exports[_0x4825('0xa4')]=runReport;exports[_0x4825('0x32')]=function(_0x1ccb72,_0x53d9c7){var _0x31d02e=0xa;var _0x435592=[_0x4825('0x55'),_0x4825('0x86'),_0x4825('0x56'),'cross_join'];var _0x428df7={'SUM':_0x4825('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4825('0x5a'),'MAX':_0x4825('0xa5'),'MIN':_0x4825('0x87'),'AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':_0x4825('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21f97b={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x4d43af=function(_0x8bfa67){return!_[_0x4825('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4825('0x8a'),_0x4825('0x8b')],_0x8bfa67);};var _0x53bfe7=function(_0x1bb77c){if(!_0x1bb77c||!_0x1bb77c[_0x4825('0x65')][_0x4825('0x37')]){return'';}for(var _0x4e398c='(',_0x9bf3df=0x0;_0x9bf3df<_0x1bb77c[_0x4825('0x65')][_0x4825('0x37')];_0x9bf3df+=0x1){_0x9bf3df>0x0&&(_0x4e398c+='\x20'+_0x1bb77c[_0x4825('0x66')]+'\x20');_0x4e398c+=_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x67')]?_0x53bfe7(_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x67')]):_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x68')]+'\x20'+_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x69')]+(_0x4d43af(_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x69')])?'\x20'+_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x8c')]:'');}return _0x4e398c+')';};var _0x3a91c7={'where':{'id':_0x1ccb72[_0x4825('0x48')]['id']}},_0x4203ed,_0x10c1b9,_0x39a714,_0x20b212,_0xf4efab;_0x3a91c7=_[_0x4825('0x3f')]({},_0x3a91c7,_0x1ccb72['options']);return db[_0x4825('0x2f')][_0x4825('0x4a')](_0x3a91c7)['then'](function(_0xd78be1){if(_0xd78be1){_0x4203ed=_0xd78be1;return _0xd78be1[_0x4825('0x6a')]();}return null;})[_0x4825('0x27')](function(_0x40efcd){if(_0x40efcd){if(!_0x40efcd[_0x4825('0x37')]){throw new db['Sequelize'][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x10c1b9=_0x40efcd;return db[_0x4825('0x6e')][_0x4825('0x45')]({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x286560){if(_0x286560){_0x39a714=_[_0x4825('0x6f')](_0x286560,'id');var _0x845681;var _0x11266a=squel['select']();_0x11266a['from'](_0x4203ed[_0x4825('0x72')]);for(var _0x44408b=0x0;_0x44408b<_0x10c1b9[_0x4825('0x37')];_0x44408b+=0x1){_0x845681=_0x10c1b9[_0x44408b][_0x4825('0x73')]?_0x39a714[_0x10c1b9[_0x44408b]['MetricId']][_0x4825('0xa6')]:_0x10c1b9[_0x44408b][_0x4825('0x68')];_0x845681=_0x10c1b9[_0x44408b][_0x4825('0x74')]?_[_0x4825('0x76')](_0x428df7[_0x10c1b9[_0x44408b][_0x4825('0x74')]],'%s',_0x845681):_0x845681;_0x845681=_0x10c1b9[_0x44408b]['format']?_['replace'](_0x21f97b[_0x10c1b9[_0x44408b][_0x4825('0x75')]],'%s',_0x845681):_0x845681;if(_0x10c1b9[_0x44408b][_0x4825('0x77')]){_0x11266a[_0x4825('0x67')](_0x845681);}_0x10c1b9[_0x44408b]['orderBy']&&_0x11266a['order'](_0x845681,_0x10c1b9[_0x44408b][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x11266a[_0x4825('0x68')](_0x845681,_0x10c1b9[_0x44408b]['alias']||_0x845681);}if(_0x4203ed['joins']){_0x4203ed[_0x4825('0x7b')]=JSON[_0x4825('0x7c')](_0x4203ed[_0x4825('0x7b')]);for(var _0x5beb28=0x0;_0x5beb28<_0x4203ed[_0x4825('0x7b')][_0x4825('0x37')];_0x5beb28+=0x1){if(_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x435592,_0x4203ed[_0x4825('0x7b')][_0x5beb28]['type'])&&_0x4203ed[_0x4825('0x7b')][_0x5beb28]['parentKey']&&_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')]&&_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7e')]){_0x11266a[_0x4203ed['joins'][_0x5beb28][_0x4825('0x41')]](_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')],null,util['format'](_0x4825('0xa7'),_0x4203ed[_0x4825('0x72')],_0x4203ed['joins'][_0x5beb28]['parentKey'],_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')],_0x4203ed['joins'][_0x5beb28][_0x4825('0x7e')]));}}}if(_0x4203ed[_0x4825('0x7f')]){_0x4203ed[_0x4825('0x7f')]=JSON[_0x4825('0x7c')](_0x4203ed[_0x4825('0x7f')]);_0x11266a[_0x4825('0x3b')](_0x53bfe7(_0x4203ed[_0x4825('0x7f')][_0x4825('0x67')]));}_0xf4efab=_0x11266a[_0x4825('0x80')]();_0x11266a[_0x4825('0x1f')](_0x31d02e);_0x11266a['offset'](0x0);logger[_0x4825('0x81')](_0x4825('0x82'),_0x11266a['toString']());return dbH[_0x4825('0x84')][_0x4825('0x32')](_0x11266a[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')][_0x4825('0xa2')][_0x4825('0x85')]});}})[_0x4825('0x27')](function(){return{'sql':_0xf4efab['toString']()};})[_0x4825('0x27')](respondWithResult(_0x53d9c7,null))[_0x4825('0x52')](handleError(_0x53d9c7,null));}; \ No newline at end of file +var _0x0cef=['SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','group','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20EMPTY','table','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','toString','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','metric','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','role','CustomReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0x450e1f,_0x485e1d){var _0x167d06=function(_0x1edd10){while(--_0x1edd10){_0x450e1f['push'](_0x450e1f['shift']());}};_0x167d06(++_0x485e1d);}(_0x0cef,0xe0));var _0xf0ce=function(_0x45adaf,_0x21c3c1){_0x45adaf=_0x45adaf-0x0;var _0x15d189=_0x0cef[_0x45adaf];return _0x15d189;};'use strict';var emlformat=require(_0xf0ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ce('0x1'));var jsonpatch=require(_0xf0ce('0x2'));var rp=require(_0xf0ce('0x3'));var moment=require(_0xf0ce('0x4'));var BPromise=require(_0xf0ce('0x5'));var Mustache=require(_0xf0ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf0ce('0x7'));var csv=require(_0xf0ce('0x8'));var ejs=require(_0xf0ce('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ce('0xa'));var _=require('lodash');var squel=require(_0xf0ce('0xb'));var crypto=require(_0xf0ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0ce('0xd'));var toCsv=require(_0xf0ce('0x8'));var querystring=require(_0xf0ce('0xe'));var Papa=require(_0xf0ce('0xf'));var Redis=require(_0xf0ce('0x10'));var authService=require(_0xf0ce('0x11'));var qs=require(_0xf0ce('0x12'));var as=require(_0xf0ce('0x13'));var hardwareService=require(_0xf0ce('0x14'));var logger=require(_0xf0ce('0x15'))('api');var utils=require(_0xf0ce('0x16'));var config=require(_0xf0ce('0x17'));var licenseUtil=require(_0xf0ce('0x18'));var db=require(_0xf0ce('0x19'))['db'];var dbH=require(_0xf0ce('0x19'))['dbH'];function respondWithStatusCode(_0x599ff9,_0x1a5a6a){_0x1a5a6a=_0x1a5a6a||0xcc;return function(_0x430181){if(_0x430181){return _0x599ff9[_0xf0ce('0x1a')](_0x1a5a6a);}return _0x599ff9['status'](_0x1a5a6a)[_0xf0ce('0x1b')]();};}function respondWithResult(_0x2f4915,_0x544c55){_0x544c55=_0x544c55||0xc8;return function(_0x130661){if(_0x130661){return _0x2f4915[_0xf0ce('0x1c')](_0x544c55)[_0xf0ce('0x1d')](_0x130661);}};}function respondWithFilteredResult(_0x2300fe,_0x5c053c){return function(_0x3612ef){if(_0x3612ef){var _0x4a34ff=typeof _0x5c053c['offset']===_0xf0ce('0x1e')&&typeof _0x5c053c[_0xf0ce('0x1f')]==='undefined';var _0xd4e389=_0x3612ef[_0xf0ce('0x20')];var _0x7d1dac=_0x4a34ff?0x0:_0x5c053c[_0xf0ce('0x21')];var _0x4d7ce8=_0x4a34ff?_0x3612ef['count']:_0x5c053c[_0xf0ce('0x21')]+_0x5c053c[_0xf0ce('0x1f')];var _0x485a91;if(_0x4d7ce8>=_0xd4e389){_0x4d7ce8=_0xd4e389;_0x485a91=0xc8;}else{_0x485a91=0xce;}_0x2300fe[_0xf0ce('0x1c')](_0x485a91);return _0x2300fe[_0xf0ce('0x22')]('Content-Range',_0x7d1dac+'-'+_0x4d7ce8+'/'+_0xd4e389)['json'](_0x3612ef);}return null;};}function patchUpdates(_0x12bc04){return function(_0x3bc652){try{jsonpatch[_0xf0ce('0x23')](_0x3bc652,_0x12bc04,!![]);}catch(_0x5d1db5){return BPromise[_0xf0ce('0x24')](_0x5d1db5);}return _0x3bc652[_0xf0ce('0x25')]();};}function saveUpdates(_0x594015,_0x419999){return function(_0x126177){if(_0x126177){return _0x126177['update'](_0x594015)[_0xf0ce('0x26')](function(_0x50006e){return _0x50006e;});}return null;};}function removeEntity(_0x429f72,_0x3c637b){return function(_0x43d03a){if(_0x43d03a){return _0x43d03a['destroy']()[_0xf0ce('0x26')](function(){var _0x27ed97=_0x43d03a[_0xf0ce('0x27')]({'plain':!![]});var _0x55a42b='CustomReports';return db[_0xf0ce('0x28')]['destroy']({'where':{'type':_0x55a42b,'resourceId':_0x27ed97['id']}})['then'](function(){return _0x43d03a;});})[_0xf0ce('0x26')](function(){_0x429f72['status'](0xcc)[_0xf0ce('0x1b')]();});}};}function handleEntityNotFound(_0x280730,_0x501f1d){return function(_0xac6e5){if(!_0xac6e5){_0x280730[_0xf0ce('0x1a')](0x194);}return _0xac6e5;};}function handleError(_0x15505b,_0x1a796f){_0x1a796f=_0x1a796f||0x1f4;return function(_0x40533c){logger[_0xf0ce('0x29')](_0x40533c[_0xf0ce('0x2a')]);if(_0x40533c[_0xf0ce('0x2b')]){delete _0x40533c['name'];}_0x15505b[_0xf0ce('0x1c')](_0x1a796f)[_0xf0ce('0x2c')](_0x40533c);};}exports['index']=function(_0x57cc29,_0x3ddd44){var _0x1032f1={},_0x2ecf58={},_0x307875={'count':0x0,'rows':[]};var _0x308603=_['map'](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')],function(_0x112c66){return{'name':_0x112c66['fieldName'],'type':_0x112c66[_0xf0ce('0x2f')][_0xf0ce('0x30')]};});_0x2ecf58[_0xf0ce('0x31')]=_[_0xf0ce('0x32')](_0x308603,_0xf0ce('0x2b'));_0x2ecf58[_0xf0ce('0x33')]=_[_0xf0ce('0x34')](_0x57cc29[_0xf0ce('0x33')]);_0x2ecf58[_0xf0ce('0x35')]=_['intersection'](_0x2ecf58[_0xf0ce('0x31')],_0x2ecf58[_0xf0ce('0x33')]);_0x1032f1[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x2ecf58[_0xf0ce('0x31')],qs['fields'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x1032f1[_0xf0ce('0x36')]=_0x1032f1[_0xf0ce('0x36')][_0xf0ce('0x39')]?_0x1032f1[_0xf0ce('0x36')]:_0x2ecf58[_0xf0ce('0x31')];if(!_0x57cc29['query']['hasOwnProperty']('nolimit')){_0x1032f1[_0xf0ce('0x1f')]=qs['limit'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x1f')]);_0x1032f1[_0xf0ce('0x21')]=qs[_0xf0ce('0x21')](_0x57cc29['query'][_0xf0ce('0x21')]);}_0x1032f1[_0xf0ce('0x3a')]=qs[_0xf0ce('0x3b')](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3b')]);_0x1032f1[_0xf0ce('0x3c')]=qs[_0xf0ce('0x35')](_[_0xf0ce('0x3d')](_0x57cc29[_0xf0ce('0x33')],_0x2ecf58['filters']),_0x308603);if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]){_0x1032f1[_0xf0ce('0x3c')]=_[_0xf0ce('0x3f')](_0x1032f1[_0xf0ce('0x3c')],{'$or':_['map'](_0x308603,function(_0x1aba99){if(_0x1aba99['type']!==_0xf0ce('0x40')){var _0xa4de4e={};_0xa4de4e[_0x1aba99[_0xf0ce('0x2b')]]={'$like':'%'+_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]+'%'};return _0xa4de4e;}})});}_0x1032f1=_[_0xf0ce('0x3f')]({},_0x1032f1,_0x57cc29[_0xf0ce('0x41')]);var _0x37dc3e={'where':_0x1032f1[_0xf0ce('0x3c')]};return db[_0xf0ce('0x2d')]['count'](_0x37dc3e)['then'](function(_0x4348e9){_0x307875['count']=_0x4348e9;if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x42')]){_0x1032f1[_0xf0ce('0x43')]=[{'all':!![]}];}return db[_0xf0ce('0x2d')][_0xf0ce('0x44')](_0x1032f1);})['then'](function(_0xc4382a){_0x307875[_0xf0ce('0x45')]=_0xc4382a;return _0x307875;})[_0xf0ce('0x26')](respondWithFilteredResult(_0x3ddd44,_0x1032f1))['catch'](handleError(_0x3ddd44,null));};exports[_0xf0ce('0x46')]=function(_0x4349e7,_0x254478){var _0x3bbf41={'raw':![],'where':{'id':_0x4349e7[_0xf0ce('0x47')]['id']}},_0x4c650d={};_0x4c650d['model']=_[_0xf0ce('0x34')](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')]);_0x4c650d['query']=_[_0xf0ce('0x34')](_0x4349e7[_0xf0ce('0x33')]);_0x4c650d[_0xf0ce('0x35')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],_0x4c650d[_0xf0ce('0x33')]);_0x3bbf41[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],qs[_0xf0ce('0x38')](_0x4349e7[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x3bbf41[_0xf0ce('0x36')]=_0x3bbf41['attributes'][_0xf0ce('0x39')]?_0x3bbf41[_0xf0ce('0x36')]:_0x4c650d[_0xf0ce('0x31')];if(_0x4349e7['query'][_0xf0ce('0x42')]){_0x3bbf41[_0xf0ce('0x43')]=[{'all':!![]}];}_0x3bbf41=_[_0xf0ce('0x3f')]({},_0x3bbf41,_0x4349e7[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x3bbf41)[_0xf0ce('0x26')](handleEntityNotFound(_0x254478,null))['then'](respondWithResult(_0x254478,null))['catch'](handleError(_0x254478,null));};exports[_0xf0ce('0x49')]=function(_0x194f90,_0x4955fe){return db['AnalyticCustomReport'][_0xf0ce('0x49')](_0x194f90[_0xf0ce('0x4a')],{})['then'](function(_0x5cc50a){var _0x259321=_0x194f90[_0xf0ce('0x4b')][_0xf0ce('0x27')]({'plain':!![]});if(!_0x259321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259321[_0xf0ce('0x4c')]==='user'){var _0x1a1738=_0x5cc50a['get']({'plain':!![]});var _0x3ce5da='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x3ce5da,'userProfileId':_0x259321['userProfileId']},'raw':!![]})[_0xf0ce('0x26')](function(_0x7f1189){if(_0x7f1189&&_0x7f1189['autoAssociation']===0x0){return db[_0xf0ce('0x28')][_0xf0ce('0x49')]({'name':_0x1a1738['name'],'resourceId':_0x1a1738['id'],'type':_0xf0ce('0x4d'),'sectionId':_0x7f1189['id']},{})[_0xf0ce('0x26')](function(){return _0x5cc50a;});}else{return _0x5cc50a;}})[_0xf0ce('0x4e')](function(_0x229a55){logger[_0xf0ce('0x29')](_0xf0ce('0x4f'),_0x229a55);throw _0x229a55;});}return _0x5cc50a;})[_0xf0ce('0x26')](respondWithResult(_0x4955fe,0xc9))[_0xf0ce('0x4e')](handleError(_0x4955fe,null));};exports[_0xf0ce('0x50')]=function(_0x41f350,_0x33fcc0){if(_0x41f350[_0xf0ce('0x4a')]['id']){delete _0x41f350['body']['id'];}return db[_0xf0ce('0x2d')]['find']({'where':{'id':_0x41f350['params']['id']}})[_0xf0ce('0x26')](handleEntityNotFound(_0x33fcc0,null))['then'](saveUpdates(_0x41f350[_0xf0ce('0x4a')],null))[_0xf0ce('0x26')](respondWithResult(_0x33fcc0,null))['catch'](handleError(_0x33fcc0,null));};exports['destroy']=function(_0x378a81,_0x5b5ee7){return db[_0xf0ce('0x2d')][_0xf0ce('0x48')]({'where':{'id':_0x378a81[_0xf0ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b5ee7,null))[_0xf0ce('0x26')](removeEntity(_0x5b5ee7,null))[_0xf0ce('0x4e')](handleError(_0x5b5ee7,null));};exports[_0xf0ce('0x51')]=function(_0x98e247,_0x2afd81){var _0x575d7d=0xa;var _0x1f3e58=[_0xf0ce('0x52'),_0xf0ce('0x53'),'right_join',_0xf0ce('0x54')];var _0x5a1c6d={'SUM':_0xf0ce('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':_0xf0ce('0x5a'),'GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x16fea2={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':'DATE(%s)','HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x11e8fe=function(_0x5bca08){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),'IS\x20NOT\x20EMPTY'],_0x5bca08);};var _0x46f3a0=function(_0x22a36a){if(!_0x22a36a||!_0x22a36a['rules'][_0xf0ce('0x39')]){return'';}for(var _0x1f160e='(',_0x1151a7=0x0;_0x1151a7<_0x22a36a['rules'][_0xf0ce('0x39')];_0x1151a7+=0x1){_0x1151a7>0x0&&(_0x1f160e+='\x20'+_0x22a36a[_0xf0ce('0x64')]+'\x20');_0x1f160e+=_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x65')]?_0x46f3a0(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x65')]):_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x67')]+'\x20'+_0x22a36a[_0xf0ce('0x66')][_0x1151a7]['condition']+(_0x11e8fe(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x68')])?'\x20'+_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x69')]:'');}return _0x1f160e+')';};var _0x4be9c1={'where':{'id':_0x98e247[_0xf0ce('0x47')]['id']}},_0x4e66bc,_0x9e1efc,_0x28aed4,_0x1f9d63,_0x36be17;_0x4be9c1=_[_0xf0ce('0x3f')]({},_0x4be9c1,_0x98e247[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x4be9c1)[_0xf0ce('0x26')](function(_0x479653){if(_0x479653){_0x4e66bc=_0x479653;return _0x479653[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x3273ea){if(_0x3273ea){if(!_0x3273ea[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))](_0xf0ce('0x6d'),0x193);}_0x9e1efc=_0x3273ea;return db[_0xf0ce('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5a706c){if(_0x5a706c){_0x28aed4=_[_0xf0ce('0x6f')](_0x5a706c,'id');var _0x30c3df;var _0x23a282=squel[_0xf0ce('0x70')]();_0x23a282[_0xf0ce('0x71')](_0x4e66bc['table']);for(var _0x705231=0x0;_0x705231<_0x9e1efc[_0xf0ce('0x39')];_0x705231+=0x1){_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x72')]?_0x28aed4[_0x9e1efc[_0x705231]['MetricId']]['metric']:_0x9e1efc[_0x705231][_0xf0ce('0x67')];_0x30c3df=_0x9e1efc[_0x705231]['function']?_['replace'](_0x5a1c6d[_0x9e1efc[_0x705231][_0xf0ce('0x73')]],'%s',_0x30c3df):_0x30c3df;_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x16fea2[_0x9e1efc[_0x705231]['format']],'%s',_0x30c3df):_0x30c3df;if(_0x9e1efc[_0x705231][_0xf0ce('0x76')]){_0x23a282[_0xf0ce('0x65')](_0x30c3df);}_0x9e1efc[_0x705231]['orderBy']&&_0x23a282[_0xf0ce('0x3a')](_0x30c3df,_0x9e1efc[_0x705231][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x23a282[_0xf0ce('0x67')](_0x30c3df,_0x9e1efc[_0x705231]['alias']||_0x30c3df);}if(_0x4e66bc['joins']){_0x4e66bc[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x79')]);for(var _0x2ed129=0x0;_0x2ed129<_0x4e66bc[_0xf0ce('0x79')]['length'];_0x2ed129+=0x1){if(_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x1f3e58,_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')])&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7b')]&&_0x4e66bc['joins'][_0x2ed129][_0xf0ce('0x7c')]&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]){_0x23a282[_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]](_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7c')],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x4e66bc['table'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['parentKey'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['foreignTable'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]));}}}if(_0x4e66bc['conditions']){_0x4e66bc['conditions']=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x7f')]);_0x23a282[_0xf0ce('0x3c')](_0x46f3a0(_0x4e66bc[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x36be17=_0x23a282['clone']();_0x23a282[_0xf0ce('0x1f')](_0x575d7d);_0x23a282[_0xf0ce('0x21')](0x0);logger['debug'](_0xf0ce('0x80'),_0x23a282['toString']());return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x23a282['toString'](),{'type':dbH['sequelize'][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})['then'](respondWithResult(_0x2afd81,null))[_0xf0ce('0x4e')](handleError(_0x2afd81,null));};function runReport(_0x1d370f,_0xbb748f,_0x524053){var _0x4c358c=_0xbb748f[_0xf0ce('0x2b')];var _0x101fd6=0xa;var _0x532c13=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),_0xf0ce('0x54')];var _0x154a8f={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x5cdbf6={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x16ad05=function(_0x345c40){return!_['includes'](['IS\x20NULL',_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x345c40);};var _0x525233=function(_0x17d82c){if(!_0x17d82c||!_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')]){return'';}for(var _0x321f73='(',_0x21560f=0x0;_0x21560f<_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')];_0x21560f+=0x1){_0x21560f>0x0&&(_0x321f73+='\x20'+_0x17d82c[_0xf0ce('0x64')]+'\x20');_0x321f73+=_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']?_0x525233(_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']):_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x67')]+'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')]+(_0x16ad05(_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')])?'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x69')]:'');}return _0x321f73+')';};var _0x2f3cbd={'where':{'id':_0x1d370f['id']}},_0x1c793c,_0x13ed5e,_0x4314a7,_0x354e43,_0x191683;_0x2f3cbd=_[_0xf0ce('0x3f')]({},_0x2f3cbd,_0x524053);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x2f3cbd)[_0xf0ce('0x26')](function(_0xd20ebb){if(_0xd20ebb){_0x1c793c=_0xd20ebb;return _0xd20ebb[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x1dc7b8){if(_0x1dc7b8){if(!_0x1dc7b8[_0xf0ce('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13ed5e=_0x1dc7b8;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x1725ba){if(_0x1725ba){_0x4314a7=_[_0xf0ce('0x6f')](_0x1725ba,'id');var _0x2278fb;var _0x1a07f0=squel[_0xf0ce('0x70')]();_0x1a07f0[_0xf0ce('0x71')](_0x1c793c[_0xf0ce('0x89')]);for(var _0x1ef550=0x0;_0x1ef550<_0x13ed5e[_0xf0ce('0x39')];_0x1ef550+=0x1){_0x2278fb=_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]?_0x4314a7[_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]]['metric']:_0x13ed5e[_0x1ef550][_0xf0ce('0x67')];_0x2278fb=_0x13ed5e[_0x1ef550]['function']?_[_0xf0ce('0x75')](_0x154a8f[_0x13ed5e[_0x1ef550][_0xf0ce('0x73')]],'%s',_0x2278fb):_0x2278fb;_0x2278fb=_0x13ed5e[_0x1ef550]['format']?_[_0xf0ce('0x75')](_0x5cdbf6[_0x13ed5e[_0x1ef550][_0xf0ce('0x74')]],'%s',_0x2278fb):_0x2278fb;if(_0x13ed5e[_0x1ef550]['groupBy']){_0x1a07f0[_0xf0ce('0x65')](_0x2278fb);}_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]&&_0x1a07f0['order'](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]==='DESC'?![]:!![]);_0x1a07f0[_0xf0ce('0x67')](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x8a')]||_0x2278fb);}if(_0x1c793c[_0xf0ce('0x79')]){_0x1c793c[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x1c793c['joins']);for(var _0x332fdd=0x0;_0x332fdd<_0x1c793c[_0xf0ce('0x79')]['length'];_0x332fdd+=0x1){if(_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x532c13,_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x2f')])&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7b')]&&_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x7c')]&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']){_0x1a07f0[_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['type']](_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x1c793c[_0xf0ce('0x89')],_0x1c793c['joins'][_0x332fdd]['parentKey'],_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7c')],_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']));}}}if(_0x1c793c['conditions']){_0x1c793c[_0xf0ce('0x7f')]=JSON['parse'](_0x1c793c[_0xf0ce('0x7f')]);_0x1a07f0[_0xf0ce('0x3c')](_0x525233(_0x1c793c[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x191683=_0x1a07f0['clone']();_0x1a07f0['limit'](_0x101fd6);_0x1a07f0[_0xf0ce('0x21')](0x0);return;}})[_0xf0ce('0x26')](function(){if(_0xbb748f[_0xf0ce('0x8b')]===_0xf0ce('0x8c')){return null;}var _0x13f6ac=_[_0xf0ce('0x3f')](_0xbb748f,{'name':_0xbb748f[_0xf0ce('0x8d')]||_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],'basename':_0x4c358c,'savename':util[_0xf0ce('0x74')](_0xf0ce('0x8e'),_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],require(_0xf0ce('0x8f'))[_0xf0ce('0x90')](0x4),_0xbb748f[_0xf0ce('0x8b')]||_0xf0ce('0x91')),'reportId':_0x1c793c['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xf0ce('0x49')](_0x13f6ac,{'raw':!![]});})[_0xf0ce('0x26')](function(_0x23f7cf){if(_0x1c793c[_0xf0ce('0x89')]==='cdr'){_0x191683['where'](_0x1c793c[_0xf0ce('0x89')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xbb748f[_0xf0ce('0x92')],_0xbb748f['endDate']);}else{_0x191683[_0xf0ce('0x3c')](_0x1c793c['table']+_0xf0ce('0x93'),_0xbb748f['startDate'],_0xbb748f['endDate']);}if(_0x23f7cf){logger['info']('Run\x20Query:',_0x191683[_0xf0ce('0x94')]());require('child_process')[_0xf0ce('0x95')](path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x96'),_0x23f7cf['output']),[_0x23f7cf['id'],_0x191683[_0xf0ce('0x94')](),path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x97'),_0x23f7cf[_0xf0ce('0x98')]),_0x4c358c]);return _0x23f7cf;}else{var _0x48c48f=squel[_0xf0ce('0x70')]();_0x48c48f[_0xf0ce('0x71')]('('+_0x191683[_0xf0ce('0x94')]()+')',_0xf0ce('0x99'));_0x48c48f[_0xf0ce('0x67')](_0xf0ce('0x9a'),'count');_0x191683[_0xf0ce('0x1f')](_0xbb748f['limit']||_0x101fd6);_0x191683[_0xf0ce('0x21')](_0xbb748f['offset']||0x0);return dbH['sequelize'][_0xf0ce('0x33')](_0x48c48f['toString'](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']})[_0xf0ce('0x26')](function(_0x5a9079){if(!_0x5a9079[_0xf0ce('0x39')]){_0x354e43=0x0;}else{_0x354e43=_0x5a9079[0x0]['count']||0x0;}return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x191683[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']});})[_0xf0ce('0x26')](function(_0x302ba0){return{'rows':_0x302ba0||[],'count':_0x354e43};});}});}exports['run']=function(_0x5e8650,_0x3ebbad){return runReport(_0x5e8650[_0xf0ce('0x47')],_0x5e8650[_0xf0ce('0x33')],_0x5e8650[_0xf0ce('0x41')])[_0xf0ce('0x26')](respondWithResult(_0x3ebbad,null))['catch'](handleError(_0x3ebbad,null));};exports[_0xf0ce('0x9b')]=runReport;exports[_0xf0ce('0x33')]=function(_0x149497,_0x5d3210){var _0x4f02bc=0xa;var _0x5adbf1=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),'cross_join'];var _0x2b2b2e={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3fd7f9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x49785b=function(_0x2e0054){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x2e0054);};var _0x43d753=function(_0x333b23){if(!_0x333b23||!_0x333b23['rules']['length']){return'';}for(var _0x3db831='(',_0xfdd3db=0x0;_0xfdd3db<_0x333b23[_0xf0ce('0x66')][_0xf0ce('0x39')];_0xfdd3db+=0x1){_0xfdd3db>0x0&&(_0x3db831+='\x20'+_0x333b23[_0xf0ce('0x64')]+'\x20');_0x3db831+=_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x65')]?_0x43d753(_0x333b23[_0xf0ce('0x66')][_0xfdd3db]['group']):_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x67')]+'\x20'+_0x333b23[_0xf0ce('0x66')][_0xfdd3db][_0xf0ce('0x68')]+(_0x49785b(_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x68')])?'\x20'+_0x333b23['rules'][_0xfdd3db]['value']:'');}return _0x3db831+')';};var _0x246e4f={'where':{'id':_0x149497['params']['id']}},_0x3fcdf0,_0x100b4a,_0x238651,_0x549783,_0x48fe42;_0x246e4f=_[_0xf0ce('0x3f')]({},_0x246e4f,_0x149497[_0xf0ce('0x41')]);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x246e4f)[_0xf0ce('0x26')](function(_0x40ba6b){if(_0x40ba6b){_0x3fcdf0=_0x40ba6b;return _0x40ba6b[_0xf0ce('0x6a')]();}return null;})[_0xf0ce('0x26')](function(_0x56d82b){if(_0x56d82b){if(!_0x56d82b[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x100b4a=_0x56d82b;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x33763e){if(_0x33763e){_0x238651=_[_0xf0ce('0x6f')](_0x33763e,'id');var _0x609d4d;var _0x5297d9=squel['select']();_0x5297d9[_0xf0ce('0x71')](_0x3fcdf0[_0xf0ce('0x89')]);for(var _0x577ce8=0x0;_0x577ce8<_0x100b4a[_0xf0ce('0x39')];_0x577ce8+=0x1){_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x72')]?_0x238651[_0x100b4a[_0x577ce8][_0xf0ce('0x72')]][_0xf0ce('0x9c')]:_0x100b4a[_0x577ce8][_0xf0ce('0x67')];_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x73')]?_[_0xf0ce('0x75')](_0x2b2b2e[_0x100b4a[_0x577ce8][_0xf0ce('0x73')]],'%s',_0x609d4d):_0x609d4d;_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x3fd7f9[_0x100b4a[_0x577ce8]['format']],'%s',_0x609d4d):_0x609d4d;if(_0x100b4a[_0x577ce8]['groupBy']){_0x5297d9[_0xf0ce('0x65')](_0x609d4d);}_0x100b4a[_0x577ce8]['orderBy']&&_0x5297d9[_0xf0ce('0x3a')](_0x609d4d,_0x100b4a[_0x577ce8][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x5297d9[_0xf0ce('0x67')](_0x609d4d,_0x100b4a[_0x577ce8]['alias']||_0x609d4d);}if(_0x3fcdf0[_0xf0ce('0x79')]){_0x3fcdf0[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0['joins']);for(var _0x20cdda=0x0;_0x20cdda<_0x3fcdf0[_0xf0ce('0x79')][_0xf0ce('0x39')];_0x20cdda+=0x1){if(_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')]&&_['includes'](_0x5adbf1,_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')])&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7b')]&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')]&&_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7d')]){_0x5297d9[_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['type']](_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x3fcdf0[_0xf0ce('0x89')],_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7b')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7d')]));}}}if(_0x3fcdf0['conditions']){_0x3fcdf0[_0xf0ce('0x7f')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0[_0xf0ce('0x7f')]);_0x5297d9[_0xf0ce('0x3c')](_0x43d753(_0x3fcdf0[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x48fe42=_0x5297d9[_0xf0ce('0x9d')]();_0x5297d9[_0xf0ce('0x1f')](_0x4f02bc);_0x5297d9[_0xf0ce('0x21')](0x0);logger['debug']('Limited\x20Query:',_0x5297d9['toString']());return dbH[_0xf0ce('0x81')]['query'](_0x5297d9[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})[_0xf0ce('0x26')](function(){return{'sql':_0x48fe42['toString']()};})[_0xf0ce('0x26')](respondWithResult(_0x5d3210,null))[_0xf0ce('0x4e')](handleError(_0x5d3210,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7682945..c783f5b 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 _0x8e65=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','util','../../config/logger','moment','bluebird'];(function(_0x80d2ee,_0x1f46d3){var _0x1b5e38=function(_0x50ab8b){while(--_0x50ab8b){_0x80d2ee['push'](_0x80d2ee['shift']());}};_0x1b5e38(++_0x1f46d3);}(_0x8e65,0x1a9));var _0x58e6=function(_0x388d0a,_0x3ed289){_0x388d0a=_0x388d0a-0x0;var _0x1b4cc4=_0x8e65[_0x388d0a];return _0x1b4cc4;};'use strict';var _=require('lodash');var util=require(_0x58e6('0x0'));var logger=require(_0x58e6('0x1'))('api');var moment=require(_0x58e6('0x2'));var BPromise=require(_0x58e6('0x3'));var rp=require(_0x58e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e6('0x5'));var config=require(_0x58e6('0x6'));var attributes=require(_0x58e6('0x7'));module[_0x58e6('0x8')]=function(_0xc0a08e,_0x283c72){return _0xc0a08e[_0x58e6('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x58e6('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb28=['./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e2610,_0xe56978){var _0x4ce655=function(_0x325978){while(--_0x325978){_0x5e2610['push'](_0x5e2610['shift']());}};_0x4ce655(++_0xe56978);}(_0xeb28,0x9f));var _0x8eb2=function(_0x1748fd,_0x2c52a0){_0x1748fd=_0x1748fd-0x0;var _0x4575e8=_0xeb28[_0x1748fd];return _0x4575e8;};'use strict';var _=require(_0x8eb2('0x0'));var util=require(_0x8eb2('0x1'));var logger=require(_0x8eb2('0x2'))(_0x8eb2('0x3'));var moment=require(_0x8eb2('0x4'));var BPromise=require(_0x8eb2('0x5'));var rp=require(_0x8eb2('0x6'));var fs=require('fs');var path=require(_0x8eb2('0x7'));var rimraf=require(_0x8eb2('0x8'));var config=require('../../config/environment');var attributes=require(_0x8eb2('0x9'));module[_0x8eb2('0xa')]=function(_0x3f2d0b,_0x500a6){return _0x3f2d0b['define']('AnalyticCustomReport',attributes,{'tableName':_0x8eb2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 3cd82ea..34bdcd5 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 _0x49a0=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x59263b,_0x4d4ddd){var _0x41bed9=function(_0x30e91e){while(--_0x30e91e){_0x59263b['push'](_0x59263b['shift']());}};_0x41bed9(++_0x4d4ddd);}(_0x49a0,0x1ed));var _0x049a=function(_0x4ead23,_0x537fec){_0x4ead23=_0x4ead23-0x0;var _0x36bcae=_0x49a0[_0x4ead23];return _0x36bcae;};'use strict';var _=require(_0x049a('0x0'));var util=require(_0x049a('0x1'));var moment=require('moment');var BPromise=require(_0x049a('0x2'));var rs=require(_0x049a('0x3'));var fs=require('fs');var Redis=require(_0x049a('0x4'));var db=require(_0x049a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x049a('0x6'))(_0x049a('0x7'));var config=require('../../config/environment');var jayson=require(_0x049a('0x8'));var client=jayson['client'][_0x049a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdb0341,_0x38ed8c,_0x58a94c){return new BPromise(function(_0x557495,_0x307ddd){return client[_0x049a('0xa')](_0xdb0341,_0x58a94c)[_0x049a('0xb')](function(_0x1f79d8){logger[_0x049a('0xc')](_0x049a('0xd'),_0x38ed8c,'request\x20sent');logger[_0x049a('0xe')](_0x049a('0xf'),_0x38ed8c,_0x049a('0x10'),JSON[_0x049a('0x11')](_0x1f79d8));if(_0x1f79d8[_0x049a('0x12')]){if(_0x1f79d8[_0x049a('0x12')][_0x049a('0x13')]===0x1f4){logger[_0x049a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38ed8c,_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);return _0x307ddd(_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);}logger[_0x049a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38ed8c,_0x1f79d8['error'][_0x049a('0x14')]);return _0x557495(_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);}else{logger['info'](_0x049a('0xd'),_0x38ed8c,_0x049a('0x10'));_0x557495(_0x1f79d8[_0x049a('0x15')]['message']);}})[_0x049a('0x16')](function(_0x4c6f59){logger[_0x049a('0x12')](_0x049a('0xd'),_0x38ed8c,_0x4c6f59);_0x307ddd(_0x4c6f59);});});} \ No newline at end of file +var _0xfa76=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2a815a,_0x46e71b){var _0x11296b=function(_0x392bc1){while(--_0x392bc1){_0x2a815a['push'](_0x2a815a['shift']());}};_0x11296b(++_0x46e71b);}(_0xfa76,0x18f));var _0x6fa7=function(_0x456a43,_0x471c3a){_0x456a43=_0x456a43-0x0;var _0xfe97de=_0xfa76[_0x456a43];return _0xfe97de;};'use strict';var _=require(_0x6fa7('0x0'));var util=require(_0x6fa7('0x1'));var moment=require(_0x6fa7('0x2'));var BPromise=require(_0x6fa7('0x3'));var rs=require(_0x6fa7('0x4'));var fs=require('fs');var Redis=require(_0x6fa7('0x5'));var db=require(_0x6fa7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fa7('0x7'))(_0x6fa7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6fa7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bcb54,_0x53ec8f,_0x2a6f50){return new BPromise(function(_0x503e1a,_0x5299db){return client[_0x6fa7('0xa')](_0x1bcb54,_0x2a6f50)[_0x6fa7('0xb')](function(_0x2f1cc5){logger[_0x6fa7('0xc')](_0x6fa7('0xd'),_0x53ec8f,_0x6fa7('0xe'));logger[_0x6fa7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x53ec8f,'request\x20sent',JSON[_0x6fa7('0x10')](_0x2f1cc5));if(_0x2f1cc5[_0x6fa7('0x11')]){if(_0x2f1cc5['error'][_0x6fa7('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);return _0x5299db(_0x2f1cc5['error'][_0x6fa7('0x13')]);}logger['error'](_0x6fa7('0xd'),_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')]['message']);return _0x503e1a(_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);}else{logger['info'](_0x6fa7('0xd'),_0x53ec8f,'request\x20sent');_0x503e1a(_0x2f1cc5[_0x6fa7('0x14')][_0x6fa7('0x13')]);}})[_0x6fa7('0x15')](function(_0x13bbb8){logger[_0x6fa7('0x11')](_0x6fa7('0xd'),_0x53ec8f,_0x13bbb8);_0x5299db(_0x13bbb8);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index db96fd6..acf268d 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 _0x248a=['/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0xb47d1e,_0x1a306b){var _0x5180aa=function(_0x4d7294){while(--_0x4d7294){_0xb47d1e['push'](_0xb47d1e['shift']());}};_0x5180aa(++_0x1a306b);}(_0x248a,0x74));var _0xa248=function(_0x1021ea,_0x577e92){_0x1021ea=_0x1021ea-0x0;var _0x1b18ee=_0x248a[_0x1021ea];return _0x1b18ee;};'use strict';var multer=require(_0xa248('0x0'));var util=require(_0xa248('0x1'));var path=require(_0xa248('0x2'));var timeout=require(_0xa248('0x3'));var express=require(_0xa248('0x4'));var router=express[_0xa248('0x5')]();var fs_extra=require(_0xa248('0x6'));var auth=require(_0xa248('0x7'));var interaction=require(_0xa248('0x8'));var config=require(_0xa248('0x9'));var controller=require(_0xa248('0xa'));router['get']('/',auth[_0xa248('0xb')](),controller[_0xa248('0xc')]);router[_0xa248('0xd')](_0xa248('0xe'),auth[_0xa248('0xb')](),controller[_0xa248('0xf')]);router[_0xa248('0xd')](_0xa248('0x10'),auth[_0xa248('0xb')](),controller[_0xa248('0x11')]);router[_0xa248('0xd')](_0xa248('0x12'),auth[_0xa248('0xb')](),controller['run']);router[_0xa248('0xd')](_0xa248('0x13'),auth['isAuthenticated'](),controller[_0xa248('0x14')]);router[_0xa248('0x15')]('/',auth[_0xa248('0xb')](),controller[_0xa248('0x16')]);router[_0xa248('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa248('0x18')]);router[_0xa248('0x19')](_0xa248('0xe'),auth[_0xa248('0xb')](),controller[_0xa248('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xe93d=['query','post','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x315b9f,_0x5463c9){var _0x5c2907=function(_0x5607df){while(--_0x5607df){_0x315b9f['push'](_0x315b9f['shift']());}};_0x5c2907(++_0x5463c9);}(_0xe93d,0x1be));var _0xde93=function(_0xe2d486,_0x375089){_0xe2d486=_0xe2d486-0x0;var _0x414ffe=_0xe93d[_0xe2d486];return _0x414ffe;};'use strict';var multer=require(_0xde93('0x0'));var util=require(_0xde93('0x1'));var path=require('path');var timeout=require(_0xde93('0x2'));var express=require(_0xde93('0x3'));var router=express['Router']();var fs_extra=require(_0xde93('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde93('0x5'));var controller=require(_0xde93('0x6'));router[_0xde93('0x7')]('/',auth[_0xde93('0x8')](),controller['index']);router[_0xde93('0x7')](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0xa')]);router[_0xde93('0x7')](_0xde93('0xb'),auth[_0xde93('0x8')](),controller[_0xde93('0xc')]);router[_0xde93('0x7')](_0xde93('0xd'),auth[_0xde93('0x8')](),controller[_0xde93('0xe')]);router[_0xde93('0x7')](_0xde93('0xf'),auth[_0xde93('0x8')](),controller[_0xde93('0x10')]);router[_0xde93('0x11')]('/',auth[_0xde93('0x8')](),controller['create']);router[_0xde93('0x12')](_0xde93('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0x13')]);module[_0xde93('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 43b021a..b0d41fd 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4ca288,_0x254dd8){var _0x2362c1=function(_0x5504d8){while(--_0x5504d8){_0x4ca288['push'](_0x4ca288['shift']());}};_0x2362c1(++_0x254dd8);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x19cfac,_0x3745dc){_0x19cfac=_0x19cfac-0x0;var _0x25d2a5=_0xfdbd[_0x19cfac];return _0x25d2a5;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x24ca[_0x2c0ded];return _0x4473e5;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 277ced9..409848d 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xabce[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0xfc84ed,_0x32ee8a){var _0xb5fba1=function(_0x1e3938){while(--_0x1e3938){_0xfc84ed['push'](_0xfc84ed['shift']());}};_0xb5fba1(++_0x32ee8a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','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 _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c3b7f48..5e6c9ad 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 _0x16d1=['analytics_default_reports','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x17727b,_0x16ac94){var _0x2c0c61=function(_0x1f1a82){while(--_0x1f1a82){_0x17727b['push'](_0x17727b['shift']());}};_0x2c0c61(++_0x16ac94);}(_0x16d1,0x15d));var _0x116d=function(_0x563739,_0x4b9199){_0x563739=_0x563739-0x0;var _0x1f326a=_0x16d1[_0x563739];return _0x1f326a;};'use strict';var _=require(_0x116d('0x0'));var util=require(_0x116d('0x1'));var logger=require('../../config/logger')(_0x116d('0x2'));var moment=require('moment');var BPromise=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var fs=require('fs');var path=require(_0x116d('0x5'));var rimraf=require(_0x116d('0x6'));var config=require(_0x116d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x116d('0x8')]=function(_0x437602,_0x2fd8ed){return _0x437602[_0x116d('0x9')](_0x116d('0xa'),attributes,{'tableName':_0x116d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61a3=['define','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1a5d29,_0x46f6cb){var _0x2b8467=function(_0x3ecee3){while(--_0x3ecee3){_0x1a5d29['push'](_0x1a5d29['shift']());}};_0x2b8467(++_0x46f6cb);}(_0x61a3,0x171));var _0x361a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x361a('0x0'));var logger=require('../../config/logger')(_0x361a('0x1'));var moment=require(_0x361a('0x2'));var BPromise=require(_0x361a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x361a('0x4'));var rimraf=require(_0x361a('0x5'));var config=require(_0x361a('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x22b087,_0x7411c1){return _0x22b087[_0x361a('0x7')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 5c0bfbe..f4c94a0 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 _0x8a94=['../../config/logger','jayson/promise','client','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x1e9140,_0x44060d){var _0xf84e09=function(_0x257f57){while(--_0x257f57){_0x1e9140['push'](_0x1e9140['shift']());}};_0xf84e09(++_0x44060d);}(_0x8a94,0x13f));var _0x48a9=function(_0x576d65,_0x232150){_0x576d65=_0x576d65-0x0;var _0x5ba053=_0x8a94[_0x576d65];return _0x5ba053;};'use strict';var _=require(_0x48a9('0x0'));var util=require(_0x48a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x48a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48a9('0x3'))['db'];var utils=require(_0x48a9('0x4'));var logger=require(_0x48a9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x48a9('0x6'));var client=jayson[_0x48a9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b32e,_0x27da97,_0x329de5){return new BPromise(function(_0x1aa1c4,_0x5c2788){return client['request'](_0x50b32e,_0x329de5)[_0x48a9('0x8')](function(_0x44c7e7){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x48a9('0x9'));logger[_0x48a9('0xa')](_0x48a9('0xb'),_0x27da97,_0x48a9('0x9'),JSON[_0x48a9('0xc')](_0x44c7e7));if(_0x44c7e7[_0x48a9('0xd')]){if(_0x44c7e7[_0x48a9('0xd')]['code']===0x1f4){logger[_0x48a9('0xd')](_0x48a9('0xe'),_0x27da97,_0x44c7e7[_0x48a9('0xd')]['message']);return _0x5c2788(_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);}logger[_0x48a9('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);return _0x1aa1c4(_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);}else{logger['info'](_0x48a9('0xe'),_0x27da97,_0x48a9('0x9'));_0x1aa1c4(_0x44c7e7[_0x48a9('0x10')]['message']);}})[_0x48a9('0x11')](function(_0x453c1c){logger[_0x48a9('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x453c1c);_0x5c2788(_0x453c1c);});});} \ No newline at end of file +var _0x31d8=['../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x31d8,0x1c7));var _0x831d=function(_0x3eda3d,_0x232089){_0x3eda3d=_0x3eda3d-0x0;var _0x2efe88=_0x31d8[_0x3eda3d];return _0x2efe88;};'use strict';var _=require('lodash');var util=require(_0x831d('0x0'));var moment=require(_0x831d('0x1'));var BPromise=require(_0x831d('0x2'));var rs=require(_0x831d('0x3'));var fs=require('fs');var Redis=require(_0x831d('0x4'));var db=require(_0x831d('0x5'))['db'];var utils=require(_0x831d('0x6'));var logger=require(_0x831d('0x7'))(_0x831d('0x8'));var config=require('../../config/environment');var jayson=require(_0x831d('0x9'));var client=jayson[_0x831d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254715,_0x361c11,_0xac8ca9){return new BPromise(function(_0x317125,_0x1a716f){return client[_0x831d('0xb')](_0x254715,_0xac8ca9)[_0x831d('0xc')](function(_0x4b4d6c){logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,_0x831d('0xf'));logger[_0x831d('0x10')](_0x831d('0x11'),_0x361c11,_0x831d('0xf'),JSON[_0x831d('0x12')](_0x4b4d6c));if(_0x4b4d6c['error']){if(_0x4b4d6c[_0x831d('0x13')]['code']===0x1f4){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x1a716f(_0x4b4d6c['error'][_0x831d('0x14')]);}logger['error'](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x317125(_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);}else{logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,'request\x20sent');_0x317125(_0x4b4d6c['result'][_0x831d('0x14')]);}})['catch'](function(_0x3eeb0d){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x3eeb0d);_0x1a716f(_0x3eeb0d);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3f0dcf5..5e15ccb 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 _0x8c61=['Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','query','post','create','update','delete','multer','path','connect-timeout','express'];(function(_0x338805,_0x13788c){var _0x3f4f1f=function(_0xed0f6d){while(--_0xed0f6d){_0x338805['push'](_0x338805['shift']());}};_0x3f4f1f(++_0x13788c);}(_0x8c61,0x88));var _0x18c6=function(_0x282c51,_0x3b3fd5){_0x282c51=_0x282c51-0x0;var _0x4c54aa=_0x8c61[_0x282c51];return _0x4c54aa;};'use strict';var multer=require(_0x18c6('0x0'));var util=require('util');var path=require(_0x18c6('0x1'));var timeout=require(_0x18c6('0x2'));var express=require(_0x18c6('0x3'));var router=express[_0x18c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18c6('0x5'));var config=require(_0x18c6('0x6'));var controller=require(_0x18c6('0x7'));router[_0x18c6('0x8')]('/',auth[_0x18c6('0x9')](),controller[_0x18c6('0xa')]);router[_0x18c6('0x8')](_0x18c6('0xb'),auth[_0x18c6('0x9')](),controller['show']);router[_0x18c6('0x8')](_0x18c6('0xc'),auth[_0x18c6('0x9')](),controller[_0x18c6('0xd')]);router['get'](_0x18c6('0xe'),auth[_0x18c6('0x9')](),controller['run']);router[_0x18c6('0x8')]('/:id/query',auth[_0x18c6('0x9')](),controller[_0x18c6('0xf')]);router[_0x18c6('0x10')]('/',auth[_0x18c6('0x9')](),controller[_0x18c6('0x11')]);router['put'](_0x18c6('0xb'),auth['isAuthenticated'](),controller[_0x18c6('0x12')]);router[_0x18c6('0x13')](_0x18c6('0xb'),auth[_0x18c6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe55d=['Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/run','run','/:id/query','query','post','create','update','delete','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x3ba60c,_0x27b3a3){var _0x5de53d=function(_0x4b3396){while(--_0x4b3396){_0x3ba60c['push'](_0x3ba60c['shift']());}};_0x5de53d(++_0x27b3a3);}(_0xe55d,0x15d));var _0xde55=function(_0x4af6b8,_0x59f8a1){_0x4af6b8=_0x4af6b8-0x0;var _0x1b3b4b=_0xe55d[_0x4af6b8];return _0x1b3b4b;};'use strict';var multer=require(_0xde55('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xde55('0x1'));var express=require(_0xde55('0x2'));var router=express[_0xde55('0x3')]();var fs_extra=require(_0xde55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde55('0x5'));var config=require('../../config/environment');var controller=require(_0xde55('0x6'));router['get']('/',auth[_0xde55('0x7')](),controller[_0xde55('0x8')]);router[_0xde55('0x9')]('/:id',auth[_0xde55('0x7')](),controller[_0xde55('0xa')]);router[_0xde55('0x9')]('/:id/preview',auth[_0xde55('0x7')](),controller['preview']);router['get'](_0xde55('0xb'),auth[_0xde55('0x7')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth[_0xde55('0x7')](),controller[_0xde55('0xe')]);router[_0xde55('0xf')]('/',auth[_0xde55('0x7')](),controller[_0xde55('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xde55('0x11')]);router[_0xde55('0x12')](_0xde55('0x13'),auth[_0xde55('0x7')](),controller[_0xde55('0x14')]);module[_0xde55('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8f291d0..f55dbef 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 _0x6b26=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading','manual','scheduled'];(function(_0x5a2b99,_0x352dd7){var _0x167c87=function(_0xbd4900){while(--_0xbd4900){_0x5a2b99['push'](_0x5a2b99['shift']());}};_0x167c87(++_0x352dd7);}(_0x6b26,0x152));var _0x66b2=function(_0x3b9ffd,_0x9c8e5b){_0x3b9ffd=_0x3b9ffd-0x0;var _0x4bdb61=_0x6b26[_0x3b9ffd];return _0x4bdb61;};'use strict';var Sequelize=require(_0x66b2('0x0'));var moment=require(_0x66b2('0x1'));module[_0x66b2('0x2')]={'name':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x66b2('0x4')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x66b2('0x5')},'savename':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x66b2('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x66b2('0x7')},'type':{'type':Sequelize['ENUM'](_0x66b2('0x8'),_0x66b2('0x9')),'allowNull':![],'defaultValue':_0x66b2('0x8')},'reportId':{'type':Sequelize[_0x66b2('0xa')](0xb)[_0x66b2('0xb')]},'reportType':{'type':Sequelize[_0x66b2('0x3')]}}; \ No newline at end of file +var _0x63da=['ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x4f72aa,_0x101b06){var _0x328dfe=function(_0x4bb1b5){while(--_0x4bb1b5){_0x4f72aa['push'](_0x4f72aa['shift']());}};_0x328dfe(++_0x101b06);}(_0x63da,0x1d6));var _0xa63d=function(_0x10d128,_0x1d80f6){_0x10d128=_0x10d128-0x0;var _0x52dc8a=_0x63da[_0x10d128];return _0x52dc8a;};'use strict';var Sequelize=require(_0xa63d('0x0'));var moment=require('moment');module[_0xa63d('0x1')]={'name':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x4'),'pdf',_0xa63d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa63d('0x6')]},'endDate':{'type':Sequelize[_0xa63d('0x6')]},'status':{'type':Sequelize[_0xa63d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x7'),_0xa63d('0x8')),'allowNull':![],'defaultValue':_0xa63d('0x7')},'reportId':{'type':Sequelize[_0xa63d('0x9')](0xb)[_0xa63d('0xa')]},'reportType':{'type':Sequelize[_0xa63d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 93814a5..7ac71b2 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 _0xc28f=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xd6b4a0,_0x1c4b83){var _0xd9048f=function(_0x926056){while(--_0x926056){_0xd6b4a0['push'](_0xd6b4a0['shift']());}};_0xd9048f(++_0x1c4b83);}(_0xc28f,0x109));var _0xfc28=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xc28f[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xfc28('0x0'));var rimraf=require(_0xfc28('0x1'));var zipdir=require(_0xfc28('0x2'));var jsonpatch=require(_0xfc28('0x3'));var rp=require(_0xfc28('0x4'));var moment=require(_0xfc28('0x5'));var BPromise=require(_0xfc28('0x6'));var Mustache=require('mustache');var util=require(_0xfc28('0x7'));var path=require(_0xfc28('0x8'));var sox=require(_0xfc28('0x9'));var csv=require(_0xfc28('0xa'));var ejs=require(_0xfc28('0xb'));var fs=require('fs');var fs_extra=require(_0xfc28('0xc'));var _=require(_0xfc28('0xd'));var squel=require(_0xfc28('0xe'));var crypto=require(_0xfc28('0xf'));var jsforce=require(_0xfc28('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfc28('0xa'));var querystring=require(_0xfc28('0x11'));var Papa=require(_0xfc28('0x12'));var Redis=require(_0xfc28('0x13'));var authService=require(_0xfc28('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc28('0x15'));var logger=require(_0xfc28('0x16'))(_0xfc28('0x17'));var utils=require(_0xfc28('0x18'));var config=require(_0xfc28('0x19'));var licenseUtil=require(_0xfc28('0x1a'));var db=require(_0xfc28('0x1b'))['db'];function respondWithStatusCode(_0x475dfa,_0x392f46){_0x392f46=_0x392f46||0xcc;return function(_0x281146){if(_0x281146){return _0x475dfa[_0xfc28('0x1c')](_0x392f46);}return _0x475dfa['status'](_0x392f46)[_0xfc28('0x1d')]();};}function respondWithResult(_0x3c3ad9,_0x3678aa){_0x3678aa=_0x3678aa||0xc8;return function(_0x5336f7){if(_0x5336f7){return _0x3c3ad9[_0xfc28('0x1e')](_0x3678aa)[_0xfc28('0x1f')](_0x5336f7);}};}function respondWithFilteredResult(_0x59f8d5,_0x5144cb){return function(_0x4cd437){if(_0x4cd437){var _0x4ac0bc=typeof _0x5144cb[_0xfc28('0x20')]==='undefined'&&typeof _0x5144cb[_0xfc28('0x21')]===_0xfc28('0x22');var _0x254235=_0x4cd437[_0xfc28('0x23')];var _0x2a7014=_0x4ac0bc?0x0:_0x5144cb['offset'];var _0x3c5be0=_0x4ac0bc?_0x4cd437['count']:_0x5144cb['offset']+_0x5144cb[_0xfc28('0x21')];var _0x2b1220;if(_0x3c5be0>=_0x254235){_0x3c5be0=_0x254235;_0x2b1220=0xc8;}else{_0x2b1220=0xce;}_0x59f8d5[_0xfc28('0x1e')](_0x2b1220);return _0x59f8d5[_0xfc28('0x24')](_0xfc28('0x25'),_0x2a7014+'-'+_0x3c5be0+'/'+_0x254235)[_0xfc28('0x1f')](_0x4cd437);}return null;};}function patchUpdates(_0x32cf4a){return function(_0x2f9ce4){try{jsonpatch['apply'](_0x2f9ce4,_0x32cf4a,!![]);}catch(_0x3ba24c){return BPromise[_0xfc28('0x26')](_0x3ba24c);}return _0x2f9ce4[_0xfc28('0x27')]();};}function saveUpdates(_0x17d1e2,_0x245052){return function(_0x51e3dc){if(_0x51e3dc){return _0x51e3dc[_0xfc28('0x28')](_0x17d1e2)[_0xfc28('0x29')](function(_0x36d4af){return _0x36d4af;});}return null;};}function removeEntity(_0x3f7c28,_0x4d40f7){return function(_0x226c47){if(_0x226c47){return _0x226c47[_0xfc28('0x2a')]()[_0xfc28('0x29')](function(){var _0x1073f3=_0x226c47[_0xfc28('0x2b')]({'plain':!![]});var _0x4657cf=_0xfc28('0x2c');return db[_0xfc28('0x2d')][_0xfc28('0x2a')]({'where':{'type':_0x4657cf,'resourceId':_0x1073f3['id']}})[_0xfc28('0x29')](function(){return _0x226c47;});})['then'](function(){_0x3f7c28[_0xfc28('0x1e')](0xcc)[_0xfc28('0x1d')]();});}};}function handleEntityNotFound(_0x5a50a1,_0x3129ae){return function(_0x1c36e7){if(!_0x1c36e7){_0x5a50a1[_0xfc28('0x1c')](0x194);}return _0x1c36e7;};}function handleError(_0x3688f9,_0x159108){_0x159108=_0x159108||0x1f4;return function(_0x2514f3){logger[_0xfc28('0x2e')](_0x2514f3['stack']);if(_0x2514f3[_0xfc28('0x2f')]){delete _0x2514f3[_0xfc28('0x2f')];}_0x3688f9['status'](_0x159108)['send'](_0x2514f3);};}exports['index']=function(_0x365ecc,_0x5992b6){var _0x34cd29={},_0x133085={},_0x446e45={'count':0x0,'rows':[]};var _0x2b9ab5=_[_0xfc28('0x30')](db[_0xfc28('0x31')]['rawAttributes'],function(_0x1530f5){return{'name':_0x1530f5[_0xfc28('0x32')],'type':_0x1530f5[_0xfc28('0x33')][_0xfc28('0x34')]};});_0x133085[_0xfc28('0x35')]=_[_0xfc28('0x30')](_0x2b9ab5,_0xfc28('0x2f'));_0x133085[_0xfc28('0x36')]=_[_0xfc28('0x37')](_0x365ecc[_0xfc28('0x36')]);_0x133085[_0xfc28('0x38')]=_[_0xfc28('0x39')](_0x133085[_0xfc28('0x35')],_0x133085[_0xfc28('0x36')]);_0x34cd29[_0xfc28('0x3a')]=_[_0xfc28('0x39')](_0x133085['model'],qs[_0xfc28('0x3b')](_0x365ecc[_0xfc28('0x36')][_0xfc28('0x3b')]));_0x34cd29[_0xfc28('0x3a')]=_0x34cd29[_0xfc28('0x3a')][_0xfc28('0x3c')]?_0x34cd29[_0xfc28('0x3a')]:_0x133085['model'];if(!_0x365ecc[_0xfc28('0x36')]['hasOwnProperty'](_0xfc28('0x3d'))){_0x34cd29[_0xfc28('0x21')]=qs['limit'](_0x365ecc['query'][_0xfc28('0x21')]);_0x34cd29[_0xfc28('0x20')]=qs['offset'](_0x365ecc[_0xfc28('0x36')][_0xfc28('0x20')]);}_0x34cd29['order']=qs['sort'](_0x365ecc[_0xfc28('0x36')]['sort']);_0x34cd29[_0xfc28('0x3e')]=qs[_0xfc28('0x38')](_[_0xfc28('0x3f')](_0x365ecc[_0xfc28('0x36')],_0x133085[_0xfc28('0x38')]),_0x2b9ab5);if(_0x365ecc['query'][_0xfc28('0x40')]){_0x34cd29[_0xfc28('0x3e')]=_['merge'](_0x34cd29[_0xfc28('0x3e')],{'$or':_[_0xfc28('0x30')](_0x2b9ab5,function(_0x45c22a){if(_0x45c22a[_0xfc28('0x33')]!==_0xfc28('0x41')){var _0x4459cd={};_0x4459cd[_0x45c22a[_0xfc28('0x2f')]]={'$like':'%'+_0x365ecc[_0xfc28('0x36')]['filter']+'%'};return _0x4459cd;}})});}_0x34cd29=_[_0xfc28('0x42')]({},_0x34cd29,_0x365ecc[_0xfc28('0x43')]);var _0x4dd8eb={'where':_0x34cd29[_0xfc28('0x3e')]};return db[_0xfc28('0x31')][_0xfc28('0x23')](_0x4dd8eb)['then'](function(_0x461b55){_0x446e45['count']=_0x461b55;if(_0x365ecc[_0xfc28('0x36')]['includeAll']){_0x34cd29[_0xfc28('0x44')]=[{'all':!![]}];}return db[_0xfc28('0x31')][_0xfc28('0x45')](_0x34cd29);})[_0xfc28('0x29')](function(_0x96897b){_0x446e45[_0xfc28('0x46')]=_0x96897b;return _0x446e45;})[_0xfc28('0x29')](respondWithFilteredResult(_0x5992b6,_0x34cd29))['catch'](handleError(_0x5992b6,null));};exports['show']=function(_0x1a40e1,_0x11c315){var _0x1f21bf={'raw':!![],'where':{'id':_0x1a40e1[_0xfc28('0x47')]['id']}},_0x3cf1f0={};_0x3cf1f0[_0xfc28('0x35')]=_[_0xfc28('0x37')](db['AnalyticExtractedReport']['rawAttributes']);_0x3cf1f0['query']=_[_0xfc28('0x37')](_0x1a40e1[_0xfc28('0x36')]);_0x3cf1f0[_0xfc28('0x38')]=_['intersection'](_0x3cf1f0[_0xfc28('0x35')],_0x3cf1f0[_0xfc28('0x36')]);_0x1f21bf[_0xfc28('0x3a')]=_[_0xfc28('0x39')](_0x3cf1f0[_0xfc28('0x35')],qs['fields'](_0x1a40e1[_0xfc28('0x36')]['fields']));_0x1f21bf['attributes']=_0x1f21bf['attributes'][_0xfc28('0x3c')]?_0x1f21bf[_0xfc28('0x3a')]:_0x3cf1f0[_0xfc28('0x35')];if(_0x1a40e1['query'][_0xfc28('0x48')]){_0x1f21bf['include']=[{'all':!![]}];}_0x1f21bf=_['merge']({},_0x1f21bf,_0x1a40e1[_0xfc28('0x43')]);return db[_0xfc28('0x31')][_0xfc28('0x49')](_0x1f21bf)[_0xfc28('0x29')](handleEntityNotFound(_0x11c315,null))[_0xfc28('0x29')](respondWithResult(_0x11c315,null))['catch'](handleError(_0x11c315,null));};exports['create']=function(_0x475fbc,_0x420ade){return db[_0xfc28('0x31')][_0xfc28('0x4a')](_0x475fbc['body'],{})[_0xfc28('0x29')](function(_0x1ca9a6){var _0x486d61=_0x475fbc[_0xfc28('0x4b')]['get']({'plain':!![]});if(!_0x486d61)throw new Error(_0xfc28('0x4c'));if(_0x486d61['role']===_0xfc28('0x4b')){var _0x3d9d54=_0x1ca9a6[_0xfc28('0x2b')]({'plain':!![]});var _0x7dc80a=_0xfc28('0x2c');return db[_0xfc28('0x4d')]['find']({'where':{'name':_0x7dc80a,'userProfileId':_0x486d61[_0xfc28('0x4e')]},'raw':!![]})[_0xfc28('0x29')](function(_0x358a95){if(_0x358a95&&_0x358a95[_0xfc28('0x4f')]===0x0){return db[_0xfc28('0x2d')][_0xfc28('0x4a')]({'name':_0x3d9d54[_0xfc28('0x2f')],'resourceId':_0x3d9d54['id'],'type':_0x358a95['name'],'sectionId':_0x358a95['id']},{})['then'](function(){return _0x1ca9a6;});}else{return _0x1ca9a6;}})[_0xfc28('0x50')](function(_0x2a9543){logger[_0xfc28('0x2e')](_0xfc28('0x51'),_0x2a9543);throw _0x2a9543;});}return _0x1ca9a6;})['then'](respondWithResult(_0x420ade,0xc9))[_0xfc28('0x50')](handleError(_0x420ade,null));};exports['update']=function(_0x17e5cf,_0x59d51b){if(_0x17e5cf[_0xfc28('0x52')]['id']){delete _0x17e5cf[_0xfc28('0x52')]['id'];}return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x17e5cf[_0xfc28('0x47')]['id']}})[_0xfc28('0x29')](handleEntityNotFound(_0x59d51b,null))[_0xfc28('0x29')](saveUpdates(_0x17e5cf[_0xfc28('0x52')],null))[_0xfc28('0x29')](respondWithResult(_0x59d51b,null))[_0xfc28('0x50')](handleError(_0x59d51b,null));};exports[_0xfc28('0x2a')]=function(_0x259e6e,_0xc228fb){return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x259e6e['params']['id']}})[_0xfc28('0x29')](handleEntityNotFound(_0xc228fb,null))['then'](removeEntity(_0xc228fb,null))[_0xfc28('0x50')](handleError(_0xc228fb,null));};exports[_0xfc28('0x53')]=function(_0x3c99ff,_0x108c99,_0x54fdb6){return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x3c99ff['params']['id']},'attributes':['name',_0xfc28('0x54'),_0xfc28('0x55'),_0xfc28('0x56')],'raw':!![]})[_0xfc28('0x29')](handleEntityNotFound(_0x108c99,null))[_0xfc28('0x29')](function(_0x4d6d2a){if(_0x4d6d2a){if(!fs[_0xfc28('0x57')](path[_0xfc28('0x58')](config[_0xfc28('0x59')],_0xfc28('0x5a'),_0x4d6d2a['savename']))){throw new db[(_0xfc28('0x5b'))][(_0xfc28('0x5c'))](_0xfc28('0x5d'));}if(_0x3c99ff[_0xfc28('0x36')][_0xfc28('0x5e')]){return _0x108c99[_0xfc28('0x1c')](0xc8);}return _0x108c99[_0xfc28('0x53')](path[_0xfc28('0x58')](config[_0xfc28('0x59')],_0xfc28('0x5a'),_0x4d6d2a[_0xfc28('0x55')]),util['format'](_0xfc28('0x5f'),_0x4d6d2a[_0xfc28('0x54')]||_0x4d6d2a[_0xfc28('0x2f')],_0x4d6d2a[_0xfc28('0x56')][_0xfc28('0x60')]()));}})[_0xfc28('0x50')](handleError(_0x108c99,null));}; \ No newline at end of file +var _0x868c=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','undefined','count','limit','set','Content-Range','apply','save','then','UserProfileResource','error','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868c,0x6a));var _0xc868=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x868c[_0x2c7b86];return _0x256735;};'use strict';var emlformat=require(_0xc868('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc868('0x1'));var jsonpatch=require(_0xc868('0x2'));var rp=require(_0xc868('0x3'));var moment=require(_0xc868('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc868('0x5'));var util=require('util');var path=require(_0xc868('0x6'));var sox=require('sox');var csv=require(_0xc868('0x7'));var ejs=require(_0xc868('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc868('0x9'));var squel=require(_0xc868('0xa'));var crypto=require(_0xc868('0xb'));var jsforce=require(_0xc868('0xc'));var deskjs=require(_0xc868('0xd'));var toCsv=require(_0xc868('0x7'));var querystring=require(_0xc868('0xe'));var Papa=require('papaparse');var Redis=require(_0xc868('0xf'));var authService=require(_0xc868('0x10'));var qs=require(_0xc868('0x11'));var as=require(_0xc868('0x12'));var hardwareService=require(_0xc868('0x13'));var logger=require(_0xc868('0x14'))(_0xc868('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc868('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d8701,_0x390945){_0x390945=_0x390945||0xcc;return function(_0x2a10a3){if(_0x2a10a3){return _0x5d8701[_0xc868('0x17')](_0x390945);}return _0x5d8701['status'](_0x390945)[_0xc868('0x18')]();};}function respondWithResult(_0x28249e,_0x43d366){_0x43d366=_0x43d366||0xc8;return function(_0x427f2a){if(_0x427f2a){return _0x28249e[_0xc868('0x19')](_0x43d366)[_0xc868('0x1a')](_0x427f2a);}};}function respondWithFilteredResult(_0x5cacf3,_0xb18435){return function(_0x5d3241){if(_0x5d3241){var _0x2d6704=typeof _0xb18435['offset']===_0xc868('0x1b')&&typeof _0xb18435['limit']===_0xc868('0x1b');var _0x13c72a=_0x5d3241[_0xc868('0x1c')];var _0x2d3930=_0x2d6704?0x0:_0xb18435['offset'];var _0x3f823d=_0x2d6704?_0x5d3241[_0xc868('0x1c')]:_0xb18435['offset']+_0xb18435[_0xc868('0x1d')];var _0x4d279f;if(_0x3f823d>=_0x13c72a){_0x3f823d=_0x13c72a;_0x4d279f=0xc8;}else{_0x4d279f=0xce;}_0x5cacf3['status'](_0x4d279f);return _0x5cacf3[_0xc868('0x1e')](_0xc868('0x1f'),_0x2d3930+'-'+_0x3f823d+'/'+_0x13c72a)[_0xc868('0x1a')](_0x5d3241);}return null;};}function patchUpdates(_0x1a40b3){return function(_0x35021){try{jsonpatch[_0xc868('0x20')](_0x35021,_0x1a40b3,!![]);}catch(_0x1219a0){return BPromise['reject'](_0x1219a0);}return _0x35021[_0xc868('0x21')]();};}function saveUpdates(_0x5b6ad8,_0x2f356c){return function(_0x2764dc){if(_0x2764dc){return _0x2764dc['update'](_0x5b6ad8)[_0xc868('0x22')](function(_0x3756f7){return _0x3756f7;});}return null;};}function removeEntity(_0x5cad42,_0x248be9){return function(_0x4ac71f){if(_0x4ac71f){return _0x4ac71f['destroy']()[_0xc868('0x22')](function(){var _0x42f85d=_0x4ac71f['get']({'plain':!![]});var _0xa5acf='ExtractedReports';return db[_0xc868('0x23')]['destroy']({'where':{'type':_0xa5acf,'resourceId':_0x42f85d['id']}})[_0xc868('0x22')](function(){return _0x4ac71f;});})[_0xc868('0x22')](function(){_0x5cad42['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fbedb,_0x4c0fb7){return function(_0x54bcda){if(!_0x54bcda){_0x2fbedb['sendStatus'](0x194);}return _0x54bcda;};}function handleError(_0x453d84,_0x4d94ab){_0x4d94ab=_0x4d94ab||0x1f4;return function(_0x555507){logger[_0xc868('0x24')](_0x555507['stack']);if(_0x555507[_0xc868('0x25')]){delete _0x555507[_0xc868('0x25')];}_0x453d84[_0xc868('0x19')](_0x4d94ab)['send'](_0x555507);};}exports[_0xc868('0x26')]=function(_0x212539,_0x1014d5){var _0x5b3ee3={},_0x389522={},_0xb5a86f={'count':0x0,'rows':[]};var _0x24cde4=_[_0xc868('0x27')](db[_0xc868('0x28')][_0xc868('0x29')],function(_0x2eeb1a){return{'name':_0x2eeb1a[_0xc868('0x2a')],'type':_0x2eeb1a['type'][_0xc868('0x2b')]};});_0x389522['model']=_['map'](_0x24cde4,_0xc868('0x25'));_0x389522[_0xc868('0x2c')]=_['keys'](_0x212539[_0xc868('0x2c')]);_0x389522[_0xc868('0x2d')]=_[_0xc868('0x2e')](_0x389522[_0xc868('0x2f')],_0x389522[_0xc868('0x2c')]);_0x5b3ee3[_0xc868('0x30')]=_['intersection'](_0x389522[_0xc868('0x2f')],qs['fields'](_0x212539[_0xc868('0x2c')][_0xc868('0x31')]));_0x5b3ee3[_0xc868('0x30')]=_0x5b3ee3[_0xc868('0x30')][_0xc868('0x32')]?_0x5b3ee3[_0xc868('0x30')]:_0x389522[_0xc868('0x2f')];if(!_0x212539[_0xc868('0x2c')]['hasOwnProperty'](_0xc868('0x33'))){_0x5b3ee3[_0xc868('0x1d')]=qs[_0xc868('0x1d')](_0x212539['query'][_0xc868('0x1d')]);_0x5b3ee3[_0xc868('0x34')]=qs[_0xc868('0x34')](_0x212539[_0xc868('0x2c')]['offset']);}_0x5b3ee3[_0xc868('0x35')]=qs[_0xc868('0x36')](_0x212539[_0xc868('0x2c')][_0xc868('0x36')]);_0x5b3ee3[_0xc868('0x37')]=qs['filters'](_[_0xc868('0x38')](_0x212539[_0xc868('0x2c')],_0x389522[_0xc868('0x2d')]),_0x24cde4);if(_0x212539['query']['filter']){_0x5b3ee3[_0xc868('0x37')]=_[_0xc868('0x39')](_0x5b3ee3['where'],{'$or':_[_0xc868('0x27')](_0x24cde4,function(_0x4064fa){if(_0x4064fa['type']!=='VIRTUAL'){var _0x50625e={};_0x50625e[_0x4064fa[_0xc868('0x25')]]={'$like':'%'+_0x212539[_0xc868('0x2c')][_0xc868('0x3a')]+'%'};return _0x50625e;}})});}_0x5b3ee3=_['merge']({},_0x5b3ee3,_0x212539[_0xc868('0x3b')]);var _0x5e2edc={'where':_0x5b3ee3['where']};return db['AnalyticExtractedReport']['count'](_0x5e2edc)[_0xc868('0x22')](function(_0x43612b){_0xb5a86f[_0xc868('0x1c')]=_0x43612b;if(_0x212539['query']['includeAll']){_0x5b3ee3[_0xc868('0x3c')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc868('0x3d')](_0x5b3ee3);})[_0xc868('0x22')](function(_0x5e515a){_0xb5a86f[_0xc868('0x3e')]=_0x5e515a;return _0xb5a86f;})[_0xc868('0x22')](respondWithFilteredResult(_0x1014d5,_0x5b3ee3))[_0xc868('0x3f')](handleError(_0x1014d5,null));};exports['show']=function(_0x85ce5c,_0x575ce4){var _0x30f4b5={'raw':!![],'where':{'id':_0x85ce5c[_0xc868('0x40')]['id']}},_0x94c26d={};_0x94c26d[_0xc868('0x2f')]=_[_0xc868('0x41')](db[_0xc868('0x28')][_0xc868('0x29')]);_0x94c26d[_0xc868('0x2c')]=_[_0xc868('0x41')](_0x85ce5c[_0xc868('0x2c')]);_0x94c26d['filters']=_[_0xc868('0x2e')](_0x94c26d[_0xc868('0x2f')],_0x94c26d[_0xc868('0x2c')]);_0x30f4b5['attributes']=_[_0xc868('0x2e')](_0x94c26d['model'],qs[_0xc868('0x31')](_0x85ce5c[_0xc868('0x2c')][_0xc868('0x31')]));_0x30f4b5['attributes']=_0x30f4b5[_0xc868('0x30')][_0xc868('0x32')]?_0x30f4b5['attributes']:_0x94c26d[_0xc868('0x2f')];if(_0x85ce5c[_0xc868('0x2c')][_0xc868('0x42')]){_0x30f4b5[_0xc868('0x3c')]=[{'all':!![]}];}_0x30f4b5=_[_0xc868('0x39')]({},_0x30f4b5,_0x85ce5c[_0xc868('0x3b')]);return db[_0xc868('0x28')][_0xc868('0x43')](_0x30f4b5)[_0xc868('0x22')](handleEntityNotFound(_0x575ce4,null))[_0xc868('0x22')](respondWithResult(_0x575ce4,null))[_0xc868('0x3f')](handleError(_0x575ce4,null));};exports[_0xc868('0x44')]=function(_0xcf461b,_0x358d09){return db[_0xc868('0x28')]['create'](_0xcf461b[_0xc868('0x45')],{})[_0xc868('0x22')](function(_0x6f74ae){var _0x2bcd86=_0xcf461b[_0xc868('0x46')]['get']({'plain':!![]});if(!_0x2bcd86)throw new Error(_0xc868('0x47'));if(_0x2bcd86['role']===_0xc868('0x46')){var _0x4f8291=_0x6f74ae['get']({'plain':!![]});var _0x194185=_0xc868('0x48');return db[_0xc868('0x49')][_0xc868('0x43')]({'where':{'name':_0x194185,'userProfileId':_0x2bcd86[_0xc868('0x4a')]},'raw':!![]})[_0xc868('0x22')](function(_0x3d7d7d){if(_0x3d7d7d&&_0x3d7d7d['autoAssociation']===0x0){return db['UserProfileResource'][_0xc868('0x44')]({'name':_0x4f8291['name'],'resourceId':_0x4f8291['id'],'type':_0x3d7d7d[_0xc868('0x25')],'sectionId':_0x3d7d7d['id']},{})[_0xc868('0x22')](function(){return _0x6f74ae;});}else{return _0x6f74ae;}})[_0xc868('0x3f')](function(_0x30ecc9){logger['error'](_0xc868('0x4b'),_0x30ecc9);throw _0x30ecc9;});}return _0x6f74ae;})['then'](respondWithResult(_0x358d09,0xc9))[_0xc868('0x3f')](handleError(_0x358d09,null));};exports[_0xc868('0x4c')]=function(_0x49563e,_0x2fe358){if(_0x49563e[_0xc868('0x45')]['id']){delete _0x49563e[_0xc868('0x45')]['id'];}return db['AnalyticExtractedReport'][_0xc868('0x43')]({'where':{'id':_0x49563e[_0xc868('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fe358,null))[_0xc868('0x22')](saveUpdates(_0x49563e[_0xc868('0x45')],null))['then'](respondWithResult(_0x2fe358,null))[_0xc868('0x3f')](handleError(_0x2fe358,null));};exports['destroy']=function(_0x3d4acd,_0x365642){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x3d4acd[_0xc868('0x40')]['id']}})[_0xc868('0x22')](handleEntityNotFound(_0x365642,null))[_0xc868('0x22')](removeEntity(_0x365642,null))[_0xc868('0x3f')](handleError(_0x365642,null));};exports['download']=function(_0x4aaf7e,_0x2a1155,_0x2505ab){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x4aaf7e[_0xc868('0x40')]['id']},'attributes':['name','basename',_0xc868('0x4d'),_0xc868('0x4e')],'raw':!![]})[_0xc868('0x22')](handleEntityNotFound(_0x2a1155,null))[_0xc868('0x22')](function(_0x357364){if(_0x357364){if(!fs[_0xc868('0x4f')](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]))){throw new db[(_0xc868('0x53'))][(_0xc868('0x54'))](_0xc868('0x55'));}if(_0x4aaf7e['query'][_0xc868('0x56')]){return _0x2a1155['sendStatus'](0xc8);}return _0x2a1155['download'](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]),util['format'](_0xc868('0x57'),_0x357364[_0xc868('0x58')]||_0x357364['name'],_0x357364[_0xc868('0x4e')][_0xc868('0x59')]()));}})[_0xc868('0x3f')](handleError(_0x2a1155,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index e24b4dd..aaec26e 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 _0xe912=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x5dc755,_0x3254d0){var _0x24ce81=function(_0x3c8315){while(--_0x3c8315){_0x5dc755['push'](_0x5dc755['shift']());}};_0x24ce81(++_0x3254d0);}(_0xe912,0xb5));var _0x2e91=function(_0x5e9f46,_0x4967c9){_0x5e9f46=_0x5e9f46-0x0;var _0x3ad20c=_0xe912[_0x5e9f46];return _0x3ad20c;};'use strict';var _=require(_0x2e91('0x0'));var util=require(_0x2e91('0x1'));var logger=require(_0x2e91('0x2'))(_0x2e91('0x3'));var moment=require(_0x2e91('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e91('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e91('0x6'));var config=require(_0x2e91('0x7'));var attributes=require(_0x2e91('0x8'));module[_0x2e91('0x9')]=function(_0x2a7583,_0x29080e){return _0x2a7583[_0x2e91('0xa')](_0x2e91('0xb'),attributes,{'tableName':_0x2e91('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38c8=['api','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0xd9a887,_0x51bfb3){var _0x331b9f=function(_0x22f5bb){while(--_0x22f5bb){_0xd9a887['push'](_0xd9a887['shift']());}};_0x331b9f(++_0x51bfb3);}(_0x38c8,0x1e2));var _0x838c=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x38c8[_0x4667b2];return _0x1070f2;};'use strict';var _=require(_0x838c('0x0'));var util=require(_0x838c('0x1'));var logger=require('../../config/logger')(_0x838c('0x2'));var moment=require('moment');var BPromise=require(_0x838c('0x3'));var rp=require(_0x838c('0x4'));var fs=require('fs');var path=require(_0x838c('0x5'));var rimraf=require(_0x838c('0x6'));var config=require('../../config/environment');var attributes=require(_0x838c('0x7'));module[_0x838c('0x8')]=function(_0x5bb480,_0xc948ca){return _0x5bb480[_0x838c('0x9')](_0x838c('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 6655d4b..4f1b630 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 _0x3bc4=['error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x3b2191,_0x13dba7){var _0x2c6233=function(_0x1247fb){while(--_0x1247fb){_0x3b2191['push'](_0x3b2191['shift']());}};_0x2c6233(++_0x13dba7);}(_0x3bc4,0xc9));var _0x43bc=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0x3bc4[_0x41930d];return _0x455ade;};'use strict';var _=require('lodash');var util=require(_0x43bc('0x0'));var moment=require(_0x43bc('0x1'));var BPromise=require(_0x43bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43bc('0x3'));var db=require(_0x43bc('0x4'))['db'];var utils=require(_0x43bc('0x5'));var logger=require(_0x43bc('0x6'))(_0x43bc('0x7'));var config=require(_0x43bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43bc('0x9')][_0x43bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3037ba,_0x2cb9a8,_0x22a9fc){return new BPromise(function(_0x3926a4,_0x18cdef){return client[_0x43bc('0xb')](_0x3037ba,_0x22a9fc)[_0x43bc('0xc')](function(_0x1088d9){logger[_0x43bc('0xd')](_0x43bc('0xe'),_0x2cb9a8,'request\x20sent');logger['debug'](_0x43bc('0xf'),_0x2cb9a8,_0x43bc('0x10'),JSON[_0x43bc('0x11')](_0x1088d9));if(_0x1088d9['error']){if(_0x1088d9['error'][_0x43bc('0x12')]===0x1f4){logger[_0x43bc('0x13')](_0x43bc('0xe'),_0x2cb9a8,_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);return _0x18cdef(_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);}logger[_0x43bc('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2cb9a8,_0x1088d9['error'][_0x43bc('0x14')]);return _0x3926a4(_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);}else{logger[_0x43bc('0xd')](_0x43bc('0xe'),_0x2cb9a8,_0x43bc('0x10'));_0x3926a4(_0x1088d9['result'][_0x43bc('0x14')]);}})[_0x43bc('0x15')](function(_0x17e0e0){logger[_0x43bc('0x13')](_0x43bc('0xe'),_0x2cb9a8,_0x17e0e0);_0x18cdef(_0x17e0e0);});});} \ No newline at end of file +var _0x0f7f=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x26df46,_0x5badde){var _0x1722bf=function(_0x38d7cf){while(--_0x38d7cf){_0x26df46['push'](_0x26df46['shift']());}};_0x1722bf(++_0x5badde);}(_0x0f7f,0x1cf));var _0xf0f7=function(_0x1156e1,_0x1844bc){_0x1156e1=_0x1156e1-0x0;var _0x18969e=_0x0f7f[_0x1156e1];return _0x18969e;};'use strict';var _=require(_0xf0f7('0x0'));var util=require('util');var moment=require(_0xf0f7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0f7('0x2'));var fs=require('fs');var Redis=require(_0xf0f7('0x3'));var db=require(_0xf0f7('0x4'))['db'];var utils=require(_0xf0f7('0x5'));var logger=require('../../config/logger')(_0xf0f7('0x6'));var config=require(_0xf0f7('0x7'));var jayson=require(_0xf0f7('0x8'));var client=jayson[_0xf0f7('0x9')][_0xf0f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c01b,_0x165652,_0x47835a){return new BPromise(function(_0x413ea3,_0x22ba33){return client[_0xf0f7('0xb')](_0x56c01b,_0x47835a)[_0xf0f7('0xc')](function(_0x2d2473){logger['info'](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));logger[_0xf0f7('0xf')](_0xf0f7('0x10'),_0x165652,_0xf0f7('0xe'),JSON['stringify'](_0x2d2473));if(_0x2d2473[_0xf0f7('0x11')]){if(_0x2d2473['error'][_0xf0f7('0x12')]===0x1f4){logger[_0xf0f7('0x11')](_0xf0f7('0xd'),_0x165652,_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);return _0x22ba33(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}logger['error'](_0xf0f7('0xd'),_0x165652,_0x2d2473['error'][_0xf0f7('0x13')]);return _0x413ea3(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}else{logger[_0xf0f7('0x14')](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));_0x413ea3(_0x2d2473[_0xf0f7('0x15')]['message']);}})['catch'](function(_0x2c14c8){logger[_0xf0f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x165652,_0x2c14c8);_0x22ba33(_0x2c14c8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0c496cb..8ba2f7d 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 _0xd12f=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','put','delete','destroy','multer','util','express','fs-extra'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd12f,0x13f));var _0xfd12=function(_0x20261c,_0x215fa9){_0x20261c=_0x20261c-0x0;var _0x44b50=_0xd12f[_0x20261c];return _0x44b50;};'use strict';var multer=require(_0xfd12('0x0'));var util=require(_0xfd12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd12('0x2'));var router=express['Router']();var fs_extra=require(_0xfd12('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd12('0x4'));var config=require(_0xfd12('0x5'));var controller=require(_0xfd12('0x6'));router[_0xfd12('0x7')]('/',auth[_0xfd12('0x8')](),controller[_0xfd12('0x9')]);router[_0xfd12('0x7')](_0xfd12('0xa'),auth['isAuthenticated'](),controller[_0xfd12('0xb')]);router[_0xfd12('0x7')](_0xfd12('0xc'),auth[_0xfd12('0x8')](),controller[_0xfd12('0xd')]);router['post']('/',auth[_0xfd12('0x8')](),controller['create']);router[_0xfd12('0xe')](_0xfd12('0xa'),auth[_0xfd12('0x8')](),controller['update']);router[_0xfd12('0xf')](_0xfd12('0xa'),auth[_0xfd12('0x8')](),controller[_0xfd12('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa197=['show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1302ef,_0x57e326){var _0x5f3c4e=function(_0x4ca663){while(--_0x4ca663){_0x1302ef['push'](_0x1302ef['shift']());}};_0x5f3c4e(++_0x57e326);}(_0xa197,0x8c));var _0x7a19=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xa197[_0x519756];return _0x37047e;};'use strict';var multer=require(_0x7a19('0x0'));var util=require(_0x7a19('0x1'));var path=require(_0x7a19('0x2'));var timeout=require(_0x7a19('0x3'));var express=require('express');var router=express[_0x7a19('0x4')]();var fs_extra=require(_0x7a19('0x5'));var auth=require(_0x7a19('0x6'));var interaction=require(_0x7a19('0x7'));var config=require(_0x7a19('0x8'));var controller=require(_0x7a19('0x9'));router[_0x7a19('0xa')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0xc')]);router[_0x7a19('0xa')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0xe')]);router[_0x7a19('0xa')](_0x7a19('0xf'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x10')]);router[_0x7a19('0x11')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0x12')]);router['put'](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x13')]);router[_0x7a19('0x14')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller['destroy']);module[_0x7a19('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e7d7fa1..6b1412c 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 _0x4cf5=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4cf5,0x17f));var _0x54cf=function(_0x44f1d6,_0x1f9336){_0x44f1d6=_0x44f1d6-0x0;var _0x49a030=_0x4cf5[_0x44f1d6];return _0x49a030;};'use strict';var Sequelize=require(_0x54cf('0x0'));module['exports']={'field':{'type':Sequelize[_0x54cf('0x1')]},'alias':{'type':Sequelize[_0x54cf('0x2')]},'function':{'type':Sequelize[_0x54cf('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x54cf('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x54cf('0x2')]},'custom':{'type':Sequelize[_0x54cf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfe1f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0xfe1f,0x97));var _0xffe1=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0xfe1f[_0x295143];return _0x7982e4;};'use strict';var Sequelize=require(_0xffe1('0x0'));module[_0xffe1('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xffe1('0x2')]},'groupBy':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xffe1('0x2')]},'custom':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9b33b84..4d548e3 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 _0x5937=['pick','filter','where','merge','type','VIRTUAL','AnalyticFieldReport','include','findAll','rows','show','params','keys','filters','intersection','fields','includeAll','options','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x31417e,_0x424f9a){var _0x3a7cee=function(_0x6024fd){while(--_0x6024fd){_0x31417e['push'](_0x31417e['shift']());}};_0x3a7cee(++_0x424f9a);}(_0x5937,0x1c3));var _0x7593=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5937[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x7593('0x0'));var rimraf=require(_0x7593('0x1'));var zipdir=require(_0x7593('0x2'));var jsonpatch=require(_0x7593('0x3'));var rp=require('request-promise');var moment=require(_0x7593('0x4'));var BPromise=require(_0x7593('0x5'));var Mustache=require('mustache');var util=require(_0x7593('0x6'));var path=require('path');var sox=require(_0x7593('0x7'));var csv=require(_0x7593('0x8'));var ejs=require(_0x7593('0x9'));var fs=require('fs');var fs_extra=require(_0x7593('0xa'));var _=require('lodash');var squel=require(_0x7593('0xb'));var crypto=require(_0x7593('0xc'));var jsforce=require(_0x7593('0xd'));var deskjs=require(_0x7593('0xe'));var toCsv=require(_0x7593('0x8'));var querystring=require(_0x7593('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7593('0x10'));var qs=require(_0x7593('0x11'));var as=require(_0x7593('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7593('0x13'))(_0x7593('0x14'));var utils=require('../../config/utils');var config=require(_0x7593('0x15'));var licenseUtil=require(_0x7593('0x16'));var db=require(_0x7593('0x17'))['db'];function respondWithStatusCode(_0x9bf4b7,_0x187f40){_0x187f40=_0x187f40||0xcc;return function(_0x18a1f0){if(_0x18a1f0){return _0x9bf4b7[_0x7593('0x18')](_0x187f40);}return _0x9bf4b7['status'](_0x187f40)['end']();};}function respondWithResult(_0x483def,_0x27e0aa){_0x27e0aa=_0x27e0aa||0xc8;return function(_0x4e2a2e){if(_0x4e2a2e){return _0x483def[_0x7593('0x19')](_0x27e0aa)[_0x7593('0x1a')](_0x4e2a2e);}};}function respondWithFilteredResult(_0x3ede67,_0x12718b){return function(_0x36746b){if(_0x36746b){var _0x5a1ede=typeof _0x12718b[_0x7593('0x1b')]===_0x7593('0x1c')&&typeof _0x12718b['limit']==='undefined';var _0x556d06=_0x36746b[_0x7593('0x1d')];var _0x549969=_0x5a1ede?0x0:_0x12718b[_0x7593('0x1b')];var _0x554b75=_0x5a1ede?_0x36746b['count']:_0x12718b[_0x7593('0x1b')]+_0x12718b[_0x7593('0x1e')];var _0x2ec661;if(_0x554b75>=_0x556d06){_0x554b75=_0x556d06;_0x2ec661=0xc8;}else{_0x2ec661=0xce;}_0x3ede67['status'](_0x2ec661);return _0x3ede67['set'](_0x7593('0x1f'),_0x549969+'-'+_0x554b75+'/'+_0x556d06)[_0x7593('0x1a')](_0x36746b);}return null;};}function patchUpdates(_0x26369f){return function(_0x62e291){try{jsonpatch[_0x7593('0x20')](_0x62e291,_0x26369f,!![]);}catch(_0x5c2dac){return BPromise[_0x7593('0x21')](_0x5c2dac);}return _0x62e291['save']();};}function saveUpdates(_0x9fc481,_0x5206a3){return function(_0x25d6c1){if(_0x25d6c1){return _0x25d6c1[_0x7593('0x22')](_0x9fc481)[_0x7593('0x23')](function(_0x41cee8){return _0x41cee8;});}return null;};}function removeEntity(_0x266055,_0x12ae02){return function(_0x3e911f){if(_0x3e911f){return _0x3e911f[_0x7593('0x24')]()['then'](function(){_0x266055[_0x7593('0x19')](0xcc)[_0x7593('0x25')]();});}};}function handleEntityNotFound(_0x19106a,_0x57066a){return function(_0x3ee81d){if(!_0x3ee81d){_0x19106a['sendStatus'](0x194);}return _0x3ee81d;};}function handleError(_0x26c88d,_0x53efc1){_0x53efc1=_0x53efc1||0x1f4;return function(_0x5576fa){logger[_0x7593('0x26')](_0x5576fa[_0x7593('0x27')]);if(_0x5576fa['name']){delete _0x5576fa[_0x7593('0x28')];}_0x26c88d[_0x7593('0x19')](_0x53efc1)[_0x7593('0x29')](_0x5576fa);};}exports[_0x7593('0x2a')]=function(_0x390d11,_0x47acee){var _0x11696a={},_0x5abe56={},_0x15e682={'count':0x0,'rows':[]};var _0xa69d73=_[_0x7593('0x2b')](db['AnalyticFieldReport'][_0x7593('0x2c')],function(_0x307845){return{'name':_0x307845[_0x7593('0x2d')],'type':_0x307845['type']['key']};});_0x5abe56[_0x7593('0x2e')]=_[_0x7593('0x2b')](_0xa69d73,'name');_0x5abe56[_0x7593('0x2f')]=_['keys'](_0x390d11[_0x7593('0x2f')]);_0x5abe56['filters']=_['intersection'](_0x5abe56[_0x7593('0x2e')],_0x5abe56[_0x7593('0x2f')]);_0x11696a['attributes']=_['intersection'](_0x5abe56[_0x7593('0x2e')],qs['fields'](_0x390d11[_0x7593('0x2f')]['fields']));_0x11696a[_0x7593('0x30')]=_0x11696a['attributes'][_0x7593('0x31')]?_0x11696a['attributes']:_0x5abe56[_0x7593('0x2e')];if(!_0x390d11[_0x7593('0x2f')][_0x7593('0x32')](_0x7593('0x33'))){_0x11696a[_0x7593('0x1e')]=qs['limit'](_0x390d11['query']['limit']);_0x11696a[_0x7593('0x1b')]=qs['offset'](_0x390d11[_0x7593('0x2f')]['offset']);}_0x11696a['order']=qs[_0x7593('0x34')](_0x390d11[_0x7593('0x2f')][_0x7593('0x34')]);_0x11696a['where']=qs['filters'](_[_0x7593('0x35')](_0x390d11['query'],_0x5abe56['filters']),_0xa69d73);if(_0x390d11[_0x7593('0x2f')][_0x7593('0x36')]){_0x11696a[_0x7593('0x37')]=_[_0x7593('0x38')](_0x11696a[_0x7593('0x37')],{'$or':_[_0x7593('0x2b')](_0xa69d73,function(_0x5909ba){if(_0x5909ba[_0x7593('0x39')]!==_0x7593('0x3a')){var _0x21f027={};_0x21f027[_0x5909ba[_0x7593('0x28')]]={'$like':'%'+_0x390d11[_0x7593('0x2f')]['filter']+'%'};return _0x21f027;}})});}_0x11696a=_['merge']({},_0x11696a,_0x390d11['options']);var _0x33b1c7={'where':_0x11696a[_0x7593('0x37')]};return db[_0x7593('0x3b')][_0x7593('0x1d')](_0x33b1c7)[_0x7593('0x23')](function(_0x37826c){_0x15e682[_0x7593('0x1d')]=_0x37826c;if(_0x390d11[_0x7593('0x2f')]['includeAll']){_0x11696a[_0x7593('0x3c')]=[{'all':!![]}];}return db[_0x7593('0x3b')][_0x7593('0x3d')](_0x11696a);})[_0x7593('0x23')](function(_0x2509bf){_0x15e682[_0x7593('0x3e')]=_0x2509bf;return _0x15e682;})['then'](respondWithFilteredResult(_0x47acee,_0x11696a))['catch'](handleError(_0x47acee,null));};exports[_0x7593('0x3f')]=function(_0x27aac6,_0x198626){var _0x32c862={'raw':![],'where':{'id':_0x27aac6[_0x7593('0x40')]['id']}},_0xfbbdf1={};_0xfbbdf1[_0x7593('0x2e')]=_[_0x7593('0x41')](db[_0x7593('0x3b')][_0x7593('0x2c')]);_0xfbbdf1[_0x7593('0x2f')]=_['keys'](_0x27aac6[_0x7593('0x2f')]);_0xfbbdf1[_0x7593('0x42')]=_[_0x7593('0x43')](_0xfbbdf1[_0x7593('0x2e')],_0xfbbdf1[_0x7593('0x2f')]);_0x32c862['attributes']=_[_0x7593('0x43')](_0xfbbdf1['model'],qs[_0x7593('0x44')](_0x27aac6[_0x7593('0x2f')][_0x7593('0x44')]));_0x32c862[_0x7593('0x30')]=_0x32c862[_0x7593('0x30')][_0x7593('0x31')]?_0x32c862[_0x7593('0x30')]:_0xfbbdf1[_0x7593('0x2e')];if(_0x27aac6[_0x7593('0x2f')][_0x7593('0x45')]){_0x32c862['include']=[{'all':!![]}];}_0x32c862=_[_0x7593('0x38')]({},_0x32c862,_0x27aac6[_0x7593('0x46')]);return db[_0x7593('0x3b')][_0x7593('0x47')](_0x32c862)[_0x7593('0x23')](handleEntityNotFound(_0x198626,null))[_0x7593('0x23')](respondWithResult(_0x198626,null))[_0x7593('0x48')](handleError(_0x198626,null));};exports[_0x7593('0x49')]=function(_0x122a46,_0x4094c0){return db[_0x7593('0x3b')][_0x7593('0x49')](_0x122a46['body'],{})['then'](respondWithResult(_0x4094c0,0xc9))[_0x7593('0x48')](handleError(_0x4094c0,null));};exports[_0x7593('0x4a')]=function(_0x3ffed5,_0x5f0186){return db[_0x7593('0x3b')][_0x7593('0x4a')](_0x3ffed5['body'],{'raw':![],'individualHooks':!![]})[_0x7593('0x23')](respondWithResult(_0x5f0186,0xc9))[_0x7593('0x48')](handleError(_0x5f0186,null));};exports[_0x7593('0x22')]=function(_0x17e271,_0x13b8b0){if(_0x17e271['body']['id']){delete _0x17e271[_0x7593('0x4b')]['id'];}return db[_0x7593('0x3b')]['find']({'where':{'id':_0x17e271[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x13b8b0,null))[_0x7593('0x23')](saveUpdates(_0x17e271[_0x7593('0x4b')],null))[_0x7593('0x23')](respondWithResult(_0x13b8b0,null))[_0x7593('0x48')](handleError(_0x13b8b0,null));};exports['destroy']=function(_0x39395a,_0x2741b7){return db['AnalyticFieldReport'][_0x7593('0x47')]({'where':{'id':_0x39395a[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x2741b7,null))[_0x7593('0x23')](removeEntity(_0x2741b7,null))[_0x7593('0x48')](handleError(_0x2741b7,null));};exports[_0x7593('0x4c')]=function(_0x1663ee,_0x27a2a6){return db[_0x7593('0x3b')][_0x7593('0x24')]({'where':{'id':_0x1663ee[_0x7593('0x2f')][_0x7593('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27a2a6,0xcc))[_0x7593('0x48')](handleError(_0x27a2a6,null));};exports[_0x7593('0x4e')]=function(_0x4f5f56,_0x57bd3f,_0x5a653b){return db[_0x7593('0x4f')][_0x7593('0x50')]({'where':{'id':_0x4f5f56[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x57bd3f,null))['then'](function(_0x440c67){if(_0x440c67){return db[_0x7593('0x51')][_0x7593('0x52')](function(_0x2b050c){return db[_0x7593('0x3b')]['destroy']({'where':{'CustomReportId':_0x4f5f56[_0x7593('0x40')]['id']},'transaction':_0x2b050c})[_0x7593('0x23')](function(_0x13d5d8){var _0x5b25c7=_['map'](_0x4f5f56[_0x7593('0x4b')],function(_0xdeb4ca){delete _0xdeb4ca['id'];_0xdeb4ca[_0x7593('0x53')]=_0x4f5f56[_0x7593('0x40')]['id'];return _0xdeb4ca;});return db[_0x7593('0x3b')]['bulkCreate'](_0x5b25c7,{'transaction':_0x2b050c});});})[_0x7593('0x23')](function(){return db[_0x7593('0x3b')]['findAll']({'where':{'CustomReportId':_0x4f5f56[_0x7593('0x40')]['id']}});});}})[_0x7593('0x23')](respondWithResult(_0x57bd3f,null))[_0x7593('0x48')](handleError(_0x57bd3f,null));}; \ No newline at end of file +var _0xd147=['rows','catch','show','keys','merge','options','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','includeAll','include'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0xd147,0xb1));var _0x7d14=function(_0x4791bb,_0x191223){_0x4791bb=_0x4791bb-0x0;var _0x3431b2=_0xd147[_0x4791bb];return _0x3431b2;};'use strict';var emlformat=require(_0x7d14('0x0'));var rimraf=require(_0x7d14('0x1'));var zipdir=require(_0x7d14('0x2'));var jsonpatch=require(_0x7d14('0x3'));var rp=require(_0x7d14('0x4'));var moment=require(_0x7d14('0x5'));var BPromise=require(_0x7d14('0x6'));var Mustache=require(_0x7d14('0x7'));var util=require(_0x7d14('0x8'));var path=require(_0x7d14('0x9'));var sox=require(_0x7d14('0xa'));var csv=require(_0x7d14('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d14('0xc'));var _=require(_0x7d14('0xd'));var squel=require('squel');var crypto=require(_0x7d14('0xe'));var jsforce=require(_0x7d14('0xf'));var deskjs=require(_0x7d14('0x10'));var toCsv=require(_0x7d14('0xb'));var querystring=require(_0x7d14('0x11'));var Papa=require('papaparse');var Redis=require(_0x7d14('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7d14('0x13'));var as=require(_0x7d14('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d14('0x15'))('api');var utils=require(_0x7d14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7d14('0x17'));var db=require(_0x7d14('0x18'))['db'];function respondWithStatusCode(_0x20e251,_0x40833a){_0x40833a=_0x40833a||0xcc;return function(_0x3c9123){if(_0x3c9123){return _0x20e251[_0x7d14('0x19')](_0x40833a);}return _0x20e251[_0x7d14('0x1a')](_0x40833a)['end']();};}function respondWithResult(_0xda8910,_0x599115){_0x599115=_0x599115||0xc8;return function(_0x4369e8){if(_0x4369e8){return _0xda8910[_0x7d14('0x1a')](_0x599115)[_0x7d14('0x1b')](_0x4369e8);}};}function respondWithFilteredResult(_0x5e58f3,_0x2b159a){return function(_0x22a594){if(_0x22a594){var _0xaaceba=typeof _0x2b159a[_0x7d14('0x1c')]===_0x7d14('0x1d')&&typeof _0x2b159a[_0x7d14('0x1e')]===_0x7d14('0x1d');var _0x2d5ca7=_0x22a594[_0x7d14('0x1f')];var _0x447729=_0xaaceba?0x0:_0x2b159a['offset'];var _0x4ae848=_0xaaceba?_0x22a594[_0x7d14('0x1f')]:_0x2b159a[_0x7d14('0x1c')]+_0x2b159a['limit'];var _0xac70a9;if(_0x4ae848>=_0x2d5ca7){_0x4ae848=_0x2d5ca7;_0xac70a9=0xc8;}else{_0xac70a9=0xce;}_0x5e58f3[_0x7d14('0x1a')](_0xac70a9);return _0x5e58f3[_0x7d14('0x20')]('Content-Range',_0x447729+'-'+_0x4ae848+'/'+_0x2d5ca7)['json'](_0x22a594);}return null;};}function patchUpdates(_0x47e05a){return function(_0x4cea4d){try{jsonpatch[_0x7d14('0x21')](_0x4cea4d,_0x47e05a,!![]);}catch(_0x25005f){return BPromise[_0x7d14('0x22')](_0x25005f);}return _0x4cea4d['save']();};}function saveUpdates(_0x1ee50b,_0x152f7d){return function(_0x156ada){if(_0x156ada){return _0x156ada[_0x7d14('0x23')](_0x1ee50b)[_0x7d14('0x24')](function(_0x216f18){return _0x216f18;});}return null;};}function removeEntity(_0x29c28d,_0x565bf6){return function(_0xf1cf06){if(_0xf1cf06){return _0xf1cf06[_0x7d14('0x25')]()[_0x7d14('0x24')](function(){_0x29c28d[_0x7d14('0x1a')](0xcc)[_0x7d14('0x26')]();});}};}function handleEntityNotFound(_0x346350,_0xce1af7){return function(_0x18dad3){if(!_0x18dad3){_0x346350[_0x7d14('0x19')](0x194);}return _0x18dad3;};}function handleError(_0x12db7e,_0x2acaa4){_0x2acaa4=_0x2acaa4||0x1f4;return function(_0x55f7ce){logger[_0x7d14('0x27')](_0x55f7ce[_0x7d14('0x28')]);if(_0x55f7ce[_0x7d14('0x29')]){delete _0x55f7ce[_0x7d14('0x29')];}_0x12db7e[_0x7d14('0x1a')](_0x2acaa4)['send'](_0x55f7ce);};}exports[_0x7d14('0x2a')]=function(_0x494ef5,_0x25f456){var _0x1c7d47={},_0x2bf100={},_0x510e20={'count':0x0,'rows':[]};var _0x43ded7=_[_0x7d14('0x2b')](db[_0x7d14('0x2c')][_0x7d14('0x2d')],function(_0x117e22){return{'name':_0x117e22[_0x7d14('0x2e')],'type':_0x117e22['type']['key']};});_0x2bf100['model']=_[_0x7d14('0x2b')](_0x43ded7,_0x7d14('0x29'));_0x2bf100[_0x7d14('0x2f')]=_['keys'](_0x494ef5['query']);_0x2bf100[_0x7d14('0x30')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],_0x2bf100[_0x7d14('0x2f')]);_0x1c7d47[_0x7d14('0x33')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],qs['fields'](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x1c7d47[_0x7d14('0x33')]=_0x1c7d47[_0x7d14('0x33')][_0x7d14('0x35')]?_0x1c7d47[_0x7d14('0x33')]:_0x2bf100[_0x7d14('0x32')];if(!_0x494ef5['query']['hasOwnProperty'](_0x7d14('0x36'))){_0x1c7d47['limit']=qs[_0x7d14('0x1e')](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x1e')]);_0x1c7d47[_0x7d14('0x1c')]=qs[_0x7d14('0x1c')](_0x494ef5['query'][_0x7d14('0x1c')]);}_0x1c7d47[_0x7d14('0x37')]=qs[_0x7d14('0x38')](_0x494ef5[_0x7d14('0x2f')]['sort']);_0x1c7d47['where']=qs['filters'](_['pick'](_0x494ef5['query'],_0x2bf100[_0x7d14('0x30')]),_0x43ded7);if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]){_0x1c7d47[_0x7d14('0x3a')]=_['merge'](_0x1c7d47['where'],{'$or':_[_0x7d14('0x2b')](_0x43ded7,function(_0x5b9c88){if(_0x5b9c88[_0x7d14('0x3b')]!==_0x7d14('0x3c')){var _0x3c3e66={};_0x3c3e66[_0x5b9c88[_0x7d14('0x29')]]={'$like':'%'+_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]+'%'};return _0x3c3e66;}})});}_0x1c7d47=_['merge']({},_0x1c7d47,_0x494ef5['options']);var _0x4432d9={'where':_0x1c7d47[_0x7d14('0x3a')]};return db[_0x7d14('0x2c')][_0x7d14('0x1f')](_0x4432d9)[_0x7d14('0x24')](function(_0x15b569){_0x510e20[_0x7d14('0x1f')]=_0x15b569;if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x1c7d47[_0x7d14('0x3e')]=[{'all':!![]}];}return db[_0x7d14('0x2c')]['findAll'](_0x1c7d47);})[_0x7d14('0x24')](function(_0x57b514){_0x510e20[_0x7d14('0x3f')]=_0x57b514;return _0x510e20;})[_0x7d14('0x24')](respondWithFilteredResult(_0x25f456,_0x1c7d47))[_0x7d14('0x40')](handleError(_0x25f456,null));};exports[_0x7d14('0x41')]=function(_0x371be0,_0x1affd5){var _0x34563f={'raw':![],'where':{'id':_0x371be0['params']['id']}},_0x4519bf={};_0x4519bf['model']=_['keys'](db[_0x7d14('0x2c')][_0x7d14('0x2d')]);_0x4519bf[_0x7d14('0x2f')]=_[_0x7d14('0x42')](_0x371be0[_0x7d14('0x2f')]);_0x4519bf['filters']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],_0x4519bf['query']);_0x34563f['attributes']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],qs[_0x7d14('0x34')](_0x371be0[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x34563f['attributes']=_0x34563f[_0x7d14('0x33')][_0x7d14('0x35')]?_0x34563f[_0x7d14('0x33')]:_0x4519bf[_0x7d14('0x32')];if(_0x371be0[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x34563f[_0x7d14('0x3e')]=[{'all':!![]}];}_0x34563f=_[_0x7d14('0x43')]({},_0x34563f,_0x371be0[_0x7d14('0x44')]);return db[_0x7d14('0x2c')][_0x7d14('0x45')](_0x34563f)['then'](handleEntityNotFound(_0x1affd5,null))[_0x7d14('0x24')](respondWithResult(_0x1affd5,null))['catch'](handleError(_0x1affd5,null));};exports[_0x7d14('0x46')]=function(_0x5c90a0,_0x4414bc){return db[_0x7d14('0x2c')][_0x7d14('0x46')](_0x5c90a0[_0x7d14('0x47')],{})[_0x7d14('0x24')](respondWithResult(_0x4414bc,0xc9))[_0x7d14('0x40')](handleError(_0x4414bc,null));};exports[_0x7d14('0x48')]=function(_0x549ec6,_0xff1fda){return db['AnalyticFieldReport']['bulkCreate'](_0x549ec6[_0x7d14('0x47')],{'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0xff1fda,0xc9))[_0x7d14('0x40')](handleError(_0xff1fda,null));};exports[_0x7d14('0x23')]=function(_0x3a810e,_0x1a049a){if(_0x3a810e['body']['id']){delete _0x3a810e[_0x7d14('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7d14('0x45')]({'where':{'id':_0x3a810e[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x1a049a,null))[_0x7d14('0x24')](saveUpdates(_0x3a810e[_0x7d14('0x47')],null))[_0x7d14('0x24')](respondWithResult(_0x1a049a,null))[_0x7d14('0x40')](handleError(_0x1a049a,null));};exports[_0x7d14('0x25')]=function(_0x2bfc0c,_0x340429){return db[_0x7d14('0x2c')][_0x7d14('0x45')]({'where':{'id':_0x2bfc0c[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x340429,null))[_0x7d14('0x24')](removeEntity(_0x340429,null))[_0x7d14('0x40')](handleError(_0x340429,null));};exports['bulkDestroy']=function(_0x223cf4,_0x436de1){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'id':_0x223cf4[_0x7d14('0x2f')][_0x7d14('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0x436de1,0xcc))[_0x7d14('0x40')](handleError(_0x436de1,null));};exports[_0x7d14('0x4b')]=function(_0x21353a,_0x3263d8,_0x1ad263){return db[_0x7d14('0x4c')]['findOne']({'where':{'id':_0x21353a[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x3263d8,null))[_0x7d14('0x24')](function(_0x2f766e){if(_0x2f766e){return db[_0x7d14('0x4d')][_0x7d14('0x4e')](function(_0x1fa00e){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']},'transaction':_0x1fa00e})['then'](function(_0x982741){var _0x14bc5b=_['map'](_0x21353a[_0x7d14('0x47')],function(_0x20c627){delete _0x20c627['id'];_0x20c627[_0x7d14('0x4f')]=_0x21353a[_0x7d14('0x49')]['id'];return _0x20c627;});return db[_0x7d14('0x2c')][_0x7d14('0x48')](_0x14bc5b,{'transaction':_0x1fa00e});});})[_0x7d14('0x24')](function(){return db[_0x7d14('0x2c')]['findAll']({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']}});});}})['then'](respondWithResult(_0x3263d8,null))[_0x7d14('0x40')](handleError(_0x3263d8,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index b928b2b..1434ba9 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 _0xcec5=['define','AnalyticFieldReport','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x338b5c,_0x1a4fec){var _0x2f9a67=function(_0x15015e){while(--_0x15015e){_0x338b5c['push'](_0x338b5c['shift']());}};_0x2f9a67(++_0x1a4fec);}(_0xcec5,0x11a));var _0x5cec=function(_0x3d244b,_0x34a8ce){_0x3d244b=_0x3d244b-0x0;var _0x1c7af2=_0xcec5[_0x3d244b];return _0x1c7af2;};'use strict';var _=require('lodash');var util=require(_0x5cec('0x0'));var logger=require(_0x5cec('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5cec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cec('0x3'));var rimraf=require(_0x5cec('0x4'));var config=require(_0x5cec('0x5'));var attributes=require(_0x5cec('0x6'));module[_0x5cec('0x7')]=function(_0x16d881,_0x2bc1a8){return _0x16d881[_0x5cec('0x8')](_0x5cec('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb347=['bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment'];(function(_0x130507,_0x55a00e){var _0x34e1d5=function(_0x4f88bf){while(--_0x4f88bf){_0x130507['push'](_0x130507['shift']());}};_0x34e1d5(++_0x55a00e);}(_0xb347,0x104));var _0x7b34=function(_0x3df874,_0x819192){_0x3df874=_0x3df874-0x0;var _0x1d6b01=_0xb347[_0x3df874];return _0x1d6b01;};'use strict';var _=require(_0x7b34('0x0'));var util=require(_0x7b34('0x1'));var logger=require(_0x7b34('0x2'))('api');var moment=require(_0x7b34('0x3'));var BPromise=require(_0x7b34('0x4'));var rp=require(_0x7b34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b34('0x6'));var config=require(_0x7b34('0x7'));var attributes=require(_0x7b34('0x8'));module[_0x7b34('0x9')]=function(_0x37737f,_0x4f56fd){return _0x37737f['define'](_0x7b34('0xa'),attributes,{'tableName':_0x7b34('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 4549ecf..431ef6a 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 _0x69ea=['debug','stringify','error','code','message','result','catch','util','moment','../../config/environment','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0xb66f92,_0x301f99){var _0x344d2d=function(_0x34378c){while(--_0x34378c){_0xb66f92['push'](_0xb66f92['shift']());}};_0x344d2d(++_0x301f99);}(_0x69ea,0x142));var _0xa69e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x69ea[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xa69e('0x0'));var moment=require(_0xa69e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa69e('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400c4b,_0x42b759,_0x8c4e38){return new BPromise(function(_0x5be6f4,_0x4d4d33){return client[_0xa69e('0x3')](_0x400c4b,_0x8c4e38)[_0xa69e('0x4')](function(_0x5b9440){logger[_0xa69e('0x5')](_0xa69e('0x6'),_0x42b759,_0xa69e('0x7'));logger[_0xa69e('0x8')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x42b759,_0xa69e('0x7'),JSON[_0xa69e('0x9')](_0x5b9440));if(_0x5b9440[_0xa69e('0xa')]){if(_0x5b9440[_0xa69e('0xa')][_0xa69e('0xb')]===0x1f4){logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5b9440[_0xa69e('0xa')][_0xa69e('0xc')]);return _0x4d4d33(_0x5b9440['error'][_0xa69e('0xc')]);}logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5b9440['error']['message']);return _0x5be6f4(_0x5b9440[_0xa69e('0xa')][_0xa69e('0xc')]);}else{logger[_0xa69e('0x5')](_0xa69e('0x6'),_0x42b759,'request\x20sent');_0x5be6f4(_0x5b9440[_0xa69e('0xd')][_0xa69e('0xc')]);}})[_0xa69e('0xe')](function(_0x5d20f3){logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5d20f3);_0x4d4d33(_0x5d20f3);});});} \ No newline at end of file +var _0xb9c6=['../../config/environment','jayson/promise','client','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x15c0a8,_0x3b0c8b){_0x15c0a8=_0x15c0a8-0x0;var _0x4a1943=_0xb9c6[_0x15c0a8];return _0x4a1943;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var moment=require(_0x6b9c('0x2'));var BPromise=require(_0x6b9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b9c('0x4'));var db=require(_0x6b9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6b9c('0x6'));var jayson=require(_0x6b9c('0x7'));var client=jayson[_0x6b9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44b505,_0x91dd39,_0x48a116){return new BPromise(function(_0x353bd3,_0xa3c8a){return client['request'](_0x44b505,_0x48a116)[_0x6b9c('0x9')](function(_0x1e5ce8){logger['info'](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));logger['debug'](_0x6b9c('0xc'),_0x91dd39,_0x6b9c('0xb'),JSON['stringify'](_0x1e5ce8));if(_0x1e5ce8[_0x6b9c('0xd')]){if(_0x1e5ce8['error']['code']===0x1f4){logger[_0x6b9c('0xd')](_0x6b9c('0xa'),_0x91dd39,_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);return _0xa3c8a(_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);}logger[_0x6b9c('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x1e5ce8['error'][_0x6b9c('0xe')]);return _0x353bd3(_0x1e5ce8['error'][_0x6b9c('0xe')]);}else{logger[_0x6b9c('0xf')](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));_0x353bd3(_0x1e5ce8[_0x6b9c('0x10')]['message']);}})[_0x6b9c('0x11')](function(_0x837a13){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x837a13);_0xa3c8a(_0x837a13);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index fea20cc..24ee471 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 _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x26eb68,_0x87ffb2){var _0x4074e5=function(_0xd901d3){while(--_0xd901d3){_0x26eb68['push'](_0x26eb68['shift']());}};_0x4074e5(++_0x87ffb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x25f743,_0x27841d){var _0x48bba1=function(_0x59430c){while(--_0x59430c){_0x25f743['push'](_0x25f743['shift']());}};_0x48bba1(++_0x27841d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 8ab037f..cc0c500 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 _0xee4f=['TEXT','sequelize','name','STRING'];(function(_0x2c94af,_0x179897){var _0x9d1bf6=function(_0x11499c){while(--_0x11499c){_0x2c94af['push'](_0x2c94af['shift']());}};_0x9d1bf6(++_0x179897);}(_0xee4f,0xad));var _0xfee4=function(_0xea6b6a,_0x5de9e5){_0xea6b6a=_0xea6b6a-0x0;var _0x1eeab2=_0xee4f[_0xea6b6a];return _0x1eeab2;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfee4('0x1')},'table':{'type':Sequelize[_0xfee4('0x2')]},'metric':{'type':Sequelize[_0xfee4('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd957=['exports','name','STRING','sequelize'];(function(_0x2191fb,_0x4497b2){var _0x435aa6=function(_0x55b09d){while(--_0x55b09d){_0x2191fb['push'](_0x2191fb['shift']());}};_0x435aa6(++_0x4497b2);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ebda695..aec5ec5 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7da7,0x10d));var _0x77da=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x7da7[_0x285800];return _0x4b809e;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x10c7e0,_0x484507){var _0x330990=function(_0x3b5317){while(--_0x3b5317){_0x10c7e0['push'](_0x10c7e0['shift']());}};_0x330990(++_0x484507);}(_0x425d,0x1e0));var _0xd425=function(_0x2eb207,_0x504197){_0x2eb207=_0x2eb207-0x0;var _0x3afb71=_0x425d[_0x2eb207];return _0x3afb71;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e297f4b..fa835c5 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 _0xbac8=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xbac8,0x140));var _0x8bac=function(_0x13ad5d,_0x4b071b){_0x13ad5d=_0x13ad5d-0x0;var _0x213ef8=_0xbac8[_0x13ad5d];return _0x213ef8;};'use strict';var _=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8bac('0x2'));var BPromise=require(_0x8bac('0x3'));var rp=require(_0x8bac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bac('0x5'));var config=require(_0x8bac('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x28b1d1,_0x36f5b4){return _0x28b1d1[_0x8bac('0x7')](_0x8bac('0x8'),attributes,{'tableName':_0x8bac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f6b=['bluebird','path','rimraf','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x31c3ec,_0x41a015){var _0x319164=function(_0x52c298){while(--_0x52c298){_0x31c3ec['push'](_0x31c3ec['shift']());}};_0x319164(++_0x41a015);}(_0x8f6b,0x146));var _0xb8f6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f6b[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var logger=require(_0xb8f6('0x2'))('api');var moment=require(_0xb8f6('0x3'));var BPromise=require(_0xb8f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8f6('0x5'));var rimraf=require(_0xb8f6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8f6('0x7'));module['exports']=function(_0x332ce0,_0x4c73ad){return _0x332ce0[_0xb8f6('0x8')]('AnalyticMetric',attributes,{'tableName':_0xb8f6('0x9'),'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 5819c5b..f8014eb 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 _0x4572=['then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x227f59,_0xeecf9d){var _0x2da8c0=function(_0xb5319e){while(--_0xb5319e){_0x227f59['push'](_0x227f59['shift']());}};_0x2da8c0(++_0xeecf9d);}(_0x4572,0x106));var _0x2457=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x4572[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x2457('0x0'));var util=require(_0x2457('0x1'));var moment=require(_0x2457('0x2'));var BPromise=require(_0x2457('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2457('0x4'));var db=require(_0x2457('0x5'))['db'];var utils=require(_0x2457('0x6'));var logger=require(_0x2457('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2457('0x8'));var client=jayson['client'][_0x2457('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa34ed6,_0x4c10ca,_0x16ce42){return new BPromise(function(_0x44b5a5,_0xb7cecc){return client[_0x2457('0xa')](_0xa34ed6,_0x16ce42)[_0x2457('0xb')](function(_0x47e881){logger[_0x2457('0xc')](_0x2457('0xd'),_0x4c10ca,'request\x20sent');logger['debug'](_0x2457('0xe'),_0x4c10ca,_0x2457('0xf'),JSON[_0x2457('0x10')](_0x47e881));if(_0x47e881[_0x2457('0x11')]){if(_0x47e881[_0x2457('0x11')][_0x2457('0x12')]===0x1f4){logger['error'](_0x2457('0xd'),_0x4c10ca,_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);return _0xb7cecc(_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);}logger[_0x2457('0x11')](_0x2457('0xd'),_0x4c10ca,_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);return _0x44b5a5(_0x47e881[_0x2457('0x11')]['message']);}else{logger[_0x2457('0xc')](_0x2457('0xd'),_0x4c10ca,_0x2457('0xf'));_0x44b5a5(_0x47e881['result'][_0x2457('0x13')]);}})[_0x2457('0x14')](function(_0x2079e7){logger[_0x2457('0x11')](_0x2457('0xd'),_0x4c10ca,_0x2079e7);_0xb7cecc(_0x2079e7);});});} \ No newline at end of file +var _0x0639=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','moment','bluebird'];(function(_0x35b7a3,_0x9e0044){var _0x3be8e4=function(_0x1407ae){while(--_0x1407ae){_0x35b7a3['push'](_0x35b7a3['shift']());}};_0x3be8e4(++_0x9e0044);}(_0x0639,0x173));var _0x9063=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x0639[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x9063('0x0'));var util=require('util');var moment=require(_0x9063('0x1'));var BPromise=require(_0x9063('0x2'));var rs=require(_0x9063('0x3'));var fs=require('fs');var Redis=require(_0x9063('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9063('0x5'));var logger=require(_0x9063('0x6'))(_0x9063('0x7'));var config=require(_0x9063('0x8'));var jayson=require(_0x9063('0x9'));var client=jayson[_0x9063('0xa')][_0x9063('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x582d15,_0x46bc11,_0x34398d){return new BPromise(function(_0x1b1940,_0x5b1cd5){return client[_0x9063('0xc')](_0x582d15,_0x34398d)['then'](function(_0x23bcdc){logger[_0x9063('0xd')](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));logger[_0x9063('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46bc11,_0x9063('0xf'),JSON[_0x9063('0x11')](_0x23bcdc));if(_0x23bcdc['error']){if(_0x23bcdc['error'][_0x9063('0x12')]===0x1f4){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x5b1cd5(_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);}logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x1b1940(_0x23bcdc['error'][_0x9063('0x14')]);}else{logger['info'](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));_0x1b1940(_0x23bcdc['result'][_0x9063('0x14')]);}})[_0x9063('0x15')](function(_0x29c1bf){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x29c1bf);_0x5b1cd5(_0x29c1bf);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 49f3eb3..e89adc8 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 _0x88b0=['../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','update','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x16dfb3,_0x1613fc){var _0x1d8030=function(_0x1bd5da){while(--_0x1bd5da){_0x16dfb3['push'](_0x16dfb3['shift']());}};_0x1d8030(++_0x1613fc);}(_0x88b0,0x1cb));var _0x088b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x88b0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x088b('0x0'));var util=require(_0x088b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x088b('0x2'));var router=express[_0x088b('0x3')]();var fs_extra=require(_0x088b('0x4'));var auth=require(_0x088b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x088b('0x6'));var controller=require(_0x088b('0x7'));router[_0x088b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x088b('0x8')](_0x088b('0x9'),auth[_0x088b('0xa')](),controller[_0x088b('0xb')]);router[_0x088b('0xc')]('/',auth[_0x088b('0xa')](),controller[_0x088b('0xd')]);router['put'](_0x088b('0x9'),auth['isAuthenticated'](),controller[_0x088b('0xe')]);router['delete'](_0x088b('0x9'),auth[_0x088b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf842=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x47878f,_0x48d3bf){var _0x4b05b8=function(_0x3d6597){while(--_0x3d6597){_0x47878f['push'](_0x47878f['shift']());}};_0x4b05b8(++_0x48d3bf);}(_0xf842,0x172));var _0x2f84=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xf842[_0x1fa759];return _0x2da9f4;};'use strict';var multer=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var path=require(_0x2f84('0x2'));var timeout=require(_0x2f84('0x3'));var express=require('express');var router=express[_0x2f84('0x4')]();var fs_extra=require(_0x2f84('0x5'));var auth=require(_0x2f84('0x6'));var interaction=require(_0x2f84('0x7'));var config=require(_0x2f84('0x8'));var controller=require('./analyticMetric.controller');router[_0x2f84('0x9')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xb')]);router['get'](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0xd')]);router[_0x2f84('0xe')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xf')]);router[_0x2f84('0x10')](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0x11')]);router['delete'](_0x2f84('0xc'),auth['isAuthenticated'](),controller[_0x2f84('0x12')]);module[_0x2f84('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d956770..83897c8 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 _0xbc8b=['exports'];(function(_0x509dfd,_0x52d06c){var _0x469a63=function(_0x399f29){while(--_0x399f29){_0x509dfd['push'](_0x509dfd['shift']());}};_0x469a63(++_0x52d06c);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xbc8b[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require('sequelize');module[_0xbbc8('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x83bd=['sequelize','TEXT'];(function(_0x55e537,_0x464d61){var _0x2dbbe1=function(_0x158d9f){while(--_0x158d9f){_0x55e537['push'](_0x55e537['shift']());}};_0x2dbbe1(++_0x464d61);}(_0x83bd,0x160));var _0xd83b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x83bd[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xd83b('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd83b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 3aa6bde..f07deb7 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 _0x9c21=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0x3ccd40,_0x538726){var _0x45baf0=function(_0x5d6c70){while(--_0x5d6c70){_0x3ccd40['push'](_0x3ccd40['shift']());}};_0x45baf0(++_0x538726);}(_0x9c21,0x178));var _0x19c2=function(_0xc137,_0x3011df){_0xc137=_0xc137-0x0;var _0x36ace7=_0x9c21[_0xc137];return _0x36ace7;};'use strict';var emlformat=require(_0x19c2('0x0'));var rimraf=require(_0x19c2('0x1'));var zipdir=require(_0x19c2('0x2'));var jsonpatch=require(_0x19c2('0x3'));var rp=require('request-promise');var moment=require(_0x19c2('0x4'));var BPromise=require(_0x19c2('0x5'));var Mustache=require(_0x19c2('0x6'));var util=require('util');var path=require(_0x19c2('0x7'));var sox=require(_0x19c2('0x8'));var csv=require('to-csv');var ejs=require(_0x19c2('0x9'));var fs=require('fs');var fs_extra=require(_0x19c2('0xa'));var _=require(_0x19c2('0xb'));var squel=require(_0x19c2('0xc'));var crypto=require(_0x19c2('0xd'));var jsforce=require(_0x19c2('0xe'));var deskjs=require(_0x19c2('0xf'));var toCsv=require(_0x19c2('0x10'));var querystring=require(_0x19c2('0x11'));var Papa=require(_0x19c2('0x12'));var Redis=require(_0x19c2('0x13'));var authService=require(_0x19c2('0x14'));var qs=require(_0x19c2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x19c2('0x16'));var utils=require(_0x19c2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x19c2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbd62fd,_0x5cb7cf){_0x5cb7cf=_0x5cb7cf||0xcc;return function(_0x166c4e){if(_0x166c4e){return _0xbd62fd[_0x19c2('0x19')](_0x5cb7cf);}return _0xbd62fd[_0x19c2('0x1a')](_0x5cb7cf)[_0x19c2('0x1b')]();};}function respondWithResult(_0x3407b8,_0x3fa1bc){_0x3fa1bc=_0x3fa1bc||0xc8;return function(_0x5b016a){if(_0x5b016a){return _0x3407b8[_0x19c2('0x1a')](_0x3fa1bc)[_0x19c2('0x1c')](_0x5b016a);}};}function respondWithFilteredResult(_0x5ef532,_0x382cdd){return function(_0x84dc58){if(_0x84dc58){var _0x4ce53f=typeof _0x382cdd['offset']==='undefined'&&typeof _0x382cdd['limit']===_0x19c2('0x1d');var _0x717670=_0x84dc58[_0x19c2('0x1e')];var _0x4e16e2=_0x4ce53f?0x0:_0x382cdd[_0x19c2('0x1f')];var _0x4908f6=_0x4ce53f?_0x84dc58[_0x19c2('0x1e')]:_0x382cdd[_0x19c2('0x1f')]+_0x382cdd[_0x19c2('0x20')];var _0x658752;if(_0x4908f6>=_0x717670){_0x4908f6=_0x717670;_0x658752=0xc8;}else{_0x658752=0xce;}_0x5ef532[_0x19c2('0x1a')](_0x658752);return _0x5ef532[_0x19c2('0x21')](_0x19c2('0x22'),_0x4e16e2+'-'+_0x4908f6+'/'+_0x717670)['json'](_0x84dc58);}return null;};}function patchUpdates(_0x471576){return function(_0x49358f){try{jsonpatch[_0x19c2('0x23')](_0x49358f,_0x471576,!![]);}catch(_0xca76d4){return BPromise['reject'](_0xca76d4);}return _0x49358f['save']();};}function saveUpdates(_0x159252,_0xebf064){return function(_0x510153){if(_0x510153){return _0x510153[_0x19c2('0x24')](_0x159252)['then'](function(_0x53095a){return _0x53095a;});}return null;};}function removeEntity(_0x166272,_0x244298){return function(_0x17b7af){if(_0x17b7af){return _0x17b7af[_0x19c2('0x25')]()[_0x19c2('0x26')](function(){_0x166272[_0x19c2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc883,_0x36daee){return function(_0x2e6ba4){if(!_0x2e6ba4){_0x1bc883[_0x19c2('0x19')](0x194);}return _0x2e6ba4;};}function handleError(_0xeaf4ef,_0x16d750){_0x16d750=_0x16d750||0x1f4;return function(_0x24a6cc){logger[_0x19c2('0x27')](_0x24a6cc[_0x19c2('0x28')]);if(_0x24a6cc[_0x19c2('0x29')]){delete _0x24a6cc[_0x19c2('0x29')];}_0xeaf4ef[_0x19c2('0x1a')](_0x16d750)[_0x19c2('0x2a')](_0x24a6cc);};}exports[_0x19c2('0x2b')]=function(_0x58d51b,_0x4cbc3c){var _0x5f1f0f={},_0x4f6c72={},_0x59790b={'count':0x0,'rows':[]};var _0x5e44cf=_[_0x19c2('0x2c')](db[_0x19c2('0x2d')][_0x19c2('0x2e')],function(_0x3a7baa){return{'name':_0x3a7baa[_0x19c2('0x2f')],'type':_0x3a7baa[_0x19c2('0x30')][_0x19c2('0x31')]};});_0x4f6c72[_0x19c2('0x32')]=_[_0x19c2('0x2c')](_0x5e44cf,_0x19c2('0x29'));_0x4f6c72[_0x19c2('0x33')]=_['keys'](_0x58d51b[_0x19c2('0x33')]);_0x4f6c72[_0x19c2('0x34')]=_['intersection'](_0x4f6c72[_0x19c2('0x32')],_0x4f6c72['query']);_0x5f1f0f[_0x19c2('0x35')]=_[_0x19c2('0x36')](_0x4f6c72[_0x19c2('0x32')],qs[_0x19c2('0x37')](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x37')]));_0x5f1f0f['attributes']=_0x5f1f0f[_0x19c2('0x35')][_0x19c2('0x38')]?_0x5f1f0f[_0x19c2('0x35')]:_0x4f6c72['model'];if(!_0x58d51b[_0x19c2('0x33')][_0x19c2('0x39')](_0x19c2('0x3a'))){_0x5f1f0f[_0x19c2('0x20')]=qs['limit'](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x20')]);_0x5f1f0f[_0x19c2('0x1f')]=qs[_0x19c2('0x1f')](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x1f')]);}_0x5f1f0f[_0x19c2('0x3b')]=qs[_0x19c2('0x3c')](_0x58d51b[_0x19c2('0x33')]['sort']);_0x5f1f0f[_0x19c2('0x3d')]=qs[_0x19c2('0x34')](_[_0x19c2('0x3e')](_0x58d51b[_0x19c2('0x33')],_0x4f6c72[_0x19c2('0x34')]),_0x5e44cf);if(_0x58d51b[_0x19c2('0x33')][_0x19c2('0x3f')]){_0x5f1f0f[_0x19c2('0x3d')]=_[_0x19c2('0x40')](_0x5f1f0f[_0x19c2('0x3d')],{'$or':_[_0x19c2('0x2c')](_0x5e44cf,function(_0x3f21da){if(_0x3f21da[_0x19c2('0x30')]!==_0x19c2('0x41')){var _0x39accb={};_0x39accb[_0x3f21da[_0x19c2('0x29')]]={'$like':'%'+_0x58d51b[_0x19c2('0x33')]['filter']+'%'};return _0x39accb;}})});}_0x5f1f0f=_['merge']({},_0x5f1f0f,_0x58d51b[_0x19c2('0x42')]);var _0x55722a={'where':_0x5f1f0f['where']};return db['AnalyticTreeReport'][_0x19c2('0x1e')](_0x55722a)[_0x19c2('0x26')](function(_0x3622e2){_0x59790b['count']=_0x3622e2;if(_0x58d51b[_0x19c2('0x33')][_0x19c2('0x43')]){_0x5f1f0f['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x19c2('0x44')](_0x5f1f0f);})[_0x19c2('0x26')](function(_0x4cba6a){_0x59790b[_0x19c2('0x45')]=_0x4cba6a;return _0x59790b;})[_0x19c2('0x26')](respondWithFilteredResult(_0x4cbc3c,_0x5f1f0f))['catch'](handleError(_0x4cbc3c,null));};exports['show']=function(_0x14a328,_0x2fcf6b){var _0x1ddcd7={'raw':!![],'where':{'id':_0x14a328[_0x19c2('0x46')]['id']}},_0x15bbb2={};_0x15bbb2[_0x19c2('0x32')]=_[_0x19c2('0x47')](db['AnalyticTreeReport']['rawAttributes']);_0x15bbb2['query']=_[_0x19c2('0x47')](_0x14a328[_0x19c2('0x33')]);_0x15bbb2[_0x19c2('0x34')]=_['intersection'](_0x15bbb2[_0x19c2('0x32')],_0x15bbb2['query']);_0x1ddcd7[_0x19c2('0x35')]=_['intersection'](_0x15bbb2[_0x19c2('0x32')],qs['fields'](_0x14a328[_0x19c2('0x33')]['fields']));_0x1ddcd7[_0x19c2('0x35')]=_0x1ddcd7[_0x19c2('0x35')][_0x19c2('0x38')]?_0x1ddcd7['attributes']:_0x15bbb2['model'];if(_0x14a328[_0x19c2('0x33')]['includeAll']){_0x1ddcd7[_0x19c2('0x48')]=[{'all':!![]}];}_0x1ddcd7=_[_0x19c2('0x40')]({},_0x1ddcd7,_0x14a328['options']);return db[_0x19c2('0x2d')]['find'](_0x1ddcd7)['then'](handleEntityNotFound(_0x2fcf6b,null))[_0x19c2('0x26')](respondWithResult(_0x2fcf6b,null))[_0x19c2('0x49')](handleError(_0x2fcf6b,null));};exports[_0x19c2('0x4a')]=function(_0x50d60a,_0x1e3f5a){return db[_0x19c2('0x2d')][_0x19c2('0x4a')](_0x50d60a[_0x19c2('0x4b')],{})[_0x19c2('0x26')](respondWithResult(_0x1e3f5a,0xc9))['catch'](handleError(_0x1e3f5a,null));};exports[_0x19c2('0x24')]=function(_0x2c82b4,_0x27ad7f){if(_0x2c82b4[_0x19c2('0x4b')]['id']){delete _0x2c82b4[_0x19c2('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x19c2('0x4c')]({'where':{'id':_0x2c82b4[_0x19c2('0x46')]['id']}})[_0x19c2('0x26')](handleEntityNotFound(_0x27ad7f,null))['then'](saveUpdates(_0x2c82b4['body'],null))[_0x19c2('0x26')](respondWithResult(_0x27ad7f,null))[_0x19c2('0x49')](handleError(_0x27ad7f,null));};exports[_0x19c2('0x25')]=function(_0x2658e6,_0x403259){return db[_0x19c2('0x2d')][_0x19c2('0x4c')]({'where':{'id':_0x2658e6[_0x19c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x403259,null))[_0x19c2('0x26')](removeEntity(_0x403259,null))['catch'](handleError(_0x403259,null));}; \ No newline at end of file +var _0xa784=['reject','save','update','then','destroy','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','include','includeAll','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2bea18,_0x4aee7d){var _0x1d5d79=function(_0x3af13f){while(--_0x3af13f){_0x2bea18['push'](_0x2bea18['shift']());}};_0x1d5d79(++_0x4aee7d);}(_0xa784,0x149));var _0x4a78=function(_0x5898d5,_0x316204){_0x5898d5=_0x5898d5-0x0;var _0x2b3c4e=_0xa784[_0x5898d5];return _0x2b3c4e;};'use strict';var emlformat=require(_0x4a78('0x0'));var rimraf=require(_0x4a78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a78('0x2'));var rp=require('request-promise');var moment=require(_0x4a78('0x3'));var BPromise=require(_0x4a78('0x4'));var Mustache=require(_0x4a78('0x5'));var util=require(_0x4a78('0x6'));var path=require(_0x4a78('0x7'));var sox=require(_0x4a78('0x8'));var csv=require(_0x4a78('0x9'));var ejs=require(_0x4a78('0xa'));var fs=require('fs');var fs_extra=require(_0x4a78('0xb'));var _=require(_0x4a78('0xc'));var squel=require(_0x4a78('0xd'));var crypto=require(_0x4a78('0xe'));var jsforce=require(_0x4a78('0xf'));var deskjs=require(_0x4a78('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4a78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4a78('0x12'));var as=require(_0x4a78('0x13'));var hardwareService=require(_0x4a78('0x14'));var logger=require(_0x4a78('0x15'))(_0x4a78('0x16'));var utils=require('../../config/utils');var config=require(_0x4a78('0x17'));var licenseUtil=require(_0x4a78('0x18'));var db=require(_0x4a78('0x19'))['db'];function respondWithStatusCode(_0x25f65b,_0x2eaf72){_0x2eaf72=_0x2eaf72||0xcc;return function(_0xfa8ff3){if(_0xfa8ff3){return _0x25f65b['sendStatus'](_0x2eaf72);}return _0x25f65b['status'](_0x2eaf72)[_0x4a78('0x1a')]();};}function respondWithResult(_0x1fa64e,_0x2686dd){_0x2686dd=_0x2686dd||0xc8;return function(_0x384964){if(_0x384964){return _0x1fa64e[_0x4a78('0x1b')](_0x2686dd)[_0x4a78('0x1c')](_0x384964);}};}function respondWithFilteredResult(_0x90a53e,_0x2dd995){return function(_0x564fdd){if(_0x564fdd){var _0xaba8eb=typeof _0x2dd995[_0x4a78('0x1d')]===_0x4a78('0x1e')&&typeof _0x2dd995['limit']===_0x4a78('0x1e');var _0x272b0e=_0x564fdd[_0x4a78('0x1f')];var _0x3796da=_0xaba8eb?0x0:_0x2dd995[_0x4a78('0x1d')];var _0x5c7ae8=_0xaba8eb?_0x564fdd['count']:_0x2dd995['offset']+_0x2dd995[_0x4a78('0x20')];var _0x947a0;if(_0x5c7ae8>=_0x272b0e){_0x5c7ae8=_0x272b0e;_0x947a0=0xc8;}else{_0x947a0=0xce;}_0x90a53e['status'](_0x947a0);return _0x90a53e[_0x4a78('0x21')](_0x4a78('0x22'),_0x3796da+'-'+_0x5c7ae8+'/'+_0x272b0e)[_0x4a78('0x1c')](_0x564fdd);}return null;};}function patchUpdates(_0x453d3b){return function(_0xe181fc){try{jsonpatch[_0x4a78('0x23')](_0xe181fc,_0x453d3b,!![]);}catch(_0x3c09ab){return BPromise[_0x4a78('0x24')](_0x3c09ab);}return _0xe181fc[_0x4a78('0x25')]();};}function saveUpdates(_0x1e15c0,_0x42d77d){return function(_0x1ba18c){if(_0x1ba18c){return _0x1ba18c[_0x4a78('0x26')](_0x1e15c0)[_0x4a78('0x27')](function(_0x1f6079){return _0x1f6079;});}return null;};}function removeEntity(_0x5e1314,_0x26dfe7){return function(_0x2f7019){if(_0x2f7019){return _0x2f7019[_0x4a78('0x28')]()[_0x4a78('0x27')](function(){_0x5e1314[_0x4a78('0x1b')](0xcc)[_0x4a78('0x1a')]();});}};}function handleEntityNotFound(_0x366a1f,_0x1011bf){return function(_0xe5c85e){if(!_0xe5c85e){_0x366a1f[_0x4a78('0x29')](0x194);}return _0xe5c85e;};}function handleError(_0x3f8925,_0x56d7f7){_0x56d7f7=_0x56d7f7||0x1f4;return function(_0x3c9985){logger['error'](_0x3c9985[_0x4a78('0x2a')]);if(_0x3c9985[_0x4a78('0x2b')]){delete _0x3c9985['name'];}_0x3f8925[_0x4a78('0x1b')](_0x56d7f7)[_0x4a78('0x2c')](_0x3c9985);};}exports['index']=function(_0x4ce339,_0x12ae8c){var _0x43f3ab={},_0x218202={},_0x550d83={'count':0x0,'rows':[]};var _0x2b856c=_[_0x4a78('0x2d')](db[_0x4a78('0x2e')][_0x4a78('0x2f')],function(_0x4693ac){return{'name':_0x4693ac[_0x4a78('0x30')],'type':_0x4693ac[_0x4a78('0x31')][_0x4a78('0x32')]};});_0x218202[_0x4a78('0x33')]=_['map'](_0x2b856c,_0x4a78('0x2b'));_0x218202[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x4ce339[_0x4a78('0x34')]);_0x218202[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x218202['model'],_0x218202[_0x4a78('0x34')]);_0x43f3ab[_0x4a78('0x38')]=_[_0x4a78('0x37')](_0x218202[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x39')]));_0x43f3ab[_0x4a78('0x38')]=_0x43f3ab['attributes'][_0x4a78('0x3a')]?_0x43f3ab[_0x4a78('0x38')]:_0x218202['model'];if(!_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3b')]('nolimit')){_0x43f3ab[_0x4a78('0x20')]=qs['limit'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x20')]);_0x43f3ab[_0x4a78('0x1d')]=qs['offset'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x1d')]);}_0x43f3ab[_0x4a78('0x3c')]=qs[_0x4a78('0x3d')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3d')]);_0x43f3ab[_0x4a78('0x3e')]=qs['filters'](_['pick'](_0x4ce339['query'],_0x218202['filters']),_0x2b856c);if(_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]){_0x43f3ab[_0x4a78('0x3e')]=_[_0x4a78('0x40')](_0x43f3ab[_0x4a78('0x3e')],{'$or':_[_0x4a78('0x2d')](_0x2b856c,function(_0x2a4af6){if(_0x2a4af6[_0x4a78('0x31')]!=='VIRTUAL'){var _0x1ec030={};_0x1ec030[_0x2a4af6[_0x4a78('0x2b')]]={'$like':'%'+_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]+'%'};return _0x1ec030;}})});}_0x43f3ab=_[_0x4a78('0x40')]({},_0x43f3ab,_0x4ce339['options']);var _0xf6fac6={'where':_0x43f3ab[_0x4a78('0x3e')]};return db[_0x4a78('0x2e')][_0x4a78('0x1f')](_0xf6fac6)[_0x4a78('0x27')](function(_0x5a28b0){_0x550d83['count']=_0x5a28b0;if(_0x4ce339[_0x4a78('0x34')]['includeAll']){_0x43f3ab[_0x4a78('0x41')]=[{'all':!![]}];}return db[_0x4a78('0x2e')]['findAll'](_0x43f3ab);})[_0x4a78('0x27')](function(_0xc54919){_0x550d83['rows']=_0xc54919;return _0x550d83;})[_0x4a78('0x27')](respondWithFilteredResult(_0x12ae8c,_0x43f3ab))['catch'](handleError(_0x12ae8c,null));};exports['show']=function(_0x1a9bd2,_0x2ac901){var _0x31bfdf={'raw':!![],'where':{'id':_0x1a9bd2['params']['id']}},_0x1a89cd={};_0x1a89cd[_0x4a78('0x33')]=_['keys'](db[_0x4a78('0x2e')][_0x4a78('0x2f')]);_0x1a89cd[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x1a9bd2[_0x4a78('0x34')]);_0x1a89cd[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],_0x1a89cd[_0x4a78('0x34')]);_0x31bfdf['attributes']=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x1a9bd2['query'][_0x4a78('0x39')]));_0x31bfdf[_0x4a78('0x38')]=_0x31bfdf[_0x4a78('0x38')][_0x4a78('0x3a')]?_0x31bfdf[_0x4a78('0x38')]:_0x1a89cd[_0x4a78('0x33')];if(_0x1a9bd2[_0x4a78('0x34')][_0x4a78('0x42')]){_0x31bfdf[_0x4a78('0x41')]=[{'all':!![]}];}_0x31bfdf=_[_0x4a78('0x40')]({},_0x31bfdf,_0x1a9bd2[_0x4a78('0x43')]);return db[_0x4a78('0x2e')][_0x4a78('0x44')](_0x31bfdf)[_0x4a78('0x27')](handleEntityNotFound(_0x2ac901,null))[_0x4a78('0x27')](respondWithResult(_0x2ac901,null))[_0x4a78('0x45')](handleError(_0x2ac901,null));};exports[_0x4a78('0x46')]=function(_0x174133,_0x1a4d1f){return db['AnalyticTreeReport'][_0x4a78('0x46')](_0x174133[_0x4a78('0x47')],{})['then'](respondWithResult(_0x1a4d1f,0xc9))[_0x4a78('0x45')](handleError(_0x1a4d1f,null));};exports[_0x4a78('0x26')]=function(_0x5df4bc,_0x5c5e05){if(_0x5df4bc[_0x4a78('0x47')]['id']){delete _0x5df4bc['body']['id'];}return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x5df4bc['params']['id']}})['then'](handleEntityNotFound(_0x5c5e05,null))[_0x4a78('0x27')](saveUpdates(_0x5df4bc[_0x4a78('0x47')],null))[_0x4a78('0x27')](respondWithResult(_0x5c5e05,null))[_0x4a78('0x45')](handleError(_0x5c5e05,null));};exports['destroy']=function(_0x2d96e7,_0x264751){return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x2d96e7[_0x4a78('0x48')]['id']}})['then'](handleEntityNotFound(_0x264751,null))[_0x4a78('0x27')](removeEntity(_0x264751,null))[_0x4a78('0x45')](handleError(_0x264751,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 90314b9..ce46b89 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 _0x1eba=['request-promise','path','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x598a3d,_0x3728b8){var _0x303e9e=function(_0x2fca75){while(--_0x2fca75){_0x598a3d['push'](_0x598a3d['shift']());}};_0x303e9e(++_0x3728b8);}(_0x1eba,0x132));var _0xa1eb=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x1eba[_0x460150];return _0x340677;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require(_0xa1eb('0x5'));var rp=require(_0xa1eb('0x6'));var fs=require('fs');var path=require(_0xa1eb('0x7'));var rimraf=require('rimraf');var config=require(_0xa1eb('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xa1eb('0x9')]=function(_0x5c912b,_0x14d519){return _0x5c912b[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd68=['analytics_report_trees','util','../../config/logger','api','moment','bluebird','path','rimraf','define','AnalyticTreeReport'];(function(_0x2c505a,_0x3f7365){var _0x436bfb=function(_0x5863dc){while(--_0x5863dc){_0x2c505a['push'](_0x2c505a['shift']());}};_0x436bfb(++_0x3f7365);}(_0xdd68,0x119));var _0x8dd6=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xdd68[_0xee3051];return _0x139e81;};'use strict';var _=require('lodash');var util=require(_0x8dd6('0x0'));var logger=require(_0x8dd6('0x1'))(_0x8dd6('0x2'));var moment=require(_0x8dd6('0x3'));var BPromise=require(_0x8dd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd6('0x5'));var rimraf=require(_0x8dd6('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x20580a,_0x331c3c){return _0x20580a[_0x8dd6('0x7')](_0x8dd6('0x8'),attributes,{'tableName':_0x8dd6('0x9'),'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 b690c8f..c9b6b0e 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3cf964,_0x50417c){var _0x13581e=function(_0x36bf73){while(--_0x36bf73){_0x3cf964['push'](_0x3cf964['shift']());}};_0x13581e(++_0x50417c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ab638,_0x43c800){_0x1ab638=_0x1ab638-0x0;var _0x169e3d=_0x5f2f[_0x1ab638];return _0x169e3d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x398dd5,_0x2c8907){_0x398dd5=_0x398dd5-0x0;var _0x4f8b53=_0x7a54[_0x398dd5];return _0x4f8b53;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 038efc1..8e6b97f 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 _0xda89=['/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xda89,0x19e));var _0x9da8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xda89[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x9da8('0x0'));var util=require(_0x9da8('0x1'));var path=require('path');var timeout=require(_0x9da8('0x2'));var express=require(_0x9da8('0x3'));var router=express['Router']();var fs_extra=require(_0x9da8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9da8('0x5'));var config=require(_0x9da8('0x6'));var controller=require(_0x9da8('0x7'));router[_0x9da8('0x8')]('/',auth[_0x9da8('0x9')](),controller[_0x9da8('0xa')]);router[_0x9da8('0x8')](_0x9da8('0xb'),auth['isAuthenticated'](),controller[_0x9da8('0xc')]);router['post']('/',auth[_0x9da8('0x9')](),controller[_0x9da8('0xd')]);router['put'](_0x9da8('0xb'),auth[_0x9da8('0x9')](),controller[_0x9da8('0xe')]);router[_0x9da8('0xf')]('/:id',auth[_0x9da8('0x9')](),controller['destroy']);module[_0x9da8('0x10')]=router; \ No newline at end of file +var _0x9f6f=['post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f6f,0x1a4));var _0xf9f6=function(_0x1af82a,_0x57001c){_0x1af82a=_0x1af82a-0x0;var _0x37220d=_0x9f6f[_0x1af82a];return _0x37220d;};'use strict';var multer=require(_0xf9f6('0x0'));var util=require(_0xf9f6('0x1'));var path=require('path');var timeout=require(_0xf9f6('0x2'));var express=require(_0xf9f6('0x3'));var router=express[_0xf9f6('0x4')]();var fs_extra=require(_0xf9f6('0x5'));var auth=require(_0xf9f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf9f6('0x7')]);router[_0xf9f6('0x8')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xb')]);router[_0xf9f6('0xc')]('/',auth['isAuthenticated'](),controller[_0xf9f6('0xd')]);router[_0xf9f6('0xe')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xf')]);router['delete'](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller['destroy']);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 30f6d73..41abb77 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 _0xdfcc=['sequelize','exports','STRING'];(function(_0x53f6d4,_0xa61cc2){var _0x5d9a2d=function(_0x6fc0fa){while(--_0x6fc0fa){_0x53f6d4['push'](_0x53f6d4['shift']());}};_0x5d9a2d(++_0xa61cc2);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xdfcc[_0x34bc6c];return _0x168820;};'use strict';var Sequelize=require(_0xcdfc('0x0'));module[_0xcdfc('0x1')]={'name':{'type':Sequelize[_0xcdfc('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcdfc('0x2')]}}; \ No newline at end of file +var _0x864a=['sequelize','exports','STRING'];(function(_0x4b72f7,_0x5bc45d){var _0x4f3fb0=function(_0x44762e){while(--_0x44762e){_0x4b72f7['push'](_0x4b72f7['shift']());}};_0x4f3fb0(++_0x5bc45d);}(_0x864a,0x8a));var _0xa864=function(_0x274887,_0x929096){_0x274887=_0x274887-0x0;var _0x2c992e=_0x864a[_0x274887];return _0x2c992e;};'use strict';var Sequelize=require(_0xa864('0x0'));module[_0xa864('0x1')]={'name':{'type':Sequelize[_0xa864('0x2')]},'basename':{'type':Sequelize[_0xa864('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 69818f4..d8d66ec 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 _0x60be=['get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','keys','include','options','find'];(function(_0x366fb4,_0x397abd){var _0x352234=function(_0x21f574){while(--_0x21f574){_0x366fb4['push'](_0x366fb4['shift']());}};_0x352234(++_0x397abd);}(_0x60be,0x1d0));var _0xe60b=function(_0x3005a6,_0x320826){_0x3005a6=_0x3005a6-0x0;var _0x2f7399=_0x60be[_0x3005a6];return _0x2f7399;};'use strict';var emlformat=require(_0xe60b('0x0'));var rimraf=require(_0xe60b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe60b('0x2'));var rp=require(_0xe60b('0x3'));var moment=require(_0xe60b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe60b('0x5'));var util=require(_0xe60b('0x6'));var path=require(_0xe60b('0x7'));var sox=require(_0xe60b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe60b('0x9'));var _=require(_0xe60b('0xa'));var squel=require('squel');var crypto=require(_0xe60b('0xb'));var jsforce=require(_0xe60b('0xc'));var deskjs=require(_0xe60b('0xd'));var toCsv=require(_0xe60b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe60b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe60b('0x10'));var hardwareService=require(_0xe60b('0x11'));var logger=require(_0xe60b('0x12'))('api');var utils=require(_0xe60b('0x13'));var config=require(_0xe60b('0x14'));var licenseUtil=require(_0xe60b('0x15'));var db=require(_0xe60b('0x16'))['db'];function respondWithStatusCode(_0x452782,_0xc33cd3){_0xc33cd3=_0xc33cd3||0xcc;return function(_0x4b8fa3){if(_0x4b8fa3){return _0x452782[_0xe60b('0x17')](_0xc33cd3);}return _0x452782[_0xe60b('0x18')](_0xc33cd3)[_0xe60b('0x19')]();};}function respondWithResult(_0x5adbdd,_0x3efe6b){_0x3efe6b=_0x3efe6b||0xc8;return function(_0x5ccf7a){if(_0x5ccf7a){return _0x5adbdd[_0xe60b('0x18')](_0x3efe6b)[_0xe60b('0x1a')](_0x5ccf7a);}};}function respondWithFilteredResult(_0x4af477,_0x347874){return function(_0x291e4c){if(_0x291e4c){var _0x3eb74e=typeof _0x347874[_0xe60b('0x1b')]==='undefined'&&typeof _0x347874[_0xe60b('0x1c')]===_0xe60b('0x1d');var _0x5e8eb5=_0x291e4c[_0xe60b('0x1e')];var _0x1c9481=_0x3eb74e?0x0:_0x347874[_0xe60b('0x1b')];var _0x51f709=_0x3eb74e?_0x291e4c['count']:_0x347874['offset']+_0x347874[_0xe60b('0x1c')];var _0x5566e4;if(_0x51f709>=_0x5e8eb5){_0x51f709=_0x5e8eb5;_0x5566e4=0xc8;}else{_0x5566e4=0xce;}_0x4af477['status'](_0x5566e4);return _0x4af477[_0xe60b('0x1f')](_0xe60b('0x20'),_0x1c9481+'-'+_0x51f709+'/'+_0x5e8eb5)[_0xe60b('0x1a')](_0x291e4c);}return null;};}function patchUpdates(_0x56558d){return function(_0x21cc96){try{jsonpatch['apply'](_0x21cc96,_0x56558d,!![]);}catch(_0x19f784){return BPromise[_0xe60b('0x21')](_0x19f784);}return _0x21cc96[_0xe60b('0x22')]();};}function saveUpdates(_0xb2c8d9,_0x1955d5){return function(_0x4c75e7){if(_0x4c75e7){return _0x4c75e7['update'](_0xb2c8d9)[_0xe60b('0x23')](function(_0x2a0a9f){return _0x2a0a9f;});}return null;};}function removeEntity(_0x2562d1,_0x512401){return function(_0x408ba9){if(_0x408ba9){return _0x408ba9['destroy']()[_0xe60b('0x23')](function(){_0x2562d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa15c8a,_0x44f332){return function(_0x1519ce){if(!_0x1519ce){_0xa15c8a[_0xe60b('0x17')](0x194);}return _0x1519ce;};}function handleError(_0x27cebb,_0x1715b6){_0x1715b6=_0x1715b6||0x1f4;return function(_0x18426f){logger[_0xe60b('0x24')](_0x18426f[_0xe60b('0x25')]);if(_0x18426f[_0xe60b('0x26')]){delete _0x18426f[_0xe60b('0x26')];}_0x27cebb[_0xe60b('0x18')](_0x1715b6)[_0xe60b('0x27')](_0x18426f);};}exports[_0xe60b('0x28')]=function(_0x298e99,_0xf13d92){var _0xa6c9e7={},_0x3789dd={},_0x551922={'count':0x0,'rows':[]};var _0x287204=_[_0xe60b('0x29')](db[_0xe60b('0x2a')][_0xe60b('0x2b')],function(_0x37f439){return{'name':_0x37f439[_0xe60b('0x2c')],'type':_0x37f439[_0xe60b('0x2d')][_0xe60b('0x2e')]};});_0x3789dd[_0xe60b('0x2f')]=_[_0xe60b('0x29')](_0x287204,_0xe60b('0x26'));_0x3789dd[_0xe60b('0x30')]=_['keys'](_0x298e99[_0xe60b('0x30')]);_0x3789dd[_0xe60b('0x31')]=_[_0xe60b('0x32')](_0x3789dd[_0xe60b('0x2f')],_0x3789dd[_0xe60b('0x30')]);_0xa6c9e7['attributes']=_[_0xe60b('0x32')](_0x3789dd['model'],qs[_0xe60b('0x33')](_0x298e99[_0xe60b('0x30')][_0xe60b('0x33')]));_0xa6c9e7[_0xe60b('0x34')]=_0xa6c9e7[_0xe60b('0x34')][_0xe60b('0x35')]?_0xa6c9e7['attributes']:_0x3789dd[_0xe60b('0x2f')];if(!_0x298e99[_0xe60b('0x30')][_0xe60b('0x36')](_0xe60b('0x37'))){_0xa6c9e7[_0xe60b('0x1c')]=qs[_0xe60b('0x1c')](_0x298e99[_0xe60b('0x30')]['limit']);_0xa6c9e7[_0xe60b('0x1b')]=qs[_0xe60b('0x1b')](_0x298e99[_0xe60b('0x30')][_0xe60b('0x1b')]);}_0xa6c9e7[_0xe60b('0x38')]=qs['sort'](_0x298e99[_0xe60b('0x30')]['sort']);_0xa6c9e7[_0xe60b('0x39')]=qs['filters'](_[_0xe60b('0x3a')](_0x298e99[_0xe60b('0x30')],_0x3789dd[_0xe60b('0x31')]),_0x287204);if(_0x298e99[_0xe60b('0x30')][_0xe60b('0x3b')]){_0xa6c9e7['where']=_[_0xe60b('0x3c')](_0xa6c9e7[_0xe60b('0x39')],{'$or':_[_0xe60b('0x29')](_0x287204,function(_0x1d9daa){if(_0x1d9daa[_0xe60b('0x2d')]!==_0xe60b('0x3d')){var _0x523e5a={};_0x523e5a[_0x1d9daa['name']]={'$like':'%'+_0x298e99[_0xe60b('0x30')][_0xe60b('0x3b')]+'%'};return _0x523e5a;}})});}_0xa6c9e7=_[_0xe60b('0x3c')]({},_0xa6c9e7,_0x298e99['options']);var _0x8da81c={'where':_0xa6c9e7[_0xe60b('0x39')]};return db['Attachment']['count'](_0x8da81c)[_0xe60b('0x23')](function(_0x565d09){_0x551922[_0xe60b('0x1e')]=_0x565d09;if(_0x298e99['query'][_0xe60b('0x3e')]){_0xa6c9e7['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0xa6c9e7);})[_0xe60b('0x23')](function(_0x7b88a9){_0x551922[_0xe60b('0x3f')]=_0x7b88a9;return _0x551922;})[_0xe60b('0x23')](respondWithFilteredResult(_0xf13d92,_0xa6c9e7))[_0xe60b('0x40')](handleError(_0xf13d92,null));};exports['show']=function(_0x411de8,_0x399886){var _0x4829c8={'raw':!![],'where':{'id':_0x411de8[_0xe60b('0x41')]['id']}},_0x1881b5={};_0x1881b5[_0xe60b('0x2f')]=_[_0xe60b('0x42')](db[_0xe60b('0x2a')][_0xe60b('0x2b')]);_0x1881b5[_0xe60b('0x30')]=_['keys'](_0x411de8[_0xe60b('0x30')]);_0x1881b5['filters']=_[_0xe60b('0x32')](_0x1881b5[_0xe60b('0x2f')],_0x1881b5[_0xe60b('0x30')]);_0x4829c8['attributes']=_[_0xe60b('0x32')](_0x1881b5['model'],qs[_0xe60b('0x33')](_0x411de8[_0xe60b('0x30')][_0xe60b('0x33')]));_0x4829c8['attributes']=_0x4829c8[_0xe60b('0x34')]['length']?_0x4829c8[_0xe60b('0x34')]:_0x1881b5[_0xe60b('0x2f')];if(_0x411de8[_0xe60b('0x30')][_0xe60b('0x3e')]){_0x4829c8[_0xe60b('0x43')]=[{'all':!![]}];}_0x4829c8=_['merge']({},_0x4829c8,_0x411de8[_0xe60b('0x44')]);return db[_0xe60b('0x2a')][_0xe60b('0x45')](_0x4829c8)[_0xe60b('0x23')](handleEntityNotFound(_0x399886,null))[_0xe60b('0x23')](respondWithResult(_0x399886,null))['catch'](handleError(_0x399886,null));};exports['clone']=function(_0x110ec3,_0x2ae69f){var _0x1c1968={'where':{'id':_0x110ec3[_0xe60b('0x41')]['id']}},_0x5ecc76={};_0x5ecc76[_0xe60b('0x2f')]=_['keys'](db[_0xe60b('0x2a')][_0xe60b('0x2b')]);_0x1c1968['attributes']=_[_0xe60b('0x32')](_0x5ecc76[_0xe60b('0x2f')],qs['fields'](_0x110ec3['query'][_0xe60b('0x33')]));_0x1c1968[_0xe60b('0x34')]=_0x1c1968['attributes'][_0xe60b('0x35')]?_0x1c1968[_0xe60b('0x34')]:_0x5ecc76[_0xe60b('0x2f')];if(_0x110ec3[_0xe60b('0x30')]['includeAll']){_0x1c1968[_0xe60b('0x43')]=[{'all':!![]}];}_0x1c1968=_[_0xe60b('0x3c')]({},_0x1c1968,_0x110ec3[_0xe60b('0x44')]);return db[_0xe60b('0x2a')][_0xe60b('0x45')](_0x1c1968)['then'](handleEntityNotFound(_0x2ae69f,null))[_0xe60b('0x23')](function(_0x3c2253){if(_0x3c2253){var _0x31f5f6=_0x3c2253[_0xe60b('0x46')]({'plain':!![]});_0x31f5f6=qs[_0xe60b('0x47')](_0x31f5f6,['id',_0xe60b('0x48'),_0xe60b('0x49')]);_0x110ec3[_0xe60b('0x4a')]=_[_0xe60b('0x47')](_0x110ec3[_0xe60b('0x4a')],['id',_0xe60b('0x48'),_0xe60b('0x49')]);return db[_0xe60b('0x2a')]['create'](_[_0xe60b('0x3c')](_0x31f5f6,_0x110ec3[_0xe60b('0x4a')]),{'include':_0x110ec3[_0xe60b('0x30')][_0xe60b('0x3e')]?[{'all':!![]}]:undefined});}})[_0xe60b('0x23')](respondWithResult(_0x2ae69f,0xc9))[_0xe60b('0x40')](handleError(_0x2ae69f,null));};exports[_0xe60b('0x4b')]=function(_0x59e4fd,_0x44e324){if(_0x59e4fd[_0xe60b('0x4a')]['id']){delete _0x59e4fd[_0xe60b('0x4a')]['id'];}return db[_0xe60b('0x2a')][_0xe60b('0x45')]({'where':{'id':_0x59e4fd[_0xe60b('0x41')]['id']}})[_0xe60b('0x23')](handleEntityNotFound(_0x44e324,null))[_0xe60b('0x23')](saveUpdates(_0x59e4fd['body'],null))[_0xe60b('0x23')](respondWithResult(_0x44e324,null))[_0xe60b('0x40')](handleError(_0x44e324,null));};exports['destroy']=function(_0x46f330,_0x3f9a2b){return db['Attachment'][_0xe60b('0x45')]({'where':{'id':_0x46f330[_0xe60b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f9a2b,null))['then'](removeEntity(_0x3f9a2b,null))[_0xe60b('0x40')](handleError(_0x3f9a2b,null));};exports[_0xe60b('0x4c')]=function(_0x4f2ad5,_0x50017e,_0x17383e){_0x4f2ad5[_0xe60b('0x4a')][_0xe60b('0x26')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x4e')];_0x4f2ad5['body'][_0xe60b('0x4f')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x50')];_0x4f2ad5['body'][_0xe60b('0x2d')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x51')];return db[_0xe60b('0x2a')][_0xe60b('0x4c')](_0x4f2ad5['body'])[_0xe60b('0x23')](respondWithResult(_0x50017e,0xc9))[_0xe60b('0x40')](handleError(_0x50017e,null));};exports[_0xe60b('0x52')]=function(_0x3490bd,_0x148c9a,_0x42ef5c){return db[_0xe60b('0x2a')][_0xe60b('0x53')]({'where':{'id':_0x3490bd[_0xe60b('0x41')]['id']},'raw':!![]})[_0xe60b('0x23')](handleEntityNotFound(_0x148c9a,null))['then'](function(_0x299a14){if(_0x299a14){var _0x159c00=_0x299a14[_0xe60b('0x54')]!==null;var _0x336611=path[_0xe60b('0x55')](config[_0xe60b('0x56')],_0xe60b('0x57'));if(_0x159c00){_0x336611=path[_0xe60b('0x55')](_0x336611,_0xe60b('0x58'));}var _0x541caa=path[_0xe60b('0x55')](_0x336611,_0x299a14['basename']);return _0x148c9a[_0xe60b('0x52')](_0x541caa);}})[_0xe60b('0x40')](handleError(_0x148c9a,null));}; \ No newline at end of file +var _0x4d97=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','get','omit','updatedAt','body','createdAt','file','filename','type','mimetype','create','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','key','model','query','intersection','fields','attributes'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x4d97,0x77));var _0x74d9=function(_0xe64add,_0x513eec){_0xe64add=_0xe64add-0x0;var _0x3af097=_0x4d97[_0xe64add];return _0x3af097;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d9('0x0'));var zipdir=require(_0x74d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x74d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x74d9('0x3'));var util=require(_0x74d9('0x4'));var path=require(_0x74d9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74d9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d9('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x74d9('0x8'));var toCsv=require(_0x74d9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74d9('0xa'));var authService=require(_0x74d9('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x74d9('0xc'));var hardwareService=require(_0x74d9('0xd'));var logger=require(_0x74d9('0xe'))(_0x74d9('0xf'));var utils=require(_0x74d9('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x74d9('0x11'));var db=require(_0x74d9('0x12'))['db'];function respondWithStatusCode(_0x8f6f40,_0x5aa494){_0x5aa494=_0x5aa494||0xcc;return function(_0x572614){if(_0x572614){return _0x8f6f40['sendStatus'](_0x5aa494);}return _0x8f6f40['status'](_0x5aa494)[_0x74d9('0x13')]();};}function respondWithResult(_0xc92a25,_0x2a72b5){_0x2a72b5=_0x2a72b5||0xc8;return function(_0x2d238a){if(_0x2d238a){return _0xc92a25[_0x74d9('0x14')](_0x2a72b5)['json'](_0x2d238a);}};}function respondWithFilteredResult(_0x53aaa7,_0x350596){return function(_0x4a04fe){if(_0x4a04fe){var _0x8c01ef=typeof _0x350596['offset']===_0x74d9('0x15')&&typeof _0x350596[_0x74d9('0x16')]===_0x74d9('0x15');var _0x33b47f=_0x4a04fe['count'];var _0x42a0d0=_0x8c01ef?0x0:_0x350596['offset'];var _0x44cca2=_0x8c01ef?_0x4a04fe[_0x74d9('0x17')]:_0x350596[_0x74d9('0x18')]+_0x350596['limit'];var _0x3cca66;if(_0x44cca2>=_0x33b47f){_0x44cca2=_0x33b47f;_0x3cca66=0xc8;}else{_0x3cca66=0xce;}_0x53aaa7['status'](_0x3cca66);return _0x53aaa7['set']('Content-Range',_0x42a0d0+'-'+_0x44cca2+'/'+_0x33b47f)[_0x74d9('0x19')](_0x4a04fe);}return null;};}function patchUpdates(_0x15d964){return function(_0x27d1ec){try{jsonpatch[_0x74d9('0x1a')](_0x27d1ec,_0x15d964,!![]);}catch(_0xcc45f6){return BPromise[_0x74d9('0x1b')](_0xcc45f6);}return _0x27d1ec[_0x74d9('0x1c')]();};}function saveUpdates(_0x1d81ba,_0x469c16){return function(_0xc56775){if(_0xc56775){return _0xc56775[_0x74d9('0x1d')](_0x1d81ba)[_0x74d9('0x1e')](function(_0x263cd0){return _0x263cd0;});}return null;};}function removeEntity(_0x3656c4,_0x5407ac){return function(_0x47bba7){if(_0x47bba7){return _0x47bba7['destroy']()[_0x74d9('0x1e')](function(){_0x3656c4['status'](0xcc)[_0x74d9('0x13')]();});}};}function handleEntityNotFound(_0x582e1a,_0x226d28){return function(_0x11554c){if(!_0x11554c){_0x582e1a[_0x74d9('0x1f')](0x194);}return _0x11554c;};}function handleError(_0x4d2255,_0x5371b7){_0x5371b7=_0x5371b7||0x1f4;return function(_0x1e5861){logger[_0x74d9('0x20')](_0x1e5861[_0x74d9('0x21')]);if(_0x1e5861[_0x74d9('0x22')]){delete _0x1e5861[_0x74d9('0x22')];}_0x4d2255[_0x74d9('0x14')](_0x5371b7)[_0x74d9('0x23')](_0x1e5861);};}exports[_0x74d9('0x24')]=function(_0x1f6db8,_0x265e92){var _0x5f3ac1={},_0x2075d0={},_0x553028={'count':0x0,'rows':[]};var _0x50f7d1=_[_0x74d9('0x25')](db[_0x74d9('0x26')]['rawAttributes'],function(_0x2e6a1c){return{'name':_0x2e6a1c['fieldName'],'type':_0x2e6a1c['type'][_0x74d9('0x27')]};});_0x2075d0[_0x74d9('0x28')]=_['map'](_0x50f7d1,_0x74d9('0x22'));_0x2075d0[_0x74d9('0x29')]=_['keys'](_0x1f6db8['query']);_0x2075d0['filters']=_[_0x74d9('0x2a')](_0x2075d0[_0x74d9('0x28')],_0x2075d0['query']);_0x5f3ac1['attributes']=_['intersection'](_0x2075d0[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5f3ac1[_0x74d9('0x2c')]=_0x5f3ac1[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5f3ac1[_0x74d9('0x2c')]:_0x2075d0[_0x74d9('0x28')];if(!_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2e')](_0x74d9('0x2f'))){_0x5f3ac1['limit']=qs['limit'](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x16')]);_0x5f3ac1[_0x74d9('0x18')]=qs[_0x74d9('0x18')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x18')]);}_0x5f3ac1[_0x74d9('0x30')]=qs[_0x74d9('0x31')](_0x1f6db8['query']['sort']);_0x5f3ac1[_0x74d9('0x32')]=qs[_0x74d9('0x33')](_[_0x74d9('0x34')](_0x1f6db8[_0x74d9('0x29')],_0x2075d0[_0x74d9('0x33')]),_0x50f7d1);if(_0x1f6db8[_0x74d9('0x29')]['filter']){_0x5f3ac1[_0x74d9('0x32')]=_['merge'](_0x5f3ac1['where'],{'$or':_[_0x74d9('0x25')](_0x50f7d1,function(_0x392630){if(_0x392630['type']!==_0x74d9('0x35')){var _0x14ed55={};_0x14ed55[_0x392630[_0x74d9('0x22')]]={'$like':'%'+_0x1f6db8[_0x74d9('0x29')]['filter']+'%'};return _0x14ed55;}})});}_0x5f3ac1=_[_0x74d9('0x36')]({},_0x5f3ac1,_0x1f6db8[_0x74d9('0x37')]);var _0x392b6d={'where':_0x5f3ac1[_0x74d9('0x32')]};return db[_0x74d9('0x26')][_0x74d9('0x17')](_0x392b6d)[_0x74d9('0x1e')](function(_0x1c42f4){_0x553028[_0x74d9('0x17')]=_0x1c42f4;if(_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5f3ac1['include']=[{'all':!![]}];}return db[_0x74d9('0x26')][_0x74d9('0x39')](_0x5f3ac1);})[_0x74d9('0x1e')](function(_0x4b424e){_0x553028[_0x74d9('0x3a')]=_0x4b424e;return _0x553028;})['then'](respondWithFilteredResult(_0x265e92,_0x5f3ac1))['catch'](handleError(_0x265e92,null));};exports[_0x74d9('0x3b')]=function(_0x41d6f7,_0x409717){var _0x3c1d15={'raw':!![],'where':{'id':_0x41d6f7[_0x74d9('0x3c')]['id']}},_0x526383={};_0x526383[_0x74d9('0x28')]=_[_0x74d9('0x3d')](db[_0x74d9('0x26')][_0x74d9('0x3e')]);_0x526383['query']=_[_0x74d9('0x3d')](_0x41d6f7[_0x74d9('0x29')]);_0x526383[_0x74d9('0x33')]=_['intersection'](_0x526383[_0x74d9('0x28')],_0x526383['query']);_0x3c1d15[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x526383['model'],qs['fields'](_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x3c1d15['attributes']=_0x3c1d15[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x3c1d15['attributes']:_0x526383[_0x74d9('0x28')];if(_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x38')]){_0x3c1d15[_0x74d9('0x3f')]=[{'all':!![]}];}_0x3c1d15=_['merge']({},_0x3c1d15,_0x41d6f7[_0x74d9('0x37')]);return db['Attachment'][_0x74d9('0x40')](_0x3c1d15)[_0x74d9('0x1e')](handleEntityNotFound(_0x409717,null))[_0x74d9('0x1e')](respondWithResult(_0x409717,null))[_0x74d9('0x41')](handleError(_0x409717,null));};exports['clone']=function(_0x490fd3,_0x1dae36){var _0x5d9d9d={'where':{'id':_0x490fd3[_0x74d9('0x3c')]['id']}},_0x1d0671={};_0x1d0671['model']=_[_0x74d9('0x3d')](db[_0x74d9('0x26')]['rawAttributes']);_0x5d9d9d[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x1d0671[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x490fd3[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5d9d9d[_0x74d9('0x2c')]=_0x5d9d9d[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5d9d9d[_0x74d9('0x2c')]:_0x1d0671[_0x74d9('0x28')];if(_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5d9d9d[_0x74d9('0x3f')]=[{'all':!![]}];}_0x5d9d9d=_['merge']({},_0x5d9d9d,_0x490fd3['options']);return db[_0x74d9('0x26')][_0x74d9('0x40')](_0x5d9d9d)[_0x74d9('0x1e')](handleEntityNotFound(_0x1dae36,null))[_0x74d9('0x1e')](function(_0x4cf085){if(_0x4cf085){var _0x5ce857=_0x4cf085[_0x74d9('0x42')]({'plain':!![]});_0x5ce857=qs[_0x74d9('0x43')](_0x5ce857,['id','createdAt',_0x74d9('0x44')]);_0x490fd3[_0x74d9('0x45')]=_[_0x74d9('0x43')](_0x490fd3[_0x74d9('0x45')],['id',_0x74d9('0x46'),_0x74d9('0x44')]);return db[_0x74d9('0x26')]['create'](_[_0x74d9('0x36')](_0x5ce857,_0x490fd3['body']),{'include':_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]?[{'all':!![]}]:undefined});}})[_0x74d9('0x1e')](respondWithResult(_0x1dae36,0xc9))[_0x74d9('0x41')](handleError(_0x1dae36,null));};exports[_0x74d9('0x1d')]=function(_0x2c52cf,_0x45528f){if(_0x2c52cf[_0x74d9('0x45')]['id']){delete _0x2c52cf[_0x74d9('0x45')]['id'];}return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x2c52cf[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x45528f,null))[_0x74d9('0x1e')](saveUpdates(_0x2c52cf['body'],null))[_0x74d9('0x1e')](respondWithResult(_0x45528f,null))['catch'](handleError(_0x45528f,null));};exports['destroy']=function(_0x5357d8,_0x1376cd){return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x5357d8[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x1376cd,null))[_0x74d9('0x1e')](removeEntity(_0x1376cd,null))[_0x74d9('0x41')](handleError(_0x1376cd,null));};exports['create']=function(_0x4e154c,_0x59c977,_0x38f2e6){_0x4e154c[_0x74d9('0x45')]['name']=_0x4e154c['file']['originalname'];_0x4e154c[_0x74d9('0x45')]['basename']=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x48')];_0x4e154c[_0x74d9('0x45')][_0x74d9('0x49')]=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x4a')];return db[_0x74d9('0x26')][_0x74d9('0x4b')](_0x4e154c[_0x74d9('0x45')])[_0x74d9('0x1e')](respondWithResult(_0x59c977,0xc9))[_0x74d9('0x41')](handleError(_0x59c977,null));};exports[_0x74d9('0x4c')]=function(_0x570306,_0x5773d6,_0x12f6ff){return db[_0x74d9('0x26')]['findOne']({'where':{'id':_0x570306[_0x74d9('0x3c')]['id']},'raw':!![]})[_0x74d9('0x1e')](handleEntityNotFound(_0x5773d6,null))['then'](function(_0x38a770){if(_0x38a770){var _0x42e714=_0x38a770[_0x74d9('0x4d')]!==null;var _0x1e623e=path[_0x74d9('0x4e')](config['root'],_0x74d9('0x4f'));if(_0x42e714){_0x1e623e=path[_0x74d9('0x4e')](_0x1e623e,_0x74d9('0x50'));}var _0x2a88f9=path['join'](_0x1e623e,_0x38a770[_0x74d9('0x51')]);return _0x5773d6[_0x74d9('0x4c')](_0x2a88f9);}})[_0x74d9('0x41')](handleError(_0x5773d6,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 14489b6..58b191f 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 _0xcc23=['util','moment','bluebird','rimraf','../../config/environment','exports','define','attachments','lodash'];(function(_0x496ca0,_0x5c8eb1){var _0x109004=function(_0x157eab){while(--_0x157eab){_0x496ca0['push'](_0x496ca0['shift']());}};_0x109004(++_0x5c8eb1);}(_0xcc23,0x167));var _0x3cc2=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xcc23[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x3cc2('0x0'));var util=require(_0x3cc2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3cc2('0x2'));var BPromise=require(_0x3cc2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc2('0x4'));var config=require(_0x3cc2('0x5'));var attributes=require('./attachment.attributes');module[_0x3cc2('0x6')]=function(_0x35653b,_0x21b593){return _0x35653b[_0x3cc2('0x7')]('Attachment',attributes,{'tableName':_0x3cc2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb8a=['api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger'];(function(_0x1dc029,_0x17fb0d){var _0x510cb3=function(_0x5a42c0){while(--_0x5a42c0){_0x1dc029['push'](_0x1dc029['shift']());}};_0x510cb3(++_0x17fb0d);}(_0xbb8a,0xae));var _0xabb8=function(_0x2790ed,_0x35544c){_0x2790ed=_0x2790ed-0x0;var _0x1431cc=_0xbb8a[_0x2790ed];return _0x1431cc;};'use strict';var _=require('lodash');var util=require(_0xabb8('0x0'));var logger=require(_0xabb8('0x1'))(_0xabb8('0x2'));var moment=require(_0xabb8('0x3'));var BPromise=require(_0xabb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabb8('0x5'));var rimraf=require('rimraf');var config=require(_0xabb8('0x6'));var attributes=require(_0xabb8('0x7'));module[_0xabb8('0x8')]=function(_0x2c829e,_0x3d2a5c){return _0x2c829e[_0xabb8('0x9')]('Attachment',attributes,{'tableName':_0xabb8('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 2d9c537..b76fbc3 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 _0x3ee5=['body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create'];(function(_0x179c7b,_0x12bd08){var _0x5b9496=function(_0x37d098){while(--_0x37d098){_0x179c7b['push'](_0x179c7b['shift']());}};_0x5b9496(++_0x12bd08);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x50707b,_0x485f24){_0x50707b=_0x50707b-0x0;var _0x423e5c=_0x3ee5[_0x50707b];return _0x423e5c;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Attachment,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')](_0x3d788e[_0x53ee('0x1b')],{'raw':_0x3d788e[_0x53ee('0x1c')]?_0x3d788e[_0x53ee('0x1c')][_0x53ee('0x1d')]===undefined?!![]:![]:!![]})[_0x53ee('0xd')](function(_0x2cbd98){logger['info'](_0x53ee('0x18'),_0x3d788e);logger['debug']('CreateAttachment',_0x3d788e,JSON[_0x53ee('0x1e')](_0x2cbd98));_0x708604(_0x2cbd98);})[_0x53ee('0x17')](function(_0x4105d6){logger['error'](_0x53ee('0x18'),_0x4105d6[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb[_0x53ee('0x13')](0x1f4,_0x4105d6[_0x53ee('0x15')]));});});}; \ No newline at end of file +var _0x24cf=['code','message','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x2283a9,_0x4e2e63){var _0x3cbc8c=function(_0x282ab5){while(--_0x282ab5){_0x2283a9['push'](_0x2283a9['shift']());}};_0x3cbc8c(++_0x4e2e63);}(_0x24cf,0x1d5));var _0xf24c=function(_0x19f9e9,_0x5ab385){_0x19f9e9=_0x19f9e9-0x0;var _0x2c23cb=_0x24cf[_0x19f9e9];return _0x2c23cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateAttachment',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b38080e..e888d8d 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0xc98284,_0xfbb179){_0xc98284=_0xc98284-0x0;var _0x3f9ad2=_0xdb28[_0xc98284];return _0x3f9ad2;};'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 fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x35f9fe,_0x25746a){_0x35f9fe=_0x35f9fe-0x0;var _0x3327a1=_0xdb28[_0x35f9fe];return _0x3327a1;};'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 fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 6236748..a5e4e3f 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x395b=['signToken','json','use','User','passport','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','disabled','online','user','blockedAt','add','clearBlockUser','getLicense','catch','status','role'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x395b,0x79));var _0xb395=function(_0x5d7803,_0x30e9aa){_0x5d7803=_0x5d7803-0x0;var _0x1a43b2=_0x395b[_0x5d7803];return _0x1a43b2;};'use strict';var passport=require(_0xb395('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xb395('0x1'));var BPromise=require(_0xb395('0x2'));var util=require(_0xb395('0x3'));var db=require(_0xb395('0x4'))['db'];var authService=require(_0xb395('0x5'));var utils=require('../../config/utils');var config=require(_0xb395('0x6'));var logger=require(_0xb395('0x7'))(_0xb395('0x8'));function isActiveDirectoryConfigured(_0x4bb8fa){var _0x24018e=![];if(typeof _0x4bb8fa['activedirectory']!==_0xb395('0x9')){_0x24018e=_0x4bb8fa[_0xb395('0xa')]['baseDN']&&_0x4bb8fa[_0xb395('0xa')]['url']&&_0x4bb8fa['activedirectory'][_0xb395('0xb')];}return _0x24018e;}function adAuthenticate(_0x558d5e,_0x5e36a3,_0x183cb4){return new BPromise(function(_0x3d5282,_0x7bc91e){try{var _0x2e1cda=new ActiveDirectory(_0x558d5e);_0x2e1cda[_0xb395('0xc')](_0x5e36a3,_0x183cb4,function(_0x144e61,_0x1a19d6){if(_0x144e61){logger[_0xb395('0xd')](_0xb395('0xe'),_0x5e36a3,util['inspect'](_0x144e61,{'showHidden':![],'depth':null}));_0x7bc91e(_0xb395('0xf'));}else if(!_0x1a19d6){logger[_0xb395('0xd')](_0xb395('0x10'),_0x5e36a3);_0x7bc91e(_0xb395('0xf'));}else{_0x3d5282(_0x1a19d6);}});}catch(_0x2b2554){_0x7bc91e(_0x2b2554);}});}function ActiveDirectoryAuthenticate(_0x563616,_0x27f0c0,_0x12f760,_0x5e727d){var _0x5201a6,_0x5ee56c;if(!isActiveDirectoryConfigured(config)){logger[_0xb395('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x27f0c0);return _0x5e727d(null,![],{'message':_0xb395('0xf')});}return db[_0xb395('0x11')][_0xb395('0x12')]({'where':{'id':0x1},'attributes':[_0xb395('0x13'),_0xb395('0x14')],'raw':!![]})[_0xb395('0x15')](function(_0x2c0414){_0x5201a6=_0x2c0414;if(!_0x5201a6['adSsoEnabled']){logger[_0xb395('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x27f0c0);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x563616['findOne']({'attributes':['id',_0xb395('0x16'),_0xb395('0x17'),_0xb395('0x18'),'role',_0xb395('0x19'),'blocked','blockedAt',_0xb395('0x1a')],'where':{'name':_0x27f0c0,'role':{'$or':['admin',_0xb395('0x1b'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x37a60c){if(!_0x37a60c||_0x37a60c&&_0x37a60c['name']!==_0x27f0c0){throw new Error(_0xb395('0xf'));}_0x5ee56c=_0x37a60c;var _0x2a1000=_0x5ee56c['name']+'@'+config[_0xb395('0xa')][_0xb395('0xb')];return adAuthenticate(config['activedirectory'],_0x2a1000,_0x12f760);})['then'](function(_0x22c7a3){if(_0x5ee56c[_0xb395('0x19')]){throw new Error(_0xb395('0xf'));}if(_0x5201a6[_0xb395('0x14')]>0x0){if(_0x5ee56c['blocked']){if(moment(_0x5ee56c[_0xb395('0x1c')])[_0xb395('0x1d')](_0x5201a6[_0xb395('0x14')],'minutes')>moment()){throw new Error(_0xb395('0xf'));}return utils[_0xb395('0x1e')](_0x5ee56c,0x0,![],null)[_0xb395('0x15')](function(){return utils['getLicense'](_0x5ee56c);})[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}else{return utils[_0xb395('0x1f')](_0x5ee56c)[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}}else{return utils[_0xb395('0x1f')](_0x5ee56c)[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}})[_0xb395('0x20')](function(_0x214af8){return _0x5e727d(null,![],_0x214af8);});}function handleError(_0x7b29c8,_0x2fba5e,_0x127bb5){return _0x7b29c8[_0xb395('0x21')](_0x2fba5e||0x1f4)['send']({'message':_0x127bb5?_0x127bb5['message']||_0x127bb5:''});}exports['login']=function(_0x47be48,_0x3c7c4b,_0x1ecc90){passport[_0xb395('0xc')]('ad-login',function(_0x2af13c,_0xb19c59,_0x3c51ad){var _0x4ca032=_0x2af13c||_0x3c51ad;if(_0x4ca032){return handleError(_0x3c7c4b,0x191,_0x4ca032);}if(!_0xb19c59){return handleError(_0x3c7c4b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x362bff={'payload':{'id':_0xb19c59['id'],'role':_0xb19c59[_0xb395('0x22')]},'options':{'expiresIn':0x15180}};return authService[_0xb395('0x23')](_0x362bff)[_0xb395('0x15')](function(_0x2d1441){_0x3c7c4b[_0xb395('0x24')]({'id':_0xb19c59['id'],'token':_0x2d1441,'statusCall':'','isAlreadyLogged':_0xb19c59[_0xb395('0x1a')]});});}})(_0x47be48,_0x3c7c4b,_0x1ecc90);};passport[_0xb395('0x25')]('ad-login',new LocalStrategy({'usernameField':_0xb395('0x16'),'passwordField':_0xb395('0x17')},function(_0x1720a1,_0x38b4d6,_0x102059){return ActiveDirectoryAuthenticate(db[_0xb395('0x26')],_0x1720a1,_0x38b4d6,_0x102059);})); \ No newline at end of file +var _0xee6f=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','then','name','add','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','User','passport','passport-local','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xee6f,0x1f3));var _0xfee6=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xee6f[_0xef4fc0];return _0x57dade;};'use strict';var passport=require(_0xfee6('0x0'));var LocalStrategy=require(_0xfee6('0x1'))[_0xfee6('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xfee6('0x3'));var BPromise=require('bluebird');var util=require(_0xfee6('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfee6('0x5'));var utils=require(_0xfee6('0x6'));var config=require(_0xfee6('0x7'));var logger=require(_0xfee6('0x8'))('api');function isActiveDirectoryConfigured(_0x382ca9){var _0x31a800=![];if(typeof _0x382ca9[_0xfee6('0x9')]!==_0xfee6('0xa')){_0x31a800=_0x382ca9[_0xfee6('0x9')][_0xfee6('0xb')]&&_0x382ca9[_0xfee6('0x9')][_0xfee6('0xc')]&&_0x382ca9['activedirectory'][_0xfee6('0xd')];}return _0x31a800;}function adAuthenticate(_0x415643,_0x3ad248,_0x58013b){return new BPromise(function(_0x441f2e,_0x39424d){try{var _0x333f5a=new ActiveDirectory(_0x415643);_0x333f5a[_0xfee6('0xe')](_0x3ad248,_0x58013b,function(_0x4412a4,_0x453194){if(_0x4412a4){logger['error'](_0xfee6('0xf'),_0x3ad248,util[_0xfee6('0x10')](_0x4412a4,{'showHidden':![],'depth':null}));_0x39424d(_0xfee6('0x11'));}else if(!_0x453194){logger[_0xfee6('0x12')](_0xfee6('0x13'),_0x3ad248);_0x39424d(_0xfee6('0x11'));}else{_0x441f2e(_0x453194);}});}catch(_0x2ae36d){_0x39424d(_0x2ae36d);}});}function ActiveDirectoryAuthenticate(_0x10ee4d,_0x735e3d,_0x6308ba,_0x206c9d){var _0x514d91,_0xd3cb2a;if(!isActiveDirectoryConfigured(config)){logger[_0xfee6('0x12')](_0xfee6('0x14'),_0x735e3d);return _0x206c9d(null,![],{'message':_0xfee6('0x11')});}return db['Setting'][_0xfee6('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xfee6('0x16')],'raw':!![]})['then'](function(_0x77d050){_0x514d91=_0x77d050;if(!_0x514d91['adSsoEnabled']){logger[_0xfee6('0x12')](_0xfee6('0x17'),_0x735e3d);throw new Error(_0xfee6('0x11'));}return _0x10ee4d[_0xfee6('0x15')]({'attributes':['id','name',_0xfee6('0x18'),_0xfee6('0x19'),_0xfee6('0x1a'),'disabled',_0xfee6('0x1b'),_0xfee6('0x1c'),'online'],'where':{'name':_0x735e3d,'role':{'$or':[_0xfee6('0x1d'),'user','agent']},'adSsoEnabled':!![]}});})[_0xfee6('0x1e')](function(_0x18123d){if(!_0x18123d||_0x18123d&&_0x18123d[_0xfee6('0x1f')]!==_0x735e3d){throw new Error(_0xfee6('0x11'));}_0xd3cb2a=_0x18123d;var _0x32e484=_0xd3cb2a['name']+'@'+config[_0xfee6('0x9')][_0xfee6('0xd')];return adAuthenticate(config['activedirectory'],_0x32e484,_0x6308ba);})[_0xfee6('0x1e')](function(_0x55ffad){if(_0xd3cb2a['disabled']){throw new Error(_0xfee6('0x11'));}if(_0x514d91[_0xfee6('0x16')]>0x0){if(_0xd3cb2a[_0xfee6('0x1b')]){if(moment(_0xd3cb2a[_0xfee6('0x1c')])[_0xfee6('0x20')](_0x514d91['blockDuration'],'minutes')>moment()){throw new Error(_0xfee6('0x11'));}return utils['clearBlockUser'](_0xd3cb2a,0x0,![],null)[_0xfee6('0x1e')](function(){return utils[_0xfee6('0x21')](_0xd3cb2a);})[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}})[_0xfee6('0x22')](function(_0x4bf912){return _0x206c9d(null,![],_0x4bf912);});}function handleError(_0x3951f3,_0x1f0de6,_0x2fdf88){return _0x3951f3['status'](_0x1f0de6||0x1f4)[_0xfee6('0x23')]({'message':_0x2fdf88?_0x2fdf88[_0xfee6('0x24')]||_0x2fdf88:''});}exports[_0xfee6('0x25')]=function(_0x30a32d,_0x1d347e,_0x3b6eb6){passport[_0xfee6('0xe')](_0xfee6('0x26'),function(_0x573376,_0x29d2ab,_0x30d0ac){var _0x5d41a9=_0x573376||_0x30d0ac;if(_0x5d41a9){return handleError(_0x1d347e,0x191,_0x5d41a9);}if(!_0x29d2ab){return handleError(_0x1d347e,0x194,{'message':_0xfee6('0x27')});}else{var _0x1f6e66={'payload':{'id':_0x29d2ab['id'],'role':_0x29d2ab['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f6e66)[_0xfee6('0x1e')](function(_0x36c40b){_0x1d347e[_0xfee6('0x28')]({'id':_0x29d2ab['id'],'token':_0x36c40b,'statusCall':'','isAlreadyLogged':_0x29d2ab[_0xfee6('0x29')]});});}})(_0x30a32d,_0x1d347e,_0x3b6eb6);};passport['use'](_0xfee6('0x26'),new LocalStrategy({'usernameField':_0xfee6('0x1f'),'passwordField':_0xfee6('0x18')},function(_0x501917,_0x3d2823,_0xaa6320){return ActiveDirectoryAuthenticate(db[_0xfee6('0x2a')],_0x501917,_0x3d2823,_0xaa6320);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index ac844ce..3736e70 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f2e=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x4529df,_0x1b9abd){var _0x41e9d3=function(_0x569224){while(--_0x569224){_0x4529df['push'](_0x4529df['shift']());}};_0x41e9d3(++_0x1b9abd);}(_0x0f2e,0x6b));var _0xe0f2=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x0f2e[_0x1075b8];return _0x5d047f;};'use strict';var express=require(_0xe0f2('0x0'));var router=express[_0xe0f2('0x1')]();var controller=require(_0xe0f2('0x2'));router[_0xe0f2('0x3')]('/',controller['login']);module[_0xe0f2('0x4')]=router; \ No newline at end of file +var _0x2e84=['express','Router','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e84,0x150));var _0x42e8=function(_0x436564,_0xeb94af){_0x436564=_0x436564-0x0;var _0x25f606=_0x2e84[_0x436564];return _0x25f606;};'use strict';var express=require(_0x42e8('0x0'));var router=express[_0x42e8('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x42e8('0x2')]('/',controller['login']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d11bfb0..4abbce7 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x7a54,0x106));var _0x47a5=function(_0x7e7377,_0x3301ec){_0x7e7377=_0x7e7377-0x0;var _0x3978b5=_0x7a54[_0x7e7377];return _0x3978b5;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x504dde,_0x207ebc){var _0x5333c4=function(_0x1136c4){while(--_0x1136c4){_0x504dde['push'](_0x504dde['shift']());}};_0x5333c4(++_0x207ebc);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ec03671..209b271 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 _0x0060=['setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0060,0xda));var _0x0006=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0x0060[_0x32a81f];return _0x5b67a2;};'use strict';var express=require('express');var passport=require(_0x0006('0x0'));var router=express[_0x0006('0x1')]();var controller=require(_0x0006('0x2'));var userController=require(_0x0006('0x3'));var authService=require('../../components/auth/service');router[_0x0006('0x4')]('/',controller['login']);router[_0x0006('0x4')](_0x0006('0x5'),controller[_0x0006('0x6')],authService['isMiddleware'],userController['login'],authService[_0x0006('0x7')]);module[_0x0006('0x8')]=router; \ No newline at end of file +var _0x8b8d=['./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','setTokenCookie','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8b8d,0x15f));var _0xd8b8=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x8b8d[_0x2576d7];return _0x16a08c;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xd8b8('0x0')]();var controller=require(_0xd8b8('0x1'));var userController=require(_0xd8b8('0x2'));var authService=require('../../components/auth/service');router[_0xd8b8('0x3')]('/',controller['login']);router[_0xd8b8('0x3')](_0xd8b8('0x4'),controller[_0xd8b8('0x5')],authService['isMiddleware'],userController[_0xd8b8('0x6')],authService[_0xd8b8('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 4d65026..fc90f8c 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 _0x7a73=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','save','Password\x20reset!','catch','use','local-login','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','minutes','clearBlockUser','blockedAt','add','getLicense','MailAccount','find','email','Smtp','CloudProvider'];(function(_0x3bd5cd,_0x284a33){var _0x1e9ad2=function(_0xbe0d4e){while(--_0xbe0d4e){_0x3bd5cd['push'](_0x3bd5cd['shift']());}};_0x1e9ad2(++_0x284a33);}(_0x7a73,0xd9));var _0x37a7=function(_0x334b82,_0x56030f){_0x334b82=_0x334b82-0x0;var _0x713ad6=_0x7a73[_0x334b82];return _0x713ad6;};'use strict';var util=require(_0x37a7('0x0'));var passport=require(_0x37a7('0x1'));var LocalStrategy=require(_0x37a7('0x2'))[_0x37a7('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x37a7('0x4'));var moment=require(_0x37a7('0x5'));var db=require(_0x37a7('0x6'))['db'];var authService=require(_0x37a7('0x7'));var utils=require('../../config/utils');var client=jayson[_0x37a7('0x8')][_0x37a7('0x9')]({'port':0x232b});function localAuthenticate(_0x1be633,_0x55fe84,_0x2a1de0,_0x4e445a){var _0x5d0e0c,_0x13c767;return db[_0x37a7('0xa')][_0x37a7('0xb')]({'where':{'id':0x1},'attributes':[_0x37a7('0xc'),_0x37a7('0xd')],'raw':!![]})[_0x37a7('0xe')](function(_0x2cbbbe){_0x5d0e0c=_0x2cbbbe;return _0x1be633[_0x37a7('0xb')]({'attributes':['id',_0x37a7('0xf'),'password',_0x37a7('0x10'),_0x37a7('0x11'),'disabled',_0x37a7('0x12'),'blockedAt','loginAttempts'],'where':{'name':_0x55fe84,'role':{'$or':[_0x37a7('0x13'),_0x37a7('0x14'),_0x37a7('0x15')]}}});})[_0x37a7('0xe')](function(_0x3d38cc){if(!_0x3d38cc||_0x3d38cc&&_0x3d38cc[_0x37a7('0xf')]!==_0x55fe84){throw new Error(_0x37a7('0x16'));}else{_0x13c767=_0x3d38cc;return _0x13c767;}})['then'](function(){_0x13c767[_0x37a7('0x17')](_0x2a1de0,function(_0x5924fc,_0x4419cd){var _0x5ca1e6=_0x13c767['loginAttempts']+0x1;if(_0x5924fc){return _0x4e445a(_0x5924fc);}else if(!_0x4419cd){if(_0x13c767[_0x37a7('0x18')]){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else if(_0x5d0e0c[_0x37a7('0xc')]>0x0){if(_0x13c767[_0x37a7('0x12')]){if(_0x5d0e0c[_0x37a7('0xd')]>0x0){if(moment(_0x13c767['blockedAt'])['add'](_0x5d0e0c[_0x37a7('0xd')],_0x37a7('0x19'))>moment()){return _0x4e445a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x37a7('0x1a')](_0x13c767,_0x5ca1e6,![],null)[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{if(_0x5ca1e6>=_0x5d0e0c[_0x37a7('0xc')]){return utils[_0x37a7('0x1a')](_0x13c767,0x0,!![],moment())[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}else{return utils[_0x37a7('0x1a')](_0x13c767,_0x5ca1e6,![],null)[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{if(_0x13c767[_0x37a7('0x18')]){return _0x4e445a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5d0e0c[_0x37a7('0xc')]>0x0){if(_0x13c767['blocked']){if(_0x5d0e0c[_0x37a7('0xd')]>0x0){if(moment(_0x13c767[_0x37a7('0x1b')])[_0x37a7('0x1c')](_0x5d0e0c['blockDuration'],'minutes')>moment()){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else{return utils[_0x37a7('0x1a')](_0x13c767,0x0,![],null)[_0x37a7('0xe')](function(){return utils[_0x37a7('0x1d')](_0x13c767);})[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);});}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{return utils[_0x37a7('0x1a')](_0x13c767,0x0,![],null)[_0x37a7('0xe')](function(){return utils[_0x37a7('0x1d')](_0x13c767);})[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);})['catch'](function(_0x43a310){return _0x4e445a(null,![],_0x43a310);});}}else{if(_0x13c767[_0x37a7('0x12')]){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else{return utils['getLicense'](_0x13c767)[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);});}}}});})['catch'](function(_0x106aa6){return _0x4e445a(null,![],_0x106aa6);});}function sendServiceMail(_0x5cf880){return db[_0x37a7('0x1e')][_0x37a7('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x37a7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x37a7('0x21'),'include':[{'model':db[_0x37a7('0x22')],'as':_0x37a7('0x22')}]}]})['then'](function(_0x14f66c){if(!_0x14f66c){throw new Error(_0x37a7('0x23'));}var _0x43d273=_0x14f66c[_0x37a7('0x24')]();var _0x89f81={'account':_0x43d273,'message':_['merge']({'from':util[_0x37a7('0x25')](_0x37a7('0x26'),_0x14f66c[_0x37a7('0xf')],_0x14f66c['email']||_0x14f66c[_0x37a7('0x21')][_0x37a7('0x14')])},_0x5cf880)};return client[_0x37a7('0x27')](_0x37a7('0x28'),_0x89f81);})[_0x37a7('0xe')](function(_0x2b54e1){if(_0x2b54e1[_0x37a7('0x29')]){throw new Error(util[_0x37a7('0x25')](_0x37a7('0x2a'),_0x2b54e1[_0x37a7('0x29')][_0x37a7('0x2b')]||JSON[_0x37a7('0x2c')](_0x2b54e1[_0x37a7('0x29')])));}return!![];});}function handleError(_0x261fa3,_0x5eede9,_0x214cda){return _0x261fa3[_0x37a7('0x2d')](_0x5eede9||0x1f4)[_0x37a7('0x2e')]({'message':_0x214cda?_0x214cda[_0x37a7('0x2b')]||_0x214cda:''});}exports[_0x37a7('0x2f')]=function(_0x3eed76,_0x47ce23,_0x16e678){passport[_0x37a7('0x17')]('local-login',function(_0x365d8f,_0x538113,_0x25d820){var _0x12e72e=_0x365d8f||_0x25d820;if(_0x12e72e){return handleError(_0x47ce23,0x191,_0x12e72e);}if(!_0x538113){return handleError(_0x47ce23,0x194,{'message':_0x37a7('0x30')});}else{var _0x2153c8={'payload':{'id':_0x538113['id'],'role':_0x538113['role']},'options':{'expiresIn':0x15180}};return authService[_0x37a7('0x31')](_0x2153c8)[_0x37a7('0xe')](function(_0x564ee5){_0x47ce23[_0x37a7('0x32')]({'id':_0x538113['id'],'token':_0x564ee5,'statusCall':'','isAlreadyLogged':_0x538113[_0x37a7('0x33')]});});}})(_0x3eed76,_0x47ce23,_0x16e678);};exports['forgot']=function(_0x479157,_0x45cc55){if(!_0x479157[_0x37a7('0x34')][_0x37a7('0x20')]){return handleError(_0x45cc55,0x1f4,{'message':_0x37a7('0x35')});}var _0x2811fe=rs[_0x37a7('0x36')]();_0x479157['body'][_0x37a7('0x20')]=_0x479157[_0x37a7('0x34')][_0x37a7('0x20')][_0x37a7('0x37')]()[_0x37a7('0x38')]();var _0x5919df;return db['Setting'][_0x37a7('0xb')]({'where':{'id':0x1},'attributes':[_0x37a7('0xc'),_0x37a7('0xd')],'raw':!![]})[_0x37a7('0xe')](function(_0x2edaa5){_0x5919df=_0x2edaa5;return db['User'][_0x37a7('0x1f')]({'where':{'email':_0x479157[_0x37a7('0x34')][_0x37a7('0x20')]}});})[_0x37a7('0xe')](function(_0x503a53){if(!_0x503a53){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x503a53['disabled']){throw new Error(_0x37a7('0x39'));}if(_0x503a53['blocked']){if(moment(_0x503a53['blockedAt'])[_0x37a7('0x1c')](_0x5919df[_0x37a7('0xd')],'minutes')>moment()){throw new Error(_0x37a7('0x3a'));}else{_0x503a53[_0x37a7('0x12')]=![];_0x503a53[_0x37a7('0x1b')]=null;}}_0x503a53['resetPasswordToken']=_0x2811fe;_0x503a53[_0x37a7('0x3b')]=Date[_0x37a7('0x3c')]()+0x36ee80;return _0x503a53['save']();})[_0x37a7('0xe')](function(){return sendServiceMail({'to':_0x479157['body'][_0x37a7('0x20')],'subject':_0x37a7('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x37a7('0x3e')+'https://'+_0x479157[_0x37a7('0x3f')][_0x37a7('0x40')]+_0x37a7('0x41')+_0x2811fe+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x37a7('0xe')](function(){_0x45cc55[_0x37a7('0x2d')](0xc8)[_0x37a7('0x2e')]({'message':_0x37a7('0x42')});})['catch'](function(_0x132464){return handleError(_0x45cc55,0x1f4,_0x132464);});};exports[_0x37a7('0x43')]=function(_0x8d61e0,_0x588c27){return db[_0x37a7('0x44')][_0x37a7('0x1f')]({'where':{'resetPasswordToken':_0x8d61e0[_0x37a7('0x45')][_0x37a7('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x37a7('0xe')](function(_0x5eb4cc){if(!_0x5eb4cc){throw new Error(_0x37a7('0x47'));}return db[_0x37a7('0xa')][_0x37a7('0xb')]({'attributes':['id',_0x37a7('0x48'),_0x37a7('0x49'),_0x37a7('0x4a')]})[_0x37a7('0xe')](function(_0x4e5518){if(_0x4e5518['securePassword'])authService[_0x37a7('0x4b')](_0x8d61e0[_0x37a7('0x34')][_0x37a7('0x4c')]);if(!_0x4e5518[_0x37a7('0x49')]||!_0x5eb4cc[_0x37a7('0x4d')])return _0x5eb4cc;authService['validatePasswordHistory'](_0x8d61e0[_0x37a7('0x34')]['password'],_0x5eb4cc[_0x37a7('0x4d')],_0x4e5518[_0x37a7('0x4a')]);return _0x5eb4cc;})['then'](function(){_0x5eb4cc[_0x37a7('0x4c')]=_0x8d61e0[_0x37a7('0x34')][_0x37a7('0x4c')];_0x5eb4cc[_0x37a7('0x4e')]=null;_0x5eb4cc[_0x37a7('0x3b')]=null;return _0x5eb4cc[_0x37a7('0x4f')]();});})[_0x37a7('0xe')](function(){_0x588c27['status'](0xc8)['send']({'message':_0x37a7('0x50')});})[_0x37a7('0x51')](function(_0x37034f){return handleError(_0x588c27,0x1f4,_0x37034f);});};passport[_0x37a7('0x52')](_0x37a7('0x53'),new LocalStrategy({'usernameField':_0x37a7('0xf'),'passwordField':_0x37a7('0x4c')},function(_0x1b0ffa,_0x21bd51,_0x1e1366){return localAuthenticate(db[_0x37a7('0x44')],_0x1b0ffa,_0x21bd51,_0x1e1366);})); \ No newline at end of file +var _0xe34f=['securePassword','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','catch','use','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','add','getLicense','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local-login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit'];(function(_0x762129,_0x2014e2){var _0x327472=function(_0x15e8dd){while(--_0x15e8dd){_0x762129['push'](_0x762129['shift']());}};_0x327472(++_0x2014e2);}(_0xe34f,0x19e));var _0xfe34=function(_0x1d353d,_0x71f4f0){_0x1d353d=_0x1d353d-0x0;var _0x1d8714=_0xe34f[_0x1d353d];return _0x1d8714;};'use strict';var util=require('util');var passport=require(_0xfe34('0x0'));var LocalStrategy=require(_0xfe34('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xfe34('0x2'));var rs=require('randomstring');var moment=require(_0xfe34('0x3'));var db=require(_0xfe34('0x4'))['db'];var authService=require(_0xfe34('0x5'));var utils=require(_0xfe34('0x6'));var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232b});function localAuthenticate(_0x288dac,_0x20917f,_0x9e2042,_0x58dee7){var _0x3a6a41,_0x8dcd63;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':[_0xfe34('0xb'),_0xfe34('0xc')],'raw':!![]})['then'](function(_0x25a03a){_0x3a6a41=_0x25a03a;return _0x288dac['findOne']({'attributes':['id',_0xfe34('0xd'),'password',_0xfe34('0xe'),_0xfe34('0xf'),_0xfe34('0x10'),_0xfe34('0x11'),_0xfe34('0x12'),'loginAttempts'],'where':{'name':_0x20917f,'role':{'$or':[_0xfe34('0x13'),_0xfe34('0x14'),_0xfe34('0x15')]}}});})[_0xfe34('0x16')](function(_0x4c2a27){if(!_0x4c2a27||_0x4c2a27&&_0x4c2a27[_0xfe34('0xd')]!==_0x20917f){throw new Error(_0xfe34('0x17'));}else{_0x8dcd63=_0x4c2a27;return _0x8dcd63;}})[_0xfe34('0x16')](function(){_0x8dcd63['authenticate'](_0x9e2042,function(_0x40a3a1,_0x4aa71e){var _0x19f9cc=_0x8dcd63[_0xfe34('0x18')]+0x1;if(_0x40a3a1){return _0x58dee7(_0x40a3a1);}else if(!_0x4aa71e){if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3a6a41[_0xfe34('0xb')]>0x0){if(_0x8dcd63[_0xfe34('0x11')]){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])['add'](_0x3a6a41['blockDuration'],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,_0x19f9cc,![],null)['then'](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x19f9cc>=_0x3a6a41[_0xfe34('0xb')]){return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,!![],moment())[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}else{return utils['clearBlockUser'](_0x8dcd63,_0x19f9cc,![],null)[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else if(_0x3a6a41['allowedLoginAttempts']>0x0){if(_0x8dcd63['blocked']){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])[_0xfe34('0x1b')](_0x3a6a41[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)['then'](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)[_0xfe34('0x16')](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);})['catch'](function(_0x5313e8){return _0x58dee7(null,![],_0x5313e8);});}}else{if(_0x8dcd63['blocked']){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1c')](_0x8dcd63)[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}}});})['catch'](function(_0x30e6bd){return _0x58dee7(null,![],_0x30e6bd);});}function sendServiceMail(_0x4f111e){return db['MailAccount'][_0xfe34('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xfe34('0xd'),_0xfe34('0x1e')],'include':[{'model':db[_0xfe34('0x1f')],'as':'Smtp','include':[{'model':db[_0xfe34('0x20')],'as':'CloudProvider'}]}]})['then'](function(_0x3da0ad){if(!_0x3da0ad){throw new Error(_0xfe34('0x21'));}var _0x224893=_0x3da0ad['getSmtpOptions']();var _0x304852={'account':_0x224893,'message':_['merge']({'from':util[_0xfe34('0x22')](_0xfe34('0x23'),_0x3da0ad[_0xfe34('0xd')],_0x3da0ad['email']||_0x3da0ad[_0xfe34('0x24')]['user'])},_0x4f111e)};return client[_0xfe34('0x25')](_0xfe34('0x26'),_0x304852);})['then'](function(_0x56c260){if(_0x56c260[_0xfe34('0x27')]){throw new Error(util[_0xfe34('0x22')](_0xfe34('0x28'),_0x56c260[_0xfe34('0x27')]['message']||JSON[_0xfe34('0x29')](_0x56c260[_0xfe34('0x27')])));}return!![];});}function handleError(_0x3473ae,_0x118c94,_0x4b9430){return _0x3473ae[_0xfe34('0x2a')](_0x118c94||0x1f4)[_0xfe34('0x2b')]({'message':_0x4b9430?_0x4b9430[_0xfe34('0x2c')]||_0x4b9430:''});}exports[_0xfe34('0x2d')]=function(_0x382efb,_0x2df6e4,_0x5f1ab5){passport[_0xfe34('0x2e')](_0xfe34('0x2f'),function(_0x30336a,_0x4df23c,_0x379c18){var _0x32ce0d=_0x30336a||_0x379c18;if(_0x32ce0d){return handleError(_0x2df6e4,0x191,_0x32ce0d);}if(!_0x4df23c){return handleError(_0x2df6e4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x152df1={'payload':{'id':_0x4df23c['id'],'role':_0x4df23c[_0xfe34('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xfe34('0x30')](_0x152df1)[_0xfe34('0x16')](function(_0x48466b){_0x2df6e4[_0xfe34('0x31')]({'id':_0x4df23c['id'],'token':_0x48466b,'statusCall':'','isAlreadyLogged':_0x4df23c[_0xfe34('0x32')]});});}})(_0x382efb,_0x2df6e4,_0x5f1ab5);};exports['forgot']=function(_0x3f845d,_0xc1ddba){if(!_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]){return handleError(_0xc1ddba,0x1f4,{'message':_0xfe34('0x34')});}var _0x5ad626=rs[_0xfe34('0x35')]();_0x3f845d['body']['email']=_0x3f845d['body'][_0xfe34('0x1e')]['trim']()['toLowerCase']();var _0xf204d6;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfe34('0xc')],'raw':!![]})['then'](function(_0x39249b){_0xf204d6=_0x39249b;return db['User'][_0xfe34('0x1d')]({'where':{'email':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]}});})[_0xfe34('0x16')](function(_0x5949e2){if(!_0x5949e2){throw new Error(_0xfe34('0x36'));}if(_0x5949e2['disabled']){throw new Error(_0xfe34('0x37'));}if(_0x5949e2[_0xfe34('0x11')]){if(moment(_0x5949e2['blockedAt'])['add'](_0xf204d6[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){throw new Error(_0xfe34('0x38'));}else{_0x5949e2[_0xfe34('0x11')]=![];_0x5949e2[_0xfe34('0x12')]=null;}}_0x5949e2['resetPasswordToken']=_0x5ad626;_0x5949e2[_0xfe34('0x39')]=Date['now']()+0x36ee80;return _0x5949e2[_0xfe34('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')],'subject':_0xfe34('0x3b'),'text':_0xfe34('0x3c')+_0xfe34('0x3d')+'https://'+_0x3f845d[_0xfe34('0x3e')][_0xfe34('0x3f')]+_0xfe34('0x40')+_0x5ad626+'\x0a\x0a'+_0xfe34('0x41')});})['then'](function(){_0xc1ddba[_0xfe34('0x2a')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x4efd75){return handleError(_0xc1ddba,0x1f4,_0x4efd75);});};exports['reset']=function(_0x59278a,_0x5a4c6d){return db[_0xfe34('0x42')][_0xfe34('0x1d')]({'where':{'resetPasswordToken':_0x59278a[_0xfe34('0x43')][_0xfe34('0x44')],'resetPasswordExpires':{'$gt':Date[_0xfe34('0x45')]()}}})[_0xfe34('0x16')](function(_0x92a4aa){if(!_0x92a4aa){throw new Error(_0xfe34('0x46'));}return db[_0xfe34('0x9')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xfe34('0x47')]})[_0xfe34('0x16')](function(_0x341570){if(_0x341570[_0xfe34('0x48')])authService[_0xfe34('0x49')](_0x59278a[_0xfe34('0x33')][_0xfe34('0x4a')]);if(!_0x341570['enforcePasswordHistory']||!_0x92a4aa['previousPasswords'])return _0x92a4aa;authService[_0xfe34('0x4b')](_0x59278a[_0xfe34('0x33')]['password'],_0x92a4aa[_0xfe34('0x4c')],_0x341570['passwordHistoryLimit']);return _0x92a4aa;})['then'](function(){_0x92a4aa[_0xfe34('0x4a')]=_0x59278a['body'][_0xfe34('0x4a')];_0x92a4aa[_0xfe34('0x4d')]=null;_0x92a4aa['resetPasswordExpires']=null;return _0x92a4aa[_0xfe34('0x3a')]();});})['then'](function(){_0x5a4c6d[_0xfe34('0x2a')](0xc8)['send']({'message':_0xfe34('0x4e')});})[_0xfe34('0x4f')](function(_0x30d7ce){return handleError(_0x5a4c6d,0x1f4,_0x30d7ce);});};passport[_0xfe34('0x50')](_0xfe34('0x2f'),new LocalStrategy({'usernameField':_0xfe34('0xd'),'passwordField':_0xfe34('0x4a')},function(_0x3631bc,_0x3c3d09,_0x2c2a33){return localAuthenticate(db[_0xfe34('0x42')],_0x3631bc,_0x3c3d09,_0x2c2a33);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f41082e..1ea2441 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 _0xc784=['forgot','reset','exports','express','./authLocal.controller','post','login','/forgot'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xc784,0xb3));var _0x4c78=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0xc784[_0x46cf00];return _0x3974dc;};'use strict';var express=require(_0x4c78('0x0'));var router=express['Router']();var controller=require(_0x4c78('0x1'));router[_0x4c78('0x2')]('/',controller[_0x4c78('0x3')]);router['post'](_0x4c78('0x4'),controller[_0x4c78('0x5')]);router['post']('/reset/:token',controller[_0x4c78('0x6')]);module[_0x4c78('0x7')]=router; \ No newline at end of file +var _0xbf5a=['login','post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xbf5a,0x177));var _0xabf5=function(_0x242a25,_0x5e89fa){_0x242a25=_0x242a25-0x0;var _0x63ce6c=_0xbf5a[_0x242a25];return _0x63ce6c;};'use strict';var express=require(_0xabf5('0x0'));var router=express[_0xabf5('0x1')]();var controller=require(_0xabf5('0x2'));router['post']('/',controller[_0xabf5('0x3')]);router[_0xabf5('0x4')](_0xabf5('0x5'),controller[_0xabf5('0x6')]);router[_0xabf5('0x4')]('/reset/:token',controller[_0xabf5('0x7')]);module[_0xabf5('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index adf19af..ed0494f 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 _0x90b2=['STRING','INTEGER','sequelize','exports'];(function(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x90b2,0x1b2));var _0x290b=function(_0x1a212a,_0x64496b){_0x1a212a=_0x1a212a-0x0;var _0x22d075=_0x90b2[_0x1a212a];return _0x22d075;};'use strict';var Sequelize=require(_0x290b('0x0'));module[_0x290b('0x1')]={'name':{'type':Sequelize[_0x290b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x290b('0x2')]},'description':{'type':Sequelize[_0x290b('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x290b('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x34d2=['exports','STRING','BOOLEAN','sequelize'];(function(_0x511f3c,_0x5a4c42){var _0x466c5a=function(_0x1821bd){while(--_0x1821bd){_0x511f3c['push'](_0x511f3c['shift']());}};_0x466c5a(++_0x5a4c42);}(_0x34d2,0x143));var _0x234d=function(_0x264733,_0x13200e){_0x264733=_0x264733-0x0;var _0x433704=_0x34d2[_0x264733];return _0x433704;};'use strict';var Sequelize=require(_0x234d('0x0'));module[_0x234d('0x1')]={'name':{'type':Sequelize[_0x234d('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x234d('0x2')]},'status':{'type':Sequelize[_0x234d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 df0160d..cd3e572 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 _0x68f2=['order','hasOwnProperty','addActions','omit','Action','getActions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x68f2,0x1b4));var _0x268f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x68f2[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x268f('0x0'));var zipdir=require(_0x268f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x268f('0x2'));var moment=require(_0x268f('0x3'));var BPromise=require(_0x268f('0x4'));var Mustache=require(_0x268f('0x5'));var util=require(_0x268f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x268f('0x7'));var ejs=require(_0x268f('0x8'));var fs=require('fs');var fs_extra=require(_0x268f('0x9'));var _=require(_0x268f('0xa'));var squel=require(_0x268f('0xb'));var crypto=require(_0x268f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x268f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x268f('0xe'));var Papa=require(_0x268f('0xf'));var Redis=require(_0x268f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x268f('0x11'));var as=require(_0x268f('0x12'));var hardwareService=require(_0x268f('0x13'));var logger=require(_0x268f('0x14'))(_0x268f('0x15'));var utils=require(_0x268f('0x16'));var config=require(_0x268f('0x17'));var licenseUtil=require(_0x268f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaa,_0xec56b0){_0xec56b0=_0xec56b0||0xcc;return function(_0x302719){if(_0x302719){return _0x3eaa[_0x268f('0x19')](_0xec56b0);}return _0x3eaa[_0x268f('0x1a')](_0xec56b0)[_0x268f('0x1b')]();};}function respondWithResult(_0x13ceaa,_0x53e6fc){_0x53e6fc=_0x53e6fc||0xc8;return function(_0x59b19d){if(_0x59b19d){return _0x13ceaa[_0x268f('0x1a')](_0x53e6fc)['json'](_0x59b19d);}};}function respondWithFilteredResult(_0x4b0d02,_0x315d7d){return function(_0xd01f57){if(_0xd01f57){var _0x37a3a9=typeof _0x315d7d['offset']===_0x268f('0x1c')&&typeof _0x315d7d[_0x268f('0x1d')]===_0x268f('0x1c');var _0x59bb8e=_0xd01f57[_0x268f('0x1e')];var _0x1897b7=_0x37a3a9?0x0:_0x315d7d[_0x268f('0x1f')];var _0x79eae5=_0x37a3a9?_0xd01f57[_0x268f('0x1e')]:_0x315d7d[_0x268f('0x1f')]+_0x315d7d[_0x268f('0x1d')];var _0x41d2ff;if(_0x79eae5>=_0x59bb8e){_0x79eae5=_0x59bb8e;_0x41d2ff=0xc8;}else{_0x41d2ff=0xce;}_0x4b0d02['status'](_0x41d2ff);return _0x4b0d02[_0x268f('0x20')](_0x268f('0x21'),_0x1897b7+'-'+_0x79eae5+'/'+_0x59bb8e)['json'](_0xd01f57);}return null;};}function patchUpdates(_0x359044){return function(_0x4ecd27){try{jsonpatch[_0x268f('0x22')](_0x4ecd27,_0x359044,!![]);}catch(_0xd03ebe){return BPromise[_0x268f('0x23')](_0xd03ebe);}return _0x4ecd27[_0x268f('0x24')]();};}function saveUpdates(_0x4c3e59,_0x167ff4){return function(_0x1e472d){if(_0x1e472d){return _0x1e472d[_0x268f('0x25')](_0x4c3e59)[_0x268f('0x26')](function(_0x385093){return _0x385093;});}return null;};}function removeEntity(_0x4793a3,_0x3ea423){return function(_0x16fa7d){if(_0x16fa7d){return _0x16fa7d[_0x268f('0x27')]()[_0x268f('0x26')](function(){_0x4793a3[_0x268f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b51d9,_0x57d1f1){return function(_0x3875f6){if(!_0x3875f6){_0x3b51d9[_0x268f('0x19')](0x194);}return _0x3875f6;};}function handleError(_0x3cb9f1,_0xb08117){_0xb08117=_0xb08117||0x1f4;return function(_0x178d7e){logger['error'](_0x178d7e[_0x268f('0x28')]);if(_0x178d7e[_0x268f('0x29')]){delete _0x178d7e['name'];}_0x3cb9f1[_0x268f('0x1a')](_0xb08117)['send'](_0x178d7e);};}exports[_0x268f('0x2a')]=function(_0x4b3808,_0x5b6438){var _0xf455da={},_0x2e0b1e={},_0x59b081={'count':0x0,'rows':[]};var _0x3fd7cf=_[_0x268f('0x2b')](db[_0x268f('0x2c')][_0x268f('0x2d')],function(_0x4450ee){return{'name':_0x4450ee[_0x268f('0x2e')],'type':_0x4450ee[_0x268f('0x2f')][_0x268f('0x30')]};});_0x2e0b1e['model']=_['map'](_0x3fd7cf,'name');_0x2e0b1e[_0x268f('0x31')]=_[_0x268f('0x32')](_0x4b3808[_0x268f('0x31')]);_0x2e0b1e['filters']=_[_0x268f('0x33')](_0x2e0b1e['model'],_0x2e0b1e['query']);_0xf455da[_0x268f('0x34')]=_[_0x268f('0x33')](_0x2e0b1e[_0x268f('0x35')],qs[_0x268f('0x36')](_0x4b3808['query']['fields']));_0xf455da[_0x268f('0x34')]=_0xf455da[_0x268f('0x34')][_0x268f('0x37')]?_0xf455da[_0x268f('0x34')]:_0x2e0b1e[_0x268f('0x35')];if(!_0x4b3808[_0x268f('0x31')]['hasOwnProperty'](_0x268f('0x38'))){_0xf455da['limit']=qs[_0x268f('0x1d')](_0x4b3808[_0x268f('0x31')][_0x268f('0x1d')]);_0xf455da['offset']=qs['offset'](_0x4b3808[_0x268f('0x31')][_0x268f('0x1f')]);}_0xf455da['order']=qs[_0x268f('0x39')](_0x4b3808[_0x268f('0x31')][_0x268f('0x39')]);_0xf455da[_0x268f('0x3a')]=qs[_0x268f('0x3b')](_[_0x268f('0x3c')](_0x4b3808['query'],_0x2e0b1e['filters']),_0x3fd7cf);if(_0x4b3808['query'][_0x268f('0x3d')]){_0xf455da[_0x268f('0x3a')]=_[_0x268f('0x3e')](_0xf455da[_0x268f('0x3a')],{'$or':_[_0x268f('0x2b')](_0x3fd7cf,function(_0x4d9f8e){if(_0x4d9f8e[_0x268f('0x2f')]!==_0x268f('0x3f')){var _0x33f293={};_0x33f293[_0x4d9f8e[_0x268f('0x29')]]={'$like':'%'+_0x4b3808[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x33f293;}})});}_0xf455da=_[_0x268f('0x3e')]({},_0xf455da,_0x4b3808[_0x268f('0x40')]);var _0x4178e1={'where':_0xf455da['where']};return db['Automation']['count'](_0x4178e1)[_0x268f('0x26')](function(_0x3e0b17){_0x59b081[_0x268f('0x1e')]=_0x3e0b17;if(_0x4b3808[_0x268f('0x31')][_0x268f('0x41')]){_0xf455da[_0x268f('0x42')]=[{'all':!![]}];}return db[_0x268f('0x2c')][_0x268f('0x43')](_0xf455da);})[_0x268f('0x26')](function(_0x5b4c17){_0x59b081[_0x268f('0x44')]=_0x5b4c17;return _0x59b081;})[_0x268f('0x26')](respondWithFilteredResult(_0x5b6438,_0xf455da))[_0x268f('0x45')](handleError(_0x5b6438,null));};exports[_0x268f('0x46')]=function(_0x1ac90f,_0x710c72){var _0x7eb11f={'raw':![],'where':{'id':_0x1ac90f[_0x268f('0x47')]['id']}},_0x1728b5={};_0x1728b5[_0x268f('0x35')]=_['keys'](db[_0x268f('0x2c')][_0x268f('0x2d')]);_0x1728b5['query']=_['keys'](_0x1ac90f[_0x268f('0x31')]);_0x1728b5['filters']=_[_0x268f('0x33')](_0x1728b5[_0x268f('0x35')],_0x1728b5['query']);_0x7eb11f['attributes']=_[_0x268f('0x33')](_0x1728b5['model'],qs['fields'](_0x1ac90f['query'][_0x268f('0x36')]));_0x7eb11f['attributes']=_0x7eb11f[_0x268f('0x34')]['length']?_0x7eb11f[_0x268f('0x34')]:_0x1728b5[_0x268f('0x35')];if(_0x1ac90f[_0x268f('0x31')]['includeAll']){_0x7eb11f[_0x268f('0x42')]=[{'all':!![]}];}_0x7eb11f=_[_0x268f('0x3e')]({},_0x7eb11f,_0x1ac90f['options']);return db[_0x268f('0x2c')][_0x268f('0x48')](_0x7eb11f)[_0x268f('0x26')](handleEntityNotFound(_0x710c72,null))[_0x268f('0x26')](respondWithResult(_0x710c72,null))[_0x268f('0x45')](handleError(_0x710c72,null));};exports[_0x268f('0x49')]=function(_0x7cdf6b,_0x181dfb){return db[_0x268f('0x2c')][_0x268f('0x49')](_0x7cdf6b[_0x268f('0x4a')],{})[_0x268f('0x26')](respondWithResult(_0x181dfb,0xc9))['catch'](handleError(_0x181dfb,null));};exports[_0x268f('0x25')]=function(_0x3225b4,_0x4f8783){if(_0x3225b4[_0x268f('0x4a')]['id']){delete _0x3225b4[_0x268f('0x4a')]['id'];}return db[_0x268f('0x2c')][_0x268f('0x48')]({'where':{'id':_0x3225b4[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f8783,null))['then'](saveUpdates(_0x3225b4[_0x268f('0x4a')],null))[_0x268f('0x26')](respondWithResult(_0x4f8783,null))[_0x268f('0x45')](handleError(_0x4f8783,null));};exports[_0x268f('0x27')]=function(_0x4c7033,_0x53d857){return db['Automation'][_0x268f('0x48')]({'where':{'id':_0x4c7033[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x53d857,null))[_0x268f('0x26')](removeEntity(_0x53d857,null))[_0x268f('0x45')](handleError(_0x53d857,null));};exports[_0x268f('0x4b')]=function(_0x1a0494,_0x1fe275,_0x2b6c20){return db[_0x268f('0x4c')][_0x268f('0x48')]({'where':{'id':_0x1a0494[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fe275,null))['then'](function(_0x297849){if(_0x297849){return _0x297849[_0x268f('0x4b')](_0x1a0494[_0x268f('0x4a')][_0x268f('0x4d')],_['omit'](_0x1a0494[_0x268f('0x4a')],[_0x268f('0x4d'),'id'])||{});}})[_0x268f('0x26')](respondWithResult(_0x1fe275,null))[_0x268f('0x45')](handleError(_0x1fe275,null));};exports[_0x268f('0x4e')]=function(_0x1e0d85,_0x508727,_0x471986){var _0x518635={};var _0x30556a={};var _0x51fd49;var _0x44a8d7;return db['Automation'][_0x268f('0x4f')]({'where':{'id':_0x1e0d85[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x508727,null))[_0x268f('0x26')](function(_0x565e88){if(_0x565e88){_0x51fd49=_0x565e88;_0x30556a[_0x268f('0x35')]=_[_0x268f('0x32')](db['Condition'][_0x268f('0x2d')]);_0x30556a[_0x268f('0x31')]=_[_0x268f('0x32')](_0x1e0d85['query']);_0x30556a[_0x268f('0x3b')]=_[_0x268f('0x33')](_0x30556a['model'],_0x30556a[_0x268f('0x31')]);_0x518635[_0x268f('0x34')]=_[_0x268f('0x33')](_0x30556a[_0x268f('0x35')],qs[_0x268f('0x36')](_0x1e0d85[_0x268f('0x31')][_0x268f('0x36')]));_0x518635[_0x268f('0x34')]=_0x518635[_0x268f('0x34')][_0x268f('0x37')]?_0x518635[_0x268f('0x34')]:_0x30556a[_0x268f('0x35')];_0x518635[_0x268f('0x50')]=qs[_0x268f('0x39')](_0x1e0d85['query'][_0x268f('0x39')]);_0x518635['where']=qs[_0x268f('0x3b')](_[_0x268f('0x3c')](_0x1e0d85['query'],_0x30556a[_0x268f('0x3b')]));if(_0x1e0d85[_0x268f('0x31')][_0x268f('0x3d')]){_0x518635[_0x268f('0x3a')]=_['merge'](_0x518635['where'],{'$or':_['map'](_0x518635[_0x268f('0x34')],function(_0x17d146){var _0x3179c7={};_0x3179c7[_0x17d146]={'$like':'%'+_0x1e0d85[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x3179c7;})});}_0x518635=_['merge']({},_0x518635,_0x1e0d85[_0x268f('0x40')]);return _0x51fd49['getConditions'](_0x518635);}})[_0x268f('0x26')](function(_0x5c22ad){if(_0x5c22ad){_0x44a8d7=_0x5c22ad['length'];if(!_0x1e0d85['query'][_0x268f('0x51')](_0x268f('0x38'))){_0x518635[_0x268f('0x1d')]=qs[_0x268f('0x1d')](_0x1e0d85[_0x268f('0x31')][_0x268f('0x1d')]);_0x518635[_0x268f('0x1f')]=qs[_0x268f('0x1f')](_0x1e0d85['query']['offset']);}return _0x51fd49[_0x268f('0x4e')](_0x518635);}})['then'](function(_0x1ed14c){if(_0x1ed14c){return _0x1ed14c?{'count':_0x44a8d7,'rows':_0x1ed14c}:null;}})[_0x268f('0x26')](respondWithResult(_0x508727,null))[_0x268f('0x45')](handleError(_0x508727,null));};exports[_0x268f('0x52')]=function(_0x536adc,_0x542cae,_0x19858a){return db['Action'][_0x268f('0x48')]({'where':{'id':_0x536adc[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x542cae,null))['then'](function(_0x38e5bf){if(_0x38e5bf){return _0x38e5bf[_0x268f('0x52')](_0x536adc[_0x268f('0x4a')][_0x268f('0x4d')],_[_0x268f('0x53')](_0x536adc[_0x268f('0x4a')],[_0x268f('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x542cae,null))[_0x268f('0x45')](handleError(_0x542cae,null));};exports['getActions']=function(_0x34da6e,_0x480e31,_0x13af3c){var _0x1d6c0a={};var _0x4709de={};var _0x4748ba;var _0xb37e67;return db[_0x268f('0x2c')][_0x268f('0x4f')]({'where':{'id':_0x34da6e[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x480e31,null))[_0x268f('0x26')](function(_0x4aef8a){if(_0x4aef8a){_0x4748ba=_0x4aef8a;_0x4709de[_0x268f('0x35')]=_[_0x268f('0x32')](db[_0x268f('0x54')][_0x268f('0x2d')]);_0x4709de[_0x268f('0x31')]=_[_0x268f('0x32')](_0x34da6e[_0x268f('0x31')]);_0x4709de[_0x268f('0x3b')]=_['intersection'](_0x4709de[_0x268f('0x35')],_0x4709de[_0x268f('0x31')]);_0x1d6c0a['attributes']=_['intersection'](_0x4709de['model'],qs[_0x268f('0x36')](_0x34da6e['query']['fields']));_0x1d6c0a[_0x268f('0x34')]=_0x1d6c0a[_0x268f('0x34')][_0x268f('0x37')]?_0x1d6c0a['attributes']:_0x4709de[_0x268f('0x35')];_0x1d6c0a[_0x268f('0x50')]=qs[_0x268f('0x39')](_0x34da6e[_0x268f('0x31')]['sort']);_0x1d6c0a[_0x268f('0x3a')]=qs[_0x268f('0x3b')](_['pick'](_0x34da6e['query'],_0x4709de[_0x268f('0x3b')]));if(_0x34da6e[_0x268f('0x31')][_0x268f('0x3d')]){_0x1d6c0a['where']=_['merge'](_0x1d6c0a[_0x268f('0x3a')],{'$or':_['map'](_0x1d6c0a[_0x268f('0x34')],function(_0x2f0c5c){var _0x16609c={};_0x16609c[_0x2f0c5c]={'$like':'%'+_0x34da6e[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x16609c;})});}_0x1d6c0a=_[_0x268f('0x3e')]({},_0x1d6c0a,_0x34da6e[_0x268f('0x40')]);return _0x4748ba[_0x268f('0x55')](_0x1d6c0a);}})[_0x268f('0x26')](function(_0x439f8f){if(_0x439f8f){_0xb37e67=_0x439f8f[_0x268f('0x37')];if(!_0x34da6e[_0x268f('0x31')]['hasOwnProperty'](_0x268f('0x38'))){_0x1d6c0a[_0x268f('0x1d')]=qs[_0x268f('0x1d')](_0x34da6e[_0x268f('0x31')][_0x268f('0x1d')]);_0x1d6c0a[_0x268f('0x1f')]=qs[_0x268f('0x1f')](_0x34da6e['query'][_0x268f('0x1f')]);}return _0x4748ba[_0x268f('0x55')](_0x1d6c0a);}})['then'](function(_0x46c76f){if(_0x46c76f){return _0x46c76f?{'count':_0xb37e67,'rows':_0x46c76f}:null;}})[_0x268f('0x26')](respondWithResult(_0x480e31,null))[_0x268f('0x45')](handleError(_0x480e31,null));}; \ No newline at end of file +var _0x9fb1=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Automation','includeAll','findAll','rows','show','params','keys','include','catch','create','update','body','find','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0x9fb1,0x1e6));var _0x19fb=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9fb1[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x19fb('0x0'));var rimraf=require(_0x19fb('0x1'));var zipdir=require(_0x19fb('0x2'));var jsonpatch=require(_0x19fb('0x3'));var rp=require(_0x19fb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19fb('0x5'));var util=require('util');var path=require(_0x19fb('0x6'));var sox=require(_0x19fb('0x7'));var csv=require(_0x19fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19fb('0x9'));var _=require('lodash');var squel=require(_0x19fb('0xa'));var crypto=require(_0x19fb('0xb'));var jsforce=require(_0x19fb('0xc'));var deskjs=require(_0x19fb('0xd'));var toCsv=require(_0x19fb('0x8'));var querystring=require('querystring');var Papa=require(_0x19fb('0xe'));var Redis=require(_0x19fb('0xf'));var authService=require(_0x19fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x19fb('0x11'));var hardwareService=require(_0x19fb('0x12'));var logger=require(_0x19fb('0x13'))(_0x19fb('0x14'));var utils=require(_0x19fb('0x15'));var config=require(_0x19fb('0x16'));var licenseUtil=require(_0x19fb('0x17'));var db=require(_0x19fb('0x18'))['db'];function respondWithStatusCode(_0x39ed49,_0x1fe4b4){_0x1fe4b4=_0x1fe4b4||0xcc;return function(_0x41188a){if(_0x41188a){return _0x39ed49[_0x19fb('0x19')](_0x1fe4b4);}return _0x39ed49[_0x19fb('0x1a')](_0x1fe4b4)[_0x19fb('0x1b')]();};}function respondWithResult(_0x3c627d,_0x8dc8de){_0x8dc8de=_0x8dc8de||0xc8;return function(_0x9de498){if(_0x9de498){return _0x3c627d[_0x19fb('0x1a')](_0x8dc8de)['json'](_0x9de498);}};}function respondWithFilteredResult(_0x4db650,_0xa476f0){return function(_0x10f11e){if(_0x10f11e){var _0x2d2e9c=typeof _0xa476f0[_0x19fb('0x1c')]===_0x19fb('0x1d')&&typeof _0xa476f0[_0x19fb('0x1e')]===_0x19fb('0x1d');var _0x317ccd=_0x10f11e[_0x19fb('0x1f')];var _0x41c719=_0x2d2e9c?0x0:_0xa476f0[_0x19fb('0x1c')];var _0x2d9f11=_0x2d2e9c?_0x10f11e[_0x19fb('0x1f')]:_0xa476f0['offset']+_0xa476f0['limit'];var _0x47266f;if(_0x2d9f11>=_0x317ccd){_0x2d9f11=_0x317ccd;_0x47266f=0xc8;}else{_0x47266f=0xce;}_0x4db650[_0x19fb('0x1a')](_0x47266f);return _0x4db650['set'](_0x19fb('0x20'),_0x41c719+'-'+_0x2d9f11+'/'+_0x317ccd)['json'](_0x10f11e);}return null;};}function patchUpdates(_0x491cd3){return function(_0x20d991){try{jsonpatch[_0x19fb('0x21')](_0x20d991,_0x491cd3,!![]);}catch(_0x3a1bf2){return BPromise[_0x19fb('0x22')](_0x3a1bf2);}return _0x20d991[_0x19fb('0x23')]();};}function saveUpdates(_0x2fc541,_0x231d4d){return function(_0x3737dd){if(_0x3737dd){return _0x3737dd['update'](_0x2fc541)[_0x19fb('0x24')](function(_0x9dc3){return _0x9dc3;});}return null;};}function removeEntity(_0xfd2fd1,_0x288790){return function(_0x364698){if(_0x364698){return _0x364698[_0x19fb('0x25')]()[_0x19fb('0x24')](function(){_0xfd2fd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xea3758,_0x3fe81c){return function(_0x410c44){if(!_0x410c44){_0xea3758[_0x19fb('0x19')](0x194);}return _0x410c44;};}function handleError(_0x8e3a9b,_0x3e9dff){_0x3e9dff=_0x3e9dff||0x1f4;return function(_0x2d9373){logger['error'](_0x2d9373['stack']);if(_0x2d9373[_0x19fb('0x26')]){delete _0x2d9373[_0x19fb('0x26')];}_0x8e3a9b['status'](_0x3e9dff)['send'](_0x2d9373);};}exports['index']=function(_0x3871c5,_0x50014a){var _0x184741={},_0x1b1e68={},_0x13c556={'count':0x0,'rows':[]};var _0x92f700=_[_0x19fb('0x27')](db['Automation'][_0x19fb('0x28')],function(_0xd4bcf3){return{'name':_0xd4bcf3[_0x19fb('0x29')],'type':_0xd4bcf3['type'][_0x19fb('0x2a')]};});_0x1b1e68[_0x19fb('0x2b')]=_[_0x19fb('0x27')](_0x92f700,'name');_0x1b1e68[_0x19fb('0x2c')]=_['keys'](_0x3871c5[_0x19fb('0x2c')]);_0x1b1e68[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x1b1e68[_0x19fb('0x2b')],_0x1b1e68[_0x19fb('0x2c')]);_0x184741['attributes']=_['intersection'](_0x1b1e68[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x184741[_0x19fb('0x30')]=_0x184741[_0x19fb('0x30')][_0x19fb('0x31')]?_0x184741[_0x19fb('0x30')]:_0x1b1e68['model'];if(!_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x32')]('nolimit')){_0x184741[_0x19fb('0x1e')]=qs[_0x19fb('0x1e')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x184741[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1c')]);}_0x184741[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x184741[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x3871c5[_0x19fb('0x2c')],_0x1b1e68['filters']),_0x92f700);if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x184741[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x184741[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x92f700,function(_0x4b60c2){if(_0x4b60c2[_0x19fb('0x39')]!==_0x19fb('0x3a')){var _0x471b26={};_0x471b26[_0x4b60c2[_0x19fb('0x26')]]={'$like':'%'+_0x3871c5[_0x19fb('0x2c')]['filter']+'%'};return _0x471b26;}})});}_0x184741=_[_0x19fb('0x38')]({},_0x184741,_0x3871c5[_0x19fb('0x3b')]);var _0x18e493={'where':_0x184741[_0x19fb('0x35')]};return db[_0x19fb('0x3c')][_0x19fb('0x1f')](_0x18e493)['then'](function(_0x28fbe5){_0x13c556[_0x19fb('0x1f')]=_0x28fbe5;if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x184741['include']=[{'all':!![]}];}return db['Automation'][_0x19fb('0x3e')](_0x184741);})[_0x19fb('0x24')](function(_0x402473){_0x13c556[_0x19fb('0x3f')]=_0x402473;return _0x13c556;})[_0x19fb('0x24')](respondWithFilteredResult(_0x50014a,_0x184741))['catch'](handleError(_0x50014a,null));};exports[_0x19fb('0x40')]=function(_0x2b4f3d,_0x5d946a){var _0x222b4b={'raw':![],'where':{'id':_0x2b4f3d[_0x19fb('0x41')]['id']}},_0x5becee={};_0x5becee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x3c')][_0x19fb('0x28')]);_0x5becee[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x2b4f3d[_0x19fb('0x2c')]);_0x5becee[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],_0x5becee[_0x19fb('0x2c')]);_0x222b4b[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x2b4f3d['query'][_0x19fb('0x2f')]));_0x222b4b[_0x19fb('0x30')]=_0x222b4b[_0x19fb('0x30')]['length']?_0x222b4b['attributes']:_0x5becee[_0x19fb('0x2b')];if(_0x2b4f3d[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x222b4b[_0x19fb('0x43')]=[{'all':!![]}];}_0x222b4b=_[_0x19fb('0x38')]({},_0x222b4b,_0x2b4f3d['options']);return db[_0x19fb('0x3c')]['find'](_0x222b4b)[_0x19fb('0x24')](handleEntityNotFound(_0x5d946a,null))[_0x19fb('0x24')](respondWithResult(_0x5d946a,null))[_0x19fb('0x44')](handleError(_0x5d946a,null));};exports[_0x19fb('0x45')]=function(_0xaeee6,_0x2ff938){return db[_0x19fb('0x3c')][_0x19fb('0x45')](_0xaeee6['body'],{})[_0x19fb('0x24')](respondWithResult(_0x2ff938,0xc9))[_0x19fb('0x44')](handleError(_0x2ff938,null));};exports[_0x19fb('0x46')]=function(_0xc65755,_0x109e07){if(_0xc65755[_0x19fb('0x47')]['id']){delete _0xc65755[_0x19fb('0x47')]['id'];}return db[_0x19fb('0x3c')][_0x19fb('0x48')]({'where':{'id':_0xc65755['params']['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x109e07,null))['then'](saveUpdates(_0xc65755[_0x19fb('0x47')],null))['then'](respondWithResult(_0x109e07,null))['catch'](handleError(_0x109e07,null));};exports[_0x19fb('0x25')]=function(_0x22bdb4,_0x335a64){return db['Automation'][_0x19fb('0x48')]({'where':{'id':_0x22bdb4[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x335a64,null))[_0x19fb('0x24')](removeEntity(_0x335a64,null))['catch'](handleError(_0x335a64,null));};exports[_0x19fb('0x49')]=function(_0x33adb2,_0x47bb07,_0x2e1791){return db[_0x19fb('0x4a')]['find']({'where':{'id':_0x33adb2['params']['id']}})['then'](handleEntityNotFound(_0x47bb07,null))[_0x19fb('0x24')](function(_0xa05b4e){if(_0xa05b4e){return _0xa05b4e[_0x19fb('0x49')](_0x33adb2[_0x19fb('0x47')][_0x19fb('0x4b')],_[_0x19fb('0x4c')](_0x33adb2[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x47bb07,null))[_0x19fb('0x44')](handleError(_0x47bb07,null));};exports[_0x19fb('0x4d')]=function(_0x343f69,_0x397f13,_0x439524){var _0x4736c8={};var _0x39c152={};var _0x4111e2;var _0x186164;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x343f69[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x397f13,null))['then'](function(_0x586dd8){if(_0x586dd8){_0x4111e2=_0x586dd8;_0x39c152[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x4a')][_0x19fb('0x28')]);_0x39c152[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x343f69[_0x19fb('0x2c')]);_0x39c152[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],_0x39c152[_0x19fb('0x2c')]);_0x4736c8[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x4736c8[_0x19fb('0x30')]=_0x4736c8[_0x19fb('0x30')][_0x19fb('0x31')]?_0x4736c8[_0x19fb('0x30')]:_0x39c152[_0x19fb('0x2b')];_0x4736c8[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x4736c8[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x343f69[_0x19fb('0x2c')],_0x39c152[_0x19fb('0x2d')]));if(_0x343f69['query']['filter']){_0x4736c8[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x4736c8[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x4736c8[_0x19fb('0x30')],function(_0x1810fd){var _0x2221d2={};_0x2221d2[_0x1810fd]={'$like':'%'+_0x343f69['query']['filter']+'%'};return _0x2221d2;})});}_0x4736c8=_['merge']({},_0x4736c8,_0x343f69[_0x19fb('0x3b')]);return _0x4111e2['getConditions'](_0x4736c8);}})[_0x19fb('0x24')](function(_0x36ec66){if(_0x36ec66){_0x186164=_0x36ec66[_0x19fb('0x31')];if(!_0x343f69[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x4736c8['limit']=qs['limit'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x4736c8[_0x19fb('0x1c')]=qs['offset'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x4111e2[_0x19fb('0x4d')](_0x4736c8);}})[_0x19fb('0x24')](function(_0x42e115){if(_0x42e115){return _0x42e115?{'count':_0x186164,'rows':_0x42e115}:null;}})[_0x19fb('0x24')](respondWithResult(_0x397f13,null))[_0x19fb('0x44')](handleError(_0x397f13,null));};exports['addActions']=function(_0x16387c,_0x550b6c,_0xaf0ac7){return db[_0x19fb('0x50')]['find']({'where':{'id':_0x16387c[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x550b6c,null))['then'](function(_0x4fb6cb){if(_0x4fb6cb){return _0x4fb6cb[_0x19fb('0x51')](_0x16387c['body'][_0x19fb('0x4b')],_['omit'](_0x16387c[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x550b6c,null))[_0x19fb('0x44')](handleError(_0x550b6c,null));};exports[_0x19fb('0x52')]=function(_0x5563b1,_0x4e0350,_0x1e155c){var _0x3f0a3b={};var _0x49f0ee={};var _0x8d460a;var _0x281c8c;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x5563b1[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e0350,null))[_0x19fb('0x24')](function(_0x424aae){if(_0x424aae){_0x8d460a=_0x424aae;_0x49f0ee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x50')][_0x19fb('0x28')]);_0x49f0ee[_0x19fb('0x2c')]=_['keys'](_0x5563b1[_0x19fb('0x2c')]);_0x49f0ee['filters']=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],_0x49f0ee[_0x19fb('0x2c')]);_0x3f0a3b[_0x19fb('0x30')]=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],qs['fields'](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x3f0a3b[_0x19fb('0x30')]=_0x3f0a3b[_0x19fb('0x30')][_0x19fb('0x31')]?_0x3f0a3b[_0x19fb('0x30')]:_0x49f0ee[_0x19fb('0x2b')];_0x3f0a3b[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x3f0a3b[_0x19fb('0x35')]=qs['filters'](_['pick'](_0x5563b1[_0x19fb('0x2c')],_0x49f0ee[_0x19fb('0x2d')]));if(_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x3f0a3b[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x3f0a3b[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x3f0a3b[_0x19fb('0x30')],function(_0x510f6c){var _0x29cf26={};_0x29cf26[_0x510f6c]={'$like':'%'+_0x5563b1['query'][_0x19fb('0x37')]+'%'};return _0x29cf26;})});}_0x3f0a3b=_[_0x19fb('0x38')]({},_0x3f0a3b,_0x5563b1[_0x19fb('0x3b')]);return _0x8d460a[_0x19fb('0x52')](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x50dd79){if(_0x50dd79){_0x281c8c=_0x50dd79[_0x19fb('0x31')];if(!_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x3f0a3b['limit']=qs[_0x19fb('0x1e')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x3f0a3b[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x8d460a['getActions'](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x791811){if(_0x791811){return _0x791811?{'count':_0x281c8c,'rows':_0x791811}:null;}})[_0x19fb('0x24')](respondWithResult(_0x4e0350,null))['catch'](handleError(_0x4e0350,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0c38671..bfb4c7f 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 _0xaf36=['exports','define','Automation','tools_automations','moment','request-promise','path','./automation.attributes'];(function(_0x1eab4a,_0x1aebee){var _0x10b991=function(_0x416dba){while(--_0x416dba){_0x1eab4a['push'](_0x1eab4a['shift']());}};_0x10b991(++_0x1aebee);}(_0xaf36,0xb4));var _0x6af3=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xaf36[_0x127a60];return _0xc1f6a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6af3('0x0'));var BPromise=require('bluebird');var rp=require(_0x6af3('0x1'));var fs=require('fs');var path=require(_0x6af3('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6af3('0x3'));module[_0x6af3('0x4')]=function(_0x4ac981,_0x23d387){return _0x4ac981[_0x6af3('0x5')](_0x6af3('0x6'),attributes,{'tableName':_0x6af3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90d0=['rimraf','../../config/environment','./automation.attributes','exports','Automation','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45df3d,_0x3be0d8){var _0x33f6bd=function(_0x21b6af){while(--_0x21b6af){_0x45df3d['push'](_0x45df3d['shift']());}};_0x33f6bd(++_0x3be0d8);}(_0x90d0,0x73));var _0x090d=function(_0x2545d0,_0x397e79){_0x2545d0=_0x2545d0-0x0;var _0x10111b=_0x90d0[_0x2545d0];return _0x10111b;};'use strict';var _=require(_0x090d('0x0'));var util=require(_0x090d('0x1'));var logger=require(_0x090d('0x2'))(_0x090d('0x3'));var moment=require(_0x090d('0x4'));var BPromise=require(_0x090d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x090d('0x6'));var config=require(_0x090d('0x7'));var attributes=require(_0x090d('0x8'));module[_0x090d('0x9')]=function(_0x3be0f9,_0x3e4912){return _0x3be0f9['define'](_0x090d('0xa'),attributes,{'tableName':'tools_automations','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 84bb1a4..4d3bfb3 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 _0x2f56=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1e55d9,_0x5ce14a){var _0x6dc799=function(_0x383e7b){while(--_0x383e7b){_0x1e55d9['push'](_0x1e55d9['shift']());}};_0x6dc799(++_0x5ce14a);}(_0x2f56,0xb5));var _0x62f5=function(_0x40d8f2,_0x303920){_0x40d8f2=_0x40d8f2-0x0;var _0x32d122=_0x2f56[_0x40d8f2];return _0x32d122;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387150,_0x58ae99,_0x3ee814){return new BPromise(function(_0xc11beb,_0x505bfd){return client[_0x62f5('0xc')](_0x387150,_0x3ee814)[_0x62f5('0xd')](function(_0x4a3621){logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x58ae99,_0x62f5('0x10'),JSON[_0x62f5('0x11')](_0x4a3621));if(_0x4a3621[_0x62f5('0x12')]){if(_0x4a3621[_0x62f5('0x12')][_0x62f5('0x13')]===0x1f4){logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621['error'][_0x62f5('0x14')]);return _0x505bfd(_0x4a3621['error'][_0x62f5('0x14')]);}logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621[_0x62f5('0x12')]['message']);return _0xc11beb(_0x4a3621[_0x62f5('0x12')]['message']);}else{logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));_0xc11beb(_0x4a3621[_0x62f5('0x15')][_0x62f5('0x14')]);}})[_0x62f5('0x16')](function(_0x2756cb){logger[_0x62f5('0x12')]('Automation,\x20%s,\x20%s',_0x58ae99,_0x2756cb);_0x505bfd(_0x2756cb);});});} \ No newline at end of file +var _0xa03c=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5015cc,_0x35eb6b){var _0xa4fd74=function(_0x3d4cfe){while(--_0x3d4cfe){_0x5015cc['push'](_0x5015cc['shift']());}};_0xa4fd74(++_0x35eb6b);}(_0xa03c,0x94));var _0xca03=function(_0x1965df,_0x275b26){_0x1965df=_0x1965df-0x0;var _0x4a5ed6=_0xa03c[_0x1965df];return _0x4a5ed6;};'use strict';var _=require(_0xca03('0x0'));var util=require('util');var moment=require(_0xca03('0x1'));var BPromise=require(_0xca03('0x2'));var rs=require(_0xca03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca03('0x4'))['db'];var utils=require(_0xca03('0x5'));var logger=require(_0xca03('0x6'))('rpc');var config=require(_0xca03('0x7'));var jayson=require(_0xca03('0x8'));var client=jayson[_0xca03('0x9')][_0xca03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27aac6,_0x9d2b3d,_0x52f12e){return new BPromise(function(_0x1832cc,_0x18ddee){return client[_0xca03('0xb')](_0x27aac6,_0x52f12e)[_0xca03('0xc')](function(_0x31e7be){logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));logger[_0xca03('0x10')](_0xca03('0x11'),_0x9d2b3d,'request\x20sent',JSON[_0xca03('0x12')](_0x31e7be));if(_0x31e7be[_0xca03('0x13')]){if(_0x31e7be[_0xca03('0x13')][_0xca03('0x14')]===0x1f4){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x18ddee(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x1832cc(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}else{logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));_0x1832cc(_0x31e7be['result'][_0xca03('0x15')]);}})[_0xca03('0x16')](function(_0x184313){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x184313);_0x18ddee(_0x184313);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 755f971..2cacc5b 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 _0xbe27=['get','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index'];(function(_0x33418c,_0x342219){var _0x1d2264=function(_0x379fed){while(--_0x379fed){_0x33418c['push'](_0x33418c['shift']());}};_0x1d2264(++_0x342219);}(_0xbe27,0x12d));var _0x7be2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xbe27[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x7be2('0x0'));var path=require(_0x7be2('0x1'));var timeout=require('connect-timeout');var express=require(_0x7be2('0x2'));var router=express[_0x7be2('0x3')]();var fs_extra=require(_0x7be2('0x4'));var auth=require(_0x7be2('0x5'));var interaction=require(_0x7be2('0x6'));var config=require(_0x7be2('0x7'));var controller=require(_0x7be2('0x8'));router['get']('/',auth[_0x7be2('0x9')](),controller[_0x7be2('0xa')]);router[_0x7be2('0xb')]('/:id',auth[_0x7be2('0x9')](),controller[_0x7be2('0xc')]);router['get'](_0x7be2('0xd'),auth[_0x7be2('0x9')](),controller[_0x7be2('0xe')]);router[_0x7be2('0xb')](_0x7be2('0xf'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7be2('0x11')](_0x7be2('0xd'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x12')]);router['post'](_0x7be2('0xf'),auth['isAuthenticated'](),controller[_0x7be2('0x13')]);router[_0x7be2('0x14')](_0x7be2('0x15'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x16')]);router[_0x7be2('0x17')](_0x7be2('0x15'),auth['isAuthenticated'](),controller[_0x7be2('0x18')]);module[_0x7be2('0x19')]=router; \ No newline at end of file +var _0x4a99=['./automation.controller','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','get','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x287428,_0x5a62c2){var _0x5169c2=function(_0x5c4aee){while(--_0x5c4aee){_0x287428['push'](_0x287428['shift']());}};_0x5169c2(++_0x5a62c2);}(_0x4a99,0x1aa));var _0x94a9=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x4a99[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x94a9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x94a9('0x1'));var express=require(_0x94a9('0x2'));var router=express['Router']();var fs_extra=require(_0x94a9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x94a9('0x4'));var config=require(_0x94a9('0x5'));var controller=require(_0x94a9('0x6'));router['get']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x8')]);router['get'](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xa')]);router['get'](_0x94a9('0xb'),auth['isAuthenticated'](),controller[_0x94a9('0xc')]);router[_0x94a9('0xd')](_0x94a9('0xe'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xf')]);router['post']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x10')]);router[_0x94a9('0x11')](_0x94a9('0xb'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x12')]);router[_0x94a9('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x94a9('0x13')]);router[_0x94a9('0x14')](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x15')]);router[_0x94a9('0x16')](_0x94a9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x94a9('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 663dc2e..32cf218 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 _0x2b65=['ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x10f2d6,_0x2813e2){var _0x54eebb=function(_0x25dbb2){while(--_0x25dbb2){_0x10f2d6['push'](_0x10f2d6['shift']());}};_0x54eebb(++_0x2813e2);}(_0x2b65,0xc3));var _0x52b6=function(_0x334570,_0x23d405){_0x334570=_0x334570-0x0;var _0x45c6dc=_0x2b65[_0x334570];return _0x45c6dc;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'name':{'type':Sequelize[_0x52b6('0x2')],'unique':_0x52b6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x52b6('0x4')](_0x52b6('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x52b6('0x2')]},'active':{'type':Sequelize[_0x52b6('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x52b6('0x7')](0x4)[_0x52b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x52b6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'comment':_0x52b6('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x52b6('0xf')},'dialTimezone':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':_0x52b6('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x52b6('0x4')](_0x52b6('0x11'),_0x52b6('0x12'),_0x52b6('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x52b6('0x6')],'defaultValue':0x0,'comment':_0x52b6('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x52b6('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x52b6('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x52b6('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x52b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52b6('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x52b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x52b6('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x52b6('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x52b6('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x52b6('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x52b6('0x1d'),_0x52b6('0x1e')),'defaultValue':_0x52b6('0x1d')},'dialPrefix':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52b6('0x1f')},'dialCutDigit':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52b6('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x22')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x25')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x27')}}; \ No newline at end of file +var _0x03e5=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','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)'];(function(_0x4a7977,_0x4b0931){var _0x3c8a0d=function(_0x2c3977){while(--_0x2c3977){_0x4a7977['push'](_0x4a7977['shift']());}};_0x3c8a0d(++_0x4b0931);}(_0x03e5,0x64));var _0x503e=function(_0x5da55f,_0x2428f7){_0x5da55f=_0x5da55f-0x0;var _0x13c392=_0x03e5[_0x5da55f];return _0x13c392;};'use strict';var Sequelize=require(_0x503e('0x0'));module['exports']={'name':{'type':Sequelize[_0x503e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x3')),'allowNull':![],'defaultValue':_0x503e('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x5')},'limitCalls':{'type':Sequelize[_0x503e('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x503e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'comment':_0x503e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x503e('0xf')},'dialTimezone':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x503e('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x11'),_0x503e('0x12'),'onlyIfOpen'),'defaultValue':_0x503e('0x11')},'dialAMDActive':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x503e('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x503e('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x503e('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x503e('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x503e('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x503e('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x503e('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x503e('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x503e('0x2')]('DESC',_0x503e('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 42e5218..4fa0aca 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 _0xb57d=['index','map','Campaign','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','name','send'];(function(_0xce014b,_0x2c69f4){var _0x1a7d81=function(_0x51b2bb){while(--_0x51b2bb){_0xce014b['push'](_0xce014b['shift']());}};_0x1a7d81(++_0x2c69f4);}(_0xb57d,0x18d));var _0xdb57=function(_0x55b7b0,_0x2df366){_0x55b7b0=_0x55b7b0-0x0;var _0x231f56=_0xb57d[_0x55b7b0];return _0x231f56;};'use strict';var emlformat=require(_0xdb57('0x0'));var rimraf=require(_0xdb57('0x1'));var zipdir=require(_0xdb57('0x2'));var jsonpatch=require(_0xdb57('0x3'));var rp=require(_0xdb57('0x4'));var moment=require('moment');var BPromise=require(_0xdb57('0x5'));var Mustache=require(_0xdb57('0x6'));var util=require(_0xdb57('0x7'));var path=require(_0xdb57('0x8'));var sox=require('sox');var csv=require(_0xdb57('0x9'));var ejs=require(_0xdb57('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb57('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb57('0xc'));var deskjs=require(_0xdb57('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb57('0xe'));var Redis=require(_0xdb57('0xf'));var authService=require(_0xdb57('0x10'));var qs=require(_0xdb57('0x11'));var as=require(_0xdb57('0x12'));var hardwareService=require(_0xdb57('0x13'));var logger=require('../../config/logger')(_0xdb57('0x14'));var utils=require('../../config/utils');var config=require(_0xdb57('0x15'));var licenseUtil=require(_0xdb57('0x16'));var db=require(_0xdb57('0x17'))['db'];function respondWithStatusCode(_0x1f83a7,_0x52fcf9){_0x52fcf9=_0x52fcf9||0xcc;return function(_0x5c8870){if(_0x5c8870){return _0x1f83a7[_0xdb57('0x18')](_0x52fcf9);}return _0x1f83a7[_0xdb57('0x19')](_0x52fcf9)[_0xdb57('0x1a')]();};}function respondWithResult(_0x5f311a,_0x201fde){_0x201fde=_0x201fde||0xc8;return function(_0x25a660){if(_0x25a660){return _0x5f311a[_0xdb57('0x19')](_0x201fde)[_0xdb57('0x1b')](_0x25a660);}};}function respondWithFilteredResult(_0x3c5178,_0x4fae19){return function(_0x42924f){if(_0x42924f){var _0x42f86a=typeof _0x4fae19[_0xdb57('0x1c')]===_0xdb57('0x1d')&&typeof _0x4fae19['limit']===_0xdb57('0x1d');var _0x54e7b4=_0x42924f[_0xdb57('0x1e')];var _0x14b4f0=_0x42f86a?0x0:_0x4fae19[_0xdb57('0x1c')];var _0x3858b2=_0x42f86a?_0x42924f['count']:_0x4fae19[_0xdb57('0x1c')]+_0x4fae19[_0xdb57('0x1f')];var _0x2df673;if(_0x3858b2>=_0x54e7b4){_0x3858b2=_0x54e7b4;_0x2df673=0xc8;}else{_0x2df673=0xce;}_0x3c5178['status'](_0x2df673);return _0x3c5178['set'](_0xdb57('0x20'),_0x14b4f0+'-'+_0x3858b2+'/'+_0x54e7b4)[_0xdb57('0x1b')](_0x42924f);}return null;};}function patchUpdates(_0x4ee3af){return function(_0x48b941){try{jsonpatch[_0xdb57('0x21')](_0x48b941,_0x4ee3af,!![]);}catch(_0x579614){return BPromise[_0xdb57('0x22')](_0x579614);}return _0x48b941[_0xdb57('0x23')]();};}function saveUpdates(_0x416fc6,_0x582607){return function(_0x1f4c0d){if(_0x1f4c0d){return _0x1f4c0d[_0xdb57('0x24')](_0x416fc6)[_0xdb57('0x25')](function(_0x43841f){return _0x43841f;});}return null;};}function removeEntity(_0x3a1755,_0x436f76){return function(_0x141768){if(_0x141768){return _0x141768[_0xdb57('0x26')]()[_0xdb57('0x25')](function(){var _0x55e28a=_0x141768['get']({'plain':!![]});var _0x528ac8=_0xdb57('0x27');return db[_0xdb57('0x28')]['destroy']({'where':{'type':_0x528ac8,'resourceId':_0x55e28a['id']}})[_0xdb57('0x25')](function(){return _0x141768;});})[_0xdb57('0x25')](function(){_0x3a1755[_0xdb57('0x19')](0xcc)[_0xdb57('0x1a')]();});}};}function handleEntityNotFound(_0x38216c,_0x53fba1){return function(_0x3c9d8f){if(!_0x3c9d8f){_0x38216c[_0xdb57('0x18')](0x194);}return _0x3c9d8f;};}function handleError(_0x2185b9,_0x2a9311){_0x2a9311=_0x2a9311||0x1f4;return function(_0x51d0f0){logger[_0xdb57('0x29')](_0x51d0f0['stack']);if(_0x51d0f0[_0xdb57('0x2a')]){delete _0x51d0f0['name'];}_0x2185b9[_0xdb57('0x19')](_0x2a9311)[_0xdb57('0x2b')](_0x51d0f0);};}exports[_0xdb57('0x2c')]=function(_0x445a78,_0x2aee4f){var _0x1c1895={},_0x563ed9={},_0x17af2c={'count':0x0,'rows':[]};var _0x30817e=_[_0xdb57('0x2d')](db[_0xdb57('0x2e')][_0xdb57('0x2f')],function(_0x185499){return{'name':_0x185499['fieldName'],'type':_0x185499[_0xdb57('0x30')][_0xdb57('0x31')]};});_0x563ed9[_0xdb57('0x32')]=_[_0xdb57('0x2d')](_0x30817e,_0xdb57('0x2a'));_0x563ed9['query']=_[_0xdb57('0x33')](_0x445a78[_0xdb57('0x34')]);_0x563ed9['filters']=_[_0xdb57('0x35')](_0x563ed9[_0xdb57('0x32')],_0x563ed9[_0xdb57('0x34')]);_0x1c1895[_0xdb57('0x36')]=_['intersection'](_0x563ed9[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x37')]));_0x1c1895[_0xdb57('0x36')]=_0x1c1895[_0xdb57('0x36')][_0xdb57('0x38')]?_0x1c1895[_0xdb57('0x36')]:_0x563ed9['model'];if(!_0x445a78['query'][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x1c1895[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x1c1895[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x1c1895[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x1c1895[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0x445a78['query'],_0x563ed9[_0xdb57('0x3e')]),_0x30817e);if(_0x445a78[_0xdb57('0x34')]['filter']){_0x1c1895[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x1c1895[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x30817e,function(_0x409397){if(_0x409397['type']!==_0xdb57('0x40')){var _0x155d4c={};_0x155d4c[_0x409397[_0xdb57('0x2a')]]={'$like':'%'+_0x445a78[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x155d4c;}})});}_0x1c1895=_[_0xdb57('0x3f')]({},_0x1c1895,_0x445a78['options']);var _0x453be5={'where':_0x1c1895[_0xdb57('0x3d')]};return db[_0xdb57('0x2e')]['count'](_0x453be5)[_0xdb57('0x25')](function(_0x4bbf26){_0x17af2c[_0xdb57('0x1e')]=_0x4bbf26;if(_0x445a78[_0xdb57('0x34')][_0xdb57('0x42')]){_0x1c1895[_0xdb57('0x43')]=[{'all':!![]}];}return db[_0xdb57('0x2e')][_0xdb57('0x44')](_0x1c1895);})[_0xdb57('0x25')](function(_0x3889d3){_0x17af2c['rows']=_0x3889d3;return _0x17af2c;})[_0xdb57('0x25')](respondWithFilteredResult(_0x2aee4f,_0x1c1895))['catch'](handleError(_0x2aee4f,null));};exports[_0xdb57('0x45')]=function(_0x3632f4,_0x307914){var _0x93b61a={'raw':![],'where':{'id':_0x3632f4[_0xdb57('0x46')]['id']}},_0x32f7fa={};_0x32f7fa[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x2e')][_0xdb57('0x2f')]);_0x32f7fa[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x3632f4[_0xdb57('0x34')]);_0x32f7fa['filters']=_[_0xdb57('0x35')](_0x32f7fa['model'],_0x32f7fa[_0xdb57('0x34')]);_0x93b61a[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x32f7fa[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x3632f4[_0xdb57('0x34')][_0xdb57('0x37')]));_0x93b61a[_0xdb57('0x36')]=_0x93b61a[_0xdb57('0x36')]['length']?_0x93b61a['attributes']:_0x32f7fa[_0xdb57('0x32')];if(_0x3632f4['query']['includeAll']){_0x93b61a[_0xdb57('0x43')]=[{'all':!![]}];}_0x93b61a=_[_0xdb57('0x3f')]({},_0x93b61a,_0x3632f4[_0xdb57('0x47')]);return db[_0xdb57('0x2e')][_0xdb57('0x48')](_0x93b61a)[_0xdb57('0x25')](handleEntityNotFound(_0x307914,null))['then'](respondWithResult(_0x307914,null))['catch'](handleError(_0x307914,null));};exports[_0xdb57('0x49')]=function(_0x45a990,_0x5f3653){return db[_0xdb57('0x2e')][_0xdb57('0x49')](_0x45a990[_0xdb57('0x4a')],{})[_0xdb57('0x25')](function(_0x1c2df0){var _0xdd5329=_0x45a990[_0xdb57('0x4b')][_0xdb57('0x4c')]({'plain':!![]});if(!_0xdd5329)throw new Error(_0xdb57('0x4d'));if(_0xdd5329[_0xdb57('0x4e')]===_0xdb57('0x4b')){var _0x230d68=_0x1c2df0[_0xdb57('0x4c')]({'plain':!![]});var _0x78202b='IvrCampaigns';return db[_0xdb57('0x4f')][_0xdb57('0x48')]({'where':{'name':_0x78202b,'userProfileId':_0xdd5329['userProfileId']},'raw':!![]})[_0xdb57('0x25')](function(_0x196be2){if(_0x196be2&&_0x196be2[_0xdb57('0x50')]===0x0){return db[_0xdb57('0x28')][_0xdb57('0x49')]({'name':_0x230d68[_0xdb57('0x2a')],'resourceId':_0x230d68['id'],'type':_0x196be2[_0xdb57('0x2a')],'sectionId':_0x196be2['id']},{})[_0xdb57('0x25')](function(){return _0x1c2df0;});}else{return _0x1c2df0;}})[_0xdb57('0x51')](function(_0x30868b){logger[_0xdb57('0x29')](_0xdb57('0x52'),_0x30868b);throw _0x30868b;});}return _0x1c2df0;})['then'](respondWithResult(_0x5f3653,0xc9))[_0xdb57('0x51')](handleError(_0x5f3653,null));};exports['clone']=function(_0x32c7a2,_0x1ff555){var _0x22ab41={'where':{'id':_0x32c7a2[_0xdb57('0x46')]['id']}},_0x4f283c={};_0x4f283c['model']=_[_0xdb57('0x33')](db[_0xdb57('0x2e')][_0xdb57('0x2f')]);_0x22ab41[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x4f283c[_0xdb57('0x32')],qs['fields'](_0x32c7a2[_0xdb57('0x34')][_0xdb57('0x37')]));_0x22ab41[_0xdb57('0x36')]=_0x22ab41['attributes'][_0xdb57('0x38')]?_0x22ab41[_0xdb57('0x36')]:_0x4f283c[_0xdb57('0x32')];if(_0x32c7a2[_0xdb57('0x34')]['includeAll']){_0x22ab41[_0xdb57('0x43')]=[{'all':!![]}];}_0x22ab41=_[_0xdb57('0x3f')]({},_0x22ab41,_0x32c7a2[_0xdb57('0x47')]);return db[_0xdb57('0x2e')][_0xdb57('0x48')](_0x22ab41)[_0xdb57('0x25')](handleEntityNotFound(_0x1ff555,null))['then'](function(_0x19820e){if(_0x19820e){var _0x44f5c4=_0x19820e[_0xdb57('0x4c')]({'plain':!![]});_0x44f5c4=qs[_0xdb57('0x53')](_0x44f5c4,['id',_0xdb57('0x54'),_0xdb57('0x55')]);_0x32c7a2[_0xdb57('0x4a')]=_['omit'](_0x32c7a2[_0xdb57('0x4a')],['id',_0xdb57('0x54'),_0xdb57('0x55')]);return db[_0xdb57('0x2e')]['create'](_[_0xdb57('0x3f')](_0x44f5c4,_0x32c7a2[_0xdb57('0x4a')]),{'include':_0x32c7a2[_0xdb57('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xdb57('0x25')](function(_0x4d5262){var _0x49bce4=_0x32c7a2[_0xdb57('0x4b')][_0xdb57('0x4c')]({'plain':!![]});if(!_0x49bce4)throw new Error(_0xdb57('0x4d'));if(_0x49bce4[_0xdb57('0x4e')]===_0xdb57('0x4b')){var _0x49524e=_0x4d5262[_0xdb57('0x4c')]({'plain':!![]});var _0xa53c2c=_0xdb57('0x27');return db[_0xdb57('0x4f')]['find']({'where':{'name':_0xa53c2c,'userProfileId':_0x49bce4['userProfileId']},'raw':!![]})[_0xdb57('0x25')](function(_0xc456b6){if(_0xc456b6&&_0xc456b6[_0xdb57('0x50')]===0x0){return db[_0xdb57('0x28')][_0xdb57('0x49')]({'name':_0x49524e[_0xdb57('0x2a')],'resourceId':_0x49524e['id'],'type':_0xc456b6['name'],'sectionId':_0xc456b6['id']},{})[_0xdb57('0x25')](function(){return _0x4d5262;});}else{return _0x4d5262;}})[_0xdb57('0x51')](function(_0x5f4194){logger[_0xdb57('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f4194);throw _0x5f4194;});}return _0x4d5262;});}})[_0xdb57('0x25')](respondWithResult(_0x1ff555,0xc9))[_0xdb57('0x51')](handleError(_0x1ff555,null));};exports[_0xdb57('0x24')]=function(_0x32fffe,_0x11918e){if(_0x32fffe[_0xdb57('0x4a')]['id']){delete _0x32fffe['body']['id'];}return db['Campaign'][_0xdb57('0x48')]({'where':{'id':_0x32fffe[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x11918e,null))['then'](saveUpdates(_0x32fffe[_0xdb57('0x4a')],null))[_0xdb57('0x25')](respondWithResult(_0x11918e,null))['catch'](handleError(_0x11918e,null));};exports[_0xdb57('0x26')]=function(_0x5db407,_0x29da48){return db['Campaign']['find']({'where':{'id':_0x5db407[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x29da48,null))['then'](removeEntity(_0x29da48,null))[_0xdb57('0x51')](handleError(_0x29da48,null));};exports[_0xdb57('0x56')]=function(_0x4a704d,_0x1256c0,_0xa3d3d3){var _0x9b6fd4={'raw':!![],'where':{}};var _0x2ed7cc={};var _0x54411f={'count':0x0,'rows':[]};return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x4a704d[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x1256c0,null))[_0xdb57('0x25')](function(_0x5a6acd){if(_0x5a6acd){_0x2ed7cc['model']=_[_0xdb57('0x33')](db['CmHopper']['rawAttributes']);_0x2ed7cc[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x4a704d['query']);_0x2ed7cc['filters']=_[_0xdb57('0x35')](_0x2ed7cc[_0xdb57('0x32')],_0x2ed7cc[_0xdb57('0x34')]);_0x9b6fd4[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x2ed7cc['model'],qs[_0xdb57('0x37')](_0x4a704d[_0xdb57('0x34')][_0xdb57('0x37')]));_0x9b6fd4[_0xdb57('0x36')]=_0x9b6fd4[_0xdb57('0x36')][_0xdb57('0x38')]?_0x9b6fd4[_0xdb57('0x36')]:_0x2ed7cc['model'];if(!_0x4a704d[_0xdb57('0x34')]['hasOwnProperty']('nolimit')){_0x9b6fd4['limit']=qs[_0xdb57('0x1f')](_0x4a704d[_0xdb57('0x34')]['limit']);_0x9b6fd4[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x4a704d[_0xdb57('0x34')]['offset']);}_0x9b6fd4['order']=qs['sort'](_0x4a704d['query'][_0xdb57('0x3c')]);_0x9b6fd4[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x4a704d[_0xdb57('0x34')],_0x2ed7cc['filters']));_0x9b6fd4[_0xdb57('0x3d')]['CampaignId']=_0x5a6acd['id'];if(_0x4a704d[_0xdb57('0x34')][_0xdb57('0x41')]){_0x9b6fd4['where']=_['merge'](_0x9b6fd4[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x9b6fd4[_0xdb57('0x36')],function(_0x588446){var _0x18bb07={};_0x18bb07[_0x588446]={'$like':'%'+_0x4a704d[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x18bb07;})});}_0x9b6fd4=_[_0xdb57('0x3f')]({},_0x9b6fd4,_0x4a704d[_0xdb57('0x47')]);return db[_0xdb57('0x59')][_0xdb57('0x1e')]({'where':_0x9b6fd4['where']})[_0xdb57('0x25')](function(_0x18db6d){_0x54411f[_0xdb57('0x1e')]=_0x18db6d;if(_0x4a704d['query'][_0xdb57('0x42')]){_0x9b6fd4[_0xdb57('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x9b6fd4);})[_0xdb57('0x25')](function(_0xfe2999){_0x54411f[_0xdb57('0x5a')]=_0xfe2999;return _0x54411f;});}})['then'](respondWithFilteredResult(_0x1256c0,_0x9b6fd4))[_0xdb57('0x51')](handleError(_0x1256c0,null));};exports[_0xdb57('0x5b')]=function(_0x12f90d,_0x8aa5ea,_0x3ee8b5){var _0x3f803d={'raw':!![],'where':{}};var _0xa04e91={};var _0x56d69f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x12f90d[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x8aa5ea,null))[_0xdb57('0x25')](function(_0x2430aa){if(_0x2430aa){_0xa04e91[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x5c')][_0xdb57('0x2f')]);_0xa04e91[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x12f90d['query']);_0xa04e91[_0xdb57('0x3e')]=_['intersection'](_0xa04e91[_0xdb57('0x32')],_0xa04e91[_0xdb57('0x34')]);_0x3f803d[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0xa04e91['model'],qs[_0xdb57('0x37')](_0x12f90d['query'][_0xdb57('0x37')]));_0x3f803d[_0xdb57('0x36')]=_0x3f803d[_0xdb57('0x36')]['length']?_0x3f803d[_0xdb57('0x36')]:_0xa04e91[_0xdb57('0x32')];if(!_0x12f90d[_0xdb57('0x34')]['hasOwnProperty'](_0xdb57('0x3a'))){_0x3f803d['limit']=qs[_0xdb57('0x1f')](_0x12f90d[_0xdb57('0x34')]['limit']);_0x3f803d[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x12f90d[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x3f803d['order']=qs[_0xdb57('0x3c')](_0x12f90d[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x3f803d['where']=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x12f90d[_0xdb57('0x34')],_0xa04e91[_0xdb57('0x3e')]));_0x3f803d[_0xdb57('0x3d')][_0xdb57('0x5d')]=_0x2430aa['id'];if(_0x12f90d[_0xdb57('0x34')][_0xdb57('0x41')]){_0x3f803d[_0xdb57('0x3d')]=_['merge'](_0x3f803d[_0xdb57('0x3d')],{'$or':_['map'](_0x3f803d[_0xdb57('0x36')],function(_0x3b7c42){var _0x22d5b5={};_0x22d5b5[_0x3b7c42]={'$like':'%'+_0x12f90d[_0xdb57('0x34')]['filter']+'%'};return _0x22d5b5;})});}_0x3f803d=_[_0xdb57('0x3f')]({},_0x3f803d,_0x12f90d['options']);return db[_0xdb57('0x5c')]['count']({'where':_0x3f803d[_0xdb57('0x3d')]})[_0xdb57('0x25')](function(_0x4381a6){_0x56d69f[_0xdb57('0x1e')]=_0x4381a6;if(_0x12f90d[_0xdb57('0x34')][_0xdb57('0x42')]){_0x3f803d['include']=[{'all':!![]}];}return db[_0xdb57('0x5c')][_0xdb57('0x44')](_0x3f803d);})[_0xdb57('0x25')](function(_0x4f775e){_0x56d69f[_0xdb57('0x5a')]=_0x4f775e;return _0x56d69f;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x8aa5ea,_0x3f803d))[_0xdb57('0x51')](handleError(_0x8aa5ea,null));};exports['getHopperFinals']=function(_0xc6113b,_0x18009a,_0x111b78){var _0x4a6ee1={'raw':!![],'where':{}};var _0x2b49cc={};var _0x4534d1={'count':0x0,'rows':[]};return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0xc6113b['params']['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x18009a,null))['then'](function(_0x352b35){if(_0x352b35){_0x2b49cc[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x5e')]['rawAttributes']);_0x2b49cc[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0xc6113b[_0xdb57('0x34')]);_0x2b49cc[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x2b49cc[_0xdb57('0x32')],_0x2b49cc[_0xdb57('0x34')]);_0x4a6ee1[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x2b49cc[_0xdb57('0x32')],qs['fields'](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x37')]));_0x4a6ee1[_0xdb57('0x36')]=_0x4a6ee1['attributes'][_0xdb57('0x38')]?_0x4a6ee1[_0xdb57('0x36')]:_0x2b49cc[_0xdb57('0x32')];if(!_0xc6113b['query'][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x4a6ee1[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0xc6113b['query'][_0xdb57('0x1f')]);_0x4a6ee1[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x4a6ee1[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x4a6ee1[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0xc6113b[_0xdb57('0x34')],_0x2b49cc['filters']));_0x4a6ee1[_0xdb57('0x3d')]['CampaignId']=_0x352b35['id'];if(_0xc6113b['query'][_0xdb57('0x41')]){_0x4a6ee1[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x4a6ee1[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x4a6ee1[_0xdb57('0x36')],function(_0x34bf2d){var _0x2a6503={};_0x2a6503[_0x34bf2d]={'$like':'%'+_0xc6113b[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x2a6503;})});}_0x4a6ee1=_[_0xdb57('0x3f')]({},_0x4a6ee1,_0xc6113b[_0xdb57('0x47')]);return db[_0xdb57('0x5e')]['count']({'where':_0x4a6ee1['where']})[_0xdb57('0x25')](function(_0x132ebf){_0x4534d1[_0xdb57('0x1e')]=_0x132ebf;if(_0xc6113b[_0xdb57('0x34')][_0xdb57('0x42')]){_0x4a6ee1['include']=[{'all':!![]}];}return db[_0xdb57('0x5e')][_0xdb57('0x44')](_0x4a6ee1);})[_0xdb57('0x25')](function(_0x3b6235){_0x4534d1['rows']=_0x3b6235;return _0x4534d1;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x18009a,_0x4a6ee1))[_0xdb57('0x51')](handleError(_0x18009a,null));};exports[_0xdb57('0x5f')]=function(_0x421427,_0x7e346b,_0x101ee5){var _0x29696e={'raw':!![],'where':{}};var _0x44f717={};var _0x55a690={'count':0x0,'rows':[]};return db['Campaign'][_0xdb57('0x57')]({'where':{'id':_0x421427[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x7e346b,null))[_0xdb57('0x25')](function(_0x195ccc){if(_0x195ccc){_0x44f717[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x60')]['rawAttributes']);_0x44f717[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x421427[_0xdb57('0x34')]);_0x44f717['filters']=_[_0xdb57('0x35')](_0x44f717['model'],_0x44f717[_0xdb57('0x34')]);_0x29696e[_0xdb57('0x36')]=_['intersection'](_0x44f717[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x421427[_0xdb57('0x34')][_0xdb57('0x37')]));_0x29696e[_0xdb57('0x36')]=_0x29696e[_0xdb57('0x36')][_0xdb57('0x38')]?_0x29696e[_0xdb57('0x36')]:_0x44f717['model'];if(!_0x421427[_0xdb57('0x34')][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x29696e['limit']=qs[_0xdb57('0x1f')](_0x421427[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x29696e[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x421427[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x29696e['order']=qs[_0xdb57('0x3c')](_0x421427[_0xdb57('0x34')]['sort']);_0x29696e[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x421427[_0xdb57('0x34')],_0x44f717[_0xdb57('0x3e')]));_0x29696e[_0xdb57('0x3d')]['CampaignId']=_0x195ccc['id'];if(_0x421427[_0xdb57('0x34')][_0xdb57('0x41')]){_0x29696e[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x29696e[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x29696e['attributes'],function(_0x3d0609){var _0x20423c={};_0x20423c[_0x3d0609]={'$like':'%'+_0x421427[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x20423c;})});}_0x29696e=_['merge']({},_0x29696e,_0x421427[_0xdb57('0x47')]);return db[_0xdb57('0x60')]['count']({'where':_0x29696e[_0xdb57('0x3d')]})[_0xdb57('0x25')](function(_0x5c420b){_0x55a690[_0xdb57('0x1e')]=_0x5c420b;if(_0x421427[_0xdb57('0x34')]['includeAll']){_0x29696e['include']=[{'all':!![]}];}return db[_0xdb57('0x60')]['findAll'](_0x29696e);})[_0xdb57('0x25')](function(_0x16e446){_0x55a690[_0xdb57('0x5a')]=_0x16e446;return _0x55a690;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x7e346b,_0x29696e))[_0xdb57('0x51')](handleError(_0x7e346b,null));};exports[_0xdb57('0x61')]=function(_0x39de79,_0x42c2a8,_0x425f50){var _0x182af6={};var _0x7b47c5={};var _0x4a08ad;var _0x23412f;return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x39de79[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x42c2a8,null))[_0xdb57('0x25')](function(_0x5f2655){if(_0x5f2655){_0x4a08ad=_0x5f2655;_0x7b47c5['model']=_[_0xdb57('0x33')](db[_0xdb57('0x62')]['rawAttributes']);_0x7b47c5[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x39de79[_0xdb57('0x34')]);_0x7b47c5[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x7b47c5[_0xdb57('0x32')],_0x7b47c5['query']);_0x182af6[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x7b47c5[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x39de79[_0xdb57('0x34')][_0xdb57('0x37')]));_0x182af6[_0xdb57('0x36')]=_0x182af6['attributes'][_0xdb57('0x38')]?_0x182af6[_0xdb57('0x36')]:_0x7b47c5[_0xdb57('0x32')];_0x182af6[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x39de79['query'][_0xdb57('0x3c')]);_0x182af6[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x39de79['query'],_0x7b47c5['filters']));if(_0x39de79['query'][_0xdb57('0x41')]){_0x182af6['where']=_[_0xdb57('0x3f')](_0x182af6[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x182af6['attributes'],function(_0x57c22e){var _0x253030={};_0x253030[_0x57c22e]={'$like':'%'+_0x39de79[_0xdb57('0x34')]['filter']+'%'};return _0x253030;})});}_0x182af6=_[_0xdb57('0x3f')]({},_0x182af6,_0x39de79[_0xdb57('0x47')]);return _0x4a08ad['getLists'](_0x182af6);}})[_0xdb57('0x25')](function(_0x491b1b){if(_0x491b1b){_0x23412f=_0x491b1b[_0xdb57('0x38')];if(!_0x39de79[_0xdb57('0x34')]['hasOwnProperty'](_0xdb57('0x3a'))){_0x182af6['limit']=qs[_0xdb57('0x1f')](_0x39de79['query']['limit']);_0x182af6[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x39de79[_0xdb57('0x34')]['offset']);}return _0x4a08ad[_0xdb57('0x61')](_0x182af6);}})[_0xdb57('0x25')](function(_0x340816){if(_0x340816){return _0x340816?{'count':_0x23412f,'rows':_0x340816}:null;}})[_0xdb57('0x25')](respondWithResult(_0x42c2a8,null))['catch'](handleError(_0x42c2a8,null));};exports[_0xdb57('0x63')]=function(_0xd5ccc1,_0x21a30f,_0x2788fc){var _0x4f04c0,_0x2c6762;var _0x104ca7=[];var _0x34e895=moment()['format'](_0xdb57('0x64'));return db[_0xdb57('0x2e')][_0xdb57('0x48')]({'where':{'id':_0xd5ccc1[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x21a30f,null))['then'](function(_0x50d4ad){if(_0x50d4ad){_0x2c6762=_0x50d4ad;return _0x50d4ad[_0xdb57('0x63')](_0xd5ccc1[_0xdb57('0x4a')][_0xdb57('0x65')],_['omit'](_0xd5ccc1[_0xdb57('0x4a')],[_0xdb57('0x65'),'id'])||{});}return null;})[_0xdb57('0x66')](function(_0x856af6){var _0x49dc5d;var _0x9f4eb0;_0x4f04c0=_0x856af6||[];var _0x246468=[];if(_0x856af6){for(var _0x12df8d=0x0;_0x12df8d<_0x856af6['length'];_0x12df8d+=0x1){var _0x55f617=_0x856af6[_0x12df8d][_0xdb57('0x4c')]({'plain':!![]});_0x2c6762['dialCheckDuplicateType']=_0xd5ccc1[_0xdb57('0x4a')][_0xdb57('0x67')]?_0xd5ccc1['body']['dialCheckDuplicateType']:_0x2c6762[_0xdb57('0x67')];switch(_0x2c6762['dialCheckDuplicateType']){case _0xdb57('0x68'):_0x49dc5d=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')]('cm_hopper')[_0xdb57('0x6b')](['phone',_0xdb57('0x6c'),_0xdb57('0x6d'),_0xdb57('0x6e'),_0xdb57('0x5d'),_0xdb57('0x54'),'updatedAt'],squel['select']()['field'](_0xdb57('0x6f'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x6c'))['field']('id',_0xdb57('0x6d'))[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))['field'](_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))['where'](_0xdb57('0x76'))['where'](_0xdb57('0x77'),_0x55f617['CmListId'][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x7a'))[_0xdb57('0x74')]('cm_hopper_final')[_0xdb57('0x3d')](_0xdb57('0x7b'),_0xd5ccc1['params']['id']['toString']()))[_0xdb57('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x7c'))[_0xdb57('0x74')](_0xdb57('0x7d'))[_0xdb57('0x3d')](_0xdb57('0x7b'),_0xd5ccc1[_0xdb57('0x46')]['id']['toString']())))[_0xdb57('0x73')]();break;case'onlyIfOpen':_0x49dc5d=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')](_0xdb57('0x7d'))[_0xdb57('0x6b')](['phone','scheduledAt',_0xdb57('0x6d'),_0xdb57('0x6e'),_0xdb57('0x5d'),_0xdb57('0x54'),_0xdb57('0x55')],squel['select']()[_0xdb57('0x70')](_0xdb57('0x6f'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x6c'))['field']('id',_0xdb57('0x6d'))[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xd5ccc1['params']['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))[_0xdb57('0x3d')](_0xdb57('0x76'))[_0xdb57('0x3d')](_0xdb57('0x77'),_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78'))[_0xdb57('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdb57('0x70')](_0xdb57('0x7c'))[_0xdb57('0x74')](_0xdb57('0x7d'))['where'](_0xdb57('0x7b'),_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')]())))[_0xdb57('0x73')]();break;default:_0x49dc5d=squel[_0xdb57('0x69')]()['into']('cm_hopper')['fromQuery']([_0xdb57('0x6f'),_0xdb57('0x6c'),_0xdb57('0x6d'),'ListId',_0xdb57('0x5d'),_0xdb57('0x54'),_0xdb57('0x55')],squel[_0xdb57('0x79')]()[_0xdb57('0x70')]('phone',_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),'scheduledAt')[_0xdb57('0x70')]('id','ContactId')[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))[_0xdb57('0x3d')](_0xdb57('0x76'))['where'](_0xdb57('0x77'),_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78')))[_0xdb57('0x73')]();}_0x9f4eb0=squel[_0xdb57('0x69')]()['into'](_0xdb57('0x7e'))[_0xdb57('0x6b')]([_0xdb57('0x7f'),_0xdb57('0x6c'),_0xdb57('0x6f'),_0xdb57('0x80'),_0xdb57('0x54'),'updatedAt'],squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x81'),'id')['field'](_0xdb57('0x71'),_0xdb57('0x6c'))['field'](_0xdb57('0x82'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x83'),_0xdb57('0x80'))['field']('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x84'),'ci')[_0xdb57('0x85')]('cm_hopper','h',_0xdb57('0x86'))[_0xdb57('0x3d')](_0xdb57('0x87'),_0x55f617['CmListId'][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x88'),_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')]())['where'](_0xdb57('0x89'),_0x34e895))['toString']();_0x246468[_0xdb57('0x8a')](db[_0xdb57('0x8b')]['query'](_0x49dc5d));_0x104ca7[_0xdb57('0x8a')](db['sequelize'][_0xdb57('0x34')](_0x9f4eb0));}return BPromise[_0xdb57('0x8c')](_0x246468);}})['then'](function(){return BPromise[_0xdb57('0x8c')](_0x104ca7);})[_0xdb57('0x25')](function(){return _0x4f04c0;})[_0xdb57('0x25')](respondWithResult(_0x21a30f,null))[_0xdb57('0x51')](handleError(_0x21a30f,null));};exports['removeLists']=function(_0x479ea7,_0x3c0ec1,_0xe5a4be){return db[_0xdb57('0x2e')][_0xdb57('0x48')]({'where':{'id':_0x479ea7[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c0ec1,null))['then'](function(_0xac1323){if(_0xac1323){return _0xac1323[_0xdb57('0x8d')](_0x479ea7[_0xdb57('0x34')][_0xdb57('0x65')]);}})['then'](function(_0x434563){if(_0x434563){return db['CmHopper'][_0xdb57('0x26')]({'where':{'ListId':_0x479ea7[_0xdb57('0x34')][_0xdb57('0x65')],'CampaignId':_0x479ea7[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](function(){return _0x434563;});}})[_0xdb57('0x25')](respondWithStatusCode(_0x3c0ec1,null))[_0xdb57('0x51')](handleError(_0x3c0ec1,null));};exports[_0xdb57('0x8e')]=function(_0x70266f,_0x26b5c9,_0x1b6bf0){var _0x3bb8eb={};var _0x27a4ca={};var _0x4ed971;var _0x3e78cd;return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x70266f[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x26b5c9,null))[_0xdb57('0x25')](function(_0x16d08c){if(_0x16d08c){_0x4ed971=_0x16d08c;_0x27a4ca[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x62')]['rawAttributes']);_0x27a4ca[_0xdb57('0x34')]=_['keys'](_0x70266f[_0xdb57('0x34')]);_0x27a4ca[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x27a4ca[_0xdb57('0x32')],_0x27a4ca[_0xdb57('0x34')]);_0x3bb8eb[_0xdb57('0x36')]=_['intersection'](_0x27a4ca[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x37')]));_0x3bb8eb[_0xdb57('0x36')]=_0x3bb8eb[_0xdb57('0x36')][_0xdb57('0x38')]?_0x3bb8eb[_0xdb57('0x36')]:_0x27a4ca[_0xdb57('0x32')];_0x3bb8eb[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x3bb8eb[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0x70266f[_0xdb57('0x34')],_0x27a4ca[_0xdb57('0x3e')]));if(_0x70266f[_0xdb57('0x34')]['filter']){_0x3bb8eb[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x3bb8eb['where'],{'$or':_[_0xdb57('0x2d')](_0x3bb8eb[_0xdb57('0x36')],function(_0x4b0a39){var _0x562018={};_0x562018[_0x4b0a39]={'$like':'%'+_0x70266f[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x562018;})});}_0x3bb8eb=_[_0xdb57('0x3f')]({},_0x3bb8eb,_0x70266f[_0xdb57('0x47')]);return _0x4ed971['getBlackLists'](_0x3bb8eb);}})[_0xdb57('0x25')](function(_0x4e4dd5){if(_0x4e4dd5){_0x3e78cd=_0x4e4dd5[_0xdb57('0x38')];if(!_0x70266f[_0xdb57('0x34')]['hasOwnProperty']('nolimit')){_0x3bb8eb[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x3bb8eb[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x70266f['query'][_0xdb57('0x1c')]);}return _0x4ed971['getBlackLists'](_0x3bb8eb);}})[_0xdb57('0x25')](function(_0x5e295f){if(_0x5e295f){return _0x5e295f?{'count':_0x3e78cd,'rows':_0x5e295f}:null;}})[_0xdb57('0x25')](respondWithResult(_0x26b5c9,null))[_0xdb57('0x51')](handleError(_0x26b5c9,null));};exports[_0xdb57('0x8f')]=function(_0xa4d460,_0x3dc5cc,_0x41b295){var _0x4ef27d,_0x5165c2;var _0x2b3fcf=[];var _0x3e6eaa=moment()[_0xdb57('0x90')](_0xdb57('0x64'));return db['Campaign'][_0xdb57('0x48')]({'where':{'id':_0xa4d460[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x3dc5cc,null))[_0xdb57('0x25')](function(_0x155a24){if(_0x155a24){_0x5165c2=_0x155a24;return _0x155a24[_0xdb57('0x8f')](_0xa4d460[_0xdb57('0x4a')]['ids'],_[_0xdb57('0x53')](_0xa4d460[_0xdb57('0x4a')],[_0xdb57('0x65'),'id'])||{});}return null;})['spread'](function(_0x42a946){var _0x477eb3;var _0x1b8e0b;_0x4ef27d=_0x42a946||[];var _0x411c40=[];if(_0x42a946){for(var _0x2e77f2=0x0;_0x2e77f2<_0x42a946[_0xdb57('0x38')];_0x2e77f2+=0x1){var _0x44ccde=_0x42a946[_0x2e77f2][_0xdb57('0x4c')]({'plain':!![]});_0x477eb3=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')](_0xdb57('0x91'))[_0xdb57('0x6b')](['phone',_0xdb57('0x6d'),_0xdb57('0x6e'),'CampaignId',_0xdb57('0x54'),'updatedAt'],squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x6f'),_0xdb57('0x6f'))['field']('id','ContactId')[_0xdb57('0x70')](_0x44ccde[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xa4d460[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x54'))['field'](_0xdb57('0x71'),_0xdb57('0x55'))[_0xdb57('0x74')]('cm_contacts')[_0xdb57('0x3d')](_0xdb57('0x76'))[_0xdb57('0x3d')](_0xdb57('0x77'),_0x44ccde['CmListId']['toString']())[_0xdb57('0x3d')](_0xdb57('0x78')))[_0xdb57('0x73')]();_0x411c40[_0xdb57('0x8a')](db[_0xdb57('0x8b')][_0xdb57('0x34')](_0x477eb3));}return BPromise[_0xdb57('0x8c')](_0x411c40);}})[_0xdb57('0x25')](function(){return _0x4ef27d;})[_0xdb57('0x25')](respondWithResult(_0x3dc5cc,null))['catch'](handleError(_0x3dc5cc,null));};exports['removeBlackLists']=function(_0x5f0d8c,_0xb81699,_0x1e5bf4){return db[_0xdb57('0x2e')]['find']({'where':{'id':_0x5f0d8c[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0xb81699,null))[_0xdb57('0x25')](function(_0x4d3126){if(_0x4d3126){return _0x4d3126[_0xdb57('0x92')](_0x5f0d8c[_0xdb57('0x34')]['ids']);}})[_0xdb57('0x25')](function(_0xf3b9d3){if(_0xf3b9d3){return db[_0xdb57('0x60')]['destroy']({'where':{'ListId':_0x5f0d8c['query'][_0xdb57('0x65')],'CampaignId':_0x5f0d8c[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](function(){return _0xf3b9d3;});}})[_0xdb57('0x25')](respondWithStatusCode(_0xb81699,null))['catch'](handleError(_0xb81699,null));}; \ No newline at end of file +var _0xc48e=['rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','getHoppers','CmHopper','pick','findOne','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','NOW()','field','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','format','addBlackLists','spread','removeBlackLists','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','Campaign','findAll','rows','show','params'];(function(_0x156e7b,_0x757e18){var _0x59ce42=function(_0x339b08){while(--_0x339b08){_0x156e7b['push'](_0x156e7b['shift']());}};_0x59ce42(++_0x757e18);}(_0xc48e,0xd7));var _0xec48=function(_0x381f0b,_0x2ad002){_0x381f0b=_0x381f0b-0x0;var _0x5e00e9=_0xc48e[_0x381f0b];return _0x5e00e9;};'use strict';var emlformat=require(_0xec48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec48('0x2'));var moment=require(_0xec48('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec48('0x4'));var path=require(_0xec48('0x5'));var sox=require(_0xec48('0x6'));var csv=require(_0xec48('0x7'));var ejs=require(_0xec48('0x8'));var fs=require('fs');var fs_extra=require(_0xec48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec48('0xa'));var jsforce=require(_0xec48('0xb'));var deskjs=require(_0xec48('0xc'));var toCsv=require(_0xec48('0x7'));var querystring=require(_0xec48('0xd'));var Papa=require(_0xec48('0xe'));var Redis=require(_0xec48('0xf'));var authService=require(_0xec48('0x10'));var qs=require(_0xec48('0x11'));var as=require(_0xec48('0x12'));var hardwareService=require(_0xec48('0x13'));var logger=require('../../config/logger')(_0xec48('0x14'));var utils=require(_0xec48('0x15'));var config=require(_0xec48('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xec48('0x17'))['db'];function respondWithStatusCode(_0x4a4761,_0x4f17d7){_0x4f17d7=_0x4f17d7||0xcc;return function(_0x2fe7f1){if(_0x2fe7f1){return _0x4a4761[_0xec48('0x18')](_0x4f17d7);}return _0x4a4761[_0xec48('0x19')](_0x4f17d7)[_0xec48('0x1a')]();};}function respondWithResult(_0x3677a3,_0x3374c4){_0x3374c4=_0x3374c4||0xc8;return function(_0x5ef355){if(_0x5ef355){return _0x3677a3[_0xec48('0x19')](_0x3374c4)[_0xec48('0x1b')](_0x5ef355);}};}function respondWithFilteredResult(_0x42202a,_0xf77d40){return function(_0x4a9150){if(_0x4a9150){var _0x2ef68f=typeof _0xf77d40['offset']==='undefined'&&typeof _0xf77d40[_0xec48('0x1c')]===_0xec48('0x1d');var _0x3a9205=_0x4a9150[_0xec48('0x1e')];var _0x41a7e9=_0x2ef68f?0x0:_0xf77d40[_0xec48('0x1f')];var _0x211f24=_0x2ef68f?_0x4a9150['count']:_0xf77d40[_0xec48('0x1f')]+_0xf77d40['limit'];var _0x40f10e;if(_0x211f24>=_0x3a9205){_0x211f24=_0x3a9205;_0x40f10e=0xc8;}else{_0x40f10e=0xce;}_0x42202a[_0xec48('0x19')](_0x40f10e);return _0x42202a['set'](_0xec48('0x20'),_0x41a7e9+'-'+_0x211f24+'/'+_0x3a9205)[_0xec48('0x1b')](_0x4a9150);}return null;};}function patchUpdates(_0x5e7cb6){return function(_0x50ac10){try{jsonpatch['apply'](_0x50ac10,_0x5e7cb6,!![]);}catch(_0x5575c7){return BPromise[_0xec48('0x21')](_0x5575c7);}return _0x50ac10[_0xec48('0x22')]();};}function saveUpdates(_0x5840d6,_0x98a3b0){return function(_0x5ce57d){if(_0x5ce57d){return _0x5ce57d[_0xec48('0x23')](_0x5840d6)['then'](function(_0x54b55d){return _0x54b55d;});}return null;};}function removeEntity(_0x2a6613,_0x140978){return function(_0x5aeea1){if(_0x5aeea1){return _0x5aeea1[_0xec48('0x24')]()[_0xec48('0x25')](function(){var _0x1d389a=_0x5aeea1[_0xec48('0x26')]({'plain':!![]});var _0x3a6b56='IvrCampaigns';return db[_0xec48('0x27')][_0xec48('0x24')]({'where':{'type':_0x3a6b56,'resourceId':_0x1d389a['id']}})['then'](function(){return _0x5aeea1;});})[_0xec48('0x25')](function(){_0x2a6613['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2270,_0x348293){return function(_0x32f12f){if(!_0x32f12f){_0x5c2270[_0xec48('0x18')](0x194);}return _0x32f12f;};}function handleError(_0x29ce4d,_0x5ea784){_0x5ea784=_0x5ea784||0x1f4;return function(_0x2426ed){logger[_0xec48('0x28')](_0x2426ed[_0xec48('0x29')]);if(_0x2426ed[_0xec48('0x2a')]){delete _0x2426ed[_0xec48('0x2a')];}_0x29ce4d['status'](_0x5ea784)['send'](_0x2426ed);};}exports['index']=function(_0x4eb580,_0x210abe){var _0x3f287f={},_0x34e423={},_0xaf5708={'count':0x0,'rows':[]};var _0x4ef91a=_['map'](db['Campaign']['rawAttributes'],function(_0x393d47){return{'name':_0x393d47['fieldName'],'type':_0x393d47[_0xec48('0x2b')][_0xec48('0x2c')]};});_0x34e423[_0xec48('0x2d')]=_[_0xec48('0x2e')](_0x4ef91a,_0xec48('0x2a'));_0x34e423[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4eb580[_0xec48('0x2f')]);_0x34e423[_0xec48('0x31')]=_[_0xec48('0x32')](_0x34e423[_0xec48('0x2d')],_0x34e423['query']);_0x3f287f[_0xec48('0x33')]=_[_0xec48('0x32')](_0x34e423['model'],qs['fields'](_0x4eb580[_0xec48('0x2f')][_0xec48('0x34')]));_0x3f287f[_0xec48('0x33')]=_0x3f287f[_0xec48('0x33')][_0xec48('0x35')]?_0x3f287f['attributes']:_0x34e423[_0xec48('0x2d')];if(!_0x4eb580[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x3f287f[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4eb580['query']['limit']);_0x3f287f[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x3f287f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x39')]);_0x3f287f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x4eb580[_0xec48('0x2f')],_0x34e423[_0xec48('0x31')]),_0x4ef91a);if(_0x4eb580[_0xec48('0x2f')]['filter']){_0x3f287f[_0xec48('0x3a')]=_['merge'](_0x3f287f['where'],{'$or':_[_0xec48('0x2e')](_0x4ef91a,function(_0x9ebfd8){if(_0x9ebfd8['type']!==_0xec48('0x3b')){var _0x2f5bac={};_0x2f5bac[_0x9ebfd8['name']]={'$like':'%'+_0x4eb580[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x2f5bac;}})});}_0x3f287f=_[_0xec48('0x3d')]({},_0x3f287f,_0x4eb580[_0xec48('0x3e')]);var _0xa436af={'where':_0x3f287f[_0xec48('0x3a')]};return db['Campaign'][_0xec48('0x1e')](_0xa436af)[_0xec48('0x25')](function(_0x253d1a){_0xaf5708[_0xec48('0x1e')]=_0x253d1a;if(_0x4eb580[_0xec48('0x2f')]['includeAll']){_0x3f287f[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x40')][_0xec48('0x41')](_0x3f287f);})['then'](function(_0x57008c){_0xaf5708[_0xec48('0x42')]=_0x57008c;return _0xaf5708;})[_0xec48('0x25')](respondWithFilteredResult(_0x210abe,_0x3f287f))['catch'](handleError(_0x210abe,null));};exports[_0xec48('0x43')]=function(_0x58b45f,_0x3f0ea1){var _0x4a8dfc={'raw':![],'where':{'id':_0x58b45f[_0xec48('0x44')]['id']}},_0xf6957={};_0xf6957[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0xf6957[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x58b45f[_0xec48('0x2f')]);_0xf6957[_0xec48('0x31')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],_0xf6957[_0xec48('0x2f')]);_0x4a8dfc[_0xec48('0x33')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x58b45f['query'][_0xec48('0x34')]));_0x4a8dfc[_0xec48('0x33')]=_0x4a8dfc[_0xec48('0x33')][_0xec48('0x35')]?_0x4a8dfc[_0xec48('0x33')]:_0xf6957['model'];if(_0x58b45f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4a8dfc['include']=[{'all':!![]}];}_0x4a8dfc=_[_0xec48('0x3d')]({},_0x4a8dfc,_0x58b45f[_0xec48('0x3e')]);return db[_0xec48('0x40')][_0xec48('0x47')](_0x4a8dfc)[_0xec48('0x25')](handleEntityNotFound(_0x3f0ea1,null))[_0xec48('0x25')](respondWithResult(_0x3f0ea1,null))['catch'](handleError(_0x3f0ea1,null));};exports['create']=function(_0x1313fb,_0x5e88cb){return db[_0xec48('0x40')][_0xec48('0x48')](_0x1313fb[_0xec48('0x49')],{})['then'](function(_0x3c468d){var _0x44da3e=_0x1313fb[_0xec48('0x4a')][_0xec48('0x26')]({'plain':!![]});if(!_0x44da3e)throw new Error(_0xec48('0x4b'));if(_0x44da3e[_0xec48('0x4c')]===_0xec48('0x4a')){var _0x378288=_0x3c468d[_0xec48('0x26')]({'plain':!![]});var _0x1999c0=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x1999c0,'userProfileId':_0x44da3e[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0xffbfa1){if(_0xffbfa1&&_0xffbfa1[_0xec48('0x4f')]===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x378288[_0xec48('0x2a')],'resourceId':_0x378288['id'],'type':_0xffbfa1['name'],'sectionId':_0xffbfa1['id']},{})[_0xec48('0x25')](function(){return _0x3c468d;});}else{return _0x3c468d;}})['catch'](function(_0x172f57){logger['error'](_0xec48('0x50'),_0x172f57);throw _0x172f57;});}return _0x3c468d;})['then'](respondWithResult(_0x5e88cb,0xc9))[_0xec48('0x51')](handleError(_0x5e88cb,null));};exports[_0xec48('0x52')]=function(_0x496226,_0x28dd61){var _0x63629={'where':{'id':_0x496226[_0xec48('0x44')]['id']}},_0x578647={};_0x578647[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0x63629['attributes']=_[_0xec48('0x32')](_0x578647['model'],qs['fields'](_0x496226[_0xec48('0x2f')][_0xec48('0x34')]));_0x63629[_0xec48('0x33')]=_0x63629[_0xec48('0x33')][_0xec48('0x35')]?_0x63629['attributes']:_0x578647[_0xec48('0x2d')];if(_0x496226[_0xec48('0x2f')][_0xec48('0x46')]){_0x63629[_0xec48('0x3f')]=[{'all':!![]}];}_0x63629=_[_0xec48('0x3d')]({},_0x63629,_0x496226[_0xec48('0x3e')]);return db['Campaign'][_0xec48('0x47')](_0x63629)[_0xec48('0x25')](handleEntityNotFound(_0x28dd61,null))[_0xec48('0x25')](function(_0x214b3b){if(_0x214b3b){var _0x2ae6a1=_0x214b3b[_0xec48('0x26')]({'plain':!![]});_0x2ae6a1=qs[_0xec48('0x53')](_0x2ae6a1,['id',_0xec48('0x54'),'updatedAt']);_0x496226[_0xec48('0x49')]=_[_0xec48('0x53')](_0x496226[_0xec48('0x49')],['id',_0xec48('0x54'),'updatedAt']);return db['Campaign'][_0xec48('0x48')](_['merge'](_0x2ae6a1,_0x496226[_0xec48('0x49')]),{'include':_0x496226[_0xec48('0x2f')][_0xec48('0x46')]?[{'all':!![]}]:undefined})[_0xec48('0x25')](function(_0x4e3899){var _0x387421=_0x496226['user'][_0xec48('0x26')]({'plain':!![]});if(!_0x387421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x387421[_0xec48('0x4c')]==='user'){var _0x167a04=_0x4e3899[_0xec48('0x26')]({'plain':!![]});var _0x4e6507=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x4e6507,'userProfileId':_0x387421[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0x594388){if(_0x594388&&_0x594388['autoAssociation']===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x167a04[_0xec48('0x2a')],'resourceId':_0x167a04['id'],'type':_0x594388[_0xec48('0x2a')],'sectionId':_0x594388['id']},{})[_0xec48('0x25')](function(){return _0x4e3899;});}else{return _0x4e3899;}})[_0xec48('0x51')](function(_0x3fa36d){logger['error'](_0xec48('0x50'),_0x3fa36d);throw _0x3fa36d;});}return _0x4e3899;});}})['then'](respondWithResult(_0x28dd61,0xc9))[_0xec48('0x51')](handleError(_0x28dd61,null));};exports[_0xec48('0x23')]=function(_0x460172,_0x114ba3){if(_0x460172[_0xec48('0x49')]['id']){delete _0x460172[_0xec48('0x49')]['id'];}return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x460172[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x114ba3,null))[_0xec48('0x25')](saveUpdates(_0x460172[_0xec48('0x49')],null))[_0xec48('0x25')](respondWithResult(_0x114ba3,null))['catch'](handleError(_0x114ba3,null));};exports['destroy']=function(_0x2b3d30,_0xd3c82b){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x2b3d30[_0xec48('0x44')]['id']}})[_0xec48('0x25')](handleEntityNotFound(_0xd3c82b,null))['then'](removeEntity(_0xd3c82b,null))['catch'](handleError(_0xd3c82b,null));};exports[_0xec48('0x55')]=function(_0x45371f,_0xfcb3df,_0x4d0c8d){var _0x4eb807={'raw':!![],'where':{}};var _0x5b33ef={};var _0x4a3974={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x45371f[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0xfcb3df,null))[_0xec48('0x25')](function(_0x29e012){if(_0x29e012){_0x5b33ef[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x56')]['rawAttributes']);_0x5b33ef[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x45371f[_0xec48('0x2f')]);_0x5b33ef[_0xec48('0x31')]=_[_0xec48('0x32')](_0x5b33ef[_0xec48('0x2d')],_0x5b33ef[_0xec48('0x2f')]);_0x4eb807[_0xec48('0x33')]=_['intersection'](_0x5b33ef[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x45371f[_0xec48('0x2f')][_0xec48('0x34')]));_0x4eb807['attributes']=_0x4eb807[_0xec48('0x33')][_0xec48('0x35')]?_0x4eb807[_0xec48('0x33')]:_0x5b33ef[_0xec48('0x2d')];if(!_0x45371f[_0xec48('0x2f')]['hasOwnProperty'](_0xec48('0x37'))){_0x4eb807[_0xec48('0x1c')]=qs['limit'](_0x45371f[_0xec48('0x2f')]['limit']);_0x4eb807[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x45371f[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x4eb807['order']=qs[_0xec48('0x39')](_0x45371f[_0xec48('0x2f')][_0xec48('0x39')]);_0x4eb807[_0xec48('0x3a')]=qs['filters'](_[_0xec48('0x57')](_0x45371f[_0xec48('0x2f')],_0x5b33ef['filters']));_0x4eb807[_0xec48('0x3a')]['CampaignId']=_0x29e012['id'];if(_0x45371f['query'][_0xec48('0x3c')]){_0x4eb807[_0xec48('0x3a')]=_['merge'](_0x4eb807[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x4eb807[_0xec48('0x33')],function(_0x24a40a){var _0x5df7fc={};_0x5df7fc[_0x24a40a]={'$like':'%'+_0x45371f[_0xec48('0x2f')]['filter']+'%'};return _0x5df7fc;})});}_0x4eb807=_[_0xec48('0x3d')]({},_0x4eb807,_0x45371f[_0xec48('0x3e')]);return db[_0xec48('0x56')][_0xec48('0x1e')]({'where':_0x4eb807[_0xec48('0x3a')]})['then'](function(_0x516f34){_0x4a3974[_0xec48('0x1e')]=_0x516f34;if(_0x45371f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4eb807[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xec48('0x41')](_0x4eb807);})[_0xec48('0x25')](function(_0x2d874a){_0x4a3974['rows']=_0x2d874a;return _0x4a3974;});}})[_0xec48('0x25')](respondWithFilteredResult(_0xfcb3df,_0x4eb807))['catch'](handleError(_0xfcb3df,null));};exports['getHopperHistories']=function(_0x4012d6,_0x368838,_0x2fe4bd){var _0x5d5118={'raw':!![],'where':{}};var _0x38d97d={};var _0x54c790={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x4012d6[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x368838,null))[_0xec48('0x25')](function(_0x3708e7){if(_0x3708e7){_0x38d97d['model']=_[_0xec48('0x30')](db[_0xec48('0x59')][_0xec48('0x45')]);_0x38d97d[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4012d6[_0xec48('0x2f')]);_0x38d97d[_0xec48('0x31')]=_[_0xec48('0x32')](_0x38d97d[_0xec48('0x2d')],_0x38d97d[_0xec48('0x2f')]);_0x5d5118[_0xec48('0x33')]=_['intersection'](_0x38d97d[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x34')]));_0x5d5118[_0xec48('0x33')]=_0x5d5118['attributes']['length']?_0x5d5118[_0xec48('0x33')]:_0x38d97d[_0xec48('0x2d')];if(!_0x4012d6['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x5d5118[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4012d6[_0xec48('0x2f')]['limit']);_0x5d5118[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x5d5118[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x39')]);_0x5d5118[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x4012d6[_0xec48('0x2f')],_0x38d97d[_0xec48('0x31')]));_0x5d5118['where'][_0xec48('0x5a')]=_0x3708e7['id'];if(_0x4012d6[_0xec48('0x2f')]['filter']){_0x5d5118['where']=_[_0xec48('0x3d')](_0x5d5118[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x5d5118[_0xec48('0x33')],function(_0x4fc35d){var _0x3fe956={};_0x3fe956[_0x4fc35d]={'$like':'%'+_0x4012d6['query']['filter']+'%'};return _0x3fe956;})});}_0x5d5118=_[_0xec48('0x3d')]({},_0x5d5118,_0x4012d6[_0xec48('0x3e')]);return db[_0xec48('0x59')]['count']({'where':_0x5d5118['where']})[_0xec48('0x25')](function(_0x1edb0c){_0x54c790[_0xec48('0x1e')]=_0x1edb0c;if(_0x4012d6[_0xec48('0x2f')]['includeAll']){_0x5d5118[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x59')]['findAll'](_0x5d5118);})[_0xec48('0x25')](function(_0x55bd3f){_0x54c790[_0xec48('0x42')]=_0x55bd3f;return _0x54c790;});}})['then'](respondWithFilteredResult(_0x368838,_0x5d5118))[_0xec48('0x51')](handleError(_0x368838,null));};exports['getHopperFinals']=function(_0x14d1aa,_0x191ec0,_0x38c984){var _0x46d04f={'raw':!![],'where':{}};var _0x56223a={};var _0x288cd9={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x14d1aa['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x191ec0,null))[_0xec48('0x25')](function(_0x97717c){if(_0x97717c){_0x56223a['model']=_['keys'](db[_0xec48('0x5b')][_0xec48('0x45')]);_0x56223a[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x14d1aa[_0xec48('0x2f')]);_0x56223a[_0xec48('0x31')]=_[_0xec48('0x32')](_0x56223a[_0xec48('0x2d')],_0x56223a['query']);_0x46d04f[_0xec48('0x33')]=_['intersection'](_0x56223a[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x34')]));_0x46d04f['attributes']=_0x46d04f[_0xec48('0x33')][_0xec48('0x35')]?_0x46d04f['attributes']:_0x56223a[_0xec48('0x2d')];if(!_0x14d1aa['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x46d04f['limit']=qs[_0xec48('0x1c')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x1c')]);_0x46d04f[_0xec48('0x1f')]=qs['offset'](_0x14d1aa['query'][_0xec48('0x1f')]);}_0x46d04f['order']=qs[_0xec48('0x39')](_0x14d1aa['query'][_0xec48('0x39')]);_0x46d04f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x14d1aa[_0xec48('0x2f')],_0x56223a[_0xec48('0x31')]));_0x46d04f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x97717c['id'];if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x3c')]){_0x46d04f['where']=_[_0xec48('0x3d')](_0x46d04f[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x46d04f[_0xec48('0x33')],function(_0x3bc9fd){var _0x3ba6bb={};_0x3ba6bb[_0x3bc9fd]={'$like':'%'+_0x14d1aa['query']['filter']+'%'};return _0x3ba6bb;})});}_0x46d04f=_[_0xec48('0x3d')]({},_0x46d04f,_0x14d1aa['options']);return db['CmHopperFinal'][_0xec48('0x1e')]({'where':_0x46d04f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x39a06e){_0x288cd9[_0xec48('0x1e')]=_0x39a06e;if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x46')]){_0x46d04f[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xec48('0x41')](_0x46d04f);})[_0xec48('0x25')](function(_0x1b2afa){_0x288cd9[_0xec48('0x42')]=_0x1b2afa;return _0x288cd9;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x191ec0,_0x46d04f))['catch'](handleError(_0x191ec0,null));};exports[_0xec48('0x5c')]=function(_0x5a1881,_0x3a4f0d,_0x4f4da9){var _0x5c073f={'raw':!![],'where':{}};var _0xd33994={};var _0x422104={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x5a1881['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x3a4f0d,null))[_0xec48('0x25')](function(_0x42d386){if(_0x42d386){_0xd33994[_0xec48('0x2d')]=_[_0xec48('0x30')](db['CmHopperBlack'][_0xec48('0x45')]);_0xd33994[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x5a1881[_0xec48('0x2f')]);_0xd33994['filters']=_[_0xec48('0x32')](_0xd33994[_0xec48('0x2d')],_0xd33994['query']);_0x5c073f['attributes']=_['intersection'](_0xd33994['model'],qs[_0xec48('0x34')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x34')]));_0x5c073f[_0xec48('0x33')]=_0x5c073f[_0xec48('0x33')]['length']?_0x5c073f['attributes']:_0xd33994['model'];if(!_0x5a1881['query'][_0xec48('0x36')]('nolimit')){_0x5c073f['limit']=qs[_0xec48('0x1c')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x1c')]);_0x5c073f[_0xec48('0x1f')]=qs['offset'](_0x5a1881['query'][_0xec48('0x1f')]);}_0x5c073f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x39')]);_0x5c073f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x5a1881[_0xec48('0x2f')],_0xd33994[_0xec48('0x31')]));_0x5c073f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x42d386['id'];if(_0x5a1881['query'][_0xec48('0x3c')]){_0x5c073f['where']=_[_0xec48('0x3d')](_0x5c073f[_0xec48('0x3a')],{'$or':_['map'](_0x5c073f[_0xec48('0x33')],function(_0x5d08e3){var _0x56a7da={};_0x56a7da[_0x5d08e3]={'$like':'%'+_0x5a1881[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x56a7da;})});}_0x5c073f=_[_0xec48('0x3d')]({},_0x5c073f,_0x5a1881[_0xec48('0x3e')]);return db['CmHopperBlack'][_0xec48('0x1e')]({'where':_0x5c073f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x14cc3a){_0x422104['count']=_0x14cc3a;if(_0x5a1881[_0xec48('0x2f')]['includeAll']){_0x5c073f['include']=[{'all':!![]}];}return db[_0xec48('0x5d')]['findAll'](_0x5c073f);})[_0xec48('0x25')](function(_0x548e80){_0x422104[_0xec48('0x42')]=_0x548e80;return _0x422104;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x3a4f0d,_0x5c073f))[_0xec48('0x51')](handleError(_0x3a4f0d,null));};exports['getLists']=function(_0x5a68bf,_0x4590a5,_0x2945c9){var _0x39447c={};var _0x3605d3={};var _0x33317c;var _0x48d9ed;return db['Campaign'][_0xec48('0x58')]({'where':{'id':_0x5a68bf[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4590a5,null))[_0xec48('0x25')](function(_0x391a60){if(_0x391a60){_0x33317c=_0x391a60;_0x3605d3['model']=_[_0xec48('0x30')](db['CmList']['rawAttributes']);_0x3605d3['query']=_[_0xec48('0x30')](_0x5a68bf[_0xec48('0x2f')]);_0x3605d3[_0xec48('0x31')]=_['intersection'](_0x3605d3['model'],_0x3605d3[_0xec48('0x2f')]);_0x39447c['attributes']=_['intersection'](_0x3605d3[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x5a68bf['query'][_0xec48('0x34')]));_0x39447c[_0xec48('0x33')]=_0x39447c['attributes'][_0xec48('0x35')]?_0x39447c[_0xec48('0x33')]:_0x3605d3[_0xec48('0x2d')];_0x39447c['order']=qs['sort'](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x39')]);_0x39447c[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x5a68bf[_0xec48('0x2f')],_0x3605d3['filters']));if(_0x5a68bf['query'][_0xec48('0x3c')]){_0x39447c['where']=_['merge'](_0x39447c[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x39447c[_0xec48('0x33')],function(_0x678cc3){var _0x1de685={};_0x1de685[_0x678cc3]={'$like':'%'+_0x5a68bf['query'][_0xec48('0x3c')]+'%'};return _0x1de685;})});}_0x39447c=_[_0xec48('0x3d')]({},_0x39447c,_0x5a68bf[_0xec48('0x3e')]);return _0x33317c[_0xec48('0x5e')](_0x39447c);}})['then'](function(_0x2ee2c0){if(_0x2ee2c0){_0x48d9ed=_0x2ee2c0[_0xec48('0x35')];if(!_0x5a68bf[_0xec48('0x2f')][_0xec48('0x36')]('nolimit')){_0x39447c[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1c')]);_0x39447c[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x33317c[_0xec48('0x5e')](_0x39447c);}})[_0xec48('0x25')](function(_0x4a2c6e){if(_0x4a2c6e){return _0x4a2c6e?{'count':_0x48d9ed,'rows':_0x4a2c6e}:null;}})[_0xec48('0x25')](respondWithResult(_0x4590a5,null))[_0xec48('0x51')](handleError(_0x4590a5,null));};exports[_0xec48('0x5f')]=function(_0x3ddebc,_0x11c59a,_0x560a75){var _0x4eab6c,_0x5efb48;var _0x43a879=[];var _0x426004=moment()['format'](_0xec48('0x60'));return db['Campaign'][_0xec48('0x47')]({'where':{'id':_0x3ddebc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x11c59a,null))[_0xec48('0x25')](function(_0x5c6c53){if(_0x5c6c53){_0x5efb48=_0x5c6c53;return _0x5c6c53['addLists'](_0x3ddebc['body'][_0xec48('0x61')],_['omit'](_0x3ddebc[_0xec48('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xa38d94){var _0x2375a2;var _0x3a79af;_0x4eab6c=_0xa38d94||[];var _0x1ae869=[];if(_0xa38d94){for(var _0x4fe934=0x0;_0x4fe934<_0xa38d94[_0xec48('0x35')];_0x4fe934+=0x1){var _0x203cc4=_0xa38d94[_0x4fe934][_0xec48('0x26')]({'plain':!![]});_0x5efb48[_0xec48('0x62')]=_0x3ddebc[_0xec48('0x49')][_0xec48('0x62')]?_0x3ddebc[_0xec48('0x49')]['dialCheckDuplicateType']:_0x5efb48[_0xec48('0x62')];switch(_0x5efb48[_0xec48('0x62')]){case'always':_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))['fromQuery']([_0xec48('0x66'),_0xec48('0x67'),_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))['field'](_0xec48('0x6c'),_0xec48('0x67'))['field']('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4['CmListId'][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x3ddebc['params']['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27','createdAt')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')]('deletedAt\x20IS\x20NULL')[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xec48('0x73'),squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x74'))[_0xec48('0x6f')](_0xec48('0x75'))['where'](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]()))[_0xec48('0x3a')](_0xec48('0x73'),squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())))[_0xec48('0x6e')]();break;case _0xec48('0x78'):_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')]([_0xec48('0x66'),_0xec48('0x67'),'ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x67'))[_0xec48('0x6d')]('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),'ListId')[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')]('cm_contacts')[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b'))[_0xec48('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]())))[_0xec48('0x6e')]();break;default:_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')](['phone','scheduledAt',_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('id','ContactId')[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),_0xec48('0x69'))[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id']['toString'](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from']('cm_contacts')['where'](_0xec48('0x7a'))[_0xec48('0x3a')]('ListId\x20=\x20?',_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b')))[_0xec48('0x6e')]();}_0x3a79af=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x7c'))[_0xec48('0x79')]([_0xec48('0x7d'),_0xec48('0x67'),_0xec48('0x66'),'OrderBy',_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x7e'),'id')[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('ci.item','phone')[_0xec48('0x6d')](_0xec48('0x7f'),'OrderBy')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from'](_0xec48('0x80'),'ci')['join'](_0xec48('0x65'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xec48('0x3a')](_0xec48('0x81'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x82'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())[_0xec48('0x3a')](_0xec48('0x83'),_0x426004))['toString']();_0x1ae869[_0xec48('0x84')](db[_0xec48('0x85')][_0xec48('0x2f')](_0x2375a2));_0x43a879[_0xec48('0x84')](db['sequelize']['query'](_0x3a79af));}return BPromise[_0xec48('0x86')](_0x1ae869);}})[_0xec48('0x25')](function(){return BPromise['all'](_0x43a879);})['then'](function(){return _0x4eab6c;})[_0xec48('0x25')](respondWithResult(_0x11c59a,null))[_0xec48('0x51')](handleError(_0x11c59a,null));};exports[_0xec48('0x87')]=function(_0x3c3ffc,_0x5662fe,_0x45b849){return db[_0xec48('0x40')]['find']({'where':{'id':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x5662fe,null))['then'](function(_0x100f3c){if(_0x100f3c){return _0x100f3c[_0xec48('0x87')](_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x389f08){if(_0x389f08){return db[_0xec48('0x56')][_0xec48('0x24')]({'where':{'ListId':_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](function(){return _0x389f08;});}})[_0xec48('0x25')](respondWithStatusCode(_0x5662fe,null))[_0xec48('0x51')](handleError(_0x5662fe,null));};exports[_0xec48('0x88')]=function(_0x282721,_0x4bc9e3,_0x5eff45){var _0x58b3e4={};var _0x19e37b={};var _0x2b1b9a;var _0x57871b;return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x282721['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x4bc9e3,null))[_0xec48('0x25')](function(_0x1bb002){if(_0x1bb002){_0x2b1b9a=_0x1bb002;_0x19e37b[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x89')][_0xec48('0x45')]);_0x19e37b['query']=_[_0xec48('0x30')](_0x282721[_0xec48('0x2f')]);_0x19e37b['filters']=_['intersection'](_0x19e37b[_0xec48('0x2d')],_0x19e37b[_0xec48('0x2f')]);_0x58b3e4[_0xec48('0x33')]=_[_0xec48('0x32')](_0x19e37b[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x282721[_0xec48('0x2f')][_0xec48('0x34')]));_0x58b3e4[_0xec48('0x33')]=_0x58b3e4[_0xec48('0x33')][_0xec48('0x35')]?_0x58b3e4[_0xec48('0x33')]:_0x19e37b[_0xec48('0x2d')];_0x58b3e4[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x282721['query'][_0xec48('0x39')]);_0x58b3e4[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x282721['query'],_0x19e37b['filters']));if(_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]){_0x58b3e4[_0xec48('0x3a')]=_[_0xec48('0x3d')](_0x58b3e4[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x58b3e4[_0xec48('0x33')],function(_0x126301){var _0x488d5e={};_0x488d5e[_0x126301]={'$like':'%'+_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x488d5e;})});}_0x58b3e4=_['merge']({},_0x58b3e4,_0x282721[_0xec48('0x3e')]);return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x2695e5){if(_0x2695e5){_0x57871b=_0x2695e5[_0xec48('0x35')];if(!_0x282721[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x58b3e4[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x282721[_0xec48('0x2f')]['limit']);_0x58b3e4['offset']=qs['offset'](_0x282721[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x4fd407){if(_0x4fd407){return _0x4fd407?{'count':_0x57871b,'rows':_0x4fd407}:null;}})[_0xec48('0x25')](respondWithResult(_0x4bc9e3,null))[_0xec48('0x51')](handleError(_0x4bc9e3,null));};exports['addBlackLists']=function(_0x40d520,_0x9424e5,_0x1b51c1){var _0xd89d7,_0x4292ac;var _0xb44f1d=[];var _0x15bca9=moment()[_0xec48('0x8a')](_0xec48('0x60'));return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x40d520['params']['id']}})['then'](handleEntityNotFound(_0x9424e5,null))[_0xec48('0x25')](function(_0x2beae6){if(_0x2beae6){_0x4292ac=_0x2beae6;return _0x2beae6[_0xec48('0x8b')](_0x40d520[_0xec48('0x49')][_0xec48('0x61')],_[_0xec48('0x53')](_0x40d520[_0xec48('0x49')],['ids','id'])||{});}return null;})[_0xec48('0x8c')](function(_0x1ae850){var _0x33d84c;var _0x400c71;_0xd89d7=_0x1ae850||[];var _0x13171e=[];if(_0x1ae850){for(var _0x45f111=0x0;_0x45f111<_0x1ae850[_0xec48('0x35')];_0x45f111+=0x1){var _0x33d08d=_0x1ae850[_0x45f111][_0xec48('0x26')]({'plain':!![]});_0x33d84c=squel[_0xec48('0x63')]()[_0xec48('0x64')]('cm_hopper_black')[_0xec48('0x79')](['phone','ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel['select']()['field'](_0xec48('0x66'),_0xec48('0x66'))['field']('id',_0xec48('0x68'))['field'](_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x40d520[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x54'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xec48('0x6e')]();_0x13171e['push'](db['sequelize'][_0xec48('0x2f')](_0x33d84c));}return BPromise[_0xec48('0x86')](_0x13171e);}})[_0xec48('0x25')](function(){return _0xd89d7;})[_0xec48('0x25')](respondWithResult(_0x9424e5,null))[_0xec48('0x51')](handleError(_0x9424e5,null));};exports[_0xec48('0x8d')]=function(_0x576520,_0x4402b9,_0x1df1e9){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x576520[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4402b9,null))[_0xec48('0x25')](function(_0x1839b2){if(_0x1839b2){return _0x1839b2[_0xec48('0x8d')](_0x576520[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x23f53e){if(_0x23f53e){return db[_0xec48('0x5d')][_0xec48('0x24')]({'where':{'ListId':_0x576520[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x576520[_0xec48('0x44')]['id']}})[_0xec48('0x25')](function(){return _0x23f53e;});}})[_0xec48('0x25')](respondWithStatusCode(_0x4402b9,null))['catch'](handleError(_0x4402b9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 49e04f2..ff7cfa8 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x7a54,0x106));var _0x47a5=function(_0x56a8ee,_0x3b1ccd){_0x56a8ee=_0x56a8ee-0x0;var _0x813043=_0x7a54[_0x56a8ee];return _0x813043;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_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 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':'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 6a667ac..e36badf 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 _0xf958=['message','catch','Campaign','findAll','options','where','limit','map','model','include','attributes','GetCampaign','stringify','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4ecb9b,_0xb2c16b){var _0x451ffb=function(_0x377db2){while(--_0x377db2){_0x4ecb9b['push'](_0x4ecb9b['shift']());}};_0x451ffb(++_0xb2c16b);}(_0xf958,0xe6));var _0x8f95=function(_0x2aa68f,_0x809c6c){_0x2aa68f=_0x2aa68f-0x0;var _0x2a6472=_0xf958[_0x2aa68f];return _0x2a6472;};'use strict';var _=require(_0x8f95('0x0'));var util=require('util');var moment=require(_0x8f95('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x3'))['db'];var utils=require(_0x8f95('0x4'));var logger=require(_0x8f95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f95('0x6'));var client=jayson[_0x8f95('0x7')][_0x8f95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2af8,_0x5cfc04,_0x1ae9c4){return new BPromise(function(_0x109bed,_0x435b5b){return client[_0x8f95('0x9')](_0x5c2af8,_0x1ae9c4)[_0x8f95('0xa')](function(_0x585025){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5cfc04,'request\x20sent');logger[_0x8f95('0xd')](_0x8f95('0xe'),_0x5cfc04,_0x8f95('0xf'),JSON['stringify'](_0x585025));if(_0x585025[_0x8f95('0x10')]){if(_0x585025[_0x8f95('0x10')][_0x8f95('0x11')]===0x1f4){logger['error'](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x435b5b(_0x585025['error'][_0x8f95('0x12')]);}logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x109bed(_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x5cfc04,'request\x20sent');_0x109bed(_0x585025['result']['message']);}})[_0x8f95('0x13')](function(_0x2f01cd){logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x2f01cd);_0x435b5b(_0x2f01cd);});});}exports['GetCampaign']=function(_0x5da758){var _0x14d21f=this;return new Promise(function(_0x17b85b,_0x55ba7f){return db[_0x8f95('0x14')][_0x8f95('0x15')]({'raw':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')][_0x8f95('0x17')]||null:null,'attributes':_0x5da758[_0x8f95('0x16')]?_0x5da758['options']['attributes']||null:null,'limit':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')][_0x8f95('0x18')]||null:null,'include':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')]['include']?_[_0x8f95('0x19')](_0x5da758[_0x8f95('0x16')]['include'],function(_0x205c3e){return{'model':db[_0x205c3e[_0x8f95('0x1a')]],'as':_0x205c3e['as'],'attributes':_0x205c3e['attributes'],'include':_0x205c3e[_0x8f95('0x1b')]?_[_0x8f95('0x19')](_0x205c3e[_0x8f95('0x1b')],function(_0xb00b6f){return{'model':db[_0xb00b6f['model']],'as':_0xb00b6f['as'],'attributes':_0xb00b6f[_0x8f95('0x1c')],'include':_0xb00b6f['include']?_['map'](_0xb00b6f[_0x8f95('0x1b')],function(_0x5dabb6){return{'model':db[_0x5dabb6[_0x8f95('0x1a')]],'as':_0x5dabb6['as'],'attributes':_0x5dabb6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x312658){logger['info'](_0x8f95('0x1d'),_0x5da758);logger['debug'](_0x8f95('0x1d'),_0x5da758,JSON[_0x8f95('0x1e')](_0x312658));_0x17b85b(_0x312658);})[_0x8f95('0x13')](function(_0x2bb4ea){logger[_0x8f95('0x10')](_0x8f95('0x1d'),_0x2bb4ea[_0x8f95('0x12')],_0x5da758);_0x55ba7f(_0x14d21f[_0x8f95('0x10')](0x1f4,_0x2bb4ea[_0x8f95('0x12')]));});});}; \ No newline at end of file +var _0x7333=['info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'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')]('Campaign,\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')]('Campaign,\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);});});}exports[_0x3733('0x16')]=function(_0xd0f743){var _0x497600=this;return new Promise(function(_0x24a91e,_0x328490){return db[_0x3733('0x17')][_0x3733('0x18')]({'raw':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1a')]===undefined?!![]:![]:!![],'where':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')]['where']||null:null,'attributes':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1b')]||null:null,'limit':_0xd0f743['options']?_0xd0f743[_0x3733('0x19')][_0x3733('0x1c')]||null:null,'include':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1d')]?_[_0x3733('0x1e')](_0xd0f743[_0x3733('0x19')]['include'],function(_0x3187a3){return{'model':db[_0x3187a3['model']],'as':_0x3187a3['as'],'attributes':_0x3187a3[_0x3733('0x1b')],'include':_0x3187a3[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3187a3[_0x3733('0x1d')],function(_0x3f77d0){return{'model':db[_0x3f77d0[_0x3733('0x1f')]],'as':_0x3f77d0['as'],'attributes':_0x3f77d0[_0x3733('0x1b')],'include':_0x3f77d0[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3f77d0['include'],function(_0x1ce6c1){return{'model':db[_0x1ce6c1['model']],'as':_0x1ce6c1['as'],'attributes':_0x1ce6c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3733('0xb')](function(_0x12169e){logger[_0x3733('0xc')]('GetCampaign',_0xd0f743);logger[_0x3733('0x20')](_0x3733('0x16'),_0xd0f743,JSON[_0x3733('0xf')](_0x12169e));_0x24a91e(_0x12169e);})[_0x3733('0x15')](function(_0x13b66e){logger[_0x3733('0x10')](_0x3733('0x16'),_0x13b66e['message'],_0xd0f743);_0x328490(_0x497600[_0x3733('0x10')](0x1f4,_0x13b66e[_0x3733('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 84998eb..695f03a 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 _0x4c62=['removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0x4c62,0x18e));var _0x24c6=function(_0x53278c,_0x358eab){_0x53278c=_0x53278c-0x0;var _0x35ebb2=_0x4c62[_0x53278c];return _0x35ebb2;};'use strict';var multer=require(_0x24c6('0x0'));var util=require(_0x24c6('0x1'));var path=require(_0x24c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x24c6('0x3'));var router=express[_0x24c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x24c6('0x5'));var interaction=require(_0x24c6('0x6'));var config=require(_0x24c6('0x7'));var controller=require(_0x24c6('0x8'));router[_0x24c6('0x9')]('/',auth[_0x24c6('0xa')](),controller[_0x24c6('0xb')]);router['get'](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0xd')]);router['get']('/:id/hoppers',auth[_0x24c6('0xa')](),controller[_0x24c6('0xe')]);router[_0x24c6('0x9')](_0x24c6('0xf'),auth[_0x24c6('0xa')](),controller['getHopperHistories']);router[_0x24c6('0x9')]('/:id/hopper_finals',auth[_0x24c6('0xa')](),controller[_0x24c6('0x10')]);router[_0x24c6('0x9')](_0x24c6('0x11'),auth[_0x24c6('0xa')](),controller['getHopperBlacks']);router[_0x24c6('0x9')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x13')]);router[_0x24c6('0x9')](_0x24c6('0x14'),auth[_0x24c6('0xa')](),controller['getBlackLists']);router[_0x24c6('0x15')]('/',auth[_0x24c6('0xa')](),controller[_0x24c6('0x16')]);router[_0x24c6('0x15')](_0x24c6('0x17'),auth['isAuthenticated'](),controller[_0x24c6('0x18')]);router[_0x24c6('0x15')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x19')]);router[_0x24c6('0x15')](_0x24c6('0x14'),auth['isAuthenticated'](),controller[_0x24c6('0x1a')]);router['put'](_0x24c6('0xc'),auth['isAuthenticated'](),controller[_0x24c6('0x1b')]);router[_0x24c6('0x1c')](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1d')]);router[_0x24c6('0x1c')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1e')]);router['delete'](_0x24c6('0x14'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1f')]);module[_0x24c6('0x20')]=router; \ No newline at end of file +var _0xcf33=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path'];(function(_0x25fc59,_0x4711cf){var _0x3bf8c5=function(_0x4f1ea2){while(--_0x4f1ea2){_0x25fc59['push'](_0x25fc59['shift']());}};_0x3bf8c5(++_0x4711cf);}(_0xcf33,0x10d));var _0x3cf3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf33[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var timeout=require(_0x3cf3('0x3'));var express=require('express');var router=express[_0x3cf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf3('0x5'));var interaction=require(_0x3cf3('0x6'));var config=require(_0x3cf3('0x7'));var controller=require('./campaign.controller');router[_0x3cf3('0x8')]('/',auth[_0x3cf3('0x9')](),controller['index']);router[_0x3cf3('0x8')](_0x3cf3('0xa'),auth['isAuthenticated'](),controller[_0x3cf3('0xb')]);router['get'](_0x3cf3('0xc'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xd')]);router[_0x3cf3('0x8')]('/:id/hopper_histories',auth[_0x3cf3('0x9')](),controller['getHopperHistories']);router[_0x3cf3('0x8')]('/:id/hopper_finals',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xe')]);router[_0x3cf3('0x8')](_0x3cf3('0xf'),auth['isAuthenticated'](),controller[_0x3cf3('0x10')]);router['get'](_0x3cf3('0x11'),auth['isAuthenticated'](),controller[_0x3cf3('0x12')]);router[_0x3cf3('0x8')](_0x3cf3('0x13'),auth['isAuthenticated'](),controller[_0x3cf3('0x14')]);router[_0x3cf3('0x15')]('/',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x16')]);router['post'](_0x3cf3('0x17'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x18')]);router['post'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x19')]);router[_0x3cf3('0x15')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1a')]);router[_0x3cf3('0x1b')](_0x3cf3('0xa'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1c')]);router['delete']('/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1d')]);router['delete'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1e')]);router[_0x3cf3('0x1f')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x20')]);module[_0x3cf3('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d3b9dfb..7c8458d 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 _0x84c2=['VIRTUAL','getDataValue','key','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x84c2,0x1eb));var _0x284c=function(_0x42e873,_0xff4f2a){_0x42e873=_0x42e873-0x0;var _0xc90c74=_0x84c2[_0x42e873];return _0xc90c74;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x284c('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x284c('0x0')]},'name':{'type':Sequelize[_0x284c('0x1')],'get':function(){return this[_0x284c('0x2')](_0x284c('0x3'));}}}; \ No newline at end of file +var _0x8daa=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x15aadf,_0x144c83){var _0x75c612=function(_0x37bb40){while(--_0x37bb40){_0x15aadf['push'](_0x15aadf['shift']());}};_0x75c612(++_0x144c83);}(_0x8daa,0x102));var _0xa8da=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x8daa[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require(_0xa8da('0x0'));module[_0xa8da('0x1')]={'key':{'type':Sequelize[_0xa8da('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa8da('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa8da('0x4')],'get':function(){return this[_0xa8da('0x5')](_0xa8da('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index bb96097..38eb8d7 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 _0x6b98=['autoAssociation','error','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','rawAttributes','update','body','params','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId'];(function(_0x323970,_0x5bde6f){var _0x3217da=function(_0x4dcdf3){while(--_0x4dcdf3){_0x323970['push'](_0x323970['shift']());}};_0x3217da(++_0x5bde6f);}(_0x6b98,0x110));var _0x86b9=function(_0x4e9f1a,_0x35e3f3){_0x4e9f1a=_0x4e9f1a-0x0;var _0x441f20=_0x6b98[_0x4e9f1a];return _0x441f20;};'use strict';var emlformat=require(_0x86b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86b9('0x1'));var rp=require(_0x86b9('0x2'));var moment=require(_0x86b9('0x3'));var BPromise=require(_0x86b9('0x4'));var Mustache=require(_0x86b9('0x5'));var util=require('util');var path=require(_0x86b9('0x6'));var sox=require(_0x86b9('0x7'));var csv=require(_0x86b9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86b9('0x9'));var _=require('lodash');var squel=require(_0x86b9('0xa'));var crypto=require(_0x86b9('0xb'));var jsforce=require(_0x86b9('0xc'));var deskjs=require(_0x86b9('0xd'));var toCsv=require(_0x86b9('0x8'));var querystring=require(_0x86b9('0xe'));var Papa=require(_0x86b9('0xf'));var Redis=require('ioredis');var authService=require(_0x86b9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x86b9('0x11'));var hardwareService=require(_0x86b9('0x12'));var logger=require(_0x86b9('0x13'))(_0x86b9('0x14'));var utils=require(_0x86b9('0x15'));var config=require(_0x86b9('0x16'));var licenseUtil=require(_0x86b9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59cfd8,_0x2ef526){_0x2ef526=_0x2ef526||0xcc;return function(_0x213f50){if(_0x213f50){return _0x59cfd8[_0x86b9('0x18')](_0x2ef526);}return _0x59cfd8[_0x86b9('0x19')](_0x2ef526)[_0x86b9('0x1a')]();};}function respondWithResult(_0x357003,_0x590ca0){_0x590ca0=_0x590ca0||0xc8;return function(_0x82173c){if(_0x82173c){return _0x357003[_0x86b9('0x19')](_0x590ca0)['json'](_0x82173c);}};}function respondWithFilteredResult(_0x1926d4,_0x55a60d){return function(_0xfc7202){if(_0xfc7202){var _0x243e2a=typeof _0x55a60d['offset']==='undefined'&&typeof _0x55a60d['limit']===_0x86b9('0x1b');var _0x458c8c=_0xfc7202[_0x86b9('0x1c')];var _0x21f44d=_0x243e2a?0x0:_0x55a60d[_0x86b9('0x1d')];var _0x56e428=_0x243e2a?_0xfc7202['count']:_0x55a60d['offset']+_0x55a60d[_0x86b9('0x1e')];var _0x17ef11;if(_0x56e428>=_0x458c8c){_0x56e428=_0x458c8c;_0x17ef11=0xc8;}else{_0x17ef11=0xce;}_0x1926d4[_0x86b9('0x19')](_0x17ef11);return _0x1926d4[_0x86b9('0x1f')](_0x86b9('0x20'),_0x21f44d+'-'+_0x56e428+'/'+_0x458c8c)['json'](_0xfc7202);}return null;};}function patchUpdates(_0x7602b9){return function(_0x5c48de){try{jsonpatch[_0x86b9('0x21')](_0x5c48de,_0x7602b9,!![]);}catch(_0x34e18b){return BPromise[_0x86b9('0x22')](_0x34e18b);}return _0x5c48de[_0x86b9('0x23')]();};}function saveUpdates(_0x1f7c73,_0x587439){return function(_0x33b590){if(_0x33b590){return _0x33b590['update'](_0x1f7c73)['then'](function(_0x47140b){return _0x47140b;});}return null;};}function removeEntity(_0x49295b,_0x416a7f){return function(_0xe73706){if(_0xe73706){return _0xe73706[_0x86b9('0x24')]()[_0x86b9('0x25')](function(){var _0x56d0f7=_0xe73706[_0x86b9('0x26')]({'plain':!![]});var _0x10af5d='CannedAnswers';return db[_0x86b9('0x27')]['destroy']({'where':{'type':_0x10af5d,'resourceId':_0x56d0f7['id']}})['then'](function(){return _0xe73706;});})['then'](function(){_0x49295b[_0x86b9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x410aae,_0x40a31a){return function(_0x206eea){if(!_0x206eea){_0x410aae[_0x86b9('0x18')](0x194);}return _0x206eea;};}function handleError(_0x20ee75,_0x530f2b){_0x530f2b=_0x530f2b||0x1f4;return function(_0x45ec73){logger['error'](_0x45ec73[_0x86b9('0x28')]);if(_0x45ec73[_0x86b9('0x29')]){delete _0x45ec73[_0x86b9('0x29')];}_0x20ee75[_0x86b9('0x19')](_0x530f2b)[_0x86b9('0x2a')](_0x45ec73);};}exports['index']=function(_0x29396a,_0x4b5feb){var _0xd80aab={},_0x59a69e={},_0x3ceaa9={'count':0x0,'rows':[]};var _0x3742c4=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x4f2abd){return{'name':_0x4f2abd[_0x86b9('0x2b')],'type':_0x4f2abd[_0x86b9('0x2c')][_0x86b9('0x2d')]};});_0x59a69e[_0x86b9('0x2e')]=_[_0x86b9('0x2f')](_0x3742c4,_0x86b9('0x29'));_0x59a69e['query']=_[_0x86b9('0x30')](_0x29396a[_0x86b9('0x31')]);_0x59a69e[_0x86b9('0x32')]=_[_0x86b9('0x33')](_0x59a69e['model'],_0x59a69e['query']);_0xd80aab[_0x86b9('0x34')]=_[_0x86b9('0x33')](_0x59a69e[_0x86b9('0x2e')],qs[_0x86b9('0x35')](_0x29396a['query'][_0x86b9('0x35')]));_0xd80aab['attributes']=_0xd80aab['attributes'][_0x86b9('0x36')]?_0xd80aab['attributes']:_0x59a69e[_0x86b9('0x2e')];if(!_0x29396a['query'][_0x86b9('0x37')](_0x86b9('0x38'))){_0xd80aab[_0x86b9('0x1e')]=qs[_0x86b9('0x1e')](_0x29396a[_0x86b9('0x31')][_0x86b9('0x1e')]);_0xd80aab[_0x86b9('0x1d')]=qs[_0x86b9('0x1d')](_0x29396a['query'][_0x86b9('0x1d')]);}_0xd80aab[_0x86b9('0x39')]=qs[_0x86b9('0x3a')](_0x29396a[_0x86b9('0x31')][_0x86b9('0x3a')]);_0xd80aab[_0x86b9('0x3b')]=qs['filters'](_[_0x86b9('0x3c')](_0x29396a[_0x86b9('0x31')],_0x59a69e['filters']),_0x3742c4);if(_0x29396a[_0x86b9('0x31')]['filter']){_0xd80aab[_0x86b9('0x3b')]=_[_0x86b9('0x3d')](_0xd80aab[_0x86b9('0x3b')],{'$or':[{'key':{'$like':'%'+_0x29396a[_0x86b9('0x31')][_0x86b9('0x3e')]+'%'}},{'value':{'$like':'%'+_0x29396a['query'][_0x86b9('0x3e')]+'%'}}]});}_0xd80aab=_[_0x86b9('0x3d')]({},_0xd80aab,_0x29396a[_0x86b9('0x3f')]);var _0x2d62aa={'where':_0xd80aab[_0x86b9('0x3b')]};return db[_0x86b9('0x40')]['count'](_0x2d62aa)['then'](function(_0xcfc673){_0x3ceaa9[_0x86b9('0x1c')]=_0xcfc673;if(_0x29396a['query'][_0x86b9('0x41')]){_0xd80aab[_0x86b9('0x42')]=[{'all':!![]}];}return db[_0x86b9('0x40')][_0x86b9('0x43')](_0xd80aab);})[_0x86b9('0x25')](function(_0x549b9d){_0x3ceaa9[_0x86b9('0x44')]=_0x549b9d;return _0x3ceaa9;})[_0x86b9('0x25')](respondWithFilteredResult(_0x4b5feb,_0xd80aab))[_0x86b9('0x45')](handleError(_0x4b5feb,null));};exports['show']=function(_0x64f8ae,_0xa1fe18){var _0x4b152e={'raw':!![],'where':{'id':_0x64f8ae['params']['id']}},_0x1367d3={};_0x1367d3[_0x86b9('0x2e')]=_[_0x86b9('0x30')](db['CannedAnswer'][_0x86b9('0x46')]);_0x1367d3[_0x86b9('0x31')]=_[_0x86b9('0x30')](_0x64f8ae[_0x86b9('0x31')]);_0x1367d3[_0x86b9('0x32')]=_[_0x86b9('0x33')](_0x1367d3[_0x86b9('0x2e')],_0x1367d3[_0x86b9('0x31')]);_0x4b152e[_0x86b9('0x34')]=_[_0x86b9('0x33')](_0x1367d3[_0x86b9('0x2e')],qs[_0x86b9('0x35')](_0x64f8ae[_0x86b9('0x31')][_0x86b9('0x35')]));_0x4b152e['attributes']=_0x4b152e['attributes'][_0x86b9('0x36')]?_0x4b152e[_0x86b9('0x34')]:_0x1367d3[_0x86b9('0x2e')];if(_0x64f8ae[_0x86b9('0x31')]['includeAll']){_0x4b152e[_0x86b9('0x42')]=[{'all':!![]}];}_0x4b152e=_[_0x86b9('0x3d')]({},_0x4b152e,_0x64f8ae[_0x86b9('0x3f')]);return db['CannedAnswer']['find'](_0x4b152e)[_0x86b9('0x25')](handleEntityNotFound(_0xa1fe18,null))['then'](respondWithResult(_0xa1fe18,null))[_0x86b9('0x45')](handleError(_0xa1fe18,null));};exports[_0x86b9('0x47')]=function(_0x17747c,_0xfed46a){if(_0x17747c[_0x86b9('0x48')]['id']){delete _0x17747c[_0x86b9('0x48')]['id'];}return db[_0x86b9('0x40')]['find']({'where':{'id':_0x17747c[_0x86b9('0x49')]['id']}})[_0x86b9('0x25')](handleEntityNotFound(_0xfed46a,null))[_0x86b9('0x25')](saveUpdates(_0x17747c[_0x86b9('0x48')],null))['then'](respondWithResult(_0xfed46a,null))['catch'](handleError(_0xfed46a,null));};exports['destroy']=function(_0x471974,_0x1f6f08){return db[_0x86b9('0x40')][_0x86b9('0x4a')]({'where':{'id':_0x471974[_0x86b9('0x49')]['id']}})[_0x86b9('0x25')](handleEntityNotFound(_0x1f6f08,null))[_0x86b9('0x25')](removeEntity(_0x1f6f08,null))[_0x86b9('0x45')](handleError(_0x1f6f08,null));};exports[_0x86b9('0x4b')]=function(_0x10f819,_0x51d51e){var _0x5ee328={'key':_0x10f819[_0x86b9('0x48')][_0x86b9('0x2d')]};if(_0x10f819[_0x86b9('0x48')][_0x86b9('0x4c')]){_0x5ee328[_0x86b9('0x4c')]=_0x10f819['body'][_0x86b9('0x4c')];}else if(_0x10f819[_0x86b9('0x48')]['SmsAccountId']){_0x5ee328['SmsAccountId']=_0x10f819['body'][_0x86b9('0x4d')];}else if(_0x10f819['body'][_0x86b9('0x4e')]){_0x5ee328[_0x86b9('0x4e')]=_0x10f819[_0x86b9('0x48')][_0x86b9('0x4e')];}else if(_0x10f819[_0x86b9('0x48')][_0x86b9('0x4f')]){_0x5ee328['ChatWebsiteId']=_0x10f819[_0x86b9('0x48')][_0x86b9('0x4f')];}return db[_0x86b9('0x40')][_0x86b9('0x4a')]({'where':_0x5ee328})[_0x86b9('0x25')](function(_0x2d3880){if(_0x2d3880){throw new db[(_0x86b9('0x50'))][(_0x86b9('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x86b9('0x40')][_0x86b9('0x4b')](_0x10f819['body']);})[_0x86b9('0x25')](function(_0x60891){var _0x56bbd0=_0x10f819[_0x86b9('0x52')][_0x86b9('0x26')]({'plain':!![]});if(!_0x56bbd0)throw new Error(_0x86b9('0x53'));if(_0x56bbd0[_0x86b9('0x54')]===_0x86b9('0x52')){var _0x1392ba=_0x60891['get']({'plain':!![]});return db[_0x86b9('0x55')]['find']({'where':{'name':_0x86b9('0x56'),'userProfileId':_0x56bbd0[_0x86b9('0x57')]},'raw':!![]})[_0x86b9('0x25')](function(_0x5636d6){if(_0x5636d6&&_0x5636d6[_0x86b9('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x1392ba[_0x86b9('0x29')],'resourceId':_0x1392ba['id'],'type':_0x5636d6[_0x86b9('0x29')],'sectionId':_0x5636d6['id']},{})['then'](function(){return _0x60891;});}else{return _0x60891;}})[_0x86b9('0x45')](function(_0x2142a3){logger[_0x86b9('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2142a3);throw _0x2142a3;});}return _0x60891;})['then'](respondWithResult(_0x51d51e,0xc9))[_0x86b9('0x45')](handleError(_0x51d51e,null));}; \ No newline at end of file +var _0x7d2d=['fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','body','find','params','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x51d3a8,_0x207ca2){var _0x53dbec=function(_0x312150){while(--_0x312150){_0x51d3a8['push'](_0x51d3a8['shift']());}};_0x53dbec(++_0x207ca2);}(_0x7d2d,0x7c));var _0xd7d2=function(_0x3047b4,_0x13059d){_0x3047b4=_0x3047b4-0x0;var _0x1ba017=_0x7d2d[_0x3047b4];return _0x1ba017;};'use strict';var emlformat=require(_0xd7d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd7d2('0x1'));var rp=require(_0xd7d2('0x2'));var moment=require(_0xd7d2('0x3'));var BPromise=require(_0xd7d2('0x4'));var Mustache=require(_0xd7d2('0x5'));var util=require(_0xd7d2('0x6'));var path=require(_0xd7d2('0x7'));var sox=require(_0xd7d2('0x8'));var csv=require(_0xd7d2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7d2('0xa'));var squel=require('squel');var crypto=require(_0xd7d2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd7d2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd7d2('0xe'));var qs=require(_0xd7d2('0xf'));var as=require(_0xd7d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7d2('0x11'));var utils=require(_0xd7d2('0x12'));var config=require(_0xd7d2('0x13'));var licenseUtil=require(_0xd7d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc631e9,_0x55f25e){_0x55f25e=_0x55f25e||0xcc;return function(_0x9c5077){if(_0x9c5077){return _0xc631e9[_0xd7d2('0x15')](_0x55f25e);}return _0xc631e9['status'](_0x55f25e)[_0xd7d2('0x16')]();};}function respondWithResult(_0x1a7f59,_0x44d976){_0x44d976=_0x44d976||0xc8;return function(_0x5df645){if(_0x5df645){return _0x1a7f59[_0xd7d2('0x17')](_0x44d976)[_0xd7d2('0x18')](_0x5df645);}};}function respondWithFilteredResult(_0x4f8701,_0x4a6d25){return function(_0x14d029){if(_0x14d029){var _0x29eb39=typeof _0x4a6d25[_0xd7d2('0x19')]===_0xd7d2('0x1a')&&typeof _0x4a6d25['limit']===_0xd7d2('0x1a');var _0x20fb9d=_0x14d029[_0xd7d2('0x1b')];var _0x207161=_0x29eb39?0x0:_0x4a6d25[_0xd7d2('0x19')];var _0x342cac=_0x29eb39?_0x14d029[_0xd7d2('0x1b')]:_0x4a6d25[_0xd7d2('0x19')]+_0x4a6d25[_0xd7d2('0x1c')];var _0xf9786b;if(_0x342cac>=_0x20fb9d){_0x342cac=_0x20fb9d;_0xf9786b=0xc8;}else{_0xf9786b=0xce;}_0x4f8701[_0xd7d2('0x17')](_0xf9786b);return _0x4f8701[_0xd7d2('0x1d')](_0xd7d2('0x1e'),_0x207161+'-'+_0x342cac+'/'+_0x20fb9d)[_0xd7d2('0x18')](_0x14d029);}return null;};}function patchUpdates(_0x41bfce){return function(_0x30b893){try{jsonpatch[_0xd7d2('0x1f')](_0x30b893,_0x41bfce,!![]);}catch(_0x316a9f){return BPromise[_0xd7d2('0x20')](_0x316a9f);}return _0x30b893['save']();};}function saveUpdates(_0xcd699f,_0x2e19d0){return function(_0x348fb5){if(_0x348fb5){return _0x348fb5[_0xd7d2('0x21')](_0xcd699f)[_0xd7d2('0x22')](function(_0x260e79){return _0x260e79;});}return null;};}function removeEntity(_0x4a50e6,_0x415c9b){return function(_0x394724){if(_0x394724){return _0x394724[_0xd7d2('0x23')]()[_0xd7d2('0x22')](function(){var _0x4703d9=_0x394724['get']({'plain':!![]});var _0x1c8b86=_0xd7d2('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c8b86,'resourceId':_0x4703d9['id']}})[_0xd7d2('0x22')](function(){return _0x394724;});})[_0xd7d2('0x22')](function(){_0x4a50e6[_0xd7d2('0x17')](0xcc)[_0xd7d2('0x16')]();});}};}function handleEntityNotFound(_0x8aa2da,_0x2718af){return function(_0x3dda3e){if(!_0x3dda3e){_0x8aa2da['sendStatus'](0x194);}return _0x3dda3e;};}function handleError(_0x1b4933,_0x16446a){_0x16446a=_0x16446a||0x1f4;return function(_0x429bde){logger[_0xd7d2('0x25')](_0x429bde['stack']);if(_0x429bde[_0xd7d2('0x26')]){delete _0x429bde[_0xd7d2('0x26')];}_0x1b4933['status'](_0x16446a)[_0xd7d2('0x27')](_0x429bde);};}exports[_0xd7d2('0x28')]=function(_0x2c7eee,_0x4df677){var _0x2e828f={},_0x2a0594={},_0x503f0e={'count':0x0,'rows':[]};var _0x32dff5=_[_0xd7d2('0x29')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')],function(_0x440f63){return{'name':_0x440f63[_0xd7d2('0x2c')],'type':_0x440f63[_0xd7d2('0x2d')][_0xd7d2('0x2e')]};});_0x2a0594[_0xd7d2('0x2f')]=_[_0xd7d2('0x29')](_0x32dff5,'name');_0x2a0594[_0xd7d2('0x30')]=_['keys'](_0x2c7eee[_0xd7d2('0x30')]);_0x2a0594[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x2a0594[_0xd7d2('0x2f')],_0x2a0594[_0xd7d2('0x30')]);_0x2e828f['attributes']=_[_0xd7d2('0x32')](_0x2a0594['model'],qs[_0xd7d2('0x33')](_0x2c7eee[_0xd7d2('0x30')]['fields']));_0x2e828f[_0xd7d2('0x34')]=_0x2e828f[_0xd7d2('0x34')]['length']?_0x2e828f[_0xd7d2('0x34')]:_0x2a0594[_0xd7d2('0x2f')];if(!_0x2c7eee['query'][_0xd7d2('0x35')](_0xd7d2('0x36'))){_0x2e828f[_0xd7d2('0x1c')]=qs['limit'](_0x2c7eee['query'][_0xd7d2('0x1c')]);_0x2e828f[_0xd7d2('0x19')]=qs[_0xd7d2('0x19')](_0x2c7eee[_0xd7d2('0x30')]['offset']);}_0x2e828f[_0xd7d2('0x37')]=qs[_0xd7d2('0x38')](_0x2c7eee['query'][_0xd7d2('0x38')]);_0x2e828f[_0xd7d2('0x39')]=qs['filters'](_[_0xd7d2('0x3a')](_0x2c7eee[_0xd7d2('0x30')],_0x2a0594[_0xd7d2('0x31')]),_0x32dff5);if(_0x2c7eee['query'][_0xd7d2('0x3b')]){_0x2e828f[_0xd7d2('0x39')]=_['merge'](_0x2e828f[_0xd7d2('0x39')],{'$or':[{'key':{'$like':'%'+_0x2c7eee['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3b')]+'%'}}]});}_0x2e828f=_[_0xd7d2('0x3c')]({},_0x2e828f,_0x2c7eee[_0xd7d2('0x3d')]);var _0x25cbd3={'where':_0x2e828f[_0xd7d2('0x39')]};return db[_0xd7d2('0x2a')][_0xd7d2('0x1b')](_0x25cbd3)[_0xd7d2('0x22')](function(_0x2fcc23){_0x503f0e[_0xd7d2('0x1b')]=_0x2fcc23;if(_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3e')]){_0x2e828f[_0xd7d2('0x3f')]=[{'all':!![]}];}return db[_0xd7d2('0x2a')][_0xd7d2('0x40')](_0x2e828f);})[_0xd7d2('0x22')](function(_0x259855){_0x503f0e[_0xd7d2('0x41')]=_0x259855;return _0x503f0e;})[_0xd7d2('0x22')](respondWithFilteredResult(_0x4df677,_0x2e828f))[_0xd7d2('0x42')](handleError(_0x4df677,null));};exports[_0xd7d2('0x43')]=function(_0x5adc4b,_0x30f2d5){var _0x5721e6={'raw':!![],'where':{'id':_0x5adc4b['params']['id']}},_0x3115b9={};_0x3115b9['model']=_[_0xd7d2('0x44')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')]);_0x3115b9[_0xd7d2('0x30')]=_[_0xd7d2('0x44')](_0x5adc4b[_0xd7d2('0x30')]);_0x3115b9[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x3115b9[_0xd7d2('0x2f')],_0x3115b9[_0xd7d2('0x30')]);_0x5721e6[_0xd7d2('0x34')]=_['intersection'](_0x3115b9[_0xd7d2('0x2f')],qs['fields'](_0x5adc4b[_0xd7d2('0x30')][_0xd7d2('0x33')]));_0x5721e6[_0xd7d2('0x34')]=_0x5721e6[_0xd7d2('0x34')]['length']?_0x5721e6['attributes']:_0x3115b9[_0xd7d2('0x2f')];if(_0x5adc4b[_0xd7d2('0x30')]['includeAll']){_0x5721e6[_0xd7d2('0x3f')]=[{'all':!![]}];}_0x5721e6=_[_0xd7d2('0x3c')]({},_0x5721e6,_0x5adc4b[_0xd7d2('0x3d')]);return db['CannedAnswer']['find'](_0x5721e6)[_0xd7d2('0x22')](handleEntityNotFound(_0x30f2d5,null))[_0xd7d2('0x22')](respondWithResult(_0x30f2d5,null))['catch'](handleError(_0x30f2d5,null));};exports['update']=function(_0x31fe3f,_0x3b344c){if(_0x31fe3f['body']['id']){delete _0x31fe3f[_0xd7d2('0x45')]['id'];}return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x31fe3f[_0xd7d2('0x47')]['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x3b344c,null))[_0xd7d2('0x22')](saveUpdates(_0x31fe3f[_0xd7d2('0x45')],null))['then'](respondWithResult(_0x3b344c,null))[_0xd7d2('0x42')](handleError(_0x3b344c,null));};exports[_0xd7d2('0x23')]=function(_0x57085a,_0x20ecd7){return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x57085a['params']['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x20ecd7,null))[_0xd7d2('0x22')](removeEntity(_0x20ecd7,null))['catch'](handleError(_0x20ecd7,null));};exports[_0xd7d2('0x48')]=function(_0x400851,_0x4e9693){var _0x35dc01={'key':_0x400851['body'][_0xd7d2('0x2e')]};if(_0x400851[_0xd7d2('0x45')]['MailAccountId']){_0x35dc01['MailAccountId']=_0x400851[_0xd7d2('0x45')]['MailAccountId'];}else if(_0x400851['body']['SmsAccountId']){_0x35dc01[_0xd7d2('0x49')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x49')];}else if(_0x400851['body'][_0xd7d2('0x4a')]){_0x35dc01[_0xd7d2('0x4a')]=_0x400851['body'][_0xd7d2('0x4a')];}else if(_0x400851['body']['ChatWebsiteId']){_0x35dc01[_0xd7d2('0x4b')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x4b')];}return db[_0xd7d2('0x2a')]['find']({'where':_0x35dc01})[_0xd7d2('0x22')](function(_0x4bbc09){if(_0x4bbc09){throw new db[(_0xd7d2('0x4c'))][(_0xd7d2('0x4d'))](_0xd7d2('0x4e'));}return db[_0xd7d2('0x2a')][_0xd7d2('0x48')](_0x400851[_0xd7d2('0x45')]);})['then'](function(_0x57c42a){var _0x5aad93=_0x400851['user']['get']({'plain':!![]});if(!_0x5aad93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aad93['role']===_0xd7d2('0x4f')){var _0x15e954=_0x57c42a['get']({'plain':!![]});return db[_0xd7d2('0x50')]['find']({'where':{'name':_0xd7d2('0x24'),'userProfileId':_0x5aad93['userProfileId']},'raw':!![]})[_0xd7d2('0x22')](function(_0x2ee5ce){if(_0x2ee5ce&&_0x2ee5ce[_0xd7d2('0x51')]===0x0){return db[_0xd7d2('0x52')][_0xd7d2('0x48')]({'name':_0x15e954[_0xd7d2('0x26')],'resourceId':_0x15e954['id'],'type':_0x2ee5ce[_0xd7d2('0x26')],'sectionId':_0x2ee5ce['id']},{})[_0xd7d2('0x22')](function(){return _0x57c42a;});}else{return _0x57c42a;}})[_0xd7d2('0x42')](function(_0x562d15){logger[_0xd7d2('0x25')](_0xd7d2('0x53'),_0x562d15);throw _0x562d15;});}return _0x57c42a;})['then'](respondWithResult(_0x4e9693,0xc9))[_0xd7d2('0x42')](handleError(_0x4e9693,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b1e7d7c..94e13ed 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 _0x3354=['utf8mb4','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x5ca7dd,_0x31cff4){var _0x44aa57=function(_0x106f69){while(--_0x106f69){_0x5ca7dd['push'](_0x5ca7dd['shift']());}};_0x44aa57(++_0x31cff4);}(_0x3354,0x189));var _0x4335=function(_0x3297a3,_0x220dc1){_0x3297a3=_0x3297a3-0x0;var _0x5aa51f=_0x3354[_0x3297a3];return _0x5aa51f;};'use strict';var _=require(_0x4335('0x0'));var util=require(_0x4335('0x1'));var logger=require('../../config/logger')(_0x4335('0x2'));var moment=require(_0x4335('0x3'));var BPromise=require(_0x4335('0x4'));var rp=require(_0x4335('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4335('0x6'));var config=require(_0x4335('0x7'));var attributes=require(_0x4335('0x8'));module[_0x4335('0x9')]=function(_0x1facac,_0x46ec7b){return _0x1facac[_0x4335('0xa')](_0x4335('0xb'),attributes,{'tableName':_0x4335('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4335('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3fc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers'];(function(_0x3bf56d,_0xa0b1f1){var _0x518c54=function(_0x4ec245){while(--_0x4ec245){_0x3bf56d['push'](_0x3bf56d['shift']());}};_0x518c54(++_0xa0b1f1);}(_0x3fc3,0x110));var _0x33fc=function(_0x1c65ab,_0x31bd2f){_0x1c65ab=_0x1c65ab-0x0;var _0x2eaafb=_0x3fc3[_0x1c65ab];return _0x2eaafb;};'use strict';var _=require(_0x33fc('0x0'));var util=require(_0x33fc('0x1'));var logger=require(_0x33fc('0x2'))(_0x33fc('0x3'));var moment=require(_0x33fc('0x4'));var BPromise=require(_0x33fc('0x5'));var rp=require(_0x33fc('0x6'));var fs=require('fs');var path=require(_0x33fc('0x7'));var rimraf=require(_0x33fc('0x8'));var config=require(_0x33fc('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x33fc('0xa')]=function(_0x491a41,_0x5a4627){return _0x491a41['define'](_0x33fc('0xb'),attributes,{'tableName':_0x33fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33fc('0xd'),'collate':_0x33fc('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 40db582..63c784b 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 _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x271ec9,_0xefbaf){var _0x2b153a=function(_0x3c5e3c){while(--_0x3c5e3c){_0x271ec9['push'](_0x271ec9['shift']());}};_0x2b153a(++_0xefbaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x4adbd8,_0x655861){var _0x22b303=function(_0x22af66){while(--_0x22af66){_0x4adbd8['push'](_0x4adbd8['shift']());}};_0x22b303(++_0x655861);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 1c04a61..6c958ac 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 _0xcc49=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x3e4924,_0x3c25b0){var _0x724fe5=function(_0x29aeba){while(--_0x29aeba){_0x3e4924['push'](_0x3e4924['shift']());}};_0x724fe5(++_0x3c25b0);}(_0xcc49,0x84));var _0x9cc4=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xcc49[_0x5aef17];return _0x43f9d0;};'use strict';var multer=require(_0x9cc4('0x0'));var util=require(_0x9cc4('0x1'));var path=require(_0x9cc4('0x2'));var timeout=require(_0x9cc4('0x3'));var express=require(_0x9cc4('0x4'));var router=express['Router']();var fs_extra=require(_0x9cc4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9cc4('0x6'));var controller=require(_0x9cc4('0x7'));router[_0x9cc4('0x8')]('/',auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xa')]);router[_0x9cc4('0x8')](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xc')]);router[_0x9cc4('0xd')]('/',auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xe')]);router[_0x9cc4('0xf')](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0x10')]);router['delete'](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x420c=['index','isAuthenticated','show','create','/:id','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x1fff7d,_0xe8b9a){var _0x2996e0=function(_0x223f54){while(--_0x223f54){_0x1fff7d['push'](_0x1fff7d['shift']());}};_0x2996e0(++_0xe8b9a);}(_0x420c,0xd7));var _0xc420=function(_0xc5837d,_0x27cda1){_0xc5837d=_0xc5837d-0x0;var _0x59ccd4=_0x420c[_0xc5837d];return _0x59ccd4;};'use strict';var multer=require('multer');var util=require(_0xc420('0x0'));var path=require(_0xc420('0x1'));var timeout=require(_0xc420('0x2'));var express=require('express');var router=express[_0xc420('0x3')]();var fs_extra=require(_0xc420('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc420('0x5'));var config=require(_0xc420('0x6'));var controller=require(_0xc420('0x7'));router[_0xc420('0x8')]('/',auth['isAuthenticated'](),controller[_0xc420('0x9')]);router[_0xc420('0x8')]('/:id',auth[_0xc420('0xa')](),controller[_0xc420('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc420('0xc')]);router['put'](_0xc420('0xd'),auth[_0xc420('0xa')](),controller[_0xc420('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc420('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a011708..c70a624 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 _0xfe57=['INTEGER','sequelize','exports','STRING'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0xfe57,0x195));var _0x7fe5=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xfe57[_0x146a97];return _0x259d5c;};'use strict';var Sequelize=require(_0x7fe5('0x0'));module[_0x7fe5('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7fe5('0x2')]},'src':{'type':Sequelize[_0x7fe5('0x2')]},'dst':{'type':Sequelize[_0x7fe5('0x2')]},'dcontext':{'type':Sequelize[_0x7fe5('0x2')]},'channel':{'type':Sequelize[_0x7fe5('0x2')]},'dstchannel':{'type':Sequelize[_0x7fe5('0x2')]},'lastapp':{'type':Sequelize[_0x7fe5('0x2')]},'lastdata':{'type':Sequelize[_0x7fe5('0x2')]},'duration':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7fe5('0x2')]},'amaflags':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7fe5('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7fe5('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7fe5('0x2')]},'peeraccount':{'type':Sequelize[_0x7fe5('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe5b5=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2a85f2,_0x458881){var _0x86e5a9=function(_0x44eb18){while(--_0x44eb18){_0x2a85f2['push'](_0x2a85f2['shift']());}};_0x86e5a9(++_0x458881);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xe5b5[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'calldate':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![],'defaultValue':_0x5e5b('0x3')},'clid':{'type':Sequelize[_0x5e5b('0x4')]},'src':{'type':Sequelize[_0x5e5b('0x4')]},'dst':{'type':Sequelize[_0x5e5b('0x4')]},'dcontext':{'type':Sequelize[_0x5e5b('0x4')]},'channel':{'type':Sequelize[_0x5e5b('0x4')]},'dstchannel':{'type':Sequelize[_0x5e5b('0x4')]},'lastapp':{'type':Sequelize[_0x5e5b('0x4')]},'lastdata':{'type':Sequelize[_0x5e5b('0x4')]},'duration':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e5b('0x4')]},'amaflags':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5e5b('0x4')]},'userfield':{'type':Sequelize[_0x5e5b('0x4')]},'uniqueid':{'type':Sequelize[_0x5e5b('0x4')]},'linkedid':{'type':Sequelize[_0x5e5b('0x4')]},'sequence':{'type':Sequelize[_0x5e5b('0x4')]},'peeraccount':{'type':Sequelize[_0x5e5b('0x4')]},'type':{'type':Sequelize[_0x5e5b('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 59eb17b..37736bc 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 _0xd6d2=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Cdr','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x13b4c9,_0x146baf){var _0x15a9a0=function(_0xbfe8f6){while(--_0xbfe8f6){_0x13b4c9['push'](_0x13b4c9['shift']());}};_0x15a9a0(++_0x146baf);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x374acb,_0x52f395){_0x374acb=_0x374acb-0x0;var _0x58c788=_0xd6d2[_0x374acb];return _0x58c788;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];function respondWithStatusCode(_0x2ad9fc,_0x5c4bf6){_0x5c4bf6=_0x5c4bf6||0xcc;return function(_0x5ef174){if(_0x5ef174){return _0x2ad9fc[_0x2d6d('0x1b')](_0x5c4bf6);}return _0x2ad9fc[_0x2d6d('0x1c')](_0x5c4bf6)[_0x2d6d('0x1d')]();};}function respondWithResult(_0x3528de,_0x58bd29){_0x58bd29=_0x58bd29||0xc8;return function(_0x1ec6aa){if(_0x1ec6aa){return _0x3528de[_0x2d6d('0x1c')](_0x58bd29)['json'](_0x1ec6aa);}};}function respondWithFilteredResult(_0x586085,_0x370096){return function(_0x17340f){if(_0x17340f){var _0x109b49=typeof _0x370096['offset']===_0x2d6d('0x1e')&&typeof _0x370096['limit']==='undefined';var _0x4c3092=_0x17340f[_0x2d6d('0x1f')];var _0x4179f2=_0x109b49?0x0:_0x370096[_0x2d6d('0x20')];var _0x3c527e=_0x109b49?_0x17340f[_0x2d6d('0x1f')]:_0x370096[_0x2d6d('0x20')]+_0x370096[_0x2d6d('0x21')];var _0xa2c4a7;if(_0x3c527e>=_0x4c3092){_0x3c527e=_0x4c3092;_0xa2c4a7=0xc8;}else{_0xa2c4a7=0xce;}_0x586085[_0x2d6d('0x1c')](_0xa2c4a7);return _0x586085['set'](_0x2d6d('0x22'),_0x4179f2+'-'+_0x3c527e+'/'+_0x4c3092)[_0x2d6d('0x23')](_0x17340f);}return null;};}function patchUpdates(_0x5b0c61){return function(_0x227e44){try{jsonpatch[_0x2d6d('0x24')](_0x227e44,_0x5b0c61,!![]);}catch(_0x15cb80){return BPromise[_0x2d6d('0x25')](_0x15cb80);}return _0x227e44[_0x2d6d('0x26')]();};}function saveUpdates(_0x59234a,_0x4aaa62){return function(_0x42c2f2){if(_0x42c2f2){return _0x42c2f2[_0x2d6d('0x27')](_0x59234a)[_0x2d6d('0x28')](function(_0x585b54){return _0x585b54;});}return null;};}function removeEntity(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(_0x4e7ec8){return _0x4e7ec8['destroy']()['then'](function(){_0x47eb0e[_0x2d6d('0x1c')](0xcc)[_0x2d6d('0x1d')]();});}};}function handleEntityNotFound(_0x3da83d,_0x3f89dd){return function(_0x3e5a92){if(!_0x3e5a92){_0x3da83d['sendStatus'](0x194);}return _0x3e5a92;};}function handleError(_0x16634d,_0x1b4964){_0x1b4964=_0x1b4964||0x1f4;return function(_0x455e71){logger[_0x2d6d('0x29')](_0x455e71[_0x2d6d('0x2a')]);if(_0x455e71[_0x2d6d('0x2b')]){delete _0x455e71[_0x2d6d('0x2b')];}_0x16634d[_0x2d6d('0x1c')](_0x1b4964)[_0x2d6d('0x2c')](_0x455e71);};}exports['index']=function(_0x1016e1,_0x26d299){var _0x2e7b32={},_0x34d485={},_0x486963={'count':0x0,'rows':[]};var _0x317bde=_['map'](db[_0x2d6d('0x2d')]['rawAttributes'],function(_0x58bfc7){return{'name':_0x58bfc7[_0x2d6d('0x2e')],'type':_0x58bfc7['type'][_0x2d6d('0x2f')]};});_0x34d485[_0x2d6d('0x30')]=_['map'](_0x317bde,_0x2d6d('0x2b'));_0x34d485['query']=_[_0x2d6d('0x31')](_0x1016e1[_0x2d6d('0x32')]);_0x34d485[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x34d485[_0x2d6d('0x30')],_0x34d485[_0x2d6d('0x32')]);_0x2e7b32[_0x2d6d('0x35')]=_[_0x2d6d('0x34')](_0x34d485['model'],qs[_0x2d6d('0x36')](_0x1016e1[_0x2d6d('0x32')]['fields']));_0x2e7b32[_0x2d6d('0x35')]=_0x2e7b32[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x2e7b32[_0x2d6d('0x35')]:_0x34d485[_0x2d6d('0x30')];if(!_0x1016e1['query']['hasOwnProperty']('nolimit')){_0x2e7b32[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x1016e1[_0x2d6d('0x32')]['limit']);_0x2e7b32[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x20')]);}_0x2e7b32['order']=qs[_0x2d6d('0x38')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x2e7b32[_0x2d6d('0x39')]=qs[_0x2d6d('0x33')](_[_0x2d6d('0x3a')](_0x1016e1[_0x2d6d('0x32')],_0x34d485['filters']),_0x317bde);if(_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]){_0x2e7b32[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x2e7b32[_0x2d6d('0x39')],{'$or':_['map'](_0x317bde,function(_0x1cad57){if(_0x1cad57[_0x2d6d('0x3d')]!==_0x2d6d('0x3e')){var _0x4616df={};_0x4616df[_0x1cad57[_0x2d6d('0x2b')]]={'$like':'%'+_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x4616df;}})});}_0x2e7b32=_[_0x2d6d('0x3c')]({},_0x2e7b32,_0x1016e1[_0x2d6d('0x3f')]);var _0x38cce8={'where':_0x2e7b32[_0x2d6d('0x39')]};return db[_0x2d6d('0x2d')][_0x2d6d('0x1f')](_0x38cce8)[_0x2d6d('0x28')](function(_0x34fc23){_0x486963[_0x2d6d('0x1f')]=_0x34fc23;if(_0x1016e1[_0x2d6d('0x32')]['includeAll']){_0x2e7b32[_0x2d6d('0x40')]=[{'all':!![]}];}return db[_0x2d6d('0x2d')][_0x2d6d('0x41')](_0x2e7b32);})[_0x2d6d('0x28')](function(_0x246d6e){_0x486963['rows']=_0x246d6e;return _0x486963;})[_0x2d6d('0x28')](respondWithFilteredResult(_0x26d299,_0x2e7b32))[_0x2d6d('0x42')](handleError(_0x26d299,null));};exports[_0x2d6d('0x43')]=function(_0x41ab2e,_0x543b4b){var _0x3b62b1={'raw':!![],'where':{'id':_0x41ab2e[_0x2d6d('0x44')]['id']}},_0x7f76ad={};_0x7f76ad[_0x2d6d('0x30')]=_[_0x2d6d('0x31')](db['Cdr'][_0x2d6d('0x45')]);_0x7f76ad[_0x2d6d('0x32')]=_['keys'](_0x41ab2e[_0x2d6d('0x32')]);_0x7f76ad[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x7f76ad['model'],_0x7f76ad[_0x2d6d('0x32')]);_0x3b62b1[_0x2d6d('0x35')]=_['intersection'](_0x7f76ad['model'],qs['fields'](_0x41ab2e[_0x2d6d('0x32')][_0x2d6d('0x36')]));_0x3b62b1['attributes']=_0x3b62b1[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x3b62b1[_0x2d6d('0x35')]:_0x7f76ad[_0x2d6d('0x30')];if(_0x41ab2e['query'][_0x2d6d('0x46')]){_0x3b62b1[_0x2d6d('0x40')]=[{'all':!![]}];}_0x3b62b1=_['merge']({},_0x3b62b1,_0x41ab2e[_0x2d6d('0x3f')]);return db[_0x2d6d('0x2d')][_0x2d6d('0x47')](_0x3b62b1)[_0x2d6d('0x28')](handleEntityNotFound(_0x543b4b,null))[_0x2d6d('0x28')](respondWithResult(_0x543b4b,null))[_0x2d6d('0x42')](handleError(_0x543b4b,null));};exports[_0x2d6d('0x48')]=function(_0x5ac5e9,_0xe6b038){return db[_0x2d6d('0x2d')][_0x2d6d('0x48')](_0x5ac5e9['body'],{})['then'](respondWithResult(_0xe6b038,0xc9))[_0x2d6d('0x42')](handleError(_0xe6b038,null));};exports[_0x2d6d('0x27')]=function(_0x422198,_0x4e5203){if(_0x422198[_0x2d6d('0x49')]['id']){delete _0x422198[_0x2d6d('0x49')]['id'];}return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x422198[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x4e5203,null))[_0x2d6d('0x28')](saveUpdates(_0x422198[_0x2d6d('0x49')],null))[_0x2d6d('0x28')](respondWithResult(_0x4e5203,null))[_0x2d6d('0x42')](handleError(_0x4e5203,null));};exports[_0x2d6d('0x4a')]=function(_0x42c125,_0x1ca9a2){return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x42c125[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x1ca9a2,null))['then'](removeEntity(_0x1ca9a2,null))[_0x2d6d('0x42')](handleError(_0x1ca9a2,null));};exports[_0x2d6d('0x4b')]=function(_0x3738b3,_0x2dbcdc){return db[_0x2d6d('0x2d')][_0x2d6d('0x4b')]()[_0x2d6d('0x28')](respondWithResult(_0x2dbcdc,null))['catch'](handleError(_0x2dbcdc,null));}; \ No newline at end of file +var _0x4873=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Cdr','catch','show','model','fields','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4873,0x1df));var _0x3487=function(_0xef2e27,_0x5ce104){_0xef2e27=_0xef2e27-0x0;var _0x1afb9b=_0x4873[_0xef2e27];return _0x1afb9b;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3487('0x4'));var util=require(_0x3487('0x5'));var path=require(_0x3487('0x6'));var sox=require(_0x3487('0x7'));var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require(_0x3487('0xb'));var squel=require('squel');var crypto=require(_0x3487('0xc'));var jsforce=require(_0x3487('0xd'));var deskjs=require(_0x3487('0xe'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xf'));var Papa=require('papaparse');var Redis=require(_0x3487('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3487('0x13'));var utils=require(_0x3487('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3487('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557d64,_0x395774){_0x395774=_0x395774||0xcc;return function(_0x1be2e0){if(_0x1be2e0){return _0x557d64[_0x3487('0x16')](_0x395774);}return _0x557d64[_0x3487('0x17')](_0x395774)[_0x3487('0x18')]();};}function respondWithResult(_0x1e468b,_0x4fbd63){_0x4fbd63=_0x4fbd63||0xc8;return function(_0x23ce3b){if(_0x23ce3b){return _0x1e468b[_0x3487('0x17')](_0x4fbd63)[_0x3487('0x19')](_0x23ce3b);}};}function respondWithFilteredResult(_0x4f79f0,_0x156e80){return function(_0x1b19c4){if(_0x1b19c4){var _0x38c0c1=typeof _0x156e80[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x156e80[_0x3487('0x1c')]===_0x3487('0x1b');var _0x32ecde=_0x1b19c4[_0x3487('0x1d')];var _0x2fa630=_0x38c0c1?0x0:_0x156e80[_0x3487('0x1a')];var _0x41795b=_0x38c0c1?_0x1b19c4[_0x3487('0x1d')]:_0x156e80[_0x3487('0x1a')]+_0x156e80['limit'];var _0x320349;if(_0x41795b>=_0x32ecde){_0x41795b=_0x32ecde;_0x320349=0xc8;}else{_0x320349=0xce;}_0x4f79f0['status'](_0x320349);return _0x4f79f0[_0x3487('0x1e')](_0x3487('0x1f'),_0x2fa630+'-'+_0x41795b+'/'+_0x32ecde)[_0x3487('0x19')](_0x1b19c4);}return null;};}function patchUpdates(_0x29546f){return function(_0xd788f8){try{jsonpatch[_0x3487('0x20')](_0xd788f8,_0x29546f,!![]);}catch(_0x479354){return BPromise[_0x3487('0x21')](_0x479354);}return _0xd788f8[_0x3487('0x22')]();};}function saveUpdates(_0x28f8f7,_0x97013d){return function(_0x11437c){if(_0x11437c){return _0x11437c[_0x3487('0x23')](_0x28f8f7)['then'](function(_0x384792){return _0x384792;});}return null;};}function removeEntity(_0x3e63e8,_0x25ed9f){return function(_0x482551){if(_0x482551){return _0x482551['destroy']()[_0x3487('0x24')](function(){_0x3e63e8[_0x3487('0x17')](0xcc)[_0x3487('0x18')]();});}};}function handleEntityNotFound(_0x3a9d76,_0x4c6882){return function(_0x79a183){if(!_0x79a183){_0x3a9d76[_0x3487('0x16')](0x194);}return _0x79a183;};}function handleError(_0x5484f6,_0x1e7126){_0x1e7126=_0x1e7126||0x1f4;return function(_0x3fb245){logger['error'](_0x3fb245['stack']);if(_0x3fb245[_0x3487('0x25')]){delete _0x3fb245[_0x3487('0x25')];}_0x5484f6[_0x3487('0x17')](_0x1e7126)[_0x3487('0x26')](_0x3fb245);};}exports[_0x3487('0x27')]=function(_0x1a02d6,_0x1c5bd6){var _0x38af4a={},_0x25e123={},_0x4dada9={'count':0x0,'rows':[]};var _0x24532a=_['map'](db['Cdr'][_0x3487('0x28')],function(_0x56ee54){return{'name':_0x56ee54['fieldName'],'type':_0x56ee54[_0x3487('0x29')][_0x3487('0x2a')]};});_0x25e123['model']=_['map'](_0x24532a,_0x3487('0x25'));_0x25e123[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x1a02d6['query']);_0x25e123[_0x3487('0x2d')]=_['intersection'](_0x25e123['model'],_0x25e123['query']);_0x38af4a[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x25e123['model'],qs['fields'](_0x1a02d6[_0x3487('0x2b')]['fields']));_0x38af4a['attributes']=_0x38af4a[_0x3487('0x2e')][_0x3487('0x30')]?_0x38af4a[_0x3487('0x2e')]:_0x25e123['model'];if(!_0x1a02d6[_0x3487('0x2b')][_0x3487('0x31')](_0x3487('0x32'))){_0x38af4a[_0x3487('0x1c')]=qs['limit'](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1c')]);_0x38af4a['offset']=qs[_0x3487('0x1a')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1a')]);}_0x38af4a[_0x3487('0x33')]=qs[_0x3487('0x34')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x34')]);_0x38af4a[_0x3487('0x35')]=qs[_0x3487('0x2d')](_['pick'](_0x1a02d6[_0x3487('0x2b')],_0x25e123[_0x3487('0x2d')]),_0x24532a);if(_0x1a02d6['query']['filter']){_0x38af4a[_0x3487('0x35')]=_[_0x3487('0x36')](_0x38af4a[_0x3487('0x35')],{'$or':_['map'](_0x24532a,function(_0x58006c){if(_0x58006c['type']!==_0x3487('0x37')){var _0x268674={};_0x268674[_0x58006c['name']]={'$like':'%'+_0x1a02d6[_0x3487('0x2b')][_0x3487('0x38')]+'%'};return _0x268674;}})});}_0x38af4a=_[_0x3487('0x36')]({},_0x38af4a,_0x1a02d6[_0x3487('0x39')]);var _0x106393={'where':_0x38af4a[_0x3487('0x35')]};return db[_0x3487('0x3a')][_0x3487('0x1d')](_0x106393)[_0x3487('0x24')](function(_0x565cb2){_0x4dada9[_0x3487('0x1d')]=_0x565cb2;if(_0x1a02d6[_0x3487('0x2b')]['includeAll']){_0x38af4a['include']=[{'all':!![]}];}return db[_0x3487('0x3a')]['findAll'](_0x38af4a);})['then'](function(_0x3eb68c){_0x4dada9['rows']=_0x3eb68c;return _0x4dada9;})['then'](respondWithFilteredResult(_0x1c5bd6,_0x38af4a))[_0x3487('0x3b')](handleError(_0x1c5bd6,null));};exports[_0x3487('0x3c')]=function(_0x58a4c8,_0x51b69c){var _0xc04317={'raw':!![],'where':{'id':_0x58a4c8['params']['id']}},_0x8cd06f={};_0x8cd06f[_0x3487('0x3d')]=_[_0x3487('0x2c')](db['Cdr'][_0x3487('0x28')]);_0x8cd06f[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x58a4c8['query']);_0x8cd06f[_0x3487('0x2d')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],_0x8cd06f[_0x3487('0x2b')]);_0xc04317[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],qs[_0x3487('0x3e')](_0x58a4c8['query'][_0x3487('0x3e')]));_0xc04317[_0x3487('0x2e')]=_0xc04317[_0x3487('0x2e')][_0x3487('0x30')]?_0xc04317[_0x3487('0x2e')]:_0x8cd06f[_0x3487('0x3d')];if(_0x58a4c8[_0x3487('0x2b')][_0x3487('0x3f')]){_0xc04317['include']=[{'all':!![]}];}_0xc04317=_['merge']({},_0xc04317,_0x58a4c8[_0x3487('0x39')]);return db[_0x3487('0x3a')][_0x3487('0x40')](_0xc04317)[_0x3487('0x24')](handleEntityNotFound(_0x51b69c,null))['then'](respondWithResult(_0x51b69c,null))['catch'](handleError(_0x51b69c,null));};exports[_0x3487('0x41')]=function(_0x122456,_0x3fe91f){return db[_0x3487('0x3a')][_0x3487('0x41')](_0x122456[_0x3487('0x42')],{})[_0x3487('0x24')](respondWithResult(_0x3fe91f,0xc9))[_0x3487('0x3b')](handleError(_0x3fe91f,null));};exports['update']=function(_0x585a44,_0x320351){if(_0x585a44[_0x3487('0x42')]['id']){delete _0x585a44['body']['id'];}return db[_0x3487('0x3a')]['find']({'where':{'id':_0x585a44['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x320351,null))[_0x3487('0x24')](saveUpdates(_0x585a44['body'],null))[_0x3487('0x24')](respondWithResult(_0x320351,null))[_0x3487('0x3b')](handleError(_0x320351,null));};exports[_0x3487('0x43')]=function(_0x4ab5f8,_0x761f95){return db[_0x3487('0x3a')][_0x3487('0x40')]({'where':{'id':_0x4ab5f8[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0x761f95,null))[_0x3487('0x24')](removeEntity(_0x761f95,null))[_0x3487('0x3b')](handleError(_0x761f95,null));};exports[_0x3487('0x45')]=function(_0x33e826,_0x11125d){return db[_0x3487('0x3a')][_0x3487('0x45')]()['then'](respondWithResult(_0x11125d,null))[_0x3487('0x3b')](handleError(_0x11125d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index f2e0cc1..69c3508 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1eb400,_0x3c9483){var _0x320d9f=function(_0x56597a){while(--_0x56597a){_0x1eb400['push'](_0x1eb400['shift']());}};_0x320d9f(++_0x3c9483);}(_0x7a54,0x106));var _0x47a5=function(_0x24df01,_0x9a49e3){_0x24df01=_0x24df01-0x0;var _0x2aed6b=_0x7a54[_0x24df01];return _0x2aed6b;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3e704c,_0x4b1eb4){var _0x41c075=function(_0x5f2140){while(--_0x5f2140){_0x3e704c['push'](_0x3e704c['shift']());}};_0x41c075(++_0x4b1eb4);}(_0x7a54,0x106));var _0x47a5=function(_0x3b062a,_0x5b324b){_0x3b062a=_0x3b062a-0x0;var _0x31c9d2=_0x7a54[_0x3b062a];return _0x31c9d2;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2a1699e..1b9554b 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 _0x5a26=['jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x118e90,_0x45b88b){var _0x105d8c=function(_0x238ad6){while(--_0x238ad6){_0x118e90['push'](_0x118e90['shift']());}};_0x105d8c(++_0x45b88b);}(_0x5a26,0x1f2));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x65a2('0x0'));var util=require('util');var moment=require(_0x65a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x65a2('0x2'));var fs=require('fs');var Redis=require(_0x65a2('0x3'));var db=require(_0x65a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65a2('0x5'))(_0x65a2('0x6'));var config=require(_0x65a2('0x7'));var jayson=require(_0x65a2('0x8'));var client=jayson[_0x65a2('0x9')][_0x65a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9020,_0x537664,_0x54f2ed){return new BPromise(function(_0x510b87,_0x6d18b){return client['request'](_0x4e9020,_0x54f2ed)[_0x65a2('0xb')](function(_0x23dc19){logger[_0x65a2('0xc')](_0x65a2('0xd'),_0x537664,_0x65a2('0xe'));logger['debug'](_0x65a2('0xf'),_0x537664,_0x65a2('0xe'),JSON[_0x65a2('0x10')](_0x23dc19));if(_0x23dc19[_0x65a2('0x11')]){if(_0x23dc19['error'][_0x65a2('0x12')]===0x1f4){logger[_0x65a2('0x11')](_0x65a2('0xd'),_0x537664,_0x23dc19[_0x65a2('0x11')][_0x65a2('0x13')]);return _0x6d18b(_0x23dc19[_0x65a2('0x11')][_0x65a2('0x13')]);}logger[_0x65a2('0x11')](_0x65a2('0xd'),_0x537664,_0x23dc19[_0x65a2('0x11')]['message']);return _0x510b87(_0x23dc19['error']['message']);}else{logger['info'](_0x65a2('0xd'),_0x537664,_0x65a2('0xe'));_0x510b87(_0x23dc19[_0x65a2('0x14')][_0x65a2('0x13')]);}})[_0x65a2('0x15')](function(_0x125bdc){logger['error'](_0x65a2('0xd'),_0x537664,_0x125bdc);_0x6d18b(_0x125bdc);});});} \ No newline at end of file +var _0xfd8e=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x40b3de,_0x327d8b){var _0x269f49=function(_0x56d430){while(--_0x56d430){_0x40b3de['push'](_0x40b3de['shift']());}};_0x269f49(++_0x327d8b);}(_0xfd8e,0x127));var _0xefd8=function(_0x46e6e3,_0x59e170){_0x46e6e3=_0x46e6e3-0x0;var _0x348f17=_0xfd8e[_0x46e6e3];return _0x348f17;};'use strict';var _=require(_0xefd8('0x0'));var util=require(_0xefd8('0x1'));var moment=require('moment');var BPromise=require(_0xefd8('0x2'));var rs=require(_0xefd8('0x3'));var fs=require('fs');var Redis=require(_0xefd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefd8('0x5'))(_0xefd8('0x6'));var config=require('../../config/environment');var jayson=require(_0xefd8('0x7'));var client=jayson[_0xefd8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d6f,_0x2a57e3,_0x1fc457){return new BPromise(function(_0x407312,_0x656657){return client[_0xefd8('0x9')](_0x461d6f,_0x1fc457)[_0xefd8('0xa')](function(_0x1a85b0){logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));logger['debug'](_0xefd8('0xe'),_0x2a57e3,_0xefd8('0xd'),JSON[_0xefd8('0xf')](_0x1a85b0));if(_0x1a85b0[_0xefd8('0x10')]){if(_0x1a85b0[_0xefd8('0x10')]['code']===0x1f4){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0['error'][_0xefd8('0x11')]);return _0x656657(_0x1a85b0[_0xefd8('0x10')]['message']);}logger['error'](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0[_0xefd8('0x10')]['message']);return _0x407312(_0x1a85b0[_0xefd8('0x10')][_0xefd8('0x11')]);}else{logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));_0x407312(_0x1a85b0['result'][_0xefd8('0x11')]);}})[_0xefd8('0x12')](function(_0x530042){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x530042);_0x656657(_0x530042);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0324ead..7492974 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x271d02,_0x5cd222){var _0x14112d=function(_0x43c775){while(--_0x43c775){_0x271d02['push'](_0x271d02['shift']());}};_0x14112d(++_0x5cd222);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x32d351,_0x44eb47){var _0xcde9fa=function(_0x24a26d){while(--_0x24a26d){_0x32d351['push'](_0x32d351['shift']());}};_0xcde9fa(++_0x44eb47);}(_0xb10b,0x12a));var _0xbb10=function(_0xfadccd,_0x290136){_0xfadccd=_0xfadccd-0x0;var _0x482ac4=_0xb10b[_0xfadccd];return _0x482ac4;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b4bd554..8cf696f 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 _0x6e87=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6e87,0x7e));var _0x76e8=function(_0x52c8f8,_0x5b141b){_0x52c8f8=_0x52c8f8-0x0;var _0x3193ba=_0x6e87[_0x52c8f8];return _0x3193ba;};'use strict';var Sequelize=require('sequelize');module[_0x76e8('0x0')]={'priority':{'type':Sequelize[_0x76e8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x76e8('0x2')],'allowNull':![],'defaultValue':_0x76e8('0x3')},'appdata':{'type':Sequelize[_0x76e8('0x4')]()},'description':{'type':Sequelize[_0x76e8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe4a3=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x54dfa3,_0x519df9){var _0x302fb9=function(_0x35c204){while(--_0x35c204){_0x54dfa3['push'](_0x54dfa3['shift']());}};_0x302fb9(++_0x519df9);}(_0xe4a3,0x107));var _0x3e4a=function(_0x938050,_0x5591e9){_0x938050=_0x938050-0x0;var _0x43da16=_0xe4a3[_0x938050];return _0x43da16;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3e4a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3e4a('0x1')],'allowNull':![],'defaultValue':_0x3e4a('0x2')},'appdata':{'type':Sequelize[_0x3e4a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3e4a('0x1')],'defaultValue':_0x3e4a('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ce0d984..c2f94ae 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 _0x3013=['body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','apply','then','destroy','error','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','update'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x3013,0xea));var _0x3301=function(_0x12aaa9,_0x71ed9c){_0x12aaa9=_0x12aaa9-0x0;var _0x6da6d8=_0x3013[_0x12aaa9];return _0x6da6d8;};'use strict';var emlformat=require(_0x3301('0x0'));var rimraf=require(_0x3301('0x1'));var zipdir=require(_0x3301('0x2'));var jsonpatch=require(_0x3301('0x3'));var rp=require('request-promise');var moment=require(_0x3301('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3301('0x5'));var util=require(_0x3301('0x6'));var path=require(_0x3301('0x7'));var sox=require(_0x3301('0x8'));var csv=require('to-csv');var ejs=require(_0x3301('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3301('0xa'));var squel=require(_0x3301('0xb'));var crypto=require(_0x3301('0xc'));var jsforce=require(_0x3301('0xd'));var deskjs=require(_0x3301('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3301('0xf'));var Papa=require(_0x3301('0x10'));var Redis=require(_0x3301('0x11'));var authService=require(_0x3301('0x12'));var qs=require(_0x3301('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3301('0x14'));var logger=require(_0x3301('0x15'))(_0x3301('0x16'));var utils=require(_0x3301('0x17'));var config=require(_0x3301('0x18'));var licenseUtil=require(_0x3301('0x19'));var db=require(_0x3301('0x1a'))['db'];function respondWithStatusCode(_0x2c8df9,_0x427c22){_0x427c22=_0x427c22||0xcc;return function(_0x40dad9){if(_0x40dad9){return _0x2c8df9[_0x3301('0x1b')](_0x427c22);}return _0x2c8df9[_0x3301('0x1c')](_0x427c22)[_0x3301('0x1d')]();};}function respondWithResult(_0x3dcf1d,_0x52a56c){_0x52a56c=_0x52a56c||0xc8;return function(_0x3d182e){if(_0x3d182e){return _0x3dcf1d[_0x3301('0x1c')](_0x52a56c)['json'](_0x3d182e);}};}function respondWithFilteredResult(_0x49bc8e,_0x8f280d){return function(_0x225e94){if(_0x225e94){var _0x5e7d09=typeof _0x8f280d[_0x3301('0x1e')]===_0x3301('0x1f')&&typeof _0x8f280d['limit']===_0x3301('0x1f');var _0x6e88ec=_0x225e94[_0x3301('0x20')];var _0x4b3eea=_0x5e7d09?0x0:_0x8f280d[_0x3301('0x1e')];var _0xd3d931=_0x5e7d09?_0x225e94[_0x3301('0x20')]:_0x8f280d[_0x3301('0x1e')]+_0x8f280d[_0x3301('0x21')];var _0x2a15b9;if(_0xd3d931>=_0x6e88ec){_0xd3d931=_0x6e88ec;_0x2a15b9=0xc8;}else{_0x2a15b9=0xce;}_0x49bc8e['status'](_0x2a15b9);return _0x49bc8e['set']('Content-Range',_0x4b3eea+'-'+_0xd3d931+'/'+_0x6e88ec)['json'](_0x225e94);}return null;};}function patchUpdates(_0x23dcc8){return function(_0x2b2005){try{jsonpatch[_0x3301('0x22')](_0x2b2005,_0x23dcc8,!![]);}catch(_0x2490d7){return BPromise['reject'](_0x2490d7);}return _0x2b2005['save']();};}function saveUpdates(_0x4e65c9,_0x3ebe89){return function(_0x54c291){if(_0x54c291){return _0x54c291['update'](_0x4e65c9)[_0x3301('0x23')](function(_0x21edb4){return _0x21edb4;});}return null;};}function removeEntity(_0x258d28,_0xef67c4){return function(_0x1d89b2){if(_0x1d89b2){return _0x1d89b2[_0x3301('0x24')]()['then'](function(){_0x258d28[_0x3301('0x1c')](0xcc)[_0x3301('0x1d')]();});}};}function handleEntityNotFound(_0x13fb21,_0x39d766){return function(_0x54ec21){if(!_0x54ec21){_0x13fb21[_0x3301('0x1b')](0x194);}return _0x54ec21;};}function handleError(_0x2f821,_0x150f73){_0x150f73=_0x150f73||0x1f4;return function(_0x2febe1){logger[_0x3301('0x25')](_0x2febe1['stack']);if(_0x2febe1['name']){delete _0x2febe1['name'];}_0x2f821['status'](_0x150f73)[_0x3301('0x26')](_0x2febe1);};}exports[_0x3301('0x27')]=function(_0x1684a9,_0x48f661){var _0x31d585={'raw':!![],'where':{'id':_0x1684a9[_0x3301('0x28')]['id']}},_0x3d1d80={};_0x3d1d80[_0x3301('0x29')]=_[_0x3301('0x2a')](db[_0x3301('0x2b')][_0x3301('0x2c')]);_0x3d1d80[_0x3301('0x2d')]=_['keys'](_0x1684a9['query']);_0x3d1d80[_0x3301('0x2e')]=_[_0x3301('0x2f')](_0x3d1d80[_0x3301('0x29')],_0x3d1d80[_0x3301('0x2d')]);_0x31d585[_0x3301('0x30')]=_[_0x3301('0x2f')](_0x3d1d80[_0x3301('0x29')],qs['fields'](_0x1684a9['query'][_0x3301('0x31')]));_0x31d585[_0x3301('0x30')]=_0x31d585[_0x3301('0x30')][_0x3301('0x32')]?_0x31d585[_0x3301('0x30')]:_0x3d1d80[_0x3301('0x29')];if(_0x1684a9[_0x3301('0x2d')][_0x3301('0x33')]){_0x31d585[_0x3301('0x34')]=[{'all':!![]}];}_0x31d585=_['merge']({},_0x31d585,_0x1684a9[_0x3301('0x35')]);return db['ChatApplication']['find'](_0x31d585)[_0x3301('0x23')](handleEntityNotFound(_0x48f661,null))[_0x3301('0x23')](respondWithResult(_0x48f661,null))[_0x3301('0x36')](handleError(_0x48f661,null));};exports[_0x3301('0x37')]=function(_0x115b72,_0x137f48){if(_0x115b72[_0x3301('0x38')]['id']){delete _0x115b72['body']['id'];}return db[_0x3301('0x2b')][_0x3301('0x39')]({'where':{'id':_0x115b72[_0x3301('0x28')]['id']}})[_0x3301('0x23')](handleEntityNotFound(_0x137f48,null))[_0x3301('0x23')](saveUpdates(_0x115b72[_0x3301('0x38')],null))[_0x3301('0x23')](respondWithResult(_0x137f48,null))['catch'](handleError(_0x137f48,null));};exports[_0x3301('0x24')]=function(_0x37b3a3,_0x563392){return db['ChatApplication'][_0x3301('0x39')]({'where':{'id':_0x37b3a3[_0x3301('0x28')]['id']}})['then'](handleEntityNotFound(_0x563392,null))[_0x3301('0x23')](removeEntity(_0x563392,null))['catch'](handleError(_0x563392,null));}; \ No newline at end of file +var _0x58e5=['sox','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x51fd4e,_0x4bf5fd){var _0x20beed=function(_0x4bd9f7){while(--_0x4bd9f7){_0x51fd4e['push'](_0x51fd4e['shift']());}};_0x20beed(++_0x4bf5fd);}(_0x58e5,0xd1));var _0x558e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x58e5[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require(_0x558e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x558e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x558e('0x7'));var csv=require('to-csv');var ejs=require(_0x558e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558e('0x9'));var squel=require(_0x558e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x558e('0xb'));var Redis=require(_0x558e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558e('0xd'));var as=require(_0x558e('0xe'));var hardwareService=require(_0x558e('0xf'));var logger=require(_0x558e('0x10'))('api');var utils=require(_0x558e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x558e('0x12'));var db=require(_0x558e('0x13'))['db'];function respondWithStatusCode(_0x1328b5,_0x3bd154){_0x3bd154=_0x3bd154||0xcc;return function(_0x4a0889){if(_0x4a0889){return _0x1328b5[_0x558e('0x14')](_0x3bd154);}return _0x1328b5[_0x558e('0x15')](_0x3bd154)['end']();};}function respondWithResult(_0x288e2f,_0x9933cd){_0x9933cd=_0x9933cd||0xc8;return function(_0x4a6f57){if(_0x4a6f57){return _0x288e2f[_0x558e('0x15')](_0x9933cd)['json'](_0x4a6f57);}};}function respondWithFilteredResult(_0x134bdf,_0x13d3b1){return function(_0x5d61ab){if(_0x5d61ab){var _0x21552c=typeof _0x13d3b1[_0x558e('0x16')]===_0x558e('0x17')&&typeof _0x13d3b1[_0x558e('0x18')]==='undefined';var _0x2225d5=_0x5d61ab[_0x558e('0x19')];var _0x84da47=_0x21552c?0x0:_0x13d3b1[_0x558e('0x16')];var _0xb955b2=_0x21552c?_0x5d61ab[_0x558e('0x19')]:_0x13d3b1[_0x558e('0x16')]+_0x13d3b1['limit'];var _0x4afcfe;if(_0xb955b2>=_0x2225d5){_0xb955b2=_0x2225d5;_0x4afcfe=0xc8;}else{_0x4afcfe=0xce;}_0x134bdf[_0x558e('0x15')](_0x4afcfe);return _0x134bdf[_0x558e('0x1a')](_0x558e('0x1b'),_0x84da47+'-'+_0xb955b2+'/'+_0x2225d5)[_0x558e('0x1c')](_0x5d61ab);}return null;};}function patchUpdates(_0x208288){return function(_0xc046be){try{jsonpatch[_0x558e('0x1d')](_0xc046be,_0x208288,!![]);}catch(_0x2e3279){return BPromise[_0x558e('0x1e')](_0x2e3279);}return _0xc046be[_0x558e('0x1f')]();};}function saveUpdates(_0x4c402d,_0x39b61d){return function(_0x10d323){if(_0x10d323){return _0x10d323['update'](_0x4c402d)['then'](function(_0x448485){return _0x448485;});}return null;};}function removeEntity(_0x59a349,_0x87fb47){return function(_0x44b7fe){if(_0x44b7fe){return _0x44b7fe['destroy']()[_0x558e('0x20')](function(){_0x59a349[_0x558e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26874d,_0x4e9182){return function(_0x29caf3){if(!_0x29caf3){_0x26874d[_0x558e('0x14')](0x194);}return _0x29caf3;};}function handleError(_0x2ce831,_0x391da8){_0x391da8=_0x391da8||0x1f4;return function(_0x489f65){logger['error'](_0x489f65[_0x558e('0x21')]);if(_0x489f65['name']){delete _0x489f65['name'];}_0x2ce831[_0x558e('0x15')](_0x391da8)[_0x558e('0x22')](_0x489f65);};}exports[_0x558e('0x23')]=function(_0x17bf74,_0x42fb72){var _0x4deb75={'raw':!![],'where':{'id':_0x17bf74[_0x558e('0x24')]['id']}},_0x2e0166={};_0x2e0166[_0x558e('0x25')]=_['keys'](db[_0x558e('0x26')][_0x558e('0x27')]);_0x2e0166[_0x558e('0x28')]=_[_0x558e('0x29')](_0x17bf74[_0x558e('0x28')]);_0x2e0166[_0x558e('0x2a')]=_[_0x558e('0x2b')](_0x2e0166[_0x558e('0x25')],_0x2e0166[_0x558e('0x28')]);_0x4deb75[_0x558e('0x2c')]=_['intersection'](_0x2e0166[_0x558e('0x25')],qs[_0x558e('0x2d')](_0x17bf74[_0x558e('0x28')][_0x558e('0x2d')]));_0x4deb75['attributes']=_0x4deb75['attributes'][_0x558e('0x2e')]?_0x4deb75[_0x558e('0x2c')]:_0x2e0166[_0x558e('0x25')];if(_0x17bf74[_0x558e('0x28')]['includeAll']){_0x4deb75['include']=[{'all':!![]}];}_0x4deb75=_[_0x558e('0x2f')]({},_0x4deb75,_0x17bf74[_0x558e('0x30')]);return db[_0x558e('0x26')][_0x558e('0x31')](_0x4deb75)[_0x558e('0x20')](handleEntityNotFound(_0x42fb72,null))[_0x558e('0x20')](respondWithResult(_0x42fb72,null))[_0x558e('0x32')](handleError(_0x42fb72,null));};exports[_0x558e('0x33')]=function(_0x2225db,_0xdedffa){if(_0x2225db[_0x558e('0x34')]['id']){delete _0x2225db['body']['id'];}return db[_0x558e('0x26')][_0x558e('0x31')]({'where':{'id':_0x2225db['params']['id']}})['then'](handleEntityNotFound(_0xdedffa,null))['then'](saveUpdates(_0x2225db[_0x558e('0x34')],null))[_0x558e('0x20')](respondWithResult(_0xdedffa,null))['catch'](handleError(_0xdedffa,null));};exports[_0x558e('0x35')]=function(_0x2b555f,_0x449d74){return db[_0x558e('0x26')]['find']({'where':{'id':_0x2b555f[_0x558e('0x24')]['id']}})[_0x558e('0x20')](handleEntityNotFound(_0x449d74,null))['then'](removeEntity(_0x449d74,null))['catch'](handleError(_0x449d74,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d32a895..5b71f10 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 _0xbdfd=['bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x4f6e7f,_0x22d8b1){var _0x3d919b=function(_0xad4db3){while(--_0xad4db3){_0x4f6e7f['push'](_0x4f6e7f['shift']());}};_0x3d919b(++_0x22d8b1);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbdf('0x1'));var moment=require(_0xdbdf('0x2'));var BPromise=require(_0xdbdf('0x3'));var rp=require(_0xdbdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var attributes=require('./chatApplication.attributes');module[_0xdbdf('0x7')]=function(_0xa743ff,_0x484034){return _0xa743ff[_0xdbdf('0x8')](_0xdbdf('0x9'),attributes,{'tableName':_0xdbdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdbdf('0xb'),'collate':_0xdbdf('0xc')});}; \ No newline at end of file +var _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','util'];(function(_0x5eb236,_0x333496){var _0x795156=function(_0x57f85f){while(--_0x57f85f){_0x5eb236['push'](_0x5eb236['shift']());}};_0x795156(++_0x333496);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa4ba[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('ChatApplication',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 670ed91..ccb6a72 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 _0x36fc=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x389722,_0x2cb8ac){var _0x2c41f5=function(_0x471ba9){while(--_0x471ba9){_0x389722['push'](_0x389722['shift']());}};_0x2c41f5(++_0x2cb8ac);}(_0x36fc,0x6e));var _0xc36f=function(_0x1bd332,_0x536135){_0x1bd332=_0x1bd332-0x0;var _0x3227cd=_0x36fc[_0x1bd332];return _0x3227cd;};'use strict';var _=require('lodash');var util=require(_0xc36f('0x0'));var moment=require(_0xc36f('0x1'));var BPromise=require(_0xc36f('0x2'));var rs=require(_0xc36f('0x3'));var fs=require('fs');var Redis=require(_0xc36f('0x4'));var db=require(_0xc36f('0x5'))['db'];var utils=require(_0xc36f('0x6'));var logger=require(_0xc36f('0x7'))(_0xc36f('0x8'));var config=require(_0xc36f('0x9'));var jayson=require(_0xc36f('0xa'));var client=jayson['client'][_0xc36f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x306d78,_0x4cd1f3,_0x5bc3d0){return new BPromise(function(_0x561393,_0x57937c){return client['request'](_0x306d78,_0x5bc3d0)[_0xc36f('0xc')](function(_0x27bbb5){logger['info'](_0xc36f('0xd'),_0x4cd1f3,_0xc36f('0xe'));logger['debug'](_0xc36f('0xf'),_0x4cd1f3,'request\x20sent',JSON[_0xc36f('0x10')](_0x27bbb5));if(_0x27bbb5[_0xc36f('0x11')]){if(_0x27bbb5['error'][_0xc36f('0x12')]===0x1f4){logger[_0xc36f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4cd1f3,_0x27bbb5[_0xc36f('0x11')]['message']);return _0x57937c(_0x27bbb5['error'][_0xc36f('0x13')]);}logger[_0xc36f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4cd1f3,_0x27bbb5[_0xc36f('0x11')][_0xc36f('0x13')]);return _0x561393(_0x27bbb5[_0xc36f('0x11')][_0xc36f('0x13')]);}else{logger['info'](_0xc36f('0xd'),_0x4cd1f3,_0xc36f('0xe'));_0x561393(_0x27bbb5[_0xc36f('0x14')]['message']);}})['catch'](function(_0x3911c6){logger[_0xc36f('0x11')](_0xc36f('0xd'),_0x4cd1f3,_0x3911c6);_0x57937c(_0x3911c6);});});} \ No newline at end of file +var _0xff46=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x35085c,_0x292579){var _0x36d2b2=function(_0x2b2068){while(--_0x2b2068){_0x35085c['push'](_0x35085c['shift']());}};_0x36d2b2(++_0x292579);}(_0xff46,0x70));var _0x6ff4=function(_0x2e1e77,_0x1bc176){_0x2e1e77=_0x2e1e77-0x0;var _0x5403b6=_0xff46[_0x2e1e77];return _0x5403b6;};'use strict';var _=require(_0x6ff4('0x0'));var util=require('util');var moment=require(_0x6ff4('0x1'));var BPromise=require(_0x6ff4('0x2'));var rs=require(_0x6ff4('0x3'));var fs=require('fs');var Redis=require(_0x6ff4('0x4'));var db=require(_0x6ff4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ff4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6ff4('0x7')][_0x6ff4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fbe2e,_0x816b11,_0x290e71){return new BPromise(function(_0x351247,_0x102239){return client[_0x6ff4('0x9')](_0x2fbe2e,_0x290e71)['then'](function(_0x5b4fdb){logger[_0x6ff4('0xa')]('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'));logger[_0x6ff4('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'),JSON['stringify'](_0x5b4fdb));if(_0x5b4fdb[_0x6ff4('0xd')]){if(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xe')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);return _0x102239(_0x5b4fdb[_0x6ff4('0xd')]['message']);}logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x5b4fdb['error']['message']);return _0x351247(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);}else{logger[_0x6ff4('0xa')](_0x6ff4('0x10'),_0x816b11,'request\x20sent');_0x351247(_0x5b4fdb[_0x6ff4('0x11')][_0x6ff4('0xf')]);}})[_0x6ff4('0x12')](function(_0x38bf93){logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x38bf93);_0x102239(_0x38bf93);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 46fd3f9..4dd745f 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 _0xcbe4=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./chatApplication.controller','/:id','put'];(function(_0x16f117,_0x1a0bf9){var _0x169b4d=function(_0x562314){while(--_0x562314){_0x16f117['push'](_0x16f117['shift']());}};_0x169b4d(++_0x1a0bf9);}(_0xcbe4,0x153));var _0x4cbe=function(_0x1ab479,_0x2a2ed6){_0x1ab479=_0x1ab479-0x0;var _0x43aa53=_0xcbe4[_0x1ab479];return _0x43aa53;};'use strict';var multer=require(_0x4cbe('0x0'));var util=require(_0x4cbe('0x1'));var path=require(_0x4cbe('0x2'));var timeout=require(_0x4cbe('0x3'));var express=require(_0x4cbe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4cbe('0x5'));var config=require('../../config/environment');var controller=require(_0x4cbe('0x6'));router['get'](_0x4cbe('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x4cbe('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4cbe('0x9')](_0x4cbe('0x7'),auth[_0x4cbe('0xa')](),controller['destroy']);module[_0x4cbe('0xb')]=router; \ No newline at end of file +var _0x26b1=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','get','/:id','isAuthenticated','show','put'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x26b1,0x13f));var _0x126b=function(_0x3f38f3,_0x22cad7){_0x3f38f3=_0x3f38f3-0x0;var _0x2e88c1=_0x26b1[_0x3f38f3];return _0x2e88c1;};'use strict';var multer=require(_0x126b('0x0'));var util=require(_0x126b('0x1'));var path=require(_0x126b('0x2'));var timeout=require('connect-timeout');var express=require(_0x126b('0x3'));var router=express[_0x126b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x126b('0x5'));var controller=require('./chatApplication.controller');router[_0x126b('0x6')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0x9')]);router[_0x126b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x126b('0xb')]);router[_0x126b('0xc')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0xd')]);module[_0x126b('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4f3fc49..245562c 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 _0xe63f=['BOOLEAN','sequelize','STRING'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xe63f,0x163));var _0xfe63=function(_0xdc6179,_0x228c8d){_0xdc6179=_0xdc6179-0x0;var _0x3c24c4=_0xe63f[_0xdc6179];return _0x3c24c4;};'use strict';var Sequelize=require(_0xfe63('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe63('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfe63('0x1')]},'write':{'type':Sequelize[_0xfe63('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3f3d=['STRING','BOOLEAN','sequelize'];(function(_0x3b8363,_0x17bc8){var _0x4d8289=function(_0x520c1d){while(--_0x520c1d){_0x3b8363['push'](_0x3b8363['shift']());}};_0x4d8289(++_0x17bc8);}(_0x3f3d,0xd4));var _0xd3f3=function(_0x160148,_0x5c0639){_0x160148=_0x160148-0x0;var _0x5d4a2c=_0x3f3d[_0x160148];return _0x5d4a2c;};'use strict';var Sequelize=require(_0xd3f3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3f3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3f3('0x1')]},'write':{'type':Sequelize[_0xd3f3('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 096f0fb..98b3eb1 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 _0xb6be=['destroy','error','name','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','ChatGroup','include','findAll','rows','show','includeAll','find','catch','create','body','update','params','describe','toInteger','addMembers','ids','omit','getMembers','User','order','removeMembers','addMessage','getMessages','findOne','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','offset','limit','count','status','set','Content-Range','apply','reject','save','then'];(function(_0x5efa14,_0x470ee0){var _0x580121=function(_0xa354b4){while(--_0xa354b4){_0x5efa14['push'](_0x5efa14['shift']());}};_0x580121(++_0x470ee0);}(_0xb6be,0x141));var _0xeb6b=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xb6be[_0x4bd06e];return _0x85ebb;};'use strict';var emlformat=require(_0xeb6b('0x0'));var rimraf=require(_0xeb6b('0x1'));var zipdir=require(_0xeb6b('0x2'));var jsonpatch=require(_0xeb6b('0x3'));var rp=require(_0xeb6b('0x4'));var moment=require('moment');var BPromise=require(_0xeb6b('0x5'));var Mustache=require(_0xeb6b('0x6'));var util=require(_0xeb6b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeb6b('0x8'));var ejs=require(_0xeb6b('0x9'));var fs=require('fs');var fs_extra=require(_0xeb6b('0xa'));var _=require(_0xeb6b('0xb'));var squel=require(_0xeb6b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb6b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeb6b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeb6b('0xf'));var as=require(_0xeb6b('0x10'));var hardwareService=require(_0xeb6b('0x11'));var logger=require(_0xeb6b('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb6b('0x13'));var db=require(_0xeb6b('0x14'))['db'];config[_0xeb6b('0x15')]=_[_0xeb6b('0x16')](config[_0xeb6b('0x15')],{'host':_0xeb6b('0x17'),'port':0x18eb});var socket=require(_0xeb6b('0x18'))(new Redis(config[_0xeb6b('0x15')]));require(_0xeb6b('0x19'))[_0xeb6b('0x1a')](socket);function respondWithStatusCode(_0x1c3ce0,_0x49d031){_0x49d031=_0x49d031||0xcc;return function(_0x4ddaea){if(_0x4ddaea){return _0x1c3ce0[_0xeb6b('0x1b')](_0x49d031);}return _0x1c3ce0['status'](_0x49d031)[_0xeb6b('0x1c')]();};}function respondWithResult(_0x4f8ba6,_0x40a23e){_0x40a23e=_0x40a23e||0xc8;return function(_0x373854){if(_0x373854){return _0x4f8ba6['status'](_0x40a23e)['json'](_0x373854);}};}function respondWithFilteredResult(_0x286b18,_0x5cb770){return function(_0x425c90){if(_0x425c90){var _0x58cfb6=typeof _0x5cb770[_0xeb6b('0x1d')]==='undefined'&&typeof _0x5cb770[_0xeb6b('0x1e')]==='undefined';var _0x258703=_0x425c90['count'];var _0x5a2100=_0x58cfb6?0x0:_0x5cb770['offset'];var _0x34ac6f=_0x58cfb6?_0x425c90[_0xeb6b('0x1f')]:_0x5cb770[_0xeb6b('0x1d')]+_0x5cb770[_0xeb6b('0x1e')];var _0x34343f;if(_0x34ac6f>=_0x258703){_0x34ac6f=_0x258703;_0x34343f=0xc8;}else{_0x34343f=0xce;}_0x286b18[_0xeb6b('0x20')](_0x34343f);return _0x286b18[_0xeb6b('0x21')](_0xeb6b('0x22'),_0x5a2100+'-'+_0x34ac6f+'/'+_0x258703)['json'](_0x425c90);}return null;};}function patchUpdates(_0x1c63a8){return function(_0x4ca340){try{jsonpatch[_0xeb6b('0x23')](_0x4ca340,_0x1c63a8,!![]);}catch(_0x20e021){return BPromise[_0xeb6b('0x24')](_0x20e021);}return _0x4ca340[_0xeb6b('0x25')]();};}function saveUpdates(_0x35c988,_0xf9d3d){return function(_0x2ca1e0){if(_0x2ca1e0){return _0x2ca1e0['update'](_0x35c988)[_0xeb6b('0x26')](function(_0x50f60a){return _0x50f60a;});}return null;};}function removeEntity(_0x54ba40,_0x2cc6f3){return function(_0x1bb3e8){if(_0x1bb3e8){return _0x1bb3e8[_0xeb6b('0x27')]()[_0xeb6b('0x26')](function(){_0x54ba40[_0xeb6b('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4c57,_0x441d32){return function(_0x20ceb2){if(!_0x20ceb2){_0x4f4c57[_0xeb6b('0x1b')](0x194);}return _0x20ceb2;};}function handleError(_0x48e55e,_0x296247){_0x296247=_0x296247||0x1f4;return function(_0x5caf77){logger[_0xeb6b('0x28')](_0x5caf77['stack']);if(_0x5caf77[_0xeb6b('0x29')]){delete _0x5caf77['name'];}_0x48e55e[_0xeb6b('0x20')](_0x296247)['send'](_0x5caf77);};}exports['index']=function(_0xc16b66,_0x1b39d5){var _0x34f1c5={},_0x5a6ec9={},_0x3e9c80={'count':0x0,'rows':[]};var _0xe93ad4=_[_0xeb6b('0x2a')](db['ChatGroup'][_0xeb6b('0x2b')],function(_0x171e39){return{'name':_0x171e39[_0xeb6b('0x2c')],'type':_0x171e39[_0xeb6b('0x2d')][_0xeb6b('0x2e')]};});_0x5a6ec9['model']=_[_0xeb6b('0x2a')](_0xe93ad4,'name');_0x5a6ec9['query']=_[_0xeb6b('0x2f')](_0xc16b66['query']);_0x5a6ec9[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x5a6ec9[_0xeb6b('0x32')],_0x5a6ec9[_0xeb6b('0x33')]);_0x34f1c5[_0xeb6b('0x34')]=_['intersection'](_0x5a6ec9['model'],qs[_0xeb6b('0x35')](_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x35')]));_0x34f1c5[_0xeb6b('0x34')]=_0x34f1c5[_0xeb6b('0x34')][_0xeb6b('0x36')]?_0x34f1c5[_0xeb6b('0x34')]:_0x5a6ec9[_0xeb6b('0x32')];if(!_0xc16b66['query'][_0xeb6b('0x37')](_0xeb6b('0x38'))){_0x34f1c5[_0xeb6b('0x1e')]=qs[_0xeb6b('0x1e')](_0xc16b66[_0xeb6b('0x33')]['limit']);_0x34f1c5['offset']=qs[_0xeb6b('0x1d')](_0xc16b66['query'][_0xeb6b('0x1d')]);}_0x34f1c5['order']=qs[_0xeb6b('0x39')](_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x39')]);_0x34f1c5[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0xc16b66[_0xeb6b('0x33')],_0x5a6ec9[_0xeb6b('0x30')]),_0xe93ad4);if(_0xc16b66['query']['filter']){_0x34f1c5[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0x34f1c5['where'],{'$or':_['map'](_0xe93ad4,function(_0x235d0c){if(_0x235d0c[_0xeb6b('0x2d')]!==_0xeb6b('0x3d')){var _0x4debc4={};_0x4debc4[_0x235d0c[_0xeb6b('0x29')]]={'$like':'%'+_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x4debc4;}})});}_0x34f1c5=_[_0xeb6b('0x3c')]({},_0x34f1c5,_0xc16b66[_0xeb6b('0x3f')]);var _0x5aa2bb={'where':_0x34f1c5[_0xeb6b('0x3a')]};return db[_0xeb6b('0x40')][_0xeb6b('0x1f')](_0x5aa2bb)[_0xeb6b('0x26')](function(_0x3a887c){_0x3e9c80[_0xeb6b('0x1f')]=_0x3a887c;if(_0xc16b66[_0xeb6b('0x33')]['includeAll']){_0x34f1c5[_0xeb6b('0x41')]=[{'all':!![]}];}return db[_0xeb6b('0x40')][_0xeb6b('0x42')](_0x34f1c5);})[_0xeb6b('0x26')](function(_0x4f4f4c){_0x3e9c80[_0xeb6b('0x43')]=_0x4f4f4c;return _0x3e9c80;})['then'](respondWithFilteredResult(_0x1b39d5,_0x34f1c5))['catch'](handleError(_0x1b39d5,null));};exports[_0xeb6b('0x44')]=function(_0x2cf9b5,_0x273b56){var _0x5b32dc={'raw':!![],'where':{'id':_0x2cf9b5['params']['id']}},_0x48972b={};_0x48972b[_0xeb6b('0x32')]=_['keys'](db['ChatGroup'][_0xeb6b('0x2b')]);_0x48972b[_0xeb6b('0x33')]=_[_0xeb6b('0x2f')](_0x2cf9b5['query']);_0x48972b[_0xeb6b('0x30')]=_['intersection'](_0x48972b[_0xeb6b('0x32')],_0x48972b['query']);_0x5b32dc['attributes']=_[_0xeb6b('0x31')](_0x48972b[_0xeb6b('0x32')],qs['fields'](_0x2cf9b5[_0xeb6b('0x33')]['fields']));_0x5b32dc[_0xeb6b('0x34')]=_0x5b32dc[_0xeb6b('0x34')][_0xeb6b('0x36')]?_0x5b32dc['attributes']:_0x48972b[_0xeb6b('0x32')];if(_0x2cf9b5['query'][_0xeb6b('0x45')]){_0x5b32dc[_0xeb6b('0x41')]=[{'all':!![]}];}_0x5b32dc=_[_0xeb6b('0x3c')]({},_0x5b32dc,_0x2cf9b5[_0xeb6b('0x3f')]);return db[_0xeb6b('0x40')][_0xeb6b('0x46')](_0x5b32dc)['then'](handleEntityNotFound(_0x273b56,null))[_0xeb6b('0x26')](respondWithResult(_0x273b56,null))[_0xeb6b('0x47')](handleError(_0x273b56,null));};exports[_0xeb6b('0x48')]=function(_0x105c03,_0xc0f572){return db[_0xeb6b('0x40')]['create'](_0x105c03[_0xeb6b('0x49')],{})[_0xeb6b('0x26')](respondWithResult(_0xc0f572,0xc9))['catch'](handleError(_0xc0f572,null));};exports[_0xeb6b('0x4a')]=function(_0x44ec46,_0x2a43bc){if(_0x44ec46[_0xeb6b('0x49')]['id']){delete _0x44ec46['body']['id'];}return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x44ec46[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x2a43bc,null))[_0xeb6b('0x26')](saveUpdates(_0x44ec46[_0xeb6b('0x49')],null))[_0xeb6b('0x26')](respondWithResult(_0x2a43bc,null))[_0xeb6b('0x47')](handleError(_0x2a43bc,null));};exports[_0xeb6b('0x27')]=function(_0x5ee0a0,_0x5d12e3){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x5ee0a0[_0xeb6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d12e3,null))[_0xeb6b('0x26')](removeEntity(_0x5d12e3,null))['catch'](handleError(_0x5d12e3,null));};exports[_0xeb6b('0x4c')]=function(_0x35c187,_0x2c9841){return db['ChatGroup'][_0xeb6b('0x4c')]()[_0xeb6b('0x26')](respondWithResult(_0x2c9841,null))[_0xeb6b('0x47')](handleError(_0x2c9841,null));};exports['getUnread']=function(_0x3df0a3,_0x115ee3,_0x17f2e0){return db['ChatInternalMessage'][_0xeb6b('0x1f')]({'where':{'ChatGroupId':_0x3df0a3[_0xeb6b('0x4b')]['id'],'ToId':_0x3df0a3['user']['id'],'read':![]}})[_0xeb6b('0x26')](function(_0x1a33c6){return{'id':_[_0xeb6b('0x4d')](_0x3df0a3[_0xeb6b('0x4b')]['id']),'count':_0x1a33c6};})[_0xeb6b('0x26')](respondWithResult(_0x115ee3,null))[_0xeb6b('0x47')](handleError(_0x115ee3,null));};exports['addMembers']=function(_0x3b5b0d,_0x5c2e70,_0x2bd1cd){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x3b5b0d[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x5c2e70,null))[_0xeb6b('0x26')](function(_0x3b27b8){if(_0x3b27b8){return _0x3b27b8[_0xeb6b('0x4e')](_0x3b5b0d[_0xeb6b('0x49')][_0xeb6b('0x4f')],_[_0xeb6b('0x50')](_0x3b5b0d[_0xeb6b('0x49')],[_0xeb6b('0x4f'),'id'])||{});}})[_0xeb6b('0x26')](respondWithResult(_0x5c2e70,null))[_0xeb6b('0x47')](handleError(_0x5c2e70,null));};exports[_0xeb6b('0x51')]=function(_0x34ca1e,_0x4a2760,_0x3f76de){var _0x5c2d0b={};var _0x1d85f4={};var _0x569722;var _0x59e762;return db['ChatGroup']['findOne']({'where':{'id':_0x34ca1e[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x4a2760,null))[_0xeb6b('0x26')](function(_0x464ad7){if(_0x464ad7){_0x569722=_0x464ad7;_0x1d85f4[_0xeb6b('0x32')]=_[_0xeb6b('0x2f')](db[_0xeb6b('0x52')][_0xeb6b('0x2b')]);_0x1d85f4[_0xeb6b('0x33')]=_[_0xeb6b('0x2f')](_0x34ca1e[_0xeb6b('0x33')]);_0x1d85f4[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x1d85f4[_0xeb6b('0x32')],_0x1d85f4['query']);_0x5c2d0b[_0xeb6b('0x34')]=_[_0xeb6b('0x31')](_0x1d85f4[_0xeb6b('0x32')],qs[_0xeb6b('0x35')](_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x35')]));_0x5c2d0b[_0xeb6b('0x34')]=_0x5c2d0b[_0xeb6b('0x34')]['length']?_0x5c2d0b['attributes']:_0x1d85f4[_0xeb6b('0x32')];_0x5c2d0b[_0xeb6b('0x53')]=qs['sort'](_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x39')]);_0x5c2d0b[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0x34ca1e[_0xeb6b('0x33')],_0x1d85f4[_0xeb6b('0x30')]));if(_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x3e')]){_0x5c2d0b[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0x5c2d0b['where'],{'$or':_[_0xeb6b('0x2a')](_0x5c2d0b[_0xeb6b('0x34')],function(_0x15d06f){var _0x33c0c2={};_0x33c0c2[_0x15d06f]={'$like':'%'+_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x33c0c2;})});}_0x5c2d0b=_[_0xeb6b('0x3c')]({},_0x5c2d0b,_0x34ca1e[_0xeb6b('0x3f')]);return _0x569722[_0xeb6b('0x51')](_0x5c2d0b);}})[_0xeb6b('0x26')](function(_0x5cd385){if(_0x5cd385){_0x59e762=_0x5cd385['length'];if(!_0x34ca1e[_0xeb6b('0x33')]['hasOwnProperty'](_0xeb6b('0x38'))){_0x5c2d0b[_0xeb6b('0x1e')]=qs['limit'](_0x34ca1e['query'][_0xeb6b('0x1e')]);_0x5c2d0b['offset']=qs[_0xeb6b('0x1d')](_0x34ca1e[_0xeb6b('0x33')]['offset']);}return _0x569722[_0xeb6b('0x51')](_0x5c2d0b);}})['then'](function(_0x3a8590){if(_0x3a8590){return _0x3a8590?{'count':_0x59e762,'rows':_0x3a8590}:null;}})['then'](respondWithResult(_0x4a2760,null))[_0xeb6b('0x47')](handleError(_0x4a2760,null));};exports[_0xeb6b('0x54')]=function(_0x3352ce,_0x46f69f,_0x1e0a10){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x3352ce[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x46f69f,null))[_0xeb6b('0x26')](function(_0x24f2db){if(_0x24f2db){return _0x24f2db[_0xeb6b('0x54')](_0x3352ce[_0xeb6b('0x33')]['ids']);}})[_0xeb6b('0x26')](respondWithStatusCode(_0x46f69f,null))[_0xeb6b('0x47')](handleError(_0x46f69f,null));};exports[_0xeb6b('0x55')]=function(_0x462b81,_0x1d5dd4,_0x5e3759){if(_0x462b81[_0xeb6b('0x49')]['id']){delete _0x462b81[_0xeb6b('0x49')]['id'];}return db['ChatGroup'][_0xeb6b('0x46')]({'where':{'id':_0x462b81[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x1d5dd4,null))['then'](function(_0x220fc1){if(_0x220fc1){_0x462b81['body']['ChatGroupId']=_0x220fc1['id'];return db['ChatInternalMessage'][_0xeb6b('0x48')](_0x462b81[_0xeb6b('0x49')]);}})[_0xeb6b('0x26')](respondWithResult(_0x1d5dd4,null))[_0xeb6b('0x47')](handleError(_0x1d5dd4,null));};exports[_0xeb6b('0x56')]=function(_0x3bf135,_0x3e27a8,_0xe624fd){var _0xdb5070={};var _0x4bc246={};var _0x492430;var _0x32af51;return db[_0xeb6b('0x40')][_0xeb6b('0x57')]({'where':{'id':_0x3bf135[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x3e27a8,null))[_0xeb6b('0x26')](function(_0x3d0a5e){if(_0x3d0a5e){_0x492430=_0x3d0a5e;_0x4bc246[_0xeb6b('0x32')]=_[_0xeb6b('0x2f')](db['ChatInternalMessage'][_0xeb6b('0x2b')]);_0x4bc246[_0xeb6b('0x33')]=_['keys'](_0x3bf135[_0xeb6b('0x33')]);_0x4bc246[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x4bc246[_0xeb6b('0x32')],_0x4bc246[_0xeb6b('0x33')]);_0xdb5070[_0xeb6b('0x34')]=_[_0xeb6b('0x31')](_0x4bc246[_0xeb6b('0x32')],qs[_0xeb6b('0x35')](_0x3bf135[_0xeb6b('0x33')]['fields']));_0xdb5070['attributes']=_0xdb5070['attributes'][_0xeb6b('0x36')]?_0xdb5070[_0xeb6b('0x34')]:_0x4bc246[_0xeb6b('0x32')];_0xdb5070[_0xeb6b('0x53')]=qs[_0xeb6b('0x39')](_0x3bf135[_0xeb6b('0x33')]['sort']);_0xdb5070[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0x3bf135['query'],_0x4bc246[_0xeb6b('0x30')]));if(_0x3bf135['query'][_0xeb6b('0x3e')]){_0xdb5070[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0xdb5070[_0xeb6b('0x3a')],{'$or':_[_0xeb6b('0x2a')](_0xdb5070[_0xeb6b('0x34')],function(_0x37824c){var _0x534e78={};_0x534e78[_0x37824c]={'$like':'%'+_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x534e78;})});}if(_0x3bf135[_0xeb6b('0x33')]['$gte']){var _0x245d17=_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x58')][_0xeb6b('0x59')](',');var _0x466b0f={};_0x466b0f[_0x245d17[0x0]]={'$gte':moment(_0x245d17[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xdb5070[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0xdb5070[_0xeb6b('0x3a')],_0x466b0f);}_0xdb5070=_[_0xeb6b('0x3c')]({},_0xdb5070,_0x3bf135[_0xeb6b('0x3f')]);return _0x492430['getMessages'](_0xdb5070);}})['then'](function(_0xb2e145){if(_0xb2e145){_0x32af51=_0xb2e145[_0xeb6b('0x36')];if(!_0x3bf135['query'][_0xeb6b('0x37')]('nolimit')){_0xdb5070['limit']=qs['limit'](_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x1e')]);_0xdb5070[_0xeb6b('0x1d')]=qs[_0xeb6b('0x1d')](_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x1d')]);}return _0x492430[_0xeb6b('0x56')](_0xdb5070);}})[_0xeb6b('0x26')](function(_0x4c95df){if(_0x4c95df){return _0x4c95df?{'count':_0x32af51,'rows':_0x4c95df}:null;}})[_0xeb6b('0x26')](respondWithResult(_0x3e27a8,null))[_0xeb6b('0x47')](handleError(_0x3e27a8,null));}; \ No newline at end of file +var _0x2caf=['index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','create','body','update','find','params','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','stack','name'];(function(_0x39a968,_0x364d93){var _0x47b0a5=function(_0x17c9dd){while(--_0x17c9dd){_0x39a968['push'](_0x39a968['shift']());}};_0x47b0a5(++_0x364d93);}(_0x2caf,0x96));var _0xf2ca=function(_0x53a68c,_0x540744){_0x53a68c=_0x53a68c-0x0;var _0x29f9c1=_0x2caf[_0x53a68c];return _0x29f9c1;};'use strict';var emlformat=require(_0xf2ca('0x0'));var rimraf=require(_0xf2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ca('0x2'));var rp=require('request-promise');var moment=require(_0xf2ca('0x3'));var BPromise=require(_0xf2ca('0x4'));var Mustache=require(_0xf2ca('0x5'));var util=require(_0xf2ca('0x6'));var path=require(_0xf2ca('0x7'));var sox=require(_0xf2ca('0x8'));var csv=require(_0xf2ca('0x9'));var ejs=require(_0xf2ca('0xa'));var fs=require('fs');var fs_extra=require(_0xf2ca('0xb'));var _=require(_0xf2ca('0xc'));var squel=require(_0xf2ca('0xd'));var crypto=require(_0xf2ca('0xe'));var jsforce=require(_0xf2ca('0xf'));var deskjs=require(_0xf2ca('0x10'));var toCsv=require(_0xf2ca('0x9'));var querystring=require(_0xf2ca('0x11'));var Papa=require(_0xf2ca('0x12'));var Redis=require(_0xf2ca('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf2ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2ca('0x15'))(_0xf2ca('0x16'));var utils=require(_0xf2ca('0x17'));var config=require(_0xf2ca('0x18'));var licenseUtil=require(_0xf2ca('0x19'));var db=require(_0xf2ca('0x1a'))['db'];config[_0xf2ca('0x1b')]=_[_0xf2ca('0x1c')](config[_0xf2ca('0x1b')],{'host':_0xf2ca('0x1d'),'port':0x18eb});var socket=require(_0xf2ca('0x1e'))(new Redis(config[_0xf2ca('0x1b')]));require(_0xf2ca('0x1f'))[_0xf2ca('0x20')](socket);function respondWithStatusCode(_0x45fab2,_0x1797c8){_0x1797c8=_0x1797c8||0xcc;return function(_0x5d8dcf){if(_0x5d8dcf){return _0x45fab2[_0xf2ca('0x21')](_0x1797c8);}return _0x45fab2['status'](_0x1797c8)['end']();};}function respondWithResult(_0x4dc664,_0x19244f){_0x19244f=_0x19244f||0xc8;return function(_0x13569b){if(_0x13569b){return _0x4dc664[_0xf2ca('0x22')](_0x19244f)[_0xf2ca('0x23')](_0x13569b);}};}function respondWithFilteredResult(_0xe74616,_0x1914f4){return function(_0x1d7048){if(_0x1d7048){var _0x1f47b9=typeof _0x1914f4[_0xf2ca('0x24')]===_0xf2ca('0x25')&&typeof _0x1914f4[_0xf2ca('0x26')]==='undefined';var _0x4831d6=_0x1d7048[_0xf2ca('0x27')];var _0x44cece=_0x1f47b9?0x0:_0x1914f4[_0xf2ca('0x24')];var _0x48195e=_0x1f47b9?_0x1d7048['count']:_0x1914f4[_0xf2ca('0x24')]+_0x1914f4[_0xf2ca('0x26')];var _0x1321d8;if(_0x48195e>=_0x4831d6){_0x48195e=_0x4831d6;_0x1321d8=0xc8;}else{_0x1321d8=0xce;}_0xe74616[_0xf2ca('0x22')](_0x1321d8);return _0xe74616[_0xf2ca('0x28')]('Content-Range',_0x44cece+'-'+_0x48195e+'/'+_0x4831d6)['json'](_0x1d7048);}return null;};}function patchUpdates(_0x2fc8e7){return function(_0x3057dd){try{jsonpatch[_0xf2ca('0x29')](_0x3057dd,_0x2fc8e7,!![]);}catch(_0x8cf96){return BPromise['reject'](_0x8cf96);}return _0x3057dd[_0xf2ca('0x2a')]();};}function saveUpdates(_0xbde9ad,_0x2185f8){return function(_0x11c4ac){if(_0x11c4ac){return _0x11c4ac['update'](_0xbde9ad)[_0xf2ca('0x2b')](function(_0x3766d3){return _0x3766d3;});}return null;};}function removeEntity(_0xb06112,_0x2c0c27){return function(_0x4e91df){if(_0x4e91df){return _0x4e91df[_0xf2ca('0x2c')]()['then'](function(){_0xb06112['status'](0xcc)[_0xf2ca('0x2d')]();});}};}function handleEntityNotFound(_0x473b31,_0x4a14d9){return function(_0x598132){if(!_0x598132){_0x473b31[_0xf2ca('0x21')](0x194);}return _0x598132;};}function handleError(_0x571ddf,_0x4e96cc){_0x4e96cc=_0x4e96cc||0x1f4;return function(_0x1d4a1b){logger['error'](_0x1d4a1b[_0xf2ca('0x2e')]);if(_0x1d4a1b[_0xf2ca('0x2f')]){delete _0x1d4a1b[_0xf2ca('0x2f')];}_0x571ddf[_0xf2ca('0x22')](_0x4e96cc)['send'](_0x1d4a1b);};}exports[_0xf2ca('0x30')]=function(_0x1ade32,_0x374c51){var _0x58ddbd={},_0x2e518f={},_0x161665={'count':0x0,'rows':[]};var _0x1ad8b8=_[_0xf2ca('0x31')](db[_0xf2ca('0x32')][_0xf2ca('0x33')],function(_0x3bbe8a){return{'name':_0x3bbe8a[_0xf2ca('0x34')],'type':_0x3bbe8a[_0xf2ca('0x35')]['key']};});_0x2e518f[_0xf2ca('0x36')]=_[_0xf2ca('0x31')](_0x1ad8b8,'name');_0x2e518f[_0xf2ca('0x37')]=_['keys'](_0x1ade32[_0xf2ca('0x37')]);_0x2e518f[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],_0x2e518f[_0xf2ca('0x37')]);_0x58ddbd[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x58ddbd[_0xf2ca('0x3a')]=_0x58ddbd['attributes']['length']?_0x58ddbd[_0xf2ca('0x3a')]:_0x2e518f['model'];if(!_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x58ddbd['limit']=qs['limit'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x58ddbd[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x24')]);}_0x58ddbd[_0xf2ca('0x3e')]=qs['sort'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x58ddbd[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_['pick'](_0x1ade32[_0xf2ca('0x37')],_0x2e518f['filters']),_0x1ad8b8);if(_0x1ade32['query'][_0xf2ca('0x41')]){_0x58ddbd[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x58ddbd['where'],{'$or':_[_0xf2ca('0x31')](_0x1ad8b8,function(_0x40eca9){if(_0x40eca9[_0xf2ca('0x35')]!=='VIRTUAL'){var _0x23f5f7={};_0x23f5f7[_0x40eca9['name']]={'$like':'%'+_0x1ade32[_0xf2ca('0x37')]['filter']+'%'};return _0x23f5f7;}})});}_0x58ddbd=_['merge']({},_0x58ddbd,_0x1ade32[_0xf2ca('0x43')]);var _0x160683={'where':_0x58ddbd[_0xf2ca('0x40')]};return db[_0xf2ca('0x32')]['count'](_0x160683)['then'](function(_0x2243a5){_0x161665[_0xf2ca('0x27')]=_0x2243a5;if(_0x1ade32['query']['includeAll']){_0x58ddbd[_0xf2ca('0x44')]=[{'all':!![]}];}return db[_0xf2ca('0x32')][_0xf2ca('0x45')](_0x58ddbd);})[_0xf2ca('0x2b')](function(_0x1c5f51){_0x161665[_0xf2ca('0x46')]=_0x1c5f51;return _0x161665;})[_0xf2ca('0x2b')](respondWithFilteredResult(_0x374c51,_0x58ddbd))[_0xf2ca('0x47')](handleError(_0x374c51,null));};exports[_0xf2ca('0x48')]=function(_0x48b858,_0x1cb21f){var _0x44ef4a={'raw':!![],'where':{'id':_0x48b858['params']['id']}},_0xd63977={};_0xd63977['model']=_[_0xf2ca('0x49')](db['ChatGroup'][_0xf2ca('0x33')]);_0xd63977[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x48b858['query']);_0xd63977[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],_0xd63977['query']);_0x44ef4a[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],qs['fields'](_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x44ef4a['attributes']=_0x44ef4a['attributes'][_0xf2ca('0x4a')]?_0x44ef4a[_0xf2ca('0x3a')]:_0xd63977['model'];if(_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x4b')]){_0x44ef4a['include']=[{'all':!![]}];}_0x44ef4a=_[_0xf2ca('0x42')]({},_0x44ef4a,_0x48b858['options']);return db['ChatGroup']['find'](_0x44ef4a)[_0xf2ca('0x2b')](handleEntityNotFound(_0x1cb21f,null))[_0xf2ca('0x2b')](respondWithResult(_0x1cb21f,null))[_0xf2ca('0x47')](handleError(_0x1cb21f,null));};exports[_0xf2ca('0x4c')]=function(_0x3d599a,_0x492f05){return db[_0xf2ca('0x32')]['create'](_0x3d599a[_0xf2ca('0x4d')],{})[_0xf2ca('0x2b')](respondWithResult(_0x492f05,0xc9))[_0xf2ca('0x47')](handleError(_0x492f05,null));};exports[_0xf2ca('0x4e')]=function(_0xc33974,_0x310c8d){if(_0xc33974['body']['id']){delete _0xc33974[_0xf2ca('0x4d')]['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0xc33974[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x310c8d,null))['then'](saveUpdates(_0xc33974[_0xf2ca('0x4d')],null))[_0xf2ca('0x2b')](respondWithResult(_0x310c8d,null))[_0xf2ca('0x47')](handleError(_0x310c8d,null));};exports['destroy']=function(_0x47e870,_0xdcbf5b){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x47e870['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xdcbf5b,null))[_0xf2ca('0x2b')](removeEntity(_0xdcbf5b,null))[_0xf2ca('0x47')](handleError(_0xdcbf5b,null));};exports['describe']=function(_0x5ab2e2,_0xcdb771){return db[_0xf2ca('0x32')][_0xf2ca('0x51')]()[_0xf2ca('0x2b')](respondWithResult(_0xcdb771,null))[_0xf2ca('0x47')](handleError(_0xcdb771,null));};exports['getUnread']=function(_0x21453b,_0x5e331c,_0x26420d){return db['ChatInternalMessage'][_0xf2ca('0x27')]({'where':{'ChatGroupId':_0x21453b[_0xf2ca('0x50')]['id'],'ToId':_0x21453b[_0xf2ca('0x52')]['id'],'read':![]}})['then'](function(_0x2c0ae7){return{'id':_[_0xf2ca('0x53')](_0x21453b['params']['id']),'count':_0x2c0ae7};})[_0xf2ca('0x2b')](respondWithResult(_0x5e331c,null))['catch'](handleError(_0x5e331c,null));};exports[_0xf2ca('0x54')]=function(_0x8c2e2f,_0x559a98,_0x278028){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x8c2e2f['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x559a98,null))[_0xf2ca('0x2b')](function(_0x3b819b){if(_0x3b819b){return _0x3b819b[_0xf2ca('0x54')](_0x8c2e2f['body'][_0xf2ca('0x55')],_[_0xf2ca('0x56')](_0x8c2e2f[_0xf2ca('0x4d')],[_0xf2ca('0x55'),'id'])||{});}})[_0xf2ca('0x2b')](respondWithResult(_0x559a98,null))[_0xf2ca('0x47')](handleError(_0x559a98,null));};exports[_0xf2ca('0x57')]=function(_0xd50682,_0x72b8f,_0x36d334){var _0x23af16={};var _0x1d62ba={};var _0x40c3b7;var _0x52221a;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0xd50682[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x72b8f,null))[_0xf2ca('0x2b')](function(_0x5664db){if(_0x5664db){_0x40c3b7=_0x5664db;_0x1d62ba['model']=_[_0xf2ca('0x49')](db[_0xf2ca('0x59')][_0xf2ca('0x33')]);_0x1d62ba[_0xf2ca('0x37')]=_['keys'](_0xd50682[_0xf2ca('0x37')]);_0x1d62ba['filters']=_['intersection'](_0x1d62ba['model'],_0x1d62ba['query']);_0x23af16[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x1d62ba[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x23af16[_0xf2ca('0x3a')]=_0x23af16[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x23af16['attributes']:_0x1d62ba[_0xf2ca('0x36')];_0x23af16['order']=qs[_0xf2ca('0x3f')](_0xd50682['query'][_0xf2ca('0x3f')]);_0x23af16[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_[_0xf2ca('0x5a')](_0xd50682[_0xf2ca('0x37')],_0x1d62ba[_0xf2ca('0x38')]));if(_0xd50682['query'][_0xf2ca('0x41')]){_0x23af16[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x23af16['where'],{'$or':_['map'](_0x23af16[_0xf2ca('0x3a')],function(_0x5ab38b){var _0x556e97={};_0x556e97[_0x5ab38b]={'$like':'%'+_0xd50682[_0xf2ca('0x37')]['filter']+'%'};return _0x556e97;})});}_0x23af16=_[_0xf2ca('0x42')]({},_0x23af16,_0xd50682[_0xf2ca('0x43')]);return _0x40c3b7['getMembers'](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x3d5c5a){if(_0x3d5c5a){_0x52221a=_0x3d5c5a[_0xf2ca('0x4a')];if(!_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x23af16[_0xf2ca('0x26')]=qs['limit'](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x23af16[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0xd50682['query'][_0xf2ca('0x24')]);}return _0x40c3b7[_0xf2ca('0x57')](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x815638){if(_0x815638){return _0x815638?{'count':_0x52221a,'rows':_0x815638}:null;}})[_0xf2ca('0x2b')](respondWithResult(_0x72b8f,null))['catch'](handleError(_0x72b8f,null));};exports[_0xf2ca('0x5b')]=function(_0x2508ec,_0x28be18,_0x39d46a){return db['ChatGroup'][_0xf2ca('0x4f')]({'where':{'id':_0x2508ec[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x28be18,null))[_0xf2ca('0x2b')](function(_0x468a72){if(_0x468a72){return _0x468a72['removeMembers'](_0x2508ec['query']['ids']);}})[_0xf2ca('0x2b')](respondWithStatusCode(_0x28be18,null))['catch'](handleError(_0x28be18,null));};exports[_0xf2ca('0x5c')]=function(_0x106b04,_0x3b4ffb,_0x1077ea){if(_0x106b04['body']['id']){delete _0x106b04['body']['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x106b04['params']['id']}})['then'](handleEntityNotFound(_0x3b4ffb,null))['then'](function(_0x2b7baf){if(_0x2b7baf){_0x106b04[_0xf2ca('0x4d')]['ChatGroupId']=_0x2b7baf['id'];return db[_0xf2ca('0x5d')][_0xf2ca('0x4c')](_0x106b04[_0xf2ca('0x4d')]);}})[_0xf2ca('0x2b')](respondWithResult(_0x3b4ffb,null))[_0xf2ca('0x47')](handleError(_0x3b4ffb,null));};exports[_0xf2ca('0x5e')]=function(_0x2157b3,_0xab284a,_0x173505){var _0x3a4658={};var _0x217c25={};var _0x40bc8b;var _0x4b41ce;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0x2157b3[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xab284a,null))[_0xf2ca('0x2b')](function(_0x1fb538){if(_0x1fb538){_0x40bc8b=_0x1fb538;_0x217c25[_0xf2ca('0x36')]=_[_0xf2ca('0x49')](db[_0xf2ca('0x5d')]['rawAttributes']);_0x217c25[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x2157b3[_0xf2ca('0x37')]);_0x217c25[_0xf2ca('0x38')]=_['intersection'](_0x217c25[_0xf2ca('0x36')],_0x217c25[_0xf2ca('0x37')]);_0x3a4658['attributes']=_[_0xf2ca('0x39')](_0x217c25[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x2157b3['query'][_0xf2ca('0x3b')]));_0x3a4658['attributes']=_0x3a4658[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x3a4658[_0xf2ca('0x3a')]:_0x217c25[_0xf2ca('0x36')];_0x3a4658[_0xf2ca('0x3e')]=qs[_0xf2ca('0x3f')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x3a4658[_0xf2ca('0x40')]=qs['filters'](_['pick'](_0x2157b3['query'],_0x217c25[_0xf2ca('0x38')]));if(_0x2157b3['query']['filter']){_0x3a4658[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],{'$or':_[_0xf2ca('0x31')](_0x3a4658[_0xf2ca('0x3a')],function(_0x17ba04){var _0x433b7f={};_0x433b7f[_0x17ba04]={'$like':'%'+_0x2157b3['query']['filter']+'%'};return _0x433b7f;})});}if(_0x2157b3['query'][_0xf2ca('0x5f')]){var _0x24c227=_0x2157b3['query'][_0xf2ca('0x5f')][_0xf2ca('0x60')](',');var _0xde3057={};_0xde3057[_0x24c227[0x0]]={'$gte':moment(_0x24c227[0x1])[_0xf2ca('0x61')](_0xf2ca('0x62'))};_0x3a4658['where']=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],_0xde3057);}_0x3a4658=_[_0xf2ca('0x42')]({},_0x3a4658,_0x2157b3[_0xf2ca('0x43')]);return _0x40bc8b[_0xf2ca('0x5e')](_0x3a4658);}})['then'](function(_0x1b3d89){if(_0x1b3d89){_0x4b41ce=_0x1b3d89['length'];if(!_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3c')]('nolimit')){_0x3a4658[_0xf2ca('0x26')]=qs[_0xf2ca('0x26')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x3a4658['offset']=qs[_0xf2ca('0x24')](_0x2157b3['query']['offset']);}return _0x40bc8b['getMessages'](_0x3a4658);}})[_0xf2ca('0x2b')](function(_0x1397b3){if(_0x1397b3){return _0x1397b3?{'count':_0x4b41ce,'rows':_0x1397b3}:null;}})['then'](respondWithResult(_0xab284a,null))[_0xf2ca('0x47')](handleError(_0xab284a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index eaee435..5386afe 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 _0x394d=['update','emit','hook','events','save'];(function(_0xf20f37,_0x435fb0){var _0x5185dd=function(_0x4e56ad){while(--_0x4e56ad){_0xf20f37['push'](_0xf20f37['shift']());}};_0x5185dd(++_0x435fb0);}(_0x394d,0x12a));var _0xd394=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x394d[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0xd394('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd394('0x1'),'afterUpdate':_0xd394('0x2'),'afterDestroy':'remove'};function emitEvent(_0x410368){return function(_0x499c7c,_0x278b36,_0x5c765b){ChatGroupEvents['emit'](_0x410368+':'+_0x499c7c['id'],_0x499c7c);ChatGroupEvents[_0xd394('0x3')](_0x410368,_0x499c7c);_0x5c765b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd394('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x3504=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x3504,0xce));var _0x4350=function(_0x53aad7,_0x3964c7){_0x53aad7=_0x53aad7-0x0;var _0x3be51e=_0x3504[_0x53aad7];return _0x3be51e;};'use strict';var EventEmitter=require(_0x4350('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4350('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4350('0x2'),'afterDestroy':_0x4350('0x3')};function emitEvent(_0x568470){return function(_0x1b5485,_0x3b0f42,_0x5aa5a3){ChatGroupEvents[_0x4350('0x4')](_0x568470+':'+_0x1b5485['id'],_0x1b5485);ChatGroupEvents[_0x4350('0x4')](_0x568470,_0x1b5485);_0x5aa5a3(null);};}for(var e in events){if(events[_0x4350('0x5')](e)){var event=events[e];ChatGroup[_0x4350('0x6')](e,emitEvent(event));}}module[_0x4350('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 368b288..b42bfce 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 _0x0e48=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x0e48,0x120));var _0x80e4=function(_0x9fe87c,_0x1e9f2c){_0x9fe87c=_0x9fe87c-0x0;var _0x4822c5=_0x0e48[_0x9fe87c];return _0x4822c5;};'use strict';var _=require(_0x80e4('0x0'));var util=require(_0x80e4('0x1'));var logger=require(_0x80e4('0x2'))('api');var moment=require(_0x80e4('0x3'));var BPromise=require(_0x80e4('0x4'));var rp=require(_0x80e4('0x5'));var fs=require('fs');var path=require(_0x80e4('0x6'));var rimraf=require(_0x80e4('0x7'));var config=require('../../config/environment');var attributes=require(_0x80e4('0x8'));module[_0x80e4('0x9')]=function(_0x418f2a,_0x244386){return _0x418f2a[_0x80e4('0xa')](_0x80e4('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b82=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4b82,0xb6));var _0x24b8=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x4b82[_0x1b3564];return _0x504069;};'use strict';var _=require(_0x24b8('0x0'));var util=require(_0x24b8('0x1'));var logger=require(_0x24b8('0x2'))(_0x24b8('0x3'));var moment=require(_0x24b8('0x4'));var BPromise=require(_0x24b8('0x5'));var rp=require(_0x24b8('0x6'));var fs=require('fs');var path=require(_0x24b8('0x7'));var rimraf=require(_0x24b8('0x8'));var config=require(_0x24b8('0x9'));var attributes=require(_0x24b8('0xa'));module[_0x24b8('0xb')]=function(_0x2d82e0,_0x28c432){return _0x2d82e0[_0x24b8('0xc')](_0x24b8('0xd'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 83beb49..cca9a8d 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 _0x6b6d=['redis','defaults','localhost','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x6b6d,0xbd));var _0xd6b6=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x6b6d[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var moment=require(_0xd6b6('0x2'));var BPromise=require(_0xd6b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b6('0x4'));var db=require(_0xd6b6('0x5'))['db'];var utils=require(_0xd6b6('0x6'));var logger=require(_0xd6b6('0x7'))('rpc');var config=require(_0xd6b6('0x8'));var jayson=require(_0xd6b6('0x9'));var client=jayson[_0xd6b6('0xa')]['http']({'port':0x232a});config[_0xd6b6('0xb')]=_[_0xd6b6('0xc')](config[_0xd6b6('0xb')],{'host':_0xd6b6('0xd'),'port':0x18eb});var socket=require(_0xd6b6('0xe'))(new Redis(config[_0xd6b6('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x362edc,_0x72ece2,_0x4d918d){return new BPromise(function(_0x3a5bf,_0x212d48){return client[_0xd6b6('0xf')](_0x362edc,_0x4d918d)[_0xd6b6('0x10')](function(_0x1d002b){logger[_0xd6b6('0x11')](_0xd6b6('0x12'),_0x72ece2,_0xd6b6('0x13'));logger[_0xd6b6('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x72ece2,_0xd6b6('0x13'),JSON[_0xd6b6('0x15')](_0x1d002b));if(_0x1d002b[_0xd6b6('0x16')]){if(_0x1d002b[_0xd6b6('0x16')]['code']===0x1f4){logger[_0xd6b6('0x16')](_0xd6b6('0x12'),_0x72ece2,_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);return _0x212d48(_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);}logger[_0xd6b6('0x16')](_0xd6b6('0x12'),_0x72ece2,_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);return _0x3a5bf(_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);}else{logger[_0xd6b6('0x11')](_0xd6b6('0x12'),_0x72ece2,_0xd6b6('0x13'));_0x3a5bf(_0x1d002b['result'][_0xd6b6('0x17')]);}})[_0xd6b6('0x18')](function(_0x13023b){logger[_0xd6b6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x72ece2,_0x13023b);_0x212d48(_0x13023b);});});} \ No newline at end of file +var _0xf88f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3e19e3,_0x232e8c){var _0x59e523=function(_0x4a9240){while(--_0x4a9240){_0x3e19e3['push'](_0x3e19e3['shift']());}};_0x59e523(++_0x232e8c);}(_0xf88f,0x1bb));var _0xff88=function(_0x19b31d,_0x4ec9aa){_0x19b31d=_0x19b31d-0x0;var _0x498fbf=_0xf88f[_0x19b31d];return _0x498fbf;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var moment=require(_0xff88('0x2'));var BPromise=require(_0xff88('0x3'));var rs=require(_0xff88('0x4'));var fs=require('fs');var Redis=require(_0xff88('0x5'));var db=require(_0xff88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xff88('0x7'))(_0xff88('0x8'));var config=require(_0xff88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff88('0xa')][_0xff88('0xb')]({'port':0x232a});config[_0xff88('0xc')]=_[_0xff88('0xd')](config[_0xff88('0xc')],{'host':_0xff88('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff88('0xc')]));require(_0xff88('0xf'))[_0xff88('0x10')](socket);function respondWithRpcPromise(_0x4715fc,_0x3d5534,_0x3dcefc){return new BPromise(function(_0x22bca3,_0x178fc4){return client[_0xff88('0x11')](_0x4715fc,_0x3dcefc)[_0xff88('0x12')](function(_0xc1ee70){logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,_0xff88('0x15'));logger[_0xff88('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3d5534,_0xff88('0x15'),JSON[_0xff88('0x17')](_0xc1ee70));if(_0xc1ee70[_0xff88('0x18')]){if(_0xc1ee70['error'][_0xff88('0x19')]===0x1f4){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x178fc4(_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);}logger[_0xff88('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x22bca3(_0xc1ee70['error']['message']);}else{logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,'request\x20sent');_0x22bca3(_0xc1ee70[_0xff88('0x1b')][_0xff88('0x1a')]);}})['catch'](function(_0x2bafb1){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0x2bafb1);_0x178fc4(_0x2bafb1);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a74d961..cd9a837 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 _0xa016=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0xe033e7,_0x561a6d){var _0x63031f=function(_0x246e1f){while(--_0x246e1f){_0xe033e7['push'](_0xe033e7['shift']());}};_0x63031f(++_0x561a6d);}(_0xa016,0x119));var _0x6a01=function(_0x42e328,_0x144e7a){_0x42e328=_0x42e328-0x0;var _0x10292f=_0xa016[_0x42e328];return _0x10292f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6a01('0x0'),_0x6a01('0x1'),_0x6a01('0x2')];function createListener(_0x362315,_0x5cc973){return function(_0x3f1ba9){_0x5cc973[_0x6a01('0x3')](_0x362315,_0x3f1ba9);};}function removeListener(_0x5ab575,_0x5961d2){return function(){ChatGroupEvents[_0x6a01('0x4')](_0x5ab575,_0x5961d2);};}exports[_0x6a01('0x5')]=function(_0x273c9e){for(var _0x48fa8f=0x0,_0x10b044=events[_0x6a01('0x6')];_0x48fa8f<_0x10b044;_0x48fa8f++){var _0x3dc5a2=events[_0x48fa8f];var _0x5c19ae=createListener(_0x6a01('0x7')+_0x3dc5a2,_0x273c9e);ChatGroupEvents['on'](_0x3dc5a2,_0x5c19ae);}}; \ No newline at end of file +var _0x8e68=['save','remove','emit','removeListener','register','length','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e68,0x1e2));var _0x88e6=function(_0x277a4a,_0x4300e0){_0x277a4a=_0x277a4a-0x0;var _0x404ea6=_0x8e68[_0x277a4a];return _0x404ea6;};'use strict';var ChatGroupEvents=require(_0x88e6('0x0'));var events=[_0x88e6('0x1'),_0x88e6('0x2'),'update'];function createListener(_0x3acbaa,_0x10d1bf){return function(_0x10e2be){_0x10d1bf[_0x88e6('0x3')](_0x3acbaa,_0x10e2be);};}function removeListener(_0x5b83f7,_0x596e97){return function(){ChatGroupEvents[_0x88e6('0x4')](_0x5b83f7,_0x596e97);};}exports[_0x88e6('0x5')]=function(_0x34a1cc){for(var _0x5a214c=0x0,_0x100b9e=events[_0x88e6('0x6')];_0x5a214c<_0x100b9e;_0x5a214c++){var _0x1c72f4=events[_0x5a214c];var _0x5aea6c=createListener('chatGroup:'+_0x1c72f4,_0x34a1cc);ChatGroupEvents['on'](_0x1c72f4,_0x5aea6c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c5e4643..39cbe4f 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 _0x1c87=['index','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated'];(function(_0x41352a,_0x246ea2){var _0x3e392f=function(_0x11a5a6){while(--_0x11a5a6){_0x41352a['push'](_0x41352a['shift']());}};_0x3e392f(++_0x246ea2);}(_0x1c87,0x155));var _0x71c8=function(_0x2f5bf7,_0x428282){_0x2f5bf7=_0x2f5bf7-0x0;var _0x42128a=_0x1c87[_0x2f5bf7];return _0x42128a;};'use strict';var multer=require(_0x71c8('0x0'));var util=require(_0x71c8('0x1'));var path=require(_0x71c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x71c8('0x3'));var router=express[_0x71c8('0x4')]();var fs_extra=require(_0x71c8('0x5'));var auth=require(_0x71c8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71c8('0x7'));router[_0x71c8('0x8')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0xa')]);router[_0x71c8('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x71c8('0x8')](_0x71c8('0xb'),auth['isAuthenticated'](),controller[_0x71c8('0xc')]);router[_0x71c8('0x8')](_0x71c8('0xd'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xe')]);router[_0x71c8('0x8')](_0x71c8('0xf'),auth['isAuthenticated'](),controller[_0x71c8('0x10')]);router[_0x71c8('0x8')](_0x71c8('0x11'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x12')]);router[_0x71c8('0x13')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0x14')]);router[_0x71c8('0x13')](_0x71c8('0xf'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x15')]);router['post'](_0x71c8('0x11'),auth['isAuthenticated'](),controller[_0x71c8('0x16')]);router['put'](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x17')]);router[_0x71c8('0x18')](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x19')]);router[_0x71c8('0x18')](_0x71c8('0xf'),auth[_0x71c8('0x9')](),controller['removeMembers']);module[_0x71c8('0x1a')]=router; \ No newline at end of file +var _0x452e=['/:id/messages','post','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x452e,0x96));var _0xe452=function(_0x5d64b0,_0x27840e){_0x5d64b0=_0x5d64b0-0x0;var _0x1f7342=_0x452e[_0x5d64b0];return _0x1f7342;};'use strict';var multer=require(_0xe452('0x0'));var util=require(_0xe452('0x1'));var path=require('path');var timeout=require(_0xe452('0x2'));var express=require(_0xe452('0x3'));var router=express[_0xe452('0x4')]();var fs_extra=require(_0xe452('0x5'));var auth=require(_0xe452('0x6'));var interaction=require(_0xe452('0x7'));var config=require(_0xe452('0x8'));var controller=require('./chatGroup.controller');router[_0xe452('0x9')]('/',auth[_0xe452('0xa')](),controller[_0xe452('0xb')]);router[_0xe452('0x9')](_0xe452('0xc'),auth[_0xe452('0xa')](),controller[_0xe452('0xd')]);router[_0xe452('0x9')](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0xf')]);router[_0xe452('0x9')](_0xe452('0x10'),auth[_0xe452('0xa')](),controller[_0xe452('0x11')]);router[_0xe452('0x9')]('/:id/members',auth[_0xe452('0xa')](),controller['getMembers']);router[_0xe452('0x9')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller['getMessages']);router[_0xe452('0x13')]('/',auth[_0xe452('0xa')](),controller['create']);router[_0xe452('0x13')](_0xe452('0x14'),auth[_0xe452('0xa')](),controller[_0xe452('0x15')]);router[_0xe452('0x13')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller[_0xe452('0x16')]);router[_0xe452('0x17')](_0xe452('0xe'),auth['isAuthenticated'](),controller[_0xe452('0x18')]);router['delete'](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0x19')]);router[_0xe452('0x1a')]('/:id/members',auth[_0xe452('0xa')](),controller[_0xe452('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index fc89997..350cabf 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 _0xf7b4=['ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','INTEGER'];(function(_0x408e07,_0x4d1a56){var _0x5c7fb7=function(_0x1b4031){while(--_0x1b4031){_0x408e07['push'](_0x408e07['shift']());}};_0x5c7fb7(++_0x4d1a56);}(_0xf7b4,0x152));var _0x4f7b=function(_0xe9f4a2,_0x50f0c4){_0xe9f4a2=_0xe9f4a2-0x0;var _0x25e066=_0xf7b4[_0xe9f4a2];return _0x25e066;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4f7b('0x1')]},'ratingType':{'type':Sequelize[_0x4f7b('0x2')]('star','thumb'),'defaultValue':_0x4f7b('0x3')},'ratingMessage':{'type':Sequelize[_0x4f7b('0x4')]},'pathTranscript':{'type':Sequelize[_0x4f7b('0x4')]},'mailTranscript':{'type':Sequelize[_0x4f7b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4f7b('0x6')]},'disposition':{'type':Sequelize[_0x4f7b('0x5')]},'secondDisposition':{'type':Sequelize[_0x4f7b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4f7b('0x5')]},'note':{'type':Sequelize[_0x4f7b('0x5')]},'browserName':{'type':Sequelize[_0x4f7b('0x5')]},'browserVersion':{'type':Sequelize[_0x4f7b('0x5')]},'osName':{'type':Sequelize[_0x4f7b('0x5')]},'osVersion':{'type':Sequelize[_0x4f7b('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x4f7b('0x5')]},'deviceType':{'type':Sequelize[_0x4f7b('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4f7b('0x5')]},'formData':{'type':Sequelize[_0x4f7b('0x4')](_0x4f7b('0x7'))},'read1stAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4f7b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4f7b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4f7b('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xce3a=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x893787,_0x2ecfe4){var _0x4d2cb0=function(_0x486640){while(--_0x486640){_0x893787['push'](_0x893787['shift']());}};_0x4d2cb0(++_0x2ecfe4);}(_0xce3a,0x194));var _0xace3=function(_0x37fadf,_0xb0cf13){_0x37fadf=_0x37fadf-0x0;var _0x5b8739=_0xce3a[_0x37fadf];return _0x5b8739;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'closed':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xace3('0x3')]},'ratingType':{'type':Sequelize[_0xace3('0x4')](_0xace3('0x5'),_0xace3('0x6')),'defaultValue':_0xace3('0x5')},'ratingMessage':{'type':Sequelize[_0xace3('0x7')]},'pathTranscript':{'type':Sequelize[_0xace3('0x7')]},'mailTranscript':{'type':Sequelize[_0xace3('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xace3('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xace3('0x8')]},'thirdDisposition':{'type':Sequelize[_0xace3('0x8')]},'note':{'type':Sequelize[_0xace3('0x8')]},'browserName':{'type':Sequelize[_0xace3('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xace3('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xace3('0x8')]},'deviceVendor':{'type':Sequelize[_0xace3('0x8')]},'deviceType':{'type':Sequelize[_0xace3('0x8')]},'referer':{'type':Sequelize[_0xace3('0x7')]},'customerIp':{'type':Sequelize[_0xace3('0x8')]},'formData':{'type':Sequelize[_0xace3('0x7')](_0xace3('0xa'))},'read1stAt':{'type':Sequelize[_0xace3('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xace3('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 3743b38..dc896d8 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 _0x7815=['body','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooMetadata','vidaooApiKey','user','name','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','UserId','Visitor','website_alias','System','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','intersection','hasOwnProperty','nolimit','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','getMyMessages','order','pick','includeAgent','push','setTags','omit','spread','Tag','emit','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','read','Account','Owner','Chat','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','createWriteStream','firstName','lastName','value','renderFile','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','json','destroy','end','stack','send','render','merge','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','show','params','model','keys','ChatInteraction','query','filters','fields','attributes','length','includeAll','find','create','update'];(function(_0x26f03d,_0x4866c2){var _0x42dc9f=function(_0x110528){while(--_0x110528){_0x26f03d['push'](_0x26f03d['shift']());}};_0x42dc9f(++_0x4866c2);}(_0x7815,0x15c));var _0x5781=function(_0x231717,_0x280141){_0x231717=_0x231717-0x0;var _0x9a8e7b=_0x7815[_0x231717];return _0x9a8e7b;};'use strict';var rimraf=require(_0x5781('0x0'));var zipdir=require(_0x5781('0x1'));var rp=require('request-promise');var moment=require(_0x5781('0x2'));var BPromise=require(_0x5781('0x3'));var Mustache=require('mustache');var util=require(_0x5781('0x4'));var path=require(_0x5781('0x5'));var ejs=require(_0x5781('0x6'));var fs=require('fs');var _=require(_0x5781('0x7'));var Redis=require('ioredis');var interaction=require(_0x5781('0x8'));var qs=require(_0x5781('0x9'));var pdf=require(_0x5781('0xa'));var logger=require(_0x5781('0xb'))(_0x5781('0xc'));var config=require(_0x5781('0xd'));var db=require(_0x5781('0xe'))['db'];config[_0x5781('0xf')]=_[_0x5781('0x10')](config[_0x5781('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x5781('0x11'))(new Redis(config[_0x5781('0xf')]));require(_0x5781('0x12'))[_0x5781('0x13')](socket);var jayson=require(_0x5781('0x14'));var client=jayson[_0x5781('0x15')][_0x5781('0x16')]({'port':0x232b});var client9004=jayson[_0x5781('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19f607,_0x14c0ef,_0x3d1445,_0x32b9fa){return new BPromise(function(_0x5bb0c7,_0x1147b2){var _0x457586=_0x32b9fa||client;return _0x457586['request'](_0x19f607,_0x3d1445)[_0x5781('0x17')](function(_0x2242c1){logger[_0x5781('0x18')](_0x5781('0x19'),_0x14c0ef,_0x5781('0x1a'));logger[_0x5781('0x1b')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x14c0ef,_0x5781('0x1a'),JSON[_0x5781('0x1c')](_0x2242c1));if(_0x2242c1['error']){if(_0x2242c1[_0x5781('0x1d')][_0x5781('0x1e')]===0x1f4){logger[_0x5781('0x1d')](_0x5781('0x19'),_0x14c0ef,_0x2242c1[_0x5781('0x1d')][_0x5781('0x1f')]);return _0x1147b2(_0x2242c1[_0x5781('0x1d')]['message']);}logger[_0x5781('0x1d')](_0x5781('0x19'),_0x14c0ef,_0x2242c1[_0x5781('0x1d')]['message']);return _0x5bb0c7(_0x2242c1['error'][_0x5781('0x1f')]);}else{logger['info'](_0x5781('0x19'),_0x14c0ef,_0x5781('0x1a'));_0x5bb0c7(_0x2242c1[_0x5781('0x20')]['message']);}})[_0x5781('0x21')](function(_0x5156e1){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x14c0ef,_0x5156e1);_0x1147b2(_0x5156e1);});});}function respondWithStatusCode(_0xb3835e,_0x2e0252){_0x2e0252=_0x2e0252||0xcc;return function(_0x3d2c12){if(_0x3d2c12){return _0xb3835e[_0x5781('0x22')](_0x2e0252);}return _0xb3835e[_0x5781('0x23')](_0x2e0252)['end']();};}function respondWithResult(_0x12220c,_0x102d43){_0x102d43=_0x102d43||0xc8;return function(_0x3a211e){if(_0x3a211e){return _0x12220c['status'](_0x102d43)['json'](_0x3a211e);}};}function respondWithFilteredResult(_0x2943c6,_0x3f6a94){return function(_0x2dc69d){if(_0x2dc69d){var _0x50671b=typeof _0x3f6a94[_0x5781('0x24')]==='undefined'&&typeof _0x3f6a94[_0x5781('0x25')]===_0x5781('0x26');var _0x3740e8=_0x2dc69d[_0x5781('0x27')];var _0x1d108d=_0x50671b?0x0:_0x3f6a94['offset'];var _0x3166f8=_0x50671b?_0x2dc69d['count']:_0x3f6a94[_0x5781('0x24')]+_0x3f6a94[_0x5781('0x25')];var _0x13a4a0;if(_0x3166f8>=_0x3740e8){_0x3166f8=_0x3740e8;_0x13a4a0=0xc8;}else{_0x13a4a0=0xce;}_0x2943c6['status'](_0x13a4a0);return _0x2943c6['set']('Content-Range',_0x1d108d+'-'+_0x3166f8+'/'+_0x3740e8)[_0x5781('0x28')](_0x2dc69d);}return null;};}function saveUpdates(_0x4da3a5){return function(_0x19eb31){if(_0x19eb31){return _0x19eb31['update'](_0x4da3a5)[_0x5781('0x17')](function(_0x4e98d6){return _0x4e98d6;});}return null;};}function removeEntity(_0x4cf40a){return function(_0x4d3367){if(_0x4d3367){return _0x4d3367[_0x5781('0x29')]()['then'](function(){_0x4cf40a[_0x5781('0x23')](0xcc)[_0x5781('0x2a')]();});}};}function handleEntityNotFound(_0x5db684){return function(_0x2216b5){if(!_0x2216b5){_0x5db684[_0x5781('0x22')](0x194);}return _0x2216b5;};}function handleError(_0x21bdfb,_0x15b46e){_0x15b46e=_0x15b46e||0x1f4;return function(_0x15f309){logger['error'](_0x15f309[_0x5781('0x2b')]);if(_0x15f309['name']){delete _0x15f309['name'];}_0x21bdfb['status'](_0x15b46e)[_0x5781('0x2c')](_0x15f309);};}function getMustacheRender(_0x153f99,_0x65b51){return Mustache[_0x5781('0x2d')](_0x153f99,_[_0x5781('0x2e')](_0x65b51['body'],{'contact':_0x65b51[_0x5781('0x2f')],'message':_0x65b51[_0x5781('0x1f')],'agent':_0x65b51[_0x5781('0x30')],'interaction':_0x65b51[_0x5781('0x31')],'account':_0x65b51[_0x5781('0x32')]}))||'';}exports[_0x5781('0x33')]=function(_0x5ccff4,_0x578616){var _0x2c4398={};var _0x11ceb7=_[_0x5781('0x34')](db['ChatInteraction'][_0x5781('0x35')],function(_0x43c61d){return{'name':_0x43c61d[_0x5781('0x36')],'type':_0x43c61d[_0x5781('0x37')][_0x5781('0x38')]};});_0x2c4398=qs[_0x5781('0x39')](_0x11ceb7,_0x5ccff4);return interaction[_0x5781('0x3a')](_0x5781('0x3b'),_0x5ccff4['query'],_0x5ccff4['user'],_0x2c4398,_0x11ceb7)[_0x5781('0x17')](respondWithFilteredResult(_0x578616,_0x2c4398))[_0x5781('0x21')](handleError(_0x578616,null));};exports[_0x5781('0x3c')]=function(_0x5a1fd1,_0xb83d0d){var _0x24dded={'raw':![],'where':{'id':_0x5a1fd1[_0x5781('0x3d')]['id']}},_0x493d2e={};_0x493d2e[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x40')]['rawAttributes']);_0x493d2e[_0x5781('0x41')]=_[_0x5781('0x3f')](_0x5a1fd1[_0x5781('0x41')]);_0x493d2e[_0x5781('0x42')]=_['intersection'](_0x493d2e[_0x5781('0x3e')],_0x493d2e[_0x5781('0x41')]);_0x24dded['attributes']=_['intersection'](_0x493d2e[_0x5781('0x3e')],qs['fields'](_0x5a1fd1[_0x5781('0x41')][_0x5781('0x43')]));_0x24dded[_0x5781('0x44')]=_0x24dded['attributes'][_0x5781('0x45')]?_0x24dded[_0x5781('0x44')]:_0x493d2e[_0x5781('0x3e')];if(_0x5a1fd1[_0x5781('0x41')][_0x5781('0x46')]){_0x24dded['include']=[{'all':!![]}];}_0x24dded=_[_0x5781('0x2e')]({},_0x24dded,_0x5a1fd1['options']);return db[_0x5781('0x40')][_0x5781('0x47')](_0x24dded)[_0x5781('0x17')](handleEntityNotFound(_0xb83d0d,null))[_0x5781('0x17')](respondWithResult(_0xb83d0d,null))[_0x5781('0x21')](handleError(_0xb83d0d,null));};exports[_0x5781('0x48')]=function(_0x888371,_0x34d05f){return db[_0x5781('0x40')][_0x5781('0x48')](_0x888371['body'],{})[_0x5781('0x17')](respondWithResult(_0x34d05f,0xc9))[_0x5781('0x21')](handleError(_0x34d05f,null));};exports[_0x5781('0x49')]=function(_0x50d713,_0x49c9ce){if(_0x50d713[_0x5781('0x4a')]['id']){delete _0x50d713[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x50d713[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x49c9ce,null))[_0x5781('0x17')](saveUpdates(_0x50d713['body'],null))['then'](respondWithResult(_0x49c9ce,null))[_0x5781('0x21')](handleError(_0x49c9ce,null));};exports[_0x5781('0x29')]=function(_0x946f34,_0x32419d){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x946f34[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x32419d,null))[_0x5781('0x17')](removeEntity(_0x32419d,null))[_0x5781('0x21')](handleError(_0x32419d,null));};exports[_0x5781('0x4b')]=function(_0x36e4fb,_0x36b276){return db['ChatInteraction'][_0x5781('0x4b')]()[_0x5781('0x17')](respondWithResult(_0x36b276,null))[_0x5781('0x21')](handleError(_0x36b276,null));};exports[_0x5781('0x4c')]=function(_0x5a2600,_0x10ca02){var _0x205adf=_0x5a2600[_0x5781('0x3d')]['id'];var _0x30c77e;var _0x3552a4;var _0x3b9ada;return db[_0x5781('0x40')][_0x5781('0x4d')]({'where':{'id':_0x205adf}})['then'](function(_0x1b845b){_0x30c77e=_0x1b845b;return db[_0x5781('0x4e')][_0x5781('0x4d')]({'where':{'id':_0x1b845b['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x5781('0x4f'),'vidaooNote',_0x5781('0x50')],'raw':!![]});})[_0x5781('0x17')](function(_0x5d2515){if(_0x5d2515&&_0x5d2515[_0x5781('0x51')]&&_0x5d2515['vidaooEscalation']){_0x3552a4=_0x5d2515;var _0x139c42={'interaction':{'id':_0x205adf},'agent':{'id':_0x5a2600[_0x5781('0x52')]['id'],'name':_0x5a2600[_0x5781('0x52')][_0x5781('0x53')],'fullname':_0x5a2600[_0x5781('0x52')][_0x5781('0x54')],'email':_0x5a2600[_0x5781('0x52')][_0x5781('0x55')]},'contact':_0x5a2600[_0x5781('0x4a')][_0x5781('0x2f')],'account':_0x5a2600[_0x5781('0x4a')][_0x5781('0x32')]};var _0x340f35={'rejectUnauthorized':![],'method':'POST','url':_0x5781('0x56'),'headers':{'X-APIKEY':_0x5d2515['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5a2600[_0x5781('0x52')][_0x5781('0x55')]],'buttons':null,'topic':_0x3552a4[_0x5781('0x4f')],'note':_['isNull'](_0x3552a4[_0x5781('0x57')])?null:getMustacheRender(_0x3552a4['vidaooNote'],_0x139c42),'metadata':null},'redirect':_0x5781('0x58'),'json':!![]};try{if(!_[_0x5781('0x59')](_0x3552a4[_0x5781('0x50')])){var _0x2751ee=getMustacheRender(_0x3552a4[_0x5781('0x50')],_0x139c42);var _0x4670b1=JSON[_0x5781('0x5a')](_0x2751ee);_0x340f35[_0x5781('0x4a')]['metadata']=_0x4670b1;}}catch(_0x56bfc6){throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x5c'));}return rp(_0x340f35);}else{throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x5d'));}})[_0x5781('0x17')](function(_0x54796f){_0x3b9ada=_0x54796f;if(_0x3b9ada['id']){var _0x1f7731={'body':_0x3b9ada[_0x5781('0x5e')],'ChatWebsiteId':_0x3552a4['id'],'ChatInteractionId':_0x30c77e['id'],'direction':_0x5781('0x5f'),'UserId':_0x5a2600[_0x5781('0x52')]['id']};return db[_0x5781('0x60')][_0x5781('0x48')](_0x1f7731,{});}else{throw new db[(_0x5781('0x5b'))][(_0x5781('0x61'))](_0x5781('0x62'));}})[_0x5781('0x17')](function(){return _0x30c77e[_0x5781('0x63')]({'vidaooSessionId':_0x3b9ada['id']});})[_0x5781('0x17')](respondWithResult(_0x10ca02,null))[_0x5781('0x21')](handleError(_0x10ca02,null));};exports[_0x5781('0x64')]=function(_0x546adc,_0x49c2d8){if(_0x546adc[_0x5781('0x4a')]['id']){delete _0x546adc[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x546adc[_0x5781('0x3d')]['id']},'include':[{'model':db[_0x5781('0x65')],'as':_0x5781('0x66')}]})['then'](handleEntityNotFound(_0x49c2d8,null))[_0x5781('0x17')](saveUpdates(_0x546adc[_0x5781('0x4a')],null))['then'](respondWithResult(_0x49c2d8,null))[_0x5781('0x21')](handleError(_0x49c2d8,null));};exports[_0x5781('0x67')]=function(_0x53deff,_0x4ba5b9){if(_0x53deff[_0x5781('0x4a')]['id']){delete _0x53deff[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x53deff[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](function(_0x26246b){if(!_0x26246b){logger[_0x5781('0x1d')](_0x5781('0x68'),_0x5781('0x67'),0x194,_0x5781('0x69'));_0x4ba5b9[_0x5781('0x22')](0x194);}else{if(_0x26246b['UserId']){throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x6a'));}}return _0x26246b;})[_0x5781('0x17')](function(_0x3fb290){if(_0x3fb290){return _0x3fb290[_0x5781('0x49')]({'closed':_0x53deff[_0x5781('0x4a')][_0x5781('0x6b')],'disposition':_0x53deff['body'][_0x5781('0x6c')]})['then'](function(_0x4dfdeb){return _0x4dfdeb;});}})[_0x5781('0x17')](function(){return respondWithRpcPromise(_0x5781('0x6d'),_0x5781('0x67'),_0x53deff[_0x5781('0x4a')],client9004);})['then'](respondWithResult(_0x4ba5b9,null))[_0x5781('0x21')](handleError(_0x4ba5b9,null));};exports['attachmentUpload']=function(_0x5bdf8b,_0x43d196){_0x5bdf8b[_0x5781('0x4a')]['name']=_0x5bdf8b[_0x5781('0x6e')][_0x5781('0x6f')];_0x5bdf8b[_0x5781('0x4a')]['basename']=_0x5bdf8b[_0x5781('0x6e')][_0x5781('0x70')];_0x5bdf8b[_0x5781('0x4a')][_0x5781('0x37')]=_0x5bdf8b['file'][_0x5781('0x71')];return db['Attachment'][_0x5781('0x48')](_0x5bdf8b[_0x5781('0x4a')])[_0x5781('0x17')](respondWithResult(_0x43d196,0xc9))[_0x5781('0x21')](handleError(_0x43d196,null));};exports[_0x5781('0x72')]=function(_0x5c2c5b,_0x28e8d4){return db[_0x5781('0x40')]['findOne']({'where':{'id':_0x5c2c5b[_0x5781('0x3d')]['id']},'raw':!![]})[_0x5781('0x17')](handleEntityNotFound(_0x28e8d4,null))['then'](function(_0x5479dc){if(_0x5479dc){if(_0x5479dc[_0x5781('0x6b')]){return _0x28e8d4[_0x5781('0x23')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x5781('0x73')]['findOne']({'where':{'id':_0x5c2c5b[_0x5781('0x41')][_0x5781('0x74')]},'raw':!![]})[_0x5781('0x17')](handleEntityNotFound(_0x28e8d4,null));}})[_0x5781('0x17')](function(_0x16e01e){if(_0x16e01e){var _0x248d65=_0x16e01e[_0x5781('0x75')]!==null;var _0x5e576f=path[_0x5781('0x76')](config[_0x5781('0x77')],'server/files/attachments/');if(_0x248d65){_0x5e576f=path['join'](_0x5e576f,_0x5781('0x78'));}var _0x504b1a=path[_0x5781('0x76')](_0x5e576f,_0x16e01e[_0x5781('0x79')]);return _0x28e8d4[_0x5781('0x7a')](_0x504b1a);}})['catch'](handleError(_0x28e8d4,null));};exports[_0x5781('0x7b')]=function(_0x548f92,_0x532e56){var _0x4403a3=null;var _0x250cdd=null;var _0x5a59d5=null;if(_0x548f92['body']['id']){delete _0x548f92[_0x5781('0x4a')]['id'];}if(_0x548f92[_0x5781('0x4a')]['mailTranscript']){_0x5a59d5=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0x7c'),util[_0x5781('0x7d')]('transcript-%s.txt',Date[_0x5781('0x7e')]()));_0x548f92[_0x5781('0x4a')][_0x5781('0x7f')]=_0x5a59d5;}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x548f92[_0x5781('0x3d')]['id']},'include':[{'model':db[_0x5781('0x60')],'as':_0x5781('0x80'),'include':[{'model':db[_0x5781('0x81')],'as':_0x5781('0x81')}]}]})[_0x5781('0x17')](handleEntityNotFound(_0x532e56,null))[_0x5781('0x17')](saveUpdates(_0x548f92[_0x5781('0x4a')],null))[_0x5781('0x17')](function(_0x28b242){if(_0x28b242){_0x4403a3=_0x28b242;return db['ChatWebsite']['find']({'where':{'id':_0x4403a3[_0x5781('0x82')]}});}})[_0x5781('0x17')](function(_0xbbb5a1){if(_0xbbb5a1){_0x250cdd=_0xbbb5a1;return db['CmContact'][_0x5781('0x47')]({'where':{'id':_0x4403a3[_0x5781('0x83')]}});}})['then'](function(_0x27341a){if(_0x27341a){if(_0x5a59d5){var _0x4b9a19=null;for(var _0x21b498=0x1;_0x21b498<_0x4403a3[_0x5781('0x80')][_0x5781('0x45')];++_0x21b498){_0x4b9a19=_0x4403a3[_0x5781('0x80')][_0x21b498];var _0x20bd97=_0x4b9a19['UserId']?util['format'](_0x5781('0x84'),_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):'System';var _0x455697=_0x548f92[_0x5781('0x4a')]['customer']||util[_0x5781('0x7d')](_0x5781('0x84'),_0x5781('0x87'),_0x4b9a19[_0x5781('0x83')]);switch(_0x250cdd['agentIdentifier']){case _0x5781('0x88'):_0x20bd97=_0x4b9a19[_0x5781('0x86')]?util[_0x5781('0x7d')](_0x5781('0x84'),_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):_0x5781('0x89');break;case _0x5781('0x8a'):_0x20bd97=_0x4b9a19['UserId']?_0x4b9a19[_0x5781('0x81')][_0x5781('0x8b')]||_0x4b9a19[_0x5781('0x81')][_0x5781('0x54')]:'System';break;case _0x5781('0x8c'):_0x20bd97=_0x4b9a19[_0x5781('0x86')]?_0x4b9a19[_0x5781('0x81')][_0x5781('0x54')]:_0x5781('0x89');break;default:_0x20bd97=_0x4b9a19[_0x5781('0x86')]?util[_0x5781('0x7d')]('%s%d',_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):_0x5781('0x89');}var _0x350232=util[_0x5781('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4b9a19[_0x5781('0x8d')])[_0x5781('0x7d')](_0x5781('0x8e')),_0x4b9a19[_0x5781('0x8f')]==='in'?_0x455697:_0x20bd97,_0x4b9a19[_0x5781('0x4a')]);if(!_0x4b9a19[_0x5781('0x90')]){fs[_0x5781('0x91')](_0x5a59d5,_0x350232);}}return db[_0x5781('0x92')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x5781('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5781('0x94'),'raw':!![]}]}]});}}})[_0x5781('0x17')](function(_0xc9f0eb){if(!_0xc9f0eb||!_0xc9f0eb[_0x5781('0x95')]||!_0x548f92[_0x5781('0x4a')])return _0x4403a3;var _0x4cf994=_0xc9f0eb['getSmtpOptions']();return respondWithRpcPromise(_0x5781('0x96'),_0x5781('0x97'),{'account':_0x4cf994,'message':{'from':util['format'](_0x5781('0x98'),_0xc9f0eb[_0x5781('0x53')],_0xc9f0eb[_0x5781('0x55')]||_0xc9f0eb[_0x5781('0x95')][_0x5781('0x52')]),'to':_0x548f92[_0x5781('0x4a')][_0x5781('0x99')],'subject':_0x5781('0x9a'),'text':util[_0x5781('0x7d')](_0x5781('0x9b'),_0x548f92['body'][_0x5781('0x99')]),'attachments':[{'path':_0x5a59d5}]}})[_0x5781('0x17')](function(){return _0x4403a3;})[_0x5781('0x21')](function(_0x679381){logger['error'](_0x679381);});})[_0x5781('0x17')](respondWithStatusCode(_0x532e56,0xc8))['catch'](handleError(_0x532e56,null));};exports['addMessage']=function(_0x1a8028,_0x2685d5){return db[_0x5781('0x60')][_0x5781('0x47')]({'where':{'id':_0x1a8028[_0x5781('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2685d5,null))[_0x5781('0x17')](function(_0x52557d){if(_0x52557d){return _0x52557d[_0x5781('0x9c')](_0x1a8028[_0x5781('0x4a')][_0x5781('0x9d')],_['omit'](_0x1a8028[_0x5781('0x4a')],[_0x5781('0x9d'),'id'])||{});}})[_0x5781('0x17')](respondWithResult(_0x2685d5,null))[_0x5781('0x21')](handleError(_0x2685d5,null));};exports[_0x5781('0x9e')]=function(_0x5cc144,_0x5df9ee){var _0x12eafc={'raw':![],'where':{}};var _0xe0fd38={};var _0x5cdf2f={'count':0x0,'rows':[]};return db[_0x5781('0x40')][_0x5781('0x4d')]({'where':{'id':_0x5cc144[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x5df9ee,null))[_0x5781('0x17')](function(_0x470b87){if(_0x470b87){_0xe0fd38[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x60')][_0x5781('0x35')]);_0xe0fd38[_0x5781('0x41')]=_['keys'](_0x5cc144[_0x5781('0x41')]);_0xe0fd38[_0x5781('0x42')]=_[_0x5781('0x9f')](_0xe0fd38[_0x5781('0x3e')],_0xe0fd38[_0x5781('0x41')]);_0x12eafc[_0x5781('0x44')]=_[_0x5781('0x9f')](_0xe0fd38[_0x5781('0x3e')],qs[_0x5781('0x43')](_0x5cc144[_0x5781('0x41')]['fields']));_0x12eafc[_0x5781('0x44')]=_0x12eafc[_0x5781('0x44')]['length']?_0x12eafc[_0x5781('0x44')]:_0xe0fd38[_0x5781('0x3e')];if(!_0x5cc144['query'][_0x5781('0xa0')](_0x5781('0xa1'))){_0x12eafc['limit']=qs[_0x5781('0x25')](_0x5cc144[_0x5781('0x41')]['limit']);_0x12eafc[_0x5781('0x24')]=qs[_0x5781('0x24')](_0x5cc144['query'][_0x5781('0x24')]);}_0x12eafc['order']=qs['sort'](_0x5cc144[_0x5781('0x41')][_0x5781('0xa2')]);_0x12eafc[_0x5781('0xa3')]=qs[_0x5781('0x42')](_['pick'](_0x5cc144[_0x5781('0x41')],_0xe0fd38['filters']));_0x12eafc[_0x5781('0xa3')][_0x5781('0xa4')]=_0x470b87['id'];if(_0x5cc144[_0x5781('0x41')]['filter']){_0x12eafc[_0x5781('0xa3')]=_[_0x5781('0x2e')](_0x12eafc[_0x5781('0xa3')],{'$or':_[_0x5781('0x34')](_0x12eafc['attributes'],function(_0x9c1c5){var _0x287f30={};_0x287f30[_0x9c1c5]={'$like':'%'+_0x5cc144['query'][_0x5781('0xa5')]+'%'};return _0x287f30;})});}if(_0x5cc144[_0x5781('0x41')][_0x5781('0xa6')]){var _0x42845f=_0x5cc144['query']['$gte'][_0x5781('0xa7')](',');var _0x9a2e0a={};_0x9a2e0a[_0x42845f[0x0]]={'$gte':moment(_0x42845f[0x1])[_0x5781('0x7d')](_0x5781('0xa8'))};_0x12eafc['where']=_['merge'](_0x12eafc[_0x5781('0xa3')],_0x9a2e0a);}_0x12eafc=_['merge']({},_0x12eafc,_0x5cc144[_0x5781('0xa9')]);return db[_0x5781('0x60')]['count']({'where':_0x12eafc[_0x5781('0xa3')]})['then'](function(_0x2b2f3e){_0x5cdf2f[_0x5781('0x27')]=_0x2b2f3e;if(_0x5cc144[_0x5781('0x41')][_0x5781('0x46')]){_0x12eafc[_0x5781('0xaa')]=[{'all':!![]}];}return db[_0x5781('0x60')][_0x5781('0x3a')](_0x12eafc);})[_0x5781('0x17')](function(_0x1755f7){_0x5cdf2f[_0x5781('0xab')]=_0x1755f7;return _0x5cdf2f;});}})[_0x5781('0x17')](respondWithFilteredResult(_0x5df9ee,_0x12eafc))[_0x5781('0x21')](handleError(_0x5df9ee,null));};exports[_0x5781('0xac')]=function(_0x7acc46,_0x9f9544){var _0x1c157a={'where':{}},_0x24791d={},_0x3e9bcc={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x7acc46['params']['id']}})['then'](handleEntityNotFound(_0x9f9544,null))[_0x5781('0x17')](function(_0x3a195e){if(_0x3a195e){_0x24791d[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x60')][_0x5781('0x35')]);_0x24791d['query']=_[_0x5781('0x3f')](_0x7acc46['query']);_0x24791d[_0x5781('0x42')]=_[_0x5781('0x9f')](_0x24791d['model'],_0x24791d[_0x5781('0x41')]);_0x1c157a[_0x5781('0x44')]=_[_0x5781('0x9f')](_0x24791d[_0x5781('0x3e')],qs[_0x5781('0x43')](_0x7acc46['query'][_0x5781('0x43')]));_0x1c157a[_0x5781('0x44')]=_0x1c157a[_0x5781('0x44')][_0x5781('0x45')]?_0x1c157a[_0x5781('0x44')]:_0x24791d[_0x5781('0x3e')];if(!_0x7acc46[_0x5781('0x41')][_0x5781('0xa0')](_0x5781('0xa1'))){_0x1c157a[_0x5781('0x25')]=qs[_0x5781('0x25')](_0x7acc46[_0x5781('0x41')][_0x5781('0x25')]);_0x1c157a['offset']=qs['offset'](_0x7acc46[_0x5781('0x41')][_0x5781('0x24')]);}_0x1c157a[_0x5781('0xad')]=qs[_0x5781('0xa2')](_0x7acc46[_0x5781('0x41')]['sort']);_0x1c157a['where']=qs[_0x5781('0x42')](_[_0x5781('0xae')](_0x7acc46[_0x5781('0x41')],_0x24791d[_0x5781('0x42')]));_0x1c157a[_0x5781('0xa3')]['ChatInteractionId']=_0x3a195e['id'];if(_0x7acc46[_0x5781('0x41')][_0x5781('0xa5')]){_0x1c157a[_0x5781('0xa3')]=_[_0x5781('0x2e')](_0x1c157a[_0x5781('0xa3')],{'$or':_['map'](_0x1c157a[_0x5781('0x44')],function(_0x51ff80){var _0x4cbad2={};_0x4cbad2[_0x51ff80]={'$like':'%'+_0x7acc46[_0x5781('0x41')][_0x5781('0xa5')]+'%'};return _0x4cbad2;})});}_0x1c157a[_0x5781('0xa3')][_0x5781('0x90')]=![];if(_0x7acc46['query']['id']){_0x1c157a[_0x5781('0xa3')]['id']={'$gt':_0x7acc46[_0x5781('0x41')]['id']};}_0x1c157a=_['merge']({},_0x1c157a,_0x7acc46[_0x5781('0xa9')]);return db[_0x5781('0x60')][_0x5781('0x27')]({'where':_0x1c157a[_0x5781('0xa3')]})['then'](function(_0x536b4e){_0x3e9bcc[_0x5781('0x27')]=_0x536b4e;_0x1c157a[_0x5781('0xaa')]=[];if(_0x7acc46[_0x5781('0x41')][_0x5781('0xaf')]){_0x1c157a[_0x5781('0xaa')][_0x5781('0xb0')]({'model':db[_0x5781('0x81')],'as':_0x5781('0x81'),'attributes':['id',_0x5781('0x54'),_0x5781('0x8b')]});}if(_0x7acc46[_0x5781('0x41')][_0x5781('0x46')]){_0x1c157a[_0x5781('0xaa')]=[{'all':!![]}];}return db[_0x5781('0x60')][_0x5781('0x3a')](_0x1c157a);})[_0x5781('0x17')](function(_0x399066){_0x3e9bcc['rows']=_0x399066;return _0x3e9bcc;});}})[_0x5781('0x17')](respondWithFilteredResult(_0x9f9544,_0x1c157a))[_0x5781('0x21')](handleError(_0x9f9544,null));};exports['addTags']=function(_0x1620f8,_0x356f20){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x1620f8['params']['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x356f20,null))[_0x5781('0x17')](function(_0x553f89){if(_0x553f89){return _0x553f89[_0x5781('0xb1')](_0x1620f8['body']['ids'],_[_0x5781('0xb2')](_0x1620f8[_0x5781('0x4a')],['ids','id'])||{})[_0x5781('0xb3')](function(){return db[_0x5781('0xb4')][_0x5781('0x3a')]({'attributes':['id',_0x5781('0x53'),'color'],'where':{'id':_0x1620f8[_0x5781('0x4a')]['ids']}});})[_0x5781('0x17')](function(_0x33ccc3){socket[_0x5781('0xb5')]('chatInteractionTags:save',{'id':Number(_0x1620f8[_0x5781('0x3d')]['id']),'tags':_0x33ccc3||[]});return{'id':Number(_0x1620f8['params']['id']),'tags':_0x33ccc3||[]};});}})[_0x5781('0x17')](respondWithResult(_0x356f20,null))['catch'](handleError(_0x356f20,null));};exports['removeTags']=function(_0x5395b5,_0x3589a9){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x5395b5[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x3589a9,null))[_0x5781('0x17')](function(_0x5e1d53){if(_0x5e1d53){return _0x5e1d53[_0x5781('0xb6')](_0x5395b5['query'][_0x5781('0x9d')]);}})[_0x5781('0x17')](respondWithStatusCode(_0x3589a9,null))[_0x5781('0x21')](handleError(_0x3589a9,null));};exports['download']=function(_0x1fd201,_0x5916e2){var _0x42ee87=moment()[_0x5781('0xb7')]()[_0x5781('0xb8')]();var _0x40c21d=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),'files',_0x5781('0xba'));var _0x770fef=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),_0x5781('0xbb'),_0x5781('0xbc'));var _0x591502=path['join'](_0x40c21d,_0x42ee87);var _0x544a55=util[_0x5781('0x7d')](_0x5781('0xbd'),_0x1fd201[_0x5781('0x3d')]['id'],_0x42ee87);var _0x4a4be0=path[_0x5781('0x76')](_0x40c21d,_0x544a55);var _0x5867e9=[];_0x5867e9['push']({'model':db[_0x5781('0x81')],'as':_0x5781('0x81'),'attributes':['id',_0x5781('0x54')],'raw':!![]});_0x5867e9[_0x5781('0xb0')]({'model':db[_0x5781('0x65')],'as':_0x5781('0x66'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x1fd201[_0x5781('0x41')][_0x5781('0xbc')]){_0x5867e9[_0x5781('0xb0')]({'model':db[_0x5781('0x73')],'as':_0x5781('0x73'),'raw':!![]});}var _0x48f307=[{'model':db['ChatMessage'],'as':_0x5781('0x80'),'attributes':['id',_0x5781('0x4a'),'createdAt',_0x5781('0x8f'),_0x5781('0x90'),_0x5781('0xbe')],'include':_0x5867e9}];_0x48f307[_0x5781('0xb0')]({'model':db[_0x5781('0x4e')],'as':_0x5781('0xbf'),'attributes':['id',_0x5781('0x53')]});_0x48f307[_0x5781('0xb0')]({'model':db[_0x5781('0x81')],'as':_0x5781('0xc0'),'attributes':['id',_0x5781('0x54')]});return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x1fd201[_0x5781('0x3d')]['id']},'include':_0x48f307})[_0x5781('0x17')](handleEntityNotFound(_0x5916e2,null))[_0x5781('0x17')](function(_0x3e30b9){if(_0x3e30b9){var _0x5222ec=_0x3e30b9['get']({'plain':!![]});fs['mkdirSync'](_0x591502);var _0x39aec2={'channel':_0x5781('0xc1'),'account':_0x5222ec[_0x5781('0xbf')]['name'],'agent':_0x5222ec['Owner']?_0x5222ec[_0x5781('0xc0')]['fullname']:'N.A.','createdAt':moment(_0x5222ec[_0x5781('0x8d')])[_0x5781('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5781('0xb8')](),'closedAt':_0x5222ec[_0x5781('0x6b')]?moment(_0x5222ec['closedAt'])[_0x5781('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5781('0xb8')]():'','disposition':_0x5222ec['disposition'],'chatInfo':{'browser':_0x5222ec[_0x5781('0xc2')],'os':_0x5222ec[_0x5781('0xc3')],'referer':_0x5222ec[_0x5781('0xc4')],'customerIp':_0x5222ec[_0x5781('0xc5')],'customerPort':_0x5222ec[_0x5781('0xc6')]?_0x5222ec[_0x5781('0xc6')]:_0x5781('0xc7')},'messages':_(_0x5222ec['Messages'])['tail']()[_0x5781('0xa5')]({'secret':![]})[_0x5781('0x34')](function(_0x235993){if(_0x235993['Attachment']){var _0x1b33a4=path['join'](_0x770fef,_0x235993[_0x5781('0x73')][_0x5781('0x79')]);if(fs[_0x5781('0xc8')](_0x1b33a4)){fs[_0x5781('0xc9')](_0x1b33a4)['pipe'](fs[_0x5781('0xca')](path[_0x5781('0x76')](_0x591502,_0x235993['Attachment'][_0x5781('0x79')])));}}return{'date':moment(_0x235993[_0x5781('0x8d')])['format'](_0x5781('0xa8'))[_0x5781('0xb8')](),'sender':_0x235993['direction']===_0x5781('0x5f')?_0x235993['User']?_0x235993[_0x5781('0x81')][_0x5781('0x54')]:_0x5781('0x89'):_0x235993[_0x5781('0x66')][_0x5781('0xcb')]+(_0x235993[_0x5781('0x66')][_0x5781('0xcc')]?'\x20'+_0x235993[_0x5781('0x66')][_0x5781('0xcc')]:''),'body':_0x235993[_0x5781('0x73')]?_0x235993[_0x5781('0x73')][_0x5781('0x79')]:_0x235993[_0x5781('0x4a')],'direction':_0x235993[_0x5781('0x8f')]===_0x5781('0x5f')?'A':'C','secret':_0x235993[_0x5781('0x90')],'read':_0x235993[_0x5781('0xbe')],'attachment':_0x235993[_0x5781('0x73')]};})[_0x5781('0xcd')]()};return ejs[_0x5781('0xce')](path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),'views',_0x5781('0xcf')),{'interaction':_0x39aec2})[_0x5781('0x17')](function(_0x1c6c71){var _0x4410cb=path[_0x5781('0x76')](_0x591502,'transcript-'+_0x5222ec['id']+'-'+_0x42ee87+'.pdf');var _0x22e106={'path':_0x4410cb,'channel':_0x5781('0xc1'),'interactionId':_0x5222ec['id']};return pdf[_0x5781('0xd0')](_0x1c6c71,_0x22e106);})[_0x5781('0x17')](function(){return new Promise(function(_0x278d8e,_0x21d868){zipdir(_0x591502,{'saveTo':_0x4a4be0},function(_0x48510c,_0x2c343e){if(_0x48510c)return _0x21d868(_0x48510c);return _0x278d8e(_0x2c343e);});})[_0x5781('0x17')](function(){return new BPromise(function(_0x54dfe2,_0x299bf5){rimraf(_0x591502,function(_0x2516ce){if(_0x2516ce)_0x299bf5(_0x2516ce);return _0x54dfe2();});});})[_0x5781('0x17')](function(){return _0x5916e2['download'](_0x4a4be0,_0x544a55,function(_0x43e2b3){if(_0x43e2b3){logger['error'](_0x5781('0xd1'),_0x43e2b3);}else{fs[_0x5781('0xd2')](_0x4a4be0);}});});});}else{return _0x5916e2[_0x5781('0x22')](0xc8);}})['catch'](handleError(_0x5916e2,null));}; \ No newline at end of file +var _0x3677=['query','user','show','params','model','keys','intersection','attributes','includeAll','include','create','body','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','close','root','server/files/chat/upload/','now','pathTranscript','ChatMessage','Messages','ContactId','format','%s%d','agentAlias','UserId','System','customer','Visitor','User','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','fields','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','createdAt','read','Account','Owner','get','N.A.','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','undefined','limit','offset','count','Content-Range','then','destroy','name','render','merge','contact','interaction','index','map','ChatInteraction','rawAttributes','type','key','getOptions','chat'];(function(_0x57c16a,_0x31eedc){var _0x506317=function(_0x5f192d){while(--_0x5f192d){_0x57c16a['push'](_0x57c16a['shift']());}};_0x506317(++_0x31eedc);}(_0x3677,0x163));var _0x7367=function(_0x1bc7fb,_0x1a6fa8){_0x1bc7fb=_0x1bc7fb-0x0;var _0x348f52=_0x3677[_0x1bc7fb];return _0x348f52;};'use strict';var rimraf=require(_0x7367('0x0'));var zipdir=require(_0x7367('0x1'));var rp=require(_0x7367('0x2'));var moment=require(_0x7367('0x3'));var BPromise=require(_0x7367('0x4'));var Mustache=require(_0x7367('0x5'));var util=require(_0x7367('0x6'));var path=require(_0x7367('0x7'));var ejs=require(_0x7367('0x8'));var fs=require('fs');var _=require(_0x7367('0x9'));var Redis=require('ioredis');var interaction=require(_0x7367('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7367('0xb'));var logger=require('../../config/logger')(_0x7367('0xc'));var config=require(_0x7367('0xd'));var db=require(_0x7367('0xe'))['db'];config[_0x7367('0xf')]=_[_0x7367('0x10')](config[_0x7367('0xf')],{'host':_0x7367('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7367('0xf')]));require(_0x7367('0x12'))[_0x7367('0x13')](socket);var jayson=require(_0x7367('0x14'));var client=jayson[_0x7367('0x15')][_0x7367('0x16')]({'port':0x232b});var client9004=jayson[_0x7367('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3291a6,_0x531e8f,_0x4c7ace,_0x28d7ad){return new BPromise(function(_0x3468af,_0x4f75fe){var _0xd4df9c=_0x28d7ad||client;return _0xd4df9c[_0x7367('0x17')](_0x3291a6,_0x4c7ace)['then'](function(_0x34ea47){logger[_0x7367('0x18')](_0x7367('0x19'),_0x531e8f,'request\x20sent');logger['debug'](_0x7367('0x1a'),_0x531e8f,_0x7367('0x1b'),JSON[_0x7367('0x1c')](_0x34ea47));if(_0x34ea47['error']){if(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1e')]===0x1f4){logger['error'](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x4f75fe(_0x34ea47['error'][_0x7367('0x1f')]);}logger[_0x7367('0x1d')](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x3468af(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);}else{logger[_0x7367('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x531e8f,_0x7367('0x1b'));_0x3468af(_0x34ea47[_0x7367('0x20')][_0x7367('0x1f')]);}})[_0x7367('0x21')](function(_0x1af053){logger['error'](_0x7367('0x19'),_0x531e8f,_0x1af053);_0x4f75fe(_0x1af053);});});}function respondWithStatusCode(_0x11ce72,_0x36a4f4){_0x36a4f4=_0x36a4f4||0xcc;return function(_0x542748){if(_0x542748){return _0x11ce72['sendStatus'](_0x36a4f4);}return _0x11ce72['status'](_0x36a4f4)[_0x7367('0x22')]();};}function respondWithResult(_0x3907e8,_0x54c835){_0x54c835=_0x54c835||0xc8;return function(_0x5385bd){if(_0x5385bd){return _0x3907e8[_0x7367('0x23')](_0x54c835)[_0x7367('0x24')](_0x5385bd);}};}function respondWithFilteredResult(_0xb5d3dd,_0x2a2a21){return function(_0x4226b3){if(_0x4226b3){var _0x2c946b=typeof _0x2a2a21['offset']===_0x7367('0x25')&&typeof _0x2a2a21[_0x7367('0x26')]==='undefined';var _0x1e721b=_0x4226b3['count'];var _0x4e44f4=_0x2c946b?0x0:_0x2a2a21[_0x7367('0x27')];var _0x1fa03a=_0x2c946b?_0x4226b3[_0x7367('0x28')]:_0x2a2a21[_0x7367('0x27')]+_0x2a2a21[_0x7367('0x26')];var _0x292b3a;if(_0x1fa03a>=_0x1e721b){_0x1fa03a=_0x1e721b;_0x292b3a=0xc8;}else{_0x292b3a=0xce;}_0xb5d3dd[_0x7367('0x23')](_0x292b3a);return _0xb5d3dd['set'](_0x7367('0x29'),_0x4e44f4+'-'+_0x1fa03a+'/'+_0x1e721b)['json'](_0x4226b3);}return null;};}function saveUpdates(_0x469522){return function(_0xa04d1f){if(_0xa04d1f){return _0xa04d1f['update'](_0x469522)[_0x7367('0x2a')](function(_0x5355b1){return _0x5355b1;});}return null;};}function removeEntity(_0x4f4a6d){return function(_0x171647){if(_0x171647){return _0x171647[_0x7367('0x2b')]()[_0x7367('0x2a')](function(){_0x4f4a6d[_0x7367('0x23')](0xcc)[_0x7367('0x22')]();});}};}function handleEntityNotFound(_0x168eb5){return function(_0x15f272){if(!_0x15f272){_0x168eb5['sendStatus'](0x194);}return _0x15f272;};}function handleError(_0x554b0a,_0x36ed08){_0x36ed08=_0x36ed08||0x1f4;return function(_0x3d86a5){logger['error'](_0x3d86a5['stack']);if(_0x3d86a5[_0x7367('0x2c')]){delete _0x3d86a5[_0x7367('0x2c')];}_0x554b0a['status'](_0x36ed08)['send'](_0x3d86a5);};}function getMustacheRender(_0x543c90,_0x57361c){return Mustache[_0x7367('0x2d')](_0x543c90,_[_0x7367('0x2e')](_0x57361c['body'],{'contact':_0x57361c[_0x7367('0x2f')],'message':_0x57361c[_0x7367('0x1f')],'agent':_0x57361c['agent'],'interaction':_0x57361c[_0x7367('0x30')],'account':_0x57361c['account']}))||'';}exports[_0x7367('0x31')]=function(_0x52d920,_0x831a39){var _0xae077c={};var _0x209c13=_[_0x7367('0x32')](db[_0x7367('0x33')][_0x7367('0x34')],function(_0x201042){return{'name':_0x201042['fieldName'],'type':_0x201042[_0x7367('0x35')][_0x7367('0x36')]};});_0xae077c=qs[_0x7367('0x37')](_0x209c13,_0x52d920);return interaction['findAll'](_0x7367('0x38'),_0x52d920[_0x7367('0x39')],_0x52d920[_0x7367('0x3a')],_0xae077c,_0x209c13)[_0x7367('0x2a')](respondWithFilteredResult(_0x831a39,_0xae077c))[_0x7367('0x21')](handleError(_0x831a39,null));};exports[_0x7367('0x3b')]=function(_0x57f915,_0x474ec3){var _0x3645a8={'raw':![],'where':{'id':_0x57f915[_0x7367('0x3c')]['id']}},_0x185d3f={};_0x185d3f[_0x7367('0x3d')]=_[_0x7367('0x3e')](db[_0x7367('0x33')]['rawAttributes']);_0x185d3f[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x57f915[_0x7367('0x39')]);_0x185d3f['filters']=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],_0x185d3f[_0x7367('0x39')]);_0x3645a8[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],qs['fields'](_0x57f915[_0x7367('0x39')]['fields']));_0x3645a8[_0x7367('0x40')]=_0x3645a8[_0x7367('0x40')]['length']?_0x3645a8['attributes']:_0x185d3f['model'];if(_0x57f915[_0x7367('0x39')][_0x7367('0x41')]){_0x3645a8[_0x7367('0x42')]=[{'all':!![]}];}_0x3645a8=_[_0x7367('0x2e')]({},_0x3645a8,_0x57f915['options']);return db['ChatInteraction']['find'](_0x3645a8)[_0x7367('0x2a')](handleEntityNotFound(_0x474ec3,null))['then'](respondWithResult(_0x474ec3,null))[_0x7367('0x21')](handleError(_0x474ec3,null));};exports['create']=function(_0x3337d4,_0x5b6ef2){return db[_0x7367('0x33')][_0x7367('0x43')](_0x3337d4[_0x7367('0x44')],{})[_0x7367('0x2a')](respondWithResult(_0x5b6ef2,0xc9))[_0x7367('0x21')](handleError(_0x5b6ef2,null));};exports[_0x7367('0x45')]=function(_0x4a6824,_0x4118bc){if(_0x4a6824['body']['id']){delete _0x4a6824[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x4a6824[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4118bc,null))[_0x7367('0x2a')](saveUpdates(_0x4a6824['body'],null))[_0x7367('0x2a')](respondWithResult(_0x4118bc,null))[_0x7367('0x21')](handleError(_0x4118bc,null));};exports[_0x7367('0x2b')]=function(_0x43b55c,_0xf242ae){return db['ChatInteraction'][_0x7367('0x46')]({'where':{'id':_0x43b55c['params']['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xf242ae,null))[_0x7367('0x2a')](removeEntity(_0xf242ae,null))[_0x7367('0x21')](handleError(_0xf242ae,null));};exports[_0x7367('0x47')]=function(_0x19541b,_0x200cad){return db['ChatInteraction'][_0x7367('0x47')]()[_0x7367('0x2a')](respondWithResult(_0x200cad,null))['catch'](handleError(_0x200cad,null));};exports['createVidaooSession']=function(_0x426f98,_0x2d999a){var _0x18a2e4=_0x426f98[_0x7367('0x3c')]['id'];var _0x24c703;var _0x5d3953;var _0x1a3c2e;return db['ChatInteraction'][_0x7367('0x48')]({'where':{'id':_0x18a2e4}})[_0x7367('0x2a')](function(_0x4dea20){_0x24c703=_0x4dea20;return db[_0x7367('0x49')][_0x7367('0x48')]({'where':{'id':_0x4dea20[_0x7367('0x4a')]},'attributes':['id',_0x7367('0x4b'),_0x7367('0x4c'),_0x7367('0x4d'),_0x7367('0x4e'),_0x7367('0x4f')],'raw':!![]});})[_0x7367('0x2a')](function(_0xf59466){if(_0xf59466&&_0xf59466['vidaooApiKey']&&_0xf59466[_0x7367('0x4c')]){_0x5d3953=_0xf59466;var _0x54c626={'interaction':{'id':_0x18a2e4},'agent':{'id':_0x426f98[_0x7367('0x3a')]['id'],'name':_0x426f98[_0x7367('0x3a')][_0x7367('0x2c')],'fullname':_0x426f98['user']['fullname'],'email':_0x426f98['user']['email']},'contact':_0x426f98[_0x7367('0x44')][_0x7367('0x2f')],'account':_0x426f98[_0x7367('0x44')]['account']};var _0x1633c5={'rejectUnauthorized':![],'method':'POST','url':_0x7367('0x50'),'headers':{'X-APIKEY':_0xf59466['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x426f98[_0x7367('0x3a')]['email']],'buttons':null,'topic':_0x5d3953[_0x7367('0x4d')],'note':_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4e')])?null:getMustacheRender(_0x5d3953[_0x7367('0x4e')],_0x54c626),'metadata':null},'redirect':_0x7367('0x52'),'json':!![]};try{if(!_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4f')])){var _0x4b0baf=getMustacheRender(_0x5d3953[_0x7367('0x4f')],_0x54c626);var _0x260953=JSON[_0x7367('0x53')](_0x4b0baf);_0x1633c5[_0x7367('0x44')][_0x7367('0x54')]=_0x260953;}}catch(_0x469e07){throw new db[(_0x7367('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1633c5);}else{throw new db[(_0x7367('0x55'))][(_0x7367('0x56'))](_0x7367('0x57'));}})[_0x7367('0x2a')](function(_0x3d3d21){_0x1a3c2e=_0x3d3d21;if(_0x1a3c2e['id']){var _0x55492f={'body':_0x1a3c2e[_0x7367('0x58')],'ChatWebsiteId':_0x5d3953['id'],'ChatInteractionId':_0x24c703['id'],'direction':_0x7367('0x59'),'UserId':_0x426f98[_0x7367('0x3a')]['id']};return db['ChatMessage'][_0x7367('0x43')](_0x55492f,{});}else{throw new db['Sequelize']['ValidationError'](_0x7367('0x5a'));}})[_0x7367('0x2a')](function(){return _0x24c703[_0x7367('0x5b')]({'vidaooSessionId':_0x1a3c2e['id']});})['then'](respondWithResult(_0x2d999a,null))[_0x7367('0x21')](handleError(_0x2d999a,null));};exports[_0x7367('0x5c')]=function(_0x5f5517,_0x3f8def){if(_0x5f5517[_0x7367('0x44')]['id']){delete _0x5f5517[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')]['find']({'where':{'id':_0x5f5517[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e')}]})['then'](handleEntityNotFound(_0x3f8def,null))[_0x7367('0x2a')](saveUpdates(_0x5f5517[_0x7367('0x44')],null))['then'](respondWithResult(_0x3f8def,null))[_0x7367('0x21')](handleError(_0x3f8def,null));};exports[_0x7367('0x5f')]=function(_0x5c0d43,_0x2b3be9){if(_0x5c0d43[_0x7367('0x44')]['id']){delete _0x5c0d43[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x5c0d43[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](function(_0x3eeaa0){if(!_0x3eeaa0){logger[_0x7367('0x1d')](_0x7367('0x60'),'abandon',0x194,_0x7367('0x61'));_0x2b3be9[_0x7367('0x62')](0x194);}else{if(_0x3eeaa0['UserId']){throw new db['Sequelize'][(_0x7367('0x56'))](_0x7367('0x63'));}}return _0x3eeaa0;})[_0x7367('0x2a')](function(_0x14c8b4){if(_0x14c8b4){return _0x14c8b4['update']({'closed':_0x5c0d43[_0x7367('0x44')][_0x7367('0x64')],'disposition':_0x5c0d43[_0x7367('0x44')][_0x7367('0x65')]})[_0x7367('0x2a')](function(_0x2d6ebd){return _0x2d6ebd;});}})[_0x7367('0x2a')](function(){return respondWithRpcPromise('AbandonInteraction',_0x7367('0x5f'),_0x5c0d43[_0x7367('0x44')],client9004);})[_0x7367('0x2a')](respondWithResult(_0x2b3be9,null))[_0x7367('0x21')](handleError(_0x2b3be9,null));};exports[_0x7367('0x66')]=function(_0x1c194,_0x5ce300){_0x1c194[_0x7367('0x44')]['name']=_0x1c194[_0x7367('0x67')][_0x7367('0x68')];_0x1c194['body'][_0x7367('0x69')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6a')];_0x1c194[_0x7367('0x44')][_0x7367('0x35')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6b')];return db[_0x7367('0x6c')][_0x7367('0x43')](_0x1c194[_0x7367('0x44')])['then'](respondWithResult(_0x5ce300,0xc9))[_0x7367('0x21')](handleError(_0x5ce300,null));};exports[_0x7367('0x6d')]=function(_0x5cae34,_0x34750b){return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x3c')]['id']},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null))[_0x7367('0x2a')](function(_0x3c975a){if(_0x3c975a){if(_0x3c975a[_0x7367('0x64')]){return _0x34750b[_0x7367('0x23')](0x193)['json']({'status':0x193,'message':_0x7367('0x6e')});}return db[_0x7367('0x6c')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x39')][_0x7367('0x6f')]},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null));}})[_0x7367('0x2a')](function(_0x49812c){if(_0x49812c){var _0xfad70c=_0x49812c[_0x7367('0x70')]!==null;var _0x2e08c6=path[_0x7367('0x71')](config['root'],_0x7367('0x72'));if(_0xfad70c){_0x2e08c6=path[_0x7367('0x71')](_0x2e08c6,'offline-chat/');}var _0xcdc967=path['join'](_0x2e08c6,_0x49812c[_0x7367('0x69')]);return _0x34750b['download'](_0xcdc967);}})[_0x7367('0x21')](handleError(_0x34750b,null));};exports[_0x7367('0x73')]=function(_0xc51323,_0x29d04e){var _0x2d4e26=null;var _0x46c264=null;var _0x222fcd=null;if(_0xc51323[_0x7367('0x44')]['id']){delete _0xc51323['body']['id'];}if(_0xc51323[_0x7367('0x44')]['mailTranscript']){_0x222fcd=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0x75'),util['format']('transcript-%s.txt',Date[_0x7367('0x76')]()));_0xc51323[_0x7367('0x44')][_0x7367('0x77')]=_0x222fcd;}return db[_0x7367('0x33')]['find']({'where':{'id':_0xc51323[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x78')],'as':_0x7367('0x79'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x7367('0x2a')](handleEntityNotFound(_0x29d04e,null))['then'](saveUpdates(_0xc51323[_0x7367('0x44')],null))[_0x7367('0x2a')](function(_0x289e30){if(_0x289e30){_0x2d4e26=_0x289e30;return db['ChatWebsite'][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x4a')]}});}})['then'](function(_0x8a9cd3){if(_0x8a9cd3){_0x46c264=_0x8a9cd3;return db[_0x7367('0x5d')][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x7a')]}});}})[_0x7367('0x2a')](function(_0x1f7baf){if(_0x1f7baf){if(_0x222fcd){var _0x3e439c=null;for(var _0x4d3c25=0x1;_0x4d3c25<_0x2d4e26['Messages']['length'];++_0x4d3c25){_0x3e439c=_0x2d4e26[_0x7367('0x79')][_0x4d3c25];var _0x37378a=_0x3e439c['UserId']?util[_0x7367('0x7b')](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');var _0x5cfa26=_0xc51323[_0x7367('0x44')][_0x7367('0x80')]||util[_0x7367('0x7b')](_0x7367('0x7c'),_0x7367('0x81'),_0x3e439c[_0x7367('0x7a')]);switch(_0x46c264['agentIdentifier']){case'website_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');break;case'agent_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x83')]||_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:'System';break;case'agent_fullname':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:_0x7367('0x7f');break;default:_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264['agentAlias'],_0x3e439c['UserId']):_0x7367('0x7f');}var _0x5dc52c=util[_0x7367('0x7b')](_0x7367('0x85'),moment(_0x3e439c['createdAt'])[_0x7367('0x7b')](_0x7367('0x86')),_0x3e439c[_0x7367('0x87')]==='in'?_0x5cfa26:_0x37378a,_0x3e439c[_0x7367('0x44')]);if(!_0x3e439c[_0x7367('0x88')]){fs[_0x7367('0x89')](_0x222fcd,_0x5dc52c);}}return db[_0x7367('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7367('0x8b')],'as':_0x7367('0x8c'),'raw':!![],'include':[{'model':db[_0x7367('0x8d')],'as':_0x7367('0x8d'),'raw':!![]}]}]});}}})[_0x7367('0x2a')](function(_0x4d50d2){if(!_0x4d50d2||!_0x4d50d2[_0x7367('0x8c')]||!_0xc51323[_0x7367('0x44')])return _0x2d4e26;var _0x534197=_0x4d50d2[_0x7367('0x8e')]();return respondWithRpcPromise('SendMail',_0x7367('0x8f'),{'account':_0x534197,'message':{'from':util[_0x7367('0x7b')](_0x7367('0x90'),_0x4d50d2[_0x7367('0x2c')],_0x4d50d2[_0x7367('0x91')]||_0x4d50d2[_0x7367('0x8c')][_0x7367('0x3a')]),'to':_0xc51323[_0x7367('0x44')][_0x7367('0x92')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc51323[_0x7367('0x44')][_0x7367('0x92')]),'attachments':[{'path':_0x222fcd}]}})[_0x7367('0x2a')](function(){return _0x2d4e26;})[_0x7367('0x21')](function(_0x55d378){logger[_0x7367('0x1d')](_0x55d378);});})['then'](respondWithStatusCode(_0x29d04e,0xc8))[_0x7367('0x21')](handleError(_0x29d04e,null));};exports[_0x7367('0x93')]=function(_0x2e299c,_0x2df8ae){return db['ChatMessage']['find']({'where':{'id':_0x2e299c[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x2df8ae,null))['then'](function(_0x5c75cd){if(_0x5c75cd){return _0x5c75cd['addMessage'](_0x2e299c[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x2e299c[_0x7367('0x44')],[_0x7367('0x94'),'id'])||{});}})[_0x7367('0x2a')](respondWithResult(_0x2df8ae,null))[_0x7367('0x21')](handleError(_0x2df8ae,null));};exports[_0x7367('0x96')]=function(_0x9bb23d,_0x581d96){var _0x4cf8c9={'raw':![],'where':{}};var _0x4f2ca5={};var _0x5cab53={'count':0x0,'rows':[]};return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x9bb23d[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x581d96,null))[_0x7367('0x2a')](function(_0x21a26c){if(_0x21a26c){_0x4f2ca5['model']=_[_0x7367('0x3e')](db[_0x7367('0x78')][_0x7367('0x34')]);_0x4f2ca5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x9bb23d[_0x7367('0x39')]);_0x4f2ca5['filters']=_['intersection'](_0x4f2ca5[_0x7367('0x3d')],_0x4f2ca5[_0x7367('0x39')]);_0x4cf8c9['attributes']=_[_0x7367('0x3f')](_0x4f2ca5[_0x7367('0x3d')],qs['fields'](_0x9bb23d[_0x7367('0x39')]['fields']));_0x4cf8c9['attributes']=_0x4cf8c9[_0x7367('0x40')][_0x7367('0x97')]?_0x4cf8c9['attributes']:_0x4f2ca5['model'];if(!_0x9bb23d['query'][_0x7367('0x98')](_0x7367('0x99'))){_0x4cf8c9['limit']=qs['limit'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x26')]);_0x4cf8c9[_0x7367('0x27')]=qs['offset'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x27')]);}_0x4cf8c9[_0x7367('0x9a')]=qs[_0x7367('0x9b')](_0x9bb23d['query'][_0x7367('0x9b')]);_0x4cf8c9[_0x7367('0x9c')]=qs[_0x7367('0x9d')](_[_0x7367('0x9e')](_0x9bb23d[_0x7367('0x39')],_0x4f2ca5['filters']));_0x4cf8c9[_0x7367('0x9c')][_0x7367('0x9f')]=_0x21a26c['id'];if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]){_0x4cf8c9['where']=_['merge'](_0x4cf8c9[_0x7367('0x9c')],{'$or':_['map'](_0x4cf8c9[_0x7367('0x40')],function(_0x2ab2c6){var _0x8bbf4c={};_0x8bbf4c[_0x2ab2c6]={'$like':'%'+_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]+'%'};return _0x8bbf4c;})});}if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')]){var _0x8386c9=_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')][_0x7367('0xa2')](',');var _0x534ba5={};_0x534ba5[_0x8386c9[0x0]]={'$gte':moment(_0x8386c9[0x1])['format'](_0x7367('0xa3'))};_0x4cf8c9[_0x7367('0x9c')]=_[_0x7367('0x2e')](_0x4cf8c9[_0x7367('0x9c')],_0x534ba5);}_0x4cf8c9=_[_0x7367('0x2e')]({},_0x4cf8c9,_0x9bb23d[_0x7367('0xa4')]);return db[_0x7367('0x78')]['count']({'where':_0x4cf8c9['where']})[_0x7367('0x2a')](function(_0x2690e4){_0x5cab53[_0x7367('0x28')]=_0x2690e4;if(_0x9bb23d[_0x7367('0x39')]['includeAll']){_0x4cf8c9[_0x7367('0x42')]=[{'all':!![]}];}return db['ChatMessage'][_0x7367('0xa5')](_0x4cf8c9);})[_0x7367('0x2a')](function(_0x2cc397){_0x5cab53['rows']=_0x2cc397;return _0x5cab53;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x581d96,_0x4cf8c9))[_0x7367('0x21')](handleError(_0x581d96,null));};exports[_0x7367('0xa6')]=function(_0x5e5388,_0x4470f8){var _0xd40b1a={'where':{}},_0x4bcef5={},_0x553ae9={'count':0x0,'rows':[]};return db[_0x7367('0x33')]['findOne']({'where':{'id':_0x5e5388[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4470f8,null))['then'](function(_0x463723){if(_0x463723){_0x4bcef5[_0x7367('0x3d')]=_['keys'](db['ChatMessage'][_0x7367('0x34')]);_0x4bcef5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x5e5388[_0x7367('0x39')]);_0x4bcef5['filters']=_[_0x7367('0x3f')](_0x4bcef5[_0x7367('0x3d')],_0x4bcef5[_0x7367('0x39')]);_0xd40b1a[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x4bcef5['model'],qs[_0x7367('0xa7')](_0x5e5388[_0x7367('0x39')]['fields']));_0xd40b1a[_0x7367('0x40')]=_0xd40b1a[_0x7367('0x40')][_0x7367('0x97')]?_0xd40b1a['attributes']:_0x4bcef5[_0x7367('0x3d')];if(!_0x5e5388[_0x7367('0x39')][_0x7367('0x98')](_0x7367('0x99'))){_0xd40b1a[_0x7367('0x26')]=qs[_0x7367('0x26')](_0x5e5388[_0x7367('0x39')][_0x7367('0x26')]);_0xd40b1a[_0x7367('0x27')]=qs[_0x7367('0x27')](_0x5e5388[_0x7367('0x39')][_0x7367('0x27')]);}_0xd40b1a[_0x7367('0x9a')]=qs['sort'](_0x5e5388['query']['sort']);_0xd40b1a[_0x7367('0x9c')]=qs['filters'](_['pick'](_0x5e5388[_0x7367('0x39')],_0x4bcef5[_0x7367('0x9d')]));_0xd40b1a[_0x7367('0x9c')][_0x7367('0x9f')]=_0x463723['id'];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa0')]){_0xd40b1a['where']=_[_0x7367('0x2e')](_0xd40b1a[_0x7367('0x9c')],{'$or':_[_0x7367('0x32')](_0xd40b1a[_0x7367('0x40')],function(_0x13fda0){var _0x2cdad6={};_0x2cdad6[_0x13fda0]={'$like':'%'+_0x5e5388['query']['filter']+'%'};return _0x2cdad6;})});}_0xd40b1a[_0x7367('0x9c')][_0x7367('0x88')]=![];if(_0x5e5388['query']['id']){_0xd40b1a[_0x7367('0x9c')]['id']={'$gt':_0x5e5388[_0x7367('0x39')]['id']};}_0xd40b1a=_['merge']({},_0xd40b1a,_0x5e5388[_0x7367('0xa4')]);return db['ChatMessage'][_0x7367('0x28')]({'where':_0xd40b1a['where']})[_0x7367('0x2a')](function(_0xf2288b){_0x553ae9[_0x7367('0x28')]=_0xf2288b;_0xd40b1a[_0x7367('0x42')]=[];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa8')]){_0xd40b1a[_0x7367('0x42')][_0x7367('0xa9')]({'model':db[_0x7367('0x82')],'as':_0x7367('0x82'),'attributes':['id',_0x7367('0x84'),'alias']});}if(_0x5e5388[_0x7367('0x39')][_0x7367('0x41')]){_0xd40b1a['include']=[{'all':!![]}];}return db[_0x7367('0x78')][_0x7367('0xa5')](_0xd40b1a);})[_0x7367('0x2a')](function(_0x3c8c72){_0x553ae9[_0x7367('0xaa')]=_0x3c8c72;return _0x553ae9;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x4470f8,_0xd40b1a))['catch'](handleError(_0x4470f8,null));};exports[_0x7367('0xab')]=function(_0x483564,_0xe12f0b){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x483564[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xe12f0b,null))[_0x7367('0x2a')](function(_0x2b1919){if(_0x2b1919){return _0x2b1919[_0x7367('0xac')](_0x483564[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x483564['body'],[_0x7367('0x94'),'id'])||{})[_0x7367('0xad')](function(){return db[_0x7367('0xae')][_0x7367('0xa5')]({'attributes':['id',_0x7367('0x2c'),_0x7367('0xaf')],'where':{'id':_0x483564['body'][_0x7367('0x94')]}});})[_0x7367('0x2a')](function(_0x4affb9){socket[_0x7367('0xb0')](_0x7367('0xb1'),{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]});return{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]};});}})[_0x7367('0x2a')](respondWithResult(_0xe12f0b,null))[_0x7367('0x21')](handleError(_0xe12f0b,null));};exports[_0x7367('0xb2')]=function(_0xc1a7ce,_0x4c6902){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0xc1a7ce[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4c6902,null))['then'](function(_0x2c8f6c){if(_0x2c8f6c){return _0x2c8f6c[_0x7367('0xb2')](_0xc1a7ce[_0x7367('0x39')][_0x7367('0x94')]);}})[_0x7367('0x2a')](respondWithStatusCode(_0x4c6902,null))['catch'](handleError(_0x4c6902,null));};exports[_0x7367('0xb3')]=function(_0x4852dc,_0x4aecd4){var _0x4a75b7=moment()[_0x7367('0xb4')]()[_0x7367('0xb5')]();var _0xb33935=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),'files',_0x7367('0xb7'));var _0x570b57=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xb8'),_0x7367('0xb9'));var _0x33ef1e=path['join'](_0xb33935,_0x4a75b7);var _0x55673b=util[_0x7367('0x7b')](_0x7367('0xba'),_0x4852dc[_0x7367('0x3c')]['id'],_0x4a75b7);var _0x57d29c=path[_0x7367('0x71')](_0xb33935,_0x55673b);var _0x8e3402=[];_0x8e3402['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e'),'attributes':['id',_0x7367('0xbb'),'lastName'],'raw':!![]});if(_0x4852dc['query'][_0x7367('0xb9')]){_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x6c')],'as':_0x7367('0x6c'),'raw':!![]});}var _0x3cdb24=[{'model':db[_0x7367('0x78')],'as':'Messages','attributes':['id','body',_0x7367('0xbc'),_0x7367('0x87'),_0x7367('0x88'),_0x7367('0xbd')],'include':_0x8e3402}];_0x3cdb24[_0x7367('0xa9')]({'model':db['ChatWebsite'],'as':_0x7367('0xbe'),'attributes':['id','name']});_0x3cdb24[_0x7367('0xa9')]({'model':db['User'],'as':_0x7367('0xbf'),'attributes':['id',_0x7367('0x84')]});return db[_0x7367('0x33')]['find']({'where':{'id':_0x4852dc['params']['id']},'include':_0x3cdb24})[_0x7367('0x2a')](handleEntityNotFound(_0x4aecd4,null))[_0x7367('0x2a')](function(_0x52505c){if(_0x52505c){var _0x2717ee=_0x52505c[_0x7367('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x33ef1e);var _0xf048dc={'channel':'Chat','account':_0x2717ee['Account'][_0x7367('0x2c')],'agent':_0x2717ee['Owner']?_0x2717ee['Owner'][_0x7367('0x84')]:_0x7367('0xc1'),'createdAt':moment(_0x2717ee[_0x7367('0xbc')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7367('0xb5')](),'closedAt':_0x2717ee[_0x7367('0x64')]?moment(_0x2717ee['closedAt'])[_0x7367('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2717ee[_0x7367('0x65')],'chatInfo':{'browser':_0x2717ee[_0x7367('0xc2')],'os':_0x2717ee['osName'],'referer':_0x2717ee['referer'],'customerIp':_0x2717ee[_0x7367('0xc3')],'customerPort':_0x2717ee[_0x7367('0xc4')]?_0x2717ee[_0x7367('0xc4')]:_0x7367('0xc1')},'messages':_(_0x2717ee[_0x7367('0x79')])[_0x7367('0xc5')]()[_0x7367('0xa0')]({'secret':![]})[_0x7367('0x32')](function(_0x36ee28){if(_0x36ee28[_0x7367('0x6c')]){var _0x2b4ac9=path[_0x7367('0x71')](_0x570b57,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')]);if(fs[_0x7367('0xc6')](_0x2b4ac9)){fs[_0x7367('0xc7')](_0x2b4ac9)[_0x7367('0xc8')](fs['createWriteStream'](path[_0x7367('0x71')](_0x33ef1e,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')])));}}return{'date':moment(_0x36ee28[_0x7367('0xbc')])[_0x7367('0x7b')](_0x7367('0xa3'))['toString'](),'sender':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?_0x36ee28['User']?_0x36ee28[_0x7367('0x82')]['fullname']:_0x7367('0x7f'):_0x36ee28[_0x7367('0x5e')][_0x7367('0xbb')]+(_0x36ee28[_0x7367('0x5e')]['lastName']?'\x20'+_0x36ee28['Contact']['lastName']:''),'body':_0x36ee28[_0x7367('0x6c')]?_0x36ee28['Attachment'][_0x7367('0x69')]:_0x36ee28[_0x7367('0x44')],'direction':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?'A':'C','secret':_0x36ee28[_0x7367('0x88')],'read':_0x36ee28[_0x7367('0xbd')],'attachment':_0x36ee28[_0x7367('0x6c')]};})['value']()};return ejs[_0x7367('0xc9')](path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xca'),'downloadInteraction.ejs'),{'interaction':_0xf048dc})[_0x7367('0x2a')](function(_0x5eda9e){var _0x257888=path[_0x7367('0x71')](_0x33ef1e,_0x7367('0xcb')+_0x2717ee['id']+'-'+_0x4a75b7+_0x7367('0xcc'));var _0xa5132a={'path':_0x257888,'channel':'Chat','interactionId':_0x2717ee['id']};return pdf['createPdfFromHTML'](_0x5eda9e,_0xa5132a);})[_0x7367('0x2a')](function(){return new Promise(function(_0x39118b,_0x239240){zipdir(_0x33ef1e,{'saveTo':_0x57d29c},function(_0x5c9273,_0x4dd063){if(_0x5c9273)return _0x239240(_0x5c9273);return _0x39118b(_0x4dd063);});})[_0x7367('0x2a')](function(){return new BPromise(function(_0xb5cba8,_0x646f1d){rimraf(_0x33ef1e,function(_0x3960c9){if(_0x3960c9)_0x646f1d(_0x3960c9);return _0xb5cba8();});});})[_0x7367('0x2a')](function(){return _0x4aecd4[_0x7367('0xb3')](_0x57d29c,_0x55673b,function(_0x53109e){if(_0x53109e){logger[_0x7367('0x1d')]('err',_0x53109e);}else{fs[_0x7367('0xcd')](_0x57d29c);}});});});}else{return _0x4aecd4[_0x7367('0x62')](0xc8);}})[_0x7367('0x21')](handleError(_0x4aecd4,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 64bed95..0d6fe73 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 _0x3e96=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save'];(function(_0x994307,_0x2e2762){var _0x503ced=function(_0x1c46f2){while(--_0x1c46f2){_0x994307['push'](_0x994307['shift']());}};_0x503ced(++_0x2e2762);}(_0x3e96,0x1c7));var _0x63e9=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x3e96[_0x29df9a];return _0x3a8e96;};'use strict';var EventEmitter=require(_0x63e9('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x63e9('0x1')];var ChatMessage=require(_0x63e9('0x2'))['db'][_0x63e9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63e9('0x4'),'afterUpdate':_0x63e9('0x5'),'afterDestroy':_0x63e9('0x6')};function emitEvent(_0x24a618){return function(_0x55f85c,_0x465743,_0x950b16){_0x55f85c[_0x63e9('0x7')]({'attributes':['id'],'raw':!![]})[_0x63e9('0x8')](function(_0x3fae4b){_0x55f85c[_0x63e9('0x9')](_0x63e9('0xa'),_0x3fae4b[_0x63e9('0xb')](function(_0x31757d){return{'id':_0x31757d['id']};}));return ChatMessage[_0x63e9('0xc')]({'where':{'ChatInteractionId':_0x55f85c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x63e9('0x8')](function(_0x37992e){_0x55f85c[_0x63e9('0x9')](_0x63e9('0xd'),_0x37992e[_0x63e9('0xe')]);ChatInteractionEvents[_0x63e9('0xf')](_0x24a618+':'+_0x55f85c['id'],_0x55f85c);ChatInteractionEvents['emit'](_0x24a618,_0x55f85c);_0x950b16(null);})[_0x63e9('0x10')](_0x950b16(null));};}for(var e in events){if(events[_0x63e9('0x11')](e)){var event=events[e];ChatInteraction[_0x63e9('0x12')](e,emitEvent(event));}}module[_0x63e9('0x13')]=ChatInteractionEvents; \ No newline at end of file +var _0x17d8=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17d8,0x110));var _0x817d=function(_0x42d485,_0x2c2c7c){_0x42d485=_0x42d485-0x0;var _0x65ba00=_0x17d8[_0x42d485];return _0x65ba00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x817d('0x0'))['db'][_0x817d('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x817d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x817d('0x3')](0x0);var events={'afterCreate':_0x817d('0x4'),'afterUpdate':_0x817d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x349f1c){return function(_0x3c1b40,_0x3713ad,_0x5ed4d7){_0x3c1b40[_0x817d('0x6')]({'attributes':['id'],'raw':!![]})[_0x817d('0x7')](function(_0x3c8a28){_0x3c1b40['setDataValue'](_0x817d('0x8'),_0x3c8a28[_0x817d('0x9')](function(_0x1d445e){return{'id':_0x1d445e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3c1b40['id'],'direction':'in','read':![]},'raw':!![]});})[_0x817d('0x7')](function(_0x41c7b1){_0x3c1b40[_0x817d('0xa')](_0x817d('0xb'),_0x41c7b1[_0x817d('0xc')]);ChatInteractionEvents['emit'](_0x349f1c+':'+_0x3c1b40['id'],_0x3c1b40);ChatInteractionEvents[_0x817d('0xd')](_0x349f1c,_0x3c1b40);_0x5ed4d7(null);})[_0x817d('0xe')](_0x5ed4d7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x817d('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ee41cfa..325f276 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 _0x3be1=['changed','closed','format','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3be1,0xc7));var _0x13be=function(_0x1204e8,_0x56d4d2){_0x1204e8=_0x1204e8-0x0;var _0x4f7b9e=_0x3be1[_0x1204e8];return _0x4f7b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13be('0x0'))(_0x13be('0x1'));var moment=require(_0x13be('0x2'));var BPromise=require(_0x13be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13be('0x4'));var rimraf=require(_0x13be('0x5'));var config=require(_0x13be('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x13be('0x7')]=function(_0x1dae8b,_0x54f4df){return _0x1dae8b[_0x13be('0x8')](_0x13be('0x9'),attributes,{'tableName':_0x13be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d496d,_0x34dec1,_0x5c94ab){if(_0x2d496d[_0x13be('0xb')](_0x13be('0xc'))){_0x2d496d['closedAt']=moment()[_0x13be('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c94ab(null,_0x2d496d);}},'charset':'utf8mb4','collate':_0x13be('0xe')});}; \ No newline at end of file +var _0xb915=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xb915,0xe1));var _0x5b91=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xb915[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x5b91('0x0'));var util=require(_0x5b91('0x1'));var logger=require(_0x5b91('0x2'))('api');var moment=require(_0x5b91('0x3'));var BPromise=require(_0x5b91('0x4'));var rp=require(_0x5b91('0x5'));var fs=require('fs');var path=require(_0x5b91('0x6'));var rimraf=require('rimraf');var config=require(_0x5b91('0x7'));var attributes=require(_0x5b91('0x8'));module[_0x5b91('0x9')]=function(_0xefebf2,_0x5a819a){return _0xefebf2['define'](_0x5b91('0xa'),attributes,{'tableName':_0x5b91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f254c,_0x512132,_0x417639){if(_0x3f254c['changed']('closed')){_0x3f254c['closedAt']=moment()[_0x5b91('0xc')](_0x5b91('0xd'));}_0x417639(null,_0x3f254c);}},'charset':'utf8mb4','collate':_0x5b91('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 76e8d75..cdabc24 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 _0x3432=['code','message','result','catch','options','raw','attributes','limit','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','find','where','ids','omit','body','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ff911,_0x1d2823){var _0x557082=function(_0x247a45){while(--_0x247a45){_0x1ff911['push'](_0x1ff911['shift']());}};_0x557082(++_0x1d2823);}(_0x3432,0x1c1));var _0x2343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3432[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2343('0x0'));var util=require(_0x2343('0x1'));var moment=require(_0x2343('0x2'));var BPromise=require('bluebird');var rs=require(_0x2343('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2343('0x4'))['db'];var utils=require(_0x2343('0x5'));var logger=require('../../config/logger')(_0x2343('0x6'));var config=require('../../config/environment');var jayson=require(_0x2343('0x7'));var client=jayson['client'][_0x2343('0x8')]({'port':0x232a});config[_0x2343('0x9')]=_['defaults'](config[_0x2343('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2343('0xa'))(new Redis(config[_0x2343('0x9')]));require(_0x2343('0xb'))['register'](socket);function respondWithRpcPromise(_0x37bfdd,_0x1609cd,_0x26fe67){return new BPromise(function(_0x9c5f3b,_0x39d702){return client[_0x2343('0xc')](_0x37bfdd,_0x26fe67)['then'](function(_0x271f6b){logger[_0x2343('0xd')](_0x2343('0xe'),_0x1609cd,_0x2343('0xf'));logger['debug'](_0x2343('0x10'),_0x1609cd,'request\x20sent',JSON[_0x2343('0x11')](_0x271f6b));if(_0x271f6b[_0x2343('0x12')]){if(_0x271f6b[_0x2343('0x12')][_0x2343('0x13')]===0x1f4){logger[_0x2343('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1609cd,_0x271f6b[_0x2343('0x12')][_0x2343('0x14')]);return _0x39d702(_0x271f6b['error'][_0x2343('0x14')]);}logger[_0x2343('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1609cd,_0x271f6b[_0x2343('0x12')][_0x2343('0x14')]);return _0x9c5f3b(_0x271f6b['error'][_0x2343('0x14')]);}else{logger[_0x2343('0xd')](_0x2343('0xe'),_0x1609cd,_0x2343('0xf'));_0x9c5f3b(_0x271f6b[_0x2343('0x15')][_0x2343('0x14')]);}})[_0x2343('0x16')](function(_0x525829){logger[_0x2343('0x12')](_0x2343('0xe'),_0x1609cd,_0x525829);_0x39d702(_0x525829);});});}exports['UpdateChatInteraction']=function(_0x34665a){var _0x539412=this;return new Promise(function(_0x2d7b6e,_0x376174){return db['ChatInteraction']['update'](_0x34665a['body'],{'raw':_0x34665a[_0x2343('0x17')]?_0x34665a['options'][_0x2343('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')]['where']||null:null,'attributes':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')][_0x2343('0x19')]||null:null,'limit':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')][_0x2343('0x1a')]||null:null})[_0x2343('0x1b')](function(_0x4e0b28){logger[_0x2343('0xd')](_0x2343('0x1c'),_0x34665a);logger[_0x2343('0x1d')](_0x2343('0x1c'),_0x34665a,JSON[_0x2343('0x11')](_0x4e0b28));_0x2d7b6e(_0x4e0b28);})[_0x2343('0x16')](function(_0x843a6){logger['error'](_0x2343('0x1c'),_0x843a6['message'],_0x34665a);_0x376174(_0x539412['error'](0x1f4,_0x843a6['message']));});});};exports[_0x2343('0x1e')]=function(_0x2ccabe){return new Promise(function(_0x51449a,_0x54407e){return db[_0x2343('0x1f')][_0x2343('0x20')]({'where':_0x2ccabe[_0x2343('0x17')]?_0x2ccabe[_0x2343('0x17')][_0x2343('0x21')]||null:null})[_0x2343('0x1b')](function(_0x25b706){if(_0x25b706){return _0x25b706['addTags'](_0x2ccabe['body'][_0x2343('0x22')],_[_0x2343('0x23')](_0x2ccabe[_0x2343('0x24')],['ids','id'])||{});}})[_0x2343('0x25')](function(_0x43b6a6){logger[_0x2343('0xd')](_0x2343('0x26'),_0x2ccabe);logger[_0x2343('0x1d')](_0x2343('0x26'),_0x2ccabe,JSON[_0x2343('0x11')](_0x43b6a6));_0x51449a(_0x43b6a6);})['catch'](function(_0x477147){logger['error'](_0x2343('0x26'),_0x477147[_0x2343('0x14')],_0x2ccabe);_0x54407e(_this['error'](0x1f4,_0x477147[_0x2343('0x14')]));});});}; \ No newline at end of file +var _0x8a3c=['AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread'];(function(_0x347573,_0x3a1f04){var _0x15a549=function(_0x1aef7d){while(--_0x1aef7d){_0x347573['push'](_0x347573['shift']());}};_0x15a549(++_0x3a1f04);}(_0x8a3c,0x1c4));var _0xc8a3=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x8a3c[_0xcd4d8e];return _0x1c3c61;};'use strict';var _=require(_0xc8a3('0x0'));var util=require(_0xc8a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc8a3('0x2'));var fs=require('fs');var Redis=require(_0xc8a3('0x3'));var db=require(_0xc8a3('0x4'))['db'];var utils=require(_0xc8a3('0x5'));var logger=require(_0xc8a3('0x6'))(_0xc8a3('0x7'));var config=require(_0xc8a3('0x8'));var jayson=require(_0xc8a3('0x9'));var client=jayson[_0xc8a3('0xa')][_0xc8a3('0xb')]({'port':0x232a});config[_0xc8a3('0xc')]=_[_0xc8a3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc8a3('0xe'))(new Redis(config[_0xc8a3('0xc')]));require(_0xc8a3('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c5e29,_0x5ddbb1,_0x84d7c6){return new BPromise(function(_0x5a7ed0,_0x4d9bb6){return client['request'](_0x5c5e29,_0x84d7c6)[_0xc8a3('0x10')](function(_0x499583){logger['info'](_0xc8a3('0x11'),_0x5ddbb1,'request\x20sent');logger[_0xc8a3('0x12')](_0xc8a3('0x13'),_0x5ddbb1,_0xc8a3('0x14'),JSON[_0xc8a3('0x15')](_0x499583));if(_0x499583[_0xc8a3('0x16')]){if(_0x499583[_0xc8a3('0x16')]['code']===0x1f4){logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583[_0xc8a3('0x16')]['message']);return _0x4d9bb6(_0x499583[_0xc8a3('0x16')][_0xc8a3('0x17')]);}logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583['error'][_0xc8a3('0x17')]);return _0x5a7ed0(_0x499583['error'][_0xc8a3('0x17')]);}else{logger[_0xc8a3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0xc8a3('0x14'));_0x5a7ed0(_0x499583[_0xc8a3('0x19')][_0xc8a3('0x17')]);}})[_0xc8a3('0x1a')](function(_0x5a79cc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0x5a79cc);_0x4d9bb6(_0x5a79cc);});});}exports[_0xc8a3('0x1b')]=function(_0x57e150){var _0x2c81ab=this;return new Promise(function(_0x46e0b2,_0x551a1a){return db[_0xc8a3('0x1c')]['update'](_0x57e150[_0xc8a3('0x1d')],{'raw':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null,'attributes':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x21')]||null:null,'limit':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x22')]||null:null})[_0xc8a3('0x10')](function(_0x37cc0c){logger['info']('UpdateChatInteraction',_0x57e150);logger[_0xc8a3('0x12')](_0xc8a3('0x1b'),_0x57e150,JSON[_0xc8a3('0x15')](_0x37cc0c));_0x46e0b2(_0x37cc0c);})['catch'](function(_0x45a1fb){logger[_0xc8a3('0x16')](_0xc8a3('0x1b'),_0x45a1fb[_0xc8a3('0x17')],_0x57e150);_0x551a1a(_0x2c81ab[_0xc8a3('0x16')](0x1f4,_0x45a1fb['message']));});});};exports[_0xc8a3('0x23')]=function(_0x599525){return new Promise(function(_0xe3b33a,_0x45c8e6){return db[_0xc8a3('0x1c')][_0xc8a3('0x24')]({'where':_0x599525[_0xc8a3('0x1e')]?_0x599525[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null})[_0xc8a3('0x10')](function(_0x11b93b){if(_0x11b93b){return _0x11b93b[_0xc8a3('0x25')](_0x599525[_0xc8a3('0x1d')][_0xc8a3('0x26')],_['omit'](_0x599525[_0xc8a3('0x1d')],['ids','id'])||{});}})[_0xc8a3('0x27')](function(_0x404d60){logger[_0xc8a3('0x18')](_0xc8a3('0x28'),_0x599525);logger[_0xc8a3('0x12')]('AddTags',_0x599525,JSON['stringify'](_0x404d60));_0xe3b33a(_0x404d60);})[_0xc8a3('0x1a')](function(_0x1a6c41){logger['error'](_0xc8a3('0x28'),_0x1a6c41[_0xc8a3('0x17')],_0x599525);_0x45c8e6(_this[_0xc8a3('0x16')](0x1f4,_0x1a6c41[_0xc8a3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f2ac622..9c91c54 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 _0x564c=['save','remove','update','emit','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x2f29a5,_0x486f4a){var _0x1bbfae=function(_0x22652e){while(--_0x22652e){_0x2f29a5['push'](_0x2f29a5['shift']());}};_0x1bbfae(++_0x486f4a);}(_0x564c,0xe7));var _0xc564=function(_0x200045,_0x4e5da1){_0x200045=_0x200045-0x0;var _0x566a8d=_0x564c[_0x200045];return _0x566a8d;};'use strict';var ChatInteractionEvents=require(_0xc564('0x0'));var events=[_0xc564('0x1'),_0xc564('0x2'),_0xc564('0x3')];function createListener(_0x363ba3,_0x5597df){return function(_0x58ad7b){_0x5597df[_0xc564('0x4')](_0x363ba3,_0x58ad7b);};}function removeListener(_0x38a70c,_0x1fceee){return function(){ChatInteractionEvents['removeListener'](_0x38a70c,_0x1fceee);};}exports[_0xc564('0x5')]=function(_0x32bbc9){for(var _0x147c03=0x0,_0x149eec=events[_0xc564('0x6')];_0x147c03<_0x149eec;_0x147c03++){var _0x19ca48=events[_0x147c03];var _0xe00518=createListener(_0xc564('0x7')+_0x19ca48,_0x32bbc9);ChatInteractionEvents['on'](_0x19ca48,_0xe00518);}}; \ No newline at end of file +var _0x7376=['save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x2b92ec,_0x18e0e3){var _0x12be46=function(_0x18118b){while(--_0x18118b){_0x2b92ec['push'](_0x2b92ec['shift']());}};_0x12be46(++_0x18e0e3);}(_0x7376,0xa8));var _0x6737=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7376[_0x4b055c];return _0x4b62bb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6737('0x0'),_0x6737('0x1'),_0x6737('0x2')];function createListener(_0x3ad727,_0x45c267){return function(_0x2c9370){_0x45c267[_0x6737('0x3')](_0x3ad727,_0x2c9370);};}function removeListener(_0x5da8ea,_0x569bb8){return function(){ChatInteractionEvents[_0x6737('0x4')](_0x5da8ea,_0x569bb8);};}exports['register']=function(_0x1d0d44){for(var _0x12b8bc=0x0,_0x17eae0=events[_0x6737('0x5')];_0x12b8bc<_0x17eae0;_0x12b8bc++){var _0x579b64=events[_0x12b8bc];var _0x184a47=createListener(_0x6737('0x6')+_0x579b64,_0x1d0d44);ChatInteractionEvents['on'](_0x579b64,_0x184a47);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 0b4803a..1d2bce2 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 _0x4a4f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMyMessages','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','close','chatinteraction:destroy','destroy','delete','exports','multer','util'];(function(_0x256bfc,_0x26e6ff){var _0x5cdd26=function(_0x51b296){while(--_0x51b296){_0x256bfc['push'](_0x256bfc['shift']());}};_0x5cdd26(++_0x26e6ff);}(_0x4a4f,0x1a5));var _0xf4a4=function(_0xb6dab7,_0x209af0){_0xb6dab7=_0xb6dab7-0x0;var _0x9d51a7=_0x4a4f[_0xb6dab7];return _0x9d51a7;};'use strict';var multer=require(_0xf4a4('0x0'));var util=require(_0xf4a4('0x1'));var path=require('path');var timeout=require(_0xf4a4('0x2'));var express=require(_0xf4a4('0x3'));var router=express['Router']();var fs_extra=require(_0xf4a4('0x4'));var auth=require(_0xf4a4('0x5'));var interaction=require(_0xf4a4('0x6'));var config=require(_0xf4a4('0x7'));var controller=require(_0xf4a4('0x8'));router[_0xf4a4('0x9')]('/',auth[_0xf4a4('0xa')](),controller[_0xf4a4('0xb')]);router[_0xf4a4('0x9')](_0xf4a4('0xc'),auth[_0xf4a4('0xa')](),controller['describe']);router[_0xf4a4('0x9')]('/:id',auth[_0xf4a4('0xd')](),controller['show']);router[_0xf4a4('0x9')](_0xf4a4('0xe'),auth[_0xf4a4('0xd')](),controller[_0xf4a4('0xf')]);router[_0xf4a4('0x9')]('/:id/messages',auth[_0xf4a4('0xa')](),controller['getMessages']);router[_0xf4a4('0x9')]('/:id/my_messages',auth[_0xf4a4('0xd')](),controller[_0xf4a4('0x10')]);router[_0xf4a4('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf4a4('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf4a4('0x11')](_0xf4a4('0x12'),auth[_0xf4a4('0xa')](),controller[_0xf4a4('0x13')]);var upload=multer({'storage':multer[_0xf4a4('0x14')]({'destination':function(_0x3cbf7e,_0x4befe6,_0x433b87){_0x433b87(null,path['join'](config[_0xf4a4('0x15')],_0xf4a4('0x16')));},'filename':function(_0x2f6823,_0xc8bd3f,_0x50b35d){_0x50b35d(null,util[_0xf4a4('0x17')](_0xf4a4('0x18'),Date['now'](),_0xc8bd3f['originalname'][_0xf4a4('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf4a4('0x1a'),upload[_0xf4a4('0x1b')](_0xf4a4('0x1c')),controller['attachmentUpload']);router[_0xf4a4('0x11')](_0xf4a4('0x1d'),auth[_0xf4a4('0xd')](),controller[_0xf4a4('0x1e')]);router['post'](_0xf4a4('0x1f'),auth[_0xf4a4('0xa')](),interaction[_0xf4a4('0x20')](_0xf4a4('0x21'),_0xf4a4('0x22')),controller[_0xf4a4('0x23')]);router[_0xf4a4('0x24')](_0xf4a4('0x25'),auth[_0xf4a4('0xa')](),interaction[_0xf4a4('0x20')](_0xf4a4('0x21'),_0xf4a4('0x26')),controller[_0xf4a4('0x27')]);router[_0xf4a4('0x24')]('/:id/custom_update',controller[_0xf4a4('0x28')]);router[_0xf4a4('0x24')](_0xf4a4('0x29'),auth[_0xf4a4('0xd')](),controller['abandon']);router['put']('/:id/close',controller[_0xf4a4('0x2a')]);router['delete'](_0xf4a4('0x25'),auth['isAuthenticated'](),interaction[_0xf4a4('0x20')]('chat',_0xf4a4('0x2b')),controller[_0xf4a4('0x2c')]);router[_0xf4a4('0x2d')](_0xf4a4('0x1f'),auth[_0xf4a4('0xa')](),controller['removeTags']);module[_0xf4a4('0x2e')]=router; \ No newline at end of file +var _0x8dd8=['update','put','/:id/custom_update','/:id/abandon','abandon','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x5b67bd,_0x2bf7ef){var _0x2b795a=function(_0x124fea){while(--_0x124fea){_0x5b67bd['push'](_0x5b67bd['shift']());}};_0x2b795a(++_0x2bf7ef);}(_0x8dd8,0x188));var _0x88dd=function(_0x585ae6,_0x25aa5f){_0x585ae6=_0x585ae6-0x0;var _0x87f16b=_0x8dd8[_0x585ae6];return _0x87f16b;};'use strict';var multer=require(_0x88dd('0x0'));var util=require('util');var path=require(_0x88dd('0x1'));var timeout=require(_0x88dd('0x2'));var express=require(_0x88dd('0x3'));var router=express[_0x88dd('0x4')]();var fs_extra=require(_0x88dd('0x5'));var auth=require(_0x88dd('0x6'));var interaction=require(_0x88dd('0x7'));var config=require(_0x88dd('0x8'));var controller=require(_0x88dd('0x9'));router[_0x88dd('0xa')]('/',auth[_0x88dd('0xb')](),controller[_0x88dd('0xc')]);router[_0x88dd('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x88dd('0xd')]);router[_0x88dd('0xa')](_0x88dd('0xe'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x10')]);router[_0x88dd('0xa')](_0x88dd('0x11'),auth[_0x88dd('0xf')](),controller['attachmentDownload']);router[_0x88dd('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x88dd('0xa')](_0x88dd('0x12'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x13')]);router[_0x88dd('0xa')](_0x88dd('0x14'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x15')]);router[_0x88dd('0x16')]('/',auth['isAuthenticated'](),controller[_0x88dd('0x17')]);router[_0x88dd('0x16')](_0x88dd('0x18'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x388fca,_0xdb5b02,_0x7572d4){_0x7572d4(null,path[_0x88dd('0x1a')](config[_0x88dd('0x1b')],_0x88dd('0x1c')));},'filename':function(_0x4407c3,_0x24a9be,_0x24e59d){_0x24e59d(null,util[_0x88dd('0x1d')](_0x88dd('0x1e'),Date[_0x88dd('0x1f')](),_0x24a9be[_0x88dd('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88dd('0x21'),upload[_0x88dd('0x22')](_0x88dd('0x23')),controller['attachmentUpload']);router[_0x88dd('0x16')]('/:id/messages',auth[_0x88dd('0xf')](),controller['addMessage']);router['post'](_0x88dd('0x24'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),_0x88dd('0x27')),controller['addTags']);router['put']('/:id',auth[_0x88dd('0xb')](),interaction['tracked'](_0x88dd('0x26'),'chatinteraction:update'),controller[_0x88dd('0x28')]);router[_0x88dd('0x29')](_0x88dd('0x2a'),controller['customUpdate']);router['put'](_0x88dd('0x2b'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x2c')]);router[_0x88dd('0x29')]('/:id/close',controller['close']);router[_0x88dd('0x2d')](_0x88dd('0xe'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),'chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x88dd('0xb')](),controller[_0x88dd('0x2e')]);module[_0x88dd('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 9e38a22..b8e6563 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 _0xef83=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x4989ce,_0x2c420d){var _0x4d5c47=function(_0x596edf){while(--_0x596edf){_0x4989ce['push'](_0x4989ce['shift']());}};_0x4d5c47(++_0x2c420d);}(_0xef83,0x161));var _0x3ef8=function(_0x1fc3aa,_0x1b92fd){_0x1fc3aa=_0x1fc3aa-0x0;var _0x11dd40=_0xef83[_0x1fc3aa];return _0x11dd40;};'use strict';var Sequelize=require('sequelize');module[_0x3ef8('0x0')]={'body':{'type':Sequelize[_0x3ef8('0x1')](_0x3ef8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3ef8('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3ef8('0x4')]}}; \ No newline at end of file +var _0xc65c=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x3e0475,_0x4ee34c){var _0x1547c3=function(_0x415a52){while(--_0x415a52){_0x3e0475['push'](_0x3e0475['shift']());}};_0x1547c3(++_0x4ee34c);}(_0xc65c,0x11b));var _0xcc65=function(_0x5197eb,_0x745e93){_0x5197eb=_0x5197eb-0x0;var _0x19da1f=_0xc65c[_0x5197eb];return _0x19da1f;};'use strict';var Sequelize=require(_0xcc65('0x0'));module[_0xcc65('0x1')]={'body':{'type':Sequelize[_0xcc65('0x2')](_0xcc65('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcc65('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 87511eb..144525c 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 _0x3ac8=['agent','user','fullname','online','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','ChatInternalMessage','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x3ac8,0x1d4));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x83ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83ac('0x1'));var jsonpatch=require(_0x83ac('0x2'));var rp=require(_0x83ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83ac('0x4'));var util=require(_0x83ac('0x5'));var path=require(_0x83ac('0x6'));var sox=require(_0x83ac('0x7'));var csv=require(_0x83ac('0x8'));var ejs=require(_0x83ac('0x9'));var fs=require('fs');var fs_extra=require(_0x83ac('0xa'));var _=require(_0x83ac('0xb'));var squel=require(_0x83ac('0xc'));var crypto=require(_0x83ac('0xd'));var jsforce=require(_0x83ac('0xe'));var deskjs=require(_0x83ac('0xf'));var toCsv=require(_0x83ac('0x8'));var querystring=require(_0x83ac('0x10'));var Papa=require(_0x83ac('0x11'));var Redis=require(_0x83ac('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x83ac('0x13'));var as=require(_0x83ac('0x14'));var hardwareService=require(_0x83ac('0x15'));var logger=require('../../config/logger')(_0x83ac('0x16'));var utils=require(_0x83ac('0x17'));var config=require(_0x83ac('0x18'));var licenseUtil=require(_0x83ac('0x19'));var db=require(_0x83ac('0x1a'))['db'];config[_0x83ac('0x1b')]=_[_0x83ac('0x1c')](config[_0x83ac('0x1b')],{'host':_0x83ac('0x1d'),'port':0x18eb});var socket=require(_0x83ac('0x1e'))(new Redis(config[_0x83ac('0x1b')]));require(_0x83ac('0x1f'))['register'](socket);function respondWithStatusCode(_0x5db060,_0x34d5a1){_0x34d5a1=_0x34d5a1||0xcc;return function(_0x5a9b3a){if(_0x5a9b3a){return _0x5db060['sendStatus'](_0x34d5a1);}return _0x5db060[_0x83ac('0x20')](_0x34d5a1)[_0x83ac('0x21')]();};}function respondWithResult(_0x873d48,_0x5e7463){_0x5e7463=_0x5e7463||0xc8;return function(_0x3d6b52){if(_0x3d6b52){return _0x873d48['status'](_0x5e7463)[_0x83ac('0x22')](_0x3d6b52);}};}function respondWithFilteredResult(_0x2127b9,_0x50a88d){return function(_0x40824d){if(_0x40824d){var _0x13f03a=typeof _0x50a88d[_0x83ac('0x23')]===_0x83ac('0x24')&&typeof _0x50a88d[_0x83ac('0x25')]===_0x83ac('0x24');var _0x254815=_0x40824d[_0x83ac('0x26')];var _0x103ed8=_0x13f03a?0x0:_0x50a88d[_0x83ac('0x23')];var _0x5f4a38=_0x13f03a?_0x40824d[_0x83ac('0x26')]:_0x50a88d[_0x83ac('0x23')]+_0x50a88d['limit'];var _0x42d2e1;if(_0x5f4a38>=_0x254815){_0x5f4a38=_0x254815;_0x42d2e1=0xc8;}else{_0x42d2e1=0xce;}_0x2127b9[_0x83ac('0x20')](_0x42d2e1);return _0x2127b9['set'](_0x83ac('0x27'),_0x103ed8+'-'+_0x5f4a38+'/'+_0x254815)[_0x83ac('0x22')](_0x40824d);}return null;};}function patchUpdates(_0x1e4db8){return function(_0x4dc24c){try{jsonpatch[_0x83ac('0x28')](_0x4dc24c,_0x1e4db8,!![]);}catch(_0x65e78d){return BPromise[_0x83ac('0x29')](_0x65e78d);}return _0x4dc24c[_0x83ac('0x2a')]();};}function saveUpdates(_0x230feb,_0x49d514){return function(_0x36b13b){if(_0x36b13b){return _0x36b13b['update'](_0x230feb)[_0x83ac('0x2b')](function(_0x4a8173){return _0x4a8173;});}return null;};}function removeEntity(_0x4bb49d,_0x4d9b57){return function(_0x5bf2d2){if(_0x5bf2d2){return _0x5bf2d2[_0x83ac('0x2c')]()[_0x83ac('0x2b')](function(){_0x4bb49d[_0x83ac('0x20')](0xcc)[_0x83ac('0x21')]();});}};}function handleEntityNotFound(_0x338bac,_0x395b68){return function(_0x404d76){if(!_0x404d76){_0x338bac[_0x83ac('0x2d')](0x194);}return _0x404d76;};}function handleError(_0x392c6b,_0x189103){_0x189103=_0x189103||0x1f4;return function(_0x53b4cf){logger[_0x83ac('0x2e')](_0x53b4cf['stack']);if(_0x53b4cf[_0x83ac('0x2f')]){delete _0x53b4cf[_0x83ac('0x2f')];}_0x392c6b[_0x83ac('0x20')](_0x189103)['send'](_0x53b4cf);};}exports[_0x83ac('0x30')]=function(_0x12e4b6,_0x2275a2){var _0x13d300={},_0x239910={},_0x5512cc={'count':0x0,'rows':[]};var _0x2637ed=_[_0x83ac('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x544672){return{'name':_0x544672[_0x83ac('0x32')],'type':_0x544672[_0x83ac('0x33')]['key']};});_0x239910['model']=_[_0x83ac('0x31')](_0x2637ed,_0x83ac('0x2f'));_0x239910[_0x83ac('0x34')]=_['keys'](_0x12e4b6[_0x83ac('0x34')]);_0x239910[_0x83ac('0x35')]=_[_0x83ac('0x36')](_0x239910[_0x83ac('0x37')],_0x239910[_0x83ac('0x34')]);_0x13d300[_0x83ac('0x38')]=_[_0x83ac('0x36')](_0x239910[_0x83ac('0x37')],qs[_0x83ac('0x39')](_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x39')]));_0x13d300['attributes']=_0x13d300[_0x83ac('0x38')][_0x83ac('0x3a')]?_0x13d300[_0x83ac('0x38')]:_0x239910['model'];if(!_0x12e4b6['query'][_0x83ac('0x3b')]('nolimit')){_0x13d300[_0x83ac('0x25')]=qs[_0x83ac('0x25')](_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x25')]);_0x13d300[_0x83ac('0x23')]=qs[_0x83ac('0x23')](_0x12e4b6['query'][_0x83ac('0x23')]);}_0x13d300[_0x83ac('0x3c')]=qs[_0x83ac('0x3d')](_0x12e4b6[_0x83ac('0x34')]['sort']);_0x13d300['where']=qs[_0x83ac('0x35')](_[_0x83ac('0x3e')](_0x12e4b6['query'],_0x239910[_0x83ac('0x35')]),_0x2637ed);if(_0x12e4b6['query']['filter']){_0x13d300[_0x83ac('0x3f')]=_[_0x83ac('0x40')](_0x13d300[_0x83ac('0x3f')],{'$or':_[_0x83ac('0x31')](_0x2637ed,function(_0x2b8621){if(_0x2b8621[_0x83ac('0x33')]!==_0x83ac('0x41')){var _0x258df4={};_0x258df4[_0x2b8621['name']]={'$like':'%'+_0x12e4b6[_0x83ac('0x34')]['filter']+'%'};return _0x258df4;}})});}_0x13d300=_[_0x83ac('0x40')]({},_0x13d300,_0x12e4b6[_0x83ac('0x42')]);var _0x518d38={'where':_0x13d300[_0x83ac('0x3f')]};return db[_0x83ac('0x43')][_0x83ac('0x26')](_0x518d38)['then'](function(_0x127242){_0x5512cc[_0x83ac('0x26')]=_0x127242;if(_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x44')]){_0x13d300['include']=[{'all':!![]}];}return db[_0x83ac('0x43')][_0x83ac('0x45')](_0x13d300);})[_0x83ac('0x2b')](function(_0x12020e){_0x5512cc[_0x83ac('0x46')]=_0x12020e;return _0x5512cc;})[_0x83ac('0x2b')](respondWithFilteredResult(_0x2275a2,_0x13d300))[_0x83ac('0x47')](handleError(_0x2275a2,null));};exports[_0x83ac('0x48')]=function(_0x50deae,_0x1aacd0){var _0x1c05da={'raw':!![],'where':{'id':_0x50deae[_0x83ac('0x49')]['id']}},_0xb0a04e={};_0xb0a04e['model']=_[_0x83ac('0x4a')](db[_0x83ac('0x43')][_0x83ac('0x4b')]);_0xb0a04e['query']=_[_0x83ac('0x4a')](_0x50deae['query']);_0xb0a04e[_0x83ac('0x35')]=_[_0x83ac('0x36')](_0xb0a04e[_0x83ac('0x37')],_0xb0a04e[_0x83ac('0x34')]);_0x1c05da[_0x83ac('0x38')]=_['intersection'](_0xb0a04e[_0x83ac('0x37')],qs[_0x83ac('0x39')](_0x50deae['query']['fields']));_0x1c05da[_0x83ac('0x38')]=_0x1c05da[_0x83ac('0x38')][_0x83ac('0x3a')]?_0x1c05da[_0x83ac('0x38')]:_0xb0a04e[_0x83ac('0x37')];if(_0x50deae[_0x83ac('0x34')][_0x83ac('0x44')]){_0x1c05da[_0x83ac('0x4c')]=[{'all':!![]}];}_0x1c05da=_['merge']({},_0x1c05da,_0x50deae['options']);return db[_0x83ac('0x43')][_0x83ac('0x4d')](_0x1c05da)['then'](handleEntityNotFound(_0x1aacd0,null))[_0x83ac('0x2b')](respondWithResult(_0x1aacd0,null))['catch'](handleError(_0x1aacd0,null));};exports['create']=function(_0x2aed74,_0x5b3182){return db[_0x83ac('0x43')][_0x83ac('0x4e')](_0x2aed74[_0x83ac('0x4f')],{})[_0x83ac('0x2b')](respondWithResult(_0x5b3182,0xc9))[_0x83ac('0x47')](handleError(_0x5b3182,null));};exports['update']=function(_0x1292cf,_0x2e62f4){if(_0x1292cf[_0x83ac('0x4f')]['id']){delete _0x1292cf[_0x83ac('0x4f')]['id'];}return db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'id':_0x1292cf[_0x83ac('0x49')]['id']}})[_0x83ac('0x2b')](handleEntityNotFound(_0x2e62f4,null))[_0x83ac('0x2b')](saveUpdates(_0x1292cf[_0x83ac('0x4f')],null))[_0x83ac('0x2b')](respondWithResult(_0x2e62f4,null))[_0x83ac('0x47')](handleError(_0x2e62f4,null));};exports[_0x83ac('0x2c')]=function(_0x115b79,_0x1db189){return db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'id':_0x115b79['params']['id']}})['then'](handleEntityNotFound(_0x1db189,null))[_0x83ac('0x2b')](removeEntity(_0x1db189,null))[_0x83ac('0x47')](handleError(_0x1db189,null));};exports['describe']=function(_0x31b004,_0x243fbd){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x243fbd,null))['catch'](handleError(_0x243fbd,null));};function wrapUser(_0x3d1667){return function(_0xb5a1e){var _0x436f09=_0x3d1667[_0x83ac('0x50')]({'plain':!![]});_0x436f09[_0x83ac('0x51')]=[];if(_0xb5a1e){_0x436f09[_0x83ac('0x52')]=_0xb5a1e['createdAt'];_0x436f09['lastMessage']=_0xb5a1e;}else{_0x436f09[_0x83ac('0x52')]=moment(0x0)[_0x83ac('0x53')](_0x83ac('0x54'));_0x436f09[_0x83ac('0x55')]={};}return _0x436f09;};}exports['getUsers']=function(_0x347d6e,_0x50ff2c,_0x4dda24){var _0x45b505=[];return db[_0x83ac('0x56')][_0x83ac('0x45')]({'where':{'role':[_0x83ac('0x57'),'admin',_0x83ac('0x58')]},'attributes':['id',_0x83ac('0x59'),_0x83ac('0x2f'),'role','userpic','internal',_0x83ac('0x5a'),'lastLoginAt','allowmessenger',_0x83ac('0x5b')],'order':qs['sort'](_0x83ac('0x5c')),'include':[{'model':db[_0x83ac('0x5d')],'as':_0x83ac('0x5e'),'attributes':['id',_0x83ac('0x2f'),_0x83ac('0x33')],'through':{'attributes':[]}}]})[_0x83ac('0x2b')](function(_0x3aa34e){if(_0x3aa34e){var _0x5e642a=_0x347d6e[_0x83ac('0x58')][_0x83ac('0x50')]({'plain':!![]});if(!_0x5e642a)throw new Error(_0x83ac('0x5f'));if(_0x5e642a[_0x83ac('0x60')]==='user'){return db[_0x83ac('0x61')][_0x83ac('0x4d')]({'where':{'name':_0x83ac('0x62'),'userProfileId':_0x5e642a[_0x83ac('0x63')]},'raw':!![]})['then'](function(_0x7b6b94){if(_0x7b6b94){if(_0x7b6b94[_0x83ac('0x64')]===0x0){return db[_0x83ac('0x65')]['findAll']({'where':{'sectionId':_0x7b6b94['id']},'raw':!![]})[_0x83ac('0x2b')](function(_0x4f969f){var _0x207a77=[];if(_[_0x83ac('0x66')](_0x4f969f)){_0x207a77=_[_0x83ac('0x67')](_0x3aa34e,function(_0x27b815){if(_0x27b815[_0x83ac('0x60')]!==_0x83ac('0x57')){return _0x27b815;}});return _0x207a77;}else{for(var _0x3fc14c=0x0;_0x3fc14c<_0x3aa34e['length'];_0x3fc14c++){var _0x1b13f7=_0x3aa34e[_0x3fc14c];if(_0x1b13f7[_0x83ac('0x60')]===_0x83ac('0x57')){var _0x5b180b=_[_0x83ac('0x4d')](_0x4f969f,function(_0x113577){return _0x113577[_0x83ac('0x68')]===_0x1b13f7['id'];});if(_0x5b180b)_0x207a77[_0x83ac('0x69')](_0x1b13f7);}else{_0x207a77[_0x83ac('0x69')](_0x1b13f7);}}return _0x207a77;}});}else{return _0x3aa34e;}}else{var _0x574904=_[_0x83ac('0x67')](_0x3aa34e,function(_0x4fe3b4){if(_0x4fe3b4[_0x83ac('0x60')]!==_0x83ac('0x57')){return _0x4fe3b4;}});return _0x574904;}});}else{return _0x3aa34e;}}})[_0x83ac('0x2b')](function(_0x22f1bd){var _0x5ac14d=[];if(_0x22f1bd){_0x45b505=_0x22f1bd;for(var _0x4fe513=0x0;_0x4fe513<_0x22f1bd['length'];_0x4fe513+=0x1){_0x45b505[_0x4fe513]['messages']=[];_0x5ac14d[_0x83ac('0x69')](db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'FromId':[_0x347d6e[_0x83ac('0x58')]['id'],_0x22f1bd[_0x4fe513]['id']],'ToId':[_0x347d6e[_0x83ac('0x58')]['id'],_0x22f1bd[_0x4fe513]['id']],'ChatGroupId':null},'attributes':['id',_0x83ac('0x6a'),_0x83ac('0x6b'),'ToId',_0x83ac('0x6c'),_0x83ac('0x4f')],'order':qs['sort'](_0x83ac('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x83ac('0x2b')](wrapUser(_0x22f1bd[_0x4fe513])));}return BPromise[_0x83ac('0x6e')](_0x5ac14d);}return[];})[_0x83ac('0x2b')](function(_0x2795f5){return{'rows':_0x2795f5,'count':_0x2795f5[_0x83ac('0x3a')]};})['then'](respondWithResult(_0x50ff2c,null))[_0x83ac('0x47')](handleError(_0x50ff2c,null));}; \ No newline at end of file +var _0xc879=['update','destroy','stack','name','index','map','fieldName','query','filters','intersection','attributes','model','fields','length','nolimit','order','where','pick','filter','merge','type','VIRTUAL','ChatInternalMessage','then','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','online','lastLoginAt','sort','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x6595d5,_0x3f84e1){var _0x1b7304=function(_0x44f4f8){while(--_0x44f4f8){_0x6595d5['push'](_0x6595d5['shift']());}};_0x1b7304(++_0x3f84e1);}(_0xc879,0xae));var _0x9c87=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xc879[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x9c87('0x0'));var rimraf=require(_0x9c87('0x1'));var zipdir=require(_0x9c87('0x2'));var jsonpatch=require(_0x9c87('0x3'));var rp=require('request-promise');var moment=require(_0x9c87('0x4'));var BPromise=require(_0x9c87('0x5'));var Mustache=require('mustache');var util=require(_0x9c87('0x6'));var path=require(_0x9c87('0x7'));var sox=require(_0x9c87('0x8'));var csv=require(_0x9c87('0x9'));var ejs=require(_0x9c87('0xa'));var fs=require('fs');var fs_extra=require(_0x9c87('0xb'));var _=require('lodash');var squel=require(_0x9c87('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c87('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c87('0xe'));var Papa=require(_0x9c87('0xf'));var Redis=require(_0x9c87('0x10'));var authService=require(_0x9c87('0x11'));var qs=require(_0x9c87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c87('0x13'));var logger=require('../../config/logger')(_0x9c87('0x14'));var utils=require(_0x9c87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9c87('0x16'));var db=require(_0x9c87('0x17'))['db'];config[_0x9c87('0x18')]=_[_0x9c87('0x19')](config[_0x9c87('0x18')],{'host':_0x9c87('0x1a'),'port':0x18eb});var socket=require(_0x9c87('0x1b'))(new Redis(config['redis']));require(_0x9c87('0x1c'))[_0x9c87('0x1d')](socket);function respondWithStatusCode(_0x1b1b4e,_0x472e9f){_0x472e9f=_0x472e9f||0xcc;return function(_0x2c928e){if(_0x2c928e){return _0x1b1b4e[_0x9c87('0x1e')](_0x472e9f);}return _0x1b1b4e[_0x9c87('0x1f')](_0x472e9f)[_0x9c87('0x20')]();};}function respondWithResult(_0x21d637,_0x1c7628){_0x1c7628=_0x1c7628||0xc8;return function(_0xa32f90){if(_0xa32f90){return _0x21d637['status'](_0x1c7628)[_0x9c87('0x21')](_0xa32f90);}};}function respondWithFilteredResult(_0x2dd586,_0x2507bb){return function(_0xeac869){if(_0xeac869){var _0x427240=typeof _0x2507bb[_0x9c87('0x22')]===_0x9c87('0x23')&&typeof _0x2507bb[_0x9c87('0x24')]===_0x9c87('0x23');var _0x322563=_0xeac869['count'];var _0x1a6a7f=_0x427240?0x0:_0x2507bb[_0x9c87('0x22')];var _0x226b5=_0x427240?_0xeac869[_0x9c87('0x25')]:_0x2507bb[_0x9c87('0x22')]+_0x2507bb[_0x9c87('0x24')];var _0x4016c8;if(_0x226b5>=_0x322563){_0x226b5=_0x322563;_0x4016c8=0xc8;}else{_0x4016c8=0xce;}_0x2dd586[_0x9c87('0x1f')](_0x4016c8);return _0x2dd586['set'](_0x9c87('0x26'),_0x1a6a7f+'-'+_0x226b5+'/'+_0x322563)[_0x9c87('0x21')](_0xeac869);}return null;};}function patchUpdates(_0x1bb5ee){return function(_0x506d84){try{jsonpatch[_0x9c87('0x27')](_0x506d84,_0x1bb5ee,!![]);}catch(_0x136ba1){return BPromise[_0x9c87('0x28')](_0x136ba1);}return _0x506d84[_0x9c87('0x29')]();};}function saveUpdates(_0x571065,_0x52e558){return function(_0x4d46a0){if(_0x4d46a0){return _0x4d46a0[_0x9c87('0x2a')](_0x571065)['then'](function(_0x33487f){return _0x33487f;});}return null;};}function removeEntity(_0x58a702,_0x40a06c){return function(_0x2b7ddf){if(_0x2b7ddf){return _0x2b7ddf[_0x9c87('0x2b')]()['then'](function(){_0x58a702['status'](0xcc)[_0x9c87('0x20')]();});}};}function handleEntityNotFound(_0x1e169b,_0x4633fb){return function(_0x1b94ec){if(!_0x1b94ec){_0x1e169b[_0x9c87('0x1e')](0x194);}return _0x1b94ec;};}function handleError(_0x396794,_0x5e2c6a){_0x5e2c6a=_0x5e2c6a||0x1f4;return function(_0x58029b){logger['error'](_0x58029b[_0x9c87('0x2c')]);if(_0x58029b[_0x9c87('0x2d')]){delete _0x58029b['name'];}_0x396794[_0x9c87('0x1f')](_0x5e2c6a)['send'](_0x58029b);};}exports[_0x9c87('0x2e')]=function(_0x4c2477,_0x12a939){var _0x2a6105={},_0xed8b2b={},_0x3a549d={'count':0x0,'rows':[]};var _0x4debec=_[_0x9c87('0x2f')](db['ChatInternalMessage']['rawAttributes'],function(_0x4f464a){return{'name':_0x4f464a[_0x9c87('0x30')],'type':_0x4f464a['type']['key']};});_0xed8b2b['model']=_['map'](_0x4debec,_0x9c87('0x2d'));_0xed8b2b[_0x9c87('0x31')]=_['keys'](_0x4c2477[_0x9c87('0x31')]);_0xed8b2b[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0xed8b2b['model'],_0xed8b2b[_0x9c87('0x31')]);_0x2a6105[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0xed8b2b[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x4c2477[_0x9c87('0x31')]['fields']));_0x2a6105[_0x9c87('0x34')]=_0x2a6105[_0x9c87('0x34')][_0x9c87('0x37')]?_0x2a6105['attributes']:_0xed8b2b[_0x9c87('0x35')];if(!_0x4c2477[_0x9c87('0x31')]['hasOwnProperty'](_0x9c87('0x38'))){_0x2a6105[_0x9c87('0x24')]=qs[_0x9c87('0x24')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x24')]);_0x2a6105[_0x9c87('0x22')]=qs[_0x9c87('0x22')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x22')]);}_0x2a6105[_0x9c87('0x39')]=qs['sort'](_0x4c2477[_0x9c87('0x31')]['sort']);_0x2a6105[_0x9c87('0x3a')]=qs[_0x9c87('0x32')](_[_0x9c87('0x3b')](_0x4c2477['query'],_0xed8b2b[_0x9c87('0x32')]),_0x4debec);if(_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]){_0x2a6105[_0x9c87('0x3a')]=_[_0x9c87('0x3d')](_0x2a6105[_0x9c87('0x3a')],{'$or':_['map'](_0x4debec,function(_0x324347){if(_0x324347[_0x9c87('0x3e')]!==_0x9c87('0x3f')){var _0x23dc90={};_0x23dc90[_0x324347['name']]={'$like':'%'+_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]+'%'};return _0x23dc90;}})});}_0x2a6105=_[_0x9c87('0x3d')]({},_0x2a6105,_0x4c2477['options']);var _0x4b5fd8={'where':_0x2a6105[_0x9c87('0x3a')]};return db[_0x9c87('0x40')]['count'](_0x4b5fd8)[_0x9c87('0x41')](function(_0x5cafce){_0x3a549d[_0x9c87('0x25')]=_0x5cafce;if(_0x4c2477['query']['includeAll']){_0x2a6105[_0x9c87('0x42')]=[{'all':!![]}];}return db[_0x9c87('0x40')][_0x9c87('0x43')](_0x2a6105);})[_0x9c87('0x41')](function(_0x6e8d3){_0x3a549d['rows']=_0x6e8d3;return _0x3a549d;})[_0x9c87('0x41')](respondWithFilteredResult(_0x12a939,_0x2a6105))[_0x9c87('0x44')](handleError(_0x12a939,null));};exports[_0x9c87('0x45')]=function(_0x1ad7b8,_0x27d1d5){var _0x54795a={'raw':!![],'where':{'id':_0x1ad7b8[_0x9c87('0x46')]['id']}},_0x3c25ad={};_0x3c25ad[_0x9c87('0x35')]=_[_0x9c87('0x47')](db['ChatInternalMessage']['rawAttributes']);_0x3c25ad[_0x9c87('0x31')]=_[_0x9c87('0x47')](_0x1ad7b8[_0x9c87('0x31')]);_0x3c25ad[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],_0x3c25ad['query']);_0x54795a[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x36')]));_0x54795a[_0x9c87('0x34')]=_0x54795a[_0x9c87('0x34')][_0x9c87('0x37')]?_0x54795a['attributes']:_0x3c25ad['model'];if(_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x48')]){_0x54795a[_0x9c87('0x42')]=[{'all':!![]}];}_0x54795a=_[_0x9c87('0x3d')]({},_0x54795a,_0x1ad7b8[_0x9c87('0x49')]);return db[_0x9c87('0x40')][_0x9c87('0x4a')](_0x54795a)['then'](handleEntityNotFound(_0x27d1d5,null))[_0x9c87('0x41')](respondWithResult(_0x27d1d5,null))['catch'](handleError(_0x27d1d5,null));};exports[_0x9c87('0x4b')]=function(_0x26a4db,_0x5a01d1){return db[_0x9c87('0x40')]['create'](_0x26a4db[_0x9c87('0x4c')],{})[_0x9c87('0x41')](respondWithResult(_0x5a01d1,0xc9))['catch'](handleError(_0x5a01d1,null));};exports[_0x9c87('0x2a')]=function(_0x3bb56e,_0x57cce2){if(_0x3bb56e[_0x9c87('0x4c')]['id']){delete _0x3bb56e[_0x9c87('0x4c')]['id'];}return db[_0x9c87('0x40')][_0x9c87('0x4a')]({'where':{'id':_0x3bb56e['params']['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x57cce2,null))['then'](saveUpdates(_0x3bb56e[_0x9c87('0x4c')],null))[_0x9c87('0x41')](respondWithResult(_0x57cce2,null))[_0x9c87('0x44')](handleError(_0x57cce2,null));};exports[_0x9c87('0x2b')]=function(_0x52e823,_0x1959bc){return db['ChatInternalMessage'][_0x9c87('0x4a')]({'where':{'id':_0x52e823[_0x9c87('0x46')]['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x1959bc,null))['then'](removeEntity(_0x1959bc,null))[_0x9c87('0x44')](handleError(_0x1959bc,null));};exports[_0x9c87('0x4d')]=function(_0x39cf27,_0x3da7a7){return db['ChatInternalMessage']['describe']()[_0x9c87('0x41')](respondWithResult(_0x3da7a7,null))[_0x9c87('0x44')](handleError(_0x3da7a7,null));};function wrapUser(_0x2beb00){return function(_0x8a948f){var _0x578c19=_0x2beb00[_0x9c87('0x4e')]({'plain':!![]});_0x578c19[_0x9c87('0x4f')]=[];if(_0x8a948f){_0x578c19[_0x9c87('0x50')]=_0x8a948f[_0x9c87('0x51')];_0x578c19[_0x9c87('0x52')]=_0x8a948f;}else{_0x578c19[_0x9c87('0x50')]=moment(0x0)[_0x9c87('0x53')](_0x9c87('0x54'));_0x578c19[_0x9c87('0x52')]={};}return _0x578c19;};}exports[_0x9c87('0x55')]=function(_0x39e627,_0x3e8d06,_0x15c080){var _0x878772=[];return db[_0x9c87('0x56')][_0x9c87('0x43')]({'where':{'role':['agent',_0x9c87('0x57'),'user']},'attributes':['id',_0x9c87('0x58'),_0x9c87('0x2d'),_0x9c87('0x59'),'userpic','internal',_0x9c87('0x5a'),_0x9c87('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x9c87('0x5c')]('-online'),'include':[{'model':db[_0x9c87('0x5d')],'as':_0x9c87('0x5e'),'attributes':['id',_0x9c87('0x2d'),_0x9c87('0x3e')],'through':{'attributes':[]}}]})[_0x9c87('0x41')](function(_0x3d14b0){if(_0x3d14b0){var _0x86440d=_0x39e627[_0x9c87('0x5f')][_0x9c87('0x4e')]({'plain':!![]});if(!_0x86440d)throw new Error(_0x9c87('0x60'));if(_0x86440d[_0x9c87('0x59')]===_0x9c87('0x5f')){return db[_0x9c87('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x86440d[_0x9c87('0x62')]},'raw':!![]})['then'](function(_0x21adf8){if(_0x21adf8){if(_0x21adf8[_0x9c87('0x63')]===0x0){return db[_0x9c87('0x64')]['findAll']({'where':{'sectionId':_0x21adf8['id']},'raw':!![]})[_0x9c87('0x41')](function(_0xa5092f){var _0x292c5f=[];if(_[_0x9c87('0x65')](_0xa5092f)){_0x292c5f=_['filter'](_0x3d14b0,function(_0x1ec3a7){if(_0x1ec3a7[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x1ec3a7;}});return _0x292c5f;}else{for(var _0x3c06eb=0x0;_0x3c06eb<_0x3d14b0[_0x9c87('0x37')];_0x3c06eb++){var _0x1820b5=_0x3d14b0[_0x3c06eb];if(_0x1820b5[_0x9c87('0x59')]===_0x9c87('0x66')){var _0x6ef7ef=_[_0x9c87('0x4a')](_0xa5092f,function(_0x116e7e){return _0x116e7e[_0x9c87('0x67')]===_0x1820b5['id'];});if(_0x6ef7ef)_0x292c5f[_0x9c87('0x68')](_0x1820b5);}else{_0x292c5f[_0x9c87('0x68')](_0x1820b5);}}return _0x292c5f;}});}else{return _0x3d14b0;}}else{var _0xeea046=_[_0x9c87('0x3c')](_0x3d14b0,function(_0x15ff74){if(_0x15ff74[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x15ff74;}});return _0xeea046;}});}else{return _0x3d14b0;}}})['then'](function(_0x31cff4){var _0x3b297d=[];if(_0x31cff4){_0x878772=_0x31cff4;for(var _0x200a55=0x0;_0x200a55<_0x31cff4[_0x9c87('0x37')];_0x200a55+=0x1){_0x878772[_0x200a55][_0x9c87('0x4f')]=[];_0x3b297d[_0x9c87('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ToId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ChatGroupId':null},'attributes':['id',_0x9c87('0x51'),_0x9c87('0x69'),'ToId',_0x9c87('0x6a'),_0x9c87('0x4c')],'order':qs['sort'](_0x9c87('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x31cff4[_0x200a55])));}return BPromise['all'](_0x3b297d);}return[];})['then'](function(_0x33e8a3){return{'rows':_0x33e8a3,'count':_0x33e8a3[_0x9c87('0x37')]};})['then'](respondWithResult(_0x3e8d06,null))[_0x9c87('0x44')](handleError(_0x3e8d06,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index fd99a13..6bf2050 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 _0xb7b9=['save','emit','hasOwnProperty','ChatInternalMessage'];(function(_0x22a633,_0x19707f){var _0x24e275=function(_0x5eb720){while(--_0x5eb720){_0x22a633['push'](_0x22a633['shift']());}};_0x24e275(++_0x19707f);}(_0xb7b9,0xcf));var _0x9b7b=function(_0x4cb660,_0x4c2f2c){_0x4cb660=_0x4cb660-0x0;var _0x476e24=_0xb7b9[_0x4cb660];return _0x476e24;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x9b7b('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b7b('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32a53d){return function(_0x4815ad,_0x4ad0f4,_0x2e1e13){ChatInternalMessageEvents[_0x9b7b('0x2')](_0x32a53d+':'+_0x4815ad['id'],_0x4815ad);ChatInternalMessageEvents[_0x9b7b('0x2')](_0x32a53d,_0x4815ad);_0x2e1e13(null);};}for(var e in events){if(events[_0x9b7b('0x3')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x6df6=['hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x6df6,0xb6));var _0x66df=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x6df6[_0x597484];return _0x218e64;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x66df('0x0'))['db'][_0x66df('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x66df('0x2')](0x0);var events={'afterCreate':_0x66df('0x3'),'afterUpdate':'update','afterDestroy':_0x66df('0x4')};function emitEvent(_0x228964){return function(_0x1d6492,_0x465d71,_0x3cd814){ChatInternalMessageEvents['emit'](_0x228964+':'+_0x1d6492['id'],_0x1d6492);ChatInternalMessageEvents[_0x66df('0x5')](_0x228964,_0x1d6492);_0x3cd814(null);};}for(var e in events){if(events[_0x66df('0x6')](e)){var event=events[e];ChatInternalMessage[_0x66df('0x7')](e,emitEvent(event));}}module[_0x66df('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 89819ea..aa18201 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 _0xf048=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5d5024,_0x4b13ca){var _0x26618e=function(_0x5a4ceb){while(--_0x5a4ceb){_0x5d5024['push'](_0x5d5024['shift']());}};_0x26618e(++_0x4b13ca);}(_0xf048,0x1a1));var _0x8f04=function(_0x5b7ba9,_0x4d437d){_0x5b7ba9=_0x5b7ba9-0x0;var _0xd17602=_0xf048[_0x5b7ba9];return _0xd17602;};'use strict';var _=require(_0x8f04('0x0'));var util=require('util');var logger=require(_0x8f04('0x1'))(_0x8f04('0x2'));var moment=require(_0x8f04('0x3'));var BPromise=require(_0x8f04('0x4'));var rp=require(_0x8f04('0x5'));var fs=require('fs');var path=require(_0x8f04('0x6'));var rimraf=require(_0x8f04('0x7'));var config=require(_0x8f04('0x8'));var attributes=require(_0x8f04('0x9'));module[_0x8f04('0xa')]=function(_0x54dac2,_0x5310aa){return _0x54dac2['define'](_0x8f04('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8f04('0xc'),'collate':_0x8f04('0xd')});}; \ No newline at end of file +var _0xe77d=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xe77d,0x163));var _0xde77=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe77d[_0x581249];return _0x284bae;};'use strict';var _=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var logger=require(_0xde77('0x2'))(_0xde77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde77('0x4'));var fs=require('fs');var path=require(_0xde77('0x5'));var rimraf=require(_0xde77('0x6'));var config=require(_0xde77('0x7'));var attributes=require(_0xde77('0x8'));module['exports']=function(_0x41c6c2,_0x44d28a){return _0x41c6c2[_0xde77('0x9')](_0xde77('0xa'),attributes,{'tableName':_0xde77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde77('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index ddfb7b9..10f081c 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 _0x899a=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x573e59,_0x38748d){var _0x40ae80=function(_0x4c3616){while(--_0x4c3616){_0x573e59['push'](_0x573e59['shift']());}};_0x40ae80(++_0x38748d);}(_0x899a,0x1b6));var _0xa899=function(_0x174531,_0x14049a){_0x174531=_0x174531-0x0;var _0x41b887=_0x899a[_0x174531];return _0x41b887;};'use strict';var _=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var moment=require('moment');var BPromise=require(_0xa899('0x2'));var rs=require(_0xa899('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa899('0x4'))['db'];var utils=require(_0xa899('0x5'));var logger=require(_0xa899('0x6'))(_0xa899('0x7'));var config=require('../../config/environment');var jayson=require(_0xa899('0x8'));var client=jayson[_0xa899('0x9')][_0xa899('0xa')]({'port':0x232a});config[_0xa899('0xb')]=_['defaults'](config[_0xa899('0xb')],{'host':_0xa899('0xc'),'port':0x18eb});var socket=require(_0xa899('0xd'))(new Redis(config[_0xa899('0xb')]));require(_0xa899('0xe'))[_0xa899('0xf')](socket);function respondWithRpcPromise(_0x30954d,_0x184920,_0x1fbfa6){return new BPromise(function(_0x34282a,_0x5a6582){return client[_0xa899('0x10')](_0x30954d,_0x1fbfa6)['then'](function(_0x4eb704){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x184920,_0xa899('0x11'));logger[_0xa899('0x12')](_0xa899('0x13'),_0x184920,'request\x20sent',JSON[_0xa899('0x14')](_0x4eb704));if(_0x4eb704[_0xa899('0x15')]){if(_0x4eb704['error'][_0xa899('0x16')]===0x1f4){logger[_0xa899('0x15')](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')]['message']);return _0x5a6582(_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);}logger['error'](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);return _0x34282a(_0x4eb704['error']['message']);}else{logger[_0xa899('0x19')](_0xa899('0x17'),_0x184920,_0xa899('0x11'));_0x34282a(_0x4eb704[_0xa899('0x1a')][_0xa899('0x18')]);}})['catch'](function(_0x332ced){logger['error'](_0xa899('0x17'),_0x184920,_0x332ced);_0x5a6582(_0x332ced);});});} \ No newline at end of file +var _0xaf73=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d8040,_0x3b44b1){var _0x2dfc90=function(_0xad65ee){while(--_0xad65ee){_0x2d8040['push'](_0x2d8040['shift']());}};_0x2dfc90(++_0x3b44b1);}(_0xaf73,0x19d));var _0x3af7=function(_0x3e2081,_0x55efd1){_0x3e2081=_0x3e2081-0x0;var _0x2897b0=_0xaf73[_0x3e2081];return _0x2897b0;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var moment=require(_0x3af7('0x2'));var BPromise=require(_0x3af7('0x3'));var rs=require(_0x3af7('0x4'));var fs=require('fs');var Redis=require(_0x3af7('0x5'));var db=require(_0x3af7('0x6'))['db'];var utils=require(_0x3af7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3af7('0x8'));var jayson=require(_0x3af7('0x9'));var client=jayson[_0x3af7('0xa')][_0x3af7('0xb')]({'port':0x232a});config[_0x3af7('0xc')]=_[_0x3af7('0xd')](config[_0x3af7('0xc')],{'host':_0x3af7('0xe'),'port':0x18eb});var socket=require(_0x3af7('0xf'))(new Redis(config[_0x3af7('0xc')]));require(_0x3af7('0x10'))[_0x3af7('0x11')](socket);function respondWithRpcPromise(_0xc028c3,_0x53840e,_0x2506dd){return new BPromise(function(_0x2f3265,_0x421c26){return client[_0x3af7('0x12')](_0xc028c3,_0x2506dd)[_0x3af7('0x13')](function(_0x17705b){logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,_0x3af7('0x16'));logger[_0x3af7('0x17')](_0x3af7('0x18'),_0x53840e,'request\x20sent',JSON[_0x3af7('0x19')](_0x17705b));if(_0x17705b[_0x3af7('0x1a')]){if(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1b')]===0x1f4){logger['error'](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x421c26(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}logger[_0x3af7('0x1a')](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x2f3265(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}else{logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,'request\x20sent');_0x2f3265(_0x17705b[_0x3af7('0x1d')][_0x3af7('0x1c')]);}})['catch'](function(_0x4d8dfd){logger['error'](_0x3af7('0x15'),_0x53840e,_0x4d8dfd);_0x421c26(_0x4d8dfd);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index edc8a61..a4e77ed 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 _0x2d2c=['./chatInternalMessage.events','save','remove','update','removeListener','length','chatInternalMessage:'];(function(_0x53afd7,_0x926178){var _0x32ff71=function(_0x124bb5){while(--_0x124bb5){_0x53afd7['push'](_0x53afd7['shift']());}};_0x32ff71(++_0x926178);}(_0x2d2c,0xfc));var _0xc2d2=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x2d2c[_0x397f37];return _0x31cae6;};'use strict';var ChatInternalMessageEvents=require(_0xc2d2('0x0'));var events=[_0xc2d2('0x1'),_0xc2d2('0x2'),_0xc2d2('0x3')];function createListener(_0x33e548,_0x5293e2){return function(_0x52cb1e){_0x5293e2['emit'](_0x33e548,_0x52cb1e);};}function removeListener(_0x135cbb,_0x5ddc51){return function(){ChatInternalMessageEvents[_0xc2d2('0x4')](_0x135cbb,_0x5ddc51);};}exports['register']=function(_0x42fc19){for(var _0x1e8723=0x0,_0x29bb95=events[_0xc2d2('0x5')];_0x1e8723<_0x29bb95;_0x1e8723++){var _0x578d52=events[_0x1e8723];var _0x286152=createListener(_0xc2d2('0x6')+_0x578d52,_0x42fc19);ChatInternalMessageEvents['on'](_0x578d52,_0x286152);}}; \ No newline at end of file +var _0x13ae=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x13ae,0x8b));var _0xe13a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x13ae[_0x2be8c2];return _0x97f531;};'use strict';var ChatInternalMessageEvents=require(_0xe13a('0x0'));var events=[_0xe13a('0x1'),_0xe13a('0x2'),_0xe13a('0x3')];function createListener(_0x5564db,_0x30c11b){return function(_0x241bca){_0x30c11b[_0xe13a('0x4')](_0x5564db,_0x241bca);};}function removeListener(_0x501902,_0x1fd819){return function(){ChatInternalMessageEvents[_0xe13a('0x5')](_0x501902,_0x1fd819);};}exports[_0xe13a('0x6')]=function(_0x4f4051){for(var _0x3359d1=0x0,_0x82892a=events[_0xe13a('0x7')];_0x3359d1<_0x82892a;_0x3359d1++){var _0x505f4f=events[_0x3359d1];var _0x5b098d=createListener(_0xe13a('0x8')+_0x505f4f,_0x4f4051);ChatInternalMessageEvents['on'](_0x505f4f,_0x5b098d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 238ba76..0b271c2 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 _0x88d5=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy'];(function(_0x23a796,_0x48fb50){var _0xa62cb4=function(_0x5dbe47){while(--_0x5dbe47){_0x23a796['push'](_0x23a796['shift']());}};_0xa62cb4(++_0x48fb50);}(_0x88d5,0x83));var _0x588d=function(_0x3ec023,_0xc91590){_0x3ec023=_0x3ec023-0x0;var _0x38db02=_0x88d5[_0x3ec023];return _0x38db02;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express[_0x588d('0x5')]();var fs_extra=require(_0x588d('0x6'));var auth=require(_0x588d('0x7'));var interaction=require(_0x588d('0x8'));var config=require(_0x588d('0x9'));var controller=require(_0x588d('0xa'));router[_0x588d('0xb')]('/',auth['isAuthenticated'](),controller[_0x588d('0xc')]);router[_0x588d('0xb')]('/describe',auth[_0x588d('0xd')](),controller[_0x588d('0xe')]);router[_0x588d('0xb')](_0x588d('0xf'),auth[_0x588d('0xd')](),controller[_0x588d('0x10')]);router[_0x588d('0xb')](_0x588d('0x11'),auth[_0x588d('0xd')](),controller[_0x588d('0x12')]);router[_0x588d('0x13')]('/',auth[_0x588d('0xd')](),controller[_0x588d('0x14')]);router[_0x588d('0x15')]('/:id',controller[_0x588d('0x16')]);router[_0x588d('0x17')](_0x588d('0x11'),auth['isAuthenticated'](),controller[_0x588d('0x18')]);module[_0x588d('0x19')]=router; \ No newline at end of file +var _0xaf12=['show','post','create','update','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','describe','/users','isAuthenticated','getUsers','/:id'];(function(_0xbcc312,_0x26429c){var _0x1edbb5=function(_0x17bb24){while(--_0x17bb24){_0xbcc312['push'](_0xbcc312['shift']());}};_0x1edbb5(++_0x26429c);}(_0xaf12,0x1cd));var _0x2af1=function(_0x3001e6,_0xec7ba1){_0x3001e6=_0x3001e6-0x0;var _0x578018=_0xaf12[_0x3001e6];return _0x578018;};'use strict';var multer=require(_0x2af1('0x0'));var util=require(_0x2af1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2af1('0x2'));var router=express['Router']();var fs_extra=require(_0x2af1('0x3'));var auth=require(_0x2af1('0x4'));var interaction=require(_0x2af1('0x5'));var config=require('../../config/environment');var controller=require(_0x2af1('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2af1('0x7')](_0x2af1('0x8'),auth['isAuthenticated'](),controller[_0x2af1('0x9')]);router[_0x2af1('0x7')](_0x2af1('0xa'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xc')]);router[_0x2af1('0x7')](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xe')]);router[_0x2af1('0xf')]('/',auth[_0x2af1('0xb')](),controller[_0x2af1('0x10')]);router['put']('/:id',controller[_0x2af1('0x11')]);router['delete'](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller['destroy']);module[_0x2af1('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 1ec30e9..9c34573 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 _0xfd7b=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x37a846,_0x1beab2){var _0x4cd7e2=function(_0x1b6c65){while(--_0x1b6c65){_0x37a846['push'](_0x37a846['shift']());}};_0x4cd7e2(++_0x1beab2);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xfd7b[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'body':{'type':Sequelize[_0xbfd7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfd7('0x4')]('in','out'),'defaultValue':_0xbfd7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfd7('0x6')]},'providerName':{'type':Sequelize[_0xbfd7('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x33bca9,_0x25672f){var _0x3190f0=function(_0x1cd6db){while(--_0x1cd6db){_0x33bca9['push'](_0x33bca9['shift']());}};_0x3190f0(++_0x25672f);}(_0x39c4,0x174));var _0x439c=function(_0xa233b,_0x234c9d){_0xa233b=_0xa233b-0x0;var _0x2471d7=_0x39c4[_0xa233b];return _0x2471d7;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7243863..d4eaf6e 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 _0x83f0=['SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','fullname','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','options','include','findAll','rows','show','params','keys','length','includeAll','create','body','find','describe','accept','chat','read','readAt','format','UserId','agent','get','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','interface'];(function(_0x2701fd,_0x506374){var _0x2a9cff=function(_0x4aaec1){while(--_0x4aaec1){_0x2701fd['push'](_0x2701fd['shift']());}};_0x2a9cff(++_0x506374);}(_0x83f0,0x99));var _0x083f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x83f0[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x083f('0x0'));var rimraf=require(_0x083f('0x1'));var zipdir=require(_0x083f('0x2'));var jsonpatch=require(_0x083f('0x3'));var rp=require(_0x083f('0x4'));var moment=require('moment');var BPromise=require(_0x083f('0x5'));var Mustache=require(_0x083f('0x6'));var util=require('util');var path=require(_0x083f('0x7'));var sox=require(_0x083f('0x8'));var csv=require(_0x083f('0x9'));var ejs=require(_0x083f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x083f('0xb'));var squel=require(_0x083f('0xc'));var crypto=require(_0x083f('0xd'));var jsforce=require(_0x083f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x083f('0xf'));var Papa=require(_0x083f('0x10'));var Redis=require(_0x083f('0x11'));var authService=require(_0x083f('0x12'));var qs=require(_0x083f('0x13'));var as=require(_0x083f('0x14'));var hardwareService=require(_0x083f('0x15'));var logger=require(_0x083f('0x16'))(_0x083f('0x17'));var utils=require(_0x083f('0x18'));var config=require(_0x083f('0x19'));var licenseUtil=require(_0x083f('0x1a'));var db=require(_0x083f('0x1b'))['db'];config['redis']=_['defaults'](config[_0x083f('0x1c')],{'host':_0x083f('0x1d'),'port':0x18eb});var socket=require(_0x083f('0x1e'))(new Redis(config[_0x083f('0x1c')]));require(_0x083f('0x1f'))[_0x083f('0x20')](socket);var jayson=require(_0x083f('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x083f('0x22')][_0x083f('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5375e4,_0xde980a,_0x5d757a,_0x56118d){return new BPromise(function(_0x3371f0,_0xc47aef){var _0x4b597e=_0x56118d||client;return _0x4b597e[_0x083f('0x24')](_0x5375e4,_0x5d757a)[_0x083f('0x25')](function(_0x1816dc){logger['info'](_0x083f('0x26'),_0xde980a,_0x083f('0x27'));logger[_0x083f('0x28')](_0x083f('0x29'),_0xde980a,_0x083f('0x27'),JSON[_0x083f('0x2a')](_0x1816dc));if(_0x1816dc[_0x083f('0x2b')]){if(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2c')]===0x1f4){logger[_0x083f('0x2b')](_0x083f('0x26'),_0xde980a,_0x1816dc['error'][_0x083f('0x2d')]);return _0xc47aef(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2d')]);}logger[_0x083f('0x2b')](_0x083f('0x26'),_0xde980a,_0x1816dc['error'][_0x083f('0x2d')]);return _0x3371f0(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2d')]);}else{logger[_0x083f('0x2e')]('ChatMessage,\x20%s,\x20%s',_0xde980a,_0x083f('0x27'));_0x3371f0(_0x1816dc[_0x083f('0x2f')][_0x083f('0x2d')]);}})[_0x083f('0x30')](function(_0x4812f0){logger[_0x083f('0x2b')]('ChatMessage,\x20%s,\x20%s',_0xde980a,_0x4812f0);_0xc47aef(_0x4812f0);});});}function respondWithStatusCode(_0x11f6d3,_0xa2bfe0){_0xa2bfe0=_0xa2bfe0||0xcc;return function(_0x379247){if(_0x379247){return _0x11f6d3[_0x083f('0x31')](_0xa2bfe0);}return _0x11f6d3['status'](_0xa2bfe0)[_0x083f('0x32')]();};}function respondWithResult(_0x5bddb6,_0x3973ad){_0x3973ad=_0x3973ad||0xc8;return function(_0x5475c5){if(_0x5475c5){return _0x5bddb6[_0x083f('0x33')](_0x3973ad)[_0x083f('0x34')](_0x5475c5);}};}function respondWithFilteredResult(_0x200886,_0x172f1d){return function(_0x4a93c7){if(_0x4a93c7){var _0x19409b=typeof _0x172f1d[_0x083f('0x35')]===_0x083f('0x36')&&typeof _0x172f1d['limit']===_0x083f('0x36');var _0x162bb4=_0x4a93c7['count'];var _0x319954=_0x19409b?0x0:_0x172f1d[_0x083f('0x35')];var _0x355eb4=_0x19409b?_0x4a93c7[_0x083f('0x37')]:_0x172f1d[_0x083f('0x35')]+_0x172f1d[_0x083f('0x38')];var _0x4a4535;if(_0x355eb4>=_0x162bb4){_0x355eb4=_0x162bb4;_0x4a4535=0xc8;}else{_0x4a4535=0xce;}_0x200886['status'](_0x4a4535);return _0x200886['set']('Content-Range',_0x319954+'-'+_0x355eb4+'/'+_0x162bb4)[_0x083f('0x34')](_0x4a93c7);}return null;};}function patchUpdates(_0x1472b2){return function(_0x1f2c9f){try{jsonpatch[_0x083f('0x39')](_0x1f2c9f,_0x1472b2,!![]);}catch(_0x4dfc3c){return BPromise[_0x083f('0x3a')](_0x4dfc3c);}return _0x1f2c9f[_0x083f('0x3b')]();};}function saveUpdates(_0x1e0902,_0x4af0f8){return function(_0x142854){if(_0x142854){return _0x142854[_0x083f('0x3c')](_0x1e0902)[_0x083f('0x25')](function(_0x228408){return _0x228408;});}return null;};}function removeEntity(_0x2dcf45,_0x59634b){return function(_0x1f5c92){if(_0x1f5c92){return _0x1f5c92[_0x083f('0x3d')]()[_0x083f('0x25')](function(){_0x2dcf45[_0x083f('0x33')](0xcc)[_0x083f('0x32')]();});}};}function handleEntityNotFound(_0x52cf65,_0x9820a3){return function(_0x27ef51){if(!_0x27ef51){_0x52cf65[_0x083f('0x31')](0x194);}return _0x27ef51;};}function handleError(_0xf2a10f,_0x4a79b6){_0x4a79b6=_0x4a79b6||0x1f4;return function(_0x2a1bde){logger['error'](_0x2a1bde[_0x083f('0x3e')]);if(_0x2a1bde[_0x083f('0x3f')]){delete _0x2a1bde[_0x083f('0x3f')];}_0xf2a10f['status'](_0x4a79b6)[_0x083f('0x40')](_0x2a1bde);};}exports['index']=function(_0x22e2c3,_0x117db5){var _0x199595={},_0x7e1941={},_0x46a6d3={'count':0x0,'rows':[]};var _0x265790=_[_0x083f('0x41')](db[_0x083f('0x42')][_0x083f('0x43')],function(_0x5cf33e){return{'name':_0x5cf33e[_0x083f('0x44')],'type':_0x5cf33e['type'][_0x083f('0x45')]};});_0x7e1941[_0x083f('0x46')]=_[_0x083f('0x41')](_0x265790,_0x083f('0x3f'));_0x7e1941['query']=_['keys'](_0x22e2c3['query']);_0x7e1941['filters']=_[_0x083f('0x47')](_0x7e1941[_0x083f('0x46')],_0x7e1941[_0x083f('0x48')]);_0x199595[_0x083f('0x49')]=_[_0x083f('0x47')](_0x7e1941[_0x083f('0x46')],qs['fields'](_0x22e2c3[_0x083f('0x48')][_0x083f('0x4a')]));_0x199595[_0x083f('0x49')]=_0x199595['attributes']['length']?_0x199595['attributes']:_0x7e1941['model'];if(!_0x22e2c3[_0x083f('0x48')][_0x083f('0x4b')](_0x083f('0x4c'))){_0x199595[_0x083f('0x38')]=qs[_0x083f('0x38')](_0x22e2c3['query'][_0x083f('0x38')]);_0x199595['offset']=qs[_0x083f('0x35')](_0x22e2c3[_0x083f('0x48')][_0x083f('0x35')]);}_0x199595[_0x083f('0x4d')]=qs[_0x083f('0x4e')](_0x22e2c3['query'][_0x083f('0x4e')]);_0x199595['where']=qs[_0x083f('0x4f')](_[_0x083f('0x50')](_0x22e2c3[_0x083f('0x48')],_0x7e1941['filters']),_0x265790);if(_0x22e2c3['query']['filter']){_0x199595[_0x083f('0x51')]=_[_0x083f('0x52')](_0x199595[_0x083f('0x51')],{'$or':_[_0x083f('0x41')](_0x265790,function(_0x585b8b){if(_0x585b8b['type']!=='VIRTUAL'){var _0x4d9079={};_0x4d9079[_0x585b8b[_0x083f('0x3f')]]={'$like':'%'+_0x22e2c3[_0x083f('0x48')][_0x083f('0x53')]+'%'};return _0x4d9079;}})});}_0x199595=_['merge']({},_0x199595,_0x22e2c3[_0x083f('0x54')]);var _0x3bf87d={'where':_0x199595[_0x083f('0x51')]};return db[_0x083f('0x42')][_0x083f('0x37')](_0x3bf87d)[_0x083f('0x25')](function(_0x48c268){_0x46a6d3[_0x083f('0x37')]=_0x48c268;if(_0x22e2c3['query']['includeAll']){_0x199595[_0x083f('0x55')]=[{'all':!![]}];}return db[_0x083f('0x42')][_0x083f('0x56')](_0x199595);})[_0x083f('0x25')](function(_0x17fbe3){_0x46a6d3[_0x083f('0x57')]=_0x17fbe3;return _0x46a6d3;})['then'](respondWithFilteredResult(_0x117db5,_0x199595))[_0x083f('0x30')](handleError(_0x117db5,null));};exports[_0x083f('0x58')]=function(_0x7a6b1e,_0x22730e){var _0x569304={'raw':!![],'where':{'id':_0x7a6b1e[_0x083f('0x59')]['id']}},_0x3ecd11={};_0x3ecd11[_0x083f('0x46')]=_[_0x083f('0x5a')](db[_0x083f('0x42')][_0x083f('0x43')]);_0x3ecd11[_0x083f('0x48')]=_[_0x083f('0x5a')](_0x7a6b1e['query']);_0x3ecd11[_0x083f('0x4f')]=_[_0x083f('0x47')](_0x3ecd11['model'],_0x3ecd11['query']);_0x569304['attributes']=_[_0x083f('0x47')](_0x3ecd11[_0x083f('0x46')],qs[_0x083f('0x4a')](_0x7a6b1e['query'][_0x083f('0x4a')]));_0x569304[_0x083f('0x49')]=_0x569304[_0x083f('0x49')][_0x083f('0x5b')]?_0x569304[_0x083f('0x49')]:_0x3ecd11[_0x083f('0x46')];if(_0x7a6b1e['query'][_0x083f('0x5c')]){_0x569304[_0x083f('0x55')]=[{'all':!![]}];}_0x569304=_['merge']({},_0x569304,_0x7a6b1e['options']);return db[_0x083f('0x42')]['find'](_0x569304)['then'](handleEntityNotFound(_0x22730e,null))['then'](respondWithResult(_0x22730e,null))['catch'](handleError(_0x22730e,null));};exports[_0x083f('0x5d')]=function(_0x33ffbd,_0xf9663c){return db[_0x083f('0x42')][_0x083f('0x5d')](_0x33ffbd['body'],{})[_0x083f('0x25')](respondWithResult(_0xf9663c,0xc9))[_0x083f('0x30')](handleError(_0xf9663c,null));};exports[_0x083f('0x3c')]=function(_0xeccc51,_0x583c33){if(_0xeccc51[_0x083f('0x5e')]['id']){delete _0xeccc51['body']['id'];}return db[_0x083f('0x42')][_0x083f('0x5f')]({'where':{'id':_0xeccc51[_0x083f('0x59')]['id']}})['then'](handleEntityNotFound(_0x583c33,null))[_0x083f('0x25')](saveUpdates(_0xeccc51[_0x083f('0x5e')],null))[_0x083f('0x25')](respondWithResult(_0x583c33,null))[_0x083f('0x30')](handleError(_0x583c33,null));};exports[_0x083f('0x3d')]=function(_0x53e06c,_0x3fa58b){return db['ChatMessage'][_0x083f('0x5f')]({'where':{'id':_0x53e06c['params']['id']}})[_0x083f('0x25')](handleEntityNotFound(_0x3fa58b,null))[_0x083f('0x25')](removeEntity(_0x3fa58b,null))[_0x083f('0x30')](handleError(_0x3fa58b,null));};exports[_0x083f('0x60')]=function(_0x954329,_0x5e34ed){return db[_0x083f('0x42')]['describe']()[_0x083f('0x25')](respondWithResult(_0x5e34ed,null))[_0x083f('0x30')](handleError(_0x5e34ed,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x083f('0x61')]=function(_0x2a4693,_0xf88a59,_0x33b7a1){var _0x567519={'agent':{},'channel':_0x083f('0x62')};if(_0x2a4693[_0x083f('0x5e')]['id']){delete _0x2a4693[_0x083f('0x5e')]['id'];}_0x2a4693['body'][_0x083f('0x63')]=!![];_0x2a4693['body'][_0x083f('0x64')]=moment()[_0x083f('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')]=_0x2a4693['body'][_0x083f('0x66')]||_0x2a4693['user']['id'];_0x567519[_0x083f('0x67')]['id']=_0x2a4693['body']['UserId'];return db[_0x083f('0x42')]['find']({'where':{'id':_0x2a4693[_0x083f('0x59')]['id'],'UserId':null}})[_0x083f('0x25')](handleEntityNotFound(_0xf88a59,null))[_0x083f('0x25')](saveUpdates(_0x2a4693['body'],null))[_0x083f('0x25')](function(_0x24f5d7){if(_0x24f5d7){_0x567519[_0x083f('0x2d')]=_0x24f5d7[_0x083f('0x68')]({'plain':!![]});return db[_0x083f('0x69')][_0x083f('0x5f')]({'where':{'id':_0x24f5d7['ChatInteractionId']}});}return null;})[_0x083f('0x25')](handleEntityNotFound(_0xf88a59,null))[_0x083f('0x25')](function(_0x129fd3){if(_0x129fd3){return _0x129fd3['update']({'UserId':_0x2a4693['body'][_0x083f('0x66')],'read1stAt':_[_0x083f('0x6a')](_0x129fd3['read1stAt'])?moment()[_0x083f('0x65')](_0x083f('0x6b')):undefined});}return null;})['then'](function(_0x515fbc){if(_0x515fbc){_0x567519[_0x083f('0x6c')]=_0x515fbc[_0x083f('0x68')]({'plain':!![]});interaction_log['info'](_0x083f('0x6d'),_0x2a4693[_0x083f('0x6e')]['id'],_0x2a4693['user'][_0x083f('0x3f')],_0x2a4693[_0x083f('0x6e')][_0x083f('0x6f')],_0x567519[_0x083f('0x6c')]['id'],_0x2a4693[_0x083f('0x5e')]?JSON[_0x083f('0x2a')](_0x2a4693[_0x083f('0x5e')]):_0x083f('0x70'));return respondWithRpcPromise(_0x083f('0x71'),_0x083f('0x72'),_0x567519);}return null;})[_0x083f('0x25')](function(_0xaf30ad){var _0x14e8f8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xaf30ad[_0x083f('0x2d')]['ContactId'];return db[_0x083f('0x73')]['query'](_0x14e8f8,{'type':db[_0x083f('0x74')][_0x083f('0x75')][_0x083f('0x76')],'raw':!![]})[_0x083f('0x25')](function(_0x978091){return _0x978091;});})[_0x083f('0x25')](function(_0x337c8a){if(_0x337c8a){_0x567519['message'][_0x083f('0x77')]=_0x337c8a[0x0];if(!_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')])return;return db[_0x083f('0x78')][_0x083f('0x5f')]({'where':{'id':_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')],'role':_0x083f('0x67')},'attributes':['id',_0x083f('0x3f'),'fullname','email',_0x083f('0x79')],'raw':!![]});}return null;})[_0x083f('0x25')](function(_0xe33f8c){if(!_0xe33f8c)return null;_0x567519[_0x083f('0x2d')][_0x083f('0x67')]=_0xe33f8c;return _0x567519;})[_0x083f('0x25')](function(_0x38534f){if(_0x38534f){if(_0x2a4693[_0x083f('0x5e')]['manual']){_0x567519['message'][_0x083f('0x7a')]=util['format'](_0x083f('0x7b'),_0x2a4693[_0x083f('0x6e')][_0x083f('0x3f')]);_0x567519[_0x083f('0x2d')][_0x083f('0x7c')]=_0x567519[_0x083f('0x7c')];_0x567519[_0x083f('0x2d')][_0x083f('0x7d')]=_0x567519[_0x083f('0x7c')];_0x567519[_0x083f('0x2d')][_0x083f('0x7e')]=_0x083f('0x61');return respondWithRpcPromise(_0x083f('0x7f'),'EventManager',{'event':_0x083f('0x80'),'message':_['merge'](_0x567519[_0x083f('0x2d')],JSON[_0x083f('0x81')](_0x567519['interaction'][_0x083f('0x82')]))},client9002)['then'](function(){return _0x567519;});}return _0x567519;}return null;})[_0x083f('0x25')](respondWithResult(_0xf88a59,null))[_0x083f('0x30')](handleError(_0xf88a59,null));};var interaction_log=require(_0x083f('0x16'))('chat-interactions');exports[_0x083f('0x3a')]=function(_0x4c8957,_0x32725e,_0x22a6ad){var _0xffb386={'agent':{},'channel':_0x083f('0x62')};if(_0x4c8957['body']['id']){delete _0x4c8957[_0x083f('0x5e')]['id'];}_0x4c8957['body'][_0x083f('0x66')]=_0x4c8957['body'][_0x083f('0x66')]||_0x4c8957['user']['id'];_0xffb386['agent']['id']=_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')];return db[_0x083f('0x42')][_0x083f('0x5f')]({'where':{'id':_0x4c8957[_0x083f('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32725e,null))[_0x083f('0x25')](function(_0x33aabe){if(_0x33aabe){_0xffb386[_0x083f('0x2d')]=_0x33aabe[_0x083f('0x68')]({'plain':!![]});return db[_0x083f('0x69')][_0x083f('0x5f')]({'where':{'id':_0x33aabe[_0x083f('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x32725e,null))[_0x083f('0x25')](function(_0x580499){if(_0x580499){_0xffb386[_0x083f('0x6c')]=_0x580499[_0x083f('0x68')]({'plain':!![]});interaction_log[_0x083f('0x2e')](_0x083f('0x84'),_0x4c8957[_0x083f('0x6e')]['id'],_0x4c8957[_0x083f('0x6e')][_0x083f('0x3f')],_0x4c8957['user'][_0x083f('0x6f')],_0xffb386[_0x083f('0x6c')]['id'],_0x4c8957['body']?JSON[_0x083f('0x2a')](_0x4c8957[_0x083f('0x5e')]):_0x083f('0x70'));return respondWithRpcPromise(_0x083f('0x85'),'rejectMessage',_0xffb386);}return null;})[_0x083f('0x25')](function(_0x406646){var _0x5ae848='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x406646[_0x083f('0x2d')][_0x083f('0x86')];return db[_0x083f('0x73')][_0x083f('0x48')](_0x5ae848,{'type':db[_0x083f('0x74')][_0x083f('0x75')][_0x083f('0x76')],'raw':!![]})[_0x083f('0x25')](function(_0x621d21){return _0x621d21;});})[_0x083f('0x25')](function(_0x1fc3c8){if(_0x1fc3c8){_0xffb386[_0x083f('0x2d')][_0x083f('0x77')]=_0x1fc3c8[0x0];if(!_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')])return;return db[_0x083f('0x78')][_0x083f('0x5f')]({'where':{'id':_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')],'role':_0x083f('0x67')},'attributes':['id',_0x083f('0x3f'),_0x083f('0x87'),_0x083f('0x88'),_0x083f('0x79')],'raw':!![]});}return null;})['then'](function(_0x376515){if(!_0x376515)return null;_0xffb386[_0x083f('0x2d')][_0x083f('0x67')]=_0x376515;return _0xffb386;})['then'](function(_0xf21f47){if(_0xf21f47){_0xf21f47['message'][_0x083f('0x7a')]=util[_0x083f('0x65')](_0x083f('0x7b'),_0x4c8957[_0x083f('0x6e')][_0x083f('0x3f')]);_0xf21f47[_0x083f('0x2d')][_0x083f('0x7c')]=_0xffb386[_0x083f('0x7c')];_0xf21f47[_0x083f('0x2d')][_0x083f('0x7d')]=_0xffb386[_0x083f('0x7c')];_0xf21f47[_0x083f('0x2d')][_0x083f('0x7e')]=_0x083f('0x3a');respondWithRpcPromise(_0x083f('0x7f'),_0x083f('0x7f'),{'event':_0x083f('0x89'),'message':_['merge'](_0xffb386[_0x083f('0x2d')],JSON[_0x083f('0x81')](_0xffb386[_0x083f('0x6c')][_0x083f('0x82')]))},client9002);return _0xffb386;}return null;})[_0x083f('0x25')](respondWithResult(_0x32725e,null))[_0x083f('0x30')](handleError(_0x32725e,null));}; \ No newline at end of file +var _0x54b4=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','../../config/logger','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','RejectMessage','rejectMessage','reject','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','save','then','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x12e634,_0x452df4){var _0x19e23d=function(_0x24cdcd){while(--_0x24cdcd){_0x12e634['push'](_0x12e634['shift']());}};_0x19e23d(++_0x452df4);}(_0x54b4,0xc9));var _0x454b=function(_0x23a1b5,_0x57f4cb){_0x23a1b5=_0x23a1b5-0x0;var _0x34e70b=_0x54b4[_0x23a1b5];return _0x34e70b;};'use strict';var emlformat=require(_0x454b('0x0'));var rimraf=require(_0x454b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x454b('0x2'));var rp=require(_0x454b('0x3'));var moment=require('moment');var BPromise=require(_0x454b('0x4'));var Mustache=require(_0x454b('0x5'));var util=require(_0x454b('0x6'));var path=require(_0x454b('0x7'));var sox=require(_0x454b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x454b('0x9'));var _=require('lodash');var squel=require(_0x454b('0xa'));var crypto=require(_0x454b('0xb'));var jsforce=require(_0x454b('0xc'));var deskjs=require(_0x454b('0xd'));var toCsv=require(_0x454b('0xe'));var querystring=require(_0x454b('0xf'));var Papa=require('papaparse');var Redis=require(_0x454b('0x10'));var authService=require(_0x454b('0x11'));var qs=require(_0x454b('0x12'));var as=require(_0x454b('0x13'));var hardwareService=require(_0x454b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x454b('0x15'));var config=require(_0x454b('0x16'));var licenseUtil=require(_0x454b('0x17'));var db=require(_0x454b('0x18'))['db'];config['redis']=_[_0x454b('0x19')](config[_0x454b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x454b('0x1b'))(new Redis(config['redis']));require(_0x454b('0x1c'))['register'](socket);var jayson=require(_0x454b('0x1d'));var client=jayson[_0x454b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x454b('0x1e')][_0x454b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x8bea2f,_0x2914c2,_0x31788e,_0x14d1ab){return new BPromise(function(_0x12cd47,_0x44f748){var _0x23134=_0x14d1ab||client;return _0x23134[_0x454b('0x20')](_0x8bea2f,_0x31788e)['then'](function(_0x53a316){logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));logger[_0x454b('0x23')](_0x454b('0x24'),_0x2914c2,'request\x20sent',JSON[_0x454b('0x25')](_0x53a316));if(_0x53a316['error']){if(_0x53a316[_0x454b('0x26')][_0x454b('0x27')]===0x1f4){logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316[_0x454b('0x26')]['message']);return _0x44f748(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316['error'][_0x454b('0x29')]);return _0x12cd47(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}else{logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));_0x12cd47(_0x53a316[_0x454b('0x2a')]['message']);}})[_0x454b('0x2b')](function(_0x5d2c09){logger[_0x454b('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x5d2c09);_0x44f748(_0x5d2c09);});});}function respondWithStatusCode(_0x4cd0fb,_0x54c38e){_0x54c38e=_0x54c38e||0xcc;return function(_0x4f1458){if(_0x4f1458){return _0x4cd0fb[_0x454b('0x2c')](_0x54c38e);}return _0x4cd0fb['status'](_0x54c38e)[_0x454b('0x2d')]();};}function respondWithResult(_0x474a69,_0x5c100b){_0x5c100b=_0x5c100b||0xc8;return function(_0xd2b082){if(_0xd2b082){return _0x474a69[_0x454b('0x2e')](_0x5c100b)[_0x454b('0x2f')](_0xd2b082);}};}function respondWithFilteredResult(_0x2f0ed8,_0x1eb774){return function(_0x5bda90){if(_0x5bda90){var _0x3f7e8a=typeof _0x1eb774[_0x454b('0x30')]==='undefined'&&typeof _0x1eb774[_0x454b('0x31')]===_0x454b('0x32');var _0x4147f3=_0x5bda90['count'];var _0x3ff96d=_0x3f7e8a?0x0:_0x1eb774[_0x454b('0x30')];var _0x1685b9=_0x3f7e8a?_0x5bda90['count']:_0x1eb774[_0x454b('0x30')]+_0x1eb774[_0x454b('0x31')];var _0x428f39;if(_0x1685b9>=_0x4147f3){_0x1685b9=_0x4147f3;_0x428f39=0xc8;}else{_0x428f39=0xce;}_0x2f0ed8[_0x454b('0x2e')](_0x428f39);return _0x2f0ed8[_0x454b('0x33')](_0x454b('0x34'),_0x3ff96d+'-'+_0x1685b9+'/'+_0x4147f3)[_0x454b('0x2f')](_0x5bda90);}return null;};}function patchUpdates(_0x20f73f){return function(_0x4e9678){try{jsonpatch[_0x454b('0x35')](_0x4e9678,_0x20f73f,!![]);}catch(_0x29b76c){return BPromise['reject'](_0x29b76c);}return _0x4e9678[_0x454b('0x36')]();};}function saveUpdates(_0x57da73,_0x480280){return function(_0x4a6b41){if(_0x4a6b41){return _0x4a6b41['update'](_0x57da73)[_0x454b('0x37')](function(_0x17f914){return _0x17f914;});}return null;};}function removeEntity(_0x4c9413,_0x56907e){return function(_0x7acfa7){if(_0x7acfa7){return _0x7acfa7['destroy']()['then'](function(){_0x4c9413['status'](0xcc)[_0x454b('0x2d')]();});}};}function handleEntityNotFound(_0x662a09,_0x52d453){return function(_0x495ab0){if(!_0x495ab0){_0x662a09['sendStatus'](0x194);}return _0x495ab0;};}function handleError(_0x5b6238,_0x4186fb){_0x4186fb=_0x4186fb||0x1f4;return function(_0x250ef4){logger[_0x454b('0x26')](_0x250ef4[_0x454b('0x38')]);if(_0x250ef4[_0x454b('0x39')]){delete _0x250ef4[_0x454b('0x39')];}_0x5b6238[_0x454b('0x2e')](_0x4186fb)[_0x454b('0x3a')](_0x250ef4);};}exports[_0x454b('0x3b')]=function(_0x3e533a,_0x41c317){var _0x323e0f={},_0x5dfbcd={},_0x51c85b={'count':0x0,'rows':[]};var _0x2d2980=_[_0x454b('0x3c')](db[_0x454b('0x3d')][_0x454b('0x3e')],function(_0x5d03a4){return{'name':_0x5d03a4['fieldName'],'type':_0x5d03a4[_0x454b('0x3f')][_0x454b('0x40')]};});_0x5dfbcd[_0x454b('0x41')]=_[_0x454b('0x3c')](_0x2d2980,_0x454b('0x39'));_0x5dfbcd[_0x454b('0x42')]=_[_0x454b('0x43')](_0x3e533a[_0x454b('0x42')]);_0x5dfbcd[_0x454b('0x44')]=_[_0x454b('0x45')](_0x5dfbcd['model'],_0x5dfbcd[_0x454b('0x42')]);_0x323e0f[_0x454b('0x46')]=_[_0x454b('0x45')](_0x5dfbcd[_0x454b('0x41')],qs[_0x454b('0x47')](_0x3e533a[_0x454b('0x42')]['fields']));_0x323e0f[_0x454b('0x46')]=_0x323e0f['attributes'][_0x454b('0x48')]?_0x323e0f[_0x454b('0x46')]:_0x5dfbcd[_0x454b('0x41')];if(!_0x3e533a['query']['hasOwnProperty'](_0x454b('0x49'))){_0x323e0f['limit']=qs[_0x454b('0x31')](_0x3e533a[_0x454b('0x42')][_0x454b('0x31')]);_0x323e0f[_0x454b('0x30')]=qs['offset'](_0x3e533a[_0x454b('0x42')][_0x454b('0x30')]);}_0x323e0f[_0x454b('0x4a')]=qs[_0x454b('0x4b')](_0x3e533a[_0x454b('0x42')][_0x454b('0x4b')]);_0x323e0f[_0x454b('0x4c')]=qs[_0x454b('0x44')](_[_0x454b('0x4d')](_0x3e533a[_0x454b('0x42')],_0x5dfbcd[_0x454b('0x44')]),_0x2d2980);if(_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]){_0x323e0f[_0x454b('0x4c')]=_[_0x454b('0x4f')](_0x323e0f[_0x454b('0x4c')],{'$or':_[_0x454b('0x3c')](_0x2d2980,function(_0x1a6740){if(_0x1a6740[_0x454b('0x3f')]!==_0x454b('0x50')){var _0x5d5490={};_0x5d5490[_0x1a6740[_0x454b('0x39')]]={'$like':'%'+_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]+'%'};return _0x5d5490;}})});}_0x323e0f=_[_0x454b('0x4f')]({},_0x323e0f,_0x3e533a[_0x454b('0x51')]);var _0x55ad74={'where':_0x323e0f['where']};return db['ChatMessage'][_0x454b('0x52')](_0x55ad74)[_0x454b('0x37')](function(_0x1bf3e6){_0x51c85b[_0x454b('0x52')]=_0x1bf3e6;if(_0x3e533a[_0x454b('0x42')][_0x454b('0x53')]){_0x323e0f[_0x454b('0x54')]=[{'all':!![]}];}return db['ChatMessage'][_0x454b('0x55')](_0x323e0f);})[_0x454b('0x37')](function(_0x313c1a){_0x51c85b[_0x454b('0x56')]=_0x313c1a;return _0x51c85b;})[_0x454b('0x37')](respondWithFilteredResult(_0x41c317,_0x323e0f))['catch'](handleError(_0x41c317,null));};exports[_0x454b('0x57')]=function(_0x31a844,_0x3d44a7){var _0xc5c195={'raw':!![],'where':{'id':_0x31a844[_0x454b('0x58')]['id']}},_0x32fd63={};_0x32fd63['model']=_[_0x454b('0x43')](db[_0x454b('0x3d')][_0x454b('0x3e')]);_0x32fd63[_0x454b('0x42')]=_['keys'](_0x31a844[_0x454b('0x42')]);_0x32fd63[_0x454b('0x44')]=_[_0x454b('0x45')](_0x32fd63['model'],_0x32fd63[_0x454b('0x42')]);_0xc5c195[_0x454b('0x46')]=_[_0x454b('0x45')](_0x32fd63[_0x454b('0x41')],qs[_0x454b('0x47')](_0x31a844[_0x454b('0x42')][_0x454b('0x47')]));_0xc5c195['attributes']=_0xc5c195[_0x454b('0x46')]['length']?_0xc5c195[_0x454b('0x46')]:_0x32fd63[_0x454b('0x41')];if(_0x31a844[_0x454b('0x42')][_0x454b('0x53')]){_0xc5c195['include']=[{'all':!![]}];}_0xc5c195=_[_0x454b('0x4f')]({},_0xc5c195,_0x31a844[_0x454b('0x51')]);return db[_0x454b('0x3d')][_0x454b('0x59')](_0xc5c195)['then'](handleEntityNotFound(_0x3d44a7,null))['then'](respondWithResult(_0x3d44a7,null))[_0x454b('0x2b')](handleError(_0x3d44a7,null));};exports[_0x454b('0x5a')]=function(_0x2e5cc0,_0x19ef79){return db[_0x454b('0x3d')][_0x454b('0x5a')](_0x2e5cc0[_0x454b('0x5b')],{})[_0x454b('0x37')](respondWithResult(_0x19ef79,0xc9))[_0x454b('0x2b')](handleError(_0x19ef79,null));};exports[_0x454b('0x5c')]=function(_0x190e48,_0x40e788){if(_0x190e48['body']['id']){delete _0x190e48[_0x454b('0x5b')]['id'];}return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x190e48['params']['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x40e788,null))['then'](saveUpdates(_0x190e48[_0x454b('0x5b')],null))[_0x454b('0x37')](respondWithResult(_0x40e788,null))['catch'](handleError(_0x40e788,null));};exports[_0x454b('0x5d')]=function(_0x1764a6,_0x4e8bef){return db[_0x454b('0x3d')][_0x454b('0x59')]({'where':{'id':_0x1764a6[_0x454b('0x58')]['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x4e8bef,null))['then'](removeEntity(_0x4e8bef,null))[_0x454b('0x2b')](handleError(_0x4e8bef,null));};exports[_0x454b('0x5e')]=function(_0x262c35,_0x445981){return db[_0x454b('0x3d')]['describe']()['then'](respondWithResult(_0x445981,null))['catch'](handleError(_0x445981,null));};var interaction_log=require(_0x454b('0x5f'))(_0x454b('0x60'));exports[_0x454b('0x61')]=function(_0x14ef9e,_0x304082,_0x4f08d0){var _0x4bdad3={'agent':{},'channel':'chat'};if(_0x14ef9e[_0x454b('0x5b')]['id']){delete _0x14ef9e['body']['id'];}_0x14ef9e[_0x454b('0x5b')]['read']=!![];_0x14ef9e['body'][_0x454b('0x62')]=moment()['format'](_0x454b('0x63'));_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]=_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]||_0x14ef9e[_0x454b('0x65')]['id'];_0x4bdad3['agent']['id']=_0x14ef9e[_0x454b('0x5b')]['UserId'];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](saveUpdates(_0x14ef9e[_0x454b('0x5b')],null))[_0x454b('0x37')](function(_0x93857c){if(_0x93857c){_0x4bdad3['message']=_0x93857c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x93857c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](function(_0x37d2a9){if(_0x37d2a9){return _0x37d2a9[_0x454b('0x5c')]({'UserId':_0x14ef9e['body'][_0x454b('0x64')],'read1stAt':_[_0x454b('0x69')](_0x37d2a9[_0x454b('0x6a')])?moment()[_0x454b('0x6b')](_0x454b('0x63')):undefined});}return null;})[_0x454b('0x37')](function(_0x44199f){if(_0x44199f){_0x4bdad3[_0x454b('0x6c')]=_0x44199f['get']({'plain':!![]});interaction_log['info'](_0x454b('0x6d'),_0x14ef9e[_0x454b('0x65')]['id'],_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')],_0x14ef9e[_0x454b('0x65')][_0x454b('0x6e')],_0x4bdad3[_0x454b('0x6c')]['id'],_0x14ef9e[_0x454b('0x5b')]?JSON[_0x454b('0x25')](_0x14ef9e[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x454b('0x70'),_0x4bdad3);}return null;})[_0x454b('0x37')](function(_0x181e36){var _0x3db2b0=_0x454b('0x71')+_0x181e36[_0x454b('0x29')][_0x454b('0x72')];return db[_0x454b('0x73')]['query'](_0x3db2b0,{'type':db[_0x454b('0x74')][_0x454b('0x75')][_0x454b('0x76')],'raw':!![]})[_0x454b('0x37')](function(_0x1d6be3){return _0x1d6be3;});})['then'](function(_0x34c651){if(_0x34c651){_0x4bdad3[_0x454b('0x29')][_0x454b('0x77')]=_0x34c651[0x0];if(!_0x14ef9e[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')],'role':_0x454b('0x79')},'attributes':['id',_0x454b('0x39'),_0x454b('0x7a'),_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0x179cb8){if(!_0x179cb8)return null;_0x4bdad3[_0x454b('0x29')][_0x454b('0x79')]=_0x179cb8;return _0x4bdad3;})[_0x454b('0x37')](function(_0x5c54ae){if(_0x5c54ae){if(_0x14ef9e[_0x454b('0x5b')]['manual']){_0x4bdad3[_0x454b('0x29')][_0x454b('0x7d')]=util['format'](_0x454b('0x7e'),_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')]);_0x4bdad3['message']['channel']=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3['message'][_0x454b('0x80')]=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3[_0x454b('0x29')][_0x454b('0x81')]=_0x454b('0x61');return respondWithRpcPromise(_0x454b('0x82'),_0x454b('0x82'),{'event':_0x454b('0x83'),'message':_[_0x454b('0x4f')](_0x4bdad3[_0x454b('0x29')],JSON['parse'](_0x4bdad3[_0x454b('0x6c')][_0x454b('0x84')]))},client9002)[_0x454b('0x37')](function(){return _0x4bdad3;});}return _0x4bdad3;}return null;})['then'](respondWithResult(_0x304082,null))[_0x454b('0x2b')](handleError(_0x304082,null));};var interaction_log=require('../../config/logger')(_0x454b('0x60'));exports['reject']=function(_0x5a9b65,_0xd0bdbb,_0x1a90be){var _0x1b5ca8={'agent':{},'channel':_0x454b('0x85')};if(_0x5a9b65[_0x454b('0x5b')]['id']){delete _0x5a9b65[_0x454b('0x5b')]['id'];}_0x5a9b65[_0x454b('0x5b')][_0x454b('0x64')]=_0x5a9b65['body'][_0x454b('0x64')]||_0x5a9b65[_0x454b('0x65')]['id'];_0x1b5ca8[_0x454b('0x79')]['id']=_0x5a9b65['body'][_0x454b('0x64')];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x4a858c){if(_0x4a858c){_0x1b5ca8[_0x454b('0x29')]=_0x4a858c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x4a858c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x5a4c9d){if(_0x5a4c9d){_0x1b5ca8[_0x454b('0x6c')]=_0x5a4c9d[_0x454b('0x66')]({'plain':!![]});interaction_log[_0x454b('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a9b65['user']['id'],_0x5a9b65[_0x454b('0x65')][_0x454b('0x39')],_0x5a9b65[_0x454b('0x65')][_0x454b('0x6e')],_0x1b5ca8[_0x454b('0x6c')]['id'],_0x5a9b65['body']?JSON['stringify'](_0x5a9b65[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise(_0x454b('0x86'),_0x454b('0x87'),_0x1b5ca8);}return null;})[_0x454b('0x37')](function(_0x59527c){var _0x4858e8=_0x454b('0x71')+_0x59527c[_0x454b('0x29')]['ContactId'];return db[_0x454b('0x73')][_0x454b('0x42')](_0x4858e8,{'type':db[_0x454b('0x74')][_0x454b('0x75')]['SELECT'],'raw':!![]})[_0x454b('0x37')](function(_0x51f7e8){return _0x51f7e8;});})[_0x454b('0x37')](function(_0x5beb6f){if(_0x5beb6f){_0x1b5ca8[_0x454b('0x29')][_0x454b('0x77')]=_0x5beb6f[0x0];if(!_0x5a9b65[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x454b('0x39'),'fullname',_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0xa9e1e){if(!_0xa9e1e)return null;_0x1b5ca8['message'][_0x454b('0x79')]=_0xa9e1e;return _0x1b5ca8;})[_0x454b('0x37')](function(_0x4140c4){if(_0x4140c4){_0x4140c4[_0x454b('0x29')][_0x454b('0x7d')]=util[_0x454b('0x6b')](_0x454b('0x7e'),_0x5a9b65[_0x454b('0x65')]['name']);_0x4140c4[_0x454b('0x29')][_0x454b('0x7f')]=_0x1b5ca8['channel'];_0x4140c4['message'][_0x454b('0x80')]=_0x1b5ca8[_0x454b('0x7f')];_0x4140c4[_0x454b('0x29')]['event']=_0x454b('0x88');respondWithRpcPromise('EventManager','EventManager',{'event':_0x454b('0x89'),'message':_['merge'](_0x1b5ca8[_0x454b('0x29')],JSON['parse'](_0x1b5ca8['interaction'][_0x454b('0x84')]))},client9002);return _0x1b5ca8;}return null;})[_0x454b('0x37')](respondWithResult(_0xd0bdbb,null))[_0x454b('0x2b')](handleError(_0xd0bdbb,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 29b0c21..01d6875 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 _0xd47e=['hook','exports','events','ChatMessage','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0xd47e,0x134));var _0xed47=function(_0x464e93,_0x3f5e20){_0x464e93=_0x464e93-0x0;var _0x18e264=_0xd47e[_0x464e93];return _0x18e264;};'use strict';var EventEmitter=require(_0xed47('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xed47('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed47('0x2')](0x0);var events={'afterCreate':_0xed47('0x3'),'afterUpdate':_0xed47('0x4'),'afterDestroy':_0xed47('0x5')};function emitEvent(_0x2fe77e){return function(_0x574cb6,_0x1a72fc,_0xea4bb9){ChatMessageEvents['emit'](_0x2fe77e+':'+_0x574cb6['id'],_0x574cb6);ChatMessageEvents['emit'](_0x2fe77e,_0x574cb6);_0xea4bb9(null);};}for(var e in events){if(events[_0xed47('0x6')](e)){var event=events[e];ChatMessage[_0xed47('0x7')](e,emitEvent(event));}}module[_0xed47('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xfac0=['exports','../../mysqldb','ChatMessage','setMaxListeners','remove','hasOwnProperty'];(function(_0x23408e,_0x17bdce){var _0x58f607=function(_0x3f587d){while(--_0x3f587d){_0x23408e['push'](_0x23408e['shift']());}};_0x58f607(++_0x17bdce);}(_0xfac0,0x19f));var _0x0fac=function(_0xe24fb7,_0x1b4d12){_0xe24fb7=_0xe24fb7-0x0;var _0x56b975=_0xfac0[_0xe24fb7];return _0x56b975;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0fac('0x0'))['db'][_0x0fac('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0fac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0fac('0x3')};function emitEvent(_0x311b37){return function(_0x52425a,_0xeae09a,_0x18ef54){ChatMessageEvents['emit'](_0x311b37+':'+_0x52425a['id'],_0x52425a);ChatMessageEvents['emit'](_0x311b37,_0x52425a);_0x18ef54(null);};}for(var e in events){if(events[_0x0fac('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0fac('0x5')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 595b633..932f3b3 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 _0xbd5c=['UserId','ChatInteraction','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','out','secret'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbd5c,0x19d));var _0xcbd5=function(_0xf6d197,_0x948e12){_0xf6d197=_0xf6d197-0x0;var _0x420255=_0xbd5c[_0xf6d197];return _0x420255;};'use strict';var _=require(_0xcbd5('0x0'));var util=require(_0xcbd5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcbd5('0x2'));var BPromise=require(_0xcbd5('0x3'));var rp=require(_0xcbd5('0x4'));var fs=require('fs');var path=require(_0xcbd5('0x5'));var rimraf=require(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var attributes=require(_0xcbd5('0x8'));module[_0xcbd5('0x9')]=function(_0x389aaa,_0xb2e08){return _0x389aaa['define'](_0xcbd5('0xa'),attributes,{'tableName':_0xcbd5('0xb'),'paranoid':![],'indexes':[{'name':_0xcbd5('0xc'),'fields':[_0xcbd5('0xd')],'type':_0xcbd5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f12c0,_0x52cf5b,_0x431e3f){var _0x5f45ba=_0x389aaa[_0xcbd5('0xf')];var _0x6a7fe2=_0x4f12c0['get']({'plain':!![]});if(_0x6a7fe2['direction']['toLowerCase']()==='in'||_0x6a7fe2[_0xcbd5('0x10')]['toLowerCase']()===_0xcbd5('0x11')&&!_0x6a7fe2[_0xcbd5('0x12')]&&!_['isNil'](_0x6a7fe2[_0xcbd5('0x13')])){_0x5f45ba[_0xcbd5('0x14')]['findOne']({'where':{'id':_0x6a7fe2['ChatInteractionId']}})['then'](function(_0x1af92a){if(_0x1af92a){_0x1af92a['update']({'lastMsgAt':_0x6a7fe2['createdAt'],'lastMsgDirection':_0x6a7fe2[_0xcbd5('0x10')]['toLowerCase']()});}})['catch'](function(_0x235c81){console[_0xcbd5('0x15')](_0x235c81);});}_0x431e3f();}},'charset':_0xcbd5('0x16'),'collate':_0xcbd5('0x17')});}; \ No newline at end of file +var _0x4318=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x47c566,_0x280943){var _0x5693c7=function(_0x4e07c9){while(--_0x4e07c9){_0x47c566['push'](_0x47c566['shift']());}};_0x5693c7(++_0x280943);}(_0x4318,0x1a7));var _0x8431=function(_0x3e7a4e,_0xe67c15){_0x3e7a4e=_0x3e7a4e-0x0;var _0x5912e1=_0x4318[_0x3e7a4e];return _0x5912e1;};'use strict';var _=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var logger=require(_0x8431('0x2'))(_0x8431('0x3'));var moment=require(_0x8431('0x4'));var BPromise=require(_0x8431('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8431('0x6'));var rimraf=require(_0x8431('0x7'));var config=require(_0x8431('0x8'));var attributes=require('./chatMessage.attributes');module[_0x8431('0x9')]=function(_0x391150,_0x35b031){return _0x391150[_0x8431('0xa')](_0x8431('0xb'),attributes,{'tableName':_0x8431('0xc'),'paranoid':![],'indexes':[{'name':_0x8431('0xd'),'fields':['body'],'type':_0x8431('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a22ae,_0x14d241,_0x17f4da){var _0x5c3360=_0x391150[_0x8431('0xf')];var _0xd90f8a=_0x4a22ae[_0x8431('0x10')]({'plain':!![]});if(_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()==='in'||_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()===_0x8431('0x13')&&!_0xd90f8a[_0x8431('0x14')]&&!_['isNil'](_0xd90f8a[_0x8431('0x15')])){_0x5c3360[_0x8431('0x16')][_0x8431('0x17')]({'where':{'id':_0xd90f8a[_0x8431('0x18')]}})[_0x8431('0x19')](function(_0x47cbac){if(_0x47cbac){_0x47cbac[_0x8431('0x1a')]({'lastMsgAt':_0xd90f8a[_0x8431('0x1b')],'lastMsgDirection':_0xd90f8a[_0x8431('0x11')]['toLowerCase']()});}})[_0x8431('0x1c')](function(_0x5718af){console[_0x8431('0x1d')](_0x5718af);});}_0x17f4da();}},'charset':_0x8431('0x1e'),'collate':_0x8431('0x1f')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b313515..1bc7972 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 _0x184a=['message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x58b9b2,_0x4a3098){var _0x215fb5=function(_0x70e8d3){while(--_0x70e8d3){_0x58b9b2['push'](_0x58b9b2['shift']());}};_0x215fb5(++_0x4a3098);}(_0x184a,0x16b));var _0xa184=function(_0x26fe83,_0x29110){_0x26fe83=_0x26fe83-0x0;var _0x41b15f=_0x184a[_0x26fe83];return _0x41b15f;};'use strict';var _=require(_0xa184('0x0'));var util=require('util');var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require(_0xa184('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa184('0x4'))['db'];var utils=require(_0xa184('0x5'));var logger=require(_0xa184('0x6'))(_0xa184('0x7'));var config=require(_0xa184('0x8'));var jayson=require(_0xa184('0x9'));var client=jayson[_0xa184('0xa')]['http']({'port':0x232a});config[_0xa184('0xb')]=_['defaults'](config[_0xa184('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa184('0xb')]));require('./chatMessage.socket')[_0xa184('0xc')](socket);function respondWithRpcPromise(_0x54e82e,_0x5d7adf,_0xa9bbf6){return new BPromise(function(_0x3ee8e1,_0x1bdac7){return client[_0xa184('0xd')](_0x54e82e,_0xa9bbf6)[_0xa184('0xe')](function(_0x1e3d9e){logger['info'](_0xa184('0xf'),_0x5d7adf,_0xa184('0x10'));logger[_0xa184('0x11')](_0xa184('0x12'),_0x5d7adf,_0xa184('0x10'),JSON['stringify'](_0x1e3d9e));if(_0x1e3d9e[_0xa184('0x13')]){if(_0x1e3d9e['error'][_0xa184('0x14')]===0x1f4){logger['error'](_0xa184('0xf'),_0x5d7adf,_0x1e3d9e[_0xa184('0x13')]['message']);return _0x1bdac7(_0x1e3d9e[_0xa184('0x13')][_0xa184('0x15')]);}logger[_0xa184('0x13')](_0xa184('0xf'),_0x5d7adf,_0x1e3d9e[_0xa184('0x13')][_0xa184('0x15')]);return _0x3ee8e1(_0x1e3d9e['error'][_0xa184('0x15')]);}else{logger[_0xa184('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5d7adf,_0xa184('0x10'));_0x3ee8e1(_0x1e3d9e[_0xa184('0x17')][_0xa184('0x15')]);}})[_0xa184('0x18')](function(_0x11d91e){logger[_0xa184('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5d7adf,_0x11d91e);_0x1bdac7(_0x11d91e);});});}exports[_0xa184('0x19')]=function(_0x67496e){var _0x5d210c=this;return new Promise(function(_0x58d70e,_0x24b71e){return db[_0xa184('0x1a')][_0xa184('0x1b')](_0x67496e[_0xa184('0x1c')],{'raw':_0x67496e[_0xa184('0x1d')]?_0x67496e[_0xa184('0x1d')][_0xa184('0x1e')]===undefined?!![]:![]:!![]})[_0xa184('0xe')](function(_0x2c4a11){logger['info'](_0xa184('0x19'),_0x67496e);logger[_0xa184('0x11')]('CreateChatMessage',_0x67496e,JSON[_0xa184('0x1f')](_0x2c4a11));_0x58d70e(_0x2c4a11);})[_0xa184('0x18')](function(_0x2a0ec8){logger[_0xa184('0x13')](_0xa184('0x19'),_0x2a0ec8['message'],_0x67496e);_0x24b71e(_0x5d210c[_0xa184('0x13')](0x1f4,_0x2a0ec8[_0xa184('0x15')]));});});}; \ No newline at end of file +var _0x8524=['result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c41dd,_0x542e1c){var _0x3b54c7=function(_0x3b00c2){while(--_0x3b00c2){_0x1c41dd['push'](_0x1c41dd['shift']());}};_0x3b54c7(++_0x542e1c);}(_0x8524,0x84));var _0x4852=function(_0x17eb95,_0x25527a){_0x17eb95=_0x17eb95-0x0;var _0x311877=_0x8524[_0x17eb95];return _0x311877;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4852('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4852('0x1'));var db=require(_0x4852('0x2'))['db'];var utils=require(_0x4852('0x3'));var logger=require(_0x4852('0x4'))(_0x4852('0x5'));var config=require('../../config/environment');var jayson=require(_0x4852('0x6'));var client=jayson[_0x4852('0x7')][_0x4852('0x8')]({'port':0x232a});config[_0x4852('0x9')]=_[_0x4852('0xa')](config[_0x4852('0x9')],{'host':_0x4852('0xb'),'port':0x18eb});var socket=require(_0x4852('0xc'))(new Redis(config[_0x4852('0x9')]));require(_0x4852('0xd'))['register'](socket);function respondWithRpcPromise(_0x173eee,_0x3fdb83,_0x376582){return new BPromise(function(_0x28da5d,_0x54c66f){return client[_0x4852('0xe')](_0x173eee,_0x376582)['then'](function(_0x56739e){logger[_0x4852('0xf')](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));logger[_0x4852('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3fdb83,_0x4852('0x11'),JSON[_0x4852('0x13')](_0x56739e));if(_0x56739e['error']){if(_0x56739e[_0x4852('0x14')][_0x4852('0x15')]===0x1f4){logger['error'](_0x4852('0x10'),_0x3fdb83,_0x56739e[_0x4852('0x14')]['message']);return _0x54c66f(_0x56739e['error']['message']);}logger[_0x4852('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3fdb83,_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);return _0x28da5d(_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);}else{logger['info'](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));_0x28da5d(_0x56739e[_0x4852('0x17')][_0x4852('0x16')]);}})[_0x4852('0x18')](function(_0x4201b7){logger[_0x4852('0x14')](_0x4852('0x10'),_0x3fdb83,_0x4201b7);_0x54c66f(_0x4201b7);});});}exports[_0x4852('0x19')]=function(_0x416c79){var _0x41a143=this;return new Promise(function(_0x748a93,_0x5c9ff1){return db[_0x4852('0x1a')][_0x4852('0x1b')](_0x416c79[_0x4852('0x1c')],{'raw':_0x416c79[_0x4852('0x1d')]?_0x416c79[_0x4852('0x1d')][_0x4852('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x251d0c){logger['info']('CreateChatMessage',_0x416c79);logger[_0x4852('0x12')](_0x4852('0x19'),_0x416c79,JSON[_0x4852('0x13')](_0x251d0c));_0x748a93(_0x251d0c);})['catch'](function(_0x5bfc7c){logger[_0x4852('0x14')](_0x4852('0x19'),_0x5bfc7c['message'],_0x416c79);_0x5c9ff1(_0x41a143[_0x4852('0x14')](0x1f4,_0x5bfc7c[_0x4852('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 70b4ea4..221f143 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 _0xdd0c=['save','remove','update','emit','removeListener','register','length'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0xdd0c,0x165));var _0xcdd0=function(_0x491fcf,_0x450f7f){_0x491fcf=_0x491fcf-0x0;var _0x5b65f1=_0xdd0c[_0x491fcf];return _0x5b65f1;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xcdd0('0x0'),_0xcdd0('0x1'),_0xcdd0('0x2')];function createListener(_0x5e3ada,_0xe8ed9){return function(_0x5b86cb){_0xe8ed9[_0xcdd0('0x3')](_0x5e3ada,_0x5b86cb);};}function removeListener(_0x159e38,_0x432716){return function(){ChatMessageEvents[_0xcdd0('0x4')](_0x159e38,_0x432716);};}exports[_0xcdd0('0x5')]=function(_0x5ae472){for(var _0x2b33fc=0x0,_0x1b6f5d=events[_0xcdd0('0x6')];_0x2b33fc<_0x1b6f5d;_0x2b33fc++){var _0x15c402=events[_0x2b33fc];var _0x337496=createListener('chatMessage:'+_0x15c402,_0x5ae472);ChatMessageEvents['on'](_0x15c402,_0x337496);}}; \ No newline at end of file +var _0x8ba0=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1b2bda,_0x11c750){var _0x5d955b=function(_0x2ae5fb){while(--_0x2ae5fb){_0x1b2bda['push'](_0x1b2bda['shift']());}};_0x5d955b(++_0x11c750);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x7ab04c,_0x3a7791){_0x7ab04c=_0x7ab04c-0x0;var _0x14add2=_0x8ba0[_0x7ab04c];return _0x14add2;};'use strict';var ChatMessageEvents=require(_0x08ba('0x0'));var events=[_0x08ba('0x1'),_0x08ba('0x2'),_0x08ba('0x3')];function createListener(_0x43ffb6,_0x5684f1){return function(_0x5e182a){_0x5684f1[_0x08ba('0x4')](_0x43ffb6,_0x5e182a);};}function removeListener(_0x802b7e,_0x3defcd){return function(){ChatMessageEvents[_0x08ba('0x5')](_0x802b7e,_0x3defcd);};}exports[_0x08ba('0x6')]=function(_0x161a9d){for(var _0x5f29fa=0x0,_0x235354=events[_0x08ba('0x7')];_0x5f29fa<_0x235354;_0x5f29fa++){var _0x37bcdf=events[_0x5f29fa];var _0x451f15=createListener(_0x08ba('0x8')+_0x37bcdf,_0x161a9d);ChatMessageEvents['on'](_0x37bcdf,_0x451f15);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a8e9f7b..5606afc 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 _0x5a61=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a61,0x6b));var _0x15a6=function(_0x3e103d,_0x55790c){_0x3e103d=_0x3e103d-0x0;var _0x4931bf=_0x5a61[_0x3e103d];return _0x4931bf;};'use strict';var multer=require(_0x15a6('0x0'));var util=require('util');var path=require(_0x15a6('0x1'));var timeout=require(_0x15a6('0x2'));var express=require(_0x15a6('0x3'));var router=express[_0x15a6('0x4')]();var fs_extra=require(_0x15a6('0x5'));var auth=require(_0x15a6('0x6'));var interaction=require(_0x15a6('0x7'));var config=require(_0x15a6('0x8'));var controller=require(_0x15a6('0x9'));router[_0x15a6('0xa')]('/',auth[_0x15a6('0xb')](),controller[_0x15a6('0xc')]);router[_0x15a6('0xa')](_0x15a6('0xd'),auth[_0x15a6('0xb')](),controller[_0x15a6('0xe')]);router[_0x15a6('0xa')](_0x15a6('0xf'),auth[_0x15a6('0xb')](),controller['show']);router[_0x15a6('0x10')]('/',auth[_0x15a6('0xb')](),interaction[_0x15a6('0x11')](_0x15a6('0x12'),_0x15a6('0x13')),controller['create']);router[_0x15a6('0x14')](_0x15a6('0xf'),controller[_0x15a6('0x15')]);router[_0x15a6('0x14')](_0x15a6('0x16'),auth[_0x15a6('0xb')](),controller[_0x15a6('0x17')]);router[_0x15a6('0x14')](_0x15a6('0x18'),auth[_0x15a6('0xb')](),controller[_0x15a6('0x19')]);router[_0x15a6('0x1a')](_0x15a6('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa172=['create','put','/:id/accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked'];(function(_0x2c66b3,_0x4ecbd1){var _0x14527e=function(_0x167b4a){while(--_0x167b4a){_0x2c66b3['push'](_0x2c66b3['shift']());}};_0x14527e(++_0x4ecbd1);}(_0xa172,0x1d2));var _0x2a17=function(_0x4e9208,_0x3e7809){_0x4e9208=_0x4e9208-0x0;var _0x32a86f=_0xa172[_0x4e9208];return _0x32a86f;};'use strict';var multer=require(_0x2a17('0x0'));var util=require(_0x2a17('0x1'));var path=require(_0x2a17('0x2'));var timeout=require(_0x2a17('0x3'));var express=require(_0x2a17('0x4'));var router=express['Router']();var fs_extra=require(_0x2a17('0x5'));var auth=require(_0x2a17('0x6'));var interaction=require(_0x2a17('0x7'));var config=require(_0x2a17('0x8'));var controller=require(_0x2a17('0x9'));router['get']('/',auth[_0x2a17('0xa')](),controller[_0x2a17('0xb')]);router[_0x2a17('0xc')](_0x2a17('0xd'),auth[_0x2a17('0xa')](),controller[_0x2a17('0xe')]);router[_0x2a17('0xc')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x2a17('0x10')]('chat','chatmessage:create'),controller[_0x2a17('0x11')]);router[_0x2a17('0x12')]('/:id',controller['update']);router[_0x2a17('0x12')](_0x2a17('0x13'),auth[_0x2a17('0xa')](),controller['accept']);router['put'](_0x2a17('0x14'),auth[_0x2a17('0xa')](),controller[_0x2a17('0x15')]);router[_0x2a17('0x16')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 379f1c2..c3165bb 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 _0xadb5=['medium','TEXT','exports'];(function(_0x184abf,_0x1bd5d2){var _0x4954a4=function(_0x600bf7){while(--_0x600bf7){_0x184abf['push'](_0x184abf['shift']());}};_0x4954a4(++_0x1bd5d2);}(_0xadb5,0xad));var _0x5adb=function(_0x3b59c0,_0x13a0bd){_0x3b59c0=_0x3b59c0-0x0;var _0x1e2e25=_0xadb5[_0x3b59c0];return _0x1e2e25;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x2eed97,_0x2f9a2a){var _0x260c3c=function(_0x39967d){while(--_0x39967d){_0x2eed97['push'](_0x2eed97['shift']());}};_0x260c3c(++_0x2f9a2a);}(_0xdb28,0x106));var _0x8db2=function(_0x3b0e21,_0x29d3bb){_0x3b0e21=_0x3b0e21-0x0;var _0x344841=_0xdb28[_0x3b0e21];return _0x344841;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 79f692c..8a9a07e 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x5e7f9f,_0x2de81a){_0x5e7f9f=_0x5e7f9f-0x0;var _0x2afd1b=_0x7a54[_0x5e7f9f];return _0x2afd1b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1f0cc0,_0x1e9eec){var _0x477658=function(_0x38fd09){while(--_0x38fd09){_0x1f0cc0['push'](_0x1f0cc0['shift']());}};_0x477658(++_0x1e9eec);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index e4994bc..2f279d3 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x847f=['emit','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x30c0a8,_0xfe54a1){var _0x17a034=function(_0x585a6f){while(--_0x585a6f){_0x30c0a8['push'](_0x30c0a8['shift']());}};_0x17a034(++_0xfe54a1);}(_0x847f,0x182));var _0xf847=function(_0x3705f7,_0x2553c4){_0x3705f7=_0x3705f7-0x0;var _0x2a1cf2=_0x847f[_0x3705f7];return _0x2a1cf2;};'use strict';var EventEmitter=require(_0xf847('0x0'));var ChatOfflineMessage=require(_0xf847('0x1'))['db'][_0xf847('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf847('0x3'),'afterUpdate':_0xf847('0x4'),'afterDestroy':_0xf847('0x5')};function emitEvent(_0x2e0f72){return function(_0x12faa2,_0x5d5964,_0x5eeab2){ChatOfflineMessageEvents[_0xf847('0x6')](_0x2e0f72+':'+_0x12faa2['id'],_0x12faa2);ChatOfflineMessageEvents[_0xf847('0x6')](_0x2e0f72,_0x12faa2);_0x5eeab2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf847('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x54c7=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x332e95,_0x2d5ef2){var _0x387cb1=function(_0x168886){while(--_0x168886){_0x332e95['push'](_0x332e95['shift']());}};_0x387cb1(++_0x2d5ef2);}(_0x54c7,0x161));var _0x754c=function(_0x1ef2ac,_0x2589fd){_0x1ef2ac=_0x1ef2ac-0x0;var _0x30ca2d=_0x54c7[_0x1ef2ac];return _0x30ca2d;};'use strict';var EventEmitter=require(_0x754c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x754c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x754c('0x2')](0x0);var events={'afterCreate':_0x754c('0x3'),'afterUpdate':_0x754c('0x4'),'afterDestroy':_0x754c('0x5')};function emitEvent(_0x4bb46c){return function(_0x5000a8,_0x4a028d,_0x338ac1){ChatOfflineMessageEvents[_0x754c('0x6')](_0x4bb46c+':'+_0x5000a8['id'],_0x5000a8);ChatOfflineMessageEvents['emit'](_0x4bb46c,_0x5000a8);_0x338ac1(null);};}for(var e in events){if(events[_0x754c('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x754c('0x8')](e,emitEvent(event));}}module[_0x754c('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f45c349..4580b20 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 _0x9a43=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x9a43,0x96));var _0x39a4=function(_0x15a833,_0x5092d6){_0x15a833=_0x15a833-0x0;var _0x371593=_0x9a43[_0x15a833];return _0x371593;};'use strict';var attributes=require(_0x39a4('0x0'));module[_0x39a4('0x1')]=function(_0x3cac99){return _0x3cac99[_0x39a4('0x2')](_0x39a4('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39a4('0x4'),'collate':_0x39a4('0x5')});}; \ No newline at end of file +var _0x165e=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x165e,0xd3));var _0xe165=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x165e[_0x3d8ba1];return _0x87804e;};'use strict';var attributes=require(_0xe165('0x0'));module['exports']=function(_0x19b26b){return _0x19b26b[_0xe165('0x1')](_0xe165('0x2'),attributes,{'tableName':_0xe165('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe165('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a13f82f..13d4ca8 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 _0x21d1=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0x4029b1,_0x4a2674){var _0x27ac22=function(_0x500e25){while(--_0x500e25){_0x4029b1['push'](_0x4029b1['shift']());}};_0x27ac22(++_0x4a2674);}(_0x21d1,0x1c9));var _0x121d=function(_0x5a13ec,_0x431fd7){_0x5a13ec=_0x5a13ec-0x0;var _0x27fd53=_0x21d1[_0x5a13ec];return _0x27fd53;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var moment=require(_0x121d('0x2'));var BPromise=require(_0x121d('0x3'));var rs=require(_0x121d('0x4'));var fs=require('fs');var Redis=require(_0x121d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x121d('0x6'))(_0x121d('0x7'));var config=require(_0x121d('0x8'));var jayson=require(_0x121d('0x9'));var client=jayson[_0x121d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226625,_0x2bd1e8,_0x47b50b){return new BPromise(function(_0x2d4d7e,_0x242f0c){return client[_0x121d('0xb')](_0x226625,_0x47b50b)[_0x121d('0xc')](function(_0x8b07c2){logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,'request\x20sent');logger[_0x121d('0xf')](_0x121d('0x10'),_0x2bd1e8,_0x121d('0x11'),JSON['stringify'](_0x8b07c2));if(_0x8b07c2['error']){if(_0x8b07c2[_0x121d('0x12')][_0x121d('0x13')]===0x1f4){logger[_0x121d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x242f0c(_0x8b07c2['error'][_0x121d('0x14')]);}logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x2d4d7e(_0x8b07c2[_0x121d('0x12')][_0x121d('0x14')]);}else{logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,_0x121d('0x11'));_0x2d4d7e(_0x8b07c2[_0x121d('0x15')][_0x121d('0x14')]);}})[_0x121d('0x16')](function(_0x475541){logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x475541);_0x242f0c(_0x475541);});});} \ No newline at end of file +var _0x13e3=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x13e3,0x137));var _0x313e=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x13e3[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x313e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x313e('0x1'));var db=require(_0x313e('0x2'))['db'];var utils=require(_0x313e('0x3'));var logger=require(_0x313e('0x4'))('rpc');var config=require(_0x313e('0x5'));var jayson=require(_0x313e('0x6'));var client=jayson[_0x313e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65b347,_0x1fb2da,_0x5439c2){return new BPromise(function(_0x5cd7a0,_0x572930){return client[_0x313e('0x8')](_0x65b347,_0x5439c2)[_0x313e('0x9')](function(_0x1dbff1){logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));logger['debug'](_0x313e('0xd'),_0x1fb2da,_0x313e('0xc'),JSON['stringify'](_0x1dbff1));if(_0x1dbff1[_0x313e('0xe')]){if(_0x1dbff1[_0x313e('0xe')]['code']===0x1f4){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x572930(_0x1dbff1[_0x313e('0xe')]['message']);}logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x5cd7a0(_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);}else{logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));_0x5cd7a0(_0x1dbff1[_0x313e('0x10')]['message']);}})[_0x313e('0x11')](function(_0xb404d3){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0xb404d3);_0x572930(_0xb404d3);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 2afdb2f..35d73e4 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 _0xc88d=['update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc88d,0x1be));var _0xdc88=function(_0x49f371,_0x5a4f84){_0x49f371=_0x49f371-0x0;var _0x101bd9=_0xc88d[_0x49f371];return _0x101bd9;};'use strict';var multer=require('multer');var util=require(_0xdc88('0x0'));var path=require(_0xdc88('0x1'));var timeout=require(_0xdc88('0x2'));var express=require(_0xdc88('0x3'));var router=express[_0xdc88('0x4')]();var fs_extra=require(_0xdc88('0x5'));var auth=require(_0xdc88('0x6'));var interaction=require(_0xdc88('0x7'));var config=require(_0xdc88('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xdc88('0x9')]('/',auth[_0xdc88('0xa')](),controller[_0xdc88('0xb')]);router[_0xdc88('0x9')]('/describe',auth[_0xdc88('0xa')](),controller['describe']);router['get']('/:id',auth[_0xdc88('0xa')](),controller[_0xdc88('0xc')]);router[_0xdc88('0xd')]('/',auth[_0xdc88('0xa')](),controller[_0xdc88('0xe')]);router[_0xdc88('0xf')]('/:id',auth[_0xdc88('0xa')](),controller[_0xdc88('0x10')]);router[_0xdc88('0x11')](_0xdc88('0x12'),auth[_0xdc88('0xa')](),controller[_0xdc88('0x13')]);module[_0xdc88('0x14')]=router; \ No newline at end of file +var _0x1fa6=['/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x1fa6,0x12d));var _0x61fa=function(_0x5e6d6b,_0x12c0f0){_0x5e6d6b=_0x5e6d6b-0x0;var _0xea6381=_0x1fa6[_0x5e6d6b];return _0xea6381;};'use strict';var multer=require(_0x61fa('0x0'));var util=require(_0x61fa('0x1'));var path=require(_0x61fa('0x2'));var timeout=require(_0x61fa('0x3'));var express=require(_0x61fa('0x4'));var router=express['Router']();var fs_extra=require(_0x61fa('0x5'));var auth=require(_0x61fa('0x6'));var interaction=require(_0x61fa('0x7'));var config=require(_0x61fa('0x8'));var controller=require(_0x61fa('0x9'));router[_0x61fa('0xa')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0xc')]);router[_0x61fa('0xa')]('/describe',auth[_0x61fa('0xb')](),controller[_0x61fa('0xd')]);router['get'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0xf')]);router[_0x61fa('0x10')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0x11')]);router['put'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x12')]);router[_0x61fa('0x13')](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index b184d70..4db8bcb 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 _0x665d=['ENUM','mouseOver','timeout','sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x665d,0x12f));var _0xd665=function(_0x57aec1,_0x2b6744){_0x57aec1=_0x57aec1-0x0;var _0x4597ae=_0x665d[_0x57aec1];return _0x4597ae;};'use strict';var Sequelize=require(_0xd665('0x0'));module[_0xd665('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd665('0x2')](_0xd665('0x3'),_0xd665('0x4')),'defaultValue':_0xd665('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xae29=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x594c55,_0x2bf942){var _0x4801a5=function(_0x52a288){while(--_0x52a288){_0x594c55['push'](_0x594c55['shift']());}};_0x4801a5(++_0x2bf942);}(_0xae29,0xf3));var _0x9ae2=function(_0xada429,_0xdb476b){_0xada429=_0xada429-0x0;var _0x4d8c6d=_0xae29[_0xada429];return _0x4d8c6d;};'use strict';var Sequelize=require(_0x9ae2('0x0'));module[_0x9ae2('0x1')]={'name':{'type':Sequelize[_0x9ae2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9ae2('0x3')](_0x9ae2('0x4'),_0x9ae2('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9ae2('0x2')]},'timeout':{'type':Sequelize[_0x9ae2('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 40421a5..45eed99 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 _0x4e00=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','catch','params','destroy','rimraf','fast-json-patch','request-promise','mustache','path'];(function(_0x213ba1,_0x35c70f){var _0x192447=function(_0x5b5968){while(--_0x5b5968){_0x213ba1['push'](_0x213ba1['shift']());}};_0x192447(++_0x35c70f);}(_0x4e00,0xa0));var _0x04e0=function(_0x4b6bb4,_0x205fd3){_0x4b6bb4=_0x4b6bb4-0x0;var _0x53b2f6=_0x4e00[_0x4b6bb4];return _0x53b2f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04e0('0x1'));var rp=require(_0x04e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04e0('0x3'));var util=require('util');var path=require(_0x04e0('0x4'));var sox=require(_0x04e0('0x5'));var csv=require(_0x04e0('0x6'));var ejs=require(_0x04e0('0x7'));var fs=require('fs');var fs_extra=require(_0x04e0('0x8'));var _=require(_0x04e0('0x9'));var squel=require(_0x04e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x04e0('0xb'));var deskjs=require(_0x04e0('0xc'));var toCsv=require(_0x04e0('0x6'));var querystring=require(_0x04e0('0xd'));var Papa=require('papaparse');var Redis=require(_0x04e0('0xe'));var authService=require(_0x04e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04e0('0x10'));var logger=require('../../config/logger')(_0x04e0('0x11'));var utils=require(_0x04e0('0x12'));var config=require(_0x04e0('0x13'));var licenseUtil=require(_0x04e0('0x14'));var db=require(_0x04e0('0x15'))['db'];function respondWithStatusCode(_0xc0ae61,_0x2a620a){_0x2a620a=_0x2a620a||0xcc;return function(_0x323881){if(_0x323881){return _0xc0ae61['sendStatus'](_0x2a620a);}return _0xc0ae61[_0x04e0('0x16')](_0x2a620a)['end']();};}function respondWithResult(_0x1963cf,_0x29f682){_0x29f682=_0x29f682||0xc8;return function(_0xdf6702){if(_0xdf6702){return _0x1963cf['status'](_0x29f682)[_0x04e0('0x17')](_0xdf6702);}};}function respondWithFilteredResult(_0x3823f6,_0x2e28a5){return function(_0x221c66){if(_0x221c66){var _0x462cf7=typeof _0x2e28a5[_0x04e0('0x18')]===_0x04e0('0x19')&&typeof _0x2e28a5[_0x04e0('0x1a')]===_0x04e0('0x19');var _0xf7b102=_0x221c66[_0x04e0('0x1b')];var _0x1b6f4a=_0x462cf7?0x0:_0x2e28a5[_0x04e0('0x18')];var _0x5bdd6c=_0x462cf7?_0x221c66['count']:_0x2e28a5['offset']+_0x2e28a5[_0x04e0('0x1a')];var _0x3e940e;if(_0x5bdd6c>=_0xf7b102){_0x5bdd6c=_0xf7b102;_0x3e940e=0xc8;}else{_0x3e940e=0xce;}_0x3823f6[_0x04e0('0x16')](_0x3e940e);return _0x3823f6['set'](_0x04e0('0x1c'),_0x1b6f4a+'-'+_0x5bdd6c+'/'+_0xf7b102)[_0x04e0('0x17')](_0x221c66);}return null;};}function patchUpdates(_0x27e761){return function(_0x7bc646){try{jsonpatch['apply'](_0x7bc646,_0x27e761,!![]);}catch(_0x4fdbc4){return BPromise[_0x04e0('0x1d')](_0x4fdbc4);}return _0x7bc646[_0x04e0('0x1e')]();};}function saveUpdates(_0x34e44c,_0x310473){return function(_0x9e9020){if(_0x9e9020){return _0x9e9020[_0x04e0('0x1f')](_0x34e44c)[_0x04e0('0x20')](function(_0x3c3f69){return _0x3c3f69;});}return null;};}function removeEntity(_0x4566e2,_0x133b27){return function(_0x30decd){if(_0x30decd){return _0x30decd['destroy']()[_0x04e0('0x20')](function(){_0x4566e2[_0x04e0('0x16')](0xcc)[_0x04e0('0x21')]();});}};}function handleEntityNotFound(_0x2f47e1,_0x207c4c){return function(_0x50416c){if(!_0x50416c){_0x2f47e1['sendStatus'](0x194);}return _0x50416c;};}function handleError(_0x1ec359,_0x47e3be){_0x47e3be=_0x47e3be||0x1f4;return function(_0x11e64c){logger['error'](_0x11e64c['stack']);if(_0x11e64c[_0x04e0('0x22')]){delete _0x11e64c[_0x04e0('0x22')];}_0x1ec359[_0x04e0('0x16')](_0x47e3be)[_0x04e0('0x23')](_0x11e64c);};}exports[_0x04e0('0x24')]=function(_0x748569,_0xafde85){var _0x383a94={'raw':!![],'where':{'id':_0x748569['params']['id']}},_0xce81d5={};_0xce81d5[_0x04e0('0x25')]=_[_0x04e0('0x26')](db[_0x04e0('0x27')][_0x04e0('0x28')]);_0xce81d5[_0x04e0('0x29')]=_[_0x04e0('0x26')](_0x748569[_0x04e0('0x29')]);_0xce81d5['filters']=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],_0xce81d5['query']);_0x383a94[_0x04e0('0x2b')]=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],qs[_0x04e0('0x2c')](_0x748569[_0x04e0('0x29')]['fields']));_0x383a94['attributes']=_0x383a94[_0x04e0('0x2b')][_0x04e0('0x2d')]?_0x383a94[_0x04e0('0x2b')]:_0xce81d5[_0x04e0('0x25')];if(_0x748569[_0x04e0('0x29')][_0x04e0('0x2e')]){_0x383a94['include']=[{'all':!![]}];}_0x383a94=_[_0x04e0('0x2f')]({},_0x383a94,_0x748569[_0x04e0('0x30')]);return db['ChatProactiveAction'][_0x04e0('0x31')](_0x383a94)[_0x04e0('0x20')](handleEntityNotFound(_0xafde85,null))['then'](respondWithResult(_0xafde85,null))['catch'](handleError(_0xafde85,null));};exports[_0x04e0('0x32')]=function(_0xba549a,_0x3f29de){return db[_0x04e0('0x27')][_0x04e0('0x32')](_0xba549a[_0x04e0('0x33')],{})['then'](respondWithResult(_0x3f29de,0xc9))[_0x04e0('0x34')](handleError(_0x3f29de,null));};exports[_0x04e0('0x1f')]=function(_0xe3af2a,_0x4956b5){if(_0xe3af2a[_0x04e0('0x33')]['id']){delete _0xe3af2a[_0x04e0('0x33')]['id'];}return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0xe3af2a[_0x04e0('0x35')]['id']}})[_0x04e0('0x20')](handleEntityNotFound(_0x4956b5,null))[_0x04e0('0x20')](saveUpdates(_0xe3af2a[_0x04e0('0x33')],null))['then'](respondWithResult(_0x4956b5,null))['catch'](handleError(_0x4956b5,null));};exports[_0x04e0('0x36')]=function(_0x573755,_0x2a4595){return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0x573755['params']['id']}})['then'](handleEntityNotFound(_0x2a4595,null))[_0x04e0('0x20')](removeEntity(_0x2a4595,null))['catch'](handleError(_0x2a4595,null));}; \ No newline at end of file +var _0xa276=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x2bad0d,_0x1a99c9){var _0x69f1e1=function(_0x152a30){while(--_0x152a30){_0x2bad0d['push'](_0x2bad0d['shift']());}};_0x69f1e1(++_0x1a99c9);}(_0xa276,0x9a));var _0x6a27=function(_0xd1f83b,_0xc10512){_0xd1f83b=_0xd1f83b-0x0;var _0x548b09=_0xa276[_0xd1f83b];return _0x548b09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a27('0x0'));var zipdir=require(_0x6a27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a27('0x2'));var moment=require(_0x6a27('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a27('0x4'));var util=require(_0x6a27('0x5'));var path=require(_0x6a27('0x6'));var sox=require('sox');var csv=require(_0x6a27('0x7'));var ejs=require(_0x6a27('0x8'));var fs=require('fs');var fs_extra=require(_0x6a27('0x9'));var _=require('lodash');var squel=require(_0x6a27('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a27('0xb'));var Papa=require(_0x6a27('0xc'));var Redis=require(_0x6a27('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a27('0xe'));var hardwareService=require(_0x6a27('0xf'));var logger=require(_0x6a27('0x10'))(_0x6a27('0x11'));var utils=require(_0x6a27('0x12'));var config=require(_0x6a27('0x13'));var licenseUtil=require(_0x6a27('0x14'));var db=require(_0x6a27('0x15'))['db'];function respondWithStatusCode(_0x394307,_0x4a7209){_0x4a7209=_0x4a7209||0xcc;return function(_0x96472c){if(_0x96472c){return _0x394307['sendStatus'](_0x4a7209);}return _0x394307['status'](_0x4a7209)[_0x6a27('0x16')]();};}function respondWithResult(_0x1e987f,_0x39ef85){_0x39ef85=_0x39ef85||0xc8;return function(_0x5b28c6){if(_0x5b28c6){return _0x1e987f[_0x6a27('0x17')](_0x39ef85)[_0x6a27('0x18')](_0x5b28c6);}};}function respondWithFilteredResult(_0x318b61,_0x8f297b){return function(_0x294ac7){if(_0x294ac7){var _0x523e6d=typeof _0x8f297b['offset']===_0x6a27('0x19')&&typeof _0x8f297b[_0x6a27('0x1a')]===_0x6a27('0x19');var _0x4339d3=_0x294ac7[_0x6a27('0x1b')];var _0x1d5925=_0x523e6d?0x0:_0x8f297b['offset'];var _0x3fd414=_0x523e6d?_0x294ac7[_0x6a27('0x1b')]:_0x8f297b[_0x6a27('0x1c')]+_0x8f297b[_0x6a27('0x1a')];var _0x50ddcc;if(_0x3fd414>=_0x4339d3){_0x3fd414=_0x4339d3;_0x50ddcc=0xc8;}else{_0x50ddcc=0xce;}_0x318b61[_0x6a27('0x17')](_0x50ddcc);return _0x318b61[_0x6a27('0x1d')](_0x6a27('0x1e'),_0x1d5925+'-'+_0x3fd414+'/'+_0x4339d3)[_0x6a27('0x18')](_0x294ac7);}return null;};}function patchUpdates(_0x57649a){return function(_0x531d60){try{jsonpatch[_0x6a27('0x1f')](_0x531d60,_0x57649a,!![]);}catch(_0x4231c3){return BPromise['reject'](_0x4231c3);}return _0x531d60[_0x6a27('0x20')]();};}function saveUpdates(_0x2a7fdf,_0x13fc15){return function(_0x167076){if(_0x167076){return _0x167076[_0x6a27('0x21')](_0x2a7fdf)[_0x6a27('0x22')](function(_0x29348c){return _0x29348c;});}return null;};}function removeEntity(_0x13e148,_0x5e3a2e){return function(_0x241029){if(_0x241029){return _0x241029[_0x6a27('0x23')]()[_0x6a27('0x22')](function(){_0x13e148[_0x6a27('0x17')](0xcc)[_0x6a27('0x16')]();});}};}function handleEntityNotFound(_0x5f4897,_0x5b725c){return function(_0x30454b){if(!_0x30454b){_0x5f4897[_0x6a27('0x24')](0x194);}return _0x30454b;};}function handleError(_0x73dc52,_0x354781){_0x354781=_0x354781||0x1f4;return function(_0x54fc6c){logger[_0x6a27('0x25')](_0x54fc6c['stack']);if(_0x54fc6c['name']){delete _0x54fc6c[_0x6a27('0x26')];}_0x73dc52[_0x6a27('0x17')](_0x354781)['send'](_0x54fc6c);};}exports[_0x6a27('0x27')]=function(_0x52cc5d,_0x35fe1c){var _0xa42f9c={'raw':!![],'where':{'id':_0x52cc5d[_0x6a27('0x28')]['id']}},_0x5140b2={};_0x5140b2[_0x6a27('0x29')]=_[_0x6a27('0x2a')](db[_0x6a27('0x2b')][_0x6a27('0x2c')]);_0x5140b2[_0x6a27('0x2d')]=_[_0x6a27('0x2a')](_0x52cc5d[_0x6a27('0x2d')]);_0x5140b2['filters']=_[_0x6a27('0x2e')](_0x5140b2[_0x6a27('0x29')],_0x5140b2[_0x6a27('0x2d')]);_0xa42f9c[_0x6a27('0x2f')]=_['intersection'](_0x5140b2['model'],qs[_0x6a27('0x30')](_0x52cc5d['query'][_0x6a27('0x30')]));_0xa42f9c[_0x6a27('0x2f')]=_0xa42f9c[_0x6a27('0x2f')][_0x6a27('0x31')]?_0xa42f9c[_0x6a27('0x2f')]:_0x5140b2[_0x6a27('0x29')];if(_0x52cc5d[_0x6a27('0x2d')][_0x6a27('0x32')]){_0xa42f9c['include']=[{'all':!![]}];}_0xa42f9c=_[_0x6a27('0x33')]({},_0xa42f9c,_0x52cc5d['options']);return db[_0x6a27('0x2b')][_0x6a27('0x34')](_0xa42f9c)[_0x6a27('0x22')](handleEntityNotFound(_0x35fe1c,null))[_0x6a27('0x22')](respondWithResult(_0x35fe1c,null))[_0x6a27('0x35')](handleError(_0x35fe1c,null));};exports['create']=function(_0xabaac8,_0x316bb5){return db['ChatProactiveAction']['create'](_0xabaac8[_0x6a27('0x36')],{})[_0x6a27('0x22')](respondWithResult(_0x316bb5,0xc9))[_0x6a27('0x35')](handleError(_0x316bb5,null));};exports[_0x6a27('0x21')]=function(_0x1d9c1c,_0x3c3ad2){if(_0x1d9c1c['body']['id']){delete _0x1d9c1c[_0x6a27('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a27('0x34')]({'where':{'id':_0x1d9c1c[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x3c3ad2,null))[_0x6a27('0x22')](saveUpdates(_0x1d9c1c[_0x6a27('0x36')],null))[_0x6a27('0x22')](respondWithResult(_0x3c3ad2,null))[_0x6a27('0x35')](handleError(_0x3c3ad2,null));};exports[_0x6a27('0x23')]=function(_0x55020d,_0x43c9f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x55020d[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x43c9f3,null))[_0x6a27('0x22')](removeEntity(_0x43c9f3,null))[_0x6a27('0x35')](handleError(_0x43c9f3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f724e62..0e22242 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 _0x65ac=['util','../../config/logger','bluebird','exports','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x417577,_0x53d563){var _0x19db92=function(_0x4adc94){while(--_0x4adc94){_0x417577['push'](_0x417577['shift']());}};_0x19db92(++_0x53d563);}(_0x65ac,0x1bf));var _0xc65a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x65ac[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xc65a('0x0'));var util=require(_0xc65a('0x1'));var logger=require(_0xc65a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc65a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xc65a('0x4')]=function(_0x21af0c,_0x4c9227){return _0x21af0c['define'](_0xc65a('0x5'),attributes,{'tableName':_0xc65a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf51=['chat_proactive_actions','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1abe5a,_0x3be795){var _0x54d205=function(_0x3c31f6){while(--_0x3c31f6){_0x1abe5a['push'](_0x1abe5a['shift']());}};_0x54d205(++_0x3be795);}(_0xbf51,0x12d));var _0x1bf5=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xbf51[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x1bf5('0x0'));var util=require(_0x1bf5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1bf5('0x2'));var rp=require(_0x1bf5('0x3'));var fs=require('fs');var path=require(_0x1bf5('0x4'));var rimraf=require(_0x1bf5('0x5'));var config=require(_0x1bf5('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x1bf5('0x7')]=function(_0x3eeaa3,_0x1d2f49){return _0x3eeaa3[_0x1bf5('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1bf5('0x9'),'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 73cc141..4d3dccd 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 _0x652f=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x652f,0xbd));var _0xf652=function(_0x5bdb03,_0x12c8f4){_0x5bdb03=_0x5bdb03-0x0;var _0x34b89c=_0x652f[_0x5bdb03];return _0x34b89c;};'use strict';var _=require(_0xf652('0x0'));var util=require(_0xf652('0x1'));var moment=require(_0xf652('0x2'));var BPromise=require(_0xf652('0x3'));var rs=require(_0xf652('0x4'));var fs=require('fs');var Redis=require(_0xf652('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf652('0x6'));var logger=require(_0xf652('0x7'))('rpc');var config=require(_0xf652('0x8'));var jayson=require(_0xf652('0x9'));var client=jayson[_0xf652('0xa')][_0xf652('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd0fc,_0x2af39a,_0x372b47){return new BPromise(function(_0x19768a,_0x7b48b6){return client[_0xf652('0xc')](_0x5bd0fc,_0x372b47)[_0xf652('0xd')](function(_0x41e850){logger[_0xf652('0xe')](_0xf652('0xf'),_0x2af39a,_0xf652('0x10'));logger[_0xf652('0x11')](_0xf652('0x12'),_0x2af39a,_0xf652('0x10'),JSON[_0xf652('0x13')](_0x41e850));if(_0x41e850['error']){if(_0x41e850[_0xf652('0x14')][_0xf652('0x15')]===0x1f4){logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x41e850[_0xf652('0x14')][_0xf652('0x16')]);return _0x7b48b6(_0x41e850[_0xf652('0x14')]['message']);}logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x41e850[_0xf652('0x14')]['message']);return _0x19768a(_0x41e850[_0xf652('0x14')][_0xf652('0x16')]);}else{logger[_0xf652('0xe')](_0xf652('0xf'),_0x2af39a,_0xf652('0x10'));_0x19768a(_0x41e850[_0xf652('0x17')]['message']);}})[_0xf652('0x18')](function(_0x443d6f){logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x443d6f);_0x7b48b6(_0x443d6f);});});} \ No newline at end of file +var _0x9220=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','ChatProactiveAction,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x52f2eb,_0x138336){var _0x3e344d=function(_0x2a7b7b){while(--_0x2a7b7b){_0x52f2eb['push'](_0x52f2eb['shift']());}};_0x3e344d(++_0x138336);}(_0x9220,0x162));var _0x0922=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9220[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x0922('0x0'));var util=require(_0x0922('0x1'));var moment=require(_0x0922('0x2'));var BPromise=require(_0x0922('0x3'));var rs=require(_0x0922('0x4'));var fs=require('fs');var Redis=require(_0x0922('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0922('0x6'));var logger=require(_0x0922('0x7'))(_0x0922('0x8'));var config=require(_0x0922('0x9'));var jayson=require(_0x0922('0xa'));var client=jayson[_0x0922('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x591d6c,_0x48ce8a,_0x41ba28){return new BPromise(function(_0x10cfb5,_0x33b528){return client[_0x0922('0xc')](_0x591d6c,_0x41ba28)[_0x0922('0xd')](function(_0xa849e){logger[_0x0922('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x48ce8a,'request\x20sent');logger[_0x0922('0xf')](_0x0922('0x10'),_0x48ce8a,_0x0922('0x11'),JSON[_0x0922('0x12')](_0xa849e));if(_0xa849e['error']){if(_0xa849e['error']['code']===0x1f4){logger['error'](_0x0922('0x13'),_0x48ce8a,_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);return _0x33b528(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0xa849e['error'][_0x0922('0x15')]);return _0x10cfb5(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}else{logger['info'](_0x0922('0x13'),_0x48ce8a,_0x0922('0x11'));_0x10cfb5(_0xa849e[_0x0922('0x16')][_0x0922('0x15')]);}})[_0x0922('0x17')](function(_0x4c0e44){logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0x4c0e44);_0x33b528(_0x4c0e44);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 5f50634..6dabcc0 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x43da18,_0x4c4521){var _0x5d72c5=function(_0x2ee73d){while(--_0x2ee73d){_0x43da18['push'](_0x43da18['shift']());}};_0x5d72c5(++_0x4c4521);}(_0x032e,0x124));var _0xe032=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x032e[_0x5ddb1c];return _0x354adc;};'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 fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file +var _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x330a10,_0x32a371){var _0x1d0b53=function(_0x596911){while(--_0x596911){_0x330a10['push'](_0x330a10['shift']());}};_0x1d0b53(++_0x32a371);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x24ca[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 3f24331..3f3c579 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 _0xd0c4=['exports','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0xa8c155,_0x216e02){var _0x1e43cf=function(_0x38ec39){while(--_0x38ec39){_0xa8c155['push'](_0xa8c155['shift']());}};_0x1e43cf(++_0x216e02);}(_0xd0c4,0xd7));var _0x4d0c=function(_0x1ccb6b,_0x4e91e6){_0x1ccb6b=_0x1ccb6b-0x0;var _0x4c316=_0xd0c4[_0x1ccb6b];return _0x4c316;};'use strict';var Sequelize=require(_0x4d0c('0x0'));module[_0x4d0c('0x1')]={'name':{'type':Sequelize[_0x4d0c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4d0c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4d0c('0x4'),_0x4d0c('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x86d4=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory'];(function(_0x32e77d,_0x46cb63){var _0x583d3f=function(_0x30b4dc){while(--_0x30b4dc){_0x32e77d['push'](_0x32e77d['shift']());}};_0x583d3f(++_0x46cb63);}(_0x86d4,0x6d));var _0x486d=function(_0xa197e5,_0x574530){_0xa197e5=_0xa197e5-0x0;var _0xcea285=_0x86d4[_0xa197e5];return _0xcea285;};'use strict';var Sequelize=require(_0x486d('0x0'));module[_0x486d('0x1')]={'name':{'type':Sequelize[_0x486d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x486d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x486d('0x4'),'beepall',_0x486d('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f778b87..0c31d30 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 _0xc5dc=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','ChatQueue','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra'];(function(_0x33a8ee,_0x572c3a){var _0x39f415=function(_0x47078a){while(--_0x47078a){_0x33a8ee['push'](_0x33a8ee['shift']());}};_0x39f415(++_0x572c3a);}(_0xc5dc,0x128));var _0xcc5d=function(_0x748ad0,_0x4cac46){_0x748ad0=_0x748ad0-0x0;var _0xe98ad4=_0xc5dc[_0x748ad0];return _0xe98ad4;};'use strict';var emlformat=require(_0xcc5d('0x0'));var rimraf=require(_0xcc5d('0x1'));var zipdir=require(_0xcc5d('0x2'));var jsonpatch=require(_0xcc5d('0x3'));var rp=require(_0xcc5d('0x4'));var moment=require(_0xcc5d('0x5'));var BPromise=require(_0xcc5d('0x6'));var Mustache=require(_0xcc5d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xcc5d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc5d('0x9'));var _=require(_0xcc5d('0xa'));var squel=require(_0xcc5d('0xb'));var crypto=require(_0xcc5d('0xc'));var jsforce=require(_0xcc5d('0xd'));var deskjs=require(_0xcc5d('0xe'));var toCsv=require(_0xcc5d('0xf'));var querystring=require('querystring');var Papa=require(_0xcc5d('0x10'));var Redis=require(_0xcc5d('0x11'));var authService=require(_0xcc5d('0x12'));var qs=require(_0xcc5d('0x13'));var as=require(_0xcc5d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc5d('0x15'))['db'];config['redis']=_[_0xcc5d('0x16')](config[_0xcc5d('0x17')],{'host':_0xcc5d('0x18'),'port':0x18eb});var socket=require(_0xcc5d('0x19'))(new Redis(config[_0xcc5d('0x17')]));require(_0xcc5d('0x1a'))['register'](socket);var jayson=require(_0xcc5d('0x1b'));var client=jayson[_0xcc5d('0x1c')][_0xcc5d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x10a9ce,_0x2820d7,_0x56e666,_0x5a1071){return new BPromise(function(_0x2f8c87,_0xf610c9){var _0x2bfa9f=_0x5a1071||client;return _0x2bfa9f[_0xcc5d('0x1e')](_0x10a9ce,_0x56e666)[_0xcc5d('0x1f')](function(_0xba7c4d){logger[_0xcc5d('0x20')](_0xcc5d('0x21'),_0x2820d7,_0xcc5d('0x22'));logger[_0xcc5d('0x23')](_0xcc5d('0x24'),_0x2820d7,_0xcc5d('0x22'),JSON['stringify'](_0xba7c4d));if(_0xba7c4d[_0xcc5d('0x25')]){if(_0xba7c4d['error'][_0xcc5d('0x26')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2820d7,_0xba7c4d[_0xcc5d('0x25')][_0xcc5d('0x27')]);return _0xf610c9(_0xba7c4d[_0xcc5d('0x25')][_0xcc5d('0x27')]);}logger[_0xcc5d('0x25')](_0xcc5d('0x21'),_0x2820d7,_0xba7c4d[_0xcc5d('0x25')]['message']);return _0x2f8c87(_0xba7c4d[_0xcc5d('0x25')]['message']);}else{logger['info'](_0xcc5d('0x21'),_0x2820d7,_0xcc5d('0x22'));_0x2f8c87(_0xba7c4d[_0xcc5d('0x28')][_0xcc5d('0x27')]);}})['catch'](function(_0x2279f9){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2820d7,_0x2279f9);_0xf610c9(_0x2279f9);});});}function respondWithStatusCode(_0x511bc8,_0x4043e0){_0x4043e0=_0x4043e0||0xcc;return function(_0xb1d23c){if(_0xb1d23c){return _0x511bc8[_0xcc5d('0x29')](_0x4043e0);}return _0x511bc8['status'](_0x4043e0)[_0xcc5d('0x2a')]();};}function respondWithResult(_0x5ac238,_0x365dd4){_0x365dd4=_0x365dd4||0xc8;return function(_0x52162b){if(_0x52162b){return _0x5ac238[_0xcc5d('0x2b')](_0x365dd4)[_0xcc5d('0x2c')](_0x52162b);}};}function respondWithFilteredResult(_0x1d5dd9,_0x4cd204){return function(_0x24ef39){if(_0x24ef39){var _0x517d3e=typeof _0x4cd204[_0xcc5d('0x2d')]===_0xcc5d('0x2e')&&typeof _0x4cd204[_0xcc5d('0x2f')]===_0xcc5d('0x2e');var _0xf9b1b7=_0x24ef39[_0xcc5d('0x30')];var _0xe98f3a=_0x517d3e?0x0:_0x4cd204[_0xcc5d('0x2d')];var _0x2a091c=_0x517d3e?_0x24ef39[_0xcc5d('0x30')]:_0x4cd204[_0xcc5d('0x2d')]+_0x4cd204['limit'];var _0x266270;if(_0x2a091c>=_0xf9b1b7){_0x2a091c=_0xf9b1b7;_0x266270=0xc8;}else{_0x266270=0xce;}_0x1d5dd9[_0xcc5d('0x2b')](_0x266270);return _0x1d5dd9[_0xcc5d('0x31')](_0xcc5d('0x32'),_0xe98f3a+'-'+_0x2a091c+'/'+_0xf9b1b7)[_0xcc5d('0x2c')](_0x24ef39);}return null;};}function patchUpdates(_0x163c74){return function(_0x178566){try{jsonpatch[_0xcc5d('0x33')](_0x178566,_0x163c74,!![]);}catch(_0x1eb06e){return BPromise[_0xcc5d('0x34')](_0x1eb06e);}return _0x178566['save']();};}function saveUpdates(_0xabd69f,_0x6c5a8){return function(_0x94ee5b){if(_0x94ee5b){return _0x94ee5b[_0xcc5d('0x35')](_0xabd69f)[_0xcc5d('0x1f')](function(_0x1dc12b){return _0x1dc12b;});}return null;};}function removeEntity(_0x2cacf9,_0x777bed){return function(_0x4f14b0){if(_0x4f14b0){return _0x4f14b0[_0xcc5d('0x36')]()['then'](function(){var _0x7023ce=_0x4f14b0[_0xcc5d('0x37')]({'plain':!![]});var _0x2fc952=_0xcc5d('0x38');return db['UserProfileResource'][_0xcc5d('0x36')]({'where':{'type':_0x2fc952,'resourceId':_0x7023ce['id']}})[_0xcc5d('0x1f')](function(){return _0x4f14b0;});})[_0xcc5d('0x1f')](function(){_0x2cacf9[_0xcc5d('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4471,_0x1fc7fd){return function(_0xe7dd77){if(!_0xe7dd77){_0x2d4471[_0xcc5d('0x29')](0x194);}return _0xe7dd77;};}function handleError(_0x4a0bbb,_0x306209){_0x306209=_0x306209||0x1f4;return function(_0x27ba13){logger[_0xcc5d('0x25')](_0x27ba13[_0xcc5d('0x39')]);if(_0x27ba13['name']){delete _0x27ba13[_0xcc5d('0x3a')];}_0x4a0bbb[_0xcc5d('0x2b')](_0x306209)[_0xcc5d('0x3b')](_0x27ba13);};}exports[_0xcc5d('0x3c')]=function(_0xf8019b,_0x110b0d){var _0x4246c3={},_0x27c0e1={},_0x390983={'count':0x0,'rows':[]};var _0x121da4=_['map'](db['ChatQueue'][_0xcc5d('0x3d')],function(_0x4596c8){return{'name':_0x4596c8[_0xcc5d('0x3e')],'type':_0x4596c8[_0xcc5d('0x3f')][_0xcc5d('0x40')]};});_0x27c0e1['model']=_[_0xcc5d('0x41')](_0x121da4,_0xcc5d('0x3a'));_0x27c0e1[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0xf8019b['query']);_0x27c0e1[_0xcc5d('0x44')]=_[_0xcc5d('0x45')](_0x27c0e1[_0xcc5d('0x46')],_0x27c0e1['query']);_0x4246c3['attributes']=_[_0xcc5d('0x45')](_0x27c0e1[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x4246c3[_0xcc5d('0x48')]=_0x4246c3[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x4246c3[_0xcc5d('0x48')]:_0x27c0e1[_0xcc5d('0x46')];if(!_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x4246c3[_0xcc5d('0x2f')]=qs[_0xcc5d('0x2f')](_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x4246c3['offset']=qs[_0xcc5d('0x2d')](_0xf8019b['query'][_0xcc5d('0x2d')]);}_0x4246c3['order']=qs[_0xcc5d('0x4c')](_0xf8019b['query']['sort']);_0x4246c3['where']=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0xf8019b[_0xcc5d('0x42')],_0x27c0e1[_0xcc5d('0x44')]),_0x121da4);if(_0xf8019b[_0xcc5d('0x42')]['filter']){_0x4246c3[_0xcc5d('0x4e')]=_['merge'](_0x4246c3[_0xcc5d('0x4e')],{'$or':_['map'](_0x121da4,function(_0x2dfaaa){if(_0x2dfaaa[_0xcc5d('0x3f')]!==_0xcc5d('0x4f')){var _0x2472cd={};_0x2472cd[_0x2dfaaa['name']]={'$like':'%'+_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x50')]+'%'};return _0x2472cd;}})});}_0x4246c3=_['merge']({},_0x4246c3,_0xf8019b['options']);var _0x416b23={'where':_0x4246c3[_0xcc5d('0x4e')]};return db[_0xcc5d('0x51')][_0xcc5d('0x30')](_0x416b23)[_0xcc5d('0x1f')](function(_0x5ad436){_0x390983[_0xcc5d('0x30')]=_0x5ad436;if(_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x52')]){_0x4246c3[_0xcc5d('0x53')]=[{'all':!![]}];}return db[_0xcc5d('0x51')][_0xcc5d('0x54')](_0x4246c3);})[_0xcc5d('0x1f')](function(_0x148cc0){_0x390983[_0xcc5d('0x55')]=_0x148cc0;return _0x390983;})['then'](respondWithFilteredResult(_0x110b0d,_0x4246c3))['catch'](handleError(_0x110b0d,null));};exports[_0xcc5d('0x56')]=function(_0x29a128,_0x41c965){var _0x194c79={'raw':!![],'where':{'id':_0x29a128[_0xcc5d('0x57')]['id']}},_0x5b63ab={};_0x5b63ab['model']=_[_0xcc5d('0x43')](db['ChatQueue'][_0xcc5d('0x3d')]);_0x5b63ab['query']=_[_0xcc5d('0x43')](_0x29a128[_0xcc5d('0x42')]);_0x5b63ab[_0xcc5d('0x44')]=_['intersection'](_0x5b63ab[_0xcc5d('0x46')],_0x5b63ab[_0xcc5d('0x42')]);_0x194c79[_0xcc5d('0x48')]=_['intersection'](_0x5b63ab[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x29a128[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x194c79[_0xcc5d('0x48')]=_0x194c79[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x194c79[_0xcc5d('0x48')]:_0x5b63ab['model'];if(_0x29a128[_0xcc5d('0x42')][_0xcc5d('0x52')]){_0x194c79[_0xcc5d('0x53')]=[{'all':!![]}];}_0x194c79=_[_0xcc5d('0x58')]({},_0x194c79,_0x29a128[_0xcc5d('0x59')]);return db[_0xcc5d('0x51')][_0xcc5d('0x5a')](_0x194c79)[_0xcc5d('0x1f')](handleEntityNotFound(_0x41c965,null))[_0xcc5d('0x1f')](respondWithResult(_0x41c965,null))[_0xcc5d('0x5b')](handleError(_0x41c965,null));};exports['create']=function(_0x3352fb,_0x15ac6b){return db['ChatQueue'][_0xcc5d('0x5c')](_0x3352fb[_0xcc5d('0x5d')],{})[_0xcc5d('0x1f')](function(_0xf14a12){var _0x26d9a4=_0x3352fb[_0xcc5d('0x5e')][_0xcc5d('0x37')]({'plain':!![]});if(!_0x26d9a4)throw new Error(_0xcc5d('0x5f'));if(_0x26d9a4['role']===_0xcc5d('0x5e')){var _0x41566b=_0xf14a12[_0xcc5d('0x37')]({'plain':!![]});var _0x43fa99=_0xcc5d('0x38');return db[_0xcc5d('0x60')]['find']({'where':{'name':_0x43fa99,'userProfileId':_0x26d9a4['userProfileId']},'raw':!![]})[_0xcc5d('0x1f')](function(_0x53d669){if(_0x53d669&&_0x53d669[_0xcc5d('0x61')]===0x0){return db[_0xcc5d('0x62')]['create']({'name':_0x41566b[_0xcc5d('0x3a')],'resourceId':_0x41566b['id'],'type':_0x53d669[_0xcc5d('0x3a')],'sectionId':_0x53d669['id']},{})[_0xcc5d('0x1f')](function(){return _0xf14a12;});}else{return _0xf14a12;}})['catch'](function(_0x5b87a6){logger['error'](_0xcc5d('0x63'),_0x5b87a6);throw _0x5b87a6;});}return _0xf14a12;})['then'](respondWithResult(_0x15ac6b,0xc9))['catch'](handleError(_0x15ac6b,null));};exports[_0xcc5d('0x35')]=function(_0x1b9bd9,_0x41f224){if(_0x1b9bd9[_0xcc5d('0x5d')]['id']){delete _0x1b9bd9['body']['id'];}return db[_0xcc5d('0x51')][_0xcc5d('0x5a')]({'where':{'id':_0x1b9bd9['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x41f224,null))['then'](saveUpdates(_0x1b9bd9[_0xcc5d('0x5d')],null))['then'](respondWithResult(_0x41f224,null))[_0xcc5d('0x5b')](handleError(_0x41f224,null));};exports['destroy']=function(_0x2b8d55,_0x535253){return db['ChatQueue'][_0xcc5d('0x5a')]({'where':{'id':_0x2b8d55['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x535253,null))[_0xcc5d('0x1f')](removeEntity(_0x535253,null))[_0xcc5d('0x5b')](handleError(_0x535253,null));};exports['describe']=function(_0x44823,_0x2b7d33){return db[_0xcc5d('0x51')][_0xcc5d('0x64')]()[_0xcc5d('0x1f')](respondWithResult(_0x2b7d33,null))[_0xcc5d('0x5b')](handleError(_0x2b7d33,null));};exports[_0xcc5d('0x65')]=function(_0x57efca,_0x1d9dd8,_0x204048){var _0x54cb1c={'raw':!![],'where':{}},_0x3b815c={},_0x4de6d7;return db['ChatQueue'][_0xcc5d('0x66')]({'where':{'id':_0x57efca[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x1d9dd8,null))[_0xcc5d('0x1f')](function(_0x542c55){if(_0x542c55){_0x4de6d7=_0x542c55[_0xcc5d('0x37')]({'plain':!![]});_0x3b815c[_0xcc5d('0x46')]=_['keys'](db[_0xcc5d('0x67')][_0xcc5d('0x3d')]);_0x3b815c['query']=_[_0xcc5d('0x43')](_0x57efca[_0xcc5d('0x42')]);_0x3b815c['filters']=_[_0xcc5d('0x45')](_0x3b815c[_0xcc5d('0x46')],_0x3b815c['query']);_0x54cb1c['attributes']=_[_0xcc5d('0x45')](_0x3b815c[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x54cb1c[_0xcc5d('0x48')]=_0x54cb1c[_0xcc5d('0x48')]['length']?_0x54cb1c[_0xcc5d('0x48')]:_0x3b815c['model'];if(!_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x4a')]('nolimit')){_0x54cb1c['limit']=qs[_0xcc5d('0x2f')](_0x57efca[_0xcc5d('0x42')]['limit']);_0x54cb1c[_0xcc5d('0x2d')]=qs[_0xcc5d('0x2d')](_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x2d')]);}_0x54cb1c[_0xcc5d('0x68')]=qs[_0xcc5d('0x4c')](_0x57efca['query']['sort']);_0x54cb1c[_0xcc5d('0x4e')]=qs['filters'](_[_0xcc5d('0x4d')](_0x57efca[_0xcc5d('0x42')],_0x3b815c[_0xcc5d('0x44')]));_0x54cb1c[_0xcc5d('0x4e')][_0xcc5d('0x69')]=_0x542c55['id'];if(_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x50')]){_0x54cb1c[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x54cb1c[_0xcc5d('0x4e')],{'$or':_[_0xcc5d('0x41')](_0x54cb1c[_0xcc5d('0x48')],function(_0x522470){var _0x5d93ec={};_0x5d93ec[_0x522470]={'$like':'%'+_0x57efca[_0xcc5d('0x42')]['filter']+'%'};return _0x5d93ec;})});}_0x54cb1c=_[_0xcc5d('0x58')]({},_0x54cb1c,_0x57efca[_0xcc5d('0x59')]);return db['UserChatQueue']['findAll'](_0x54cb1c);}})[_0xcc5d('0x1f')](function(_0x3adf90){if(_0x3adf90){return db[_0xcc5d('0x6a')][_0xcc5d('0x6b')]({'where':{'id':_['map'](_0x3adf90,'UserId'),'role':_0xcc5d('0x6c')},'attributes':['id',_0xcc5d('0x3a'),_0xcc5d('0x6d'),_0xcc5d('0x6e'),_0xcc5d('0x6f')]});}})[_0xcc5d('0x1f')](function(_0x20ffa3){if(_0x20ffa3){return{'count':_0x20ffa3[_0xcc5d('0x30')],'rows':_['map'](_0x20ffa3['rows'],function(_0x4ac3a6){return{'membername':_0x4ac3a6[_0xcc5d('0x3a')],'UserId':_0x4ac3a6['id'],'queue_name':_0x4de6d7['name'],'ChatQueueId':_0x4de6d7['id'],'interface':util['format']('%s/%s',_0xcc5d('0x70'),_0x4ac3a6[_0xcc5d('0x3a')]),'penalty':0x0,'paused':_0x4ac3a6['chatPause'],'createdAt':_0x4ac3a6[_0xcc5d('0x6f')],'updatedAt':_0x4ac3a6[_0xcc5d('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcc5d('0x1f')](respondWithFilteredResult(_0x1d9dd8,_0x54cb1c))['catch'](handleError(_0x1d9dd8,null));};exports[_0xcc5d('0x71')]=function(_0x1c8d9f,_0x340f94,_0x568db0){var _0x15ca04={};var _0x2b064b={};var _0x631a80;var _0x4c99c4;return db[_0xcc5d('0x51')][_0xcc5d('0x66')]({'where':{'id':_0x1c8d9f[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x340f94,null))[_0xcc5d('0x1f')](function(_0x3cd7a8){if(_0x3cd7a8){_0x631a80=_0x3cd7a8;_0x2b064b[_0xcc5d('0x46')]=_[_0xcc5d('0x43')](db[_0xcc5d('0x72')][_0xcc5d('0x3d')]);_0x2b064b[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0x1c8d9f[_0xcc5d('0x42')]);_0x2b064b[_0xcc5d('0x44')]=_[_0xcc5d('0x45')](_0x2b064b['model'],_0x2b064b['query']);_0x15ca04['attributes']=_[_0xcc5d('0x45')](_0x2b064b['model'],qs[_0xcc5d('0x47')](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x15ca04[_0xcc5d('0x48')]=_0x15ca04[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x15ca04['attributes']:_0x2b064b[_0xcc5d('0x46')];_0x15ca04['order']=qs[_0xcc5d('0x4c')](_0x1c8d9f['query'][_0xcc5d('0x4c')]);_0x15ca04[_0xcc5d('0x4e')]=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0x1c8d9f['query'],_0x2b064b['filters']));if(_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x50')]){_0x15ca04[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x15ca04['where'],{'$or':_[_0xcc5d('0x41')](_0x15ca04['attributes'],function(_0x446412){var _0xbde76e={};_0xbde76e[_0x446412]={'$like':'%'+_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x50')]+'%'};return _0xbde76e;})});}_0x15ca04=_['merge']({},_0x15ca04,_0x1c8d9f['options']);return _0x631a80[_0xcc5d('0x71')](_0x15ca04);}})[_0xcc5d('0x1f')](function(_0x5c54c0){if(_0x5c54c0){_0x4c99c4=_0x5c54c0[_0xcc5d('0x49')];if(!_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x15ca04['limit']=qs[_0xcc5d('0x2f')](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x15ca04[_0xcc5d('0x2d')]=qs['offset'](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x2d')]);}return _0x631a80[_0xcc5d('0x71')](_0x15ca04);}})[_0xcc5d('0x1f')](function(_0x1ed9a7){if(_0x1ed9a7){return _0x1ed9a7?{'count':_0x4c99c4,'rows':_0x1ed9a7}:null;}})['then'](respondWithResult(_0x340f94,null))[_0xcc5d('0x5b')](handleError(_0x340f94,null));};exports[_0xcc5d('0x73')]=function(_0x1cb8e5,_0x296944,_0x9f4471){var _0x2ee8dd=_0x1cb8e5[_0xcc5d('0x5d')][_0xcc5d('0x74')];return db[_0xcc5d('0x72')][_0xcc5d('0x54')]({'where':{'id':_0x2ee8dd},'attributes':['id'],'include':[{'model':db[_0xcc5d('0x6a')],'as':_0xcc5d('0x75'),'attributes':['id',_0xcc5d('0x3a'),_0xcc5d('0x76'),'voicePause',_0xcc5d('0x77')],'raw':!![]}]})[_0xcc5d('0x1f')](function(_0x1867ba){if(_0x1867ba){var _0x1ac8ac=_[_0xcc5d('0x78')](_0x1867ba,function(_0x1f428c){var _0x5f2b05=_0x1f428c['get']({'plain':!![]});return _0x5f2b05[_0xcc5d('0x75')];});return db['ChatQueue'][_0xcc5d('0x5a')]({'where':{'id':_0x1cb8e5[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](function(_0x2915c0){return db[_0xcc5d('0x79')][_0xcc5d('0x7a')](function(_0x13e6a1){return _0x2915c0[_0xcc5d('0x73')](_0x2ee8dd,{'transaction':_0x13e6a1})[_0xcc5d('0x1f')](function(){return BPromise[_0xcc5d('0x7b')](_0x1ac8ac,function(_0x51c5f1){return db[_0xcc5d('0x67')][_0xcc5d('0x7c')]({'where':{'UserId':_0x51c5f1['id'],'ChatQueueId':_0x1cb8e5[_0xcc5d('0x57')]['id']},'transaction':_0x13e6a1});});})[_0xcc5d('0x1f')](function(){_0x1ac8ac[_0xcc5d('0x7d')](function(_0x90cb6e){socket[_0xcc5d('0x7e')](_0xcc5d('0x7f'),{'UserId':_0x90cb6e['id'],'ChatQueueId':_0x2915c0['id']});});});});});}})['then'](respondWithStatusCode(_0x296944,null))[_0xcc5d('0x5b')](handleError(_0x296944,null));};exports[_0xcc5d('0x80')]=function(_0x8075a3,_0x4358df,_0x57bb6e){return db['Team'][_0xcc5d('0x54')]({'where':{'id':_0x8075a3[_0xcc5d('0x42')][_0xcc5d('0x74')]},'attributes':['id'],'include':[{'model':db[_0xcc5d('0x6a')],'as':_0xcc5d('0x75'),'attributes':['id'],'raw':!![]}]})[_0xcc5d('0x1f')](handleEntityNotFound(_0x4358df,null))[_0xcc5d('0x1f')](function(_0x200f56){var _0x33a051=_['map'](_0x200f56,'id');var _0x2cb6fc=[];var _0x4ad60e=[];var _0x1567d2=squel['select']();_0x1567d2[_0xcc5d('0x81')](_0xcc5d('0x82'))[_0xcc5d('0x83')](_0xcc5d('0x84'),'tq')[_0xcc5d('0x85')]('user_has_teams','ut',_0xcc5d('0x86'))[_0xcc5d('0x4e')](_0xcc5d('0x87'),_0x8075a3[_0xcc5d('0x57')]['id']);for(var _0x3faf53=0x0;_0x3faf53<_0x200f56['length'];_0x3faf53+=0x1){let _0x4d6ea5=_0x200f56[_0x3faf53];for(var _0x145782=0x0;_0x145782<_0x4d6ea5['Agents'][_0xcc5d('0x49')];_0x145782+=0x1){let _0x545202=_0x4d6ea5[_0xcc5d('0x75')][_0x145782];var _0x313794=_0x1567d2[_0xcc5d('0x88')]();_0x313794[_0xcc5d('0x4e')](_0xcc5d('0x89'),_0x545202['id']);_0x4ad60e[_0xcc5d('0x8a')](db['sequelize'][_0xcc5d('0x42')](_0x313794['toString'](),{'type':db['sequelize'][_0xcc5d('0x8b')]['SELECT']})[_0xcc5d('0x1f')](function(_0xf8404b){if(_0xf8404b[_0xcc5d('0x49')]===0x1){return _0x545202['id'];}else{var _0x384d01=_[_0xcc5d('0x8c')](_[_0xcc5d('0x41')](_0xf8404b,'TeamId'),function(_0x4b60b4){return _[_0xcc5d('0x8d')](_0x33a051,_0x4b60b4);});if(_0x384d01){return _0x545202['id'];}}}));}}return BPromise[_0xcc5d('0x8e')](_0x4ad60e)[_0xcc5d('0x1f')](function(_0x37dc65){_0x2cb6fc=_(_0x2cb6fc)[_0xcc5d('0x8f')](_0x37dc65)['compact']()[_0xcc5d('0x90')]();return db[_0xcc5d('0x51')]['find']({'where':{'id':_0x8075a3[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](function(_0xf1becf){return db['sequelize'][_0xcc5d('0x7a')](function(_0x512e39){return _0xf1becf[_0xcc5d('0x80')](_0x8075a3['query']['ids'],{'transaction':_0x512e39})[_0xcc5d('0x1f')](function(){if(!_[_0xcc5d('0x91')](_0x2cb6fc)){return _0xf1becf[_0xcc5d('0x92')](_0x2cb6fc,{'transaction':_0x512e39});}})[_0xcc5d('0x1f')](function(){_0x2cb6fc[_0xcc5d('0x7d')](function(_0x39a4b1){socket[_0xcc5d('0x7e')](_0xcc5d('0x93'),{'UserId':_0x39a4b1,'ChatQueueId':_0xf1becf['id']});});});});});});})[_0xcc5d('0x1f')](respondWithStatusCode(_0x4358df,null))[_0xcc5d('0x5b')](handleError(_0x4358df,null));};exports['addAgents']=function(_0x470c9b,_0x272def,_0x484f18){return db[_0xcc5d('0x51')][_0xcc5d('0x5a')]({'where':{'id':_0x470c9b[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x272def,null))[_0xcc5d('0x1f')](function(_0x4fa6fe){if(_0x4fa6fe){return _0x4fa6fe[_0xcc5d('0x94')](_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')],_[_0xcc5d('0x95')](_0x470c9b[_0xcc5d('0x5d')],[_0xcc5d('0x74'),'id'])||{})[_0xcc5d('0x96')](function(_0x583947){for(var _0x5dca26=0x0;_0x5dca26<_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')][_0xcc5d('0x49')];_0x5dca26+=0x1){socket['emit'](_0xcc5d('0x7f'),{'UserId':Number(_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')][_0x5dca26]),'ChatQueueId':Number(_0x470c9b[_0xcc5d('0x57')]['id'])});}return _0x583947;});}})[_0xcc5d('0x1f')](respondWithResult(_0x272def,null))[_0xcc5d('0x5b')](handleError(_0x272def,null));};exports[_0xcc5d('0x92')]=function(_0x406c4f,_0x314b6c,_0x18a812){return db[_0xcc5d('0x51')]['find']({'where':{'id':_0x406c4f['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x314b6c,null))[_0xcc5d('0x1f')](function(_0x1e1ab8){if(_0x1e1ab8){return _0x1e1ab8['removeAgents'](_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')])['then'](function(){if(_[_0xcc5d('0x97')](_0x406c4f['query']['ids'])){for(var _0x40ddb7=0x0;_0x40ddb7<_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')][_0xcc5d('0x49')];_0x40ddb7+=0x1){socket[_0xcc5d('0x7e')](_0xcc5d('0x93'),{'UserId':Number(_0x406c4f[_0xcc5d('0x42')]['ids'][_0x40ddb7]),'ChatQueueId':Number(_0x406c4f[_0xcc5d('0x57')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')]),'ChatQueueId':Number(_0x406c4f[_0xcc5d('0x57')]['id'])});}});}})[_0xcc5d('0x1f')](respondWithStatusCode(_0x314b6c,null))['catch'](handleError(_0x314b6c,null));};exports[_0xcc5d('0x98')]=function(_0x41a7bd,_0x4ca663,_0xde427f){var _0x112b9c={};var _0x544eaa={};var _0x236c26;var _0x3df766;return db['ChatQueue'][_0xcc5d('0x66')]({'where':{'id':_0x41a7bd[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x4ca663,null))['then'](function(_0x3f2d6f){if(_0x3f2d6f){_0x236c26=_0x3f2d6f;_0x544eaa['model']=_['keys'](db[_0xcc5d('0x6a')][_0xcc5d('0x3d')]);_0x544eaa[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0x41a7bd[_0xcc5d('0x42')]);_0x544eaa['filters']=_['intersection'](_0x544eaa[_0xcc5d('0x46')],_0x544eaa[_0xcc5d('0x42')]);_0x112b9c[_0xcc5d('0x48')]=_[_0xcc5d('0x45')](_0x544eaa[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x112b9c[_0xcc5d('0x48')]=_0x112b9c[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x112b9c[_0xcc5d('0x48')]:_0x544eaa[_0xcc5d('0x46')];_0x112b9c[_0xcc5d('0x68')]=qs[_0xcc5d('0x4c')](_0x41a7bd[_0xcc5d('0x42')]['sort']);_0x112b9c[_0xcc5d('0x4e')]=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0x41a7bd['query'],_0x544eaa['filters']));if(_0x41a7bd['query']['filter']){_0x112b9c[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x112b9c[_0xcc5d('0x4e')],{'$or':_['map'](_0x112b9c[_0xcc5d('0x48')],function(_0x201812){var _0x568bc0={};_0x568bc0[_0x201812]={'$like':'%'+_0x41a7bd['query'][_0xcc5d('0x50')]+'%'};return _0x568bc0;})});}_0x112b9c=_[_0xcc5d('0x58')]({},_0x112b9c,_0x41a7bd[_0xcc5d('0x59')]);return _0x236c26[_0xcc5d('0x98')](_0x112b9c);}})[_0xcc5d('0x1f')](function(_0x57fdf6){if(_0x57fdf6){_0x3df766=_0x57fdf6[_0xcc5d('0x49')];if(!_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x112b9c[_0xcc5d('0x2f')]=qs[_0xcc5d('0x2f')](_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x112b9c['offset']=qs['offset'](_0x41a7bd['query'][_0xcc5d('0x2d')]);}return _0x236c26[_0xcc5d('0x98')](_0x112b9c);}})[_0xcc5d('0x1f')](function(_0x19a822){if(_0x19a822){return _0x19a822?{'count':_0x3df766,'rows':_0x19a822}:null;}})[_0xcc5d('0x1f')](respondWithResult(_0x4ca663,null))[_0xcc5d('0x5b')](handleError(_0x4ca663,null));}; \ No newline at end of file +var _0xdcec=['omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','nolimit','addTeams','ids','User','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','sequelize','removeAgents','userChatQueue:remove'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdcec,0x1c0));var _0xcdce=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xdcec[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0xcdce('0x0'));var rimraf=require(_0xcdce('0x1'));var zipdir=require(_0xcdce('0x2'));var jsonpatch=require(_0xcdce('0x3'));var rp=require(_0xcdce('0x4'));var moment=require(_0xcdce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcdce('0x6'));var path=require(_0xcdce('0x7'));var sox=require('sox');var csv=require(_0xcdce('0x8'));var ejs=require(_0xcdce('0x9'));var fs=require('fs');var fs_extra=require(_0xcdce('0xa'));var _=require(_0xcdce('0xb'));var squel=require('squel');var crypto=require(_0xcdce('0xc'));var jsforce=require(_0xcdce('0xd'));var deskjs=require(_0xcdce('0xe'));var toCsv=require(_0xcdce('0x8'));var querystring=require(_0xcdce('0xf'));var Papa=require(_0xcdce('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdce('0x12'));var utils=require(_0xcdce('0x13'));var config=require(_0xcdce('0x14'));var licenseUtil=require(_0xcdce('0x15'));var db=require(_0xcdce('0x16'))['db'];config['redis']=_[_0xcdce('0x17')](config[_0xcdce('0x18')],{'host':_0xcdce('0x19'),'port':0x18eb});var socket=require(_0xcdce('0x1a'))(new Redis(config['redis']));require(_0xcdce('0x1b'))[_0xcdce('0x1c')](socket);var jayson=require(_0xcdce('0x1d'));var client=jayson[_0xcdce('0x1e')][_0xcdce('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1cefd4,_0x5aae4e,_0x584f83,_0x4bd8fc){return new BPromise(function(_0x507dbe,_0x16075a){var _0x12e549=_0x4bd8fc||client;return _0x12e549[_0xcdce('0x20')](_0x1cefd4,_0x584f83)[_0xcdce('0x21')](function(_0x2e4b73){logger[_0xcdce('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'),JSON['stringify'](_0x2e4b73));if(_0x2e4b73[_0xcdce('0x24')]){if(_0x2e4b73['error'][_0xcdce('0x25')]===0x1f4){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73['error']['message']);return _0x16075a(_0x2e4b73[_0xcdce('0x24')]['message']);}logger['error'](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);return _0x507dbe(_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);}else{logger[_0xcdce('0x22')](_0xcdce('0x26'),_0x5aae4e,_0xcdce('0x23'));_0x507dbe(_0x2e4b73[_0xcdce('0x28')][_0xcdce('0x27')]);}})['catch'](function(_0x1b5740){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x1b5740);_0x16075a(_0x1b5740);});});}function respondWithStatusCode(_0x253b2a,_0x1d0e08){_0x1d0e08=_0x1d0e08||0xcc;return function(_0x559049){if(_0x559049){return _0x253b2a[_0xcdce('0x29')](_0x1d0e08);}return _0x253b2a[_0xcdce('0x2a')](_0x1d0e08)[_0xcdce('0x2b')]();};}function respondWithResult(_0xed7ad1,_0x35eb6b){_0x35eb6b=_0x35eb6b||0xc8;return function(_0x26bfed){if(_0x26bfed){return _0xed7ad1[_0xcdce('0x2a')](_0x35eb6b)[_0xcdce('0x2c')](_0x26bfed);}};}function respondWithFilteredResult(_0x38ce67,_0x3a1a4a){return function(_0x239512){if(_0x239512){var _0x1f813e=typeof _0x3a1a4a[_0xcdce('0x2d')]==='undefined'&&typeof _0x3a1a4a['limit']===_0xcdce('0x2e');var _0x277700=_0x239512['count'];var _0x56a7d4=_0x1f813e?0x0:_0x3a1a4a[_0xcdce('0x2d')];var _0x3db934=_0x1f813e?_0x239512[_0xcdce('0x2f')]:_0x3a1a4a[_0xcdce('0x2d')]+_0x3a1a4a['limit'];var _0xb93332;if(_0x3db934>=_0x277700){_0x3db934=_0x277700;_0xb93332=0xc8;}else{_0xb93332=0xce;}_0x38ce67[_0xcdce('0x2a')](_0xb93332);return _0x38ce67[_0xcdce('0x30')](_0xcdce('0x31'),_0x56a7d4+'-'+_0x3db934+'/'+_0x277700)[_0xcdce('0x2c')](_0x239512);}return null;};}function patchUpdates(_0x199883){return function(_0x446fe0){try{jsonpatch[_0xcdce('0x32')](_0x446fe0,_0x199883,!![]);}catch(_0x59c946){return BPromise['reject'](_0x59c946);}return _0x446fe0[_0xcdce('0x33')]();};}function saveUpdates(_0x45778b,_0x4eb92e){return function(_0x3d4cf0){if(_0x3d4cf0){return _0x3d4cf0[_0xcdce('0x34')](_0x45778b)['then'](function(_0x334822){return _0x334822;});}return null;};}function removeEntity(_0x370c54,_0x5a5cf0){return function(_0x102792){if(_0x102792){return _0x102792[_0xcdce('0x35')]()['then'](function(){var _0x3a55f5=_0x102792[_0xcdce('0x36')]({'plain':!![]});var _0x272f2b=_0xcdce('0x37');return db[_0xcdce('0x38')][_0xcdce('0x35')]({'where':{'type':_0x272f2b,'resourceId':_0x3a55f5['id']}})[_0xcdce('0x21')](function(){return _0x102792;});})[_0xcdce('0x21')](function(){_0x370c54['status'](0xcc)[_0xcdce('0x2b')]();});}};}function handleEntityNotFound(_0x540fa5,_0x4a74c2){return function(_0xf0d427){if(!_0xf0d427){_0x540fa5[_0xcdce('0x29')](0x194);}return _0xf0d427;};}function handleError(_0x26996,_0x3c9db4){_0x3c9db4=_0x3c9db4||0x1f4;return function(_0x9490c9){logger[_0xcdce('0x24')](_0x9490c9[_0xcdce('0x39')]);if(_0x9490c9[_0xcdce('0x3a')]){delete _0x9490c9[_0xcdce('0x3a')];}_0x26996['status'](_0x3c9db4)['send'](_0x9490c9);};}exports[_0xcdce('0x3b')]=function(_0x34783d,_0x132181){var _0x498cb0={},_0x196c33={},_0x70c391={'count':0x0,'rows':[]};var _0x2dc2af=_[_0xcdce('0x3c')](db[_0xcdce('0x3d')]['rawAttributes'],function(_0x3692d2){return{'name':_0x3692d2[_0xcdce('0x3e')],'type':_0x3692d2[_0xcdce('0x3f')][_0xcdce('0x40')]};});_0x196c33[_0xcdce('0x41')]=_[_0xcdce('0x3c')](_0x2dc2af,_0xcdce('0x3a'));_0x196c33[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x34783d['query']);_0x196c33[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x196c33[_0xcdce('0x41')],_0x196c33[_0xcdce('0x42')]);_0x498cb0[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x196c33['model'],qs[_0xcdce('0x47')](_0x34783d['query']['fields']));_0x498cb0['attributes']=_0x498cb0[_0xcdce('0x46')]['length']?_0x498cb0[_0xcdce('0x46')]:_0x196c33['model'];if(!_0x34783d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x498cb0[_0xcdce('0x49')]=qs['limit'](_0x34783d[_0xcdce('0x42')]['limit']);_0x498cb0['offset']=qs[_0xcdce('0x2d')](_0x34783d['query']['offset']);}_0x498cb0['order']=qs[_0xcdce('0x4a')](_0x34783d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x498cb0[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x34783d[_0xcdce('0x42')],_0x196c33[_0xcdce('0x44')]),_0x2dc2af);if(_0x34783d['query']['filter']){_0x498cb0[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x498cb0[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x2dc2af,function(_0x5dca90){if(_0x5dca90[_0xcdce('0x3f')]!==_0xcdce('0x4e')){var _0xb135de={};_0xb135de[_0x5dca90[_0xcdce('0x3a')]]={'$like':'%'+_0x34783d[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0xb135de;}})});}_0x498cb0=_[_0xcdce('0x4d')]({},_0x498cb0,_0x34783d[_0xcdce('0x50')]);var _0x3d56ce={'where':_0x498cb0[_0xcdce('0x4b')]};return db[_0xcdce('0x3d')][_0xcdce('0x2f')](_0x3d56ce)[_0xcdce('0x21')](function(_0x10d3ff){_0x70c391[_0xcdce('0x2f')]=_0x10d3ff;if(_0x34783d[_0xcdce('0x42')][_0xcdce('0x51')]){_0x498cb0[_0xcdce('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xcdce('0x53')](_0x498cb0);})[_0xcdce('0x21')](function(_0x61d3ea){_0x70c391[_0xcdce('0x54')]=_0x61d3ea;return _0x70c391;})[_0xcdce('0x21')](respondWithFilteredResult(_0x132181,_0x498cb0))[_0xcdce('0x55')](handleError(_0x132181,null));};exports[_0xcdce('0x56')]=function(_0x5d1440,_0x1b64d8){var _0x2c197b={'raw':!![],'where':{'id':_0x5d1440[_0xcdce('0x57')]['id']}},_0x22183f={};_0x22183f['model']=_[_0xcdce('0x43')](db[_0xcdce('0x3d')][_0xcdce('0x58')]);_0x22183f[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x5d1440[_0xcdce('0x42')]);_0x22183f[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],_0x22183f[_0xcdce('0x42')]);_0x2c197b['attributes']=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x5d1440[_0xcdce('0x42')][_0xcdce('0x47')]));_0x2c197b[_0xcdce('0x46')]=_0x2c197b[_0xcdce('0x46')][_0xcdce('0x59')]?_0x2c197b[_0xcdce('0x46')]:_0x22183f['model'];if(_0x5d1440[_0xcdce('0x42')]['includeAll']){_0x2c197b[_0xcdce('0x52')]=[{'all':!![]}];}_0x2c197b=_['merge']({},_0x2c197b,_0x5d1440['options']);return db['ChatQueue']['find'](_0x2c197b)['then'](handleEntityNotFound(_0x1b64d8,null))[_0xcdce('0x21')](respondWithResult(_0x1b64d8,null))[_0xcdce('0x55')](handleError(_0x1b64d8,null));};exports[_0xcdce('0x5a')]=function(_0x121655,_0x137d2f){return db['ChatQueue'][_0xcdce('0x5a')](_0x121655['body'],{})[_0xcdce('0x21')](function(_0x3bb6c7){var _0x24c18c=_0x121655['user'][_0xcdce('0x36')]({'plain':!![]});if(!_0x24c18c)throw new Error(_0xcdce('0x5b'));if(_0x24c18c[_0xcdce('0x5c')]===_0xcdce('0x5d')){var _0x45cfc9=_0x3bb6c7[_0xcdce('0x36')]({'plain':!![]});var _0x535cc7='ChatQueues';return db[_0xcdce('0x5e')][_0xcdce('0x5f')]({'where':{'name':_0x535cc7,'userProfileId':_0x24c18c['userProfileId']},'raw':!![]})[_0xcdce('0x21')](function(_0x1288ff){if(_0x1288ff&&_0x1288ff['autoAssociation']===0x0){return db[_0xcdce('0x38')][_0xcdce('0x5a')]({'name':_0x45cfc9[_0xcdce('0x3a')],'resourceId':_0x45cfc9['id'],'type':_0x1288ff[_0xcdce('0x3a')],'sectionId':_0x1288ff['id']},{})['then'](function(){return _0x3bb6c7;});}else{return _0x3bb6c7;}})[_0xcdce('0x55')](function(_0x1fc1cc){logger['error'](_0xcdce('0x60'),_0x1fc1cc);throw _0x1fc1cc;});}return _0x3bb6c7;})[_0xcdce('0x21')](respondWithResult(_0x137d2f,0xc9))[_0xcdce('0x55')](handleError(_0x137d2f,null));};exports['update']=function(_0x56cb09,_0x53bdd0){if(_0x56cb09[_0xcdce('0x61')]['id']){delete _0x56cb09[_0xcdce('0x61')]['id'];}return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x56cb09[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x53bdd0,null))[_0xcdce('0x21')](saveUpdates(_0x56cb09['body'],null))[_0xcdce('0x21')](respondWithResult(_0x53bdd0,null))[_0xcdce('0x55')](handleError(_0x53bdd0,null));};exports[_0xcdce('0x35')]=function(_0x150f7f,_0x362ed1){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x150f7f[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x362ed1,null))[_0xcdce('0x21')](removeEntity(_0x362ed1,null))[_0xcdce('0x55')](handleError(_0x362ed1,null));};exports[_0xcdce('0x62')]=function(_0x515bbe,_0x37791c){return db['ChatQueue'][_0xcdce('0x62')]()['then'](respondWithResult(_0x37791c,null))[_0xcdce('0x55')](handleError(_0x37791c,null));};exports[_0xcdce('0x63')]=function(_0x2581b0,_0x54c99e,_0x175677){var _0x1b8f0d={'raw':!![],'where':{}},_0x247418={},_0x598d78;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x2581b0[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54c99e,null))[_0xcdce('0x21')](function(_0x28ca70){if(_0x28ca70){_0x598d78=_0x28ca70[_0xcdce('0x36')]({'plain':!![]});_0x247418['model']=_[_0xcdce('0x43')](db[_0xcdce('0x65')][_0xcdce('0x58')]);_0x247418[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x2581b0[_0xcdce('0x42')]);_0x247418[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x247418[_0xcdce('0x41')],_0x247418[_0xcdce('0x42')]);_0x1b8f0d[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x247418['model'],qs['fields'](_0x2581b0[_0xcdce('0x42')]['fields']));_0x1b8f0d[_0xcdce('0x46')]=_0x1b8f0d['attributes']['length']?_0x1b8f0d['attributes']:_0x247418[_0xcdce('0x41')];if(!_0x2581b0['query'][_0xcdce('0x48')]('nolimit')){_0x1b8f0d[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x49')]);_0x1b8f0d[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x2581b0[_0xcdce('0x42')]['offset']);}_0x1b8f0d[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x1b8f0d[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x2581b0[_0xcdce('0x42')],_0x247418[_0xcdce('0x44')]));_0x1b8f0d['where'][_0xcdce('0x67')]=_0x28ca70['id'];if(_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x1b8f0d[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x1b8f0d['where'],{'$or':_[_0xcdce('0x3c')](_0x1b8f0d[_0xcdce('0x46')],function(_0x436999){var _0x4912c1={};_0x4912c1[_0x436999]={'$like':'%'+_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0x4912c1;})});}_0x1b8f0d=_[_0xcdce('0x4d')]({},_0x1b8f0d,_0x2581b0['options']);return db[_0xcdce('0x65')]['findAll'](_0x1b8f0d);}})[_0xcdce('0x21')](function(_0x2f2fee){if(_0x2f2fee){return db['User'][_0xcdce('0x68')]({'where':{'id':_[_0xcdce('0x3c')](_0x2f2fee,_0xcdce('0x69')),'role':_0xcdce('0x6a')},'attributes':['id',_0xcdce('0x3a'),'chatPause',_0xcdce('0x6b'),_0xcdce('0x6c')]});}})['then'](function(_0x41645b){if(_0x41645b){return{'count':_0x41645b[_0xcdce('0x2f')],'rows':_[_0xcdce('0x3c')](_0x41645b[_0xcdce('0x54')],function(_0x59c377){return{'membername':_0x59c377['name'],'UserId':_0x59c377['id'],'queue_name':_0x598d78['name'],'ChatQueueId':_0x598d78['id'],'interface':util[_0xcdce('0x6d')](_0xcdce('0x6e'),_0xcdce('0x6f'),_0x59c377[_0xcdce('0x3a')]),'penalty':0x0,'paused':_0x59c377[_0xcdce('0x70')],'createdAt':_0x59c377['createdAt'],'updatedAt':_0x59c377['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdce('0x21')](respondWithFilteredResult(_0x54c99e,_0x1b8f0d))[_0xcdce('0x55')](handleError(_0x54c99e,null));};exports['getTeams']=function(_0x69d77c,_0x54e3af,_0x18196b){var _0x5918ad={};var _0x36e207={};var _0x1e8289;var _0x55f2c1;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x69d77c[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54e3af,null))[_0xcdce('0x21')](function(_0x34d502){if(_0x34d502){_0x1e8289=_0x34d502;_0x36e207[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x71')][_0xcdce('0x58')]);_0x36e207[_0xcdce('0x42')]=_['keys'](_0x69d77c[_0xcdce('0x42')]);_0x36e207[_0xcdce('0x44')]=_['intersection'](_0x36e207['model'],_0x36e207[_0xcdce('0x42')]);_0x5918ad[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x36e207[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x69d77c['query'][_0xcdce('0x47')]));_0x5918ad[_0xcdce('0x46')]=_0x5918ad[_0xcdce('0x46')][_0xcdce('0x59')]?_0x5918ad['attributes']:_0x36e207[_0xcdce('0x41')];_0x5918ad[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x69d77c['query'][_0xcdce('0x4a')]);_0x5918ad[_0xcdce('0x4b')]=qs['filters'](_['pick'](_0x69d77c[_0xcdce('0x42')],_0x36e207[_0xcdce('0x44')]));if(_0x69d77c[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x5918ad[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x5918ad[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x5918ad['attributes'],function(_0x32eda4){var _0x5eb531={};_0x5eb531[_0x32eda4]={'$like':'%'+_0x69d77c[_0xcdce('0x42')]['filter']+'%'};return _0x5eb531;})});}_0x5918ad=_[_0xcdce('0x4d')]({},_0x5918ad,_0x69d77c[_0xcdce('0x50')]);return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})['then'](function(_0x4403d2){if(_0x4403d2){_0x55f2c1=_0x4403d2['length'];if(!_0x69d77c['query'][_0xcdce('0x48')](_0xcdce('0x73'))){_0x5918ad[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x69d77c['query'][_0xcdce('0x49')]);_0x5918ad['offset']=qs[_0xcdce('0x2d')](_0x69d77c['query'][_0xcdce('0x2d')]);}return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})[_0xcdce('0x21')](function(_0x55386f){if(_0x55386f){return _0x55386f?{'count':_0x55f2c1,'rows':_0x55386f}:null;}})[_0xcdce('0x21')](respondWithResult(_0x54e3af,null))[_0xcdce('0x55')](handleError(_0x54e3af,null));};exports[_0xcdce('0x74')]=function(_0x3e2d5e,_0x1f7558,_0x36ce38){var _0x4e20a2=_0x3e2d5e['body'][_0xcdce('0x75')];return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x4e20a2},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':'Agents','attributes':['id',_0xcdce('0x3a'),'online',_0xcdce('0x77'),'interface'],'raw':!![]}]})[_0xcdce('0x21')](function(_0x441b14){if(_0x441b14){var _0x4c76b5=_['flatMap'](_0x441b14,function(_0x36c0d0){var _0x39ebc3=_0x36c0d0[_0xcdce('0x36')]({'plain':!![]});return _0x39ebc3[_0xcdce('0x78')];});return db['ChatQueue']['find']({'where':{'id':_0x3e2d5e[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x5e17b9){return db['sequelize'][_0xcdce('0x79')](function(_0x269758){return _0x5e17b9[_0xcdce('0x74')](_0x4e20a2,{'transaction':_0x269758})['then'](function(){return BPromise[_0xcdce('0x7a')](_0x4c76b5,function(_0x3f2757){return db['UserChatQueue'][_0xcdce('0x7b')]({'where':{'UserId':_0x3f2757['id'],'ChatQueueId':_0x3e2d5e[_0xcdce('0x57')]['id']},'transaction':_0x269758});});})[_0xcdce('0x21')](function(){_0x4c76b5[_0xcdce('0x7c')](function(_0xbdb99){socket[_0xcdce('0x7d')]('userChatQueue:save',{'UserId':_0xbdb99['id'],'ChatQueueId':_0x5e17b9['id']});});});});});}})[_0xcdce('0x21')](respondWithStatusCode(_0x1f7558,null))[_0xcdce('0x55')](handleError(_0x1f7558,null));};exports[_0xcdce('0x7e')]=function(_0x511497,_0x4a65c5,_0xdd38b5){return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x511497[_0xcdce('0x42')][_0xcdce('0x75')]},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':_0xcdce('0x78'),'attributes':['id'],'raw':!![]}]})[_0xcdce('0x21')](handleEntityNotFound(_0x4a65c5,null))['then'](function(_0x5624b4){var _0x3c718e=_[_0xcdce('0x3c')](_0x5624b4,'id');var _0x3866ea=[];var _0x394338=[];var _0x4cbda9=squel[_0xcdce('0x7f')]();_0x4cbda9[_0xcdce('0x80')](_0xcdce('0x81'))['from']('team_has_chat_queues','tq')[_0xcdce('0x82')](_0xcdce('0x83'),'ut',_0xcdce('0x84'))[_0xcdce('0x4b')]('ChatQueueId\x20=\x20?',_0x511497['params']['id']);for(var _0x2d32af=0x0;_0x2d32af<_0x5624b4[_0xcdce('0x59')];_0x2d32af+=0x1){let _0x52c447=_0x5624b4[_0x2d32af];for(var _0x32fa7f=0x0;_0x32fa7f<_0x52c447['Agents'][_0xcdce('0x59')];_0x32fa7f+=0x1){let _0x302781=_0x52c447[_0xcdce('0x78')][_0x32fa7f];var _0xcd1477=_0x4cbda9[_0xcdce('0x85')]();_0xcd1477[_0xcdce('0x4b')](_0xcdce('0x86'),_0x302781['id']);_0x394338['push'](db['sequelize'][_0xcdce('0x42')](_0xcd1477[_0xcdce('0x87')](),{'type':db['sequelize']['QueryTypes'][_0xcdce('0x88')]})[_0xcdce('0x21')](function(_0x2c90a8){if(_0x2c90a8[_0xcdce('0x59')]===0x1){return _0x302781['id'];}else{var _0x121d1d=_[_0xcdce('0x89')](_[_0xcdce('0x3c')](_0x2c90a8,'TeamId'),function(_0x27a941){return _[_0xcdce('0x8a')](_0x3c718e,_0x27a941);});if(_0x121d1d){return _0x302781['id'];}}}));}}return BPromise[_0xcdce('0x8b')](_0x394338)['then'](function(_0x487269){_0x3866ea=_(_0x3866ea)[_0xcdce('0x8c')](_0x487269)['compact']()['value']();return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x511497[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x38daaf){return db[_0xcdce('0x8d')][_0xcdce('0x79')](function(_0x411733){return _0x38daaf[_0xcdce('0x7e')](_0x511497['query'][_0xcdce('0x75')],{'transaction':_0x411733})[_0xcdce('0x21')](function(){if(!_['isEmpty'](_0x3866ea)){return _0x38daaf[_0xcdce('0x8e')](_0x3866ea,{'transaction':_0x411733});}})[_0xcdce('0x21')](function(){_0x3866ea['forEach'](function(_0x248f8e){socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':_0x248f8e,'ChatQueueId':_0x38daaf['id']});});});});});});})[_0xcdce('0x21')](respondWithStatusCode(_0x4a65c5,null))['catch'](handleError(_0x4a65c5,null));};exports['addAgents']=function(_0x1d60e2,_0x5730d0,_0x59119d){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x1d60e2['params']['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x5730d0,null))[_0xcdce('0x21')](function(_0x2684c7){if(_0x2684c7){return _0x2684c7['addAgents'](_0x1d60e2['body'][_0xcdce('0x75')],_[_0xcdce('0x90')](_0x1d60e2[_0xcdce('0x61')],[_0xcdce('0x75'),'id'])||{})[_0xcdce('0x91')](function(_0x2e89e9){for(var _0x389e4f=0x0;_0x389e4f<_0x1d60e2[_0xcdce('0x61')]['ids']['length'];_0x389e4f+=0x1){socket[_0xcdce('0x7d')](_0xcdce('0x92'),{'UserId':Number(_0x1d60e2[_0xcdce('0x61')][_0xcdce('0x75')][_0x389e4f]),'ChatQueueId':Number(_0x1d60e2[_0xcdce('0x57')]['id'])});}return _0x2e89e9;});}})[_0xcdce('0x21')](respondWithResult(_0x5730d0,null))[_0xcdce('0x55')](handleError(_0x5730d0,null));};exports[_0xcdce('0x8e')]=function(_0x51180a,_0x460d4c,_0x11aa41){return db['ChatQueue'][_0xcdce('0x5f')]({'where':{'id':_0x51180a[_0xcdce('0x57')]['id']}})['then'](handleEntityNotFound(_0x460d4c,null))[_0xcdce('0x21')](function(_0x25d859){if(_0x25d859){return _0x25d859['removeAgents'](_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')])['then'](function(){if(_['isArray'](_0x51180a[_0xcdce('0x42')]['ids'])){for(var _0x31270c=0x0;_0x31270c<_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0xcdce('0x59')];_0x31270c+=0x1){socket[_0xcdce('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0x31270c]),'ChatQueueId':Number(_0x51180a[_0xcdce('0x57')]['id'])});}}else{socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')]),'ChatQueueId':Number(_0x51180a['params']['id'])});}});}})[_0xcdce('0x21')](respondWithStatusCode(_0x460d4c,null))[_0xcdce('0x55')](handleError(_0x460d4c,null));};exports[_0xcdce('0x93')]=function(_0x28975d,_0x2cf0b0,_0x36b308){var _0x4d59e4={};var _0x4d98b9={};var _0x29973e;var _0x3cce05;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x28975d[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x2cf0b0,null))['then'](function(_0x491588){if(_0x491588){_0x29973e=_0x491588;_0x4d98b9[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x76')][_0xcdce('0x58')]);_0x4d98b9[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x28975d[_0xcdce('0x42')]);_0x4d98b9['filters']=_['intersection'](_0x4d98b9[_0xcdce('0x41')],_0x4d98b9['query']);_0x4d59e4[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x4d98b9[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x47')]));_0x4d59e4['attributes']=_0x4d59e4['attributes'][_0xcdce('0x59')]?_0x4d59e4[_0xcdce('0x46')]:_0x4d98b9['model'];_0x4d59e4['order']=qs['sort'](_0x28975d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x4d59e4['where']=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x28975d[_0xcdce('0x42')],_0x4d98b9[_0xcdce('0x44')]));if(_0x28975d[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x4d59e4[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x4d59e4[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x4d59e4[_0xcdce('0x46')],function(_0x320df1){var _0x5ac920={};_0x5ac920[_0x320df1]={'$like':'%'+_0x28975d[_0xcdce('0x42')]['filter']+'%'};return _0x5ac920;})});}_0x4d59e4=_[_0xcdce('0x4d')]({},_0x4d59e4,_0x28975d[_0xcdce('0x50')]);return _0x29973e['getAgents'](_0x4d59e4);}})['then'](function(_0x559e90){if(_0x559e90){_0x3cce05=_0x559e90[_0xcdce('0x59')];if(!_0x28975d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x4d59e4['limit']=qs['limit'](_0x28975d[_0xcdce('0x42')]['limit']);_0x4d59e4[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x2d')]);}return _0x29973e[_0xcdce('0x93')](_0x4d59e4);}})['then'](function(_0x93dc12){if(_0x93dc12){return _0x93dc12?{'count':_0x3cce05,'rows':_0x93dc12}:null;}})[_0xcdce('0x21')](respondWithResult(_0x2cf0b0,null))[_0xcdce('0x55')](handleError(_0x2cf0b0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index dac4abd..a987057 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 _0x5732=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x4da3aa,_0x3cca7a){var _0x24ff0e=function(_0xbf7caf){while(--_0xbf7caf){_0x4da3aa['push'](_0x4da3aa['shift']());}};_0x24ff0e(++_0x3cca7a);}(_0x5732,0xfb));var _0x2573=function(_0x5c66e6,_0x4a4254){_0x5c66e6=_0x5c66e6-0x0;var _0x3b378f=_0x5732[_0x5c66e6];return _0x3b378f;};'use strict';var EventEmitter=require(_0x2573('0x0'));var ChatQueue=require(_0x2573('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2573('0x2'),'afterUpdate':_0x2573('0x3'),'afterDestroy':'remove'};function emitEvent(_0x27696e){return function(_0x2cd27b,_0x2ee042,_0x2d9889){ChatQueueEvents[_0x2573('0x4')](_0x27696e+':'+_0x2cd27b['id'],_0x2cd27b);ChatQueueEvents[_0x2573('0x4')](_0x27696e,_0x2cd27b);_0x2d9889(null);};}for(var e in events){if(events[_0x2573('0x5')](e)){var event=events[e];ChatQueue[_0x2573('0x6')](e,emitEvent(event));}}module[_0x2573('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x6a7a=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x686d95,_0x5e9d91){var _0x1ee747=function(_0x1d1135){while(--_0x1d1135){_0x686d95['push'](_0x686d95['shift']());}};_0x1ee747(++_0x5e9d91);}(_0x6a7a,0x122));var _0xa6a7=function(_0x1fe402,_0xa1d716){_0x1fe402=_0x1fe402-0x0;var _0x11a809=_0x6a7a[_0x1fe402];return _0x11a809;};'use strict';var EventEmitter=require(_0xa6a7('0x0'));var ChatQueue=require(_0xa6a7('0x1'))['db'][_0xa6a7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa6a7('0x3')](0x0);var events={'afterCreate':_0xa6a7('0x4'),'afterUpdate':_0xa6a7('0x5'),'afterDestroy':_0xa6a7('0x6')};function emitEvent(_0x37b38b){return function(_0x20570e,_0x30bf83,_0x2c447e){ChatQueueEvents['emit'](_0x37b38b+':'+_0x20570e['id'],_0x20570e);ChatQueueEvents[_0xa6a7('0x7')](_0x37b38b,_0x20570e);_0x2c447e(null);};}for(var e in events){if(events[_0xa6a7('0x8')](e)){var event=events[e];ChatQueue[_0xa6a7('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 7c4eaa3..d20a87b 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 _0xfe5d=['bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0xd88736,_0x9c3494){var _0x24e4a8=function(_0x36607e){while(--_0x36607e){_0xd88736['push'](_0xd88736['shift']());}};_0x24e4a8(++_0x9c3494);}(_0xfe5d,0x80));var _0xdfe5=function(_0x4f5471,_0x40b087){_0x4f5471=_0x4f5471-0x0;var _0x8a9ea0=_0xfe5d[_0x4f5471];return _0x8a9ea0;};'use strict';var _=require(_0xdfe5('0x0'));var util=require(_0xdfe5('0x1'));var logger=require(_0xdfe5('0x2'))('api');var moment=require(_0xdfe5('0x3'));var BPromise=require(_0xdfe5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfe5('0x5'));var rimraf=require(_0xdfe5('0x6'));var config=require(_0xdfe5('0x7'));var attributes=require(_0xdfe5('0x8'));module[_0xdfe5('0x9')]=function(_0x100f26,_0x43e0ad){return _0x100f26[_0xdfe5('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc821=['define','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5e88aa,_0x170b60){var _0x55ab65=function(_0xe2531d){while(--_0xe2531d){_0x5e88aa['push'](_0x5e88aa['shift']());}};_0x55ab65(++_0x170b60);}(_0xc821,0x9c));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1c82('0x0'));var logger=require(_0x1c82('0x1'))(_0x1c82('0x2'));var moment=require(_0x1c82('0x3'));var BPromise=require(_0x1c82('0x4'));var rp=require(_0x1c82('0x5'));var fs=require('fs');var path=require(_0x1c82('0x6'));var rimraf=require('rimraf');var config=require(_0x1c82('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1c82('0x8')]=function(_0x52e4cf,_0x32dc7d){return _0x52e4cf[_0x1c82('0x9')]('ChatQueue',attributes,{'tableName':_0x1c82('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index fd2ea7f..76d83a4 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 _0xb749=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','model','map','then','debug','ShowChatQueue','lodash','moment','bluebird'];(function(_0x283783,_0x31b6b2){var _0x3ca348=function(_0x4cfc67){while(--_0x4cfc67){_0x283783['push'](_0x283783['shift']());}};_0x3ca348(++_0x31b6b2);}(_0xb749,0xac));var _0x9b74=function(_0x1925f8,_0x545551){_0x1925f8=_0x1925f8-0x0;var _0x2fd553=_0xb749[_0x1925f8];return _0x2fd553;};'use strict';var _=require(_0x9b74('0x0'));var util=require('util');var moment=require(_0x9b74('0x1'));var BPromise=require(_0x9b74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b74('0x4'));var logger=require(_0x9b74('0x5'))(_0x9b74('0x6'));var config=require(_0x9b74('0x7'));var jayson=require(_0x9b74('0x8'));var client=jayson[_0x9b74('0x9')]['http']({'port':0x232a});config[_0x9b74('0xa')]=_['defaults'](config[_0x9b74('0xa')],{'host':_0x9b74('0xb'),'port':0x18eb});var socket=require(_0x9b74('0xc'))(new Redis(config[_0x9b74('0xa')]));require(_0x9b74('0xd'))['register'](socket);function respondWithRpcPromise(_0x91a9b4,_0x1fd119,_0x561ca6){return new BPromise(function(_0x3ae044,_0xfc8a79){return client[_0x9b74('0xe')](_0x91a9b4,_0x561ca6)['then'](function(_0x2474a3){logger[_0x9b74('0xf')](_0x9b74('0x10'),_0x1fd119,_0x9b74('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1fd119,_0x9b74('0x11'),JSON[_0x9b74('0x12')](_0x2474a3));if(_0x2474a3[_0x9b74('0x13')]){if(_0x2474a3[_0x9b74('0x13')]['code']===0x1f4){logger[_0x9b74('0x13')](_0x9b74('0x10'),_0x1fd119,_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);return _0xfc8a79(_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);return _0x3ae044(_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x9b74('0x11'));_0x3ae044(_0x2474a3[_0x9b74('0x15')]['message']);}})[_0x9b74('0x16')](function(_0x427085){logger[_0x9b74('0x13')]('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x427085);_0xfc8a79(_0x427085);});});}exports[_0x9b74('0x17')]=function(_0x2a3498){var _0xc94186=this;return new Promise(function(_0x2f2464,_0x4d3673){return db['ChatQueue']['findAll']({'raw':_0x2a3498[_0x9b74('0x18')]?_0x2a3498['options'][_0x9b74('0x19')]===undefined?!![]:![]:!![],'where':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1a')]||null:null,'attributes':_0x2a3498[_0x9b74('0x18')]?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1b')]||null:null,'limit':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1c')]||null:null,'include':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1d')]?_['map'](_0x2a3498['options'][_0x9b74('0x1d')],function(_0x1d41ca){return{'model':db[_0x1d41ca[_0x9b74('0x1e')]],'as':_0x1d41ca['as'],'attributes':_0x1d41ca[_0x9b74('0x1b')],'include':_0x1d41ca[_0x9b74('0x1d')]?_['map'](_0x1d41ca[_0x9b74('0x1d')],function(_0x35d202){return{'model':db[_0x35d202['model']],'as':_0x35d202['as'],'attributes':_0x35d202[_0x9b74('0x1b')],'include':_0x35d202['include']?_[_0x9b74('0x1f')](_0x35d202['include'],function(_0x55e332){return{'model':db[_0x55e332[_0x9b74('0x1e')]],'as':_0x55e332['as'],'attributes':_0x55e332[_0x9b74('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9b74('0x20')](function(_0x5a0319){logger['info'](_0x9b74('0x17'),_0x2a3498);logger[_0x9b74('0x21')](_0x9b74('0x17'),_0x2a3498,JSON['stringify'](_0x5a0319));_0x2f2464(_0x5a0319);})[_0x9b74('0x16')](function(_0x8f811e){logger[_0x9b74('0x13')](_0x9b74('0x17'),_0x8f811e[_0x9b74('0x14')],_0x2a3498);_0x4d3673(_0xc94186[_0x9b74('0x13')](0x1f4,_0x8f811e[_0x9b74('0x14')]));});});};exports[_0x9b74('0x22')]=function(_0x61e0cb){var _0x2c2a46=this;return new Promise(function(_0x4f7271,_0x54a253){return db['ChatQueue']['find']({'raw':_0x61e0cb[_0x9b74('0x18')]?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x19')]===undefined?!![]:![]:!![],'where':_0x61e0cb['options']?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x1a')]||null:null,'attributes':_0x61e0cb['options']?_0x61e0cb['options'][_0x9b74('0x1b')]||null:null,'include':_0x61e0cb[_0x9b74('0x18')]?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x1d')]?_[_0x9b74('0x1f')](_0x61e0cb['options'][_0x9b74('0x1d')],function(_0x113017){return{'model':db[_0x113017[_0x9b74('0x1e')]],'as':_0x113017['as'],'attributes':_0x113017[_0x9b74('0x1b')],'include':_0x113017['include']?_[_0x9b74('0x1f')](_0x113017[_0x9b74('0x1d')],function(_0x346e2f){return{'model':db[_0x346e2f[_0x9b74('0x1e')]],'as':_0x346e2f['as'],'attributes':_0x346e2f[_0x9b74('0x1b')],'include':_0x346e2f[_0x9b74('0x1d')]?_[_0x9b74('0x1f')](_0x346e2f[_0x9b74('0x1d')],function(_0x32b3e9){return{'model':db[_0x32b3e9[_0x9b74('0x1e')]],'as':_0x32b3e9['as'],'attributes':_0x32b3e9[_0x9b74('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9b74('0x20')](function(_0x2d2b97){logger[_0x9b74('0xf')](_0x9b74('0x22'),_0x61e0cb);logger[_0x9b74('0x21')](_0x9b74('0x22'),_0x61e0cb,JSON[_0x9b74('0x12')](_0x2d2b97));_0x4f7271(_0x2d2b97);})[_0x9b74('0x16')](function(_0x54d9e9){logger[_0x9b74('0x13')]('ShowChatQueue',_0x54d9e9[_0x9b74('0x14')],_0x61e0cb);_0x54a253(_0x2c2a46[_0x9b74('0x13')](0x1f4,_0x54d9e9[_0x9b74('0x14')]));});});}; \ No newline at end of file +var _0xa169=['error','code','ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','model','attributes','include','then','catch','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x398544,_0x161cb3){var _0x46c9c4=function(_0x300fb1){while(--_0x300fb1){_0x398544['push'](_0x398544['shift']());}};_0x46c9c4(++_0x161cb3);}(_0xa169,0xaa));var _0x9a16=function(_0x48feb5,_0x333560){_0x48feb5=_0x48feb5-0x0;var _0x59761d=_0xa169[_0x48feb5];return _0x59761d;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var moment=require(_0x9a16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a16('0x3'));var db=require(_0x9a16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a16('0x5'))(_0x9a16('0x6'));var config=require(_0x9a16('0x7'));var jayson=require(_0x9a16('0x8'));var client=jayson[_0x9a16('0x9')]['http']({'port':0x232a});config[_0x9a16('0xa')]=_[_0x9a16('0xb')](config[_0x9a16('0xa')],{'host':_0x9a16('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a16('0xa')]));require('./chatQueue.socket')[_0x9a16('0xd')](socket);function respondWithRpcPromise(_0x4a0bc6,_0x198eff,_0x41ac32){return new BPromise(function(_0x4f97c7,_0x956e25){return client[_0x9a16('0xe')](_0x4a0bc6,_0x41ac32)['then'](function(_0x5e385a){logger[_0x9a16('0xf')]('ChatQueue,\x20%s,\x20%s',_0x198eff,'request\x20sent');logger[_0x9a16('0x10')](_0x9a16('0x11'),_0x198eff,_0x9a16('0x12'),JSON[_0x9a16('0x13')](_0x5e385a));if(_0x5e385a['error']){if(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x15')]===0x1f4){logger[_0x9a16('0x14')](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x956e25(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);}logger['error'](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x4f97c7(_0x5e385a[_0x9a16('0x14')]['message']);}else{logger['info'](_0x9a16('0x16'),_0x198eff,_0x9a16('0x12'));_0x4f97c7(_0x5e385a['result'][_0x9a16('0x17')]);}})['catch'](function(_0x5f3f60){logger['error']('ChatQueue,\x20%s,\x20%s',_0x198eff,_0x5f3f60);_0x956e25(_0x5f3f60);});});}exports[_0x9a16('0x18')]=function(_0x3f684f){var _0x4e9732=this;return new Promise(function(_0x1bca76,_0x2d8950){return db[_0x9a16('0x19')][_0x9a16('0x1a')]({'raw':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f['options']['attributes']||null:null,'limit':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1e')]||null:null,'include':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x3f684f[_0x9a16('0x1b')]['include'],function(_0x42bd3b){return{'model':db[_0x42bd3b[_0x9a16('0x20')]],'as':_0x42bd3b['as'],'attributes':_0x42bd3b[_0x9a16('0x21')],'include':_0x42bd3b[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x42bd3b[_0x9a16('0x22')],function(_0x1ac894){return{'model':db[_0x1ac894['model']],'as':_0x1ac894['as'],'attributes':_0x1ac894[_0x9a16('0x21')],'include':_0x1ac894[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x1ac894[_0x9a16('0x22')],function(_0x20290f){return{'model':db[_0x20290f[_0x9a16('0x20')]],'as':_0x20290f['as'],'attributes':_0x20290f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x241cda){logger['info'](_0x9a16('0x18'),_0x3f684f);logger[_0x9a16('0x10')](_0x9a16('0x18'),_0x3f684f,JSON[_0x9a16('0x13')](_0x241cda));_0x1bca76(_0x241cda);})[_0x9a16('0x24')](function(_0x7be0f5){logger[_0x9a16('0x14')](_0x9a16('0x18'),_0x7be0f5[_0x9a16('0x17')],_0x3f684f);_0x2d8950(_0x4e9732['error'](0x1f4,_0x7be0f5[_0x9a16('0x17')]));});});};exports[_0x9a16('0x25')]=function(_0x16ddc9){var _0x1302fc=this;return new Promise(function(_0x4ea7f5,_0x45f491){return db['ChatQueue']['find']({'raw':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['attributes']||null:null,'include':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x22')],function(_0xb8c3a){return{'model':db[_0xb8c3a[_0x9a16('0x20')]],'as':_0xb8c3a['as'],'attributes':_0xb8c3a[_0x9a16('0x21')],'include':_0xb8c3a['include']?_[_0x9a16('0x1f')](_0xb8c3a[_0x9a16('0x22')],function(_0x4a53d3){return{'model':db[_0x4a53d3[_0x9a16('0x20')]],'as':_0x4a53d3['as'],'attributes':_0x4a53d3[_0x9a16('0x21')],'include':_0x4a53d3[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x4a53d3['include'],function(_0x59510f){return{'model':db[_0x59510f[_0x9a16('0x20')]],'as':_0x59510f['as'],'attributes':_0x59510f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x69de2e){logger[_0x9a16('0xf')](_0x9a16('0x25'),_0x16ddc9);logger[_0x9a16('0x10')](_0x9a16('0x25'),_0x16ddc9,JSON[_0x9a16('0x13')](_0x69de2e));_0x4ea7f5(_0x69de2e);})['catch'](function(_0x2a736a){logger[_0x9a16('0x14')](_0x9a16('0x25'),_0x2a736a[_0x9a16('0x17')],_0x16ddc9);_0x45f491(_0x1302fc[_0x9a16('0x14')](0x1f4,_0x2a736a[_0x9a16('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 98832b5..2d8d39f 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x32febf,_0x4e3901){var _0x246469=function(_0xf83890){while(--_0xf83890){_0x32febf['push'](_0x32febf['shift']());}};_0x246469(++_0x4e3901);}(_0x22fb,0x192));var _0xb22f=function(_0x5da667,_0x3a5e16){_0x5da667=_0x5da667-0x0;var _0x47f4a8=_0x22fb[_0x5da667];return _0x47f4a8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file +var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x2b136c,_0xe706a0){var _0x3f4a87=function(_0x234ffe){while(--_0x234ffe){_0x2b136c['push'](_0x2b136c['shift']());}};_0x3f4a87(++_0xe706a0);}(_0xe107,0xb3));var _0x7e10=function(_0x54d1ce,_0x1b6bc0){_0x54d1ce=_0x54d1ce-0x0;var _0x35896f=_0xe107[_0x54d1ce];return _0x35896f;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index f6129a5..9aae518 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x4802ed,_0xbb726b){var _0xe67dc3=function(_0x20cca6){while(--_0x20cca6){_0x4802ed['push'](_0x4802ed['shift']());}};_0xe67dc3(++_0xbb726b);}(_0xe14b,0x93));var _0xbe14=function(_0x3d9b23,_0x52894d){_0x3d9b23=_0x3d9b23-0x0;var _0xf22517=_0xe14b[_0x3d9b23];return _0xf22517;};'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 fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x503c5c,_0x38e24d){var _0x894667=function(_0x4f1b17){while(--_0x4f1b17){_0x503c5c['push'](_0x503c5c['shift']());}};_0x894667(++_0x38e24d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index c59b1eb..bb09fee 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 _0x759a=['STRING','DATE','moment','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x759a,0x126));var _0xa759=function(_0x1d35e9,_0x5ac1b5){_0x1d35e9=_0x1d35e9-0x0;var _0x49c1a4=_0x759a[_0x1d35e9];return _0x49c1a4;};'use strict';var moment=require(_0xa759('0x0'));var Sequelize=require('sequelize');module[_0xa759('0x1')]={'uniqueid':{'type':Sequelize[_0xa759('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa759('0x2')]},'joinAt':{'type':Sequelize[_0xa759('0x3')]},'leaveAt':{'type':Sequelize[_0xa759('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa759('0x3')]},'reason':{'type':Sequelize[_0xa759('0x2')]}}; \ No newline at end of file +var _0xff58=['DATE','moment','sequelize','exports','STRING'];(function(_0x30af13,_0x243c55){var _0x20bd99=function(_0x5b21a2){while(--_0x5b21a2){_0x30af13['push'](_0x30af13['shift']());}};_0x20bd99(++_0x243c55);}(_0xff58,0x150));var _0x8ff5=function(_0x3e2e99,_0xad339){_0x3e2e99=_0x3e2e99-0x0;var _0x52ceef=_0xff58[_0x3e2e99];return _0x52ceef;};'use strict';var moment=require(_0x8ff5('0x0'));var Sequelize=require(_0x8ff5('0x1'));module[_0x8ff5('0x2')]={'uniqueid':{'type':Sequelize[_0x8ff5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8ff5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8ff5('0x4')]},'exitAt':{'type':Sequelize[_0x8ff5('0x4')]},'reason':{'type':Sequelize[_0x8ff5('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index fb24404..fc2212f 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 _0xbe2c=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','reject','save','update','then','sendStatus','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x2f77ee,_0x2bff02){var _0x38d29a=function(_0x1f7e81){while(--_0x1f7e81){_0x2f77ee['push'](_0x2f77ee['shift']());}};_0x38d29a(++_0x2bff02);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x195a4e,_0x1b58e){_0x195a4e=_0x195a4e-0x0;var _0x274bbf=_0xbe2c[_0x195a4e];return _0x274bbf;};'use strict';var emlformat=require(_0xcbe2('0x0'));var rimraf=require(_0xcbe2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbe2('0x2'));var rp=require('request-promise');var moment=require(_0xcbe2('0x3'));var BPromise=require(_0xcbe2('0x4'));var Mustache=require(_0xcbe2('0x5'));var util=require(_0xcbe2('0x6'));var path=require(_0xcbe2('0x7'));var sox=require('sox');var csv=require(_0xcbe2('0x8'));var ejs=require(_0xcbe2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbe2('0xa'));var squel=require(_0xcbe2('0xb'));var crypto=require(_0xcbe2('0xc'));var jsforce=require(_0xcbe2('0xd'));var deskjs=require(_0xcbe2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcbe2('0xf'));var Redis=require(_0xcbe2('0x10'));var authService=require(_0xcbe2('0x11'));var qs=require(_0xcbe2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbe2('0x13'))(_0xcbe2('0x14'));var utils=require(_0xcbe2('0x15'));var config=require(_0xcbe2('0x16'));var licenseUtil=require(_0xcbe2('0x17'));var db=require(_0xcbe2('0x18'))['db'];function respondWithStatusCode(_0x526ce2,_0x1b94fb){_0x1b94fb=_0x1b94fb||0xcc;return function(_0x192c00){if(_0x192c00){return _0x526ce2['sendStatus'](_0x1b94fb);}return _0x526ce2[_0xcbe2('0x19')](_0x1b94fb)['end']();};}function respondWithResult(_0x41de3f,_0x4c18dc){_0x4c18dc=_0x4c18dc||0xc8;return function(_0x3920bf){if(_0x3920bf){return _0x41de3f['status'](_0x4c18dc)['json'](_0x3920bf);}};}function respondWithFilteredResult(_0xb89337,_0x4ec284){return function(_0xb2995b){if(_0xb2995b){var _0x23c38f=typeof _0x4ec284[_0xcbe2('0x1a')]===_0xcbe2('0x1b')&&typeof _0x4ec284[_0xcbe2('0x1c')]===_0xcbe2('0x1b');var _0x126aa9=_0xb2995b['count'];var _0xb968ac=_0x23c38f?0x0:_0x4ec284['offset'];var _0x1c09cb=_0x23c38f?_0xb2995b[_0xcbe2('0x1d')]:_0x4ec284[_0xcbe2('0x1a')]+_0x4ec284[_0xcbe2('0x1c')];var _0x537eb2;if(_0x1c09cb>=_0x126aa9){_0x1c09cb=_0x126aa9;_0x537eb2=0xc8;}else{_0x537eb2=0xce;}_0xb89337[_0xcbe2('0x19')](_0x537eb2);return _0xb89337['set']('Content-Range',_0xb968ac+'-'+_0x1c09cb+'/'+_0x126aa9)[_0xcbe2('0x1e')](_0xb2995b);}return null;};}function patchUpdates(_0x208863){return function(_0x8b1504){try{jsonpatch['apply'](_0x8b1504,_0x208863,!![]);}catch(_0x104706){return BPromise[_0xcbe2('0x1f')](_0x104706);}return _0x8b1504[_0xcbe2('0x20')]();};}function saveUpdates(_0x5167eb,_0x372789){return function(_0x432329){if(_0x432329){return _0x432329[_0xcbe2('0x21')](_0x5167eb)[_0xcbe2('0x22')](function(_0x38048c){return _0x38048c;});}return null;};}function removeEntity(_0x285fc7,_0x2f1e25){return function(_0x2914e6){if(_0x2914e6){return _0x2914e6['destroy']()[_0xcbe2('0x22')](function(){_0x285fc7[_0xcbe2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40039f,_0x1829e6){return function(_0xc6ec9b){if(!_0xc6ec9b){_0x40039f[_0xcbe2('0x23')](0x194);}return _0xc6ec9b;};}function handleError(_0x105b92,_0x4833cd){_0x4833cd=_0x4833cd||0x1f4;return function(_0xbc5aab){logger[_0xcbe2('0x24')](_0xbc5aab['stack']);if(_0xbc5aab[_0xcbe2('0x25')]){delete _0xbc5aab['name'];}_0x105b92[_0xcbe2('0x19')](_0x4833cd)[_0xcbe2('0x26')](_0xbc5aab);};}exports[_0xcbe2('0x27')]=function(_0x431631,_0x4c194d){var _0xdee879={},_0x37eb8b={},_0x4cf95a={'count':0x0,'rows':[]};var _0x3596be=_[_0xcbe2('0x28')](db[_0xcbe2('0x29')][_0xcbe2('0x2a')],function(_0x26d570){return{'name':_0x26d570[_0xcbe2('0x2b')],'type':_0x26d570[_0xcbe2('0x2c')][_0xcbe2('0x2d')]};});_0x37eb8b[_0xcbe2('0x2e')]=_[_0xcbe2('0x28')](_0x3596be,_0xcbe2('0x25'));_0x37eb8b[_0xcbe2('0x2f')]=_[_0xcbe2('0x30')](_0x431631['query']);_0x37eb8b[_0xcbe2('0x31')]=_[_0xcbe2('0x32')](_0x37eb8b['model'],_0x37eb8b['query']);_0xdee879[_0xcbe2('0x33')]=_['intersection'](_0x37eb8b[_0xcbe2('0x2e')],qs[_0xcbe2('0x34')](_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x34')]));_0xdee879[_0xcbe2('0x33')]=_0xdee879[_0xcbe2('0x33')][_0xcbe2('0x35')]?_0xdee879['attributes']:_0x37eb8b[_0xcbe2('0x2e')];if(!_0x431631['query']['hasOwnProperty'](_0xcbe2('0x36'))){_0xdee879['limit']=qs[_0xcbe2('0x1c')](_0x431631['query'][_0xcbe2('0x1c')]);_0xdee879[_0xcbe2('0x1a')]=qs['offset'](_0x431631[_0xcbe2('0x2f')]['offset']);}_0xdee879[_0xcbe2('0x37')]=qs['sort'](_0x431631['query'][_0xcbe2('0x38')]);_0xdee879['where']=qs['filters'](_[_0xcbe2('0x39')](_0x431631['query'],_0x37eb8b[_0xcbe2('0x31')]),_0x3596be);if(_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x3a')]){_0xdee879['where']=_[_0xcbe2('0x3b')](_0xdee879[_0xcbe2('0x3c')],{'$or':_['map'](_0x3596be,function(_0x522bfd){if(_0x522bfd['type']!==_0xcbe2('0x3d')){var _0x4347a7={};_0x4347a7[_0x522bfd[_0xcbe2('0x25')]]={'$like':'%'+_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x3a')]+'%'};return _0x4347a7;}})});}_0xdee879=_['merge']({},_0xdee879,_0x431631[_0xcbe2('0x3e')]);var _0x2b9fd8={'where':_0xdee879['where']};return db[_0xcbe2('0x29')][_0xcbe2('0x1d')](_0x2b9fd8)[_0xcbe2('0x22')](function(_0x3b2878){_0x4cf95a[_0xcbe2('0x1d')]=_0x3b2878;if(_0x431631[_0xcbe2('0x2f')]['includeAll']){_0xdee879[_0xcbe2('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xcbe2('0x40')](_0xdee879);})['then'](function(_0x272fdb){_0x4cf95a['rows']=_0x272fdb;return _0x4cf95a;})[_0xcbe2('0x22')](respondWithFilteredResult(_0x4c194d,_0xdee879))[_0xcbe2('0x41')](handleError(_0x4c194d,null));};exports[_0xcbe2('0x42')]=function(_0x1a200a,_0x4e72bb){var _0x25899c={'raw':!![],'where':{'id':_0x1a200a[_0xcbe2('0x43')]['id']}},_0x5c5684={};_0x5c5684[_0xcbe2('0x2e')]=_[_0xcbe2('0x30')](db['ChatQueueReport'][_0xcbe2('0x2a')]);_0x5c5684[_0xcbe2('0x2f')]=_['keys'](_0x1a200a[_0xcbe2('0x2f')]);_0x5c5684['filters']=_[_0xcbe2('0x32')](_0x5c5684[_0xcbe2('0x2e')],_0x5c5684[_0xcbe2('0x2f')]);_0x25899c[_0xcbe2('0x33')]=_[_0xcbe2('0x32')](_0x5c5684[_0xcbe2('0x2e')],qs['fields'](_0x1a200a['query'][_0xcbe2('0x34')]));_0x25899c['attributes']=_0x25899c[_0xcbe2('0x33')][_0xcbe2('0x35')]?_0x25899c[_0xcbe2('0x33')]:_0x5c5684[_0xcbe2('0x2e')];if(_0x1a200a[_0xcbe2('0x2f')][_0xcbe2('0x44')]){_0x25899c[_0xcbe2('0x3f')]=[{'all':!![]}];}_0x25899c=_[_0xcbe2('0x3b')]({},_0x25899c,_0x1a200a[_0xcbe2('0x3e')]);return db[_0xcbe2('0x29')][_0xcbe2('0x45')](_0x25899c)[_0xcbe2('0x22')](handleEntityNotFound(_0x4e72bb,null))[_0xcbe2('0x22')](respondWithResult(_0x4e72bb,null))[_0xcbe2('0x41')](handleError(_0x4e72bb,null));};exports['create']=function(_0x1110eb,_0x5868be){return db[_0xcbe2('0x29')][_0xcbe2('0x46')](_0x1110eb[_0xcbe2('0x47')],{})['then'](respondWithResult(_0x5868be,0xc9))[_0xcbe2('0x41')](handleError(_0x5868be,null));};exports[_0xcbe2('0x21')]=function(_0x52057b,_0x33e78b){if(_0x52057b[_0xcbe2('0x47')]['id']){delete _0x52057b[_0xcbe2('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x52057b['params']['id']}})[_0xcbe2('0x22')](handleEntityNotFound(_0x33e78b,null))[_0xcbe2('0x22')](saveUpdates(_0x52057b[_0xcbe2('0x47')],null))[_0xcbe2('0x22')](respondWithResult(_0x33e78b,null))[_0xcbe2('0x41')](handleError(_0x33e78b,null));};exports[_0xcbe2('0x48')]=function(_0x2d295c,_0x19f1e1){return db[_0xcbe2('0x29')]['find']({'where':{'id':_0x2d295c['params']['id']}})['then'](handleEntityNotFound(_0x19f1e1,null))[_0xcbe2('0x22')](removeEntity(_0x19f1e1,null))[_0xcbe2('0x41')](handleError(_0x19f1e1,null));};exports[_0xcbe2('0x49')]=function(_0x3b6cf8,_0x3275a5){return db[_0xcbe2('0x29')][_0xcbe2('0x49')]()['then'](respondWithResult(_0x3275a5,null))['catch'](handleError(_0x3275a5,null));}; \ No newline at end of file +var _0xdc86=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x44dfea,_0x1adca9){var _0x14b889=function(_0x2ff7c9){while(--_0x2ff7c9){_0x44dfea['push'](_0x44dfea['shift']());}};_0x14b889(++_0x1adca9);}(_0xdc86,0x118));var _0x6dc8=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xdc86[_0x11005e];return _0x29338f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dc8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc8('0x1'));var rp=require('request-promise');var moment=require(_0x6dc8('0x2'));var BPromise=require(_0x6dc8('0x3'));var Mustache=require(_0x6dc8('0x4'));var util=require(_0x6dc8('0x5'));var path=require(_0x6dc8('0x6'));var sox=require('sox');var csv=require(_0x6dc8('0x7'));var ejs=require(_0x6dc8('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc8('0x9'));var _=require(_0x6dc8('0xa'));var squel=require(_0x6dc8('0xb'));var crypto=require(_0x6dc8('0xc'));var jsforce=require(_0x6dc8('0xd'));var deskjs=require(_0x6dc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6dc8('0xf'));var Papa=require('papaparse');var Redis=require(_0x6dc8('0x10'));var authService=require(_0x6dc8('0x11'));var qs=require(_0x6dc8('0x12'));var as=require(_0x6dc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc8('0x14'))(_0x6dc8('0x15'));var utils=require(_0x6dc8('0x16'));var config=require(_0x6dc8('0x17'));var licenseUtil=require(_0x6dc8('0x18'));var db=require(_0x6dc8('0x19'))['db'];function respondWithStatusCode(_0x49e474,_0x36e427){_0x36e427=_0x36e427||0xcc;return function(_0x542c8b){if(_0x542c8b){return _0x49e474['sendStatus'](_0x36e427);}return _0x49e474[_0x6dc8('0x1a')](_0x36e427)[_0x6dc8('0x1b')]();};}function respondWithResult(_0x21be3d,_0x58c295){_0x58c295=_0x58c295||0xc8;return function(_0x23acc6){if(_0x23acc6){return _0x21be3d[_0x6dc8('0x1a')](_0x58c295)[_0x6dc8('0x1c')](_0x23acc6);}};}function respondWithFilteredResult(_0x45a2f7,_0x28158d){return function(_0x4782c8){if(_0x4782c8){var _0x351c11=typeof _0x28158d[_0x6dc8('0x1d')]===_0x6dc8('0x1e')&&typeof _0x28158d['limit']==='undefined';var _0x2702c5=_0x4782c8[_0x6dc8('0x1f')];var _0x209ae4=_0x351c11?0x0:_0x28158d[_0x6dc8('0x1d')];var _0x2f3b94=_0x351c11?_0x4782c8['count']:_0x28158d['offset']+_0x28158d['limit'];var _0x2247c4;if(_0x2f3b94>=_0x2702c5){_0x2f3b94=_0x2702c5;_0x2247c4=0xc8;}else{_0x2247c4=0xce;}_0x45a2f7['status'](_0x2247c4);return _0x45a2f7[_0x6dc8('0x20')]('Content-Range',_0x209ae4+'-'+_0x2f3b94+'/'+_0x2702c5)[_0x6dc8('0x1c')](_0x4782c8);}return null;};}function patchUpdates(_0x4467a1){return function(_0x3e161a){try{jsonpatch[_0x6dc8('0x21')](_0x3e161a,_0x4467a1,!![]);}catch(_0x1949be){return BPromise[_0x6dc8('0x22')](_0x1949be);}return _0x3e161a[_0x6dc8('0x23')]();};}function saveUpdates(_0x38ce80,_0x1436d1){return function(_0x5526cd){if(_0x5526cd){return _0x5526cd[_0x6dc8('0x24')](_0x38ce80)[_0x6dc8('0x25')](function(_0x30afb5){return _0x30afb5;});}return null;};}function removeEntity(_0x49b5a8,_0xf69b){return function(_0x5c78db){if(_0x5c78db){return _0x5c78db[_0x6dc8('0x26')]()[_0x6dc8('0x25')](function(){_0x49b5a8[_0x6dc8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56895f,_0x1983f8){return function(_0x14ec58){if(!_0x14ec58){_0x56895f['sendStatus'](0x194);}return _0x14ec58;};}function handleError(_0x4596db,_0x4636be){_0x4636be=_0x4636be||0x1f4;return function(_0x36b904){logger['error'](_0x36b904['stack']);if(_0x36b904[_0x6dc8('0x27')]){delete _0x36b904[_0x6dc8('0x27')];}_0x4596db['status'](_0x4636be)[_0x6dc8('0x28')](_0x36b904);};}exports['index']=function(_0x482cc6,_0x4e9f46){var _0x63da34={},_0x283a42={},_0x35e1fc={'count':0x0,'rows':[]};var _0x1fde66=_[_0x6dc8('0x29')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')],function(_0x437671){return{'name':_0x437671[_0x6dc8('0x2c')],'type':_0x437671[_0x6dc8('0x2d')]['key']};});_0x283a42[_0x6dc8('0x2e')]=_['map'](_0x1fde66,'name');_0x283a42[_0x6dc8('0x2f')]=_[_0x6dc8('0x30')](_0x482cc6[_0x6dc8('0x2f')]);_0x283a42[_0x6dc8('0x31')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],_0x283a42['query']);_0x63da34[_0x6dc8('0x32')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],qs[_0x6dc8('0x33')](_0x482cc6['query'][_0x6dc8('0x33')]));_0x63da34[_0x6dc8('0x32')]=_0x63da34['attributes'][_0x6dc8('0x34')]?_0x63da34[_0x6dc8('0x32')]:_0x283a42[_0x6dc8('0x2e')];if(!_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x35')]('nolimit')){_0x63da34['limit']=qs[_0x6dc8('0x36')](_0x482cc6['query'][_0x6dc8('0x36')]);_0x63da34[_0x6dc8('0x1d')]=qs['offset'](_0x482cc6['query'][_0x6dc8('0x1d')]);}_0x63da34['order']=qs[_0x6dc8('0x37')](_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x37')]);_0x63da34[_0x6dc8('0x38')]=qs[_0x6dc8('0x31')](_[_0x6dc8('0x39')](_0x482cc6[_0x6dc8('0x2f')],_0x283a42['filters']),_0x1fde66);if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]){_0x63da34[_0x6dc8('0x38')]=_[_0x6dc8('0x3b')](_0x63da34[_0x6dc8('0x38')],{'$or':_[_0x6dc8('0x29')](_0x1fde66,function(_0x14822f){if(_0x14822f[_0x6dc8('0x2d')]!==_0x6dc8('0x3c')){var _0x5b5e67={};_0x5b5e67[_0x14822f['name']]={'$like':'%'+_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]+'%'};return _0x5b5e67;}})});}_0x63da34=_['merge']({},_0x63da34,_0x482cc6[_0x6dc8('0x3d')]);var _0x2f4078={'where':_0x63da34[_0x6dc8('0x38')]};return db[_0x6dc8('0x2a')][_0x6dc8('0x1f')](_0x2f4078)[_0x6dc8('0x25')](function(_0x400070){_0x35e1fc[_0x6dc8('0x1f')]=_0x400070;if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x63da34[_0x6dc8('0x3f')]=[{'all':!![]}];}return db[_0x6dc8('0x2a')][_0x6dc8('0x40')](_0x63da34);})[_0x6dc8('0x25')](function(_0xc46154){_0x35e1fc[_0x6dc8('0x41')]=_0xc46154;return _0x35e1fc;})[_0x6dc8('0x25')](respondWithFilteredResult(_0x4e9f46,_0x63da34))[_0x6dc8('0x42')](handleError(_0x4e9f46,null));};exports['show']=function(_0x483868,_0x1b5d94){var _0x34d6ca={'raw':!![],'where':{'id':_0x483868[_0x6dc8('0x43')]['id']}},_0x2de273={};_0x2de273[_0x6dc8('0x2e')]=_[_0x6dc8('0x30')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')]);_0x2de273[_0x6dc8('0x2f')]=_['keys'](_0x483868[_0x6dc8('0x2f')]);_0x2de273[_0x6dc8('0x31')]=_[_0x6dc8('0x44')](_0x2de273[_0x6dc8('0x2e')],_0x2de273[_0x6dc8('0x2f')]);_0x34d6ca['attributes']=_[_0x6dc8('0x44')](_0x2de273['model'],qs[_0x6dc8('0x33')](_0x483868['query']['fields']));_0x34d6ca['attributes']=_0x34d6ca['attributes'][_0x6dc8('0x34')]?_0x34d6ca[_0x6dc8('0x32')]:_0x2de273[_0x6dc8('0x2e')];if(_0x483868[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x34d6ca[_0x6dc8('0x3f')]=[{'all':!![]}];}_0x34d6ca=_[_0x6dc8('0x3b')]({},_0x34d6ca,_0x483868[_0x6dc8('0x3d')]);return db[_0x6dc8('0x2a')][_0x6dc8('0x45')](_0x34d6ca)['then'](handleEntityNotFound(_0x1b5d94,null))['then'](respondWithResult(_0x1b5d94,null))[_0x6dc8('0x42')](handleError(_0x1b5d94,null));};exports[_0x6dc8('0x46')]=function(_0x151b05,_0x2b516a){return db[_0x6dc8('0x2a')][_0x6dc8('0x46')](_0x151b05[_0x6dc8('0x47')],{})[_0x6dc8('0x25')](respondWithResult(_0x2b516a,0xc9))[_0x6dc8('0x42')](handleError(_0x2b516a,null));};exports['update']=function(_0x8fe06e,_0x387f48){if(_0x8fe06e[_0x6dc8('0x47')]['id']){delete _0x8fe06e[_0x6dc8('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x8fe06e[_0x6dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x387f48,null))[_0x6dc8('0x25')](saveUpdates(_0x8fe06e[_0x6dc8('0x47')],null))['then'](respondWithResult(_0x387f48,null))['catch'](handleError(_0x387f48,null));};exports['destroy']=function(_0x3707f8,_0x6e3f57){return db[_0x6dc8('0x2a')]['find']({'where':{'id':_0x3707f8[_0x6dc8('0x43')]['id']}})[_0x6dc8('0x25')](handleEntityNotFound(_0x6e3f57,null))[_0x6dc8('0x25')](removeEntity(_0x6e3f57,null))[_0x6dc8('0x42')](handleError(_0x6e3f57,null));};exports[_0x6dc8('0x48')]=function(_0x2db363,_0x5e9e5d){return db[_0x6dc8('0x2a')][_0x6dc8('0x48')]()['then'](respondWithResult(_0x5e9e5d,null))[_0x6dc8('0x42')](handleError(_0x5e9e5d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7039d83..e7331d2 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3d7c5b,_0x296fed){var _0x9c1421=function(_0x5477ce){while(--_0x5477ce){_0x3d7c5b['push'](_0x3d7c5b['shift']());}};_0x9c1421(++_0x296fed);}(_0x757a,0xde));var _0xa757=function(_0x3219fd,_0x1121a2){_0x3219fd=_0x3219fd-0x0;var _0x2b500e=_0x757a[_0x3219fd];return _0x2b500e;};'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')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x32db19,_0x145d3a){var _0x130d3f=function(_0xdf8f97){while(--_0xdf8f97){_0x32db19['push'](_0x32db19['shift']());}};_0x130d3f(++_0x145d3a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e7fb549..aa1ca24 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 _0x0b66=['jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','catch','UpdateChatQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37a738,_0x302f32){var _0x58a23a=function(_0x500ed0){while(--_0x500ed0){_0x37a738['push'](_0x37a738['shift']());}};_0x58a23a(++_0x302f32);}(_0x0b66,0x1b9));var _0x60b6=function(_0x362c80,_0x1b8621){_0x362c80=_0x362c80-0x0;var _0xcc5206=_0x0b66[_0x362c80];return _0xcc5206;};'use strict';var _=require('lodash');var util=require(_0x60b6('0x0'));var moment=require(_0x60b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x60b6('0x2'));var fs=require('fs');var Redis=require(_0x60b6('0x3'));var db=require(_0x60b6('0x4'))['db'];var utils=require(_0x60b6('0x5'));var logger=require(_0x60b6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x60b6('0x7'));var client=jayson[_0x60b6('0x8')][_0x60b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15fc3d,_0x4bdeca,_0x1f0265){return new BPromise(function(_0xac7161,_0x9e15ac){return client[_0x60b6('0xa')](_0x15fc3d,_0x1f0265)['then'](function(_0x100d80){logger[_0x60b6('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4bdeca,_0x60b6('0xc'));logger[_0x60b6('0xd')](_0x60b6('0xe'),_0x4bdeca,_0x60b6('0xc'),JSON['stringify'](_0x100d80));if(_0x100d80['error']){if(_0x100d80['error']['code']===0x1f4){logger[_0x60b6('0xf')](_0x60b6('0x10'),_0x4bdeca,_0x100d80['error'][_0x60b6('0x11')]);return _0x9e15ac(_0x100d80['error'][_0x60b6('0x11')]);}logger['error'](_0x60b6('0x10'),_0x4bdeca,_0x100d80[_0x60b6('0xf')]['message']);return _0xac7161(_0x100d80['error']['message']);}else{logger[_0x60b6('0xb')](_0x60b6('0x10'),_0x4bdeca,'request\x20sent');_0xac7161(_0x100d80['result']['message']);}})['catch'](function(_0x1dd9de){logger[_0x60b6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x4bdeca,_0x1dd9de);_0x9e15ac(_0x1dd9de);});});}exports[_0x60b6('0x12')]=function(_0x58c747){var _0x51418e=this;return new Promise(function(_0x391aea,_0x14ea69){return db[_0x60b6('0x13')][_0x60b6('0x14')](_0x58c747[_0x60b6('0x15')],{'raw':_0x58c747['options']?_0x58c747[_0x60b6('0x16')][_0x60b6('0x17')]===undefined?!![]:![]:!![]})[_0x60b6('0x18')](function(_0x572de3){logger['info'](_0x60b6('0x12'),_0x58c747);logger['debug'](_0x60b6('0x12'),_0x58c747,JSON[_0x60b6('0x19')](_0x572de3));_0x391aea(_0x572de3);})[_0x60b6('0x1a')](function(_0x5d6424){logger[_0x60b6('0xf')](_0x60b6('0x12'),_0x5d6424[_0x60b6('0x11')],_0x58c747);_0x14ea69(_0x51418e[_0x60b6('0xf')](0x1f4,_0x5d6424[_0x60b6('0x11')]));});});};exports[_0x60b6('0x1b')]=function(_0x25e544){var _0x469fe0=this;return new Promise(function(_0x24104f,_0x38aa5b){return db[_0x60b6('0x13')][_0x60b6('0x1c')](_0x25e544['body'],{'raw':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1d')]||null:null,'attributes':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1e')]||null:null,'limit':_0x25e544['options']?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1f')]||null:null})[_0x60b6('0x18')](function(_0x53cd4f){logger[_0x60b6('0xb')](_0x60b6('0x1b'),_0x25e544);logger['debug'](_0x60b6('0x1b'),_0x25e544,JSON[_0x60b6('0x19')](_0x53cd4f));_0x24104f(_0x53cd4f);})[_0x60b6('0x1a')](function(_0x3e79c2){logger['error']('UpdateChatQueueReport',_0x3e79c2[_0x60b6('0x11')],_0x25e544);_0x38aa5b(_0x469fe0['error'](0x1f4,_0x3e79c2[_0x60b6('0x11')]));});});}; \ No newline at end of file +var _0xd398=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','ChatQueueReport','body','options','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment'];(function(_0xa4d0d9,_0x36a590){var _0x2cb66a=function(_0x16153e){while(--_0x16153e){_0xa4d0d9['push'](_0xa4d0d9['shift']());}};_0x2cb66a(++_0x36a590);}(_0xd398,0x1dd));var _0x8d39=function(_0x2aed6b,_0x14ddb2){_0x2aed6b=_0x2aed6b-0x0;var _0x3a703d=_0xd398[_0x2aed6b];return _0x3a703d;};'use strict';var _=require(_0x8d39('0x0'));var util=require(_0x8d39('0x1'));var moment=require(_0x8d39('0x2'));var BPromise=require(_0x8d39('0x3'));var rs=require(_0x8d39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d39('0x5'))['db'];var utils=require(_0x8d39('0x6'));var logger=require(_0x8d39('0x7'))(_0x8d39('0x8'));var config=require(_0x8d39('0x9'));var jayson=require(_0x8d39('0xa'));var client=jayson[_0x8d39('0xb')][_0x8d39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38dd94,_0x1d8081,_0x41fe53){return new BPromise(function(_0x3405f3,_0x4711c7){return client['request'](_0x38dd94,_0x41fe53)[_0x8d39('0xd')](function(_0x3392e3){logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');logger[_0x8d39('0x10')](_0x8d39('0x11'),_0x1d8081,_0x8d39('0x12'),JSON['stringify'](_0x3392e3));if(_0x3392e3[_0x8d39('0x13')]){if(_0x3392e3[_0x8d39('0x13')]['code']===0x1f4){logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x4711c7(_0x3392e3[_0x8d39('0x13')]['message']);}logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x3405f3(_0x3392e3[_0x8d39('0x13')]['message']);}else{logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');_0x3405f3(_0x3392e3['result'][_0x8d39('0x14')]);}})[_0x8d39('0x15')](function(_0x182980){logger[_0x8d39('0x13')](_0x8d39('0xf'),_0x1d8081,_0x182980);_0x4711c7(_0x182980);});});}exports['CreateChatQueueReport']=function(_0x1eabfa){var _0x295ae5=this;return new Promise(function(_0x1e5f95,_0x531e41){return db[_0x8d39('0x16')]['create'](_0x1eabfa[_0x8d39('0x17')],{'raw':_0x1eabfa[_0x8d39('0x18')]?_0x1eabfa[_0x8d39('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18e30d){logger[_0x8d39('0xe')](_0x8d39('0x19'),_0x1eabfa);logger['debug']('CreateChatQueueReport',_0x1eabfa,JSON[_0x8d39('0x1a')](_0x18e30d));_0x1e5f95(_0x18e30d);})[_0x8d39('0x15')](function(_0x48d0e2){logger['error']('CreateChatQueueReport',_0x48d0e2[_0x8d39('0x14')],_0x1eabfa);_0x531e41(_0x295ae5[_0x8d39('0x13')](0x1f4,_0x48d0e2[_0x8d39('0x14')]));});});};exports[_0x8d39('0x1b')]=function(_0x57e88d){var _0x2f4f85=this;return new Promise(function(_0x488451,_0x59e406){return db[_0x8d39('0x16')][_0x8d39('0x1c')](_0x57e88d[_0x8d39('0x17')],{'raw':_0x57e88d[_0x8d39('0x18')]?_0x57e88d['options'][_0x8d39('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1e')]||null:null,'attributes':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')]['attributes']||null:null,'limit':_0x57e88d['options']?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1f')]||null:null})[_0x8d39('0xd')](function(_0x1120b6){logger[_0x8d39('0xe')](_0x8d39('0x1b'),_0x57e88d);logger[_0x8d39('0x10')](_0x8d39('0x1b'),_0x57e88d,JSON[_0x8d39('0x1a')](_0x1120b6));_0x488451(_0x1120b6);})[_0x8d39('0x15')](function(_0x57865a){logger[_0x8d39('0x13')]('UpdateChatQueueReport',_0x57865a[_0x8d39('0x14')],_0x57e88d);_0x59e406(_0x2f4f85[_0x8d39('0x13')](0x1f4,_0x57865a[_0x8d39('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index d14a5c6..5cc0c9c 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 _0x99e7=['destroy','multer','util','connect-timeout','Router','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x99e7,0x19f));var _0x799e=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0x99e7[_0x24cc72];return _0xd49f1e;};'use strict';var multer=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var path=require('path');var timeout=require(_0x799e('0x2'));var express=require('express');var router=express[_0x799e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x799e('0x4'));var config=require('../../config/environment');var controller=require(_0x799e('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x799e('0x6')]);router[_0x799e('0x7')](_0x799e('0x8'),auth[_0x799e('0x9')](),controller[_0x799e('0xa')]);router['get'](_0x799e('0xb'),auth['isAuthenticated'](),controller[_0x799e('0xc')]);router[_0x799e('0xd')]('/',auth[_0x799e('0x9')](),controller[_0x799e('0xe')]);router[_0x799e('0xf')](_0x799e('0xb'),auth[_0x799e('0x9')](),controller[_0x799e('0x10')]);router['delete'](_0x799e('0xb'),auth[_0x799e('0x9')](),controller[_0x799e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5ade=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','post','put'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x5ade,0x116));var _0xe5ad=function(_0x4d1002,_0x1575ac){_0x4d1002=_0x4d1002-0x0;var _0x441aba=_0x5ade[_0x4d1002];return _0x441aba;};'use strict';var multer=require(_0xe5ad('0x0'));var util=require(_0xe5ad('0x1'));var path=require(_0xe5ad('0x2'));var timeout=require(_0xe5ad('0x3'));var express=require('express');var router=express[_0xe5ad('0x4')]();var fs_extra=require(_0xe5ad('0x5'));var auth=require(_0xe5ad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5ad('0x7'));var controller=require(_0xe5ad('0x8'));router['get']('/',auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xa')]);router['get'](_0xe5ad('0xb'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xc')]);router[_0xe5ad('0xd')]('/:id',auth[_0xe5ad('0x9')](),controller['show']);router[_0xe5ad('0xe')]('/',auth[_0xe5ad('0x9')](),controller['create']);router[_0xe5ad('0xf')](_0xe5ad('0x10'),auth['isAuthenticated'](),controller[_0xe5ad('0x11')]);router[_0xe5ad('0x12')](_0xe5ad('0x10'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0x13')]);module[_0xe5ad('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index be372c5..199e04e 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5ddfd6,_0x32ddcd){var _0x5a7ba9=function(_0x476c78){while(--_0x476c78){_0x5ddfd6['push'](_0x5ddfd6['shift']());}};_0x5a7ba9(++_0x32ddcd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x276c27,_0x5e56dd){var _0x56fbe4=function(_0x3ea975){while(--_0x3ea975){_0x276c27['push'](_0x276c27['shift']());}};_0x56fbe4(++_0x5e56dd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5f49691..34a6d06 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 _0xb70e=['VIRTUAL','options','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','ChatTransferReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type'];(function(_0x684bee,_0xbf2e7){var _0x524c9f=function(_0x18b127){while(--_0x18b127){_0x684bee['push'](_0x684bee['shift']());}};_0x524c9f(++_0xbf2e7);}(_0xb70e,0x1ee));var _0xeb70=function(_0xbd28e,_0x250eb3){_0xbd28e=_0xbd28e-0x0;var _0x1155e0=_0xb70e[_0xbd28e];return _0x1155e0;};'use strict';var emlformat=require(_0xeb70('0x0'));var rimraf=require(_0xeb70('0x1'));var zipdir=require(_0xeb70('0x2'));var jsonpatch=require(_0xeb70('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb70('0x4'));var util=require('util');var path=require('path');var sox=require(_0xeb70('0x5'));var csv=require(_0xeb70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb70('0x7'));var _=require(_0xeb70('0x8'));var squel=require(_0xeb70('0x9'));var crypto=require(_0xeb70('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xeb70('0xb'));var toCsv=require(_0xeb70('0x6'));var querystring=require(_0xeb70('0xc'));var Papa=require(_0xeb70('0xd'));var Redis=require('ioredis');var authService=require(_0xeb70('0xe'));var qs=require(_0xeb70('0xf'));var as=require(_0xeb70('0x10'));var hardwareService=require(_0xeb70('0x11'));var logger=require(_0xeb70('0x12'))(_0xeb70('0x13'));var utils=require(_0xeb70('0x14'));var config=require(_0xeb70('0x15'));var licenseUtil=require(_0xeb70('0x16'));var db=require(_0xeb70('0x17'))['db'];function respondWithStatusCode(_0x3eb8ae,_0x4b9e47){_0x4b9e47=_0x4b9e47||0xcc;return function(_0x5d5ae1){if(_0x5d5ae1){return _0x3eb8ae[_0xeb70('0x18')](_0x4b9e47);}return _0x3eb8ae[_0xeb70('0x19')](_0x4b9e47)['end']();};}function respondWithResult(_0x441660,_0x281388){_0x281388=_0x281388||0xc8;return function(_0xa4bf6a){if(_0xa4bf6a){return _0x441660[_0xeb70('0x19')](_0x281388)[_0xeb70('0x1a')](_0xa4bf6a);}};}function respondWithFilteredResult(_0x12e262,_0x58c304){return function(_0xcd3d48){if(_0xcd3d48){var _0xad4bba=typeof _0x58c304[_0xeb70('0x1b')]===_0xeb70('0x1c')&&typeof _0x58c304[_0xeb70('0x1d')]===_0xeb70('0x1c');var _0x1d525b=_0xcd3d48[_0xeb70('0x1e')];var _0x102ac6=_0xad4bba?0x0:_0x58c304['offset'];var _0x37c934=_0xad4bba?_0xcd3d48[_0xeb70('0x1e')]:_0x58c304[_0xeb70('0x1b')]+_0x58c304['limit'];var _0x2577ac;if(_0x37c934>=_0x1d525b){_0x37c934=_0x1d525b;_0x2577ac=0xc8;}else{_0x2577ac=0xce;}_0x12e262[_0xeb70('0x19')](_0x2577ac);return _0x12e262[_0xeb70('0x1f')](_0xeb70('0x20'),_0x102ac6+'-'+_0x37c934+'/'+_0x1d525b)[_0xeb70('0x1a')](_0xcd3d48);}return null;};}function patchUpdates(_0x68c67f){return function(_0x213252){try{jsonpatch[_0xeb70('0x21')](_0x213252,_0x68c67f,!![]);}catch(_0x327a6a){return BPromise['reject'](_0x327a6a);}return _0x213252['save']();};}function saveUpdates(_0x296b49,_0x14119a){return function(_0x286b57){if(_0x286b57){return _0x286b57[_0xeb70('0x22')](_0x296b49)[_0xeb70('0x23')](function(_0x890e1f){return _0x890e1f;});}return null;};}function removeEntity(_0x40743f,_0x1a4f0c){return function(_0x3deb1f){if(_0x3deb1f){return _0x3deb1f['destroy']()[_0xeb70('0x23')](function(){_0x40743f[_0xeb70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a9a0,_0x2c81ab){return function(_0x158196){if(!_0x158196){_0x34a9a0['sendStatus'](0x194);}return _0x158196;};}function handleError(_0x4c69b4,_0x2813a0){_0x2813a0=_0x2813a0||0x1f4;return function(_0x538d43){logger[_0xeb70('0x24')](_0x538d43[_0xeb70('0x25')]);if(_0x538d43[_0xeb70('0x26')]){delete _0x538d43[_0xeb70('0x26')];}_0x4c69b4[_0xeb70('0x19')](_0x2813a0)[_0xeb70('0x27')](_0x538d43);};}exports['index']=function(_0x3eab93,_0x24c07b){var _0x5edf6e={},_0x307aa7={},_0x22ae05={'count':0x0,'rows':[]};var _0x3abe83=_[_0xeb70('0x28')](db[_0xeb70('0x29')][_0xeb70('0x2a')],function(_0xa88baa){return{'name':_0xa88baa['fieldName'],'type':_0xa88baa['type']['key']};});_0x307aa7['model']=_[_0xeb70('0x28')](_0x3abe83,_0xeb70('0x26'));_0x307aa7[_0xeb70('0x2b')]=_[_0xeb70('0x2c')](_0x3eab93[_0xeb70('0x2b')]);_0x307aa7[_0xeb70('0x2d')]=_[_0xeb70('0x2e')](_0x307aa7[_0xeb70('0x2f')],_0x307aa7[_0xeb70('0x2b')]);_0x5edf6e[_0xeb70('0x30')]=_[_0xeb70('0x2e')](_0x307aa7['model'],qs['fields'](_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x31')]));_0x5edf6e[_0xeb70('0x30')]=_0x5edf6e[_0xeb70('0x30')][_0xeb70('0x32')]?_0x5edf6e[_0xeb70('0x30')]:_0x307aa7[_0xeb70('0x2f')];if(!_0x3eab93['query']['hasOwnProperty'](_0xeb70('0x33'))){_0x5edf6e[_0xeb70('0x1d')]=qs[_0xeb70('0x1d')](_0x3eab93[_0xeb70('0x2b')]['limit']);_0x5edf6e[_0xeb70('0x1b')]=qs[_0xeb70('0x1b')](_0x3eab93[_0xeb70('0x2b')]['offset']);}_0x5edf6e['order']=qs[_0xeb70('0x34')](_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x34')]);_0x5edf6e[_0xeb70('0x35')]=qs[_0xeb70('0x2d')](_[_0xeb70('0x36')](_0x3eab93[_0xeb70('0x2b')],_0x307aa7['filters']),_0x3abe83);if(_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x37')]){_0x5edf6e[_0xeb70('0x35')]=_[_0xeb70('0x38')](_0x5edf6e[_0xeb70('0x35')],{'$or':_[_0xeb70('0x28')](_0x3abe83,function(_0x72c856){if(_0x72c856[_0xeb70('0x39')]!==_0xeb70('0x3a')){var _0x23657a={};_0x23657a[_0x72c856[_0xeb70('0x26')]]={'$like':'%'+_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x37')]+'%'};return _0x23657a;}})});}_0x5edf6e=_[_0xeb70('0x38')]({},_0x5edf6e,_0x3eab93[_0xeb70('0x3b')]);var _0x1c318e={'where':_0x5edf6e[_0xeb70('0x35')]};return db[_0xeb70('0x29')][_0xeb70('0x1e')](_0x1c318e)[_0xeb70('0x23')](function(_0x157992){_0x22ae05[_0xeb70('0x1e')]=_0x157992;if(_0x3eab93[_0xeb70('0x2b')]['includeAll']){_0x5edf6e[_0xeb70('0x3c')]=[{'all':!![]}];}return db[_0xeb70('0x29')]['findAll'](_0x5edf6e);})['then'](function(_0xf6a928){_0x22ae05[_0xeb70('0x3d')]=_0xf6a928;return _0x22ae05;})[_0xeb70('0x23')](respondWithFilteredResult(_0x24c07b,_0x5edf6e))[_0xeb70('0x3e')](handleError(_0x24c07b,null));};exports[_0xeb70('0x3f')]=function(_0x559cb0,_0x596ac2){var _0x4094b0={'raw':!![],'where':{'id':_0x559cb0[_0xeb70('0x40')]['id']}},_0x15de9b={};_0x15de9b[_0xeb70('0x2f')]=_[_0xeb70('0x2c')](db[_0xeb70('0x29')]['rawAttributes']);_0x15de9b[_0xeb70('0x2b')]=_[_0xeb70('0x2c')](_0x559cb0[_0xeb70('0x2b')]);_0x15de9b[_0xeb70('0x2d')]=_['intersection'](_0x15de9b[_0xeb70('0x2f')],_0x15de9b[_0xeb70('0x2b')]);_0x4094b0[_0xeb70('0x30')]=_[_0xeb70('0x2e')](_0x15de9b[_0xeb70('0x2f')],qs[_0xeb70('0x31')](_0x559cb0[_0xeb70('0x2b')]['fields']));_0x4094b0[_0xeb70('0x30')]=_0x4094b0['attributes'][_0xeb70('0x32')]?_0x4094b0[_0xeb70('0x30')]:_0x15de9b[_0xeb70('0x2f')];if(_0x559cb0[_0xeb70('0x2b')]['includeAll']){_0x4094b0[_0xeb70('0x3c')]=[{'all':!![]}];}_0x4094b0=_[_0xeb70('0x38')]({},_0x4094b0,_0x559cb0[_0xeb70('0x3b')]);return db[_0xeb70('0x29')][_0xeb70('0x41')](_0x4094b0)['then'](handleEntityNotFound(_0x596ac2,null))[_0xeb70('0x23')](respondWithResult(_0x596ac2,null))[_0xeb70('0x3e')](handleError(_0x596ac2,null));};exports[_0xeb70('0x42')]=function(_0x158500,_0x23283a){return db[_0xeb70('0x29')][_0xeb70('0x42')](_0x158500[_0xeb70('0x43')],{})[_0xeb70('0x23')](respondWithResult(_0x23283a,0xc9))['catch'](handleError(_0x23283a,null));};exports[_0xeb70('0x22')]=function(_0x418a26,_0x2c7b4e){if(_0x418a26[_0xeb70('0x43')]['id']){delete _0x418a26[_0xeb70('0x43')]['id'];}return db['ChatTransferReport'][_0xeb70('0x41')]({'where':{'id':_0x418a26[_0xeb70('0x40')]['id']}})[_0xeb70('0x23')](handleEntityNotFound(_0x2c7b4e,null))[_0xeb70('0x23')](saveUpdates(_0x418a26[_0xeb70('0x43')],null))['then'](respondWithResult(_0x2c7b4e,null))[_0xeb70('0x3e')](handleError(_0x2c7b4e,null));};exports['destroy']=function(_0xa8b10f,_0x4fa856){return db['ChatTransferReport'][_0xeb70('0x41')]({'where':{'id':_0xa8b10f[_0xeb70('0x40')]['id']}})['then'](handleEntityNotFound(_0x4fa856,null))['then'](removeEntity(_0x4fa856,null))['catch'](handleError(_0x4fa856,null));};exports[_0xeb70('0x44')]=function(_0x3d7554,_0x4949b5){return db[_0xeb70('0x29')][_0xeb70('0x44')]()[_0xeb70('0x23')](respondWithResult(_0x4949b5,null))[_0xeb70('0x3e')](handleError(_0x4949b5,null));}; \ No newline at end of file +var _0x7a8f=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x7a8f,0x1ed));var _0xf7a8=function(_0xe3d180,_0x1a2a7f){_0xe3d180=_0xe3d180-0x0;var _0x440869=_0x7a8f[_0xe3d180];return _0x440869;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a8('0x1'));var rp=require('request-promise');var moment=require(_0xf7a8('0x2'));var BPromise=require(_0xf7a8('0x3'));var Mustache=require(_0xf7a8('0x4'));var util=require('util');var path=require(_0xf7a8('0x5'));var sox=require(_0xf7a8('0x6'));var csv=require(_0xf7a8('0x7'));var ejs=require(_0xf7a8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a8('0x9'));var squel=require(_0xf7a8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf7a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf7a8('0xc'));var Papa=require(_0xf7a8('0xd'));var Redis=require(_0xf7a8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7a8('0xf'));var logger=require('../../config/logger')(_0xf7a8('0x10'));var utils=require(_0xf7a8('0x11'));var config=require(_0xf7a8('0x12'));var licenseUtil=require(_0xf7a8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28bec7,_0x3e970a){_0x3e970a=_0x3e970a||0xcc;return function(_0x5b0af9){if(_0x5b0af9){return _0x28bec7['sendStatus'](_0x3e970a);}return _0x28bec7[_0xf7a8('0x14')](_0x3e970a)['end']();};}function respondWithResult(_0x5c13e7,_0x43a604){_0x43a604=_0x43a604||0xc8;return function(_0x4a60d2){if(_0x4a60d2){return _0x5c13e7['status'](_0x43a604)['json'](_0x4a60d2);}};}function respondWithFilteredResult(_0x3b6769,_0x11a9b7){return function(_0x7655a3){if(_0x7655a3){var _0x339fdf=typeof _0x11a9b7['offset']===_0xf7a8('0x15')&&typeof _0x11a9b7[_0xf7a8('0x16')]===_0xf7a8('0x15');var _0x5457d2=_0x7655a3[_0xf7a8('0x17')];var _0x197b6f=_0x339fdf?0x0:_0x11a9b7['offset'];var _0x568db1=_0x339fdf?_0x7655a3['count']:_0x11a9b7[_0xf7a8('0x18')]+_0x11a9b7['limit'];var _0xc5b680;if(_0x568db1>=_0x5457d2){_0x568db1=_0x5457d2;_0xc5b680=0xc8;}else{_0xc5b680=0xce;}_0x3b6769[_0xf7a8('0x14')](_0xc5b680);return _0x3b6769[_0xf7a8('0x19')](_0xf7a8('0x1a'),_0x197b6f+'-'+_0x568db1+'/'+_0x5457d2)['json'](_0x7655a3);}return null;};}function patchUpdates(_0x4216db){return function(_0x1e8cdc){try{jsonpatch[_0xf7a8('0x1b')](_0x1e8cdc,_0x4216db,!![]);}catch(_0x37961a){return BPromise['reject'](_0x37961a);}return _0x1e8cdc[_0xf7a8('0x1c')]();};}function saveUpdates(_0x3d2f98,_0xccae90){return function(_0x186469){if(_0x186469){return _0x186469[_0xf7a8('0x1d')](_0x3d2f98)[_0xf7a8('0x1e')](function(_0x49ed45){return _0x49ed45;});}return null;};}function removeEntity(_0x32ab43,_0x332060){return function(_0x4976e9){if(_0x4976e9){return _0x4976e9['destroy']()[_0xf7a8('0x1e')](function(){_0x32ab43[_0xf7a8('0x14')](0xcc)[_0xf7a8('0x1f')]();});}};}function handleEntityNotFound(_0x203c8d,_0x21d53e){return function(_0x55c905){if(!_0x55c905){_0x203c8d[_0xf7a8('0x20')](0x194);}return _0x55c905;};}function handleError(_0xad5e79,_0x3337ed){_0x3337ed=_0x3337ed||0x1f4;return function(_0x1350ad){logger['error'](_0x1350ad[_0xf7a8('0x21')]);if(_0x1350ad[_0xf7a8('0x22')]){delete _0x1350ad[_0xf7a8('0x22')];}_0xad5e79[_0xf7a8('0x14')](_0x3337ed)[_0xf7a8('0x23')](_0x1350ad);};}exports[_0xf7a8('0x24')]=function(_0x29d995,_0x558779){var _0x222931={},_0x4d224d={},_0x57b6b7={'count':0x0,'rows':[]};var _0x3f43fa=_[_0xf7a8('0x25')](db[_0xf7a8('0x26')][_0xf7a8('0x27')],function(_0x18673c){return{'name':_0x18673c['fieldName'],'type':_0x18673c[_0xf7a8('0x28')][_0xf7a8('0x29')]};});_0x4d224d[_0xf7a8('0x2a')]=_['map'](_0x3f43fa,_0xf7a8('0x22'));_0x4d224d[_0xf7a8('0x2b')]=_[_0xf7a8('0x2c')](_0x29d995['query']);_0x4d224d[_0xf7a8('0x2d')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],_0x4d224d[_0xf7a8('0x2b')]);_0x222931[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],qs[_0xf7a8('0x30')](_0x29d995['query'][_0xf7a8('0x30')]));_0x222931[_0xf7a8('0x2f')]=_0x222931[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x222931[_0xf7a8('0x2f')]:_0x4d224d['model'];if(!_0x29d995['query'][_0xf7a8('0x32')]('nolimit')){_0x222931['limit']=qs[_0xf7a8('0x16')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x16')]);_0x222931[_0xf7a8('0x18')]=qs[_0xf7a8('0x18')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x18')]);}_0x222931[_0xf7a8('0x33')]=qs[_0xf7a8('0x34')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x34')]);_0x222931[_0xf7a8('0x35')]=qs[_0xf7a8('0x2d')](_[_0xf7a8('0x36')](_0x29d995[_0xf7a8('0x2b')],_0x4d224d[_0xf7a8('0x2d')]),_0x3f43fa);if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]){_0x222931['where']=_[_0xf7a8('0x38')](_0x222931[_0xf7a8('0x35')],{'$or':_[_0xf7a8('0x25')](_0x3f43fa,function(_0x26c466){if(_0x26c466[_0xf7a8('0x28')]!==_0xf7a8('0x39')){var _0x28520c={};_0x28520c[_0x26c466[_0xf7a8('0x22')]]={'$like':'%'+_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]+'%'};return _0x28520c;}})});}_0x222931=_[_0xf7a8('0x38')]({},_0x222931,_0x29d995[_0xf7a8('0x3a')]);var _0x50eb7c={'where':_0x222931[_0xf7a8('0x35')]};return db[_0xf7a8('0x26')][_0xf7a8('0x17')](_0x50eb7c)[_0xf7a8('0x1e')](function(_0x40073c){_0x57b6b7['count']=_0x40073c;if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x3b')]){_0x222931['include']=[{'all':!![]}];}return db[_0xf7a8('0x26')]['findAll'](_0x222931);})['then'](function(_0x3bde50){_0x57b6b7['rows']=_0x3bde50;return _0x57b6b7;})[_0xf7a8('0x1e')](respondWithFilteredResult(_0x558779,_0x222931))[_0xf7a8('0x3c')](handleError(_0x558779,null));};exports['show']=function(_0x1ed415,_0x344520){var _0x2a24e2={'raw':!![],'where':{'id':_0x1ed415[_0xf7a8('0x3d')]['id']}},_0x3c9da8={};_0x3c9da8[_0xf7a8('0x2a')]=_[_0xf7a8('0x2c')](db['ChatTransferReport']['rawAttributes']);_0x3c9da8['query']=_[_0xf7a8('0x2c')](_0x1ed415[_0xf7a8('0x2b')]);_0x3c9da8['filters']=_[_0xf7a8('0x2e')](_0x3c9da8[_0xf7a8('0x2a')],_0x3c9da8[_0xf7a8('0x2b')]);_0x2a24e2[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x3c9da8['model'],qs['fields'](_0x1ed415[_0xf7a8('0x2b')][_0xf7a8('0x30')]));_0x2a24e2[_0xf7a8('0x2f')]=_0x2a24e2[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x2a24e2[_0xf7a8('0x2f')]:_0x3c9da8[_0xf7a8('0x2a')];if(_0x1ed415[_0xf7a8('0x2b')]['includeAll']){_0x2a24e2[_0xf7a8('0x3e')]=[{'all':!![]}];}_0x2a24e2=_[_0xf7a8('0x38')]({},_0x2a24e2,_0x1ed415[_0xf7a8('0x3a')]);return db[_0xf7a8('0x26')][_0xf7a8('0x3f')](_0x2a24e2)[_0xf7a8('0x1e')](handleEntityNotFound(_0x344520,null))[_0xf7a8('0x1e')](respondWithResult(_0x344520,null))['catch'](handleError(_0x344520,null));};exports[_0xf7a8('0x40')]=function(_0x4554aa,_0x401e65){return db['ChatTransferReport']['create'](_0x4554aa[_0xf7a8('0x41')],{})[_0xf7a8('0x1e')](respondWithResult(_0x401e65,0xc9))['catch'](handleError(_0x401e65,null));};exports[_0xf7a8('0x1d')]=function(_0x3063fb,_0xf9b5ee){if(_0x3063fb[_0xf7a8('0x41')]['id']){delete _0x3063fb[_0xf7a8('0x41')]['id'];}return db[_0xf7a8('0x26')][_0xf7a8('0x3f')]({'where':{'id':_0x3063fb[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0xf9b5ee,null))[_0xf7a8('0x1e')](saveUpdates(_0x3063fb['body'],null))['then'](respondWithResult(_0xf9b5ee,null))['catch'](handleError(_0xf9b5ee,null));};exports[_0xf7a8('0x42')]=function(_0xec247,_0x5d59b0){return db['ChatTransferReport'][_0xf7a8('0x3f')]({'where':{'id':_0xec247[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0x5d59b0,null))[_0xf7a8('0x1e')](removeEntity(_0x5d59b0,null))[_0xf7a8('0x3c')](handleError(_0x5d59b0,null));};exports['describe']=function(_0x55b380,_0x33f4cb){return db[_0xf7a8('0x26')][_0xf7a8('0x43')]()[_0xf7a8('0x1e')](respondWithResult(_0x33f4cb,null))[_0xf7a8('0x3c')](handleError(_0x33f4cb,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 84de1fb..8044a8b 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 _0x934a=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x541fdf,_0x268606){var _0x3f11cf=function(_0x103d78){while(--_0x103d78){_0x541fdf['push'](_0x541fdf['shift']());}};_0x3f11cf(++_0x268606);}(_0x934a,0xfe));var _0xa934=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x934a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xa934('0x0'));var util=require(_0xa934('0x1'));var logger=require(_0xa934('0x2'))(_0xa934('0x3'));var moment=require('moment');var BPromise=require(_0xa934('0x4'));var rp=require(_0xa934('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa934('0x6'));var config=require(_0xa934('0x7'));var attributes=require(_0xa934('0x8'));module['exports']=function(_0x17157b,_0x8cab85){return _0x17157b[_0xa934('0x9')]('ChatTransferReport',attributes,{'tableName':_0xa934('0xa'),'paranoid':![],'indexes':[{'name':_0xa934('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f73=['util','../../config/logger','moment','bluebird','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash'];(function(_0x7eb7d6,_0x52900e){var _0x1cabf5=function(_0x4a59d9){while(--_0x4a59d9){_0x7eb7d6['push'](_0x7eb7d6['shift']());}};_0x1cabf5(++_0x52900e);}(_0x0f73,0x117));var _0x30f7=function(_0x4145da,_0x1dcf93){_0x4145da=_0x4145da-0x0;var _0x2dd421=_0x0f73[_0x4145da];return _0x2dd421;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var logger=require(_0x30f7('0x2'))('api');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x30f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x30f7('0x6'));module[_0x30f7('0x7')]=function(_0x1b8159,_0x43107f){return _0x1b8159['define'](_0x30f7('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x30f7('0x9'),'fields':[_0x30f7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 941f722..60833dc 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 _0xc4ce=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0xc4ce,0x1e4));var _0xec4c=function(_0x31add5,_0x2879bb){_0x31add5=_0x31add5-0x0;var _0x23b83c=_0xc4ce[_0x31add5];return _0x23b83c;};'use strict';var _=require(_0xec4c('0x0'));var util=require(_0xec4c('0x1'));var moment=require(_0xec4c('0x2'));var BPromise=require('bluebird');var rs=require(_0xec4c('0x3'));var fs=require('fs');var Redis=require(_0xec4c('0x4'));var db=require(_0xec4c('0x5'))['db'];var utils=require(_0xec4c('0x6'));var logger=require('../../config/logger')(_0xec4c('0x7'));var config=require(_0xec4c('0x8'));var jayson=require(_0xec4c('0x9'));var client=jayson[_0xec4c('0xa')][_0xec4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x598148,_0x5e64a7,_0x58c6a3){return new BPromise(function(_0x3787c2,_0xd47b81){return client[_0xec4c('0xc')](_0x598148,_0x58c6a3)['then'](function(_0x3c9b92){logger['info'](_0xec4c('0xd'),_0x5e64a7,_0xec4c('0xe'));logger[_0xec4c('0xf')](_0xec4c('0x10'),_0x5e64a7,_0xec4c('0xe'),JSON[_0xec4c('0x11')](_0x3c9b92));if(_0x3c9b92[_0xec4c('0x12')]){if(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x13')]===0x1f4){logger[_0xec4c('0x12')](_0xec4c('0xd'),_0x5e64a7,_0x3c9b92['error'][_0xec4c('0x14')]);return _0xd47b81(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);}logger[_0xec4c('0x12')](_0xec4c('0xd'),_0x5e64a7,_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);return _0x3787c2(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);}else{logger[_0xec4c('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x5e64a7,'request\x20sent');_0x3787c2(_0x3c9b92[_0xec4c('0x16')][_0xec4c('0x14')]);}})[_0xec4c('0x17')](function(_0x526fd2){logger['error'](_0xec4c('0xd'),_0x5e64a7,_0x526fd2);_0xd47b81(_0x526fd2);});});} \ No newline at end of file +var _0x73ef=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x463dcb,_0x92aa0b){var _0x54722b=function(_0xc25df9){while(--_0xc25df9){_0x463dcb['push'](_0x463dcb['shift']());}};_0x54722b(++_0x92aa0b);}(_0x73ef,0xdc));var _0xf73e=function(_0x4a114e,_0x4e839e){_0x4a114e=_0x4a114e-0x0;var _0x968eb3=_0x73ef[_0x4a114e];return _0x968eb3;};'use strict';var _=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var moment=require(_0xf73e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf73e('0x3'));var db=require(_0xf73e('0x4'))['db'];var utils=require(_0xf73e('0x5'));var logger=require(_0xf73e('0x6'))(_0xf73e('0x7'));var config=require(_0xf73e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf73e('0x9')][_0xf73e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49969,_0x26ad2a,_0x501d42){return new BPromise(function(_0x1a7f3d,_0x3f282a){return client['request'](_0x49969,_0x501d42)[_0xf73e('0xb')](function(_0x1719b1){logger[_0xf73e('0xc')](_0xf73e('0xd'),_0x26ad2a,_0xf73e('0xe'));logger[_0xf73e('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x26ad2a,'request\x20sent',JSON['stringify'](_0x1719b1));if(_0x1719b1[_0xf73e('0x10')]){if(_0x1719b1['error']['code']===0x1f4){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x3f282a(_0x1719b1[_0xf73e('0x10')]['message']);}logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x1a7f3d(_0x1719b1[_0xf73e('0x10')][_0xf73e('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x26ad2a,_0xf73e('0xe'));_0x1a7f3d(_0x1719b1[_0xf73e('0x12')][_0xf73e('0x11')]);}})[_0xf73e('0x13')](function(_0x5e91ed){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x5e91ed);_0x3f282a(_0x5e91ed);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a41555a..fdff3a5 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 _0x2455=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','isAuthenticated','show','post','create','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53ff1b,_0xc2a0fa){var _0x34ef7d=function(_0x56f681){while(--_0x56f681){_0x53ff1b['push'](_0x53ff1b['shift']());}};_0x34ef7d(++_0xc2a0fa);}(_0x2455,0x7a));var _0x5245=function(_0x3ddefb,_0x2641f9){_0x3ddefb=_0x3ddefb-0x0;var _0x206cfc=_0x2455[_0x3ddefb];return _0x206cfc;};'use strict';var multer=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var path=require(_0x5245('0x2'));var timeout=require(_0x5245('0x3'));var express=require(_0x5245('0x4'));var router=express[_0x5245('0x5')]();var fs_extra=require(_0x5245('0x6'));var auth=require(_0x5245('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5245('0x8'));var controller=require(_0x5245('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5245('0xa')]);router[_0x5245('0xb')](_0x5245('0xc'),auth['isAuthenticated'](),controller[_0x5245('0xd')]);router[_0x5245('0xb')]('/:id',auth[_0x5245('0xe')](),controller[_0x5245('0xf')]);router[_0x5245('0x10')]('/',auth[_0x5245('0xe')](),controller[_0x5245('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5245('0x12'),auth[_0x5245('0xe')](),controller[_0x5245('0x13')]);module[_0x5245('0x14')]=router; \ No newline at end of file +var _0xac93=['/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','describe','get'];(function(_0x5a7dfe,_0x3d1ab0){var _0x5a658=function(_0x485dec){while(--_0x485dec){_0x5a7dfe['push'](_0x5a7dfe['shift']());}};_0x5a658(++_0x3d1ab0);}(_0xac93,0xf0));var _0x3ac9=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xac93[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0x3ac9('0x0'));var util=require(_0x3ac9('0x1'));var path=require(_0x3ac9('0x2'));var timeout=require(_0x3ac9('0x3'));var express=require(_0x3ac9('0x4'));var router=express[_0x3ac9('0x5')]();var fs_extra=require(_0x3ac9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ac9('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x9')]);router['get']('/describe',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xa')]);router[_0x3ac9('0xb')](_0x3ac9('0xc'),auth['isAuthenticated'](),controller[_0x3ac9('0xd')]);router[_0x3ac9('0xe')]('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xf')]);router[_0x3ac9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3ac9('0xc'),auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 90615c1..eb80b37 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 _0x3c81=['bottom_right','alternate','#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','text','input','parse','getDataValue','setDataValue','onlineForm','textarea','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias'];(function(_0x3f417c,_0x123722){var _0x45d920=function(_0x1ce62f){while(--_0x1ce62f){_0x3f417c['push'](_0x3f417c['shift']());}};_0x45d920(++_0x123722);}(_0x3c81,0x102));var _0x13c8=function(_0x3ab056,_0x2c63d5){_0x3ab056=_0x3ab056-0x0;var _0x465cff=_0x3c81[_0x3ab056];return _0x465cff;};'use strict';var Sequelize=require(_0x13c8('0x0'));var rs=require(_0x13c8('0x1'));module['exports']={'name':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x3')},'key':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x4')},'customerAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x13c8('0x2')]},'animation':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x13c8('0x8')](_0x13c8('0x9'),_0x13c8('0xa')),'defaultValue':_0x13c8('0x9')},'header_online':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xb')},'start_chat_button':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xc')},'header_offline':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x13c8('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x11')},'placeholderMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x12')},'closingMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x13')},'closingMessageButton':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xc')},'skipMessageButton':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x14')},'conditionAgreement':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x13c8('0x16'),_0x13c8('0x17')),'defaultValue':_0x13c8('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':function(){return JSON[_0x13c8('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x13c8('0x19'),'type':_0x13c8('0x1a'),'required':!![]},'props':{'title':_0x13c8('0x19'),'helpText':''}},{'type':_0x13c8('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13c8('0x3'),'type':_0x13c8('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x13c8('0x1c')](this[_0x13c8('0x1d')]('onlineForm')):{};},'set':function(_0x5ad0dc){return this[_0x13c8('0x1e')](_0x13c8('0x1f'),JSON['stringify'](_0x5ad0dc));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x13c8('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13c8('0x3'),'type':_0x13c8('0x3')},'variable':null},{'type':_0x13c8('0x20'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x13c8('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x13c8('0x1d')](_0x13c8('0x22'))?JSON[_0x13c8('0x1c')](this[_0x13c8('0x1d')](_0x13c8('0x22'))):{};},'set':function(_0x343080){return this['setDataValue'](_0x13c8('0x22'),JSON[_0x13c8('0x18')](_0x343080));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x13c8('0x2')]},'forwardOffline':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x23')},'waitingMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x13c8('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x13c8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':function(){return _0x13c8('0x28');}},'notificationSound':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0x2b')},'defaultTitle':{'type':Sequelize[_0x13c8('0x2')]},'customerAvatar':{'type':Sequelize[_0x13c8('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x13c8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x2d')},'systemAvatar':{'type':Sequelize[_0x13c8('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x13c8('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x343dba){if(!_0x343dba)this[_0x13c8('0x1e')](_0x13c8('0x2e'),null);this[_0x13c8('0x1e')](_0x13c8('0x2f'),_0x343dba);}},'vidaooEscalation':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x13c8('0x2')]},'vidaooTopic':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x30')},'vidaooNote':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':function(){return _0x13c8('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x13c8('0xe')]}}; \ No newline at end of file +var _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x405a50,_0x1cbebf){var _0x195319=function(_0xa4e9f9){while(--_0xa4e9f9){_0x405a50['push'](_0x405a50['shift']());}};_0x195319(++_0x1cbebf);}(_0xe706,0xa3));var _0x6e70=function(_0x5b5095,_0x4518d0){_0x5b5095=_0x5b5095-0x0;var _0x54d290=_0xe706[_0x5b5095];return _0x54d290;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 83b4a57..8cf3b6c 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 _0x42ba=['Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','priority','account','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','openNewInteraction','sequelize','Attachment','MailServerOut','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','MailAccountId','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','all','URL','address','origin','3.1.0','remote','x-real-ip','remoteAddress','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','html-to-text','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','update','destroy','get','ChatWebsites','then','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','intersection','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','create','nolimit','order','removeDispositions','ids','CannedAnswer','getAnswers','findOne','include','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','user-agent','chat'];(function(_0x28c117,_0x590409){var _0x397766=function(_0x1ce4c9){while(--_0x1ce4c9){_0x28c117['push'](_0x28c117['shift']());}};_0x397766(++_0x590409);}(_0x42ba,0x1cc));var _0xa42b=function(_0x29dab8,_0x428035){_0x29dab8=_0x29dab8-0x0;var _0x2bbcf3=_0x42ba[_0x29dab8];return _0x2bbcf3;};'use strict';var BPromise=require(_0xa42b('0x0'));var Mustache=require(_0xa42b('0x1'));var util=require(_0xa42b('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa42b('0x3'));var _=require(_0xa42b('0x4'));var querystring=require(_0xa42b('0x5'));var Redis=require('ioredis');var qs=require(_0xa42b('0x6'));var logger=require(_0xa42b('0x7'))(_0xa42b('0x8'));var config=require(_0xa42b('0x9'));var url=require('url');var db=require(_0xa42b('0xa'))['db'];config['redis']=_[_0xa42b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa42b('0xc'))(new Redis(config[_0xa42b('0xd')]));require(_0xa42b('0xe'))['register'](socket);var htmlToText=require(_0xa42b('0xf'));var jayson=require(_0xa42b('0x10'));var client=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232c});var client9002=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232a});var client9003=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232b});var client9001=jayson[_0xa42b('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x2324d0,_0x2c1bff,_0x25dbcd,_0x271467){return new BPromise(function(_0xc67c82,_0x438a9f){var _0x4fb608=_0x271467||client;return _0x4fb608['request'](_0x2324d0,_0x25dbcd)['then'](function(_0xd7be20){logger[_0xa42b('0x13')](_0xa42b('0x14'),_0x2c1bff,'request\x20sent');logger['debug'](_0xa42b('0x15'),_0x2c1bff,_0xa42b('0x16'),JSON[_0xa42b('0x17')](_0xd7be20));if(_0xd7be20[_0xa42b('0x18')]){if(_0xd7be20[_0xa42b('0x18')][_0xa42b('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2c1bff,_0xd7be20[_0xa42b('0x18')][_0xa42b('0x1a')]);return _0x438a9f(_0xd7be20[_0xa42b('0x18')]['message']);}logger['error'](_0xa42b('0x14'),_0x2c1bff,_0xd7be20[_0xa42b('0x18')]['message']);return _0xc67c82(_0xd7be20[_0xa42b('0x18')][_0xa42b('0x1a')]);}else{logger[_0xa42b('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2c1bff,'request\x20sent');_0xc67c82(_0xd7be20['result'][_0xa42b('0x1a')]);}})[_0xa42b('0x1b')](function(_0x474790){logger[_0xa42b('0x18')](_0xa42b('0x14'),_0x2c1bff,_0x474790);_0x438a9f(_0x474790);});});}function respondWithStatusCode(_0x4db733,_0x1fae23){_0x1fae23=_0x1fae23||0xcc;return function(_0x148716){if(_0x148716){return _0x4db733[_0xa42b('0x1c')](_0x1fae23);}return _0x4db733['status'](_0x1fae23)[_0xa42b('0x1d')]();};}function respondWithResult(_0x4c15a1,_0x3ac0db){_0x3ac0db=_0x3ac0db||0xc8;return function(_0x3141d7){if(_0x3141d7){return _0x4c15a1['status'](_0x3ac0db)[_0xa42b('0x1e')](_0x3141d7);}};}function respondWithFilteredResult(_0x598f31,_0x5e562b){return function(_0x3006fc){if(_0x3006fc){var _0x1d2f34=typeof _0x5e562b[_0xa42b('0x1f')]===_0xa42b('0x20')&&typeof _0x5e562b[_0xa42b('0x21')]===_0xa42b('0x20');var _0x2f87d7=_0x3006fc[_0xa42b('0x22')];var _0x375730=_0x1d2f34?0x0:_0x5e562b[_0xa42b('0x1f')];var _0x121371=_0x1d2f34?_0x3006fc[_0xa42b('0x22')]:_0x5e562b[_0xa42b('0x1f')]+_0x5e562b[_0xa42b('0x21')];var _0xbceb2a;if(_0x121371>=_0x2f87d7){_0x121371=_0x2f87d7;_0xbceb2a=0xc8;}else{_0xbceb2a=0xce;}_0x598f31[_0xa42b('0x23')](_0xbceb2a);return _0x598f31[_0xa42b('0x24')]('Content-Range',_0x375730+'-'+_0x121371+'/'+_0x2f87d7)[_0xa42b('0x1e')](_0x3006fc);}return null;};}function saveUpdates(_0x4500a6){return function(_0x2c5011){if(_0x2c5011){return _0x2c5011[_0xa42b('0x25')](_0x4500a6)['then'](function(_0x146e00){return _0x146e00;});}return null;};}function removeEntity(_0xeef079){return function(_0x56ba5a){if(_0x56ba5a){return _0x56ba5a[_0xa42b('0x26')]()['then'](function(){var _0x3c3f9a=_0x56ba5a[_0xa42b('0x27')]({'plain':!![]});var _0x1e062f=_0xa42b('0x28');return db['UserProfileResource'][_0xa42b('0x26')]({'where':{'type':_0x1e062f,'resourceId':_0x3c3f9a['id']}})[_0xa42b('0x29')](function(){return _0x56ba5a;});})[_0xa42b('0x29')](function(){_0xeef079[_0xa42b('0x23')](0xcc)[_0xa42b('0x1d')]();});}};}function handleEntityNotFound(_0x5d9b0e){return function(_0x166368){if(!_0x166368){_0x5d9b0e[_0xa42b('0x1c')](0x194);}return _0x166368;};}function handleError(_0x44ed81,_0x2e9e7){_0x2e9e7=_0x2e9e7||0x1f4;return function(_0x20f8cc){logger[_0xa42b('0x18')](_0x20f8cc['stack']);if(_0x20f8cc['name']){delete _0x20f8cc[_0xa42b('0x2a')];}_0x44ed81[_0xa42b('0x23')](_0x2e9e7)[_0xa42b('0x2b')](_0x20f8cc);};}exports[_0xa42b('0x2c')]=function(_0x44e571,_0x12bc1e){var _0x959197={'include':[{'model':db[_0xa42b('0x2d')],'as':_0xa42b('0x2e')}]},_0x46fdeb={},_0x522c00={'count':0x0,'rows':[]};var _0x509157=_[_0xa42b('0x2f')](db[_0xa42b('0x30')]['rawAttributes'],function(_0x160b17){return{'name':_0x160b17[_0xa42b('0x31')],'type':_0x160b17['type'][_0xa42b('0x32')]};});_0x46fdeb['model']=_[_0xa42b('0x2f')](_0x509157,'name');_0x46fdeb[_0xa42b('0x33')]=_['keys'](_0x44e571[_0xa42b('0x33')]);_0x46fdeb['filters']=_['intersection'](_0x46fdeb[_0xa42b('0x34')],_0x46fdeb[_0xa42b('0x33')]);_0x959197[_0xa42b('0x35')]=_['intersection'](_0x46fdeb['model'],qs[_0xa42b('0x36')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x36')]));_0x959197[_0xa42b('0x35')]=_0x959197[_0xa42b('0x35')][_0xa42b('0x37')]?_0x959197[_0xa42b('0x35')]:_0x46fdeb[_0xa42b('0x34')];if(!_0x44e571['query'][_0xa42b('0x38')]('nolimit')){_0x959197[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x21')]);_0x959197['offset']=qs[_0xa42b('0x1f')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x959197['order']=qs['sort'](_0x44e571['query'][_0xa42b('0x39')]);_0x959197[_0xa42b('0x3a')]=qs['filters'](_[_0xa42b('0x3b')](_0x44e571[_0xa42b('0x33')],_0x46fdeb[_0xa42b('0x3c')]),_0x509157);if(_0x44e571['query'][_0xa42b('0x3d')]){_0x959197[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x959197['where'],{'$or':_[_0xa42b('0x2f')](_0x509157,function(_0x59ba97){if(_0x59ba97['type']!==_0xa42b('0x3f')){var _0x5218a6={};_0x5218a6[_0x59ba97[_0xa42b('0x2a')]]={'$like':'%'+_0x44e571[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x5218a6;}})});}_0x959197=_['merge']({},_0x959197,_0x44e571[_0xa42b('0x40')]);var _0xcf5dae={'where':_0x959197['where']};return db[_0xa42b('0x30')][_0xa42b('0x22')](_0xcf5dae)['then'](function(_0x3dff35){_0x522c00[_0xa42b('0x22')]=_0x3dff35;if(_0x44e571[_0xa42b('0x33')][_0xa42b('0x41')]){_0x959197['include']=[{'all':!![]}];}return db[_0xa42b('0x30')][_0xa42b('0x42')](_0x959197);})[_0xa42b('0x29')](function(_0xc5ad90){_0x522c00[_0xa42b('0x43')]=_0xc5ad90;return _0x522c00;})[_0xa42b('0x29')](respondWithFilteredResult(_0x12bc1e,_0x959197))[_0xa42b('0x1b')](handleError(_0x12bc1e,null));};exports[_0xa42b('0x44')]=function(_0x2cc036,_0x5372ff){var _0x2c2a71={'raw':![],'where':{'id':_0x2cc036[_0xa42b('0x45')]['id']},'include':[{'model':db['Pause'],'as':_0xa42b('0x2e')}]},_0x12b02a={};_0x12b02a[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x30')][_0xa42b('0x47')]);_0x12b02a['query']=_[_0xa42b('0x46')](_0x2cc036['query']);_0x12b02a[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x12b02a['model'],_0x12b02a[_0xa42b('0x33')]);_0x2c2a71[_0xa42b('0x35')]=_['intersection'](_0x12b02a[_0xa42b('0x34')],qs['fields'](_0x2cc036[_0xa42b('0x33')][_0xa42b('0x36')]));_0x2c2a71[_0xa42b('0x35')]=_0x2c2a71[_0xa42b('0x35')]['length']?_0x2c2a71[_0xa42b('0x35')]:_0x12b02a[_0xa42b('0x34')];if(_0x2cc036[_0xa42b('0x33')][_0xa42b('0x41')]){_0x2c2a71['include']=[{'all':!![]}];}_0x2c2a71=_[_0xa42b('0x3e')]({},_0x2c2a71,_0x2cc036['options']);return db[_0xa42b('0x30')]['find'](_0x2c2a71)['then'](handleEntityNotFound(_0x5372ff,null))[_0xa42b('0x29')](respondWithResult(_0x5372ff,null))[_0xa42b('0x1b')](handleError(_0x5372ff,null));};exports['create']=function(_0x515aea,_0x117863){return db[_0xa42b('0x30')]['create'](_0x515aea[_0xa42b('0x49')],{})[_0xa42b('0x29')](function(_0x4c25b1){var _0x28c251=_0x515aea[_0xa42b('0x4a')][_0xa42b('0x27')]({'plain':!![]});if(!_0x28c251)throw new Error(_0xa42b('0x4b'));if(_0x28c251[_0xa42b('0x4c')]===_0xa42b('0x4a')){var _0x353334=_0x4c25b1[_0xa42b('0x27')]({'plain':!![]});var _0x67cf30=_0xa42b('0x28');return db[_0xa42b('0x4d')][_0xa42b('0x4e')]({'where':{'name':_0x67cf30,'userProfileId':_0x28c251['userProfileId']},'raw':!![]})['then'](function(_0x4bfbcd){if(_0x4bfbcd&&_0x4bfbcd['autoAssociation']===0x0){return db[_0xa42b('0x4f')]['create']({'name':_0x353334['name'],'resourceId':_0x353334['id'],'type':_0x4bfbcd['name'],'sectionId':_0x4bfbcd['id']},{})[_0xa42b('0x29')](function(){return _0x4c25b1;});}else{return _0x4c25b1;}})['catch'](function(_0x5789a0){logger['error'](_0xa42b('0x50'),_0x5789a0);throw _0x5789a0;});}return _0x4c25b1;})[_0xa42b('0x29')](respondWithResult(_0x117863,0xc9))[_0xa42b('0x1b')](handleError(_0x117863,null));};exports[_0xa42b('0x25')]=function(_0x5da301,_0x39332a){if(_0x5da301['body']['id']){delete _0x5da301[_0xa42b('0x49')]['id'];}return db[_0xa42b('0x30')]['find']({'where':{'id':_0x5da301[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0x2d')],'as':_0xa42b('0x2e')}]})[_0xa42b('0x29')](handleEntityNotFound(_0x39332a,null))[_0xa42b('0x29')](saveUpdates(_0x5da301[_0xa42b('0x49')],null))['then'](respondWithResult(_0x39332a,null))[_0xa42b('0x1b')](handleError(_0x39332a,null));};exports['destroy']=function(_0x31cb8d,_0x2eb488){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x31cb8d[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb488,null))['then'](removeEntity(_0x2eb488,null))[_0xa42b('0x1b')](handleError(_0x2eb488,null));};exports['describe']=function(_0x475331,_0x563162){return db[_0xa42b('0x30')][_0xa42b('0x51')]()[_0xa42b('0x29')](respondWithResult(_0x563162,null))[_0xa42b('0x1b')](handleError(_0x563162,null));};exports[_0xa42b('0x52')]=function(_0x1c66e2,_0x5d6082){if(_0x1c66e2[_0xa42b('0x49')]['id']){delete _0x1c66e2['body']['id'];}return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x1c66e2[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5d6082,null))['then'](function(_0x44cb2d){if(_0x44cb2d){_0x1c66e2['body'][_0xa42b('0x53')]=_0x44cb2d['id'];return db[_0xa42b('0x54')][_0xa42b('0x55')](_0x1c66e2['body']);}})[_0xa42b('0x29')](respondWithResult(_0x5d6082,null))['catch'](handleError(_0x5d6082,null));};exports['getDispositions']=function(_0x2a1d38,_0x382b31){var _0x350b77={'raw':![],'where':{}};var _0x630384={};var _0x2c3ef4={'count':0x0,'rows':[]};return db[_0xa42b('0x30')]['findOne']({'where':{'id':_0x2a1d38[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x382b31,null))[_0xa42b('0x29')](function(_0x1a5d71){if(_0x1a5d71){_0x630384['model']=_['keys'](db[_0xa42b('0x54')]['rawAttributes']);_0x630384[_0xa42b('0x33')]=_['keys'](_0x2a1d38[_0xa42b('0x33')]);_0x630384[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x630384[_0xa42b('0x34')],_0x630384['query']);_0x350b77['attributes']=_[_0xa42b('0x48')](_0x630384['model'],qs[_0xa42b('0x36')](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x36')]));_0x350b77[_0xa42b('0x35')]=_0x350b77[_0xa42b('0x35')][_0xa42b('0x37')]?_0x350b77['attributes']:_0x630384[_0xa42b('0x34')];if(!_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x38')](_0xa42b('0x56'))){_0x350b77[_0xa42b('0x21')]=qs['limit'](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x21')]);_0x350b77['offset']=qs[_0xa42b('0x1f')](_0x2a1d38[_0xa42b('0x33')]['offset']);}_0x350b77[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x39')]);_0x350b77[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_['pick'](_0x2a1d38[_0xa42b('0x33')],_0x630384[_0xa42b('0x3c')]));_0x350b77['where'][_0xa42b('0x53')]=_0x1a5d71['id'];if(_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x350b77[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x350b77['where'],{'$or':_['map'](_0x350b77['attributes'],function(_0x2ff7d9){var _0x159c19={};_0x159c19[_0x2ff7d9]={'$like':'%'+_0x2a1d38[_0xa42b('0x33')]['filter']+'%'};return _0x159c19;})});}_0x350b77=_['merge']({},_0x350b77,_0x2a1d38[_0xa42b('0x40')]);return db[_0xa42b('0x54')][_0xa42b('0x22')]({'where':_0x350b77[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x35a8e7){_0x2c3ef4['count']=_0x35a8e7;if(_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x41')]){_0x350b77['include']=[{'all':!![]}];}return db[_0xa42b('0x54')]['findAll'](_0x350b77);})[_0xa42b('0x29')](function(_0x2d2f07){_0x2c3ef4[_0xa42b('0x43')]=_0x2d2f07;return _0x2c3ef4;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x382b31,_0x350b77))[_0xa42b('0x1b')](handleError(_0x382b31,null));};exports['removeDispositions']=function(_0x670a8c,_0x5096c0){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x670a8c['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5096c0,null))[_0xa42b('0x29')](function(_0x5c33b9){if(_0x5c33b9){return _0x5c33b9[_0xa42b('0x58')](_0x670a8c[_0xa42b('0x33')][_0xa42b('0x59')]);}})[_0xa42b('0x29')](respondWithStatusCode(_0x5096c0,null))['catch'](handleError(_0x5096c0,null));};exports['addAnswer']=function(_0x4a34c6,_0x5923e7){if(_0x4a34c6['body']['id']){delete _0x4a34c6[_0xa42b('0x49')]['id'];}return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x4a34c6[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5923e7,null))[_0xa42b('0x29')](function(_0x51cc8a){if(_0x51cc8a){_0x4a34c6[_0xa42b('0x49')]['ChatWebsiteId']=_0x51cc8a['id'];return db[_0xa42b('0x5a')][_0xa42b('0x55')](_0x4a34c6[_0xa42b('0x49')]);}})[_0xa42b('0x29')](respondWithResult(_0x5923e7,null))['catch'](handleError(_0x5923e7,null));};exports[_0xa42b('0x5b')]=function(_0x24bb64,_0x5d72be){var _0x30557c={'raw':![],'where':{}};var _0x2532bf={};var _0x586656={'count':0x0,'rows':[]};return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x24bb64[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5d72be,null))[_0xa42b('0x29')](function(_0x3f12c8){if(_0x3f12c8){_0x2532bf[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x5a')]['rawAttributes']);_0x2532bf[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x24bb64[_0xa42b('0x33')]);_0x2532bf[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x2532bf['model'],_0x2532bf[_0xa42b('0x33')]);_0x30557c['attributes']=_['intersection'](_0x2532bf['model'],qs[_0xa42b('0x36')](_0x24bb64['query'][_0xa42b('0x36')]));_0x30557c[_0xa42b('0x35')]=_0x30557c[_0xa42b('0x35')][_0xa42b('0x37')]?_0x30557c['attributes']:_0x2532bf['model'];if(!_0x24bb64['query'][_0xa42b('0x38')](_0xa42b('0x56'))){_0x30557c['limit']=qs[_0xa42b('0x21')](_0x24bb64['query']['limit']);_0x30557c['offset']=qs[_0xa42b('0x1f')](_0x24bb64[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x30557c[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x24bb64[_0xa42b('0x33')][_0xa42b('0x39')]);_0x30557c[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x24bb64[_0xa42b('0x33')],_0x2532bf[_0xa42b('0x3c')]));_0x30557c[_0xa42b('0x3a')]['ChatWebsiteId']=_0x3f12c8['id'];if(_0x24bb64[_0xa42b('0x33')]['filter']){_0x30557c[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x30557c[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x30557c[_0xa42b('0x35')],function(_0x383873){var _0x564c1e={};_0x564c1e[_0x383873]={'$like':'%'+_0x24bb64[_0xa42b('0x33')]['filter']+'%'};return _0x564c1e;})});}_0x30557c=_[_0xa42b('0x3e')]({},_0x30557c,_0x24bb64[_0xa42b('0x40')]);return db['CannedAnswer'][_0xa42b('0x22')]({'where':_0x30557c[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x192060){_0x586656[_0xa42b('0x22')]=_0x192060;if(_0x24bb64[_0xa42b('0x33')][_0xa42b('0x41')]){_0x30557c[_0xa42b('0x5d')]=[{'all':!![]}];}return db[_0xa42b('0x5a')]['findAll'](_0x30557c);})[_0xa42b('0x29')](function(_0x55a746){_0x586656[_0xa42b('0x43')]=_0x55a746;return _0x586656;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x5d72be,_0x30557c))[_0xa42b('0x1b')](handleError(_0x5d72be,null));};exports[_0xa42b('0x5e')]=function(_0x24ee36,_0x2cc1e0){return db['ChatWebsite']['find']({'where':{'id':_0x24ee36['params']['id']}})['then'](handleEntityNotFound(_0x2cc1e0,null))[_0xa42b('0x29')](function(_0x27beb6){if(_0x27beb6){return _0x27beb6['removeAnswers'](_0x24ee36[_0xa42b('0x33')][_0xa42b('0x59')]);}})[_0xa42b('0x29')](respondWithStatusCode(_0x2cc1e0,null))[_0xa42b('0x1b')](handleError(_0x2cc1e0,null));};exports[_0xa42b('0x5f')]=function(_0x4a6ba4,_0x2c884d){_0x4a6ba4[_0xa42b('0x49')][_0xa42b('0x60')]=_0x4a6ba4[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x4a6ba4['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2c884d,null))['then'](saveUpdates(_0x4a6ba4[_0xa42b('0x49')],null))['then'](respondWithResult(_0x2c884d,null))['catch'](handleError(_0x2c884d,null));};exports['addAvatar']=function(_0x6deffc,_0x5eb8ce){_0x6deffc[_0xa42b('0x49')][_0xa42b('0x63')]=_0x6deffc['file'][_0xa42b('0x62')];return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x6deffc[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5eb8ce,null))[_0xa42b('0x29')](saveUpdates(_0x6deffc[_0xa42b('0x49')],null))[_0xa42b('0x29')](respondWithResult(_0x5eb8ce,null))['catch'](handleError(_0x5eb8ce,null));};exports[_0xa42b('0x64')]=function(_0x5b21f9,_0x3bff96){_0x5b21f9[_0xa42b('0x49')]['customerAvatar']=_0x5b21f9[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')]['find']({'where':{'id':_0x5b21f9['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3bff96,null))[_0xa42b('0x29')](saveUpdates(_0x5b21f9[_0xa42b('0x49')],null))[_0xa42b('0x29')](respondWithResult(_0x3bff96,null))[_0xa42b('0x1b')](handleError(_0x3bff96,null));};exports['addSystemAvatar']=function(_0x19aacb,_0x5cd347){_0x19aacb[_0xa42b('0x49')][_0xa42b('0x65')]=_0x19aacb[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')]['find']({'where':{'id':_0x19aacb[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd347,null))['then'](saveUpdates(_0x19aacb[_0xa42b('0x49')],null))['then'](respondWithResult(_0x5cd347,null))[_0xa42b('0x1b')](handleError(_0x5cd347,null));};exports['getLogo']=function(_0x250b99,_0x2bff53){var _0x12253d=path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x68'));var _0x4d7455={'where':{'id':_0x250b99[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x60')],'raw':!![]};var _0x1320b7=![];return require(_0xa42b('0x69'))[_0xa42b('0x6a')]()['then'](function(_0x46a595){if(_0x46a595){_0x1320b7=_0x46a595[_0xa42b('0x6b')];}})['then'](function(){return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x4d7455);})[_0xa42b('0x29')](handleEntityNotFound(_0x2bff53,null))[_0xa42b('0x29')](function(_0x4b880b){if(_0x4b880b){if(!_['isNil'](_0x4b880b[_0xa42b('0x60')])){if(fs['existsSync'](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x6c'),_0x4b880b['sitepic']))&&_0x1320b7){_0x12253d=path[_0xa42b('0x66')](config['root'],_0xa42b('0x6c'),_0x4b880b[_0xa42b('0x60')]);}}return _0x2bff53[_0xa42b('0x6d')](_0x12253d);}})[_0xa42b('0x1b')](handleError(_0x2bff53,null));};exports['getAvatar']=function(_0x35c8bc,_0x55af52){var _0x693510=path['join'](config[_0xa42b('0x67')],_0xa42b('0x6e'));var _0x5eb571={'where':{'id':_0x35c8bc[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x63')],'raw':!![]};return db[_0xa42b('0x30')]['find'](_0x5eb571)[_0xa42b('0x29')](handleEntityNotFound(_0x55af52,null))[_0xa42b('0x29')](function(_0x1fb76b){if(_0x1fb76b){if(!_[_0xa42b('0x6f')](_0x1fb76b[_0xa42b('0x63')])){if(fs[_0xa42b('0x70')](path['join'](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x1fb76b[_0xa42b('0x63')]))){_0x693510=path[_0xa42b('0x66')](config['root'],_0xa42b('0x71'),_0x1fb76b[_0xa42b('0x63')]);}}return _0x55af52['download'](_0x693510);}})[_0xa42b('0x1b')](handleError(_0x55af52,null));};exports['getCustomerAvatar']=function(_0x59844c,_0x30d8f1){var _0x212121=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x42e62b={'where':{'id':_0x59844c[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x72'),_0xa42b('0x73')],'raw':!![]};return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x42e62b)[_0xa42b('0x29')](handleEntityNotFound(_0x30d8f1,null))[_0xa42b('0x29')](function(_0x51fa73){if(_0x51fa73){if(!_[_0xa42b('0x6f')](_0x51fa73[_0xa42b('0x72')])){if(fs[_0xa42b('0x70')](path[_0xa42b('0x66')](config['root'],'server/files/images/avatars/',_0x51fa73[_0xa42b('0x72')]))&&_0x51fa73['showCustomerAvatar']){_0x212121=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/',_0x51fa73['customerAvatar']);}}return _0x30d8f1[_0xa42b('0x6d')](_0x212121);}})[_0xa42b('0x1b')](handleError(_0x30d8f1,null));};exports[_0xa42b('0x74')]=function(_0x4359be,_0x4ad7e3){var _0x3dab56=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/system_avatar.png');var _0x4723a5={'where':{'id':_0x4359be[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x65')],'raw':!![]};return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x4723a5)['then'](handleEntityNotFound(_0x4ad7e3,null))[_0xa42b('0x29')](function(_0x568b98){if(_0x568b98){if(!_[_0xa42b('0x6f')](_0x568b98[_0xa42b('0x65')])){if(fs[_0xa42b('0x70')](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x568b98[_0xa42b('0x65')]))){_0x3dab56=path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x568b98[_0xa42b('0x65')]);}}return _0x4ad7e3[_0xa42b('0x6d')](_0x3dab56);}})[_0xa42b('0x1b')](handleError(_0x4ad7e3,null));};exports[_0xa42b('0x75')]=function(_0x38ba41,_0x4b22bd){var _0x54228b=require('user-agent-parser');var _0x2ad523=new _0x54228b();var _0x30be3a=_0x2ad523[_0xa42b('0x76')](_0x38ba41[_0xa42b('0x77')][_0xa42b('0x78')])['getResult']();var _0xd0d849={'body':_0x38ba41['body'],'channel':_0xa42b('0x79')};var _0x94e135=[];var _0x306b75=[];var _0x58b048={};var _0x27e25c=![];return db['CmContact'][_0xa42b('0x51')]()[_0xa42b('0x29')](function(_0x417c65){if(!_0x417c65){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))]('no\x20available\x20attributes');}_0x94e135=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x417c65),['createdAt','updatedAt']);_0x306b75=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x417c65),[_0xa42b('0x7d'),_0xa42b('0x7e'),'CompanyId',_0xa42b('0x7f')]);if(_0x38ba41['body']['id']){delete _0x38ba41[_0xa42b('0x49')]['id'];}if(_[_0xa42b('0x6f')](_0x38ba41[_0xa42b('0x49')][_0xa42b('0x80')])){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0x81'));}if(_[_0xa42b('0x6f')](_0x38ba41[_0xa42b('0x49')][_0xa42b('0x49')])||_0x38ba41[_0xa42b('0x49')][_0xa42b('0x49')]===''){throw new db['Sequelize'][(_0xa42b('0x7b'))](_0xa42b('0x82'));}if(_[_0xa42b('0x6f')](_0x38ba41['body'][_0xa42b('0x83')])){throw new db['Sequelize']['ValidationError'](_0xa42b('0x84')+_0x306b75);}if(!_[_0xa42b('0x85')](_0x306b75,_0x38ba41[_0xa42b('0x49')]['mapKey'])){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0x86')+_0x306b75);}_0x58b048[_0x38ba41[_0xa42b('0x49')][_0xa42b('0x83')]]=_0x38ba41['body'][_0xa42b('0x80')];})[_0xa42b('0x29')](function(){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x38ba41[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0x87')],'as':_0xa42b('0x88'),'include':[{'model':db['CmContact'],'as':_0xa42b('0x89'),'where':_0x58b048,'limit':0x1,'order':[[_0xa42b('0x7e'),'DESC']]}]},{'model':db[_0xa42b('0x8a')],'as':_0xa42b('0x8b')}]});})[_0xa42b('0x29')](handleEntityNotFound(_0x4b22bd,null))[_0xa42b('0x29')](function(_0x1e120e){if(_0x1e120e&&_0x1e120e[_0xa42b('0x88')]){_0xd0d849['account']=_0x1e120e;_0xd0d849[_0xa42b('0x8c')]=_0x1e120e[_0xa42b('0x8b')];_0xd0d849[_0xa42b('0x8d')]=_0x1e120e[_0xa42b('0x88')];_0xd0d849[_0xa42b('0x8c')]=_[_0xa42b('0x8e')](_0xd0d849['applications'],[_0xa42b('0x8f')],['asc']);if(_0xd0d849[_0xa42b('0x90')][_0xa42b('0x8b')]){delete _0xd0d849[_0xa42b('0x90')][_0xa42b('0x8b')];}if(_0xd0d849['account'][_0xa42b('0x88')]&&_0xd0d849[_0xa42b('0x90')][_0xa42b('0x88')][_0xa42b('0x89')][_0xa42b('0x37')]){return _0xd0d849['account'][_0xa42b('0x88')][_0xa42b('0x89')][0x0];}var _0x1a1dc7=_[_0xa42b('0xb')](_0x38ba41[_0xa42b('0x49')],{'firstName':_0x38ba41[_0xa42b('0x49')]['from'],'ListId':_0x1e120e[_0xa42b('0x7f')]});_0x1a1dc7[_0x38ba41['body'][_0xa42b('0x83')]]=_0x38ba41[_0xa42b('0x49')]['from'];return db[_0xa42b('0x91')][_0xa42b('0x55')](_0x1a1dc7,{'fields':_0x94e135,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b22bd,null))['then'](function(_0x4a3d34){_0xd0d849[_0xa42b('0x92')]=_0x4a3d34;var _0x41ed92=_0x38ba41[_0xa42b('0x49')][_0xa42b('0x93')];if(_0x38ba41[_0xa42b('0x77')][_0xa42b('0x94')]){_0x41ed92=_0x38ba41[_0xa42b('0x77')][_0xa42b('0x94')];}else if(_0x38ba41[_0xa42b('0x77')][_0xa42b('0x95')]){_0x41ed92=_['first'](_0x38ba41[_0xa42b('0x77')][_0xa42b('0x95')][_0xa42b('0x96')](','));}if(_0x4a3d34){var _0xa723af={'ContactId':_0x4a3d34['id'],'ChatWebsiteId':_0x38ba41['params']['id'],'from':(_0x4a3d34[_0xa42b('0x97')]||'')+'\x20'+(_0x4a3d34[_0xa42b('0x98')]||''),'customerIp':_0x41ed92,'customerPort':_0x38ba41[_0xa42b('0x77')][_0xa42b('0x99')]?_0x38ba41['headers']['x-real-port']:null,'referer':_0x38ba41['body'][_0xa42b('0x9a')],'browserName':_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x2a')]&&_0x30be3a['browser'][_0xa42b('0x9c')]?util[_0xa42b('0x9d')]('%s\x20%s',_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x2a')],_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x9c')]):_0xa42b('0x9e'),'browserVersion':_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x9c')]||'unknown','osName':util[_0xa42b('0x9d')](_0xa42b('0x9f'),_0x30be3a['os'][_0xa42b('0x2a')],_0x30be3a['os'][_0xa42b('0x9c')]),'osVersion':_0x30be3a['os'][_0xa42b('0x9c')],'deviceModel':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0x34')]&&_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa1')]?util['format'](_0xa42b('0xa2'),_0x30be3a[_0xa42b('0xa0')][_0xa42b('0x34')],_0x30be3a[_0xa42b('0xa0')]['vendor'],_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa3')]):null,'deviceVendor':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa1')],'deviceType':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa3')],'formData':JSON[_0xa42b('0x17')](_0x38ba41[_0xa42b('0x49')])};var _0x43c736={'ChatWebsiteId':_0x38ba41['params']['id'],'closed':![]};if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]){_0x43c736[_0xa42b('0xa4')]=_0x38ba41['body'][_0xa42b('0xa4')];return db[_0xa42b('0xa5')][_0xa42b('0x4e')]({'where':_0x43c736})[_0xa42b('0x29')](function(_0x554a94){if(_0x554a94){return[_0x554a94,![]];}_0xa723af[_0xa42b('0xa4')]=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')];_0xa723af[_0xa42b('0xa6')]=_0x38ba41[_0xa42b('0x49')]['externalUrl'];return db['ChatInteraction'][_0xa42b('0x55')](_0xa723af)['then'](function(_0x475746){return[_0x475746,!![]];});});}_0x43c736[_0xa42b('0xa7')]=_0x4a3d34['id'];if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa8')]&&_0x38ba41['body'][_0xa42b('0xa8')]['id']){_0x43c736['id']=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa8')]['id'];return db[_0xa42b('0xa5')]['find']({'where':_0x43c736})[_0xa42b('0x29')](function(_0x36644f){if(_0x36644f){return[_0x36644f,![]];}return db['ChatInteraction']['create'](_0xa723af)[_0xa42b('0x29')](function(_0x4508ba){return[_0x4508ba,!![]];});});}return db[_0xa42b('0xa5')][_0xa42b('0x55')](_0xa723af)[_0xa42b('0x29')](function(_0x16d1ae){return[_0x16d1ae,!![]];});}})[_0xa42b('0xa9')](function(_0x18ad21,_0x5e37be){if(_0x18ad21){_0x27e25c=_0x5e37be;if(!_0x5e37be){var _0x347e60={'from':(_0xd0d849[_0xa42b('0x92')][_0xa42b('0x97')]||'')+'\x20'+(_0xd0d849[_0xa42b('0x92')][_0xa42b('0x98')]||'')};if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]&&_0x38ba41['body'][_0xa42b('0xaa')]&&_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]!=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xaa')]){_0x347e60[_0xa42b('0xa4')]=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xaa')];}return _0x18ad21[_0xa42b('0x25')](_0x347e60);}else{return _0x18ad21;}}})[_0xa42b('0x29')](function(_0x25a714){_0xd0d849[_0xa42b('0xa8')]=_0x25a714[_0xa42b('0x27')]({'plain':!![]});_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xab')]=_0x27e25c;if(_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xab')]){if(_0xd0d849[_0xa42b('0x90')][_0xa42b('0xac')]){_0xd0d849[_0xa42b('0x8c')][_0xa42b('0xad')]({'id':0x0,'priority':_0xd0d849[_0xa42b('0x8c')]['length']+0x1,'app':_0xa42b('0xae'),'appdata':_0xa42b('0xaf'),'interval':_0xa42b('0xb0')});}}return db[_0xa42b('0xb1')][_0xa42b('0x55')]({'body':_0x38ba41['body'][_0xa42b('0x49')],'ChatWebsiteId':_0x38ba41[_0xa42b('0x45')]['id'],'ChatInteractionId':_0x25a714['id'],'direction':'in','ContactId':_0xd0d849['contact']['id'],'AttachmentId':_0x38ba41['body'][_0xa42b('0xb2')]});})[_0xa42b('0x29')](function(_0x425e60){_0xd0d849[_0xa42b('0x1a')]=_0x425e60;if(_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xb3')]){return db[_0xa42b('0xb4')][_0xa42b('0x4e')]({'attributes':['id',_0xa42b('0x2a')],'where':{'id':_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xb3')]}})[_0xa42b('0x29')](function(_0x371e8c){if(_0x371e8c){_0xd0d849['applications'][_0xa42b('0xb5')]({'id':0x0,'priority':0x0,'app':_0xa42b('0xb6'),'appdata':_0x371e8c[_0xa42b('0x2a')]+','+(_0xd0d849['account'][_0xa42b('0xb7')]||0xa),'interval':_0xa42b('0xb0')});_0xd0d849[_0xa42b('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xa42b('0xb9'),_0xd0d849);});}return respondWithRpcPromise(_0xa42b('0xba'),_0xa42b('0xb9'),_0xd0d849);})[_0xa42b('0x29')](function(_0x51a965){respondWithRpcPromise('EventManager',_0xa42b('0xbb'),{'event':'notify','message':_0x51a965},client9002);return _0x51a965;})['then'](respondWithResult(_0x4b22bd,null))['catch'](handleError(_0x4b22bd,null));};exports[_0xa42b('0xbc')]=function(_0x11c82b,_0x5570c9){var _0x19da34,_0x3299f8,_0x52618e;var _0x3c993a=[];var _0x1a18c2={};var _0x2e7c5f=_0x11c82b[_0xa42b('0xbd')]||[];var _0xadad39=[];var _0x465c73;return db['CmContact']['describe']()[_0xa42b('0x29')](function(_0x25b4c7){if(!_0x25b4c7){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0xbe'));}_0x3c993a=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x25b4c7),[_0xa42b('0x7d'),_0xa42b('0x7e'),_0xa42b('0xbf'),_0xa42b('0x7f')]);if(_0x11c82b[_0xa42b('0x49')]['id']){delete _0x11c82b[_0xa42b('0x49')]['id'];}if(_['isNil'](_0x11c82b['body'][_0xa42b('0x80')])){throw _0x5570c9['status'](0x1f4)[_0xa42b('0x2b')](new db[(_0xa42b('0x7a'))]['ValidationError'](_0xa42b('0x81')));}if(_[_0xa42b('0x6f')](_0x11c82b[_0xa42b('0x49')][_0xa42b('0x49')])||_0x11c82b[_0xa42b('0x49')][_0xa42b('0x49')]===''){throw _0x5570c9['status'](0x1f4)[_0xa42b('0x2b')](new db['Sequelize']['ValidationError'](_0xa42b('0x82')));}if(_[_0xa42b('0x6f')](_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')])){throw _0x5570c9[_0xa42b('0x23')](0x1f4)['send'](new db[(_0xa42b('0x7a'))]['ValidationError'](_0xa42b('0xc1')+_0x3c993a));}if(!_['includes'](_0x3c993a,_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')])){throw _0x5570c9[_0xa42b('0x23')](0x1f4)['send'](new db['Sequelize'][(_0xa42b('0x7b'))](_0xa42b('0xc2')+_0x3c993a));}_0x1a18c2[_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')]]=_0x11c82b['body'][_0xa42b('0x80')];})[_0xa42b('0x29')](function(){return db[_0xa42b('0x30')]['find']({'where':{'id':_0x11c82b['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0xa42b('0xc3')}]});})['then'](handleEntityNotFound(_0x5570c9,null))[_0xa42b('0x29')](function(_0x4e43ae){if(_0x4e43ae&&_0x4e43ae[_0xa42b('0x88')]){_0x3299f8=_0x4e43ae;var _0x633811=_['defaults'](_0x11c82b['body'],{'firstName':_0x11c82b['body'][_0xa42b('0x80')],'phone':_0x11c82b[_0xa42b('0x49')][_0xa42b('0x80')],'ListId':_0x4e43ae[_0xa42b('0x7f')]});_0x633811[_0x11c82b[_0xa42b('0x49')]['mapKeyOffline']]=_0x11c82b[_0xa42b('0x49')]['from'];return db[_0xa42b('0x91')]['findOrCreate']({'where':_0x1a18c2,'defaults':_0x633811});}})[_0xa42b('0xa9')](function(_0x50683d){if(_0x50683d){_0x52618e=_0x50683d;var _0x53138d=fs[_0xa42b('0xc4')](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0xc5')),_0xa42b('0xc6'));var _0x19dae6=ejs['render'](_0x53138d,{'body':_[_0xa42b('0xc7')](_0x11c82b['body'][_0xa42b('0x49')]),'bodyTitle':_0x3299f8[_0xa42b('0xc8')]});return db[_0xa42b('0xc9')]['create']({'body':_0x19dae6,'plainBody':htmlToText[_0xa42b('0xca')](_0x19dae6),'ContactId':_0x50683d['id'],'ChatWebsiteId':_0x3299f8['id']});}})[_0xa42b('0x29')](function(_0x58d7b1){_0x465c73=_0x58d7b1;if(_0x2e7c5f[_0xa42b('0x37')]){var _0x5ba11a=_0x2e7c5f[_0xa42b('0x2f')](function(_0x1deb4d){return{'name':_0x1deb4d[_0xa42b('0xcb')],'basename':_0x1deb4d[_0xa42b('0x62')],'type':_0x1deb4d[_0xa42b('0xcc')],'ChatOfflineMessageId':_0x58d7b1['id']};});_0xadad39=_0x5ba11a[_0xa42b('0x2f')](_0x4b4fc0=>{var _0x203d06={'filename':_0x4b4fc0[_0xa42b('0x2a')],'path':path[_0xa42b('0x66')](config['root'],_0xa42b('0xcd'),'files','attachments',_0xa42b('0xce'),_0x4b4fc0['basename'])};return _0x203d06;});if(!_0x3299f8[_0xa42b('0xcf')]){return db[_0xa42b('0xd0')]['transaction'](function(_0x2966b7){return db[_0xa42b('0xd1')]['bulkCreate'](_0x5ba11a,{'transaction':_0x2966b7});});}}})[_0xa42b('0x29')](function(){if(_0x465c73){_0x19da34=_0x465c73;return db[_0xa42b('0xc3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa42b('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa42b('0xd3')],'as':_0xa42b('0xd3'),'raw':!![]}]}]});}})[_0xa42b('0x29')](function(_0x14e573){if(_0x14e573&&_0x14e573['Smtp']&&_0x3299f8[_0xa42b('0xd4')]&&_0x3299f8['forwardOfflineAddress']){var _0x281986=_0x14e573[_0xa42b('0xd5')]();return respondWithRpcPromise(_0xa42b('0xd6'),_0xa42b('0xd7'),{'account':_0x281986,'message':{'from':util[_0xa42b('0x9d')](_0xa42b('0xd8'),_0x14e573['name'],_0x14e573[_0xa42b('0xd9')]||_0x14e573[_0xa42b('0xda')][_0xa42b('0x4a')]),'to':_0x3299f8['forwardOfflineAddress'],'subject':_0x3299f8['offlineMessageSubject'],'html':_0x19da34[_0xa42b('0x49')],'attachments':_0xadad39}},client9003)['then'](function(){return _0x19da34;})[_0xa42b('0x1b')](function(_0xbae89c){logger[_0xa42b('0x18')](_0xbae89c);});}})[_0xa42b('0x29')](function(){if(_0x3299f8&&_0x3299f8[_0xa42b('0xcf')]&&_0x3299f8[_0xa42b('0xdb')]){var _0x45c4d5=[];if(_0x2e7c5f[_0xa42b('0x37')]){_0x45c4d5=_0x2e7c5f['map'](function(_0x46a09b){return{'name':_0x46a09b[_0xa42b('0xcb')],'basename':_0x46a09b[_0xa42b('0x62')],'type':_0x46a09b[_0xa42b('0xcc')],'ChatOfflineMessageId':_0x465c73['id']};});}var _0x20a458;if(!_[_0xa42b('0x6f')](_0x3299f8['subjectOffline'])){var _0x341d49=_[_0xa42b('0x2f')](_0x11c82b[_0xa42b('0x49')],function(_0x5461b7){return _0x5461b7;});var _0x245e16=_['toPairsIn'](_0x341d49)[0x0];var _0xcfa3ab=_['mapValues'](_0x245e16,function(_0x21c186){return _0x21c186;});_0x20a458=_0xcfa3ab[0x1][_0x3299f8['subjectOffline']];}var _0x1e8cf9={'from':_0x52618e[_0xa42b('0xd9')],'firstName':_0x52618e['firstName'],'lastName':_0x52618e[_0xa42b('0x98')],'mapKey':_0xa42b('0xd9'),'message':{'from':_0x52618e[_0xa42b('0xd9')],'to':_0x3299f8[_0xa42b('0xc3')][_0xa42b('0xd9')],'cc':'','subject':_[_0xa42b('0x6f')](_0x20a458)?_0x3299f8['offlineMessageSubject']:_0x20a458,'messageId':'','sentAt':new Date(),'attach':_0x45c4d5[_0xa42b('0x37')],'attachments':_0x45c4d5,'originChannel':_0xa42b('0xdc'),'ChatWebsiteId':_0x3299f8['id'],'ChatOfflineMessageId':_0x19da34['id'],'originTo':_0x3299f8['MailAccount']['email']},'body':_0x19da34['body']};var _0x2d4ee2={'account':{'id':_0x3299f8['MailAccountId']},'body':_0x1e8cf9,'log':_0xa42b('0xdd')};return respondWithRpcPromise(_0xa42b('0xdd'),_0xa42b('0xde'),_0x2d4ee2,client9001)[_0xa42b('0x29')](function(){return _0x19da34;})[_0xa42b('0x1b')](function(_0x4460e7){logger[_0xa42b('0x18')](_0x4460e7);});}return;})[_0xa42b('0x29')](function(){if(_0x19da34){return _0x19da34;}})[_0xa42b('0x29')](respondWithResult(_0x5570c9,null))[_0xa42b('0x1b')](function(_0x3a341e){logger[_0xa42b('0x18')](_0xa42b('0x1b'),_0x3a341e);for(var _0x19eefb of _0x2e7c5f){var _0x2f2396=path['join'](config[_0xa42b('0x67')],_0xa42b('0xcd'),_0xa42b('0xbd'),'attachments','offline-chat',_0x19eefb[_0xa42b('0x62')]);fs_extra[_0xa42b('0xdf')](_0x2f2396)['catch'](function(_0x5d90dc){logger[_0xa42b('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x2f2396,_0x5d90dc);});}});};exports[_0xa42b('0xe0')]=function(_0x268215,_0x3f0b52){return db[_0xa42b('0xa5')][_0xa42b('0x4e')]({'where':{'id':_0x268215[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3f0b52,null))[_0xa42b('0x29')](function(_0x2cffe5){if(_0x2cffe5){return _0x2cffe5[_0xa42b('0xe0')](_0x268215['body'][_0xa42b('0x59')],_[_0xa42b('0xe1')](_0x268215[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{});}})[_0xa42b('0x29')](respondWithResult(_0x3f0b52,null))[_0xa42b('0x1b')](handleError(_0x3f0b52,null));};exports[_0xa42b('0xe2')]=function(_0x25ed7e,_0x544015){var _0x1f3308={'raw':![],'where':{}};var _0x2dc3c0={};var _0x54fb74={'count':0x0,'rows':[]};return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x25ed7e[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x544015,null))[_0xa42b('0x29')](function(_0x47da31){if(_0x47da31){_0x2dc3c0[_0xa42b('0x34')]=_[_0xa42b('0x46')](db['ChatInteraction']['rawAttributes']);_0x2dc3c0['query']=_['keys'](_0x25ed7e[_0xa42b('0x33')]);_0x2dc3c0[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x2dc3c0[_0xa42b('0x34')],_0x2dc3c0[_0xa42b('0x33')]);_0x1f3308[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x2dc3c0[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x25ed7e['query']['fields']));_0x1f3308[_0xa42b('0x35')]=_0x1f3308[_0xa42b('0x35')]['length']?_0x1f3308[_0xa42b('0x35')]:_0x2dc3c0['model'];if(!_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x38')](_0xa42b('0x56'))){_0x1f3308['limit']=qs[_0xa42b('0x21')](_0x25ed7e[_0xa42b('0x33')]['limit']);_0x1f3308[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x1f3308['order']=qs[_0xa42b('0x39')](_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x39')]);_0x1f3308['where']=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x25ed7e[_0xa42b('0x33')],_0x2dc3c0[_0xa42b('0x3c')]));_0x1f3308[_0xa42b('0x3a')]['ChatWebsiteId']=_0x47da31['id'];if(_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x1f3308[_0xa42b('0x3a')]=_['merge'](_0x1f3308[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x1f3308['attributes'],function(_0x59b79e){var _0x58bf24={};_0x58bf24[_0x59b79e]={'$like':'%'+_0x25ed7e[_0xa42b('0x33')]['filter']+'%'};return _0x58bf24;})});}_0x1f3308=_[_0xa42b('0x3e')]({},_0x1f3308,_0x25ed7e[_0xa42b('0x40')]);return db[_0xa42b('0xa5')][_0xa42b('0x22')]({'where':_0x1f3308[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x5aabe2){_0x54fb74[_0xa42b('0x22')]=_0x5aabe2;if(_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x41')]){_0x1f3308['include']=[{'model':db[_0xa42b('0x91')],'as':_0xa42b('0xe3'),'required':![]},{'model':db[_0xa42b('0xb4')],'as':_0xa42b('0xe4'),'attributes':[_0xa42b('0x2a'),'fullname',_0xa42b('0xe5')],'required':![]},{'model':db[_0xa42b('0xe6')],'as':'Tags','attributes':['id',_0xa42b('0x2a'),_0xa42b('0xe7')],'where':_0x25ed7e['query']['tag']?{'id':_0x25ed7e['query'][_0xa42b('0xe8')]}:undefined,'required':_0x25ed7e[_0xa42b('0x33')][_0xa42b('0xe8')]?!![]:![]}];}return db[_0xa42b('0xa5')]['findAll'](_0x1f3308);})['then'](function(_0x26165b){_0x54fb74[_0xa42b('0x43')]=_0x26165b;return _0x54fb74;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x544015,_0x1f3308))[_0xa42b('0x1b')](handleError(_0x544015,null));};function iftimePromise(_0x1e112b,_0x36d352){return respondWithRpcPromise(_0xa42b('0xe9'),_0xa42b('0xea'),{'command':_0x36d352[_0xa42b('0xeb')]?util[_0xa42b('0x9d')](_0xa42b('0xec'),_0x1e112b[_0xa42b('0xed')],_0x36d352[_0xa42b('0xeb')]):util[_0xa42b('0x9d')](_0xa42b('0xee'),_0x1e112b[_0xa42b('0xed')])},client9002)['then'](function(_0x2c422e){var _0x58b709=_0x2c422e&&_0x2c422e['indexOf'](_0xa42b('0xef'))>=0x0?!![]:![];logger[_0xa42b('0x13')](_0xa42b('0xf0'),_0x36d352['id'],_0x1e112b['id'],_0x1e112b[_0xa42b('0xed')],_0x58b709?_0xa42b('0xf1'):_0xa42b('0xf2'),_0x36d352[_0xa42b('0xeb')]?_0x36d352[_0xa42b('0xeb')]:_0xa42b('0xf3'));return _0x58b709;})[_0xa42b('0x1b')](function(_0x13ac21){logger['error'](_0xa42b('0xf0'),_0x36d352['id'],_0x1e112b['id'],_0x1e112b[_0xa42b('0xed')],util[_0xa42b('0xf4')](_0x13ac21,{'showHidden':![],'depth':null}),_0x36d352[_0xa42b('0xeb')]?_0x36d352['timezone']:_0xa42b('0xf3'));return![];});}exports[_0xa42b('0xea')]=function(_0x22405c,_0x40279d){var _0xf32098=0x0;var _0x2ed4b0=0x0;var _0x39e331=![];var _0x52bb6e;var _0x465757;return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x22405c[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0xf5')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xa42b('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x40279d,null))['then'](function(_0x1c48b9){if(_0x1c48b9){_0x52bb6e=_0x1c48b9;return _0x1c48b9[_0xa42b('0xf6')]({'raw':!![]});}})['then'](function(_0x34a8b2){if(_0x52bb6e){if(_0x34a8b2){_0x465757=_0x34a8b2;}}return require(_0xa42b('0x69'))[_0xa42b('0x6a')]();})[_0xa42b('0x29')](function(_0x29086c){if(_0x29086c){_0x2ed4b0=_0x29086c['virtual'];_0x39e331=_0x29086c[_0xa42b('0x6b')];}})[_0xa42b('0x29')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xa42b('0x29')](function(_0x591ffb){_0xf32098=_0x591ffb;if(_0x2ed4b0&&_0x591ffb>_0x2ed4b0){return db[_0xa42b('0xf7')][_0xa42b('0x5c')]({'where':{'id':0x1}})[_0xa42b('0x29')](function(_0x325bbc){if(_0x325bbc){_0x325bbc[_0xa42b('0xf8')](_0xa42b('0xf9'));}});}})[_0xa42b('0x29')](function(){if(_0x52bb6e['Interval']&&_0x52bb6e[_0xa42b('0xf5')][_0xa42b('0xfa')]){var _0x2b92dc=[];for(var _0x219e3=0x0;_0x219e3<_0x52bb6e['Interval'][_0xa42b('0xfa')][_0xa42b('0x37')];_0x219e3++){var _0x4b8b16=_0x52bb6e[_0xa42b('0xf5')][_0xa42b('0xfa')][_0x219e3][_0xa42b('0x27')]({'plain':!![]});_0x2b92dc[_0xa42b('0xad')](iftimePromise(_0x4b8b16,_0x52bb6e));}return BPromise[_0xa42b('0xfb')](_0x2b92dc)[_0xa42b('0x29')](function(_0x4e2db3){return _['some'](_0x4e2db3);});}else{return!![];}})[_0xa42b('0x29')](function(_0xf82047){var _0x5c12ea=fs[_0xa42b('0xc4')](path['join'](config[_0xa42b('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x310510=new url[(_0xa42b('0xfc'))](_0x52bb6e[_0xa42b('0xfd')])[_0xa42b('0xfe')];var _0x921762=_0xa42b('0xff');var _0x5b794e=![];var _0x108d40={'chatVersion':_0x921762,'chatWebsiteAddressOrigin':_0x310510,'remote':_0x52bb6e[_0xa42b('0x100')],'query':querystring[_0xa42b('0x17')](_[_0xa42b('0x3e')](_0x52bb6e[_0xa42b('0x27')]({'plain':!![]}),{'customerIp':_0x22405c[_0xa42b('0x77')]['x-forwarded-for']||_0x22405c[_0xa42b('0x77')][_0xa42b('0x101')]||_0x22405c['connection'][_0xa42b('0x102')]||_0x22405c['ip'],'referer':_0x22405c[_0xa42b('0x77')][_0xa42b('0x9a')],'openedInteractions':_0xf32098,'maxInteractions':_0x2ed4b0,'virtual':_0x39e331[_0xa42b('0x103')],'online':_0xf82047,'custom':_0x39e331}))[_0xa42b('0x104')](/'/g,'\x5c\x27')};_0x40279d['send'](ejs[_0xa42b('0x105')](Mustache[_0xa42b('0x105')](_0x5c12ea,_0x108d40),{'proactiveActions':_0x465757,'alignment':_0x52bb6e[_0xa42b('0x106')],'verticalAlignment':_0x52bb6e[_0xa42b('0x107')],'div_color':_0x52bb6e[_0xa42b('0xe7')],'labelText':_0x52bb6e[_0xa42b('0x108')],'text_color':_0x52bb6e[_0xa42b('0x109')],'text_button_color':_0x52bb6e[_0xa42b('0x10a')],'button_color':_0x52bb6e[_0xa42b('0x10b')],'background_color':_0x52bb6e['backgroundColor'],'hideWhenOffline':_0x52bb6e[_0xa42b('0x10c')],'intervalId':_0x52bb6e['IntervalId'],'isDevelopment':_0x5b794e,'chatVersion':_0x921762}));})[_0xa42b('0x1b')](handleError(_0x40279d,null));};exports[_0xa42b('0x10d')]=function(_0x375b77,_0x56e8e1){var _0xaf6578=_0x375b77[_0xa42b('0x45')]['id'];var _0x73efd0=_0x375b77[_0xa42b('0x49')];var _0x20df5c=0xc8;var _0x3c9e2c=null;return db[_0xa42b('0xd0')][_0xa42b('0x10e')]({'isolationLevel':db[_0xa42b('0xd0')][_0xa42b('0x10f')][_0xa42b('0x110')][_0xa42b('0x111')]},function(_0x54709e){return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0xaf6578},'transaction':_0x54709e})['then'](function(_0x277c86){if(_0x277c86){return db[_0xa42b('0x8a')][_0xa42b('0x26')]({'where':{'ChatWebsiteId':_0xaf6578},'transaction':_0x54709e})[_0xa42b('0x29')](function(){var _0x28a150=_[_0xa42b('0x2f')](_0x73efd0,function(_0x1e02a7){_0x1e02a7['ChatWebsiteId']=_0xaf6578;return _0x1e02a7;});return db['ChatApplication']['bulkCreate'](_0x28a150,{'transaction':_0x54709e});});}else{_0x20df5c=0x194;_0x3c9e2c=[];}});})[_0xa42b('0x29')](function(){if(_0x20df5c!==0x194){return db[_0xa42b('0x8a')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xaf6578},'order':_0xa42b('0x8f')})[_0xa42b('0x29')](function(_0x146f9b){_0x3c9e2c=_0x146f9b;});}})[_0xa42b('0x1b')](function(_0x1e1223){_0x20df5c=0x1f4;logger['error'](_0x1e1223[_0xa42b('0x112')]);if(_0x1e1223[_0xa42b('0x2a')]){delete _0x1e1223['name'];}_0x3c9e2c=_0x1e1223;})['finally'](function(){if(_0x3c9e2c===null){_0x56e8e1[_0xa42b('0x1c')](_0x20df5c);}else{if(_0x20df5c===0x1f4){_0x56e8e1[_0xa42b('0x23')](_0x20df5c)[_0xa42b('0x2b')](_0x3c9e2c);}else{_0x56e8e1[_0xa42b('0x23')](_0x20df5c)[_0xa42b('0x1e')](_0x3c9e2c);}}});};exports['getApplications']=function(_0x36b220,_0x3458c0){var _0x39a2f2={};var _0x3b2482={};var _0x3fa958;var _0x5379b4;return db[_0xa42b('0x30')]['findOne']({'where':{'id':_0x36b220[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3458c0,null))[_0xa42b('0x29')](function(_0x392831){if(_0x392831){_0x3fa958=_0x392831;_0x3b2482[_0xa42b('0x34')]=_['keys'](db[_0xa42b('0x8a')][_0xa42b('0x47')]);_0x3b2482[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x36b220[_0xa42b('0x33')]);_0x3b2482[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x3b2482[_0xa42b('0x34')],_0x3b2482[_0xa42b('0x33')]);_0x39a2f2['attributes']=_[_0xa42b('0x48')](_0x3b2482[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x36b220[_0xa42b('0x33')][_0xa42b('0x36')]));_0x39a2f2['attributes']=_0x39a2f2['attributes'][_0xa42b('0x37')]?_0x39a2f2[_0xa42b('0x35')]:_0x3b2482['model'];_0x39a2f2[_0xa42b('0x57')]=qs['sort'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x39')]);_0x39a2f2[_0xa42b('0x3a')]=qs['filters'](_[_0xa42b('0x3b')](_0x36b220[_0xa42b('0x33')],_0x3b2482[_0xa42b('0x3c')]));if(_0x36b220[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x39a2f2['where']=_[_0xa42b('0x3e')](_0x39a2f2[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x39a2f2['attributes'],function(_0x494074){var _0x14527f={};_0x14527f[_0x494074]={'$like':'%'+_0x36b220[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x14527f;})});}_0x39a2f2=_['merge']({},_0x39a2f2,_0x36b220[_0xa42b('0x40')]);return _0x3fa958['getApplications'](_0x39a2f2);}})['then'](function(_0x3ba503){if(_0x3ba503){_0x5379b4=_0x3ba503[_0xa42b('0x37')];if(!_0x36b220[_0xa42b('0x33')][_0xa42b('0x38')]('nolimit')){_0x39a2f2[_0xa42b('0x21')]=qs['limit'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x21')]);_0x39a2f2[_0xa42b('0x1f')]=qs['offset'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x1f')]);}return _0x3fa958['getApplications'](_0x39a2f2);}})[_0xa42b('0x29')](function(_0x354e7a){if(_0x354e7a){return _0x354e7a?{'count':_0x5379b4,'rows':_0x354e7a}:null;}})[_0xa42b('0x29')](respondWithResult(_0x3458c0,null))[_0xa42b('0x1b')](handleError(_0x3458c0,null));};exports[_0xa42b('0x113')]=function(_0x339af8,_0xe3c5fe){return db['chatProactiveAction'][_0xa42b('0x4e')]({'where':{'id':_0x339af8[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0xe3c5fe,null))[_0xa42b('0x29')](function(_0x198c74){if(_0x198c74){return _0x198c74['addProactiveActions'](_0x339af8[_0xa42b('0x49')][_0xa42b('0x59')],_[_0xa42b('0xe1')](_0x339af8[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{});}})[_0xa42b('0x29')](respondWithResult(_0xe3c5fe,null))[_0xa42b('0x1b')](handleError(_0xe3c5fe,null));};exports[_0xa42b('0xf6')]=function(_0x6f0045,_0x40ae9b){var _0x35b466={};var _0x42fd78={};var _0x2d0b22;var _0x178353;return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x6f0045[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x40ae9b,null))[_0xa42b('0x29')](function(_0x16e8a0){if(_0x16e8a0){_0x2d0b22=_0x16e8a0;_0x42fd78[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x114')]['rawAttributes']);_0x42fd78['query']=_[_0xa42b('0x46')](_0x6f0045[_0xa42b('0x33')]);_0x42fd78[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x42fd78['model'],_0x42fd78[_0xa42b('0x33')]);_0x35b466[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x42fd78[_0xa42b('0x34')],qs['fields'](_0x6f0045[_0xa42b('0x33')][_0xa42b('0x36')]));_0x35b466['attributes']=_0x35b466['attributes'][_0xa42b('0x37')]?_0x35b466[_0xa42b('0x35')]:_0x42fd78[_0xa42b('0x34')];_0x35b466[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x6f0045[_0xa42b('0x33')]['sort']);_0x35b466['where']=qs['filters'](_[_0xa42b('0x3b')](_0x6f0045[_0xa42b('0x33')],_0x42fd78[_0xa42b('0x3c')]));if(_0x6f0045[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x35b466[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x35b466['where'],{'$or':_['map'](_0x35b466[_0xa42b('0x35')],function(_0x55e5df){var _0x3f5d39={};_0x3f5d39[_0x55e5df]={'$like':'%'+_0x6f0045[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x3f5d39;})});}_0x35b466=_[_0xa42b('0x3e')]({},_0x35b466,_0x6f0045[_0xa42b('0x40')]);return _0x2d0b22[_0xa42b('0xf6')](_0x35b466);}})[_0xa42b('0x29')](function(_0x271f90){if(_0x271f90){_0x178353=_0x271f90[_0xa42b('0x37')];if(!_0x6f0045['query']['hasOwnProperty'](_0xa42b('0x56'))){_0x35b466[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x6f0045[_0xa42b('0x33')][_0xa42b('0x21')]);_0x35b466[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x6f0045[_0xa42b('0x33')]['offset']);}return _0x2d0b22[_0xa42b('0xf6')](_0x35b466);}})['then'](function(_0xe20c5b){if(_0xe20c5b){return _0xe20c5b?{'count':_0x178353,'rows':_0xe20c5b}:null;}})['then'](respondWithResult(_0x40ae9b,null))['catch'](handleError(_0x40ae9b,null));};exports[_0xa42b('0x115')]=function(_0x56938d,_0x2e4343){var _0xbbcbf3=_0x56938d[_0xa42b('0x33')][_0xa42b('0x116')]==='false'?_0xa42b('0x117'):'onlineForm';return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'attributes':['id',_0xbbcbf3],'where':{'id':_0x56938d[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e4343,null))[_0xa42b('0x29')](function(_0x1ca25b){if(_0x1ca25b){var _0x3d97d5=_0x1ca25b[_0xbbcbf3];var _0x5b60ce=_0x3d97d5&&_0x3d97d5['items']?_0x3d97d5[_0xa42b('0x118')]:[];_0x2e4343['send']({'fromKey':_['isNil'](_0x3d97d5[_0xa42b('0x119')])?undefined:_0x3d97d5[_0xa42b('0x119')],'count':_0x5b60ce['length'],'rows':_0x5b60ce});}})[_0xa42b('0x1b')](handleError(_0x2e4343,null));};exports[_0xa42b('0x11a')]=function(_0x5375c8,_0x2686dd){var _0x70e7cc={'raw':![],'where':{}};var _0x54338f={};var _0x4e3cbf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0x5375c8[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2686dd,null))['then'](function(_0x5577bb){if(_0x5577bb){_0x54338f[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0xc9')][_0xa42b('0x47')]);_0x54338f['query']=_[_0xa42b('0x46')](_0x5375c8[_0xa42b('0x33')]);_0x54338f['filters']=_[_0xa42b('0x48')](_0x54338f['model'],_0x54338f[_0xa42b('0x33')]);_0x70e7cc[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x54338f[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x5375c8[_0xa42b('0x33')][_0xa42b('0x36')]));_0x70e7cc['attributes']=_0x70e7cc[_0xa42b('0x35')][_0xa42b('0x37')]?_0x70e7cc[_0xa42b('0x35')]:_0x54338f[_0xa42b('0x34')];if(!_0x5375c8['query'][_0xa42b('0x38')](_0xa42b('0x56'))){_0x70e7cc['limit']=qs[_0xa42b('0x21')](_0x5375c8[_0xa42b('0x33')]['limit']);_0x70e7cc['offset']=qs[_0xa42b('0x1f')](_0x5375c8[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x70e7cc[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x5375c8['query'][_0xa42b('0x39')]);_0x70e7cc[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x5375c8['query'],_0x54338f[_0xa42b('0x3c')]));_0x70e7cc[_0xa42b('0x3a')][_0xa42b('0x53')]=_0x5577bb['id'];if(_0x5375c8[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x70e7cc[_0xa42b('0x3a')]=_['merge'](_0x70e7cc[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x70e7cc[_0xa42b('0x35')],function(_0x10f033){var _0x5991d0={};_0x5991d0[_0x10f033]={'$like':'%'+_0x5375c8[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x5991d0;})});}_0x70e7cc=_[_0xa42b('0x3e')]({},_0x70e7cc,_0x5375c8['options']);return db[_0xa42b('0xc9')][_0xa42b('0x22')]({'where':_0x70e7cc['where']})[_0xa42b('0x29')](function(_0x174a7d){_0x4e3cbf[_0xa42b('0x22')]=_0x174a7d;if(_0x5375c8[_0xa42b('0x33')][_0xa42b('0x41')]){_0x70e7cc[_0xa42b('0x5d')]=[{'all':!![]}];}else{_0x70e7cc[_0xa42b('0x5d')]=[{'model':db[_0xa42b('0x91')],'as':_0xa42b('0xe3'),'required':![]},{'model':db[_0xa42b('0xd1')],'as':_0xa42b('0x11b'),'required':![]}];}return db[_0xa42b('0xc9')][_0xa42b('0x42')](_0x70e7cc);})[_0xa42b('0x29')](function(_0x52cded){_0x4e3cbf['rows']=_0x52cded;return _0x4e3cbf;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x2686dd,_0x70e7cc))[_0xa42b('0x1b')](handleError(_0x2686dd,null));};exports[_0xa42b('0x11c')]=function(_0x500b3d,_0x2f42a2){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x500b3d[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2f42a2,null))[_0xa42b('0x29')](function(_0x5e361d){if(_0x5e361d){return _0x5e361d[_0xa42b('0x11c')](_0x500b3d[_0xa42b('0x49')]['ids'],_[_0xa42b('0xe1')](_0x500b3d[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{})[_0xa42b('0xa9')](function(_0x4f28a9){for(var _0x56aabe=0x0;_0x56aabe<_0x500b3d[_0xa42b('0x49')][_0xa42b('0x59')]['length'];_0x56aabe+=0x1){socket[_0xa42b('0x11d')](_0xa42b('0x11e'),{'UserId':Number(_0x500b3d[_0xa42b('0x49')]['ids'][_0x56aabe]),'ChatWebsiteId':Number(_0x500b3d[_0xa42b('0x45')]['id'])});}return _0x4f28a9;});}})['then'](respondWithResult(_0x2f42a2,null))['catch'](handleError(_0x2f42a2,null));};exports[_0xa42b('0x11f')]=function(_0x1efecd,_0x528318){return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x1efecd[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x528318,null))[_0xa42b('0x29')](function(_0x502131){if(_0x502131){return _0x502131['removeAgents'](_0x1efecd['query'][_0xa42b('0x59')])[_0xa42b('0x29')](function(){if(_[_0xa42b('0x120')](_0x1efecd[_0xa42b('0x33')][_0xa42b('0x59')])){for(var _0x32ebf=0x0;_0x32ebf<_0x1efecd[_0xa42b('0x33')]['ids'][_0xa42b('0x37')];_0x32ebf+=0x1){socket[_0xa42b('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x1efecd[_0xa42b('0x33')][_0xa42b('0x59')][_0x32ebf]),'ChatWebsiteId':Number(_0x1efecd[_0xa42b('0x45')]['id'])});}}else{socket[_0xa42b('0x11d')](_0xa42b('0x121'),{'UserId':Number(_0x1efecd['query'][_0xa42b('0x59')]),'ChatWebsiteId':Number(_0x1efecd[_0xa42b('0x45')]['id'])});}});}})[_0xa42b('0x29')](respondWithStatusCode(_0x528318,null))['catch'](handleError(_0x528318,null));};exports[_0xa42b('0x122')]=function(_0x3fa1f4,_0x5bdfb6){var _0x2afa44={};var _0x447d39={};var _0x21331c;var _0x557c32;return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0x3fa1f4['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5bdfb6,null))[_0xa42b('0x29')](function(_0x3ed4d5){if(_0x3ed4d5){_0x21331c=_0x3ed4d5;_0x447d39[_0xa42b('0x34')]=_[_0xa42b('0x46')](db['User'][_0xa42b('0x47')]);_0x447d39[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x3fa1f4['query']);_0x447d39[_0xa42b('0x3c')]=_['intersection'](_0x447d39[_0xa42b('0x34')],_0x447d39['query']);_0x2afa44[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x447d39[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x3fa1f4['query'][_0xa42b('0x36')]));_0x2afa44[_0xa42b('0x35')]=_0x2afa44[_0xa42b('0x35')][_0xa42b('0x37')]?_0x2afa44[_0xa42b('0x35')]:_0x447d39[_0xa42b('0x34')];_0x2afa44[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x3fa1f4['query'][_0xa42b('0x39')]);_0x2afa44['where']=qs['filters'](_[_0xa42b('0x3b')](_0x3fa1f4[_0xa42b('0x33')],_0x447d39[_0xa42b('0x3c')]));if(_0x3fa1f4[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x2afa44['where']=_['merge'](_0x2afa44[_0xa42b('0x3a')],{'$or':_['map'](_0x2afa44['attributes'],function(_0x5adbfc){var _0x46076b={};_0x46076b[_0x5adbfc]={'$like':'%'+_0x3fa1f4['query'][_0xa42b('0x3d')]+'%'};return _0x46076b;})});}_0x2afa44=_[_0xa42b('0x3e')]({},_0x2afa44,_0x3fa1f4[_0xa42b('0x40')]);return _0x21331c[_0xa42b('0x122')](_0x2afa44);}})[_0xa42b('0x29')](function(_0x2c9212){if(_0x2c9212){_0x557c32=_0x2c9212[_0xa42b('0x37')];if(!_0x3fa1f4[_0xa42b('0x33')]['hasOwnProperty'](_0xa42b('0x56'))){_0x2afa44[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x3fa1f4[_0xa42b('0x33')]['limit']);_0x2afa44[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x3fa1f4[_0xa42b('0x33')][_0xa42b('0x1f')]);}return _0x21331c[_0xa42b('0x122')](_0x2afa44);}})['then'](function(_0x3c30e7){if(_0x3c30e7){return _0x3c30e7?{'count':_0x557c32,'rows':_0x3c30e7}:null;}})['then'](respondWithResult(_0x5bdfb6,null))[_0xa42b('0x1b')](handleError(_0x5bdfb6,null));}; \ No newline at end of file +var _0xb6c2=['CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','URL','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','onlineForm','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','UserProfileResource','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','create','body','user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','find','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','getResult','chat','no\x20available\x20attributes','createdAt','updatedAt','difference'];(function(_0x2228b8,_0x2a73c5){var _0x3fc754=function(_0x246d01){while(--_0x246d01){_0x2228b8['push'](_0x2228b8['shift']());}};_0x3fc754(++_0x2a73c5);}(_0xb6c2,0xa5));var _0x2b6c=function(_0x59c884,_0x3cc95a){_0x59c884=_0x59c884-0x0;var _0x291b1e=_0xb6c2[_0x59c884];return _0x291b1e;};'use strict';var BPromise=require(_0x2b6c('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0x2b6c('0x1'));var fs=require('fs');var fs_extra=require(_0x2b6c('0x2'));var _=require(_0x2b6c('0x3'));var querystring=require(_0x2b6c('0x4'));var Redis=require(_0x2b6c('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x2b6c('0x6'))(_0x2b6c('0x7'));var config=require(_0x2b6c('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2b6c('0x9')](config[_0x2b6c('0xa')],{'host':_0x2b6c('0xb'),'port':0x18eb});var socket=require(_0x2b6c('0xc'))(new Redis(config['redis']));require(_0x2b6c('0xd'))[_0x2b6c('0xe')](socket);var htmlToText=require(_0x2b6c('0xf'));var jayson=require(_0x2b6c('0x10'));var client=jayson[_0x2b6c('0x11')]['http']({'port':0x232c});var client9002=jayson[_0x2b6c('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x232b});var client9001=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x584ddd,_0x2af14d,_0x2f5c4a,_0x801b8a){return new BPromise(function(_0x4b1b55,_0x2e04b2){var _0x2a498e=_0x801b8a||client;return _0x2a498e['request'](_0x584ddd,_0x2f5c4a)[_0x2b6c('0x13')](function(_0x140fcb){logger[_0x2b6c('0x14')](_0x2b6c('0x15'),_0x2af14d,'request\x20sent');logger[_0x2b6c('0x16')](_0x2b6c('0x17'),_0x2af14d,_0x2b6c('0x18'),JSON['stringify'](_0x140fcb));if(_0x140fcb['error']){if(_0x140fcb[_0x2b6c('0x19')]['code']===0x1f4){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);return _0x2e04b2(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}logger['error'](_0x2b6c('0x15'),_0x2af14d,_0x140fcb['error'][_0x2b6c('0x1a')]);return _0x4b1b55(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2af14d,_0x2b6c('0x18'));_0x4b1b55(_0x140fcb[_0x2b6c('0x1b')][_0x2b6c('0x1a')]);}})['catch'](function(_0x41317b){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x41317b);_0x2e04b2(_0x41317b);});});}function respondWithStatusCode(_0x41b9b3,_0x24d957){_0x24d957=_0x24d957||0xcc;return function(_0x27c11a){if(_0x27c11a){return _0x41b9b3[_0x2b6c('0x1c')](_0x24d957);}return _0x41b9b3[_0x2b6c('0x1d')](_0x24d957)[_0x2b6c('0x1e')]();};}function respondWithResult(_0x5b0f3b,_0x474d76){_0x474d76=_0x474d76||0xc8;return function(_0x176f97){if(_0x176f97){return _0x5b0f3b[_0x2b6c('0x1d')](_0x474d76)['json'](_0x176f97);}};}function respondWithFilteredResult(_0x3cc6a3,_0x5c7e30){return function(_0x58aa80){if(_0x58aa80){var _0x543182=typeof _0x5c7e30[_0x2b6c('0x1f')]===_0x2b6c('0x20')&&typeof _0x5c7e30[_0x2b6c('0x21')]===_0x2b6c('0x20');var _0x33e16f=_0x58aa80[_0x2b6c('0x22')];var _0x40c7c5=_0x543182?0x0:_0x5c7e30[_0x2b6c('0x1f')];var _0x2a3084=_0x543182?_0x58aa80[_0x2b6c('0x22')]:_0x5c7e30[_0x2b6c('0x1f')]+_0x5c7e30[_0x2b6c('0x21')];var _0x13cf47;if(_0x2a3084>=_0x33e16f){_0x2a3084=_0x33e16f;_0x13cf47=0xc8;}else{_0x13cf47=0xce;}_0x3cc6a3[_0x2b6c('0x1d')](_0x13cf47);return _0x3cc6a3[_0x2b6c('0x23')](_0x2b6c('0x24'),_0x40c7c5+'-'+_0x2a3084+'/'+_0x33e16f)[_0x2b6c('0x25')](_0x58aa80);}return null;};}function saveUpdates(_0x1de723){return function(_0xb6045c){if(_0xb6045c){return _0xb6045c[_0x2b6c('0x26')](_0x1de723)['then'](function(_0xb4153e){return _0xb4153e;});}return null;};}function removeEntity(_0x37e7b){return function(_0x96346){if(_0x96346){return _0x96346[_0x2b6c('0x27')]()[_0x2b6c('0x13')](function(){var _0x2c9ced=_0x96346[_0x2b6c('0x28')]({'plain':!![]});var _0x44bb48='ChatWebsites';return db[_0x2b6c('0x29')][_0x2b6c('0x27')]({'where':{'type':_0x44bb48,'resourceId':_0x2c9ced['id']}})[_0x2b6c('0x13')](function(){return _0x96346;});})['then'](function(){_0x37e7b[_0x2b6c('0x1d')](0xcc)[_0x2b6c('0x1e')]();});}};}function handleEntityNotFound(_0x21834a){return function(_0x341d01){if(!_0x341d01){_0x21834a[_0x2b6c('0x1c')](0x194);}return _0x341d01;};}function handleError(_0x287166,_0x27af91){_0x27af91=_0x27af91||0x1f4;return function(_0x3e6039){logger[_0x2b6c('0x19')](_0x3e6039['stack']);if(_0x3e6039[_0x2b6c('0x2a')]){delete _0x3e6039[_0x2b6c('0x2a')];}_0x287166['status'](_0x27af91)[_0x2b6c('0x2b')](_0x3e6039);};}exports['index']=function(_0x35b5f,_0xc2a02c){var _0x54ac13={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x347054={},_0x3a6bea={'count':0x0,'rows':[]};var _0xf70e79=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x3b3561){return{'name':_0x3b3561[_0x2b6c('0x2c')],'type':_0x3b3561['type'][_0x2b6c('0x2d')]};});_0x347054[_0x2b6c('0x2e')]=_[_0x2b6c('0x2f')](_0xf70e79,_0x2b6c('0x2a'));_0x347054[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x35b5f['query']);_0x347054[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x347054[_0x2b6c('0x2e')],_0x347054[_0x2b6c('0x30')]);_0x54ac13[_0x2b6c('0x34')]=_['intersection'](_0x347054[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x54ac13[_0x2b6c('0x34')]=_0x54ac13[_0x2b6c('0x34')]['length']?_0x54ac13[_0x2b6c('0x34')]:_0x347054[_0x2b6c('0x2e')];if(!_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x54ac13[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x35b5f['query'][_0x2b6c('0x21')]);_0x54ac13['offset']=qs[_0x2b6c('0x1f')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x54ac13[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x35b5f['query'][_0x2b6c('0x39')]);_0x54ac13[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x35b5f[_0x2b6c('0x30')],_0x347054[_0x2b6c('0x32')]),_0xf70e79);if(_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x54ac13[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x54ac13[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0xf70e79,function(_0x78aba0){if(_0x78aba0[_0x2b6c('0x3e')]!==_0x2b6c('0x3f')){var _0x52e881={};_0x52e881[_0x78aba0[_0x2b6c('0x2a')]]={'$like':'%'+_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x52e881;}})});}_0x54ac13=_[_0x2b6c('0x3d')]({},_0x54ac13,_0x35b5f[_0x2b6c('0x40')]);var _0x475e04={'where':_0x54ac13['where']};return db[_0x2b6c('0x41')][_0x2b6c('0x22')](_0x475e04)[_0x2b6c('0x13')](function(_0x15994c){_0x3a6bea[_0x2b6c('0x22')]=_0x15994c;if(_0x35b5f['query'][_0x2b6c('0x42')]){_0x54ac13[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x41')][_0x2b6c('0x44')](_0x54ac13);})[_0x2b6c('0x13')](function(_0x1f1590){_0x3a6bea[_0x2b6c('0x45')]=_0x1f1590;return _0x3a6bea;})[_0x2b6c('0x13')](respondWithFilteredResult(_0xc2a02c,_0x54ac13))[_0x2b6c('0x46')](handleError(_0xc2a02c,null));};exports[_0x2b6c('0x47')]=function(_0x1b78e6,_0x1d41d4){var _0x4d8487={'raw':![],'where':{'id':_0x1b78e6[_0x2b6c('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x2b6c('0x49')}]},_0x765b0b={};_0x765b0b[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x41')]['rawAttributes']);_0x765b0b[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x1b78e6[_0x2b6c('0x30')]);_0x765b0b[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x765b0b[_0x2b6c('0x2e')],_0x765b0b['query']);_0x4d8487[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x765b0b['model'],qs[_0x2b6c('0x35')](_0x1b78e6['query'][_0x2b6c('0x35')]));_0x4d8487[_0x2b6c('0x34')]=_0x4d8487[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x4d8487[_0x2b6c('0x34')]:_0x765b0b[_0x2b6c('0x2e')];if(_0x1b78e6[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x4d8487[_0x2b6c('0x43')]=[{'all':!![]}];}_0x4d8487=_[_0x2b6c('0x3d')]({},_0x4d8487,_0x1b78e6[_0x2b6c('0x40')]);return db['ChatWebsite']['find'](_0x4d8487)['then'](handleEntityNotFound(_0x1d41d4,null))[_0x2b6c('0x13')](respondWithResult(_0x1d41d4,null))[_0x2b6c('0x46')](handleError(_0x1d41d4,null));};exports['create']=function(_0x382a3a,_0x17f104){return db['ChatWebsite'][_0x2b6c('0x4b')](_0x382a3a[_0x2b6c('0x4c')],{})[_0x2b6c('0x13')](function(_0x3573be){var _0xf316ba=_0x382a3a[_0x2b6c('0x4d')][_0x2b6c('0x28')]({'plain':!![]});if(!_0xf316ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf316ba[_0x2b6c('0x4e')]==='user'){var _0x31e734=_0x3573be[_0x2b6c('0x28')]({'plain':!![]});var _0x19e7fd=_0x2b6c('0x4f');return db[_0x2b6c('0x50')]['find']({'where':{'name':_0x19e7fd,'userProfileId':_0xf316ba['userProfileId']},'raw':!![]})[_0x2b6c('0x13')](function(_0x485b1d){if(_0x485b1d&&_0x485b1d[_0x2b6c('0x51')]===0x0){return db[_0x2b6c('0x29')][_0x2b6c('0x4b')]({'name':_0x31e734[_0x2b6c('0x2a')],'resourceId':_0x31e734['id'],'type':_0x485b1d[_0x2b6c('0x2a')],'sectionId':_0x485b1d['id']},{})['then'](function(){return _0x3573be;});}else{return _0x3573be;}})['catch'](function(_0xa1c23b){logger[_0x2b6c('0x19')](_0x2b6c('0x52'),_0xa1c23b);throw _0xa1c23b;});}return _0x3573be;})[_0x2b6c('0x13')](respondWithResult(_0x17f104,0xc9))[_0x2b6c('0x46')](handleError(_0x17f104,null));};exports[_0x2b6c('0x26')]=function(_0x2af718,_0x3aeba6){if(_0x2af718[_0x2b6c('0x4c')]['id']){delete _0x2af718['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2af718[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x53')],'as':_0x2b6c('0x49')}]})[_0x2b6c('0x13')](handleEntityNotFound(_0x3aeba6,null))[_0x2b6c('0x13')](saveUpdates(_0x2af718[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x3aeba6,null))[_0x2b6c('0x46')](handleError(_0x3aeba6,null));};exports[_0x2b6c('0x27')]=function(_0xa0af8e,_0x5861e9){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0xa0af8e[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5861e9,null))['then'](removeEntity(_0x5861e9,null))[_0x2b6c('0x46')](handleError(_0x5861e9,null));};exports[_0x2b6c('0x54')]=function(_0x44847e,_0xd23f2e){return db[_0x2b6c('0x41')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](respondWithResult(_0xd23f2e,null))[_0x2b6c('0x46')](handleError(_0xd23f2e,null));};exports[_0x2b6c('0x55')]=function(_0x326ce5,_0x532a1d){if(_0x326ce5['body']['id']){delete _0x326ce5[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x326ce5[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x532a1d,null))[_0x2b6c('0x13')](function(_0x239ad1){if(_0x239ad1){_0x326ce5[_0x2b6c('0x4c')][_0x2b6c('0x57')]=_0x239ad1['id'];return db[_0x2b6c('0x58')]['create'](_0x326ce5[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x532a1d,null))[_0x2b6c('0x46')](handleError(_0x532a1d,null));};exports[_0x2b6c('0x59')]=function(_0x2ebf91,_0x243100){var _0x229280={'raw':![],'where':{}};var _0x574b6d={};var _0x203cce={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x2ebf91['params']['id']}})['then'](handleEntityNotFound(_0x243100,null))[_0x2b6c('0x13')](function(_0xf8caf1){if(_0xf8caf1){_0x574b6d['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0x58')]['rawAttributes']);_0x574b6d[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2ebf91[_0x2b6c('0x30')]);_0x574b6d['filters']=_['intersection'](_0x574b6d[_0x2b6c('0x2e')],_0x574b6d[_0x2b6c('0x30')]);_0x229280['attributes']=_[_0x2b6c('0x33')](_0x574b6d['model'],qs[_0x2b6c('0x35')](_0x2ebf91['query'][_0x2b6c('0x35')]));_0x229280[_0x2b6c('0x34')]=_0x229280['attributes']['length']?_0x229280[_0x2b6c('0x34')]:_0x574b6d[_0x2b6c('0x2e')];if(!_0x2ebf91[_0x2b6c('0x30')]['hasOwnProperty']('nolimit')){_0x229280['limit']=qs[_0x2b6c('0x21')](_0x2ebf91['query'][_0x2b6c('0x21')]);_0x229280['offset']=qs[_0x2b6c('0x1f')](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x229280['order']=qs['sort'](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x229280[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x2ebf91[_0x2b6c('0x30')],_0x574b6d[_0x2b6c('0x32')]));_0x229280['where']['ChatWebsiteId']=_0xf8caf1['id'];if(_0x2ebf91['query'][_0x2b6c('0x3c')]){_0x229280[_0x2b6c('0x3a')]=_['merge'](_0x229280[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x229280[_0x2b6c('0x34')],function(_0x1cfd58){var _0x48d33c={};_0x48d33c[_0x1cfd58]={'$like':'%'+_0x2ebf91['query'][_0x2b6c('0x3c')]+'%'};return _0x48d33c;})});}_0x229280=_['merge']({},_0x229280,_0x2ebf91[_0x2b6c('0x40')]);return db[_0x2b6c('0x58')][_0x2b6c('0x22')]({'where':_0x229280[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x157039){_0x203cce[_0x2b6c('0x22')]=_0x157039;if(_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x229280[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x58')][_0x2b6c('0x44')](_0x229280);})[_0x2b6c('0x13')](function(_0x17632c){_0x203cce[_0x2b6c('0x45')]=_0x17632c;return _0x203cce;});}})[_0x2b6c('0x13')](respondWithFilteredResult(_0x243100,_0x229280))[_0x2b6c('0x46')](handleError(_0x243100,null));};exports[_0x2b6c('0x5b')]=function(_0x519a90,_0x50498d){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x519a90['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x50498d,null))['then'](function(_0x24f958){if(_0x24f958){return _0x24f958['removeDispositions'](_0x519a90[_0x2b6c('0x30')][_0x2b6c('0x5c')]);}})['then'](respondWithStatusCode(_0x50498d,null))[_0x2b6c('0x46')](handleError(_0x50498d,null));};exports[_0x2b6c('0x5d')]=function(_0x39a7e1,_0x211e15){if(_0x39a7e1[_0x2b6c('0x4c')]['id']){delete _0x39a7e1[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x39a7e1[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x211e15,null))['then'](function(_0x253afd){if(_0x253afd){_0x39a7e1[_0x2b6c('0x4c')]['ChatWebsiteId']=_0x253afd['id'];return db[_0x2b6c('0x5e')][_0x2b6c('0x4b')](_0x39a7e1[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x211e15,null))['catch'](handleError(_0x211e15,null));};exports[_0x2b6c('0x5f')]=function(_0x103a6b,_0x26244b){var _0x18a336={'raw':![],'where':{}};var _0x3ef0e9={};var _0x379d4e={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x103a6b[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x26244b,null))[_0x2b6c('0x13')](function(_0x38013f){if(_0x38013f){_0x3ef0e9[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['CannedAnswer'][_0x2b6c('0x60')]);_0x3ef0e9[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x103a6b['query']);_0x3ef0e9['filters']=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],_0x3ef0e9[_0x2b6c('0x30')]);_0x18a336[_0x2b6c('0x34')]=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x103a6b['query'][_0x2b6c('0x35')]));_0x18a336[_0x2b6c('0x34')]=_0x18a336[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x18a336[_0x2b6c('0x34')]:_0x3ef0e9[_0x2b6c('0x2e')];if(!_0x103a6b['query'][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x18a336['limit']=qs[_0x2b6c('0x21')](_0x103a6b['query']['limit']);_0x18a336['offset']=qs[_0x2b6c('0x1f')](_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x18a336[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x103a6b[_0x2b6c('0x30')]['sort']);_0x18a336[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x103a6b[_0x2b6c('0x30')],_0x3ef0e9[_0x2b6c('0x32')]));_0x18a336[_0x2b6c('0x3a')]['ChatWebsiteId']=_0x38013f['id'];if(_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x18a336[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x18a336[_0x2b6c('0x3a')],{'$or':_['map'](_0x18a336['attributes'],function(_0x3a0d1e){var _0x378be8={};_0x378be8[_0x3a0d1e]={'$like':'%'+_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x378be8;})});}_0x18a336=_[_0x2b6c('0x3d')]({},_0x18a336,_0x103a6b[_0x2b6c('0x40')]);return db[_0x2b6c('0x5e')][_0x2b6c('0x22')]({'where':_0x18a336['where']})[_0x2b6c('0x13')](function(_0x1ed353){_0x379d4e[_0x2b6c('0x22')]=_0x1ed353;if(_0x103a6b[_0x2b6c('0x30')]['includeAll']){_0x18a336[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x5e')][_0x2b6c('0x44')](_0x18a336);})['then'](function(_0x5207e5){_0x379d4e['rows']=_0x5207e5;return _0x379d4e;});}})['then'](respondWithFilteredResult(_0x26244b,_0x18a336))[_0x2b6c('0x46')](handleError(_0x26244b,null));};exports['removeAnswers']=function(_0x2e2141,_0x520423){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x2e2141[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x520423,null))['then'](function(_0x58b375){if(_0x58b375){return _0x58b375['removeAnswers'](_0x2e2141['query'][_0x2b6c('0x5c')]);}})[_0x2b6c('0x13')](respondWithStatusCode(_0x520423,null))[_0x2b6c('0x46')](handleError(_0x520423,null));};exports['addLogo']=function(_0xfc1b07,_0x1d3e1c){_0xfc1b07[_0x2b6c('0x4c')][_0x2b6c('0x61')]=_0xfc1b07[_0x2b6c('0x62')]['filename'];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0xfc1b07['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x1d3e1c,null))[_0x2b6c('0x13')](saveUpdates(_0xfc1b07[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x1d3e1c,null))['catch'](handleError(_0x1d3e1c,null));};exports[_0x2b6c('0x63')]=function(_0x446f2d,_0x492d1e){_0x446f2d[_0x2b6c('0x4c')][_0x2b6c('0x64')]=_0x446f2d['file'][_0x2b6c('0x65')];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x446f2d[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x492d1e,null))[_0x2b6c('0x13')](saveUpdates(_0x446f2d['body'],null))['then'](respondWithResult(_0x492d1e,null))[_0x2b6c('0x46')](handleError(_0x492d1e,null));};exports[_0x2b6c('0x66')]=function(_0x4589a8,_0x24e2f2){_0x4589a8[_0x2b6c('0x4c')][_0x2b6c('0x67')]=_0x4589a8[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x4589a8['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x24e2f2,null))[_0x2b6c('0x13')](saveUpdates(_0x4589a8[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x24e2f2,null))[_0x2b6c('0x46')](handleError(_0x24e2f2,null));};exports[_0x2b6c('0x68')]=function(_0x3c4dc6,_0x196a34){_0x3c4dc6[_0x2b6c('0x4c')][_0x2b6c('0x69')]=_0x3c4dc6[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x3c4dc6[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x196a34,null))['then'](saveUpdates(_0x3c4dc6[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x196a34,null))[_0x2b6c('0x46')](handleError(_0x196a34,null));};exports[_0x2b6c('0x6a')]=function(_0xdf72fc,_0x5d198d){var _0x4ce934=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x6d'));var _0x1db788={'where':{'id':_0xdf72fc[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x61')],'raw':!![]};var _0x59b559=![];return require(_0x2b6c('0x6e'))[_0x2b6c('0x6f')]()[_0x2b6c('0x13')](function(_0x476f05){if(_0x476f05){_0x59b559=_0x476f05[_0x2b6c('0x70')];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x1db788);})['then'](handleEntityNotFound(_0x5d198d,null))['then'](function(_0x2a0bcf){if(_0x2a0bcf){if(!_[_0x2b6c('0x71')](_0x2a0bcf[_0x2b6c('0x61')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/logos/',_0x2a0bcf[_0x2b6c('0x61')]))&&_0x59b559){_0x4ce934=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x72'),_0x2a0bcf['sitepic']);}}return _0x5d198d[_0x2b6c('0x73')](_0x4ce934);}})[_0x2b6c('0x46')](handleError(_0x5d198d,null));};exports['getAvatar']=function(_0x312be0,_0x49f0f5){var _0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x74'));var _0x3aa51f={'where':{'id':_0x312be0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x64')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x3aa51f)[_0x2b6c('0x13')](handleEntityNotFound(_0x49f0f5,null))[_0x2b6c('0x13')](function(_0x511045){if(_0x511045){if(!_[_0x2b6c('0x71')](_0x511045['agentAvatar'])){if(fs[_0x2b6c('0x75')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]))){_0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]);}}return _0x49f0f5['download'](_0x5b0c68);}})[_0x2b6c('0x46')](handleError(_0x49f0f5,null));};exports[_0x2b6c('0x77')]=function(_0x5dc3d0,_0x30ccc8){var _0x3d7e7d=path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x78'));var _0x3365c0={'where':{'id':_0x5dc3d0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x67'),_0x2b6c('0x79')],'raw':!![]};return db[_0x2b6c('0x41')]['find'](_0x3365c0)[_0x2b6c('0x13')](handleEntityNotFound(_0x30ccc8,null))['then'](function(_0x2a1dbe){if(_0x2a1dbe){if(!_[_0x2b6c('0x71')](_0x2a1dbe[_0x2b6c('0x67')])){if(fs['existsSync'](path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]))&&_0x2a1dbe[_0x2b6c('0x79')]){_0x3d7e7d=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]);}}return _0x30ccc8[_0x2b6c('0x73')](_0x3d7e7d);}})[_0x2b6c('0x46')](handleError(_0x30ccc8,null));};exports['getSystemAvatar']=function(_0x3cf067,_0xd502c0){var _0x417e48=path[_0x2b6c('0x6b')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x474983={'where':{'id':_0x3cf067[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x69')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x474983)[_0x2b6c('0x13')](handleEntityNotFound(_0xd502c0,null))['then'](function(_0x546919){if(_0x546919){if(!_[_0x2b6c('0x71')](_0x546919[_0x2b6c('0x69')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919['systemAvatar']))){_0x417e48=path['join'](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919[_0x2b6c('0x69')]);}}return _0xd502c0[_0x2b6c('0x73')](_0x417e48);}})['catch'](handleError(_0xd502c0,null));};exports[_0x2b6c('0x7a')]=function(_0x4881b6,_0xa3d644){var _0x13b0af=require(_0x2b6c('0x7b'));var _0x157eac=new _0x13b0af();var _0x4e1e91=_0x157eac[_0x2b6c('0x7c')](_0x4881b6['headers']['user-agent'])[_0x2b6c('0x7d')]();var _0x19cfb1={'body':_0x4881b6['body'],'channel':_0x2b6c('0x7e')};var _0x3566fa=[];var _0x265e61=[];var _0x88aa13={};var _0x240164=![];return db['CmContact']['describe']()['then'](function(_0x2bc2de){if(!_0x2bc2de){throw new db['Sequelize']['ValidationError'](_0x2b6c('0x7f'));}_0x3566fa=_['difference'](_[_0x2b6c('0x31')](_0x2bc2de),[_0x2b6c('0x80'),_0x2b6c('0x81')]);_0x265e61=_[_0x2b6c('0x82')](_[_0x2b6c('0x31')](_0x2bc2de),['createdAt',_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x4881b6['body']['id']){delete _0x4881b6[_0x2b6c('0x4c')]['id'];}if(_['isNil'](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')])){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x88'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')]===''){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8b')+_0x265e61);}if(!_['includes'](_0x265e61,_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8c')+_0x265e61);}_0x88aa13[_0x4881b6['body'][_0x2b6c('0x8a')]]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')];})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x4881b6[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x8d')],'as':_0x2b6c('0x8e'),'include':[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0x90'),'where':_0x88aa13,'limit':0x1,'order':[[_0x2b6c('0x81'),'DESC']]}]},{'model':db[_0x2b6c('0x91')],'as':_0x2b6c('0x92')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0xa3d644,null))['then'](function(_0x56407c){if(_0x56407c&&_0x56407c[_0x2b6c('0x8e')]){_0x19cfb1[_0x2b6c('0x93')]=_0x56407c;_0x19cfb1[_0x2b6c('0x94')]=_0x56407c[_0x2b6c('0x92')];_0x19cfb1['list']=_0x56407c[_0x2b6c('0x8e')];_0x19cfb1[_0x2b6c('0x94')]=_[_0x2b6c('0x95')](_0x19cfb1['applications'],[_0x2b6c('0x96')],[_0x2b6c('0x97')]);if(_0x19cfb1['account'][_0x2b6c('0x92')]){delete _0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x92')];}if(_0x19cfb1[_0x2b6c('0x93')]['List']&&_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x8e')][_0x2b6c('0x90')]['length']){return _0x19cfb1[_0x2b6c('0x93')]['List'][_0x2b6c('0x90')][0x0];}var _0x3066a3=_['defaults'](_0x4881b6[_0x2b6c('0x4c')],{'firstName':_0x4881b6['body'][_0x2b6c('0x85')],'ListId':_0x56407c[_0x2b6c('0x84')]});_0x3066a3[_0x4881b6[_0x2b6c('0x4c')]['mapKey']]=_0x4881b6[_0x2b6c('0x4c')]['from'];return db[_0x2b6c('0x8f')][_0x2b6c('0x4b')](_0x3066a3,{'fields':_0x3566fa,'raw':!![]});}})['then'](handleEntityNotFound(_0xa3d644,null))[_0x2b6c('0x13')](function(_0x10fc06){_0x19cfb1[_0x2b6c('0x98')]=_0x10fc06;var _0x1229d1=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x99')];if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9b')]){_0x1229d1=_0x4881b6['headers']['cf-connecting-ip'];}else if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')]){_0x1229d1=_[_0x2b6c('0x9d')](_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')][_0x2b6c('0x9e')](','));}if(_0x10fc06){var _0x270a41={'ContactId':_0x10fc06['id'],'ChatWebsiteId':_0x4881b6[_0x2b6c('0x48')]['id'],'from':(_0x10fc06[_0x2b6c('0x9f')]||'')+'\x20'+(_0x10fc06[_0x2b6c('0xa0')]||''),'customerIp':_0x1229d1,'customerPort':_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]?_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]:null,'referer':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xa2')],'browserName':_0x4e1e91['browser'][_0x2b6c('0x2a')]&&_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]?util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0x2a')],_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]):_0x2b6c('0xa7'),'browserVersion':_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]||_0x2b6c('0xa7'),'osName':util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91['os'][_0x2b6c('0x2a')],_0x4e1e91['os'][_0x2b6c('0xa4')]),'osVersion':_0x4e1e91['os'][_0x2b6c('0xa4')],'deviceModel':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x2e')]&&_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')]?util[_0x2b6c('0xa5')]('%s\x20%s\x20%s',_0x4e1e91['device'][_0x2b6c('0x2e')],_0x4e1e91['device'][_0x2b6c('0xa9')],_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x3e')]):null,'deviceVendor':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')],'deviceType':_0x4e1e91[_0x2b6c('0xa8')]['type'],'formData':JSON[_0x2b6c('0xaa')](_0x4881b6[_0x2b6c('0x4c')])};var _0x250113={'ChatWebsiteId':_0x4881b6['params']['id'],'closed':![]};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]){_0x250113[_0x2b6c('0xab')]=_0x4881b6['body'][_0x2b6c('0xab')];return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':_0x250113})[_0x2b6c('0x13')](function(_0x229b56){if(_0x229b56){return[_0x229b56,![]];}_0x270a41['threadId']=_0x4881b6[_0x2b6c('0x4c')]['threadId'];_0x270a41[_0x2b6c('0xad')]=_0x4881b6['body'][_0x2b6c('0xad')];return db[_0x2b6c('0xac')]['create'](_0x270a41)[_0x2b6c('0x13')](function(_0x3441cb){return[_0x3441cb,!![]];});});}_0x250113[_0x2b6c('0xae')]=_0x10fc06['id'];if(_0x4881b6[_0x2b6c('0x4c')]['interaction']&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id']){_0x250113['id']=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id'];return db[_0x2b6c('0xac')]['find']({'where':_0x250113})[_0x2b6c('0x13')](function(_0x3380a9){if(_0x3380a9){return[_0x3380a9,![]];}return db[_0x2b6c('0xac')][_0x2b6c('0x4b')](_0x270a41)[_0x2b6c('0x13')](function(_0x56fb08){return[_0x56fb08,!![]];});});}return db['ChatInteraction'][_0x2b6c('0x4b')](_0x270a41)['then'](function(_0x403dea){return[_0x403dea,!![]];});}})[_0x2b6c('0xb0')](function(_0xdafa77,_0x4bf470){if(_0xdafa77){_0x240164=_0x4bf470;if(!_0x4bf470){var _0x4479ff={'from':(_0x19cfb1[_0x2b6c('0x98')][_0x2b6c('0x9f')]||'')+'\x20'+(_0x19cfb1['contact'][_0x2b6c('0xa0')]||'')};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]!=_0x4881b6[_0x2b6c('0x4c')]['messageId']){_0x4479ff[_0x2b6c('0xab')]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')];}return _0xdafa77[_0x2b6c('0x26')](_0x4479ff);}else{return _0xdafa77;}}})[_0x2b6c('0x13')](function(_0x19aba4){_0x19cfb1['interaction']=_0x19aba4[_0x2b6c('0x28')]({'plain':!![]});_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb2')]=_0x240164;if(_0x19cfb1['interaction'][_0x2b6c('0xb2')]){if(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb3')]){_0x19cfb1[_0x2b6c('0x94')]['push']({'id':0x0,'priority':_0x19cfb1[_0x2b6c('0x94')]['length']+0x1,'app':'close','appdata':_0x2b6c('0xb4'),'interval':'*,*,*,*'});}}return db[_0x2b6c('0xb5')]['create']({'body':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')],'ChatWebsiteId':_0x4881b6['params']['id'],'ChatInteractionId':_0x19aba4['id'],'direction':'in','ContactId':_0x19cfb1[_0x2b6c('0x98')]['id'],'AttachmentId':_0x4881b6[_0x2b6c('0x4c')]['AttachmentId']});})[_0x2b6c('0x13')](function(_0x30f36e){_0x19cfb1[_0x2b6c('0x1a')]=_0x30f36e;if(_0x19cfb1['interaction']['UserId']){return db['User'][_0x2b6c('0x56')]({'attributes':['id','name'],'where':{'id':_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb6')]}})['then'](function(_0x534f98){if(_0x534f98){_0x19cfb1[_0x2b6c('0x94')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2b6c('0xb7'),'appdata':_0x534f98[_0x2b6c('0x2a')]+','+(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb8')]||0xa),'interval':'*,*,*,*'});_0x19cfb1[_0x2b6c('0xb9')]=!![];}return respondWithRpcPromise(_0x2b6c('0xba'),'startRouting',_0x19cfb1);});}return respondWithRpcPromise(_0x2b6c('0xba'),_0x2b6c('0xbb'),_0x19cfb1);})[_0x2b6c('0x13')](function(_0x6cfcb){respondWithRpcPromise(_0x2b6c('0xbc'),_0x2b6c('0xbc'),{'event':'notify','message':_0x6cfcb},client9002);return _0x6cfcb;})[_0x2b6c('0x13')](respondWithResult(_0xa3d644,null))['catch'](handleError(_0xa3d644,null));};exports[_0x2b6c('0xbd')]=function(_0x1f2281,_0x52dbc1){var _0xed2c38,_0x174332,_0x5d8cf0;var _0x4033b2=[];var _0x1731e0={};var _0x17daac=_0x1f2281[_0x2b6c('0xbe')]||[];var _0x26db61=[];var _0x16ef22;return db[_0x2b6c('0x8f')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](function(_0x13b089){if(!_0x13b089){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x7f'));}_0x4033b2=_[_0x2b6c('0x82')](_['keys'](_0x13b089),[_0x2b6c('0x80'),_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x1f2281[_0x2b6c('0x4c')]['id']){delete _0x1f2281[_0x2b6c('0x4c')]['id'];}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['from'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x88')));}if(_['isNil'](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x1f2281[_0x2b6c('0x4c')]['body']===''){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89')));}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4033b2));}if(!_[_0x2b6c('0xbf')](_0x4033b2,_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')])){throw _0x52dbc1['status'](0x1f4)['send'](new db[(_0x2b6c('0x86'))]['ValidationError'](_0x2b6c('0xc1')+_0x4033b2));}_0x1731e0[_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')]]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];})['then'](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x1f2281[_0x2b6c('0x48')]['id']},'include':[{'model':db['CmList'],'as':_0x2b6c('0x8e')},{'model':db[_0x2b6c('0xc2')],'as':_0x2b6c('0xc2')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0x52dbc1,null))[_0x2b6c('0x13')](function(_0x5df218){if(_0x5df218&&_0x5df218[_0x2b6c('0x8e')]){_0x174332=_0x5df218;var _0x21a82e=_[_0x2b6c('0x9')](_0x1f2281[_0x2b6c('0x4c')],{'firstName':_0x1f2281['body'][_0x2b6c('0x85')],'phone':_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')],'ListId':_0x5df218[_0x2b6c('0x84')]});_0x21a82e[_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline']]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];return db[_0x2b6c('0x8f')][_0x2b6c('0xc3')]({'where':_0x1731e0,'defaults':_0x21a82e});}})[_0x2b6c('0xb0')](function(_0x5ae640){if(_0x5ae640){_0x5d8cf0=_0x5ae640;var _0x2fd5e9=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xc5')),_0x2b6c('0xc6'));var _0x1987be=ejs[_0x2b6c('0xc7')](_0x2fd5e9,{'body':_[_0x2b6c('0xc8')](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')]),'bodyTitle':_0x174332['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2b6c('0x4b')]({'body':_0x1987be,'plainBody':htmlToText[_0x2b6c('0xc9')](_0x1987be),'ContactId':_0x5ae640['id'],'ChatWebsiteId':_0x174332['id']});}})[_0x2b6c('0x13')](function(_0x190460){_0x16ef22=_0x190460;if(_0x17daac['length']){var _0x4953b2=_0x17daac[_0x2b6c('0x2f')](function(_0x37ba00){return{'name':_0x37ba00[_0x2b6c('0xca')],'basename':_0x37ba00['filename'],'type':_0x37ba00[_0x2b6c('0xcb')],'ChatOfflineMessageId':_0x190460['id']};});_0x26db61=_0x4953b2['map'](_0x28ae85=>{var _0xfb661a={'filename':_0x28ae85['name'],'path':path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),'offline-chat',_0x28ae85[_0x2b6c('0xce')])};return _0xfb661a;});if(!_0x174332[_0x2b6c('0xcf')]){return db[_0x2b6c('0xd0')][_0x2b6c('0xd1')](function(_0xa5812){return db[_0x2b6c('0xd2')][_0x2b6c('0xd3')](_0x4953b2,{'transaction':_0xa5812});});}}})[_0x2b6c('0x13')](function(){if(_0x16ef22){_0xed2c38=_0x16ef22;return db[_0x2b6c('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2b6c('0xd4')],'as':_0x2b6c('0xd5'),'raw':!![],'include':[{'model':db[_0x2b6c('0xd6')],'as':_0x2b6c('0xd6'),'raw':!![]}]}]});}})[_0x2b6c('0x13')](function(_0x402de6){if(_0x402de6&&_0x402de6[_0x2b6c('0xd5')]&&_0x174332[_0x2b6c('0xd7')]&&_0x174332['forwardOfflineAddress']){var _0x1c8dc1=_0x402de6[_0x2b6c('0xd8')]();return respondWithRpcPromise('SendMail',_0x2b6c('0xd9'),{'account':_0x1c8dc1,'message':{'from':util[_0x2b6c('0xa5')](_0x2b6c('0xda'),_0x402de6[_0x2b6c('0x2a')],_0x402de6['email']||_0x402de6[_0x2b6c('0xd5')]['user']),'to':_0x174332[_0x2b6c('0xdb')],'subject':_0x174332['offlineMessageSubject'],'html':_0xed2c38[_0x2b6c('0x4c')],'attachments':_0x26db61}},client9003)[_0x2b6c('0x13')](function(){return _0xed2c38;})['catch'](function(_0x411bb0){logger[_0x2b6c('0x19')](_0x411bb0);});}})[_0x2b6c('0x13')](function(){if(_0x174332&&_0x174332[_0x2b6c('0xcf')]&&_0x174332[_0x2b6c('0xdc')]){var _0x2e5116=[];if(_0x17daac['length']){_0x2e5116=_0x17daac[_0x2b6c('0x2f')](function(_0x10c9bd){return{'name':_0x10c9bd[_0x2b6c('0xca')],'basename':_0x10c9bd['filename'],'type':_0x10c9bd['mimetype'],'ChatOfflineMessageId':_0x16ef22['id']};});}var _0x37f605;if(!_[_0x2b6c('0x71')](_0x174332[_0x2b6c('0xdd')])){var _0x50e425=_[_0x2b6c('0x2f')](_0x1f2281['body'],function(_0x13cc2d){return _0x13cc2d;});var _0x104368=_[_0x2b6c('0xde')](_0x50e425)[0x0];var _0x3bbcfc=_['mapValues'](_0x104368,function(_0x11c415){return _0x11c415;});_0x37f605=_0x3bbcfc[0x1][_0x174332['subjectOffline']];}var _0x3d4c34={'from':_0x5d8cf0[_0x2b6c('0xdf')],'firstName':_0x5d8cf0[_0x2b6c('0x9f')],'lastName':_0x5d8cf0[_0x2b6c('0xa0')],'mapKey':_0x2b6c('0xdf'),'message':{'from':_0x5d8cf0[_0x2b6c('0xdf')],'to':_0x174332[_0x2b6c('0xc2')]['email'],'cc':'','subject':_[_0x2b6c('0x71')](_0x37f605)?_0x174332['offlineMessageSubject']:_0x37f605,'messageId':'','sentAt':new Date(),'attach':_0x2e5116[_0x2b6c('0x4a')],'attachments':_0x2e5116,'originChannel':_0x2b6c('0xe0'),'ChatWebsiteId':_0x174332['id'],'ChatOfflineMessageId':_0xed2c38['id'],'originTo':_0x174332[_0x2b6c('0xc2')][_0x2b6c('0xdf')]},'body':_0xed2c38[_0x2b6c('0x4c')]};var _0x37ffca={'account':{'id':_0x174332['MailAccountId']},'body':_0x3d4c34,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2b6c('0xe1'),_0x2b6c('0xe2'),_0x37ffca,client9001)[_0x2b6c('0x13')](function(){return _0xed2c38;})[_0x2b6c('0x46')](function(_0x5da751){logger[_0x2b6c('0x19')](_0x5da751);});}return;})[_0x2b6c('0x13')](function(){if(_0xed2c38){return _0xed2c38;}})[_0x2b6c('0x13')](respondWithResult(_0x52dbc1,null))['catch'](function(_0xc1e7e7){logger['error'](_0x2b6c('0x46'),_0xc1e7e7);for(var _0x303861 of _0x17daac){var _0x34e9b6=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),_0x2b6c('0xe3'),_0x303861['filename']);fs_extra[_0x2b6c('0xe4')](_0x34e9b6)[_0x2b6c('0x46')](function(_0x25481a){logger[_0x2b6c('0x19')](_0x2b6c('0xe5'),_0x34e9b6,_0x25481a);});}});};exports[_0x2b6c('0xe6')]=function(_0x162150,_0x155993){return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':{'id':_0x162150[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x155993,null))['then'](function(_0x5d1327){if(_0x5d1327){return _0x5d1327[_0x2b6c('0xe6')](_0x162150[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x162150['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x155993,null))['catch'](handleError(_0x155993,null));};exports[_0x2b6c('0xe8')]=function(_0x102268,_0x58a0c6){var _0x12532b={'raw':![],'where':{}};var _0x75e521={};var _0x5dab61={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x102268[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x58a0c6,null))[_0x2b6c('0x13')](function(_0x80bfca){if(_0x80bfca){_0x75e521['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0xac')][_0x2b6c('0x60')]);_0x75e521[_0x2b6c('0x30')]=_['keys'](_0x102268['query']);_0x75e521[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x75e521['model'],_0x75e521[_0x2b6c('0x30')]);_0x12532b[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x75e521[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x102268[_0x2b6c('0x30')]['fields']));_0x12532b[_0x2b6c('0x34')]=_0x12532b['attributes'][_0x2b6c('0x4a')]?_0x12532b[_0x2b6c('0x34')]:_0x75e521[_0x2b6c('0x2e')];if(!_0x102268[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x12532b[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x12532b[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x102268[_0x2b6c('0x30')]['offset']);}_0x12532b[_0x2b6c('0x38')]=qs['sort'](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x12532b[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x102268[_0x2b6c('0x30')],_0x75e521['filters']));_0x12532b[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x80bfca['id'];if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x12532b['where']=_[_0x2b6c('0x3d')](_0x12532b['where'],{'$or':_[_0x2b6c('0x2f')](_0x12532b[_0x2b6c('0x34')],function(_0x3a274b){var _0x169b7d={};_0x169b7d[_0x3a274b]={'$like':'%'+_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x169b7d;})});}_0x12532b=_[_0x2b6c('0x3d')]({},_0x12532b,_0x102268[_0x2b6c('0x40')]);return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':_0x12532b[_0x2b6c('0x3a')]})['then'](function(_0x1617ed){_0x5dab61['count']=_0x1617ed;if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x12532b[_0x2b6c('0x43')]=[{'model':db['CmContact'],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xea')],'as':_0x2b6c('0xeb'),'attributes':['name',_0x2b6c('0xec'),'internal'],'required':![]},{'model':db[_0x2b6c('0xed')],'as':_0x2b6c('0xee'),'attributes':['id',_0x2b6c('0x2a'),'color'],'where':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?{'id':_0x102268[_0x2b6c('0x30')]['tag']}:undefined,'required':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?!![]:![]}];}return db[_0x2b6c('0xac')][_0x2b6c('0x44')](_0x12532b);})[_0x2b6c('0x13')](function(_0x1effbc){_0x5dab61[_0x2b6c('0x45')]=_0x1effbc;return _0x5dab61;});}})['then'](respondWithFilteredResult(_0x58a0c6,_0x12532b))[_0x2b6c('0x46')](handleError(_0x58a0c6,null));};function iftimePromise(_0x5b6701,_0x54490d){return respondWithRpcPromise(_0x2b6c('0xf0'),'getSnippet',{'command':_0x54490d[_0x2b6c('0xf1')]?util[_0x2b6c('0xa5')]('iftime\x20%s,%s',_0x5b6701[_0x2b6c('0xf2')],_0x54490d['timezone']):util[_0x2b6c('0xa5')](_0x2b6c('0xf3'),_0x5b6701['interval'])},client9002)[_0x2b6c('0x13')](function(_0x2f3c8a){var _0x214409=_0x2f3c8a&&_0x2f3c8a[_0x2b6c('0xf4')](_0x2b6c('0xf5'))>=0x0?!![]:![];logger[_0x2b6c('0x14')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701['interval'],_0x214409?'ONLINE':'OFFLINE',_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return _0x214409;})['catch'](function(_0x46a36c){logger[_0x2b6c('0x19')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701[_0x2b6c('0xf2')],util[_0x2b6c('0xf8')](_0x46a36c,{'showHidden':![],'depth':null}),_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return![];});}exports[_0x2b6c('0xf9')]=function(_0x8e6594,_0x22626f){var _0x3ad52a=0x0;var _0x12b247=0x0;var _0x335490=![];var _0x3af4c1;var _0x464eea;return db['ChatWebsite']['find']({'where':{'id':_0x8e6594[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfa'),'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfb'),'attributes':['id',_0x2b6c('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x22626f,null))[_0x2b6c('0x13')](function(_0x56ff04){if(_0x56ff04){_0x3af4c1=_0x56ff04;return _0x56ff04[_0x2b6c('0xfc')]({'raw':!![]});}})[_0x2b6c('0x13')](function(_0x57c35f){if(_0x3af4c1){if(_0x57c35f){_0x464eea=_0x57c35f;}}return require('../../config/license/util')[_0x2b6c('0x6f')]();})[_0x2b6c('0x13')](function(_0x56c624){if(_0x56c624){_0x12b247=_0x56c624[_0x2b6c('0xfd')];_0x335490=_0x56c624['custom'];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':{'closed':![]}});})[_0x2b6c('0x13')](function(_0x55a265){_0x3ad52a=_0x55a265;if(_0x12b247&&_0x55a265>_0x12b247){return db[_0x2b6c('0xfe')][_0x2b6c('0x5a')]({'where':{'id':0x1}})['then'](function(_0x155cf7){if(_0x155cf7){_0x155cf7[_0x2b6c('0xff')](_0x2b6c('0x100'));}});}})[_0x2b6c('0x13')](function(){if(_0x3af4c1['Interval']&&_0x3af4c1['Interval']['Intervals']){var _0x26bcf1=[];for(var _0x520347=0x0;_0x520347<_0x3af4c1['Interval'][_0x2b6c('0xfb')][_0x2b6c('0x4a')];_0x520347++){var _0x2e327c=_0x3af4c1[_0x2b6c('0xfa')][_0x2b6c('0xfb')][_0x520347]['get']({'plain':!![]});_0x26bcf1[_0x2b6c('0x101')](iftimePromise(_0x2e327c,_0x3af4c1));}return BPromise[_0x2b6c('0x102')](_0x26bcf1)['then'](function(_0x3f3f53){return _[_0x2b6c('0x103')](_0x3f3f53);});}else{return!![];}})[_0x2b6c('0x13')](function(_0x105330){var _0x2898fe=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x104')),'utf8');var _0x142312=new url[(_0x2b6c('0x105'))](_0x3af4c1['address'])[_0x2b6c('0x106')];var _0x28ad7c=_0x2b6c('0x107');var _0x2d959a=![];var _0x4b244c={'chatVersion':_0x28ad7c,'chatWebsiteAddressOrigin':_0x142312,'remote':_0x3af4c1[_0x2b6c('0x108')],'query':querystring[_0x2b6c('0xaa')](_['merge'](_0x3af4c1[_0x2b6c('0x28')]({'plain':!![]}),{'customerIp':_0x8e6594[_0x2b6c('0x9a')][_0x2b6c('0x9c')]||_0x8e6594['headers'][_0x2b6c('0x109')]||_0x8e6594[_0x2b6c('0x10a')][_0x2b6c('0x10b')]||_0x8e6594['ip'],'referer':_0x8e6594['headers']['referer'],'openedInteractions':_0x3ad52a,'maxInteractions':_0x12b247,'virtual':_0x335490[_0x2b6c('0xfd')],'online':_0x105330,'custom':_0x335490}))['replace'](/'/g,'\x5c\x27')};_0x22626f[_0x2b6c('0x2b')](ejs[_0x2b6c('0xc7')](Mustache[_0x2b6c('0xc7')](_0x2898fe,_0x4b244c),{'proactiveActions':_0x464eea,'alignment':_0x3af4c1[_0x2b6c('0x10c')],'verticalAlignment':_0x3af4c1[_0x2b6c('0x10d')],'div_color':_0x3af4c1[_0x2b6c('0x10e')],'labelText':_0x3af4c1[_0x2b6c('0x10f')],'text_color':_0x3af4c1[_0x2b6c('0x110')],'text_button_color':_0x3af4c1[_0x2b6c('0x111')],'button_color':_0x3af4c1['color_button'],'background_color':_0x3af4c1[_0x2b6c('0x112')],'hideWhenOffline':_0x3af4c1['hideWhenOffline'],'intervalId':_0x3af4c1[_0x2b6c('0x113')],'isDevelopment':_0x2d959a,'chatVersion':_0x28ad7c}));})[_0x2b6c('0x46')](handleError(_0x22626f,null));};exports[_0x2b6c('0x114')]=function(_0x71c1cb,_0x52c016){var _0x4291e1=_0x71c1cb['params']['id'];var _0x270c86=_0x71c1cb['body'];var _0x21c7ef=0xc8;var _0x52f0bf=null;return db[_0x2b6c('0xd0')]['transaction']({'isolationLevel':db[_0x2b6c('0xd0')][_0x2b6c('0x115')][_0x2b6c('0x116')][_0x2b6c('0x117')]},function(_0x17e931){return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x4291e1},'transaction':_0x17e931})[_0x2b6c('0x13')](function(_0x4ea0eb){if(_0x4ea0eb){return db[_0x2b6c('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x4291e1},'transaction':_0x17e931})['then'](function(){var _0x87ba1e=_[_0x2b6c('0x2f')](_0x270c86,function(_0x93c6b9){_0x93c6b9[_0x2b6c('0x57')]=_0x4291e1;return _0x93c6b9;});return db['ChatApplication'][_0x2b6c('0xd3')](_0x87ba1e,{'transaction':_0x17e931});});}else{_0x21c7ef=0x194;_0x52f0bf=[];}});})[_0x2b6c('0x13')](function(){if(_0x21c7ef!==0x194){return db[_0x2b6c('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4291e1},'order':_0x2b6c('0x96')})[_0x2b6c('0x13')](function(_0x195a75){_0x52f0bf=_0x195a75;});}})['catch'](function(_0x177a6b){_0x21c7ef=0x1f4;logger[_0x2b6c('0x19')](_0x177a6b[_0x2b6c('0x118')]);if(_0x177a6b['name']){delete _0x177a6b['name'];}_0x52f0bf=_0x177a6b;})['finally'](function(){if(_0x52f0bf===null){_0x52c016[_0x2b6c('0x1c')](_0x21c7ef);}else{if(_0x21c7ef===0x1f4){_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x2b')](_0x52f0bf);}else{_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x25')](_0x52f0bf);}}});};exports[_0x2b6c('0x119')]=function(_0x3b2e57,_0x22ec7b){var _0x52f108={};var _0x1888e8={};var _0x20d148;var _0x5a7fc5;return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x3b2e57[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x22ec7b,null))[_0x2b6c('0x13')](function(_0x1b8507){if(_0x1b8507){_0x20d148=_0x1b8507;_0x1888e8[_0x2b6c('0x2e')]=_['keys'](db[_0x2b6c('0x91')][_0x2b6c('0x60')]);_0x1888e8[_0x2b6c('0x30')]=_['keys'](_0x3b2e57[_0x2b6c('0x30')]);_0x1888e8[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],_0x1888e8[_0x2b6c('0x30')]);_0x52f108[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3b2e57['query'][_0x2b6c('0x35')]));_0x52f108[_0x2b6c('0x34')]=_0x52f108[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x52f108[_0x2b6c('0x34')]:_0x1888e8[_0x2b6c('0x2e')];_0x52f108[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3b2e57['query'][_0x2b6c('0x39')]);_0x52f108['where']=qs[_0x2b6c('0x32')](_['pick'](_0x3b2e57[_0x2b6c('0x30')],_0x1888e8[_0x2b6c('0x32')]));if(_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x52f108[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x52f108['where'],{'$or':_[_0x2b6c('0x2f')](_0x52f108[_0x2b6c('0x34')],function(_0x54a8df){var _0x11e100={};_0x11e100[_0x54a8df]={'$like':'%'+_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x11e100;})});}_0x52f108=_[_0x2b6c('0x3d')]({},_0x52f108,_0x3b2e57[_0x2b6c('0x40')]);return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})[_0x2b6c('0x13')](function(_0x55184d){if(_0x55184d){_0x5a7fc5=_0x55184d['length'];if(!_0x3b2e57[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x52f108['limit']=qs[_0x2b6c('0x21')](_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x52f108[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3b2e57[_0x2b6c('0x30')]['offset']);}return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})['then'](function(_0xb9bb18){if(_0xb9bb18){return _0xb9bb18?{'count':_0x5a7fc5,'rows':_0xb9bb18}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x22ec7b,null))[_0x2b6c('0x46')](handleError(_0x22ec7b,null));};exports[_0x2b6c('0x11a')]=function(_0x230ade,_0x1b1121){return db[_0x2b6c('0x11b')][_0x2b6c('0x56')]({'where':{'id':_0x230ade[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1121,null))[_0x2b6c('0x13')](function(_0x1b307a){if(_0x1b307a){return _0x1b307a['addProactiveActions'](_0x230ade[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x230ade['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x1b1121,null))['catch'](handleError(_0x1b1121,null));};exports['getProactiveActions']=function(_0x3283c8,_0x5f1159){var _0x14d3ca={};var _0x44f96e={};var _0x497c74;var _0x563443;return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x3283c8[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5f1159,null))[_0x2b6c('0x13')](function(_0x4b9d75){if(_0x4b9d75){_0x497c74=_0x4b9d75;_0x44f96e[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x11c')]['rawAttributes']);_0x44f96e[_0x2b6c('0x30')]=_['keys'](_0x3283c8[_0x2b6c('0x30')]);_0x44f96e[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x44f96e['model'],_0x44f96e['query']);_0x14d3ca[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x44f96e[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3283c8['query'][_0x2b6c('0x35')]));_0x14d3ca['attributes']=_0x14d3ca[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x14d3ca['attributes']:_0x44f96e['model'];_0x14d3ca[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x14d3ca[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x3283c8[_0x2b6c('0x30')],_0x44f96e[_0x2b6c('0x32')]));if(_0x3283c8['query'][_0x2b6c('0x3c')]){_0x14d3ca['where']=_['merge'](_0x14d3ca['where'],{'$or':_[_0x2b6c('0x2f')](_0x14d3ca[_0x2b6c('0x34')],function(_0x3c520e){var _0x12fa50={};_0x12fa50[_0x3c520e]={'$like':'%'+_0x3283c8['query']['filter']+'%'};return _0x12fa50;})});}_0x14d3ca=_[_0x2b6c('0x3d')]({},_0x14d3ca,_0x3283c8['options']);return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})['then'](function(_0xdf2863){if(_0xdf2863){_0x563443=_0xdf2863['length'];if(!_0x3283c8['query']['hasOwnProperty']('nolimit')){_0x14d3ca[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x14d3ca[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3283c8['query'][_0x2b6c('0x1f')]);}return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})[_0x2b6c('0x13')](function(_0x5464d2){if(_0x5464d2){return _0x5464d2?{'count':_0x563443,'rows':_0x5464d2}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x5f1159,null))['catch'](handleError(_0x5f1159,null));};exports['getFields']=function(_0x5f31c4,_0x115a54){var _0x2a3a9a=_0x5f31c4[_0x2b6c('0x30')][_0x2b6c('0x11d')]==='false'?_0x2b6c('0x11e'):_0x2b6c('0x11f');return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'attributes':['id',_0x2a3a9a],'where':{'id':_0x5f31c4[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x115a54,null))['then'](function(_0x738986){if(_0x738986){var _0x578ed2=_0x738986[_0x2a3a9a];var _0x17d9cd=_0x578ed2&&_0x578ed2['items']?_0x578ed2['items']:[];_0x115a54['send']({'fromKey':_[_0x2b6c('0x71')](_0x578ed2['fromKey'])?undefined:_0x578ed2[_0x2b6c('0x120')],'count':_0x17d9cd[_0x2b6c('0x4a')],'rows':_0x17d9cd});}})[_0x2b6c('0x46')](handleError(_0x115a54,null));};exports[_0x2b6c('0x121')]=function(_0x4045be,_0x9306c5){var _0x8f32e9={'raw':![],'where':{}};var _0x473dff={};var _0x1b1951={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x4045be['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x9306c5,null))[_0x2b6c('0x13')](function(_0x28b585){if(_0x28b585){_0x473dff[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['ChatOfflineMessage'][_0x2b6c('0x60')]);_0x473dff[_0x2b6c('0x30')]=_['keys'](_0x4045be['query']);_0x473dff[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x473dff[_0x2b6c('0x2e')],_0x473dff[_0x2b6c('0x30')]);_0x8f32e9[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x473dff['model'],qs[_0x2b6c('0x35')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x8f32e9[_0x2b6c('0x34')]=_0x8f32e9[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x8f32e9[_0x2b6c('0x34')]:_0x473dff[_0x2b6c('0x2e')];if(!_0x4045be[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x8f32e9['limit']=qs['limit'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x8f32e9[_0x2b6c('0x1f')]=qs['offset'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x8f32e9[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x8f32e9[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x4045be[_0x2b6c('0x30')],_0x473dff[_0x2b6c('0x32')]));_0x8f32e9[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x28b585['id'];if(_0x4045be[_0x2b6c('0x30')]['filter']){_0x8f32e9[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x8f32e9[_0x2b6c('0x3a')],{'$or':_['map'](_0x8f32e9[_0x2b6c('0x34')],function(_0x114083){var _0x100d7d={};_0x100d7d[_0x114083]={'$like':'%'+_0x4045be[_0x2b6c('0x30')]['filter']+'%'};return _0x100d7d;})});}_0x8f32e9=_[_0x2b6c('0x3d')]({},_0x8f32e9,_0x4045be[_0x2b6c('0x40')]);return db['ChatOfflineMessage'][_0x2b6c('0x22')]({'where':_0x8f32e9[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x119724){_0x1b1951[_0x2b6c('0x22')]=_0x119724;if(_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x8f32e9['include']=[{'all':!![]}];}else{_0x8f32e9[_0x2b6c('0x43')]=[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xd2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x2b6c('0x44')](_0x8f32e9);})[_0x2b6c('0x13')](function(_0x2dc3fe){_0x1b1951[_0x2b6c('0x45')]=_0x2dc3fe;return _0x1b1951;});}})['then'](respondWithFilteredResult(_0x9306c5,_0x8f32e9))[_0x2b6c('0x46')](handleError(_0x9306c5,null));};exports[_0x2b6c('0x122')]=function(_0x222071,_0x2957e1){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x222071[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2957e1,null))['then'](function(_0xc7de3c){if(_0xc7de3c){return _0xc7de3c[_0x2b6c('0x122')](_0x222071['body'][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x222071[_0x2b6c('0x4c')],['ids','id'])||{})[_0x2b6c('0xb0')](function(_0x217908){for(var _0x3a7e37=0x0;_0x3a7e37<_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x3a7e37+=0x1){socket['emit'](_0x2b6c('0x123'),{'UserId':Number(_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x3a7e37]),'ChatWebsiteId':Number(_0x222071[_0x2b6c('0x48')]['id'])});}return _0x217908;});}})[_0x2b6c('0x13')](respondWithResult(_0x2957e1,null))[_0x2b6c('0x46')](handleError(_0x2957e1,null));};exports[_0x2b6c('0x124')]=function(_0x54f785,_0x2a6e46){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x54f785['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x2a6e46,null))[_0x2b6c('0x13')](function(_0xef1e0f){if(_0xef1e0f){return _0xef1e0f[_0x2b6c('0x124')](_0x54f785[_0x2b6c('0x30')]['ids'])[_0x2b6c('0x13')](function(){if(_['isArray'](_0x54f785['query']['ids'])){for(var _0x30cae6=0x0;_0x30cae6<_0x54f785['query'][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x30cae6+=0x1){socket[_0x2b6c('0x125')](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')][_0x2b6c('0x5c')][_0x30cae6]),'ChatWebsiteId':Number(_0x54f785['params']['id'])});}}else{socket['emit'](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')]['ids']),'ChatWebsiteId':Number(_0x54f785[_0x2b6c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a6e46,null))[_0x2b6c('0x46')](handleError(_0x2a6e46,null));};exports['getAgents']=function(_0x2e65ce,_0x19aff4){var _0x34aa12={};var _0x1f27f3={};var _0x1a8a0e;var _0x1a976c;return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x2e65ce[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x19aff4,null))[_0x2b6c('0x13')](function(_0x32f5e8){if(_0x32f5e8){_0x1a8a0e=_0x32f5e8;_0x1f27f3[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0xea')]['rawAttributes']);_0x1f27f3[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2e65ce['query']);_0x1f27f3[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],_0x1f27f3[_0x2b6c('0x30')]);_0x34aa12['attributes']=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x34aa12[_0x2b6c('0x34')]=_0x34aa12[_0x2b6c('0x34')]['length']?_0x34aa12[_0x2b6c('0x34')]:_0x1f27f3[_0x2b6c('0x2e')];_0x34aa12[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x2e65ce[_0x2b6c('0x30')]['sort']);_0x34aa12[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x2e65ce[_0x2b6c('0x30')],_0x1f27f3[_0x2b6c('0x32')]));if(_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x34aa12['where']=_[_0x2b6c('0x3d')](_0x34aa12[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x34aa12[_0x2b6c('0x34')],function(_0x7de937){var _0x2313be={};_0x2313be[_0x7de937]={'$like':'%'+_0x2e65ce['query'][_0x2b6c('0x3c')]+'%'};return _0x2313be;})});}_0x34aa12=_['merge']({},_0x34aa12,_0x2e65ce[_0x2b6c('0x40')]);return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0xd50fc1){if(_0xd50fc1){_0x1a976c=_0xd50fc1['length'];if(!_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x34aa12[_0x2b6c('0x21')]=qs['limit'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x34aa12[_0x2b6c('0x1f')]=qs['offset'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0x451ecc){if(_0x451ecc){return _0x451ecc?{'count':_0x1a976c,'rows':_0x451ecc}:null;}})['then'](respondWithResult(_0x19aff4,null))[_0x2b6c('0x46')](handleError(_0x19aff4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 91e45e8..b94e5d6 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 _0x5a93=['exports','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5a93,0xf6));var _0x35a9=function(_0x1e1017,_0x55783a){_0x1e1017=_0x1e1017-0x0;var _0x362a58=_0x5a93[_0x1e1017];return _0x362a58;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x35a9('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x35a9('0x1')](0x0);var events={'afterCreate':_0x35a9('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7dc79f){return function(_0xf10dcf,_0x3a23d6,_0x4f45aa){ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f+':'+_0xf10dcf['id'],_0xf10dcf);ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f,_0xf10dcf);_0x4f45aa(null);};}for(var e in events){if(events[_0x35a9('0x4')](e)){var event=events[e];ChatWebsite[_0x35a9('0x5')](e,emitEvent(event));}}module[_0x35a9('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1ef3=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x166435,_0x16391f){var _0xe4713a=function(_0xea464f){while(--_0xea464f){_0x166435['push'](_0x166435['shift']());}};_0xe4713a(++_0x16391f);}(_0x1ef3,0x69));var _0x31ef=function(_0x189516,_0x14a8f6){_0x189516=_0x189516-0x0;var _0x1cdd69=_0x1ef3[_0x189516];return _0x1cdd69;};'use strict';var EventEmitter=require(_0x31ef('0x0'));var ChatWebsite=require(_0x31ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31ef('0x2')](0x0);var events={'afterCreate':_0x31ef('0x3'),'afterUpdate':_0x31ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x311a32){return function(_0x58388a,_0x49ce87,_0x1a8d7f){ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32+':'+_0x58388a['id'],_0x58388a);ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32,_0x58388a);_0x1a8d7f(null);};}for(var e in events){if(events[_0x31ef('0x6')](e)){var event=events[e];ChatWebsite[_0x31ef('0x7')](e,emitEvent(event));}}module[_0x31ef('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 642a559..39dbece 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 _0xe9b1=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27b2fd,_0x8c95b8){var _0x135f31=function(_0x13494d){while(--_0x13494d){_0x27b2fd['push'](_0x27b2fd['shift']());}};_0x135f31(++_0x8c95b8);}(_0xe9b1,0xaf));var _0x1e9b=function(_0x5bdb83,_0x3605de){_0x5bdb83=_0x5bdb83-0x0;var _0x1986bb=_0xe9b1[_0x5bdb83];return _0x1986bb;};'use strict';var _=require(_0x1e9b('0x0'));var util=require(_0x1e9b('0x1'));var logger=require(_0x1e9b('0x2'))(_0x1e9b('0x3'));var moment=require(_0x1e9b('0x4'));var BPromise=require(_0x1e9b('0x5'));var rp=require(_0x1e9b('0x6'));var fs=require('fs');var path=require(_0x1e9b('0x7'));var rimraf=require(_0x1e9b('0x8'));var config=require(_0x1e9b('0x9'));var attributes=require(_0x1e9b('0xa'));module[_0x1e9b('0xb')]=function(_0x41c896,_0x7de997){return _0x41c896['define'](_0x1e9b('0xc'),attributes,{'tableName':_0x1e9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0137=['rimraf','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x183f7e,_0xa61ba7){var _0x590260=function(_0x109b31){while(--_0x109b31){_0x183f7e['push'](_0x183f7e['shift']());}};_0x590260(++_0xa61ba7);}(_0x0137,0x1a8));var _0x7013=function(_0x173ec0,_0x4374db){_0x173ec0=_0x173ec0-0x0;var _0xcbf53d=_0x0137[_0x173ec0];return _0xcbf53d;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require(_0x7013('0x5'));var rp=require(_0x7013('0x6'));var fs=require('fs');var path=require(_0x7013('0x7'));var rimraf=require(_0x7013('0x8'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x7013('0x9')]=function(_0x2d7771,_0x38a446){return _0x2d7771[_0x7013('0xa')]('ChatWebsite',attributes,{'tableName':_0x7013('0xb'),'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 c01ec17..6f1dd87 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 _0xad67=['redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ca7f2,_0x565a83){var _0x51ca1b=function(_0xde6828){while(--_0xde6828){_0x5ca7f2['push'](_0x5ca7f2['shift']());}};_0x51ca1b(++_0x565a83);}(_0xad67,0x81));var _0x7ad6=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xad67[_0x2f1753];return _0x56a164;};'use strict';var _=require(_0x7ad6('0x0'));var util=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ad6('0x3'))['db'];var utils=require(_0x7ad6('0x4'));var logger=require(_0x7ad6('0x5'))(_0x7ad6('0x6'));var config=require(_0x7ad6('0x7'));var jayson=require(_0x7ad6('0x8'));var client=jayson[_0x7ad6('0x9')][_0x7ad6('0xa')]({'port':0x232a});config[_0x7ad6('0xb')]=_[_0x7ad6('0xc')](config[_0x7ad6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ad6('0xd'))(new Redis(config[_0x7ad6('0xb')]));require(_0x7ad6('0xe'))[_0x7ad6('0xf')](socket);function respondWithRpcPromise(_0x4b6b51,_0x1544e0,_0x5d0b23){return new BPromise(function(_0x4fe155,_0x39cf35){return client[_0x7ad6('0x10')](_0x4b6b51,_0x5d0b23)[_0x7ad6('0x11')](function(_0x3bf1e7){logger[_0x7ad6('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1544e0,_0x7ad6('0x13'));logger['debug'](_0x7ad6('0x14'),_0x1544e0,'request\x20sent',JSON[_0x7ad6('0x15')](_0x3bf1e7));if(_0x3bf1e7['error']){if(_0x3bf1e7[_0x7ad6('0x16')][_0x7ad6('0x17')]===0x1f4){logger['error'](_0x7ad6('0x18'),_0x1544e0,_0x3bf1e7[_0x7ad6('0x16')]['message']);return _0x39cf35(_0x3bf1e7[_0x7ad6('0x16')][_0x7ad6('0x19')]);}logger['error'](_0x7ad6('0x18'),_0x1544e0,_0x3bf1e7[_0x7ad6('0x16')]['message']);return _0x4fe155(_0x3bf1e7[_0x7ad6('0x16')]['message']);}else{logger[_0x7ad6('0x12')](_0x7ad6('0x18'),_0x1544e0,_0x7ad6('0x13'));_0x4fe155(_0x3bf1e7[_0x7ad6('0x1a')][_0x7ad6('0x19')]);}})[_0x7ad6('0x1b')](function(_0x165160){logger[_0x7ad6('0x16')](_0x7ad6('0x18'),_0x1544e0,_0x165160);_0x39cf35(_0x165160);});});} \ No newline at end of file +var _0xe803=['register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0xe803,0x90));var _0x3e80=function(_0x472a2d,_0x7b6a64){_0x472a2d=_0x472a2d-0x0;var _0x58c1eb=_0xe803[_0x472a2d];return _0x58c1eb;};'use strict';var _=require('lodash');var util=require(_0x3e80('0x0'));var moment=require(_0x3e80('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e80('0x2'));var fs=require('fs');var Redis=require(_0x3e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e80('0x4'));var logger=require(_0x3e80('0x5'))(_0x3e80('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e80('0x7')][_0x3e80('0x8')]({'port':0x232a});config[_0x3e80('0x9')]=_[_0x3e80('0xa')](config[_0x3e80('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e80('0xb'))(new Redis(config[_0x3e80('0x9')]));require('./chatWebsite.socket')[_0x3e80('0xc')](socket);function respondWithRpcPromise(_0x1712b9,_0x417fc4,_0x3fbc8d){return new BPromise(function(_0x2d31db,_0x1230de){return client[_0x3e80('0xd')](_0x1712b9,_0x3fbc8d)[_0x3e80('0xe')](function(_0x4520ce){logger[_0x3e80('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x417fc4,_0x3e80('0x10'));logger[_0x3e80('0x11')](_0x3e80('0x12'),_0x417fc4,_0x3e80('0x10'),JSON[_0x3e80('0x13')](_0x4520ce));if(_0x4520ce[_0x3e80('0x14')]){if(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x15')]===0x1f4){logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x1230de(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x2d31db(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}else{logger['info'](_0x3e80('0x16'),_0x417fc4,_0x3e80('0x10'));_0x2d31db(_0x4520ce[_0x3e80('0x18')][_0x3e80('0x17')]);}})[_0x3e80('0x19')](function(_0x52d6f){logger['error'](_0x3e80('0x16'),_0x417fc4,_0x52d6f);_0x1230de(_0x52d6f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 643f52b..0c58fa3 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 _0x44e8=['register','length','chatWebsite:','save','removeListener'];(function(_0x457b18,_0x1c99ab){var _0x38ffac=function(_0x19172a){while(--_0x19172a){_0x457b18['push'](_0x457b18['shift']());}};_0x38ffac(++_0x1c99ab);}(_0x44e8,0x107));var _0x844e=function(_0x16ed97,_0x363ac8){_0x16ed97=_0x16ed97-0x0;var _0x215fad=_0x44e8[_0x16ed97];return _0x215fad;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x844e('0x0'),'remove','update'];function createListener(_0x24c1af,_0x154d28){return function(_0x5d046b){_0x154d28['emit'](_0x24c1af,_0x5d046b);};}function removeListener(_0x1674d0,_0x891a47){return function(){ChatWebsiteEvents[_0x844e('0x1')](_0x1674d0,_0x891a47);};}exports[_0x844e('0x2')]=function(_0x433218){for(var _0x4a2dab=0x0,_0x5ab3b1=events[_0x844e('0x3')];_0x4a2dab<_0x5ab3b1;_0x4a2dab++){var _0x20ee2c=events[_0x4a2dab];var _0x396608=createListener(_0x844e('0x4')+_0x20ee2c,_0x433218);ChatWebsiteEvents['on'](_0x20ee2c,_0x396608);}}; \ No newline at end of file +var _0x602f=['emit','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x265596,_0x23947a){var _0x3f8d6b=function(_0x46349d){while(--_0x46349d){_0x265596['push'](_0x265596['shift']());}};_0x3f8d6b(++_0x23947a);}(_0x602f,0x1f4));var _0xf602=function(_0x429b19,_0x23615c){_0x429b19=_0x429b19-0x0;var _0x5849fa=_0x602f[_0x429b19];return _0x5849fa;};'use strict';var ChatWebsiteEvents=require(_0xf602('0x0'));var events=[_0xf602('0x1'),_0xf602('0x2'),_0xf602('0x3')];function createListener(_0x48a35d,_0x581259){return function(_0x366680){_0x581259[_0xf602('0x4')](_0x48a35d,_0x366680);};}function removeListener(_0x30f82f,_0x4a51d9){return function(){ChatWebsiteEvents['removeListener'](_0x30f82f,_0x4a51d9);};}exports['register']=function(_0x5552cc){for(var _0x52691d=0x0,_0x19f993=events[_0xf602('0x5')];_0x52691d<_0x19f993;_0x52691d++){var _0x466324=events[_0x52691d];var _0x420e8c=createListener(_0xf602('0x6')+_0x466324,_0x5552cc);ChatWebsiteEvents['on'](_0x466324,_0x420e8c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 1c36c0f..b3f4a40 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 _0x5e89=['getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','diskStorage','join','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','root','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0x568c2a,_0x436eb8){var _0x373a36=function(_0x1d59e5){while(--_0x1d59e5){_0x568c2a['push'](_0x568c2a['shift']());}};_0x373a36(++_0x436eb8);}(_0x5e89,0x165));var _0x95e8=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5e89[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x95e8('0x0'));var util=require(_0x95e8('0x1'));var path=require(_0x95e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x95e8('0x3'));var router=express['Router']();var fs_extra=require(_0x95e8('0x4'));var auth=require(_0x95e8('0x5'));var interaction=require(_0x95e8('0x6'));var config=require(_0x95e8('0x7'));var controller=require(_0x95e8('0x8'));router[_0x95e8('0x9')]('/',auth[_0x95e8('0xa')](),controller[_0x95e8('0xb')]);router[_0x95e8('0x9')](_0x95e8('0xc'),auth[_0x95e8('0xa')](),controller[_0x95e8('0xd')]);router[_0x95e8('0x9')]('/:id',auth[_0x95e8('0xa')](),controller[_0x95e8('0xe')]);router[_0x95e8('0x9')]('/:id/dispositions',auth[_0x95e8('0xa')](),controller[_0x95e8('0xf')]);router[_0x95e8('0x9')](_0x95e8('0x10'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x11')]);router['get'](_0x95e8('0x12'),controller[_0x95e8('0x13')]);router[_0x95e8('0x9')](_0x95e8('0x14'),controller[_0x95e8('0x15')]);router[_0x95e8('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0x95e8('0x9')](_0x95e8('0x16'),auth['isAuthenticated'](),controller[_0x95e8('0x17')]);router[_0x95e8('0x9')](_0x95e8('0x18'),controller[_0x95e8('0x19')]);router[_0x95e8('0x9')](_0x95e8('0x1a'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x1b')]);router[_0x95e8('0x9')]('/:id/proactive_actions',auth[_0x95e8('0xa')](),controller[_0x95e8('0x1c')]);router[_0x95e8('0x9')]('/:id/fields',controller[_0x95e8('0x1d')]);router[_0x95e8('0x9')]('/:id/offline_messages',auth[_0x95e8('0xa')](),controller[_0x95e8('0x1e')]);router[_0x95e8('0x9')](_0x95e8('0x1f'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95e8('0x21')]);router['post'](_0x95e8('0x22'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x23')]);router[_0x95e8('0x24')](_0x95e8('0x10'),auth[_0x95e8('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x1d0ef8,_0x548e62,_0x551dad){_0x551dad(null,path[_0x95e8('0x26')](config['root'],_0x95e8('0x27')));},'filename':function(_0x502a10,_0x5cc0d1,_0x2b2bac){_0x2b2bac(null,util['format'](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x5cc0d1[_0x95e8('0x2a')]));}})});router['post']('/:id/logo',upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x2d')]);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x32ea34,_0x5d37ec,_0x46ee93){_0x46ee93(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x2b0b33,_0x346631,_0x143a2a){_0x143a2a(null,util[_0x95e8('0x30')]('%s-%s',Date[_0x95e8('0x29')](),_0x346631[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x14'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x31')]);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x5a6020,_0x2ed3b3,_0x28e19e){_0x28e19e(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x2c7b13,_0x27fe33,_0x2657ff){_0x2657ff(null,util[_0x95e8('0x30')](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x27fe33[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x32'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52797f,_0x42f59e,_0x56fd84){_0x56fd84(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x3966b9,_0x283dc6,_0x28a234){_0x28a234(null,util[_0x95e8('0x30')](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x283dc6[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x33'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x34')]);router[_0x95e8('0x24')](_0x95e8('0x35'),controller[_0x95e8('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x382ebb,_0x3d8da4,_0x47f36f){const _0x531946=path[_0x95e8('0x26')](config[_0x95e8('0x2e')],_0x95e8('0x37'),_0x95e8('0x38'),_0x95e8('0x39'));fs_extra[_0x95e8('0x3a')](_0x531946,function(){_0x47f36f(null,_0x531946);});},'filename':function(_0x1d147e,_0x574fb8,_0x49c6cc){const _0x23ec39=_0x574fb8[_0x95e8('0x2a')][_0x95e8('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x597bd2=path[_0x95e8('0x3c')](_0x23ec39);const _0x520e03=Date[_0x95e8('0x29')]()+'-'+_0x23ec39[_0x95e8('0x3b')](_0x597bd2,'')+_0x597bd2;_0x49c6cc(null,_0x520e03);}})});router[_0x95e8('0x24')](_0x95e8('0x3d'),offlineUploadMulter[_0x95e8('0x3e')](),controller[_0x95e8('0x3f')]);router['post'](_0x95e8('0x16'),auth[_0x95e8('0xa')](),controller['addInteraction']);router['post'](_0x95e8('0x1a'),auth['isAuthenticated'](),controller[_0x95e8('0x40')]);router[_0x95e8('0x24')](_0x95e8('0x41'),auth['isAuthenticated'](),controller[_0x95e8('0x42')]);router[_0x95e8('0x24')](_0x95e8('0x1f'),auth['isAuthenticated'](),controller[_0x95e8('0x43')]);router[_0x95e8('0x44')](_0x95e8('0x45'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x46')]);router[_0x95e8('0x47')](_0x95e8('0x45'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x48')]);router['delete'](_0x95e8('0x22'),auth['isAuthenticated'](),controller[_0x95e8('0x49')]);router[_0x95e8('0x47')](_0x95e8('0x10'),auth['isAuthenticated'](),controller[_0x95e8('0x4a')]);router[_0x95e8('0x47')]('/:id/users',auth[_0x95e8('0xa')](),controller[_0x95e8('0x4b')]);module[_0x95e8('0x4c')]=router; \ No newline at end of file +var _0xed77=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','delete','removeAnswers','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet'];(function(_0x4d4ea2,_0x4858f4){var _0x1ba039=function(_0x14c589){while(--_0x14c589){_0x4d4ea2['push'](_0x4d4ea2['shift']());}};_0x1ba039(++_0x4858f4);}(_0xed77,0x147));var _0x7ed7=function(_0x241b38,_0x59a7b1){_0x241b38=_0x241b38-0x0;var _0x9619ea=_0xed77[_0x241b38];return _0x9619ea;};'use strict';var multer=require(_0x7ed7('0x0'));var util=require('util');var path=require(_0x7ed7('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ed7('0x2'));var router=express[_0x7ed7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ed7('0x4'));var config=require(_0x7ed7('0x5'));var controller=require(_0x7ed7('0x6'));router['get']('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x8')]);router[_0x7ed7('0x9')](_0x7ed7('0xa'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xb')]);router[_0x7ed7('0x9')](_0x7ed7('0xc'),auth['isAuthenticated'](),controller[_0x7ed7('0xd')]);router[_0x7ed7('0x9')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xf')]);router['get'](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller['getAnswers']);router[_0x7ed7('0x9')]('/:id/logo',controller['getLogo']);router[_0x7ed7('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x7ed7('0x11'),controller['getCustomerAvatar']);router['get'](_0x7ed7('0x12'),controller[_0x7ed7('0x13')]);router[_0x7ed7('0x9')]('/:id/interactions',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x14')]);router['get'](_0x7ed7('0x15'),controller[_0x7ed7('0x16')]);router[_0x7ed7('0x9')](_0x7ed7('0x17'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x18')]);router[_0x7ed7('0x9')](_0x7ed7('0x19'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1a')]);router[_0x7ed7('0x9')](_0x7ed7('0x1b'),controller[_0x7ed7('0x1c')]);router[_0x7ed7('0x9')](_0x7ed7('0x1d'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1e')]);router[_0x7ed7('0x9')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x20')]);router[_0x7ed7('0x21')]('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x22')]);router[_0x7ed7('0x21')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x23')]);router[_0x7ed7('0x21')](_0x7ed7('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0xfc0d36,_0x1ef40e,_0xc94603){_0xc94603(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x27')));},'filename':function(_0x3d4e38,_0x189696,_0x304f62){_0x304f62(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date['now'](),_0x189696[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x2b'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ebc83,_0x374476,_0x5e4922){_0x5e4922(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x44276e,_0x25bdf0,_0x56e670){_0x56e670(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x25bdf0[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')](_0x7ed7('0x31'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x32')]);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0x42edb0,_0x26d0a4,_0x2a8cf2){_0x2a8cf2(null,path['join'](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x1a2dde,_0x13d762,_0x4ea07d){_0x4ea07d(null,util['format'](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x13d762[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x11'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10c7ac,_0x2d4e3b,_0x1b79a5){_0x1b79a5(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x4210cc,_0xed6371,_0x1da905){_0x1da905(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0xed6371[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')]('/:id/system_avatar',upload[_0x7ed7('0x2c')]('file'),controller[_0x7ed7('0x33')]);router[_0x7ed7('0x21')]('/:id/notify',controller[_0x7ed7('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x11b7ac,_0x3cc977,_0x18840f){const _0x52a76f=path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x35'),_0x7ed7('0x36'),_0x7ed7('0x37'));fs_extra[_0x7ed7('0x38')](_0x52a76f,function(){_0x18840f(null,_0x52a76f);});},'filename':function(_0x181ec7,_0x5dd77b,_0x33f3ad){const _0x4e9726=_0x5dd77b[_0x7ed7('0x2a')][_0x7ed7('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x44a31d=path[_0x7ed7('0x3a')](_0x4e9726);const _0xf7d880=Date[_0x7ed7('0x30')]()+'-'+_0x4e9726[_0x7ed7('0x39')](_0x44a31d,'')+_0x44a31d;_0x33f3ad(null,_0xf7d880);}})});router[_0x7ed7('0x21')](_0x7ed7('0x3b'),offlineUploadMulter[_0x7ed7('0x3c')](),controller[_0x7ed7('0x3d')]);router[_0x7ed7('0x21')](_0x7ed7('0x3e'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x3f')]);router[_0x7ed7('0x21')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x7ed7('0x21')](_0x7ed7('0x19'),auth['isAuthenticated'](),controller[_0x7ed7('0x40')]);router[_0x7ed7('0x21')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x41')]);router['put'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['update']);router['delete'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['destroy']);router[_0x7ed7('0x42')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller['removeDispositions']);router[_0x7ed7('0x42')](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x43')]);router[_0x7ed7('0x42')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x44')]);module[_0x7ed7('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 749c365..d4d14ca 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ed=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x5a633a,_0x4e8830){var _0x4a9df=function(_0x1a6732){while(--_0x1a6732){_0x5a633a['push'](_0x5a633a['shift']());}};_0x4a9df(++_0x4e8830);}(_0x62ed,0x115));var _0xd62e=function(_0x40258b,_0x1db52e){_0x40258b=_0x40258b-0x0;var _0x498cf2=_0x62ed[_0x40258b];return _0x498cf2;};var beaverLogger=require(_0xd62e('0x0'));var express=require(_0xd62e('0x1'));var auth=require(_0xd62e('0x2'));var config=require(_0xd62e('0x3'));var router=express[_0xd62e('0x4')]();var isProduction=config[_0xd62e('0x5')]==='production'||![];function clientSideLogs(_0x3db6d0,_0x3ac8ae,_0x5377a7){var _0x50ad49=_0x3db6d0[_0xd62e('0x6')][_0xd62e('0x7')]('client-side-logger');if(!_0x50ad49){throw new Error(_0xd62e('0x8'));}return beaverLogger[_0xd62e('0x9')]({'uri':_0xd62e('0xa'),'logger':_0x50ad49,'enableCors':!isProduction})(_0x3db6d0,_0x3ac8ae,_0x5377a7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xd62e('0xb')]=router; \ No newline at end of file +var _0xe5ae=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0x4d930e,_0x434ebe){var _0xbda995=function(_0x5b4b5e){while(--_0x5b4b5e){_0x4d930e['push'](_0x4d930e['shift']());}};_0xbda995(++_0x434ebe);}(_0xe5ae,0x186));var _0xee5a=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xe5ae[_0x149083];return _0x4dc74e;};var beaverLogger=require(_0xee5a('0x0'));var express=require('express');var auth=require(_0xee5a('0x1'));var config=require(_0xee5a('0x2'));var router=express[_0xee5a('0x3')]();var isProduction=config[_0xee5a('0x4')]===_0xee5a('0x5')||![];function clientSideLogs(_0x4bb2b1,_0x234fbd,_0x35e8d7){var _0x532089=_0x4bb2b1['app']['get'](_0xee5a('0x6'));if(!_0x532089){throw new Error(_0xee5a('0x7'));}return beaverLogger[_0xee5a('0x8')]({'uri':_0xee5a('0x9'),'logger':_0x532089,'enableCors':!isProduction})(_0x4bb2b1,_0x234fbd,_0x35e8d7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xee5a('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ccd727c..4d45e5a 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x745d=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x745d,0xe2));var _0xd745=function(_0x265c51,_0x199578){_0x265c51=_0x265c51-0x0;var _0x3faf9d=_0x745d[_0x265c51];return _0x3faf9d;};'use strict';var Sequelize=require(_0xd745('0x0'));module[_0xd745('0x1')]={'name':{'type':Sequelize[_0xd745('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd745('0x3')]('AmazonAWS',_0xd745('0x4'),_0xd745('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd745('0x3')]('Outlook365',_0xd745('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd745('0x7')},'data2':{'type':Sequelize[_0xd745('0x2')],'comment':_0xd745('0x8')},'data3':{'type':Sequelize[_0xd745('0x2')],'comment':_0xd745('0x9')},'data4':{'type':Sequelize[_0xd745('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xd745('0xa')],'comment':_0xd745('0xb')},'data6':{'type':Sequelize[_0xd745('0xa')],'comment':_0xd745('0xc')},'data7':{'type':Sequelize[_0xd745('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x1152=['STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x382541,_0x40226e){var _0x3d0287=function(_0x41caf7){while(--_0x41caf7){_0x382541['push'](_0x382541['shift']());}};_0x3d0287(++_0x40226e);}(_0x1152,0x167));var _0x2115=function(_0x5608df,_0xff2326){_0x5608df=_0x5608df-0x0;var _0x4c2e63=_0x1152[_0x5608df];return _0x4c2e63;};'use strict';var Sequelize=require('sequelize');module[_0x2115('0x0')]={'name':{'type':Sequelize[_0x2115('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2115('0x2'),_0x2115('0x3'),_0x2115('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2115('0x5')]('Outlook365',_0x2115('0x6'))},'data1':{'type':Sequelize[_0x2115('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x7')},'data3':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x8')},'data4':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x2115('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x2115('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 11e61a5..33f8792 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91bf=['VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','limit','undefined','offset','count','status','set','Content-Range','then','error','name','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','pick','filters','filter','merge','where'];(function(_0xb0bfd6,_0x2ca684){var _0x2924fc=function(_0xf0e69a){while(--_0xf0e69a){_0xb0bfd6['push'](_0xb0bfd6['shift']());}};_0x2924fc(++_0x2ca684);}(_0x91bf,0x147));var _0xf91b=function(_0x522b58,_0x527a40){_0x522b58=_0x522b58-0x0;var _0x1ee0f0=_0x91bf[_0x522b58];return _0x1ee0f0;};'use strict';var _=require(_0xf91b('0x0'));var Redis=require(_0xf91b('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf91b('0x2'));var config=require(_0xf91b('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xf91b('0x4'));config['redis']=_[_0xf91b('0x5')](config[_0xf91b('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xf91b('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xf91b('0x6')]);function respondWithStatusCode(_0x24115b,_0x4bf91f){_0x4bf91f=_0x4bf91f||0xcc;return function(_0x4e75a8){if(_0x4e75a8){return _0x24115b[_0xf91b('0x8')](_0x4bf91f);}return _0x24115b['status'](_0x4bf91f)['end']();};}function respondWithResult(_0x2859e3,_0x4aa71e){_0x4aa71e=_0x4aa71e||0xc8;return function(_0x2053b4){if(_0x2053b4){return _0x2859e3['status'](_0x4aa71e)['json'](_0x2053b4);}};}function respondWithFilteredResult(_0x2e66ba,_0x449a17){return function(_0x42dca2){if(_0x42dca2){var _0x55bee8=typeof _0x449a17['offset']==='undefined'&&typeof _0x449a17[_0xf91b('0x9')]===_0xf91b('0xa');var _0x191cd9=_0x42dca2['count'];var _0x59945b=_0x55bee8?0x0:_0x449a17[_0xf91b('0xb')];var _0x299b71=_0x55bee8?_0x42dca2[_0xf91b('0xc')]:_0x449a17['offset']+_0x449a17['limit'];var _0x3bb0a7;if(_0x299b71>=_0x191cd9){_0x299b71=_0x191cd9;_0x3bb0a7=0xc8;}else{_0x3bb0a7=0xce;}_0x2e66ba[_0xf91b('0xd')](_0x3bb0a7);return _0x2e66ba[_0xf91b('0xe')](_0xf91b('0xf'),_0x59945b+'-'+_0x299b71+'/'+_0x191cd9)['json'](_0x42dca2);}return null;};}function saveUpdates(_0x2f056d){return function(_0x3fd8ec){if(_0x3fd8ec){return _0x3fd8ec['update'](_0x2f056d)[_0xf91b('0x10')](function(_0x30d7e4){return _0x30d7e4;});}return null;};}function removeEntity(_0x3d8fe0){return function(_0xa0c494){if(_0xa0c494){return _0xa0c494['destroy']()[_0xf91b('0x10')](function(){_0x3d8fe0[_0xf91b('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198380){return function(_0x57cf85){if(!_0x57cf85){_0x198380[_0xf91b('0x8')](0x194);}return _0x57cf85;};}function handleError(_0x181bb2,_0x4de572){_0x4de572=_0x4de572||0x1f4;return function(_0x8ee907){logger[_0xf91b('0x11')](_0x8ee907['stack']);if(_0x8ee907['name']){delete _0x8ee907[_0xf91b('0x12')];}_0x181bb2[_0xf91b('0xd')](_0x4de572)['send'](_0x8ee907);};}function maskClientSecret(_0x4c0c38){return _[_0xf91b('0x13')](_0x4c0c38['slice'](0x0,0x3),0x14,'*');}exports[_0xf91b('0x14')]=function(_0x50bc91,_0x4148eb){var _0x57f318={},_0x190a46={},_0x18b8f0={'count':0x0,'rows':[]};var _0x137c13=_[_0xf91b('0x15')](db[_0xf91b('0x16')][_0xf91b('0x17')],function(_0x2d48d3){return{'name':_0x2d48d3[_0xf91b('0x18')],'type':_0x2d48d3[_0xf91b('0x19')][_0xf91b('0x1a')]};});_0x190a46[_0xf91b('0x1b')]=_[_0xf91b('0x15')](_0x137c13,_0xf91b('0x12'));_0x190a46['query']=_[_0xf91b('0x1c')](_0x50bc91['query']);_0x190a46['filters']=_[_0xf91b('0x1d')](_0x190a46[_0xf91b('0x1b')],_0x190a46[_0xf91b('0x1e')]);_0x57f318['attributes']=_[_0xf91b('0x1d')](_0x190a46['model'],qs[_0xf91b('0x1f')](_0x50bc91[_0xf91b('0x1e')]['fields']));_0x57f318[_0xf91b('0x20')]=_0x57f318['attributes']['length']?_0x57f318[_0xf91b('0x20')]:_0x190a46[_0xf91b('0x1b')];if(!_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x21')](_0xf91b('0x22'))){_0x57f318[_0xf91b('0x9')]=qs['limit'](_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x9')]);_0x57f318[_0xf91b('0xb')]=qs[_0xf91b('0xb')](_0x50bc91['query']['offset']);}_0x57f318[_0xf91b('0x23')]=qs['sort'](_0x50bc91[_0xf91b('0x1e')]['sort']);_0x57f318['where']=qs['filters'](_[_0xf91b('0x24')](_0x50bc91[_0xf91b('0x1e')],_0x190a46[_0xf91b('0x25')]),_0x137c13);if(_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x26')]){_0x57f318['where']=_[_0xf91b('0x27')](_0x57f318[_0xf91b('0x28')],{'$or':_[_0xf91b('0x15')](_0x137c13,function(_0x5a0576){if(_0x5a0576[_0xf91b('0x19')]!==_0xf91b('0x29')){var _0xb5ba63={};_0xb5ba63[_0x5a0576[_0xf91b('0x12')]]={'$like':'%'+_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x26')]+'%'};return _0xb5ba63;}})});}_0x57f318=_[_0xf91b('0x27')]({},_0x57f318,_0x50bc91[_0xf91b('0x2a')]);var _0x39a815={'where':_0x57f318['where']};return db[_0xf91b('0x16')][_0xf91b('0xc')](_0x39a815)['then'](function(_0x273ca5){_0x18b8f0[_0xf91b('0xc')]=_0x273ca5;if(_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x2b')]){_0x57f318[_0xf91b('0x2c')]=[{'all':!![]}];}return db[_0xf91b('0x16')]['findAll'](_0x57f318);})[_0xf91b('0x10')](function(_0x36cdca){_0x18b8f0[_0xf91b('0x2d')]=_['map'](_0x36cdca,function(_0x362064){if(_0x362064[_0xf91b('0x2e')]===_0xf91b('0x2f')){var _0x98861d=encryptor[_0xf91b('0x30')](_0x362064[_0xf91b('0x31')]);_0x362064[_0xf91b('0x31')]=maskClientSecret(_0x98861d);}return _0x362064;});return _0x18b8f0;})['then'](respondWithFilteredResult(_0x4148eb,_0x57f318))[_0xf91b('0x32')](handleError(_0x4148eb,null));};exports[_0xf91b('0x33')]=function(_0xde74e6,_0x1faf3d){var _0x47e297={'raw':!![],'where':{'id':_0xde74e6[_0xf91b('0x34')]['id']}},_0x1dfc05={};_0x1dfc05[_0xf91b('0x1b')]=_[_0xf91b('0x1c')](db['CloudProvider']['rawAttributes']);_0x1dfc05[_0xf91b('0x1e')]=_['keys'](_0xde74e6[_0xf91b('0x1e')]);_0x1dfc05[_0xf91b('0x25')]=_[_0xf91b('0x1d')](_0x1dfc05[_0xf91b('0x1b')],_0x1dfc05[_0xf91b('0x1e')]);_0x47e297['attributes']=_[_0xf91b('0x1d')](_0x1dfc05['model'],qs[_0xf91b('0x1f')](_0xde74e6[_0xf91b('0x1e')]['fields']));_0x47e297[_0xf91b('0x20')]=_0x47e297[_0xf91b('0x20')]['length']?_0x47e297['attributes']:_0x1dfc05[_0xf91b('0x1b')];if(_0xde74e6['query'][_0xf91b('0x2b')]){_0x47e297['include']=[{'all':!![]}];}_0x47e297=_['merge']({},_0x47e297,_0xde74e6[_0xf91b('0x2a')]);return db[_0xf91b('0x16')][_0xf91b('0x35')](_0x47e297)[_0xf91b('0x10')](handleEntityNotFound(_0x1faf3d,null))[_0xf91b('0x10')](function(_0x118aa6){if(_0x118aa6[_0xf91b('0x2e')]===_0xf91b('0x2f')){var _0x5abb99=encryptor[_0xf91b('0x30')](_0x118aa6[_0xf91b('0x31')]);_0x118aa6[_0xf91b('0x31')]=maskClientSecret(_0x5abb99);}return _0x118aa6;})['then'](respondWithResult(_0x1faf3d,null))[_0xf91b('0x32')](handleError(_0x1faf3d,null));};exports[_0xf91b('0x36')]=function(_0x5334af,_0xe5fc79){if(!_0x5334af[_0xf91b('0x37')][_0xf91b('0x12')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5334af['body']['service'])throw new Error(_0xf91b('0x38'));var _0x22a2e0=db[_0xf91b('0x16')][_0xf91b('0x17')]['service'][_0xf91b('0x39')];if(!_0x22a2e0['includes'](_0x5334af['body'][_0xf91b('0x2e')]))throw new Error(_0xf91b('0x3a')+_0x22a2e0[_0xf91b('0x3b')](',\x20'));if(_0x5334af['body'][_0xf91b('0x2e')]===_0xf91b('0x2f')&&_0x5334af['body'][_0xf91b('0x31')]){_0x5334af['body'][_0xf91b('0x31')]=encryptor[_0xf91b('0x3c')](_0x5334af[_0xf91b('0x37')][_0xf91b('0x31')]);}return db[_0xf91b('0x16')][_0xf91b('0x36')](_0x5334af[_0xf91b('0x37')],{})['then'](respondWithResult(_0xe5fc79,0xc9))[_0xf91b('0x32')](handleError(_0xe5fc79,null));};exports[_0xf91b('0x3d')]=function(_0x7365ef,_0x533863){if(_0x7365ef[_0xf91b('0x37')]['id']){delete _0x7365ef[_0xf91b('0x37')]['id'];}return db[_0xf91b('0x16')]['find']({'where':{'id':_0x7365ef[_0xf91b('0x34')]['id']}})[_0xf91b('0x10')](handleEntityNotFound(_0x533863,null))[_0xf91b('0x10')](function(_0x1c46b9){if(_0x1c46b9[_0xf91b('0x2e')]==='MicrosoftAzure'&&_0x7365ef[_0xf91b('0x37')][_0xf91b('0x31')]){_0x7365ef[_0xf91b('0x37')][_0xf91b('0x31')]=encryptor['encryptString'](_0x7365ef['body'][_0xf91b('0x31')]);}return _0x1c46b9;})['then'](saveUpdates(_0x7365ef['body'],null))[_0xf91b('0x10')](respondWithResult(_0x533863,null))['catch'](handleError(_0x533863,null));};exports[_0xf91b('0x3e')]=function(_0x1431f1,_0x54fb2f){return db['CloudProvider'][_0xf91b('0x35')]({'where':{'id':_0x1431f1[_0xf91b('0x34')]['id']}})[_0xf91b('0x10')](handleEntityNotFound(_0x54fb2f,null))[_0xf91b('0x10')](removeEntity(_0x54fb2f,null))['catch'](handleError(_0x54fb2f,null));};exports[_0xf91b('0x3f')]=function(_0x29593e,_0x463667){return db[_0xf91b('0x16')][_0xf91b('0x40')]({'where':{'id':_0x29593e[_0xf91b('0x34')]['id']},'raw':!![]})[_0xf91b('0x10')](function(_0x2aab02){if(!_0x2aab02)return _0x463667[_0xf91b('0x8')](0x194);return{'url':oauth[_0xf91b('0x41')](_0x2aab02,_0x29593e[_0xf91b('0x42')]['id'])};})[_0xf91b('0x10')](respondWithResult(_0x463667,null))[_0xf91b('0x32')](handleError(_0x463667,null));};exports[_0xf91b('0x43')]=function(_0x57b10b,_0x4f031b){var _0x20ab7f=_0x57b10b[_0xf91b('0x37')];var _0x155563;var _0x2b5e2b;if(_0x20ab7f[_0xf91b('0x11')])throw _0x20ab7f;redis[_0xf91b('0x44')](_0x20ab7f[_0xf91b('0x45')])[_0xf91b('0x10')](function(_0xbf7133){if(!_0xbf7133)throw new Error(_0xf91b('0x46'));_0x155563=JSON[_0xf91b('0x47')](_0xbf7133);var _0x40edaa=Buffer[_0xf91b('0x48')](_0x20ab7f[_0xf91b('0x45')],_0xf91b('0x49'))['toString'](_0xf91b('0x4a'));_0x2b5e2b=JSON[_0xf91b('0x47')](_0x40edaa);if(!oauth['isValidIdToken'](_0x20ab7f[_0xf91b('0x4b')],_0x155563[_0xf91b('0x4c')]))throw new Error(_0xf91b('0x4d'));redis[_0xf91b('0x4e')](_0x20ab7f[_0xf91b('0x45')]);return oauth[_0xf91b('0x4f')](_0x20ab7f['code'],_0x155563);})['then'](function(_0x54b8b6){_0x155563[_0xf91b('0x50')]=_0x54b8b6[_0xf91b('0x51')];_0x155563['data6']=_0x54b8b6[_0xf91b('0x52')];return db[_0xf91b('0x16')][_0xf91b('0x3d')]({'data5':_0x155563[_0xf91b('0x50')],'data6':_0x155563['data6']},{'where':{'id':_0x155563['id']}});})[_0xf91b('0x10')](function(){oauth[_0xf91b('0x53')](_0x155563);socket[_0xf91b('0x54')](_0xf91b('0x55'),{'id':_0x2b5e2b['id']});return;})['then'](respondWithStatusCode(_0x4f031b,null))[_0xf91b('0x32')](function(_0x2a20c0){if(_0x2b5e2b){socket[_0xf91b('0x54')](_0xf91b('0x56'),{'id':_0x2b5e2b['id']});}if(!_0x155563){logger[_0xf91b('0x11')](_0xf91b('0x57'),_0x2a20c0);return _0x4f031b[_0xf91b('0xd')](0x1f4)[_0xf91b('0x58')](_0x2a20c0[_0xf91b('0x59')]);}logger['error'](_0xf91b('0x5a'),_0x155563['id'],JSON[_0xf91b('0x5b')](_0x2a20c0));});}; \ No newline at end of file +var _0xeccd=['update','then','sendStatus','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x2c1e14,_0x4680db){var _0x1a12b1=function(_0x3fdaec){while(--_0x3fdaec){_0x2c1e14['push'](_0x2c1e14['shift']());}};_0x1a12b1(++_0x4680db);}(_0xeccd,0x100));var _0xdecc=function(_0x351521,_0x2b9971){_0x351521=_0x351521-0x0;var _0x8bfb3a=_0xeccd[_0x351521];return _0x8bfb3a;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xdecc('0x0'));var encryptor=require('../../components/encryptor');var config=require(_0xdecc('0x1'));var logger=require(_0xdecc('0x2'))(_0xdecc('0x3'));var db=require(_0xdecc('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xdecc('0x5')]=_[_0xdecc('0x6')](config[_0xdecc('0x5')],{'host':_0xdecc('0x7'),'port':0x18eb});var socket=require(_0xdecc('0x8'))(new Redis(config[_0xdecc('0x5')]));var redis=new Redis(config[_0xdecc('0x5')]);function respondWithStatusCode(_0xf26e93,_0x4c3c20){_0x4c3c20=_0x4c3c20||0xcc;return function(_0xe7e34b){if(_0xe7e34b){return _0xf26e93['sendStatus'](_0x4c3c20);}return _0xf26e93[_0xdecc('0x9')](_0x4c3c20)[_0xdecc('0xa')]();};}function respondWithResult(_0x42fcc0,_0x55637b){_0x55637b=_0x55637b||0xc8;return function(_0x230799){if(_0x230799){return _0x42fcc0[_0xdecc('0x9')](_0x55637b)[_0xdecc('0xb')](_0x230799);}};}function respondWithFilteredResult(_0xbda0ae,_0x407a5a){return function(_0xa37f1c){if(_0xa37f1c){var _0x2300f1=typeof _0x407a5a[_0xdecc('0xc')]==='undefined'&&typeof _0x407a5a[_0xdecc('0xd')]===_0xdecc('0xe');var _0xbf66aa=_0xa37f1c[_0xdecc('0xf')];var _0x800900=_0x2300f1?0x0:_0x407a5a[_0xdecc('0xc')];var _0x1fd48b=_0x2300f1?_0xa37f1c[_0xdecc('0xf')]:_0x407a5a['offset']+_0x407a5a[_0xdecc('0xd')];var _0x586ccd;if(_0x1fd48b>=_0xbf66aa){_0x1fd48b=_0xbf66aa;_0x586ccd=0xc8;}else{_0x586ccd=0xce;}_0xbda0ae[_0xdecc('0x9')](_0x586ccd);return _0xbda0ae['set'](_0xdecc('0x10'),_0x800900+'-'+_0x1fd48b+'/'+_0xbf66aa)[_0xdecc('0xb')](_0xa37f1c);}return null;};}function saveUpdates(_0x5aebc5){return function(_0x4edaa5){if(_0x4edaa5){return _0x4edaa5[_0xdecc('0x11')](_0x5aebc5)[_0xdecc('0x12')](function(_0x3febc8){return _0x3febc8;});}return null;};}function removeEntity(_0x1c962f){return function(_0x3349c5){if(_0x3349c5){return _0x3349c5['destroy']()[_0xdecc('0x12')](function(){_0x1c962f[_0xdecc('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce6e3){return function(_0x45bcc7){if(!_0x45bcc7){_0x1ce6e3[_0xdecc('0x13')](0x194);}return _0x45bcc7;};}function handleError(_0x557f2c,_0x45affc){_0x45affc=_0x45affc||0x1f4;return function(_0x5df811){logger[_0xdecc('0x14')](_0x5df811[_0xdecc('0x15')]);if(_0x5df811[_0xdecc('0x16')]){delete _0x5df811[_0xdecc('0x16')];}_0x557f2c[_0xdecc('0x9')](_0x45affc)['send'](_0x5df811);};}function maskClientSecret(_0x337b12){return _['padEnd'](_0x337b12[_0xdecc('0x17')](0x0,0x3),0x14,'*');}exports[_0xdecc('0x18')]=function(_0x100d9a,_0x29b03c){var _0x14c272={},_0x4c7772={},_0xea53c2={'count':0x0,'rows':[]};var _0x568552=_[_0xdecc('0x19')](db[_0xdecc('0x1a')][_0xdecc('0x1b')],function(_0x578a3d){return{'name':_0x578a3d[_0xdecc('0x1c')],'type':_0x578a3d[_0xdecc('0x1d')]['key']};});_0x4c7772[_0xdecc('0x1e')]=_[_0xdecc('0x19')](_0x568552,'name');_0x4c7772['query']=_[_0xdecc('0x1f')](_0x100d9a[_0xdecc('0x20')]);_0x4c7772[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x4c7772['model'],_0x4c7772[_0xdecc('0x20')]);_0x14c272[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x4c7772['model'],qs[_0xdecc('0x24')](_0x100d9a['query']['fields']));_0x14c272[_0xdecc('0x23')]=_0x14c272[_0xdecc('0x23')]['length']?_0x14c272[_0xdecc('0x23')]:_0x4c7772[_0xdecc('0x1e')];if(!_0x100d9a[_0xdecc('0x20')]['hasOwnProperty'](_0xdecc('0x25'))){_0x14c272[_0xdecc('0xd')]=qs[_0xdecc('0xd')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xd')]);_0x14c272[_0xdecc('0xc')]=qs[_0xdecc('0xc')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xc')]);}_0x14c272[_0xdecc('0x26')]=qs[_0xdecc('0x27')](_0x100d9a['query'][_0xdecc('0x27')]);_0x14c272[_0xdecc('0x28')]=qs['filters'](_['pick'](_0x100d9a['query'],_0x4c7772['filters']),_0x568552);if(_0x100d9a[_0xdecc('0x20')][_0xdecc('0x29')]){_0x14c272[_0xdecc('0x28')]=_[_0xdecc('0x2a')](_0x14c272[_0xdecc('0x28')],{'$or':_[_0xdecc('0x19')](_0x568552,function(_0x40923a){if(_0x40923a['type']!==_0xdecc('0x2b')){var _0x451ce3={};_0x451ce3[_0x40923a[_0xdecc('0x16')]]={'$like':'%'+_0x100d9a['query'][_0xdecc('0x29')]+'%'};return _0x451ce3;}})});}_0x14c272=_[_0xdecc('0x2a')]({},_0x14c272,_0x100d9a['options']);var _0x50f833={'where':_0x14c272[_0xdecc('0x28')]};return db['CloudProvider'][_0xdecc('0xf')](_0x50f833)[_0xdecc('0x12')](function(_0x902fa7){_0xea53c2[_0xdecc('0xf')]=_0x902fa7;if(_0x100d9a['query']['includeAll']){_0x14c272[_0xdecc('0x2c')]=[{'all':!![]}];}return db[_0xdecc('0x1a')][_0xdecc('0x2d')](_0x14c272);})[_0xdecc('0x12')](function(_0x18a3b6){_0xea53c2['rows']=_[_0xdecc('0x19')](_0x18a3b6,function(_0x3fabe3){if(_0x3fabe3[_0xdecc('0x2e')]===_0xdecc('0x2f')){var _0x3afb4b=encryptor[_0xdecc('0x30')](_0x3fabe3[_0xdecc('0x31')]);_0x3fabe3[_0xdecc('0x31')]=maskClientSecret(_0x3afb4b);}return _0x3fabe3;});return _0xea53c2;})[_0xdecc('0x12')](respondWithFilteredResult(_0x29b03c,_0x14c272))[_0xdecc('0x32')](handleError(_0x29b03c,null));};exports[_0xdecc('0x33')]=function(_0x3a0bf2,_0x117ef0){var _0x5c4c96={'raw':!![],'where':{'id':_0x3a0bf2[_0xdecc('0x34')]['id']}},_0x589e34={};_0x589e34[_0xdecc('0x1e')]=_[_0xdecc('0x1f')](db[_0xdecc('0x1a')][_0xdecc('0x1b')]);_0x589e34[_0xdecc('0x20')]=_[_0xdecc('0x1f')](_0x3a0bf2['query']);_0x589e34[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x589e34['model'],_0x589e34[_0xdecc('0x20')]);_0x5c4c96[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x589e34[_0xdecc('0x1e')],qs[_0xdecc('0x24')](_0x3a0bf2[_0xdecc('0x20')][_0xdecc('0x24')]));_0x5c4c96[_0xdecc('0x23')]=_0x5c4c96['attributes']['length']?_0x5c4c96[_0xdecc('0x23')]:_0x589e34[_0xdecc('0x1e')];if(_0x3a0bf2[_0xdecc('0x20')]['includeAll']){_0x5c4c96[_0xdecc('0x2c')]=[{'all':!![]}];}_0x5c4c96=_['merge']({},_0x5c4c96,_0x3a0bf2[_0xdecc('0x35')]);return db[_0xdecc('0x1a')][_0xdecc('0x36')](_0x5c4c96)[_0xdecc('0x12')](handleEntityNotFound(_0x117ef0,null))[_0xdecc('0x12')](function(_0x14eea1){if(_0x14eea1['service']===_0xdecc('0x2f')){var _0x1b41fa=encryptor[_0xdecc('0x30')](_0x14eea1[_0xdecc('0x31')]);_0x14eea1['data3']=maskClientSecret(_0x1b41fa);}return _0x14eea1;})['then'](respondWithResult(_0x117ef0,null))[_0xdecc('0x32')](handleError(_0x117ef0,null));};exports[_0xdecc('0x37')]=function(_0x4750a6,_0x57f2b3){if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x16')])throw new Error(_0xdecc('0x39'));if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4494a5=db[_0xdecc('0x1a')][_0xdecc('0x1b')][_0xdecc('0x2e')]['values'];if(!_0x4494a5[_0xdecc('0x3a')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')]))throw new Error(_0xdecc('0x3b')+_0x4494a5[_0xdecc('0x3c')](',\x20'));if(_0x4750a6[_0xdecc('0x38')]['service']===_0xdecc('0x2f')&&_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]){_0x4750a6['body']['data3']=encryptor[_0xdecc('0x3d')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]);}return db[_0xdecc('0x1a')]['create'](_0x4750a6[_0xdecc('0x38')],{})[_0xdecc('0x12')](respondWithResult(_0x57f2b3,0xc9))[_0xdecc('0x32')](handleError(_0x57f2b3,null));};exports[_0xdecc('0x11')]=function(_0x24b566,_0x43a227){if(_0x24b566[_0xdecc('0x38')]['id']){delete _0x24b566[_0xdecc('0x38')]['id'];}return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x24b566[_0xdecc('0x34')]['id']}})['then'](handleEntityNotFound(_0x43a227,null))[_0xdecc('0x12')](function(_0x3498e0){if(_0x3498e0[_0xdecc('0x2e')]==='MicrosoftAzure'&&_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]){_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]=encryptor[_0xdecc('0x3d')](_0x24b566[_0xdecc('0x38')]['data3']);}return _0x3498e0;})[_0xdecc('0x12')](saveUpdates(_0x24b566[_0xdecc('0x38')],null))['then'](respondWithResult(_0x43a227,null))[_0xdecc('0x32')](handleError(_0x43a227,null));};exports[_0xdecc('0x3e')]=function(_0x46512a,_0x12195b){return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x46512a[_0xdecc('0x34')]['id']}})[_0xdecc('0x12')](handleEntityNotFound(_0x12195b,null))[_0xdecc('0x12')](removeEntity(_0x12195b,null))[_0xdecc('0x32')](handleError(_0x12195b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x554fa0,_0x43d6a2){return db[_0xdecc('0x1a')][_0xdecc('0x3f')]({'where':{'id':_0x554fa0['params']['id']},'raw':!![]})[_0xdecc('0x12')](function(_0x47db8d){if(!_0x47db8d)return _0x43d6a2[_0xdecc('0x13')](0x194);return{'url':oauth[_0xdecc('0x40')](_0x47db8d,_0x554fa0[_0xdecc('0x41')]['id'])};})[_0xdecc('0x12')](respondWithResult(_0x43d6a2,null))[_0xdecc('0x32')](handleError(_0x43d6a2,null));};exports[_0xdecc('0x42')]=function(_0x4405f3,_0x514e9e){var _0x5cc12d=_0x4405f3[_0xdecc('0x38')];var _0x3d6ec2;var _0x3598c7;if(_0x5cc12d['error'])throw _0x5cc12d;redis[_0xdecc('0x43')](_0x5cc12d[_0xdecc('0x44')])['then'](function(_0x38e123){if(!_0x38e123)throw new Error(_0xdecc('0x45'));_0x3d6ec2=JSON['parse'](_0x38e123);var _0x12dea9=Buffer[_0xdecc('0x46')](_0x5cc12d[_0xdecc('0x44')],_0xdecc('0x47'))[_0xdecc('0x48')](_0xdecc('0x49'));_0x3598c7=JSON[_0xdecc('0x4a')](_0x12dea9);if(!oauth[_0xdecc('0x4b')](_0x5cc12d[_0xdecc('0x4c')],_0x3d6ec2[_0xdecc('0x4d')]))throw new Error(_0xdecc('0x4e'));redis[_0xdecc('0x4f')](_0x5cc12d['state']);return oauth[_0xdecc('0x50')](_0x5cc12d[_0xdecc('0x51')],_0x3d6ec2);})[_0xdecc('0x12')](function(_0x19063d){_0x3d6ec2[_0xdecc('0x52')]=_0x19063d[_0xdecc('0x53')];_0x3d6ec2[_0xdecc('0x54')]=_0x19063d['refresh_token'];return db[_0xdecc('0x1a')][_0xdecc('0x11')]({'data5':_0x3d6ec2[_0xdecc('0x52')],'data6':_0x3d6ec2[_0xdecc('0x54')]},{'where':{'id':_0x3d6ec2['id']}});})[_0xdecc('0x12')](function(){oauth['startRefreshInterval'](_0x3d6ec2);socket['emit'](_0xdecc('0x55'),{'id':_0x3598c7['id']});return;})[_0xdecc('0x12')](respondWithStatusCode(_0x514e9e,null))['catch'](function(_0x53803f){if(_0x3598c7){socket['emit'](_0xdecc('0x56'),{'id':_0x3598c7['id']});}if(!_0x3d6ec2){logger['error'](_0xdecc('0x57'),_0x53803f);return _0x514e9e[_0xdecc('0x9')](0x1f4)[_0xdecc('0x58')](_0x53803f[_0xdecc('0x59')]);}logger[_0xdecc('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3d6ec2['id'],JSON[_0xdecc('0x5a')](_0x53803f));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b203627..6d5302b 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9974=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cloudProvider.attributes','cloud_providers'];(function(_0x45799a,_0x203d8d){var _0x20b234=function(_0x3faf51){while(--_0x3faf51){_0x45799a['push'](_0x45799a['shift']());}};_0x20b234(++_0x203d8d);}(_0x9974,0x168));var _0x4997=function(_0x4f602f,_0x5a0e14){_0x4f602f=_0x4f602f-0x0;var _0x79cf8b=_0x9974[_0x4f602f];return _0x79cf8b;};'use strict';var _=require(_0x4997('0x0'));var util=require(_0x4997('0x1'));var logger=require(_0x4997('0x2'))('api');var moment=require(_0x4997('0x3'));var BPromise=require('bluebird');var rp=require(_0x4997('0x4'));var fs=require('fs');var path=require(_0x4997('0x5'));var rimraf=require(_0x4997('0x6'));var config=require('../../config/environment');var attributes=require(_0x4997('0x7'));module['exports']=function(_0x2bb3dd,_0x2d358d){return _0x2bb3dd['define']('CloudProvider',attributes,{'tableName':_0x4997('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc088=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','../../config/logger','api'];(function(_0xe6c803,_0x484b8c){var _0x588402=function(_0x552eaf){while(--_0x552eaf){_0xe6c803['push'](_0xe6c803['shift']());}};_0x588402(++_0x484b8c);}(_0xc088,0x1b6));var _0x8c08=function(_0x2df23d,_0x4b03b0){_0x2df23d=_0x2df23d-0x0;var _0x5d499a=_0xc088[_0x2df23d];return _0x5d499a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c08('0x0'))(_0x8c08('0x1'));var moment=require(_0x8c08('0x2'));var BPromise=require(_0x8c08('0x3'));var rp=require(_0x8c08('0x4'));var fs=require('fs');var path=require(_0x8c08('0x5'));var rimraf=require(_0x8c08('0x6'));var config=require(_0x8c08('0x7'));var attributes=require(_0x8c08('0x8'));module['exports']=function(_0x59add9,_0x5cfd7f){return _0x59add9[_0x8c08('0x9')]('CloudProvider',attributes,{'tableName':_0x8c08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 7d0fb1a..d1fa9c6 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69cb=['data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}','access_token','update','data5','data6','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace'];(function(_0x43026d,_0x4d8576){var _0x313e6d=function(_0x3d6a35){while(--_0x3d6a35){_0x43026d['push'](_0x43026d['shift']());}};_0x313e6d(++_0x4d8576);}(_0x69cb,0xd5));var _0xb69c=function(_0x861e02,_0x33f772){_0x861e02=_0x861e02-0x0;var _0x48fc24=_0x69cb[_0x861e02];return _0x48fc24;};'use strict';var _=require(_0xb69c('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb69c('0x1'));var Redis=require('ioredis');var rp=require(_0xb69c('0x2'));var util=require('util');var encryptor=require(_0xb69c('0x3'));var config=require(_0xb69c('0x4'));var logger=require(_0xb69c('0x5'))(_0xb69c('0x6'));var schedule=require(_0xb69c('0x7'));var db=require(_0xb69c('0x8'))['db'];config[_0xb69c('0x9')]=_[_0xb69c('0xa')](config[_0xb69c('0x9')],{'host':_0xb69c('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb69c('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb69c('0xc'),'email',_0xb69c('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xb69c('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb69c('0xf'),_0xb69c('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xb69c('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4ffac0){var _0x3c06c2=_[_0xb69c('0x11')](AZURE_AUTH_SCOPES[_0x4ffac0[_0xb69c('0x12')]]);if(_0x4ffac0['type']===_0xb69c('0x13'))_0x3c06c2[_0xb69c('0x14')](_0x4ffac0[_0xb69c('0x15')]+_0xb69c('0x16'));return _0x3c06c2[_0xb69c('0x17')]('\x20');}function getAccessTokenScope(_0x547fa2){if(_0x547fa2['type']===_0xb69c('0x18'))return _0xb69c('0x19');if(_0x547fa2[_0xb69c('0x12')]===_0xb69c('0x13'))return _0x547fa2[_0xb69c('0x15')]+_0xb69c('0x16');}function generateMicrosoftAuthorizationUrl(_0x2c2ac1,_0x2c1329){var _0x67b459=MICROSOFT_AUTH_URL[_0xb69c('0x1a')]('{TENANT_ID}',_0x2c2ac1[_0xb69c('0x1b')]);var _0x1c29cb=[_0xb69c('0x1c'),_0xb69c('0x1d')];var _0x581c83=Buffer[_0xb69c('0x1e')](JSON[_0xb69c('0x1f')]({'id':_0x2c1329}))[_0xb69c('0x20')](_0xb69c('0x21'));var _0x44ca5e=crypto[_0xb69c('0x22')](0x10)[_0xb69c('0x20')](_0xb69c('0x23'));var _0x3bec85=getAuthorizationScopes(_0x2c2ac1);var _0x18e26f=[{'key':_0xb69c('0x24'),'value':_0x2c2ac1[_0xb69c('0x25')]},{'key':_0xb69c('0x26'),'value':encodeURIComponent(_0x1c29cb['join']('\x20'))},{'key':_0xb69c('0x27'),'value':_0x2c2ac1[_0xb69c('0x28')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x3bec85)},{'key':_0xb69c('0x29'),'value':_0x581c83},{'key':_0xb69c('0x2a'),'value':_0x44ca5e},{'key':_0xb69c('0x2b'),'value':'login'}];var _0x2f490c=_0x67b459+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb69c('0x11')](_0x18e26f,function(_0x3093c5){return _0x3093c5[_0xb69c('0x2c')]+'='+_0x3093c5[_0xb69c('0x2d')];})[_0xb69c('0x17')]('&');_0x2c2ac1[_0xb69c('0x2e')]={'issuer':_0x67b459[_0xb69c('0x1a')](_0xb69c('0x2f'),''),'audience':_0x2c2ac1[_0xb69c('0x25')],'state':_0x581c83,'nonce':_0x44ca5e};redis['set'](_0x581c83,JSON['stringify'](_0x2c2ac1));return _0x2f490c;}function isValidIdToken(_0x16c0dc,_0x26f825){try{var _0x260d1b=jwt[_0xb69c('0x30')](_0x16c0dc,{'complete':!![]});var _0x1408d7=_0x260d1b[_0xb69c('0x31')];if(_0x1408d7[_0xb69c('0x32')]!==_0x26f825[_0xb69c('0x33')])return![];if(_0x1408d7[_0xb69c('0x34')]!==_0x26f825[_0xb69c('0x35')])return![];if(_0x1408d7['nonce']!==_0x26f825[_0xb69c('0x2a')])return![];if(moment()[_0xb69c('0x36')](moment[_0xb69c('0x37')](_0x1408d7[_0xb69c('0x38')])))return![];return!![];}catch(_0x2a6bc8){throw _0x2a6bc8;}}function refreshOauth2MicrosoftAccessToken(_0x311852){return Promise[_0xb69c('0x39')]()[_0xb69c('0x3a')](function(){if(_0x311852[_0xb69c('0x3b')])return _0x311852;return db[_0xb69c('0x3c')][_0xb69c('0x3d')]({'where':{'id':_0x311852['id']},'raw':!![]});})['then'](function(_0x5e577c){var _0x4f4d2a={'grant_type':_0xb69c('0x3e'),'refresh_token':_0x5e577c['data6'],'scope':getAccessTokenScope(_0x5e577c),'redirect_uri':_0x5e577c[_0xb69c('0x28')],'client_id':_0x5e577c['data1'],'client_secret':encryptor[_0xb69c('0x3f')](_0x5e577c[_0xb69c('0x3b')])};var _0x54ca73={'method':_0xb69c('0x40'),'uri':MICROSOFT_AUTH_URL[_0xb69c('0x1a')](_0xb69c('0x41'),_0x5e577c[_0xb69c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f4d2a,'json':!![]};return rp(_0x54ca73);})[_0xb69c('0x3a')](function(_0x71e8b4){_0x311852['data5']=_0x71e8b4[_0xb69c('0x42')];_0x311852['data6']=_0x71e8b4['refresh_token'];return db['CloudProvider'][_0xb69c('0x43')]({'data5':_0x311852[_0xb69c('0x44')],'data6':_0x311852[_0xb69c('0x45')]},{'where':{'id':_0x311852['id']}});})[_0xb69c('0x3a')](function(){return _0x311852;})[_0xb69c('0x46')](function(_0x78437b){logger['error'](_0xb69c('0x47'),_0x311852['id'],_0x78437b);});}function getOauth2MicrosoftAccessToken(_0x5826eb,_0x4dfe7b){var _0x1413e4={'grant_type':'authorization_code','code':_0x5826eb,'scope':getAccessTokenScope(_0x4dfe7b),'redirect_uri':_0x4dfe7b[_0xb69c('0x28')],'client_id':_0x4dfe7b[_0xb69c('0x25')],'client_secret':encryptor['decryptString'](_0x4dfe7b[_0xb69c('0x3b')])};var _0x515270={'method':_0xb69c('0x40'),'uri':MICROSOFT_AUTH_URL[_0xb69c('0x1a')](_0xb69c('0x41'),_0x4dfe7b[_0xb69c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1413e4,'json':!![]};return rp(_0x515270);}function startRefreshInterval(_0x4fb358){var _0x55a616=schedule[_0xb69c('0x48')];if(_0x55a616[_0x4fb358['id']])clearInterval(_0x55a616[_0x4fb358['id']]);_0x55a616[_0x4fb358['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb69c('0x49')](this,{'id':_0x4fb358['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x55a616;}function startAllRefreshIntervals(){return db[_0xb69c('0x3c')][_0xb69c('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x51759a){var _0x4ab598=_0x51759a[_0xb69c('0x11')](function(_0x19d615){return refreshOauth2MicrosoftAccessToken(_0x19d615)[_0xb69c('0x3a')](function(_0x50b5b9){startRefreshInterval(_0x50b5b9);});});return Promise[_0xb69c('0x4b')](_0x4ab598);})[_0xb69c('0x46')](function(_0xcb0e3d){var _0x9f1658=_0xcb0e3d?util[_0xb69c('0x4c')](_0xcb0e3d,{'showHidden':![],'depth':null}):'';logger[_0xb69c('0x4d')](_0xb69c('0x4e'),_0x9f1658);});}module[_0xb69c('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x351b=['openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','hex','client_id','data1','join','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','POST','data5','access_token','CloudProvider','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','decryptString','intervals','bind','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost'];(function(_0x49d522,_0x1292c3){var _0x5ca1d9=function(_0x274351){while(--_0x274351){_0x49d522['push'](_0x49d522['shift']());}};_0x5ca1d9(++_0x1292c3);}(_0x351b,0x91));var _0xb351=function(_0x3be6fb,_0x18fd31){_0x3be6fb=_0x3be6fb-0x0;var _0x4ba854=_0x351b[_0x3be6fb];return _0x4ba854;};'use strict';var _=require(_0xb351('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb351('0x1'));var Redis=require(_0xb351('0x2'));var rp=require(_0xb351('0x3'));var util=require(_0xb351('0x4'));var encryptor=require(_0xb351('0x5'));var config=require(_0xb351('0x6'));var logger=require(_0xb351('0x7'))(_0xb351('0x8'));var schedule=require(_0xb351('0x9'));var db=require(_0xb351('0xa'))['db'];config[_0xb351('0xb')]=_['defaults'](config[_0xb351('0xb')],{'host':_0xb351('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xb351('0xd'),_0xb351('0xe'),_0xb351('0xf'),_0xb351('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xb351('0x11')],'Dynamics365':[_0xb351('0xd'),_0xb351('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x10a203){var _0x30a1b6=_[_0xb351('0x12')](AZURE_AUTH_SCOPES[_0x10a203[_0xb351('0x13')]]);if(_0x10a203['type']===_0xb351('0x14'))_0x30a1b6['push'](_0x10a203[_0xb351('0x15')]+_0xb351('0x16'));return _0x30a1b6['join']('\x20');}function getAccessTokenScope(_0x27d9b0){if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x17'))return _0xb351('0x18');if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x14'))return _0x27d9b0[_0xb351('0x15')]+_0xb351('0x16');}function generateMicrosoftAuthorizationUrl(_0x3f2cec,_0x14450d){var _0x82029e=MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x3f2cec[_0xb351('0x1a')]);var _0x2e6ec7=['code',_0xb351('0x1b')];var _0x50cf72=Buffer[_0xb351('0x1c')](JSON[_0xb351('0x1d')]({'id':_0x14450d}))['toString']('base64');var _0x4ba651=crypto[_0xb351('0x1e')](0x10)[_0xb351('0x1f')](_0xb351('0x20'));var _0x408381=getAuthorizationScopes(_0x3f2cec);var _0x5c8394=[{'key':_0xb351('0x21'),'value':_0x3f2cec[_0xb351('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x2e6ec7[_0xb351('0x23')]('\x20'))},{'key':_0xb351('0x24'),'value':_0x3f2cec['data4']},{'key':_0xb351('0x25'),'value':_0xb351('0x26')},{'key':_0xb351('0x27'),'value':encodeURIComponent(_0x408381)},{'key':_0xb351('0x28'),'value':_0x50cf72},{'key':_0xb351('0x29'),'value':_0x4ba651},{'key':_0xb351('0x2a'),'value':'login'}];var _0x5229b7=_0x82029e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5c8394,function(_0x4a1752){return _0x4a1752[_0xb351('0x2b')]+'='+_0x4a1752[_0xb351('0x2c')];})[_0xb351('0x23')]('&');_0x3f2cec[_0xb351('0x2d')]={'issuer':_0x82029e[_0xb351('0x2e')](_0xb351('0x2f'),''),'audience':_0x3f2cec['data1'],'state':_0x50cf72,'nonce':_0x4ba651};redis[_0xb351('0x30')](_0x50cf72,JSON[_0xb351('0x1d')](_0x3f2cec));return _0x5229b7;}function isValidIdToken(_0x3fda14,_0xdbad99){try{var _0x24093f=jwt[_0xb351('0x31')](_0x3fda14,{'complete':!![]});var _0x4240ca=_0x24093f[_0xb351('0x32')];if(_0x4240ca[_0xb351('0x33')]!==_0xdbad99[_0xb351('0x34')])return![];if(_0x4240ca[_0xb351('0x35')]!==_0xdbad99[_0xb351('0x36')])return![];if(_0x4240ca['nonce']!==_0xdbad99[_0xb351('0x29')])return![];if(moment()[_0xb351('0x37')](moment[_0xb351('0x38')](_0x4240ca[_0xb351('0x39')])))return![];return!![];}catch(_0x2c30d8){throw _0x2c30d8;}}function refreshOauth2MicrosoftAccessToken(_0x229eda){return Promise[_0xb351('0x3a')]()[_0xb351('0x3b')](function(){if(_0x229eda[_0xb351('0x3c')])return _0x229eda;return db['CloudProvider'][_0xb351('0x3d')]({'where':{'id':_0x229eda['id']},'raw':!![]});})['then'](function(_0x2ca782){var _0x3e71d4={'grant_type':_0xb351('0x3e'),'refresh_token':_0x2ca782[_0xb351('0x3f')],'scope':getAccessTokenScope(_0x2ca782),'redirect_uri':_0x2ca782['data4'],'client_id':_0x2ca782[_0xb351('0x22')],'client_secret':encryptor['decryptString'](_0x2ca782[_0xb351('0x3c')])};var _0x380fcd={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x2ca782[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3e71d4,'json':!![]};return rp(_0x380fcd);})[_0xb351('0x3b')](function(_0x32bb37){_0x229eda[_0xb351('0x41')]=_0x32bb37[_0xb351('0x42')];_0x229eda[_0xb351('0x3f')]=_0x32bb37[_0xb351('0x3e')];return db[_0xb351('0x43')][_0xb351('0x44')]({'data5':_0x229eda[_0xb351('0x41')],'data6':_0x229eda[_0xb351('0x3f')]},{'where':{'id':_0x229eda['id']}});})[_0xb351('0x3b')](function(){return _0x229eda;})['catch'](function(_0x8636a9){logger['error'](_0xb351('0x45'),_0x229eda['id'],_0x8636a9);});}function getOauth2MicrosoftAccessToken(_0x54a597,_0x1e31cb){var _0x2352af={'grant_type':'authorization_code','code':_0x54a597,'scope':getAccessTokenScope(_0x1e31cb),'redirect_uri':_0x1e31cb[_0xb351('0x46')],'client_id':_0x1e31cb[_0xb351('0x22')],'client_secret':encryptor[_0xb351('0x47')](_0x1e31cb[_0xb351('0x3c')])};var _0x396932={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x1e31cb[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2352af,'json':!![]};return rp(_0x396932);}function startRefreshInterval(_0x3941ed){var _0x5ca9eb=schedule[_0xb351('0x48')];if(_0x5ca9eb[_0x3941ed['id']])clearInterval(_0x5ca9eb[_0x3941ed['id']]);_0x5ca9eb[_0x3941ed['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb351('0x49')](this,{'id':_0x3941ed['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb351('0x48')]=_0x5ca9eb;}function startAllRefreshIntervals(){return db[_0xb351('0x43')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb351('0x3b')](function(_0xf4b05f){var _0xa36155=_0xf4b05f['map'](function(_0xbd75e4){return refreshOauth2MicrosoftAccessToken(_0xbd75e4)[_0xb351('0x3b')](function(_0x45ea6c){startRefreshInterval(_0x45ea6c);});});return Promise[_0xb351('0x4a')](_0xa36155);})[_0xb351('0x4b')](function(_0x5d5bf){var _0x38ce36=_0x5d5bf?util[_0xb351('0x4c')](_0x5d5bf,{'showHidden':![],'depth':null}):'';logger[_0xb351('0x4d')](_0xb351('0x4e'),_0x38ce36);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 6f7c396..357ba26 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa467=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xa467,0x143));var _0x7a46=function(_0x1a0e2f,_0x173d4f){_0x1a0e2f=_0x1a0e2f-0x0;var _0x1b74c6=_0xa467[_0x1a0e2f];return _0x1b74c6;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var moment=require(_0x7a46('0x2'));var BPromise=require(_0x7a46('0x3'));var rs=require(_0x7a46('0x4'));var fs=require('fs');var Redis=require(_0x7a46('0x5'));var db=require(_0x7a46('0x6'))['db'];var utils=require(_0x7a46('0x7'));var logger=require(_0x7a46('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a46('0x9'));var client=jayson[_0x7a46('0xa')][_0x7a46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463cdf,_0x6d8fce,_0x550c38){return new BPromise(function(_0x341d9e,_0x1f8b07){return client[_0x7a46('0xc')](_0x463cdf,_0x550c38)[_0x7a46('0xd')](function(_0x382b56){logger[_0x7a46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));logger['debug'](_0x7a46('0x10'),_0x6d8fce,'request\x20sent',JSON[_0x7a46('0x11')](_0x382b56));if(_0x382b56[_0x7a46('0x12')]){if(_0x382b56[_0x7a46('0x12')][_0x7a46('0x13')]===0x1f4){logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);return _0x1f8b07(_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);}logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')]['message']);return _0x341d9e(_0x382b56['error'][_0x7a46('0x14')]);}else{logger[_0x7a46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));_0x341d9e(_0x382b56['result'][_0x7a46('0x14')]);}})[_0x7a46('0x15')](function(_0x50e40e){logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x50e40e);_0x1f8b07(_0x50e40e);});});} \ No newline at end of file +var _0xe797=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe797,0x12a));var _0x7e79=function(_0x41ae18,_0x570d43){_0x41ae18=_0x41ae18-0x0;var _0x51c805=_0xe797[_0x41ae18];return _0x51c805;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var moment=require(_0x7e79('0x2'));var BPromise=require(_0x7e79('0x3'));var rs=require(_0x7e79('0x4'));var fs=require('fs');var Redis=require(_0x7e79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e79('0x6'));var logger=require(_0x7e79('0x7'))('rpc');var config=require(_0x7e79('0x8'));var jayson=require(_0x7e79('0x9'));var client=jayson[_0x7e79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdfa1,_0x9dd35a,_0x358bd6){return new BPromise(function(_0x484e66,_0x54aab5){return client[_0x7e79('0xb')](_0x4fdfa1,_0x358bd6)[_0x7e79('0xc')](function(_0x134e89){logger['info'](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));logger[_0x7e79('0xf')](_0x7e79('0x10'),_0x9dd35a,_0x7e79('0xe'),JSON[_0x7e79('0x11')](_0x134e89));if(_0x134e89[_0x7e79('0x12')]){if(_0x134e89[_0x7e79('0x12')][_0x7e79('0x13')]===0x1f4){logger['error'](_0x7e79('0xd'),_0x9dd35a,_0x134e89['error'][_0x7e79('0x14')]);return _0x54aab5(_0x134e89['error'][_0x7e79('0x14')]);}logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x134e89[_0x7e79('0x12')]['message']);return _0x484e66(_0x134e89[_0x7e79('0x12')][_0x7e79('0x14')]);}else{logger[_0x7e79('0x15')](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));_0x484e66(_0x134e89[_0x7e79('0x16')][_0x7e79('0x14')]);}})['catch'](function(_0x2ec0c7){logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x2ec0c7);_0x54aab5(_0x2ec0c7);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 84f9901..2199671 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x1261,0x144));var _0x1126=function(_0x4a6934,_0x1237f4){_0x4a6934=_0x4a6934-0x0;var _0x532acf=_0x1261[_0x4a6934];return _0x532acf;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x233821,_0x230bfc){var _0xf3613e=function(_0x3594d9){while(--_0x3594d9){_0x233821['push'](_0x233821['shift']());}};_0xf3613e(++_0x230bfc);}(_0xadb5,0xad));var _0x5adb=function(_0x367e32,_0x9a8868){_0x367e32=_0x367e32-0x0;var _0x3d7295=_0xadb5[_0x367e32];return _0x3d7295;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 92fa0f3..366f310 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 _0x6690=['STRING','name','exports'];(function(_0x94a268,_0x68f124){var _0x6eb3fd=function(_0x2bdce7){while(--_0x2bdce7){_0x94a268['push'](_0x94a268['shift']());}};_0x6eb3fd(++_0x68f124);}(_0x6690,0x7a));var _0x0669=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6690[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module[_0x0669('0x0')]={'name':{'type':Sequelize[_0x0669('0x1')],'unique':_0x0669('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0669('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0669('0x1')]},'phone':{'type':Sequelize[_0x0669('0x1')]},'fax':{'type':Sequelize[_0x0669('0x1')]},'type':{'type':Sequelize[_0x0669('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0669('0x1')]},'email':{'type':Sequelize[_0x0669('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0669('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x0669('0x1')]},'sCity':{'type':Sequelize[_0x0669('0x1')]},'sCountry':{'type':Sequelize[_0x0669('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9ca=['exports','STRING','sequelize'];(function(_0x419f08,_0x140060){var _0x47b5f8=function(_0x1906fa){while(--_0x1906fa){_0x419f08['push'](_0x419f08['shift']());}};_0x47b5f8(++_0x140060);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x449b95,_0x3f0845){_0x449b95=_0x449b95-0x0;var _0x4e6519=_0xd9ca[_0x449b95];return _0x4e6519;};'use strict';var Sequelize=require(_0xad9c('0x0'));module[_0xad9c('0x1')]={'name':{'type':Sequelize[_0xad9c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xad9c('0x2')]},'companyId':{'type':Sequelize[_0xad9c('0x2')]},'website':{'type':Sequelize[_0xad9c('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xad9c('0x2')]},'type':{'type':Sequelize[_0xad9c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xad9c('0x2')]},'city':{'type':Sequelize[_0xad9c('0x2')]},'country':{'type':Sequelize[_0xad9c('0x2')]},'email':{'type':Sequelize[_0xad9c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xad9c('0x2')]},'sCity':{'type':Sequelize[_0xad9c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad9c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f4bf583..3ecd6b3 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 _0xc2bc=['stack','name','send','index','describe','model','keys','intersection','attributes','query','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error'];(function(_0x5288a8,_0x3dafed){var _0x1f9e67=function(_0x26e598){while(--_0x26e598){_0x5288a8['push'](_0x5288a8['shift']());}};_0x1f9e67(++_0x3dafed);}(_0xc2bc,0x139));var _0xcc2b=function(_0x36b927,_0x67c31f){_0x36b927=_0x36b927-0x0;var _0x42e629=_0xc2bc[_0x36b927];return _0x42e629;};'use strict';var emlformat=require(_0xcc2b('0x0'));var rimraf=require(_0xcc2b('0x1'));var zipdir=require(_0xcc2b('0x2'));var jsonpatch=require(_0xcc2b('0x3'));var rp=require(_0xcc2b('0x4'));var moment=require(_0xcc2b('0x5'));var BPromise=require(_0xcc2b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc2b('0x7'));var sox=require('sox');var csv=require(_0xcc2b('0x8'));var ejs=require(_0xcc2b('0x9'));var fs=require('fs');var fs_extra=require(_0xcc2b('0xa'));var _=require(_0xcc2b('0xb'));var squel=require('squel');var crypto=require(_0xcc2b('0xc'));var jsforce=require(_0xcc2b('0xd'));var deskjs=require(_0xcc2b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc2b('0xf'));var authService=require(_0xcc2b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc2b('0x11'));var logger=require(_0xcc2b('0x12'))(_0xcc2b('0x13'));var utils=require(_0xcc2b('0x14'));var config=require(_0xcc2b('0x15'));var licenseUtil=require(_0xcc2b('0x16'));var db=require(_0xcc2b('0x17'))['db'];function respondWithStatusCode(_0x1de27c,_0x17e196){_0x17e196=_0x17e196||0xcc;return function(_0x124553){if(_0x124553){return _0x1de27c[_0xcc2b('0x18')](_0x17e196);}return _0x1de27c['status'](_0x17e196)[_0xcc2b('0x19')]();};}function respondWithResult(_0x56ba6a,_0x5cf089){_0x5cf089=_0x5cf089||0xc8;return function(_0xfaddb8){if(_0xfaddb8){return _0x56ba6a[_0xcc2b('0x1a')](_0x5cf089)[_0xcc2b('0x1b')](_0xfaddb8);}};}function respondWithFilteredResult(_0x55ea90,_0x4d8eeb){return function(_0x593fd5){if(_0x593fd5){var _0x347f66=typeof _0x4d8eeb[_0xcc2b('0x1c')]==='undefined'&&typeof _0x4d8eeb[_0xcc2b('0x1d')]==='undefined';var _0xd68cfe=_0x593fd5['count'];var _0x12f71d=_0x347f66?0x0:_0x4d8eeb[_0xcc2b('0x1c')];var _0x1356d2=_0x347f66?_0x593fd5[_0xcc2b('0x1e')]:_0x4d8eeb[_0xcc2b('0x1c')]+_0x4d8eeb[_0xcc2b('0x1d')];var _0x22ad92;if(_0x1356d2>=_0xd68cfe){_0x1356d2=_0xd68cfe;_0x22ad92=0xc8;}else{_0x22ad92=0xce;}_0x55ea90[_0xcc2b('0x1a')](_0x22ad92);return _0x55ea90[_0xcc2b('0x1f')](_0xcc2b('0x20'),_0x12f71d+'-'+_0x1356d2+'/'+_0xd68cfe)[_0xcc2b('0x1b')](_0x593fd5);}return null;};}function patchUpdates(_0x3df0fc){return function(_0x5f3dcd){try{jsonpatch[_0xcc2b('0x21')](_0x5f3dcd,_0x3df0fc,!![]);}catch(_0x52c601){return BPromise[_0xcc2b('0x22')](_0x52c601);}return _0x5f3dcd[_0xcc2b('0x23')]();};}function saveUpdates(_0x4d0a5c,_0x4a037e){return function(_0x35b60d){if(_0x35b60d){return _0x35b60d[_0xcc2b('0x24')](_0x4d0a5c)['then'](function(_0xb9ae5c){return _0xb9ae5c;});}return null;};}function removeEntity(_0xd0d805,_0x50f385){return function(_0x3b30e7){if(_0x3b30e7){return _0x3b30e7['destroy']()[_0xcc2b('0x25')](function(){var _0x5a49e7=_0x3b30e7[_0xcc2b('0x26')]({'plain':!![]});var _0x49850=_0xcc2b('0x27');return db[_0xcc2b('0x28')][_0xcc2b('0x29')]({'where':{'type':_0x49850,'resourceId':_0x5a49e7['id']}})[_0xcc2b('0x25')](function(){return _0x3b30e7;});})['then'](function(){_0xd0d805['status'](0xcc)[_0xcc2b('0x19')]();});}};}function handleEntityNotFound(_0x5f8161,_0x76af9d){return function(_0x132efb){if(!_0x132efb){_0x5f8161[_0xcc2b('0x18')](0x194);}return _0x132efb;};}function handleError(_0x4d5858,_0x51a8c7){_0x51a8c7=_0x51a8c7||0x1f4;return function(_0x34e436){logger[_0xcc2b('0x2a')](_0x34e436[_0xcc2b('0x2b')]);if(_0x34e436['name']){delete _0x34e436[_0xcc2b('0x2c')];}_0x4d5858['status'](_0x51a8c7)[_0xcc2b('0x2d')](_0x34e436);};}exports[_0xcc2b('0x2e')]=function(_0x2b14d9,_0x41381a){var _0x25962e={},_0x5dec43={},_0x128f5a={'count':0x0,'rows':[]};return db['CmCompany'][_0xcc2b('0x2f')]()[_0xcc2b('0x25')](function(_0x198a80){_0x5dec43[_0xcc2b('0x30')]=_[_0xcc2b('0x31')](_0x198a80);_0x5dec43['query']=_[_0xcc2b('0x31')](_0x2b14d9['query']);_0x5dec43['filters']=_[_0xcc2b('0x32')](_0x5dec43['model'],_0x5dec43['query']);_0x25962e[_0xcc2b('0x33')]=_[_0xcc2b('0x32')](_0x5dec43[_0xcc2b('0x30')],qs['fields'](_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x35')]));_0x25962e[_0xcc2b('0x33')]=_0x25962e[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0x25962e[_0xcc2b('0x33')]:_0x5dec43[_0xcc2b('0x30')];if(!_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x37')]('nolimit')){_0x25962e['limit']=qs[_0xcc2b('0x1d')](_0x2b14d9[_0xcc2b('0x34')]['limit']);_0x25962e[_0xcc2b('0x1c')]=qs[_0xcc2b('0x1c')](_0x2b14d9['query'][_0xcc2b('0x1c')]);}_0x25962e[_0xcc2b('0x38')]=qs[_0xcc2b('0x39')](_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x39')]);_0x25962e['where']=qs[_0xcc2b('0x3a')](_['pick'](_0x2b14d9[_0xcc2b('0x34')],_0x5dec43[_0xcc2b('0x3a')]),_0x198a80);if(_0x2b14d9['query'][_0xcc2b('0x3b')]){_0x25962e[_0xcc2b('0x3c')]=_['merge'](_0x25962e['where'],{'$or':_['map'](_0x25962e[_0xcc2b('0x33')],function(_0x16d0d8){var _0x16222a={};_0x16222a[_0x16d0d8]={'$like':'%'+_0x2b14d9['query'][_0xcc2b('0x3b')]+'%'};return _0x16222a;})});}_0x25962e=_[_0xcc2b('0x3d')]({},_0x25962e,_0x2b14d9[_0xcc2b('0x3e')]);var _0x471a5e={'where':_0x25962e['where']};return db[_0xcc2b('0x3f')][_0xcc2b('0x1e')](_0x471a5e)[_0xcc2b('0x25')](function(_0xf9647f){_0x128f5a[_0xcc2b('0x1e')]=_0xf9647f;if(_0x2b14d9['query'][_0xcc2b('0x40')]){_0x25962e['include']=[{'all':!![]}];}return db['CmCompany'][_0xcc2b('0x41')](_0x25962e);})[_0xcc2b('0x25')](function(_0x1c8bc7){_0x128f5a[_0xcc2b('0x42')]=_0x1c8bc7;return _0x128f5a;})[_0xcc2b('0x25')](respondWithFilteredResult(_0x41381a,_0x25962e))[_0xcc2b('0x43')](handleError(_0x41381a,null));})[_0xcc2b('0x43')](handleError(_0x41381a,null));};exports[_0xcc2b('0x44')]=function(_0x452fb,_0x1cdbc6){var _0xfc15a2={'raw':![],'where':{'id':_0x452fb[_0xcc2b('0x45')]['id']}},_0x1bc373={};_0x1bc373[_0xcc2b('0x30')]=_[_0xcc2b('0x31')](db[_0xcc2b('0x3f')][_0xcc2b('0x46')]);_0x1bc373['query']=_[_0xcc2b('0x31')](_0x452fb['query']);_0x1bc373[_0xcc2b('0x3a')]=_['intersection'](_0x1bc373[_0xcc2b('0x30')],_0x1bc373['query']);_0xfc15a2['attributes']=_[_0xcc2b('0x32')](_0x1bc373[_0xcc2b('0x30')],qs[_0xcc2b('0x35')](_0x452fb['query']['fields']));_0xfc15a2[_0xcc2b('0x33')]=_0xfc15a2[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0xfc15a2[_0xcc2b('0x33')]:_0x1bc373['model'];if(_0x452fb[_0xcc2b('0x34')][_0xcc2b('0x40')]){_0xfc15a2[_0xcc2b('0x47')]=[{'all':!![]}];}_0xfc15a2=_[_0xcc2b('0x3d')]({},_0xfc15a2,_0x452fb[_0xcc2b('0x3e')]);return db['CmCompany'][_0xcc2b('0x48')](_0xfc15a2)['then'](handleEntityNotFound(_0x1cdbc6,null))[_0xcc2b('0x25')](respondWithResult(_0x1cdbc6,null))[_0xcc2b('0x43')](handleError(_0x1cdbc6,null));};exports[_0xcc2b('0x49')]=function(_0x39b934,_0x53f480){return db[_0xcc2b('0x3f')][_0xcc2b('0x49')](_0x39b934[_0xcc2b('0x4a')],{})[_0xcc2b('0x25')](function(_0x38cac6){var _0x46d5ce=_0x39b934[_0xcc2b('0x4b')]['get']({'plain':!![]});if(!_0x46d5ce)throw new Error(_0xcc2b('0x4c'));if(_0x46d5ce['role']===_0xcc2b('0x4b')){var _0x2dd09a=_0x38cac6[_0xcc2b('0x26')]({'plain':!![]});var _0x4e4193=_0xcc2b('0x27');return db[_0xcc2b('0x4d')]['find']({'where':{'name':_0x4e4193,'userProfileId':_0x46d5ce[_0xcc2b('0x4e')]},'raw':!![]})[_0xcc2b('0x25')](function(_0x440d32){if(_0x440d32&&_0x440d32[_0xcc2b('0x4f')]===0x0){return db['UserProfileResource'][_0xcc2b('0x49')]({'name':_0x2dd09a[_0xcc2b('0x2c')],'resourceId':_0x2dd09a['id'],'type':_0x440d32[_0xcc2b('0x2c')],'sectionId':_0x440d32['id']},{})[_0xcc2b('0x25')](function(){return _0x38cac6;});}else{return _0x38cac6;}})[_0xcc2b('0x43')](function(_0x1fbfd7){logger[_0xcc2b('0x2a')](_0xcc2b('0x50'),_0x1fbfd7);throw _0x1fbfd7;});}return _0x38cac6;})[_0xcc2b('0x25')](respondWithResult(_0x53f480,0xc9))['catch'](handleError(_0x53f480,null));};exports[_0xcc2b('0x24')]=function(_0x35ef03,_0x1bb6ef){if(_0x35ef03[_0xcc2b('0x4a')]['id']){delete _0x35ef03[_0xcc2b('0x4a')]['id'];}return db[_0xcc2b('0x3f')]['find']({'where':{'id':_0x35ef03['params']['id']}})[_0xcc2b('0x25')](handleEntityNotFound(_0x1bb6ef,null))[_0xcc2b('0x25')](saveUpdates(_0x35ef03[_0xcc2b('0x4a')],null))[_0xcc2b('0x25')](respondWithResult(_0x1bb6ef,null))[_0xcc2b('0x43')](handleError(_0x1bb6ef,null));};exports['destroy']=function(_0x155ff3,_0x5463e2){return db['CmCompany'][_0xcc2b('0x48')]({'where':{'id':_0x155ff3[_0xcc2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5463e2,null))['then'](removeEntity(_0x5463e2,null))[_0xcc2b('0x43')](handleError(_0x5463e2,null));};exports[_0xcc2b('0x2f')]=function(_0x3565bc,_0xaa1892){return db[_0xcc2b('0x3f')][_0xcc2b('0x2f')]()[_0xcc2b('0x25')](respondWithResult(_0xaa1892,null))[_0xcc2b('0x43')](handleError(_0xaa1892,null));};exports[_0xcc2b('0x51')]=function(_0x54e4d0,_0x401f97,_0x55eae0){return db[_0xcc2b('0x52')][_0xcc2b('0x48')]({'where':{'id':_0x54e4d0[_0xcc2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x401f97,null))[_0xcc2b('0x25')](function(_0x2b502b){if(_0x2b502b){return _0x2b502b[_0xcc2b('0x51')](_0x54e4d0[_0xcc2b('0x4a')][_0xcc2b('0x53')],_[_0xcc2b('0x54')](_0x54e4d0['body'],[_0xcc2b('0x53'),'id'])||{});}})['then'](respondWithResult(_0x401f97,null))[_0xcc2b('0x43')](handleError(_0x401f97,null));};exports[_0xcc2b('0x55')]=function(_0xb1ecc5,_0x3faa84,_0x3bce32){var _0x42c5d5={};var _0x3d236c={};var _0x5e5a1f;var _0x314345;return db[_0xcc2b('0x3f')][_0xcc2b('0x56')]({'where':{'id':_0xb1ecc5[_0xcc2b('0x45')]['id']}})[_0xcc2b('0x25')](handleEntityNotFound(_0x3faa84,null))[_0xcc2b('0x25')](function(_0x3a71dc){if(_0x3a71dc){_0x5e5a1f=_0x3a71dc;_0x3d236c['model']=_[_0xcc2b('0x31')](db[_0xcc2b('0x52')][_0xcc2b('0x46')]);_0x3d236c[_0xcc2b('0x34')]=_[_0xcc2b('0x31')](_0xb1ecc5[_0xcc2b('0x34')]);_0x3d236c[_0xcc2b('0x3a')]=_['intersection'](_0x3d236c[_0xcc2b('0x30')],_0x3d236c[_0xcc2b('0x34')]);_0x42c5d5[_0xcc2b('0x33')]=_[_0xcc2b('0x32')](_0x3d236c['model'],qs[_0xcc2b('0x35')](_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x35')]));_0x42c5d5[_0xcc2b('0x33')]=_0x42c5d5[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0x42c5d5['attributes']:_0x3d236c[_0xcc2b('0x30')];_0x42c5d5[_0xcc2b('0x38')]=qs[_0xcc2b('0x39')](_0xb1ecc5['query'][_0xcc2b('0x39')]);_0x42c5d5['where']=qs[_0xcc2b('0x3a')](_['pick'](_0xb1ecc5[_0xcc2b('0x34')],_0x3d236c['filters']));if(_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x3b')]){_0x42c5d5['where']=_[_0xcc2b('0x3d')](_0x42c5d5[_0xcc2b('0x3c')],{'$or':_[_0xcc2b('0x57')](_0x42c5d5[_0xcc2b('0x33')],function(_0x366df1){var _0x106489={};_0x106489[_0x366df1]={'$like':'%'+_0xb1ecc5[_0xcc2b('0x34')]['filter']+'%'};return _0x106489;})});}_0x42c5d5=_[_0xcc2b('0x3d')]({},_0x42c5d5,_0xb1ecc5[_0xcc2b('0x3e')]);return _0x5e5a1f[_0xcc2b('0x55')](_0x42c5d5);}})['then'](function(_0x2d6ac3){if(_0x2d6ac3){_0x314345=_0x2d6ac3[_0xcc2b('0x36')];if(!_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x37')](_0xcc2b('0x58'))){_0x42c5d5[_0xcc2b('0x1d')]=qs['limit'](_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x1d')]);_0x42c5d5[_0xcc2b('0x1c')]=qs[_0xcc2b('0x1c')](_0xb1ecc5['query'][_0xcc2b('0x1c')]);}return _0x5e5a1f[_0xcc2b('0x55')](_0x42c5d5);}})['then'](function(_0x21b0b8){if(_0x21b0b8){return _0x21b0b8?{'count':_0x314345,'rows':_0x21b0b8}:null;}})[_0xcc2b('0x25')](respondWithResult(_0x3faa84,null))[_0xcc2b('0x43')](handleError(_0x3faa84,null));}; \ No newline at end of file +var _0x26a0=['merge','map','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','get','Companies','UserProfileResource','then','end','error','stack','name','send','index','CmCompany','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x26a0,0xc3));var _0x026a=function(_0x28dcd3,_0x33e8d0){_0x28dcd3=_0x28dcd3-0x0;var _0x44e5db=_0x26a0[_0x28dcd3];return _0x44e5db;};'use strict';var emlformat=require(_0x026a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x026a('0x1'));var rp=require(_0x026a('0x2'));var moment=require('moment');var BPromise=require(_0x026a('0x3'));var Mustache=require(_0x026a('0x4'));var util=require(_0x026a('0x5'));var path=require(_0x026a('0x6'));var sox=require(_0x026a('0x7'));var csv=require(_0x026a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x026a('0x9'));var _=require('lodash');var squel=require(_0x026a('0xa'));var crypto=require(_0x026a('0xb'));var jsforce=require(_0x026a('0xc'));var deskjs=require(_0x026a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026a('0xe'));var authService=require(_0x026a('0xf'));var qs=require(_0x026a('0x10'));var as=require(_0x026a('0x11'));var hardwareService=require(_0x026a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x026a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x026a('0x14'))['db'];function respondWithStatusCode(_0x513565,_0x31b8fc){_0x31b8fc=_0x31b8fc||0xcc;return function(_0x4b8475){if(_0x4b8475){return _0x513565[_0x026a('0x15')](_0x31b8fc);}return _0x513565[_0x026a('0x16')](_0x31b8fc)['end']();};}function respondWithResult(_0x1eb5b6,_0x1e0a3e){_0x1e0a3e=_0x1e0a3e||0xc8;return function(_0x1a43e6){if(_0x1a43e6){return _0x1eb5b6[_0x026a('0x16')](_0x1e0a3e)[_0x026a('0x17')](_0x1a43e6);}};}function respondWithFilteredResult(_0x1497e5,_0x44c66f){return function(_0xb66623){if(_0xb66623){var _0x43fed2=typeof _0x44c66f['offset']===_0x026a('0x18')&&typeof _0x44c66f[_0x026a('0x19')]===_0x026a('0x18');var _0x331603=_0xb66623['count'];var _0x1d5ebf=_0x43fed2?0x0:_0x44c66f[_0x026a('0x1a')];var _0xbcb4ff=_0x43fed2?_0xb66623[_0x026a('0x1b')]:_0x44c66f[_0x026a('0x1a')]+_0x44c66f['limit'];var _0x11be86;if(_0xbcb4ff>=_0x331603){_0xbcb4ff=_0x331603;_0x11be86=0xc8;}else{_0x11be86=0xce;}_0x1497e5[_0x026a('0x16')](_0x11be86);return _0x1497e5['set'](_0x026a('0x1c'),_0x1d5ebf+'-'+_0xbcb4ff+'/'+_0x331603)[_0x026a('0x17')](_0xb66623);}return null;};}function patchUpdates(_0x2a4449){return function(_0x2cfdb8){try{jsonpatch[_0x026a('0x1d')](_0x2cfdb8,_0x2a4449,!![]);}catch(_0x277feb){return BPromise[_0x026a('0x1e')](_0x277feb);}return _0x2cfdb8[_0x026a('0x1f')]();};}function saveUpdates(_0x1f39cc,_0x3aa886){return function(_0x5560bb){if(_0x5560bb){return _0x5560bb[_0x026a('0x20')](_0x1f39cc)['then'](function(_0x58de78){return _0x58de78;});}return null;};}function removeEntity(_0x29bf50,_0x12c6be){return function(_0x50e113){if(_0x50e113){return _0x50e113[_0x026a('0x21')]()['then'](function(){var _0x532a32=_0x50e113[_0x026a('0x22')]({'plain':!![]});var _0x215956=_0x026a('0x23');return db[_0x026a('0x24')]['destroy']({'where':{'type':_0x215956,'resourceId':_0x532a32['id']}})[_0x026a('0x25')](function(){return _0x50e113;});})[_0x026a('0x25')](function(){_0x29bf50[_0x026a('0x16')](0xcc)[_0x026a('0x26')]();});}};}function handleEntityNotFound(_0x2c9c0f,_0x1dbbec){return function(_0x9ac4e6){if(!_0x9ac4e6){_0x2c9c0f[_0x026a('0x15')](0x194);}return _0x9ac4e6;};}function handleError(_0x287a31,_0x4eb141){_0x4eb141=_0x4eb141||0x1f4;return function(_0x1f96e8){logger[_0x026a('0x27')](_0x1f96e8[_0x026a('0x28')]);if(_0x1f96e8[_0x026a('0x29')]){delete _0x1f96e8[_0x026a('0x29')];}_0x287a31[_0x026a('0x16')](_0x4eb141)[_0x026a('0x2a')](_0x1f96e8);};}exports[_0x026a('0x2b')]=function(_0x4f7d29,_0x5e6ec4){var _0x468576={},_0x39bad2={},_0x1e4f06={'count':0x0,'rows':[]};return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](function(_0x3a6530){_0x39bad2[_0x026a('0x2d')]=_['keys'](_0x3a6530);_0x39bad2[_0x026a('0x2e')]=_['keys'](_0x4f7d29[_0x026a('0x2e')]);_0x39bad2[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x39bad2[_0x026a('0x2d')],_0x39bad2[_0x026a('0x2e')]);_0x468576['attributes']=_['intersection'](_0x39bad2[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4f7d29['query'][_0x026a('0x31')]));_0x468576[_0x026a('0x32')]=_0x468576[_0x026a('0x32')][_0x026a('0x33')]?_0x468576[_0x026a('0x32')]:_0x39bad2[_0x026a('0x2d')];if(!_0x4f7d29[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x468576['limit']=qs[_0x026a('0x19')](_0x4f7d29[_0x026a('0x2e')]['limit']);_0x468576[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x4f7d29[_0x026a('0x2e')][_0x026a('0x1a')]);}_0x468576[_0x026a('0x35')]=qs[_0x026a('0x36')](_0x4f7d29[_0x026a('0x2e')]['sort']);_0x468576[_0x026a('0x37')]=qs[_0x026a('0x2f')](_['pick'](_0x4f7d29['query'],_0x39bad2['filters']),_0x3a6530);if(_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]){_0x468576['where']=_[_0x026a('0x39')](_0x468576[_0x026a('0x37')],{'$or':_[_0x026a('0x3a')](_0x468576[_0x026a('0x32')],function(_0x2be8fb){var _0xea8032={};_0xea8032[_0x2be8fb]={'$like':'%'+_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0xea8032;})});}_0x468576=_['merge']({},_0x468576,_0x4f7d29[_0x026a('0x3b')]);var _0x4352f5={'where':_0x468576[_0x026a('0x37')]};return db['CmCompany'][_0x026a('0x1b')](_0x4352f5)['then'](function(_0x307a55){_0x1e4f06[_0x026a('0x1b')]=_0x307a55;if(_0x4f7d29[_0x026a('0x2e')]['includeAll']){_0x468576[_0x026a('0x3c')]=[{'all':!![]}];}return db[_0x026a('0x2c')]['findAll'](_0x468576);})[_0x026a('0x25')](function(_0x4e1fdd){_0x1e4f06[_0x026a('0x3d')]=_0x4e1fdd;return _0x1e4f06;})['then'](respondWithFilteredResult(_0x5e6ec4,_0x468576))[_0x026a('0x3e')](handleError(_0x5e6ec4,null));})[_0x026a('0x3e')](handleError(_0x5e6ec4,null));};exports[_0x026a('0x3f')]=function(_0x4e434c,_0x75f796){var _0x35ebbd={'raw':![],'where':{'id':_0x4e434c[_0x026a('0x40')]['id']}},_0x2d5206={};_0x2d5206[_0x026a('0x2d')]=_[_0x026a('0x41')](db[_0x026a('0x2c')][_0x026a('0x42')]);_0x2d5206[_0x026a('0x2e')]=_[_0x026a('0x41')](_0x4e434c[_0x026a('0x2e')]);_0x2d5206[_0x026a('0x2f')]=_['intersection'](_0x2d5206['model'],_0x2d5206['query']);_0x35ebbd[_0x026a('0x32')]=_[_0x026a('0x30')](_0x2d5206[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4e434c[_0x026a('0x2e')]['fields']));_0x35ebbd[_0x026a('0x32')]=_0x35ebbd[_0x026a('0x32')][_0x026a('0x33')]?_0x35ebbd['attributes']:_0x2d5206['model'];if(_0x4e434c[_0x026a('0x2e')][_0x026a('0x43')]){_0x35ebbd[_0x026a('0x3c')]=[{'all':!![]}];}_0x35ebbd=_['merge']({},_0x35ebbd,_0x4e434c['options']);return db[_0x026a('0x2c')][_0x026a('0x44')](_0x35ebbd)[_0x026a('0x25')](handleEntityNotFound(_0x75f796,null))['then'](respondWithResult(_0x75f796,null))['catch'](handleError(_0x75f796,null));};exports[_0x026a('0x45')]=function(_0x1b8948,_0x196b6e){return db[_0x026a('0x2c')][_0x026a('0x45')](_0x1b8948[_0x026a('0x46')],{})['then'](function(_0x3202e4){var _0x5b0e77=_0x1b8948[_0x026a('0x47')]['get']({'plain':!![]});if(!_0x5b0e77)throw new Error(_0x026a('0x48'));if(_0x5b0e77['role']===_0x026a('0x47')){var _0x39f54b=_0x3202e4[_0x026a('0x22')]({'plain':!![]});var _0x2960d6=_0x026a('0x23');return db[_0x026a('0x49')][_0x026a('0x44')]({'where':{'name':_0x2960d6,'userProfileId':_0x5b0e77['userProfileId']},'raw':!![]})[_0x026a('0x25')](function(_0x61bef4){if(_0x61bef4&&_0x61bef4[_0x026a('0x4a')]===0x0){return db['UserProfileResource'][_0x026a('0x45')]({'name':_0x39f54b[_0x026a('0x29')],'resourceId':_0x39f54b['id'],'type':_0x61bef4['name'],'sectionId':_0x61bef4['id']},{})[_0x026a('0x25')](function(){return _0x3202e4;});}else{return _0x3202e4;}})['catch'](function(_0x51f5ea){logger[_0x026a('0x27')](_0x026a('0x4b'),_0x51f5ea);throw _0x51f5ea;});}return _0x3202e4;})['then'](respondWithResult(_0x196b6e,0xc9))[_0x026a('0x3e')](handleError(_0x196b6e,null));};exports[_0x026a('0x20')]=function(_0x1ddc7a,_0x54b4be){if(_0x1ddc7a['body']['id']){delete _0x1ddc7a[_0x026a('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x1ddc7a['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x54b4be,null))[_0x026a('0x25')](saveUpdates(_0x1ddc7a[_0x026a('0x46')],null))[_0x026a('0x25')](respondWithResult(_0x54b4be,null))[_0x026a('0x3e')](handleError(_0x54b4be,null));};exports['destroy']=function(_0x7d9d1d,_0x248bdd){return db[_0x026a('0x2c')][_0x026a('0x44')]({'where':{'id':_0x7d9d1d[_0x026a('0x40')]['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x248bdd,null))[_0x026a('0x25')](removeEntity(_0x248bdd,null))[_0x026a('0x3e')](handleError(_0x248bdd,null));};exports[_0x026a('0x4c')]=function(_0x5ba3d8,_0x179adc){return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](respondWithResult(_0x179adc,null))['catch'](handleError(_0x179adc,null));};exports[_0x026a('0x4d')]=function(_0x1e0b91,_0xd69b52,_0x183e5d){return db[_0x026a('0x4e')][_0x026a('0x44')]({'where':{'id':_0x1e0b91['params']['id']}})['then'](handleEntityNotFound(_0xd69b52,null))['then'](function(_0x2951bb){if(_0x2951bb){return _0x2951bb[_0x026a('0x4d')](_0x1e0b91[_0x026a('0x46')][_0x026a('0x4f')],_[_0x026a('0x50')](_0x1e0b91['body'],[_0x026a('0x4f'),'id'])||{});}})[_0x026a('0x25')](respondWithResult(_0xd69b52,null))['catch'](handleError(_0xd69b52,null));};exports[_0x026a('0x51')]=function(_0x457ffa,_0x4c9db1,_0x1bf439){var _0x5d4eda={};var _0x333d00={};var _0x3955ee;var _0x1150c4;return db[_0x026a('0x2c')][_0x026a('0x52')]({'where':{'id':_0x457ffa['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x4c9db1,null))['then'](function(_0x40bc2c){if(_0x40bc2c){_0x3955ee=_0x40bc2c;_0x333d00[_0x026a('0x2d')]=_[_0x026a('0x41')](db['CmContact'][_0x026a('0x42')]);_0x333d00[_0x026a('0x2e')]=_['keys'](_0x457ffa['query']);_0x333d00[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x333d00['model'],_0x333d00[_0x026a('0x2e')]);_0x5d4eda[_0x026a('0x32')]=_['intersection'](_0x333d00['model'],qs[_0x026a('0x31')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x31')]));_0x5d4eda[_0x026a('0x32')]=_0x5d4eda[_0x026a('0x32')][_0x026a('0x33')]?_0x5d4eda[_0x026a('0x32')]:_0x333d00[_0x026a('0x2d')];_0x5d4eda['order']=qs[_0x026a('0x36')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x36')]);_0x5d4eda['where']=qs[_0x026a('0x2f')](_[_0x026a('0x53')](_0x457ffa[_0x026a('0x2e')],_0x333d00[_0x026a('0x2f')]));if(_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]){_0x5d4eda[_0x026a('0x37')]=_['merge'](_0x5d4eda['where'],{'$or':_[_0x026a('0x3a')](_0x5d4eda['attributes'],function(_0x138589){var _0x2fb5ea={};_0x2fb5ea[_0x138589]={'$like':'%'+_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0x2fb5ea;})});}_0x5d4eda=_[_0x026a('0x39')]({},_0x5d4eda,_0x457ffa[_0x026a('0x3b')]);return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})['then'](function(_0xfa49b4){if(_0xfa49b4){_0x1150c4=_0xfa49b4[_0x026a('0x33')];if(!_0x457ffa[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x5d4eda[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x19')]);_0x5d4eda[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x1a')]);}return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})[_0x026a('0x25')](function(_0x4d2704){if(_0x4d2704){return _0x4d2704?{'count':_0x1150c4,'rows':_0x4d2704}:null;}})[_0x026a('0x25')](respondWithResult(_0x4c9db1,null))[_0x026a('0x3e')](handleError(_0x4c9db1,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 852e4b6..a82e72a 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 _0x6d1c=['exports','define','CmCompany','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6d1c,0xd3));var _0xc6d1=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x6d1c[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0xc6d1('0x0'));var logger=require(_0xc6d1('0x1'))(_0xc6d1('0x2'));var moment=require(_0xc6d1('0x3'));var BPromise=require(_0xc6d1('0x4'));var rp=require(_0xc6d1('0x5'));var fs=require('fs');var path=require(_0xc6d1('0x6'));var rimraf=require(_0xc6d1('0x7'));var config=require(_0xc6d1('0x8'));var attributes=require(_0xc6d1('0x9'));module[_0xc6d1('0xa')]=function(_0x3743ce,_0x1e0578){return _0x3743ce[_0xc6d1('0xb')](_0xc6d1('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x496f=['request-promise','path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','moment','bluebird'];(function(_0x41a234,_0x572403){var _0x1219db=function(_0x30facf){while(--_0x30facf){_0x41a234['push'](_0x41a234['shift']());}};_0x1219db(++_0x572403);}(_0x496f,0x1c8));var _0xf496=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x496f[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xf496('0x0'));var util=require(_0xf496('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf496('0x2'));var BPromise=require(_0xf496('0x3'));var rp=require(_0xf496('0x4'));var fs=require('fs');var path=require(_0xf496('0x5'));var rimraf=require(_0xf496('0x6'));var config=require('../../config/environment');var attributes=require(_0xf496('0x7'));module[_0xf496('0x8')]=function(_0x4503d3,_0x3f98b5){return _0x4503d3['define']('CmCompany',attributes,{'tableName':_0xf496('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 8a802ab..cfa85d3 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 _0x9088=['http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','../../mysqldb','rpc','jayson/promise'];(function(_0x198099,_0x2b8ab1){var _0x111ae7=function(_0x49611f){while(--_0x49611f){_0x198099['push'](_0x198099['shift']());}};_0x111ae7(++_0x2b8ab1);}(_0x9088,0xdd));var _0x8908=function(_0x5d737d,_0x421884){_0x5d737d=_0x5d737d-0x0;var _0x29c646=_0x9088[_0x5d737d];return _0x29c646;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8908('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8908('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8908('0x2'));var config=require('../../config/environment');var jayson=require(_0x8908('0x3'));var client=jayson['client'][_0x8908('0x4')]({'port':0x232a});function respondWithRpcPromise(_0xf22cbc,_0x59ea19,_0x5abaf6){return new BPromise(function(_0x557384,_0x4f0197){return client['request'](_0xf22cbc,_0x5abaf6)[_0x8908('0x5')](function(_0xdaaf64){logger[_0x8908('0x6')](_0x8908('0x7'),_0x59ea19,_0x8908('0x8'));logger[_0x8908('0x9')](_0x8908('0xa'),_0x59ea19,_0x8908('0x8'),JSON['stringify'](_0xdaaf64));if(_0xdaaf64[_0x8908('0xb')]){if(_0xdaaf64[_0x8908('0xb')][_0x8908('0xc')]===0x1f4){logger[_0x8908('0xb')]('CmCompany,\x20%s,\x20%s',_0x59ea19,_0xdaaf64[_0x8908('0xb')][_0x8908('0xd')]);return _0x4f0197(_0xdaaf64[_0x8908('0xb')][_0x8908('0xd')]);}logger['error'](_0x8908('0x7'),_0x59ea19,_0xdaaf64[_0x8908('0xb')]['message']);return _0x557384(_0xdaaf64['error']['message']);}else{logger['info'](_0x8908('0x7'),_0x59ea19,_0x8908('0x8'));_0x557384(_0xdaaf64[_0x8908('0xe')][_0x8908('0xd')]);}})['catch'](function(_0x5cfe3e){logger[_0x8908('0xb')](_0x8908('0x7'),_0x59ea19,_0x5cfe3e);_0x4f0197(_0x5cfe3e);});});} \ No newline at end of file +var _0x568b=['then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x33d144,_0x4fc483){var _0x4ff4aa=function(_0x404bc9){while(--_0x404bc9){_0x33d144['push'](_0x33d144['shift']());}};_0x4ff4aa(++_0x4fc483);}(_0x568b,0x112));var _0xb568=function(_0x5107fc,_0x9c107d){_0x5107fc=_0x5107fc-0x0;var _0x4e6464=_0x568b[_0x5107fc];return _0x4e6464;};'use strict';var _=require(_0xb568('0x0'));var util=require(_0xb568('0x1'));var moment=require(_0xb568('0x2'));var BPromise=require(_0xb568('0x3'));var rs=require(_0xb568('0x4'));var fs=require('fs');var Redis=require(_0xb568('0x5'));var db=require(_0xb568('0x6'))['db'];var utils=require(_0xb568('0x7'));var logger=require(_0xb568('0x8'))('rpc');var config=require(_0xb568('0x9'));var jayson=require(_0xb568('0xa'));var client=jayson[_0xb568('0xb')][_0xb568('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x420913,_0x3a6da4,_0x51cd39){return new BPromise(function(_0x1f8227,_0x4c72ea){return client[_0xb568('0xd')](_0x420913,_0x51cd39)[_0xb568('0xe')](function(_0x3041c6){logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,_0xb568('0x11'));logger['debug'](_0xb568('0x12'),_0x3a6da4,'request\x20sent',JSON[_0xb568('0x13')](_0x3041c6));if(_0x3041c6[_0xb568('0x14')]){if(_0x3041c6[_0xb568('0x14')]['code']===0x1f4){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x4c72ea(_0x3041c6[_0xb568('0x14')][_0xb568('0x15')]);}logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x1f8227(_0x3041c6[_0xb568('0x14')]['message']);}else{logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,'request\x20sent');_0x1f8227(_0x3041c6[_0xb568('0x16')][_0xb568('0x15')]);}})[_0xb568('0x17')](function(_0x1805ba){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x1805ba);_0x4c72ea(_0x1805ba);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index f8d82ac..1af79d0 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 _0xa359=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','post','create','/:id/contacts','put','delete','destroy'];(function(_0x40b046,_0x27857f){var _0x1558d4=function(_0xbfd78f){while(--_0xbfd78f){_0x40b046['push'](_0x40b046['shift']());}};_0x1558d4(++_0x27857f);}(_0xa359,0x12c));var _0x9a35=function(_0x17aec5,_0x32c026){_0x17aec5=_0x17aec5-0x0;var _0x51b26d=_0xa359[_0x17aec5];return _0x51b26d;};'use strict';var multer=require(_0x9a35('0x0'));var util=require(_0x9a35('0x1'));var path=require('path');var timeout=require(_0x9a35('0x2'));var express=require(_0x9a35('0x3'));var router=express[_0x9a35('0x4')]();var fs_extra=require(_0x9a35('0x5'));var auth=require(_0x9a35('0x6'));var interaction=require(_0x9a35('0x7'));var config=require(_0x9a35('0x8'));var controller=require(_0x9a35('0x9'));router[_0x9a35('0xa')]('/',auth[_0x9a35('0xb')](),controller[_0x9a35('0xc')]);router[_0x9a35('0xa')]('/describe',auth[_0x9a35('0xb')](),controller[_0x9a35('0xd')]);router[_0x9a35('0xa')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller[_0x9a35('0xf')]);router[_0x9a35('0xa')]('/:id/contacts',auth[_0x9a35('0xb')](),controller['getContacts']);router[_0x9a35('0x10')]('/',auth[_0x9a35('0xb')](),controller[_0x9a35('0x11')]);router[_0x9a35('0x10')](_0x9a35('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0x9a35('0x13')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller['update']);router[_0x9a35('0x14')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller[_0x9a35('0x15')]);module[_0x9a35('0x16')]=router; \ No newline at end of file +var _0xab50=['update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/contacts','getContacts','post','create','/:id'];(function(_0x1ed482,_0x308d08){var _0x488557=function(_0x4a5dc2){while(--_0x4a5dc2){_0x1ed482['push'](_0x1ed482['shift']());}};_0x488557(++_0x308d08);}(_0xab50,0x1e3));var _0x0ab5=function(_0x701bd8,_0x1a792f){_0x701bd8=_0x701bd8-0x0;var _0x2aa48b=_0xab50[_0x701bd8];return _0x2aa48b;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require('path');var timeout=require(_0x0ab5('0x2'));var express=require('express');var router=express[_0x0ab5('0x3')]();var fs_extra=require(_0x0ab5('0x4'));var auth=require(_0x0ab5('0x5'));var interaction=require(_0x0ab5('0x6'));var config=require(_0x0ab5('0x7'));var controller=require('./cmCompany.controller');router[_0x0ab5('0x8')]('/',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xa')]);router[_0x0ab5('0x8')]('/describe',auth[_0x0ab5('0x9')](),controller['describe']);router[_0x0ab5('0x8')]('/:id',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xb')]);router[_0x0ab5('0x8')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xd')]);router[_0x0ab5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0ab5('0xf')]);router[_0x0ab5('0xe')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller['addContacts']);router['put'](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0x11')]);router[_0x0ab5('0x12')](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller['destroy']);module[_0x0ab5('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7810142..306e761 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 _0x6f13=['STRING','TEXT','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x432616,_0x5211f1){var _0xbb21ef=function(_0x2106af){while(--_0x2106af){_0x432616['push'](_0x432616['shift']());}};_0xbb21ef(++_0x5211f1);}(_0x6f13,0xe5));var _0x36f1=function(_0x5c6670,_0x46f467){_0x5c6670=_0x5c6670-0x0;var _0x21e11a=_0x6f13[_0x5c6670];return _0x21e11a;};'use strict';var _=require('lodash');var Sequelize=require(_0x36f1('0x0'));module[_0x36f1('0x1')]={'firstName':{'type':Sequelize[_0x36f1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x36f1('0x2')]},'street':{'type':Sequelize[_0x36f1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x36f1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x36f1('0x2')]},'description':{'type':Sequelize[_0x36f1('0x3')]},'phone':{'type':Sequelize[_0x36f1('0x2')]},'mobile':{'type':Sequelize[_0x36f1('0x2')]},'fax':{'type':Sequelize[_0x36f1('0x2')]},'email':{'type':Sequelize[_0x36f1('0x2')]},'url':{'type':Sequelize[_0x36f1('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x36f1('0x2')]},'skype':{'type':Sequelize[_0x36f1('0x2')]},'teams':{'type':Sequelize[_0x36f1('0x2')]},'viber':{'type':Sequelize[_0x36f1('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x36f1('0x2')]},'telegram':{'type':Sequelize[_0x36f1('0x2')]},'UserId':{'type':Sequelize[_0x36f1('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x36f1('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x36f1('0x5')],'defaultValue':Sequelize[_0x36f1('0x6')]},'dialTimezone':{'type':Sequelize[_0x36f1('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdc66=['UNSIGNED','NOW','sequelize','STRING','TEXT','INTEGER'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xdc66,0x1e2));var _0x6dc6=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0xdc66[_0x48845d];return _0x5bad7d;};'use strict';var _=require('lodash');var Sequelize=require(_0x6dc6('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6dc6('0x1')]},'postalCode':{'type':Sequelize[_0x6dc6('0x1')]},'city':{'type':Sequelize[_0x6dc6('0x1')]},'country':{'type':Sequelize[_0x6dc6('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6dc6('0x2')]},'phone':{'type':Sequelize[_0x6dc6('0x1')]},'mobile':{'type':Sequelize[_0x6dc6('0x1')]},'fax':{'type':Sequelize[_0x6dc6('0x1')]},'email':{'type':Sequelize[_0x6dc6('0x1')]},'url':{'type':Sequelize[_0x6dc6('0x1')]},'facebook':{'type':Sequelize[_0x6dc6('0x1')]},'fb_data':{'type':Sequelize[_0x6dc6('0x1')]},'twitter':{'type':Sequelize[_0x6dc6('0x1')]},'skype':{'type':Sequelize[_0x6dc6('0x1')]},'teams':{'type':Sequelize[_0x6dc6('0x1')]},'viber':{'type':Sequelize[_0x6dc6('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6dc6('0x1')]},'telegram':{'type':Sequelize[_0x6dc6('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6dc6('0x1')]},'priority':{'type':Sequelize[_0x6dc6('0x3')](0x2)[_0x6dc6('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x6dc6('0x5')]},'dialTimezone':{'type':Sequelize[_0x6dc6('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index f40ba88..f973b63 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 7bf00cd..454a9ff 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fc=['update','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x39035b,_0x381fb4){var _0x356b7a=function(_0x322478){while(--_0x322478){_0x39035b['push'](_0x39035b['shift']());}};_0x356b7a(++_0x381fb4);}(_0xe2fc,0x1bc));var _0xce2f=function(_0x39cd68,_0x6c4b05){_0x39cd68=_0x39cd68-0x0;var _0x268612=_0xe2fc[_0x39cd68];return _0x268612;};'use strict';var EventEmitter=require(_0xce2f('0x0'));var CmContact=require(_0xce2f('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xce2f('0x2')](0x0);var events={'afterCreate':_0xce2f('0x3'),'afterUpdate':_0xce2f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e8b02){return function(_0x5c24c5,_0x524663,_0x39510f){CmContactEvents['emit'](_0x3e8b02+':'+_0x5c24c5['id'],_0x5c24c5);CmContactEvents[_0xce2f('0x5')](_0x3e8b02,_0x5c24c5);_0x39510f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xce2f('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x5176=['../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xb1d65f,_0x5a87be){var _0x32de83=function(_0x32c256){while(--_0x32c256){_0xb1d65f['push'](_0xb1d65f['shift']());}};_0x32de83(++_0x5a87be);}(_0x5176,0x154));var _0x6517=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5176[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x6517('0x0'))['db'][_0x6517('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x6517('0x2')](0x0);var events={'afterCreate':_0x6517('0x3'),'afterUpdate':_0x6517('0x4'),'afterDestroy':_0x6517('0x5')};function emitEvent(_0x2013e0){return function(_0x58ed94,_0x353901,_0x5b1943){CmContactEvents[_0x6517('0x6')](_0x2013e0+':'+_0x58ed94['id'],_0x58ed94);CmContactEvents[_0x6517('0x6')](_0x2013e0,_0x58ed94);_0x5b1943(null);};}for(var e in events){if(events[_0x6517('0x7')](e)){var event=events[e];CmContact[_0x6517('0x8')](e,emitEvent(event));}}module[_0x6517('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3e577f5..ff2c2a5 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf821=['minutes','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','format','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','dialCheckDuplicateType','CmList','always','findAll','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','length','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','exports','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','then','timezones','utcOffset'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xf821,0x145));var _0x1f82=function(_0x190d2c,_0x159734){_0x190d2c=_0x190d2c-0x0;var _0x83d998=_0xf821[_0x190d2c];return _0x83d998;};'use strict';var _=require(_0x1f82('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1f82('0x1'));var rp=require(_0x1f82('0x2'));var fs=require('fs');var path=require(_0x1f82('0x3'));var rimraf=require('rimraf');var config=require(_0x1f82('0x4'));var shared=require(_0x1f82('0x5'));var attributes=require('./cmContact.attributes');module[_0x1f82('0x6')]=function(_0x3260fa,_0x5bc22f){return _0x3260fa['define'](_0x1f82('0x7'),attributes,{'tableName':_0x1f82('0x8'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x1f82('0x9')]},{'name':'fti_cm_contacts','fields':[_0x1f82('0xa'),_0x1f82('0xb'),_0x1f82('0x9'),_0x1f82('0xc'),_0x1f82('0xd'),_0x1f82('0xe')],'type':_0x1f82('0xf')}],'timestamps':!![],'charset':_0x1f82('0x10'),'collate':_0x1f82('0x11'),'hooks':{'afterCreate':function(_0x141c42,_0x71ec4c,_0x209a18){var _0x11cb15=_0x3260fa[_0x1f82('0x12')];var _0x243e4=_0x141c42[_0x1f82('0x13')]({'plain':!![]});function _0x28dc96(){return function(_0x18a083){logger[_0x1f82('0x14')]('cmContact',_0x1f82('0x15'),util[_0x1f82('0x16')](_0x18a083,{'showHidden':![],'depth':null}));};}function _0x1c49e2(_0x3ce6cd,_0x5a4b37){var _0x37b25c=_0x5a4b37['scheduledat']?_0x5a4b37[_0x1f82('0x17')]:moment()['format'](_0x1f82('0x18'));return new BPromise(function(_0x32904e,_0x371575){if(_[_0x1f82('0x19')](_0x5a4b37[_0x1f82('0x1a')])){_0x32904e({'ret':_0x37b25c});}else{_0x11cb15['VoiceQueue']['findOne']({'where':{'id':_0x3ce6cd['id']}})[_0x1f82('0x1b')](function(_0x1d4c40){if(!_[_0x1f82('0x19')](_0x1d4c40)){var _0x297c12=_0x1d4c40[_0x1f82('0x1a')];if(!_['isNil'](_0x297c12)){var _0x46b391=shared[_0x1f82('0x1c')];var _0x56d4f1=_0x46b391[_0x297c12];var _0x465be3=_0x46b391[_0x5a4b37['dialTimezone']];if(!_[_0x1f82('0x19')](_0x56d4f1)&&!_['isNil'](_0x465be3)){var _0x19841b=_0x56d4f1[_0x1f82('0x1d')]-_0x465be3[_0x1f82('0x1d')];_0x37b25c=_0x5a4b37[_0x1f82('0x17')]?_0x5a4b37['scheduledat']:moment();var _0x1effe4=moment(_0x37b25c)['add'](_0x19841b,_0x1f82('0x1e'));_0x32904e({'ret':_0x1effe4['format'](_0x1f82('0x18'))});}else _0x32904e({'ret':_0x37b25c});}else _0x32904e({'ret':_0x37b25c});}else{_0x32904e({'ret':_0x37b25c});}});}});return 0xa;}var _0x38e98e=function(_0x3a1302){return new BPromise(function(_0x438003,_0x56d903){_0x1c49e2(_0x3a1302,_0x243e4)[_0x1f82('0x1b')](function(_0x2e9063){_0x243e4[_0x1f82('0x17')]=_0x2e9063[_0x1f82('0x1f')];_0x11cb15[_0x1f82('0x20')][_0x1f82('0x21')]({'where':{'phone':_0x243e4[_0x1f82('0x9')],'VoiceQueueId':_0x3a1302['id']}})[_0x1f82('0x1b')](function(_0x133cb2){if(!_['isNil'](_0x133cb2)){throw new Error(_0x1f82('0x22')+_0x243e4['phone']+_0x1f82('0x23')+_0x3a1302['id']);}return _0x11cb15[_0x1f82('0x20')][_0x1f82('0x24')]({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'scheduledat':_0x243e4[_0x1f82('0x17')]?_0x243e4[_0x1f82('0x17')]:moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x243e4[_0x1f82('0x28')]?!![]:![],'callbackuniqueid':_0x243e4[_0x1f82('0x28')]?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4[_0x1f82('0x28')]?moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3a1302['id']});})['catch'](function(_0x47d67d){_0x56d903(_0x47d67d);});});});};var _0x38de45=function(_0x1d6e1c){return new BPromise(function(_0x56983b,_0x68c654){_0x1c49e2(_0x1d6e1c,_0x243e4)[_0x1f82('0x1b')](function(_0x598225){_0x243e4['scheduledat']=_0x598225['ret'];_0x11cb15['CmHopper'][_0x1f82('0x21')]({'where':{'phone':_0x243e4[_0x1f82('0x9')],'VoiceQueueId':_0x1d6e1c['id']}})[_0x1f82('0x1b')](function(_0x21f9c6){if(!_['isNil'](_0x21f9c6)){throw new Error('cmContact,\x20afterCreate\x20'+_0x243e4[_0x1f82('0x9')]+_0x1f82('0x29')+_0x1d6e1c['id']);}return _0x11cb15[_0x1f82('0x2a')][_0x1f82('0x21')]({'where':{'calleridnum':_0x243e4[_0x1f82('0x9')],'VoiceQueueId':_0x1d6e1c['id']}});})['then'](function(_0x53d783){if(!_[_0x1f82('0x19')](_0x53d783)){throw new Error(_0x1f82('0x2b')+_0x243e4[_0x1f82('0x9')]+_0x1f82('0x2c')+_0x1d6e1c['id']);}return _0x11cb15['CmHopper']['create']({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'scheduledat':_0x243e4[_0x1f82('0x17')]?_0x243e4[_0x1f82('0x17')]:moment()['format'](_0x1f82('0x18')),'callback':_0x243e4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x243e4[_0x1f82('0x28')]?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4['callbackUniqueid']?moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1d6e1c['id']});})[_0x1f82('0x2d')](function(_0x3a03aa){_0x68c654(_0x3a03aa);});});});};function _0x6643db(){return function(_0x36fa01){logger[_0x1f82('0x14')](_0x1f82('0x2e'),_0x1f82('0x15'),util[_0x1f82('0x16')](_0x36fa01,{'showHidden':![],'depth':null}));};}function _0x34e204(_0x795a82,_0x3b295c){var _0x317882=_0x3b295c['scheduledat']?_0x3b295c['scheduledat']:moment()[_0x1f82('0x27')](_0x1f82('0x18'));return new BPromise(function(_0x23b0ad,_0x509190){if(_['isNil'](_0x3b295c[_0x1f82('0x1a')])){_0x23b0ad({'ret':_0x317882});}else{_0x11cb15['Campaign'][_0x1f82('0x21')]({'where':{'id':_0x795a82['id']}})[_0x1f82('0x1b')](function(_0x4ac2e2){if(!_[_0x1f82('0x19')](_0x4ac2e2)){var _0x2eec6f=_0x4ac2e2['dialTimezone'];if(!_[_0x1f82('0x19')](_0x2eec6f)){var _0xfd29be=shared[_0x1f82('0x1c')];var _0x4c7ad6=_0xfd29be[_0x2eec6f];var _0x46edd0=_0xfd29be[_0x3b295c['dialTimezone']];if(!_[_0x1f82('0x19')](_0x4c7ad6)&&!_[_0x1f82('0x19')](_0x46edd0)){var _0xec1181=_0x4c7ad6[_0x1f82('0x1d')]-_0x46edd0['utcOffset'];_0x317882=_0x3b295c[_0x1f82('0x17')]?_0x3b295c[_0x1f82('0x17')]:moment();var _0x40210b=moment(_0x317882)['add'](_0xec1181,_0x1f82('0x1e'));_0x23b0ad({'ret':_0x40210b[_0x1f82('0x27')](_0x1f82('0x18'))});}else _0x23b0ad({'ret':_0x317882});}else _0x23b0ad({'ret':_0x317882});}else{_0x23b0ad({'ret':_0x317882});}});}});return 0xa;}var _0x472dac=function(_0x1384af){return new BPromise(function(_0x42436c,_0x3fca1c){_0x34e204(_0x1384af,_0x243e4)[_0x1f82('0x1b')](function(_0x3157f7){_0x243e4[_0x1f82('0x17')]=_0x3157f7['ret'];_0x11cb15[_0x1f82('0x20')][_0x1f82('0x21')]({'where':{'phone':_0x243e4['phone'],'CampaignId':_0x1384af['id']}})[_0x1f82('0x1b')](function(_0x2cf2ed){if(!_[_0x1f82('0x19')](_0x2cf2ed)){throw new Error('cmContact,\x20afterCreate\x20'+_0x243e4[_0x1f82('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1384af['id']);}return _0x11cb15[_0x1f82('0x20')]['create']({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'scheduledat':_0x243e4['scheduledat']?_0x243e4['scheduledat']:moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x243e4[_0x1f82('0x28')]?!![]:![],'callbackuniqueid':_0x243e4['callbackUniqueid']?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1384af['id']});})[_0x1f82('0x2d')](function(_0x284ff3){_0x3fca1c(_0x284ff3);});});});};var _0x42f87=function(_0x19c0d5){return new BPromise(function(_0x5b56e6,_0x162976){_0x34e204(_0x19c0d5,_0x243e4)['then'](function(_0x151dd7){_0x243e4[_0x1f82('0x17')]=_0x151dd7[_0x1f82('0x1f')];_0x11cb15[_0x1f82('0x20')][_0x1f82('0x21')]({'where':{'phone':_0x243e4[_0x1f82('0x9')],'CampaignId':_0x19c0d5['id']}})['then'](function(_0xe6c017){if(!_['isNil'](_0xe6c017)){throw new Error(_0x1f82('0x22')+_0x243e4['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x19c0d5['id']);}return _0x11cb15['CmHopperFinal'][_0x1f82('0x21')]({'where':{'calleridnum':_0x243e4[_0x1f82('0x9')],'CampaignId':_0x19c0d5['id']}});})[_0x1f82('0x1b')](function(_0x321209){if(!_[_0x1f82('0x19')](_0x321209)){throw new Error(_0x1f82('0x2b')+_0x243e4[_0x1f82('0x9')]+_0x1f82('0x2f')+_0x19c0d5['id']);}return _0x11cb15[_0x1f82('0x20')][_0x1f82('0x24')]({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'scheduledat':_0x243e4[_0x1f82('0x17')]?_0x243e4[_0x1f82('0x17')]:moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x243e4[_0x1f82('0x28')]?!![]:![],'callbackuniqueid':_0x243e4[_0x1f82('0x28')]?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4[_0x1f82('0x28')]?moment()[_0x1f82('0x27')](_0x1f82('0x18')):undefined,'CampaignId':_0x19c0d5['id']});})[_0x1f82('0x2d')](function(_0x1b823f){_0x162976(_0x1b823f);});});});};if(_0x243e4['ListId']){_0x11cb15[_0x1f82('0x30')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x1f82('0x31'),_0x1f82('0x1a')],'include':[{'model':_0x11cb15[_0x1f82('0x32')],'as':'Lists','where':{'id':_0x243e4[_0x1f82('0x25')]}}]})[_0x1f82('0x1b')](function(_0x210f18){if(_0x210f18){var _0x455359=[];for(var _0x515f51=0x0,_0x5ea600;_0x515f51<_0x210f18['length'];_0x515f51+=0x1){_0x5ea600=_0x210f18[_0x515f51][_0x1f82('0x13')]({'plain':!![]});switch(_0x5ea600[_0x1f82('0x31')]){case _0x1f82('0x33'):_0x38de45(_0x5ea600)['catch'](_0x28dc96());break;case'onlyIfOpen':_0x38e98e(_0x5ea600)[_0x1f82('0x2d')](_0x28dc96());break;default:_0x34e204(_0x5ea600,_0x243e4)[_0x1f82('0x1b')](function(_0x2ebeca){_0x243e4[_0x1f82('0x17')]=_0x2ebeca[_0x1f82('0x1f')];_0x11cb15[_0x1f82('0x20')]['create']({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'scheduledat':_0x243e4['scheduledat']?_0x243e4[_0x1f82('0x17')]:moment()['format'](_0x1f82('0x18')),'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'callback':_0x243e4[_0x1f82('0x28')]?!![]:![],'callbackuniqueid':_0x243e4[_0x1f82('0x28')]?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4[_0x1f82('0x28')]?moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x5ea600['id']})[_0x1f82('0x2d')](_0x28dc96());});}}}})[_0x1f82('0x1b')](function(){return _0x11cb15[_0x1f82('0x30')][_0x1f82('0x34')]({'where':{'type':_0x1f82('0x35')},'attributes':['id'],'include':[{'model':_0x11cb15[_0x1f82('0x32')],'as':_0x1f82('0x36'),'where':{'id':_0x243e4[_0x1f82('0x25')]}}]})[_0x1f82('0x1b')](function(_0x49127c){if(_0x49127c){var _0x15f3f0=[];for(var _0x216227=0x0,_0x19010e;_0x216227<_0x49127c['length'];_0x216227+=0x1){_0x19010e=_0x49127c[_0x216227][_0x1f82('0x13')]({'plain':!![]});_0x11cb15[_0x1f82('0x37')][_0x1f82('0x24')]({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'VoiceQueueId':_0x19010e['id']})['catch'](function(_0xfe225c){logger[_0x1f82('0x14')](_0x1f82('0x38'),_0x1f82('0x15'),_0xfe225c[_0x1f82('0x39')]);});}}});})[_0x1f82('0x1b')](function(){return _0x11cb15[_0x1f82('0x3a')][_0x1f82('0x34')]({'attributes':['id',_0x1f82('0x31'),_0x1f82('0x1a')],'include':[{'model':_0x11cb15[_0x1f82('0x32')],'as':_0x1f82('0x3b'),'where':{'id':_0x243e4['ListId']}}]})[_0x1f82('0x1b')](function(_0x301496){if(_0x301496){var _0x6a8ee1=[];for(var _0xf8f970=0x0,_0x576710;_0xf8f970<_0x301496['length'];_0xf8f970+=0x1){_0x576710=_0x301496[_0xf8f970][_0x1f82('0x13')]({'plain':!![]});switch(_0x576710['dialCheckDuplicateType']){case'always':_0x42f87(_0x576710)['catch'](_0x6643db());break;case'onlyIfOpen':_0x472dac(_0x576710)['catch'](_0x6643db());break;default:_0x11cb15['CmHopper']['create']({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'scheduledat':_0x243e4[_0x1f82('0x17')]?_0x243e4[_0x1f82('0x17')]:moment()[_0x1f82('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x243e4[_0x1f82('0x26')]?_0x243e4[_0x1f82('0x26')]:0x2,'callback':_0x243e4[_0x1f82('0x28')]?!![]:![],'callbackuniqueid':_0x243e4[_0x1f82('0x28')]?_0x243e4[_0x1f82('0x28')]:undefined,'callbackat':_0x243e4[_0x1f82('0x28')]?moment()['format'](_0x1f82('0x18')):undefined,'CampaignId':_0x576710['id']})[_0x1f82('0x2d')](_0x6643db());}}}});})[_0x1f82('0x1b')](function(){return _0x11cb15[_0x1f82('0x3a')][_0x1f82('0x34')]({'attributes':['id'],'include':[{'model':_0x11cb15[_0x1f82('0x32')],'as':_0x1f82('0x36'),'where':{'id':_0x243e4['ListId']}}]})[_0x1f82('0x1b')](function(_0x41efe7){if(_0x41efe7){var _0x3b97ca=[];for(var _0xe6e5c0=0x0,_0x225741;_0xe6e5c0<_0x41efe7[_0x1f82('0x3c')];_0xe6e5c0+=0x1){_0x225741=_0x41efe7[_0xe6e5c0][_0x1f82('0x13')]({'plain':!![]});_0x11cb15[_0x1f82('0x37')]['create']({'phone':_0x243e4[_0x1f82('0x9')],'ContactId':_0x243e4['id'],'ListId':_0x243e4[_0x1f82('0x25')],'CampaignId':_0x225741['id']})['catch'](function(_0x4576c4){logger[_0x1f82('0x14')](_0x1f82('0x38'),_0x1f82('0x15'),_0x4576c4[_0x1f82('0x39')]);});}}});})['then'](function(){_0x209a18();})[_0x1f82('0x2d')](function(_0x1a9f47){logger['error'](_0x1f82('0x38'),_0x1f82('0x15'),_0x1a9f47[_0x1f82('0x39')]);_0x209a18(_0x1a9f47);});}else{_0x209a18(new Error(_0x1f82('0x3d')));}},'afterDestroy':function(_0x307ac4,_0x2a817a,_0x353d77){var _0x25ed34=_0x3260fa['models'];var _0x48793b=_0x307ac4[_0x1f82('0x13')]({'plain':!![]});return _0x25ed34['CmHopper'][_0x1f82('0x34')]({'raw':!![],'where':{'ListId':_0x48793b[_0x1f82('0x25')],'ContactId':_0x48793b['id']}})[_0x1f82('0x1b')](function(_0x499cd7){if(!_[_0x1f82('0x3e')](_0x499cd7)){var _0x5f56be=[];for(var _0x1607d2=0x0;_0x1607d2<_0x499cd7[_0x1f82('0x3c')];_0x1607d2+=0x1){var _0x1735fb=_0x25ed34[_0x1f82('0x20')]['destroy']({'where':{'ListId':_0x499cd7[_0x1607d2][_0x1f82('0x25')],'ContactId':_0x499cd7[_0x1607d2][_0x1f82('0x3f')],'VoiceQueueId':_0x499cd7[_0x1607d2][_0x1f82('0x40')],'CampaignId':_0x499cd7[_0x1607d2][_0x1f82('0x41')]}});_0x5f56be[_0x1f82('0x42')](_0x1735fb);}return BPromise[_0x1f82('0x43')](_0x5f56be);}})['then'](function(_0xece853){logger[_0x1f82('0x44')](_0x1f82('0x45'),util[_0x1f82('0x16')](_0xece853,{'showHidden':![],'depth':null}));_0x353d77();})[_0x1f82('0x2d')](function(_0x1aa062){logger['error'](_0x1f82('0x46'),util['inspect'](_0x1aa062,{'showHidden':![],'depth':null}));_0x353d77(_0x1aa062);});}}});}; \ No newline at end of file +var _0x1d17=['dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','VoiceQueue','BlackLists','cmContact,\x20%s,\x20%s','Campaign','CmHopperBlack','message','List\x20not\x20found','isEmpty','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','get','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','timezones','utcOffset','add','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','format','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','cmContact','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1d17,0xe9));var _0x71d1=function(_0x21f5e6,_0x543eb5){_0x21f5e6=_0x21f5e6-0x0;var _0x338850=_0x1d17[_0x21f5e6];return _0x338850;};'use strict';var _=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var logger=require(_0x71d1('0x2'))(_0x71d1('0x3'));var moment=require(_0x71d1('0x4'));var BPromise=require(_0x71d1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71d1('0x6'));var rimraf=require(_0x71d1('0x7'));var config=require(_0x71d1('0x8'));var shared=require(_0x71d1('0x9'));var attributes=require(_0x71d1('0xa'));module['exports']=function(_0x54f07c,_0x184034){return _0x54f07c[_0x71d1('0xb')](_0x71d1('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x71d1('0xd'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x71d1('0xe'),_0x71d1('0xf'),'phone',_0x71d1('0x10'),_0x71d1('0x11'),_0x71d1('0x12')],'type':_0x71d1('0x13')}],'timestamps':!![],'charset':_0x71d1('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4c0361,_0x316dc4,_0x38773a){var _0x2c00b2=_0x54f07c[_0x71d1('0x15')];var _0x3d47c4=_0x4c0361[_0x71d1('0x16')]({'plain':!![]});function _0x26f39e(){return function(_0x4501c4){logger[_0x71d1('0x17')]('cmContact',_0x71d1('0x18'),util[_0x71d1('0x19')](_0x4501c4,{'showHidden':![],'depth':null}));};}function _0x46bccf(_0x2609c6,_0x2d6492){var _0x3096ab=_0x2d6492['scheduledat']?_0x2d6492[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b'));return new BPromise(function(_0x3e3ce9,_0x38cf7d){if(_['isNil'](_0x2d6492[_0x71d1('0x1c')])){_0x3e3ce9({'ret':_0x3096ab});}else{_0x2c00b2['VoiceQueue'][_0x71d1('0x1d')]({'where':{'id':_0x2609c6['id']}})[_0x71d1('0x1e')](function(_0x118f6f){if(!_[_0x71d1('0x1f')](_0x118f6f)){var _0x5f53c0=_0x118f6f['dialTimezone'];if(!_[_0x71d1('0x1f')](_0x5f53c0)){var _0x416100=shared[_0x71d1('0x20')];var _0x4e46ff=_0x416100[_0x5f53c0];var _0x3d6f6a=_0x416100[_0x2d6492['dialTimezone']];if(!_[_0x71d1('0x1f')](_0x4e46ff)&&!_[_0x71d1('0x1f')](_0x3d6f6a)){var _0x1e8aba=_0x4e46ff[_0x71d1('0x21')]-_0x3d6f6a['utcOffset'];_0x3096ab=_0x2d6492[_0x71d1('0x1a')]?_0x2d6492[_0x71d1('0x1a')]:moment();var _0x3fe3cb=moment(_0x3096ab)[_0x71d1('0x22')](_0x1e8aba,'minutes');_0x3e3ce9({'ret':_0x3fe3cb['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3e3ce9({'ret':_0x3096ab});}else _0x3e3ce9({'ret':_0x3096ab});}else{_0x3e3ce9({'ret':_0x3096ab});}});}});return 0xa;}var _0x18a2b0=function(_0x1298de){return new BPromise(function(_0x2a11e0,_0x42fb0b){_0x46bccf(_0x1298de,_0x3d47c4)['then'](function(_0x4e7d3e){_0x3d47c4[_0x71d1('0x1a')]=_0x4e7d3e[_0x71d1('0x23')];_0x2c00b2['CmHopper'][_0x71d1('0x1d')]({'where':{'phone':_0x3d47c4['phone'],'VoiceQueueId':_0x1298de['id']}})[_0x71d1('0x1e')](function(_0x538c66){if(!_['isNil'](_0x538c66)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x25')+_0x1298de['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4['ListId'],'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3d47c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'VoiceQueueId':_0x1298de['id']});})[_0x71d1('0x2b')](function(_0x195d77){_0x42fb0b(_0x195d77);});});});};var _0x5161ad=function(_0x4010f8){return new BPromise(function(_0x167e16,_0x396b50){_0x46bccf(_0x4010f8,_0x3d47c4)['then'](function(_0x2f7e13){_0x3d47c4['scheduledat']=_0x2f7e13[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')]['findOne']({'where':{'phone':_0x3d47c4[_0x71d1('0xd')],'VoiceQueueId':_0x4010f8['id']}})[_0x71d1('0x1e')](function(_0xa0cbd3){if(!_[_0x71d1('0x1f')](_0xa0cbd3)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x2c')+_0x4010f8['id']);}return _0x2c00b2[_0x71d1('0x2d')][_0x71d1('0x1d')]({'where':{'calleridnum':_0x3d47c4['phone'],'VoiceQueueId':_0x4010f8['id']}});})[_0x71d1('0x1e')](function(_0x1a6441){if(!_[_0x71d1('0x1f')](_0x1a6441)){throw new Error(_0x71d1('0x2e')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x2f')+_0x4010f8['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4['callbackUniqueid']:undefined,'callbackat':_0x3d47c4['callbackUniqueid']?moment()['format'](_0x71d1('0x1b')):undefined,'VoiceQueueId':_0x4010f8['id']});})['catch'](function(_0x1145f7){_0x396b50(_0x1145f7);});});});};function _0x1adb08(){return function(_0x399e3a){logger['error'](_0x71d1('0x31'),_0x71d1('0x18'),util[_0x71d1('0x19')](_0x399e3a,{'showHidden':![],'depth':null}));};}function _0x5f395c(_0x22e55c,_0x3c0210){var _0x28dd31=_0x3c0210['scheduledat']?_0x3c0210[_0x71d1('0x1a')]:moment()[_0x71d1('0x29')](_0x71d1('0x1b'));return new BPromise(function(_0x448689,_0x106ed1){if(_[_0x71d1('0x1f')](_0x3c0210[_0x71d1('0x1c')])){_0x448689({'ret':_0x28dd31});}else{_0x2c00b2['Campaign']['findOne']({'where':{'id':_0x22e55c['id']}})['then'](function(_0x2ffc6f){if(!_[_0x71d1('0x1f')](_0x2ffc6f)){var _0x2638b=_0x2ffc6f['dialTimezone'];if(!_[_0x71d1('0x1f')](_0x2638b)){var _0x4ed760=shared['timezones'];var _0x55fe39=_0x4ed760[_0x2638b];var _0xfeee91=_0x4ed760[_0x3c0210[_0x71d1('0x1c')]];if(!_[_0x71d1('0x1f')](_0x55fe39)&&!_[_0x71d1('0x1f')](_0xfeee91)){var _0x3baf31=_0x55fe39['utcOffset']-_0xfeee91[_0x71d1('0x21')];_0x28dd31=_0x3c0210[_0x71d1('0x1a')]?_0x3c0210[_0x71d1('0x1a')]:moment();var _0xe1ed47=moment(_0x28dd31)[_0x71d1('0x22')](_0x3baf31,_0x71d1('0x32'));_0x448689({'ret':_0xe1ed47['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x448689({'ret':_0x28dd31});}else _0x448689({'ret':_0x28dd31});}else{_0x448689({'ret':_0x28dd31});}});}});return 0xa;}var _0x25b7e1=function(_0x351336){return new BPromise(function(_0x1265ae,_0x2a334b){_0x5f395c(_0x351336,_0x3d47c4)[_0x71d1('0x1e')](function(_0x4a6f0e){_0x3d47c4[_0x71d1('0x1a')]=_0x4a6f0e['ret'];_0x2c00b2[_0x71d1('0x26')][_0x71d1('0x1d')]({'where':{'phone':_0x3d47c4['phone'],'CampaignId':_0x351336['id']}})[_0x71d1('0x1e')](function(_0x5345a5){if(!_[_0x71d1('0x1f')](_0x5345a5)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x33')+_0x351336['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'callback':_0x3d47c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'CampaignId':_0x351336['id']});})[_0x71d1('0x2b')](function(_0x444fc8){_0x2a334b(_0x444fc8);});});});};var _0x5ea1c5=function(_0x340c8b){return new BPromise(function(_0x142d8e,_0xfccf26){_0x5f395c(_0x340c8b,_0x3d47c4)[_0x71d1('0x1e')](function(_0x5557b0){_0x3d47c4[_0x71d1('0x1a')]=_0x5557b0[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')]['findOne']({'where':{'phone':_0x3d47c4[_0x71d1('0xd')],'CampaignId':_0x340c8b['id']}})[_0x71d1('0x1e')](function(_0x58fca4){if(!_[_0x71d1('0x1f')](_0x58fca4)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x340c8b['id']);}return _0x2c00b2[_0x71d1('0x2d')]['findOne']({'where':{'calleridnum':_0x3d47c4[_0x71d1('0xd')],'CampaignId':_0x340c8b['id']}});})[_0x71d1('0x1e')](function(_0x9a963e){if(!_[_0x71d1('0x1f')](_0x9a963e)){throw new Error(_0x71d1('0x2e')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x34')+_0x340c8b['id']);}return _0x2c00b2['CmHopper']['create']({'phone':_0x3d47c4['phone'],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4['scheduledat']?_0x3d47c4['scheduledat']:moment()[_0x71d1('0x29')](_0x71d1('0x1b')),'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x340c8b['id']});})[_0x71d1('0x2b')](function(_0xde10d1){_0xfccf26(_0xde10d1);});});});};if(_0x3d47c4[_0x71d1('0x30')]){_0x2c00b2['VoiceQueue'][_0x71d1('0x35')]({'where':{'type':_0x71d1('0x36')},'attributes':['id',_0x71d1('0x37'),_0x71d1('0x1c')],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x39'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})['then'](function(_0x1199f4){if(_0x1199f4){var _0x407fcd=[];for(var _0x5643a0=0x0,_0x161c26;_0x5643a0<_0x1199f4[_0x71d1('0x3a')];_0x5643a0+=0x1){_0x161c26=_0x1199f4[_0x5643a0][_0x71d1('0x16')]({'plain':!![]});switch(_0x161c26[_0x71d1('0x37')]){case _0x71d1('0x3b'):_0x5161ad(_0x161c26)['catch'](_0x26f39e());break;case _0x71d1('0x3c'):_0x18a2b0(_0x161c26)[_0x71d1('0x2b')](_0x26f39e());break;default:_0x5f395c(_0x161c26,_0x3d47c4)['then'](function(_0x4e0179){_0x3d47c4['scheduledat']=_0x4e0179[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'scheduledat':_0x3d47c4['scheduledat']?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4['callbackUniqueid']:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x161c26['id']})[_0x71d1('0x2b')](_0x26f39e());});}}}})[_0x71d1('0x1e')](function(){return _0x2c00b2[_0x71d1('0x3d')][_0x71d1('0x35')]({'where':{'type':_0x71d1('0x36')},'attributes':['id'],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x3e'),'where':{'id':_0x3d47c4['ListId']}}]})[_0x71d1('0x1e')](function(_0x33e9d6){if(_0x33e9d6){var _0x2454ac=[];for(var _0x19d0ae=0x0,_0x8420b0;_0x19d0ae<_0x33e9d6[_0x71d1('0x3a')];_0x19d0ae+=0x1){_0x8420b0=_0x33e9d6[_0x19d0ae]['get']({'plain':!![]});_0x2c00b2['CmHopperBlack'][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4['ListId'],'VoiceQueueId':_0x8420b0['id']})[_0x71d1('0x2b')](function(_0x574837){logger['error'](_0x71d1('0x3f'),_0x71d1('0x18'),_0x574837['message']);});}}});})[_0x71d1('0x1e')](function(){return _0x2c00b2[_0x71d1('0x40')]['findAll']({'attributes':['id',_0x71d1('0x37'),_0x71d1('0x1c')],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x39'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})[_0x71d1('0x1e')](function(_0xd986c3){if(_0xd986c3){var _0x50757a=[];for(var _0x5bbe53=0x0,_0x26c6af;_0x5bbe53<_0xd986c3[_0x71d1('0x3a')];_0x5bbe53+=0x1){_0x26c6af=_0xd986c3[_0x5bbe53][_0x71d1('0x16')]({'plain':!![]});switch(_0x26c6af['dialCheckDuplicateType']){case _0x71d1('0x3b'):_0x5ea1c5(_0x26c6af)[_0x71d1('0x2b')](_0x1adb08());break;case _0x71d1('0x3c'):_0x25b7e1(_0x26c6af)[_0x71d1('0x2b')](_0x1adb08());break;default:_0x2c00b2[_0x71d1('0x26')]['create']({'phone':_0x3d47c4['phone'],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'CampaignId':_0x26c6af['id']})[_0x71d1('0x2b')](_0x1adb08());}}}});})[_0x71d1('0x1e')](function(){return _0x2c00b2['Campaign'][_0x71d1('0x35')]({'attributes':['id'],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x3e'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})[_0x71d1('0x1e')](function(_0x178c5f){if(_0x178c5f){var _0x42977d=[];for(var _0x189ac9=0x0,_0x583895;_0x189ac9<_0x178c5f[_0x71d1('0x3a')];_0x189ac9+=0x1){_0x583895=_0x178c5f[_0x189ac9][_0x71d1('0x16')]({'plain':!![]});_0x2c00b2[_0x71d1('0x41')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'CampaignId':_0x583895['id']})[_0x71d1('0x2b')](function(_0x264b4e){logger[_0x71d1('0x17')](_0x71d1('0x3f'),'afterCreate',_0x264b4e[_0x71d1('0x42')]);});}}});})['then'](function(){_0x38773a();})[_0x71d1('0x2b')](function(_0xb7ba16){logger[_0x71d1('0x17')]('cmContact,\x20%s,\x20%s','afterCreate',_0xb7ba16['message']);_0x38773a(_0xb7ba16);});}else{_0x38773a(new Error(_0x71d1('0x43')));}},'afterDestroy':function(_0x2a99ce,_0x4ed5f6,_0x30bfb6){var _0x27bd8a=_0x54f07c[_0x71d1('0x15')];var _0x1e9d8e=_0x2a99ce[_0x71d1('0x16')]({'plain':!![]});return _0x27bd8a[_0x71d1('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x1e9d8e[_0x71d1('0x30')],'ContactId':_0x1e9d8e['id']}})['then'](function(_0x303d7b){if(!_[_0x71d1('0x44')](_0x303d7b)){var _0x50ec1c=[];for(var _0x5682c8=0x0;_0x5682c8<_0x303d7b[_0x71d1('0x3a')];_0x5682c8+=0x1){var _0x503660=_0x27bd8a[_0x71d1('0x26')]['destroy']({'where':{'ListId':_0x303d7b[_0x5682c8][_0x71d1('0x30')],'ContactId':_0x303d7b[_0x5682c8]['ContactId'],'VoiceQueueId':_0x303d7b[_0x5682c8]['VoiceQueueId'],'CampaignId':_0x303d7b[_0x5682c8]['CampaignId']}});_0x50ec1c['push'](_0x503660);}return BPromise[_0x71d1('0x45')](_0x50ec1c);}})[_0x71d1('0x1e')](function(_0x2a281f){logger[_0x71d1('0x46')]('[CmContact][afterDestroy][Succesfull]',util[_0x71d1('0x19')](_0x2a281f,{'showHidden':![],'depth':null}));_0x30bfb6();})[_0x71d1('0x2b')](function(_0xedc26){logger[_0x71d1('0x17')](_0x71d1('0x47'),util[_0x71d1('0x19')](_0xedc26,{'showHidden':![],'depth':null}));_0x30bfb6(_0xedc26);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 0f3397b..5f88aa2 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x46a82a,_0xfbbad){var _0x5e4dd6=function(_0x4469a7){while(--_0x4469a7){_0x46a82a['push'](_0x46a82a['shift']());}};_0x5e4dd6(++_0xfbbad);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x742a25,_0x28f592){var _0x15f39c=function(_0x8c7a13){while(--_0x8c7a13){_0x742a25['push'](_0x742a25['shift']());}};_0x15f39c(++_0x28f592);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index d4d0f95..d871463 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f72=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x23d057,_0x78b62d){var _0x2fbc46=function(_0x16de3a){while(--_0x16de3a){_0x23d057['push'](_0x23d057['shift']());}};_0x2fbc46(++_0x78b62d);}(_0x2f72,0x166));var _0x22f7=function(_0x195af5,_0x3339e8){_0x195af5=_0x195af5-0x0;var _0x1b3a36=_0x2f72[_0x195af5];return _0x1b3a36;};'use strict';var Sequelize=require(_0x22f7('0x0'));module[_0x22f7('0x1')]={'CmContactId':{'type':Sequelize[_0x22f7('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x22f7('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x22f7('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x22f7('0x3')],'defaultValue':_0x22f7('0x4')},'OrderBy':{'type':Sequelize[_0x22f7('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x9b83=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0x9b83,0x84));var _0x39b8=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x9b83[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x39b8('0x0'));module[_0x39b8('0x1')]={'CmContactId':{'type':Sequelize[_0x39b8('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x39b8('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':_0x39b8('0x4')},'OrderBy':{'type':Sequelize[_0x39b8('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index fec52e3..131ca92 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbfc=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include','body','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x488262,_0x1f4b62){var _0x4e072b=function(_0x517e54){while(--_0x517e54){_0x488262['push'](_0x488262['shift']());}};_0x4e072b(++_0x1f4b62);}(_0xcbfc,0xfa));var _0xccbf=function(_0x4dfe8d,_0x432442){_0x4dfe8d=_0x4dfe8d-0x0;var _0x55cd1e=_0xcbfc[_0x4dfe8d];return _0x55cd1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccbf('0x0'));var zipdir=require(_0xccbf('0x1'));var jsonpatch=require(_0xccbf('0x2'));var rp=require(_0xccbf('0x3'));var moment=require(_0xccbf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xccbf('0x5'));var util=require(_0xccbf('0x6'));var path=require(_0xccbf('0x7'));var sox=require(_0xccbf('0x8'));var csv=require(_0xccbf('0x9'));var ejs=require(_0xccbf('0xa'));var fs=require('fs');var fs_extra=require(_0xccbf('0xb'));var _=require(_0xccbf('0xc'));var squel=require(_0xccbf('0xd'));var crypto=require(_0xccbf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xccbf('0xf'));var toCsv=require(_0xccbf('0x9'));var querystring=require(_0xccbf('0x10'));var Papa=require(_0xccbf('0x11'));var Redis=require(_0xccbf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xccbf('0x13'));var as=require(_0xccbf('0x14'));var hardwareService=require(_0xccbf('0x15'));var logger=require(_0xccbf('0x16'))('api');var utils=require(_0xccbf('0x17'));var config=require(_0xccbf('0x18'));var licenseUtil=require(_0xccbf('0x19'));var db=require(_0xccbf('0x1a'))['db'];function respondWithStatusCode(_0x17324e,_0x53e608){_0x53e608=_0x53e608||0xcc;return function(_0x5ec364){if(_0x5ec364){return _0x17324e[_0xccbf('0x1b')](_0x53e608);}return _0x17324e[_0xccbf('0x1c')](_0x53e608)['end']();};}function respondWithResult(_0x316e80,_0x39d2e4){_0x39d2e4=_0x39d2e4||0xc8;return function(_0x7e229f){if(_0x7e229f){return _0x316e80[_0xccbf('0x1c')](_0x39d2e4)[_0xccbf('0x1d')](_0x7e229f);}};}function respondWithFilteredResult(_0x246502,_0x44055c){return function(_0x3ea4a8){if(_0x3ea4a8){var _0x150994=typeof _0x44055c[_0xccbf('0x1e')]==='undefined'&&typeof _0x44055c[_0xccbf('0x1f')]===_0xccbf('0x20');var _0x375001=_0x3ea4a8[_0xccbf('0x21')];var _0x176c33=_0x150994?0x0:_0x44055c[_0xccbf('0x1e')];var _0xd90199=_0x150994?_0x3ea4a8[_0xccbf('0x21')]:_0x44055c[_0xccbf('0x1e')]+_0x44055c['limit'];var _0x29bc13;if(_0xd90199>=_0x375001){_0xd90199=_0x375001;_0x29bc13=0xc8;}else{_0x29bc13=0xce;}_0x246502[_0xccbf('0x1c')](_0x29bc13);return _0x246502[_0xccbf('0x22')](_0xccbf('0x23'),_0x176c33+'-'+_0xd90199+'/'+_0x375001)[_0xccbf('0x1d')](_0x3ea4a8);}return null;};}function patchUpdates(_0x1e7112){return function(_0x1859b0){try{jsonpatch['apply'](_0x1859b0,_0x1e7112,!![]);}catch(_0x3b177c){return BPromise[_0xccbf('0x24')](_0x3b177c);}return _0x1859b0[_0xccbf('0x25')]();};}function saveUpdates(_0x2539f6,_0x1b9243){return function(_0x1ebf73){if(_0x1ebf73){return _0x1ebf73['update'](_0x2539f6)['then'](function(_0x663020){return _0x663020;});}return null;};}function removeEntity(_0x14674f,_0x2c4632){return function(_0x1f87dd){if(_0x1f87dd){return _0x1f87dd[_0xccbf('0x26')]()[_0xccbf('0x27')](function(){var _0x459311=_0x1f87dd[_0xccbf('0x28')]({'plain':!![]});var _0x452212=_0xccbf('0x29');return db[_0xccbf('0x2a')][_0xccbf('0x26')]({'where':{'type':_0x452212,'resourceId':_0x459311['id']}})['then'](function(){return _0x1f87dd;});})['then'](function(){_0x14674f[_0xccbf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47dadc,_0x15e592){return function(_0x3162f4){if(!_0x3162f4){_0x47dadc[_0xccbf('0x1b')](0x194);}return _0x3162f4;};}function handleError(_0x2b02e1,_0x2c002a){_0x2c002a=_0x2c002a||0x1f4;return function(_0x226e53){logger[_0xccbf('0x2b')](_0x226e53[_0xccbf('0x2c')]);if(_0x226e53['name']){delete _0x226e53[_0xccbf('0x2d')];}_0x2b02e1['status'](_0x2c002a)[_0xccbf('0x2e')](_0x226e53);};}exports[_0xccbf('0x2f')]=function(_0x385b96,_0x53d9cb){var _0x421292={},_0x22b225={},_0x12251c={'count':0x0,'rows':[]};var _0x2fe380=_[_0xccbf('0x30')](db[_0xccbf('0x31')][_0xccbf('0x32')],function(_0x1d79a0){return{'name':_0x1d79a0[_0xccbf('0x33')],'type':_0x1d79a0[_0xccbf('0x34')][_0xccbf('0x35')]};});_0x22b225['model']=_['map'](_0x2fe380,_0xccbf('0x2d'));_0x22b225[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x385b96[_0xccbf('0x36')]);_0x22b225[_0xccbf('0x38')]=_[_0xccbf('0x39')](_0x22b225['model'],_0x22b225['query']);_0x421292[_0xccbf('0x3a')]=_[_0xccbf('0x39')](_0x22b225[_0xccbf('0x3b')],qs[_0xccbf('0x3c')](_0x385b96[_0xccbf('0x36')]['fields']));_0x421292['attributes']=_0x421292[_0xccbf('0x3a')]['length']?_0x421292['attributes']:_0x22b225[_0xccbf('0x3b')];if(!_0x385b96[_0xccbf('0x36')][_0xccbf('0x3d')](_0xccbf('0x3e'))){_0x421292[_0xccbf('0x1f')]=qs[_0xccbf('0x1f')](_0x385b96[_0xccbf('0x36')][_0xccbf('0x1f')]);_0x421292[_0xccbf('0x1e')]=qs[_0xccbf('0x1e')](_0x385b96['query'][_0xccbf('0x1e')]);}_0x421292[_0xccbf('0x3f')]=qs['sort'](_0x385b96['query'][_0xccbf('0x40')]);_0x421292[_0xccbf('0x41')]=qs[_0xccbf('0x38')](_[_0xccbf('0x42')](_0x385b96['query'],_0x22b225['filters']),_0x2fe380);if(_0x385b96[_0xccbf('0x36')]['filter']){_0x421292['where']=_['merge'](_0x421292[_0xccbf('0x41')],{'$or':_[_0xccbf('0x30')](_0x2fe380,function(_0x2a240b){if(_0x2a240b[_0xccbf('0x34')]!==_0xccbf('0x43')){var _0x163c45={};_0x163c45[_0x2a240b['name']]={'$like':'%'+_0x385b96[_0xccbf('0x36')]['filter']+'%'};return _0x163c45;}})});}_0x421292=_[_0xccbf('0x44')]({},_0x421292,_0x385b96[_0xccbf('0x45')]);var _0x2b9705={'where':_0x421292[_0xccbf('0x41')]};return db['CmContactHasItem'][_0xccbf('0x21')](_0x2b9705)[_0xccbf('0x27')](function(_0x4ed168){_0x12251c[_0xccbf('0x21')]=_0x4ed168;if(_0x385b96[_0xccbf('0x36')][_0xccbf('0x46')]){_0x421292['include']=[{'all':!![]}];}return db[_0xccbf('0x31')][_0xccbf('0x47')](_0x421292);})[_0xccbf('0x27')](function(_0x2b4e33){_0x12251c[_0xccbf('0x48')]=_0x2b4e33;return _0x12251c;})[_0xccbf('0x27')](respondWithFilteredResult(_0x53d9cb,_0x421292))[_0xccbf('0x49')](handleError(_0x53d9cb,null));};exports[_0xccbf('0x4a')]=function(_0x5d4ae5,_0xc3c72f){var _0xbb3ac3={'raw':!![],'where':{'id':_0x5d4ae5[_0xccbf('0x4b')]['id']}},_0x1a573d={};_0x1a573d[_0xccbf('0x3b')]=_[_0xccbf('0x37')](db[_0xccbf('0x31')]['rawAttributes']);_0x1a573d[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x5d4ae5[_0xccbf('0x36')]);_0x1a573d[_0xccbf('0x38')]=_['intersection'](_0x1a573d[_0xccbf('0x3b')],_0x1a573d[_0xccbf('0x36')]);_0xbb3ac3[_0xccbf('0x3a')]=_[_0xccbf('0x39')](_0x1a573d[_0xccbf('0x3b')],qs[_0xccbf('0x3c')](_0x5d4ae5[_0xccbf('0x36')][_0xccbf('0x3c')]));_0xbb3ac3[_0xccbf('0x3a')]=_0xbb3ac3[_0xccbf('0x3a')][_0xccbf('0x4c')]?_0xbb3ac3[_0xccbf('0x3a')]:_0x1a573d[_0xccbf('0x3b')];if(_0x5d4ae5[_0xccbf('0x36')][_0xccbf('0x46')]){_0xbb3ac3[_0xccbf('0x4d')]=[{'all':!![]}];}_0xbb3ac3=_[_0xccbf('0x44')]({},_0xbb3ac3,_0x5d4ae5[_0xccbf('0x45')]);return db[_0xccbf('0x31')]['find'](_0xbb3ac3)['then'](handleEntityNotFound(_0xc3c72f,null))['then'](respondWithResult(_0xc3c72f,null))[_0xccbf('0x49')](handleError(_0xc3c72f,null));};exports['create']=function(_0x5ea4ef,_0x2a57dc){return db[_0xccbf('0x31')]['create'](_0x5ea4ef[_0xccbf('0x4e')],{})['then'](function(_0x1babc6){var _0x1425a2=_0x5ea4ef[_0xccbf('0x4f')]['get']({'plain':!![]});if(!_0x1425a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1425a2['role']===_0xccbf('0x4f')){var _0x716b33=_0x1babc6['get']({'plain':!![]});var _0x505b62=_0xccbf('0x29');return db[_0xccbf('0x50')]['find']({'where':{'name':_0x505b62,'userProfileId':_0x1425a2[_0xccbf('0x51')]},'raw':!![]})[_0xccbf('0x27')](function(_0xafe89c){if(_0xafe89c&&_0xafe89c[_0xccbf('0x52')]===0x0){return db[_0xccbf('0x2a')][_0xccbf('0x53')]({'name':_0x716b33[_0xccbf('0x2d')],'resourceId':_0x716b33['id'],'type':_0xafe89c[_0xccbf('0x2d')],'sectionId':_0xafe89c['id']},{})[_0xccbf('0x27')](function(){return _0x1babc6;});}else{return _0x1babc6;}})['catch'](function(_0x219cd6){logger[_0xccbf('0x2b')](_0xccbf('0x54'),_0x219cd6);throw _0x219cd6;});}return _0x1babc6;})[_0xccbf('0x27')](respondWithResult(_0x2a57dc,0xc9))['catch'](handleError(_0x2a57dc,null));};exports[_0xccbf('0x55')]=function(_0x63c562,_0x21de5a){if(_0x63c562[_0xccbf('0x4e')]['id']){delete _0x63c562[_0xccbf('0x4e')]['id'];}return db[_0xccbf('0x31')][_0xccbf('0x56')]({'where':{'id':_0x63c562['params']['id']}})[_0xccbf('0x27')](handleEntityNotFound(_0x21de5a,null))[_0xccbf('0x27')](saveUpdates(_0x63c562[_0xccbf('0x4e')],null))[_0xccbf('0x27')](respondWithResult(_0x21de5a,null))[_0xccbf('0x49')](handleError(_0x21de5a,null));};exports[_0xccbf('0x26')]=function(_0x40d4f4,_0x3805c9){return db['CmContactHasItem'][_0xccbf('0x56')]({'where':{'id':_0x40d4f4[_0xccbf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3805c9,null))['then'](removeEntity(_0x3805c9,null))[_0xccbf('0x49')](handleError(_0x3805c9,null));}; \ No newline at end of file +var _0xaf48=['type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','params','intersection','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','CmContactHasItems','UserProfileResource','destroy','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName'];(function(_0x1aeea6,_0x407d72){var _0x143992=function(_0x251888){while(--_0x251888){_0x1aeea6['push'](_0x1aeea6['shift']());}};_0x143992(++_0x407d72);}(_0xaf48,0x75));var _0x8af4=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xaf48[_0x4e7d25];return _0x526fe6;};'use strict';var emlformat=require(_0x8af4('0x0'));var rimraf=require(_0x8af4('0x1'));var zipdir=require(_0x8af4('0x2'));var jsonpatch=require(_0x8af4('0x3'));var rp=require(_0x8af4('0x4'));var moment=require(_0x8af4('0x5'));var BPromise=require(_0x8af4('0x6'));var Mustache=require(_0x8af4('0x7'));var util=require('util');var path=require(_0x8af4('0x8'));var sox=require(_0x8af4('0x9'));var csv=require(_0x8af4('0xa'));var ejs=require(_0x8af4('0xb'));var fs=require('fs');var fs_extra=require(_0x8af4('0xc'));var _=require(_0x8af4('0xd'));var squel=require(_0x8af4('0xe'));var crypto=require('crypto');var jsforce=require(_0x8af4('0xf'));var deskjs=require(_0x8af4('0x10'));var toCsv=require(_0x8af4('0xa'));var querystring=require(_0x8af4('0x11'));var Papa=require(_0x8af4('0x12'));var Redis=require(_0x8af4('0x13'));var authService=require(_0x8af4('0x14'));var qs=require(_0x8af4('0x15'));var as=require(_0x8af4('0x16'));var hardwareService=require(_0x8af4('0x17'));var logger=require(_0x8af4('0x18'))('api');var utils=require(_0x8af4('0x19'));var config=require(_0x8af4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3526bd,_0x46d588){_0x46d588=_0x46d588||0xcc;return function(_0x24e056){if(_0x24e056){return _0x3526bd[_0x8af4('0x1b')](_0x46d588);}return _0x3526bd[_0x8af4('0x1c')](_0x46d588)[_0x8af4('0x1d')]();};}function respondWithResult(_0x10bf5c,_0x2a5857){_0x2a5857=_0x2a5857||0xc8;return function(_0x50d05d){if(_0x50d05d){return _0x10bf5c[_0x8af4('0x1c')](_0x2a5857)[_0x8af4('0x1e')](_0x50d05d);}};}function respondWithFilteredResult(_0x5bde74,_0xc3b64a){return function(_0x30d8f9){if(_0x30d8f9){var _0x49908b=typeof _0xc3b64a[_0x8af4('0x1f')]===_0x8af4('0x20')&&typeof _0xc3b64a['limit']===_0x8af4('0x20');var _0x241efc=_0x30d8f9[_0x8af4('0x21')];var _0x29a142=_0x49908b?0x0:_0xc3b64a[_0x8af4('0x1f')];var _0x2f03ad=_0x49908b?_0x30d8f9[_0x8af4('0x21')]:_0xc3b64a[_0x8af4('0x1f')]+_0xc3b64a[_0x8af4('0x22')];var _0x10b944;if(_0x2f03ad>=_0x241efc){_0x2f03ad=_0x241efc;_0x10b944=0xc8;}else{_0x10b944=0xce;}_0x5bde74[_0x8af4('0x1c')](_0x10b944);return _0x5bde74[_0x8af4('0x23')]('Content-Range',_0x29a142+'-'+_0x2f03ad+'/'+_0x241efc)[_0x8af4('0x1e')](_0x30d8f9);}return null;};}function patchUpdates(_0x52be62){return function(_0x199c6b){try{jsonpatch[_0x8af4('0x24')](_0x199c6b,_0x52be62,!![]);}catch(_0x93a3dc){return BPromise['reject'](_0x93a3dc);}return _0x199c6b[_0x8af4('0x25')]();};}function saveUpdates(_0x265174,_0x3041d6){return function(_0x13230e){if(_0x13230e){return _0x13230e[_0x8af4('0x26')](_0x265174)[_0x8af4('0x27')](function(_0xa6f1e3){return _0xa6f1e3;});}return null;};}function removeEntity(_0x170a7a,_0x7c051b){return function(_0x39f879){if(_0x39f879){return _0x39f879['destroy']()['then'](function(){var _0x100dff=_0x39f879['get']({'plain':!![]});var _0x4a34ae=_0x8af4('0x28');return db[_0x8af4('0x29')][_0x8af4('0x2a')]({'where':{'type':_0x4a34ae,'resourceId':_0x100dff['id']}})[_0x8af4('0x27')](function(){return _0x39f879;});})[_0x8af4('0x27')](function(){_0x170a7a[_0x8af4('0x1c')](0xcc)[_0x8af4('0x1d')]();});}};}function handleEntityNotFound(_0x4e1cbb,_0x390012){return function(_0x5adbf3){if(!_0x5adbf3){_0x4e1cbb[_0x8af4('0x1b')](0x194);}return _0x5adbf3;};}function handleError(_0x2e284b,_0x26a9a8){_0x26a9a8=_0x26a9a8||0x1f4;return function(_0x19db12){logger['error'](_0x19db12[_0x8af4('0x2b')]);if(_0x19db12[_0x8af4('0x2c')]){delete _0x19db12[_0x8af4('0x2c')];}_0x2e284b['status'](_0x26a9a8)[_0x8af4('0x2d')](_0x19db12);};}exports[_0x8af4('0x2e')]=function(_0x2aeb7b,_0x69f13b){var _0x5f465b={},_0x2bcf22={},_0x4a99fa={'count':0x0,'rows':[]};var _0x847a6=_[_0x8af4('0x2f')](db[_0x8af4('0x30')][_0x8af4('0x31')],function(_0x5f0c19){return{'name':_0x5f0c19[_0x8af4('0x32')],'type':_0x5f0c19[_0x8af4('0x33')][_0x8af4('0x34')]};});_0x2bcf22[_0x8af4('0x35')]=_[_0x8af4('0x2f')](_0x847a6,_0x8af4('0x2c'));_0x2bcf22[_0x8af4('0x36')]=_[_0x8af4('0x37')](_0x2aeb7b['query']);_0x2bcf22[_0x8af4('0x38')]=_['intersection'](_0x2bcf22[_0x8af4('0x35')],_0x2bcf22[_0x8af4('0x36')]);_0x5f465b[_0x8af4('0x39')]=_['intersection'](_0x2bcf22[_0x8af4('0x35')],qs[_0x8af4('0x3a')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x3a')]));_0x5f465b['attributes']=_0x5f465b['attributes'][_0x8af4('0x3b')]?_0x5f465b[_0x8af4('0x39')]:_0x2bcf22[_0x8af4('0x35')];if(!_0x2aeb7b[_0x8af4('0x36')]['hasOwnProperty'](_0x8af4('0x3c'))){_0x5f465b[_0x8af4('0x22')]=qs[_0x8af4('0x22')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x22')]);_0x5f465b[_0x8af4('0x1f')]=qs[_0x8af4('0x1f')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x1f')]);}_0x5f465b[_0x8af4('0x3d')]=qs[_0x8af4('0x3e')](_0x2aeb7b['query']['sort']);_0x5f465b[_0x8af4('0x3f')]=qs[_0x8af4('0x38')](_[_0x8af4('0x40')](_0x2aeb7b[_0x8af4('0x36')],_0x2bcf22['filters']),_0x847a6);if(_0x2aeb7b['query']['filter']){_0x5f465b[_0x8af4('0x3f')]=_[_0x8af4('0x41')](_0x5f465b[_0x8af4('0x3f')],{'$or':_[_0x8af4('0x2f')](_0x847a6,function(_0x5d5871){if(_0x5d5871[_0x8af4('0x33')]!=='VIRTUAL'){var _0xb7ef86={};_0xb7ef86[_0x5d5871[_0x8af4('0x2c')]]={'$like':'%'+_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x42')]+'%'};return _0xb7ef86;}})});}_0x5f465b=_[_0x8af4('0x41')]({},_0x5f465b,_0x2aeb7b[_0x8af4('0x43')]);var _0x163d6c={'where':_0x5f465b[_0x8af4('0x3f')]};return db[_0x8af4('0x30')][_0x8af4('0x21')](_0x163d6c)['then'](function(_0x257cac){_0x4a99fa[_0x8af4('0x21')]=_0x257cac;if(_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x44')]){_0x5f465b[_0x8af4('0x45')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x5f465b);})[_0x8af4('0x27')](function(_0x5119c0){_0x4a99fa[_0x8af4('0x46')]=_0x5119c0;return _0x4a99fa;})['then'](respondWithFilteredResult(_0x69f13b,_0x5f465b))[_0x8af4('0x47')](handleError(_0x69f13b,null));};exports['show']=function(_0x1e3b62,_0x420535){var _0x4945a7={'raw':!![],'where':{'id':_0x1e3b62[_0x8af4('0x48')]['id']}},_0x19e9e5={};_0x19e9e5[_0x8af4('0x35')]=_[_0x8af4('0x37')](db[_0x8af4('0x30')][_0x8af4('0x31')]);_0x19e9e5[_0x8af4('0x36')]=_[_0x8af4('0x37')](_0x1e3b62[_0x8af4('0x36')]);_0x19e9e5[_0x8af4('0x38')]=_[_0x8af4('0x49')](_0x19e9e5[_0x8af4('0x35')],_0x19e9e5[_0x8af4('0x36')]);_0x4945a7[_0x8af4('0x39')]=_[_0x8af4('0x49')](_0x19e9e5[_0x8af4('0x35')],qs[_0x8af4('0x3a')](_0x1e3b62[_0x8af4('0x36')][_0x8af4('0x3a')]));_0x4945a7[_0x8af4('0x39')]=_0x4945a7[_0x8af4('0x39')][_0x8af4('0x3b')]?_0x4945a7[_0x8af4('0x39')]:_0x19e9e5[_0x8af4('0x35')];if(_0x1e3b62[_0x8af4('0x36')][_0x8af4('0x44')]){_0x4945a7[_0x8af4('0x45')]=[{'all':!![]}];}_0x4945a7=_[_0x8af4('0x41')]({},_0x4945a7,_0x1e3b62[_0x8af4('0x43')]);return db[_0x8af4('0x30')][_0x8af4('0x4a')](_0x4945a7)[_0x8af4('0x27')](handleEntityNotFound(_0x420535,null))[_0x8af4('0x27')](respondWithResult(_0x420535,null))['catch'](handleError(_0x420535,null));};exports[_0x8af4('0x4b')]=function(_0x569d43,_0x5acd0a){return db[_0x8af4('0x30')][_0x8af4('0x4b')](_0x569d43['body'],{})[_0x8af4('0x27')](function(_0x22966b){var _0x238616=_0x569d43['user'][_0x8af4('0x4c')]({'plain':!![]});if(!_0x238616)throw new Error(_0x8af4('0x4d'));if(_0x238616[_0x8af4('0x4e')]===_0x8af4('0x4f')){var _0x56c67e=_0x22966b[_0x8af4('0x4c')]({'plain':!![]});var _0x584fd5='CmContactHasItems';return db['UserProfileSection']['find']({'where':{'name':_0x584fd5,'userProfileId':_0x238616[_0x8af4('0x50')]},'raw':!![]})[_0x8af4('0x27')](function(_0x4167a1){if(_0x4167a1&&_0x4167a1['autoAssociation']===0x0){return db[_0x8af4('0x29')][_0x8af4('0x4b')]({'name':_0x56c67e[_0x8af4('0x2c')],'resourceId':_0x56c67e['id'],'type':_0x4167a1[_0x8af4('0x2c')],'sectionId':_0x4167a1['id']},{})[_0x8af4('0x27')](function(){return _0x22966b;});}else{return _0x22966b;}})[_0x8af4('0x47')](function(_0x12bf6d){logger[_0x8af4('0x51')](_0x8af4('0x52'),_0x12bf6d);throw _0x12bf6d;});}return _0x22966b;})[_0x8af4('0x27')](respondWithResult(_0x5acd0a,0xc9))[_0x8af4('0x47')](handleError(_0x5acd0a,null));};exports[_0x8af4('0x26')]=function(_0x4f2d3e,_0x521375){if(_0x4f2d3e[_0x8af4('0x53')]['id']){delete _0x4f2d3e[_0x8af4('0x53')]['id'];}return db[_0x8af4('0x30')][_0x8af4('0x4a')]({'where':{'id':_0x4f2d3e[_0x8af4('0x48')]['id']}})[_0x8af4('0x27')](handleEntityNotFound(_0x521375,null))['then'](saveUpdates(_0x4f2d3e[_0x8af4('0x53')],null))[_0x8af4('0x27')](respondWithResult(_0x521375,null))['catch'](handleError(_0x521375,null));};exports['destroy']=function(_0x4483b0,_0x380dfc){return db[_0x8af4('0x30')][_0x8af4('0x4a')]({'where':{'id':_0x4483b0['params']['id']}})[_0x8af4('0x27')](handleEntityNotFound(_0x380dfc,null))['then'](removeEntity(_0x380dfc,null))[_0x8af4('0x47')](handleError(_0x380dfc,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 7c02ebb..555d2be 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacc3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_contact_has_items','lodash','util','api'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xacc3,0x1d1));var _0x3acc=function(_0x17e22e,_0x4fa092){_0x17e22e=_0x17e22e-0x0;var _0x4b0914=_0xacc3[_0x17e22e];return _0x4b0914;};'use strict';var _=require(_0x3acc('0x0'));var util=require(_0x3acc('0x1'));var logger=require('../../config/logger')(_0x3acc('0x2'));var moment=require(_0x3acc('0x3'));var BPromise=require(_0x3acc('0x4'));var rp=require(_0x3acc('0x5'));var fs=require('fs');var path=require(_0x3acc('0x6'));var rimraf=require(_0x3acc('0x7'));var config=require(_0x3acc('0x8'));var attributes=require('./cmContactHasItem.attributes');module[_0x3acc('0x9')]=function(_0x1135c5,_0x5ac136){return _0x1135c5[_0x3acc('0xa')]('CmContactHasItem',attributes,{'tableName':_0x3acc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4cf=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x49b7e6,_0x536dd0){var _0x231ea5=function(_0x16865b){while(--_0x16865b){_0x49b7e6['push'](_0x49b7e6['shift']());}};_0x231ea5(++_0x536dd0);}(_0xe4cf,0x120));var _0xfe4c=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0xe4cf[_0x4bb1b3];return _0x6b3651;};'use strict';var _=require(_0xfe4c('0x0'));var util=require(_0xfe4c('0x1'));var logger=require(_0xfe4c('0x2'))(_0xfe4c('0x3'));var moment=require(_0xfe4c('0x4'));var BPromise=require(_0xfe4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe4c('0x6'));var config=require(_0xfe4c('0x7'));var attributes=require(_0xfe4c('0x8'));module['exports']=function(_0x24daa2,_0x31b355){return _0x24daa2['define']('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 74efe3d..ce41208 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b64=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x1722ea,_0x4393a8){var _0x1665dc=function(_0xa537d4){while(--_0xa537d4){_0x1722ea['push'](_0x1722ea['shift']());}};_0x1665dc(++_0x4393a8);}(_0x1b64,0x7c));var _0x41b6=function(_0x17d7a9,_0x4a1b71){_0x17d7a9=_0x17d7a9-0x0;var _0x595f9c=_0x1b64[_0x17d7a9];return _0x595f9c;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var moment=require(_0x41b6('0x2'));var BPromise=require(_0x41b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41b6('0x4'));var db=require(_0x41b6('0x5'))['db'];var utils=require(_0x41b6('0x6'));var logger=require(_0x41b6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x41b6('0x8'));var client=jayson[_0x41b6('0x9')][_0x41b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2085bc,_0x5b7a5f,_0x5e1411){return new BPromise(function(_0x2ceddf,_0x34e1fe){return client[_0x41b6('0xb')](_0x2085bc,_0x5e1411)['then'](function(_0x1963a0){logger[_0x41b6('0xc')](_0x41b6('0xd'),_0x5b7a5f,'request\x20sent');logger[_0x41b6('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x5b7a5f,_0x41b6('0xf'),JSON[_0x41b6('0x10')](_0x1963a0));if(_0x1963a0[_0x41b6('0x11')]){if(_0x1963a0[_0x41b6('0x11')][_0x41b6('0x12')]===0x1f4){logger[_0x41b6('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x5b7a5f,_0x1963a0[_0x41b6('0x11')][_0x41b6('0x13')]);return _0x34e1fe(_0x1963a0['error']['message']);}logger[_0x41b6('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x5b7a5f,_0x1963a0[_0x41b6('0x11')][_0x41b6('0x13')]);return _0x2ceddf(_0x1963a0[_0x41b6('0x11')]['message']);}else{logger[_0x41b6('0xc')](_0x41b6('0xd'),_0x5b7a5f,_0x41b6('0xf'));_0x2ceddf(_0x1963a0['result'][_0x41b6('0x13')]);}})[_0x41b6('0x14')](function(_0x4ac968){logger[_0x41b6('0x11')](_0x41b6('0xd'),_0x5b7a5f,_0x4ac968);_0x34e1fe(_0x4ac968);});});} \ No newline at end of file +var _0xb679=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','code','CmContactHasItem,\x20%s,\x20%s','error','message','catch','lodash','util'];(function(_0x4e6dc1,_0x4bda16){var _0x5f1b92=function(_0x136917){while(--_0x136917){_0x4e6dc1['push'](_0x4e6dc1['shift']());}};_0x5f1b92(++_0x4bda16);}(_0xb679,0x1b7));var _0x9b67=function(_0x34758e,_0x4f6593){_0x34758e=_0x34758e-0x0;var _0x410ef3=_0xb679[_0x34758e];return _0x410ef3;};'use strict';var _=require(_0x9b67('0x0'));var util=require(_0x9b67('0x1'));var moment=require(_0x9b67('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b67('0x3'));var fs=require('fs');var Redis=require(_0x9b67('0x4'));var db=require(_0x9b67('0x5'))['db'];var utils=require(_0x9b67('0x6'));var logger=require('../../config/logger')(_0x9b67('0x7'));var config=require(_0x9b67('0x8'));var jayson=require(_0x9b67('0x9'));var client=jayson[_0x9b67('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd4f3,_0x466c44,_0x165524){return new BPromise(function(_0x557a72,_0x2add10){return client[_0x9b67('0xb')](_0x4fd4f3,_0x165524)[_0x9b67('0xc')](function(_0x5ba58b){logger[_0x9b67('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x466c44,_0x9b67('0xe'));logger[_0x9b67('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x466c44,_0x9b67('0xe'),JSON['stringify'](_0x5ba58b));if(_0x5ba58b['error']){if(_0x5ba58b['error'][_0x9b67('0x10')]===0x1f4){logger['error'](_0x9b67('0x11'),_0x466c44,_0x5ba58b[_0x9b67('0x12')][_0x9b67('0x13')]);return _0x2add10(_0x5ba58b['error'][_0x9b67('0x13')]);}logger[_0x9b67('0x12')](_0x9b67('0x11'),_0x466c44,_0x5ba58b[_0x9b67('0x12')][_0x9b67('0x13')]);return _0x557a72(_0x5ba58b[_0x9b67('0x12')]['message']);}else{logger[_0x9b67('0xd')](_0x9b67('0x11'),_0x466c44,_0x9b67('0xe'));_0x557a72(_0x5ba58b['result']['message']);}})[_0x9b67('0x14')](function(_0x2fc168){logger[_0x9b67('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x466c44,_0x2fc168);_0x2add10(_0x2fc168);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 59e001a..6564b23 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc378=['index','get','/:id','post','put','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x38e0de,_0x132d49){var _0x1a906a=function(_0x45d5a0){while(--_0x45d5a0){_0x38e0de['push'](_0x38e0de['shift']());}};_0x1a906a(++_0x132d49);}(_0xc378,0x1c2));var _0x8c37=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0xc378[_0x31df6f];return _0x31e353;};'use strict';var multer=require('multer');var util=require(_0x8c37('0x0'));var path=require(_0x8c37('0x1'));var timeout=require(_0x8c37('0x2'));var express=require(_0x8c37('0x3'));var router=express[_0x8c37('0x4')]();var fs_extra=require(_0x8c37('0x5'));var auth=require(_0x8c37('0x6'));var interaction=require(_0x8c37('0x7'));var config=require(_0x8c37('0x8'));var controller=require(_0x8c37('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8c37('0xa')]);router[_0x8c37('0xb')](_0x8c37('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8c37('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c37('0xe')](_0x8c37('0xc'),auth[_0x8c37('0xf')](),controller[_0x8c37('0x10')]);router[_0x8c37('0x11')]('/:id',auth[_0x8c37('0xf')](),controller[_0x8c37('0x12')]);module[_0x8c37('0x13')]=router; \ No newline at end of file +var _0xeb6c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x1614a6,_0x4a66cb){_0x1614a6=_0x1614a6-0x0;var _0x4bc4cf=_0xeb6c[_0x1614a6];return _0x4bc4cf;};'use strict';var multer=require(_0xceb6('0x0'));var util=require(_0xceb6('0x1'));var path=require(_0xceb6('0x2'));var timeout=require(_0xceb6('0x3'));var express=require(_0xceb6('0x4'));var router=express[_0xceb6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xceb6('0x6'));var interaction=require(_0xceb6('0x7'));var config=require('../../config/environment');var controller=require(_0xceb6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xceb6('0x9')]);router[_0xceb6('0xa')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0xd')]);router[_0xceb6('0xe')]('/',auth['isAuthenticated'](),controller[_0xceb6('0xf')]);router[_0xceb6('0x10')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0x11')]);router[_0xceb6('0x12')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0x13')]);module[_0xceb6('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 10db558..4824fa9 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 _0xd967=['TEXT','long','type','parse','values','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','alias','setDataValue','STRING'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0xd967,0x1bb));var _0x7d96=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0xd967[_0x4a5494];return _0x57cbb5;};'use strict';var Sequelize=require(_0x7d96('0x0'));var _=require(_0x7d96('0x1'));module[_0x7d96('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52943a){return this[_0x7d96('0x3')](_0x7d96('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x314c29){this[_0x7d96('0x5')](_0x7d96('0x4'),_0x314c29?_0x314c29:this[_0x7d96('0x3')]('name'));}},'type':{'type':Sequelize[_0x7d96('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x7d96('0x7')](_0x7d96('0x8')),'get':function(){if(this['getDataValue'](_0x7d96('0x9'))==='select'){return JSON[_0x7d96('0xa')](this[_0x7d96('0x3')](_0x7d96('0xb')));}else{return this[_0x7d96('0x3')](_0x7d96('0xb'));}},'set':function(_0x420a08){if(Array['isArray'](_0x420a08)){this[_0x7d96('0x5')](_0x7d96('0xb'),JSON[_0x7d96('0xc')](_0x420a08));}else{this[_0x7d96('0x5')]('values',_0x420a08);}}},'required':{'type':Sequelize[_0x7d96('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7d96('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7d96('0xe')]('voice')}}; \ No newline at end of file +var _0x130d=['name','TEXT','long','type','select','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING'];(function(_0x1adaa9,_0x26efcc){var _0x1ed1f4=function(_0x54f9af){while(--_0x54f9af){_0x1adaa9['push'](_0x1adaa9['shift']());}};_0x1ed1f4(++_0x26efcc);}(_0x130d,0xdd));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd130('0x0'));var _=require(_0xd130('0x1'));module[_0xd130('0x2')]={'name':{'type':Sequelize[_0xd130('0x3')],'get':function(_0x58dc04){return this[_0xd130('0x4')](_0xd130('0x5'));}},'alias':{'type':Sequelize[_0xd130('0x6')],'allowNull':![],'set':function(_0x394571){this['setDataValue'](_0xd130('0x5'),_0x394571?_0x394571:this[_0xd130('0x4')](_0xd130('0x7')));}},'type':{'type':Sequelize[_0xd130('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xd130('0x8')](_0xd130('0x9')),'get':function(){if(this['getDataValue'](_0xd130('0xa'))===_0xd130('0xb')){return JSON['parse'](this[_0xd130('0x4')](_0xd130('0xc')));}else{return this[_0xd130('0x4')](_0xd130('0xc'));}},'set':function(_0x3e4186){if(Array[_0xd130('0xd')](_0x3e4186)){this[_0xd130('0xe')](_0xd130('0xc'),JSON[_0xd130('0xf')](_0x3e4186));}else{this[_0xd130('0xe')](_0xd130('0xc'),_0x3e4186);}}},'required':{'type':Sequelize[_0xd130('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd130('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd130('0x11')](_0xd130('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index c85b106..06075eb 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 _0x55e5=['stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','transaction','TEXT','text','Sequelize','INTEGER','switch','defaultValue','sequelize','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error'];(function(_0x286749,_0x5e4a13){var _0x78e0cb=function(_0x4c9acf){while(--_0x4c9acf){_0x286749['push'](_0x286749['shift']());}};_0x78e0cb(++_0x5e4a13);}(_0x55e5,0xe1));var _0x555e=function(_0x4371f9,_0x1ccee6){_0x4371f9=_0x4371f9-0x0;var _0x3c4ca5=_0x55e5[_0x4371f9];return _0x3c4ca5;};'use strict';var emlformat=require(_0x555e('0x0'));var rimraf=require(_0x555e('0x1'));var zipdir=require(_0x555e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x555e('0x3'));var BPromise=require(_0x555e('0x4'));var Mustache=require('mustache');var util=require(_0x555e('0x5'));var path=require(_0x555e('0x6'));var sox=require('sox');var csv=require(_0x555e('0x7'));var ejs=require(_0x555e('0x8'));var fs=require('fs');var fs_extra=require(_0x555e('0x9'));var _=require(_0x555e('0xa'));var squel=require(_0x555e('0xb'));var crypto=require(_0x555e('0xc'));var jsforce=require(_0x555e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x555e('0x7'));var querystring=require(_0x555e('0xe'));var Papa=require(_0x555e('0xf'));var Redis=require('ioredis');var authService=require(_0x555e('0x10'));var qs=require(_0x555e('0x11'));var as=require(_0x555e('0x12'));var hardwareService=require(_0x555e('0x13'));var logger=require(_0x555e('0x14'))(_0x555e('0x15'));var utils=require(_0x555e('0x16'));var config=require(_0x555e('0x17'));var licenseUtil=require(_0x555e('0x18'));var db=require(_0x555e('0x19'))['db'];function respondWithStatusCode(_0x4bab5a,_0x170b29){_0x170b29=_0x170b29||0xcc;return function(_0x1ac745){if(_0x1ac745){return _0x4bab5a[_0x555e('0x1a')](_0x170b29);}return _0x4bab5a[_0x555e('0x1b')](_0x170b29)['end']();};}function respondWithResult(_0x3d52ba,_0x31ddf7){_0x31ddf7=_0x31ddf7||0xc8;return function(_0x5a0fea){if(_0x5a0fea){return _0x3d52ba[_0x555e('0x1b')](_0x31ddf7)[_0x555e('0x1c')](_0x5a0fea);}};}function respondWithFilteredResult(_0x50ea99,_0x3f2d6b){return function(_0x5aeabf){if(_0x5aeabf){var _0x55924a=typeof _0x3f2d6b[_0x555e('0x1d')]===_0x555e('0x1e')&&typeof _0x3f2d6b['limit']==='undefined';var _0x13a7f2=_0x5aeabf[_0x555e('0x1f')];var _0x541012=_0x55924a?0x0:_0x3f2d6b['offset'];var _0x306317=_0x55924a?_0x5aeabf[_0x555e('0x1f')]:_0x3f2d6b['offset']+_0x3f2d6b[_0x555e('0x20')];var _0x36a3c3;if(_0x306317>=_0x13a7f2){_0x306317=_0x13a7f2;_0x36a3c3=0xc8;}else{_0x36a3c3=0xce;}_0x50ea99[_0x555e('0x1b')](_0x36a3c3);return _0x50ea99[_0x555e('0x21')](_0x555e('0x22'),_0x541012+'-'+_0x306317+'/'+_0x13a7f2)[_0x555e('0x1c')](_0x5aeabf);}return null;};}function patchUpdates(_0x4135dd){return function(_0x4d9026){try{jsonpatch['apply'](_0x4d9026,_0x4135dd,!![]);}catch(_0x2abf05){return BPromise[_0x555e('0x23')](_0x2abf05);}return _0x4d9026[_0x555e('0x24')]();};}function saveUpdates(_0x5626c0,_0x3063da){return function(_0x55efc7){if(_0x55efc7){return _0x55efc7[_0x555e('0x25')](_0x5626c0)[_0x555e('0x26')](function(_0x4627b3){return _0x4627b3;});}return null;};}function removeEntity(_0x107d2a,_0x6ce9f9){return function(_0xcaa184){if(_0xcaa184){return _0xcaa184[_0x555e('0x27')]()['then'](function(){_0x107d2a[_0x555e('0x1b')](0xcc)[_0x555e('0x28')]();});}};}function handleEntityNotFound(_0x18b609,_0x3fb43d){return function(_0x4999ad){if(!_0x4999ad){_0x18b609[_0x555e('0x1a')](0x194);}return _0x4999ad;};}function handleError(_0x2926ba,_0x3e8a15){_0x3e8a15=_0x3e8a15||0x1f4;return function(_0x245c9e){logger[_0x555e('0x29')](_0x245c9e[_0x555e('0x2a')]);if(_0x245c9e[_0x555e('0x2b')]){delete _0x245c9e[_0x555e('0x2b')];}_0x2926ba['status'](_0x3e8a15)[_0x555e('0x2c')](_0x245c9e);};}exports[_0x555e('0x2d')]=function(_0x429de3,_0x178c8b){var _0x31640c={},_0x41197b={},_0x444c86={'count':0x0,'rows':[]};var _0x5cee53=_[_0x555e('0x2e')](db[_0x555e('0x2f')][_0x555e('0x30')],function(_0xd3594a){return{'name':_0xd3594a[_0x555e('0x31')],'type':_0xd3594a[_0x555e('0x32')]['key']};});_0x41197b[_0x555e('0x33')]=_[_0x555e('0x34')](_[_0x555e('0x2e')](_0x5cee53,_0x555e('0x2b')),[_0x555e('0x2b')]);_0x41197b[_0x555e('0x35')]=_[_0x555e('0x36')](_0x429de3[_0x555e('0x35')]);_0x41197b['filters']=_['intersection'](_0x41197b[_0x555e('0x33')],_0x41197b[_0x555e('0x35')]);_0x31640c[_0x555e('0x37')]=_[_0x555e('0x38')](_0x41197b[_0x555e('0x33')],qs['fields'](_0x429de3[_0x555e('0x35')][_0x555e('0x39')]));_0x31640c['attributes']=_0x31640c[_0x555e('0x37')][_0x555e('0x3a')]?_0x31640c[_0x555e('0x37')]:_0x41197b[_0x555e('0x33')];if(!_0x429de3['query'][_0x555e('0x3b')](_0x555e('0x3c'))){_0x31640c[_0x555e('0x20')]=qs[_0x555e('0x20')](_0x429de3[_0x555e('0x35')][_0x555e('0x20')]);_0x31640c['offset']=qs[_0x555e('0x1d')](_0x429de3[_0x555e('0x35')]['offset']);}_0x31640c[_0x555e('0x3d')]=qs[_0x555e('0x3e')](_0x429de3[_0x555e('0x35')][_0x555e('0x3e')]);_0x31640c['where']=qs[_0x555e('0x3f')](_['pick'](_0x429de3[_0x555e('0x35')],_0x41197b[_0x555e('0x3f')]),_0x5cee53);if(_0x429de3[_0x555e('0x35')][_0x555e('0x40')]){_0x31640c[_0x555e('0x41')]=_[_0x555e('0x42')](_0x31640c[_0x555e('0x41')],{'$or':_[_0x555e('0x2e')](_0x5cee53,function(_0x175b53){if(_0x175b53[_0x555e('0x32')]!==_0x555e('0x43')){var _0x23a059={};_0x23a059[_0x175b53[_0x555e('0x2b')]]={'$like':'%'+_0x429de3[_0x555e('0x35')][_0x555e('0x40')]+'%'};return _0x23a059;}})});}_0x31640c=_[_0x555e('0x42')]({},_0x31640c,_0x429de3[_0x555e('0x44')]);var _0x370135={'where':_0x31640c[_0x555e('0x41')]};return db[_0x555e('0x2f')][_0x555e('0x1f')](_0x370135)['then'](function(_0x5ba9a6){_0x444c86[_0x555e('0x1f')]=_0x5ba9a6;if(_0x429de3['query'][_0x555e('0x45')]){_0x31640c[_0x555e('0x46')]=[{'all':!![]}];}return db[_0x555e('0x2f')][_0x555e('0x47')](_0x31640c);})['then'](function(_0x2304a8){_0x444c86[_0x555e('0x48')]=_0x2304a8;return _0x444c86;})['then'](respondWithFilteredResult(_0x178c8b,_0x31640c))[_0x555e('0x49')](handleError(_0x178c8b,null));};exports[_0x555e('0x4a')]=function(_0x27fd89,_0x5c6ed6){var _0x217dcb={'raw':!![],'where':{'id':_0x27fd89[_0x555e('0x4b')]['id']}},_0x57d805={};_0x57d805[_0x555e('0x33')]=_[_0x555e('0x36')](db['CmCustomField'][_0x555e('0x30')]);_0x57d805[_0x555e('0x35')]=_['keys'](_0x27fd89[_0x555e('0x35')]);_0x57d805[_0x555e('0x3f')]=_[_0x555e('0x38')](_0x57d805[_0x555e('0x33')],_0x57d805[_0x555e('0x35')]);_0x217dcb[_0x555e('0x37')]=_['intersection'](_0x57d805[_0x555e('0x33')],qs[_0x555e('0x39')](_0x27fd89[_0x555e('0x35')][_0x555e('0x39')]));_0x217dcb[_0x555e('0x37')]=_0x217dcb[_0x555e('0x37')]['length']?_0x217dcb[_0x555e('0x37')]:_0x57d805['model'];if(_0x27fd89[_0x555e('0x35')][_0x555e('0x45')]){_0x217dcb[_0x555e('0x46')]=[{'all':!![]}];}_0x217dcb=_['merge']({},_0x217dcb,_0x27fd89[_0x555e('0x44')]);return db[_0x555e('0x2f')]['find'](_0x217dcb)[_0x555e('0x26')](handleEntityNotFound(_0x5c6ed6,null))[_0x555e('0x26')](respondWithResult(_0x5c6ed6,null))[_0x555e('0x49')](handleError(_0x5c6ed6,null));};exports[_0x555e('0x25')]=function(_0x38ebdb,_0xac4c0c){if(_0x38ebdb[_0x555e('0x4c')]['id']){delete _0x38ebdb[_0x555e('0x4c')]['id'];}return db[_0x555e('0x2f')][_0x555e('0x4d')]({'where':{'id':_0x38ebdb[_0x555e('0x4b')]['id']}})[_0x555e('0x26')](handleEntityNotFound(_0xac4c0c,null))['then'](saveUpdates(_0x38ebdb[_0x555e('0x4c')],null))['then'](respondWithResult(_0xac4c0c,null))['catch'](handleError(_0xac4c0c,null));};exports[_0x555e('0x27')]=function(_0x469652,_0x3f745a){return db['CmCustomField'][_0x555e('0x4d')]({'where':{'id':_0x469652[_0x555e('0x4b')]['id']}})[_0x555e('0x26')](handleEntityNotFound(_0x3f745a,null))[_0x555e('0x26')](removeEntity(_0x3f745a,null))[_0x555e('0x49')](handleError(_0x3f745a,null));};exports['create']=function(_0x27d525,_0x3c0fcc){var _0x476706;return db['sequelize'][_0x555e('0x4e')](function(_0x5281ec){return db['CmCustomField']['create'](_0x27d525[_0x555e('0x4c')],{'transaction':_0x5281ec})[_0x555e('0x26')](function(_0x54e34a){_0x476706=_0x54e34a;var _0x12a0dc={'type':db['Sequelize'][_0x555e('0x4f')],'transaction':_0x5281ec};switch(_0x27d525[_0x555e('0x4c')][_0x555e('0x32')]){case _0x555e('0x50'):_0x12a0dc['type']=db[_0x555e('0x51')][_0x555e('0x4f')];break;case'number':_0x12a0dc[_0x555e('0x32')]=db[_0x555e('0x51')][_0x555e('0x52')];break;case _0x555e('0x53'):_0x12a0dc['type']=db[_0x555e('0x51')]['BOOLEAN'];_0x12a0dc[_0x555e('0x54')]=![];break;default:}return db[_0x555e('0x55')]['queryInterface'][_0x555e('0x56')]('cm_contacts',util[_0x555e('0x57')](_0x555e('0x58'),_0x476706['id']),_0x12a0dc);})[_0x555e('0x26')](function(){return _0x476706;});})[_0x555e('0x26')](respondWithResult(_0x3c0fcc,0xc9))[_0x555e('0x49')](handleError(_0x3c0fcc,null));}; \ No newline at end of file +var _0x8e91=['CmCustomField','then','include','rows','catch','keys','includeAll','update','body','params','find','create','text','Sequelize','TEXT','INTEGER','switch','BOOLEAN','sequelize','addColumn','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','reject','save','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8e91,0x1aa));var _0x18e9=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x8e91[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x18e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18e9('0x1'));var jsonpatch=require(_0x18e9('0x2'));var rp=require('request-promise');var moment=require(_0x18e9('0x3'));var BPromise=require(_0x18e9('0x4'));var Mustache=require(_0x18e9('0x5'));var util=require(_0x18e9('0x6'));var path=require(_0x18e9('0x7'));var sox=require(_0x18e9('0x8'));var csv=require(_0x18e9('0x9'));var ejs=require(_0x18e9('0xa'));var fs=require('fs');var fs_extra=require(_0x18e9('0xb'));var _=require(_0x18e9('0xc'));var squel=require('squel');var crypto=require(_0x18e9('0xd'));var jsforce=require(_0x18e9('0xe'));var deskjs=require(_0x18e9('0xf'));var toCsv=require(_0x18e9('0x9'));var querystring=require(_0x18e9('0x10'));var Papa=require('papaparse');var Redis=require(_0x18e9('0x11'));var authService=require(_0x18e9('0x12'));var qs=require(_0x18e9('0x13'));var as=require(_0x18e9('0x14'));var hardwareService=require(_0x18e9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x18e9('0x16'));var config=require(_0x18e9('0x17'));var licenseUtil=require(_0x18e9('0x18'));var db=require(_0x18e9('0x19'))['db'];function respondWithStatusCode(_0x32e30,_0x169bb9){_0x169bb9=_0x169bb9||0xcc;return function(_0x336389){if(_0x336389){return _0x32e30['sendStatus'](_0x169bb9);}return _0x32e30[_0x18e9('0x1a')](_0x169bb9)['end']();};}function respondWithResult(_0x2a64cf,_0x41ea4b){_0x41ea4b=_0x41ea4b||0xc8;return function(_0x328c1e){if(_0x328c1e){return _0x2a64cf[_0x18e9('0x1a')](_0x41ea4b)[_0x18e9('0x1b')](_0x328c1e);}};}function respondWithFilteredResult(_0x1c3ca9,_0x2cbdf7){return function(_0x2528d7){if(_0x2528d7){var _0x47a412=typeof _0x2cbdf7[_0x18e9('0x1c')]==='undefined'&&typeof _0x2cbdf7[_0x18e9('0x1d')]===_0x18e9('0x1e');var _0x12930c=_0x2528d7[_0x18e9('0x1f')];var _0x357f3f=_0x47a412?0x0:_0x2cbdf7[_0x18e9('0x1c')];var _0x5e1996=_0x47a412?_0x2528d7[_0x18e9('0x1f')]:_0x2cbdf7['offset']+_0x2cbdf7[_0x18e9('0x1d')];var _0x2d207e;if(_0x5e1996>=_0x12930c){_0x5e1996=_0x12930c;_0x2d207e=0xc8;}else{_0x2d207e=0xce;}_0x1c3ca9['status'](_0x2d207e);return _0x1c3ca9['set']('Content-Range',_0x357f3f+'-'+_0x5e1996+'/'+_0x12930c)[_0x18e9('0x1b')](_0x2528d7);}return null;};}function patchUpdates(_0x321dc5){return function(_0x329dfc){try{jsonpatch['apply'](_0x329dfc,_0x321dc5,!![]);}catch(_0x59c7df){return BPromise[_0x18e9('0x20')](_0x59c7df);}return _0x329dfc[_0x18e9('0x21')]();};}function saveUpdates(_0x2f3c1c,_0x561f9c){return function(_0xca0bbc){if(_0xca0bbc){return _0xca0bbc['update'](_0x2f3c1c)['then'](function(_0x1b3119){return _0x1b3119;});}return null;};}function removeEntity(_0x28ac5f,_0x8668f6){return function(_0x38e927){if(_0x38e927){return _0x38e927[_0x18e9('0x22')]()['then'](function(){_0x28ac5f[_0x18e9('0x1a')](0xcc)[_0x18e9('0x23')]();});}};}function handleEntityNotFound(_0xe86354,_0x54e479){return function(_0x338847){if(!_0x338847){_0xe86354[_0x18e9('0x24')](0x194);}return _0x338847;};}function handleError(_0x414b71,_0x5eef11){_0x5eef11=_0x5eef11||0x1f4;return function(_0x2dd73c){logger[_0x18e9('0x25')](_0x2dd73c['stack']);if(_0x2dd73c[_0x18e9('0x26')]){delete _0x2dd73c[_0x18e9('0x26')];}_0x414b71[_0x18e9('0x1a')](_0x5eef11)[_0x18e9('0x27')](_0x2dd73c);};}exports[_0x18e9('0x28')]=function(_0x1181d7,_0x109ba3){var _0x112b7d={},_0x43a2bc={},_0x1ebe5a={'count':0x0,'rows':[]};var _0x504ff1=_[_0x18e9('0x29')](db['CmCustomField'][_0x18e9('0x2a')],function(_0x288581){return{'name':_0x288581['fieldName'],'type':_0x288581[_0x18e9('0x2b')][_0x18e9('0x2c')]};});_0x43a2bc[_0x18e9('0x2d')]=_['differenceBy'](_['map'](_0x504ff1,_0x18e9('0x26')),[_0x18e9('0x26')]);_0x43a2bc['query']=_['keys'](_0x1181d7['query']);_0x43a2bc['filters']=_['intersection'](_0x43a2bc[_0x18e9('0x2d')],_0x43a2bc[_0x18e9('0x2e')]);_0x112b7d[_0x18e9('0x2f')]=_[_0x18e9('0x30')](_0x43a2bc['model'],qs[_0x18e9('0x31')](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x31')]));_0x112b7d['attributes']=_0x112b7d[_0x18e9('0x2f')][_0x18e9('0x32')]?_0x112b7d['attributes']:_0x43a2bc[_0x18e9('0x2d')];if(!_0x1181d7['query'][_0x18e9('0x33')]('nolimit')){_0x112b7d[_0x18e9('0x1d')]=qs[_0x18e9('0x1d')](_0x1181d7[_0x18e9('0x2e')]['limit']);_0x112b7d[_0x18e9('0x1c')]=qs['offset'](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x1c')]);}_0x112b7d[_0x18e9('0x34')]=qs[_0x18e9('0x35')](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x35')]);_0x112b7d[_0x18e9('0x36')]=qs[_0x18e9('0x37')](_['pick'](_0x1181d7[_0x18e9('0x2e')],_0x43a2bc['filters']),_0x504ff1);if(_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x38')]){_0x112b7d[_0x18e9('0x36')]=_[_0x18e9('0x39')](_0x112b7d[_0x18e9('0x36')],{'$or':_[_0x18e9('0x29')](_0x504ff1,function(_0x33d214){if(_0x33d214['type']!==_0x18e9('0x3a')){var _0x150598={};_0x150598[_0x33d214['name']]={'$like':'%'+_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x38')]+'%'};return _0x150598;}})});}_0x112b7d=_[_0x18e9('0x39')]({},_0x112b7d,_0x1181d7[_0x18e9('0x3b')]);var _0x203582={'where':_0x112b7d[_0x18e9('0x36')]};return db[_0x18e9('0x3c')]['count'](_0x203582)[_0x18e9('0x3d')](function(_0x132822){_0x1ebe5a['count']=_0x132822;if(_0x1181d7['query']['includeAll']){_0x112b7d[_0x18e9('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x112b7d);})[_0x18e9('0x3d')](function(_0x3933b2){_0x1ebe5a[_0x18e9('0x3f')]=_0x3933b2;return _0x1ebe5a;})['then'](respondWithFilteredResult(_0x109ba3,_0x112b7d))[_0x18e9('0x40')](handleError(_0x109ba3,null));};exports['show']=function(_0x42a733,_0x2efc91){var _0x3aa976={'raw':!![],'where':{'id':_0x42a733['params']['id']}},_0xdfea63={};_0xdfea63[_0x18e9('0x2d')]=_[_0x18e9('0x41')](db['CmCustomField'][_0x18e9('0x2a')]);_0xdfea63[_0x18e9('0x2e')]=_['keys'](_0x42a733[_0x18e9('0x2e')]);_0xdfea63[_0x18e9('0x37')]=_['intersection'](_0xdfea63[_0x18e9('0x2d')],_0xdfea63[_0x18e9('0x2e')]);_0x3aa976[_0x18e9('0x2f')]=_['intersection'](_0xdfea63[_0x18e9('0x2d')],qs[_0x18e9('0x31')](_0x42a733[_0x18e9('0x2e')]['fields']));_0x3aa976[_0x18e9('0x2f')]=_0x3aa976[_0x18e9('0x2f')][_0x18e9('0x32')]?_0x3aa976[_0x18e9('0x2f')]:_0xdfea63['model'];if(_0x42a733[_0x18e9('0x2e')][_0x18e9('0x42')]){_0x3aa976[_0x18e9('0x3e')]=[{'all':!![]}];}_0x3aa976=_[_0x18e9('0x39')]({},_0x3aa976,_0x42a733[_0x18e9('0x3b')]);return db[_0x18e9('0x3c')]['find'](_0x3aa976)[_0x18e9('0x3d')](handleEntityNotFound(_0x2efc91,null))['then'](respondWithResult(_0x2efc91,null))[_0x18e9('0x40')](handleError(_0x2efc91,null));};exports[_0x18e9('0x43')]=function(_0x23029a,_0x241559){if(_0x23029a[_0x18e9('0x44')]['id']){delete _0x23029a['body']['id'];}return db[_0x18e9('0x3c')]['find']({'where':{'id':_0x23029a[_0x18e9('0x45')]['id']}})['then'](handleEntityNotFound(_0x241559,null))[_0x18e9('0x3d')](saveUpdates(_0x23029a[_0x18e9('0x44')],null))[_0x18e9('0x3d')](respondWithResult(_0x241559,null))[_0x18e9('0x40')](handleError(_0x241559,null));};exports[_0x18e9('0x22')]=function(_0x4bed9d,_0x4b4099){return db[_0x18e9('0x3c')][_0x18e9('0x46')]({'where':{'id':_0x4bed9d[_0x18e9('0x45')]['id']}})[_0x18e9('0x3d')](handleEntityNotFound(_0x4b4099,null))[_0x18e9('0x3d')](removeEntity(_0x4b4099,null))['catch'](handleError(_0x4b4099,null));};exports[_0x18e9('0x47')]=function(_0x9a71fb,_0x5789e8){var _0x35ad17;return db['sequelize']['transaction'](function(_0x20f885){return db[_0x18e9('0x3c')]['create'](_0x9a71fb['body'],{'transaction':_0x20f885})[_0x18e9('0x3d')](function(_0x660477){_0x35ad17=_0x660477;var _0x2861f6={'type':db['Sequelize']['TEXT'],'transaction':_0x20f885};switch(_0x9a71fb['body'][_0x18e9('0x2b')]){case _0x18e9('0x48'):_0x2861f6[_0x18e9('0x2b')]=db[_0x18e9('0x49')][_0x18e9('0x4a')];break;case'number':_0x2861f6[_0x18e9('0x2b')]=db[_0x18e9('0x49')][_0x18e9('0x4b')];break;case _0x18e9('0x4c'):_0x2861f6[_0x18e9('0x2b')]=db['Sequelize'][_0x18e9('0x4d')];_0x2861f6['defaultValue']=![];break;default:}return db[_0x18e9('0x4e')]['queryInterface'][_0x18e9('0x4f')]('cm_contacts',util['format'](_0x18e9('0x50'),_0x35ad17['id']),_0x2861f6);})[_0x18e9('0x3d')](function(){return _0x35ad17;});})[_0x18e9('0x3d')](respondWithResult(_0x5789e8,0xc9))['catch'](handleError(_0x5789e8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 7dd2748..150dbd0 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 _0x1f76=['CmCustomField','cm_custom_fields','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x48271f,_0xc4f6d3){var _0x13eb5c=function(_0x1a4acd){while(--_0x1a4acd){_0x48271f['push'](_0x48271f['shift']());}};_0x13eb5c(++_0xc4f6d3);}(_0x1f76,0x1d6));var _0x61f7=function(_0x3c6c2a,_0x28ef97){_0x3c6c2a=_0x3c6c2a-0x0;var _0x3c3ac9=_0x1f76[_0x3c6c2a];return _0x3c3ac9;};'use strict';var _=require(_0x61f7('0x0'));var util=require(_0x61f7('0x1'));var logger=require('../../config/logger')(_0x61f7('0x2'));var moment=require('moment');var BPromise=require(_0x61f7('0x3'));var rp=require(_0x61f7('0x4'));var fs=require('fs');var path=require(_0x61f7('0x5'));var rimraf=require(_0x61f7('0x6'));var config=require(_0x61f7('0x7'));var attributes=require(_0x61f7('0x8'));module[_0x61f7('0x9')]=function(_0x4eb26c,_0x7aa15b){return _0x4eb26c[_0x61f7('0xa')](_0x61f7('0xb'),attributes,{'tableName':_0x61f7('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63b1=['rimraf','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x63b1,0x1a5));var _0x163b=function(_0x4892da,_0x5cb928){_0x4892da=_0x4892da-0x0;var _0x15c412=_0x63b1[_0x4892da];return _0x15c412;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var logger=require(_0x163b('0x2'))(_0x163b('0x3'));var moment=require(_0x163b('0x4'));var BPromise=require(_0x163b('0x5'));var rp=require(_0x163b('0x6'));var fs=require('fs');var path=require(_0x163b('0x7'));var rimraf=require(_0x163b('0x8'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x522d34,_0x44df16){return _0x522d34['define'](_0x163b('0x9'),attributes,{'tableName':_0x163b('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 2e30210..fd5a0c1 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 _0xa7c8=['http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x24d629,_0x9e418c){var _0x2728fd=function(_0x4469fa){while(--_0x4469fa){_0x24d629['push'](_0x24d629['shift']());}};_0x2728fd(++_0x9e418c);}(_0xa7c8,0xa8));var _0x8a7c=function(_0x1f7d6c,_0x512583){_0x1f7d6c=_0x1f7d6c-0x0;var _0x5e0321=_0xa7c8[_0x1f7d6c];return _0x5e0321;};'use strict';var _=require(_0x8a7c('0x0'));var util=require('util');var moment=require(_0x8a7c('0x1'));var BPromise=require(_0x8a7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a7c('0x3'));var logger=require(_0x8a7c('0x4'))(_0x8a7c('0x5'));var config=require(_0x8a7c('0x6'));var jayson=require(_0x8a7c('0x7'));var client=jayson['client'][_0x8a7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x503b55,_0x44cc5f,_0x57e454){return new BPromise(function(_0x5c2a3a,_0x5b105b){return client[_0x8a7c('0x9')](_0x503b55,_0x57e454)[_0x8a7c('0xa')](function(_0x39c39e){logger[_0x8a7c('0xb')](_0x8a7c('0xc'),_0x44cc5f,'request\x20sent');logger[_0x8a7c('0xd')](_0x8a7c('0xe'),_0x44cc5f,_0x8a7c('0xf'),JSON[_0x8a7c('0x10')](_0x39c39e));if(_0x39c39e[_0x8a7c('0x11')]){if(_0x39c39e['error'][_0x8a7c('0x12')]===0x1f4){logger[_0x8a7c('0x11')](_0x8a7c('0xc'),_0x44cc5f,_0x39c39e['error'][_0x8a7c('0x13')]);return _0x5b105b(_0x39c39e[_0x8a7c('0x11')][_0x8a7c('0x13')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x44cc5f,_0x39c39e['error'][_0x8a7c('0x13')]);return _0x5c2a3a(_0x39c39e[_0x8a7c('0x11')]['message']);}else{logger[_0x8a7c('0xb')](_0x8a7c('0xc'),_0x44cc5f,_0x8a7c('0xf'));_0x5c2a3a(_0x39c39e[_0x8a7c('0x14')]['message']);}})[_0x8a7c('0x15')](function(_0x308026){logger[_0x8a7c('0x11')](_0x8a7c('0xc'),_0x44cc5f,_0x308026);_0x5b105b(_0x308026);});});} \ No newline at end of file +var _0x3cdb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x3cdb,0xa6));var _0xb3cd=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x3cdb[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xb3cd('0x0'));var util=require(_0xb3cd('0x1'));var moment=require(_0xb3cd('0x2'));var BPromise=require(_0xb3cd('0x3'));var rs=require(_0xb3cd('0x4'));var fs=require('fs');var Redis=require(_0xb3cd('0x5'));var db=require(_0xb3cd('0x6'))['db'];var utils=require(_0xb3cd('0x7'));var logger=require(_0xb3cd('0x8'))('rpc');var config=require(_0xb3cd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb3cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32185c,_0x2fabd3,_0x108b23){return new BPromise(function(_0x183908,_0x58229d){return client[_0xb3cd('0xb')](_0x32185c,_0x108b23)['then'](function(_0x16c47f){logger[_0xb3cd('0xc')](_0xb3cd('0xd'),_0x2fabd3,_0xb3cd('0xe'));logger[_0xb3cd('0xf')](_0xb3cd('0x10'),_0x2fabd3,_0xb3cd('0xe'),JSON[_0xb3cd('0x11')](_0x16c47f));if(_0x16c47f[_0xb3cd('0x12')]){if(_0x16c47f[_0xb3cd('0x12')][_0xb3cd('0x13')]===0x1f4){logger[_0xb3cd('0x12')](_0xb3cd('0xd'),_0x2fabd3,_0x16c47f[_0xb3cd('0x12')]['message']);return _0x58229d(_0x16c47f[_0xb3cd('0x12')][_0xb3cd('0x14')]);}logger[_0xb3cd('0x12')](_0xb3cd('0xd'),_0x2fabd3,_0x16c47f[_0xb3cd('0x12')]['message']);return _0x183908(_0x16c47f['error'][_0xb3cd('0x14')]);}else{logger[_0xb3cd('0xc')](_0xb3cd('0xd'),_0x2fabd3,_0xb3cd('0xe'));_0x183908(_0x16c47f['result'][_0xb3cd('0x14')]);}})['catch'](function(_0x5d3877){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2fabd3,_0x5d3877);_0x58229d(_0x5d3877);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f2cec97..7a38b41 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 _0x120b=['./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x120b,0x8f));var _0xb120=function(_0x22d984,_0x114eab){_0x22d984=_0x22d984-0x0;var _0x420991=_0x120b[_0x22d984];return _0x420991;};'use strict';var multer=require(_0xb120('0x0'));var util=require(_0xb120('0x1'));var path=require('path');var timeout=require(_0xb120('0x2'));var express=require(_0xb120('0x3'));var router=express[_0xb120('0x4')]();var fs_extra=require(_0xb120('0x5'));var auth=require(_0xb120('0x6'));var interaction=require(_0xb120('0x7'));var config=require(_0xb120('0x8'));var controller=require(_0xb120('0x9'));router[_0xb120('0xa')]('/',auth[_0xb120('0xb')](),controller[_0xb120('0xc')]);router['get'](_0xb120('0xd'),auth[_0xb120('0xb')](),controller[_0xb120('0xe')]);router['post']('/',auth[_0xb120('0xb')](),controller[_0xb120('0xf')]);router['put']('/:id',auth[_0xb120('0xb')](),controller[_0xb120('0x10')]);router[_0xb120('0x11')](_0xb120('0xd'),auth[_0xb120('0xb')](),controller[_0xb120('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8f53=['index','/:id','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','./cmCustomField.controller','get','isAuthenticated'];(function(_0xad6ff1,_0x3ffe70){var _0x28c697=function(_0x15732b){while(--_0x15732b){_0xad6ff1['push'](_0xad6ff1['shift']());}};_0x28c697(++_0x3ffe70);}(_0x8f53,0x128));var _0x38f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f53[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var path=require(_0x38f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x38f5('0x3')]();var fs_extra=require(_0x38f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38f5('0x5'));router[_0x38f5('0x6')]('/',auth[_0x38f5('0x7')](),controller[_0x38f5('0x8')]);router[_0x38f5('0x6')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xa')]);router[_0x38f5('0xb')]('/',auth['isAuthenticated'](),controller[_0x38f5('0xc')]);router['put']('/:id',auth[_0x38f5('0x7')](),controller[_0x38f5('0xd')]);router[_0x38f5('0xe')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b5c50a6..47aff00 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 _0xcecd=['exports','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcecd,0x8c));var _0xdcec=function(_0x16ac49,_0x5bcd1b){_0x16ac49=_0x16ac49-0x0;var _0x5b297a=_0xcecd[_0x16ac49];return _0x5b297a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xdcec('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xdcec('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xdcec('0x2')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdcec('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdcec('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdcec('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xdcec('0x3')],'unique':_0xdcec('0x5')},'ListId':{'type':Sequelize[_0xdcec('0x3')],'unique':_0xdcec('0x5')},'UserId':{'type':Sequelize[_0xdcec('0x3')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdcec('0x3')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xdcec('0x3')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdcec('0x6')]},'recallmeNotifiedDate':{'type':Sequelize[_0xdcec('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xc4e3=['sequelize','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue'];(function(_0x3cf5c7,_0x1eb319){var _0xf3d981=function(_0x3521ef){while(--_0x3521ef){_0x3cf5c7['push'](_0x3cf5c7['shift']());}};_0xf3d981(++_0x1eb319);}(_0xc4e3,0x90));var _0x3c4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4e3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x3c4e('0x0'));module['exports']={'phone':{'type':Sequelize[_0x3c4e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3c4e('0x3')],'defaultValue':moment()[_0x3c4e('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c4e('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3c4e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3c4e('0x5')],'unique':_0x3c4e('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3c4e('0x5')],'unique':_0x3c4e('0x7')},'CampaignId':{'type':Sequelize[_0x3c4e('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3c4e('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3c4e('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3c4e('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f32a2b3..83d11bd 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 _0xd6d2=['find','create','body','destroy','VoiceQueueId','CampaignId','Campaign','dataValues','createdAt','state','statedesc','campaign','membername','user','UserId','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','describe','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','List','VoiceQueue','Queue','dialActive','UPDATE','CmList','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','intersection','filters','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','length'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x19ab37,_0xf13b13){_0x19ab37=_0x19ab37-0x0;var _0x4abc0e=_0xd6d2[_0x19ab37];return _0x4abc0e;};'use strict';var moment=require(_0x2d6d('0x0'));var _=require(_0x2d6d('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x2d6d('0x2'))(_0x2d6d('0x3'));var shared=require('../../config/environment');var db=require(_0x2d6d('0x4'))['db'];function respondWithResult(_0x482d86,_0x1c5e54){_0x1c5e54=_0x1c5e54||0xc8;return function(_0x3ee519){if(_0x3ee519){return _0x482d86[_0x2d6d('0x5')](_0x1c5e54)['json'](_0x3ee519);}};}function respondWithFilteredResult(_0xfcdb1d,_0x132361){return function(_0xf59b20){if(_0xf59b20){var _0x45b7b9=typeof _0x132361[_0x2d6d('0x6')]===_0x2d6d('0x7')&&typeof _0x132361[_0x2d6d('0x8')]===_0x2d6d('0x7');var _0x8e4be8=_0xf59b20[_0x2d6d('0x9')];var _0x1a1f60=_0x45b7b9?0x0:_0x132361['offset'];var _0x25fc41=_0x45b7b9?_0xf59b20[_0x2d6d('0x9')]:_0x132361[_0x2d6d('0x6')]+_0x132361[_0x2d6d('0x8')];var _0x4143d5;if(_0x25fc41>=_0x8e4be8){_0x25fc41=_0x8e4be8;_0x4143d5=0xc8;}else{_0x4143d5=0xce;}_0xfcdb1d['status'](_0x4143d5);return _0xfcdb1d[_0x2d6d('0xa')](_0x2d6d('0xb'),_0x1a1f60+'-'+_0x25fc41+'/'+_0x8e4be8)[_0x2d6d('0xc')](_0xf59b20);}return null;};}function saveUpdates(_0x2ad9fc,_0x5c4bf6){return function(_0x5ef174){if(_0x5ef174){return _0x5ef174[_0x2d6d('0xd')](_0x2ad9fc)[_0x2d6d('0xe')](function(_0x46c909){return _0x46c909;});}return null;};}function handleEntityNotFound(_0x3528de,_0x58bd29){return function(_0x1ec6aa){if(!_0x1ec6aa){_0x3528de[_0x2d6d('0xf')](0x194);}return _0x1ec6aa;};}function handleError(_0x48a84e,_0x586085){_0x586085=_0x586085||0x1f4;return function(_0x370096){logger[_0x2d6d('0x10')](_0x370096[_0x2d6d('0x11')]);if(_0x370096['name']){delete _0x370096[_0x2d6d('0x12')];}_0x48a84e['status'](_0x586085)['send'](_0x370096);};}exports['index']=function(_0x1896fc,_0x4179f2){var _0x4426b8={},_0x3c527e={},_0x1d9f01={'count':0x0,'rows':[]};var _0x1bb4db=_[_0x2d6d('0x13')](db[_0x2d6d('0x14')][_0x2d6d('0x15')],function(_0x4898a7){return{'name':_0x4898a7[_0x2d6d('0x16')],'type':_0x4898a7[_0x2d6d('0x17')]['key']};});_0x3c527e[_0x2d6d('0x18')]=_[_0x2d6d('0x13')](_0x1bb4db,_0x2d6d('0x12'));_0x3c527e[_0x2d6d('0x19')]=_[_0x2d6d('0x1a')](_0x1896fc[_0x2d6d('0x19')]);_0x3c527e['filters']=_[_0x2d6d('0x1b')](_0x3c527e[_0x2d6d('0x18')],_0x3c527e[_0x2d6d('0x19')]);_0x3c527e['filters']=_['concat'](_0x3c527e[_0x2d6d('0x1c')],['$and','$or','$gt',_0x2d6d('0x1d'),_0x2d6d('0x1e'),_0x2d6d('0x1f'),_0x2d6d('0x20'),_0x2d6d('0x21'),'$not',_0x2d6d('0x22'),_0x2d6d('0x23'),_0x2d6d('0x24'),_0x2d6d('0x25'),_0x2d6d('0x26'),_0x2d6d('0x27'),_0x2d6d('0x28'),_0x2d6d('0x29'),_0x2d6d('0x26'),'$overlap',_0x2d6d('0x2a'),_0x2d6d('0x2b'),_0x2d6d('0x2c')]);_0x4426b8[_0x2d6d('0x2d')]=_['intersection'](_0x3c527e[_0x2d6d('0x18')],qs['fields'](_0x1896fc[_0x2d6d('0x19')]['fields']));_0x4426b8['attributes']=_0x4426b8[_0x2d6d('0x2d')]['length']?_0x4426b8[_0x2d6d('0x2d')]:_0x3c527e[_0x2d6d('0x18')];if(!_0x1896fc['query'][_0x2d6d('0x2e')]('nolimit')){_0x4426b8[_0x2d6d('0x8')]=qs[_0x2d6d('0x8')](_0x1896fc[_0x2d6d('0x19')][_0x2d6d('0x8')]);_0x4426b8[_0x2d6d('0x6')]=qs[_0x2d6d('0x6')](_0x1896fc[_0x2d6d('0x19')][_0x2d6d('0x6')]);}_0x4426b8['order']=qs[_0x2d6d('0x2f')](_0x1896fc[_0x2d6d('0x19')]['sort']);_0x4426b8[_0x2d6d('0x30')]=qs[_0x2d6d('0x1c')](_[_0x2d6d('0x31')](_0x1896fc[_0x2d6d('0x19')],_0x3c527e[_0x2d6d('0x1c')]),_0x1bb4db);if(_0x1896fc['query']['filter']){_0x4426b8['where']=_[_0x2d6d('0x32')](_0x4426b8[_0x2d6d('0x30')],{'$or':_[_0x2d6d('0x13')](_0x1bb4db,function(_0x54533e){if(_0x54533e[_0x2d6d('0x17')]!==_0x2d6d('0x33')){var _0x29dce0={};_0x29dce0[_0x54533e[_0x2d6d('0x12')]]={'$like':'%'+_0x1896fc['query'][_0x2d6d('0x34')]+'%'};return _0x29dce0;}})});}_0x4426b8=_[_0x2d6d('0x32')]({},_0x4426b8,_0x1896fc[_0x2d6d('0x35')]);var _0x15f9af={'where':_0x4426b8[_0x2d6d('0x30')]};return db[_0x2d6d('0x14')][_0x2d6d('0x9')](_0x15f9af)['then'](function(_0x2f331e){_0x1d9f01[_0x2d6d('0x9')]=_0x2f331e;if(_0x1896fc[_0x2d6d('0x19')][_0x2d6d('0x36')]){_0x4426b8[_0x2d6d('0x37')]=[{'all':!![]}];}return db['CmHopper'][_0x2d6d('0x38')](_0x4426b8);})[_0x2d6d('0xe')](function(_0x352ca9){_0x1d9f01[_0x2d6d('0x39')]=_0x352ca9;return _0x1d9f01;})[_0x2d6d('0xe')](respondWithFilteredResult(_0x4179f2,_0x4426b8))[_0x2d6d('0x3a')](handleError(_0x4179f2,null));};exports[_0x2d6d('0x3b')]=function(_0x124fc2,_0x179fc7){var _0x38cce8={'raw':!![],'where':{'id':_0x124fc2[_0x2d6d('0x3c')]['id']}},_0x3d2fea={};_0x3d2fea[_0x2d6d('0x18')]=_[_0x2d6d('0x1a')](db[_0x2d6d('0x14')][_0x2d6d('0x15')]);_0x3d2fea[_0x2d6d('0x19')]=_['keys'](_0x124fc2[_0x2d6d('0x19')]);_0x3d2fea[_0x2d6d('0x1c')]=_[_0x2d6d('0x1b')](_0x3d2fea[_0x2d6d('0x18')],_0x3d2fea[_0x2d6d('0x19')]);_0x38cce8['attributes']=_[_0x2d6d('0x1b')](_0x3d2fea[_0x2d6d('0x18')],qs[_0x2d6d('0x3d')](_0x124fc2[_0x2d6d('0x19')]['fields']));_0x38cce8[_0x2d6d('0x2d')]=_0x38cce8[_0x2d6d('0x2d')][_0x2d6d('0x3e')]?_0x38cce8[_0x2d6d('0x2d')]:_0x3d2fea[_0x2d6d('0x18')];if(_0x124fc2['query'][_0x2d6d('0x36')]){_0x38cce8[_0x2d6d('0x37')]=[{'all':!![]}];}_0x38cce8=_['merge']({},_0x38cce8,_0x124fc2[_0x2d6d('0x35')]);return db[_0x2d6d('0x14')][_0x2d6d('0x3f')](_0x38cce8)['then'](handleEntityNotFound(_0x179fc7,null))[_0x2d6d('0xe')](respondWithResult(_0x179fc7,null))[_0x2d6d('0x3a')](handleError(_0x179fc7,null));};exports['create']=function(_0x546f1f,_0x4b52a1){return db[_0x2d6d('0x14')][_0x2d6d('0x40')](_0x546f1f['body'],{})[_0x2d6d('0xe')](respondWithResult(_0x4b52a1,0xc9))[_0x2d6d('0x3a')](handleError(_0x4b52a1,null));};exports[_0x2d6d('0xd')]=function(_0x470fb5,_0x4d154c){if(_0x470fb5[_0x2d6d('0x41')]['id']){delete _0x470fb5[_0x2d6d('0x41')]['id'];}return db['CmHopper'][_0x2d6d('0x3f')]({'where':{'id':_0x470fb5[_0x2d6d('0x3c')]['id']}})[_0x2d6d('0xe')](handleEntityNotFound(_0x4d154c,null))[_0x2d6d('0xe')](saveUpdates(_0x470fb5[_0x2d6d('0x41')],null))[_0x2d6d('0xe')](respondWithResult(_0x4d154c,null))[_0x2d6d('0x3a')](handleError(_0x4d154c,null));};exports['describe']=function(_0xe6b038,_0x29771a){return db[_0x2d6d('0x14')]['describe']()['then'](respondWithResult(_0x29771a,null))[_0x2d6d('0x3a')](handleError(_0x29771a,null));};exports[_0x2d6d('0x42')]=function(_0x422198,_0x4e5203){var _0x238402;var _0xff0b07=_0x422198['params']['id'];return db[_0x2d6d('0x14')][_0x2d6d('0x3f')]({'where':{'id':_0x422198[_0x2d6d('0x3c')]['id']}})[_0x2d6d('0xe')](handleEntityNotFound(_0x4e5203,null))[_0x2d6d('0xe')](function(_0x28385f){if(_0x28385f){return _0x28385f[_0x2d6d('0x42')]()[_0x2d6d('0xe')](function(_0x42c125){return _0x42c125;});}})[_0x2d6d('0xe')](function(_0x57e1ec){_0x238402=_0x57e1ec;if(_0x57e1ec){if(_0x57e1ec[_0x2d6d('0x43')]||_0x57e1ec[_0x2d6d('0x44')]){return db[_0x57e1ec[_0x2d6d('0x43')]?'VoiceQueue':_0x2d6d('0x45')][_0x2d6d('0x3f')]({'where':{'id':_0x57e1ec[_0x2d6d('0x43')]?_0x57e1ec[_0x2d6d('0x43')]:_0x57e1ec[_0x2d6d('0x44')]},'attributes':['id',_0x2d6d('0x12')],'raw':!![]});}}})[_0x2d6d('0xe')](function(_0x4eb1d7){var _0x3131c5={};if(_0x4eb1d7){_[_0x2d6d('0x32')](_0x3131c5,_['omit'](_0x238402[_0x2d6d('0x46')],[_0x2d6d('0x47'),'updatedAt','id']));_0x3131c5[_0x2d6d('0x48')]=0x15;_0x3131c5[_0x2d6d('0x49')]='deleted';_0x3131c5[_0x2d6d('0x4a')]=_0x4eb1d7[_0x2d6d('0x12')];_0x3131c5[_0x2d6d('0x4b')]=_0x422198[_0x2d6d('0x4c')][_0x2d6d('0x12')];_0x3131c5[_0x2d6d('0x4d')]=_0x422198[_0x2d6d('0x4c')]['id'];_0x3131c5['deleted']=!![];_0x3131c5['deletedat']=moment()[_0x2d6d('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3131c5[_0x2d6d('0x4f')]=_0x238402[_0x2d6d('0x50')];_0x3131c5[_0x2d6d('0x51')]=_0x238402['VoiceQueueId']?_0x2d6d('0x52'):'ivr';return db[_0x2d6d('0x53')][_0x2d6d('0x3f')]({'where':{'id':_0x3131c5[_0x2d6d('0x54')]},'attributes':[_0x2d6d('0x55'),_0x2d6d('0x56')]})[_0x2d6d('0xe')](function(_0x3b2dc7){if(!_[_0x2d6d('0x57')](_0x4e5203)&&!_['isNil'](_0x3b2dc7[_0x2d6d('0x55')])){_0x3131c5[_0x2d6d('0x58')]=_0x3b2dc7[_0x2d6d('0x55')];if(!_['isNil'](_0x3b2dc7['lastName'])){_0x3131c5['calleridname']+='\x20'+_0x3b2dc7[_0x2d6d('0x56')];}}})['finally'](function(){return db[_0x2d6d('0x59')][_0x2d6d('0x40')](_0x3131c5);});}})[_0x2d6d('0xe')](function(_0x3f9e3d){return db[_0x2d6d('0x5a')][_0x2d6d('0x42')]({'where':{'CmHopperId':_0xff0b07}});})['then'](function(){return _0x4e5203[_0x2d6d('0x5')](0xcc)[_0x2d6d('0x5b')]();})[_0x2d6d('0x3a')](handleError(_0x4e5203,null));};exports[_0x2d6d('0x5c')]=function(_0x9323fc,_0x487b55){var _0x4bbbeb=[];return db[_0x2d6d('0x53')][_0x2d6d('0x5d')]()[_0x2d6d('0xe')](function(_0x10216f){_0x4bbbeb=_['keys'](_0x10216f);return _0x9323fc[_0x2d6d('0x4c')][_0x2d6d('0x5e')]({'where':{'type':_0x2d6d('0x5f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x2d6d('0x60'),_0x2d6d('0x61')],'raw':!![]});})[_0x2d6d('0xe')](function(_0x52c244){if(_0x52c244&&_0x52c244[_0x2d6d('0x3e')]){return db['sequelize'][_0x2d6d('0x62')](function(_0x2cdb39){var _0x2183ba={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2d6d('0x4e')](_0x2d6d('0x63'))},'VoiceQueueId':{'$in':_[_0x2d6d('0x13')](_0x52c244,'id')},'$or':[{'UserId':null},{'UserId':_0x9323fc[_0x2d6d('0x4c')]['id']}]};var _0x1021f0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x52c244)['filter']([_0x2d6d('0x61'),0x0])[_0x2d6d('0x13')]('id')[_0x2d6d('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x9323fc[_0x2d6d('0x4c')]['id']}]};var _0x2145ea={'$or':[_0x2183ba,_0x1021f0]};var _0x584682=[];if(_0x9323fc[_0x2d6d('0x41')]['direction']&&_0x9323fc[_0x2d6d('0x41')][_0x2d6d('0x65')]===_0x2d6d('0x66')){if(!_[_0x2d6d('0x67')](_0x9323fc[_0x2d6d('0x41')][_0x2d6d('0x68')])){_0x2145ea['id']={'$in':_0x9323fc[_0x2d6d('0x41')][_0x2d6d('0x68')]};}_0x584682=[['priority',_0x2d6d('0x69')],[_0x2d6d('0x6a'),_0x52c244[0x0][_0x2d6d('0x60')]===_0x2d6d('0x69')?_0x2d6d('0x6b'):'ASC'],db['sequelize']['literal'](_0x2d6d('0x6c')),['id',_0x2d6d('0x6b')]];}else{if(!_[_0x2d6d('0x67')](_0x9323fc[_0x2d6d('0x41')][_0x2d6d('0x68')])){_0x2145ea['id']={'$notIn':_0x9323fc[_0x2d6d('0x41')][_0x2d6d('0x68')]};}_0x584682=[[_0x2d6d('0x6d'),_0x2d6d('0x6b')],['scheduledAt',_0x52c244[0x0][_0x2d6d('0x60')]],db['sequelize'][_0x2d6d('0x6e')](_0x2d6d('0x6f')),['id',_0x2d6d('0x69')]];}return db[_0x2d6d('0x14')][_0x2d6d('0x70')]({'attributes':['id',_0x2d6d('0x71'),'phone',_0x2d6d('0x72')],'where':_0x2145ea,'order':_0x584682,'transaction':_0x2cdb39,'lock':_0x2cdb39[_0x2d6d('0x73')]['UPDATE'],'include':[{'model':db[_0x2d6d('0x53')],'as':_0x2d6d('0x74'),'attributes':_0x4bbbeb,'include':[{'model':db[_0x2d6d('0x75')],'as':_0x2d6d('0x76'),'attributes':['id',_0x2d6d('0x12')]}]},{'model':db['CmList'],'as':_0x2d6d('0x77'),'attributes':['id',_0x2d6d('0x12')]},{'model':db[_0x2d6d('0x78')],'as':_0x2d6d('0x79'),'attributes':['id',_0x2d6d('0x12'),_0x2d6d('0x7a')]}]})[_0x2d6d('0xe')](function(_0x1b37ab){if(_0x1b37ab){return _0x1b37ab['update']({'UserId':_0x9323fc[_0x2d6d('0x4c')]['id']},{'transaction':_0x2cdb39});}});});}})[_0x2d6d('0xe')](handleEntityNotFound(_0x487b55,null))[_0x2d6d('0xe')](respondWithResult(_0x487b55,null))[_0x2d6d('0x3a')](handleError(_0x487b55,null));};exports['getPreviewRecall']=function(_0x455d3b,_0x4cc4c2,_0x4b67d8){var _0x55e5d1=[];var _0x5c3218=_0x455d3b['params']['id'];var _0x3b07e5=_0x455d3b[_0x2d6d('0x4c')]['id'];return db[_0x2d6d('0x53')][_0x2d6d('0x5d')]()[_0x2d6d('0xe')](function(_0x10908a){_0x55e5d1=_[_0x2d6d('0x1a')](_0x10908a);return db['sequelize'][_0x2d6d('0x62')](function(_0x92da1c){const _0x54df4b={'id':_0x5c3218};return db[_0x2d6d('0x14')][_0x2d6d('0x70')]({'attributes':['id','scheduledat',_0x2d6d('0x72')],'where':_0x54df4b,'transaction':_0x92da1c,'lock':_0x92da1c[_0x2d6d('0x73')][_0x2d6d('0x7b')],'include':[{'model':db['CmContact'],'as':_0x2d6d('0x74'),'attributes':_0x55e5d1,'include':[{'model':db[_0x2d6d('0x75')],'as':_0x2d6d('0x76'),'attributes':['id',_0x2d6d('0x12')]}]},{'model':db[_0x2d6d('0x7c')],'as':'List','attributes':['id',_0x2d6d('0x12')]},{'model':db['VoiceQueue'],'as':_0x2d6d('0x79'),'attributes':['id',_0x2d6d('0x12'),_0x2d6d('0x7a')]}]})['then'](function(_0x491ab5){if(_0x491ab5){return _0x491ab5[_0x2d6d('0xd')]({'UserId':_0x3b07e5},{'transaction':_0x92da1c});}});});})[_0x2d6d('0xe')](handleEntityNotFound(_0x4cc4c2,null))['then'](respondWithResult(_0x4cc4c2,null))[_0x2d6d('0x3a')](handleError(_0x4cc4c2,null));};exports[_0x2d6d('0x7d')]=function(_0x4952ac,_0x3e8f03){return _0x4952ac[_0x2d6d('0x4c')][_0x2d6d('0x5e')]({'where':{'type':_0x2d6d('0x5f'),'dialActive':!![],'dialMethod':_0x2d6d('0x7e')},'attributes':['id'],'raw':!![]})[_0x2d6d('0xe')](function(_0x5c5bdf){if(_0x5c5bdf&&_0x5c5bdf[_0x2d6d('0x3e')]){return db[_0x2d6d('0x14')][_0x2d6d('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2d6d('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2d6d('0x13')](_0x5c5bdf,'id')},'$or':[{'UserId':null},{'UserId':_0x4952ac['user']['id']}]}});}return 0x0;})[_0x2d6d('0xe')](function(_0x578da6){if(!_[_0x2d6d('0x57')](_0x578da6)&&_[_0x2d6d('0x7f')](_0x578da6)){return _0x3e8f03['status'](0xc8)[_0x2d6d('0xc')]({'contacts':_0x578da6});}else{logger['error'](_0x2d6d('0x80'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x3e8f03[_0x2d6d('0xf')](0x194);}})[_0x2d6d('0x3a')](handleError(_0x3e8f03,null));};exports['getTimezones']=function(_0x11d954,_0x46113c){var _0x47f382=shared[_0x2d6d('0x81')];var _0x1ad450=[];_[_0x2d6d('0x13')](_0x47f382,function(_0x43b696){_0x1ad450[_0x2d6d('0x82')]({'id':_0x43b696['name'],'name':_0x43b696[_0x2d6d('0x12')],'utcOffset':_0x43b696[_0x2d6d('0x83')]});});return _0x46113c['status'](0xc8)['json']({'tz':_0x1ad450});};exports[_0x2d6d('0x84')]=function(_0x44f0b3,_0x4d596c){var _0x53ef4e=shared[_0x2d6d('0x81')];var _0x296125={};if(!_['isNil'](_0x53ef4e[_0x44f0b3[_0x2d6d('0x41')]['id']]))_0x296125=_0x53ef4e[_0x44f0b3[_0x2d6d('0x41')]['id']];return _0x4d596c[_0x2d6d('0x5')](0xc8)[_0x2d6d('0xc')](_0x296125);}; \ No newline at end of file +var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0x3bc536,_0x2701fc){var _0x3b9ce0=function(_0x469e05){while(--_0x469e05){_0x3bc536['push'](_0x3bc536['shift']());}};_0x3b9ce0(++_0x2701fc);}(_0x6737,0xe2));var _0x7673=function(_0x2325da,_0x260753){_0x2325da=_0x2325da-0x0;var _0x2a64bd=_0x6737[_0x2325da];return _0x2a64bd;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 02352ea..a3df70c 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 _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xd117,0x182));var _0x7d11=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0xd117[_0x2ad008];return _0x4538cf;};'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':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0xba34,0x119));var _0x4ba3=function(_0x184077,_0x3fdb34){_0x184077=_0x184077-0x0;var _0x247c9e=_0xba34[_0x184077];return _0x247c9e;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 947de33..e82baa2 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 _0x5fcc=['length','UserId','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','transaction','order','all','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','lodash','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','then','debug','stringify','catch','error','message','ShowCmHopper','CmHopper','find','raw','info','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5fcc,0x161));var _0xc5fc=function(_0x1003bf,_0x1eaba6){_0x1003bf=_0x1003bf-0x0;var _0x34bef1=_0x5fcc[_0x1003bf];return _0x34bef1;};'use strict';var _=require(_0xc5fc('0x0'));var util=require(_0xc5fc('0x1'));var moment=require(_0xc5fc('0x2'));var BPromise=require(_0xc5fc('0x3'));var db=require(_0xc5fc('0x4'))['db'];var logger=require('../../config/logger')(_0xc5fc('0x5'));exports[_0xc5fc('0x6')]=function(_0x5c499f){var _0x15bf9a=this;return new Promise(function(_0xf4d950,_0x48aca0){return db['CmHopper'][_0xc5fc('0x7')]({'raw':_0x5c499f[_0xc5fc('0x8')]?_0x5c499f[_0xc5fc('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5c499f[_0xc5fc('0x8')]?_0x5c499f[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':_0x5c499f['options']?_0x5c499f[_0xc5fc('0x8')][_0xc5fc('0xa')]||null:null,'limit':_0x5c499f[_0xc5fc('0x8')]?_0x5c499f[_0xc5fc('0x8')][_0xc5fc('0xb')]||null:null,'include':_0x5c499f[_0xc5fc('0x8')]?_0x5c499f[_0xc5fc('0x8')][_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0x5c499f[_0xc5fc('0x8')][_0xc5fc('0xc')],function(_0x5a784a){return{'model':db[_0x5a784a[_0xc5fc('0xe')]],'as':_0x5a784a['as'],'attributes':_0x5a784a[_0xc5fc('0xa')],'include':_0x5a784a[_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0x5a784a[_0xc5fc('0xc')],function(_0x4dd68e){return{'model':db[_0x4dd68e[_0xc5fc('0xe')]],'as':_0x4dd68e['as'],'attributes':_0x4dd68e[_0xc5fc('0xa')],'include':_0x4dd68e['include']?_[_0xc5fc('0xd')](_0x4dd68e[_0xc5fc('0xc')],function(_0x51db22){return{'model':db[_0x51db22[_0xc5fc('0xe')]],'as':_0x51db22['as'],'attributes':_0x51db22[_0xc5fc('0xa')]};}):[]};}):[]};}):[]:[]})[_0xc5fc('0xf')](function(_0xc996b8){logger['info'](_0xc5fc('0x6'),_0x5c499f);logger[_0xc5fc('0x10')](_0xc5fc('0x6'),_0x5c499f,JSON[_0xc5fc('0x11')](_0xc996b8));_0xf4d950(_0xc996b8);})[_0xc5fc('0x12')](function(_0x225cd9){logger[_0xc5fc('0x13')](_0xc5fc('0x6'),_0x225cd9['message'],_0x5c499f);_0x48aca0(_0x15bf9a[_0xc5fc('0x13')](0x1f4,_0x225cd9[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x15')]=function(_0x2db80d){var _0x2c3f75=this;return new Promise(function(_0x4aebdb,_0x454dd4){return db[_0xc5fc('0x16')][_0xc5fc('0x17')]({'raw':_0x2db80d['options']?_0x2db80d['options'][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'where':_0x2db80d['options']?_0x2db80d[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':_0x2db80d[_0xc5fc('0x8')]?_0x2db80d['options']['attributes']||null:null,'include':_0x2db80d[_0xc5fc('0x8')]?_0x2db80d[_0xc5fc('0x8')][_0xc5fc('0xc')]?_['map'](_0x2db80d[_0xc5fc('0x8')][_0xc5fc('0xc')],function(_0x2ddb65){return{'model':db[_0x2ddb65['model']],'as':_0x2ddb65['as'],'attributes':_0x2ddb65[_0xc5fc('0xa')],'include':_0x2ddb65[_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0x2ddb65['include'],function(_0xb9be73){return{'model':db[_0xb9be73['model']],'as':_0xb9be73['as'],'attributes':_0xb9be73[_0xc5fc('0xa')],'include':_0xb9be73[_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0xb9be73[_0xc5fc('0xc')],function(_0x1b7f9e){return{'model':db[_0x1b7f9e['model']],'as':_0x1b7f9e['as'],'attributes':_0x1b7f9e[_0xc5fc('0xa')]};}):[]};}):[]};}):[]:[]})[_0xc5fc('0xf')](function(_0x139284){logger[_0xc5fc('0x19')]('ShowCmHopper',_0x2db80d);logger[_0xc5fc('0x10')](_0xc5fc('0x15'),_0x2db80d,JSON[_0xc5fc('0x11')](_0x139284));_0x4aebdb(_0x139284);})[_0xc5fc('0x12')](function(_0x3205c8){logger[_0xc5fc('0x13')](_0xc5fc('0x15'),_0x3205c8[_0xc5fc('0x14')],_0x2db80d);_0x454dd4(_0x2c3f75[_0xc5fc('0x13')](0x1f4,_0x3205c8[_0xc5fc('0x14')]));});});};exports['CreateCmHopper']=function(_0x43d6e3){var _0x5f0029=this;return new Promise(function(_0x5e5d4b,_0x39e427){return db[_0xc5fc('0x16')][_0xc5fc('0x1a')](_0x43d6e3[_0xc5fc('0x1b')],{'raw':_0x43d6e3['options']?_0x43d6e3[_0xc5fc('0x8')][_0xc5fc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x220d16){logger[_0xc5fc('0x19')](_0xc5fc('0x1c'),_0x43d6e3);logger[_0xc5fc('0x10')](_0xc5fc('0x1c'),_0x43d6e3,JSON[_0xc5fc('0x11')](_0x220d16));_0x5e5d4b(_0x220d16);})['catch'](function(_0x4359b3){logger[_0xc5fc('0x13')]('CreateCmHopper',_0x4359b3[_0xc5fc('0x14')],_0x43d6e3);_0x39e427(_0x5f0029[_0xc5fc('0x13')](0x1f4,_0x4359b3[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x1d')]=function(_0x1f4958){var _0x81c000=this;return new Promise(function(_0x442ac1,_0x414a87){return db[_0xc5fc('0x16')][_0xc5fc('0x1e')](_0x1f4958[_0xc5fc('0x1b')],{'raw':_0x1f4958['options']?_0x1f4958['options'][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f4958[_0xc5fc('0x8')]?_0x1f4958['options']['where']||null:null,'attributes':_0x1f4958[_0xc5fc('0x8')]?_0x1f4958[_0xc5fc('0x8')][_0xc5fc('0xa')]||null:null,'limit':_0x1f4958['options']?_0x1f4958['options']['limit']||null:null})[_0xc5fc('0xf')](function(_0x2183c2){logger[_0xc5fc('0x19')](_0xc5fc('0x1d'),_0x1f4958);logger[_0xc5fc('0x19')](_0xc5fc('0x1f'),JSON[_0xc5fc('0x11')](_0x1f4958[_0xc5fc('0x8')][_0xc5fc('0x9')]),_0x1f4958[_0xc5fc('0x1b')][_0xc5fc('0x20')]);logger[_0xc5fc('0x10')]('UpdateCmHopper',_0x1f4958,JSON[_0xc5fc('0x11')](_0x2183c2));_0x442ac1(_0x2183c2);})['catch'](function(_0xe79a85){logger[_0xc5fc('0x13')](_0xc5fc('0x1d'),_0xe79a85[_0xc5fc('0x14')],_0x1f4958);_0x414a87(_0x81c000[_0xc5fc('0x13')](0x1f4,_0xe79a85[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x21')]=function(_0x3079c7){var _0x29a9a8=this;return new Promise(function(_0x5679c0,_0x2a2b08){return db[_0xc5fc('0x16')][_0xc5fc('0x22')]({'where':_0x3079c7[_0xc5fc('0x8')]?_0x3079c7['options']['where']||null:null})[_0xc5fc('0xf')](function(_0x199ca1){logger[_0xc5fc('0x19')](_0xc5fc('0x21'),_0x3079c7);logger[_0xc5fc('0x10')](_0xc5fc('0x21'),_0x3079c7,JSON['stringify'](_0x199ca1));_0x5679c0(_0x199ca1);})[_0xc5fc('0x12')](function(_0x3b757b){logger[_0xc5fc('0x13')](_0xc5fc('0x21'),_0x3b757b[_0xc5fc('0x14')],_0x3079c7);_0x2a2b08(_0x29a9a8['error'](0x1f4,_0x3b757b[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x23')]=function(_0x14d64b){var _0x13ae1c=this;return new Promise(function(_0x547d81,_0x30d032){return db[_0xc5fc('0x24')][_0xc5fc('0x25')]()[_0xc5fc('0xf')](function(_0x20f888){return db[_0xc5fc('0x26')]['transaction'](function(_0x2d5ac8){return db[_0xc5fc('0x16')][_0xc5fc('0x7')]({'where':_0x14d64b['options']?_0x14d64b[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':_0x14d64b[_0xc5fc('0x8')]?_0x14d64b[_0xc5fc('0x8')][_0xc5fc('0xa')]||null:null,'limit':_0x14d64b[_0xc5fc('0x8')]?_0x14d64b['options'][_0xc5fc('0xb')]||null:null,'order':_0x14d64b[_0xc5fc('0x8')]?_0x14d64b['options']['order']||null:null,'transaction':_0x2d5ac8,'lock':_0x2d5ac8[_0xc5fc('0x27')][_0xc5fc('0x28')],'include':[{'model':db[_0xc5fc('0x24')],'as':_0xc5fc('0x29'),'attributes':_[_0xc5fc('0x2a')](_0x20f888)},{'model':db[_0xc5fc('0x2b')],'as':_0xc5fc('0x2c'),'attributes':['id',_0xc5fc('0x2d'),_0xc5fc('0x2e')]}]})[_0xc5fc('0xf')](function(_0x256f6a){var _0x5a30d0=[];var _0x5a6b62=[];for(var _0x15a9f6=0x0;_0x15a9f6<_0x256f6a[_0xc5fc('0x2f')];_0x15a9f6+=0x1){var _0xbcfc72=_0x256f6a[_0x15a9f6][_0xc5fc('0x30')];if(_0xbcfc72===null){_0x5a30d0[_0xc5fc('0x31')](_0x256f6a[_0x15a9f6]['update'](_0x14d64b[_0xc5fc('0x1b')],{'transaction':_0x2d5ac8}));}else if(!_0x5a6b62['includes'](_0xbcfc72)){_0x5a6b62[_0xc5fc('0x31')](_0xbcfc72);_0x5a30d0[_0xc5fc('0x31')](_0x256f6a[_0x15a9f6][_0xc5fc('0x1e')](_0x14d64b[_0xc5fc('0x1b')],{'transaction':_0x2d5ac8}));}}return BPromise['all'](_0x5a30d0);});})[_0xc5fc('0xf')](function(_0x5100d3){logger['info'](_0xc5fc('0x23'),_0x14d64b);if(_0x5100d3[_0xc5fc('0x2f')]>0x0){logger[_0xc5fc('0x19')](_0xc5fc('0x32'),_0x5100d3[0x0]['dataValues']['id'],_0x5100d3[0x0][_0xc5fc('0x33')]['ContactId'],_0x5100d3[0x0][_0xc5fc('0x33')]['active']);}logger[_0xc5fc('0x10')](_0xc5fc('0x23'),_0x14d64b,JSON[_0xc5fc('0x11')](_0x5100d3));_0x547d81(_0x5100d3);})[_0xc5fc('0x12')](function(_0x5c0700){logger[_0xc5fc('0x13')]('GetContactDialer',_0x5c0700['message'],_0x14d64b);_0x30d032(_0x13ae1c[_0xc5fc('0x13')](0x1f4,_0x5c0700[_0xc5fc('0x14')]));});});});};exports[_0xc5fc('0x34')]=function(_0x2863fd){var _0x506cd5=this;return new Promise(function(_0x51164e,_0x1497fa){return db[_0xc5fc('0x26')]['transaction'](function(_0x3b5b66){return db[_0xc5fc('0x35')]['create'](_0x2863fd[_0xc5fc('0x1b')],{'raw':_0x2863fd[_0xc5fc('0x8')]?_0x2863fd['options'][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'transaction':_0x3b5b66})['then'](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xc5fc('0x11')](_0x2863fd[_0xc5fc('0x8')][_0xc5fc('0x9')]),_0x2863fd[_0xc5fc('0x8')][_0xc5fc('0x9')][_0xc5fc('0x20')]);return db[_0xc5fc('0x16')][_0xc5fc('0x22')]({'where':_0x2863fd[_0xc5fc('0x8')]?_0x2863fd[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'transaction':_0x3b5b66});});})[_0xc5fc('0xf')](function(_0x4a0dec){logger['info'](_0xc5fc('0x34'),_0x2863fd);logger['debug'](_0xc5fc('0x34'),_0x2863fd,JSON[_0xc5fc('0x11')](_0x4a0dec));_0x51164e(_0x4a0dec);})['catch'](function(_0x254a90){logger[_0xc5fc('0x13')]('MoveContactManagedDialer',_0x254a90[_0xc5fc('0x14')],_0x2863fd);_0x1497fa(_0x506cd5['error'](0x1f4,_0x254a90[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x36')]=function(_0x332c4d){var _0x1f1bf5=this;return new Promise(function(_0x2f5fe7,_0x300ee6){return db[_0xc5fc('0x16')][_0xc5fc('0x7')]({'raw':_0x332c4d[_0xc5fc('0x8')]?_0x332c4d[_0xc5fc('0x8')][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'where':_0x332c4d['options']?_0x332c4d[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':[[db[_0xc5fc('0x26')]['fn'](_0xc5fc('0x37'),db[_0xc5fc('0x26')]['fn']('IF',db['sequelize'][_0xc5fc('0x38')](_0xc5fc('0x39')+util['format'](_0xc5fc('0x3a'),moment()[_0xc5fc('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xc5fc('0x3c')))),_0xc5fc('0x3d')]]})[_0xc5fc('0xf')](function(_0x2aeaed){logger[_0xc5fc('0x19')](_0xc5fc('0x36'),_0x332c4d);logger[_0xc5fc('0x10')](_0xc5fc('0x36'),_0x332c4d,JSON[_0xc5fc('0x11')](_0x2aeaed));_0x2f5fe7(_0x2aeaed);})[_0xc5fc('0x12')](function(_0x5c109c){logger[_0xc5fc('0x13')](_0xc5fc('0x36'),_0x5c109c[_0xc5fc('0x14')],_0x332c4d);_0x300ee6(_0x1f1bf5['error'](0x1f4,_0x5c109c[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x3e')]=function(_0x1ff02a){var _0x437365=this;return new Promise(function(_0x252c06,_0x517253){return db[_0xc5fc('0x24')][_0xc5fc('0x25')]()['then'](function(){return db['sequelize'][_0xc5fc('0x3f')](function(_0x2461ff){return db[_0xc5fc('0x16')][_0xc5fc('0x7')]({'where':_0x1ff02a[_0xc5fc('0x8')]?_0x1ff02a[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':_0x1ff02a[_0xc5fc('0x8')]?_0x1ff02a[_0xc5fc('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x1ff02a[_0xc5fc('0x8')]?_0x1ff02a['options'][_0xc5fc('0x40')]||null:null,'group':db['CmHopper'][_0xc5fc('0x30')],'transaction':_0x2461ff,'lock':_0x2461ff[_0xc5fc('0x27')][_0xc5fc('0x28')],'include':_0x1ff02a['options']?_0x1ff02a[_0xc5fc('0x8')][_0xc5fc('0xc')]?_['map'](_0x1ff02a[_0xc5fc('0x8')][_0xc5fc('0xc')],function(_0x165fd9){return{'model':db[_0x165fd9[_0xc5fc('0xe')]],'as':_0x165fd9['as'],'attributes':_0x165fd9[_0xc5fc('0xa')],'include':_0x165fd9[_0xc5fc('0xc')]?_['map'](_0x165fd9['include'],function(_0x24a092){return{'model':db[_0x24a092[_0xc5fc('0xe')]],'as':_0x24a092['as'],'attributes':_0x24a092[_0xc5fc('0xa')],'include':_0x24a092['include']?_[_0xc5fc('0xd')](_0x24a092['include'],function(_0x4798f0){return{'model':db[_0x4798f0[_0xc5fc('0xe')]],'as':_0x4798f0['as'],'attributes':_0x4798f0[_0xc5fc('0xa')]};}):[]};}):[]};}):[]:[]})[_0xc5fc('0xf')](function(_0x256f8b){var _0x1d3f46=[];for(var _0x287b60=0x0;_0x287b60<_0x256f8b['length'];_0x287b60+=0x1){_0x1d3f46[_0xc5fc('0x31')](_0x256f8b[_0x287b60]['update'](_0x1ff02a[_0xc5fc('0x1b')],{'transaction':_0x2461ff}));}return BPromise[_0xc5fc('0x41')](_0x1d3f46);});})[_0xc5fc('0xf')](function(_0x234f26){logger[_0xc5fc('0x19')](_0xc5fc('0x3e'),_0x1ff02a);logger[_0xc5fc('0x10')](_0xc5fc('0x3e'),_0x1ff02a,JSON['stringify'](_0x234f26));_0x252c06(_0x234f26);})[_0xc5fc('0x12')](function(_0x5c018c){logger[_0xc5fc('0x13')](_0xc5fc('0x3e'),_0x5c018c[_0xc5fc('0x14')],_0x1ff02a);_0x517253(_0x437365['error'](0x1f4,_0x5c018c[_0xc5fc('0x14')]));});});});};exports[_0xc5fc('0x42')]=function(_0x472e65){var _0x1cf01c=this;return new Promise(function(_0x1c313c,_0x1f9772){db['CmContact'][_0xc5fc('0x25')]()[_0xc5fc('0xf')](function(_0x4aaacf){return db[_0xc5fc('0x16')][_0xc5fc('0x7')]({'raw':_0x472e65[_0xc5fc('0x8')]?_0x472e65[_0xc5fc('0x8')][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'where':_0x472e65['options']?_0x472e65[_0xc5fc('0x8')][_0xc5fc('0x9')]||null:null,'attributes':_0x472e65[_0xc5fc('0x8')]?_0x472e65[_0xc5fc('0x8')][_0xc5fc('0xa')]||null:null,'limit':_0x472e65[_0xc5fc('0x8')]?_0x472e65[_0xc5fc('0x8')][_0xc5fc('0xb')]||null:null,'include':_0x472e65[_0xc5fc('0x8')]?_0x472e65[_0xc5fc('0x8')][_0xc5fc('0xc')]?_['map'](_0x472e65[_0xc5fc('0x8')][_0xc5fc('0xc')],function(_0x1ecd0f){return{'model':db[_0x1ecd0f[_0xc5fc('0xe')]],'as':_0x1ecd0f['as'],'attributes':_0x1ecd0f['as']===_0xc5fc('0x29')?_[_0xc5fc('0x2a')](_0x4aaacf):_0x1ecd0f[_0xc5fc('0xa')],'include':_0x1ecd0f[_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0x1ecd0f[_0xc5fc('0xc')],function(_0x30d84a){return{'model':db[_0x30d84a[_0xc5fc('0xe')]],'as':_0x30d84a['as'],'attributes':_0x30d84a[_0xc5fc('0xa')],'include':_0x30d84a[_0xc5fc('0xc')]?_[_0xc5fc('0xd')](_0x30d84a[_0xc5fc('0xc')],function(_0x5b987e){return{'model':db[_0x5b987e[_0xc5fc('0xe')]],'as':_0x5b987e['as'],'attributes':_0x5b987e[_0xc5fc('0xa')]};}):[]};}):[]};}):[]:[]})[_0xc5fc('0xf')](function(_0x1e14c7){logger['info']('GetCmHopper',_0x472e65);logger[_0xc5fc('0x10')]('GetCmHopper',_0x472e65,JSON[_0xc5fc('0x11')](_0x1e14c7));_0x1c313c(_0x1e14c7);})[_0xc5fc('0x12')](function(_0x370b33){logger['error'](_0xc5fc('0x6'),_0x370b33[_0xc5fc('0x14')],_0x472e65);_0x1f9772(_0x1cf01c[_0xc5fc('0x13')](0x1f4,_0x370b33['message']));});});});};exports[_0xc5fc('0x43')]=function(_0x5009c8){var _0x5392af=this;return new Promise(function(_0x4714df,_0x8118c3){return db[_0xc5fc('0x24')][_0xc5fc('0x44')]({'raw':!![],'where':{'phone':_0x5009c8[_0xc5fc('0x8')][_0xc5fc('0x9')][_0xc5fc('0x45')]},'attributes':['id',_0xc5fc('0x46')],'order':[['id',_0xc5fc('0x47')]]})[_0xc5fc('0xf')](function(_0x2204e5){logger[_0xc5fc('0x19')](_0xc5fc('0x48'),_0x5009c8);logger[_0xc5fc('0x10')]('getContactByPhone',_0x5009c8,JSON['stringify'](_0x2204e5));_0x4714df(_0x2204e5);})['catch'](function(_0x11520c){logger[_0xc5fc('0x13')](_0xc5fc('0x48'),_0x11520c[_0xc5fc('0x14')],_0x5009c8);_0x8118c3(_0x5392af[_0xc5fc('0x13')](0x1f4,_0x11520c[_0xc5fc('0x14')]));});});};exports[_0xc5fc('0x49')]=function(_0x493acb){var _0x4b14e7=this;return new Promise(function(_0x4da60f,_0x2e8afa){return db[_0xc5fc('0x26')][_0xc5fc('0x3f')](function(_0x1cca90){var _0x178831=_0x493acb['options']&&_0x493acb['options'][_0xc5fc('0x9')]?_0x493acb[_0xc5fc('0x8')][_0xc5fc('0x9')]:{};return db['CmHopper']['update'](_0x493acb['body'],{'where':_0x178831,'transaction':_0x1cca90})['then'](function(_0x2c7f01){logger[_0xc5fc('0x19')](_0xc5fc('0x49'),_0x493acb);logger['debug'](_0xc5fc('0x49'),_0x493acb,JSON['stringify'](_0x2c7f01));_0x4da60f(_0x2c7f01);})[_0xc5fc('0x12')](function(_0x11becd){logger['error'](_0xc5fc('0x49'),_0x11becd['message'],_0x493acb);_0x2e8afa(_0x4b14e7['error'](0x1f4,_0x11becd[_0xc5fc('0x14')]));});});});};exports[_0xc5fc('0x4a')]=function(_0x310c4e){var _0x1805bf=this;var _0xf63946=_0x310c4e[_0xc5fc('0x1b')][_0xc5fc('0x9')][_0xc5fc('0x4b')];var _0x40ccbf=_0x310c4e[_0xc5fc('0x1b')][_0xc5fc('0x9')][_0xc5fc('0x4c')];var _0x519cb8=_0x310c4e[_0xc5fc('0x1b')][_0xc5fc('0x9')]['availableAgentsIds'];return new Promise(function(_0x2d4b39,_0x4f66cf){return db[_0xc5fc('0x16')][_0xc5fc('0x7')]({'where':{'voiceQueueId':{'$in':_0xf63946},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xc5fc('0x4d')+_0x40ccbf+_0xc5fc('0x4e')),'$gt':db[_0xc5fc('0x26')]['literal'](_0xc5fc('0x4f'))}},'UserId':{'$in':_0x519cb8}},'include':[{'model':db[_0xc5fc('0x24')],'as':_0xc5fc('0x29')},{'model':db['User'],'as':_0xc5fc('0x2c'),'attributes':['id',_0xc5fc('0x2d'),_0xc5fc('0x2e')]},{'model':db['CmList'],'as':'List'}]})[_0xc5fc('0xf')](function(_0x12ebd8){if(_0x12ebd8['length']>0x0){return db[_0xc5fc('0x26')]['transaction'](function(_0x2f2bdc){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xc5fc('0x26')][_0xc5fc('0x38')](_0xc5fc('0x4f'))},{'where':{'id':{'$in':_['map'](_0x12ebd8,'id')}},'transaction':_0x2f2bdc})['then'](function(){_0x2d4b39(_0x12ebd8);})['catch'](function(_0x178ce2){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x178ce2[_0xc5fc('0x14')],_0x310c4e);_0x4f66cf(_0x1805bf['error'](0x1f4,_0x178ce2[_0xc5fc('0x14')]));});})['catch'](function(_0xa2d9c3){logger[_0xc5fc('0x13')]('CmHopperHandlePreviewRecallNotifications',_0xa2d9c3[_0xc5fc('0x14')],_0x310c4e);_0x4f66cf(_0x1805bf[_0xc5fc('0x13')](0x1f4,_0xa2d9c3[_0xc5fc('0x14')]));});}else{_0x2d4b39(_0x12ebd8);}});});}; \ No newline at end of file +var _0x1121=['destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','GetCmHopperPreview','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','List','util','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','attributes','map','model','then','debug','stringify','catch','error','message','ShowCmHopper','find','info','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active'];(function(_0xa6a23e,_0x8b657a){var _0x210e65=function(_0x58b4b8){while(--_0x58b4b8){_0xa6a23e['push'](_0xa6a23e['shift']());}};_0x210e65(++_0x8b657a);}(_0x1121,0xc9));var _0x1112=function(_0x1e299e,_0x14821c){_0x1e299e=_0x1e299e-0x0;var _0x481580=_0x1121[_0x1e299e];return _0x481580;};'use strict';var _=require('lodash');var util=require(_0x1112('0x0'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x1112('0x1'))['db'];var logger=require(_0x1112('0x2'))('rpc');exports[_0x1112('0x3')]=function(_0x15abea){var _0x3b9878=this;return new Promise(function(_0x1d23f6,_0x220e20){return db[_0x1112('0x4')][_0x1112('0x5')]({'raw':_0x15abea['options']?_0x15abea[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x15abea['options']?_0x15abea['options'][_0x1112('0x8')]||null:null,'attributes':_0x15abea[_0x1112('0x6')]?_0x15abea['options']['attributes']||null:null,'limit':_0x15abea[_0x1112('0x6')]?_0x15abea['options'][_0x1112('0x9')]||null:null,'include':_0x15abea['options']?_0x15abea['options'][_0x1112('0xa')]?_['map'](_0x15abea[_0x1112('0x6')][_0x1112('0xa')],function(_0x18a08f){return{'model':db[_0x18a08f['model']],'as':_0x18a08f['as'],'attributes':_0x18a08f[_0x1112('0xb')],'include':_0x18a08f[_0x1112('0xa')]?_[_0x1112('0xc')](_0x18a08f[_0x1112('0xa')],function(_0x586be4){return{'model':db[_0x586be4[_0x1112('0xd')]],'as':_0x586be4['as'],'attributes':_0x586be4[_0x1112('0xb')],'include':_0x586be4[_0x1112('0xa')]?_[_0x1112('0xc')](_0x586be4[_0x1112('0xa')],function(_0x43dd6c){return{'model':db[_0x43dd6c['model']],'as':_0x43dd6c['as'],'attributes':_0x43dd6c[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})[_0x1112('0xe')](function(_0xbfc2bd){logger['info'](_0x1112('0x3'),_0x15abea);logger[_0x1112('0xf')](_0x1112('0x3'),_0x15abea,JSON[_0x1112('0x10')](_0xbfc2bd));_0x1d23f6(_0xbfc2bd);})[_0x1112('0x11')](function(_0x565dc0){logger[_0x1112('0x12')](_0x1112('0x3'),_0x565dc0[_0x1112('0x13')],_0x15abea);_0x220e20(_0x3b9878[_0x1112('0x12')](0x1f4,_0x565dc0[_0x1112('0x13')]));});});};exports[_0x1112('0x14')]=function(_0x9ee5f9){var _0x453eb0=this;return new Promise(function(_0x27ca19,_0x509d41){return db[_0x1112('0x4')][_0x1112('0x15')]({'raw':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9['options'][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9['options'][_0x1112('0x8')]||null:null,'attributes':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9[_0x1112('0x6')]['attributes']||null:null,'include':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9[_0x1112('0x6')][_0x1112('0xa')]?_[_0x1112('0xc')](_0x9ee5f9[_0x1112('0x6')][_0x1112('0xa')],function(_0x209ac6){return{'model':db[_0x209ac6['model']],'as':_0x209ac6['as'],'attributes':_0x209ac6['attributes'],'include':_0x209ac6['include']?_[_0x1112('0xc')](_0x209ac6[_0x1112('0xa')],function(_0x2ee05d){return{'model':db[_0x2ee05d[_0x1112('0xd')]],'as':_0x2ee05d['as'],'attributes':_0x2ee05d[_0x1112('0xb')],'include':_0x2ee05d[_0x1112('0xa')]?_[_0x1112('0xc')](_0x2ee05d[_0x1112('0xa')],function(_0x1e1e9e){return{'model':db[_0x1e1e9e[_0x1112('0xd')]],'as':_0x1e1e9e['as'],'attributes':_0x1e1e9e[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})[_0x1112('0xe')](function(_0x5ca322){logger[_0x1112('0x16')](_0x1112('0x14'),_0x9ee5f9);logger[_0x1112('0xf')](_0x1112('0x14'),_0x9ee5f9,JSON[_0x1112('0x10')](_0x5ca322));_0x27ca19(_0x5ca322);})[_0x1112('0x11')](function(_0x5968a1){logger[_0x1112('0x12')](_0x1112('0x14'),_0x5968a1[_0x1112('0x13')],_0x9ee5f9);_0x509d41(_0x453eb0[_0x1112('0x12')](0x1f4,_0x5968a1[_0x1112('0x13')]));});});};exports[_0x1112('0x17')]=function(_0x46a5a9){var _0x4094ee=this;return new Promise(function(_0x1940c0,_0x547f42){return db['CmHopper'][_0x1112('0x18')](_0x46a5a9[_0x1112('0x19')],{'raw':_0x46a5a9[_0x1112('0x6')]?_0x46a5a9[_0x1112('0x6')]['raw']===undefined?!![]:![]:!![]})[_0x1112('0xe')](function(_0x1a0b55){logger[_0x1112('0x16')]('CreateCmHopper',_0x46a5a9);logger[_0x1112('0xf')](_0x1112('0x17'),_0x46a5a9,JSON[_0x1112('0x10')](_0x1a0b55));_0x1940c0(_0x1a0b55);})['catch'](function(_0x37305d){logger[_0x1112('0x12')](_0x1112('0x17'),_0x37305d[_0x1112('0x13')],_0x46a5a9);_0x547f42(_0x4094ee[_0x1112('0x12')](0x1f4,_0x37305d[_0x1112('0x13')]));});});};exports[_0x1112('0x1a')]=function(_0x456abc){var _0x52cb31=this;return new Promise(function(_0x1f6e5e,_0x41849e){return db[_0x1112('0x4')][_0x1112('0x1b')](_0x456abc[_0x1112('0x19')],{'raw':_0x456abc[_0x1112('0x6')]?_0x456abc[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456abc[_0x1112('0x6')]?_0x456abc['options'][_0x1112('0x8')]||null:null,'attributes':_0x456abc[_0x1112('0x6')]?_0x456abc[_0x1112('0x6')][_0x1112('0xb')]||null:null,'limit':_0x456abc['options']?_0x456abc['options'][_0x1112('0x9')]||null:null})[_0x1112('0xe')](function(_0x2bb1ab){logger['info'](_0x1112('0x1a'),_0x456abc);logger['info'](_0x1112('0x1c'),JSON[_0x1112('0x10')](_0x456abc[_0x1112('0x6')]['where']),_0x456abc[_0x1112('0x19')][_0x1112('0x1d')]);logger[_0x1112('0xf')](_0x1112('0x1a'),_0x456abc,JSON['stringify'](_0x2bb1ab));_0x1f6e5e(_0x2bb1ab);})['catch'](function(_0x46701a){logger['error'](_0x1112('0x1a'),_0x46701a[_0x1112('0x13')],_0x456abc);_0x41849e(_0x52cb31[_0x1112('0x12')](0x1f4,_0x46701a['message']));});});};exports['DestroyCmHopper']=function(_0x39695a){var _0x374058=this;return new Promise(function(_0x4647c9,_0xef6d91){return db[_0x1112('0x4')][_0x1112('0x1e')]({'where':_0x39695a['options']?_0x39695a['options']['where']||null:null})['then'](function(_0x23cf3e){logger[_0x1112('0x16')](_0x1112('0x1f'),_0x39695a);logger[_0x1112('0xf')](_0x1112('0x1f'),_0x39695a,JSON['stringify'](_0x23cf3e));_0x4647c9(_0x23cf3e);})[_0x1112('0x11')](function(_0x179ff3){logger[_0x1112('0x12')]('DestroyCmHopper',_0x179ff3[_0x1112('0x13')],_0x39695a);_0xef6d91(_0x374058[_0x1112('0x12')](0x1f4,_0x179ff3['message']));});});};exports[_0x1112('0x20')]=function(_0x2f1ede){var _0x131785=this;return new Promise(function(_0x3d660e,_0x4a680d){return db[_0x1112('0x21')][_0x1112('0x22')]()['then'](function(_0x376107){return db['sequelize'][_0x1112('0x23')](function(_0x35db57){return db[_0x1112('0x4')]['findAll']({'where':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')][_0x1112('0x8')]||null:null,'attributes':_0x2f1ede['options']?_0x2f1ede[_0x1112('0x6')][_0x1112('0xb')]||null:null,'limit':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')][_0x1112('0x9')]||null:null,'order':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')]['order']||null:null,'transaction':_0x35db57,'lock':_0x35db57[_0x1112('0x24')]['UPDATE'],'include':[{'model':db[_0x1112('0x21')],'as':_0x1112('0x25'),'attributes':_[_0x1112('0x26')](_0x376107)},{'model':db[_0x1112('0x27')],'as':_0x1112('0x28'),'attributes':['id',_0x1112('0x29'),_0x1112('0x2a')]}]})[_0x1112('0xe')](function(_0x25b4c0){var _0x34c181=[];var _0x303daa=[];for(var _0x327523=0x0;_0x327523<_0x25b4c0[_0x1112('0x2b')];_0x327523+=0x1){var _0x1ff6b3=_0x25b4c0[_0x327523][_0x1112('0x2c')];if(_0x1ff6b3===null){_0x34c181[_0x1112('0x2d')](_0x25b4c0[_0x327523][_0x1112('0x1b')](_0x2f1ede[_0x1112('0x19')],{'transaction':_0x35db57}));}else if(!_0x303daa[_0x1112('0x2e')](_0x1ff6b3)){_0x303daa[_0x1112('0x2d')](_0x1ff6b3);_0x34c181[_0x1112('0x2d')](_0x25b4c0[_0x327523][_0x1112('0x1b')](_0x2f1ede[_0x1112('0x19')],{'transaction':_0x35db57}));}}return BPromise[_0x1112('0x2f')](_0x34c181);});})[_0x1112('0xe')](function(_0x133527){logger['info']('GetContactDialer',_0x2f1ede);if(_0x133527['length']>0x0){logger[_0x1112('0x16')](_0x1112('0x30'),_0x133527[0x0]['dataValues']['id'],_0x133527[0x0][_0x1112('0x31')][_0x1112('0x32')],_0x133527[0x0]['dataValues'][_0x1112('0x1d')]);}logger[_0x1112('0xf')]('GetContactDialer',_0x2f1ede,JSON[_0x1112('0x10')](_0x133527));_0x3d660e(_0x133527);})[_0x1112('0x11')](function(_0x466005){logger[_0x1112('0x12')]('GetContactDialer',_0x466005['message'],_0x2f1ede);_0x4a680d(_0x131785[_0x1112('0x12')](0x1f4,_0x466005[_0x1112('0x13')]));});});});};exports[_0x1112('0x33')]=function(_0x140665){var _0x140fee=this;return new Promise(function(_0x1fcf8f,_0x5dbe25){return db[_0x1112('0x34')][_0x1112('0x23')](function(_0x299a76){return db[_0x1112('0x35')][_0x1112('0x18')](_0x140665[_0x1112('0x19')],{'raw':_0x140665[_0x1112('0x6')]?_0x140665[_0x1112('0x6')]['raw']===undefined?!![]:![]:!![],'transaction':_0x299a76})[_0x1112('0xe')](function(){logger[_0x1112('0x16')](_0x1112('0x36'),JSON['stringify'](_0x140665[_0x1112('0x6')][_0x1112('0x8')]),_0x140665[_0x1112('0x6')][_0x1112('0x8')]['active']);return db[_0x1112('0x4')][_0x1112('0x1e')]({'where':_0x140665[_0x1112('0x6')]?_0x140665[_0x1112('0x6')][_0x1112('0x8')]||null:null,'transaction':_0x299a76});});})[_0x1112('0xe')](function(_0x15aaec){logger[_0x1112('0x16')](_0x1112('0x33'),_0x140665);logger[_0x1112('0xf')]('MoveContactManagedDialer',_0x140665,JSON[_0x1112('0x10')](_0x15aaec));_0x1fcf8f(_0x15aaec);})[_0x1112('0x11')](function(_0x16dc8d){logger[_0x1112('0x12')](_0x1112('0x33'),_0x16dc8d[_0x1112('0x13')],_0x140665);_0x5dbe25(_0x140fee[_0x1112('0x12')](0x1f4,_0x16dc8d['message']));});});};exports[_0x1112('0x37')]=function(_0x56b508){var _0x3e4562=this;return new Promise(function(_0x4465d0,_0x570604){return db[_0x1112('0x4')]['findAll']({'raw':_0x56b508[_0x1112('0x6')]?_0x56b508[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x56b508[_0x1112('0x6')]?_0x56b508[_0x1112('0x6')]['where']||null:null,'attributes':[[db[_0x1112('0x34')]['fn'](_0x1112('0x38'),db[_0x1112('0x34')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0x1112('0x39')]('\x22%s\x22',moment()[_0x1112('0x39')](_0x1112('0x3a')))+_0x1112('0x3b')))),_0x1112('0x3c')]]})['then'](function(_0x5e0f97){logger['info'](_0x1112('0x37'),_0x56b508);logger['debug'](_0x1112('0x37'),_0x56b508,JSON[_0x1112('0x10')](_0x5e0f97));_0x4465d0(_0x5e0f97);})[_0x1112('0x11')](function(_0x327b0a){logger[_0x1112('0x12')](_0x1112('0x37'),_0x327b0a[_0x1112('0x13')],_0x56b508);_0x570604(_0x3e4562[_0x1112('0x12')](0x1f4,_0x327b0a[_0x1112('0x13')]));});});};exports[_0x1112('0x3d')]=function(_0x297eb5){var _0x3bd6fa=this;return new Promise(function(_0x50df40,_0x51ad97){return db[_0x1112('0x21')][_0x1112('0x22')]()[_0x1112('0xe')](function(){return db[_0x1112('0x34')][_0x1112('0x23')](function(_0x53a7ff){return db[_0x1112('0x4')][_0x1112('0x5')]({'where':_0x297eb5['options']?_0x297eb5['options'][_0x1112('0x8')]||null:null,'attributes':_0x297eb5['options']?_0x297eb5['options'][_0x1112('0xb')]||null:null,'limit':0x1,'order':_0x297eb5[_0x1112('0x6')]?_0x297eb5[_0x1112('0x6')][_0x1112('0x3e')]||null:null,'group':db[_0x1112('0x4')]['UserId'],'transaction':_0x53a7ff,'lock':_0x53a7ff[_0x1112('0x24')][_0x1112('0x3f')],'include':_0x297eb5['options']?_0x297eb5[_0x1112('0x6')][_0x1112('0xa')]?_[_0x1112('0xc')](_0x297eb5[_0x1112('0x6')][_0x1112('0xa')],function(_0x489c5d){return{'model':db[_0x489c5d[_0x1112('0xd')]],'as':_0x489c5d['as'],'attributes':_0x489c5d['attributes'],'include':_0x489c5d[_0x1112('0xa')]?_[_0x1112('0xc')](_0x489c5d['include'],function(_0xffecac){return{'model':db[_0xffecac['model']],'as':_0xffecac['as'],'attributes':_0xffecac[_0x1112('0xb')],'include':_0xffecac['include']?_[_0x1112('0xc')](_0xffecac[_0x1112('0xa')],function(_0x55f0e5){return{'model':db[_0x55f0e5[_0x1112('0xd')]],'as':_0x55f0e5['as'],'attributes':_0x55f0e5[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50a1e2){var _0x1315a2=[];for(var _0x1c4bec=0x0;_0x1c4bec<_0x50a1e2[_0x1112('0x2b')];_0x1c4bec+=0x1){_0x1315a2[_0x1112('0x2d')](_0x50a1e2[_0x1c4bec][_0x1112('0x1b')](_0x297eb5[_0x1112('0x19')],{'transaction':_0x53a7ff}));}return BPromise[_0x1112('0x2f')](_0x1315a2);});})[_0x1112('0xe')](function(_0x35c134){logger['info'](_0x1112('0x3d'),_0x297eb5);logger[_0x1112('0xf')]('GetContactRecallMe',_0x297eb5,JSON[_0x1112('0x10')](_0x35c134));_0x50df40(_0x35c134);})['catch'](function(_0x2f0df3){logger['error'](_0x1112('0x3d'),_0x2f0df3[_0x1112('0x13')],_0x297eb5);_0x51ad97(_0x3bd6fa[_0x1112('0x12')](0x1f4,_0x2f0df3[_0x1112('0x13')]));});});});};exports[_0x1112('0x40')]=function(_0x27a012){var _0x29e035=this;return new Promise(function(_0x5a1878,_0x11b29e){db[_0x1112('0x21')][_0x1112('0x22')]()[_0x1112('0xe')](function(_0x3512bd){return db['CmHopper'][_0x1112('0x5')]({'raw':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x27a012[_0x1112('0x6')]?_0x27a012['options'][_0x1112('0x8')]||null:null,'attributes':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')]['attributes']||null:null,'limit':_0x27a012[_0x1112('0x6')]?_0x27a012['options'][_0x1112('0x9')]||null:null,'include':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')]['include']?_[_0x1112('0xc')](_0x27a012[_0x1112('0x6')][_0x1112('0xa')],function(_0x37a9e3){return{'model':db[_0x37a9e3['model']],'as':_0x37a9e3['as'],'attributes':_0x37a9e3['as']===_0x1112('0x25')?_['keys'](_0x3512bd):_0x37a9e3[_0x1112('0xb')],'include':_0x37a9e3['include']?_[_0x1112('0xc')](_0x37a9e3[_0x1112('0xa')],function(_0x142cfe){return{'model':db[_0x142cfe[_0x1112('0xd')]],'as':_0x142cfe['as'],'attributes':_0x142cfe[_0x1112('0xb')],'include':_0x142cfe[_0x1112('0xa')]?_[_0x1112('0xc')](_0x142cfe[_0x1112('0xa')],function(_0x46e9a9){return{'model':db[_0x46e9a9[_0x1112('0xd')]],'as':_0x46e9a9['as'],'attributes':_0x46e9a9[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2133bb){logger[_0x1112('0x16')]('GetCmHopper',_0x27a012);logger[_0x1112('0xf')](_0x1112('0x3'),_0x27a012,JSON[_0x1112('0x10')](_0x2133bb));_0x5a1878(_0x2133bb);})['catch'](function(_0xfdffb2){logger['error'](_0x1112('0x3'),_0xfdffb2[_0x1112('0x13')],_0x27a012);_0x11b29e(_0x29e035['error'](0x1f4,_0xfdffb2['message']));});});});};exports['GetContactByPhone']=function(_0x44b3af){var _0x330529=this;return new Promise(function(_0x394d21,_0x152ec9){return db['CmContact'][_0x1112('0x41')]({'raw':!![],'where':{'phone':_0x44b3af[_0x1112('0x6')][_0x1112('0x8')]['phone']},'attributes':['id',_0x1112('0x42')],'order':[['id',_0x1112('0x43')]]})[_0x1112('0xe')](function(_0x2609b8){logger[_0x1112('0x16')](_0x1112('0x44'),_0x44b3af);logger['debug'](_0x1112('0x44'),_0x44b3af,JSON['stringify'](_0x2609b8));_0x394d21(_0x2609b8);})[_0x1112('0x11')](function(_0x4eb8df){logger[_0x1112('0x12')](_0x1112('0x44'),_0x4eb8df[_0x1112('0x13')],_0x44b3af);_0x152ec9(_0x330529['error'](0x1f4,_0x4eb8df[_0x1112('0x13')]));});});};exports[_0x1112('0x45')]=function(_0x2e09e1){var _0x558c05=this;return new Promise(function(_0x849881,_0x4c0bba){return db['sequelize'][_0x1112('0x23')](function(_0x5c83b1){var _0x1e9887=_0x2e09e1[_0x1112('0x6')]&&_0x2e09e1[_0x1112('0x6')]['where']?_0x2e09e1[_0x1112('0x6')]['where']:{};return db[_0x1112('0x4')]['update'](_0x2e09e1[_0x1112('0x19')],{'where':_0x1e9887,'transaction':_0x5c83b1})[_0x1112('0xe')](function(_0x512f56){logger['info'](_0x1112('0x45'),_0x2e09e1);logger['debug'](_0x1112('0x45'),_0x2e09e1,JSON[_0x1112('0x10')](_0x512f56));_0x849881(_0x512f56);})[_0x1112('0x11')](function(_0x2f6f9a){logger['error'](_0x1112('0x45'),_0x2f6f9a[_0x1112('0x13')],_0x2e09e1);_0x4c0bba(_0x558c05[_0x1112('0x12')](0x1f4,_0x2f6f9a[_0x1112('0x13')]));});});});};exports[_0x1112('0x46')]=function(_0x2b8323){var _0x2e1862=this;var _0x34850b=_0x2b8323[_0x1112('0x19')]['where'][_0x1112('0x47')];var _0x5abdda=_0x2b8323[_0x1112('0x19')][_0x1112('0x8')]['interval'];var _0x490354=_0x2b8323['body'][_0x1112('0x8')][_0x1112('0x48')];return new Promise(function(_0x67b27e,_0x348b6f){return db[_0x1112('0x4')][_0x1112('0x5')]({'where':{'voiceQueueId':{'$in':_0x34850b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x1112('0x49')](_0x1112('0x4a')+_0x5abdda+_0x1112('0x4b')),'$gt':db[_0x1112('0x34')][_0x1112('0x49')]('NOW()')}},'UserId':{'$in':_0x490354}},'include':[{'model':db['CmContact'],'as':_0x1112('0x25')},{'model':db['User'],'as':_0x1112('0x28'),'attributes':['id',_0x1112('0x29'),_0x1112('0x2a')]},{'model':db['CmList'],'as':_0x1112('0x4c')}]})[_0x1112('0xe')](function(_0x2a0f55){if(_0x2a0f55[_0x1112('0x2b')]>0x0){return db['sequelize'][_0x1112('0x23')](function(_0x46def2){return db[_0x1112('0x4')][_0x1112('0x1b')]({'recallmeNotifiedDate':db[_0x1112('0x34')]['literal']('NOW()')},{'where':{'id':{'$in':_[_0x1112('0xc')](_0x2a0f55,'id')}},'transaction':_0x46def2})[_0x1112('0xe')](function(){_0x67b27e(_0x2a0f55);})['catch'](function(_0x5238db){logger[_0x1112('0x12')](_0x1112('0x46'),_0x5238db[_0x1112('0x13')],_0x2b8323);_0x348b6f(_0x2e1862[_0x1112('0x12')](0x1f4,_0x5238db['message']));});})[_0x1112('0x11')](function(_0x539ab5){logger[_0x1112('0x12')](_0x1112('0x46'),_0x539ab5[_0x1112('0x13')],_0x2b8323);_0x348b6f(_0x2e1862[_0x1112('0x12')](0x1f4,_0x539ab5[_0x1112('0x13')]));});}else{_0x67b27e(_0x2a0f55);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index e8f87b6..9af0e6b 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 _0xd213=['update','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getTimezones','show','getPreviewRecall','post','/preview','/timezone','put'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0xd213,0xc9));var _0x3d21=function(_0x54b2fc,_0x43ca61){_0x54b2fc=_0x54b2fc-0x0;var _0x48443f=_0xd213[_0x54b2fc];return _0x48443f;};'use strict';var express=require(_0x3d21('0x0'));var router=express[_0x3d21('0x1')]();var auth=require(_0x3d21('0x2'));var controller=require(_0x3d21('0x3'));router[_0x3d21('0x4')]('/',auth[_0x3d21('0x5')](),controller['index']);router['get']('/describe',auth[_0x3d21('0x5')](),controller[_0x3d21('0x6')]);router[_0x3d21('0x4')](_0x3d21('0x7'),auth[_0x3d21('0x5')](),controller['getOpenContacts']);router[_0x3d21('0x4')]('/timezones',auth[_0x3d21('0x5')](),controller[_0x3d21('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3d21('0x9')]);router['get']('/:id/previewrecall',auth[_0x3d21('0x5')](),controller[_0x3d21('0xa')]);router[_0x3d21('0xb')]('/',auth[_0x3d21('0x5')](),controller['create']);router[_0x3d21('0xb')](_0x3d21('0xc'),auth['isAuthenticated'](),controller['getPreview']);router[_0x3d21('0xb')](_0x3d21('0xd'),auth[_0x3d21('0x5')](),controller['getTimezone']);router[_0x3d21('0xe')]('/:id',auth[_0x3d21('0x5')](),controller[_0x3d21('0xf')]);router['delete']('/:id',auth[_0x3d21('0x5')](),controller[_0x3d21('0x10')]);module[_0x3d21('0x11')]=router; \ No newline at end of file +var _0x506d=['getTimezone','put','update','delete','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone'];(function(_0x38bbec,_0x1b542e){var _0x27e9dc=function(_0x369c07){while(--_0x369c07){_0x38bbec['push'](_0x38bbec['shift']());}};_0x27e9dc(++_0x1b542e);}(_0x506d,0x1d9));var _0xd506=function(_0x5712ba,_0x4e8568){_0x5712ba=_0x5712ba-0x0;var _0x539d69=_0x506d[_0x5712ba];return _0x539d69;};'use strict';var express=require(_0xd506('0x0'));var router=express[_0xd506('0x1')]();var auth=require(_0xd506('0x2'));var controller=require(_0xd506('0x3'));router[_0xd506('0x4')]('/',auth[_0xd506('0x5')](),controller[_0xd506('0x6')]);router[_0xd506('0x4')](_0xd506('0x7'),auth['isAuthenticated'](),controller[_0xd506('0x8')]);router['get'](_0xd506('0x9'),auth[_0xd506('0x5')](),controller[_0xd506('0xa')]);router[_0xd506('0x4')](_0xd506('0xb'),auth[_0xd506('0x5')](),controller[_0xd506('0xc')]);router[_0xd506('0x4')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller['show']);router['get'](_0xd506('0xe'),auth[_0xd506('0x5')](),controller[_0xd506('0xf')]);router[_0xd506('0x10')]('/',auth[_0xd506('0x5')](),controller[_0xd506('0x11')]);router['post'](_0xd506('0x12'),auth[_0xd506('0x5')](),controller[_0xd506('0x13')]);router[_0xd506('0x10')](_0xd506('0x14'),auth[_0xd506('0x5')](),controller[_0xd506('0x15')]);router[_0xd506('0x16')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller[_0xd506('0x17')]);router[_0xd506('0x18')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller['destroy']);module[_0xd506('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 5acb757..47a9494 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeede=['sequelize','exports','INTEGER','STRING','DATE','moment'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0xeede,0x9b));var _0xeeed=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xeede[_0x574ce3];return _0x3447a0;};'use strict';var moment=require(_0xeeed('0x0'));var Sequelize=require(_0xeeed('0x1'));module[_0xeeed('0x2')]={'CmHopperId':{'type':Sequelize[_0xeeed('0x3')]},'phone':{'type':Sequelize[_0xeeed('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xeeed('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeeed('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x339a=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x296652,_0x46b259){var _0x43dbab=function(_0x46d86e){while(--_0x46d86e){_0x296652['push'](_0x296652['shift']());}};_0x43dbab(++_0x46b259);}(_0x339a,0x12d));var _0xa339=function(_0x4ce20f,_0xad2d46){_0x4ce20f=_0x4ce20f-0x0;var _0x20bda4=_0x339a[_0x4ce20f];return _0x20bda4;};'use strict';var moment=require(_0xa339('0x0'));var Sequelize=require(_0xa339('0x1'));module[_0xa339('0x2')]={'CmHopperId':{'type':Sequelize[_0xa339('0x3')]},'phone':{'type':Sequelize[_0xa339('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa339('0x5')],'defaultValue':moment()[_0xa339('0x6')](_0xa339('0x7'))},'countbusyretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index d1a8a13..37d2a49 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa971=['set','reject','save','then','CmHopperAdditionalPhones','UserProfileResource','destroy','error','stack','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','catch','show','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x590be3,_0x45e19b){var _0x5667a4=function(_0x2c5107){while(--_0x2c5107){_0x590be3['push'](_0x590be3['shift']());}};_0x5667a4(++_0x45e19b);}(_0xa971,0x18b));var _0x1a97=function(_0x3b5ebb,_0x371290){_0x3b5ebb=_0x3b5ebb-0x0;var _0xc4c84b=_0xa971[_0x3b5ebb];return _0xc4c84b;};'use strict';var emlformat=require(_0x1a97('0x0'));var rimraf=require(_0x1a97('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a97('0x2'));var rp=require(_0x1a97('0x3'));var moment=require(_0x1a97('0x4'));var BPromise=require(_0x1a97('0x5'));var Mustache=require(_0x1a97('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1a97('0x7'));var csv=require(_0x1a97('0x8'));var ejs=require(_0x1a97('0x9'));var fs=require('fs');var fs_extra=require(_0x1a97('0xa'));var _=require(_0x1a97('0xb'));var squel=require(_0x1a97('0xc'));var crypto=require(_0x1a97('0xd'));var jsforce=require(_0x1a97('0xe'));var deskjs=require(_0x1a97('0xf'));var toCsv=require(_0x1a97('0x8'));var querystring=require(_0x1a97('0x10'));var Papa=require(_0x1a97('0x11'));var Redis=require(_0x1a97('0x12'));var authService=require(_0x1a97('0x13'));var qs=require(_0x1a97('0x14'));var as=require(_0x1a97('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a97('0x16'))(_0x1a97('0x17'));var utils=require(_0x1a97('0x18'));var config=require(_0x1a97('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a97('0x1a'))['db'];function respondWithStatusCode(_0x5de0aa,_0xfe1fc3){_0xfe1fc3=_0xfe1fc3||0xcc;return function(_0x25d304){if(_0x25d304){return _0x5de0aa[_0x1a97('0x1b')](_0xfe1fc3);}return _0x5de0aa[_0x1a97('0x1c')](_0xfe1fc3)[_0x1a97('0x1d')]();};}function respondWithResult(_0x3e8025,_0x56e982){_0x56e982=_0x56e982||0xc8;return function(_0x215715){if(_0x215715){return _0x3e8025[_0x1a97('0x1c')](_0x56e982)[_0x1a97('0x1e')](_0x215715);}};}function respondWithFilteredResult(_0x4c0e56,_0x33fd23){return function(_0x4c8598){if(_0x4c8598){var _0x31c2ee=typeof _0x33fd23[_0x1a97('0x1f')]==='undefined'&&typeof _0x33fd23['limit']===_0x1a97('0x20');var _0x3f889a=_0x4c8598['count'];var _0x46eb64=_0x31c2ee?0x0:_0x33fd23[_0x1a97('0x1f')];var _0x5234e9=_0x31c2ee?_0x4c8598[_0x1a97('0x21')]:_0x33fd23[_0x1a97('0x1f')]+_0x33fd23[_0x1a97('0x22')];var _0x38b47a;if(_0x5234e9>=_0x3f889a){_0x5234e9=_0x3f889a;_0x38b47a=0xc8;}else{_0x38b47a=0xce;}_0x4c0e56['status'](_0x38b47a);return _0x4c0e56[_0x1a97('0x23')]('Content-Range',_0x46eb64+'-'+_0x5234e9+'/'+_0x3f889a)[_0x1a97('0x1e')](_0x4c8598);}return null;};}function patchUpdates(_0x255438){return function(_0x3f6dca){try{jsonpatch['apply'](_0x3f6dca,_0x255438,!![]);}catch(_0x5d6831){return BPromise[_0x1a97('0x24')](_0x5d6831);}return _0x3f6dca[_0x1a97('0x25')]();};}function saveUpdates(_0x169da1,_0x273c1c){return function(_0x1bc34a){if(_0x1bc34a){return _0x1bc34a['update'](_0x169da1)[_0x1a97('0x26')](function(_0x586c78){return _0x586c78;});}return null;};}function removeEntity(_0x46c985,_0x5989f6){return function(_0x9d5ace){if(_0x9d5ace){return _0x9d5ace['destroy']()[_0x1a97('0x26')](function(){var _0x20d02e=_0x9d5ace['get']({'plain':!![]});var _0x5f5266=_0x1a97('0x27');return db[_0x1a97('0x28')][_0x1a97('0x29')]({'where':{'type':_0x5f5266,'resourceId':_0x20d02e['id']}})['then'](function(){return _0x9d5ace;});})[_0x1a97('0x26')](function(){_0x46c985[_0x1a97('0x1c')](0xcc)[_0x1a97('0x1d')]();});}};}function handleEntityNotFound(_0x1df8bf,_0x37aa71){return function(_0x68b69f){if(!_0x68b69f){_0x1df8bf[_0x1a97('0x1b')](0x194);}return _0x68b69f;};}function handleError(_0x1ffee3,_0x323459){_0x323459=_0x323459||0x1f4;return function(_0x42fbfb){logger[_0x1a97('0x2a')](_0x42fbfb[_0x1a97('0x2b')]);if(_0x42fbfb['name']){delete _0x42fbfb['name'];}_0x1ffee3[_0x1a97('0x1c')](_0x323459)[_0x1a97('0x2c')](_0x42fbfb);};}exports[_0x1a97('0x2d')]=function(_0x3a5452,_0x54f619){var _0x519499={},_0x57134a={},_0x4ff2ab={'count':0x0,'rows':[]};var _0x3df7bd=_[_0x1a97('0x2e')](db[_0x1a97('0x2f')][_0x1a97('0x30')],function(_0x1c3746){return{'name':_0x1c3746[_0x1a97('0x31')],'type':_0x1c3746[_0x1a97('0x32')][_0x1a97('0x33')]};});_0x57134a[_0x1a97('0x34')]=_[_0x1a97('0x2e')](_0x3df7bd,'name');_0x57134a[_0x1a97('0x35')]=_[_0x1a97('0x36')](_0x3a5452[_0x1a97('0x35')]);_0x57134a[_0x1a97('0x37')]=_[_0x1a97('0x38')](_0x57134a[_0x1a97('0x34')],_0x57134a[_0x1a97('0x35')]);_0x519499[_0x1a97('0x39')]=_[_0x1a97('0x38')](_0x57134a[_0x1a97('0x34')],qs[_0x1a97('0x3a')](_0x3a5452[_0x1a97('0x35')][_0x1a97('0x3a')]));_0x519499[_0x1a97('0x39')]=_0x519499[_0x1a97('0x39')][_0x1a97('0x3b')]?_0x519499['attributes']:_0x57134a[_0x1a97('0x34')];if(!_0x3a5452['query'][_0x1a97('0x3c')](_0x1a97('0x3d'))){_0x519499['limit']=qs[_0x1a97('0x22')](_0x3a5452['query']['limit']);_0x519499[_0x1a97('0x1f')]=qs[_0x1a97('0x1f')](_0x3a5452[_0x1a97('0x35')]['offset']);}_0x519499['order']=qs['sort'](_0x3a5452[_0x1a97('0x35')][_0x1a97('0x3e')]);_0x519499[_0x1a97('0x3f')]=qs[_0x1a97('0x37')](_[_0x1a97('0x40')](_0x3a5452['query'],_0x57134a['filters']),_0x3df7bd);if(_0x3a5452[_0x1a97('0x35')][_0x1a97('0x41')]){_0x519499[_0x1a97('0x3f')]=_[_0x1a97('0x42')](_0x519499['where'],{'$or':_['map'](_0x3df7bd,function(_0x1f3caf){if(_0x1f3caf['type']!==_0x1a97('0x43')){var _0x5217fa={};_0x5217fa[_0x1f3caf[_0x1a97('0x44')]]={'$like':'%'+_0x3a5452['query'][_0x1a97('0x41')]+'%'};return _0x5217fa;}})});}_0x519499=_[_0x1a97('0x42')]({},_0x519499,_0x3a5452[_0x1a97('0x45')]);var _0x4d4076={'where':_0x519499[_0x1a97('0x3f')]};return db[_0x1a97('0x2f')][_0x1a97('0x21')](_0x4d4076)[_0x1a97('0x26')](function(_0x3ee0a4){_0x4ff2ab['count']=_0x3ee0a4;if(_0x3a5452['query'][_0x1a97('0x46')]){_0x519499[_0x1a97('0x47')]=[{'all':!![]}];}return db[_0x1a97('0x2f')][_0x1a97('0x48')](_0x519499);})[_0x1a97('0x26')](function(_0x17f9ed){_0x4ff2ab['rows']=_0x17f9ed;return _0x4ff2ab;})[_0x1a97('0x26')](respondWithFilteredResult(_0x54f619,_0x519499))[_0x1a97('0x49')](handleError(_0x54f619,null));};exports[_0x1a97('0x4a')]=function(_0x5650f2,_0x2a0b18){var _0x5982af={'raw':!![],'where':{'id':_0x5650f2['params']['id']}},_0x548ead={};_0x548ead[_0x1a97('0x34')]=_[_0x1a97('0x36')](db[_0x1a97('0x2f')][_0x1a97('0x30')]);_0x548ead[_0x1a97('0x35')]=_[_0x1a97('0x36')](_0x5650f2[_0x1a97('0x35')]);_0x548ead['filters']=_[_0x1a97('0x38')](_0x548ead[_0x1a97('0x34')],_0x548ead[_0x1a97('0x35')]);_0x5982af[_0x1a97('0x39')]=_['intersection'](_0x548ead[_0x1a97('0x34')],qs['fields'](_0x5650f2[_0x1a97('0x35')][_0x1a97('0x3a')]));_0x5982af['attributes']=_0x5982af['attributes'][_0x1a97('0x3b')]?_0x5982af[_0x1a97('0x39')]:_0x548ead[_0x1a97('0x34')];if(_0x5650f2[_0x1a97('0x35')][_0x1a97('0x46')]){_0x5982af[_0x1a97('0x47')]=[{'all':!![]}];}_0x5982af=_[_0x1a97('0x42')]({},_0x5982af,_0x5650f2[_0x1a97('0x45')]);return db[_0x1a97('0x2f')]['find'](_0x5982af)[_0x1a97('0x26')](handleEntityNotFound(_0x2a0b18,null))[_0x1a97('0x26')](respondWithResult(_0x2a0b18,null))[_0x1a97('0x49')](handleError(_0x2a0b18,null));};exports[_0x1a97('0x4b')]=function(_0xf6a273,_0x1357e2){return db[_0x1a97('0x2f')][_0x1a97('0x4b')](_0xf6a273[_0x1a97('0x4c')],{})[_0x1a97('0x26')](function(_0x47c800){var _0x1d1748=_0xf6a273[_0x1a97('0x4d')]['get']({'plain':!![]});if(!_0x1d1748)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d1748[_0x1a97('0x4e')]==='user'){var _0x37b126=_0x47c800['get']({'plain':!![]});var _0x342961='CmHopperAdditionalPhones';return db[_0x1a97('0x4f')]['find']({'where':{'name':_0x342961,'userProfileId':_0x1d1748[_0x1a97('0x50')]},'raw':!![]})['then'](function(_0xbf1615){if(_0xbf1615&&_0xbf1615[_0x1a97('0x51')]===0x0){return db[_0x1a97('0x28')][_0x1a97('0x4b')]({'name':_0x37b126[_0x1a97('0x44')],'resourceId':_0x37b126['id'],'type':_0xbf1615['name'],'sectionId':_0xbf1615['id']},{})[_0x1a97('0x26')](function(){return _0x47c800;});}else{return _0x47c800;}})[_0x1a97('0x49')](function(_0x496042){logger[_0x1a97('0x2a')](_0x1a97('0x52'),_0x496042);throw _0x496042;});}return _0x47c800;})[_0x1a97('0x26')](respondWithResult(_0x1357e2,0xc9))[_0x1a97('0x49')](handleError(_0x1357e2,null));};exports[_0x1a97('0x53')]=function(_0x1f828a,_0x462d59){if(_0x1f828a[_0x1a97('0x4c')]['id']){delete _0x1f828a['body']['id'];}return db[_0x1a97('0x2f')][_0x1a97('0x54')]({'where':{'id':_0x1f828a[_0x1a97('0x55')]['id']}})[_0x1a97('0x26')](handleEntityNotFound(_0x462d59,null))['then'](saveUpdates(_0x1f828a[_0x1a97('0x4c')],null))[_0x1a97('0x26')](respondWithResult(_0x462d59,null))[_0x1a97('0x49')](handleError(_0x462d59,null));};exports['destroy']=function(_0x46d248,_0x2fa485){return db[_0x1a97('0x2f')]['find']({'where':{'id':_0x46d248['params']['id']}})['then'](handleEntityNotFound(_0x2fa485,null))[_0x1a97('0x26')](removeEntity(_0x2fa485,null))[_0x1a97('0x49')](handleError(_0x2fa485,null));}; \ No newline at end of file +var _0xab22=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0xab22,0x14b));var _0x2ab2=function(_0xe5ad59,_0x4354ae){_0xe5ad59=_0xe5ad59-0x0;var _0x15df32=_0xab22[_0xe5ad59];return _0x15df32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ab2('0x0'));var zipdir=require(_0x2ab2('0x1'));var jsonpatch=require(_0x2ab2('0x2'));var rp=require(_0x2ab2('0x3'));var moment=require('moment');var BPromise=require(_0x2ab2('0x4'));var Mustache=require(_0x2ab2('0x5'));var util=require(_0x2ab2('0x6'));var path=require(_0x2ab2('0x7'));var sox=require(_0x2ab2('0x8'));var csv=require(_0x2ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ab2('0xa'));var _=require(_0x2ab2('0xb'));var squel=require(_0x2ab2('0xc'));var crypto=require(_0x2ab2('0xd'));var jsforce=require(_0x2ab2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2ab2('0x9'));var querystring=require(_0x2ab2('0xf'));var Papa=require(_0x2ab2('0x10'));var Redis=require(_0x2ab2('0x11'));var authService=require(_0x2ab2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2ab2('0x13'));var hardwareService=require(_0x2ab2('0x14'));var logger=require(_0x2ab2('0x15'))(_0x2ab2('0x16'));var utils=require('../../config/utils');var config=require(_0x2ab2('0x17'));var licenseUtil=require(_0x2ab2('0x18'));var db=require(_0x2ab2('0x19'))['db'];function respondWithStatusCode(_0x27bdad,_0x2a1a0a){_0x2a1a0a=_0x2a1a0a||0xcc;return function(_0x4f9930){if(_0x4f9930){return _0x27bdad[_0x2ab2('0x1a')](_0x2a1a0a);}return _0x27bdad[_0x2ab2('0x1b')](_0x2a1a0a)[_0x2ab2('0x1c')]();};}function respondWithResult(_0x4dbd7a,_0x3decbb){_0x3decbb=_0x3decbb||0xc8;return function(_0x3c4a1e){if(_0x3c4a1e){return _0x4dbd7a[_0x2ab2('0x1b')](_0x3decbb)[_0x2ab2('0x1d')](_0x3c4a1e);}};}function respondWithFilteredResult(_0x222d3c,_0x1b1fa1){return function(_0xf54135){if(_0xf54135){var _0x2adb8a=typeof _0x1b1fa1[_0x2ab2('0x1e')]===_0x2ab2('0x1f')&&typeof _0x1b1fa1[_0x2ab2('0x20')]===_0x2ab2('0x1f');var _0x647e38=_0xf54135[_0x2ab2('0x21')];var _0x340f08=_0x2adb8a?0x0:_0x1b1fa1[_0x2ab2('0x1e')];var _0x4c6adc=_0x2adb8a?_0xf54135[_0x2ab2('0x21')]:_0x1b1fa1['offset']+_0x1b1fa1[_0x2ab2('0x20')];var _0x5af32f;if(_0x4c6adc>=_0x647e38){_0x4c6adc=_0x647e38;_0x5af32f=0xc8;}else{_0x5af32f=0xce;}_0x222d3c[_0x2ab2('0x1b')](_0x5af32f);return _0x222d3c[_0x2ab2('0x22')](_0x2ab2('0x23'),_0x340f08+'-'+_0x4c6adc+'/'+_0x647e38)['json'](_0xf54135);}return null;};}function patchUpdates(_0x18c544){return function(_0x1152d5){try{jsonpatch[_0x2ab2('0x24')](_0x1152d5,_0x18c544,!![]);}catch(_0xdb1c3a){return BPromise[_0x2ab2('0x25')](_0xdb1c3a);}return _0x1152d5[_0x2ab2('0x26')]();};}function saveUpdates(_0x4b6f81,_0x5819c1){return function(_0x47e50e){if(_0x47e50e){return _0x47e50e[_0x2ab2('0x27')](_0x4b6f81)[_0x2ab2('0x28')](function(_0x5ae580){return _0x5ae580;});}return null;};}function removeEntity(_0x2cf76f,_0x20a4aa){return function(_0x261a18){if(_0x261a18){return _0x261a18[_0x2ab2('0x29')]()['then'](function(){var _0x3e563d=_0x261a18[_0x2ab2('0x2a')]({'plain':!![]});var _0x348935='CmHopperAdditionalPhones';return db[_0x2ab2('0x2b')]['destroy']({'where':{'type':_0x348935,'resourceId':_0x3e563d['id']}})[_0x2ab2('0x28')](function(){return _0x261a18;});})[_0x2ab2('0x28')](function(){_0x2cf76f[_0x2ab2('0x1b')](0xcc)[_0x2ab2('0x1c')]();});}};}function handleEntityNotFound(_0x58c787,_0x3df6bc){return function(_0x4a414c){if(!_0x4a414c){_0x58c787[_0x2ab2('0x1a')](0x194);}return _0x4a414c;};}function handleError(_0x3d603f,_0x514646){_0x514646=_0x514646||0x1f4;return function(_0x3885d4){logger[_0x2ab2('0x2c')](_0x3885d4[_0x2ab2('0x2d')]);if(_0x3885d4[_0x2ab2('0x2e')]){delete _0x3885d4['name'];}_0x3d603f[_0x2ab2('0x1b')](_0x514646)[_0x2ab2('0x2f')](_0x3885d4);};}exports['index']=function(_0x1a8399,_0x25b555){var _0x31a896={},_0x467832={},_0x1807bf={'count':0x0,'rows':[]};var _0x120622=_[_0x2ab2('0x30')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x52461f){return{'name':_0x52461f[_0x2ab2('0x31')],'type':_0x52461f[_0x2ab2('0x32')]['key']};});_0x467832[_0x2ab2('0x33')]=_[_0x2ab2('0x30')](_0x120622,_0x2ab2('0x2e'));_0x467832[_0x2ab2('0x34')]=_['keys'](_0x1a8399[_0x2ab2('0x34')]);_0x467832[_0x2ab2('0x35')]=_[_0x2ab2('0x36')](_0x467832[_0x2ab2('0x33')],_0x467832[_0x2ab2('0x34')]);_0x31a896[_0x2ab2('0x37')]=_[_0x2ab2('0x36')](_0x467832['model'],qs[_0x2ab2('0x38')](_0x1a8399[_0x2ab2('0x34')]['fields']));_0x31a896[_0x2ab2('0x37')]=_0x31a896['attributes']['length']?_0x31a896[_0x2ab2('0x37')]:_0x467832[_0x2ab2('0x33')];if(!_0x1a8399['query']['hasOwnProperty']('nolimit')){_0x31a896[_0x2ab2('0x20')]=qs['limit'](_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x20')]);_0x31a896['offset']=qs['offset'](_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x1e')]);}_0x31a896[_0x2ab2('0x39')]=qs[_0x2ab2('0x3a')](_0x1a8399['query']['sort']);_0x31a896[_0x2ab2('0x3b')]=qs[_0x2ab2('0x35')](_[_0x2ab2('0x3c')](_0x1a8399[_0x2ab2('0x34')],_0x467832[_0x2ab2('0x35')]),_0x120622);if(_0x1a8399['query'][_0x2ab2('0x3d')]){_0x31a896['where']=_['merge'](_0x31a896[_0x2ab2('0x3b')],{'$or':_[_0x2ab2('0x30')](_0x120622,function(_0x21bb5c){if(_0x21bb5c['type']!==_0x2ab2('0x3e')){var _0x113e9f={};_0x113e9f[_0x21bb5c[_0x2ab2('0x2e')]]={'$like':'%'+_0x1a8399[_0x2ab2('0x34')]['filter']+'%'};return _0x113e9f;}})});}_0x31a896=_['merge']({},_0x31a896,_0x1a8399['options']);var _0x3a8d0f={'where':_0x31a896[_0x2ab2('0x3b')]};return db[_0x2ab2('0x3f')][_0x2ab2('0x21')](_0x3a8d0f)['then'](function(_0x49b350){_0x1807bf[_0x2ab2('0x21')]=_0x49b350;if(_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x40')]){_0x31a896[_0x2ab2('0x41')]=[{'all':!![]}];}return db[_0x2ab2('0x3f')][_0x2ab2('0x42')](_0x31a896);})[_0x2ab2('0x28')](function(_0x5970ff){_0x1807bf[_0x2ab2('0x43')]=_0x5970ff;return _0x1807bf;})[_0x2ab2('0x28')](respondWithFilteredResult(_0x25b555,_0x31a896))[_0x2ab2('0x44')](handleError(_0x25b555,null));};exports[_0x2ab2('0x45')]=function(_0x27e887,_0x142662){var _0x4bc02a={'raw':!![],'where':{'id':_0x27e887[_0x2ab2('0x46')]['id']}},_0x9daa4f={};_0x9daa4f[_0x2ab2('0x33')]=_['keys'](db['CmHopperAdditionalPhone'][_0x2ab2('0x47')]);_0x9daa4f[_0x2ab2('0x34')]=_[_0x2ab2('0x48')](_0x27e887['query']);_0x9daa4f['filters']=_[_0x2ab2('0x36')](_0x9daa4f[_0x2ab2('0x33')],_0x9daa4f[_0x2ab2('0x34')]);_0x4bc02a[_0x2ab2('0x37')]=_[_0x2ab2('0x36')](_0x9daa4f[_0x2ab2('0x33')],qs['fields'](_0x27e887['query'][_0x2ab2('0x38')]));_0x4bc02a[_0x2ab2('0x37')]=_0x4bc02a[_0x2ab2('0x37')]['length']?_0x4bc02a['attributes']:_0x9daa4f[_0x2ab2('0x33')];if(_0x27e887[_0x2ab2('0x34')][_0x2ab2('0x40')]){_0x4bc02a['include']=[{'all':!![]}];}_0x4bc02a=_[_0x2ab2('0x49')]({},_0x4bc02a,_0x27e887[_0x2ab2('0x4a')]);return db[_0x2ab2('0x3f')][_0x2ab2('0x4b')](_0x4bc02a)[_0x2ab2('0x28')](handleEntityNotFound(_0x142662,null))[_0x2ab2('0x28')](respondWithResult(_0x142662,null))[_0x2ab2('0x44')](handleError(_0x142662,null));};exports['create']=function(_0x286b66,_0x4eefc9){return db[_0x2ab2('0x3f')][_0x2ab2('0x4c')](_0x286b66[_0x2ab2('0x4d')],{})[_0x2ab2('0x28')](function(_0xad599f){var _0x4cf268=_0x286b66[_0x2ab2('0x4e')][_0x2ab2('0x2a')]({'plain':!![]});if(!_0x4cf268)throw new Error(_0x2ab2('0x4f'));if(_0x4cf268[_0x2ab2('0x50')]==='user'){var _0x142a72=_0xad599f[_0x2ab2('0x2a')]({'plain':!![]});var _0x194fb9=_0x2ab2('0x51');return db[_0x2ab2('0x52')][_0x2ab2('0x4b')]({'where':{'name':_0x194fb9,'userProfileId':_0x4cf268['userProfileId']},'raw':!![]})[_0x2ab2('0x28')](function(_0x5954a9){if(_0x5954a9&&_0x5954a9[_0x2ab2('0x53')]===0x0){return db['UserProfileResource'][_0x2ab2('0x4c')]({'name':_0x142a72['name'],'resourceId':_0x142a72['id'],'type':_0x5954a9[_0x2ab2('0x2e')],'sectionId':_0x5954a9['id']},{})[_0x2ab2('0x28')](function(){return _0xad599f;});}else{return _0xad599f;}})['catch'](function(_0xdc5379){logger[_0x2ab2('0x2c')](_0x2ab2('0x54'),_0xdc5379);throw _0xdc5379;});}return _0xad599f;})[_0x2ab2('0x28')](respondWithResult(_0x4eefc9,0xc9))[_0x2ab2('0x44')](handleError(_0x4eefc9,null));};exports[_0x2ab2('0x27')]=function(_0x3430b8,_0x3b11b1){if(_0x3430b8[_0x2ab2('0x4d')]['id']){delete _0x3430b8[_0x2ab2('0x4d')]['id'];}return db[_0x2ab2('0x3f')][_0x2ab2('0x4b')]({'where':{'id':_0x3430b8[_0x2ab2('0x46')]['id']}})[_0x2ab2('0x28')](handleEntityNotFound(_0x3b11b1,null))[_0x2ab2('0x28')](saveUpdates(_0x3430b8[_0x2ab2('0x4d')],null))[_0x2ab2('0x28')](respondWithResult(_0x3b11b1,null))[_0x2ab2('0x44')](handleError(_0x3b11b1,null));};exports['destroy']=function(_0x11e37f,_0x597c32){return db[_0x2ab2('0x3f')]['find']({'where':{'id':_0x11e37f['params']['id']}})[_0x2ab2('0x28')](handleEntityNotFound(_0x597c32,null))['then'](removeEntity(_0x597c32,null))[_0x2ab2('0x44')](handleError(_0x597c32,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index a1ad3f8..cab1d47 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3a=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','CmHopperAdditionalPhone'];(function(_0x3a11ab,_0x3f2562){var _0x524541=function(_0x686a9){while(--_0x686a9){_0x3a11ab['push'](_0x3a11ab['shift']());}};_0x524541(++_0x3f2562);}(_0x0b3a,0x9a));var _0xa0b3=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x0b3a[_0x2af160];return _0x439d67;};'use strict';var _=require(_0xa0b3('0x0'));var util=require(_0xa0b3('0x1'));var logger=require(_0xa0b3('0x2'))(_0xa0b3('0x3'));var moment=require(_0xa0b3('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0b3('0x5'));var fs=require('fs');var path=require(_0xa0b3('0x6'));var rimraf=require(_0xa0b3('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xa0b3('0x8')]=function(_0x156bff,_0x30d509){return _0x156bff[_0xa0b3('0x9')](_0xa0b3('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c8=['path','../../config/environment','exports','CmHopperAdditionalPhone','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4a9ded,_0x5f8a6e){var _0x392b48=function(_0x496189){while(--_0x496189){_0x4a9ded['push'](_0x4a9ded['shift']());}};_0x392b48(++_0x5f8a6e);}(_0xc2c8,0x1e4));var _0x8c2c=function(_0x330251,_0x44d71d){_0x330251=_0x330251-0x0;var _0x5e734f=_0xc2c8[_0x330251];return _0x5e734f;};'use strict';var _=require(_0x8c2c('0x0'));var util=require(_0x8c2c('0x1'));var logger=require(_0x8c2c('0x2'))('api');var moment=require(_0x8c2c('0x3'));var BPromise=require(_0x8c2c('0x4'));var rp=require(_0x8c2c('0x5'));var fs=require('fs');var path=require(_0x8c2c('0x6'));var rimraf=require('rimraf');var config=require(_0x8c2c('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x8c2c('0x8')]=function(_0x403620,_0x1fbb60){return _0x403620['define'](_0x8c2c('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index d5ae887..bf510a0 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb552=['countnosuchnumberretry','createdAt','updatedAt','sequelize','transaction','update','phone','field','IncrementPreviewCounters','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countdropretry','countmachineretry','SwapAdditionalPhones','ContactId','duration','waitTime','isNil','scheduledat','add','minutes'];(function(_0x3ff009,_0x1a3994){var _0x4346bf=function(_0x14350a){while(--_0x14350a){_0x3ff009['push'](_0x3ff009['shift']());}};_0x4346bf(++_0x1a3994);}(_0xb552,0x1d9));var _0x2b55=function(_0x5566f9,_0xa2899d){_0x5566f9=_0x5566f9-0x0;var _0x246527=_0xb552[_0x5566f9];return _0x246527;};'use strict';var _=require('lodash');var util=require(_0x2b55('0x0'));var moment=require('moment');var BPromise=require(_0x2b55('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b55('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b55('0x3'));var logger=require(_0x2b55('0x4'))(_0x2b55('0x5'));var config=require(_0x2b55('0x6'));var jayson=require(_0x2b55('0x7'));var client=jayson[_0x2b55('0x8')][_0x2b55('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373178,_0x562ce9,_0x43d57c){return new BPromise(function(_0x1c4bc8,_0x46ba0e){return client[_0x2b55('0xa')](_0x373178,_0x43d57c)[_0x2b55('0xb')](function(_0x57b0c5){logger[_0x2b55('0xc')](_0x2b55('0xd'),_0x562ce9,_0x2b55('0xe'));logger[_0x2b55('0xf')](_0x2b55('0x10'),_0x562ce9,_0x2b55('0xe'),JSON[_0x2b55('0x11')](_0x57b0c5));if(_0x57b0c5['error']){if(_0x57b0c5[_0x2b55('0x12')][_0x2b55('0x13')]===0x1f4){logger[_0x2b55('0x12')](_0x2b55('0xd'),_0x562ce9,_0x57b0c5[_0x2b55('0x12')]['message']);return _0x46ba0e(_0x57b0c5[_0x2b55('0x12')][_0x2b55('0x14')]);}logger[_0x2b55('0x12')](_0x2b55('0xd'),_0x562ce9,_0x57b0c5['error'][_0x2b55('0x14')]);return _0x1c4bc8(_0x57b0c5['error'][_0x2b55('0x14')]);}else{logger[_0x2b55('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x562ce9,_0x2b55('0xe'));_0x1c4bc8(_0x57b0c5['result'][_0x2b55('0x14')]);}})[_0x2b55('0x15')](function(_0x2523e9){logger[_0x2b55('0x12')](_0x2b55('0xd'),_0x562ce9,_0x2523e9);_0x46ba0e(_0x2523e9);});});}exports[_0x2b55('0x16')]=function(_0x175f91){var _0x3e6d6b=this;return new Promise(function(_0x568047,_0x38d673){return db[_0x2b55('0x17')][_0x2b55('0x18')]({'raw':!![],'where':{'ContactId':_0x175f91[_0x2b55('0x19')]['ContactId'],'ListId':_0x175f91[_0x2b55('0x19')][_0x2b55('0x1a')],'VoiceQueueId':_0x175f91[_0x2b55('0x19')][_0x2b55('0x1b')]===undefined?null:_0x175f91[_0x2b55('0x19')]['VoiceQueueId'],'CampaignId':_0x175f91[_0x2b55('0x19')][_0x2b55('0x1c')]===undefined?null:_0x175f91[_0x2b55('0x19')][_0x2b55('0x1c')]}})[_0x2b55('0xb')](function(_0x485af8){if(_0x485af8!=null){return db[_0x2b55('0x1d')][_0x2b55('0x18')]({'raw':!![],'where':{'CmHopperId':_0x485af8['id'],'OrderBy':{'$gt':_0x485af8[_0x2b55('0x1e')]}},'order':[[_0x2b55('0x1e'),_0x2b55('0x1f')]]})['then'](function(_0x25813e){var _0x480f60=0x0;if(_0x25813e){if(_0x25813e[_0x2b55('0x20')]+_0x25813e[_0x2b55('0x21')]+_0x25813e[_0x2b55('0x22')]+_0x25813e['countnosuchnumberretry']+_0x25813e['countdropretry']+_0x25813e[_0x2b55('0x23')]+_0x25813e['countmachineretry']+_0x25813e[_0x2b55('0x24')]<_0x175f91[_0x2b55('0x25')][_0x2b55('0x26')])_0x480f60=0x1;_0x568047({'additional':_0x480f60});}else{return db[_0x2b55('0x1d')][_0x2b55('0x18')]({'raw':!![],'where':{'CmHopperId':_0x485af8['id']},'order':[[_0x2b55('0x1e'),'ASC']]})[_0x2b55('0xb')](function(_0x5c54d9){var _0x39e3d8=0x0;if(_0x5c54d9){if(_0x5c54d9[_0x2b55('0x20')]+_0x5c54d9[_0x2b55('0x21')]+_0x5c54d9[_0x2b55('0x22')]+_0x5c54d9['countnosuchnumberretry']+_0x5c54d9[_0x2b55('0x27')]+_0x5c54d9['countabandonedretry']+_0x5c54d9[_0x2b55('0x28')]+_0x5c54d9[_0x2b55('0x24')]<_0x175f91[_0x2b55('0x25')][_0x2b55('0x26')])_0x39e3d8=0x1;_0x568047({'additional':_0x39e3d8});}else{_0x568047({'additional':0x0});}})[_0x2b55('0x15')](function(_0x23ea33){logger[_0x2b55('0x12')](_0x2b55('0x16'),_0x23ea33[_0x2b55('0x14')]);_0x38d673(_0x3e6d6b[_0x2b55('0x12')](0x1f4,_0x23ea33[_0x2b55('0x14')]));});}})['catch'](function(_0x224734){logger['error'](_0x2b55('0x16'),_0x224734[_0x2b55('0x14')]);_0x38d673(_0x3e6d6b['error'](0x1f4,_0x224734[_0x2b55('0x14')]));});}else _0x568047({'additional':0x0});});});};exports[_0x2b55('0x29')]=function(_0x19c588){var _0x336c66=this;return new Promise(function(_0x292175,_0x3db679){return db[_0x2b55('0x17')][_0x2b55('0x18')]({'raw':!![],'where':{'ContactId':_0x19c588[_0x2b55('0x19')][_0x2b55('0x2a')],'ListId':_0x19c588['body'][_0x2b55('0x1a')],'VoiceQueueId':_0x19c588['body']['VoiceQueueId']===undefined?null:_0x19c588['body'][_0x2b55('0x1b')],'CampaignId':_0x19c588[_0x2b55('0x19')][_0x2b55('0x1c')]===undefined?null:_0x19c588[_0x2b55('0x19')]['CampaignId']}})[_0x2b55('0xb')](function(_0x1b786a){if(_0x1b786a!=null){return db['CmHopperAdditionalPhone'][_0x2b55('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1b786a['id'],'OrderBy':{'$gte':_0x1b786a['OrderBy']}},'order':[[_0x2b55('0x1e'),_0x2b55('0x1f')]]})[_0x2b55('0xb')](function(_0xe09156){if(_0xe09156)return activateAdditionalPhone(_0x1b786a,_0x19c588[_0x2b55('0x19')],_0xe09156,_0x19c588[_0x2b55('0x2b')],_0x19c588[_0x2b55('0x2c')])[_0x2b55('0xb')](function(_0x1d0ea6){_0x292175(_0x1d0ea6);});else{return db[_0x2b55('0x1d')][_0x2b55('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1b786a['id']},'order':[[_0x2b55('0x1e'),_0x2b55('0x1f')]]})[_0x2b55('0xb')](function(_0x147018){if(_0x147018)return activateAdditionalPhone(_0x1b786a,_0x19c588['body'],_0x147018,_0x19c588[_0x2b55('0x2b')],_0x19c588[_0x2b55('0x2c')])[_0x2b55('0xb')](function(_0x4c9bf2){_0x292175(_0x4c9bf2);});else{_0x292175({'id':_0x1b786a['id'],'phone':''});}})[_0x2b55('0x15')](function(_0x44552f){logger[_0x2b55('0x12')](_0x2b55('0x16'),_0x44552f[_0x2b55('0x14')]);_0x3db679(_0x336c66[_0x2b55('0x12')](0x1f4,_0x44552f[_0x2b55('0x14')]));});}})[_0x2b55('0x15')](function(_0x225bbd){logger[_0x2b55('0x12')](_0x2b55('0x16'),_0x225bbd[_0x2b55('0x14')]);_0x3db679(_0x336c66[_0x2b55('0x12')](0x1f4,_0x225bbd[_0x2b55('0x14')]));});}else _0x292175(0x1);});});};function activateAdditionalPhone(_0x5f5084,_0x45f9c5,_0x5d9ca4,_0x51af26,_0x157f68){return new Promise(function(_0x5f36d0,_0x4a2e27){var _0x40d81e;if(_[_0x2b55('0x2d')](_0x5d9ca4['scheduledat'])){_0x5d9ca4[_0x2b55('0x2e')]=moment();}if(moment()>moment(_0x5d9ca4[_0x2b55('0x2e')])){_0x40d81e=moment()[_0x2b55('0x2f')](_0x157f68||0x3,_0x2b55('0x30'));}else{if(_0x5d9ca4[_0x2b55('0x1e')]==0x0){_0x40d81e=moment(_0x5d9ca4[_0x2b55('0x2e')]);}else{_0x40d81e=moment()[_0x2b55('0x2f')](_0x157f68||0x3,_0x2b55('0x30'));}}if(_[_0x2b55('0x2d')](_0x40d81e)){_0x40d81e=moment()[_0x2b55('0x2f')](_0x157f68||0x3,_0x2b55('0x30'));}var _0x3d9f7c={'phone':_0x5f5084['phone'],'active':0x0,'OrderBy':_[_0x2b55('0x2d')](_0x5f5084[_0x2b55('0x1e')])?0x0:_0x5f5084[_0x2b55('0x1e')],'scheduledat':moment()[_0x2b55('0x2f')](_0x51af26||0x1,'minutes'),'countbusyretry':_0x45f9c5[_0x2b55('0x20')],'countcongestionretry':_0x45f9c5[_0x2b55('0x21')],'countnoanswerretry':_0x45f9c5[_0x2b55('0x22')],'countnosuchnumberretry':_0x45f9c5[_0x2b55('0x31')],'countdropretry':_0x45f9c5[_0x2b55('0x27')],'countabandonedretry':_0x45f9c5[_0x2b55('0x23')],'countmachineretry':_0x45f9c5[_0x2b55('0x28')],'countagentrejectretry':_0x45f9c5[_0x2b55('0x24')],'createdAt':_0x45f9c5[_0x2b55('0x32')],'updatedAt':_0x45f9c5[_0x2b55('0x33')]};var _0x4ea56c={'CmHopperId':_0x5f5084['id'],'phone':_0x5d9ca4['phone'],'active':0x0,'OrderBy':_[_0x2b55('0x2d')](_0x5d9ca4[_0x2b55('0x1e')])?0x0:_0x5d9ca4[_0x2b55('0x1e')],'scheduledat':_0x40d81e,'countbusyretry':_0x5d9ca4[_0x2b55('0x20')],'countcongestionretry':_0x5d9ca4['countcongestionretry'],'countnoanswerretry':_0x5d9ca4['countnoanswerretry'],'countnosuchnumberretry':_0x5d9ca4[_0x2b55('0x31')],'countdropretry':_0x5d9ca4[_0x2b55('0x27')],'countabandonedretry':_0x5d9ca4[_0x2b55('0x23')],'countmachineretry':_0x5d9ca4[_0x2b55('0x28')],'countagentrejectretry':_0x5d9ca4[_0x2b55('0x24')],'createdAt':_0x5d9ca4[_0x2b55('0x32')],'updatedAt':_0x5d9ca4[_0x2b55('0x33')]};return db[_0x2b55('0x34')][_0x2b55('0x35')](function(_0x248bce){return db[_0x2b55('0x1d')][_0x2b55('0x36')](_0x3d9f7c,{'where':{'id':_0x5d9ca4['id']}},{'transaction':_0x248bce})[_0x2b55('0xb')](function(){return db['CmHopper']['update'](_0x4ea56c,{'where':{'id':_0x5f5084['id']}},{'transaction':_0x248bce});});})[_0x2b55('0xb')](function(_0x5a0e4b){_0x5f36d0({'id':_0x5f5084['id'],'phone':_0x5d9ca4[_0x2b55('0x37')]});})[_0x2b55('0x15')](function(_0xc55428){logger[_0x2b55('0x12')]('activateAdditionalPhone',_0xc55428[_0x2b55('0x14')]);_0x4a2e27({'error':_0xc55428[_0x2b55('0x14')]});});});}exports['IncrementPreviewCounters']=function(_0x166b82){var _0x5b8762=this;return new Promise(function(_0x59827f,_0xde9418){return db[_0x2b55('0x17')][_0x2b55('0x36')](_0x166b82[_0x2b55('0x19')][_0x2b55('0x38')],{'where':{'id':_0x166b82[_0x2b55('0x19')]['id']}})[_0x2b55('0xb')](function(_0x5a7c3b){_0x59827f(_0x5a7c3b);})[_0x2b55('0x15')](function(_0x5e73f9){logger[_0x2b55('0x12')](_0x2b55('0x39'),_0x5e73f9['message']);_0xde9418(_0x5b8762['error'](0x1f4,_0x5e73f9[_0x2b55('0x14')]));});});}; \ No newline at end of file +var _0xc2c7=['countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','CmHopperAdditionalPhone','countcongestionretry'];(function(_0x49b3d7,_0x3b60d8){var _0x3bb7ab=function(_0x88c64f){while(--_0x88c64f){_0x49b3d7['push'](_0x49b3d7['shift']());}};_0x3bb7ab(++_0x3b60d8);}(_0xc2c7,0x131));var _0x7c2c=function(_0x5670d4,_0x4a4703){_0x5670d4=_0x5670d4-0x0;var _0x5c8602=_0xc2c7[_0x5670d4];return _0x5c8602;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c2c('0x1'));var fs=require('fs');var Redis=require(_0x7c2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c2c('0x3'));var logger=require('../../config/logger')(_0x7c2c('0x4'));var config=require(_0x7c2c('0x5'));var jayson=require(_0x7c2c('0x6'));var client=jayson[_0x7c2c('0x7')][_0x7c2c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x137c6f,_0x25085f,_0x4bf8f0){return new BPromise(function(_0x54e155,_0x132b06){return client[_0x7c2c('0x9')](_0x137c6f,_0x4bf8f0)[_0x7c2c('0xa')](function(_0x3a149b){logger[_0x7c2c('0xb')](_0x7c2c('0xc'),_0x25085f,_0x7c2c('0xd'));logger[_0x7c2c('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x25085f,_0x7c2c('0xd'),JSON['stringify'](_0x3a149b));if(_0x3a149b['error']){if(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x10')]===0x1f4){logger['error'](_0x7c2c('0xc'),_0x25085f,_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);return _0x132b06(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);}logger[_0x7c2c('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x25085f,_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);return _0x54e155(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);}else{logger['info'](_0x7c2c('0xc'),_0x25085f,_0x7c2c('0xd'));_0x54e155(_0x3a149b[_0x7c2c('0x12')][_0x7c2c('0x11')]);}})[_0x7c2c('0x13')](function(_0x42ae8c){logger[_0x7c2c('0xf')](_0x7c2c('0xc'),_0x25085f,_0x42ae8c);_0x132b06(_0x42ae8c);});});}exports[_0x7c2c('0x14')]=function(_0x234097){var _0x10ccbc=this;return new Promise(function(_0x302e7f,_0x4fa30c){return db[_0x7c2c('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x17')],'ListId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x18')],'VoiceQueueId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x19')]===undefined?null:_0x234097['body'][_0x7c2c('0x19')],'CampaignId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x1a')]===undefined?null:_0x234097[_0x7c2c('0x16')][_0x7c2c('0x1a')]}})[_0x7c2c('0xa')](function(_0xf6cc16){if(_0xf6cc16!=null){return db['CmHopperAdditionalPhone'][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xf6cc16['id'],'OrderBy':{'$gt':_0xf6cc16[_0x7c2c('0x1c')]}},'order':[['OrderBy',_0x7c2c('0x1d')]]})[_0x7c2c('0xa')](function(_0x322522){var _0x104cab=0x0;if(_0x322522){if(_0x322522[_0x7c2c('0x1e')]+_0x322522['countcongestionretry']+_0x322522[_0x7c2c('0x1f')]+_0x322522[_0x7c2c('0x20')]+_0x322522['countdropretry']+_0x322522['countabandonedretry']+_0x322522[_0x7c2c('0x21')]+_0x322522[_0x7c2c('0x22')]<_0x234097['entity']['dialGlobalMaxRetry'])_0x104cab=0x1;_0x302e7f({'additional':_0x104cab});}else{return db[_0x7c2c('0x23')][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xf6cc16['id']},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})['then'](function(_0x1f9943){var _0x27bcbf=0x0;if(_0x1f9943){if(_0x1f9943['countbusyretry']+_0x1f9943[_0x7c2c('0x24')]+_0x1f9943[_0x7c2c('0x1f')]+_0x1f9943[_0x7c2c('0x20')]+_0x1f9943[_0x7c2c('0x25')]+_0x1f9943[_0x7c2c('0x26')]+_0x1f9943[_0x7c2c('0x21')]+_0x1f9943[_0x7c2c('0x22')]<_0x234097[_0x7c2c('0x27')][_0x7c2c('0x28')])_0x27bcbf=0x1;_0x302e7f({'additional':_0x27bcbf});}else{_0x302e7f({'additional':0x0});}})[_0x7c2c('0x13')](function(_0x2a4e7b){logger[_0x7c2c('0xf')](_0x7c2c('0x14'),_0x2a4e7b[_0x7c2c('0x11')]);_0x4fa30c(_0x10ccbc[_0x7c2c('0xf')](0x1f4,_0x2a4e7b[_0x7c2c('0x11')]));});}})[_0x7c2c('0x13')](function(_0x7dd5f){logger['error'](_0x7c2c('0x14'),_0x7dd5f[_0x7c2c('0x11')]);_0x4fa30c(_0x10ccbc[_0x7c2c('0xf')](0x1f4,_0x7dd5f[_0x7c2c('0x11')]));});}else _0x302e7f({'additional':0x0});});});};exports[_0x7c2c('0x29')]=function(_0x2dc032){var _0x106124=this;return new Promise(function(_0x51695f,_0x531fb4){return db[_0x7c2c('0x15')][_0x7c2c('0x1b')]({'raw':!![],'where':{'ContactId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x17')],'ListId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x18')],'VoiceQueueId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x19')]===undefined?null:_0x2dc032[_0x7c2c('0x16')]['VoiceQueueId'],'CampaignId':_0x2dc032['body'][_0x7c2c('0x1a')]===undefined?null:_0x2dc032['body'][_0x7c2c('0x1a')]}})['then'](function(_0xd6023c){if(_0xd6023c!=null){return db[_0x7c2c('0x23')][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xd6023c['id'],'OrderBy':{'$gte':_0xd6023c[_0x7c2c('0x1c')]}},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})['then'](function(_0x3d8ba0){if(_0x3d8ba0)return activateAdditionalPhone(_0xd6023c,_0x2dc032[_0x7c2c('0x16')],_0x3d8ba0,_0x2dc032[_0x7c2c('0x2a')],_0x2dc032[_0x7c2c('0x2b')])[_0x7c2c('0xa')](function(_0x3f5d8c){_0x51695f(_0x3f5d8c);});else{return db[_0x7c2c('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xd6023c['id']},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})[_0x7c2c('0xa')](function(_0x127b8f){if(_0x127b8f)return activateAdditionalPhone(_0xd6023c,_0x2dc032[_0x7c2c('0x16')],_0x127b8f,_0x2dc032[_0x7c2c('0x2a')],_0x2dc032['waitTime'])[_0x7c2c('0xa')](function(_0x2474b0){_0x51695f(_0x2474b0);});else{_0x51695f({'id':_0xd6023c['id'],'phone':''});}})[_0x7c2c('0x13')](function(_0x127059){logger['error']('VerifyAdditionalPhones',_0x127059[_0x7c2c('0x11')]);_0x531fb4(_0x106124['error'](0x1f4,_0x127059[_0x7c2c('0x11')]));});}})['catch'](function(_0x48a440){logger['error'](_0x7c2c('0x14'),_0x48a440[_0x7c2c('0x11')]);_0x531fb4(_0x106124['error'](0x1f4,_0x48a440[_0x7c2c('0x11')]));});}else _0x51695f(0x1);});});};function activateAdditionalPhone(_0x3bca46,_0x3b5414,_0x3ed36c,_0x1fa38a,_0x3c45c1){return new Promise(function(_0x4f3438,_0x18a741){var _0xc346e0;if(_[_0x7c2c('0x2c')](_0x3ed36c[_0x7c2c('0x2d')])){_0x3ed36c[_0x7c2c('0x2d')]=moment();}if(moment()>moment(_0x3ed36c[_0x7c2c('0x2d')])){_0xc346e0=moment()[_0x7c2c('0x2e')](_0x3c45c1||0x3,_0x7c2c('0x2f'));}else{if(_0x3ed36c[_0x7c2c('0x1c')]==0x0){_0xc346e0=moment(_0x3ed36c[_0x7c2c('0x2d')]);}else{_0xc346e0=moment()['add'](_0x3c45c1||0x3,'minutes');}}if(_['isNil'](_0xc346e0)){_0xc346e0=moment()[_0x7c2c('0x2e')](_0x3c45c1||0x3,_0x7c2c('0x2f'));}var _0x4ea76c={'phone':_0x3bca46[_0x7c2c('0x30')],'active':0x0,'OrderBy':_[_0x7c2c('0x2c')](_0x3bca46[_0x7c2c('0x1c')])?0x0:_0x3bca46[_0x7c2c('0x1c')],'scheduledat':moment()[_0x7c2c('0x2e')](_0x1fa38a||0x1,_0x7c2c('0x2f')),'countbusyretry':_0x3b5414[_0x7c2c('0x1e')],'countcongestionretry':_0x3b5414['countcongestionretry'],'countnoanswerretry':_0x3b5414[_0x7c2c('0x1f')],'countnosuchnumberretry':_0x3b5414['countnosuchnumberretry'],'countdropretry':_0x3b5414[_0x7c2c('0x25')],'countabandonedretry':_0x3b5414[_0x7c2c('0x26')],'countmachineretry':_0x3b5414[_0x7c2c('0x21')],'countagentrejectretry':_0x3b5414[_0x7c2c('0x22')],'createdAt':_0x3b5414[_0x7c2c('0x31')],'updatedAt':_0x3b5414[_0x7c2c('0x32')]};var _0x47bc24={'CmHopperId':_0x3bca46['id'],'phone':_0x3ed36c['phone'],'active':0x0,'OrderBy':_[_0x7c2c('0x2c')](_0x3ed36c[_0x7c2c('0x1c')])?0x0:_0x3ed36c['OrderBy'],'scheduledat':_0xc346e0,'countbusyretry':_0x3ed36c['countbusyretry'],'countcongestionretry':_0x3ed36c['countcongestionretry'],'countnoanswerretry':_0x3ed36c[_0x7c2c('0x1f')],'countnosuchnumberretry':_0x3ed36c[_0x7c2c('0x20')],'countdropretry':_0x3ed36c[_0x7c2c('0x25')],'countabandonedretry':_0x3ed36c[_0x7c2c('0x26')],'countmachineretry':_0x3ed36c[_0x7c2c('0x21')],'countagentrejectretry':_0x3ed36c[_0x7c2c('0x22')],'createdAt':_0x3ed36c[_0x7c2c('0x31')],'updatedAt':_0x3ed36c[_0x7c2c('0x32')]};return db[_0x7c2c('0x33')][_0x7c2c('0x34')](function(_0x4d23d1){return db['CmHopperAdditionalPhone'][_0x7c2c('0x35')](_0x4ea76c,{'where':{'id':_0x3ed36c['id']}},{'transaction':_0x4d23d1})[_0x7c2c('0xa')](function(){return db[_0x7c2c('0x15')][_0x7c2c('0x35')](_0x47bc24,{'where':{'id':_0x3bca46['id']}},{'transaction':_0x4d23d1});});})[_0x7c2c('0xa')](function(_0x9004f2){_0x4f3438({'id':_0x3bca46['id'],'phone':_0x3ed36c['phone']});})[_0x7c2c('0x13')](function(_0x2288b1){logger[_0x7c2c('0xf')](_0x7c2c('0x36'),_0x2288b1[_0x7c2c('0x11')]);_0x18a741({'error':_0x2288b1['message']});});});}exports[_0x7c2c('0x37')]=function(_0x14e6da){var _0x30ee29=this;return new Promise(function(_0xa09fef,_0x2a0bf2){return db[_0x7c2c('0x15')][_0x7c2c('0x35')](_0x14e6da[_0x7c2c('0x16')][_0x7c2c('0x38')],{'where':{'id':_0x14e6da[_0x7c2c('0x16')]['id']}})[_0x7c2c('0xa')](function(_0x54a131){_0xa09fef(_0x54a131);})[_0x7c2c('0x13')](function(_0x367bda){logger[_0x7c2c('0xf')](_0x7c2c('0x37'),_0x367bda[_0x7c2c('0x11')]);_0x2a0bf2(_0x30ee29['error'](0x1f4,_0x367bda[_0x7c2c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c774cc3..51e9514 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07be=['put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','show','post','create'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x07be,0xfb));var _0xe07b=function(_0x1c6937,_0x401124){_0x1c6937=_0x1c6937-0x0;var _0x1aa094=_0x07be[_0x1c6937];return _0x1aa094;};'use strict';var multer=require(_0xe07b('0x0'));var util=require(_0xe07b('0x1'));var path=require(_0xe07b('0x2'));var timeout=require(_0xe07b('0x3'));var express=require('express');var router=express[_0xe07b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe07b('0x5'));var interaction=require(_0xe07b('0x6'));var config=require(_0xe07b('0x7'));var controller=require(_0xe07b('0x8'));router['get']('/',auth[_0xe07b('0x9')](),controller[_0xe07b('0xa')]);router[_0xe07b('0xb')]('/:id',auth[_0xe07b('0x9')](),controller[_0xe07b('0xc')]);router[_0xe07b('0xd')]('/',auth[_0xe07b('0x9')](),controller[_0xe07b('0xe')]);router[_0xe07b('0xf')](_0xe07b('0x10'),auth[_0xe07b('0x9')](),controller[_0xe07b('0x11')]);router[_0xe07b('0x12')](_0xe07b('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd015=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x191378,_0x2b219f){var _0x2005c0=function(_0xa01e4a){while(--_0xa01e4a){_0x191378['push'](_0x191378['shift']());}};_0x2005c0(++_0x2b219f);}(_0xd015,0x18c));var _0x5d01=function(_0x126af7,_0x25fa06){_0x126af7=_0x126af7-0x0;var _0x25b500=_0xd015[_0x126af7];return _0x25b500;};'use strict';var multer=require(_0x5d01('0x0'));var util=require(_0x5d01('0x1'));var path=require(_0x5d01('0x2'));var timeout=require(_0x5d01('0x3'));var express=require(_0x5d01('0x4'));var router=express[_0x5d01('0x5')]();var fs_extra=require(_0x5d01('0x6'));var auth=require(_0x5d01('0x7'));var interaction=require(_0x5d01('0x8'));var config=require(_0x5d01('0x9'));var controller=require(_0x5d01('0xa'));router[_0x5d01('0xb')]('/',auth[_0x5d01('0xc')](),controller['index']);router[_0x5d01('0xb')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller['show']);router[_0x5d01('0xe')]('/',auth['isAuthenticated'](),controller[_0x5d01('0xf')]);router[_0x5d01('0x10')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x11')]);router[_0x5d01('0x12')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x13')]);module[_0x5d01('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index aed01ac..5134a20 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 _0x9829=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x4b50b9,_0x26cdc9){var _0x5a97d1=function(_0x30a238){while(--_0x30a238){_0x4b50b9['push'](_0x4b50b9['shift']());}};_0x5a97d1(++_0x26cdc9);}(_0x9829,0xc4));var _0x9982=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x9829[_0x421263];return _0x34e4b5;};'use strict';var moment=require(_0x9982('0x0'));var Sequelize=require(_0x9982('0x1'));module[_0x9982('0x2')]={'phone':{'type':Sequelize[_0x9982('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9982('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9982('0x4')],'unique':_0x9982('0x5')},'VoiceQueueId':{'type':Sequelize[_0x9982('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x7596=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x1e01a5,_0x1da351){var _0x14e15a=function(_0x2128aa){while(--_0x2128aa){_0x1e01a5['push'](_0x1e01a5['shift']());}};_0x14e15a(++_0x1da351);}(_0x7596,0xa2));var _0x6759=function(_0x3c8c63,_0x5530ea){_0x3c8c63=_0x3c8c63-0x0;var _0x872537=_0x7596[_0x3c8c63];return _0x872537;};'use strict';var moment=require(_0x6759('0x0'));var Sequelize=require(_0x6759('0x1'));module[_0x6759('0x2')]={'phone':{'type':Sequelize[_0x6759('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6759('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6759('0x5')},'VoiceQueueId':{'type':Sequelize[_0x6759('0x4')],'unique':_0x6759('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 0487126..43c0808 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 _0x8157=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperBlack','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','describe'];(function(_0x106629,_0x499504){var _0x770cfb=function(_0x7586b9){while(--_0x7586b9){_0x106629['push'](_0x106629['shift']());}};_0x770cfb(++_0x499504);}(_0x8157,0x128));var _0x7815=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x8157[_0x149083];return _0x4dc74e;};'use strict';var emlformat=require(_0x7815('0x0'));var rimraf=require(_0x7815('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7815('0x2'));var moment=require(_0x7815('0x3'));var BPromise=require(_0x7815('0x4'));var Mustache=require(_0x7815('0x5'));var util=require(_0x7815('0x6'));var path=require(_0x7815('0x7'));var sox=require('sox');var csv=require(_0x7815('0x8'));var ejs=require(_0x7815('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7815('0xa'));var squel=require(_0x7815('0xb'));var crypto=require(_0x7815('0xc'));var jsforce=require(_0x7815('0xd'));var deskjs=require(_0x7815('0xe'));var toCsv=require(_0x7815('0x8'));var querystring=require('querystring');var Papa=require(_0x7815('0xf'));var Redis=require('ioredis');var authService=require(_0x7815('0x10'));var qs=require(_0x7815('0x11'));var as=require(_0x7815('0x12'));var hardwareService=require(_0x7815('0x13'));var logger=require(_0x7815('0x14'))(_0x7815('0x15'));var utils=require('../../config/utils');var config=require(_0x7815('0x16'));var licenseUtil=require(_0x7815('0x17'));var db=require(_0x7815('0x18'))['db'];function respondWithStatusCode(_0x56bef6,_0x787b9e){_0x787b9e=_0x787b9e||0xcc;return function(_0x3b9400){if(_0x3b9400){return _0x56bef6['sendStatus'](_0x787b9e);}return _0x56bef6[_0x7815('0x19')](_0x787b9e)[_0x7815('0x1a')]();};}function respondWithResult(_0x2fb74a,_0x48eba6){_0x48eba6=_0x48eba6||0xc8;return function(_0xc4c292){if(_0xc4c292){return _0x2fb74a['status'](_0x48eba6)[_0x7815('0x1b')](_0xc4c292);}};}function respondWithFilteredResult(_0x565d2e,_0x85b6b){return function(_0x5de3ad){if(_0x5de3ad){var _0x130c35=typeof _0x85b6b[_0x7815('0x1c')]==='undefined'&&typeof _0x85b6b[_0x7815('0x1d')]===_0x7815('0x1e');var _0x59783f=_0x5de3ad[_0x7815('0x1f')];var _0x52b775=_0x130c35?0x0:_0x85b6b[_0x7815('0x1c')];var _0x5e445d=_0x130c35?_0x5de3ad['count']:_0x85b6b['offset']+_0x85b6b[_0x7815('0x1d')];var _0x32b07a;if(_0x5e445d>=_0x59783f){_0x5e445d=_0x59783f;_0x32b07a=0xc8;}else{_0x32b07a=0xce;}_0x565d2e[_0x7815('0x19')](_0x32b07a);return _0x565d2e['set'](_0x7815('0x20'),_0x52b775+'-'+_0x5e445d+'/'+_0x59783f)['json'](_0x5de3ad);}return null;};}function patchUpdates(_0x49f511){return function(_0x14f054){try{jsonpatch[_0x7815('0x21')](_0x14f054,_0x49f511,!![]);}catch(_0x4840c5){return BPromise[_0x7815('0x22')](_0x4840c5);}return _0x14f054[_0x7815('0x23')]();};}function saveUpdates(_0x216f79,_0xb1afaa){return function(_0x12742a){if(_0x12742a){return _0x12742a[_0x7815('0x24')](_0x216f79)[_0x7815('0x25')](function(_0x13e6f9){return _0x13e6f9;});}return null;};}function removeEntity(_0x554493,_0x1413cc){return function(_0x213664){if(_0x213664){return _0x213664[_0x7815('0x26')]()[_0x7815('0x25')](function(){_0x554493['status'](0xcc)[_0x7815('0x1a')]();});}};}function handleEntityNotFound(_0x5c79d3,_0x274e4f){return function(_0x37cfac){if(!_0x37cfac){_0x5c79d3[_0x7815('0x27')](0x194);}return _0x37cfac;};}function handleError(_0x8dc688,_0x1a2bf8){_0x1a2bf8=_0x1a2bf8||0x1f4;return function(_0x3fdb2b){logger[_0x7815('0x28')](_0x3fdb2b['stack']);if(_0x3fdb2b[_0x7815('0x29')]){delete _0x3fdb2b['name'];}_0x8dc688[_0x7815('0x19')](_0x1a2bf8)[_0x7815('0x2a')](_0x3fdb2b);};}exports[_0x7815('0x2b')]=function(_0x1c7ca3,_0x3f8a00){var _0x2373bd={},_0x53e64a={},_0x4df3be={'count':0x0,'rows':[]};var _0x4e67a9=_[_0x7815('0x2c')](db[_0x7815('0x2d')][_0x7815('0x2e')],function(_0x546daa){return{'name':_0x546daa['fieldName'],'type':_0x546daa[_0x7815('0x2f')]['key']};});_0x53e64a['model']=_[_0x7815('0x2c')](_0x4e67a9,_0x7815('0x29'));_0x53e64a[_0x7815('0x30')]=_['keys'](_0x1c7ca3[_0x7815('0x30')]);_0x53e64a[_0x7815('0x31')]=_[_0x7815('0x32')](_0x53e64a[_0x7815('0x33')],_0x53e64a[_0x7815('0x30')]);_0x2373bd[_0x7815('0x34')]=_[_0x7815('0x32')](_0x53e64a[_0x7815('0x33')],qs[_0x7815('0x35')](_0x1c7ca3[_0x7815('0x30')]['fields']));_0x2373bd['attributes']=_0x2373bd[_0x7815('0x34')][_0x7815('0x36')]?_0x2373bd['attributes']:_0x53e64a['model'];if(!_0x1c7ca3[_0x7815('0x30')][_0x7815('0x37')](_0x7815('0x38'))){_0x2373bd[_0x7815('0x1d')]=qs[_0x7815('0x1d')](_0x1c7ca3[_0x7815('0x30')][_0x7815('0x1d')]);_0x2373bd[_0x7815('0x1c')]=qs[_0x7815('0x1c')](_0x1c7ca3[_0x7815('0x30')][_0x7815('0x1c')]);}_0x2373bd[_0x7815('0x39')]=qs[_0x7815('0x3a')](_0x1c7ca3[_0x7815('0x30')][_0x7815('0x3a')]);_0x2373bd[_0x7815('0x3b')]=qs[_0x7815('0x31')](_['pick'](_0x1c7ca3[_0x7815('0x30')],_0x53e64a[_0x7815('0x31')]),_0x4e67a9);if(_0x1c7ca3[_0x7815('0x30')]['filter']){_0x2373bd['where']=_[_0x7815('0x3c')](_0x2373bd[_0x7815('0x3b')],{'$or':_[_0x7815('0x2c')](_0x4e67a9,function(_0x367ea5){if(_0x367ea5[_0x7815('0x2f')]!==_0x7815('0x3d')){var _0x3836d={};_0x3836d[_0x367ea5[_0x7815('0x29')]]={'$like':'%'+_0x1c7ca3['query'][_0x7815('0x3e')]+'%'};return _0x3836d;}})});}_0x2373bd=_[_0x7815('0x3c')]({},_0x2373bd,_0x1c7ca3['options']);var _0x4d0da3={'where':_0x2373bd[_0x7815('0x3b')]};return db[_0x7815('0x2d')][_0x7815('0x1f')](_0x4d0da3)[_0x7815('0x25')](function(_0x1a8cd3){_0x4df3be[_0x7815('0x1f')]=_0x1a8cd3;if(_0x1c7ca3['query'][_0x7815('0x3f')]){_0x2373bd[_0x7815('0x40')]=[{'all':!![]}];}return db[_0x7815('0x2d')]['findAll'](_0x2373bd);})[_0x7815('0x25')](function(_0x2a8fa6){_0x4df3be[_0x7815('0x41')]=_0x2a8fa6;return _0x4df3be;})[_0x7815('0x25')](respondWithFilteredResult(_0x3f8a00,_0x2373bd))[_0x7815('0x42')](handleError(_0x3f8a00,null));};exports[_0x7815('0x43')]=function(_0x2a960d,_0x41aa95){var _0x1d86c1={'raw':!![],'where':{'id':_0x2a960d[_0x7815('0x44')]['id']}},_0x133e07={};_0x133e07[_0x7815('0x33')]=_[_0x7815('0x45')](db[_0x7815('0x2d')]['rawAttributes']);_0x133e07[_0x7815('0x30')]=_[_0x7815('0x45')](_0x2a960d[_0x7815('0x30')]);_0x133e07[_0x7815('0x31')]=_[_0x7815('0x32')](_0x133e07['model'],_0x133e07[_0x7815('0x30')]);_0x1d86c1['attributes']=_['intersection'](_0x133e07[_0x7815('0x33')],qs[_0x7815('0x35')](_0x2a960d[_0x7815('0x30')][_0x7815('0x35')]));_0x1d86c1[_0x7815('0x34')]=_0x1d86c1['attributes'][_0x7815('0x36')]?_0x1d86c1[_0x7815('0x34')]:_0x133e07['model'];if(_0x2a960d[_0x7815('0x30')][_0x7815('0x3f')]){_0x1d86c1['include']=[{'all':!![]}];}_0x1d86c1=_[_0x7815('0x3c')]({},_0x1d86c1,_0x2a960d[_0x7815('0x46')]);return db[_0x7815('0x2d')][_0x7815('0x47')](_0x1d86c1)[_0x7815('0x25')](handleEntityNotFound(_0x41aa95,null))[_0x7815('0x25')](respondWithResult(_0x41aa95,null))['catch'](handleError(_0x41aa95,null));};exports['update']=function(_0x3ad4dd,_0x23f6e1){if(_0x3ad4dd['body']['id']){delete _0x3ad4dd[_0x7815('0x48')]['id'];}return db[_0x7815('0x2d')][_0x7815('0x47')]({'where':{'id':_0x3ad4dd[_0x7815('0x44')]['id']}})[_0x7815('0x25')](handleEntityNotFound(_0x23f6e1,null))[_0x7815('0x25')](saveUpdates(_0x3ad4dd[_0x7815('0x48')],null))[_0x7815('0x25')](respondWithResult(_0x23f6e1,null))['catch'](handleError(_0x23f6e1,null));};exports['destroy']=function(_0x78797e,_0x408b84){return db[_0x7815('0x2d')]['find']({'where':{'id':_0x78797e[_0x7815('0x44')]['id']}})['then'](handleEntityNotFound(_0x408b84,null))['then'](removeEntity(_0x408b84,null))[_0x7815('0x42')](handleError(_0x408b84,null));};exports[_0x7815('0x49')]=function(_0x2843a5,_0x33ed36){return db[_0x7815('0x2d')][_0x7815('0x49')]()[_0x7815('0x25')](respondWithResult(_0x33ed36,null))['catch'](handleError(_0x33ed36,null));}; \ No newline at end of file +var _0x1c57=['index','map','CmHopperBlack','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send'];(function(_0x4cde52,_0x10987a){var _0x5f3a14=function(_0x29b770){while(--_0x29b770){_0x4cde52['push'](_0x4cde52['shift']());}};_0x5f3a14(++_0x10987a);}(_0x1c57,0x144));var _0x71c5=function(_0x2dcb9c,_0x45fca9){_0x2dcb9c=_0x2dcb9c-0x0;var _0x152512=_0x1c57[_0x2dcb9c];return _0x152512;};'use strict';var emlformat=require(_0x71c5('0x0'));var rimraf=require(_0x71c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x71c5('0x2'));var moment=require(_0x71c5('0x3'));var BPromise=require(_0x71c5('0x4'));var Mustache=require(_0x71c5('0x5'));var util=require('util');var path=require(_0x71c5('0x6'));var sox=require(_0x71c5('0x7'));var csv=require('to-csv');var ejs=require(_0x71c5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x71c5('0x9'));var jsforce=require(_0x71c5('0xa'));var deskjs=require(_0x71c5('0xb'));var toCsv=require(_0x71c5('0xc'));var querystring=require(_0x71c5('0xd'));var Papa=require(_0x71c5('0xe'));var Redis=require('ioredis');var authService=require(_0x71c5('0xf'));var qs=require(_0x71c5('0x10'));var as=require(_0x71c5('0x11'));var hardwareService=require(_0x71c5('0x12'));var logger=require(_0x71c5('0x13'))('api');var utils=require(_0x71c5('0x14'));var config=require(_0x71c5('0x15'));var licenseUtil=require(_0x71c5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xab1102,_0x220c21){_0x220c21=_0x220c21||0xcc;return function(_0x34b704){if(_0x34b704){return _0xab1102[_0x71c5('0x17')](_0x220c21);}return _0xab1102[_0x71c5('0x18')](_0x220c21)[_0x71c5('0x19')]();};}function respondWithResult(_0x534fda,_0x3ea456){_0x3ea456=_0x3ea456||0xc8;return function(_0x5b29e0){if(_0x5b29e0){return _0x534fda['status'](_0x3ea456)[_0x71c5('0x1a')](_0x5b29e0);}};}function respondWithFilteredResult(_0x5256e4,_0x1b4efd){return function(_0x240896){if(_0x240896){var _0x3120d3=typeof _0x1b4efd[_0x71c5('0x1b')]===_0x71c5('0x1c')&&typeof _0x1b4efd[_0x71c5('0x1d')]==='undefined';var _0x1eee6e=_0x240896['count'];var _0x4d913d=_0x3120d3?0x0:_0x1b4efd[_0x71c5('0x1b')];var _0x78a874=_0x3120d3?_0x240896[_0x71c5('0x1e')]:_0x1b4efd[_0x71c5('0x1b')]+_0x1b4efd[_0x71c5('0x1d')];var _0x27e4cb;if(_0x78a874>=_0x1eee6e){_0x78a874=_0x1eee6e;_0x27e4cb=0xc8;}else{_0x27e4cb=0xce;}_0x5256e4[_0x71c5('0x18')](_0x27e4cb);return _0x5256e4[_0x71c5('0x1f')](_0x71c5('0x20'),_0x4d913d+'-'+_0x78a874+'/'+_0x1eee6e)[_0x71c5('0x1a')](_0x240896);}return null;};}function patchUpdates(_0x49ac54){return function(_0x18b8f4){try{jsonpatch[_0x71c5('0x21')](_0x18b8f4,_0x49ac54,!![]);}catch(_0x110194){return BPromise['reject'](_0x110194);}return _0x18b8f4[_0x71c5('0x22')]();};}function saveUpdates(_0x508d10,_0x43a165){return function(_0x1f47af){if(_0x1f47af){return _0x1f47af[_0x71c5('0x23')](_0x508d10)[_0x71c5('0x24')](function(_0x4a7c3b){return _0x4a7c3b;});}return null;};}function removeEntity(_0x2a13cf,_0x7bc09c){return function(_0x55eac2){if(_0x55eac2){return _0x55eac2[_0x71c5('0x25')]()[_0x71c5('0x24')](function(){_0x2a13cf[_0x71c5('0x18')](0xcc)[_0x71c5('0x19')]();});}};}function handleEntityNotFound(_0x420f18,_0x496e30){return function(_0x1c572c){if(!_0x1c572c){_0x420f18['sendStatus'](0x194);}return _0x1c572c;};}function handleError(_0x1815c4,_0x542d95){_0x542d95=_0x542d95||0x1f4;return function(_0x321be4){logger[_0x71c5('0x26')](_0x321be4['stack']);if(_0x321be4['name']){delete _0x321be4[_0x71c5('0x27')];}_0x1815c4['status'](_0x542d95)[_0x71c5('0x28')](_0x321be4);};}exports[_0x71c5('0x29')]=function(_0x23467c,_0x2d73f9){var _0x18f6cd={},_0x4965d9={},_0x57861a={'count':0x0,'rows':[]};var _0x2a8ec1=_[_0x71c5('0x2a')](db[_0x71c5('0x2b')]['rawAttributes'],function(_0x4fa1ad){return{'name':_0x4fa1ad[_0x71c5('0x2c')],'type':_0x4fa1ad[_0x71c5('0x2d')]['key']};});_0x4965d9[_0x71c5('0x2e')]=_[_0x71c5('0x2a')](_0x2a8ec1,'name');_0x4965d9[_0x71c5('0x2f')]=_[_0x71c5('0x30')](_0x23467c[_0x71c5('0x2f')]);_0x4965d9['filters']=_['intersection'](_0x4965d9[_0x71c5('0x2e')],_0x4965d9['query']);_0x18f6cd[_0x71c5('0x31')]=_[_0x71c5('0x32')](_0x4965d9[_0x71c5('0x2e')],qs['fields'](_0x23467c[_0x71c5('0x2f')][_0x71c5('0x33')]));_0x18f6cd[_0x71c5('0x31')]=_0x18f6cd[_0x71c5('0x31')][_0x71c5('0x34')]?_0x18f6cd[_0x71c5('0x31')]:_0x4965d9[_0x71c5('0x2e')];if(!_0x23467c[_0x71c5('0x2f')][_0x71c5('0x35')](_0x71c5('0x36'))){_0x18f6cd[_0x71c5('0x1d')]=qs['limit'](_0x23467c[_0x71c5('0x2f')]['limit']);_0x18f6cd[_0x71c5('0x1b')]=qs[_0x71c5('0x1b')](_0x23467c['query']['offset']);}_0x18f6cd['order']=qs[_0x71c5('0x37')](_0x23467c[_0x71c5('0x2f')][_0x71c5('0x37')]);_0x18f6cd[_0x71c5('0x38')]=qs[_0x71c5('0x39')](_[_0x71c5('0x3a')](_0x23467c[_0x71c5('0x2f')],_0x4965d9[_0x71c5('0x39')]),_0x2a8ec1);if(_0x23467c[_0x71c5('0x2f')][_0x71c5('0x3b')]){_0x18f6cd[_0x71c5('0x38')]=_[_0x71c5('0x3c')](_0x18f6cd[_0x71c5('0x38')],{'$or':_[_0x71c5('0x2a')](_0x2a8ec1,function(_0x2c8e5a){if(_0x2c8e5a[_0x71c5('0x2d')]!==_0x71c5('0x3d')){var _0x1edd29={};_0x1edd29[_0x2c8e5a['name']]={'$like':'%'+_0x23467c['query']['filter']+'%'};return _0x1edd29;}})});}_0x18f6cd=_[_0x71c5('0x3c')]({},_0x18f6cd,_0x23467c[_0x71c5('0x3e')]);var _0x3dcd8c={'where':_0x18f6cd[_0x71c5('0x38')]};return db[_0x71c5('0x2b')]['count'](_0x3dcd8c)[_0x71c5('0x24')](function(_0x9a7293){_0x57861a[_0x71c5('0x1e')]=_0x9a7293;if(_0x23467c[_0x71c5('0x2f')][_0x71c5('0x3f')]){_0x18f6cd[_0x71c5('0x40')]=[{'all':!![]}];}return db[_0x71c5('0x2b')][_0x71c5('0x41')](_0x18f6cd);})['then'](function(_0x316f7a){_0x57861a[_0x71c5('0x42')]=_0x316f7a;return _0x57861a;})[_0x71c5('0x24')](respondWithFilteredResult(_0x2d73f9,_0x18f6cd))['catch'](handleError(_0x2d73f9,null));};exports[_0x71c5('0x43')]=function(_0x5434f8,_0x351583){var _0x393902={'raw':!![],'where':{'id':_0x5434f8[_0x71c5('0x44')]['id']}},_0x54cbdd={};_0x54cbdd[_0x71c5('0x2e')]=_[_0x71c5('0x30')](db[_0x71c5('0x2b')][_0x71c5('0x45')]);_0x54cbdd[_0x71c5('0x2f')]=_[_0x71c5('0x30')](_0x5434f8['query']);_0x54cbdd['filters']=_[_0x71c5('0x32')](_0x54cbdd[_0x71c5('0x2e')],_0x54cbdd[_0x71c5('0x2f')]);_0x393902[_0x71c5('0x31')]=_[_0x71c5('0x32')](_0x54cbdd[_0x71c5('0x2e')],qs[_0x71c5('0x33')](_0x5434f8['query']['fields']));_0x393902[_0x71c5('0x31')]=_0x393902[_0x71c5('0x31')][_0x71c5('0x34')]?_0x393902['attributes']:_0x54cbdd[_0x71c5('0x2e')];if(_0x5434f8[_0x71c5('0x2f')][_0x71c5('0x3f')]){_0x393902['include']=[{'all':!![]}];}_0x393902=_['merge']({},_0x393902,_0x5434f8['options']);return db['CmHopperBlack'][_0x71c5('0x46')](_0x393902)[_0x71c5('0x24')](handleEntityNotFound(_0x351583,null))[_0x71c5('0x24')](respondWithResult(_0x351583,null))[_0x71c5('0x47')](handleError(_0x351583,null));};exports[_0x71c5('0x23')]=function(_0x55df9a,_0x8922b6){if(_0x55df9a[_0x71c5('0x48')]['id']){delete _0x55df9a[_0x71c5('0x48')]['id'];}return db[_0x71c5('0x2b')]['find']({'where':{'id':_0x55df9a[_0x71c5('0x44')]['id']}})[_0x71c5('0x24')](handleEntityNotFound(_0x8922b6,null))[_0x71c5('0x24')](saveUpdates(_0x55df9a[_0x71c5('0x48')],null))[_0x71c5('0x24')](respondWithResult(_0x8922b6,null))['catch'](handleError(_0x8922b6,null));};exports[_0x71c5('0x25')]=function(_0x931675,_0x5332cc){return db[_0x71c5('0x2b')][_0x71c5('0x46')]({'where':{'id':_0x931675[_0x71c5('0x44')]['id']}})[_0x71c5('0x24')](handleEntityNotFound(_0x5332cc,null))[_0x71c5('0x24')](removeEntity(_0x5332cc,null))['catch'](handleError(_0x5332cc,null));};exports['describe']=function(_0x4db46b,_0x1faa3b){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x1faa3b,null))['catch'](handleError(_0x1faa3b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 2b8d2e5..f419278 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 _0xda16=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xda16,0xb3));var _0x6da1=function(_0x51eb1b,_0x3f0f18){_0x51eb1b=_0x51eb1b-0x0;var _0x125309=_0xda16[_0x51eb1b];return _0x125309;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require(_0x6da1('0x4'));var BPromise=require(_0x6da1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6da1('0x6'));var rimraf=require(_0x6da1('0x7'));var config=require(_0x6da1('0x8'));var attributes=require(_0x6da1('0x9'));module[_0x6da1('0xa')]=function(_0x402a8f,_0x3a9850){return _0x402a8f[_0x6da1('0xb')](_0x6da1('0xc'),attributes,{'tableName':_0x6da1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca48=['../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x533d66,_0x3cf5da){var _0x55ea0a=function(_0x4c151d){while(--_0x4c151d){_0x533d66['push'](_0x533d66['shift']());}};_0x55ea0a(++_0x3cf5da);}(_0xca48,0x155));var _0x8ca4=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0xca48[_0x185d2a];return _0x4dea27;};'use strict';var _=require(_0x8ca4('0x0'));var util=require(_0x8ca4('0x1'));var logger=require(_0x8ca4('0x2'))(_0x8ca4('0x3'));var moment=require(_0x8ca4('0x4'));var BPromise=require(_0x8ca4('0x5'));var rp=require(_0x8ca4('0x6'));var fs=require('fs');var path=require(_0x8ca4('0x7'));var rimraf=require(_0x8ca4('0x8'));var config=require(_0x8ca4('0x9'));var attributes=require(_0x8ca4('0xa'));module['exports']=function(_0x394e65,_0x1e6de9){return _0x394e65[_0x8ca4('0xb')](_0x8ca4('0xc'),attributes,{'tableName':_0x8ca4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index f5d3975..60233f4 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 _0xbaa3=['client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopperBlack','findAll','options','raw','where','limit','include','model','attributes','GetCmHopperBlack','stringify','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x580ef1,_0x4138ec){var _0x223855=function(_0x44867d){while(--_0x44867d){_0x580ef1['push'](_0x580ef1['shift']());}};_0x223855(++_0x4138ec);}(_0xbaa3,0x11f));var _0x3baa=function(_0x110d59,_0x50c4fb){_0x110d59=_0x110d59-0x0;var _0x2fce64=_0xbaa3[_0x110d59];return _0x2fce64;};'use strict';var _=require(_0x3baa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3baa('0x1'));var rs=require(_0x3baa('0x2'));var fs=require('fs');var Redis=require(_0x3baa('0x3'));var db=require(_0x3baa('0x4'))['db'];var utils=require(_0x3baa('0x5'));var logger=require('../../config/logger')(_0x3baa('0x6'));var config=require(_0x3baa('0x7'));var jayson=require(_0x3baa('0x8'));var client=jayson[_0x3baa('0x9')][_0x3baa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x270d9c,_0x44559a,_0x15baff){return new BPromise(function(_0x3a4d78,_0x37ccac){return client[_0x3baa('0xb')](_0x270d9c,_0x15baff)[_0x3baa('0xc')](function(_0x1461b8){logger[_0x3baa('0xd')](_0x3baa('0xe'),_0x44559a,_0x3baa('0xf'));logger[_0x3baa('0x10')](_0x3baa('0x11'),_0x44559a,_0x3baa('0xf'),JSON['stringify'](_0x1461b8));if(_0x1461b8[_0x3baa('0x12')]){if(_0x1461b8[_0x3baa('0x12')]['code']===0x1f4){logger[_0x3baa('0x12')](_0x3baa('0xe'),_0x44559a,_0x1461b8['error'][_0x3baa('0x13')]);return _0x37ccac(_0x1461b8[_0x3baa('0x12')][_0x3baa('0x13')]);}logger[_0x3baa('0x12')](_0x3baa('0xe'),_0x44559a,_0x1461b8[_0x3baa('0x12')][_0x3baa('0x13')]);return _0x3a4d78(_0x1461b8['error'][_0x3baa('0x13')]);}else{logger[_0x3baa('0xd')](_0x3baa('0xe'),_0x44559a,_0x3baa('0xf'));_0x3a4d78(_0x1461b8[_0x3baa('0x14')][_0x3baa('0x13')]);}})[_0x3baa('0x15')](function(_0xcf604e){logger['error'](_0x3baa('0xe'),_0x44559a,_0xcf604e);_0x37ccac(_0xcf604e);});});}exports['GetCmHopperBlack']=function(_0x5c02d3){var _0x5df21e=this;return new Promise(function(_0x5e6de5,_0x16e358){return db[_0x3baa('0x16')][_0x3baa('0x17')]({'raw':_0x5c02d3[_0x3baa('0x18')]?_0x5c02d3['options'][_0x3baa('0x19')]===undefined?!![]:![]:!![],'where':_0x5c02d3[_0x3baa('0x18')]?_0x5c02d3['options'][_0x3baa('0x1a')]||null:null,'attributes':_0x5c02d3['options']?_0x5c02d3[_0x3baa('0x18')]['attributes']||null:null,'limit':_0x5c02d3[_0x3baa('0x18')]?_0x5c02d3[_0x3baa('0x18')][_0x3baa('0x1b')]||null:null,'include':_0x5c02d3[_0x3baa('0x18')]?_0x5c02d3[_0x3baa('0x18')][_0x3baa('0x1c')]?_['map'](_0x5c02d3[_0x3baa('0x18')]['include'],function(_0x59bb5b){return{'model':db[_0x59bb5b[_0x3baa('0x1d')]],'as':_0x59bb5b['as'],'attributes':_0x59bb5b[_0x3baa('0x1e')],'include':_0x59bb5b[_0x3baa('0x1c')]?_['map'](_0x59bb5b['include'],function(_0x5e469e){return{'model':db[_0x5e469e[_0x3baa('0x1d')]],'as':_0x5e469e['as'],'attributes':_0x5e469e['attributes'],'include':_0x5e469e['include']?_['map'](_0x5e469e[_0x3baa('0x1c')],function(_0x121a0a){return{'model':db[_0x121a0a[_0x3baa('0x1d')]],'as':_0x121a0a['as'],'attributes':_0x121a0a[_0x3baa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3baa('0xc')](function(_0x5d1283){logger[_0x3baa('0xd')](_0x3baa('0x1f'),_0x5c02d3);logger[_0x3baa('0x10')]('GetCmHopperBlack',_0x5c02d3,JSON[_0x3baa('0x20')](_0x5d1283));_0x5e6de5(_0x5d1283);})[_0x3baa('0x15')](function(_0x20dcfb){logger[_0x3baa('0x12')](_0x3baa('0x1f'),_0x20dcfb[_0x3baa('0x13')],_0x5c02d3);_0x16e358(_0x5df21e['error'](0x1f4,_0x20dcfb[_0x3baa('0x13')]));});});};exports[_0x3baa('0x21')]=function(_0x47e397){var _0x5a9144=this;return new Promise(function(_0x3b4a44,_0x638c3){return db[_0x3baa('0x16')]['update'](_0x47e397[_0x3baa('0x22')],{'raw':_0x47e397['options']?_0x47e397['options'][_0x3baa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47e397[_0x3baa('0x18')]?_0x47e397[_0x3baa('0x18')][_0x3baa('0x1a')]||null:null,'attributes':_0x47e397[_0x3baa('0x18')]?_0x47e397['options'][_0x3baa('0x1e')]||null:null,'limit':_0x47e397['options']?_0x47e397[_0x3baa('0x18')][_0x3baa('0x1b')]||null:null})[_0x3baa('0xc')](function(_0x535272){logger[_0x3baa('0xd')]('UpdateCmHopperBlack',_0x47e397);logger[_0x3baa('0x10')]('UpdateCmHopperBlack',_0x47e397,JSON[_0x3baa('0x20')](_0x535272));_0x3b4a44(_0x535272);})[_0x3baa('0x15')](function(_0xd92971){logger[_0x3baa('0x12')](_0x3baa('0x21'),_0xd92971[_0x3baa('0x13')],_0x47e397);_0x638c3(_0x5a9144[_0x3baa('0x12')](0x1f4,_0xd92971[_0x3baa('0x13')]));});});};exports[_0x3baa('0x23')]=function(_0x193752){var _0x33d688=this;return new Promise(function(_0x33b0f5,_0x45ab8d){return db[_0x3baa('0x16')][_0x3baa('0x24')]({'where':_0x193752[_0x3baa('0x18')]?_0x193752[_0x3baa('0x18')][_0x3baa('0x1a')]||null:null})[_0x3baa('0xc')](function(_0xd5eed9){logger['info'](_0x3baa('0x23'),_0x193752);logger['debug'](_0x3baa('0x23'),_0x193752,JSON[_0x3baa('0x20')](_0xd5eed9));_0x33b0f5(_0xd5eed9);})[_0x3baa('0x15')](function(_0x2c2702){logger[_0x3baa('0x12')]('DestroyCmHopperBlack',_0x2c2702[_0x3baa('0x13')],_0x193752);_0x45ab8d(_0x33d688['error'](0x1f4,_0x2c2702['message']));});});}; \ No newline at end of file +var _0x63a8=['then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','model','attributes','map','stringify','catch','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x45d6e1,_0x377c83){var _0x41a978=function(_0x15afe8){while(--_0x15afe8){_0x45d6e1['push'](_0x45d6e1['shift']());}};_0x41a978(++_0x377c83);}(_0x63a8,0xe3));var _0x863a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x63a8[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x863a('0x0'));var util=require(_0x863a('0x1'));var moment=require(_0x863a('0x2'));var BPromise=require(_0x863a('0x3'));var rs=require(_0x863a('0x4'));var fs=require('fs');var Redis=require(_0x863a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x863a('0x6'));var logger=require(_0x863a('0x7'))(_0x863a('0x8'));var config=require('../../config/environment');var jayson=require(_0x863a('0x9'));var client=jayson[_0x863a('0xa')][_0x863a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fa31e,_0xba1874,_0x535847){return new BPromise(function(_0x4debc9,_0x2dbe13){return client[_0x863a('0xc')](_0x3fa31e,_0x535847)[_0x863a('0xd')](function(_0x111ca9){logger['info'](_0x863a('0xe'),_0xba1874,_0x863a('0xf'));logger[_0x863a('0x10')](_0x863a('0x11'),_0xba1874,_0x863a('0xf'),JSON['stringify'](_0x111ca9));if(_0x111ca9['error']){if(_0x111ca9[_0x863a('0x12')][_0x863a('0x13')]===0x1f4){logger['error'](_0x863a('0xe'),_0xba1874,_0x111ca9['error']['message']);return _0x2dbe13(_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);}logger[_0x863a('0x12')](_0x863a('0xe'),_0xba1874,_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);return _0x4debc9(_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);}else{logger[_0x863a('0x15')](_0x863a('0xe'),_0xba1874,_0x863a('0xf'));_0x4debc9(_0x111ca9[_0x863a('0x16')][_0x863a('0x14')]);}})['catch'](function(_0x21afd8){logger[_0x863a('0x12')](_0x863a('0xe'),_0xba1874,_0x21afd8);_0x2dbe13(_0x21afd8);});});}exports[_0x863a('0x17')]=function(_0xa8814e){var _0x462dcf=this;return new Promise(function(_0x826424,_0x1ac932){return db[_0x863a('0x18')][_0x863a('0x19')]({'raw':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')][_0x863a('0x1b')]||null:null,'attributes':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')]['attributes']||null:null,'limit':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')][_0x863a('0x1c')]||null:null,'include':_0xa8814e[_0x863a('0x1a')]?_0xa8814e['options'][_0x863a('0x1d')]?_['map'](_0xa8814e[_0x863a('0x1a')][_0x863a('0x1d')],function(_0x3bc9ab){return{'model':db[_0x3bc9ab[_0x863a('0x1e')]],'as':_0x3bc9ab['as'],'attributes':_0x3bc9ab[_0x863a('0x1f')],'include':_0x3bc9ab[_0x863a('0x1d')]?_[_0x863a('0x20')](_0x3bc9ab[_0x863a('0x1d')],function(_0x1c5e0f){return{'model':db[_0x1c5e0f[_0x863a('0x1e')]],'as':_0x1c5e0f['as'],'attributes':_0x1c5e0f[_0x863a('0x1f')],'include':_0x1c5e0f[_0x863a('0x1d')]?_[_0x863a('0x20')](_0x1c5e0f['include'],function(_0xe03286){return{'model':db[_0xe03286[_0x863a('0x1e')]],'as':_0xe03286['as'],'attributes':_0xe03286['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e6d9a){logger['info'](_0x863a('0x17'),_0xa8814e);logger[_0x863a('0x10')](_0x863a('0x17'),_0xa8814e,JSON[_0x863a('0x21')](_0x2e6d9a));_0x826424(_0x2e6d9a);})[_0x863a('0x22')](function(_0x2889f0){logger[_0x863a('0x12')](_0x863a('0x17'),_0x2889f0['message'],_0xa8814e);_0x1ac932(_0x462dcf[_0x863a('0x12')](0x1f4,_0x2889f0[_0x863a('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x199ff6){var _0x79a0d4=this;return new Promise(function(_0x28177d,_0x3d3b9d){return db[_0x863a('0x18')][_0x863a('0x23')](_0x199ff6[_0x863a('0x24')],{'raw':_0x199ff6[_0x863a('0x1a')]?_0x199ff6[_0x863a('0x1a')][_0x863a('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199ff6['options']?_0x199ff6[_0x863a('0x1a')][_0x863a('0x1b')]||null:null,'attributes':_0x199ff6['options']?_0x199ff6[_0x863a('0x1a')]['attributes']||null:null,'limit':_0x199ff6[_0x863a('0x1a')]?_0x199ff6[_0x863a('0x1a')]['limit']||null:null})[_0x863a('0xd')](function(_0x32154f){logger[_0x863a('0x15')](_0x863a('0x26'),_0x199ff6);logger[_0x863a('0x10')](_0x863a('0x26'),_0x199ff6,JSON[_0x863a('0x21')](_0x32154f));_0x28177d(_0x32154f);})[_0x863a('0x22')](function(_0x4c31bd){logger[_0x863a('0x12')](_0x863a('0x26'),_0x4c31bd[_0x863a('0x14')],_0x199ff6);_0x3d3b9d(_0x79a0d4['error'](0x1f4,_0x4c31bd['message']));});});};exports[_0x863a('0x27')]=function(_0x82dea1){var _0x50ae3f=this;return new Promise(function(_0x16d366,_0x5d422f){return db[_0x863a('0x18')]['destroy']({'where':_0x82dea1[_0x863a('0x1a')]?_0x82dea1[_0x863a('0x1a')][_0x863a('0x1b')]||null:null})[_0x863a('0xd')](function(_0x2602a4){logger[_0x863a('0x15')]('DestroyCmHopperBlack',_0x82dea1);logger[_0x863a('0x10')]('DestroyCmHopperBlack',_0x82dea1,JSON[_0x863a('0x21')](_0x2602a4));_0x16d366(_0x2602a4);})[_0x863a('0x22')](function(_0x44ed05){logger[_0x863a('0x12')](_0x863a('0x27'),_0x44ed05[_0x863a('0x14')],_0x82dea1);_0x5d422f(_0x50ae3f[_0x863a('0x12')](0x1f4,_0x44ed05[_0x863a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 0a0088a..67cdc2c 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 _0x3d04=['show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id'];(function(_0x33db13,_0x169eb4){var _0x5eb09d=function(_0x289656){while(--_0x289656){_0x33db13['push'](_0x33db13['shift']());}};_0x5eb09d(++_0x169eb4);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xf')]);module[_0x43d0('0x10')]=router; \ No newline at end of file +var _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x2a2718,_0x428041){var _0x5b6feb=function(_0x1f1277){while(--_0x1f1277){_0x2a2718['push'](_0x2a2718['shift']());}};_0x5b6feb(++_0x428041);}(_0x1db9,0x176));var _0x91db=function(_0x16e65a,_0x34b753){_0x16e65a=_0x16e65a-0x0;var _0x5241d1=_0x1db9[_0x16e65a];return _0x5241d1;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8e35a6b..60a11f8 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 _0x796e=['moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize'];(function(_0x2e0b72,_0x45066e){var _0x3df44c=function(_0x113240){while(--_0x113240){_0x2e0b72['push'](_0x2e0b72['shift']());}};_0x3df44c(++_0x45066e);}(_0x796e,0x143));var _0xe796=function(_0x25b0cd,_0x3dcd36){_0x25b0cd=_0x25b0cd-0x0;var _0x302f0d=_0x796e[_0x25b0cd];return _0x302f0d;};'use strict';var Sequelize=require(_0xe796('0x0'));var moment=require(_0xe796('0x1'));module[_0xe796('0x2')]={'state':{'type':Sequelize[_0xe796('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xe796('0x4')]},'scheduledat':{'type':Sequelize[_0xe796('0x5')]},'countbusyretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe796('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xe796('0x4')]},'originatecalleridname':{'type':Sequelize[_0xe796('0x4')]},'calleridnum':{'type':Sequelize[_0xe796('0x4')]},'calleridname':{'type':Sequelize[_0xe796('0x4')]},'starttime':{'type':Sequelize[_0xe796('0x5')]},'responsetime':{'type':Sequelize[_0xe796('0x5')]},'answertime':{'type':Sequelize[_0xe796('0x5')]},'droptime':{'type':Sequelize[_0xe796('0x5')]},'endtime':{'type':Sequelize[_0xe796('0x5')]},'ringtime':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xe796('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xe796('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe796('0x4')]},'dispositionat':{'type':Sequelize[_0xe796('0x5')],'set':function(_0xd74313){var _0x7390f3=this[_0xe796('0x6')]('endtime');if(_0x7390f3&&_0xd74313){this[_0xe796('0x7')](_0xe796('0x8'),moment(_0xd74313)[_0xe796('0x9')](moment(_0x7390f3),_0xe796('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xe796('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe796('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe796('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xe796('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe796('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe796('0x5')]},'deleted':{'type':Sequelize[_0xe796('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe796('0x5')]},'recallme':{'type':Sequelize[_0xe796('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe796('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe796('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x98fd=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x98fd,0x67));var _0xd98f=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x98fd[_0xbc346f];return _0x9f9260;};'use strict';var Sequelize=require(_0xd98f('0x0'));var moment=require(_0xd98f('0x1'));module['exports']={'state':{'type':Sequelize[_0xd98f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd98f('0x3')]},'scheduledat':{'type':Sequelize[_0xd98f('0x4')]},'countbusyretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd98f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xd98f('0x3')]},'calleridnum':{'type':Sequelize[_0xd98f('0x3')]},'calleridname':{'type':Sequelize[_0xd98f('0x3')]},'starttime':{'type':Sequelize[_0xd98f('0x4')]},'responsetime':{'type':Sequelize[_0xd98f('0x4')]},'answertime':{'type':Sequelize[_0xd98f('0x4')]},'droptime':{'type':Sequelize[_0xd98f('0x4')]},'endtime':{'type':Sequelize[_0xd98f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd98f('0x3')]},'campaign':{'type':Sequelize[_0xd98f('0x3')]},'campaigntype':{'type':Sequelize[_0xd98f('0x3')]},'membername':{'type':Sequelize[_0xd98f('0x3')]},'reason':{'type':Sequelize[_0xd98f('0x3')]},'disposition':{'type':Sequelize[_0xd98f('0x3')]},'secondDisposition':{'type':Sequelize[_0xd98f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd98f('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4213d3){var _0x728524=this[_0xd98f('0x5')](_0xd98f('0x6'));if(_0x728524&&_0x4213d3){this[_0xd98f('0x7')](_0xd98f('0x8'),moment(_0x4213d3)[_0xd98f('0x9')](moment(_0x728524),_0xd98f('0xa')));}}},'amd':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd98f('0x4')]},'callback':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd98f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd98f('0x4')]},'deleted':{'type':Sequelize[_0xd98f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd98f('0x4')]},'recallme':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd98f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index d631a38..971db45 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 _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x45318e,_0x358ed8){var _0x5272c4=function(_0x3c23b1){while(--_0x3c23b1){_0x45318e['push'](_0x45318e['shift']());}};_0x5272c4(++_0x358ed8);}(_0x1623,0xab));var _0x3162=function(_0x487b14,_0x26f63){_0x487b14=_0x487b14-0x0;var _0x2b87e7=_0x1623[_0x487b14];return _0x2b87e7;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file +var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x37a051,_0x4551c1){var _0x224dfc=function(_0x39462f){while(--_0x39462f){_0x37a051['push'](_0x37a051['shift']());}};_0x224dfc(++_0x4551c1);}(_0x90b1,0x1bb));var _0x190b=function(_0x5e8d8b,_0x3defdb){_0x5e8d8b=_0x5e8d8b-0x0;var _0xc38051=_0x90b1[_0x5e8d8b];return _0xc38051;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d39e58a..2b96580 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 _0xbd95=['../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x2b4ed7,_0x3de6bc){var _0x2974f6=function(_0x549e96){while(--_0x549e96){_0x2b4ed7['push'](_0x2b4ed7['shift']());}};_0x2974f6(++_0x3de6bc);}(_0xbd95,0x1a2));var _0x5bd9=function(_0x53d231,_0x1072b1){_0x53d231=_0x53d231-0x0;var _0x20956b=_0xbd95[_0x53d231];return _0x20956b;};'use strict';var _=require(_0x5bd9('0x0'));var util=require(_0x5bd9('0x1'));var logger=require(_0x5bd9('0x2'))(_0x5bd9('0x3'));var moment=require(_0x5bd9('0x4'));var BPromise=require(_0x5bd9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bd9('0x6'));var rimraf=require(_0x5bd9('0x7'));var config=require('../../config/environment');var attributes=require(_0x5bd9('0x8'));module[_0x5bd9('0x9')]=function(_0x14cc2b,_0x1de259){return _0x14cc2b[_0x5bd9('0xa')](_0x5bd9('0xb'),attributes,{'tableName':_0x5bd9('0xc'),'paranoid':![],'indexes':[{'name':_0x5bd9('0xd'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x5bd9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3c4=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4aae41,_0x100d30){var _0x41456b=function(_0x889727){while(--_0x889727){_0x4aae41['push'](_0x4aae41['shift']());}};_0x41456b(++_0x100d30);}(_0xa3c4,0xf4));var _0x4a3c=function(_0x1e2ba0,_0x25f9a3){_0x1e2ba0=_0x1e2ba0-0x0;var _0x33757b=_0xa3c4[_0x1e2ba0];return _0x33757b;};'use strict';var _=require('lodash');var util=require(_0x4a3c('0x0'));var logger=require(_0x4a3c('0x1'))(_0x4a3c('0x2'));var moment=require(_0x4a3c('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a3c('0x4'));var fs=require('fs');var path=require(_0x4a3c('0x5'));var rimraf=require('rimraf');var config=require(_0x4a3c('0x6'));var attributes=require(_0x4a3c('0x7'));module[_0x4a3c('0x8')]=function(_0x40929d,_0x1f9050){return _0x40929d[_0x4a3c('0x9')](_0x4a3c('0xa'),attributes,{'tableName':_0x4a3c('0xb'),'paranoid':![],'indexes':[{'name':_0x4a3c('0xc'),'fields':[_0x4a3c('0xc')]},{'name':'uniqueid','fields':[_0x4a3c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f22995a..3b2ad56 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5690e2,_0x4fbe8e){var _0x360b7c=function(_0x10dc84){while(--_0x10dc84){_0x5690e2['push'](_0x5690e2['shift']());}};_0x360b7c(++_0x4fbe8e);}(_0x7a54,0x106));var _0x47a5=function(_0x216914,_0x445b18){_0x216914=_0x216914-0x0;var _0xdb2782=_0x7a54[_0x216914];return _0xdb2782;};'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')]('CmHopperFinal,\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['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4c2fa8,_0x5f4d41){var _0x3c74ce=function(_0x343ba3){while(--_0x343ba3){_0x4c2fa8['push'](_0x4c2fa8['shift']());}};_0x3c74ce(++_0x5f4d41);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ae2cd,_0xb42c96){_0x2ae2cd=_0x2ae2cd-0x0;var _0xc52725=_0xb10b[_0x2ae2cd];return _0xc52725;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d1a15e8..d174bf7 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 _0x0a1f=['isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','util','path','express','Router','fs-extra','../../config/environment','./cmHopperFinal.controller','get'];(function(_0x403396,_0x28f1d6){var _0x1cafd9=function(_0x4c43c0){while(--_0x4c43c0){_0x403396['push'](_0x403396['shift']());}};_0x1cafd9(++_0x28f1d6);}(_0x0a1f,0x88));var _0xf0a1=function(_0x22a1b7,_0x1822b7){_0x22a1b7=_0x22a1b7-0x0;var _0x2d1d50=_0x0a1f[_0x22a1b7];return _0x2d1d50;};'use strict';var multer=require('multer');var util=require(_0xf0a1('0x0'));var path=require(_0xf0a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0a1('0x2'));var router=express[_0xf0a1('0x3')]();var fs_extra=require(_0xf0a1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0a1('0x5'));var controller=require(_0xf0a1('0x6'));router[_0xf0a1('0x7')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x9')]);router[_0xf0a1('0x7')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xb')]);router[_0xf0a1('0x7')](_0xf0a1('0xc'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xd')]);router[_0xf0a1('0x7')]('/voice/queue/countAttributes/:id',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xe')]);router[_0xf0a1('0x7')](_0xf0a1('0xf'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x10')]);router[_0xf0a1('0x11')]('/voice/queue/moveContacts/:id',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x12')]);router['post'](_0xf0a1('0x13'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x14')]);router[_0xf0a1('0x11')](_0xf0a1('0x15'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x16')]);router['put'](_0xf0a1('0xc'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x17')]);module['exports']=router; \ No newline at end of file +var _0x49a3=['/describe','describe','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x58e502,_0x7eff41){var _0x63e85c=function(_0x63f36e){while(--_0x63f36e){_0x58e502['push'](_0x58e502['shift']());}};_0x63e85c(++_0x7eff41);}(_0x49a3,0xe6));var _0x349a=function(_0x2512de,_0x268ad3){_0x2512de=_0x2512de-0x0;var _0x4f9774=_0x49a3[_0x2512de];return _0x4f9774;};'use strict';var multer=require('multer');var util=require(_0x349a('0x0'));var path=require(_0x349a('0x1'));var timeout=require(_0x349a('0x2'));var express=require(_0x349a('0x3'));var router=express[_0x349a('0x4')]();var fs_extra=require(_0x349a('0x5'));var auth=require(_0x349a('0x6'));var interaction=require(_0x349a('0x7'));var config=require(_0x349a('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x349a('0x9')](),controller['index']);router['get'](_0x349a('0xa'),auth[_0x349a('0x9')](),controller[_0x349a('0xb')]);router[_0x349a('0xc')]('/:id',auth[_0x349a('0x9')](),controller['show']);router[_0x349a('0xc')](_0x349a('0xd'),auth['isAuthenticated'](),controller[_0x349a('0xe')]);router['get'](_0x349a('0xf'),auth['isAuthenticated'](),controller[_0x349a('0x10')]);router[_0x349a('0x11')](_0x349a('0x12'),auth[_0x349a('0x9')](),controller[_0x349a('0x13')]);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x349a('0x14')]);router['post']('/checkContactHopper',auth[_0x349a('0x9')](),controller[_0x349a('0x15')]);router['put']('/:id',auth[_0x349a('0x9')](),controller[_0x349a('0x16')]);module[_0x349a('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b22eb67..2acf92f 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 _0xaae4=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x45209d,_0x98639a){var _0x5a1c63=function(_0x1704cd){while(--_0x1704cd){_0x45209d['push'](_0x45209d['shift']());}};_0x5a1c63(++_0x98639a);}(_0xaae4,0x120));var _0x4aae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xaae4[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x4aae('0x0'));module[_0x4aae('0x1')]={'state':{'type':Sequelize[_0x4aae('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4aae('0x3')]},'countbusyretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4aae('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x4aae('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4aae('0x4')]},'calleridname':{'type':Sequelize[_0x4aae('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4aae('0x3')]},'answertime':{'type':Sequelize[_0x4aae('0x3')]},'droptime':{'type':Sequelize[_0x4aae('0x3')]},'endtime':{'type':Sequelize[_0x4aae('0x3')]},'ringtime':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4aae('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4aae('0x4')]},'membername':{'type':Sequelize[_0x4aae('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4aae('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x4aae('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x4aae('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4aae('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4aae('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4aae('0x4')]}}; \ No newline at end of file +var _0xa59a=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xa59a,0x1d2));var _0xaa59=function(_0x3fae7e,_0x3d7800){_0x3fae7e=_0x3fae7e-0x0;var _0x13aaf3=_0xa59a[_0x3fae7e];return _0x13aaf3;};'use strict';var Sequelize=require(_0xaa59('0x0'));module[_0xaa59('0x1')]={'state':{'type':Sequelize[_0xaa59('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xaa59('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xaa59('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xaa59('0x3')]},'calleridnum':{'type':Sequelize[_0xaa59('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xaa59('0x4')]},'answertime':{'type':Sequelize[_0xaa59('0x4')]},'droptime':{'type':Sequelize[_0xaa59('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xaa59('0x3')]},'campaign':{'type':Sequelize[_0xaa59('0x3')]},'campaigntype':{'type':Sequelize[_0xaa59('0x3')]},'membername':{'type':Sequelize[_0xaa59('0x3')]},'reason':{'type':Sequelize[_0xaa59('0x3')]},'amd':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xaa59('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xaa59('0x4')]},'recallme':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xaa59('0x4')]},'edited':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xaa59('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 96b2de9..4c04cc4 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 _0x93bd=['mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','stack','name','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2687e5,_0x5d297f){var _0x2e7d32=function(_0x406f30){while(--_0x406f30){_0x2687e5['push'](_0x2687e5['shift']());}};_0x2e7d32(++_0x5d297f);}(_0x93bd,0x130));var _0xd93b=function(_0x2a9fbf,_0x1cdd71){_0x2a9fbf=_0x2a9fbf-0x0;var _0x21035f=_0x93bd[_0x2a9fbf];return _0x21035f;};'use strict';var emlformat=require(_0xd93b('0x0'));var rimraf=require(_0xd93b('0x1'));var zipdir=require(_0xd93b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd93b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd93b('0x4'));var util=require('util');var path=require(_0xd93b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd93b('0x6'));var fs=require('fs');var fs_extra=require(_0xd93b('0x7'));var _=require(_0xd93b('0x8'));var squel=require(_0xd93b('0x9'));var crypto=require(_0xd93b('0xa'));var jsforce=require(_0xd93b('0xb'));var deskjs=require(_0xd93b('0xc'));var toCsv=require(_0xd93b('0xd'));var querystring=require(_0xd93b('0xe'));var Papa=require(_0xd93b('0xf'));var Redis=require('ioredis');var authService=require(_0xd93b('0x10'));var qs=require(_0xd93b('0x11'));var as=require(_0xd93b('0x12'));var hardwareService=require(_0xd93b('0x13'));var logger=require(_0xd93b('0x14'))('api');var utils=require(_0xd93b('0x15'));var config=require(_0xd93b('0x16'));var licenseUtil=require(_0xd93b('0x17'));var db=require(_0xd93b('0x18'))['db'];function respondWithStatusCode(_0x3a5b88,_0x836aad){_0x836aad=_0x836aad||0xcc;return function(_0xc89dbe){if(_0xc89dbe){return _0x3a5b88['sendStatus'](_0x836aad);}return _0x3a5b88['status'](_0x836aad)['end']();};}function respondWithResult(_0x44b1bb,_0x37cc49){_0x37cc49=_0x37cc49||0xc8;return function(_0x2ece05){if(_0x2ece05){return _0x44b1bb[_0xd93b('0x19')](_0x37cc49)[_0xd93b('0x1a')](_0x2ece05);}};}function respondWithFilteredResult(_0x50fed7,_0x15b7b7){return function(_0x4e3d86){if(_0x4e3d86){var _0x5d85cf=typeof _0x15b7b7[_0xd93b('0x1b')]===_0xd93b('0x1c')&&typeof _0x15b7b7[_0xd93b('0x1d')]===_0xd93b('0x1c');var _0x30e45b=_0x4e3d86[_0xd93b('0x1e')];var _0x2456a9=_0x5d85cf?0x0:_0x15b7b7[_0xd93b('0x1b')];var _0x29ee78=_0x5d85cf?_0x4e3d86['count']:_0x15b7b7[_0xd93b('0x1b')]+_0x15b7b7[_0xd93b('0x1d')];var _0x475f93;if(_0x29ee78>=_0x30e45b){_0x29ee78=_0x30e45b;_0x475f93=0xc8;}else{_0x475f93=0xce;}_0x50fed7[_0xd93b('0x19')](_0x475f93);return _0x50fed7['set'](_0xd93b('0x1f'),_0x2456a9+'-'+_0x29ee78+'/'+_0x30e45b)[_0xd93b('0x1a')](_0x4e3d86);}return null;};}function patchUpdates(_0x28c139){return function(_0x4a0a82){try{jsonpatch[_0xd93b('0x20')](_0x4a0a82,_0x28c139,!![]);}catch(_0x2d1eb6){return BPromise['reject'](_0x2d1eb6);}return _0x4a0a82[_0xd93b('0x21')]();};}function saveUpdates(_0x3c0dbe,_0x5d33d5){return function(_0x4dda32){if(_0x4dda32){return _0x4dda32[_0xd93b('0x22')](_0x3c0dbe)[_0xd93b('0x23')](function(_0x574a47){return _0x574a47;});}return null;};}function removeEntity(_0x5a5ffd,_0x54aa8f){return function(_0x3af860){if(_0x3af860){return _0x3af860[_0xd93b('0x24')]()[_0xd93b('0x23')](function(){_0x5a5ffd[_0xd93b('0x19')](0xcc)[_0xd93b('0x25')]();});}};}function handleEntityNotFound(_0x258c32,_0x433b06){return function(_0x312b92){if(!_0x312b92){_0x258c32[_0xd93b('0x26')](0x194);}return _0x312b92;};}function handleError(_0x5310eb,_0x83aa33){_0x83aa33=_0x83aa33||0x1f4;return function(_0x3ef88f){logger['error'](_0x3ef88f[_0xd93b('0x27')]);if(_0x3ef88f[_0xd93b('0x28')]){delete _0x3ef88f[_0xd93b('0x28')];}_0x5310eb[_0xd93b('0x19')](_0x83aa33)['send'](_0x3ef88f);};}exports['index']=function(_0x59a920,_0x4536ec){var _0x453267={},_0x204d1a={},_0x1ea320={'count':0x0,'rows':[]};var _0x25d48e=_[_0xd93b('0x29')](db[_0xd93b('0x2a')][_0xd93b('0x2b')],function(_0x21043c){return{'name':_0x21043c[_0xd93b('0x2c')],'type':_0x21043c[_0xd93b('0x2d')][_0xd93b('0x2e')]};});_0x204d1a[_0xd93b('0x2f')]=_[_0xd93b('0x29')](_0x25d48e,_0xd93b('0x28'));_0x204d1a[_0xd93b('0x30')]=_[_0xd93b('0x31')](_0x59a920[_0xd93b('0x30')]);_0x204d1a[_0xd93b('0x32')]=_[_0xd93b('0x33')](_0x204d1a[_0xd93b('0x2f')],_0x204d1a['query']);_0x453267[_0xd93b('0x34')]=_['intersection'](_0x204d1a[_0xd93b('0x2f')],qs[_0xd93b('0x35')](_0x59a920[_0xd93b('0x30')][_0xd93b('0x35')]));_0x453267[_0xd93b('0x34')]=_0x453267[_0xd93b('0x34')]['length']?_0x453267[_0xd93b('0x34')]:_0x204d1a[_0xd93b('0x2f')];if(!_0x59a920['query'][_0xd93b('0x36')](_0xd93b('0x37'))){_0x453267['limit']=qs[_0xd93b('0x1d')](_0x59a920[_0xd93b('0x30')]['limit']);_0x453267['offset']=qs[_0xd93b('0x1b')](_0x59a920[_0xd93b('0x30')][_0xd93b('0x1b')]);}_0x453267[_0xd93b('0x38')]=qs['sort'](_0x59a920[_0xd93b('0x30')][_0xd93b('0x39')]);_0x453267['where']=qs[_0xd93b('0x32')](_[_0xd93b('0x3a')](_0x59a920[_0xd93b('0x30')],_0x204d1a[_0xd93b('0x32')]),_0x25d48e);if(_0x59a920[_0xd93b('0x30')][_0xd93b('0x3b')]){_0x453267[_0xd93b('0x3c')]=_[_0xd93b('0x3d')](_0x453267[_0xd93b('0x3c')],{'$or':_['map'](_0x25d48e,function(_0x543042){if(_0x543042[_0xd93b('0x2d')]!==_0xd93b('0x3e')){var _0x2adf44={};_0x2adf44[_0x543042['name']]={'$like':'%'+_0x59a920[_0xd93b('0x30')][_0xd93b('0x3b')]+'%'};return _0x2adf44;}})});}_0x453267=_[_0xd93b('0x3d')]({},_0x453267,_0x59a920[_0xd93b('0x3f')]);var _0x477f02={'where':_0x453267['where']};return db[_0xd93b('0x2a')][_0xd93b('0x1e')](_0x477f02)[_0xd93b('0x23')](function(_0x294046){_0x1ea320[_0xd93b('0x1e')]=_0x294046;if(_0x59a920[_0xd93b('0x30')][_0xd93b('0x40')]){_0x453267['include']=[{'all':!![]}];}return db[_0xd93b('0x2a')][_0xd93b('0x41')](_0x453267);})[_0xd93b('0x23')](function(_0x59b65b){_0x1ea320[_0xd93b('0x42')]=_0x59b65b;return _0x1ea320;})[_0xd93b('0x23')](respondWithFilteredResult(_0x4536ec,_0x453267))[_0xd93b('0x43')](handleError(_0x4536ec,null));};exports[_0xd93b('0x44')]=function(_0x30b888,_0x475a64){var _0x18fd8f={'raw':!![],'where':{'id':_0x30b888[_0xd93b('0x45')]['id']}},_0x3e62b7={};_0x3e62b7['model']=_[_0xd93b('0x31')](db[_0xd93b('0x2a')][_0xd93b('0x2b')]);_0x3e62b7[_0xd93b('0x30')]=_[_0xd93b('0x31')](_0x30b888[_0xd93b('0x30')]);_0x3e62b7[_0xd93b('0x32')]=_[_0xd93b('0x33')](_0x3e62b7[_0xd93b('0x2f')],_0x3e62b7[_0xd93b('0x30')]);_0x18fd8f[_0xd93b('0x34')]=_['intersection'](_0x3e62b7[_0xd93b('0x2f')],qs[_0xd93b('0x35')](_0x30b888[_0xd93b('0x30')]['fields']));_0x18fd8f['attributes']=_0x18fd8f[_0xd93b('0x34')][_0xd93b('0x46')]?_0x18fd8f[_0xd93b('0x34')]:_0x3e62b7[_0xd93b('0x2f')];if(_0x30b888[_0xd93b('0x30')]['includeAll']){_0x18fd8f[_0xd93b('0x47')]=[{'all':!![]}];}_0x18fd8f=_['merge']({},_0x18fd8f,_0x30b888['options']);return db[_0xd93b('0x2a')][_0xd93b('0x48')](_0x18fd8f)[_0xd93b('0x23')](handleEntityNotFound(_0x475a64,null))[_0xd93b('0x23')](respondWithResult(_0x475a64,null))[_0xd93b('0x43')](handleError(_0x475a64,null));};exports[_0xd93b('0x49')]=function(_0x166588,_0x3af5c4){return db['CmHopperHistory'][_0xd93b('0x49')](_0x166588['body'],{})['then'](respondWithResult(_0x3af5c4,0xc9))[_0xd93b('0x43')](handleError(_0x3af5c4,null));};exports['describe']=function(_0x4c3ba,_0x3e87a6){return db[_0xd93b('0x2a')][_0xd93b('0x4a')]()['then'](respondWithResult(_0x3e87a6,null))[_0xd93b('0x43')](handleError(_0x3e87a6,null));};exports[_0xd93b('0x22')]=function(_0x6bc927,_0x57d47a){if(_0x6bc927[_0xd93b('0x4b')]['uniqueid']){delete _0x6bc927[_0xd93b('0x4b')][_0xd93b('0x4c')];}return db[_0xd93b('0x2a')][_0xd93b('0x48')]({'where':{'uniqueid':_0x6bc927[_0xd93b('0x45')]['id']}})[_0xd93b('0x23')](handleEntityNotFound(_0x57d47a,null))[_0xd93b('0x23')](saveUpdates(_0x6bc927['body'],null))[_0xd93b('0x23')](respondWithResult(_0x57d47a,null))[_0xd93b('0x43')](handleError(_0x57d47a,null));}; \ No newline at end of file +var _0x7b78=['keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','model','query'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7b78,0x16a));var _0x87b7=function(_0x24a0b6,_0x43dd37){_0x24a0b6=_0x24a0b6-0x0;var _0x525767=_0x7b78[_0x24a0b6];return _0x525767;};'use strict';var emlformat=require(_0x87b7('0x0'));var rimraf=require(_0x87b7('0x1'));var zipdir=require(_0x87b7('0x2'));var jsonpatch=require(_0x87b7('0x3'));var rp=require(_0x87b7('0x4'));var moment=require(_0x87b7('0x5'));var BPromise=require(_0x87b7('0x6'));var Mustache=require(_0x87b7('0x7'));var util=require(_0x87b7('0x8'));var path=require(_0x87b7('0x9'));var sox=require(_0x87b7('0xa'));var csv=require(_0x87b7('0xb'));var ejs=require(_0x87b7('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87b7('0xd'));var squel=require(_0x87b7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87b7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x87b7('0x10'));var Redis=require(_0x87b7('0x11'));var authService=require(_0x87b7('0x12'));var qs=require(_0x87b7('0x13'));var as=require(_0x87b7('0x14'));var hardwareService=require(_0x87b7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x87b7('0x16'));var config=require(_0x87b7('0x17'));var licenseUtil=require(_0x87b7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x532f7a,_0x5dd189){_0x5dd189=_0x5dd189||0xcc;return function(_0x1640c4){if(_0x1640c4){return _0x532f7a[_0x87b7('0x19')](_0x5dd189);}return _0x532f7a[_0x87b7('0x1a')](_0x5dd189)[_0x87b7('0x1b')]();};}function respondWithResult(_0x181ac5,_0x3bf1eb){_0x3bf1eb=_0x3bf1eb||0xc8;return function(_0x4753b2){if(_0x4753b2){return _0x181ac5[_0x87b7('0x1a')](_0x3bf1eb)['json'](_0x4753b2);}};}function respondWithFilteredResult(_0x108740,_0x3c4f2d){return function(_0x21f976){if(_0x21f976){var _0x37477a=typeof _0x3c4f2d[_0x87b7('0x1c')]===_0x87b7('0x1d')&&typeof _0x3c4f2d[_0x87b7('0x1e')]===_0x87b7('0x1d');var _0x467c63=_0x21f976['count'];var _0x903c33=_0x37477a?0x0:_0x3c4f2d['offset'];var _0x690699=_0x37477a?_0x21f976[_0x87b7('0x1f')]:_0x3c4f2d[_0x87b7('0x1c')]+_0x3c4f2d[_0x87b7('0x1e')];var _0x54d412;if(_0x690699>=_0x467c63){_0x690699=_0x467c63;_0x54d412=0xc8;}else{_0x54d412=0xce;}_0x108740['status'](_0x54d412);return _0x108740['set'](_0x87b7('0x20'),_0x903c33+'-'+_0x690699+'/'+_0x467c63)['json'](_0x21f976);}return null;};}function patchUpdates(_0x27424f){return function(_0x41363b){try{jsonpatch['apply'](_0x41363b,_0x27424f,!![]);}catch(_0x363b8a){return BPromise[_0x87b7('0x21')](_0x363b8a);}return _0x41363b['save']();};}function saveUpdates(_0x2269e2,_0x31d343){return function(_0x143a81){if(_0x143a81){return _0x143a81[_0x87b7('0x22')](_0x2269e2)[_0x87b7('0x23')](function(_0x3e6270){return _0x3e6270;});}return null;};}function removeEntity(_0x184e84,_0x9e65ea){return function(_0x132044){if(_0x132044){return _0x132044[_0x87b7('0x24')]()['then'](function(){_0x184e84[_0x87b7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17be48,_0xd238f3){return function(_0x43c552){if(!_0x43c552){_0x17be48[_0x87b7('0x19')](0x194);}return _0x43c552;};}function handleError(_0x5387d3,_0xcfe77a){_0xcfe77a=_0xcfe77a||0x1f4;return function(_0xb4f656){logger['error'](_0xb4f656[_0x87b7('0x25')]);if(_0xb4f656['name']){delete _0xb4f656[_0x87b7('0x26')];}_0x5387d3[_0x87b7('0x1a')](_0xcfe77a)['send'](_0xb4f656);};}exports[_0x87b7('0x27')]=function(_0x25bbc1,_0x152de0){var _0x5efb57={},_0x1f13ea={},_0x252eea={'count':0x0,'rows':[]};var _0x59b9e9=_[_0x87b7('0x28')](db[_0x87b7('0x29')][_0x87b7('0x2a')],function(_0x369767){return{'name':_0x369767[_0x87b7('0x2b')],'type':_0x369767['type']['key']};});_0x1f13ea[_0x87b7('0x2c')]=_[_0x87b7('0x28')](_0x59b9e9,_0x87b7('0x26'));_0x1f13ea[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x25bbc1['query']);_0x1f13ea[_0x87b7('0x2f')]=_[_0x87b7('0x30')](_0x1f13ea['model'],_0x1f13ea['query']);_0x5efb57[_0x87b7('0x31')]=_[_0x87b7('0x30')](_0x1f13ea['model'],qs[_0x87b7('0x32')](_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x32')]));_0x5efb57[_0x87b7('0x31')]=_0x5efb57[_0x87b7('0x31')]['length']?_0x5efb57[_0x87b7('0x31')]:_0x1f13ea[_0x87b7('0x2c')];if(!_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x33')]('nolimit')){_0x5efb57[_0x87b7('0x1e')]=qs['limit'](_0x25bbc1['query'][_0x87b7('0x1e')]);_0x5efb57[_0x87b7('0x1c')]=qs[_0x87b7('0x1c')](_0x25bbc1['query'][_0x87b7('0x1c')]);}_0x5efb57['order']=qs[_0x87b7('0x34')](_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x34')]);_0x5efb57[_0x87b7('0x35')]=qs['filters'](_[_0x87b7('0x36')](_0x25bbc1[_0x87b7('0x2d')],_0x1f13ea['filters']),_0x59b9e9);if(_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x37')]){_0x5efb57[_0x87b7('0x35')]=_[_0x87b7('0x38')](_0x5efb57[_0x87b7('0x35')],{'$or':_['map'](_0x59b9e9,function(_0x1d5bec){if(_0x1d5bec['type']!=='VIRTUAL'){var _0x295331={};_0x295331[_0x1d5bec[_0x87b7('0x26')]]={'$like':'%'+_0x25bbc1['query'][_0x87b7('0x37')]+'%'};return _0x295331;}})});}_0x5efb57=_[_0x87b7('0x38')]({},_0x5efb57,_0x25bbc1[_0x87b7('0x39')]);var _0x5ad1c9={'where':_0x5efb57[_0x87b7('0x35')]};return db[_0x87b7('0x29')]['count'](_0x5ad1c9)[_0x87b7('0x23')](function(_0x378715){_0x252eea[_0x87b7('0x1f')]=_0x378715;if(_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x3a')]){_0x5efb57[_0x87b7('0x3b')]=[{'all':!![]}];}return db[_0x87b7('0x29')][_0x87b7('0x3c')](_0x5efb57);})[_0x87b7('0x23')](function(_0x529bd0){_0x252eea['rows']=_0x529bd0;return _0x252eea;})[_0x87b7('0x23')](respondWithFilteredResult(_0x152de0,_0x5efb57))['catch'](handleError(_0x152de0,null));};exports['show']=function(_0x38ac78,_0x19cd58){var _0x3c1d74={'raw':!![],'where':{'id':_0x38ac78[_0x87b7('0x3d')]['id']}},_0x33a9b9={};_0x33a9b9[_0x87b7('0x2c')]=_[_0x87b7('0x2e')](db[_0x87b7('0x29')][_0x87b7('0x2a')]);_0x33a9b9[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x38ac78[_0x87b7('0x2d')]);_0x33a9b9['filters']=_[_0x87b7('0x30')](_0x33a9b9['model'],_0x33a9b9[_0x87b7('0x2d')]);_0x3c1d74[_0x87b7('0x31')]=_['intersection'](_0x33a9b9[_0x87b7('0x2c')],qs[_0x87b7('0x32')](_0x38ac78['query'][_0x87b7('0x32')]));_0x3c1d74[_0x87b7('0x31')]=_0x3c1d74['attributes']['length']?_0x3c1d74['attributes']:_0x33a9b9[_0x87b7('0x2c')];if(_0x38ac78['query'][_0x87b7('0x3a')]){_0x3c1d74[_0x87b7('0x3b')]=[{'all':!![]}];}_0x3c1d74=_['merge']({},_0x3c1d74,_0x38ac78[_0x87b7('0x39')]);return db[_0x87b7('0x29')][_0x87b7('0x3e')](_0x3c1d74)[_0x87b7('0x23')](handleEntityNotFound(_0x19cd58,null))[_0x87b7('0x23')](respondWithResult(_0x19cd58,null))[_0x87b7('0x3f')](handleError(_0x19cd58,null));};exports[_0x87b7('0x40')]=function(_0x3ad407,_0x471d95){return db['CmHopperHistory'][_0x87b7('0x40')](_0x3ad407[_0x87b7('0x41')],{})[_0x87b7('0x23')](respondWithResult(_0x471d95,0xc9))[_0x87b7('0x3f')](handleError(_0x471d95,null));};exports[_0x87b7('0x42')]=function(_0x1170f1,_0x51a4b9){return db['CmHopperHistory']['describe']()[_0x87b7('0x23')](respondWithResult(_0x51a4b9,null))[_0x87b7('0x3f')](handleError(_0x51a4b9,null));};exports[_0x87b7('0x22')]=function(_0x4f3bfe,_0x5179be){if(_0x4f3bfe[_0x87b7('0x41')][_0x87b7('0x43')]){delete _0x4f3bfe[_0x87b7('0x41')][_0x87b7('0x43')];}return db['CmHopperHistory'][_0x87b7('0x3e')]({'where':{'uniqueid':_0x4f3bfe[_0x87b7('0x3d')]['id']}})[_0x87b7('0x23')](handleEntityNotFound(_0x5179be,null))['then'](saveUpdates(_0x4f3bfe[_0x87b7('0x41')],null))[_0x87b7('0x23')](respondWithResult(_0x5179be,null))[_0x87b7('0x3f')](handleError(_0x5179be,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3bb78c2..bc89bdf 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 _0xb78e=['../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x82ad48,_0x2d6224){var _0x3a4643=function(_0x4b1d2b){while(--_0x4b1d2b){_0x82ad48['push'](_0x82ad48['shift']());}};_0x3a4643(++_0x2d6224);}(_0xb78e,0x1c9));var _0xeb78=function(_0x277c6b,_0x1ee9a){_0x277c6b=_0x277c6b-0x0;var _0x353f02=_0xb78e[_0x277c6b];return _0x353f02;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[{'name':_0xeb78('0xd'),'fields':[_0xeb78('0xd')]},{'name':'uniqueid','fields':[_0xeb78('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7d9=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf7d9,0x122));var _0x9f7d=function(_0x5db4c9,_0x821c99){_0x5db4c9=_0x5db4c9-0x0;var _0x176a85=_0xf7d9[_0x5db4c9];return _0x176a85;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var logger=require(_0x9f7d('0x2'))(_0x9f7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f7d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f7d('0x5'));var config=require(_0x9f7d('0x6'));var attributes=require(_0x9f7d('0x7'));module[_0x9f7d('0x8')]=function(_0x3cb3b8,_0x513f73){return _0x3cb3b8['define'](_0x9f7d('0x9'),attributes,{'tableName':_0x9f7d('0xa'),'paranoid':![],'indexes':[{'name':_0x9f7d('0xb'),'fields':[_0x9f7d('0xb')]},{'name':_0x9f7d('0xc'),'fields':[_0x9f7d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9fbc918..fe0962a 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 _0xbbc6=['`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x4c887e,_0x422965){var _0x135a75=function(_0x42d528){while(--_0x42d528){_0x4c887e['push'](_0x4c887e['shift']());}};_0x135a75(++_0x422965);}(_0xbbc6,0xa6));var _0x6bbc=function(_0x23adbf,_0xba5878){_0x23adbf=_0x23adbf-0x0;var _0x38bfad=_0xbbc6[_0x23adbf];return _0x38bfad;};'use strict';var _=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var moment=require(_0x6bbc('0x2'));var BPromise=require(_0x6bbc('0x3'));var rs=require(_0x6bbc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6bbc('0x5'));var logger=require(_0x6bbc('0x6'))('rpc');var config=require(_0x6bbc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6bbc('0x8')][_0x6bbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d63ac,_0x447ef2,_0x38b3f4){return new BPromise(function(_0x560278,_0x1ed07f){return client[_0x6bbc('0xa')](_0x2d63ac,_0x38b3f4)[_0x6bbc('0xb')](function(_0x5aab77){logger[_0x6bbc('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x447ef2,_0x6bbc('0xd'));logger[_0x6bbc('0xe')](_0x6bbc('0xf'),_0x447ef2,'request\x20sent',JSON['stringify'](_0x5aab77));if(_0x5aab77[_0x6bbc('0x10')]){if(_0x5aab77['error'][_0x6bbc('0x11')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x447ef2,_0x5aab77[_0x6bbc('0x10')][_0x6bbc('0x12')]);return _0x1ed07f(_0x5aab77['error'][_0x6bbc('0x12')]);}logger[_0x6bbc('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x447ef2,_0x5aab77['error'][_0x6bbc('0x12')]);return _0x560278(_0x5aab77[_0x6bbc('0x10')][_0x6bbc('0x12')]);}else{logger['info'](_0x6bbc('0x13'),_0x447ef2,_0x6bbc('0xd'));_0x560278(_0x5aab77[_0x6bbc('0x14')][_0x6bbc('0x12')]);}})[_0x6bbc('0x15')](function(_0x2d8f2c){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x447ef2,_0x2d8f2c);_0x1ed07f(_0x2d8f2c);});});}exports[_0x6bbc('0x16')]=function(_0x51a5fe){var _0x3af05e=this;return new Promise(function(_0x5aa926,_0x2d39af){return db[_0x6bbc('0x17')][_0x6bbc('0x18')](_0x51a5fe[_0x6bbc('0x19')],{'raw':_0x51a5fe[_0x6bbc('0x1a')]?_0x51a5fe['options']['raw']===undefined?!![]:![]:!![]})[_0x6bbc('0xb')](function(_0x4d7620){logger['info'](_0x6bbc('0x16'),_0x51a5fe);logger[_0x6bbc('0xe')](_0x6bbc('0x16'),_0x51a5fe,JSON[_0x6bbc('0x1b')](_0x4d7620));_0x5aa926(_0x4d7620);})[_0x6bbc('0x15')](function(_0x86526){logger[_0x6bbc('0x10')](_0x6bbc('0x16'),_0x86526['message'],_0x51a5fe);_0x2d39af(_0x3af05e[_0x6bbc('0x10')](0x1f4,_0x86526['message']));});});};exports[_0x6bbc('0x1c')]=function(_0x51854d){var _0x49f8e8=this;return new Promise(function(_0x4b1fb3,_0x49e556){return db[_0x6bbc('0x17')][_0x6bbc('0x1d')]({'raw':_0x51854d[_0x6bbc('0x1a')]?_0x51854d[_0x6bbc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x51854d[_0x6bbc('0x1a')]?_0x51854d[_0x6bbc('0x1a')][_0x6bbc('0x1e')]||null:null,'attributes':[[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['col']('id')),_0x6bbc('0x21')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x23')))),_0x6bbc('0x24')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x6bbc('0x22')](_0x6bbc('0x25')))),_0x6bbc('0x26')],[db[_0x6bbc('0x1f')]['fn']('COUNT',db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x27')))),_0x6bbc('0x28')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x29'),db[_0x6bbc('0x1f')]['fn']('IF',db['sequelize'][_0x6bbc('0x22')](_0x6bbc('0x2a')))),_0x6bbc('0x2b')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x29'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6bbc('0x2c')))),'predictiveIntervalAvgTalktime']]})[_0x6bbc('0xb')](function(_0x641381){logger[_0x6bbc('0xc')](_0x6bbc('0x1c'),_0x51854d);logger['debug']('AvgHandleTime',_0x51854d,JSON[_0x6bbc('0x1b')](_0x641381));_0x4b1fb3(_0x641381);})['catch'](function(_0x2ec4b2){logger['error'](_0x6bbc('0x1c'),_0x2ec4b2[_0x6bbc('0x12')],_0x51854d);_0x49e556(_0x49f8e8[_0x6bbc('0x10')](0x1f4,_0x2ec4b2[_0x6bbc('0x12')]));});});};exports[_0x6bbc('0x2d')]=function(_0x36bf64){var _0x471a62=this;return new Promise(function(_0x4e67d7,_0x41c821){return db[_0x6bbc('0x17')][_0x6bbc('0x1d')]({'raw':_0x36bf64[_0x6bbc('0x1a')]?_0x36bf64[_0x6bbc('0x1a')][_0x6bbc('0x2e')]===undefined?!![]:![]:!![],'where':_0x36bf64['options']?_0x36bf64['options'][_0x6bbc('0x1e')]||null:null,'attributes':[[_0x6bbc('0x2f'),'name'],[db[_0x6bbc('0x1f')]['fn']('COUNT',db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x30')))),_0x6bbc('0x31')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x32')))),_0x6bbc('0x33')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db['sequelize']['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x23')))),_0x6bbc('0x34')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db['sequelize']['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x35')))),_0x6bbc('0x36')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x37')))),_0x6bbc('0x38')],[db[_0x6bbc('0x1f')]['fn']('COUNT',db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x39')))),_0x6bbc('0x3a')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x3b')))),_0x6bbc('0x3c')],[db[_0x6bbc('0x1f')]['fn']('COUNT',db[_0x6bbc('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x6bbc('0x3d')))),_0x6bbc('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x3f')))),_0x6bbc('0x40')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x41')))),_0x6bbc('0x42')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x43')))),_0x6bbc('0x44')],[db['sequelize']['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')][_0x6bbc('0x22')](_0x6bbc('0x45')))),'outboundAnswerAgiCallsDay'],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')]['literal'](_0x6bbc('0x46')))),_0x6bbc('0x44')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db[_0x6bbc('0x1f')]['fn']('IF',db[_0x6bbc('0x1f')]['literal'](_0x6bbc('0x47')))),_0x6bbc('0x48')]],'group':[_0x6bbc('0x2f')]})[_0x6bbc('0xb')](function(_0x8960dd){logger[_0x6bbc('0xc')]('GetVoiceQueueHopperHistory',_0x36bf64);logger[_0x6bbc('0xe')](_0x6bbc('0x2d'),_0x36bf64,JSON['stringify'](_0x8960dd));_0x4e67d7(_0x8960dd);})['catch'](function(_0x4677d0){logger['error'](_0x6bbc('0x2d'),_0x4677d0[_0x6bbc('0x12')],_0x36bf64);_0x41c821(_0x471a62['error'](0x1f4,_0x4677d0[_0x6bbc('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x1f4e0a){var _0x4a6dd5=this;return new Promise(function(_0x3c136c,_0x2502ac){return db[_0x6bbc('0x17')][_0x6bbc('0x1d')]({'raw':_0x1f4e0a['options']?_0x1f4e0a[_0x6bbc('0x1a')][_0x6bbc('0x2e')]===undefined?!![]:![]:!![],'where':_0x1f4e0a[_0x6bbc('0x1a')]?_0x1f4e0a['options']['where']||null:null,'attributes':[[_0x6bbc('0x2f'),_0x6bbc('0x49')],[db[_0x6bbc('0x1f')]['fn'](_0x6bbc('0x20'),db['sequelize']['col']('id')),_0x6bbc('0x4a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6bbc('0x23')))),_0x6bbc('0x4b')]],'group':[_0x6bbc('0x2f')]})[_0x6bbc('0xb')](function(_0x3f4da0){logger[_0x6bbc('0xc')]('GetCampaignHopperHistory',_0x1f4e0a);logger[_0x6bbc('0xe')](_0x6bbc('0x4c'),_0x1f4e0a,JSON[_0x6bbc('0x1b')](_0x3f4da0));_0x3c136c(_0x3f4da0);})[_0x6bbc('0x15')](function(_0x55baaa){logger['error'](_0x6bbc('0x4c'),_0x55baaa[_0x6bbc('0x12')],_0x1f4e0a);_0x2502ac(_0x4a6dd5[_0x6bbc('0x10')](0x1f4,_0x55baaa['message']));});});}; \ No newline at end of file +var _0xe739=['options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','stringify','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x413960,_0x1024cc){var _0x963609=function(_0xca404){while(--_0xca404){_0x413960['push'](_0x413960['shift']());}};_0x963609(++_0x1024cc);}(_0xe739,0x105));var _0x9e73=function(_0x4e57b9,_0x563b9b){_0x4e57b9=_0x4e57b9-0x0;var _0x3e8fb3=_0xe739[_0x4e57b9];return _0x3e8fb3;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}exports[_0x9e73('0x13')]=function(_0x48b1db){var _0x4dabb2=this;return new Promise(function(_0x419c5b,_0x3944fc){return db[_0x9e73('0x14')][_0x9e73('0x15')](_0x48b1db[_0x9e73('0x16')],{'raw':_0x48b1db[_0x9e73('0x17')]?_0x48b1db[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![]})[_0x9e73('0xa')](function(_0x3f56bf){logger['info'](_0x9e73('0x13'),_0x48b1db);logger['debug'](_0x9e73('0x13'),_0x48b1db,JSON['stringify'](_0x3f56bf));_0x419c5b(_0x3f56bf);})[_0x9e73('0x12')](function(_0x589a5d){logger[_0x9e73('0xd')](_0x9e73('0x13'),_0x589a5d['message'],_0x48b1db);_0x3944fc(_0x4dabb2['error'](0x1f4,_0x589a5d[_0x9e73('0x10')]));});});};exports[_0x9e73('0x19')]=function(_0x256ea1){var _0x257dca=this;return new Promise(function(_0x1214b5,_0x5117af){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x1b')]||null:null,'attributes':[[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize'][_0x9e73('0x1e')]('id')),_0x9e73('0x1f')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x22')))),_0x9e73('0x23')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x24')))),_0x9e73('0x25')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x27')))),_0x9e73('0x28')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x29')))),_0x9e73('0x2a')]]})[_0x9e73('0xa')](function(_0x4cf402){logger[_0x9e73('0xb')](_0x9e73('0x19'),_0x256ea1);logger[_0x9e73('0x2b')](_0x9e73('0x19'),_0x256ea1,JSON['stringify'](_0x4cf402));_0x1214b5(_0x4cf402);})[_0x9e73('0x12')](function(_0x3186b0){logger['error']('AvgHandleTime',_0x3186b0[_0x9e73('0x10')],_0x256ea1);_0x5117af(_0x257dca[_0x9e73('0xd')](0x1f4,_0x3186b0[_0x9e73('0x10')]));});});};exports[_0x9e73('0x2c')]=function(_0x14fb70){var _0x430846=this;return new Promise(function(_0x5e6ffe,_0x574a8b){return db['CmHopperHistory'][_0x9e73('0x1a')]({'raw':_0x14fb70[_0x9e73('0x17')]?_0x14fb70[_0x9e73('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x14fb70['options']?_0x14fb70['options'][_0x9e73('0x1b')]||null:null,'attributes':[[_0x9e73('0x2d'),_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x2f')))),_0x9e73('0x30')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x21')))),_0x9e73('0x31')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9e73('0x32')))),_0x9e73('0x33')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x34')))),_0x9e73('0x35')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9e73('0x37')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x38')))),_0x9e73('0x39')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3a')))),_0x9e73('0x3b')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x3c')))),_0x9e73('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3e')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x40')))),_0x9e73('0x41')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x42')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x9e73('0x2d')]})['then'](function(_0x22f69a){logger['info'](_0x9e73('0x2c'),_0x14fb70);logger['debug'](_0x9e73('0x2c'),_0x14fb70,JSON[_0x9e73('0x43')](_0x22f69a));_0x5e6ffe(_0x22f69a);})[_0x9e73('0x12')](function(_0x43c524){logger[_0x9e73('0xd')](_0x9e73('0x2c'),_0x43c524[_0x9e73('0x10')],_0x14fb70);_0x574a8b(_0x430846['error'](0x1f4,_0x43c524[_0x9e73('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0xe3ee0d){var _0x39aa72=this;return new Promise(function(_0x29b3e1,_0x5d4c99){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0xe3ee0d['options']?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0xe3ee0d[_0x9e73('0x17')]?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x1b')]||null:null,'attributes':[['campaign',_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')][_0x9e73('0x1e')]('id')),_0x9e73('0x44')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x21')))),_0x9e73('0x45')]],'group':[_0x9e73('0x2d')]})[_0x9e73('0xa')](function(_0x34465a){logger[_0x9e73('0xb')](_0x9e73('0x46'),_0xe3ee0d);logger[_0x9e73('0x2b')](_0x9e73('0x46'),_0xe3ee0d,JSON[_0x9e73('0x43')](_0x34465a));_0x29b3e1(_0x34465a);})[_0x9e73('0x12')](function(_0x4dacf2){logger[_0x9e73('0xd')](_0x9e73('0x46'),_0x4dacf2[_0x9e73('0x10')],_0xe3ee0d);_0x5d4c99(_0x39aa72['error'](0x1f4,_0x4dacf2['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index af8829d..3200e26 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 _0x0322=['index','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x19655c,_0x35229b){var _0x10b430=function(_0x4b1597){while(--_0x4b1597){_0x19655c['push'](_0x19655c['shift']());}};_0x10b430(++_0x35229b);}(_0x0322,0x14a));var _0x2032=function(_0x584513,_0x37c6c9){_0x584513=_0x584513-0x0;var _0xe4a14e=_0x0322[_0x584513];return _0xe4a14e;};'use strict';var multer=require(_0x2032('0x0'));var util=require(_0x2032('0x1'));var path=require(_0x2032('0x2'));var timeout=require(_0x2032('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2032('0x4'));var auth=require(_0x2032('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2032('0x6'));var controller=require(_0x2032('0x7'));router[_0x2032('0x8')]('/',auth[_0x2032('0x9')](),controller[_0x2032('0xa')]);router[_0x2032('0x8')](_0x2032('0xb'),auth[_0x2032('0x9')](),controller[_0x2032('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2032('0xd')]);router[_0x2032('0xe')]('/',auth[_0x2032('0x9')](),controller[_0x2032('0xf')]);router[_0x2032('0x10')](_0x2032('0x11'),auth[_0x2032('0x9')](),controller[_0x2032('0x12')]);module[_0x2032('0x13')]=router; \ No newline at end of file +var _0x427d=['get','/describe','describe','/:id','show','create','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x427d,0x1b9));var _0xd427=function(_0xa27e48,_0x620d9d){_0xa27e48=_0xa27e48-0x0;var _0x4a82fd=_0x427d[_0xa27e48];return _0x4a82fd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd427('0x0'));var router=express[_0xd427('0x1')]();var fs_extra=require(_0xd427('0x2'));var auth=require(_0xd427('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd427('0x4'));var controller=require(_0xd427('0x5'));router['get']('/',auth[_0xd427('0x6')](),controller['index']);router[_0xd427('0x7')](_0xd427('0x8'),auth[_0xd427('0x6')](),controller[_0xd427('0x9')]);router[_0xd427('0x7')](_0xd427('0xa'),auth[_0xd427('0x6')](),controller[_0xd427('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd427('0xc')]);router['put'](_0xd427('0xa'),auth[_0xd427('0x6')](),controller['update']);module[_0xd427('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 79f4aa5..d661fda 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 _0x4b1f=['STRING','sequelize','exports','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x4b1f[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xf4b1('0x0'));module[_0xf4b1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf4b1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf4b1('0x3')]},'dialPrefix':{'type':Sequelize[_0xf4b1('0x3')]}}; \ No newline at end of file +var _0x6aa7=['name','sequelize','STRING'];(function(_0x1d61b5,_0x5371d6){var _0x3147f5=function(_0xde866a){while(--_0xde866a){_0x1d61b5['push'](_0x1d61b5['shift']());}};_0x3147f5(++_0x5371d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x4b4904,_0x243c5c){_0x4b4904=_0x4b4904-0x0;var _0x532f9c=_0x6aa7[_0x4b4904];return _0x532f9c;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index aacfc11..19aa7ca 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 _0xee41=['VIRTUAL','includeAll','include','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','push','each','omit','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','destroy','get','UserProfileResource','stack','name','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x36a481,_0x29a707){var _0x4a590c=function(_0x4e0d40){while(--_0x4e0d40){_0x36a481['push'](_0x36a481['shift']());}};_0x4a590c(++_0x29a707);}(_0xee41,0x1aa));var _0x1ee4=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0xee41[_0x23e33d];return _0x818fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ee4('0x0'));var zipdir=require(_0x1ee4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ee4('0x2'));var moment=require(_0x1ee4('0x3'));var BPromise=require(_0x1ee4('0x4'));var Mustache=require(_0x1ee4('0x5'));var util=require(_0x1ee4('0x6'));var path=require(_0x1ee4('0x7'));var sox=require('sox');var csv=require(_0x1ee4('0x8'));var ejs=require(_0x1ee4('0x9'));var fs=require('fs');var fs_extra=require(_0x1ee4('0xa'));var _=require(_0x1ee4('0xb'));var squel=require('squel');var crypto=require(_0x1ee4('0xc'));var jsforce=require(_0x1ee4('0xd'));var deskjs=require(_0x1ee4('0xe'));var toCsv=require(_0x1ee4('0x8'));var querystring=require(_0x1ee4('0xf'));var Papa=require(_0x1ee4('0x10'));var Redis=require(_0x1ee4('0x11'));var authService=require(_0x1ee4('0x12'));var qs=require(_0x1ee4('0x13'));var as=require(_0x1ee4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ee4('0x15'))(_0x1ee4('0x16'));var utils=require('../../config/utils');var config=require(_0x1ee4('0x17'));var licenseUtil=require(_0x1ee4('0x18'));var db=require(_0x1ee4('0x19'))['db'];var csv_results;config[_0x1ee4('0x1a')]=_[_0x1ee4('0x1b')](config[_0x1ee4('0x1a')],{'host':_0x1ee4('0x1c'),'port':0x18eb});var socket=require(_0x1ee4('0x1d'))(new Redis(config[_0x1ee4('0x1a')]));require(_0x1ee4('0x1e'))['register'](socket);function respondWithStatusCode(_0x416544,_0x44ad8a){_0x44ad8a=_0x44ad8a||0xcc;return function(_0xaebb6){if(_0xaebb6){return _0x416544[_0x1ee4('0x1f')](_0x44ad8a);}return _0x416544[_0x1ee4('0x20')](_0x44ad8a)[_0x1ee4('0x21')]();};}function respondWithResult(_0x1b29df,_0xd57dcb){_0xd57dcb=_0xd57dcb||0xc8;return function(_0x21c148){if(_0x21c148){return _0x1b29df[_0x1ee4('0x20')](_0xd57dcb)[_0x1ee4('0x22')](_0x21c148);}};}function respondWithFilteredResult(_0x4b70ac,_0x1bfb2d){return function(_0x953b58){if(_0x953b58){var _0x31a8aa=typeof _0x1bfb2d[_0x1ee4('0x23')]==='undefined'&&typeof _0x1bfb2d[_0x1ee4('0x24')]===_0x1ee4('0x25');var _0x4221f8=_0x953b58[_0x1ee4('0x26')];var _0x58ad37=_0x31a8aa?0x0:_0x1bfb2d[_0x1ee4('0x23')];var _0x2c459d=_0x31a8aa?_0x953b58[_0x1ee4('0x26')]:_0x1bfb2d[_0x1ee4('0x23')]+_0x1bfb2d[_0x1ee4('0x24')];var _0x1b9dde;if(_0x2c459d>=_0x4221f8){_0x2c459d=_0x4221f8;_0x1b9dde=0xc8;}else{_0x1b9dde=0xce;}_0x4b70ac[_0x1ee4('0x20')](_0x1b9dde);return _0x4b70ac[_0x1ee4('0x27')]('Content-Range',_0x58ad37+'-'+_0x2c459d+'/'+_0x4221f8)[_0x1ee4('0x22')](_0x953b58);}return null;};}function patchUpdates(_0x10476d){return function(_0x52bc3b){try{jsonpatch[_0x1ee4('0x28')](_0x52bc3b,_0x10476d,!![]);}catch(_0x22e340){return BPromise['reject'](_0x22e340);}return _0x52bc3b['save']();};}function saveUpdates(_0x426d87,_0x48af86){return function(_0x16bd27){if(_0x16bd27){return _0x16bd27[_0x1ee4('0x29')](_0x426d87)[_0x1ee4('0x2a')](function(_0x306114){return _0x306114;});}return null;};}function removeEntity(_0x412e15,_0x2881d0){return function(_0x1e47b7){if(_0x1e47b7){return _0x1e47b7[_0x1ee4('0x2b')]()['then'](function(){var _0x5ab224=_0x1e47b7[_0x1ee4('0x2c')]({'plain':!![]});var _0x36d788='Lists';return db[_0x1ee4('0x2d')][_0x1ee4('0x2b')]({'where':{'type':_0x36d788,'resourceId':_0x5ab224['id']}})[_0x1ee4('0x2a')](function(){return _0x1e47b7;});})[_0x1ee4('0x2a')](function(){_0x412e15['status'](0xcc)[_0x1ee4('0x21')]();});}};}function handleEntityNotFound(_0x4d663f,_0x4b738d){return function(_0x3b7880){if(!_0x3b7880){_0x4d663f[_0x1ee4('0x1f')](0x194);}return _0x3b7880;};}function handleError(_0x54b85e,_0x5a4413){_0x5a4413=_0x5a4413||0x1f4;return function(_0x338fc8){logger['error'](_0x338fc8[_0x1ee4('0x2e')]);if(_0x338fc8[_0x1ee4('0x2f')]){delete _0x338fc8['name'];}_0x54b85e[_0x1ee4('0x20')](_0x5a4413)['send'](_0x338fc8);};}exports[_0x1ee4('0x30')]=function(_0x512fa1,_0x241949){var _0x30fd13={},_0x5f4ec5={},_0x45bdfd={'count':0x0,'rows':[]};var _0x73ce91=_[_0x1ee4('0x31')](db[_0x1ee4('0x32')][_0x1ee4('0x33')],function(_0x312f4b){return{'name':_0x312f4b[_0x1ee4('0x34')],'type':_0x312f4b[_0x1ee4('0x35')]['key']};});_0x5f4ec5[_0x1ee4('0x36')]=_[_0x1ee4('0x31')](_0x73ce91,_0x1ee4('0x2f'));_0x5f4ec5[_0x1ee4('0x37')]=_[_0x1ee4('0x38')](_0x512fa1['query']);_0x5f4ec5[_0x1ee4('0x39')]=_[_0x1ee4('0x3a')](_0x5f4ec5['model'],_0x5f4ec5[_0x1ee4('0x37')]);_0x30fd13[_0x1ee4('0x3b')]=_[_0x1ee4('0x3a')](_0x5f4ec5[_0x1ee4('0x36')],qs['fields'](_0x512fa1['query'][_0x1ee4('0x3c')]));_0x30fd13[_0x1ee4('0x3b')]=_0x30fd13[_0x1ee4('0x3b')][_0x1ee4('0x3d')]?_0x30fd13[_0x1ee4('0x3b')]:_0x5f4ec5['model'];if(!_0x512fa1['query'][_0x1ee4('0x3e')](_0x1ee4('0x3f'))){_0x30fd13[_0x1ee4('0x24')]=qs[_0x1ee4('0x24')](_0x512fa1['query'][_0x1ee4('0x24')]);_0x30fd13[_0x1ee4('0x23')]=qs[_0x1ee4('0x23')](_0x512fa1[_0x1ee4('0x37')][_0x1ee4('0x23')]);}_0x30fd13[_0x1ee4('0x40')]=qs['sort'](_0x512fa1[_0x1ee4('0x37')][_0x1ee4('0x41')]);_0x30fd13[_0x1ee4('0x42')]=qs['filters'](_['pick'](_0x512fa1[_0x1ee4('0x37')],_0x5f4ec5['filters']),_0x73ce91);if(_0x512fa1[_0x1ee4('0x37')][_0x1ee4('0x43')]){_0x30fd13[_0x1ee4('0x42')]=_[_0x1ee4('0x44')](_0x30fd13['where'],{'$or':_[_0x1ee4('0x31')](_0x73ce91,function(_0x4d9697){if(_0x4d9697[_0x1ee4('0x35')]!==_0x1ee4('0x45')){var _0x4421cc={};_0x4421cc[_0x4d9697['name']]={'$like':'%'+_0x512fa1['query'][_0x1ee4('0x43')]+'%'};return _0x4421cc;}})});}_0x30fd13=_['merge']({},_0x30fd13,_0x512fa1['options']);var _0x32d8b8={'where':_0x30fd13[_0x1ee4('0x42')]};return db[_0x1ee4('0x32')]['count'](_0x32d8b8)['then'](function(_0x40a159){_0x45bdfd[_0x1ee4('0x26')]=_0x40a159;if(_0x512fa1['query'][_0x1ee4('0x46')]){_0x30fd13[_0x1ee4('0x47')]=[{'all':!![]}];}return db[_0x1ee4('0x32')]['findAll'](_0x30fd13);})[_0x1ee4('0x2a')](function(_0x186434){_0x45bdfd['rows']=_0x186434;return _0x45bdfd;})[_0x1ee4('0x2a')](respondWithFilteredResult(_0x241949,_0x30fd13))['catch'](handleError(_0x241949,null));};exports['show']=function(_0x14af9e,_0x4728bc){var _0x1a202f={'raw':![],'where':{'id':_0x14af9e[_0x1ee4('0x48')]['id']}},_0x4c1660={};_0x4c1660[_0x1ee4('0x36')]=_[_0x1ee4('0x38')](db['CmList'][_0x1ee4('0x33')]);_0x4c1660[_0x1ee4('0x37')]=_['keys'](_0x14af9e[_0x1ee4('0x37')]);_0x4c1660['filters']=_[_0x1ee4('0x3a')](_0x4c1660[_0x1ee4('0x36')],_0x4c1660['query']);_0x1a202f[_0x1ee4('0x3b')]=_['intersection'](_0x4c1660[_0x1ee4('0x36')],qs[_0x1ee4('0x3c')](_0x14af9e['query'][_0x1ee4('0x3c')]));_0x1a202f[_0x1ee4('0x3b')]=_0x1a202f[_0x1ee4('0x3b')][_0x1ee4('0x3d')]?_0x1a202f['attributes']:_0x4c1660[_0x1ee4('0x36')];if(_0x14af9e[_0x1ee4('0x37')][_0x1ee4('0x46')]){_0x1a202f[_0x1ee4('0x47')]=[{'all':!![]}];}_0x1a202f=_['merge']({},_0x1a202f,_0x14af9e[_0x1ee4('0x49')]);return db[_0x1ee4('0x32')][_0x1ee4('0x4a')](_0x1a202f)[_0x1ee4('0x2a')](handleEntityNotFound(_0x4728bc,null))[_0x1ee4('0x2a')](respondWithResult(_0x4728bc,null))[_0x1ee4('0x4b')](handleError(_0x4728bc,null));};exports[_0x1ee4('0x4c')]=function(_0x30e15f,_0x517c0d){return db[_0x1ee4('0x32')][_0x1ee4('0x4c')](_0x30e15f[_0x1ee4('0x4d')],{})[_0x1ee4('0x2a')](function(_0x7f29fd){var _0x3ce1db=_0x30e15f[_0x1ee4('0x4e')][_0x1ee4('0x2c')]({'plain':!![]});if(!_0x3ce1db)throw new Error(_0x1ee4('0x4f'));if(_0x3ce1db[_0x1ee4('0x50')]===_0x1ee4('0x4e')){var _0x3c1290=_0x7f29fd[_0x1ee4('0x2c')]({'plain':!![]});var _0x5cfc85=_0x1ee4('0x51');return db[_0x1ee4('0x52')][_0x1ee4('0x4a')]({'where':{'name':_0x5cfc85,'userProfileId':_0x3ce1db[_0x1ee4('0x53')]},'raw':!![]})[_0x1ee4('0x2a')](function(_0x1b31a4){if(_0x1b31a4&&_0x1b31a4[_0x1ee4('0x54')]===0x0){return db['UserProfileResource'][_0x1ee4('0x4c')]({'name':_0x3c1290[_0x1ee4('0x2f')],'resourceId':_0x3c1290['id'],'type':_0x1b31a4['name'],'sectionId':_0x1b31a4['id']},{})[_0x1ee4('0x2a')](function(){return _0x7f29fd;});}else{return _0x7f29fd;}})[_0x1ee4('0x4b')](function(_0x1d0bc0){logger[_0x1ee4('0x55')](_0x1ee4('0x56'),_0x1d0bc0);throw _0x1d0bc0;});}return _0x7f29fd;})['then'](respondWithResult(_0x517c0d,0xc9))[_0x1ee4('0x4b')](handleError(_0x517c0d,null));};exports[_0x1ee4('0x29')]=function(_0x2ecae5,_0x16c702){if(_0x2ecae5['body']['id']){delete _0x2ecae5[_0x1ee4('0x4d')]['id'];}return db[_0x1ee4('0x32')][_0x1ee4('0x4a')]({'where':{'id':_0x2ecae5[_0x1ee4('0x48')]['id']}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x16c702,null))[_0x1ee4('0x2a')](saveUpdates(_0x2ecae5[_0x1ee4('0x4d')],null))['then'](respondWithResult(_0x16c702,null))['catch'](handleError(_0x16c702,null));};exports[_0x1ee4('0x2b')]=function(_0x274db0,_0xb318ae){return db['CmList'][_0x1ee4('0x4a')]({'where':{'id':_0x274db0[_0x1ee4('0x48')]['id']}})['then'](handleEntityNotFound(_0xb318ae,null))[_0x1ee4('0x2a')](removeEntity(_0xb318ae,null))[_0x1ee4('0x4b')](handleError(_0xb318ae,null));};exports[_0x1ee4('0x57')]=function(_0x192ffe,_0x378b16){return db[_0x1ee4('0x32')][_0x1ee4('0x57')]()[_0x1ee4('0x2a')](respondWithResult(_0x378b16,null))[_0x1ee4('0x4b')](handleError(_0x378b16,null));};exports[_0x1ee4('0x58')]=function(_0x33627c,_0x1caf33,_0xb453ad){if(_0x33627c['body']['id']){delete _0x33627c[_0x1ee4('0x4d')]['id'];}return db[_0x1ee4('0x32')][_0x1ee4('0x4a')]({'where':{'id':_0x33627c[_0x1ee4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1caf33,null))[_0x1ee4('0x2a')](function(_0x58e1e1){if(_0x58e1e1){_0x33627c['body'][_0x1ee4('0x59')]=_0x58e1e1['id'];return db[_0x1ee4('0x5a')]['create'](_0x33627c['body']);}})['then'](respondWithResult(_0x1caf33,null))[_0x1ee4('0x4b')](handleError(_0x1caf33,null));};exports[_0x1ee4('0x5b')]=function(_0x1d33d2,_0x9baf45,_0x14e23c){var _0x2e38f={'raw':![],'where':{}};var _0x22b751={};var _0x32e950={'count':0x0,'rows':[]};return db['CmList'][_0x1ee4('0x5c')]({'where':{'id':_0x1d33d2[_0x1ee4('0x48')]['id']}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x9baf45,null))[_0x1ee4('0x2a')](function(_0x4981d7){if(_0x4981d7){_0x22b751['model']=_[_0x1ee4('0x38')](db['Disposition']['rawAttributes']);_0x22b751['query']=_[_0x1ee4('0x38')](_0x1d33d2[_0x1ee4('0x37')]);_0x22b751['filters']=_['intersection'](_0x22b751[_0x1ee4('0x36')],_0x22b751[_0x1ee4('0x37')]);_0x2e38f[_0x1ee4('0x3b')]=_[_0x1ee4('0x3a')](_0x22b751[_0x1ee4('0x36')],qs[_0x1ee4('0x3c')](_0x1d33d2['query'][_0x1ee4('0x3c')]));_0x2e38f[_0x1ee4('0x3b')]=_0x2e38f[_0x1ee4('0x3b')][_0x1ee4('0x3d')]?_0x2e38f[_0x1ee4('0x3b')]:_0x22b751[_0x1ee4('0x36')];if(!_0x1d33d2[_0x1ee4('0x37')][_0x1ee4('0x3e')](_0x1ee4('0x3f'))){_0x2e38f[_0x1ee4('0x24')]=qs[_0x1ee4('0x24')](_0x1d33d2[_0x1ee4('0x37')][_0x1ee4('0x24')]);_0x2e38f[_0x1ee4('0x23')]=qs[_0x1ee4('0x23')](_0x1d33d2['query'][_0x1ee4('0x23')]);}_0x2e38f[_0x1ee4('0x40')]=qs[_0x1ee4('0x41')](_0x1d33d2['query'][_0x1ee4('0x41')]);_0x2e38f[_0x1ee4('0x42')]=qs[_0x1ee4('0x39')](_[_0x1ee4('0x5d')](_0x1d33d2['query'],_0x22b751[_0x1ee4('0x39')]));_0x2e38f['where'][_0x1ee4('0x59')]=_0x4981d7['id'];if(_0x1d33d2[_0x1ee4('0x37')][_0x1ee4('0x43')]){_0x2e38f[_0x1ee4('0x42')]=_[_0x1ee4('0x44')](_0x2e38f[_0x1ee4('0x42')],{'$or':_['map'](_0x2e38f[_0x1ee4('0x3b')],function(_0x4d670c){var _0x388f94={};_0x388f94[_0x4d670c]={'$like':'%'+_0x1d33d2['query']['filter']+'%'};return _0x388f94;})});}_0x2e38f=_[_0x1ee4('0x44')]({},_0x2e38f,_0x1d33d2['options']);return db[_0x1ee4('0x5a')][_0x1ee4('0x26')]({'where':_0x2e38f[_0x1ee4('0x42')]})[_0x1ee4('0x2a')](function(_0x5ab323){_0x32e950[_0x1ee4('0x26')]=_0x5ab323;if(_0x1d33d2['query']['includeAll']){_0x2e38f['include']=[{'all':!![]}];}return db[_0x1ee4('0x5a')][_0x1ee4('0x5e')](_0x2e38f);})[_0x1ee4('0x2a')](function(_0x2be051){_0x32e950['rows']=_0x2be051;return _0x32e950;});}})['then'](respondWithFilteredResult(_0x9baf45,_0x2e38f))[_0x1ee4('0x4b')](handleError(_0x9baf45,null));};exports[_0x1ee4('0x5f')]=function(_0x329b36,_0x5344d9,_0x4b4f16){return db[_0x1ee4('0x32')]['find']({'where':{'id':_0x329b36[_0x1ee4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5344d9,null))[_0x1ee4('0x2a')](function(_0x349e33){if(_0x349e33){return _0x349e33[_0x1ee4('0x5f')](_0x329b36[_0x1ee4('0x37')][_0x1ee4('0x60')]);}})[_0x1ee4('0x2a')](respondWithStatusCode(_0x5344d9,null))[_0x1ee4('0x4b')](handleError(_0x5344d9,null));};exports[_0x1ee4('0x61')]=function(_0x4a31c8,_0x16b60a,_0x267720){return db[_0x1ee4('0x32')]['find']({'where':{'id':_0x4a31c8[_0x1ee4('0x48')]['id']}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x16b60a,null))[_0x1ee4('0x2a')](function(_0x5dbee3){if(_0x5dbee3){var _0x14778c=[];var _0x1c7afc={'success':[],'errors':[]};return db[_0x1ee4('0x62')]['describe']()[_0x1ee4('0x2a')](function(_0x11447e){if(_0x4a31c8[_0x1ee4('0x4d')][_0x1ee4('0x63')]&&_['isArray'](_0x4a31c8['body']['tags'])){if(_0x4a31c8['body'][_0x1ee4('0x63')]['length']){_0x4a31c8[_0x1ee4('0x4d')][_0x1ee4('0x63')]=_0x4a31c8[_0x1ee4('0x4d')][_0x1ee4('0x63')][_0x1ee4('0x64')](';')+';';}else{_0x4a31c8[_0x1ee4('0x4d')][_0x1ee4('0x63')]=null;}}else{_0x4a31c8['body'][_0x1ee4('0x63')]=null;}if(_0x4a31c8[_0x1ee4('0x4d')]&&_['isArray'](_0x4a31c8[_0x1ee4('0x4d')])){for(var _0x16569c=0x0;_0x16569c<_0x4a31c8[_0x1ee4('0x4d')][_0x1ee4('0x3d')];_0x16569c+=0x1){_0x4a31c8[_0x1ee4('0x4d')][_0x16569c][_0x1ee4('0x59')]=_0x4a31c8['params']['id'];_0x14778c[_0x1ee4('0x65')](_0x4a31c8[_0x1ee4('0x4d')][_0x16569c]);}return BPromise[_0x1ee4('0x66')](_0x14778c,function(_0x1567fa){return db[_0x1ee4('0x62')][_0x1ee4('0x4c')](_[_0x1ee4('0x67')](_0x1567fa,['ids','id'])||{},{'fields':_[_0x1ee4('0x38')](_0x11447e),'raw':!![]})['then'](function(_0x1ecca4){_0x1c7afc[_0x1ee4('0x68')]['push'](_0x1ecca4[_0x1ee4('0x69')]);})[_0x1ee4('0x4b')](function(_0x4ab9f9){_0x1c7afc['errors'][_0x1ee4('0x65')]({'data':_0x1567fa,'error':_0x4ab9f9[_0x1ee4('0x6a')]});});})[_0x1ee4('0x2a')](function(_0x5b2671){return _0x1c7afc;})[_0x1ee4('0x4b')](function(_0x571265){return _0x571265;});}else{_0x16b60a[_0x1ee4('0x20')](0x190)[_0x1ee4('0x22')]({'message':_0x1ee4('0x6b')});}});}})[_0x1ee4('0x2a')](respondWithResult(_0x16b60a,null))['catch'](handleError(_0x16b60a,null));};exports[_0x1ee4('0x6c')]=function(_0x2ddbe3,_0x3232d5,_0x28ec72){var _0x4da61f;return db[_0x1ee4('0x32')][_0x1ee4('0x4a')]({'where':{'id':_0x2ddbe3[_0x1ee4('0x48')]['id']},'include':[{'model':db[_0x1ee4('0x6d')],'as':'CustomFields'}]})[_0x1ee4('0x2a')](handleEntityNotFound(_0x3232d5,null))[_0x1ee4('0x2a')](function(_0x3eb3fe){if(_0x3eb3fe){_0x4da61f=_0x3eb3fe;return db[_0x1ee4('0x62')][_0x1ee4('0x33')];}})[_0x1ee4('0x2a')](function(_0x279ba4){if(_0x279ba4){var _0x3f7722={};var _0x3d7fa5={};_0x3d7fa5[_0x1ee4('0x36')]=_['concat'](_['keys'](_0x279ba4),_['map'](_0x4da61f[_0x1ee4('0x6e')],function(_0x299a08){return util[_0x1ee4('0x6f')](_0x1ee4('0x70'),_0x299a08['id']);}));_0x3d7fa5['query']=_[_0x1ee4('0x38')](_0x2ddbe3[_0x1ee4('0x37')]);_0x3d7fa5[_0x1ee4('0x39')]=_[_0x1ee4('0x3a')](_0x3d7fa5[_0x1ee4('0x36')],_0x3d7fa5[_0x1ee4('0x37')]);_0x3f7722[_0x1ee4('0x3b')]=_['intersection'](_0x3d7fa5[_0x1ee4('0x36')],qs[_0x1ee4('0x3c')](_0x2ddbe3[_0x1ee4('0x37')]['fields']));_0x3f7722[_0x1ee4('0x3b')]=_0x3f7722[_0x1ee4('0x3b')][_0x1ee4('0x3d')]?_0x3f7722[_0x1ee4('0x3b')]:_0x3d7fa5[_0x1ee4('0x36')];if(!_0x2ddbe3[_0x1ee4('0x37')][_0x1ee4('0x3e')](_0x1ee4('0x3f'))){_0x3f7722['limit']=qs[_0x1ee4('0x24')](_0x2ddbe3[_0x1ee4('0x37')][_0x1ee4('0x24')]);_0x3f7722['offset']=qs['offset'](_0x2ddbe3['query'][_0x1ee4('0x23')]);}_0x3f7722['order']=qs[_0x1ee4('0x41')](_0x2ddbe3['query'][_0x1ee4('0x41')]);_0x3f7722[_0x1ee4('0x42')]=qs[_0x1ee4('0x39')](_[_0x1ee4('0x5d')](_0x2ddbe3[_0x1ee4('0x37')],_0x3d7fa5[_0x1ee4('0x39')]));_0x3f7722[_0x1ee4('0x71')]=!![];if(_0x2ddbe3[_0x1ee4('0x37')][_0x1ee4('0x43')]){_0x3f7722[_0x1ee4('0x42')]=_[_0x1ee4('0x44')](_0x3f7722[_0x1ee4('0x42')],{'$or':_['map'](_0x3f7722[_0x1ee4('0x3b')],function(_0x36578e){var _0xe4de9c={};_0xe4de9c[_0x36578e]={'$like':'%'+_0x2ddbe3[_0x1ee4('0x37')][_0x1ee4('0x43')]+'%'};return _0xe4de9c;})});}_0x3f7722=_[_0x1ee4('0x44')]({},_0x3f7722,_0x2ddbe3[_0x1ee4('0x49')]);return _0x4da61f[_0x1ee4('0x6c')](_0x3f7722);}})[_0x1ee4('0x2a')](respondWithResult(_0x3232d5,null))[_0x1ee4('0x4b')](handleError(_0x3232d5,null));};exports[_0x1ee4('0x72')]=function(_0x3bd633,_0x459d32,_0x1c2fbf){var _0x34548c;var _0x10d350;var _0x323f40;var _0x39a472=_0x3bd633[_0x1ee4('0x48')]['id'];csv_results=[];return db[_0x1ee4('0x73')][_0x1ee4('0x5e')]({'attributes':['id',_0x1ee4('0x2f')],'raw':!![],'order':[_0x1ee4('0x74')]})[_0x1ee4('0x2a')](function(_0x48b04d){_0x34548c=_0x48b04d;var _0x45d3e7=_[_0x1ee4('0x38')](db[_0x1ee4('0x62')][_0x1ee4('0x33')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x1ee4('0x75')]})[_0x1ee4('0x2a')](function(_0x4b4a48){_0x10d350=_0x4b4a48;var _0x1c7d8a=squel[_0x1ee4('0x76')]()[_0x1ee4('0x3c')](_0x45d3e7)[_0x1ee4('0x77')]('cm_contacts','c')[_0x1ee4('0x42')](_0x1ee4('0x78'),_0x39a472)['where'](_0x1ee4('0x79'))[_0x1ee4('0x7a')]();for(var _0x550c15=0x0;_0x550c15<_0x10d350[_0x1ee4('0x3d')];_0x550c15++){_0x1c7d8a[_0x1ee4('0x7b')](_0x1ee4('0x7c')+_0x10d350[_0x550c15]['id'],_0x1ee4('0x7d')+_0x10d350[_0x550c15]['alias']);}for(var _0x550c15=0x0;_0x550c15<_0x34548c[_0x1ee4('0x3d')];_0x550c15++){_0x1c7d8a[_0x1ee4('0x7b')](squel[_0x1ee4('0x76')]()['field'](_0x1ee4('0x7e'))[_0x1ee4('0x77')](_0x1ee4('0x7f'))['where'](_0x1ee4('0x80'),_0x34548c[_0x550c15]['id'])[_0x1ee4('0x42')](_0x1ee4('0x81')),_0x1ee4('0x82')+_0x34548c[_0x550c15]['name']);_0x1c7d8a['field'](squel[_0x1ee4('0x76')]()[_0x1ee4('0x7b')]('description')[_0x1ee4('0x77')](_0x1ee4('0x7f'))[_0x1ee4('0x42')](_0x1ee4('0x80'),_0x34548c[_0x550c15]['id'])[_0x1ee4('0x42')](_0x1ee4('0x81')),'description_additionalPhone_'+_0x34548c[_0x550c15][_0x1ee4('0x2f')]);}var _0x1fc2b2=[];_0x1fc2b2[_0x1ee4('0x65')](_0x1c7d8a[_0x1ee4('0x83')]());BPromise[_0x1ee4('0x66')](_0x1fc2b2,handleQuery)[_0x1ee4('0x2a')](function(_0x44176f){handleQuery(_0x1c7d8a[_0x1ee4('0x83')]());var _0x3544fe=csv_results[0x0];if(!_[_0x1ee4('0x84')](_0x3544fe)){var _0x1c751a=toCsv(_0x3544fe);var _0x201e3c=Date[_0x1ee4('0x85')]();fs['writeFileSync'](util[_0x1ee4('0x6f')](_0x1ee4('0x86'),_0x39a472,_0x201e3c),_0x1c751a);_0x459d32[_0x1ee4('0x87')]('Content-disposition',_0x1ee4('0x88')+util[_0x1ee4('0x6f')](_0x1ee4('0x89'),_0x39a472,_0x201e3c));_0x459d32['setHeader'](_0x1ee4('0x8a'),'text/csv');return _0x459d32['download'](util['format'](_0x1ee4('0x86'),_0x39a472,_0x201e3c));}else{return _0x459d32[_0x1ee4('0x1f')](0xcc);}});});});};exports[_0x1ee4('0x8b')]=function(_0x291b8e,_0x4fe42f,_0x15f0be){var _0x336b81;delete _0x291b8e[_0x1ee4('0x4d')]['id'];return db[_0x1ee4('0x32')][_0x1ee4('0x5c')]({'where':{'id':_0x291b8e['params']['id']}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x4fe42f,null))[_0x1ee4('0x2a')](function(_0x2be8b3){if(_0x2be8b3){return db[_0x1ee4('0x8c')][_0x1ee4('0x8d')](function(_0x339a80){return db[_0x1ee4('0x6d')][_0x1ee4('0x4c')](_0x291b8e[_0x1ee4('0x4d')],{'transaction':_0x339a80})[_0x1ee4('0x2a')](function(_0x27c338){_0x336b81=_0x27c338;return _0x2be8b3[_0x1ee4('0x8e')](_0x27c338,{'transaction':_0x339a80});})[_0x1ee4('0x2a')](function(){var _0x2e8c14={'type':db[_0x1ee4('0x8f')][_0x1ee4('0x90')],'transaction':_0x339a80};switch(_0x291b8e[_0x1ee4('0x4d')][_0x1ee4('0x35')]){case _0x1ee4('0x91'):_0x2e8c14['type']=db['Sequelize'][_0x1ee4('0x90')];break;case _0x1ee4('0x92'):_0x2e8c14[_0x1ee4('0x35')]=db['Sequelize'][_0x1ee4('0x93')];break;case'switch':_0x2e8c14[_0x1ee4('0x35')]=db[_0x1ee4('0x8f')][_0x1ee4('0x94')];_0x2e8c14['defaultValue']=![];break;default:}return db[_0x1ee4('0x8c')][_0x1ee4('0x95')][_0x1ee4('0x96')](_0x1ee4('0x97'),util['format'](_0x1ee4('0x98'),_0x336b81['id']),_0x2e8c14);})[_0x1ee4('0x2a')](function(){return _0x336b81;});});}})[_0x1ee4('0x2a')](respondWithResult(_0x4fe42f,null))[_0x1ee4('0x4b')](handleError(_0x4fe42f,null));};exports[_0x1ee4('0x99')]=function(_0x273433,_0x3f4d39,_0x17bc35){var _0x9c8120={};var _0xc2f259={};var _0x5da6f7;var _0x3b28ec;return db[_0x1ee4('0x32')]['findOne']({'where':{'id':_0x273433[_0x1ee4('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f4d39,null))['then'](function(_0x13f0b5){if(_0x13f0b5){_0x5da6f7=_0x13f0b5;_0xc2f259['model']=_['keys'](db[_0x1ee4('0x6d')][_0x1ee4('0x33')]);_0xc2f259['query']=_[_0x1ee4('0x38')](_0x273433['query']);_0xc2f259['filters']=_[_0x1ee4('0x3a')](_0xc2f259[_0x1ee4('0x36')],_0xc2f259[_0x1ee4('0x37')]);_0x9c8120[_0x1ee4('0x3b')]=_['intersection'](_0xc2f259[_0x1ee4('0x36')],qs[_0x1ee4('0x3c')](_0x273433[_0x1ee4('0x37')][_0x1ee4('0x3c')]));_0x9c8120[_0x1ee4('0x3b')]=_0x9c8120[_0x1ee4('0x3b')]['length']?_0x9c8120[_0x1ee4('0x3b')]:_0xc2f259[_0x1ee4('0x36')];_0x9c8120['order']=qs[_0x1ee4('0x41')](_0x273433[_0x1ee4('0x37')][_0x1ee4('0x41')]);_0x9c8120[_0x1ee4('0x42')]=qs[_0x1ee4('0x39')](_[_0x1ee4('0x5d')](_0x273433[_0x1ee4('0x37')],_0xc2f259['filters']));_0x9c8120[_0x1ee4('0x42')]=_[_0x1ee4('0x44')](_0x9c8120[_0x1ee4('0x42')],{'$or':[{'ListId':_0x13f0b5['id']},{'ListId':null}]});if(_0x273433['query'][_0x1ee4('0x43')]){_0x9c8120[_0x1ee4('0x42')]=_[_0x1ee4('0x44')](_0x9c8120['where'],{'$or':_['map'](_0x9c8120[_0x1ee4('0x3b')],function(_0x2a1a7c){var _0x298f2a={};_0x298f2a[_0x2a1a7c]={'$like':'%'+_0x273433[_0x1ee4('0x37')]['filter']+'%'};return _0x298f2a;})});}_0x9c8120=_[_0x1ee4('0x44')]({},_0x9c8120,_0x273433[_0x1ee4('0x49')]);return db[_0x1ee4('0x6d')][_0x1ee4('0x9a')](_0x9c8120);}})['then'](respondWithResult(_0x3f4d39,null))['catch'](handleError(_0x3f4d39,null));};exports[_0x1ee4('0x9b')]=function(_0x4560bc,_0x35172){return db[_0x1ee4('0x6d')][_0x1ee4('0x9a')]({'where':{'ListId':null}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x35172,null))[_0x1ee4('0x2a')](function(_0xf1f6b2){return _0xf1f6b2;})['then'](respondWithResult(_0x35172,null))[_0x1ee4('0x4b')](handleError(_0x35172,null));};exports[_0x1ee4('0x9c')]=function(_0x42ed9b,_0x4da481,_0x52551c){return db[_0x1ee4('0x32')][_0x1ee4('0x4a')]({'where':{'id':_0x42ed9b['params']['id']}})['then'](handleEntityNotFound(_0x4da481,null))[_0x1ee4('0x2a')](function(_0x40066d){if(_0x40066d){return _0x40066d[_0x1ee4('0x9c')](_0x42ed9b[_0x1ee4('0x4d')][_0x1ee4('0x60')],_[_0x1ee4('0x67')](_0x42ed9b['body'],[_0x1ee4('0x60'),'id'])||{})[_0x1ee4('0x9d')](function(_0x525e14){for(var _0x2e4b09=0x0;_0x2e4b09<_0x42ed9b['body'][_0x1ee4('0x60')]['length'];_0x2e4b09+=0x1){socket[_0x1ee4('0x9e')](_0x1ee4('0x9f'),{'UserId':Number(_0x42ed9b[_0x1ee4('0x4d')][_0x1ee4('0x60')][_0x2e4b09]),'CmListId':Number(_0x42ed9b[_0x1ee4('0x48')]['id'])});}return _0x525e14;});}})[_0x1ee4('0x2a')](respondWithResult(_0x4da481,null))[_0x1ee4('0x4b')](handleError(_0x4da481,null));};exports[_0x1ee4('0xa0')]=function(_0x48f1d6,_0x36583f,_0xfe639d){return db['CmList']['find']({'where':{'id':_0x48f1d6[_0x1ee4('0x48')]['id']}})['then'](handleEntityNotFound(_0x36583f,null))[_0x1ee4('0x2a')](function(_0x4638c0){if(_0x4638c0){return _0x4638c0['removeAgents'](_0x48f1d6['query']['ids'])[_0x1ee4('0x2a')](function(){if(_['isArray'](_0x48f1d6['query'][_0x1ee4('0x60')])){for(var _0x219e9c=0x0;_0x219e9c<_0x48f1d6[_0x1ee4('0x37')][_0x1ee4('0x60')][_0x1ee4('0x3d')];_0x219e9c+=0x1){socket[_0x1ee4('0x9e')](_0x1ee4('0xa1'),{'UserId':Number(_0x48f1d6[_0x1ee4('0x37')][_0x1ee4('0x60')][_0x219e9c]),'CmListId':Number(_0x48f1d6[_0x1ee4('0x48')]['id'])});}}else{socket[_0x1ee4('0x9e')](_0x1ee4('0xa1'),{'UserId':Number(_0x48f1d6[_0x1ee4('0x37')][_0x1ee4('0x60')]),'CmListId':Number(_0x48f1d6[_0x1ee4('0x48')]['id'])});}});}})[_0x1ee4('0x2a')](respondWithStatusCode(_0x36583f,null))[_0x1ee4('0x4b')](handleError(_0x36583f,null));};exports['getAgents']=function(_0x3b6163,_0x4248eb,_0x289465){var _0x4d9eb0={};var _0x2f04da={};var _0x320a2d;var _0x56f255;return db[_0x1ee4('0x32')]['findOne']({'where':{'id':_0x3b6163[_0x1ee4('0x48')]['id']}})[_0x1ee4('0x2a')](handleEntityNotFound(_0x4248eb,null))[_0x1ee4('0x2a')](function(_0x389ef0){if(_0x389ef0){_0x320a2d=_0x389ef0;_0x2f04da[_0x1ee4('0x36')]=_[_0x1ee4('0x38')](db[_0x1ee4('0xa2')][_0x1ee4('0x33')]);_0x2f04da[_0x1ee4('0x37')]=_[_0x1ee4('0x38')](_0x3b6163[_0x1ee4('0x37')]);_0x2f04da[_0x1ee4('0x39')]=_[_0x1ee4('0x3a')](_0x2f04da[_0x1ee4('0x36')],_0x2f04da[_0x1ee4('0x37')]);_0x4d9eb0[_0x1ee4('0x3b')]=_[_0x1ee4('0x3a')](_0x2f04da[_0x1ee4('0x36')],qs[_0x1ee4('0x3c')](_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x3c')]));_0x4d9eb0[_0x1ee4('0x3b')]=_0x4d9eb0['attributes']['length']?_0x4d9eb0['attributes']:_0x2f04da[_0x1ee4('0x36')];_0x4d9eb0[_0x1ee4('0x40')]=qs['sort'](_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x41')]);_0x4d9eb0[_0x1ee4('0x42')]=qs[_0x1ee4('0x39')](_[_0x1ee4('0x5d')](_0x3b6163[_0x1ee4('0x37')],_0x2f04da['filters']));if(_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x43')]){_0x4d9eb0[_0x1ee4('0x42')]=_['merge'](_0x4d9eb0[_0x1ee4('0x42')],{'$or':_['map'](_0x4d9eb0[_0x1ee4('0x3b')],function(_0x495e56){var _0x7f8fd5={};_0x7f8fd5[_0x495e56]={'$like':'%'+_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x43')]+'%'};return _0x7f8fd5;})});}_0x4d9eb0=_[_0x1ee4('0x44')]({},_0x4d9eb0,_0x3b6163[_0x1ee4('0x49')]);return _0x320a2d[_0x1ee4('0xa3')](_0x4d9eb0);}})[_0x1ee4('0x2a')](function(_0x2f8138){if(_0x2f8138){_0x56f255=_0x2f8138[_0x1ee4('0x3d')];if(!_0x3b6163[_0x1ee4('0x37')]['hasOwnProperty'](_0x1ee4('0x3f'))){_0x4d9eb0['limit']=qs[_0x1ee4('0x24')](_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x24')]);_0x4d9eb0['offset']=qs[_0x1ee4('0x23')](_0x3b6163[_0x1ee4('0x37')][_0x1ee4('0x23')]);}return _0x320a2d[_0x1ee4('0xa3')](_0x4d9eb0);}})[_0x1ee4('0x2a')](function(_0x335eda){if(_0x335eda){return _0x335eda?{'count':_0x56f255,'rows':_0x335eda}:null;}})[_0x1ee4('0x2a')](respondWithResult(_0x4248eb,null))['catch'](handleError(_0x4248eb,null));};function handleQuery(_0x546777){logger[_0x1ee4('0xa4')](_0x546777);return db['sequelize'][_0x1ee4('0x37')](_0x546777)[_0x1ee4('0x9d')](function(_0x32fa6e){csv_results[_0x1ee4('0x65')](_0x32fa6e);})[_0x1ee4('0x4b')](function(_0x5357e9){logger[_0x1ee4('0x55')](_0x5357e9[_0x1ee4('0x6a')]);});} \ No newline at end of file +var _0x7424=['fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','create','body','user','get','role','Lists','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CmContact','isArray','tags','join','push','each','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','from','distinct','field','c.cf_','customField_','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','switch','BOOLEAN','queryInterface','cm_contacts','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','message','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','CmList','rawAttributes'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x7424,0x72));var _0x4742=function(_0x32d667,_0x409c3d){_0x32d667=_0x32d667-0x0;var _0x4776d2=_0x7424[_0x32d667];return _0x4776d2;};'use strict';var emlformat=require(_0x4742('0x0'));var rimraf=require(_0x4742('0x1'));var zipdir=require(_0x4742('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4742('0x3'));var moment=require(_0x4742('0x4'));var BPromise=require(_0x4742('0x5'));var Mustache=require(_0x4742('0x6'));var util=require('util');var path=require(_0x4742('0x7'));var sox=require('sox');var csv=require(_0x4742('0x8'));var ejs=require(_0x4742('0x9'));var fs=require('fs');var fs_extra=require(_0x4742('0xa'));var _=require(_0x4742('0xb'));var squel=require(_0x4742('0xc'));var crypto=require(_0x4742('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4742('0xe'));var toCsv=require(_0x4742('0x8'));var querystring=require(_0x4742('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4742('0x10'));var qs=require(_0x4742('0x11'));var as=require(_0x4742('0x12'));var hardwareService=require(_0x4742('0x13'));var logger=require(_0x4742('0x14'))(_0x4742('0x15'));var utils=require(_0x4742('0x16'));var config=require(_0x4742('0x17'));var licenseUtil=require(_0x4742('0x18'));var db=require(_0x4742('0x19'))['db'];var csv_results;config[_0x4742('0x1a')]=_['defaults'](config[_0x4742('0x1a')],{'host':_0x4742('0x1b'),'port':0x18eb});var socket=require(_0x4742('0x1c'))(new Redis(config[_0x4742('0x1a')]));require(_0x4742('0x1d'))[_0x4742('0x1e')](socket);function respondWithStatusCode(_0x5e744b,_0x47653b){_0x47653b=_0x47653b||0xcc;return function(_0x5000a6){if(_0x5000a6){return _0x5e744b['sendStatus'](_0x47653b);}return _0x5e744b[_0x4742('0x1f')](_0x47653b)[_0x4742('0x20')]();};}function respondWithResult(_0x3e939b,_0x4cd238){_0x4cd238=_0x4cd238||0xc8;return function(_0xbeaee5){if(_0xbeaee5){return _0x3e939b['status'](_0x4cd238)[_0x4742('0x21')](_0xbeaee5);}};}function respondWithFilteredResult(_0x51a915,_0x4ef2e8){return function(_0x4f44c8){if(_0x4f44c8){var _0x432f6b=typeof _0x4ef2e8[_0x4742('0x22')]===_0x4742('0x23')&&typeof _0x4ef2e8[_0x4742('0x24')]===_0x4742('0x23');var _0x58145d=_0x4f44c8[_0x4742('0x25')];var _0x2bd436=_0x432f6b?0x0:_0x4ef2e8[_0x4742('0x22')];var _0x3bc9ae=_0x432f6b?_0x4f44c8[_0x4742('0x25')]:_0x4ef2e8[_0x4742('0x22')]+_0x4ef2e8[_0x4742('0x24')];var _0x5c5717;if(_0x3bc9ae>=_0x58145d){_0x3bc9ae=_0x58145d;_0x5c5717=0xc8;}else{_0x5c5717=0xce;}_0x51a915[_0x4742('0x1f')](_0x5c5717);return _0x51a915[_0x4742('0x26')](_0x4742('0x27'),_0x2bd436+'-'+_0x3bc9ae+'/'+_0x58145d)[_0x4742('0x21')](_0x4f44c8);}return null;};}function patchUpdates(_0x5e6a55){return function(_0x40c29a){try{jsonpatch[_0x4742('0x28')](_0x40c29a,_0x5e6a55,!![]);}catch(_0x583cc2){return BPromise[_0x4742('0x29')](_0x583cc2);}return _0x40c29a[_0x4742('0x2a')]();};}function saveUpdates(_0x1c5290,_0x393e0b){return function(_0x37ad03){if(_0x37ad03){return _0x37ad03[_0x4742('0x2b')](_0x1c5290)['then'](function(_0x56b85d){return _0x56b85d;});}return null;};}function removeEntity(_0x3d5f7c,_0x2c0373){return function(_0x5e8811){if(_0x5e8811){return _0x5e8811['destroy']()[_0x4742('0x2c')](function(){var _0xb8aaae=_0x5e8811['get']({'plain':!![]});var _0x3742bd='Lists';return db['UserProfileResource'][_0x4742('0x2d')]({'where':{'type':_0x3742bd,'resourceId':_0xb8aaae['id']}})[_0x4742('0x2c')](function(){return _0x5e8811;});})[_0x4742('0x2c')](function(){_0x3d5f7c[_0x4742('0x1f')](0xcc)[_0x4742('0x20')]();});}};}function handleEntityNotFound(_0x1d841b,_0x183929){return function(_0x19f977){if(!_0x19f977){_0x1d841b['sendStatus'](0x194);}return _0x19f977;};}function handleError(_0x3dbba7,_0x30a9c0){_0x30a9c0=_0x30a9c0||0x1f4;return function(_0x534a61){logger[_0x4742('0x2e')](_0x534a61[_0x4742('0x2f')]);if(_0x534a61['name']){delete _0x534a61[_0x4742('0x30')];}_0x3dbba7['status'](_0x30a9c0)['send'](_0x534a61);};}exports['index']=function(_0x4c6715,_0x2a7a7b){var _0x560376={},_0x2150ec={},_0x515d12={'count':0x0,'rows':[]};var _0x403f80=_['map'](db[_0x4742('0x31')][_0x4742('0x32')],function(_0x2d91d4){return{'name':_0x2d91d4[_0x4742('0x33')],'type':_0x2d91d4[_0x4742('0x34')][_0x4742('0x35')]};});_0x2150ec[_0x4742('0x36')]=_[_0x4742('0x37')](_0x403f80,_0x4742('0x30'));_0x2150ec[_0x4742('0x38')]=_['keys'](_0x4c6715['query']);_0x2150ec[_0x4742('0x39')]=_['intersection'](_0x2150ec[_0x4742('0x36')],_0x2150ec[_0x4742('0x38')]);_0x560376[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x2150ec[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x4c6715[_0x4742('0x38')][_0x4742('0x3c')]));_0x560376[_0x4742('0x3a')]=_0x560376[_0x4742('0x3a')][_0x4742('0x3d')]?_0x560376['attributes']:_0x2150ec[_0x4742('0x36')];if(!_0x4c6715['query'][_0x4742('0x3e')]('nolimit')){_0x560376['limit']=qs[_0x4742('0x24')](_0x4c6715[_0x4742('0x38')][_0x4742('0x24')]);_0x560376[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x4c6715[_0x4742('0x38')][_0x4742('0x22')]);}_0x560376[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x4c6715[_0x4742('0x38')][_0x4742('0x40')]);_0x560376[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x4c6715['query'],_0x2150ec[_0x4742('0x39')]),_0x403f80);if(_0x4c6715['query']['filter']){_0x560376[_0x4742('0x41')]=_[_0x4742('0x43')](_0x560376[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x403f80,function(_0x344843){if(_0x344843[_0x4742('0x34')]!==_0x4742('0x44')){var _0x5ebb89={};_0x5ebb89[_0x344843[_0x4742('0x30')]]={'$like':'%'+_0x4c6715[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x5ebb89;}})});}_0x560376=_[_0x4742('0x43')]({},_0x560376,_0x4c6715[_0x4742('0x46')]);var _0x213e0f={'where':_0x560376[_0x4742('0x41')]};return db['CmList'][_0x4742('0x25')](_0x213e0f)[_0x4742('0x2c')](function(_0x421153){_0x515d12[_0x4742('0x25')]=_0x421153;if(_0x4c6715[_0x4742('0x38')][_0x4742('0x47')]){_0x560376[_0x4742('0x48')]=[{'all':!![]}];}return db[_0x4742('0x31')][_0x4742('0x49')](_0x560376);})[_0x4742('0x2c')](function(_0x61f779){_0x515d12[_0x4742('0x4a')]=_0x61f779;return _0x515d12;})[_0x4742('0x2c')](respondWithFilteredResult(_0x2a7a7b,_0x560376))[_0x4742('0x4b')](handleError(_0x2a7a7b,null));};exports['show']=function(_0x2e02d5,_0x165b35){var _0x344c67={'raw':![],'where':{'id':_0x2e02d5[_0x4742('0x4c')]['id']}},_0x2a06ef={};_0x2a06ef[_0x4742('0x36')]=_['keys'](db[_0x4742('0x31')][_0x4742('0x32')]);_0x2a06ef[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x2e02d5[_0x4742('0x38')]);_0x2a06ef[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x2a06ef[_0x4742('0x36')],_0x2a06ef[_0x4742('0x38')]);_0x344c67[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x2a06ef[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x2e02d5[_0x4742('0x38')][_0x4742('0x3c')]));_0x344c67[_0x4742('0x3a')]=_0x344c67['attributes'][_0x4742('0x3d')]?_0x344c67[_0x4742('0x3a')]:_0x2a06ef[_0x4742('0x36')];if(_0x2e02d5['query']['includeAll']){_0x344c67[_0x4742('0x48')]=[{'all':!![]}];}_0x344c67=_[_0x4742('0x43')]({},_0x344c67,_0x2e02d5['options']);return db['CmList']['find'](_0x344c67)['then'](handleEntityNotFound(_0x165b35,null))['then'](respondWithResult(_0x165b35,null))[_0x4742('0x4b')](handleError(_0x165b35,null));};exports['create']=function(_0x30a66c,_0x1adfa8){return db[_0x4742('0x31')][_0x4742('0x4e')](_0x30a66c[_0x4742('0x4f')],{})[_0x4742('0x2c')](function(_0x49a83d){var _0x293683=_0x30a66c[_0x4742('0x50')][_0x4742('0x51')]({'plain':!![]});if(!_0x293683)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293683[_0x4742('0x52')]===_0x4742('0x50')){var _0x492597=_0x49a83d[_0x4742('0x51')]({'plain':!![]});var _0x4ee10f=_0x4742('0x53');return db[_0x4742('0x54')][_0x4742('0x55')]({'where':{'name':_0x4ee10f,'userProfileId':_0x293683[_0x4742('0x56')]},'raw':!![]})['then'](function(_0x910960){if(_0x910960&&_0x910960[_0x4742('0x57')]===0x0){return db[_0x4742('0x58')][_0x4742('0x4e')]({'name':_0x492597[_0x4742('0x30')],'resourceId':_0x492597['id'],'type':_0x910960[_0x4742('0x30')],'sectionId':_0x910960['id']},{})[_0x4742('0x2c')](function(){return _0x49a83d;});}else{return _0x49a83d;}})['catch'](function(_0x1b2cfa){logger['error'](_0x4742('0x59'),_0x1b2cfa);throw _0x1b2cfa;});}return _0x49a83d;})['then'](respondWithResult(_0x1adfa8,0xc9))['catch'](handleError(_0x1adfa8,null));};exports[_0x4742('0x2b')]=function(_0x334599,_0x33f1f4){if(_0x334599[_0x4742('0x4f')]['id']){delete _0x334599[_0x4742('0x4f')]['id'];}return db[_0x4742('0x31')]['find']({'where':{'id':_0x334599[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x33f1f4,null))[_0x4742('0x2c')](saveUpdates(_0x334599[_0x4742('0x4f')],null))['then'](respondWithResult(_0x33f1f4,null))['catch'](handleError(_0x33f1f4,null));};exports[_0x4742('0x2d')]=function(_0x333275,_0x23c9aa){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x333275[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x23c9aa,null))[_0x4742('0x2c')](removeEntity(_0x23c9aa,null))[_0x4742('0x4b')](handleError(_0x23c9aa,null));};exports[_0x4742('0x5a')]=function(_0x2e0528,_0x3b0444){return db[_0x4742('0x31')]['describe']()[_0x4742('0x2c')](respondWithResult(_0x3b0444,null))[_0x4742('0x4b')](handleError(_0x3b0444,null));};exports['addDisposition']=function(_0x10986e,_0xf75056,_0x5aca6f){if(_0x10986e[_0x4742('0x4f')]['id']){delete _0x10986e['body']['id'];}return db['CmList'][_0x4742('0x55')]({'where':{'id':_0x10986e['params']['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0xf75056,null))[_0x4742('0x2c')](function(_0x26b267){if(_0x26b267){_0x10986e['body'][_0x4742('0x5b')]=_0x26b267['id'];return db[_0x4742('0x5c')][_0x4742('0x4e')](_0x10986e[_0x4742('0x4f')]);}})[_0x4742('0x2c')](respondWithResult(_0xf75056,null))[_0x4742('0x4b')](handleError(_0xf75056,null));};exports[_0x4742('0x5d')]=function(_0x3c3ca9,_0x269b37,_0x86467){var _0x17a3e9={'raw':![],'where':{}};var _0x3f79c0={};var _0x5105e9={'count':0x0,'rows':[]};return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x3c3ca9[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x269b37,null))[_0x4742('0x2c')](function(_0x52cb38){if(_0x52cb38){_0x3f79c0[_0x4742('0x36')]=_[_0x4742('0x4d')](db['Disposition'][_0x4742('0x32')]);_0x3f79c0[_0x4742('0x38')]=_['keys'](_0x3c3ca9['query']);_0x3f79c0[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x3f79c0[_0x4742('0x36')],_0x3f79c0['query']);_0x17a3e9[_0x4742('0x3a')]=_['intersection'](_0x3f79c0[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x3c3ca9['query'][_0x4742('0x3c')]));_0x17a3e9[_0x4742('0x3a')]=_0x17a3e9['attributes']['length']?_0x17a3e9[_0x4742('0x3a')]:_0x3f79c0['model'];if(!_0x3c3ca9[_0x4742('0x38')][_0x4742('0x3e')](_0x4742('0x5f'))){_0x17a3e9[_0x4742('0x24')]=qs[_0x4742('0x24')](_0x3c3ca9[_0x4742('0x38')]['limit']);_0x17a3e9[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x3c3ca9[_0x4742('0x38')][_0x4742('0x22')]);}_0x17a3e9[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x3c3ca9[_0x4742('0x38')][_0x4742('0x40')]);_0x17a3e9[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x3c3ca9['query'],_0x3f79c0[_0x4742('0x39')]));_0x17a3e9[_0x4742('0x41')][_0x4742('0x5b')]=_0x52cb38['id'];if(_0x3c3ca9[_0x4742('0x38')][_0x4742('0x45')]){_0x17a3e9[_0x4742('0x41')]=_[_0x4742('0x43')](_0x17a3e9[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x17a3e9[_0x4742('0x3a')],function(_0x244d29){var _0x200f2f={};_0x200f2f[_0x244d29]={'$like':'%'+_0x3c3ca9[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x200f2f;})});}_0x17a3e9=_[_0x4742('0x43')]({},_0x17a3e9,_0x3c3ca9[_0x4742('0x46')]);return db[_0x4742('0x5c')][_0x4742('0x25')]({'where':_0x17a3e9[_0x4742('0x41')]})[_0x4742('0x2c')](function(_0x50317f){_0x5105e9['count']=_0x50317f;if(_0x3c3ca9[_0x4742('0x38')]['includeAll']){_0x17a3e9[_0x4742('0x48')]=[{'all':!![]}];}return db[_0x4742('0x5c')][_0x4742('0x49')](_0x17a3e9);})['then'](function(_0x2b205e){_0x5105e9[_0x4742('0x4a')]=_0x2b205e;return _0x5105e9;});}})[_0x4742('0x2c')](respondWithFilteredResult(_0x269b37,_0x17a3e9))['catch'](handleError(_0x269b37,null));};exports[_0x4742('0x60')]=function(_0x3fa6f2,_0x32ea7b,_0x4fbb6d){return db[_0x4742('0x31')]['find']({'where':{'id':_0x3fa6f2['params']['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x32ea7b,null))[_0x4742('0x2c')](function(_0x565979){if(_0x565979){return _0x565979[_0x4742('0x60')](_0x3fa6f2[_0x4742('0x38')][_0x4742('0x61')]);}})[_0x4742('0x2c')](respondWithStatusCode(_0x32ea7b,null))[_0x4742('0x4b')](handleError(_0x32ea7b,null));};exports['addContacts']=function(_0x4d9ec8,_0x1bf127,_0x3b5f21){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x4d9ec8[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x1bf127,null))[_0x4742('0x2c')](function(_0x43a33c){if(_0x43a33c){var _0x483eee=[];var _0x4a6a19={'success':[],'errors':[]};return db[_0x4742('0x62')][_0x4742('0x5a')]()['then'](function(_0x2a04d0){if(_0x4d9ec8[_0x4742('0x4f')]['tags']&&_[_0x4742('0x63')](_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')])){if(_0x4d9ec8['body'][_0x4742('0x64')]['length']){_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')]=_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')][_0x4742('0x65')](';')+';';}else{_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')]=null;}}else{_0x4d9ec8['body'][_0x4742('0x64')]=null;}if(_0x4d9ec8[_0x4742('0x4f')]&&_[_0x4742('0x63')](_0x4d9ec8['body'])){for(var _0x2bff11=0x0;_0x2bff11<_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x3d')];_0x2bff11+=0x1){_0x4d9ec8[_0x4742('0x4f')][_0x2bff11][_0x4742('0x5b')]=_0x4d9ec8[_0x4742('0x4c')]['id'];_0x483eee[_0x4742('0x66')](_0x4d9ec8[_0x4742('0x4f')][_0x2bff11]);}return BPromise[_0x4742('0x67')](_0x483eee,function(_0x3267f3){return db[_0x4742('0x62')]['create'](_['omit'](_0x3267f3,[_0x4742('0x61'),'id'])||{},{'fields':_[_0x4742('0x4d')](_0x2a04d0),'raw':!![]})[_0x4742('0x2c')](function(_0xc923b2){_0x4a6a19[_0x4742('0x68')][_0x4742('0x66')](_0xc923b2[_0x4742('0x69')]);})[_0x4742('0x4b')](function(_0x2e96e7){_0x4a6a19[_0x4742('0x6a')][_0x4742('0x66')]({'data':_0x3267f3,'error':_0x2e96e7['message']});});})[_0x4742('0x2c')](function(_0x21390a){return _0x4a6a19;})[_0x4742('0x4b')](function(_0x2750a4){return _0x2750a4;});}else{_0x1bf127[_0x4742('0x1f')](0x190)['json']({'message':_0x4742('0x6b')});}});}})[_0x4742('0x2c')](respondWithResult(_0x1bf127,null))[_0x4742('0x4b')](handleError(_0x1bf127,null));};exports[_0x4742('0x6c')]=function(_0x5e6373,_0x31ba32,_0xdcd431){var _0x188f06;return db['CmList']['find']({'where':{'id':_0x5e6373[_0x4742('0x4c')]['id']},'include':[{'model':db[_0x4742('0x6d')],'as':'CustomFields'}]})[_0x4742('0x2c')](handleEntityNotFound(_0x31ba32,null))['then'](function(_0x2ac468){if(_0x2ac468){_0x188f06=_0x2ac468;return db[_0x4742('0x62')]['rawAttributes'];}})[_0x4742('0x2c')](function(_0x51629a){if(_0x51629a){var _0x2323d5={};var _0x579f0f={};_0x579f0f['model']=_[_0x4742('0x6e')](_[_0x4742('0x4d')](_0x51629a),_[_0x4742('0x37')](_0x188f06[_0x4742('0x6f')],function(_0x3aab8f){return util['format'](_0x4742('0x70'),_0x3aab8f['id']);}));_0x579f0f[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x5e6373['query']);_0x579f0f['filters']=_[_0x4742('0x3b')](_0x579f0f[_0x4742('0x36')],_0x579f0f[_0x4742('0x38')]);_0x2323d5['attributes']=_['intersection'](_0x579f0f[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x5e6373[_0x4742('0x38')][_0x4742('0x3c')]));_0x2323d5[_0x4742('0x3a')]=_0x2323d5[_0x4742('0x3a')][_0x4742('0x3d')]?_0x2323d5['attributes']:_0x579f0f[_0x4742('0x36')];if(!_0x5e6373[_0x4742('0x38')][_0x4742('0x3e')](_0x4742('0x5f'))){_0x2323d5['limit']=qs[_0x4742('0x24')](_0x5e6373[_0x4742('0x38')]['limit']);_0x2323d5['offset']=qs[_0x4742('0x22')](_0x5e6373[_0x4742('0x38')]['offset']);}_0x2323d5[_0x4742('0x3f')]=qs['sort'](_0x5e6373[_0x4742('0x38')][_0x4742('0x40')]);_0x2323d5[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x5e6373[_0x4742('0x38')],_0x579f0f[_0x4742('0x39')]));_0x2323d5['raw']=!![];if(_0x5e6373['query'][_0x4742('0x45')]){_0x2323d5[_0x4742('0x41')]=_[_0x4742('0x43')](_0x2323d5[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x2323d5[_0x4742('0x3a')],function(_0x45a351){var _0x3e641e={};_0x3e641e[_0x45a351]={'$like':'%'+_0x5e6373['query']['filter']+'%'};return _0x3e641e;})});}_0x2323d5=_[_0x4742('0x43')]({},_0x2323d5,_0x5e6373[_0x4742('0x46')]);return _0x188f06['getContacts'](_0x2323d5);}})[_0x4742('0x2c')](respondWithResult(_0x31ba32,null))['catch'](handleError(_0x31ba32,null));};exports[_0x4742('0x71')]=function(_0x54e3f5,_0x7669a4,_0x81d480){var _0x4974ca;var _0x2f1657;var _0x5c6aa3;var _0x2f74d1=_0x54e3f5['params']['id'];csv_results=[];return db[_0x4742('0x72')][_0x4742('0x49')]({'attributes':['id',_0x4742('0x30')],'raw':!![],'order':[_0x4742('0x73')]})[_0x4742('0x2c')](function(_0x204e3a){_0x4974ca=_0x204e3a;var _0x155781=_[_0x4742('0x4d')](db[_0x4742('0x62')][_0x4742('0x32')]);return db[_0x4742('0x6d')][_0x4742('0x49')]({'raw':!![],'attributes':['id',_0x4742('0x74')]})['then'](function(_0x3d13d9){_0x2f1657=_0x3d13d9;var _0x2267e0=squel['select']()['fields'](_0x155781)[_0x4742('0x75')]('cm_contacts','c')[_0x4742('0x41')]('c.ListId\x20=\x20?',_0x2f74d1)['where']('c.deletedAt\x20is\x20null')[_0x4742('0x76')]();for(var _0x45dcbf=0x0;_0x45dcbf<_0x2f1657[_0x4742('0x3d')];_0x45dcbf++){_0x2267e0[_0x4742('0x77')](_0x4742('0x78')+_0x2f1657[_0x45dcbf]['id'],_0x4742('0x79')+_0x2f1657[_0x45dcbf][_0x4742('0x74')]);}for(var _0x45dcbf=0x0;_0x45dcbf<_0x4974ca[_0x4742('0x3d')];_0x45dcbf++){_0x2267e0[_0x4742('0x77')](squel[_0x4742('0x7a')]()[_0x4742('0x77')](_0x4742('0x7b'))['from'](_0x4742('0x7c'))[_0x4742('0x41')]('ItemTypeId\x20=\x20?',_0x4974ca[_0x45dcbf]['id'])[_0x4742('0x41')](_0x4742('0x7d')),_0x4742('0x7e')+_0x4974ca[_0x45dcbf][_0x4742('0x30')]);_0x2267e0['field'](squel[_0x4742('0x7a')]()[_0x4742('0x77')](_0x4742('0x7f'))[_0x4742('0x75')](_0x4742('0x7c'))[_0x4742('0x41')]('ItemTypeId\x20=\x20?',_0x4974ca[_0x45dcbf]['id'])['where'](_0x4742('0x7d')),_0x4742('0x80')+_0x4974ca[_0x45dcbf][_0x4742('0x30')]);}var _0x3bba48=[];_0x3bba48[_0x4742('0x66')](_0x2267e0['toString']());BPromise['each'](_0x3bba48,handleQuery)[_0x4742('0x2c')](function(_0x43b541){handleQuery(_0x2267e0[_0x4742('0x81')]());var _0x53de96=csv_results[0x0];if(!_['isEmpty'](_0x53de96)){var _0x19e9ab=toCsv(_0x53de96);var _0x597358=Date['now']();fs[_0x4742('0x82')](util['format'](_0x4742('0x83'),_0x2f74d1,_0x597358),_0x19e9ab);_0x7669a4[_0x4742('0x84')](_0x4742('0x85'),_0x4742('0x86')+util[_0x4742('0x87')](_0x4742('0x88'),_0x2f74d1,_0x597358));_0x7669a4[_0x4742('0x84')](_0x4742('0x89'),_0x4742('0x8a'));return _0x7669a4[_0x4742('0x8b')](util[_0x4742('0x87')](_0x4742('0x83'),_0x2f74d1,_0x597358));}else{return _0x7669a4[_0x4742('0x8c')](0xcc);}});});});};exports[_0x4742('0x8d')]=function(_0x5c7e78,_0x258abe,_0x61e9af){var _0x3fd978;delete _0x5c7e78[_0x4742('0x4f')]['id'];return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x5c7e78[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x258abe,null))[_0x4742('0x2c')](function(_0x45a1c4){if(_0x45a1c4){return db[_0x4742('0x8e')][_0x4742('0x8f')](function(_0x1a84ce){return db[_0x4742('0x6d')][_0x4742('0x4e')](_0x5c7e78['body'],{'transaction':_0x1a84ce})[_0x4742('0x2c')](function(_0x4e6f7f){_0x3fd978=_0x4e6f7f;return _0x45a1c4[_0x4742('0x90')](_0x4e6f7f,{'transaction':_0x1a84ce});})[_0x4742('0x2c')](function(){var _0x519130={'type':db[_0x4742('0x91')][_0x4742('0x92')],'transaction':_0x1a84ce};switch(_0x5c7e78['body'][_0x4742('0x34')]){case _0x4742('0x93'):_0x519130[_0x4742('0x34')]=db[_0x4742('0x91')][_0x4742('0x92')];break;case'number':_0x519130[_0x4742('0x34')]=db['Sequelize']['INTEGER'];break;case _0x4742('0x94'):_0x519130[_0x4742('0x34')]=db[_0x4742('0x91')][_0x4742('0x95')];_0x519130['defaultValue']=![];break;default:}return db[_0x4742('0x8e')][_0x4742('0x96')]['addColumn'](_0x4742('0x97'),util[_0x4742('0x87')](_0x4742('0x98'),_0x3fd978['id']),_0x519130);})[_0x4742('0x2c')](function(){return _0x3fd978;});});}})[_0x4742('0x2c')](respondWithResult(_0x258abe,null))[_0x4742('0x4b')](handleError(_0x258abe,null));};exports[_0x4742('0x99')]=function(_0x284d55,_0x51c808,_0x2fb7a8){var _0x3690d4={};var _0x1ec0fc={};var _0x2b4c82;var _0x5af5e8;return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x284d55[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x51c808,null))[_0x4742('0x2c')](function(_0x2364cf){if(_0x2364cf){_0x2b4c82=_0x2364cf;_0x1ec0fc[_0x4742('0x36')]=_[_0x4742('0x4d')](db[_0x4742('0x6d')][_0x4742('0x32')]);_0x1ec0fc[_0x4742('0x38')]=_['keys'](_0x284d55[_0x4742('0x38')]);_0x1ec0fc['filters']=_[_0x4742('0x3b')](_0x1ec0fc[_0x4742('0x36')],_0x1ec0fc[_0x4742('0x38')]);_0x3690d4['attributes']=_[_0x4742('0x3b')](_0x1ec0fc[_0x4742('0x36')],qs['fields'](_0x284d55[_0x4742('0x38')][_0x4742('0x3c')]));_0x3690d4[_0x4742('0x3a')]=_0x3690d4[_0x4742('0x3a')][_0x4742('0x3d')]?_0x3690d4[_0x4742('0x3a')]:_0x1ec0fc['model'];_0x3690d4[_0x4742('0x3f')]=qs['sort'](_0x284d55[_0x4742('0x38')]['sort']);_0x3690d4[_0x4742('0x41')]=qs['filters'](_['pick'](_0x284d55['query'],_0x1ec0fc[_0x4742('0x39')]));_0x3690d4[_0x4742('0x41')]=_['merge'](_0x3690d4[_0x4742('0x41')],{'$or':[{'ListId':_0x2364cf['id']},{'ListId':null}]});if(_0x284d55[_0x4742('0x38')][_0x4742('0x45')]){_0x3690d4[_0x4742('0x41')]=_[_0x4742('0x43')](_0x3690d4[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x3690d4[_0x4742('0x3a')],function(_0x4da9f5){var _0x3f531a={};_0x3f531a[_0x4da9f5]={'$like':'%'+_0x284d55[_0x4742('0x38')]['filter']+'%'};return _0x3f531a;})});}_0x3690d4=_[_0x4742('0x43')]({},_0x3690d4,_0x284d55[_0x4742('0x46')]);return db['CmCustomField']['findAndCountAll'](_0x3690d4);}})[_0x4742('0x2c')](respondWithResult(_0x51c808,null))[_0x4742('0x4b')](handleError(_0x51c808,null));};exports[_0x4742('0x9a')]=function(_0xf8c3ff,_0x5c25d7){return db[_0x4742('0x6d')][_0x4742('0x9b')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x5c25d7,null))['then'](function(_0x13d4a8){return _0x13d4a8;})['then'](respondWithResult(_0x5c25d7,null))[_0x4742('0x4b')](handleError(_0x5c25d7,null));};exports[_0x4742('0x9c')]=function(_0x39aa2c,_0x4722a5,_0x349369){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x39aa2c[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x4722a5,null))[_0x4742('0x2c')](function(_0x4ecf7c){if(_0x4ecf7c){return _0x4ecf7c[_0x4742('0x9c')](_0x39aa2c[_0x4742('0x4f')]['ids'],_[_0x4742('0x9d')](_0x39aa2c[_0x4742('0x4f')],['ids','id'])||{})[_0x4742('0x9e')](function(_0x4f3f3b){for(var _0x60cbd6=0x0;_0x60cbd6<_0x39aa2c[_0x4742('0x4f')]['ids'][_0x4742('0x3d')];_0x60cbd6+=0x1){socket[_0x4742('0x9f')](_0x4742('0xa0'),{'UserId':Number(_0x39aa2c['body'][_0x4742('0x61')][_0x60cbd6]),'CmListId':Number(_0x39aa2c[_0x4742('0x4c')]['id'])});}return _0x4f3f3b;});}})[_0x4742('0x2c')](respondWithResult(_0x4722a5,null))['catch'](handleError(_0x4722a5,null));};exports[_0x4742('0xa1')]=function(_0x3d241c,_0x32fde6,_0x2f8642){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x3d241c[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x32fde6,null))['then'](function(_0x1fa76d){if(_0x1fa76d){return _0x1fa76d['removeAgents'](_0x3d241c['query'][_0x4742('0x61')])['then'](function(){if(_[_0x4742('0x63')](_0x3d241c[_0x4742('0x38')][_0x4742('0x61')])){for(var _0x5b9d4f=0x0;_0x5b9d4f<_0x3d241c[_0x4742('0x38')]['ids'][_0x4742('0x3d')];_0x5b9d4f+=0x1){socket[_0x4742('0x9f')](_0x4742('0xa2'),{'UserId':Number(_0x3d241c[_0x4742('0x38')][_0x4742('0x61')][_0x5b9d4f]),'CmListId':Number(_0x3d241c[_0x4742('0x4c')]['id'])});}}else{socket[_0x4742('0x9f')](_0x4742('0xa2'),{'UserId':Number(_0x3d241c[_0x4742('0x38')][_0x4742('0x61')]),'CmListId':Number(_0x3d241c[_0x4742('0x4c')]['id'])});}});}})[_0x4742('0x2c')](respondWithStatusCode(_0x32fde6,null))[_0x4742('0x4b')](handleError(_0x32fde6,null));};exports[_0x4742('0xa3')]=function(_0x97ba75,_0xf9d902,_0x32e70b){var _0x3811b8={};var _0x1b6049={};var _0x31865d;var _0x305528;return db['CmList'][_0x4742('0x5e')]({'where':{'id':_0x97ba75[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0xf9d902,null))['then'](function(_0x3a6f44){if(_0x3a6f44){_0x31865d=_0x3a6f44;_0x1b6049[_0x4742('0x36')]=_[_0x4742('0x4d')](db['User']['rawAttributes']);_0x1b6049[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x97ba75[_0x4742('0x38')]);_0x1b6049[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x1b6049[_0x4742('0x36')],_0x1b6049['query']);_0x3811b8[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x1b6049[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x97ba75[_0x4742('0x38')][_0x4742('0x3c')]));_0x3811b8['attributes']=_0x3811b8[_0x4742('0x3a')][_0x4742('0x3d')]?_0x3811b8[_0x4742('0x3a')]:_0x1b6049[_0x4742('0x36')];_0x3811b8[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x97ba75['query'][_0x4742('0x40')]);_0x3811b8['where']=qs['filters'](_[_0x4742('0x42')](_0x97ba75[_0x4742('0x38')],_0x1b6049[_0x4742('0x39')]));if(_0x97ba75[_0x4742('0x38')][_0x4742('0x45')]){_0x3811b8['where']=_['merge'](_0x3811b8['where'],{'$or':_[_0x4742('0x37')](_0x3811b8[_0x4742('0x3a')],function(_0x216513){var _0x916aef={};_0x916aef[_0x216513]={'$like':'%'+_0x97ba75[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x916aef;})});}_0x3811b8=_['merge']({},_0x3811b8,_0x97ba75[_0x4742('0x46')]);return _0x31865d[_0x4742('0xa3')](_0x3811b8);}})['then'](function(_0x492ff0){if(_0x492ff0){_0x305528=_0x492ff0[_0x4742('0x3d')];if(!_0x97ba75[_0x4742('0x38')]['hasOwnProperty'](_0x4742('0x5f'))){_0x3811b8[_0x4742('0x24')]=qs['limit'](_0x97ba75[_0x4742('0x38')][_0x4742('0x24')]);_0x3811b8[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x97ba75[_0x4742('0x38')][_0x4742('0x22')]);}return _0x31865d[_0x4742('0xa3')](_0x3811b8);}})[_0x4742('0x2c')](function(_0x147321){if(_0x147321){return _0x147321?{'count':_0x305528,'rows':_0x147321}:null;}})[_0x4742('0x2c')](respondWithResult(_0xf9d902,null))[_0x4742('0x4b')](handleError(_0xf9d902,null));};function handleQuery(_0x16dc45){logger['info'](_0x16dc45);return db[_0x4742('0x8e')][_0x4742('0x38')](_0x16dc45)[_0x4742('0x9e')](function(_0x2ce741){csv_results[_0x4742('0x66')](_0x2ce741);})['catch'](function(_0x9c1b49){logger[_0x4742('0x2e')](_0x9c1b49[_0x4742('0xa4')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3a74e69..6eba05b 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x814b,0x1a2));var _0xb814=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x814b[_0x124f88];return _0xed0e3b;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x1c0928,_0x3a5f09){var _0x557de8=function(_0x22d8a4){while(--_0x22d8a4){_0x1c0928['push'](_0x1c0928['shift']());}};_0x557de8(++_0x3a5f09);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 2d80512..cc83088 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 _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList','cm_lists','lodash'];(function(_0x25c655,_0x583d89){var _0x33c2f6=function(_0xd2899a){while(--_0xd2899a){_0x25c655['push'](_0x25c655['shift']());}};_0x33c2f6(++_0x583d89);}(_0xda55,0x6d));var _0x5da5=function(_0x34b71e,_0x58f44d){_0x34b71e=_0x34b71e-0x0;var _0x2cb29b=_0xda55[_0x34b71e];return _0x2cb29b;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x2bf5fc,_0x109374){var _0x447525=function(_0x2abc85){while(--_0x2abc85){_0x2bf5fc['push'](_0x2bf5fc['shift']());}};_0x447525(++_0x109374);}(_0x5ff3,0x17d));var _0x35ff=function(_0x322d61,_0x4cd1b6){_0x322d61=_0x322d61-0x0;var _0x1ed39d=_0x5ff3[_0x322d61];return _0x1ed39d;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'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 f7196fc..0149f0c 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 _0x6bb6=['defaults','localhost','redis','register','then','info','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10392d,_0x33691b){var _0x44a8ef=function(_0x408ecb){while(--_0x408ecb){_0x10392d['push'](_0x10392d['shift']());}};_0x44a8ef(++_0x33691b);}(_0x6bb6,0xd7));var _0x66bb=function(_0x1b7a69,_0x4cc209){_0x1b7a69=_0x1b7a69-0x0;var _0x176d25=_0x6bb6[_0x1b7a69];return _0x176d25;};'use strict';var _=require(_0x66bb('0x0'));var util=require('util');var moment=require(_0x66bb('0x1'));var BPromise=require('bluebird');var rs=require(_0x66bb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66bb('0x3'))['db'];var utils=require(_0x66bb('0x4'));var logger=require('../../config/logger')(_0x66bb('0x5'));var config=require(_0x66bb('0x6'));var jayson=require(_0x66bb('0x7'));var client=jayson[_0x66bb('0x8')][_0x66bb('0x9')]({'port':0x232a});config['redis']=_[_0x66bb('0xa')](config['redis'],{'host':_0x66bb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66bb('0xc')]));require('./cmList.socket')[_0x66bb('0xd')](socket);function respondWithRpcPromise(_0x2a113c,_0x1d4306,_0x3ba55f){return new BPromise(function(_0x39fa32,_0x51cafe){return client['request'](_0x2a113c,_0x3ba55f)[_0x66bb('0xe')](function(_0x6938da){logger[_0x66bb('0xf')]('CmList,\x20%s,\x20%s',_0x1d4306,'request\x20sent');logger[_0x66bb('0x10')](_0x66bb('0x11'),_0x1d4306,'request\x20sent',JSON[_0x66bb('0x12')](_0x6938da));if(_0x6938da['error']){if(_0x6938da['error'][_0x66bb('0x13')]===0x1f4){logger[_0x66bb('0x14')](_0x66bb('0x15'),_0x1d4306,_0x6938da[_0x66bb('0x14')][_0x66bb('0x16')]);return _0x51cafe(_0x6938da[_0x66bb('0x14')]['message']);}logger[_0x66bb('0x14')](_0x66bb('0x15'),_0x1d4306,_0x6938da[_0x66bb('0x14')][_0x66bb('0x16')]);return _0x39fa32(_0x6938da[_0x66bb('0x14')][_0x66bb('0x16')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x1d4306,'request\x20sent');_0x39fa32(_0x6938da[_0x66bb('0x17')][_0x66bb('0x16')]);}})[_0x66bb('0x18')](function(_0x766650){logger[_0x66bb('0x14')]('CmList,\x20%s,\x20%s',_0x1d4306,_0x766650);_0x51cafe(_0x766650);});});} \ No newline at end of file +var _0x5cb5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3d3d51,_0x53e609){var _0x32145c=function(_0x48e337){while(--_0x48e337){_0x3d3d51['push'](_0x3d3d51['shift']());}};_0x32145c(++_0x53e609);}(_0x5cb5,0x157));var _0x55cb=function(_0x184f60,_0x3464da){_0x184f60=_0x184f60-0x0;var _0x471c58=_0x5cb5[_0x184f60];return _0x471c58;};'use strict';var _=require(_0x55cb('0x0'));var util=require(_0x55cb('0x1'));var moment=require(_0x55cb('0x2'));var BPromise=require(_0x55cb('0x3'));var rs=require(_0x55cb('0x4'));var fs=require('fs');var Redis=require(_0x55cb('0x5'));var db=require(_0x55cb('0x6'))['db'];var utils=require(_0x55cb('0x7'));var logger=require(_0x55cb('0x8'))(_0x55cb('0x9'));var config=require(_0x55cb('0xa'));var jayson=require(_0x55cb('0xb'));var client=jayson[_0x55cb('0xc')]['http']({'port':0x232a});config[_0x55cb('0xd')]=_[_0x55cb('0xe')](config[_0x55cb('0xd')],{'host':_0x55cb('0xf'),'port':0x18eb});var socket=require(_0x55cb('0x10'))(new Redis(config[_0x55cb('0xd')]));require('./cmList.socket')[_0x55cb('0x11')](socket);function respondWithRpcPromise(_0x4f4a93,_0x438b18,_0x44676c){return new BPromise(function(_0xa9675b,_0x1b4494){return client['request'](_0x4f4a93,_0x44676c)[_0x55cb('0x12')](function(_0x520c04){logger['info']('CmList,\x20%s,\x20%s',_0x438b18,_0x55cb('0x13'));logger[_0x55cb('0x14')](_0x55cb('0x15'),_0x438b18,_0x55cb('0x13'),JSON[_0x55cb('0x16')](_0x520c04));if(_0x520c04[_0x55cb('0x17')]){if(_0x520c04[_0x55cb('0x17')][_0x55cb('0x18')]===0x1f4){logger[_0x55cb('0x17')]('CmList,\x20%s,\x20%s',_0x438b18,_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);return _0x1b4494(_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x438b18,_0x520c04[_0x55cb('0x17')]['message']);return _0xa9675b(_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);}else{logger['info'](_0x55cb('0x1a'),_0x438b18,_0x55cb('0x13'));_0xa9675b(_0x520c04[_0x55cb('0x1b')][_0x55cb('0x19')]);}})[_0x55cb('0x1c')](function(_0x49d77f){logger[_0x55cb('0x17')](_0x55cb('0x1a'),_0x438b18,_0x49d77f);_0x1b4494(_0x49d77f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 514c391..dfb9214 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 _0xcf09=['register','length','cmList:','./cmList.events','save','emit'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xcf09,0x165));var _0x9cf0=function(_0x27c06e,_0xa9b01c){_0x27c06e=_0x27c06e-0x0;var _0x116681=_0xcf09[_0x27c06e];return _0x116681;};'use strict';var CmListEvents=require(_0x9cf0('0x0'));var events=[_0x9cf0('0x1'),'remove','update'];function createListener(_0x153ac4,_0x1f7fb0){return function(_0x278cfd){_0x1f7fb0[_0x9cf0('0x2')](_0x153ac4,_0x278cfd);};}function removeListener(_0x13d71d,_0x55ae0c){return function(){CmListEvents['removeListener'](_0x13d71d,_0x55ae0c);};}exports[_0x9cf0('0x3')]=function(_0x1a2d10){for(var _0x3c2609=0x0,_0x3e3625=events[_0x9cf0('0x4')];_0x3c2609<_0x3e3625;_0x3c2609++){var _0x4271f4=events[_0x3c2609];var _0xfb344e=createListener(_0x9cf0('0x5')+_0x4271f4,_0x1a2d10);CmListEvents['on'](_0x4271f4,_0xfb344e);}}; \ No newline at end of file +var _0xb143=['./cmList.events','remove','update','removeListener','length','cmList:'];(function(_0x33e4c7,_0x4d8a1a){var _0x234be9=function(_0xef51f){while(--_0xef51f){_0x33e4c7['push'](_0x33e4c7['shift']());}};_0x234be9(++_0x4d8a1a);}(_0xb143,0x1e6));var _0x3b14=function(_0x4940d0,_0x1142ad){_0x4940d0=_0x4940d0-0x0;var _0x53354b=_0xb143[_0x4940d0];return _0x53354b;};'use strict';var CmListEvents=require(_0x3b14('0x0'));var events=['save',_0x3b14('0x1'),_0x3b14('0x2')];function createListener(_0x51edad,_0xc13743){return function(_0x291a25){_0xc13743['emit'](_0x51edad,_0x291a25);};}function removeListener(_0x46e873,_0x5ed25b){return function(){CmListEvents[_0x3b14('0x3')](_0x46e873,_0x5ed25b);};}exports['register']=function(_0x227129){for(var _0x5407d8=0x0,_0x355628=events[_0x3b14('0x4')];_0x5407d8<_0x355628;_0x5407d8++){var _0x3526db=events[_0x5407d8];var _0x38a61c=createListener(_0x3b14('0x5')+_0x3526db,_0x227129);CmListEvents['on'](_0x3526db,_0x38a61c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ff1d597..a9c3572 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 _0x1c57=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','getGlobalCustomFields','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','post','create','addDisposition','/:id/contacts','/:id/fields','put','update','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout'];(function(_0x16d6dd,_0x23730d){var _0x1d4048=function(_0x1508b2){while(--_0x1508b2){_0x16d6dd['push'](_0x16d6dd['shift']());}};_0x1d4048(++_0x23730d);}(_0x1c57,0xf5));var _0x71c5=function(_0x18a008,_0x3386ad){_0x18a008=_0x18a008-0x0;var _0x4e236e=_0x1c57[_0x18a008];return _0x4e236e;};'use strict';var multer=require(_0x71c5('0x0'));var util=require('util');var path=require(_0x71c5('0x1'));var timeout=require(_0x71c5('0x2'));var express=require('express');var router=express[_0x71c5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x71c5('0x4'));var interaction=require(_0x71c5('0x5'));var config=require(_0x71c5('0x6'));var controller=require('./cmList.controller');router[_0x71c5('0x7')]('/',auth['isAuthenticated'](),controller[_0x71c5('0x8')]);router[_0x71c5('0x7')](_0x71c5('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x71c5('0x7')]('/global_fields',auth['isAuthenticated'](),controller[_0x71c5('0xa')]);router[_0x71c5('0x7')](_0x71c5('0xb'),auth['isAuthenticated'](),controller[_0x71c5('0xc')]);router[_0x71c5('0x7')](_0x71c5('0xd'),auth[_0x71c5('0xe')](),controller[_0x71c5('0xf')]);router[_0x71c5('0x7')]('/:id/contacts',auth[_0x71c5('0xe')](),controller[_0x71c5('0x10')]);router[_0x71c5('0x7')](_0x71c5('0x11'),auth['isAuthenticated'](),controller[_0x71c5('0x12')]);router['get']('/:id/fields',auth[_0x71c5('0xe')](),controller[_0x71c5('0x13')]);router[_0x71c5('0x7')]('/:id/users',auth[_0x71c5('0xe')](),controller['getAgents']);router[_0x71c5('0x14')]('/',auth[_0x71c5('0xe')](),controller[_0x71c5('0x15')]);router['post']('/:id/dispositions',auth[_0x71c5('0xe')](),controller[_0x71c5('0x16')]);router['post'](_0x71c5('0x17'),auth['isAuthenticated'](),controller['addContacts']);router[_0x71c5('0x14')](_0x71c5('0x18'),auth[_0x71c5('0xe')](),controller['addCustomField']);router[_0x71c5('0x14')]('/:id/users',auth[_0x71c5('0xe')](),controller['addAgents']);router[_0x71c5('0x19')](_0x71c5('0xb'),auth['isAuthenticated'](),controller[_0x71c5('0x1a')]);router[_0x71c5('0x1b')](_0x71c5('0xb'),auth[_0x71c5('0xe')](),controller['destroy']);router[_0x71c5('0x1b')](_0x71c5('0xd'),auth[_0x71c5('0xe')](),controller[_0x71c5('0x1c')]);router['delete']('/:id/users',auth[_0x71c5('0xe')](),controller[_0x71c5('0x1d')]);module[_0x71c5('0x1e')]=router; \ No newline at end of file +var _0x6325=['/:id/fields','getCustomFields','/:id/users','create','post','addDisposition','addContacts','addCustomField','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/global_fields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x6325,0xe8));var _0x5632=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6325[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5632('0x0'));var util=require(_0x5632('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5632('0x2'));var router=express[_0x5632('0x3')]();var fs_extra=require(_0x5632('0x4'));var auth=require(_0x5632('0x5'));var interaction=require(_0x5632('0x6'));var config=require(_0x5632('0x7'));var controller=require('./cmList.controller');router[_0x5632('0x8')]('/',auth[_0x5632('0x9')](),controller[_0x5632('0xa')]);router[_0x5632('0x8')]('/describe',auth[_0x5632('0x9')](),controller[_0x5632('0xb')]);router[_0x5632('0x8')](_0x5632('0xc'),auth[_0x5632('0x9')](),controller['getGlobalCustomFields']);router[_0x5632('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5632('0xd')]);router[_0x5632('0x8')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0xf')]);router[_0x5632('0x8')](_0x5632('0x10'),auth['isAuthenticated'](),controller[_0x5632('0x11')]);router[_0x5632('0x8')](_0x5632('0x12'),auth[_0x5632('0x9')](),controller[_0x5632('0x13')]);router[_0x5632('0x8')](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x15')]);router[_0x5632('0x8')](_0x5632('0x16'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x5632('0x9')](),controller[_0x5632('0x17')]);router[_0x5632('0x18')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0x19')]);router[_0x5632('0x18')](_0x5632('0x10'),auth[_0x5632('0x9')](),controller[_0x5632('0x1a')]);router['post'](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x1b')]);router[_0x5632('0x18')](_0x5632('0x16'),auth[_0x5632('0x9')](),controller['addAgents']);router[_0x5632('0x1c')](_0x5632('0x1d'),auth[_0x5632('0x9')](),controller[_0x5632('0x1e')]);router[_0x5632('0x1f')](_0x5632('0x1d'),auth[_0x5632('0x9')](),controller[_0x5632('0x20')]);router[_0x5632('0x1f')](_0x5632('0xe'),auth['isAuthenticated'](),controller[_0x5632('0x21')]);router['delete'](_0x5632('0x16'),auth[_0x5632('0x9')](),controller[_0x5632('0x22')]);module[_0x5632('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d8a3752..8be010e 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 _0xe3c9=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x1582ab,_0x3203fd){var _0x2a4368=function(_0xd83a0d){while(--_0xd83a0d){_0x1582ab['push'](_0x1582ab['shift']());}};_0x2a4368(++_0x3203fd);}(_0xe3c9,0x1d7));var _0x9e3c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe3c9[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x9e3c('0x0'));module[_0x9e3c('0x1')]={'name':{'type':Sequelize[_0x9e3c('0x2')],'get':function(_0x194579){return this['getDataValue'](_0x9e3c('0x3'));}},'field':{'type':Sequelize[_0x9e3c('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x9e3c('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf645=['exports','VIRTUAL','STRING'];(function(_0x4e221c,_0x4e8f0d){var _0x37686d=function(_0x4e03c3){while(--_0x4e03c3){_0x4e221c['push'](_0x4e221c['shift']());}};_0x37686d(++_0x4e8f0d);}(_0xf645,0x1dd));var _0x5f64=function(_0x5b0bc8,_0x3f86b0){_0x5b0bc8=_0x5b0bc8-0x0;var _0x1626a5=_0xf645[_0x5b0bc8];return _0x1626a5;};'use strict';var Sequelize=require('sequelize');module[_0x5f64('0x0')]={'name':{'type':Sequelize[_0x5f64('0x1')],'get':function(_0xfe481d){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x5f64('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x5f64('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x5f64('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 e3e5ba4..99087d0 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 _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x17fa80,_0x6a7e6e){var _0x532893=function(_0x3d6758){while(--_0x3d6758){_0x17fa80['push'](_0x17fa80['shift']());}};_0x532893(++_0x6a7e6e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xc9eb61,_0x443215){var _0x1eba68=function(_0x387d21){while(--_0x387d21){_0xc9eb61['push'](_0xc9eb61['shift']());}};_0x1eba68(++_0x443215);}(_0x7a54,0x106));var _0x47a5=function(_0xb49caf,_0x518f9f){_0xb49caf=_0xb49caf-0x0;var _0x4b270c=_0x7a54[_0xb49caf];return _0x4b270c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 5bf80fe..e29055c 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 _0xafbc=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','path','exports'];(function(_0x29241b,_0x1fa79f){var _0x548e79=function(_0x5ea7a5){while(--_0x5ea7a5){_0x29241b['push'](_0x29241b['shift']());}};_0x548e79(++_0x1fa79f);}(_0xafbc,0xb3));var _0xcafb=function(_0x149c42,_0x51b231){_0x149c42=_0x149c42-0x0;var _0x4a708c=_0xafbc[_0x149c42];return _0x4a708c;};'use strict';var _=require(_0xcafb('0x0'));var util=require(_0xcafb('0x1'));var logger=require(_0xcafb('0x2'))(_0xcafb('0x3'));var moment=require(_0xcafb('0x4'));var BPromise=require(_0xcafb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcafb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0xcafb('0x7')]=function(_0x419a15,_0x52064a){return _0x419a15[_0xcafb('0x8')](_0xcafb('0x9'),attributes,{'tableName':_0xcafb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccf1=['request-promise','path','rimraf','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x1ae7b0,_0x2301a2){var _0x2d83dc=function(_0x32a63f){while(--_0x32a63f){_0x1ae7b0['push'](_0x1ae7b0['shift']());}};_0x2d83dc(++_0x2301a2);}(_0xccf1,0x1d4));var _0x1ccf=function(_0x45fa7d,_0x2c3049){_0x45fa7d=_0x45fa7d-0x0;var _0x1f9fe0=_0xccf1[_0x45fa7d];return _0x1f9fe0;};'use strict';var _=require(_0x1ccf('0x0'));var util=require(_0x1ccf('0x1'));var logger=require(_0x1ccf('0x2'))(_0x1ccf('0x3'));var moment=require(_0x1ccf('0x4'));var BPromise=require('bluebird');var rp=require(_0x1ccf('0x5'));var fs=require('fs');var path=require(_0x1ccf('0x6'));var rimraf=require(_0x1ccf('0x7'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x565d0f,_0x439d8e){return _0x565d0f[_0x1ccf('0x8')](_0x1ccf('0x9'),attributes,{'tableName':_0x1ccf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 7e3efb4..1998c93 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 _0x5b1d=['request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x5b1d,0x140));var _0xd5b1=function(_0x2bd278,_0x2123e2){_0x2bd278=_0x2bd278-0x0;var _0x4e5425=_0x5b1d[_0x2bd278];return _0x4e5425;};'use strict';var _=require(_0xd5b1('0x0'));var util=require(_0xd5b1('0x1'));var moment=require(_0xd5b1('0x2'));var BPromise=require(_0xd5b1('0x3'));var rs=require(_0xd5b1('0x4'));var fs=require('fs');var Redis=require(_0xd5b1('0x5'));var db=require(_0xd5b1('0x6'))['db'];var utils=require(_0xd5b1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5b1('0x8'));var jayson=require(_0xd5b1('0x9'));var client=jayson[_0xd5b1('0xa')][_0xd5b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x333e07,_0x53e300,_0xf3007f){return new BPromise(function(_0x31cc08,_0x4019ca){return client[_0xd5b1('0xc')](_0x333e07,_0xf3007f)[_0xd5b1('0xd')](function(_0x2e4d49){logger[_0xd5b1('0xe')](_0xd5b1('0xf'),_0x53e300,_0xd5b1('0x10'));logger['debug'](_0xd5b1('0x11'),_0x53e300,_0xd5b1('0x10'),JSON[_0xd5b1('0x12')](_0x2e4d49));if(_0x2e4d49[_0xd5b1('0x13')]){if(_0x2e4d49[_0xd5b1('0x13')][_0xd5b1('0x14')]===0x1f4){logger[_0xd5b1('0x13')](_0xd5b1('0xf'),_0x53e300,_0x2e4d49[_0xd5b1('0x13')][_0xd5b1('0x15')]);return _0x4019ca(_0x2e4d49[_0xd5b1('0x13')]['message']);}logger[_0xd5b1('0x13')](_0xd5b1('0xf'),_0x53e300,_0x2e4d49['error'][_0xd5b1('0x15')]);return _0x31cc08(_0x2e4d49[_0xd5b1('0x13')][_0xd5b1('0x15')]);}else{logger['info'](_0xd5b1('0xf'),_0x53e300,'request\x20sent');_0x31cc08(_0x2e4d49[_0xd5b1('0x16')][_0xd5b1('0x15')]);}})[_0xd5b1('0x17')](function(_0x3ff92){logger[_0xd5b1('0x13')]('Condition,\x20%s,\x20%s',_0x53e300,_0x3ff92);_0x4019ca(_0x3ff92);});});} \ No newline at end of file +var _0x2d42=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','Condition,\x20%s,\x20%s','message'];(function(_0x555040,_0x4b586a){var _0x153e91=function(_0x11b49b){while(--_0x11b49b){_0x555040['push'](_0x555040['shift']());}};_0x153e91(++_0x4b586a);}(_0x2d42,0x6a));var _0x22d4=function(_0xec2112,_0x5281a6){_0xec2112=_0xec2112-0x0;var _0x2ba326=_0x2d42[_0xec2112];return _0x2ba326;};'use strict';var _=require(_0x22d4('0x0'));var util=require(_0x22d4('0x1'));var moment=require(_0x22d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x22d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22d4('0x4'));var logger=require(_0x22d4('0x5'))(_0x22d4('0x6'));var config=require(_0x22d4('0x7'));var jayson=require(_0x22d4('0x8'));var client=jayson[_0x22d4('0x9')][_0x22d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39581b,_0x429732,_0x3a685d){return new BPromise(function(_0x48492b,_0x18733f){return client[_0x22d4('0xb')](_0x39581b,_0x3a685d)[_0x22d4('0xc')](function(_0x128d0e){logger[_0x22d4('0xd')]('Condition,\x20%s,\x20%s',_0x429732,_0x22d4('0xe'));logger[_0x22d4('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x429732,_0x22d4('0xe'),JSON['stringify'](_0x128d0e));if(_0x128d0e['error']){if(_0x128d0e[_0x22d4('0x10')][_0x22d4('0x11')]===0x1f4){logger['error'](_0x22d4('0x12'),_0x429732,_0x128d0e[_0x22d4('0x10')][_0x22d4('0x13')]);return _0x18733f(_0x128d0e[_0x22d4('0x10')]['message']);}logger[_0x22d4('0x10')](_0x22d4('0x12'),_0x429732,_0x128d0e[_0x22d4('0x10')][_0x22d4('0x13')]);return _0x48492b(_0x128d0e[_0x22d4('0x10')]['message']);}else{logger[_0x22d4('0xd')](_0x22d4('0x12'),_0x429732,_0x22d4('0xe'));_0x48492b(_0x128d0e['result'][_0x22d4('0x13')]);}})[_0x22d4('0x14')](function(_0x3821bf){logger[_0x22d4('0x10')](_0x22d4('0x12'),_0x429732,_0x3821bf);_0x18733f(_0x3821bf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fc6adbf..6d0134f 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 _0x69bd=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','isAuthenticated','update','/:id','destroy','multer'];(function(_0x5b989e,_0x4e28f9){var _0x36f054=function(_0x4a0bd0){while(--_0x4a0bd0){_0x5b989e['push'](_0x5b989e['shift']());}};_0x36f054(++_0x4e28f9);}(_0x69bd,0x144));var _0xd69b=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x69bd[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xd69b('0x0'));var util=require(_0xd69b('0x1'));var path=require('path');var timeout=require(_0xd69b('0x2'));var express=require('express');var router=express[_0xd69b('0x3')]();var fs_extra=require(_0xd69b('0x4'));var auth=require(_0xd69b('0x5'));var interaction=require(_0xd69b('0x6'));var config=require('../../config/environment');var controller=require(_0xd69b('0x7'));router[_0xd69b('0x8')]('/:id',auth[_0xd69b('0x9')](),controller[_0xd69b('0xa')]);router['delete'](_0xd69b('0xb'),auth[_0xd69b('0x9')](),controller[_0xd69b('0xc')]);module['exports']=router; \ No newline at end of file +var _0x9a7a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x21f181,_0x27b9df){var _0x1e7320=function(_0x5e6c72){while(--_0x5e6c72){_0x21f181['push'](_0x21f181['shift']());}};_0x1e7320(++_0x27b9df);}(_0x9a7a,0x130));var _0xa9a7=function(_0x475aa9,_0x439aab){_0x475aa9=_0x475aa9-0x0;var _0x360bbc=_0x9a7a[_0x475aa9];return _0x360bbc;};'use strict';var multer=require(_0xa9a7('0x0'));var util=require(_0xa9a7('0x1'));var path=require(_0xa9a7('0x2'));var timeout=require(_0xa9a7('0x3'));var express=require(_0xa9a7('0x4'));var router=express[_0xa9a7('0x5')]();var fs_extra=require(_0xa9a7('0x6'));var auth=require(_0xa9a7('0x7'));var interaction=require(_0xa9a7('0x8'));var config=require('../../config/environment');var controller=require(_0xa9a7('0x9'));router[_0xa9a7('0xa')](_0xa9a7('0xb'),auth[_0xa9a7('0xc')](),controller[_0xa9a7('0xd')]);router[_0xa9a7('0xe')](_0xa9a7('0xb'),auth[_0xa9a7('0xc')](),controller[_0xa9a7('0xf')]);module[_0xa9a7('0x10')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 87e72c6..3381fbd 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x818e=['exports','name','INTEGER'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x818e,0xff));var _0xe818=function(_0x3f7c8c,_0x5c26a6){_0x3f7c8c=_0x3f7c8c-0x0;var _0x48e4d2=_0x818e[_0x3f7c8c];return _0x48e4d2;};'use strict';var Sequelize=require('sequelize');module[_0xe818('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe818('0x1')},'OrderBy':{'type':Sequelize[_0xe818('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xbdaa=['STRING','name','INTEGER','sequelize','exports'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xbdaa,0x99));var _0xabda=function(_0x31e442,_0x40e2b4){_0x31e442=_0x31e442-0x0;var _0x4cfde2=_0xbdaa[_0x31e442];return _0x4cfde2;};'use strict';var Sequelize=require(_0xabda('0x0'));module[_0xabda('0x1')]={'name':{'type':Sequelize[_0xabda('0x2')],'allowNull':![],'unique':_0xabda('0x3')},'OrderBy':{'type':Sequelize[_0xabda('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 85b33a8..3babd57 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x065e=['findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','ContactItemType','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include'];(function(_0x405069,_0x14db45){var _0xd7c425=function(_0x18ea5e){while(--_0x18ea5e){_0x405069['push'](_0x405069['shift']());}};_0xd7c425(++_0x14db45);}(_0x065e,0x1a7));var _0xe065=function(_0x2f461d,_0x40029c){_0x2f461d=_0x2f461d-0x0;var _0x3fe90e=_0x065e[_0x2f461d];return _0x3fe90e;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='ContactItemTypes';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':!![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x21')]=function(_0x1ea568,_0xe77af6){if(_0x1ea568[_0xe065('0x4f')]['id']){delete _0x1ea568[_0xe065('0x4f')]['id'];}return db[_0xe065('0x2a')]['find']({'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](saveUpdates(_0x1ea568[_0xe065('0x4f')],null))['then'](respondWithResult(_0xe77af6,null))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x23')]=function(_0x21884d,_0xb1fca1){return db['ContactItemType'][_0xe065('0x45')]({'where':{'id':_0x21884d[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xb1fca1,null))['then'](db[_0xe065('0x50')][_0xe065('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x21884d[_0xe065('0x42')]['id']}}))[_0xe065('0x22')](removeEntity(_0xb1fca1,null))[_0xe065('0x4d')](handleError(_0xb1fca1,null));}; \ No newline at end of file +var _0x5464=['filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','get','ContactItemTypes','destroy','sendStatus','stack','name','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x5555fa,_0x54dee1){var _0x4670ae=function(_0x1be6ff){while(--_0x1be6ff){_0x5555fa['push'](_0x5555fa['shift']());}};_0x4670ae(++_0x54dee1);}(_0x5464,0x15d));var _0x4546=function(_0x283641,_0x15ee30){_0x283641=_0x283641-0x0;var _0x498032=_0x5464[_0x283641];return _0x498032;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];function respondWithStatusCode(_0x4d31a7,_0x4f2641){_0x4f2641=_0x4f2641||0xcc;return function(_0x3e6622){if(_0x3e6622){return _0x4d31a7['sendStatus'](_0x4f2641);}return _0x4d31a7['status'](_0x4f2641)['end']();};}function respondWithResult(_0x5b64b7,_0x598516){_0x598516=_0x598516||0xc8;return function(_0x4f5571){if(_0x4f5571){return _0x5b64b7[_0x4546('0x18')](_0x598516)['json'](_0x4f5571);}};}function respondWithFilteredResult(_0x363a17,_0x54581c){return function(_0x26fc0e){if(_0x26fc0e){var _0x564f3e=typeof _0x54581c[_0x4546('0x19')]===_0x4546('0x1a')&&typeof _0x54581c[_0x4546('0x1b')]===_0x4546('0x1a');var _0x2a294b=_0x26fc0e[_0x4546('0x1c')];var _0x57d8de=_0x564f3e?0x0:_0x54581c['offset'];var _0x5780a7=_0x564f3e?_0x26fc0e[_0x4546('0x1c')]:_0x54581c[_0x4546('0x19')]+_0x54581c[_0x4546('0x1b')];var _0x3d95c2;if(_0x5780a7>=_0x2a294b){_0x5780a7=_0x2a294b;_0x3d95c2=0xc8;}else{_0x3d95c2=0xce;}_0x363a17[_0x4546('0x18')](_0x3d95c2);return _0x363a17[_0x4546('0x1d')](_0x4546('0x1e'),_0x57d8de+'-'+_0x5780a7+'/'+_0x2a294b)[_0x4546('0x1f')](_0x26fc0e);}return null;};}function patchUpdates(_0x4034a5){return function(_0xceb1d6){try{jsonpatch['apply'](_0xceb1d6,_0x4034a5,!![]);}catch(_0x2d689f){return BPromise[_0x4546('0x20')](_0x2d689f);}return _0xceb1d6['save']();};}function saveUpdates(_0x3067ab,_0x437f55){return function(_0x1a1984){if(_0x1a1984){return _0x1a1984[_0x4546('0x21')](_0x3067ab)[_0x4546('0x22')](function(_0x15b013){return _0x15b013;});}return null;};}function removeEntity(_0x53e402,_0x3dab5c){return function(_0x2cca8b){if(_0x2cca8b){return _0x2cca8b['destroy']()[_0x4546('0x22')](function(){var _0x4618a6=_0x2cca8b[_0x4546('0x23')]({'plain':!![]});var _0x4467ee=_0x4546('0x24');return db['UserProfileResource'][_0x4546('0x25')]({'where':{'type':_0x4467ee,'resourceId':_0x4618a6['id']}})[_0x4546('0x22')](function(){return _0x2cca8b;});})[_0x4546('0x22')](function(){_0x53e402['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43740e,_0x166d6f){return function(_0x15611c){if(!_0x15611c){_0x43740e[_0x4546('0x26')](0x194);}return _0x15611c;};}function handleError(_0x29a3f0,_0x225bc6){_0x225bc6=_0x225bc6||0x1f4;return function(_0xcea7da){logger['error'](_0xcea7da[_0x4546('0x27')]);if(_0xcea7da['name']){delete _0xcea7da[_0x4546('0x28')];}_0x29a3f0[_0x4546('0x18')](_0x225bc6)['send'](_0xcea7da);};}exports['index']=function(_0xf7a95b,_0x5af997){var _0x3c7c7d={},_0x58b69={},_0x480d8e={'count':0x0,'rows':[]};var _0x5f0226=_[_0x4546('0x29')](db[_0x4546('0x2a')][_0x4546('0x2b')],function(_0x5716dc){return{'name':_0x5716dc[_0x4546('0x2c')],'type':_0x5716dc[_0x4546('0x2d')]['key']};});_0x58b69[_0x4546('0x2e')]=_['map'](_0x5f0226,_0x4546('0x28'));_0x58b69[_0x4546('0x2f')]=_[_0x4546('0x30')](_0xf7a95b[_0x4546('0x2f')]);_0x58b69['filters']=_[_0x4546('0x31')](_0x58b69[_0x4546('0x2e')],_0x58b69[_0x4546('0x2f')]);_0x3c7c7d[_0x4546('0x32')]=_[_0x4546('0x31')](_0x58b69[_0x4546('0x2e')],qs['fields'](_0xf7a95b[_0x4546('0x2f')][_0x4546('0x33')]));_0x3c7c7d['attributes']=_0x3c7c7d['attributes'][_0x4546('0x34')]?_0x3c7c7d[_0x4546('0x32')]:_0x58b69['model'];if(!_0xf7a95b[_0x4546('0x2f')][_0x4546('0x35')]('nolimit')){_0x3c7c7d['limit']=qs[_0x4546('0x1b')](_0xf7a95b[_0x4546('0x2f')][_0x4546('0x1b')]);_0x3c7c7d[_0x4546('0x19')]=qs[_0x4546('0x19')](_0xf7a95b[_0x4546('0x2f')]['offset']);}_0x3c7c7d[_0x4546('0x36')]=qs[_0x4546('0x37')](_0xf7a95b['query'][_0x4546('0x37')]);_0x3c7c7d['where']=qs[_0x4546('0x38')](_[_0x4546('0x39')](_0xf7a95b['query'],_0x58b69['filters']),_0x5f0226);if(_0xf7a95b[_0x4546('0x2f')][_0x4546('0x3a')]){_0x3c7c7d[_0x4546('0x3b')]=_['merge'](_0x3c7c7d[_0x4546('0x3b')],{'$or':_[_0x4546('0x29')](_0x5f0226,function(_0x24eb6d){if(_0x24eb6d[_0x4546('0x2d')]!==_0x4546('0x3c')){var _0x320772={};_0x320772[_0x24eb6d[_0x4546('0x28')]]={'$like':'%'+_0xf7a95b[_0x4546('0x2f')]['filter']+'%'};return _0x320772;}})});}_0x3c7c7d=_[_0x4546('0x3d')]({},_0x3c7c7d,_0xf7a95b[_0x4546('0x3e')]);var _0x4a76a2={'where':_0x3c7c7d['where']};return db[_0x4546('0x2a')][_0x4546('0x1c')](_0x4a76a2)[_0x4546('0x22')](function(_0x1ea5c4){_0x480d8e[_0x4546('0x1c')]=_0x1ea5c4;if(_0xf7a95b['query'][_0x4546('0x3f')]){_0x3c7c7d[_0x4546('0x40')]=[{'all':!![]}];}return db[_0x4546('0x2a')][_0x4546('0x41')](_0x3c7c7d);})[_0x4546('0x22')](function(_0x3fabf0){_0x480d8e[_0x4546('0x42')]=_0x3fabf0;return _0x480d8e;})[_0x4546('0x22')](respondWithFilteredResult(_0x5af997,_0x3c7c7d))[_0x4546('0x43')](handleError(_0x5af997,null));};exports['show']=function(_0x270f59,_0x1dd5b0){var _0x3510e0={'raw':!![],'where':{'id':_0x270f59[_0x4546('0x44')]['id']}},_0x35b51e={};_0x35b51e[_0x4546('0x2e')]=_[_0x4546('0x30')](db[_0x4546('0x2a')][_0x4546('0x2b')]);_0x35b51e[_0x4546('0x2f')]=_[_0x4546('0x30')](_0x270f59['query']);_0x35b51e[_0x4546('0x38')]=_[_0x4546('0x31')](_0x35b51e['model'],_0x35b51e[_0x4546('0x2f')]);_0x3510e0[_0x4546('0x32')]=_[_0x4546('0x31')](_0x35b51e['model'],qs[_0x4546('0x33')](_0x270f59[_0x4546('0x2f')][_0x4546('0x33')]));_0x3510e0[_0x4546('0x32')]=_0x3510e0[_0x4546('0x32')][_0x4546('0x34')]?_0x3510e0[_0x4546('0x32')]:_0x35b51e[_0x4546('0x2e')];if(_0x270f59[_0x4546('0x2f')][_0x4546('0x3f')]){_0x3510e0['include']=[{'all':!![]}];}_0x3510e0=_[_0x4546('0x3d')]({},_0x3510e0,_0x270f59[_0x4546('0x3e')]);return db['ContactItemType'][_0x4546('0x45')](_0x3510e0)[_0x4546('0x22')](handleEntityNotFound(_0x1dd5b0,null))[_0x4546('0x22')](respondWithResult(_0x1dd5b0,null))[_0x4546('0x43')](handleError(_0x1dd5b0,null));};exports['create']=function(_0x329566,_0x57bb39){return db[_0x4546('0x2a')][_0x4546('0x46')](_0x329566[_0x4546('0x47')],{})['then'](function(_0x118a36){var _0x3dc9a9=_0x329566[_0x4546('0x48')][_0x4546('0x23')]({'plain':!![]});if(!_0x3dc9a9)throw new Error(_0x4546('0x49'));if(_0x3dc9a9[_0x4546('0x4a')]===_0x4546('0x48')){var _0x325181=_0x118a36[_0x4546('0x23')]({'plain':!![]});var _0x369dc3=_0x4546('0x24');return db['UserProfileSection'][_0x4546('0x45')]({'where':{'name':_0x369dc3,'userProfileId':_0x3dc9a9[_0x4546('0x4b')]},'raw':!![]})['then'](function(_0x50da6e){if(_0x50da6e&&_0x50da6e[_0x4546('0x4c')]===0x0){return db[_0x4546('0x4d')]['create']({'name':_0x325181[_0x4546('0x28')],'resourceId':_0x325181['id'],'type':_0x50da6e[_0x4546('0x28')],'sectionId':_0x50da6e['id']},{})[_0x4546('0x22')](function(){return _0x118a36;});}else{return _0x118a36;}})[_0x4546('0x43')](function(_0x10dfd6){logger[_0x4546('0x4e')](_0x4546('0x4f'),_0x10dfd6);throw _0x10dfd6;});}return _0x118a36;})[_0x4546('0x22')](respondWithResult(_0x57bb39,0xc9))[_0x4546('0x43')](handleError(_0x57bb39,null));};exports[_0x4546('0x21')]=function(_0x14f5a3,_0x198c5d){if(_0x14f5a3[_0x4546('0x47')]['id']){delete _0x14f5a3[_0x4546('0x47')]['id'];}return db[_0x4546('0x2a')][_0x4546('0x45')]({'where':{'id':_0x14f5a3['params']['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x198c5d,null))[_0x4546('0x22')](saveUpdates(_0x14f5a3['body'],null))[_0x4546('0x22')](respondWithResult(_0x198c5d,null))[_0x4546('0x43')](handleError(_0x198c5d,null));};exports[_0x4546('0x25')]=function(_0x30e748,_0x5e2094){return db[_0x4546('0x2a')][_0x4546('0x45')]({'where':{'id':_0x30e748[_0x4546('0x44')]['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x5e2094,null))[_0x4546('0x22')](db[_0x4546('0x50')][_0x4546('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x30e748[_0x4546('0x44')]['id']}}))[_0x4546('0x22')](removeEntity(_0x5e2094,null))[_0x4546('0x43')](handleError(_0x5e2094,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 826d6c8..3893104 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde6f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash'];(function(_0x5a517d,_0x54b788){var _0x3fe234=function(_0x2afc2f){while(--_0x2afc2f){_0x5a517d['push'](_0x5a517d['shift']());}};_0x3fe234(++_0x54b788);}(_0xde6f,0xdf));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfde6('0x0'));var util=require('util');var logger=require(_0xfde6('0x1'))(_0xfde6('0x2'));var moment=require(_0xfde6('0x3'));var BPromise=require(_0xfde6('0x4'));var rp=require(_0xfde6('0x5'));var fs=require('fs');var path=require(_0xfde6('0x6'));var rimraf=require(_0xfde6('0x7'));var config=require(_0xfde6('0x8'));var attributes=require(_0xfde6('0x9'));module[_0xfde6('0xa')]=function(_0x40b57f,_0x285e19){return _0x40b57f[_0xfde6('0xb')](_0xfde6('0xc'),attributes,{'tableName':_0xfde6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcef6=['ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports','define'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xcef6,0x16e));var _0x6cef=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xcef6[_0x2c9b79];return _0x265032;};'use strict';var _=require(_0x6cef('0x0'));var util=require(_0x6cef('0x1'));var logger=require(_0x6cef('0x2'))(_0x6cef('0x3'));var moment=require(_0x6cef('0x4'));var BPromise=require(_0x6cef('0x5'));var rp=require(_0x6cef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6cef('0x7'));var attributes=require(_0x6cef('0x8'));module[_0x6cef('0x9')]=function(_0x22227e,_0x26c08b){return _0x22227e[_0x6cef('0xa')](_0x6cef('0xb'),attributes,{'tableName':_0x6cef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 89bf2ec..1f1e383 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d5d=['info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x36bb96,_0x5ec14a){var _0x287f17=function(_0x142f2b){while(--_0x142f2b){_0x36bb96['push'](_0x36bb96['shift']());}};_0x287f17(++_0x5ec14a);}(_0x1d5d,0x7f));var _0xd1d5=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x1d5d[_0x2f3848];return _0x102668;};'use strict';var _=require(_0xd1d5('0x0'));var util=require(_0xd1d5('0x1'));var moment=require(_0xd1d5('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1d5('0x3'));var fs=require('fs');var Redis=require(_0xd1d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1d5('0x5'));var logger=require('../../config/logger')(_0xd1d5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd1d5('0x7'));var client=jayson[_0xd1d5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34dd34,_0x506ff9,_0x3d7907){return new BPromise(function(_0x24613e,_0x85e98c){return client['request'](_0x34dd34,_0x3d7907)['then'](function(_0x1e5038){logger[_0xd1d5('0x9')](_0xd1d5('0xa'),_0x506ff9,_0xd1d5('0xb'));logger['debug'](_0xd1d5('0xc'),_0x506ff9,'request\x20sent',JSON[_0xd1d5('0xd')](_0x1e5038));if(_0x1e5038[_0xd1d5('0xe')]){if(_0x1e5038[_0xd1d5('0xe')][_0xd1d5('0xf')]===0x1f4){logger[_0xd1d5('0xe')](_0xd1d5('0xa'),_0x506ff9,_0x1e5038['error']['message']);return _0x85e98c(_0x1e5038[_0xd1d5('0xe')][_0xd1d5('0x10')]);}logger[_0xd1d5('0xe')](_0xd1d5('0xa'),_0x506ff9,_0x1e5038['error'][_0xd1d5('0x10')]);return _0x24613e(_0x1e5038['error'][_0xd1d5('0x10')]);}else{logger[_0xd1d5('0x9')]('ContactItemType,\x20%s,\x20%s',_0x506ff9,_0xd1d5('0xb'));_0x24613e(_0x1e5038['result'][_0xd1d5('0x10')]);}})['catch'](function(_0x2b2397){logger['error'](_0xd1d5('0xa'),_0x506ff9,_0x2b2397);_0x85e98c(_0x2b2397);});});} \ No newline at end of file +var _0xfba1=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfba1,0x1e5));var _0x1fba=function(_0x5bf2b6,_0xd8b37a){_0x5bf2b6=_0x5bf2b6-0x0;var _0x102b1a=_0xfba1[_0x5bf2b6];return _0x102b1a;};'use strict';var _=require('lodash');var util=require(_0x1fba('0x0'));var moment=require('moment');var BPromise=require(_0x1fba('0x1'));var rs=require(_0x1fba('0x2'));var fs=require('fs');var Redis=require(_0x1fba('0x3'));var db=require(_0x1fba('0x4'))['db'];var utils=require(_0x1fba('0x5'));var logger=require(_0x1fba('0x6'))('rpc');var config=require(_0x1fba('0x7'));var jayson=require(_0x1fba('0x8'));var client=jayson['client'][_0x1fba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18811b,_0x1c710d,_0x5e38f5){return new BPromise(function(_0x15eb48,_0x4f5c0e){return client[_0x1fba('0xa')](_0x18811b,_0x5e38f5)[_0x1fba('0xb')](function(_0x31d989){logger['info']('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x1fba('0xc'));logger[_0x1fba('0xd')](_0x1fba('0xe'),_0x1c710d,'request\x20sent',JSON[_0x1fba('0xf')](_0x31d989));if(_0x31d989[_0x1fba('0x10')]){if(_0x31d989[_0x1fba('0x10')][_0x1fba('0x11')]===0x1f4){logger[_0x1fba('0x10')](_0x1fba('0x12'),_0x1c710d,_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);return _0x4f5c0e(_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);}logger[_0x1fba('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);return _0x15eb48(_0x31d989[_0x1fba('0x10')]['message']);}else{logger[_0x1fba('0x14')](_0x1fba('0x12'),_0x1c710d,_0x1fba('0xc'));_0x15eb48(_0x31d989[_0x1fba('0x15')][_0x1fba('0x13')]);}})[_0x1fba('0x16')](function(_0x8fb2c0){logger[_0x1fba('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x8fb2c0);_0x4f5c0e(_0x8fb2c0);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 4166e4a..7a20e71 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a51=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','multer','connect-timeout','express'];(function(_0x45ea78,_0x31678e){var _0xd722b7=function(_0x25710a){while(--_0x25710a){_0x45ea78['push'](_0x45ea78['shift']());}};_0xd722b7(++_0x31678e);}(_0x3a51,0x69));var _0x13a5=function(_0x1fe58d,_0x327378){_0x1fe58d=_0x1fe58d-0x0;var _0x5119b8=_0x3a51[_0x1fe58d];return _0x5119b8;};'use strict';var multer=require(_0x13a5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x13a5('0x1'));var express=require(_0x13a5('0x2'));var router=express[_0x13a5('0x3')]();var fs_extra=require(_0x13a5('0x4'));var auth=require(_0x13a5('0x5'));var interaction=require(_0x13a5('0x6'));var config=require(_0x13a5('0x7'));var controller=require(_0x13a5('0x8'));router['get']('/',auth[_0x13a5('0x9')](),controller['index']);router[_0x13a5('0xa')](_0x13a5('0xb'),auth['isAuthenticated'](),controller[_0x13a5('0xc')]);router[_0x13a5('0xd')]('/',auth[_0x13a5('0x9')](),controller[_0x13a5('0xe')]);router[_0x13a5('0xf')](_0x13a5('0xb'),auth['isAuthenticated'](),controller[_0x13a5('0x10')]);router[_0x13a5('0x11')](_0x13a5('0xb'),auth[_0x13a5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2629=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x283b3c,_0x3b4675){var _0x1dbb38=function(_0x40134f){while(--_0x40134f){_0x283b3c['push'](_0x283b3c['shift']());}};_0x1dbb38(++_0x3b4675);}(_0x2629,0x88));var _0x9262=function(_0x5460df,_0x33d87b){_0x5460df=_0x5460df-0x0;var _0x246990=_0x2629[_0x5460df];return _0x246990;};'use strict';var multer=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var path=require(_0x9262('0x2'));var timeout=require(_0x9262('0x3'));var express=require('express');var router=express[_0x9262('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9262('0x5'));var interaction=require(_0x9262('0x6'));var config=require(_0x9262('0x7'));var controller=require(_0x9262('0x8'));router[_0x9262('0x9')]('/',auth[_0x9262('0xa')](),controller[_0x9262('0xb')]);router[_0x9262('0x9')](_0x9262('0xc'),auth[_0x9262('0xa')](),controller[_0x9262('0xd')]);router[_0x9262('0xe')]('/',auth[_0x9262('0xa')](),controller[_0x9262('0xf')]);router[_0x9262('0x10')]('/:id',auth[_0x9262('0xa')](),controller[_0x9262('0x11')]);router[_0x9262('0x12')](_0x9262('0xc'),auth['isAuthenticated'](),controller[_0x9262('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 5d24328..bd644df 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 _0xd8b0=['exports','sequelize'];(function(_0x202126,_0x3aff7c){var _0x3327e7=function(_0x580a3c){while(--_0x580a3c){_0x202126['push'](_0x202126['shift']());}};_0x3327e7(++_0x3aff7c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x541d02,_0x6c8fd9){var _0x5afb72=function(_0x1fa5f2){while(--_0x1fa5f2){_0x541d02['push'](_0x541d02['shift']());}};_0x5afb72(++_0x6c8fd9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a6c7d12..cff02bd 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 _0x6747=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','then','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','find','catch','clone','updatedAt','UserProfileSection','userProfileId','autoAssociation','update','destroy','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','order','getItems','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x6747,0x70));var _0x7674=function(_0x132887,_0x8a429e){_0x132887=_0x132887-0x0;var _0x4edd79=_0x6747[_0x132887];return _0x4edd79;};'use strict';var emlformat=require(_0x7674('0x0'));var rimraf=require(_0x7674('0x1'));var zipdir=require(_0x7674('0x2'));var jsonpatch=require(_0x7674('0x3'));var rp=require('request-promise');var moment=require(_0x7674('0x4'));var BPromise=require(_0x7674('0x5'));var Mustache=require('mustache');var util=require(_0x7674('0x6'));var path=require(_0x7674('0x7'));var sox=require('sox');var csv=require(_0x7674('0x8'));var ejs=require(_0x7674('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7674('0xa'));var squel=require(_0x7674('0xb'));var crypto=require('crypto');var jsforce=require(_0x7674('0xc'));var deskjs=require(_0x7674('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7674('0xe'));var Papa=require(_0x7674('0xf'));var Redis=require(_0x7674('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7674('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7674('0x12'));var logger=require(_0x7674('0x13'))(_0x7674('0x14'));var utils=require(_0x7674('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7674('0x16'));var db=require('../../mysqldb')['db'];config[_0x7674('0x17')]=_[_0x7674('0x18')](config[_0x7674('0x17')],{'host':_0x7674('0x19'),'port':0x18eb});var socket=require(_0x7674('0x1a'))(new Redis(config[_0x7674('0x17')]));require(_0x7674('0x1b'))[_0x7674('0x1c')](socket);function respondWithStatusCode(_0x228a5a,_0x341156){_0x341156=_0x341156||0xcc;return function(_0x46dd38){if(_0x46dd38){return _0x228a5a[_0x7674('0x1d')](_0x341156);}return _0x228a5a[_0x7674('0x1e')](_0x341156)[_0x7674('0x1f')]();};}function respondWithResult(_0x394479,_0x44ab2a){_0x44ab2a=_0x44ab2a||0xc8;return function(_0x5db5ad){if(_0x5db5ad){return _0x394479[_0x7674('0x1e')](_0x44ab2a)[_0x7674('0x20')](_0x5db5ad);}};}function respondWithFilteredResult(_0x1b54e2,_0x3ae163){return function(_0x4f8367){if(_0x4f8367){var _0x271be4=typeof _0x3ae163[_0x7674('0x21')]===_0x7674('0x22')&&typeof _0x3ae163[_0x7674('0x23')]==='undefined';var _0x2294c8=_0x4f8367['count'];var _0x2916e2=_0x271be4?0x0:_0x3ae163[_0x7674('0x21')];var _0xd331b3=_0x271be4?_0x4f8367['count']:_0x3ae163[_0x7674('0x21')]+_0x3ae163['limit'];var _0x1c9138;if(_0xd331b3>=_0x2294c8){_0xd331b3=_0x2294c8;_0x1c9138=0xc8;}else{_0x1c9138=0xce;}_0x1b54e2[_0x7674('0x1e')](_0x1c9138);return _0x1b54e2[_0x7674('0x24')](_0x7674('0x25'),_0x2916e2+'-'+_0xd331b3+'/'+_0x2294c8)[_0x7674('0x20')](_0x4f8367);}return null;};}function patchUpdates(_0x51bf58){return function(_0x129354){try{jsonpatch[_0x7674('0x26')](_0x129354,_0x51bf58,!![]);}catch(_0x534212){return BPromise['reject'](_0x534212);}return _0x129354[_0x7674('0x27')]();};}function saveUpdates(_0x402c0c,_0x336caa){return function(_0x11416){if(_0x11416){return _0x11416['update'](_0x402c0c)[_0x7674('0x28')](function(_0x547b71){return _0x547b71;});}return null;};}function removeEntity(_0x3b75ec,_0x202a28){return function(_0x1c19b6){if(_0x1c19b6){return _0x1c19b6['destroy']()[_0x7674('0x28')](function(){var _0x3b9a78=_0x1c19b6['get']({'plain':!![]});var _0x437fc0='CustomDashboards';return db[_0x7674('0x29')]['destroy']({'where':{'type':_0x437fc0,'resourceId':_0x3b9a78['id']}})[_0x7674('0x28')](function(){return _0x1c19b6;});})['then'](function(){_0x3b75ec[_0x7674('0x1e')](0xcc)[_0x7674('0x1f')]();});}};}function handleEntityNotFound(_0x541b73,_0x539343){return function(_0x1fccd9){if(!_0x1fccd9){_0x541b73[_0x7674('0x1d')](0x194);}return _0x1fccd9;};}function handleError(_0x430443,_0x4f8915){_0x4f8915=_0x4f8915||0x1f4;return function(_0x1b593c){logger[_0x7674('0x2a')](_0x1b593c['stack']);if(_0x1b593c[_0x7674('0x2b')]){delete _0x1b593c[_0x7674('0x2b')];}_0x430443['status'](_0x4f8915)[_0x7674('0x2c')](_0x1b593c);};}exports[_0x7674('0x2d')]=function(_0x4a41df,_0x2949cf){var _0x4cf010={},_0x1131c4={},_0x4214b9={'count':0x0,'rows':[]};var _0x11a0ed=_[_0x7674('0x2e')](db[_0x7674('0x2f')][_0x7674('0x30')],function(_0x52b3ba){return{'name':_0x52b3ba['fieldName'],'type':_0x52b3ba['type'][_0x7674('0x31')]};});_0x1131c4[_0x7674('0x32')]=_[_0x7674('0x2e')](_0x11a0ed,'name');_0x1131c4[_0x7674('0x33')]=_[_0x7674('0x34')](_0x4a41df['query']);_0x1131c4[_0x7674('0x35')]=_[_0x7674('0x36')](_0x1131c4[_0x7674('0x32')],_0x1131c4[_0x7674('0x33')]);_0x4cf010[_0x7674('0x37')]=_['intersection'](_0x1131c4['model'],qs['fields'](_0x4a41df[_0x7674('0x33')][_0x7674('0x38')]));_0x4cf010[_0x7674('0x37')]=_0x4cf010[_0x7674('0x37')][_0x7674('0x39')]?_0x4cf010[_0x7674('0x37')]:_0x1131c4['model'];if(!_0x4a41df['query']['hasOwnProperty'](_0x7674('0x3a'))){_0x4cf010[_0x7674('0x23')]=qs[_0x7674('0x23')](_0x4a41df[_0x7674('0x33')]['limit']);_0x4cf010['offset']=qs[_0x7674('0x21')](_0x4a41df['query']['offset']);}_0x4cf010['order']=qs[_0x7674('0x3b')](_0x4a41df['query']['sort']);_0x4cf010['where']=qs['filters'](_[_0x7674('0x3c')](_0x4a41df[_0x7674('0x33')],_0x1131c4[_0x7674('0x35')]),_0x11a0ed);if(_0x4a41df[_0x7674('0x33')]['filter']){_0x4cf010[_0x7674('0x3d')]=_[_0x7674('0x3e')](_0x4cf010[_0x7674('0x3d')],{'$or':_[_0x7674('0x2e')](_0x11a0ed,function(_0x41c726){if(_0x41c726[_0x7674('0x3f')]!==_0x7674('0x40')){var _0x2efb72={};_0x2efb72[_0x41c726[_0x7674('0x2b')]]={'$like':'%'+_0x4a41df[_0x7674('0x33')][_0x7674('0x41')]+'%'};return _0x2efb72;}})});}_0x4cf010=_[_0x7674('0x3e')]({},_0x4cf010,_0x4a41df[_0x7674('0x42')]);var _0x1126ef={'where':_0x4cf010['where']};return db['Dashboard'][_0x7674('0x43')](_0x1126ef)['then'](function(_0x58b5bd){_0x4214b9[_0x7674('0x43')]=_0x58b5bd;if(_0x4a41df['query'][_0x7674('0x44')]){_0x4cf010[_0x7674('0x45')]=[{'all':!![]}];}return db[_0x7674('0x2f')][_0x7674('0x46')](_0x4cf010);})[_0x7674('0x28')](function(_0x1f2545){_0x4214b9[_0x7674('0x47')]=_0x1f2545;return _0x4214b9;})[_0x7674('0x28')](respondWithFilteredResult(_0x2949cf,_0x4cf010))['catch'](handleError(_0x2949cf,null));};exports['show']=function(_0x1ea7ab,_0x4b709){var _0xe95b58={'raw':![],'where':{'id':_0x1ea7ab[_0x7674('0x48')]['id']}},_0x250647={};_0x250647[_0x7674('0x32')]=_[_0x7674('0x34')](db['Dashboard'][_0x7674('0x30')]);_0x250647[_0x7674('0x33')]=_[_0x7674('0x34')](_0x1ea7ab['query']);_0x250647[_0x7674('0x35')]=_[_0x7674('0x36')](_0x250647['model'],_0x250647[_0x7674('0x33')]);_0xe95b58[_0x7674('0x37')]=_[_0x7674('0x36')](_0x250647['model'],qs[_0x7674('0x38')](_0x1ea7ab[_0x7674('0x33')]['fields']));_0xe95b58[_0x7674('0x37')]=_0xe95b58[_0x7674('0x37')]['length']?_0xe95b58[_0x7674('0x37')]:_0x250647['model'];if(_0x1ea7ab[_0x7674('0x33')][_0x7674('0x44')]){_0xe95b58[_0x7674('0x45')]=[{'all':!![]}];}_0xe95b58=_['merge']({},_0xe95b58,_0x1ea7ab['options']);return db[_0x7674('0x2f')]['find'](_0xe95b58)[_0x7674('0x28')](handleEntityNotFound(_0x4b709,null))[_0x7674('0x28')](respondWithResult(_0x4b709,null))['catch'](handleError(_0x4b709,null));};exports[_0x7674('0x49')]=function(_0x139bc5,_0x2bb1a0){return db[_0x7674('0x2f')][_0x7674('0x49')](_0x139bc5[_0x7674('0x4a')],{})[_0x7674('0x28')](function(_0x1dd73a){var _0x5acaf0=_0x139bc5[_0x7674('0x4b')][_0x7674('0x4c')]({'plain':!![]});if(!_0x5acaf0)throw new Error(_0x7674('0x4d'));if(_0x5acaf0[_0x7674('0x4e')]===_0x7674('0x4b')){var _0x1d4d1c=_0x1dd73a[_0x7674('0x4c')]({'plain':!![]});var _0x4076ba=_0x7674('0x4f');return db['UserProfileSection'][_0x7674('0x50')]({'where':{'name':_0x4076ba,'userProfileId':_0x5acaf0['userProfileId']},'raw':!![]})['then'](function(_0x37a9df){if(_0x37a9df&&_0x37a9df['autoAssociation']===0x0){return db[_0x7674('0x29')]['create']({'name':_0x1d4d1c['name'],'resourceId':_0x1d4d1c['id'],'type':_0x37a9df[_0x7674('0x2b')],'sectionId':_0x37a9df['id']},{})[_0x7674('0x28')](function(){return _0x1dd73a;});}else{return _0x1dd73a;}})[_0x7674('0x51')](function(_0x3eafd8){logger[_0x7674('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eafd8);throw _0x3eafd8;});}return _0x1dd73a;})['then'](respondWithResult(_0x2bb1a0,0xc9))[_0x7674('0x51')](handleError(_0x2bb1a0,null));};exports[_0x7674('0x52')]=function(_0x29cd2f,_0x28c1b0){var _0x33b7a6={'where':{'id':_0x29cd2f[_0x7674('0x48')]['id']}},_0x45f2d2={};_0x45f2d2['model']=_[_0x7674('0x34')](db[_0x7674('0x2f')]['rawAttributes']);_0x33b7a6[_0x7674('0x37')]=_['intersection'](_0x45f2d2[_0x7674('0x32')],qs['fields'](_0x29cd2f[_0x7674('0x33')]['fields']));_0x33b7a6[_0x7674('0x37')]=_0x33b7a6[_0x7674('0x37')][_0x7674('0x39')]?_0x33b7a6['attributes']:_0x45f2d2[_0x7674('0x32')];if(_0x29cd2f['query'][_0x7674('0x44')]){_0x33b7a6[_0x7674('0x45')]=[{'all':!![]}];}_0x33b7a6=_[_0x7674('0x3e')]({},_0x33b7a6,_0x29cd2f[_0x7674('0x42')]);return db[_0x7674('0x2f')][_0x7674('0x50')](_0x33b7a6)[_0x7674('0x28')](handleEntityNotFound(_0x28c1b0,null))[_0x7674('0x28')](function(_0x1b37f4){if(_0x1b37f4){var _0x1d3dc3=_0x1b37f4[_0x7674('0x4c')]({'plain':!![]});_0x1d3dc3=qs['omit'](_0x1d3dc3,['id','createdAt',_0x7674('0x53')]);_0x29cd2f[_0x7674('0x4a')]=_['omit'](_0x29cd2f[_0x7674('0x4a')],['id','createdAt',_0x7674('0x53')]);return db['Dashboard']['create'](_['merge'](_0x1d3dc3,_0x29cd2f[_0x7674('0x4a')]),{'include':_0x29cd2f[_0x7674('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x7674('0x28')](function(_0x3b749e){var _0x43a498=_0x29cd2f['user'][_0x7674('0x4c')]({'plain':!![]});if(!_0x43a498)throw new Error(_0x7674('0x4d'));if(_0x43a498[_0x7674('0x4e')]===_0x7674('0x4b')){var _0x1741d9=_0x3b749e['get']({'plain':!![]});var _0x1a00b9=_0x7674('0x4f');return db[_0x7674('0x54')]['find']({'where':{'name':_0x1a00b9,'userProfileId':_0x43a498[_0x7674('0x55')]},'raw':!![]})['then'](function(_0x3c343c){if(_0x3c343c&&_0x3c343c[_0x7674('0x56')]===0x0){return db[_0x7674('0x29')][_0x7674('0x49')]({'name':_0x1741d9[_0x7674('0x2b')],'resourceId':_0x1741d9['id'],'type':_0x3c343c[_0x7674('0x2b')],'sectionId':_0x3c343c['id']},{})[_0x7674('0x28')](function(){return _0x3b749e;});}else{return _0x3b749e;}})[_0x7674('0x51')](function(_0x31919c){logger[_0x7674('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31919c);throw _0x31919c;});}return _0x3b749e;});}})[_0x7674('0x28')](respondWithResult(_0x28c1b0,0xc9))['catch'](handleError(_0x28c1b0,null));};exports[_0x7674('0x57')]=function(_0xde301e,_0x3386b3){if(_0xde301e[_0x7674('0x4a')]['id']){delete _0xde301e[_0x7674('0x4a')]['id'];}return db[_0x7674('0x2f')][_0x7674('0x50')]({'where':{'id':_0xde301e[_0x7674('0x48')]['id']}})[_0x7674('0x28')](handleEntityNotFound(_0x3386b3,null))[_0x7674('0x28')](saveUpdates(_0xde301e[_0x7674('0x4a')],null))[_0x7674('0x28')](respondWithResult(_0x3386b3,null))[_0x7674('0x51')](handleError(_0x3386b3,null));};exports[_0x7674('0x58')]=function(_0x4c2bdb,_0x10428e){return db['Dashboard'][_0x7674('0x50')]({'where':{'id':_0x4c2bdb['params']['id']}})[_0x7674('0x28')](handleEntityNotFound(_0x10428e,null))[_0x7674('0x28')](removeEntity(_0x10428e,null))[_0x7674('0x51')](handleError(_0x10428e,null));};function widgetAttributes(_0x2016c1){try{switch(_0x2016c1[_0x7674('0x3f')]){case _0x7674('0x59'):return[{'name':_0x7674('0x5a'),'value':_0x2016c1[_0x7674('0x5a')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1['attrs'][0x0]?_0x2016c1[_0x7674('0x5b')][0x0][_0x7674('0x5c')]:undefined)||'https://'}];case'custom':return[{'name':_0x7674('0x5d'),'value':_0x2016c1[_0x7674('0x5d')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1[_0x7674('0x5b')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x7674('0x5e'),'value':_0x2016c1['attrHourFormat']||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1[_0x7674('0x5b')][0x0]['value']:undefined)||_0x7674('0x5f')},{'name':_0x7674('0x60'),'value':_0x2016c1[_0x7674('0x60')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x1]?_0x2016c1[_0x7674('0x5b')][0x1][_0x7674('0x5c')]:undefined)||_0x7674('0x61')},{'name':_0x7674('0x62'),'value':_0x2016c1[_0x7674('0x62')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1['attrs'][0x2]?_0x2016c1[_0x7674('0x5b')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x7674('0x63'),'value':_0x2016c1['attrMetric']||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1['attrs'][0x0][_0x7674('0x5c')]:undefined)||_0x7674('0x64')},{'name':_0x7674('0x65'),'value':_0x2016c1[_0x7674('0x65')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x1]?_0x2016c1[_0x7674('0x5b')][0x1]['value']:undefined)||[]},{'name':_0x7674('0x62'),'value':_0x2016c1[_0x7674('0x62')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x2]?_0x2016c1[_0x7674('0x5b')][0x2][_0x7674('0x5c')]:undefined)||0x14},{'name':_0x7674('0x66'),'value':_0x2016c1[_0x7674('0x66')]||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x3]?_0x2016c1['attrs'][0x3][_0x7674('0x5c')]:undefined)||_0x7674('0x67')},{'name':_0x7674('0x68'),'value':_0x2016c1['attrEmailAccounts']||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x4]?_0x2016c1['attrs'][0x4][_0x7674('0x5c')]:undefined)||''},{'name':_0x7674('0x69'),'value':_0x2016c1[_0x7674('0x69')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1['attrs'][0x5]?_0x2016c1['attrs'][0x5]['value']:undefined)||''},{'name':_0x7674('0x6a'),'value':_0x2016c1[_0x7674('0x6a')]||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x6]?_0x2016c1['attrs'][0x6][_0x7674('0x5c')]:undefined)||''},{'name':_0x7674('0x6b'),'value':_0x2016c1[_0x7674('0x6b')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x7]?_0x2016c1[_0x7674('0x5b')][0x7][_0x7674('0x5c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2016c1[_0x7674('0x6c')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x8]?_0x2016c1[_0x7674('0x5b')][0x8]['value']:undefined)||''},{'name':_0x7674('0x6d'),'value':_0x2016c1[_0x7674('0x6d')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1['attrs'][0x9]?_0x2016c1[_0x7674('0x5b')][0x9][_0x7674('0x5c')]:undefined)||''}];case _0x7674('0x6e'):case _0x7674('0x6f'):return[{'name':_0x7674('0x70'),'value':_0x2016c1['attrSerie1']||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1[_0x7674('0x5b')][0x0][_0x7674('0x5c')]:undefined)||'total'},{'name':'attrSerie2','value':_0x2016c1[_0x7674('0x71')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x1]?_0x2016c1['attrs'][0x1][_0x7674('0x5c')]:undefined)||null},{'name':_0x7674('0x72'),'value':_0x2016c1[_0x7674('0x72')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x2]?_0x2016c1['attrs'][0x2][_0x7674('0x5c')]:undefined)||null},{'name':_0x7674('0x65'),'value':_0x2016c1['attrVoiceQueues']||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x3]?_0x2016c1[_0x7674('0x5b')][0x3][_0x7674('0x5c')]:undefined)||[]},{'name':_0x7674('0x66'),'value':_0x2016c1[_0x7674('0x66')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x4]?_0x2016c1[_0x7674('0x5b')][0x4][_0x7674('0x5c')]:undefined)||_0x7674('0x67')},{'name':_0x7674('0x68'),'value':_0x2016c1[_0x7674('0x68')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x5]?_0x2016c1['attrs'][0x5]['value']:undefined)||''},{'name':_0x7674('0x69'),'value':_0x2016c1[_0x7674('0x69')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x6]?_0x2016c1[_0x7674('0x5b')][0x6][_0x7674('0x5c')]:undefined)||''},{'name':_0x7674('0x6a'),'value':_0x2016c1['attrSmsAccounts']||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x7]?_0x2016c1[_0x7674('0x5b')][0x7][_0x7674('0x5c')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2016c1[_0x7674('0x6b')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1['attrs'][0x8]?_0x2016c1[_0x7674('0x5b')][0x8][_0x7674('0x5c')]:undefined)||''},{'name':_0x7674('0x6c'),'value':_0x2016c1[_0x7674('0x6c')]||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x9]?_0x2016c1[_0x7674('0x5b')][0x9][_0x7674('0x5c')]:undefined)||''},{'name':_0x7674('0x6d'),'value':_0x2016c1[_0x7674('0x6d')]||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0xa]?_0x2016c1[_0x7674('0x5b')][0xa][_0x7674('0x5c')]:undefined)||''}];case _0x7674('0x73'):return[{'name':_0x7674('0x74'),'type':_0x2016c1[_0x7674('0x75')]||(_0x2016c1['attrs']&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1[_0x7674('0x5b')][0x0][_0x7674('0x3f')]:undefined)||null,'value':_0x2016c1[_0x7674('0x74')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x0]?_0x2016c1[_0x7674('0x5b')][0x0][_0x7674('0x5c')]:undefined)||null},{'name':_0x7674('0x76'),'value':_0x2016c1[_0x7674('0x76')]||(_0x2016c1[_0x7674('0x5b')]&&_0x2016c1[_0x7674('0x5b')][0x1]?_0x2016c1[_0x7674('0x5b')][0x1][_0x7674('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x45d8e8){logger[_0x7674('0x2a')](_0x7674('0x77'),JSON[_0x7674('0x78')](_0x45d8e8));return[];}}exports[_0x7674('0x79')]=function(_0x3fbad6,_0x34f414,_0x10ec40){if(_0x3fbad6[_0x7674('0x4a')]['id']){delete _0x3fbad6[_0x7674('0x4a')]['id'];}return db[_0x7674('0x2f')][_0x7674('0x50')]({'where':{'id':_0x3fbad6['params']['id']}})[_0x7674('0x28')](handleEntityNotFound(_0x34f414,null))[_0x7674('0x28')](function(_0x5a0a31){if(_0x5a0a31){_0x3fbad6[_0x7674('0x4a')][_0x7674('0x7a')]=_0x5a0a31['id'];_0x3fbad6[_0x7674('0x4a')][_0x7674('0x5b')]=widgetAttributes(_0x3fbad6[_0x7674('0x4a')]);return db[_0x7674('0x7b')][_0x7674('0x49')](_0x3fbad6[_0x7674('0x4a')]);}})[_0x7674('0x28')](respondWithResult(_0x34f414,null))[_0x7674('0x51')](handleError(_0x34f414,null));};exports['getItems']=function(_0x934963,_0x3b3c9a,_0x219ecf){var _0x148f32={};var _0x3d5167={};var _0x2dee13;var _0x2e94c8;return db[_0x7674('0x2f')]['findOne']({'where':{'id':_0x934963[_0x7674('0x48')]['id']}})[_0x7674('0x28')](handleEntityNotFound(_0x3b3c9a,null))['then'](function(_0x41b2d4){if(_0x41b2d4){_0x2dee13=_0x41b2d4;_0x3d5167[_0x7674('0x32')]=_[_0x7674('0x34')](db['DashboardItem'][_0x7674('0x30')]);_0x3d5167[_0x7674('0x33')]=_[_0x7674('0x34')](_0x934963[_0x7674('0x33')]);_0x3d5167['filters']=_[_0x7674('0x36')](_0x3d5167[_0x7674('0x32')],_0x3d5167[_0x7674('0x33')]);_0x148f32[_0x7674('0x37')]=_[_0x7674('0x36')](_0x3d5167[_0x7674('0x32')],qs[_0x7674('0x38')](_0x934963[_0x7674('0x33')][_0x7674('0x38')]));_0x148f32[_0x7674('0x37')]=_0x148f32[_0x7674('0x37')][_0x7674('0x39')]?_0x148f32[_0x7674('0x37')]:_0x3d5167['model'];_0x148f32[_0x7674('0x7c')]=qs[_0x7674('0x3b')](_0x934963[_0x7674('0x33')][_0x7674('0x3b')]);_0x148f32[_0x7674('0x3d')]=qs[_0x7674('0x35')](_[_0x7674('0x3c')](_0x934963[_0x7674('0x33')],_0x3d5167[_0x7674('0x35')]));if(_0x934963[_0x7674('0x33')][_0x7674('0x41')]){_0x148f32[_0x7674('0x3d')]=_['merge'](_0x148f32[_0x7674('0x3d')],{'$or':_[_0x7674('0x2e')](_0x148f32['attributes'],function(_0x4bcdf2){var _0x21ef66={};_0x21ef66[_0x4bcdf2]={'$like':'%'+_0x934963[_0x7674('0x33')]['filter']+'%'};return _0x21ef66;})});}_0x148f32=_[_0x7674('0x3e')]({},_0x148f32,_0x934963[_0x7674('0x42')]);return _0x2dee13[_0x7674('0x7d')](_0x148f32);}})['then'](function(_0x3f3b71){if(_0x3f3b71){_0x2e94c8=_0x3f3b71[_0x7674('0x39')];if(!_0x934963[_0x7674('0x33')][_0x7674('0x7e')](_0x7674('0x3a'))){_0x148f32['limit']=qs[_0x7674('0x23')](_0x934963['query'][_0x7674('0x23')]);_0x148f32['offset']=qs[_0x7674('0x21')](_0x934963[_0x7674('0x33')][_0x7674('0x21')]);}return _0x2dee13[_0x7674('0x7d')](_0x148f32);}})[_0x7674('0x28')](function(_0x50d121){if(_0x50d121){return _0x50d121?{'count':_0x2e94c8,'rows':_0x50d121}:null;}})[_0x7674('0x28')](respondWithResult(_0x3b3c9a,null))[_0x7674('0x51')](handleError(_0x3b3c9a,null));}; \ No newline at end of file +var _0x4ae9=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Dashboard','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','attrUrl','attrs','https://','custom','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x39f56d,_0x1fdfc1){var _0x3f6f62=function(_0x3ec689){while(--_0x3ec689){_0x39f56d['push'](_0x39f56d['shift']());}};_0x3f6f62(++_0x1fdfc1);}(_0x4ae9,0x92));var _0x94ae=function(_0x2a9490,_0x43cb5f){_0x2a9490=_0x2a9490-0x0;var _0x5bf90e=_0x4ae9[_0x2a9490];return _0x5bf90e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94ae('0x0'));var zipdir=require(_0x94ae('0x1'));var jsonpatch=require(_0x94ae('0x2'));var rp=require(_0x94ae('0x3'));var moment=require('moment');var BPromise=require(_0x94ae('0x4'));var Mustache=require(_0x94ae('0x5'));var util=require('util');var path=require(_0x94ae('0x6'));var sox=require(_0x94ae('0x7'));var csv=require(_0x94ae('0x8'));var ejs=require(_0x94ae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ae('0xa'));var squel=require(_0x94ae('0xb'));var crypto=require('crypto');var jsforce=require(_0x94ae('0xc'));var deskjs=require(_0x94ae('0xd'));var toCsv=require(_0x94ae('0x8'));var querystring=require(_0x94ae('0xe'));var Papa=require(_0x94ae('0xf'));var Redis=require(_0x94ae('0x10'));var authService=require(_0x94ae('0x11'));var qs=require(_0x94ae('0x12'));var as=require(_0x94ae('0x13'));var hardwareService=require(_0x94ae('0x14'));var logger=require(_0x94ae('0x15'))('api');var utils=require(_0x94ae('0x16'));var config=require(_0x94ae('0x17'));var licenseUtil=require(_0x94ae('0x18'));var db=require('../../mysqldb')['db'];config[_0x94ae('0x19')]=_['defaults'](config[_0x94ae('0x19')],{'host':_0x94ae('0x1a'),'port':0x18eb});var socket=require(_0x94ae('0x1b'))(new Redis(config[_0x94ae('0x19')]));require(_0x94ae('0x1c'))[_0x94ae('0x1d')](socket);function respondWithStatusCode(_0x56dcf3,_0x4f82e4){_0x4f82e4=_0x4f82e4||0xcc;return function(_0x445ff0){if(_0x445ff0){return _0x56dcf3[_0x94ae('0x1e')](_0x4f82e4);}return _0x56dcf3[_0x94ae('0x1f')](_0x4f82e4)[_0x94ae('0x20')]();};}function respondWithResult(_0x5ca4c7,_0x4aff36){_0x4aff36=_0x4aff36||0xc8;return function(_0x3a3491){if(_0x3a3491){return _0x5ca4c7['status'](_0x4aff36)[_0x94ae('0x21')](_0x3a3491);}};}function respondWithFilteredResult(_0x8abb4c,_0x3c7bbd){return function(_0x35d666){if(_0x35d666){var _0x12b7e6=typeof _0x3c7bbd['offset']===_0x94ae('0x22')&&typeof _0x3c7bbd[_0x94ae('0x23')]===_0x94ae('0x22');var _0x2c862f=_0x35d666[_0x94ae('0x24')];var _0x2e38c9=_0x12b7e6?0x0:_0x3c7bbd[_0x94ae('0x25')];var _0x4ca268=_0x12b7e6?_0x35d666[_0x94ae('0x24')]:_0x3c7bbd[_0x94ae('0x25')]+_0x3c7bbd[_0x94ae('0x23')];var _0x1e076f;if(_0x4ca268>=_0x2c862f){_0x4ca268=_0x2c862f;_0x1e076f=0xc8;}else{_0x1e076f=0xce;}_0x8abb4c[_0x94ae('0x1f')](_0x1e076f);return _0x8abb4c['set'](_0x94ae('0x26'),_0x2e38c9+'-'+_0x4ca268+'/'+_0x2c862f)[_0x94ae('0x21')](_0x35d666);}return null;};}function patchUpdates(_0x44e17c){return function(_0x2384b6){try{jsonpatch[_0x94ae('0x27')](_0x2384b6,_0x44e17c,!![]);}catch(_0x1f1126){return BPromise[_0x94ae('0x28')](_0x1f1126);}return _0x2384b6['save']();};}function saveUpdates(_0x3b493c,_0x1d6b94){return function(_0x4ae81d){if(_0x4ae81d){return _0x4ae81d[_0x94ae('0x29')](_0x3b493c)[_0x94ae('0x2a')](function(_0x47c1a1){return _0x47c1a1;});}return null;};}function removeEntity(_0x1f301a,_0x54ce21){return function(_0x5403a8){if(_0x5403a8){return _0x5403a8[_0x94ae('0x2b')]()[_0x94ae('0x2a')](function(){var _0x346ae5=_0x5403a8[_0x94ae('0x2c')]({'plain':!![]});var _0x251c7e='CustomDashboards';return db[_0x94ae('0x2d')][_0x94ae('0x2b')]({'where':{'type':_0x251c7e,'resourceId':_0x346ae5['id']}})[_0x94ae('0x2a')](function(){return _0x5403a8;});})[_0x94ae('0x2a')](function(){_0x1f301a[_0x94ae('0x1f')](0xcc)[_0x94ae('0x20')]();});}};}function handleEntityNotFound(_0x1a0a4b,_0x232aea){return function(_0x4acc85){if(!_0x4acc85){_0x1a0a4b['sendStatus'](0x194);}return _0x4acc85;};}function handleError(_0x2b851d,_0x31ec8e){_0x31ec8e=_0x31ec8e||0x1f4;return function(_0x1b8e53){logger[_0x94ae('0x2e')](_0x1b8e53[_0x94ae('0x2f')]);if(_0x1b8e53[_0x94ae('0x30')]){delete _0x1b8e53[_0x94ae('0x30')];}_0x2b851d[_0x94ae('0x1f')](_0x31ec8e)[_0x94ae('0x31')](_0x1b8e53);};}exports['index']=function(_0x481d62,_0x1300f6){var _0x49dd52={},_0x2e4731={},_0xebb7ff={'count':0x0,'rows':[]};var _0x361eb9=_[_0x94ae('0x32')](db[_0x94ae('0x33')][_0x94ae('0x34')],function(_0x183723){return{'name':_0x183723['fieldName'],'type':_0x183723[_0x94ae('0x35')][_0x94ae('0x36')]};});_0x2e4731[_0x94ae('0x37')]=_[_0x94ae('0x32')](_0x361eb9,_0x94ae('0x30'));_0x2e4731['query']=_[_0x94ae('0x38')](_0x481d62[_0x94ae('0x39')]);_0x2e4731[_0x94ae('0x3a')]=_[_0x94ae('0x3b')](_0x2e4731['model'],_0x2e4731[_0x94ae('0x39')]);_0x49dd52[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x2e4731[_0x94ae('0x37')],qs[_0x94ae('0x3d')](_0x481d62['query'][_0x94ae('0x3d')]));_0x49dd52[_0x94ae('0x3c')]=_0x49dd52['attributes'][_0x94ae('0x3e')]?_0x49dd52[_0x94ae('0x3c')]:_0x2e4731['model'];if(!_0x481d62[_0x94ae('0x39')][_0x94ae('0x3f')](_0x94ae('0x40'))){_0x49dd52[_0x94ae('0x23')]=qs[_0x94ae('0x23')](_0x481d62['query']['limit']);_0x49dd52[_0x94ae('0x25')]=qs[_0x94ae('0x25')](_0x481d62[_0x94ae('0x39')]['offset']);}_0x49dd52[_0x94ae('0x41')]=qs['sort'](_0x481d62[_0x94ae('0x39')][_0x94ae('0x42')]);_0x49dd52[_0x94ae('0x43')]=qs[_0x94ae('0x3a')](_[_0x94ae('0x44')](_0x481d62['query'],_0x2e4731['filters']),_0x361eb9);if(_0x481d62[_0x94ae('0x39')][_0x94ae('0x45')]){_0x49dd52[_0x94ae('0x43')]=_['merge'](_0x49dd52[_0x94ae('0x43')],{'$or':_[_0x94ae('0x32')](_0x361eb9,function(_0x280b08){if(_0x280b08[_0x94ae('0x35')]!=='VIRTUAL'){var _0x38997a={};_0x38997a[_0x280b08[_0x94ae('0x30')]]={'$like':'%'+_0x481d62[_0x94ae('0x39')][_0x94ae('0x45')]+'%'};return _0x38997a;}})});}_0x49dd52=_[_0x94ae('0x46')]({},_0x49dd52,_0x481d62[_0x94ae('0x47')]);var _0x1bc83c={'where':_0x49dd52['where']};return db[_0x94ae('0x33')][_0x94ae('0x24')](_0x1bc83c)[_0x94ae('0x2a')](function(_0x40c1a6){_0xebb7ff[_0x94ae('0x24')]=_0x40c1a6;if(_0x481d62[_0x94ae('0x39')][_0x94ae('0x48')]){_0x49dd52['include']=[{'all':!![]}];}return db[_0x94ae('0x33')][_0x94ae('0x49')](_0x49dd52);})[_0x94ae('0x2a')](function(_0x463ea2){_0xebb7ff[_0x94ae('0x4a')]=_0x463ea2;return _0xebb7ff;})['then'](respondWithFilteredResult(_0x1300f6,_0x49dd52))[_0x94ae('0x4b')](handleError(_0x1300f6,null));};exports[_0x94ae('0x4c')]=function(_0x2aa1e5,_0x51361e){var _0x241928={'raw':![],'where':{'id':_0x2aa1e5[_0x94ae('0x4d')]['id']}},_0x1fdf79={};_0x1fdf79['model']=_[_0x94ae('0x38')](db[_0x94ae('0x33')][_0x94ae('0x34')]);_0x1fdf79[_0x94ae('0x39')]=_[_0x94ae('0x38')](_0x2aa1e5[_0x94ae('0x39')]);_0x1fdf79[_0x94ae('0x3a')]=_[_0x94ae('0x3b')](_0x1fdf79[_0x94ae('0x37')],_0x1fdf79[_0x94ae('0x39')]);_0x241928[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x1fdf79[_0x94ae('0x37')],qs['fields'](_0x2aa1e5[_0x94ae('0x39')]['fields']));_0x241928[_0x94ae('0x3c')]=_0x241928['attributes']['length']?_0x241928['attributes']:_0x1fdf79[_0x94ae('0x37')];if(_0x2aa1e5[_0x94ae('0x39')][_0x94ae('0x48')]){_0x241928[_0x94ae('0x4e')]=[{'all':!![]}];}_0x241928=_[_0x94ae('0x46')]({},_0x241928,_0x2aa1e5[_0x94ae('0x47')]);return db[_0x94ae('0x33')][_0x94ae('0x4f')](_0x241928)[_0x94ae('0x2a')](handleEntityNotFound(_0x51361e,null))[_0x94ae('0x2a')](respondWithResult(_0x51361e,null))['catch'](handleError(_0x51361e,null));};exports[_0x94ae('0x50')]=function(_0x3e5af2,_0x4d57c1){return db['Dashboard'][_0x94ae('0x50')](_0x3e5af2[_0x94ae('0x51')],{})[_0x94ae('0x2a')](function(_0x544a32){var _0x1e04cb=_0x3e5af2[_0x94ae('0x52')]['get']({'plain':!![]});if(!_0x1e04cb)throw new Error(_0x94ae('0x53'));if(_0x1e04cb[_0x94ae('0x54')]===_0x94ae('0x52')){var _0x193287=_0x544a32['get']({'plain':!![]});var _0x473798=_0x94ae('0x55');return db['UserProfileSection'][_0x94ae('0x4f')]({'where':{'name':_0x473798,'userProfileId':_0x1e04cb[_0x94ae('0x56')]},'raw':!![]})[_0x94ae('0x2a')](function(_0x2d6286){if(_0x2d6286&&_0x2d6286[_0x94ae('0x57')]===0x0){return db[_0x94ae('0x2d')][_0x94ae('0x50')]({'name':_0x193287['name'],'resourceId':_0x193287['id'],'type':_0x2d6286[_0x94ae('0x30')],'sectionId':_0x2d6286['id']},{})['then'](function(){return _0x544a32;});}else{return _0x544a32;}})['catch'](function(_0x268d50){logger['error'](_0x94ae('0x58'),_0x268d50);throw _0x268d50;});}return _0x544a32;})[_0x94ae('0x2a')](respondWithResult(_0x4d57c1,0xc9))[_0x94ae('0x4b')](handleError(_0x4d57c1,null));};exports[_0x94ae('0x59')]=function(_0xb14539,_0x24b17d){var _0x33ffe3={'where':{'id':_0xb14539['params']['id']}},_0x5322fb={};_0x5322fb[_0x94ae('0x37')]=_['keys'](db[_0x94ae('0x33')]['rawAttributes']);_0x33ffe3[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x5322fb[_0x94ae('0x37')],qs[_0x94ae('0x3d')](_0xb14539[_0x94ae('0x39')][_0x94ae('0x3d')]));_0x33ffe3[_0x94ae('0x3c')]=_0x33ffe3[_0x94ae('0x3c')][_0x94ae('0x3e')]?_0x33ffe3[_0x94ae('0x3c')]:_0x5322fb[_0x94ae('0x37')];if(_0xb14539[_0x94ae('0x39')][_0x94ae('0x48')]){_0x33ffe3['include']=[{'all':!![]}];}_0x33ffe3=_[_0x94ae('0x46')]({},_0x33ffe3,_0xb14539[_0x94ae('0x47')]);return db[_0x94ae('0x33')]['find'](_0x33ffe3)[_0x94ae('0x2a')](handleEntityNotFound(_0x24b17d,null))[_0x94ae('0x2a')](function(_0x506253){if(_0x506253){var _0x2910af=_0x506253['get']({'plain':!![]});_0x2910af=qs[_0x94ae('0x5a')](_0x2910af,['id',_0x94ae('0x5b'),_0x94ae('0x5c')]);_0xb14539['body']=_[_0x94ae('0x5a')](_0xb14539[_0x94ae('0x51')],['id',_0x94ae('0x5b'),_0x94ae('0x5c')]);return db[_0x94ae('0x33')]['create'](_[_0x94ae('0x46')](_0x2910af,_0xb14539[_0x94ae('0x51')]),{'include':_0xb14539[_0x94ae('0x39')][_0x94ae('0x48')]?[{'all':!![]}]:undefined})[_0x94ae('0x2a')](function(_0x5222e9){var _0x3edc2a=_0xb14539[_0x94ae('0x52')][_0x94ae('0x2c')]({'plain':!![]});if(!_0x3edc2a)throw new Error(_0x94ae('0x53'));if(_0x3edc2a[_0x94ae('0x54')]===_0x94ae('0x52')){var _0x4fbb4b=_0x5222e9[_0x94ae('0x2c')]({'plain':!![]});var _0x7ed1f7=_0x94ae('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x7ed1f7,'userProfileId':_0x3edc2a[_0x94ae('0x56')]},'raw':!![]})[_0x94ae('0x2a')](function(_0x3dc759){if(_0x3dc759&&_0x3dc759[_0x94ae('0x57')]===0x0){return db['UserProfileResource'][_0x94ae('0x50')]({'name':_0x4fbb4b[_0x94ae('0x30')],'resourceId':_0x4fbb4b['id'],'type':_0x3dc759['name'],'sectionId':_0x3dc759['id']},{})[_0x94ae('0x2a')](function(){return _0x5222e9;});}else{return _0x5222e9;}})[_0x94ae('0x4b')](function(_0x3be468){logger[_0x94ae('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3be468);throw _0x3be468;});}return _0x5222e9;});}})[_0x94ae('0x2a')](respondWithResult(_0x24b17d,0xc9))[_0x94ae('0x4b')](handleError(_0x24b17d,null));};exports[_0x94ae('0x29')]=function(_0x1ebc70,_0x5bb741){if(_0x1ebc70[_0x94ae('0x51')]['id']){delete _0x1ebc70[_0x94ae('0x51')]['id'];}return db[_0x94ae('0x33')][_0x94ae('0x4f')]({'where':{'id':_0x1ebc70[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x5bb741,null))['then'](saveUpdates(_0x1ebc70[_0x94ae('0x51')],null))[_0x94ae('0x2a')](respondWithResult(_0x5bb741,null))['catch'](handleError(_0x5bb741,null));};exports[_0x94ae('0x2b')]=function(_0x594db1,_0x4fd837){return db[_0x94ae('0x33')][_0x94ae('0x4f')]({'where':{'id':_0x594db1[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x4fd837,null))[_0x94ae('0x2a')](removeEntity(_0x4fd837,null))[_0x94ae('0x4b')](handleError(_0x4fd837,null));};function widgetAttributes(_0x58332e){try{switch(_0x58332e[_0x94ae('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x58332e[_0x94ae('0x5d')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0]['value']:undefined)||_0x94ae('0x5f')}];case _0x94ae('0x60'):return[{'name':_0x94ae('0x61'),'value':_0x58332e[_0x94ae('0x61')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x63'):return[{'name':'attrHourFormat','value':_0x58332e['attrHourFormat']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x62')]:undefined)||_0x94ae('0x64')},{'name':'attrTimezone','value':_0x58332e[_0x94ae('0x65')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||_0x94ae('0x66')},{'name':'attrFontSize','value':_0x58332e[_0x94ae('0x67')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e['attrs'][0x2]['value']:undefined)||0xc}];case _0x94ae('0x68'):return[{'name':'attrMetric','value':_0x58332e[_0x94ae('0x69')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||_0x94ae('0x6a')},{'name':'attrVoiceQueues','value':_0x58332e[_0x94ae('0x6b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||[]},{'name':_0x94ae('0x67'),'value':_0x58332e['attrFontSize']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x94ae('0x6c'),'value':_0x58332e[_0x94ae('0x6c')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x3]?_0x58332e[_0x94ae('0x5e')][0x3][_0x94ae('0x62')]:undefined)||_0x94ae('0x6d')},{'name':_0x94ae('0x6e'),'value':_0x58332e['attrEmailAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x4]?_0x58332e[_0x94ae('0x5e')][0x4][_0x94ae('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x58332e[_0x94ae('0x6f')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x5]?_0x58332e['attrs'][0x5][_0x94ae('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x58332e[_0x94ae('0x70')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x6]?_0x58332e['attrs'][0x6][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x71'),'value':_0x58332e['attrOpenchannelAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x7]?_0x58332e[_0x94ae('0x5e')][0x7][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x72'),'value':_0x58332e['attrWhatsappAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x8]?_0x58332e[_0x94ae('0x5e')][0x8][_0x94ae('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x58332e[_0x94ae('0x73')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x9]?_0x58332e[_0x94ae('0x5e')][0x9][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x74'):case _0x94ae('0x75'):return[{'name':'attrSerie1','value':_0x58332e[_0x94ae('0x76')]||(_0x58332e['attrs']&&_0x58332e['attrs'][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||_0x94ae('0x6a')},{'name':_0x94ae('0x77'),'value':_0x58332e[_0x94ae('0x77')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||null},{'name':_0x94ae('0x78'),'value':_0x58332e[_0x94ae('0x78')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e[_0x94ae('0x5e')][0x2][_0x94ae('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x58332e[_0x94ae('0x6b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x3]?_0x58332e['attrs'][0x3]['value']:undefined)||[]},{'name':_0x94ae('0x6c'),'value':_0x58332e[_0x94ae('0x6c')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x4]?_0x58332e[_0x94ae('0x5e')][0x4][_0x94ae('0x62')]:undefined)||_0x94ae('0x6d')},{'name':_0x94ae('0x6e'),'value':_0x58332e[_0x94ae('0x6e')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x5]?_0x58332e['attrs'][0x5][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x6f'),'value':_0x58332e[_0x94ae('0x6f')]||(_0x58332e['attrs']&&_0x58332e['attrs'][0x6]?_0x58332e[_0x94ae('0x5e')][0x6][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x70'),'value':_0x58332e[_0x94ae('0x70')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x7]?_0x58332e[_0x94ae('0x5e')][0x7][_0x94ae('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x58332e[_0x94ae('0x71')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x8]?_0x58332e[_0x94ae('0x5e')][0x8][_0x94ae('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x58332e[_0x94ae('0x72')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x9]?_0x58332e[_0x94ae('0x5e')][0x9]['value']:undefined)||''},{'name':_0x94ae('0x73'),'value':_0x58332e[_0x94ae('0x73')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0xa]?_0x58332e[_0x94ae('0x5e')][0xa][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x79'):return[{'name':'attrReport','type':_0x58332e[_0x94ae('0x7a')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x35')]:undefined)||null,'value':_0x58332e['attrReport']||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||null},{'name':_0x94ae('0x7b'),'value':_0x58332e[_0x94ae('0x7b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x1]?_0x58332e[_0x94ae('0x5e')][0x1][_0x94ae('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x120a01){logger[_0x94ae('0x2e')](_0x94ae('0x7c'),JSON['stringify'](_0x120a01));return[];}}exports[_0x94ae('0x7d')]=function(_0x51ec00,_0x220c80,_0x23174e){if(_0x51ec00[_0x94ae('0x51')]['id']){delete _0x51ec00[_0x94ae('0x51')]['id'];}return db['Dashboard'][_0x94ae('0x4f')]({'where':{'id':_0x51ec00[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x220c80,null))[_0x94ae('0x2a')](function(_0x98eed3){if(_0x98eed3){_0x51ec00[_0x94ae('0x51')][_0x94ae('0x7e')]=_0x98eed3['id'];_0x51ec00[_0x94ae('0x51')][_0x94ae('0x5e')]=widgetAttributes(_0x51ec00[_0x94ae('0x51')]);return db['DashboardItem'][_0x94ae('0x50')](_0x51ec00[_0x94ae('0x51')]);}})[_0x94ae('0x2a')](respondWithResult(_0x220c80,null))[_0x94ae('0x4b')](handleError(_0x220c80,null));};exports[_0x94ae('0x7f')]=function(_0x5f1fed,_0x55afbf,_0x2e6b56){var _0x3b0f38={};var _0x7b17f0={};var _0x458c2c;var _0x52044e;return db['Dashboard'][_0x94ae('0x80')]({'where':{'id':_0x5f1fed[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x55afbf,null))[_0x94ae('0x2a')](function(_0x5a8637){if(_0x5a8637){_0x458c2c=_0x5a8637;_0x7b17f0[_0x94ae('0x37')]=_[_0x94ae('0x38')](db[_0x94ae('0x81')][_0x94ae('0x34')]);_0x7b17f0['query']=_['keys'](_0x5f1fed[_0x94ae('0x39')]);_0x7b17f0[_0x94ae('0x3a')]=_['intersection'](_0x7b17f0[_0x94ae('0x37')],_0x7b17f0[_0x94ae('0x39')]);_0x3b0f38[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x7b17f0['model'],qs['fields'](_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x3d')]));_0x3b0f38[_0x94ae('0x3c')]=_0x3b0f38[_0x94ae('0x3c')][_0x94ae('0x3e')]?_0x3b0f38['attributes']:_0x7b17f0[_0x94ae('0x37')];_0x3b0f38[_0x94ae('0x41')]=qs[_0x94ae('0x42')](_0x5f1fed['query'][_0x94ae('0x42')]);_0x3b0f38[_0x94ae('0x43')]=qs[_0x94ae('0x3a')](_['pick'](_0x5f1fed[_0x94ae('0x39')],_0x7b17f0[_0x94ae('0x3a')]));if(_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x45')]){_0x3b0f38[_0x94ae('0x43')]=_[_0x94ae('0x46')](_0x3b0f38[_0x94ae('0x43')],{'$or':_[_0x94ae('0x32')](_0x3b0f38[_0x94ae('0x3c')],function(_0x2cacbc){var _0x1294c6={};_0x1294c6[_0x2cacbc]={'$like':'%'+_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x45')]+'%'};return _0x1294c6;})});}_0x3b0f38=_[_0x94ae('0x46')]({},_0x3b0f38,_0x5f1fed[_0x94ae('0x47')]);return _0x458c2c[_0x94ae('0x7f')](_0x3b0f38);}})[_0x94ae('0x2a')](function(_0x380d64){if(_0x380d64){_0x52044e=_0x380d64[_0x94ae('0x3e')];if(!_0x5f1fed[_0x94ae('0x39')]['hasOwnProperty'](_0x94ae('0x40'))){_0x3b0f38[_0x94ae('0x23')]=qs['limit'](_0x5f1fed[_0x94ae('0x39')]['limit']);_0x3b0f38['offset']=qs[_0x94ae('0x25')](_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x25')]);}return _0x458c2c['getItems'](_0x3b0f38);}})[_0x94ae('0x2a')](function(_0x3ac769){if(_0x3ac769){return _0x3ac769?{'count':_0x52044e,'rows':_0x3ac769}:null;}})['then'](respondWithResult(_0x55afbf,null))[_0x94ae('0x4b')](handleError(_0x55afbf,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index a565078..4b49632 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 _0xcb04=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4cb0('0x0'));var Dashboard=require(_0x4cb0('0x1'))['db'][_0x4cb0('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4cb0('0x3')](0x0);var events={'afterCreate':_0x4cb0('0x4'),'afterUpdate':_0x4cb0('0x5'),'afterDestroy':_0x4cb0('0x6')};function emitEvent(_0x2f1690){return function(_0x392bd7,_0x3939b4,_0x47aae7){DashboardEvents[_0x4cb0('0x7')](_0x2f1690+':'+_0x392bd7['id'],_0x392bd7);DashboardEvents[_0x4cb0('0x7')](_0x2f1690,_0x392bd7);_0x47aae7(null);};}for(var e in events){if(events[_0x4cb0('0x8')](e)){var event=events[e];Dashboard[_0x4cb0('0x9')](e,emitEvent(event));}}module[_0x4cb0('0xa')]=DashboardEvents; \ No newline at end of file +var _0x0d78=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x0d78,0x134));var _0x80d7=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x0d78[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x80d7('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80d7('0x1'),'afterDestroy':_0x80d7('0x2')};function emitEvent(_0xdce367){return function(_0x27b4b7,_0x5b96f3,_0x27dd1c){DashboardEvents['emit'](_0xdce367+':'+_0x27b4b7['id'],_0x27b4b7);DashboardEvents[_0x80d7('0x3')](_0xdce367,_0x27b4b7);_0x27dd1c(null);};}for(var e in events){if(events[_0x80d7('0x4')](e)){var event=events[e];Dashboard[_0x80d7('0x5')](e,emitEvent(event));}}module[_0x80d7('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 3beffd6..662f71b 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 _0x6c1d=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash'];(function(_0x2b8a91,_0x3d9cc3){var _0x5240c0=function(_0x301393){while(--_0x301393){_0x2b8a91['push'](_0x2b8a91['shift']());}};_0x5240c0(++_0x3d9cc3);}(_0x6c1d,0xa4));var _0xd6c1=function(_0x1e2c07,_0x24ce44){_0x1e2c07=_0x1e2c07-0x0;var _0x6d9e9=_0x6c1d[_0x1e2c07];return _0x6d9e9;};'use strict';var _=require(_0xd6c1('0x0'));var util=require('util');var logger=require(_0xd6c1('0x1'))(_0xd6c1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd6c1('0x3'));var fs=require('fs');var path=require(_0xd6c1('0x4'));var rimraf=require(_0xd6c1('0x5'));var config=require(_0xd6c1('0x6'));var attributes=require(_0xd6c1('0x7'));module[_0xd6c1('0x8')]=function(_0x255d90,_0x1e8394){return _0x255d90['define'](_0xd6c1('0x9'),attributes,{'tableName':_0xd6c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf408=['define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf408,0x199));var _0x8f40=function(_0x18032f,_0x4f4e45){_0x18032f=_0x18032f-0x0;var _0xb0b2b8=_0xf408[_0x18032f];return _0xb0b2b8;};'use strict';var _=require(_0x8f40('0x0'));var util=require(_0x8f40('0x1'));var logger=require(_0x8f40('0x2'))('api');var moment=require(_0x8f40('0x3'));var BPromise=require(_0x8f40('0x4'));var rp=require(_0x8f40('0x5'));var fs=require('fs');var path=require(_0x8f40('0x6'));var rimraf=require(_0x8f40('0x7'));var config=require(_0x8f40('0x8'));var attributes=require(_0x8f40('0x9'));module[_0x8f40('0xa')]=function(_0x188ff8,_0x15def3){return _0x188ff8[_0x8f40('0xb')](_0x8f40('0xc'),attributes,{'tableName':_0x8f40('0xd'),'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 5c0cff7..b02ef55 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 _0xe8fd=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2a5310,_0x41dfcf){var _0x144037=function(_0xe6447f){while(--_0xe6447f){_0x2a5310['push'](_0x2a5310['shift']());}};_0x144037(++_0x41dfcf);}(_0xe8fd,0xa9));var _0xde8f=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xe8fd[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0xde8f('0x0'));var util=require(_0xde8f('0x1'));var moment=require(_0xde8f('0x2'));var BPromise=require(_0xde8f('0x3'));var rs=require(_0xde8f('0x4'));var fs=require('fs');var Redis=require(_0xde8f('0x5'));var db=require(_0xde8f('0x6'))['db'];var utils=require(_0xde8f('0x7'));var logger=require('../../config/logger')(_0xde8f('0x8'));var config=require('../../config/environment');var jayson=require(_0xde8f('0x9'));var client=jayson[_0xde8f('0xa')][_0xde8f('0xb')]({'port':0x232a});config[_0xde8f('0xc')]=_[_0xde8f('0xd')](config[_0xde8f('0xc')],{'host':_0xde8f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde8f('0xc')]));require(_0xde8f('0xf'))[_0xde8f('0x10')](socket);function respondWithRpcPromise(_0x1dd737,_0x178889,_0x4ac7ef){return new BPromise(function(_0x514258,_0x1c56ad){return client[_0xde8f('0x11')](_0x1dd737,_0x4ac7ef)[_0xde8f('0x12')](function(_0x4fb03a){logger[_0xde8f('0x13')](_0xde8f('0x14'),_0x178889,_0xde8f('0x15'));logger[_0xde8f('0x16')](_0xde8f('0x17'),_0x178889,_0xde8f('0x15'),JSON['stringify'](_0x4fb03a));if(_0x4fb03a[_0xde8f('0x18')]){if(_0x4fb03a[_0xde8f('0x18')][_0xde8f('0x19')]===0x1f4){logger[_0xde8f('0x18')](_0xde8f('0x14'),_0x178889,_0x4fb03a[_0xde8f('0x18')][_0xde8f('0x1a')]);return _0x1c56ad(_0x4fb03a[_0xde8f('0x18')][_0xde8f('0x1a')]);}logger[_0xde8f('0x18')](_0xde8f('0x14'),_0x178889,_0x4fb03a[_0xde8f('0x18')][_0xde8f('0x1a')]);return _0x514258(_0x4fb03a[_0xde8f('0x18')][_0xde8f('0x1a')]);}else{logger['info'](_0xde8f('0x14'),_0x178889,_0xde8f('0x15'));_0x514258(_0x4fb03a[_0xde8f('0x1b')][_0xde8f('0x1a')]);}})[_0xde8f('0x1c')](function(_0x32eae8){logger[_0xde8f('0x18')]('Dashboard,\x20%s,\x20%s',_0x178889,_0x32eae8);_0x1c56ad(_0x32eae8);});});} \ No newline at end of file +var _0xa6a7=['randomstring','../../config/logger','rpc','jayson/promise','client','defaults','localhost','redis','./dashboard.socket','register','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x1fb41c,_0xe78a53){var _0x1b88cf=function(_0x2cfbb8){while(--_0x2cfbb8){_0x1fb41c['push'](_0x1fb41c['shift']());}};_0x1b88cf(++_0xe78a53);}(_0xa6a7,0x1d9));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7a6a('0x0'));var moment=require('moment');var BPromise=require(_0x7a6a('0x1'));var rs=require(_0x7a6a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a6a('0x3'))(_0x7a6a('0x4'));var config=require('../../config/environment');var jayson=require(_0x7a6a('0x5'));var client=jayson[_0x7a6a('0x6')]['http']({'port':0x232a});config['redis']=_[_0x7a6a('0x7')](config['redis'],{'host':_0x7a6a('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a6a('0x9')]));require(_0x7a6a('0xa'))[_0x7a6a('0xb')](socket);function respondWithRpcPromise(_0x44c85b,_0x1fdc89,_0x530e3f){return new BPromise(function(_0x19c99c,_0xfe679b){return client[_0x7a6a('0xc')](_0x44c85b,_0x530e3f)[_0x7a6a('0xd')](function(_0x367c52){logger[_0x7a6a('0xe')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,'request\x20sent');logger[_0x7a6a('0xf')](_0x7a6a('0x10'),_0x1fdc89,_0x7a6a('0x11'),JSON[_0x7a6a('0x12')](_0x367c52));if(_0x367c52[_0x7a6a('0x13')]){if(_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x14')]===0x1f4){logger[_0x7a6a('0x13')](_0x7a6a('0x15'),_0x1fdc89,_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x16')]);return _0xfe679b(_0x367c52[_0x7a6a('0x13')]['message']);}logger[_0x7a6a('0x13')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x16')]);return _0x19c99c(_0x367c52['error'][_0x7a6a('0x16')]);}else{logger[_0x7a6a('0xe')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x7a6a('0x11'));_0x19c99c(_0x367c52[_0x7a6a('0x17')][_0x7a6a('0x16')]);}})[_0x7a6a('0x18')](function(_0x3ee093){logger['error']('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x3ee093);_0xfe679b(_0x3ee093);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 96a3c4d..384d340 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 _0x7cc5=['removeListener','register','length','./dashboard.events','save','remove','update','emit'];(function(_0x3b1e3f,_0xf8826b){var _0x3b1cd3=function(_0x26ad44){while(--_0x26ad44){_0x3b1e3f['push'](_0x3b1e3f['shift']());}};_0x3b1cd3(++_0xf8826b);}(_0x7cc5,0xfb));var _0x57cc=function(_0x2ec593,_0x167967){_0x2ec593=_0x2ec593-0x0;var _0x1a9f9e=_0x7cc5[_0x2ec593];return _0x1a9f9e;};'use strict';var DashboardEvents=require(_0x57cc('0x0'));var events=[_0x57cc('0x1'),_0x57cc('0x2'),_0x57cc('0x3')];function createListener(_0x425fc3,_0x40b909){return function(_0xef78c2){_0x40b909[_0x57cc('0x4')](_0x425fc3,_0xef78c2);};}function removeListener(_0x2f57f0,_0x513665){return function(){DashboardEvents[_0x57cc('0x5')](_0x2f57f0,_0x513665);};}exports[_0x57cc('0x6')]=function(_0x18fb36){for(var _0x1a96b0=0x0,_0x346649=events[_0x57cc('0x7')];_0x1a96b0<_0x346649;_0x1a96b0++){var _0x5b6b7f=events[_0x1a96b0];var _0x253b00=createListener('dashboard:'+_0x5b6b7f,_0x18fb36);DashboardEvents['on'](_0x5b6b7f,_0x253b00);}}; \ No newline at end of file +var _0xeb00=['register','length','dashboard:','./dashboard.events','save','update','emit','removeListener'];(function(_0x334bb4,_0x38360e){var _0x4dfb4c=function(_0x3fb816){while(--_0x3fb816){_0x334bb4['push'](_0x334bb4['shift']());}};_0x4dfb4c(++_0x38360e);}(_0xeb00,0x16b));var _0x0eb0=function(_0xbeaaa3,_0x21b657){_0xbeaaa3=_0xbeaaa3-0x0;var _0x5e6590=_0xeb00[_0xbeaaa3];return _0x5e6590;};'use strict';var DashboardEvents=require(_0x0eb0('0x0'));var events=[_0x0eb0('0x1'),'remove',_0x0eb0('0x2')];function createListener(_0x82c237,_0xfb1823){return function(_0x4138eb){_0xfb1823[_0x0eb0('0x3')](_0x82c237,_0x4138eb);};}function removeListener(_0x54645f,_0x52b6a7){return function(){DashboardEvents[_0x0eb0('0x4')](_0x54645f,_0x52b6a7);};}exports[_0x0eb0('0x5')]=function(_0x56b152){for(var _0x31008a=0x0,_0x27b79a=events[_0x0eb0('0x6')];_0x31008a<_0x27b79a;_0x31008a++){var _0x5b55dc=events[_0x31008a];var _0x4a74e9=createListener(_0x0eb0('0x7')+_0x5b55dc,_0x56b152);DashboardEvents['on'](_0x5b55dc,_0x4a74e9);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 70f07da..fb3f253 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 _0x5c12=['Router','fs-extra','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','/:id','/:id/items','post','/:id/clone','clone','update','delete','exports','multer','path','express'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x5c12,0x12f));var _0x25c1=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x5c12[_0x3a2e49];return _0x257140;};'use strict';var multer=require(_0x25c1('0x0'));var util=require('util');var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25c1('0x5'));var config=require('../../config/environment');var controller=require(_0x25c1('0x6'));router['get']('/',auth[_0x25c1('0x7')](),controller[_0x25c1('0x8')]);router[_0x25c1('0x9')](_0x25c1('0xa'),auth[_0x25c1('0x7')](),controller['show']);router[_0x25c1('0x9')](_0x25c1('0xb'),auth[_0x25c1('0x7')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x25c1('0xc')](_0x25c1('0xd'),auth[_0x25c1('0x7')](),controller[_0x25c1('0xe')]);router[_0x25c1('0xc')]('/:id/items',auth[_0x25c1('0x7')](),controller['addItem']);router['put'](_0x25c1('0xa'),auth[_0x25c1('0x7')](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')]('/:id',auth[_0x25c1('0x7')](),controller['destroy']);module[_0x25c1('0x11')]=router; \ No newline at end of file +var _0x6a44=['show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id'];(function(_0x2327fe,_0x204b47){var _0xfdeeca=function(_0x20c895){while(--_0x20c895){_0x2327fe['push'](_0x2327fe['shift']());}};_0xfdeeca(++_0x204b47);}(_0x6a44,0x183));var _0x46a4=function(_0x54404a,_0x4c3d3b){_0x54404a=_0x54404a-0x0;var _0x259732=_0x6a44[_0x54404a];return _0x259732;};'use strict';var multer=require(_0x46a4('0x0'));var util=require(_0x46a4('0x1'));var path=require(_0x46a4('0x2'));var timeout=require('connect-timeout');var express=require(_0x46a4('0x3'));var router=express[_0x46a4('0x4')]();var fs_extra=require(_0x46a4('0x5'));var auth=require(_0x46a4('0x6'));var interaction=require(_0x46a4('0x7'));var config=require(_0x46a4('0x8'));var controller=require(_0x46a4('0x9'));router['get']('/',auth[_0x46a4('0xa')](),controller[_0x46a4('0xb')]);router['get'](_0x46a4('0xc'),auth[_0x46a4('0xa')](),controller[_0x46a4('0xd')]);router['get'](_0x46a4('0xe'),auth['isAuthenticated'](),controller[_0x46a4('0xf')]);router[_0x46a4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x46a4('0x11'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x12')]);router[_0x46a4('0x10')](_0x46a4('0xe'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x13')]);router[_0x46a4('0x14')](_0x46a4('0xc'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x15')]);router[_0x46a4('0x16')](_0x46a4('0xc'),auth['isAuthenticated'](),controller[_0x46a4('0x17')]);module[_0x46a4('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ba31bde..3f245c3 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 _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x6ff99f,_0x234351){var _0xecc8c2=function(_0x50b591){while(--_0x50b591){_0x6ff99f['push'](_0x6ff99f['shift']());}};_0xecc8c2(++_0x234351);}(_0x687b,0x14a));var _0xb687=function(_0x54b719,_0x39ade5){_0x54b719=_0x54b719-0x0;var _0x31edd9=_0x687b[_0x54b719];return _0x31edd9;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5496,0x175));var _0x6549=function(_0x42a49f,_0x4901ea){_0x42a49f=_0x42a49f-0x0;var _0x4f2aee=_0x5496[_0x42a49f];return _0x4f2aee;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index c6f9db1..674d440 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 _0xb073=['attrSerie3','attrReport','reportType','attrRefresh','stringify','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','sendStatus','status','end','limit','count','offset','set','json','save','update','destroy','then','error','send','show','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','options','catch','find','params','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2'];(function(_0x2a357d,_0x1a1a19){var _0x429b9c=function(_0x4f70e1){while(--_0x4f70e1){_0x2a357d['push'](_0x2a357d['shift']());}};_0x429b9c(++_0x1a1a19);}(_0xb073,0x187));var _0x3b07=function(_0x48ebe8,_0x300832){_0x48ebe8=_0x48ebe8-0x0;var _0x5c65fb=_0xb073[_0x48ebe8];return _0x5c65fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b07('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b07('0x1'));var rp=require(_0x3b07('0x2'));var moment=require(_0x3b07('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3b07('0x4'));var util=require(_0x3b07('0x5'));var path=require(_0x3b07('0x6'));var sox=require('sox');var csv=require(_0x3b07('0x7'));var ejs=require(_0x3b07('0x8'));var fs=require('fs');var fs_extra=require(_0x3b07('0x9'));var _=require(_0x3b07('0xa'));var squel=require(_0x3b07('0xb'));var crypto=require(_0x3b07('0xc'));var jsforce=require(_0x3b07('0xd'));var deskjs=require(_0x3b07('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b07('0xf'));var Redis=require(_0x3b07('0x10'));var authService=require(_0x3b07('0x11'));var qs=require(_0x3b07('0x12'));var as=require(_0x3b07('0x13'));var hardwareService=require(_0x3b07('0x14'));var logger=require(_0x3b07('0x15'))(_0x3b07('0x16'));var utils=require(_0x3b07('0x17'));var config=require(_0x3b07('0x18'));var licenseUtil=require(_0x3b07('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3b07('0x1a')](config[_0x3b07('0x1b')],{'host':_0x3b07('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b07('0x1b')]));require('./dashboardItem.socket')[_0x3b07('0x1d')](socket);function respondWithStatusCode(_0x589d65,_0x2d3151){_0x2d3151=_0x2d3151||0xcc;return function(_0xad5aaa){if(_0xad5aaa){return _0x589d65[_0x3b07('0x1e')](_0x2d3151);}return _0x589d65[_0x3b07('0x1f')](_0x2d3151)[_0x3b07('0x20')]();};}function respondWithResult(_0x33d648,_0x4560db){_0x4560db=_0x4560db||0xc8;return function(_0x268f0b){if(_0x268f0b){return _0x33d648['status'](_0x4560db)['json'](_0x268f0b);}};}function respondWithFilteredResult(_0x5e956d,_0x318a17){return function(_0x227afa){if(_0x227afa){var _0x4d28a0=typeof _0x318a17['offset']==='undefined'&&typeof _0x318a17[_0x3b07('0x21')]==='undefined';var _0x5bd380=_0x227afa[_0x3b07('0x22')];var _0x3b66ff=_0x4d28a0?0x0:_0x318a17[_0x3b07('0x23')];var _0x46f659=_0x4d28a0?_0x227afa[_0x3b07('0x22')]:_0x318a17[_0x3b07('0x23')]+_0x318a17[_0x3b07('0x21')];var _0x1e2713;if(_0x46f659>=_0x5bd380){_0x46f659=_0x5bd380;_0x1e2713=0xc8;}else{_0x1e2713=0xce;}_0x5e956d[_0x3b07('0x1f')](_0x1e2713);return _0x5e956d[_0x3b07('0x24')]('Content-Range',_0x3b66ff+'-'+_0x46f659+'/'+_0x5bd380)[_0x3b07('0x25')](_0x227afa);}return null;};}function patchUpdates(_0x4c7117){return function(_0x367064){try{jsonpatch['apply'](_0x367064,_0x4c7117,!![]);}catch(_0x20969e){return BPromise['reject'](_0x20969e);}return _0x367064[_0x3b07('0x26')]();};}function saveUpdates(_0x1e9d62,_0x42123f){return function(_0x4bd5f9){if(_0x4bd5f9){return _0x4bd5f9[_0x3b07('0x27')](_0x1e9d62)['then'](function(_0x248e4e){return _0x248e4e;});}return null;};}function removeEntity(_0x503dea,_0xbb8016){return function(_0x33e124){if(_0x33e124){return _0x33e124[_0x3b07('0x28')]()[_0x3b07('0x29')](function(){_0x503dea[_0x3b07('0x1f')](0xcc)[_0x3b07('0x20')]();});}};}function handleEntityNotFound(_0x43d50f,_0x4a67c3){return function(_0x2b3c96){if(!_0x2b3c96){_0x43d50f[_0x3b07('0x1e')](0x194);}return _0x2b3c96;};}function handleError(_0xe738c7,_0x3fa1f5){_0x3fa1f5=_0x3fa1f5||0x1f4;return function(_0x15c1a1){logger[_0x3b07('0x2a')](_0x15c1a1['stack']);if(_0x15c1a1['name']){delete _0x15c1a1['name'];}_0xe738c7['status'](_0x3fa1f5)[_0x3b07('0x2b')](_0x15c1a1);};}exports[_0x3b07('0x2c')]=function(_0xbc12a2,_0x3ce8c6){var _0xe5fdc7={'raw':![],'where':{'id':_0xbc12a2['params']['id']}},_0x4491f2={};_0x4491f2['model']=_[_0x3b07('0x2d')](db[_0x3b07('0x2e')][_0x3b07('0x2f')]);_0x4491f2['query']=_[_0x3b07('0x2d')](_0xbc12a2[_0x3b07('0x30')]);_0x4491f2[_0x3b07('0x31')]=_[_0x3b07('0x32')](_0x4491f2['model'],_0x4491f2[_0x3b07('0x30')]);_0xe5fdc7[_0x3b07('0x33')]=_[_0x3b07('0x32')](_0x4491f2[_0x3b07('0x34')],qs['fields'](_0xbc12a2[_0x3b07('0x30')][_0x3b07('0x35')]));_0xe5fdc7[_0x3b07('0x33')]=_0xe5fdc7[_0x3b07('0x33')][_0x3b07('0x36')]?_0xe5fdc7[_0x3b07('0x33')]:_0x4491f2[_0x3b07('0x34')];if(_0xbc12a2[_0x3b07('0x30')][_0x3b07('0x37')]){_0xe5fdc7['include']=[{'all':!![]}];}_0xe5fdc7=_[_0x3b07('0x38')]({},_0xe5fdc7,_0xbc12a2[_0x3b07('0x39')]);return db[_0x3b07('0x2e')]['find'](_0xe5fdc7)['then'](handleEntityNotFound(_0x3ce8c6,null))[_0x3b07('0x29')](respondWithResult(_0x3ce8c6,null))[_0x3b07('0x3a')](handleError(_0x3ce8c6,null));};exports[_0x3b07('0x28')]=function(_0x12df56,_0x537ffe){return db[_0x3b07('0x2e')][_0x3b07('0x3b')]({'where':{'id':_0x12df56[_0x3b07('0x3c')]['id']}})['then'](handleEntityNotFound(_0x537ffe,null))[_0x3b07('0x29')](removeEntity(_0x537ffe,null))['catch'](handleError(_0x537ffe,null));};function widgetAttributes(_0x2ae8c6){try{switch(_0x2ae8c6[_0x3b07('0x3d')]){case _0x3b07('0x3e'):return[{'name':_0x3b07('0x3f'),'value':_0x2ae8c6[_0x3b07('0x3f')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0]['value']:undefined)||_0x3b07('0x41')}];case _0x3b07('0x42'):return[{'name':'attrPath','value':_0x2ae8c6[_0x3b07('0x43')]||(_0x2ae8c6['attrs']&&_0x2ae8c6['attrs'][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0][_0x3b07('0x44')]:undefined)||''}];case'clock':return[{'name':_0x3b07('0x45'),'value':_0x2ae8c6[_0x3b07('0x45')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0][_0x3b07('0x44')]:undefined)||_0x3b07('0x46')},{'name':_0x3b07('0x47'),'value':_0x2ae8c6[_0x3b07('0x47')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x1]?_0x2ae8c6['attrs'][0x1][_0x3b07('0x44')]:undefined)||_0x3b07('0x48')},{'name':_0x3b07('0x49'),'value':_0x2ae8c6['attrFontSize']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x2]?_0x2ae8c6[_0x3b07('0x40')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2ae8c6[_0x3b07('0x4a')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0][_0x3b07('0x44')]:undefined)||_0x3b07('0x4b')},{'name':_0x3b07('0x4c'),'value':_0x2ae8c6[_0x3b07('0x4c')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x1]?_0x2ae8c6[_0x3b07('0x40')][0x1][_0x3b07('0x44')]:undefined)||[]},{'name':_0x3b07('0x49'),'value':_0x2ae8c6[_0x3b07('0x49')]||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x2]?_0x2ae8c6[_0x3b07('0x40')][0x2][_0x3b07('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x2ae8c6[_0x3b07('0x4d')]||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x3]?_0x2ae8c6[_0x3b07('0x40')][0x3]['value']:undefined)||_0x3b07('0x4e')},{'name':_0x3b07('0x4f'),'value':_0x2ae8c6['attrEmailAccounts']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x4]?_0x2ae8c6[_0x3b07('0x40')][0x4][_0x3b07('0x44')]:undefined)||''},{'name':_0x3b07('0x50'),'value':_0x2ae8c6['attrFaxAccounts']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x5]?_0x2ae8c6[_0x3b07('0x40')][0x5][_0x3b07('0x44')]:undefined)||''},{'name':_0x3b07('0x51'),'value':_0x2ae8c6[_0x3b07('0x51')]||(_0x2ae8c6['attrs']&&_0x2ae8c6['attrs'][0x6]?_0x2ae8c6[_0x3b07('0x40')][0x6]['value']:undefined)||''},{'name':_0x3b07('0x52'),'value':_0x2ae8c6['attrOpenchannelAccounts']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x7]?_0x2ae8c6[_0x3b07('0x40')][0x7][_0x3b07('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2ae8c6[_0x3b07('0x53')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x8]?_0x2ae8c6[_0x3b07('0x40')][0x8][_0x3b07('0x44')]:undefined)||''},{'name':_0x3b07('0x54'),'value':_0x2ae8c6[_0x3b07('0x54')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x9]?_0x2ae8c6[_0x3b07('0x40')][0x9][_0x3b07('0x44')]:undefined)||''}];case _0x3b07('0x55'):case _0x3b07('0x56'):return[{'name':_0x3b07('0x57'),'value':_0x2ae8c6['attrSerie1']||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0][_0x3b07('0x44')]:undefined)||_0x3b07('0x4b')},{'name':'attrSerie2','value':_0x2ae8c6[_0x3b07('0x58')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x1]?_0x2ae8c6[_0x3b07('0x40')][0x1][_0x3b07('0x44')]:undefined)||null},{'name':_0x3b07('0x59'),'value':_0x2ae8c6[_0x3b07('0x59')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x2]?_0x2ae8c6[_0x3b07('0x40')][0x2][_0x3b07('0x44')]:undefined)||null},{'name':_0x3b07('0x4c'),'value':_0x2ae8c6[_0x3b07('0x4c')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6['attrs'][0x3]?_0x2ae8c6[_0x3b07('0x40')][0x3]['value']:undefined)||[]},{'name':_0x3b07('0x4d'),'value':_0x2ae8c6['attrChannel']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x4]?_0x2ae8c6['attrs'][0x4][_0x3b07('0x44')]:undefined)||_0x3b07('0x4e')},{'name':_0x3b07('0x4f'),'value':_0x2ae8c6['attrEmailAccounts']||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x5]?_0x2ae8c6[_0x3b07('0x40')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x2ae8c6[_0x3b07('0x50')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x6]?_0x2ae8c6[_0x3b07('0x40')][0x6][_0x3b07('0x44')]:undefined)||''},{'name':_0x3b07('0x51'),'value':_0x2ae8c6[_0x3b07('0x51')]||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x7]?_0x2ae8c6[_0x3b07('0x40')][0x7]['value']:undefined)||''},{'name':_0x3b07('0x52'),'value':_0x2ae8c6[_0x3b07('0x52')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x8]?_0x2ae8c6[_0x3b07('0x40')][0x8][_0x3b07('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2ae8c6[_0x3b07('0x53')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x9]?_0x2ae8c6[_0x3b07('0x40')][0x9]['value']:undefined)||''},{'name':_0x3b07('0x54'),'value':_0x2ae8c6[_0x3b07('0x54')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0xa]?_0x2ae8c6['attrs'][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x3b07('0x5a'),'type':_0x2ae8c6[_0x3b07('0x5b')]||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0][_0x3b07('0x3d')]:undefined)||null,'value':_0x2ae8c6[_0x3b07('0x5a')]||(_0x2ae8c6[_0x3b07('0x40')]&&_0x2ae8c6[_0x3b07('0x40')][0x0]?_0x2ae8c6[_0x3b07('0x40')][0x0]['value']:undefined)||null},{'name':_0x3b07('0x5c'),'value':_0x2ae8c6[_0x3b07('0x5c')]||(_0x2ae8c6['attrs']&&_0x2ae8c6[_0x3b07('0x40')][0x1]?_0x2ae8c6[_0x3b07('0x40')][0x1][_0x3b07('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x25e50f){logger[_0x3b07('0x2a')]('widgetAttributes:\x20%s',JSON[_0x3b07('0x5d')](_0x25e50f));return[];}}exports[_0x3b07('0x5e')]=function(_0x50c803,_0x29856d){if(_0x50c803[_0x3b07('0x5f')]){_0x50c803['body']['attrs']=widgetAttributes(_0x50c803[_0x3b07('0x5f')]);}return db['DashboardItem'][_0x3b07('0x5e')](_0x50c803[_0x3b07('0x5f')],{})[_0x3b07('0x29')](respondWithResult(_0x29856d,0xc9))[_0x3b07('0x3a')](handleError(_0x29856d,null));};exports[_0x3b07('0x27')]=function(_0x265b8d,_0x53150b){if(_0x265b8d['body']['id']){delete _0x265b8d[_0x3b07('0x5f')]['id'];}_0x265b8d['body'][_0x3b07('0x40')]=widgetAttributes(_0x265b8d[_0x3b07('0x5f')]);return db[_0x3b07('0x2e')]['find']({'where':{'id':_0x265b8d['params']['id']}})[_0x3b07('0x29')](handleEntityNotFound(_0x53150b,null))[_0x3b07('0x29')](saveUpdates(_0x265b8d[_0x3b07('0x5f')],null))[_0x3b07('0x29')](respondWithResult(_0x53150b,null))['catch'](handleError(_0x53150b,null));}; \ No newline at end of file +var _0xba0d=['DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','error','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','params','model'];(function(_0x38cb77,_0x2ae23e){var _0x2a628c=function(_0x500b78){while(--_0x500b78){_0x38cb77['push'](_0x38cb77['shift']());}};_0x2a628c(++_0x2ae23e);}(_0xba0d,0x8e));var _0xdba0=function(_0x34df72,_0x2bb5f5){_0x34df72=_0x34df72-0x0;var _0x1b0ac6=_0xba0d[_0x34df72];return _0x1b0ac6;};'use strict';var emlformat=require(_0xdba0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdba0('0x1'));var jsonpatch=require(_0xdba0('0x2'));var rp=require(_0xdba0('0x3'));var moment=require('moment');var BPromise=require(_0xdba0('0x4'));var Mustache=require('mustache');var util=require(_0xdba0('0x5'));var path=require(_0xdba0('0x6'));var sox=require(_0xdba0('0x7'));var csv=require(_0xdba0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdba0('0x9'));var squel=require(_0xdba0('0xa'));var crypto=require(_0xdba0('0xb'));var jsforce=require(_0xdba0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdba0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdba0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdba0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdba0('0xf'));var logger=require(_0xdba0('0x10'))(_0xdba0('0x11'));var utils=require(_0xdba0('0x12'));var config=require(_0xdba0('0x13'));var licenseUtil=require(_0xdba0('0x14'));var db=require(_0xdba0('0x15'))['db'];config[_0xdba0('0x16')]=_['defaults'](config['redis'],{'host':_0xdba0('0x17'),'port':0x18eb});var socket=require(_0xdba0('0x18'))(new Redis(config[_0xdba0('0x16')]));require(_0xdba0('0x19'))[_0xdba0('0x1a')](socket);function respondWithStatusCode(_0x28da4c,_0x1077c2){_0x1077c2=_0x1077c2||0xcc;return function(_0x563983){if(_0x563983){return _0x28da4c[_0xdba0('0x1b')](_0x1077c2);}return _0x28da4c[_0xdba0('0x1c')](_0x1077c2)[_0xdba0('0x1d')]();};}function respondWithResult(_0xb0ffc4,_0xd66d92){_0xd66d92=_0xd66d92||0xc8;return function(_0x1aee2d){if(_0x1aee2d){return _0xb0ffc4[_0xdba0('0x1c')](_0xd66d92)[_0xdba0('0x1e')](_0x1aee2d);}};}function respondWithFilteredResult(_0x119c31,_0x167dbc){return function(_0x479a46){if(_0x479a46){var _0x2b75e7=typeof _0x167dbc['offset']===_0xdba0('0x1f')&&typeof _0x167dbc[_0xdba0('0x20')]===_0xdba0('0x1f');var _0x436fff=_0x479a46['count'];var _0x4c954f=_0x2b75e7?0x0:_0x167dbc[_0xdba0('0x21')];var _0x427dea=_0x2b75e7?_0x479a46['count']:_0x167dbc[_0xdba0('0x21')]+_0x167dbc[_0xdba0('0x20')];var _0x907a7a;if(_0x427dea>=_0x436fff){_0x427dea=_0x436fff;_0x907a7a=0xc8;}else{_0x907a7a=0xce;}_0x119c31['status'](_0x907a7a);return _0x119c31[_0xdba0('0x22')](_0xdba0('0x23'),_0x4c954f+'-'+_0x427dea+'/'+_0x436fff)[_0xdba0('0x1e')](_0x479a46);}return null;};}function patchUpdates(_0x11ded6){return function(_0x2fdeeb){try{jsonpatch[_0xdba0('0x24')](_0x2fdeeb,_0x11ded6,!![]);}catch(_0xe4ac33){return BPromise[_0xdba0('0x25')](_0xe4ac33);}return _0x2fdeeb[_0xdba0('0x26')]();};}function saveUpdates(_0x46525a,_0x151704){return function(_0x47eab6){if(_0x47eab6){return _0x47eab6[_0xdba0('0x27')](_0x46525a)[_0xdba0('0x28')](function(_0x4873de){return _0x4873de;});}return null;};}function removeEntity(_0x80ec5b,_0x4ac548){return function(_0x3600e6){if(_0x3600e6){return _0x3600e6[_0xdba0('0x29')]()['then'](function(){_0x80ec5b['status'](0xcc)[_0xdba0('0x1d')]();});}};}function handleEntityNotFound(_0x2541a6,_0x331a07){return function(_0x3c7f03){if(!_0x3c7f03){_0x2541a6[_0xdba0('0x1b')](0x194);}return _0x3c7f03;};}function handleError(_0x16b3a1,_0x2337df){_0x2337df=_0x2337df||0x1f4;return function(_0x59b3e7){logger['error'](_0x59b3e7[_0xdba0('0x2a')]);if(_0x59b3e7[_0xdba0('0x2b')]){delete _0x59b3e7[_0xdba0('0x2b')];}_0x16b3a1[_0xdba0('0x1c')](_0x2337df)['send'](_0x59b3e7);};}exports['show']=function(_0x189373,_0x5b199b){var _0x3cb358={'raw':![],'where':{'id':_0x189373[_0xdba0('0x2c')]['id']}},_0x5b89af={};_0x5b89af[_0xdba0('0x2d')]=_['keys'](db[_0xdba0('0x2e')][_0xdba0('0x2f')]);_0x5b89af[_0xdba0('0x30')]=_[_0xdba0('0x31')](_0x189373[_0xdba0('0x30')]);_0x5b89af[_0xdba0('0x32')]=_[_0xdba0('0x33')](_0x5b89af['model'],_0x5b89af['query']);_0x3cb358[_0xdba0('0x34')]=_[_0xdba0('0x33')](_0x5b89af[_0xdba0('0x2d')],qs[_0xdba0('0x35')](_0x189373[_0xdba0('0x30')]['fields']));_0x3cb358['attributes']=_0x3cb358[_0xdba0('0x34')][_0xdba0('0x36')]?_0x3cb358['attributes']:_0x5b89af[_0xdba0('0x2d')];if(_0x189373['query'][_0xdba0('0x37')]){_0x3cb358[_0xdba0('0x38')]=[{'all':!![]}];}_0x3cb358=_[_0xdba0('0x39')]({},_0x3cb358,_0x189373[_0xdba0('0x3a')]);return db[_0xdba0('0x2e')][_0xdba0('0x3b')](_0x3cb358)[_0xdba0('0x28')](handleEntityNotFound(_0x5b199b,null))['then'](respondWithResult(_0x5b199b,null))[_0xdba0('0x3c')](handleError(_0x5b199b,null));};exports['destroy']=function(_0x4eb994,_0x1bc343){return db[_0xdba0('0x2e')]['find']({'where':{'id':_0x4eb994[_0xdba0('0x2c')]['id']}})[_0xdba0('0x28')](handleEntityNotFound(_0x1bc343,null))['then'](removeEntity(_0x1bc343,null))['catch'](handleError(_0x1bc343,null));};function widgetAttributes(_0x4a61cc){try{switch(_0x4a61cc['type']){case _0xdba0('0x3d'):return[{'name':'attrUrl','value':_0x4a61cc['attrUrl']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0][_0xdba0('0x3f')]:undefined)||_0xdba0('0x40')}];case _0xdba0('0x41'):return[{'name':_0xdba0('0x42'),'value':_0x4a61cc[_0xdba0('0x42')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0][_0xdba0('0x3f')]:undefined)||''}];case _0xdba0('0x43'):return[{'name':_0xdba0('0x44'),'value':_0x4a61cc['attrHourFormat']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0][_0xdba0('0x3f')]:undefined)||_0xdba0('0x45')},{'name':_0xdba0('0x46'),'value':_0x4a61cc[_0xdba0('0x46')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1][_0xdba0('0x3f')]:undefined)||_0xdba0('0x47')},{'name':_0xdba0('0x48'),'value':_0x4a61cc[_0xdba0('0x48')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc['attrs'][0x2][_0xdba0('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0xdba0('0x49'),'value':_0x4a61cc[_0xdba0('0x49')]||(_0x4a61cc['attrs']&&_0x4a61cc['attrs'][0x0]?_0x4a61cc['attrs'][0x0]['value']:undefined)||_0xdba0('0x4a')},{'name':_0xdba0('0x4b'),'value':_0x4a61cc['attrVoiceQueues']||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1][_0xdba0('0x3f')]:undefined)||[]},{'name':_0xdba0('0x48'),'value':_0x4a61cc[_0xdba0('0x48')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc[_0xdba0('0x3e')][0x2][_0xdba0('0x3f')]:undefined)||0x14},{'name':_0xdba0('0x4c'),'value':_0x4a61cc[_0xdba0('0x4c')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x3]?_0x4a61cc[_0xdba0('0x3e')][0x3][_0xdba0('0x3f')]:undefined)||'voice'},{'name':_0xdba0('0x4d'),'value':_0x4a61cc[_0xdba0('0x4d')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x4]?_0x4a61cc[_0xdba0('0x3e')][0x4][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4e'),'value':_0x4a61cc[_0xdba0('0x4e')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x5]?_0x4a61cc[_0xdba0('0x3e')][0x5][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4f'),'value':_0x4a61cc[_0xdba0('0x4f')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x6]?_0x4a61cc[_0xdba0('0x3e')][0x6]['value']:undefined)||''},{'name':_0xdba0('0x50'),'value':_0x4a61cc[_0xdba0('0x50')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x7]?_0x4a61cc[_0xdba0('0x3e')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4a61cc[_0xdba0('0x51')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x8]?_0x4a61cc[_0xdba0('0x3e')][0x8][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x52'),'value':_0x4a61cc[_0xdba0('0x52')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x9]?_0x4a61cc[_0xdba0('0x3e')][0x9][_0xdba0('0x3f')]:undefined)||''}];case _0xdba0('0x53'):case'pie-chart':return[{'name':'attrSerie1','value':_0x4a61cc[_0xdba0('0x54')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0]['value']:undefined)||'total'},{'name':_0xdba0('0x55'),'value':_0x4a61cc[_0xdba0('0x55')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x1]?_0x4a61cc['attrs'][0x1][_0xdba0('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x4a61cc[_0xdba0('0x56')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc[_0xdba0('0x3e')][0x2][_0xdba0('0x3f')]:undefined)||null},{'name':_0xdba0('0x4b'),'value':_0x4a61cc['attrVoiceQueues']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x3]?_0x4a61cc['attrs'][0x3][_0xdba0('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x4a61cc['attrChannel']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x4]?_0x4a61cc[_0xdba0('0x3e')][0x4][_0xdba0('0x3f')]:undefined)||_0xdba0('0x57')},{'name':'attrEmailAccounts','value':_0x4a61cc[_0xdba0('0x4d')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x5]?_0x4a61cc[_0xdba0('0x3e')][0x5][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4e'),'value':_0x4a61cc[_0xdba0('0x4e')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x6]?_0x4a61cc[_0xdba0('0x3e')][0x6][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4f'),'value':_0x4a61cc[_0xdba0('0x4f')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x7]?_0x4a61cc[_0xdba0('0x3e')][0x7][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x50'),'value':_0x4a61cc[_0xdba0('0x50')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x8]?_0x4a61cc[_0xdba0('0x3e')][0x8][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x51'),'value':_0x4a61cc[_0xdba0('0x51')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x9]?_0x4a61cc['attrs'][0x9]['value']:undefined)||''},{'name':_0xdba0('0x52'),'value':_0x4a61cc['attrChatWebsites']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0xa]?_0x4a61cc['attrs'][0xa][_0xdba0('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0xdba0('0x58'),'type':_0x4a61cc[_0xdba0('0x59')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0]['type']:undefined)||null,'value':_0x4a61cc[_0xdba0('0x58')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0][_0xdba0('0x3f')]:undefined)||null},{'name':_0xdba0('0x5a'),'value':_0x4a61cc[_0xdba0('0x5a')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3ad3ca){logger[_0xdba0('0x5b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x3ad3ca));return[];}}exports[_0xdba0('0x5c')]=function(_0x42b680,_0x4e005b){if(_0x42b680['body']){_0x42b680['body'][_0xdba0('0x3e')]=widgetAttributes(_0x42b680[_0xdba0('0x5d')]);}return db[_0xdba0('0x2e')][_0xdba0('0x5c')](_0x42b680[_0xdba0('0x5d')],{})[_0xdba0('0x28')](respondWithResult(_0x4e005b,0xc9))[_0xdba0('0x3c')](handleError(_0x4e005b,null));};exports['update']=function(_0x312222,_0x1415fb){if(_0x312222['body']['id']){delete _0x312222[_0xdba0('0x5d')]['id'];}_0x312222[_0xdba0('0x5d')][_0xdba0('0x3e')]=widgetAttributes(_0x312222[_0xdba0('0x5d')]);return db[_0xdba0('0x2e')]['find']({'where':{'id':_0x312222['params']['id']}})['then'](handleEntityNotFound(_0x1415fb,null))[_0xdba0('0x28')](saveUpdates(_0x312222['body'],null))[_0xdba0('0x28')](respondWithResult(_0x1415fb,null))[_0xdba0('0x3c')](handleError(_0x1415fb,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2bc88e0..70dfef8 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 _0x4417=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x5a6a3f,_0x313a88){var _0x3b6bc8=function(_0x16bd1a){while(--_0x16bd1a){_0x5a6a3f['push'](_0x5a6a3f['shift']());}};_0x3b6bc8(++_0x313a88);}(_0x4417,0xd7));var _0x7441=function(_0x4cc854,_0x558afa){_0x4cc854=_0x4cc854-0x0;var _0x20bde0=_0x4417[_0x4cc854];return _0x20bde0;};'use strict';var EventEmitter=require(_0x7441('0x0'));var DashboardItem=require(_0x7441('0x1'))['db'][_0x7441('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7441('0x3')](0x0);var events={'afterCreate':_0x7441('0x4'),'afterUpdate':_0x7441('0x5'),'afterDestroy':'remove'};function emitEvent(_0x294022){return function(_0x56fbb1,_0x31e4a6,_0x124240){DashboardItemEvents[_0x7441('0x6')](_0x294022+':'+_0x56fbb1['id'],_0x56fbb1);DashboardItemEvents['emit'](_0x294022,_0x56fbb1);_0x124240(null);};}for(var e in events){if(events[_0x7441('0x7')](e)){var event=events[e];DashboardItem[_0x7441('0x8')](e,emitEvent(event));}}module[_0x7441('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x992b=['DashboardItem','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x992b,0x127));var _0xb992=function(_0x4d4d72,_0x5a9e4c){_0x4d4d72=_0x4d4d72-0x0;var _0x1e70c1=_0x992b[_0x4d4d72];return _0x1e70c1;};'use strict';var EventEmitter=require(_0xb992('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xb992('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb992('0x2')](0x0);var events={'afterCreate':_0xb992('0x3'),'afterUpdate':_0xb992('0x4'),'afterDestroy':_0xb992('0x5')};function emitEvent(_0x5c20a2){return function(_0x33e8ca,_0x4f7579,_0x9fabba){DashboardItemEvents['emit'](_0x5c20a2+':'+_0x33e8ca['id'],_0x33e8ca);DashboardItemEvents[_0xb992('0x6')](_0x5c20a2,_0x33e8ca);_0x9fabba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xb992('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 8e17907..d9e766a 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 _0x946e=['./dashboardItem.attributes','exports','define','DashboardItem','lodash','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x2420c8,_0x59cdcc){var _0x46e13d=function(_0x1117c3){while(--_0x1117c3){_0x2420c8['push'](_0x2420c8['shift']());}};_0x46e13d(++_0x59cdcc);}(_0x946e,0x1d0));var _0xe946=function(_0x130ced,_0x2f1655){_0x130ced=_0x130ced-0x0;var _0x44d512=_0x946e[_0x130ced];return _0x44d512;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var logger=require(_0xe946('0x1'))('api');var moment=require(_0xe946('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe946('0x3'));var rimraf=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var attributes=require(_0xe946('0x6'));module[_0xe946('0x7')]=function(_0x49224a,_0x123d0c){return _0x49224a[_0xe946('0x8')](_0xe946('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21e3=['dashboard_items','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x337537,_0x4ea7b8){var _0x4fdd67=function(_0x59ad18){while(--_0x59ad18){_0x337537['push'](_0x337537['shift']());}};_0x4fdd67(++_0x4ea7b8);}(_0x21e3,0x1a1));var _0x321e=function(_0xb9ba11,_0x4233a3){_0xb9ba11=_0xb9ba11-0x0;var _0x4678c9=_0x21e3[_0xb9ba11];return _0x4678c9;};'use strict';var _=require(_0x321e('0x0'));var util=require('util');var logger=require(_0x321e('0x1'))('api');var moment=require(_0x321e('0x2'));var BPromise=require(_0x321e('0x3'));var rp=require(_0x321e('0x4'));var fs=require('fs');var path=require(_0x321e('0x5'));var rimraf=require(_0x321e('0x6'));var config=require(_0x321e('0x7'));var attributes=require(_0x321e('0x8'));module[_0x321e('0x9')]=function(_0x3dbb99,_0x600c75){return _0x3dbb99[_0x321e('0xa')](_0x321e('0xb'),attributes,{'tableName':_0x321e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 3b2ddcb..28d0750 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 _0xdcae=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f2327,_0x123bcd){var _0x304698=function(_0x5eb594){while(--_0x5eb594){_0x5f2327['push'](_0x5f2327['shift']());}};_0x304698(++_0x123bcd);}(_0xdcae,0x1cf));var _0xedca=function(_0x45c9f4,_0x2eec90){_0x45c9f4=_0x45c9f4-0x0;var _0x1f9be9=_0xdcae[_0x45c9f4];return _0x1f9be9;};'use strict';var _=require(_0xedca('0x0'));var util=require(_0xedca('0x1'));var moment=require(_0xedca('0x2'));var BPromise=require(_0xedca('0x3'));var rs=require(_0xedca('0x4'));var fs=require('fs');var Redis=require(_0xedca('0x5'));var db=require(_0xedca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xedca('0x7'))(_0xedca('0x8'));var config=require(_0xedca('0x9'));var jayson=require(_0xedca('0xa'));var client=jayson[_0xedca('0xb')][_0xedca('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xedca('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xedca('0xe'))[_0xedca('0xf')](socket);function respondWithRpcPromise(_0x18688b,_0x8b3543,_0x4fd635){return new BPromise(function(_0x1ac489,_0x306e07){return client[_0xedca('0x10')](_0x18688b,_0x4fd635)['then'](function(_0x5780f5){logger[_0xedca('0x11')](_0xedca('0x12'),_0x8b3543,_0xedca('0x13'));logger[_0xedca('0x14')](_0xedca('0x15'),_0x8b3543,_0xedca('0x13'),JSON[_0xedca('0x16')](_0x5780f5));if(_0x5780f5[_0xedca('0x17')]){if(_0x5780f5[_0xedca('0x17')][_0xedca('0x18')]===0x1f4){logger[_0xedca('0x17')](_0xedca('0x12'),_0x8b3543,_0x5780f5[_0xedca('0x17')][_0xedca('0x19')]);return _0x306e07(_0x5780f5[_0xedca('0x17')][_0xedca('0x19')]);}logger['error'](_0xedca('0x12'),_0x8b3543,_0x5780f5[_0xedca('0x17')][_0xedca('0x19')]);return _0x1ac489(_0x5780f5[_0xedca('0x17')][_0xedca('0x19')]);}else{logger[_0xedca('0x11')](_0xedca('0x12'),_0x8b3543,_0xedca('0x13'));_0x1ac489(_0x5780f5['result']['message']);}})[_0xedca('0x1a')](function(_0x5a1f4b){logger[_0xedca('0x17')]('DashboardItem,\x20%s,\x20%s',_0x8b3543,_0x5a1f4b);_0x306e07(_0x5a1f4b);});});} \ No newline at end of file +var _0xf36d=['request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf36d,0xff));var _0xdf36=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0xf36d[_0x238671];return _0x474844;};'use strict';var _=require(_0xdf36('0x0'));var util=require(_0xdf36('0x1'));var moment=require(_0xdf36('0x2'));var BPromise=require(_0xdf36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf36('0x4'));var db=require(_0xdf36('0x5'))['db'];var utils=require(_0xdf36('0x6'));var logger=require(_0xdf36('0x7'))(_0xdf36('0x8'));var config=require(_0xdf36('0x9'));var jayson=require(_0xdf36('0xa'));var client=jayson[_0xdf36('0xb')]['http']({'port':0x232a});config[_0xdf36('0xc')]=_[_0xdf36('0xd')](config[_0xdf36('0xc')],{'host':_0xdf36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf36('0xc')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x11f8d9,_0x2ca933,_0x346bac){return new BPromise(function(_0x6d9ea5,_0x43f6da){return client[_0xdf36('0xf')](_0x11f8d9,_0x346bac)[_0xdf36('0x10')](function(_0x562c5a){logger[_0xdf36('0x11')](_0xdf36('0x12'),_0x2ca933,'request\x20sent');logger['debug'](_0xdf36('0x13'),_0x2ca933,_0xdf36('0x14'),JSON[_0xdf36('0x15')](_0x562c5a));if(_0x562c5a[_0xdf36('0x16')]){if(_0x562c5a[_0xdf36('0x16')]['code']===0x1f4){logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x562c5a[_0xdf36('0x16')][_0xdf36('0x17')]);return _0x43f6da(_0x562c5a[_0xdf36('0x16')][_0xdf36('0x17')]);}logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x562c5a[_0xdf36('0x16')]['message']);return _0x6d9ea5(_0x562c5a[_0xdf36('0x16')]['message']);}else{logger[_0xdf36('0x11')](_0xdf36('0x12'),_0x2ca933,'request\x20sent');_0x6d9ea5(_0x562c5a[_0xdf36('0x18')]['message']);}})['catch'](function(_0x35c418){logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x35c418);_0x43f6da(_0x35c418);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 838d758..ea8f420 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 _0x6257=['remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x420668,_0x112b85){var _0x23cfc2=function(_0x5d7a47){while(--_0x5d7a47){_0x420668['push'](_0x420668['shift']());}};_0x23cfc2(++_0x112b85);}(_0x6257,0x181));var _0x7625=function(_0x12a338,_0x23c57e){_0x12a338=_0x12a338-0x0;var _0x3fa984=_0x6257[_0x12a338];return _0x3fa984;};'use strict';var DashboardItemEvents=require(_0x7625('0x0'));var events=[_0x7625('0x1'),_0x7625('0x2'),_0x7625('0x3')];function createListener(_0x35aa4a,_0x35146f){return function(_0x3535c1){_0x35146f[_0x7625('0x4')](_0x35aa4a,_0x3535c1);};}function removeListener(_0x1cc78f,_0x3f08bb){return function(){DashboardItemEvents[_0x7625('0x5')](_0x1cc78f,_0x3f08bb);};}exports[_0x7625('0x6')]=function(_0x4da799){for(var _0x338947=0x0,_0xa24349=events[_0x7625('0x7')];_0x338947<_0xa24349;_0x338947++){var _0x2d20ce=events[_0x338947];var _0x1a1359=createListener(_0x7625('0x8')+_0x2d20ce,_0x4da799);DashboardItemEvents['on'](_0x2d20ce,_0x1a1359);}}; \ No newline at end of file +var _0xc72e=['register','length','./dashboardItem.events','update','emit','removeListener'];(function(_0xf0f211,_0x478b32){var _0x212f05=function(_0x1f6a88){while(--_0x1f6a88){_0xf0f211['push'](_0xf0f211['shift']());}};_0x212f05(++_0x478b32);}(_0xc72e,0x7a));var _0xec72=function(_0x222d09,_0x2f2eef){_0x222d09=_0x222d09-0x0;var _0x128368=_0xc72e[_0x222d09];return _0x128368;};'use strict';var DashboardItemEvents=require(_0xec72('0x0'));var events=['save','remove',_0xec72('0x1')];function createListener(_0x419054,_0x1e7d17){return function(_0x1eee13){_0x1e7d17[_0xec72('0x2')](_0x419054,_0x1eee13);};}function removeListener(_0x3d2a4a,_0x1ba882){return function(){DashboardItemEvents[_0xec72('0x3')](_0x3d2a4a,_0x1ba882);};}exports[_0xec72('0x4')]=function(_0x1d96b9){for(var _0x1176fe=0x0,_0x2b898b=events[_0xec72('0x5')];_0x1176fe<_0x2b898b;_0x1176fe++){var _0x20ab81=events[_0x1176fe];var _0x1f20ca=createListener('dashboardItem:'+_0x20ab81,_0x1d96b9);DashboardItemEvents['on'](_0x20ab81,_0x1f20ca);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index fd81c44..a8cccaa 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 _0x94d9=['connect-timeout','express','fs-extra','../../components/interaction/service','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','delete','destroy','exports','util','path'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x94d9,0x1de));var _0x994d=function(_0x655ff7,_0x453fa8){_0x655ff7=_0x655ff7-0x0;var _0x5c55fe=_0x94d9[_0x655ff7];return _0x5c55fe;};'use strict';var multer=require('multer');var util=require(_0x994d('0x0'));var path=require(_0x994d('0x1'));var timeout=require(_0x994d('0x2'));var express=require(_0x994d('0x3'));var router=express['Router']();var fs_extra=require(_0x994d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x994d('0x5'));var config=require('../../config/environment');var controller=require(_0x994d('0x6'));router[_0x994d('0x7')](_0x994d('0x8'),auth['isAuthenticated'](),controller[_0x994d('0x9')]);router[_0x994d('0xa')]('/',auth[_0x994d('0xb')](),controller[_0x994d('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x994d('0xd')](_0x994d('0x8'),auth[_0x994d('0xb')](),controller[_0x994d('0xe')]);module[_0x994d('0xf')]=router; \ No newline at end of file +var _0x90de=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','create','update','/:id','destroy','multer','util','path','express'];(function(_0x3582de,_0x4cd6d1){var _0x202b18=function(_0x31e140){while(--_0x31e140){_0x3582de['push'](_0x3582de['shift']());}};_0x202b18(++_0x4cd6d1);}(_0x90de,0x73));var _0xe90d=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x90de[_0x2d1840];return _0xd06a88;};'use strict';var multer=require(_0xe90d('0x0'));var util=require(_0xe90d('0x1'));var path=require(_0xe90d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe90d('0x3'));var router=express[_0xe90d('0x4')]();var fs_extra=require(_0xe90d('0x5'));var auth=require(_0xe90d('0x6'));var interaction=require(_0xe90d('0x7'));var config=require(_0xe90d('0x8'));var controller=require(_0xe90d('0x9'));router[_0xe90d('0xa')]('/:id',auth[_0xe90d('0xb')](),controller[_0xe90d('0xc')]);router['post']('/',auth[_0xe90d('0xb')](),controller[_0xe90d('0xd')]);router['put']('/:id',auth[_0xe90d('0xb')](),controller[_0xe90d('0xe')]);router['delete'](_0xe90d('0xf'),auth[_0xe90d('0xb')](),controller[_0xe90d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d05734b..f8a09df 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 _0x084d=['first','second','STRING','sequelize','exports','ENUM'];(function(_0x1bca87,_0x17410b){var _0x4dead3=function(_0x1baf01){while(--_0x1baf01){_0x1bca87['push'](_0x1bca87['shift']());}};_0x4dead3(++_0x17410b);}(_0x084d,0x1c5));var _0xd084=function(_0x42c930,_0x34df51){_0x42c930=_0x42c930-0x0;var _0x2b863b=_0x084d[_0x42c930];return _0x2b863b;};'use strict';var Sequelize=require(_0xd084('0x0'));module[_0xd084('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xd084('0x2')](_0xd084('0x3'),_0xd084('0x4'),'third'),'allowNull':![],'defaultValue':_0xd084('0x3')},'description':{'type':Sequelize[_0xd084('0x5')]}}; \ No newline at end of file +var _0x42aa=['second','exports','STRING','ENUM','first'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x42aa,0xbf));var _0xa42a=function(_0x289291,_0x3ead45){_0x289291=_0x289291-0x0;var _0x1d4970=_0x42aa[_0x289291];return _0x1d4970;};'use strict';var Sequelize=require('sequelize');module[_0xa42a('0x0')]={'name':{'type':Sequelize[_0xa42a('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa42a('0x2')](_0xa42a('0x3'),_0xa42a('0x4'),'third'),'allowNull':![],'defaultValue':_0xa42a('0x3')},'description':{'type':Sequelize[_0xa42a('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 86091af..40b88e5 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 _0x6462=['order','sort','pick','filter','where','VIRTUAL','merge','options','Disposition','includeAll','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x6462,0x11f));var _0x2646=function(_0x409fcd,_0x25aef2){_0x409fcd=_0x409fcd-0x0;var _0x14dda3=_0x6462[_0x409fcd];return _0x14dda3;};'use strict';var emlformat=require(_0x2646('0x0'));var rimraf=require(_0x2646('0x1'));var zipdir=require(_0x2646('0x2'));var jsonpatch=require(_0x2646('0x3'));var rp=require('request-promise');var moment=require(_0x2646('0x4'));var BPromise=require(_0x2646('0x5'));var Mustache=require(_0x2646('0x6'));var util=require(_0x2646('0x7'));var path=require(_0x2646('0x8'));var sox=require(_0x2646('0x9'));var csv=require(_0x2646('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2646('0xb'));var squel=require(_0x2646('0xc'));var crypto=require(_0x2646('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2646('0xe'));var toCsv=require(_0x2646('0xa'));var querystring=require(_0x2646('0xf'));var Papa=require(_0x2646('0x10'));var Redis=require(_0x2646('0x11'));var authService=require(_0x2646('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2646('0x13'));var hardwareService=require(_0x2646('0x14'));var logger=require('../../config/logger')(_0x2646('0x15'));var utils=require('../../config/utils');var config=require(_0x2646('0x16'));var licenseUtil=require(_0x2646('0x17'));var db=require(_0x2646('0x18'))['db'];function respondWithStatusCode(_0x3ea81f,_0x591f4c){_0x591f4c=_0x591f4c||0xcc;return function(_0x7c9590){if(_0x7c9590){return _0x3ea81f['sendStatus'](_0x591f4c);}return _0x3ea81f['status'](_0x591f4c)[_0x2646('0x19')]();};}function respondWithResult(_0x538ca6,_0x1727ce){_0x1727ce=_0x1727ce||0xc8;return function(_0x8bcc76){if(_0x8bcc76){return _0x538ca6[_0x2646('0x1a')](_0x1727ce)['json'](_0x8bcc76);}};}function respondWithFilteredResult(_0x593642,_0x1097e4){return function(_0x19a4a1){if(_0x19a4a1){var _0x52914d=typeof _0x1097e4['offset']===_0x2646('0x1b')&&typeof _0x1097e4[_0x2646('0x1c')]===_0x2646('0x1b');var _0x7d2ddb=_0x19a4a1[_0x2646('0x1d')];var _0x25a1a9=_0x52914d?0x0:_0x1097e4[_0x2646('0x1e')];var _0x24cd8c=_0x52914d?_0x19a4a1[_0x2646('0x1d')]:_0x1097e4[_0x2646('0x1e')]+_0x1097e4[_0x2646('0x1c')];var _0x4d077c;if(_0x24cd8c>=_0x7d2ddb){_0x24cd8c=_0x7d2ddb;_0x4d077c=0xc8;}else{_0x4d077c=0xce;}_0x593642['status'](_0x4d077c);return _0x593642['set'](_0x2646('0x1f'),_0x25a1a9+'-'+_0x24cd8c+'/'+_0x7d2ddb)[_0x2646('0x20')](_0x19a4a1);}return null;};}function patchUpdates(_0x2632ff){return function(_0x36ee19){try{jsonpatch[_0x2646('0x21')](_0x36ee19,_0x2632ff,!![]);}catch(_0x506702){return BPromise[_0x2646('0x22')](_0x506702);}return _0x36ee19[_0x2646('0x23')]();};}function saveUpdates(_0x3d4c82,_0x15da0d){return function(_0xc0358){if(_0xc0358){return _0xc0358[_0x2646('0x24')](_0x3d4c82)[_0x2646('0x25')](function(_0x3f13c2){return _0x3f13c2;});}return null;};}function removeEntity(_0x1fdb46,_0x10a1ca){return function(_0x325244){if(_0x325244){return _0x325244[_0x2646('0x26')]()[_0x2646('0x25')](function(){var _0x5821e8=_0x325244[_0x2646('0x27')]({'plain':!![]});var _0x3d0ee3='Dispositions';return db[_0x2646('0x28')]['destroy']({'where':{'type':_0x3d0ee3,'resourceId':_0x5821e8['id']}})[_0x2646('0x25')](function(){return _0x325244;});})[_0x2646('0x25')](function(){_0x1fdb46[_0x2646('0x1a')](0xcc)[_0x2646('0x19')]();});}};}function handleEntityNotFound(_0x544073,_0x3a2f6d){return function(_0x43bd0a){if(!_0x43bd0a){_0x544073[_0x2646('0x29')](0x194);}return _0x43bd0a;};}function handleError(_0x2bfaa5,_0x186b4d){_0x186b4d=_0x186b4d||0x1f4;return function(_0x3e12b9){logger['error'](_0x3e12b9[_0x2646('0x2a')]);if(_0x3e12b9[_0x2646('0x2b')]){delete _0x3e12b9[_0x2646('0x2b')];}_0x2bfaa5[_0x2646('0x1a')](_0x186b4d)[_0x2646('0x2c')](_0x3e12b9);};}exports[_0x2646('0x2d')]=function(_0x2b23c9,_0x20fb97){var _0x29ef79={},_0x2750a3={},_0x2f3be3={'count':0x0,'rows':[]};var _0xb2b38c=_[_0x2646('0x2e')](db['Disposition'][_0x2646('0x2f')],function(_0xb05216){return{'name':_0xb05216[_0x2646('0x30')],'type':_0xb05216[_0x2646('0x31')][_0x2646('0x32')]};});_0x2750a3['model']=_[_0x2646('0x2e')](_0xb2b38c,'name');_0x2750a3[_0x2646('0x33')]=_[_0x2646('0x34')](_0x2b23c9[_0x2646('0x33')]);_0x2750a3[_0x2646('0x35')]=_[_0x2646('0x36')](_0x2750a3['model'],_0x2750a3['query']);_0x29ef79['attributes']=_[_0x2646('0x36')](_0x2750a3[_0x2646('0x37')],qs[_0x2646('0x38')](_0x2b23c9[_0x2646('0x33')]['fields']));_0x29ef79[_0x2646('0x39')]=_0x29ef79[_0x2646('0x39')][_0x2646('0x3a')]?_0x29ef79['attributes']:_0x2750a3[_0x2646('0x37')];if(!_0x2b23c9[_0x2646('0x33')][_0x2646('0x3b')](_0x2646('0x3c'))){_0x29ef79['limit']=qs[_0x2646('0x1c')](_0x2b23c9['query'][_0x2646('0x1c')]);_0x29ef79['offset']=qs[_0x2646('0x1e')](_0x2b23c9['query'][_0x2646('0x1e')]);}_0x29ef79[_0x2646('0x3d')]=qs[_0x2646('0x3e')](_0x2b23c9['query'][_0x2646('0x3e')]);_0x29ef79['where']=qs[_0x2646('0x35')](_[_0x2646('0x3f')](_0x2b23c9[_0x2646('0x33')],_0x2750a3[_0x2646('0x35')]),_0xb2b38c);if(_0x2b23c9['query'][_0x2646('0x40')]){_0x29ef79[_0x2646('0x41')]=_['merge'](_0x29ef79[_0x2646('0x41')],{'$or':_[_0x2646('0x2e')](_0xb2b38c,function(_0x42c51f){if(_0x42c51f[_0x2646('0x31')]!==_0x2646('0x42')){var _0x5a1bf8={};_0x5a1bf8[_0x42c51f['name']]={'$like':'%'+_0x2b23c9['query'][_0x2646('0x40')]+'%'};return _0x5a1bf8;}})});}_0x29ef79=_[_0x2646('0x43')]({},_0x29ef79,_0x2b23c9[_0x2646('0x44')]);var _0x3d6cbd={'where':_0x29ef79[_0x2646('0x41')]};return db[_0x2646('0x45')][_0x2646('0x1d')](_0x3d6cbd)[_0x2646('0x25')](function(_0x128fc4){_0x2f3be3[_0x2646('0x1d')]=_0x128fc4;if(_0x2b23c9[_0x2646('0x33')][_0x2646('0x46')]){_0x29ef79['include']=[{'all':!![]}];}return db['Disposition'][_0x2646('0x47')](_0x29ef79);})['then'](function(_0x2e9ff2){_0x2f3be3[_0x2646('0x48')]=_0x2e9ff2;return _0x2f3be3;})[_0x2646('0x25')](respondWithFilteredResult(_0x20fb97,_0x29ef79))['catch'](handleError(_0x20fb97,null));};exports[_0x2646('0x49')]=function(_0x1fb449,_0x37cec9){var _0x3febcd={'raw':!![],'where':{'id':_0x1fb449[_0x2646('0x4a')]['id']}},_0x38d386={};_0x38d386[_0x2646('0x37')]=_['keys'](db['Disposition'][_0x2646('0x2f')]);_0x38d386[_0x2646('0x33')]=_[_0x2646('0x34')](_0x1fb449['query']);_0x38d386[_0x2646('0x35')]=_['intersection'](_0x38d386[_0x2646('0x37')],_0x38d386[_0x2646('0x33')]);_0x3febcd[_0x2646('0x39')]=_['intersection'](_0x38d386[_0x2646('0x37')],qs['fields'](_0x1fb449[_0x2646('0x33')][_0x2646('0x38')]));_0x3febcd['attributes']=_0x3febcd[_0x2646('0x39')]['length']?_0x3febcd[_0x2646('0x39')]:_0x38d386['model'];if(_0x1fb449[_0x2646('0x33')][_0x2646('0x46')]){_0x3febcd[_0x2646('0x4b')]=[{'all':!![]}];}_0x3febcd=_[_0x2646('0x43')]({},_0x3febcd,_0x1fb449[_0x2646('0x44')]);return db[_0x2646('0x45')]['find'](_0x3febcd)[_0x2646('0x25')](handleEntityNotFound(_0x37cec9,null))['then'](respondWithResult(_0x37cec9,null))[_0x2646('0x4c')](handleError(_0x37cec9,null));};exports[_0x2646('0x4d')]=function(_0x462b73,_0x2fe6dc){return db[_0x2646('0x45')][_0x2646('0x4d')](_0x462b73[_0x2646('0x4e')],{})[_0x2646('0x25')](function(_0x152f8a){var _0x204432=_0x462b73[_0x2646('0x4f')][_0x2646('0x27')]({'plain':!![]});if(!_0x204432)throw new Error(_0x2646('0x50'));if(_0x204432[_0x2646('0x51')]===_0x2646('0x4f')){var _0x1c3987=_0x152f8a[_0x2646('0x27')]({'plain':!![]});var _0x345d3e='Dispositions';return db[_0x2646('0x52')][_0x2646('0x53')]({'where':{'name':_0x345d3e,'userProfileId':_0x204432['userProfileId']},'raw':!![]})['then'](function(_0x1e6aa9){if(_0x1e6aa9&&_0x1e6aa9[_0x2646('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c3987[_0x2646('0x2b')],'resourceId':_0x1c3987['id'],'type':_0x1e6aa9[_0x2646('0x2b')],'sectionId':_0x1e6aa9['id']},{})[_0x2646('0x25')](function(){return _0x152f8a;});}else{return _0x152f8a;}})[_0x2646('0x4c')](function(_0x24d269){logger[_0x2646('0x55')](_0x2646('0x56'),_0x24d269);throw _0x24d269;});}return _0x152f8a;})['then'](respondWithResult(_0x2fe6dc,0xc9))[_0x2646('0x4c')](handleError(_0x2fe6dc,null));};exports[_0x2646('0x24')]=function(_0x1f6810,_0x33c1a4){if(_0x1f6810[_0x2646('0x4e')]['id']){delete _0x1f6810['body']['id'];}return db[_0x2646('0x45')][_0x2646('0x53')]({'where':{'id':_0x1f6810[_0x2646('0x4a')]['id']}})[_0x2646('0x25')](handleEntityNotFound(_0x33c1a4,null))['then'](saveUpdates(_0x1f6810[_0x2646('0x4e')],null))[_0x2646('0x25')](respondWithResult(_0x33c1a4,null))[_0x2646('0x4c')](handleError(_0x33c1a4,null));};exports[_0x2646('0x26')]=function(_0x29d71d,_0x1d213d){return db[_0x2646('0x45')]['find']({'where':{'id':_0x29d71d[_0x2646('0x4a')]['id']}})[_0x2646('0x25')](handleEntityNotFound(_0x1d213d,null))[_0x2646('0x25')](removeEntity(_0x1d213d,null))[_0x2646('0x4c')](handleError(_0x1d213d,null));}; \ No newline at end of file +var _0xdace=['hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','map','Disposition','fieldName','type','query','keys','filters','attributes','fields','model'];(function(_0x2cd989,_0x9225cb){var _0x2d0584=function(_0x10ac24){while(--_0x10ac24){_0x2cd989['push'](_0x2cd989['shift']());}};_0x2d0584(++_0x9225cb);}(_0xdace,0xc1));var _0xedac=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xdace[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedac('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xedac('0x1'));var Mustache=require(_0xedac('0x2'));var util=require(_0xedac('0x3'));var path=require('path');var sox=require(_0xedac('0x4'));var csv=require(_0xedac('0x5'));var ejs=require(_0xedac('0x6'));var fs=require('fs');var fs_extra=require(_0xedac('0x7'));var _=require(_0xedac('0x8'));var squel=require(_0xedac('0x9'));var crypto=require(_0xedac('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xedac('0xb'));var toCsv=require(_0xedac('0x5'));var querystring=require(_0xedac('0xc'));var Papa=require(_0xedac('0xd'));var Redis=require(_0xedac('0xe'));var authService=require(_0xedac('0xf'));var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require(_0xedac('0x12'));var logger=require(_0xedac('0x13'))(_0xedac('0x14'));var utils=require(_0xedac('0x15'));var config=require(_0xedac('0x16'));var licenseUtil=require(_0xedac('0x17'));var db=require(_0xedac('0x18'))['db'];function respondWithStatusCode(_0x3d7a30,_0x3777fb){_0x3777fb=_0x3777fb||0xcc;return function(_0x831b3){if(_0x831b3){return _0x3d7a30['sendStatus'](_0x3777fb);}return _0x3d7a30['status'](_0x3777fb)[_0xedac('0x19')]();};}function respondWithResult(_0x27a1b8,_0x3e08c0){_0x3e08c0=_0x3e08c0||0xc8;return function(_0x5a8668){if(_0x5a8668){return _0x27a1b8[_0xedac('0x1a')](_0x3e08c0)[_0xedac('0x1b')](_0x5a8668);}};}function respondWithFilteredResult(_0x4095e2,_0x3d0bf0){return function(_0x3df438){if(_0x3df438){var _0x5edd0e=typeof _0x3d0bf0[_0xedac('0x1c')]===_0xedac('0x1d')&&typeof _0x3d0bf0['limit']===_0xedac('0x1d');var _0x56b524=_0x3df438[_0xedac('0x1e')];var _0x14350e=_0x5edd0e?0x0:_0x3d0bf0[_0xedac('0x1c')];var _0x5a6d9b=_0x5edd0e?_0x3df438[_0xedac('0x1e')]:_0x3d0bf0[_0xedac('0x1c')]+_0x3d0bf0[_0xedac('0x1f')];var _0x40d64b;if(_0x5a6d9b>=_0x56b524){_0x5a6d9b=_0x56b524;_0x40d64b=0xc8;}else{_0x40d64b=0xce;}_0x4095e2[_0xedac('0x1a')](_0x40d64b);return _0x4095e2[_0xedac('0x20')]('Content-Range',_0x14350e+'-'+_0x5a6d9b+'/'+_0x56b524)[_0xedac('0x1b')](_0x3df438);}return null;};}function patchUpdates(_0x17b186){return function(_0x5f45be){try{jsonpatch[_0xedac('0x21')](_0x5f45be,_0x17b186,!![]);}catch(_0x314bd2){return BPromise['reject'](_0x314bd2);}return _0x5f45be[_0xedac('0x22')]();};}function saveUpdates(_0x238dc1,_0x1132ee){return function(_0x1132fd){if(_0x1132fd){return _0x1132fd[_0xedac('0x23')](_0x238dc1)[_0xedac('0x24')](function(_0x7477f2){return _0x7477f2;});}return null;};}function removeEntity(_0x492372,_0x1479a4){return function(_0x301a53){if(_0x301a53){return _0x301a53[_0xedac('0x25')]()[_0xedac('0x24')](function(){var _0x60a4d5=_0x301a53[_0xedac('0x26')]({'plain':!![]});var _0x5eb3e0=_0xedac('0x27');return db[_0xedac('0x28')][_0xedac('0x25')]({'where':{'type':_0x5eb3e0,'resourceId':_0x60a4d5['id']}})[_0xedac('0x24')](function(){return _0x301a53;});})['then'](function(){_0x492372[_0xedac('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2282c4,_0x238b58){return function(_0x3c6f7b){if(!_0x3c6f7b){_0x2282c4[_0xedac('0x29')](0x194);}return _0x3c6f7b;};}function handleError(_0x5ce399,_0x4dc737){_0x4dc737=_0x4dc737||0x1f4;return function(_0x482744){logger[_0xedac('0x2a')](_0x482744['stack']);if(_0x482744['name']){delete _0x482744[_0xedac('0x2b')];}_0x5ce399[_0xedac('0x1a')](_0x4dc737)[_0xedac('0x2c')](_0x482744);};}exports[_0xedac('0x2d')]=function(_0x3b61ac,_0x40918b){var _0x4f7985={},_0x181402={},_0xb6854a={'count':0x0,'rows':[]};var _0x13ee48=_[_0xedac('0x2e')](db[_0xedac('0x2f')]['rawAttributes'],function(_0xe1dc28){return{'name':_0xe1dc28[_0xedac('0x30')],'type':_0xe1dc28[_0xedac('0x31')]['key']};});_0x181402['model']=_[_0xedac('0x2e')](_0x13ee48,_0xedac('0x2b'));_0x181402[_0xedac('0x32')]=_[_0xedac('0x33')](_0x3b61ac[_0xedac('0x32')]);_0x181402[_0xedac('0x34')]=_['intersection'](_0x181402['model'],_0x181402['query']);_0x4f7985[_0xedac('0x35')]=_['intersection'](_0x181402['model'],qs[_0xedac('0x36')](_0x3b61ac['query']['fields']));_0x4f7985[_0xedac('0x35')]=_0x4f7985[_0xedac('0x35')]['length']?_0x4f7985[_0xedac('0x35')]:_0x181402[_0xedac('0x37')];if(!_0x3b61ac[_0xedac('0x32')][_0xedac('0x38')](_0xedac('0x39'))){_0x4f7985[_0xedac('0x1f')]=qs[_0xedac('0x1f')](_0x3b61ac[_0xedac('0x32')][_0xedac('0x1f')]);_0x4f7985[_0xedac('0x1c')]=qs[_0xedac('0x1c')](_0x3b61ac[_0xedac('0x32')][_0xedac('0x1c')]);}_0x4f7985['order']=qs['sort'](_0x3b61ac[_0xedac('0x32')][_0xedac('0x3a')]);_0x4f7985[_0xedac('0x3b')]=qs['filters'](_[_0xedac('0x3c')](_0x3b61ac[_0xedac('0x32')],_0x181402[_0xedac('0x34')]),_0x13ee48);if(_0x3b61ac[_0xedac('0x32')]['filter']){_0x4f7985[_0xedac('0x3b')]=_[_0xedac('0x3d')](_0x4f7985[_0xedac('0x3b')],{'$or':_['map'](_0x13ee48,function(_0x209bee){if(_0x209bee[_0xedac('0x31')]!==_0xedac('0x3e')){var _0x4e8015={};_0x4e8015[_0x209bee[_0xedac('0x2b')]]={'$like':'%'+_0x3b61ac[_0xedac('0x32')]['filter']+'%'};return _0x4e8015;}})});}_0x4f7985=_[_0xedac('0x3d')]({},_0x4f7985,_0x3b61ac[_0xedac('0x3f')]);var _0x2610b1={'where':_0x4f7985[_0xedac('0x3b')]};return db[_0xedac('0x2f')][_0xedac('0x1e')](_0x2610b1)[_0xedac('0x24')](function(_0x382bb2){_0xb6854a[_0xedac('0x1e')]=_0x382bb2;if(_0x3b61ac[_0xedac('0x32')][_0xedac('0x40')]){_0x4f7985[_0xedac('0x41')]=[{'all':!![]}];}return db[_0xedac('0x2f')][_0xedac('0x42')](_0x4f7985);})[_0xedac('0x24')](function(_0x499148){_0xb6854a[_0xedac('0x43')]=_0x499148;return _0xb6854a;})[_0xedac('0x24')](respondWithFilteredResult(_0x40918b,_0x4f7985))[_0xedac('0x44')](handleError(_0x40918b,null));};exports[_0xedac('0x45')]=function(_0x2c4772,_0x2b9f46){var _0x17520c={'raw':!![],'where':{'id':_0x2c4772[_0xedac('0x46')]['id']}},_0xca3c1c={};_0xca3c1c['model']=_[_0xedac('0x33')](db[_0xedac('0x2f')][_0xedac('0x47')]);_0xca3c1c[_0xedac('0x32')]=_[_0xedac('0x33')](_0x2c4772[_0xedac('0x32')]);_0xca3c1c[_0xedac('0x34')]=_['intersection'](_0xca3c1c[_0xedac('0x37')],_0xca3c1c[_0xedac('0x32')]);_0x17520c[_0xedac('0x35')]=_[_0xedac('0x48')](_0xca3c1c[_0xedac('0x37')],qs[_0xedac('0x36')](_0x2c4772[_0xedac('0x32')][_0xedac('0x36')]));_0x17520c['attributes']=_0x17520c[_0xedac('0x35')][_0xedac('0x49')]?_0x17520c[_0xedac('0x35')]:_0xca3c1c['model'];if(_0x2c4772[_0xedac('0x32')]['includeAll']){_0x17520c[_0xedac('0x41')]=[{'all':!![]}];}_0x17520c=_[_0xedac('0x3d')]({},_0x17520c,_0x2c4772['options']);return db[_0xedac('0x2f')][_0xedac('0x4a')](_0x17520c)[_0xedac('0x24')](handleEntityNotFound(_0x2b9f46,null))[_0xedac('0x24')](respondWithResult(_0x2b9f46,null))[_0xedac('0x44')](handleError(_0x2b9f46,null));};exports[_0xedac('0x4b')]=function(_0x2d9326,_0x10070f){return db[_0xedac('0x2f')][_0xedac('0x4b')](_0x2d9326[_0xedac('0x4c')],{})[_0xedac('0x24')](function(_0x3329ca){var _0x31b073=_0x2d9326[_0xedac('0x4d')]['get']({'plain':!![]});if(!_0x31b073)throw new Error(_0xedac('0x4e'));if(_0x31b073[_0xedac('0x4f')]===_0xedac('0x4d')){var _0x27ae66=_0x3329ca[_0xedac('0x26')]({'plain':!![]});var _0x4a47db=_0xedac('0x27');return db[_0xedac('0x50')]['find']({'where':{'name':_0x4a47db,'userProfileId':_0x31b073['userProfileId']},'raw':!![]})['then'](function(_0x1ac1b0){if(_0x1ac1b0&&_0x1ac1b0[_0xedac('0x51')]===0x0){return db[_0xedac('0x28')][_0xedac('0x4b')]({'name':_0x27ae66[_0xedac('0x2b')],'resourceId':_0x27ae66['id'],'type':_0x1ac1b0[_0xedac('0x2b')],'sectionId':_0x1ac1b0['id']},{})[_0xedac('0x24')](function(){return _0x3329ca;});}else{return _0x3329ca;}})['catch'](function(_0x5a51c7){logger[_0xedac('0x2a')](_0xedac('0x52'),_0x5a51c7);throw _0x5a51c7;});}return _0x3329ca;})[_0xedac('0x24')](respondWithResult(_0x10070f,0xc9))['catch'](handleError(_0x10070f,null));};exports[_0xedac('0x23')]=function(_0x32c581,_0xaf82a){if(_0x32c581[_0xedac('0x4c')]['id']){delete _0x32c581[_0xedac('0x4c')]['id'];}return db[_0xedac('0x2f')][_0xedac('0x4a')]({'where':{'id':_0x32c581[_0xedac('0x46')]['id']}})[_0xedac('0x24')](handleEntityNotFound(_0xaf82a,null))[_0xedac('0x24')](saveUpdates(_0x32c581['body'],null))['then'](respondWithResult(_0xaf82a,null))[_0xedac('0x44')](handleError(_0xaf82a,null));};exports[_0xedac('0x25')]=function(_0x176b69,_0x29fe75){return db['Disposition'][_0xedac('0x4a')]({'where':{'id':_0x176b69[_0xedac('0x46')]['id']}})[_0xedac('0x24')](handleEntityNotFound(_0x29fe75,null))[_0xedac('0x24')](removeEntity(_0x29fe75,null))[_0xedac('0x44')](handleError(_0x29fe75,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index db55ce4..00913b7 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 _0xb656=['ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','WhatsappAccountId','lodash','util','../../config/logger','api','moment','path','rimraf','./disposition.attributes','exports','tools_dispositions','name_voice','name'];(function(_0x1db551,_0x4a6682){var _0x7b3bdc=function(_0x36c82c){while(--_0x36c82c){_0x1db551['push'](_0x1db551['shift']());}};_0x7b3bdc(++_0x4a6682);}(_0xb656,0x1a9));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b65('0x0'));var util=require(_0x6b65('0x1'));var logger=require(_0x6b65('0x2'))(_0x6b65('0x3'));var moment=require(_0x6b65('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b65('0x5'));var rimraf=require(_0x6b65('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b65('0x7'));module[_0x6b65('0x8')]=function(_0x1cd1fd,_0x23ba2b){return _0x1cd1fd['define']('Disposition',attributes,{'tableName':_0x6b65('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6b65('0xa'),'fields':[_0x6b65('0xb'),_0x6b65('0xc')]},{'unique':!![],'name':_0x6b65('0xd'),'fields':[_0x6b65('0xb'),_0x6b65('0xe')]},{'unique':!![],'name':_0x6b65('0xf'),'fields':[_0x6b65('0xb'),_0x6b65('0x10')]},{'unique':!![],'name':_0x6b65('0x11'),'fields':[_0x6b65('0xb'),_0x6b65('0x12')]},{'unique':!![],'name':_0x6b65('0x13'),'fields':[_0x6b65('0xb'),_0x6b65('0x14')]},{'unique':!![],'name':_0x6b65('0x15'),'fields':[_0x6b65('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x6b65('0xb'),_0x6b65('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae5=['request-promise','path','rimraf','../../config/environment','exports','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x8ef83d,_0x520c3d){var _0x4a4a19=function(_0x189336){while(--_0x189336){_0x8ef83d['push'](_0x8ef83d['shift']());}};_0x4a4a19(++_0x520c3d);}(_0x1ae5,0xb3));var _0x51ae=function(_0x34901f,_0x2e8786){_0x34901f=_0x34901f-0x0;var _0x3a9371=_0x1ae5[_0x34901f];return _0x3a9371;};'use strict';var _=require(_0x51ae('0x0'));var util=require('util');var logger=require(_0x51ae('0x1'))(_0x51ae('0x2'));var moment=require(_0x51ae('0x3'));var BPromise=require(_0x51ae('0x4'));var rp=require(_0x51ae('0x5'));var fs=require('fs');var path=require(_0x51ae('0x6'));var rimraf=require(_0x51ae('0x7'));var config=require(_0x51ae('0x8'));var attributes=require('./disposition.attributes');module[_0x51ae('0x9')]=function(_0x36a850,_0x20bc66){return _0x36a850['define'](_0x51ae('0xa'),attributes,{'tableName':_0x51ae('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x51ae('0xc')]},{'unique':!![],'name':_0x51ae('0xd'),'fields':[_0x51ae('0xe'),_0x51ae('0xf')]},{'unique':!![],'name':_0x51ae('0x10'),'fields':[_0x51ae('0xe'),_0x51ae('0x11')]},{'unique':!![],'name':_0x51ae('0x12'),'fields':[_0x51ae('0xe'),_0x51ae('0x13')]},{'unique':!![],'name':_0x51ae('0x14'),'fields':['name',_0x51ae('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0x51ae('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x51ae('0xe'),_0x51ae('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9b653fb..f780748 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 _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x24669b,_0x144ee1){var _0x3cf3b4=function(_0x57ca9d){while(--_0x57ca9d){_0x24669b['push'](_0x24669b['shift']());}};_0x3cf3b4(++_0x144ee1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x201283,_0x37bc1c){var _0x11eada=function(_0xaa0970){while(--_0xaa0970){_0x201283['push'](_0x201283['shift']());}};_0x11eada(++_0x37bc1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 63a85d5..0cdf712 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 _0xfaee=['/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x4e74c3,_0x5c8a2d){var _0x2fb1dd=function(_0x464f1c){while(--_0x464f1c){_0x4e74c3['push'](_0x4e74c3['shift']());}};_0x2fb1dd(++_0x5c8a2d);}(_0xfaee,0x15d));var _0xefae=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0xfaee[_0x1fd675];return _0x521d1c;};'use strict';var multer=require(_0xefae('0x0'));var util=require(_0xefae('0x1'));var path=require('path');var timeout=require(_0xefae('0x2'));var express=require(_0xefae('0x3'));var router=express[_0xefae('0x4')]();var fs_extra=require(_0xefae('0x5'));var auth=require(_0xefae('0x6'));var interaction=require(_0xefae('0x7'));var config=require(_0xefae('0x8'));var controller=require(_0xefae('0x9'));router[_0xefae('0xa')]('/',auth[_0xefae('0xb')](),controller['index']);router[_0xefae('0xa')](_0xefae('0xc'),auth[_0xefae('0xb')](),controller[_0xefae('0xd')]);router[_0xefae('0xe')]('/',auth['isAuthenticated'](),controller[_0xefae('0xf')]);router[_0xefae('0x10')](_0xefae('0xc'),auth[_0xefae('0xb')](),controller['update']);router['delete'](_0xefae('0xc'),auth[_0xefae('0xb')](),controller[_0xefae('0x11')]);module[_0xefae('0x12')]=router; \ No newline at end of file +var _0x263a=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','update','delete'];(function(_0x11f28f,_0x30ebf9){var _0x413f1a=function(_0x537f8b){while(--_0x537f8b){_0x11f28f['push'](_0x11f28f['shift']());}};_0x413f1a(++_0x30ebf9);}(_0x263a,0x112));var _0xa263=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x263a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa263('0x0'));var util=require(_0xa263('0x1'));var path=require(_0xa263('0x2'));var timeout=require(_0xa263('0x3'));var express=require('express');var router=express[_0xa263('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa263('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa263('0x6'));var controller=require('./disposition.controller');router[_0xa263('0x7')]('/',auth[_0xa263('0x8')](),controller[_0xa263('0x9')]);router['get']('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xa')]);router[_0xa263('0xb')]('/',auth[_0xa263('0x8')](),controller[_0xa263('0xc')]);router['put']('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xd')]);router[_0xa263('0xe')]('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xf')]);module[_0xa263('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 420c767..42db743 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 _0xe606=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','12000','14400','7200','9600','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xc5b1aa,_0x436c79){var _0x4cfe8d=function(_0xac03f5){while(--_0xac03f5){_0xc5b1aa['push'](_0xc5b1aa['shift']());}};_0x4cfe8d(++_0x436c79);}(_0xe606,0x125));var _0x6e60=function(_0x12314f,_0x2ac7ae){_0x12314f=_0x12314f-0x0;var _0x3b6e61=_0xe606[_0x12314f];return _0x3b6e61;};'use strict';var Sequelize=require(_0x6e60('0x0'));module[_0x6e60('0x1')]={'name':{'type':Sequelize[_0x6e60('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x6e60('0x3')](_0x6e60('0x4'),'no'),'defaultValue':_0x6e60('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x6e60('0x5')},'localstationid':{'type':Sequelize[_0x6e60('0x2')],'unique':_0x6e60('0x6')},'minrate':{'type':Sequelize[_0x6e60('0x3')](_0x6e60('0x7'),_0x6e60('0x8'),'7200','9600',_0x6e60('0x9'),_0x6e60('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x6e60('0x3')]('2400',_0x6e60('0x8'),_0x6e60('0xb'),_0x6e60('0xc'),'12000','14400'),'defaultValue':_0x6e60('0xa')},'modem':{'type':Sequelize[_0x6e60('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x6e60('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6e60('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6e60('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6e60('0x3')](_0x6e60('0xe'),'IAX',_0x6e60('0xf'),_0x6e60('0x10')),'defaultValue':_0x6e60('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6e60('0x11')],'defaultValue':function(){return _0x6e60('0x12');}},'notificationSound':{'type':Sequelize[_0x6e60('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e60('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e60('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e60('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e60('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e60('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e60('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e60('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x6e60('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x6e60('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2721a4){if(!_0x2721a4)this[_0x6e60('0x15')](_0x6e60('0x16'),null);this[_0x6e60('0x15')](_0x6e60('0x17'),_0x2721a4);}}}; \ No newline at end of file +var _0xbc5b=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xbc5b,0x1d1));var _0xbbc5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbc5b[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xbbc5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbc5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbbc5('0x1')]},'ecm':{'type':Sequelize[_0xbbc5('0x2')]('yes','no'),'defaultValue':_0xbbc5('0x3')},'headerinfo':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xbbc5('0x4')},'minrate':{'type':Sequelize[_0xbbc5('0x2')](_0xbbc5('0x5'),_0xbbc5('0x6'),_0xbbc5('0x7'),_0xbbc5('0x8'),_0xbbc5('0x9'),_0xbbc5('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xbbc5('0x2')]('2400',_0xbbc5('0x6'),_0xbbc5('0x7'),'9600',_0xbbc5('0x9'),'14400'),'defaultValue':_0xbbc5('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbbc5('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbbc5('0x2')](_0xbbc5('0xc'),_0xbbc5('0xd'),_0xbbc5('0xe'),_0xbbc5('0xf')),'defaultValue':_0xbbc5('0xc')},'key':{'type':Sequelize[_0xbbc5('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbbc5('0x10');}},'notificationSound':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbbc5('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xbbc5('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![],'comment':_0xbbc5('0x13'),'set':function(_0x543119){if(!_0x543119)this[_0xbbc5('0x14')]('mandatoryDispositionPauseId',null);this[_0xbbc5('0x14')]('mandatoryDisposition',_0x543119);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6472def..43c735a 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 _0x0483=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','name','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','Pause','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','getDispositions','findOne','pick','options','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','omit','FaxInteraction','CmContact','Owner','fullname','internal','Tags','addApplications','sequelize','Transaction','FaxApplication','bulkCreate','findAndCountAll','priority','stack','send','getApplications','context','from-voip-provider','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','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','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','tech','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','format','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','User','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x56e0e5,_0x2e3937){var _0x27bb15=function(_0x186336){while(--_0x186336){_0x56e0e5['push'](_0x56e0e5['shift']());}};_0x27bb15(++_0x2e3937);}(_0x0483,0x16b));var _0x3048=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0483[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3048('0x0'));var zipdir=require(_0x3048('0x1'));var jsonpatch=require(_0x3048('0x2'));var rp=require('request-promise');var moment=require(_0x3048('0x3'));var BPromise=require(_0x3048('0x4'));var Mustache=require('mustache');var util=require(_0x3048('0x5'));var path=require(_0x3048('0x6'));var sox=require('sox');var csv=require(_0x3048('0x7'));var ejs=require(_0x3048('0x8'));var fs=require('fs');var fs_extra=require(_0x3048('0x9'));var _=require(_0x3048('0xa'));var squel=require(_0x3048('0xb'));var crypto=require(_0x3048('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3048('0xd'));var toCsv=require(_0x3048('0x7'));var querystring=require(_0x3048('0xe'));var Papa=require(_0x3048('0xf'));var Redis=require(_0x3048('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3048('0x11'));var as=require(_0x3048('0x12'));var hardwareService=require(_0x3048('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3048('0x14'));var licenseUtil=require(_0x3048('0x15'));var db=require(_0x3048('0x16'))['db'];config[_0x3048('0x17')]=_[_0x3048('0x18')](config['redis'],{'host':_0x3048('0x19'),'port':0x18eb});var socket=require(_0x3048('0x1a'))(new Redis(config[_0x3048('0x17')]));require(_0x3048('0x1b'))['register'](socket);var jayson=require(_0x3048('0x1c'));var client=jayson[_0x3048('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x3048('0x1d')][_0x3048('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5d8e33,_0x5b28c3,_0x264535,_0xf09ee1){return new BPromise(function(_0x25b73f,_0x41ff5f){var _0x3109a9=_0xf09ee1||client;return _0x3109a9[_0x3048('0x1f')](_0x5d8e33,_0x264535)[_0x3048('0x20')](function(_0xf356c6){logger[_0x3048('0x21')](_0x3048('0x22'),_0x5b28c3,_0x3048('0x23'));logger[_0x3048('0x24')](_0x3048('0x25'),_0x5b28c3,'request\x20sent',JSON[_0x3048('0x26')](_0xf356c6));if(_0xf356c6[_0x3048('0x27')]){if(_0xf356c6[_0x3048('0x27')][_0x3048('0x28')]===0x1f4){logger['error'](_0x3048('0x22'),_0x5b28c3,_0xf356c6[_0x3048('0x27')][_0x3048('0x29')]);return _0x41ff5f(_0xf356c6[_0x3048('0x27')]['message']);}logger[_0x3048('0x27')](_0x3048('0x22'),_0x5b28c3,_0xf356c6[_0x3048('0x27')][_0x3048('0x29')]);return _0x25b73f(_0xf356c6[_0x3048('0x27')][_0x3048('0x29')]);}else{logger['info'](_0x3048('0x22'),_0x5b28c3,_0x3048('0x23'));_0x25b73f(_0xf356c6['result'][_0x3048('0x29')]);}})[_0x3048('0x2a')](function(_0x1d0d9a){logger[_0x3048('0x27')]('FaxAccount,\x20%s,\x20%s',_0x5b28c3,_0x1d0d9a);_0x41ff5f(_0x1d0d9a);});});}function respondWithStatusCode(_0x420672,_0x43b425){_0x43b425=_0x43b425||0xcc;return function(_0x42b58c){if(_0x42b58c){return _0x420672[_0x3048('0x2b')](_0x43b425);}return _0x420672[_0x3048('0x2c')](_0x43b425)[_0x3048('0x2d')]();};}function respondWithResult(_0x424dfd,_0x34baaf){_0x34baaf=_0x34baaf||0xc8;return function(_0x542ca6){if(_0x542ca6){return _0x424dfd['status'](_0x34baaf)[_0x3048('0x2e')](_0x542ca6);}};}function respondWithFilteredResult(_0x370785,_0x58f551){return function(_0x4a01dd){if(_0x4a01dd){var _0x347624=typeof _0x58f551['offset']===_0x3048('0x2f')&&typeof _0x58f551['limit']===_0x3048('0x2f');var _0x2c4b94=_0x4a01dd[_0x3048('0x30')];var _0x5d2c98=_0x347624?0x0:_0x58f551[_0x3048('0x31')];var _0x1da698=_0x347624?_0x4a01dd[_0x3048('0x30')]:_0x58f551['offset']+_0x58f551[_0x3048('0x32')];var _0x1925b6;if(_0x1da698>=_0x2c4b94){_0x1da698=_0x2c4b94;_0x1925b6=0xc8;}else{_0x1925b6=0xce;}_0x370785['status'](_0x1925b6);return _0x370785['set'](_0x3048('0x33'),_0x5d2c98+'-'+_0x1da698+'/'+_0x2c4b94)[_0x3048('0x2e')](_0x4a01dd);}return null;};}function patchUpdates(_0x163484){return function(_0x2b8aec){try{jsonpatch[_0x3048('0x34')](_0x2b8aec,_0x163484,!![]);}catch(_0x309059){return BPromise['reject'](_0x309059);}return _0x2b8aec[_0x3048('0x35')]();};}function saveUpdates(_0xc6cccf,_0x2f8936){return function(_0x51482f){if(_0x51482f){return _0x51482f[_0x3048('0x36')](_0xc6cccf)[_0x3048('0x20')](function(_0xd75497){return _0xd75497;});}return null;};}function removeEntity(_0x554854,_0x3a0721){return function(_0x56b1ea){if(_0x56b1ea){return _0x56b1ea[_0x3048('0x37')]()[_0x3048('0x20')](function(){var _0x498d00=_0x56b1ea[_0x3048('0x38')]({'plain':!![]});var _0x15d97d=_0x3048('0x39');return db[_0x3048('0x3a')][_0x3048('0x37')]({'where':{'type':_0x15d97d,'resourceId':_0x498d00['id']}})['then'](function(){return _0x56b1ea;});})['then'](function(){_0x554854['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ca60,_0x596554){return function(_0x114648){if(!_0x114648){_0x10ca60[_0x3048('0x2b')](0x194);}return _0x114648;};}function handleError(_0xa37ddc,_0x370e37){_0x370e37=_0x370e37||0x1f4;return function(_0x341cb9){logger['error'](_0x341cb9['stack']);if(_0x341cb9[_0x3048('0x3b')]){delete _0x341cb9[_0x3048('0x3b')];}_0xa37ddc['status'](_0x370e37)['send'](_0x341cb9);};}exports[_0x3048('0x3c')]=function(_0x556172,_0x3e6ff3){var _0x3c6e67={'include':[{'model':db['Pause'],'as':_0x3048('0x3d')}]},_0x138e8f={},_0x588279={'count':0x0,'rows':[]};var _0x41494b=_[_0x3048('0x3e')](db[_0x3048('0x3f')][_0x3048('0x40')],function(_0x45b730){return{'name':_0x45b730['fieldName'],'type':_0x45b730['type'][_0x3048('0x41')]};});_0x138e8f[_0x3048('0x42')]=_['map'](_0x41494b,_0x3048('0x3b'));_0x138e8f['query']=_[_0x3048('0x43')](_0x556172[_0x3048('0x44')]);_0x138e8f[_0x3048('0x45')]=_[_0x3048('0x46')](_0x138e8f['model'],_0x138e8f['query']);_0x3c6e67['attributes']=_[_0x3048('0x46')](_0x138e8f['model'],qs[_0x3048('0x47')](_0x556172[_0x3048('0x44')][_0x3048('0x47')]));_0x3c6e67[_0x3048('0x48')]=_0x3c6e67['attributes'][_0x3048('0x49')]?_0x3c6e67[_0x3048('0x48')]:_0x138e8f[_0x3048('0x42')];if(!_0x556172['query'][_0x3048('0x4a')](_0x3048('0x4b'))){_0x3c6e67[_0x3048('0x32')]=qs[_0x3048('0x32')](_0x556172[_0x3048('0x44')][_0x3048('0x32')]);_0x3c6e67['offset']=qs[_0x3048('0x31')](_0x556172[_0x3048('0x44')][_0x3048('0x31')]);}_0x3c6e67[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0x556172[_0x3048('0x44')][_0x3048('0x4d')]);_0x3c6e67[_0x3048('0x4e')]=qs[_0x3048('0x45')](_['pick'](_0x556172['query'],_0x138e8f[_0x3048('0x45')]),_0x41494b);if(_0x556172['query'][_0x3048('0x4f')]){_0x3c6e67[_0x3048('0x4e')]=_[_0x3048('0x50')](_0x3c6e67[_0x3048('0x4e')],{'$or':_['map'](_0x41494b,function(_0x1efa97){if(_0x1efa97[_0x3048('0x51')]!==_0x3048('0x52')){var _0x1b62b5={};_0x1b62b5[_0x1efa97[_0x3048('0x3b')]]={'$like':'%'+_0x556172[_0x3048('0x44')][_0x3048('0x4f')]+'%'};return _0x1b62b5;}})});}_0x3c6e67=_[_0x3048('0x50')]({},_0x3c6e67,_0x556172['options']);var _0x341b54={'where':_0x3c6e67[_0x3048('0x4e')]};return db['FaxAccount'][_0x3048('0x30')](_0x341b54)[_0x3048('0x20')](function(_0xe7541a){_0x588279['count']=_0xe7541a;if(_0x556172['query'][_0x3048('0x53')]){_0x3c6e67[_0x3048('0x54')]=[{'all':!![]}];}return db[_0x3048('0x3f')][_0x3048('0x55')](_0x3c6e67);})['then'](function(_0x4e2e01){_0x588279['rows']=_0x4e2e01;return _0x588279;})[_0x3048('0x20')](respondWithFilteredResult(_0x3e6ff3,_0x3c6e67))[_0x3048('0x2a')](handleError(_0x3e6ff3,null));};exports[_0x3048('0x56')]=function(_0xf73101,_0x416f99){var _0x88a450={'raw':![],'where':{'id':_0xf73101['params']['id']},'include':[{'model':db[_0x3048('0x57')],'as':_0x3048('0x3d')}]},_0xa5e263={};_0xa5e263[_0x3048('0x42')]=_[_0x3048('0x43')](db[_0x3048('0x3f')][_0x3048('0x40')]);_0xa5e263[_0x3048('0x44')]=_['keys'](_0xf73101[_0x3048('0x44')]);_0xa5e263[_0x3048('0x45')]=_[_0x3048('0x46')](_0xa5e263[_0x3048('0x42')],_0xa5e263[_0x3048('0x44')]);_0x88a450[_0x3048('0x48')]=_[_0x3048('0x46')](_0xa5e263['model'],qs[_0x3048('0x47')](_0xf73101[_0x3048('0x44')][_0x3048('0x47')]));_0x88a450[_0x3048('0x48')]=_0x88a450[_0x3048('0x48')][_0x3048('0x49')]?_0x88a450['attributes']:_0xa5e263[_0x3048('0x42')];if(_0xf73101[_0x3048('0x44')]['includeAll']){_0x88a450[_0x3048('0x54')]=[{'all':!![]}];}_0x88a450=_['merge']({},_0x88a450,_0xf73101['options']);return db['FaxAccount'][_0x3048('0x58')](_0x88a450)['then'](handleEntityNotFound(_0x416f99,null))[_0x3048('0x20')](respondWithResult(_0x416f99,null))[_0x3048('0x2a')](handleError(_0x416f99,null));};exports['create']=function(_0x4cd9f9,_0x2c480b){return db['FaxAccount'][_0x3048('0x59')](_0x4cd9f9[_0x3048('0x5a')],{})[_0x3048('0x20')](function(_0x2b783f){var _0x3ac9ec=_0x4cd9f9[_0x3048('0x5b')][_0x3048('0x38')]({'plain':!![]});if(!_0x3ac9ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ac9ec['role']==='user'){var _0x53c255=_0x2b783f[_0x3048('0x38')]({'plain':!![]});var _0x10950f=_0x3048('0x39');return db[_0x3048('0x5c')][_0x3048('0x58')]({'where':{'name':_0x10950f,'userProfileId':_0x3ac9ec[_0x3048('0x5d')]},'raw':!![]})['then'](function(_0x53e371){if(_0x53e371&&_0x53e371[_0x3048('0x5e')]===0x0){return db[_0x3048('0x3a')][_0x3048('0x59')]({'name':_0x53c255[_0x3048('0x3b')],'resourceId':_0x53c255['id'],'type':_0x53e371[_0x3048('0x3b')],'sectionId':_0x53e371['id']},{})[_0x3048('0x20')](function(){return _0x2b783f;});}else{return _0x2b783f;}})['catch'](function(_0x159732){logger[_0x3048('0x27')](_0x3048('0x5f'),_0x159732);throw _0x159732;});}return _0x2b783f;})['then'](respondWithResult(_0x2c480b,0xc9))['catch'](handleError(_0x2c480b,null));};exports[_0x3048('0x36')]=function(_0x3e958c,_0x3cf436){if(_0x3e958c[_0x3048('0x5a')]['id']){delete _0x3e958c[_0x3048('0x5a')]['id'];}return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x3e958c['params']['id']},'include':[{'model':db[_0x3048('0x57')],'as':_0x3048('0x3d')}]})[_0x3048('0x20')](handleEntityNotFound(_0x3cf436,null))['then'](saveUpdates(_0x3e958c['body'],null))[_0x3048('0x20')](respondWithResult(_0x3cf436,null))[_0x3048('0x2a')](handleError(_0x3cf436,null));};exports[_0x3048('0x37')]=function(_0x69a479,_0x42ac51){return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x69a479[_0x3048('0x60')]['id']}})['then'](handleEntityNotFound(_0x42ac51,null))['then'](removeEntity(_0x42ac51,null))[_0x3048('0x2a')](handleError(_0x42ac51,null));};exports[_0x3048('0x61')]=function(_0x19e972,_0xb59282){return db[_0x3048('0x3f')][_0x3048('0x61')]()['then'](respondWithResult(_0xb59282,null))[_0x3048('0x2a')](handleError(_0xb59282,null));};exports['addDisposition']=function(_0x34df12,_0x1be514,_0x190a4a){if(_0x34df12[_0x3048('0x5a')]['id']){delete _0x34df12[_0x3048('0x5a')]['id'];}return db['FaxAccount'][_0x3048('0x58')]({'where':{'id':_0x34df12[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x1be514,null))[_0x3048('0x20')](function(_0x3524fa){if(_0x3524fa){_0x34df12[_0x3048('0x5a')][_0x3048('0x62')]=_0x3524fa['id'];return db[_0x3048('0x63')][_0x3048('0x59')](_0x34df12[_0x3048('0x5a')]);}})['then'](respondWithResult(_0x1be514,null))[_0x3048('0x2a')](handleError(_0x1be514,null));};exports[_0x3048('0x64')]=function(_0xb0503c,_0x2c1b7b,_0x247486){var _0x36a0df={'raw':![],'where':{}};var _0x319b37={};var _0x4e3fc7={'count':0x0,'rows':[]};return db[_0x3048('0x3f')][_0x3048('0x65')]({'where':{'id':_0xb0503c[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x2c1b7b,null))['then'](function(_0x260749){if(_0x260749){_0x319b37['model']=_[_0x3048('0x43')](db[_0x3048('0x63')][_0x3048('0x40')]);_0x319b37['query']=_[_0x3048('0x43')](_0xb0503c[_0x3048('0x44')]);_0x319b37[_0x3048('0x45')]=_[_0x3048('0x46')](_0x319b37[_0x3048('0x42')],_0x319b37['query']);_0x36a0df[_0x3048('0x48')]=_[_0x3048('0x46')](_0x319b37[_0x3048('0x42')],qs[_0x3048('0x47')](_0xb0503c[_0x3048('0x44')]['fields']));_0x36a0df[_0x3048('0x48')]=_0x36a0df[_0x3048('0x48')]['length']?_0x36a0df['attributes']:_0x319b37[_0x3048('0x42')];if(!_0xb0503c[_0x3048('0x44')]['hasOwnProperty'](_0x3048('0x4b'))){_0x36a0df['limit']=qs['limit'](_0xb0503c[_0x3048('0x44')][_0x3048('0x32')]);_0x36a0df[_0x3048('0x31')]=qs[_0x3048('0x31')](_0xb0503c[_0x3048('0x44')]['offset']);}_0x36a0df[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0xb0503c[_0x3048('0x44')]['sort']);_0x36a0df[_0x3048('0x4e')]=qs[_0x3048('0x45')](_[_0x3048('0x66')](_0xb0503c[_0x3048('0x44')],_0x319b37[_0x3048('0x45')]));_0x36a0df[_0x3048('0x4e')][_0x3048('0x62')]=_0x260749['id'];if(_0xb0503c['query'][_0x3048('0x4f')]){_0x36a0df[_0x3048('0x4e')]=_[_0x3048('0x50')](_0x36a0df[_0x3048('0x4e')],{'$or':_[_0x3048('0x3e')](_0x36a0df[_0x3048('0x48')],function(_0x3c7bcc){var _0xf5c8e3={};_0xf5c8e3[_0x3c7bcc]={'$like':'%'+_0xb0503c[_0x3048('0x44')][_0x3048('0x4f')]+'%'};return _0xf5c8e3;})});}_0x36a0df=_['merge']({},_0x36a0df,_0xb0503c[_0x3048('0x67')]);return db[_0x3048('0x63')][_0x3048('0x30')]({'where':_0x36a0df[_0x3048('0x4e')]})['then'](function(_0xd820a0){_0x4e3fc7[_0x3048('0x30')]=_0xd820a0;if(_0xb0503c[_0x3048('0x44')][_0x3048('0x53')]){_0x36a0df[_0x3048('0x54')]=[{'all':!![]}];}return db[_0x3048('0x63')]['findAll'](_0x36a0df);})['then'](function(_0x2e2692){_0x4e3fc7[_0x3048('0x68')]=_0x2e2692;return _0x4e3fc7;});}})[_0x3048('0x20')](respondWithFilteredResult(_0x2c1b7b,_0x36a0df))[_0x3048('0x2a')](handleError(_0x2c1b7b,null));};exports[_0x3048('0x69')]=function(_0x4cb463,_0x53d3e0,_0x214653){return db['FaxAccount'][_0x3048('0x58')]({'where':{'id':_0x4cb463['params']['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x53d3e0,null))[_0x3048('0x20')](function(_0x5c81b5){if(_0x5c81b5){return _0x5c81b5[_0x3048('0x69')](_0x4cb463[_0x3048('0x44')]['ids']);}})[_0x3048('0x20')](respondWithStatusCode(_0x53d3e0,null))['catch'](handleError(_0x53d3e0,null));};exports[_0x3048('0x6a')]=function(_0x2492c2,_0x3d91da,_0x41d894){if(_0x2492c2[_0x3048('0x5a')]['id']){delete _0x2492c2[_0x3048('0x5a')]['id'];}return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x2492c2[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x3d91da,null))[_0x3048('0x20')](function(_0x1a6c21){if(_0x1a6c21){_0x2492c2[_0x3048('0x5a')][_0x3048('0x62')]=_0x1a6c21['id'];return db[_0x3048('0x6b')]['create'](_0x2492c2[_0x3048('0x5a')]);}})[_0x3048('0x20')](respondWithResult(_0x3d91da,null))[_0x3048('0x2a')](handleError(_0x3d91da,null));};exports[_0x3048('0x6c')]=function(_0x56cf8c,_0x1e1995,_0x2ba8be){var _0x1396ae={'raw':![],'where':{}};var _0x3f57f9={};var _0x44266d={'count':0x0,'rows':[]};return db[_0x3048('0x3f')]['findOne']({'where':{'id':_0x56cf8c['params']['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x1e1995,null))['then'](function(_0x116b51){if(_0x116b51){_0x3f57f9[_0x3048('0x42')]=_[_0x3048('0x43')](db[_0x3048('0x6b')]['rawAttributes']);_0x3f57f9[_0x3048('0x44')]=_[_0x3048('0x43')](_0x56cf8c['query']);_0x3f57f9[_0x3048('0x45')]=_[_0x3048('0x46')](_0x3f57f9['model'],_0x3f57f9['query']);_0x1396ae['attributes']=_[_0x3048('0x46')](_0x3f57f9['model'],qs['fields'](_0x56cf8c[_0x3048('0x44')]['fields']));_0x1396ae[_0x3048('0x48')]=_0x1396ae['attributes']['length']?_0x1396ae[_0x3048('0x48')]:_0x3f57f9[_0x3048('0x42')];if(!_0x56cf8c['query'][_0x3048('0x4a')]('nolimit')){_0x1396ae[_0x3048('0x32')]=qs['limit'](_0x56cf8c[_0x3048('0x44')]['limit']);_0x1396ae[_0x3048('0x31')]=qs['offset'](_0x56cf8c['query']['offset']);}_0x1396ae[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0x56cf8c[_0x3048('0x44')][_0x3048('0x4d')]);_0x1396ae[_0x3048('0x4e')]=qs[_0x3048('0x45')](_['pick'](_0x56cf8c[_0x3048('0x44')],_0x3f57f9[_0x3048('0x45')]));_0x1396ae[_0x3048('0x4e')]['FaxAccountId']=_0x116b51['id'];if(_0x56cf8c['query'][_0x3048('0x4f')]){_0x1396ae['where']=_[_0x3048('0x50')](_0x1396ae[_0x3048('0x4e')],{'$or':_[_0x3048('0x3e')](_0x1396ae[_0x3048('0x48')],function(_0x498063){var _0x3ec0c6={};_0x3ec0c6[_0x498063]={'$like':'%'+_0x56cf8c[_0x3048('0x44')]['filter']+'%'};return _0x3ec0c6;})});}_0x1396ae=_[_0x3048('0x50')]({},_0x1396ae,_0x56cf8c[_0x3048('0x67')]);return db[_0x3048('0x6b')][_0x3048('0x30')]({'where':_0x1396ae[_0x3048('0x4e')]})['then'](function(_0x33542b){_0x44266d[_0x3048('0x30')]=_0x33542b;if(_0x56cf8c['query']['includeAll']){_0x1396ae['include']=[{'all':!![]}];}return db[_0x3048('0x6b')][_0x3048('0x55')](_0x1396ae);})[_0x3048('0x20')](function(_0x440d94){_0x44266d[_0x3048('0x68')]=_0x440d94;return _0x44266d;});}})[_0x3048('0x20')](respondWithFilteredResult(_0x1e1995,_0x1396ae))[_0x3048('0x2a')](handleError(_0x1e1995,null));};exports[_0x3048('0x6d')]=function(_0x4af474,_0x193614,_0x23a811){return db['FaxAccount'][_0x3048('0x58')]({'where':{'id':_0x4af474[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x193614,null))[_0x3048('0x20')](function(_0x2a5e4f){if(_0x2a5e4f){return _0x2a5e4f['removeAnswers'](_0x4af474[_0x3048('0x44')][_0x3048('0x6e')]);}})[_0x3048('0x20')](respondWithStatusCode(_0x193614,null))[_0x3048('0x2a')](handleError(_0x193614,null));};exports[_0x3048('0x6f')]=function(_0x1eee88,_0x460887,_0x4976a4){return db['FaxInteraction'][_0x3048('0x58')]({'where':{'id':_0x1eee88[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x460887,null))[_0x3048('0x20')](function(_0x4d713c){if(_0x4d713c){return _0x4d713c[_0x3048('0x6f')](_0x1eee88[_0x3048('0x5a')][_0x3048('0x6e')],_[_0x3048('0x70')](_0x1eee88[_0x3048('0x5a')],['ids','id'])||{});}})[_0x3048('0x20')](respondWithResult(_0x460887,null))[_0x3048('0x2a')](handleError(_0x460887,null));};exports['getInteractions']=function(_0x4bc9f1,_0x21717d,_0x59e625){var _0x1ecdcd={'raw':![],'where':{}};var _0x3830cc={};var _0x4e4588={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3048('0x65')]({'where':{'id':_0x4bc9f1[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x21717d,null))[_0x3048('0x20')](function(_0x13897b){if(_0x13897b){_0x3830cc[_0x3048('0x42')]=_['keys'](db['FaxInteraction'][_0x3048('0x40')]);_0x3830cc[_0x3048('0x44')]=_[_0x3048('0x43')](_0x4bc9f1[_0x3048('0x44')]);_0x3830cc['filters']=_['intersection'](_0x3830cc[_0x3048('0x42')],_0x3830cc[_0x3048('0x44')]);_0x1ecdcd[_0x3048('0x48')]=_['intersection'](_0x3830cc[_0x3048('0x42')],qs[_0x3048('0x47')](_0x4bc9f1['query']['fields']));_0x1ecdcd[_0x3048('0x48')]=_0x1ecdcd[_0x3048('0x48')]['length']?_0x1ecdcd['attributes']:_0x3830cc['model'];if(!_0x4bc9f1[_0x3048('0x44')][_0x3048('0x4a')](_0x3048('0x4b'))){_0x1ecdcd[_0x3048('0x32')]=qs[_0x3048('0x32')](_0x4bc9f1[_0x3048('0x44')][_0x3048('0x32')]);_0x1ecdcd[_0x3048('0x31')]=qs['offset'](_0x4bc9f1[_0x3048('0x44')][_0x3048('0x31')]);}_0x1ecdcd[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0x4bc9f1['query'][_0x3048('0x4d')]);_0x1ecdcd[_0x3048('0x4e')]=qs[_0x3048('0x45')](_[_0x3048('0x66')](_0x4bc9f1[_0x3048('0x44')],_0x3830cc[_0x3048('0x45')]));_0x1ecdcd[_0x3048('0x4e')][_0x3048('0x62')]=_0x13897b['id'];if(_0x4bc9f1[_0x3048('0x44')][_0x3048('0x4f')]){_0x1ecdcd[_0x3048('0x4e')]=_[_0x3048('0x50')](_0x1ecdcd['where'],{'$or':_[_0x3048('0x3e')](_0x1ecdcd[_0x3048('0x48')],function(_0x38c028){var _0x5ce6a1={};_0x5ce6a1[_0x38c028]={'$like':'%'+_0x4bc9f1['query'][_0x3048('0x4f')]+'%'};return _0x5ce6a1;})});}_0x1ecdcd=_[_0x3048('0x50')]({},_0x1ecdcd,_0x4bc9f1[_0x3048('0x67')]);return db[_0x3048('0x71')][_0x3048('0x30')]({'where':_0x1ecdcd[_0x3048('0x4e')]})[_0x3048('0x20')](function(_0x308a5a){_0x4e4588[_0x3048('0x30')]=_0x308a5a;if(_0x4bc9f1[_0x3048('0x44')][_0x3048('0x53')]){_0x1ecdcd[_0x3048('0x54')]=[{'model':db[_0x3048('0x72')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x3048('0x73'),'attributes':[_0x3048('0x3b'),_0x3048('0x74'),_0x3048('0x75')],'required':![]},{'model':db['Tag'],'as':_0x3048('0x76'),'attributes':['id',_0x3048('0x3b'),'color'],'where':_0x4bc9f1['query']['tag']?{'id':_0x4bc9f1[_0x3048('0x44')]['tag']}:undefined,'required':_0x4bc9f1[_0x3048('0x44')]['tag']?!![]:![]}];}return db[_0x3048('0x71')][_0x3048('0x55')](_0x1ecdcd);})['then'](function(_0x5cb8a0){_0x4e4588[_0x3048('0x68')]=_0x5cb8a0;return _0x4e4588;});}})[_0x3048('0x20')](respondWithFilteredResult(_0x21717d,_0x1ecdcd))['catch'](handleError(_0x21717d,null));};exports[_0x3048('0x77')]=function(_0x37bcf1,_0x2cf364){var _0x45abb8=_0x37bcf1[_0x3048('0x60')]['id'];var _0x4ea8a1=_0x37bcf1[_0x3048('0x5a')];var _0x253ee5=0xc8;var _0x3a770b=null;return db[_0x3048('0x78')]['transaction']({'isolationLevel':db[_0x3048('0x78')][_0x3048('0x79')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5794c9){return db[_0x3048('0x3f')][_0x3048('0x65')]({'where':{'id':_0x45abb8},'transaction':_0x5794c9})[_0x3048('0x20')](function(_0x4f0ca0){if(_0x4f0ca0){return db[_0x3048('0x7a')][_0x3048('0x37')]({'where':{'FaxAccountId':_0x45abb8},'transaction':_0x5794c9})[_0x3048('0x20')](function(){var _0x2d8fbf=_['map'](_0x4ea8a1,function(_0x428a9c){_0x428a9c[_0x3048('0x62')]=_0x45abb8;return _0x428a9c;});return db[_0x3048('0x7a')][_0x3048('0x7b')](_0x2d8fbf,{'transaction':_0x5794c9});});}else{_0x253ee5=0x194;_0x3a770b=[];}});})['then'](function(){if(_0x253ee5!==0x194){return db['FaxApplication'][_0x3048('0x7c')]({'where':{'FaxAccountId':_0x45abb8},'order':_0x3048('0x7d')})[_0x3048('0x20')](function(_0x773a16){_0x3a770b=_0x773a16;});}})['catch'](function(_0x5baf63){_0x253ee5=0x1f4;logger['error'](_0x5baf63[_0x3048('0x7e')]);if(_0x5baf63['name']){delete _0x5baf63[_0x3048('0x3b')];}_0x3a770b=_0x5baf63;})['finally'](function(){if(_0x3a770b===null){_0x2cf364[_0x3048('0x2b')](_0x253ee5);}else{if(_0x253ee5===0x1f4){_0x2cf364[_0x3048('0x2c')](_0x253ee5)[_0x3048('0x7f')](_0x3a770b);}else{_0x2cf364[_0x3048('0x2c')](_0x253ee5)[_0x3048('0x2e')](_0x3a770b);}}});};exports[_0x3048('0x80')]=function(_0x40633d,_0x30db53,_0x122f9a){var _0x173fe0={};var _0x2dd4d4={};var _0x877878;var _0x83bb81;return db[_0x3048('0x3f')][_0x3048('0x65')]({'where':{'id':_0x40633d[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x30db53,null))[_0x3048('0x20')](function(_0x551a43){if(_0x551a43){_0x877878=_0x551a43;_0x2dd4d4[_0x3048('0x42')]=_[_0x3048('0x43')](db[_0x3048('0x7a')][_0x3048('0x40')]);_0x2dd4d4[_0x3048('0x44')]=_['keys'](_0x40633d['query']);_0x2dd4d4[_0x3048('0x45')]=_[_0x3048('0x46')](_0x2dd4d4[_0x3048('0x42')],_0x2dd4d4['query']);_0x173fe0[_0x3048('0x48')]=_[_0x3048('0x46')](_0x2dd4d4[_0x3048('0x42')],qs[_0x3048('0x47')](_0x40633d[_0x3048('0x44')][_0x3048('0x47')]));_0x173fe0[_0x3048('0x48')]=_0x173fe0[_0x3048('0x48')][_0x3048('0x49')]?_0x173fe0[_0x3048('0x48')]:_0x2dd4d4[_0x3048('0x42')];_0x173fe0[_0x3048('0x4c')]=qs['sort'](_0x40633d[_0x3048('0x44')][_0x3048('0x4d')]);_0x173fe0[_0x3048('0x4e')]=qs[_0x3048('0x45')](_[_0x3048('0x66')](_0x40633d[_0x3048('0x44')],_0x2dd4d4[_0x3048('0x45')]));if(_0x40633d['query'][_0x3048('0x4f')]){_0x173fe0['where']=_['merge'](_0x173fe0[_0x3048('0x4e')],{'$or':_[_0x3048('0x3e')](_0x173fe0[_0x3048('0x48')],function(_0xe5bbae){var _0x46b44a={};_0x46b44a[_0xe5bbae]={'$like':'%'+_0x40633d[_0x3048('0x44')][_0x3048('0x4f')]+'%'};return _0x46b44a;})});}_0x173fe0=_[_0x3048('0x50')]({},_0x173fe0,_0x40633d[_0x3048('0x67')]);return _0x877878[_0x3048('0x80')](_0x173fe0);}})[_0x3048('0x20')](function(_0x59ca8d){if(_0x59ca8d){_0x83bb81=_0x59ca8d[_0x3048('0x49')];if(!_0x40633d[_0x3048('0x44')][_0x3048('0x4a')](_0x3048('0x4b'))){_0x173fe0['limit']=qs[_0x3048('0x32')](_0x40633d[_0x3048('0x44')][_0x3048('0x32')]);_0x173fe0[_0x3048('0x31')]=qs['offset'](_0x40633d[_0x3048('0x44')]['offset']);}return _0x877878[_0x3048('0x80')](_0x173fe0);}})[_0x3048('0x20')](function(_0x5f0cae){if(_0x5f0cae){return _0x5f0cae?{'count':_0x83bb81,'rows':_0x5f0cae}:null;}})[_0x3048('0x20')](respondWithResult(_0x30db53,null))[_0x3048('0x2a')](handleError(_0x30db53,null));};function Extension(_0x33cbef,_0x57b2eb,_0x29331c,_0x10b532){this[_0x3048('0x81')]=_0x3048('0x82');this['exten']=_0x33cbef[_0x3048('0x83')];this['app']=_0x10b532;this[_0x3048('0x51')]=_0x3048('0x84');this[_0x3048('0x85')]=_0x3048('0x86');this['FaxAccountId']=_0x33cbef['id'];this[_0x3048('0x7d')]=_0x57b2eb;this[_0x3048('0x87')]=_0x29331c;}function createExtensionsReciveFax(_0x5331e1){var _0x32d9f4=0x1;var _0x2a56e4=[];_0x2a56e4[_0x3048('0x88')](new Extension(_0x5331e1,_0x32d9f4,'',_0x3048('0x89')));_0x32d9f4+=0x1;_0x2a56e4[_0x3048('0x88')](new Extension(_0x5331e1,_0x32d9f4,_0x3048('0x8a'),_0x3048('0x8b')));_0x32d9f4+=0x1;for(var _0x2b0367 in _0x5331e1){if(_0x5331e1['hasOwnProperty'](_0x2b0367)&&(_0x2b0367===_0x3048('0x8c')||_0x2b0367==='localstationid'||_0x2b0367===_0x3048('0x8d')||_0x2b0367===_0x3048('0x8e')||_0x2b0367===_0x3048('0x8f')||_0x2b0367===_0x3048('0x90')||_0x2b0367===_0x3048('0x91')||_0x2b0367===_0x3048('0x92')||_0x2b0367===_0x3048('0x93'))){_0x2a56e4[_0x3048('0x88')](new Extension(_0x5331e1,_0x32d9f4,'FAXOPT('+_0x2b0367+')='+_0x5331e1[_0x2b0367],'Set'));_0x32d9f4+=0x1;}}_0x2a56e4[_0x3048('0x88')](new Extension(_0x5331e1,_0x32d9f4,'6',_0x3048('0x94')));_0x32d9f4+=0x1;_0x2a56e4[_0x3048('0x88')](new Extension(_0x5331e1,_0x32d9f4,_0x3048('0x95'),_0x3048('0x96')));_0x32d9f4=0x0;return _0x2a56e4;}exports[_0x3048('0x97')]=function(_0xef56cb,_0x4482d3,_0x142373){var _0x208ffc;return db[_0x3048('0x78')]['transaction'](function(_0x5b2203){return db[_0x3048('0x3f')][_0x3048('0x59')](_0xef56cb[_0x3048('0x5a')],{'transaction':_0x5b2203})[_0x3048('0x20')](function(_0x18c105){_0x208ffc=_0x18c105[_0x3048('0x38')]({'plain':!![]});return db[_0x3048('0x98')][_0x3048('0x7b')](createExtensionsReciveFax(_0x208ffc),{'transaction':_0x5b2203});});})[_0x3048('0x20')](function(){return _0x208ffc;})[_0x3048('0x20')](respondWithResult(_0x4482d3,null))['catch'](handleError(_0x4482d3,null));};exports[_0x3048('0x99')]=function(_0x4b0d77,_0x44a99e,_0x35a420){var _0x3103db;return db[_0x3048('0x78')][_0x3048('0x9a')](function(_0x17276b){return db['FaxAccount']['update'](_0x4b0d77[_0x3048('0x5a')],{'where':{'id':_0x4b0d77[_0x3048('0x5a')]['id']},'transaction':_0x17276b})[_0x3048('0x20')](function(_0x49a2a3){return db[_0x3048('0x98')][_0x3048('0x37')]({'where':{'FaxAccountId':_0x4b0d77[_0x3048('0x5a')]['id']},'transaction':_0x17276b})[_0x3048('0x20')](function(_0x5d311e){return db['VoiceExtension'][_0x3048('0x7b')](createExtensionsReciveFax(_['omit'](_0x4b0d77[_0x3048('0x5a')],[_0x3048('0x9b'),_0x3048('0x41'),_0x3048('0x9c'),_0x3048('0x9d'),'TrunkId',_0x3048('0x9e')])),{'transaction':_0x17276b});});});})[_0x3048('0x20')](function(){return db[_0x3048('0x3f')]['findById'](_0x4b0d77[_0x3048('0x5a')]['id']);})[_0x3048('0x20')](respondWithResult(_0x44a99e,null))['catch'](handleError(_0x44a99e,null));};exports[_0x3048('0x9f')]=function(_0x59deb0,_0x838942,_0x30b2a6){var _0x4fd043={'raw':!![],'where':{}};var _0x19c30b={};var _0x13b59e={'count':0x0,'rows':[]};return db[_0x3048('0x3f')][_0x3048('0x65')]({'where':{'id':_0x59deb0[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x838942,null))[_0x3048('0x20')](function(_0xacae00){if(_0xacae00){_0x19c30b[_0x3048('0x42')]=_[_0x3048('0x43')](db[_0x3048('0xa0')][_0x3048('0x40')]);_0x19c30b[_0x3048('0x44')]=_[_0x3048('0x43')](_0x59deb0['query']);_0x19c30b[_0x3048('0x45')]=_[_0x3048('0x46')](_0x19c30b[_0x3048('0x42')],_0x19c30b[_0x3048('0x44')]);_0x4fd043[_0x3048('0x48')]=_[_0x3048('0x46')](_0x19c30b[_0x3048('0x42')],qs[_0x3048('0x47')](_0x59deb0['query']['fields']));_0x4fd043[_0x3048('0x48')]=_0x4fd043[_0x3048('0x48')][_0x3048('0x49')]?_0x4fd043[_0x3048('0x48')]:_0x19c30b['model'];if(!_0x59deb0[_0x3048('0x44')][_0x3048('0x4a')]('nolimit')){_0x4fd043[_0x3048('0x32')]=qs[_0x3048('0x32')](_0x59deb0[_0x3048('0x44')][_0x3048('0x32')]);_0x4fd043['offset']=qs['offset'](_0x59deb0[_0x3048('0x44')][_0x3048('0x31')]);}_0x4fd043[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0x59deb0[_0x3048('0x44')][_0x3048('0x4d')]);_0x4fd043['where']=qs[_0x3048('0x45')](_[_0x3048('0x66')](_0x59deb0[_0x3048('0x44')],_0x19c30b[_0x3048('0x45')]));_0x4fd043[_0x3048('0x4e')][_0x3048('0x62')]=_0xacae00['id'];if(_0x59deb0[_0x3048('0x44')][_0x3048('0x4f')]){_0x4fd043['where']=_[_0x3048('0x50')](_0x4fd043[_0x3048('0x4e')],{'$or':_[_0x3048('0x3e')](_0x4fd043[_0x3048('0x48')],function(_0x18898b){var _0x5c149e={};_0x5c149e[_0x18898b]={'$like':'%'+_0x59deb0[_0x3048('0x44')][_0x3048('0x4f')]+'%'};return _0x5c149e;})});}if(_0x59deb0[_0x3048('0x44')][_0x3048('0xa1')]){var _0x6576af=_0x59deb0[_0x3048('0x44')][_0x3048('0xa1')]['split'](',');var _0x29c61a={};_0x29c61a[_0x6576af[0x0]]={'$gte':moment(_0x6576af[0x1])[_0x3048('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4fd043[_0x3048('0x4e')]=_[_0x3048('0x50')](_0x4fd043['where'],_0x29c61a);}_0x4fd043=_[_0x3048('0x50')]({},_0x4fd043,_0x59deb0[_0x3048('0x67')]);return db[_0x3048('0xa0')][_0x3048('0x30')]({'where':_0x4fd043[_0x3048('0x4e')]})['then'](function(_0x1015fb){_0x13b59e[_0x3048('0x30')]=_0x1015fb;if(_0x59deb0[_0x3048('0x44')][_0x3048('0x53')]){_0x4fd043['include']=[{'all':!![]}];}return db[_0x3048('0xa0')]['findAll'](_0x4fd043);})[_0x3048('0x20')](function(_0x59d13f){_0x13b59e[_0x3048('0x68')]=_0x59d13f;return _0x13b59e;});}})[_0x3048('0x20')](respondWithFilteredResult(_0x838942,_0x4fd043))[_0x3048('0x2a')](handleError(_0x838942,null));};exports[_0x3048('0x7f')]=function(_0x1ba94c,_0x550817,_0x38b4b4){var _0xde939f,_0xd218ba={},_0x38f462;if(_0x1ba94c[_0x3048('0x5a')]['to']){_0x38f462=_0x1ba94c['body']['to'][0x0];}return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x1ba94c[_0x3048('0x60')]['id']},'include':[{'model':db[_0x3048('0xa3')],'as':_0x3048('0xa4'),'include':[{'model':db[_0x3048('0x72')],'as':_0x3048('0xa5'),'where':{'fax':_0x38f462},'limit':0x1,'order':[[_0x3048('0x9d'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x550817,null))[_0x3048('0x20')](function(_0x573469){_0xde939f=_0x573469;if(_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')]&&_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')]['length']){for(var _0x1d7727=0x0;_0x1d7727<_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][_0x3048('0x49')];_0x1d7727+=0x1){_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][_0x1d7727]={'filename':_0x1ba94c['body']['attachments'][_0x1d7727][_0x3048('0x3b')],'id':_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][_0x1d7727]['id'],'path':path[_0x3048('0xa7')](config['root'],_0x3048('0xa8'),_0x1ba94c[_0x3048('0x5a')]['attachments'][_0x1d7727][_0x3048('0xa9')])};}}return respondWithRpcPromise(_0x3048('0xaa'),_0x3048('0xaa'),{'FaxAccountId':_[_0x3048('0xab')](_0x1ba94c['params']['id'])?undefined:_0x1ba94c['params']['id'],'path':_['isNil'](_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][0x0]['path'])?undefined:_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][0x0][_0x3048('0x6')],'fax':_[_0x3048('0xab')](_0x1ba94c[_0x3048('0x5a')]['to'][0x0])?undefined:_0x1ba94c[_0x3048('0x5a')]['to'][0x0]},client9002);})[_0x3048('0x20')](function(){if(_0xde939f){if(_[_0x3048('0xab')](_0x1ba94c['body'][_0x3048('0xac')])){_0x1ba94c['body'][_0x3048('0xac')]=util[_0x3048('0xa2')](_0x3048('0xad'),_0xde939f[_0x3048('0x3b')],_0xde939f[_0x3048('0xae')]);}if(_0xde939f[_0x3048('0xa4')]){if(_0xde939f[_0x3048('0xa4')][_0x3048('0xa5')][_0x3048('0x49')]){return _0xde939f['List'][_0x3048('0xa5')][0x0];}else{return db[_0x3048('0x72')][_0x3048('0x59')](_[_0x3048('0x18')](_0x1ba94c['body'],{'firstName':_0x1ba94c[_0x3048('0x5a')]['to'][0x0],'phone':_0x1ba94c[_0x3048('0x5a')]['to'][0x0],'fax':_0x1ba94c['body']['to'][0x0],'ListId':_0xde939f['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x3048('0x20')](function(_0x4bc34e){if(_0x4bc34e){return db['FaxInteraction'][_0x3048('0x58')]({'where':{'ContactId':_0x4bc34e['id'],'closed':![],'FaxAccountId':_0xde939f['id']}})[_0x3048('0x20')](function(_0x4c2e2d){if(_0x4c2e2d){return[_0x4c2e2d,![]];}return db[_0x3048('0x71')][_0x3048('0x59')]({'UserId':_0x1ba94c[_0x3048('0x5b')]['id'],'ContactId':_0x4bc34e['id'],'FaxAccountId':_0xde939f['id'],'fax':_0x1ba94c[_0x3048('0x5a')]['to'][0x0],'firstMsgDirection':_0x3048('0xaf'),'Messages':[_[_0x3048('0x50')](_0x1ba94c[_0x3048('0x5a')],{'read':![],'body':_0x1ba94c[_0x3048('0x5a')]['attachments'][0x0]['filename'],'FaxAccountId':_0xde939f['id'],'UserId':_0x1ba94c[_0x3048('0x5b')]['id'],'ContactId':_0x4bc34e['id'],'AttachmentId':_0x1ba94c[_0x3048('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x3048('0xa0')],'as':_0x3048('0xb0')}]})[_0x3048('0x20')](function(_0x5df127){return[_0x5df127,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3048('0xb1')](function(_0x38a116,_0x2dc375){if(_0x2dc375){return _0x38a116;}return db[_0x3048('0xa0')][_0x3048('0x59')]({'direction':_0x3048('0xaf'),'read':![],'body':_0x1ba94c['body'][_0x3048('0xa6')][0x0][_0x3048('0xb2')],'FaxAccountId':_0xde939f['id'],'FaxInteractionId':_0x38a116['id'],'UserId':_0x1ba94c['user']['id'],'ContactId':_0x38a116[_0x3048('0xb3')],'AttachmentId':_0x1ba94c[_0x3048('0x5a')]['attachments'][0x0]['id']})['then'](function(_0x1b8125){_0x38a116['dataValues'][_0x3048('0xb0')]=[];_0x38a116[_0x3048('0xb4')][_0x3048('0xb0')][_0x3048('0x88')](_0x1b8125[_0x3048('0xb4')]);return _0x38a116;});})[_0x3048('0x20')](function(_0x11c4cc){respondWithRpcPromise(_0x3048('0xb5'),'SendFax',{'FaxAccountId':_[_0x3048('0xab')](_0x1ba94c['params']['id'])?undefined:_0x1ba94c[_0x3048('0x60')]['id'],'path':_[_0x3048('0xab')](_0x1ba94c['body'][_0x3048('0xa6')][0x0][_0x3048('0x6')])?undefined:_0x1ba94c[_0x3048('0x5a')]['attachments'][0x0][_0x3048('0x6')],'fax':_[_0x3048('0xab')](_0x1ba94c[_0x3048('0x5a')]['to'][0x0])?undefined:_0x1ba94c[_0x3048('0x5a')]['to'][0x0],'AttachmentId':_0x1ba94c[_0x3048('0x5a')][_0x3048('0xa6')][0x0]['id']},client9002)[_0x3048('0x20')](function(_0x5923ba){logger['info'](_0x3048('0xb6'),_0x5923ba);})[_0x3048('0x2a')](function(_0x483fe2){logger[_0x3048('0x21')]('SendFaxRpc,\x20%s',_0x483fe2);});return _0x11c4cc;})[_0x3048('0x20')](respondWithResult(_0x550817,null))[_0x3048('0x2a')](handleError(_0x550817,null));};exports[_0x3048('0xb7')]=function(_0x2e83df,_0xbef6b,_0x426788){return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x2e83df[_0x3048('0x60')]['id']}})['then'](handleEntityNotFound(_0xbef6b,null))[_0x3048('0x20')](function(_0x34300c){if(_0x34300c){return _0x34300c['addAgents'](_0x2e83df['body']['ids'],_['omit'](_0x2e83df[_0x3048('0x5a')],['ids','id'])||{})[_0x3048('0xb1')](function(_0x18e72b){for(var _0x51f304=0x0;_0x51f304<_0x2e83df[_0x3048('0x5a')][_0x3048('0x6e')]['length'];_0x51f304+=0x1){socket[_0x3048('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x2e83df[_0x3048('0x5a')][_0x3048('0x6e')][_0x51f304]),'FaxAccountId':Number(_0x2e83df[_0x3048('0x60')]['id'])});}return _0x18e72b;});}})[_0x3048('0x20')](respondWithResult(_0xbef6b,null))['catch'](handleError(_0xbef6b,null));};exports[_0x3048('0xb9')]=function(_0x3595ca,_0x2ca517,_0x52fa1d){return db[_0x3048('0x3f')][_0x3048('0x58')]({'where':{'id':_0x3595ca['params']['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x2ca517,null))['then'](function(_0xdac42e){if(_0xdac42e){return _0xdac42e['removeAgents'](_0x3595ca[_0x3048('0x44')][_0x3048('0x6e')])[_0x3048('0x20')](function(){if(_['isArray'](_0x3595ca['query'][_0x3048('0x6e')])){for(var _0x1d9831=0x0;_0x1d9831<_0x3595ca[_0x3048('0x44')][_0x3048('0x6e')][_0x3048('0x49')];_0x1d9831+=0x1){socket[_0x3048('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x3595ca[_0x3048('0x44')]['ids'][_0x1d9831]),'FaxAccountId':Number(_0x3595ca[_0x3048('0x60')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3595ca[_0x3048('0x44')][_0x3048('0x6e')]),'FaxAccountId':Number(_0x3595ca[_0x3048('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x2ca517,null))[_0x3048('0x2a')](handleError(_0x2ca517,null));};exports['getAgents']=function(_0x270ce2,_0x295b2c,_0x1e6fe9){var _0x1451b8={};var _0x184902={};var _0x5842e7;var _0x4bcb0a;return db[_0x3048('0x3f')][_0x3048('0x65')]({'where':{'id':_0x270ce2[_0x3048('0x60')]['id']}})[_0x3048('0x20')](handleEntityNotFound(_0x295b2c,null))['then'](function(_0x2e20fb){if(_0x2e20fb){_0x5842e7=_0x2e20fb;_0x184902[_0x3048('0x42')]=_['keys'](db[_0x3048('0xba')][_0x3048('0x40')]);_0x184902[_0x3048('0x44')]=_['keys'](_0x270ce2['query']);_0x184902['filters']=_[_0x3048('0x46')](_0x184902[_0x3048('0x42')],_0x184902[_0x3048('0x44')]);_0x1451b8['attributes']=_[_0x3048('0x46')](_0x184902['model'],qs['fields'](_0x270ce2[_0x3048('0x44')]['fields']));_0x1451b8[_0x3048('0x48')]=_0x1451b8['attributes'][_0x3048('0x49')]?_0x1451b8[_0x3048('0x48')]:_0x184902[_0x3048('0x42')];_0x1451b8[_0x3048('0x4c')]=qs[_0x3048('0x4d')](_0x270ce2[_0x3048('0x44')][_0x3048('0x4d')]);_0x1451b8[_0x3048('0x4e')]=qs[_0x3048('0x45')](_[_0x3048('0x66')](_0x270ce2[_0x3048('0x44')],_0x184902[_0x3048('0x45')]));if(_0x270ce2['query'][_0x3048('0x4f')]){_0x1451b8[_0x3048('0x4e')]=_[_0x3048('0x50')](_0x1451b8['where'],{'$or':_[_0x3048('0x3e')](_0x1451b8['attributes'],function(_0xffee9d){var _0x5a290c={};_0x5a290c[_0xffee9d]={'$like':'%'+_0x270ce2[_0x3048('0x44')]['filter']+'%'};return _0x5a290c;})});}_0x1451b8=_['merge']({},_0x1451b8,_0x270ce2['options']);return _0x5842e7[_0x3048('0xbb')](_0x1451b8);}})[_0x3048('0x20')](function(_0x362aae){if(_0x362aae){_0x4bcb0a=_0x362aae['length'];if(!_0x270ce2['query'][_0x3048('0x4a')]('nolimit')){_0x1451b8[_0x3048('0x32')]=qs[_0x3048('0x32')](_0x270ce2['query'][_0x3048('0x32')]);_0x1451b8['offset']=qs[_0x3048('0x31')](_0x270ce2[_0x3048('0x44')][_0x3048('0x31')]);}return _0x5842e7['getAgents'](_0x1451b8);}})[_0x3048('0x20')](function(_0x599973){if(_0x599973){return _0x599973?{'count':_0x4bcb0a,'rows':_0x599973}:null;}})['then'](respondWithResult(_0x295b2c,null))[_0x3048('0x2a')](handleError(_0x295b2c,null));}; \ No newline at end of file +var _0xed03=['count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','show','Pause','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','params','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','CannedAnswer','getAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','hasOwnProperty','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','rows','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xed03,0x96));var _0x3ed0=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xed03[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x3ed0('0x0'));var rimraf=require(_0x3ed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ed0('0x2'));var rp=require(_0x3ed0('0x3'));var moment=require(_0x3ed0('0x4'));var BPromise=require(_0x3ed0('0x5'));var Mustache=require(_0x3ed0('0x6'));var util=require(_0x3ed0('0x7'));var path=require(_0x3ed0('0x8'));var sox=require(_0x3ed0('0x9'));var csv=require(_0x3ed0('0xa'));var ejs=require(_0x3ed0('0xb'));var fs=require('fs');var fs_extra=require(_0x3ed0('0xc'));var _=require(_0x3ed0('0xd'));var squel=require(_0x3ed0('0xe'));var crypto=require(_0x3ed0('0xf'));var jsforce=require(_0x3ed0('0x10'));var deskjs=require(_0x3ed0('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ed0('0x12'));var authService=require(_0x3ed0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ed0('0x14'));var hardwareService=require(_0x3ed0('0x15'));var logger=require('../../config/logger')(_0x3ed0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3ed0('0x17'));var db=require('../../mysqldb')['db'];config[_0x3ed0('0x18')]=_[_0x3ed0('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ed0('0x1a'))(new Redis(config[_0x3ed0('0x18')]));require(_0x3ed0('0x1b'))[_0x3ed0('0x1c')](socket);var jayson=require(_0x3ed0('0x1d'));var client=jayson[_0x3ed0('0x1e')][_0x3ed0('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x3ed0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x20e9a1,_0x4bc28e,_0x20cfb3,_0x599e95){return new BPromise(function(_0x49ec2e,_0x459f2b){var _0x53fd74=_0x599e95||client;return _0x53fd74[_0x3ed0('0x20')](_0x20e9a1,_0x20cfb3)[_0x3ed0('0x21')](function(_0x2740c4){logger[_0x3ed0('0x22')](_0x3ed0('0x23'),_0x4bc28e,_0x3ed0('0x24'));logger[_0x3ed0('0x25')](_0x3ed0('0x26'),_0x4bc28e,_0x3ed0('0x24'),JSON[_0x3ed0('0x27')](_0x2740c4));if(_0x2740c4[_0x3ed0('0x28')]){if(_0x2740c4[_0x3ed0('0x28')][_0x3ed0('0x29')]===0x1f4){logger[_0x3ed0('0x28')](_0x3ed0('0x23'),_0x4bc28e,_0x2740c4[_0x3ed0('0x28')]['message']);return _0x459f2b(_0x2740c4['error'][_0x3ed0('0x2a')]);}logger[_0x3ed0('0x28')](_0x3ed0('0x23'),_0x4bc28e,_0x2740c4[_0x3ed0('0x28')][_0x3ed0('0x2a')]);return _0x49ec2e(_0x2740c4['error'][_0x3ed0('0x2a')]);}else{logger[_0x3ed0('0x22')](_0x3ed0('0x23'),_0x4bc28e,_0x3ed0('0x24'));_0x49ec2e(_0x2740c4[_0x3ed0('0x2b')][_0x3ed0('0x2a')]);}})[_0x3ed0('0x2c')](function(_0x57b9d7){logger['error'](_0x3ed0('0x23'),_0x4bc28e,_0x57b9d7);_0x459f2b(_0x57b9d7);});});}function respondWithStatusCode(_0x59f426,_0x205f04){_0x205f04=_0x205f04||0xcc;return function(_0x3ebf09){if(_0x3ebf09){return _0x59f426['sendStatus'](_0x205f04);}return _0x59f426[_0x3ed0('0x2d')](_0x205f04)['end']();};}function respondWithResult(_0x43e4f5,_0x57a862){_0x57a862=_0x57a862||0xc8;return function(_0x1636bf){if(_0x1636bf){return _0x43e4f5[_0x3ed0('0x2d')](_0x57a862)[_0x3ed0('0x2e')](_0x1636bf);}};}function respondWithFilteredResult(_0x334932,_0x37b455){return function(_0x2605ed){if(_0x2605ed){var _0x100eda=typeof _0x37b455[_0x3ed0('0x2f')]===_0x3ed0('0x30')&&typeof _0x37b455['limit']===_0x3ed0('0x30');var _0x1dbdfb=_0x2605ed[_0x3ed0('0x31')];var _0x515adc=_0x100eda?0x0:_0x37b455['offset'];var _0x3e2c0e=_0x100eda?_0x2605ed[_0x3ed0('0x31')]:_0x37b455[_0x3ed0('0x2f')]+_0x37b455[_0x3ed0('0x32')];var _0x3397cf;if(_0x3e2c0e>=_0x1dbdfb){_0x3e2c0e=_0x1dbdfb;_0x3397cf=0xc8;}else{_0x3397cf=0xce;}_0x334932[_0x3ed0('0x2d')](_0x3397cf);return _0x334932[_0x3ed0('0x33')](_0x3ed0('0x34'),_0x515adc+'-'+_0x3e2c0e+'/'+_0x1dbdfb)[_0x3ed0('0x2e')](_0x2605ed);}return null;};}function patchUpdates(_0x8e7b5){return function(_0x5c08c7){try{jsonpatch[_0x3ed0('0x35')](_0x5c08c7,_0x8e7b5,!![]);}catch(_0x226333){return BPromise[_0x3ed0('0x36')](_0x226333);}return _0x5c08c7[_0x3ed0('0x37')]();};}function saveUpdates(_0x4ad241,_0x2b2cc6){return function(_0x1b7e66){if(_0x1b7e66){return _0x1b7e66[_0x3ed0('0x38')](_0x4ad241)[_0x3ed0('0x21')](function(_0x312e2c){return _0x312e2c;});}return null;};}function removeEntity(_0x5306f8,_0x757a16){return function(_0x37465d){if(_0x37465d){return _0x37465d[_0x3ed0('0x39')]()[_0x3ed0('0x21')](function(){var _0xdce45=_0x37465d[_0x3ed0('0x3a')]({'plain':!![]});var _0x25e565='FaxAccounts';return db[_0x3ed0('0x3b')][_0x3ed0('0x39')]({'where':{'type':_0x25e565,'resourceId':_0xdce45['id']}})['then'](function(){return _0x37465d;});})[_0x3ed0('0x21')](function(){_0x5306f8[_0x3ed0('0x2d')](0xcc)[_0x3ed0('0x3c')]();});}};}function handleEntityNotFound(_0x227098,_0x17a4fb){return function(_0x1eb356){if(!_0x1eb356){_0x227098[_0x3ed0('0x3d')](0x194);}return _0x1eb356;};}function handleError(_0x2b6794,_0x113568){_0x113568=_0x113568||0x1f4;return function(_0x2b232f){logger[_0x3ed0('0x28')](_0x2b232f[_0x3ed0('0x3e')]);if(_0x2b232f[_0x3ed0('0x3f')]){delete _0x2b232f[_0x3ed0('0x3f')];}_0x2b6794[_0x3ed0('0x2d')](_0x113568)[_0x3ed0('0x40')](_0x2b232f);};}exports[_0x3ed0('0x41')]=function(_0x6ba2cb,_0x4b0740){var _0x5d70a3={'include':[{'model':db['Pause'],'as':_0x3ed0('0x42')}]},_0x5e4509={},_0x186ee4={'count':0x0,'rows':[]};var _0x3ef3ee=_[_0x3ed0('0x43')](db[_0x3ed0('0x44')][_0x3ed0('0x45')],function(_0x37e877){return{'name':_0x37e877[_0x3ed0('0x46')],'type':_0x37e877['type'][_0x3ed0('0x47')]};});_0x5e4509['model']=_[_0x3ed0('0x43')](_0x3ef3ee,_0x3ed0('0x3f'));_0x5e4509[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x6ba2cb['query']);_0x5e4509[_0x3ed0('0x4a')]=_['intersection'](_0x5e4509[_0x3ed0('0x4b')],_0x5e4509[_0x3ed0('0x48')]);_0x5d70a3[_0x3ed0('0x4c')]=_['intersection'](_0x5e4509['model'],qs[_0x3ed0('0x4d')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x5d70a3['attributes']=_0x5d70a3[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x5d70a3[_0x3ed0('0x4c')]:_0x5e4509['model'];if(!_0x6ba2cb['query']['hasOwnProperty'](_0x3ed0('0x4f'))){_0x5d70a3[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x5d70a3[_0x3ed0('0x2f')]=qs[_0x3ed0('0x2f')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x5d70a3[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x5d70a3[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0x6ba2cb[_0x3ed0('0x48')],_0x5e4509['filters']),_0x3ef3ee);if(_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x54')]){_0x5d70a3[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x5d70a3[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x3ef3ee,function(_0x751022){if(_0x751022[_0x3ed0('0x56')]!=='VIRTUAL'){var _0x58742b={};_0x58742b[_0x751022['name']]={'$like':'%'+_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x58742b;}})});}_0x5d70a3=_[_0x3ed0('0x55')]({},_0x5d70a3,_0x6ba2cb[_0x3ed0('0x57')]);var _0x5bf125={'where':_0x5d70a3[_0x3ed0('0x52')]};return db[_0x3ed0('0x44')][_0x3ed0('0x31')](_0x5bf125)[_0x3ed0('0x21')](function(_0x354978){_0x186ee4[_0x3ed0('0x31')]=_0x354978;if(_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x58')]){_0x5d70a3[_0x3ed0('0x59')]=[{'all':!![]}];}return db[_0x3ed0('0x44')][_0x3ed0('0x5a')](_0x5d70a3);})['then'](function(_0x244046){_0x186ee4['rows']=_0x244046;return _0x186ee4;})[_0x3ed0('0x21')](respondWithFilteredResult(_0x4b0740,_0x5d70a3))[_0x3ed0('0x2c')](handleError(_0x4b0740,null));};exports[_0x3ed0('0x5b')]=function(_0x37f764,_0x563fc9){var _0x739be7={'raw':![],'where':{'id':_0x37f764['params']['id']},'include':[{'model':db[_0x3ed0('0x5c')],'as':_0x3ed0('0x42')}]},_0xefa8de={};_0xefa8de['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x44')][_0x3ed0('0x45')]);_0xefa8de[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x37f764['query']);_0xefa8de[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0xefa8de[_0x3ed0('0x4b')],_0xefa8de[_0x3ed0('0x48')]);_0x739be7[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0xefa8de[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x37f764[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x739be7[_0x3ed0('0x4c')]=_0x739be7[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x739be7[_0x3ed0('0x4c')]:_0xefa8de[_0x3ed0('0x4b')];if(_0x37f764[_0x3ed0('0x48')][_0x3ed0('0x58')]){_0x739be7['include']=[{'all':!![]}];}_0x739be7=_[_0x3ed0('0x55')]({},_0x739be7,_0x37f764[_0x3ed0('0x57')]);return db['FaxAccount'][_0x3ed0('0x5e')](_0x739be7)[_0x3ed0('0x21')](handleEntityNotFound(_0x563fc9,null))['then'](respondWithResult(_0x563fc9,null))[_0x3ed0('0x2c')](handleError(_0x563fc9,null));};exports['create']=function(_0x160d64,_0x30ca81){return db[_0x3ed0('0x44')][_0x3ed0('0x5f')](_0x160d64[_0x3ed0('0x60')],{})['then'](function(_0x5b498f){var _0x409935=_0x160d64[_0x3ed0('0x61')][_0x3ed0('0x3a')]({'plain':!![]});if(!_0x409935)throw new Error(_0x3ed0('0x62'));if(_0x409935['role']===_0x3ed0('0x61')){var _0x5b75e4=_0x5b498f[_0x3ed0('0x3a')]({'plain':!![]});var _0x244edc=_0x3ed0('0x63');return db[_0x3ed0('0x64')][_0x3ed0('0x5e')]({'where':{'name':_0x244edc,'userProfileId':_0x409935[_0x3ed0('0x65')]},'raw':!![]})[_0x3ed0('0x21')](function(_0x4aab91){if(_0x4aab91&&_0x4aab91[_0x3ed0('0x66')]===0x0){return db[_0x3ed0('0x3b')][_0x3ed0('0x5f')]({'name':_0x5b75e4[_0x3ed0('0x3f')],'resourceId':_0x5b75e4['id'],'type':_0x4aab91[_0x3ed0('0x3f')],'sectionId':_0x4aab91['id']},{})[_0x3ed0('0x21')](function(){return _0x5b498f;});}else{return _0x5b498f;}})[_0x3ed0('0x2c')](function(_0x15289e){logger[_0x3ed0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15289e);throw _0x15289e;});}return _0x5b498f;})[_0x3ed0('0x21')](respondWithResult(_0x30ca81,0xc9))[_0x3ed0('0x2c')](handleError(_0x30ca81,null));};exports[_0x3ed0('0x38')]=function(_0x111f23,_0x3cd057){if(_0x111f23['body']['id']){delete _0x111f23[_0x3ed0('0x60')]['id'];}return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0x111f23['params']['id']},'include':[{'model':db[_0x3ed0('0x5c')],'as':_0x3ed0('0x42')}]})[_0x3ed0('0x21')](handleEntityNotFound(_0x3cd057,null))[_0x3ed0('0x21')](saveUpdates(_0x111f23['body'],null))[_0x3ed0('0x21')](respondWithResult(_0x3cd057,null))[_0x3ed0('0x2c')](handleError(_0x3cd057,null));};exports[_0x3ed0('0x39')]=function(_0x1ce0ae,_0x40a728){return db[_0x3ed0('0x44')]['find']({'where':{'id':_0x1ce0ae['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x40a728,null))[_0x3ed0('0x21')](removeEntity(_0x40a728,null))['catch'](handleError(_0x40a728,null));};exports[_0x3ed0('0x67')]=function(_0x168ba6,_0x5771bf){return db[_0x3ed0('0x44')][_0x3ed0('0x67')]()['then'](respondWithResult(_0x5771bf,null))['catch'](handleError(_0x5771bf,null));};exports[_0x3ed0('0x68')]=function(_0x4cd4f4,_0x326f5a,_0x4c41e7){if(_0x4cd4f4[_0x3ed0('0x60')]['id']){delete _0x4cd4f4[_0x3ed0('0x60')]['id'];}return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x4cd4f4[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x326f5a,null))['then'](function(_0x150792){if(_0x150792){_0x4cd4f4[_0x3ed0('0x60')][_0x3ed0('0x6a')]=_0x150792['id'];return db['Disposition'][_0x3ed0('0x5f')](_0x4cd4f4[_0x3ed0('0x60')]);}})[_0x3ed0('0x21')](respondWithResult(_0x326f5a,null))[_0x3ed0('0x2c')](handleError(_0x326f5a,null));};exports[_0x3ed0('0x6b')]=function(_0x5a88c6,_0x46772c,_0x198315){var _0x191506={'raw':![],'where':{}};var _0x19b38a={};var _0x251a2d={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x5a88c6[_0x3ed0('0x69')]['id']}})['then'](handleEntityNotFound(_0x46772c,null))['then'](function(_0x376adc){if(_0x376adc){_0x19b38a[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db[_0x3ed0('0x6d')][_0x3ed0('0x45')]);_0x19b38a[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x5a88c6[_0x3ed0('0x48')]);_0x19b38a[_0x3ed0('0x4a')]=_['intersection'](_0x19b38a[_0x3ed0('0x4b')],_0x19b38a[_0x3ed0('0x48')]);_0x191506['attributes']=_['intersection'](_0x19b38a['model'],qs['fields'](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x191506['attributes']=_0x191506[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x191506[_0x3ed0('0x4c')]:_0x19b38a[_0x3ed0('0x4b')];if(!_0x5a88c6[_0x3ed0('0x48')]['hasOwnProperty'](_0x3ed0('0x4f'))){_0x191506[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x191506[_0x3ed0('0x2f')]=qs[_0x3ed0('0x2f')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x191506[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x191506[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0x5a88c6[_0x3ed0('0x48')],_0x19b38a[_0x3ed0('0x4a')]));_0x191506['where'][_0x3ed0('0x6a')]=_0x376adc['id'];if(_0x5a88c6['query'][_0x3ed0('0x54')]){_0x191506[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x191506[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x191506[_0x3ed0('0x4c')],function(_0x5009ef){var _0x1bf0be={};_0x1bf0be[_0x5009ef]={'$like':'%'+_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x1bf0be;})});}_0x191506=_[_0x3ed0('0x55')]({},_0x191506,_0x5a88c6[_0x3ed0('0x57')]);return db['Disposition'][_0x3ed0('0x31')]({'where':_0x191506[_0x3ed0('0x52')]})['then'](function(_0x558c6a){_0x251a2d[_0x3ed0('0x31')]=_0x558c6a;if(_0x5a88c6['query'][_0x3ed0('0x58')]){_0x191506[_0x3ed0('0x59')]=[{'all':!![]}];}return db[_0x3ed0('0x6d')]['findAll'](_0x191506);})[_0x3ed0('0x21')](function(_0x4f0127){_0x251a2d['rows']=_0x4f0127;return _0x251a2d;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x46772c,_0x191506))['catch'](handleError(_0x46772c,null));};exports[_0x3ed0('0x6e')]=function(_0x48aa38,_0x476f62,_0x39ca2d){return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x48aa38[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x476f62,null))['then'](function(_0x1c0f4d){if(_0x1c0f4d){return _0x1c0f4d[_0x3ed0('0x6e')](_0x48aa38[_0x3ed0('0x48')]['ids']);}})[_0x3ed0('0x21')](respondWithStatusCode(_0x476f62,null))[_0x3ed0('0x2c')](handleError(_0x476f62,null));};exports['addAnswer']=function(_0xf70ff3,_0x1d4d5a,_0x4ea420){if(_0xf70ff3[_0x3ed0('0x60')]['id']){delete _0xf70ff3['body']['id'];}return db[_0x3ed0('0x44')]['find']({'where':{'id':_0xf70ff3['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x1d4d5a,null))[_0x3ed0('0x21')](function(_0x3116be){if(_0x3116be){_0xf70ff3[_0x3ed0('0x60')][_0x3ed0('0x6a')]=_0x3116be['id'];return db[_0x3ed0('0x6f')][_0x3ed0('0x5f')](_0xf70ff3[_0x3ed0('0x60')]);}})[_0x3ed0('0x21')](respondWithResult(_0x1d4d5a,null))['catch'](handleError(_0x1d4d5a,null));};exports[_0x3ed0('0x70')]=function(_0x16ba19,_0xc2768c,_0x5c0791){var _0x7ea5cb={'raw':![],'where':{}};var _0x202ec2={};var _0x387505={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x16ba19[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0xc2768c,null))['then'](function(_0xb992c6){if(_0xb992c6){_0x202ec2[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db[_0x3ed0('0x6f')][_0x3ed0('0x45')]);_0x202ec2[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x16ba19['query']);_0x202ec2[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x202ec2[_0x3ed0('0x4b')],_0x202ec2[_0x3ed0('0x48')]);_0x7ea5cb[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x202ec2[_0x3ed0('0x4b')],qs['fields'](_0x16ba19[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x7ea5cb[_0x3ed0('0x4c')]=_0x7ea5cb[_0x3ed0('0x4c')]['length']?_0x7ea5cb['attributes']:_0x202ec2[_0x3ed0('0x4b')];if(!_0x16ba19['query']['hasOwnProperty']('nolimit')){_0x7ea5cb[_0x3ed0('0x32')]=qs['limit'](_0x16ba19[_0x3ed0('0x48')]['limit']);_0x7ea5cb['offset']=qs['offset'](_0x16ba19[_0x3ed0('0x48')]['offset']);}_0x7ea5cb[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x16ba19[_0x3ed0('0x48')]['sort']);_0x7ea5cb[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_['pick'](_0x16ba19[_0x3ed0('0x48')],_0x202ec2[_0x3ed0('0x4a')]));_0x7ea5cb['where'][_0x3ed0('0x6a')]=_0xb992c6['id'];if(_0x16ba19['query']['filter']){_0x7ea5cb[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x7ea5cb['where'],{'$or':_[_0x3ed0('0x43')](_0x7ea5cb[_0x3ed0('0x4c')],function(_0x5d1243){var _0x25b07f={};_0x25b07f[_0x5d1243]={'$like':'%'+_0x16ba19[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x25b07f;})});}_0x7ea5cb=_['merge']({},_0x7ea5cb,_0x16ba19['options']);return db[_0x3ed0('0x6f')][_0x3ed0('0x31')]({'where':_0x7ea5cb[_0x3ed0('0x52')]})[_0x3ed0('0x21')](function(_0x314ca9){_0x387505['count']=_0x314ca9;if(_0x16ba19[_0x3ed0('0x48')]['includeAll']){_0x7ea5cb[_0x3ed0('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3ed0('0x5a')](_0x7ea5cb);})[_0x3ed0('0x21')](function(_0x18e1b1){_0x387505['rows']=_0x18e1b1;return _0x387505;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0xc2768c,_0x7ea5cb))[_0x3ed0('0x2c')](handleError(_0xc2768c,null));};exports['removeAnswers']=function(_0x75ebc,_0x4eb4d6,_0x3bdc90){return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0x75ebc[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x4eb4d6,null))['then'](function(_0x566a09){if(_0x566a09){return _0x566a09['removeAnswers'](_0x75ebc[_0x3ed0('0x48')][_0x3ed0('0x71')]);}})['then'](respondWithStatusCode(_0x4eb4d6,null))[_0x3ed0('0x2c')](handleError(_0x4eb4d6,null));};exports['addInteraction']=function(_0x2bbe73,_0x2d100b,_0x535f1b){return db['FaxInteraction'][_0x3ed0('0x5e')]({'where':{'id':_0x2bbe73[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x2d100b,null))['then'](function(_0xa27581){if(_0xa27581){return _0xa27581[_0x3ed0('0x72')](_0x2bbe73['body'][_0x3ed0('0x71')],_[_0x3ed0('0x73')](_0x2bbe73[_0x3ed0('0x60')],[_0x3ed0('0x71'),'id'])||{});}})[_0x3ed0('0x21')](respondWithResult(_0x2d100b,null))[_0x3ed0('0x2c')](handleError(_0x2d100b,null));};exports[_0x3ed0('0x74')]=function(_0xdd2c8b,_0x4c4459,_0x18712f){var _0x4b57a6={'raw':![],'where':{}};var _0x4f4a40={};var _0x5c9c85={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3ed0('0x6c')]({'where':{'id':_0xdd2c8b[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x4c4459,null))[_0x3ed0('0x21')](function(_0x1a34a6){if(_0x1a34a6){_0x4f4a40['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x75')][_0x3ed0('0x45')]);_0x4f4a40[_0x3ed0('0x48')]=_['keys'](_0xdd2c8b[_0x3ed0('0x48')]);_0x4f4a40['filters']=_[_0x3ed0('0x5d')](_0x4f4a40[_0x3ed0('0x4b')],_0x4f4a40[_0x3ed0('0x48')]);_0x4b57a6[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x4f4a40[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0xdd2c8b['query'][_0x3ed0('0x4d')]));_0x4b57a6['attributes']=_0x4b57a6[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x4b57a6[_0x3ed0('0x4c')]:_0x4f4a40[_0x3ed0('0x4b')];if(!_0xdd2c8b['query'][_0x3ed0('0x76')]('nolimit')){_0x4b57a6['limit']=qs[_0x3ed0('0x32')](_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x4b57a6['offset']=qs[_0x3ed0('0x2f')](_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x4b57a6[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0xdd2c8b['query'][_0x3ed0('0x51')]);_0x4b57a6[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0xdd2c8b['query'],_0x4f4a40['filters']));_0x4b57a6[_0x3ed0('0x52')][_0x3ed0('0x6a')]=_0x1a34a6['id'];if(_0xdd2c8b['query'][_0x3ed0('0x54')]){_0x4b57a6[_0x3ed0('0x52')]=_['merge'](_0x4b57a6[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x4b57a6['attributes'],function(_0x452176){var _0x3db052={};_0x3db052[_0x452176]={'$like':'%'+_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x3db052;})});}_0x4b57a6=_[_0x3ed0('0x55')]({},_0x4b57a6,_0xdd2c8b['options']);return db[_0x3ed0('0x75')][_0x3ed0('0x31')]({'where':_0x4b57a6[_0x3ed0('0x52')]})['then'](function(_0x3554bb){_0x5c9c85[_0x3ed0('0x31')]=_0x3554bb;if(_0xdd2c8b['query']['includeAll']){_0x4b57a6['include']=[{'model':db[_0x3ed0('0x77')],'as':_0x3ed0('0x78'),'required':![]},{'model':db[_0x3ed0('0x79')],'as':_0x3ed0('0x7a'),'attributes':[_0x3ed0('0x3f'),_0x3ed0('0x7b'),'internal'],'required':![]},{'model':db[_0x3ed0('0x7c')],'as':_0x3ed0('0x7d'),'attributes':['id','name',_0x3ed0('0x7e')],'where':_0xdd2c8b[_0x3ed0('0x48')]['tag']?{'id':_0xdd2c8b['query']['tag']}:undefined,'required':_0xdd2c8b[_0x3ed0('0x48')]['tag']?!![]:![]}];}return db[_0x3ed0('0x75')][_0x3ed0('0x5a')](_0x4b57a6);})[_0x3ed0('0x21')](function(_0x1f9a59){_0x5c9c85[_0x3ed0('0x7f')]=_0x1f9a59;return _0x5c9c85;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x4c4459,_0x4b57a6))['catch'](handleError(_0x4c4459,null));};exports['addApplications']=function(_0x3e3cf2,_0x230358){var _0x57cbab=_0x3e3cf2['params']['id'];var _0x4bf190=_0x3e3cf2['body'];var _0x4d138c=0xc8;var _0x190cd8=null;return db[_0x3ed0('0x80')][_0x3ed0('0x81')]({'isolationLevel':db[_0x3ed0('0x80')][_0x3ed0('0x82')]['ISOLATION_LEVELS'][_0x3ed0('0x83')]},function(_0x26f537){return db[_0x3ed0('0x44')]['findOne']({'where':{'id':_0x57cbab},'transaction':_0x26f537})[_0x3ed0('0x21')](function(_0x496c12){if(_0x496c12){return db['FaxApplication'][_0x3ed0('0x39')]({'where':{'FaxAccountId':_0x57cbab},'transaction':_0x26f537})[_0x3ed0('0x21')](function(){var _0x84243e=_[_0x3ed0('0x43')](_0x4bf190,function(_0x206817){_0x206817[_0x3ed0('0x6a')]=_0x57cbab;return _0x206817;});return db[_0x3ed0('0x84')][_0x3ed0('0x85')](_0x84243e,{'transaction':_0x26f537});});}else{_0x4d138c=0x194;_0x190cd8=[];}});})[_0x3ed0('0x21')](function(){if(_0x4d138c!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x57cbab},'order':_0x3ed0('0x86')})['then'](function(_0x596496){_0x190cd8=_0x596496;});}})[_0x3ed0('0x2c')](function(_0x436463){_0x4d138c=0x1f4;logger[_0x3ed0('0x28')](_0x436463['stack']);if(_0x436463['name']){delete _0x436463[_0x3ed0('0x3f')];}_0x190cd8=_0x436463;})[_0x3ed0('0x87')](function(){if(_0x190cd8===null){_0x230358['sendStatus'](_0x4d138c);}else{if(_0x4d138c===0x1f4){_0x230358[_0x3ed0('0x2d')](_0x4d138c)[_0x3ed0('0x40')](_0x190cd8);}else{_0x230358[_0x3ed0('0x2d')](_0x4d138c)['json'](_0x190cd8);}}});};exports[_0x3ed0('0x88')]=function(_0x26596f,_0x5cbff2,_0x248a6f){var _0x5bea37={};var _0x1b85b9={};var _0x6e883e;var _0x5276b3;return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x26596f[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x5cbff2,null))[_0x3ed0('0x21')](function(_0x5592d0){if(_0x5592d0){_0x6e883e=_0x5592d0;_0x1b85b9[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db['FaxApplication'][_0x3ed0('0x45')]);_0x1b85b9['query']=_['keys'](_0x26596f[_0x3ed0('0x48')]);_0x1b85b9[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x1b85b9['model'],_0x1b85b9[_0x3ed0('0x48')]);_0x5bea37[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x1b85b9[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x5bea37[_0x3ed0('0x4c')]=_0x5bea37[_0x3ed0('0x4c')]['length']?_0x5bea37[_0x3ed0('0x4c')]:_0x1b85b9[_0x3ed0('0x4b')];_0x5bea37[_0x3ed0('0x50')]=qs['sort'](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x5bea37[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_[_0x3ed0('0x53')](_0x26596f[_0x3ed0('0x48')],_0x1b85b9[_0x3ed0('0x4a')]));if(_0x26596f[_0x3ed0('0x48')]['filter']){_0x5bea37[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x5bea37[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x5bea37['attributes'],function(_0x2cf0ae){var _0x4ce7b4={};_0x4ce7b4[_0x2cf0ae]={'$like':'%'+_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x4ce7b4;})});}_0x5bea37=_[_0x3ed0('0x55')]({},_0x5bea37,_0x26596f[_0x3ed0('0x57')]);return _0x6e883e[_0x3ed0('0x88')](_0x5bea37);}})[_0x3ed0('0x21')](function(_0x30893d){if(_0x30893d){_0x5276b3=_0x30893d['length'];if(!_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x76')](_0x3ed0('0x4f'))){_0x5bea37[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x5bea37[_0x3ed0('0x2f')]=qs['offset'](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}return _0x6e883e[_0x3ed0('0x88')](_0x5bea37);}})['then'](function(_0x3f56db){if(_0x3f56db){return _0x3f56db?{'count':_0x5276b3,'rows':_0x3f56db}:null;}})[_0x3ed0('0x21')](respondWithResult(_0x5cbff2,null))[_0x3ed0('0x2c')](handleError(_0x5cbff2,null));};function Extension(_0x31bc20,_0x39e400,_0x36fe13,_0x400232){this[_0x3ed0('0x89')]='from-voip-provider';this[_0x3ed0('0x8a')]=_0x31bc20[_0x3ed0('0x8b')];this['app']=_0x400232;this['type']=_0x3ed0('0x8c');this[_0x3ed0('0x8d')]=_0x3ed0('0x8e');this['FaxAccountId']=_0x31bc20['id'];this[_0x3ed0('0x86')]=_0x39e400;this[_0x3ed0('0x8f')]=_0x36fe13;}function createExtensionsReciveFax(_0x2f3fe4){var _0x419d61=0x1;var _0x59d181=[];_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,'',_0x3ed0('0x91')));_0x419d61+=0x1;_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x92'),'Set'));_0x419d61+=0x1;for(var _0x44eaa8 in _0x2f3fe4){if(_0x2f3fe4[_0x3ed0('0x76')](_0x44eaa8)&&(_0x44eaa8==='ecm'||_0x44eaa8==='localstationid'||_0x44eaa8===_0x3ed0('0x93')||_0x44eaa8===_0x3ed0('0x94')||_0x44eaa8===_0x3ed0('0x95')||_0x44eaa8===_0x3ed0('0x96')||_0x44eaa8==='minrate'||_0x44eaa8===_0x3ed0('0x97')||_0x44eaa8===_0x3ed0('0x98'))){_0x59d181['push'](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x99')+_0x44eaa8+')='+_0x2f3fe4[_0x44eaa8],_0x3ed0('0x9a')));_0x419d61+=0x1;}}_0x59d181['push'](new Extension(_0x2f3fe4,_0x419d61,'6',_0x3ed0('0x9b')));_0x419d61+=0x1;_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x9c'),_0x3ed0('0x9d')));_0x419d61=0x0;return _0x59d181;}exports['addAccountApplications']=function(_0x498573,_0x4ac133,_0x54f7d9){var _0x19d9eb;return db[_0x3ed0('0x80')][_0x3ed0('0x81')](function(_0x57c079){return db[_0x3ed0('0x44')][_0x3ed0('0x5f')](_0x498573['body'],{'transaction':_0x57c079})[_0x3ed0('0x21')](function(_0x48c738){_0x19d9eb=_0x48c738['get']({'plain':!![]});return db['VoiceExtension'][_0x3ed0('0x85')](createExtensionsReciveFax(_0x19d9eb),{'transaction':_0x57c079});});})['then'](function(){return _0x19d9eb;})[_0x3ed0('0x21')](respondWithResult(_0x4ac133,null))[_0x3ed0('0x2c')](handleError(_0x4ac133,null));};exports[_0x3ed0('0x9e')]=function(_0x1ede3e,_0x315891,_0x4950bd){var _0xe4c1c0;return db[_0x3ed0('0x80')]['transaction'](function(_0x135976){return db['FaxAccount'][_0x3ed0('0x38')](_0x1ede3e[_0x3ed0('0x60')],{'where':{'id':_0x1ede3e[_0x3ed0('0x60')]['id']},'transaction':_0x135976})[_0x3ed0('0x21')](function(_0x1eb977){return db[_0x3ed0('0x9f')][_0x3ed0('0x39')]({'where':{'FaxAccountId':_0x1ede3e[_0x3ed0('0x60')]['id']},'transaction':_0x135976})[_0x3ed0('0x21')](function(_0x1f3850){return db[_0x3ed0('0x9f')][_0x3ed0('0x85')](createExtensionsReciveFax(_[_0x3ed0('0x73')](_0x1ede3e[_0x3ed0('0x60')],[_0x3ed0('0xa0'),'key',_0x3ed0('0xa1'),_0x3ed0('0xa2'),_0x3ed0('0xa3'),_0x3ed0('0xa4')])),{'transaction':_0x135976});});});})[_0x3ed0('0x21')](function(){return db[_0x3ed0('0x44')]['findById'](_0x1ede3e[_0x3ed0('0x60')]['id']);})['then'](respondWithResult(_0x315891,null))[_0x3ed0('0x2c')](handleError(_0x315891,null));};exports[_0x3ed0('0xa5')]=function(_0x4ce65d,_0x518632,_0x12f1c1){var _0x31aa2e={'raw':!![],'where':{}};var _0x2dcf9f={};var _0x223a90={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x4ce65d['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x518632,null))[_0x3ed0('0x21')](function(_0x2ddb04){if(_0x2ddb04){_0x2dcf9f[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db['FaxMessage'][_0x3ed0('0x45')]);_0x2dcf9f[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x4ce65d[_0x3ed0('0x48')]);_0x2dcf9f[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x2dcf9f[_0x3ed0('0x4b')],_0x2dcf9f[_0x3ed0('0x48')]);_0x31aa2e[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x2dcf9f[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x31aa2e[_0x3ed0('0x4c')]=_0x31aa2e[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x31aa2e['attributes']:_0x2dcf9f[_0x3ed0('0x4b')];if(!_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x76')](_0x3ed0('0x4f'))){_0x31aa2e[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x4ce65d['query'][_0x3ed0('0x32')]);_0x31aa2e['offset']=qs[_0x3ed0('0x2f')](_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x31aa2e[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x4ce65d['query'][_0x3ed0('0x51')]);_0x31aa2e['where']=qs['filters'](_['pick'](_0x4ce65d[_0x3ed0('0x48')],_0x2dcf9f[_0x3ed0('0x4a')]));_0x31aa2e[_0x3ed0('0x52')][_0x3ed0('0x6a')]=_0x2ddb04['id'];if(_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x54')]){_0x31aa2e[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x31aa2e[_0x3ed0('0x52')],{'$or':_['map'](_0x31aa2e[_0x3ed0('0x4c')],function(_0xe65080){var _0x59bd36={};_0x59bd36[_0xe65080]={'$like':'%'+_0x4ce65d['query'][_0x3ed0('0x54')]+'%'};return _0x59bd36;})});}if(_0x4ce65d['query'][_0x3ed0('0xa6')]){var _0x1b6a6a=_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0xa6')][_0x3ed0('0xa7')](',');var _0x406c70={};_0x406c70[_0x1b6a6a[0x0]]={'$gte':moment(_0x1b6a6a[0x1])['format'](_0x3ed0('0xa8'))};_0x31aa2e['where']=_['merge'](_0x31aa2e[_0x3ed0('0x52')],_0x406c70);}_0x31aa2e=_['merge']({},_0x31aa2e,_0x4ce65d[_0x3ed0('0x57')]);return db[_0x3ed0('0xa9')]['count']({'where':_0x31aa2e['where']})[_0x3ed0('0x21')](function(_0x4899f2){_0x223a90[_0x3ed0('0x31')]=_0x4899f2;if(_0x4ce65d['query'][_0x3ed0('0x58')]){_0x31aa2e['include']=[{'all':!![]}];}return db[_0x3ed0('0xa9')]['findAll'](_0x31aa2e);})[_0x3ed0('0x21')](function(_0x250a5){_0x223a90[_0x3ed0('0x7f')]=_0x250a5;return _0x223a90;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x518632,_0x31aa2e))[_0x3ed0('0x2c')](handleError(_0x518632,null));};exports[_0x3ed0('0x40')]=function(_0xa7926d,_0x43c489,_0x28c4ea){var _0x4f6138,_0x3a2397={},_0x280cec;if(_0xa7926d[_0x3ed0('0x60')]['to']){_0x280cec=_0xa7926d['body']['to'][0x0];}return db[_0x3ed0('0x44')]['find']({'where':{'id':_0xa7926d[_0x3ed0('0x69')]['id']},'include':[{'model':db[_0x3ed0('0xaa')],'as':_0x3ed0('0xab'),'include':[{'model':db['CmContact'],'as':_0x3ed0('0xac'),'where':{'fax':_0x280cec},'limit':0x1,'order':[[_0x3ed0('0xa2'),_0x3ed0('0xad')]]}]}]})[_0x3ed0('0x21')](handleEntityNotFound(_0x43c489,null))[_0x3ed0('0x21')](function(_0x270208){_0x4f6138=_0x270208;if(_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]&&_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]['length']){for(var _0x318820=0x0;_0x318820<_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]['length'];_0x318820+=0x1){_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][_0x318820]={'filename':_0xa7926d[_0x3ed0('0x60')]['attachments'][_0x318820]['name'],'id':_0xa7926d['body'][_0x3ed0('0xae')][_0x318820]['id'],'path':path[_0x3ed0('0xaf')](config[_0x3ed0('0xb0')],_0x3ed0('0xb1'),_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][_0x318820][_0x3ed0('0xb2')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3ed0('0xb3'),{'FaxAccountId':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x69')]['id'])?undefined:_0xa7926d[_0x3ed0('0x69')]['id'],'path':_[_0x3ed0('0xb4')](_0xa7926d['body'][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')])?undefined:_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')],'fax':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['to'][0x0])?undefined:_0xa7926d[_0x3ed0('0x60')]['to'][0x0]},client9002);})[_0x3ed0('0x21')](function(){if(_0x4f6138){if(_[_0x3ed0('0xb4')](_0xa7926d['body'][_0x3ed0('0xb5')])){_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xb5')]=util[_0x3ed0('0xb6')]('\x22%s\x22\x20<%s>',_0x4f6138['name'],_0x4f6138['fax']);}if(_0x4f6138[_0x3ed0('0xab')]){if(_0x4f6138['List'][_0x3ed0('0xac')]['length']){return _0x4f6138[_0x3ed0('0xab')][_0x3ed0('0xac')][0x0];}else{return db['CmContact'][_0x3ed0('0x5f')](_[_0x3ed0('0x19')](_0xa7926d['body'],{'firstName':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'phone':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'fax':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'ListId':_0x4f6138['ListId']}));}}else{throw new Error(_0x3ed0('0xb7'));}}else{throw new Error(_0x3ed0('0xb8'));}})[_0x3ed0('0x21')](function(_0x4e2d21){if(_0x4e2d21){return db[_0x3ed0('0x75')][_0x3ed0('0x5e')]({'where':{'ContactId':_0x4e2d21['id'],'closed':![],'FaxAccountId':_0x4f6138['id']}})['then'](function(_0x329a41){if(_0x329a41){return[_0x329a41,![]];}return db['FaxInteraction'][_0x3ed0('0x5f')]({'UserId':_0xa7926d['user']['id'],'ContactId':_0x4e2d21['id'],'FaxAccountId':_0x4f6138['id'],'fax':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'firstMsgDirection':_0x3ed0('0xb9'),'Messages':[_[_0x3ed0('0x55')](_0xa7926d[_0x3ed0('0x60')],{'read':![],'body':_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0]['filename'],'FaxAccountId':_0x4f6138['id'],'UserId':_0xa7926d['user']['id'],'ContactId':_0x4e2d21['id'],'AttachmentId':_0xa7926d['body'][_0x3ed0('0xae')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3ed0('0xba')}]})['then'](function(_0x352fba){return[_0x352fba,!![]];});});}else{throw new Error(_0x3ed0('0xbb'));}})['spread'](function(_0x51aa70,_0x2dc7b3){if(_0x2dc7b3){return _0x51aa70;}return db['FaxMessage'][_0x3ed0('0x5f')]({'direction':_0x3ed0('0xb9'),'read':![],'body':_0xa7926d['body'][_0x3ed0('0xae')][0x0][_0x3ed0('0xbc')],'FaxAccountId':_0x4f6138['id'],'FaxInteractionId':_0x51aa70['id'],'UserId':_0xa7926d[_0x3ed0('0x61')]['id'],'ContactId':_0x51aa70[_0x3ed0('0xbd')],'AttachmentId':_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0]['id']})[_0x3ed0('0x21')](function(_0x327055){_0x51aa70[_0x3ed0('0xbe')][_0x3ed0('0xba')]=[];_0x51aa70[_0x3ed0('0xbe')][_0x3ed0('0xba')][_0x3ed0('0x90')](_0x327055[_0x3ed0('0xbe')]);return _0x51aa70;});})[_0x3ed0('0x21')](function(_0x4a0cdd){respondWithRpcPromise(_0x3ed0('0xbf'),_0x3ed0('0xbf'),{'FaxAccountId':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x69')]['id'])?undefined:_0xa7926d['params']['id'],'path':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['attachments'][0x0][_0x3ed0('0x8')])?undefined:_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')],'fax':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['to'][0x0])?undefined:_0xa7926d['body']['to'][0x0],'AttachmentId':_0xa7926d['body']['attachments'][0x0]['id']},client9002)[_0x3ed0('0x21')](function(_0x298a8f){logger[_0x3ed0('0x22')](_0x3ed0('0xc0'),_0x298a8f);})[_0x3ed0('0x2c')](function(_0x35619f){logger[_0x3ed0('0x22')]('SendFaxRpc,\x20%s',_0x35619f);});return _0x4a0cdd;})[_0x3ed0('0x21')](respondWithResult(_0x43c489,null))['catch'](handleError(_0x43c489,null));};exports['addAgents']=function(_0xa831d0,_0x12a4fe,_0x3f848e){return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0xa831d0[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x12a4fe,null))['then'](function(_0x15ba09){if(_0x15ba09){return _0x15ba09[_0x3ed0('0xc1')](_0xa831d0[_0x3ed0('0x60')][_0x3ed0('0x71')],_[_0x3ed0('0x73')](_0xa831d0[_0x3ed0('0x60')],['ids','id'])||{})[_0x3ed0('0xc2')](function(_0x162963){for(var _0x6e8e18=0x0;_0x6e8e18<_0xa831d0[_0x3ed0('0x60')]['ids']['length'];_0x6e8e18+=0x1){socket[_0x3ed0('0xc3')](_0x3ed0('0xc4'),{'UserId':Number(_0xa831d0[_0x3ed0('0x60')][_0x3ed0('0x71')][_0x6e8e18]),'FaxAccountId':Number(_0xa831d0[_0x3ed0('0x69')]['id'])});}return _0x162963;});}})[_0x3ed0('0x21')](respondWithResult(_0x12a4fe,null))[_0x3ed0('0x2c')](handleError(_0x12a4fe,null));};exports['removeAgents']=function(_0x60ae6a,_0x11580e,_0x3bc287){return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x60ae6a[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x11580e,null))[_0x3ed0('0x21')](function(_0x2a8a87){if(_0x2a8a87){return _0x2a8a87['removeAgents'](_0x60ae6a[_0x3ed0('0x48')]['ids'])[_0x3ed0('0x21')](function(){if(_['isArray'](_0x60ae6a[_0x3ed0('0x48')]['ids'])){for(var _0x51019b=0x0;_0x51019b<_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')][_0x3ed0('0x4e')];_0x51019b+=0x1){socket[_0x3ed0('0xc3')](_0x3ed0('0xc5'),{'UserId':Number(_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')][_0x51019b]),'FaxAccountId':Number(_0x60ae6a[_0x3ed0('0x69')]['id'])});}}else{socket['emit'](_0x3ed0('0xc5'),{'UserId':Number(_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')]),'FaxAccountId':Number(_0x60ae6a[_0x3ed0('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0x11580e,null))[_0x3ed0('0x2c')](handleError(_0x11580e,null));};exports[_0x3ed0('0xc6')]=function(_0x1ea2ea,_0x6ab927,_0x260392){var _0x1363b8={};var _0x4a4d95={};var _0x422ba2;var _0x52fbed;return db[_0x3ed0('0x44')]['findOne']({'where':{'id':_0x1ea2ea[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x6ab927,null))[_0x3ed0('0x21')](function(_0x1d4e2b){if(_0x1d4e2b){_0x422ba2=_0x1d4e2b;_0x4a4d95['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x79')][_0x3ed0('0x45')]);_0x4a4d95['query']=_[_0x3ed0('0x49')](_0x1ea2ea['query']);_0x4a4d95[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x4a4d95[_0x3ed0('0x4b')],_0x4a4d95['query']);_0x1363b8[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x4a4d95[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x1ea2ea['query'][_0x3ed0('0x4d')]));_0x1363b8[_0x3ed0('0x4c')]=_0x1363b8[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x1363b8[_0x3ed0('0x4c')]:_0x4a4d95[_0x3ed0('0x4b')];_0x1363b8[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x1ea2ea[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x1363b8[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_['pick'](_0x1ea2ea['query'],_0x4a4d95['filters']));if(_0x1ea2ea['query'][_0x3ed0('0x54')]){_0x1363b8['where']=_[_0x3ed0('0x55')](_0x1363b8[_0x3ed0('0x52')],{'$or':_['map'](_0x1363b8[_0x3ed0('0x4c')],function(_0x26c3a5){var _0x204008={};_0x204008[_0x26c3a5]={'$like':'%'+_0x1ea2ea[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x204008;})});}_0x1363b8=_[_0x3ed0('0x55')]({},_0x1363b8,_0x1ea2ea[_0x3ed0('0x57')]);return _0x422ba2['getAgents'](_0x1363b8);}})[_0x3ed0('0x21')](function(_0x399306){if(_0x399306){_0x52fbed=_0x399306[_0x3ed0('0x4e')];if(!_0x1ea2ea[_0x3ed0('0x48')]['hasOwnProperty']('nolimit')){_0x1363b8[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x1ea2ea['query'][_0x3ed0('0x32')]);_0x1363b8['offset']=qs[_0x3ed0('0x2f')](_0x1ea2ea['query'][_0x3ed0('0x2f')]);}return _0x422ba2['getAgents'](_0x1363b8);}})[_0x3ed0('0x21')](function(_0x4a81b2){if(_0x4a81b2){return _0x4a81b2?{'count':_0x52fbed,'rows':_0x4a81b2}:null;}})[_0x3ed0('0x21')](respondWithResult(_0x6ab927,null))['catch'](handleError(_0x6ab927,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c0989c7..05b356a 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 _0x7b77=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xe75d24,_0x54f93b){var _0x4d2587=function(_0x1e5fc9){while(--_0x1e5fc9){_0xe75d24['push'](_0xe75d24['shift']());}};_0x4d2587(++_0x54f93b);}(_0x7b77,0x179));var _0x77b7=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x7b77[_0xf0bc07];return _0x1c50c2;};'use strict';var EventEmitter=require(_0x77b7('0x0'));var FaxAccount=require(_0x77b7('0x1'))['db'][_0x77b7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x77b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77b7('0x4'),'afterDestroy':_0x77b7('0x5')};function emitEvent(_0x3dbd97){return function(_0x5cfb6f,_0x4716a1,_0x139f98){FaxAccountEvents[_0x77b7('0x6')](_0x3dbd97+':'+_0x5cfb6f['id'],_0x5cfb6f);FaxAccountEvents[_0x77b7('0x6')](_0x3dbd97,_0x5cfb6f);_0x139f98(null);};}for(var e in events){if(events[_0x77b7('0x7')](e)){var event=events[e];FaxAccount[_0x77b7('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x20fb=['hook','exports','events','../../mysqldb','FaxAccount','update','remove','emit','hasOwnProperty'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x20fb,0x1b2));var _0xb20f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x20fb[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xb20f('0x0'));var FaxAccount=require(_0xb20f('0x1'))['db'][_0xb20f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb20f('0x3'),'afterDestroy':_0xb20f('0x4')};function emitEvent(_0x18b212){return function(_0x49816f,_0x1f3da9,_0x1b1cd0){FaxAccountEvents[_0xb20f('0x5')](_0x18b212+':'+_0x49816f['id'],_0x49816f);FaxAccountEvents['emit'](_0x18b212,_0x49816f);_0x1b1cd0(null);};}for(var e in events){if(events[_0xb20f('0x6')](e)){var event=events[e];FaxAccount[_0xb20f('0x7')](e,emitEvent(event));}}module[_0xb20f('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f6c655e..16fe4ba 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 _0x8757=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x5d37d1,_0x2a8a4d){var _0x37683b=function(_0x38a04b){while(--_0x38a04b){_0x5d37d1['push'](_0x5d37d1['shift']());}};_0x37683b(++_0x2a8a4d);}(_0x8757,0xfd));var _0x7875=function(_0x2f0844,_0x4d2d46){_0x2f0844=_0x2f0844-0x0;var _0x46a2c3=_0x8757[_0x2f0844];return _0x46a2c3;};'use strict';var _=require(_0x7875('0x0'));var util=require(_0x7875('0x1'));var logger=require(_0x7875('0x2'))(_0x7875('0x3'));var moment=require(_0x7875('0x4'));var BPromise=require(_0x7875('0x5'));var rp=require(_0x7875('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7875('0x7'));var attributes=require(_0x7875('0x8'));module[_0x7875('0x9')]=function(_0x69735f,_0x5a899f){return _0x69735f[_0x7875('0xa')]('FaxAccount',attributes,{'tableName':_0x7875('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82d5=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x5d87e7,_0x2af2a8){var _0x130e23=function(_0x4e7ad0){while(--_0x4e7ad0){_0x5d87e7['push'](_0x5d87e7['shift']());}};_0x130e23(++_0x2af2a8);}(_0x82d5,0x12d));var _0x582d=function(_0xce8bce,_0x5bc5e8){_0xce8bce=_0xce8bce-0x0;var _0x135d09=_0x82d5[_0xce8bce];return _0x135d09;};'use strict';var _=require(_0x582d('0x0'));var util=require(_0x582d('0x1'));var logger=require(_0x582d('0x2'))(_0x582d('0x3'));var moment=require(_0x582d('0x4'));var BPromise=require(_0x582d('0x5'));var rp=require(_0x582d('0x6'));var fs=require('fs');var path=require(_0x582d('0x7'));var rimraf=require(_0x582d('0x8'));var config=require(_0x582d('0x9'));var attributes=require(_0x582d('0xa'));module[_0x582d('0xb')]=function(_0x5931fa,_0xf04fa3){return _0x5931fa[_0x582d('0xc')](_0x582d('0xd'),attributes,{'tableName':_0x582d('0xe'),'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 cd0b70b..aa72e9a 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 _0x1761=['stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','FaxAccount','findAll','options','limit','include','map','model','attributes','GetFaxAccount','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','Contacts','DESC','FaxApplication','Applications','get','applications','List','orderBy','priority','asc','length','contact','fax','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','FaxMessage','ContactId','interaction','UserId','User','unshift','agent','name','waitForTheAssignedAgent','startRouting','Start','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x1761,0x9f));var _0x1176=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1761[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1176('0x0'));var moment=require(_0x1176('0x1'));var BPromise=require(_0x1176('0x2'));var rs=require(_0x1176('0x3'));var fs=require('fs');var Redis=require(_0x1176('0x4'));var db=require(_0x1176('0x5'))['db'];var utils=require(_0x1176('0x6'));var logger=require(_0x1176('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1176('0x8')][_0x1176('0x9')]({'port':0x232c});config[_0x1176('0xa')]=_['defaults'](config['redis'],{'host':_0x1176('0xb'),'port':0x18eb});var socket=require(_0x1176('0xc'))(new Redis(config['redis']));require(_0x1176('0xd'))[_0x1176('0xe')](socket);function respondWithRpcPromise(_0x5cf689,_0x1433a3,_0x3f118f){return new BPromise(function(_0x4d51a6,_0xba95d2){return client[_0x1176('0xf')](_0x5cf689,_0x3f118f)[_0x1176('0x10')](function(_0x3725e7){logger['info']('FaxAccount,\x20%s,\x20%s',_0x1433a3,_0x1176('0x11'));logger[_0x1176('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1433a3,'request\x20sent',JSON[_0x1176('0x13')](_0x3725e7));if(_0x3725e7[_0x1176('0x14')]){if(_0x3725e7[_0x1176('0x14')][_0x1176('0x15')]===0x1f4){logger[_0x1176('0x14')](_0x1176('0x16'),_0x1433a3,_0x3725e7['error'][_0x1176('0x17')]);return _0xba95d2(_0x3725e7[_0x1176('0x14')]['message']);}logger[_0x1176('0x14')](_0x1176('0x16'),_0x1433a3,_0x3725e7[_0x1176('0x14')][_0x1176('0x17')]);return _0x4d51a6(_0x3725e7[_0x1176('0x14')][_0x1176('0x17')]);}else{logger[_0x1176('0x18')]('FaxAccount,\x20%s,\x20%s',_0x1433a3,_0x1176('0x11'));_0x4d51a6(_0x3725e7[_0x1176('0x19')]['message']);}})[_0x1176('0x1a')](function(_0x1fe448){logger[_0x1176('0x14')](_0x1176('0x16'),_0x1433a3,_0x1fe448);_0xba95d2(_0x1fe448);});});}exports['GetFaxAccount']=function(_0x5e7f3d){var _0x5533d2=this;return new Promise(function(_0x245623,_0x168d27){return db[_0x1176('0x1b')][_0x1176('0x1c')]({'raw':_0x5e7f3d[_0x1176('0x1d')]?_0x5e7f3d[_0x1176('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5e7f3d[_0x1176('0x1d')]?_0x5e7f3d[_0x1176('0x1d')]['where']||null:null,'attributes':_0x5e7f3d[_0x1176('0x1d')]?_0x5e7f3d['options']['attributes']||null:null,'limit':_0x5e7f3d[_0x1176('0x1d')]?_0x5e7f3d[_0x1176('0x1d')][_0x1176('0x1e')]||null:null,'include':_0x5e7f3d[_0x1176('0x1d')]?_0x5e7f3d[_0x1176('0x1d')][_0x1176('0x1f')]?_[_0x1176('0x20')](_0x5e7f3d[_0x1176('0x1d')][_0x1176('0x1f')],function(_0x498e38){return{'model':db[_0x498e38[_0x1176('0x21')]],'as':_0x498e38['as'],'attributes':_0x498e38['attributes'],'include':_0x498e38[_0x1176('0x1f')]?_[_0x1176('0x20')](_0x498e38[_0x1176('0x1f')],function(_0x1c22d8){return{'model':db[_0x1c22d8[_0x1176('0x21')]],'as':_0x1c22d8['as'],'attributes':_0x1c22d8[_0x1176('0x22')],'include':_0x1c22d8[_0x1176('0x1f')]?_[_0x1176('0x20')](_0x1c22d8['include'],function(_0x205a72){return{'model':db[_0x205a72[_0x1176('0x21')]],'as':_0x205a72['as'],'attributes':_0x205a72[_0x1176('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1176('0x10')](function(_0x36d8ab){logger['info'](_0x1176('0x23'),_0x5e7f3d);logger['debug']('GetFaxAccount',_0x5e7f3d,JSON['stringify'](_0x36d8ab));_0x245623(_0x36d8ab);})[_0x1176('0x1a')](function(_0x35e41a){logger['error'](_0x1176('0x23'),_0x35e41a['message'],_0x5e7f3d);_0x168d27(_0x5533d2[_0x1176('0x14')](0x1f4,_0x35e41a[_0x1176('0x17')]));});});};exports[_0x1176('0x24')]=function(_0x3dfc79,_0x516686,_0x58e1c6){var _0x38a230=this;return new Promise(function(_0x1ddca8,_0x2795c6){var _0x1a6399={'body':_0x3dfc79[_0x1176('0x25')],'channel':'fax'};var _0x5e55ec=[];var _0x2ec959=[];var _0x1ac7cb={};return db[_0x1176('0x26')][_0x1176('0x27')]()['then'](function(_0x2219f5){if(!_0x2219f5){throw new db[(_0x1176('0x28'))][(_0x1176('0x29'))](_0x1176('0x2a'));}_0x5e55ec=_[_0x1176('0x2b')](_[_0x1176('0x2c')](_0x2219f5),[_0x1176('0x2d'),_0x1176('0x2e')]);_0x2ec959=_[_0x1176('0x2b')](_['keys'](_0x2219f5),[_0x1176('0x2d'),_0x1176('0x2e'),'CompanyId',_0x1176('0x2f')]);if(_0x3dfc79[_0x1176('0x25')]['id']){delete _0x3dfc79[_0x1176('0x25')]['id'];}if(_[_0x1176('0x30')](_0x3dfc79['body'][_0x1176('0x31')])){throw new db[(_0x1176('0x28'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x1176('0x30')](_0x3dfc79['body']['body'])||_0x3dfc79[_0x1176('0x25')][_0x1176('0x25')]===''){throw new db[(_0x1176('0x28'))]['ValidationError'](_0x1176('0x32'));}if(_[_0x1176('0x30')](_0x3dfc79[_0x1176('0x25')][_0x1176('0x33')])){throw new db[(_0x1176('0x28'))]['ValidationError'](_0x1176('0x34')+_0x2ec959);}if(!_[_0x1176('0x35')](_0x2ec959,_0x3dfc79[_0x1176('0x25')][_0x1176('0x33')])){throw new db[(_0x1176('0x28'))][(_0x1176('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ec959);}_0x1ac7cb[_0x3dfc79[_0x1176('0x25')]['mapKey']]=_0x3dfc79[_0x1176('0x25')][_0x1176('0x31')];})[_0x1176('0x10')](function(){return db[_0x1176('0x1b')][_0x1176('0x36')]({'where':{'id':_0x3dfc79[_0x1176('0x37')]['id']},'include':[{'model':db[_0x1176('0x38')],'as':'List','include':[{'model':db[_0x1176('0x26')],'as':_0x1176('0x39'),'where':_0x1ac7cb,'limit':0x1,'order':[[_0x1176('0x2e'),_0x1176('0x3a')]]}]},{'model':db[_0x1176('0x3b')],'as':_0x1176('0x3c')}]});})[_0x1176('0x10')](function(_0x2f9050){if(_0x2f9050&&_0x2f9050['List']){var _0x38fda3=_0x2f9050[_0x1176('0x3d')]({'plain':!![]});_0x1a6399[_0x1176('0x37')]=_0x38fda3;_0x1a6399[_0x1176('0x3e')]=_0x38fda3[_0x1176('0x3c')];_0x1a6399['list']=_0x38fda3[_0x1176('0x3f')];_0x1a6399[_0x1176('0x3e')]=_[_0x1176('0x40')](_0x1a6399['applications'],[_0x1176('0x41')],[_0x1176('0x42')]);if(_0x1a6399[_0x1176('0x37')][_0x1176('0x3c')]){delete _0x1a6399[_0x1176('0x37')][_0x1176('0x3c')];}if(_0x1a6399[_0x1176('0x37')][_0x1176('0x3f')]&&_0x1a6399['account']['List'][_0x1176('0x39')][_0x1176('0x43')]){return _0x1a6399[_0x1176('0x37')]['List']['Contacts'][0x0];}var _0x5b9093=_['defaults'](_0x3dfc79[_0x1176('0x25')],{'firstName':_0x3dfc79[_0x1176('0x25')][_0x1176('0x31')],'ListId':_0x38fda3[_0x1176('0x2f')]});_0x5b9093[_0x3dfc79[_0x1176('0x25')][_0x1176('0x33')]]=_0x3dfc79[_0x1176('0x25')][_0x1176('0x31')];return db[_0x1176('0x26')]['create'](_0x5b9093,{'fields':_0x5e55ec,'raw':!![]});}})[_0x1176('0x10')](function(_0x12024e){_0x1a6399[_0x1176('0x44')]=_0x12024e;if(_0x12024e){var _0x36fe57={'ContactId':_0x12024e['id'],'FaxAccountId':_0x3dfc79[_0x1176('0x37')]['id'],'fax':_0x12024e[_0x1176('0x45')]};return db[_0x1176('0x46')][_0x1176('0x36')]({'where':{'ContactId':_0x12024e['id'],'closed':![],'FaxAccountId':_0x3dfc79[_0x1176('0x37')]['id']}})[_0x1176('0x10')](function(_0x1c4b59){if(_0x1c4b59){return[_0x1c4b59,![]];}return db[_0x1176('0x46')][_0x1176('0x47')](_0x36fe57)[_0x1176('0x10')](function(_0x4e64ad){return[_0x4e64ad,!![]];});});}else{throw new Error(_0x1176('0x48'));}})[_0x1176('0x49')](function(_0xb13426,_0x37be7b){var _0x2f859c=_0xb13426[_0x1176('0x3d')]({'plain':!![]});if(_0x37be7b){if(_0x1a6399[_0x1176('0x37')][_0x1176('0x4a')]){_0x1a6399[_0x1176('0x3e')][_0x1176('0x4b')]({'id':0x0,'priority':_0x1a6399[_0x1176('0x3e')][_0x1176('0x43')]+0x1,'app':_0x1176('0x4c'),'appdata':'unmanaged','interval':_0x1176('0x4d')});}_0x2f859c['created']=!![];}else{_0x2f859c['created']=![];}_0x1a6399['interaction']=_0x2f859c;return db[_0x1176('0x4e')][_0x1176('0x47')]({'body':_0x3dfc79[_0x1176('0x25')][_0x1176('0x25')],'FaxAccountId':_0x3dfc79[_0x1176('0x37')]['id'],'FaxInteractionId':_0xb13426['id'],'direction':'in','ContactId':_0xb13426[_0x1176('0x4f')],'AttachmentId':_0x3dfc79[_0x1176('0x25')]['AttachmentId']});})['then'](function(_0x2c9e8d){_0x1a6399['message']=_0x2c9e8d;if(_0x1a6399[_0x1176('0x50')][_0x1176('0x51')]){return db[_0x1176('0x52')][_0x1176('0x36')]({'attributes':['id','name'],'where':{'id':_0x1a6399[_0x1176('0x50')][_0x1176('0x51')]}})[_0x1176('0x10')](function(_0x51244b){if(_0x51244b){_0x1a6399[_0x1176('0x3e')][_0x1176('0x53')]({'id':0x0,'priority':0x0,'app':_0x1176('0x54'),'appdata':_0x51244b[_0x1176('0x55')]+','+(_0x1a6399['account'][_0x1176('0x56')]||0xa),'interval':_0x1176('0x4d')});}return respondWithRpcPromise('Start',_0x1176('0x57'),_0x1a6399);});}return respondWithRpcPromise(_0x1176('0x58'),_0x1176('0x57'),_0x1a6399);})['then'](function(_0x561710){_0x1ddca8(_0x561710);})[_0x1176('0x1a')](function(_0x1de97a){_0x2795c6(_0x38a230['error'](0x1f4,_0x1de97a[_0x1176('0x17')]));});});}; \ No newline at end of file +var _0x9f8e=['error','code','message','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','map','include','model','catch','NotifyFaxAccount','body','fax','CmContact','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','List','Contacts','DESC','FaxApplication','get','applications','list','orderBy','Applications','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x376f0e,_0x27f083){var _0x581b8c=function(_0x6bbabf){while(--_0x6bbabf){_0x376f0e['push'](_0x376f0e['shift']());}};_0x581b8c(++_0x27f083);}(_0x9f8e,0xf1));var _0xe9f8=function(_0x58edb4,_0x4e7626){_0x58edb4=_0x58edb4-0x0;var _0x26cd56=_0x9f8e[_0x58edb4];return _0x26cd56;};'use strict';var _=require(_0xe9f8('0x0'));var util=require(_0xe9f8('0x1'));var moment=require(_0xe9f8('0x2'));var BPromise=require(_0xe9f8('0x3'));var rs=require(_0xe9f8('0x4'));var fs=require('fs');var Redis=require(_0xe9f8('0x5'));var db=require(_0xe9f8('0x6'))['db'];var utils=require(_0xe9f8('0x7'));var logger=require(_0xe9f8('0x8'))(_0xe9f8('0x9'));var config=require(_0xe9f8('0xa'));var jayson=require(_0xe9f8('0xb'));var client=jayson[_0xe9f8('0xc')][_0xe9f8('0xd')]({'port':0x232c});config['redis']=_[_0xe9f8('0xe')](config[_0xe9f8('0xf')],{'host':_0xe9f8('0x10'),'port':0x18eb});var socket=require(_0xe9f8('0x11'))(new Redis(config[_0xe9f8('0xf')]));require(_0xe9f8('0x12'))['register'](socket);function respondWithRpcPromise(_0x16fae8,_0x5b6b83,_0x1fbca0){return new BPromise(function(_0x232742,_0x1b579f){return client[_0xe9f8('0x13')](_0x16fae8,_0x1fbca0)[_0xe9f8('0x14')](function(_0x55fa09){logger[_0xe9f8('0x15')](_0xe9f8('0x16'),_0x5b6b83,_0xe9f8('0x17'));logger[_0xe9f8('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5b6b83,_0xe9f8('0x17'),JSON[_0xe9f8('0x19')](_0x55fa09));if(_0x55fa09[_0xe9f8('0x1a')]){if(_0x55fa09['error'][_0xe9f8('0x1b')]===0x1f4){logger[_0xe9f8('0x1a')](_0xe9f8('0x16'),_0x5b6b83,_0x55fa09[_0xe9f8('0x1a')][_0xe9f8('0x1c')]);return _0x1b579f(_0x55fa09[_0xe9f8('0x1a')][_0xe9f8('0x1c')]);}logger[_0xe9f8('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x5b6b83,_0x55fa09['error']['message']);return _0x232742(_0x55fa09['error']['message']);}else{logger[_0xe9f8('0x15')](_0xe9f8('0x16'),_0x5b6b83,_0xe9f8('0x17'));_0x232742(_0x55fa09['result'][_0xe9f8('0x1c')]);}})['catch'](function(_0x2cc50a){logger[_0xe9f8('0x1a')](_0xe9f8('0x16'),_0x5b6b83,_0x2cc50a);_0x1b579f(_0x2cc50a);});});}exports[_0xe9f8('0x1d')]=function(_0x5fec1){var _0x3e440d=this;return new Promise(function(_0x53646e,_0x13682f){return db[_0xe9f8('0x1e')][_0xe9f8('0x1f')]({'raw':_0x5fec1['options']?_0x5fec1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x21')]||null:null,'attributes':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x22')]||null:null,'limit':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x23')]||null:null,'include':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')]['include']?_[_0xe9f8('0x24')](_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x25')],function(_0x4c5f15){return{'model':db[_0x4c5f15[_0xe9f8('0x26')]],'as':_0x4c5f15['as'],'attributes':_0x4c5f15[_0xe9f8('0x22')],'include':_0x4c5f15[_0xe9f8('0x25')]?_['map'](_0x4c5f15[_0xe9f8('0x25')],function(_0x24bf0f){return{'model':db[_0x24bf0f['model']],'as':_0x24bf0f['as'],'attributes':_0x24bf0f[_0xe9f8('0x22')],'include':_0x24bf0f[_0xe9f8('0x25')]?_[_0xe9f8('0x24')](_0x24bf0f['include'],function(_0x1d011d){return{'model':db[_0x1d011d[_0xe9f8('0x26')]],'as':_0x1d011d['as'],'attributes':_0x1d011d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f8('0x14')](function(_0x5050ff){logger[_0xe9f8('0x15')](_0xe9f8('0x1d'),_0x5fec1);logger[_0xe9f8('0x18')]('GetFaxAccount',_0x5fec1,JSON[_0xe9f8('0x19')](_0x5050ff));_0x53646e(_0x5050ff);})[_0xe9f8('0x27')](function(_0x591e4c){logger[_0xe9f8('0x1a')](_0xe9f8('0x1d'),_0x591e4c[_0xe9f8('0x1c')],_0x5fec1);_0x13682f(_0x3e440d[_0xe9f8('0x1a')](0x1f4,_0x591e4c[_0xe9f8('0x1c')]));});});};exports[_0xe9f8('0x28')]=function(_0x3446d9,_0x7007e1,_0x1b514f){var _0x34a23d=this;return new Promise(function(_0x62a404,_0x23d3c7){var _0x1a4f34={'body':_0x3446d9[_0xe9f8('0x29')],'channel':_0xe9f8('0x2a')};var _0x475cfb=[];var _0x439eb8=[];var _0x410e69={};return db[_0xe9f8('0x2b')]['describe']()['then'](function(_0x3d1b00){if(!_0x3d1b00){throw new db['Sequelize'][(_0xe9f8('0x2c'))]('no\x20available\x20attributes');}_0x475cfb=_[_0xe9f8('0x2d')](_[_0xe9f8('0x2e')](_0x3d1b00),['createdAt',_0xe9f8('0x2f')]);_0x439eb8=_[_0xe9f8('0x2d')](_[_0xe9f8('0x2e')](_0x3d1b00),[_0xe9f8('0x30'),'updatedAt',_0xe9f8('0x31'),'ListId']);if(_0x3446d9[_0xe9f8('0x29')]['id']){delete _0x3446d9['body']['id'];}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')]['from'])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))]('from\x20is\x20mandatory');}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x29')])||_0x3446d9['body'][_0xe9f8('0x29')]===''){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))](_0xe9f8('0x34'));}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x35')])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x439eb8);}if(!_['includes'](_0x439eb8,_0x3446d9['body'][_0xe9f8('0x35')])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))](_0xe9f8('0x36')+_0x439eb8);}_0x410e69[_0x3446d9['body'][_0xe9f8('0x35')]]=_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x37')];})[_0xe9f8('0x14')](function(){return db['FaxAccount'][_0xe9f8('0x38')]({'where':{'id':_0x3446d9[_0xe9f8('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xe9f8('0x3a'),'include':[{'model':db[_0xe9f8('0x2b')],'as':_0xe9f8('0x3b'),'where':_0x410e69,'limit':0x1,'order':[[_0xe9f8('0x2f'),_0xe9f8('0x3c')]]}]},{'model':db[_0xe9f8('0x3d')],'as':'Applications'}]});})[_0xe9f8('0x14')](function(_0x476f16){if(_0x476f16&&_0x476f16[_0xe9f8('0x3a')]){var _0x5cb5d7=_0x476f16[_0xe9f8('0x3e')]({'plain':!![]});_0x1a4f34[_0xe9f8('0x39')]=_0x5cb5d7;_0x1a4f34[_0xe9f8('0x3f')]=_0x5cb5d7['Applications'];_0x1a4f34[_0xe9f8('0x40')]=_0x5cb5d7[_0xe9f8('0x3a')];_0x1a4f34['applications']=_[_0xe9f8('0x41')](_0x1a4f34[_0xe9f8('0x3f')],['priority'],['asc']);if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x42')]){delete _0x1a4f34['account'][_0xe9f8('0x42')];}if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')]&&_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')][_0xe9f8('0x3b')]['length']){return _0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')][_0xe9f8('0x3b')][0x0];}var _0x1b7852=_[_0xe9f8('0xe')](_0x3446d9[_0xe9f8('0x29')],{'firstName':_0x3446d9[_0xe9f8('0x29')]['from'],'ListId':_0x5cb5d7['ListId']});_0x1b7852[_0x3446d9[_0xe9f8('0x29')]['mapKey']]=_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x37')];return db[_0xe9f8('0x2b')][_0xe9f8('0x43')](_0x1b7852,{'fields':_0x475cfb,'raw':!![]});}})[_0xe9f8('0x14')](function(_0x24b033){_0x1a4f34[_0xe9f8('0x44')]=_0x24b033;if(_0x24b033){var _0x7cac03={'ContactId':_0x24b033['id'],'FaxAccountId':_0x3446d9[_0xe9f8('0x39')]['id'],'fax':_0x24b033[_0xe9f8('0x2a')]};return db[_0xe9f8('0x45')][_0xe9f8('0x38')]({'where':{'ContactId':_0x24b033['id'],'closed':![],'FaxAccountId':_0x3446d9['account']['id']}})[_0xe9f8('0x14')](function(_0x553196){if(_0x553196){return[_0x553196,![]];}return db[_0xe9f8('0x45')][_0xe9f8('0x43')](_0x7cac03)[_0xe9f8('0x14')](function(_0xbf8854){return[_0xbf8854,!![]];});});}else{throw new Error(_0xe9f8('0x46'));}})['spread'](function(_0x31ca78,_0x279bc5){var _0x3fce99=_0x31ca78['get']({'plain':!![]});if(_0x279bc5){if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x47')]){_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x48')]({'id':0x0,'priority':_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x49')]+0x1,'app':_0xe9f8('0x4a'),'appdata':_0xe9f8('0x4b'),'interval':_0xe9f8('0x4c')});}_0x3fce99[_0xe9f8('0x4d')]=!![];}else{_0x3fce99['created']=![];}_0x1a4f34[_0xe9f8('0x4e')]=_0x3fce99;return db['FaxMessage']['create']({'body':_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x29')],'FaxAccountId':_0x3446d9[_0xe9f8('0x39')]['id'],'FaxInteractionId':_0x31ca78['id'],'direction':'in','ContactId':_0x31ca78[_0xe9f8('0x4f')],'AttachmentId':_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x50')]});})[_0xe9f8('0x14')](function(_0xa326ef){_0x1a4f34['message']=_0xa326ef;if(_0x1a4f34[_0xe9f8('0x4e')][_0xe9f8('0x51')]){return db[_0xe9f8('0x52')]['find']({'attributes':['id',_0xe9f8('0x53')],'where':{'id':_0x1a4f34[_0xe9f8('0x4e')][_0xe9f8('0x51')]}})[_0xe9f8('0x14')](function(_0x143c77){if(_0x143c77){_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x54')]({'id':0x0,'priority':0x0,'app':_0xe9f8('0x55'),'appdata':_0x143c77['name']+','+(_0x1a4f34['account'][_0xe9f8('0x56')]||0xa),'interval':_0xe9f8('0x4c')});}return respondWithRpcPromise(_0xe9f8('0x57'),'startRouting',_0x1a4f34);});}return respondWithRpcPromise('Start',_0xe9f8('0x58'),_0x1a4f34);})[_0xe9f8('0x14')](function(_0x34ab93){_0x62a404(_0x34ab93);})[_0xe9f8('0x27')](function(_0x3fb71e){_0x23d3c7(_0x34a23d[_0xe9f8('0x1a')](0x1f4,_0x3fb71e[_0xe9f8('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 10a0ae9..cd7f2e1 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 _0xc82b=['register','length','faxAccount:','./faxAccount.events','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc82b,0x1f4));var _0xbc82=function(_0xa9d635,_0x20eab5){_0xa9d635=_0xa9d635-0x0;var _0x2eff28=_0xc82b[_0xa9d635];return _0x2eff28;};'use strict';var FaxAccountEvents=require(_0xbc82('0x0'));var events=['save','remove',_0xbc82('0x1')];function createListener(_0x4ce32d,_0x4e0ff2){return function(_0x1bbb9b){_0x4e0ff2[_0xbc82('0x2')](_0x4ce32d,_0x1bbb9b);};}function removeListener(_0x36a143,_0x503a76){return function(){FaxAccountEvents[_0xbc82('0x3')](_0x36a143,_0x503a76);};}exports[_0xbc82('0x4')]=function(_0x3ed75c){for(var _0x24ad46=0x0,_0x329b62=events[_0xbc82('0x5')];_0x24ad46<_0x329b62;_0x24ad46++){var _0x1db12f=events[_0x24ad46];var _0x53b173=createListener(_0xbc82('0x6')+_0x1db12f,_0x3ed75c);FaxAccountEvents['on'](_0x1db12f,_0x53b173);}}; \ No newline at end of file +var _0xc9cc=['emit','register','faxAccount:','./faxAccount.events','save','remove'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xc9cc,0x117));var _0xcc9c=function(_0x40baad,_0x5863ae){_0x40baad=_0x40baad-0x0;var _0x5244b7=_0xc9cc[_0x40baad];return _0x5244b7;};'use strict';var FaxAccountEvents=require(_0xcc9c('0x0'));var events=[_0xcc9c('0x1'),_0xcc9c('0x2'),'update'];function createListener(_0x3ab47d,_0x1bbce4){return function(_0x37f42a){_0x1bbce4[_0xcc9c('0x3')](_0x3ab47d,_0x37f42a);};}function removeListener(_0x316770,_0x23a4a8){return function(){FaxAccountEvents['removeListener'](_0x316770,_0x23a4a8);};}exports[_0xcc9c('0x4')]=function(_0x1f211d){for(var _0x570ed5=0x0,_0xbf1007=events['length'];_0x570ed5<_0xbf1007;_0x570ed5++){var _0x57e536=events[_0x570ed5];var _0x450127=createListener(_0xcc9c('0x5')+_0x57e536,_0x1f211d);FaxAccountEvents['on'](_0x57e536,_0x450127);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1c809a4..5f5ecad 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xbe5401,_0x2433d9){var _0x4cff04=function(_0x32058f){while(--_0x32058f){_0xbe5401['push'](_0xbe5401['shift']());}};_0x4cff04(++_0x2433d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x6c0f5f,_0x1deead){var _0x23980f=function(_0x468967){while(--_0x468967){_0x6c0f5f['push'](_0x6c0f5f['shift']());}};_0x23980f(++_0x1deead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('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 4699e66..372d6a2 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 _0xd79d=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x195b77,_0x2ba1e9){var _0x4fa195=function(_0x32c185){while(--_0x32c185){_0x195b77['push'](_0x195b77['shift']());}};_0x4fa195(++_0x2ba1e9);}(_0xd79d,0x110));var _0xdd79=function(_0x12e898,_0x1ef073){_0x12e898=_0x12e898-0x0;var _0x190631=_0xd79d[_0x12e898];return _0x190631;};'use strict';var Sequelize=require(_0xdd79('0x0'));module[_0xdd79('0x1')]={'priority':{'type':Sequelize[_0xdd79('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdd79('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdd79('0x4')]()},'description':{'type':Sequelize[_0xdd79('0x3')]},'interval':{'type':Sequelize[_0xdd79('0x3')],'defaultValue':_0xdd79('0x5')}}; \ No newline at end of file +var _0x7e8c=['sequelize','STRING','noop'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x7e8c,0x138));var _0xc7e8=function(_0x3c52e3,_0x432f56){_0x3c52e3=_0x3c52e3-0x0;var _0x2e88e5=_0x7e8c[_0x3c52e3];return _0x2e88e5;};'use strict';var Sequelize=require(_0xc7e8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc7e8('0x1')],'allowNull':![],'defaultValue':_0xc7e8('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc7e8('0x1')]},'interval':{'type':Sequelize[_0xc7e8('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d6d8982..a810fb5 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 _0x6bca=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','name','index','map','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','FaxApplication','includeAll','include','findAll','show','params','rawAttributes','find','catch'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x6bca,0x11a));var _0xa6bc=function(_0x152472,_0x5b71f0){_0x152472=_0x152472-0x0;var _0x299755=_0x6bca[_0x152472];return _0x299755;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6bc('0x0'));var zipdir=require(_0xa6bc('0x1'));var jsonpatch=require(_0xa6bc('0x2'));var rp=require(_0xa6bc('0x3'));var moment=require('moment');var BPromise=require(_0xa6bc('0x4'));var Mustache=require('mustache');var util=require(_0xa6bc('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa6bc('0x6'));var ejs=require(_0xa6bc('0x7'));var fs=require('fs');var fs_extra=require(_0xa6bc('0x8'));var _=require(_0xa6bc('0x9'));var squel=require(_0xa6bc('0xa'));var crypto=require(_0xa6bc('0xb'));var jsforce=require(_0xa6bc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa6bc('0x6'));var querystring=require(_0xa6bc('0xd'));var Papa=require(_0xa6bc('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6bc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6bc('0x10'))(_0xa6bc('0x11'));var utils=require(_0xa6bc('0x12'));var config=require(_0xa6bc('0x13'));var licenseUtil=require(_0xa6bc('0x14'));var db=require(_0xa6bc('0x15'))['db'];function respondWithStatusCode(_0x560f51,_0x2ddec9){_0x2ddec9=_0x2ddec9||0xcc;return function(_0x1172f5){if(_0x1172f5){return _0x560f51['sendStatus'](_0x2ddec9);}return _0x560f51[_0xa6bc('0x16')](_0x2ddec9)[_0xa6bc('0x17')]();};}function respondWithResult(_0xfcc1d1,_0x5cfcdd){_0x5cfcdd=_0x5cfcdd||0xc8;return function(_0x2945e4){if(_0x2945e4){return _0xfcc1d1[_0xa6bc('0x16')](_0x5cfcdd)[_0xa6bc('0x18')](_0x2945e4);}};}function respondWithFilteredResult(_0xa72648,_0x45efee){return function(_0xd73b50){if(_0xd73b50){var _0x379926=typeof _0x45efee[_0xa6bc('0x19')]===_0xa6bc('0x1a')&&typeof _0x45efee[_0xa6bc('0x1b')]===_0xa6bc('0x1a');var _0x6b3098=_0xd73b50[_0xa6bc('0x1c')];var _0xd1aa4c=_0x379926?0x0:_0x45efee['offset'];var _0x4700e9=_0x379926?_0xd73b50[_0xa6bc('0x1c')]:_0x45efee[_0xa6bc('0x19')]+_0x45efee[_0xa6bc('0x1b')];var _0x1c7bbc;if(_0x4700e9>=_0x6b3098){_0x4700e9=_0x6b3098;_0x1c7bbc=0xc8;}else{_0x1c7bbc=0xce;}_0xa72648['status'](_0x1c7bbc);return _0xa72648[_0xa6bc('0x1d')]('Content-Range',_0xd1aa4c+'-'+_0x4700e9+'/'+_0x6b3098)[_0xa6bc('0x18')](_0xd73b50);}return null;};}function patchUpdates(_0x5ae71e){return function(_0x26c417){try{jsonpatch['apply'](_0x26c417,_0x5ae71e,!![]);}catch(_0x98b49a){return BPromise[_0xa6bc('0x1e')](_0x98b49a);}return _0x26c417[_0xa6bc('0x1f')]();};}function saveUpdates(_0x3b7077,_0x12319a){return function(_0x2b2713){if(_0x2b2713){return _0x2b2713[_0xa6bc('0x20')](_0x3b7077)['then'](function(_0x52e29b){return _0x52e29b;});}return null;};}function removeEntity(_0x38aa1c,_0x4e01d9){return function(_0x4d0801){if(_0x4d0801){return _0x4d0801[_0xa6bc('0x21')]()[_0xa6bc('0x22')](function(){_0x38aa1c[_0xa6bc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313aca,_0x47d971){return function(_0x225581){if(!_0x225581){_0x313aca[_0xa6bc('0x23')](0x194);}return _0x225581;};}function handleError(_0x5b7d0a,_0x1aa3d7){_0x1aa3d7=_0x1aa3d7||0x1f4;return function(_0x3cf6b8){logger[_0xa6bc('0x24')](_0x3cf6b8['stack']);if(_0x3cf6b8[_0xa6bc('0x25')]){delete _0x3cf6b8[_0xa6bc('0x25')];}_0x5b7d0a['status'](_0x1aa3d7)['send'](_0x3cf6b8);};}exports[_0xa6bc('0x26')]=function(_0x5b0679,_0x5ba95a){var _0x16e210={},_0x50be8f={},_0xe636a={'count':0x0,'rows':[]};var _0x4d28f5=_[_0xa6bc('0x27')](db['FaxApplication']['rawAttributes'],function(_0x11cd66){return{'name':_0x11cd66[_0xa6bc('0x28')],'type':_0x11cd66['type'][_0xa6bc('0x29')]};});_0x50be8f['model']=_[_0xa6bc('0x27')](_0x4d28f5,_0xa6bc('0x25'));_0x50be8f[_0xa6bc('0x2a')]=_[_0xa6bc('0x2b')](_0x5b0679['query']);_0x50be8f[_0xa6bc('0x2c')]=_['intersection'](_0x50be8f[_0xa6bc('0x2d')],_0x50be8f[_0xa6bc('0x2a')]);_0x16e210[_0xa6bc('0x2e')]=_[_0xa6bc('0x2f')](_0x50be8f[_0xa6bc('0x2d')],qs['fields'](_0x5b0679[_0xa6bc('0x2a')][_0xa6bc('0x30')]));_0x16e210[_0xa6bc('0x2e')]=_0x16e210[_0xa6bc('0x2e')][_0xa6bc('0x31')]?_0x16e210['attributes']:_0x50be8f[_0xa6bc('0x2d')];if(!_0x5b0679[_0xa6bc('0x2a')][_0xa6bc('0x32')](_0xa6bc('0x33'))){_0x16e210[_0xa6bc('0x1b')]=qs[_0xa6bc('0x1b')](_0x5b0679[_0xa6bc('0x2a')][_0xa6bc('0x1b')]);_0x16e210[_0xa6bc('0x19')]=qs['offset'](_0x5b0679['query']['offset']);}_0x16e210['order']=qs[_0xa6bc('0x34')](_0x5b0679[_0xa6bc('0x2a')]['sort']);_0x16e210[_0xa6bc('0x35')]=qs[_0xa6bc('0x2c')](_['pick'](_0x5b0679[_0xa6bc('0x2a')],_0x50be8f[_0xa6bc('0x2c')]),_0x4d28f5);if(_0x5b0679[_0xa6bc('0x2a')]['filter']){_0x16e210[_0xa6bc('0x35')]=_[_0xa6bc('0x36')](_0x16e210[_0xa6bc('0x35')],{'$or':_[_0xa6bc('0x27')](_0x4d28f5,function(_0x400bda){if(_0x400bda[_0xa6bc('0x37')]!==_0xa6bc('0x38')){var _0x13942f={};_0x13942f[_0x400bda['name']]={'$like':'%'+_0x5b0679[_0xa6bc('0x2a')][_0xa6bc('0x39')]+'%'};return _0x13942f;}})});}_0x16e210=_[_0xa6bc('0x36')]({},_0x16e210,_0x5b0679[_0xa6bc('0x3a')]);var _0x3434ed={'where':_0x16e210[_0xa6bc('0x35')]};return db[_0xa6bc('0x3b')][_0xa6bc('0x1c')](_0x3434ed)['then'](function(_0x264c0b){_0xe636a['count']=_0x264c0b;if(_0x5b0679[_0xa6bc('0x2a')][_0xa6bc('0x3c')]){_0x16e210[_0xa6bc('0x3d')]=[{'all':!![]}];}return db[_0xa6bc('0x3b')][_0xa6bc('0x3e')](_0x16e210);})[_0xa6bc('0x22')](function(_0x16af7a){_0xe636a['rows']=_0x16af7a;return _0xe636a;})[_0xa6bc('0x22')](respondWithFilteredResult(_0x5ba95a,_0x16e210))['catch'](handleError(_0x5ba95a,null));};exports[_0xa6bc('0x3f')]=function(_0x26e46d,_0x2caf2b){var _0x48d6ce={'raw':!![],'where':{'id':_0x26e46d[_0xa6bc('0x40')]['id']}},_0x592cfa={};_0x592cfa['model']=_['keys'](db[_0xa6bc('0x3b')][_0xa6bc('0x41')]);_0x592cfa[_0xa6bc('0x2a')]=_[_0xa6bc('0x2b')](_0x26e46d[_0xa6bc('0x2a')]);_0x592cfa[_0xa6bc('0x2c')]=_[_0xa6bc('0x2f')](_0x592cfa[_0xa6bc('0x2d')],_0x592cfa[_0xa6bc('0x2a')]);_0x48d6ce['attributes']=_[_0xa6bc('0x2f')](_0x592cfa[_0xa6bc('0x2d')],qs[_0xa6bc('0x30')](_0x26e46d[_0xa6bc('0x2a')][_0xa6bc('0x30')]));_0x48d6ce['attributes']=_0x48d6ce[_0xa6bc('0x2e')]['length']?_0x48d6ce[_0xa6bc('0x2e')]:_0x592cfa[_0xa6bc('0x2d')];if(_0x26e46d[_0xa6bc('0x2a')]['includeAll']){_0x48d6ce[_0xa6bc('0x3d')]=[{'all':!![]}];}_0x48d6ce=_[_0xa6bc('0x36')]({},_0x48d6ce,_0x26e46d[_0xa6bc('0x3a')]);return db['FaxApplication'][_0xa6bc('0x42')](_0x48d6ce)[_0xa6bc('0x22')](handleEntityNotFound(_0x2caf2b,null))['then'](respondWithResult(_0x2caf2b,null))[_0xa6bc('0x43')](handleError(_0x2caf2b,null));};exports['create']=function(_0xd5d05,_0x3a674a){return db[_0xa6bc('0x3b')][_0xa6bc('0x44')](_0xd5d05[_0xa6bc('0x45')],{})[_0xa6bc('0x22')](respondWithResult(_0x3a674a,0xc9))[_0xa6bc('0x43')](handleError(_0x3a674a,null));};exports['update']=function(_0x2eef4e,_0x10b470){if(_0x2eef4e['body']['id']){delete _0x2eef4e[_0xa6bc('0x45')]['id'];}return db[_0xa6bc('0x3b')][_0xa6bc('0x42')]({'where':{'id':_0x2eef4e['params']['id']}})['then'](handleEntityNotFound(_0x10b470,null))[_0xa6bc('0x22')](saveUpdates(_0x2eef4e[_0xa6bc('0x45')],null))[_0xa6bc('0x22')](respondWithResult(_0x10b470,null))[_0xa6bc('0x43')](handleError(_0x10b470,null));};exports[_0xa6bc('0x21')]=function(_0xb5c2ad,_0x3d4b2b){return db[_0xa6bc('0x3b')][_0xa6bc('0x42')]({'where':{'id':_0xb5c2ad[_0xa6bc('0x40')]['id']}})[_0xa6bc('0x22')](handleEntityNotFound(_0x3d4b2b,null))[_0xa6bc('0x22')](removeEntity(_0x3d4b2b,null))[_0xa6bc('0x43')](handleError(_0x3d4b2b,null));}; \ No newline at end of file +var _0x4443=['query','keys','intersection','fields','attributes','length','nolimit','order','pick','filters','where','merge','VIRTUAL','filter','FaxApplication','include','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x18d1ed,_0x55655d){var _0x1a7ad8=function(_0x2d1f1d){while(--_0x2d1f1d){_0x18d1ed['push'](_0x18d1ed['shift']());}};_0x1a7ad8(++_0x55655d);}(_0x4443,0xb7));var _0x3444=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4443[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3444('0x0'));var zipdir=require(_0x3444('0x1'));var jsonpatch=require(_0x3444('0x2'));var rp=require(_0x3444('0x3'));var moment=require(_0x3444('0x4'));var BPromise=require(_0x3444('0x5'));var Mustache=require(_0x3444('0x6'));var util=require(_0x3444('0x7'));var path=require(_0x3444('0x8'));var sox=require(_0x3444('0x9'));var csv=require(_0x3444('0xa'));var ejs=require(_0x3444('0xb'));var fs=require('fs');var fs_extra=require(_0x3444('0xc'));var _=require(_0x3444('0xd'));var squel=require(_0x3444('0xe'));var crypto=require(_0x3444('0xf'));var jsforce=require(_0x3444('0x10'));var deskjs=require(_0x3444('0x11'));var toCsv=require(_0x3444('0xa'));var querystring=require('querystring');var Papa=require(_0x3444('0x12'));var Redis=require(_0x3444('0x13'));var authService=require(_0x3444('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3444('0x15'));var logger=require(_0x3444('0x16'))('api');var utils=require(_0x3444('0x17'));var config=require(_0x3444('0x18'));var licenseUtil=require(_0x3444('0x19'));var db=require(_0x3444('0x1a'))['db'];function respondWithStatusCode(_0x34642b,_0x2b1d7a){_0x2b1d7a=_0x2b1d7a||0xcc;return function(_0x54c6c9){if(_0x54c6c9){return _0x34642b[_0x3444('0x1b')](_0x2b1d7a);}return _0x34642b[_0x3444('0x1c')](_0x2b1d7a)[_0x3444('0x1d')]();};}function respondWithResult(_0x50940b,_0x5adc3f){_0x5adc3f=_0x5adc3f||0xc8;return function(_0x569b44){if(_0x569b44){return _0x50940b[_0x3444('0x1c')](_0x5adc3f)[_0x3444('0x1e')](_0x569b44);}};}function respondWithFilteredResult(_0x33b589,_0xfa1652){return function(_0x21bc21){if(_0x21bc21){var _0xd0d7d9=typeof _0xfa1652[_0x3444('0x1f')]===_0x3444('0x20')&&typeof _0xfa1652[_0x3444('0x21')]===_0x3444('0x20');var _0x5d97b6=_0x21bc21[_0x3444('0x22')];var _0x32500e=_0xd0d7d9?0x0:_0xfa1652[_0x3444('0x1f')];var _0x2b7547=_0xd0d7d9?_0x21bc21[_0x3444('0x22')]:_0xfa1652['offset']+_0xfa1652[_0x3444('0x21')];var _0x5d18ca;if(_0x2b7547>=_0x5d97b6){_0x2b7547=_0x5d97b6;_0x5d18ca=0xc8;}else{_0x5d18ca=0xce;}_0x33b589[_0x3444('0x1c')](_0x5d18ca);return _0x33b589['set'](_0x3444('0x23'),_0x32500e+'-'+_0x2b7547+'/'+_0x5d97b6)['json'](_0x21bc21);}return null;};}function patchUpdates(_0x5beddd){return function(_0x431fa3){try{jsonpatch[_0x3444('0x24')](_0x431fa3,_0x5beddd,!![]);}catch(_0x769146){return BPromise['reject'](_0x769146);}return _0x431fa3[_0x3444('0x25')]();};}function saveUpdates(_0x23d8c6,_0x40acd5){return function(_0x2c6e2f){if(_0x2c6e2f){return _0x2c6e2f['update'](_0x23d8c6)[_0x3444('0x26')](function(_0x561785){return _0x561785;});}return null;};}function removeEntity(_0x592297,_0x5079d0){return function(_0x5cc72b){if(_0x5cc72b){return _0x5cc72b[_0x3444('0x27')]()[_0x3444('0x26')](function(){_0x592297[_0x3444('0x1c')](0xcc)[_0x3444('0x1d')]();});}};}function handleEntityNotFound(_0x484b26,_0x386dff){return function(_0x4a4a98){if(!_0x4a4a98){_0x484b26[_0x3444('0x1b')](0x194);}return _0x4a4a98;};}function handleError(_0xe0a787,_0x2c4bbc){_0x2c4bbc=_0x2c4bbc||0x1f4;return function(_0x74508e){logger[_0x3444('0x28')](_0x74508e[_0x3444('0x29')]);if(_0x74508e[_0x3444('0x2a')]){delete _0x74508e['name'];}_0xe0a787[_0x3444('0x1c')](_0x2c4bbc)[_0x3444('0x2b')](_0x74508e);};}exports[_0x3444('0x2c')]=function(_0x34bb8b,_0x27e485){var _0x330bfb={},_0x3a02c8={},_0x269367={'count':0x0,'rows':[]};var _0x2abd0c=_[_0x3444('0x2d')](db['FaxApplication'][_0x3444('0x2e')],function(_0x5bf703){return{'name':_0x5bf703[_0x3444('0x2f')],'type':_0x5bf703[_0x3444('0x30')][_0x3444('0x31')]};});_0x3a02c8[_0x3444('0x32')]=_[_0x3444('0x2d')](_0x2abd0c,'name');_0x3a02c8[_0x3444('0x33')]=_[_0x3444('0x34')](_0x34bb8b['query']);_0x3a02c8['filters']=_['intersection'](_0x3a02c8['model'],_0x3a02c8[_0x3444('0x33')]);_0x330bfb['attributes']=_[_0x3444('0x35')](_0x3a02c8[_0x3444('0x32')],qs['fields'](_0x34bb8b[_0x3444('0x33')][_0x3444('0x36')]));_0x330bfb['attributes']=_0x330bfb[_0x3444('0x37')][_0x3444('0x38')]?_0x330bfb[_0x3444('0x37')]:_0x3a02c8['model'];if(!_0x34bb8b[_0x3444('0x33')]['hasOwnProperty'](_0x3444('0x39'))){_0x330bfb[_0x3444('0x21')]=qs[_0x3444('0x21')](_0x34bb8b[_0x3444('0x33')][_0x3444('0x21')]);_0x330bfb[_0x3444('0x1f')]=qs['offset'](_0x34bb8b[_0x3444('0x33')][_0x3444('0x1f')]);}_0x330bfb[_0x3444('0x3a')]=qs['sort'](_0x34bb8b['query']['sort']);_0x330bfb['where']=qs['filters'](_[_0x3444('0x3b')](_0x34bb8b['query'],_0x3a02c8[_0x3444('0x3c')]),_0x2abd0c);if(_0x34bb8b['query']['filter']){_0x330bfb[_0x3444('0x3d')]=_[_0x3444('0x3e')](_0x330bfb[_0x3444('0x3d')],{'$or':_[_0x3444('0x2d')](_0x2abd0c,function(_0x2eb2d3){if(_0x2eb2d3[_0x3444('0x30')]!==_0x3444('0x3f')){var _0x51074b={};_0x51074b[_0x2eb2d3[_0x3444('0x2a')]]={'$like':'%'+_0x34bb8b['query'][_0x3444('0x40')]+'%'};return _0x51074b;}})});}_0x330bfb=_[_0x3444('0x3e')]({},_0x330bfb,_0x34bb8b['options']);var _0x1c550e={'where':_0x330bfb[_0x3444('0x3d')]};return db[_0x3444('0x41')][_0x3444('0x22')](_0x1c550e)[_0x3444('0x26')](function(_0x181258){_0x269367[_0x3444('0x22')]=_0x181258;if(_0x34bb8b[_0x3444('0x33')]['includeAll']){_0x330bfb[_0x3444('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x3444('0x43')](_0x330bfb);})[_0x3444('0x26')](function(_0x492130){_0x269367[_0x3444('0x44')]=_0x492130;return _0x269367;})[_0x3444('0x26')](respondWithFilteredResult(_0x27e485,_0x330bfb))[_0x3444('0x45')](handleError(_0x27e485,null));};exports[_0x3444('0x46')]=function(_0x49f99c,_0x121f8d){var _0x1a0ec5={'raw':!![],'where':{'id':_0x49f99c['params']['id']}},_0x52ecc7={};_0x52ecc7[_0x3444('0x32')]=_[_0x3444('0x34')](db[_0x3444('0x41')][_0x3444('0x2e')]);_0x52ecc7[_0x3444('0x33')]=_[_0x3444('0x34')](_0x49f99c[_0x3444('0x33')]);_0x52ecc7['filters']=_['intersection'](_0x52ecc7[_0x3444('0x32')],_0x52ecc7[_0x3444('0x33')]);_0x1a0ec5['attributes']=_[_0x3444('0x35')](_0x52ecc7['model'],qs[_0x3444('0x36')](_0x49f99c[_0x3444('0x33')][_0x3444('0x36')]));_0x1a0ec5['attributes']=_0x1a0ec5[_0x3444('0x37')][_0x3444('0x38')]?_0x1a0ec5['attributes']:_0x52ecc7[_0x3444('0x32')];if(_0x49f99c[_0x3444('0x33')][_0x3444('0x47')]){_0x1a0ec5['include']=[{'all':!![]}];}_0x1a0ec5=_[_0x3444('0x3e')]({},_0x1a0ec5,_0x49f99c[_0x3444('0x48')]);return db['FaxApplication'][_0x3444('0x49')](_0x1a0ec5)['then'](handleEntityNotFound(_0x121f8d,null))['then'](respondWithResult(_0x121f8d,null))[_0x3444('0x45')](handleError(_0x121f8d,null));};exports['create']=function(_0x376d24,_0x4824d5){return db[_0x3444('0x41')][_0x3444('0x4a')](_0x376d24[_0x3444('0x4b')],{})[_0x3444('0x26')](respondWithResult(_0x4824d5,0xc9))['catch'](handleError(_0x4824d5,null));};exports[_0x3444('0x4c')]=function(_0x2e3471,_0x4fb208){if(_0x2e3471[_0x3444('0x4b')]['id']){delete _0x2e3471[_0x3444('0x4b')]['id'];}return db[_0x3444('0x41')]['find']({'where':{'id':_0x2e3471[_0x3444('0x4d')]['id']}})[_0x3444('0x26')](handleEntityNotFound(_0x4fb208,null))[_0x3444('0x26')](saveUpdates(_0x2e3471['body'],null))[_0x3444('0x26')](respondWithResult(_0x4fb208,null))['catch'](handleError(_0x4fb208,null));};exports['destroy']=function(_0x38c946,_0x248d22){return db[_0x3444('0x41')][_0x3444('0x49')]({'where':{'id':_0x38c946['params']['id']}})[_0x3444('0x26')](handleEntityNotFound(_0x248d22,null))['then'](removeEntity(_0x248d22,null))['catch'](handleError(_0x248d22,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7d1ba71..921685c 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 _0xd6c5=['./faxApplication.attributes','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd6c5,0x164));var _0x5d6c=function(_0x16a731,_0x217dbd){_0x16a731=_0x16a731-0x0;var _0x58cb23=_0xd6c5[_0x16a731];return _0x58cb23;};'use strict';var _=require('lodash');var util=require(_0x5d6c('0x0'));var logger=require(_0x5d6c('0x1'))(_0x5d6c('0x2'));var moment=require(_0x5d6c('0x3'));var BPromise=require(_0x5d6c('0x4'));var rp=require(_0x5d6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d6c('0x6'));var config=require(_0x5d6c('0x7'));var attributes=require(_0x5d6c('0x8'));module['exports']=function(_0x9d948d,_0x363b83){return _0x9d948d['define'](_0x5d6c('0x9'),attributes,{'tableName':_0x5d6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d6c('0xb'),'collate':_0x5d6c('0xc')});}; \ No newline at end of file +var _0x45aa=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications'];(function(_0x36aad0,_0x3d2e17){var _0x31e987=function(_0x2d0fe4){while(--_0x2d0fe4){_0x36aad0['push'](_0x36aad0['shift']());}};_0x31e987(++_0x3d2e17);}(_0x45aa,0x192));var _0xa45a=function(_0x2305f6,_0x2ba699){_0x2305f6=_0x2305f6-0x0;var _0x1f6e3a=_0x45aa[_0x2305f6];return _0x1f6e3a;};'use strict';var _=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var logger=require(_0xa45a('0x2'))(_0xa45a('0x3'));var moment=require(_0xa45a('0x4'));var BPromise=require(_0xa45a('0x5'));var rp=require(_0xa45a('0x6'));var fs=require('fs');var path=require(_0xa45a('0x7'));var rimraf=require(_0xa45a('0x8'));var config=require(_0xa45a('0x9'));var attributes=require(_0xa45a('0xa'));module[_0xa45a('0xb')]=function(_0x5a8ce2,_0x25d4b2){return _0x5a8ce2[_0xa45a('0xc')]('FaxApplication',attributes,{'tableName':_0xa45a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa45a('0xe'),'collate':_0xa45a('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 283622c..c487fb2 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 _0x3aaf=['update','options','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateFaxApplication','FaxApplication'];(function(_0x18f32c,_0x4ab1e9){var _0x49033b=function(_0x2d2bc3){while(--_0x2d2bc3){_0x18f32c['push'](_0x18f32c['shift']());}};_0x49033b(++_0x4ab1e9);}(_0x3aaf,0x162));var _0xf3aa=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x3aaf[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xf3aa('0x0'));var util=require(_0xf3aa('0x1'));var moment=require(_0xf3aa('0x2'));var BPromise=require(_0xf3aa('0x3'));var rs=require(_0xf3aa('0x4'));var fs=require('fs');var Redis=require(_0xf3aa('0x5'));var db=require(_0xf3aa('0x6'))['db'];var utils=require(_0xf3aa('0x7'));var logger=require(_0xf3aa('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3aa('0x9')][_0xf3aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x133b01,_0x235c29,_0x5759f5){return new BPromise(function(_0x47b60d,_0x1a0200){return client['request'](_0x133b01,_0x5759f5)[_0xf3aa('0xb')](function(_0xa99096){logger[_0xf3aa('0xc')](_0xf3aa('0xd'),_0x235c29,'request\x20sent');logger[_0xf3aa('0xe')](_0xf3aa('0xf'),_0x235c29,_0xf3aa('0x10'),JSON['stringify'](_0xa99096));if(_0xa99096['error']){if(_0xa99096[_0xf3aa('0x11')]['code']===0x1f4){logger[_0xf3aa('0x11')](_0xf3aa('0xd'),_0x235c29,_0xa99096[_0xf3aa('0x11')]['message']);return _0x1a0200(_0xa99096['error'][_0xf3aa('0x12')]);}logger[_0xf3aa('0x11')]('FaxApplication,\x20%s,\x20%s',_0x235c29,_0xa99096['error'][_0xf3aa('0x12')]);return _0x47b60d(_0xa99096['error'][_0xf3aa('0x12')]);}else{logger['info'](_0xf3aa('0xd'),_0x235c29,_0xf3aa('0x10'));_0x47b60d(_0xa99096[_0xf3aa('0x13')]['message']);}})[_0xf3aa('0x14')](function(_0x16d5c9){logger[_0xf3aa('0x11')]('FaxApplication,\x20%s,\x20%s',_0x235c29,_0x16d5c9);_0x1a0200(_0x16d5c9);});});}exports[_0xf3aa('0x15')]=function(_0x5add43){var _0x5c209f=this;return new Promise(function(_0x11a600,_0x1d1411){return db[_0xf3aa('0x16')][_0xf3aa('0x17')](_0x5add43['body'],{'raw':_0x5add43['options']?_0x5add43['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5add43['options']?_0x5add43[_0xf3aa('0x18')][_0xf3aa('0x19')]||null:null,'attributes':_0x5add43['options']?_0x5add43[_0xf3aa('0x18')][_0xf3aa('0x1a')]||null:null,'limit':_0x5add43[_0xf3aa('0x18')]?_0x5add43[_0xf3aa('0x18')][_0xf3aa('0x1b')]||null:null})['then'](function(_0x23b352){logger[_0xf3aa('0xc')](_0xf3aa('0x15'),_0x5add43);logger['debug'](_0xf3aa('0x15'),_0x5add43,JSON[_0xf3aa('0x1c')](_0x23b352));_0x11a600(_0x23b352);})[_0xf3aa('0x14')](function(_0x4bfe21){logger[_0xf3aa('0x11')](_0xf3aa('0x15'),_0x4bfe21[_0xf3aa('0x12')],_0x5add43);_0x1d1411(_0x5c209f[_0xf3aa('0x11')](0x1f4,_0x4bfe21[_0xf3aa('0x12')]));});});}; \ No newline at end of file +var _0xe0bf=['result','catch','UpdateFaxApplication','update','body','options','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f1cd6,_0x179fad){var _0x2e9418=function(_0x546a56){while(--_0x546a56){_0x1f1cd6['push'](_0x1f1cd6['shift']());}};_0x2e9418(++_0x179fad);}(_0xe0bf,0x1e9));var _0xfe0b=function(_0x493719,_0x47bd36){_0x493719=_0x493719-0x0;var _0x5db50e=_0xe0bf[_0x493719];return _0x5db50e;};'use strict';var _=require(_0xfe0b('0x0'));var util=require(_0xfe0b('0x1'));var moment=require(_0xfe0b('0x2'));var BPromise=require(_0xfe0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe0b('0x5'));var logger=require(_0xfe0b('0x6'))('rpc');var config=require(_0xfe0b('0x7'));var jayson=require(_0xfe0b('0x8'));var client=jayson[_0xfe0b('0x9')][_0xfe0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11756e,_0xf7a72b,_0x1e176e){return new BPromise(function(_0xcac106,_0x1536a2){return client[_0xfe0b('0xb')](_0x11756e,_0x1e176e)[_0xfe0b('0xc')](function(_0x1ae0f4){logger[_0xfe0b('0xd')](_0xfe0b('0xe'),_0xf7a72b,_0xfe0b('0xf'));logger[_0xfe0b('0x10')](_0xfe0b('0x11'),_0xf7a72b,_0xfe0b('0xf'),JSON['stringify'](_0x1ae0f4));if(_0x1ae0f4[_0xfe0b('0x12')]){if(_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x13')]===0x1f4){logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x14')]);return _0x1536a2(_0x1ae0f4[_0xfe0b('0x12')]['message']);}logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x14')]);return _0xcac106(_0x1ae0f4['error']['message']);}else{logger[_0xfe0b('0xd')]('FaxApplication,\x20%s,\x20%s',_0xf7a72b,_0xfe0b('0xf'));_0xcac106(_0x1ae0f4[_0xfe0b('0x15')]['message']);}})[_0xfe0b('0x16')](function(_0x3ca137){logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x3ca137);_0x1536a2(_0x3ca137);});});}exports[_0xfe0b('0x17')]=function(_0x230b11){var _0xa1fd46=this;return new Promise(function(_0x21edda,_0x4804ff){return db['FaxApplication'][_0xfe0b('0x18')](_0x230b11[_0xfe0b('0x19')],{'raw':_0x230b11['options']?_0x230b11[_0xfe0b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x230b11[_0xfe0b('0x1a')]?_0x230b11['options']['where']||null:null,'attributes':_0x230b11[_0xfe0b('0x1a')]?_0x230b11[_0xfe0b('0x1a')][_0xfe0b('0x1b')]||null:null,'limit':_0x230b11[_0xfe0b('0x1a')]?_0x230b11[_0xfe0b('0x1a')][_0xfe0b('0x1c')]||null:null})[_0xfe0b('0xc')](function(_0x3642cb){logger[_0xfe0b('0xd')](_0xfe0b('0x17'),_0x230b11);logger[_0xfe0b('0x10')](_0xfe0b('0x17'),_0x230b11,JSON[_0xfe0b('0x1d')](_0x3642cb));_0x21edda(_0x3642cb);})[_0xfe0b('0x16')](function(_0x4a4304){logger[_0xfe0b('0x12')](_0xfe0b('0x17'),_0x4a4304['message'],_0x230b11);_0x4804ff(_0xa1fd46[_0xfe0b('0x12')](0x1f4,_0x4a4304[_0xfe0b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 044029f..c10d70e 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 _0x2547=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','update'];(function(_0xa36c4d,_0x12d21c){var _0x405afc=function(_0x283948){while(--_0x283948){_0xa36c4d['push'](_0xa36c4d['shift']());}};_0x405afc(++_0x12d21c);}(_0x2547,0x1cd));var _0x7254=function(_0x3e8058,_0x1a49e5){_0x3e8058=_0x3e8058-0x0;var _0x1028ea=_0x2547[_0x3e8058];return _0x1028ea;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['post']('/',auth[_0x7254('0xa')](),controller['create']);router['put']('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0xe')]);router[_0x7254('0xf')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index fba8e08..6882d2d 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 _0x999e=['ENUM','out','exports','DATE','STRING'];(function(_0x4d7bd9,_0x167a31){var _0x64176b=function(_0x361000){while(--_0x361000){_0x4d7bd9['push'](_0x4d7bd9['shift']());}};_0x64176b(++_0x167a31);}(_0x999e,0x9d));var _0xe999=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x999e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe999('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe999('0x1')]},'disposition':{'type':Sequelize[_0xe999('0x2')]},'secondDisposition':{'type':Sequelize[_0xe999('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe999('0x2')]},'read1stAt':{'type':Sequelize[_0xe999('0x1')]},'fax':{'type':Sequelize[_0xe999('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xe999('0x3')]('in',_0xe999('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe999('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7eb1=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x7eb1,0x84));var _0x17eb=function(_0x3c8c38,_0x277bc6){_0x3c8c38=_0x3c8c38-0x0;var _0x1edcab=_0x7eb1[_0x3c8c38];return _0x1edcab;};'use strict';var Sequelize=require(_0x17eb('0x0'));module[_0x17eb('0x1')]={'closed':{'type':Sequelize[_0x17eb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x17eb('0x3')]},'disposition':{'type':Sequelize[_0x17eb('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x17eb('0x4')]},'note':{'type':Sequelize[_0x17eb('0x4')]},'read1stAt':{'type':Sequelize[_0x17eb('0x3')]},'fax':{'type':Sequelize[_0x17eb('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x17eb('0x5')]('in',_0x17eb('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x17eb('0x5')]('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 88b1329..117d7a0 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 _0x18ff=['error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','fax','query','user','catch','model','FaxInteraction','keys','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','FaxMessage','ids','omit','findOne','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end'];(function(_0x216ddd,_0x4550ce){var _0x3e090c=function(_0x4f6fa3){while(--_0x4f6fa3){_0x216ddd['push'](_0x216ddd['shift']());}};_0x3e090c(++_0x4550ce);}(_0x18ff,0x18c));var _0xf18f=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x18ff[_0x55f8b4];return _0x2475f9;};'use strict';var rimraf=require(_0xf18f('0x0'));var zipdir=require(_0xf18f('0x1'));var moment=require('moment');var BPromise=require(_0xf18f('0x2'));var util=require('util');var path=require(_0xf18f('0x3'));var fs=require('fs');var _=require(_0xf18f('0x4'));var Redis=require(_0xf18f('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xf18f('0x6'));var logger=require(_0xf18f('0x7'))(_0xf18f('0x8'));var config=require(_0xf18f('0x9'));var db=require(_0xf18f('0xa'))['db'];config[_0xf18f('0xb')]=_['defaults'](config[_0xf18f('0xb')],{'host':_0xf18f('0xc'),'port':0x18eb});var socket=require(_0xf18f('0xd'))(new Redis(config[_0xf18f('0xb')]));require(_0xf18f('0xe'))[_0xf18f('0xf')](socket);function respondWithStatusCode(_0x3dcb30,_0x53af17){_0x53af17=_0x53af17||0xcc;return function(_0x3e5e0c){if(_0x3e5e0c){return _0x3dcb30[_0xf18f('0x10')](_0x53af17);}return _0x3dcb30['status'](_0x53af17)['end']();};}function respondWithResult(_0x10c7a4,_0x597941){_0x597941=_0x597941||0xc8;return function(_0x3f7e61){if(_0x3f7e61){return _0x10c7a4[_0xf18f('0x11')](_0x597941)[_0xf18f('0x12')](_0x3f7e61);}};}function respondWithFilteredResult(_0x4b1165,_0x485518){return function(_0x377c60){if(_0x377c60){var _0x3555ce=typeof _0x485518[_0xf18f('0x13')]==='undefined'&&typeof _0x485518[_0xf18f('0x14')]===_0xf18f('0x15');var _0x45b5b6=_0x377c60[_0xf18f('0x16')];var _0x59fbf4=_0x3555ce?0x0:_0x485518[_0xf18f('0x13')];var _0x397171=_0x3555ce?_0x377c60[_0xf18f('0x16')]:_0x485518[_0xf18f('0x13')]+_0x485518[_0xf18f('0x14')];var _0x11f69a;if(_0x397171>=_0x45b5b6){_0x397171=_0x45b5b6;_0x11f69a=0xc8;}else{_0x11f69a=0xce;}_0x4b1165[_0xf18f('0x11')](_0x11f69a);return _0x4b1165[_0xf18f('0x17')](_0xf18f('0x18'),_0x59fbf4+'-'+_0x397171+'/'+_0x45b5b6)[_0xf18f('0x12')](_0x377c60);}return null;};}function saveUpdates(_0x331610){return function(_0x2b0c48){if(_0x2b0c48){return _0x2b0c48['update'](_0x331610)[_0xf18f('0x19')](function(_0x484dc7){return _0x484dc7;});}return null;};}function removeEntity(_0x201b02){return function(_0x308d09){if(_0x308d09){return _0x308d09[_0xf18f('0x1a')]()[_0xf18f('0x19')](function(){_0x201b02['status'](0xcc)[_0xf18f('0x1b')]();});}};}function handleEntityNotFound(_0x4d65ee){return function(_0x245c9a){if(!_0x245c9a){_0x4d65ee[_0xf18f('0x10')](0x194);}return _0x245c9a;};}function handleError(_0x18ea38,_0x25494e){_0x25494e=_0x25494e||0x1f4;return function(_0x2e8637){logger[_0xf18f('0x1c')](_0x2e8637['stack']);if(_0x2e8637[_0xf18f('0x1d')]){delete _0x2e8637[_0xf18f('0x1d')];}_0x18ea38['status'](_0x25494e)[_0xf18f('0x1e')](_0x2e8637);};}exports[_0xf18f('0x1f')]=function(_0x1e4e09,_0x491ce2){var _0x8ee03={};var _0x23154c=_[_0xf18f('0x20')](db['FaxInteraction'][_0xf18f('0x21')],function(_0x52fe44){return{'name':_0x52fe44[_0xf18f('0x22')],'type':_0x52fe44[_0xf18f('0x23')][_0xf18f('0x24')]};});_0x8ee03=qs[_0xf18f('0x25')](_0x23154c,_0x1e4e09);return interaction['findAll'](_0xf18f('0x26'),_0x1e4e09[_0xf18f('0x27')],_0x1e4e09[_0xf18f('0x28')],_0x8ee03,_0x23154c)[_0xf18f('0x19')](respondWithFilteredResult(_0x491ce2,_0x8ee03))[_0xf18f('0x29')](handleError(_0x491ce2,null));};exports['show']=function(_0x115fe5,_0x5ea904){var _0x1c8ed9={'raw':![],'where':{'id':_0x115fe5['params']['id']}},_0x1544a4={};_0x1544a4[_0xf18f('0x2a')]=_['keys'](db[_0xf18f('0x2b')][_0xf18f('0x21')]);_0x1544a4[_0xf18f('0x27')]=_[_0xf18f('0x2c')](_0x115fe5['query']);_0x1544a4['filters']=_[_0xf18f('0x2d')](_0x1544a4[_0xf18f('0x2a')],_0x1544a4['query']);_0x1c8ed9[_0xf18f('0x2e')]=_['intersection'](_0x1544a4['model'],qs[_0xf18f('0x2f')](_0x115fe5['query'][_0xf18f('0x2f')]));_0x1c8ed9['attributes']=_0x1c8ed9['attributes']['length']?_0x1c8ed9[_0xf18f('0x2e')]:_0x1544a4[_0xf18f('0x2a')];if(_0x115fe5[_0xf18f('0x27')][_0xf18f('0x30')]){_0x1c8ed9[_0xf18f('0x31')]=[{'all':!![]}];}_0x1c8ed9=_[_0xf18f('0x32')]({},_0x1c8ed9,_0x115fe5[_0xf18f('0x33')]);return db[_0xf18f('0x2b')][_0xf18f('0x34')](_0x1c8ed9)[_0xf18f('0x19')](handleEntityNotFound(_0x5ea904,null))[_0xf18f('0x19')](respondWithResult(_0x5ea904,null))['catch'](handleError(_0x5ea904,null));};exports[_0xf18f('0x35')]=function(_0x4598ed,_0x14a0bb){return db['FaxInteraction'][_0xf18f('0x35')](_0x4598ed[_0xf18f('0x36')],{})[_0xf18f('0x19')](respondWithResult(_0x14a0bb,0xc9))[_0xf18f('0x29')](handleError(_0x14a0bb,null));};exports[_0xf18f('0x37')]=function(_0x347672,_0x51bdbf){if(_0x347672[_0xf18f('0x36')]['id']){delete _0x347672['body']['id'];}return db['FaxInteraction'][_0xf18f('0x34')]({'where':{'id':_0x347672[_0xf18f('0x38')]['id']}})[_0xf18f('0x19')](handleEntityNotFound(_0x51bdbf,null))[_0xf18f('0x19')](saveUpdates(_0x347672[_0xf18f('0x36')],null))[_0xf18f('0x19')](respondWithResult(_0x51bdbf,null))[_0xf18f('0x29')](handleError(_0x51bdbf,null));};exports[_0xf18f('0x1a')]=function(_0x1697ee,_0x10f9ae){return db[_0xf18f('0x2b')][_0xf18f('0x34')]({'where':{'id':_0x1697ee[_0xf18f('0x38')]['id']}})[_0xf18f('0x19')](handleEntityNotFound(_0x10f9ae,null))[_0xf18f('0x19')](removeEntity(_0x10f9ae,null))[_0xf18f('0x29')](handleError(_0x10f9ae,null));};exports[_0xf18f('0x39')]=function(_0x4ebc28,_0x3acdc3){return db['FaxInteraction']['describe']()[_0xf18f('0x19')](respondWithResult(_0x3acdc3,null))[_0xf18f('0x29')](handleError(_0x3acdc3,null));};exports[_0xf18f('0x3a')]=function(_0x2756f7,_0x3d9f7c){return db[_0xf18f('0x3b')]['find']({'where':{'id':_0x2756f7['params']['id']}})['then'](handleEntityNotFound(_0x3d9f7c,null))[_0xf18f('0x19')](function(_0x15d239){if(_0x15d239){return _0x15d239['addMessage'](_0x2756f7[_0xf18f('0x36')][_0xf18f('0x3c')],_[_0xf18f('0x3d')](_0x2756f7[_0xf18f('0x36')],[_0xf18f('0x3c'),'id'])||{});}})[_0xf18f('0x19')](respondWithResult(_0x3d9f7c,null))[_0xf18f('0x29')](handleError(_0x3d9f7c,null));};exports['getMessages']=function(_0x4ce1d4,_0x306d35){var _0x18c8dd={'raw':![],'where':{}};var _0x510149={};var _0x4445d4={'count':0x0,'rows':[]};return db[_0xf18f('0x2b')][_0xf18f('0x3e')]({'where':{'id':_0x4ce1d4['params']['id']}})[_0xf18f('0x19')](handleEntityNotFound(_0x306d35,null))['then'](function(_0x9b3034){if(_0x9b3034){_0x510149['model']=_[_0xf18f('0x2c')](db[_0xf18f('0x3b')]['rawAttributes']);_0x510149[_0xf18f('0x27')]=_[_0xf18f('0x2c')](_0x4ce1d4['query']);_0x510149['filters']=_[_0xf18f('0x2d')](_0x510149['model'],_0x510149[_0xf18f('0x27')]);_0x18c8dd[_0xf18f('0x2e')]=_[_0xf18f('0x2d')](_0x510149[_0xf18f('0x2a')],qs[_0xf18f('0x2f')](_0x4ce1d4['query'][_0xf18f('0x2f')]));_0x18c8dd['attributes']=_0x18c8dd['attributes'][_0xf18f('0x3f')]?_0x18c8dd[_0xf18f('0x2e')]:_0x510149[_0xf18f('0x2a')];if(!_0x4ce1d4[_0xf18f('0x27')][_0xf18f('0x40')](_0xf18f('0x41'))){_0x18c8dd['limit']=qs[_0xf18f('0x14')](_0x4ce1d4[_0xf18f('0x27')][_0xf18f('0x14')]);_0x18c8dd[_0xf18f('0x13')]=qs['offset'](_0x4ce1d4[_0xf18f('0x27')][_0xf18f('0x13')]);}_0x18c8dd[_0xf18f('0x42')]=qs['sort'](_0x4ce1d4[_0xf18f('0x27')][_0xf18f('0x43')]);_0x18c8dd['where']=qs[_0xf18f('0x44')](_[_0xf18f('0x45')](_0x4ce1d4[_0xf18f('0x27')],_0x510149[_0xf18f('0x44')]));_0x18c8dd[_0xf18f('0x46')]['FaxInteractionId']=_0x9b3034['id'];if(_0x4ce1d4[_0xf18f('0x27')]['filter']){_0x18c8dd[_0xf18f('0x46')]=_[_0xf18f('0x32')](_0x18c8dd[_0xf18f('0x46')],{'$or':_['map'](_0x18c8dd[_0xf18f('0x2e')],function(_0x14cb7a){var _0x217a1a={};_0x217a1a[_0x14cb7a]={'$like':'%'+_0x4ce1d4['query'][_0xf18f('0x47')]+'%'};return _0x217a1a;})});}if(_0x4ce1d4[_0xf18f('0x27')]['$gte']){var _0xf2d956=_0x4ce1d4['query']['$gte'][_0xf18f('0x48')](',');var _0x10ee02={};_0x10ee02[_0xf2d956[0x0]]={'$gte':moment(_0xf2d956[0x1])[_0xf18f('0x49')](_0xf18f('0x4a'))};_0x18c8dd[_0xf18f('0x46')]=_[_0xf18f('0x32')](_0x18c8dd[_0xf18f('0x46')],_0x10ee02);}_0x18c8dd=_[_0xf18f('0x32')]({},_0x18c8dd,_0x4ce1d4[_0xf18f('0x33')]);return db[_0xf18f('0x3b')][_0xf18f('0x16')]({'where':_0x18c8dd['where']})[_0xf18f('0x19')](function(_0x4aa238){_0x4445d4[_0xf18f('0x16')]=_0x4aa238;if(_0x4ce1d4[_0xf18f('0x27')][_0xf18f('0x30')]){_0x18c8dd['include']=[{'all':!![]}];}return db[_0xf18f('0x3b')][_0xf18f('0x4b')](_0x18c8dd);})[_0xf18f('0x19')](function(_0x2d41d9){_0x4445d4[_0xf18f('0x4c')]=_0x2d41d9;return _0x4445d4;});}})[_0xf18f('0x19')](respondWithFilteredResult(_0x306d35,_0x18c8dd))[_0xf18f('0x29')](handleError(_0x306d35,null));};exports[_0xf18f('0x4d')]=function(_0x988c2e,_0x36936b){return db[_0xf18f('0x2b')]['find']({'where':{'id':_0x988c2e['params']['id']}})[_0xf18f('0x19')](handleEntityNotFound(_0x36936b,null))['then'](function(_0xcc0589){if(_0xcc0589){return _0xcc0589[_0xf18f('0x4e')](_0x988c2e[_0xf18f('0x36')]['ids'],_[_0xf18f('0x3d')](_0x988c2e[_0xf18f('0x36')],[_0xf18f('0x3c'),'id'])||{})[_0xf18f('0x4f')](function(){return db[_0xf18f('0x50')][_0xf18f('0x4b')]({'attributes':['id',_0xf18f('0x1d'),_0xf18f('0x51')],'where':{'id':_0x988c2e[_0xf18f('0x36')][_0xf18f('0x3c')]}});})[_0xf18f('0x19')](function(_0x3d2076){socket[_0xf18f('0x52')](_0xf18f('0x53'),{'id':Number(_0x988c2e[_0xf18f('0x38')]['id']),'tags':_0x3d2076||[]});return{'id':Number(_0x988c2e[_0xf18f('0x38')]['id']),'tags':_0x3d2076||[]};});}})[_0xf18f('0x19')](respondWithResult(_0x36936b,null))[_0xf18f('0x29')](handleError(_0x36936b,null));};exports[_0xf18f('0x54')]=function(_0x4c5877,_0x5f1209){return db[_0xf18f('0x2b')][_0xf18f('0x34')]({'where':{'id':_0x4c5877[_0xf18f('0x38')]['id']}})[_0xf18f('0x19')](handleEntityNotFound(_0x5f1209,null))[_0xf18f('0x19')](function(_0x71eacf){if(_0x71eacf){return _0x71eacf[_0xf18f('0x54')](_0x4c5877[_0xf18f('0x27')][_0xf18f('0x3c')]);}})[_0xf18f('0x19')](respondWithStatusCode(_0x5f1209,null))[_0xf18f('0x29')](handleError(_0x5f1209,null));};exports[_0xf18f('0x55')]=function(_0xf755d8,_0x3c79c5){var _0x1837ca=moment()[_0xf18f('0x56')]()[_0xf18f('0x57')]();var _0x1a108c=path[_0xf18f('0x58')](config[_0xf18f('0x59')],_0xf18f('0x5a'),_0xf18f('0x5b'),'tmp');var _0x452bb6=path[_0xf18f('0x58')](config['root'],_0xf18f('0x5a'),_0xf18f('0x5b'),'attachments');var _0x5a0a0a=path[_0xf18f('0x58')](_0x1a108c,_0x1837ca);var _0x48929a=util[_0xf18f('0x49')](_0xf18f('0x5c'),_0xf755d8[_0xf18f('0x38')]['id'],_0x1837ca);var _0x437917=path[_0xf18f('0x58')](_0x1a108c,_0x48929a);var _0x1ab98b=[];_0x1ab98b['push']({'model':db['Attachment'],'as':_0xf18f('0x5d'),'raw':!![]});var _0x1d92ae=[{'model':db[_0xf18f('0x3b')],'as':_0xf18f('0x5e'),'attributes':['id',_0xf18f('0x36'),_0xf18f('0x5f')],'include':_0x1ab98b}];return db[_0xf18f('0x2b')][_0xf18f('0x34')]({'where':{'id':_0xf755d8[_0xf18f('0x38')]['id']},'include':_0x1d92ae})['then'](handleEntityNotFound(_0x3c79c5,null))[_0xf18f('0x19')](function(_0x3978b7){if(_0x3978b7&&_0x3978b7[_0xf18f('0x5e')]){var _0x1dfc14=_0x3978b7[_0xf18f('0x60')]({'plain':!![]});fs[_0xf18f('0x61')](_0x5a0a0a);for(var _0x36bfb6=0x0;_0x36bfb6<_0x1dfc14[_0xf18f('0x5e')][_0xf18f('0x3f')];_0x36bfb6++){var _0x87977=_0x1dfc14[_0xf18f('0x5e')][_0x36bfb6]['Attachment'];if(_0x87977){var _0xfe1729=path[_0xf18f('0x58')](_0x452bb6,_0x87977[_0xf18f('0x62')]);if(fs[_0xf18f('0x63')](_0xfe1729)){fs[_0xf18f('0x64')](_0xfe1729)['pipe'](fs[_0xf18f('0x65')](path[_0xf18f('0x58')](_0x5a0a0a,_0x87977[_0xf18f('0x62')])));}}}return BPromise[_0xf18f('0x66')]()[_0xf18f('0x19')](function(){return new BPromise(function(_0x16ab3b,_0x1aa7d0){zipdir(_0x5a0a0a,{'saveTo':_0x437917},function(_0x42ce03,_0x4873cf){if(_0x42ce03)return _0x1aa7d0(_0x42ce03);return _0x16ab3b(_0x4873cf);});})[_0xf18f('0x19')](function(){return new BPromise(function(_0x477aa9,_0x28a86e){rimraf(_0x5a0a0a,function(_0x20bab7){if(_0x20bab7)_0x28a86e(_0x20bab7);return _0x477aa9();});});})[_0xf18f('0x19')](function(){return _0x3c79c5[_0xf18f('0x55')](_0x437917,_0x48929a,function(_0x31cd73){if(_0x31cd73){console[_0xf18f('0x67')](_0xf18f('0x68'),_0x31cd73);}else{fs[_0xf18f('0x69')](_0x437917);}});});});}else{return _0x3c79c5['sendStatus'](0xc8);}})[_0xf18f('0x29')](handleError(_0x3c79c5,null));}; \ No newline at end of file +var _0xb16f=['key','getOptions','query','user','catch','show','params','model','keys','FaxInteraction','filters','attributes','fields','length','includeAll','include','merge','find','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','update','then','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xb16f,0x118));var _0xfb16=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb16f[_0x278e3c];return _0x3e2d9b;};'use strict';var rimraf=require(_0xfb16('0x0'));var zipdir=require(_0xfb16('0x1'));var moment=require(_0xfb16('0x2'));var BPromise=require('bluebird');var util=require(_0xfb16('0x3'));var path=require(_0xfb16('0x4'));var fs=require('fs');var _=require(_0xfb16('0x5'));var Redis=require('ioredis');var interaction=require(_0xfb16('0x6'));var qs=require(_0xfb16('0x7'));var logger=require('../../config/logger')(_0xfb16('0x8'));var config=require(_0xfb16('0x9'));var db=require(_0xfb16('0xa'))['db'];config[_0xfb16('0xb')]=_['defaults'](config[_0xfb16('0xb')],{'host':_0xfb16('0xc'),'port':0x18eb});var socket=require(_0xfb16('0xd'))(new Redis(config[_0xfb16('0xb')]));require('./faxInteraction.socket')[_0xfb16('0xe')](socket);function respondWithStatusCode(_0x1a46e4,_0x318cb4){_0x318cb4=_0x318cb4||0xcc;return function(_0x1ed111){if(_0x1ed111){return _0x1a46e4[_0xfb16('0xf')](_0x318cb4);}return _0x1a46e4[_0xfb16('0x10')](_0x318cb4)[_0xfb16('0x11')]();};}function respondWithResult(_0x43213f,_0x43410e){_0x43410e=_0x43410e||0xc8;return function(_0x2594a4){if(_0x2594a4){return _0x43213f[_0xfb16('0x10')](_0x43410e)['json'](_0x2594a4);}};}function respondWithFilteredResult(_0x244481,_0x6c42aa){return function(_0x1645ca){if(_0x1645ca){var _0x2f44db=typeof _0x6c42aa['offset']===_0xfb16('0x12')&&typeof _0x6c42aa[_0xfb16('0x13')]==='undefined';var _0x4378e3=_0x1645ca['count'];var _0x17be64=_0x2f44db?0x0:_0x6c42aa[_0xfb16('0x14')];var _0x3c8ef0=_0x2f44db?_0x1645ca[_0xfb16('0x15')]:_0x6c42aa[_0xfb16('0x14')]+_0x6c42aa[_0xfb16('0x13')];var _0x1f2184;if(_0x3c8ef0>=_0x4378e3){_0x3c8ef0=_0x4378e3;_0x1f2184=0xc8;}else{_0x1f2184=0xce;}_0x244481[_0xfb16('0x10')](_0x1f2184);return _0x244481[_0xfb16('0x16')](_0xfb16('0x17'),_0x17be64+'-'+_0x3c8ef0+'/'+_0x4378e3)[_0xfb16('0x18')](_0x1645ca);}return null;};}function saveUpdates(_0x4a78f7){return function(_0x22b43c){if(_0x22b43c){return _0x22b43c[_0xfb16('0x19')](_0x4a78f7)[_0xfb16('0x1a')](function(_0x554ccc){return _0x554ccc;});}return null;};}function removeEntity(_0xa228a3){return function(_0x123e35){if(_0x123e35){return _0x123e35['destroy']()[_0xfb16('0x1a')](function(){_0xa228a3[_0xfb16('0x10')](0xcc)[_0xfb16('0x11')]();});}};}function handleEntityNotFound(_0x44957f){return function(_0x292f56){if(!_0x292f56){_0x44957f['sendStatus'](0x194);}return _0x292f56;};}function handleError(_0x25de08,_0xef2b0b){_0xef2b0b=_0xef2b0b||0x1f4;return function(_0x390b50){logger[_0xfb16('0x1b')](_0x390b50[_0xfb16('0x1c')]);if(_0x390b50[_0xfb16('0x1d')]){delete _0x390b50[_0xfb16('0x1d')];}_0x25de08[_0xfb16('0x10')](_0xef2b0b)[_0xfb16('0x1e')](_0x390b50);};}exports['index']=function(_0x2e9667,_0x45dd55){var _0x5709bd={};var _0x4a96b1=_[_0xfb16('0x1f')](db['FaxInteraction'][_0xfb16('0x20')],function(_0x254a43){return{'name':_0x254a43[_0xfb16('0x21')],'type':_0x254a43[_0xfb16('0x22')][_0xfb16('0x23')]};});_0x5709bd=qs[_0xfb16('0x24')](_0x4a96b1,_0x2e9667);return interaction['findAll']('fax',_0x2e9667[_0xfb16('0x25')],_0x2e9667[_0xfb16('0x26')],_0x5709bd,_0x4a96b1)['then'](respondWithFilteredResult(_0x45dd55,_0x5709bd))[_0xfb16('0x27')](handleError(_0x45dd55,null));};exports[_0xfb16('0x28')]=function(_0x2a3cc0,_0x17ec6b){var _0x137aab={'raw':![],'where':{'id':_0x2a3cc0[_0xfb16('0x29')]['id']}},_0x595851={};_0x595851[_0xfb16('0x2a')]=_[_0xfb16('0x2b')](db[_0xfb16('0x2c')][_0xfb16('0x20')]);_0x595851[_0xfb16('0x25')]=_[_0xfb16('0x2b')](_0x2a3cc0[_0xfb16('0x25')]);_0x595851[_0xfb16('0x2d')]=_['intersection'](_0x595851['model'],_0x595851[_0xfb16('0x25')]);_0x137aab[_0xfb16('0x2e')]=_['intersection'](_0x595851['model'],qs[_0xfb16('0x2f')](_0x2a3cc0[_0xfb16('0x25')][_0xfb16('0x2f')]));_0x137aab['attributes']=_0x137aab[_0xfb16('0x2e')][_0xfb16('0x30')]?_0x137aab[_0xfb16('0x2e')]:_0x595851[_0xfb16('0x2a')];if(_0x2a3cc0['query'][_0xfb16('0x31')]){_0x137aab[_0xfb16('0x32')]=[{'all':!![]}];}_0x137aab=_[_0xfb16('0x33')]({},_0x137aab,_0x2a3cc0['options']);return db['FaxInteraction'][_0xfb16('0x34')](_0x137aab)[_0xfb16('0x1a')](handleEntityNotFound(_0x17ec6b,null))[_0xfb16('0x1a')](respondWithResult(_0x17ec6b,null))[_0xfb16('0x27')](handleError(_0x17ec6b,null));};exports[_0xfb16('0x35')]=function(_0x5f5a53,_0x3375b8){return db[_0xfb16('0x2c')]['create'](_0x5f5a53['body'],{})['then'](respondWithResult(_0x3375b8,0xc9))[_0xfb16('0x27')](handleError(_0x3375b8,null));};exports[_0xfb16('0x19')]=function(_0x490efc,_0x2456dc){if(_0x490efc['body']['id']){delete _0x490efc[_0xfb16('0x36')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x490efc['params']['id']}})['then'](handleEntityNotFound(_0x2456dc,null))[_0xfb16('0x1a')](saveUpdates(_0x490efc[_0xfb16('0x36')],null))[_0xfb16('0x1a')](respondWithResult(_0x2456dc,null))[_0xfb16('0x27')](handleError(_0x2456dc,null));};exports['destroy']=function(_0x3164da,_0xe8cef){return db['FaxInteraction'][_0xfb16('0x34')]({'where':{'id':_0x3164da[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0xe8cef,null))['then'](removeEntity(_0xe8cef,null))[_0xfb16('0x27')](handleError(_0xe8cef,null));};exports[_0xfb16('0x37')]=function(_0x856a5,_0x1f8af2){return db[_0xfb16('0x2c')][_0xfb16('0x37')]()[_0xfb16('0x1a')](respondWithResult(_0x1f8af2,null))[_0xfb16('0x27')](handleError(_0x1f8af2,null));};exports['addMessage']=function(_0x560a18,_0x2d10b9){return db[_0xfb16('0x38')][_0xfb16('0x34')]({'where':{'id':_0x560a18[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x2d10b9,null))[_0xfb16('0x1a')](function(_0x45286e){if(_0x45286e){return _0x45286e[_0xfb16('0x39')](_0x560a18[_0xfb16('0x36')][_0xfb16('0x3a')],_[_0xfb16('0x3b')](_0x560a18['body'],[_0xfb16('0x3a'),'id'])||{});}})[_0xfb16('0x1a')](respondWithResult(_0x2d10b9,null))[_0xfb16('0x27')](handleError(_0x2d10b9,null));};exports[_0xfb16('0x3c')]=function(_0x1c3ce4,_0x2d454c){var _0x3fe100={'raw':![],'where':{}};var _0x15afb7={};var _0x528b0a={'count':0x0,'rows':[]};return db[_0xfb16('0x2c')][_0xfb16('0x3d')]({'where':{'id':_0x1c3ce4[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x2d454c,null))[_0xfb16('0x1a')](function(_0x215c33){if(_0x215c33){_0x15afb7[_0xfb16('0x2a')]=_[_0xfb16('0x2b')](db[_0xfb16('0x38')][_0xfb16('0x20')]);_0x15afb7['query']=_[_0xfb16('0x2b')](_0x1c3ce4['query']);_0x15afb7['filters']=_[_0xfb16('0x3e')](_0x15afb7[_0xfb16('0x2a')],_0x15afb7['query']);_0x3fe100[_0xfb16('0x2e')]=_[_0xfb16('0x3e')](_0x15afb7[_0xfb16('0x2a')],qs[_0xfb16('0x2f')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x2f')]));_0x3fe100[_0xfb16('0x2e')]=_0x3fe100[_0xfb16('0x2e')][_0xfb16('0x30')]?_0x3fe100['attributes']:_0x15afb7[_0xfb16('0x2a')];if(!_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x3f')](_0xfb16('0x40'))){_0x3fe100[_0xfb16('0x13')]=qs[_0xfb16('0x13')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x13')]);_0x3fe100[_0xfb16('0x14')]=qs[_0xfb16('0x14')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x14')]);}_0x3fe100[_0xfb16('0x41')]=qs[_0xfb16('0x42')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x42')]);_0x3fe100[_0xfb16('0x43')]=qs[_0xfb16('0x2d')](_[_0xfb16('0x44')](_0x1c3ce4[_0xfb16('0x25')],_0x15afb7['filters']));_0x3fe100[_0xfb16('0x43')][_0xfb16('0x45')]=_0x215c33['id'];if(_0x1c3ce4[_0xfb16('0x25')]['filter']){_0x3fe100[_0xfb16('0x43')]=_[_0xfb16('0x33')](_0x3fe100['where'],{'$or':_['map'](_0x3fe100['attributes'],function(_0x5e1d2a){var _0x45698a={};_0x45698a[_0x5e1d2a]={'$like':'%'+_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x46')]+'%'};return _0x45698a;})});}if(_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x47')]){var _0x4c54c4=_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x47')][_0xfb16('0x48')](',');var _0x38a327={};_0x38a327[_0x4c54c4[0x0]]={'$gte':moment(_0x4c54c4[0x1])[_0xfb16('0x49')](_0xfb16('0x4a'))};_0x3fe100[_0xfb16('0x43')]=_['merge'](_0x3fe100[_0xfb16('0x43')],_0x38a327);}_0x3fe100=_[_0xfb16('0x33')]({},_0x3fe100,_0x1c3ce4[_0xfb16('0x4b')]);return db['FaxMessage'][_0xfb16('0x15')]({'where':_0x3fe100[_0xfb16('0x43')]})[_0xfb16('0x1a')](function(_0x1948ab){_0x528b0a[_0xfb16('0x15')]=_0x1948ab;if(_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x31')]){_0x3fe100[_0xfb16('0x32')]=[{'all':!![]}];}return db[_0xfb16('0x38')][_0xfb16('0x4c')](_0x3fe100);})[_0xfb16('0x1a')](function(_0x106ed3){_0x528b0a['rows']=_0x106ed3;return _0x528b0a;});}})[_0xfb16('0x1a')](respondWithFilteredResult(_0x2d454c,_0x3fe100))['catch'](handleError(_0x2d454c,null));};exports[_0xfb16('0x4d')]=function(_0x459817,_0x27ab93){return db[_0xfb16('0x2c')][_0xfb16('0x34')]({'where':{'id':_0x459817['params']['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x27ab93,null))[_0xfb16('0x1a')](function(_0x110a94){if(_0x110a94){return _0x110a94[_0xfb16('0x4e')](_0x459817['body'][_0xfb16('0x3a')],_[_0xfb16('0x3b')](_0x459817['body'],[_0xfb16('0x3a'),'id'])||{})[_0xfb16('0x4f')](function(){return db['Tag'][_0xfb16('0x4c')]({'attributes':['id',_0xfb16('0x1d'),_0xfb16('0x50')],'where':{'id':_0x459817[_0xfb16('0x36')]['ids']}});})[_0xfb16('0x1a')](function(_0x2434f1){socket[_0xfb16('0x51')](_0xfb16('0x52'),{'id':Number(_0x459817[_0xfb16('0x29')]['id']),'tags':_0x2434f1||[]});return{'id':Number(_0x459817[_0xfb16('0x29')]['id']),'tags':_0x2434f1||[]};});}})['then'](respondWithResult(_0x27ab93,null))[_0xfb16('0x27')](handleError(_0x27ab93,null));};exports[_0xfb16('0x53')]=function(_0x2eee89,_0x46023b){return db[_0xfb16('0x2c')][_0xfb16('0x34')]({'where':{'id':_0x2eee89['params']['id']}})['then'](handleEntityNotFound(_0x46023b,null))[_0xfb16('0x1a')](function(_0x55a6a9){if(_0x55a6a9){return _0x55a6a9[_0xfb16('0x53')](_0x2eee89['query'][_0xfb16('0x3a')]);}})[_0xfb16('0x1a')](respondWithStatusCode(_0x46023b,null))[_0xfb16('0x27')](handleError(_0x46023b,null));};exports[_0xfb16('0x54')]=function(_0x37e309,_0x4d8c4b){var _0x276f23=moment()[_0xfb16('0x55')]()['toString']();var _0x43594b=path[_0xfb16('0x56')](config[_0xfb16('0x57')],'server',_0xfb16('0x58'),_0xfb16('0x59'));var _0xbc4275=path[_0xfb16('0x56')](config[_0xfb16('0x57')],_0xfb16('0x5a'),_0xfb16('0x58'),_0xfb16('0x5b'));var _0x47d6b0=path[_0xfb16('0x56')](_0x43594b,_0x276f23);var _0x581dfd=util[_0xfb16('0x49')](_0xfb16('0x5c'),_0x37e309[_0xfb16('0x29')]['id'],_0x276f23);var _0x576f83=path[_0xfb16('0x56')](_0x43594b,_0x581dfd);var _0xa050cf=[];_0xa050cf[_0xfb16('0x5d')]({'model':db[_0xfb16('0x5e')],'as':_0xfb16('0x5e'),'raw':!![]});var _0x402168=[{'model':db[_0xfb16('0x38')],'as':_0xfb16('0x5f'),'attributes':['id',_0xfb16('0x36'),'createdAt'],'include':_0xa050cf}];return db[_0xfb16('0x2c')]['find']({'where':{'id':_0x37e309[_0xfb16('0x29')]['id']},'include':_0x402168})['then'](handleEntityNotFound(_0x4d8c4b,null))['then'](function(_0x59dc32){if(_0x59dc32&&_0x59dc32['Messages']){var _0xdcb9a6=_0x59dc32[_0xfb16('0x60')]({'plain':!![]});fs[_0xfb16('0x61')](_0x47d6b0);for(var _0x1e9d7d=0x0;_0x1e9d7d<_0xdcb9a6[_0xfb16('0x5f')][_0xfb16('0x30')];_0x1e9d7d++){var _0x1374b8=_0xdcb9a6[_0xfb16('0x5f')][_0x1e9d7d][_0xfb16('0x5e')];if(_0x1374b8){var _0x27f09b=path['join'](_0xbc4275,_0x1374b8[_0xfb16('0x62')]);if(fs['existsSync'](_0x27f09b)){fs[_0xfb16('0x63')](_0x27f09b)[_0xfb16('0x64')](fs[_0xfb16('0x65')](path[_0xfb16('0x56')](_0x47d6b0,_0x1374b8[_0xfb16('0x62')])));}}}return BPromise[_0xfb16('0x66')]()[_0xfb16('0x1a')](function(){return new BPromise(function(_0xb04b,_0x3717d1){zipdir(_0x47d6b0,{'saveTo':_0x576f83},function(_0x452dc2,_0x127406){if(_0x452dc2)return _0x3717d1(_0x452dc2);return _0xb04b(_0x127406);});})[_0xfb16('0x1a')](function(){return new BPromise(function(_0x4f8b03,_0x3eaa55){rimraf(_0x47d6b0,function(_0x7a42bd){if(_0x7a42bd)_0x3eaa55(_0x7a42bd);return _0x4f8b03();});});})['then'](function(){return _0x4d8c4b[_0xfb16('0x54')](_0x576f83,_0x581dfd,function(_0x5c95c3){if(_0x5c95c3){console[_0xfb16('0x67')]('err',_0x5c95c3);}else{fs[_0xfb16('0x68')](_0x576f83);}});});});}else{return _0x4d8c4b[_0xfb16('0xf')](0xc8);}})[_0xfb16('0x27')](handleError(_0x4d8c4b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 574104f..350aefd 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 _0x5398=['remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x5398,0x6a));var _0x8539=function(_0x56f1cc,_0x103561){_0x56f1cc=_0x56f1cc-0x0;var _0x25c55f=_0x5398[_0x56f1cc];return _0x25c55f;};'use strict';var EventEmitter=require(_0x8539('0x0'));var FaxInteraction=require(_0x8539('0x1'))['db'][_0x8539('0x2')];var FaxMessage=require(_0x8539('0x1'))['db'][_0x8539('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8539('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8539('0x5'),'afterDestroy':_0x8539('0x6')};function emitEvent(_0x33bb6f){return function(_0x4e8b20,_0x5d3858,_0xef845a){_0x4e8b20[_0x8539('0x7')]({'attributes':['id'],'raw':!![]})[_0x8539('0x8')](function(_0x1b7f72){_0x4e8b20['setDataValue']('Users',_0x1b7f72['map'](function(_0x3b1e34){return{'id':_0x3b1e34['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4e8b20['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8539('0x8')](function(_0x4ca15e){_0x4e8b20[_0x8539('0x9')](_0x8539('0xa'),_0x4ca15e[_0x8539('0xb')]);FaxInteractionEvents[_0x8539('0xc')](_0x33bb6f+':'+_0x4e8b20['id'],_0x4e8b20);FaxInteractionEvents[_0x8539('0xc')](_0x33bb6f,_0x4e8b20);_0xef845a(null);})[_0x8539('0xd')](_0xef845a(null));};}for(var e in events){if(events[_0x8539('0xe')](e)){var event=events[e];FaxInteraction[_0x8539('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x23d5=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x2bd013,_0x2fce90){var _0xeccd5=function(_0x125623){while(--_0x125623){_0x2bd013['push'](_0x2bd013['shift']());}};_0xeccd5(++_0x2fce90);}(_0x23d5,0x8a));var _0x523d=function(_0x544c80,_0x85260f){_0x544c80=_0x544c80-0x0;var _0x2e852b=_0x23d5[_0x544c80];return _0x2e852b;};'use strict';var EventEmitter=require(_0x523d('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x523d('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x523d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x523d('0x3')](0x0);var events={'afterCreate':_0x523d('0x4'),'afterUpdate':_0x523d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5e762a){return function(_0x100c56,_0x44ce4d,_0x2fe90e){_0x100c56[_0x523d('0x6')]({'attributes':['id'],'raw':!![]})[_0x523d('0x7')](function(_0x52a00b){_0x100c56[_0x523d('0x8')](_0x523d('0x9'),_0x52a00b[_0x523d('0xa')](function(_0x5a8e86){return{'id':_0x5a8e86['id']};}));return FaxMessage[_0x523d('0xb')]({'where':{'FaxInteractionId':_0x100c56['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d611e){_0x100c56[_0x523d('0x8')](_0x523d('0xc'),_0x4d611e[_0x523d('0xd')]);FaxInteractionEvents['emit'](_0x5e762a+':'+_0x100c56['id'],_0x100c56);FaxInteractionEvents[_0x523d('0xe')](_0x5e762a,_0x100c56);_0x2fe90e(null);})[_0x523d('0xf')](_0x2fe90e(null));};}for(var e in events){if(events[_0x523d('0x10')](e)){var event=events[e];FaxInteraction[_0x523d('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 9be0d40..f77891d 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 _0x7295=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions'];(function(_0x5c34c4,_0x1e278c){var _0x1082b4=function(_0x3c7fc3){while(--_0x3c7fc3){_0x5c34c4['push'](_0x5c34c4['shift']());}};_0x1082b4(++_0x1e278c);}(_0x7295,0x199));var _0x5729=function(_0x2d7827,_0x5afb3d){_0x2d7827=_0x2d7827-0x0;var _0x2ef080=_0x7295[_0x2d7827];return _0x2ef080;};'use strict';var _=require('lodash');var util=require(_0x5729('0x0'));var logger=require('../../config/logger')(_0x5729('0x1'));var moment=require(_0x5729('0x2'));var BPromise=require(_0x5729('0x3'));var rp=require(_0x5729('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5729('0x5'));var config=require(_0x5729('0x6'));var attributes=require(_0x5729('0x7'));module[_0x5729('0x8')]=function(_0x53dd57,_0x3aeae1){return _0x53dd57['define'](_0x5729('0x9'),attributes,{'tableName':_0x5729('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc3ea33,_0x3bcf50,_0x50f21e){if(_0xc3ea33[_0x5729('0xb')](_0x5729('0xc'))){_0xc3ea33[_0x5729('0xd')]=moment()['format'](_0x5729('0xe'));}_0x50f21e(null,_0xc3ea33);}}});}; \ No newline at end of file +var _0x3458=['path','rimraf','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','request-promise'];(function(_0x113a99,_0x8d0836){var _0x4d262b=function(_0x5d5cc8){while(--_0x5d5cc8){_0x113a99['push'](_0x113a99['shift']());}};_0x4d262b(++_0x8d0836);}(_0x3458,0x92));var _0x8345=function(_0x18777b,_0x596582){_0x18777b=_0x18777b-0x0;var _0xaa5585=_0x3458[_0x18777b];return _0xaa5585;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8345('0x0'))(_0x8345('0x1'));var moment=require(_0x8345('0x2'));var BPromise=require('bluebird');var rp=require(_0x8345('0x3'));var fs=require('fs');var path=require(_0x8345('0x4'));var rimraf=require(_0x8345('0x5'));var config=require('../../config/environment');var attributes=require(_0x8345('0x6'));module[_0x8345('0x7')]=function(_0x4f0b3f,_0x38a114){return _0x4f0b3f[_0x8345('0x8')]('FaxInteraction',attributes,{'tableName':_0x8345('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21b309,_0x52a058,_0x2657e7){if(_0x21b309[_0x8345('0xa')](_0x8345('0xb'))){_0x21b309[_0x8345('0xc')]=moment()[_0x8345('0xd')](_0x8345('0xe'));}_0x2657e7(null,_0x21b309);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1c74dc0..87ba709 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 _0x0fad=['body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update'];(function(_0x340ab0,_0xbf1e61){var _0x43a897=function(_0x63bdf7){while(--_0x63bdf7){_0x340ab0['push'](_0x340ab0['shift']());}};_0x43a897(++_0xbf1e61);}(_0x0fad,0xaf));var _0xd0fa=function(_0x230951,_0x4dad52){_0x230951=_0x230951-0x0;var _0xeb26b1=_0x0fad[_0x230951];return _0xeb26b1;};'use strict';var _=require(_0xd0fa('0x0'));var util=require('util');var moment=require(_0xd0fa('0x1'));var BPromise=require(_0xd0fa('0x2'));var rs=require(_0xd0fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0fa('0x4'))['db'];var utils=require(_0xd0fa('0x5'));var logger=require(_0xd0fa('0x6'))(_0xd0fa('0x7'));var config=require(_0xd0fa('0x8'));var jayson=require(_0xd0fa('0x9'));var client=jayson[_0xd0fa('0xa')][_0xd0fa('0xb')]({'port':0x232a});config[_0xd0fa('0xc')]=_['defaults'](config[_0xd0fa('0xc')],{'host':_0xd0fa('0xd'),'port':0x18eb});var socket=require(_0xd0fa('0xe'))(new Redis(config[_0xd0fa('0xc')]));require(_0xd0fa('0xf'))['register'](socket);function respondWithRpcPromise(_0x46c55c,_0x5c584a,_0x2630f7){return new BPromise(function(_0x12f210,_0x6f1d4e){return client['request'](_0x46c55c,_0x2630f7)[_0xd0fa('0x10')](function(_0x3d1140){logger[_0xd0fa('0x11')](_0xd0fa('0x12'),_0x5c584a,'request\x20sent');logger[_0xd0fa('0x13')](_0xd0fa('0x14'),_0x5c584a,_0xd0fa('0x15'),JSON[_0xd0fa('0x16')](_0x3d1140));if(_0x3d1140[_0xd0fa('0x17')]){if(_0x3d1140['error'][_0xd0fa('0x18')]===0x1f4){logger[_0xd0fa('0x17')](_0xd0fa('0x12'),_0x5c584a,_0x3d1140[_0xd0fa('0x17')][_0xd0fa('0x19')]);return _0x6f1d4e(_0x3d1140['error'][_0xd0fa('0x19')]);}logger[_0xd0fa('0x17')](_0xd0fa('0x12'),_0x5c584a,_0x3d1140['error'][_0xd0fa('0x19')]);return _0x12f210(_0x3d1140[_0xd0fa('0x17')][_0xd0fa('0x19')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5c584a,_0xd0fa('0x15'));_0x12f210(_0x3d1140['result']['message']);}})[_0xd0fa('0x1a')](function(_0x482932){logger['error'](_0xd0fa('0x12'),_0x5c584a,_0x482932);_0x6f1d4e(_0x482932);});});}exports[_0xd0fa('0x1b')]=function(_0x41630a){var _0x3287b4=this;return new Promise(function(_0x359cf2,_0x13888f){return db[_0xd0fa('0x1c')][_0xd0fa('0x1d')](_0x41630a[_0xd0fa('0x1e')],{'raw':_0x41630a[_0xd0fa('0x1f')]?_0x41630a[_0xd0fa('0x1f')][_0xd0fa('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41630a[_0xd0fa('0x1f')]?_0x41630a[_0xd0fa('0x1f')][_0xd0fa('0x21')]||null:null,'attributes':_0x41630a[_0xd0fa('0x1f')]?_0x41630a['options'][_0xd0fa('0x22')]||null:null,'limit':_0x41630a['options']?_0x41630a[_0xd0fa('0x1f')][_0xd0fa('0x23')]||null:null})[_0xd0fa('0x10')](function(_0x5734ee){logger['info'](_0xd0fa('0x1b'),_0x41630a);logger[_0xd0fa('0x13')](_0xd0fa('0x1b'),_0x41630a,JSON['stringify'](_0x5734ee));_0x359cf2(_0x5734ee);})['catch'](function(_0x18f0c1){logger['error'](_0xd0fa('0x1b'),_0x18f0c1[_0xd0fa('0x19')],_0x41630a);_0x13888f(_0x3287b4[_0xd0fa('0x17')](0x1f4,_0x18f0c1['message']));});});};exports[_0xd0fa('0x24')]=function(_0x4509c3){return new Promise(function(_0x2a2077,_0x447298){return db[_0xd0fa('0x1c')][_0xd0fa('0x25')]({'where':_0x4509c3['options']?_0x4509c3[_0xd0fa('0x1f')][_0xd0fa('0x21')]||null:null})[_0xd0fa('0x10')](function(_0x167998){if(_0x167998){return _0x167998['addTags'](_0x4509c3[_0xd0fa('0x1e')][_0xd0fa('0x26')],_[_0xd0fa('0x27')](_0x4509c3[_0xd0fa('0x1e')],['ids','id'])||{});}})['spread'](function(_0xbfa09e){logger[_0xd0fa('0x11')](_0xd0fa('0x28'),_0x4509c3);logger[_0xd0fa('0x13')]('AddTags',_0x4509c3,JSON[_0xd0fa('0x16')](_0xbfa09e));_0x2a2077(_0xbfa09e);})[_0xd0fa('0x1a')](function(_0x23b8f1){logger[_0xd0fa('0x17')]('AddTags',_0x23b8f1[_0xd0fa('0x19')],_0x4509c3);_0x447298(_this[_0xd0fa('0x17')](0x1f4,_0x23b8f1['message']));});});}; \ No newline at end of file +var _0xf900=['attributes','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','update','body','options','raw'];(function(_0xa0944b,_0x45646e){var _0x1f7540=function(_0x37e60a){while(--_0x37e60a){_0xa0944b['push'](_0xa0944b['shift']());}};_0x1f7540(++_0x45646e);}(_0xf900,0x15b));var _0x0f90=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xf900[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x0f90('0x0'));var util=require(_0x0f90('0x1'));var moment=require(_0x0f90('0x2'));var BPromise=require(_0x0f90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f90('0x4'));var logger=require('../../config/logger')(_0x0f90('0x5'));var config=require(_0x0f90('0x6'));var jayson=require(_0x0f90('0x7'));var client=jayson[_0x0f90('0x8')][_0x0f90('0x9')]({'port':0x232a});config[_0x0f90('0xa')]=_[_0x0f90('0xb')](config[_0x0f90('0xa')],{'host':_0x0f90('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f90('0xa')]));require(_0x0f90('0xd'))[_0x0f90('0xe')](socket);function respondWithRpcPromise(_0xe5bd0b,_0x12257e,_0x36bc50){return new BPromise(function(_0x496816,_0x200b0b){return client[_0x0f90('0xf')](_0xe5bd0b,_0x36bc50)['then'](function(_0x91f4b5){logger[_0x0f90('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x12257e,'request\x20sent');logger[_0x0f90('0x11')](_0x0f90('0x12'),_0x12257e,'request\x20sent',JSON[_0x0f90('0x13')](_0x91f4b5));if(_0x91f4b5['error']){if(_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x15')]===0x1f4){logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x17')]);return _0x200b0b(_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x17')]);}logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x91f4b5['error']['message']);return _0x496816(_0x91f4b5[_0x0f90('0x14')]['message']);}else{logger['info'](_0x0f90('0x16'),_0x12257e,_0x0f90('0x18'));_0x496816(_0x91f4b5[_0x0f90('0x19')][_0x0f90('0x17')]);}})[_0x0f90('0x1a')](function(_0x26c197){logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x26c197);_0x200b0b(_0x26c197);});});}exports['UpdateFaxInteraction']=function(_0x533c3d){var _0x29aed2=this;return new Promise(function(_0x3c7bb7,_0xcb9372){return db['FaxInteraction'][_0x0f90('0x1b')](_0x533c3d[_0x0f90('0x1c')],{'raw':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options'][_0x0f90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options']['where']||null:null,'attributes':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options'][_0x0f90('0x1f')]||null:null,'limit':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d[_0x0f90('0x1d')][_0x0f90('0x20')]||null:null})[_0x0f90('0x21')](function(_0x415280){logger[_0x0f90('0x10')](_0x0f90('0x22'),_0x533c3d);logger['debug'](_0x0f90('0x22'),_0x533c3d,JSON['stringify'](_0x415280));_0x3c7bb7(_0x415280);})[_0x0f90('0x1a')](function(_0x191cc9){logger[_0x0f90('0x14')](_0x0f90('0x22'),_0x191cc9[_0x0f90('0x17')],_0x533c3d);_0xcb9372(_0x29aed2['error'](0x1f4,_0x191cc9['message']));});});};exports[_0x0f90('0x23')]=function(_0x4bdc05){return new Promise(function(_0x21725b,_0x4b9a07){return db[_0x0f90('0x24')][_0x0f90('0x25')]({'where':_0x4bdc05[_0x0f90('0x1d')]?_0x4bdc05[_0x0f90('0x1d')]['where']||null:null})[_0x0f90('0x21')](function(_0x57dac6){if(_0x57dac6){return _0x57dac6[_0x0f90('0x26')](_0x4bdc05[_0x0f90('0x1c')][_0x0f90('0x27')],_[_0x0f90('0x28')](_0x4bdc05['body'],[_0x0f90('0x27'),'id'])||{});}})['spread'](function(_0x280980){logger[_0x0f90('0x10')](_0x0f90('0x29'),_0x4bdc05);logger[_0x0f90('0x11')](_0x0f90('0x29'),_0x4bdc05,JSON[_0x0f90('0x13')](_0x280980));_0x21725b(_0x280980);})[_0x0f90('0x1a')](function(_0x175b1b){logger['error'](_0x0f90('0x29'),_0x175b1b[_0x0f90('0x17')],_0x4bdc05);_0x4b9a07(_this['error'](0x1f4,_0x175b1b[_0x0f90('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index afb60cd..6c81e74 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 _0x64a9=['update','emit','removeListener','length','./faxInteraction.events','remove'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x64a9,0xc4));var _0x964a=function(_0x46ddef,_0x6c3dac){_0x46ddef=_0x46ddef-0x0;var _0x358c6e=_0x64a9[_0x46ddef];return _0x358c6e;};'use strict';var FaxInteractionEvents=require(_0x964a('0x0'));var events=['save',_0x964a('0x1'),_0x964a('0x2')];function createListener(_0x12fa79,_0x45ee15){return function(_0x30fb31){_0x45ee15[_0x964a('0x3')](_0x12fa79,_0x30fb31);};}function removeListener(_0x13d201,_0x6d7c4){return function(){FaxInteractionEvents[_0x964a('0x4')](_0x13d201,_0x6d7c4);};}exports['register']=function(_0x5b47a1){for(var _0x437844=0x0,_0x560d3f=events[_0x964a('0x5')];_0x437844<_0x560d3f;_0x437844++){var _0x28c860=events[_0x437844];var _0x58b066=createListener('faxInteraction:'+_0x28c860,_0x5b47a1);FaxInteractionEvents['on'](_0x28c860,_0x58b066);}}; \ No newline at end of file +var _0xb7ec=['./faxInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x2dfbfa,_0x91cc9b){var _0x83c70e=function(_0x1acda2){while(--_0x1acda2){_0x2dfbfa['push'](_0x2dfbfa['shift']());}};_0x83c70e(++_0x91cc9b);}(_0xb7ec,0x8c));var _0xcb7e=function(_0x43134c,_0x429046){_0x43134c=_0x43134c-0x0;var _0x402213=_0xb7ec[_0x43134c];return _0x402213;};'use strict';var FaxInteractionEvents=require(_0xcb7e('0x0'));var events=[_0xcb7e('0x1'),'remove',_0xcb7e('0x2')];function createListener(_0x373c27,_0x4e8cb6){return function(_0x2aad7f){_0x4e8cb6[_0xcb7e('0x3')](_0x373c27,_0x2aad7f);};}function removeListener(_0x3df6ee,_0x86de8a){return function(){FaxInteractionEvents[_0xcb7e('0x4')](_0x3df6ee,_0x86de8a);};}exports[_0xcb7e('0x5')]=function(_0x3e24bc){for(var _0x54c669=0x0,_0x32ddb8=events[_0xcb7e('0x6')];_0x54c669<_0x32ddb8;_0x54c669++){var _0x5dd933=events[_0x54c669];var _0x508a70=createListener('faxInteraction:'+_0x5dd933,_0x3e24bc);FaxInteractionEvents['on'](_0x5dd933,_0x508a70);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index af76335..9f3c3bf 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 _0x9cbc=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','/:id/download','download','post','addMessage','tracked','faxinteraction:addtags','addTags','put','fax','delete','faxinteraction:destroy','destroy','/:id/tags','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x398074,_0xfe40bc){var _0x24eaa3=function(_0x26dd84){while(--_0x26dd84){_0x398074['push'](_0x398074['shift']());}};_0x24eaa3(++_0xfe40bc);}(_0x9cbc,0x1f2));var _0xc9cb=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x9cbc[_0x22ffbf];return _0x360c17;};'use strict';var multer=require(_0xc9cb('0x0'));var util=require('util');var path=require(_0xc9cb('0x1'));var timeout=require(_0xc9cb('0x2'));var express=require('express');var router=express[_0xc9cb('0x3')]();var fs_extra=require(_0xc9cb('0x4'));var auth=require(_0xc9cb('0x5'));var interaction=require(_0xc9cb('0x6'));var config=require(_0xc9cb('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xc9cb('0x8')](),controller[_0xc9cb('0x9')]);router[_0xc9cb('0xa')](_0xc9cb('0xb'),auth[_0xc9cb('0x8')](),controller[_0xc9cb('0xc')]);router[_0xc9cb('0xa')](_0xc9cb('0xd'),auth[_0xc9cb('0x8')](),controller['show']);router[_0xc9cb('0xa')](_0xc9cb('0xe'),auth[_0xc9cb('0x8')](),controller['getMessages']);router[_0xc9cb('0xa')](_0xc9cb('0xf'),auth[_0xc9cb('0x8')](),controller[_0xc9cb('0x10')]);router[_0xc9cb('0x11')]('/',auth[_0xc9cb('0x8')](),controller['create']);router[_0xc9cb('0x11')](_0xc9cb('0xe'),auth[_0xc9cb('0x8')](),controller[_0xc9cb('0x12')]);router['post']('/:id/tags',auth[_0xc9cb('0x8')](),interaction[_0xc9cb('0x13')]('fax',_0xc9cb('0x14')),controller[_0xc9cb('0x15')]);router[_0xc9cb('0x16')]('/:id',auth[_0xc9cb('0x8')](),interaction[_0xc9cb('0x13')](_0xc9cb('0x17'),'faxinteraction:update'),controller['update']);router[_0xc9cb('0x18')](_0xc9cb('0xd'),auth['isAuthenticated'](),interaction[_0xc9cb('0x13')]('fax',_0xc9cb('0x19')),controller[_0xc9cb('0x1a')]);router['delete'](_0xc9cb('0x1b'),auth[_0xc9cb('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x26f3=['getMessages','/:id/download','download','post','create','/:id/messages','fax','put','faxinteraction:update','tracked','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x36671c,_0x540221){var _0x30829f=function(_0x4aa61a){while(--_0x4aa61a){_0x36671c['push'](_0x36671c['shift']());}};_0x30829f(++_0x540221);}(_0x26f3,0xe5));var _0x326f=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x26f3[_0x628eee];return _0x447718;};'use strict';var multer=require(_0x326f('0x0'));var util=require('util');var path=require(_0x326f('0x1'));var timeout=require(_0x326f('0x2'));var express=require(_0x326f('0x3'));var router=express['Router']();var fs_extra=require(_0x326f('0x4'));var auth=require(_0x326f('0x5'));var interaction=require(_0x326f('0x6'));var config=require(_0x326f('0x7'));var controller=require(_0x326f('0x8'));router[_0x326f('0x9')]('/',auth[_0x326f('0xa')](),controller['index']);router[_0x326f('0x9')](_0x326f('0xb'),auth[_0x326f('0xa')](),controller[_0x326f('0xc')]);router['get'](_0x326f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x326f('0x9')]('/:id/messages',auth[_0x326f('0xa')](),controller[_0x326f('0xe')]);router[_0x326f('0x9')](_0x326f('0xf'),auth['isAuthenticated'](),controller[_0x326f('0x10')]);router[_0x326f('0x11')]('/',auth['isAuthenticated'](),controller[_0x326f('0x12')]);router[_0x326f('0x11')](_0x326f('0x13'),auth[_0x326f('0xa')](),controller['addMessage']);router[_0x326f('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x326f('0x14'),'faxinteraction:addtags'),controller['addTags']);router[_0x326f('0x15')](_0x326f('0xd'),auth[_0x326f('0xa')](),interaction['tracked'](_0x326f('0x14'),_0x326f('0x16')),controller['update']);router['delete']('/:id',auth[_0x326f('0xa')](),interaction[_0x326f('0x17')]('fax','faxinteraction:destroy'),controller['destroy']);router['delete'](_0x326f('0x18'),auth[_0x326f('0xa')](),controller[_0x326f('0x19')]);module[_0x326f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d738a47..4b79c0d 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 _0xf9f7=['exports','TEXT','medium','BOOLEAN','ENUM','DATE','sequelize'];(function(_0x49831d,_0x302af0){var _0x42c997=function(_0x156ed3){while(--_0x156ed3){_0x49831d['push'](_0x49831d['shift']());}};_0x42c997(++_0x302af0);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0xf9f7[_0x212fcc];return _0x4d8190;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'body':{'type':Sequelize[_0x7f9f('0x2')](_0x7f9f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7f9f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f9f('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x7f9f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7f9f('0x6')]}}; \ No newline at end of file +var _0x4a81=['DATE','sequelize','exports','TEXT','medium','out'];(function(_0x58124e,_0x5026e0){var _0x7f6deb=function(_0x27fec3){while(--_0x27fec3){_0x58124e['push'](_0x58124e['shift']());}};_0x7f6deb(++_0x5026e0);}(_0x4a81,0x1b7));var _0x14a8=function(_0x4a19ea,_0x311ef2){_0x4a19ea=_0x4a19ea-0x0;var _0x305de7=_0x4a81[_0x4a19ea];return _0x305de7;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'body':{'type':Sequelize[_0x14a8('0x2')](_0x14a8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x14a8('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x14a8('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x14a8('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3bb8add..fdb8a14 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 _0x3c70=['filters','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','body','describe','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','User','fullname','internal','interface','SIP/%s','channel','event','accept','acceptmessage','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','email','motionChannel','create','CmContact','findOne','ContactId','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server','files','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x57313c,_0x3b0080){var _0x5ca2f6=function(_0x4ad4de){while(--_0x4ad4de){_0x57313c['push'](_0x57313c['shift']());}};_0x5ca2f6(++_0x3b0080);}(_0x3c70,0x1e8));var _0x03c7=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x3c70[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x03c7('0x0'));var rimraf=require(_0x03c7('0x1'));var zipdir=require(_0x03c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03c7('0x3'));var moment=require(_0x03c7('0x4'));var BPromise=require(_0x03c7('0x5'));var Mustache=require(_0x03c7('0x6'));var util=require(_0x03c7('0x7'));var path=require(_0x03c7('0x8'));var sox=require(_0x03c7('0x9'));var csv=require(_0x03c7('0xa'));var ejs=require(_0x03c7('0xb'));var fs=require('fs');var fs_extra=require(_0x03c7('0xc'));var _=require(_0x03c7('0xd'));var squel=require(_0x03c7('0xe'));var crypto=require(_0x03c7('0xf'));var jsforce=require(_0x03c7('0x10'));var deskjs=require(_0x03c7('0x11'));var toCsv=require('to-csv');var querystring=require(_0x03c7('0x12'));var Papa=require(_0x03c7('0x13'));var Redis=require(_0x03c7('0x14'));var authService=require(_0x03c7('0x15'));var qs=require(_0x03c7('0x16'));var as=require(_0x03c7('0x17'));var hardwareService=require(_0x03c7('0x18'));var logger=require(_0x03c7('0x19'))(_0x03c7('0x1a'));var utils=require('../../config/utils');var config=require(_0x03c7('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x03c7('0x1c'))['db'];config[_0x03c7('0x1d')]=_['defaults'](config['redis'],{'host':_0x03c7('0x1e'),'port':0x18eb});var socket=require(_0x03c7('0x1f'))(new Redis(config[_0x03c7('0x1d')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x03c7('0x20'));var client=jayson[_0x03c7('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x03c7('0x21')][_0x03c7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4eebea,_0x2f02d2,_0x3b7310,_0x50d83a){return new BPromise(function(_0x421fdf,_0x4ae725){var _0x338960=_0x50d83a||client;return _0x338960['request'](_0x4eebea,_0x3b7310)[_0x03c7('0x23')](function(_0x43f6dc){logger[_0x03c7('0x24')](_0x03c7('0x25'),_0x2f02d2,_0x03c7('0x26'));logger[_0x03c7('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f02d2,'request\x20sent',JSON[_0x03c7('0x28')](_0x43f6dc));if(_0x43f6dc['error']){if(_0x43f6dc[_0x03c7('0x29')]['code']===0x1f4){logger[_0x03c7('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2f02d2,_0x43f6dc['error'][_0x03c7('0x2a')]);return _0x4ae725(_0x43f6dc[_0x03c7('0x29')][_0x03c7('0x2a')]);}logger[_0x03c7('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2f02d2,_0x43f6dc['error'][_0x03c7('0x2a')]);return _0x421fdf(_0x43f6dc[_0x03c7('0x29')][_0x03c7('0x2a')]);}else{logger[_0x03c7('0x24')](_0x03c7('0x25'),_0x2f02d2,_0x03c7('0x26'));_0x421fdf(_0x43f6dc[_0x03c7('0x2b')][_0x03c7('0x2a')]);}})[_0x03c7('0x2c')](function(_0x52c44f){logger[_0x03c7('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2f02d2,_0x52c44f);_0x4ae725(_0x52c44f);});});}function respondWithStatusCode(_0x342977,_0x2c9754){_0x2c9754=_0x2c9754||0xcc;return function(_0x38340d){if(_0x38340d){return _0x342977['sendStatus'](_0x2c9754);}return _0x342977[_0x03c7('0x2d')](_0x2c9754)[_0x03c7('0x2e')]();};}function respondWithResult(_0x46d426,_0x33bcba){_0x33bcba=_0x33bcba||0xc8;return function(_0x5f0877){if(_0x5f0877){return _0x46d426[_0x03c7('0x2d')](_0x33bcba)['json'](_0x5f0877);}};}function respondWithFilteredResult(_0x1f4913,_0x479c6c){return function(_0x59b689){if(_0x59b689){var _0x280fe1=typeof _0x479c6c['offset']==='undefined'&&typeof _0x479c6c[_0x03c7('0x2f')]==='undefined';var _0x111fe1=_0x59b689[_0x03c7('0x30')];var _0x26cc95=_0x280fe1?0x0:_0x479c6c[_0x03c7('0x31')];var _0x19c2cd=_0x280fe1?_0x59b689[_0x03c7('0x30')]:_0x479c6c['offset']+_0x479c6c[_0x03c7('0x2f')];var _0x16d490;if(_0x19c2cd>=_0x111fe1){_0x19c2cd=_0x111fe1;_0x16d490=0xc8;}else{_0x16d490=0xce;}_0x1f4913[_0x03c7('0x2d')](_0x16d490);return _0x1f4913[_0x03c7('0x32')](_0x03c7('0x33'),_0x26cc95+'-'+_0x19c2cd+'/'+_0x111fe1)[_0x03c7('0x34')](_0x59b689);}return null;};}function patchUpdates(_0x30df35){return function(_0x2579c0){try{jsonpatch['apply'](_0x2579c0,_0x30df35,!![]);}catch(_0x340017){return BPromise[_0x03c7('0x35')](_0x340017);}return _0x2579c0[_0x03c7('0x36')]();};}function saveUpdates(_0x1d06f9,_0x3610be){return function(_0x421b75){if(_0x421b75){return _0x421b75[_0x03c7('0x37')](_0x1d06f9)[_0x03c7('0x23')](function(_0x4ae83d){return _0x4ae83d;});}return null;};}function removeEntity(_0x39cf12,_0x589e9d){return function(_0x795a7c){if(_0x795a7c){return _0x795a7c[_0x03c7('0x38')]()[_0x03c7('0x23')](function(){_0x39cf12[_0x03c7('0x2d')](0xcc)[_0x03c7('0x2e')]();});}};}function handleEntityNotFound(_0x36c03f,_0xa1cd82){return function(_0x42b5be){if(!_0x42b5be){_0x36c03f[_0x03c7('0x39')](0x194);}return _0x42b5be;};}function handleError(_0x4370ce,_0x3074e9){_0x3074e9=_0x3074e9||0x1f4;return function(_0x379a7a){logger[_0x03c7('0x29')](_0x379a7a[_0x03c7('0x3a')]);if(_0x379a7a[_0x03c7('0x3b')]){delete _0x379a7a[_0x03c7('0x3b')];}_0x4370ce['status'](_0x3074e9)['send'](_0x379a7a);};}exports[_0x03c7('0x3c')]=function(_0x5d37b4,_0x3c580e){var _0x23b1ae={},_0x355d1a={},_0x127b82={'count':0x0,'rows':[]};var _0x7ad42d=_['map'](db[_0x03c7('0x3d')][_0x03c7('0x3e')],function(_0x44f0d1){return{'name':_0x44f0d1['fieldName'],'type':_0x44f0d1[_0x03c7('0x3f')][_0x03c7('0x40')]};});_0x355d1a[_0x03c7('0x41')]=_[_0x03c7('0x42')](_0x7ad42d,_0x03c7('0x3b'));_0x355d1a[_0x03c7('0x43')]=_[_0x03c7('0x44')](_0x5d37b4['query']);_0x355d1a['filters']=_[_0x03c7('0x45')](_0x355d1a[_0x03c7('0x41')],_0x355d1a['query']);_0x23b1ae[_0x03c7('0x46')]=_[_0x03c7('0x45')](_0x355d1a[_0x03c7('0x41')],qs['fields'](_0x5d37b4[_0x03c7('0x43')]['fields']));_0x23b1ae[_0x03c7('0x46')]=_0x23b1ae['attributes'][_0x03c7('0x47')]?_0x23b1ae[_0x03c7('0x46')]:_0x355d1a[_0x03c7('0x41')];if(!_0x5d37b4[_0x03c7('0x43')][_0x03c7('0x48')]('nolimit')){_0x23b1ae[_0x03c7('0x2f')]=qs[_0x03c7('0x2f')](_0x5d37b4['query'][_0x03c7('0x2f')]);_0x23b1ae[_0x03c7('0x31')]=qs['offset'](_0x5d37b4['query'][_0x03c7('0x31')]);}_0x23b1ae[_0x03c7('0x49')]=qs[_0x03c7('0x4a')](_0x5d37b4[_0x03c7('0x43')][_0x03c7('0x4a')]);_0x23b1ae[_0x03c7('0x4b')]=qs['filters'](_['pick'](_0x5d37b4[_0x03c7('0x43')],_0x355d1a[_0x03c7('0x4c')]),_0x7ad42d);if(_0x5d37b4[_0x03c7('0x43')]['filter']){_0x23b1ae['where']=_[_0x03c7('0x4d')](_0x23b1ae['where'],{'$or':_[_0x03c7('0x42')](_0x7ad42d,function(_0x3d271f){if(_0x3d271f[_0x03c7('0x3f')]!==_0x03c7('0x4e')){var _0x25a2a9={};_0x25a2a9[_0x3d271f[_0x03c7('0x3b')]]={'$like':'%'+_0x5d37b4[_0x03c7('0x43')]['filter']+'%'};return _0x25a2a9;}})});}_0x23b1ae=_[_0x03c7('0x4d')]({},_0x23b1ae,_0x5d37b4[_0x03c7('0x4f')]);var _0x4968cd={'where':_0x23b1ae[_0x03c7('0x4b')]};return db[_0x03c7('0x3d')][_0x03c7('0x30')](_0x4968cd)['then'](function(_0x2f0cd2){_0x127b82[_0x03c7('0x30')]=_0x2f0cd2;if(_0x5d37b4[_0x03c7('0x43')][_0x03c7('0x50')]){_0x23b1ae['include']=[{'all':!![]}];}return db[_0x03c7('0x3d')][_0x03c7('0x51')](_0x23b1ae);})[_0x03c7('0x23')](function(_0x2e5c2b){_0x127b82[_0x03c7('0x52')]=_0x2e5c2b;return _0x127b82;})[_0x03c7('0x23')](respondWithFilteredResult(_0x3c580e,_0x23b1ae))['catch'](handleError(_0x3c580e,null));};exports[_0x03c7('0x53')]=function(_0x4c660e,_0x44b445){var _0x783c93={'raw':!![],'where':{'id':_0x4c660e[_0x03c7('0x54')]['id']}},_0x555abb={};_0x555abb[_0x03c7('0x41')]=_[_0x03c7('0x44')](db[_0x03c7('0x3d')]['rawAttributes']);_0x555abb[_0x03c7('0x43')]=_[_0x03c7('0x44')](_0x4c660e['query']);_0x555abb[_0x03c7('0x4c')]=_[_0x03c7('0x45')](_0x555abb[_0x03c7('0x41')],_0x555abb['query']);_0x783c93[_0x03c7('0x46')]=_[_0x03c7('0x45')](_0x555abb['model'],qs[_0x03c7('0x55')](_0x4c660e['query'][_0x03c7('0x55')]));_0x783c93[_0x03c7('0x46')]=_0x783c93[_0x03c7('0x46')]['length']?_0x783c93[_0x03c7('0x46')]:_0x555abb[_0x03c7('0x41')];if(_0x4c660e['query'][_0x03c7('0x50')]){_0x783c93[_0x03c7('0x56')]=[{'all':!![]}];}_0x783c93=_[_0x03c7('0x4d')]({},_0x783c93,_0x4c660e[_0x03c7('0x4f')]);return db[_0x03c7('0x3d')][_0x03c7('0x57')](_0x783c93)['then'](handleEntityNotFound(_0x44b445,null))[_0x03c7('0x23')](respondWithResult(_0x44b445,null))['catch'](handleError(_0x44b445,null));};exports['update']=function(_0x3a3ee6,_0x262c00){if(_0x3a3ee6[_0x03c7('0x58')]['id']){delete _0x3a3ee6[_0x03c7('0x58')]['id'];}return db[_0x03c7('0x3d')][_0x03c7('0x57')]({'where':{'id':_0x3a3ee6[_0x03c7('0x54')]['id']}})[_0x03c7('0x23')](handleEntityNotFound(_0x262c00,null))[_0x03c7('0x23')](saveUpdates(_0x3a3ee6[_0x03c7('0x58')],null))['then'](respondWithResult(_0x262c00,null))['catch'](handleError(_0x262c00,null));};exports[_0x03c7('0x38')]=function(_0x27005a,_0x1b1adb){return db[_0x03c7('0x3d')][_0x03c7('0x57')]({'where':{'id':_0x27005a[_0x03c7('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b1adb,null))['then'](removeEntity(_0x1b1adb,null))['catch'](handleError(_0x1b1adb,null));};exports['describe']=function(_0x454e71,_0x30e807){return db[_0x03c7('0x3d')][_0x03c7('0x59')]()[_0x03c7('0x23')](respondWithResult(_0x30e807,null))[_0x03c7('0x2c')](handleError(_0x30e807,null));};var interaction_log=require('../../config/logger')(_0x03c7('0x5a'));exports['accept']=function(_0x4ba32c,_0x121bf3,_0x3866e2){var _0x10bbad={'agent':{},'channel':'fax'};if(_0x4ba32c[_0x03c7('0x58')]['id']){delete _0x4ba32c['body']['id'];}_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5b')]=!![];_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5c')]=moment()[_0x03c7('0x5d')](_0x03c7('0x5e'));_0x4ba32c['body'][_0x03c7('0x5f')]=_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5f')]||_0x4ba32c[_0x03c7('0x60')]['id'];_0x10bbad[_0x03c7('0x61')]['id']=_0x4ba32c['body']['UserId'];return db[_0x03c7('0x3d')][_0x03c7('0x57')]({'where':{'id':_0x4ba32c['params']['id'],'UserId':null}})[_0x03c7('0x23')](handleEntityNotFound(_0x121bf3,null))[_0x03c7('0x23')](saveUpdates(_0x4ba32c[_0x03c7('0x58')],null))['then'](function(_0x4f2e56){if(_0x4f2e56){_0x10bbad[_0x03c7('0x2a')]=_0x4f2e56[_0x03c7('0x62')]({'plain':!![]});return db[_0x03c7('0x63')][_0x03c7('0x57')]({'where':{'id':_0x4f2e56['FaxInteractionId']}});}return null;})[_0x03c7('0x23')](handleEntityNotFound(_0x121bf3,null))['then'](function(_0x22d0df){if(_0x22d0df){return _0x22d0df[_0x03c7('0x37')]({'UserId':_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5f')],'read1stAt':_[_0x03c7('0x64')](_0x22d0df[_0x03c7('0x65')])?moment()[_0x03c7('0x5d')](_0x03c7('0x5e')):undefined});}return null;})[_0x03c7('0x23')](function(_0x1d5fd1){if(_0x1d5fd1){_0x10bbad['interaction']=_0x1d5fd1[_0x03c7('0x62')]({'plain':!![]});interaction_log[_0x03c7('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ba32c[_0x03c7('0x60')]['id'],_0x4ba32c[_0x03c7('0x60')][_0x03c7('0x3b')],_0x4ba32c[_0x03c7('0x60')][_0x03c7('0x66')],_0x10bbad[_0x03c7('0x67')]['id'],_0x4ba32c[_0x03c7('0x58')]?JSON[_0x03c7('0x28')](_0x4ba32c[_0x03c7('0x58')]):_0x03c7('0x68'));return respondWithRpcPromise(_0x03c7('0x69'),_0x03c7('0x6a'),_0x10bbad);}return null;})['then'](function(_0x116892){var _0x3eac5a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x116892[_0x03c7('0x2a')]['ContactId'];return db[_0x03c7('0x6b')][_0x03c7('0x43')](_0x3eac5a,{'type':db[_0x03c7('0x6c')]['QueryTypes'][_0x03c7('0x6d')],'raw':!![]})[_0x03c7('0x23')](function(_0x34ab2a){return _0x34ab2a;});})[_0x03c7('0x23')](function(_0x48b05b){if(_0x48b05b){_0x10bbad[_0x03c7('0x2a')]['contact']=_0x48b05b[0x0];if(!_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5f')])return;return db[_0x03c7('0x6e')][_0x03c7('0x57')]({'where':{'id':_0x4ba32c[_0x03c7('0x58')][_0x03c7('0x5f')],'role':_0x03c7('0x61')},'attributes':['id','name',_0x03c7('0x6f'),'email',_0x03c7('0x70')],'raw':!![]});}return null;})['then'](function(_0x4605f6){if(!_0x4605f6)return null;_0x10bbad[_0x03c7('0x2a')]['agent']=_0x4605f6;return _0x10bbad;})[_0x03c7('0x23')](function(_0x25bbcc){if(_0x25bbcc){if(_0x4ba32c['body']['manual']){_0x10bbad['message'][_0x03c7('0x71')]=util['format'](_0x03c7('0x72'),_0x4ba32c['user'][_0x03c7('0x3b')]);_0x10bbad[_0x03c7('0x2a')]['channel']=_0x10bbad[_0x03c7('0x73')];_0x10bbad[_0x03c7('0x2a')]['motionChannel']=_0x10bbad[_0x03c7('0x73')];_0x10bbad['message'][_0x03c7('0x74')]=_0x03c7('0x75');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x03c7('0x76'),'message':_0x10bbad[_0x03c7('0x2a')]},client9002)[_0x03c7('0x23')](function(){return _0x10bbad;});}return _0x10bbad;}return null;})['then'](respondWithResult(_0x121bf3,null))[_0x03c7('0x2c')](handleError(_0x121bf3,null));};var interaction_log=require(_0x03c7('0x19'))(_0x03c7('0x5a'));exports[_0x03c7('0x35')]=function(_0x160b22,_0x45dd1f,_0x312174){var _0x8d7181={'agent':{},'channel':_0x03c7('0x77')};if(_0x160b22[_0x03c7('0x58')]['id']){delete _0x160b22[_0x03c7('0x58')]['id'];}_0x160b22['body']['UserId']=_0x160b22[_0x03c7('0x58')]['UserId']||_0x160b22[_0x03c7('0x60')]['id'];_0x8d7181[_0x03c7('0x61')]['id']=_0x160b22['body'][_0x03c7('0x5f')];return db[_0x03c7('0x3d')][_0x03c7('0x57')]({'where':{'id':_0x160b22[_0x03c7('0x54')]['id'],'UserId':null}})[_0x03c7('0x23')](handleEntityNotFound(_0x45dd1f,null))[_0x03c7('0x23')](function(_0x5c0dbe){if(_0x5c0dbe){_0x8d7181[_0x03c7('0x2a')]=_0x5c0dbe[_0x03c7('0x62')]({'plain':!![]});return db[_0x03c7('0x63')][_0x03c7('0x57')]({'where':{'id':_0x5c0dbe[_0x03c7('0x78')]}});}return null;})[_0x03c7('0x23')](handleEntityNotFound(_0x45dd1f,null))['then'](function(_0x1935a3){if(_0x1935a3){_0x8d7181[_0x03c7('0x67')]=_0x1935a3['get']({'plain':!![]});interaction_log[_0x03c7('0x24')](_0x03c7('0x79'),_0x160b22['user']['id'],_0x160b22[_0x03c7('0x60')]['name'],_0x160b22['user'][_0x03c7('0x66')],_0x8d7181[_0x03c7('0x67')]['id'],_0x160b22['body']?JSON[_0x03c7('0x28')](_0x160b22[_0x03c7('0x58')]):_0x03c7('0x68'));return respondWithRpcPromise(_0x03c7('0x7a'),'rejectMessage',_0x8d7181);}return null;})[_0x03c7('0x23')](function(_0x52b117){var _0x3b4799=_0x03c7('0x7b')+_0x52b117[_0x03c7('0x2a')]['ContactId'];return db[_0x03c7('0x6b')][_0x03c7('0x43')](_0x3b4799,{'type':db[_0x03c7('0x6c')]['QueryTypes'][_0x03c7('0x6d')],'raw':!![]})['then'](function(_0x3c5c85){return _0x3c5c85;});})['then'](function(_0x263e0a){if(_0x263e0a){_0x8d7181[_0x03c7('0x2a')][_0x03c7('0x7c')]=_0x263e0a[0x0];if(!_0x160b22[_0x03c7('0x58')][_0x03c7('0x5f')])return;return db[_0x03c7('0x6e')][_0x03c7('0x57')]({'where':{'id':_0x160b22[_0x03c7('0x58')][_0x03c7('0x5f')],'role':'agent'},'attributes':['id',_0x03c7('0x3b'),_0x03c7('0x6f'),_0x03c7('0x7d'),_0x03c7('0x70')],'raw':!![]});}return null;})['then'](function(_0x195b85){if(!_0x195b85)return null;_0x8d7181[_0x03c7('0x2a')][_0x03c7('0x61')]=_0x195b85;return _0x8d7181;})[_0x03c7('0x23')](function(_0x3c2a89){if(_0x3c2a89){_0x3c2a89['message']['interface']=util['format'](_0x03c7('0x72'),_0x160b22[_0x03c7('0x60')][_0x03c7('0x3b')]);_0x3c2a89[_0x03c7('0x2a')][_0x03c7('0x73')]=_0x8d7181[_0x03c7('0x73')];_0x3c2a89['message'][_0x03c7('0x7e')]=_0x8d7181[_0x03c7('0x73')];_0x3c2a89[_0x03c7('0x2a')][_0x03c7('0x74')]=_0x03c7('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x3c2a89[_0x03c7('0x2a')]},client9002);return _0x8d7181;}return null;})['then'](respondWithResult(_0x45dd1f,null))[_0x03c7('0x2c')](handleError(_0x45dd1f,null));};exports[_0x03c7('0x7f')]=function(_0xb19143,_0x282ea7){var _0x398857;return db['FaxMessage'][_0x03c7('0x7f')](_0xb19143['body'],{})[_0x03c7('0x23')](function(_0x3dc9d1){_0x398857=_0x3dc9d1;return db[_0x03c7('0x80')][_0x03c7('0x81')]({'where':{'id':_0x398857[_0x03c7('0x82')]}});})[_0x03c7('0x23')](function(_0x574baa){if(_['isNil'](_0x574baa)){return;}else{_0x398857[_0x03c7('0x77')]=_0x574baa[_0x03c7('0x77')];return db[_0x03c7('0x83')][_0x03c7('0x81')]({'where':{'id':_0x398857['AttachmentId']}});}})[_0x03c7('0x23')](function(_0x37a818){return respondWithRpcPromise(_0x03c7('0x84'),'SendFax',{'FaxAccountId':_[_0x03c7('0x64')](_0xb19143[_0x03c7('0x58')])?undefined:_0xb19143[_0x03c7('0x58')][_0x03c7('0x85')],'path':_[_0x03c7('0x64')](_0x37a818)?undefined:util[_0x03c7('0x5d')]('/var/opt/motion2/server/files/attachments/%s',_0x37a818[_0x03c7('0x86')]),'fax':_[_0x03c7('0x64')](_0x398857[_0x03c7('0x77')])?undefined:_0x398857[_0x03c7('0x77')],'AttachmentId':_0x398857[_0x03c7('0x87')]},client9002);})[_0x03c7('0x23')](respondWithResult(_0x282ea7,0xc9))[_0x03c7('0x2c')](handleError(_0x282ea7,null));};exports[_0x03c7('0x88')]=function(_0x1473bc,_0x5ed304){var _0x24b47f=path[_0x03c7('0x89')](config[_0x03c7('0x8a')],_0x03c7('0x8b'),_0x03c7('0x8c'),'attachments');return db[_0x03c7('0x3d')][_0x03c7('0x57')]({'where':{'id':_0x1473bc['params']['id']},'include':[{'model':db[_0x03c7('0x83')],'as':_0x03c7('0x83')}]})[_0x03c7('0x23')](handleEntityNotFound(_0x5ed304,null))[_0x03c7('0x23')](function(_0x1aa1f7){if(_0x1aa1f7){return _0x5ed304[_0x03c7('0x88')](path[_0x03c7('0x89')](_0x24b47f,_0x1aa1f7[_0x03c7('0x83')][_0x03c7('0x86')]));}})[_0x03c7('0x2c')](handleError(_0x5ed304,null));}; \ No newline at end of file +var _0x407d=['channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','server','files','attachments','Attachment','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','http','client','request','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','findAll','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual'];(function(_0xf39b53,_0xae82a9){var _0x581950=function(_0xc27cb5){while(--_0xc27cb5){_0xf39b53['push'](_0xf39b53['shift']());}};_0x581950(++_0xae82a9);}(_0x407d,0x1d2));var _0xd407=function(_0x50c4d7,_0x485f9b){_0x50c4d7=_0x50c4d7-0x0;var _0x125ab1=_0x407d[_0x50c4d7];return _0x125ab1;};'use strict';var emlformat=require(_0xd407('0x0'));var rimraf=require(_0xd407('0x1'));var zipdir=require(_0xd407('0x2'));var jsonpatch=require(_0xd407('0x3'));var rp=require(_0xd407('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd407('0x5'));var sox=require(_0xd407('0x6'));var csv=require(_0xd407('0x7'));var ejs=require(_0xd407('0x8'));var fs=require('fs');var fs_extra=require(_0xd407('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd407('0xa'));var jsforce=require(_0xd407('0xb'));var deskjs=require(_0xd407('0xc'));var toCsv=require(_0xd407('0x7'));var querystring=require(_0xd407('0xd'));var Papa=require('papaparse');var Redis=require(_0xd407('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd407('0xf'));var as=require(_0xd407('0x10'));var hardwareService=require(_0xd407('0x11'));var logger=require(_0xd407('0x12'))(_0xd407('0x13'));var utils=require(_0xd407('0x14'));var config=require(_0xd407('0x15'));var licenseUtil=require(_0xd407('0x16'));var db=require(_0xd407('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd407('0x18'),'port':0x18eb});var socket=require(_0xd407('0x19'))(new Redis(config[_0xd407('0x1a')]));require(_0xd407('0x1b'))[_0xd407('0x1c')](socket);var jayson=require(_0xd407('0x1d'));var client=jayson['client'][_0xd407('0x1e')]({'port':0x232c});var client9002=jayson[_0xd407('0x1f')][_0xd407('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4d3ac7,_0x1dfc57,_0x44e19f,_0x435831){return new BPromise(function(_0xfe3587,_0x362432){var _0x4b43d1=_0x435831||client;return _0x4b43d1[_0xd407('0x20')](_0x4d3ac7,_0x44e19f)['then'](function(_0x2660f3){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1dfc57,_0xd407('0x21'));logger[_0xd407('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1dfc57,'request\x20sent',JSON[_0xd407('0x23')](_0x2660f3));if(_0x2660f3[_0xd407('0x24')]){if(_0x2660f3['error'][_0xd407('0x25')]===0x1f4){logger[_0xd407('0x24')](_0xd407('0x26'),_0x1dfc57,_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);return _0x362432(_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);}logger[_0xd407('0x24')](_0xd407('0x26'),_0x1dfc57,_0x2660f3['error']['message']);return _0xfe3587(_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);}else{logger[_0xd407('0x28')](_0xd407('0x26'),_0x1dfc57,'request\x20sent');_0xfe3587(_0x2660f3[_0xd407('0x29')][_0xd407('0x27')]);}})[_0xd407('0x2a')](function(_0x25a37c){logger[_0xd407('0x24')]('FaxMessage,\x20%s,\x20%s',_0x1dfc57,_0x25a37c);_0x362432(_0x25a37c);});});}function respondWithStatusCode(_0x44f9a1,_0xb96822){_0xb96822=_0xb96822||0xcc;return function(_0x1c2528){if(_0x1c2528){return _0x44f9a1[_0xd407('0x2b')](_0xb96822);}return _0x44f9a1[_0xd407('0x2c')](_0xb96822)[_0xd407('0x2d')]();};}function respondWithResult(_0x24cc7b,_0x2a1041){_0x2a1041=_0x2a1041||0xc8;return function(_0x5f215e){if(_0x5f215e){return _0x24cc7b[_0xd407('0x2c')](_0x2a1041)[_0xd407('0x2e')](_0x5f215e);}};}function respondWithFilteredResult(_0x49b82c,_0x2d938a){return function(_0x442c2f){if(_0x442c2f){var _0x919557=typeof _0x2d938a[_0xd407('0x2f')]===_0xd407('0x30')&&typeof _0x2d938a['limit']==='undefined';var _0x5ed04c=_0x442c2f[_0xd407('0x31')];var _0xebf3bf=_0x919557?0x0:_0x2d938a[_0xd407('0x2f')];var _0x5da0ee=_0x919557?_0x442c2f[_0xd407('0x31')]:_0x2d938a['offset']+_0x2d938a['limit'];var _0x3fd67f;if(_0x5da0ee>=_0x5ed04c){_0x5da0ee=_0x5ed04c;_0x3fd67f=0xc8;}else{_0x3fd67f=0xce;}_0x49b82c[_0xd407('0x2c')](_0x3fd67f);return _0x49b82c[_0xd407('0x32')](_0xd407('0x33'),_0xebf3bf+'-'+_0x5da0ee+'/'+_0x5ed04c)[_0xd407('0x2e')](_0x442c2f);}return null;};}function patchUpdates(_0xe926e4){return function(_0x3c9336){try{jsonpatch[_0xd407('0x34')](_0x3c9336,_0xe926e4,!![]);}catch(_0x434fa2){return BPromise[_0xd407('0x35')](_0x434fa2);}return _0x3c9336[_0xd407('0x36')]();};}function saveUpdates(_0x57e062,_0x331a83){return function(_0x54f6ef){if(_0x54f6ef){return _0x54f6ef[_0xd407('0x37')](_0x57e062)['then'](function(_0x6e43b4){return _0x6e43b4;});}return null;};}function removeEntity(_0xa85523,_0x3ee366){return function(_0x305dde){if(_0x305dde){return _0x305dde[_0xd407('0x38')]()['then'](function(){_0xa85523[_0xd407('0x2c')](0xcc)[_0xd407('0x2d')]();});}};}function handleEntityNotFound(_0xe6dbfe,_0x2d7e2a){return function(_0x313d00){if(!_0x313d00){_0xe6dbfe['sendStatus'](0x194);}return _0x313d00;};}function handleError(_0x24f47e,_0x1c35a1){_0x1c35a1=_0x1c35a1||0x1f4;return function(_0x2de778){logger[_0xd407('0x24')](_0x2de778[_0xd407('0x39')]);if(_0x2de778[_0xd407('0x3a')]){delete _0x2de778[_0xd407('0x3a')];}_0x24f47e['status'](_0x1c35a1)[_0xd407('0x3b')](_0x2de778);};}exports[_0xd407('0x3c')]=function(_0x49f9f4,_0x3da182){var _0xad514={},_0x284a94={},_0x634cf3={'count':0x0,'rows':[]};var _0x79c429=_[_0xd407('0x3d')](db[_0xd407('0x3e')][_0xd407('0x3f')],function(_0x15232b){return{'name':_0x15232b[_0xd407('0x40')],'type':_0x15232b['type'][_0xd407('0x41')]};});_0x284a94[_0xd407('0x42')]=_[_0xd407('0x3d')](_0x79c429,_0xd407('0x3a'));_0x284a94['query']=_[_0xd407('0x43')](_0x49f9f4[_0xd407('0x44')]);_0x284a94[_0xd407('0x45')]=_['intersection'](_0x284a94[_0xd407('0x42')],_0x284a94[_0xd407('0x44')]);_0xad514[_0xd407('0x46')]=_[_0xd407('0x47')](_0x284a94['model'],qs[_0xd407('0x48')](_0x49f9f4['query']['fields']));_0xad514[_0xd407('0x46')]=_0xad514[_0xd407('0x46')][_0xd407('0x49')]?_0xad514[_0xd407('0x46')]:_0x284a94[_0xd407('0x42')];if(!_0x49f9f4[_0xd407('0x44')]['hasOwnProperty'](_0xd407('0x4a'))){_0xad514[_0xd407('0x4b')]=qs['limit'](_0x49f9f4[_0xd407('0x44')]['limit']);_0xad514['offset']=qs[_0xd407('0x2f')](_0x49f9f4['query'][_0xd407('0x2f')]);}_0xad514[_0xd407('0x4c')]=qs['sort'](_0x49f9f4[_0xd407('0x44')][_0xd407('0x4d')]);_0xad514['where']=qs['filters'](_[_0xd407('0x4e')](_0x49f9f4[_0xd407('0x44')],_0x284a94[_0xd407('0x45')]),_0x79c429);if(_0x49f9f4[_0xd407('0x44')][_0xd407('0x4f')]){_0xad514[_0xd407('0x50')]=_[_0xd407('0x51')](_0xad514[_0xd407('0x50')],{'$or':_[_0xd407('0x3d')](_0x79c429,function(_0x7cc992){if(_0x7cc992[_0xd407('0x52')]!==_0xd407('0x53')){var _0xea8309={};_0xea8309[_0x7cc992['name']]={'$like':'%'+_0x49f9f4[_0xd407('0x44')]['filter']+'%'};return _0xea8309;}})});}_0xad514=_['merge']({},_0xad514,_0x49f9f4[_0xd407('0x54')]);var _0x397442={'where':_0xad514['where']};return db[_0xd407('0x3e')][_0xd407('0x31')](_0x397442)[_0xd407('0x55')](function(_0x54c14c){_0x634cf3[_0xd407('0x31')]=_0x54c14c;if(_0x49f9f4[_0xd407('0x44')][_0xd407('0x56')]){_0xad514[_0xd407('0x57')]=[{'all':!![]}];}return db[_0xd407('0x3e')][_0xd407('0x58')](_0xad514);})[_0xd407('0x55')](function(_0x270154){_0x634cf3['rows']=_0x270154;return _0x634cf3;})['then'](respondWithFilteredResult(_0x3da182,_0xad514))[_0xd407('0x2a')](handleError(_0x3da182,null));};exports[_0xd407('0x59')]=function(_0x390633,_0x34dc48){var _0x132173={'raw':!![],'where':{'id':_0x390633[_0xd407('0x5a')]['id']}},_0x277dba={};_0x277dba['model']=_['keys'](db[_0xd407('0x3e')][_0xd407('0x3f')]);_0x277dba[_0xd407('0x44')]=_['keys'](_0x390633[_0xd407('0x44')]);_0x277dba[_0xd407('0x45')]=_[_0xd407('0x47')](_0x277dba[_0xd407('0x42')],_0x277dba[_0xd407('0x44')]);_0x132173[_0xd407('0x46')]=_[_0xd407('0x47')](_0x277dba['model'],qs[_0xd407('0x48')](_0x390633[_0xd407('0x44')][_0xd407('0x48')]));_0x132173[_0xd407('0x46')]=_0x132173['attributes'][_0xd407('0x49')]?_0x132173[_0xd407('0x46')]:_0x277dba['model'];if(_0x390633[_0xd407('0x44')][_0xd407('0x56')]){_0x132173[_0xd407('0x57')]=[{'all':!![]}];}_0x132173=_[_0xd407('0x51')]({},_0x132173,_0x390633[_0xd407('0x54')]);return db[_0xd407('0x3e')][_0xd407('0x5b')](_0x132173)[_0xd407('0x55')](handleEntityNotFound(_0x34dc48,null))[_0xd407('0x55')](respondWithResult(_0x34dc48,null))[_0xd407('0x2a')](handleError(_0x34dc48,null));};exports['update']=function(_0x4e2bb5,_0x940784){if(_0x4e2bb5[_0xd407('0x5c')]['id']){delete _0x4e2bb5[_0xd407('0x5c')]['id'];}return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x4e2bb5['params']['id']}})[_0xd407('0x55')](handleEntityNotFound(_0x940784,null))['then'](saveUpdates(_0x4e2bb5['body'],null))['then'](respondWithResult(_0x940784,null))[_0xd407('0x2a')](handleError(_0x940784,null));};exports[_0xd407('0x38')]=function(_0x219c4a,_0x4d1ce9){return db['FaxMessage'][_0xd407('0x5b')]({'where':{'id':_0x219c4a[_0xd407('0x5a')]['id']}})[_0xd407('0x55')](handleEntityNotFound(_0x4d1ce9,null))[_0xd407('0x55')](removeEntity(_0x4d1ce9,null))[_0xd407('0x2a')](handleError(_0x4d1ce9,null));};exports[_0xd407('0x5d')]=function(_0x3e55f7,_0x2f95a8){return db[_0xd407('0x3e')][_0xd407('0x5d')]()[_0xd407('0x55')](respondWithResult(_0x2f95a8,null))['catch'](handleError(_0x2f95a8,null));};var interaction_log=require('../../config/logger')(_0xd407('0x5e'));exports[_0xd407('0x5f')]=function(_0x36f643,_0x5b69fb,_0x4734fe){var _0x329c69={'agent':{},'channel':_0xd407('0x60')};if(_0x36f643[_0xd407('0x5c')]['id']){delete _0x36f643[_0xd407('0x5c')]['id'];}_0x36f643[_0xd407('0x5c')][_0xd407('0x61')]=!![];_0x36f643['body'][_0xd407('0x62')]=moment()[_0xd407('0x63')](_0xd407('0x64'));_0x36f643[_0xd407('0x5c')][_0xd407('0x65')]=_0x36f643[_0xd407('0x5c')][_0xd407('0x65')]||_0x36f643[_0xd407('0x66')]['id'];_0x329c69['agent']['id']=_0x36f643['body'][_0xd407('0x65')];return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x36f643[_0xd407('0x5a')]['id'],'UserId':null}})[_0xd407('0x55')](handleEntityNotFound(_0x5b69fb,null))[_0xd407('0x55')](saveUpdates(_0x36f643[_0xd407('0x5c')],null))[_0xd407('0x55')](function(_0x5e4d8a){if(_0x5e4d8a){_0x329c69[_0xd407('0x27')]=_0x5e4d8a[_0xd407('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xd407('0x5b')]({'where':{'id':_0x5e4d8a['FaxInteractionId']}});}return null;})[_0xd407('0x55')](handleEntityNotFound(_0x5b69fb,null))[_0xd407('0x55')](function(_0x33aafb){if(_0x33aafb){return _0x33aafb[_0xd407('0x37')]({'UserId':_0x36f643['body'][_0xd407('0x65')],'read1stAt':_[_0xd407('0x68')](_0x33aafb[_0xd407('0x69')])?moment()[_0xd407('0x63')](_0xd407('0x64')):undefined});}return null;})['then'](function(_0x3e6bf2){if(_0x3e6bf2){_0x329c69['interaction']=_0x3e6bf2[_0xd407('0x67')]({'plain':!![]});interaction_log[_0xd407('0x28')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x36f643[_0xd407('0x66')]['id'],_0x36f643[_0xd407('0x66')][_0xd407('0x3a')],_0x36f643[_0xd407('0x66')][_0xd407('0x6a')],_0x329c69[_0xd407('0x6b')]['id'],_0x36f643['body']?JSON['stringify'](_0x36f643['body']):_0xd407('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xd407('0x6d'),_0x329c69);}return null;})['then'](function(_0x47f8ee){var _0x3316d0=_0xd407('0x6e')+_0x47f8ee[_0xd407('0x27')][_0xd407('0x6f')];return db['sequelize'][_0xd407('0x44')](_0x3316d0,{'type':db[_0xd407('0x70')][_0xd407('0x71')][_0xd407('0x72')],'raw':!![]})['then'](function(_0x2af668){return _0x2af668;});})[_0xd407('0x55')](function(_0xddd62b){if(_0xddd62b){_0x329c69[_0xd407('0x27')][_0xd407('0x73')]=_0xddd62b[0x0];if(!_0x36f643[_0xd407('0x5c')]['UserId'])return;return db[_0xd407('0x74')][_0xd407('0x5b')]({'where':{'id':_0x36f643[_0xd407('0x5c')]['UserId'],'role':_0xd407('0x75')},'attributes':['id',_0xd407('0x3a'),_0xd407('0x76'),_0xd407('0x77'),_0xd407('0x78')],'raw':!![]});}return null;})['then'](function(_0x495ec7){if(!_0x495ec7)return null;_0x329c69[_0xd407('0x27')][_0xd407('0x75')]=_0x495ec7;return _0x329c69;})[_0xd407('0x55')](function(_0x51917e){if(_0x51917e){if(_0x36f643[_0xd407('0x5c')][_0xd407('0x79')]){_0x329c69[_0xd407('0x27')]['interface']=util[_0xd407('0x63')]('SIP/%s',_0x36f643[_0xd407('0x66')]['name']);_0x329c69[_0xd407('0x27')][_0xd407('0x7a')]=_0x329c69[_0xd407('0x7a')];_0x329c69[_0xd407('0x27')][_0xd407('0x7b')]=_0x329c69[_0xd407('0x7a')];_0x329c69[_0xd407('0x27')][_0xd407('0x7c')]=_0xd407('0x5f');return respondWithRpcPromise('EventManager',_0xd407('0x7d'),{'event':_0xd407('0x7e'),'message':_0x329c69[_0xd407('0x27')]},client9002)[_0xd407('0x55')](function(){return _0x329c69;});}return _0x329c69;}return null;})[_0xd407('0x55')](respondWithResult(_0x5b69fb,null))[_0xd407('0x2a')](handleError(_0x5b69fb,null));};var interaction_log=require(_0xd407('0x12'))(_0xd407('0x5e'));exports[_0xd407('0x35')]=function(_0x4fe423,_0x15504c,_0x5b3d88){var _0x207edc={'agent':{},'channel':_0xd407('0x60')};if(_0x4fe423[_0xd407('0x5c')]['id']){delete _0x4fe423['body']['id'];}_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')]=_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')]||_0x4fe423[_0xd407('0x66')]['id'];_0x207edc['agent']['id']=_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')];return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x4fe423[_0xd407('0x5a')]['id'],'UserId':null}})[_0xd407('0x55')](handleEntityNotFound(_0x15504c,null))['then'](function(_0x90d283){if(_0x90d283){_0x207edc[_0xd407('0x27')]=_0x90d283['get']({'plain':!![]});return db[_0xd407('0x7f')]['find']({'where':{'id':_0x90d283['FaxInteractionId']}});}return null;})[_0xd407('0x55')](handleEntityNotFound(_0x15504c,null))['then'](function(_0x4b952d){if(_0x4b952d){_0x207edc[_0xd407('0x6b')]=_0x4b952d[_0xd407('0x67')]({'plain':!![]});interaction_log['info'](_0xd407('0x80'),_0x4fe423[_0xd407('0x66')]['id'],_0x4fe423[_0xd407('0x66')][_0xd407('0x3a')],_0x4fe423[_0xd407('0x66')][_0xd407('0x6a')],_0x207edc[_0xd407('0x6b')]['id'],_0x4fe423[_0xd407('0x5c')]?JSON['stringify'](_0x4fe423[_0xd407('0x5c')]):_0xd407('0x6c'));return respondWithRpcPromise(_0xd407('0x81'),_0xd407('0x82'),_0x207edc);}return null;})[_0xd407('0x55')](function(_0x1cbb84){var _0x54afca=_0xd407('0x6e')+_0x1cbb84[_0xd407('0x27')][_0xd407('0x6f')];return db['sequelize'][_0xd407('0x44')](_0x54afca,{'type':db[_0xd407('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x3f77b5){return _0x3f77b5;});})[_0xd407('0x55')](function(_0x13fd0f){if(_0x13fd0f){_0x207edc['message']['contact']=_0x13fd0f[0x0];if(!_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')])return;return db[_0xd407('0x74')][_0xd407('0x5b')]({'where':{'id':_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')],'role':_0xd407('0x75')},'attributes':['id','name',_0xd407('0x76'),_0xd407('0x77'),'internal'],'raw':!![]});}return null;})[_0xd407('0x55')](function(_0x434351){if(!_0x434351)return null;_0x207edc[_0xd407('0x27')][_0xd407('0x75')]=_0x434351;return _0x207edc;})[_0xd407('0x55')](function(_0x545ba3){if(_0x545ba3){_0x545ba3[_0xd407('0x27')]['interface']=util[_0xd407('0x63')]('SIP/%s',_0x4fe423[_0xd407('0x66')]['name']);_0x545ba3[_0xd407('0x27')][_0xd407('0x7a')]=_0x207edc[_0xd407('0x7a')];_0x545ba3['message'][_0xd407('0x7b')]=_0x207edc['channel'];_0x545ba3[_0xd407('0x27')][_0xd407('0x7c')]=_0xd407('0x35');respondWithRpcPromise(_0xd407('0x7d'),_0xd407('0x7d'),{'event':_0xd407('0x83'),'message':_0x545ba3['message']},client9002);return _0x207edc;}return null;})[_0xd407('0x55')](respondWithResult(_0x15504c,null))['catch'](handleError(_0x15504c,null));};exports[_0xd407('0x84')]=function(_0x1eec68,_0x5afef8){var _0x3fc0eb;return db['FaxMessage'][_0xd407('0x84')](_0x1eec68[_0xd407('0x5c')],{})[_0xd407('0x55')](function(_0x213da4){_0x3fc0eb=_0x213da4;return db[_0xd407('0x85')][_0xd407('0x86')]({'where':{'id':_0x3fc0eb[_0xd407('0x6f')]}});})[_0xd407('0x55')](function(_0x324109){if(_[_0xd407('0x68')](_0x324109)){return;}else{_0x3fc0eb['fax']=_0x324109[_0xd407('0x60')];return db['Attachment'][_0xd407('0x86')]({'where':{'id':_0x3fc0eb[_0xd407('0x87')]}});}})['then'](function(_0x48ba4a){return respondWithRpcPromise(_0xd407('0x88'),_0xd407('0x88'),{'FaxAccountId':_[_0xd407('0x68')](_0x1eec68[_0xd407('0x5c')])?undefined:_0x1eec68[_0xd407('0x5c')][_0xd407('0x89')],'path':_[_0xd407('0x68')](_0x48ba4a)?undefined:util['format'](_0xd407('0x8a'),_0x48ba4a['basename']),'fax':_[_0xd407('0x68')](_0x3fc0eb[_0xd407('0x60')])?undefined:_0x3fc0eb[_0xd407('0x60')],'AttachmentId':_0x3fc0eb[_0xd407('0x87')]},client9002);})[_0xd407('0x55')](respondWithResult(_0x5afef8,0xc9))[_0xd407('0x2a')](handleError(_0x5afef8,null));};exports[_0xd407('0x8b')]=function(_0x3fe118,_0xb9de1c){var _0x1161a4=path['join'](config[_0xd407('0x8c')],_0xd407('0x8d'),_0xd407('0x8e'),_0xd407('0x8f'));return db['FaxMessage'][_0xd407('0x5b')]({'where':{'id':_0x3fe118[_0xd407('0x5a')]['id']},'include':[{'model':db[_0xd407('0x90')],'as':_0xd407('0x90')}]})[_0xd407('0x55')](handleEntityNotFound(_0xb9de1c,null))[_0xd407('0x55')](function(_0x5ed7b4){if(_0x5ed7b4){return _0xb9de1c['download'](path[_0xd407('0x91')](_0x1161a4,_0x5ed7b4[_0xd407('0x90')][_0xd407('0x92')]));}})[_0xd407('0x2a')](handleError(_0xb9de1c,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d44db1b..9545ac2 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 _0xf811=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x41c690,_0x38e97a){var _0x1df86a=function(_0x4e19b5){while(--_0x4e19b5){_0x41c690['push'](_0x41c690['shift']());}};_0x1df86a(++_0x38e97a);}(_0xf811,0x6f));var _0x1f81=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xf811[_0x474bc0];return _0x4b24cf;};'use strict';var EventEmitter=require(_0x1f81('0x0'));var FaxMessage=require(_0x1f81('0x1'))['db'][_0x1f81('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1f81('0x3')](0x0);var events={'afterCreate':_0x1f81('0x4'),'afterUpdate':_0x1f81('0x5'),'afterDestroy':_0x1f81('0x6')};function emitEvent(_0x1650f4){return function(_0x18f178,_0x4281c3,_0x40b2b6){FaxMessageEvents[_0x1f81('0x7')](_0x1650f4+':'+_0x18f178['id'],_0x18f178);FaxMessageEvents[_0x1f81('0x7')](_0x1650f4,_0x18f178);_0x40b2b6(null);};}for(var e in events){if(events[_0x1f81('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1f81('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x1b64=['setMaxListeners','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3a24b8,_0x1b7651){var _0x502dd8=function(_0x227756){while(--_0x227756){_0x3a24b8['push'](_0x3a24b8['shift']());}};_0x502dd8(++_0x1b7651);}(_0x1b64,0x76));var _0x41b6=function(_0xd7eae5,_0x4b0c0b){_0xd7eae5=_0xd7eae5-0x0;var _0x2c24d3=_0x1b64[_0xd7eae5];return _0x2c24d3;};'use strict';var EventEmitter=require(_0x41b6('0x0'));var FaxMessage=require(_0x41b6('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x41b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3204fe){return function(_0x1f979b,_0xd38c24,_0x19f577){FaxMessageEvents['emit'](_0x3204fe+':'+_0x1f979b['id'],_0x1f979b);FaxMessageEvents[_0x41b6('0x3')](_0x3204fe,_0x1f979b);_0x19f577(null);};}for(var e in events){if(events[_0x41b6('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 41e25b7..fb038ff 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 _0x10dc=['FaxInteractionId','update','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x10dc,0x122));var _0xc10d=function(_0x47cd62,_0x19bbf3){_0x47cd62=_0x47cd62-0x0;var _0x7923b9=_0x10dc[_0x47cd62];return _0x7923b9;};'use strict';var _=require('lodash');var util=require(_0xc10d('0x0'));var logger=require(_0xc10d('0x1'))(_0xc10d('0x2'));var moment=require(_0xc10d('0x3'));var BPromise=require(_0xc10d('0x4'));var rp=require(_0xc10d('0x5'));var fs=require('fs');var path=require(_0xc10d('0x6'));var rimraf=require(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var attributes=require(_0xc10d('0x9'));module[_0xc10d('0xa')]=function(_0x57a6ea,_0xcc3577){return _0x57a6ea[_0xc10d('0xb')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xc10d('0xc'),'fields':['body'],'type':_0xc10d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x212d65,_0x291470,_0x525c01){var _0x1d6833=_0x57a6ea[_0xc10d('0xe')];var _0x29c178=_0x212d65[_0xc10d('0xf')]({'plain':!![]});if(_0x29c178[_0xc10d('0x10')][_0xc10d('0x11')]()==='in'||_0x29c178[_0xc10d('0x10')]['toLowerCase']()===_0xc10d('0x12')&&!_0x29c178[_0xc10d('0x13')]&&!_[_0xc10d('0x14')](_0x29c178['UserId'])){_0x1d6833[_0xc10d('0x15')]['findOne']({'where':{'id':_0x29c178[_0xc10d('0x16')]}})['then'](function(_0x531cd0){if(_0x531cd0){_0x531cd0[_0xc10d('0x17')]({'lastMsgAt':_0x29c178['createdAt'],'lastMsgDirection':_0x29c178['direction'][_0xc10d('0x11')]()});}})['catch'](function(_0x5cf409){console[_0xc10d('0x18')](_0x5cf409);});}_0x525c01();}},'charset':_0xc10d('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8e8b=['then','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0x8e8b,0xad));var _0xb8e8=function(_0x38b7d2,_0x583aab){_0x38b7d2=_0x38b7d2-0x0;var _0x80e337=_0x8e8b[_0x38b7d2];return _0x80e337;};'use strict';var _=require(_0xb8e8('0x0'));var util=require(_0xb8e8('0x1'));var logger=require(_0xb8e8('0x2'))(_0xb8e8('0x3'));var moment=require('moment');var BPromise=require(_0xb8e8('0x4'));var rp=require(_0xb8e8('0x5'));var fs=require('fs');var path=require(_0xb8e8('0x6'));var rimraf=require(_0xb8e8('0x7'));var config=require(_0xb8e8('0x8'));var attributes=require(_0xb8e8('0x9'));module[_0xb8e8('0xa')]=function(_0x2f1449,_0x56a121){return _0x2f1449['define'](_0xb8e8('0xb'),attributes,{'tableName':_0xb8e8('0xc'),'paranoid':![],'indexes':[{'name':_0xb8e8('0xd'),'fields':[_0xb8e8('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x299d68,_0x5cdb0f,_0xab3440){var _0x1e09cf=_0x2f1449[_0xb8e8('0xf')];var _0x292928=_0x299d68['get']({'plain':!![]});if(_0x292928[_0xb8e8('0x10')]['toLowerCase']()==='in'||_0x292928[_0xb8e8('0x10')][_0xb8e8('0x11')]()==='out'&&!_0x292928['secret']&&!_[_0xb8e8('0x12')](_0x292928[_0xb8e8('0x13')])){_0x1e09cf[_0xb8e8('0x14')][_0xb8e8('0x15')]({'where':{'id':_0x292928[_0xb8e8('0x16')]}})[_0xb8e8('0x17')](function(_0x3fed32){if(_0x3fed32){_0x3fed32[_0xb8e8('0x18')]({'lastMsgAt':_0x292928[_0xb8e8('0x19')],'lastMsgDirection':_0x292928['direction']['toLowerCase']()});}})[_0xb8e8('0x1a')](function(_0x3e12de){console['error'](_0x3e12de);});}_0xab3440();}},'charset':_0xb8e8('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 92c0d94..81953b6 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 _0x207c=['result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0x491d53,_0x119d7b){var _0x3a8be3=function(_0x2e4ed3){while(--_0x2e4ed3){_0x491d53['push'](_0x491d53['shift']());}};_0x3a8be3(++_0x119d7b);}(_0x207c,0x1e8));var _0xc207=function(_0x280d43,_0x2e7450){_0x280d43=_0x280d43-0x0;var _0x14446d=_0x207c[_0x280d43];return _0x14446d;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./faxMessage.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('FaxMessage,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')](_0x461f6a[_0xc207('0x1b')],{'raw':_0x461f6a[_0xc207('0x1c')]?_0x461f6a[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x163b36){logger['info'](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x163b36));_0x2caec5(_0x163b36);})[_0xc207('0x17')](function(_0xd209ac){logger[_0xc207('0x12')](_0xc207('0x18'),_0xd209ac[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770[_0xc207('0x12')](0x1f4,_0xd209ac[_0xc207('0x15')]));});});};exports[_0xc207('0x1e')]=function(_0x3f738e){var _0x138970=this;return new Promise(function(_0x1445d3,_0x56a066){return db[_0xc207('0x19')]['update'](_0x3f738e['body'],{'raw':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')]['where']||null:null,'attributes':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1f')]||null:null,'limit':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x20')]||null:null})[_0xc207('0x21')](function(_0x27bc72){logger[_0xc207('0xe')](_0xc207('0x1e'),_0x3f738e);logger[_0xc207('0x10')](_0xc207('0x1e'),_0x3f738e,JSON[_0xc207('0x11')](_0x27bc72));_0x1445d3(_0x27bc72);})['catch'](function(_0x1cc799){logger[_0xc207('0x12')](_0xc207('0x1e'),_0x1cc799[_0xc207('0x15')],_0x3f738e);_0x56a066(_0x138970[_0xc207('0x12')](0x1f4,_0x1cc799[_0xc207('0x15')]));});});}; \ No newline at end of file +var _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x7bae[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index f2f968e..9ad4029 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 _0xc96d=['save','update','emit','removeListener','register','length','./faxMessage.events'];(function(_0x31abac,_0x1a3457){var _0x1160ff=function(_0x4794d8){while(--_0x4794d8){_0x31abac['push'](_0x31abac['shift']());}};_0x1160ff(++_0x1a3457);}(_0xc96d,0xc3));var _0xdc96=function(_0x2fe932,_0x448c1d){_0x2fe932=_0x2fe932-0x0;var _0x56fbaf=_0xc96d[_0x2fe932];return _0x56fbaf;};'use strict';var FaxMessageEvents=require(_0xdc96('0x0'));var events=[_0xdc96('0x1'),'remove',_0xdc96('0x2')];function createListener(_0x15702d,_0x4798a7){return function(_0x365f01){_0x4798a7[_0xdc96('0x3')](_0x15702d,_0x365f01);};}function removeListener(_0x42bd64,_0x13ba78){return function(){FaxMessageEvents[_0xdc96('0x4')](_0x42bd64,_0x13ba78);};}exports[_0xdc96('0x5')]=function(_0xd47a82){for(var _0x4019fb=0x0,_0x4fc8b0=events[_0xdc96('0x6')];_0x4019fb<_0x4fc8b0;_0x4019fb++){var _0x2dfdac=events[_0x4019fb];var _0x47b0b2=createListener('faxMessage:'+_0x2dfdac,_0xd47a82);FaxMessageEvents['on'](_0x2dfdac,_0x47b0b2);}}; \ No newline at end of file +var _0xb944=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xb944,0xca));var _0x4b94=function(_0xf4fee8,_0x5951ce){_0xf4fee8=_0xf4fee8-0x0;var _0x1303d7=_0xb944[_0xf4fee8];return _0x1303d7;};'use strict';var FaxMessageEvents=require(_0x4b94('0x0'));var events=[_0x4b94('0x1'),_0x4b94('0x2'),_0x4b94('0x3')];function createListener(_0x54470f,_0x215149){return function(_0x32047d){_0x215149[_0x4b94('0x4')](_0x54470f,_0x32047d);};}function removeListener(_0x45d3d6,_0x43aaa1){return function(){FaxMessageEvents[_0x4b94('0x5')](_0x45d3d6,_0x43aaa1);};}exports[_0x4b94('0x6')]=function(_0x44661d){for(var _0x4ba9ea=0x0,_0x2c9459=events[_0x4b94('0x7')];_0x4ba9ea<_0x2c9459;_0x4ba9ea++){var _0x301db0=events[_0x4ba9ea];var _0x3d851d=createListener(_0x4b94('0x8')+_0x301db0,_0x44661d);FaxMessageEvents['on'](_0x301db0,_0x3d851d);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a86f728..e555971 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 _0x593e=['../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','fax','faxmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x783834,_0x38c810){var _0x22055f=function(_0x6a6998){while(--_0x6a6998){_0x783834['push'](_0x783834['shift']());}};_0x22055f(++_0x38c810);}(_0x593e,0xcb));var _0xe593=function(_0x227920,_0x5b0b0e){_0x227920=_0x227920-0x0;var _0x280027=_0x593e[_0x227920];return _0x280027;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var fs_extra=require(_0xe593('0x6'));var auth=require(_0xe593('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x8'));var controller=require(_0xe593('0x9'));router[_0xe593('0xa')]('/',auth[_0xe593('0xb')](),controller[_0xe593('0xc')]);router[_0xe593('0xa')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0xe')]);router[_0xe593('0xa')]('/:id',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),interaction['tracked'](_0xe593('0x12'),_0xe593('0x13')),controller[_0xe593('0x14')]);router[_0xe593('0x15')](_0xe593('0x16'),auth[_0xe593('0xb')](),controller[_0xe593('0x17')]);router[_0xe593('0x15')](_0xe593('0x18'),auth[_0xe593('0xb')](),controller['accept']);router[_0xe593('0x15')](_0xe593('0x19'),auth['isAuthenticated'](),controller[_0xe593('0x1a')]);router[_0xe593('0x1b')]('/:id',auth[_0xe593('0xb')](),controller[_0xe593('0x1c')]);module[_0xe593('0x1d')]=router; \ No newline at end of file +var _0x57f8=['../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x57f8,0x198));var _0x857f=function(_0x555ef8,_0x43e041){_0x555ef8=_0x555ef8-0x0;var _0x38cc30=_0x57f8[_0x555ef8];return _0x38cc30;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['describe']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['download']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),interaction[_0x857f('0x10')](_0x857f('0x11'),_0x857f('0x12')),controller[_0x857f('0x13')]);router[_0x857f('0x14')]('/:id',auth[_0x857f('0xb')](),controller[_0x857f('0x15')]);router[_0x857f('0x14')](_0x857f('0x16'),auth[_0x857f('0xb')](),controller['accept']);router['put'](_0x857f('0x17'),auth['isAuthenticated'](),controller[_0x857f('0x18')]);router['delete'](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['destroy']);module[_0x857f('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 1a0ebb6..e4e4ab7 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 _0x5950=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x97ec0e,_0x10eb67){var _0x1fd9dd=function(_0x187652){while(--_0x187652){_0x97ec0e['push'](_0x97ec0e['shift']());}};_0x1fd9dd(++_0x10eb67);}(_0x5950,0x11e));var _0x0595=function(_0x329432,_0x405c12){_0x329432=_0x329432-0x0;var _0x51a741=_0x5950[_0x329432];return _0x51a741;};'use strict';var Sequelize=require(_0x0595('0x0'));module[_0x0595('0x1')]={'name':{'type':Sequelize[_0x0595('0x2')],'unique':_0x0595('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0595('0x2')]},'timeout':{'type':Sequelize[_0x0595('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0595('0x5')](_0x0595('0x6'),_0x0595('0x7'),_0x0595('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x0595('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ecc=['roundrobin','exports','STRING','INTEGER','beepall'];(function(_0x2b6c1f,_0x397f69){var _0xac16cc=function(_0x43d13c){while(--_0x43d13c){_0x2b6c1f['push'](_0x2b6c1f['shift']());}};_0xac16cc(++_0x397f69);}(_0x0ecc,0x146));var _0xc0ec=function(_0x556117,_0x21bfa3){_0x556117=_0x556117-0x0;var _0x4a68c3=_0x0ecc[_0x556117];return _0x4a68c3;};'use strict';var Sequelize=require('sequelize');module[_0xc0ec('0x0')]={'name':{'type':Sequelize[_0xc0ec('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc0ec('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xc0ec('0x3'),_0xc0ec('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc0ec('0x2')],'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 9c0adcf..ae462b8 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 _0xcbee=['findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','User','UserId','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','online','interface','transaction','each','findOrCreate','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','includes','all','compact','removeTeams','removeAgents','forEach','emit','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include'];(function(_0x2b2a51,_0x3a8ff6){var _0x271f0d=function(_0xe9cbb){while(--_0xe9cbb){_0x2b2a51['push'](_0x2b2a51['shift']());}};_0x271f0d(++_0x3a8ff6);}(_0xcbee,0x1e0));var _0xecbe=function(_0x1847bd,_0xd743c5){_0x1847bd=_0x1847bd-0x0;var _0x1dbb02=_0xcbee[_0x1847bd];return _0x1dbb02;};'use strict';var emlformat=require(_0xecbe('0x0'));var rimraf=require(_0xecbe('0x1'));var zipdir=require(_0xecbe('0x2'));var jsonpatch=require(_0xecbe('0x3'));var rp=require(_0xecbe('0x4'));var moment=require('moment');var BPromise=require(_0xecbe('0x5'));var Mustache=require('mustache');var util=require(_0xecbe('0x6'));var path=require(_0xecbe('0x7'));var sox=require(_0xecbe('0x8'));var csv=require(_0xecbe('0x9'));var ejs=require(_0xecbe('0xa'));var fs=require('fs');var fs_extra=require(_0xecbe('0xb'));var _=require(_0xecbe('0xc'));var squel=require(_0xecbe('0xd'));var crypto=require(_0xecbe('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xecbe('0x9'));var querystring=require(_0xecbe('0xf'));var Papa=require(_0xecbe('0x10'));var Redis=require(_0xecbe('0x11'));var authService=require(_0xecbe('0x12'));var qs=require(_0xecbe('0x13'));var as=require(_0xecbe('0x14'));var hardwareService=require(_0xecbe('0x15'));var logger=require(_0xecbe('0x16'))('api');var utils=require(_0xecbe('0x17'));var config=require(_0xecbe('0x18'));var licenseUtil=require(_0xecbe('0x19'));var db=require('../../mysqldb')['db'];config[_0xecbe('0x1a')]=_[_0xecbe('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecbe('0x1a')]));require('./faxQueue.socket')[_0xecbe('0x1c')](socket);function respondWithStatusCode(_0x41500f,_0x3389ec){_0x3389ec=_0x3389ec||0xcc;return function(_0x2d3f61){if(_0x2d3f61){return _0x41500f[_0xecbe('0x1d')](_0x3389ec);}return _0x41500f[_0xecbe('0x1e')](_0x3389ec)[_0xecbe('0x1f')]();};}function respondWithResult(_0x41db03,_0x33b773){_0x33b773=_0x33b773||0xc8;return function(_0x498cfe){if(_0x498cfe){return _0x41db03[_0xecbe('0x1e')](_0x33b773)[_0xecbe('0x20')](_0x498cfe);}};}function respondWithFilteredResult(_0x42c15f,_0x2e8db7){return function(_0xebbd18){if(_0xebbd18){var _0x593ad4=typeof _0x2e8db7[_0xecbe('0x21')]===_0xecbe('0x22')&&typeof _0x2e8db7['limit']===_0xecbe('0x22');var _0x10851f=_0xebbd18[_0xecbe('0x23')];var _0x4f5364=_0x593ad4?0x0:_0x2e8db7['offset'];var _0x50ad69=_0x593ad4?_0xebbd18['count']:_0x2e8db7[_0xecbe('0x21')]+_0x2e8db7['limit'];var _0x4d9280;if(_0x50ad69>=_0x10851f){_0x50ad69=_0x10851f;_0x4d9280=0xc8;}else{_0x4d9280=0xce;}_0x42c15f[_0xecbe('0x1e')](_0x4d9280);return _0x42c15f[_0xecbe('0x24')](_0xecbe('0x25'),_0x4f5364+'-'+_0x50ad69+'/'+_0x10851f)[_0xecbe('0x20')](_0xebbd18);}return null;};}function patchUpdates(_0x29d07e){return function(_0x549731){try{jsonpatch[_0xecbe('0x26')](_0x549731,_0x29d07e,!![]);}catch(_0x362aee){return BPromise[_0xecbe('0x27')](_0x362aee);}return _0x549731[_0xecbe('0x28')]();};}function saveUpdates(_0x148039,_0x1731dc){return function(_0x2f6182){if(_0x2f6182){return _0x2f6182[_0xecbe('0x29')](_0x148039)[_0xecbe('0x2a')](function(_0x303ceb){return _0x303ceb;});}return null;};}function removeEntity(_0x5c824b,_0x1317e1){return function(_0x2a4631){if(_0x2a4631){return _0x2a4631[_0xecbe('0x2b')]()['then'](function(){var _0x5bef2c=_0x2a4631[_0xecbe('0x2c')]({'plain':!![]});var _0x1d2db9=_0xecbe('0x2d');return db[_0xecbe('0x2e')][_0xecbe('0x2b')]({'where':{'type':_0x1d2db9,'resourceId':_0x5bef2c['id']}})[_0xecbe('0x2a')](function(){return _0x2a4631;});})['then'](function(){_0x5c824b[_0xecbe('0x1e')](0xcc)[_0xecbe('0x1f')]();});}};}function handleEntityNotFound(_0x55ade9,_0x5cd5e2){return function(_0x3e17c8){if(!_0x3e17c8){_0x55ade9[_0xecbe('0x1d')](0x194);}return _0x3e17c8;};}function handleError(_0x22874b,_0x5973f0){_0x5973f0=_0x5973f0||0x1f4;return function(_0x324aae){logger['error'](_0x324aae[_0xecbe('0x2f')]);if(_0x324aae[_0xecbe('0x30')]){delete _0x324aae['name'];}_0x22874b[_0xecbe('0x1e')](_0x5973f0)[_0xecbe('0x31')](_0x324aae);};}exports[_0xecbe('0x32')]=function(_0x1b1214,_0x45da90){var _0x5f4542={},_0x2b784c={},_0x41bd18={'count':0x0,'rows':[]};var _0x1569e0=_[_0xecbe('0x33')](db[_0xecbe('0x34')][_0xecbe('0x35')],function(_0x301b5e){return{'name':_0x301b5e[_0xecbe('0x36')],'type':_0x301b5e['type'][_0xecbe('0x37')]};});_0x2b784c['model']=_[_0xecbe('0x33')](_0x1569e0,'name');_0x2b784c[_0xecbe('0x38')]=_[_0xecbe('0x39')](_0x1b1214[_0xecbe('0x38')]);_0x2b784c[_0xecbe('0x3a')]=_[_0xecbe('0x3b')](_0x2b784c[_0xecbe('0x3c')],_0x2b784c[_0xecbe('0x38')]);_0x5f4542[_0xecbe('0x3d')]=_[_0xecbe('0x3b')](_0x2b784c[_0xecbe('0x3c')],qs[_0xecbe('0x3e')](_0x1b1214[_0xecbe('0x38')][_0xecbe('0x3e')]));_0x5f4542['attributes']=_0x5f4542[_0xecbe('0x3d')][_0xecbe('0x3f')]?_0x5f4542[_0xecbe('0x3d')]:_0x2b784c['model'];if(!_0x1b1214[_0xecbe('0x38')][_0xecbe('0x40')]('nolimit')){_0x5f4542[_0xecbe('0x41')]=qs[_0xecbe('0x41')](_0x1b1214[_0xecbe('0x38')][_0xecbe('0x41')]);_0x5f4542[_0xecbe('0x21')]=qs[_0xecbe('0x21')](_0x1b1214[_0xecbe('0x38')][_0xecbe('0x21')]);}_0x5f4542[_0xecbe('0x42')]=qs['sort'](_0x1b1214[_0xecbe('0x38')][_0xecbe('0x43')]);_0x5f4542[_0xecbe('0x44')]=qs['filters'](_[_0xecbe('0x45')](_0x1b1214[_0xecbe('0x38')],_0x2b784c[_0xecbe('0x3a')]),_0x1569e0);if(_0x1b1214[_0xecbe('0x38')][_0xecbe('0x46')]){_0x5f4542[_0xecbe('0x44')]=_['merge'](_0x5f4542[_0xecbe('0x44')],{'$or':_[_0xecbe('0x33')](_0x1569e0,function(_0x53e48b){if(_0x53e48b[_0xecbe('0x47')]!==_0xecbe('0x48')){var _0x4ec943={};_0x4ec943[_0x53e48b['name']]={'$like':'%'+_0x1b1214[_0xecbe('0x38')][_0xecbe('0x46')]+'%'};return _0x4ec943;}})});}_0x5f4542=_['merge']({},_0x5f4542,_0x1b1214[_0xecbe('0x49')]);var _0x5dd3a3={'where':_0x5f4542[_0xecbe('0x44')]};return db[_0xecbe('0x34')][_0xecbe('0x23')](_0x5dd3a3)[_0xecbe('0x2a')](function(_0x5a1fa6){_0x41bd18[_0xecbe('0x23')]=_0x5a1fa6;if(_0x1b1214[_0xecbe('0x38')][_0xecbe('0x4a')]){_0x5f4542[_0xecbe('0x4b')]=[{'all':!![]}];}return db['FaxQueue'][_0xecbe('0x4c')](_0x5f4542);})['then'](function(_0x18428a){_0x41bd18[_0xecbe('0x4d')]=_0x18428a;return _0x41bd18;})['then'](respondWithFilteredResult(_0x45da90,_0x5f4542))[_0xecbe('0x4e')](handleError(_0x45da90,null));};exports[_0xecbe('0x4f')]=function(_0xdf2cfe,_0x118c41){var _0x25fce9={'raw':!![],'where':{'id':_0xdf2cfe[_0xecbe('0x50')]['id']}},_0x95157f={};_0x95157f['model']=_[_0xecbe('0x39')](db[_0xecbe('0x34')][_0xecbe('0x35')]);_0x95157f['query']=_[_0xecbe('0x39')](_0xdf2cfe[_0xecbe('0x38')]);_0x95157f[_0xecbe('0x3a')]=_[_0xecbe('0x3b')](_0x95157f['model'],_0x95157f[_0xecbe('0x38')]);_0x25fce9[_0xecbe('0x3d')]=_[_0xecbe('0x3b')](_0x95157f[_0xecbe('0x3c')],qs['fields'](_0xdf2cfe[_0xecbe('0x38')][_0xecbe('0x3e')]));_0x25fce9[_0xecbe('0x3d')]=_0x25fce9['attributes']['length']?_0x25fce9[_0xecbe('0x3d')]:_0x95157f[_0xecbe('0x3c')];if(_0xdf2cfe['query'][_0xecbe('0x4a')]){_0x25fce9['include']=[{'all':!![]}];}_0x25fce9=_[_0xecbe('0x51')]({},_0x25fce9,_0xdf2cfe[_0xecbe('0x49')]);return db[_0xecbe('0x34')][_0xecbe('0x52')](_0x25fce9)['then'](handleEntityNotFound(_0x118c41,null))[_0xecbe('0x2a')](respondWithResult(_0x118c41,null))[_0xecbe('0x4e')](handleError(_0x118c41,null));};exports[_0xecbe('0x53')]=function(_0x3251ec,_0x30d0de){return db[_0xecbe('0x34')][_0xecbe('0x53')](_0x3251ec[_0xecbe('0x54')],{})[_0xecbe('0x2a')](function(_0x360800){var _0x46b593=_0x3251ec[_0xecbe('0x55')][_0xecbe('0x2c')]({'plain':!![]});if(!_0x46b593)throw new Error(_0xecbe('0x56'));if(_0x46b593[_0xecbe('0x57')]==='user'){var _0x33433e=_0x360800[_0xecbe('0x2c')]({'plain':!![]});var _0x507d7c=_0xecbe('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x507d7c,'userProfileId':_0x46b593['userProfileId']},'raw':!![]})[_0xecbe('0x2a')](function(_0x50a4fe){if(_0x50a4fe&&_0x50a4fe[_0xecbe('0x58')]===0x0){return db[_0xecbe('0x2e')][_0xecbe('0x53')]({'name':_0x33433e[_0xecbe('0x30')],'resourceId':_0x33433e['id'],'type':_0x50a4fe['name'],'sectionId':_0x50a4fe['id']},{})[_0xecbe('0x2a')](function(){return _0x360800;});}else{return _0x360800;}})[_0xecbe('0x4e')](function(_0x343c84){logger[_0xecbe('0x59')](_0xecbe('0x5a'),_0x343c84);throw _0x343c84;});}return _0x360800;})['then'](respondWithResult(_0x30d0de,0xc9))['catch'](handleError(_0x30d0de,null));};exports['update']=function(_0x2cea86,_0x5ae910){if(_0x2cea86[_0xecbe('0x54')]['id']){delete _0x2cea86[_0xecbe('0x54')]['id'];}return db[_0xecbe('0x34')][_0xecbe('0x52')]({'where':{'id':_0x2cea86[_0xecbe('0x50')]['id']}})[_0xecbe('0x2a')](handleEntityNotFound(_0x5ae910,null))['then'](saveUpdates(_0x2cea86[_0xecbe('0x54')],null))[_0xecbe('0x2a')](respondWithResult(_0x5ae910,null))[_0xecbe('0x4e')](handleError(_0x5ae910,null));};exports[_0xecbe('0x2b')]=function(_0x159522,_0x260198){return db[_0xecbe('0x34')]['find']({'where':{'id':_0x159522['params']['id']}})['then'](handleEntityNotFound(_0x260198,null))['then'](removeEntity(_0x260198,null))[_0xecbe('0x4e')](handleError(_0x260198,null));};exports[_0xecbe('0x5b')]=function(_0x468d1a,_0x404013){return db[_0xecbe('0x34')][_0xecbe('0x5b')]()[_0xecbe('0x2a')](respondWithResult(_0x404013,null))['catch'](handleError(_0x404013,null));};exports[_0xecbe('0x5c')]=function(_0x195ea5,_0x250149,_0x3e2112){var _0x2867f5={'raw':!![],'where':{}},_0x5e0c28={},_0x489275;return db[_0xecbe('0x34')][_0xecbe('0x5d')]({'where':{'id':_0x195ea5['params']['id']}})[_0xecbe('0x2a')](handleEntityNotFound(_0x250149,null))[_0xecbe('0x2a')](function(_0x42e523){if(_0x42e523){_0x489275=_0x42e523[_0xecbe('0x2c')]({'plain':!![]});_0x5e0c28[_0xecbe('0x3c')]=_[_0xecbe('0x39')](db[_0xecbe('0x5e')][_0xecbe('0x35')]);_0x5e0c28[_0xecbe('0x38')]=_[_0xecbe('0x39')](_0x195ea5[_0xecbe('0x38')]);_0x5e0c28['filters']=_[_0xecbe('0x3b')](_0x5e0c28['model'],_0x5e0c28[_0xecbe('0x38')]);_0x2867f5[_0xecbe('0x3d')]=_[_0xecbe('0x3b')](_0x5e0c28[_0xecbe('0x3c')],qs[_0xecbe('0x3e')](_0x195ea5[_0xecbe('0x38')]['fields']));_0x2867f5[_0xecbe('0x3d')]=_0x2867f5[_0xecbe('0x3d')][_0xecbe('0x3f')]?_0x2867f5[_0xecbe('0x3d')]:_0x5e0c28[_0xecbe('0x3c')];if(!_0x195ea5['query'][_0xecbe('0x40')](_0xecbe('0x5f'))){_0x2867f5[_0xecbe('0x41')]=qs[_0xecbe('0x41')](_0x195ea5[_0xecbe('0x38')][_0xecbe('0x41')]);_0x2867f5[_0xecbe('0x21')]=qs['offset'](_0x195ea5[_0xecbe('0x38')][_0xecbe('0x21')]);}_0x2867f5[_0xecbe('0x42')]=qs['sort'](_0x195ea5[_0xecbe('0x38')][_0xecbe('0x43')]);_0x2867f5[_0xecbe('0x44')]=qs['filters'](_[_0xecbe('0x45')](_0x195ea5['query'],_0x5e0c28[_0xecbe('0x3a')]));_0x2867f5[_0xecbe('0x44')]['FaxQueueId']=_0x42e523['id'];if(_0x195ea5[_0xecbe('0x38')][_0xecbe('0x46')]){_0x2867f5[_0xecbe('0x44')]=_[_0xecbe('0x51')](_0x2867f5[_0xecbe('0x44')],{'$or':_[_0xecbe('0x33')](_0x2867f5['attributes'],function(_0x4a2062){var _0x54d64c={};_0x54d64c[_0x4a2062]={'$like':'%'+_0x195ea5['query'][_0xecbe('0x46')]+'%'};return _0x54d64c;})});}_0x2867f5=_[_0xecbe('0x51')]({},_0x2867f5,_0x195ea5['options']);return db['UserFaxQueue'][_0xecbe('0x4c')](_0x2867f5);}})[_0xecbe('0x2a')](function(_0x1bfc39){if(_0x1bfc39){return db[_0xecbe('0x60')]['findAndCountAll']({'where':{'id':_[_0xecbe('0x33')](_0x1bfc39,_0xecbe('0x61')),'role':'agent'},'attributes':['id','name',_0xecbe('0x62'),_0xecbe('0x63'),_0xecbe('0x64')]});}})[_0xecbe('0x2a')](function(_0x315713){if(_0x315713){return{'count':_0x315713[_0xecbe('0x23')],'rows':_[_0xecbe('0x33')](_0x315713['rows'],function(_0x2b01c6){return{'membername':_0x2b01c6[_0xecbe('0x30')],'UserId':_0x2b01c6['id'],'queue_name':_0x489275[_0xecbe('0x30')],'FaxQueueId':_0x489275['id'],'interface':util['format'](_0xecbe('0x65'),_0xecbe('0x66'),_0x2b01c6[_0xecbe('0x30')]),'penalty':0x0,'paused':_0x2b01c6['faxPause'],'createdAt':_0x2b01c6[_0xecbe('0x64')],'updatedAt':_0x2b01c6[_0xecbe('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xecbe('0x2a')](respondWithFilteredResult(_0x250149,_0x2867f5))['catch'](handleError(_0x250149,null));};exports[_0xecbe('0x67')]=function(_0x17ec8a,_0x4fd8d0,_0x168b15){var _0x3ac033={};var _0x2e2485={};var _0x5efb2a;var _0x3ef525;return db[_0xecbe('0x34')][_0xecbe('0x5d')]({'where':{'id':_0x17ec8a[_0xecbe('0x50')]['id']}})[_0xecbe('0x2a')](handleEntityNotFound(_0x4fd8d0,null))[_0xecbe('0x2a')](function(_0x19c9df){if(_0x19c9df){_0x5efb2a=_0x19c9df;_0x2e2485[_0xecbe('0x3c')]=_[_0xecbe('0x39')](db[_0xecbe('0x68')][_0xecbe('0x35')]);_0x2e2485[_0xecbe('0x38')]=_[_0xecbe('0x39')](_0x17ec8a[_0xecbe('0x38')]);_0x2e2485[_0xecbe('0x3a')]=_[_0xecbe('0x3b')](_0x2e2485['model'],_0x2e2485[_0xecbe('0x38')]);_0x3ac033[_0xecbe('0x3d')]=_[_0xecbe('0x3b')](_0x2e2485[_0xecbe('0x3c')],qs['fields'](_0x17ec8a['query'][_0xecbe('0x3e')]));_0x3ac033[_0xecbe('0x3d')]=_0x3ac033['attributes'][_0xecbe('0x3f')]?_0x3ac033['attributes']:_0x2e2485['model'];_0x3ac033[_0xecbe('0x42')]=qs[_0xecbe('0x43')](_0x17ec8a['query']['sort']);_0x3ac033['where']=qs[_0xecbe('0x3a')](_['pick'](_0x17ec8a[_0xecbe('0x38')],_0x2e2485['filters']));if(_0x17ec8a[_0xecbe('0x38')][_0xecbe('0x46')]){_0x3ac033['where']=_['merge'](_0x3ac033[_0xecbe('0x44')],{'$or':_['map'](_0x3ac033[_0xecbe('0x3d')],function(_0x3ad920){var _0x343eb0={};_0x343eb0[_0x3ad920]={'$like':'%'+_0x17ec8a['query'][_0xecbe('0x46')]+'%'};return _0x343eb0;})});}_0x3ac033=_[_0xecbe('0x51')]({},_0x3ac033,_0x17ec8a[_0xecbe('0x49')]);return _0x5efb2a[_0xecbe('0x67')](_0x3ac033);}})[_0xecbe('0x2a')](function(_0x316bfe){if(_0x316bfe){_0x3ef525=_0x316bfe[_0xecbe('0x3f')];if(!_0x17ec8a[_0xecbe('0x38')][_0xecbe('0x40')]('nolimit')){_0x3ac033[_0xecbe('0x41')]=qs[_0xecbe('0x41')](_0x17ec8a['query']['limit']);_0x3ac033[_0xecbe('0x21')]=qs[_0xecbe('0x21')](_0x17ec8a[_0xecbe('0x38')][_0xecbe('0x21')]);}return _0x5efb2a[_0xecbe('0x67')](_0x3ac033);}})['then'](function(_0x9ba171){if(_0x9ba171){return _0x9ba171?{'count':_0x3ef525,'rows':_0x9ba171}:null;}})['then'](respondWithResult(_0x4fd8d0,null))[_0xecbe('0x4e')](handleError(_0x4fd8d0,null));};exports[_0xecbe('0x69')]=function(_0x59ef07,_0x2b7c9c,_0x2c4c16){var _0x175df9=_0x59ef07[_0xecbe('0x54')][_0xecbe('0x6a')];return db[_0xecbe('0x68')][_0xecbe('0x4c')]({'where':{'id':_0x175df9},'attributes':['id'],'include':[{'model':db[_0xecbe('0x60')],'as':'Agents','attributes':['id',_0xecbe('0x30'),_0xecbe('0x6b'),'voicePause',_0xecbe('0x6c')],'raw':!![]}]})[_0xecbe('0x2a')](function(_0x237bc1){if(_0x237bc1){var _0x1e8c6d=_['flatMap'](_0x237bc1,function(_0x48d793){var _0x1f1a2f=_0x48d793['get']({'plain':!![]});return _0x1f1a2f['Agents'];});return db[_0xecbe('0x34')][_0xecbe('0x52')]({'where':{'id':_0x59ef07[_0xecbe('0x50')]['id']}})[_0xecbe('0x2a')](function(_0x4cb8a2){return db['sequelize'][_0xecbe('0x6d')](function(_0x26a613){return _0x4cb8a2[_0xecbe('0x69')](_0x175df9,{'transaction':_0x26a613})[_0xecbe('0x2a')](function(){return BPromise[_0xecbe('0x6e')](_0x1e8c6d,function(_0x39fb3e){return db[_0xecbe('0x5e')][_0xecbe('0x6f')]({'where':{'UserId':_0x39fb3e['id'],'FaxQueueId':_0x59ef07[_0xecbe('0x50')]['id']},'transaction':_0x26a613});});})[_0xecbe('0x2a')](function(){_0x1e8c6d['forEach'](function(_0x4875b0){socket['emit'](_0xecbe('0x70'),{'UserId':_0x4875b0['id'],'FaxQueueId':_0x4cb8a2['id']});});});});});}})[_0xecbe('0x2a')](respondWithStatusCode(_0x2b7c9c,null))['catch'](handleError(_0x2b7c9c,null));};exports['removeTeams']=function(_0x2371b8,_0x1e2361,_0x2ede5d){return db['Team'][_0xecbe('0x4c')]({'where':{'id':_0x2371b8['query'][_0xecbe('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xecbe('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xecbe('0x2a')](handleEntityNotFound(_0x1e2361,null))[_0xecbe('0x2a')](function(_0x5b50f3){var _0x46d42c=_['map'](_0x5b50f3,'id');var _0x449d71=[];var _0x35f577=[];var _0xea2d9a=squel[_0xecbe('0x71')]();_0xea2d9a[_0xecbe('0x72')](_0xecbe('0x73'))[_0xecbe('0x74')](_0xecbe('0x75'),'tq')[_0xecbe('0x76')](_0xecbe('0x77'),'ut',_0xecbe('0x78'))[_0xecbe('0x44')]('FaxQueueId\x20=\x20?',_0x2371b8[_0xecbe('0x50')]['id']);for(var _0x290421=0x0;_0x290421<_0x5b50f3[_0xecbe('0x3f')];_0x290421+=0x1){let _0x5887d6=_0x5b50f3[_0x290421];for(var _0x5a6552=0x0;_0x5a6552<_0x5887d6['Agents'][_0xecbe('0x3f')];_0x5a6552+=0x1){let _0x3e9a0d=_0x5887d6['Agents'][_0x5a6552];var _0x379377=_0xea2d9a[_0xecbe('0x79')]();_0x379377['where'](_0xecbe('0x7a'),_0x3e9a0d['id']);_0x35f577['push'](db[_0xecbe('0x7b')][_0xecbe('0x38')](_0x379377[_0xecbe('0x7c')](),{'type':db[_0xecbe('0x7b')][_0xecbe('0x7d')]['SELECT']})[_0xecbe('0x2a')](function(_0x500806){if(_0x500806[_0xecbe('0x3f')]===0x1){return _0x3e9a0d['id'];}else{var _0x4cc7af=_[_0xecbe('0x7e')](_[_0xecbe('0x33')](_0x500806,'TeamId'),function(_0x1d4a3a){return _[_0xecbe('0x7f')](_0x46d42c,_0x1d4a3a);});if(_0x4cc7af){return _0x3e9a0d['id'];}}}));}}return BPromise[_0xecbe('0x80')](_0x35f577)[_0xecbe('0x2a')](function(_0x55b5e0){_0x449d71=_(_0x449d71)['union'](_0x55b5e0)[_0xecbe('0x81')]()['value']();return db[_0xecbe('0x34')]['find']({'where':{'id':_0x2371b8['params']['id']}})[_0xecbe('0x2a')](function(_0xce0d11){return db[_0xecbe('0x7b')][_0xecbe('0x6d')](function(_0x137b5d){return _0xce0d11[_0xecbe('0x82')](_0x2371b8['query']['ids'],{'transaction':_0x137b5d})['then'](function(){if(!_['isEmpty'](_0x449d71)){return _0xce0d11[_0xecbe('0x83')](_0x449d71,{'transaction':_0x137b5d});}})['then'](function(){_0x449d71[_0xecbe('0x84')](function(_0x297e5d){socket[_0xecbe('0x85')]('userFaxQueue:remove',{'UserId':_0x297e5d,'FaxQueueId':_0xce0d11['id']});});});});});});})[_0xecbe('0x2a')](respondWithStatusCode(_0x1e2361,null))[_0xecbe('0x4e')](handleError(_0x1e2361,null));};exports['addAgents']=function(_0x537b1c,_0x519f36,_0x407ed5){return db[_0xecbe('0x34')][_0xecbe('0x52')]({'where':{'id':_0x537b1c[_0xecbe('0x50')]['id']}})['then'](handleEntityNotFound(_0x519f36,null))[_0xecbe('0x2a')](function(_0x2d5153){if(_0x2d5153){return _0x2d5153['addAgents'](_0x537b1c['body'][_0xecbe('0x6a')],_[_0xecbe('0x86')](_0x537b1c['body'],['ids','id'])||{})[_0xecbe('0x87')](function(_0x56ff5c){for(var _0x2cb469=0x0;_0x2cb469<_0x537b1c[_0xecbe('0x54')]['ids']['length'];_0x2cb469+=0x1){socket[_0xecbe('0x85')](_0xecbe('0x70'),{'UserId':Number(_0x537b1c[_0xecbe('0x54')][_0xecbe('0x6a')][_0x2cb469]),'FaxQueueId':Number(_0x537b1c[_0xecbe('0x50')]['id'])});}return _0x56ff5c;});}})[_0xecbe('0x2a')](respondWithResult(_0x519f36,null))[_0xecbe('0x4e')](handleError(_0x519f36,null));};exports[_0xecbe('0x83')]=function(_0x1c93c6,_0x506f88,_0x1a22d2){return db['FaxQueue'][_0xecbe('0x52')]({'where':{'id':_0x1c93c6['params']['id']}})['then'](handleEntityNotFound(_0x506f88,null))[_0xecbe('0x2a')](function(_0x205806){if(_0x205806){return _0x205806[_0xecbe('0x83')](_0x1c93c6['query'][_0xecbe('0x6a')])['then'](function(){if(_[_0xecbe('0x88')](_0x1c93c6['query'][_0xecbe('0x6a')])){for(var _0x2b50c9=0x0;_0x2b50c9<_0x1c93c6[_0xecbe('0x38')][_0xecbe('0x6a')][_0xecbe('0x3f')];_0x2b50c9+=0x1){socket['emit'](_0xecbe('0x89'),{'UserId':Number(_0x1c93c6[_0xecbe('0x38')][_0xecbe('0x6a')][_0x2b50c9]),'FaxQueueId':Number(_0x1c93c6[_0xecbe('0x50')]['id'])});}}else{socket['emit'](_0xecbe('0x89'),{'UserId':Number(_0x1c93c6[_0xecbe('0x38')]['ids']),'FaxQueueId':Number(_0x1c93c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x506f88,null))[_0xecbe('0x4e')](handleError(_0x506f88,null));};exports[_0xecbe('0x8a')]=function(_0x121bd8,_0x19d34d,_0x522d75){var _0x45a600={};var _0x4712a3={};var _0x221114;var _0x6afdf1;return db[_0xecbe('0x34')][_0xecbe('0x5d')]({'where':{'id':_0x121bd8[_0xecbe('0x50')]['id']}})[_0xecbe('0x2a')](handleEntityNotFound(_0x19d34d,null))[_0xecbe('0x2a')](function(_0x5589f3){if(_0x5589f3){_0x221114=_0x5589f3;_0x4712a3[_0xecbe('0x3c')]=_[_0xecbe('0x39')](db[_0xecbe('0x60')][_0xecbe('0x35')]);_0x4712a3[_0xecbe('0x38')]=_[_0xecbe('0x39')](_0x121bd8[_0xecbe('0x38')]);_0x4712a3[_0xecbe('0x3a')]=_[_0xecbe('0x3b')](_0x4712a3[_0xecbe('0x3c')],_0x4712a3[_0xecbe('0x38')]);_0x45a600[_0xecbe('0x3d')]=_['intersection'](_0x4712a3['model'],qs[_0xecbe('0x3e')](_0x121bd8[_0xecbe('0x38')][_0xecbe('0x3e')]));_0x45a600[_0xecbe('0x3d')]=_0x45a600['attributes']['length']?_0x45a600[_0xecbe('0x3d')]:_0x4712a3[_0xecbe('0x3c')];_0x45a600[_0xecbe('0x42')]=qs['sort'](_0x121bd8[_0xecbe('0x38')][_0xecbe('0x43')]);_0x45a600[_0xecbe('0x44')]=qs[_0xecbe('0x3a')](_[_0xecbe('0x45')](_0x121bd8[_0xecbe('0x38')],_0x4712a3[_0xecbe('0x3a')]));if(_0x121bd8[_0xecbe('0x38')]['filter']){_0x45a600[_0xecbe('0x44')]=_[_0xecbe('0x51')](_0x45a600[_0xecbe('0x44')],{'$or':_['map'](_0x45a600[_0xecbe('0x3d')],function(_0x34195a){var _0x44672f={};_0x44672f[_0x34195a]={'$like':'%'+_0x121bd8[_0xecbe('0x38')]['filter']+'%'};return _0x44672f;})});}_0x45a600=_[_0xecbe('0x51')]({},_0x45a600,_0x121bd8['options']);return _0x221114[_0xecbe('0x8a')](_0x45a600);}})[_0xecbe('0x2a')](function(_0x3b43f2){if(_0x3b43f2){_0x6afdf1=_0x3b43f2['length'];if(!_0x121bd8[_0xecbe('0x38')][_0xecbe('0x40')](_0xecbe('0x5f'))){_0x45a600[_0xecbe('0x41')]=qs['limit'](_0x121bd8[_0xecbe('0x38')][_0xecbe('0x41')]);_0x45a600[_0xecbe('0x21')]=qs[_0xecbe('0x21')](_0x121bd8[_0xecbe('0x38')][_0xecbe('0x21')]);}return _0x221114[_0xecbe('0x8a')](_0x45a600);}})[_0xecbe('0x2a')](function(_0x230a4c){if(_0x230a4c){return _0x230a4c?{'count':_0x6afdf1,'rows':_0x230a4c}:null;}})[_0xecbe('0x2a')](respondWithResult(_0x19d34d,null))['catch'](handleError(_0x19d34d,null));}; \ No newline at end of file +var _0x111f=['findOne','UserFaxQueue','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','format','SIP','getTeams','Team','pick','addTeams','ids','User','Agents','voicePause','interface','transaction','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x111f,0x13d));var _0xf111=function(_0xcc29d8,_0xc7363f){_0xcc29d8=_0xcc29d8-0x0;var _0x59667c=_0x111f[_0xcc29d8];return _0x59667c;};'use strict';var emlformat=require(_0xf111('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf111('0x1'));var jsonpatch=require(_0xf111('0x2'));var rp=require('request-promise');var moment=require(_0xf111('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf111('0x4'));var util=require(_0xf111('0x5'));var path=require('path');var sox=require(_0xf111('0x6'));var csv=require(_0xf111('0x7'));var ejs=require(_0xf111('0x8'));var fs=require('fs');var fs_extra=require(_0xf111('0x9'));var _=require(_0xf111('0xa'));var squel=require(_0xf111('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf111('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf111('0xd'));var Papa=require('papaparse');var Redis=require(_0xf111('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf111('0xf'));var as=require(_0xf111('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf111('0x11'));var db=require(_0xf111('0x12'))['db'];config['redis']=_[_0xf111('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf111('0x14'))(new Redis(config[_0xf111('0x15')]));require(_0xf111('0x16'))[_0xf111('0x17')](socket);function respondWithStatusCode(_0x4e6a3f,_0x20e942){_0x20e942=_0x20e942||0xcc;return function(_0x5ddc2e){if(_0x5ddc2e){return _0x4e6a3f[_0xf111('0x18')](_0x20e942);}return _0x4e6a3f['status'](_0x20e942)[_0xf111('0x19')]();};}function respondWithResult(_0x4b56b,_0x29f97b){_0x29f97b=_0x29f97b||0xc8;return function(_0x1f534a){if(_0x1f534a){return _0x4b56b[_0xf111('0x1a')](_0x29f97b)[_0xf111('0x1b')](_0x1f534a);}};}function respondWithFilteredResult(_0x4dba81,_0x3ac532){return function(_0x269b48){if(_0x269b48){var _0x4bb463=typeof _0x3ac532[_0xf111('0x1c')]===_0xf111('0x1d')&&typeof _0x3ac532['limit']===_0xf111('0x1d');var _0x3896f7=_0x269b48['count'];var _0x33fe82=_0x4bb463?0x0:_0x3ac532[_0xf111('0x1c')];var _0x28eec0=_0x4bb463?_0x269b48[_0xf111('0x1e')]:_0x3ac532[_0xf111('0x1c')]+_0x3ac532['limit'];var _0x4f98b7;if(_0x28eec0>=_0x3896f7){_0x28eec0=_0x3896f7;_0x4f98b7=0xc8;}else{_0x4f98b7=0xce;}_0x4dba81[_0xf111('0x1a')](_0x4f98b7);return _0x4dba81['set'](_0xf111('0x1f'),_0x33fe82+'-'+_0x28eec0+'/'+_0x3896f7)['json'](_0x269b48);}return null;};}function patchUpdates(_0x13a46a){return function(_0x3229d1){try{jsonpatch[_0xf111('0x20')](_0x3229d1,_0x13a46a,!![]);}catch(_0x553659){return BPromise['reject'](_0x553659);}return _0x3229d1['save']();};}function saveUpdates(_0x3102cf,_0x53d5e9){return function(_0x49315b){if(_0x49315b){return _0x49315b[_0xf111('0x21')](_0x3102cf)['then'](function(_0x44ee47){return _0x44ee47;});}return null;};}function removeEntity(_0x47543a,_0x24ea52){return function(_0x4c965c){if(_0x4c965c){return _0x4c965c[_0xf111('0x22')]()[_0xf111('0x23')](function(){var _0x348e9f=_0x4c965c[_0xf111('0x24')]({'plain':!![]});var _0x3f9a0a=_0xf111('0x25');return db[_0xf111('0x26')][_0xf111('0x22')]({'where':{'type':_0x3f9a0a,'resourceId':_0x348e9f['id']}})[_0xf111('0x23')](function(){return _0x4c965c;});})['then'](function(){_0x47543a[_0xf111('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102c07,_0x404123){return function(_0x5a24ae){if(!_0x5a24ae){_0x102c07['sendStatus'](0x194);}return _0x5a24ae;};}function handleError(_0x461553,_0x43ba7e){_0x43ba7e=_0x43ba7e||0x1f4;return function(_0x4f4f6a){logger[_0xf111('0x27')](_0x4f4f6a[_0xf111('0x28')]);if(_0x4f4f6a[_0xf111('0x29')]){delete _0x4f4f6a[_0xf111('0x29')];}_0x461553[_0xf111('0x1a')](_0x43ba7e)['send'](_0x4f4f6a);};}exports[_0xf111('0x2a')]=function(_0x565cd5,_0x4c1a3f){var _0x354b25={},_0x4e3f87={},_0x44773a={'count':0x0,'rows':[]};var _0x279ca4=_[_0xf111('0x2b')](db[_0xf111('0x2c')][_0xf111('0x2d')],function(_0x59ea8c){return{'name':_0x59ea8c['fieldName'],'type':_0x59ea8c[_0xf111('0x2e')][_0xf111('0x2f')]};});_0x4e3f87['model']=_[_0xf111('0x2b')](_0x279ca4,'name');_0x4e3f87[_0xf111('0x30')]=_[_0xf111('0x31')](_0x565cd5[_0xf111('0x30')]);_0x4e3f87['filters']=_[_0xf111('0x32')](_0x4e3f87[_0xf111('0x33')],_0x4e3f87[_0xf111('0x30')]);_0x354b25['attributes']=_['intersection'](_0x4e3f87['model'],qs[_0xf111('0x34')](_0x565cd5['query'][_0xf111('0x34')]));_0x354b25[_0xf111('0x35')]=_0x354b25[_0xf111('0x35')][_0xf111('0x36')]?_0x354b25[_0xf111('0x35')]:_0x4e3f87[_0xf111('0x33')];if(!_0x565cd5[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x354b25['limit']=qs[_0xf111('0x39')](_0x565cd5[_0xf111('0x30')][_0xf111('0x39')]);_0x354b25[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x565cd5['query'][_0xf111('0x1c')]);}_0x354b25[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x565cd5[_0xf111('0x30')][_0xf111('0x3b')]);_0x354b25['where']=qs[_0xf111('0x3c')](_['pick'](_0x565cd5[_0xf111('0x30')],_0x4e3f87[_0xf111('0x3c')]),_0x279ca4);if(_0x565cd5[_0xf111('0x30')]['filter']){_0x354b25[_0xf111('0x3d')]=_['merge'](_0x354b25['where'],{'$or':_[_0xf111('0x2b')](_0x279ca4,function(_0x2e63c7){if(_0x2e63c7[_0xf111('0x2e')]!==_0xf111('0x3e')){var _0x41d494={};_0x41d494[_0x2e63c7[_0xf111('0x29')]]={'$like':'%'+_0x565cd5[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x41d494;}})});}_0x354b25=_[_0xf111('0x40')]({},_0x354b25,_0x565cd5[_0xf111('0x41')]);var _0x14167c={'where':_0x354b25[_0xf111('0x3d')]};return db[_0xf111('0x2c')][_0xf111('0x1e')](_0x14167c)[_0xf111('0x23')](function(_0x3b180d){_0x44773a[_0xf111('0x1e')]=_0x3b180d;if(_0x565cd5['query']['includeAll']){_0x354b25[_0xf111('0x42')]=[{'all':!![]}];}return db[_0xf111('0x2c')][_0xf111('0x43')](_0x354b25);})[_0xf111('0x23')](function(_0x3f0910){_0x44773a[_0xf111('0x44')]=_0x3f0910;return _0x44773a;})[_0xf111('0x23')](respondWithFilteredResult(_0x4c1a3f,_0x354b25))[_0xf111('0x45')](handleError(_0x4c1a3f,null));};exports[_0xf111('0x46')]=function(_0x3da544,_0x47d0a8){var _0x26fbd4={'raw':!![],'where':{'id':_0x3da544['params']['id']}},_0x507216={};_0x507216[_0xf111('0x33')]=_['keys'](db[_0xf111('0x2c')][_0xf111('0x2d')]);_0x507216[_0xf111('0x30')]=_['keys'](_0x3da544[_0xf111('0x30')]);_0x507216[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x507216[_0xf111('0x33')],_0x507216[_0xf111('0x30')]);_0x26fbd4['attributes']=_[_0xf111('0x32')](_0x507216['model'],qs[_0xf111('0x34')](_0x3da544[_0xf111('0x30')][_0xf111('0x34')]));_0x26fbd4[_0xf111('0x35')]=_0x26fbd4['attributes']['length']?_0x26fbd4[_0xf111('0x35')]:_0x507216[_0xf111('0x33')];if(_0x3da544[_0xf111('0x30')]['includeAll']){_0x26fbd4[_0xf111('0x42')]=[{'all':!![]}];}_0x26fbd4=_[_0xf111('0x40')]({},_0x26fbd4,_0x3da544[_0xf111('0x41')]);return db['FaxQueue']['find'](_0x26fbd4)[_0xf111('0x23')](handleEntityNotFound(_0x47d0a8,null))[_0xf111('0x23')](respondWithResult(_0x47d0a8,null))[_0xf111('0x45')](handleError(_0x47d0a8,null));};exports['create']=function(_0xe549b5,_0x386a29){return db[_0xf111('0x2c')][_0xf111('0x47')](_0xe549b5['body'],{})['then'](function(_0x2c6a98){var _0x39d935=_0xe549b5[_0xf111('0x48')][_0xf111('0x24')]({'plain':!![]});if(!_0x39d935)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39d935[_0xf111('0x49')]===_0xf111('0x48')){var _0x5416ae=_0x2c6a98[_0xf111('0x24')]({'plain':!![]});var _0x55eb27=_0xf111('0x25');return db[_0xf111('0x4a')][_0xf111('0x4b')]({'where':{'name':_0x55eb27,'userProfileId':_0x39d935[_0xf111('0x4c')]},'raw':!![]})[_0xf111('0x23')](function(_0x9ee15a){if(_0x9ee15a&&_0x9ee15a[_0xf111('0x4d')]===0x0){return db['UserProfileResource'][_0xf111('0x47')]({'name':_0x5416ae[_0xf111('0x29')],'resourceId':_0x5416ae['id'],'type':_0x9ee15a['name'],'sectionId':_0x9ee15a['id']},{})[_0xf111('0x23')](function(){return _0x2c6a98;});}else{return _0x2c6a98;}})[_0xf111('0x45')](function(_0x112109){logger['error'](_0xf111('0x4e'),_0x112109);throw _0x112109;});}return _0x2c6a98;})[_0xf111('0x23')](respondWithResult(_0x386a29,0xc9))[_0xf111('0x45')](handleError(_0x386a29,null));};exports[_0xf111('0x21')]=function(_0x1dfbdc,_0x875f1e){if(_0x1dfbdc[_0xf111('0x4f')]['id']){delete _0x1dfbdc[_0xf111('0x4f')]['id'];}return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x1dfbdc[_0xf111('0x50')]['id']}})['then'](handleEntityNotFound(_0x875f1e,null))['then'](saveUpdates(_0x1dfbdc['body'],null))['then'](respondWithResult(_0x875f1e,null))[_0xf111('0x45')](handleError(_0x875f1e,null));};exports[_0xf111('0x22')]=function(_0x560723,_0x4a87a5){return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x560723['params']['id']}})['then'](handleEntityNotFound(_0x4a87a5,null))[_0xf111('0x23')](removeEntity(_0x4a87a5,null))[_0xf111('0x45')](handleError(_0x4a87a5,null));};exports['describe']=function(_0xd266d5,_0x6477e8){return db[_0xf111('0x2c')][_0xf111('0x51')]()[_0xf111('0x23')](respondWithResult(_0x6477e8,null))['catch'](handleError(_0x6477e8,null));};exports['getMembers']=function(_0x1db807,_0x316a33,_0x55efbf){var _0x2cef85={'raw':!![],'where':{}},_0x3eb812={},_0x10cc7b;return db[_0xf111('0x2c')][_0xf111('0x52')]({'where':{'id':_0x1db807[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x316a33,null))['then'](function(_0x1e107d){if(_0x1e107d){_0x10cc7b=_0x1e107d['get']({'plain':!![]});_0x3eb812[_0xf111('0x33')]=_[_0xf111('0x31')](db[_0xf111('0x53')]['rawAttributes']);_0x3eb812[_0xf111('0x30')]=_['keys'](_0x1db807[_0xf111('0x30')]);_0x3eb812[_0xf111('0x3c')]=_['intersection'](_0x3eb812[_0xf111('0x33')],_0x3eb812['query']);_0x2cef85['attributes']=_['intersection'](_0x3eb812['model'],qs[_0xf111('0x34')](_0x1db807[_0xf111('0x30')][_0xf111('0x34')]));_0x2cef85['attributes']=_0x2cef85[_0xf111('0x35')][_0xf111('0x36')]?_0x2cef85[_0xf111('0x35')]:_0x3eb812['model'];if(!_0x1db807['query'][_0xf111('0x37')](_0xf111('0x38'))){_0x2cef85[_0xf111('0x39')]=qs['limit'](_0x1db807[_0xf111('0x30')][_0xf111('0x39')]);_0x2cef85[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x1db807[_0xf111('0x30')][_0xf111('0x1c')]);}_0x2cef85[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x1db807[_0xf111('0x30')][_0xf111('0x3b')]);_0x2cef85['where']=qs[_0xf111('0x3c')](_['pick'](_0x1db807[_0xf111('0x30')],_0x3eb812[_0xf111('0x3c')]));_0x2cef85['where'][_0xf111('0x54')]=_0x1e107d['id'];if(_0x1db807[_0xf111('0x30')][_0xf111('0x3f')]){_0x2cef85['where']=_[_0xf111('0x40')](_0x2cef85[_0xf111('0x3d')],{'$or':_[_0xf111('0x2b')](_0x2cef85[_0xf111('0x35')],function(_0x50e9b7){var _0x44fd2a={};_0x44fd2a[_0x50e9b7]={'$like':'%'+_0x1db807[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x44fd2a;})});}_0x2cef85=_[_0xf111('0x40')]({},_0x2cef85,_0x1db807[_0xf111('0x41')]);return db['UserFaxQueue'][_0xf111('0x43')](_0x2cef85);}})[_0xf111('0x23')](function(_0x2e0881){if(_0x2e0881){return db['User'][_0xf111('0x55')]({'where':{'id':_[_0xf111('0x2b')](_0x2e0881,'UserId'),'role':_0xf111('0x56')},'attributes':['id',_0xf111('0x29'),_0xf111('0x57'),_0xf111('0x58'),'createdAt']});}})[_0xf111('0x23')](function(_0x11f145){if(_0x11f145){return{'count':_0x11f145[_0xf111('0x1e')],'rows':_[_0xf111('0x2b')](_0x11f145['rows'],function(_0x115c13){return{'membername':_0x115c13[_0xf111('0x29')],'UserId':_0x115c13['id'],'queue_name':_0x10cc7b[_0xf111('0x29')],'FaxQueueId':_0x10cc7b['id'],'interface':util[_0xf111('0x59')]('%s/%s',_0xf111('0x5a'),_0x115c13[_0xf111('0x29')]),'penalty':0x0,'paused':_0x115c13[_0xf111('0x57')],'createdAt':_0x115c13['createdAt'],'updatedAt':_0x115c13[_0xf111('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x316a33,_0x2cef85))['catch'](handleError(_0x316a33,null));};exports[_0xf111('0x5b')]=function(_0x263b17,_0x2ab4cc,_0x554a61){var _0x4f8bfc={};var _0x18d8e9={};var _0x19e899;var _0x1f37f1;return db[_0xf111('0x2c')]['findOne']({'where':{'id':_0x263b17['params']['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x2ab4cc,null))['then'](function(_0x1c71c6){if(_0x1c71c6){_0x19e899=_0x1c71c6;_0x18d8e9[_0xf111('0x33')]=_[_0xf111('0x31')](db[_0xf111('0x5c')][_0xf111('0x2d')]);_0x18d8e9[_0xf111('0x30')]=_['keys'](_0x263b17[_0xf111('0x30')]);_0x18d8e9[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x18d8e9['model'],_0x18d8e9[_0xf111('0x30')]);_0x4f8bfc[_0xf111('0x35')]=_[_0xf111('0x32')](_0x18d8e9[_0xf111('0x33')],qs[_0xf111('0x34')](_0x263b17[_0xf111('0x30')][_0xf111('0x34')]));_0x4f8bfc[_0xf111('0x35')]=_0x4f8bfc['attributes']['length']?_0x4f8bfc[_0xf111('0x35')]:_0x18d8e9[_0xf111('0x33')];_0x4f8bfc[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x263b17['query'][_0xf111('0x3b')]);_0x4f8bfc[_0xf111('0x3d')]=qs['filters'](_[_0xf111('0x5d')](_0x263b17[_0xf111('0x30')],_0x18d8e9['filters']));if(_0x263b17[_0xf111('0x30')]['filter']){_0x4f8bfc[_0xf111('0x3d')]=_[_0xf111('0x40')](_0x4f8bfc[_0xf111('0x3d')],{'$or':_[_0xf111('0x2b')](_0x4f8bfc[_0xf111('0x35')],function(_0x20ea34){var _0x30d1b3={};_0x30d1b3[_0x20ea34]={'$like':'%'+_0x263b17[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x30d1b3;})});}_0x4f8bfc=_['merge']({},_0x4f8bfc,_0x263b17[_0xf111('0x41')]);return _0x19e899[_0xf111('0x5b')](_0x4f8bfc);}})['then'](function(_0x207561){if(_0x207561){_0x1f37f1=_0x207561[_0xf111('0x36')];if(!_0x263b17[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x4f8bfc['limit']=qs[_0xf111('0x39')](_0x263b17[_0xf111('0x30')][_0xf111('0x39')]);_0x4f8bfc['offset']=qs[_0xf111('0x1c')](_0x263b17[_0xf111('0x30')][_0xf111('0x1c')]);}return _0x19e899[_0xf111('0x5b')](_0x4f8bfc);}})['then'](function(_0x2bbc79){if(_0x2bbc79){return _0x2bbc79?{'count':_0x1f37f1,'rows':_0x2bbc79}:null;}})[_0xf111('0x23')](respondWithResult(_0x2ab4cc,null))[_0xf111('0x45')](handleError(_0x2ab4cc,null));};exports[_0xf111('0x5e')]=function(_0x6e7821,_0x438354,_0x54e173){var _0x2822a1=_0x6e7821[_0xf111('0x4f')][_0xf111('0x5f')];return db['Team']['findAll']({'where':{'id':_0x2822a1},'attributes':['id'],'include':[{'model':db[_0xf111('0x60')],'as':_0xf111('0x61'),'attributes':['id',_0xf111('0x29'),'online',_0xf111('0x62'),_0xf111('0x63')],'raw':!![]}]})['then'](function(_0x31e6f6){if(_0x31e6f6){var _0xfa5118=_['flatMap'](_0x31e6f6,function(_0x1edab0){var _0x57fa12=_0x1edab0[_0xf111('0x24')]({'plain':!![]});return _0x57fa12[_0xf111('0x61')];});return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x6e7821[_0xf111('0x50')]['id']}})[_0xf111('0x23')](function(_0x2e923a){return db['sequelize'][_0xf111('0x64')](function(_0x5b4200){return _0x2e923a['addTeams'](_0x2822a1,{'transaction':_0x5b4200})['then'](function(){return BPromise['each'](_0xfa5118,function(_0x20778f){return db['UserFaxQueue'][_0xf111('0x65')]({'where':{'UserId':_0x20778f['id'],'FaxQueueId':_0x6e7821[_0xf111('0x50')]['id']},'transaction':_0x5b4200});});})['then'](function(){_0xfa5118[_0xf111('0x66')](function(_0x574a60){socket['emit'](_0xf111('0x67'),{'UserId':_0x574a60['id'],'FaxQueueId':_0x2e923a['id']});});});});});}})[_0xf111('0x23')](respondWithStatusCode(_0x438354,null))['catch'](handleError(_0x438354,null));};exports['removeTeams']=function(_0x3f8790,_0x1feb5a,_0x3f80ca){return db['Team'][_0xf111('0x43')]({'where':{'id':_0x3f8790[_0xf111('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf111('0x60')],'as':_0xf111('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1feb5a,null))[_0xf111('0x23')](function(_0x239153){var _0x3b8a0e=_[_0xf111('0x2b')](_0x239153,'id');var _0x4d5b52=[];var _0x5b35a6=[];var _0x38a522=squel[_0xf111('0x68')]();_0x38a522[_0xf111('0x69')](_0xf111('0x6a'))[_0xf111('0x6b')](_0xf111('0x6c'),'tq')[_0xf111('0x6d')]('user_has_teams','ut',_0xf111('0x6e'))[_0xf111('0x3d')](_0xf111('0x6f'),_0x3f8790[_0xf111('0x50')]['id']);for(var _0x86c75e=0x0;_0x86c75e<_0x239153[_0xf111('0x36')];_0x86c75e+=0x1){let _0x3c11e7=_0x239153[_0x86c75e];for(var _0x2642fc=0x0;_0x2642fc<_0x3c11e7[_0xf111('0x61')][_0xf111('0x36')];_0x2642fc+=0x1){let _0x314b48=_0x3c11e7[_0xf111('0x61')][_0x2642fc];var _0x23a1fc=_0x38a522[_0xf111('0x70')]();_0x23a1fc[_0xf111('0x3d')](_0xf111('0x71'),_0x314b48['id']);_0x5b35a6[_0xf111('0x72')](db[_0xf111('0x73')][_0xf111('0x30')](_0x23a1fc[_0xf111('0x74')](),{'type':db['sequelize']['QueryTypes'][_0xf111('0x75')]})[_0xf111('0x23')](function(_0x5d1070){if(_0x5d1070[_0xf111('0x36')]===0x1){return _0x314b48['id'];}else{var _0x32700a=_[_0xf111('0x76')](_[_0xf111('0x2b')](_0x5d1070,_0xf111('0x77')),function(_0x130afc){return _['includes'](_0x3b8a0e,_0x130afc);});if(_0x32700a){return _0x314b48['id'];}}}));}}return BPromise[_0xf111('0x78')](_0x5b35a6)[_0xf111('0x23')](function(_0x2be181){_0x4d5b52=_(_0x4d5b52)[_0xf111('0x79')](_0x2be181)[_0xf111('0x7a')]()[_0xf111('0x7b')]();return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x3f8790[_0xf111('0x50')]['id']}})[_0xf111('0x23')](function(_0x33e793){return db[_0xf111('0x73')]['transaction'](function(_0x645af6){return _0x33e793['removeTeams'](_0x3f8790['query'][_0xf111('0x5f')],{'transaction':_0x645af6})['then'](function(){if(!_[_0xf111('0x7c')](_0x4d5b52)){return _0x33e793[_0xf111('0x7d')](_0x4d5b52,{'transaction':_0x645af6});}})[_0xf111('0x23')](function(){_0x4d5b52[_0xf111('0x66')](function(_0x49cb85){socket[_0xf111('0x7e')]('userFaxQueue:remove',{'UserId':_0x49cb85,'FaxQueueId':_0x33e793['id']});});});});});});})['then'](respondWithStatusCode(_0x1feb5a,null))[_0xf111('0x45')](handleError(_0x1feb5a,null));};exports['addAgents']=function(_0x28300e,_0x6edb05,_0x4a56d7){return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x28300e[_0xf111('0x50')]['id']}})['then'](handleEntityNotFound(_0x6edb05,null))[_0xf111('0x23')](function(_0x11b892){if(_0x11b892){return _0x11b892[_0xf111('0x7f')](_0x28300e[_0xf111('0x4f')][_0xf111('0x5f')],_[_0xf111('0x80')](_0x28300e[_0xf111('0x4f')],[_0xf111('0x5f'),'id'])||{})[_0xf111('0x81')](function(_0x25be31){for(var _0x5d832a=0x0;_0x5d832a<_0x28300e['body'][_0xf111('0x5f')]['length'];_0x5d832a+=0x1){socket[_0xf111('0x7e')](_0xf111('0x67'),{'UserId':Number(_0x28300e[_0xf111('0x4f')]['ids'][_0x5d832a]),'FaxQueueId':Number(_0x28300e[_0xf111('0x50')]['id'])});}return _0x25be31;});}})[_0xf111('0x23')](respondWithResult(_0x6edb05,null))[_0xf111('0x45')](handleError(_0x6edb05,null));};exports[_0xf111('0x7d')]=function(_0x4606a5,_0x4aadb5,_0x21ee9c){return db['FaxQueue']['find']({'where':{'id':_0x4606a5[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x4aadb5,null))[_0xf111('0x23')](function(_0xc5d4eb){if(_0xc5d4eb){return _0xc5d4eb[_0xf111('0x7d')](_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')])[_0xf111('0x23')](function(){if(_[_0xf111('0x82')](_0x4606a5['query'][_0xf111('0x5f')])){for(var _0x17ceca=0x0;_0x17ceca<_0x4606a5[_0xf111('0x30')]['ids'][_0xf111('0x36')];_0x17ceca+=0x1){socket[_0xf111('0x7e')](_0xf111('0x83'),{'UserId':Number(_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')][_0x17ceca]),'FaxQueueId':Number(_0x4606a5[_0xf111('0x50')]['id'])});}}else{socket[_0xf111('0x7e')](_0xf111('0x83'),{'UserId':Number(_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')]),'FaxQueueId':Number(_0x4606a5[_0xf111('0x50')]['id'])});}});}})[_0xf111('0x23')](respondWithStatusCode(_0x4aadb5,null))[_0xf111('0x45')](handleError(_0x4aadb5,null));};exports['getAgents']=function(_0x599aab,_0x2d7449,_0x1fdfb1){var _0x5746b2={};var _0x3beb13={};var _0x143c98;var _0xcba5b7;return db['FaxQueue'][_0xf111('0x52')]({'where':{'id':_0x599aab[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x2d7449,null))['then'](function(_0x5346c2){if(_0x5346c2){_0x143c98=_0x5346c2;_0x3beb13[_0xf111('0x33')]=_['keys'](db[_0xf111('0x60')]['rawAttributes']);_0x3beb13[_0xf111('0x30')]=_[_0xf111('0x31')](_0x599aab[_0xf111('0x30')]);_0x3beb13[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x3beb13[_0xf111('0x33')],_0x3beb13[_0xf111('0x30')]);_0x5746b2[_0xf111('0x35')]=_[_0xf111('0x32')](_0x3beb13[_0xf111('0x33')],qs['fields'](_0x599aab[_0xf111('0x30')][_0xf111('0x34')]));_0x5746b2['attributes']=_0x5746b2['attributes'][_0xf111('0x36')]?_0x5746b2['attributes']:_0x3beb13[_0xf111('0x33')];_0x5746b2[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x599aab[_0xf111('0x30')][_0xf111('0x3b')]);_0x5746b2[_0xf111('0x3d')]=qs['filters'](_['pick'](_0x599aab[_0xf111('0x30')],_0x3beb13[_0xf111('0x3c')]));if(_0x599aab[_0xf111('0x30')][_0xf111('0x3f')]){_0x5746b2[_0xf111('0x3d')]=_[_0xf111('0x40')](_0x5746b2['where'],{'$or':_[_0xf111('0x2b')](_0x5746b2[_0xf111('0x35')],function(_0x29adbb){var _0x64bf12={};_0x64bf12[_0x29adbb]={'$like':'%'+_0x599aab[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x64bf12;})});}_0x5746b2=_[_0xf111('0x40')]({},_0x5746b2,_0x599aab[_0xf111('0x41')]);return _0x143c98[_0xf111('0x84')](_0x5746b2);}})['then'](function(_0x59f0bd){if(_0x59f0bd){_0xcba5b7=_0x59f0bd[_0xf111('0x36')];if(!_0x599aab[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x5746b2[_0xf111('0x39')]=qs[_0xf111('0x39')](_0x599aab['query'][_0xf111('0x39')]);_0x5746b2[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x599aab[_0xf111('0x30')]['offset']);}return _0x143c98['getAgents'](_0x5746b2);}})[_0xf111('0x23')](function(_0x6ba73f){if(_0x6ba73f){return _0x6ba73f?{'count':_0xcba5b7,'rows':_0x6ba73f}:null;}})['then'](respondWithResult(_0x2d7449,null))[_0xf111('0x45')](handleError(_0x2d7449,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index e167887..74e0f23 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 _0xa5a2=['save','update','emit','hasOwnProperty','exports','events','FaxQueue'];(function(_0x200ad7,_0x33ea52){var _0x5dca66=function(_0x2c36df){while(--_0x2c36df){_0x200ad7['push'](_0x200ad7['shift']());}};_0x5dca66(++_0x33ea52);}(_0xa5a2,0x1e8));var _0x2a5a=function(_0x551461,_0x1be3ac){_0x551461=_0x551461-0x0;var _0x443054=_0xa5a2[_0x551461];return _0x443054;};'use strict';var EventEmitter=require(_0x2a5a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x2a5a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2a5a('0x2'),'afterUpdate':_0x2a5a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b5114){return function(_0x222c26,_0xa572fc,_0x3a8f87){FaxQueueEvents[_0x2a5a('0x4')](_0x4b5114+':'+_0x222c26['id'],_0x222c26);FaxQueueEvents['emit'](_0x4b5114,_0x222c26);_0x3a8f87(null);};}for(var e in events){if(events[_0x2a5a('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x2a5a('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x295b=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5cae1e,_0x317e85){var _0x29a792=function(_0x30b439){while(--_0x30b439){_0x5cae1e['push'](_0x5cae1e['shift']());}};_0x29a792(++_0x317e85);}(_0x295b,0x12a));var _0xb295=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x295b[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xb295('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb295('0x1')](0x0);var events={'afterCreate':_0xb295('0x2'),'afterUpdate':_0xb295('0x3'),'afterDestroy':_0xb295('0x4')};function emitEvent(_0x2b41c2){return function(_0xcf08c2,_0x3a2562,_0x14f16b){FaxQueueEvents[_0xb295('0x5')](_0x2b41c2+':'+_0xcf08c2['id'],_0xcf08c2);FaxQueueEvents['emit'](_0x2b41c2,_0xcf08c2);_0x14f16b(null);};}for(var e in events){if(events[_0xb295('0x6')](e)){var event=events[e];FaxQueue[_0xb295('0x7')](e,emitEvent(event));}}module[_0xb295('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e993223..49ebb86 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 _0xbd9a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','fax_queues','lodash','util'];(function(_0x4b0878,_0x2114a0){var _0x48792f=function(_0xf632f0){while(--_0xf632f0){_0x4b0878['push'](_0x4b0878['shift']());}};_0x48792f(++_0x2114a0);}(_0xbd9a,0x129));var _0xabd9=function(_0xa5c132,_0x48c175){_0xa5c132=_0xa5c132-0x0;var _0x3faa40=_0xbd9a[_0xa5c132];return _0x3faa40;};'use strict';var _=require(_0xabd9('0x0'));var util=require(_0xabd9('0x1'));var logger=require(_0xabd9('0x2'))(_0xabd9('0x3'));var moment=require(_0xabd9('0x4'));var BPromise=require(_0xabd9('0x5'));var rp=require(_0xabd9('0x6'));var fs=require('fs');var path=require(_0xabd9('0x7'));var rimraf=require(_0xabd9('0x8'));var config=require('../../config/environment');var attributes=require(_0xabd9('0x9'));module[_0xabd9('0xa')]=function(_0x5c18f5,_0x3f3332){return _0x5c18f5[_0xabd9('0xb')]('FaxQueue',attributes,{'tableName':_0xabd9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c12=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxQueue.attributes','exports','define'];(function(_0x4193f3,_0x4686c8){var _0x123c74=function(_0x256a23){while(--_0x256a23){_0x4193f3['push'](_0x4193f3['shift']());}};_0x123c74(++_0x4686c8);}(_0x1c12,0x16e));var _0x21c1=function(_0x44c39c,_0x5521b1){_0x44c39c=_0x44c39c-0x0;var _0x26dffa=_0x1c12[_0x44c39c];return _0x26dffa;};'use strict';var _=require(_0x21c1('0x0'));var util=require(_0x21c1('0x1'));var logger=require(_0x21c1('0x2'))(_0x21c1('0x3'));var moment=require(_0x21c1('0x4'));var BPromise=require(_0x21c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21c1('0x6'));var rimraf=require(_0x21c1('0x7'));var config=require('../../config/environment');var attributes=require(_0x21c1('0x8'));module[_0x21c1('0x9')]=function(_0x423dcb,_0x124b3e){return _0x423dcb[_0x21c1('0xa')](_0x21c1('0xb'),attributes,{'tableName':_0x21c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 17d7e0a..63e6941 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 _0x661a=['FaxQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetFaxQueue','findAll','options','where','attributes','limit','include','map','model','ShowFaxQueue'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x661a,0x122));var _0xa661=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x661a[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xa661('0x0'));var util=require(_0xa661('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa661('0x2'));var fs=require('fs');var Redis=require(_0xa661('0x3'));var db=require(_0xa661('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa661('0x5'));var config=require(_0xa661('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa661('0x7')][_0xa661('0x8')]({'port':0x232a});config[_0xa661('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa661('0xa'))(new Redis(config[_0xa661('0x9')]));require(_0xa661('0xb'))[_0xa661('0xc')](socket);function respondWithRpcPromise(_0x72e9e,_0x35be99,_0x2f622c){return new BPromise(function(_0x3f444f,_0x1f6468){return client[_0xa661('0xd')](_0x72e9e,_0x2f622c)[_0xa661('0xe')](function(_0x8ea9f1){logger[_0xa661('0xf')](_0xa661('0x10'),_0x35be99,'request\x20sent');logger[_0xa661('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x35be99,_0xa661('0x12'),JSON[_0xa661('0x13')](_0x8ea9f1));if(_0x8ea9f1['error']){if(_0x8ea9f1['error']['code']===0x1f4){logger['error'](_0xa661('0x10'),_0x35be99,_0x8ea9f1[_0xa661('0x14')][_0xa661('0x15')]);return _0x1f6468(_0x8ea9f1['error'][_0xa661('0x15')]);}logger['error'](_0xa661('0x10'),_0x35be99,_0x8ea9f1[_0xa661('0x14')][_0xa661('0x15')]);return _0x3f444f(_0x8ea9f1['error'][_0xa661('0x15')]);}else{logger[_0xa661('0xf')]('FaxQueue,\x20%s,\x20%s',_0x35be99,_0xa661('0x12'));_0x3f444f(_0x8ea9f1[_0xa661('0x16')][_0xa661('0x15')]);}})[_0xa661('0x17')](function(_0x30487a){logger['error'](_0xa661('0x10'),_0x35be99,_0x30487a);_0x1f6468(_0x30487a);});});}exports[_0xa661('0x18')]=function(_0x3877e0){var _0x49e5f3=this;return new Promise(function(_0x26e27d,_0x241b14){return db['FaxQueue'][_0xa661('0x19')]({'raw':_0x3877e0[_0xa661('0x1a')]?_0x3877e0[_0xa661('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3877e0['options']?_0x3877e0[_0xa661('0x1a')][_0xa661('0x1b')]||null:null,'attributes':_0x3877e0[_0xa661('0x1a')]?_0x3877e0[_0xa661('0x1a')][_0xa661('0x1c')]||null:null,'limit':_0x3877e0['options']?_0x3877e0['options'][_0xa661('0x1d')]||null:null,'include':_0x3877e0[_0xa661('0x1a')]?_0x3877e0[_0xa661('0x1a')][_0xa661('0x1e')]?_[_0xa661('0x1f')](_0x3877e0[_0xa661('0x1a')][_0xa661('0x1e')],function(_0xe859a2){return{'model':db[_0xe859a2['model']],'as':_0xe859a2['as'],'attributes':_0xe859a2[_0xa661('0x1c')],'include':_0xe859a2[_0xa661('0x1e')]?_[_0xa661('0x1f')](_0xe859a2[_0xa661('0x1e')],function(_0x5e6c78){return{'model':db[_0x5e6c78[_0xa661('0x20')]],'as':_0x5e6c78['as'],'attributes':_0x5e6c78[_0xa661('0x1c')],'include':_0x5e6c78['include']?_[_0xa661('0x1f')](_0x5e6c78['include'],function(_0x1eb918){return{'model':db[_0x1eb918['model']],'as':_0x1eb918['as'],'attributes':_0x1eb918[_0xa661('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa661('0xe')](function(_0x2bbda9){logger[_0xa661('0xf')](_0xa661('0x18'),_0x3877e0);logger['debug'](_0xa661('0x18'),_0x3877e0,JSON['stringify'](_0x2bbda9));_0x26e27d(_0x2bbda9);})[_0xa661('0x17')](function(_0x1d8a25){logger[_0xa661('0x14')](_0xa661('0x18'),_0x1d8a25[_0xa661('0x15')],_0x3877e0);_0x241b14(_0x49e5f3[_0xa661('0x14')](0x1f4,_0x1d8a25[_0xa661('0x15')]));});});};exports[_0xa661('0x21')]=function(_0x1001e2){var _0x2e0286=this;return new Promise(function(_0x180500,_0x1a0d14){return db[_0xa661('0x22')][_0xa661('0x23')]({'raw':_0x1001e2['options']?_0x1001e2[_0xa661('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1001e2[_0xa661('0x1a')]?_0x1001e2[_0xa661('0x1a')][_0xa661('0x1b')]||null:null,'attributes':_0x1001e2[_0xa661('0x1a')]?_0x1001e2[_0xa661('0x1a')][_0xa661('0x1c')]||null:null,'include':_0x1001e2[_0xa661('0x1a')]?_0x1001e2[_0xa661('0x1a')]['include']?_[_0xa661('0x1f')](_0x1001e2['options'][_0xa661('0x1e')],function(_0x506efd){return{'model':db[_0x506efd[_0xa661('0x20')]],'as':_0x506efd['as'],'attributes':_0x506efd[_0xa661('0x1c')],'include':_0x506efd[_0xa661('0x1e')]?_[_0xa661('0x1f')](_0x506efd[_0xa661('0x1e')],function(_0x469245){return{'model':db[_0x469245[_0xa661('0x20')]],'as':_0x469245['as'],'attributes':_0x469245[_0xa661('0x1c')],'include':_0x469245[_0xa661('0x1e')]?_[_0xa661('0x1f')](_0x469245['include'],function(_0xe03e1b){return{'model':db[_0xe03e1b[_0xa661('0x20')]],'as':_0xe03e1b['as'],'attributes':_0xe03e1b[_0xa661('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa661('0xe')](function(_0x57a9d1){logger[_0xa661('0xf')](_0xa661('0x21'),_0x1001e2);logger[_0xa661('0x11')](_0xa661('0x21'),_0x1001e2,JSON['stringify'](_0x57a9d1));_0x180500(_0x57a9d1);})[_0xa661('0x17')](function(_0xcc1d3c){logger[_0xa661('0x14')](_0xa661('0x21'),_0xcc1d3c[_0xa661('0x15')],_0x1001e2);_0x1a0d14(_0x2e0286['error'](0x1f4,_0xcc1d3c[_0xa661('0x15')]));});});}; \ No newline at end of file +var _0xe08b=['model','find','ShowFaxQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','request','then','info','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','map','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe08b,0x1e4));var _0xbe08=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe08b[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xbe08('0x0'));var moment=require('moment');var BPromise=require(_0xbe08('0x1'));var rs=require(_0xbe08('0x2'));var fs=require('fs');var Redis=require(_0xbe08('0x3'));var db=require(_0xbe08('0x4'))['db'];var utils=require(_0xbe08('0x5'));var logger=require(_0xbe08('0x6'))(_0xbe08('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe08('0x8'));var client=jayson[_0xbe08('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbe08('0xa')](config[_0xbe08('0xb')],{'host':_0xbe08('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe08('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4c9c8c,_0x37463c,_0x41eb1d){return new BPromise(function(_0x123525,_0x479ef1){return client[_0xbe08('0xd')](_0x4c9c8c,_0x41eb1d)[_0xbe08('0xe')](function(_0x545d72){logger[_0xbe08('0xf')]('FaxQueue,\x20%s,\x20%s',_0x37463c,_0xbe08('0x10'));logger[_0xbe08('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x37463c,_0xbe08('0x10'),JSON[_0xbe08('0x12')](_0x545d72));if(_0x545d72[_0xbe08('0x13')]){if(_0x545d72[_0xbe08('0x13')][_0xbe08('0x14')]===0x1f4){logger[_0xbe08('0x13')](_0xbe08('0x15'),_0x37463c,_0x545d72[_0xbe08('0x13')]['message']);return _0x479ef1(_0x545d72[_0xbe08('0x13')][_0xbe08('0x16')]);}logger['error'](_0xbe08('0x15'),_0x37463c,_0x545d72['error'][_0xbe08('0x16')]);return _0x123525(_0x545d72[_0xbe08('0x13')][_0xbe08('0x16')]);}else{logger[_0xbe08('0xf')](_0xbe08('0x15'),_0x37463c,_0xbe08('0x10'));_0x123525(_0x545d72[_0xbe08('0x17')][_0xbe08('0x16')]);}})[_0xbe08('0x18')](function(_0x2c62ee){logger['error'](_0xbe08('0x15'),_0x37463c,_0x2c62ee);_0x479ef1(_0x2c62ee);});});}exports[_0xbe08('0x19')]=function(_0x12996c){var _0x3fe813=this;return new Promise(function(_0x22ee3d,_0x54cc92){return db[_0xbe08('0x1a')][_0xbe08('0x1b')]({'raw':_0x12996c['options']?_0x12996c['options']['raw']===undefined?!![]:![]:!![],'where':_0x12996c[_0xbe08('0x1c')]?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1d')]||null:null,'attributes':_0x12996c[_0xbe08('0x1c')]?_0x12996c['options']['attributes']||null:null,'limit':_0x12996c['options']?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1e')]||null:null,'include':_0x12996c[_0xbe08('0x1c')]?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x12996c['options']['include'],function(_0x1aca83){return{'model':db[_0x1aca83['model']],'as':_0x1aca83['as'],'attributes':_0x1aca83[_0xbe08('0x21')],'include':_0x1aca83[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x1aca83[_0xbe08('0x1f')],function(_0x3c664d){return{'model':db[_0x3c664d[_0xbe08('0x22')]],'as':_0x3c664d['as'],'attributes':_0x3c664d[_0xbe08('0x21')],'include':_0x3c664d[_0xbe08('0x1f')]?_['map'](_0x3c664d[_0xbe08('0x1f')],function(_0x52cf1d){return{'model':db[_0x52cf1d[_0xbe08('0x22')]],'as':_0x52cf1d['as'],'attributes':_0x52cf1d[_0xbe08('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbe08('0xe')](function(_0x35e443){logger[_0xbe08('0xf')](_0xbe08('0x19'),_0x12996c);logger[_0xbe08('0x11')](_0xbe08('0x19'),_0x12996c,JSON[_0xbe08('0x12')](_0x35e443));_0x22ee3d(_0x35e443);})[_0xbe08('0x18')](function(_0x1444f2){logger[_0xbe08('0x13')](_0xbe08('0x19'),_0x1444f2[_0xbe08('0x16')],_0x12996c);_0x54cc92(_0x3fe813['error'](0x1f4,_0x1444f2[_0xbe08('0x16')]));});});};exports['ShowFaxQueue']=function(_0x11794b){var _0x227b92=this;return new Promise(function(_0x1ff9eb,_0x51e38b){return db[_0xbe08('0x1a')][_0xbe08('0x23')]({'raw':_0x11794b[_0xbe08('0x1c')]?_0x11794b[_0xbe08('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11794b[_0xbe08('0x1c')]?_0x11794b['options'][_0xbe08('0x1d')]||null:null,'attributes':_0x11794b['options']?_0x11794b[_0xbe08('0x1c')][_0xbe08('0x21')]||null:null,'include':_0x11794b[_0xbe08('0x1c')]?_0x11794b[_0xbe08('0x1c')][_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x11794b['options'][_0xbe08('0x1f')],function(_0x3bd86e){return{'model':db[_0x3bd86e[_0xbe08('0x22')]],'as':_0x3bd86e['as'],'attributes':_0x3bd86e['attributes'],'include':_0x3bd86e[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x3bd86e[_0xbe08('0x1f')],function(_0x4bb75e){return{'model':db[_0x4bb75e[_0xbe08('0x22')]],'as':_0x4bb75e['as'],'attributes':_0x4bb75e[_0xbe08('0x21')],'include':_0x4bb75e[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x4bb75e[_0xbe08('0x1f')],function(_0x8a0d07){return{'model':db[_0x8a0d07[_0xbe08('0x22')]],'as':_0x8a0d07['as'],'attributes':_0x8a0d07['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe08('0xe')](function(_0x260abf){logger['info'](_0xbe08('0x24'),_0x11794b);logger['debug'](_0xbe08('0x24'),_0x11794b,JSON[_0xbe08('0x12')](_0x260abf));_0x1ff9eb(_0x260abf);})[_0xbe08('0x18')](function(_0x163723){logger[_0xbe08('0x13')](_0xbe08('0x24'),_0x163723['message'],_0x11794b);_0x51e38b(_0x227b92[_0xbe08('0x13')](0x1f4,_0x163723['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 1fcc584..28dc73d 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 _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x5f3059,_0x1475b3){var _0x2ff9be=function(_0x4f4451){while(--_0x4f4451){_0x5f3059['push'](_0x5f3059['shift']());}};_0x2ff9be(++_0x1475b3);}(_0x56e7,0x7b));var _0x756e=function(_0x9b45f,_0x3df8b8){_0x9b45f=_0x9b45f-0x0;var _0xb25912=_0x56e7[_0x9b45f];return _0xb25912;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){FaxQueueEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('faxQueue:'+_0x5c8589,_0x3b3b8f);FaxQueueEvents['on'](_0x5c8589,_0x1c6a22);}}; \ No newline at end of file +var _0x906c=['update','emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove'];(function(_0x135037,_0x4b1e21){var _0x45cb37=function(_0x277311){while(--_0x277311){_0x135037['push'](_0x135037['shift']());}};_0x45cb37(++_0x4b1e21);}(_0x906c,0x17d));var _0xc906=function(_0x3ede7b,_0x4b3aa1){_0x3ede7b=_0x3ede7b-0x0;var _0xe00dc5=_0x906c[_0x3ede7b];return _0xe00dc5;};'use strict';var FaxQueueEvents=require(_0xc906('0x0'));var events=[_0xc906('0x1'),_0xc906('0x2'),_0xc906('0x3')];function createListener(_0x2fcd5b,_0x4393ce){return function(_0x25480d){_0x4393ce[_0xc906('0x4')](_0x2fcd5b,_0x25480d);};}function removeListener(_0xf58a83,_0x1d9c1e){return function(){FaxQueueEvents[_0xc906('0x5')](_0xf58a83,_0x1d9c1e);};}exports[_0xc906('0x6')]=function(_0x1be903){for(var _0x2c4fe7=0x0,_0x3b9c12=events['length'];_0x2c4fe7<_0x3b9c12;_0x2c4fe7++){var _0x5ab52a=events[_0x2c4fe7];var _0x431dba=createListener(_0xc906('0x7')+_0x5ab52a,_0x1be903);FaxQueueEvents['on'](_0x5ab52a,_0x431dba);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a87da00..954a2d5 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 _0x71ab=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','create','post','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')]('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0xa')]);router[_0xb71a('0x8')](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xc')]);router[_0xb71a('0x8')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xe')]);router[_0xb71a('0x8')]('/:id/members',auth[_0xb71a('0x9')](),controller['getMembers']);router[_0xb71a('0x8')](_0xb71a('0xf'),auth[_0xb71a('0x9')](),controller['getTeams']);router[_0xb71a('0x8')]('/:id/users',auth[_0xb71a('0x9')](),controller['getAgents']);router['post']('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0x10')]);router[_0xb71a('0x11')](_0xb71a('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xb71a('0x12'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x13')]);router[_0xb71a('0x14')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x15')]);router[_0xb71a('0x16')](_0xb71a('0xd'),auth['isAuthenticated'](),controller[_0xb71a('0x17')]);router[_0xb71a('0x16')](_0xb71a('0xf'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x18')]);router[_0xb71a('0x16')](_0xb71a('0x12'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x19')]);module[_0xb71a('0x1a')]=router; \ No newline at end of file +var _0x9a5a=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','removeTeams','exports','multer','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9a5a,0x194));var _0xa9a5=function(_0x40e564,_0x4d2e8b){_0x40e564=_0x40e564-0x0;var _0x4131b3=_0x9a5a[_0x40e564];return _0x4131b3;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xa9a5('0x13'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x14')]);router[_0xa9a5('0x15')]('/',auth[_0xa9a5('0xd')](),controller['create']);router[_0xa9a5('0x15')](_0xa9a5('0x12'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x16')]);router[_0xa9a5('0x15')](_0xa9a5('0x13'),auth['isAuthenticated'](),controller[_0xa9a5('0x17')]);router[_0xa9a5('0x18')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['update']);router[_0xa9a5('0x1a')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['destroy']);router[_0xa9a5('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa9a5('0x1b')]);router[_0xa9a5('0x1a')]('/:id/users',auth[_0xa9a5('0xd')](),controller['removeAgents']);module[_0xa9a5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 26b41ec..bc4e6fa 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 _0x43e1=['DATE','moment','sequelize','exports','STRING'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x43e1,0x18c));var _0x143e=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x43e1[_0x10004e];return _0x5af990;};'use strict';var moment=require(_0x143e('0x0'));var Sequelize=require(_0x143e('0x1'));module[_0x143e('0x2')]={'uniqueid':{'type':Sequelize[_0x143e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x143e('0x3')]},'joinAt':{'type':Sequelize[_0x143e('0x4')]},'leaveAt':{'type':Sequelize[_0x143e('0x4')]},'acceptAt':{'type':Sequelize[_0x143e('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x143e('0x3')]}}; \ No newline at end of file +var _0xf49a=['sequelize','exports','STRING','DATE','moment'];(function(_0x18dc83,_0x462295){var _0x8236a2=function(_0x448df4){while(--_0x448df4){_0x18dc83['push'](_0x18dc83['shift']());}};_0x8236a2(++_0x462295);}(_0xf49a,0x199));var _0xaf49=function(_0x2c74e2,_0x78daf1){_0x2c74e2=_0x2c74e2-0x0;var _0x14e004=_0xf49a[_0x2c74e2];return _0x14e004;};'use strict';var moment=require(_0xaf49('0x0'));var Sequelize=require(_0xaf49('0x1'));module[_0xaf49('0x2')]={'uniqueid':{'type':Sequelize[_0xaf49('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaf49('0x3')]},'joinAt':{'type':Sequelize[_0xaf49('0x4')]},'leaveAt':{'type':Sequelize[_0xaf49('0x4')]},'acceptAt':{'type':Sequelize[_0xaf49('0x4')]},'exitAt':{'type':Sequelize[_0xaf49('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 648b5b5..2b4ea7a 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 _0xb63f=['hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length'];(function(_0x387d4c,_0xa49033){var _0x5aa39e=function(_0x5e49f8){while(--_0x5e49f8){_0x387d4c['push'](_0x387d4c['shift']());}};_0x5aa39e(++_0xa49033);}(_0xb63f,0xa3));var _0xfb63=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xb63f[_0x1fc1f9];return _0x4987ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb63('0x0'));var jsonpatch=require(_0xfb63('0x1'));var rp=require(_0xfb63('0x2'));var moment=require(_0xfb63('0x3'));var BPromise=require(_0xfb63('0x4'));var Mustache=require(_0xfb63('0x5'));var util=require(_0xfb63('0x6'));var path=require(_0xfb63('0x7'));var sox=require(_0xfb63('0x8'));var csv=require('to-csv');var ejs=require(_0xfb63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb63('0xa'));var squel=require(_0xfb63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb63('0xc'));var querystring=require(_0xfb63('0xd'));var Papa=require(_0xfb63('0xe'));var Redis=require('ioredis');var authService=require(_0xfb63('0xf'));var qs=require(_0xfb63('0x10'));var as=require(_0xfb63('0x11'));var hardwareService=require(_0xfb63('0x12'));var logger=require(_0xfb63('0x13'))(_0xfb63('0x14'));var utils=require(_0xfb63('0x15'));var config=require(_0xfb63('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee69d,_0x233ec3){_0x233ec3=_0x233ec3||0xcc;return function(_0xa2f034){if(_0xa2f034){return _0xee69d['sendStatus'](_0x233ec3);}return _0xee69d[_0xfb63('0x17')](_0x233ec3)[_0xfb63('0x18')]();};}function respondWithResult(_0x48a22c,_0x4575b6){_0x4575b6=_0x4575b6||0xc8;return function(_0x377d1e){if(_0x377d1e){return _0x48a22c[_0xfb63('0x17')](_0x4575b6)[_0xfb63('0x19')](_0x377d1e);}};}function respondWithFilteredResult(_0x51e7ef,_0x44619e){return function(_0x48e2c0){if(_0x48e2c0){var _0x19f196=typeof _0x44619e[_0xfb63('0x1a')]===_0xfb63('0x1b')&&typeof _0x44619e[_0xfb63('0x1c')]===_0xfb63('0x1b');var _0x49081d=_0x48e2c0[_0xfb63('0x1d')];var _0x5dfd32=_0x19f196?0x0:_0x44619e[_0xfb63('0x1a')];var _0x4f7508=_0x19f196?_0x48e2c0[_0xfb63('0x1d')]:_0x44619e[_0xfb63('0x1a')]+_0x44619e[_0xfb63('0x1c')];var _0x452f1e;if(_0x4f7508>=_0x49081d){_0x4f7508=_0x49081d;_0x452f1e=0xc8;}else{_0x452f1e=0xce;}_0x51e7ef['status'](_0x452f1e);return _0x51e7ef[_0xfb63('0x1e')]('Content-Range',_0x5dfd32+'-'+_0x4f7508+'/'+_0x49081d)[_0xfb63('0x19')](_0x48e2c0);}return null;};}function patchUpdates(_0x3ef0cf){return function(_0x564052){try{jsonpatch[_0xfb63('0x1f')](_0x564052,_0x3ef0cf,!![]);}catch(_0x23c4fb){return BPromise['reject'](_0x23c4fb);}return _0x564052[_0xfb63('0x20')]();};}function saveUpdates(_0x43bf68,_0x267953){return function(_0x34e22c){if(_0x34e22c){return _0x34e22c[_0xfb63('0x21')](_0x43bf68)[_0xfb63('0x22')](function(_0x17f81e){return _0x17f81e;});}return null;};}function removeEntity(_0x1bbedc,_0x43c245){return function(_0xa7612f){if(_0xa7612f){return _0xa7612f[_0xfb63('0x23')]()[_0xfb63('0x22')](function(){_0x1bbedc[_0xfb63('0x17')](0xcc)[_0xfb63('0x18')]();});}};}function handleEntityNotFound(_0x26036d,_0x19ea95){return function(_0x1b8f0a){if(!_0x1b8f0a){_0x26036d[_0xfb63('0x24')](0x194);}return _0x1b8f0a;};}function handleError(_0x49482f,_0x2bbe9a){_0x2bbe9a=_0x2bbe9a||0x1f4;return function(_0x4c80c1){logger['error'](_0x4c80c1[_0xfb63('0x25')]);if(_0x4c80c1[_0xfb63('0x26')]){delete _0x4c80c1[_0xfb63('0x26')];}_0x49482f[_0xfb63('0x17')](_0x2bbe9a)[_0xfb63('0x27')](_0x4c80c1);};}exports[_0xfb63('0x28')]=function(_0x594962,_0x45e231){var _0x2a008e={},_0x441dd7={},_0x188501={'count':0x0,'rows':[]};var _0x3c910b=_[_0xfb63('0x29')](db[_0xfb63('0x2a')][_0xfb63('0x2b')],function(_0x293909){return{'name':_0x293909[_0xfb63('0x2c')],'type':_0x293909[_0xfb63('0x2d')]['key']};});_0x441dd7[_0xfb63('0x2e')]=_['map'](_0x3c910b,_0xfb63('0x26'));_0x441dd7[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0x594962['query']);_0x441dd7['filters']=_[_0xfb63('0x31')](_0x441dd7['model'],_0x441dd7['query']);_0x2a008e[_0xfb63('0x32')]=_['intersection'](_0x441dd7[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0x594962[_0xfb63('0x2f')][_0xfb63('0x33')]));_0x2a008e[_0xfb63('0x32')]=_0x2a008e[_0xfb63('0x32')][_0xfb63('0x34')]?_0x2a008e[_0xfb63('0x32')]:_0x441dd7['model'];if(!_0x594962['query'][_0xfb63('0x35')]('nolimit')){_0x2a008e[_0xfb63('0x1c')]=qs[_0xfb63('0x1c')](_0x594962[_0xfb63('0x2f')][_0xfb63('0x1c')]);_0x2a008e[_0xfb63('0x1a')]=qs['offset'](_0x594962['query'][_0xfb63('0x1a')]);}_0x2a008e[_0xfb63('0x36')]=qs['sort'](_0x594962['query']['sort']);_0x2a008e[_0xfb63('0x37')]=qs[_0xfb63('0x38')](_[_0xfb63('0x39')](_0x594962['query'],_0x441dd7[_0xfb63('0x38')]),_0x3c910b);if(_0x594962[_0xfb63('0x2f')][_0xfb63('0x3a')]){_0x2a008e[_0xfb63('0x37')]=_[_0xfb63('0x3b')](_0x2a008e[_0xfb63('0x37')],{'$or':_[_0xfb63('0x29')](_0x3c910b,function(_0x579ca5){if(_0x579ca5['type']!==_0xfb63('0x3c')){var _0x4fb080={};_0x4fb080[_0x579ca5[_0xfb63('0x26')]]={'$like':'%'+_0x594962[_0xfb63('0x2f')][_0xfb63('0x3a')]+'%'};return _0x4fb080;}})});}_0x2a008e=_[_0xfb63('0x3b')]({},_0x2a008e,_0x594962[_0xfb63('0x3d')]);var _0x38ecc3={'where':_0x2a008e[_0xfb63('0x37')]};return db[_0xfb63('0x2a')][_0xfb63('0x1d')](_0x38ecc3)[_0xfb63('0x22')](function(_0x3d745a){_0x188501[_0xfb63('0x1d')]=_0x3d745a;if(_0x594962[_0xfb63('0x2f')][_0xfb63('0x3e')]){_0x2a008e[_0xfb63('0x3f')]=[{'all':!![]}];}return db[_0xfb63('0x2a')][_0xfb63('0x40')](_0x2a008e);})[_0xfb63('0x22')](function(_0x3f0d52){_0x188501[_0xfb63('0x41')]=_0x3f0d52;return _0x188501;})[_0xfb63('0x22')](respondWithFilteredResult(_0x45e231,_0x2a008e))['catch'](handleError(_0x45e231,null));};exports['show']=function(_0x29786a,_0x54346d){var _0x3bdc62={'raw':!![],'where':{'id':_0x29786a[_0xfb63('0x42')]['id']}},_0x1fc68b={};_0x1fc68b[_0xfb63('0x2e')]=_[_0xfb63('0x30')](db[_0xfb63('0x2a')][_0xfb63('0x2b')]);_0x1fc68b[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0x29786a[_0xfb63('0x2f')]);_0x1fc68b[_0xfb63('0x38')]=_[_0xfb63('0x31')](_0x1fc68b['model'],_0x1fc68b[_0xfb63('0x2f')]);_0x3bdc62[_0xfb63('0x32')]=_[_0xfb63('0x31')](_0x1fc68b[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0x29786a[_0xfb63('0x2f')][_0xfb63('0x33')]));_0x3bdc62[_0xfb63('0x32')]=_0x3bdc62[_0xfb63('0x32')]['length']?_0x3bdc62[_0xfb63('0x32')]:_0x1fc68b[_0xfb63('0x2e')];if(_0x29786a[_0xfb63('0x2f')][_0xfb63('0x3e')]){_0x3bdc62[_0xfb63('0x3f')]=[{'all':!![]}];}_0x3bdc62=_[_0xfb63('0x3b')]({},_0x3bdc62,_0x29786a['options']);return db[_0xfb63('0x2a')][_0xfb63('0x43')](_0x3bdc62)[_0xfb63('0x22')](handleEntityNotFound(_0x54346d,null))[_0xfb63('0x22')](respondWithResult(_0x54346d,null))[_0xfb63('0x44')](handleError(_0x54346d,null));};exports[_0xfb63('0x45')]=function(_0x2cf398,_0x13030c){return db[_0xfb63('0x2a')]['create'](_0x2cf398[_0xfb63('0x46')],{})[_0xfb63('0x22')](respondWithResult(_0x13030c,0xc9))[_0xfb63('0x44')](handleError(_0x13030c,null));};exports[_0xfb63('0x21')]=function(_0x27a179,_0x1f0478){if(_0x27a179[_0xfb63('0x46')]['id']){delete _0x27a179[_0xfb63('0x46')]['id'];}return db[_0xfb63('0x2a')]['find']({'where':{'id':_0x27a179[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x1f0478,null))[_0xfb63('0x22')](saveUpdates(_0x27a179[_0xfb63('0x46')],null))[_0xfb63('0x22')](respondWithResult(_0x1f0478,null))[_0xfb63('0x44')](handleError(_0x1f0478,null));};exports['destroy']=function(_0x39d921,_0x24aa62){return db['FaxQueueReport'][_0xfb63('0x43')]({'where':{'id':_0x39d921[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x24aa62,null))[_0xfb63('0x22')](removeEntity(_0x24aa62,null))[_0xfb63('0x44')](handleError(_0x24aa62,null));};exports[_0xfb63('0x47')]=function(_0xf95110,_0x43c1a8){return db[_0xfb63('0x2a')][_0xfb63('0x47')]()[_0xfb63('0x22')](respondWithResult(_0x43c1a8,null))['catch'](handleError(_0x43c1a8,null));}; \ No newline at end of file +var _0xae7b=['save','update','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x328e86,_0xd152a9){var _0x943d38=function(_0x33f4da){while(--_0x33f4da){_0x328e86['push'](_0x328e86['shift']());}};_0x943d38(++_0xd152a9);}(_0xae7b,0xbe));var _0xbae7=function(_0x2e9be4,_0x463bf6){_0x2e9be4=_0x2e9be4-0x0;var _0x22cb76=_0xae7b[_0x2e9be4];return _0x22cb76;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d17ae,_0x4090a1){_0x4090a1=_0x4090a1||0xcc;return function(_0x5b1abe){if(_0x5b1abe){return _0x3d17ae['sendStatus'](_0x4090a1);}return _0x3d17ae[_0xbae7('0x15')](_0x4090a1)[_0xbae7('0x16')]();};}function respondWithResult(_0x43e4ca,_0x25d1a){_0x25d1a=_0x25d1a||0xc8;return function(_0x4cc0a9){if(_0x4cc0a9){return _0x43e4ca[_0xbae7('0x15')](_0x25d1a)['json'](_0x4cc0a9);}};}function respondWithFilteredResult(_0x5aae99,_0x249669){return function(_0xb272c4){if(_0xb272c4){var _0x1b9ee1=typeof _0x249669[_0xbae7('0x17')]===_0xbae7('0x18')&&typeof _0x249669[_0xbae7('0x19')]==='undefined';var _0x1b2949=_0xb272c4[_0xbae7('0x1a')];var _0x99d88=_0x1b9ee1?0x0:_0x249669[_0xbae7('0x17')];var _0x1fc9fb=_0x1b9ee1?_0xb272c4['count']:_0x249669['offset']+_0x249669['limit'];var _0xa9ed79;if(_0x1fc9fb>=_0x1b2949){_0x1fc9fb=_0x1b2949;_0xa9ed79=0xc8;}else{_0xa9ed79=0xce;}_0x5aae99[_0xbae7('0x15')](_0xa9ed79);return _0x5aae99[_0xbae7('0x1b')](_0xbae7('0x1c'),_0x99d88+'-'+_0x1fc9fb+'/'+_0x1b2949)[_0xbae7('0x1d')](_0xb272c4);}return null;};}function patchUpdates(_0x519980){return function(_0xd87dc2){try{jsonpatch[_0xbae7('0x1e')](_0xd87dc2,_0x519980,!![]);}catch(_0x34a82b){return BPromise[_0xbae7('0x1f')](_0x34a82b);}return _0xd87dc2[_0xbae7('0x20')]();};}function saveUpdates(_0x502f06,_0x32d772){return function(_0x3e4569){if(_0x3e4569){return _0x3e4569[_0xbae7('0x21')](_0x502f06)[_0xbae7('0x22')](function(_0xb5d7f3){return _0xb5d7f3;});}return null;};}function removeEntity(_0x384ea6,_0x32f8eb){return function(_0x5c0245){if(_0x5c0245){return _0x5c0245['destroy']()[_0xbae7('0x22')](function(){_0x384ea6[_0xbae7('0x15')](0xcc)[_0xbae7('0x16')]();});}};}function handleEntityNotFound(_0x375df5,_0x61170a){return function(_0x3e003d){if(!_0x3e003d){_0x375df5[_0xbae7('0x23')](0x194);}return _0x3e003d;};}function handleError(_0x1b5caa,_0x1399bc){_0x1399bc=_0x1399bc||0x1f4;return function(_0x3e104e){logger[_0xbae7('0x24')](_0x3e104e[_0xbae7('0x25')]);if(_0x3e104e['name']){delete _0x3e104e['name'];}_0x1b5caa['status'](_0x1399bc)[_0xbae7('0x26')](_0x3e104e);};}exports[_0xbae7('0x27')]=function(_0x203848,_0x12dd23){var _0x12797a={},_0x2d8202={},_0x47e12b={'count':0x0,'rows':[]};var _0x5d702f=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0x258c08){return{'name':_0x258c08[_0xbae7('0x2b')],'type':_0x258c08[_0xbae7('0x2c')]['key']};});_0x2d8202[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x5d702f,_0xbae7('0x2e'));_0x2d8202[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x203848[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x2d8202[_0xbae7('0x2d')],_0x2d8202[_0xbae7('0x2f')]);_0x12797a[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x2d8202['model'],qs[_0xbae7('0x34')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x12797a['attributes']=_0x12797a[_0xbae7('0x33')][_0xbae7('0x35')]?_0x12797a['attributes']:_0x2d8202[_0xbae7('0x2d')];if(!_0x203848[_0xbae7('0x2f')][_0xbae7('0x36')](_0xbae7('0x37'))){_0x12797a[_0xbae7('0x19')]=qs[_0xbae7('0x19')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x19')]);_0x12797a[_0xbae7('0x17')]=qs['offset'](_0x203848['query'][_0xbae7('0x17')]);}_0x12797a[_0xbae7('0x38')]=qs['sort'](_0x203848[_0xbae7('0x2f')][_0xbae7('0x39')]);_0x12797a[_0xbae7('0x3a')]=qs[_0xbae7('0x31')](_[_0xbae7('0x3b')](_0x203848[_0xbae7('0x2f')],_0x2d8202[_0xbae7('0x31')]),_0x5d702f);if(_0x203848[_0xbae7('0x2f')]['filter']){_0x12797a['where']=_[_0xbae7('0x3c')](_0x12797a['where'],{'$or':_[_0xbae7('0x28')](_0x5d702f,function(_0x59e90b){if(_0x59e90b[_0xbae7('0x2c')]!==_0xbae7('0x3d')){var _0x1fdb4f={};_0x1fdb4f[_0x59e90b[_0xbae7('0x2e')]]={'$like':'%'+_0x203848[_0xbae7('0x2f')][_0xbae7('0x3e')]+'%'};return _0x1fdb4f;}})});}_0x12797a=_['merge']({},_0x12797a,_0x203848[_0xbae7('0x3f')]);var _0x4fa0ba={'where':_0x12797a['where']};return db[_0xbae7('0x29')][_0xbae7('0x1a')](_0x4fa0ba)[_0xbae7('0x22')](function(_0xc1c69e){_0x47e12b[_0xbae7('0x1a')]=_0xc1c69e;if(_0x203848['query'][_0xbae7('0x40')]){_0x12797a[_0xbae7('0x41')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x42')](_0x12797a);})[_0xbae7('0x22')](function(_0x5047b0){_0x47e12b[_0xbae7('0x43')]=_0x5047b0;return _0x47e12b;})['then'](respondWithFilteredResult(_0x12dd23,_0x12797a))[_0xbae7('0x44')](handleError(_0x12dd23,null));};exports[_0xbae7('0x45')]=function(_0x3647a8,_0x472686){var _0x1895ef={'raw':!![],'where':{'id':_0x3647a8[_0xbae7('0x46')]['id']}},_0x57f345={};_0x57f345[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x57f345[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x3647a8['query']);_0x57f345[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x57f345[_0xbae7('0x2d')],_0x57f345[_0xbae7('0x2f')]);_0x1895ef[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x57f345['model'],qs['fields'](_0x3647a8[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x1895ef['attributes']=_0x1895ef[_0xbae7('0x33')][_0xbae7('0x35')]?_0x1895ef[_0xbae7('0x33')]:_0x57f345[_0xbae7('0x2d')];if(_0x3647a8[_0xbae7('0x2f')]['includeAll']){_0x1895ef[_0xbae7('0x41')]=[{'all':!![]}];}_0x1895ef=_[_0xbae7('0x3c')]({},_0x1895ef,_0x3647a8[_0xbae7('0x3f')]);return db[_0xbae7('0x29')]['find'](_0x1895ef)[_0xbae7('0x22')](handleEntityNotFound(_0x472686,null))[_0xbae7('0x22')](respondWithResult(_0x472686,null))[_0xbae7('0x44')](handleError(_0x472686,null));};exports[_0xbae7('0x47')]=function(_0x50b52b,_0x11722e){return db[_0xbae7('0x29')][_0xbae7('0x47')](_0x50b52b[_0xbae7('0x48')],{})['then'](respondWithResult(_0x11722e,0xc9))[_0xbae7('0x44')](handleError(_0x11722e,null));};exports[_0xbae7('0x21')]=function(_0xb6df1f,_0x363b7b){if(_0xb6df1f[_0xbae7('0x48')]['id']){delete _0xb6df1f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xb6df1f[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x363b7b,null))[_0xbae7('0x22')](saveUpdates(_0xb6df1f[_0xbae7('0x48')],null))[_0xbae7('0x22')](respondWithResult(_0x363b7b,null))['catch'](handleError(_0x363b7b,null));};exports['destroy']=function(_0x1bb00a,_0x46f0a9){return db[_0xbae7('0x29')]['find']({'where':{'id':_0x1bb00a[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x46f0a9,null))[_0xbae7('0x22')](removeEntity(_0x46f0a9,null))[_0xbae7('0x44')](handleError(_0x46f0a9,null));};exports[_0xbae7('0x49')]=function(_0x4cf377,_0x2ccd2c){return db['FaxQueueReport'][_0xbae7('0x49')]()[_0xbae7('0x22')](respondWithResult(_0x2ccd2c,null))[_0xbae7('0x44')](handleError(_0x2ccd2c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e1642fe..d0e8767 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0xe0d935,_0x4610eb){var _0x12db5b=function(_0x371d2c){while(--_0x371d2c){_0xe0d935['push'](_0xe0d935['shift']());}};_0x12db5b(++_0x4610eb);}(_0x7a54,0x106));var _0x47a5=function(_0x51e28d,_0x4bfa52){_0x51e28d=_0x51e28d-0x0;var _0x34e899=_0x7a54[_0x51e28d];return _0x34e899;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x8a7c73,_0x832676){var _0x184337=function(_0x346cb9){while(--_0x346cb9){_0x8a7c73['push'](_0x8a7c73['shift']());}};_0x184337(++_0x832676);}(_0xe14b,0x93));var _0xbe14=function(_0x4b8cd8,_0x339d1e){_0x4b8cd8=_0x4b8cd8-0x0;var _0x231f12=_0xe14b[_0x4b8cd8];return _0x231f12;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','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 192363c..c8481cc 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 _0x2d88=['rpc','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0xbed58e,_0x3a1272){var _0x295e44=function(_0x45755a){while(--_0x45755a){_0xbed58e['push'](_0xbed58e['shift']());}};_0x295e44(++_0x3a1272);}(_0x2d88,0x19f));var _0x82d8=function(_0x1b66c8,_0x1569f6){_0x1b66c8=_0x1b66c8-0x0;var _0x1e372a=_0x2d88[_0x1b66c8];return _0x1e372a;};'use strict';var _=require('lodash');var util=require(_0x82d8('0x0'));var moment=require(_0x82d8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82d8('0x2'));var db=require(_0x82d8('0x3'))['db'];var utils=require(_0x82d8('0x4'));var logger=require('../../config/logger')(_0x82d8('0x5'));var config=require(_0x82d8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x343fc7,_0x112200,_0xeb140d){return new BPromise(function(_0x8edd35,_0x1ea314){return client[_0x82d8('0x8')](_0x343fc7,_0xeb140d)[_0x82d8('0x9')](function(_0x600670){logger[_0x82d8('0xa')](_0x82d8('0xb'),_0x112200,_0x82d8('0xc'));logger[_0x82d8('0xd')](_0x82d8('0xe'),_0x112200,'request\x20sent',JSON[_0x82d8('0xf')](_0x600670));if(_0x600670[_0x82d8('0x10')]){if(_0x600670[_0x82d8('0x10')][_0x82d8('0x11')]===0x1f4){logger[_0x82d8('0x10')](_0x82d8('0xb'),_0x112200,_0x600670['error'][_0x82d8('0x12')]);return _0x1ea314(_0x600670['error']['message']);}logger[_0x82d8('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x112200,_0x600670['error'][_0x82d8('0x12')]);return _0x8edd35(_0x600670[_0x82d8('0x10')][_0x82d8('0x12')]);}else{logger[_0x82d8('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x112200,'request\x20sent');_0x8edd35(_0x600670[_0x82d8('0x13')][_0x82d8('0x12')]);}})[_0x82d8('0x14')](function(_0x5c00a9){logger[_0x82d8('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x112200,_0x5c00a9);_0x1ea314(_0x5c00a9);});});}exports['CreateFaxQueueReport']=function(_0x2f3a2d){var _0x5331d3=this;return new Promise(function(_0x35ca17,_0x2b9fb0){return db['FaxQueueReport'][_0x82d8('0x15')](_0x2f3a2d[_0x82d8('0x16')],{'raw':_0x2f3a2d[_0x82d8('0x17')]?_0x2f3a2d['options'][_0x82d8('0x18')]===undefined?!![]:![]:!![]})[_0x82d8('0x9')](function(_0x1b8768){logger[_0x82d8('0xa')]('CreateFaxQueueReport',_0x2f3a2d);logger['debug'](_0x82d8('0x19'),_0x2f3a2d,JSON[_0x82d8('0xf')](_0x1b8768));_0x35ca17(_0x1b8768);})[_0x82d8('0x14')](function(_0x189ac7){logger[_0x82d8('0x10')](_0x82d8('0x19'),_0x189ac7[_0x82d8('0x12')],_0x2f3a2d);_0x2b9fb0(_0x5331d3[_0x82d8('0x10')](0x1f4,_0x189ac7['message']));});});};exports[_0x82d8('0x1a')]=function(_0x26639c){var _0xb1f50b=this;return new Promise(function(_0x3452de,_0x48b364){return db['FaxQueueReport'][_0x82d8('0x1b')](_0x26639c[_0x82d8('0x16')],{'raw':_0x26639c[_0x82d8('0x17')]?_0x26639c[_0x82d8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26639c[_0x82d8('0x17')]?_0x26639c[_0x82d8('0x17')][_0x82d8('0x1c')]||null:null,'attributes':_0x26639c[_0x82d8('0x17')]?_0x26639c['options'][_0x82d8('0x1d')]||null:null,'limit':_0x26639c[_0x82d8('0x17')]?_0x26639c[_0x82d8('0x17')]['limit']||null:null})['then'](function(_0x10831e){logger[_0x82d8('0xa')](_0x82d8('0x1a'),_0x26639c);logger[_0x82d8('0xd')](_0x82d8('0x1a'),_0x26639c,JSON[_0x82d8('0xf')](_0x10831e));_0x3452de(_0x10831e);})[_0x82d8('0x14')](function(_0x67cc18){logger['error'](_0x82d8('0x1a'),_0x67cc18[_0x82d8('0x12')],_0x26639c);_0x48b364(_0xb1f50b[_0x82d8('0x10')](0x1f4,_0x67cc18['message']));});});}; \ No newline at end of file +var _0x000a=['debug','stringify','error','code','message','result','catch','FaxQueueReport,\x20%s,\x20%s','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x000a,0x170));var _0xa000=function(_0x5d7dbf,_0x3206e7){_0x5d7dbf=_0x5d7dbf-0x0;var _0x355630=_0x000a[_0x5d7dbf];return _0x355630;};'use strict';var _=require(_0xa000('0x0'));var util=require(_0xa000('0x1'));var moment=require(_0xa000('0x2'));var BPromise=require(_0xa000('0x3'));var rs=require(_0xa000('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa000('0x5'))['db'];var utils=require(_0xa000('0x6'));var logger=require(_0xa000('0x7'))(_0xa000('0x8'));var config=require(_0xa000('0x9'));var jayson=require(_0xa000('0xa'));var client=jayson[_0xa000('0xb')][_0xa000('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ecb51,_0x28f725,_0x4af5e2){return new BPromise(function(_0x11b214,_0x1220d0){return client[_0xa000('0xd')](_0x1ecb51,_0x4af5e2)[_0xa000('0xe')](function(_0x1a2f02){logger[_0xa000('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'));logger[_0xa000('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'),JSON[_0xa000('0x12')](_0x1a2f02));if(_0x1a2f02[_0xa000('0x13')]){if(_0x1a2f02[_0xa000('0x13')][_0xa000('0x14')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0x1a2f02['error'][_0xa000('0x15')]);return _0x1220d0(_0x1a2f02[_0xa000('0x13')][_0xa000('0x15')]);}logger[_0xa000('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0x1a2f02[_0xa000('0x13')]['message']);return _0x11b214(_0x1a2f02[_0xa000('0x13')][_0xa000('0x15')]);}else{logger[_0xa000('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'));_0x11b214(_0x1a2f02[_0xa000('0x16')][_0xa000('0x15')]);}})[_0xa000('0x17')](function(_0x183a60){logger[_0xa000('0x13')](_0xa000('0x18'),_0x28f725,_0x183a60);_0x1220d0(_0x183a60);});});}exports[_0xa000('0x19')]=function(_0x5c8e24){var _0xca4455=this;return new Promise(function(_0x2699d4,_0x5e102a){return db[_0xa000('0x1a')][_0xa000('0x1b')](_0x5c8e24[_0xa000('0x1c')],{'raw':_0x5c8e24['options']?_0x5c8e24[_0xa000('0x1d')][_0xa000('0x1e')]===undefined?!![]:![]:!![]})[_0xa000('0xe')](function(_0x343a4e){logger['info'](_0xa000('0x19'),_0x5c8e24);logger[_0xa000('0x11')](_0xa000('0x19'),_0x5c8e24,JSON[_0xa000('0x12')](_0x343a4e));_0x2699d4(_0x343a4e);})[_0xa000('0x17')](function(_0x493088){logger[_0xa000('0x13')]('CreateFaxQueueReport',_0x493088[_0xa000('0x15')],_0x5c8e24);_0x5e102a(_0xca4455[_0xa000('0x13')](0x1f4,_0x493088['message']));});});};exports['UpdateFaxQueueReport']=function(_0x4fec77){var _0x5d6272=this;return new Promise(function(_0x397151,_0x1ef7b8){return db[_0xa000('0x1a')][_0xa000('0x1f')](_0x4fec77[_0xa000('0x1c')],{'raw':_0x4fec77[_0xa000('0x1d')]?_0x4fec77['options'][_0xa000('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fec77[_0xa000('0x1d')]?_0x4fec77[_0xa000('0x1d')]['where']||null:null,'attributes':_0x4fec77['options']?_0x4fec77['options'][_0xa000('0x20')]||null:null,'limit':_0x4fec77['options']?_0x4fec77[_0xa000('0x1d')][_0xa000('0x21')]||null:null})[_0xa000('0xe')](function(_0x3575c5){logger['info'](_0xa000('0x22'),_0x4fec77);logger['debug'](_0xa000('0x22'),_0x4fec77,JSON[_0xa000('0x12')](_0x3575c5));_0x397151(_0x3575c5);})[_0xa000('0x17')](function(_0x25a70a){logger[_0xa000('0x13')]('UpdateFaxQueueReport',_0x25a70a[_0xa000('0x15')],_0x4fec77);_0x1ef7b8(_0x5d6272[_0xa000('0x13')](0x1f4,_0x25a70a[_0xa000('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ad816e5..bb336a6 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 _0xdfbe=['create','put','update','delete','exports','util','path','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x4c5ed3,_0x5e5b5c){var _0x368903=function(_0x3602aa){while(--_0x3602aa){_0x4c5ed3['push'](_0x4c5ed3['shift']());}};_0x368903(++_0x5e5b5c);}(_0xdfbe,0x1e1));var _0xedfb=function(_0xe0c73d,_0x513c88){_0xe0c73d=_0xe0c73d-0x0;var _0x2c8760=_0xdfbe[_0xe0c73d];return _0x2c8760;};'use strict';var multer=require('multer');var util=require(_0xedfb('0x0'));var path=require(_0xedfb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xedfb('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xedfb('0x3'));var controller=require(_0xedfb('0x4'));router[_0xedfb('0x5')]('/',auth[_0xedfb('0x6')](),controller[_0xedfb('0x7')]);router['get'](_0xedfb('0x8'),auth[_0xedfb('0x6')](),controller[_0xedfb('0x9')]);router[_0xedfb('0x5')](_0xedfb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xedfb('0xb')]('/',auth['isAuthenticated'](),controller[_0xedfb('0xc')]);router[_0xedfb('0xd')](_0xedfb('0xa'),auth[_0xedfb('0x6')](),controller[_0xedfb('0xe')]);router[_0xedfb('0xf')](_0xedfb('0xa'),auth[_0xedfb('0x6')](),controller['destroy']);module[_0xedfb('0x10')]=router; \ No newline at end of file +var _0xdb06=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4f8f55,_0x255f66){var _0x27ae68=function(_0xb2cf50){while(--_0xb2cf50){_0x4f8f55['push'](_0x4f8f55['shift']());}};_0x27ae68(++_0x255f66);}(_0xdb06,0x126));var _0x6db0=function(_0x3cb481,_0x14507d){_0x3cb481=_0x3cb481-0x0;var _0x2896e3=_0xdb06[_0x3cb481];return _0x2896e3;};'use strict';var multer=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var path=require('path');var timeout=require(_0x6db0('0x2'));var express=require('express');var router=express[_0x6db0('0x3')]();var fs_extra=require(_0x6db0('0x4'));var auth=require(_0x6db0('0x5'));var interaction=require(_0x6db0('0x6'));var config=require(_0x6db0('0x7'));var controller=require(_0x6db0('0x8'));router[_0x6db0('0x9')]('/',auth[_0x6db0('0xa')](),controller[_0x6db0('0xb')]);router[_0x6db0('0x9')]('/describe',auth[_0x6db0('0xa')](),controller[_0x6db0('0xc')]);router[_0x6db0('0x9')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller[_0x6db0('0xe')]);router['post']('/',auth[_0x6db0('0xa')](),controller[_0x6db0('0xf')]);router[_0x6db0('0x10')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller[_0x6db0('0x11')]);router[_0x6db0('0x12')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller['destroy']);module[_0x6db0('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 88db4b1..e6f0bc4 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x134e6f,_0x58c616){var _0x519a52=function(_0xbaad8a){while(--_0xbaad8a){_0x134e6f['push'](_0x134e6f['shift']());}};_0x519a52(++_0x58c616);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x38f86b,_0x45b662){var _0x10832f=function(_0x35f66a){while(--_0x35f66a){_0x38f86b['push'](_0x38f86b['shift']());}};_0x10832f(++_0x45b662);}(_0x008c,0x188));var _0xc008=function(_0x5d4818,_0x3ccae2){_0x5d4818=_0x5d4818-0x0;var _0x578a9c=_0x008c[_0x5d4818];return _0x578a9c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1f40370..24ed3cb 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 _0x1a10=['merge','VIRTUAL','FaxTransferReport','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','index','map','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x1a10,0xa6));var _0x01a1=function(_0x25b7f2,_0x35e98b){_0x25b7f2=_0x25b7f2-0x0;var _0x424315=_0x1a10[_0x25b7f2];return _0x424315;};'use strict';var emlformat=require(_0x01a1('0x0'));var rimraf=require(_0x01a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01a1('0x2'));var rp=require(_0x01a1('0x3'));var moment=require(_0x01a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01a1('0x5'));var util=require(_0x01a1('0x6'));var path=require(_0x01a1('0x7'));var sox=require(_0x01a1('0x8'));var csv=require(_0x01a1('0x9'));var ejs=require(_0x01a1('0xa'));var fs=require('fs');var fs_extra=require(_0x01a1('0xb'));var _=require(_0x01a1('0xc'));var squel=require(_0x01a1('0xd'));var crypto=require(_0x01a1('0xe'));var jsforce=require(_0x01a1('0xf'));var deskjs=require(_0x01a1('0x10'));var toCsv=require(_0x01a1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x01a1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x01a1('0x12'));var hardwareService=require(_0x01a1('0x13'));var logger=require(_0x01a1('0x14'))(_0x01a1('0x15'));var utils=require('../../config/utils');var config=require(_0x01a1('0x16'));var licenseUtil=require(_0x01a1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x211a78,_0x3baa8c){_0x3baa8c=_0x3baa8c||0xcc;return function(_0x2b2d01){if(_0x2b2d01){return _0x211a78[_0x01a1('0x18')](_0x3baa8c);}return _0x211a78[_0x01a1('0x19')](_0x3baa8c)['end']();};}function respondWithResult(_0x3b7180,_0x31966b){_0x31966b=_0x31966b||0xc8;return function(_0x403ea7){if(_0x403ea7){return _0x3b7180[_0x01a1('0x19')](_0x31966b)[_0x01a1('0x1a')](_0x403ea7);}};}function respondWithFilteredResult(_0x3b4f8c,_0xad76be){return function(_0x1a0bac){if(_0x1a0bac){var _0x2aa043=typeof _0xad76be[_0x01a1('0x1b')]===_0x01a1('0x1c')&&typeof _0xad76be[_0x01a1('0x1d')]==='undefined';var _0x196a7e=_0x1a0bac['count'];var _0x1fbd8d=_0x2aa043?0x0:_0xad76be[_0x01a1('0x1b')];var _0x2d4f85=_0x2aa043?_0x1a0bac[_0x01a1('0x1e')]:_0xad76be['offset']+_0xad76be[_0x01a1('0x1d')];var _0x51f19a;if(_0x2d4f85>=_0x196a7e){_0x2d4f85=_0x196a7e;_0x51f19a=0xc8;}else{_0x51f19a=0xce;}_0x3b4f8c[_0x01a1('0x19')](_0x51f19a);return _0x3b4f8c[_0x01a1('0x1f')](_0x01a1('0x20'),_0x1fbd8d+'-'+_0x2d4f85+'/'+_0x196a7e)[_0x01a1('0x1a')](_0x1a0bac);}return null;};}function patchUpdates(_0x2e7aaf){return function(_0x1d1d43){try{jsonpatch[_0x01a1('0x21')](_0x1d1d43,_0x2e7aaf,!![]);}catch(_0x3d54a5){return BPromise['reject'](_0x3d54a5);}return _0x1d1d43[_0x01a1('0x22')]();};}function saveUpdates(_0x5256c4,_0xc150dd){return function(_0x3b5d4a){if(_0x3b5d4a){return _0x3b5d4a[_0x01a1('0x23')](_0x5256c4)['then'](function(_0x32b6e4){return _0x32b6e4;});}return null;};}function removeEntity(_0x1bd82c,_0x11b8c6){return function(_0xb08240){if(_0xb08240){return _0xb08240[_0x01a1('0x24')]()[_0x01a1('0x25')](function(){_0x1bd82c['status'](0xcc)[_0x01a1('0x26')]();});}};}function handleEntityNotFound(_0x56fce7,_0x2534b0){return function(_0xf899e5){if(!_0xf899e5){_0x56fce7[_0x01a1('0x18')](0x194);}return _0xf899e5;};}function handleError(_0x3412f7,_0x2baccc){_0x2baccc=_0x2baccc||0x1f4;return function(_0x19c8f6){logger[_0x01a1('0x27')](_0x19c8f6['stack']);if(_0x19c8f6[_0x01a1('0x28')]){delete _0x19c8f6['name'];}_0x3412f7[_0x01a1('0x19')](_0x2baccc)['send'](_0x19c8f6);};}exports[_0x01a1('0x29')]=function(_0x44cf49,_0x250200){var _0x103e89={},_0x503139={},_0xb33101={'count':0x0,'rows':[]};var _0x3d62fe=_[_0x01a1('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x16bf93){return{'name':_0x16bf93['fieldName'],'type':_0x16bf93[_0x01a1('0x2b')][_0x01a1('0x2c')]};});_0x503139[_0x01a1('0x2d')]=_['map'](_0x3d62fe,_0x01a1('0x28'));_0x503139[_0x01a1('0x2e')]=_['keys'](_0x44cf49['query']);_0x503139[_0x01a1('0x2f')]=_[_0x01a1('0x30')](_0x503139[_0x01a1('0x2d')],_0x503139[_0x01a1('0x2e')]);_0x103e89['attributes']=_[_0x01a1('0x30')](_0x503139['model'],qs[_0x01a1('0x31')](_0x44cf49[_0x01a1('0x2e')][_0x01a1('0x31')]));_0x103e89[_0x01a1('0x32')]=_0x103e89[_0x01a1('0x32')][_0x01a1('0x33')]?_0x103e89[_0x01a1('0x32')]:_0x503139[_0x01a1('0x2d')];if(!_0x44cf49['query'][_0x01a1('0x34')](_0x01a1('0x35'))){_0x103e89[_0x01a1('0x1d')]=qs[_0x01a1('0x1d')](_0x44cf49[_0x01a1('0x2e')][_0x01a1('0x1d')]);_0x103e89[_0x01a1('0x1b')]=qs[_0x01a1('0x1b')](_0x44cf49[_0x01a1('0x2e')][_0x01a1('0x1b')]);}_0x103e89[_0x01a1('0x36')]=qs['sort'](_0x44cf49[_0x01a1('0x2e')][_0x01a1('0x37')]);_0x103e89[_0x01a1('0x38')]=qs[_0x01a1('0x2f')](_[_0x01a1('0x39')](_0x44cf49[_0x01a1('0x2e')],_0x503139[_0x01a1('0x2f')]),_0x3d62fe);if(_0x44cf49['query'][_0x01a1('0x3a')]){_0x103e89[_0x01a1('0x38')]=_[_0x01a1('0x3b')](_0x103e89[_0x01a1('0x38')],{'$or':_[_0x01a1('0x2a')](_0x3d62fe,function(_0x4978b7){if(_0x4978b7[_0x01a1('0x2b')]!==_0x01a1('0x3c')){var _0x55f779={};_0x55f779[_0x4978b7[_0x01a1('0x28')]]={'$like':'%'+_0x44cf49[_0x01a1('0x2e')]['filter']+'%'};return _0x55f779;}})});}_0x103e89=_['merge']({},_0x103e89,_0x44cf49['options']);var _0x2589ba={'where':_0x103e89[_0x01a1('0x38')]};return db[_0x01a1('0x3d')][_0x01a1('0x1e')](_0x2589ba)[_0x01a1('0x25')](function(_0x3f3b37){_0xb33101[_0x01a1('0x1e')]=_0x3f3b37;if(_0x44cf49[_0x01a1('0x2e')][_0x01a1('0x3e')]){_0x103e89[_0x01a1('0x3f')]=[{'all':!![]}];}return db[_0x01a1('0x3d')][_0x01a1('0x40')](_0x103e89);})['then'](function(_0x5bed4e){_0xb33101[_0x01a1('0x41')]=_0x5bed4e;return _0xb33101;})[_0x01a1('0x25')](respondWithFilteredResult(_0x250200,_0x103e89))[_0x01a1('0x42')](handleError(_0x250200,null));};exports['show']=function(_0x389737,_0x2e2e9c){var _0x32e94d={'raw':!![],'where':{'id':_0x389737[_0x01a1('0x43')]['id']}},_0xf66d5a={};_0xf66d5a['model']=_[_0x01a1('0x44')](db[_0x01a1('0x3d')][_0x01a1('0x45')]);_0xf66d5a[_0x01a1('0x2e')]=_['keys'](_0x389737[_0x01a1('0x2e')]);_0xf66d5a['filters']=_['intersection'](_0xf66d5a[_0x01a1('0x2d')],_0xf66d5a[_0x01a1('0x2e')]);_0x32e94d[_0x01a1('0x32')]=_[_0x01a1('0x30')](_0xf66d5a[_0x01a1('0x2d')],qs[_0x01a1('0x31')](_0x389737[_0x01a1('0x2e')][_0x01a1('0x31')]));_0x32e94d[_0x01a1('0x32')]=_0x32e94d[_0x01a1('0x32')][_0x01a1('0x33')]?_0x32e94d[_0x01a1('0x32')]:_0xf66d5a[_0x01a1('0x2d')];if(_0x389737[_0x01a1('0x2e')][_0x01a1('0x3e')]){_0x32e94d['include']=[{'all':!![]}];}_0x32e94d=_[_0x01a1('0x3b')]({},_0x32e94d,_0x389737[_0x01a1('0x46')]);return db[_0x01a1('0x3d')][_0x01a1('0x47')](_0x32e94d)['then'](handleEntityNotFound(_0x2e2e9c,null))[_0x01a1('0x25')](respondWithResult(_0x2e2e9c,null))[_0x01a1('0x42')](handleError(_0x2e2e9c,null));};exports[_0x01a1('0x48')]=function(_0x3cfe21,_0x19d58d){return db[_0x01a1('0x3d')][_0x01a1('0x48')](_0x3cfe21[_0x01a1('0x49')],{})['then'](respondWithResult(_0x19d58d,0xc9))[_0x01a1('0x42')](handleError(_0x19d58d,null));};exports[_0x01a1('0x23')]=function(_0x55c9d6,_0x3143f8){if(_0x55c9d6['body']['id']){delete _0x55c9d6[_0x01a1('0x49')]['id'];}return db[_0x01a1('0x3d')]['find']({'where':{'id':_0x55c9d6['params']['id']}})[_0x01a1('0x25')](handleEntityNotFound(_0x3143f8,null))[_0x01a1('0x25')](saveUpdates(_0x55c9d6[_0x01a1('0x49')],null))[_0x01a1('0x25')](respondWithResult(_0x3143f8,null))[_0x01a1('0x42')](handleError(_0x3143f8,null));};exports[_0x01a1('0x24')]=function(_0x3bd43f,_0x4f3896){return db[_0x01a1('0x3d')][_0x01a1('0x47')]({'where':{'id':_0x3bd43f[_0x01a1('0x43')]['id']}})[_0x01a1('0x25')](handleEntityNotFound(_0x4f3896,null))['then'](removeEntity(_0x4f3896,null))[_0x01a1('0x42')](handleError(_0x4f3896,null));};exports[_0x01a1('0x4a')]=function(_0x4c530f,_0x5e5fef){return db['FaxTransferReport'][_0x01a1('0x4a')]()[_0x01a1('0x25')](respondWithResult(_0x5e5fef,null))[_0x01a1('0x42')](handleError(_0x5e5fef,null));}; \ No newline at end of file +var _0x5113=['catch','show','params','length','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x45dbf2,_0x1e115d){var _0x32f54d=function(_0x4dcb7e){while(--_0x4dcb7e){_0x45dbf2['push'](_0x45dbf2['shift']());}};_0x32f54d(++_0x1e115d);}(_0x5113,0x1be));var _0x3511=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x5113[_0x29771f];return _0x279baf;};'use strict';var emlformat=require(_0x3511('0x0'));var rimraf=require(_0x3511('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3511('0x2'));var moment=require(_0x3511('0x3'));var BPromise=require(_0x3511('0x4'));var Mustache=require(_0x3511('0x5'));var util=require(_0x3511('0x6'));var path=require(_0x3511('0x7'));var sox=require(_0x3511('0x8'));var csv=require(_0x3511('0x9'));var ejs=require(_0x3511('0xa'));var fs=require('fs');var fs_extra=require(_0x3511('0xb'));var _=require(_0x3511('0xc'));var squel=require(_0x3511('0xd'));var crypto=require('crypto');var jsforce=require(_0x3511('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3511('0x9'));var querystring=require(_0x3511('0xf'));var Papa=require(_0x3511('0x10'));var Redis=require(_0x3511('0x11'));var authService=require(_0x3511('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3511('0x13'));var logger=require('../../config/logger')(_0x3511('0x14'));var utils=require(_0x3511('0x15'));var config=require(_0x3511('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3511('0x17'))['db'];function respondWithStatusCode(_0xee0fc4,_0x5cc459){_0x5cc459=_0x5cc459||0xcc;return function(_0x20ddb9){if(_0x20ddb9){return _0xee0fc4[_0x3511('0x18')](_0x5cc459);}return _0xee0fc4['status'](_0x5cc459)[_0x3511('0x19')]();};}function respondWithResult(_0x3476d4,_0x4a89b8){_0x4a89b8=_0x4a89b8||0xc8;return function(_0x28b2e7){if(_0x28b2e7){return _0x3476d4[_0x3511('0x1a')](_0x4a89b8)['json'](_0x28b2e7);}};}function respondWithFilteredResult(_0x381a85,_0x1b0290){return function(_0x4dcedf){if(_0x4dcedf){var _0x29c27d=typeof _0x1b0290[_0x3511('0x1b')]===_0x3511('0x1c')&&typeof _0x1b0290['limit']===_0x3511('0x1c');var _0x59214f=_0x4dcedf['count'];var _0x1cc191=_0x29c27d?0x0:_0x1b0290['offset'];var _0x3ecdd0=_0x29c27d?_0x4dcedf[_0x3511('0x1d')]:_0x1b0290[_0x3511('0x1b')]+_0x1b0290[_0x3511('0x1e')];var _0x13f818;if(_0x3ecdd0>=_0x59214f){_0x3ecdd0=_0x59214f;_0x13f818=0xc8;}else{_0x13f818=0xce;}_0x381a85[_0x3511('0x1a')](_0x13f818);return _0x381a85[_0x3511('0x1f')](_0x3511('0x20'),_0x1cc191+'-'+_0x3ecdd0+'/'+_0x59214f)[_0x3511('0x21')](_0x4dcedf);}return null;};}function patchUpdates(_0x2a2d25){return function(_0x258f25){try{jsonpatch[_0x3511('0x22')](_0x258f25,_0x2a2d25,!![]);}catch(_0x27d128){return BPromise['reject'](_0x27d128);}return _0x258f25[_0x3511('0x23')]();};}function saveUpdates(_0x7f9d07,_0x48811f){return function(_0x339220){if(_0x339220){return _0x339220[_0x3511('0x24')](_0x7f9d07)['then'](function(_0x6979e9){return _0x6979e9;});}return null;};}function removeEntity(_0x4884e8,_0x2de2cf){return function(_0x9152de){if(_0x9152de){return _0x9152de[_0x3511('0x25')]()[_0x3511('0x26')](function(){_0x4884e8[_0x3511('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaeed01,_0x339b18){return function(_0xbfb824){if(!_0xbfb824){_0xaeed01[_0x3511('0x18')](0x194);}return _0xbfb824;};}function handleError(_0x53ceb8,_0x1e7f07){_0x1e7f07=_0x1e7f07||0x1f4;return function(_0x59b41b){logger['error'](_0x59b41b['stack']);if(_0x59b41b[_0x3511('0x27')]){delete _0x59b41b[_0x3511('0x27')];}_0x53ceb8['status'](_0x1e7f07)[_0x3511('0x28')](_0x59b41b);};}exports[_0x3511('0x29')]=function(_0x1766c0,_0x17ad2d){var _0x10ca8d={},_0x4e99ec={},_0x3c56e7={'count':0x0,'rows':[]};var _0x1748b0=_[_0x3511('0x2a')](db[_0x3511('0x2b')][_0x3511('0x2c')],function(_0x5000ee){return{'name':_0x5000ee[_0x3511('0x2d')],'type':_0x5000ee[_0x3511('0x2e')][_0x3511('0x2f')]};});_0x4e99ec[_0x3511('0x30')]=_[_0x3511('0x2a')](_0x1748b0,_0x3511('0x27'));_0x4e99ec['query']=_[_0x3511('0x31')](_0x1766c0['query']);_0x4e99ec['filters']=_[_0x3511('0x32')](_0x4e99ec[_0x3511('0x30')],_0x4e99ec[_0x3511('0x33')]);_0x10ca8d[_0x3511('0x34')]=_['intersection'](_0x4e99ec[_0x3511('0x30')],qs[_0x3511('0x35')](_0x1766c0[_0x3511('0x33')][_0x3511('0x35')]));_0x10ca8d['attributes']=_0x10ca8d['attributes']['length']?_0x10ca8d[_0x3511('0x34')]:_0x4e99ec[_0x3511('0x30')];if(!_0x1766c0['query'][_0x3511('0x36')]('nolimit')){_0x10ca8d['limit']=qs[_0x3511('0x1e')](_0x1766c0[_0x3511('0x33')]['limit']);_0x10ca8d['offset']=qs[_0x3511('0x1b')](_0x1766c0[_0x3511('0x33')][_0x3511('0x1b')]);}_0x10ca8d[_0x3511('0x37')]=qs[_0x3511('0x38')](_0x1766c0[_0x3511('0x33')][_0x3511('0x38')]);_0x10ca8d[_0x3511('0x39')]=qs[_0x3511('0x3a')](_[_0x3511('0x3b')](_0x1766c0[_0x3511('0x33')],_0x4e99ec[_0x3511('0x3a')]),_0x1748b0);if(_0x1766c0['query'][_0x3511('0x3c')]){_0x10ca8d[_0x3511('0x39')]=_[_0x3511('0x3d')](_0x10ca8d['where'],{'$or':_[_0x3511('0x2a')](_0x1748b0,function(_0x113ae9){if(_0x113ae9[_0x3511('0x2e')]!==_0x3511('0x3e')){var _0x41803d={};_0x41803d[_0x113ae9[_0x3511('0x27')]]={'$like':'%'+_0x1766c0[_0x3511('0x33')][_0x3511('0x3c')]+'%'};return _0x41803d;}})});}_0x10ca8d=_['merge']({},_0x10ca8d,_0x1766c0[_0x3511('0x3f')]);var _0x4f07ab={'where':_0x10ca8d[_0x3511('0x39')]};return db[_0x3511('0x2b')]['count'](_0x4f07ab)[_0x3511('0x26')](function(_0x4df86e){_0x3c56e7[_0x3511('0x1d')]=_0x4df86e;if(_0x1766c0[_0x3511('0x33')][_0x3511('0x40')]){_0x10ca8d['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x10ca8d);})[_0x3511('0x26')](function(_0x102e78){_0x3c56e7['rows']=_0x102e78;return _0x3c56e7;})[_0x3511('0x26')](respondWithFilteredResult(_0x17ad2d,_0x10ca8d))[_0x3511('0x41')](handleError(_0x17ad2d,null));};exports[_0x3511('0x42')]=function(_0x66844c,_0x3347d6){var _0x22eb7e={'raw':!![],'where':{'id':_0x66844c[_0x3511('0x43')]['id']}},_0x11bf82={};_0x11bf82[_0x3511('0x30')]=_[_0x3511('0x31')](db[_0x3511('0x2b')][_0x3511('0x2c')]);_0x11bf82[_0x3511('0x33')]=_['keys'](_0x66844c[_0x3511('0x33')]);_0x11bf82['filters']=_[_0x3511('0x32')](_0x11bf82[_0x3511('0x30')],_0x11bf82[_0x3511('0x33')]);_0x22eb7e[_0x3511('0x34')]=_[_0x3511('0x32')](_0x11bf82[_0x3511('0x30')],qs[_0x3511('0x35')](_0x66844c[_0x3511('0x33')][_0x3511('0x35')]));_0x22eb7e[_0x3511('0x34')]=_0x22eb7e['attributes'][_0x3511('0x44')]?_0x22eb7e[_0x3511('0x34')]:_0x11bf82[_0x3511('0x30')];if(_0x66844c[_0x3511('0x33')][_0x3511('0x40')]){_0x22eb7e['include']=[{'all':!![]}];}_0x22eb7e=_[_0x3511('0x3d')]({},_0x22eb7e,_0x66844c[_0x3511('0x3f')]);return db[_0x3511('0x2b')][_0x3511('0x45')](_0x22eb7e)[_0x3511('0x26')](handleEntityNotFound(_0x3347d6,null))[_0x3511('0x26')](respondWithResult(_0x3347d6,null))[_0x3511('0x41')](handleError(_0x3347d6,null));};exports[_0x3511('0x46')]=function(_0x10518a,_0x41a401){return db[_0x3511('0x2b')][_0x3511('0x46')](_0x10518a['body'],{})[_0x3511('0x26')](respondWithResult(_0x41a401,0xc9))[_0x3511('0x41')](handleError(_0x41a401,null));};exports[_0x3511('0x24')]=function(_0x137b0d,_0x248ae0){if(_0x137b0d[_0x3511('0x47')]['id']){delete _0x137b0d[_0x3511('0x47')]['id'];}return db[_0x3511('0x2b')]['find']({'where':{'id':_0x137b0d[_0x3511('0x43')]['id']}})['then'](handleEntityNotFound(_0x248ae0,null))[_0x3511('0x26')](saveUpdates(_0x137b0d[_0x3511('0x47')],null))[_0x3511('0x26')](respondWithResult(_0x248ae0,null))[_0x3511('0x41')](handleError(_0x248ae0,null));};exports[_0x3511('0x25')]=function(_0x568141,_0x533806){return db[_0x3511('0x2b')][_0x3511('0x45')]({'where':{'id':_0x568141[_0x3511('0x43')]['id']}})[_0x3511('0x26')](handleEntityNotFound(_0x533806,null))[_0x3511('0x26')](removeEntity(_0x533806,null))[_0x3511('0x41')](handleError(_0x533806,null));};exports[_0x3511('0x48')]=function(_0x1a09cf,_0x58f7aa){return db[_0x3511('0x2b')][_0x3511('0x48')]()['then'](respondWithResult(_0x58f7aa,null))['catch'](handleError(_0x58f7aa,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d13fca3..ee89c1b 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 _0xf5fd=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./faxTransferReport.attributes','define'];(function(_0x1fb49d,_0x17353a){var _0x160def=function(_0x4fc4f9){while(--_0x4fc4f9){_0x1fb49d['push'](_0x1fb49d['shift']());}};_0x160def(++_0x17353a);}(_0xf5fd,0xc8));var _0xdf5f=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xf5fd[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0xdf5f('0x0'));var util=require(_0xdf5f('0x1'));var logger=require(_0xdf5f('0x2'))(_0xdf5f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf5f('0x4'));var rimraf=require(_0xdf5f('0x5'));var config=require(_0xdf5f('0x6'));var attributes=require(_0xdf5f('0x7'));module['exports']=function(_0x304eb6,_0x40a943){return _0x304eb6[_0xdf5f('0x8')]('FaxTransferReport',attributes,{'tableName':_0xdf5f('0x9'),'paranoid':![],'indexes':[{'name':_0xdf5f('0xa'),'fields':[_0xdf5f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27eb=['request-promise','path','rimraf','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','util','api','moment'];(function(_0x49a2a8,_0x5122a6){var _0x106342=function(_0x9f80d){while(--_0x9f80d){_0x49a2a8['push'](_0x49a2a8['shift']());}};_0x106342(++_0x5122a6);}(_0x27eb,0x96));var _0xb27e=function(_0xbd5a3f,_0x502afe){_0xbd5a3f=_0xbd5a3f-0x0;var _0x23db9c=_0x27eb[_0xbd5a3f];return _0x23db9c;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var logger=require('../../config/logger')(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require('bluebird');var rp=require(_0xb27e('0x4'));var fs=require('fs');var path=require(_0xb27e('0x5'));var rimraf=require(_0xb27e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb27e('0x7'));module['exports']=function(_0x242724,_0xb66404){return _0x242724[_0xb27e('0x8')]('FaxTransferReport',attributes,{'tableName':_0xb27e('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb27e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 382086b..64f9661 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 _0x8c3e=['jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4f8100,_0x37f9c3){var _0x164488=function(_0x4d7dd9){while(--_0x4d7dd9){_0x4f8100['push'](_0x4f8100['shift']());}};_0x164488(++_0x37f9c3);}(_0x8c3e,0xe8));var _0xe8c3=function(_0x4cc588,_0x4a9bc4){_0x4cc588=_0x4cc588-0x0;var _0x36619d=_0x8c3e[_0x4cc588];return _0x36619d;};'use strict';var _=require(_0xe8c3('0x0'));var util=require(_0xe8c3('0x1'));var moment=require(_0xe8c3('0x2'));var BPromise=require(_0xe8c3('0x3'));var rs=require(_0xe8c3('0x4'));var fs=require('fs');var Redis=require(_0xe8c3('0x5'));var db=require(_0xe8c3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8c3('0x7'))(_0xe8c3('0x8'));var config=require(_0xe8c3('0x9'));var jayson=require(_0xe8c3('0xa'));var client=jayson['client'][_0xe8c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0117,_0x475bbe,_0x4612ab){return new BPromise(function(_0x5d35d8,_0x317919){return client['request'](_0x4c0117,_0x4612ab)[_0xe8c3('0xc')](function(_0x4473f8){logger[_0xe8c3('0xd')](_0xe8c3('0xe'),_0x475bbe,_0xe8c3('0xf'));logger[_0xe8c3('0x10')](_0xe8c3('0x11'),_0x475bbe,'request\x20sent',JSON[_0xe8c3('0x12')](_0x4473f8));if(_0x4473f8['error']){if(_0x4473f8[_0xe8c3('0x13')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x475bbe,_0x4473f8[_0xe8c3('0x13')][_0xe8c3('0x14')]);return _0x317919(_0x4473f8[_0xe8c3('0x13')][_0xe8c3('0x14')]);}logger[_0xe8c3('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x475bbe,_0x4473f8['error'][_0xe8c3('0x14')]);return _0x5d35d8(_0x4473f8['error'][_0xe8c3('0x14')]);}else{logger['info'](_0xe8c3('0xe'),_0x475bbe,_0xe8c3('0xf'));_0x5d35d8(_0x4473f8['result'][_0xe8c3('0x14')]);}})[_0xe8c3('0x15')](function(_0x520140){logger[_0xe8c3('0x13')](_0xe8c3('0xe'),_0x475bbe,_0x520140);_0x317919(_0x520140);});});} \ No newline at end of file +var _0x2b97=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2bc6b8,_0x24f5b0){var _0x1b5ce6=function(_0x3dcab1){while(--_0x3dcab1){_0x2bc6b8['push'](_0x2bc6b8['shift']());}};_0x1b5ce6(++_0x24f5b0);}(_0x2b97,0xec));var _0x72b9=function(_0x739d40,_0x4509e8){_0x739d40=_0x739d40-0x0;var _0xc24f0=_0x2b97[_0x739d40];return _0xc24f0;};'use strict';var _=require(_0x72b9('0x0'));var util=require(_0x72b9('0x1'));var moment=require(_0x72b9('0x2'));var BPromise=require(_0x72b9('0x3'));var rs=require(_0x72b9('0x4'));var fs=require('fs');var Redis=require(_0x72b9('0x5'));var db=require(_0x72b9('0x6'))['db'];var utils=require(_0x72b9('0x7'));var logger=require(_0x72b9('0x8'))(_0x72b9('0x9'));var config=require(_0x72b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x72b9('0xb')][_0x72b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ca24a,_0x11c1f5,_0x3201a9){return new BPromise(function(_0x14fa03,_0x4d53eb){return client[_0x72b9('0xd')](_0x1ca24a,_0x3201a9)['then'](function(_0x22b5ef){logger[_0x72b9('0xe')](_0x72b9('0xf'),_0x11c1f5,_0x72b9('0x10'));logger[_0x72b9('0x11')](_0x72b9('0x12'),_0x11c1f5,_0x72b9('0x10'),JSON['stringify'](_0x22b5ef));if(_0x22b5ef[_0x72b9('0x13')]){if(_0x22b5ef[_0x72b9('0x13')]['code']===0x1f4){logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x22b5ef[_0x72b9('0x13')][_0x72b9('0x14')]);return _0x4d53eb(_0x22b5ef[_0x72b9('0x13')][_0x72b9('0x14')]);}logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x22b5ef['error'][_0x72b9('0x14')]);return _0x14fa03(_0x22b5ef[_0x72b9('0x13')]['message']);}else{logger[_0x72b9('0xe')](_0x72b9('0xf'),_0x11c1f5,'request\x20sent');_0x14fa03(_0x22b5ef[_0x72b9('0x15')]['message']);}})[_0x72b9('0x16')](function(_0x3be85a){logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x3be85a);_0x4d53eb(_0x3be85a);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index fa3d987..96252b4 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 _0x1097=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller'];(function(_0x37dd6e,_0x515639){var _0x168f1e=function(_0x110b50){while(--_0x110b50){_0x37dd6e['push'](_0x37dd6e['shift']());}};_0x168f1e(++_0x515639);}(_0x1097,0x99));var _0x7109=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x1097[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require('multer');var util=require(_0x7109('0x0'));var path=require('path');var timeout=require(_0x7109('0x1'));var express=require('express');var router=express[_0x7109('0x2')]();var fs_extra=require(_0x7109('0x3'));var auth=require(_0x7109('0x4'));var interaction=require(_0x7109('0x5'));var config=require('../../config/environment');var controller=require(_0x7109('0x6'));router['get']('/',auth[_0x7109('0x7')](),controller[_0x7109('0x8')]);router[_0x7109('0x9')](_0x7109('0xa'),auth['isAuthenticated'](),controller[_0x7109('0xb')]);router['get'](_0x7109('0xc'),auth['isAuthenticated'](),controller[_0x7109('0xd')]);router[_0x7109('0xe')]('/',auth[_0x7109('0x7')](),controller[_0x7109('0xf')]);router[_0x7109('0x10')](_0x7109('0xc'),auth[_0x7109('0x7')](),controller[_0x7109('0x11')]);router[_0x7109('0x12')](_0x7109('0xc'),auth[_0x7109('0x7')](),controller['destroy']);module[_0x7109('0x13')]=router; \ No newline at end of file +var _0xc9e6=['connect-timeout','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0xc9e6,0x84));var _0x6c9e=function(_0x233d69,_0x58c7a9){_0x233d69=_0x233d69-0x0;var _0x482fef=_0xc9e6[_0x233d69];return _0x482fef;};'use strict';var multer=require('multer');var util=require(_0x6c9e('0x0'));var path=require('path');var timeout=require(_0x6c9e('0x1'));var express=require('express');var router=express[_0x6c9e('0x2')]();var fs_extra=require(_0x6c9e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6c9e('0x4'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x6')]);router['get'](_0x6c9e('0x7'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x8')]);router[_0x6c9e('0x9')](_0x6c9e('0xa'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xb')]);router[_0x6c9e('0xc')]('/',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xd')]);router[_0x6c9e('0xe')]('/:id',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xf')]);router[_0x6c9e('0x10')](_0x6c9e('0xa'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x11')]);module[_0x6c9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5fe395f..ff4337d 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 _0x4e84=['isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e84,0x191));var _0x44e8=function(_0x92d91f,_0x39b9d9){_0x92d91f=_0x92d91f-0x0;var _0x5276f2=_0x4e84[_0x92d91f];return _0x5276f2;};'use strict';var multer=require(_0x44e8('0x0'));var util=require(_0x44e8('0x1'));var path=require('path');var timeout=require(_0x44e8('0x2'));var express=require(_0x44e8('0x3'));var router=express[_0x44e8('0x4')]();var fs_extra=require(_0x44e8('0x5'));var auth=require(_0x44e8('0x6'));var interaction=require(_0x44e8('0x7'));var config=require(_0x44e8('0x8'));var controller=require(_0x44e8('0x9'));router[_0x44e8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x44e8('0xb'),auth['isAuthenticated'](),controller[_0x44e8('0xc')]);router[_0x44e8('0xa')]('/:id/configurations',auth[_0x44e8('0xd')](),controller[_0x44e8('0xe')]);router[_0x44e8('0xa')](_0x44e8('0xf'),auth[_0x44e8('0xd')](),controller[_0x44e8('0x10')]);router[_0x44e8('0x11')]('/',auth[_0x44e8('0xd')](),controller[_0x44e8('0x12')]);router['post'](_0x44e8('0x13'),auth[_0x44e8('0xd')](),controller['addConfiguration']);router[_0x44e8('0x14')](_0x44e8('0xb'),auth[_0x44e8('0xd')](),controller['update']);router[_0x44e8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x44e8('0x16')]);module['exports']=router; \ No newline at end of file +var _0x64ac=['./intDeskAccount.controller','isAuthenticated','/:id','get','/:id/configurations','/:id/fields','create','addConfiguration','put','delete','exports','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x43313b,_0x143343){var _0x21f529=function(_0x2d191e){while(--_0x2d191e){_0x43313b['push'](_0x43313b['shift']());}};_0x21f529(++_0x143343);}(_0x64ac,0x9b));var _0xc64a=function(_0x2df4fd,_0x710692){_0x2df4fd=_0x2df4fd-0x0;var _0x1f6edb=_0x64ac[_0x2df4fd];return _0x1f6edb;};'use strict';var multer=require('multer');var util=require(_0xc64a('0x0'));var path=require(_0xc64a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc64a('0x2')]();var fs_extra=require(_0xc64a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc64a('0x4'));var config=require('../../config/environment');var controller=require(_0xc64a('0x5'));router['get']('/',auth[_0xc64a('0x6')](),controller['index']);router['get'](_0xc64a('0x7'),auth[_0xc64a('0x6')](),controller['show']);router[_0xc64a('0x8')](_0xc64a('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc64a('0x8')](_0xc64a('0xa'),auth[_0xc64a('0x6')](),controller['getFields']);router['post']('/',auth[_0xc64a('0x6')](),controller[_0xc64a('0xb')]);router['post'](_0xc64a('0x9'),auth[_0xc64a('0x6')](),controller[_0xc64a('0xc')]);router[_0xc64a('0xd')](_0xc64a('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xc64a('0xe')](_0xc64a('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xc64a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ca67715..22762c2 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 _0x150a=['STRING','basic','ENUM','integrationTab','newTab','sequelize'];(function(_0x5d345b,_0x7b2e03){var _0x175516=function(_0x4ee93c){while(--_0x4ee93c){_0x5d345b['push'](_0x5d345b['shift']());}};_0x175516(++_0x7b2e03);}(_0x150a,0x13d));var _0xa150=function(_0x341ced,_0x5774ad){_0x341ced=_0x341ced-0x0;var _0x5726b5=_0x150a[_0x341ced];return _0x5726b5;};'use strict';var Sequelize=require(_0xa150('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa150('0x1')]},'remoteUri':{'type':Sequelize[_0xa150('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xa150('0x2')),'defaultValue':_0xa150('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xa150('0x1')]},'consumerSecret':{'type':Sequelize[_0xa150('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xa150('0x1')]},'serverUrl':{'type':Sequelize[_0xa150('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa150('0x3')](_0xa150('0x4'),_0xa150('0x5')),'defaultValue':_0xa150('0x4')}}; \ No newline at end of file +var _0xe618=['newTab','sequelize','exports','STRING','basic','integrationTab'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe618,0x1d5));var _0x8e61=function(_0x4f0837,_0x2ef53b){_0x4f0837=_0x4f0837-0x0;var _0x30abc4=_0xe618[_0x4f0837];return _0x30abc4;};'use strict';var Sequelize=require(_0x8e61('0x0'));module[_0x8e61('0x1')]={'name':{'type':Sequelize[_0x8e61('0x2')]},'description':{'type':Sequelize[_0x8e61('0x2')]},'username':{'type':Sequelize[_0x8e61('0x2')]},'remoteUri':{'type':Sequelize[_0x8e61('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x8e61('0x3')),'defaultValue':_0x8e61('0x3')},'password':{'type':Sequelize[_0x8e61('0x2')]},'consumerKey':{'type':Sequelize[_0x8e61('0x2')]},'consumerSecret':{'type':Sequelize[_0x8e61('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8e61('0x4'),_0x8e61('0x5')),'defaultValue':_0x8e61('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index cde32b8..33ea88b 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 _0x4f89=['nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','DeskField','Subjects','Descriptions','getFields','priority','authType','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','password','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','fast-json-patch','sox','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x31d8ab,_0x21fc97){var _0x29de5e=function(_0x32c83c){while(--_0x32c83c){_0x31d8ab['push'](_0x31d8ab['shift']());}};_0x29de5e(++_0x21fc97);}(_0x4f89,0xa6));var _0x94f8=function(_0x5951b9,_0xa33e50){_0x5951b9=_0x5951b9-0x0;var _0x426c13=_0x4f89[_0x5951b9];return _0x426c13;};'use strict';var emlformat=require(_0x94f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94f8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x94f8('0x2'));var csv=require(_0x94f8('0x3'));var ejs=require(_0x94f8('0x4'));var fs=require('fs');var fs_extra=require(_0x94f8('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x94f8('0x3'));var querystring=require(_0x94f8('0x6'));var Papa=require(_0x94f8('0x7'));var Redis=require(_0x94f8('0x8'));var authService=require(_0x94f8('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x94f8('0xa'))(_0x94f8('0xb'));var utils=require(_0x94f8('0xc'));var config=require('../../config/environment');var licenseUtil=require(_0x94f8('0xd'));var db=require(_0x94f8('0xe'))['db'];var integrations=require(_0x94f8('0xf'));function respondWithStatusCode(_0x30ac55,_0x154827){_0x154827=_0x154827||0xcc;return function(_0x578c0a){if(_0x578c0a){return _0x30ac55[_0x94f8('0x10')](_0x154827);}return _0x30ac55[_0x94f8('0x11')](_0x154827)[_0x94f8('0x12')]();};}function respondWithResult(_0x23f35d,_0x361549){_0x361549=_0x361549||0xc8;return function(_0x3e442b){if(_0x3e442b){return _0x23f35d['status'](_0x361549)[_0x94f8('0x13')](_0x3e442b);}};}function respondWithFilteredResult(_0x13a03d,_0x4f339c){return function(_0x407580){if(_0x407580){var _0x5b2cee=typeof _0x4f339c[_0x94f8('0x14')]===_0x94f8('0x15')&&typeof _0x4f339c[_0x94f8('0x16')]===_0x94f8('0x15');var _0xfe1244=_0x407580[_0x94f8('0x17')];var _0x40e37f=_0x5b2cee?0x0:_0x4f339c[_0x94f8('0x14')];var _0x43cb05=_0x5b2cee?_0x407580[_0x94f8('0x17')]:_0x4f339c[_0x94f8('0x14')]+_0x4f339c['limit'];var _0x40da7a;if(_0x43cb05>=_0xfe1244){_0x43cb05=_0xfe1244;_0x40da7a=0xc8;}else{_0x40da7a=0xce;}_0x13a03d[_0x94f8('0x11')](_0x40da7a);return _0x13a03d[_0x94f8('0x18')]('Content-Range',_0x40e37f+'-'+_0x43cb05+'/'+_0xfe1244)[_0x94f8('0x13')](_0x407580);}return null;};}function patchUpdates(_0x264ed6){return function(_0x16baf7){try{jsonpatch[_0x94f8('0x19')](_0x16baf7,_0x264ed6,!![]);}catch(_0x5a2b4a){return BPromise['reject'](_0x5a2b4a);}return _0x16baf7[_0x94f8('0x1a')]();};}function saveUpdates(_0x5c75c1,_0x5917f5){return function(_0x9ffa3){if(_0x9ffa3){return _0x9ffa3[_0x94f8('0x1b')](_0x5c75c1)[_0x94f8('0x1c')](function(_0x29aef5){return _0x29aef5;});}return null;};}function removeEntity(_0x4f2ede,_0x350f6e){return function(_0x4efe4d){if(_0x4efe4d){return _0x4efe4d['destroy']()[_0x94f8('0x1c')](function(){_0x4f2ede['status'](0xcc)[_0x94f8('0x12')]();});}};}function handleEntityNotFound(_0x47be05,_0x235f79){return function(_0x7df09b){if(!_0x7df09b){_0x47be05['sendStatus'](0x194);}return _0x7df09b;};}function handleError(_0x2136dc,_0x3b5331){_0x3b5331=_0x3b5331||0x1f4;return function(_0x477d76){logger[_0x94f8('0x1d')](_0x477d76[_0x94f8('0x1e')]);if(_0x477d76[_0x94f8('0x1f')]){delete _0x477d76['name'];}_0x2136dc[_0x94f8('0x11')](_0x3b5331)[_0x94f8('0x20')](_0x477d76);};}exports[_0x94f8('0x21')]=function(_0xfcdfa2,_0x2d6df7){var _0x146238={},_0x13dd1c={},_0x4e3590={'count':0x0,'rows':[]};var _0x3240d2=_[_0x94f8('0x22')](db[_0x94f8('0x23')][_0x94f8('0x24')],function(_0x4e4988){return{'name':_0x4e4988[_0x94f8('0x25')],'type':_0x4e4988[_0x94f8('0x26')][_0x94f8('0x27')]};});_0x13dd1c[_0x94f8('0x28')]=_[_0x94f8('0x22')](_0x3240d2,_0x94f8('0x1f'));_0x13dd1c[_0x94f8('0x29')]=_[_0x94f8('0x2a')](_0xfcdfa2[_0x94f8('0x29')]);_0x13dd1c[_0x94f8('0x2b')]=_[_0x94f8('0x2c')](_0x13dd1c['model'],_0x13dd1c[_0x94f8('0x29')]);_0x146238[_0x94f8('0x2d')]=_['intersection'](_0x13dd1c[_0x94f8('0x28')],qs['fields'](_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x2e')]));_0x146238[_0x94f8('0x2d')]=_0x146238['attributes']['length']?_0x146238[_0x94f8('0x2d')]:_0x13dd1c[_0x94f8('0x28')];if(!_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x2f')](_0x94f8('0x30'))){_0x146238[_0x94f8('0x16')]=qs[_0x94f8('0x16')](_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x16')]);_0x146238[_0x94f8('0x14')]=qs[_0x94f8('0x14')](_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x14')]);}_0x146238['order']=qs[_0x94f8('0x31')](_0xfcdfa2['query'][_0x94f8('0x31')]);_0x146238[_0x94f8('0x32')]=qs[_0x94f8('0x2b')](_['pick'](_0xfcdfa2[_0x94f8('0x29')],_0x13dd1c[_0x94f8('0x2b')]),_0x3240d2);if(_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x33')]){_0x146238[_0x94f8('0x32')]=_[_0x94f8('0x34')](_0x146238['where'],{'$or':_['map'](_0x3240d2,function(_0x38edf6){if(_0x38edf6[_0x94f8('0x26')]!=='VIRTUAL'){var _0x4ac217={};_0x4ac217[_0x38edf6['name']]={'$like':'%'+_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x33')]+'%'};return _0x4ac217;}})});}_0x146238=_[_0x94f8('0x34')]({},_0x146238,_0xfcdfa2[_0x94f8('0x35')]);var _0x4ebbe7={'where':_0x146238[_0x94f8('0x32')]};return db[_0x94f8('0x23')]['count'](_0x4ebbe7)[_0x94f8('0x1c')](function(_0x4d1bce){_0x4e3590[_0x94f8('0x17')]=_0x4d1bce;if(_0xfcdfa2[_0x94f8('0x29')][_0x94f8('0x36')]){_0x146238['include']=[{'all':!![]}];}return db[_0x94f8('0x23')][_0x94f8('0x37')](_0x146238);})[_0x94f8('0x1c')](function(_0x334844){_0x4e3590[_0x94f8('0x38')]=_0x334844;return _0x4e3590;})[_0x94f8('0x1c')](respondWithFilteredResult(_0x2d6df7,_0x146238))[_0x94f8('0x39')](handleError(_0x2d6df7,null));};exports[_0x94f8('0x3a')]=function(_0x5a7632,_0xa73ec8){var _0x44aa1b={'raw':![],'where':{'id':_0x5a7632[_0x94f8('0x3b')]['id']}},_0x36cdec={};_0x36cdec['model']=_[_0x94f8('0x2a')](db['DeskAccount'][_0x94f8('0x24')]);_0x36cdec['query']=_[_0x94f8('0x2a')](_0x5a7632[_0x94f8('0x29')]);_0x36cdec[_0x94f8('0x2b')]=_['intersection'](_0x36cdec[_0x94f8('0x28')],_0x36cdec['query']);_0x44aa1b[_0x94f8('0x2d')]=_[_0x94f8('0x2c')](_0x36cdec[_0x94f8('0x28')],qs[_0x94f8('0x2e')](_0x5a7632[_0x94f8('0x29')][_0x94f8('0x2e')]));_0x44aa1b[_0x94f8('0x2d')]=_0x44aa1b[_0x94f8('0x2d')][_0x94f8('0x3c')]?_0x44aa1b['attributes']:_0x36cdec[_0x94f8('0x28')];if(_0x5a7632[_0x94f8('0x29')][_0x94f8('0x36')]){_0x44aa1b[_0x94f8('0x3d')]=[{'all':!![]}];}_0x44aa1b=_[_0x94f8('0x34')]({},_0x44aa1b,_0x5a7632[_0x94f8('0x35')]);return db[_0x94f8('0x23')]['find'](_0x44aa1b)[_0x94f8('0x1c')](handleEntityNotFound(_0xa73ec8,null))[_0x94f8('0x1c')](respondWithResult(_0xa73ec8,null))['catch'](handleError(_0xa73ec8,null));};exports[_0x94f8('0x3e')]=function(_0x39ad83,_0x4b3b3e){return db[_0x94f8('0x23')][_0x94f8('0x3e')](_0x39ad83[_0x94f8('0x3f')],{})[_0x94f8('0x1c')](respondWithResult(_0x4b3b3e,0xc9))[_0x94f8('0x39')](handleError(_0x4b3b3e,null));};exports[_0x94f8('0x1b')]=function(_0x222b1a,_0xd02fa3){if(_0x222b1a[_0x94f8('0x3f')]['id']){delete _0x222b1a[_0x94f8('0x3f')]['id'];}return db['DeskAccount'][_0x94f8('0x40')]({'where':{'id':_0x222b1a[_0x94f8('0x3b')]['id']}})['then'](handleEntityNotFound(_0xd02fa3,null))[_0x94f8('0x1c')](saveUpdates(_0x222b1a['body'],null))['then'](respondWithResult(_0xd02fa3,null))[_0x94f8('0x39')](handleError(_0xd02fa3,null));};exports['destroy']=function(_0x148cb5,_0x2ac969){return db[_0x94f8('0x23')][_0x94f8('0x40')]({'where':{'id':_0x148cb5['params']['id']}})['then'](handleEntityNotFound(_0x2ac969,null))[_0x94f8('0x1c')](removeEntity(_0x2ac969,null))[_0x94f8('0x39')](handleError(_0x2ac969,null));};exports[_0x94f8('0x41')]=function(_0x568c30,_0x5bbf65,_0x4a89fe){var _0x590e82={};var _0x5b299e={};var _0x282394;var _0x246b94;return db['DeskAccount'][_0x94f8('0x42')]({'where':{'id':_0x568c30[_0x94f8('0x3b')]['id']}})[_0x94f8('0x1c')](handleEntityNotFound(_0x5bbf65,null))[_0x94f8('0x1c')](function(_0x5bbb30){if(_0x5bbb30){_0x282394=_0x5bbb30;_0x5b299e[_0x94f8('0x28')]=_[_0x94f8('0x2a')](db[_0x94f8('0x43')]['rawAttributes']);_0x5b299e[_0x94f8('0x29')]=_[_0x94f8('0x2a')](_0x568c30[_0x94f8('0x29')]);_0x5b299e[_0x94f8('0x2b')]=_[_0x94f8('0x2c')](_0x5b299e['model'],_0x5b299e[_0x94f8('0x29')]);_0x590e82['attributes']=_[_0x94f8('0x2c')](_0x5b299e[_0x94f8('0x28')],qs[_0x94f8('0x2e')](_0x568c30[_0x94f8('0x29')][_0x94f8('0x2e')]));_0x590e82[_0x94f8('0x2d')]=_0x590e82[_0x94f8('0x2d')][_0x94f8('0x3c')]?_0x590e82[_0x94f8('0x2d')]:_0x5b299e[_0x94f8('0x28')];_0x590e82['order']=qs[_0x94f8('0x31')](_0x568c30['query'][_0x94f8('0x31')]);_0x590e82[_0x94f8('0x32')]=qs['filters'](_['pick'](_0x568c30[_0x94f8('0x29')],_0x5b299e[_0x94f8('0x2b')]));if(_0x568c30[_0x94f8('0x29')][_0x94f8('0x33')]){_0x590e82['where']=_[_0x94f8('0x34')](_0x590e82[_0x94f8('0x32')],{'$or':_[_0x94f8('0x22')](_0x590e82[_0x94f8('0x2d')],function(_0x1baf50){var _0xc13243={};_0xc13243[_0x1baf50]={'$like':'%'+_0x568c30['query']['filter']+'%'};return _0xc13243;})});}_0x590e82=_[_0x94f8('0x34')]({},_0x590e82,_0x568c30['options']);return _0x282394['getConfigurations'](_0x590e82);}})[_0x94f8('0x1c')](function(_0x25ca0d){if(_0x25ca0d){_0x246b94=_0x25ca0d['length'];if(!_0x568c30[_0x94f8('0x29')][_0x94f8('0x2f')](_0x94f8('0x30'))){_0x590e82[_0x94f8('0x16')]=qs[_0x94f8('0x16')](_0x568c30[_0x94f8('0x29')][_0x94f8('0x16')]);_0x590e82[_0x94f8('0x14')]=qs[_0x94f8('0x14')](_0x568c30[_0x94f8('0x29')][_0x94f8('0x14')]);}return _0x282394['getConfigurations'](_0x590e82);}})['then'](function(_0x9d9a01){if(_0x9d9a01){return _0x9d9a01?{'count':_0x246b94,'rows':_0x9d9a01}:null;}})['then'](respondWithResult(_0x5bbf65,null))[_0x94f8('0x39')](handleError(_0x5bbf65,null));};exports[_0x94f8('0x44')]=function(_0x4234bd,_0x1ac577,_0x49a7e0){if(_0x4234bd[_0x94f8('0x3f')]['id']){delete _0x4234bd['body']['id'];}return db[_0x94f8('0x23')][_0x94f8('0x42')]({'where':{'id':_0x4234bd[_0x94f8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1ac577,null))['then'](function(_0x3b7259){if(_0x3b7259){_0x4234bd[_0x94f8('0x3f')][_0x94f8('0x45')]=_0x3b7259['id'];_0x4234bd[_0x94f8('0x3f')]['Subjects']=integrations[_0x94f8('0x46')](_0x4234bd['body'][_0x94f8('0x47')],_0x4234bd[_0x94f8('0x3f')]['type']);_0x4234bd[_0x94f8('0x3f')]['Descriptions']=integrations[_0x94f8('0x48')](_0x4234bd['body']['channel'],_0x4234bd[_0x94f8('0x3f')][_0x94f8('0x26')]);return db['DeskConfiguration'][_0x94f8('0x3e')](_0x4234bd[_0x94f8('0x3f')],{'include':[{'model':db[_0x94f8('0x49')],'as':_0x94f8('0x4a')},{'model':db['DeskField'],'as':_0x94f8('0x4b')}]});}return null;})['then'](respondWithResult(_0x1ac577,null))['catch'](handleError(_0x1ac577,null));};exports[_0x94f8('0x4c')]=function(_0x24cf7e,_0x28da87,_0x957e9c){var _0x216a34=[{'name':_0x94f8('0x4d'),'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 _0x24e601='';return db['DeskAccount'][_0x94f8('0x42')]({'where':{'id':_0x24cf7e[_0x94f8('0x3b')]['id']},'attributes':['id','remoteUri',_0x94f8('0x4e'),'username','password',_0x94f8('0x4f'),_0x94f8('0x50'),_0x94f8('0x51'),_0x94f8('0x52')]})[_0x94f8('0x1c')](handleEntityNotFound(_0x28da87,null))[_0x94f8('0x1c')](function(_0x36637a){if(_0x36637a){_0x24e601=_0x36637a[_0x94f8('0x53')];var _0x4dd663=_0x24e601[_0x94f8('0x54')](-0x1);if(_0x4dd663==='/'){_0x24e601=_0x24e601[_0x94f8('0x55')](0x0,_0x24e601['lastIndexOf'](_0x4dd663));}var _0x25db1d={'method':_0x94f8('0x56'),'uri':util[_0x94f8('0x57')](_0x94f8('0x58'),_0x24e601),'headers':{'Content-Type':_0x94f8('0x59'),'Accept':_0x94f8('0x59')},'json':!![]};if(_0x36637a['authType']===_0x94f8('0x5a')){_0x25db1d[_0x94f8('0x5b')][_0x94f8('0x5c')]=util[_0x94f8('0x57')](_0x94f8('0x5d'),new Buffer(util['format'](_0x94f8('0x5e'),_0x36637a[_0x94f8('0x5f')],_0x36637a[_0x94f8('0x60')]))['toString'](_0x94f8('0x61')));}return rp(_0x25db1d)[_0x94f8('0x1c')](function(_0x22fcd3){return _0x216a34[_0x94f8('0x62')](_[_0x94f8('0x22')](_0x22fcd3[_0x94f8('0x63')][_0x94f8('0x64')],function(_0x2570d3){return{'id':_0x2570d3[_0x94f8('0x1f')],'name':_0x2570d3['name'],'type':_0x2570d3[_0x94f8('0x26')],'active':_0x2570d3[_0x94f8('0x65')],'label':_0x2570d3[_0x94f8('0x66')],'custom':!![]};}));});}})[_0x94f8('0x1c')](function(_0x5cf290){return{'count':_0x5cf290[_0x94f8('0x3c')],'rows':_0x5cf290};})[_0x94f8('0x1c')](respondWithResult(_0x28da87,null))[_0x94f8('0x39')](function(_0x11b87f){var _0x3865ec=_0x24cf7e[_0x94f8('0x29')][_0x94f8('0x67')]?0x1f4:_0x11b87f['statusCode']||0x1f4;logger['error'](_0x94f8('0x68'),_0x94f8('0x4c'),_0x3865ec,JSON[_0x94f8('0x69')](_0x11b87f));delete _0x11b87f['name'];if(_0x3865ec===0x191){_0x3865ec=0x190;}_0x28da87[_0x94f8('0x11')](_0x3865ec)['send'](_0x24cf7e[_0x94f8('0x29')][_0x94f8('0x67')]?{'message':'Wrong\x20credentials','statusCode':_0x11b87f[_0x94f8('0x6a')]}:_0x11b87f);});}; \ No newline at end of file +var _0x5e39=['crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','Descriptions','getFields','priority','authType','username','consumerKey','token','tokenSecret','slice','substring','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x330418,_0x5f1c89){var _0x3a5a7c=function(_0x1ee306){while(--_0x1ee306){_0x330418['push'](_0x330418['shift']());}};_0x3a5a7c(++_0x5f1c89);}(_0x5e39,0x1a9));var _0x95e3=function(_0x504d2b,_0x3c34ae){_0x504d2b=_0x504d2b-0x0;var _0x18ef75=_0x5e39[_0x504d2b];return _0x18ef75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x95e3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95e3('0x1'));var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var Mustache=require(_0x95e3('0x4'));var util=require(_0x95e3('0x5'));var path=require('path');var sox=require(_0x95e3('0x6'));var csv=require(_0x95e3('0x7'));var ejs=require(_0x95e3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e3('0x9'));var squel=require(_0x95e3('0xa'));var crypto=require(_0x95e3('0xb'));var jsforce=require(_0x95e3('0xc'));var deskjs=require(_0x95e3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95e3('0xe'));var Redis=require(_0x95e3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95e3('0x10'));var logger=require(_0x95e3('0x11'))(_0x95e3('0x12'));var utils=require(_0x95e3('0x13'));var config=require(_0x95e3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x95e3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x250b13,_0x15517a){_0x15517a=_0x15517a||0xcc;return function(_0x5bb507){if(_0x5bb507){return _0x250b13[_0x95e3('0x16')](_0x15517a);}return _0x250b13[_0x95e3('0x17')](_0x15517a)[_0x95e3('0x18')]();};}function respondWithResult(_0x1c46c2,_0x302f67){_0x302f67=_0x302f67||0xc8;return function(_0x179490){if(_0x179490){return _0x1c46c2[_0x95e3('0x17')](_0x302f67)['json'](_0x179490);}};}function respondWithFilteredResult(_0x2822d8,_0x5a06d8){return function(_0x40e0af){if(_0x40e0af){var _0x4f9366=typeof _0x5a06d8[_0x95e3('0x19')]==='undefined'&&typeof _0x5a06d8[_0x95e3('0x1a')]==='undefined';var _0x123157=_0x40e0af[_0x95e3('0x1b')];var _0x19eb4e=_0x4f9366?0x0:_0x5a06d8['offset'];var _0xa60957=_0x4f9366?_0x40e0af[_0x95e3('0x1b')]:_0x5a06d8[_0x95e3('0x19')]+_0x5a06d8[_0x95e3('0x1a')];var _0x1128b8;if(_0xa60957>=_0x123157){_0xa60957=_0x123157;_0x1128b8=0xc8;}else{_0x1128b8=0xce;}_0x2822d8[_0x95e3('0x17')](_0x1128b8);return _0x2822d8[_0x95e3('0x1c')]('Content-Range',_0x19eb4e+'-'+_0xa60957+'/'+_0x123157)[_0x95e3('0x1d')](_0x40e0af);}return null;};}function patchUpdates(_0x33ea7){return function(_0x2d82f5){try{jsonpatch[_0x95e3('0x1e')](_0x2d82f5,_0x33ea7,!![]);}catch(_0x5aeb28){return BPromise[_0x95e3('0x1f')](_0x5aeb28);}return _0x2d82f5['save']();};}function saveUpdates(_0x34cd89,_0x1645b2){return function(_0x32970e){if(_0x32970e){return _0x32970e[_0x95e3('0x20')](_0x34cd89)[_0x95e3('0x21')](function(_0x44d65e){return _0x44d65e;});}return null;};}function removeEntity(_0x377241,_0x40f912){return function(_0x2a7e6f){if(_0x2a7e6f){return _0x2a7e6f[_0x95e3('0x22')]()[_0x95e3('0x21')](function(){_0x377241[_0x95e3('0x17')](0xcc)[_0x95e3('0x18')]();});}};}function handleEntityNotFound(_0x19b857,_0x3e1b1b){return function(_0xb6faf2){if(!_0xb6faf2){_0x19b857[_0x95e3('0x16')](0x194);}return _0xb6faf2;};}function handleError(_0x1cf608,_0x5c2df1){_0x5c2df1=_0x5c2df1||0x1f4;return function(_0x104e6f){logger[_0x95e3('0x23')](_0x104e6f[_0x95e3('0x24')]);if(_0x104e6f['name']){delete _0x104e6f[_0x95e3('0x25')];}_0x1cf608[_0x95e3('0x17')](_0x5c2df1)[_0x95e3('0x26')](_0x104e6f);};}exports[_0x95e3('0x27')]=function(_0x1032ec,_0x19f14c){var _0x390b44={},_0x2f0808={},_0x3f1653={'count':0x0,'rows':[]};var _0x1d713c=_['map'](db[_0x95e3('0x28')][_0x95e3('0x29')],function(_0x384207){return{'name':_0x384207[_0x95e3('0x2a')],'type':_0x384207['type'][_0x95e3('0x2b')]};});_0x2f0808[_0x95e3('0x2c')]=_[_0x95e3('0x2d')](_0x1d713c,_0x95e3('0x25'));_0x2f0808[_0x95e3('0x2e')]=_[_0x95e3('0x2f')](_0x1032ec['query']);_0x2f0808[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0x2f0808[_0x95e3('0x2c')],_0x2f0808[_0x95e3('0x2e')]);_0x390b44[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0x2f0808[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x33')]));_0x390b44['attributes']=_0x390b44[_0x95e3('0x32')][_0x95e3('0x34')]?_0x390b44['attributes']:_0x2f0808[_0x95e3('0x2c')];if(!_0x1032ec[_0x95e3('0x2e')]['hasOwnProperty']('nolimit')){_0x390b44['limit']=qs[_0x95e3('0x1a')](_0x1032ec[_0x95e3('0x2e')]['limit']);_0x390b44[_0x95e3('0x19')]=qs['offset'](_0x1032ec['query'][_0x95e3('0x19')]);}_0x390b44[_0x95e3('0x35')]=qs[_0x95e3('0x36')](_0x1032ec['query']['sort']);_0x390b44['where']=qs['filters'](_['pick'](_0x1032ec['query'],_0x2f0808[_0x95e3('0x30')]),_0x1d713c);if(_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x37')]){_0x390b44[_0x95e3('0x38')]=_[_0x95e3('0x39')](_0x390b44['where'],{'$or':_[_0x95e3('0x2d')](_0x1d713c,function(_0x402ebd){if(_0x402ebd[_0x95e3('0x3a')]!==_0x95e3('0x3b')){var _0x4629af={};_0x4629af[_0x402ebd[_0x95e3('0x25')]]={'$like':'%'+_0x1032ec['query'][_0x95e3('0x37')]+'%'};return _0x4629af;}})});}_0x390b44=_[_0x95e3('0x39')]({},_0x390b44,_0x1032ec[_0x95e3('0x3c')]);var _0x50b1ab={'where':_0x390b44[_0x95e3('0x38')]};return db[_0x95e3('0x28')][_0x95e3('0x1b')](_0x50b1ab)[_0x95e3('0x21')](function(_0x13cf37){_0x3f1653[_0x95e3('0x1b')]=_0x13cf37;if(_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x3d')]){_0x390b44[_0x95e3('0x3e')]=[{'all':!![]}];}return db['DeskAccount'][_0x95e3('0x3f')](_0x390b44);})['then'](function(_0xd5155b){_0x3f1653[_0x95e3('0x40')]=_0xd5155b;return _0x3f1653;})[_0x95e3('0x21')](respondWithFilteredResult(_0x19f14c,_0x390b44))[_0x95e3('0x41')](handleError(_0x19f14c,null));};exports['show']=function(_0x3cdc4f,_0x77e80d){var _0x15394e={'raw':![],'where':{'id':_0x3cdc4f[_0x95e3('0x42')]['id']}},_0xd9599f={};_0xd9599f['model']=_[_0x95e3('0x2f')](db[_0x95e3('0x28')][_0x95e3('0x29')]);_0xd9599f['query']=_['keys'](_0x3cdc4f[_0x95e3('0x2e')]);_0xd9599f[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0xd9599f[_0x95e3('0x2c')],_0xd9599f[_0x95e3('0x2e')]);_0x15394e[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0xd9599f[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x3cdc4f[_0x95e3('0x2e')]['fields']));_0x15394e[_0x95e3('0x32')]=_0x15394e[_0x95e3('0x32')][_0x95e3('0x34')]?_0x15394e['attributes']:_0xd9599f[_0x95e3('0x2c')];if(_0x3cdc4f[_0x95e3('0x2e')]['includeAll']){_0x15394e[_0x95e3('0x3e')]=[{'all':!![]}];}_0x15394e=_[_0x95e3('0x39')]({},_0x15394e,_0x3cdc4f[_0x95e3('0x3c')]);return db['DeskAccount']['find'](_0x15394e)['then'](handleEntityNotFound(_0x77e80d,null))[_0x95e3('0x21')](respondWithResult(_0x77e80d,null))[_0x95e3('0x41')](handleError(_0x77e80d,null));};exports['create']=function(_0x5379bb,_0x2f2fc0){return db[_0x95e3('0x28')][_0x95e3('0x43')](_0x5379bb[_0x95e3('0x44')],{})['then'](respondWithResult(_0x2f2fc0,0xc9))['catch'](handleError(_0x2f2fc0,null));};exports[_0x95e3('0x20')]=function(_0x2942a1,_0x4523fa){if(_0x2942a1[_0x95e3('0x44')]['id']){delete _0x2942a1[_0x95e3('0x44')]['id'];}return db[_0x95e3('0x28')][_0x95e3('0x45')]({'where':{'id':_0x2942a1['params']['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x4523fa,null))[_0x95e3('0x21')](saveUpdates(_0x2942a1['body'],null))[_0x95e3('0x21')](respondWithResult(_0x4523fa,null))[_0x95e3('0x41')](handleError(_0x4523fa,null));};exports[_0x95e3('0x22')]=function(_0x5a160d,_0x249588){return db['DeskAccount'][_0x95e3('0x45')]({'where':{'id':_0x5a160d[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x249588,null))['then'](removeEntity(_0x249588,null))[_0x95e3('0x41')](handleError(_0x249588,null));};exports[_0x95e3('0x46')]=function(_0x1822ae,_0x39428c,_0x23e667){var _0x3513c5={};var _0x2be2fa={};var _0x4a724e;var _0x11c15f;return db['DeskAccount'][_0x95e3('0x47')]({'where':{'id':_0x1822ae[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x39428c,null))['then'](function(_0x54ed72){if(_0x54ed72){_0x4a724e=_0x54ed72;_0x2be2fa[_0x95e3('0x2c')]=_[_0x95e3('0x2f')](db[_0x95e3('0x48')][_0x95e3('0x29')]);_0x2be2fa['query']=_[_0x95e3('0x2f')](_0x1822ae['query']);_0x2be2fa[_0x95e3('0x30')]=_['intersection'](_0x2be2fa[_0x95e3('0x2c')],_0x2be2fa['query']);_0x3513c5[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0x2be2fa[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x33')]));_0x3513c5[_0x95e3('0x32')]=_0x3513c5[_0x95e3('0x32')][_0x95e3('0x34')]?_0x3513c5['attributes']:_0x2be2fa[_0x95e3('0x2c')];_0x3513c5['order']=qs[_0x95e3('0x36')](_0x1822ae[_0x95e3('0x2e')]['sort']);_0x3513c5[_0x95e3('0x38')]=qs[_0x95e3('0x30')](_['pick'](_0x1822ae[_0x95e3('0x2e')],_0x2be2fa[_0x95e3('0x30')]));if(_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x37')]){_0x3513c5[_0x95e3('0x38')]=_[_0x95e3('0x39')](_0x3513c5[_0x95e3('0x38')],{'$or':_[_0x95e3('0x2d')](_0x3513c5[_0x95e3('0x32')],function(_0x4dd19e){var _0x1bea89={};_0x1bea89[_0x4dd19e]={'$like':'%'+_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x37')]+'%'};return _0x1bea89;})});}_0x3513c5=_[_0x95e3('0x39')]({},_0x3513c5,_0x1822ae[_0x95e3('0x3c')]);return _0x4a724e['getConfigurations'](_0x3513c5);}})[_0x95e3('0x21')](function(_0x48b41c){if(_0x48b41c){_0x11c15f=_0x48b41c[_0x95e3('0x34')];if(!_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x49')](_0x95e3('0x4a'))){_0x3513c5['limit']=qs['limit'](_0x1822ae[_0x95e3('0x2e')]['limit']);_0x3513c5[_0x95e3('0x19')]=qs[_0x95e3('0x19')](_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x19')]);}return _0x4a724e['getConfigurations'](_0x3513c5);}})[_0x95e3('0x21')](function(_0x2fe732){if(_0x2fe732){return _0x2fe732?{'count':_0x11c15f,'rows':_0x2fe732}:null;}})[_0x95e3('0x21')](respondWithResult(_0x39428c,null))[_0x95e3('0x41')](handleError(_0x39428c,null));};exports[_0x95e3('0x4b')]=function(_0x49f749,_0x569df3,_0x23aa89){if(_0x49f749[_0x95e3('0x44')]['id']){delete _0x49f749[_0x95e3('0x44')]['id'];}return db[_0x95e3('0x28')][_0x95e3('0x47')]({'where':{'id':_0x49f749[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x569df3,null))[_0x95e3('0x21')](function(_0x5d4ae8){if(_0x5d4ae8){_0x49f749[_0x95e3('0x44')][_0x95e3('0x4c')]=_0x5d4ae8['id'];_0x49f749[_0x95e3('0x44')][_0x95e3('0x4d')]=integrations[_0x95e3('0x4e')](_0x49f749[_0x95e3('0x44')]['channel'],_0x49f749['body'][_0x95e3('0x3a')]);_0x49f749['body']['Descriptions']=integrations['getDescriptions'](_0x49f749['body'][_0x95e3('0x4f')],_0x49f749[_0x95e3('0x44')][_0x95e3('0x3a')]);return db[_0x95e3('0x48')]['create'](_0x49f749[_0x95e3('0x44')],{'include':[{'model':db[_0x95e3('0x50')],'as':_0x95e3('0x4d')},{'model':db[_0x95e3('0x50')],'as':_0x95e3('0x51')}]});}return null;})[_0x95e3('0x21')](respondWithResult(_0x569df3,null))['catch'](handleError(_0x569df3,null));};exports[_0x95e3('0x52')]=function(_0xb6ec1e,_0x2e7b70,_0x31a161){var _0x12d55a=[{'name':'priority','label':_0x95e3('0x53'),'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 _0x29d693='';return db[_0x95e3('0x28')][_0x95e3('0x47')]({'where':{'id':_0xb6ec1e['params']['id']},'attributes':['id','remoteUri',_0x95e3('0x54'),_0x95e3('0x55'),'password',_0x95e3('0x56'),'consumerSecret',_0x95e3('0x57'),_0x95e3('0x58')]})['then'](handleEntityNotFound(_0x2e7b70,null))[_0x95e3('0x21')](function(_0x4640a8){if(_0x4640a8){_0x29d693=_0x4640a8['remoteUri'];var _0x1dc0c3=_0x29d693[_0x95e3('0x59')](-0x1);if(_0x1dc0c3==='/'){_0x29d693=_0x29d693[_0x95e3('0x5a')](0x0,_0x29d693['lastIndexOf'](_0x1dc0c3));}var _0x3a1e5d={'method':'GET','uri':util[_0x95e3('0x5b')]('%s/custom_fields',_0x29d693),'headers':{'Content-Type':_0x95e3('0x5c'),'Accept':'application/json'},'json':!![]};if(_0x4640a8['authType']===_0x95e3('0x5d')){_0x3a1e5d[_0x95e3('0x5e')][_0x95e3('0x5f')]=util['format'](_0x95e3('0x60'),new Buffer(util[_0x95e3('0x5b')](_0x95e3('0x61'),_0x4640a8[_0x95e3('0x55')],_0x4640a8[_0x95e3('0x62')]))[_0x95e3('0x63')](_0x95e3('0x64')));}return rp(_0x3a1e5d)['then'](function(_0x2b7e83){return _0x12d55a['concat'](_[_0x95e3('0x2d')](_0x2b7e83['_embedded'][_0x95e3('0x65')],function(_0x1bce67){return{'id':_0x1bce67['name'],'name':_0x1bce67[_0x95e3('0x25')],'type':_0x1bce67[_0x95e3('0x3a')],'active':_0x1bce67[_0x95e3('0x66')],'label':_0x1bce67[_0x95e3('0x67')],'custom':!![]};}));});}})[_0x95e3('0x21')](function(_0x46f7aa){return{'count':_0x46f7aa[_0x95e3('0x34')],'rows':_0x46f7aa};})[_0x95e3('0x21')](respondWithResult(_0x2e7b70,null))[_0x95e3('0x41')](function(_0x3d4fc0){var _0x236bde=_0xb6ec1e[_0x95e3('0x2e')]['test']?0x1f4:_0x3d4fc0[_0x95e3('0x68')]||0x1f4;logger[_0x95e3('0x23')](_0x95e3('0x69'),_0x95e3('0x52'),_0x236bde,JSON[_0x95e3('0x6a')](_0x3d4fc0));delete _0x3d4fc0[_0x95e3('0x25')];if(_0x236bde===0x191){_0x236bde=0x190;}_0x2e7b70[_0x95e3('0x17')](_0x236bde)['send'](_0xb6ec1e['query'][_0x95e3('0x6b')]?{'message':_0x95e3('0x6c'),'statusCode':_0x3d4fc0[_0x95e3('0x68')]}:_0x3d4fc0);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 6f6fdcd..d394ebe 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 _0x0531=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','util','../../config/logger','moment'];(function(_0x2b729a,_0x21945a){var _0x4a398d=function(_0x267019){while(--_0x267019){_0x2b729a['push'](_0x2b729a['shift']());}};_0x4a398d(++_0x21945a);}(_0x0531,0x141));var _0x1053=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x0531[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x1053('0x0'));var logger=require(_0x1053('0x1'))('api');var moment=require(_0x1053('0x2'));var BPromise=require(_0x1053('0x3'));var rp=require(_0x1053('0x4'));var fs=require('fs');var path=require(_0x1053('0x5'));var rimraf=require(_0x1053('0x6'));var config=require(_0x1053('0x7'));var attributes=require(_0x1053('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1053('0x9')]=function(_0xeac4dd,_0x2309d4){return _0xeac4dd[_0x1053('0xa')]('DeskAccount',attributes,{'tableName':_0x1053('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dd0=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x3dd0,0xba));var _0x03dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3dd0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x03dd('0x0'));var logger=require(_0x03dd('0x1'))(_0x03dd('0x2'));var moment=require(_0x03dd('0x3'));var BPromise=require(_0x03dd('0x4'));var rp=require(_0x03dd('0x5'));var fs=require('fs');var path=require(_0x03dd('0x6'));var rimraf=require(_0x03dd('0x7'));var config=require('../../config/environment');var attributes=require(_0x03dd('0x8'));var integrations=require(_0x03dd('0x9'));module['exports']=function(_0x327a05,_0x5b4436){return _0x327a05[_0x03dd('0xa')](_0x03dd('0xb'),attributes,{'tableName':_0x03dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 1257ab5..9d75d91 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 _0x2987=['error','code','message','DeskAccount,\x20%s,\x20%s','catch','GetDeskAccount','DeskAccount','findAll','options','where','limit','include','map','model','attributes','then','find','raw','ShowDeskAccount','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x41a3dc,_0x14c6c8){var _0x5782bd=function(_0x4468ed){while(--_0x4468ed){_0x41a3dc['push'](_0x41a3dc['shift']());}};_0x5782bd(++_0x14c6c8);}(_0x2987,0x17e));var _0x7298=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0x2987[_0xf738ad];return _0x598570;};'use strict';var _=require('lodash');var util=require(_0x7298('0x0'));var moment=require(_0x7298('0x1'));var BPromise=require(_0x7298('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7298('0x3'))['db'];var utils=require(_0x7298('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7298('0x5'));var jayson=require(_0x7298('0x6'));var client=jayson['client'][_0x7298('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cb4c7,_0x1d6147,_0x363c92){return new BPromise(function(_0x2b3dc6,_0x2f002d){return client[_0x7298('0x8')](_0x4cb4c7,_0x363c92)['then'](function(_0x325a8a){logger[_0x7298('0x9')]('DeskAccount,\x20%s,\x20%s',_0x1d6147,_0x7298('0xa'));logger[_0x7298('0xb')](_0x7298('0xc'),_0x1d6147,_0x7298('0xa'),JSON[_0x7298('0xd')](_0x325a8a));if(_0x325a8a[_0x7298('0xe')]){if(_0x325a8a['error'][_0x7298('0xf')]===0x1f4){logger[_0x7298('0xe')]('DeskAccount,\x20%s,\x20%s',_0x1d6147,_0x325a8a[_0x7298('0xe')][_0x7298('0x10')]);return _0x2f002d(_0x325a8a['error'][_0x7298('0x10')]);}logger[_0x7298('0xe')](_0x7298('0x11'),_0x1d6147,_0x325a8a[_0x7298('0xe')]['message']);return _0x2b3dc6(_0x325a8a[_0x7298('0xe')][_0x7298('0x10')]);}else{logger[_0x7298('0x9')]('DeskAccount,\x20%s,\x20%s',_0x1d6147,_0x7298('0xa'));_0x2b3dc6(_0x325a8a['result'][_0x7298('0x10')]);}})[_0x7298('0x12')](function(_0x4974ef){logger[_0x7298('0xe')](_0x7298('0x11'),_0x1d6147,_0x4974ef);_0x2f002d(_0x4974ef);});});}exports[_0x7298('0x13')]=function(_0xdbb01d){var _0x1955a5=this;return new Promise(function(_0xe6c14e,_0x16d2db){return db[_0x7298('0x14')][_0x7298('0x15')]({'raw':_0xdbb01d[_0x7298('0x16')]?_0xdbb01d[_0x7298('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xdbb01d[_0x7298('0x16')]?_0xdbb01d[_0x7298('0x16')][_0x7298('0x17')]||null:null,'attributes':_0xdbb01d[_0x7298('0x16')]?_0xdbb01d[_0x7298('0x16')]['attributes']||null:null,'limit':_0xdbb01d['options']?_0xdbb01d[_0x7298('0x16')][_0x7298('0x18')]||null:null,'include':_0xdbb01d[_0x7298('0x16')]?_0xdbb01d['options'][_0x7298('0x19')]?_[_0x7298('0x1a')](_0xdbb01d[_0x7298('0x16')][_0x7298('0x19')],function(_0x21b3d7){return{'model':db[_0x21b3d7[_0x7298('0x1b')]],'as':_0x21b3d7['as'],'attributes':_0x21b3d7[_0x7298('0x1c')],'include':_0x21b3d7['include']?_[_0x7298('0x1a')](_0x21b3d7[_0x7298('0x19')],function(_0x4b34c6){return{'model':db[_0x4b34c6['model']],'as':_0x4b34c6['as'],'attributes':_0x4b34c6[_0x7298('0x1c')],'include':_0x4b34c6[_0x7298('0x19')]?_[_0x7298('0x1a')](_0x4b34c6[_0x7298('0x19')],function(_0x756f44){return{'model':db[_0x756f44[_0x7298('0x1b')]],'as':_0x756f44['as'],'attributes':_0x756f44[_0x7298('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7298('0x1d')](function(_0x20d57c){logger[_0x7298('0x9')](_0x7298('0x13'),_0xdbb01d);logger['debug'](_0x7298('0x13'),_0xdbb01d,JSON['stringify'](_0x20d57c));_0xe6c14e(_0x20d57c);})['catch'](function(_0x3abd39){logger[_0x7298('0xe')]('GetDeskAccount',_0x3abd39['message'],_0xdbb01d);_0x16d2db(_0x1955a5['error'](0x1f4,_0x3abd39[_0x7298('0x10')]));});});};exports['ShowDeskAccount']=function(_0x52110d){var _0x34d84b=this;return new Promise(function(_0x3dd63f,_0x70b72c){return db['DeskAccount'][_0x7298('0x1e')]({'raw':_0x52110d['options']?_0x52110d[_0x7298('0x16')][_0x7298('0x1f')]===undefined?!![]:![]:!![],'where':_0x52110d[_0x7298('0x16')]?_0x52110d[_0x7298('0x16')][_0x7298('0x17')]||null:null,'attributes':_0x52110d[_0x7298('0x16')]?_0x52110d[_0x7298('0x16')][_0x7298('0x1c')]||null:null,'include':_0x52110d[_0x7298('0x16')]?_0x52110d[_0x7298('0x16')]['include']?_['map'](_0x52110d[_0x7298('0x16')]['include'],function(_0x19bc5b){return{'model':db[_0x19bc5b[_0x7298('0x1b')]],'as':_0x19bc5b['as'],'attributes':_0x19bc5b[_0x7298('0x1c')],'include':_0x19bc5b[_0x7298('0x19')]?_[_0x7298('0x1a')](_0x19bc5b['include'],function(_0x200db8){return{'model':db[_0x200db8[_0x7298('0x1b')]],'as':_0x200db8['as'],'attributes':_0x200db8[_0x7298('0x1c')],'include':_0x200db8[_0x7298('0x19')]?_[_0x7298('0x1a')](_0x200db8['include'],function(_0x24ff5f){return{'model':db[_0x24ff5f['model']],'as':_0x24ff5f['as'],'attributes':_0x24ff5f[_0x7298('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7298('0x1d')](function(_0x3dd395){logger['info'](_0x7298('0x20'),_0x52110d);logger[_0x7298('0xb')](_0x7298('0x20'),_0x52110d,JSON[_0x7298('0xd')](_0x3dd395));_0x3dd63f(_0x3dd395);})[_0x7298('0x12')](function(_0x48e3e6){logger[_0x7298('0xe')](_0x7298('0x20'),_0x48e3e6[_0x7298('0x10')],_0x52110d);_0x70b72c(_0x34d84b[_0x7298('0xe')](0x1f4,_0x48e3e6[_0x7298('0x10')]));});});}; \ No newline at end of file +var _0x9ddf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','attributes','include','map','model','GetDeskAccount','debug','stringify','ShowDeskAccount','DeskAccount','find'];(function(_0x4faa8d,_0x17a00a){var _0xcee355=function(_0x4c56b9){while(--_0x4c56b9){_0x4faa8d['push'](_0x4faa8d['shift']());}};_0xcee355(++_0x17a00a);}(_0x9ddf,0x88));var _0xf9dd=function(_0x4c7c25,_0x1e16a8){_0x4c7c25=_0x4c7c25-0x0;var _0x297619=_0x9ddf[_0x4c7c25];return _0x297619;};'use strict';var _=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var moment=require(_0xf9dd('0x2'));var BPromise=require(_0xf9dd('0x3'));var rs=require(_0xf9dd('0x4'));var fs=require('fs');var Redis=require(_0xf9dd('0x5'));var db=require(_0xf9dd('0x6'))['db'];var utils=require(_0xf9dd('0x7'));var logger=require('../../config/logger')(_0xf9dd('0x8'));var config=require(_0xf9dd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf9dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24eda4,_0x4187b6,_0x1407d5){return new BPromise(function(_0x39d52e,_0x4a7e11){return client[_0xf9dd('0xb')](_0x24eda4,_0x1407d5)[_0xf9dd('0xc')](function(_0x2bbd23){logger[_0xf9dd('0xd')](_0xf9dd('0xe'),_0x4187b6,_0xf9dd('0xf'));logger['debug'](_0xf9dd('0x10'),_0x4187b6,_0xf9dd('0xf'),JSON['stringify'](_0x2bbd23));if(_0x2bbd23[_0xf9dd('0x11')]){if(_0x2bbd23['error'][_0xf9dd('0x12')]===0x1f4){logger[_0xf9dd('0x11')](_0xf9dd('0xe'),_0x4187b6,_0x2bbd23[_0xf9dd('0x11')]['message']);return _0x4a7e11(_0x2bbd23['error'][_0xf9dd('0x13')]);}logger['error'](_0xf9dd('0xe'),_0x4187b6,_0x2bbd23['error'][_0xf9dd('0x13')]);return _0x39d52e(_0x2bbd23[_0xf9dd('0x11')][_0xf9dd('0x13')]);}else{logger[_0xf9dd('0xd')](_0xf9dd('0xe'),_0x4187b6,_0xf9dd('0xf'));_0x39d52e(_0x2bbd23[_0xf9dd('0x14')]['message']);}})[_0xf9dd('0x15')](function(_0x500586){logger[_0xf9dd('0x11')](_0xf9dd('0xe'),_0x4187b6,_0x500586);_0x4a7e11(_0x500586);});});}exports['GetDeskAccount']=function(_0x3d6de9){var _0x4ec988=this;return new Promise(function(_0xa3f838,_0x23404a){return db['DeskAccount']['findAll']({'raw':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x17')]===undefined?!![]:![]:!![],'where':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')]['where']||null:null,'attributes':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9['options'][_0xf9dd('0x18')]||null:null,'limit':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')]['limit']||null:null,'include':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x19')],function(_0x251655){return{'model':db[_0x251655['model']],'as':_0x251655['as'],'attributes':_0x251655[_0xf9dd('0x18')],'include':_0x251655[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x251655['include'],function(_0x31ad04){return{'model':db[_0x31ad04[_0xf9dd('0x1b')]],'as':_0x31ad04['as'],'attributes':_0x31ad04['attributes'],'include':_0x31ad04[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x31ad04[_0xf9dd('0x19')],function(_0x1159fd){return{'model':db[_0x1159fd[_0xf9dd('0x1b')]],'as':_0x1159fd['as'],'attributes':_0x1159fd[_0xf9dd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf9dd('0xc')](function(_0x39d576){logger[_0xf9dd('0xd')](_0xf9dd('0x1c'),_0x3d6de9);logger[_0xf9dd('0x1d')]('GetDeskAccount',_0x3d6de9,JSON[_0xf9dd('0x1e')](_0x39d576));_0xa3f838(_0x39d576);})[_0xf9dd('0x15')](function(_0x1a8d85){logger['error']('GetDeskAccount',_0x1a8d85[_0xf9dd('0x13')],_0x3d6de9);_0x23404a(_0x4ec988['error'](0x1f4,_0x1a8d85[_0xf9dd('0x13')]));});});};exports[_0xf9dd('0x1f')]=function(_0xcb2ad9){var _0x3cf581=this;return new Promise(function(_0x11c9af,_0x369779){return db[_0xf9dd('0x20')][_0xf9dd('0x21')]({'raw':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9[_0xf9dd('0x16')][_0xf9dd('0x17')]===undefined?!![]:![]:!![],'where':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9[_0xf9dd('0x16')]['where']||null:null,'attributes':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9['options'][_0xf9dd('0x18')]||null:null,'include':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9['options'][_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0xcb2ad9[_0xf9dd('0x16')][_0xf9dd('0x19')],function(_0x10a7b8){return{'model':db[_0x10a7b8[_0xf9dd('0x1b')]],'as':_0x10a7b8['as'],'attributes':_0x10a7b8[_0xf9dd('0x18')],'include':_0x10a7b8[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x10a7b8[_0xf9dd('0x19')],function(_0x4702ad){return{'model':db[_0x4702ad[_0xf9dd('0x1b')]],'as':_0x4702ad['as'],'attributes':_0x4702ad['attributes'],'include':_0x4702ad[_0xf9dd('0x19')]?_['map'](_0x4702ad[_0xf9dd('0x19')],function(_0x5f5697){return{'model':db[_0x5f5697[_0xf9dd('0x1b')]],'as':_0x5f5697['as'],'attributes':_0x5f5697[_0xf9dd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf9dd('0xc')](function(_0x40597f){logger[_0xf9dd('0xd')](_0xf9dd('0x1f'),_0xcb2ad9);logger[_0xf9dd('0x1d')](_0xf9dd('0x1f'),_0xcb2ad9,JSON[_0xf9dd('0x1e')](_0x40597f));_0x11c9af(_0x40597f);})[_0xf9dd('0x15')](function(_0x5b2f68){logger[_0xf9dd('0x11')]('ShowDeskAccount',_0x5b2f68[_0xf9dd('0x13')],_0xcb2ad9);_0x369779(_0x3cf581[_0xf9dd('0x11')](0x1f4,_0x5b2f68[_0xf9dd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5695c75..84a74f7 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x28a61c,_0x265fec){var _0x3fef39=function(_0x28f43b){while(--_0x28f43b){_0x28a61c['push'](_0x28a61c['shift']());}};_0x3fef39(++_0x265fec);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d0117,_0x4921e5){_0x3d0117=_0x3d0117-0x0;var _0x47fd73=_0xedd9[_0x3d0117];return _0x47fd73;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1506a3,_0x158ba3){var _0x14383f=function(_0x371b9f){while(--_0x371b9f){_0x1506a3['push'](_0x1506a3['shift']());}};_0x14383f(++_0x158ba3);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9f0ec7b..8e7c08d 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 _0x9622=['sequelize','exports','STRING'];(function(_0x257896,_0x8de612){var _0x1ff242=function(_0x8ea06a){while(--_0x8ea06a){_0x257896['push'](_0x257896['shift']());}};_0x1ff242(++_0x8de612);}(_0x9622,0xba));var _0x2962=function(_0x16bc1b,_0x33a54e){_0x16bc1b=_0x16bc1b-0x0;var _0x5cd224=_0x9622[_0x16bc1b];return _0x5cd224;};'use strict';var Sequelize=require(_0x2962('0x0'));module[_0x2962('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2962('0x2')]}}; \ No newline at end of file +var _0x8ca1=['sequelize','exports','STRING'];(function(_0x35fe37,_0x58895d){var _0x547bb1=function(_0x539676){while(--_0x539676){_0x35fe37['push'](_0x35fe37['shift']());}};_0x547bb1(++_0x58895d);}(_0x8ca1,0x195));var _0x18ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8ca1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x18ca('0x0'));module[_0x18ca('0x1')]={'name':{'type':Sequelize[_0x18ca('0x2')]},'description':{'type':Sequelize[_0x18ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 87c418d..deebc61 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 _0x5b5b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','merge','type','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','show','params','keys','intersection','create','catch','body','find','getFields','findOne','DeskField','order','sort','filter','getSubjects','pick','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse'];(function(_0x148427,_0xeb87db){var _0x501c9d=function(_0xf07181){while(--_0xf07181){_0x148427['push'](_0x148427['shift']());}};_0x501c9d(++_0xeb87db);}(_0x5b5b,0x14c));var _0xb5b5=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x5b5b[_0x3bb5b4];return _0x586c60;};'use strict';var emlformat=require(_0xb5b5('0x0'));var rimraf=require(_0xb5b5('0x1'));var zipdir=require(_0xb5b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5b5('0x3'));var moment=require(_0xb5b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb5b5('0x5'));var util=require(_0xb5b5('0x6'));var path=require(_0xb5b5('0x7'));var sox=require(_0xb5b5('0x8'));var csv=require(_0xb5b5('0x9'));var ejs=require(_0xb5b5('0xa'));var fs=require('fs');var fs_extra=require(_0xb5b5('0xb'));var _=require('lodash');var squel=require(_0xb5b5('0xc'));var crypto=require('crypto');var jsforce=require(_0xb5b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb5b5('0x9'));var querystring=require(_0xb5b5('0xe'));var Papa=require(_0xb5b5('0xf'));var Redis=require(_0xb5b5('0x10'));var authService=require(_0xb5b5('0x11'));var qs=require(_0xb5b5('0x12'));var as=require(_0xb5b5('0x13'));var hardwareService=require(_0xb5b5('0x14'));var logger=require(_0xb5b5('0x15'))(_0xb5b5('0x16'));var utils=require(_0xb5b5('0x17'));var config=require(_0xb5b5('0x18'));var licenseUtil=require(_0xb5b5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337953,_0x160bac){_0x160bac=_0x160bac||0xcc;return function(_0x23ec2e){if(_0x23ec2e){return _0x337953[_0xb5b5('0x1a')](_0x160bac);}return _0x337953[_0xb5b5('0x1b')](_0x160bac)['end']();};}function respondWithResult(_0x36a88c,_0x1e9b24){_0x1e9b24=_0x1e9b24||0xc8;return function(_0x22e9c5){if(_0x22e9c5){return _0x36a88c['status'](_0x1e9b24)['json'](_0x22e9c5);}};}function respondWithFilteredResult(_0x509bd6,_0x24f05f){return function(_0xc5fb54){if(_0xc5fb54){var _0x5a62d8=typeof _0x24f05f['offset']==='undefined'&&typeof _0x24f05f[_0xb5b5('0x1c')]===_0xb5b5('0x1d');var _0x162b4a=_0xc5fb54[_0xb5b5('0x1e')];var _0x2e854c=_0x5a62d8?0x0:_0x24f05f[_0xb5b5('0x1f')];var _0x38dc8b=_0x5a62d8?_0xc5fb54['count']:_0x24f05f[_0xb5b5('0x1f')]+_0x24f05f[_0xb5b5('0x1c')];var _0xbd0d3b;if(_0x38dc8b>=_0x162b4a){_0x38dc8b=_0x162b4a;_0xbd0d3b=0xc8;}else{_0xbd0d3b=0xce;}_0x509bd6[_0xb5b5('0x1b')](_0xbd0d3b);return _0x509bd6[_0xb5b5('0x20')](_0xb5b5('0x21'),_0x2e854c+'-'+_0x38dc8b+'/'+_0x162b4a)[_0xb5b5('0x22')](_0xc5fb54);}return null;};}function patchUpdates(_0x170a8f){return function(_0x18a749){try{jsonpatch[_0xb5b5('0x23')](_0x18a749,_0x170a8f,!![]);}catch(_0x37f1c8){return BPromise[_0xb5b5('0x24')](_0x37f1c8);}return _0x18a749[_0xb5b5('0x25')]();};}function saveUpdates(_0x2616e6,_0x202e80){return function(_0x50b58c){if(_0x50b58c){return _0x50b58c[_0xb5b5('0x26')](_0x2616e6)[_0xb5b5('0x27')](function(_0x1f61a9){return _0x1f61a9;});}return null;};}function removeEntity(_0x5aa09a,_0x440d4a){return function(_0x232e81){if(_0x232e81){return _0x232e81['destroy']()[_0xb5b5('0x27')](function(){_0x5aa09a[_0xb5b5('0x1b')](0xcc)[_0xb5b5('0x28')]();});}};}function handleEntityNotFound(_0x3f3c3a,_0x57e1b4){return function(_0x162653){if(!_0x162653){_0x3f3c3a[_0xb5b5('0x1a')](0x194);}return _0x162653;};}function handleError(_0x549289,_0x3ae791){_0x3ae791=_0x3ae791||0x1f4;return function(_0x49151a){logger[_0xb5b5('0x29')](_0x49151a[_0xb5b5('0x2a')]);if(_0x49151a['name']){delete _0x49151a[_0xb5b5('0x2b')];}_0x549289[_0xb5b5('0x1b')](_0x3ae791)[_0xb5b5('0x2c')](_0x49151a);};}exports['index']=function(_0x4e55f4,_0x5e2025){var _0x30d5bb={},_0x72df52={},_0x3d000e={'count':0x0,'rows':[]};var _0x29c4d3=_[_0xb5b5('0x2d')](db['DeskConfiguration'][_0xb5b5('0x2e')],function(_0x3eaa1e){return{'name':_0x3eaa1e[_0xb5b5('0x2f')],'type':_0x3eaa1e['type'][_0xb5b5('0x30')]};});_0x72df52['model']=_[_0xb5b5('0x2d')](_0x29c4d3,'name');_0x72df52[_0xb5b5('0x31')]=_['keys'](_0x4e55f4[_0xb5b5('0x31')]);_0x72df52[_0xb5b5('0x32')]=_['intersection'](_0x72df52[_0xb5b5('0x33')],_0x72df52[_0xb5b5('0x31')]);_0x30d5bb[_0xb5b5('0x34')]=_['intersection'](_0x72df52[_0xb5b5('0x33')],qs[_0xb5b5('0x35')](_0x4e55f4[_0xb5b5('0x31')]['fields']));_0x30d5bb[_0xb5b5('0x34')]=_0x30d5bb[_0xb5b5('0x34')][_0xb5b5('0x36')]?_0x30d5bb['attributes']:_0x72df52[_0xb5b5('0x33')];if(!_0x4e55f4[_0xb5b5('0x31')][_0xb5b5('0x37')](_0xb5b5('0x38'))){_0x30d5bb[_0xb5b5('0x1c')]=qs[_0xb5b5('0x1c')](_0x4e55f4[_0xb5b5('0x31')][_0xb5b5('0x1c')]);_0x30d5bb[_0xb5b5('0x1f')]=qs[_0xb5b5('0x1f')](_0x4e55f4[_0xb5b5('0x31')]['offset']);}_0x30d5bb['order']=qs['sort'](_0x4e55f4['query']['sort']);_0x30d5bb[_0xb5b5('0x39')]=qs[_0xb5b5('0x32')](_['pick'](_0x4e55f4[_0xb5b5('0x31')],_0x72df52[_0xb5b5('0x32')]),_0x29c4d3);if(_0x4e55f4[_0xb5b5('0x31')]['filter']){_0x30d5bb[_0xb5b5('0x39')]=_[_0xb5b5('0x3a')](_0x30d5bb[_0xb5b5('0x39')],{'$or':_[_0xb5b5('0x2d')](_0x29c4d3,function(_0x14ece5){if(_0x14ece5[_0xb5b5('0x3b')]!==_0xb5b5('0x3c')){var _0x2c8007={};_0x2c8007[_0x14ece5[_0xb5b5('0x2b')]]={'$like':'%'+_0x4e55f4[_0xb5b5('0x31')]['filter']+'%'};return _0x2c8007;}})});}_0x30d5bb=_[_0xb5b5('0x3a')]({},_0x30d5bb,_0x4e55f4[_0xb5b5('0x3d')]);var _0x2bff22={'where':_0x30d5bb[_0xb5b5('0x39')]};return db[_0xb5b5('0x3e')]['count'](_0x2bff22)['then'](function(_0x4221ca){_0x3d000e['count']=_0x4221ca;if(_0x4e55f4[_0xb5b5('0x31')][_0xb5b5('0x3f')]){_0x30d5bb[_0xb5b5('0x40')]=[{'all':!![]}];}return db[_0xb5b5('0x3e')][_0xb5b5('0x41')](_0x30d5bb);})[_0xb5b5('0x27')](function(_0x129dbd){_0x3d000e[_0xb5b5('0x42')]=_0x129dbd;return _0x3d000e;})[_0xb5b5('0x27')](respondWithFilteredResult(_0x5e2025,_0x30d5bb))['catch'](handleError(_0x5e2025,null));};exports[_0xb5b5('0x43')]=function(_0x19654d,_0x542ab0){var _0x597104={'raw':![],'where':{'id':_0x19654d[_0xb5b5('0x44')]['id']}},_0x5f5844={};_0x5f5844[_0xb5b5('0x33')]=_[_0xb5b5('0x45')](db[_0xb5b5('0x3e')][_0xb5b5('0x2e')]);_0x5f5844[_0xb5b5('0x31')]=_['keys'](_0x19654d[_0xb5b5('0x31')]);_0x5f5844[_0xb5b5('0x32')]=_[_0xb5b5('0x46')](_0x5f5844[_0xb5b5('0x33')],_0x5f5844['query']);_0x597104[_0xb5b5('0x34')]=_[_0xb5b5('0x46')](_0x5f5844[_0xb5b5('0x33')],qs[_0xb5b5('0x35')](_0x19654d[_0xb5b5('0x31')][_0xb5b5('0x35')]));_0x597104[_0xb5b5('0x34')]=_0x597104[_0xb5b5('0x34')][_0xb5b5('0x36')]?_0x597104[_0xb5b5('0x34')]:_0x5f5844[_0xb5b5('0x33')];if(_0x19654d['query']['includeAll']){_0x597104['include']=[{'all':!![]}];}_0x597104=_['merge']({},_0x597104,_0x19654d[_0xb5b5('0x3d')]);return db['DeskConfiguration']['find'](_0x597104)['then'](handleEntityNotFound(_0x542ab0,null))[_0xb5b5('0x27')](respondWithResult(_0x542ab0,null))['catch'](handleError(_0x542ab0,null));};exports[_0xb5b5('0x47')]=function(_0x58f52b,_0x18d0e5){return db['DeskConfiguration']['create'](_0x58f52b['body'],{})[_0xb5b5('0x27')](respondWithResult(_0x18d0e5,0xc9))[_0xb5b5('0x48')](handleError(_0x18d0e5,null));};exports[_0xb5b5('0x26')]=function(_0x1df9b7,_0x2a4da2){if(_0x1df9b7[_0xb5b5('0x49')]['id']){delete _0x1df9b7[_0xb5b5('0x49')]['id'];}return db[_0xb5b5('0x3e')][_0xb5b5('0x4a')]({'where':{'id':_0x1df9b7[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x2a4da2,null))[_0xb5b5('0x27')](saveUpdates(_0x1df9b7[_0xb5b5('0x49')],null))['then'](respondWithResult(_0x2a4da2,null))[_0xb5b5('0x48')](handleError(_0x2a4da2,null));};exports['destroy']=function(_0x50e5cb,_0x2bb0cb){return db['DeskConfiguration'][_0xb5b5('0x4a')]({'where':{'id':_0x50e5cb[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x2bb0cb,null))[_0xb5b5('0x27')](removeEntity(_0x2bb0cb,null))[_0xb5b5('0x48')](handleError(_0x2bb0cb,null));};exports[_0xb5b5('0x4b')]=function(_0x47f438,_0x1597d8,_0x2aeae4){var _0x4d694f={};var _0x4642e6={};var _0x2a1e47;var _0x4b990d;return db[_0xb5b5('0x3e')][_0xb5b5('0x4c')]({'where':{'id':_0x47f438['params']['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x1597d8,null))[_0xb5b5('0x27')](function(_0x1bd3b9){if(_0x1bd3b9){_0x2a1e47=_0x1bd3b9;_0x4642e6[_0xb5b5('0x33')]=_[_0xb5b5('0x45')](db[_0xb5b5('0x4d')][_0xb5b5('0x2e')]);_0x4642e6[_0xb5b5('0x31')]=_[_0xb5b5('0x45')](_0x47f438[_0xb5b5('0x31')]);_0x4642e6[_0xb5b5('0x32')]=_[_0xb5b5('0x46')](_0x4642e6[_0xb5b5('0x33')],_0x4642e6[_0xb5b5('0x31')]);_0x4d694f[_0xb5b5('0x34')]=_[_0xb5b5('0x46')](_0x4642e6[_0xb5b5('0x33')],qs[_0xb5b5('0x35')](_0x47f438['query'][_0xb5b5('0x35')]));_0x4d694f[_0xb5b5('0x34')]=_0x4d694f[_0xb5b5('0x34')][_0xb5b5('0x36')]?_0x4d694f[_0xb5b5('0x34')]:_0x4642e6[_0xb5b5('0x33')];_0x4d694f[_0xb5b5('0x4e')]=qs['sort'](_0x47f438[_0xb5b5('0x31')][_0xb5b5('0x4f')]);_0x4d694f[_0xb5b5('0x39')]=qs['filters'](_['pick'](_0x47f438[_0xb5b5('0x31')],_0x4642e6[_0xb5b5('0x32')]));if(_0x47f438[_0xb5b5('0x31')][_0xb5b5('0x50')]){_0x4d694f[_0xb5b5('0x39')]=_[_0xb5b5('0x3a')](_0x4d694f['where'],{'$or':_[_0xb5b5('0x2d')](_0x4d694f[_0xb5b5('0x34')],function(_0x30b4a9){var _0x5edd21={};_0x5edd21[_0x30b4a9]={'$like':'%'+_0x47f438[_0xb5b5('0x31')][_0xb5b5('0x50')]+'%'};return _0x5edd21;})});}_0x4d694f=_[_0xb5b5('0x3a')]({},_0x4d694f,_0x47f438[_0xb5b5('0x3d')]);return _0x2a1e47[_0xb5b5('0x4b')](_0x4d694f);}})[_0xb5b5('0x27')](function(_0x301c5a){if(_0x301c5a){_0x4b990d=_0x301c5a[_0xb5b5('0x36')];if(!_0x47f438['query']['hasOwnProperty'](_0xb5b5('0x38'))){_0x4d694f[_0xb5b5('0x1c')]=qs[_0xb5b5('0x1c')](_0x47f438[_0xb5b5('0x31')]['limit']);_0x4d694f[_0xb5b5('0x1f')]=qs[_0xb5b5('0x1f')](_0x47f438[_0xb5b5('0x31')]['offset']);}return _0x2a1e47[_0xb5b5('0x4b')](_0x4d694f);}})[_0xb5b5('0x27')](function(_0xc9e494){if(_0xc9e494){return _0xc9e494?{'count':_0x4b990d,'rows':_0xc9e494}:null;}})['then'](respondWithResult(_0x1597d8,null))['catch'](handleError(_0x1597d8,null));};exports[_0xb5b5('0x51')]=function(_0x233cd5,_0x3783b4,_0x1afb01){var _0x13c7c4={};var _0x17edad={};var _0x4bbbbd;var _0x4ab36a;return db[_0xb5b5('0x3e')][_0xb5b5('0x4c')]({'where':{'id':_0x233cd5[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x3783b4,null))[_0xb5b5('0x27')](function(_0x185b92){if(_0x185b92){_0x4bbbbd=_0x185b92;_0x17edad[_0xb5b5('0x33')]=_[_0xb5b5('0x45')](db['DeskField'][_0xb5b5('0x2e')]);_0x17edad[_0xb5b5('0x31')]=_[_0xb5b5('0x45')](_0x233cd5['query']);_0x17edad['filters']=_['intersection'](_0x17edad[_0xb5b5('0x33')],_0x17edad[_0xb5b5('0x31')]);_0x13c7c4[_0xb5b5('0x34')]=_[_0xb5b5('0x46')](_0x17edad['model'],qs['fields'](_0x233cd5[_0xb5b5('0x31')][_0xb5b5('0x35')]));_0x13c7c4[_0xb5b5('0x34')]=_0x13c7c4['attributes'][_0xb5b5('0x36')]?_0x13c7c4[_0xb5b5('0x34')]:_0x17edad['model'];_0x13c7c4[_0xb5b5('0x4e')]=qs[_0xb5b5('0x4f')](_0x233cd5[_0xb5b5('0x31')][_0xb5b5('0x4f')]);_0x13c7c4[_0xb5b5('0x39')]=qs[_0xb5b5('0x32')](_[_0xb5b5('0x52')](_0x233cd5[_0xb5b5('0x31')],_0x17edad[_0xb5b5('0x32')]));if(_0x233cd5['query'][_0xb5b5('0x50')]){_0x13c7c4[_0xb5b5('0x39')]=_['merge'](_0x13c7c4[_0xb5b5('0x39')],{'$or':_[_0xb5b5('0x2d')](_0x13c7c4[_0xb5b5('0x34')],function(_0x384ee0){var _0x4caae={};_0x4caae[_0x384ee0]={'$like':'%'+_0x233cd5[_0xb5b5('0x31')][_0xb5b5('0x50')]+'%'};return _0x4caae;})});}_0x13c7c4=_[_0xb5b5('0x3a')]({},_0x13c7c4,_0x233cd5[_0xb5b5('0x3d')]);return _0x4bbbbd[_0xb5b5('0x51')](_0x13c7c4);}})[_0xb5b5('0x27')](function(_0xad4357){if(_0xad4357){_0x4ab36a=_0xad4357['length'];if(!_0x233cd5[_0xb5b5('0x31')][_0xb5b5('0x37')](_0xb5b5('0x38'))){_0x13c7c4[_0xb5b5('0x1c')]=qs[_0xb5b5('0x1c')](_0x233cd5[_0xb5b5('0x31')]['limit']);_0x13c7c4[_0xb5b5('0x1f')]=qs[_0xb5b5('0x1f')](_0x233cd5[_0xb5b5('0x31')]['offset']);}return _0x4bbbbd[_0xb5b5('0x51')](_0x13c7c4);}})['then'](function(_0x4ee9b1){if(_0x4ee9b1){return _0x4ee9b1?{'count':_0x4ab36a,'rows':_0x4ee9b1}:null;}})['then'](respondWithResult(_0x3783b4,null))[_0xb5b5('0x48')](handleError(_0x3783b4,null));};exports[_0xb5b5('0x53')]=function(_0x321d9f,_0x24fa10,_0x13e3ae){var _0xba7bef={};var _0x2284cf={};var _0x562ecc;var _0x4e74d4;return db[_0xb5b5('0x3e')][_0xb5b5('0x4c')]({'where':{'id':_0x321d9f[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x24fa10,null))[_0xb5b5('0x27')](function(_0x8fc761){if(_0x8fc761){_0x562ecc=_0x8fc761;_0x2284cf['model']=_[_0xb5b5('0x45')](db[_0xb5b5('0x4d')][_0xb5b5('0x2e')]);_0x2284cf[_0xb5b5('0x31')]=_[_0xb5b5('0x45')](_0x321d9f[_0xb5b5('0x31')]);_0x2284cf[_0xb5b5('0x32')]=_[_0xb5b5('0x46')](_0x2284cf['model'],_0x2284cf[_0xb5b5('0x31')]);_0xba7bef[_0xb5b5('0x34')]=_[_0xb5b5('0x46')](_0x2284cf[_0xb5b5('0x33')],qs[_0xb5b5('0x35')](_0x321d9f[_0xb5b5('0x31')]['fields']));_0xba7bef['attributes']=_0xba7bef[_0xb5b5('0x34')][_0xb5b5('0x36')]?_0xba7bef[_0xb5b5('0x34')]:_0x2284cf['model'];_0xba7bef['order']=qs[_0xb5b5('0x4f')](_0x321d9f[_0xb5b5('0x31')][_0xb5b5('0x4f')]);_0xba7bef[_0xb5b5('0x39')]=qs[_0xb5b5('0x32')](_[_0xb5b5('0x52')](_0x321d9f['query'],_0x2284cf[_0xb5b5('0x32')]));if(_0x321d9f['query'][_0xb5b5('0x50')]){_0xba7bef[_0xb5b5('0x39')]=_[_0xb5b5('0x3a')](_0xba7bef['where'],{'$or':_[_0xb5b5('0x2d')](_0xba7bef[_0xb5b5('0x34')],function(_0x53420f){var _0x169cd1={};_0x169cd1[_0x53420f]={'$like':'%'+_0x321d9f[_0xb5b5('0x31')][_0xb5b5('0x50')]+'%'};return _0x169cd1;})});}_0xba7bef=_['merge']({},_0xba7bef,_0x321d9f['options']);return _0x562ecc[_0xb5b5('0x53')](_0xba7bef);}})['then'](function(_0x3c5413){if(_0x3c5413){_0x4e74d4=_0x3c5413[_0xb5b5('0x36')];if(!_0x321d9f[_0xb5b5('0x31')][_0xb5b5('0x37')](_0xb5b5('0x38'))){_0xba7bef[_0xb5b5('0x1c')]=qs[_0xb5b5('0x1c')](_0x321d9f['query'][_0xb5b5('0x1c')]);_0xba7bef['offset']=qs[_0xb5b5('0x1f')](_0x321d9f[_0xb5b5('0x31')][_0xb5b5('0x1f')]);}return _0x562ecc[_0xb5b5('0x53')](_0xba7bef);}})[_0xb5b5('0x27')](function(_0x43eb74){if(_0x43eb74){return _0x43eb74?{'count':_0x4e74d4,'rows':_0x43eb74}:null;}})[_0xb5b5('0x27')](respondWithResult(_0x24fa10,null))[_0xb5b5('0x48')](handleError(_0x24fa10,null));};exports['getTags']=function(_0x1bebf5,_0x51a861,_0x1bb4b4){var _0x5d45ae={};var _0x91ce83={};var _0x3b071e;var _0x104c11;return db['DeskConfiguration'][_0xb5b5('0x4c')]({'where':{'id':_0x1bebf5[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x51a861,null))[_0xb5b5('0x27')](function(_0x164fa7){if(_0x164fa7){_0x3b071e=_0x164fa7;_0x91ce83['model']=_[_0xb5b5('0x45')](db['Tag'][_0xb5b5('0x2e')]);_0x91ce83[_0xb5b5('0x31')]=_['keys'](_0x1bebf5['query']);_0x91ce83[_0xb5b5('0x32')]=_[_0xb5b5('0x46')](_0x91ce83[_0xb5b5('0x33')],_0x91ce83[_0xb5b5('0x31')]);_0x5d45ae['attributes']=_[_0xb5b5('0x46')](_0x91ce83[_0xb5b5('0x33')],qs[_0xb5b5('0x35')](_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x35')]));_0x5d45ae[_0xb5b5('0x34')]=_0x5d45ae['attributes'][_0xb5b5('0x36')]?_0x5d45ae[_0xb5b5('0x34')]:_0x91ce83['model'];_0x5d45ae[_0xb5b5('0x4e')]=qs[_0xb5b5('0x4f')](_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x4f')]);_0x5d45ae[_0xb5b5('0x39')]=qs[_0xb5b5('0x32')](_[_0xb5b5('0x52')](_0x1bebf5[_0xb5b5('0x31')],_0x91ce83['filters']));if(_0x1bebf5[_0xb5b5('0x31')]['filter']){_0x5d45ae[_0xb5b5('0x39')]=_['merge'](_0x5d45ae[_0xb5b5('0x39')],{'$or':_[_0xb5b5('0x2d')](_0x5d45ae[_0xb5b5('0x34')],function(_0x378d82){var _0x3ed147={};_0x3ed147[_0x378d82]={'$like':'%'+_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x50')]+'%'};return _0x3ed147;})});}_0x5d45ae=_[_0xb5b5('0x3a')]({},_0x5d45ae,_0x1bebf5['options']);return _0x3b071e[_0xb5b5('0x54')](_0x5d45ae);}})[_0xb5b5('0x27')](function(_0x1f36b5){if(_0x1f36b5){_0x104c11=_0x1f36b5[_0xb5b5('0x36')];if(!_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x37')]('nolimit')){_0x5d45ae[_0xb5b5('0x1c')]=qs[_0xb5b5('0x1c')](_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x1c')]);_0x5d45ae[_0xb5b5('0x1f')]=qs[_0xb5b5('0x1f')](_0x1bebf5[_0xb5b5('0x31')][_0xb5b5('0x1f')]);}return _0x3b071e[_0xb5b5('0x54')](_0x5d45ae);}})[_0xb5b5('0x27')](function(_0x15d057){if(_0x15d057){return _0x15d057?{'count':_0x104c11,'rows':_0x15d057}:null;}})[_0xb5b5('0x27')](respondWithResult(_0x51a861,null))[_0xb5b5('0x48')](handleError(_0x51a861,null));};exports[_0xb5b5('0x55')]=function(_0xf08c7e,_0x166ab9,_0x584484){if(_0xf08c7e[_0xb5b5('0x49')]['id']){delete _0xf08c7e['body']['id'];}return db[_0xb5b5('0x3e')][_0xb5b5('0x4c')]({'where':{'id':_0xf08c7e[_0xb5b5('0x44')]['id']}})[_0xb5b5('0x27')](handleEntityNotFound(_0x166ab9,null))[_0xb5b5('0x27')](function(_0x4f17ed){if(_0x4f17ed){return _0x4f17ed[_0xb5b5('0x55')](_0xf08c7e[_0xb5b5('0x49')][_0xb5b5('0x56')]||[]);}return null;})['then'](respondWithResult(_0x166ab9,null))[_0xb5b5('0x48')](handleError(_0x166ab9,null));}; \ No newline at end of file +var _0xd1d3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','create','body','update','find','getFields','findOne','pick','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','DeskConfiguration','fieldName','model','query','keys','filters'];(function(_0x4e2a34,_0x4eb859){var _0x3166db=function(_0x3db497){while(--_0x3db497){_0x4e2a34['push'](_0x4e2a34['shift']());}};_0x3166db(++_0x4eb859);}(_0xd1d3,0x1c8));var _0x3d1d=function(_0x486445,_0x1bfe54){_0x486445=_0x486445-0x0;var _0x5313a6=_0xd1d3[_0x486445];return _0x5313a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d1d('0x0'));var zipdir=require(_0x3d1d('0x1'));var jsonpatch=require(_0x3d1d('0x2'));var rp=require(_0x3d1d('0x3'));var moment=require('moment');var BPromise=require(_0x3d1d('0x4'));var Mustache=require(_0x3d1d('0x5'));var util=require(_0x3d1d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3d1d('0x7'));var ejs=require(_0x3d1d('0x8'));var fs=require('fs');var fs_extra=require(_0x3d1d('0x9'));var _=require(_0x3d1d('0xa'));var squel=require(_0x3d1d('0xb'));var crypto=require(_0x3d1d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3d1d('0x7'));var querystring=require(_0x3d1d('0xd'));var Papa=require(_0x3d1d('0xe'));var Redis=require(_0x3d1d('0xf'));var authService=require(_0x3d1d('0x10'));var qs=require(_0x3d1d('0x11'));var as=require(_0x3d1d('0x12'));var hardwareService=require(_0x3d1d('0x13'));var logger=require('../../config/logger')(_0x3d1d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d1d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd6fc,_0x3f0be8){_0x3f0be8=_0x3f0be8||0xcc;return function(_0x5aed83){if(_0x5aed83){return _0x4fd6fc[_0x3d1d('0x16')](_0x3f0be8);}return _0x4fd6fc[_0x3d1d('0x17')](_0x3f0be8)[_0x3d1d('0x18')]();};}function respondWithResult(_0x369657,_0x22c87e){_0x22c87e=_0x22c87e||0xc8;return function(_0x9db1ac){if(_0x9db1ac){return _0x369657[_0x3d1d('0x17')](_0x22c87e)[_0x3d1d('0x19')](_0x9db1ac);}};}function respondWithFilteredResult(_0x401fe4,_0x5b9d49){return function(_0x501b8f){if(_0x501b8f){var _0x185b68=typeof _0x5b9d49[_0x3d1d('0x1a')]==='undefined'&&typeof _0x5b9d49[_0x3d1d('0x1b')]===_0x3d1d('0x1c');var _0x4c232b=_0x501b8f[_0x3d1d('0x1d')];var _0x4d9a4b=_0x185b68?0x0:_0x5b9d49['offset'];var _0x36ab6b=_0x185b68?_0x501b8f[_0x3d1d('0x1d')]:_0x5b9d49[_0x3d1d('0x1a')]+_0x5b9d49[_0x3d1d('0x1b')];var _0x2c44be;if(_0x36ab6b>=_0x4c232b){_0x36ab6b=_0x4c232b;_0x2c44be=0xc8;}else{_0x2c44be=0xce;}_0x401fe4[_0x3d1d('0x17')](_0x2c44be);return _0x401fe4[_0x3d1d('0x1e')](_0x3d1d('0x1f'),_0x4d9a4b+'-'+_0x36ab6b+'/'+_0x4c232b)[_0x3d1d('0x19')](_0x501b8f);}return null;};}function patchUpdates(_0x43cc32){return function(_0x446703){try{jsonpatch[_0x3d1d('0x20')](_0x446703,_0x43cc32,!![]);}catch(_0x45ea96){return BPromise[_0x3d1d('0x21')](_0x45ea96);}return _0x446703[_0x3d1d('0x22')]();};}function saveUpdates(_0x1be369,_0x2d00dd){return function(_0x150272){if(_0x150272){return _0x150272['update'](_0x1be369)[_0x3d1d('0x23')](function(_0x1c27e5){return _0x1c27e5;});}return null;};}function removeEntity(_0x51995c,_0x552748){return function(_0x1bc5eb){if(_0x1bc5eb){return _0x1bc5eb[_0x3d1d('0x24')]()[_0x3d1d('0x23')](function(){_0x51995c[_0x3d1d('0x17')](0xcc)[_0x3d1d('0x18')]();});}};}function handleEntityNotFound(_0x50abb4,_0x34d2a9){return function(_0x2dfff6){if(!_0x2dfff6){_0x50abb4['sendStatus'](0x194);}return _0x2dfff6;};}function handleError(_0x24e98d,_0x28a608){_0x28a608=_0x28a608||0x1f4;return function(_0xace16e){logger[_0x3d1d('0x25')](_0xace16e['stack']);if(_0xace16e[_0x3d1d('0x26')]){delete _0xace16e[_0x3d1d('0x26')];}_0x24e98d[_0x3d1d('0x17')](_0x28a608)[_0x3d1d('0x27')](_0xace16e);};}exports[_0x3d1d('0x28')]=function(_0x5590e2,_0x73ad51){var _0x4f9338={},_0x20c76f={},_0x3d2784={'count':0x0,'rows':[]};var _0x2fce65=_[_0x3d1d('0x29')](db[_0x3d1d('0x2a')]['rawAttributes'],function(_0x47c628){return{'name':_0x47c628[_0x3d1d('0x2b')],'type':_0x47c628['type']['key']};});_0x20c76f[_0x3d1d('0x2c')]=_['map'](_0x2fce65,_0x3d1d('0x26'));_0x20c76f[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x5590e2[_0x3d1d('0x2d')]);_0x20c76f[_0x3d1d('0x2f')]=_[_0x3d1d('0x30')](_0x20c76f['model'],_0x20c76f[_0x3d1d('0x2d')]);_0x4f9338['attributes']=_[_0x3d1d('0x30')](_0x20c76f['model'],qs[_0x3d1d('0x31')](_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x4f9338[_0x3d1d('0x32')]=_0x4f9338[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x4f9338[_0x3d1d('0x32')]:_0x20c76f['model'];if(!_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x4f9338['limit']=qs[_0x3d1d('0x1b')](_0x5590e2['query'][_0x3d1d('0x1b')]);_0x4f9338[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x5590e2['query']['offset']);}_0x4f9338[_0x3d1d('0x36')]=qs['sort'](_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x4f9338[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_['pick'](_0x5590e2[_0x3d1d('0x2d')],_0x20c76f[_0x3d1d('0x2f')]),_0x2fce65);if(_0x5590e2['query'][_0x3d1d('0x39')]){_0x4f9338[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x4f9338[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x2fce65,function(_0x427fcd){if(_0x427fcd[_0x3d1d('0x3b')]!==_0x3d1d('0x3c')){var _0x3c92b9={};_0x3c92b9[_0x427fcd['name']]={'$like':'%'+_0x5590e2['query'][_0x3d1d('0x39')]+'%'};return _0x3c92b9;}})});}_0x4f9338=_['merge']({},_0x4f9338,_0x5590e2[_0x3d1d('0x3d')]);var _0x21b7b6={'where':_0x4f9338['where']};return db[_0x3d1d('0x2a')][_0x3d1d('0x1d')](_0x21b7b6)['then'](function(_0x503ea4){_0x3d2784[_0x3d1d('0x1d')]=_0x503ea4;if(_0x5590e2[_0x3d1d('0x2d')]['includeAll']){_0x4f9338['include']=[{'all':!![]}];}return db[_0x3d1d('0x2a')][_0x3d1d('0x3e')](_0x4f9338);})[_0x3d1d('0x23')](function(_0x32098d){_0x3d2784[_0x3d1d('0x3f')]=_0x32098d;return _0x3d2784;})[_0x3d1d('0x23')](respondWithFilteredResult(_0x73ad51,_0x4f9338))[_0x3d1d('0x40')](handleError(_0x73ad51,null));};exports[_0x3d1d('0x41')]=function(_0x1ac1b2,_0x31d865){var _0x35bc68={'raw':![],'where':{'id':_0x1ac1b2[_0x3d1d('0x42')]['id']}},_0x2ab93f={};_0x2ab93f[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x2a')][_0x3d1d('0x43')]);_0x2ab93f[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x1ac1b2[_0x3d1d('0x2d')]);_0x2ab93f[_0x3d1d('0x2f')]=_['intersection'](_0x2ab93f['model'],_0x2ab93f[_0x3d1d('0x2d')]);_0x35bc68[_0x3d1d('0x32')]=_['intersection'](_0x2ab93f[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x1ac1b2[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x35bc68[_0x3d1d('0x32')]=_0x35bc68[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x35bc68[_0x3d1d('0x32')]:_0x2ab93f[_0x3d1d('0x2c')];if(_0x1ac1b2[_0x3d1d('0x2d')][_0x3d1d('0x44')]){_0x35bc68[_0x3d1d('0x45')]=[{'all':!![]}];}_0x35bc68=_[_0x3d1d('0x3a')]({},_0x35bc68,_0x1ac1b2[_0x3d1d('0x3d')]);return db[_0x3d1d('0x2a')]['find'](_0x35bc68)[_0x3d1d('0x23')](handleEntityNotFound(_0x31d865,null))['then'](respondWithResult(_0x31d865,null))[_0x3d1d('0x40')](handleError(_0x31d865,null));};exports[_0x3d1d('0x46')]=function(_0x1378a8,_0x196d1d){return db['DeskConfiguration'][_0x3d1d('0x46')](_0x1378a8[_0x3d1d('0x47')],{})[_0x3d1d('0x23')](respondWithResult(_0x196d1d,0xc9))[_0x3d1d('0x40')](handleError(_0x196d1d,null));};exports[_0x3d1d('0x48')]=function(_0x374c7a,_0x3ddc90){if(_0x374c7a[_0x3d1d('0x47')]['id']){delete _0x374c7a[_0x3d1d('0x47')]['id'];}return db[_0x3d1d('0x2a')][_0x3d1d('0x49')]({'where':{'id':_0x374c7a[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x3ddc90,null))[_0x3d1d('0x23')](saveUpdates(_0x374c7a[_0x3d1d('0x47')],null))[_0x3d1d('0x23')](respondWithResult(_0x3ddc90,null))[_0x3d1d('0x40')](handleError(_0x3ddc90,null));};exports['destroy']=function(_0x2f557c,_0xc3ae1b){return db[_0x3d1d('0x2a')][_0x3d1d('0x49')]({'where':{'id':_0x2f557c[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0xc3ae1b,null))['then'](removeEntity(_0xc3ae1b,null))[_0x3d1d('0x40')](handleError(_0xc3ae1b,null));};exports[_0x3d1d('0x4a')]=function(_0x35fbe8,_0x4123b7,_0x405cc0){var _0x263cee={};var _0x15ea22={};var _0x35770e;var _0x169567;return db['DeskConfiguration'][_0x3d1d('0x4b')]({'where':{'id':_0x35fbe8[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x4123b7,null))[_0x3d1d('0x23')](function(_0x5c1820){if(_0x5c1820){_0x35770e=_0x5c1820;_0x15ea22[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db['DeskField'][_0x3d1d('0x43')]);_0x15ea22[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x35fbe8[_0x3d1d('0x2d')]);_0x15ea22[_0x3d1d('0x2f')]=_[_0x3d1d('0x30')](_0x15ea22[_0x3d1d('0x2c')],_0x15ea22[_0x3d1d('0x2d')]);_0x263cee['attributes']=_[_0x3d1d('0x30')](_0x15ea22[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x263cee[_0x3d1d('0x32')]=_0x263cee['attributes'][_0x3d1d('0x33')]?_0x263cee['attributes']:_0x15ea22[_0x3d1d('0x2c')];_0x263cee[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x263cee[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x35fbe8[_0x3d1d('0x2d')],_0x15ea22['filters']));if(_0x35fbe8['query'][_0x3d1d('0x39')]){_0x263cee[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x263cee[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x263cee['attributes'],function(_0x58e7bc){var _0x14bafe={};_0x14bafe[_0x58e7bc]={'$like':'%'+_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x14bafe;})});}_0x263cee=_['merge']({},_0x263cee,_0x35fbe8[_0x3d1d('0x3d')]);return _0x35770e['getFields'](_0x263cee);}})[_0x3d1d('0x23')](function(_0x35dada){if(_0x35dada){_0x169567=_0x35dada[_0x3d1d('0x33')];if(!_0x35fbe8['query'][_0x3d1d('0x34')]('nolimit')){_0x263cee['limit']=qs['limit'](_0x35fbe8[_0x3d1d('0x2d')]['limit']);_0x263cee[_0x3d1d('0x1a')]=qs['offset'](_0x35fbe8[_0x3d1d('0x2d')]['offset']);}return _0x35770e['getFields'](_0x263cee);}})[_0x3d1d('0x23')](function(_0x3d4a20){if(_0x3d4a20){return _0x3d4a20?{'count':_0x169567,'rows':_0x3d4a20}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x4123b7,null))[_0x3d1d('0x40')](handleError(_0x4123b7,null));};exports[_0x3d1d('0x4d')]=function(_0x3aea91,_0x4e726d,_0x222690){var _0x4726d8={};var _0x185a73={};var _0x5609c1;var _0x53f256;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3aea91[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x4e726d,null))[_0x3d1d('0x23')](function(_0x5e131d){if(_0x5e131d){_0x5609c1=_0x5e131d;_0x185a73[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x4e')][_0x3d1d('0x43')]);_0x185a73['query']=_['keys'](_0x3aea91[_0x3d1d('0x2d')]);_0x185a73['filters']=_[_0x3d1d('0x30')](_0x185a73[_0x3d1d('0x2c')],_0x185a73['query']);_0x4726d8['attributes']=_[_0x3d1d('0x30')](_0x185a73[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x3aea91['query'][_0x3d1d('0x31')]));_0x4726d8[_0x3d1d('0x32')]=_0x4726d8['attributes'][_0x3d1d('0x33')]?_0x4726d8[_0x3d1d('0x32')]:_0x185a73[_0x3d1d('0x2c')];_0x4726d8['order']=qs[_0x3d1d('0x37')](_0x3aea91[_0x3d1d('0x2d')]['sort']);_0x4726d8[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x3aea91[_0x3d1d('0x2d')],_0x185a73[_0x3d1d('0x2f')]));if(_0x3aea91[_0x3d1d('0x2d')]['filter']){_0x4726d8[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x4726d8['where'],{'$or':_[_0x3d1d('0x29')](_0x4726d8[_0x3d1d('0x32')],function(_0x15311b){var _0x597213={};_0x597213[_0x15311b]={'$like':'%'+_0x3aea91['query'][_0x3d1d('0x39')]+'%'};return _0x597213;})});}_0x4726d8=_[_0x3d1d('0x3a')]({},_0x4726d8,_0x3aea91[_0x3d1d('0x3d')]);return _0x5609c1['getSubjects'](_0x4726d8);}})[_0x3d1d('0x23')](function(_0x1f7ed3){if(_0x1f7ed3){_0x53f256=_0x1f7ed3['length'];if(!_0x3aea91[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x4726d8['limit']=qs['limit'](_0x3aea91['query'][_0x3d1d('0x1b')]);_0x4726d8[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x3aea91[_0x3d1d('0x2d')][_0x3d1d('0x1a')]);}return _0x5609c1[_0x3d1d('0x4d')](_0x4726d8);}})['then'](function(_0x218c6b){if(_0x218c6b){return _0x218c6b?{'count':_0x53f256,'rows':_0x218c6b}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x4e726d,null))[_0x3d1d('0x40')](handleError(_0x4e726d,null));};exports[_0x3d1d('0x4f')]=function(_0xc7219a,_0x2cbbc0,_0x155b20){var _0x3461cc={};var _0x279e07={};var _0x1c584f;var _0x399063;return db[_0x3d1d('0x2a')][_0x3d1d('0x4b')]({'where':{'id':_0xc7219a[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cbbc0,null))['then'](function(_0x4e7b45){if(_0x4e7b45){_0x1c584f=_0x4e7b45;_0x279e07['model']=_[_0x3d1d('0x2e')](db[_0x3d1d('0x4e')][_0x3d1d('0x43')]);_0x279e07[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0xc7219a[_0x3d1d('0x2d')]);_0x279e07['filters']=_[_0x3d1d('0x30')](_0x279e07[_0x3d1d('0x2c')],_0x279e07['query']);_0x3461cc[_0x3d1d('0x32')]=_[_0x3d1d('0x30')](_0x279e07['model'],qs['fields'](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x3461cc[_0x3d1d('0x32')]=_0x3461cc[_0x3d1d('0x32')]['length']?_0x3461cc[_0x3d1d('0x32')]:_0x279e07[_0x3d1d('0x2c')];_0x3461cc[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x3461cc[_0x3d1d('0x38')]=qs['filters'](_[_0x3d1d('0x4c')](_0xc7219a[_0x3d1d('0x2d')],_0x279e07[_0x3d1d('0x2f')]));if(_0xc7219a['query'][_0x3d1d('0x39')]){_0x3461cc['where']=_[_0x3d1d('0x3a')](_0x3461cc[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x3461cc[_0x3d1d('0x32')],function(_0x5aae47){var _0x2b96d1={};_0x2b96d1[_0x5aae47]={'$like':'%'+_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x2b96d1;})});}_0x3461cc=_[_0x3d1d('0x3a')]({},_0x3461cc,_0xc7219a[_0x3d1d('0x3d')]);return _0x1c584f[_0x3d1d('0x4f')](_0x3461cc);}})[_0x3d1d('0x23')](function(_0x29fa52){if(_0x29fa52){_0x399063=_0x29fa52[_0x3d1d('0x33')];if(!_0xc7219a[_0x3d1d('0x2d')]['hasOwnProperty']('nolimit')){_0x3461cc[_0x3d1d('0x1b')]=qs[_0x3d1d('0x1b')](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x1b')]);_0x3461cc[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0xc7219a[_0x3d1d('0x2d')]['offset']);}return _0x1c584f[_0x3d1d('0x4f')](_0x3461cc);}})[_0x3d1d('0x23')](function(_0x422fe9){if(_0x422fe9){return _0x422fe9?{'count':_0x399063,'rows':_0x422fe9}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x2cbbc0,null))[_0x3d1d('0x40')](handleError(_0x2cbbc0,null));};exports[_0x3d1d('0x50')]=function(_0x1a1b8f,_0x11a329,_0x367844){var _0x27f890={};var _0x52db7c={};var _0x30d3b4;var _0x2f6144;return db[_0x3d1d('0x2a')][_0x3d1d('0x4b')]({'where':{'id':_0x1a1b8f[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x11a329,null))[_0x3d1d('0x23')](function(_0xde2c3d){if(_0xde2c3d){_0x30d3b4=_0xde2c3d;_0x52db7c[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x51')][_0x3d1d('0x43')]);_0x52db7c['query']=_['keys'](_0x1a1b8f[_0x3d1d('0x2d')]);_0x52db7c['filters']=_[_0x3d1d('0x30')](_0x52db7c[_0x3d1d('0x2c')],_0x52db7c[_0x3d1d('0x2d')]);_0x27f890[_0x3d1d('0x32')]=_[_0x3d1d('0x30')](_0x52db7c[_0x3d1d('0x2c')],qs['fields'](_0x1a1b8f['query']['fields']));_0x27f890[_0x3d1d('0x32')]=_0x27f890[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x27f890[_0x3d1d('0x32')]:_0x52db7c['model'];_0x27f890['order']=qs[_0x3d1d('0x37')](_0x1a1b8f[_0x3d1d('0x2d')]['sort']);_0x27f890['where']=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x1a1b8f['query'],_0x52db7c[_0x3d1d('0x2f')]));if(_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x27f890['where']=_['merge'](_0x27f890[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x27f890['attributes'],function(_0x2f0ebc){var _0x5bda97={};_0x5bda97[_0x2f0ebc]={'$like':'%'+_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x5bda97;})});}_0x27f890=_[_0x3d1d('0x3a')]({},_0x27f890,_0x1a1b8f[_0x3d1d('0x3d')]);return _0x30d3b4['getTags'](_0x27f890);}})[_0x3d1d('0x23')](function(_0x5bf965){if(_0x5bf965){_0x2f6144=_0x5bf965[_0x3d1d('0x33')];if(!_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x27f890[_0x3d1d('0x1b')]=qs['limit'](_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x1b')]);_0x27f890[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x1a1b8f[_0x3d1d('0x2d')]['offset']);}return _0x30d3b4[_0x3d1d('0x50')](_0x27f890);}})[_0x3d1d('0x23')](function(_0x402d54){if(_0x402d54){return _0x402d54?{'count':_0x2f6144,'rows':_0x402d54}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x11a329,null))[_0x3d1d('0x40')](handleError(_0x11a329,null));};exports[_0x3d1d('0x52')]=function(_0x4f1866,_0x3c82ca,_0x1533d3){if(_0x4f1866[_0x3d1d('0x47')]['id']){delete _0x4f1866[_0x3d1d('0x47')]['id'];}return db[_0x3d1d('0x2a')]['findOne']({'where':{'id':_0x4f1866[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c82ca,null))['then'](function(_0x31e644){if(_0x31e644){return _0x31e644[_0x3d1d('0x52')](_0x4f1866['body'][_0x3d1d('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3c82ca,null))['catch'](handleError(_0x3c82ca,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e8dd7ac..78cd1ae 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 _0x3a8a=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x3af393,_0x3f6ed9){var _0x201105=function(_0x529015){while(--_0x529015){_0x3af393['push'](_0x3af393['shift']());}};_0x201105(++_0x3f6ed9);}(_0x3a8a,0xed));var _0xa3a8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3a8a[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa3a8('0x0'));var util=require(_0xa3a8('0x1'));var logger=require(_0xa3a8('0x2'))(_0xa3a8('0x3'));var moment=require(_0xa3a8('0x4'));var BPromise=require(_0xa3a8('0x5'));var rp=require(_0xa3a8('0x6'));var fs=require('fs');var path=require(_0xa3a8('0x7'));var rimraf=require('rimraf');var config=require(_0xa3a8('0x8'));var attributes=require(_0xa3a8('0x9'));module[_0xa3a8('0xa')]=function(_0x4117a4,_0x33e4de){return _0x4117a4[_0xa3a8('0xb')](_0xa3a8('0xc'),attributes,{'tableName':_0xa3a8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7df=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','DeskConfiguration'];(function(_0x596571,_0x41bc10){var _0x2fd369=function(_0x19cf30){while(--_0x19cf30){_0x596571['push'](_0x596571['shift']());}};_0x2fd369(++_0x41bc10);}(_0xd7df,0xe8));var _0xfd7d=function(_0x19845c,_0x67ffaa){_0x19845c=_0x19845c-0x0;var _0x460971=_0xd7df[_0x19845c];return _0x460971;};'use strict';var _=require(_0xfd7d('0x0'));var util=require(_0xfd7d('0x1'));var logger=require(_0xfd7d('0x2'))(_0xfd7d('0x3'));var moment=require(_0xfd7d('0x4'));var BPromise=require(_0xfd7d('0x5'));var rp=require(_0xfd7d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd7d('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xfd7d('0x8')]=function(_0x409b3f,_0x286688){return _0x409b3f['define'](_0xfd7d('0x9'),attributes,{'tableName':_0xfd7d('0xa'),'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 24b56f1..25361b1 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 _0x1410=['jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1410,0x130));var _0x0141=function(_0x3e9e1e,_0x2a1068){_0x3e9e1e=_0x3e9e1e-0x0;var _0x2edbbb=_0x1410[_0x3e9e1e];return _0x2edbbb;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f701,_0x22b566,_0x25511f){return new BPromise(function(_0x2d8f15,_0x57cfbb){return client[_0x0141('0xb')](_0x24f701,_0x25511f)[_0x0141('0xc')](function(_0x2b4f13){logger[_0x0141('0xd')](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));logger[_0x0141('0x10')](_0x0141('0x11'),_0x22b566,'request\x20sent',JSON[_0x0141('0x12')](_0x2b4f13));if(_0x2b4f13[_0x0141('0x13')]){if(_0x2b4f13[_0x0141('0x13')][_0x0141('0x14')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x57cfbb(_0x2b4f13['error'][_0x0141('0x15')]);}logger[_0x0141('0x13')](_0x0141('0xe'),_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x2d8f15(_0x2b4f13['error'][_0x0141('0x15')]);}else{logger['info'](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));_0x2d8f15(_0x2b4f13[_0x0141('0x16')][_0x0141('0x15')]);}})[_0x0141('0x17')](function(_0x3c91e8){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x22b566,_0x3c91e8);_0x57cfbb(_0x3c91e8);});});} \ No newline at end of file +var _0xfcbb=['code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6f49fd,_0x451553){var _0x2afd78=function(_0x5821a7){while(--_0x5821a7){_0x6f49fd['push'](_0x6f49fd['shift']());}};_0x2afd78(++_0x451553);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x22d6c9,_0x3ea6a0){_0x22d6c9=_0x22d6c9-0x0;var _0x32d857=_0xfcbb[_0x22d6c9];return _0x32d857;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 5a50fc9..2959e10 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 _0xa282=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5f1d8c,_0x372db3){var _0x5cad66=function(_0x2ee200){while(--_0x2ee200){_0x5f1d8c['push'](_0x5f1d8c['shift']());}};_0x5cad66(++_0x372db3);}(_0xa282,0x189));var _0x2a28=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa282[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var path=require(_0x2a28('0x2'));var timeout=require(_0x2a28('0x3'));var express=require(_0x2a28('0x4'));var router=express[_0x2a28('0x5')]();var fs_extra=require(_0x2a28('0x6'));var auth=require(_0x2a28('0x7'));var interaction=require(_0x2a28('0x8'));var config=require(_0x2a28('0x9'));var controller=require(_0x2a28('0xa'));router[_0x2a28('0xb')]('/',auth[_0x2a28('0xc')](),controller['index']);router['get'](_0x2a28('0xd'),auth[_0x2a28('0xc')](),controller[_0x2a28('0xe')]);router[_0x2a28('0xf')]('/',auth['isAuthenticated'](),controller[_0x2a28('0x10')]);router[_0x2a28('0x11')](_0x2a28('0xd'),auth[_0x2a28('0xc')](),controller[_0x2a28('0x12')]);router[_0x2a28('0x13')]('/:id',auth[_0x2a28('0xc')](),controller['destroy']);module[_0x2a28('0x14')]=router; \ No newline at end of file +var _0x6380=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x6380,0x159));var _0x0638=function(_0x3be926,_0xbb3c4e){_0x3be926=_0x3be926-0x0;var _0x59c6b2=_0x6380[_0x3be926];return _0x59c6b2;};'use strict';var multer=require('multer');var util=require(_0x0638('0x0'));var path=require(_0x0638('0x1'));var timeout=require(_0x0638('0x2'));var express=require(_0x0638('0x3'));var router=express[_0x0638('0x4')]();var fs_extra=require(_0x0638('0x5'));var auth=require(_0x0638('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0638('0x7'));var controller=require(_0x0638('0x8'));router[_0x0638('0x9')]('/',auth[_0x0638('0xa')](),controller[_0x0638('0xb')]);router[_0x0638('0x9')](_0x0638('0xc'),auth[_0x0638('0xa')](),controller[_0x0638('0xd')]);router[_0x0638('0xe')]('/',auth['isAuthenticated'](),controller[_0x0638('0xf')]);router['put'](_0x0638('0xc'),auth[_0x0638('0xa')](),controller[_0x0638('0x10')]);router['delete']('/:id',auth[_0x0638('0xa')](),controller[_0x0638('0x11')]);module[_0x0638('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a384744..27c8493 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 _0xdb25=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdb25,0x1ca));var _0x5db2=function(_0x80380e,_0xe62cf8){_0x80380e=_0x80380e-0x0;var _0x417c29=_0xdb25[_0x80380e];return _0x417c29;};'use strict';var Sequelize=require(_0x5db2('0x0'));module[_0x5db2('0x1')]={'type':{'type':Sequelize[_0x5db2('0x2')](_0x5db2('0x3'),_0x5db2('0x4'),_0x5db2('0x5'),_0x5db2('0x6'),_0x5db2('0x7')),'defaultValue':_0x5db2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5db2('0x2')](_0x5db2('0x3'),_0x5db2('0x4'),_0x5db2('0x5'))},'keyContent':{'type':Sequelize[_0x5db2('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5db2('0x8')]},'customField':{'type':Sequelize[_0x5db2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5db2('0x8')]}}; \ No newline at end of file +var _0xf663=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2d23c9,_0x808606){var _0x494f10=function(_0x160e35){while(--_0x160e35){_0x2d23c9['push'](_0x2d23c9['shift']());}};_0x494f10(++_0x808606);}(_0xf663,0x162));var _0x3f66=function(_0x3e1e4c,_0x4d16e4){_0x3e1e4c=_0x3e1e4c-0x0;var _0x1b5dd3=_0xf663[_0x3e1e4c];return _0x1b5dd3;};'use strict';var Sequelize=require(_0x3f66('0x0'));module[_0x3f66('0x1')]={'type':{'type':Sequelize[_0x3f66('0x2')](_0x3f66('0x3'),_0x3f66('0x4'),_0x3f66('0x5'),'keyValue',_0x3f66('0x6')),'defaultValue':_0x3f66('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3f66('0x7')]},'keyType':{'type':Sequelize[_0x3f66('0x2')]('string',_0x3f66('0x4'),_0x3f66('0x5'))},'keyContent':{'type':Sequelize[_0x3f66('0x7')]},'idField':{'type':Sequelize[_0x3f66('0x7')]},'nameField':{'type':Sequelize[_0x3f66('0x7')]},'customField':{'type':Sequelize[_0x3f66('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f66('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 1b3d6db..2642898 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 _0x494e=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskField','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','merge','find','catch','create','body','params','eml-format','zip-dir','moment','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x494e,0xd6));var _0xe494=function(_0x2bbc0b,_0x209fbc){_0x2bbc0b=_0x2bbc0b-0x0;var _0x2a2cf6=_0x494e[_0x2bbc0b];return _0x2a2cf6;};'use strict';var emlformat=require(_0xe494('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe494('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe494('0x2'));var BPromise=require(_0xe494('0x3'));var Mustache=require(_0xe494('0x4'));var util=require(_0xe494('0x5'));var path=require(_0xe494('0x6'));var sox=require(_0xe494('0x7'));var csv=require(_0xe494('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe494('0x9'));var squel=require(_0xe494('0xa'));var crypto=require(_0xe494('0xb'));var jsforce=require(_0xe494('0xc'));var deskjs=require(_0xe494('0xd'));var toCsv=require(_0xe494('0x8'));var querystring=require(_0xe494('0xe'));var Papa=require('papaparse');var Redis=require(_0xe494('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe494('0x10'));var hardwareService=require(_0xe494('0x11'));var logger=require(_0xe494('0x12'))(_0xe494('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe494('0x14'))['db'];function respondWithStatusCode(_0xbd223f,_0x43c3be){_0x43c3be=_0x43c3be||0xcc;return function(_0x51f733){if(_0x51f733){return _0xbd223f[_0xe494('0x15')](_0x43c3be);}return _0xbd223f[_0xe494('0x16')](_0x43c3be)[_0xe494('0x17')]();};}function respondWithResult(_0x2fa579,_0x57afbf){_0x57afbf=_0x57afbf||0xc8;return function(_0x1d6a4c){if(_0x1d6a4c){return _0x2fa579['status'](_0x57afbf)['json'](_0x1d6a4c);}};}function respondWithFilteredResult(_0x1158ec,_0xa43ef2){return function(_0x317c23){if(_0x317c23){var _0x34744a=typeof _0xa43ef2['offset']===_0xe494('0x18')&&typeof _0xa43ef2[_0xe494('0x19')]===_0xe494('0x18');var _0x524ec2=_0x317c23[_0xe494('0x1a')];var _0x5737b8=_0x34744a?0x0:_0xa43ef2['offset'];var _0x411dba=_0x34744a?_0x317c23[_0xe494('0x1a')]:_0xa43ef2[_0xe494('0x1b')]+_0xa43ef2[_0xe494('0x19')];var _0x4465e1;if(_0x411dba>=_0x524ec2){_0x411dba=_0x524ec2;_0x4465e1=0xc8;}else{_0x4465e1=0xce;}_0x1158ec[_0xe494('0x16')](_0x4465e1);return _0x1158ec[_0xe494('0x1c')]('Content-Range',_0x5737b8+'-'+_0x411dba+'/'+_0x524ec2)[_0xe494('0x1d')](_0x317c23);}return null;};}function patchUpdates(_0x3bc181){return function(_0xa3dd6a){try{jsonpatch[_0xe494('0x1e')](_0xa3dd6a,_0x3bc181,!![]);}catch(_0x3bb951){return BPromise[_0xe494('0x1f')](_0x3bb951);}return _0xa3dd6a[_0xe494('0x20')]();};}function saveUpdates(_0x12454d,_0x44ddda){return function(_0x3ea711){if(_0x3ea711){return _0x3ea711[_0xe494('0x21')](_0x12454d)[_0xe494('0x22')](function(_0x39b02a){return _0x39b02a;});}return null;};}function removeEntity(_0x4cbb2a,_0x22267d){return function(_0x1847ca){if(_0x1847ca){return _0x1847ca[_0xe494('0x23')]()['then'](function(){_0x4cbb2a[_0xe494('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8447e8,_0x58c4ce){return function(_0x540d67){if(!_0x540d67){_0x8447e8[_0xe494('0x15')](0x194);}return _0x540d67;};}function handleError(_0x7277a,_0x49b3b2){_0x49b3b2=_0x49b3b2||0x1f4;return function(_0x3390bd){logger[_0xe494('0x24')](_0x3390bd[_0xe494('0x25')]);if(_0x3390bd['name']){delete _0x3390bd[_0xe494('0x26')];}_0x7277a[_0xe494('0x16')](_0x49b3b2)[_0xe494('0x27')](_0x3390bd);};}exports['index']=function(_0x191de7,_0x2571ef){var _0x4fc686={},_0x58d3f9={},_0x4940ca={'count':0x0,'rows':[]};var _0x4f693f=_[_0xe494('0x28')](db[_0xe494('0x29')]['rawAttributes'],function(_0x49fb81){return{'name':_0x49fb81[_0xe494('0x2a')],'type':_0x49fb81['type'][_0xe494('0x2b')]};});_0x58d3f9['model']=_[_0xe494('0x28')](_0x4f693f,'name');_0x58d3f9[_0xe494('0x2c')]=_['keys'](_0x191de7[_0xe494('0x2c')]);_0x58d3f9[_0xe494('0x2d')]=_[_0xe494('0x2e')](_0x58d3f9[_0xe494('0x2f')],_0x58d3f9['query']);_0x4fc686[_0xe494('0x30')]=_[_0xe494('0x2e')](_0x58d3f9[_0xe494('0x2f')],qs[_0xe494('0x31')](_0x191de7[_0xe494('0x2c')][_0xe494('0x31')]));_0x4fc686[_0xe494('0x30')]=_0x4fc686[_0xe494('0x30')][_0xe494('0x32')]?_0x4fc686[_0xe494('0x30')]:_0x58d3f9['model'];if(!_0x191de7['query'][_0xe494('0x33')](_0xe494('0x34'))){_0x4fc686[_0xe494('0x19')]=qs['limit'](_0x191de7['query'][_0xe494('0x19')]);_0x4fc686['offset']=qs[_0xe494('0x1b')](_0x191de7[_0xe494('0x2c')]['offset']);}_0x4fc686['order']=qs['sort'](_0x191de7[_0xe494('0x2c')][_0xe494('0x35')]);_0x4fc686[_0xe494('0x36')]=qs['filters'](_[_0xe494('0x37')](_0x191de7['query'],_0x58d3f9[_0xe494('0x2d')]),_0x4f693f);if(_0x191de7['query'][_0xe494('0x38')]){_0x4fc686['where']=_['merge'](_0x4fc686['where'],{'$or':_[_0xe494('0x28')](_0x4f693f,function(_0x256864){if(_0x256864[_0xe494('0x39')]!==_0xe494('0x3a')){var _0x4af235={};_0x4af235[_0x256864[_0xe494('0x26')]]={'$like':'%'+_0x191de7[_0xe494('0x2c')][_0xe494('0x38')]+'%'};return _0x4af235;}})});}_0x4fc686=_['merge']({},_0x4fc686,_0x191de7[_0xe494('0x3b')]);var _0x3327ca={'where':_0x4fc686[_0xe494('0x36')]};return db[_0xe494('0x29')][_0xe494('0x1a')](_0x3327ca)['then'](function(_0x3a9fa0){_0x4940ca[_0xe494('0x1a')]=_0x3a9fa0;if(_0x191de7['query']['includeAll']){_0x4fc686[_0xe494('0x3c')]=[{'all':!![]}];}return db[_0xe494('0x29')][_0xe494('0x3d')](_0x4fc686);})[_0xe494('0x22')](function(_0x2d7bb2){_0x4940ca[_0xe494('0x3e')]=_0x2d7bb2;return _0x4940ca;})[_0xe494('0x22')](respondWithFilteredResult(_0x2571ef,_0x4fc686))['catch'](handleError(_0x2571ef,null));};exports[_0xe494('0x3f')]=function(_0x164075,_0x28b6e7){var _0x34f3d6={'raw':!![],'where':{'id':_0x164075['params']['id']}},_0x464dd4={};_0x464dd4['model']=_[_0xe494('0x40')](db[_0xe494('0x29')][_0xe494('0x41')]);_0x464dd4[_0xe494('0x2c')]=_[_0xe494('0x40')](_0x164075[_0xe494('0x2c')]);_0x464dd4[_0xe494('0x2d')]=_[_0xe494('0x2e')](_0x464dd4[_0xe494('0x2f')],_0x464dd4['query']);_0x34f3d6[_0xe494('0x30')]=_['intersection'](_0x464dd4['model'],qs[_0xe494('0x31')](_0x164075['query'][_0xe494('0x31')]));_0x34f3d6[_0xe494('0x30')]=_0x34f3d6[_0xe494('0x30')]['length']?_0x34f3d6['attributes']:_0x464dd4[_0xe494('0x2f')];if(_0x164075[_0xe494('0x2c')][_0xe494('0x42')]){_0x34f3d6['include']=[{'all':!![]}];}_0x34f3d6=_[_0xe494('0x43')]({},_0x34f3d6,_0x164075[_0xe494('0x3b')]);return db[_0xe494('0x29')][_0xe494('0x44')](_0x34f3d6)[_0xe494('0x22')](handleEntityNotFound(_0x28b6e7,null))['then'](respondWithResult(_0x28b6e7,null))[_0xe494('0x45')](handleError(_0x28b6e7,null));};exports[_0xe494('0x46')]=function(_0x488f10,_0x9be151){return db[_0xe494('0x29')][_0xe494('0x46')](_0x488f10[_0xe494('0x47')],{})[_0xe494('0x22')](respondWithResult(_0x9be151,0xc9))['catch'](handleError(_0x9be151,null));};exports[_0xe494('0x21')]=function(_0x506d15,_0x2a0271){if(_0x506d15[_0xe494('0x47')]['id']){delete _0x506d15[_0xe494('0x47')]['id'];}return db[_0xe494('0x29')][_0xe494('0x44')]({'where':{'id':_0x506d15[_0xe494('0x48')]['id']}})[_0xe494('0x22')](handleEntityNotFound(_0x2a0271,null))['then'](saveUpdates(_0x506d15[_0xe494('0x47')],null))[_0xe494('0x22')](respondWithResult(_0x2a0271,null))[_0xe494('0x45')](handleError(_0x2a0271,null));};exports[_0xe494('0x23')]=function(_0x56b86a,_0x54f619){return db['DeskField'][_0xe494('0x44')]({'where':{'id':_0x56b86a[_0xe494('0x48')]['id']}})[_0xe494('0x22')](handleEntityNotFound(_0x54f619,null))[_0xe494('0x22')](removeEntity(_0x54f619,null))['catch'](handleError(_0x54f619,null));}; \ No newline at end of file +var _0xc9c3=['options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','filter','where','merge'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xc9c3,0x96));var _0x3c9c=function(_0x10790f,_0x250349){_0x10790f=_0x10790f-0x0;var _0xf18563=_0xc9c3[_0x10790f];return _0xf18563;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];function respondWithStatusCode(_0x3f464d,_0x4a17ed){_0x4a17ed=_0x4a17ed||0xcc;return function(_0x50cf96){if(_0x50cf96){return _0x3f464d['sendStatus'](_0x4a17ed);}return _0x3f464d[_0x3c9c('0x18')](_0x4a17ed)['end']();};}function respondWithResult(_0x5e8c0e,_0x53b3ca){_0x53b3ca=_0x53b3ca||0xc8;return function(_0x22c495){if(_0x22c495){return _0x5e8c0e['status'](_0x53b3ca)[_0x3c9c('0x19')](_0x22c495);}};}function respondWithFilteredResult(_0xf16337,_0x1f725b){return function(_0x824e63){if(_0x824e63){var _0x4a43d2=typeof _0x1f725b[_0x3c9c('0x1a')]==='undefined'&&typeof _0x1f725b['limit']==='undefined';var _0x3200a3=_0x824e63[_0x3c9c('0x1b')];var _0x216fd8=_0x4a43d2?0x0:_0x1f725b[_0x3c9c('0x1a')];var _0x3e63e0=_0x4a43d2?_0x824e63[_0x3c9c('0x1b')]:_0x1f725b[_0x3c9c('0x1a')]+_0x1f725b['limit'];var _0x15a90a;if(_0x3e63e0>=_0x3200a3){_0x3e63e0=_0x3200a3;_0x15a90a=0xc8;}else{_0x15a90a=0xce;}_0xf16337['status'](_0x15a90a);return _0xf16337[_0x3c9c('0x1c')]('Content-Range',_0x216fd8+'-'+_0x3e63e0+'/'+_0x3200a3)[_0x3c9c('0x19')](_0x824e63);}return null;};}function patchUpdates(_0x1152d5){return function(_0x5f51fb){try{jsonpatch[_0x3c9c('0x1d')](_0x5f51fb,_0x1152d5,!![]);}catch(_0x29e4ac){return BPromise[_0x3c9c('0x1e')](_0x29e4ac);}return _0x5f51fb['save']();};}function saveUpdates(_0x3faad1,_0x249747){return function(_0x2d5ffc){if(_0x2d5ffc){return _0x2d5ffc[_0x3c9c('0x1f')](_0x3faad1)[_0x3c9c('0x20')](function(_0x3bc5c4){return _0x3bc5c4;});}return null;};}function removeEntity(_0x338c2d,_0x32e4c2){return function(_0x509bf7){if(_0x509bf7){return _0x509bf7[_0x3c9c('0x21')]()['then'](function(){_0x338c2d[_0x3c9c('0x18')](0xcc)[_0x3c9c('0x22')]();});}};}function handleEntityNotFound(_0x4ca078,_0x527bb9){return function(_0x379880){if(!_0x379880){_0x4ca078[_0x3c9c('0x23')](0x194);}return _0x379880;};}function handleError(_0x1b57ec,_0x43d1f0){_0x43d1f0=_0x43d1f0||0x1f4;return function(_0x4c283d){logger[_0x3c9c('0x24')](_0x4c283d[_0x3c9c('0x25')]);if(_0x4c283d['name']){delete _0x4c283d[_0x3c9c('0x26')];}_0x1b57ec['status'](_0x43d1f0)['send'](_0x4c283d);};}exports[_0x3c9c('0x27')]=function(_0x39ea8d,_0x333f2b){var _0x248de1={},_0x7bdf33={},_0x5da4e9={'count':0x0,'rows':[]};var _0x18eebd=_['map'](db[_0x3c9c('0x28')][_0x3c9c('0x29')],function(_0x4a0644){return{'name':_0x4a0644[_0x3c9c('0x2a')],'type':_0x4a0644['type'][_0x3c9c('0x2b')]};});_0x7bdf33[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x18eebd,_0x3c9c('0x26'));_0x7bdf33[_0x3c9c('0x2e')]=_[_0x3c9c('0x2f')](_0x39ea8d[_0x3c9c('0x2e')]);_0x7bdf33[_0x3c9c('0x30')]=_['intersection'](_0x7bdf33[_0x3c9c('0x2c')],_0x7bdf33[_0x3c9c('0x2e')]);_0x248de1[_0x3c9c('0x31')]=_[_0x3c9c('0x32')](_0x7bdf33[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x248de1[_0x3c9c('0x31')]=_0x248de1[_0x3c9c('0x31')][_0x3c9c('0x34')]?_0x248de1[_0x3c9c('0x31')]:_0x7bdf33[_0x3c9c('0x2c')];if(!_0x39ea8d[_0x3c9c('0x2e')]['hasOwnProperty'](_0x3c9c('0x35'))){_0x248de1[_0x3c9c('0x36')]=qs[_0x3c9c('0x36')](_0x39ea8d['query'][_0x3c9c('0x36')]);_0x248de1[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x39ea8d[_0x3c9c('0x2e')]['offset']);}_0x248de1['order']=qs[_0x3c9c('0x37')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x37')]);_0x248de1['where']=qs['filters'](_[_0x3c9c('0x38')](_0x39ea8d['query'],_0x7bdf33['filters']),_0x18eebd);if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]){_0x248de1[_0x3c9c('0x3a')]=_['merge'](_0x248de1[_0x3c9c('0x3a')],{'$or':_[_0x3c9c('0x2d')](_0x18eebd,function(_0x4024aa){if(_0x4024aa['type']!=='VIRTUAL'){var _0x4826d3={};_0x4826d3[_0x4024aa[_0x3c9c('0x26')]]={'$like':'%'+_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]+'%'};return _0x4826d3;}})});}_0x248de1=_[_0x3c9c('0x3b')]({},_0x248de1,_0x39ea8d[_0x3c9c('0x3c')]);var _0x1125ff={'where':_0x248de1['where']};return db['DeskField'][_0x3c9c('0x1b')](_0x1125ff)[_0x3c9c('0x20')](function(_0xe23844){_0x5da4e9['count']=_0xe23844;if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x248de1[_0x3c9c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x248de1);})[_0x3c9c('0x20')](function(_0xdbac2a){_0x5da4e9[_0x3c9c('0x3f')]=_0xdbac2a;return _0x5da4e9;})['then'](respondWithFilteredResult(_0x333f2b,_0x248de1))[_0x3c9c('0x40')](handleError(_0x333f2b,null));};exports[_0x3c9c('0x41')]=function(_0xd81ea4,_0x3dbfc7){var _0x5be9a3={'raw':!![],'where':{'id':_0xd81ea4[_0x3c9c('0x42')]['id']}},_0x412a21={};_0x412a21['model']=_['keys'](db[_0x3c9c('0x28')][_0x3c9c('0x29')]);_0x412a21['query']=_[_0x3c9c('0x2f')](_0xd81ea4[_0x3c9c('0x2e')]);_0x412a21[_0x3c9c('0x30')]=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],_0x412a21[_0x3c9c('0x2e')]);_0x5be9a3['attributes']=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x5be9a3['attributes']=_0x5be9a3['attributes'][_0x3c9c('0x34')]?_0x5be9a3[_0x3c9c('0x31')]:_0x412a21[_0x3c9c('0x2c')];if(_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x5be9a3['include']=[{'all':!![]}];}_0x5be9a3=_[_0x3c9c('0x3b')]({},_0x5be9a3,_0xd81ea4[_0x3c9c('0x3c')]);return db[_0x3c9c('0x28')][_0x3c9c('0x43')](_0x5be9a3)[_0x3c9c('0x20')](handleEntityNotFound(_0x3dbfc7,null))['then'](respondWithResult(_0x3dbfc7,null))[_0x3c9c('0x40')](handleError(_0x3dbfc7,null));};exports[_0x3c9c('0x44')]=function(_0x1804e3,_0x24b1f0){return db[_0x3c9c('0x28')][_0x3c9c('0x44')](_0x1804e3[_0x3c9c('0x45')],{})['then'](respondWithResult(_0x24b1f0,0xc9))[_0x3c9c('0x40')](handleError(_0x24b1f0,null));};exports[_0x3c9c('0x1f')]=function(_0xbcf5fb,_0x278f77){if(_0xbcf5fb[_0x3c9c('0x45')]['id']){delete _0xbcf5fb[_0x3c9c('0x45')]['id'];}return db['DeskField'][_0x3c9c('0x43')]({'where':{'id':_0xbcf5fb[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x278f77,null))[_0x3c9c('0x20')](saveUpdates(_0xbcf5fb[_0x3c9c('0x45')],null))[_0x3c9c('0x20')](respondWithResult(_0x278f77,null))[_0x3c9c('0x40')](handleError(_0x278f77,null));};exports[_0x3c9c('0x21')]=function(_0xb62338,_0x31e63d){return db[_0x3c9c('0x28')][_0x3c9c('0x43')]({'where':{'id':_0xb62338[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x31e63d,null))[_0x3c9c('0x20')](removeEntity(_0x31e63d,null))[_0x3c9c('0x40')](handleError(_0x31e63d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 3e481e8..b207d32 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 _0xfe5b=['desk_unique_index','idField','lodash','util','api','bluebird','request-promise','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields'];(function(_0x3f8870,_0x362fb5){var _0xf7bb50=function(_0x58617c){while(--_0x58617c){_0x3f8870['push'](_0x3f8870['shift']());}};_0xf7bb50(++_0x362fb5);}(_0xfe5b,0x1f0));var _0xbfe5=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xfe5b[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0xbfe5('0x0'));var util=require(_0xbfe5('0x1'));var logger=require('../../config/logger')(_0xbfe5('0x2'));var moment=require('moment');var BPromise=require(_0xbfe5('0x3'));var rp=require(_0xbfe5('0x4'));var fs=require('fs');var path=require(_0xbfe5('0x5'));var rimraf=require(_0xbfe5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbfe5('0x7'));module['exports']=function(_0x18787a,_0x317d29){return _0x18787a[_0xbfe5('0x8')](_0xbfe5('0x9'),attributes,{'tableName':_0xbfe5('0xa'),'paranoid':![],'indexes':[{'name':_0xbfe5('0xb'),'fields':[_0xbfe5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa71=['rimraf','../../config/environment','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x15a877,_0x4a0e56){var _0x551174=function(_0x3a1cd0){while(--_0x3a1cd0){_0x15a877['push'](_0x15a877['shift']());}};_0x551174(++_0x4a0e56);}(_0xaa71,0x118));var _0x1aa7=function(_0x5903b0,_0x554c48){_0x5903b0=_0x5903b0-0x0;var _0x1dd78f=_0xaa71[_0x5903b0];return _0x1dd78f;};'use strict';var _=require(_0x1aa7('0x0'));var util=require('util');var logger=require(_0x1aa7('0x1'))(_0x1aa7('0x2'));var moment=require(_0x1aa7('0x3'));var BPromise=require('bluebird');var rp=require(_0x1aa7('0x4'));var fs=require('fs');var path=require(_0x1aa7('0x5'));var rimraf=require(_0x1aa7('0x6'));var config=require(_0x1aa7('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x1a1037,_0x425b65){return _0x1a1037[_0x1aa7('0x8')](_0x1aa7('0x9'),attributes,{'tableName':_0x1aa7('0xa'),'paranoid':![],'indexes':[{'name':_0x1aa7('0xb'),'fields':['idField',_0x1aa7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 29f4536..36f591e 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 _0x44ee=['info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x13ec74,_0x2ed6bd){var _0x1bf158=function(_0x20da2b){while(--_0x20da2b){_0x13ec74['push'](_0x13ec74['shift']());}};_0x1bf158(++_0x2ed6bd);}(_0x44ee,0x1d7));var _0xe44e=function(_0x2173ad,_0x29c09a){_0x2173ad=_0x2173ad-0x0;var _0x1b32ca=_0x44ee[_0x2173ad];return _0x1b32ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe44e('0x0'));var BPromise=require(_0xe44e('0x1'));var rs=require(_0xe44e('0x2'));var fs=require('fs');var Redis=require(_0xe44e('0x3'));var db=require(_0xe44e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe44e('0x5'))(_0xe44e('0x6'));var config=require(_0xe44e('0x7'));var jayson=require(_0xe44e('0x8'));var client=jayson[_0xe44e('0x9')][_0xe44e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d6797,_0x40397e,_0x2c3ae7){return new BPromise(function(_0x40efa7,_0x59a6c5){return client[_0xe44e('0xb')](_0x5d6797,_0x2c3ae7)['then'](function(_0x281504){logger[_0xe44e('0xc')](_0xe44e('0xd'),_0x40397e,_0xe44e('0xe'));logger['debug'](_0xe44e('0xf'),_0x40397e,'request\x20sent',JSON[_0xe44e('0x10')](_0x281504));if(_0x281504[_0xe44e('0x11')]){if(_0x281504['error'][_0xe44e('0x12')]===0x1f4){logger[_0xe44e('0x11')](_0xe44e('0xd'),_0x40397e,_0x281504[_0xe44e('0x11')]['message']);return _0x59a6c5(_0x281504[_0xe44e('0x11')][_0xe44e('0x13')]);}logger[_0xe44e('0x11')]('DeskField,\x20%s,\x20%s',_0x40397e,_0x281504[_0xe44e('0x11')][_0xe44e('0x13')]);return _0x40efa7(_0x281504['error'][_0xe44e('0x13')]);}else{logger[_0xe44e('0xc')]('DeskField,\x20%s,\x20%s',_0x40397e,_0xe44e('0xe'));_0x40efa7(_0x281504['result']['message']);}})[_0xe44e('0x14')](function(_0x1ea80f){logger[_0xe44e('0x11')](_0xe44e('0xd'),_0x40397e,_0x1ea80f);_0x59a6c5(_0x1ea80f);});});} \ No newline at end of file +var _0x45db=['rpc','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x284551,_0x4ee3b1){var _0x1be363=function(_0x4919bf){while(--_0x4919bf){_0x284551['push'](_0x284551['shift']());}};_0x1be363(++_0x4ee3b1);}(_0x45db,0x16f));var _0xb45d=function(_0x1dd6ba,_0x4f8eea){_0x1dd6ba=_0x1dd6ba-0x0;var _0xbdfc7a=_0x45db[_0x1dd6ba];return _0xbdfc7a;};'use strict';var _=require(_0xb45d('0x0'));var util=require(_0xb45d('0x1'));var moment=require(_0xb45d('0x2'));var BPromise=require(_0xb45d('0x3'));var rs=require(_0xb45d('0x4'));var fs=require('fs');var Redis=require(_0xb45d('0x5'));var db=require(_0xb45d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb45d('0x7'));var config=require(_0xb45d('0x8'));var jayson=require(_0xb45d('0x9'));var client=jayson[_0xb45d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2152,_0x275a32,_0x14a636){return new BPromise(function(_0x27d74f,_0x519f0d){return client[_0xb45d('0xb')](_0x2a2152,_0x14a636)['then'](function(_0x574941){logger[_0xb45d('0xc')](_0xb45d('0xd'),_0x275a32,_0xb45d('0xe'));logger[_0xb45d('0xf')](_0xb45d('0x10'),_0x275a32,_0xb45d('0xe'),JSON[_0xb45d('0x11')](_0x574941));if(_0x574941['error']){if(_0x574941[_0xb45d('0x12')][_0xb45d('0x13')]===0x1f4){logger[_0xb45d('0x12')](_0xb45d('0xd'),_0x275a32,_0x574941[_0xb45d('0x12')]['message']);return _0x519f0d(_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);}logger['error'](_0xb45d('0xd'),_0x275a32,_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);return _0x27d74f(_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x275a32,_0xb45d('0xe'));_0x27d74f(_0x574941[_0xb45d('0x15')][_0xb45d('0x14')]);}})['catch'](function(_0xad1334){logger[_0xb45d('0x12')]('DeskField,\x20%s,\x20%s',_0x275a32,_0xad1334);_0x519f0d(_0xad1334);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e91c9a9..2f14b80 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 _0x194d=['multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports'];(function(_0x148bc0,_0xf5cfdc){var _0x34d7d0=function(_0x28f5d7){while(--_0x28f5d7){_0x148bc0['push'](_0x148bc0['shift']());}};_0x34d7d0(++_0xf5cfdc);}(_0x194d,0x9a));var _0xd194=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x194d[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xd194('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd194('0x1'));var express=require(_0xd194('0x2'));var router=express['Router']();var fs_extra=require(_0xd194('0x3'));var auth=require(_0xd194('0x4'));var interaction=require(_0xd194('0x5'));var config=require(_0xd194('0x6'));var controller=require('./intDynamics365Account.controller');router[_0xd194('0x7')]('/',auth[_0xd194('0x8')](),controller[_0xd194('0x9')]);router['get'](_0xd194('0xa'),auth[_0xd194('0x8')](),controller['show']);router[_0xd194('0x7')](_0xd194('0xb'),auth[_0xd194('0x8')](),controller[_0xd194('0xc')]);router[_0xd194('0x7')](_0xd194('0xd'),auth[_0xd194('0x8')](),controller[_0xd194('0xe')]);router[_0xd194('0xf')]('/',auth[_0xd194('0x8')](),controller[_0xd194('0x10')]);router[_0xd194('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd194('0x11')]);router['put']('/:id',auth[_0xd194('0x8')](),controller[_0xd194('0x12')]);router[_0xd194('0x13')](_0xd194('0xa'),auth[_0xd194('0x8')](),controller[_0xd194('0x14')]);module[_0xd194('0x15')]=router; \ No newline at end of file +var _0xfbfe=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','delete','exports','path','connect-timeout'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xfbfe,0x124));var _0xefbf=function(_0x4cb2d8,_0x4dec1a){_0x4cb2d8=_0x4cb2d8-0x0;var _0x5f57e5=_0xfbfe[_0x4cb2d8];return _0x5f57e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xefbf('0x0'));var timeout=require(_0xefbf('0x1'));var express=require(_0xefbf('0x2'));var router=express['Router']();var fs_extra=require(_0xefbf('0x3'));var auth=require(_0xefbf('0x4'));var interaction=require(_0xefbf('0x5'));var config=require(_0xefbf('0x6'));var controller=require(_0xefbf('0x7'));router[_0xefbf('0x8')]('/',auth[_0xefbf('0x9')](),controller[_0xefbf('0xa')]);router[_0xefbf('0x8')](_0xefbf('0xb'),auth[_0xefbf('0x9')](),controller['show']);router[_0xefbf('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xefbf('0xc')]);router['get'](_0xefbf('0xd'),auth[_0xefbf('0x9')](),controller[_0xefbf('0xe')]);router['post']('/',auth[_0xefbf('0x9')](),controller[_0xefbf('0xf')]);router['post'](_0xefbf('0x10'),auth['isAuthenticated'](),controller[_0xefbf('0x11')]);router[_0xefbf('0x12')](_0xefbf('0xb'),auth[_0xefbf('0x9')](),controller['update']);router[_0xefbf('0x13')](_0xefbf('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xefbf('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a2b22c5..fe4003e 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 _0x10dc=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4af3dc,_0x5ef283){var _0x2b8396=function(_0x90991){while(--_0x90991){_0x4af3dc['push'](_0x4af3dc['shift']());}};_0x2b8396(++_0x5ef283);}(_0x10dc,0x107));var _0xc10d=function(_0x113a1a,_0x22a2c9){_0x113a1a=_0x113a1a-0x0;var _0x14d16e=_0x10dc[_0x113a1a];return _0x14d16e;};'use strict';var Sequelize=require(_0xc10d('0x0'));module[_0xc10d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc10d('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc10d('0x2')]},'tenantId':{'type':Sequelize[_0xc10d('0x2')]},'clientId':{'type':Sequelize[_0xc10d('0x2')]},'clientSecret':{'type':Sequelize[_0xc10d('0x2')]},'serverUrl':{'type':Sequelize[_0xc10d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc10d('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc10d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7dfd=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5ca342,_0x5e4bdc){var _0x4b0d48=function(_0xc87360){while(--_0xc87360){_0x5ca342['push'](_0x5ca342['shift']());}};_0x4b0d48(++_0x5e4bdc);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')]},'username':{'type':Sequelize[_0xd7df('0x2')]},'password':{'type':Sequelize[_0xd7df('0x2')]},'remoteUri':{'type':Sequelize[_0xd7df('0x2')]},'tenantId':{'type':Sequelize[_0xd7df('0x2')]},'clientId':{'type':Sequelize[_0xd7df('0x2')]},'clientSecret':{'type':Sequelize[_0xd7df('0x2')]},'serverUrl':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'modernAuthentication':{'type':Sequelize[_0xd7df('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 8caef46..ed042d4 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 _0x3a87=['ticketType','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','clientId','clientSecret','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Label','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','status','offset','limit','undefined','count','set','Content-Range','json','then','end','error','stack','name','send','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','where','includeAll','include','Dynamics365Account','findAll','catch','show','rawAttributes','options','find','create','body','update','params','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','format','getFields'];(function(_0x3d9343,_0x3802c5){var _0x7f93df=function(_0x46e6b9){while(--_0x46e6b9){_0x3d9343['push'](_0x3d9343['shift']());}};_0x7f93df(++_0x3802c5);}(_0x3a87,0x1f2));var _0x73a8=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x3a87[_0x3ce2c4];return _0x4047c1;};'use strict';var rp=require(_0x73a8('0x0'));var util=require(_0x73a8('0x1'));var _=require(_0x73a8('0x2'));var qs=require(_0x73a8('0x3'));var logger=require(_0x73a8('0x4'))(_0x73a8('0x5'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x217296,_0x5cf5db){_0x5cf5db=_0x5cf5db||0xc8;return function(_0x37093a){if(_0x37093a){return _0x217296[_0x73a8('0x6')](_0x5cf5db)['json'](_0x37093a);}};}function respondWithFilteredResult(_0x4e03a0,_0x386523){return function(_0xf4166c){if(_0xf4166c){var _0x412c20=typeof _0x386523[_0x73a8('0x7')]==='undefined'&&typeof _0x386523[_0x73a8('0x8')]===_0x73a8('0x9');var _0x20afe1=_0xf4166c['count'];var _0x1a1338=_0x412c20?0x0:_0x386523[_0x73a8('0x7')];var _0x5cd3c5=_0x412c20?_0xf4166c[_0x73a8('0xa')]:_0x386523[_0x73a8('0x7')]+_0x386523['limit'];var _0x2a4fe9;if(_0x5cd3c5>=_0x20afe1){_0x5cd3c5=_0x20afe1;_0x2a4fe9=0xc8;}else{_0x2a4fe9=0xce;}_0x4e03a0['status'](_0x2a4fe9);return _0x4e03a0[_0x73a8('0xb')](_0x73a8('0xc'),_0x1a1338+'-'+_0x5cd3c5+'/'+_0x20afe1)[_0x73a8('0xd')](_0xf4166c);}return null;};}function saveUpdates(_0x3eaf4e){return function(_0x4e8ce3){if(_0x4e8ce3){return _0x4e8ce3['update'](_0x3eaf4e)[_0x73a8('0xe')](function(_0x24b995){return _0x24b995;});}return null;};}function removeEntity(_0x30df81){return function(_0x2e8e66){if(_0x2e8e66){return _0x2e8e66['destroy']()[_0x73a8('0xe')](function(){_0x30df81[_0x73a8('0x6')](0xcc)[_0x73a8('0xf')]();});}};}function handleEntityNotFound(_0x43930b){return function(_0x3d6ebc){if(!_0x3d6ebc){_0x43930b['sendStatus'](0x194);}return _0x3d6ebc;};}function handleError(_0x51baba,_0x3a5515){_0x3a5515=_0x3a5515||0x1f4;return function(_0xa7e401){logger[_0x73a8('0x10')](_0xa7e401[_0x73a8('0x11')]);if(_0xa7e401['name']){delete _0xa7e401[_0x73a8('0x12')];}_0x51baba[_0x73a8('0x6')](_0x3a5515)[_0x73a8('0x13')](_0xa7e401);};}exports['index']=function(_0x3056b4,_0x9caf4c){var _0xe4f2aa={},_0x31aa27={},_0x164076={'count':0x0,'rows':[]};var _0x17f724=_[_0x73a8('0x14')](db['Dynamics365Account']['rawAttributes'],function(_0x94ca9a){return{'name':_0x94ca9a['fieldName'],'type':_0x94ca9a[_0x73a8('0x15')]['key']};});_0x31aa27[_0x73a8('0x16')]=_[_0x73a8('0x14')](_0x17f724,'name');_0x31aa27[_0x73a8('0x17')]=_[_0x73a8('0x18')](_0x3056b4[_0x73a8('0x17')]);_0x31aa27[_0x73a8('0x19')]=_['intersection'](_0x31aa27[_0x73a8('0x16')],_0x31aa27[_0x73a8('0x17')]);_0xe4f2aa['attributes']=_[_0x73a8('0x1a')](_0x31aa27[_0x73a8('0x16')],qs[_0x73a8('0x1b')](_0x3056b4[_0x73a8('0x17')][_0x73a8('0x1b')]));_0xe4f2aa[_0x73a8('0x1c')]=_0xe4f2aa[_0x73a8('0x1c')][_0x73a8('0x1d')]?_0xe4f2aa['attributes']:_0x31aa27[_0x73a8('0x16')];if(!_0x3056b4[_0x73a8('0x17')][_0x73a8('0x1e')](_0x73a8('0x1f'))){_0xe4f2aa[_0x73a8('0x8')]=qs[_0x73a8('0x8')](_0x3056b4[_0x73a8('0x17')]['limit']);_0xe4f2aa[_0x73a8('0x7')]=qs[_0x73a8('0x7')](_0x3056b4[_0x73a8('0x17')][_0x73a8('0x7')]);}_0xe4f2aa[_0x73a8('0x20')]=qs['sort'](_0x3056b4[_0x73a8('0x17')][_0x73a8('0x21')]);_0xe4f2aa['where']=qs[_0x73a8('0x19')](_[_0x73a8('0x22')](_0x3056b4[_0x73a8('0x17')],_0x31aa27[_0x73a8('0x19')]),_0x17f724);if(_0x3056b4[_0x73a8('0x17')]['filter']){_0xe4f2aa['where']=_['merge'](_0xe4f2aa['where'],{'$or':_[_0x73a8('0x14')](_0x17f724,function(_0x29ab05){if(_0x29ab05[_0x73a8('0x15')]!==_0x73a8('0x23')){var _0x384e81={};_0x384e81[_0x29ab05[_0x73a8('0x12')]]={'$like':'%'+_0x3056b4[_0x73a8('0x17')][_0x73a8('0x24')]+'%'};return _0x384e81;}})});}_0xe4f2aa=_[_0x73a8('0x25')]({},_0xe4f2aa,_0x3056b4['options']);var _0x3ba41d={'where':_0xe4f2aa[_0x73a8('0x26')]};return db['Dynamics365Account'][_0x73a8('0xa')](_0x3ba41d)[_0x73a8('0xe')](function(_0x561106){_0x164076[_0x73a8('0xa')]=_0x561106;if(_0x3056b4[_0x73a8('0x17')][_0x73a8('0x27')]){_0xe4f2aa[_0x73a8('0x28')]=[{'all':!![]}];}return db[_0x73a8('0x29')][_0x73a8('0x2a')](_0xe4f2aa);})[_0x73a8('0xe')](function(_0x4feb70){_0x164076['rows']=_0x4feb70;return _0x164076;})['then'](respondWithFilteredResult(_0x9caf4c,_0xe4f2aa))[_0x73a8('0x2b')](handleError(_0x9caf4c,null));};exports[_0x73a8('0x2c')]=function(_0x555e57,_0x3506b4){var _0x119bdb={'raw':![],'where':{'id':_0x555e57['params']['id']}},_0x44bda7={};_0x44bda7[_0x73a8('0x16')]=_[_0x73a8('0x18')](db[_0x73a8('0x29')][_0x73a8('0x2d')]);_0x44bda7[_0x73a8('0x17')]=_[_0x73a8('0x18')](_0x555e57[_0x73a8('0x17')]);_0x44bda7[_0x73a8('0x19')]=_[_0x73a8('0x1a')](_0x44bda7[_0x73a8('0x16')],_0x44bda7['query']);_0x119bdb['attributes']=_[_0x73a8('0x1a')](_0x44bda7[_0x73a8('0x16')],qs['fields'](_0x555e57[_0x73a8('0x17')][_0x73a8('0x1b')]));_0x119bdb['attributes']=_0x119bdb[_0x73a8('0x1c')][_0x73a8('0x1d')]?_0x119bdb[_0x73a8('0x1c')]:_0x44bda7[_0x73a8('0x16')];if(_0x555e57[_0x73a8('0x17')][_0x73a8('0x27')]){_0x119bdb['include']=[{'all':!![]}];}_0x119bdb=_[_0x73a8('0x25')]({},_0x119bdb,_0x555e57[_0x73a8('0x2e')]);return db[_0x73a8('0x29')][_0x73a8('0x2f')](_0x119bdb)[_0x73a8('0xe')](handleEntityNotFound(_0x3506b4,null))[_0x73a8('0xe')](respondWithResult(_0x3506b4,null))['catch'](handleError(_0x3506b4,null));};exports['create']=function(_0x149c95,_0x47c7d6){return db[_0x73a8('0x29')][_0x73a8('0x30')](_0x149c95[_0x73a8('0x31')],{})[_0x73a8('0xe')](respondWithResult(_0x47c7d6,0xc9))[_0x73a8('0x2b')](handleError(_0x47c7d6,null));};exports[_0x73a8('0x32')]=function(_0x4fbbd8,_0x2bd09a){if(_0x4fbbd8[_0x73a8('0x31')]['id']){delete _0x4fbbd8[_0x73a8('0x31')]['id'];}return db['Dynamics365Account'][_0x73a8('0x2f')]({'where':{'id':_0x4fbbd8[_0x73a8('0x33')]['id']}})[_0x73a8('0xe')](handleEntityNotFound(_0x2bd09a,null))[_0x73a8('0xe')](saveUpdates(_0x4fbbd8[_0x73a8('0x31')],null))[_0x73a8('0xe')](respondWithResult(_0x2bd09a,null))[_0x73a8('0x2b')](handleError(_0x2bd09a,null));};exports[_0x73a8('0x34')]=function(_0x554de1,_0x3d5ec8){return db['Dynamics365Account']['find']({'where':{'id':_0x554de1[_0x73a8('0x33')]['id']}})[_0x73a8('0xe')](handleEntityNotFound(_0x3d5ec8,null))[_0x73a8('0xe')](removeEntity(_0x3d5ec8,null))['catch'](handleError(_0x3d5ec8,null));};exports['getConfigurations']=function(_0x2b0495,_0x4e338e){var _0x40fb57={};var _0x5809eb={};var _0x529aa0;var _0x321dc5;return db[_0x73a8('0x29')][_0x73a8('0x35')]({'where':{'id':_0x2b0495[_0x73a8('0x33')]['id']}})[_0x73a8('0xe')](handleEntityNotFound(_0x4e338e,null))[_0x73a8('0xe')](function(_0x31ca69){if(_0x31ca69){_0x529aa0=_0x31ca69;_0x5809eb['model']=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x5809eb[_0x73a8('0x17')]=_[_0x73a8('0x18')](_0x2b0495[_0x73a8('0x17')]);_0x5809eb['filters']=_[_0x73a8('0x1a')](_0x5809eb[_0x73a8('0x16')],_0x5809eb[_0x73a8('0x17')]);_0x40fb57[_0x73a8('0x1c')]=_[_0x73a8('0x1a')](_0x5809eb[_0x73a8('0x16')],qs[_0x73a8('0x1b')](_0x2b0495['query'][_0x73a8('0x1b')]));_0x40fb57[_0x73a8('0x1c')]=_0x40fb57[_0x73a8('0x1c')][_0x73a8('0x1d')]?_0x40fb57[_0x73a8('0x1c')]:_0x5809eb[_0x73a8('0x16')];_0x40fb57[_0x73a8('0x20')]=qs[_0x73a8('0x21')](_0x2b0495[_0x73a8('0x17')]['sort']);_0x40fb57[_0x73a8('0x26')]=qs[_0x73a8('0x19')](_[_0x73a8('0x22')](_0x2b0495[_0x73a8('0x17')],_0x5809eb[_0x73a8('0x19')]));if(_0x2b0495['query'][_0x73a8('0x24')]){_0x40fb57[_0x73a8('0x26')]=_[_0x73a8('0x25')](_0x40fb57[_0x73a8('0x26')],{'$or':_[_0x73a8('0x14')](_0x40fb57['attributes'],function(_0x1a5797){var _0x1658a5={};_0x1658a5[_0x1a5797]={'$like':'%'+_0x2b0495[_0x73a8('0x17')]['filter']+'%'};return _0x1658a5;})});}_0x40fb57=_[_0x73a8('0x25')]({},_0x40fb57,_0x2b0495[_0x73a8('0x2e')]);return _0x529aa0[_0x73a8('0x36')](_0x40fb57);}})[_0x73a8('0xe')](function(_0x15b9b6){if(_0x15b9b6){_0x321dc5=_0x15b9b6[_0x73a8('0x1d')];if(!_0x2b0495[_0x73a8('0x17')][_0x73a8('0x1e')]('nolimit')){_0x40fb57[_0x73a8('0x8')]=qs[_0x73a8('0x8')](_0x2b0495[_0x73a8('0x17')][_0x73a8('0x8')]);_0x40fb57['offset']=qs[_0x73a8('0x7')](_0x2b0495['query'][_0x73a8('0x7')]);}return _0x529aa0[_0x73a8('0x36')](_0x40fb57);}})[_0x73a8('0xe')](function(_0x3f2b79){if(_0x3f2b79){return _0x3f2b79?{'count':_0x321dc5,'rows':_0x3f2b79}:null;}})[_0x73a8('0xe')](respondWithResult(_0x4e338e,null))[_0x73a8('0x2b')](handleError(_0x4e338e,null));};exports[_0x73a8('0x37')]=function(_0x714e18,_0x5a9ffe){if(_0x714e18[_0x73a8('0x31')]['id']){delete _0x714e18[_0x73a8('0x31')]['id'];}return db[_0x73a8('0x29')][_0x73a8('0x35')]({'where':{'id':_0x714e18[_0x73a8('0x33')]['id']}})[_0x73a8('0xe')](handleEntityNotFound(_0x5a9ffe,null))[_0x73a8('0xe')](function(_0x20da79){if(_0x20da79){_0x714e18[_0x73a8('0x31')][_0x73a8('0x38')]=_0x20da79['id'];_0x714e18['body'][_0x73a8('0x39')]=integrations[_0x73a8('0x3a')](_0x714e18['body'][_0x73a8('0x3b')],_0x714e18['body']['type']);_0x714e18[_0x73a8('0x31')][_0x73a8('0x3c')]=integrations['getDescriptions'](_0x714e18[_0x73a8('0x31')][_0x73a8('0x3b')],_0x714e18[_0x73a8('0x31')]['type']);return db['Dynamics365Configuration'][_0x73a8('0x30')](_0x714e18['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x73a8('0x39')},{'model':db[_0x73a8('0x3d')],'as':_0x73a8('0x3c')}]});}return null;})[_0x73a8('0xe')](respondWithResult(_0x5a9ffe,null))['catch'](handleError(_0x5a9ffe,null));};function sanitizeRemoteUri(_0x51ae5f){var _0x3b087d=_0x51ae5f[_0x73a8('0x3e')](-0x1);if(_0x3b087d==='/')return _0x51ae5f[_0x73a8('0x3f')](0x0,_0x51ae5f['lastIndexOf'](_0x3b087d));return _0x51ae5f;}function getWebApiUrl(_0x12210e){return util[_0x73a8('0x40')]('%s/api/data/v9.0/',_0x12210e);}exports[_0x73a8('0x41')]=function(_0x242a0d,_0x42cee5){var _0x1eb5ab=_0x242a0d[_0x73a8('0x17')][_0x73a8('0x42')];var _0x17ff1a=_0x1eb5ab==='incident'?_0x73a8('0x43'):_0x73a8('0x44');var _0x2965e1='';var _0x58e07e='';var _0x32ad4f='';var _0x1e0178='';var _0x2e83c5='';var _0x59208f='';var _0x3a4714='';var _0x4605e6='';var _0xeb59d=[_0x73a8('0x45'),'description',_0x73a8('0x46'),_0x73a8('0x47'),_0x73a8('0x48'),_0x73a8('0x49'),_0x73a8('0x4a'),_0x73a8('0x4b'),_0x73a8('0x4c'),_0x73a8('0x4d')];var _0x50c143=[_0x73a8('0x4e'),_0x73a8('0x4f'),_0x73a8('0x50'),_0x73a8('0x51'),_0x73a8('0x52'),_0x73a8('0x53'),_0x73a8('0x54'),_0x73a8('0x55'),_0x73a8('0x56'),_0x73a8('0x57'),'createdbyname',_0x73a8('0x58'),_0x73a8('0x59'),_0x73a8('0x5a'),_0x73a8('0x5b'),'customeridname',_0x73a8('0x5c'),_0x73a8('0x5d'),_0x73a8('0x5e'),_0x73a8('0x5f'),_0x73a8('0x60'),'entityimage_url','escalatedon',_0x73a8('0x61'),_0x73a8('0x62'),'followupby',_0x73a8('0x63'),_0x73a8('0x64'),_0x73a8('0x65'),_0x73a8('0x66'),_0x73a8('0x67'),_0x73a8('0x68'),_0x73a8('0x69'),'modifiedbyname',_0x73a8('0x6a'),_0x73a8('0x6b'),_0x73a8('0x6c'),_0x73a8('0x6d'),_0x73a8('0x6e'),'msdyn_iotalertname',_0x73a8('0x6f'),_0x73a8('0x70'),_0x73a8('0x71'),_0x73a8('0x72'),_0x73a8('0x73'),_0x73a8('0x74'),_0x73a8('0x75'),_0x73a8('0x76'),_0x73a8('0x77'),'prioritycodename',_0x73a8('0x78'),_0x73a8('0x79'),_0x73a8('0x7a'),'resolvebykpiidname',_0x73a8('0x7b'),'responsiblecontactidname','responsiblecontactidyominame',_0x73a8('0x7c'),_0x73a8('0x7d'),_0x73a8('0x7e'),'socialprofileidname',_0x73a8('0x7f'),'statuscode',_0x73a8('0x80'),_0x73a8('0x81'),'timezoneruleversionnumber',_0x73a8('0x82'),_0x73a8('0x83'),'utcconversiontimezonecode',_0x73a8('0x84')];var _0x14a6f3=_0xeb59d[_0x73a8('0x85')](_0x50c143);return db[_0x73a8('0x29')][_0x73a8('0x35')]({'where':{'id':_0x242a0d[_0x73a8('0x33')]['id']},'attributes':['id','username','password','remoteUri','tenantId',_0x73a8('0x86'),_0x73a8('0x87'),'modernAuthentication'],'include':[{'model':db[_0x73a8('0x88')],'as':_0x73a8('0x88'),'attributes':['id','data5',_0x73a8('0x89')]}]})[_0x73a8('0xe')](handleEntityNotFound(_0x42cee5,null))[_0x73a8('0xe')](function(_0x1d5d3e){if(_0x1d5d3e){if(_0x1d5d3e['modernAuthentication']){_0x1d5d3e[_0x73a8('0x8a')]=_0x1d5d3e['CloudProvider'][_0x73a8('0x8b')];_0x4605e6=sanitizeRemoteUri(_0x1d5d3e[_0x73a8('0x88')][_0x73a8('0x89')]);_0x3a4714=getWebApiUrl(_0x4605e6);return _0x1d5d3e;}_0x4605e6=sanitizeRemoteUri(_0x1d5d3e['remoteUri']);_0x3a4714=getWebApiUrl(_0x4605e6);var _0xa1bb24={'method':_0x73a8('0x8c'),'uri':_0x73a8('0x8d')+_0x1d5d3e[_0x73a8('0x8e')]+_0x73a8('0x8f'),'form':{'client_id':_0x1d5d3e[_0x73a8('0x86')],'resource':_0x4605e6,'username':_0x1d5d3e[_0x73a8('0x90')],'password':_0x1d5d3e[_0x73a8('0x91')],'grant_type':'password','client_secret':_0x1d5d3e[_0x73a8('0x87')]},'json':!![]};return rp(_0xa1bb24);}})[_0x73a8('0xe')](function(_0x2d2ca7){_0x59208f=_0x2d2ca7[_0x73a8('0x8a')];var _0x1d8d6f={'method':_0x73a8('0x92'),'uri':encodeURI(_0x3a4714+_0x73a8('0x93')+_0x17ff1a+'\x27'),'headers':{'Authorization':_0x73a8('0x94')+_0x59208f,'If-None-Match':null,'OData-Version':_0x73a8('0x95')},'json':!![]};return rp(_0x1d8d6f);})[_0x73a8('0xe')](function(_0x59738e){var _0xd077c8=_0x59738e[_0x73a8('0x96')][0x0];var _0x16604d=_0xd077c8[_0x73a8('0x97')];var _0x56b039={'method':_0x73a8('0x92'),'uri':_0x3a4714+_0x73a8('0x98')+_0x16604d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x73a8('0x94')+_0x59208f,'If-None-Match':null,'OData-Version':_0x73a8('0x95')},'json':!![]};return rp(_0x56b039);})[_0x73a8('0xe')](function(_0x3fe221){_0x2965e1=_0x3fe221;_0x58e07e=_0x2965e1[_0x73a8('0x99')];_0x58e07e=_[_0x73a8('0x9a')](_0x58e07e,function(_0x1d200b){return!_0x14a6f3[_0x73a8('0x9b')](_0x1d200b[_0x73a8('0x9c')]);});var _0x54f0fd=[];var _0x4af5f4=[];_0x58e07e['forEach'](function(_0xbbcb6c){if(_0xbbcb6c[_0x73a8('0x9d')]){var _0x33b930=_0xbbcb6c[_0x73a8('0x9d')][_0x73a8('0x3f')](_0xbbcb6c[_0x73a8('0x9d')][_0x73a8('0x9e')]('.')+0x1);if(_0x33b930===_0x73a8('0x9f')){_0x54f0fd[_0x73a8('0xa0')](getSelectList(_0x3a4714,_0x1eb5ab,_0x4af5f4,_0x2965e1['MetadataId'],_0xbbcb6c[_0x73a8('0x97')],_0x59208f));}}});return Promise[_0x73a8('0xa1')](_0x54f0fd);})['then'](function(_0x24ad11){_0x32ad4f=_0x24ad11[0x0];var _0x11ab33=[];var _0x2cabb5=[];_0x58e07e[_0x73a8('0xa2')](function(_0x551d79){if(!_[_0x73a8('0xa3')](_0x551d79[_0x73a8('0x9d')])){var _0x5bf012=_0x551d79['@odata.type'][_0x73a8('0x3f')](_0x551d79['@odata.type'][_0x73a8('0x9e')]('.')+0x1);if(_0x5bf012===_0x73a8('0xa4')){_0x11ab33[_0x73a8('0xa0')](getBooleanList(_0x3a4714,_0x1eb5ab,_0x2cabb5,_0x2965e1['MetadataId'],_0x551d79[_0x73a8('0x97')],_0x59208f));}}});return Promise[_0x73a8('0xa1')](_0x11ab33);})['then'](function(_0x5642b5){_0x1e0178=_0x5642b5[0x0];var _0x2f76bd=[];var _0x4c8156=[];_0x58e07e[_0x73a8('0xa2')](function(_0x539ad7){if(_0x539ad7[_0x73a8('0x9d')]){var _0x202908=_0x539ad7[_0x73a8('0x9d')]['substring'](_0x539ad7[_0x73a8('0x9d')][_0x73a8('0x9e')]('.')+0x1);if(_0x202908===_0x73a8('0xa5')||_0x202908===_0x73a8('0xa6')||_0x202908==='BigIntAttributeMetadata'||_0x202908===_0x73a8('0xa7')||_0x202908==='MemoAttributeMetadata'||_0x202908===_0x73a8('0xa8')||_0x202908===_0x73a8('0xa9')||_0x202908===_0x73a8('0xaa')||_0x202908===_0x73a8('0xab')||_0x202908==='DecimalAttributeMetadata'){_0x2f76bd[_0x73a8('0xa0')](getInputList(_0x3a4714,_0x1eb5ab,_0x202908,_0x4c8156,_0x2965e1[_0x73a8('0x97')],_0x539ad7[_0x73a8('0x97')],_0x59208f));}}});return Promise[_0x73a8('0xa1')](_0x2f76bd);})[_0x73a8('0xe')](function(_0x596add){_0x2e83c5=_0x596add[0x0];var _0x15c0e8=_0x32ad4f[_0x73a8('0x85')](_0x1e0178)[_0x73a8('0x85')](_0x2e83c5);var _0x44f082={'count':_0x15c0e8[_0x73a8('0x1d')],'rows':_0x15c0e8};return _0x44f082;})[_0x73a8('0xe')](respondWithResult(_0x42cee5,null))[_0x73a8('0x2b')](function(_0x4101ca){var _0x14701e=_0x242a0d[_0x73a8('0x17')]['test']?0x1f4:_0x4101ca[_0x73a8('0xac')]||0x1f4;logger[_0x73a8('0x10')](_0x4101ca[_0x73a8('0x11')]);delete _0x4101ca[_0x73a8('0x12')];if(_0x14701e===0x191){_0x14701e=0x190;}_0x42cee5[_0x73a8('0x6')](_0x14701e)[_0x73a8('0x13')](_0x242a0d[_0x73a8('0x17')][_0x73a8('0xad')]?{'message':_0x73a8('0xae'),'statusCode':_0x4101ca[_0x73a8('0xac')]}:_0x4101ca);});};function getSelectList(_0x139b33,_0x47e1bd,_0x34a6c5,_0x553108,_0x4a1391,_0xcbd03b){var _0x24f730={'method':_0x73a8('0x92'),'uri':_0x139b33+'EntityDefinitions('+_0x553108+')/Attributes('+_0x4a1391+_0x73a8('0xaf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x73a8('0x94')+_0xcbd03b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x24f730)[_0x73a8('0xe')](function(_0xd61c2a){var _0x21cd8f=[];var _0x1b4934=_0xd61c2a['OptionSet']['Options'];_0x1b4934[_0x73a8('0xa2')](function(_0x51d42d){_0x21cd8f['push']({'name':_0x51d42d[_0x73a8('0xb0')]['UserLocalizedLabel']['Label'],'value':String(_0x51d42d['Value'])});});var _0x112cb9={'id':_0x47e1bd+'_'+_0xd61c2a[_0x73a8('0x9c')],'name':_0xd61c2a['DisplayName'][_0x73a8('0xb1')][_0x73a8('0xb0')],'custom':![],'options':_0x21cd8f};_0x34a6c5[_0x73a8('0xa0')](_0x112cb9);return _0x34a6c5;});}function getBooleanList(_0x547034,_0x4d73d2,_0xf2ebab,_0x258c34,_0x4f08f7,_0x1b44e2){var _0x3def52={'method':_0x73a8('0x92'),'uri':_0x547034+'EntityDefinitions('+_0x258c34+_0x73a8('0xb2')+_0x4f08f7+_0x73a8('0xb3'),'headers':{'Authorization':_0x73a8('0x94')+_0x1b44e2,'If-None-Match':null,'OData-Version':_0x73a8('0x95')},'json':!![]};return rp(_0x3def52)[_0x73a8('0xe')](function(_0x288656){var _0x16cea6=[];_0x16cea6['push']({'name':_0x288656[_0x73a8('0xb4')][_0x73a8('0xb5')][_0x73a8('0xb0')][_0x73a8('0xb1')][_0x73a8('0xb0')],'value':_0x73a8('0xb6')},{'name':_0x288656[_0x73a8('0xb4')][_0x73a8('0xb7')]['Label'][_0x73a8('0xb1')][_0x73a8('0xb0')],'value':_0x73a8('0xb8')});var _0x2e72a6={'id':_0x4d73d2+'_'+_0x288656[_0x73a8('0x9c')],'name':_0x288656['DisplayName']['UserLocalizedLabel'][_0x73a8('0xb0')],'custom':![],'options':_0x16cea6};_0xf2ebab[_0x73a8('0xa0')](_0x2e72a6);return _0xf2ebab;});}function getInputList(_0x52012e,_0x205c60,_0x4c87d0,_0xcd77bc,_0x4a3079,_0x486f9d,_0x4599e7){var _0x2ff13e={'method':_0x73a8('0x92'),'uri':_0x52012e+_0x73a8('0x98')+_0x4a3079+')/Attributes('+_0x486f9d+_0x73a8('0xb9')+_0x4c87d0+_0x73a8('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x4599e7,'If-None-Match':null,'OData-Version':_0x73a8('0x95')},'json':!![]};return rp(_0x2ff13e)['then'](function(_0xfaf3cf){var _0x367a4b={'id':_0x205c60+'_'+_0xfaf3cf[_0x73a8('0x9c')],'name':_0xfaf3cf[_0x73a8('0xbb')][_0x73a8('0xb1')]?_0xfaf3cf[_0x73a8('0xbb')]['UserLocalizedLabel'][_0x73a8('0xb0')]:_0xfaf3cf[_0x73a8('0x9c')],'custom':![],'options':[]};_0xcd77bc[_0x73a8('0xa0')](_0x367a4b);return _0xcd77bc;});} \ No newline at end of file +var _0x0f2a=['description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','DisplayName','request-promise','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','order','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','lastIndexOf','%s/api/data/v9.0/','incident','Incident'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0x0f2a,0x12d));var _0xa0f2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0f2a[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0xa0f2('0x0'));var util=require('util');var _=require(_0xa0f2('0x1'));var qs=require(_0xa0f2('0x2'));var logger=require(_0xa0f2('0x3'))('api');var db=require(_0xa0f2('0x4'))['db'];var integrations=require(_0xa0f2('0x5'));function respondWithResult(_0x1604dc,_0x3fed5e){_0x3fed5e=_0x3fed5e||0xc8;return function(_0x50cbb8){if(_0x50cbb8){return _0x1604dc[_0xa0f2('0x6')](_0x3fed5e)[_0xa0f2('0x7')](_0x50cbb8);}};}function respondWithFilteredResult(_0x56be5b,_0x2f0d1e){return function(_0x28cb){if(_0x28cb){var _0x53de2c=typeof _0x2f0d1e[_0xa0f2('0x8')]==='undefined'&&typeof _0x2f0d1e[_0xa0f2('0x9')]===_0xa0f2('0xa');var _0x429c7e=_0x28cb[_0xa0f2('0xb')];var _0x479814=_0x53de2c?0x0:_0x2f0d1e[_0xa0f2('0x8')];var _0x5763b3=_0x53de2c?_0x28cb['count']:_0x2f0d1e[_0xa0f2('0x8')]+_0x2f0d1e[_0xa0f2('0x9')];var _0x529a69;if(_0x5763b3>=_0x429c7e){_0x5763b3=_0x429c7e;_0x529a69=0xc8;}else{_0x529a69=0xce;}_0x56be5b[_0xa0f2('0x6')](_0x529a69);return _0x56be5b[_0xa0f2('0xc')]('Content-Range',_0x479814+'-'+_0x5763b3+'/'+_0x429c7e)['json'](_0x28cb);}return null;};}function saveUpdates(_0x103214){return function(_0x805a89){if(_0x805a89){return _0x805a89[_0xa0f2('0xd')](_0x103214)[_0xa0f2('0xe')](function(_0x125d55){return _0x125d55;});}return null;};}function removeEntity(_0x4b001b){return function(_0x45a229){if(_0x45a229){return _0x45a229[_0xa0f2('0xf')]()[_0xa0f2('0xe')](function(){_0x4b001b[_0xa0f2('0x6')](0xcc)[_0xa0f2('0x10')]();});}};}function handleEntityNotFound(_0x586c61){return function(_0x34645a){if(!_0x34645a){_0x586c61[_0xa0f2('0x11')](0x194);}return _0x34645a;};}function handleError(_0x36d94b,_0x453d56){_0x453d56=_0x453d56||0x1f4;return function(_0x5867d2){logger[_0xa0f2('0x12')](_0x5867d2[_0xa0f2('0x13')]);if(_0x5867d2[_0xa0f2('0x14')]){delete _0x5867d2['name'];}_0x36d94b[_0xa0f2('0x6')](_0x453d56)[_0xa0f2('0x15')](_0x5867d2);};}exports[_0xa0f2('0x16')]=function(_0x14dca2,_0x5c4955){var _0x87dc3={},_0x1975d2={},_0x25dff3={'count':0x0,'rows':[]};var _0x5b42d9=_['map'](db[_0xa0f2('0x17')][_0xa0f2('0x18')],function(_0x412594){return{'name':_0x412594[_0xa0f2('0x19')],'type':_0x412594[_0xa0f2('0x1a')][_0xa0f2('0x1b')]};});_0x1975d2[_0xa0f2('0x1c')]=_['map'](_0x5b42d9,_0xa0f2('0x14'));_0x1975d2[_0xa0f2('0x1d')]=_[_0xa0f2('0x1e')](_0x14dca2[_0xa0f2('0x1d')]);_0x1975d2[_0xa0f2('0x1f')]=_[_0xa0f2('0x20')](_0x1975d2[_0xa0f2('0x1c')],_0x1975d2[_0xa0f2('0x1d')]);_0x87dc3[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x1975d2[_0xa0f2('0x1c')],qs[_0xa0f2('0x22')](_0x14dca2[_0xa0f2('0x1d')]['fields']));_0x87dc3['attributes']=_0x87dc3[_0xa0f2('0x21')]['length']?_0x87dc3[_0xa0f2('0x21')]:_0x1975d2[_0xa0f2('0x1c')];if(!_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x23')]('nolimit')){_0x87dc3[_0xa0f2('0x9')]=qs[_0xa0f2('0x9')](_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x9')]);_0x87dc3['offset']=qs[_0xa0f2('0x8')](_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x8')]);}_0x87dc3['order']=qs[_0xa0f2('0x24')](_0x14dca2[_0xa0f2('0x1d')]['sort']);_0x87dc3[_0xa0f2('0x25')]=qs[_0xa0f2('0x1f')](_[_0xa0f2('0x26')](_0x14dca2['query'],_0x1975d2[_0xa0f2('0x1f')]),_0x5b42d9);if(_0x14dca2['query'][_0xa0f2('0x27')]){_0x87dc3['where']=_[_0xa0f2('0x28')](_0x87dc3[_0xa0f2('0x25')],{'$or':_['map'](_0x5b42d9,function(_0xf31f3a){if(_0xf31f3a['type']!=='VIRTUAL'){var _0x474438={};_0x474438[_0xf31f3a[_0xa0f2('0x14')]]={'$like':'%'+_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x27')]+'%'};return _0x474438;}})});}_0x87dc3=_[_0xa0f2('0x28')]({},_0x87dc3,_0x14dca2[_0xa0f2('0x29')]);var _0x4fd1c3={'where':_0x87dc3[_0xa0f2('0x25')]};return db[_0xa0f2('0x17')][_0xa0f2('0xb')](_0x4fd1c3)[_0xa0f2('0xe')](function(_0x41c8ee){_0x25dff3[_0xa0f2('0xb')]=_0x41c8ee;if(_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x2a')]){_0x87dc3[_0xa0f2('0x2b')]=[{'all':!![]}];}return db[_0xa0f2('0x17')][_0xa0f2('0x2c')](_0x87dc3);})['then'](function(_0x409110){_0x25dff3[_0xa0f2('0x2d')]=_0x409110;return _0x25dff3;})[_0xa0f2('0xe')](respondWithFilteredResult(_0x5c4955,_0x87dc3))[_0xa0f2('0x2e')](handleError(_0x5c4955,null));};exports[_0xa0f2('0x2f')]=function(_0x27aa08,_0x17dd50){var _0x2a1303={'raw':![],'where':{'id':_0x27aa08['params']['id']}},_0x150714={};_0x150714[_0xa0f2('0x1c')]=_[_0xa0f2('0x1e')](db[_0xa0f2('0x17')][_0xa0f2('0x18')]);_0x150714['query']=_[_0xa0f2('0x1e')](_0x27aa08[_0xa0f2('0x1d')]);_0x150714['filters']=_[_0xa0f2('0x20')](_0x150714[_0xa0f2('0x1c')],_0x150714[_0xa0f2('0x1d')]);_0x2a1303[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x150714[_0xa0f2('0x1c')],qs['fields'](_0x27aa08[_0xa0f2('0x1d')][_0xa0f2('0x22')]));_0x2a1303[_0xa0f2('0x21')]=_0x2a1303[_0xa0f2('0x21')][_0xa0f2('0x30')]?_0x2a1303[_0xa0f2('0x21')]:_0x150714[_0xa0f2('0x1c')];if(_0x27aa08[_0xa0f2('0x1d')][_0xa0f2('0x2a')]){_0x2a1303[_0xa0f2('0x2b')]=[{'all':!![]}];}_0x2a1303=_[_0xa0f2('0x28')]({},_0x2a1303,_0x27aa08[_0xa0f2('0x29')]);return db[_0xa0f2('0x17')][_0xa0f2('0x31')](_0x2a1303)['then'](handleEntityNotFound(_0x17dd50,null))['then'](respondWithResult(_0x17dd50,null))[_0xa0f2('0x2e')](handleError(_0x17dd50,null));};exports[_0xa0f2('0x32')]=function(_0x414565,_0x1af84f){return db[_0xa0f2('0x17')][_0xa0f2('0x32')](_0x414565[_0xa0f2('0x33')],{})[_0xa0f2('0xe')](respondWithResult(_0x1af84f,0xc9))['catch'](handleError(_0x1af84f,null));};exports[_0xa0f2('0xd')]=function(_0x1a2c47,_0x226d01){if(_0x1a2c47[_0xa0f2('0x33')]['id']){delete _0x1a2c47['body']['id'];}return db[_0xa0f2('0x17')][_0xa0f2('0x31')]({'where':{'id':_0x1a2c47['params']['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x226d01,null))[_0xa0f2('0xe')](saveUpdates(_0x1a2c47[_0xa0f2('0x33')],null))[_0xa0f2('0xe')](respondWithResult(_0x226d01,null))['catch'](handleError(_0x226d01,null));};exports['destroy']=function(_0x316658,_0x6990c6){return db[_0xa0f2('0x17')][_0xa0f2('0x31')]({'where':{'id':_0x316658[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x6990c6,null))['then'](removeEntity(_0x6990c6,null))[_0xa0f2('0x2e')](handleError(_0x6990c6,null));};exports[_0xa0f2('0x35')]=function(_0x288a41,_0x199225){var _0x536201={};var _0x584cd5={};var _0x18b256;var _0x2ec6c1;return db[_0xa0f2('0x17')][_0xa0f2('0x36')]({'where':{'id':_0x288a41[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x199225,null))[_0xa0f2('0xe')](function(_0x4d1495){if(_0x4d1495){_0x18b256=_0x4d1495;_0x584cd5[_0xa0f2('0x1c')]=_['keys'](db[_0xa0f2('0x37')][_0xa0f2('0x18')]);_0x584cd5[_0xa0f2('0x1d')]=_['keys'](_0x288a41[_0xa0f2('0x1d')]);_0x584cd5['filters']=_[_0xa0f2('0x20')](_0x584cd5[_0xa0f2('0x1c')],_0x584cd5[_0xa0f2('0x1d')]);_0x536201[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x584cd5[_0xa0f2('0x1c')],qs[_0xa0f2('0x22')](_0x288a41['query'][_0xa0f2('0x22')]));_0x536201[_0xa0f2('0x21')]=_0x536201[_0xa0f2('0x21')][_0xa0f2('0x30')]?_0x536201[_0xa0f2('0x21')]:_0x584cd5[_0xa0f2('0x1c')];_0x536201[_0xa0f2('0x38')]=qs['sort'](_0x288a41['query'][_0xa0f2('0x24')]);_0x536201['where']=qs[_0xa0f2('0x1f')](_['pick'](_0x288a41[_0xa0f2('0x1d')],_0x584cd5[_0xa0f2('0x1f')]));if(_0x288a41['query'][_0xa0f2('0x27')]){_0x536201[_0xa0f2('0x25')]=_[_0xa0f2('0x28')](_0x536201[_0xa0f2('0x25')],{'$or':_[_0xa0f2('0x39')](_0x536201[_0xa0f2('0x21')],function(_0x480710){var _0x3dc141={};_0x3dc141[_0x480710]={'$like':'%'+_0x288a41['query'][_0xa0f2('0x27')]+'%'};return _0x3dc141;})});}_0x536201=_[_0xa0f2('0x28')]({},_0x536201,_0x288a41[_0xa0f2('0x29')]);return _0x18b256[_0xa0f2('0x35')](_0x536201);}})[_0xa0f2('0xe')](function(_0x24655a){if(_0x24655a){_0x2ec6c1=_0x24655a[_0xa0f2('0x30')];if(!_0x288a41[_0xa0f2('0x1d')]['hasOwnProperty']('nolimit')){_0x536201[_0xa0f2('0x9')]=qs[_0xa0f2('0x9')](_0x288a41['query'][_0xa0f2('0x9')]);_0x536201[_0xa0f2('0x8')]=qs['offset'](_0x288a41[_0xa0f2('0x1d')][_0xa0f2('0x8')]);}return _0x18b256['getConfigurations'](_0x536201);}})[_0xa0f2('0xe')](function(_0x4837bf){if(_0x4837bf){return _0x4837bf?{'count':_0x2ec6c1,'rows':_0x4837bf}:null;}})[_0xa0f2('0xe')](respondWithResult(_0x199225,null))[_0xa0f2('0x2e')](handleError(_0x199225,null));};exports[_0xa0f2('0x3a')]=function(_0x418ae6,_0xdfa027){if(_0x418ae6['body']['id']){delete _0x418ae6['body']['id'];}return db[_0xa0f2('0x17')]['findOne']({'where':{'id':_0x418ae6[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0xdfa027,null))[_0xa0f2('0xe')](function(_0x3e6ea0){if(_0x3e6ea0){_0x418ae6[_0xa0f2('0x33')][_0xa0f2('0x3b')]=_0x3e6ea0['id'];_0x418ae6['body'][_0xa0f2('0x3c')]=integrations[_0xa0f2('0x3d')](_0x418ae6['body'][_0xa0f2('0x3e')],_0x418ae6[_0xa0f2('0x33')]['type']);_0x418ae6[_0xa0f2('0x33')]['Descriptions']=integrations[_0xa0f2('0x3f')](_0x418ae6[_0xa0f2('0x33')]['channel'],_0x418ae6[_0xa0f2('0x33')][_0xa0f2('0x1a')]);return db['Dynamics365Configuration']['create'](_0x418ae6[_0xa0f2('0x33')],{'include':[{'model':db[_0xa0f2('0x40')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0xa0f2('0x41')}]});}return null;})[_0xa0f2('0xe')](respondWithResult(_0xdfa027,null))['catch'](handleError(_0xdfa027,null));};function sanitizeRemoteUri(_0x34d634){var _0x56c2e6=_0x34d634[_0xa0f2('0x42')](-0x1);if(_0x56c2e6==='/')return _0x34d634['substring'](0x0,_0x34d634[_0xa0f2('0x43')](_0x56c2e6));return _0x34d634;}function getWebApiUrl(_0xcc957c){return util['format'](_0xa0f2('0x44'),_0xcc957c);}exports['getFields']=function(_0x1e20c1,_0x533f41){var _0x27aea3=_0x1e20c1[_0xa0f2('0x1d')]['ticketType'];var _0x592c33=_0x27aea3===_0xa0f2('0x45')?_0xa0f2('0x46'):'PhoneCall';var _0x1a9f86='';var _0x21b1d5='';var _0x443924='';var _0x4a76e7='';var _0x588188='';var _0x24eedb='';var _0x329586='';var _0x1a3b74='';var _0x2eda05=['title',_0xa0f2('0x47'),_0xa0f2('0x48'),'ownerid',_0xa0f2('0x49'),_0xa0f2('0x4a'),_0xa0f2('0x4b'),_0xa0f2('0x4c'),'directioncode',_0xa0f2('0x4d')];var _0x6581ae=[_0xa0f2('0x4e'),_0xa0f2('0x4f'),_0xa0f2('0x50'),'billedserviceunits',_0xa0f2('0x51'),_0xa0f2('0x52'),'contractdetailidname',_0xa0f2('0x53'),_0xa0f2('0x54'),_0xa0f2('0x55'),_0xa0f2('0x56'),'createdbyyominame',_0xa0f2('0x57'),_0xa0f2('0x58'),'createdonbehalfbyyominame',_0xa0f2('0x59'),_0xa0f2('0x5a'),_0xa0f2('0x5b'),'emailaddress',_0xa0f2('0x5c'),_0xa0f2('0x5d'),_0xa0f2('0x5e'),'escalatedon','exchangerate','firstresponsebykpiidname',_0xa0f2('0x5f'),_0xa0f2('0x60'),'influencescore',_0xa0f2('0x61'),_0xa0f2('0x62'),_0xa0f2('0x63'),_0xa0f2('0x64'),_0xa0f2('0x65'),_0xa0f2('0x66'),_0xa0f2('0x67'),'modifiedon',_0xa0f2('0x68'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xa0f2('0x69'),_0xa0f2('0x6a'),'onholdtime',_0xa0f2('0x6b'),_0xa0f2('0x6c'),_0xa0f2('0x6d'),_0xa0f2('0x6e'),'parentcaseidname','primarycontactidname',_0xa0f2('0x6f'),_0xa0f2('0x70'),_0xa0f2('0x71'),'productserialnumber',_0xa0f2('0x72'),_0xa0f2('0x73'),_0xa0f2('0x74'),'responsiblecontactidname',_0xa0f2('0x75'),_0xa0f2('0x76'),_0xa0f2('0x77'),_0xa0f2('0x78'),_0xa0f2('0x79'),_0xa0f2('0x7a'),_0xa0f2('0x7b'),_0xa0f2('0x7c'),_0xa0f2('0x7d'),_0xa0f2('0x7e'),_0xa0f2('0x7f'),'traversedpath',_0xa0f2('0x80'),_0xa0f2('0x81')];var _0x1a0811=_0x2eda05[_0xa0f2('0x82')](_0x6581ae);return db['Dynamics365Account'][_0xa0f2('0x36')]({'where':{'id':_0x1e20c1['params']['id']},'attributes':['id',_0xa0f2('0x83'),_0xa0f2('0x84'),_0xa0f2('0x85'),_0xa0f2('0x86'),'clientId',_0xa0f2('0x87'),'modernAuthentication'],'include':[{'model':db[_0xa0f2('0x88')],'as':_0xa0f2('0x88'),'attributes':['id',_0xa0f2('0x89'),'data7']}]})['then'](handleEntityNotFound(_0x533f41,null))[_0xa0f2('0xe')](function(_0x28b877){if(_0x28b877){if(_0x28b877['modernAuthentication']){_0x28b877[_0xa0f2('0x8a')]=_0x28b877[_0xa0f2('0x88')][_0xa0f2('0x89')];_0x1a3b74=sanitizeRemoteUri(_0x28b877[_0xa0f2('0x88')][_0xa0f2('0x8b')]);_0x329586=getWebApiUrl(_0x1a3b74);return _0x28b877;}_0x1a3b74=sanitizeRemoteUri(_0x28b877[_0xa0f2('0x85')]);_0x329586=getWebApiUrl(_0x1a3b74);var _0x54aebe={'method':_0xa0f2('0x8c'),'uri':_0xa0f2('0x8d')+_0x28b877[_0xa0f2('0x86')]+'/oauth2/token','form':{'client_id':_0x28b877[_0xa0f2('0x8e')],'resource':_0x1a3b74,'username':_0x28b877[_0xa0f2('0x83')],'password':_0x28b877['password'],'grant_type':'password','client_secret':_0x28b877[_0xa0f2('0x87')]},'json':!![]};return rp(_0x54aebe);}})['then'](function(_0x19a2c0){_0x24eedb=_0x19a2c0['access_token'];var _0x35cb15={'method':_0xa0f2('0x8f'),'uri':encodeURI(_0x329586+_0xa0f2('0x90')+_0x592c33+'\x27'),'headers':{'Authorization':_0xa0f2('0x91')+_0x24eedb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35cb15);})[_0xa0f2('0xe')](function(_0x2b1576){var _0x1f4cf0=_0x2b1576[_0xa0f2('0x92')][0x0];var _0x443477=_0x1f4cf0['MetadataId'];var _0x42a900={'method':_0xa0f2('0x8f'),'uri':_0x329586+_0xa0f2('0x93')+_0x443477+_0xa0f2('0x94'),'headers':{'Authorization':_0xa0f2('0x91')+_0x24eedb,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x42a900);})[_0xa0f2('0xe')](function(_0x33fab1){_0x1a9f86=_0x33fab1;_0x21b1d5=_0x1a9f86[_0xa0f2('0x96')];_0x21b1d5=_[_0xa0f2('0x97')](_0x21b1d5,function(_0x4e8648){return!_0x1a0811[_0xa0f2('0x98')](_0x4e8648[_0xa0f2('0x99')]);});var _0x53cf2e=[];var _0x45c589=[];_0x21b1d5[_0xa0f2('0x9a')](function(_0x444a69){if(_0x444a69['@odata.type']){var _0x206f03=_0x444a69[_0xa0f2('0x9b')][_0xa0f2('0x9c')](_0x444a69[_0xa0f2('0x9b')][_0xa0f2('0x43')]('.')+0x1);if(_0x206f03===_0xa0f2('0x9d')){_0x53cf2e[_0xa0f2('0x9e')](getSelectList(_0x329586,_0x27aea3,_0x45c589,_0x1a9f86['MetadataId'],_0x444a69[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x53cf2e);})[_0xa0f2('0xe')](function(_0x40bb73){_0x443924=_0x40bb73[0x0];var _0x6baae7=[];var _0x425006=[];_0x21b1d5['forEach'](function(_0x6a16b5){if(!_[_0xa0f2('0xa1')](_0x6a16b5[_0xa0f2('0x9b')])){var _0x592dec=_0x6a16b5['@odata.type'][_0xa0f2('0x9c')](_0x6a16b5[_0xa0f2('0x9b')]['lastIndexOf']('.')+0x1);if(_0x592dec===_0xa0f2('0xa2')){_0x6baae7[_0xa0f2('0x9e')](getBooleanList(_0x329586,_0x27aea3,_0x425006,_0x1a9f86[_0xa0f2('0x9f')],_0x6a16b5[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x6baae7);})[_0xa0f2('0xe')](function(_0x295415){_0x4a76e7=_0x295415[0x0];var _0x2cd566=[];var _0xac98b4=[];_0x21b1d5[_0xa0f2('0x9a')](function(_0x4f44c7){if(_0x4f44c7['@odata.type']){var _0x404f42=_0x4f44c7[_0xa0f2('0x9b')][_0xa0f2('0x9c')](_0x4f44c7[_0xa0f2('0x9b')][_0xa0f2('0x43')]('.')+0x1);if(_0x404f42===_0xa0f2('0xa3')||_0x404f42==='DoubleAttributeMetadata'||_0x404f42===_0xa0f2('0xa4')||_0x404f42===_0xa0f2('0xa5')||_0x404f42===_0xa0f2('0xa6')||_0x404f42===_0xa0f2('0xa7')||_0x404f42===_0xa0f2('0xa8')||_0x404f42==='EntityNameAttributeMetadata'||_0x404f42===_0xa0f2('0xa9')||_0x404f42===_0xa0f2('0xaa')){_0x2cd566['push'](getInputList(_0x329586,_0x27aea3,_0x404f42,_0xac98b4,_0x1a9f86['MetadataId'],_0x4f44c7[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x2cd566);})['then'](function(_0x4f4091){_0x588188=_0x4f4091[0x0];var _0x47cd78=_0x443924[_0xa0f2('0x82')](_0x4a76e7)[_0xa0f2('0x82')](_0x588188);var _0x1b7cd1={'count':_0x47cd78['length'],'rows':_0x47cd78};return _0x1b7cd1;})['then'](respondWithResult(_0x533f41,null))[_0xa0f2('0x2e')](function(_0x84e03f){var _0x34435c=_0x1e20c1[_0xa0f2('0x1d')][_0xa0f2('0xab')]?0x1f4:_0x84e03f[_0xa0f2('0xac')]||0x1f4;logger[_0xa0f2('0x12')](_0x84e03f[_0xa0f2('0x13')]);delete _0x84e03f[_0xa0f2('0x14')];if(_0x34435c===0x191){_0x34435c=0x190;}_0x533f41[_0xa0f2('0x6')](_0x34435c)[_0xa0f2('0x15')](_0x1e20c1[_0xa0f2('0x1d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x84e03f['statusCode']}:_0x84e03f);});};function getSelectList(_0x22492d,_0x572faa,_0x329255,_0x53c439,_0x41747b,_0x4fe825){var _0x11392f={'method':_0xa0f2('0x8f'),'uri':_0x22492d+_0xa0f2('0x93')+_0x53c439+_0xa0f2('0xad')+_0x41747b+_0xa0f2('0xae')+_0xa0f2('0xaf'),'headers':{'Authorization':_0xa0f2('0x91')+_0x4fe825,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x11392f)['then'](function(_0x16e082){var _0x12a062=[];var _0x78e63c=_0x16e082[_0xa0f2('0xb0')][_0xa0f2('0xb1')];_0x78e63c[_0xa0f2('0x9a')](function(_0x3b4e7e){_0x12a062[_0xa0f2('0x9e')]({'name':_0x3b4e7e['Label'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'value':String(_0x3b4e7e['Value'])});});var _0x33799e={'id':_0x572faa+'_'+_0x16e082['LogicalName'],'name':_0x16e082['DisplayName'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'custom':![],'options':_0x12a062};_0x329255[_0xa0f2('0x9e')](_0x33799e);return _0x329255;});}function getBooleanList(_0x45d817,_0x3b3847,_0x20bccd,_0x19fd25,_0x168a8f,_0x23e381){var _0x261aef={'method':_0xa0f2('0x8f'),'uri':_0x45d817+_0xa0f2('0x93')+_0x19fd25+_0xa0f2('0xad')+_0x168a8f+_0xa0f2('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x23e381,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x261aef)['then'](function(_0x27554e){var _0x264efc=[];_0x264efc[_0xa0f2('0x9e')]({'name':_0x27554e['OptionSet'][_0xa0f2('0xb5')][_0xa0f2('0xb3')][_0xa0f2('0xb2')]['Label'],'value':_0xa0f2('0xb6')},{'name':_0x27554e[_0xa0f2('0xb0')][_0xa0f2('0xb7')][_0xa0f2('0xb3')][_0xa0f2('0xb2')]['Label'],'value':'false'});var _0x58c981={'id':_0x3b3847+'_'+_0x27554e[_0xa0f2('0x99')],'name':_0x27554e['DisplayName'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'custom':![],'options':_0x264efc};_0x20bccd[_0xa0f2('0x9e')](_0x58c981);return _0x20bccd;});}function getInputList(_0x176361,_0x17225c,_0x58d606,_0x37aa6f,_0x163a2e,_0x32c6ff,_0xedaa13){var _0x54da47={'method':_0xa0f2('0x8f'),'uri':_0x176361+'EntityDefinitions('+_0x163a2e+_0xa0f2('0xad')+_0x32c6ff+')/Microsoft.Dynamics.CRM.'+_0x58d606+_0xa0f2('0xb8'),'headers':{'Authorization':_0xa0f2('0x91')+_0xedaa13,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x54da47)[_0xa0f2('0xe')](function(_0x2c10ee){var _0x4af5d5={'id':_0x17225c+'_'+_0x2c10ee[_0xa0f2('0x99')],'name':_0x2c10ee['DisplayName']['UserLocalizedLabel']?_0x2c10ee[_0xa0f2('0xb9')][_0xa0f2('0xb2')][_0xa0f2('0xb3')]:_0x2c10ee['LogicalName'],'custom':![],'options':[]};_0x37aa6f[_0xa0f2('0x9e')](_0x4af5d5);return _0x37aa6f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c2b1f7f..539429b 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41ef97,_0x701f4){var _0x131d25=function(_0x4cd731){while(--_0x4cd731){_0x41ef97['push'](_0x41ef97['shift']());}};_0x131d25(++_0x701f4);}(_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 logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x32b45c,_0x149a18){var _0x1db19a=function(_0x16ea8a){while(--_0x16ea8a){_0x32b45c['push'](_0x32b45c['shift']());}};_0x1db19a(++_0x149a18);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e9ed387..6e58804 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 _0x7443=['../../config/utils','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','include','map','model','attributes','ShowDynamics365Account','Dynamics365Account','find','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x7443,0xf4));var _0x3744=function(_0x216d84,_0x592540){_0x216d84=_0x216d84-0x0;var _0x115b45=_0x7443[_0x216d84];return _0x115b45;};'use strict';var _=require(_0x3744('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3744('0x1'));var fs=require('fs');var Redis=require(_0x3744('0x2'));var db=require(_0x3744('0x3'))['db'];var utils=require(_0x3744('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3744('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3744('0x6')][_0x3744('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdd0967,_0x3a9c25,_0x5a83b1){return new BPromise(function(_0x5f588e,_0x5c0b60){return client['request'](_0xdd0967,_0x5a83b1)[_0x3744('0x8')](function(_0x4a01a2){logger[_0x3744('0x9')](_0x3744('0xa'),_0x3a9c25,_0x3744('0xb'));logger['debug'](_0x3744('0xc'),_0x3a9c25,_0x3744('0xb'),JSON[_0x3744('0xd')](_0x4a01a2));if(_0x4a01a2[_0x3744('0xe')]){if(_0x4a01a2[_0x3744('0xe')][_0x3744('0xf')]===0x1f4){logger['error'](_0x3744('0xa'),_0x3a9c25,_0x4a01a2[_0x3744('0xe')][_0x3744('0x10')]);return _0x5c0b60(_0x4a01a2[_0x3744('0xe')][_0x3744('0x10')]);}logger[_0x3744('0xe')](_0x3744('0xa'),_0x3a9c25,_0x4a01a2[_0x3744('0xe')][_0x3744('0x10')]);return _0x5f588e(_0x4a01a2[_0x3744('0xe')]['message']);}else{logger[_0x3744('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x3a9c25,_0x3744('0xb'));_0x5f588e(_0x4a01a2[_0x3744('0x11')][_0x3744('0x10')]);}})[_0x3744('0x12')](function(_0x41c51b){logger[_0x3744('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x3a9c25,_0x41c51b);_0x5c0b60(_0x41c51b);});});}exports[_0x3744('0x13')]=function(_0x25c729){var _0x47e67d=this;return new Promise(function(_0x1398e6,_0x5575a7){return db['Dynamics365Account'][_0x3744('0x14')]({'raw':_0x25c729[_0x3744('0x15')]?_0x25c729[_0x3744('0x15')][_0x3744('0x16')]===undefined?!![]:![]:!![],'where':_0x25c729[_0x3744('0x15')]?_0x25c729[_0x3744('0x15')][_0x3744('0x17')]||null:null,'attributes':_0x25c729[_0x3744('0x15')]?_0x25c729[_0x3744('0x15')]['attributes']||null:null,'limit':_0x25c729[_0x3744('0x15')]?_0x25c729[_0x3744('0x15')]['limit']||null:null,'include':_0x25c729['options']?_0x25c729['options'][_0x3744('0x18')]?_[_0x3744('0x19')](_0x25c729['options'][_0x3744('0x18')],function(_0x34587c){return{'model':db[_0x34587c[_0x3744('0x1a')]],'as':_0x34587c['as'],'attributes':_0x34587c['attributes'],'include':_0x34587c[_0x3744('0x18')]?_[_0x3744('0x19')](_0x34587c[_0x3744('0x18')],function(_0x245da8){return{'model':db[_0x245da8['model']],'as':_0x245da8['as'],'attributes':_0x245da8[_0x3744('0x1b')],'include':_0x245da8[_0x3744('0x18')]?_[_0x3744('0x19')](_0x245da8[_0x3744('0x18')],function(_0x5bade1){return{'model':db[_0x5bade1[_0x3744('0x1a')]],'as':_0x5bade1['as'],'attributes':_0x5bade1[_0x3744('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3744('0x8')](function(_0x589928){logger['info'](_0x3744('0x13'),_0x25c729);logger['debug'](_0x3744('0x13'),_0x25c729,JSON['stringify'](_0x589928));_0x1398e6(_0x589928);})[_0x3744('0x12')](function(_0x27e367){logger[_0x3744('0xe')](_0x3744('0x13'),_0x27e367[_0x3744('0x10')],_0x25c729);_0x5575a7(_0x47e67d[_0x3744('0xe')](0x1f4,_0x27e367[_0x3744('0x10')]));});});};exports[_0x3744('0x1c')]=function(_0x3ffcb8){var _0x395552=this;return new Promise(function(_0x144368,_0x3a1269){return db[_0x3744('0x1d')][_0x3744('0x1e')]({'raw':_0x3ffcb8[_0x3744('0x15')]?_0x3ffcb8[_0x3744('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3ffcb8[_0x3744('0x15')]?_0x3ffcb8[_0x3744('0x15')]['where']||null:null,'attributes':_0x3ffcb8[_0x3744('0x15')]?_0x3ffcb8[_0x3744('0x15')][_0x3744('0x1b')]||null:null,'include':_0x3ffcb8[_0x3744('0x15')]?_0x3ffcb8[_0x3744('0x15')][_0x3744('0x18')]?_[_0x3744('0x19')](_0x3ffcb8[_0x3744('0x15')]['include'],function(_0x54e8f9){return{'model':db[_0x54e8f9[_0x3744('0x1a')]],'as':_0x54e8f9['as'],'attributes':_0x54e8f9['attributes'],'include':_0x54e8f9[_0x3744('0x18')]?_['map'](_0x54e8f9['include'],function(_0xfeb823){return{'model':db[_0xfeb823[_0x3744('0x1a')]],'as':_0xfeb823['as'],'attributes':_0xfeb823[_0x3744('0x1b')],'include':_0xfeb823['include']?_[_0x3744('0x19')](_0xfeb823[_0x3744('0x18')],function(_0x2fef7a){return{'model':db[_0x2fef7a['model']],'as':_0x2fef7a['as'],'attributes':_0x2fef7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3744('0x8')](function(_0xbf170a){logger['info']('ShowDynamics365Account',_0x3ffcb8);logger['debug']('ShowDynamics365Account',_0x3ffcb8,JSON[_0x3744('0xd')](_0xbf170a));_0x144368(_0xbf170a);})[_0x3744('0x12')](function(_0x15e847){logger[_0x3744('0xe')](_0x3744('0x1c'),_0x15e847['message'],_0x3ffcb8);_0x3a1269(_0x395552[_0x3744('0xe')](0x1f4,_0x15e847[_0x3744('0x10')]));});});}; \ No newline at end of file +var _0x3f36=['findAll','options','where','limit','map','include','model','attributes','stringify','catch','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','GetDynamics365Account','Dynamics365Account'];(function(_0xdd1ea0,_0x402a68){var _0x59c493=function(_0x514ec0){while(--_0x514ec0){_0xdd1ea0['push'](_0xdd1ea0['shift']());}};_0x59c493(++_0x402a68);}(_0x3f36,0x90));var _0x63f3=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x3f36[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x63f3('0x0'));var util=require(_0x63f3('0x1'));var moment=require('moment');var BPromise=require(_0x63f3('0x2'));var rs=require(_0x63f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x63f3('0x5'))('rpc');var config=require(_0x63f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x63f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ff6a6,_0x4b74f8,_0x5ed7f9){return new BPromise(function(_0x8ec921,_0x13775a){return client[_0x63f3('0x8')](_0x4ff6a6,_0x5ed7f9)[_0x63f3('0x9')](function(_0x55f383){logger[_0x63f3('0xa')](_0x63f3('0xb'),_0x4b74f8,_0x63f3('0xc'));logger[_0x63f3('0xd')](_0x63f3('0xe'),_0x4b74f8,'request\x20sent',JSON['stringify'](_0x55f383));if(_0x55f383[_0x63f3('0xf')]){if(_0x55f383['error'][_0x63f3('0x10')]===0x1f4){logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);return _0x13775a(_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);}logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x55f383[_0x63f3('0xf')]['message']);return _0x8ec921(_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);}else{logger[_0x63f3('0xa')](_0x63f3('0xb'),_0x4b74f8,_0x63f3('0xc'));_0x8ec921(_0x55f383[_0x63f3('0x12')][_0x63f3('0x11')]);}})['catch'](function(_0x25cb36){logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x25cb36);_0x13775a(_0x25cb36);});});}exports[_0x63f3('0x13')]=function(_0x49df22){var _0x2a70f4=this;return new Promise(function(_0x3a35fe,_0x409f94){return db[_0x63f3('0x14')][_0x63f3('0x15')]({'raw':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')][_0x63f3('0x17')]||null:null,'attributes':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['attributes']||null:null,'limit':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')][_0x63f3('0x18')]||null:null,'include':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['include']?_[_0x63f3('0x19')](_0x49df22[_0x63f3('0x16')][_0x63f3('0x1a')],function(_0x58d7dd){return{'model':db[_0x58d7dd[_0x63f3('0x1b')]],'as':_0x58d7dd['as'],'attributes':_0x58d7dd[_0x63f3('0x1c')],'include':_0x58d7dd[_0x63f3('0x1a')]?_['map'](_0x58d7dd['include'],function(_0x32b7d6){return{'model':db[_0x32b7d6[_0x63f3('0x1b')]],'as':_0x32b7d6['as'],'attributes':_0x32b7d6[_0x63f3('0x1c')],'include':_0x32b7d6['include']?_[_0x63f3('0x19')](_0x32b7d6[_0x63f3('0x1a')],function(_0x30a880){return{'model':db[_0x30a880[_0x63f3('0x1b')]],'as':_0x30a880['as'],'attributes':_0x30a880[_0x63f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x63f3('0x9')](function(_0x30cc43){logger['info']('GetDynamics365Account',_0x49df22);logger[_0x63f3('0xd')](_0x63f3('0x13'),_0x49df22,JSON[_0x63f3('0x1d')](_0x30cc43));_0x3a35fe(_0x30cc43);})[_0x63f3('0x1e')](function(_0xb55ae8){logger[_0x63f3('0xf')](_0x63f3('0x13'),_0xb55ae8[_0x63f3('0x11')],_0x49df22);_0x409f94(_0x2a70f4['error'](0x1f4,_0xb55ae8['message']));});});};exports[_0x63f3('0x1f')]=function(_0x5c633b){var _0x509bd6=this;return new Promise(function(_0x5c2716,_0x3bcbb4){return db['Dynamics365Account'][_0x63f3('0x20')]({'raw':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x17')]||null:null,'attributes':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1c')]||null:null,'include':_0x5c633b['options']?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1a')]?_['map'](_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1a')],function(_0x4c7a85){return{'model':db[_0x4c7a85[_0x63f3('0x1b')]],'as':_0x4c7a85['as'],'attributes':_0x4c7a85[_0x63f3('0x1c')],'include':_0x4c7a85[_0x63f3('0x1a')]?_[_0x63f3('0x19')](_0x4c7a85[_0x63f3('0x1a')],function(_0x3b5cb3){return{'model':db[_0x3b5cb3[_0x63f3('0x1b')]],'as':_0x3b5cb3['as'],'attributes':_0x3b5cb3[_0x63f3('0x1c')],'include':_0x3b5cb3['include']?_[_0x63f3('0x19')](_0x3b5cb3[_0x63f3('0x1a')],function(_0x3f6201){return{'model':db[_0x3f6201['model']],'as':_0x3f6201['as'],'attributes':_0x3f6201['attributes']};}):[]};}):[]};}):[]:[]})[_0x63f3('0x9')](function(_0x28a99f){logger['info'](_0x63f3('0x1f'),_0x5c633b);logger[_0x63f3('0xd')](_0x63f3('0x1f'),_0x5c633b,JSON[_0x63f3('0x1d')](_0x28a99f));_0x5c2716(_0x28a99f);})['catch'](function(_0x447935){logger[_0x63f3('0xf')]('ShowDynamics365Account',_0x447935[_0x63f3('0x11')],_0x5c633b);_0x3bcbb4(_0x509bd6['error'](0x1f4,_0x447935['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d76188d..b683521 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 _0xbaca=['get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x2567a0,_0x1847de){var _0x5f47f5=function(_0x2d2af7){while(--_0x2d2af7){_0x2567a0['push'](_0x2567a0['shift']());}};_0x5f47f5(++_0x1847de);}(_0xbaca,0xfc));var _0xabac=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0xbaca[_0x30c7c5];return _0x29e24e;};'use strict';var multer=require(_0xabac('0x0'));var util=require(_0xabac('0x1'));var path=require('path');var timeout=require(_0xabac('0x2'));var express=require(_0xabac('0x3'));var router=express['Router']();var fs_extra=require(_0xabac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xabac('0x5'));var config=require(_0xabac('0x6'));var controller=require(_0xabac('0x7'));router[_0xabac('0x8')]('/',auth[_0xabac('0x9')](),controller['index']);router['get'](_0xabac('0xa'),auth[_0xabac('0x9')](),controller['show']);router['get'](_0xabac('0xb'),auth[_0xabac('0x9')](),controller[_0xabac('0xc')]);router['get'](_0xabac('0xd'),auth[_0xabac('0x9')](),controller['getSubjects']);router[_0xabac('0x8')]('/:id/descriptions',auth[_0xabac('0x9')](),controller[_0xabac('0xe')]);router[_0xabac('0xf')]('/',auth['isAuthenticated'](),controller[_0xabac('0x10')]);router[_0xabac('0x11')](_0xabac('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xabac('0xa'),auth[_0xabac('0x9')](),controller[_0xabac('0x12')]);module[_0xabac('0x13')]=router; \ No newline at end of file +var _0x5323=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','/:id'];(function(_0x2d582c,_0x424a15){var _0x37e92a=function(_0x142fb1){while(--_0x142fb1){_0x2d582c['push'](_0x2d582c['shift']());}};_0x37e92a(++_0x424a15);}(_0x5323,0x88));var _0x3532=function(_0x393826,_0x5d573c){_0x393826=_0x393826-0x0;var _0x585b2d=_0x5323[_0x393826];return _0x585b2d;};'use strict';var multer=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var path=require(_0x3532('0x2'));var timeout=require(_0x3532('0x3'));var express=require(_0x3532('0x4'));var router=express['Router']();var fs_extra=require(_0x3532('0x5'));var auth=require(_0x3532('0x6'));var interaction=require(_0x3532('0x7'));var config=require('../../config/environment');var controller=require(_0x3532('0x8'));router[_0x3532('0x9')]('/',auth[_0x3532('0xa')](),controller['index']);router[_0x3532('0x9')]('/:id',auth[_0x3532('0xa')](),controller['show']);router[_0x3532('0x9')](_0x3532('0xb'),auth['isAuthenticated'](),controller[_0x3532('0xc')]);router[_0x3532('0x9')](_0x3532('0xd'),auth[_0x3532('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3532('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3532('0xf')]);router[_0x3532('0x10')](_0x3532('0x11'),auth['isAuthenticated'](),controller[_0x3532('0x12')]);router[_0x3532('0x13')]('/:id',auth[_0x3532('0xa')](),controller[_0x3532('0x14')]);module[_0x3532('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index fdaf5b6..c1c773c 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 _0xf439=['STRING','ENUM','incident','phonecall','nothing','contact','BOOLEAN','sequelize','exports'];(function(_0x4df747,_0x3fbecf){var _0x2112f3=function(_0x5ceab6){while(--_0x5ceab6){_0x4df747['push'](_0x4df747['shift']());}};_0x2112f3(++_0x3fbecf);}(_0xf439,0x1ed));var _0x9f43=function(_0x40daf6,_0x4f976f){_0x40daf6=_0x40daf6-0x0;var _0x56435c=_0xf439[_0x40daf6];return _0x56435c;};'use strict';var Sequelize=require(_0x9f43('0x0'));module[_0x9f43('0x1')]={'name':{'type':Sequelize[_0x9f43('0x2')]},'description':{'type':Sequelize[_0x9f43('0x2')]},'ticketType':{'type':Sequelize[_0x9f43('0x3')](_0x9f43('0x4'),_0x9f43('0x5')),'defaultValue':_0x9f43('0x4')},'moduleCreate':{'type':Sequelize[_0x9f43('0x3')]('contact',_0x9f43('0x6')),'defaultValue':_0x9f43('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9f43('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9f43('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x84f3=['exports','STRING','ENUM','incident','phonecall','contact','sequelize'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x84f3,0xe6));var _0x384f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x84f3[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x384f('0x0'));module[_0x384f('0x1')]={'name':{'type':Sequelize[_0x384f('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x384f('0x3')](_0x384f('0x4'),_0x384f('0x5')),'defaultValue':_0x384f('0x4')},'moduleCreate':{'type':Sequelize[_0x384f('0x3')](_0x384f('0x6'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x384f('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ace84d0..132c873 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 _0x64b8=['length','hasOwnProperty','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','params','keys','options','create','body','find','getFields','findOne','Dynamics365Field','order','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x64b8,0x1aa));var _0x864b=function(_0x4458d7,_0xb46535){_0x4458d7=_0x4458d7-0x0;var _0x538fca=_0x64b8[_0x4458d7];return _0x538fca;};'use strict';var emlformat=require(_0x864b('0x0'));var rimraf=require(_0x864b('0x1'));var zipdir=require(_0x864b('0x2'));var jsonpatch=require(_0x864b('0x3'));var rp=require(_0x864b('0x4'));var moment=require('moment');var BPromise=require(_0x864b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x864b('0x6'));var sox=require(_0x864b('0x7'));var csv=require(_0x864b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x864b('0x9'));var _=require(_0x864b('0xa'));var squel=require(_0x864b('0xb'));var crypto=require('crypto');var jsforce=require(_0x864b('0xc'));var deskjs=require(_0x864b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x864b('0xe'));var Papa=require('papaparse');var Redis=require(_0x864b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x864b('0x10'));var as=require(_0x864b('0x11'));var hardwareService=require(_0x864b('0x12'));var logger=require(_0x864b('0x13'))(_0x864b('0x14'));var utils=require(_0x864b('0x15'));var config=require(_0x864b('0x16'));var licenseUtil=require(_0x864b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37488c,_0xb345ec){_0xb345ec=_0xb345ec||0xcc;return function(_0x190217){if(_0x190217){return _0x37488c[_0x864b('0x18')](_0xb345ec);}return _0x37488c[_0x864b('0x19')](_0xb345ec)[_0x864b('0x1a')]();};}function respondWithResult(_0x1557b3,_0x1a9281){_0x1a9281=_0x1a9281||0xc8;return function(_0x385580){if(_0x385580){return _0x1557b3[_0x864b('0x19')](_0x1a9281)[_0x864b('0x1b')](_0x385580);}};}function respondWithFilteredResult(_0x1bc07d,_0x10c93d){return function(_0x4a1131){if(_0x4a1131){var _0x4df77c=typeof _0x10c93d['offset']==='undefined'&&typeof _0x10c93d[_0x864b('0x1c')]===_0x864b('0x1d');var _0x1ba78c=_0x4a1131[_0x864b('0x1e')];var _0x3ffff5=_0x4df77c?0x0:_0x10c93d[_0x864b('0x1f')];var _0x430c93=_0x4df77c?_0x4a1131[_0x864b('0x1e')]:_0x10c93d['offset']+_0x10c93d[_0x864b('0x1c')];var _0xacc938;if(_0x430c93>=_0x1ba78c){_0x430c93=_0x1ba78c;_0xacc938=0xc8;}else{_0xacc938=0xce;}_0x1bc07d[_0x864b('0x19')](_0xacc938);return _0x1bc07d[_0x864b('0x20')](_0x864b('0x21'),_0x3ffff5+'-'+_0x430c93+'/'+_0x1ba78c)[_0x864b('0x1b')](_0x4a1131);}return null;};}function patchUpdates(_0xa84f82){return function(_0x456862){try{jsonpatch['apply'](_0x456862,_0xa84f82,!![]);}catch(_0x2178a9){return BPromise[_0x864b('0x22')](_0x2178a9);}return _0x456862[_0x864b('0x23')]();};}function saveUpdates(_0x4c6150,_0x3e65c6){return function(_0x566309){if(_0x566309){return _0x566309[_0x864b('0x24')](_0x4c6150)['then'](function(_0x21451c){return _0x21451c;});}return null;};}function removeEntity(_0x18e326,_0x4a009b){return function(_0x1b794d){if(_0x1b794d){return _0x1b794d[_0x864b('0x25')]()[_0x864b('0x26')](function(){_0x18e326[_0x864b('0x19')](0xcc)[_0x864b('0x1a')]();});}};}function handleEntityNotFound(_0x20a9c2,_0x6a168e){return function(_0x560d10){if(!_0x560d10){_0x20a9c2[_0x864b('0x18')](0x194);}return _0x560d10;};}function handleError(_0x1e46a4,_0x1729ea){_0x1729ea=_0x1729ea||0x1f4;return function(_0x2c0233){logger[_0x864b('0x27')](_0x2c0233[_0x864b('0x28')]);if(_0x2c0233[_0x864b('0x29')]){delete _0x2c0233[_0x864b('0x29')];}_0x1e46a4[_0x864b('0x19')](_0x1729ea)[_0x864b('0x2a')](_0x2c0233);};}exports[_0x864b('0x2b')]=function(_0x3c784d,_0x5c6803){var _0x1a6bbb={},_0x18976c={},_0x2cb018={'count':0x0,'rows':[]};var _0x53dec8=_[_0x864b('0x2c')](db[_0x864b('0x2d')][_0x864b('0x2e')],function(_0x8e9cef){return{'name':_0x8e9cef[_0x864b('0x2f')],'type':_0x8e9cef['type']['key']};});_0x18976c[_0x864b('0x30')]=_[_0x864b('0x2c')](_0x53dec8,_0x864b('0x29'));_0x18976c['query']=_['keys'](_0x3c784d[_0x864b('0x31')]);_0x18976c[_0x864b('0x32')]=_[_0x864b('0x33')](_0x18976c[_0x864b('0x30')],_0x18976c[_0x864b('0x31')]);_0x1a6bbb['attributes']=_['intersection'](_0x18976c['model'],qs[_0x864b('0x34')](_0x3c784d['query'][_0x864b('0x34')]));_0x1a6bbb[_0x864b('0x35')]=_0x1a6bbb['attributes'][_0x864b('0x36')]?_0x1a6bbb[_0x864b('0x35')]:_0x18976c[_0x864b('0x30')];if(!_0x3c784d[_0x864b('0x31')][_0x864b('0x37')]('nolimit')){_0x1a6bbb[_0x864b('0x1c')]=qs[_0x864b('0x1c')](_0x3c784d[_0x864b('0x31')][_0x864b('0x1c')]);_0x1a6bbb[_0x864b('0x1f')]=qs[_0x864b('0x1f')](_0x3c784d[_0x864b('0x31')][_0x864b('0x1f')]);}_0x1a6bbb['order']=qs[_0x864b('0x38')](_0x3c784d[_0x864b('0x31')][_0x864b('0x38')]);_0x1a6bbb[_0x864b('0x39')]=qs[_0x864b('0x32')](_['pick'](_0x3c784d[_0x864b('0x31')],_0x18976c[_0x864b('0x32')]),_0x53dec8);if(_0x3c784d[_0x864b('0x31')][_0x864b('0x3a')]){_0x1a6bbb[_0x864b('0x39')]=_[_0x864b('0x3b')](_0x1a6bbb[_0x864b('0x39')],{'$or':_[_0x864b('0x2c')](_0x53dec8,function(_0x509d2e){if(_0x509d2e[_0x864b('0x3c')]!=='VIRTUAL'){var _0x7c591a={};_0x7c591a[_0x509d2e['name']]={'$like':'%'+_0x3c784d[_0x864b('0x31')][_0x864b('0x3a')]+'%'};return _0x7c591a;}})});}_0x1a6bbb=_[_0x864b('0x3b')]({},_0x1a6bbb,_0x3c784d['options']);var _0x23407a={'where':_0x1a6bbb[_0x864b('0x39')]};return db[_0x864b('0x2d')][_0x864b('0x1e')](_0x23407a)[_0x864b('0x26')](function(_0x17fb64){_0x2cb018[_0x864b('0x1e')]=_0x17fb64;if(_0x3c784d[_0x864b('0x31')][_0x864b('0x3d')]){_0x1a6bbb[_0x864b('0x3e')]=[{'all':!![]}];}return db[_0x864b('0x2d')][_0x864b('0x3f')](_0x1a6bbb);})['then'](function(_0x12ba91){_0x2cb018[_0x864b('0x40')]=_0x12ba91;return _0x2cb018;})[_0x864b('0x26')](respondWithFilteredResult(_0x5c6803,_0x1a6bbb))[_0x864b('0x41')](handleError(_0x5c6803,null));};exports['show']=function(_0x105c66,_0x2dccec){var _0x31c72c={'raw':![],'where':{'id':_0x105c66[_0x864b('0x42')]['id']}},_0xe10354={};_0xe10354[_0x864b('0x30')]=_[_0x864b('0x43')](db[_0x864b('0x2d')][_0x864b('0x2e')]);_0xe10354[_0x864b('0x31')]=_['keys'](_0x105c66[_0x864b('0x31')]);_0xe10354[_0x864b('0x32')]=_[_0x864b('0x33')](_0xe10354[_0x864b('0x30')],_0xe10354[_0x864b('0x31')]);_0x31c72c[_0x864b('0x35')]=_[_0x864b('0x33')](_0xe10354[_0x864b('0x30')],qs[_0x864b('0x34')](_0x105c66[_0x864b('0x31')][_0x864b('0x34')]));_0x31c72c[_0x864b('0x35')]=_0x31c72c[_0x864b('0x35')][_0x864b('0x36')]?_0x31c72c[_0x864b('0x35')]:_0xe10354[_0x864b('0x30')];if(_0x105c66['query'][_0x864b('0x3d')]){_0x31c72c['include']=[{'all':!![]}];}_0x31c72c=_[_0x864b('0x3b')]({},_0x31c72c,_0x105c66[_0x864b('0x44')]);return db[_0x864b('0x2d')]['find'](_0x31c72c)[_0x864b('0x26')](handleEntityNotFound(_0x2dccec,null))['then'](respondWithResult(_0x2dccec,null))[_0x864b('0x41')](handleError(_0x2dccec,null));};exports[_0x864b('0x45')]=function(_0xf6d544,_0x2d21ad){return db[_0x864b('0x2d')][_0x864b('0x45')](_0xf6d544[_0x864b('0x46')],{})[_0x864b('0x26')](respondWithResult(_0x2d21ad,0xc9))[_0x864b('0x41')](handleError(_0x2d21ad,null));};exports[_0x864b('0x24')]=function(_0x237736,_0x1732b3){if(_0x237736[_0x864b('0x46')]['id']){delete _0x237736[_0x864b('0x46')]['id'];}return db[_0x864b('0x2d')][_0x864b('0x47')]({'where':{'id':_0x237736[_0x864b('0x42')]['id']}})[_0x864b('0x26')](handleEntityNotFound(_0x1732b3,null))[_0x864b('0x26')](saveUpdates(_0x237736[_0x864b('0x46')],null))[_0x864b('0x26')](respondWithResult(_0x1732b3,null))['catch'](handleError(_0x1732b3,null));};exports['destroy']=function(_0x1db115,_0x49474b){return db[_0x864b('0x2d')][_0x864b('0x47')]({'where':{'id':_0x1db115[_0x864b('0x42')]['id']}})[_0x864b('0x26')](handleEntityNotFound(_0x49474b,null))[_0x864b('0x26')](removeEntity(_0x49474b,null))[_0x864b('0x41')](handleError(_0x49474b,null));};exports[_0x864b('0x48')]=function(_0x56475d,_0x3a05d8,_0x5a53e6){var _0x4d6d00={};var _0x9ce6e5={};var _0x5eb6b3;var _0x1dbbd2;return db['Dynamics365Configuration'][_0x864b('0x49')]({'where':{'id':_0x56475d[_0x864b('0x42')]['id']}})[_0x864b('0x26')](handleEntityNotFound(_0x3a05d8,null))[_0x864b('0x26')](function(_0x2e47e6){if(_0x2e47e6){_0x5eb6b3=_0x2e47e6;_0x9ce6e5[_0x864b('0x30')]=_[_0x864b('0x43')](db[_0x864b('0x4a')][_0x864b('0x2e')]);_0x9ce6e5[_0x864b('0x31')]=_[_0x864b('0x43')](_0x56475d[_0x864b('0x31')]);_0x9ce6e5[_0x864b('0x32')]=_['intersection'](_0x9ce6e5['model'],_0x9ce6e5[_0x864b('0x31')]);_0x4d6d00['attributes']=_[_0x864b('0x33')](_0x9ce6e5['model'],qs[_0x864b('0x34')](_0x56475d[_0x864b('0x31')][_0x864b('0x34')]));_0x4d6d00[_0x864b('0x35')]=_0x4d6d00[_0x864b('0x35')][_0x864b('0x36')]?_0x4d6d00[_0x864b('0x35')]:_0x9ce6e5[_0x864b('0x30')];_0x4d6d00[_0x864b('0x4b')]=qs[_0x864b('0x38')](_0x56475d[_0x864b('0x31')][_0x864b('0x38')]);_0x4d6d00[_0x864b('0x39')]=qs[_0x864b('0x32')](_[_0x864b('0x4c')](_0x56475d['query'],_0x9ce6e5[_0x864b('0x32')]));if(_0x56475d[_0x864b('0x31')][_0x864b('0x3a')]){_0x4d6d00[_0x864b('0x39')]=_[_0x864b('0x3b')](_0x4d6d00[_0x864b('0x39')],{'$or':_[_0x864b('0x2c')](_0x4d6d00['attributes'],function(_0x1f251a){var _0x121c15={};_0x121c15[_0x1f251a]={'$like':'%'+_0x56475d[_0x864b('0x31')][_0x864b('0x3a')]+'%'};return _0x121c15;})});}_0x4d6d00=_[_0x864b('0x3b')]({},_0x4d6d00,_0x56475d[_0x864b('0x44')]);return _0x5eb6b3[_0x864b('0x48')](_0x4d6d00);}})['then'](function(_0xb64ab2){if(_0xb64ab2){_0x1dbbd2=_0xb64ab2['length'];if(!_0x56475d[_0x864b('0x31')]['hasOwnProperty'](_0x864b('0x4d'))){_0x4d6d00[_0x864b('0x1c')]=qs[_0x864b('0x1c')](_0x56475d['query'][_0x864b('0x1c')]);_0x4d6d00[_0x864b('0x1f')]=qs[_0x864b('0x1f')](_0x56475d['query'][_0x864b('0x1f')]);}return _0x5eb6b3[_0x864b('0x48')](_0x4d6d00);}})[_0x864b('0x26')](function(_0x268ed1){if(_0x268ed1){return _0x268ed1?{'count':_0x1dbbd2,'rows':_0x268ed1}:null;}})[_0x864b('0x26')](respondWithResult(_0x3a05d8,null))[_0x864b('0x41')](handleError(_0x3a05d8,null));};exports['getSubjects']=function(_0x2dee54,_0x16d692,_0x4217a4){var _0x39a188={};var _0x2a57d5={};var _0x91cafb;var _0x5deeda;return db[_0x864b('0x2d')][_0x864b('0x49')]({'where':{'id':_0x2dee54[_0x864b('0x42')]['id']}})[_0x864b('0x26')](handleEntityNotFound(_0x16d692,null))['then'](function(_0x2b525b){if(_0x2b525b){_0x91cafb=_0x2b525b;_0x2a57d5[_0x864b('0x30')]=_['keys'](db[_0x864b('0x4a')][_0x864b('0x2e')]);_0x2a57d5[_0x864b('0x31')]=_[_0x864b('0x43')](_0x2dee54['query']);_0x2a57d5[_0x864b('0x32')]=_[_0x864b('0x33')](_0x2a57d5[_0x864b('0x30')],_0x2a57d5[_0x864b('0x31')]);_0x39a188['attributes']=_['intersection'](_0x2a57d5['model'],qs['fields'](_0x2dee54[_0x864b('0x31')][_0x864b('0x34')]));_0x39a188['attributes']=_0x39a188[_0x864b('0x35')]['length']?_0x39a188[_0x864b('0x35')]:_0x2a57d5[_0x864b('0x30')];_0x39a188['order']=qs[_0x864b('0x38')](_0x2dee54[_0x864b('0x31')][_0x864b('0x38')]);_0x39a188[_0x864b('0x39')]=qs['filters'](_[_0x864b('0x4c')](_0x2dee54['query'],_0x2a57d5[_0x864b('0x32')]));if(_0x2dee54['query'][_0x864b('0x3a')]){_0x39a188[_0x864b('0x39')]=_[_0x864b('0x3b')](_0x39a188[_0x864b('0x39')],{'$or':_[_0x864b('0x2c')](_0x39a188[_0x864b('0x35')],function(_0x3bb62a){var _0x43d9a6={};_0x43d9a6[_0x3bb62a]={'$like':'%'+_0x2dee54['query'][_0x864b('0x3a')]+'%'};return _0x43d9a6;})});}_0x39a188=_['merge']({},_0x39a188,_0x2dee54[_0x864b('0x44')]);return _0x91cafb[_0x864b('0x4e')](_0x39a188);}})[_0x864b('0x26')](function(_0x11bd5b){if(_0x11bd5b){_0x5deeda=_0x11bd5b[_0x864b('0x36')];if(!_0x2dee54['query'][_0x864b('0x37')](_0x864b('0x4d'))){_0x39a188[_0x864b('0x1c')]=qs[_0x864b('0x1c')](_0x2dee54['query'][_0x864b('0x1c')]);_0x39a188['offset']=qs[_0x864b('0x1f')](_0x2dee54['query'][_0x864b('0x1f')]);}return _0x91cafb[_0x864b('0x4e')](_0x39a188);}})['then'](function(_0x288a56){if(_0x288a56){return _0x288a56?{'count':_0x5deeda,'rows':_0x288a56}:null;}})[_0x864b('0x26')](respondWithResult(_0x16d692,null))[_0x864b('0x41')](handleError(_0x16d692,null));};exports[_0x864b('0x4f')]=function(_0x14dbf2,_0x2b3788,_0x5441ee){var _0x1c7f64={};var _0x427bcd={};var _0x5a170d;var _0x38fa6e;return db[_0x864b('0x2d')][_0x864b('0x49')]({'where':{'id':_0x14dbf2[_0x864b('0x42')]['id']}})[_0x864b('0x26')](handleEntityNotFound(_0x2b3788,null))[_0x864b('0x26')](function(_0x305b71){if(_0x305b71){_0x5a170d=_0x305b71;_0x427bcd[_0x864b('0x30')]=_[_0x864b('0x43')](db['Dynamics365Field'][_0x864b('0x2e')]);_0x427bcd[_0x864b('0x31')]=_[_0x864b('0x43')](_0x14dbf2['query']);_0x427bcd[_0x864b('0x32')]=_[_0x864b('0x33')](_0x427bcd[_0x864b('0x30')],_0x427bcd[_0x864b('0x31')]);_0x1c7f64[_0x864b('0x35')]=_[_0x864b('0x33')](_0x427bcd['model'],qs[_0x864b('0x34')](_0x14dbf2[_0x864b('0x31')][_0x864b('0x34')]));_0x1c7f64[_0x864b('0x35')]=_0x1c7f64[_0x864b('0x35')][_0x864b('0x36')]?_0x1c7f64[_0x864b('0x35')]:_0x427bcd['model'];_0x1c7f64[_0x864b('0x4b')]=qs[_0x864b('0x38')](_0x14dbf2[_0x864b('0x31')][_0x864b('0x38')]);_0x1c7f64[_0x864b('0x39')]=qs[_0x864b('0x32')](_['pick'](_0x14dbf2[_0x864b('0x31')],_0x427bcd[_0x864b('0x32')]));if(_0x14dbf2[_0x864b('0x31')][_0x864b('0x3a')]){_0x1c7f64[_0x864b('0x39')]=_['merge'](_0x1c7f64[_0x864b('0x39')],{'$or':_[_0x864b('0x2c')](_0x1c7f64[_0x864b('0x35')],function(_0x4c2ca3){var _0x5aec84={};_0x5aec84[_0x4c2ca3]={'$like':'%'+_0x14dbf2['query'][_0x864b('0x3a')]+'%'};return _0x5aec84;})});}_0x1c7f64=_[_0x864b('0x3b')]({},_0x1c7f64,_0x14dbf2[_0x864b('0x44')]);return _0x5a170d[_0x864b('0x4f')](_0x1c7f64);}})['then'](function(_0x3cc4a3){if(_0x3cc4a3){_0x38fa6e=_0x3cc4a3[_0x864b('0x36')];if(!_0x14dbf2['query'][_0x864b('0x37')](_0x864b('0x4d'))){_0x1c7f64[_0x864b('0x1c')]=qs[_0x864b('0x1c')](_0x14dbf2[_0x864b('0x31')][_0x864b('0x1c')]);_0x1c7f64['offset']=qs[_0x864b('0x1f')](_0x14dbf2['query'][_0x864b('0x1f')]);}return _0x5a170d['getDescriptions'](_0x1c7f64);}})['then'](function(_0x4400b2){if(_0x4400b2){return _0x4400b2?{'count':_0x38fa6e,'rows':_0x4400b2}:null;}})[_0x864b('0x26')](respondWithResult(_0x2b3788,null))[_0x864b('0x41')](handleError(_0x2b3788,null));}; \ No newline at end of file +var _0x7468=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','fieldName','key','model','query','keys','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','getFields','findOne','Dynamics365Field','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce'];(function(_0xbe7320,_0x106a76){var _0x43f0a9=function(_0x1ecd82){while(--_0x1ecd82){_0xbe7320['push'](_0xbe7320['shift']());}};_0x43f0a9(++_0x106a76);}(_0x7468,0x94));var _0x8746=function(_0x216cd8,_0x1e1661){_0x216cd8=_0x216cd8-0x0;var _0x4ee5d4=_0x7468[_0x216cd8];return _0x4ee5d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8746('0x0'));var zipdir=require(_0x8746('0x1'));var jsonpatch=require(_0x8746('0x2'));var rp=require('request-promise');var moment=require(_0x8746('0x3'));var BPromise=require(_0x8746('0x4'));var Mustache=require(_0x8746('0x5'));var util=require(_0x8746('0x6'));var path=require(_0x8746('0x7'));var sox=require('sox');var csv=require(_0x8746('0x8'));var ejs=require(_0x8746('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8746('0xa'));var jsforce=require(_0x8746('0xb'));var deskjs=require(_0x8746('0xc'));var toCsv=require(_0x8746('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8746('0xd'));var qs=require(_0x8746('0xe'));var as=require(_0x8746('0xf'));var hardwareService=require(_0x8746('0x10'));var logger=require(_0x8746('0x11'))(_0x8746('0x12'));var utils=require(_0x8746('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8746('0x14'));var db=require(_0x8746('0x15'))['db'];function respondWithStatusCode(_0x42e91d,_0x5bf23d){_0x5bf23d=_0x5bf23d||0xcc;return function(_0x579edc){if(_0x579edc){return _0x42e91d[_0x8746('0x16')](_0x5bf23d);}return _0x42e91d[_0x8746('0x17')](_0x5bf23d)[_0x8746('0x18')]();};}function respondWithResult(_0x2cf297,_0x10eee6){_0x10eee6=_0x10eee6||0xc8;return function(_0x5f10b0){if(_0x5f10b0){return _0x2cf297[_0x8746('0x17')](_0x10eee6)[_0x8746('0x19')](_0x5f10b0);}};}function respondWithFilteredResult(_0x2dc6eb,_0x5f212c){return function(_0x559622){if(_0x559622){var _0xa17745=typeof _0x5f212c['offset']===_0x8746('0x1a')&&typeof _0x5f212c[_0x8746('0x1b')]==='undefined';var _0x559bfb=_0x559622[_0x8746('0x1c')];var _0x5604c9=_0xa17745?0x0:_0x5f212c[_0x8746('0x1d')];var _0x37dd61=_0xa17745?_0x559622[_0x8746('0x1c')]:_0x5f212c['offset']+_0x5f212c[_0x8746('0x1b')];var _0x376461;if(_0x37dd61>=_0x559bfb){_0x37dd61=_0x559bfb;_0x376461=0xc8;}else{_0x376461=0xce;}_0x2dc6eb['status'](_0x376461);return _0x2dc6eb['set'](_0x8746('0x1e'),_0x5604c9+'-'+_0x37dd61+'/'+_0x559bfb)[_0x8746('0x19')](_0x559622);}return null;};}function patchUpdates(_0x417643){return function(_0x2fba71){try{jsonpatch[_0x8746('0x1f')](_0x2fba71,_0x417643,!![]);}catch(_0x5e00e8){return BPromise[_0x8746('0x20')](_0x5e00e8);}return _0x2fba71[_0x8746('0x21')]();};}function saveUpdates(_0x1a5604,_0x2bd81a){return function(_0x578f08){if(_0x578f08){return _0x578f08[_0x8746('0x22')](_0x1a5604)[_0x8746('0x23')](function(_0x4c71bd){return _0x4c71bd;});}return null;};}function removeEntity(_0x1bc80b,_0x1f6b32){return function(_0x51946e){if(_0x51946e){return _0x51946e[_0x8746('0x24')]()['then'](function(){_0x1bc80b[_0x8746('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5138f7,_0x293f56){return function(_0x428b6b){if(!_0x428b6b){_0x5138f7[_0x8746('0x16')](0x194);}return _0x428b6b;};}function handleError(_0x196140,_0x55e9e5){_0x55e9e5=_0x55e9e5||0x1f4;return function(_0x103a4b){logger[_0x8746('0x25')](_0x103a4b['stack']);if(_0x103a4b[_0x8746('0x26')]){delete _0x103a4b[_0x8746('0x26')];}_0x196140[_0x8746('0x17')](_0x55e9e5)[_0x8746('0x27')](_0x103a4b);};}exports[_0x8746('0x28')]=function(_0x304d32,_0x24d9e5){var _0x3e8ac9={},_0x3f26ee={},_0x114080={'count':0x0,'rows':[]};var _0x117804=_[_0x8746('0x29')](db[_0x8746('0x2a')]['rawAttributes'],function(_0x2d0fd5){return{'name':_0x2d0fd5[_0x8746('0x2b')],'type':_0x2d0fd5['type'][_0x8746('0x2c')]};});_0x3f26ee[_0x8746('0x2d')]=_[_0x8746('0x29')](_0x117804,_0x8746('0x26'));_0x3f26ee[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x304d32[_0x8746('0x2e')]);_0x3f26ee['filters']=_['intersection'](_0x3f26ee[_0x8746('0x2d')],_0x3f26ee[_0x8746('0x2e')]);_0x3e8ac9[_0x8746('0x30')]=_[_0x8746('0x31')](_0x3f26ee[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x304d32['query'][_0x8746('0x32')]));_0x3e8ac9['attributes']=_0x3e8ac9[_0x8746('0x30')]['length']?_0x3e8ac9[_0x8746('0x30')]:_0x3f26ee[_0x8746('0x2d')];if(!_0x304d32[_0x8746('0x2e')]['hasOwnProperty']('nolimit')){_0x3e8ac9[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x304d32['query'][_0x8746('0x1b')]);_0x3e8ac9['offset']=qs[_0x8746('0x1d')](_0x304d32[_0x8746('0x2e')][_0x8746('0x1d')]);}_0x3e8ac9[_0x8746('0x33')]=qs[_0x8746('0x34')](_0x304d32[_0x8746('0x2e')]['sort']);_0x3e8ac9[_0x8746('0x35')]=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x304d32[_0x8746('0x2e')],_0x3f26ee[_0x8746('0x36')]),_0x117804);if(_0x304d32['query'][_0x8746('0x38')]){_0x3e8ac9[_0x8746('0x35')]=_[_0x8746('0x39')](_0x3e8ac9['where'],{'$or':_[_0x8746('0x29')](_0x117804,function(_0x1d6f84){if(_0x1d6f84[_0x8746('0x3a')]!==_0x8746('0x3b')){var _0x394490={};_0x394490[_0x1d6f84[_0x8746('0x26')]]={'$like':'%'+_0x304d32['query'][_0x8746('0x38')]+'%'};return _0x394490;}})});}_0x3e8ac9=_[_0x8746('0x39')]({},_0x3e8ac9,_0x304d32[_0x8746('0x3c')]);var _0x569875={'where':_0x3e8ac9[_0x8746('0x35')]};return db[_0x8746('0x2a')][_0x8746('0x1c')](_0x569875)[_0x8746('0x23')](function(_0x2d4b23){_0x114080[_0x8746('0x1c')]=_0x2d4b23;if(_0x304d32['query'][_0x8746('0x3d')]){_0x3e8ac9[_0x8746('0x3e')]=[{'all':!![]}];}return db[_0x8746('0x2a')][_0x8746('0x3f')](_0x3e8ac9);})[_0x8746('0x23')](function(_0x1e4dfa){_0x114080[_0x8746('0x40')]=_0x1e4dfa;return _0x114080;})[_0x8746('0x23')](respondWithFilteredResult(_0x24d9e5,_0x3e8ac9))[_0x8746('0x41')](handleError(_0x24d9e5,null));};exports[_0x8746('0x42')]=function(_0x4e5b3a,_0x59fced){var _0x2ebf82={'raw':![],'where':{'id':_0x4e5b3a[_0x8746('0x43')]['id']}},_0x3514d2={};_0x3514d2[_0x8746('0x2d')]=_[_0x8746('0x2f')](db[_0x8746('0x2a')][_0x8746('0x44')]);_0x3514d2[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x4e5b3a[_0x8746('0x2e')]);_0x3514d2['filters']=_[_0x8746('0x31')](_0x3514d2['model'],_0x3514d2[_0x8746('0x2e')]);_0x2ebf82['attributes']=_[_0x8746('0x31')](_0x3514d2[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x4e5b3a[_0x8746('0x2e')]['fields']));_0x2ebf82[_0x8746('0x30')]=_0x2ebf82['attributes'][_0x8746('0x45')]?_0x2ebf82[_0x8746('0x30')]:_0x3514d2[_0x8746('0x2d')];if(_0x4e5b3a['query'][_0x8746('0x3d')]){_0x2ebf82['include']=[{'all':!![]}];}_0x2ebf82=_[_0x8746('0x39')]({},_0x2ebf82,_0x4e5b3a[_0x8746('0x3c')]);return db['Dynamics365Configuration'][_0x8746('0x46')](_0x2ebf82)[_0x8746('0x23')](handleEntityNotFound(_0x59fced,null))[_0x8746('0x23')](respondWithResult(_0x59fced,null))[_0x8746('0x41')](handleError(_0x59fced,null));};exports[_0x8746('0x47')]=function(_0x259226,_0x387a63){return db[_0x8746('0x2a')][_0x8746('0x47')](_0x259226[_0x8746('0x48')],{})[_0x8746('0x23')](respondWithResult(_0x387a63,0xc9))[_0x8746('0x41')](handleError(_0x387a63,null));};exports[_0x8746('0x22')]=function(_0x9672f1,_0x30ae2a){if(_0x9672f1[_0x8746('0x48')]['id']){delete _0x9672f1[_0x8746('0x48')]['id'];}return db[_0x8746('0x2a')]['find']({'where':{'id':_0x9672f1[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x30ae2a,null))['then'](saveUpdates(_0x9672f1[_0x8746('0x48')],null))[_0x8746('0x23')](respondWithResult(_0x30ae2a,null))[_0x8746('0x41')](handleError(_0x30ae2a,null));};exports[_0x8746('0x24')]=function(_0x2b88bd,_0x11392d){return db[_0x8746('0x2a')][_0x8746('0x46')]({'where':{'id':_0x2b88bd[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x11392d,null))['then'](removeEntity(_0x11392d,null))[_0x8746('0x41')](handleError(_0x11392d,null));};exports[_0x8746('0x49')]=function(_0x2014e5,_0x47ad84,_0x59aff5){var _0x1f3b8d={};var _0x3334ec={};var _0x1f1a2a;var _0x1393d4;return db['Dynamics365Configuration'][_0x8746('0x4a')]({'where':{'id':_0x2014e5[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x47ad84,null))[_0x8746('0x23')](function(_0x2724be){if(_0x2724be){_0x1f1a2a=_0x2724be;_0x3334ec['model']=_['keys'](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x3334ec[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x2014e5[_0x8746('0x2e')]);_0x3334ec[_0x8746('0x36')]=_['intersection'](_0x3334ec[_0x8746('0x2d')],_0x3334ec[_0x8746('0x2e')]);_0x1f3b8d['attributes']=_['intersection'](_0x3334ec[_0x8746('0x2d')],qs['fields'](_0x2014e5['query'][_0x8746('0x32')]));_0x1f3b8d[_0x8746('0x30')]=_0x1f3b8d[_0x8746('0x30')]['length']?_0x1f3b8d['attributes']:_0x3334ec['model'];_0x1f3b8d[_0x8746('0x33')]=qs[_0x8746('0x34')](_0x2014e5['query'][_0x8746('0x34')]);_0x1f3b8d[_0x8746('0x35')]=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x2014e5[_0x8746('0x2e')],_0x3334ec[_0x8746('0x36')]));if(_0x2014e5[_0x8746('0x2e')][_0x8746('0x38')]){_0x1f3b8d[_0x8746('0x35')]=_[_0x8746('0x39')](_0x1f3b8d['where'],{'$or':_[_0x8746('0x29')](_0x1f3b8d[_0x8746('0x30')],function(_0x3b0af2){var _0x5ce9c2={};_0x5ce9c2[_0x3b0af2]={'$like':'%'+_0x2014e5[_0x8746('0x2e')][_0x8746('0x38')]+'%'};return _0x5ce9c2;})});}_0x1f3b8d=_[_0x8746('0x39')]({},_0x1f3b8d,_0x2014e5[_0x8746('0x3c')]);return _0x1f1a2a[_0x8746('0x49')](_0x1f3b8d);}})[_0x8746('0x23')](function(_0x3fde59){if(_0x3fde59){_0x1393d4=_0x3fde59['length'];if(!_0x2014e5[_0x8746('0x2e')][_0x8746('0x4c')](_0x8746('0x4d'))){_0x1f3b8d[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x2014e5[_0x8746('0x2e')][_0x8746('0x1b')]);_0x1f3b8d[_0x8746('0x1d')]=qs[_0x8746('0x1d')](_0x2014e5[_0x8746('0x2e')]['offset']);}return _0x1f1a2a[_0x8746('0x49')](_0x1f3b8d);}})['then'](function(_0x3385b3){if(_0x3385b3){return _0x3385b3?{'count':_0x1393d4,'rows':_0x3385b3}:null;}})['then'](respondWithResult(_0x47ad84,null))[_0x8746('0x41')](handleError(_0x47ad84,null));};exports[_0x8746('0x4e')]=function(_0x24d1c9,_0x445dce,_0x9e313){var _0x4d86e3={};var _0x30942b={};var _0x37faea;var _0x550674;return db[_0x8746('0x2a')]['findOne']({'where':{'id':_0x24d1c9[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x445dce,null))[_0x8746('0x23')](function(_0xc4048c){if(_0xc4048c){_0x37faea=_0xc4048c;_0x30942b['model']=_[_0x8746('0x2f')](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x30942b[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x24d1c9[_0x8746('0x2e')]);_0x30942b[_0x8746('0x36')]=_[_0x8746('0x31')](_0x30942b[_0x8746('0x2d')],_0x30942b['query']);_0x4d86e3[_0x8746('0x30')]=_[_0x8746('0x31')](_0x30942b[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x24d1c9['query'][_0x8746('0x32')]));_0x4d86e3[_0x8746('0x30')]=_0x4d86e3['attributes'][_0x8746('0x45')]?_0x4d86e3['attributes']:_0x30942b[_0x8746('0x2d')];_0x4d86e3['order']=qs[_0x8746('0x34')](_0x24d1c9['query']['sort']);_0x4d86e3[_0x8746('0x35')]=qs[_0x8746('0x36')](_['pick'](_0x24d1c9['query'],_0x30942b[_0x8746('0x36')]));if(_0x24d1c9['query'][_0x8746('0x38')]){_0x4d86e3[_0x8746('0x35')]=_[_0x8746('0x39')](_0x4d86e3[_0x8746('0x35')],{'$or':_[_0x8746('0x29')](_0x4d86e3[_0x8746('0x30')],function(_0x2aec29){var _0x371888={};_0x371888[_0x2aec29]={'$like':'%'+_0x24d1c9[_0x8746('0x2e')][_0x8746('0x38')]+'%'};return _0x371888;})});}_0x4d86e3=_[_0x8746('0x39')]({},_0x4d86e3,_0x24d1c9[_0x8746('0x3c')]);return _0x37faea['getSubjects'](_0x4d86e3);}})[_0x8746('0x23')](function(_0x4980b3){if(_0x4980b3){_0x550674=_0x4980b3[_0x8746('0x45')];if(!_0x24d1c9[_0x8746('0x2e')][_0x8746('0x4c')](_0x8746('0x4d'))){_0x4d86e3[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x24d1c9['query'][_0x8746('0x1b')]);_0x4d86e3['offset']=qs[_0x8746('0x1d')](_0x24d1c9[_0x8746('0x2e')][_0x8746('0x1d')]);}return _0x37faea['getSubjects'](_0x4d86e3);}})[_0x8746('0x23')](function(_0x17f911){if(_0x17f911){return _0x17f911?{'count':_0x550674,'rows':_0x17f911}:null;}})[_0x8746('0x23')](respondWithResult(_0x445dce,null))[_0x8746('0x41')](handleError(_0x445dce,null));};exports[_0x8746('0x4f')]=function(_0x11c860,_0x3291a4,_0x5779e3){var _0x125851={};var _0x37565d={};var _0x48d0d8;var _0x110f6d;return db['Dynamics365Configuration'][_0x8746('0x4a')]({'where':{'id':_0x11c860[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x3291a4,null))['then'](function(_0x2dd91b){if(_0x2dd91b){_0x48d0d8=_0x2dd91b;_0x37565d[_0x8746('0x2d')]=_[_0x8746('0x2f')](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x37565d[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x11c860[_0x8746('0x2e')]);_0x37565d[_0x8746('0x36')]=_['intersection'](_0x37565d[_0x8746('0x2d')],_0x37565d['query']);_0x125851[_0x8746('0x30')]=_[_0x8746('0x31')](_0x37565d['model'],qs[_0x8746('0x32')](_0x11c860[_0x8746('0x2e')][_0x8746('0x32')]));_0x125851[_0x8746('0x30')]=_0x125851[_0x8746('0x30')][_0x8746('0x45')]?_0x125851['attributes']:_0x37565d[_0x8746('0x2d')];_0x125851['order']=qs[_0x8746('0x34')](_0x11c860[_0x8746('0x2e')][_0x8746('0x34')]);_0x125851['where']=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x11c860['query'],_0x37565d[_0x8746('0x36')]));if(_0x11c860[_0x8746('0x2e')][_0x8746('0x38')]){_0x125851['where']=_[_0x8746('0x39')](_0x125851[_0x8746('0x35')],{'$or':_[_0x8746('0x29')](_0x125851['attributes'],function(_0x2b8007){var _0x4ed62b={};_0x4ed62b[_0x2b8007]={'$like':'%'+_0x11c860[_0x8746('0x2e')]['filter']+'%'};return _0x4ed62b;})});}_0x125851=_[_0x8746('0x39')]({},_0x125851,_0x11c860[_0x8746('0x3c')]);return _0x48d0d8[_0x8746('0x4f')](_0x125851);}})['then'](function(_0x2303b1){if(_0x2303b1){_0x110f6d=_0x2303b1[_0x8746('0x45')];if(!_0x11c860[_0x8746('0x2e')]['hasOwnProperty']('nolimit')){_0x125851[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x11c860[_0x8746('0x2e')][_0x8746('0x1b')]);_0x125851[_0x8746('0x1d')]=qs[_0x8746('0x1d')](_0x11c860['query']['offset']);}return _0x48d0d8['getDescriptions'](_0x125851);}})[_0x8746('0x23')](function(_0x58d2c0){if(_0x58d2c0){return _0x58d2c0?{'count':_0x110f6d,'rows':_0x58d2c0}:null;}})[_0x8746('0x23')](respondWithResult(_0x3291a4,null))[_0x8746('0x41')](handleError(_0x3291a4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index fb4a80f..c8bbaac 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x432c09,_0x38c421){var _0x54d340=function(_0x154733){while(--_0x154733){_0x432c09['push'](_0x432c09['shift']());}};_0x54d340(++_0x38c421);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xe14d,0x1ee));var _0xde14=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe14d[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'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 982bb4c..95387b1 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 _0x260d=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x2c9cce,_0x21e21c){var _0x4bc082=function(_0x16ba4c){while(--_0x16ba4c){_0x2c9cce['push'](_0x2c9cce['shift']());}};_0x4bc082(++_0x21e21c);}(_0x260d,0x181));var _0xd260=function(_0x1bcbf,_0xb1d7e){_0x1bcbf=_0x1bcbf-0x0;var _0x10f707=_0x260d[_0x1bcbf];return _0x10f707;};'use strict';var _=require('lodash');var util=require(_0xd260('0x0'));var moment=require('moment');var BPromise=require(_0xd260('0x1'));var rs=require(_0xd260('0x2'));var fs=require('fs');var Redis=require(_0xd260('0x3'));var db=require(_0xd260('0x4'))['db'];var utils=require(_0xd260('0x5'));var logger=require('../../config/logger')(_0xd260('0x6'));var config=require('../../config/environment');var jayson=require(_0xd260('0x7'));var client=jayson[_0xd260('0x8')][_0xd260('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f7cb9,_0x1b6852,_0x596c58){return new BPromise(function(_0x529c12,_0x716a32){return client[_0xd260('0xa')](_0x2f7cb9,_0x596c58)[_0xd260('0xb')](function(_0x184a26){logger[_0xd260('0xc')](_0xd260('0xd'),_0x1b6852,_0xd260('0xe'));logger[_0xd260('0xf')](_0xd260('0x10'),_0x1b6852,'request\x20sent',JSON[_0xd260('0x11')](_0x184a26));if(_0x184a26[_0xd260('0x12')]){if(_0x184a26[_0xd260('0x12')][_0xd260('0x13')]===0x1f4){logger[_0xd260('0x12')](_0xd260('0xd'),_0x1b6852,_0x184a26[_0xd260('0x12')][_0xd260('0x14')]);return _0x716a32(_0x184a26[_0xd260('0x12')][_0xd260('0x14')]);}logger[_0xd260('0x12')](_0xd260('0xd'),_0x1b6852,_0x184a26[_0xd260('0x12')][_0xd260('0x14')]);return _0x529c12(_0x184a26[_0xd260('0x12')]['message']);}else{logger[_0xd260('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b6852,_0xd260('0xe'));_0x529c12(_0x184a26['result'][_0xd260('0x14')]);}})[_0xd260('0x15')](function(_0x11f4ae){logger[_0xd260('0x12')](_0xd260('0xd'),_0x1b6852,_0x11f4ae);_0x716a32(_0x11f4ae);});});} \ No newline at end of file +var _0x4c3b=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x309d68,_0x1036c9){var _0xcee19a=function(_0x3d1350){while(--_0x3d1350){_0x309d68['push'](_0x309d68['shift']());}};_0xcee19a(++_0x1036c9);}(_0x4c3b,0xc9));var _0xb4c3=function(_0xc540c5,_0x265dc8){_0xc540c5=_0xc540c5-0x0;var _0x2cc2ab=_0x4c3b[_0xc540c5];return _0x2cc2ab;};'use strict';var _=require(_0xb4c3('0x0'));var util=require(_0xb4c3('0x1'));var moment=require(_0xb4c3('0x2'));var BPromise=require(_0xb4c3('0x3'));var rs=require(_0xb4c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4c3('0x5'))['db'];var utils=require(_0xb4c3('0x6'));var logger=require(_0xb4c3('0x7'))(_0xb4c3('0x8'));var config=require(_0xb4c3('0x9'));var jayson=require(_0xb4c3('0xa'));var client=jayson[_0xb4c3('0xb')][_0xb4c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53db3b,_0x4f2df9,_0x4217b8){return new BPromise(function(_0x1ede7f,_0x3d016d){return client[_0xb4c3('0xd')](_0x53db3b,_0x4217b8)[_0xb4c3('0xe')](function(_0x479759){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0xb4c3('0xf'));logger[_0xb4c3('0x10')](_0xb4c3('0x11'),_0x4f2df9,_0xb4c3('0xf'),JSON['stringify'](_0x479759));if(_0x479759['error']){if(_0x479759[_0xb4c3('0x12')]['code']===0x1f4){logger[_0xb4c3('0x12')](_0xb4c3('0x13'),_0x4f2df9,_0x479759['error']['message']);return _0x3d016d(_0x479759[_0xb4c3('0x12')][_0xb4c3('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0x479759[_0xb4c3('0x12')]['message']);return _0x1ede7f(_0x479759[_0xb4c3('0x12')]['message']);}else{logger[_0xb4c3('0x15')](_0xb4c3('0x13'),_0x4f2df9,_0xb4c3('0xf'));_0x1ede7f(_0x479759[_0xb4c3('0x16')][_0xb4c3('0x14')]);}})[_0xb4c3('0x17')](function(_0x302074){logger[_0xb4c3('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0x302074);_0x3d016d(_0x302074);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8ef694e..a1492f2 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 _0xfa3c=['get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x1948d0,_0xbd5720){var _0x188e66=function(_0x187b9e){while(--_0x187b9e){_0x1948d0['push'](_0x1948d0['shift']());}};_0x188e66(++_0xbd5720);}(_0xfa3c,0x10e));var _0xcfa3=function(_0x3e330a,_0x11bf04){_0x3e330a=_0x3e330a-0x0;var _0x451dee=_0xfa3c[_0x3e330a];return _0x451dee;};'use strict';var multer=require(_0xcfa3('0x0'));var util=require(_0xcfa3('0x1'));var path=require(_0xcfa3('0x2'));var timeout=require(_0xcfa3('0x3'));var express=require(_0xcfa3('0x4'));var router=express[_0xcfa3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcfa3('0x6'));var interaction=require(_0xcfa3('0x7'));var config=require(_0xcfa3('0x8'));var controller=require(_0xcfa3('0x9'));router[_0xcfa3('0xa')]('/',auth['isAuthenticated'](),controller[_0xcfa3('0xb')]);router['get'](_0xcfa3('0xc'),auth[_0xcfa3('0xd')](),controller['show']);router[_0xcfa3('0xe')]('/',auth[_0xcfa3('0xd')](),controller[_0xcfa3('0xf')]);router['put'](_0xcfa3('0xc'),auth['isAuthenticated'](),controller[_0xcfa3('0x10')]);router[_0xcfa3('0x11')]('/:id',auth[_0xcfa3('0xd')](),controller[_0xcfa3('0x12')]);module[_0xcfa3('0x13')]=router; \ No newline at end of file +var _0x9f35=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x9f35,0x89));var _0x59f3=function(_0x35242a,_0xbfe266){_0x35242a=_0x35242a-0x0;var _0x39a7f6=_0x9f35[_0x35242a];return _0x39a7f6;};'use strict';var multer=require(_0x59f3('0x0'));var util=require(_0x59f3('0x1'));var path=require('path');var timeout=require(_0x59f3('0x2'));var express=require(_0x59f3('0x3'));var router=express['Router']();var fs_extra=require(_0x59f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x59f3('0x5'));var config=require('../../config/environment');var controller=require(_0x59f3('0x6'));router[_0x59f3('0x7')]('/',auth[_0x59f3('0x8')](),controller[_0x59f3('0x9')]);router['get'](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller['show']);router[_0x59f3('0xb')]('/',auth['isAuthenticated'](),controller[_0x59f3('0xc')]);router[_0x59f3('0xd')](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller[_0x59f3('0xe')]);router['delete'](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller[_0x59f3('0xf')]);module[_0x59f3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 465c60f..72067b8 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 _0x93a3=['picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports','string','keyValue'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x93a3,0x1c7));var _0x393a=function(_0x660318,_0x30e7f0){_0x660318=_0x660318-0x0;var _0xcdee13=_0x93a3[_0x660318];return _0xcdee13;};'use strict';var Sequelize=require(_0x393a('0x0'));module[_0x393a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x393a('0x2'),'variable','customVariable',_0x393a('0x3'),_0x393a('0x4')),'defaultValue':_0x393a('0x2')},'content':{'type':Sequelize[_0x393a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x393a('0x2'),_0x393a('0x6'),_0x393a('0x7'))},'keyContent':{'type':Sequelize[_0x393a('0x5')]},'idField':{'type':Sequelize[_0x393a('0x5')]},'nameField':{'type':Sequelize[_0x393a('0x5')]},'customField':{'type':Sequelize[_0x393a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x393a('0x5')]}}; \ No newline at end of file +var _0x17c3=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x204e9f,_0x5cb184){var _0x1da35d=function(_0x5ea2fe){while(--_0x5ea2fe){_0x204e9f['push'](_0x204e9f['shift']());}};_0x1da35d(++_0x5cb184);}(_0x17c3,0x90));var _0x317c=function(_0x5abe61,_0xdb5b36){_0x5abe61=_0x5abe61-0x0;var _0x21d79f=_0x17c3[_0x5abe61];return _0x21d79f;};'use strict';var Sequelize=require(_0x317c('0x0'));module[_0x317c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x317c('0x2'),_0x317c('0x3'),_0x317c('0x4'),_0x317c('0x5'),_0x317c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x317c('0x7')]},'key':{'type':Sequelize[_0x317c('0x7')]},'keyType':{'type':Sequelize[_0x317c('0x8')](_0x317c('0x2'),_0x317c('0x3'),_0x317c('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x317c('0x7')]},'nameField':{'type':Sequelize[_0x317c('0x7')]},'customField':{'type':Sequelize[_0x317c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x317c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 66555ed..5ac6beb 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 _0xeba7=['end','json','offset','undefined','limit','count','status','set','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Dynamics365Field','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x8faf90,_0x5ae801){var _0x4e6aae=function(_0x747dcf){while(--_0x747dcf){_0x8faf90['push'](_0x8faf90['shift']());}};_0x4e6aae(++_0x5ae801);}(_0xeba7,0x139));var _0x7eba=function(_0x46cfbb,_0x16f6bf){_0x46cfbb=_0x46cfbb-0x0;var _0x5a384a=_0xeba7[_0x46cfbb];return _0x5a384a;};'use strict';var emlformat=require(_0x7eba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7eba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7eba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7eba('0x3'));var util=require(_0x7eba('0x4'));var path=require(_0x7eba('0x5'));var sox=require(_0x7eba('0x6'));var csv=require(_0x7eba('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eba('0x8'));var _=require(_0x7eba('0x9'));var squel=require(_0x7eba('0xa'));var crypto=require(_0x7eba('0xb'));var jsforce=require(_0x7eba('0xc'));var deskjs=require(_0x7eba('0xd'));var toCsv=require(_0x7eba('0x7'));var querystring=require(_0x7eba('0xe'));var Papa=require('papaparse');var Redis=require(_0x7eba('0xf'));var authService=require(_0x7eba('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7eba('0x11'));var logger=require(_0x7eba('0x12'))('api');var utils=require(_0x7eba('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7eba('0x14'))['db'];function respondWithStatusCode(_0x5621eb,_0x6f5610){_0x6f5610=_0x6f5610||0xcc;return function(_0x2fc381){if(_0x2fc381){return _0x5621eb[_0x7eba('0x15')](_0x6f5610);}return _0x5621eb['status'](_0x6f5610)[_0x7eba('0x16')]();};}function respondWithResult(_0x47205a,_0xeea4ab){_0xeea4ab=_0xeea4ab||0xc8;return function(_0x45f57a){if(_0x45f57a){return _0x47205a['status'](_0xeea4ab)[_0x7eba('0x17')](_0x45f57a);}};}function respondWithFilteredResult(_0x5c12b2,_0x3f2df6){return function(_0x38a192){if(_0x38a192){var _0x19d17c=typeof _0x3f2df6[_0x7eba('0x18')]===_0x7eba('0x19')&&typeof _0x3f2df6[_0x7eba('0x1a')]==='undefined';var _0x2eef22=_0x38a192[_0x7eba('0x1b')];var _0x3f9aeb=_0x19d17c?0x0:_0x3f2df6[_0x7eba('0x18')];var _0x3bc383=_0x19d17c?_0x38a192[_0x7eba('0x1b')]:_0x3f2df6[_0x7eba('0x18')]+_0x3f2df6[_0x7eba('0x1a')];var _0xa60507;if(_0x3bc383>=_0x2eef22){_0x3bc383=_0x2eef22;_0xa60507=0xc8;}else{_0xa60507=0xce;}_0x5c12b2[_0x7eba('0x1c')](_0xa60507);return _0x5c12b2[_0x7eba('0x1d')]('Content-Range',_0x3f9aeb+'-'+_0x3bc383+'/'+_0x2eef22)[_0x7eba('0x17')](_0x38a192);}return null;};}function patchUpdates(_0xb4bec0){return function(_0x4e1b92){try{jsonpatch['apply'](_0x4e1b92,_0xb4bec0,!![]);}catch(_0x3c72f4){return BPromise['reject'](_0x3c72f4);}return _0x4e1b92[_0x7eba('0x1e')]();};}function saveUpdates(_0x2f76ba,_0x2ff72a){return function(_0x3e4802){if(_0x3e4802){return _0x3e4802[_0x7eba('0x1f')](_0x2f76ba)[_0x7eba('0x20')](function(_0x1c6a74){return _0x1c6a74;});}return null;};}function removeEntity(_0x11039e,_0xdb366d){return function(_0x4ef622){if(_0x4ef622){return _0x4ef622[_0x7eba('0x21')]()[_0x7eba('0x20')](function(){_0x11039e[_0x7eba('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x531f70,_0x389172){return function(_0x5adfb0){if(!_0x5adfb0){_0x531f70[_0x7eba('0x15')](0x194);}return _0x5adfb0;};}function handleError(_0x418e9a,_0x27efc0){_0x27efc0=_0x27efc0||0x1f4;return function(_0xa05227){logger[_0x7eba('0x22')](_0xa05227[_0x7eba('0x23')]);if(_0xa05227[_0x7eba('0x24')]){delete _0xa05227[_0x7eba('0x24')];}_0x418e9a[_0x7eba('0x1c')](_0x27efc0)['send'](_0xa05227);};}exports[_0x7eba('0x25')]=function(_0x2a7d6b,_0xc8ebd0){var _0x5e0975={},_0x26665c={},_0x1c9718={'count':0x0,'rows':[]};var _0x4388a9=_[_0x7eba('0x26')](db['Dynamics365Field'][_0x7eba('0x27')],function(_0x290ea7){return{'name':_0x290ea7['fieldName'],'type':_0x290ea7[_0x7eba('0x28')]['key']};});_0x26665c[_0x7eba('0x29')]=_[_0x7eba('0x26')](_0x4388a9,_0x7eba('0x24'));_0x26665c[_0x7eba('0x2a')]=_[_0x7eba('0x2b')](_0x2a7d6b[_0x7eba('0x2a')]);_0x26665c[_0x7eba('0x2c')]=_[_0x7eba('0x2d')](_0x26665c[_0x7eba('0x29')],_0x26665c[_0x7eba('0x2a')]);_0x5e0975[_0x7eba('0x2e')]=_[_0x7eba('0x2d')](_0x26665c['model'],qs['fields'](_0x2a7d6b[_0x7eba('0x2a')][_0x7eba('0x2f')]));_0x5e0975['attributes']=_0x5e0975[_0x7eba('0x2e')][_0x7eba('0x30')]?_0x5e0975[_0x7eba('0x2e')]:_0x26665c['model'];if(!_0x2a7d6b['query'][_0x7eba('0x31')](_0x7eba('0x32'))){_0x5e0975['limit']=qs[_0x7eba('0x1a')](_0x2a7d6b[_0x7eba('0x2a')][_0x7eba('0x1a')]);_0x5e0975[_0x7eba('0x18')]=qs[_0x7eba('0x18')](_0x2a7d6b['query'][_0x7eba('0x18')]);}_0x5e0975['order']=qs[_0x7eba('0x33')](_0x2a7d6b[_0x7eba('0x2a')][_0x7eba('0x33')]);_0x5e0975[_0x7eba('0x34')]=qs[_0x7eba('0x2c')](_[_0x7eba('0x35')](_0x2a7d6b[_0x7eba('0x2a')],_0x26665c[_0x7eba('0x2c')]),_0x4388a9);if(_0x2a7d6b['query'][_0x7eba('0x36')]){_0x5e0975[_0x7eba('0x34')]=_[_0x7eba('0x37')](_0x5e0975[_0x7eba('0x34')],{'$or':_['map'](_0x4388a9,function(_0x350bd2){if(_0x350bd2[_0x7eba('0x28')]!==_0x7eba('0x38')){var _0x4c6b88={};_0x4c6b88[_0x350bd2[_0x7eba('0x24')]]={'$like':'%'+_0x2a7d6b['query'][_0x7eba('0x36')]+'%'};return _0x4c6b88;}})});}_0x5e0975=_['merge']({},_0x5e0975,_0x2a7d6b['options']);var _0x52051d={'where':_0x5e0975['where']};return db[_0x7eba('0x39')][_0x7eba('0x1b')](_0x52051d)['then'](function(_0x10919d){_0x1c9718['count']=_0x10919d;if(_0x2a7d6b[_0x7eba('0x2a')]['includeAll']){_0x5e0975['include']=[{'all':!![]}];}return db[_0x7eba('0x39')][_0x7eba('0x3a')](_0x5e0975);})[_0x7eba('0x20')](function(_0x1492e8){_0x1c9718[_0x7eba('0x3b')]=_0x1492e8;return _0x1c9718;})['then'](respondWithFilteredResult(_0xc8ebd0,_0x5e0975))[_0x7eba('0x3c')](handleError(_0xc8ebd0,null));};exports[_0x7eba('0x3d')]=function(_0x10fb53,_0x87b98){var _0x49ff52={'raw':!![],'where':{'id':_0x10fb53[_0x7eba('0x3e')]['id']}},_0x5d7bf8={};_0x5d7bf8[_0x7eba('0x29')]=_[_0x7eba('0x2b')](db[_0x7eba('0x39')][_0x7eba('0x27')]);_0x5d7bf8[_0x7eba('0x2a')]=_[_0x7eba('0x2b')](_0x10fb53['query']);_0x5d7bf8['filters']=_[_0x7eba('0x2d')](_0x5d7bf8[_0x7eba('0x29')],_0x5d7bf8['query']);_0x49ff52[_0x7eba('0x2e')]=_[_0x7eba('0x2d')](_0x5d7bf8[_0x7eba('0x29')],qs[_0x7eba('0x2f')](_0x10fb53[_0x7eba('0x2a')][_0x7eba('0x2f')]));_0x49ff52[_0x7eba('0x2e')]=_0x49ff52['attributes']['length']?_0x49ff52[_0x7eba('0x2e')]:_0x5d7bf8[_0x7eba('0x29')];if(_0x10fb53[_0x7eba('0x2a')][_0x7eba('0x3f')]){_0x49ff52['include']=[{'all':!![]}];}_0x49ff52=_[_0x7eba('0x37')]({},_0x49ff52,_0x10fb53['options']);return db[_0x7eba('0x39')][_0x7eba('0x40')](_0x49ff52)[_0x7eba('0x20')](handleEntityNotFound(_0x87b98,null))['then'](respondWithResult(_0x87b98,null))['catch'](handleError(_0x87b98,null));};exports[_0x7eba('0x41')]=function(_0x5858b2,_0x52439f){return db[_0x7eba('0x39')][_0x7eba('0x41')](_0x5858b2['body'],{})[_0x7eba('0x20')](respondWithResult(_0x52439f,0xc9))[_0x7eba('0x3c')](handleError(_0x52439f,null));};exports[_0x7eba('0x1f')]=function(_0x1ff247,_0x34f25d){if(_0x1ff247[_0x7eba('0x42')]['id']){delete _0x1ff247['body']['id'];}return db[_0x7eba('0x39')]['find']({'where':{'id':_0x1ff247[_0x7eba('0x3e')]['id']}})[_0x7eba('0x20')](handleEntityNotFound(_0x34f25d,null))[_0x7eba('0x20')](saveUpdates(_0x1ff247[_0x7eba('0x42')],null))[_0x7eba('0x20')](respondWithResult(_0x34f25d,null))[_0x7eba('0x3c')](handleError(_0x34f25d,null));};exports['destroy']=function(_0x3135f2,_0x5a311e){return db['Dynamics365Field'][_0x7eba('0x40')]({'where':{'id':_0x3135f2['params']['id']}})[_0x7eba('0x20')](handleEntityNotFound(_0x5a311e,null))[_0x7eba('0x20')](removeEntity(_0x5a311e,null))[_0x7eba('0x3c')](handleError(_0x5a311e,null));}; \ No newline at end of file +var _0x9deb=['find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','rows','catch','params','create','body'];(function(_0x229c5b,_0x48ae8d){var _0x1e3351=function(_0x4b29a9){while(--_0x4b29a9){_0x229c5b['push'](_0x229c5b['shift']());}};_0x1e3351(++_0x48ae8d);}(_0x9deb,0x11d));var _0xb9de=function(_0x36c5f9,_0x12724d){_0x36c5f9=_0x36c5f9-0x0;var _0x1962d6=_0x9deb[_0x36c5f9];return _0x1962d6;};'use strict';var emlformat=require(_0xb9de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9de('0x1'));var jsonpatch=require(_0xb9de('0x2'));var rp=require(_0xb9de('0x3'));var moment=require('moment');var BPromise=require(_0xb9de('0x4'));var Mustache=require(_0xb9de('0x5'));var util=require(_0xb9de('0x6'));var path=require(_0xb9de('0x7'));var sox=require(_0xb9de('0x8'));var csv=require(_0xb9de('0x9'));var ejs=require(_0xb9de('0xa'));var fs=require('fs');var fs_extra=require(_0xb9de('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb9de('0xc'));var jsforce=require(_0xb9de('0xd'));var deskjs=require(_0xb9de('0xe'));var toCsv=require(_0xb9de('0x9'));var querystring=require(_0xb9de('0xf'));var Papa=require('papaparse');var Redis=require(_0xb9de('0x10'));var authService=require(_0xb9de('0x11'));var qs=require(_0xb9de('0x12'));var as=require(_0xb9de('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb9de('0x14'));var utils=require(_0xb9de('0x15'));var config=require(_0xb9de('0x16'));var licenseUtil=require(_0xb9de('0x17'));var db=require(_0xb9de('0x18'))['db'];function respondWithStatusCode(_0xaf4002,_0x4d4cb5){_0x4d4cb5=_0x4d4cb5||0xcc;return function(_0x37ac38){if(_0x37ac38){return _0xaf4002[_0xb9de('0x19')](_0x4d4cb5);}return _0xaf4002['status'](_0x4d4cb5)[_0xb9de('0x1a')]();};}function respondWithResult(_0x2cb33d,_0x56d1ed){_0x56d1ed=_0x56d1ed||0xc8;return function(_0x3f2d5b){if(_0x3f2d5b){return _0x2cb33d[_0xb9de('0x1b')](_0x56d1ed)[_0xb9de('0x1c')](_0x3f2d5b);}};}function respondWithFilteredResult(_0x276cb3,_0x39efcd){return function(_0x479edf){if(_0x479edf){var _0x21b36d=typeof _0x39efcd[_0xb9de('0x1d')]===_0xb9de('0x1e')&&typeof _0x39efcd['limit']===_0xb9de('0x1e');var _0x2ea899=_0x479edf[_0xb9de('0x1f')];var _0x17cac3=_0x21b36d?0x0:_0x39efcd[_0xb9de('0x1d')];var _0x413f4b=_0x21b36d?_0x479edf[_0xb9de('0x1f')]:_0x39efcd[_0xb9de('0x1d')]+_0x39efcd[_0xb9de('0x20')];var _0x254a3d;if(_0x413f4b>=_0x2ea899){_0x413f4b=_0x2ea899;_0x254a3d=0xc8;}else{_0x254a3d=0xce;}_0x276cb3[_0xb9de('0x1b')](_0x254a3d);return _0x276cb3[_0xb9de('0x21')]('Content-Range',_0x17cac3+'-'+_0x413f4b+'/'+_0x2ea899)['json'](_0x479edf);}return null;};}function patchUpdates(_0x54d0e1){return function(_0xc4ee3c){try{jsonpatch['apply'](_0xc4ee3c,_0x54d0e1,!![]);}catch(_0x1f96ae){return BPromise[_0xb9de('0x22')](_0x1f96ae);}return _0xc4ee3c[_0xb9de('0x23')]();};}function saveUpdates(_0x584f67,_0x10519f){return function(_0x152faf){if(_0x152faf){return _0x152faf[_0xb9de('0x24')](_0x584f67)[_0xb9de('0x25')](function(_0x58eeb2){return _0x58eeb2;});}return null;};}function removeEntity(_0x4f447f,_0x273603){return function(_0x4a79b6){if(_0x4a79b6){return _0x4a79b6[_0xb9de('0x26')]()['then'](function(){_0x4f447f[_0xb9de('0x1b')](0xcc)[_0xb9de('0x1a')]();});}};}function handleEntityNotFound(_0x2bf5ec,_0x56f216){return function(_0x159377){if(!_0x159377){_0x2bf5ec[_0xb9de('0x19')](0x194);}return _0x159377;};}function handleError(_0x3c38b6,_0x1dffec){_0x1dffec=_0x1dffec||0x1f4;return function(_0x549a38){logger[_0xb9de('0x27')](_0x549a38[_0xb9de('0x28')]);if(_0x549a38['name']){delete _0x549a38[_0xb9de('0x29')];}_0x3c38b6[_0xb9de('0x1b')](_0x1dffec)[_0xb9de('0x2a')](_0x549a38);};}exports[_0xb9de('0x2b')]=function(_0xe96855,_0x35f2f5){var _0x52caf6={},_0x58792f={},_0x2f1465={'count':0x0,'rows':[]};var _0x541da5=_['map'](db[_0xb9de('0x2c')][_0xb9de('0x2d')],function(_0x1cbeb5){return{'name':_0x1cbeb5[_0xb9de('0x2e')],'type':_0x1cbeb5['type'][_0xb9de('0x2f')]};});_0x58792f[_0xb9de('0x30')]=_['map'](_0x541da5,_0xb9de('0x29'));_0x58792f[_0xb9de('0x31')]=_[_0xb9de('0x32')](_0xe96855[_0xb9de('0x31')]);_0x58792f['filters']=_['intersection'](_0x58792f[_0xb9de('0x30')],_0x58792f[_0xb9de('0x31')]);_0x52caf6[_0xb9de('0x33')]=_[_0xb9de('0x34')](_0x58792f[_0xb9de('0x30')],qs[_0xb9de('0x35')](_0xe96855[_0xb9de('0x31')]['fields']));_0x52caf6[_0xb9de('0x33')]=_0x52caf6[_0xb9de('0x33')][_0xb9de('0x36')]?_0x52caf6['attributes']:_0x58792f[_0xb9de('0x30')];if(!_0xe96855[_0xb9de('0x31')][_0xb9de('0x37')](_0xb9de('0x38'))){_0x52caf6[_0xb9de('0x20')]=qs[_0xb9de('0x20')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x20')]);_0x52caf6[_0xb9de('0x1d')]=qs[_0xb9de('0x1d')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x1d')]);}_0x52caf6['order']=qs[_0xb9de('0x39')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x39')]);_0x52caf6[_0xb9de('0x3a')]=qs['filters'](_[_0xb9de('0x3b')](_0xe96855[_0xb9de('0x31')],_0x58792f[_0xb9de('0x3c')]),_0x541da5);if(_0xe96855[_0xb9de('0x31')][_0xb9de('0x3d')]){_0x52caf6[_0xb9de('0x3a')]=_[_0xb9de('0x3e')](_0x52caf6[_0xb9de('0x3a')],{'$or':_['map'](_0x541da5,function(_0x2b9e65){if(_0x2b9e65['type']!=='VIRTUAL'){var _0x576f41={};_0x576f41[_0x2b9e65['name']]={'$like':'%'+_0xe96855[_0xb9de('0x31')][_0xb9de('0x3d')]+'%'};return _0x576f41;}})});}_0x52caf6=_[_0xb9de('0x3e')]({},_0x52caf6,_0xe96855['options']);var _0x4b94e7={'where':_0x52caf6[_0xb9de('0x3a')]};return db[_0xb9de('0x2c')][_0xb9de('0x1f')](_0x4b94e7)[_0xb9de('0x25')](function(_0x1def37){_0x2f1465[_0xb9de('0x1f')]=_0x1def37;if(_0xe96855[_0xb9de('0x31')][_0xb9de('0x3f')]){_0x52caf6[_0xb9de('0x40')]=[{'all':!![]}];}return db[_0xb9de('0x2c')]['findAll'](_0x52caf6);})[_0xb9de('0x25')](function(_0x262e43){_0x2f1465[_0xb9de('0x41')]=_0x262e43;return _0x2f1465;})[_0xb9de('0x25')](respondWithFilteredResult(_0x35f2f5,_0x52caf6))[_0xb9de('0x42')](handleError(_0x35f2f5,null));};exports['show']=function(_0x50e551,_0x2767fc){var _0x3e3420={'raw':!![],'where':{'id':_0x50e551[_0xb9de('0x43')]['id']}},_0x45b473={};_0x45b473[_0xb9de('0x30')]=_[_0xb9de('0x32')](db[_0xb9de('0x2c')]['rawAttributes']);_0x45b473[_0xb9de('0x31')]=_[_0xb9de('0x32')](_0x50e551[_0xb9de('0x31')]);_0x45b473[_0xb9de('0x3c')]=_[_0xb9de('0x34')](_0x45b473[_0xb9de('0x30')],_0x45b473[_0xb9de('0x31')]);_0x3e3420[_0xb9de('0x33')]=_[_0xb9de('0x34')](_0x45b473['model'],qs['fields'](_0x50e551[_0xb9de('0x31')]['fields']));_0x3e3420[_0xb9de('0x33')]=_0x3e3420[_0xb9de('0x33')][_0xb9de('0x36')]?_0x3e3420[_0xb9de('0x33')]:_0x45b473['model'];if(_0x50e551['query']['includeAll']){_0x3e3420[_0xb9de('0x40')]=[{'all':!![]}];}_0x3e3420=_[_0xb9de('0x3e')]({},_0x3e3420,_0x50e551['options']);return db['Dynamics365Field']['find'](_0x3e3420)[_0xb9de('0x25')](handleEntityNotFound(_0x2767fc,null))[_0xb9de('0x25')](respondWithResult(_0x2767fc,null))['catch'](handleError(_0x2767fc,null));};exports['create']=function(_0x27fae3,_0xbe5273){return db['Dynamics365Field'][_0xb9de('0x44')](_0x27fae3[_0xb9de('0x45')],{})[_0xb9de('0x25')](respondWithResult(_0xbe5273,0xc9))[_0xb9de('0x42')](handleError(_0xbe5273,null));};exports['update']=function(_0x1ea1e5,_0x161a83){if(_0x1ea1e5['body']['id']){delete _0x1ea1e5['body']['id'];}return db[_0xb9de('0x2c')][_0xb9de('0x46')]({'where':{'id':_0x1ea1e5[_0xb9de('0x43')]['id']}})[_0xb9de('0x25')](handleEntityNotFound(_0x161a83,null))[_0xb9de('0x25')](saveUpdates(_0x1ea1e5[_0xb9de('0x45')],null))['then'](respondWithResult(_0x161a83,null))[_0xb9de('0x42')](handleError(_0x161a83,null));};exports[_0xb9de('0x26')]=function(_0x21d46f,_0x8e20a9){return db[_0xb9de('0x2c')][_0xb9de('0x46')]({'where':{'id':_0x21d46f[_0xb9de('0x43')]['id']}})['then'](handleEntityNotFound(_0x8e20a9,null))[_0xb9de('0x25')](removeEntity(_0x8e20a9,null))[_0xb9de('0x42')](handleError(_0x8e20a9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index d66e1a7..1ac9e4e 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 _0xe326=['request-promise','path','rimraf','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','util','api','moment','bluebird'];(function(_0x13c6bf,_0x4bf8b3){var _0x474009=function(_0x1e262f){while(--_0x1e262f){_0x13c6bf['push'](_0x13c6bf['shift']());}};_0x474009(++_0x4bf8b3);}(_0xe326,0x1c4));var _0x6e32=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xe326[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var util=require(_0x6e32('0x0'));var logger=require('../../config/logger')(_0x6e32('0x1'));var moment=require(_0x6e32('0x2'));var BPromise=require(_0x6e32('0x3'));var rp=require(_0x6e32('0x4'));var fs=require('fs');var path=require(_0x6e32('0x5'));var rimraf=require(_0x6e32('0x6'));var config=require('../../config/environment');var attributes=require(_0x6e32('0x7'));module['exports']=function(_0x590d41,_0x502865){return _0x590d41['define'](_0x6e32('0x8'),attributes,{'tableName':_0x6e32('0x9'),'paranoid':![],'indexes':[{'name':_0x6e32('0xa'),'fields':['idField',_0x6e32('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1596=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','dynamics365_unique_index','idField','FieldId'];(function(_0x13a9d1,_0x35d032){var _0xbc602d=function(_0x2bde7a){while(--_0x2bde7a){_0x13a9d1['push'](_0x13a9d1['shift']());}};_0xbc602d(++_0x35d032);}(_0x1596,0xa8));var _0x6159=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1596[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var logger=require(_0x6159('0x2'))('api');var moment=require(_0x6159('0x3'));var BPromise=require(_0x6159('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6159('0x5'));var rimraf=require(_0x6159('0x6'));var config=require(_0x6159('0x7'));var attributes=require(_0x6159('0x8'));module[_0x6159('0x9')]=function(_0x17ca88,_0x824a04){return _0x17ca88['define'](_0x6159('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x6159('0xb'),'fields':[_0x6159('0xc'),_0x6159('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index b881be4..d652227 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 _0xbf6c=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xbf6c,0x1cd));var _0xcbf6=function(_0xfe9168,_0x51393e){_0xfe9168=_0xfe9168-0x0;var _0x168b04=_0xbf6c[_0xfe9168];return _0x168b04;};'use strict';var _=require(_0xcbf6('0x0'));var util=require(_0xcbf6('0x1'));var moment=require(_0xcbf6('0x2'));var BPromise=require('bluebird');var rs=require(_0xcbf6('0x3'));var fs=require('fs');var Redis=require(_0xcbf6('0x4'));var db=require(_0xcbf6('0x5'))['db'];var utils=require(_0xcbf6('0x6'));var logger=require(_0xcbf6('0x7'))(_0xcbf6('0x8'));var config=require(_0xcbf6('0x9'));var jayson=require(_0xcbf6('0xa'));var client=jayson[_0xcbf6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a317b,_0x5b5779,_0xcc7498){return new BPromise(function(_0x8acbbe,_0x46398c){return client[_0xcbf6('0xc')](_0x4a317b,_0xcc7498)[_0xcbf6('0xd')](function(_0x2d131d){logger[_0xcbf6('0xe')](_0xcbf6('0xf'),_0x5b5779,'request\x20sent');logger[_0xcbf6('0x10')](_0xcbf6('0x11'),_0x5b5779,'request\x20sent',JSON['stringify'](_0x2d131d));if(_0x2d131d[_0xcbf6('0x12')]){if(_0x2d131d['error'][_0xcbf6('0x13')]===0x1f4){logger[_0xcbf6('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5b5779,_0x2d131d['error']['message']);return _0x46398c(_0x2d131d[_0xcbf6('0x12')][_0xcbf6('0x14')]);}logger[_0xcbf6('0x12')](_0xcbf6('0xf'),_0x5b5779,_0x2d131d['error'][_0xcbf6('0x14')]);return _0x8acbbe(_0x2d131d[_0xcbf6('0x12')][_0xcbf6('0x14')]);}else{logger[_0xcbf6('0xe')](_0xcbf6('0xf'),_0x5b5779,_0xcbf6('0x15'));_0x8acbbe(_0x2d131d[_0xcbf6('0x16')][_0xcbf6('0x14')]);}})['catch'](function(_0x370089){logger[_0xcbf6('0x12')](_0xcbf6('0xf'),_0x5b5779,_0x370089);_0x46398c(_0x370089);});});} \ No newline at end of file +var _0x6857=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3a3569,_0x1fdbf4){var _0x3ca86c=function(_0x4cf534){while(--_0x4cf534){_0x3a3569['push'](_0x3a3569['shift']());}};_0x3ca86c(++_0x1fdbf4);}(_0x6857,0x175));var _0x7685=function(_0x418c51,_0x40e1fd){_0x418c51=_0x418c51-0x0;var _0x3ab926=_0x6857[_0x418c51];return _0x3ab926;};'use strict';var _=require(_0x7685('0x0'));var util=require('util');var moment=require(_0x7685('0x1'));var BPromise=require(_0x7685('0x2'));var rs=require(_0x7685('0x3'));var fs=require('fs');var Redis=require(_0x7685('0x4'));var db=require(_0x7685('0x5'))['db'];var utils=require(_0x7685('0x6'));var logger=require('../../config/logger')(_0x7685('0x7'));var config=require(_0x7685('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7685('0x9')][_0x7685('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360e4d,_0x5225dd,_0x930444){return new BPromise(function(_0x150068,_0x638d9c){return client[_0x7685('0xb')](_0x360e4d,_0x930444)['then'](function(_0x38006c){logger[_0x7685('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5225dd,'request\x20sent');logger['debug'](_0x7685('0xd'),_0x5225dd,_0x7685('0xe'),JSON[_0x7685('0xf')](_0x38006c));if(_0x38006c['error']){if(_0x38006c[_0x7685('0x10')][_0x7685('0x11')]===0x1f4){logger[_0x7685('0x10')](_0x7685('0x12'),_0x5225dd,_0x38006c[_0x7685('0x10')]['message']);return _0x638d9c(_0x38006c['error'][_0x7685('0x13')]);}logger[_0x7685('0x10')](_0x7685('0x12'),_0x5225dd,_0x38006c[_0x7685('0x10')]['message']);return _0x150068(_0x38006c[_0x7685('0x10')][_0x7685('0x13')]);}else{logger['info'](_0x7685('0x12'),_0x5225dd,_0x7685('0xe'));_0x150068(_0x38006c[_0x7685('0x14')][_0x7685('0x13')]);}})[_0x7685('0x15')](function(_0x4b843b){logger['error'](_0x7685('0x12'),_0x5225dd,_0x4b843b);_0x638d9c(_0x4b843b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8ef5332..baaa646 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 _0x6743=['destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete'];(function(_0xee4883,_0x2529ee){var _0x43629d=function(_0x374e2a){while(--_0x374e2a){_0xee4883['push'](_0xee4883['shift']());}};_0x43629d(++_0x2529ee);}(_0x6743,0x80));var _0x3674=function(_0x46012c,_0x66bacf){_0x46012c=_0x46012c-0x0;var _0x26d30f=_0x6743[_0x46012c];return _0x26d30f;};'use strict';var multer=require(_0x3674('0x0'));var util=require(_0x3674('0x1'));var path=require('path');var timeout=require(_0x3674('0x2'));var express=require('express');var router=express[_0x3674('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3674('0x4'));var config=require('../../config/environment');var controller=require(_0x3674('0x5'));router[_0x3674('0x6')]('/',auth['isAuthenticated'](),controller[_0x3674('0x7')]);router['get']('/:id',auth[_0x3674('0x8')](),controller['show']);router['get'](_0x3674('0x9'),auth[_0x3674('0x8')](),controller[_0x3674('0xa')]);router[_0x3674('0x6')](_0x3674('0xb'),auth[_0x3674('0x8')](),controller[_0x3674('0xc')]);router[_0x3674('0xd')]('/',auth[_0x3674('0x8')](),controller[_0x3674('0xe')]);router['post'](_0x3674('0x9'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3674('0xf')](_0x3674('0x10'),auth[_0x3674('0x8')](),controller[_0x3674('0x11')]);router[_0x3674('0x12')]('/:id',auth[_0x3674('0x8')](),controller[_0x3674('0x13')]);module[_0x3674('0x14')]=router; \ No newline at end of file +var _0xa6fb=['/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x452b17,_0x36366f){var _0x4172f9=function(_0x105c32){while(--_0x105c32){_0x452b17['push'](_0x452b17['shift']());}};_0x4172f9(++_0x36366f);}(_0xa6fb,0xd5));var _0xba6f=function(_0x197afe,_0x5b4f36){_0x197afe=_0x197afe-0x0;var _0x227d26=_0xa6fb[_0x197afe];return _0x227d26;};'use strict';var multer=require(_0xba6f('0x0'));var util=require(_0xba6f('0x1'));var path=require(_0xba6f('0x2'));var timeout=require(_0xba6f('0x3'));var express=require(_0xba6f('0x4'));var router=express[_0xba6f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba6f('0x6'));var interaction=require(_0xba6f('0x7'));var config=require(_0xba6f('0x8'));var controller=require(_0xba6f('0x9'));router[_0xba6f('0xa')]('/',auth[_0xba6f('0xb')](),controller['index']);router[_0xba6f('0xa')]('/:id',auth[_0xba6f('0xb')](),controller['show']);router[_0xba6f('0xa')](_0xba6f('0xc'),auth[_0xba6f('0xb')](),controller['getConfigurations']);router[_0xba6f('0xa')](_0xba6f('0xd'),auth[_0xba6f('0xb')](),controller[_0xba6f('0xe')]);router[_0xba6f('0xf')]('/',auth[_0xba6f('0xb')](),controller[_0xba6f('0x10')]);router[_0xba6f('0xf')](_0xba6f('0xc'),auth[_0xba6f('0xb')](),controller[_0xba6f('0x11')]);router['put'](_0xba6f('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xba6f('0x13')](_0xba6f('0x12'),auth[_0xba6f('0xb')](),controller[_0xba6f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 93e8551..5d2210b 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 _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x2c87a8,_0x31378a){var _0x27ad4d=function(_0x44788c){while(--_0x44788c){_0x2c87a8['push'](_0x2c87a8['shift']());}};_0x27ad4d(++_0x31378a);}(_0xd824,0xc2));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7b84=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7b84,0x17c));var _0x47b8=function(_0x1a43e1,_0x40654b){_0x1a43e1=_0x1a43e1-0x0;var _0x5b41ce=_0x7b84[_0x1a43e1];return _0x5b41ce;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')]},'description':{'type':Sequelize[_0x47b8('0x2')]},'username':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x3')},'apiKey':{'type':Sequelize[_0x47b8('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x47b8('0x4')},'serverUrl':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b368e61..95bcbac 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 _0xb12d=['fields','hasOwnProperty','nolimit','order','where','pick','merge','FreshdeskAccount','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','rawAttributes','sort','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','remoteUri','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','default','custom_text','custom_dropdown','choices','capitalize','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x555491,_0x423f2c){var _0x4acccc=function(_0x3b3287){while(--_0x3b3287){_0x555491['push'](_0x555491['shift']());}};_0x4acccc(++_0x423f2c);}(_0xb12d,0x124));var _0xdb12=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xb12d[_0x3b1b23];return _0x1efc85;};'use strict';var emlformat=require(_0xdb12('0x0'));var rimraf=require(_0xdb12('0x1'));var zipdir=require(_0xdb12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb12('0x3'));var moment=require('moment');var BPromise=require(_0xdb12('0x4'));var Mustache=require(_0xdb12('0x5'));var util=require(_0xdb12('0x6'));var path=require(_0xdb12('0x7'));var sox=require(_0xdb12('0x8'));var csv=require(_0xdb12('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb12('0xa'));var _=require(_0xdb12('0xb'));var squel=require(_0xdb12('0xc'));var crypto=require(_0xdb12('0xd'));var jsforce=require(_0xdb12('0xe'));var deskjs=require(_0xdb12('0xf'));var toCsv=require(_0xdb12('0x9'));var querystring=require(_0xdb12('0x10'));var Papa=require('papaparse');var Redis=require(_0xdb12('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdb12('0x12'));var as=require(_0xdb12('0x13'));var hardwareService=require(_0xdb12('0x14'));var logger=require('../../config/logger')(_0xdb12('0x15'));var utils=require(_0xdb12('0x16'));var config=require(_0xdb12('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb12('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f607f,_0x127a69){_0x127a69=_0x127a69||0xcc;return function(_0x2aa078){if(_0x2aa078){return _0x3f607f['sendStatus'](_0x127a69);}return _0x3f607f[_0xdb12('0x19')](_0x127a69)[_0xdb12('0x1a')]();};}function respondWithResult(_0x55d032,_0x44b39c){_0x44b39c=_0x44b39c||0xc8;return function(_0x490e71){if(_0x490e71){return _0x55d032[_0xdb12('0x19')](_0x44b39c)[_0xdb12('0x1b')](_0x490e71);}};}function respondWithFilteredResult(_0x54a745,_0x1dc8b8){return function(_0x4325a9){if(_0x4325a9){var _0x477a29=typeof _0x1dc8b8[_0xdb12('0x1c')]==='undefined'&&typeof _0x1dc8b8['limit']===_0xdb12('0x1d');var _0x38b639=_0x4325a9['count'];var _0x40d2b9=_0x477a29?0x0:_0x1dc8b8[_0xdb12('0x1c')];var _0x2e1926=_0x477a29?_0x4325a9[_0xdb12('0x1e')]:_0x1dc8b8[_0xdb12('0x1c')]+_0x1dc8b8[_0xdb12('0x1f')];var _0x4481cb;if(_0x2e1926>=_0x38b639){_0x2e1926=_0x38b639;_0x4481cb=0xc8;}else{_0x4481cb=0xce;}_0x54a745[_0xdb12('0x19')](_0x4481cb);return _0x54a745[_0xdb12('0x20')](_0xdb12('0x21'),_0x40d2b9+'-'+_0x2e1926+'/'+_0x38b639)[_0xdb12('0x1b')](_0x4325a9);}return null;};}function patchUpdates(_0x3aaafc){return function(_0x2e40d3){try{jsonpatch[_0xdb12('0x22')](_0x2e40d3,_0x3aaafc,!![]);}catch(_0x37b293){return BPromise['reject'](_0x37b293);}return _0x2e40d3[_0xdb12('0x23')]();};}function saveUpdates(_0x2ae3c9,_0x20aecf){return function(_0x2ff27a){if(_0x2ff27a){return _0x2ff27a[_0xdb12('0x24')](_0x2ae3c9)[_0xdb12('0x25')](function(_0x9dc121){return _0x9dc121;});}return null;};}function removeEntity(_0x32190c,_0x3ae83a){return function(_0x471c50){if(_0x471c50){return _0x471c50[_0xdb12('0x26')]()[_0xdb12('0x25')](function(){_0x32190c[_0xdb12('0x19')](0xcc)[_0xdb12('0x1a')]();});}};}function handleEntityNotFound(_0x182090,_0x1f5a3e){return function(_0x34f8ae){if(!_0x34f8ae){_0x182090[_0xdb12('0x27')](0x194);}return _0x34f8ae;};}function handleError(_0x456395,_0x5ec5af){_0x5ec5af=_0x5ec5af||0x1f4;return function(_0x8cb4d6){logger['error'](_0x8cb4d6['stack']);if(_0x8cb4d6[_0xdb12('0x28')]){delete _0x8cb4d6[_0xdb12('0x28')];}_0x456395[_0xdb12('0x19')](_0x5ec5af)[_0xdb12('0x29')](_0x8cb4d6);};}exports[_0xdb12('0x2a')]=function(_0xa5da71,_0x2187e6){var _0x43131b={},_0x5dd88e={},_0x32a1dd={'count':0x0,'rows':[]};var _0x19d6da=_[_0xdb12('0x2b')](db['FreshdeskAccount']['rawAttributes'],function(_0x3ac501){return{'name':_0x3ac501[_0xdb12('0x2c')],'type':_0x3ac501[_0xdb12('0x2d')][_0xdb12('0x2e')]};});_0x5dd88e[_0xdb12('0x2f')]=_[_0xdb12('0x2b')](_0x19d6da,_0xdb12('0x28'));_0x5dd88e[_0xdb12('0x30')]=_[_0xdb12('0x31')](_0xa5da71[_0xdb12('0x30')]);_0x5dd88e[_0xdb12('0x32')]=_[_0xdb12('0x33')](_0x5dd88e[_0xdb12('0x2f')],_0x5dd88e['query']);_0x43131b[_0xdb12('0x34')]=_[_0xdb12('0x33')](_0x5dd88e['model'],qs['fields'](_0xa5da71[_0xdb12('0x30')][_0xdb12('0x35')]));_0x43131b[_0xdb12('0x34')]=_0x43131b['attributes']['length']?_0x43131b[_0xdb12('0x34')]:_0x5dd88e['model'];if(!_0xa5da71[_0xdb12('0x30')][_0xdb12('0x36')](_0xdb12('0x37'))){_0x43131b[_0xdb12('0x1f')]=qs[_0xdb12('0x1f')](_0xa5da71['query']['limit']);_0x43131b['offset']=qs['offset'](_0xa5da71[_0xdb12('0x30')]['offset']);}_0x43131b[_0xdb12('0x38')]=qs['sort'](_0xa5da71['query']['sort']);_0x43131b[_0xdb12('0x39')]=qs['filters'](_[_0xdb12('0x3a')](_0xa5da71['query'],_0x5dd88e['filters']),_0x19d6da);if(_0xa5da71['query']['filter']){_0x43131b[_0xdb12('0x39')]=_[_0xdb12('0x3b')](_0x43131b[_0xdb12('0x39')],{'$or':_['map'](_0x19d6da,function(_0x1e14dd){if(_0x1e14dd['type']!=='VIRTUAL'){var _0x53da36={};_0x53da36[_0x1e14dd[_0xdb12('0x28')]]={'$like':'%'+_0xa5da71['query']['filter']+'%'};return _0x53da36;}})});}_0x43131b=_[_0xdb12('0x3b')]({},_0x43131b,_0xa5da71['options']);var _0x137136={'where':_0x43131b['where']};return db[_0xdb12('0x3c')][_0xdb12('0x1e')](_0x137136)['then'](function(_0x1fd46c){_0x32a1dd['count']=_0x1fd46c;if(_0xa5da71['query'][_0xdb12('0x3d')]){_0x43131b[_0xdb12('0x3e')]=[{'all':!![]}];}return db[_0xdb12('0x3c')][_0xdb12('0x3f')](_0x43131b);})['then'](function(_0x5ee617){_0x32a1dd[_0xdb12('0x40')]=_0x5ee617;return _0x32a1dd;})[_0xdb12('0x25')](respondWithFilteredResult(_0x2187e6,_0x43131b))['catch'](handleError(_0x2187e6,null));};exports[_0xdb12('0x41')]=function(_0x22bfe2,_0x227e64){var _0x44b13d={'raw':![],'where':{'id':_0x22bfe2[_0xdb12('0x42')]['id']}},_0x53f5f1={};_0x53f5f1[_0xdb12('0x2f')]=_[_0xdb12('0x31')](db[_0xdb12('0x3c')]['rawAttributes']);_0x53f5f1[_0xdb12('0x30')]=_[_0xdb12('0x31')](_0x22bfe2[_0xdb12('0x30')]);_0x53f5f1[_0xdb12('0x32')]=_['intersection'](_0x53f5f1[_0xdb12('0x2f')],_0x53f5f1[_0xdb12('0x30')]);_0x44b13d[_0xdb12('0x34')]=_['intersection'](_0x53f5f1[_0xdb12('0x2f')],qs[_0xdb12('0x35')](_0x22bfe2[_0xdb12('0x30')][_0xdb12('0x35')]));_0x44b13d[_0xdb12('0x34')]=_0x44b13d[_0xdb12('0x34')][_0xdb12('0x43')]?_0x44b13d['attributes']:_0x53f5f1[_0xdb12('0x2f')];if(_0x22bfe2[_0xdb12('0x30')][_0xdb12('0x3d')]){_0x44b13d[_0xdb12('0x3e')]=[{'all':!![]}];}_0x44b13d=_['merge']({},_0x44b13d,_0x22bfe2[_0xdb12('0x44')]);return db[_0xdb12('0x3c')]['find'](_0x44b13d)[_0xdb12('0x25')](handleEntityNotFound(_0x227e64,null))[_0xdb12('0x25')](respondWithResult(_0x227e64,null))[_0xdb12('0x45')](handleError(_0x227e64,null));};exports[_0xdb12('0x46')]=function(_0x31c230,_0x267f9e){return db['FreshdeskAccount'][_0xdb12('0x46')](_0x31c230[_0xdb12('0x47')],{})[_0xdb12('0x25')](respondWithResult(_0x267f9e,0xc9))[_0xdb12('0x45')](handleError(_0x267f9e,null));};exports[_0xdb12('0x24')]=function(_0x2f5b53,_0xdf1329){if(_0x2f5b53['body']['id']){delete _0x2f5b53[_0xdb12('0x47')]['id'];}return db[_0xdb12('0x3c')][_0xdb12('0x48')]({'where':{'id':_0x2f5b53[_0xdb12('0x42')]['id']}})[_0xdb12('0x25')](handleEntityNotFound(_0xdf1329,null))[_0xdb12('0x25')](saveUpdates(_0x2f5b53[_0xdb12('0x47')],null))[_0xdb12('0x25')](respondWithResult(_0xdf1329,null))[_0xdb12('0x45')](handleError(_0xdf1329,null));};exports[_0xdb12('0x26')]=function(_0xcca8dc,_0x2a63ec){return db[_0xdb12('0x3c')][_0xdb12('0x48')]({'where':{'id':_0xcca8dc['params']['id']}})[_0xdb12('0x25')](handleEntityNotFound(_0x2a63ec,null))['then'](removeEntity(_0x2a63ec,null))['catch'](handleError(_0x2a63ec,null));};exports[_0xdb12('0x49')]=function(_0x473ad7,_0x3b7926,_0x9ac248){var _0x166792={};var _0x2189bc={};var _0x4e97d4;var _0x26a508;return db[_0xdb12('0x3c')][_0xdb12('0x4a')]({'where':{'id':_0x473ad7[_0xdb12('0x42')]['id']}})[_0xdb12('0x25')](handleEntityNotFound(_0x3b7926,null))[_0xdb12('0x25')](function(_0x362593){if(_0x362593){_0x4e97d4=_0x362593;_0x2189bc[_0xdb12('0x2f')]=_['keys'](db[_0xdb12('0x4b')][_0xdb12('0x4c')]);_0x2189bc['query']=_['keys'](_0x473ad7['query']);_0x2189bc[_0xdb12('0x32')]=_[_0xdb12('0x33')](_0x2189bc['model'],_0x2189bc['query']);_0x166792['attributes']=_[_0xdb12('0x33')](_0x2189bc[_0xdb12('0x2f')],qs[_0xdb12('0x35')](_0x473ad7[_0xdb12('0x30')][_0xdb12('0x35')]));_0x166792[_0xdb12('0x34')]=_0x166792[_0xdb12('0x34')]['length']?_0x166792[_0xdb12('0x34')]:_0x2189bc[_0xdb12('0x2f')];_0x166792[_0xdb12('0x38')]=qs[_0xdb12('0x4d')](_0x473ad7[_0xdb12('0x30')][_0xdb12('0x4d')]);_0x166792[_0xdb12('0x39')]=qs[_0xdb12('0x32')](_[_0xdb12('0x3a')](_0x473ad7[_0xdb12('0x30')],_0x2189bc[_0xdb12('0x32')]));if(_0x473ad7[_0xdb12('0x30')][_0xdb12('0x4e')]){_0x166792[_0xdb12('0x39')]=_[_0xdb12('0x3b')](_0x166792[_0xdb12('0x39')],{'$or':_['map'](_0x166792['attributes'],function(_0x2092b2){var _0x1384a0={};_0x1384a0[_0x2092b2]={'$like':'%'+_0x473ad7[_0xdb12('0x30')][_0xdb12('0x4e')]+'%'};return _0x1384a0;})});}_0x166792=_[_0xdb12('0x3b')]({},_0x166792,_0x473ad7[_0xdb12('0x44')]);return _0x4e97d4[_0xdb12('0x49')](_0x166792);}})[_0xdb12('0x25')](function(_0x2f0b1f){if(_0x2f0b1f){_0x26a508=_0x2f0b1f[_0xdb12('0x43')];if(!_0x473ad7[_0xdb12('0x30')][_0xdb12('0x36')](_0xdb12('0x37'))){_0x166792[_0xdb12('0x1f')]=qs['limit'](_0x473ad7[_0xdb12('0x30')][_0xdb12('0x1f')]);_0x166792[_0xdb12('0x1c')]=qs['offset'](_0x473ad7['query'][_0xdb12('0x1c')]);}return _0x4e97d4[_0xdb12('0x49')](_0x166792);}})['then'](function(_0x561109){if(_0x561109){return _0x561109?{'count':_0x26a508,'rows':_0x561109}:null;}})[_0xdb12('0x25')](respondWithResult(_0x3b7926,null))[_0xdb12('0x45')](handleError(_0x3b7926,null));};exports[_0xdb12('0x4f')]=function(_0x510358,_0x99c2cb,_0x5bc689){if(_0x510358[_0xdb12('0x47')]['id']){delete _0x510358[_0xdb12('0x47')]['id'];}return db[_0xdb12('0x3c')]['findOne']({'where':{'id':_0x510358[_0xdb12('0x42')]['id']}})[_0xdb12('0x25')](handleEntityNotFound(_0x99c2cb,null))[_0xdb12('0x25')](function(_0x3a0494){if(_0x3a0494){_0x510358[_0xdb12('0x47')][_0xdb12('0x50')]=_0x3a0494['id'];_0x510358[_0xdb12('0x47')][_0xdb12('0x51')]=integrations[_0xdb12('0x52')](_0x510358[_0xdb12('0x47')][_0xdb12('0x53')],_0x510358[_0xdb12('0x47')][_0xdb12('0x2d')]);_0x510358[_0xdb12('0x47')]['Descriptions']=integrations['getDescriptions'](_0x510358[_0xdb12('0x47')][_0xdb12('0x53')],_0x510358[_0xdb12('0x47')][_0xdb12('0x2d')]);return db[_0xdb12('0x4b')][_0xdb12('0x46')](_0x510358[_0xdb12('0x47')],{'include':[{'model':db[_0xdb12('0x54')],'as':_0xdb12('0x51')},{'model':db['FreshdeskField'],'as':_0xdb12('0x55')}]});}return null;})[_0xdb12('0x25')](respondWithResult(_0x99c2cb,null))[_0xdb12('0x45')](handleError(_0x99c2cb,null));};exports['getFields']=function(_0x59d706,_0x16560a,_0x39cc0e){var _0x2bf69e='';return db[_0xdb12('0x3c')]['findOne']({'where':{'id':_0x59d706['params']['id']},'attributes':['id',_0xdb12('0x56'),'apiKey']})[_0xdb12('0x25')](handleEntityNotFound(_0x16560a,null))['then'](function(_0xcf052d){if(_0xcf052d){_0x2bf69e=_0xcf052d[_0xdb12('0x56')];var _0x98a34d=_0x2bf69e['slice'](-0x1);if(_0x98a34d==='/'){_0x2bf69e=_0x2bf69e[_0xdb12('0x57')](0x0,_0x2bf69e[_0xdb12('0x58')](_0x98a34d));}return rp({'method':_0xdb12('0x59'),'uri':util[_0xdb12('0x5a')](_0xdb12('0x5b'),_0x2bf69e,_0xdb12('0x5c')),'headers':{'Authorization':util[_0xdb12('0x5a')](_0xdb12('0x5d'),new Buffer(util[_0xdb12('0x5a')]('%s:X',_0xcf052d['apiKey']))[_0xdb12('0x5e')](_0xdb12('0x5f')))},'json':!![]});}})[_0xdb12('0x25')](function(_0x584903){if(_0x584903){var _0x1386ef=[_0xdb12('0x60'),_0xdb12('0x61'),_0xdb12('0x62'),_0xdb12('0x63'),'status',_0xdb12('0x64'),_0xdb12('0x65'),_0xdb12('0x66'),_0xdb12('0x67'),'group',_0xdb12('0x68')];_['remove'](_0x584903,function(_0x596cbb){return _0x1386ef['includes'](_0x596cbb[_0xdb12('0x28')])||!_0x596cbb[_0xdb12('0x69')]&&_0x596cbb['type']!==_0xdb12('0x6a')&&_0x596cbb[_0xdb12('0x2d')]!==_0xdb12('0x6b');});return{'count':_0x584903[_0xdb12('0x43')],'rows':_['map'](_0x584903,function(_0x1ca5cf){return{'id':_0x1ca5cf['name'],'name':_0x1ca5cf['label'],'custom':!_0x1ca5cf[_0xdb12('0x69')],'options':_0x1ca5cf['choices']?_['map'](_0x1ca5cf[_0xdb12('0x6c')],function(_0x167584){return{'name':_[_0xdb12('0x6d')](_0x167584),'value':_0x167584};}):[]};})};}})[_0xdb12('0x25')](respondWithResult(_0x16560a,null))[_0xdb12('0x45')](function(_0x5d23ca){var _0x1f457a=_0x59d706['query']['test']?0x1f4:_0x5d23ca[_0xdb12('0x6e')]||0x1f4;logger[_0xdb12('0x6f')](_0xdb12('0x70'),_0xdb12('0x71'),_0x1f457a,JSON['stringify'](_0x5d23ca));delete _0x5d23ca[_0xdb12('0x28')];if(_0x1f457a===0x191){_0x1f457a=0x190;}_0x16560a[_0xdb12('0x19')](_0x1f457a)[_0xdb12('0x29')](_0x59d706[_0xdb12('0x30')]['test']?{'message':_0xdb12('0x72'),'statusCode':_0x5d23ca[_0xdb12('0x6e')]}:_0x5d23ca);});}; \ No newline at end of file +var _0x39c4=['destroy','findOne','FreshdeskConfiguration','Subjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','toString','base64','requester','subject','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','then','rows','catch','show','params','keys','includeAll','find','create','body'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x39c4,0x174));var _0x439c=function(_0x1905ff,_0x31b31d){_0x1905ff=_0x1905ff-0x0;var _0x10ad5d=_0x39c4[_0x1905ff];return _0x10ad5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x439c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439c('0x3'));var path=require(_0x439c('0x4'));var sox=require(_0x439c('0x5'));var csv=require(_0x439c('0x6'));var ejs=require(_0x439c('0x7'));var fs=require('fs');var fs_extra=require(_0x439c('0x8'));var _=require(_0x439c('0x9'));var squel=require(_0x439c('0xa'));var crypto=require(_0x439c('0xb'));var jsforce=require(_0x439c('0xc'));var deskjs=require(_0x439c('0xd'));var toCsv=require(_0x439c('0x6'));var querystring=require(_0x439c('0xe'));var Papa=require(_0x439c('0xf'));var Redis=require(_0x439c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x439c('0x11'));var as=require(_0x439c('0x12'));var hardwareService=require(_0x439c('0x13'));var logger=require(_0x439c('0x14'))(_0x439c('0x15'));var utils=require(_0x439c('0x16'));var config=require(_0x439c('0x17'));var licenseUtil=require(_0x439c('0x18'));var db=require(_0x439c('0x19'))['db'];var integrations=require(_0x439c('0x1a'));function respondWithStatusCode(_0x305154,_0x2bd89){_0x2bd89=_0x2bd89||0xcc;return function(_0x518179){if(_0x518179){return _0x305154[_0x439c('0x1b')](_0x2bd89);}return _0x305154['status'](_0x2bd89)['end']();};}function respondWithResult(_0x1e367a,_0x47182e){_0x47182e=_0x47182e||0xc8;return function(_0x486451){if(_0x486451){return _0x1e367a[_0x439c('0x1c')](_0x47182e)[_0x439c('0x1d')](_0x486451);}};}function respondWithFilteredResult(_0x5b8898,_0x4f5b71){return function(_0x38d60d){if(_0x38d60d){var _0x5478b4=typeof _0x4f5b71[_0x439c('0x1e')]===_0x439c('0x1f')&&typeof _0x4f5b71[_0x439c('0x20')]==='undefined';var _0x33aeb1=_0x38d60d[_0x439c('0x21')];var _0x4635e7=_0x5478b4?0x0:_0x4f5b71[_0x439c('0x1e')];var _0x569a31=_0x5478b4?_0x38d60d[_0x439c('0x21')]:_0x4f5b71[_0x439c('0x1e')]+_0x4f5b71[_0x439c('0x20')];var _0x52fe98;if(_0x569a31>=_0x33aeb1){_0x569a31=_0x33aeb1;_0x52fe98=0xc8;}else{_0x52fe98=0xce;}_0x5b8898[_0x439c('0x1c')](_0x52fe98);return _0x5b8898['set']('Content-Range',_0x4635e7+'-'+_0x569a31+'/'+_0x33aeb1)[_0x439c('0x1d')](_0x38d60d);}return null;};}function patchUpdates(_0x5c6214){return function(_0x22d8e0){try{jsonpatch[_0x439c('0x22')](_0x22d8e0,_0x5c6214,!![]);}catch(_0x29958c){return BPromise[_0x439c('0x23')](_0x29958c);}return _0x22d8e0[_0x439c('0x24')]();};}function saveUpdates(_0x7cdb81,_0x193883){return function(_0x373f19){if(_0x373f19){return _0x373f19[_0x439c('0x25')](_0x7cdb81)['then'](function(_0x1b83b2){return _0x1b83b2;});}return null;};}function removeEntity(_0x1f8ef6,_0x49c1e3){return function(_0x222ccd){if(_0x222ccd){return _0x222ccd['destroy']()['then'](function(){_0x1f8ef6[_0x439c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3109,_0x467338){return function(_0x349d75){if(!_0x349d75){_0x2b3109[_0x439c('0x1b')](0x194);}return _0x349d75;};}function handleError(_0x390e59,_0x48cbf3){_0x48cbf3=_0x48cbf3||0x1f4;return function(_0x557dae){logger[_0x439c('0x26')](_0x557dae['stack']);if(_0x557dae[_0x439c('0x27')]){delete _0x557dae['name'];}_0x390e59[_0x439c('0x1c')](_0x48cbf3)[_0x439c('0x28')](_0x557dae);};}exports[_0x439c('0x29')]=function(_0x2f670b,_0x518b94){var _0x17ecfa={},_0x1fa033={},_0x291ab0={'count':0x0,'rows':[]};var _0x1ae717=_[_0x439c('0x2a')](db[_0x439c('0x2b')][_0x439c('0x2c')],function(_0x387833){return{'name':_0x387833[_0x439c('0x2d')],'type':_0x387833[_0x439c('0x2e')][_0x439c('0x2f')]};});_0x1fa033[_0x439c('0x30')]=_[_0x439c('0x2a')](_0x1ae717,_0x439c('0x27'));_0x1fa033['query']=_['keys'](_0x2f670b[_0x439c('0x31')]);_0x1fa033[_0x439c('0x32')]=_['intersection'](_0x1fa033[_0x439c('0x30')],_0x1fa033[_0x439c('0x31')]);_0x17ecfa[_0x439c('0x33')]=_[_0x439c('0x34')](_0x1fa033[_0x439c('0x30')],qs['fields'](_0x2f670b[_0x439c('0x31')][_0x439c('0x35')]));_0x17ecfa['attributes']=_0x17ecfa[_0x439c('0x33')][_0x439c('0x36')]?_0x17ecfa[_0x439c('0x33')]:_0x1fa033[_0x439c('0x30')];if(!_0x2f670b[_0x439c('0x31')][_0x439c('0x37')](_0x439c('0x38'))){_0x17ecfa[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x2f670b[_0x439c('0x31')][_0x439c('0x20')]);_0x17ecfa['offset']=qs[_0x439c('0x1e')](_0x2f670b['query'][_0x439c('0x1e')]);}_0x17ecfa[_0x439c('0x39')]=qs['sort'](_0x2f670b[_0x439c('0x31')][_0x439c('0x3a')]);_0x17ecfa['where']=qs['filters'](_[_0x439c('0x3b')](_0x2f670b['query'],_0x1fa033[_0x439c('0x32')]),_0x1ae717);if(_0x2f670b['query'][_0x439c('0x3c')]){_0x17ecfa[_0x439c('0x3d')]=_[_0x439c('0x3e')](_0x17ecfa[_0x439c('0x3d')],{'$or':_[_0x439c('0x2a')](_0x1ae717,function(_0x31ef6d){if(_0x31ef6d['type']!==_0x439c('0x3f')){var _0x47ac85={};_0x47ac85[_0x31ef6d[_0x439c('0x27')]]={'$like':'%'+_0x2f670b['query'][_0x439c('0x3c')]+'%'};return _0x47ac85;}})});}_0x17ecfa=_[_0x439c('0x3e')]({},_0x17ecfa,_0x2f670b[_0x439c('0x40')]);var _0x1a8d93={'where':_0x17ecfa[_0x439c('0x3d')]};return db[_0x439c('0x2b')][_0x439c('0x21')](_0x1a8d93)['then'](function(_0x5d3e22){_0x291ab0[_0x439c('0x21')]=_0x5d3e22;if(_0x2f670b[_0x439c('0x31')]['includeAll']){_0x17ecfa[_0x439c('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x17ecfa);})[_0x439c('0x42')](function(_0xa44162){_0x291ab0[_0x439c('0x43')]=_0xa44162;return _0x291ab0;})[_0x439c('0x42')](respondWithFilteredResult(_0x518b94,_0x17ecfa))[_0x439c('0x44')](handleError(_0x518b94,null));};exports[_0x439c('0x45')]=function(_0x3873bb,_0x5b31d8){var _0x340e07={'raw':![],'where':{'id':_0x3873bb[_0x439c('0x46')]['id']}},_0x45b24f={};_0x45b24f[_0x439c('0x30')]=_[_0x439c('0x47')](db['FreshdeskAccount'][_0x439c('0x2c')]);_0x45b24f[_0x439c('0x31')]=_[_0x439c('0x47')](_0x3873bb[_0x439c('0x31')]);_0x45b24f['filters']=_[_0x439c('0x34')](_0x45b24f[_0x439c('0x30')],_0x45b24f['query']);_0x340e07['attributes']=_['intersection'](_0x45b24f['model'],qs[_0x439c('0x35')](_0x3873bb['query']['fields']));_0x340e07[_0x439c('0x33')]=_0x340e07[_0x439c('0x33')]['length']?_0x340e07[_0x439c('0x33')]:_0x45b24f[_0x439c('0x30')];if(_0x3873bb[_0x439c('0x31')][_0x439c('0x48')]){_0x340e07[_0x439c('0x41')]=[{'all':!![]}];}_0x340e07=_['merge']({},_0x340e07,_0x3873bb[_0x439c('0x40')]);return db[_0x439c('0x2b')][_0x439c('0x49')](_0x340e07)[_0x439c('0x42')](handleEntityNotFound(_0x5b31d8,null))[_0x439c('0x42')](respondWithResult(_0x5b31d8,null))[_0x439c('0x44')](handleError(_0x5b31d8,null));};exports[_0x439c('0x4a')]=function(_0x2a090b,_0x12e102){return db[_0x439c('0x2b')][_0x439c('0x4a')](_0x2a090b[_0x439c('0x4b')],{})['then'](respondWithResult(_0x12e102,0xc9))[_0x439c('0x44')](handleError(_0x12e102,null));};exports[_0x439c('0x25')]=function(_0x180d0c,_0x4a5c56){if(_0x180d0c[_0x439c('0x4b')]['id']){delete _0x180d0c[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x180d0c[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a5c56,null))[_0x439c('0x42')](saveUpdates(_0x180d0c[_0x439c('0x4b')],null))[_0x439c('0x42')](respondWithResult(_0x4a5c56,null))[_0x439c('0x44')](handleError(_0x4a5c56,null));};exports[_0x439c('0x4c')]=function(_0x198648,_0x5dfebc){return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x198648[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dfebc,null))[_0x439c('0x42')](removeEntity(_0x5dfebc,null))[_0x439c('0x44')](handleError(_0x5dfebc,null));};exports['getConfigurations']=function(_0x44919e,_0x5f1844,_0x565d5f){var _0x204cbf={};var _0x348847={};var _0x43ebf5;var _0x57e81e;return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x44919e[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5f1844,null))['then'](function(_0x4d3f8c){if(_0x4d3f8c){_0x43ebf5=_0x4d3f8c;_0x348847['model']=_[_0x439c('0x47')](db[_0x439c('0x4e')]['rawAttributes']);_0x348847[_0x439c('0x31')]=_[_0x439c('0x47')](_0x44919e[_0x439c('0x31')]);_0x348847[_0x439c('0x32')]=_['intersection'](_0x348847[_0x439c('0x30')],_0x348847[_0x439c('0x31')]);_0x204cbf[_0x439c('0x33')]=_[_0x439c('0x34')](_0x348847['model'],qs[_0x439c('0x35')](_0x44919e[_0x439c('0x31')][_0x439c('0x35')]));_0x204cbf[_0x439c('0x33')]=_0x204cbf[_0x439c('0x33')][_0x439c('0x36')]?_0x204cbf['attributes']:_0x348847[_0x439c('0x30')];_0x204cbf[_0x439c('0x39')]=qs[_0x439c('0x3a')](_0x44919e[_0x439c('0x31')][_0x439c('0x3a')]);_0x204cbf[_0x439c('0x3d')]=qs[_0x439c('0x32')](_['pick'](_0x44919e[_0x439c('0x31')],_0x348847['filters']));if(_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]){_0x204cbf[_0x439c('0x3d')]=_['merge'](_0x204cbf['where'],{'$or':_[_0x439c('0x2a')](_0x204cbf['attributes'],function(_0x16723e){var _0x37ddd4={};_0x37ddd4[_0x16723e]={'$like':'%'+_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]+'%'};return _0x37ddd4;})});}_0x204cbf=_[_0x439c('0x3e')]({},_0x204cbf,_0x44919e[_0x439c('0x40')]);return _0x43ebf5['getConfigurations'](_0x204cbf);}})['then'](function(_0xbeacc1){if(_0xbeacc1){_0x57e81e=_0xbeacc1[_0x439c('0x36')];if(!_0x44919e[_0x439c('0x31')]['hasOwnProperty'](_0x439c('0x38'))){_0x204cbf[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x44919e['query'][_0x439c('0x20')]);_0x204cbf[_0x439c('0x1e')]=qs[_0x439c('0x1e')](_0x44919e[_0x439c('0x31')][_0x439c('0x1e')]);}return _0x43ebf5['getConfigurations'](_0x204cbf);}})[_0x439c('0x42')](function(_0x481481){if(_0x481481){return _0x481481?{'count':_0x57e81e,'rows':_0x481481}:null;}})[_0x439c('0x42')](respondWithResult(_0x5f1844,null))[_0x439c('0x44')](handleError(_0x5f1844,null));};exports['addConfiguration']=function(_0x2aa589,_0x5bb5c4,_0x950a8e){if(_0x2aa589[_0x439c('0x4b')]['id']){delete _0x2aa589[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x2aa589[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5bb5c4,null))[_0x439c('0x42')](function(_0x59bd8d){if(_0x59bd8d){_0x2aa589['body']['AccountId']=_0x59bd8d['id'];_0x2aa589[_0x439c('0x4b')][_0x439c('0x4f')]=integrations['getSubjects'](_0x2aa589['body']['channel'],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);_0x2aa589['body']['Descriptions']=integrations[_0x439c('0x50')](_0x2aa589[_0x439c('0x4b')][_0x439c('0x51')],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);return db[_0x439c('0x4e')]['create'](_0x2aa589[_0x439c('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':_0x439c('0x4f')},{'model':db[_0x439c('0x52')],'as':_0x439c('0x53')}]});}return null;})[_0x439c('0x42')](respondWithResult(_0x5bb5c4,null))[_0x439c('0x44')](handleError(_0x5bb5c4,null));};exports[_0x439c('0x54')]=function(_0x338905,_0x1ddd58,_0x4543f8){var _0x3406ab='';return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x338905[_0x439c('0x46')]['id']},'attributes':['id',_0x439c('0x55'),_0x439c('0x56')]})[_0x439c('0x42')](handleEntityNotFound(_0x1ddd58,null))[_0x439c('0x42')](function(_0xd3fdb0){if(_0xd3fdb0){_0x3406ab=_0xd3fdb0['remoteUri'];var _0x2c3a7f=_0x3406ab[_0x439c('0x57')](-0x1);if(_0x2c3a7f==='/'){_0x3406ab=_0x3406ab[_0x439c('0x58')](0x0,_0x3406ab['lastIndexOf'](_0x2c3a7f));}return rp({'method':_0x439c('0x59'),'uri':util['format'](_0x439c('0x5a'),_0x3406ab,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x439c('0x5b')]('Basic\x20%s',new Buffer(util[_0x439c('0x5b')]('%s:X',_0xd3fdb0['apiKey']))[_0x439c('0x5c')](_0x439c('0x5d')))},'json':!![]});}})[_0x439c('0x42')](function(_0x89692a){if(_0x89692a){var _0x357c9a=[_0x439c('0x5e'),_0x439c('0x5f'),_0x439c('0x60'),'description',_0x439c('0x1c'),_0x439c('0x61'),_0x439c('0x62'),_0x439c('0x63'),_0x439c('0x64'),_0x439c('0x62'),'company'];_[_0x439c('0x65')](_0x89692a,function(_0x593615){return _0x357c9a[_0x439c('0x66')](_0x593615['name'])||!_0x593615[_0x439c('0x67')]&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x68')&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x69');});return{'count':_0x89692a[_0x439c('0x36')],'rows':_[_0x439c('0x2a')](_0x89692a,function(_0x34e57f){return{'id':_0x34e57f[_0x439c('0x27')],'name':_0x34e57f[_0x439c('0x6a')],'custom':!_0x34e57f[_0x439c('0x67')],'options':_0x34e57f[_0x439c('0x6b')]?_['map'](_0x34e57f['choices'],function(_0x3fbf0b){return{'name':_['capitalize'](_0x3fbf0b),'value':_0x3fbf0b};}):[]};})};}})['then'](respondWithResult(_0x1ddd58,null))['catch'](function(_0x3c14be){var _0x11fdae=_0x338905[_0x439c('0x31')][_0x439c('0x6c')]?0x1f4:_0x3c14be['statusCode']||0x1f4;logger['error'](_0x439c('0x6d'),_0x439c('0x54'),_0x11fdae,JSON[_0x439c('0x6e')](_0x3c14be));delete _0x3c14be[_0x439c('0x27')];if(_0x11fdae===0x191){_0x11fdae=0x190;}_0x1ddd58[_0x439c('0x1c')](_0x11fdae)[_0x439c('0x28')](_0x338905['query'][_0x439c('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c14be[_0x439c('0x6f')]}:_0x3c14be);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1ed5bc7..dafd41a 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 _0x1fc3=['int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x26f06e,_0x3ff221){var _0x3d6def=function(_0x359009){while(--_0x359009){_0x26f06e['push'](_0x26f06e['shift']());}};_0x3d6def(++_0x3ff221);}(_0x1fc3,0x178));var _0x31fc=function(_0x108337,_0x249db3){_0x108337=_0x108337-0x0;var _0x53979d=_0x1fc3[_0x108337];return _0x53979d;};'use strict';var _=require(_0x31fc('0x0'));var util=require(_0x31fc('0x1'));var logger=require(_0x31fc('0x2'))(_0x31fc('0x3'));var moment=require('moment');var BPromise=require(_0x31fc('0x4'));var rp=require(_0x31fc('0x5'));var fs=require('fs');var path=require(_0x31fc('0x6'));var rimraf=require(_0x31fc('0x7'));var config=require(_0x31fc('0x8'));var attributes=require(_0x31fc('0x9'));var integrations=require(_0x31fc('0xa'));module[_0x31fc('0xb')]=function(_0x2626e3,_0x35a285){return _0x2626e3[_0x31fc('0xc')](_0x31fc('0xd'),attributes,{'tableName':_0x31fc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4148=['int_freshdesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x3e79ca,_0x4b37c1){var _0xe18cd5=function(_0x1e2ae5){while(--_0x1e2ae5){_0x3e79ca['push'](_0x3e79ca['shift']());}};_0xe18cd5(++_0x4b37c1);}(_0x4148,0x1da));var _0x8414=function(_0xd6db21,_0x1d08f3){_0xd6db21=_0xd6db21-0x0;var _0x3b96a0=_0x4148[_0xd6db21];return _0x3b96a0;};'use strict';var _=require('lodash');var util=require(_0x8414('0x0'));var logger=require(_0x8414('0x1'))(_0x8414('0x2'));var moment=require('moment');var BPromise=require(_0x8414('0x3'));var rp=require(_0x8414('0x4'));var fs=require('fs');var path=require(_0x8414('0x5'));var rimraf=require('rimraf');var config=require(_0x8414('0x6'));var attributes=require(_0x8414('0x7'));var integrations=require(_0x8414('0x8'));module['exports']=function(_0x54c369,_0x25e81c){return _0x54c369[_0x8414('0x9')]('FreshdeskAccount',attributes,{'tableName':_0x8414('0xa'),'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 56507c5..1480b68 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 _0xc38d=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','options','raw','where','attributes','limit','map','include','model','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x2df2eb,_0x3959a0){var _0xa5abb9=function(_0x49830e){while(--_0x49830e){_0x2df2eb['push'](_0x2df2eb['shift']());}};_0xa5abb9(++_0x3959a0);}(_0xc38d,0x110));var _0xdc38=function(_0xf41566,_0xce102f){_0xf41566=_0xf41566-0x0;var _0x5a05c1=_0xc38d[_0xf41566];return _0x5a05c1;};'use strict';var _=require(_0xdc38('0x0'));var util=require(_0xdc38('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc38('0x2'));var fs=require('fs');var Redis=require(_0xdc38('0x3'));var db=require(_0xdc38('0x4'))['db'];var utils=require(_0xdc38('0x5'));var logger=require(_0xdc38('0x6'))(_0xdc38('0x7'));var config=require(_0xdc38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdc38('0x9')][_0xdc38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58809b,_0x207f67,_0x4b5f47){return new BPromise(function(_0x1b952a,_0x81d274){return client[_0xdc38('0xb')](_0x58809b,_0x4b5f47)[_0xdc38('0xc')](function(_0x2c6954){logger[_0xdc38('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x207f67,_0xdc38('0xe'));logger[_0xdc38('0xf')](_0xdc38('0x10'),_0x207f67,_0xdc38('0xe'),JSON[_0xdc38('0x11')](_0x2c6954));if(_0x2c6954['error']){if(_0x2c6954['error']['code']===0x1f4){logger[_0xdc38('0x12')](_0xdc38('0x13'),_0x207f67,_0x2c6954['error'][_0xdc38('0x14')]);return _0x81d274(_0x2c6954[_0xdc38('0x12')][_0xdc38('0x14')]);}logger['error'](_0xdc38('0x13'),_0x207f67,_0x2c6954[_0xdc38('0x12')][_0xdc38('0x14')]);return _0x1b952a(_0x2c6954['error'][_0xdc38('0x14')]);}else{logger[_0xdc38('0xd')](_0xdc38('0x13'),_0x207f67,'request\x20sent');_0x1b952a(_0x2c6954[_0xdc38('0x15')]['message']);}})[_0xdc38('0x16')](function(_0xc8205d){logger[_0xdc38('0x12')](_0xdc38('0x13'),_0x207f67,_0xc8205d);_0x81d274(_0xc8205d);});});}exports[_0xdc38('0x17')]=function(_0x29627b){var _0x4c38b2=this;return new Promise(function(_0x1a3e81,_0x4352be){return db['FreshdeskAccount']['findAll']({'raw':_0x29627b[_0xdc38('0x18')]?_0x29627b[_0xdc38('0x18')][_0xdc38('0x19')]===undefined?!![]:![]:!![],'where':_0x29627b[_0xdc38('0x18')]?_0x29627b[_0xdc38('0x18')][_0xdc38('0x1a')]||null:null,'attributes':_0x29627b[_0xdc38('0x18')]?_0x29627b['options'][_0xdc38('0x1b')]||null:null,'limit':_0x29627b[_0xdc38('0x18')]?_0x29627b['options'][_0xdc38('0x1c')]||null:null,'include':_0x29627b[_0xdc38('0x18')]?_0x29627b[_0xdc38('0x18')]['include']?_[_0xdc38('0x1d')](_0x29627b[_0xdc38('0x18')][_0xdc38('0x1e')],function(_0x2c5a96){return{'model':db[_0x2c5a96['model']],'as':_0x2c5a96['as'],'attributes':_0x2c5a96[_0xdc38('0x1b')],'include':_0x2c5a96['include']?_[_0xdc38('0x1d')](_0x2c5a96[_0xdc38('0x1e')],function(_0x19959f){return{'model':db[_0x19959f[_0xdc38('0x1f')]],'as':_0x19959f['as'],'attributes':_0x19959f[_0xdc38('0x1b')],'include':_0x19959f[_0xdc38('0x1e')]?_[_0xdc38('0x1d')](_0x19959f[_0xdc38('0x1e')],function(_0x205571){return{'model':db[_0x205571[_0xdc38('0x1f')]],'as':_0x205571['as'],'attributes':_0x205571['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc38('0xc')](function(_0xc6f6dd){logger[_0xdc38('0xd')](_0xdc38('0x17'),_0x29627b);logger[_0xdc38('0xf')](_0xdc38('0x17'),_0x29627b,JSON[_0xdc38('0x11')](_0xc6f6dd));_0x1a3e81(_0xc6f6dd);})[_0xdc38('0x16')](function(_0x5cc211){logger[_0xdc38('0x12')](_0xdc38('0x17'),_0x5cc211[_0xdc38('0x14')],_0x29627b);_0x4352be(_0x4c38b2[_0xdc38('0x12')](0x1f4,_0x5cc211['message']));});});};exports[_0xdc38('0x20')]=function(_0x2d54e5){var _0x1a3637=this;return new Promise(function(_0x143141,_0x39ae82){return db[_0xdc38('0x21')]['find']({'raw':_0x2d54e5[_0xdc38('0x18')]?_0x2d54e5[_0xdc38('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2d54e5['options']?_0x2d54e5[_0xdc38('0x18')][_0xdc38('0x1a')]||null:null,'attributes':_0x2d54e5['options']?_0x2d54e5[_0xdc38('0x18')][_0xdc38('0x1b')]||null:null,'include':_0x2d54e5[_0xdc38('0x18')]?_0x2d54e5[_0xdc38('0x18')][_0xdc38('0x1e')]?_[_0xdc38('0x1d')](_0x2d54e5[_0xdc38('0x18')]['include'],function(_0x24b130){return{'model':db[_0x24b130[_0xdc38('0x1f')]],'as':_0x24b130['as'],'attributes':_0x24b130[_0xdc38('0x1b')],'include':_0x24b130[_0xdc38('0x1e')]?_[_0xdc38('0x1d')](_0x24b130['include'],function(_0x303909){return{'model':db[_0x303909[_0xdc38('0x1f')]],'as':_0x303909['as'],'attributes':_0x303909[_0xdc38('0x1b')],'include':_0x303909[_0xdc38('0x1e')]?_[_0xdc38('0x1d')](_0x303909[_0xdc38('0x1e')],function(_0xd1c100){return{'model':db[_0xd1c100['model']],'as':_0xd1c100['as'],'attributes':_0xd1c100['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc38('0xc')](function(_0x360570){logger[_0xdc38('0xd')](_0xdc38('0x20'),_0x2d54e5);logger[_0xdc38('0xf')](_0xdc38('0x20'),_0x2d54e5,JSON[_0xdc38('0x11')](_0x360570));_0x143141(_0x360570);})[_0xdc38('0x16')](function(_0x24cb4b){logger['error'](_0xdc38('0x20'),_0x24cb4b['message'],_0x2d54e5);_0x39ae82(_0x1a3637[_0xdc38('0x12')](0x1f4,_0x24cb4b[_0xdc38('0x14')]));});});}; \ No newline at end of file +var _0xa884=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','map','include','model','then','ShowFreshdeskAccount','raw','where','stringify','lodash','util','moment','randomstring'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0xa884,0x15a));var _0x4a88=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa884[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var moment=require(_0x4a88('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a88('0x3'));var fs=require('fs');var Redis=require(_0x4a88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a88('0x5'));var logger=require(_0x4a88('0x6'))(_0x4a88('0x7'));var config=require(_0x4a88('0x8'));var jayson=require(_0x4a88('0x9'));var client=jayson['client'][_0x4a88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574a8f,_0x3c7f27,_0xc8812c){return new BPromise(function(_0x3be228,_0x436bcb){return client[_0x4a88('0xb')](_0x574a8f,_0xc8812c)['then'](function(_0x2b6fb0){logger['info'](_0x4a88('0xc'),_0x3c7f27,_0x4a88('0xd'));logger[_0x4a88('0xe')](_0x4a88('0xf'),_0x3c7f27,_0x4a88('0xd'),JSON['stringify'](_0x2b6fb0));if(_0x2b6fb0[_0x4a88('0x10')]){if(_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x11')]===0x1f4){logger[_0x4a88('0x10')](_0x4a88('0xc'),_0x3c7f27,_0x2b6fb0[_0x4a88('0x10')]['message']);return _0x436bcb(_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x12')]);}logger[_0x4a88('0x10')](_0x4a88('0xc'),_0x3c7f27,_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x12')]);return _0x3be228(_0x2b6fb0['error'][_0x4a88('0x12')]);}else{logger[_0x4a88('0x13')](_0x4a88('0xc'),_0x3c7f27,'request\x20sent');_0x3be228(_0x2b6fb0[_0x4a88('0x14')][_0x4a88('0x12')]);}})[_0x4a88('0x15')](function(_0x55ffd4){logger['error'](_0x4a88('0xc'),_0x3c7f27,_0x55ffd4);_0x436bcb(_0x55ffd4);});});}exports[_0x4a88('0x16')]=function(_0x56b912){var _0x235ae4=this;return new Promise(function(_0x2a85f7,_0x45167d){return db['FreshdeskAccount'][_0x4a88('0x17')]({'raw':_0x56b912[_0x4a88('0x18')]?_0x56b912['options']['raw']===undefined?!![]:![]:!![],'where':_0x56b912[_0x4a88('0x18')]?_0x56b912['options']['where']||null:null,'attributes':_0x56b912[_0x4a88('0x18')]?_0x56b912[_0x4a88('0x18')][_0x4a88('0x19')]||null:null,'limit':_0x56b912[_0x4a88('0x18')]?_0x56b912[_0x4a88('0x18')][_0x4a88('0x1a')]||null:null,'include':_0x56b912['options']?_0x56b912[_0x4a88('0x18')]['include']?_[_0x4a88('0x1b')](_0x56b912[_0x4a88('0x18')][_0x4a88('0x1c')],function(_0x2b503a){return{'model':db[_0x2b503a[_0x4a88('0x1d')]],'as':_0x2b503a['as'],'attributes':_0x2b503a['attributes'],'include':_0x2b503a[_0x4a88('0x1c')]?_[_0x4a88('0x1b')](_0x2b503a['include'],function(_0x1200be){return{'model':db[_0x1200be['model']],'as':_0x1200be['as'],'attributes':_0x1200be['attributes'],'include':_0x1200be[_0x4a88('0x1c')]?_['map'](_0x1200be[_0x4a88('0x1c')],function(_0x40bb76){return{'model':db[_0x40bb76[_0x4a88('0x1d')]],'as':_0x40bb76['as'],'attributes':_0x40bb76['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a88('0x1e')](function(_0x4b8bfa){logger[_0x4a88('0x13')](_0x4a88('0x16'),_0x56b912);logger['debug'](_0x4a88('0x16'),_0x56b912,JSON['stringify'](_0x4b8bfa));_0x2a85f7(_0x4b8bfa);})[_0x4a88('0x15')](function(_0x30a562){logger[_0x4a88('0x10')]('GetFreshdeskAccount',_0x30a562['message'],_0x56b912);_0x45167d(_0x235ae4[_0x4a88('0x10')](0x1f4,_0x30a562[_0x4a88('0x12')]));});});};exports[_0x4a88('0x1f')]=function(_0x15546c){var _0x1aa947=this;return new Promise(function(_0x28f213,_0x2999bc){return db['FreshdeskAccount']['find']({'raw':_0x15546c['options']?_0x15546c[_0x4a88('0x18')][_0x4a88('0x20')]===undefined?!![]:![]:!![],'where':_0x15546c[_0x4a88('0x18')]?_0x15546c[_0x4a88('0x18')][_0x4a88('0x21')]||null:null,'attributes':_0x15546c[_0x4a88('0x18')]?_0x15546c['options'][_0x4a88('0x19')]||null:null,'include':_0x15546c['options']?_0x15546c[_0x4a88('0x18')][_0x4a88('0x1c')]?_['map'](_0x15546c[_0x4a88('0x18')][_0x4a88('0x1c')],function(_0x8d524a){return{'model':db[_0x8d524a[_0x4a88('0x1d')]],'as':_0x8d524a['as'],'attributes':_0x8d524a[_0x4a88('0x19')],'include':_0x8d524a['include']?_[_0x4a88('0x1b')](_0x8d524a[_0x4a88('0x1c')],function(_0x68735e){return{'model':db[_0x68735e[_0x4a88('0x1d')]],'as':_0x68735e['as'],'attributes':_0x68735e['attributes'],'include':_0x68735e[_0x4a88('0x1c')]?_[_0x4a88('0x1b')](_0x68735e[_0x4a88('0x1c')],function(_0x207199){return{'model':db[_0x207199[_0x4a88('0x1d')]],'as':_0x207199['as'],'attributes':_0x207199['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a88('0x1e')](function(_0x11058a){logger[_0x4a88('0x13')](_0x4a88('0x1f'),_0x15546c);logger[_0x4a88('0xe')](_0x4a88('0x1f'),_0x15546c,JSON[_0x4a88('0x22')](_0x11058a));_0x28f213(_0x11058a);})[_0x4a88('0x15')](function(_0x249b7d){logger[_0x4a88('0x10')](_0x4a88('0x1f'),_0x249b7d[_0x4a88('0x12')],_0x15546c);_0x2999bc(_0x1aa947[_0x4a88('0x10')](0x1f4,_0x249b7d[_0x4a88('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0bd8a56..2e1a4e1 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 _0x4c96=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x1cb247,_0x401c73){var _0x338700=function(_0x593f32){while(--_0x593f32){_0x1cb247['push'](_0x1cb247['shift']());}};_0x338700(++_0x401c73);}(_0x4c96,0xa6));var _0x64c9=function(_0x4e075f,_0x1c94d2){_0x4e075f=_0x4e075f-0x0;var _0x17c45e=_0x4c96[_0x4e075f];return _0x17c45e;};'use strict';var multer=require(_0x64c9('0x0'));var util=require(_0x64c9('0x1'));var path=require(_0x64c9('0x2'));var timeout=require(_0x64c9('0x3'));var express=require(_0x64c9('0x4'));var router=express[_0x64c9('0x5')]();var fs_extra=require(_0x64c9('0x6'));var auth=require(_0x64c9('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x64c9('0x8'));router[_0x64c9('0x9')]('/',auth[_0x64c9('0xa')](),controller['index']);router[_0x64c9('0x9')]('/:id',auth[_0x64c9('0xa')](),controller['show']);router[_0x64c9('0x9')](_0x64c9('0xb'),auth[_0x64c9('0xa')](),controller[_0x64c9('0xc')]);router['get'](_0x64c9('0xd'),auth[_0x64c9('0xa')](),controller[_0x64c9('0xe')]);router[_0x64c9('0x9')](_0x64c9('0xf'),auth[_0x64c9('0xa')](),controller[_0x64c9('0x10')]);router[_0x64c9('0x9')](_0x64c9('0x11'),auth[_0x64c9('0xa')](),controller[_0x64c9('0x12')]);router[_0x64c9('0x13')]('/',auth[_0x64c9('0xa')](),controller[_0x64c9('0x14')]);router['post']('/:id/tags',auth[_0x64c9('0xa')](),controller[_0x64c9('0x15')]);router[_0x64c9('0x16')]('/:id',auth[_0x64c9('0xa')](),controller['update']);router[_0x64c9('0x17')](_0x64c9('0x18'),auth['isAuthenticated'](),controller[_0x64c9('0x19')]);module[_0x64c9('0x1a')]=router; \ No newline at end of file +var _0x3846=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','create','/:id/tags','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x39f6d2,_0x11abcf){var _0x20e52e=function(_0x176027){while(--_0x176027){_0x39f6d2['push'](_0x39f6d2['shift']());}};_0x20e52e(++_0x11abcf);}(_0x3846,0x123));var _0x6384=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x3846[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x6384('0x0'));var util=require(_0x6384('0x1'));var path=require(_0x6384('0x2'));var timeout=require(_0x6384('0x3'));var express=require(_0x6384('0x4'));var router=express[_0x6384('0x5')]();var fs_extra=require(_0x6384('0x6'));var auth=require(_0x6384('0x7'));var interaction=require(_0x6384('0x8'));var config=require(_0x6384('0x9'));var controller=require(_0x6384('0xa'));router[_0x6384('0xb')]('/',auth['isAuthenticated'](),controller[_0x6384('0xc')]);router[_0x6384('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6384('0xb')](_0x6384('0xd'),auth[_0x6384('0xe')](),controller[_0x6384('0xf')]);router[_0x6384('0xb')](_0x6384('0x10'),auth[_0x6384('0xe')](),controller[_0x6384('0x11')]);router[_0x6384('0xb')]('/:id/descriptions',auth[_0x6384('0xe')](),controller[_0x6384('0x12')]);router[_0x6384('0xb')]('/:id/tags',auth[_0x6384('0xe')](),controller[_0x6384('0x13')]);router['post']('/',auth[_0x6384('0xe')](),controller[_0x6384('0x14')]);router['post'](_0x6384('0x15'),auth[_0x6384('0xe')](),controller['setTags']);router['put'](_0x6384('0x16'),auth[_0x6384('0xe')](),controller[_0x6384('0x17')]);router[_0x6384('0x18')](_0x6384('0x16'),auth['isAuthenticated'](),controller[_0x6384('0x19')]);module[_0x6384('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index bc0c742..dfbfe96 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 _0xb5bf=['STRING','sequelize'];(function(_0x534c04,_0x54d3a7){var _0x27fd87=function(_0x2ffef0){while(--_0x2ffef0){_0x534c04['push'](_0x534c04['shift']());}};_0x27fd87(++_0x54d3a7);}(_0xb5bf,0x1ef));var _0xfb5b=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xb5bf[_0xb24a3e];return _0x4038d7;};'use strict';var Sequelize=require(_0xfb5b('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb5b('0x1')]},'description':{'type':Sequelize[_0xfb5b('0x1')]}}; \ No newline at end of file +var _0xa010=['STRING','exports'];(function(_0x14417f,_0x5f0beb){var _0x10c26d=function(_0x271570){while(--_0x271570){_0x14417f['push'](_0x14417f['shift']());}};_0x10c26d(++_0x5f0beb);}(_0xa010,0xf5));var _0x0a01=function(_0x45023b,_0x59c42b){_0x45023b=_0x45023b-0x0;var _0xc4fb60=_0xa010[_0x45023b];return _0xc4fb60;};'use strict';var Sequelize=require('sequelize');module[_0x0a01('0x0')]={'name':{'type':Sequelize[_0x0a01('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f52e801..23c34e4 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 _0x2037=['merge','type','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','getFields','findOne','FreshdeskField','length','order','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','index','map','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter'];(function(_0x33ea77,_0x21ae18){var _0x2408e7=function(_0x12b57e){while(--_0x12b57e){_0x33ea77['push'](_0x33ea77['shift']());}};_0x2408e7(++_0x21ae18);}(_0x2037,0x10e));var _0x7203=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0x2037[_0x4cc03b];return _0xf0358c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7203('0x0'));var zipdir=require(_0x7203('0x1'));var jsonpatch=require(_0x7203('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7203('0x3'));var Mustache=require(_0x7203('0x4'));var util=require(_0x7203('0x5'));var path=require(_0x7203('0x6'));var sox=require(_0x7203('0x7'));var csv=require('to-csv');var ejs=require(_0x7203('0x8'));var fs=require('fs');var fs_extra=require(_0x7203('0x9'));var _=require(_0x7203('0xa'));var squel=require(_0x7203('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7203('0xc'));var toCsv=require(_0x7203('0xd'));var querystring=require(_0x7203('0xe'));var Papa=require(_0x7203('0xf'));var Redis=require('ioredis');var authService=require(_0x7203('0x10'));var qs=require(_0x7203('0x11'));var as=require(_0x7203('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7203('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7203('0x14'));var db=require(_0x7203('0x15'))['db'];function respondWithStatusCode(_0x833087,_0x1d43b1){_0x1d43b1=_0x1d43b1||0xcc;return function(_0x35a448){if(_0x35a448){return _0x833087[_0x7203('0x16')](_0x1d43b1);}return _0x833087[_0x7203('0x17')](_0x1d43b1)[_0x7203('0x18')]();};}function respondWithResult(_0x2c831c,_0x2941a5){_0x2941a5=_0x2941a5||0xc8;return function(_0x3250d5){if(_0x3250d5){return _0x2c831c[_0x7203('0x17')](_0x2941a5)[_0x7203('0x19')](_0x3250d5);}};}function respondWithFilteredResult(_0xf2887d,_0x1a2666){return function(_0x5dfeb0){if(_0x5dfeb0){var _0x19532a=typeof _0x1a2666[_0x7203('0x1a')]===_0x7203('0x1b')&&typeof _0x1a2666[_0x7203('0x1c')]==='undefined';var _0x263608=_0x5dfeb0[_0x7203('0x1d')];var _0x1275eb=_0x19532a?0x0:_0x1a2666['offset'];var _0x2d220c=_0x19532a?_0x5dfeb0[_0x7203('0x1d')]:_0x1a2666[_0x7203('0x1a')]+_0x1a2666[_0x7203('0x1c')];var _0x18062e;if(_0x2d220c>=_0x263608){_0x2d220c=_0x263608;_0x18062e=0xc8;}else{_0x18062e=0xce;}_0xf2887d[_0x7203('0x17')](_0x18062e);return _0xf2887d[_0x7203('0x1e')]('Content-Range',_0x1275eb+'-'+_0x2d220c+'/'+_0x263608)[_0x7203('0x19')](_0x5dfeb0);}return null;};}function patchUpdates(_0x11cb6c){return function(_0x484031){try{jsonpatch[_0x7203('0x1f')](_0x484031,_0x11cb6c,!![]);}catch(_0x4437c3){return BPromise[_0x7203('0x20')](_0x4437c3);}return _0x484031[_0x7203('0x21')]();};}function saveUpdates(_0x1e520e,_0x509aac){return function(_0xb0cdb8){if(_0xb0cdb8){return _0xb0cdb8[_0x7203('0x22')](_0x1e520e)[_0x7203('0x23')](function(_0x18e203){return _0x18e203;});}return null;};}function removeEntity(_0x12702c,_0x4c1d90){return function(_0x4062bf){if(_0x4062bf){return _0x4062bf[_0x7203('0x24')]()[_0x7203('0x23')](function(){_0x12702c['status'](0xcc)[_0x7203('0x18')]();});}};}function handleEntityNotFound(_0x1743f0,_0x24a329){return function(_0x14c5fe){if(!_0x14c5fe){_0x1743f0[_0x7203('0x16')](0x194);}return _0x14c5fe;};}function handleError(_0x542ba4,_0x3218e4){_0x3218e4=_0x3218e4||0x1f4;return function(_0x4a8f64){logger[_0x7203('0x25')](_0x4a8f64['stack']);if(_0x4a8f64[_0x7203('0x26')]){delete _0x4a8f64[_0x7203('0x26')];}_0x542ba4[_0x7203('0x17')](_0x3218e4)['send'](_0x4a8f64);};}exports[_0x7203('0x27')]=function(_0x2bd14f,_0x507f11){var _0x559a5f={},_0x52746d={},_0xdf3c9={'count':0x0,'rows':[]};var _0x26b4ba=_[_0x7203('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x57c9fc){return{'name':_0x57c9fc['fieldName'],'type':_0x57c9fc['type'][_0x7203('0x29')]};});_0x52746d[_0x7203('0x2a')]=_[_0x7203('0x28')](_0x26b4ba,_0x7203('0x26'));_0x52746d[_0x7203('0x2b')]=_[_0x7203('0x2c')](_0x2bd14f[_0x7203('0x2b')]);_0x52746d[_0x7203('0x2d')]=_[_0x7203('0x2e')](_0x52746d[_0x7203('0x2a')],_0x52746d['query']);_0x559a5f[_0x7203('0x2f')]=_['intersection'](_0x52746d['model'],qs[_0x7203('0x30')](_0x2bd14f['query']['fields']));_0x559a5f[_0x7203('0x2f')]=_0x559a5f[_0x7203('0x2f')]['length']?_0x559a5f[_0x7203('0x2f')]:_0x52746d[_0x7203('0x2a')];if(!_0x2bd14f[_0x7203('0x2b')]['hasOwnProperty'](_0x7203('0x31'))){_0x559a5f[_0x7203('0x1c')]=qs[_0x7203('0x1c')](_0x2bd14f[_0x7203('0x2b')][_0x7203('0x1c')]);_0x559a5f[_0x7203('0x1a')]=qs[_0x7203('0x1a')](_0x2bd14f[_0x7203('0x2b')][_0x7203('0x1a')]);}_0x559a5f['order']=qs[_0x7203('0x32')](_0x2bd14f[_0x7203('0x2b')][_0x7203('0x32')]);_0x559a5f[_0x7203('0x33')]=qs[_0x7203('0x2d')](_[_0x7203('0x34')](_0x2bd14f['query'],_0x52746d['filters']),_0x26b4ba);if(_0x2bd14f['query'][_0x7203('0x35')]){_0x559a5f['where']=_[_0x7203('0x36')](_0x559a5f[_0x7203('0x33')],{'$or':_[_0x7203('0x28')](_0x26b4ba,function(_0x37893b){if(_0x37893b[_0x7203('0x37')]!==_0x7203('0x38')){var _0x10ebc0={};_0x10ebc0[_0x37893b['name']]={'$like':'%'+_0x2bd14f['query']['filter']+'%'};return _0x10ebc0;}})});}_0x559a5f=_[_0x7203('0x36')]({},_0x559a5f,_0x2bd14f[_0x7203('0x39')]);var _0x469b8b={'where':_0x559a5f[_0x7203('0x33')]};return db[_0x7203('0x3a')]['count'](_0x469b8b)[_0x7203('0x23')](function(_0x4314d0){_0xdf3c9[_0x7203('0x1d')]=_0x4314d0;if(_0x2bd14f['query'][_0x7203('0x3b')]){_0x559a5f[_0x7203('0x3c')]=[{'all':!![]}];}return db[_0x7203('0x3a')]['findAll'](_0x559a5f);})[_0x7203('0x23')](function(_0x142a14){_0xdf3c9[_0x7203('0x3d')]=_0x142a14;return _0xdf3c9;})[_0x7203('0x23')](respondWithFilteredResult(_0x507f11,_0x559a5f))[_0x7203('0x3e')](handleError(_0x507f11,null));};exports[_0x7203('0x3f')]=function(_0x9c1e47,_0x311a38){var _0x34a6c5={'raw':![],'where':{'id':_0x9c1e47[_0x7203('0x40')]['id']}},_0x22f1ef={};_0x22f1ef[_0x7203('0x2a')]=_[_0x7203('0x2c')](db[_0x7203('0x3a')][_0x7203('0x41')]);_0x22f1ef[_0x7203('0x2b')]=_['keys'](_0x9c1e47[_0x7203('0x2b')]);_0x22f1ef[_0x7203('0x2d')]=_['intersection'](_0x22f1ef[_0x7203('0x2a')],_0x22f1ef['query']);_0x34a6c5[_0x7203('0x2f')]=_[_0x7203('0x2e')](_0x22f1ef[_0x7203('0x2a')],qs['fields'](_0x9c1e47[_0x7203('0x2b')]['fields']));_0x34a6c5[_0x7203('0x2f')]=_0x34a6c5['attributes']['length']?_0x34a6c5[_0x7203('0x2f')]:_0x22f1ef['model'];if(_0x9c1e47[_0x7203('0x2b')][_0x7203('0x3b')]){_0x34a6c5[_0x7203('0x3c')]=[{'all':!![]}];}_0x34a6c5=_['merge']({},_0x34a6c5,_0x9c1e47[_0x7203('0x39')]);return db[_0x7203('0x3a')]['find'](_0x34a6c5)[_0x7203('0x23')](handleEntityNotFound(_0x311a38,null))[_0x7203('0x23')](respondWithResult(_0x311a38,null))['catch'](handleError(_0x311a38,null));};exports[_0x7203('0x42')]=function(_0x21a43b,_0x38d374){return db[_0x7203('0x3a')][_0x7203('0x42')](_0x21a43b[_0x7203('0x43')],{})[_0x7203('0x23')](respondWithResult(_0x38d374,0xc9))['catch'](handleError(_0x38d374,null));};exports['update']=function(_0x207219,_0x4be602){if(_0x207219[_0x7203('0x43')]['id']){delete _0x207219[_0x7203('0x43')]['id'];}return db[_0x7203('0x3a')][_0x7203('0x44')]({'where':{'id':_0x207219['params']['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x4be602,null))[_0x7203('0x23')](saveUpdates(_0x207219['body'],null))[_0x7203('0x23')](respondWithResult(_0x4be602,null))['catch'](handleError(_0x4be602,null));};exports[_0x7203('0x24')]=function(_0x2d0612,_0x584b94){return db[_0x7203('0x3a')][_0x7203('0x44')]({'where':{'id':_0x2d0612[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x584b94,null))[_0x7203('0x23')](removeEntity(_0x584b94,null))[_0x7203('0x3e')](handleError(_0x584b94,null));};exports[_0x7203('0x45')]=function(_0x3f7dd8,_0x48af92,_0x45492b){var _0x802753={};var _0x3e2f90={};var _0x47efea;var _0x522288;return db['FreshdeskConfiguration'][_0x7203('0x46')]({'where':{'id':_0x3f7dd8[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x48af92,null))[_0x7203('0x23')](function(_0x12a6ac){if(_0x12a6ac){_0x47efea=_0x12a6ac;_0x3e2f90[_0x7203('0x2a')]=_[_0x7203('0x2c')](db[_0x7203('0x47')][_0x7203('0x41')]);_0x3e2f90[_0x7203('0x2b')]=_[_0x7203('0x2c')](_0x3f7dd8['query']);_0x3e2f90['filters']=_[_0x7203('0x2e')](_0x3e2f90[_0x7203('0x2a')],_0x3e2f90[_0x7203('0x2b')]);_0x802753[_0x7203('0x2f')]=_[_0x7203('0x2e')](_0x3e2f90[_0x7203('0x2a')],qs[_0x7203('0x30')](_0x3f7dd8[_0x7203('0x2b')][_0x7203('0x30')]));_0x802753['attributes']=_0x802753[_0x7203('0x2f')][_0x7203('0x48')]?_0x802753[_0x7203('0x2f')]:_0x3e2f90[_0x7203('0x2a')];_0x802753[_0x7203('0x49')]=qs[_0x7203('0x32')](_0x3f7dd8[_0x7203('0x2b')][_0x7203('0x32')]);_0x802753[_0x7203('0x33')]=qs[_0x7203('0x2d')](_[_0x7203('0x34')](_0x3f7dd8['query'],_0x3e2f90['filters']));if(_0x3f7dd8[_0x7203('0x2b')]['filter']){_0x802753['where']=_['merge'](_0x802753[_0x7203('0x33')],{'$or':_[_0x7203('0x28')](_0x802753[_0x7203('0x2f')],function(_0x1b32af){var _0xba2daa={};_0xba2daa[_0x1b32af]={'$like':'%'+_0x3f7dd8[_0x7203('0x2b')][_0x7203('0x35')]+'%'};return _0xba2daa;})});}_0x802753=_[_0x7203('0x36')]({},_0x802753,_0x3f7dd8[_0x7203('0x39')]);return _0x47efea[_0x7203('0x45')](_0x802753);}})[_0x7203('0x23')](function(_0x4b8cbc){if(_0x4b8cbc){_0x522288=_0x4b8cbc[_0x7203('0x48')];if(!_0x3f7dd8[_0x7203('0x2b')][_0x7203('0x4a')](_0x7203('0x31'))){_0x802753[_0x7203('0x1c')]=qs[_0x7203('0x1c')](_0x3f7dd8['query'][_0x7203('0x1c')]);_0x802753[_0x7203('0x1a')]=qs[_0x7203('0x1a')](_0x3f7dd8[_0x7203('0x2b')][_0x7203('0x1a')]);}return _0x47efea[_0x7203('0x45')](_0x802753);}})[_0x7203('0x23')](function(_0x25e6ca){if(_0x25e6ca){return _0x25e6ca?{'count':_0x522288,'rows':_0x25e6ca}:null;}})[_0x7203('0x23')](respondWithResult(_0x48af92,null))['catch'](handleError(_0x48af92,null));};exports[_0x7203('0x4b')]=function(_0xf3cd2e,_0x15c9b4,_0x24624d){var _0x4f6c73={};var _0x1dba9d={};var _0x1c41ca;var _0x1e6c66;return db[_0x7203('0x3a')][_0x7203('0x46')]({'where':{'id':_0xf3cd2e[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x15c9b4,null))['then'](function(_0x2a5d13){if(_0x2a5d13){_0x1c41ca=_0x2a5d13;_0x1dba9d[_0x7203('0x2a')]=_[_0x7203('0x2c')](db[_0x7203('0x47')][_0x7203('0x41')]);_0x1dba9d[_0x7203('0x2b')]=_[_0x7203('0x2c')](_0xf3cd2e[_0x7203('0x2b')]);_0x1dba9d[_0x7203('0x2d')]=_[_0x7203('0x2e')](_0x1dba9d[_0x7203('0x2a')],_0x1dba9d[_0x7203('0x2b')]);_0x4f6c73['attributes']=_[_0x7203('0x2e')](_0x1dba9d[_0x7203('0x2a')],qs['fields'](_0xf3cd2e[_0x7203('0x2b')][_0x7203('0x30')]));_0x4f6c73[_0x7203('0x2f')]=_0x4f6c73[_0x7203('0x2f')][_0x7203('0x48')]?_0x4f6c73[_0x7203('0x2f')]:_0x1dba9d[_0x7203('0x2a')];_0x4f6c73[_0x7203('0x49')]=qs['sort'](_0xf3cd2e['query'][_0x7203('0x32')]);_0x4f6c73[_0x7203('0x33')]=qs['filters'](_[_0x7203('0x34')](_0xf3cd2e[_0x7203('0x2b')],_0x1dba9d[_0x7203('0x2d')]));if(_0xf3cd2e[_0x7203('0x2b')]['filter']){_0x4f6c73[_0x7203('0x33')]=_[_0x7203('0x36')](_0x4f6c73[_0x7203('0x33')],{'$or':_[_0x7203('0x28')](_0x4f6c73['attributes'],function(_0x38397d){var _0x6c113e={};_0x6c113e[_0x38397d]={'$like':'%'+_0xf3cd2e[_0x7203('0x2b')][_0x7203('0x35')]+'%'};return _0x6c113e;})});}_0x4f6c73=_[_0x7203('0x36')]({},_0x4f6c73,_0xf3cd2e[_0x7203('0x39')]);return _0x1c41ca['getSubjects'](_0x4f6c73);}})['then'](function(_0x2d17c4){if(_0x2d17c4){_0x1e6c66=_0x2d17c4[_0x7203('0x48')];if(!_0xf3cd2e[_0x7203('0x2b')][_0x7203('0x4a')](_0x7203('0x31'))){_0x4f6c73['limit']=qs[_0x7203('0x1c')](_0xf3cd2e[_0x7203('0x2b')][_0x7203('0x1c')]);_0x4f6c73['offset']=qs[_0x7203('0x1a')](_0xf3cd2e['query'][_0x7203('0x1a')]);}return _0x1c41ca[_0x7203('0x4b')](_0x4f6c73);}})[_0x7203('0x23')](function(_0x41e4bc){if(_0x41e4bc){return _0x41e4bc?{'count':_0x1e6c66,'rows':_0x41e4bc}:null;}})[_0x7203('0x23')](respondWithResult(_0x15c9b4,null))['catch'](handleError(_0x15c9b4,null));};exports[_0x7203('0x4c')]=function(_0x91097,_0x5d9ee7,_0x3980e0){var _0x1d65e9={};var _0x34109b={};var _0x1ae80e;var _0x1d4a71;return db[_0x7203('0x3a')][_0x7203('0x46')]({'where':{'id':_0x91097[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x5d9ee7,null))[_0x7203('0x23')](function(_0x283d6f){if(_0x283d6f){_0x1ae80e=_0x283d6f;_0x34109b[_0x7203('0x2a')]=_['keys'](db[_0x7203('0x47')][_0x7203('0x41')]);_0x34109b[_0x7203('0x2b')]=_['keys'](_0x91097[_0x7203('0x2b')]);_0x34109b[_0x7203('0x2d')]=_['intersection'](_0x34109b['model'],_0x34109b[_0x7203('0x2b')]);_0x1d65e9[_0x7203('0x2f')]=_[_0x7203('0x2e')](_0x34109b[_0x7203('0x2a')],qs[_0x7203('0x30')](_0x91097[_0x7203('0x2b')][_0x7203('0x30')]));_0x1d65e9['attributes']=_0x1d65e9[_0x7203('0x2f')][_0x7203('0x48')]?_0x1d65e9[_0x7203('0x2f')]:_0x34109b[_0x7203('0x2a')];_0x1d65e9[_0x7203('0x49')]=qs[_0x7203('0x32')](_0x91097[_0x7203('0x2b')]['sort']);_0x1d65e9[_0x7203('0x33')]=qs[_0x7203('0x2d')](_[_0x7203('0x34')](_0x91097[_0x7203('0x2b')],_0x34109b[_0x7203('0x2d')]));if(_0x91097['query']['filter']){_0x1d65e9['where']=_[_0x7203('0x36')](_0x1d65e9[_0x7203('0x33')],{'$or':_['map'](_0x1d65e9[_0x7203('0x2f')],function(_0x4c8ca8){var _0xc309b8={};_0xc309b8[_0x4c8ca8]={'$like':'%'+_0x91097[_0x7203('0x2b')][_0x7203('0x35')]+'%'};return _0xc309b8;})});}_0x1d65e9=_[_0x7203('0x36')]({},_0x1d65e9,_0x91097[_0x7203('0x39')]);return _0x1ae80e[_0x7203('0x4c')](_0x1d65e9);}})[_0x7203('0x23')](function(_0x2003b9){if(_0x2003b9){_0x1d4a71=_0x2003b9[_0x7203('0x48')];if(!_0x91097[_0x7203('0x2b')]['hasOwnProperty'](_0x7203('0x31'))){_0x1d65e9[_0x7203('0x1c')]=qs['limit'](_0x91097[_0x7203('0x2b')][_0x7203('0x1c')]);_0x1d65e9['offset']=qs[_0x7203('0x1a')](_0x91097[_0x7203('0x2b')]['offset']);}return _0x1ae80e[_0x7203('0x4c')](_0x1d65e9);}})[_0x7203('0x23')](function(_0x287127){if(_0x287127){return _0x287127?{'count':_0x1d4a71,'rows':_0x287127}:null;}})[_0x7203('0x23')](respondWithResult(_0x5d9ee7,null))[_0x7203('0x3e')](handleError(_0x5d9ee7,null));};exports[_0x7203('0x4d')]=function(_0x3788ec,_0x51d6d8,_0x3b00ee){var _0x397a01={};var _0x490ecf={};var _0x4f9f84;var _0x1e009a;return db[_0x7203('0x3a')][_0x7203('0x46')]({'where':{'id':_0x3788ec[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x51d6d8,null))[_0x7203('0x23')](function(_0xd87444){if(_0xd87444){_0x4f9f84=_0xd87444;_0x490ecf[_0x7203('0x2a')]=_[_0x7203('0x2c')](db[_0x7203('0x4e')][_0x7203('0x41')]);_0x490ecf[_0x7203('0x2b')]=_[_0x7203('0x2c')](_0x3788ec['query']);_0x490ecf[_0x7203('0x2d')]=_[_0x7203('0x2e')](_0x490ecf[_0x7203('0x2a')],_0x490ecf[_0x7203('0x2b')]);_0x397a01['attributes']=_[_0x7203('0x2e')](_0x490ecf[_0x7203('0x2a')],qs[_0x7203('0x30')](_0x3788ec['query']['fields']));_0x397a01[_0x7203('0x2f')]=_0x397a01[_0x7203('0x2f')][_0x7203('0x48')]?_0x397a01['attributes']:_0x490ecf['model'];_0x397a01[_0x7203('0x49')]=qs[_0x7203('0x32')](_0x3788ec[_0x7203('0x2b')][_0x7203('0x32')]);_0x397a01['where']=qs[_0x7203('0x2d')](_[_0x7203('0x34')](_0x3788ec[_0x7203('0x2b')],_0x490ecf[_0x7203('0x2d')]));if(_0x3788ec[_0x7203('0x2b')][_0x7203('0x35')]){_0x397a01[_0x7203('0x33')]=_['merge'](_0x397a01[_0x7203('0x33')],{'$or':_[_0x7203('0x28')](_0x397a01[_0x7203('0x2f')],function(_0x9cba80){var _0x5b056c={};_0x5b056c[_0x9cba80]={'$like':'%'+_0x3788ec['query'][_0x7203('0x35')]+'%'};return _0x5b056c;})});}_0x397a01=_[_0x7203('0x36')]({},_0x397a01,_0x3788ec['options']);return _0x4f9f84[_0x7203('0x4d')](_0x397a01);}})[_0x7203('0x23')](function(_0x2f8e95){if(_0x2f8e95){_0x1e009a=_0x2f8e95[_0x7203('0x48')];if(!_0x3788ec[_0x7203('0x2b')][_0x7203('0x4a')](_0x7203('0x31'))){_0x397a01['limit']=qs[_0x7203('0x1c')](_0x3788ec[_0x7203('0x2b')][_0x7203('0x1c')]);_0x397a01[_0x7203('0x1a')]=qs['offset'](_0x3788ec[_0x7203('0x2b')][_0x7203('0x1a')]);}return _0x4f9f84[_0x7203('0x4d')](_0x397a01);}})[_0x7203('0x23')](function(_0x4c2c07){if(_0x4c2c07){return _0x4c2c07?{'count':_0x1e009a,'rows':_0x4c2c07}:null;}})[_0x7203('0x23')](respondWithResult(_0x51d6d8,null))[_0x7203('0x3e')](handleError(_0x51d6d8,null));};exports[_0x7203('0x4f')]=function(_0x259831,_0x26588b,_0x586142){if(_0x259831[_0x7203('0x43')]['id']){delete _0x259831[_0x7203('0x43')]['id'];}return db[_0x7203('0x3a')]['findOne']({'where':{'id':_0x259831[_0x7203('0x40')]['id']}})[_0x7203('0x23')](handleEntityNotFound(_0x26588b,null))['then'](function(_0x1456e4){if(_0x1456e4){return _0x1456e4[_0x7203('0x4f')](_0x259831[_0x7203('0x43')][_0x7203('0x50')]||[]);}return null;})[_0x7203('0x23')](respondWithResult(_0x26588b,null))[_0x7203('0x3e')](handleError(_0x26588b,null));}; \ No newline at end of file +var _0x8845=['bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','find','create','body','update','params','getFields','findOne','FreshdeskField','pick','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2e43e9,_0x1be677){var _0x304176=function(_0x5a436c){while(--_0x5a436c){_0x2e43e9['push'](_0x2e43e9['shift']());}};_0x304176(++_0x1be677);}(_0x8845,0x153));var _0x5884=function(_0x5d808e,_0x5b6758){_0x5d808e=_0x5d808e-0x0;var _0x2421fe=_0x8845[_0x5d808e];return _0x2421fe;};'use strict';var emlformat=require(_0x5884('0x0'));var rimraf=require(_0x5884('0x1'));var zipdir=require(_0x5884('0x2'));var jsonpatch=require(_0x5884('0x3'));var rp=require(_0x5884('0x4'));var moment=require('moment');var BPromise=require(_0x5884('0x5'));var Mustache=require(_0x5884('0x6'));var util=require('util');var path=require(_0x5884('0x7'));var sox=require('sox');var csv=require(_0x5884('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5884('0x9'));var _=require(_0x5884('0xa'));var squel=require(_0x5884('0xb'));var crypto=require(_0x5884('0xc'));var jsforce=require(_0x5884('0xd'));var deskjs=require(_0x5884('0xe'));var toCsv=require(_0x5884('0x8'));var querystring=require(_0x5884('0xf'));var Papa=require(_0x5884('0x10'));var Redis=require('ioredis');var authService=require(_0x5884('0x11'));var qs=require(_0x5884('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5884('0x13'));var logger=require(_0x5884('0x14'))(_0x5884('0x15'));var utils=require(_0x5884('0x16'));var config=require(_0x5884('0x17'));var licenseUtil=require(_0x5884('0x18'));var db=require(_0x5884('0x19'))['db'];function respondWithStatusCode(_0x9680ed,_0x504df9){_0x504df9=_0x504df9||0xcc;return function(_0x1f814a){if(_0x1f814a){return _0x9680ed[_0x5884('0x1a')](_0x504df9);}return _0x9680ed['status'](_0x504df9)[_0x5884('0x1b')]();};}function respondWithResult(_0x50ad31,_0x5da708){_0x5da708=_0x5da708||0xc8;return function(_0x507e09){if(_0x507e09){return _0x50ad31[_0x5884('0x1c')](_0x5da708)['json'](_0x507e09);}};}function respondWithFilteredResult(_0x544542,_0x90f19b){return function(_0x5e3891){if(_0x5e3891){var _0x204c09=typeof _0x90f19b[_0x5884('0x1d')]===_0x5884('0x1e')&&typeof _0x90f19b[_0x5884('0x1f')]==='undefined';var _0x48a079=_0x5e3891[_0x5884('0x20')];var _0x5ddc40=_0x204c09?0x0:_0x90f19b[_0x5884('0x1d')];var _0x176f37=_0x204c09?_0x5e3891[_0x5884('0x20')]:_0x90f19b[_0x5884('0x1d')]+_0x90f19b[_0x5884('0x1f')];var _0x36466e;if(_0x176f37>=_0x48a079){_0x176f37=_0x48a079;_0x36466e=0xc8;}else{_0x36466e=0xce;}_0x544542[_0x5884('0x1c')](_0x36466e);return _0x544542[_0x5884('0x21')](_0x5884('0x22'),_0x5ddc40+'-'+_0x176f37+'/'+_0x48a079)[_0x5884('0x23')](_0x5e3891);}return null;};}function patchUpdates(_0x13efd9){return function(_0x740874){try{jsonpatch[_0x5884('0x24')](_0x740874,_0x13efd9,!![]);}catch(_0x34fe93){return BPromise[_0x5884('0x25')](_0x34fe93);}return _0x740874[_0x5884('0x26')]();};}function saveUpdates(_0x5f2f7c,_0x4412e7){return function(_0x1fd4aa){if(_0x1fd4aa){return _0x1fd4aa['update'](_0x5f2f7c)[_0x5884('0x27')](function(_0x2e1de3){return _0x2e1de3;});}return null;};}function removeEntity(_0x205914,_0x48908a){return function(_0x520c3a){if(_0x520c3a){return _0x520c3a[_0x5884('0x28')]()[_0x5884('0x27')](function(){_0x205914[_0x5884('0x1c')](0xcc)[_0x5884('0x1b')]();});}};}function handleEntityNotFound(_0x24dbce,_0xfabaad){return function(_0x3ad777){if(!_0x3ad777){_0x24dbce[_0x5884('0x1a')](0x194);}return _0x3ad777;};}function handleError(_0x25c958,_0x316739){_0x316739=_0x316739||0x1f4;return function(_0x3a3bc3){logger[_0x5884('0x29')](_0x3a3bc3[_0x5884('0x2a')]);if(_0x3a3bc3[_0x5884('0x2b')]){delete _0x3a3bc3[_0x5884('0x2b')];}_0x25c958[_0x5884('0x1c')](_0x316739)[_0x5884('0x2c')](_0x3a3bc3);};}exports[_0x5884('0x2d')]=function(_0x9cebdf,_0x1626b4){var _0x4b4bca={},_0x4796f5={},_0x268862={'count':0x0,'rows':[]};var _0x2ef245=_['map'](db[_0x5884('0x2e')][_0x5884('0x2f')],function(_0x328788){return{'name':_0x328788[_0x5884('0x30')],'type':_0x328788[_0x5884('0x31')][_0x5884('0x32')]};});_0x4796f5[_0x5884('0x33')]=_[_0x5884('0x34')](_0x2ef245,_0x5884('0x2b'));_0x4796f5['query']=_[_0x5884('0x35')](_0x9cebdf[_0x5884('0x36')]);_0x4796f5['filters']=_[_0x5884('0x37')](_0x4796f5[_0x5884('0x33')],_0x4796f5[_0x5884('0x36')]);_0x4b4bca['attributes']=_[_0x5884('0x37')](_0x4796f5[_0x5884('0x33')],qs[_0x5884('0x38')](_0x9cebdf['query'][_0x5884('0x38')]));_0x4b4bca['attributes']=_0x4b4bca[_0x5884('0x39')][_0x5884('0x3a')]?_0x4b4bca['attributes']:_0x4796f5[_0x5884('0x33')];if(!_0x9cebdf[_0x5884('0x36')][_0x5884('0x3b')]('nolimit')){_0x4b4bca[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x9cebdf[_0x5884('0x36')][_0x5884('0x1f')]);_0x4b4bca[_0x5884('0x1d')]=qs['offset'](_0x9cebdf[_0x5884('0x36')][_0x5884('0x1d')]);}_0x4b4bca[_0x5884('0x3c')]=qs['sort'](_0x9cebdf[_0x5884('0x36')][_0x5884('0x3d')]);_0x4b4bca[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x9cebdf['query'],_0x4796f5[_0x5884('0x3f')]),_0x2ef245);if(_0x9cebdf[_0x5884('0x36')][_0x5884('0x40')]){_0x4b4bca[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x4b4bca[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x2ef245,function(_0x19db29){if(_0x19db29[_0x5884('0x31')]!==_0x5884('0x42')){var _0x4d7982={};_0x4d7982[_0x19db29['name']]={'$like':'%'+_0x9cebdf[_0x5884('0x36')]['filter']+'%'};return _0x4d7982;}})});}_0x4b4bca=_['merge']({},_0x4b4bca,_0x9cebdf[_0x5884('0x43')]);var _0x174fdb={'where':_0x4b4bca['where']};return db[_0x5884('0x2e')]['count'](_0x174fdb)[_0x5884('0x27')](function(_0x4dc0f9){_0x268862[_0x5884('0x20')]=_0x4dc0f9;if(_0x9cebdf[_0x5884('0x36')][_0x5884('0x44')]){_0x4b4bca['include']=[{'all':!![]}];}return db[_0x5884('0x2e')]['findAll'](_0x4b4bca);})[_0x5884('0x27')](function(_0x2b689f){_0x268862[_0x5884('0x45')]=_0x2b689f;return _0x268862;})[_0x5884('0x27')](respondWithFilteredResult(_0x1626b4,_0x4b4bca))[_0x5884('0x46')](handleError(_0x1626b4,null));};exports[_0x5884('0x47')]=function(_0x17ac7d,_0xd2e100){var _0x4808f2={'raw':![],'where':{'id':_0x17ac7d['params']['id']}},_0x2bd809={};_0x2bd809[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x2e')][_0x5884('0x2f')]);_0x2bd809[_0x5884('0x36')]=_[_0x5884('0x35')](_0x17ac7d[_0x5884('0x36')]);_0x2bd809[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x2bd809[_0x5884('0x33')],_0x2bd809[_0x5884('0x36')]);_0x4808f2[_0x5884('0x39')]=_['intersection'](_0x2bd809['model'],qs['fields'](_0x17ac7d['query'][_0x5884('0x38')]));_0x4808f2['attributes']=_0x4808f2['attributes']['length']?_0x4808f2[_0x5884('0x39')]:_0x2bd809[_0x5884('0x33')];if(_0x17ac7d[_0x5884('0x36')][_0x5884('0x44')]){_0x4808f2['include']=[{'all':!![]}];}_0x4808f2=_[_0x5884('0x41')]({},_0x4808f2,_0x17ac7d[_0x5884('0x43')]);return db[_0x5884('0x2e')][_0x5884('0x48')](_0x4808f2)[_0x5884('0x27')](handleEntityNotFound(_0xd2e100,null))[_0x5884('0x27')](respondWithResult(_0xd2e100,null))[_0x5884('0x46')](handleError(_0xd2e100,null));};exports[_0x5884('0x49')]=function(_0x10fd0b,_0x2f4d16){return db[_0x5884('0x2e')][_0x5884('0x49')](_0x10fd0b[_0x5884('0x4a')],{})['then'](respondWithResult(_0x2f4d16,0xc9))[_0x5884('0x46')](handleError(_0x2f4d16,null));};exports[_0x5884('0x4b')]=function(_0x39334c,_0x59639d){if(_0x39334c[_0x5884('0x4a')]['id']){delete _0x39334c[_0x5884('0x4a')]['id'];}return db[_0x5884('0x2e')]['find']({'where':{'id':_0x39334c[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x59639d,null))[_0x5884('0x27')](saveUpdates(_0x39334c[_0x5884('0x4a')],null))[_0x5884('0x27')](respondWithResult(_0x59639d,null))[_0x5884('0x46')](handleError(_0x59639d,null));};exports[_0x5884('0x28')]=function(_0x144804,_0x91615e){return db[_0x5884('0x2e')][_0x5884('0x48')]({'where':{'id':_0x144804[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x91615e,null))[_0x5884('0x27')](removeEntity(_0x91615e,null))[_0x5884('0x46')](handleError(_0x91615e,null));};exports[_0x5884('0x4d')]=function(_0x4444b4,_0x340ed4,_0x5d1861){var _0x5b1d7e={};var _0x9d7a9c={};var _0x598a7c;var _0x1dc00f;return db['FreshdeskConfiguration'][_0x5884('0x4e')]({'where':{'id':_0x4444b4[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x340ed4,null))[_0x5884('0x27')](function(_0x3e24c2){if(_0x3e24c2){_0x598a7c=_0x3e24c2;_0x9d7a9c[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x9d7a9c[_0x5884('0x36')]=_[_0x5884('0x35')](_0x4444b4[_0x5884('0x36')]);_0x9d7a9c[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x9d7a9c[_0x5884('0x33')],_0x9d7a9c['query']);_0x5b1d7e['attributes']=_[_0x5884('0x37')](_0x9d7a9c[_0x5884('0x33')],qs[_0x5884('0x38')](_0x4444b4[_0x5884('0x36')][_0x5884('0x38')]));_0x5b1d7e[_0x5884('0x39')]=_0x5b1d7e[_0x5884('0x39')][_0x5884('0x3a')]?_0x5b1d7e[_0x5884('0x39')]:_0x9d7a9c['model'];_0x5b1d7e['order']=qs['sort'](_0x4444b4[_0x5884('0x36')][_0x5884('0x3d')]);_0x5b1d7e['where']=qs[_0x5884('0x3f')](_[_0x5884('0x50')](_0x4444b4[_0x5884('0x36')],_0x9d7a9c[_0x5884('0x3f')]));if(_0x4444b4[_0x5884('0x36')][_0x5884('0x40')]){_0x5b1d7e[_0x5884('0x3e')]=_['merge'](_0x5b1d7e[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x5b1d7e['attributes'],function(_0x6a4fec){var _0x137562={};_0x137562[_0x6a4fec]={'$like':'%'+_0x4444b4[_0x5884('0x36')][_0x5884('0x40')]+'%'};return _0x137562;})});}_0x5b1d7e=_[_0x5884('0x41')]({},_0x5b1d7e,_0x4444b4['options']);return _0x598a7c[_0x5884('0x4d')](_0x5b1d7e);}})[_0x5884('0x27')](function(_0x21c4e3){if(_0x21c4e3){_0x1dc00f=_0x21c4e3[_0x5884('0x3a')];if(!_0x4444b4[_0x5884('0x36')][_0x5884('0x3b')](_0x5884('0x51'))){_0x5b1d7e[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x4444b4['query']['limit']);_0x5b1d7e[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x4444b4[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x598a7c['getFields'](_0x5b1d7e);}})[_0x5884('0x27')](function(_0x2b53ba){if(_0x2b53ba){return _0x2b53ba?{'count':_0x1dc00f,'rows':_0x2b53ba}:null;}})['then'](respondWithResult(_0x340ed4,null))[_0x5884('0x46')](handleError(_0x340ed4,null));};exports[_0x5884('0x52')]=function(_0x6a7729,_0xdf8133,_0x6b46a1){var _0x32d806={};var _0x564d30={};var _0x6df8e3;var _0x44e14d;return db['FreshdeskConfiguration'][_0x5884('0x4e')]({'where':{'id':_0x6a7729[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0xdf8133,null))[_0x5884('0x27')](function(_0x5863fb){if(_0x5863fb){_0x6df8e3=_0x5863fb;_0x564d30[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x564d30[_0x5884('0x36')]=_[_0x5884('0x35')](_0x6a7729[_0x5884('0x36')]);_0x564d30[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x564d30[_0x5884('0x33')],_0x564d30[_0x5884('0x36')]);_0x32d806[_0x5884('0x39')]=_[_0x5884('0x37')](_0x564d30[_0x5884('0x33')],qs[_0x5884('0x38')](_0x6a7729[_0x5884('0x36')][_0x5884('0x38')]));_0x32d806[_0x5884('0x39')]=_0x32d806[_0x5884('0x39')][_0x5884('0x3a')]?_0x32d806[_0x5884('0x39')]:_0x564d30[_0x5884('0x33')];_0x32d806[_0x5884('0x3c')]=qs['sort'](_0x6a7729[_0x5884('0x36')][_0x5884('0x3d')]);_0x32d806[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_[_0x5884('0x50')](_0x6a7729[_0x5884('0x36')],_0x564d30[_0x5884('0x3f')]));if(_0x6a7729[_0x5884('0x36')][_0x5884('0x40')]){_0x32d806[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x32d806['where'],{'$or':_['map'](_0x32d806['attributes'],function(_0x2123ad){var _0x2203a1={};_0x2203a1[_0x2123ad]={'$like':'%'+_0x6a7729['query'][_0x5884('0x40')]+'%'};return _0x2203a1;})});}_0x32d806=_['merge']({},_0x32d806,_0x6a7729[_0x5884('0x43')]);return _0x6df8e3[_0x5884('0x52')](_0x32d806);}})[_0x5884('0x27')](function(_0x1a1f6b){if(_0x1a1f6b){_0x44e14d=_0x1a1f6b[_0x5884('0x3a')];if(!_0x6a7729[_0x5884('0x36')][_0x5884('0x3b')](_0x5884('0x51'))){_0x32d806[_0x5884('0x1f')]=qs['limit'](_0x6a7729[_0x5884('0x36')]['limit']);_0x32d806[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x6a7729[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x6df8e3[_0x5884('0x52')](_0x32d806);}})['then'](function(_0x1afacb){if(_0x1afacb){return _0x1afacb?{'count':_0x44e14d,'rows':_0x1afacb}:null;}})[_0x5884('0x27')](respondWithResult(_0xdf8133,null))[_0x5884('0x46')](handleError(_0xdf8133,null));};exports[_0x5884('0x53')]=function(_0x2fe971,_0x2579f6,_0xdd5f67){var _0x4ad3d6={};var _0x560aca={};var _0x33e1f2;var _0x557f02;return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x2fe971[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2579f6,null))[_0x5884('0x27')](function(_0x56251e){if(_0x56251e){_0x33e1f2=_0x56251e;_0x560aca[_0x5884('0x33')]=_['keys'](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x560aca[_0x5884('0x36')]=_[_0x5884('0x35')](_0x2fe971[_0x5884('0x36')]);_0x560aca[_0x5884('0x3f')]=_['intersection'](_0x560aca[_0x5884('0x33')],_0x560aca['query']);_0x4ad3d6[_0x5884('0x39')]=_[_0x5884('0x37')](_0x560aca[_0x5884('0x33')],qs['fields'](_0x2fe971[_0x5884('0x36')][_0x5884('0x38')]));_0x4ad3d6[_0x5884('0x39')]=_0x4ad3d6[_0x5884('0x39')]['length']?_0x4ad3d6['attributes']:_0x560aca[_0x5884('0x33')];_0x4ad3d6[_0x5884('0x3c')]=qs['sort'](_0x2fe971[_0x5884('0x36')]['sort']);_0x4ad3d6[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x2fe971[_0x5884('0x36')],_0x560aca['filters']));if(_0x2fe971[_0x5884('0x36')][_0x5884('0x40')]){_0x4ad3d6[_0x5884('0x3e')]=_['merge'](_0x4ad3d6[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x4ad3d6[_0x5884('0x39')],function(_0x17b87b){var _0x2f7b56={};_0x2f7b56[_0x17b87b]={'$like':'%'+_0x2fe971[_0x5884('0x36')][_0x5884('0x40')]+'%'};return _0x2f7b56;})});}_0x4ad3d6=_[_0x5884('0x41')]({},_0x4ad3d6,_0x2fe971['options']);return _0x33e1f2['getDescriptions'](_0x4ad3d6);}})[_0x5884('0x27')](function(_0x2daa53){if(_0x2daa53){_0x557f02=_0x2daa53[_0x5884('0x3a')];if(!_0x2fe971['query'][_0x5884('0x3b')]('nolimit')){_0x4ad3d6['limit']=qs['limit'](_0x2fe971[_0x5884('0x36')][_0x5884('0x1f')]);_0x4ad3d6['offset']=qs[_0x5884('0x1d')](_0x2fe971[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x33e1f2[_0x5884('0x53')](_0x4ad3d6);}})[_0x5884('0x27')](function(_0x16d377){if(_0x16d377){return _0x16d377?{'count':_0x557f02,'rows':_0x16d377}:null;}})[_0x5884('0x27')](respondWithResult(_0x2579f6,null))[_0x5884('0x46')](handleError(_0x2579f6,null));};exports[_0x5884('0x54')]=function(_0x23eafe,_0x4706b5,_0x575584){var _0x5e0f3a={};var _0x88eeb4={};var _0x18389a;var _0x11fb3f;return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x23eafe['params']['id']}})['then'](handleEntityNotFound(_0x4706b5,null))['then'](function(_0x3980ac){if(_0x3980ac){_0x18389a=_0x3980ac;_0x88eeb4['model']=_[_0x5884('0x35')](db['Tag'][_0x5884('0x2f')]);_0x88eeb4[_0x5884('0x36')]=_[_0x5884('0x35')](_0x23eafe[_0x5884('0x36')]);_0x88eeb4[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x88eeb4[_0x5884('0x33')],_0x88eeb4[_0x5884('0x36')]);_0x5e0f3a[_0x5884('0x39')]=_[_0x5884('0x37')](_0x88eeb4[_0x5884('0x33')],qs[_0x5884('0x38')](_0x23eafe[_0x5884('0x36')]['fields']));_0x5e0f3a[_0x5884('0x39')]=_0x5e0f3a[_0x5884('0x39')][_0x5884('0x3a')]?_0x5e0f3a['attributes']:_0x88eeb4['model'];_0x5e0f3a[_0x5884('0x3c')]=qs['sort'](_0x23eafe['query'][_0x5884('0x3d')]);_0x5e0f3a[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x23eafe['query'],_0x88eeb4[_0x5884('0x3f')]));if(_0x23eafe[_0x5884('0x36')][_0x5884('0x40')]){_0x5e0f3a[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x5e0f3a[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x5e0f3a[_0x5884('0x39')],function(_0x2786b7){var _0x258ddd={};_0x258ddd[_0x2786b7]={'$like':'%'+_0x23eafe[_0x5884('0x36')]['filter']+'%'};return _0x258ddd;})});}_0x5e0f3a=_['merge']({},_0x5e0f3a,_0x23eafe['options']);return _0x18389a[_0x5884('0x54')](_0x5e0f3a);}})[_0x5884('0x27')](function(_0x2f07bc){if(_0x2f07bc){_0x11fb3f=_0x2f07bc[_0x5884('0x3a')];if(!_0x23eafe[_0x5884('0x36')][_0x5884('0x3b')]('nolimit')){_0x5e0f3a[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x23eafe[_0x5884('0x36')]['limit']);_0x5e0f3a[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x23eafe[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x18389a['getTags'](_0x5e0f3a);}})[_0x5884('0x27')](function(_0x183570){if(_0x183570){return _0x183570?{'count':_0x11fb3f,'rows':_0x183570}:null;}})[_0x5884('0x27')](respondWithResult(_0x4706b5,null))[_0x5884('0x46')](handleError(_0x4706b5,null));};exports[_0x5884('0x55')]=function(_0x3b7816,_0x213296,_0x556012){if(_0x3b7816[_0x5884('0x4a')]['id']){delete _0x3b7816[_0x5884('0x4a')]['id'];}return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x3b7816[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0x213296,null))[_0x5884('0x27')](function(_0x3f75e7){if(_0x3f75e7){return _0x3f75e7[_0x5884('0x55')](_0x3b7816[_0x5884('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0x213296,null))[_0x5884('0x46')](handleError(_0x213296,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8b83266..ba18135 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 _0x0e9a=['api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','lodash','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0e9a,0x14b));var _0xa0e9=function(_0x28029a,_0x1a4c5f){_0x28029a=_0x28029a-0x0;var _0x13f191=_0x0e9a[_0x28029a];return _0x13f191;};'use strict';var _=require(_0xa0e9('0x0'));var util=require('util');var logger=require(_0xa0e9('0x1'))(_0xa0e9('0x2'));var moment=require(_0xa0e9('0x3'));var BPromise=require('bluebird');var rp=require(_0xa0e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0e9('0x5'));var config=require(_0xa0e9('0x6'));var attributes=require(_0xa0e9('0x7'));module['exports']=function(_0x1704e5,_0x269360){return _0x1704e5[_0xa0e9('0x8')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b5d=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','api','moment'];(function(_0x3687ea,_0x3689c3){var _0x224535=function(_0x36f9b1){while(--_0x36f9b1){_0x3687ea['push'](_0x3687ea['shift']());}};_0x224535(++_0x3689c3);}(_0x5b5d,0x1e8));var _0xd5b5=function(_0x5f21ad,_0x140e8){_0x5f21ad=_0x5f21ad-0x0;var _0x1722e4=_0x5b5d[_0x5f21ad];return _0x1722e4;};'use strict';var _=require(_0xd5b5('0x0'));var util=require(_0xd5b5('0x1'));var logger=require('../../config/logger')(_0xd5b5('0x2'));var moment=require(_0xd5b5('0x3'));var BPromise=require(_0xd5b5('0x4'));var rp=require(_0xd5b5('0x5'));var fs=require('fs');var path=require(_0xd5b5('0x6'));var rimraf=require(_0xd5b5('0x7'));var config=require(_0xd5b5('0x8'));var attributes=require(_0xd5b5('0x9'));module['exports']=function(_0x1eb4b9,_0x493eea){return _0x1eb4b9[_0xd5b5('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0xd5b5('0xb'),'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 95a94f1..e8fc000 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 _0xb1cf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x285f9b,_0xfcae6c){var _0x32dd58=function(_0x392920){while(--_0x392920){_0x285f9b['push'](_0x285f9b['shift']());}};_0x32dd58(++_0xfcae6c);}(_0xb1cf,0x1c3));var _0xfb1c=function(_0x438988,_0x2a86cf){_0x438988=_0x438988-0x0;var _0x1ce59f=_0xb1cf[_0x438988];return _0x1ce59f;};'use strict';var _=require(_0xfb1c('0x0'));var util=require(_0xfb1c('0x1'));var moment=require(_0xfb1c('0x2'));var BPromise=require(_0xfb1c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb1c('0x4'));var db=require(_0xfb1c('0x5'))['db'];var utils=require(_0xfb1c('0x6'));var logger=require(_0xfb1c('0x7'))(_0xfb1c('0x8'));var config=require(_0xfb1c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb1c('0xa')][_0xfb1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee437,_0x489a35,_0x10a865){return new BPromise(function(_0x490f5d,_0x1b8aa4){return client[_0xfb1c('0xc')](_0x3ee437,_0x10a865)[_0xfb1c('0xd')](function(_0xffa7c8){logger[_0xfb1c('0xe')](_0xfb1c('0xf'),_0x489a35,_0xfb1c('0x10'));logger['debug'](_0xfb1c('0x11'),_0x489a35,_0xfb1c('0x10'),JSON[_0xfb1c('0x12')](_0xffa7c8));if(_0xffa7c8['error']){if(_0xffa7c8[_0xfb1c('0x13')][_0xfb1c('0x14')]===0x1f4){logger['error'](_0xfb1c('0xf'),_0x489a35,_0xffa7c8['error']['message']);return _0x1b8aa4(_0xffa7c8['error'][_0xfb1c('0x15')]);}logger[_0xfb1c('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x489a35,_0xffa7c8['error'][_0xfb1c('0x15')]);return _0x490f5d(_0xffa7c8[_0xfb1c('0x13')][_0xfb1c('0x15')]);}else{logger[_0xfb1c('0xe')](_0xfb1c('0xf'),_0x489a35,_0xfb1c('0x10'));_0x490f5d(_0xffa7c8[_0xfb1c('0x16')][_0xfb1c('0x15')]);}})[_0xfb1c('0x17')](function(_0x5a4a6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x489a35,_0x5a4a6e);_0x1b8aa4(_0x5a4a6e);});});} \ No newline at end of file +var _0xad36=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b0492,_0x5dcab7){var _0x328739=function(_0x17b34b){while(--_0x17b34b){_0x3b0492['push'](_0x3b0492['shift']());}};_0x328739(++_0x5dcab7);}(_0xad36,0x125));var _0x6ad3=function(_0x319020,_0x34dc4e){_0x319020=_0x319020-0x0;var _0x23d5a7=_0xad36[_0x319020];return _0x23d5a7;};'use strict';var _=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var moment=require(_0x6ad3('0x2'));var BPromise=require(_0x6ad3('0x3'));var rs=require(_0x6ad3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ad3('0x5'))['db'];var utils=require(_0x6ad3('0x6'));var logger=require(_0x6ad3('0x7'))(_0x6ad3('0x8'));var config=require(_0x6ad3('0x9'));var jayson=require(_0x6ad3('0xa'));var client=jayson[_0x6ad3('0xb')][_0x6ad3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x511c0c,_0xe9f2e5,_0x9fc2cf){return new BPromise(function(_0x27d54d,_0x2eb835){return client[_0x6ad3('0xd')](_0x511c0c,_0x9fc2cf)[_0x6ad3('0xe')](function(_0x26f142){logger[_0x6ad3('0xf')](_0x6ad3('0x10'),_0xe9f2e5,_0x6ad3('0x11'));logger[_0x6ad3('0x12')](_0x6ad3('0x13'),_0xe9f2e5,_0x6ad3('0x11'),JSON[_0x6ad3('0x14')](_0x26f142));if(_0x26f142['error']){if(_0x26f142[_0x6ad3('0x15')]['code']===0x1f4){logger[_0x6ad3('0x15')](_0x6ad3('0x10'),_0xe9f2e5,_0x26f142['error'][_0x6ad3('0x16')]);return _0x2eb835(_0x26f142['error'][_0x6ad3('0x16')]);}logger['error'](_0x6ad3('0x10'),_0xe9f2e5,_0x26f142[_0x6ad3('0x15')][_0x6ad3('0x16')]);return _0x27d54d(_0x26f142['error']['message']);}else{logger[_0x6ad3('0xf')](_0x6ad3('0x10'),_0xe9f2e5,_0x6ad3('0x11'));_0x27d54d(_0x26f142[_0x6ad3('0x17')][_0x6ad3('0x16')]);}})['catch'](function(_0x5691f0){logger[_0x6ad3('0x15')](_0x6ad3('0x10'),_0xe9f2e5,_0x5691f0);_0x2eb835(_0x5691f0);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 76d6852..1c17236 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 _0xed87=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x47140b,_0x4874b1){var _0x78d1b1=function(_0x5b51a3){while(--_0x5b51a3){_0x47140b['push'](_0x47140b['shift']());}};_0x78d1b1(++_0x4874b1);}(_0xed87,0x16e));var _0x7ed8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xed87[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7ed8('0x0'));var util=require(_0x7ed8('0x1'));var path=require(_0x7ed8('0x2'));var timeout=require(_0x7ed8('0x3'));var express=require(_0x7ed8('0x4'));var router=express[_0x7ed8('0x5')]();var fs_extra=require(_0x7ed8('0x6'));var auth=require(_0x7ed8('0x7'));var interaction=require(_0x7ed8('0x8'));var config=require(_0x7ed8('0x9'));var controller=require(_0x7ed8('0xa'));router[_0x7ed8('0xb')]('/',auth[_0x7ed8('0xc')](),controller[_0x7ed8('0xd')]);router['get']('/:id',auth[_0x7ed8('0xc')](),controller[_0x7ed8('0xe')]);router[_0x7ed8('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ed8('0x10')](_0x7ed8('0x11'),auth['isAuthenticated'](),controller[_0x7ed8('0x12')]);router[_0x7ed8('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7ed8('0x14')]);module[_0x7ed8('0x15')]=router; \ No newline at end of file +var _0xd914=['get','isAuthenticated','show','post','/:id','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x433ea1,_0x30559c){var _0x4e0fae=function(_0x567112){while(--_0x567112){_0x433ea1['push'](_0x433ea1['shift']());}};_0x4e0fae(++_0x30559c);}(_0xd914,0x14b));var _0x4d91=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xd914[_0x35a274];return _0x40d905;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express['Router']();var fs_extra=require(_0x4d91('0x4'));var auth=require(_0x4d91('0x5'));var interaction=require(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));var controller=require(_0x4d91('0x8'));router[_0x4d91('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d91('0x9')]('/:id',auth[_0x4d91('0xa')](),controller[_0x4d91('0xb')]);router[_0x4d91('0xc')]('/',auth[_0x4d91('0xa')](),controller['create']);router['put'](_0x4d91('0xd'),auth[_0x4d91('0xa')](),controller[_0x4d91('0xe')]);router[_0x4d91('0xf')](_0x4d91('0xd'),auth[_0x4d91('0xa')](),controller[_0x4d91('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4e8fb5d..4c79f5e 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 _0xdb2d=['keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb2d,0x190));var _0xddb2=function(_0x128517,_0x554ec2){_0x128517=_0x128517-0x0;var _0x50e658=_0xdb2d[_0x128517];return _0x50e658;};'use strict';var Sequelize=require(_0xddb2('0x0'));module[_0xddb2('0x1')]={'type':{'type':Sequelize[_0xddb2('0x2')](_0xddb2('0x3'),_0xddb2('0x4'),'customVariable',_0xddb2('0x5'),_0xddb2('0x6')),'defaultValue':_0xddb2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xddb2('0x7')]},'keyType':{'type':Sequelize[_0xddb2('0x2')](_0xddb2('0x3'),'variable',_0xddb2('0x8'))},'keyContent':{'type':Sequelize[_0xddb2('0x7')]},'idField':{'type':Sequelize[_0xddb2('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xddb2('0x7')]}}; \ No newline at end of file +var _0x08ed=['string','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x08ed,0x69));var _0xd08e=function(_0x36a560,_0x57378b){_0x36a560=_0x36a560-0x0;var _0x10923a=_0x08ed[_0x36a560];return _0x10923a;};'use strict';var Sequelize=require(_0xd08e('0x0'));module['exports']={'type':{'type':Sequelize[_0xd08e('0x1')]('string',_0xd08e('0x2'),_0xd08e('0x3'),_0xd08e('0x4'),_0xd08e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd08e('0x6')]},'key':{'type':Sequelize[_0xd08e('0x6')]},'keyType':{'type':Sequelize[_0xd08e('0x1')](_0xd08e('0x7'),_0xd08e('0x2'),_0xd08e('0x3'))},'keyContent':{'type':Sequelize[_0xd08e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd08e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 319bbd3..50fccfd 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 _0xf109=['crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FreshdeskField','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x32fc75,_0x3aa7d8){var _0x103668=function(_0x4d47bd){while(--_0x4d47bd){_0x32fc75['push'](_0x32fc75['shift']());}};_0x103668(++_0x3aa7d8);}(_0xf109,0xce));var _0x9f10=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xf109[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){_0x3dde2e[_0x9f10('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(!_0x11cae7){_0x2ec07d[_0x9f10('0x26')](0x194);}return _0x11cae7;};}function handleError(_0x5e80de,_0x57539b){_0x57539b=_0x57539b||0x1f4;return function(_0x5c1800){logger[_0x9f10('0x27')](_0x5c1800['stack']);if(_0x5c1800[_0x9f10('0x28')]){delete _0x5c1800[_0x9f10('0x28')];}_0x5e80de[_0x9f10('0x18')](_0x57539b)[_0x9f10('0x29')](_0x5c1800);};}exports[_0x9f10('0x2a')]=function(_0x4f6b0c,_0x522805){var _0x22814f={},_0x40f96b={},_0xfbb37f={'count':0x0,'rows':[]};var _0x181aec=_[_0x9f10('0x2b')](db['FreshdeskField'][_0x9f10('0x2c')],function(_0x501ee){return{'name':_0x501ee[_0x9f10('0x2d')],'type':_0x501ee[_0x9f10('0x2e')]['key']};});_0x40f96b[_0x9f10('0x2f')]=_[_0x9f10('0x2b')](_0x181aec,_0x9f10('0x28'));_0x40f96b['query']=_[_0x9f10('0x30')](_0x4f6b0c['query']);_0x40f96b[_0x9f10('0x31')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],_0x40f96b['query']);_0x22814f[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],qs[_0x9f10('0x34')](_0x4f6b0c[_0x9f10('0x35')]['fields']));_0x22814f[_0x9f10('0x33')]=_0x22814f['attributes'][_0x9f10('0x36')]?_0x22814f[_0x9f10('0x33')]:_0x40f96b[_0x9f10('0x2f')];if(!_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x37')](_0x9f10('0x38'))){_0x22814f['limit']=qs[_0x9f10('0x1b')](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x1b')]);_0x22814f['offset']=qs[_0x9f10('0x1d')](_0x4f6b0c[_0x9f10('0x35')]['offset']);}_0x22814f[_0x9f10('0x39')]=qs['sort'](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x3a')]);_0x22814f[_0x9f10('0x3b')]=qs[_0x9f10('0x31')](_[_0x9f10('0x3c')](_0x4f6b0c[_0x9f10('0x35')],_0x40f96b[_0x9f10('0x31')]),_0x181aec);if(_0x4f6b0c[_0x9f10('0x35')]['filter']){_0x22814f[_0x9f10('0x3b')]=_[_0x9f10('0x3d')](_0x22814f[_0x9f10('0x3b')],{'$or':_['map'](_0x181aec,function(_0x233bab){if(_0x233bab[_0x9f10('0x2e')]!=='VIRTUAL'){var _0x30b04b={};_0x30b04b[_0x233bab[_0x9f10('0x28')]]={'$like':'%'+_0x4f6b0c[_0x9f10('0x35')]['filter']+'%'};return _0x30b04b;}})});}_0x22814f=_['merge']({},_0x22814f,_0x4f6b0c[_0x9f10('0x3e')]);var _0x2ff98d={'where':_0x22814f[_0x9f10('0x3b')]};return db[_0x9f10('0x3f')][_0x9f10('0x1c')](_0x2ff98d)[_0x9f10('0x25')](function(_0x15929f){_0xfbb37f[_0x9f10('0x1c')]=_0x15929f;if(_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x40')]){_0x22814f[_0x9f10('0x41')]=[{'all':!![]}];}return db[_0x9f10('0x3f')]['findAll'](_0x22814f);})['then'](function(_0x4bb805){_0xfbb37f[_0x9f10('0x42')]=_0x4bb805;return _0xfbb37f;})['then'](respondWithFilteredResult(_0x522805,_0x22814f))[_0x9f10('0x43')](handleError(_0x522805,null));};exports[_0x9f10('0x44')]=function(_0x426d30,_0x47d25c){var _0x3cfce6={'raw':!![],'where':{'id':_0x426d30[_0x9f10('0x45')]['id']}},_0xf1164={};_0xf1164[_0x9f10('0x2f')]=_[_0x9f10('0x30')](db['FreshdeskField']['rawAttributes']);_0xf1164['query']=_[_0x9f10('0x30')](_0x426d30['query']);_0xf1164[_0x9f10('0x31')]=_['intersection'](_0xf1164[_0x9f10('0x2f')],_0xf1164[_0x9f10('0x35')]);_0x3cfce6[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0xf1164['model'],qs[_0x9f10('0x34')](_0x426d30[_0x9f10('0x35')]['fields']));_0x3cfce6[_0x9f10('0x33')]=_0x3cfce6[_0x9f10('0x33')][_0x9f10('0x36')]?_0x3cfce6[_0x9f10('0x33')]:_0xf1164[_0x9f10('0x2f')];if(_0x426d30[_0x9f10('0x35')][_0x9f10('0x40')]){_0x3cfce6[_0x9f10('0x41')]=[{'all':!![]}];}_0x3cfce6=_[_0x9f10('0x3d')]({},_0x3cfce6,_0x426d30[_0x9f10('0x3e')]);return db['FreshdeskField'][_0x9f10('0x46')](_0x3cfce6)[_0x9f10('0x25')](handleEntityNotFound(_0x47d25c,null))['then'](respondWithResult(_0x47d25c,null))[_0x9f10('0x43')](handleError(_0x47d25c,null));};exports[_0x9f10('0x47')]=function(_0x1cf3eb,_0x1807b3){return db['FreshdeskField'][_0x9f10('0x47')](_0x1cf3eb[_0x9f10('0x48')],{})[_0x9f10('0x25')](respondWithResult(_0x1807b3,0xc9))[_0x9f10('0x43')](handleError(_0x1807b3,null));};exports[_0x9f10('0x23')]=function(_0x43cb31,_0x479b46){if(_0x43cb31[_0x9f10('0x48')]['id']){delete _0x43cb31[_0x9f10('0x48')]['id'];}return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x43cb31[_0x9f10('0x45')]['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x479b46,null))['then'](saveUpdates(_0x43cb31[_0x9f10('0x48')],null))[_0x9f10('0x25')](respondWithResult(_0x479b46,null))[_0x9f10('0x43')](handleError(_0x479b46,null));};exports[_0x9f10('0x24')]=function(_0x39dae3,_0x15d676){return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x39dae3['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x15d676,null))['then'](removeEntity(_0x15d676,null))[_0x9f10('0x43')](handleError(_0x15d676,null));}; \ No newline at end of file +var _0x4e81=['../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x50b407,_0x44dbd1){var _0x50a01d=function(_0x57be1a){while(--_0x57be1a){_0x50b407['push'](_0x50b407['shift']());}};_0x50a01d(++_0x44dbd1);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0x4e81[_0x4450b1];return _0x399b0b;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['FreshdeskField'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e7d6c86..64819a2 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 _0xa3d4=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x451bb4,_0x4e2391){var _0x4f850c=function(_0x277b43){while(--_0x277b43){_0x451bb4['push'](_0x451bb4['shift']());}};_0x4f850c(++_0x4e2391);}(_0xa3d4,0x12d));var _0x4a3d=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xa3d4[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x4a3d('0x0'));var util=require(_0x4a3d('0x1'));var logger=require(_0x4a3d('0x2'))(_0x4a3d('0x3'));var moment=require(_0x4a3d('0x4'));var BPromise=require(_0x4a3d('0x5'));var rp=require(_0x4a3d('0x6'));var fs=require('fs');var path=require(_0x4a3d('0x7'));var rimraf=require(_0x4a3d('0x8'));var config=require(_0x4a3d('0x9'));var attributes=require(_0x4a3d('0xa'));module[_0x4a3d('0xb')]=function(_0x4f57be,_0x43012c){return _0x4f57be['define'](_0x4a3d('0xc'),attributes,{'tableName':_0x4a3d('0xd'),'paranoid':![],'indexes':[{'name':_0x4a3d('0xe'),'fields':[_0x4a3d('0xf'),_0x4a3d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1966=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x454589,_0x3e852e){var _0x468c5c=function(_0xa5b1f5){while(--_0xa5b1f5){_0x454589['push'](_0x454589['shift']());}};_0x468c5c(++_0x3e852e);}(_0x1966,0x9f));var _0x6196=function(_0x49311c,_0x379c09){_0x49311c=_0x49311c-0x0;var _0x1dc6ed=_0x1966[_0x49311c];return _0x1dc6ed;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var logger=require(_0x6196('0x2'))(_0x6196('0x3'));var moment=require('moment');var BPromise=require(_0x6196('0x4'));var rp=require(_0x6196('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6196('0x6'));var attributes=require(_0x6196('0x7'));module[_0x6196('0x8')]=function(_0x57abf1,_0x5de05b){return _0x57abf1[_0x6196('0x9')](_0x6196('0xa'),attributes,{'tableName':_0x6196('0xb'),'paranoid':![],'indexes':[{'name':_0x6196('0xc'),'fields':['idField',_0x6196('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index e930716..1e28a99 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 _0xf432=['request\x20sent','stringify','code','message','error','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x1b4412,_0x31c1ff){var _0x337392=function(_0x553288){while(--_0x553288){_0x1b4412['push'](_0x1b4412['shift']());}};_0x337392(++_0x31c1ff);}(_0xf432,0xc7));var _0x2f43=function(_0x7e3f06,_0x426f70){_0x7e3f06=_0x7e3f06-0x0;var _0x12b8ff=_0xf432[_0x7e3f06];return _0x12b8ff;};'use strict';var _=require('lodash');var util=require(_0x2f43('0x0'));var moment=require(_0x2f43('0x1'));var BPromise=require(_0x2f43('0x2'));var rs=require(_0x2f43('0x3'));var fs=require('fs');var Redis=require(_0x2f43('0x4'));var db=require(_0x2f43('0x5'))['db'];var utils=require(_0x2f43('0x6'));var logger=require(_0x2f43('0x7'))(_0x2f43('0x8'));var config=require(_0x2f43('0x9'));var jayson=require(_0x2f43('0xa'));var client=jayson[_0x2f43('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e7d25,_0x29c5ec,_0x54fea4){return new BPromise(function(_0x37fd2,_0x27a18e){return client['request'](_0x1e7d25,_0x54fea4)[_0x2f43('0xc')](function(_0x478749){logger[_0x2f43('0xd')](_0x2f43('0xe'),_0x29c5ec,'request\x20sent');logger[_0x2f43('0xf')](_0x2f43('0x10'),_0x29c5ec,_0x2f43('0x11'),JSON[_0x2f43('0x12')](_0x478749));if(_0x478749['error']){if(_0x478749['error'][_0x2f43('0x13')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x29c5ec,_0x478749['error'][_0x2f43('0x14')]);return _0x27a18e(_0x478749[_0x2f43('0x15')][_0x2f43('0x14')]);}logger[_0x2f43('0x15')](_0x2f43('0xe'),_0x29c5ec,_0x478749[_0x2f43('0x15')][_0x2f43('0x14')]);return _0x37fd2(_0x478749[_0x2f43('0x15')][_0x2f43('0x14')]);}else{logger[_0x2f43('0xd')](_0x2f43('0xe'),_0x29c5ec,_0x2f43('0x11'));_0x37fd2(_0x478749[_0x2f43('0x16')][_0x2f43('0x14')]);}})[_0x2f43('0x17')](function(_0x126e4c){logger[_0x2f43('0x15')](_0x2f43('0xe'),_0x29c5ec,_0x126e4c);_0x27a18e(_0x126e4c);});});} \ No newline at end of file +var _0x9d13=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2896b0,_0x59c683){var _0x2a6d78=function(_0x6728fa){while(--_0x6728fa){_0x2896b0['push'](_0x2896b0['shift']());}};_0x2a6d78(++_0x59c683);}(_0x9d13,0x81));var _0x39d1=function(_0x134664,_0x34e58a){_0x134664=_0x134664-0x0;var _0x157ac=_0x9d13[_0x134664];return _0x157ac;};'use strict';var _=require(_0x39d1('0x0'));var util=require(_0x39d1('0x1'));var moment=require(_0x39d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x39d1('0x3'));var fs=require('fs');var Redis=require(_0x39d1('0x4'));var db=require(_0x39d1('0x5'))['db'];var utils=require(_0x39d1('0x6'));var logger=require(_0x39d1('0x7'))(_0x39d1('0x8'));var config=require(_0x39d1('0x9'));var jayson=require(_0x39d1('0xa'));var client=jayson[_0x39d1('0xb')][_0x39d1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21c649,_0x2dfeb7,_0x4dacdd){return new BPromise(function(_0x3c02f3,_0x1cb416){return client[_0x39d1('0xd')](_0x21c649,_0x4dacdd)['then'](function(_0x618c28){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x2dfeb7,_0x39d1('0xe'));logger[_0x39d1('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2dfeb7,'request\x20sent',JSON[_0x39d1('0x10')](_0x618c28));if(_0x618c28[_0x39d1('0x11')]){if(_0x618c28['error'][_0x39d1('0x12')]===0x1f4){logger[_0x39d1('0x11')](_0x39d1('0x13'),_0x2dfeb7,_0x618c28[_0x39d1('0x11')]['message']);return _0x1cb416(_0x618c28['error'][_0x39d1('0x14')]);}logger['error'](_0x39d1('0x13'),_0x2dfeb7,_0x618c28[_0x39d1('0x11')]['message']);return _0x3c02f3(_0x618c28['error'][_0x39d1('0x14')]);}else{logger[_0x39d1('0x15')](_0x39d1('0x13'),_0x2dfeb7,_0x39d1('0xe'));_0x3c02f3(_0x618c28['result'][_0x39d1('0x14')]);}})[_0x39d1('0x16')](function(_0x3482e6){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x2dfeb7,_0x3482e6);_0x1cb416(_0x3482e6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e5ea160..48fc32b 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69d3=['path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','multer','util'];(function(_0x573ca2,_0x4dcca7){var _0x406c77=function(_0x271582){while(--_0x271582){_0x573ca2['push'](_0x573ca2['shift']());}};_0x406c77(++_0x4dcca7);}(_0x69d3,0xda));var _0x369d=function(_0x1838ba,_0x3d44e5){_0x1838ba=_0x1838ba-0x0;var _0x5197ef=_0x69d3[_0x1838ba];return _0x5197ef;};'use strict';var multer=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var path=require(_0x369d('0x2'));var timeout=require('connect-timeout');var express=require(_0x369d('0x3'));var router=express[_0x369d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x369d('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0x369d('0x6')]('/',auth[_0x369d('0x7')](),controller[_0x369d('0x8')]);router[_0x369d('0x6')](_0x369d('0x9'),auth[_0x369d('0x7')](),controller[_0x369d('0xa')]);router[_0x369d('0x6')](_0x369d('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x369d('0x6')](_0x369d('0xc'),auth[_0x369d('0x7')](),controller[_0x369d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x369d('0xe')]);router[_0x369d('0xf')](_0x369d('0xb'),auth[_0x369d('0x7')](),controller[_0x369d('0x10')]);router[_0x369d('0x11')]('/:id',auth[_0x369d('0x7')](),controller[_0x369d('0x12')]);router[_0x369d('0x13')](_0x369d('0x9'),auth[_0x369d('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6b20=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x6b20,0xd1));var _0x06b2=function(_0x4dbefb,_0x5693c2){_0x4dbefb=_0x4dbefb-0x0;var _0x5501f9=_0x6b20[_0x4dbefb];return _0x5501f9;};'use strict';var multer=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var path=require('path');var timeout=require(_0x06b2('0x2'));var express=require('express');var router=express[_0x06b2('0x3')]();var fs_extra=require(_0x06b2('0x4'));var auth=require(_0x06b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06b2('0x6'));var controller=require(_0x06b2('0x7'));router[_0x06b2('0x8')]('/',auth[_0x06b2('0x9')](),controller[_0x06b2('0xa')]);router[_0x06b2('0x8')](_0x06b2('0xb'),auth['isAuthenticated'](),controller[_0x06b2('0xc')]);router[_0x06b2('0x8')](_0x06b2('0xd'),auth['isAuthenticated'](),controller[_0x06b2('0xe')]);router['get'](_0x06b2('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x06b2('0x10')]('/',auth[_0x06b2('0x9')](),controller['create']);router[_0x06b2('0x10')](_0x06b2('0xd'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x11')]);router[_0x06b2('0x12')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x13')]);router[_0x06b2('0x14')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x15')]);module[_0x06b2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 787af7b..20860a4 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf2f=['exports','STRING','remoteUri','sequelize'];(function(_0x43c35c,_0xeb5f90){var _0x2ea8da=function(_0x21704a){while(--_0x21704a){_0x43c35c['push'](_0x43c35c['shift']());}};_0x2ea8da(++_0xeb5f90);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x514018,_0x59d4cb){_0x514018=_0x514018-0x0;var _0x30a2a7=_0xcf2f[_0x514018];return _0x30a2a7;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'name':{'type':Sequelize[_0xfcf2('0x2')]},'description':{'type':Sequelize[_0xfcf2('0x2')]},'username':{'type':Sequelize[_0xfcf2('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfcf2('0x2')]},'remoteUri':{'type':Sequelize[_0xfcf2('0x2')],'unique':_0xfcf2('0x3')},'serverUrl':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x495737,_0x22e541){var _0x4fa502=function(_0x1cc904){while(--_0x1cc904){_0x495737['push'](_0x495737['shift']());}};_0x4fa502(++_0x22e541);}(_0x4991,0xf7));var _0x1499=function(_0x716fea,_0xd6de79){_0x716fea=_0x716fea-0x0;var _0x26cc29=_0x4991[_0x716fea];return _0x26cc29;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index bc15a2a..fddd5b7 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab43=['FreshsalesAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','rows','show','params','length','merge','find','catch','create','body','findOne','FreshsalesConfiguration','order','getConfigurations','addConfiguration','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','remoteUri','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map'];(function(_0x1b533a,_0x407e43){var _0x4d7cb5=function(_0x1a58f8){while(--_0x1a58f8){_0x1b533a['push'](_0x1b533a['shift']());}};_0x4d7cb5(++_0x407e43);}(_0xab43,0x94));var _0x3ab4=function(_0x1ea34f,_0x50f248){_0x1ea34f=_0x1ea34f-0x0;var _0x5ecee1=_0xab43[_0x1ea34f];return _0x5ecee1;};'use strict';var emlformat=require(_0x3ab4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ab4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ab4('0x2'));var moment=require(_0x3ab4('0x3'));var BPromise=require(_0x3ab4('0x4'));var Mustache=require(_0x3ab4('0x5'));var util=require(_0x3ab4('0x6'));var path=require(_0x3ab4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ab4('0x8'));var fs=require('fs');var fs_extra=require(_0x3ab4('0x9'));var _=require(_0x3ab4('0xa'));var squel=require(_0x3ab4('0xb'));var crypto=require('crypto');var jsforce=require(_0x3ab4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3ab4('0xd'));var querystring=require('querystring');var Papa=require(_0x3ab4('0xe'));var Redis=require('ioredis');var authService=require(_0x3ab4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3ab4('0x10'));var hardwareService=require(_0x3ab4('0x11'));var logger=require(_0x3ab4('0x12'))('api');var utils=require(_0x3ab4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3ab4('0x14'));var db=require(_0x3ab4('0x15'))['db'];var integrations=require(_0x3ab4('0x16'));function respondWithStatusCode(_0x54da94,_0x41f91d){_0x41f91d=_0x41f91d||0xcc;return function(_0x3ce018){if(_0x3ce018){return _0x54da94[_0x3ab4('0x17')](_0x41f91d);}return _0x54da94[_0x3ab4('0x18')](_0x41f91d)[_0x3ab4('0x19')]();};}function respondWithResult(_0x243e7b,_0x128f42){_0x128f42=_0x128f42||0xc8;return function(_0x505530){if(_0x505530){return _0x243e7b[_0x3ab4('0x18')](_0x128f42)['json'](_0x505530);}};}function respondWithFilteredResult(_0x9c86b8,_0x431280){return function(_0x54d6d3){if(_0x54d6d3){var _0x58600e=typeof _0x431280['offset']===_0x3ab4('0x1a')&&typeof _0x431280[_0x3ab4('0x1b')]===_0x3ab4('0x1a');var _0x4f219a=_0x54d6d3[_0x3ab4('0x1c')];var _0x4dd4af=_0x58600e?0x0:_0x431280[_0x3ab4('0x1d')];var _0x401407=_0x58600e?_0x54d6d3['count']:_0x431280[_0x3ab4('0x1d')]+_0x431280[_0x3ab4('0x1b')];var _0x3d6507;if(_0x401407>=_0x4f219a){_0x401407=_0x4f219a;_0x3d6507=0xc8;}else{_0x3d6507=0xce;}_0x9c86b8['status'](_0x3d6507);return _0x9c86b8['set'](_0x3ab4('0x1e'),_0x4dd4af+'-'+_0x401407+'/'+_0x4f219a)[_0x3ab4('0x1f')](_0x54d6d3);}return null;};}function patchUpdates(_0x426c07){return function(_0x427671){try{jsonpatch[_0x3ab4('0x20')](_0x427671,_0x426c07,!![]);}catch(_0x337509){return BPromise[_0x3ab4('0x21')](_0x337509);}return _0x427671['save']();};}function saveUpdates(_0x25bc50,_0x3ffc64){return function(_0x23b204){if(_0x23b204){return _0x23b204['update'](_0x25bc50)[_0x3ab4('0x22')](function(_0x4a542c){return _0x4a542c;});}return null;};}function removeEntity(_0x4b7c40,_0x5de29b){return function(_0x169508){if(_0x169508){return _0x169508[_0x3ab4('0x23')]()[_0x3ab4('0x22')](function(){_0x4b7c40[_0x3ab4('0x18')](0xcc)[_0x3ab4('0x19')]();});}};}function handleEntityNotFound(_0x2ea82a,_0x28985f){return function(_0x23ee22){if(!_0x23ee22){_0x2ea82a['sendStatus'](0x194);}return _0x23ee22;};}function handleError(_0x3d71b4,_0x586ab9){_0x586ab9=_0x586ab9||0x1f4;return function(_0x2c9189){logger[_0x3ab4('0x24')](_0x2c9189[_0x3ab4('0x25')]);if(_0x2c9189[_0x3ab4('0x26')]){delete _0x2c9189['name'];}_0x3d71b4[_0x3ab4('0x18')](_0x586ab9)[_0x3ab4('0x27')](_0x2c9189);};}exports[_0x3ab4('0x28')]=function(_0x2e556a,_0x4fac54){var _0xfba822={},_0x2409da={},_0x1ffd7c={'count':0x0,'rows':[]};var _0x2efded=_[_0x3ab4('0x29')](db[_0x3ab4('0x2a')][_0x3ab4('0x2b')],function(_0x467b3b){return{'name':_0x467b3b['fieldName'],'type':_0x467b3b[_0x3ab4('0x2c')][_0x3ab4('0x2d')]};});_0x2409da[_0x3ab4('0x2e')]=_[_0x3ab4('0x29')](_0x2efded,_0x3ab4('0x26'));_0x2409da['query']=_[_0x3ab4('0x2f')](_0x2e556a[_0x3ab4('0x30')]);_0x2409da[_0x3ab4('0x31')]=_[_0x3ab4('0x32')](_0x2409da['model'],_0x2409da['query']);_0xfba822[_0x3ab4('0x33')]=_[_0x3ab4('0x32')](_0x2409da[_0x3ab4('0x2e')],qs['fields'](_0x2e556a['query'][_0x3ab4('0x34')]));_0xfba822[_0x3ab4('0x33')]=_0xfba822['attributes']['length']?_0xfba822['attributes']:_0x2409da[_0x3ab4('0x2e')];if(!_0x2e556a[_0x3ab4('0x30')][_0x3ab4('0x35')](_0x3ab4('0x36'))){_0xfba822[_0x3ab4('0x1b')]=qs[_0x3ab4('0x1b')](_0x2e556a[_0x3ab4('0x30')][_0x3ab4('0x1b')]);_0xfba822[_0x3ab4('0x1d')]=qs[_0x3ab4('0x1d')](_0x2e556a[_0x3ab4('0x30')][_0x3ab4('0x1d')]);}_0xfba822['order']=qs[_0x3ab4('0x37')](_0x2e556a[_0x3ab4('0x30')][_0x3ab4('0x37')]);_0xfba822[_0x3ab4('0x38')]=qs[_0x3ab4('0x31')](_['pick'](_0x2e556a[_0x3ab4('0x30')],_0x2409da[_0x3ab4('0x31')]),_0x2efded);if(_0x2e556a[_0x3ab4('0x30')][_0x3ab4('0x39')]){_0xfba822['where']=_['merge'](_0xfba822[_0x3ab4('0x38')],{'$or':_[_0x3ab4('0x29')](_0x2efded,function(_0x599881){if(_0x599881[_0x3ab4('0x2c')]!=='VIRTUAL'){var _0x45b296={};_0x45b296[_0x599881[_0x3ab4('0x26')]]={'$like':'%'+_0x2e556a[_0x3ab4('0x30')]['filter']+'%'};return _0x45b296;}})});}_0xfba822=_['merge']({},_0xfba822,_0x2e556a[_0x3ab4('0x3a')]);var _0x44f18f={'where':_0xfba822[_0x3ab4('0x38')]};return db[_0x3ab4('0x2a')][_0x3ab4('0x1c')](_0x44f18f)['then'](function(_0x58d330){_0x1ffd7c['count']=_0x58d330;if(_0x2e556a['query'][_0x3ab4('0x3b')]){_0xfba822[_0x3ab4('0x3c')]=[{'all':!![]}];}return db[_0x3ab4('0x2a')]['findAll'](_0xfba822);})[_0x3ab4('0x22')](function(_0x547dda){_0x1ffd7c[_0x3ab4('0x3d')]=_0x547dda;return _0x1ffd7c;})[_0x3ab4('0x22')](respondWithFilteredResult(_0x4fac54,_0xfba822))['catch'](handleError(_0x4fac54,null));};exports[_0x3ab4('0x3e')]=function(_0x22f488,_0x4bf1ba){var _0x597717={'raw':![],'where':{'id':_0x22f488[_0x3ab4('0x3f')]['id']}},_0x47f6ca={};_0x47f6ca[_0x3ab4('0x2e')]=_[_0x3ab4('0x2f')](db[_0x3ab4('0x2a')][_0x3ab4('0x2b')]);_0x47f6ca[_0x3ab4('0x30')]=_[_0x3ab4('0x2f')](_0x22f488['query']);_0x47f6ca[_0x3ab4('0x31')]=_['intersection'](_0x47f6ca[_0x3ab4('0x2e')],_0x47f6ca[_0x3ab4('0x30')]);_0x597717[_0x3ab4('0x33')]=_[_0x3ab4('0x32')](_0x47f6ca[_0x3ab4('0x2e')],qs[_0x3ab4('0x34')](_0x22f488[_0x3ab4('0x30')][_0x3ab4('0x34')]));_0x597717['attributes']=_0x597717[_0x3ab4('0x33')][_0x3ab4('0x40')]?_0x597717[_0x3ab4('0x33')]:_0x47f6ca[_0x3ab4('0x2e')];if(_0x22f488['query'][_0x3ab4('0x3b')]){_0x597717[_0x3ab4('0x3c')]=[{'all':!![]}];}_0x597717=_[_0x3ab4('0x41')]({},_0x597717,_0x22f488[_0x3ab4('0x3a')]);return db[_0x3ab4('0x2a')][_0x3ab4('0x42')](_0x597717)['then'](handleEntityNotFound(_0x4bf1ba,null))[_0x3ab4('0x22')](respondWithResult(_0x4bf1ba,null))[_0x3ab4('0x43')](handleError(_0x4bf1ba,null));};exports['create']=function(_0x3a7970,_0x44e999){return db[_0x3ab4('0x2a')][_0x3ab4('0x44')](_0x3a7970[_0x3ab4('0x45')],{})[_0x3ab4('0x22')](respondWithResult(_0x44e999,0xc9))[_0x3ab4('0x43')](handleError(_0x44e999,null));};exports['update']=function(_0xeb2740,_0x3d79e2){if(_0xeb2740['body']['id']){delete _0xeb2740[_0x3ab4('0x45')]['id'];}return db[_0x3ab4('0x2a')][_0x3ab4('0x42')]({'where':{'id':_0xeb2740[_0x3ab4('0x3f')]['id']}})[_0x3ab4('0x22')](handleEntityNotFound(_0x3d79e2,null))['then'](saveUpdates(_0xeb2740[_0x3ab4('0x45')],null))[_0x3ab4('0x22')](respondWithResult(_0x3d79e2,null))['catch'](handleError(_0x3d79e2,null));};exports[_0x3ab4('0x23')]=function(_0x51e9b4,_0x3b775c){return db['FreshsalesAccount'][_0x3ab4('0x42')]({'where':{'id':_0x51e9b4['params']['id']}})['then'](handleEntityNotFound(_0x3b775c,null))['then'](removeEntity(_0x3b775c,null))['catch'](handleError(_0x3b775c,null));};exports['getConfigurations']=function(_0x21cd85,_0x296586,_0x2d9e39){var _0xb08217={};var _0x4f6ba5={};var _0x538fd0;var _0x4cfff9;return db[_0x3ab4('0x2a')][_0x3ab4('0x46')]({'where':{'id':_0x21cd85[_0x3ab4('0x3f')]['id']}})[_0x3ab4('0x22')](handleEntityNotFound(_0x296586,null))[_0x3ab4('0x22')](function(_0x334e1e){if(_0x334e1e){_0x538fd0=_0x334e1e;_0x4f6ba5[_0x3ab4('0x2e')]=_[_0x3ab4('0x2f')](db[_0x3ab4('0x47')][_0x3ab4('0x2b')]);_0x4f6ba5[_0x3ab4('0x30')]=_[_0x3ab4('0x2f')](_0x21cd85[_0x3ab4('0x30')]);_0x4f6ba5['filters']=_['intersection'](_0x4f6ba5[_0x3ab4('0x2e')],_0x4f6ba5[_0x3ab4('0x30')]);_0xb08217[_0x3ab4('0x33')]=_['intersection'](_0x4f6ba5['model'],qs['fields'](_0x21cd85[_0x3ab4('0x30')]['fields']));_0xb08217[_0x3ab4('0x33')]=_0xb08217[_0x3ab4('0x33')]['length']?_0xb08217[_0x3ab4('0x33')]:_0x4f6ba5[_0x3ab4('0x2e')];_0xb08217[_0x3ab4('0x48')]=qs[_0x3ab4('0x37')](_0x21cd85[_0x3ab4('0x30')][_0x3ab4('0x37')]);_0xb08217[_0x3ab4('0x38')]=qs[_0x3ab4('0x31')](_['pick'](_0x21cd85[_0x3ab4('0x30')],_0x4f6ba5[_0x3ab4('0x31')]));if(_0x21cd85[_0x3ab4('0x30')][_0x3ab4('0x39')]){_0xb08217[_0x3ab4('0x38')]=_[_0x3ab4('0x41')](_0xb08217[_0x3ab4('0x38')],{'$or':_[_0x3ab4('0x29')](_0xb08217[_0x3ab4('0x33')],function(_0x17536b){var _0x4d05c4={};_0x4d05c4[_0x17536b]={'$like':'%'+_0x21cd85[_0x3ab4('0x30')]['filter']+'%'};return _0x4d05c4;})});}_0xb08217=_[_0x3ab4('0x41')]({},_0xb08217,_0x21cd85[_0x3ab4('0x3a')]);return _0x538fd0[_0x3ab4('0x49')](_0xb08217);}})['then'](function(_0x365d34){if(_0x365d34){_0x4cfff9=_0x365d34[_0x3ab4('0x40')];if(!_0x21cd85[_0x3ab4('0x30')][_0x3ab4('0x35')]('nolimit')){_0xb08217[_0x3ab4('0x1b')]=qs['limit'](_0x21cd85[_0x3ab4('0x30')][_0x3ab4('0x1b')]);_0xb08217['offset']=qs[_0x3ab4('0x1d')](_0x21cd85['query'][_0x3ab4('0x1d')]);}return _0x538fd0[_0x3ab4('0x49')](_0xb08217);}})[_0x3ab4('0x22')](function(_0x493dc9){if(_0x493dc9){return _0x493dc9?{'count':_0x4cfff9,'rows':_0x493dc9}:null;}})[_0x3ab4('0x22')](respondWithResult(_0x296586,null))[_0x3ab4('0x43')](handleError(_0x296586,null));};exports[_0x3ab4('0x4a')]=function(_0x54a9de,_0x5cb5c6,_0x3d7b95){if(_0x54a9de[_0x3ab4('0x45')]['id']){delete _0x54a9de[_0x3ab4('0x45')]['id'];}return db[_0x3ab4('0x2a')][_0x3ab4('0x46')]({'where':{'id':_0x54a9de[_0x3ab4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5cb5c6,null))['then'](function(_0x922f04){if(_0x922f04){_0x54a9de[_0x3ab4('0x45')]['AccountId']=_0x922f04['id'];_0x54a9de[_0x3ab4('0x45')]['Subjects']=integrations['getSubjects'](_0x54a9de[_0x3ab4('0x45')][_0x3ab4('0x4b')],_0x54a9de[_0x3ab4('0x45')]['type']);_0x54a9de[_0x3ab4('0x45')]['Descriptions']=integrations[_0x3ab4('0x4c')](_0x54a9de[_0x3ab4('0x45')][_0x3ab4('0x4b')],_0x54a9de[_0x3ab4('0x45')][_0x3ab4('0x2c')]);return db[_0x3ab4('0x47')]['create'](_0x54a9de[_0x3ab4('0x45')],{'include':[{'model':db[_0x3ab4('0x4d')],'as':_0x3ab4('0x4e')},{'model':db['FreshsalesField'],'as':_0x3ab4('0x4f')}]});}return null;})[_0x3ab4('0x22')](respondWithResult(_0x5cb5c6,null))[_0x3ab4('0x43')](handleError(_0x5cb5c6,null));};exports['getFields']=function(_0x525022,_0x3b52fe,_0x167edf){var _0x2dede4='';var _0x48c09e='';return db[_0x3ab4('0x2a')][_0x3ab4('0x46')]({'where':{'id':_0x525022['params']['id']},'attributes':['id','username',_0x3ab4('0x50'),_0x3ab4('0x51')]})['then'](handleEntityNotFound(_0x3b52fe,null))[_0x3ab4('0x22')](function(_0x2664c6){if(_0x2664c6){_0x48c09e=_0x2664c6['username'];_0x2dede4=_0x2664c6[_0x3ab4('0x50')];var _0x11f5b4=_0x2664c6[_0x3ab4('0x50')][_0x3ab4('0x52')](-0x1);if(_0x11f5b4==='/'){_0x2dede4=_0x2dede4['substring'](0x0,_0x2dede4['lastIndexOf'](_0x11f5b4));}return rp({'method':_0x3ab4('0x53'),'uri':util[_0x3ab4('0x54')](_0x3ab4('0x55'),_0x2dede4,_0x3ab4('0x56')),'headers':{'Authorization':_0x3ab4('0x57')+_0x2664c6[_0x3ab4('0x51')]},'json':!![]});}})[_0x3ab4('0x22')](function(_0x1fc507){if(_0x1fc507){var _0xa9bac1=_0x1fc507[_0x3ab4('0x58')];var _0x131fe5=![];var _0x48fc5b=null;for(_0x48fc5b=0x0;_0x48fc5b<_0xa9bac1[_0x3ab4('0x40')];_0x48fc5b++){if(_0xa9bac1[_0x48fc5b][_0x3ab4('0x59')]===_0x48c09e){_0x131fe5=!![];}}if(_0x131fe5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3ab4('0x5a')});}}})[_0x3ab4('0x22')](respondWithResult(_0x3b52fe,null))[_0x3ab4('0x43')](function(_0x57522d){var _0x803d21=_0x525022[_0x3ab4('0x30')]['test']?0x1f4:_0x57522d[_0x3ab4('0x5b')]||0x1f4;logger[_0x3ab4('0x24')](_0x3ab4('0x5c'),_0x3ab4('0x5d'),_0x803d21,JSON['stringify'](_0x57522d));delete _0x57522d[_0x3ab4('0x26')];if(_0x803d21===0x191){_0x803d21=0x190;}_0x3b52fe['status'](_0x803d21)['send'](_0x525022['query'][_0x3ab4('0x5e')]?{'message':'Wrong\x20credentials','statusCode':_0x57522d[_0x3ab4('0x5b')]}:_0x57522d);});}; \ No newline at end of file +var _0x030e=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','type','VIRTUAL','filter','options','where','FreshsalesAccount','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','findOne','order','AccountId','Subjects','getSubjects','Descriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','users','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x030e,0xac));var _0xe030=function(_0x3e3cfd,_0x410fbe){_0x3e3cfd=_0x3e3cfd-0x0;var _0x318176=_0x030e[_0x3e3cfd];return _0x318176;};'use strict';var emlformat=require(_0xe030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe030('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe030('0x2'));var moment=require(_0xe030('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe030('0x4'));var path=require(_0xe030('0x5'));var sox=require(_0xe030('0x6'));var csv=require(_0xe030('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe030('0x8'));var squel=require(_0xe030('0x9'));var crypto=require(_0xe030('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe030('0x7'));var querystring=require(_0xe030('0xb'));var Papa=require(_0xe030('0xc'));var Redis=require('ioredis');var authService=require(_0xe030('0xd'));var qs=require(_0xe030('0xe'));var as=require(_0xe030('0xf'));var hardwareService=require(_0xe030('0x10'));var logger=require('../../config/logger')(_0xe030('0x11'));var utils=require(_0xe030('0x12'));var config=require(_0xe030('0x13'));var licenseUtil=require(_0xe030('0x14'));var db=require(_0xe030('0x15'))['db'];var integrations=require(_0xe030('0x16'));function respondWithStatusCode(_0x1f920f,_0x410e5c){_0x410e5c=_0x410e5c||0xcc;return function(_0x5074be){if(_0x5074be){return _0x1f920f[_0xe030('0x17')](_0x410e5c);}return _0x1f920f['status'](_0x410e5c)[_0xe030('0x18')]();};}function respondWithResult(_0x2d0ee7,_0x3c0020){_0x3c0020=_0x3c0020||0xc8;return function(_0x5533a4){if(_0x5533a4){return _0x2d0ee7[_0xe030('0x19')](_0x3c0020)['json'](_0x5533a4);}};}function respondWithFilteredResult(_0x119eae,_0x1022e8){return function(_0x3eab01){if(_0x3eab01){var _0x89b8d1=typeof _0x1022e8[_0xe030('0x1a')]===_0xe030('0x1b')&&typeof _0x1022e8[_0xe030('0x1c')]==='undefined';var _0x528c57=_0x3eab01[_0xe030('0x1d')];var _0x7e0c19=_0x89b8d1?0x0:_0x1022e8[_0xe030('0x1a')];var _0x12637c=_0x89b8d1?_0x3eab01[_0xe030('0x1d')]:_0x1022e8['offset']+_0x1022e8['limit'];var _0x44faa5;if(_0x12637c>=_0x528c57){_0x12637c=_0x528c57;_0x44faa5=0xc8;}else{_0x44faa5=0xce;}_0x119eae[_0xe030('0x19')](_0x44faa5);return _0x119eae[_0xe030('0x1e')](_0xe030('0x1f'),_0x7e0c19+'-'+_0x12637c+'/'+_0x528c57)[_0xe030('0x20')](_0x3eab01);}return null;};}function patchUpdates(_0x5e39e8){return function(_0x36a426){try{jsonpatch[_0xe030('0x21')](_0x36a426,_0x5e39e8,!![]);}catch(_0x5b3752){return BPromise[_0xe030('0x22')](_0x5b3752);}return _0x36a426[_0xe030('0x23')]();};}function saveUpdates(_0x524d52,_0x1cbf29){return function(_0x57a745){if(_0x57a745){return _0x57a745[_0xe030('0x24')](_0x524d52)[_0xe030('0x25')](function(_0x501561){return _0x501561;});}return null;};}function removeEntity(_0x151e9b,_0x5321d8){return function(_0x4f37d0){if(_0x4f37d0){return _0x4f37d0['destroy']()[_0xe030('0x25')](function(){_0x151e9b[_0xe030('0x19')](0xcc)[_0xe030('0x18')]();});}};}function handleEntityNotFound(_0x53ad5d,_0x4fe389){return function(_0x95608){if(!_0x95608){_0x53ad5d[_0xe030('0x17')](0x194);}return _0x95608;};}function handleError(_0x475633,_0x5e29a7){_0x5e29a7=_0x5e29a7||0x1f4;return function(_0x2c0098){logger[_0xe030('0x26')](_0x2c0098['stack']);if(_0x2c0098[_0xe030('0x27')]){delete _0x2c0098[_0xe030('0x27')];}_0x475633[_0xe030('0x19')](_0x5e29a7)[_0xe030('0x28')](_0x2c0098);};}exports['index']=function(_0x16b8e4,_0x1b992d){var _0x5c4f66={},_0x42f2af={},_0x4eb670={'count':0x0,'rows':[]};var _0xab0bfc=_[_0xe030('0x29')](db['FreshsalesAccount'][_0xe030('0x2a')],function(_0x24fdce){return{'name':_0x24fdce[_0xe030('0x2b')],'type':_0x24fdce['type'][_0xe030('0x2c')]};});_0x42f2af[_0xe030('0x2d')]=_['map'](_0xab0bfc,_0xe030('0x27'));_0x42f2af['query']=_[_0xe030('0x2e')](_0x16b8e4[_0xe030('0x2f')]);_0x42f2af[_0xe030('0x30')]=_[_0xe030('0x31')](_0x42f2af[_0xe030('0x2d')],_0x42f2af[_0xe030('0x2f')]);_0x5c4f66[_0xe030('0x32')]=_[_0xe030('0x31')](_0x42f2af[_0xe030('0x2d')],qs[_0xe030('0x33')](_0x16b8e4[_0xe030('0x2f')][_0xe030('0x33')]));_0x5c4f66[_0xe030('0x32')]=_0x5c4f66[_0xe030('0x32')][_0xe030('0x34')]?_0x5c4f66[_0xe030('0x32')]:_0x42f2af['model'];if(!_0x16b8e4[_0xe030('0x2f')][_0xe030('0x35')](_0xe030('0x36'))){_0x5c4f66['limit']=qs[_0xe030('0x1c')](_0x16b8e4['query'][_0xe030('0x1c')]);_0x5c4f66[_0xe030('0x1a')]=qs[_0xe030('0x1a')](_0x16b8e4[_0xe030('0x2f')]['offset']);}_0x5c4f66['order']=qs['sort'](_0x16b8e4[_0xe030('0x2f')][_0xe030('0x37')]);_0x5c4f66['where']=qs[_0xe030('0x30')](_[_0xe030('0x38')](_0x16b8e4[_0xe030('0x2f')],_0x42f2af[_0xe030('0x30')]),_0xab0bfc);if(_0x16b8e4[_0xe030('0x2f')]['filter']){_0x5c4f66['where']=_[_0xe030('0x39')](_0x5c4f66['where'],{'$or':_[_0xe030('0x29')](_0xab0bfc,function(_0x27ae5d){if(_0x27ae5d[_0xe030('0x3a')]!==_0xe030('0x3b')){var _0x130c65={};_0x130c65[_0x27ae5d['name']]={'$like':'%'+_0x16b8e4[_0xe030('0x2f')][_0xe030('0x3c')]+'%'};return _0x130c65;}})});}_0x5c4f66=_['merge']({},_0x5c4f66,_0x16b8e4[_0xe030('0x3d')]);var _0x24ffd7={'where':_0x5c4f66[_0xe030('0x3e')]};return db[_0xe030('0x3f')][_0xe030('0x1d')](_0x24ffd7)[_0xe030('0x25')](function(_0x39a991){_0x4eb670[_0xe030('0x1d')]=_0x39a991;if(_0x16b8e4[_0xe030('0x2f')]['includeAll']){_0x5c4f66[_0xe030('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xe030('0x41')](_0x5c4f66);})[_0xe030('0x25')](function(_0xb0f220){_0x4eb670[_0xe030('0x42')]=_0xb0f220;return _0x4eb670;})[_0xe030('0x25')](respondWithFilteredResult(_0x1b992d,_0x5c4f66))[_0xe030('0x43')](handleError(_0x1b992d,null));};exports['show']=function(_0x460be8,_0x935552){var _0x4d8d62={'raw':![],'where':{'id':_0x460be8[_0xe030('0x44')]['id']}},_0xd8471a={};_0xd8471a['model']=_[_0xe030('0x2e')](db['FreshsalesAccount']['rawAttributes']);_0xd8471a[_0xe030('0x2f')]=_[_0xe030('0x2e')](_0x460be8['query']);_0xd8471a['filters']=_[_0xe030('0x31')](_0xd8471a[_0xe030('0x2d')],_0xd8471a['query']);_0x4d8d62[_0xe030('0x32')]=_['intersection'](_0xd8471a[_0xe030('0x2d')],qs[_0xe030('0x33')](_0x460be8['query'][_0xe030('0x33')]));_0x4d8d62[_0xe030('0x32')]=_0x4d8d62[_0xe030('0x32')][_0xe030('0x34')]?_0x4d8d62['attributes']:_0xd8471a[_0xe030('0x2d')];if(_0x460be8[_0xe030('0x2f')]['includeAll']){_0x4d8d62[_0xe030('0x40')]=[{'all':!![]}];}_0x4d8d62=_[_0xe030('0x39')]({},_0x4d8d62,_0x460be8[_0xe030('0x3d')]);return db[_0xe030('0x3f')][_0xe030('0x45')](_0x4d8d62)[_0xe030('0x25')](handleEntityNotFound(_0x935552,null))['then'](respondWithResult(_0x935552,null))[_0xe030('0x43')](handleError(_0x935552,null));};exports[_0xe030('0x46')]=function(_0x3dd74b,_0x85e64f){return db[_0xe030('0x3f')]['create'](_0x3dd74b['body'],{})[_0xe030('0x25')](respondWithResult(_0x85e64f,0xc9))[_0xe030('0x43')](handleError(_0x85e64f,null));};exports[_0xe030('0x24')]=function(_0x597b63,_0x14b493){if(_0x597b63['body']['id']){delete _0x597b63[_0xe030('0x47')]['id'];}return db[_0xe030('0x3f')][_0xe030('0x45')]({'where':{'id':_0x597b63[_0xe030('0x44')]['id']}})['then'](handleEntityNotFound(_0x14b493,null))[_0xe030('0x25')](saveUpdates(_0x597b63[_0xe030('0x47')],null))[_0xe030('0x25')](respondWithResult(_0x14b493,null))[_0xe030('0x43')](handleError(_0x14b493,null));};exports[_0xe030('0x48')]=function(_0x41e12a,_0x53cf2c){return db['FreshsalesAccount'][_0xe030('0x45')]({'where':{'id':_0x41e12a['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x53cf2c,null))[_0xe030('0x25')](removeEntity(_0x53cf2c,null))[_0xe030('0x43')](handleError(_0x53cf2c,null));};exports[_0xe030('0x49')]=function(_0x3a3a76,_0x1aa458,_0x21eeb7){var _0x12d0a1={};var _0x218524={};var _0x5b4c9f;var _0x7645e2;return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x3a3a76['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x1aa458,null))[_0xe030('0x25')](function(_0x3e1ad8){if(_0x3e1ad8){_0x5b4c9f=_0x3e1ad8;_0x218524[_0xe030('0x2d')]=_[_0xe030('0x2e')](db['FreshsalesConfiguration']['rawAttributes']);_0x218524[_0xe030('0x2f')]=_[_0xe030('0x2e')](_0x3a3a76[_0xe030('0x2f')]);_0x218524[_0xe030('0x30')]=_[_0xe030('0x31')](_0x218524[_0xe030('0x2d')],_0x218524['query']);_0x12d0a1[_0xe030('0x32')]=_['intersection'](_0x218524[_0xe030('0x2d')],qs['fields'](_0x3a3a76[_0xe030('0x2f')]['fields']));_0x12d0a1[_0xe030('0x32')]=_0x12d0a1['attributes'][_0xe030('0x34')]?_0x12d0a1[_0xe030('0x32')]:_0x218524[_0xe030('0x2d')];_0x12d0a1[_0xe030('0x4b')]=qs['sort'](_0x3a3a76[_0xe030('0x2f')][_0xe030('0x37')]);_0x12d0a1[_0xe030('0x3e')]=qs[_0xe030('0x30')](_[_0xe030('0x38')](_0x3a3a76['query'],_0x218524[_0xe030('0x30')]));if(_0x3a3a76[_0xe030('0x2f')][_0xe030('0x3c')]){_0x12d0a1[_0xe030('0x3e')]=_[_0xe030('0x39')](_0x12d0a1[_0xe030('0x3e')],{'$or':_[_0xe030('0x29')](_0x12d0a1['attributes'],function(_0x292bf6){var _0x465b2c={};_0x465b2c[_0x292bf6]={'$like':'%'+_0x3a3a76[_0xe030('0x2f')]['filter']+'%'};return _0x465b2c;})});}_0x12d0a1=_['merge']({},_0x12d0a1,_0x3a3a76[_0xe030('0x3d')]);return _0x5b4c9f['getConfigurations'](_0x12d0a1);}})['then'](function(_0x5ce385){if(_0x5ce385){_0x7645e2=_0x5ce385[_0xe030('0x34')];if(!_0x3a3a76[_0xe030('0x2f')][_0xe030('0x35')](_0xe030('0x36'))){_0x12d0a1[_0xe030('0x1c')]=qs[_0xe030('0x1c')](_0x3a3a76['query'][_0xe030('0x1c')]);_0x12d0a1['offset']=qs[_0xe030('0x1a')](_0x3a3a76[_0xe030('0x2f')][_0xe030('0x1a')]);}return _0x5b4c9f[_0xe030('0x49')](_0x12d0a1);}})[_0xe030('0x25')](function(_0x4c7d66){if(_0x4c7d66){return _0x4c7d66?{'count':_0x7645e2,'rows':_0x4c7d66}:null;}})['then'](respondWithResult(_0x1aa458,null))['catch'](handleError(_0x1aa458,null));};exports['addConfiguration']=function(_0x2273b8,_0x529048,_0x52e0d4){if(_0x2273b8[_0xe030('0x47')]['id']){delete _0x2273b8[_0xe030('0x47')]['id'];}return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x2273b8['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x529048,null))['then'](function(_0x3c77af){if(_0x3c77af){_0x2273b8[_0xe030('0x47')][_0xe030('0x4c')]=_0x3c77af['id'];_0x2273b8[_0xe030('0x47')][_0xe030('0x4d')]=integrations[_0xe030('0x4e')](_0x2273b8['body']['channel'],_0x2273b8[_0xe030('0x47')][_0xe030('0x3a')]);_0x2273b8[_0xe030('0x47')][_0xe030('0x4f')]=integrations['getDescriptions'](_0x2273b8[_0xe030('0x47')][_0xe030('0x50')],_0x2273b8[_0xe030('0x47')][_0xe030('0x3a')]);return db['FreshsalesConfiguration'][_0xe030('0x46')](_0x2273b8[_0xe030('0x47')],{'include':[{'model':db[_0xe030('0x51')],'as':'Subjects'},{'model':db[_0xe030('0x51')],'as':_0xe030('0x4f')}]});}return null;})['then'](respondWithResult(_0x529048,null))['catch'](handleError(_0x529048,null));};exports[_0xe030('0x52')]=function(_0x584be9,_0x4b9641,_0x5254cd){var _0xf31be2='';var _0x4a191d='';return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x584be9['params']['id']},'attributes':['id',_0xe030('0x53'),_0xe030('0x54'),_0xe030('0x55')]})['then'](handleEntityNotFound(_0x4b9641,null))[_0xe030('0x25')](function(_0x1918a8){if(_0x1918a8){_0x4a191d=_0x1918a8[_0xe030('0x53')];_0xf31be2=_0x1918a8[_0xe030('0x54')];var _0x33218a=_0x1918a8[_0xe030('0x54')][_0xe030('0x56')](-0x1);if(_0x33218a==='/'){_0xf31be2=_0xf31be2[_0xe030('0x57')](0x0,_0xf31be2[_0xe030('0x58')](_0x33218a));}return rp({'method':'GET','uri':util[_0xe030('0x59')](_0xe030('0x5a'),_0xf31be2,_0xe030('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x1918a8[_0xe030('0x55')]},'json':!![]});}})[_0xe030('0x25')](function(_0x47fc74){if(_0x47fc74){var _0x52377e=_0x47fc74[_0xe030('0x5c')];var _0x5d622d=![];var _0x145923=null;for(_0x145923=0x0;_0x145923<_0x52377e[_0xe030('0x34')];_0x145923++){if(_0x52377e[_0x145923]['email']===_0x4a191d){_0x5d622d=!![];}}if(_0x5d622d){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xe030('0x25')](respondWithResult(_0x4b9641,null))[_0xe030('0x43')](function(_0x3bb8ed){var _0x25a087=_0x584be9[_0xe030('0x2f')][_0xe030('0x5d')]?0x1f4:_0x3bb8ed[_0xe030('0x5e')]||0x1f4;logger[_0xe030('0x26')](_0xe030('0x5f'),_0xe030('0x52'),_0x25a087,JSON[_0xe030('0x60')](_0x3bb8ed));delete _0x3bb8ed[_0xe030('0x27')];if(_0x25a087===0x191){_0x25a087=0x190;}_0x4b9641['status'](_0x25a087)['send'](_0x584be9[_0xe030('0x2f')][_0xe030('0x5d')]?{'message':_0xe030('0x61'),'statusCode':_0x3bb8ed['statusCode']}:_0x3bb8ed);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 7322834..2d59e5a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api'];(function(_0x5208b2,_0x1eb1c4){var _0x52b0a0=function(_0x211d13){while(--_0x211d13){_0x5208b2['push'](_0x5208b2['shift']());}};_0x52b0a0(++_0x1eb1c4);}(_0x5fdc,0x127));var _0xc5fd=function(_0x155dc4,_0x5b6bd1){_0x155dc4=_0x155dc4-0x0;var _0x22f064=_0x5fdc[_0x155dc4];return _0x22f064;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));var integrations=require(_0xc5fd('0xb'));module[_0xc5fd('0xc')]=function(_0x216902,_0x15ffe7){return _0x216902['define']('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','bluebird'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x5d58,0x187));var _0x85d5=function(_0x16f433,_0x3bd258){_0x16f433=_0x16f433-0x0;var _0x42f448=_0x5d58[_0x16f433];return _0x42f448;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index b02446b..3596dcc 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x179cf3,_0x16f529){var _0x599ee3=function(_0x6fdce7){while(--_0x6fdce7){_0x179cf3['push'](_0x179cf3['shift']());}};_0x599ee3(++_0x16f529);}(_0xafb9,0x68));var _0x9afb=function(_0xf64efd,_0x17bd4b){_0xf64efd=_0xf64efd-0x0;var _0x5ac355=_0xafb9[_0xf64efd];return _0x5ac355;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});}; \ No newline at end of file +var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','raw','ShowFreshsalesAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')]({'raw':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x531f75[_0x2227('0x1b')]?_0x531f75['options'][_0x2227('0x1c')]||null:null,'attributes':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'limit':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1e')]||null:null,'include':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1f')]?_[_0x2227('0x20')](_0x531f75['options'][_0x2227('0x1f')],function(_0x42d500){return{'model':db[_0x42d500['model']],'as':_0x42d500['as'],'attributes':_0x42d500[_0x2227('0x1d')],'include':_0x42d500[_0x2227('0x1f')]?_['map'](_0x42d500['include'],function(_0x17c7a4){return{'model':db[_0x17c7a4[_0x2227('0x21')]],'as':_0x17c7a4['as'],'attributes':_0x17c7a4[_0x2227('0x1d')],'include':_0x17c7a4[_0x2227('0x1f')]?_['map'](_0x17c7a4[_0x2227('0x1f')],function(_0x301304){return{'model':db[_0x301304[_0x2227('0x21')]],'as':_0x301304['as'],'attributes':_0x301304[_0x2227('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204def){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x204def));_0x620012(_0x204def);})['catch'](function(_0x5d1d56){logger[_0x2227('0x12')]('GetFreshsalesAccount',_0x5d1d56[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0x5d1d56['message']));});});};exports['ShowFreshsalesAccount']=function(_0x1f1ba7){var _0x1818ba=this;return new Promise(function(_0x21838a,_0x4cc1e1){return db[_0x2227('0x19')]['find']({'raw':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x22')]===undefined?!![]:![]:!![],'where':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1c')]||null:null,'attributes':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'include':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')]['include']?_[_0x2227('0x20')](_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1f')],function(_0x6cd5d7){return{'model':db[_0x6cd5d7['model']],'as':_0x6cd5d7['as'],'attributes':_0x6cd5d7[_0x2227('0x1d')],'include':_0x6cd5d7[_0x2227('0x1f')]?_[_0x2227('0x20')](_0x6cd5d7[_0x2227('0x1f')],function(_0x5186a6){return{'model':db[_0x5186a6[_0x2227('0x21')]],'as':_0x5186a6['as'],'attributes':_0x5186a6[_0x2227('0x1d')],'include':_0x5186a6[_0x2227('0x1f')]?_['map'](_0x5186a6['include'],function(_0x35d9f1){return{'model':db[_0x35d9f1[_0x2227('0x21')]],'as':_0x35d9f1['as'],'attributes':_0x35d9f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2227('0xc')](function(_0x9a8cc3){logger['info'](_0x2227('0x23'),_0x1f1ba7);logger['debug'](_0x2227('0x23'),_0x1f1ba7,JSON[_0x2227('0x11')](_0x9a8cc3));_0x21838a(_0x9a8cc3);})[_0x2227('0x17')](function(_0x36db00){logger['error'](_0x2227('0x23'),_0x36db00['message'],_0x1f1ba7);_0x4cc1e1(_0x1818ba[_0x2227('0x12')](0x1f4,_0x36db00[_0x2227('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index cef7132..0b0ef83 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbd=['index','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','update','delete','multer','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x1e0245,_0x154010){var _0x53bea7=function(_0x5d6b09){while(--_0x5d6b09){_0x1e0245['push'](_0x1e0245['shift']());}};_0x53bea7(++_0x154010);}(_0x7fbd,0x176));var _0xd7fb=function(_0x533ef3,_0x42fc7c){_0x533ef3=_0x533ef3-0x0;var _0x25ceac=_0x7fbd[_0x533ef3];return _0x25ceac;};'use strict';var multer=require(_0xd7fb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd7fb('0x1'));var router=express[_0xd7fb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd7fb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd7fb('0x4'));var controller=require(_0xd7fb('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd7fb('0x6')]);router[_0xd7fb('0x7')](_0xd7fb('0x8'),auth[_0xd7fb('0x9')](),controller[_0xd7fb('0xa')]);router[_0xd7fb('0x7')](_0xd7fb('0xb'),auth[_0xd7fb('0x9')](),controller[_0xd7fb('0xc')]);router['get']('/:id/descriptions',auth[_0xd7fb('0x9')](),controller[_0xd7fb('0xd')]);router[_0xd7fb('0x7')](_0xd7fb('0xe'),auth[_0xd7fb('0x9')](),controller[_0xd7fb('0xf')]);router[_0xd7fb('0x10')]('/',auth[_0xd7fb('0x9')](),controller[_0xd7fb('0x11')]);router['put'](_0xd7fb('0x8'),auth[_0xd7fb('0x9')](),controller[_0xd7fb('0x12')]);router[_0xd7fb('0x13')](_0xd7fb('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x11d1=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','show','get','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','/:id','update','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0xc5ea2d,_0x33b6d4){var _0x3e90a1=function(_0x5cca30){while(--_0x5cca30){_0xc5ea2d['push'](_0xc5ea2d['shift']());}};_0x3e90a1(++_0x33b6d4);}(_0x11d1,0x160));var _0x111d=function(_0x240c77,_0x2dcc04){_0x240c77=_0x240c77-0x0;var _0x37afd1=_0x11d1[_0x240c77];return _0x37afd1;};'use strict';var multer=require(_0x111d('0x0'));var util=require(_0x111d('0x1'));var path=require(_0x111d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x111d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x111d('0x4'));var interaction=require(_0x111d('0x5'));var config=require(_0x111d('0x6'));var controller=require(_0x111d('0x7'));router['get']('/',auth[_0x111d('0x8')](),controller['index']);router['get']('/:id',auth[_0x111d('0x8')](),controller[_0x111d('0x9')]);router[_0x111d('0xa')](_0x111d('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x111d('0xa')](_0x111d('0xc'),auth['isAuthenticated'](),controller[_0x111d('0xd')]);router['get'](_0x111d('0xe'),auth[_0x111d('0x8')](),controller[_0x111d('0xf')]);router['post']('/',auth[_0x111d('0x8')](),controller[_0x111d('0x10')]);router[_0x111d('0x11')](_0x111d('0x12'),auth[_0x111d('0x8')](),controller[_0x111d('0x13')]);router['delete'](_0x111d('0x12'),auth[_0x111d('0x8')](),controller[_0x111d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4a2cc7f..5bcaa69 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd4b=['exports','STRING','sequelize'];(function(_0x256c0d,_0x52effd){var _0x11d449=function(_0x138672){while(--_0x138672){_0x256c0d['push'](_0x256c0d['shift']());}};_0x11d449(++_0x52effd);}(_0xdd4b,0x11c));var _0xbdd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd4b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbdd4('0x0'));module[_0xbdd4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbdd4('0x2')]}}; \ No newline at end of file +var _0x6753=['exports','STRING','sequelize'];(function(_0x3c9384,_0x3b4334){var _0x331d8b=function(_0x3d57af){while(--_0x3d57af){_0x3c9384['push'](_0x3c9384['shift']());}};_0x331d8b(++_0x3b4334);}(_0x6753,0x182));var _0x3675=function(_0x3d549a,_0x49ea8d){_0x3d549a=_0x3d549a-0x0;var _0x1dc73e=_0x6753[_0x3d549a];return _0x1dc73e;};'use strict';var Sequelize=require(_0x3675('0x0'));module[_0x3675('0x1')]={'name':{'type':Sequelize[_0x3675('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 60e343f..f47695e 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed66=['findAll','rows','catch','params','keys','includeAll','body','update','find','getSubjects','nolimit','getDescriptions','FreshsalesField','getFields','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','reject','save','destroy','then','end','stack','name','send','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','FreshsalesConfiguration','include'];(function(_0x1d3b63,_0x2c5e25){var _0x54ed09=function(_0x6cd72e){while(--_0x6cd72e){_0x1d3b63['push'](_0x1d3b63['shift']());}};_0x54ed09(++_0x2c5e25);}(_0xed66,0xff));var _0x6ed6=function(_0x5641d9,_0x1de53b){_0x5641d9=_0x5641d9-0x0;var _0x1b1f89=_0xed66[_0x5641d9];return _0x1b1f89;};'use strict';var emlformat=require(_0x6ed6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ed6('0x1'));var rp=require(_0x6ed6('0x2'));var moment=require(_0x6ed6('0x3'));var BPromise=require(_0x6ed6('0x4'));var Mustache=require(_0x6ed6('0x5'));var util=require(_0x6ed6('0x6'));var path=require(_0x6ed6('0x7'));var sox=require(_0x6ed6('0x8'));var csv=require(_0x6ed6('0x9'));var ejs=require(_0x6ed6('0xa'));var fs=require('fs');var fs_extra=require(_0x6ed6('0xb'));var _=require(_0x6ed6('0xc'));var squel=require(_0x6ed6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ed6('0x9'));var querystring=require(_0x6ed6('0xe'));var Papa=require(_0x6ed6('0xf'));var Redis=require(_0x6ed6('0x10'));var authService=require(_0x6ed6('0x11'));var qs=require(_0x6ed6('0x12'));var as=require(_0x6ed6('0x13'));var hardwareService=require(_0x6ed6('0x14'));var logger=require('../../config/logger')(_0x6ed6('0x15'));var utils=require(_0x6ed6('0x16'));var config=require(_0x6ed6('0x17'));var licenseUtil=require(_0x6ed6('0x18'));var db=require(_0x6ed6('0x19'))['db'];function respondWithStatusCode(_0x4d5661,_0x17472d){_0x17472d=_0x17472d||0xcc;return function(_0x1b77c1){if(_0x1b77c1){return _0x4d5661[_0x6ed6('0x1a')](_0x17472d);}return _0x4d5661['status'](_0x17472d)['end']();};}function respondWithResult(_0x6accee,_0x2ab8ed){_0x2ab8ed=_0x2ab8ed||0xc8;return function(_0x1cb6f1){if(_0x1cb6f1){return _0x6accee['status'](_0x2ab8ed)['json'](_0x1cb6f1);}};}function respondWithFilteredResult(_0x513ed7,_0x2b8e29){return function(_0x2efd39){if(_0x2efd39){var _0x352009=typeof _0x2b8e29[_0x6ed6('0x1b')]===_0x6ed6('0x1c')&&typeof _0x2b8e29[_0x6ed6('0x1d')]===_0x6ed6('0x1c');var _0x3c3ba7=_0x2efd39[_0x6ed6('0x1e')];var _0x3a24f=_0x352009?0x0:_0x2b8e29[_0x6ed6('0x1b')];var _0x591c78=_0x352009?_0x2efd39[_0x6ed6('0x1e')]:_0x2b8e29[_0x6ed6('0x1b')]+_0x2b8e29[_0x6ed6('0x1d')];var _0x400554;if(_0x591c78>=_0x3c3ba7){_0x591c78=_0x3c3ba7;_0x400554=0xc8;}else{_0x400554=0xce;}_0x513ed7[_0x6ed6('0x1f')](_0x400554);return _0x513ed7[_0x6ed6('0x20')](_0x6ed6('0x21'),_0x3a24f+'-'+_0x591c78+'/'+_0x3c3ba7)[_0x6ed6('0x22')](_0x2efd39);}return null;};}function patchUpdates(_0x1a2b15){return function(_0x1337b1){try{jsonpatch['apply'](_0x1337b1,_0x1a2b15,!![]);}catch(_0x587212){return BPromise[_0x6ed6('0x23')](_0x587212);}return _0x1337b1[_0x6ed6('0x24')]();};}function saveUpdates(_0x4fc6d6,_0x3eac19){return function(_0x5799ef){if(_0x5799ef){return _0x5799ef['update'](_0x4fc6d6)['then'](function(_0x2f759d){return _0x2f759d;});}return null;};}function removeEntity(_0x5cf71a,_0x195eac){return function(_0x237e58){if(_0x237e58){return _0x237e58[_0x6ed6('0x25')]()[_0x6ed6('0x26')](function(){_0x5cf71a['status'](0xcc)[_0x6ed6('0x27')]();});}};}function handleEntityNotFound(_0xa489db,_0x251c05){return function(_0x13d95){if(!_0x13d95){_0xa489db[_0x6ed6('0x1a')](0x194);}return _0x13d95;};}function handleError(_0x192e42,_0x9c90e7){_0x9c90e7=_0x9c90e7||0x1f4;return function(_0x3717f0){logger['error'](_0x3717f0[_0x6ed6('0x28')]);if(_0x3717f0[_0x6ed6('0x29')]){delete _0x3717f0[_0x6ed6('0x29')];}_0x192e42[_0x6ed6('0x1f')](_0x9c90e7)[_0x6ed6('0x2a')](_0x3717f0);};}exports[_0x6ed6('0x2b')]=function(_0x542f64,_0x28a50e){var _0x532f7f={},_0x19f862={},_0x2ca741={'count':0x0,'rows':[]};var _0x14366d=_[_0x6ed6('0x2c')](db['FreshsalesConfiguration'][_0x6ed6('0x2d')],function(_0x302471){return{'name':_0x302471['fieldName'],'type':_0x302471[_0x6ed6('0x2e')]['key']};});_0x19f862[_0x6ed6('0x2f')]=_['map'](_0x14366d,_0x6ed6('0x29'));_0x19f862['query']=_['keys'](_0x542f64[_0x6ed6('0x30')]);_0x19f862['filters']=_[_0x6ed6('0x31')](_0x19f862['model'],_0x19f862[_0x6ed6('0x30')]);_0x532f7f[_0x6ed6('0x32')]=_[_0x6ed6('0x31')](_0x19f862['model'],qs[_0x6ed6('0x33')](_0x542f64[_0x6ed6('0x30')]['fields']));_0x532f7f[_0x6ed6('0x32')]=_0x532f7f[_0x6ed6('0x32')][_0x6ed6('0x34')]?_0x532f7f[_0x6ed6('0x32')]:_0x19f862['model'];if(!_0x542f64[_0x6ed6('0x30')][_0x6ed6('0x35')]('nolimit')){_0x532f7f[_0x6ed6('0x1d')]=qs['limit'](_0x542f64[_0x6ed6('0x30')][_0x6ed6('0x1d')]);_0x532f7f[_0x6ed6('0x1b')]=qs[_0x6ed6('0x1b')](_0x542f64[_0x6ed6('0x30')][_0x6ed6('0x1b')]);}_0x532f7f[_0x6ed6('0x36')]=qs[_0x6ed6('0x37')](_0x542f64[_0x6ed6('0x30')][_0x6ed6('0x37')]);_0x532f7f[_0x6ed6('0x38')]=qs[_0x6ed6('0x39')](_[_0x6ed6('0x3a')](_0x542f64[_0x6ed6('0x30')],_0x19f862[_0x6ed6('0x39')]),_0x14366d);if(_0x542f64['query'][_0x6ed6('0x3b')]){_0x532f7f['where']=_['merge'](_0x532f7f['where'],{'$or':_[_0x6ed6('0x2c')](_0x14366d,function(_0x4fee9b){if(_0x4fee9b[_0x6ed6('0x2e')]!==_0x6ed6('0x3c')){var _0x20bc46={};_0x20bc46[_0x4fee9b[_0x6ed6('0x29')]]={'$like':'%'+_0x542f64[_0x6ed6('0x30')][_0x6ed6('0x3b')]+'%'};return _0x20bc46;}})});}_0x532f7f=_[_0x6ed6('0x3d')]({},_0x532f7f,_0x542f64[_0x6ed6('0x3e')]);var _0x275d44={'where':_0x532f7f[_0x6ed6('0x38')]};return db[_0x6ed6('0x3f')]['count'](_0x275d44)[_0x6ed6('0x26')](function(_0x207ed2){_0x2ca741['count']=_0x207ed2;if(_0x542f64[_0x6ed6('0x30')]['includeAll']){_0x532f7f[_0x6ed6('0x40')]=[{'all':!![]}];}return db[_0x6ed6('0x3f')][_0x6ed6('0x41')](_0x532f7f);})[_0x6ed6('0x26')](function(_0x287853){_0x2ca741[_0x6ed6('0x42')]=_0x287853;return _0x2ca741;})[_0x6ed6('0x26')](respondWithFilteredResult(_0x28a50e,_0x532f7f))[_0x6ed6('0x43')](handleError(_0x28a50e,null));};exports['show']=function(_0x383d9c,_0x407246){var _0x10bd80={'raw':![],'where':{'id':_0x383d9c[_0x6ed6('0x44')]['id']}},_0x1a8882={};_0x1a8882[_0x6ed6('0x2f')]=_[_0x6ed6('0x45')](db[_0x6ed6('0x3f')]['rawAttributes']);_0x1a8882[_0x6ed6('0x30')]=_['keys'](_0x383d9c[_0x6ed6('0x30')]);_0x1a8882[_0x6ed6('0x39')]=_[_0x6ed6('0x31')](_0x1a8882['model'],_0x1a8882[_0x6ed6('0x30')]);_0x10bd80[_0x6ed6('0x32')]=_['intersection'](_0x1a8882[_0x6ed6('0x2f')],qs[_0x6ed6('0x33')](_0x383d9c[_0x6ed6('0x30')][_0x6ed6('0x33')]));_0x10bd80[_0x6ed6('0x32')]=_0x10bd80[_0x6ed6('0x32')][_0x6ed6('0x34')]?_0x10bd80[_0x6ed6('0x32')]:_0x1a8882['model'];if(_0x383d9c[_0x6ed6('0x30')][_0x6ed6('0x46')]){_0x10bd80[_0x6ed6('0x40')]=[{'all':!![]}];}_0x10bd80=_[_0x6ed6('0x3d')]({},_0x10bd80,_0x383d9c[_0x6ed6('0x3e')]);return db[_0x6ed6('0x3f')]['find'](_0x10bd80)[_0x6ed6('0x26')](handleEntityNotFound(_0x407246,null))[_0x6ed6('0x26')](respondWithResult(_0x407246,null))[_0x6ed6('0x43')](handleError(_0x407246,null));};exports['create']=function(_0x541e18,_0xe5bb23){return db[_0x6ed6('0x3f')]['create'](_0x541e18[_0x6ed6('0x47')],{})[_0x6ed6('0x26')](respondWithResult(_0xe5bb23,0xc9))[_0x6ed6('0x43')](handleError(_0xe5bb23,null));};exports[_0x6ed6('0x48')]=function(_0x16251e,_0x1612aa){if(_0x16251e['body']['id']){delete _0x16251e[_0x6ed6('0x47')]['id'];}return db['FreshsalesConfiguration'][_0x6ed6('0x49')]({'where':{'id':_0x16251e[_0x6ed6('0x44')]['id']}})['then'](handleEntityNotFound(_0x1612aa,null))['then'](saveUpdates(_0x16251e[_0x6ed6('0x47')],null))['then'](respondWithResult(_0x1612aa,null))[_0x6ed6('0x43')](handleError(_0x1612aa,null));};exports[_0x6ed6('0x25')]=function(_0x18ad49,_0x2cd336){return db[_0x6ed6('0x3f')][_0x6ed6('0x49')]({'where':{'id':_0x18ad49[_0x6ed6('0x44')]['id']}})[_0x6ed6('0x26')](handleEntityNotFound(_0x2cd336,null))[_0x6ed6('0x26')](removeEntity(_0x2cd336,null))[_0x6ed6('0x43')](handleError(_0x2cd336,null));};exports[_0x6ed6('0x4a')]=function(_0x35d2eb,_0x2e74f9,_0xb5895){var _0xea34dd={};var _0x213b5e={};var _0x567f39;var _0x298bdf;return db[_0x6ed6('0x3f')]['findOne']({'where':{'id':_0x35d2eb[_0x6ed6('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e74f9,null))[_0x6ed6('0x26')](function(_0x15026f){if(_0x15026f){_0x567f39=_0x15026f;_0x213b5e[_0x6ed6('0x2f')]=_[_0x6ed6('0x45')](db['FreshsalesField'][_0x6ed6('0x2d')]);_0x213b5e[_0x6ed6('0x30')]=_[_0x6ed6('0x45')](_0x35d2eb['query']);_0x213b5e[_0x6ed6('0x39')]=_[_0x6ed6('0x31')](_0x213b5e[_0x6ed6('0x2f')],_0x213b5e[_0x6ed6('0x30')]);_0xea34dd[_0x6ed6('0x32')]=_[_0x6ed6('0x31')](_0x213b5e[_0x6ed6('0x2f')],qs[_0x6ed6('0x33')](_0x35d2eb[_0x6ed6('0x30')][_0x6ed6('0x33')]));_0xea34dd[_0x6ed6('0x32')]=_0xea34dd[_0x6ed6('0x32')][_0x6ed6('0x34')]?_0xea34dd[_0x6ed6('0x32')]:_0x213b5e[_0x6ed6('0x2f')];_0xea34dd[_0x6ed6('0x36')]=qs[_0x6ed6('0x37')](_0x35d2eb['query'][_0x6ed6('0x37')]);_0xea34dd[_0x6ed6('0x38')]=qs[_0x6ed6('0x39')](_[_0x6ed6('0x3a')](_0x35d2eb[_0x6ed6('0x30')],_0x213b5e['filters']));if(_0x35d2eb[_0x6ed6('0x30')][_0x6ed6('0x3b')]){_0xea34dd[_0x6ed6('0x38')]=_[_0x6ed6('0x3d')](_0xea34dd[_0x6ed6('0x38')],{'$or':_[_0x6ed6('0x2c')](_0xea34dd[_0x6ed6('0x32')],function(_0x594538){var _0x67d18c={};_0x67d18c[_0x594538]={'$like':'%'+_0x35d2eb[_0x6ed6('0x30')]['filter']+'%'};return _0x67d18c;})});}_0xea34dd=_[_0x6ed6('0x3d')]({},_0xea34dd,_0x35d2eb['options']);return _0x567f39[_0x6ed6('0x4a')](_0xea34dd);}})[_0x6ed6('0x26')](function(_0x321cd4){if(_0x321cd4){_0x298bdf=_0x321cd4[_0x6ed6('0x34')];if(!_0x35d2eb[_0x6ed6('0x30')][_0x6ed6('0x35')](_0x6ed6('0x4b'))){_0xea34dd[_0x6ed6('0x1d')]=qs[_0x6ed6('0x1d')](_0x35d2eb['query'][_0x6ed6('0x1d')]);_0xea34dd['offset']=qs['offset'](_0x35d2eb[_0x6ed6('0x30')][_0x6ed6('0x1b')]);}return _0x567f39[_0x6ed6('0x4a')](_0xea34dd);}})[_0x6ed6('0x26')](function(_0x1305a9){if(_0x1305a9){return _0x1305a9?{'count':_0x298bdf,'rows':_0x1305a9}:null;}})[_0x6ed6('0x26')](respondWithResult(_0x2e74f9,null))[_0x6ed6('0x43')](handleError(_0x2e74f9,null));};exports[_0x6ed6('0x4c')]=function(_0x18558f,_0x88329e,_0x365e51){var _0x431e6a={};var _0x1c7c96={};var _0x2552af;var _0x49dd58;return db[_0x6ed6('0x3f')]['findOne']({'where':{'id':_0x18558f['params']['id']}})[_0x6ed6('0x26')](handleEntityNotFound(_0x88329e,null))[_0x6ed6('0x26')](function(_0x1b5fc8){if(_0x1b5fc8){_0x2552af=_0x1b5fc8;_0x1c7c96[_0x6ed6('0x2f')]=_[_0x6ed6('0x45')](db[_0x6ed6('0x4d')][_0x6ed6('0x2d')]);_0x1c7c96['query']=_['keys'](_0x18558f[_0x6ed6('0x30')]);_0x1c7c96['filters']=_[_0x6ed6('0x31')](_0x1c7c96['model'],_0x1c7c96['query']);_0x431e6a[_0x6ed6('0x32')]=_[_0x6ed6('0x31')](_0x1c7c96[_0x6ed6('0x2f')],qs[_0x6ed6('0x33')](_0x18558f['query'][_0x6ed6('0x33')]));_0x431e6a['attributes']=_0x431e6a[_0x6ed6('0x32')][_0x6ed6('0x34')]?_0x431e6a[_0x6ed6('0x32')]:_0x1c7c96[_0x6ed6('0x2f')];_0x431e6a['order']=qs[_0x6ed6('0x37')](_0x18558f[_0x6ed6('0x30')][_0x6ed6('0x37')]);_0x431e6a[_0x6ed6('0x38')]=qs['filters'](_[_0x6ed6('0x3a')](_0x18558f[_0x6ed6('0x30')],_0x1c7c96[_0x6ed6('0x39')]));if(_0x18558f[_0x6ed6('0x30')][_0x6ed6('0x3b')]){_0x431e6a[_0x6ed6('0x38')]=_[_0x6ed6('0x3d')](_0x431e6a['where'],{'$or':_[_0x6ed6('0x2c')](_0x431e6a['attributes'],function(_0x426e9d){var _0x4451b2={};_0x4451b2[_0x426e9d]={'$like':'%'+_0x18558f['query'][_0x6ed6('0x3b')]+'%'};return _0x4451b2;})});}_0x431e6a=_[_0x6ed6('0x3d')]({},_0x431e6a,_0x18558f[_0x6ed6('0x3e')]);return _0x2552af[_0x6ed6('0x4c')](_0x431e6a);}})['then'](function(_0x579c42){if(_0x579c42){_0x49dd58=_0x579c42[_0x6ed6('0x34')];if(!_0x18558f[_0x6ed6('0x30')][_0x6ed6('0x35')]('nolimit')){_0x431e6a['limit']=qs[_0x6ed6('0x1d')](_0x18558f[_0x6ed6('0x30')][_0x6ed6('0x1d')]);_0x431e6a['offset']=qs[_0x6ed6('0x1b')](_0x18558f['query'][_0x6ed6('0x1b')]);}return _0x2552af['getDescriptions'](_0x431e6a);}})['then'](function(_0x584157){if(_0x584157){return _0x584157?{'count':_0x49dd58,'rows':_0x584157}:null;}})[_0x6ed6('0x26')](respondWithResult(_0x88329e,null))[_0x6ed6('0x43')](handleError(_0x88329e,null));};exports[_0x6ed6('0x4e')]=function(_0x1e5def,_0x112c43,_0x5580e0){var _0xce1b77={};var _0x5c0161={};var _0x13f2e7;var _0x180f19;return db['FreshsalesConfiguration'][_0x6ed6('0x4f')]({'where':{'id':_0x1e5def[_0x6ed6('0x44')]['id']}})[_0x6ed6('0x26')](handleEntityNotFound(_0x112c43,null))[_0x6ed6('0x26')](function(_0x57804c){if(_0x57804c){_0x13f2e7=_0x57804c;_0x5c0161['model']=_[_0x6ed6('0x45')](db[_0x6ed6('0x4d')][_0x6ed6('0x2d')]);_0x5c0161[_0x6ed6('0x30')]=_[_0x6ed6('0x45')](_0x1e5def[_0x6ed6('0x30')]);_0x5c0161[_0x6ed6('0x39')]=_['intersection'](_0x5c0161[_0x6ed6('0x2f')],_0x5c0161[_0x6ed6('0x30')]);_0xce1b77[_0x6ed6('0x32')]=_[_0x6ed6('0x31')](_0x5c0161['model'],qs['fields'](_0x1e5def[_0x6ed6('0x30')][_0x6ed6('0x33')]));_0xce1b77[_0x6ed6('0x32')]=_0xce1b77[_0x6ed6('0x32')][_0x6ed6('0x34')]?_0xce1b77[_0x6ed6('0x32')]:_0x5c0161['model'];_0xce1b77[_0x6ed6('0x36')]=qs[_0x6ed6('0x37')](_0x1e5def[_0x6ed6('0x30')][_0x6ed6('0x37')]);_0xce1b77[_0x6ed6('0x38')]=qs[_0x6ed6('0x39')](_[_0x6ed6('0x3a')](_0x1e5def['query'],_0x5c0161['filters']));if(_0x1e5def[_0x6ed6('0x30')][_0x6ed6('0x3b')]){_0xce1b77[_0x6ed6('0x38')]=_[_0x6ed6('0x3d')](_0xce1b77['where'],{'$or':_[_0x6ed6('0x2c')](_0xce1b77[_0x6ed6('0x32')],function(_0x3e3992){var _0x175a46={};_0x175a46[_0x3e3992]={'$like':'%'+_0x1e5def[_0x6ed6('0x30')][_0x6ed6('0x3b')]+'%'};return _0x175a46;})});}_0xce1b77=_['merge']({},_0xce1b77,_0x1e5def[_0x6ed6('0x3e')]);return _0x13f2e7[_0x6ed6('0x4e')](_0xce1b77);}})[_0x6ed6('0x26')](function(_0x2a3e76){if(_0x2a3e76){_0x180f19=_0x2a3e76['length'];if(!_0x1e5def[_0x6ed6('0x30')][_0x6ed6('0x35')]('nolimit')){_0xce1b77[_0x6ed6('0x1d')]=qs[_0x6ed6('0x1d')](_0x1e5def['query']['limit']);_0xce1b77['offset']=qs[_0x6ed6('0x1b')](_0x1e5def[_0x6ed6('0x30')]['offset']);}return _0x13f2e7[_0x6ed6('0x4e')](_0xce1b77);}})[_0x6ed6('0x26')](function(_0x261975){if(_0x261975){return _0x261975?{'count':_0x180f19,'rows':_0x261975}:null;}})[_0x6ed6('0x26')](respondWithResult(_0x112c43,null))[_0x6ed6('0x43')](handleError(_0x112c43,null));}; \ No newline at end of file +var _0x494d=['findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','getSubjects'];(function(_0x1714d5,_0xf2ad9a){var _0xbcfd82=function(_0x3f03c4){while(--_0x3f03c4){_0x1714d5['push'](_0x1714d5['shift']());}};_0xbcfd82(++_0xf2ad9a);}(_0x494d,0x1a8));var _0xd494=function(_0x41622c,_0x5f5350){_0x41622c=_0x41622c-0x0;var _0x374a3e=_0x494d[_0x41622c];return _0x374a3e;};'use strict';var emlformat=require(_0xd494('0x0'));var rimraf=require(_0xd494('0x1'));var zipdir=require(_0xd494('0x2'));var jsonpatch=require(_0xd494('0x3'));var rp=require(_0xd494('0x4'));var moment=require(_0xd494('0x5'));var BPromise=require(_0xd494('0x6'));var Mustache=require(_0xd494('0x7'));var util=require(_0xd494('0x8'));var path=require(_0xd494('0x9'));var sox=require(_0xd494('0xa'));var csv=require('to-csv');var ejs=require(_0xd494('0xb'));var fs=require('fs');var fs_extra=require(_0xd494('0xc'));var _=require('lodash');var squel=require(_0xd494('0xd'));var crypto=require(_0xd494('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd494('0xf'));var toCsv=require(_0xd494('0x10'));var querystring=require(_0xd494('0x11'));var Papa=require(_0xd494('0x12'));var Redis=require(_0xd494('0x13'));var authService=require(_0xd494('0x14'));var qs=require(_0xd494('0x15'));var as=require(_0xd494('0x16'));var hardwareService=require(_0xd494('0x17'));var logger=require('../../config/logger')(_0xd494('0x18'));var utils=require(_0xd494('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd494('0x1a'));var db=require(_0xd494('0x1b'))['db'];function respondWithStatusCode(_0x32a34e,_0x551735){_0x551735=_0x551735||0xcc;return function(_0x89c04a){if(_0x89c04a){return _0x32a34e[_0xd494('0x1c')](_0x551735);}return _0x32a34e[_0xd494('0x1d')](_0x551735)[_0xd494('0x1e')]();};}function respondWithResult(_0x5bc852,_0x5913c6){_0x5913c6=_0x5913c6||0xc8;return function(_0x85c638){if(_0x85c638){return _0x5bc852[_0xd494('0x1d')](_0x5913c6)[_0xd494('0x1f')](_0x85c638);}};}function respondWithFilteredResult(_0xb36829,_0x2ac19a){return function(_0x7a82c1){if(_0x7a82c1){var _0x481386=typeof _0x2ac19a[_0xd494('0x20')]===_0xd494('0x21')&&typeof _0x2ac19a[_0xd494('0x22')]==='undefined';var _0x5be335=_0x7a82c1[_0xd494('0x23')];var _0x5c0798=_0x481386?0x0:_0x2ac19a[_0xd494('0x20')];var _0x334ca5=_0x481386?_0x7a82c1[_0xd494('0x23')]:_0x2ac19a['offset']+_0x2ac19a['limit'];var _0x244d08;if(_0x334ca5>=_0x5be335){_0x334ca5=_0x5be335;_0x244d08=0xc8;}else{_0x244d08=0xce;}_0xb36829[_0xd494('0x1d')](_0x244d08);return _0xb36829['set'](_0xd494('0x24'),_0x5c0798+'-'+_0x334ca5+'/'+_0x5be335)['json'](_0x7a82c1);}return null;};}function patchUpdates(_0x576bbd){return function(_0x3e3269){try{jsonpatch[_0xd494('0x25')](_0x3e3269,_0x576bbd,!![]);}catch(_0x18beaf){return BPromise['reject'](_0x18beaf);}return _0x3e3269[_0xd494('0x26')]();};}function saveUpdates(_0x213e82,_0x5b3d8c){return function(_0x547d5c){if(_0x547d5c){return _0x547d5c[_0xd494('0x27')](_0x213e82)[_0xd494('0x28')](function(_0x3b42d6){return _0x3b42d6;});}return null;};}function removeEntity(_0x5dbbcf,_0x4f52ff){return function(_0x4d41f6){if(_0x4d41f6){return _0x4d41f6[_0xd494('0x29')]()[_0xd494('0x28')](function(){_0x5dbbcf[_0xd494('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3542c4,_0x2884a9){return function(_0x1de8bc){if(!_0x1de8bc){_0x3542c4['sendStatus'](0x194);}return _0x1de8bc;};}function handleError(_0x66060e,_0x57a294){_0x57a294=_0x57a294||0x1f4;return function(_0x4ed034){logger[_0xd494('0x2a')](_0x4ed034['stack']);if(_0x4ed034[_0xd494('0x2b')]){delete _0x4ed034[_0xd494('0x2b')];}_0x66060e['status'](_0x57a294)[_0xd494('0x2c')](_0x4ed034);};}exports[_0xd494('0x2d')]=function(_0x404366,_0x16017d){var _0x334d6b={},_0x72d394={},_0x2e6302={'count':0x0,'rows':[]};var _0x21651d=_[_0xd494('0x2e')](db[_0xd494('0x2f')][_0xd494('0x30')],function(_0x3f37bd){return{'name':_0x3f37bd['fieldName'],'type':_0x3f37bd['type'][_0xd494('0x31')]};});_0x72d394['model']=_[_0xd494('0x2e')](_0x21651d,'name');_0x72d394['query']=_[_0xd494('0x32')](_0x404366[_0xd494('0x33')]);_0x72d394[_0xd494('0x34')]=_[_0xd494('0x35')](_0x72d394[_0xd494('0x36')],_0x72d394['query']);_0x334d6b[_0xd494('0x37')]=_[_0xd494('0x35')](_0x72d394[_0xd494('0x36')],qs[_0xd494('0x38')](_0x404366[_0xd494('0x33')][_0xd494('0x38')]));_0x334d6b[_0xd494('0x37')]=_0x334d6b[_0xd494('0x37')][_0xd494('0x39')]?_0x334d6b[_0xd494('0x37')]:_0x72d394[_0xd494('0x36')];if(!_0x404366[_0xd494('0x33')][_0xd494('0x3a')](_0xd494('0x3b'))){_0x334d6b['limit']=qs[_0xd494('0x22')](_0x404366['query'][_0xd494('0x22')]);_0x334d6b['offset']=qs[_0xd494('0x20')](_0x404366[_0xd494('0x33')][_0xd494('0x20')]);}_0x334d6b[_0xd494('0x3c')]=qs[_0xd494('0x3d')](_0x404366[_0xd494('0x33')][_0xd494('0x3d')]);_0x334d6b[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x404366[_0xd494('0x33')],_0x72d394[_0xd494('0x34')]),_0x21651d);if(_0x404366[_0xd494('0x33')][_0xd494('0x40')]){_0x334d6b[_0xd494('0x3e')]=_[_0xd494('0x41')](_0x334d6b[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x21651d,function(_0x636839){if(_0x636839[_0xd494('0x42')]!==_0xd494('0x43')){var _0x1d1339={};_0x1d1339[_0x636839[_0xd494('0x2b')]]={'$like':'%'+_0x404366[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x1d1339;}})});}_0x334d6b=_['merge']({},_0x334d6b,_0x404366[_0xd494('0x44')]);var _0x5c1767={'where':_0x334d6b[_0xd494('0x3e')]};return db[_0xd494('0x2f')]['count'](_0x5c1767)[_0xd494('0x28')](function(_0x5937aa){_0x2e6302[_0xd494('0x23')]=_0x5937aa;if(_0x404366[_0xd494('0x33')]['includeAll']){_0x334d6b[_0xd494('0x45')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xd494('0x46')](_0x334d6b);})[_0xd494('0x28')](function(_0x233a7a){_0x2e6302[_0xd494('0x47')]=_0x233a7a;return _0x2e6302;})[_0xd494('0x28')](respondWithFilteredResult(_0x16017d,_0x334d6b))['catch'](handleError(_0x16017d,null));};exports[_0xd494('0x48')]=function(_0x53bec9,_0x3301b6){var _0x247bb5={'raw':![],'where':{'id':_0x53bec9[_0xd494('0x49')]['id']}},_0x25ca77={};_0x25ca77['model']=_[_0xd494('0x32')](db[_0xd494('0x2f')]['rawAttributes']);_0x25ca77[_0xd494('0x33')]=_['keys'](_0x53bec9[_0xd494('0x33')]);_0x25ca77[_0xd494('0x34')]=_['intersection'](_0x25ca77[_0xd494('0x36')],_0x25ca77['query']);_0x247bb5[_0xd494('0x37')]=_['intersection'](_0x25ca77['model'],qs[_0xd494('0x38')](_0x53bec9[_0xd494('0x33')][_0xd494('0x38')]));_0x247bb5['attributes']=_0x247bb5['attributes'][_0xd494('0x39')]?_0x247bb5['attributes']:_0x25ca77[_0xd494('0x36')];if(_0x53bec9[_0xd494('0x33')][_0xd494('0x4a')]){_0x247bb5[_0xd494('0x45')]=[{'all':!![]}];}_0x247bb5=_[_0xd494('0x41')]({},_0x247bb5,_0x53bec9['options']);return db[_0xd494('0x2f')][_0xd494('0x4b')](_0x247bb5)[_0xd494('0x28')](handleEntityNotFound(_0x3301b6,null))[_0xd494('0x28')](respondWithResult(_0x3301b6,null))[_0xd494('0x4c')](handleError(_0x3301b6,null));};exports[_0xd494('0x4d')]=function(_0x50a688,_0x87d4eb){return db['FreshsalesConfiguration'][_0xd494('0x4d')](_0x50a688[_0xd494('0x4e')],{})['then'](respondWithResult(_0x87d4eb,0xc9))[_0xd494('0x4c')](handleError(_0x87d4eb,null));};exports[_0xd494('0x27')]=function(_0x52a7cd,_0x2108a9){if(_0x52a7cd[_0xd494('0x4e')]['id']){delete _0x52a7cd[_0xd494('0x4e')]['id'];}return db[_0xd494('0x2f')][_0xd494('0x4b')]({'where':{'id':_0x52a7cd[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x2108a9,null))[_0xd494('0x28')](saveUpdates(_0x52a7cd['body'],null))['then'](respondWithResult(_0x2108a9,null))[_0xd494('0x4c')](handleError(_0x2108a9,null));};exports[_0xd494('0x29')]=function(_0x3a1cfc,_0x549631){return db[_0xd494('0x2f')]['find']({'where':{'id':_0x3a1cfc[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x549631,null))[_0xd494('0x28')](removeEntity(_0x549631,null))[_0xd494('0x4c')](handleError(_0x549631,null));};exports[_0xd494('0x4f')]=function(_0x2b85c3,_0x594c4d,_0x28fcb2){var _0x39acef={};var _0x4ec4d1={};var _0x48b130;var _0x469e0b;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x2b85c3[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x594c4d,null))[_0xd494('0x28')](function(_0x233acc){if(_0x233acc){_0x48b130=_0x233acc;_0x4ec4d1['model']=_[_0xd494('0x32')](db[_0xd494('0x51')][_0xd494('0x30')]);_0x4ec4d1[_0xd494('0x33')]=_['keys'](_0x2b85c3[_0xd494('0x33')]);_0x4ec4d1['filters']=_['intersection'](_0x4ec4d1[_0xd494('0x36')],_0x4ec4d1['query']);_0x39acef[_0xd494('0x37')]=_[_0xd494('0x35')](_0x4ec4d1['model'],qs[_0xd494('0x38')](_0x2b85c3[_0xd494('0x33')]['fields']));_0x39acef[_0xd494('0x37')]=_0x39acef['attributes'][_0xd494('0x39')]?_0x39acef[_0xd494('0x37')]:_0x4ec4d1[_0xd494('0x36')];_0x39acef[_0xd494('0x3c')]=qs[_0xd494('0x3d')](_0x2b85c3[_0xd494('0x33')][_0xd494('0x3d')]);_0x39acef[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x2b85c3[_0xd494('0x33')],_0x4ec4d1[_0xd494('0x34')]));if(_0x2b85c3[_0xd494('0x33')]['filter']){_0x39acef[_0xd494('0x3e')]=_[_0xd494('0x41')](_0x39acef[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x39acef[_0xd494('0x37')],function(_0x55e8e9){var _0x4c0339={};_0x4c0339[_0x55e8e9]={'$like':'%'+_0x2b85c3[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x4c0339;})});}_0x39acef=_['merge']({},_0x39acef,_0x2b85c3[_0xd494('0x44')]);return _0x48b130['getSubjects'](_0x39acef);}})[_0xd494('0x28')](function(_0x190718){if(_0x190718){_0x469e0b=_0x190718[_0xd494('0x39')];if(!_0x2b85c3['query']['hasOwnProperty'](_0xd494('0x3b'))){_0x39acef['limit']=qs['limit'](_0x2b85c3[_0xd494('0x33')][_0xd494('0x22')]);_0x39acef[_0xd494('0x20')]=qs[_0xd494('0x20')](_0x2b85c3[_0xd494('0x33')][_0xd494('0x20')]);}return _0x48b130[_0xd494('0x4f')](_0x39acef);}})[_0xd494('0x28')](function(_0x1d19c5){if(_0x1d19c5){return _0x1d19c5?{'count':_0x469e0b,'rows':_0x1d19c5}:null;}})['then'](respondWithResult(_0x594c4d,null))[_0xd494('0x4c')](handleError(_0x594c4d,null));};exports[_0xd494('0x52')]=function(_0x3f42ad,_0x54bdd9,_0x1ac614){var _0x48fe7a={};var _0x23d8cf={};var _0x5d81c9;var _0x24ff56;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x3f42ad[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x54bdd9,null))[_0xd494('0x28')](function(_0x2fa5e1){if(_0x2fa5e1){_0x5d81c9=_0x2fa5e1;_0x23d8cf[_0xd494('0x36')]=_['keys'](db[_0xd494('0x51')][_0xd494('0x30')]);_0x23d8cf['query']=_['keys'](_0x3f42ad[_0xd494('0x33')]);_0x23d8cf[_0xd494('0x34')]=_[_0xd494('0x35')](_0x23d8cf['model'],_0x23d8cf[_0xd494('0x33')]);_0x48fe7a[_0xd494('0x37')]=_[_0xd494('0x35')](_0x23d8cf[_0xd494('0x36')],qs[_0xd494('0x38')](_0x3f42ad[_0xd494('0x33')][_0xd494('0x38')]));_0x48fe7a[_0xd494('0x37')]=_0x48fe7a['attributes'][_0xd494('0x39')]?_0x48fe7a[_0xd494('0x37')]:_0x23d8cf['model'];_0x48fe7a['order']=qs[_0xd494('0x3d')](_0x3f42ad[_0xd494('0x33')][_0xd494('0x3d')]);_0x48fe7a[_0xd494('0x3e')]=qs[_0xd494('0x34')](_['pick'](_0x3f42ad[_0xd494('0x33')],_0x23d8cf['filters']));if(_0x3f42ad['query']['filter']){_0x48fe7a[_0xd494('0x3e')]=_['merge'](_0x48fe7a[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x48fe7a[_0xd494('0x37')],function(_0x3da28a){var _0x18048e={};_0x18048e[_0x3da28a]={'$like':'%'+_0x3f42ad['query'][_0xd494('0x40')]+'%'};return _0x18048e;})});}_0x48fe7a=_['merge']({},_0x48fe7a,_0x3f42ad[_0xd494('0x44')]);return _0x5d81c9[_0xd494('0x52')](_0x48fe7a);}})[_0xd494('0x28')](function(_0xe808e){if(_0xe808e){_0x24ff56=_0xe808e[_0xd494('0x39')];if(!_0x3f42ad[_0xd494('0x33')][_0xd494('0x3a')]('nolimit')){_0x48fe7a[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x3f42ad['query'][_0xd494('0x22')]);_0x48fe7a[_0xd494('0x20')]=qs[_0xd494('0x20')](_0x3f42ad[_0xd494('0x33')]['offset']);}return _0x5d81c9[_0xd494('0x52')](_0x48fe7a);}})[_0xd494('0x28')](function(_0x2feca5){if(_0x2feca5){return _0x2feca5?{'count':_0x24ff56,'rows':_0x2feca5}:null;}})[_0xd494('0x28')](respondWithResult(_0x54bdd9,null))['catch'](handleError(_0x54bdd9,null));};exports['getFields']=function(_0x1d2393,_0x13d6bf,_0x3bd0f9){var _0xc70589={};var _0x2dea10={};var _0x34ed16;var _0x33f3e7;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x1d2393[_0xd494('0x49')]['id']}})['then'](handleEntityNotFound(_0x13d6bf,null))[_0xd494('0x28')](function(_0x3b9038){if(_0x3b9038){_0x34ed16=_0x3b9038;_0x2dea10['model']=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2dea10[_0xd494('0x33')]=_[_0xd494('0x32')](_0x1d2393[_0xd494('0x33')]);_0x2dea10[_0xd494('0x34')]=_['intersection'](_0x2dea10[_0xd494('0x36')],_0x2dea10[_0xd494('0x33')]);_0xc70589[_0xd494('0x37')]=_['intersection'](_0x2dea10[_0xd494('0x36')],qs['fields'](_0x1d2393['query']['fields']));_0xc70589['attributes']=_0xc70589[_0xd494('0x37')][_0xd494('0x39')]?_0xc70589[_0xd494('0x37')]:_0x2dea10[_0xd494('0x36')];_0xc70589[_0xd494('0x3c')]=qs['sort'](_0x1d2393[_0xd494('0x33')][_0xd494('0x3d')]);_0xc70589[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x1d2393[_0xd494('0x33')],_0x2dea10['filters']));if(_0x1d2393['query'][_0xd494('0x40')]){_0xc70589[_0xd494('0x3e')]=_[_0xd494('0x41')](_0xc70589[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0xc70589[_0xd494('0x37')],function(_0x3eb247){var _0x16aaf9={};_0x16aaf9[_0x3eb247]={'$like':'%'+_0x1d2393[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x16aaf9;})});}_0xc70589=_[_0xd494('0x41')]({},_0xc70589,_0x1d2393[_0xd494('0x44')]);return _0x34ed16[_0xd494('0x53')](_0xc70589);}})[_0xd494('0x28')](function(_0x7c40e4){if(_0x7c40e4){_0x33f3e7=_0x7c40e4[_0xd494('0x39')];if(!_0x1d2393[_0xd494('0x33')]['hasOwnProperty']('nolimit')){_0xc70589[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x1d2393['query'][_0xd494('0x22')]);_0xc70589['offset']=qs[_0xd494('0x20')](_0x1d2393[_0xd494('0x33')][_0xd494('0x20')]);}return _0x34ed16[_0xd494('0x53')](_0xc70589);}})[_0xd494('0x28')](function(_0x4721d0){if(_0x4721d0){return _0x4721d0?{'count':_0x33f3e7,'rows':_0x4721d0}:null;}})[_0xd494('0x28')](respondWithResult(_0x13d6bf,null))[_0xd494('0x4c')](handleError(_0x13d6bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 7e864fa..9d26533 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0079=['int_freshsales_configurations','util','../../config/logger','api','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x4c18c8,_0x156539){var _0x59d2ac=function(_0x135294){while(--_0x135294){_0x4c18c8['push'](_0x4c18c8['shift']());}};_0x59d2ac(++_0x156539);}(_0x0079,0x1cf));var _0x9007=function(_0x1dde87,_0x54ac00){_0x1dde87=_0x1dde87-0x0;var _0x4052a9=_0x0079[_0x1dde87];return _0x4052a9;};'use strict';var _=require('lodash');var util=require(_0x9007('0x0'));var logger=require(_0x9007('0x1'))(_0x9007('0x2'));var moment=require('moment');var BPromise=require(_0x9007('0x3'));var rp=require(_0x9007('0x4'));var fs=require('fs');var path=require(_0x9007('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9007('0x6'));module[_0x9007('0x7')]=function(_0x387c73,_0x1b7997){return _0x387c73[_0x9007('0x8')](_0x9007('0x9'),attributes,{'tableName':_0x9007('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd042=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xd042,0x64));var _0x2d04=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd042[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2d04('0x0'));var util=require(_0x2d04('0x1'));var logger=require(_0x2d04('0x2'))(_0x2d04('0x3'));var moment=require(_0x2d04('0x4'));var BPromise=require(_0x2d04('0x5'));var rp=require(_0x2d04('0x6'));var fs=require('fs');var path=require(_0x2d04('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d04('0x8'));module['exports']=function(_0x6b6668,_0x24b84d){return _0x6b6668['define'](_0x2d04('0x9'),attributes,{'tableName':_0x2d04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 4db82ad..7bf4952 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b22=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x0b22,0x1a1));var _0x20b2=function(_0x3d6cbe,_0x28215a){_0x3d6cbe=_0x3d6cbe-0x0;var _0xdca8c1=_0x0b22[_0x3d6cbe];return _0xdca8c1;};'use strict';var _=require('lodash');var util=require(_0x20b2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20b2('0x1'));var fs=require('fs');var Redis=require(_0x20b2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x20b2('0x3'));var logger=require(_0x20b2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x20b2('0x5'));var client=jayson[_0x20b2('0x6')][_0x20b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e3801,_0x501055,_0x42c12c){return new BPromise(function(_0x25c454,_0x5b7323){return client[_0x20b2('0x8')](_0x1e3801,_0x42c12c)[_0x20b2('0x9')](function(_0x2f9f70){logger[_0x20b2('0xa')](_0x20b2('0xb'),_0x501055,_0x20b2('0xc'));logger[_0x20b2('0xd')](_0x20b2('0xe'),_0x501055,_0x20b2('0xc'),JSON['stringify'](_0x2f9f70));if(_0x2f9f70[_0x20b2('0xf')]){if(_0x2f9f70[_0x20b2('0xf')][_0x20b2('0x10')]===0x1f4){logger[_0x20b2('0xf')](_0x20b2('0xb'),_0x501055,_0x2f9f70['error']['message']);return _0x5b7323(_0x2f9f70[_0x20b2('0xf')]['message']);}logger[_0x20b2('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x501055,_0x2f9f70['error'][_0x20b2('0x11')]);return _0x25c454(_0x2f9f70[_0x20b2('0xf')][_0x20b2('0x11')]);}else{logger['info'](_0x20b2('0xb'),_0x501055,_0x20b2('0xc'));_0x25c454(_0x2f9f70[_0x20b2('0x12')][_0x20b2('0x11')]);}})['catch'](function(_0x33e068){logger[_0x20b2('0xf')](_0x20b2('0xb'),_0x501055,_0x33e068);_0x5b7323(_0x33e068);});});} \ No newline at end of file +var _0xf81c=['info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xf3ee24,_0x39f8f2){var _0x19a59f=function(_0xed2a80){while(--_0xed2a80){_0xf3ee24['push'](_0xf3ee24['shift']());}};_0x19a59f(++_0x39f8f2);}(_0xf81c,0x1d0));var _0xcf81=function(_0x478689,_0x257f1a){_0x478689=_0x478689-0x0;var _0x9e4bf1=_0xf81c[_0x478689];return _0x9e4bf1;};'use strict';var _=require(_0xcf81('0x0'));var util=require('util');var moment=require(_0xcf81('0x1'));var BPromise=require(_0xcf81('0x2'));var rs=require(_0xcf81('0x3'));var fs=require('fs');var Redis=require(_0xcf81('0x4'));var db=require(_0xcf81('0x5'))['db'];var utils=require(_0xcf81('0x6'));var logger=require(_0xcf81('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcf81('0x8')][_0xcf81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c547,_0x54513a,_0x4eba38){return new BPromise(function(_0x24dffc,_0x1a09ce){return client[_0xcf81('0xa')](_0x40c547,_0x4eba38)[_0xcf81('0xb')](function(_0x5c90be){logger['info'](_0xcf81('0xc'),_0x54513a,'request\x20sent');logger[_0xcf81('0xd')](_0xcf81('0xe'),_0x54513a,_0xcf81('0xf'),JSON[_0xcf81('0x10')](_0x5c90be));if(_0x5c90be[_0xcf81('0x11')]){if(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x12')]===0x1f4){logger[_0xcf81('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54513a,_0x5c90be['error']['message']);return _0x1a09ce(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x13')]);}logger[_0xcf81('0x11')](_0xcf81('0xc'),_0x54513a,_0x5c90be['error'][_0xcf81('0x13')]);return _0x24dffc(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x13')]);}else{logger[_0xcf81('0x14')](_0xcf81('0xc'),_0x54513a,'request\x20sent');_0x24dffc(_0x5c90be[_0xcf81('0x15')][_0xcf81('0x13')]);}})['catch'](function(_0x45c8e4){logger[_0xcf81('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54513a,_0x45c8e4);_0x1a09ce(_0x45c8e4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 38b7e82..d139d08 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3b0=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util'];(function(_0x238d40,_0x3d809b){var _0x27e010=function(_0x6a2812){while(--_0x6a2812){_0x238d40['push'](_0x238d40['shift']());}};_0x27e010(++_0x3d809b);}(_0xc3b0,0x166));var _0x0c3b=function(_0x1d887b,_0x1a5487){_0x1d887b=_0x1d887b-0x0;var _0x4754ed=_0xc3b0[_0x1d887b];return _0x4754ed;};'use strict';var multer=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var path=require(_0x0c3b('0x2'));var timeout=require(_0x0c3b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c3b('0x4'));var auth=require(_0x0c3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c3b('0x6'));var controller=require(_0x0c3b('0x7'));router[_0x0c3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0c3b('0x9')]);router[_0x0c3b('0x8')](_0x0c3b('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0c3b('0xb')](),controller[_0x0c3b('0xc')]);router[_0x0c3b('0xd')](_0x0c3b('0xa'),auth[_0x0c3b('0xb')](),controller[_0x0c3b('0xe')]);router[_0x0c3b('0xf')](_0x0c3b('0xa'),auth[_0x0c3b('0xb')](),controller[_0x0c3b('0x10')]);module[_0x0c3b('0x11')]=router; \ No newline at end of file +var _0x057a=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x057a,0x1a6));var _0xa057=function(_0x44647c,_0x5c4d1e){_0x44647c=_0x44647c-0x0;var _0x392256=_0x057a[_0x44647c];return _0x392256;};'use strict';var multer=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var path=require(_0xa057('0x2'));var timeout=require('connect-timeout');var express=require(_0xa057('0x3'));var router=express['Router']();var fs_extra=require(_0xa057('0x4'));var auth=require(_0xa057('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa057('0x6'));var controller=require(_0xa057('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa057('0x8')]);router[_0xa057('0x9')](_0xa057('0xa'),auth[_0xa057('0xb')](),controller[_0xa057('0xc')]);router[_0xa057('0xd')]('/',auth[_0xa057('0xb')](),controller[_0xa057('0xe')]);router[_0xa057('0xf')](_0xa057('0xa'),auth[_0xa057('0xb')](),controller[_0xa057('0x10')]);router[_0xa057('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa057('0x12')]);module[_0xa057('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a20261e..d57ec05 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2345=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x5a5412,_0x37cbd1){var _0x345052=function(_0x4e8eb8){while(--_0x4e8eb8){_0x5a5412['push'](_0x5a5412['shift']());}};_0x345052(++_0x37cbd1);}(_0x2345,0x1e8));var _0x5234=function(_0x304aa5,_0x1dac8f){_0x304aa5=_0x304aa5-0x0;var _0x13823b=_0x2345[_0x304aa5];return _0x13823b;};'use strict';var Sequelize=require(_0x5234('0x0'));module[_0x5234('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5234('0x2'),_0x5234('0x3'),_0x5234('0x4'),_0x5234('0x5'),_0x5234('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5234('0x7')]},'key':{'type':Sequelize[_0x5234('0x7')]},'keyType':{'type':Sequelize[_0x5234('0x8')](_0x5234('0x2'),_0x5234('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5234('0x7')]},'customField':{'type':Sequelize[_0x5234('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8bc5=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x8bc5,0x6d));var _0x58bc=function(_0x207f5c,_0x1648c0){_0x207f5c=_0x207f5c-0x0;var _0x5ec16f=_0x8bc5[_0x207f5c];return _0x5ec16f;};'use strict';var Sequelize=require(_0x58bc('0x0'));module[_0x58bc('0x1')]={'type':{'type':Sequelize[_0x58bc('0x2')](_0x58bc('0x3'),_0x58bc('0x4'),_0x58bc('0x5'),'keyValue','picklist'),'defaultValue':_0x58bc('0x3')},'content':{'type':Sequelize[_0x58bc('0x6')]},'key':{'type':Sequelize[_0x58bc('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x58bc('0x3'),_0x58bc('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x58bc('0x6')]},'idField':{'type':Sequelize[_0x58bc('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x58bc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x58bc('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 72f0a20..1ede1b7 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d67=['map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','status','error','name','send','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d67,0xb8));var _0x74d6=function(_0x17e8a2,_0x16e8e6){_0x17e8a2=_0x17e8a2-0x0;var _0xe752f9=_0x4d67[_0x17e8a2];return _0xe752f9;};'use strict';var emlformat=require(_0x74d6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74d6('0x1'));var rp=require(_0x74d6('0x2'));var moment=require(_0x74d6('0x3'));var BPromise=require(_0x74d6('0x4'));var Mustache=require(_0x74d6('0x5'));var util=require(_0x74d6('0x6'));var path=require(_0x74d6('0x7'));var sox=require(_0x74d6('0x8'));var csv=require(_0x74d6('0x9'));var ejs=require(_0x74d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d6('0xb'));var squel=require(_0x74d6('0xc'));var crypto=require(_0x74d6('0xd'));var jsforce=require(_0x74d6('0xe'));var deskjs=require(_0x74d6('0xf'));var toCsv=require(_0x74d6('0x9'));var querystring=require(_0x74d6('0x10'));var Papa=require(_0x74d6('0x11'));var Redis=require(_0x74d6('0x12'));var authService=require(_0x74d6('0x13'));var qs=require(_0x74d6('0x14'));var as=require(_0x74d6('0x15'));var hardwareService=require(_0x74d6('0x16'));var logger=require(_0x74d6('0x17'))('api');var utils=require(_0x74d6('0x18'));var config=require(_0x74d6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x74d6('0x1a'))['db'];function respondWithStatusCode(_0x43ca54,_0x2c6807){_0x2c6807=_0x2c6807||0xcc;return function(_0x2577f9){if(_0x2577f9){return _0x43ca54[_0x74d6('0x1b')](_0x2c6807);}return _0x43ca54['status'](_0x2c6807)['end']();};}function respondWithResult(_0x4f79af,_0x274e7d){_0x274e7d=_0x274e7d||0xc8;return function(_0x3b8791){if(_0x3b8791){return _0x4f79af['status'](_0x274e7d)[_0x74d6('0x1c')](_0x3b8791);}};}function respondWithFilteredResult(_0x4b883e,_0x3e380a){return function(_0x106a15){if(_0x106a15){var _0x27b9bf=typeof _0x3e380a[_0x74d6('0x1d')]==='undefined'&&typeof _0x3e380a[_0x74d6('0x1e')]===_0x74d6('0x1f');var _0x4609c0=_0x106a15[_0x74d6('0x20')];var _0x98a7eb=_0x27b9bf?0x0:_0x3e380a[_0x74d6('0x1d')];var _0x138741=_0x27b9bf?_0x106a15[_0x74d6('0x20')]:_0x3e380a[_0x74d6('0x1d')]+_0x3e380a['limit'];var _0x35f647;if(_0x138741>=_0x4609c0){_0x138741=_0x4609c0;_0x35f647=0xc8;}else{_0x35f647=0xce;}_0x4b883e['status'](_0x35f647);return _0x4b883e[_0x74d6('0x21')](_0x74d6('0x22'),_0x98a7eb+'-'+_0x138741+'/'+_0x4609c0)[_0x74d6('0x1c')](_0x106a15);}return null;};}function patchUpdates(_0x170932){return function(_0x3988b0){try{jsonpatch['apply'](_0x3988b0,_0x170932,!![]);}catch(_0x2f164e){return BPromise['reject'](_0x2f164e);}return _0x3988b0[_0x74d6('0x23')]();};}function saveUpdates(_0x30e3f8,_0x5e5f28){return function(_0x1632d4){if(_0x1632d4){return _0x1632d4[_0x74d6('0x24')](_0x30e3f8)[_0x74d6('0x25')](function(_0x44a16e){return _0x44a16e;});}return null;};}function removeEntity(_0xe17f00,_0x5c8b47){return function(_0x2ce406){if(_0x2ce406){return _0x2ce406[_0x74d6('0x26')]()['then'](function(){_0xe17f00[_0x74d6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa802d5,_0x1b303d){return function(_0x105671){if(!_0x105671){_0xa802d5[_0x74d6('0x1b')](0x194);}return _0x105671;};}function handleError(_0x2f0e0b,_0x22d9ea){_0x22d9ea=_0x22d9ea||0x1f4;return function(_0x28e248){logger[_0x74d6('0x28')](_0x28e248['stack']);if(_0x28e248[_0x74d6('0x29')]){delete _0x28e248['name'];}_0x2f0e0b[_0x74d6('0x27')](_0x22d9ea)[_0x74d6('0x2a')](_0x28e248);};}exports[_0x74d6('0x2b')]=function(_0x241711,_0x518aba){var _0x3286fa={},_0x8aa138={},_0x236045={'count':0x0,'rows':[]};var _0x2941a3=_[_0x74d6('0x2c')](db[_0x74d6('0x2d')][_0x74d6('0x2e')],function(_0xc19c45){return{'name':_0xc19c45[_0x74d6('0x2f')],'type':_0xc19c45[_0x74d6('0x30')][_0x74d6('0x31')]};});_0x8aa138[_0x74d6('0x32')]=_[_0x74d6('0x2c')](_0x2941a3,'name');_0x8aa138[_0x74d6('0x33')]=_[_0x74d6('0x34')](_0x241711[_0x74d6('0x33')]);_0x8aa138[_0x74d6('0x35')]=_[_0x74d6('0x36')](_0x8aa138[_0x74d6('0x32')],_0x8aa138[_0x74d6('0x33')]);_0x3286fa[_0x74d6('0x37')]=_['intersection'](_0x8aa138[_0x74d6('0x32')],qs['fields'](_0x241711['query'][_0x74d6('0x38')]));_0x3286fa[_0x74d6('0x37')]=_0x3286fa[_0x74d6('0x37')]['length']?_0x3286fa[_0x74d6('0x37')]:_0x8aa138[_0x74d6('0x32')];if(!_0x241711['query'][_0x74d6('0x39')](_0x74d6('0x3a'))){_0x3286fa[_0x74d6('0x1e')]=qs[_0x74d6('0x1e')](_0x241711[_0x74d6('0x33')][_0x74d6('0x1e')]);_0x3286fa['offset']=qs[_0x74d6('0x1d')](_0x241711[_0x74d6('0x33')][_0x74d6('0x1d')]);}_0x3286fa['order']=qs['sort'](_0x241711[_0x74d6('0x33')][_0x74d6('0x3b')]);_0x3286fa[_0x74d6('0x3c')]=qs['filters'](_[_0x74d6('0x3d')](_0x241711['query'],_0x8aa138[_0x74d6('0x35')]),_0x2941a3);if(_0x241711[_0x74d6('0x33')][_0x74d6('0x3e')]){_0x3286fa['where']=_['merge'](_0x3286fa[_0x74d6('0x3c')],{'$or':_['map'](_0x2941a3,function(_0x1e8350){if(_0x1e8350['type']!==_0x74d6('0x3f')){var _0x1ecbf0={};_0x1ecbf0[_0x1e8350[_0x74d6('0x29')]]={'$like':'%'+_0x241711[_0x74d6('0x33')][_0x74d6('0x3e')]+'%'};return _0x1ecbf0;}})});}_0x3286fa=_[_0x74d6('0x40')]({},_0x3286fa,_0x241711[_0x74d6('0x41')]);var _0x5ea590={'where':_0x3286fa[_0x74d6('0x3c')]};return db[_0x74d6('0x2d')][_0x74d6('0x20')](_0x5ea590)[_0x74d6('0x25')](function(_0x5d55e1){_0x236045[_0x74d6('0x20')]=_0x5d55e1;if(_0x241711[_0x74d6('0x33')][_0x74d6('0x42')]){_0x3286fa[_0x74d6('0x43')]=[{'all':!![]}];}return db[_0x74d6('0x2d')][_0x74d6('0x44')](_0x3286fa);})[_0x74d6('0x25')](function(_0x514cf0){_0x236045[_0x74d6('0x45')]=_0x514cf0;return _0x236045;})['then'](respondWithFilteredResult(_0x518aba,_0x3286fa))[_0x74d6('0x46')](handleError(_0x518aba,null));};exports[_0x74d6('0x47')]=function(_0x294693,_0x188027){var _0x472d99={'raw':!![],'where':{'id':_0x294693[_0x74d6('0x48')]['id']}},_0x15bed8={};_0x15bed8['model']=_[_0x74d6('0x34')](db[_0x74d6('0x2d')][_0x74d6('0x2e')]);_0x15bed8[_0x74d6('0x33')]=_[_0x74d6('0x34')](_0x294693['query']);_0x15bed8[_0x74d6('0x35')]=_['intersection'](_0x15bed8[_0x74d6('0x32')],_0x15bed8[_0x74d6('0x33')]);_0x472d99[_0x74d6('0x37')]=_['intersection'](_0x15bed8[_0x74d6('0x32')],qs[_0x74d6('0x38')](_0x294693['query'][_0x74d6('0x38')]));_0x472d99[_0x74d6('0x37')]=_0x472d99[_0x74d6('0x37')][_0x74d6('0x49')]?_0x472d99['attributes']:_0x15bed8['model'];if(_0x294693[_0x74d6('0x33')][_0x74d6('0x42')]){_0x472d99[_0x74d6('0x43')]=[{'all':!![]}];}_0x472d99=_['merge']({},_0x472d99,_0x294693[_0x74d6('0x41')]);return db[_0x74d6('0x2d')][_0x74d6('0x4a')](_0x472d99)['then'](handleEntityNotFound(_0x188027,null))['then'](respondWithResult(_0x188027,null))[_0x74d6('0x46')](handleError(_0x188027,null));};exports['create']=function(_0x1ceb3f,_0x24b4e8){return db[_0x74d6('0x2d')]['create'](_0x1ceb3f[_0x74d6('0x4b')],{})[_0x74d6('0x25')](respondWithResult(_0x24b4e8,0xc9))[_0x74d6('0x46')](handleError(_0x24b4e8,null));};exports['update']=function(_0x2d37b2,_0x403a22){if(_0x2d37b2[_0x74d6('0x4b')]['id']){delete _0x2d37b2['body']['id'];}return db[_0x74d6('0x2d')][_0x74d6('0x4a')]({'where':{'id':_0x2d37b2['params']['id']}})[_0x74d6('0x25')](handleEntityNotFound(_0x403a22,null))[_0x74d6('0x25')](saveUpdates(_0x2d37b2[_0x74d6('0x4b')],null))[_0x74d6('0x25')](respondWithResult(_0x403a22,null))[_0x74d6('0x46')](handleError(_0x403a22,null));};exports['destroy']=function(_0x1a399a,_0x3a2fd3){return db['FreshsalesField'][_0x74d6('0x4a')]({'where':{'id':_0x1a399a[_0x74d6('0x48')]['id']}})[_0x74d6('0x25')](handleEntityNotFound(_0x3a2fd3,null))[_0x74d6('0x25')](removeEntity(_0x3a2fd3,null))[_0x74d6('0x46')](handleError(_0x3a2fd3,null));}; \ No newline at end of file +var _0xb91a=['undefined','limit','count','set','json','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x67be45,_0xc7ed38){var _0x5a74a9=function(_0x3e53ba){while(--_0x3e53ba){_0x67be45['push'](_0x67be45['shift']());}};_0x5a74a9(++_0xc7ed38);}(_0xb91a,0x1ef));var _0xab91=function(_0x4c6383,_0x43a72e){_0x4c6383=_0x4c6383-0x0;var _0x34c769=_0xb91a[_0x4c6383];return _0x34c769;};'use strict';var emlformat=require(_0xab91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab91('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab91('0x2'));var moment=require(_0xab91('0x3'));var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require(_0xab91('0x6'));var path=require(_0xab91('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab91('0x8'));var fs=require('fs');var fs_extra=require(_0xab91('0x9'));var _=require(_0xab91('0xa'));var squel=require(_0xab91('0xb'));var crypto=require(_0xab91('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xab91('0xd'));var toCsv=require(_0xab91('0xe'));var querystring=require(_0xab91('0xf'));var Papa=require(_0xab91('0x10'));var Redis=require(_0xab91('0x11'));var authService=require(_0xab91('0x12'));var qs=require(_0xab91('0x13'));var as=require(_0xab91('0x14'));var hardwareService=require(_0xab91('0x15'));var logger=require(_0xab91('0x16'))(_0xab91('0x17'));var utils=require(_0xab91('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xab91('0x19'));var db=require(_0xab91('0x1a'))['db'];function respondWithStatusCode(_0x36a7b3,_0x250548){_0x250548=_0x250548||0xcc;return function(_0x369c99){if(_0x369c99){return _0x36a7b3[_0xab91('0x1b')](_0x250548);}return _0x36a7b3[_0xab91('0x1c')](_0x250548)['end']();};}function respondWithResult(_0x114da5,_0x5b8b2f){_0x5b8b2f=_0x5b8b2f||0xc8;return function(_0x37f2f2){if(_0x37f2f2){return _0x114da5[_0xab91('0x1c')](_0x5b8b2f)['json'](_0x37f2f2);}};}function respondWithFilteredResult(_0x3aebed,_0x348610){return function(_0x550776){if(_0x550776){var _0x189685=typeof _0x348610[_0xab91('0x1d')]===_0xab91('0x1e')&&typeof _0x348610[_0xab91('0x1f')]===_0xab91('0x1e');var _0x55976a=_0x550776[_0xab91('0x20')];var _0x5e180b=_0x189685?0x0:_0x348610[_0xab91('0x1d')];var _0x44fae7=_0x189685?_0x550776['count']:_0x348610[_0xab91('0x1d')]+_0x348610[_0xab91('0x1f')];var _0x67738a;if(_0x44fae7>=_0x55976a){_0x44fae7=_0x55976a;_0x67738a=0xc8;}else{_0x67738a=0xce;}_0x3aebed[_0xab91('0x1c')](_0x67738a);return _0x3aebed[_0xab91('0x21')]('Content-Range',_0x5e180b+'-'+_0x44fae7+'/'+_0x55976a)[_0xab91('0x22')](_0x550776);}return null;};}function patchUpdates(_0x2b4176){return function(_0x5d5c40){try{jsonpatch[_0xab91('0x23')](_0x5d5c40,_0x2b4176,!![]);}catch(_0x13025f){return BPromise['reject'](_0x13025f);}return _0x5d5c40['save']();};}function saveUpdates(_0xb1bd94,_0x252bdd){return function(_0x497e9f){if(_0x497e9f){return _0x497e9f[_0xab91('0x24')](_0xb1bd94)[_0xab91('0x25')](function(_0x45ab99){return _0x45ab99;});}return null;};}function removeEntity(_0x554289,_0x48fce8){return function(_0x1548c1){if(_0x1548c1){return _0x1548c1[_0xab91('0x26')]()[_0xab91('0x25')](function(){_0x554289['status'](0xcc)[_0xab91('0x27')]();});}};}function handleEntityNotFound(_0x5d825a,_0x401e45){return function(_0x40be5d){if(!_0x40be5d){_0x5d825a['sendStatus'](0x194);}return _0x40be5d;};}function handleError(_0x5f0e93,_0x14db9a){_0x14db9a=_0x14db9a||0x1f4;return function(_0x343587){logger['error'](_0x343587[_0xab91('0x28')]);if(_0x343587[_0xab91('0x29')]){delete _0x343587['name'];}_0x5f0e93['status'](_0x14db9a)[_0xab91('0x2a')](_0x343587);};}exports[_0xab91('0x2b')]=function(_0x33110e,_0x56cf3c){var _0x47a96c={},_0x2f0145={},_0x4f3200={'count':0x0,'rows':[]};var _0x4923d9=_[_0xab91('0x2c')](db['FreshsalesField'][_0xab91('0x2d')],function(_0x4fdc6b){return{'name':_0x4fdc6b[_0xab91('0x2e')],'type':_0x4fdc6b[_0xab91('0x2f')]['key']};});_0x2f0145[_0xab91('0x30')]=_[_0xab91('0x2c')](_0x4923d9,'name');_0x2f0145[_0xab91('0x31')]=_['keys'](_0x33110e['query']);_0x2f0145['filters']=_['intersection'](_0x2f0145[_0xab91('0x30')],_0x2f0145[_0xab91('0x31')]);_0x47a96c['attributes']=_[_0xab91('0x32')](_0x2f0145['model'],qs[_0xab91('0x33')](_0x33110e[_0xab91('0x31')][_0xab91('0x33')]));_0x47a96c[_0xab91('0x34')]=_0x47a96c[_0xab91('0x34')][_0xab91('0x35')]?_0x47a96c[_0xab91('0x34')]:_0x2f0145['model'];if(!_0x33110e[_0xab91('0x31')][_0xab91('0x36')](_0xab91('0x37'))){_0x47a96c[_0xab91('0x1f')]=qs[_0xab91('0x1f')](_0x33110e[_0xab91('0x31')][_0xab91('0x1f')]);_0x47a96c[_0xab91('0x1d')]=qs[_0xab91('0x1d')](_0x33110e['query'][_0xab91('0x1d')]);}_0x47a96c[_0xab91('0x38')]=qs[_0xab91('0x39')](_0x33110e[_0xab91('0x31')][_0xab91('0x39')]);_0x47a96c[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_['pick'](_0x33110e[_0xab91('0x31')],_0x2f0145['filters']),_0x4923d9);if(_0x33110e['query'][_0xab91('0x3c')]){_0x47a96c[_0xab91('0x3a')]=_[_0xab91('0x3d')](_0x47a96c['where'],{'$or':_[_0xab91('0x2c')](_0x4923d9,function(_0x34ccfb){if(_0x34ccfb[_0xab91('0x2f')]!=='VIRTUAL'){var _0xaf30ee={};_0xaf30ee[_0x34ccfb[_0xab91('0x29')]]={'$like':'%'+_0x33110e['query'][_0xab91('0x3c')]+'%'};return _0xaf30ee;}})});}_0x47a96c=_[_0xab91('0x3d')]({},_0x47a96c,_0x33110e[_0xab91('0x3e')]);var _0x2f3138={'where':_0x47a96c[_0xab91('0x3a')]};return db[_0xab91('0x3f')][_0xab91('0x20')](_0x2f3138)['then'](function(_0x1303f8){_0x4f3200[_0xab91('0x20')]=_0x1303f8;if(_0x33110e['query'][_0xab91('0x40')]){_0x47a96c[_0xab91('0x41')]=[{'all':!![]}];}return db[_0xab91('0x3f')][_0xab91('0x42')](_0x47a96c);})[_0xab91('0x25')](function(_0x132735){_0x4f3200[_0xab91('0x43')]=_0x132735;return _0x4f3200;})['then'](respondWithFilteredResult(_0x56cf3c,_0x47a96c))[_0xab91('0x44')](handleError(_0x56cf3c,null));};exports[_0xab91('0x45')]=function(_0x34a1ce,_0x342093){var _0x32cc40={'raw':!![],'where':{'id':_0x34a1ce[_0xab91('0x46')]['id']}},_0x2d0ab0={};_0x2d0ab0[_0xab91('0x30')]=_[_0xab91('0x47')](db['FreshsalesField'][_0xab91('0x2d')]);_0x2d0ab0[_0xab91('0x31')]=_[_0xab91('0x47')](_0x34a1ce[_0xab91('0x31')]);_0x2d0ab0['filters']=_[_0xab91('0x32')](_0x2d0ab0['model'],_0x2d0ab0['query']);_0x32cc40[_0xab91('0x34')]=_[_0xab91('0x32')](_0x2d0ab0[_0xab91('0x30')],qs['fields'](_0x34a1ce[_0xab91('0x31')]['fields']));_0x32cc40['attributes']=_0x32cc40[_0xab91('0x34')][_0xab91('0x35')]?_0x32cc40[_0xab91('0x34')]:_0x2d0ab0['model'];if(_0x34a1ce[_0xab91('0x31')][_0xab91('0x40')]){_0x32cc40[_0xab91('0x41')]=[{'all':!![]}];}_0x32cc40=_['merge']({},_0x32cc40,_0x34a1ce[_0xab91('0x3e')]);return db[_0xab91('0x3f')]['find'](_0x32cc40)[_0xab91('0x25')](handleEntityNotFound(_0x342093,null))[_0xab91('0x25')](respondWithResult(_0x342093,null))['catch'](handleError(_0x342093,null));};exports[_0xab91('0x48')]=function(_0x1a8aeb,_0x4ca74e){return db['FreshsalesField'][_0xab91('0x48')](_0x1a8aeb[_0xab91('0x49')],{})['then'](respondWithResult(_0x4ca74e,0xc9))['catch'](handleError(_0x4ca74e,null));};exports['update']=function(_0x430374,_0x5aebdc){if(_0x430374['body']['id']){delete _0x430374[_0xab91('0x49')]['id'];}return db[_0xab91('0x3f')][_0xab91('0x4a')]({'where':{'id':_0x430374[_0xab91('0x46')]['id']}})[_0xab91('0x25')](handleEntityNotFound(_0x5aebdc,null))[_0xab91('0x25')](saveUpdates(_0x430374[_0xab91('0x49')],null))[_0xab91('0x25')](respondWithResult(_0x5aebdc,null))['catch'](handleError(_0x5aebdc,null));};exports[_0xab91('0x26')]=function(_0x53fb6e,_0x40aacf){return db['FreshsalesField'][_0xab91('0x4a')]({'where':{'id':_0x53fb6e[_0xab91('0x46')]['id']}})['then'](handleEntityNotFound(_0x40aacf,null))[_0xab91('0x25')](removeEntity(_0x40aacf,null))[_0xab91('0x44')](handleError(_0x40aacf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index ea7dfc7..c1a95b8 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe77c=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','moment'];(function(_0x26ddd9,_0x128536){var _0x2dafd9=function(_0x382f0b){while(--_0x382f0b){_0x26ddd9['push'](_0x26ddd9['shift']());}};_0x2dafd9(++_0x128536);}(_0xe77c,0x176));var _0xce77=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0xe77c[_0x2860ab];return _0x3037c4;};'use strict';var _=require(_0xce77('0x0'));var util=require(_0xce77('0x1'));var logger=require(_0xce77('0x2'))('api');var moment=require(_0xce77('0x3'));var BPromise=require(_0xce77('0x4'));var rp=require(_0xce77('0x5'));var fs=require('fs');var path=require(_0xce77('0x6'));var rimraf=require(_0xce77('0x7'));var config=require(_0xce77('0x8'));var attributes=require(_0xce77('0x9'));module['exports']=function(_0x5aea39,_0xed47c5){return _0x5aea39['define'](_0xce77('0xa'),attributes,{'tableName':_0xce77('0xb'),'paranoid':![],'indexes':[{'name':_0xce77('0xc'),'fields':['idField',_0xce77('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde9f=['FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','api','moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xde9f,0x118));var _0xfde9=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0xde9f[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xfde9('0xa'),_0xfde9('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index c3d63ad..7a18208 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x47219c,_0x78ae33){var _0x4cd653=function(_0x5cb6da){while(--_0x5cb6da){_0x47219c['push'](_0x47219c['shift']());}};_0x4cd653(++_0x78ae33);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4230d6,_0x12477e){_0x4230d6=_0x4230d6-0x0;var _0x2743f2=_0xb4c7[_0x4230d6];return _0x2743f2;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file +var _0x2eb2=['request','then','info','request\x20sent','error','FreshsalesField,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x4fe4f6,_0x57efde){var _0x5e71fb=function(_0x3404d8){while(--_0x3404d8){_0x4fe4f6['push'](_0x4fe4f6['shift']());}};_0x5e71fb(++_0x57efde);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x2eb2[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4787e34..d07403c 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2b92db,_0x43b44e){var _0x140e0c=function(_0x585e68){while(--_0x585e68){_0x2b92db['push'](_0x2b92db['shift']());}};_0x140e0c(++_0x43b44e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5cf338,_0x3dcccc){var _0x7a16c7=function(_0x5bb2d2){while(--_0x5bb2d2){_0x5cf338['push'](_0x5cf338['shift']());}};_0x7a16c7(++_0x3dcccc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d5d4f50..05f350e 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 _0x1f20=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x1519a9,_0x1ae115){var _0x132aee=function(_0x2cdce3){while(--_0x2cdce3){_0x1519a9['push'](_0x1519a9['shift']());}};_0x132aee(++_0x1ae115);}(_0x1f20,0x11c));var _0x01f2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1f20[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x01f2('0x0'));module[_0x01f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01f2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x01f2('0x3')},'remoteUri':{'type':Sequelize[_0x01f2('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x01f2('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x01f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x01f2('0x4')](_0x01f2('0x5'),_0x01f2('0x6')),'defaultValue':_0x01f2('0x5')}}; \ No newline at end of file +var _0xa32b=['STRING','username','ENUM','integrationTab','sequelize'];(function(_0x4a2b33,_0x208982){var _0x2e966f=function(_0x30e429){while(--_0x30e429){_0x4a2b33['push'](_0x4a2b33['shift']());}};_0x2e966f(++_0x208982);}(_0xa32b,0x68));var _0xba32=function(_0x151d64,_0x360f73){_0x151d64=_0x151d64-0x0;var _0x409cfd=_0xa32b[_0x151d64];return _0x409cfd;};'use strict';var Sequelize=require(_0xba32('0x0'));module['exports']={'name':{'type':Sequelize[_0xba32('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xba32('0x2')},'remoteUri':{'type':Sequelize[_0xba32('0x1')]},'password':{'type':Sequelize[_0xba32('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xba32('0x1')]},'securityToken':{'type':Sequelize[_0xba32('0x1')]},'serverUrl':{'type':Sequelize[_0xba32('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xba32('0x3')](_0xba32('0x4'),'newTab'),'defaultValue':_0xba32('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index c070c7c..8008617 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 _0xb012=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientSecret','securityToken','remoteUri','slice','lastIndexOf','clientId','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','textarea','phone','remove','includes','length','custom','picklistValues','label','value','true','False','false','send','Wrong\x20credentials','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x142dc4,_0x366f49){var _0x5d9776=function(_0x41e34b){while(--_0x41e34b){_0x142dc4['push'](_0x142dc4['shift']());}};_0x5d9776(++_0x366f49);}(_0xb012,0x69));var _0x2b01=function(_0x3cd34a,_0x93acd2){_0x3cd34a=_0x3cd34a-0x0;var _0x1ea6f4=_0xb012[_0x3cd34a];return _0x1ea6f4;};'use strict';var emlformat=require(_0x2b01('0x0'));var rimraf=require(_0x2b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b01('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2b01('0x3'));var util=require(_0x2b01('0x4'));var path=require(_0x2b01('0x5'));var sox=require(_0x2b01('0x6'));var csv=require(_0x2b01('0x7'));var ejs=require(_0x2b01('0x8'));var fs=require('fs');var fs_extra=require(_0x2b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b01('0xa'));var jsforce=require(_0x2b01('0xb'));var deskjs=require(_0x2b01('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2b01('0xd'));var Papa=require(_0x2b01('0xe'));var Redis=require(_0x2b01('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2b01('0x10'));var as=require(_0x2b01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b01('0x12'))(_0x2b01('0x13'));var utils=require(_0x2b01('0x14'));var config=require(_0x2b01('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b01('0x16'))['db'];var integrations=require(_0x2b01('0x17'));function respondWithStatusCode(_0x368125,_0x5d8718){_0x5d8718=_0x5d8718||0xcc;return function(_0x3eec52){if(_0x3eec52){return _0x368125[_0x2b01('0x18')](_0x5d8718);}return _0x368125[_0x2b01('0x19')](_0x5d8718)[_0x2b01('0x1a')]();};}function respondWithResult(_0x4584f6,_0x4feec2){_0x4feec2=_0x4feec2||0xc8;return function(_0x4074fa){if(_0x4074fa){return _0x4584f6[_0x2b01('0x19')](_0x4feec2)['json'](_0x4074fa);}};}function respondWithFilteredResult(_0x2758c6,_0x521462){return function(_0x5f2324){if(_0x5f2324){var _0x13e75b=typeof _0x521462['offset']===_0x2b01('0x1b')&&typeof _0x521462[_0x2b01('0x1c')]===_0x2b01('0x1b');var _0x2245f3=_0x5f2324[_0x2b01('0x1d')];var _0x5a3dcb=_0x13e75b?0x0:_0x521462[_0x2b01('0x1e')];var _0x4aeef9=_0x13e75b?_0x5f2324['count']:_0x521462[_0x2b01('0x1e')]+_0x521462[_0x2b01('0x1c')];var _0x2c06ae;if(_0x4aeef9>=_0x2245f3){_0x4aeef9=_0x2245f3;_0x2c06ae=0xc8;}else{_0x2c06ae=0xce;}_0x2758c6['status'](_0x2c06ae);return _0x2758c6['set'](_0x2b01('0x1f'),_0x5a3dcb+'-'+_0x4aeef9+'/'+_0x2245f3)[_0x2b01('0x20')](_0x5f2324);}return null;};}function patchUpdates(_0x392eec){return function(_0x501329){try{jsonpatch[_0x2b01('0x21')](_0x501329,_0x392eec,!![]);}catch(_0x22c0cd){return BPromise[_0x2b01('0x22')](_0x22c0cd);}return _0x501329[_0x2b01('0x23')]();};}function saveUpdates(_0x39286d,_0x9fb63f){return function(_0x271614){if(_0x271614){return _0x271614[_0x2b01('0x24')](_0x39286d)[_0x2b01('0x25')](function(_0x2a0474){return _0x2a0474;});}return null;};}function removeEntity(_0x26f957,_0x1f64fc){return function(_0x34411d){if(_0x34411d){return _0x34411d[_0x2b01('0x26')]()[_0x2b01('0x25')](function(){_0x26f957[_0x2b01('0x19')](0xcc)[_0x2b01('0x1a')]();});}};}function handleEntityNotFound(_0x418faa,_0x39cf49){return function(_0x342af7){if(!_0x342af7){_0x418faa['sendStatus'](0x194);}return _0x342af7;};}function handleError(_0x288915,_0x17d5a2){_0x17d5a2=_0x17d5a2||0x1f4;return function(_0x45b337){logger[_0x2b01('0x27')](_0x45b337[_0x2b01('0x28')]);if(_0x45b337[_0x2b01('0x29')]){delete _0x45b337[_0x2b01('0x29')];}_0x288915[_0x2b01('0x19')](_0x17d5a2)['send'](_0x45b337);};}exports[_0x2b01('0x2a')]=function(_0x593692,_0x26cc17){var _0x230cd2={},_0x2365f3={},_0x4e9abd={'count':0x0,'rows':[]};var _0x1b68e2=_[_0x2b01('0x2b')](db[_0x2b01('0x2c')][_0x2b01('0x2d')],function(_0x13f653){return{'name':_0x13f653[_0x2b01('0x2e')],'type':_0x13f653[_0x2b01('0x2f')][_0x2b01('0x30')]};});_0x2365f3[_0x2b01('0x31')]=_['map'](_0x1b68e2,'name');_0x2365f3['query']=_[_0x2b01('0x32')](_0x593692[_0x2b01('0x33')]);_0x2365f3[_0x2b01('0x34')]=_[_0x2b01('0x35')](_0x2365f3[_0x2b01('0x31')],_0x2365f3['query']);_0x230cd2['attributes']=_['intersection'](_0x2365f3[_0x2b01('0x31')],qs[_0x2b01('0x36')](_0x593692[_0x2b01('0x33')][_0x2b01('0x36')]));_0x230cd2[_0x2b01('0x37')]=_0x230cd2['attributes']['length']?_0x230cd2['attributes']:_0x2365f3['model'];if(!_0x593692[_0x2b01('0x33')]['hasOwnProperty'](_0x2b01('0x38'))){_0x230cd2['limit']=qs[_0x2b01('0x1c')](_0x593692['query']['limit']);_0x230cd2[_0x2b01('0x1e')]=qs[_0x2b01('0x1e')](_0x593692[_0x2b01('0x33')][_0x2b01('0x1e')]);}_0x230cd2['order']=qs[_0x2b01('0x39')](_0x593692['query'][_0x2b01('0x39')]);_0x230cd2['where']=qs['filters'](_[_0x2b01('0x3a')](_0x593692[_0x2b01('0x33')],_0x2365f3[_0x2b01('0x34')]),_0x1b68e2);if(_0x593692['query'][_0x2b01('0x3b')]){_0x230cd2[_0x2b01('0x3c')]=_[_0x2b01('0x3d')](_0x230cd2[_0x2b01('0x3c')],{'$or':_['map'](_0x1b68e2,function(_0x5ccab7){if(_0x5ccab7[_0x2b01('0x2f')]!==_0x2b01('0x3e')){var _0x37ed1d={};_0x37ed1d[_0x5ccab7[_0x2b01('0x29')]]={'$like':'%'+_0x593692[_0x2b01('0x33')]['filter']+'%'};return _0x37ed1d;}})});}_0x230cd2=_[_0x2b01('0x3d')]({},_0x230cd2,_0x593692[_0x2b01('0x3f')]);var _0x16879d={'where':_0x230cd2[_0x2b01('0x3c')]};return db[_0x2b01('0x2c')]['count'](_0x16879d)[_0x2b01('0x25')](function(_0x36fe2d){_0x4e9abd[_0x2b01('0x1d')]=_0x36fe2d;if(_0x593692['query']['includeAll']){_0x230cd2['include']=[{'all':!![]}];}return db[_0x2b01('0x2c')][_0x2b01('0x40')](_0x230cd2);})[_0x2b01('0x25')](function(_0x2dbc5c){_0x4e9abd[_0x2b01('0x41')]=_0x2dbc5c;return _0x4e9abd;})[_0x2b01('0x25')](respondWithFilteredResult(_0x26cc17,_0x230cd2))['catch'](handleError(_0x26cc17,null));};exports[_0x2b01('0x42')]=function(_0x5cc723,_0x425dda){var _0x113951={'raw':![],'where':{'id':_0x5cc723[_0x2b01('0x43')]['id']}},_0x5a85d9={};_0x5a85d9[_0x2b01('0x31')]=_[_0x2b01('0x32')](db[_0x2b01('0x2c')][_0x2b01('0x2d')]);_0x5a85d9[_0x2b01('0x33')]=_[_0x2b01('0x32')](_0x5cc723['query']);_0x5a85d9[_0x2b01('0x34')]=_['intersection'](_0x5a85d9['model'],_0x5a85d9[_0x2b01('0x33')]);_0x113951[_0x2b01('0x37')]=_['intersection'](_0x5a85d9[_0x2b01('0x31')],qs[_0x2b01('0x36')](_0x5cc723[_0x2b01('0x33')][_0x2b01('0x36')]));_0x113951[_0x2b01('0x37')]=_0x113951[_0x2b01('0x37')]['length']?_0x113951[_0x2b01('0x37')]:_0x5a85d9[_0x2b01('0x31')];if(_0x5cc723[_0x2b01('0x33')][_0x2b01('0x44')]){_0x113951['include']=[{'all':!![]}];}_0x113951=_[_0x2b01('0x3d')]({},_0x113951,_0x5cc723[_0x2b01('0x3f')]);return db['SalesforceAccount'][_0x2b01('0x45')](_0x113951)[_0x2b01('0x25')](handleEntityNotFound(_0x425dda,null))[_0x2b01('0x25')](respondWithResult(_0x425dda,null))[_0x2b01('0x46')](handleError(_0x425dda,null));};exports[_0x2b01('0x47')]=function(_0xcc73c7,_0x41b344){return db['SalesforceAccount'][_0x2b01('0x47')](_0xcc73c7[_0x2b01('0x48')],{})[_0x2b01('0x25')](respondWithResult(_0x41b344,0xc9))[_0x2b01('0x46')](handleError(_0x41b344,null));};exports[_0x2b01('0x24')]=function(_0x205032,_0xf64c9){if(_0x205032[_0x2b01('0x48')]['id']){delete _0x205032['body']['id'];}return db[_0x2b01('0x2c')][_0x2b01('0x45')]({'where':{'id':_0x205032[_0x2b01('0x43')]['id']}})[_0x2b01('0x25')](handleEntityNotFound(_0xf64c9,null))['then'](saveUpdates(_0x205032['body'],null))[_0x2b01('0x25')](respondWithResult(_0xf64c9,null))['catch'](handleError(_0xf64c9,null));};exports[_0x2b01('0x26')]=function(_0x2e3ec8,_0x4c4a59){return db['SalesforceAccount'][_0x2b01('0x45')]({'where':{'id':_0x2e3ec8[_0x2b01('0x43')]['id']}})[_0x2b01('0x25')](handleEntityNotFound(_0x4c4a59,null))[_0x2b01('0x25')](removeEntity(_0x4c4a59,null))['catch'](handleError(_0x4c4a59,null));};exports[_0x2b01('0x49')]=function(_0x59a22c,_0x19e756,_0x364f99){var _0x249c9d={};var _0xeef65d={};var _0x19321c;var _0x512dd6;return db[_0x2b01('0x2c')][_0x2b01('0x4a')]({'where':{'id':_0x59a22c[_0x2b01('0x43')]['id']}})[_0x2b01('0x25')](handleEntityNotFound(_0x19e756,null))[_0x2b01('0x25')](function(_0x1f8186){if(_0x1f8186){_0x19321c=_0x1f8186;_0xeef65d['model']=_[_0x2b01('0x32')](db[_0x2b01('0x4b')]['rawAttributes']);_0xeef65d[_0x2b01('0x33')]=_[_0x2b01('0x32')](_0x59a22c[_0x2b01('0x33')]);_0xeef65d[_0x2b01('0x34')]=_['intersection'](_0xeef65d[_0x2b01('0x31')],_0xeef65d['query']);_0x249c9d['attributes']=_[_0x2b01('0x35')](_0xeef65d[_0x2b01('0x31')],qs[_0x2b01('0x36')](_0x59a22c['query'][_0x2b01('0x36')]));_0x249c9d[_0x2b01('0x37')]=_0x249c9d['attributes']['length']?_0x249c9d[_0x2b01('0x37')]:_0xeef65d[_0x2b01('0x31')];_0x249c9d['order']=qs[_0x2b01('0x39')](_0x59a22c[_0x2b01('0x33')][_0x2b01('0x39')]);_0x249c9d[_0x2b01('0x3c')]=qs['filters'](_[_0x2b01('0x3a')](_0x59a22c[_0x2b01('0x33')],_0xeef65d[_0x2b01('0x34')]));if(_0x59a22c[_0x2b01('0x33')][_0x2b01('0x3b')]){_0x249c9d['where']=_[_0x2b01('0x3d')](_0x249c9d['where'],{'$or':_[_0x2b01('0x2b')](_0x249c9d['attributes'],function(_0x46b284){var _0x25476f={};_0x25476f[_0x46b284]={'$like':'%'+_0x59a22c[_0x2b01('0x33')]['filter']+'%'};return _0x25476f;})});}_0x249c9d=_[_0x2b01('0x3d')]({},_0x249c9d,_0x59a22c['options']);return _0x19321c['getConfigurations'](_0x249c9d);}})[_0x2b01('0x25')](function(_0x19a284){if(_0x19a284){_0x512dd6=_0x19a284['length'];if(!_0x59a22c[_0x2b01('0x33')][_0x2b01('0x4c')](_0x2b01('0x38'))){_0x249c9d[_0x2b01('0x1c')]=qs[_0x2b01('0x1c')](_0x59a22c[_0x2b01('0x33')][_0x2b01('0x1c')]);_0x249c9d['offset']=qs[_0x2b01('0x1e')](_0x59a22c[_0x2b01('0x33')][_0x2b01('0x1e')]);}return _0x19321c[_0x2b01('0x49')](_0x249c9d);}})['then'](function(_0x138c2f){if(_0x138c2f){return _0x138c2f?{'count':_0x512dd6,'rows':_0x138c2f}:null;}})['then'](respondWithResult(_0x19e756,null))[_0x2b01('0x46')](handleError(_0x19e756,null));};exports[_0x2b01('0x4d')]=function(_0xcaec0c,_0xd6299a,_0x3f539e){if(_0xcaec0c[_0x2b01('0x48')]['id']){delete _0xcaec0c[_0x2b01('0x48')]['id'];}return db[_0x2b01('0x2c')][_0x2b01('0x4a')]({'where':{'id':_0xcaec0c[_0x2b01('0x43')]['id']}})[_0x2b01('0x25')](handleEntityNotFound(_0xd6299a,null))['then'](function(_0x4de082){if(_0x4de082){_0xcaec0c['body'][_0x2b01('0x4e')]=_0x4de082['id'];_0xcaec0c['body'][_0x2b01('0x4f')]=integrations[_0x2b01('0x50')](_0xcaec0c[_0x2b01('0x48')][_0x2b01('0x51')],_0xcaec0c[_0x2b01('0x48')][_0x2b01('0x2f')]);_0xcaec0c[_0x2b01('0x48')][_0x2b01('0x52')]=integrations[_0x2b01('0x53')](_0xcaec0c[_0x2b01('0x48')][_0x2b01('0x51')],_0xcaec0c[_0x2b01('0x48')][_0x2b01('0x2f')]);return db['SalesforceConfiguration']['create'](_0xcaec0c['body'],{'include':[{'model':db[_0x2b01('0x54')],'as':_0x2b01('0x4f')},{'model':db[_0x2b01('0x54')],'as':_0x2b01('0x52')}]});}return null;})['then'](respondWithResult(_0xd6299a,null))[_0x2b01('0x46')](handleError(_0xd6299a,null));};exports[_0x2b01('0x55')]=function(_0x729bb0,_0x4f9a51,_0x2317c4){var _0x47064c;var _0x419bf3='';var _0x925709=_0x2b01('0x56');return db['SalesforceAccount'][_0x2b01('0x4a')]({'where':{'id':_0x729bb0[_0x2b01('0x43')]['id']},'attributes':['id','remoteUri','clientId',_0x2b01('0x57'),'username','password',_0x2b01('0x58')]})[_0x2b01('0x25')](handleEntityNotFound(_0x4f9a51,null))[_0x2b01('0x25')](function(_0x316bc8){if(_0x316bc8){_0x419bf3=_0x316bc8[_0x2b01('0x59')];var _0xd3779f=_0x419bf3[_0x2b01('0x5a')](-0x1);if(_0xd3779f==='/'){_0x419bf3=_0x419bf3['substring'](0x0,_0x419bf3[_0x2b01('0x5b')](_0xd3779f));}_0x47064c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x419bf3,'clientId':_0x316bc8[_0x2b01('0x5c')],'clientSecret':_0x316bc8[_0x2b01('0x57')]}});return _0x47064c['login'](_0x316bc8['username'],_0x316bc8[_0x2b01('0x5d')][_0x2b01('0x5e')](_0x316bc8[_0x2b01('0x58')]));}})[_0x2b01('0x25')](function(_0x26415b){if(_0x26415b){if(!_[_0x2b01('0x5f')](_0x729bb0[_0x2b01('0x33')]['ticketType'])){_0x925709=_0x729bb0[_0x2b01('0x33')][_0x2b01('0x60')];}return _0x47064c[_0x2b01('0x61')](_0x925709)[_0x2b01('0x62')]();}})[_0x2b01('0x25')](function(_0x22de36){var _0x22aa1b=[_0x2b01('0x63'),_0x2b01('0x64'),_0x2b01('0x65'),_0x2b01('0x66'),_0x2b01('0x67'),'Description'];var _0x69154a=[_0x2b01('0x68'),_0x2b01('0x69'),_0x2b01('0x6a'),_0x2b01('0x6b'),'email',_0x2b01('0x6c'),_0x2b01('0x6d')];if(_0x22de36){_[_0x2b01('0x6e')](_0x22de36['fields'],function(_0x326063){return _0x22aa1b[_0x2b01('0x6f')](_0x326063['name'])||!_0x69154a[_0x2b01('0x6f')](_0x326063['type']);});return{'count':_0x22de36[_0x2b01('0x36')][_0x2b01('0x70')],'rows':_[_0x2b01('0x2b')](_0x22de36['fields'],function(_0x48ee81){return{'id':_0x48ee81[_0x2b01('0x29')],'name':_0x48ee81['label'],'custom':_0x48ee81[_0x2b01('0x71')],'options':_0x48ee81[_0x2b01('0x72')][_0x2b01('0x70')]>0x0?_[_0x2b01('0x2b')](_0x48ee81[_0x2b01('0x72')],function(_0x2abb9b){return{'name':_0x2abb9b[_0x2b01('0x73')],'value':_0x2abb9b[_0x2b01('0x74')]};}):_0x48ee81[_0x2b01('0x2f')]==_0x2b01('0x6b')?[{'name':'True','value':_0x2b01('0x75')},{'name':_0x2b01('0x76'),'value':_0x2b01('0x77')}]:[]};})};}})[_0x2b01('0x25')](respondWithResult(_0x4f9a51,null))[_0x2b01('0x46')](function(_0xa3b62){var _0x152c66=_0x729bb0['query']['test']?0x1f4:_0xa3b62['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2b01('0x55'),_0x152c66,JSON['stringify'](_0xa3b62));delete _0xa3b62['name'];if(_0x152c66===0x191){_0x152c66=0x190;}_0x4f9a51[_0x2b01('0x19')](_0x152c66)[_0x2b01('0x78')](_0x729bb0[_0x2b01('0x33')]['test']?{'message':_0x2b01('0x79'),'statusCode':_0xa3b62['statusCode']}:_0xa3b62);});}; \ No newline at end of file +var _0x9d26=['phone','remove','includes','picklistValues','label','boolean','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','map','SalesforceAccount','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','sobject','describe','ActivityDate','Subject','Description','string','int','picklist','email'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x9d26,0xf7));var _0x69d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d26[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x69d2('0x0'));var rimraf=require(_0x69d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69d2('0x2'));var rp=require(_0x69d2('0x3'));var moment=require(_0x69d2('0x4'));var BPromise=require(_0x69d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x69d2('0x6'));var sox=require(_0x69d2('0x7'));var csv=require(_0x69d2('0x8'));var ejs=require(_0x69d2('0x9'));var fs=require('fs');var fs_extra=require(_0x69d2('0xa'));var _=require(_0x69d2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69d2('0xc'));var toCsv=require(_0x69d2('0x8'));var querystring=require(_0x69d2('0xd'));var Papa=require(_0x69d2('0xe'));var Redis=require('ioredis');var authService=require(_0x69d2('0xf'));var qs=require(_0x69d2('0x10'));var as=require(_0x69d2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69d2('0x12'))(_0x69d2('0x13'));var utils=require(_0x69d2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x69d2('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x69d2('0x16'));function respondWithStatusCode(_0x272035,_0x238676){_0x238676=_0x238676||0xcc;return function(_0x2f9350){if(_0x2f9350){return _0x272035[_0x69d2('0x17')](_0x238676);}return _0x272035[_0x69d2('0x18')](_0x238676)[_0x69d2('0x19')]();};}function respondWithResult(_0xcc5dbd,_0x1cff97){_0x1cff97=_0x1cff97||0xc8;return function(_0x1ce94e){if(_0x1ce94e){return _0xcc5dbd['status'](_0x1cff97)[_0x69d2('0x1a')](_0x1ce94e);}};}function respondWithFilteredResult(_0x10f130,_0x2f8657){return function(_0x2913c){if(_0x2913c){var _0x5e88ab=typeof _0x2f8657[_0x69d2('0x1b')]===_0x69d2('0x1c')&&typeof _0x2f8657[_0x69d2('0x1d')]==='undefined';var _0x18db87=_0x2913c['count'];var _0x2f2339=_0x5e88ab?0x0:_0x2f8657[_0x69d2('0x1b')];var _0x4260a4=_0x5e88ab?_0x2913c[_0x69d2('0x1e')]:_0x2f8657['offset']+_0x2f8657[_0x69d2('0x1d')];var _0x273c34;if(_0x4260a4>=_0x18db87){_0x4260a4=_0x18db87;_0x273c34=0xc8;}else{_0x273c34=0xce;}_0x10f130[_0x69d2('0x18')](_0x273c34);return _0x10f130[_0x69d2('0x1f')](_0x69d2('0x20'),_0x2f2339+'-'+_0x4260a4+'/'+_0x18db87)['json'](_0x2913c);}return null;};}function patchUpdates(_0x25727a){return function(_0x154140){try{jsonpatch[_0x69d2('0x21')](_0x154140,_0x25727a,!![]);}catch(_0x57ce2a){return BPromise[_0x69d2('0x22')](_0x57ce2a);}return _0x154140['save']();};}function saveUpdates(_0x6bd29a,_0x2c2aee){return function(_0x2038fa){if(_0x2038fa){return _0x2038fa[_0x69d2('0x23')](_0x6bd29a)[_0x69d2('0x24')](function(_0x3a51b0){return _0x3a51b0;});}return null;};}function removeEntity(_0x4ee32f,_0x52ddd8){return function(_0x3595dc){if(_0x3595dc){return _0x3595dc[_0x69d2('0x25')]()[_0x69d2('0x24')](function(){_0x4ee32f[_0x69d2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b6f4,_0x27fab7){return function(_0x9c0b0f){if(!_0x9c0b0f){_0x11b6f4[_0x69d2('0x17')](0x194);}return _0x9c0b0f;};}function handleError(_0x4e95c1,_0x3c121c){_0x3c121c=_0x3c121c||0x1f4;return function(_0x2f4781){logger['error'](_0x2f4781['stack']);if(_0x2f4781[_0x69d2('0x26')]){delete _0x2f4781[_0x69d2('0x26')];}_0x4e95c1['status'](_0x3c121c)[_0x69d2('0x27')](_0x2f4781);};}exports['index']=function(_0x1b9b7d,_0x2b4de7){var _0x2d3a56={},_0x5566c9={},_0x5b5ef0={'count':0x0,'rows':[]};var _0x338b15=_[_0x69d2('0x28')](db[_0x69d2('0x29')][_0x69d2('0x2a')],function(_0x503f30){return{'name':_0x503f30['fieldName'],'type':_0x503f30[_0x69d2('0x2b')]['key']};});_0x5566c9['model']=_[_0x69d2('0x28')](_0x338b15,_0x69d2('0x26'));_0x5566c9[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0x1b9b7d['query']);_0x5566c9['filters']=_[_0x69d2('0x2e')](_0x5566c9[_0x69d2('0x2f')],_0x5566c9[_0x69d2('0x2c')]);_0x2d3a56[_0x69d2('0x30')]=_[_0x69d2('0x2e')](_0x5566c9[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x31')]));_0x2d3a56[_0x69d2('0x30')]=_0x2d3a56[_0x69d2('0x30')][_0x69d2('0x32')]?_0x2d3a56[_0x69d2('0x30')]:_0x5566c9['model'];if(!_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x33')](_0x69d2('0x34'))){_0x2d3a56[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x1d')]);_0x2d3a56[_0x69d2('0x1b')]=qs[_0x69d2('0x1b')](_0x1b9b7d[_0x69d2('0x2c')]['offset']);}_0x2d3a56[_0x69d2('0x35')]=qs[_0x69d2('0x36')](_0x1b9b7d[_0x69d2('0x2c')]['sort']);_0x2d3a56[_0x69d2('0x37')]=qs[_0x69d2('0x38')](_[_0x69d2('0x39')](_0x1b9b7d['query'],_0x5566c9['filters']),_0x338b15);if(_0x1b9b7d['query'][_0x69d2('0x3a')]){_0x2d3a56[_0x69d2('0x37')]=_['merge'](_0x2d3a56[_0x69d2('0x37')],{'$or':_[_0x69d2('0x28')](_0x338b15,function(_0x529c1a){if(_0x529c1a[_0x69d2('0x2b')]!==_0x69d2('0x3b')){var _0x114d0f={};_0x114d0f[_0x529c1a[_0x69d2('0x26')]]={'$like':'%'+_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x3a')]+'%'};return _0x114d0f;}})});}_0x2d3a56=_[_0x69d2('0x3c')]({},_0x2d3a56,_0x1b9b7d['options']);var _0x3472b8={'where':_0x2d3a56[_0x69d2('0x37')]};return db[_0x69d2('0x29')]['count'](_0x3472b8)[_0x69d2('0x24')](function(_0x30b80d){_0x5b5ef0[_0x69d2('0x1e')]=_0x30b80d;if(_0x1b9b7d['query'][_0x69d2('0x3d')]){_0x2d3a56[_0x69d2('0x3e')]=[{'all':!![]}];}return db[_0x69d2('0x29')][_0x69d2('0x3f')](_0x2d3a56);})[_0x69d2('0x24')](function(_0x4f6c61){_0x5b5ef0[_0x69d2('0x40')]=_0x4f6c61;return _0x5b5ef0;})[_0x69d2('0x24')](respondWithFilteredResult(_0x2b4de7,_0x2d3a56))[_0x69d2('0x41')](handleError(_0x2b4de7,null));};exports[_0x69d2('0x42')]=function(_0xdfba33,_0x2f624c){var _0x58b634={'raw':![],'where':{'id':_0xdfba33[_0x69d2('0x43')]['id']}},_0x1d23df={};_0x1d23df[_0x69d2('0x2f')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x1d23df[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0xdfba33[_0x69d2('0x2c')]);_0x1d23df[_0x69d2('0x38')]=_[_0x69d2('0x2e')](_0x1d23df[_0x69d2('0x2f')],_0x1d23df[_0x69d2('0x2c')]);_0x58b634[_0x69d2('0x30')]=_[_0x69d2('0x2e')](_0x1d23df[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0xdfba33['query']['fields']));_0x58b634[_0x69d2('0x30')]=_0x58b634['attributes'][_0x69d2('0x32')]?_0x58b634[_0x69d2('0x30')]:_0x1d23df[_0x69d2('0x2f')];if(_0xdfba33[_0x69d2('0x2c')]['includeAll']){_0x58b634[_0x69d2('0x3e')]=[{'all':!![]}];}_0x58b634=_[_0x69d2('0x3c')]({},_0x58b634,_0xdfba33['options']);return db['SalesforceAccount']['find'](_0x58b634)[_0x69d2('0x24')](handleEntityNotFound(_0x2f624c,null))[_0x69d2('0x24')](respondWithResult(_0x2f624c,null))[_0x69d2('0x41')](handleError(_0x2f624c,null));};exports[_0x69d2('0x44')]=function(_0x1bfd43,_0xad8d6e){return db['SalesforceAccount'][_0x69d2('0x44')](_0x1bfd43[_0x69d2('0x45')],{})['then'](respondWithResult(_0xad8d6e,0xc9))[_0x69d2('0x41')](handleError(_0xad8d6e,null));};exports[_0x69d2('0x23')]=function(_0x353c44,_0x3dcc68){if(_0x353c44['body']['id']){delete _0x353c44[_0x69d2('0x45')]['id'];}return db[_0x69d2('0x29')][_0x69d2('0x46')]({'where':{'id':_0x353c44['params']['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x3dcc68,null))[_0x69d2('0x24')](saveUpdates(_0x353c44[_0x69d2('0x45')],null))['then'](respondWithResult(_0x3dcc68,null))[_0x69d2('0x41')](handleError(_0x3dcc68,null));};exports[_0x69d2('0x25')]=function(_0x112041,_0x57109c){return db[_0x69d2('0x29')][_0x69d2('0x46')]({'where':{'id':_0x112041[_0x69d2('0x43')]['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x57109c,null))['then'](removeEntity(_0x57109c,null))['catch'](handleError(_0x57109c,null));};exports[_0x69d2('0x47')]=function(_0x26e558,_0xb62631,_0x279d3d){var _0x3c72db={};var _0x79a1a5={};var _0x2ec137;var _0x4883a1;return db[_0x69d2('0x29')][_0x69d2('0x48')]({'where':{'id':_0x26e558[_0x69d2('0x43')]['id']}})['then'](handleEntityNotFound(_0xb62631,null))[_0x69d2('0x24')](function(_0x9ec3ea){if(_0x9ec3ea){_0x2ec137=_0x9ec3ea;_0x79a1a5['model']=_[_0x69d2('0x2d')](db[_0x69d2('0x49')][_0x69d2('0x2a')]);_0x79a1a5[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0x26e558[_0x69d2('0x2c')]);_0x79a1a5[_0x69d2('0x38')]=_['intersection'](_0x79a1a5[_0x69d2('0x2f')],_0x79a1a5[_0x69d2('0x2c')]);_0x3c72db[_0x69d2('0x30')]=_['intersection'](_0x79a1a5[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x31')]));_0x3c72db['attributes']=_0x3c72db[_0x69d2('0x30')]['length']?_0x3c72db[_0x69d2('0x30')]:_0x79a1a5['model'];_0x3c72db[_0x69d2('0x35')]=qs[_0x69d2('0x36')](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x36')]);_0x3c72db[_0x69d2('0x37')]=qs[_0x69d2('0x38')](_[_0x69d2('0x39')](_0x26e558[_0x69d2('0x2c')],_0x79a1a5[_0x69d2('0x38')]));if(_0x26e558[_0x69d2('0x2c')][_0x69d2('0x3a')]){_0x3c72db[_0x69d2('0x37')]=_[_0x69d2('0x3c')](_0x3c72db['where'],{'$or':_[_0x69d2('0x28')](_0x3c72db[_0x69d2('0x30')],function(_0x5d0698){var _0x5477be={};_0x5477be[_0x5d0698]={'$like':'%'+_0x26e558[_0x69d2('0x2c')][_0x69d2('0x3a')]+'%'};return _0x5477be;})});}_0x3c72db=_[_0x69d2('0x3c')]({},_0x3c72db,_0x26e558['options']);return _0x2ec137[_0x69d2('0x47')](_0x3c72db);}})['then'](function(_0x41da15){if(_0x41da15){_0x4883a1=_0x41da15[_0x69d2('0x32')];if(!_0x26e558[_0x69d2('0x2c')][_0x69d2('0x33')](_0x69d2('0x34'))){_0x3c72db[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x26e558['query'][_0x69d2('0x1d')]);_0x3c72db[_0x69d2('0x1b')]=qs['offset'](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x1b')]);}return _0x2ec137[_0x69d2('0x47')](_0x3c72db);}})[_0x69d2('0x24')](function(_0x350376){if(_0x350376){return _0x350376?{'count':_0x4883a1,'rows':_0x350376}:null;}})[_0x69d2('0x24')](respondWithResult(_0xb62631,null))[_0x69d2('0x41')](handleError(_0xb62631,null));};exports['addConfiguration']=function(_0x293240,_0x6391a7,_0x5b3940){if(_0x293240[_0x69d2('0x45')]['id']){delete _0x293240[_0x69d2('0x45')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x293240['params']['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x6391a7,null))[_0x69d2('0x24')](function(_0x596f5c){if(_0x596f5c){_0x293240[_0x69d2('0x45')][_0x69d2('0x4a')]=_0x596f5c['id'];_0x293240[_0x69d2('0x45')]['Subjects']=integrations[_0x69d2('0x4b')](_0x293240[_0x69d2('0x45')][_0x69d2('0x4c')],_0x293240[_0x69d2('0x45')][_0x69d2('0x2b')]);_0x293240['body'][_0x69d2('0x4d')]=integrations[_0x69d2('0x4e')](_0x293240[_0x69d2('0x45')][_0x69d2('0x4c')],_0x293240[_0x69d2('0x45')][_0x69d2('0x2b')]);return db[_0x69d2('0x49')][_0x69d2('0x44')](_0x293240['body'],{'include':[{'model':db[_0x69d2('0x4f')],'as':_0x69d2('0x50')},{'model':db['SalesforceField'],'as':_0x69d2('0x4d')}]});}return null;})[_0x69d2('0x24')](respondWithResult(_0x6391a7,null))[_0x69d2('0x41')](handleError(_0x6391a7,null));};exports[_0x69d2('0x51')]=function(_0x142287,_0x3d183d,_0x54993c){var _0x50acba;var _0x5d923e='';var _0x1535ed='Task';return db[_0x69d2('0x29')][_0x69d2('0x48')]({'where':{'id':_0x142287[_0x69d2('0x43')]['id']},'attributes':['id',_0x69d2('0x52'),_0x69d2('0x53'),_0x69d2('0x54'),_0x69d2('0x55'),'password',_0x69d2('0x56')]})['then'](handleEntityNotFound(_0x3d183d,null))[_0x69d2('0x24')](function(_0xa82737){if(_0xa82737){_0x5d923e=_0xa82737['remoteUri'];var _0x39c592=_0x5d923e[_0x69d2('0x57')](-0x1);if(_0x39c592==='/'){_0x5d923e=_0x5d923e[_0x69d2('0x58')](0x0,_0x5d923e[_0x69d2('0x59')](_0x39c592));}_0x50acba=new jsforce[(_0x69d2('0x5a'))]({'oauth2':{'loginUrl':_0x5d923e,'clientId':_0xa82737[_0x69d2('0x53')],'clientSecret':_0xa82737['clientSecret']}});return _0x50acba[_0x69d2('0x5b')](_0xa82737[_0x69d2('0x55')],_0xa82737[_0x69d2('0x5c')][_0x69d2('0x5d')](_0xa82737[_0x69d2('0x56')]));}})[_0x69d2('0x24')](function(_0x2d9e9d){if(_0x2d9e9d){if(!_[_0x69d2('0x5e')](_0x142287[_0x69d2('0x2c')]['ticketType'])){_0x1535ed=_0x142287['query']['ticketType'];}return _0x50acba[_0x69d2('0x5f')](_0x1535ed)[_0x69d2('0x60')]();}})[_0x69d2('0x24')](function(_0x33d2b5){var _0x3b9c03=['OwnerId',_0x69d2('0x61'),'IsReminderSet','IsRecurrence',_0x69d2('0x62'),_0x69d2('0x63')];var _0x2916c5=[_0x69d2('0x64'),_0x69d2('0x65'),_0x69d2('0x66'),'boolean',_0x69d2('0x67'),'textarea',_0x69d2('0x68')];if(_0x33d2b5){_[_0x69d2('0x69')](_0x33d2b5[_0x69d2('0x31')],function(_0x54c0df){return _0x3b9c03[_0x69d2('0x6a')](_0x54c0df['name'])||!_0x2916c5[_0x69d2('0x6a')](_0x54c0df['type']);});return{'count':_0x33d2b5[_0x69d2('0x31')][_0x69d2('0x32')],'rows':_['map'](_0x33d2b5[_0x69d2('0x31')],function(_0x4d0153){return{'id':_0x4d0153[_0x69d2('0x26')],'name':_0x4d0153['label'],'custom':_0x4d0153['custom'],'options':_0x4d0153[_0x69d2('0x6b')][_0x69d2('0x32')]>0x0?_['map'](_0x4d0153[_0x69d2('0x6b')],function(_0x44e291){return{'name':_0x44e291[_0x69d2('0x6c')],'value':_0x44e291['value']};}):_0x4d0153[_0x69d2('0x2b')]==_0x69d2('0x6d')?[{'name':_0x69d2('0x6e'),'value':_0x69d2('0x6f')},{'name':'False','value':_0x69d2('0x70')}]:[]};})};}})[_0x69d2('0x24')](respondWithResult(_0x3d183d,null))[_0x69d2('0x41')](function(_0x36bd11){var _0x33a33e=_0x142287['query'][_0x69d2('0x71')]?0x1f4:_0x36bd11[_0x69d2('0x72')]||0x1f4;logger['error'](_0x69d2('0x73'),_0x69d2('0x51'),_0x33a33e,JSON['stringify'](_0x36bd11));delete _0x36bd11[_0x69d2('0x26')];if(_0x33a33e===0x191){_0x33a33e=0x190;}_0x3d183d[_0x69d2('0x18')](_0x33a33e)[_0x69d2('0x27')](_0x142287[_0x69d2('0x2c')]['test']?{'message':_0x69d2('0x74'),'statusCode':_0x36bd11['statusCode']}:_0x36bd11);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index dbfa410..fc6464e 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 _0x10d8=['exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x10d8,0xee));var _0x810d=function(_0x488876,_0x6baec9){_0x488876=_0x488876-0x0;var _0x58e179=_0x10d8[_0x488876];return _0x58e179;};'use strict';var _=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var logger=require(_0x810d('0x2'))('api');var moment=require(_0x810d('0x3'));var BPromise=require(_0x810d('0x4'));var rp=require(_0x810d('0x5'));var fs=require('fs');var path=require(_0x810d('0x6'));var rimraf=require(_0x810d('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x810d('0x8'));module[_0x810d('0x9')]=function(_0xeebfbe,_0x3a4786){return _0xeebfbe[_0x810d('0xa')](_0x810d('0xb'),attributes,{'tableName':_0x810d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb29=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x15bc05,_0x5e1bd8){var _0x251683=function(_0x2fda6e){while(--_0x2fda6e){_0x15bc05['push'](_0x15bc05['shift']());}};_0x251683(++_0x5e1bd8);}(_0xfb29,0x119));var _0x9fb2=function(_0x27cded,_0xb38344){_0x27cded=_0x27cded-0x0;var _0x183a0a=_0xfb29[_0x27cded];return _0x183a0a;};'use strict';var _=require(_0x9fb2('0x0'));var util=require('util');var logger=require(_0x9fb2('0x1'))('api');var moment=require(_0x9fb2('0x2'));var BPromise=require('bluebird');var rp=require(_0x9fb2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fb2('0x4'));var config=require('../../config/environment');var attributes=require(_0x9fb2('0x5'));var integrations=require(_0x9fb2('0x6'));module[_0x9fb2('0x7')]=function(_0x2f9a3a,_0xc26c95){return _0x2f9a3a[_0x9fb2('0x8')](_0x9fb2('0x9'),attributes,{'tableName':_0x9fb2('0xa'),'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 8858a47..c684bba 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 _0x9105=['client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','map','include','model','ShowSalesforceAccount','find','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b5ebf,_0x3ecfcc){var _0x154546=function(_0x5bd577){while(--_0x5bd577){_0x4b5ebf['push'](_0x4b5ebf['shift']());}};_0x154546(++_0x3ecfcc);}(_0x9105,0xc9));var _0x5910=function(_0x1335e1,_0x9f1072){_0x1335e1=_0x1335e1-0x0;var _0x2f92d5=_0x9105[_0x1335e1];return _0x2f92d5;};'use strict';var _=require(_0x5910('0x0'));var util=require('util');var moment=require(_0x5910('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5910('0x2'));var db=require(_0x5910('0x3'))['db'];var utils=require(_0x5910('0x4'));var logger=require(_0x5910('0x5'))(_0x5910('0x6'));var config=require(_0x5910('0x7'));var jayson=require(_0x5910('0x8'));var client=jayson[_0x5910('0x9')][_0x5910('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ac61d,_0x562ea6,_0x20a475){return new BPromise(function(_0x2c30e3,_0x3489d4){return client['request'](_0x2ac61d,_0x20a475)[_0x5910('0xb')](function(_0x542c09){logger[_0x5910('0xc')](_0x5910('0xd'),_0x562ea6,_0x5910('0xe'));logger[_0x5910('0xf')](_0x5910('0x10'),_0x562ea6,_0x5910('0xe'),JSON[_0x5910('0x11')](_0x542c09));if(_0x542c09[_0x5910('0x12')]){if(_0x542c09['error'][_0x5910('0x13')]===0x1f4){logger['error'](_0x5910('0xd'),_0x562ea6,_0x542c09[_0x5910('0x12')]['message']);return _0x3489d4(_0x542c09['error']['message']);}logger[_0x5910('0x12')](_0x5910('0xd'),_0x562ea6,_0x542c09[_0x5910('0x12')]['message']);return _0x2c30e3(_0x542c09[_0x5910('0x12')][_0x5910('0x14')]);}else{logger['info'](_0x5910('0xd'),_0x562ea6,'request\x20sent');_0x2c30e3(_0x542c09[_0x5910('0x15')][_0x5910('0x14')]);}})[_0x5910('0x16')](function(_0x54fa34){logger[_0x5910('0x12')](_0x5910('0xd'),_0x562ea6,_0x54fa34);_0x3489d4(_0x54fa34);});});}exports[_0x5910('0x17')]=function(_0x40c440){var _0xc25d79=this;return new Promise(function(_0x598c7b,_0x472198){return db[_0x5910('0x18')][_0x5910('0x19')]({'raw':_0x40c440[_0x5910('0x1a')]?_0x40c440['options'][_0x5910('0x1b')]===undefined?!![]:![]:!![],'where':_0x40c440[_0x5910('0x1a')]?_0x40c440[_0x5910('0x1a')][_0x5910('0x1c')]||null:null,'attributes':_0x40c440[_0x5910('0x1a')]?_0x40c440[_0x5910('0x1a')][_0x5910('0x1d')]||null:null,'limit':_0x40c440[_0x5910('0x1a')]?_0x40c440[_0x5910('0x1a')]['limit']||null:null,'include':_0x40c440['options']?_0x40c440[_0x5910('0x1a')]['include']?_[_0x5910('0x1e')](_0x40c440[_0x5910('0x1a')][_0x5910('0x1f')],function(_0xbe5e1a){return{'model':db[_0xbe5e1a[_0x5910('0x20')]],'as':_0xbe5e1a['as'],'attributes':_0xbe5e1a[_0x5910('0x1d')],'include':_0xbe5e1a['include']?_['map'](_0xbe5e1a['include'],function(_0x42f680){return{'model':db[_0x42f680[_0x5910('0x20')]],'as':_0x42f680['as'],'attributes':_0x42f680['attributes'],'include':_0x42f680[_0x5910('0x1f')]?_[_0x5910('0x1e')](_0x42f680['include'],function(_0x59c1f3){return{'model':db[_0x59c1f3[_0x5910('0x20')]],'as':_0x59c1f3['as'],'attributes':_0x59c1f3[_0x5910('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5910('0xb')](function(_0x57ca0a){logger[_0x5910('0xc')](_0x5910('0x17'),_0x40c440);logger[_0x5910('0xf')](_0x5910('0x17'),_0x40c440,JSON['stringify'](_0x57ca0a));_0x598c7b(_0x57ca0a);})[_0x5910('0x16')](function(_0x214999){logger[_0x5910('0x12')](_0x5910('0x17'),_0x214999[_0x5910('0x14')],_0x40c440);_0x472198(_0xc25d79['error'](0x1f4,_0x214999['message']));});});};exports[_0x5910('0x21')]=function(_0x33d318){var _0x5489e9=this;return new Promise(function(_0x10702b,_0x2e77da){return db['SalesforceAccount'][_0x5910('0x22')]({'raw':_0x33d318['options']?_0x33d318['options'][_0x5910('0x1b')]===undefined?!![]:![]:!![],'where':_0x33d318[_0x5910('0x1a')]?_0x33d318[_0x5910('0x1a')][_0x5910('0x1c')]||null:null,'attributes':_0x33d318[_0x5910('0x1a')]?_0x33d318[_0x5910('0x1a')][_0x5910('0x1d')]||null:null,'include':_0x33d318['options']?_0x33d318['options']['include']?_[_0x5910('0x1e')](_0x33d318['options'][_0x5910('0x1f')],function(_0x57fa62){return{'model':db[_0x57fa62[_0x5910('0x20')]],'as':_0x57fa62['as'],'attributes':_0x57fa62[_0x5910('0x1d')],'include':_0x57fa62['include']?_[_0x5910('0x1e')](_0x57fa62[_0x5910('0x1f')],function(_0x49db7a){return{'model':db[_0x49db7a['model']],'as':_0x49db7a['as'],'attributes':_0x49db7a[_0x5910('0x1d')],'include':_0x49db7a[_0x5910('0x1f')]?_['map'](_0x49db7a[_0x5910('0x1f')],function(_0x16f096){return{'model':db[_0x16f096['model']],'as':_0x16f096['as'],'attributes':_0x16f096[_0x5910('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5910('0xb')](function(_0x1847a6){logger['info'](_0x5910('0x21'),_0x33d318);logger[_0x5910('0xf')](_0x5910('0x21'),_0x33d318,JSON[_0x5910('0x11')](_0x1847a6));_0x10702b(_0x1847a6);})[_0x5910('0x16')](function(_0x4390f7){logger[_0x5910('0x12')]('ShowSalesforceAccount',_0x4390f7[_0x5910('0x14')],_0x33d318);_0x2e77da(_0x5489e9[_0x5910('0x12')](0x1f4,_0x4390f7[_0x5910('0x14')]));});});}; \ No newline at end of file +var _0x9228=['catch','ShowSalesforceAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','SalesforceAccount','findAll','options','where','attributes','limit','map','model','include','GetSalesforceAccount'];(function(_0x213ac4,_0x576b0a){var _0xd29598=function(_0x48bfcc){while(--_0x48bfcc){_0x213ac4['push'](_0x213ac4['shift']());}};_0xd29598(++_0x576b0a);}(_0x9228,0xf9));var _0x8922=function(_0x5b80ff,_0x38517e){_0x5b80ff=_0x5b80ff-0x0;var _0x3cb5f5=_0x9228[_0x5b80ff];return _0x3cb5f5;};'use strict';var _=require(_0x8922('0x0'));var util=require('util');var moment=require(_0x8922('0x1'));var BPromise=require('bluebird');var rs=require(_0x8922('0x2'));var fs=require('fs');var Redis=require(_0x8922('0x3'));var db=require(_0x8922('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8922('0x5'))(_0x8922('0x6'));var config=require(_0x8922('0x7'));var jayson=require(_0x8922('0x8'));var client=jayson[_0x8922('0x9')][_0x8922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x391baf,_0x2e8ac1,_0x2c1032){return new BPromise(function(_0x506c2f,_0x20c658){return client['request'](_0x391baf,_0x2c1032)[_0x8922('0xb')](function(_0x1175ac){logger[_0x8922('0xc')](_0x8922('0xd'),_0x2e8ac1,_0x8922('0xe'));logger[_0x8922('0xf')](_0x8922('0x10'),_0x2e8ac1,'request\x20sent',JSON['stringify'](_0x1175ac));if(_0x1175ac[_0x8922('0x11')]){if(_0x1175ac[_0x8922('0x11')][_0x8922('0x12')]===0x1f4){logger[_0x8922('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2e8ac1,_0x1175ac[_0x8922('0x11')]['message']);return _0x20c658(_0x1175ac['error']['message']);}logger['error'](_0x8922('0xd'),_0x2e8ac1,_0x1175ac[_0x8922('0x11')][_0x8922('0x13')]);return _0x506c2f(_0x1175ac['error'][_0x8922('0x13')]);}else{logger[_0x8922('0xc')](_0x8922('0xd'),_0x2e8ac1,_0x8922('0xe'));_0x506c2f(_0x1175ac[_0x8922('0x14')][_0x8922('0x13')]);}})['catch'](function(_0xde78eb){logger[_0x8922('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2e8ac1,_0xde78eb);_0x20c658(_0xde78eb);});});}exports['GetSalesforceAccount']=function(_0x42afdf){var _0x3624ab=this;return new Promise(function(_0x1242dd,_0x456a79){return db[_0x8922('0x15')][_0x8922('0x16')]({'raw':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')][_0x8922('0x18')]||null:null,'attributes':_0x42afdf[_0x8922('0x17')]?_0x42afdf['options'][_0x8922('0x19')]||null:null,'limit':_0x42afdf[_0x8922('0x17')]?_0x42afdf['options'][_0x8922('0x1a')]||null:null,'include':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')]['include']?_[_0x8922('0x1b')](_0x42afdf[_0x8922('0x17')]['include'],function(_0x29c13e){return{'model':db[_0x29c13e[_0x8922('0x1c')]],'as':_0x29c13e['as'],'attributes':_0x29c13e['attributes'],'include':_0x29c13e['include']?_['map'](_0x29c13e[_0x8922('0x1d')],function(_0x101793){return{'model':db[_0x101793['model']],'as':_0x101793['as'],'attributes':_0x101793[_0x8922('0x19')],'include':_0x101793[_0x8922('0x1d')]?_[_0x8922('0x1b')](_0x101793[_0x8922('0x1d')],function(_0x5f09f8){return{'model':db[_0x5f09f8[_0x8922('0x1c')]],'as':_0x5f09f8['as'],'attributes':_0x5f09f8[_0x8922('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x459bd9){logger[_0x8922('0xc')](_0x8922('0x1e'),_0x42afdf);logger[_0x8922('0xf')](_0x8922('0x1e'),_0x42afdf,JSON['stringify'](_0x459bd9));_0x1242dd(_0x459bd9);})[_0x8922('0x1f')](function(_0x5f4055){logger[_0x8922('0x11')](_0x8922('0x1e'),_0x5f4055[_0x8922('0x13')],_0x42afdf);_0x456a79(_0x3624ab[_0x8922('0x11')](0x1f4,_0x5f4055['message']));});});};exports[_0x8922('0x20')]=function(_0x1d37eb){var _0x35ba90=this;return new Promise(function(_0x56ead7,_0x28857d){return db[_0x8922('0x15')][_0x8922('0x21')]({'raw':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')][_0x8922('0x22')]===undefined?!![]:![]:!![],'where':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')]['where']||null:null,'attributes':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')][_0x8922('0x19')]||null:null,'include':_0x1d37eb['options']?_0x1d37eb[_0x8922('0x17')]['include']?_[_0x8922('0x1b')](_0x1d37eb['options'][_0x8922('0x1d')],function(_0x160d25){return{'model':db[_0x160d25['model']],'as':_0x160d25['as'],'attributes':_0x160d25[_0x8922('0x19')],'include':_0x160d25[_0x8922('0x1d')]?_[_0x8922('0x1b')](_0x160d25['include'],function(_0x219815){return{'model':db[_0x219815[_0x8922('0x1c')]],'as':_0x219815['as'],'attributes':_0x219815[_0x8922('0x19')],'include':_0x219815[_0x8922('0x1d')]?_['map'](_0x219815[_0x8922('0x1d')],function(_0x1d59e8){return{'model':db[_0x1d59e8['model']],'as':_0x1d59e8['as'],'attributes':_0x1d59e8[_0x8922('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8922('0xb')](function(_0x5c5ef9){logger['info']('ShowSalesforceAccount',_0x1d37eb);logger[_0x8922('0xf')](_0x8922('0x20'),_0x1d37eb,JSON['stringify'](_0x5c5ef9));_0x56ead7(_0x5c5ef9);})[_0x8922('0x1f')](function(_0x4b0f53){logger['error'](_0x8922('0x20'),_0x4b0f53['message'],_0x1d37eb);_0x28857d(_0x35ba90[_0x8922('0x11')](0x1f4,_0x4b0f53[_0x8922('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 31d2276..d87aaae 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0xcc51bc,_0x19bfb8){var _0x190c3f=function(_0x4c251d){while(--_0x4c251d){_0xcc51bc['push'](_0xcc51bc['shift']());}};_0x190c3f(++_0x19bfb8);}(_0x2ef3,0xba));var _0x32ef=function(_0x3555fc,_0xd9afcc){_0x3555fc=_0x3555fc-0x0;var _0x480684=_0x2ef3[_0x3555fc];return _0x480684;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x53e403,_0x43ed62){var _0x2d58db=function(_0x406acf){while(--_0x406acf){_0x53e403['push'](_0x53e403['shift']());}};_0x2d58db(++_0x43ed62);}(_0x2ef3,0xba));var _0x32ef=function(_0x17952d,_0x2ed477){_0x17952d=_0x17952d-0x0;var _0x1cada9=_0x2ef3[_0x17952d];return _0x1cada9;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7615ee0..4c67698 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 _0xd21b=['contact','lead','STRING','exports','ENUM','Task','Case','contact_lead','account_contact_lead','account','nothing'];(function(_0x122264,_0x16878a){var _0x4385a0=function(_0x2af3af){while(--_0x2af3af){_0x122264['push'](_0x122264['shift']());}};_0x4385a0(++_0x16878a);}(_0xd21b,0x9d));var _0xbd21=function(_0x2db025,_0x1cf6de){_0x2db025=_0x2db025-0x0;var _0x47afbe=_0xd21b[_0x2db025];return _0x47afbe;};'use strict';var Sequelize=require('sequelize');module[_0xbd21('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbd21('0x1')](_0xbd21('0x2'),_0xbd21('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xbd21('0x1')](_0xbd21('0x4'),'contact','lead',_0xbd21('0x5'),_0xbd21('0x6')),'defaultValue':_0xbd21('0x4')},'moduleCreate':{'type':Sequelize[_0xbd21('0x1')](_0xbd21('0x7'),_0xbd21('0x8'),_0xbd21('0x9'),_0xbd21('0x6')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xbd21('0xa')]},'additionalSearchContact':{'type':Sequelize[_0xbd21('0xa')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x678e=['sequelize','STRING','ENUM','contact','contact_lead','nothing','lead'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x678e,0xe0));var _0xe678=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x678e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xe678('0x0'));module['exports']={'name':{'type':Sequelize[_0xe678('0x1')]},'description':{'type':Sequelize[_0xe678('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xe678('0x2')]('contact_lead',_0xe678('0x3'),'lead','account_contact_lead','account'),'defaultValue':_0xe678('0x4')},'moduleCreate':{'type':Sequelize[_0xe678('0x2')](_0xe678('0x5'),_0xe678('0x3'),_0xe678('0x6'),'account'),'defaultValue':_0xe678('0x6')},'leadId':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xe678('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 2b9aefa..2c10afc 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 _0xf518=['Content-Range','json','apply','reject','save','update','then','error','stack','name','send','fieldName','type','map','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','find','catch','body','destroy','getFields','findOne','SalesforceField','length','filter','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xf518,0xd4));var _0x8f51=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0xf518[_0x7dbd65];return _0x33d551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f51('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f51('0x1'));var rp=require(_0x8f51('0x2'));var moment=require(_0x8f51('0x3'));var BPromise=require(_0x8f51('0x4'));var Mustache=require(_0x8f51('0x5'));var util=require(_0x8f51('0x6'));var path=require(_0x8f51('0x7'));var sox=require('sox');var csv=require(_0x8f51('0x8'));var ejs=require(_0x8f51('0x9'));var fs=require('fs');var fs_extra=require(_0x8f51('0xa'));var _=require(_0x8f51('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8f51('0xc'));var deskjs=require(_0x8f51('0xd'));var toCsv=require(_0x8f51('0x8'));var querystring=require(_0x8f51('0xe'));var Papa=require(_0x8f51('0xf'));var Redis=require(_0x8f51('0x10'));var authService=require(_0x8f51('0x11'));var qs=require(_0x8f51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f51('0x13'))('api');var utils=require(_0x8f51('0x14'));var config=require(_0x8f51('0x15'));var licenseUtil=require(_0x8f51('0x16'));var db=require(_0x8f51('0x17'))['db'];function respondWithStatusCode(_0x29cde0,_0x3848e1){_0x3848e1=_0x3848e1||0xcc;return function(_0x3db835){if(_0x3db835){return _0x29cde0[_0x8f51('0x18')](_0x3848e1);}return _0x29cde0[_0x8f51('0x19')](_0x3848e1)[_0x8f51('0x1a')]();};}function respondWithResult(_0x41e699,_0x1032f1){_0x1032f1=_0x1032f1||0xc8;return function(_0x1a45a5){if(_0x1a45a5){return _0x41e699[_0x8f51('0x19')](_0x1032f1)['json'](_0x1a45a5);}};}function respondWithFilteredResult(_0x88c5cf,_0x11f1bd){return function(_0x22d841){if(_0x22d841){var _0x486d69=typeof _0x11f1bd[_0x8f51('0x1b')]===_0x8f51('0x1c')&&typeof _0x11f1bd['limit']===_0x8f51('0x1c');var _0x1cf74d=_0x22d841[_0x8f51('0x1d')];var _0x238dd6=_0x486d69?0x0:_0x11f1bd['offset'];var _0x1473ee=_0x486d69?_0x22d841[_0x8f51('0x1d')]:_0x11f1bd['offset']+_0x11f1bd['limit'];var _0x46ca3a;if(_0x1473ee>=_0x1cf74d){_0x1473ee=_0x1cf74d;_0x46ca3a=0xc8;}else{_0x46ca3a=0xce;}_0x88c5cf[_0x8f51('0x19')](_0x46ca3a);return _0x88c5cf[_0x8f51('0x1e')](_0x8f51('0x1f'),_0x238dd6+'-'+_0x1473ee+'/'+_0x1cf74d)[_0x8f51('0x20')](_0x22d841);}return null;};}function patchUpdates(_0x43b914){return function(_0x5abcc2){try{jsonpatch[_0x8f51('0x21')](_0x5abcc2,_0x43b914,!![]);}catch(_0x38210c){return BPromise[_0x8f51('0x22')](_0x38210c);}return _0x5abcc2[_0x8f51('0x23')]();};}function saveUpdates(_0x1a0e68,_0x3594bf){return function(_0x2125f8){if(_0x2125f8){return _0x2125f8[_0x8f51('0x24')](_0x1a0e68)[_0x8f51('0x25')](function(_0x593213){return _0x593213;});}return null;};}function removeEntity(_0x341ed0,_0x4970c4){return function(_0x212612){if(_0x212612){return _0x212612['destroy']()[_0x8f51('0x25')](function(){_0x341ed0['status'](0xcc)[_0x8f51('0x1a')]();});}};}function handleEntityNotFound(_0x43afcd,_0x406cbf){return function(_0x3ea4fd){if(!_0x3ea4fd){_0x43afcd[_0x8f51('0x18')](0x194);}return _0x3ea4fd;};}function handleError(_0x1f86c4,_0x2121e9){_0x2121e9=_0x2121e9||0x1f4;return function(_0x26d5cc){logger[_0x8f51('0x26')](_0x26d5cc[_0x8f51('0x27')]);if(_0x26d5cc[_0x8f51('0x28')]){delete _0x26d5cc[_0x8f51('0x28')];}_0x1f86c4[_0x8f51('0x19')](_0x2121e9)[_0x8f51('0x29')](_0x26d5cc);};}exports['index']=function(_0x4ac7d2,_0x38c680){var _0x52c701={},_0x27af59={},_0x237976={'count':0x0,'rows':[]};var _0x80c02c=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x42bc0a){return{'name':_0x42bc0a[_0x8f51('0x2a')],'type':_0x42bc0a[_0x8f51('0x2b')]['key']};});_0x27af59['model']=_[_0x8f51('0x2c')](_0x80c02c,_0x8f51('0x28'));_0x27af59[_0x8f51('0x2d')]=_['keys'](_0x4ac7d2[_0x8f51('0x2d')]);_0x27af59[_0x8f51('0x2e')]=_[_0x8f51('0x2f')](_0x27af59[_0x8f51('0x30')],_0x27af59[_0x8f51('0x2d')]);_0x52c701[_0x8f51('0x31')]=_['intersection'](_0x27af59[_0x8f51('0x30')],qs['fields'](_0x4ac7d2[_0x8f51('0x2d')]['fields']));_0x52c701[_0x8f51('0x31')]=_0x52c701[_0x8f51('0x31')]['length']?_0x52c701[_0x8f51('0x31')]:_0x27af59['model'];if(!_0x4ac7d2[_0x8f51('0x2d')][_0x8f51('0x32')](_0x8f51('0x33'))){_0x52c701[_0x8f51('0x34')]=qs[_0x8f51('0x34')](_0x4ac7d2[_0x8f51('0x2d')]['limit']);_0x52c701['offset']=qs[_0x8f51('0x1b')](_0x4ac7d2[_0x8f51('0x2d')][_0x8f51('0x1b')]);}_0x52c701[_0x8f51('0x35')]=qs[_0x8f51('0x36')](_0x4ac7d2[_0x8f51('0x2d')]['sort']);_0x52c701['where']=qs[_0x8f51('0x2e')](_[_0x8f51('0x37')](_0x4ac7d2[_0x8f51('0x2d')],_0x27af59['filters']),_0x80c02c);if(_0x4ac7d2['query']['filter']){_0x52c701[_0x8f51('0x38')]=_['merge'](_0x52c701[_0x8f51('0x38')],{'$or':_[_0x8f51('0x2c')](_0x80c02c,function(_0x2fcfaa){if(_0x2fcfaa[_0x8f51('0x2b')]!==_0x8f51('0x39')){var _0x44af6f={};_0x44af6f[_0x2fcfaa[_0x8f51('0x28')]]={'$like':'%'+_0x4ac7d2['query']['filter']+'%'};return _0x44af6f;}})});}_0x52c701=_[_0x8f51('0x3a')]({},_0x52c701,_0x4ac7d2[_0x8f51('0x3b')]);var _0x3a2c2b={'where':_0x52c701[_0x8f51('0x38')]};return db[_0x8f51('0x3c')][_0x8f51('0x1d')](_0x3a2c2b)[_0x8f51('0x25')](function(_0x33b29f){_0x237976[_0x8f51('0x1d')]=_0x33b29f;if(_0x4ac7d2[_0x8f51('0x2d')][_0x8f51('0x3d')]){_0x52c701[_0x8f51('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x8f51('0x3f')](_0x52c701);})[_0x8f51('0x25')](function(_0x1f58fc){_0x237976[_0x8f51('0x40')]=_0x1f58fc;return _0x237976;})[_0x8f51('0x25')](respondWithFilteredResult(_0x38c680,_0x52c701))['catch'](handleError(_0x38c680,null));};exports[_0x8f51('0x41')]=function(_0x2ac15c,_0xbd84b){var _0x173ed1={'raw':![],'where':{'id':_0x2ac15c[_0x8f51('0x42')]['id']}},_0xf73b0c={};_0xf73b0c[_0x8f51('0x30')]=_[_0x8f51('0x43')](db[_0x8f51('0x3c')][_0x8f51('0x44')]);_0xf73b0c[_0x8f51('0x2d')]=_['keys'](_0x2ac15c['query']);_0xf73b0c[_0x8f51('0x2e')]=_['intersection'](_0xf73b0c['model'],_0xf73b0c[_0x8f51('0x2d')]);_0x173ed1[_0x8f51('0x31')]=_[_0x8f51('0x2f')](_0xf73b0c['model'],qs[_0x8f51('0x45')](_0x2ac15c[_0x8f51('0x2d')]['fields']));_0x173ed1[_0x8f51('0x31')]=_0x173ed1[_0x8f51('0x31')]['length']?_0x173ed1[_0x8f51('0x31')]:_0xf73b0c[_0x8f51('0x30')];if(_0x2ac15c['query']['includeAll']){_0x173ed1['include']=[{'all':!![]}];}_0x173ed1=_['merge']({},_0x173ed1,_0x2ac15c[_0x8f51('0x3b')]);return db[_0x8f51('0x3c')][_0x8f51('0x46')](_0x173ed1)['then'](handleEntityNotFound(_0xbd84b,null))['then'](respondWithResult(_0xbd84b,null))[_0x8f51('0x47')](handleError(_0xbd84b,null));};exports['create']=function(_0x1f82fa,_0x5d464e){return db[_0x8f51('0x3c')]['create'](_0x1f82fa[_0x8f51('0x48')],{})[_0x8f51('0x25')](respondWithResult(_0x5d464e,0xc9))['catch'](handleError(_0x5d464e,null));};exports[_0x8f51('0x24')]=function(_0x1d47c1,_0x5e5d3a){if(_0x1d47c1[_0x8f51('0x48')]['id']){delete _0x1d47c1[_0x8f51('0x48')]['id'];}return db[_0x8f51('0x3c')][_0x8f51('0x46')]({'where':{'id':_0x1d47c1['params']['id']}})[_0x8f51('0x25')](handleEntityNotFound(_0x5e5d3a,null))[_0x8f51('0x25')](saveUpdates(_0x1d47c1[_0x8f51('0x48')],null))[_0x8f51('0x25')](respondWithResult(_0x5e5d3a,null))[_0x8f51('0x47')](handleError(_0x5e5d3a,null));};exports[_0x8f51('0x49')]=function(_0x39b892,_0x1aff92){return db['SalesforceConfiguration'][_0x8f51('0x46')]({'where':{'id':_0x39b892[_0x8f51('0x42')]['id']}})[_0x8f51('0x25')](handleEntityNotFound(_0x1aff92,null))[_0x8f51('0x25')](removeEntity(_0x1aff92,null))[_0x8f51('0x47')](handleError(_0x1aff92,null));};exports[_0x8f51('0x4a')]=function(_0x593d99,_0x112c68,_0x24ff3b){var _0x73faee={};var _0x12cda2={};var _0x50e8da;var _0x37a5ca;return db[_0x8f51('0x3c')][_0x8f51('0x4b')]({'where':{'id':_0x593d99[_0x8f51('0x42')]['id']}})[_0x8f51('0x25')](handleEntityNotFound(_0x112c68,null))[_0x8f51('0x25')](function(_0xb15fa7){if(_0xb15fa7){_0x50e8da=_0xb15fa7;_0x12cda2[_0x8f51('0x30')]=_[_0x8f51('0x43')](db[_0x8f51('0x4c')][_0x8f51('0x44')]);_0x12cda2[_0x8f51('0x2d')]=_[_0x8f51('0x43')](_0x593d99['query']);_0x12cda2['filters']=_[_0x8f51('0x2f')](_0x12cda2[_0x8f51('0x30')],_0x12cda2[_0x8f51('0x2d')]);_0x73faee[_0x8f51('0x31')]=_[_0x8f51('0x2f')](_0x12cda2[_0x8f51('0x30')],qs['fields'](_0x593d99[_0x8f51('0x2d')]['fields']));_0x73faee[_0x8f51('0x31')]=_0x73faee[_0x8f51('0x31')][_0x8f51('0x4d')]?_0x73faee[_0x8f51('0x31')]:_0x12cda2[_0x8f51('0x30')];_0x73faee[_0x8f51('0x35')]=qs['sort'](_0x593d99[_0x8f51('0x2d')][_0x8f51('0x36')]);_0x73faee['where']=qs['filters'](_[_0x8f51('0x37')](_0x593d99[_0x8f51('0x2d')],_0x12cda2[_0x8f51('0x2e')]));if(_0x593d99[_0x8f51('0x2d')][_0x8f51('0x4e')]){_0x73faee['where']=_['merge'](_0x73faee[_0x8f51('0x38')],{'$or':_[_0x8f51('0x2c')](_0x73faee[_0x8f51('0x31')],function(_0x55075b){var _0x3ce2b6={};_0x3ce2b6[_0x55075b]={'$like':'%'+_0x593d99[_0x8f51('0x2d')][_0x8f51('0x4e')]+'%'};return _0x3ce2b6;})});}_0x73faee=_[_0x8f51('0x3a')]({},_0x73faee,_0x593d99[_0x8f51('0x3b')]);return _0x50e8da[_0x8f51('0x4a')](_0x73faee);}})[_0x8f51('0x25')](function(_0x33d1e4){if(_0x33d1e4){_0x37a5ca=_0x33d1e4['length'];if(!_0x593d99[_0x8f51('0x2d')][_0x8f51('0x32')](_0x8f51('0x33'))){_0x73faee[_0x8f51('0x34')]=qs[_0x8f51('0x34')](_0x593d99[_0x8f51('0x2d')][_0x8f51('0x34')]);_0x73faee['offset']=qs[_0x8f51('0x1b')](_0x593d99[_0x8f51('0x2d')]['offset']);}return _0x50e8da[_0x8f51('0x4a')](_0x73faee);}})[_0x8f51('0x25')](function(_0x22b1ac){if(_0x22b1ac){return _0x22b1ac?{'count':_0x37a5ca,'rows':_0x22b1ac}:null;}})['then'](respondWithResult(_0x112c68,null))[_0x8f51('0x47')](handleError(_0x112c68,null));};exports[_0x8f51('0x4f')]=function(_0x5e348b,_0xffcd03,_0x37a1bc){var _0xdf26ca={};var _0x1e1821={};var _0x4f9e62;var _0x5e90b3;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5e348b[_0x8f51('0x42')]['id']}})['then'](handleEntityNotFound(_0xffcd03,null))['then'](function(_0x2e1a72){if(_0x2e1a72){_0x4f9e62=_0x2e1a72;_0x1e1821['model']=_['keys'](db[_0x8f51('0x4c')]['rawAttributes']);_0x1e1821[_0x8f51('0x2d')]=_[_0x8f51('0x43')](_0x5e348b['query']);_0x1e1821['filters']=_['intersection'](_0x1e1821[_0x8f51('0x30')],_0x1e1821[_0x8f51('0x2d')]);_0xdf26ca['attributes']=_[_0x8f51('0x2f')](_0x1e1821[_0x8f51('0x30')],qs[_0x8f51('0x45')](_0x5e348b['query'][_0x8f51('0x45')]));_0xdf26ca['attributes']=_0xdf26ca[_0x8f51('0x31')]['length']?_0xdf26ca['attributes']:_0x1e1821[_0x8f51('0x30')];_0xdf26ca[_0x8f51('0x35')]=qs[_0x8f51('0x36')](_0x5e348b['query']['sort']);_0xdf26ca['where']=qs[_0x8f51('0x2e')](_[_0x8f51('0x37')](_0x5e348b[_0x8f51('0x2d')],_0x1e1821[_0x8f51('0x2e')]));if(_0x5e348b[_0x8f51('0x2d')]['filter']){_0xdf26ca[_0x8f51('0x38')]=_['merge'](_0xdf26ca[_0x8f51('0x38')],{'$or':_['map'](_0xdf26ca['attributes'],function(_0x1b0784){var _0x3a1ff0={};_0x3a1ff0[_0x1b0784]={'$like':'%'+_0x5e348b[_0x8f51('0x2d')][_0x8f51('0x4e')]+'%'};return _0x3a1ff0;})});}_0xdf26ca=_[_0x8f51('0x3a')]({},_0xdf26ca,_0x5e348b[_0x8f51('0x3b')]);return _0x4f9e62[_0x8f51('0x4f')](_0xdf26ca);}})['then'](function(_0x2ba635){if(_0x2ba635){_0x5e90b3=_0x2ba635[_0x8f51('0x4d')];if(!_0x5e348b['query'][_0x8f51('0x32')](_0x8f51('0x33'))){_0xdf26ca['limit']=qs[_0x8f51('0x34')](_0x5e348b[_0x8f51('0x2d')][_0x8f51('0x34')]);_0xdf26ca[_0x8f51('0x1b')]=qs[_0x8f51('0x1b')](_0x5e348b[_0x8f51('0x2d')][_0x8f51('0x1b')]);}return _0x4f9e62['getSubjects'](_0xdf26ca);}})[_0x8f51('0x25')](function(_0x4bf467){if(_0x4bf467){return _0x4bf467?{'count':_0x5e90b3,'rows':_0x4bf467}:null;}})['then'](respondWithResult(_0xffcd03,null))[_0x8f51('0x47')](handleError(_0xffcd03,null));};exports[_0x8f51('0x50')]=function(_0x4af242,_0x4f5886,_0x306139){var _0x36c5ae={};var _0x203018={};var _0x31f8e9;var _0x407e86;return db[_0x8f51('0x3c')][_0x8f51('0x4b')]({'where':{'id':_0x4af242['params']['id']}})[_0x8f51('0x25')](handleEntityNotFound(_0x4f5886,null))[_0x8f51('0x25')](function(_0x20055a){if(_0x20055a){_0x31f8e9=_0x20055a;_0x203018[_0x8f51('0x30')]=_[_0x8f51('0x43')](db[_0x8f51('0x4c')][_0x8f51('0x44')]);_0x203018[_0x8f51('0x2d')]=_[_0x8f51('0x43')](_0x4af242[_0x8f51('0x2d')]);_0x203018[_0x8f51('0x2e')]=_['intersection'](_0x203018['model'],_0x203018[_0x8f51('0x2d')]);_0x36c5ae['attributes']=_[_0x8f51('0x2f')](_0x203018['model'],qs[_0x8f51('0x45')](_0x4af242[_0x8f51('0x2d')]['fields']));_0x36c5ae['attributes']=_0x36c5ae['attributes'][_0x8f51('0x4d')]?_0x36c5ae[_0x8f51('0x31')]:_0x203018[_0x8f51('0x30')];_0x36c5ae[_0x8f51('0x35')]=qs['sort'](_0x4af242['query'][_0x8f51('0x36')]);_0x36c5ae[_0x8f51('0x38')]=qs[_0x8f51('0x2e')](_[_0x8f51('0x37')](_0x4af242['query'],_0x203018[_0x8f51('0x2e')]));if(_0x4af242[_0x8f51('0x2d')]['filter']){_0x36c5ae[_0x8f51('0x38')]=_[_0x8f51('0x3a')](_0x36c5ae[_0x8f51('0x38')],{'$or':_[_0x8f51('0x2c')](_0x36c5ae[_0x8f51('0x31')],function(_0x1ae475){var _0x3b4ba3={};_0x3b4ba3[_0x1ae475]={'$like':'%'+_0x4af242[_0x8f51('0x2d')][_0x8f51('0x4e')]+'%'};return _0x3b4ba3;})});}_0x36c5ae=_[_0x8f51('0x3a')]({},_0x36c5ae,_0x4af242[_0x8f51('0x3b')]);return _0x31f8e9[_0x8f51('0x50')](_0x36c5ae);}})[_0x8f51('0x25')](function(_0x5f06f6){if(_0x5f06f6){_0x407e86=_0x5f06f6[_0x8f51('0x4d')];if(!_0x4af242[_0x8f51('0x2d')][_0x8f51('0x32')]('nolimit')){_0x36c5ae[_0x8f51('0x34')]=qs['limit'](_0x4af242[_0x8f51('0x2d')][_0x8f51('0x34')]);_0x36c5ae[_0x8f51('0x1b')]=qs[_0x8f51('0x1b')](_0x4af242[_0x8f51('0x2d')][_0x8f51('0x1b')]);}return _0x31f8e9[_0x8f51('0x50')](_0x36c5ae);}})[_0x8f51('0x25')](function(_0x41d222){if(_0x41d222){return _0x41d222?{'count':_0x407e86,'rows':_0x41d222}:null;}})['then'](respondWithResult(_0x4f5886,null))[_0x8f51('0x47')](handleError(_0x4f5886,null));}; \ No newline at end of file +var _0xc00c=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x536699,_0x41b335){var _0x475a6a=function(_0x2da2f6){while(--_0x2da2f6){_0x536699['push'](_0x536699['shift']());}};_0x475a6a(++_0x41b335);}(_0xc00c,0x92));var _0xcc00=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xc00c[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc00('0x1'));var jsonpatch=require(_0xcc00('0x2'));var rp=require(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var Mustache=require(_0xcc00('0x6'));var util=require(_0xcc00('0x7'));var path=require('path');var sox=require(_0xcc00('0x8'));var csv=require(_0xcc00('0x9'));var ejs=require(_0xcc00('0xa'));var fs=require('fs');var fs_extra=require(_0xcc00('0xb'));var _=require('lodash');var squel=require(_0xcc00('0xc'));var crypto=require(_0xcc00('0xd'));var jsforce=require(_0xcc00('0xe'));var deskjs=require(_0xcc00('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcc00('0x10'));var Papa=require(_0xcc00('0x11'));var Redis=require(_0xcc00('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc00('0x13'));var as=require(_0xcc00('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc00('0x15'))('api');var utils=require(_0xcc00('0x16'));var config=require(_0xcc00('0x17'));var licenseUtil=require(_0xcc00('0x18'));var db=require(_0xcc00('0x19'))['db'];function respondWithStatusCode(_0x42b5c2,_0x438cec){_0x438cec=_0x438cec||0xcc;return function(_0x4b2663){if(_0x4b2663){return _0x42b5c2[_0xcc00('0x1a')](_0x438cec);}return _0x42b5c2['status'](_0x438cec)[_0xcc00('0x1b')]();};}function respondWithResult(_0xafaf86,_0x438fa3){_0x438fa3=_0x438fa3||0xc8;return function(_0x108a40){if(_0x108a40){return _0xafaf86[_0xcc00('0x1c')](_0x438fa3)[_0xcc00('0x1d')](_0x108a40);}};}function respondWithFilteredResult(_0x150d7a,_0x47aa2d){return function(_0x26dd58){if(_0x26dd58){var _0x8f3cab=typeof _0x47aa2d['offset']===_0xcc00('0x1e')&&typeof _0x47aa2d[_0xcc00('0x1f')]===_0xcc00('0x1e');var _0x2e5475=_0x26dd58[_0xcc00('0x20')];var _0x3eadf7=_0x8f3cab?0x0:_0x47aa2d[_0xcc00('0x21')];var _0xf4f20d=_0x8f3cab?_0x26dd58[_0xcc00('0x20')]:_0x47aa2d[_0xcc00('0x21')]+_0x47aa2d['limit'];var _0x47c876;if(_0xf4f20d>=_0x2e5475){_0xf4f20d=_0x2e5475;_0x47c876=0xc8;}else{_0x47c876=0xce;}_0x150d7a[_0xcc00('0x1c')](_0x47c876);return _0x150d7a[_0xcc00('0x22')](_0xcc00('0x23'),_0x3eadf7+'-'+_0xf4f20d+'/'+_0x2e5475)[_0xcc00('0x1d')](_0x26dd58);}return null;};}function patchUpdates(_0x448a80){return function(_0x434079){try{jsonpatch['apply'](_0x434079,_0x448a80,!![]);}catch(_0x155a47){return BPromise[_0xcc00('0x24')](_0x155a47);}return _0x434079[_0xcc00('0x25')]();};}function saveUpdates(_0x3465a3,_0x369016){return function(_0x111a34){if(_0x111a34){return _0x111a34[_0xcc00('0x26')](_0x3465a3)[_0xcc00('0x27')](function(_0x564f45){return _0x564f45;});}return null;};}function removeEntity(_0x40535e,_0x2af6dd){return function(_0x81b7f1){if(_0x81b7f1){return _0x81b7f1[_0xcc00('0x28')]()[_0xcc00('0x27')](function(){_0x40535e[_0xcc00('0x1c')](0xcc)[_0xcc00('0x1b')]();});}};}function handleEntityNotFound(_0x2fbbbf,_0x42f975){return function(_0x2f8a56){if(!_0x2f8a56){_0x2fbbbf[_0xcc00('0x1a')](0x194);}return _0x2f8a56;};}function handleError(_0x24edb8,_0x4d824f){_0x4d824f=_0x4d824f||0x1f4;return function(_0xca140b){logger[_0xcc00('0x29')](_0xca140b[_0xcc00('0x2a')]);if(_0xca140b[_0xcc00('0x2b')]){delete _0xca140b['name'];}_0x24edb8[_0xcc00('0x1c')](_0x4d824f)[_0xcc00('0x2c')](_0xca140b);};}exports[_0xcc00('0x2d')]=function(_0x1ba470,_0x3b7be4){var _0x2e0026={},_0x4f2ca4={},_0x14c0f6={'count':0x0,'rows':[]};var _0x396d32=_[_0xcc00('0x2e')](db[_0xcc00('0x2f')][_0xcc00('0x30')],function(_0xb1d77b){return{'name':_0xb1d77b[_0xcc00('0x31')],'type':_0xb1d77b[_0xcc00('0x32')][_0xcc00('0x33')]};});_0x4f2ca4[_0xcc00('0x34')]=_[_0xcc00('0x2e')](_0x396d32,_0xcc00('0x2b'));_0x4f2ca4[_0xcc00('0x35')]=_['keys'](_0x1ba470['query']);_0x4f2ca4[_0xcc00('0x36')]=_['intersection'](_0x4f2ca4[_0xcc00('0x34')],_0x4f2ca4['query']);_0x2e0026[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x4f2ca4[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x39')]));_0x2e0026[_0xcc00('0x37')]=_0x2e0026[_0xcc00('0x37')][_0xcc00('0x3a')]?_0x2e0026[_0xcc00('0x37')]:_0x4f2ca4[_0xcc00('0x34')];if(!_0x1ba470[_0xcc00('0x35')]['hasOwnProperty'](_0xcc00('0x3b'))){_0x2e0026[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x2e0026['offset']=qs['offset'](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x21')]);}_0x2e0026[_0xcc00('0x3c')]=qs[_0xcc00('0x3d')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x3d')]);_0x2e0026[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_[_0xcc00('0x3f')](_0x1ba470[_0xcc00('0x35')],_0x4f2ca4[_0xcc00('0x36')]),_0x396d32);if(_0x1ba470['query']['filter']){_0x2e0026[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0x2e0026[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0x396d32,function(_0x3f8d0a){if(_0x3f8d0a[_0xcc00('0x32')]!==_0xcc00('0x41')){var _0x17906f={};_0x17906f[_0x3f8d0a[_0xcc00('0x2b')]]={'$like':'%'+_0x1ba470[_0xcc00('0x35')][_0xcc00('0x42')]+'%'};return _0x17906f;}})});}_0x2e0026=_[_0xcc00('0x40')]({},_0x2e0026,_0x1ba470['options']);var _0x37f5dd={'where':_0x2e0026[_0xcc00('0x3e')]};return db['SalesforceConfiguration'][_0xcc00('0x20')](_0x37f5dd)[_0xcc00('0x27')](function(_0x4bab54){_0x14c0f6[_0xcc00('0x20')]=_0x4bab54;if(_0x1ba470[_0xcc00('0x35')]['includeAll']){_0x2e0026[_0xcc00('0x43')]=[{'all':!![]}];}return db[_0xcc00('0x2f')][_0xcc00('0x44')](_0x2e0026);})[_0xcc00('0x27')](function(_0xbc88ee){_0x14c0f6[_0xcc00('0x45')]=_0xbc88ee;return _0x14c0f6;})[_0xcc00('0x27')](respondWithFilteredResult(_0x3b7be4,_0x2e0026))[_0xcc00('0x46')](handleError(_0x3b7be4,null));};exports[_0xcc00('0x47')]=function(_0x203063,_0x59e679){var _0x2bdc32={'raw':![],'where':{'id':_0x203063[_0xcc00('0x48')]['id']}},_0x28d7da={};_0x28d7da[_0xcc00('0x34')]=_[_0xcc00('0x49')](db[_0xcc00('0x2f')][_0xcc00('0x30')]);_0x28d7da[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x203063[_0xcc00('0x35')]);_0x28d7da['filters']=_[_0xcc00('0x38')](_0x28d7da[_0xcc00('0x34')],_0x28d7da[_0xcc00('0x35')]);_0x2bdc32[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x28d7da[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x203063['query']['fields']));_0x2bdc32[_0xcc00('0x37')]=_0x2bdc32[_0xcc00('0x37')]['length']?_0x2bdc32[_0xcc00('0x37')]:_0x28d7da[_0xcc00('0x34')];if(_0x203063[_0xcc00('0x35')][_0xcc00('0x4a')]){_0x2bdc32[_0xcc00('0x43')]=[{'all':!![]}];}_0x2bdc32=_[_0xcc00('0x40')]({},_0x2bdc32,_0x203063[_0xcc00('0x4b')]);return db[_0xcc00('0x2f')][_0xcc00('0x4c')](_0x2bdc32)[_0xcc00('0x27')](handleEntityNotFound(_0x59e679,null))[_0xcc00('0x27')](respondWithResult(_0x59e679,null))[_0xcc00('0x46')](handleError(_0x59e679,null));};exports['create']=function(_0x414701,_0x402900){return db[_0xcc00('0x2f')]['create'](_0x414701[_0xcc00('0x4d')],{})[_0xcc00('0x27')](respondWithResult(_0x402900,0xc9))[_0xcc00('0x46')](handleError(_0x402900,null));};exports['update']=function(_0x5008ac,_0x5bb0fe){if(_0x5008ac['body']['id']){delete _0x5008ac[_0xcc00('0x4d')]['id'];}return db[_0xcc00('0x2f')][_0xcc00('0x4c')]({'where':{'id':_0x5008ac['params']['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x5bb0fe,null))[_0xcc00('0x27')](saveUpdates(_0x5008ac[_0xcc00('0x4d')],null))[_0xcc00('0x27')](respondWithResult(_0x5bb0fe,null))[_0xcc00('0x46')](handleError(_0x5bb0fe,null));};exports[_0xcc00('0x28')]=function(_0x289616,_0x58afee){return db[_0xcc00('0x2f')][_0xcc00('0x4c')]({'where':{'id':_0x289616[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x58afee,null))['then'](removeEntity(_0x58afee,null))[_0xcc00('0x46')](handleError(_0x58afee,null));};exports[_0xcc00('0x4e')]=function(_0x1ad5ae,_0x2415c8,_0xa4f1c8){var _0x205f7e={};var _0x3b101e={};var _0x4b4842;var _0x256b38;return db['SalesforceConfiguration'][_0xcc00('0x4f')]({'where':{'id':_0x1ad5ae[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x2415c8,null))['then'](function(_0x13b440){if(_0x13b440){_0x4b4842=_0x13b440;_0x3b101e[_0xcc00('0x34')]=_['keys'](db[_0xcc00('0x50')]['rawAttributes']);_0x3b101e[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x1ad5ae['query']);_0x3b101e['filters']=_[_0xcc00('0x38')](_0x3b101e['model'],_0x3b101e[_0xcc00('0x35')]);_0x205f7e[_0xcc00('0x37')]=_['intersection'](_0x3b101e[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x1ad5ae['query']['fields']));_0x205f7e[_0xcc00('0x37')]=_0x205f7e[_0xcc00('0x37')][_0xcc00('0x3a')]?_0x205f7e[_0xcc00('0x37')]:_0x3b101e['model'];_0x205f7e[_0xcc00('0x3c')]=qs[_0xcc00('0x3d')](_0x1ad5ae[_0xcc00('0x35')]['sort']);_0x205f7e[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_['pick'](_0x1ad5ae[_0xcc00('0x35')],_0x3b101e['filters']));if(_0x1ad5ae[_0xcc00('0x35')]['filter']){_0x205f7e['where']=_[_0xcc00('0x40')](_0x205f7e[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0x205f7e[_0xcc00('0x37')],function(_0x2acd19){var _0x5770a8={};_0x5770a8[_0x2acd19]={'$like':'%'+_0x1ad5ae['query']['filter']+'%'};return _0x5770a8;})});}_0x205f7e=_[_0xcc00('0x40')]({},_0x205f7e,_0x1ad5ae[_0xcc00('0x4b')]);return _0x4b4842['getFields'](_0x205f7e);}})['then'](function(_0x11d68b){if(_0x11d68b){_0x256b38=_0x11d68b[_0xcc00('0x3a')];if(!_0x1ad5ae[_0xcc00('0x35')][_0xcc00('0x51')](_0xcc00('0x3b'))){_0x205f7e[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ad5ae[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x205f7e['offset']=qs['offset'](_0x1ad5ae['query'][_0xcc00('0x21')]);}return _0x4b4842['getFields'](_0x205f7e);}})[_0xcc00('0x27')](function(_0x547cc6){if(_0x547cc6){return _0x547cc6?{'count':_0x256b38,'rows':_0x547cc6}:null;}})[_0xcc00('0x27')](respondWithResult(_0x2415c8,null))['catch'](handleError(_0x2415c8,null));};exports[_0xcc00('0x52')]=function(_0x272c90,_0x4d3cb3,_0x150839){var _0x317e87={};var _0x319dac={};var _0x42f1af;var _0x3acba6;return db[_0xcc00('0x2f')][_0xcc00('0x4f')]({'where':{'id':_0x272c90[_0xcc00('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d3cb3,null))['then'](function(_0x11c096){if(_0x11c096){_0x42f1af=_0x11c096;_0x319dac[_0xcc00('0x34')]=_[_0xcc00('0x49')](db[_0xcc00('0x50')][_0xcc00('0x30')]);_0x319dac['query']=_[_0xcc00('0x49')](_0x272c90['query']);_0x319dac['filters']=_['intersection'](_0x319dac[_0xcc00('0x34')],_0x319dac[_0xcc00('0x35')]);_0x317e87['attributes']=_['intersection'](_0x319dac[_0xcc00('0x34')],qs['fields'](_0x272c90['query'][_0xcc00('0x39')]));_0x317e87['attributes']=_0x317e87[_0xcc00('0x37')]['length']?_0x317e87['attributes']:_0x319dac[_0xcc00('0x34')];_0x317e87[_0xcc00('0x3c')]=qs['sort'](_0x272c90[_0xcc00('0x35')][_0xcc00('0x3d')]);_0x317e87[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_[_0xcc00('0x3f')](_0x272c90[_0xcc00('0x35')],_0x319dac[_0xcc00('0x36')]));if(_0x272c90['query']['filter']){_0x317e87[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0x317e87['where'],{'$or':_[_0xcc00('0x2e')](_0x317e87[_0xcc00('0x37')],function(_0x1d4530){var _0x2d5eff={};_0x2d5eff[_0x1d4530]={'$like':'%'+_0x272c90[_0xcc00('0x35')]['filter']+'%'};return _0x2d5eff;})});}_0x317e87=_[_0xcc00('0x40')]({},_0x317e87,_0x272c90[_0xcc00('0x4b')]);return _0x42f1af['getSubjects'](_0x317e87);}})[_0xcc00('0x27')](function(_0x11a23d){if(_0x11a23d){_0x3acba6=_0x11a23d['length'];if(!_0x272c90[_0xcc00('0x35')][_0xcc00('0x51')](_0xcc00('0x3b'))){_0x317e87[_0xcc00('0x1f')]=qs['limit'](_0x272c90[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x317e87['offset']=qs[_0xcc00('0x21')](_0x272c90[_0xcc00('0x35')]['offset']);}return _0x42f1af[_0xcc00('0x52')](_0x317e87);}})[_0xcc00('0x27')](function(_0x4d41c7){if(_0x4d41c7){return _0x4d41c7?{'count':_0x3acba6,'rows':_0x4d41c7}:null;}})['then'](respondWithResult(_0x4d3cb3,null))[_0xcc00('0x46')](handleError(_0x4d3cb3,null));};exports['getDescriptions']=function(_0x2f7b78,_0x4b4531,_0x487dff){var _0xbb5db4={};var _0x550228={};var _0x161285;var _0x29dca1;return db['SalesforceConfiguration'][_0xcc00('0x4f')]({'where':{'id':_0x2f7b78[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x4b4531,null))['then'](function(_0x34d5d1){if(_0x34d5d1){_0x161285=_0x34d5d1;_0x550228[_0xcc00('0x34')]=_['keys'](db['SalesforceField'][_0xcc00('0x30')]);_0x550228[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x2f7b78[_0xcc00('0x35')]);_0x550228[_0xcc00('0x36')]=_[_0xcc00('0x38')](_0x550228[_0xcc00('0x34')],_0x550228['query']);_0xbb5db4['attributes']=_[_0xcc00('0x38')](_0x550228[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x2f7b78['query'][_0xcc00('0x39')]));_0xbb5db4[_0xcc00('0x37')]=_0xbb5db4[_0xcc00('0x37')][_0xcc00('0x3a')]?_0xbb5db4['attributes']:_0x550228[_0xcc00('0x34')];_0xbb5db4['order']=qs[_0xcc00('0x3d')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x3d')]);_0xbb5db4['where']=qs['filters'](_[_0xcc00('0x3f')](_0x2f7b78[_0xcc00('0x35')],_0x550228['filters']));if(_0x2f7b78['query'][_0xcc00('0x42')]){_0xbb5db4[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0xbb5db4[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0xbb5db4[_0xcc00('0x37')],function(_0x153961){var _0x40eb75={};_0x40eb75[_0x153961]={'$like':'%'+_0x2f7b78[_0xcc00('0x35')]['filter']+'%'};return _0x40eb75;})});}_0xbb5db4=_[_0xcc00('0x40')]({},_0xbb5db4,_0x2f7b78['options']);return _0x161285[_0xcc00('0x53')](_0xbb5db4);}})[_0xcc00('0x27')](function(_0x3af2ef){if(_0x3af2ef){_0x29dca1=_0x3af2ef[_0xcc00('0x3a')];if(!_0x2f7b78['query'][_0xcc00('0x51')](_0xcc00('0x3b'))){_0xbb5db4['limit']=qs[_0xcc00('0x1f')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x1f')]);_0xbb5db4[_0xcc00('0x21')]=qs[_0xcc00('0x21')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x21')]);}return _0x161285[_0xcc00('0x53')](_0xbb5db4);}})[_0xcc00('0x27')](function(_0x6e684c){if(_0x6e684c){return _0x6e684c?{'count':_0x29dca1,'rows':_0x6e684c}:null;}})[_0xcc00('0x27')](respondWithResult(_0x4b4531,null))['catch'](handleError(_0x4b4531,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index adb0d2f..7694ee2 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 _0x251d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util'];(function(_0x10d6f5,_0x140245){var _0x484db4=function(_0x2f7ec4){while(--_0x2f7ec4){_0x10d6f5['push'](_0x10d6f5['shift']());}};_0x484db4(++_0x140245);}(_0x251d,0x172));var _0xd251=function(_0x261813,_0x4b54c8){_0x261813=_0x261813-0x0;var _0x13097a=_0x251d[_0x261813];return _0x13097a;};'use strict';var _=require(_0xd251('0x0'));var util=require(_0xd251('0x1'));var logger=require(_0xd251('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd251('0x3'));var rp=require(_0xd251('0x4'));var fs=require('fs');var path=require(_0xd251('0x5'));var rimraf=require(_0xd251('0x6'));var config=require(_0xd251('0x7'));var attributes=require(_0xd251('0x8'));module[_0xd251('0x9')]=function(_0x57720d,_0x485231){return _0x57720d[_0xd251('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0xd251('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x528c=['rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1df0a6,_0x1d1a95){var _0x139016=function(_0x574201){while(--_0x574201){_0x1df0a6['push'](_0x1df0a6['shift']());}};_0x139016(++_0x1d1a95);}(_0x528c,0x195));var _0xc528=function(_0x40b90d,_0x6d00df){_0x40b90d=_0x40b90d-0x0;var _0x1f9418=_0x528c[_0x40b90d];return _0x1f9418;};'use strict';var _=require('lodash');var util=require(_0xc528('0x0'));var logger=require(_0xc528('0x1'))(_0xc528('0x2'));var moment=require('moment');var BPromise=require(_0xc528('0x3'));var rp=require(_0xc528('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc528('0x5'));var config=require(_0xc528('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x456a87,_0x438577){return _0x456a87[_0xc528('0x7')](_0xc528('0x8'),attributes,{'tableName':_0xc528('0x9'),'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 87cb16b..7f1c99f 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 _0x6257=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3140da,_0x39e0e0){var _0x5887ba=function(_0x769f3f){while(--_0x769f3f){_0x3140da['push'](_0x3140da['shift']());}};_0x5887ba(++_0x39e0e0);}(_0x6257,0x176));var _0x7625=function(_0x1ef6b3,_0x14ee00){_0x1ef6b3=_0x1ef6b3-0x0;var _0x44d55d=_0x6257[_0x1ef6b3];return _0x44d55d;};'use strict';var _=require(_0x7625('0x0'));var util=require('util');var moment=require(_0x7625('0x1'));var BPromise=require(_0x7625('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7625('0x3'));var db=require(_0x7625('0x4'))['db'];var utils=require(_0x7625('0x5'));var logger=require(_0x7625('0x6'))(_0x7625('0x7'));var config=require(_0x7625('0x8'));var jayson=require(_0x7625('0x9'));var client=jayson[_0x7625('0xa')][_0x7625('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32381b,_0x4b0d43,_0x39ffab){return new BPromise(function(_0xcea96c,_0x39ad88){return client[_0x7625('0xc')](_0x32381b,_0x39ffab)[_0x7625('0xd')](function(_0x269342){logger[_0x7625('0xe')](_0x7625('0xf'),_0x4b0d43,_0x7625('0x10'));logger['debug'](_0x7625('0x11'),_0x4b0d43,'request\x20sent',JSON['stringify'](_0x269342));if(_0x269342[_0x7625('0x12')]){if(_0x269342[_0x7625('0x12')][_0x7625('0x13')]===0x1f4){logger[_0x7625('0x12')](_0x7625('0xf'),_0x4b0d43,_0x269342[_0x7625('0x12')][_0x7625('0x14')]);return _0x39ad88(_0x269342['error']['message']);}logger[_0x7625('0x12')](_0x7625('0xf'),_0x4b0d43,_0x269342[_0x7625('0x12')][_0x7625('0x14')]);return _0xcea96c(_0x269342[_0x7625('0x12')][_0x7625('0x14')]);}else{logger[_0x7625('0xe')](_0x7625('0xf'),_0x4b0d43,_0x7625('0x10'));_0xcea96c(_0x269342[_0x7625('0x15')]['message']);}})[_0x7625('0x16')](function(_0x4ef0d1){logger[_0x7625('0x12')](_0x7625('0xf'),_0x4b0d43,_0x4ef0d1);_0x39ad88(_0x4ef0d1);});});} \ No newline at end of file +var _0x69ff=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1788f8,_0x23c27b){var _0x409e03=function(_0x25f4d2){while(--_0x25f4d2){_0x1788f8['push'](_0x1788f8['shift']());}};_0x409e03(++_0x23c27b);}(_0x69ff,0x16a));var _0xf69f=function(_0x2c2d7d,_0x1c7dac){_0x2c2d7d=_0x2c2d7d-0x0;var _0x26f421=_0x69ff[_0x2c2d7d];return _0x26f421;};'use strict';var _=require('lodash');var util=require(_0xf69f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf69f('0x1'));var fs=require('fs');var Redis=require(_0xf69f('0x2'));var db=require(_0xf69f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69f('0x4'))(_0xf69f('0x5'));var config=require(_0xf69f('0x6'));var jayson=require(_0xf69f('0x7'));var client=jayson[_0xf69f('0x8')][_0xf69f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb062b,_0x37f37b,_0x45ebb2){return new BPromise(function(_0x489504,_0x5aae8c){return client['request'](_0xb062b,_0x45ebb2)[_0xf69f('0xa')](function(_0xca32d1){logger[_0xf69f('0xb')](_0xf69f('0xc'),_0x37f37b,_0xf69f('0xd'));logger[_0xf69f('0xe')](_0xf69f('0xf'),_0x37f37b,_0xf69f('0xd'),JSON[_0xf69f('0x10')](_0xca32d1));if(_0xca32d1[_0xf69f('0x11')]){if(_0xca32d1[_0xf69f('0x11')]['code']===0x1f4){logger[_0xf69f('0x11')](_0xf69f('0xc'),_0x37f37b,_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);return _0x5aae8c(_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);}logger[_0xf69f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x37f37b,_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);return _0x489504(_0xca32d1['error'][_0xf69f('0x12')]);}else{logger[_0xf69f('0xb')](_0xf69f('0xc'),_0x37f37b,'request\x20sent');_0x489504(_0xca32d1[_0xf69f('0x13')][_0xf69f('0x12')]);}})['catch'](function(_0x7f93ab){logger[_0xf69f('0x11')](_0xf69f('0xc'),_0x37f37b,_0x7f93ab);_0x5aae8c(_0x7f93ab);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 910a577..f877ac6 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 _0xa522=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0xbb1add,_0x489d26){var _0x1620b1=function(_0x2b43c3){while(--_0x2b43c3){_0xbb1add['push'](_0xbb1add['shift']());}};_0x1620b1(++_0x489d26);}(_0xa522,0x1c0));var _0x2a52=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xa522[_0xdd2bfa];return _0x55397e;};'use strict';var multer=require(_0x2a52('0x0'));var util=require(_0x2a52('0x1'));var path=require('path');var timeout=require(_0x2a52('0x2'));var express=require(_0x2a52('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a52('0x4'));var interaction=require(_0x2a52('0x5'));var config=require('../../config/environment');var controller=require(_0x2a52('0x6'));router[_0x2a52('0x7')]('/',auth[_0x2a52('0x8')](),controller[_0x2a52('0x9')]);router[_0x2a52('0x7')](_0x2a52('0xa'),auth['isAuthenticated'](),controller[_0x2a52('0xb')]);router[_0x2a52('0xc')]('/',auth[_0x2a52('0x8')](),controller['create']);router[_0x2a52('0xd')](_0x2a52('0xa'),auth[_0x2a52('0x8')](),controller[_0x2a52('0xe')]);router[_0x2a52('0xf')](_0x2a52('0xa'),auth['isAuthenticated'](),controller[_0x2a52('0x10')]);module[_0x2a52('0x11')]=router; \ No newline at end of file +var _0x41fb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x408849,_0x11e717){var _0x1affdb=function(_0x15472e){while(--_0x15472e){_0x408849['push'](_0x408849['shift']());}};_0x1affdb(++_0x11e717);}(_0x41fb,0x1c8));var _0xb41f=function(_0x156081,_0x2f44ce){_0x156081=_0x156081-0x0;var _0x1c35b3=_0x41fb[_0x156081];return _0x1c35b3;};'use strict';var multer=require(_0xb41f('0x0'));var util=require(_0xb41f('0x1'));var path=require(_0xb41f('0x2'));var timeout=require(_0xb41f('0x3'));var express=require(_0xb41f('0x4'));var router=express[_0xb41f('0x5')]();var fs_extra=require(_0xb41f('0x6'));var auth=require(_0xb41f('0x7'));var interaction=require(_0xb41f('0x8'));var config=require(_0xb41f('0x9'));var controller=require('./intSalesforceField.controller');router[_0xb41f('0xa')]('/',auth['isAuthenticated'](),controller[_0xb41f('0xb')]);router[_0xb41f('0xa')](_0xb41f('0xc'),auth[_0xb41f('0xd')](),controller[_0xb41f('0xe')]);router[_0xb41f('0xf')]('/',auth[_0xb41f('0xd')](),controller[_0xb41f('0x10')]);router[_0xb41f('0x11')](_0xb41f('0xc'),auth[_0xb41f('0xd')](),controller['update']);router[_0xb41f('0x12')](_0xb41f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb41f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 4ec76d6..e237713 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 _0x9ec0=['picklist','string','STRING','exports','ENUM','variable','customVariable','keyValue'];(function(_0x11cb92,_0x534825){var _0x50e2e6=function(_0x347dce){while(--_0x347dce){_0x11cb92['push'](_0x11cb92['shift']());}};_0x50e2e6(++_0x534825);}(_0x9ec0,0xc3));var _0x09ec=function(_0x2edfb3,_0x1267bd){_0x2edfb3=_0x2edfb3-0x0;var _0x3df862=_0x9ec0[_0x2edfb3];return _0x3df862;};'use strict';var Sequelize=require('sequelize');module[_0x09ec('0x0')]={'type':{'type':Sequelize[_0x09ec('0x1')]('string',_0x09ec('0x2'),_0x09ec('0x3'),_0x09ec('0x4'),_0x09ec('0x5')),'defaultValue':_0x09ec('0x6')},'content':{'type':Sequelize[_0x09ec('0x7')]},'key':{'type':Sequelize[_0x09ec('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x09ec('0x6'),_0x09ec('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x09ec('0x7')]},'idField':{'type':Sequelize[_0x09ec('0x7')]},'variableName':{'type':Sequelize[_0x09ec('0x7')]}}; \ No newline at end of file +var _0x8113=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x487e21,_0x4bc6ed){var _0x8906b7=function(_0x53375e){while(--_0x53375e){_0x487e21['push'](_0x487e21['shift']());}};_0x8906b7(++_0x4bc6ed);}(_0x8113,0x159));var _0x3811=function(_0x115997,_0x5f4b2){_0x115997=_0x115997-0x0;var _0x120e18=_0x8113[_0x115997];return _0x120e18;};'use strict';var Sequelize=require(_0x3811('0x0'));module['exports']={'type':{'type':Sequelize[_0x3811('0x1')](_0x3811('0x2'),_0x3811('0x3'),_0x3811('0x4'),_0x3811('0x5'),_0x3811('0x6')),'defaultValue':_0x3811('0x2')},'content':{'type':Sequelize[_0x3811('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x3811('0x3'),_0x3811('0x4'))},'keyContent':{'type':Sequelize[_0x3811('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x3811('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0416aab..8bc04fc 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 _0x69fa=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','reject','save','update','destroy','then','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','model','keys','query','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','intersection','include','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x116c0b,_0x300ef3){var _0x4b3179=function(_0x28c944){while(--_0x28c944){_0x116c0b['push'](_0x116c0b['shift']());}};_0x4b3179(++_0x300ef3);}(_0x69fa,0x176));var _0xa69f=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x69fa[_0x333767];return _0x51661b;};'use strict';var emlformat=require(_0xa69f('0x0'));var rimraf=require(_0xa69f('0x1'));var zipdir=require(_0xa69f('0x2'));var jsonpatch=require(_0xa69f('0x3'));var rp=require(_0xa69f('0x4'));var moment=require(_0xa69f('0x5'));var BPromise=require(_0xa69f('0x6'));var Mustache=require(_0xa69f('0x7'));var util=require(_0xa69f('0x8'));var path=require(_0xa69f('0x9'));var sox=require(_0xa69f('0xa'));var csv=require(_0xa69f('0xb'));var ejs=require(_0xa69f('0xc'));var fs=require('fs');var fs_extra=require(_0xa69f('0xd'));var _=require(_0xa69f('0xe'));var squel=require(_0xa69f('0xf'));var crypto=require(_0xa69f('0x10'));var jsforce=require(_0xa69f('0x11'));var deskjs=require(_0xa69f('0x12'));var toCsv=require(_0xa69f('0xb'));var querystring=require('querystring');var Papa=require(_0xa69f('0x13'));var Redis=require(_0xa69f('0x14'));var authService=require(_0xa69f('0x15'));var qs=require(_0xa69f('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa69f('0x17'));var logger=require('../../config/logger')(_0xa69f('0x18'));var utils=require(_0xa69f('0x19'));var config=require(_0xa69f('0x1a'));var licenseUtil=require(_0xa69f('0x1b'));var db=require(_0xa69f('0x1c'))['db'];function respondWithStatusCode(_0x25ff13,_0x2b940c){_0x2b940c=_0x2b940c||0xcc;return function(_0x1efb32){if(_0x1efb32){return _0x25ff13[_0xa69f('0x1d')](_0x2b940c);}return _0x25ff13['status'](_0x2b940c)[_0xa69f('0x1e')]();};}function respondWithResult(_0x3877ad,_0x58bbcf){_0x58bbcf=_0x58bbcf||0xc8;return function(_0x214af4){if(_0x214af4){return _0x3877ad['status'](_0x58bbcf)[_0xa69f('0x1f')](_0x214af4);}};}function respondWithFilteredResult(_0x4562ab,_0x415855){return function(_0x1df248){if(_0x1df248){var _0x380130=typeof _0x415855[_0xa69f('0x20')]===_0xa69f('0x21')&&typeof _0x415855[_0xa69f('0x22')]===_0xa69f('0x21');var _0x27fd9c=_0x1df248['count'];var _0x114785=_0x380130?0x0:_0x415855[_0xa69f('0x20')];var _0x420721=_0x380130?_0x1df248[_0xa69f('0x23')]:_0x415855['offset']+_0x415855['limit'];var _0x5def51;if(_0x420721>=_0x27fd9c){_0x420721=_0x27fd9c;_0x5def51=0xc8;}else{_0x5def51=0xce;}_0x4562ab[_0xa69f('0x24')](_0x5def51);return _0x4562ab['set']('Content-Range',_0x114785+'-'+_0x420721+'/'+_0x27fd9c)[_0xa69f('0x1f')](_0x1df248);}return null;};}function patchUpdates(_0x49a15c){return function(_0x2dceab){try{jsonpatch['apply'](_0x2dceab,_0x49a15c,!![]);}catch(_0x2570d6){return BPromise[_0xa69f('0x25')](_0x2570d6);}return _0x2dceab[_0xa69f('0x26')]();};}function saveUpdates(_0x4746cb,_0x4216f7){return function(_0x49c483){if(_0x49c483){return _0x49c483[_0xa69f('0x27')](_0x4746cb)['then'](function(_0x2ae08c){return _0x2ae08c;});}return null;};}function removeEntity(_0x10709f,_0x5115e0){return function(_0x3d3a2e){if(_0x3d3a2e){return _0x3d3a2e[_0xa69f('0x28')]()[_0xa69f('0x29')](function(){_0x10709f[_0xa69f('0x24')](0xcc)[_0xa69f('0x1e')]();});}};}function handleEntityNotFound(_0x4512d4,_0x3935fd){return function(_0x16f228){if(!_0x16f228){_0x4512d4[_0xa69f('0x1d')](0x194);}return _0x16f228;};}function handleError(_0x5d807a,_0x42c601){_0x42c601=_0x42c601||0x1f4;return function(_0x3c5710){logger[_0xa69f('0x2a')](_0x3c5710[_0xa69f('0x2b')]);if(_0x3c5710[_0xa69f('0x2c')]){delete _0x3c5710[_0xa69f('0x2c')];}_0x5d807a[_0xa69f('0x24')](_0x42c601)[_0xa69f('0x2d')](_0x3c5710);};}exports['index']=function(_0x4b5f48,_0x17b6b6){var _0x406aa7={},_0xa76c9e={},_0x283ee4={'count':0x0,'rows':[]};var _0x50beb9=_[_0xa69f('0x2e')](db[_0xa69f('0x2f')][_0xa69f('0x30')],function(_0x1bc6cb){return{'name':_0x1bc6cb[_0xa69f('0x31')],'type':_0x1bc6cb[_0xa69f('0x32')]['key']};});_0xa76c9e[_0xa69f('0x33')]=_[_0xa69f('0x2e')](_0x50beb9,'name');_0xa76c9e['query']=_[_0xa69f('0x34')](_0x4b5f48[_0xa69f('0x35')]);_0xa76c9e['filters']=_['intersection'](_0xa76c9e[_0xa69f('0x33')],_0xa76c9e[_0xa69f('0x35')]);_0x406aa7['attributes']=_['intersection'](_0xa76c9e['model'],qs[_0xa69f('0x36')](_0x4b5f48[_0xa69f('0x35')][_0xa69f('0x36')]));_0x406aa7[_0xa69f('0x37')]=_0x406aa7[_0xa69f('0x37')][_0xa69f('0x38')]?_0x406aa7[_0xa69f('0x37')]:_0xa76c9e[_0xa69f('0x33')];if(!_0x4b5f48[_0xa69f('0x35')]['hasOwnProperty'](_0xa69f('0x39'))){_0x406aa7['limit']=qs[_0xa69f('0x22')](_0x4b5f48[_0xa69f('0x35')][_0xa69f('0x22')]);_0x406aa7[_0xa69f('0x20')]=qs[_0xa69f('0x20')](_0x4b5f48[_0xa69f('0x35')][_0xa69f('0x20')]);}_0x406aa7[_0xa69f('0x3a')]=qs['sort'](_0x4b5f48[_0xa69f('0x35')][_0xa69f('0x3b')]);_0x406aa7[_0xa69f('0x3c')]=qs[_0xa69f('0x3d')](_[_0xa69f('0x3e')](_0x4b5f48[_0xa69f('0x35')],_0xa76c9e['filters']),_0x50beb9);if(_0x4b5f48[_0xa69f('0x35')]['filter']){_0x406aa7['where']=_[_0xa69f('0x3f')](_0x406aa7[_0xa69f('0x3c')],{'$or':_[_0xa69f('0x2e')](_0x50beb9,function(_0x4f245e){if(_0x4f245e[_0xa69f('0x32')]!==_0xa69f('0x40')){var _0x115d5b={};_0x115d5b[_0x4f245e[_0xa69f('0x2c')]]={'$like':'%'+_0x4b5f48['query'][_0xa69f('0x41')]+'%'};return _0x115d5b;}})});}_0x406aa7=_[_0xa69f('0x3f')]({},_0x406aa7,_0x4b5f48[_0xa69f('0x42')]);var _0x30e1ea={'where':_0x406aa7['where']};return db[_0xa69f('0x2f')][_0xa69f('0x23')](_0x30e1ea)[_0xa69f('0x29')](function(_0xd05b0){_0x283ee4[_0xa69f('0x23')]=_0xd05b0;if(_0x4b5f48['query'][_0xa69f('0x43')]){_0x406aa7['include']=[{'all':!![]}];}return db['SalesforceField'][_0xa69f('0x44')](_0x406aa7);})['then'](function(_0xec5d14){_0x283ee4[_0xa69f('0x45')]=_0xec5d14;return _0x283ee4;})['then'](respondWithFilteredResult(_0x17b6b6,_0x406aa7))['catch'](handleError(_0x17b6b6,null));};exports[_0xa69f('0x46')]=function(_0xa13c39,_0x160c74){var _0x58de1b={'raw':!![],'where':{'id':_0xa13c39[_0xa69f('0x47')]['id']}},_0x59eb51={};_0x59eb51[_0xa69f('0x33')]=_[_0xa69f('0x34')](db[_0xa69f('0x2f')][_0xa69f('0x30')]);_0x59eb51[_0xa69f('0x35')]=_[_0xa69f('0x34')](_0xa13c39[_0xa69f('0x35')]);_0x59eb51['filters']=_[_0xa69f('0x48')](_0x59eb51[_0xa69f('0x33')],_0x59eb51[_0xa69f('0x35')]);_0x58de1b[_0xa69f('0x37')]=_[_0xa69f('0x48')](_0x59eb51['model'],qs[_0xa69f('0x36')](_0xa13c39[_0xa69f('0x35')]['fields']));_0x58de1b[_0xa69f('0x37')]=_0x58de1b[_0xa69f('0x37')][_0xa69f('0x38')]?_0x58de1b[_0xa69f('0x37')]:_0x59eb51[_0xa69f('0x33')];if(_0xa13c39[_0xa69f('0x35')]['includeAll']){_0x58de1b[_0xa69f('0x49')]=[{'all':!![]}];}_0x58de1b=_[_0xa69f('0x3f')]({},_0x58de1b,_0xa13c39['options']);return db[_0xa69f('0x2f')][_0xa69f('0x4a')](_0x58de1b)[_0xa69f('0x29')](handleEntityNotFound(_0x160c74,null))['then'](respondWithResult(_0x160c74,null))['catch'](handleError(_0x160c74,null));};exports[_0xa69f('0x4b')]=function(_0x59bdcb,_0x1733c5){return db[_0xa69f('0x2f')][_0xa69f('0x4b')](_0x59bdcb[_0xa69f('0x4c')],{})['then'](respondWithResult(_0x1733c5,0xc9))[_0xa69f('0x4d')](handleError(_0x1733c5,null));};exports[_0xa69f('0x27')]=function(_0x2d1712,_0xffb1b0){if(_0x2d1712[_0xa69f('0x4c')]['id']){delete _0x2d1712[_0xa69f('0x4c')]['id'];}return db[_0xa69f('0x2f')][_0xa69f('0x4a')]({'where':{'id':_0x2d1712['params']['id']}})['then'](handleEntityNotFound(_0xffb1b0,null))[_0xa69f('0x29')](saveUpdates(_0x2d1712[_0xa69f('0x4c')],null))[_0xa69f('0x29')](respondWithResult(_0xffb1b0,null))['catch'](handleError(_0xffb1b0,null));};exports[_0xa69f('0x28')]=function(_0xfcf720,_0x47e079){return db[_0xa69f('0x2f')][_0xa69f('0x4a')]({'where':{'id':_0xfcf720[_0xa69f('0x47')]['id']}})[_0xa69f('0x29')](handleEntityNotFound(_0x47e079,null))[_0xa69f('0x29')](removeEntity(_0x47e079,null))['catch'](handleError(_0x47e079,null));}; \ No newline at end of file +var _0x7a90=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','SalesforceField','includeAll','include','findAll','rows','catch','show','params'];(function(_0x5676bc,_0x19c7b0){var _0x3ad6ac=function(_0x69aed8){while(--_0x69aed8){_0x5676bc['push'](_0x5676bc['shift']());}};_0x3ad6ac(++_0x19c7b0);}(_0x7a90,0x143));var _0x07a9=function(_0x4b2b88,_0x51f6c0){_0x4b2b88=_0x4b2b88-0x0;var _0x1558bb=_0x7a90[_0x4b2b88];return _0x1558bb;};'use strict';var emlformat=require(_0x07a9('0x0'));var rimraf=require(_0x07a9('0x1'));var zipdir=require(_0x07a9('0x2'));var jsonpatch=require(_0x07a9('0x3'));var rp=require(_0x07a9('0x4'));var moment=require(_0x07a9('0x5'));var BPromise=require(_0x07a9('0x6'));var Mustache=require('mustache');var util=require(_0x07a9('0x7'));var path=require(_0x07a9('0x8'));var sox=require(_0x07a9('0x9'));var csv=require('to-csv');var ejs=require(_0x07a9('0xa'));var fs=require('fs');var fs_extra=require(_0x07a9('0xb'));var _=require(_0x07a9('0xc'));var squel=require(_0x07a9('0xd'));var crypto=require(_0x07a9('0xe'));var jsforce=require(_0x07a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07a9('0x10'));var querystring=require(_0x07a9('0x11'));var Papa=require(_0x07a9('0x12'));var Redis=require(_0x07a9('0x13'));var authService=require(_0x07a9('0x14'));var qs=require(_0x07a9('0x15'));var as=require(_0x07a9('0x16'));var hardwareService=require(_0x07a9('0x17'));var logger=require(_0x07a9('0x18'))(_0x07a9('0x19'));var utils=require(_0x07a9('0x1a'));var config=require(_0x07a9('0x1b'));var licenseUtil=require(_0x07a9('0x1c'));var db=require(_0x07a9('0x1d'))['db'];function respondWithStatusCode(_0x2d5c69,_0x6f48b8){_0x6f48b8=_0x6f48b8||0xcc;return function(_0x1daaf1){if(_0x1daaf1){return _0x2d5c69[_0x07a9('0x1e')](_0x6f48b8);}return _0x2d5c69[_0x07a9('0x1f')](_0x6f48b8)[_0x07a9('0x20')]();};}function respondWithResult(_0x3074ad,_0x41b00f){_0x41b00f=_0x41b00f||0xc8;return function(_0xf77a4){if(_0xf77a4){return _0x3074ad[_0x07a9('0x1f')](_0x41b00f)[_0x07a9('0x21')](_0xf77a4);}};}function respondWithFilteredResult(_0x78c2dc,_0x198756){return function(_0x1c43fd){if(_0x1c43fd){var _0x1e0b8c=typeof _0x198756['offset']===_0x07a9('0x22')&&typeof _0x198756[_0x07a9('0x23')]===_0x07a9('0x22');var _0x5ddabe=_0x1c43fd[_0x07a9('0x24')];var _0x3ecb85=_0x1e0b8c?0x0:_0x198756[_0x07a9('0x25')];var _0x2cf210=_0x1e0b8c?_0x1c43fd[_0x07a9('0x24')]:_0x198756[_0x07a9('0x25')]+_0x198756[_0x07a9('0x23')];var _0xb0beaa;if(_0x2cf210>=_0x5ddabe){_0x2cf210=_0x5ddabe;_0xb0beaa=0xc8;}else{_0xb0beaa=0xce;}_0x78c2dc[_0x07a9('0x1f')](_0xb0beaa);return _0x78c2dc[_0x07a9('0x26')](_0x07a9('0x27'),_0x3ecb85+'-'+_0x2cf210+'/'+_0x5ddabe)[_0x07a9('0x21')](_0x1c43fd);}return null;};}function patchUpdates(_0x12ee3a){return function(_0x3365d2){try{jsonpatch[_0x07a9('0x28')](_0x3365d2,_0x12ee3a,!![]);}catch(_0x1f11f0){return BPromise['reject'](_0x1f11f0);}return _0x3365d2['save']();};}function saveUpdates(_0x1eabef,_0x220728){return function(_0x55bad2){if(_0x55bad2){return _0x55bad2[_0x07a9('0x29')](_0x1eabef)[_0x07a9('0x2a')](function(_0x338407){return _0x338407;});}return null;};}function removeEntity(_0x51f4f8,_0x1920b9){return function(_0x2369ac){if(_0x2369ac){return _0x2369ac[_0x07a9('0x2b')]()[_0x07a9('0x2a')](function(){_0x51f4f8[_0x07a9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50614c,_0x355006){return function(_0x3fddc0){if(!_0x3fddc0){_0x50614c[_0x07a9('0x1e')](0x194);}return _0x3fddc0;};}function handleError(_0x427380,_0x584f07){_0x584f07=_0x584f07||0x1f4;return function(_0x332585){logger[_0x07a9('0x2c')](_0x332585[_0x07a9('0x2d')]);if(_0x332585[_0x07a9('0x2e')]){delete _0x332585[_0x07a9('0x2e')];}_0x427380['status'](_0x584f07)['send'](_0x332585);};}exports[_0x07a9('0x2f')]=function(_0x460051,_0x465931){var _0x53af7a={},_0x5edd69={},_0x529670={'count':0x0,'rows':[]};var _0x3b24a3=_[_0x07a9('0x30')](db['SalesforceField'][_0x07a9('0x31')],function(_0x417432){return{'name':_0x417432[_0x07a9('0x32')],'type':_0x417432[_0x07a9('0x33')][_0x07a9('0x34')]};});_0x5edd69[_0x07a9('0x35')]=_[_0x07a9('0x30')](_0x3b24a3,_0x07a9('0x2e'));_0x5edd69[_0x07a9('0x36')]=_[_0x07a9('0x37')](_0x460051[_0x07a9('0x36')]);_0x5edd69[_0x07a9('0x38')]=_[_0x07a9('0x39')](_0x5edd69['model'],_0x5edd69['query']);_0x53af7a[_0x07a9('0x3a')]=_[_0x07a9('0x39')](_0x5edd69['model'],qs[_0x07a9('0x3b')](_0x460051[_0x07a9('0x36')][_0x07a9('0x3b')]));_0x53af7a[_0x07a9('0x3a')]=_0x53af7a[_0x07a9('0x3a')][_0x07a9('0x3c')]?_0x53af7a[_0x07a9('0x3a')]:_0x5edd69['model'];if(!_0x460051[_0x07a9('0x36')][_0x07a9('0x3d')](_0x07a9('0x3e'))){_0x53af7a[_0x07a9('0x23')]=qs[_0x07a9('0x23')](_0x460051[_0x07a9('0x36')]['limit']);_0x53af7a['offset']=qs['offset'](_0x460051['query'][_0x07a9('0x25')]);}_0x53af7a['order']=qs[_0x07a9('0x3f')](_0x460051[_0x07a9('0x36')][_0x07a9('0x3f')]);_0x53af7a[_0x07a9('0x40')]=qs[_0x07a9('0x38')](_[_0x07a9('0x41')](_0x460051['query'],_0x5edd69['filters']),_0x3b24a3);if(_0x460051[_0x07a9('0x36')][_0x07a9('0x42')]){_0x53af7a['where']=_[_0x07a9('0x43')](_0x53af7a[_0x07a9('0x40')],{'$or':_[_0x07a9('0x30')](_0x3b24a3,function(_0x13fda2){if(_0x13fda2[_0x07a9('0x33')]!=='VIRTUAL'){var _0x34d474={};_0x34d474[_0x13fda2[_0x07a9('0x2e')]]={'$like':'%'+_0x460051[_0x07a9('0x36')][_0x07a9('0x42')]+'%'};return _0x34d474;}})});}_0x53af7a=_[_0x07a9('0x43')]({},_0x53af7a,_0x460051[_0x07a9('0x44')]);var _0x2f433c={'where':_0x53af7a['where']};return db[_0x07a9('0x45')][_0x07a9('0x24')](_0x2f433c)[_0x07a9('0x2a')](function(_0x3cc1a2){_0x529670[_0x07a9('0x24')]=_0x3cc1a2;if(_0x460051['query'][_0x07a9('0x46')]){_0x53af7a[_0x07a9('0x47')]=[{'all':!![]}];}return db['SalesforceField'][_0x07a9('0x48')](_0x53af7a);})[_0x07a9('0x2a')](function(_0x72bda){_0x529670[_0x07a9('0x49')]=_0x72bda;return _0x529670;})[_0x07a9('0x2a')](respondWithFilteredResult(_0x465931,_0x53af7a))[_0x07a9('0x4a')](handleError(_0x465931,null));};exports[_0x07a9('0x4b')]=function(_0x2800b0,_0x2d025c){var _0x39ea44={'raw':!![],'where':{'id':_0x2800b0[_0x07a9('0x4c')]['id']}},_0x46ad31={};_0x46ad31['model']=_[_0x07a9('0x37')](db['SalesforceField'][_0x07a9('0x31')]);_0x46ad31['query']=_[_0x07a9('0x37')](_0x2800b0['query']);_0x46ad31[_0x07a9('0x38')]=_[_0x07a9('0x39')](_0x46ad31[_0x07a9('0x35')],_0x46ad31[_0x07a9('0x36')]);_0x39ea44[_0x07a9('0x3a')]=_['intersection'](_0x46ad31[_0x07a9('0x35')],qs[_0x07a9('0x3b')](_0x2800b0[_0x07a9('0x36')][_0x07a9('0x3b')]));_0x39ea44[_0x07a9('0x3a')]=_0x39ea44[_0x07a9('0x3a')][_0x07a9('0x3c')]?_0x39ea44[_0x07a9('0x3a')]:_0x46ad31[_0x07a9('0x35')];if(_0x2800b0[_0x07a9('0x36')][_0x07a9('0x46')]){_0x39ea44[_0x07a9('0x47')]=[{'all':!![]}];}_0x39ea44=_['merge']({},_0x39ea44,_0x2800b0[_0x07a9('0x44')]);return db[_0x07a9('0x45')][_0x07a9('0x4d')](_0x39ea44)[_0x07a9('0x2a')](handleEntityNotFound(_0x2d025c,null))[_0x07a9('0x2a')](respondWithResult(_0x2d025c,null))[_0x07a9('0x4a')](handleError(_0x2d025c,null));};exports['create']=function(_0x4982f5,_0x1af80c){return db['SalesforceField'][_0x07a9('0x4e')](_0x4982f5[_0x07a9('0x4f')],{})[_0x07a9('0x2a')](respondWithResult(_0x1af80c,0xc9))[_0x07a9('0x4a')](handleError(_0x1af80c,null));};exports[_0x07a9('0x29')]=function(_0x434faf,_0x269857){if(_0x434faf[_0x07a9('0x4f')]['id']){delete _0x434faf[_0x07a9('0x4f')]['id'];}return db[_0x07a9('0x45')]['find']({'where':{'id':_0x434faf[_0x07a9('0x4c')]['id']}})[_0x07a9('0x2a')](handleEntityNotFound(_0x269857,null))[_0x07a9('0x2a')](saveUpdates(_0x434faf[_0x07a9('0x4f')],null))[_0x07a9('0x2a')](respondWithResult(_0x269857,null))['catch'](handleError(_0x269857,null));};exports[_0x07a9('0x2b')]=function(_0x4b9c01,_0x590e95){return db[_0x07a9('0x45')]['find']({'where':{'id':_0x4b9c01['params']['id']}})[_0x07a9('0x2a')](handleEntityNotFound(_0x590e95,null))[_0x07a9('0x2a')](removeEntity(_0x590e95,null))['catch'](handleError(_0x590e95,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f6e482e..0885cd6 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 _0xe6e4=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField'];(function(_0x2b7d8a,_0x3ae57d){var _0x533d53=function(_0x23a7b9){while(--_0x23a7b9){_0x2b7d8a['push'](_0x2b7d8a['shift']());}};_0x533d53(++_0x3ae57d);}(_0xe6e4,0xd3));var _0x4e6e=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xe6e4[_0x46a671];return _0x526d75;};'use strict';var _=require(_0x4e6e('0x0'));var util=require(_0x4e6e('0x1'));var logger=require(_0x4e6e('0x2'))(_0x4e6e('0x3'));var moment=require(_0x4e6e('0x4'));var BPromise=require('bluebird');var rp=require(_0x4e6e('0x5'));var fs=require('fs');var path=require(_0x4e6e('0x6'));var rimraf=require('rimraf');var config=require(_0x4e6e('0x7'));var attributes=require(_0x4e6e('0x8'));module[_0x4e6e('0x9')]=function(_0x1817e7,_0x1dfc10){return _0x1817e7[_0x4e6e('0xa')](_0x4e6e('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x4e6e('0xc'),'fields':[_0x4e6e('0xd'),_0x4e6e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ac1=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','FieldId','lodash','util','api','moment','request-promise','path'];(function(_0x81e07c,_0x13d9aa){var _0x55a038=function(_0x27e3a4){while(--_0x27e3a4){_0x81e07c['push'](_0x81e07c['shift']());}};_0x55a038(++_0x13d9aa);}(_0x5ac1,0x19e));var _0x15ac=function(_0x53228f,_0x4abb42){_0x53228f=_0x53228f-0x0;var _0x461513=_0x5ac1[_0x53228f];return _0x461513;};'use strict';var _=require(_0x15ac('0x0'));var util=require(_0x15ac('0x1'));var logger=require('../../config/logger')(_0x15ac('0x2'));var moment=require(_0x15ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x15ac('0x4'));var fs=require('fs');var path=require(_0x15ac('0x5'));var rimraf=require(_0x15ac('0x6'));var config=require(_0x15ac('0x7'));var attributes=require(_0x15ac('0x8'));module[_0x15ac('0x9')]=function(_0x47c011,_0x2352d7){return _0x47c011[_0x15ac('0xa')](_0x15ac('0xb'),attributes,{'tableName':_0x15ac('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x15ac('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index f61da69..31be117 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 _0xa696=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2baab2,_0x4050ef){var _0x1df670=function(_0x45729b){while(--_0x45729b){_0x2baab2['push'](_0x2baab2['shift']());}};_0x1df670(++_0x4050ef);}(_0xa696,0xfd));var _0x6a69=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0xa696[_0x254b22];return _0x1279db;};'use strict';var _=require('lodash');var util=require(_0x6a69('0x0'));var moment=require(_0x6a69('0x1'));var BPromise=require(_0x6a69('0x2'));var rs=require(_0x6a69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a69('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a69('0x5'))(_0x6a69('0x6'));var config=require(_0x6a69('0x7'));var jayson=require(_0x6a69('0x8'));var client=jayson[_0x6a69('0x9')][_0x6a69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x132c08,_0x2d1209,_0x39c4ce){return new BPromise(function(_0x3e5654,_0x2f7059){return client[_0x6a69('0xb')](_0x132c08,_0x39c4ce)[_0x6a69('0xc')](function(_0x13c199){logger[_0x6a69('0xd')](_0x6a69('0xe'),_0x2d1209,_0x6a69('0xf'));logger['debug'](_0x6a69('0x10'),_0x2d1209,_0x6a69('0xf'),JSON[_0x6a69('0x11')](_0x13c199));if(_0x13c199['error']){if(_0x13c199[_0x6a69('0x12')]['code']===0x1f4){logger[_0x6a69('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2d1209,_0x13c199['error'][_0x6a69('0x13')]);return _0x2f7059(_0x13c199['error'][_0x6a69('0x13')]);}logger[_0x6a69('0x12')](_0x6a69('0xe'),_0x2d1209,_0x13c199['error'][_0x6a69('0x13')]);return _0x3e5654(_0x13c199[_0x6a69('0x12')][_0x6a69('0x13')]);}else{logger[_0x6a69('0xd')](_0x6a69('0xe'),_0x2d1209,_0x6a69('0xf'));_0x3e5654(_0x13c199['result'][_0x6a69('0x13')]);}})[_0x6a69('0x14')](function(_0x54e23e){logger['error'](_0x6a69('0xe'),_0x2d1209,_0x54e23e);_0x2f7059(_0x54e23e);});});} \ No newline at end of file +var _0xca01=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52d77c,_0x444105){var _0x526c14=function(_0x4eea0f){while(--_0x4eea0f){_0x52d77c['push'](_0x52d77c['shift']());}};_0x526c14(++_0x444105);}(_0xca01,0xad));var _0x1ca0=function(_0x565a32,_0x2f8937){_0x565a32=_0x565a32-0x0;var _0xf9ed48=_0xca01[_0x565a32];return _0xf9ed48;};'use strict';var _=require(_0x1ca0('0x0'));var util=require(_0x1ca0('0x1'));var moment=require(_0x1ca0('0x2'));var BPromise=require(_0x1ca0('0x3'));var rs=require(_0x1ca0('0x4'));var fs=require('fs');var Redis=require(_0x1ca0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ca0('0x6'));var logger=require(_0x1ca0('0x7'))(_0x1ca0('0x8'));var config=require(_0x1ca0('0x9'));var jayson=require(_0x1ca0('0xa'));var client=jayson['client'][_0x1ca0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ac9f7,_0x8e2d6a,_0x1c9a48){return new BPromise(function(_0x3ee7f4,_0x3b80b1){return client[_0x1ca0('0xc')](_0x1ac9f7,_0x1c9a48)[_0x1ca0('0xd')](function(_0x3b5862){logger[_0x1ca0('0xe')](_0x1ca0('0xf'),_0x8e2d6a,_0x1ca0('0x10'));logger['debug'](_0x1ca0('0x11'),_0x8e2d6a,_0x1ca0('0x10'),JSON[_0x1ca0('0x12')](_0x3b5862));if(_0x3b5862[_0x1ca0('0x13')]){if(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x14')]===0x1f4){logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);return _0x3b80b1(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);}logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0x3b5862[_0x1ca0('0x13')]['message']);return _0x3ee7f4(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);}else{logger['info'](_0x1ca0('0xf'),_0x8e2d6a,'request\x20sent');_0x3ee7f4(_0x3b5862[_0x1ca0('0x16')][_0x1ca0('0x15')]);}})['catch'](function(_0xfff638){logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0xfff638);_0x3b80b1(_0xfff638);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 746a5a3..f8d1abd 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 _0xd2ce=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/configurations','isAuthenticated'];(function(_0x4438f0,_0x3e4909){var _0x5ed82b=function(_0x2eea9a){while(--_0x2eea9a){_0x4438f0['push'](_0x4438f0['shift']());}};_0x5ed82b(++_0x3e4909);}(_0xd2ce,0x13c));var _0xed2c=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xd2ce[_0x12d033];return _0x3b4e80;};'use strict';var multer=require('multer');var util=require(_0xed2c('0x0'));var path=require('path');var timeout=require(_0xed2c('0x1'));var express=require(_0xed2c('0x2'));var router=express[_0xed2c('0x3')]();var fs_extra=require(_0xed2c('0x4'));var auth=require(_0xed2c('0x5'));var interaction=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var controller=require('./intServicenowAccount.controller');router[_0xed2c('0x8')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x9')]);router[_0xed2c('0x8')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0xb')]);router['get'](_0xed2c('0xc'),auth[_0xed2c('0xd')](),controller['getConfigurations']);router['get'](_0xed2c('0xe'),auth[_0xed2c('0xd')](),controller[_0xed2c('0xf')]);router[_0xed2c('0x10')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x11')]);router[_0xed2c('0x10')](_0xed2c('0xc'),auth[_0xed2c('0xd')](),controller[_0xed2c('0x12')]);router['put'](_0xed2c('0xa'),auth[_0xed2c('0xd')](),controller[_0xed2c('0x13')]);router[_0xed2c('0x14')](_0xed2c('0xa'),auth[_0xed2c('0xd')](),controller['destroy']);module[_0xed2c('0x15')]=router; \ No newline at end of file +var _0x55c7=['getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/fields'];(function(_0xbf8c62,_0x84b913){var _0x2fa1be=function(_0x12bcd4){while(--_0x12bcd4){_0xbf8c62['push'](_0xbf8c62['shift']());}};_0x2fa1be(++_0x84b913);}(_0x55c7,0x127));var _0x755c=function(_0x200400,_0x1f0e9f){_0x200400=_0x200400-0x0;var _0x3f92f8=_0x55c7[_0x200400];return _0x3f92f8;};'use strict';var multer=require('multer');var util=require(_0x755c('0x0'));var path=require(_0x755c('0x1'));var timeout=require(_0x755c('0x2'));var express=require(_0x755c('0x3'));var router=express[_0x755c('0x4')]();var fs_extra=require(_0x755c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x755c('0x6'));var config=require('../../config/environment');var controller=require(_0x755c('0x7'));router['get']('/',auth[_0x755c('0x8')](),controller[_0x755c('0x9')]);router[_0x755c('0xa')]('/:id',auth[_0x755c('0x8')](),controller[_0x755c('0xb')]);router['get']('/:id/configurations',auth[_0x755c('0x8')](),controller['getConfigurations']);router[_0x755c('0xa')](_0x755c('0xc'),auth['isAuthenticated'](),controller[_0x755c('0xd')]);router[_0x755c('0xe')]('/',auth[_0x755c('0x8')](),controller['create']);router[_0x755c('0xe')](_0x755c('0xf'),auth[_0x755c('0x8')](),controller[_0x755c('0x10')]);router[_0x755c('0x11')]('/:id',auth[_0x755c('0x8')](),controller[_0x755c('0x12')]);router[_0x755c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x755c('0x14')]);module[_0x755c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index e387b3b..9bc0bb5 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 _0x7e34=['remoteUri','exports','STRING','username'];(function(_0x5db6f5,_0x515567){var _0x119303=function(_0x58c973){while(--_0x58c973){_0x5db6f5['push'](_0x5db6f5['shift']());}};_0x119303(++_0x515567);}(_0x7e34,0x1d1));var _0x47e3=function(_0x43b4a2,_0x520e8d){_0x43b4a2=_0x43b4a2-0x0;var _0x6055d8=_0x7e34[_0x43b4a2];return _0x6055d8;};'use strict';var Sequelize=require('sequelize');module[_0x47e3('0x0')]={'name':{'type':Sequelize[_0x47e3('0x1')]},'description':{'type':Sequelize[_0x47e3('0x1')]},'username':{'type':Sequelize[_0x47e3('0x1')],'unique':_0x47e3('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x47e3('0x1')]},'remoteUri':{'type':Sequelize[_0x47e3('0x1')],'unique':_0x47e3('0x3')},'serverUrl':{'type':Sequelize[_0x47e3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xcb25=['remoteUri','sequelize','STRING','username'];(function(_0x322257,_0xd267a7){var _0x40aa7e=function(_0x482f39){while(--_0x482f39){_0x322257['push'](_0x322257['shift']());}};_0x40aa7e(++_0xd267a7);}(_0xcb25,0xb5));var _0x5cb2=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xcb25[_0x3acee8];return _0x5046cc;};'use strict';var Sequelize=require(_0x5cb2('0x0'));module['exports']={'name':{'type':Sequelize[_0x5cb2('0x1')]},'description':{'type':Sequelize[_0x5cb2('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x5cb2('0x2')},'password':{'type':Sequelize[_0x5cb2('0x1')]},'email':{'type':Sequelize[_0x5cb2('0x1')]},'remoteUri':{'type':Sequelize[_0x5cb2('0x1')],'unique':_0x5cb2('0x3')},'serverUrl':{'type':Sequelize[_0x5cb2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8609e40..ba3bfe7 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 _0x49fb=['../../components/integrations/configuration','sendStatus','status','undefined','limit','offset','count','set','json','save','then','destroy','end','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','knowledge','subcategory','close_code','incident_state','severity','category','caused_by','watch_list','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','reopened_time','resolved_at','caller_id','approval_set','work_notes','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','sys_id','contact_type','reopened_by','problem_id','company','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','substring','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','error','send','test','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util'];(function(_0x3df568,_0x3de3b3){var _0x451540=function(_0x3ccffd){while(--_0x3ccffd){_0x3df568['push'](_0x3df568['shift']());}};_0x451540(++_0x3de3b3);}(_0x49fb,0xa2));var _0xb49f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x49fb[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xb49f('0x0'));var rimraf=require(_0xb49f('0x1'));var zipdir=require(_0xb49f('0x2'));var jsonpatch=require(_0xb49f('0x3'));var rp=require(_0xb49f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb49f('0x5'));var path=require(_0xb49f('0x6'));var sox=require('sox');var csv=require(_0xb49f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb49f('0x8'));var _=require(_0xb49f('0x9'));var squel=require(_0xb49f('0xa'));var crypto=require(_0xb49f('0xb'));var jsforce=require(_0xb49f('0xc'));var deskjs=require(_0xb49f('0xd'));var toCsv=require(_0xb49f('0x7'));var querystring=require(_0xb49f('0xe'));var Papa=require(_0xb49f('0xf'));var Redis=require(_0xb49f('0x10'));var authService=require(_0xb49f('0x11'));var qs=require(_0xb49f('0x12'));var as=require(_0xb49f('0x13'));var hardwareService=require(_0xb49f('0x14'));var logger=require(_0xb49f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb49f('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb49f('0x17'));function respondWithStatusCode(_0x2b5a3a,_0x4e9b91){_0x4e9b91=_0x4e9b91||0xcc;return function(_0x2c9004){if(_0x2c9004){return _0x2b5a3a[_0xb49f('0x18')](_0x4e9b91);}return _0x2b5a3a[_0xb49f('0x19')](_0x4e9b91)['end']();};}function respondWithResult(_0x53df85,_0x23cbdd){_0x23cbdd=_0x23cbdd||0xc8;return function(_0x4960b3){if(_0x4960b3){return _0x53df85[_0xb49f('0x19')](_0x23cbdd)['json'](_0x4960b3);}};}function respondWithFilteredResult(_0x443229,_0x544f21){return function(_0xd7ec12){if(_0xd7ec12){var _0x7e2f80=typeof _0x544f21['offset']===_0xb49f('0x1a')&&typeof _0x544f21[_0xb49f('0x1b')]===_0xb49f('0x1a');var _0x5f3bda=_0xd7ec12['count'];var _0x3eef40=_0x7e2f80?0x0:_0x544f21[_0xb49f('0x1c')];var _0x27bdcb=_0x7e2f80?_0xd7ec12[_0xb49f('0x1d')]:_0x544f21[_0xb49f('0x1c')]+_0x544f21[_0xb49f('0x1b')];var _0x218d3e;if(_0x27bdcb>=_0x5f3bda){_0x27bdcb=_0x5f3bda;_0x218d3e=0xc8;}else{_0x218d3e=0xce;}_0x443229[_0xb49f('0x19')](_0x218d3e);return _0x443229[_0xb49f('0x1e')]('Content-Range',_0x3eef40+'-'+_0x27bdcb+'/'+_0x5f3bda)[_0xb49f('0x1f')](_0xd7ec12);}return null;};}function patchUpdates(_0x418953){return function(_0x5717ba){try{jsonpatch['apply'](_0x5717ba,_0x418953,!![]);}catch(_0x588276){return BPromise['reject'](_0x588276);}return _0x5717ba[_0xb49f('0x20')]();};}function saveUpdates(_0x34fd4f,_0x2fdfb1){return function(_0x1cd084){if(_0x1cd084){return _0x1cd084['update'](_0x34fd4f)[_0xb49f('0x21')](function(_0x357a14){return _0x357a14;});}return null;};}function removeEntity(_0x4bf46f,_0x127bc9){return function(_0x57e300){if(_0x57e300){return _0x57e300[_0xb49f('0x22')]()[_0xb49f('0x21')](function(){_0x4bf46f[_0xb49f('0x19')](0xcc)[_0xb49f('0x23')]();});}};}function handleEntityNotFound(_0x5f193f,_0x409aeb){return function(_0x525469){if(!_0x525469){_0x5f193f[_0xb49f('0x18')](0x194);}return _0x525469;};}function handleError(_0x124def,_0x3eaff5){_0x3eaff5=_0x3eaff5||0x1f4;return function(_0x1b1d85){logger['error'](_0x1b1d85[_0xb49f('0x24')]);if(_0x1b1d85['name']){delete _0x1b1d85[_0xb49f('0x25')];}_0x124def[_0xb49f('0x19')](_0x3eaff5)['send'](_0x1b1d85);};}exports[_0xb49f('0x26')]=function(_0x29d04a,_0x3693f0){var _0x51784b={},_0x39fe16={},_0x271a1c={'count':0x0,'rows':[]};var _0x557c4b=_[_0xb49f('0x27')](db[_0xb49f('0x28')][_0xb49f('0x29')],function(_0x4f6776){return{'name':_0x4f6776[_0xb49f('0x2a')],'type':_0x4f6776['type']['key']};});_0x39fe16[_0xb49f('0x2b')]=_[_0xb49f('0x27')](_0x557c4b,'name');_0x39fe16[_0xb49f('0x2c')]=_[_0xb49f('0x2d')](_0x29d04a[_0xb49f('0x2c')]);_0x39fe16[_0xb49f('0x2e')]=_[_0xb49f('0x2f')](_0x39fe16[_0xb49f('0x2b')],_0x39fe16[_0xb49f('0x2c')]);_0x51784b[_0xb49f('0x30')]=_[_0xb49f('0x2f')](_0x39fe16[_0xb49f('0x2b')],qs[_0xb49f('0x31')](_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x31')]));_0x51784b[_0xb49f('0x30')]=_0x51784b['attributes'][_0xb49f('0x32')]?_0x51784b['attributes']:_0x39fe16[_0xb49f('0x2b')];if(!_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x33')](_0xb49f('0x34'))){_0x51784b[_0xb49f('0x1b')]=qs['limit'](_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x1b')]);_0x51784b[_0xb49f('0x1c')]=qs['offset'](_0x29d04a['query'][_0xb49f('0x1c')]);}_0x51784b[_0xb49f('0x35')]=qs[_0xb49f('0x36')](_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x36')]);_0x51784b[_0xb49f('0x37')]=qs[_0xb49f('0x2e')](_[_0xb49f('0x38')](_0x29d04a[_0xb49f('0x2c')],_0x39fe16['filters']),_0x557c4b);if(_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x39')]){_0x51784b['where']=_['merge'](_0x51784b[_0xb49f('0x37')],{'$or':_['map'](_0x557c4b,function(_0x2d146e){if(_0x2d146e[_0xb49f('0x3a')]!==_0xb49f('0x3b')){var _0x13a644={};_0x13a644[_0x2d146e[_0xb49f('0x25')]]={'$like':'%'+_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x39')]+'%'};return _0x13a644;}})});}_0x51784b=_['merge']({},_0x51784b,_0x29d04a[_0xb49f('0x3c')]);var _0x1127b8={'where':_0x51784b[_0xb49f('0x37')]};return db[_0xb49f('0x28')][_0xb49f('0x1d')](_0x1127b8)[_0xb49f('0x21')](function(_0x4d0a2f){_0x271a1c[_0xb49f('0x1d')]=_0x4d0a2f;if(_0x29d04a[_0xb49f('0x2c')][_0xb49f('0x3d')]){_0x51784b[_0xb49f('0x3e')]=[{'all':!![]}];}return db[_0xb49f('0x28')][_0xb49f('0x3f')](_0x51784b);})[_0xb49f('0x21')](function(_0x3e8fdd){_0x271a1c[_0xb49f('0x40')]=_0x3e8fdd;return _0x271a1c;})[_0xb49f('0x21')](respondWithFilteredResult(_0x3693f0,_0x51784b))[_0xb49f('0x41')](handleError(_0x3693f0,null));};exports[_0xb49f('0x42')]=function(_0x188902,_0x369a67){var _0x5512a5={'raw':![],'where':{'id':_0x188902[_0xb49f('0x43')]['id']}},_0x1341e0={};_0x1341e0[_0xb49f('0x2b')]=_[_0xb49f('0x2d')](db[_0xb49f('0x28')][_0xb49f('0x29')]);_0x1341e0[_0xb49f('0x2c')]=_[_0xb49f('0x2d')](_0x188902[_0xb49f('0x2c')]);_0x1341e0[_0xb49f('0x2e')]=_[_0xb49f('0x2f')](_0x1341e0[_0xb49f('0x2b')],_0x1341e0[_0xb49f('0x2c')]);_0x5512a5[_0xb49f('0x30')]=_[_0xb49f('0x2f')](_0x1341e0[_0xb49f('0x2b')],qs[_0xb49f('0x31')](_0x188902[_0xb49f('0x2c')][_0xb49f('0x31')]));_0x5512a5[_0xb49f('0x30')]=_0x5512a5[_0xb49f('0x30')][_0xb49f('0x32')]?_0x5512a5[_0xb49f('0x30')]:_0x1341e0[_0xb49f('0x2b')];if(_0x188902[_0xb49f('0x2c')][_0xb49f('0x3d')]){_0x5512a5[_0xb49f('0x3e')]=[{'all':!![]}];}_0x5512a5=_[_0xb49f('0x44')]({},_0x5512a5,_0x188902[_0xb49f('0x3c')]);return db['ServicenowAccount'][_0xb49f('0x45')](_0x5512a5)[_0xb49f('0x21')](handleEntityNotFound(_0x369a67,null))['then'](respondWithResult(_0x369a67,null))['catch'](handleError(_0x369a67,null));};exports[_0xb49f('0x46')]=function(_0x5a281a,_0x1e808d){return db[_0xb49f('0x28')][_0xb49f('0x46')](_0x5a281a['body'],{})[_0xb49f('0x21')](respondWithResult(_0x1e808d,0xc9))[_0xb49f('0x41')](handleError(_0x1e808d,null));};exports['update']=function(_0x311e4e,_0x42c6a5){if(_0x311e4e[_0xb49f('0x47')]['id']){delete _0x311e4e[_0xb49f('0x47')]['id'];}return db[_0xb49f('0x28')]['find']({'where':{'id':_0x311e4e[_0xb49f('0x43')]['id']}})[_0xb49f('0x21')](handleEntityNotFound(_0x42c6a5,null))[_0xb49f('0x21')](saveUpdates(_0x311e4e['body'],null))[_0xb49f('0x21')](respondWithResult(_0x42c6a5,null))[_0xb49f('0x41')](handleError(_0x42c6a5,null));};exports['destroy']=function(_0x36c241,_0x480815){return db['ServicenowAccount'][_0xb49f('0x45')]({'where':{'id':_0x36c241[_0xb49f('0x43')]['id']}})['then'](handleEntityNotFound(_0x480815,null))[_0xb49f('0x21')](removeEntity(_0x480815,null))[_0xb49f('0x41')](handleError(_0x480815,null));};exports['getConfigurations']=function(_0xc30648,_0x487823,_0xa30f44){var _0xada931={};var _0x41c206={};var _0x2b0905;var _0x29cd81;return db[_0xb49f('0x28')][_0xb49f('0x48')]({'where':{'id':_0xc30648['params']['id']}})[_0xb49f('0x21')](handleEntityNotFound(_0x487823,null))[_0xb49f('0x21')](function(_0x47ba02){if(_0x47ba02){_0x2b0905=_0x47ba02;_0x41c206[_0xb49f('0x2b')]=_['keys'](db[_0xb49f('0x49')][_0xb49f('0x29')]);_0x41c206[_0xb49f('0x2c')]=_['keys'](_0xc30648[_0xb49f('0x2c')]);_0x41c206['filters']=_['intersection'](_0x41c206['model'],_0x41c206[_0xb49f('0x2c')]);_0xada931['attributes']=_['intersection'](_0x41c206[_0xb49f('0x2b')],qs[_0xb49f('0x31')](_0xc30648[_0xb49f('0x2c')][_0xb49f('0x31')]));_0xada931[_0xb49f('0x30')]=_0xada931[_0xb49f('0x30')][_0xb49f('0x32')]?_0xada931[_0xb49f('0x30')]:_0x41c206[_0xb49f('0x2b')];_0xada931[_0xb49f('0x35')]=qs['sort'](_0xc30648[_0xb49f('0x2c')][_0xb49f('0x36')]);_0xada931['where']=qs[_0xb49f('0x2e')](_[_0xb49f('0x38')](_0xc30648[_0xb49f('0x2c')],_0x41c206[_0xb49f('0x2e')]));if(_0xc30648[_0xb49f('0x2c')][_0xb49f('0x39')]){_0xada931['where']=_[_0xb49f('0x44')](_0xada931['where'],{'$or':_[_0xb49f('0x27')](_0xada931[_0xb49f('0x30')],function(_0x435a19){var _0x3c503a={};_0x3c503a[_0x435a19]={'$like':'%'+_0xc30648[_0xb49f('0x2c')]['filter']+'%'};return _0x3c503a;})});}_0xada931=_[_0xb49f('0x44')]({},_0xada931,_0xc30648['options']);return _0x2b0905[_0xb49f('0x4a')](_0xada931);}})[_0xb49f('0x21')](function(_0x17cb30){if(_0x17cb30){_0x29cd81=_0x17cb30[_0xb49f('0x32')];if(!_0xc30648[_0xb49f('0x2c')][_0xb49f('0x33')]('nolimit')){_0xada931[_0xb49f('0x1b')]=qs[_0xb49f('0x1b')](_0xc30648['query'][_0xb49f('0x1b')]);_0xada931[_0xb49f('0x1c')]=qs[_0xb49f('0x1c')](_0xc30648[_0xb49f('0x2c')][_0xb49f('0x1c')]);}return _0x2b0905[_0xb49f('0x4a')](_0xada931);}})[_0xb49f('0x21')](function(_0x4bfea5){if(_0x4bfea5){return _0x4bfea5?{'count':_0x29cd81,'rows':_0x4bfea5}:null;}})[_0xb49f('0x21')](respondWithResult(_0x487823,null))[_0xb49f('0x41')](handleError(_0x487823,null));};exports[_0xb49f('0x4b')]=function(_0x5a175b,_0x191270,_0x31a9d8){if(_0x5a175b[_0xb49f('0x47')]['id']){delete _0x5a175b[_0xb49f('0x47')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x5a175b[_0xb49f('0x43')]['id']}})['then'](handleEntityNotFound(_0x191270,null))[_0xb49f('0x21')](function(_0x5e42c9){if(_0x5e42c9){_0x5a175b[_0xb49f('0x47')][_0xb49f('0x4c')]=_0x5e42c9['id'];_0x5a175b[_0xb49f('0x47')][_0xb49f('0x4d')]=integrations[_0xb49f('0x4e')](_0x5a175b[_0xb49f('0x47')][_0xb49f('0x4f')],_0x5a175b[_0xb49f('0x47')]['type']);_0x5a175b['body']['Descriptions']=integrations[_0xb49f('0x50')](_0x5a175b[_0xb49f('0x47')]['channel'],_0x5a175b[_0xb49f('0x47')]['type']);return db[_0xb49f('0x49')][_0xb49f('0x46')](_0x5a175b[_0xb49f('0x47')],{'include':[{'model':db[_0xb49f('0x51')],'as':_0xb49f('0x4d')},{'model':db['ServicenowField'],'as':_0xb49f('0x52')}]});}return null;})[_0xb49f('0x21')](respondWithResult(_0x191270,null))[_0xb49f('0x41')](handleError(_0x191270,null));};exports[_0xb49f('0x53')]=function(_0x3cd4c6,_0x1be5e7,_0x362a8b){var _0x676c3f=['made_sla','hold_reason',_0xb49f('0x54'),_0xb49f('0x55'),_0xb49f('0x56'),'notify',_0xb49f('0x57'),_0xb49f('0x58'),_0xb49f('0x59')];var _0x481d96=['parent','made_sla',_0xb49f('0x5a'),_0xb49f('0x5b'),'upon_reject',_0xb49f('0x5c'),'child_incidents',_0xb49f('0x5d'),_0xb49f('0x5e'),_0xb49f('0x5f'),_0xb49f('0x60'),_0xb49f('0x61'),_0xb49f('0x62'),'user_input',_0xb49f('0x63'),_0xb49f('0x64'),_0xb49f('0x65'),_0xb49f('0x66'),_0xb49f('0x54'),'order',_0xb49f('0x67'),'closed_at','cmdb_ci',_0xb49f('0x68'),'impact',_0xb49f('0x69'),_0xb49f('0x6a'),_0xb49f('0x6b'),_0xb49f('0x6c'),_0xb49f('0x6d'),_0xb49f('0x6e'),_0xb49f('0x6f'),'expected_start',_0xb49f('0x70'),'business_duration','group_list','work_end',_0xb49f('0x71'),_0xb49f('0x72'),_0xb49f('0x73'),_0xb49f('0x74'),_0xb49f('0x55'),_0xb49f('0x75'),_0xb49f('0x76'),'close_code',_0xb49f('0x77'),'delivery_task',_0xb49f('0x78'),_0xb49f('0x79'),_0xb49f('0x7a'),_0xb49f('0x7b'),_0xb49f('0x7c'),_0xb49f('0x7d'),'notify',_0xb49f('0x7e'),_0xb49f('0x7f'),_0xb49f('0x80'),_0xb49f('0x81'),_0xb49f('0x82'),_0xb49f('0x83'),_0xb49f('0x84'),_0xb49f('0x85'),_0xb49f('0x57'),'urgency',_0xb49f('0x86'),_0xb49f('0x87'),'reassignment_count',_0xb49f('0x88'),_0xb49f('0x89'),_0xb49f('0x58'),'comments',_0xb49f('0x8a'),_0xb49f('0x8b'),_0xb49f('0x8c'),_0xb49f('0x8d'),_0xb49f('0x8e'),_0xb49f('0x8f'),_0xb49f('0x90'),_0xb49f('0x91'),_0xb49f('0x92'),_0xb49f('0x93'),_0xb49f('0x94'),'category'];var _0x452317='';var _0x2b88fe='';var _0x17f122=[];var _0x3e3167='';var _0x5bc5a4='';var _0xc5a3e=[];var _0x3e669d='';var _0xa7f904='';var _0x581006={};var _0xfa629e='';return db[_0xb49f('0x28')][_0xb49f('0x48')]({'where':{'id':_0x3cd4c6[_0xb49f('0x43')]['id']},'attributes':['id',_0xb49f('0x95'),_0xb49f('0x96'),'email',_0xb49f('0x97'),_0xb49f('0x98')]})['then'](handleEntityNotFound(_0x1be5e7,null))['then'](function(_0x38f8b0){if(_0x38f8b0){_0xfa629e=_0x38f8b0['remoteUri'];var _0x4b7542=_0xfa629e['slice'](-0x1);if(_0x4b7542==='/'){_0xfa629e=_0xfa629e[_0xb49f('0x99')](0x0,_0xfa629e['lastIndexOf'](_0x4b7542));}_0xa7f904=util[_0xb49f('0x9a')]('%s/api/now/doc/table/schema/',_0xfa629e);_0x3e669d=util[_0xb49f('0x9a')](_0xb49f('0x9b'),_0xfa629e);_0x581006={'user':_0x38f8b0['username'],'pass':_0x38f8b0[_0xb49f('0x96')]};var _0x272989={'method':_0xb49f('0x9c'),'uri':_0xa7f904+_0xb49f('0x9d'),'auth':_0x581006,'json':!![]};return rp(_0x272989);}})[_0xb49f('0x21')](function(_0x4852a4){if(_0x4852a4[_0xb49f('0x9e')][_0xb49f('0x32')]>0x0){_0x452317=_0x4852a4[_0xb49f('0x9e')];}console['log'](_0xb49f('0x9f'),_0x452317);_0xc5a3e=[];_0x2b88fe=Object[_0xb49f('0xa0')]([],_0x452317);_[_0xb49f('0xa1')](_0x2b88fe,function(_0x2fc137){return!_0x676c3f[_0xb49f('0xa2')](_0x2fc137[_0xb49f('0x25')]);});_0x2b88fe[_0xb49f('0xa3')](function(_0x11f18a){var _0x572e5f=createFieldObject(_0x3e669d,_0x581006,_0x11f18a[_0xb49f('0xa4')],_0x11f18a[_0xb49f('0x25')],_0x11f18a[_0xb49f('0xa5')],![]);_0xc5a3e[_0xb49f('0xa6')](_0x572e5f);});return Promise['all'](_0xc5a3e);})['then'](function(_0x2543da){_0x17f122=_0x2543da;_0x3e3167=Object['assign']([],_0x452317);console[_0xb49f('0xa7')](_0xb49f('0xa8'),_0x452317);_[_0xb49f('0xa1')](_0x3e3167,function(_0x235b1a){return _0x481d96[_0xb49f('0xa2')](_0x235b1a['name']);});console[_0xb49f('0xa7')](_0xb49f('0xa9'),_0x3e3167);_0xc5a3e=[];_0x3e3167[_0xb49f('0xa3')](function(_0x2347ba){var _0x4f09c6=createFieldObject(_0x3e669d,_0x581006,_0x2347ba[_0xb49f('0xa4')],_0x2347ba[_0xb49f('0x25')],_0x2347ba[_0xb49f('0xa5')],!![]);_0xc5a3e['push'](_0x4f09c6);});return Promise[_0xb49f('0xaa')](_0xc5a3e);})[_0xb49f('0x21')](function(_0x4d951c){_0x5bc5a4=_0x4d951c;var _0x222285=_0x17f122[_0xb49f('0xab')](_0x5bc5a4);return{'count':_0x222285[_0xb49f('0x32')],'rows':_0x222285};})[_0xb49f('0x21')](respondWithResult(_0x1be5e7,null))['catch'](function(_0x3f9847){console[_0xb49f('0xa7')](_0xb49f('0xac')+_0x3f9847);var _0x60d3b2=_0x3cd4c6['query']['test']?0x1f4:_0x3f9847[_0xb49f('0xad')]||0x1f4;logger[_0xb49f('0xae')](_0x3f9847[_0xb49f('0x24')]);delete _0x3f9847[_0xb49f('0x25')];if(_0x60d3b2===0x191){_0x60d3b2=0x190;}_0x1be5e7['status'](_0x60d3b2)[_0xb49f('0xaf')](_0x3cd4c6[_0xb49f('0x2c')][_0xb49f('0xb0')]?{'message':_0xb49f('0xb1'),'statusCode':_0x3f9847['statusCode']}:_0x3f9847);});};function createFieldObject(_0x1112c2,_0x4ee10b,_0x152710,_0x3af4dc,_0x519bc0,_0x93f9c2){return new Promise(function(_0x3105a9,_0x85e1c){var _0xe85bc0={'id':_0x3af4dc,'name':_0x519bc0,'custom':_0x93f9c2};if(_0x152710==='boolean'){_0xe85bc0[_0xb49f('0x3c')]=[{'name':_0xb49f('0xb2'),'value':_0xb49f('0xb3')},{'name':_0xb49f('0xb4'),'value':_0xb49f('0xb5')}];_0x3105a9(_0xe85bc0);}else{var _0x2a9a3d={'method':_0xb49f('0x9c'),'uri':_0x1112c2+_0xb49f('0xb6')+_0x3af4dc,'auth':_0x4ee10b,'json':!![]};return rp(_0x2a9a3d)[_0xb49f('0x21')](function(_0x27616d){var _0x40e53b=[];if(_0x27616d[_0xb49f('0x9e')]['length']>0x0){_0x27616d[_0xb49f('0x9e')][_0xb49f('0xa3')](function(_0x4a5c95){if(_0x4a5c95[_0xb49f('0xb7')]===_0xb49f('0xb5')){var _0x363e18={'name':_0x4a5c95[_0xb49f('0xa5')],'value':_0x4a5c95[_0xb49f('0xb8')]};_0x40e53b[_0xb49f('0xa6')](_0x363e18);}});}_0xe85bc0[_0xb49f('0x3c')]=_0x40e53b;if(_0xe85bc0['options'][_0xb49f('0x32')]>0x0){_0x3105a9(_0xe85bc0);}else{if(_0x93f9c2==![]){_0x3105a9();}else{_0x3105a9(_0xe85bc0);}}});}});} \ No newline at end of file +var _0x0fe3=['sys_domain_path','time_worked','expected_start','group_list','reopened_time','resolved_at','approval_set','work_notes','correlation_display','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','location','category','username','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','all','concat','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','ServicenowConfiguration','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','made_sla','knowledge','subcategory','close_code','notify','incident_state','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0x0fe3,0x102));var _0x30fe=function(_0x3305e0,_0x4d1e3f){_0x3305e0=_0x3305e0-0x0;var _0x27ce0f=_0x0fe3[_0x3305e0];return _0x27ce0f;};'use strict';var emlformat=require(_0x30fe('0x0'));var rimraf=require(_0x30fe('0x1'));var zipdir=require(_0x30fe('0x2'));var jsonpatch=require(_0x30fe('0x3'));var rp=require(_0x30fe('0x4'));var moment=require(_0x30fe('0x5'));var BPromise=require(_0x30fe('0x6'));var Mustache=require(_0x30fe('0x7'));var util=require('util');var path=require(_0x30fe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x30fe('0x9'));var fs=require('fs');var fs_extra=require(_0x30fe('0xa'));var _=require(_0x30fe('0xb'));var squel=require(_0x30fe('0xc'));var crypto=require(_0x30fe('0xd'));var jsforce=require(_0x30fe('0xe'));var deskjs=require(_0x30fe('0xf'));var toCsv=require(_0x30fe('0x10'));var querystring=require(_0x30fe('0x11'));var Papa=require(_0x30fe('0x12'));var Redis=require(_0x30fe('0x13'));var authService=require(_0x30fe('0x14'));var qs=require(_0x30fe('0x15'));var as=require(_0x30fe('0x16'));var hardwareService=require(_0x30fe('0x17'));var logger=require(_0x30fe('0x18'))(_0x30fe('0x19'));var utils=require(_0x30fe('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x30fe('0x1b'));var db=require(_0x30fe('0x1c'))['db'];var integrations=require(_0x30fe('0x1d'));function respondWithStatusCode(_0x4ed6d4,_0x51e43d){_0x51e43d=_0x51e43d||0xcc;return function(_0xd300e9){if(_0xd300e9){return _0x4ed6d4['sendStatus'](_0x51e43d);}return _0x4ed6d4[_0x30fe('0x1e')](_0x51e43d)[_0x30fe('0x1f')]();};}function respondWithResult(_0x2962dc,_0x309fa0){_0x309fa0=_0x309fa0||0xc8;return function(_0x1b0b55){if(_0x1b0b55){return _0x2962dc[_0x30fe('0x1e')](_0x309fa0)[_0x30fe('0x20')](_0x1b0b55);}};}function respondWithFilteredResult(_0x4363a7,_0x41621e){return function(_0x2430be){if(_0x2430be){var _0xae0a78=typeof _0x41621e[_0x30fe('0x21')]==='undefined'&&typeof _0x41621e[_0x30fe('0x22')]===_0x30fe('0x23');var _0x3551ac=_0x2430be[_0x30fe('0x24')];var _0x5f5b94=_0xae0a78?0x0:_0x41621e[_0x30fe('0x21')];var _0x3d6896=_0xae0a78?_0x2430be['count']:_0x41621e[_0x30fe('0x21')]+_0x41621e[_0x30fe('0x22')];var _0x1acd86;if(_0x3d6896>=_0x3551ac){_0x3d6896=_0x3551ac;_0x1acd86=0xc8;}else{_0x1acd86=0xce;}_0x4363a7[_0x30fe('0x1e')](_0x1acd86);return _0x4363a7[_0x30fe('0x25')](_0x30fe('0x26'),_0x5f5b94+'-'+_0x3d6896+'/'+_0x3551ac)[_0x30fe('0x20')](_0x2430be);}return null;};}function patchUpdates(_0x1ee165){return function(_0x4c8dcc){try{jsonpatch['apply'](_0x4c8dcc,_0x1ee165,!![]);}catch(_0x5e6d59){return BPromise[_0x30fe('0x27')](_0x5e6d59);}return _0x4c8dcc['save']();};}function saveUpdates(_0xb00d14,_0x46e0ad){return function(_0x29e0c0){if(_0x29e0c0){return _0x29e0c0[_0x30fe('0x28')](_0xb00d14)[_0x30fe('0x29')](function(_0x31e89c){return _0x31e89c;});}return null;};}function removeEntity(_0x299be6,_0x1694db){return function(_0x5eac46){if(_0x5eac46){return _0x5eac46[_0x30fe('0x2a')]()['then'](function(){_0x299be6[_0x30fe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405ad1,_0x491465){return function(_0x4bfac8){if(!_0x4bfac8){_0x405ad1[_0x30fe('0x2b')](0x194);}return _0x4bfac8;};}function handleError(_0x126560,_0x2326c8){_0x2326c8=_0x2326c8||0x1f4;return function(_0x3aa881){logger[_0x30fe('0x2c')](_0x3aa881[_0x30fe('0x2d')]);if(_0x3aa881[_0x30fe('0x2e')]){delete _0x3aa881[_0x30fe('0x2e')];}_0x126560[_0x30fe('0x1e')](_0x2326c8)[_0x30fe('0x2f')](_0x3aa881);};}exports['index']=function(_0x495ada,_0x5cd34d){var _0x4a5d10={},_0x33aff3={},_0x532e10={'count':0x0,'rows':[]};var _0x14fc58=_[_0x30fe('0x30')](db[_0x30fe('0x31')][_0x30fe('0x32')],function(_0x2c51f7){return{'name':_0x2c51f7[_0x30fe('0x33')],'type':_0x2c51f7['type']['key']};});_0x33aff3[_0x30fe('0x34')]=_['map'](_0x14fc58,'name');_0x33aff3[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x495ada[_0x30fe('0x35')]);_0x33aff3[_0x30fe('0x37')]=_[_0x30fe('0x38')](_0x33aff3[_0x30fe('0x34')],_0x33aff3[_0x30fe('0x35')]);_0x4a5d10[_0x30fe('0x39')]=_[_0x30fe('0x38')](_0x33aff3[_0x30fe('0x34')],qs['fields'](_0x495ada[_0x30fe('0x35')][_0x30fe('0x3a')]));_0x4a5d10[_0x30fe('0x39')]=_0x4a5d10[_0x30fe('0x39')][_0x30fe('0x3b')]?_0x4a5d10['attributes']:_0x33aff3[_0x30fe('0x34')];if(!_0x495ada[_0x30fe('0x35')][_0x30fe('0x3c')](_0x30fe('0x3d'))){_0x4a5d10[_0x30fe('0x22')]=qs[_0x30fe('0x22')](_0x495ada[_0x30fe('0x35')][_0x30fe('0x22')]);_0x4a5d10['offset']=qs[_0x30fe('0x21')](_0x495ada[_0x30fe('0x35')][_0x30fe('0x21')]);}_0x4a5d10[_0x30fe('0x3e')]=qs['sort'](_0x495ada[_0x30fe('0x35')][_0x30fe('0x3f')]);_0x4a5d10['where']=qs[_0x30fe('0x37')](_['pick'](_0x495ada[_0x30fe('0x35')],_0x33aff3[_0x30fe('0x37')]),_0x14fc58);if(_0x495ada['query'][_0x30fe('0x40')]){_0x4a5d10['where']=_[_0x30fe('0x41')](_0x4a5d10[_0x30fe('0x42')],{'$or':_[_0x30fe('0x30')](_0x14fc58,function(_0x172c2b){if(_0x172c2b[_0x30fe('0x43')]!==_0x30fe('0x44')){var _0xebf61c={};_0xebf61c[_0x172c2b[_0x30fe('0x2e')]]={'$like':'%'+_0x495ada['query'][_0x30fe('0x40')]+'%'};return _0xebf61c;}})});}_0x4a5d10=_[_0x30fe('0x41')]({},_0x4a5d10,_0x495ada[_0x30fe('0x45')]);var _0x3f9407={'where':_0x4a5d10[_0x30fe('0x42')]};return db['ServicenowAccount'][_0x30fe('0x24')](_0x3f9407)[_0x30fe('0x29')](function(_0x345ce4){_0x532e10[_0x30fe('0x24')]=_0x345ce4;if(_0x495ada[_0x30fe('0x35')][_0x30fe('0x46')]){_0x4a5d10[_0x30fe('0x47')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x30fe('0x48')](_0x4a5d10);})[_0x30fe('0x29')](function(_0x626254){_0x532e10[_0x30fe('0x49')]=_0x626254;return _0x532e10;})[_0x30fe('0x29')](respondWithFilteredResult(_0x5cd34d,_0x4a5d10))[_0x30fe('0x4a')](handleError(_0x5cd34d,null));};exports[_0x30fe('0x4b')]=function(_0x5f25ac,_0x308bc6){var _0x2fe2ef={'raw':![],'where':{'id':_0x5f25ac[_0x30fe('0x4c')]['id']}},_0x2fd820={};_0x2fd820[_0x30fe('0x34')]=_[_0x30fe('0x36')](db['ServicenowAccount'][_0x30fe('0x32')]);_0x2fd820[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x5f25ac[_0x30fe('0x35')]);_0x2fd820[_0x30fe('0x37')]=_['intersection'](_0x2fd820['model'],_0x2fd820['query']);_0x2fe2ef[_0x30fe('0x39')]=_['intersection'](_0x2fd820[_0x30fe('0x34')],qs[_0x30fe('0x3a')](_0x5f25ac[_0x30fe('0x35')][_0x30fe('0x3a')]));_0x2fe2ef['attributes']=_0x2fe2ef[_0x30fe('0x39')]['length']?_0x2fe2ef[_0x30fe('0x39')]:_0x2fd820[_0x30fe('0x34')];if(_0x5f25ac[_0x30fe('0x35')][_0x30fe('0x46')]){_0x2fe2ef[_0x30fe('0x47')]=[{'all':!![]}];}_0x2fe2ef=_[_0x30fe('0x41')]({},_0x2fe2ef,_0x5f25ac[_0x30fe('0x45')]);return db[_0x30fe('0x31')][_0x30fe('0x4d')](_0x2fe2ef)[_0x30fe('0x29')](handleEntityNotFound(_0x308bc6,null))[_0x30fe('0x29')](respondWithResult(_0x308bc6,null))['catch'](handleError(_0x308bc6,null));};exports[_0x30fe('0x4e')]=function(_0x5c7d8d,_0x2cba7e){return db[_0x30fe('0x31')]['create'](_0x5c7d8d[_0x30fe('0x4f')],{})[_0x30fe('0x29')](respondWithResult(_0x2cba7e,0xc9))[_0x30fe('0x4a')](handleError(_0x2cba7e,null));};exports[_0x30fe('0x28')]=function(_0x53c807,_0x281661){if(_0x53c807[_0x30fe('0x4f')]['id']){delete _0x53c807['body']['id'];}return db[_0x30fe('0x31')]['find']({'where':{'id':_0x53c807[_0x30fe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x281661,null))['then'](saveUpdates(_0x53c807[_0x30fe('0x4f')],null))[_0x30fe('0x29')](respondWithResult(_0x281661,null))[_0x30fe('0x4a')](handleError(_0x281661,null));};exports['destroy']=function(_0x2f3943,_0x3db245){return db['ServicenowAccount']['find']({'where':{'id':_0x2f3943[_0x30fe('0x4c')]['id']}})[_0x30fe('0x29')](handleEntityNotFound(_0x3db245,null))[_0x30fe('0x29')](removeEntity(_0x3db245,null))['catch'](handleError(_0x3db245,null));};exports['getConfigurations']=function(_0x377f5c,_0x57d570,_0x1db603){var _0x2c53dc={};var _0x5142ca={};var _0x5138f7;var _0x4a313d;return db['ServicenowAccount']['findOne']({'where':{'id':_0x377f5c[_0x30fe('0x4c')]['id']}})[_0x30fe('0x29')](handleEntityNotFound(_0x57d570,null))['then'](function(_0x166238){if(_0x166238){_0x5138f7=_0x166238;_0x5142ca[_0x30fe('0x34')]=_[_0x30fe('0x36')](db[_0x30fe('0x50')]['rawAttributes']);_0x5142ca[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x377f5c[_0x30fe('0x35')]);_0x5142ca[_0x30fe('0x37')]=_[_0x30fe('0x38')](_0x5142ca[_0x30fe('0x34')],_0x5142ca[_0x30fe('0x35')]);_0x2c53dc[_0x30fe('0x39')]=_['intersection'](_0x5142ca[_0x30fe('0x34')],qs[_0x30fe('0x3a')](_0x377f5c['query']['fields']));_0x2c53dc[_0x30fe('0x39')]=_0x2c53dc[_0x30fe('0x39')][_0x30fe('0x3b')]?_0x2c53dc[_0x30fe('0x39')]:_0x5142ca[_0x30fe('0x34')];_0x2c53dc[_0x30fe('0x3e')]=qs[_0x30fe('0x3f')](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x3f')]);_0x2c53dc['where']=qs[_0x30fe('0x37')](_[_0x30fe('0x51')](_0x377f5c[_0x30fe('0x35')],_0x5142ca['filters']));if(_0x377f5c[_0x30fe('0x35')]['filter']){_0x2c53dc[_0x30fe('0x42')]=_[_0x30fe('0x41')](_0x2c53dc['where'],{'$or':_[_0x30fe('0x30')](_0x2c53dc[_0x30fe('0x39')],function(_0x3ff4a0){var _0x97fb94={};_0x97fb94[_0x3ff4a0]={'$like':'%'+_0x377f5c[_0x30fe('0x35')]['filter']+'%'};return _0x97fb94;})});}_0x2c53dc=_[_0x30fe('0x41')]({},_0x2c53dc,_0x377f5c[_0x30fe('0x45')]);return _0x5138f7[_0x30fe('0x52')](_0x2c53dc);}})[_0x30fe('0x29')](function(_0xecfb18){if(_0xecfb18){_0x4a313d=_0xecfb18['length'];if(!_0x377f5c[_0x30fe('0x35')][_0x30fe('0x3c')](_0x30fe('0x3d'))){_0x2c53dc['limit']=qs['limit'](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x22')]);_0x2c53dc[_0x30fe('0x21')]=qs[_0x30fe('0x21')](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x21')]);}return _0x5138f7[_0x30fe('0x52')](_0x2c53dc);}})['then'](function(_0xe2d1fb){if(_0xe2d1fb){return _0xe2d1fb?{'count':_0x4a313d,'rows':_0xe2d1fb}:null;}})[_0x30fe('0x29')](respondWithResult(_0x57d570,null))['catch'](handleError(_0x57d570,null));};exports[_0x30fe('0x53')]=function(_0x116091,_0x5ad4db,_0x3c554e){if(_0x116091[_0x30fe('0x4f')]['id']){delete _0x116091[_0x30fe('0x4f')]['id'];}return db[_0x30fe('0x31')][_0x30fe('0x54')]({'where':{'id':_0x116091[_0x30fe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ad4db,null))[_0x30fe('0x29')](function(_0x3e5777){if(_0x3e5777){_0x116091[_0x30fe('0x4f')][_0x30fe('0x55')]=_0x3e5777['id'];_0x116091[_0x30fe('0x4f')][_0x30fe('0x56')]=integrations[_0x30fe('0x57')](_0x116091[_0x30fe('0x4f')][_0x30fe('0x58')],_0x116091[_0x30fe('0x4f')]['type']);_0x116091['body']['Descriptions']=integrations[_0x30fe('0x59')](_0x116091[_0x30fe('0x4f')][_0x30fe('0x58')],_0x116091[_0x30fe('0x4f')][_0x30fe('0x43')]);return db[_0x30fe('0x50')]['create'](_0x116091['body'],{'include':[{'model':db[_0x30fe('0x5a')],'as':'Subjects'},{'model':db[_0x30fe('0x5a')],'as':_0x30fe('0x5b')}]});}return null;})[_0x30fe('0x29')](respondWithResult(_0x5ad4db,null))['catch'](handleError(_0x5ad4db,null));};exports['getFields']=function(_0x2c8382,_0x57a64b,_0x4bb2f2){var _0x3d1114=[_0x30fe('0x5c'),'hold_reason',_0x30fe('0x5d'),_0x30fe('0x5e'),_0x30fe('0x5f'),_0x30fe('0x60'),_0x30fe('0x61'),'severity','category'];var _0xe5bee8=[_0x30fe('0x62'),_0x30fe('0x5c'),_0x30fe('0x63'),'watch_list',_0x30fe('0x64'),_0x30fe('0x65'),_0x30fe('0x66'),_0x30fe('0x67'),_0x30fe('0x68'),_0x30fe('0x69'),'resolved_by','sys_updated_by',_0x30fe('0x6a'),_0x30fe('0x6b'),'sys_created_on',_0x30fe('0x6c'),_0x30fe('0x6d'),_0x30fe('0x6e'),_0x30fe('0x5d'),'order',_0x30fe('0x6f'),'closed_at',_0x30fe('0x70'),_0x30fe('0x71'),_0x30fe('0x72'),_0x30fe('0x73'),_0x30fe('0x74'),_0x30fe('0x75'),'priority',_0x30fe('0x76'),'rfc',_0x30fe('0x77'),_0x30fe('0x78'),'opened_at','business_duration',_0x30fe('0x79'),'work_end',_0x30fe('0x7a'),_0x30fe('0x7b'),'caller_id',_0x30fe('0x7c'),_0x30fe('0x5e'),_0x30fe('0x7d'),'short_description','close_code',_0x30fe('0x7e'),'delivery_task','work_start',_0x30fe('0x7f'),_0x30fe('0x80'),'additional_assignee_list','description',_0x30fe('0x81'),'notify',_0x30fe('0x82'),_0x30fe('0x83'),'closed_by',_0x30fe('0x84'),_0x30fe('0x85'),_0x30fe('0x86'),_0x30fe('0x87'),_0x30fe('0x88'),'incident_state',_0x30fe('0x89'),'problem_id',_0x30fe('0x8a'),_0x30fe('0x8b'),_0x30fe('0x8c'),_0x30fe('0x8d'),'severity',_0x30fe('0x8e'),_0x30fe('0x8f'),_0x30fe('0x90'),_0x30fe('0x91'),_0x30fe('0x92'),_0x30fe('0x93'),'reopen_count',_0x30fe('0x94'),'escalation','upon_approval','correlation_id',_0x30fe('0x95'),_0x30fe('0x96')];var _0x11f6fc='';var _0x3fc13e='';var _0x3f29e0=[];var _0x330ca1='';var _0x4beaa4='';var _0x3d2f06=[];var _0x305307='';var _0x4ea8ba='';var _0x1a98b2={};var _0x17912e='';return db[_0x30fe('0x31')][_0x30fe('0x54')]({'where':{'id':_0x2c8382[_0x30fe('0x4c')]['id']},'attributes':['id',_0x30fe('0x97'),_0x30fe('0x98'),_0x30fe('0x99'),'remoteUri',_0x30fe('0x9a')]})[_0x30fe('0x29')](handleEntityNotFound(_0x57a64b,null))[_0x30fe('0x29')](function(_0x4e236d){if(_0x4e236d){_0x17912e=_0x4e236d['remoteUri'];var _0x5c85fc=_0x17912e[_0x30fe('0x9b')](-0x1);if(_0x5c85fc==='/'){_0x17912e=_0x17912e[_0x30fe('0x9c')](0x0,_0x17912e[_0x30fe('0x9d')](_0x5c85fc));}_0x4ea8ba=util[_0x30fe('0x9e')](_0x30fe('0x9f'),_0x17912e);_0x305307=util[_0x30fe('0x9e')](_0x30fe('0xa0'),_0x17912e);_0x1a98b2={'user':_0x4e236d[_0x30fe('0x97')],'pass':_0x4e236d['password']};var _0x3c8c19={'method':'GET','uri':_0x4ea8ba+_0x30fe('0xa1'),'auth':_0x1a98b2,'json':!![]};return rp(_0x3c8c19);}})[_0x30fe('0x29')](function(_0x417d92){if(_0x417d92[_0x30fe('0xa2')][_0x30fe('0x3b')]>0x0){_0x11f6fc=_0x417d92[_0x30fe('0xa2')];}console[_0x30fe('0xa3')](_0x30fe('0xa4'),_0x11f6fc);_0x3d2f06=[];_0x3fc13e=Object[_0x30fe('0xa5')]([],_0x11f6fc);_[_0x30fe('0xa6')](_0x3fc13e,function(_0x4489e9){return!_0x3d1114[_0x30fe('0xa7')](_0x4489e9[_0x30fe('0x2e')]);});_0x3fc13e[_0x30fe('0xa8')](function(_0x3e5659){var _0x55ff9d=createFieldObject(_0x305307,_0x1a98b2,_0x3e5659['internalType'],_0x3e5659[_0x30fe('0x2e')],_0x3e5659[_0x30fe('0xa9')],![]);_0x3d2f06[_0x30fe('0xaa')](_0x55ff9d);});return Promise['all'](_0x3d2f06);})[_0x30fe('0x29')](function(_0x27b5bd){_0x3f29e0=_0x27b5bd;_0x330ca1=Object[_0x30fe('0xa5')]([],_0x11f6fc);console[_0x30fe('0xa3')](_0x30fe('0xab'),_0x11f6fc);_[_0x30fe('0xa6')](_0x330ca1,function(_0x3ad2d2){return _0xe5bee8['includes'](_0x3ad2d2[_0x30fe('0x2e')]);});console[_0x30fe('0xa3')](_0x30fe('0xac'),_0x330ca1);_0x3d2f06=[];_0x330ca1[_0x30fe('0xa8')](function(_0x5a3999){var _0xc955d7=createFieldObject(_0x305307,_0x1a98b2,_0x5a3999[_0x30fe('0xad')],_0x5a3999['name'],_0x5a3999['label'],!![]);_0x3d2f06[_0x30fe('0xaa')](_0xc955d7);});return Promise[_0x30fe('0xae')](_0x3d2f06);})['then'](function(_0x3e138a){_0x4beaa4=_0x3e138a;var _0x522538=_0x3f29e0[_0x30fe('0xaf')](_0x4beaa4);return{'count':_0x522538[_0x30fe('0x3b')],'rows':_0x522538};})['then'](respondWithResult(_0x57a64b,null))[_0x30fe('0x4a')](function(_0xd4fc5b){console[_0x30fe('0xa3')]('ServiceNow\x20error:\x20'+_0xd4fc5b);var _0x476571=_0x2c8382[_0x30fe('0x35')][_0x30fe('0xb0')]?0x1f4:_0xd4fc5b[_0x30fe('0xb1')]||0x1f4;logger[_0x30fe('0x2c')](_0xd4fc5b['stack']);delete _0xd4fc5b['name'];if(_0x476571===0x191){_0x476571=0x190;}_0x57a64b['status'](_0x476571)[_0x30fe('0x2f')](_0x2c8382[_0x30fe('0x35')][_0x30fe('0xb0')]?{'message':_0x30fe('0xb2'),'statusCode':_0xd4fc5b[_0x30fe('0xb1')]}:_0xd4fc5b);});};function createFieldObject(_0x1896cf,_0x5a9b16,_0x398865,_0x3aa19a,_0x4c6a37,_0x2ac5d2){return new Promise(function(_0x5ca9eb,_0x39e7d7){var _0x5b51c4={'id':_0x3aa19a,'name':_0x4c6a37,'custom':_0x2ac5d2};if(_0x398865===_0x30fe('0xb3')){_0x5b51c4['options']=[{'name':_0x30fe('0xb4'),'value':_0x30fe('0xb5')},{'name':_0x30fe('0xb6'),'value':_0x30fe('0xb7')}];_0x5ca9eb(_0x5b51c4);}else{var _0x226c7a={'method':_0x30fe('0xb8'),'uri':_0x1896cf+_0x30fe('0xb9')+_0x3aa19a,'auth':_0x5a9b16,'json':!![]};return rp(_0x226c7a)['then'](function(_0x289284){var _0x521ee3=[];if(_0x289284[_0x30fe('0xa2')][_0x30fe('0x3b')]>0x0){_0x289284['result'][_0x30fe('0xa8')](function(_0x4e7a01){if(_0x4e7a01[_0x30fe('0xba')]===_0x30fe('0xb7')){var _0x37a786={'name':_0x4e7a01['label'],'value':_0x4e7a01[_0x30fe('0xbb')]};_0x521ee3['push'](_0x37a786);}});}_0x5b51c4[_0x30fe('0x45')]=_0x521ee3;if(_0x5b51c4[_0x30fe('0x45')][_0x30fe('0x3b')]>0x0){_0x5ca9eb(_0x5b51c4);}else{if(_0x2ac5d2==![]){_0x5ca9eb();}else{_0x5ca9eb(_0x5b51c4);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index cff4f87..0350cf1 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 _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x4285f2,_0x4342b1){var _0x5a3014=function(_0x5f20bf){while(--_0x5f20bf){_0x4285f2['push'](_0x4285f2['shift']());}};_0x5a3014(++_0x4342b1);}(_0xe14b,0x93));var _0xbe14=function(_0x325957,_0x48a222){_0x325957=_0x325957-0x0;var _0xbb84a9=_0xe14b[_0x325957];return _0xbb84a9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x1f00f7,_0x469d49){var _0x24d9f3=function(_0x4795ed){while(--_0x4795ed){_0x1f00f7['push'](_0x1f00f7['shift']());}};_0x24d9f3(++_0x469d49);}(_0x5fab,0x177));var _0xb5fa=function(_0x35bdcf,_0x21421c){_0x35bdcf=_0x35bdcf-0x0;var _0x5a4fc7=_0x5fab[_0x35bdcf];return _0x5a4fc7;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'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 8193634..a0d68a3 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 _0x98e8=['message','info','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowServicenowAccount','find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','error','code','ServicenowAccount,\x20%s,\x20%s'];(function(_0x591f11,_0x434242){var _0x3ba1db=function(_0x26f4bc){while(--_0x26f4bc){_0x591f11['push'](_0x591f11['shift']());}};_0x3ba1db(++_0x434242);}(_0x98e8,0x10e));var _0x898e=function(_0x219fcf,_0x228f59){_0x219fcf=_0x219fcf-0x0;var _0x857eb7=_0x98e8[_0x219fcf];return _0x857eb7;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var moment=require(_0x898e('0x2'));var BPromise=require(_0x898e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x898e('0x4'));var db=require(_0x898e('0x5'))['db'];var utils=require(_0x898e('0x6'));var logger=require('../../config/logger')(_0x898e('0x7'));var config=require(_0x898e('0x8'));var jayson=require(_0x898e('0x9'));var client=jayson[_0x898e('0xa')][_0x898e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dfbe8,_0x3948a9,_0x4410aa){return new BPromise(function(_0x1e9ad6,_0x4bed28){return client[_0x898e('0xc')](_0x1dfbe8,_0x4410aa)[_0x898e('0xd')](function(_0x415922){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3948a9,_0x898e('0xe'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3948a9,_0x898e('0xe'),JSON['stringify'](_0x415922));if(_0x415922[_0x898e('0xf')]){if(_0x415922[_0x898e('0xf')][_0x898e('0x10')]===0x1f4){logger[_0x898e('0xf')](_0x898e('0x11'),_0x3948a9,_0x415922[_0x898e('0xf')][_0x898e('0x12')]);return _0x4bed28(_0x415922[_0x898e('0xf')]['message']);}logger[_0x898e('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x3948a9,_0x415922['error']['message']);return _0x1e9ad6(_0x415922[_0x898e('0xf')][_0x898e('0x12')]);}else{logger[_0x898e('0x13')](_0x898e('0x11'),_0x3948a9,'request\x20sent');_0x1e9ad6(_0x415922['result'][_0x898e('0x12')]);}})[_0x898e('0x14')](function(_0x5b6fbd){logger[_0x898e('0xf')](_0x898e('0x11'),_0x3948a9,_0x5b6fbd);_0x4bed28(_0x5b6fbd);});});}exports[_0x898e('0x15')]=function(_0x1f73d6){var _0x2ef986=this;return new Promise(function(_0x196926,_0x259f35){return db[_0x898e('0x16')][_0x898e('0x17')]({'raw':_0x1f73d6[_0x898e('0x18')]?_0x1f73d6[_0x898e('0x18')][_0x898e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f73d6[_0x898e('0x18')]?_0x1f73d6['options'][_0x898e('0x1a')]||null:null,'attributes':_0x1f73d6[_0x898e('0x18')]?_0x1f73d6[_0x898e('0x18')][_0x898e('0x1b')]||null:null,'limit':_0x1f73d6[_0x898e('0x18')]?_0x1f73d6[_0x898e('0x18')][_0x898e('0x1c')]||null:null,'include':_0x1f73d6[_0x898e('0x18')]?_0x1f73d6['options'][_0x898e('0x1d')]?_[_0x898e('0x1e')](_0x1f73d6[_0x898e('0x18')][_0x898e('0x1d')],function(_0x438fad){return{'model':db[_0x438fad[_0x898e('0x1f')]],'as':_0x438fad['as'],'attributes':_0x438fad[_0x898e('0x1b')],'include':_0x438fad[_0x898e('0x1d')]?_['map'](_0x438fad[_0x898e('0x1d')],function(_0x160433){return{'model':db[_0x160433['model']],'as':_0x160433['as'],'attributes':_0x160433['attributes'],'include':_0x160433[_0x898e('0x1d')]?_[_0x898e('0x1e')](_0x160433[_0x898e('0x1d')],function(_0x3e30c3){return{'model':db[_0x3e30c3[_0x898e('0x1f')]],'as':_0x3e30c3['as'],'attributes':_0x3e30c3[_0x898e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43f431){logger[_0x898e('0x13')](_0x898e('0x15'),_0x1f73d6);logger['debug'](_0x898e('0x15'),_0x1f73d6,JSON[_0x898e('0x20')](_0x43f431));_0x196926(_0x43f431);})[_0x898e('0x14')](function(_0x407516){logger[_0x898e('0xf')]('GetServicenowAccount',_0x407516[_0x898e('0x12')],_0x1f73d6);_0x259f35(_0x2ef986[_0x898e('0xf')](0x1f4,_0x407516[_0x898e('0x12')]));});});};exports[_0x898e('0x21')]=function(_0x5c685c){var _0x41673c=this;return new Promise(function(_0x3827b6,_0x401026){return db[_0x898e('0x16')][_0x898e('0x22')]({'raw':_0x5c685c[_0x898e('0x18')]?_0x5c685c[_0x898e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c685c[_0x898e('0x18')]?_0x5c685c[_0x898e('0x18')][_0x898e('0x1a')]||null:null,'attributes':_0x5c685c[_0x898e('0x18')]?_0x5c685c[_0x898e('0x18')][_0x898e('0x1b')]||null:null,'include':_0x5c685c['options']?_0x5c685c[_0x898e('0x18')][_0x898e('0x1d')]?_[_0x898e('0x1e')](_0x5c685c[_0x898e('0x18')]['include'],function(_0x488e03){return{'model':db[_0x488e03[_0x898e('0x1f')]],'as':_0x488e03['as'],'attributes':_0x488e03[_0x898e('0x1b')],'include':_0x488e03[_0x898e('0x1d')]?_[_0x898e('0x1e')](_0x488e03[_0x898e('0x1d')],function(_0x42fdb0){return{'model':db[_0x42fdb0['model']],'as':_0x42fdb0['as'],'attributes':_0x42fdb0[_0x898e('0x1b')],'include':_0x42fdb0[_0x898e('0x1d')]?_['map'](_0x42fdb0['include'],function(_0x47c1a6){return{'model':db[_0x47c1a6[_0x898e('0x1f')]],'as':_0x47c1a6['as'],'attributes':_0x47c1a6[_0x898e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x898e('0xd')](function(_0x5ed63f){logger[_0x898e('0x13')](_0x898e('0x21'),_0x5c685c);logger[_0x898e('0x23')](_0x898e('0x21'),_0x5c685c,JSON[_0x898e('0x20')](_0x5ed63f));_0x3827b6(_0x5ed63f);})['catch'](function(_0x255f05){logger[_0x898e('0xf')](_0x898e('0x21'),_0x255f05[_0x898e('0x12')],_0x5c685c);_0x401026(_0x41673c[_0x898e('0xf')](0x1f4,_0x255f05[_0x898e('0x12')]));});});}; \ No newline at end of file +var _0xfdaf=['ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','catch'];(function(_0x4c5ffb,_0xbf67f0){var _0x52e05a=function(_0x2b1181){while(--_0x2b1181){_0x4c5ffb['push'](_0x4c5ffb['shift']());}};_0x52e05a(++_0xbf67f0);}(_0xfdaf,0xdb));var _0xffda=function(_0xb17f95,_0x3fc12d){_0xb17f95=_0xb17f95-0x0;var _0x5aaf5f=_0xfdaf[_0xb17f95];return _0x5aaf5f;};'use strict';var _=require(_0xffda('0x0'));var util=require(_0xffda('0x1'));var moment=require('moment');var BPromise=require(_0xffda('0x2'));var rs=require(_0xffda('0x3'));var fs=require('fs');var Redis=require(_0xffda('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffda('0x5'));var logger=require('../../config/logger')(_0xffda('0x6'));var config=require(_0xffda('0x7'));var jayson=require(_0xffda('0x8'));var client=jayson['client'][_0xffda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x419a17,_0x49f88a,_0x1d2972){return new BPromise(function(_0x5463bb,_0x43c17b){return client[_0xffda('0xa')](_0x419a17,_0x1d2972)[_0xffda('0xb')](function(_0x14bd66){logger['info'](_0xffda('0xc'),_0x49f88a,_0xffda('0xd'));logger[_0xffda('0xe')](_0xffda('0xf'),_0x49f88a,_0xffda('0xd'),JSON[_0xffda('0x10')](_0x14bd66));if(_0x14bd66[_0xffda('0x11')]){if(_0x14bd66[_0xffda('0x11')][_0xffda('0x12')]===0x1f4){logger[_0xffda('0x11')](_0xffda('0xc'),_0x49f88a,_0x14bd66[_0xffda('0x11')][_0xffda('0x13')]);return _0x43c17b(_0x14bd66['error'][_0xffda('0x13')]);}logger[_0xffda('0x11')](_0xffda('0xc'),_0x49f88a,_0x14bd66['error'][_0xffda('0x13')]);return _0x5463bb(_0x14bd66[_0xffda('0x11')][_0xffda('0x13')]);}else{logger[_0xffda('0x14')](_0xffda('0xc'),_0x49f88a,_0xffda('0xd'));_0x5463bb(_0x14bd66[_0xffda('0x15')][_0xffda('0x13')]);}})['catch'](function(_0x1f368d){logger[_0xffda('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x49f88a,_0x1f368d);_0x43c17b(_0x1f368d);});});}exports['GetServicenowAccount']=function(_0x663368){var _0x1ad6ff=this;return new Promise(function(_0x3b2d69,_0x488670){return db[_0xffda('0x16')][_0xffda('0x17')]({'raw':_0x663368['options']?_0x663368['options']['raw']===undefined?!![]:![]:!![],'where':_0x663368[_0xffda('0x18')]?_0x663368[_0xffda('0x18')][_0xffda('0x19')]||null:null,'attributes':_0x663368['options']?_0x663368[_0xffda('0x18')][_0xffda('0x1a')]||null:null,'limit':_0x663368['options']?_0x663368[_0xffda('0x18')][_0xffda('0x1b')]||null:null,'include':_0x663368[_0xffda('0x18')]?_0x663368[_0xffda('0x18')][_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x663368[_0xffda('0x18')][_0xffda('0x1c')],function(_0x44f42c){return{'model':db[_0x44f42c[_0xffda('0x1e')]],'as':_0x44f42c['as'],'attributes':_0x44f42c[_0xffda('0x1a')],'include':_0x44f42c['include']?_[_0xffda('0x1d')](_0x44f42c[_0xffda('0x1c')],function(_0x45b4d6){return{'model':db[_0x45b4d6[_0xffda('0x1e')]],'as':_0x45b4d6['as'],'attributes':_0x45b4d6[_0xffda('0x1a')],'include':_0x45b4d6['include']?_[_0xffda('0x1d')](_0x45b4d6[_0xffda('0x1c')],function(_0x40d150){return{'model':db[_0x40d150[_0xffda('0x1e')]],'as':_0x40d150['as'],'attributes':_0x40d150[_0xffda('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x1ca564){logger[_0xffda('0x14')]('GetServicenowAccount',_0x663368);logger[_0xffda('0xe')](_0xffda('0x1f'),_0x663368,JSON[_0xffda('0x10')](_0x1ca564));_0x3b2d69(_0x1ca564);})[_0xffda('0x20')](function(_0x43434b){logger['error']('GetServicenowAccount',_0x43434b[_0xffda('0x13')],_0x663368);_0x488670(_0x1ad6ff[_0xffda('0x11')](0x1f4,_0x43434b[_0xffda('0x13')]));});});};exports[_0xffda('0x21')]=function(_0x816956){var _0x20c753=this;return new Promise(function(_0x406eff,_0x1c7723){return db[_0xffda('0x16')][_0xffda('0x22')]({'raw':_0x816956[_0xffda('0x18')]?_0x816956['options'][_0xffda('0x23')]===undefined?!![]:![]:!![],'where':_0x816956[_0xffda('0x18')]?_0x816956[_0xffda('0x18')][_0xffda('0x19')]||null:null,'attributes':_0x816956['options']?_0x816956[_0xffda('0x18')][_0xffda('0x1a')]||null:null,'include':_0x816956['options']?_0x816956[_0xffda('0x18')][_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x816956['options']['include'],function(_0x570df5){return{'model':db[_0x570df5['model']],'as':_0x570df5['as'],'attributes':_0x570df5[_0xffda('0x1a')],'include':_0x570df5[_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x570df5[_0xffda('0x1c')],function(_0x781e7e){return{'model':db[_0x781e7e[_0xffda('0x1e')]],'as':_0x781e7e['as'],'attributes':_0x781e7e['attributes'],'include':_0x781e7e['include']?_[_0xffda('0x1d')](_0x781e7e[_0xffda('0x1c')],function(_0x46874b){return{'model':db[_0x46874b[_0xffda('0x1e')]],'as':_0x46874b['as'],'attributes':_0x46874b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54c67c){logger[_0xffda('0x14')](_0xffda('0x21'),_0x816956);logger['debug'](_0xffda('0x21'),_0x816956,JSON[_0xffda('0x10')](_0x54c67c));_0x406eff(_0x54c67c);})[_0xffda('0x20')](function(_0x4f7f84){logger[_0xffda('0x11')](_0xffda('0x21'),_0x4f7f84[_0xffda('0x13')],_0x816956);_0x1c7723(_0x20c753[_0xffda('0x11')](0x1f4,_0x4f7f84['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a397446..5111aae 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 _0x5a25=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x3aa0d8,_0x4d1345){var _0x2a3d45=function(_0x2b5013){while(--_0x2b5013){_0x3aa0d8['push'](_0x3aa0d8['shift']());}};_0x2a3d45(++_0x4d1345);}(_0x5a25,0x193));var _0x55a2=function(_0x539bde,_0x14b7db){_0x539bde=_0x539bde-0x0;var _0x1718d4=_0x5a25[_0x539bde];return _0x1718d4;};'use strict';var multer=require(_0x55a2('0x0'));var util=require(_0x55a2('0x1'));var path=require(_0x55a2('0x2'));var timeout=require('connect-timeout');var express=require(_0x55a2('0x3'));var router=express[_0x55a2('0x4')]();var fs_extra=require(_0x55a2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x55a2('0x6'));var controller=require(_0x55a2('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x55a2('0x8')](_0x55a2('0x9'),auth[_0x55a2('0xa')](),controller['show']);router[_0x55a2('0x8')](_0x55a2('0xb'),auth[_0x55a2('0xa')](),controller[_0x55a2('0xc')]);router[_0x55a2('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x55a2('0xd')]);router['get'](_0x55a2('0xe'),auth[_0x55a2('0xa')](),controller[_0x55a2('0xf')]);router[_0x55a2('0x10')]('/',auth[_0x55a2('0xa')](),controller['create']);router['put'](_0x55a2('0x9'),auth['isAuthenticated'](),controller[_0x55a2('0x11')]);router[_0x55a2('0x12')](_0x55a2('0x9'),auth[_0x55a2('0xa')](),controller[_0x55a2('0x13')]);module[_0x55a2('0x14')]=router; \ No newline at end of file +var _0xfa61=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xfa61,0x1d6));var _0x1fa6=function(_0x32dc94,_0x28b830){_0x32dc94=_0x32dc94-0x0;var _0x25615d=_0xfa61[_0x32dc94];return _0x25615d;};'use strict';var multer=require(_0x1fa6('0x0'));var util=require(_0x1fa6('0x1'));var path=require(_0x1fa6('0x2'));var timeout=require(_0x1fa6('0x3'));var express=require(_0x1fa6('0x4'));var router=express[_0x1fa6('0x5')]();var fs_extra=require(_0x1fa6('0x6'));var auth=require(_0x1fa6('0x7'));var interaction=require(_0x1fa6('0x8'));var config=require('../../config/environment');var controller=require(_0x1fa6('0x9'));router[_0x1fa6('0xa')]('/',auth[_0x1fa6('0xb')](),controller[_0x1fa6('0xc')]);router[_0x1fa6('0xa')](_0x1fa6('0xd'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0xe')]);router[_0x1fa6('0xa')](_0x1fa6('0xf'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x10')]);router[_0x1fa6('0xa')](_0x1fa6('0x11'),auth['isAuthenticated'](),controller[_0x1fa6('0x12')]);router[_0x1fa6('0xa')](_0x1fa6('0x13'),auth[_0x1fa6('0xb')](),controller['getDescriptions']);router[_0x1fa6('0x14')]('/',auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x15')]);router[_0x1fa6('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x1fa6('0x17')]);router[_0x1fa6('0x18')](_0x1fa6('0xd'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x19')]);module[_0x1fa6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 007fa08..f117dda 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 _0x92bd=['exports','STRING','sequelize'];(function(_0x4a1de0,_0x61d745){var _0x566a67=function(_0x3d6ba7){while(--_0x3d6ba7){_0x4a1de0['push'](_0x4a1de0['shift']());}};_0x566a67(++_0x61d745);}(_0x92bd,0x176));var _0xd92b=function(_0x22eaca,_0xe31556){_0x22eaca=_0x22eaca-0x0;var _0x309bd0=_0x92bd[_0x22eaca];return _0x309bd0;};'use strict';var Sequelize=require(_0xd92b('0x0'));module[_0xd92b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd92b('0x2')]}}; \ No newline at end of file +var _0xc7b1=['sequelize','STRING'];(function(_0x1f0533,_0x12f344){var _0x498dd3=function(_0x4f3193){while(--_0x4f3193){_0x1f0533['push'](_0x1f0533['shift']());}};_0x498dd3(++_0x12f344);}(_0xc7b1,0x12c));var _0x1c7b=function(_0x4c2bdc,_0x5915d7){_0x4c2bdc=_0x4c2bdc-0x0;var _0x5a3222=_0xc7b1[_0x4c2bdc];return _0x5a3222;};'use strict';var Sequelize=require(_0x1c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c7b('0x1')]},'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 59fb969..6891b74 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 _0xd976=['type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','params','keys','length','include','find','catch','create','body','update','getFields','findOne','ServicenowField','order','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','send','ServicenowConfiguration','rawAttributes','fieldName'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0xd976,0x169));var _0x6d97=function(_0x476f08,_0x3c5760){_0x476f08=_0x476f08-0x0;var _0x355fae=_0xd976[_0x476f08];return _0x355fae;};'use strict';var emlformat=require(_0x6d97('0x0'));var rimraf=require(_0x6d97('0x1'));var zipdir=require(_0x6d97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d97('0x3'));var moment=require('moment');var BPromise=require(_0x6d97('0x4'));var Mustache=require(_0x6d97('0x5'));var util=require(_0x6d97('0x6'));var path=require(_0x6d97('0x7'));var sox=require(_0x6d97('0x8'));var csv=require(_0x6d97('0x9'));var ejs=require(_0x6d97('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d97('0xb'));var squel=require(_0x6d97('0xc'));var crypto=require(_0x6d97('0xd'));var jsforce=require(_0x6d97('0xe'));var deskjs=require(_0x6d97('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6d97('0x10'));var Papa=require(_0x6d97('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d97('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d97('0x13'));var logger=require(_0x6d97('0x14'))('api');var utils=require(_0x6d97('0x15'));var config=require(_0x6d97('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d97('0x17'))['db'];function respondWithStatusCode(_0x3a00c0,_0x425bf6){_0x425bf6=_0x425bf6||0xcc;return function(_0x3a2422){if(_0x3a2422){return _0x3a00c0['sendStatus'](_0x425bf6);}return _0x3a00c0[_0x6d97('0x18')](_0x425bf6)[_0x6d97('0x19')]();};}function respondWithResult(_0x5a33b9,_0x502baf){_0x502baf=_0x502baf||0xc8;return function(_0x2898ec){if(_0x2898ec){return _0x5a33b9[_0x6d97('0x18')](_0x502baf)[_0x6d97('0x1a')](_0x2898ec);}};}function respondWithFilteredResult(_0x5b304d,_0x186011){return function(_0x12fc94){if(_0x12fc94){var _0x75099f=typeof _0x186011[_0x6d97('0x1b')]===_0x6d97('0x1c')&&typeof _0x186011['limit']===_0x6d97('0x1c');var _0xc97be=_0x12fc94[_0x6d97('0x1d')];var _0x46acd3=_0x75099f?0x0:_0x186011[_0x6d97('0x1b')];var _0x194be0=_0x75099f?_0x12fc94[_0x6d97('0x1d')]:_0x186011['offset']+_0x186011[_0x6d97('0x1e')];var _0x20d6cc;if(_0x194be0>=_0xc97be){_0x194be0=_0xc97be;_0x20d6cc=0xc8;}else{_0x20d6cc=0xce;}_0x5b304d[_0x6d97('0x18')](_0x20d6cc);return _0x5b304d[_0x6d97('0x1f')](_0x6d97('0x20'),_0x46acd3+'-'+_0x194be0+'/'+_0xc97be)[_0x6d97('0x1a')](_0x12fc94);}return null;};}function patchUpdates(_0x71e27f){return function(_0x3642e1){try{jsonpatch['apply'](_0x3642e1,_0x71e27f,!![]);}catch(_0x54659e){return BPromise[_0x6d97('0x21')](_0x54659e);}return _0x3642e1[_0x6d97('0x22')]();};}function saveUpdates(_0x589986,_0x47146e){return function(_0x3243ac){if(_0x3243ac){return _0x3243ac['update'](_0x589986)[_0x6d97('0x23')](function(_0x4b13d3){return _0x4b13d3;});}return null;};}function removeEntity(_0x3b1c90,_0x237f80){return function(_0x5dfd91){if(_0x5dfd91){return _0x5dfd91[_0x6d97('0x24')]()[_0x6d97('0x23')](function(){_0x3b1c90[_0x6d97('0x18')](0xcc)[_0x6d97('0x19')]();});}};}function handleEntityNotFound(_0x3f87df,_0x306125){return function(_0x16d8eb){if(!_0x16d8eb){_0x3f87df[_0x6d97('0x25')](0x194);}return _0x16d8eb;};}function handleError(_0x1b1af3,_0x15b6b3){_0x15b6b3=_0x15b6b3||0x1f4;return function(_0x3956b2){logger[_0x6d97('0x26')](_0x3956b2[_0x6d97('0x27')]);if(_0x3956b2['name']){delete _0x3956b2['name'];}_0x1b1af3[_0x6d97('0x18')](_0x15b6b3)[_0x6d97('0x28')](_0x3956b2);};}exports['index']=function(_0x39f33c,_0x4fbeb7){var _0x378efa={},_0x5bd01c={},_0x5e6803={'count':0x0,'rows':[]};var _0x5733b0=_['map'](db[_0x6d97('0x29')][_0x6d97('0x2a')],function(_0x8100f3){return{'name':_0x8100f3[_0x6d97('0x2b')],'type':_0x8100f3[_0x6d97('0x2c')][_0x6d97('0x2d')]};});_0x5bd01c[_0x6d97('0x2e')]=_[_0x6d97('0x2f')](_0x5733b0,'name');_0x5bd01c[_0x6d97('0x30')]=_['keys'](_0x39f33c[_0x6d97('0x30')]);_0x5bd01c['filters']=_[_0x6d97('0x31')](_0x5bd01c[_0x6d97('0x2e')],_0x5bd01c['query']);_0x378efa[_0x6d97('0x32')]=_[_0x6d97('0x31')](_0x5bd01c[_0x6d97('0x2e')],qs[_0x6d97('0x33')](_0x39f33c['query']['fields']));_0x378efa['attributes']=_0x378efa[_0x6d97('0x32')]['length']?_0x378efa[_0x6d97('0x32')]:_0x5bd01c['model'];if(!_0x39f33c[_0x6d97('0x30')][_0x6d97('0x34')]('nolimit')){_0x378efa['limit']=qs[_0x6d97('0x1e')](_0x39f33c[_0x6d97('0x30')]['limit']);_0x378efa['offset']=qs[_0x6d97('0x1b')](_0x39f33c[_0x6d97('0x30')][_0x6d97('0x1b')]);}_0x378efa['order']=qs['sort'](_0x39f33c[_0x6d97('0x30')][_0x6d97('0x35')]);_0x378efa['where']=qs[_0x6d97('0x36')](_[_0x6d97('0x37')](_0x39f33c['query'],_0x5bd01c[_0x6d97('0x36')]),_0x5733b0);if(_0x39f33c['query'][_0x6d97('0x38')]){_0x378efa[_0x6d97('0x39')]=_[_0x6d97('0x3a')](_0x378efa[_0x6d97('0x39')],{'$or':_[_0x6d97('0x2f')](_0x5733b0,function(_0x4224d5){if(_0x4224d5['type']!==_0x6d97('0x3b')){var _0x2fb39e={};_0x2fb39e[_0x4224d5[_0x6d97('0x3c')]]={'$like':'%'+_0x39f33c[_0x6d97('0x30')][_0x6d97('0x38')]+'%'};return _0x2fb39e;}})});}_0x378efa=_['merge']({},_0x378efa,_0x39f33c[_0x6d97('0x3d')]);var _0x5e3b82={'where':_0x378efa[_0x6d97('0x39')]};return db[_0x6d97('0x29')][_0x6d97('0x1d')](_0x5e3b82)[_0x6d97('0x23')](function(_0x5935e9){_0x5e6803[_0x6d97('0x1d')]=_0x5935e9;if(_0x39f33c[_0x6d97('0x30')][_0x6d97('0x3e')]){_0x378efa['include']=[{'all':!![]}];}return db[_0x6d97('0x29')][_0x6d97('0x3f')](_0x378efa);})['then'](function(_0x5d4419){_0x5e6803[_0x6d97('0x40')]=_0x5d4419;return _0x5e6803;})[_0x6d97('0x23')](respondWithFilteredResult(_0x4fbeb7,_0x378efa))['catch'](handleError(_0x4fbeb7,null));};exports['show']=function(_0x187d56,_0xf02606){var _0x184157={'raw':![],'where':{'id':_0x187d56[_0x6d97('0x41')]['id']}},_0x51b488={};_0x51b488['model']=_[_0x6d97('0x42')](db[_0x6d97('0x29')]['rawAttributes']);_0x51b488[_0x6d97('0x30')]=_[_0x6d97('0x42')](_0x187d56[_0x6d97('0x30')]);_0x51b488[_0x6d97('0x36')]=_['intersection'](_0x51b488[_0x6d97('0x2e')],_0x51b488[_0x6d97('0x30')]);_0x184157['attributes']=_[_0x6d97('0x31')](_0x51b488[_0x6d97('0x2e')],qs[_0x6d97('0x33')](_0x187d56[_0x6d97('0x30')]['fields']));_0x184157[_0x6d97('0x32')]=_0x184157[_0x6d97('0x32')][_0x6d97('0x43')]?_0x184157[_0x6d97('0x32')]:_0x51b488['model'];if(_0x187d56[_0x6d97('0x30')][_0x6d97('0x3e')]){_0x184157[_0x6d97('0x44')]=[{'all':!![]}];}_0x184157=_[_0x6d97('0x3a')]({},_0x184157,_0x187d56['options']);return db[_0x6d97('0x29')][_0x6d97('0x45')](_0x184157)[_0x6d97('0x23')](handleEntityNotFound(_0xf02606,null))['then'](respondWithResult(_0xf02606,null))[_0x6d97('0x46')](handleError(_0xf02606,null));};exports[_0x6d97('0x47')]=function(_0xfbfe17,_0x5a8ca9){return db[_0x6d97('0x29')][_0x6d97('0x47')](_0xfbfe17[_0x6d97('0x48')],{})[_0x6d97('0x23')](respondWithResult(_0x5a8ca9,0xc9))[_0x6d97('0x46')](handleError(_0x5a8ca9,null));};exports[_0x6d97('0x49')]=function(_0x49acbf,_0x2b3e63){if(_0x49acbf['body']['id']){delete _0x49acbf[_0x6d97('0x48')]['id'];}return db[_0x6d97('0x29')][_0x6d97('0x45')]({'where':{'id':_0x49acbf['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x2b3e63,null))['then'](saveUpdates(_0x49acbf[_0x6d97('0x48')],null))[_0x6d97('0x23')](respondWithResult(_0x2b3e63,null))[_0x6d97('0x46')](handleError(_0x2b3e63,null));};exports[_0x6d97('0x24')]=function(_0x2a4c5a,_0x2359d5){return db[_0x6d97('0x29')][_0x6d97('0x45')]({'where':{'id':_0x2a4c5a['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x2359d5,null))[_0x6d97('0x23')](removeEntity(_0x2359d5,null))[_0x6d97('0x46')](handleError(_0x2359d5,null));};exports[_0x6d97('0x4a')]=function(_0x1113ce,_0x224ff6,_0x32ad9b){var _0x3d4f7b={};var _0x5ae482={};var _0x528b08;var _0x50f433;return db['ServicenowConfiguration'][_0x6d97('0x4b')]({'where':{'id':_0x1113ce[_0x6d97('0x41')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x224ff6,null))['then'](function(_0x1b65ec){if(_0x1b65ec){_0x528b08=_0x1b65ec;_0x5ae482[_0x6d97('0x2e')]=_['keys'](db[_0x6d97('0x4c')]['rawAttributes']);_0x5ae482[_0x6d97('0x30')]=_[_0x6d97('0x42')](_0x1113ce['query']);_0x5ae482[_0x6d97('0x36')]=_[_0x6d97('0x31')](_0x5ae482['model'],_0x5ae482['query']);_0x3d4f7b[_0x6d97('0x32')]=_['intersection'](_0x5ae482[_0x6d97('0x2e')],qs[_0x6d97('0x33')](_0x1113ce['query'][_0x6d97('0x33')]));_0x3d4f7b[_0x6d97('0x32')]=_0x3d4f7b['attributes'][_0x6d97('0x43')]?_0x3d4f7b[_0x6d97('0x32')]:_0x5ae482['model'];_0x3d4f7b[_0x6d97('0x4d')]=qs[_0x6d97('0x35')](_0x1113ce[_0x6d97('0x30')][_0x6d97('0x35')]);_0x3d4f7b[_0x6d97('0x39')]=qs[_0x6d97('0x36')](_['pick'](_0x1113ce[_0x6d97('0x30')],_0x5ae482[_0x6d97('0x36')]));if(_0x1113ce[_0x6d97('0x30')][_0x6d97('0x38')]){_0x3d4f7b[_0x6d97('0x39')]=_[_0x6d97('0x3a')](_0x3d4f7b[_0x6d97('0x39')],{'$or':_[_0x6d97('0x2f')](_0x3d4f7b[_0x6d97('0x32')],function(_0x538ebb){var _0x2a33cf={};_0x2a33cf[_0x538ebb]={'$like':'%'+_0x1113ce[_0x6d97('0x30')][_0x6d97('0x38')]+'%'};return _0x2a33cf;})});}_0x3d4f7b=_['merge']({},_0x3d4f7b,_0x1113ce[_0x6d97('0x3d')]);return _0x528b08[_0x6d97('0x4a')](_0x3d4f7b);}})[_0x6d97('0x23')](function(_0x4c27a7){if(_0x4c27a7){_0x50f433=_0x4c27a7[_0x6d97('0x43')];if(!_0x1113ce[_0x6d97('0x30')][_0x6d97('0x34')]('nolimit')){_0x3d4f7b['limit']=qs[_0x6d97('0x1e')](_0x1113ce['query']['limit']);_0x3d4f7b[_0x6d97('0x1b')]=qs['offset'](_0x1113ce['query'][_0x6d97('0x1b')]);}return _0x528b08[_0x6d97('0x4a')](_0x3d4f7b);}})['then'](function(_0x2d75ec){if(_0x2d75ec){return _0x2d75ec?{'count':_0x50f433,'rows':_0x2d75ec}:null;}})['then'](respondWithResult(_0x224ff6,null))[_0x6d97('0x46')](handleError(_0x224ff6,null));};exports['getSubjects']=function(_0x1bb469,_0x16770c,_0x43b6e7){var _0x46c72b={};var _0x52072a={};var _0x20a7f5;var _0x10a39b;return db[_0x6d97('0x29')]['findOne']({'where':{'id':_0x1bb469[_0x6d97('0x41')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x16770c,null))[_0x6d97('0x23')](function(_0x564916){if(_0x564916){_0x20a7f5=_0x564916;_0x52072a[_0x6d97('0x2e')]=_['keys'](db[_0x6d97('0x4c')]['rawAttributes']);_0x52072a[_0x6d97('0x30')]=_[_0x6d97('0x42')](_0x1bb469[_0x6d97('0x30')]);_0x52072a['filters']=_[_0x6d97('0x31')](_0x52072a['model'],_0x52072a['query']);_0x46c72b[_0x6d97('0x32')]=_['intersection'](_0x52072a[_0x6d97('0x2e')],qs[_0x6d97('0x33')](_0x1bb469[_0x6d97('0x30')][_0x6d97('0x33')]));_0x46c72b[_0x6d97('0x32')]=_0x46c72b[_0x6d97('0x32')]['length']?_0x46c72b[_0x6d97('0x32')]:_0x52072a['model'];_0x46c72b[_0x6d97('0x4d')]=qs[_0x6d97('0x35')](_0x1bb469[_0x6d97('0x30')]['sort']);_0x46c72b[_0x6d97('0x39')]=qs[_0x6d97('0x36')](_['pick'](_0x1bb469[_0x6d97('0x30')],_0x52072a[_0x6d97('0x36')]));if(_0x1bb469['query'][_0x6d97('0x38')]){_0x46c72b[_0x6d97('0x39')]=_[_0x6d97('0x3a')](_0x46c72b[_0x6d97('0x39')],{'$or':_['map'](_0x46c72b[_0x6d97('0x32')],function(_0xbd0de3){var _0x572bd6={};_0x572bd6[_0xbd0de3]={'$like':'%'+_0x1bb469[_0x6d97('0x30')][_0x6d97('0x38')]+'%'};return _0x572bd6;})});}_0x46c72b=_['merge']({},_0x46c72b,_0x1bb469[_0x6d97('0x3d')]);return _0x20a7f5[_0x6d97('0x4e')](_0x46c72b);}})[_0x6d97('0x23')](function(_0x31d675){if(_0x31d675){_0x10a39b=_0x31d675[_0x6d97('0x43')];if(!_0x1bb469[_0x6d97('0x30')][_0x6d97('0x34')](_0x6d97('0x4f'))){_0x46c72b[_0x6d97('0x1e')]=qs[_0x6d97('0x1e')](_0x1bb469['query'][_0x6d97('0x1e')]);_0x46c72b[_0x6d97('0x1b')]=qs[_0x6d97('0x1b')](_0x1bb469[_0x6d97('0x30')][_0x6d97('0x1b')]);}return _0x20a7f5[_0x6d97('0x4e')](_0x46c72b);}})[_0x6d97('0x23')](function(_0x540c20){if(_0x540c20){return _0x540c20?{'count':_0x10a39b,'rows':_0x540c20}:null;}})[_0x6d97('0x23')](respondWithResult(_0x16770c,null))[_0x6d97('0x46')](handleError(_0x16770c,null));};exports['getDescriptions']=function(_0x2a1fd5,_0x178244,_0x5ab75a){var _0x1c16b0={};var _0x31b6d7={};var _0xe18254;var _0xc7c8e4;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2a1fd5[_0x6d97('0x41')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x178244,null))[_0x6d97('0x23')](function(_0x13502b){if(_0x13502b){_0xe18254=_0x13502b;_0x31b6d7[_0x6d97('0x2e')]=_[_0x6d97('0x42')](db[_0x6d97('0x4c')][_0x6d97('0x2a')]);_0x31b6d7['query']=_[_0x6d97('0x42')](_0x2a1fd5[_0x6d97('0x30')]);_0x31b6d7[_0x6d97('0x36')]=_['intersection'](_0x31b6d7[_0x6d97('0x2e')],_0x31b6d7['query']);_0x1c16b0[_0x6d97('0x32')]=_[_0x6d97('0x31')](_0x31b6d7[_0x6d97('0x2e')],qs['fields'](_0x2a1fd5[_0x6d97('0x30')][_0x6d97('0x33')]));_0x1c16b0[_0x6d97('0x32')]=_0x1c16b0[_0x6d97('0x32')]['length']?_0x1c16b0[_0x6d97('0x32')]:_0x31b6d7[_0x6d97('0x2e')];_0x1c16b0[_0x6d97('0x4d')]=qs[_0x6d97('0x35')](_0x2a1fd5[_0x6d97('0x30')]['sort']);_0x1c16b0['where']=qs[_0x6d97('0x36')](_['pick'](_0x2a1fd5[_0x6d97('0x30')],_0x31b6d7[_0x6d97('0x36')]));if(_0x2a1fd5[_0x6d97('0x30')][_0x6d97('0x38')]){_0x1c16b0[_0x6d97('0x39')]=_[_0x6d97('0x3a')](_0x1c16b0[_0x6d97('0x39')],{'$or':_[_0x6d97('0x2f')](_0x1c16b0[_0x6d97('0x32')],function(_0x44a1e7){var _0x3f4341={};_0x3f4341[_0x44a1e7]={'$like':'%'+_0x2a1fd5['query']['filter']+'%'};return _0x3f4341;})});}_0x1c16b0=_[_0x6d97('0x3a')]({},_0x1c16b0,_0x2a1fd5[_0x6d97('0x3d')]);return _0xe18254[_0x6d97('0x50')](_0x1c16b0);}})[_0x6d97('0x23')](function(_0x51c21a){if(_0x51c21a){_0xc7c8e4=_0x51c21a[_0x6d97('0x43')];if(!_0x2a1fd5[_0x6d97('0x30')][_0x6d97('0x34')](_0x6d97('0x4f'))){_0x1c16b0[_0x6d97('0x1e')]=qs[_0x6d97('0x1e')](_0x2a1fd5[_0x6d97('0x30')][_0x6d97('0x1e')]);_0x1c16b0[_0x6d97('0x1b')]=qs[_0x6d97('0x1b')](_0x2a1fd5[_0x6d97('0x30')][_0x6d97('0x1b')]);}return _0xe18254[_0x6d97('0x50')](_0x1c16b0);}})[_0x6d97('0x23')](function(_0x2db7f7){if(_0x2db7f7){return _0x2db7f7?{'count':_0xc7c8e4,'rows':_0x2db7f7}:null;}})[_0x6d97('0x23')](respondWithResult(_0x178244,null))[_0x6d97('0x46')](handleError(_0x178244,null));}; \ No newline at end of file +var _0x7954=['getFields','ServicenowField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','ServicenowConfiguration','includeAll','include','rows','catch','show','params','length','options','find','create','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7954,0xa7));var _0x4795=function(_0x440800,_0x391868){_0x440800=_0x440800-0x0;var _0x1b3ff9=_0x7954[_0x440800];return _0x1b3ff9;};'use strict';var emlformat=require(_0x4795('0x0'));var rimraf=require(_0x4795('0x1'));var zipdir=require(_0x4795('0x2'));var jsonpatch=require(_0x4795('0x3'));var rp=require(_0x4795('0x4'));var moment=require(_0x4795('0x5'));var BPromise=require(_0x4795('0x6'));var Mustache=require(_0x4795('0x7'));var util=require('util');var path=require(_0x4795('0x8'));var sox=require(_0x4795('0x9'));var csv=require(_0x4795('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4795('0xb'));var _=require(_0x4795('0xc'));var squel=require('squel');var crypto=require(_0x4795('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4795('0xe'));var toCsv=require(_0x4795('0xa'));var querystring=require(_0x4795('0xf'));var Papa=require(_0x4795('0x10'));var Redis=require(_0x4795('0x11'));var authService=require(_0x4795('0x12'));var qs=require(_0x4795('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4795('0x14'))(_0x4795('0x15'));var utils=require(_0x4795('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4795('0x17'));var db=require(_0x4795('0x18'))['db'];function respondWithStatusCode(_0x11aa2e,_0x54c0a6){_0x54c0a6=_0x54c0a6||0xcc;return function(_0x354074){if(_0x354074){return _0x11aa2e[_0x4795('0x19')](_0x54c0a6);}return _0x11aa2e['status'](_0x54c0a6)['end']();};}function respondWithResult(_0x3fc6fa,_0xbcc05f){_0xbcc05f=_0xbcc05f||0xc8;return function(_0x17f455){if(_0x17f455){return _0x3fc6fa[_0x4795('0x1a')](_0xbcc05f)[_0x4795('0x1b')](_0x17f455);}};}function respondWithFilteredResult(_0x10e6b1,_0x3c46b9){return function(_0xdb3fdd){if(_0xdb3fdd){var _0x56e05c=typeof _0x3c46b9[_0x4795('0x1c')]===_0x4795('0x1d')&&typeof _0x3c46b9['limit']==='undefined';var _0x42d77e=_0xdb3fdd[_0x4795('0x1e')];var _0x1497a2=_0x56e05c?0x0:_0x3c46b9[_0x4795('0x1c')];var _0x32f3ab=_0x56e05c?_0xdb3fdd[_0x4795('0x1e')]:_0x3c46b9['offset']+_0x3c46b9['limit'];var _0x5d0f70;if(_0x32f3ab>=_0x42d77e){_0x32f3ab=_0x42d77e;_0x5d0f70=0xc8;}else{_0x5d0f70=0xce;}_0x10e6b1[_0x4795('0x1a')](_0x5d0f70);return _0x10e6b1[_0x4795('0x1f')](_0x4795('0x20'),_0x1497a2+'-'+_0x32f3ab+'/'+_0x42d77e)[_0x4795('0x1b')](_0xdb3fdd);}return null;};}function patchUpdates(_0x3753e9){return function(_0x2df043){try{jsonpatch[_0x4795('0x21')](_0x2df043,_0x3753e9,!![]);}catch(_0x4ca714){return BPromise[_0x4795('0x22')](_0x4ca714);}return _0x2df043[_0x4795('0x23')]();};}function saveUpdates(_0x141975,_0x3abe2c){return function(_0x55af44){if(_0x55af44){return _0x55af44[_0x4795('0x24')](_0x141975)[_0x4795('0x25')](function(_0x37cc74){return _0x37cc74;});}return null;};}function removeEntity(_0xa69e1b,_0xac85d2){return function(_0x248f77){if(_0x248f77){return _0x248f77[_0x4795('0x26')]()[_0x4795('0x25')](function(){_0xa69e1b['status'](0xcc)[_0x4795('0x27')]();});}};}function handleEntityNotFound(_0x12f0bb,_0x209f8c){return function(_0x2ef7f7){if(!_0x2ef7f7){_0x12f0bb[_0x4795('0x19')](0x194);}return _0x2ef7f7;};}function handleError(_0x528b2d,_0x1a07c7){_0x1a07c7=_0x1a07c7||0x1f4;return function(_0x5dbc21){logger[_0x4795('0x28')](_0x5dbc21[_0x4795('0x29')]);if(_0x5dbc21[_0x4795('0x2a')]){delete _0x5dbc21[_0x4795('0x2a')];}_0x528b2d['status'](_0x1a07c7)['send'](_0x5dbc21);};}exports[_0x4795('0x2b')]=function(_0x132574,_0x80cc1e){var _0x46699e={},_0x4dd90e={},_0x365a79={'count':0x0,'rows':[]};var _0x36c08c=_[_0x4795('0x2c')](db['ServicenowConfiguration'][_0x4795('0x2d')],function(_0xf18dd1){return{'name':_0xf18dd1['fieldName'],'type':_0xf18dd1[_0x4795('0x2e')][_0x4795('0x2f')]};});_0x4dd90e[_0x4795('0x30')]=_[_0x4795('0x2c')](_0x36c08c,'name');_0x4dd90e[_0x4795('0x31')]=_[_0x4795('0x32')](_0x132574['query']);_0x4dd90e['filters']=_[_0x4795('0x33')](_0x4dd90e['model'],_0x4dd90e[_0x4795('0x31')]);_0x46699e[_0x4795('0x34')]=_['intersection'](_0x4dd90e[_0x4795('0x30')],qs['fields'](_0x132574[_0x4795('0x31')][_0x4795('0x35')]));_0x46699e[_0x4795('0x34')]=_0x46699e[_0x4795('0x34')]['length']?_0x46699e[_0x4795('0x34')]:_0x4dd90e['model'];if(!_0x132574[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x46699e['limit']=qs[_0x4795('0x38')](_0x132574[_0x4795('0x31')][_0x4795('0x38')]);_0x46699e[_0x4795('0x1c')]=qs['offset'](_0x132574['query'][_0x4795('0x1c')]);}_0x46699e[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x132574[_0x4795('0x31')][_0x4795('0x3a')]);_0x46699e[_0x4795('0x3b')]=qs['filters'](_[_0x4795('0x3c')](_0x132574['query'],_0x4dd90e[_0x4795('0x3d')]),_0x36c08c);if(_0x132574[_0x4795('0x31')][_0x4795('0x3e')]){_0x46699e[_0x4795('0x3b')]=_[_0x4795('0x3f')](_0x46699e[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x36c08c,function(_0x54e1e5){if(_0x54e1e5[_0x4795('0x2e')]!=='VIRTUAL'){var _0x16f6c0={};_0x16f6c0[_0x54e1e5[_0x4795('0x2a')]]={'$like':'%'+_0x132574[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0x16f6c0;}})});}_0x46699e=_[_0x4795('0x3f')]({},_0x46699e,_0x132574['options']);var _0x2ec3d2={'where':_0x46699e[_0x4795('0x3b')]};return db[_0x4795('0x40')]['count'](_0x2ec3d2)[_0x4795('0x25')](function(_0x337145){_0x365a79[_0x4795('0x1e')]=_0x337145;if(_0x132574['query'][_0x4795('0x41')]){_0x46699e[_0x4795('0x42')]=[{'all':!![]}];}return db[_0x4795('0x40')]['findAll'](_0x46699e);})[_0x4795('0x25')](function(_0x195e3b){_0x365a79[_0x4795('0x43')]=_0x195e3b;return _0x365a79;})[_0x4795('0x25')](respondWithFilteredResult(_0x80cc1e,_0x46699e))[_0x4795('0x44')](handleError(_0x80cc1e,null));};exports[_0x4795('0x45')]=function(_0x57d68b,_0xb33955){var _0x1a4f9b={'raw':![],'where':{'id':_0x57d68b[_0x4795('0x46')]['id']}},_0x301e42={};_0x301e42[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x40')]['rawAttributes']);_0x301e42[_0x4795('0x31')]=_[_0x4795('0x32')](_0x57d68b[_0x4795('0x31')]);_0x301e42['filters']=_[_0x4795('0x33')](_0x301e42[_0x4795('0x30')],_0x301e42['query']);_0x1a4f9b[_0x4795('0x34')]=_[_0x4795('0x33')](_0x301e42[_0x4795('0x30')],qs[_0x4795('0x35')](_0x57d68b['query'][_0x4795('0x35')]));_0x1a4f9b['attributes']=_0x1a4f9b['attributes'][_0x4795('0x47')]?_0x1a4f9b[_0x4795('0x34')]:_0x301e42[_0x4795('0x30')];if(_0x57d68b[_0x4795('0x31')][_0x4795('0x41')]){_0x1a4f9b[_0x4795('0x42')]=[{'all':!![]}];}_0x1a4f9b=_[_0x4795('0x3f')]({},_0x1a4f9b,_0x57d68b[_0x4795('0x48')]);return db['ServicenowConfiguration'][_0x4795('0x49')](_0x1a4f9b)[_0x4795('0x25')](handleEntityNotFound(_0xb33955,null))[_0x4795('0x25')](respondWithResult(_0xb33955,null))[_0x4795('0x44')](handleError(_0xb33955,null));};exports[_0x4795('0x4a')]=function(_0x29f875,_0x1668c9){return db[_0x4795('0x40')][_0x4795('0x4a')](_0x29f875['body'],{})[_0x4795('0x25')](respondWithResult(_0x1668c9,0xc9))['catch'](handleError(_0x1668c9,null));};exports[_0x4795('0x24')]=function(_0x1de816,_0x4de3d){if(_0x1de816[_0x4795('0x4b')]['id']){delete _0x1de816[_0x4795('0x4b')]['id'];}return db[_0x4795('0x40')][_0x4795('0x49')]({'where':{'id':_0x1de816[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x4de3d,null))[_0x4795('0x25')](saveUpdates(_0x1de816[_0x4795('0x4b')],null))['then'](respondWithResult(_0x4de3d,null))['catch'](handleError(_0x4de3d,null));};exports[_0x4795('0x26')]=function(_0x310a53,_0x1b96bf){return db[_0x4795('0x40')][_0x4795('0x49')]({'where':{'id':_0x310a53[_0x4795('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b96bf,null))[_0x4795('0x25')](removeEntity(_0x1b96bf,null))[_0x4795('0x44')](handleError(_0x1b96bf,null));};exports[_0x4795('0x4c')]=function(_0xf1971b,_0x4c7f51,_0x4d86e5){var _0x2f31a7={};var _0x2e24be={};var _0x353815;var _0x33c279;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xf1971b[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x4c7f51,null))['then'](function(_0x517ff5){if(_0x517ff5){_0x353815=_0x517ff5;_0x2e24be[_0x4795('0x30')]=_['keys'](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0x2e24be[_0x4795('0x31')]=_[_0x4795('0x32')](_0xf1971b['query']);_0x2e24be['filters']=_[_0x4795('0x33')](_0x2e24be[_0x4795('0x30')],_0x2e24be[_0x4795('0x31')]);_0x2f31a7['attributes']=_['intersection'](_0x2e24be['model'],qs[_0x4795('0x35')](_0xf1971b[_0x4795('0x31')][_0x4795('0x35')]));_0x2f31a7[_0x4795('0x34')]=_0x2f31a7[_0x4795('0x34')]['length']?_0x2f31a7[_0x4795('0x34')]:_0x2e24be[_0x4795('0x30')];_0x2f31a7['order']=qs[_0x4795('0x3a')](_0xf1971b[_0x4795('0x31')]['sort']);_0x2f31a7['where']=qs['filters'](_[_0x4795('0x3c')](_0xf1971b['query'],_0x2e24be[_0x4795('0x3d')]));if(_0xf1971b[_0x4795('0x31')][_0x4795('0x3e')]){_0x2f31a7[_0x4795('0x3b')]=_['merge'](_0x2f31a7[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x2f31a7[_0x4795('0x34')],function(_0x3891ae){var _0xfd4c74={};_0xfd4c74[_0x3891ae]={'$like':'%'+_0xf1971b[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0xfd4c74;})});}_0x2f31a7=_[_0x4795('0x3f')]({},_0x2f31a7,_0xf1971b[_0x4795('0x48')]);return _0x353815['getFields'](_0x2f31a7);}})[_0x4795('0x25')](function(_0x3cecef){if(_0x3cecef){_0x33c279=_0x3cecef['length'];if(!_0xf1971b[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x2f31a7[_0x4795('0x38')]=qs[_0x4795('0x38')](_0xf1971b[_0x4795('0x31')][_0x4795('0x38')]);_0x2f31a7[_0x4795('0x1c')]=qs['offset'](_0xf1971b[_0x4795('0x31')]['offset']);}return _0x353815[_0x4795('0x4c')](_0x2f31a7);}})['then'](function(_0x17061c){if(_0x17061c){return _0x17061c?{'count':_0x33c279,'rows':_0x17061c}:null;}})[_0x4795('0x25')](respondWithResult(_0x4c7f51,null))[_0x4795('0x44')](handleError(_0x4c7f51,null));};exports[_0x4795('0x4e')]=function(_0x4886a4,_0x17a633,_0x538555){var _0x1692b9={};var _0xb70f05={};var _0x4add22;var _0x2b4091;return db[_0x4795('0x40')][_0x4795('0x4f')]({'where':{'id':_0x4886a4[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x17a633,null))[_0x4795('0x25')](function(_0x4dfb38){if(_0x4dfb38){_0x4add22=_0x4dfb38;_0xb70f05[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0xb70f05['query']=_[_0x4795('0x32')](_0x4886a4[_0x4795('0x31')]);_0xb70f05[_0x4795('0x3d')]=_[_0x4795('0x33')](_0xb70f05[_0x4795('0x30')],_0xb70f05[_0x4795('0x31')]);_0x1692b9[_0x4795('0x34')]=_['intersection'](_0xb70f05[_0x4795('0x30')],qs['fields'](_0x4886a4['query'][_0x4795('0x35')]));_0x1692b9['attributes']=_0x1692b9[_0x4795('0x34')][_0x4795('0x47')]?_0x1692b9['attributes']:_0xb70f05[_0x4795('0x30')];_0x1692b9[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x4886a4[_0x4795('0x31')][_0x4795('0x3a')]);_0x1692b9[_0x4795('0x3b')]=qs['filters'](_[_0x4795('0x3c')](_0x4886a4[_0x4795('0x31')],_0xb70f05[_0x4795('0x3d')]));if(_0x4886a4[_0x4795('0x31')][_0x4795('0x3e')]){_0x1692b9[_0x4795('0x3b')]=_[_0x4795('0x3f')](_0x1692b9['where'],{'$or':_[_0x4795('0x2c')](_0x1692b9['attributes'],function(_0x45b65e){var _0x165101={};_0x165101[_0x45b65e]={'$like':'%'+_0x4886a4[_0x4795('0x31')]['filter']+'%'};return _0x165101;})});}_0x1692b9=_[_0x4795('0x3f')]({},_0x1692b9,_0x4886a4[_0x4795('0x48')]);return _0x4add22[_0x4795('0x4e')](_0x1692b9);}})[_0x4795('0x25')](function(_0x90576){if(_0x90576){_0x2b4091=_0x90576[_0x4795('0x47')];if(!_0x4886a4[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x1692b9[_0x4795('0x38')]=qs['limit'](_0x4886a4[_0x4795('0x31')][_0x4795('0x38')]);_0x1692b9[_0x4795('0x1c')]=qs[_0x4795('0x1c')](_0x4886a4[_0x4795('0x31')]['offset']);}return _0x4add22[_0x4795('0x4e')](_0x1692b9);}})[_0x4795('0x25')](function(_0x2d5ef5){if(_0x2d5ef5){return _0x2d5ef5?{'count':_0x2b4091,'rows':_0x2d5ef5}:null;}})[_0x4795('0x25')](respondWithResult(_0x17a633,null))['catch'](handleError(_0x17a633,null));};exports[_0x4795('0x50')]=function(_0x552ec6,_0x5bf034,_0xc15b27){var _0x3028e9={};var _0x33a8e5={};var _0x3da1de;var _0x33ceb7;return db[_0x4795('0x40')][_0x4795('0x4f')]({'where':{'id':_0x552ec6[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x5bf034,null))[_0x4795('0x25')](function(_0x30bf51){if(_0x30bf51){_0x3da1de=_0x30bf51;_0x33a8e5[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0x33a8e5['query']=_[_0x4795('0x32')](_0x552ec6[_0x4795('0x31')]);_0x33a8e5['filters']=_['intersection'](_0x33a8e5['model'],_0x33a8e5[_0x4795('0x31')]);_0x3028e9[_0x4795('0x34')]=_[_0x4795('0x33')](_0x33a8e5[_0x4795('0x30')],qs[_0x4795('0x35')](_0x552ec6[_0x4795('0x31')][_0x4795('0x35')]));_0x3028e9[_0x4795('0x34')]=_0x3028e9['attributes'][_0x4795('0x47')]?_0x3028e9[_0x4795('0x34')]:_0x33a8e5[_0x4795('0x30')];_0x3028e9[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x552ec6[_0x4795('0x31')][_0x4795('0x3a')]);_0x3028e9[_0x4795('0x3b')]=qs[_0x4795('0x3d')](_['pick'](_0x552ec6[_0x4795('0x31')],_0x33a8e5[_0x4795('0x3d')]));if(_0x552ec6[_0x4795('0x31')]['filter']){_0x3028e9['where']=_[_0x4795('0x3f')](_0x3028e9[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x3028e9[_0x4795('0x34')],function(_0x59880c){var _0x2a08f3={};_0x2a08f3[_0x59880c]={'$like':'%'+_0x552ec6[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0x2a08f3;})});}_0x3028e9=_[_0x4795('0x3f')]({},_0x3028e9,_0x552ec6[_0x4795('0x48')]);return _0x3da1de['getDescriptions'](_0x3028e9);}})[_0x4795('0x25')](function(_0x164014){if(_0x164014){_0x33ceb7=_0x164014[_0x4795('0x47')];if(!_0x552ec6[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x3028e9[_0x4795('0x38')]=qs[_0x4795('0x38')](_0x552ec6['query'][_0x4795('0x38')]);_0x3028e9['offset']=qs[_0x4795('0x1c')](_0x552ec6[_0x4795('0x31')][_0x4795('0x1c')]);}return _0x3da1de[_0x4795('0x50')](_0x3028e9);}})['then'](function(_0x20eb76){if(_0x20eb76){return _0x20eb76?{'count':_0x33ceb7,'rows':_0x20eb76}:null;}})['then'](respondWithResult(_0x5bf034,null))[_0x4795('0x44')](handleError(_0x5bf034,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2062a00..66a9b70 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 _0xb515=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger'];(function(_0x11a485,_0x44430f){var _0x19308b=function(_0x337eb6){while(--_0x337eb6){_0x11a485['push'](_0x11a485['shift']());}};_0x19308b(++_0x44430f);}(_0xb515,0x1b8));var _0x5b51=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0xb515[_0x2ecc65];return _0x103cc3;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var logger=require(_0x5b51('0x1'))(_0x5b51('0x2'));var moment=require(_0x5b51('0x3'));var BPromise=require(_0x5b51('0x4'));var rp=require(_0x5b51('0x5'));var fs=require('fs');var path=require(_0x5b51('0x6'));var rimraf=require(_0x5b51('0x7'));var config=require(_0x5b51('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x5b51('0x9')]=function(_0xf9e3ac,_0x3ef482){return _0xf9e3ac[_0x5b51('0xa')](_0x5b51('0xb'),attributes,{'tableName':_0x5b51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x4fc2,0x111));var _0x24fc=function(_0x46e85e,_0x48ad32){_0x46e85e=_0x46e85e-0x0;var _0x402ec5=_0x4fc2[_0x46e85e];return _0x402ec5;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'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 275fbfc..e207203 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 _0xbcc9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','ioredis'];(function(_0x532178,_0x5a1e6f){var _0x54d107=function(_0x54aadc){while(--_0x54aadc){_0x532178['push'](_0x532178['shift']());}};_0x54d107(++_0x5a1e6f);}(_0xbcc9,0x13d));var _0x9bcc=function(_0x389ff9,_0x556658){_0x389ff9=_0x389ff9-0x0;var _0x5e281c=_0xbcc9[_0x389ff9];return _0x5e281c;};'use strict';var _=require('lodash');var util=require(_0x9bcc('0x0'));var moment=require('moment');var BPromise=require(_0x9bcc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bcc('0x2'));var db=require(_0x9bcc('0x3'))['db'];var utils=require(_0x9bcc('0x4'));var logger=require(_0x9bcc('0x5'))(_0x9bcc('0x6'));var config=require('../../config/environment');var jayson=require(_0x9bcc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11bf5a,_0x22509d,_0x5cf966){return new BPromise(function(_0x38b2a1,_0x3ce5b6){return client[_0x9bcc('0x8')](_0x11bf5a,_0x5cf966)[_0x9bcc('0x9')](function(_0xfeec82){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x22509d,_0x9bcc('0xa'));logger['debug'](_0x9bcc('0xb'),_0x22509d,_0x9bcc('0xa'),JSON[_0x9bcc('0xc')](_0xfeec82));if(_0xfeec82[_0x9bcc('0xd')]){if(_0xfeec82[_0x9bcc('0xd')][_0x9bcc('0xe')]===0x1f4){logger[_0x9bcc('0xd')](_0x9bcc('0xf'),_0x22509d,_0xfeec82['error'][_0x9bcc('0x10')]);return _0x3ce5b6(_0xfeec82['error']['message']);}logger['error'](_0x9bcc('0xf'),_0x22509d,_0xfeec82[_0x9bcc('0xd')][_0x9bcc('0x10')]);return _0x38b2a1(_0xfeec82[_0x9bcc('0xd')]['message']);}else{logger[_0x9bcc('0x11')](_0x9bcc('0xf'),_0x22509d,_0x9bcc('0xa'));_0x38b2a1(_0xfeec82[_0x9bcc('0x12')]['message']);}})[_0x9bcc('0x13')](function(_0x1d8689){logger[_0x9bcc('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x22509d,_0x1d8689);_0x3ce5b6(_0x1d8689);});});} \ No newline at end of file +var _0x0c75=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5e8584,_0xab5d1f){var _0x500b5a=function(_0x5b4223){while(--_0x5b4223){_0x5e8584['push'](_0x5e8584['shift']());}};_0x500b5a(++_0xab5d1f);}(_0x0c75,0x6a));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x50c7('0x0'));var moment=require('moment');var BPromise=require(_0x50c7('0x1'));var rs=require(_0x50c7('0x2'));var fs=require('fs');var Redis=require(_0x50c7('0x3'));var db=require(_0x50c7('0x4'))['db'];var utils=require(_0x50c7('0x5'));var logger=require(_0x50c7('0x6'))(_0x50c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x50c7('0x8'));var client=jayson['client'][_0x50c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x594830,_0x34a297,_0x172856){return new BPromise(function(_0x44d102,_0x53ef83){return client['request'](_0x594830,_0x172856)[_0x50c7('0xa')](function(_0x474dc0){logger[_0x50c7('0xb')](_0x50c7('0xc'),_0x34a297,_0x50c7('0xd'));logger[_0x50c7('0xe')](_0x50c7('0xf'),_0x34a297,'request\x20sent',JSON['stringify'](_0x474dc0));if(_0x474dc0[_0x50c7('0x10')]){if(_0x474dc0[_0x50c7('0x10')][_0x50c7('0x11')]===0x1f4){logger['error'](_0x50c7('0xc'),_0x34a297,_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);return _0x53ef83(_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x34a297,_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);return _0x44d102(_0x474dc0['error'][_0x50c7('0x12')]);}else{logger[_0x50c7('0xb')](_0x50c7('0xc'),_0x34a297,_0x50c7('0xd'));_0x44d102(_0x474dc0['result'][_0x50c7('0x12')]);}})[_0x50c7('0x13')](function(_0xc4d7f5){logger['error'](_0x50c7('0xc'),_0x34a297,_0xc4d7f5);_0x53ef83(_0xc4d7f5);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 03ba09d..fd9a1d3 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 _0x0b44=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3737a7,_0x364cb1){var _0x50ca2b=function(_0xc9de0a){while(--_0xc9de0a){_0x3737a7['push'](_0x3737a7['shift']());}};_0x50ca2b(++_0x364cb1);}(_0x0b44,0x160));var _0x40b4=function(_0x3e6451,_0x4f7c12){_0x3e6451=_0x3e6451-0x0;var _0x27dde9=_0x0b44[_0x3e6451];return _0x27dde9;};'use strict';var multer=require(_0x40b4('0x0'));var util=require(_0x40b4('0x1'));var path=require(_0x40b4('0x2'));var timeout=require(_0x40b4('0x3'));var express=require(_0x40b4('0x4'));var router=express[_0x40b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x40b4('0x6'));var interaction=require(_0x40b4('0x7'));var config=require(_0x40b4('0x8'));var controller=require(_0x40b4('0x9'));router[_0x40b4('0xa')]('/',auth[_0x40b4('0xb')](),controller[_0x40b4('0xc')]);router[_0x40b4('0xa')]('/:id',auth[_0x40b4('0xb')](),controller[_0x40b4('0xd')]);router[_0x40b4('0xe')]('/',auth['isAuthenticated'](),controller[_0x40b4('0xf')]);router[_0x40b4('0x10')](_0x40b4('0x11'),auth['isAuthenticated'](),controller[_0x40b4('0x12')]);router['delete'](_0x40b4('0x11'),auth[_0x40b4('0xb')](),controller[_0x40b4('0x13')]);module[_0x40b4('0x14')]=router; \ No newline at end of file +var _0xdb9a=['./intServicenowField.controller','get','index','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x59237e,_0x3aff88){var _0x3b38ce=function(_0x405f2c){while(--_0x405f2c){_0x59237e['push'](_0x59237e['shift']());}};_0x3b38ce(++_0x3aff88);}(_0xdb9a,0xb5));var _0xadb9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdb9a[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xadb9('0x0'));var util=require(_0xadb9('0x1'));var path=require(_0xadb9('0x2'));var timeout=require(_0xadb9('0x3'));var express=require(_0xadb9('0x4'));var router=express[_0xadb9('0x5')]();var fs_extra=require(_0xadb9('0x6'));var auth=require(_0xadb9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xadb9('0x8'));var controller=require(_0xadb9('0x9'));router[_0xadb9('0xa')]('/',auth['isAuthenticated'](),controller[_0xadb9('0xb')]);router['get'](_0xadb9('0xc'),auth[_0xadb9('0xd')](),controller[_0xadb9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xadb9('0xf')](_0xadb9('0xc'),auth[_0xadb9('0xd')](),controller[_0xadb9('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xadb9('0x11')]);module[_0xadb9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 03a5242..f699d57 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 _0x89c4=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x3635b2,_0x47c1da){var _0x2cc51d=function(_0x58484a){while(--_0x58484a){_0x3635b2['push'](_0x3635b2['shift']());}};_0x2cc51d(++_0x47c1da);}(_0x89c4,0xde));var _0x489c=function(_0x4520bc,_0x3cc3aa){_0x4520bc=_0x4520bc-0x0;var _0x4d3122=_0x89c4[_0x4520bc];return _0x4d3122;};'use strict';var Sequelize=require(_0x489c('0x0'));module['exports']={'type':{'type':Sequelize[_0x489c('0x1')](_0x489c('0x2'),_0x489c('0x3'),'customVariable',_0x489c('0x4'),_0x489c('0x5')),'defaultValue':_0x489c('0x2')},'content':{'type':Sequelize[_0x489c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x489c('0x1')](_0x489c('0x2'),_0x489c('0x3'),_0x489c('0x7'))},'keyContent':{'type':Sequelize[_0x489c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x489c('0x6')]},'customField':{'type':Sequelize[_0x489c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x489c('0x6')]}}; \ No newline at end of file +var _0xf47b=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xf47b,0x153));var _0xbf47=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xf47b[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xbf47('0x0'));module[_0xbf47('0x1')]={'type':{'type':Sequelize[_0xbf47('0x2')](_0xbf47('0x3'),_0xbf47('0x4'),_0xbf47('0x5'),_0xbf47('0x6'),_0xbf47('0x7')),'defaultValue':_0xbf47('0x3')},'content':{'type':Sequelize[_0xbf47('0x8')]},'key':{'type':Sequelize[_0xbf47('0x8')]},'keyType':{'type':Sequelize[_0xbf47('0x2')]('string',_0xbf47('0x4'),_0xbf47('0x5'))},'keyContent':{'type':Sequelize[_0xbf47('0x8')]},'idField':{'type':Sequelize[_0xbf47('0x8')]},'nameField':{'type':Sequelize[_0xbf47('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index cb2d404..a606461 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 _0xf678=['name','send','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','body','update','rimraf','zip-dir','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','undefined','count','offset','limit','Content-Range','apply','reject','then','destroy','sendStatus','stack'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xf678,0x136));var _0x8f67=function(_0x2f6dba,_0x5cce6e){_0x2f6dba=_0x2f6dba-0x0;var _0x199994=_0xf678[_0x2f6dba];return _0x199994;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f67('0x0'));var zipdir=require(_0x8f67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f67('0x2'));var util=require(_0x8f67('0x3'));var path=require(_0x8f67('0x4'));var sox=require(_0x8f67('0x5'));var csv=require('to-csv');var ejs=require(_0x8f67('0x6'));var fs=require('fs');var fs_extra=require(_0x8f67('0x7'));var _=require('lodash');var squel=require(_0x8f67('0x8'));var crypto=require(_0x8f67('0x9'));var jsforce=require(_0x8f67('0xa'));var deskjs=require(_0x8f67('0xb'));var toCsv=require(_0x8f67('0xc'));var querystring=require(_0x8f67('0xd'));var Papa=require(_0x8f67('0xe'));var Redis=require(_0x8f67('0xf'));var authService=require(_0x8f67('0x10'));var qs=require(_0x8f67('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f67('0x12'));var logger=require('../../config/logger')(_0x8f67('0x13'));var utils=require(_0x8f67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f67('0x15'))['db'];function respondWithStatusCode(_0x31a906,_0x24eca8){_0x24eca8=_0x24eca8||0xcc;return function(_0x554568){if(_0x554568){return _0x31a906['sendStatus'](_0x24eca8);}return _0x31a906['status'](_0x24eca8)[_0x8f67('0x16')]();};}function respondWithResult(_0x421b45,_0x5d9da0){_0x5d9da0=_0x5d9da0||0xc8;return function(_0x2d5083){if(_0x2d5083){return _0x421b45[_0x8f67('0x17')](_0x5d9da0)['json'](_0x2d5083);}};}function respondWithFilteredResult(_0x15a573,_0xb27fe7){return function(_0x39724b){if(_0x39724b){var _0x4fddec=typeof _0xb27fe7['offset']===_0x8f67('0x18')&&typeof _0xb27fe7['limit']===_0x8f67('0x18');var _0xc8632d=_0x39724b[_0x8f67('0x19')];var _0x1a8a04=_0x4fddec?0x0:_0xb27fe7[_0x8f67('0x1a')];var _0x7a51ff=_0x4fddec?_0x39724b[_0x8f67('0x19')]:_0xb27fe7[_0x8f67('0x1a')]+_0xb27fe7[_0x8f67('0x1b')];var _0x30d88f;if(_0x7a51ff>=_0xc8632d){_0x7a51ff=_0xc8632d;_0x30d88f=0xc8;}else{_0x30d88f=0xce;}_0x15a573[_0x8f67('0x17')](_0x30d88f);return _0x15a573['set'](_0x8f67('0x1c'),_0x1a8a04+'-'+_0x7a51ff+'/'+_0xc8632d)['json'](_0x39724b);}return null;};}function patchUpdates(_0x2bdd92){return function(_0x3c95cb){try{jsonpatch[_0x8f67('0x1d')](_0x3c95cb,_0x2bdd92,!![]);}catch(_0x1a2b58){return BPromise[_0x8f67('0x1e')](_0x1a2b58);}return _0x3c95cb['save']();};}function saveUpdates(_0x5705ff,_0x170bca){return function(_0x28ae0e){if(_0x28ae0e){return _0x28ae0e['update'](_0x5705ff)[_0x8f67('0x1f')](function(_0x5a8fb1){return _0x5a8fb1;});}return null;};}function removeEntity(_0x49264f,_0xbcccf9){return function(_0x3633d3){if(_0x3633d3){return _0x3633d3[_0x8f67('0x20')]()['then'](function(){_0x49264f['status'](0xcc)[_0x8f67('0x16')]();});}};}function handleEntityNotFound(_0x57c848,_0x43e737){return function(_0x4ed517){if(!_0x4ed517){_0x57c848[_0x8f67('0x21')](0x194);}return _0x4ed517;};}function handleError(_0x45e4db,_0x373b2b){_0x373b2b=_0x373b2b||0x1f4;return function(_0x14b98c){logger['error'](_0x14b98c[_0x8f67('0x22')]);if(_0x14b98c[_0x8f67('0x23')]){delete _0x14b98c['name'];}_0x45e4db[_0x8f67('0x17')](_0x373b2b)[_0x8f67('0x24')](_0x14b98c);};}exports['index']=function(_0x216f73,_0x4acd5f){var _0x34cb58={},_0x24e3ee={},_0x809253={'count':0x0,'rows':[]};var _0x32ed83=_[_0x8f67('0x25')](db[_0x8f67('0x26')][_0x8f67('0x27')],function(_0x4ffc9d){return{'name':_0x4ffc9d[_0x8f67('0x28')],'type':_0x4ffc9d[_0x8f67('0x29')]['key']};});_0x24e3ee[_0x8f67('0x2a')]=_[_0x8f67('0x25')](_0x32ed83,_0x8f67('0x23'));_0x24e3ee[_0x8f67('0x2b')]=_[_0x8f67('0x2c')](_0x216f73[_0x8f67('0x2b')]);_0x24e3ee[_0x8f67('0x2d')]=_[_0x8f67('0x2e')](_0x24e3ee[_0x8f67('0x2a')],_0x24e3ee['query']);_0x34cb58[_0x8f67('0x2f')]=_['intersection'](_0x24e3ee['model'],qs[_0x8f67('0x30')](_0x216f73[_0x8f67('0x2b')][_0x8f67('0x30')]));_0x34cb58[_0x8f67('0x2f')]=_0x34cb58['attributes'][_0x8f67('0x31')]?_0x34cb58[_0x8f67('0x2f')]:_0x24e3ee['model'];if(!_0x216f73[_0x8f67('0x2b')][_0x8f67('0x32')](_0x8f67('0x33'))){_0x34cb58['limit']=qs[_0x8f67('0x1b')](_0x216f73[_0x8f67('0x2b')][_0x8f67('0x1b')]);_0x34cb58['offset']=qs[_0x8f67('0x1a')](_0x216f73[_0x8f67('0x2b')][_0x8f67('0x1a')]);}_0x34cb58[_0x8f67('0x34')]=qs['sort'](_0x216f73['query'][_0x8f67('0x35')]);_0x34cb58[_0x8f67('0x36')]=qs[_0x8f67('0x2d')](_[_0x8f67('0x37')](_0x216f73[_0x8f67('0x2b')],_0x24e3ee[_0x8f67('0x2d')]),_0x32ed83);if(_0x216f73[_0x8f67('0x2b')][_0x8f67('0x38')]){_0x34cb58[_0x8f67('0x36')]=_[_0x8f67('0x39')](_0x34cb58[_0x8f67('0x36')],{'$or':_[_0x8f67('0x25')](_0x32ed83,function(_0x101f34){if(_0x101f34[_0x8f67('0x29')]!==_0x8f67('0x3a')){var _0x27780a={};_0x27780a[_0x101f34['name']]={'$like':'%'+_0x216f73[_0x8f67('0x2b')]['filter']+'%'};return _0x27780a;}})});}_0x34cb58=_['merge']({},_0x34cb58,_0x216f73[_0x8f67('0x3b')]);var _0x8ef544={'where':_0x34cb58['where']};return db['ServicenowField'][_0x8f67('0x19')](_0x8ef544)['then'](function(_0x36bff8){_0x809253[_0x8f67('0x19')]=_0x36bff8;if(_0x216f73[_0x8f67('0x2b')][_0x8f67('0x3c')]){_0x34cb58['include']=[{'all':!![]}];}return db[_0x8f67('0x26')]['findAll'](_0x34cb58);})[_0x8f67('0x1f')](function(_0x56905a){_0x809253[_0x8f67('0x3d')]=_0x56905a;return _0x809253;})[_0x8f67('0x1f')](respondWithFilteredResult(_0x4acd5f,_0x34cb58))['catch'](handleError(_0x4acd5f,null));};exports[_0x8f67('0x3e')]=function(_0x522a51,_0x21d6e1){var _0xa1c8b8={'raw':!![],'where':{'id':_0x522a51[_0x8f67('0x3f')]['id']}},_0x3c0310={};_0x3c0310[_0x8f67('0x2a')]=_[_0x8f67('0x2c')](db[_0x8f67('0x26')][_0x8f67('0x27')]);_0x3c0310[_0x8f67('0x2b')]=_[_0x8f67('0x2c')](_0x522a51['query']);_0x3c0310[_0x8f67('0x2d')]=_[_0x8f67('0x2e')](_0x3c0310[_0x8f67('0x2a')],_0x3c0310[_0x8f67('0x2b')]);_0xa1c8b8[_0x8f67('0x2f')]=_['intersection'](_0x3c0310[_0x8f67('0x2a')],qs[_0x8f67('0x30')](_0x522a51[_0x8f67('0x2b')][_0x8f67('0x30')]));_0xa1c8b8['attributes']=_0xa1c8b8[_0x8f67('0x2f')][_0x8f67('0x31')]?_0xa1c8b8['attributes']:_0x3c0310[_0x8f67('0x2a')];if(_0x522a51['query']['includeAll']){_0xa1c8b8['include']=[{'all':!![]}];}_0xa1c8b8=_[_0x8f67('0x39')]({},_0xa1c8b8,_0x522a51[_0x8f67('0x3b')]);return db['ServicenowField'][_0x8f67('0x40')](_0xa1c8b8)['then'](handleEntityNotFound(_0x21d6e1,null))[_0x8f67('0x1f')](respondWithResult(_0x21d6e1,null))[_0x8f67('0x41')](handleError(_0x21d6e1,null));};exports[_0x8f67('0x42')]=function(_0x25b468,_0x13e0e2){return db[_0x8f67('0x26')][_0x8f67('0x42')](_0x25b468[_0x8f67('0x43')],{})[_0x8f67('0x1f')](respondWithResult(_0x13e0e2,0xc9))[_0x8f67('0x41')](handleError(_0x13e0e2,null));};exports[_0x8f67('0x44')]=function(_0x3a22ab,_0x4da526){if(_0x3a22ab[_0x8f67('0x43')]['id']){delete _0x3a22ab['body']['id'];}return db[_0x8f67('0x26')]['find']({'where':{'id':_0x3a22ab[_0x8f67('0x3f')]['id']}})[_0x8f67('0x1f')](handleEntityNotFound(_0x4da526,null))[_0x8f67('0x1f')](saveUpdates(_0x3a22ab[_0x8f67('0x43')],null))[_0x8f67('0x1f')](respondWithResult(_0x4da526,null))[_0x8f67('0x41')](handleError(_0x4da526,null));};exports[_0x8f67('0x20')]=function(_0x5595d8,_0xfa7e5e){return db[_0x8f67('0x26')]['find']({'where':{'id':_0x5595d8[_0x8f67('0x3f')]['id']}})[_0x8f67('0x1f')](handleEntityNotFound(_0xfa7e5e,null))[_0x8f67('0x1f')](removeEntity(_0xfa7e5e,null))[_0x8f67('0x41')](handleError(_0xfa7e5e,null));}; \ No newline at end of file +var _0x7ba5=['Content-Range','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ServicenowField','includeAll','findAll','rows','catch','show','fields','include','merge','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x7ba5,0x72));var _0x57ba=function(_0x12908b,_0x2abc84){_0x12908b=_0x12908b-0x0;var _0x5e6384=_0x7ba5[_0x12908b];return _0x5e6384;};'use strict';var emlformat=require(_0x57ba('0x0'));var rimraf=require(_0x57ba('0x1'));var zipdir=require(_0x57ba('0x2'));var jsonpatch=require(_0x57ba('0x3'));var rp=require(_0x57ba('0x4'));var moment=require(_0x57ba('0x5'));var BPromise=require(_0x57ba('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x57ba('0x7'));var csv=require(_0x57ba('0x8'));var ejs=require(_0x57ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57ba('0xa'));var squel=require(_0x57ba('0xb'));var crypto=require(_0x57ba('0xc'));var jsforce=require(_0x57ba('0xd'));var deskjs=require(_0x57ba('0xe'));var toCsv=require(_0x57ba('0x8'));var querystring=require('querystring');var Papa=require(_0x57ba('0xf'));var Redis=require('ioredis');var authService=require(_0x57ba('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x57ba('0x11'))(_0x57ba('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x57ba('0x13'));var db=require(_0x57ba('0x14'))['db'];function respondWithStatusCode(_0x23ec08,_0xc8f294){_0xc8f294=_0xc8f294||0xcc;return function(_0xd5cdf4){if(_0xd5cdf4){return _0x23ec08[_0x57ba('0x15')](_0xc8f294);}return _0x23ec08['status'](_0xc8f294)[_0x57ba('0x16')]();};}function respondWithResult(_0x2e90c1,_0x395f55){_0x395f55=_0x395f55||0xc8;return function(_0x3d52a0){if(_0x3d52a0){return _0x2e90c1[_0x57ba('0x17')](_0x395f55)['json'](_0x3d52a0);}};}function respondWithFilteredResult(_0x1dce4a,_0x256e80){return function(_0x79b74c){if(_0x79b74c){var _0x5a6bc2=typeof _0x256e80['offset']===_0x57ba('0x18')&&typeof _0x256e80[_0x57ba('0x19')]===_0x57ba('0x18');var _0x1c0a16=_0x79b74c[_0x57ba('0x1a')];var _0x8af08c=_0x5a6bc2?0x0:_0x256e80[_0x57ba('0x1b')];var _0x2b6d0d=_0x5a6bc2?_0x79b74c[_0x57ba('0x1a')]:_0x256e80['offset']+_0x256e80['limit'];var _0x5d1e9b;if(_0x2b6d0d>=_0x1c0a16){_0x2b6d0d=_0x1c0a16;_0x5d1e9b=0xc8;}else{_0x5d1e9b=0xce;}_0x1dce4a[_0x57ba('0x17')](_0x5d1e9b);return _0x1dce4a['set'](_0x57ba('0x1c'),_0x8af08c+'-'+_0x2b6d0d+'/'+_0x1c0a16)['json'](_0x79b74c);}return null;};}function patchUpdates(_0x4f0ab7){return function(_0xf3edc0){try{jsonpatch[_0x57ba('0x1d')](_0xf3edc0,_0x4f0ab7,!![]);}catch(_0x316f31){return BPromise[_0x57ba('0x1e')](_0x316f31);}return _0xf3edc0['save']();};}function saveUpdates(_0x51c7bb,_0x488de2){return function(_0x1a01e2){if(_0x1a01e2){return _0x1a01e2['update'](_0x51c7bb)[_0x57ba('0x1f')](function(_0x18ed4a){return _0x18ed4a;});}return null;};}function removeEntity(_0x5580dc,_0x41a770){return function(_0x1bf966){if(_0x1bf966){return _0x1bf966[_0x57ba('0x20')]()['then'](function(){_0x5580dc[_0x57ba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3100e9,_0x2b100d){return function(_0x6ebb3a){if(!_0x6ebb3a){_0x3100e9['sendStatus'](0x194);}return _0x6ebb3a;};}function handleError(_0x1d79c0,_0x3346b0){_0x3346b0=_0x3346b0||0x1f4;return function(_0x402577){logger[_0x57ba('0x21')](_0x402577['stack']);if(_0x402577[_0x57ba('0x22')]){delete _0x402577[_0x57ba('0x22')];}_0x1d79c0['status'](_0x3346b0)[_0x57ba('0x23')](_0x402577);};}exports[_0x57ba('0x24')]=function(_0x3156d0,_0x208c7e){var _0xd32053={},_0x1bb81b={},_0x1e3161={'count':0x0,'rows':[]};var _0x40c6e2=_[_0x57ba('0x25')](db['ServicenowField'][_0x57ba('0x26')],function(_0x5aedfa){return{'name':_0x5aedfa[_0x57ba('0x27')],'type':_0x5aedfa[_0x57ba('0x28')][_0x57ba('0x29')]};});_0x1bb81b[_0x57ba('0x2a')]=_[_0x57ba('0x25')](_0x40c6e2,_0x57ba('0x22'));_0x1bb81b[_0x57ba('0x2b')]=_[_0x57ba('0x2c')](_0x3156d0[_0x57ba('0x2b')]);_0x1bb81b[_0x57ba('0x2d')]=_[_0x57ba('0x2e')](_0x1bb81b[_0x57ba('0x2a')],_0x1bb81b[_0x57ba('0x2b')]);_0xd32053[_0x57ba('0x2f')]=_['intersection'](_0x1bb81b[_0x57ba('0x2a')],qs['fields'](_0x3156d0[_0x57ba('0x2b')]['fields']));_0xd32053[_0x57ba('0x2f')]=_0xd32053[_0x57ba('0x2f')][_0x57ba('0x30')]?_0xd32053[_0x57ba('0x2f')]:_0x1bb81b[_0x57ba('0x2a')];if(!_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x31')](_0x57ba('0x32'))){_0xd32053['limit']=qs[_0x57ba('0x19')](_0x3156d0['query'][_0x57ba('0x19')]);_0xd32053[_0x57ba('0x1b')]=qs[_0x57ba('0x1b')](_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x1b')]);}_0xd32053[_0x57ba('0x33')]=qs[_0x57ba('0x34')](_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x34')]);_0xd32053[_0x57ba('0x35')]=qs[_0x57ba('0x2d')](_[_0x57ba('0x36')](_0x3156d0[_0x57ba('0x2b')],_0x1bb81b[_0x57ba('0x2d')]),_0x40c6e2);if(_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x37')]){_0xd32053[_0x57ba('0x35')]=_['merge'](_0xd32053[_0x57ba('0x35')],{'$or':_['map'](_0x40c6e2,function(_0x49dc0e){if(_0x49dc0e[_0x57ba('0x28')]!==_0x57ba('0x38')){var _0x25f594={};_0x25f594[_0x49dc0e['name']]={'$like':'%'+_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x37')]+'%'};return _0x25f594;}})});}_0xd32053=_['merge']({},_0xd32053,_0x3156d0['options']);var _0x3ab431={'where':_0xd32053['where']};return db[_0x57ba('0x39')][_0x57ba('0x1a')](_0x3ab431)['then'](function(_0x4149b1){_0x1e3161[_0x57ba('0x1a')]=_0x4149b1;if(_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x3a')]){_0xd32053['include']=[{'all':!![]}];}return db['ServicenowField'][_0x57ba('0x3b')](_0xd32053);})[_0x57ba('0x1f')](function(_0x19bd09){_0x1e3161[_0x57ba('0x3c')]=_0x19bd09;return _0x1e3161;})[_0x57ba('0x1f')](respondWithFilteredResult(_0x208c7e,_0xd32053))[_0x57ba('0x3d')](handleError(_0x208c7e,null));};exports[_0x57ba('0x3e')]=function(_0x2546b8,_0x2e0afb){var _0x2db104={'raw':!![],'where':{'id':_0x2546b8['params']['id']}},_0x22fb71={};_0x22fb71[_0x57ba('0x2a')]=_[_0x57ba('0x2c')](db[_0x57ba('0x39')][_0x57ba('0x26')]);_0x22fb71[_0x57ba('0x2b')]=_['keys'](_0x2546b8[_0x57ba('0x2b')]);_0x22fb71[_0x57ba('0x2d')]=_[_0x57ba('0x2e')](_0x22fb71['model'],_0x22fb71[_0x57ba('0x2b')]);_0x2db104['attributes']=_[_0x57ba('0x2e')](_0x22fb71[_0x57ba('0x2a')],qs['fields'](_0x2546b8[_0x57ba('0x2b')][_0x57ba('0x3f')]));_0x2db104['attributes']=_0x2db104[_0x57ba('0x2f')][_0x57ba('0x30')]?_0x2db104[_0x57ba('0x2f')]:_0x22fb71[_0x57ba('0x2a')];if(_0x2546b8[_0x57ba('0x2b')][_0x57ba('0x3a')]){_0x2db104[_0x57ba('0x40')]=[{'all':!![]}];}_0x2db104=_[_0x57ba('0x41')]({},_0x2db104,_0x2546b8[_0x57ba('0x42')]);return db['ServicenowField'][_0x57ba('0x43')](_0x2db104)[_0x57ba('0x1f')](handleEntityNotFound(_0x2e0afb,null))[_0x57ba('0x1f')](respondWithResult(_0x2e0afb,null))['catch'](handleError(_0x2e0afb,null));};exports['create']=function(_0x1e00d2,_0x2c0b7d){return db[_0x57ba('0x39')][_0x57ba('0x44')](_0x1e00d2[_0x57ba('0x45')],{})[_0x57ba('0x1f')](respondWithResult(_0x2c0b7d,0xc9))[_0x57ba('0x3d')](handleError(_0x2c0b7d,null));};exports['update']=function(_0x145685,_0x336ea1){if(_0x145685[_0x57ba('0x45')]['id']){delete _0x145685[_0x57ba('0x45')]['id'];}return db[_0x57ba('0x39')][_0x57ba('0x43')]({'where':{'id':_0x145685['params']['id']}})[_0x57ba('0x1f')](handleEntityNotFound(_0x336ea1,null))[_0x57ba('0x1f')](saveUpdates(_0x145685[_0x57ba('0x45')],null))[_0x57ba('0x1f')](respondWithResult(_0x336ea1,null))['catch'](handleError(_0x336ea1,null));};exports[_0x57ba('0x20')]=function(_0x4e1a07,_0x275b92){return db[_0x57ba('0x39')][_0x57ba('0x43')]({'where':{'id':_0x4e1a07[_0x57ba('0x46')]['id']}})[_0x57ba('0x1f')](handleEntityNotFound(_0x275b92,null))[_0x57ba('0x1f')](removeEntity(_0x275b92,null))[_0x57ba('0x3d')](handleError(_0x275b92,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index cbe8de8..cbcafed 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 _0x9d5d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d5d,0xa4));var _0xd9d5=function(_0x374c6e,_0x3999f3){_0x374c6e=_0x374c6e-0x0;var _0x2a13d2=_0x9d5d[_0x374c6e];return _0x2a13d2;};'use strict';var _=require(_0xd9d5('0x0'));var util=require(_0xd9d5('0x1'));var logger=require(_0xd9d5('0x2'))(_0xd9d5('0x3'));var moment=require(_0xd9d5('0x4'));var BPromise=require(_0xd9d5('0x5'));var rp=require(_0xd9d5('0x6'));var fs=require('fs');var path=require(_0xd9d5('0x7'));var rimraf=require(_0xd9d5('0x8'));var config=require(_0xd9d5('0x9'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x55993d,_0x44ce51){return _0x55993d[_0xd9d5('0xa')]('ServicenowField',attributes,{'tableName':_0xd9d5('0xb'),'paranoid':![],'indexes':[{'name':_0xd9d5('0xc'),'fields':[_0xd9d5('0xd'),_0xd9d5('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb8=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x5eb8,0x186));var _0x85eb=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0x5eb8[_0x38a6c6];return _0x142f0a;};'use strict';var _=require(_0x85eb('0x0'));var util=require(_0x85eb('0x1'));var logger=require(_0x85eb('0x2'))(_0x85eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x4b6e49,_0x4677d9){return _0x4b6e49[_0x85eb('0xa')]('ServicenowField',attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x85eb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 3fea3ec..46adf62 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x40fea4,_0x8757e0){var _0x10197c=function(_0x42c986){while(--_0x42c986){_0x40fea4['push'](_0x40fea4['shift']());}};_0x10197c(++_0x8757e0);}(_0xaa88,0x137));var _0x8aa8=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xaa88[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x260ee1,_0x3e1588){var _0xc45df9=function(_0xa3a2e2){while(--_0xa3a2e2){_0x260ee1['push'](_0x260ee1['shift']());}};_0xc45df9(++_0x3e1588);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7a2c51c..31f948b 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x29a1f1,_0x3400d8){var _0x49ff9d=function(_0x74250d){while(--_0x74250d){_0x29a1f1['push'](_0x29a1f1['shift']());}};_0x49ff9d(++_0x3400d8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x620a5e,_0x30de47){var _0x389748=function(_0x2fa941){while(--_0x2fa941){_0x620a5e['push'](_0x620a5e['shift']());}};_0x389748(++_0x30de47);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 051481e..b1c3fee 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 _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x18f2b5,_0x23580f){var _0x119fa5=function(_0x5aeb96){while(--_0x5aeb96){_0x18f2b5['push'](_0x18f2b5['shift']());}};_0x119fa5(++_0x23580f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xb8b31e,_0x288564){var _0x4f871d=function(_0x72e230){while(--_0x72e230){_0xb8b31e['push'](_0xb8b31e['shift']());}};_0x4f871d(++_0x288564);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d98a423..e5c090f 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 _0x1edd=['error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','filter','includeAll','include','findAll','rows','show','options','create','body','catch','find','getConfigurations','findOne','params','SugarcrmConfiguration','pick','merge','addConfiguration','Subjects','getSubjects','Descriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','POST','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy'];(function(_0x119d2b,_0xc3190f){var _0x3c8728=function(_0x24f9e2){while(--_0x24f9e2){_0x119d2b['push'](_0x119d2b['shift']());}};_0x3c8728(++_0xc3190f);}(_0x1edd,0xcd));var _0xd1ed=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x1edd[_0x43f489];return _0x4134b4;};'use strict';var emlformat=require(_0xd1ed('0x0'));var rimraf=require(_0xd1ed('0x1'));var zipdir=require(_0xd1ed('0x2'));var jsonpatch=require(_0xd1ed('0x3'));var rp=require(_0xd1ed('0x4'));var moment=require(_0xd1ed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd1ed('0x6'));var util=require(_0xd1ed('0x7'));var path=require('path');var sox=require(_0xd1ed('0x8'));var csv=require(_0xd1ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1ed('0xa'));var squel=require(_0xd1ed('0xb'));var crypto=require(_0xd1ed('0xc'));var jsforce=require(_0xd1ed('0xd'));var deskjs=require(_0xd1ed('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd1ed('0xf'));var Papa=require(_0xd1ed('0x10'));var Redis=require(_0xd1ed('0x11'));var authService=require(_0xd1ed('0x12'));var qs=require(_0xd1ed('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1ed('0x14'))('api');var utils=require(_0xd1ed('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd1ed('0x16'));var db=require(_0xd1ed('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x830708,_0x1fcb38){_0x1fcb38=_0x1fcb38||0xcc;return function(_0x4bac1e){if(_0x4bac1e){return _0x830708[_0xd1ed('0x18')](_0x1fcb38);}return _0x830708[_0xd1ed('0x19')](_0x1fcb38)[_0xd1ed('0x1a')]();};}function respondWithResult(_0x58101c,_0x3303c7){_0x3303c7=_0x3303c7||0xc8;return function(_0x4e01c9){if(_0x4e01c9){return _0x58101c[_0xd1ed('0x19')](_0x3303c7)[_0xd1ed('0x1b')](_0x4e01c9);}};}function respondWithFilteredResult(_0x474ba4,_0x58f0b1){return function(_0x2464f5){if(_0x2464f5){var _0x229bd2=typeof _0x58f0b1['offset']===_0xd1ed('0x1c')&&typeof _0x58f0b1[_0xd1ed('0x1d')]==='undefined';var _0x552bd2=_0x2464f5[_0xd1ed('0x1e')];var _0x3bbd71=_0x229bd2?0x0:_0x58f0b1[_0xd1ed('0x1f')];var _0x358fa8=_0x229bd2?_0x2464f5['count']:_0x58f0b1[_0xd1ed('0x1f')]+_0x58f0b1[_0xd1ed('0x1d')];var _0x43254a;if(_0x358fa8>=_0x552bd2){_0x358fa8=_0x552bd2;_0x43254a=0xc8;}else{_0x43254a=0xce;}_0x474ba4[_0xd1ed('0x19')](_0x43254a);return _0x474ba4[_0xd1ed('0x20')]('Content-Range',_0x3bbd71+'-'+_0x358fa8+'/'+_0x552bd2)['json'](_0x2464f5);}return null;};}function patchUpdates(_0x643fed){return function(_0x3c7087){try{jsonpatch[_0xd1ed('0x21')](_0x3c7087,_0x643fed,!![]);}catch(_0x4bc212){return BPromise[_0xd1ed('0x22')](_0x4bc212);}return _0x3c7087[_0xd1ed('0x23')]();};}function saveUpdates(_0x12e3ea,_0x27161e){return function(_0x5e664f){if(_0x5e664f){return _0x5e664f[_0xd1ed('0x24')](_0x12e3ea)[_0xd1ed('0x25')](function(_0x8981d2){return _0x8981d2;});}return null;};}function removeEntity(_0x5d2f3e,_0xc246d4){return function(_0xaeb3c7){if(_0xaeb3c7){return _0xaeb3c7[_0xd1ed('0x26')]()[_0xd1ed('0x25')](function(){_0x5d2f3e[_0xd1ed('0x19')](0xcc)[_0xd1ed('0x1a')]();});}};}function handleEntityNotFound(_0x249d34,_0x1472a8){return function(_0x5ae661){if(!_0x5ae661){_0x249d34[_0xd1ed('0x18')](0x194);}return _0x5ae661;};}function handleError(_0x3b9c18,_0x4797cc){_0x4797cc=_0x4797cc||0x1f4;return function(_0xc51b97){logger[_0xd1ed('0x27')](_0xc51b97[_0xd1ed('0x28')]);if(_0xc51b97[_0xd1ed('0x29')]){delete _0xc51b97[_0xd1ed('0x29')];}_0x3b9c18['status'](_0x4797cc)[_0xd1ed('0x2a')](_0xc51b97);};}exports[_0xd1ed('0x2b')]=function(_0x5d7574,_0x4e0df4){var _0x2d701f={},_0x2f6dc1={},_0x4e7b75={'count':0x0,'rows':[]};var _0x429f8f=_[_0xd1ed('0x2c')](db[_0xd1ed('0x2d')][_0xd1ed('0x2e')],function(_0x34835f){return{'name':_0x34835f[_0xd1ed('0x2f')],'type':_0x34835f[_0xd1ed('0x30')][_0xd1ed('0x31')]};});_0x2f6dc1[_0xd1ed('0x32')]=_['map'](_0x429f8f,_0xd1ed('0x29'));_0x2f6dc1[_0xd1ed('0x33')]=_[_0xd1ed('0x34')](_0x5d7574[_0xd1ed('0x33')]);_0x2f6dc1['filters']=_[_0xd1ed('0x35')](_0x2f6dc1['model'],_0x2f6dc1[_0xd1ed('0x33')]);_0x2d701f[_0xd1ed('0x36')]=_['intersection'](_0x2f6dc1[_0xd1ed('0x32')],qs['fields'](_0x5d7574[_0xd1ed('0x33')][_0xd1ed('0x37')]));_0x2d701f['attributes']=_0x2d701f[_0xd1ed('0x36')][_0xd1ed('0x38')]?_0x2d701f[_0xd1ed('0x36')]:_0x2f6dc1[_0xd1ed('0x32')];if(!_0x5d7574['query'][_0xd1ed('0x39')](_0xd1ed('0x3a'))){_0x2d701f[_0xd1ed('0x1d')]=qs[_0xd1ed('0x1d')](_0x5d7574['query'][_0xd1ed('0x1d')]);_0x2d701f['offset']=qs['offset'](_0x5d7574[_0xd1ed('0x33')][_0xd1ed('0x1f')]);}_0x2d701f[_0xd1ed('0x3b')]=qs[_0xd1ed('0x3c')](_0x5d7574[_0xd1ed('0x33')][_0xd1ed('0x3c')]);_0x2d701f['where']=qs['filters'](_['pick'](_0x5d7574['query'],_0x2f6dc1[_0xd1ed('0x3d')]),_0x429f8f);if(_0x5d7574[_0xd1ed('0x33')]['filter']){_0x2d701f[_0xd1ed('0x3e')]=_['merge'](_0x2d701f[_0xd1ed('0x3e')],{'$or':_[_0xd1ed('0x2c')](_0x429f8f,function(_0x3aec31){if(_0x3aec31[_0xd1ed('0x30')]!==_0xd1ed('0x3f')){var _0x18fe95={};_0x18fe95[_0x3aec31['name']]={'$like':'%'+_0x5d7574[_0xd1ed('0x33')][_0xd1ed('0x40')]+'%'};return _0x18fe95;}})});}_0x2d701f=_['merge']({},_0x2d701f,_0x5d7574['options']);var _0x54c9bb={'where':_0x2d701f[_0xd1ed('0x3e')]};return db[_0xd1ed('0x2d')]['count'](_0x54c9bb)['then'](function(_0x7b92af){_0x4e7b75['count']=_0x7b92af;if(_0x5d7574[_0xd1ed('0x33')][_0xd1ed('0x41')]){_0x2d701f[_0xd1ed('0x42')]=[{'all':!![]}];}return db[_0xd1ed('0x2d')][_0xd1ed('0x43')](_0x2d701f);})[_0xd1ed('0x25')](function(_0x5d2cd1){_0x4e7b75[_0xd1ed('0x44')]=_0x5d2cd1;return _0x4e7b75;})['then'](respondWithFilteredResult(_0x4e0df4,_0x2d701f))['catch'](handleError(_0x4e0df4,null));};exports[_0xd1ed('0x45')]=function(_0x7c959d,_0x3c4cf2){var _0xb3e263={'raw':![],'where':{'id':_0x7c959d['params']['id']}},_0x1aeabd={};_0x1aeabd[_0xd1ed('0x32')]=_['keys'](db[_0xd1ed('0x2d')][_0xd1ed('0x2e')]);_0x1aeabd[_0xd1ed('0x33')]=_[_0xd1ed('0x34')](_0x7c959d[_0xd1ed('0x33')]);_0x1aeabd[_0xd1ed('0x3d')]=_[_0xd1ed('0x35')](_0x1aeabd[_0xd1ed('0x32')],_0x1aeabd[_0xd1ed('0x33')]);_0xb3e263['attributes']=_[_0xd1ed('0x35')](_0x1aeabd[_0xd1ed('0x32')],qs[_0xd1ed('0x37')](_0x7c959d[_0xd1ed('0x33')][_0xd1ed('0x37')]));_0xb3e263[_0xd1ed('0x36')]=_0xb3e263[_0xd1ed('0x36')][_0xd1ed('0x38')]?_0xb3e263[_0xd1ed('0x36')]:_0x1aeabd['model'];if(_0x7c959d[_0xd1ed('0x33')][_0xd1ed('0x41')]){_0xb3e263[_0xd1ed('0x42')]=[{'all':!![]}];}_0xb3e263=_['merge']({},_0xb3e263,_0x7c959d[_0xd1ed('0x46')]);return db['SugarcrmAccount']['find'](_0xb3e263)[_0xd1ed('0x25')](handleEntityNotFound(_0x3c4cf2,null))[_0xd1ed('0x25')](respondWithResult(_0x3c4cf2,null))['catch'](handleError(_0x3c4cf2,null));};exports[_0xd1ed('0x47')]=function(_0x479076,_0x1ff97d){return db['SugarcrmAccount']['create'](_0x479076[_0xd1ed('0x48')],{})[_0xd1ed('0x25')](respondWithResult(_0x1ff97d,0xc9))[_0xd1ed('0x49')](handleError(_0x1ff97d,null));};exports[_0xd1ed('0x24')]=function(_0xfdbc58,_0x53727a){if(_0xfdbc58[_0xd1ed('0x48')]['id']){delete _0xfdbc58[_0xd1ed('0x48')]['id'];}return db[_0xd1ed('0x2d')][_0xd1ed('0x4a')]({'where':{'id':_0xfdbc58['params']['id']}})['then'](handleEntityNotFound(_0x53727a,null))['then'](saveUpdates(_0xfdbc58[_0xd1ed('0x48')],null))[_0xd1ed('0x25')](respondWithResult(_0x53727a,null))[_0xd1ed('0x49')](handleError(_0x53727a,null));};exports[_0xd1ed('0x26')]=function(_0x4378b8,_0x279145){return db[_0xd1ed('0x2d')][_0xd1ed('0x4a')]({'where':{'id':_0x4378b8['params']['id']}})[_0xd1ed('0x25')](handleEntityNotFound(_0x279145,null))[_0xd1ed('0x25')](removeEntity(_0x279145,null))[_0xd1ed('0x49')](handleError(_0x279145,null));};exports[_0xd1ed('0x4b')]=function(_0x4579be,_0x4be686,_0x357b24){var _0x2e4e31={};var _0x30b984={};var _0xf8691a;var _0x4bacca;return db[_0xd1ed('0x2d')][_0xd1ed('0x4c')]({'where':{'id':_0x4579be[_0xd1ed('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4be686,null))[_0xd1ed('0x25')](function(_0x292ea3){if(_0x292ea3){_0xf8691a=_0x292ea3;_0x30b984[_0xd1ed('0x32')]=_[_0xd1ed('0x34')](db[_0xd1ed('0x4e')]['rawAttributes']);_0x30b984[_0xd1ed('0x33')]=_[_0xd1ed('0x34')](_0x4579be[_0xd1ed('0x33')]);_0x30b984[_0xd1ed('0x3d')]=_[_0xd1ed('0x35')](_0x30b984[_0xd1ed('0x32')],_0x30b984[_0xd1ed('0x33')]);_0x2e4e31['attributes']=_['intersection'](_0x30b984['model'],qs[_0xd1ed('0x37')](_0x4579be[_0xd1ed('0x33')][_0xd1ed('0x37')]));_0x2e4e31[_0xd1ed('0x36')]=_0x2e4e31['attributes'][_0xd1ed('0x38')]?_0x2e4e31[_0xd1ed('0x36')]:_0x30b984[_0xd1ed('0x32')];_0x2e4e31[_0xd1ed('0x3b')]=qs['sort'](_0x4579be[_0xd1ed('0x33')][_0xd1ed('0x3c')]);_0x2e4e31[_0xd1ed('0x3e')]=qs[_0xd1ed('0x3d')](_[_0xd1ed('0x4f')](_0x4579be['query'],_0x30b984['filters']));if(_0x4579be[_0xd1ed('0x33')]['filter']){_0x2e4e31[_0xd1ed('0x3e')]=_[_0xd1ed('0x50')](_0x2e4e31['where'],{'$or':_[_0xd1ed('0x2c')](_0x2e4e31[_0xd1ed('0x36')],function(_0x10500b){var _0x33b209={};_0x33b209[_0x10500b]={'$like':'%'+_0x4579be[_0xd1ed('0x33')]['filter']+'%'};return _0x33b209;})});}_0x2e4e31=_[_0xd1ed('0x50')]({},_0x2e4e31,_0x4579be[_0xd1ed('0x46')]);return _0xf8691a[_0xd1ed('0x4b')](_0x2e4e31);}})[_0xd1ed('0x25')](function(_0x3ee942){if(_0x3ee942){_0x4bacca=_0x3ee942[_0xd1ed('0x38')];if(!_0x4579be[_0xd1ed('0x33')][_0xd1ed('0x39')]('nolimit')){_0x2e4e31[_0xd1ed('0x1d')]=qs['limit'](_0x4579be[_0xd1ed('0x33')][_0xd1ed('0x1d')]);_0x2e4e31[_0xd1ed('0x1f')]=qs['offset'](_0x4579be[_0xd1ed('0x33')][_0xd1ed('0x1f')]);}return _0xf8691a['getConfigurations'](_0x2e4e31);}})[_0xd1ed('0x25')](function(_0xacbd7e){if(_0xacbd7e){return _0xacbd7e?{'count':_0x4bacca,'rows':_0xacbd7e}:null;}})['then'](respondWithResult(_0x4be686,null))['catch'](handleError(_0x4be686,null));};exports[_0xd1ed('0x51')]=function(_0x4687d9,_0x3a4e5,_0x455e64){if(_0x4687d9[_0xd1ed('0x48')]['id']){delete _0x4687d9[_0xd1ed('0x48')]['id'];}return db['SugarcrmAccount'][_0xd1ed('0x4c')]({'where':{'id':_0x4687d9[_0xd1ed('0x4d')]['id']}})[_0xd1ed('0x25')](handleEntityNotFound(_0x3a4e5,null))['then'](function(_0xcf486c){if(_0xcf486c){_0x4687d9['body']['AccountId']=_0xcf486c['id'];_0x4687d9[_0xd1ed('0x48')][_0xd1ed('0x52')]=integrations[_0xd1ed('0x53')](_0x4687d9[_0xd1ed('0x48')]['channel'],_0x4687d9[_0xd1ed('0x48')][_0xd1ed('0x30')]);_0x4687d9[_0xd1ed('0x48')][_0xd1ed('0x54')]=integrations['getDescriptions'](_0x4687d9[_0xd1ed('0x48')]['channel'],_0x4687d9[_0xd1ed('0x48')][_0xd1ed('0x30')]);return db[_0xd1ed('0x4e')][_0xd1ed('0x47')](_0x4687d9[_0xd1ed('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0xd1ed('0x52')},{'model':db[_0xd1ed('0x55')],'as':_0xd1ed('0x54')}]});}return null;})['then'](respondWithResult(_0x3a4e5,null))['catch'](handleError(_0x3a4e5,null));};exports[_0xd1ed('0x56')]=function(_0x32a24a,_0x54eaaf,_0x2ec1f8){var _0x7ce5e7='';var _0x5e72c4=['id','name',_0xd1ed('0x57'),'created_by',_0xd1ed('0x58'),_0xd1ed('0x59'),_0xd1ed('0x5a'),_0xd1ed('0x5b'),_0xd1ed('0x5c'),'parent_type',_0xd1ed('0x5d'),_0xd1ed('0x5e')];return db[_0xd1ed('0x2d')][_0xd1ed('0x4c')]({'where':{'id':_0x32a24a[_0xd1ed('0x4d')]['id']},'attributes':['id',_0xd1ed('0x5f'),_0xd1ed('0x60'),_0xd1ed('0x61')]})['then'](handleEntityNotFound(_0x54eaaf,null))[_0xd1ed('0x25')](function(_0x56577c){if(_0x56577c){_0x7ce5e7=_0x56577c[_0xd1ed('0x61')];var _0x278528=_0x7ce5e7[_0xd1ed('0x62')](-0x1);if(_0x278528==='/'){_0x7ce5e7=_0x7ce5e7[_0xd1ed('0x63')](0x0,_0x7ce5e7[_0xd1ed('0x64')](_0x278528));}return rp({'method':'POST','uri':util[_0xd1ed('0x65')](_0xd1ed('0x66'),_0x7ce5e7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd1ed('0x67'),'input_type':'JSON','response_type':_0xd1ed('0x68'),'rest_data':JSON[_0xd1ed('0x69')]({'user_auth':{'user_name':_0x56577c['username'],'password':_0x56577c[_0xd1ed('0x60')],'encryption':_0xd1ed('0x6a')},'application':_0xd1ed('0x6b')})}});}})['then'](function(_0x25dc87){if(_0x25dc87&&_0x25dc87['name']!=='Invalid\x20Login'&&_0x25dc87[_0xd1ed('0x29')]!=='Password\x20Expired'){return rp({'method':_0xd1ed('0x6c'),'uri':util[_0xd1ed('0x65')](_0xd1ed('0x66'),_0x7ce5e7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd1ed('0x6d'),'input_type':_0xd1ed('0x68'),'response_type':_0xd1ed('0x68'),'rest_data':JSON[_0xd1ed('0x69')]({'session':_0x25dc87['id'],'module_name':_0xd1ed('0x6e')})}})[_0xd1ed('0x25')](function(_0x241a2d){if(_0x241a2d){var _0x1e01e6=_[_0xd1ed('0x6f')](_0x241a2d[_0xd1ed('0x70')]);_[_0xd1ed('0x71')](_0x1e01e6,function(_0x3a100d){return _0x5e72c4[_0xd1ed('0x72')](_0x3a100d[_0xd1ed('0x29')]);});return{'count':_0x1e01e6[_0xd1ed('0x38')],'rows':_[_0xd1ed('0x2c')](_0x1e01e6,function(_0x180d31){return{'id':_0x180d31['name'],'name':_0x180d31[_0xd1ed('0x73')],'custom':_[_0xd1ed('0x74')](_0x180d31[_0xd1ed('0x29')],'_c')?!![]:![],'options':_0x180d31[_0xd1ed('0x46')]?_[_0xd1ed('0x2c')](_['values'](_0x180d31[_0xd1ed('0x46')]),function(_0x2ba7f5){return{'name':_0x2ba7f5[_0xd1ed('0x75')],'value':_0x2ba7f5[_0xd1ed('0x29')]};}):[]};})};}})[_0xd1ed('0x25')](respondWithResult(_0x54eaaf,null))[_0xd1ed('0x49')](function(_0x122eaf){var _0x325232=_0x32a24a[_0xd1ed('0x33')][_0xd1ed('0x76')]?0x1f4:_0x122eaf[_0xd1ed('0x77')]||0x1f4;logger[_0xd1ed('0x27')](_0xd1ed('0x78'),_0xd1ed('0x56'),_0x325232,JSON[_0xd1ed('0x69')](_0x122eaf));delete _0x122eaf[_0xd1ed('0x29')];if(_0x325232===0x191){_0x325232=0x190;}_0x54eaaf['status'](_0x325232)[_0xd1ed('0x2a')](_0x32a24a[_0xd1ed('0x33')][_0xd1ed('0x76')]?{'message':_0xd1ed('0x79'),'statusCode':_0x122eaf[_0xd1ed('0x77')]}:_0x122eaf);});}else{var _0x2bedd1=0x1f4;_0x54eaaf[_0xd1ed('0x19')](_0x2bedd1)[_0xd1ed('0x2a')]({'message':_0xd1ed('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4e2c=['SugarcrmAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','catch','show','keys','merge','find','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x4fb233,_0x55f824){var _0x1eaf6f=function(_0x3daea7){while(--_0x3daea7){_0x4fb233['push'](_0x4fb233['shift']());}};_0x1eaf6f(++_0x55f824);}(_0x4e2c,0x143));var _0xc4e2=function(_0x99dcd5,_0x4cbff5){_0x99dcd5=_0x99dcd5-0x0;var _0x96bac8=_0x4e2c[_0x99dcd5];return _0x96bac8;};'use strict';var emlformat=require(_0xc4e2('0x0'));var rimraf=require(_0xc4e2('0x1'));var zipdir=require(_0xc4e2('0x2'));var jsonpatch=require(_0xc4e2('0x3'));var rp=require('request-promise');var moment=require(_0xc4e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4e2('0x5'));var util=require(_0xc4e2('0x6'));var path=require('path');var sox=require(_0xc4e2('0x7'));var csv=require(_0xc4e2('0x8'));var ejs=require(_0xc4e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4e2('0xa'));var squel=require(_0xc4e2('0xb'));var crypto=require(_0xc4e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4e2('0xe'));var Papa=require(_0xc4e2('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e2('0x11'));var hardwareService=require(_0xc4e2('0x12'));var logger=require(_0xc4e2('0x13'))(_0xc4e2('0x14'));var utils=require(_0xc4e2('0x15'));var config=require(_0xc4e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4e2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42e7fa,_0x361c1c){_0x361c1c=_0x361c1c||0xcc;return function(_0x7e07c5){if(_0x7e07c5){return _0x42e7fa[_0xc4e2('0x18')](_0x361c1c);}return _0x42e7fa[_0xc4e2('0x19')](_0x361c1c)[_0xc4e2('0x1a')]();};}function respondWithResult(_0x5d42e0,_0xb18798){_0xb18798=_0xb18798||0xc8;return function(_0x39a791){if(_0x39a791){return _0x5d42e0['status'](_0xb18798)[_0xc4e2('0x1b')](_0x39a791);}};}function respondWithFilteredResult(_0x2403b3,_0x3ec9f3){return function(_0x5380b3){if(_0x5380b3){var _0xa26b65=typeof _0x3ec9f3[_0xc4e2('0x1c')]===_0xc4e2('0x1d')&&typeof _0x3ec9f3[_0xc4e2('0x1e')]===_0xc4e2('0x1d');var _0x199478=_0x5380b3['count'];var _0x420f28=_0xa26b65?0x0:_0x3ec9f3[_0xc4e2('0x1c')];var _0x3da520=_0xa26b65?_0x5380b3[_0xc4e2('0x1f')]:_0x3ec9f3[_0xc4e2('0x1c')]+_0x3ec9f3[_0xc4e2('0x1e')];var _0x5b257a;if(_0x3da520>=_0x199478){_0x3da520=_0x199478;_0x5b257a=0xc8;}else{_0x5b257a=0xce;}_0x2403b3[_0xc4e2('0x19')](_0x5b257a);return _0x2403b3['set']('Content-Range',_0x420f28+'-'+_0x3da520+'/'+_0x199478)[_0xc4e2('0x1b')](_0x5380b3);}return null;};}function patchUpdates(_0x5caaa3){return function(_0x1856b0){try{jsonpatch[_0xc4e2('0x20')](_0x1856b0,_0x5caaa3,!![]);}catch(_0x5d9fdf){return BPromise[_0xc4e2('0x21')](_0x5d9fdf);}return _0x1856b0[_0xc4e2('0x22')]();};}function saveUpdates(_0x3f18f6,_0x296449){return function(_0x17cb71){if(_0x17cb71){return _0x17cb71[_0xc4e2('0x23')](_0x3f18f6)[_0xc4e2('0x24')](function(_0x1ccd20){return _0x1ccd20;});}return null;};}function removeEntity(_0xa181ea,_0x37c1f4){return function(_0x5e057d){if(_0x5e057d){return _0x5e057d['destroy']()[_0xc4e2('0x24')](function(){_0xa181ea[_0xc4e2('0x19')](0xcc)[_0xc4e2('0x1a')]();});}};}function handleEntityNotFound(_0x6727f3,_0x107a5e){return function(_0x133749){if(!_0x133749){_0x6727f3[_0xc4e2('0x18')](0x194);}return _0x133749;};}function handleError(_0xd59df1,_0x3c6d40){_0x3c6d40=_0x3c6d40||0x1f4;return function(_0x2f5b55){logger[_0xc4e2('0x25')](_0x2f5b55[_0xc4e2('0x26')]);if(_0x2f5b55[_0xc4e2('0x27')]){delete _0x2f5b55[_0xc4e2('0x27')];}_0xd59df1[_0xc4e2('0x19')](_0x3c6d40)[_0xc4e2('0x28')](_0x2f5b55);};}exports[_0xc4e2('0x29')]=function(_0x24d5f3,_0x5f24a9){var _0x57e403={},_0x2a9b2a={},_0x4c788c={'count':0x0,'rows':[]};var _0x2eada5=_[_0xc4e2('0x2a')](db[_0xc4e2('0x2b')][_0xc4e2('0x2c')],function(_0x17b881){return{'name':_0x17b881[_0xc4e2('0x2d')],'type':_0x17b881[_0xc4e2('0x2e')]['key']};});_0x2a9b2a[_0xc4e2('0x2f')]=_[_0xc4e2('0x2a')](_0x2eada5,_0xc4e2('0x27'));_0x2a9b2a[_0xc4e2('0x30')]=_['keys'](_0x24d5f3['query']);_0x2a9b2a['filters']=_['intersection'](_0x2a9b2a[_0xc4e2('0x2f')],_0x2a9b2a[_0xc4e2('0x30')]);_0x57e403[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x2a9b2a[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x57e403[_0xc4e2('0x31')]=_0x57e403[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x57e403['attributes']:_0x2a9b2a['model'];if(!_0x24d5f3[_0xc4e2('0x30')]['hasOwnProperty'](_0xc4e2('0x35'))){_0x57e403[_0xc4e2('0x1e')]=qs[_0xc4e2('0x1e')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x57e403[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1c')]);}_0x57e403[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x24d5f3[_0xc4e2('0x30')]['sort']);_0x57e403[_0xc4e2('0x38')]=qs['filters'](_[_0xc4e2('0x39')](_0x24d5f3['query'],_0x2a9b2a[_0xc4e2('0x3a')]),_0x2eada5);if(_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x57e403['where']=_['merge'](_0x57e403[_0xc4e2('0x38')],{'$or':_[_0xc4e2('0x2a')](_0x2eada5,function(_0x70138b){if(_0x70138b['type']!=='VIRTUAL'){var _0x339745={};_0x339745[_0x70138b[_0xc4e2('0x27')]]={'$like':'%'+_0x24d5f3[_0xc4e2('0x30')]['filter']+'%'};return _0x339745;}})});}_0x57e403=_['merge']({},_0x57e403,_0x24d5f3[_0xc4e2('0x3c')]);var _0x18692f={'where':_0x57e403['where']};return db[_0xc4e2('0x2b')][_0xc4e2('0x1f')](_0x18692f)[_0xc4e2('0x24')](function(_0x3b6bb5){_0x4c788c['count']=_0x3b6bb5;if(_0x24d5f3['query'][_0xc4e2('0x3d')]){_0x57e403[_0xc4e2('0x3e')]=[{'all':!![]}];}return db[_0xc4e2('0x2b')][_0xc4e2('0x3f')](_0x57e403);})[_0xc4e2('0x24')](function(_0x4ec83f){_0x4c788c['rows']=_0x4ec83f;return _0x4c788c;})[_0xc4e2('0x24')](respondWithFilteredResult(_0x5f24a9,_0x57e403))[_0xc4e2('0x40')](handleError(_0x5f24a9,null));};exports[_0xc4e2('0x41')]=function(_0x5491a4,_0x4dc0cb){var _0x49c473={'raw':![],'where':{'id':_0x5491a4['params']['id']}},_0x543f65={};_0x543f65[_0xc4e2('0x2f')]=_['keys'](db[_0xc4e2('0x2b')]['rawAttributes']);_0x543f65['query']=_[_0xc4e2('0x42')](_0x5491a4['query']);_0x543f65[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x543f65[_0xc4e2('0x2f')],_0x543f65[_0xc4e2('0x30')]);_0x49c473['attributes']=_[_0xc4e2('0x32')](_0x543f65['model'],qs['fields'](_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x49c473[_0xc4e2('0x31')]=_0x49c473[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x49c473[_0xc4e2('0x31')]:_0x543f65['model'];if(_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x3d')]){_0x49c473[_0xc4e2('0x3e')]=[{'all':!![]}];}_0x49c473=_[_0xc4e2('0x43')]({},_0x49c473,_0x5491a4[_0xc4e2('0x3c')]);return db[_0xc4e2('0x2b')][_0xc4e2('0x44')](_0x49c473)['then'](handleEntityNotFound(_0x4dc0cb,null))[_0xc4e2('0x24')](respondWithResult(_0x4dc0cb,null))[_0xc4e2('0x40')](handleError(_0x4dc0cb,null));};exports[_0xc4e2('0x45')]=function(_0x483933,_0x140a2f){return db[_0xc4e2('0x2b')]['create'](_0x483933[_0xc4e2('0x46')],{})['then'](respondWithResult(_0x140a2f,0xc9))['catch'](handleError(_0x140a2f,null));};exports[_0xc4e2('0x23')]=function(_0x50ec22,_0xf9b83a){if(_0x50ec22[_0xc4e2('0x46')]['id']){delete _0x50ec22['body']['id'];}return db[_0xc4e2('0x2b')][_0xc4e2('0x44')]({'where':{'id':_0x50ec22[_0xc4e2('0x47')]['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0xf9b83a,null))[_0xc4e2('0x24')](saveUpdates(_0x50ec22['body'],null))[_0xc4e2('0x24')](respondWithResult(_0xf9b83a,null))['catch'](handleError(_0xf9b83a,null));};exports[_0xc4e2('0x48')]=function(_0x42975e,_0x1a9e65){return db['SugarcrmAccount']['find']({'where':{'id':_0x42975e[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9e65,null))[_0xc4e2('0x24')](removeEntity(_0x1a9e65,null))['catch'](handleError(_0x1a9e65,null));};exports[_0xc4e2('0x49')]=function(_0x4c0a0c,_0x335042,_0x469533){var _0x22e4cc={};var _0x3c80b2={};var _0x56ab58;var _0x247881;return db[_0xc4e2('0x2b')]['findOne']({'where':{'id':_0x4c0a0c[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x335042,null))[_0xc4e2('0x24')](function(_0x54a517){if(_0x54a517){_0x56ab58=_0x54a517;_0x3c80b2['model']=_['keys'](db[_0xc4e2('0x4a')][_0xc4e2('0x2c')]);_0x3c80b2['query']=_[_0xc4e2('0x42')](_0x4c0a0c[_0xc4e2('0x30')]);_0x3c80b2[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],_0x3c80b2[_0xc4e2('0x30')]);_0x22e4cc[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x4c0a0c['query']['fields']));_0x22e4cc[_0xc4e2('0x31')]=_0x22e4cc[_0xc4e2('0x31')]['length']?_0x22e4cc[_0xc4e2('0x31')]:_0x3c80b2[_0xc4e2('0x2f')];_0x22e4cc[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x4c0a0c['query'][_0xc4e2('0x37')]);_0x22e4cc[_0xc4e2('0x38')]=qs['filters'](_['pick'](_0x4c0a0c[_0xc4e2('0x30')],_0x3c80b2[_0xc4e2('0x3a')]));if(_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x22e4cc['where']=_[_0xc4e2('0x43')](_0x22e4cc[_0xc4e2('0x38')],{'$or':_['map'](_0x22e4cc[_0xc4e2('0x31')],function(_0xe2b534){var _0x2858fd={};_0x2858fd[_0xe2b534]={'$like':'%'+_0x4c0a0c['query'][_0xc4e2('0x3b')]+'%'};return _0x2858fd;})});}_0x22e4cc=_[_0xc4e2('0x43')]({},_0x22e4cc,_0x4c0a0c[_0xc4e2('0x3c')]);return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})['then'](function(_0x10a4c0){if(_0x10a4c0){_0x247881=_0x10a4c0[_0xc4e2('0x34')];if(!_0x4c0a0c['query'][_0xc4e2('0x4b')](_0xc4e2('0x35'))){_0x22e4cc[_0xc4e2('0x1e')]=qs['limit'](_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x22e4cc[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x4c0a0c[_0xc4e2('0x30')]['offset']);}return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})[_0xc4e2('0x24')](function(_0x16252e){if(_0x16252e){return _0x16252e?{'count':_0x247881,'rows':_0x16252e}:null;}})['then'](respondWithResult(_0x335042,null))['catch'](handleError(_0x335042,null));};exports[_0xc4e2('0x4c')]=function(_0xef3598,_0x3e0f78,_0x32d9b2){if(_0xef3598[_0xc4e2('0x46')]['id']){delete _0xef3598[_0xc4e2('0x46')]['id'];}return db['SugarcrmAccount'][_0xc4e2('0x4d')]({'where':{'id':_0xef3598['params']['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0x3e0f78,null))[_0xc4e2('0x24')](function(_0x578ee9){if(_0x578ee9){_0xef3598['body'][_0xc4e2('0x4e')]=_0x578ee9['id'];_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x4f')]=integrations[_0xc4e2('0x50')](_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x51')],_0xef3598['body'][_0xc4e2('0x2e')]);_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x52')]=integrations[_0xc4e2('0x53')](_0xef3598['body']['channel'],_0xef3598[_0xc4e2('0x46')]['type']);return db['SugarcrmConfiguration'][_0xc4e2('0x45')](_0xef3598['body'],{'include':[{'model':db[_0xc4e2('0x54')],'as':_0xc4e2('0x4f')},{'model':db[_0xc4e2('0x54')],'as':'Descriptions'}]});}return null;})[_0xc4e2('0x24')](respondWithResult(_0x3e0f78,null))[_0xc4e2('0x40')](handleError(_0x3e0f78,null));};exports['getFields']=function(_0x3d59f4,_0x5b6e16,_0x4c7206){var _0x58f0ba='';var _0x5366fd=['id','name',_0xc4e2('0x55'),_0xc4e2('0x56'),'description',_0xc4e2('0x57'),_0xc4e2('0x58'),_0xc4e2('0x59'),_0xc4e2('0x5a'),'parent_type',_0xc4e2('0x5b'),'direction'];return db[_0xc4e2('0x2b')][_0xc4e2('0x4d')]({'where':{'id':_0x3d59f4[_0xc4e2('0x47')]['id']},'attributes':['id',_0xc4e2('0x5c'),_0xc4e2('0x5d'),'remoteUri']})[_0xc4e2('0x24')](handleEntityNotFound(_0x5b6e16,null))[_0xc4e2('0x24')](function(_0xbb6638){if(_0xbb6638){_0x58f0ba=_0xbb6638[_0xc4e2('0x5e')];var _0xa1dc4b=_0x58f0ba[_0xc4e2('0x5f')](-0x1);if(_0xa1dc4b==='/'){_0x58f0ba=_0x58f0ba[_0xc4e2('0x60')](0x0,_0x58f0ba[_0xc4e2('0x61')](_0xa1dc4b));}return rp({'method':_0xc4e2('0x62'),'uri':util['format'](_0xc4e2('0x63'),_0x58f0ba,_0xc4e2('0x64')),'json':!![],'form':{'method':_0xc4e2('0x65'),'input_type':_0xc4e2('0x66'),'response_type':_0xc4e2('0x66'),'rest_data':JSON[_0xc4e2('0x67')]({'user_auth':{'user_name':_0xbb6638['username'],'password':_0xbb6638['password'],'encryption':_0xc4e2('0x68')},'application':_0xc4e2('0x69')})}});}})[_0xc4e2('0x24')](function(_0x307800){if(_0x307800&&_0x307800[_0xc4e2('0x27')]!==_0xc4e2('0x6a')&&_0x307800['name']!==_0xc4e2('0x6b')){return rp({'method':_0xc4e2('0x62'),'uri':util[_0xc4e2('0x6c')](_0xc4e2('0x63'),_0x58f0ba,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xc4e2('0x6d'),'input_type':_0xc4e2('0x66'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x307800['id'],'module_name':_0xc4e2('0x6e')})}})['then'](function(_0xb3ee62){if(_0xb3ee62){var _0x30a684=_[_0xc4e2('0x6f')](_0xb3ee62['module_fields']);_[_0xc4e2('0x70')](_0x30a684,function(_0x91924d){return _0x5366fd[_0xc4e2('0x71')](_0x91924d[_0xc4e2('0x27')]);});return{'count':_0x30a684[_0xc4e2('0x34')],'rows':_[_0xc4e2('0x2a')](_0x30a684,function(_0xa2c816){return{'id':_0xa2c816['name'],'name':_0xa2c816[_0xc4e2('0x72')],'custom':_[_0xc4e2('0x73')](_0xa2c816[_0xc4e2('0x27')],'_c')?!![]:![],'options':_0xa2c816[_0xc4e2('0x3c')]?_[_0xc4e2('0x2a')](_[_0xc4e2('0x6f')](_0xa2c816[_0xc4e2('0x3c')]),function(_0x363409){return{'name':_0x363409[_0xc4e2('0x74')],'value':_0x363409['name']};}):[]};})};}})[_0xc4e2('0x24')](respondWithResult(_0x5b6e16,null))[_0xc4e2('0x40')](function(_0x3011c2){var _0x5a7601=_0x3d59f4[_0xc4e2('0x30')]['test']?0x1f4:_0x3011c2[_0xc4e2('0x75')]||0x1f4;logger[_0xc4e2('0x25')](_0xc4e2('0x76'),_0xc4e2('0x77'),_0x5a7601,JSON[_0xc4e2('0x67')](_0x3011c2));delete _0x3011c2['name'];if(_0x5a7601===0x191){_0x5a7601=0x190;}_0x5b6e16[_0xc4e2('0x19')](_0x5a7601)[_0xc4e2('0x28')](_0x3d59f4[_0xc4e2('0x30')][_0xc4e2('0x78')]?{'message':_0xc4e2('0x79'),'statusCode':_0x3011c2[_0xc4e2('0x75')]}:_0x3011c2);});}else{var _0x21f835=0x1f4;_0x5b6e16[_0xc4e2('0x19')](_0x21f835)[_0xc4e2('0x28')]({'message':_0xc4e2('0x79'),'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 a2a2f37..2784e14 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 _0x9fda=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api','moment','bluebird'];(function(_0x110ce3,_0xd22d55){var _0x17e26e=function(_0x3dda46){while(--_0x3dda46){_0x110ce3['push'](_0x110ce3['shift']());}};_0x17e26e(++_0xd22d55);}(_0x9fda,0x8c));var _0xa9fd=function(_0x6224bc,_0x38960d){_0x6224bc=_0x6224bc-0x0;var _0x5cf36b=_0x9fda[_0x6224bc];return _0x5cf36b;};'use strict';var _=require(_0xa9fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa9fd('0x1'));var moment=require(_0xa9fd('0x2'));var BPromise=require(_0xa9fd('0x3'));var rp=require(_0xa9fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9fd('0x5'));var config=require(_0xa9fd('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xa9fd('0x7'));module[_0xa9fd('0x8')]=function(_0x4eb431,_0x5f2d27){return _0x4eb431[_0xa9fd('0x9')](_0xa9fd('0xa'),attributes,{'tableName':_0xa9fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd739=['api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x2a9ea3,_0xaea21c){var _0x19291b=function(_0x5bba90){while(--_0x5bba90){_0x2a9ea3['push'](_0x2a9ea3['shift']());}};_0x19291b(++_0xaea21c);}(_0xd739,0x135));var _0x9d73=function(_0x1e409d,_0x2ef2ef){_0x1e409d=_0x1e409d-0x0;var _0x43ae04=_0xd739[_0x1e409d];return _0x43ae04;};'use strict';var _=require(_0x9d73('0x0'));var util=require(_0x9d73('0x1'));var logger=require(_0x9d73('0x2'))(_0x9d73('0x3'));var moment=require(_0x9d73('0x4'));var BPromise=require('bluebird');var rp=require(_0x9d73('0x5'));var fs=require('fs');var path=require(_0x9d73('0x6'));var rimraf=require(_0x9d73('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9d73('0x8'));module[_0x9d73('0x9')]=function(_0x54b306,_0x3af8fe){return _0x54b306[_0x9d73('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x9d73('0xb'),'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 f075f27..665781e 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 _0xdf4d=['find','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSugarcrmAccount'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xdf4d,0xce));var _0xddf4=function(_0x315b62,_0x58e83b){_0x315b62=_0x315b62-0x0;var _0x33e3a9=_0xdf4d[_0x315b62];return _0x33e3a9;};'use strict';var _=require(_0xddf4('0x0'));var util=require(_0xddf4('0x1'));var moment=require('moment');var BPromise=require(_0xddf4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddf4('0x3'));var db=require(_0xddf4('0x4'))['db'];var utils=require(_0xddf4('0x5'));var logger=require(_0xddf4('0x6'))('rpc');var config=require(_0xddf4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xddf4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x175ca1,_0x264a89,_0x348eaa){return new BPromise(function(_0x4e36e0,_0x33b378){return client[_0xddf4('0x9')](_0x175ca1,_0x348eaa)[_0xddf4('0xa')](function(_0x45d2e5){logger[_0xddf4('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x264a89,_0xddf4('0xc'));logger['debug'](_0xddf4('0xd'),_0x264a89,_0xddf4('0xc'),JSON[_0xddf4('0xe')](_0x45d2e5));if(_0x45d2e5['error']){if(_0x45d2e5[_0xddf4('0xf')]['code']===0x1f4){logger[_0xddf4('0xf')](_0xddf4('0x10'),_0x264a89,_0x45d2e5[_0xddf4('0xf')][_0xddf4('0x11')]);return _0x33b378(_0x45d2e5[_0xddf4('0xf')][_0xddf4('0x11')]);}logger[_0xddf4('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x264a89,_0x45d2e5[_0xddf4('0xf')]['message']);return _0x4e36e0(_0x45d2e5[_0xddf4('0xf')]['message']);}else{logger[_0xddf4('0xb')](_0xddf4('0x10'),_0x264a89,'request\x20sent');_0x4e36e0(_0x45d2e5[_0xddf4('0x12')][_0xddf4('0x11')]);}})['catch'](function(_0x1240a1){logger[_0xddf4('0xf')](_0xddf4('0x10'),_0x264a89,_0x1240a1);_0x33b378(_0x1240a1);});});}exports[_0xddf4('0x13')]=function(_0x3617c4){var _0x171a51=this;return new Promise(function(_0x9b58b,_0x53ef5f){return db[_0xddf4('0x14')][_0xddf4('0x15')]({'raw':_0x3617c4[_0xddf4('0x16')]?_0x3617c4['options'][_0xddf4('0x17')]===undefined?!![]:![]:!![],'where':_0x3617c4['options']?_0x3617c4[_0xddf4('0x16')][_0xddf4('0x18')]||null:null,'attributes':_0x3617c4[_0xddf4('0x16')]?_0x3617c4['options'][_0xddf4('0x19')]||null:null,'limit':_0x3617c4[_0xddf4('0x16')]?_0x3617c4[_0xddf4('0x16')][_0xddf4('0x1a')]||null:null,'include':_0x3617c4[_0xddf4('0x16')]?_0x3617c4[_0xddf4('0x16')][_0xddf4('0x1b')]?_[_0xddf4('0x1c')](_0x3617c4[_0xddf4('0x16')][_0xddf4('0x1b')],function(_0x39891e){return{'model':db[_0x39891e[_0xddf4('0x1d')]],'as':_0x39891e['as'],'attributes':_0x39891e[_0xddf4('0x19')],'include':_0x39891e[_0xddf4('0x1b')]?_[_0xddf4('0x1c')](_0x39891e[_0xddf4('0x1b')],function(_0x45efee){return{'model':db[_0x45efee['model']],'as':_0x45efee['as'],'attributes':_0x45efee[_0xddf4('0x19')],'include':_0x45efee[_0xddf4('0x1b')]?_['map'](_0x45efee['include'],function(_0x52bd25){return{'model':db[_0x52bd25[_0xddf4('0x1d')]],'as':_0x52bd25['as'],'attributes':_0x52bd25['attributes']};}):[]};}):[]};}):[]:[]})[_0xddf4('0xa')](function(_0x4e55b9){logger[_0xddf4('0xb')](_0xddf4('0x13'),_0x3617c4);logger[_0xddf4('0x1e')](_0xddf4('0x13'),_0x3617c4,JSON['stringify'](_0x4e55b9));_0x9b58b(_0x4e55b9);})['catch'](function(_0x24507c){logger['error'](_0xddf4('0x13'),_0x24507c[_0xddf4('0x11')],_0x3617c4);_0x53ef5f(_0x171a51[_0xddf4('0xf')](0x1f4,_0x24507c[_0xddf4('0x11')]));});});};exports[_0xddf4('0x1f')]=function(_0x41fc5e){var _0x346417=this;return new Promise(function(_0x14d719,_0x5b4914){return db[_0xddf4('0x14')][_0xddf4('0x20')]({'raw':_0x41fc5e[_0xddf4('0x16')]?_0x41fc5e['options']['raw']===undefined?!![]:![]:!![],'where':_0x41fc5e[_0xddf4('0x16')]?_0x41fc5e[_0xddf4('0x16')][_0xddf4('0x18')]||null:null,'attributes':_0x41fc5e[_0xddf4('0x16')]?_0x41fc5e[_0xddf4('0x16')][_0xddf4('0x19')]||null:null,'include':_0x41fc5e['options']?_0x41fc5e[_0xddf4('0x16')]['include']?_[_0xddf4('0x1c')](_0x41fc5e[_0xddf4('0x16')]['include'],function(_0x1ea007){return{'model':db[_0x1ea007[_0xddf4('0x1d')]],'as':_0x1ea007['as'],'attributes':_0x1ea007[_0xddf4('0x19')],'include':_0x1ea007[_0xddf4('0x1b')]?_['map'](_0x1ea007[_0xddf4('0x1b')],function(_0xf23ce6){return{'model':db[_0xf23ce6['model']],'as':_0xf23ce6['as'],'attributes':_0xf23ce6[_0xddf4('0x19')],'include':_0xf23ce6['include']?_[_0xddf4('0x1c')](_0xf23ce6[_0xddf4('0x1b')],function(_0x2c911a){return{'model':db[_0x2c911a[_0xddf4('0x1d')]],'as':_0x2c911a['as'],'attributes':_0x2c911a[_0xddf4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xddf4('0xa')](function(_0x20343a){logger[_0xddf4('0xb')]('ShowSugarcrmAccount',_0x41fc5e);logger['debug'](_0xddf4('0x1f'),_0x41fc5e,JSON[_0xddf4('0xe')](_0x20343a));_0x14d719(_0x20343a);})[_0xddf4('0x21')](function(_0x1726d2){logger[_0xddf4('0xf')](_0xddf4('0x1f'),_0x1726d2[_0xddf4('0x11')],_0x41fc5e);_0x5b4914(_0x346417[_0xddf4('0xf')](0x1f4,_0x1726d2[_0xddf4('0x11')]));});});}; \ No newline at end of file +var _0x5a7e=['ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','SugarcrmAccount,\x20%s,\x20%s','message','result','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','GetSugarcrmAccount','stringify','catch'];(function(_0x28d748,_0x55cd99){var _0x56eae0=function(_0x50f0fd){while(--_0x50f0fd){_0x28d748['push'](_0x28d748['shift']());}};_0x56eae0(++_0x55cd99);}(_0x5a7e,0x18e));var _0xe5a7=function(_0x3c7115,_0x40a6b6){_0x3c7115=_0x3c7115-0x0;var _0x82d3db=_0x5a7e[_0x3c7115];return _0x82d3db;};'use strict';var _=require(_0xe5a7('0x0'));var util=require(_0xe5a7('0x1'));var moment=require(_0xe5a7('0x2'));var BPromise=require(_0xe5a7('0x3'));var rs=require(_0xe5a7('0x4'));var fs=require('fs');var Redis=require(_0xe5a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5a7('0x6'));var logger=require('../../config/logger')(_0xe5a7('0x7'));var config=require(_0xe5a7('0x8'));var jayson=require(_0xe5a7('0x9'));var client=jayson[_0xe5a7('0xa')][_0xe5a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b67,_0x19aaca,_0x27ee6d){return new BPromise(function(_0x3def08,_0x1090c1){return client[_0xe5a7('0xc')](_0x5e8b67,_0x27ee6d)['then'](function(_0x2a8068){logger[_0xe5a7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x19aaca,_0xe5a7('0xe'));logger[_0xe5a7('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x19aaca,_0xe5a7('0xe'),JSON['stringify'](_0x2a8068));if(_0x2a8068['error']){if(_0x2a8068[_0xe5a7('0x10')]['code']===0x1f4){logger['error'](_0xe5a7('0x11'),_0x19aaca,_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);return _0x1090c1(_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);}logger['error'](_0xe5a7('0x11'),_0x19aaca,_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);return _0x3def08(_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);}else{logger[_0xe5a7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x19aaca,'request\x20sent');_0x3def08(_0x2a8068[_0xe5a7('0x13')][_0xe5a7('0x12')]);}})['catch'](function(_0x199147){logger[_0xe5a7('0x10')](_0xe5a7('0x11'),_0x19aaca,_0x199147);_0x1090c1(_0x199147);});});}exports['GetSugarcrmAccount']=function(_0x18da5c){var _0x5ee0e6=this;return new Promise(function(_0x515958,_0x346fdf){return db[_0xe5a7('0x14')][_0xe5a7('0x15')]({'raw':_0x18da5c['options']?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x17')]===undefined?!![]:![]:!![],'where':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x18')]||null:null,'attributes':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x19')]||null:null,'limit':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1a')]||null:null,'include':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1b')]?_['map'](_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1b')],function(_0x3608cd){return{'model':db[_0x3608cd[_0xe5a7('0x1c')]],'as':_0x3608cd['as'],'attributes':_0x3608cd[_0xe5a7('0x19')],'include':_0x3608cd[_0xe5a7('0x1b')]?_[_0xe5a7('0x1d')](_0x3608cd[_0xe5a7('0x1b')],function(_0x33f6ca){return{'model':db[_0x33f6ca['model']],'as':_0x33f6ca['as'],'attributes':_0x33f6ca[_0xe5a7('0x19')],'include':_0x33f6ca['include']?_[_0xe5a7('0x1d')](_0x33f6ca[_0xe5a7('0x1b')],function(_0x111bf1){return{'model':db[_0x111bf1[_0xe5a7('0x1c')]],'as':_0x111bf1['as'],'attributes':_0x111bf1['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5a7('0x1e')](function(_0x4e8d02){logger[_0xe5a7('0xd')](_0xe5a7('0x1f'),_0x18da5c);logger[_0xe5a7('0xf')](_0xe5a7('0x1f'),_0x18da5c,JSON[_0xe5a7('0x20')](_0x4e8d02));_0x515958(_0x4e8d02);})[_0xe5a7('0x21')](function(_0x56214a){logger[_0xe5a7('0x10')](_0xe5a7('0x1f'),_0x56214a['message'],_0x18da5c);_0x346fdf(_0x5ee0e6['error'](0x1f4,_0x56214a[_0xe5a7('0x12')]));});});};exports[_0xe5a7('0x22')]=function(_0x5deafb){var _0x4235d3=this;return new Promise(function(_0x10bf96,_0x5ed1b3){return db[_0xe5a7('0x14')][_0xe5a7('0x23')]({'raw':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x17')]===undefined?!![]:![]:!![],'where':_0x5deafb['options']?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x18')]||null:null,'attributes':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x19')]||null:null,'include':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x1b')]?_['map'](_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x1b')],function(_0x3b97bf){return{'model':db[_0x3b97bf[_0xe5a7('0x1c')]],'as':_0x3b97bf['as'],'attributes':_0x3b97bf[_0xe5a7('0x19')],'include':_0x3b97bf['include']?_['map'](_0x3b97bf[_0xe5a7('0x1b')],function(_0x1c202){return{'model':db[_0x1c202['model']],'as':_0x1c202['as'],'attributes':_0x1c202[_0xe5a7('0x19')],'include':_0x1c202['include']?_[_0xe5a7('0x1d')](_0x1c202['include'],function(_0x28c5aa){return{'model':db[_0x28c5aa[_0xe5a7('0x1c')]],'as':_0x28c5aa['as'],'attributes':_0x28c5aa[_0xe5a7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe5a7('0x1e')](function(_0xcc0133){logger[_0xe5a7('0xd')](_0xe5a7('0x22'),_0x5deafb);logger[_0xe5a7('0xf')](_0xe5a7('0x22'),_0x5deafb,JSON[_0xe5a7('0x20')](_0xcc0133));_0x10bf96(_0xcc0133);})[_0xe5a7('0x21')](function(_0x25ef86){logger['error'](_0xe5a7('0x22'),_0x25ef86[_0xe5a7('0x12')],_0x5deafb);_0x5ed1b3(_0x4235d3['error'](0x1f4,_0x25ef86[_0xe5a7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 82bc02e..f5f8b87 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 _0xdb0d=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','delete','destroy','exports','multer','util'];(function(_0x1def1b,_0x31f12e){var _0x1a294e=function(_0x356484){while(--_0x356484){_0x1def1b['push'](_0x1def1b['shift']());}};_0x1a294e(++_0x31f12e);}(_0xdb0d,0xee));var _0xddb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb0d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xddb0('0x0'));var util=require(_0xddb0('0x1'));var path=require(_0xddb0('0x2'));var timeout=require(_0xddb0('0x3'));var express=require(_0xddb0('0x4'));var router=express[_0xddb0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xddb0('0x6'));var interaction=require(_0xddb0('0x7'));var config=require(_0xddb0('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xddb0('0x9')]('/',auth['isAuthenticated'](),controller[_0xddb0('0xa')]);router['get'](_0xddb0('0xb'),auth[_0xddb0('0xc')](),controller[_0xddb0('0xd')]);router[_0xddb0('0x9')](_0xddb0('0xe'),auth[_0xddb0('0xc')](),controller[_0xddb0('0xf')]);router[_0xddb0('0x9')](_0xddb0('0x10'),auth[_0xddb0('0xc')](),controller[_0xddb0('0x11')]);router[_0xddb0('0x9')]('/:id/descriptions',auth[_0xddb0('0xc')](),controller[_0xddb0('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xddb0('0x13')](_0xddb0('0xb'),auth[_0xddb0('0xc')](),controller[_0xddb0('0x14')]);router[_0xddb0('0x15')](_0xddb0('0xb'),auth[_0xddb0('0xc')](),controller[_0xddb0('0x16')]);module[_0xddb0('0x17')]=router; \ No newline at end of file +var _0x1f81=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x327c69,_0x27e755){var _0x49c1af=function(_0x21f59e){while(--_0x21f59e){_0x327c69['push'](_0x327c69['shift']());}};_0x49c1af(++_0x27e755);}(_0x1f81,0xab));var _0x11f8=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x1f81[_0x1406ae];return _0x23a076;};'use strict';var multer=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var path=require('path');var timeout=require(_0x11f8('0x2'));var express=require(_0x11f8('0x3'));var router=express['Router']();var fs_extra=require(_0x11f8('0x4'));var auth=require(_0x11f8('0x5'));var interaction=require(_0x11f8('0x6'));var config=require(_0x11f8('0x7'));var controller=require(_0x11f8('0x8'));router[_0x11f8('0x9')]('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0xb')]);router['get'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xd')]);router[_0x11f8('0x9')](_0x11f8('0xe'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xf')]);router[_0x11f8('0x9')](_0x11f8('0x10'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x11')]);router['get'](_0x11f8('0x12'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x13')]);router[_0x11f8('0x14')]('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0x15')]);router['put'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x16')]);router['delete'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x17')]);module[_0x11f8('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 eeebef2..877bdf7 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 _0x582a=['exports','STRING','sequelize'];(function(_0x1317c6,_0x3941d1){var _0x2a83b7=function(_0x599bcb){while(--_0x599bcb){_0x1317c6['push'](_0x1317c6['shift']());}};_0x2a83b7(++_0x3941d1);}(_0x582a,0x1cd));var _0xa582=function(_0x5bd613,_0x151a02){_0x5bd613=_0x5bd613-0x0;var _0x62f674=_0x582a[_0x5bd613];return _0x62f674;};'use strict';var Sequelize=require(_0xa582('0x0'));module[_0xa582('0x1')]={'name':{'type':Sequelize[_0xa582('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x33e1=['exports','STRING','sequelize'];(function(_0x2b6c40,_0x392cab){var _0xfbd49d=function(_0x34086f){while(--_0x34086f){_0x2b6c40['push'](_0x2b6c40['shift']());}};_0xfbd49d(++_0x392cab);}(_0x33e1,0x113));var _0x133e=function(_0x5ad9dd,_0x542fef){_0x5ad9dd=_0x5ad9dd-0x0;var _0x2db6c0=_0x33e1[_0x5ad9dd];return _0x2db6c0;};'use strict';var Sequelize=require(_0x133e('0x0'));module[_0x133e('0x1')]={'name':{'type':Sequelize[_0x133e('0x2')]},'description':{'type':Sequelize[_0x133e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index a16939c..b9e6408 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 _0xa8a2=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','body','find','getFields','findOne','sort','getSubjects','SugarcrmField','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x2af5ec,_0x5cf1f8){var _0xd144aa=function(_0x1a1c81){while(--_0x1a1c81){_0x2af5ec['push'](_0x2af5ec['shift']());}};_0xd144aa(++_0x5cf1f8);}(_0xa8a2,0x185));var _0x2a8a=function(_0x511b38,_0x3731bf){_0x511b38=_0x511b38-0x0;var _0x205e91=_0xa8a2[_0x511b38];return _0x205e91;};'use strict';var emlformat=require(_0x2a8a('0x0'));var rimraf=require(_0x2a8a('0x1'));var zipdir=require(_0x2a8a('0x2'));var jsonpatch=require(_0x2a8a('0x3'));var rp=require(_0x2a8a('0x4'));var moment=require(_0x2a8a('0x5'));var BPromise=require(_0x2a8a('0x6'));var Mustache=require(_0x2a8a('0x7'));var util=require(_0x2a8a('0x8'));var path=require('path');var sox=require(_0x2a8a('0x9'));var csv=require(_0x2a8a('0xa'));var ejs=require(_0x2a8a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a8a('0xc'));var squel=require(_0x2a8a('0xd'));var crypto=require(_0x2a8a('0xe'));var jsforce=require(_0x2a8a('0xf'));var deskjs=require(_0x2a8a('0x10'));var toCsv=require(_0x2a8a('0xa'));var querystring=require(_0x2a8a('0x11'));var Papa=require('papaparse');var Redis=require(_0x2a8a('0x12'));var authService=require(_0x2a8a('0x13'));var qs=require(_0x2a8a('0x14'));var as=require(_0x2a8a('0x15'));var hardwareService=require(_0x2a8a('0x16'));var logger=require('../../config/logger')(_0x2a8a('0x17'));var utils=require('../../config/utils');var config=require(_0x2a8a('0x18'));var licenseUtil=require(_0x2a8a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb5038c,_0x53cecc){_0x53cecc=_0x53cecc||0xcc;return function(_0x5c4286){if(_0x5c4286){return _0xb5038c[_0x2a8a('0x1a')](_0x53cecc);}return _0xb5038c[_0x2a8a('0x1b')](_0x53cecc)[_0x2a8a('0x1c')]();};}function respondWithResult(_0x14018a,_0xe5420f){_0xe5420f=_0xe5420f||0xc8;return function(_0x57c000){if(_0x57c000){return _0x14018a[_0x2a8a('0x1b')](_0xe5420f)[_0x2a8a('0x1d')](_0x57c000);}};}function respondWithFilteredResult(_0x224180,_0x205bcd){return function(_0x360348){if(_0x360348){var _0x2799fa=typeof _0x205bcd[_0x2a8a('0x1e')]===_0x2a8a('0x1f')&&typeof _0x205bcd[_0x2a8a('0x20')]===_0x2a8a('0x1f');var _0x336c57=_0x360348[_0x2a8a('0x21')];var _0x1b8a66=_0x2799fa?0x0:_0x205bcd[_0x2a8a('0x1e')];var _0xc72402=_0x2799fa?_0x360348[_0x2a8a('0x21')]:_0x205bcd['offset']+_0x205bcd[_0x2a8a('0x20')];var _0x16db43;if(_0xc72402>=_0x336c57){_0xc72402=_0x336c57;_0x16db43=0xc8;}else{_0x16db43=0xce;}_0x224180['status'](_0x16db43);return _0x224180[_0x2a8a('0x22')](_0x2a8a('0x23'),_0x1b8a66+'-'+_0xc72402+'/'+_0x336c57)[_0x2a8a('0x1d')](_0x360348);}return null;};}function patchUpdates(_0x4c9c24){return function(_0xbce620){try{jsonpatch[_0x2a8a('0x24')](_0xbce620,_0x4c9c24,!![]);}catch(_0x3a888e){return BPromise['reject'](_0x3a888e);}return _0xbce620[_0x2a8a('0x25')]();};}function saveUpdates(_0xf4a6f1,_0x37f74a){return function(_0x40ac68){if(_0x40ac68){return _0x40ac68[_0x2a8a('0x26')](_0xf4a6f1)[_0x2a8a('0x27')](function(_0x440c26){return _0x440c26;});}return null;};}function removeEntity(_0x3c7a9e,_0xa0d2d3){return function(_0x36800c){if(_0x36800c){return _0x36800c[_0x2a8a('0x28')]()[_0x2a8a('0x27')](function(){_0x3c7a9e['status'](0xcc)[_0x2a8a('0x1c')]();});}};}function handleEntityNotFound(_0x11d712,_0x8f6d9e){return function(_0x15c936){if(!_0x15c936){_0x11d712[_0x2a8a('0x1a')](0x194);}return _0x15c936;};}function handleError(_0x41bac7,_0x3a333f){_0x3a333f=_0x3a333f||0x1f4;return function(_0xc0ad34){logger[_0x2a8a('0x29')](_0xc0ad34[_0x2a8a('0x2a')]);if(_0xc0ad34[_0x2a8a('0x2b')]){delete _0xc0ad34[_0x2a8a('0x2b')];}_0x41bac7[_0x2a8a('0x1b')](_0x3a333f)['send'](_0xc0ad34);};}exports['index']=function(_0x44947c,_0x27c5bc){var _0x5b2af2={},_0x1d3f84={},_0x2b2978={'count':0x0,'rows':[]};var _0xc7634a=_[_0x2a8a('0x2c')](db[_0x2a8a('0x2d')][_0x2a8a('0x2e')],function(_0x186863){return{'name':_0x186863[_0x2a8a('0x2f')],'type':_0x186863[_0x2a8a('0x30')]['key']};});_0x1d3f84[_0x2a8a('0x31')]=_[_0x2a8a('0x2c')](_0xc7634a,_0x2a8a('0x2b'));_0x1d3f84['query']=_[_0x2a8a('0x32')](_0x44947c[_0x2a8a('0x33')]);_0x1d3f84['filters']=_[_0x2a8a('0x34')](_0x1d3f84['model'],_0x1d3f84[_0x2a8a('0x33')]);_0x5b2af2[_0x2a8a('0x35')]=_['intersection'](_0x1d3f84[_0x2a8a('0x31')],qs[_0x2a8a('0x36')](_0x44947c['query'][_0x2a8a('0x36')]));_0x5b2af2[_0x2a8a('0x35')]=_0x5b2af2['attributes'][_0x2a8a('0x37')]?_0x5b2af2[_0x2a8a('0x35')]:_0x1d3f84[_0x2a8a('0x31')];if(!_0x44947c[_0x2a8a('0x33')][_0x2a8a('0x38')](_0x2a8a('0x39'))){_0x5b2af2[_0x2a8a('0x20')]=qs[_0x2a8a('0x20')](_0x44947c['query']['limit']);_0x5b2af2[_0x2a8a('0x1e')]=qs['offset'](_0x44947c[_0x2a8a('0x33')]['offset']);}_0x5b2af2[_0x2a8a('0x3a')]=qs['sort'](_0x44947c[_0x2a8a('0x33')]['sort']);_0x5b2af2[_0x2a8a('0x3b')]=qs[_0x2a8a('0x3c')](_['pick'](_0x44947c[_0x2a8a('0x33')],_0x1d3f84['filters']),_0xc7634a);if(_0x44947c[_0x2a8a('0x33')][_0x2a8a('0x3d')]){_0x5b2af2['where']=_['merge'](_0x5b2af2[_0x2a8a('0x3b')],{'$or':_[_0x2a8a('0x2c')](_0xc7634a,function(_0x31a0ed){if(_0x31a0ed[_0x2a8a('0x30')]!==_0x2a8a('0x3e')){var _0x36516d={};_0x36516d[_0x31a0ed[_0x2a8a('0x2b')]]={'$like':'%'+_0x44947c[_0x2a8a('0x33')][_0x2a8a('0x3d')]+'%'};return _0x36516d;}})});}_0x5b2af2=_[_0x2a8a('0x3f')]({},_0x5b2af2,_0x44947c[_0x2a8a('0x40')]);var _0x316474={'where':_0x5b2af2[_0x2a8a('0x3b')]};return db[_0x2a8a('0x2d')][_0x2a8a('0x21')](_0x316474)[_0x2a8a('0x27')](function(_0x4a3508){_0x2b2978[_0x2a8a('0x21')]=_0x4a3508;if(_0x44947c[_0x2a8a('0x33')][_0x2a8a('0x41')]){_0x5b2af2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x5b2af2);})['then'](function(_0x15ed2a){_0x2b2978[_0x2a8a('0x42')]=_0x15ed2a;return _0x2b2978;})[_0x2a8a('0x27')](respondWithFilteredResult(_0x27c5bc,_0x5b2af2))[_0x2a8a('0x43')](handleError(_0x27c5bc,null));};exports[_0x2a8a('0x44')]=function(_0x52f9c1,_0x26ca15){var _0x22e7ec={'raw':![],'where':{'id':_0x52f9c1[_0x2a8a('0x45')]['id']}},_0x2936fa={};_0x2936fa[_0x2a8a('0x31')]=_[_0x2a8a('0x32')](db[_0x2a8a('0x2d')][_0x2a8a('0x2e')]);_0x2936fa['query']=_[_0x2a8a('0x32')](_0x52f9c1[_0x2a8a('0x33')]);_0x2936fa[_0x2a8a('0x3c')]=_['intersection'](_0x2936fa['model'],_0x2936fa[_0x2a8a('0x33')]);_0x22e7ec[_0x2a8a('0x35')]=_[_0x2a8a('0x34')](_0x2936fa[_0x2a8a('0x31')],qs['fields'](_0x52f9c1[_0x2a8a('0x33')][_0x2a8a('0x36')]));_0x22e7ec[_0x2a8a('0x35')]=_0x22e7ec['attributes']['length']?_0x22e7ec['attributes']:_0x2936fa[_0x2a8a('0x31')];if(_0x52f9c1['query'][_0x2a8a('0x41')]){_0x22e7ec[_0x2a8a('0x46')]=[{'all':!![]}];}_0x22e7ec=_['merge']({},_0x22e7ec,_0x52f9c1[_0x2a8a('0x40')]);return db[_0x2a8a('0x2d')]['find'](_0x22e7ec)[_0x2a8a('0x27')](handleEntityNotFound(_0x26ca15,null))[_0x2a8a('0x27')](respondWithResult(_0x26ca15,null))['catch'](handleError(_0x26ca15,null));};exports['create']=function(_0x2905c5,_0x275b05){return db['SugarcrmConfiguration']['create'](_0x2905c5[_0x2a8a('0x47')],{})[_0x2a8a('0x27')](respondWithResult(_0x275b05,0xc9))[_0x2a8a('0x43')](handleError(_0x275b05,null));};exports['update']=function(_0x4541c9,_0x238d76){if(_0x4541c9[_0x2a8a('0x47')]['id']){delete _0x4541c9[_0x2a8a('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x2a8a('0x48')]({'where':{'id':_0x4541c9['params']['id']}})[_0x2a8a('0x27')](handleEntityNotFound(_0x238d76,null))['then'](saveUpdates(_0x4541c9['body'],null))[_0x2a8a('0x27')](respondWithResult(_0x238d76,null))[_0x2a8a('0x43')](handleError(_0x238d76,null));};exports[_0x2a8a('0x28')]=function(_0xa83c26,_0x1e0a01){return db[_0x2a8a('0x2d')][_0x2a8a('0x48')]({'where':{'id':_0xa83c26[_0x2a8a('0x45')]['id']}})[_0x2a8a('0x27')](handleEntityNotFound(_0x1e0a01,null))[_0x2a8a('0x27')](removeEntity(_0x1e0a01,null))[_0x2a8a('0x43')](handleError(_0x1e0a01,null));};exports[_0x2a8a('0x49')]=function(_0x39dbf9,_0x153942,_0x4c4fcb){var _0x5eb97b={};var _0x1ffabb={};var _0x17c3c8;var _0x5d584c;return db[_0x2a8a('0x2d')][_0x2a8a('0x4a')]({'where':{'id':_0x39dbf9[_0x2a8a('0x45')]['id']}})[_0x2a8a('0x27')](handleEntityNotFound(_0x153942,null))[_0x2a8a('0x27')](function(_0x4a590f){if(_0x4a590f){_0x17c3c8=_0x4a590f;_0x1ffabb[_0x2a8a('0x31')]=_[_0x2a8a('0x32')](db['SugarcrmField']['rawAttributes']);_0x1ffabb[_0x2a8a('0x33')]=_[_0x2a8a('0x32')](_0x39dbf9[_0x2a8a('0x33')]);_0x1ffabb[_0x2a8a('0x3c')]=_['intersection'](_0x1ffabb[_0x2a8a('0x31')],_0x1ffabb[_0x2a8a('0x33')]);_0x5eb97b['attributes']=_[_0x2a8a('0x34')](_0x1ffabb['model'],qs[_0x2a8a('0x36')](_0x39dbf9[_0x2a8a('0x33')][_0x2a8a('0x36')]));_0x5eb97b['attributes']=_0x5eb97b['attributes'][_0x2a8a('0x37')]?_0x5eb97b['attributes']:_0x1ffabb[_0x2a8a('0x31')];_0x5eb97b[_0x2a8a('0x3a')]=qs['sort'](_0x39dbf9[_0x2a8a('0x33')][_0x2a8a('0x4b')]);_0x5eb97b['where']=qs[_0x2a8a('0x3c')](_['pick'](_0x39dbf9[_0x2a8a('0x33')],_0x1ffabb[_0x2a8a('0x3c')]));if(_0x39dbf9[_0x2a8a('0x33')][_0x2a8a('0x3d')]){_0x5eb97b[_0x2a8a('0x3b')]=_['merge'](_0x5eb97b[_0x2a8a('0x3b')],{'$or':_['map'](_0x5eb97b['attributes'],function(_0x4a01e4){var _0x3656f6={};_0x3656f6[_0x4a01e4]={'$like':'%'+_0x39dbf9['query'][_0x2a8a('0x3d')]+'%'};return _0x3656f6;})});}_0x5eb97b=_[_0x2a8a('0x3f')]({},_0x5eb97b,_0x39dbf9['options']);return _0x17c3c8['getFields'](_0x5eb97b);}})[_0x2a8a('0x27')](function(_0x1108c7){if(_0x1108c7){_0x5d584c=_0x1108c7[_0x2a8a('0x37')];if(!_0x39dbf9[_0x2a8a('0x33')][_0x2a8a('0x38')](_0x2a8a('0x39'))){_0x5eb97b[_0x2a8a('0x20')]=qs[_0x2a8a('0x20')](_0x39dbf9[_0x2a8a('0x33')][_0x2a8a('0x20')]);_0x5eb97b['offset']=qs[_0x2a8a('0x1e')](_0x39dbf9[_0x2a8a('0x33')]['offset']);}return _0x17c3c8[_0x2a8a('0x49')](_0x5eb97b);}})[_0x2a8a('0x27')](function(_0x44daca){if(_0x44daca){return _0x44daca?{'count':_0x5d584c,'rows':_0x44daca}:null;}})[_0x2a8a('0x27')](respondWithResult(_0x153942,null))[_0x2a8a('0x43')](handleError(_0x153942,null));};exports[_0x2a8a('0x4c')]=function(_0x5a5e05,_0x18bce8,_0x3c5069){var _0x262bb9={};var _0x5c7a30={};var _0x2c9981;var _0x586818;return db[_0x2a8a('0x2d')]['findOne']({'where':{'id':_0x5a5e05['params']['id']}})[_0x2a8a('0x27')](handleEntityNotFound(_0x18bce8,null))['then'](function(_0x381bcc){if(_0x381bcc){_0x2c9981=_0x381bcc;_0x5c7a30['model']=_[_0x2a8a('0x32')](db[_0x2a8a('0x4d')]['rawAttributes']);_0x5c7a30[_0x2a8a('0x33')]=_[_0x2a8a('0x32')](_0x5a5e05[_0x2a8a('0x33')]);_0x5c7a30[_0x2a8a('0x3c')]=_[_0x2a8a('0x34')](_0x5c7a30['model'],_0x5c7a30[_0x2a8a('0x33')]);_0x262bb9['attributes']=_[_0x2a8a('0x34')](_0x5c7a30['model'],qs[_0x2a8a('0x36')](_0x5a5e05[_0x2a8a('0x33')][_0x2a8a('0x36')]));_0x262bb9[_0x2a8a('0x35')]=_0x262bb9[_0x2a8a('0x35')][_0x2a8a('0x37')]?_0x262bb9['attributes']:_0x5c7a30[_0x2a8a('0x31')];_0x262bb9['order']=qs['sort'](_0x5a5e05[_0x2a8a('0x33')]['sort']);_0x262bb9[_0x2a8a('0x3b')]=qs['filters'](_[_0x2a8a('0x4e')](_0x5a5e05[_0x2a8a('0x33')],_0x5c7a30[_0x2a8a('0x3c')]));if(_0x5a5e05['query'][_0x2a8a('0x3d')]){_0x262bb9[_0x2a8a('0x3b')]=_[_0x2a8a('0x3f')](_0x262bb9[_0x2a8a('0x3b')],{'$or':_[_0x2a8a('0x2c')](_0x262bb9[_0x2a8a('0x35')],function(_0x29c5d5){var _0x5c2105={};_0x5c2105[_0x29c5d5]={'$like':'%'+_0x5a5e05[_0x2a8a('0x33')][_0x2a8a('0x3d')]+'%'};return _0x5c2105;})});}_0x262bb9=_['merge']({},_0x262bb9,_0x5a5e05[_0x2a8a('0x40')]);return _0x2c9981[_0x2a8a('0x4c')](_0x262bb9);}})[_0x2a8a('0x27')](function(_0x6979e5){if(_0x6979e5){_0x586818=_0x6979e5['length'];if(!_0x5a5e05[_0x2a8a('0x33')]['hasOwnProperty'](_0x2a8a('0x39'))){_0x262bb9[_0x2a8a('0x20')]=qs[_0x2a8a('0x20')](_0x5a5e05[_0x2a8a('0x33')][_0x2a8a('0x20')]);_0x262bb9[_0x2a8a('0x1e')]=qs[_0x2a8a('0x1e')](_0x5a5e05[_0x2a8a('0x33')]['offset']);}return _0x2c9981[_0x2a8a('0x4c')](_0x262bb9);}})[_0x2a8a('0x27')](function(_0x52df0d){if(_0x52df0d){return _0x52df0d?{'count':_0x586818,'rows':_0x52df0d}:null;}})[_0x2a8a('0x27')](respondWithResult(_0x18bce8,null))[_0x2a8a('0x43')](handleError(_0x18bce8,null));};exports[_0x2a8a('0x4f')]=function(_0x48e3c7,_0x2d510f,_0x352adb){var _0x35867a={};var _0x14962d={};var _0x52238a;var _0x3033b5;return db[_0x2a8a('0x2d')][_0x2a8a('0x4a')]({'where':{'id':_0x48e3c7[_0x2a8a('0x45')]['id']}})[_0x2a8a('0x27')](handleEntityNotFound(_0x2d510f,null))[_0x2a8a('0x27')](function(_0x38531b){if(_0x38531b){_0x52238a=_0x38531b;_0x14962d[_0x2a8a('0x31')]=_[_0x2a8a('0x32')](db[_0x2a8a('0x4d')][_0x2a8a('0x2e')]);_0x14962d['query']=_['keys'](_0x48e3c7[_0x2a8a('0x33')]);_0x14962d[_0x2a8a('0x3c')]=_[_0x2a8a('0x34')](_0x14962d[_0x2a8a('0x31')],_0x14962d[_0x2a8a('0x33')]);_0x35867a[_0x2a8a('0x35')]=_[_0x2a8a('0x34')](_0x14962d[_0x2a8a('0x31')],qs[_0x2a8a('0x36')](_0x48e3c7[_0x2a8a('0x33')][_0x2a8a('0x36')]));_0x35867a['attributes']=_0x35867a[_0x2a8a('0x35')]['length']?_0x35867a['attributes']:_0x14962d['model'];_0x35867a[_0x2a8a('0x3a')]=qs[_0x2a8a('0x4b')](_0x48e3c7['query'][_0x2a8a('0x4b')]);_0x35867a[_0x2a8a('0x3b')]=qs['filters'](_[_0x2a8a('0x4e')](_0x48e3c7[_0x2a8a('0x33')],_0x14962d[_0x2a8a('0x3c')]));if(_0x48e3c7[_0x2a8a('0x33')][_0x2a8a('0x3d')]){_0x35867a['where']=_[_0x2a8a('0x3f')](_0x35867a[_0x2a8a('0x3b')],{'$or':_[_0x2a8a('0x2c')](_0x35867a['attributes'],function(_0x56ce72){var _0x30efdf={};_0x30efdf[_0x56ce72]={'$like':'%'+_0x48e3c7[_0x2a8a('0x33')]['filter']+'%'};return _0x30efdf;})});}_0x35867a=_[_0x2a8a('0x3f')]({},_0x35867a,_0x48e3c7['options']);return _0x52238a['getDescriptions'](_0x35867a);}})[_0x2a8a('0x27')](function(_0x2ad3fc){if(_0x2ad3fc){_0x3033b5=_0x2ad3fc['length'];if(!_0x48e3c7[_0x2a8a('0x33')][_0x2a8a('0x38')](_0x2a8a('0x39'))){_0x35867a[_0x2a8a('0x20')]=qs[_0x2a8a('0x20')](_0x48e3c7[_0x2a8a('0x33')]['limit']);_0x35867a[_0x2a8a('0x1e')]=qs[_0x2a8a('0x1e')](_0x48e3c7[_0x2a8a('0x33')][_0x2a8a('0x1e')]);}return _0x52238a[_0x2a8a('0x4f')](_0x35867a);}})[_0x2a8a('0x27')](function(_0x2e7148){if(_0x2e7148){return _0x2e7148?{'count':_0x3033b5,'rows':_0x2e7148}:null;}})[_0x2a8a('0x27')](respondWithResult(_0x2d510f,null))['catch'](handleError(_0x2d510f,null));}; \ No newline at end of file +var _0xf570=['catch','body','find','SugarcrmField','length','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','SugarcrmConfiguration','include','rows','show','params','includeAll','create'];(function(_0x60159e,_0x251a55){var _0x5d35b3=function(_0x5882b6){while(--_0x5882b6){_0x60159e['push'](_0x60159e['shift']());}};_0x5d35b3(++_0x251a55);}(_0xf570,0x1e3));var _0x0f57=function(_0x320c50,_0x6be7c7){_0x320c50=_0x320c50-0x0;var _0xd27ada=_0xf570[_0x320c50];return _0xd27ada;};'use strict';var emlformat=require(_0x0f57('0x0'));var rimraf=require(_0x0f57('0x1'));var zipdir=require(_0x0f57('0x2'));var jsonpatch=require(_0x0f57('0x3'));var rp=require(_0x0f57('0x4'));var moment=require(_0x0f57('0x5'));var BPromise=require(_0x0f57('0x6'));var Mustache=require('mustache');var util=require(_0x0f57('0x7'));var path=require(_0x0f57('0x8'));var sox=require('sox');var csv=require(_0x0f57('0x9'));var ejs=require(_0x0f57('0xa'));var fs=require('fs');var fs_extra=require(_0x0f57('0xb'));var _=require(_0x0f57('0xc'));var squel=require(_0x0f57('0xd'));var crypto=require(_0x0f57('0xe'));var jsforce=require(_0x0f57('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f57('0x9'));var querystring=require('querystring');var Papa=require(_0x0f57('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f57('0x11'));var as=require(_0x0f57('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f57('0x13'))(_0x0f57('0x14'));var utils=require(_0x0f57('0x15'));var config=require(_0x0f57('0x16'));var licenseUtil=require(_0x0f57('0x17'));var db=require(_0x0f57('0x18'))['db'];function respondWithStatusCode(_0x50c4a4,_0x188e07){_0x188e07=_0x188e07||0xcc;return function(_0x59355f){if(_0x59355f){return _0x50c4a4['sendStatus'](_0x188e07);}return _0x50c4a4['status'](_0x188e07)[_0x0f57('0x19')]();};}function respondWithResult(_0x3a2cb3,_0x3d8abe){_0x3d8abe=_0x3d8abe||0xc8;return function(_0x419218){if(_0x419218){return _0x3a2cb3['status'](_0x3d8abe)[_0x0f57('0x1a')](_0x419218);}};}function respondWithFilteredResult(_0x34ae4e,_0x55ec48){return function(_0x56a541){if(_0x56a541){var _0x5ade89=typeof _0x55ec48[_0x0f57('0x1b')]===_0x0f57('0x1c')&&typeof _0x55ec48['limit']==='undefined';var _0x4d6b31=_0x56a541[_0x0f57('0x1d')];var _0x54679b=_0x5ade89?0x0:_0x55ec48[_0x0f57('0x1b')];var _0x451145=_0x5ade89?_0x56a541[_0x0f57('0x1d')]:_0x55ec48[_0x0f57('0x1b')]+_0x55ec48['limit'];var _0x3a8730;if(_0x451145>=_0x4d6b31){_0x451145=_0x4d6b31;_0x3a8730=0xc8;}else{_0x3a8730=0xce;}_0x34ae4e['status'](_0x3a8730);return _0x34ae4e[_0x0f57('0x1e')](_0x0f57('0x1f'),_0x54679b+'-'+_0x451145+'/'+_0x4d6b31)['json'](_0x56a541);}return null;};}function patchUpdates(_0x4cbc4e){return function(_0x11e17c){try{jsonpatch[_0x0f57('0x20')](_0x11e17c,_0x4cbc4e,!![]);}catch(_0x1018c8){return BPromise[_0x0f57('0x21')](_0x1018c8);}return _0x11e17c['save']();};}function saveUpdates(_0x544467,_0x1e25bb){return function(_0x56ccce){if(_0x56ccce){return _0x56ccce[_0x0f57('0x22')](_0x544467)[_0x0f57('0x23')](function(_0x26cfbf){return _0x26cfbf;});}return null;};}function removeEntity(_0x2de74b,_0x5b85c1){return function(_0x3f26c8){if(_0x3f26c8){return _0x3f26c8[_0x0f57('0x24')]()[_0x0f57('0x23')](function(){_0x2de74b[_0x0f57('0x25')](0xcc)[_0x0f57('0x19')]();});}};}function handleEntityNotFound(_0x22d4a4,_0x355711){return function(_0x1ee84e){if(!_0x1ee84e){_0x22d4a4['sendStatus'](0x194);}return _0x1ee84e;};}function handleError(_0x4dbee5,_0x54e512){_0x54e512=_0x54e512||0x1f4;return function(_0x4f9d45){logger[_0x0f57('0x26')](_0x4f9d45[_0x0f57('0x27')]);if(_0x4f9d45[_0x0f57('0x28')]){delete _0x4f9d45[_0x0f57('0x28')];}_0x4dbee5[_0x0f57('0x25')](_0x54e512)[_0x0f57('0x29')](_0x4f9d45);};}exports[_0x0f57('0x2a')]=function(_0x9bc863,_0x295a2a){var _0x56ce61={},_0x4dacd0={},_0x529eb1={'count':0x0,'rows':[]};var _0x569da5=_[_0x0f57('0x2b')](db['SugarcrmConfiguration'][_0x0f57('0x2c')],function(_0x33b8fe){return{'name':_0x33b8fe[_0x0f57('0x2d')],'type':_0x33b8fe['type'][_0x0f57('0x2e')]};});_0x4dacd0[_0x0f57('0x2f')]=_['map'](_0x569da5,_0x0f57('0x28'));_0x4dacd0[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x9bc863['query']);_0x4dacd0[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x4dacd0['model'],_0x4dacd0[_0x0f57('0x30')]);_0x56ce61[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x4dacd0[_0x0f57('0x2f')],qs[_0x0f57('0x35')](_0x9bc863[_0x0f57('0x30')][_0x0f57('0x35')]));_0x56ce61[_0x0f57('0x34')]=_0x56ce61['attributes']['length']?_0x56ce61[_0x0f57('0x34')]:_0x4dacd0[_0x0f57('0x2f')];if(!_0x9bc863['query'][_0x0f57('0x36')](_0x0f57('0x37'))){_0x56ce61[_0x0f57('0x38')]=qs['limit'](_0x9bc863['query'][_0x0f57('0x38')]);_0x56ce61[_0x0f57('0x1b')]=qs[_0x0f57('0x1b')](_0x9bc863[_0x0f57('0x30')]['offset']);}_0x56ce61[_0x0f57('0x39')]=qs['sort'](_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x56ce61['where']=qs[_0x0f57('0x32')](_['pick'](_0x9bc863[_0x0f57('0x30')],_0x4dacd0['filters']),_0x569da5);if(_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x56ce61[_0x0f57('0x3c')]=_['merge'](_0x56ce61[_0x0f57('0x3c')],{'$or':_[_0x0f57('0x2b')](_0x569da5,function(_0x3b3c7f){if(_0x3b3c7f['type']!=='VIRTUAL'){var _0x48d3d5={};_0x48d3d5[_0x3b3c7f[_0x0f57('0x28')]]={'$like':'%'+_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x48d3d5;}})});}_0x56ce61=_[_0x0f57('0x3d')]({},_0x56ce61,_0x9bc863[_0x0f57('0x3e')]);var _0x2d9640={'where':_0x56ce61[_0x0f57('0x3c')]};return db[_0x0f57('0x3f')][_0x0f57('0x1d')](_0x2d9640)[_0x0f57('0x23')](function(_0x1b8abf){_0x529eb1[_0x0f57('0x1d')]=_0x1b8abf;if(_0x9bc863['query']['includeAll']){_0x56ce61[_0x0f57('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x56ce61);})[_0x0f57('0x23')](function(_0x4c2977){_0x529eb1[_0x0f57('0x41')]=_0x4c2977;return _0x529eb1;})['then'](respondWithFilteredResult(_0x295a2a,_0x56ce61))['catch'](handleError(_0x295a2a,null));};exports[_0x0f57('0x42')]=function(_0x20790d,_0x180d2b){var _0x76bca={'raw':![],'where':{'id':_0x20790d[_0x0f57('0x43')]['id']}},_0x41671c={};_0x41671c[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x3f')]['rawAttributes']);_0x41671c['query']=_['keys'](_0x20790d[_0x0f57('0x30')]);_0x41671c[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x41671c[_0x0f57('0x2f')],_0x41671c[_0x0f57('0x30')]);_0x76bca['attributes']=_[_0x0f57('0x33')](_0x41671c[_0x0f57('0x2f')],qs['fields'](_0x20790d[_0x0f57('0x30')][_0x0f57('0x35')]));_0x76bca['attributes']=_0x76bca[_0x0f57('0x34')]['length']?_0x76bca['attributes']:_0x41671c['model'];if(_0x20790d[_0x0f57('0x30')][_0x0f57('0x44')]){_0x76bca[_0x0f57('0x40')]=[{'all':!![]}];}_0x76bca=_[_0x0f57('0x3d')]({},_0x76bca,_0x20790d[_0x0f57('0x3e')]);return db[_0x0f57('0x3f')]['find'](_0x76bca)[_0x0f57('0x23')](handleEntityNotFound(_0x180d2b,null))[_0x0f57('0x23')](respondWithResult(_0x180d2b,null))['catch'](handleError(_0x180d2b,null));};exports['create']=function(_0x3ff530,_0x169bd1){return db['SugarcrmConfiguration'][_0x0f57('0x45')](_0x3ff530['body'],{})[_0x0f57('0x23')](respondWithResult(_0x169bd1,0xc9))[_0x0f57('0x46')](handleError(_0x169bd1,null));};exports[_0x0f57('0x22')]=function(_0x5358f0,_0x4ac57a){if(_0x5358f0[_0x0f57('0x47')]['id']){delete _0x5358f0[_0x0f57('0x47')]['id'];}return db[_0x0f57('0x3f')]['find']({'where':{'id':_0x5358f0['params']['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x4ac57a,null))[_0x0f57('0x23')](saveUpdates(_0x5358f0[_0x0f57('0x47')],null))[_0x0f57('0x23')](respondWithResult(_0x4ac57a,null))[_0x0f57('0x46')](handleError(_0x4ac57a,null));};exports[_0x0f57('0x24')]=function(_0x1f9395,_0x20686e){return db[_0x0f57('0x3f')][_0x0f57('0x48')]({'where':{'id':_0x1f9395[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x20686e,null))['then'](removeEntity(_0x20686e,null))[_0x0f57('0x46')](handleError(_0x20686e,null));};exports['getFields']=function(_0x46b605,_0x38a54b,_0x56d812){var _0x43986b={};var _0x7573bf={};var _0x33faf7;var _0x3f13d0;return db[_0x0f57('0x3f')]['findOne']({'where':{'id':_0x46b605[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x38a54b,null))['then'](function(_0x103021){if(_0x103021){_0x33faf7=_0x103021;_0x7573bf[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x7573bf[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x46b605[_0x0f57('0x30')]);_0x7573bf[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x7573bf[_0x0f57('0x2f')],_0x7573bf['query']);_0x43986b[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x7573bf[_0x0f57('0x2f')],qs[_0x0f57('0x35')](_0x46b605[_0x0f57('0x30')][_0x0f57('0x35')]));_0x43986b[_0x0f57('0x34')]=_0x43986b['attributes'][_0x0f57('0x4a')]?_0x43986b[_0x0f57('0x34')]:_0x7573bf[_0x0f57('0x2f')];_0x43986b[_0x0f57('0x39')]=qs[_0x0f57('0x3a')](_0x46b605[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x43986b['where']=qs[_0x0f57('0x32')](_[_0x0f57('0x4b')](_0x46b605[_0x0f57('0x30')],_0x7573bf[_0x0f57('0x32')]));if(_0x46b605[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x43986b['where']=_[_0x0f57('0x3d')](_0x43986b[_0x0f57('0x3c')],{'$or':_[_0x0f57('0x2b')](_0x43986b['attributes'],function(_0x1a4f91){var _0x29f2a7={};_0x29f2a7[_0x1a4f91]={'$like':'%'+_0x46b605[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x29f2a7;})});}_0x43986b=_[_0x0f57('0x3d')]({},_0x43986b,_0x46b605[_0x0f57('0x3e')]);return _0x33faf7['getFields'](_0x43986b);}})[_0x0f57('0x23')](function(_0x1fdca1){if(_0x1fdca1){_0x3f13d0=_0x1fdca1['length'];if(!_0x46b605[_0x0f57('0x30')][_0x0f57('0x36')](_0x0f57('0x37'))){_0x43986b[_0x0f57('0x38')]=qs[_0x0f57('0x38')](_0x46b605[_0x0f57('0x30')]['limit']);_0x43986b[_0x0f57('0x1b')]=qs['offset'](_0x46b605[_0x0f57('0x30')]['offset']);}return _0x33faf7[_0x0f57('0x4c')](_0x43986b);}})['then'](function(_0x228a2b){if(_0x228a2b){return _0x228a2b?{'count':_0x3f13d0,'rows':_0x228a2b}:null;}})[_0x0f57('0x23')](respondWithResult(_0x38a54b,null))['catch'](handleError(_0x38a54b,null));};exports['getSubjects']=function(_0x43f68e,_0x43e279,_0x10b853){var _0x4007d7={};var _0x49410c={};var _0x36ad44;var _0x1682f1;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x43f68e[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x43e279,null))['then'](function(_0x3efee5){if(_0x3efee5){_0x36ad44=_0x3efee5;_0x49410c['model']=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x49410c[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x43f68e[_0x0f57('0x30')]);_0x49410c['filters']=_[_0x0f57('0x33')](_0x49410c[_0x0f57('0x2f')],_0x49410c['query']);_0x4007d7['attributes']=_['intersection'](_0x49410c[_0x0f57('0x2f')],qs['fields'](_0x43f68e[_0x0f57('0x30')][_0x0f57('0x35')]));_0x4007d7[_0x0f57('0x34')]=_0x4007d7[_0x0f57('0x34')][_0x0f57('0x4a')]?_0x4007d7[_0x0f57('0x34')]:_0x49410c[_0x0f57('0x2f')];_0x4007d7['order']=qs[_0x0f57('0x3a')](_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x4007d7[_0x0f57('0x3c')]=qs[_0x0f57('0x32')](_[_0x0f57('0x4b')](_0x43f68e['query'],_0x49410c[_0x0f57('0x32')]));if(_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x4007d7[_0x0f57('0x3c')]=_[_0x0f57('0x3d')](_0x4007d7['where'],{'$or':_[_0x0f57('0x2b')](_0x4007d7['attributes'],function(_0x5990ea){var _0x43d09c={};_0x43d09c[_0x5990ea]={'$like':'%'+_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x43d09c;})});}_0x4007d7=_[_0x0f57('0x3d')]({},_0x4007d7,_0x43f68e[_0x0f57('0x3e')]);return _0x36ad44['getSubjects'](_0x4007d7);}})[_0x0f57('0x23')](function(_0x49f333){if(_0x49f333){_0x1682f1=_0x49f333[_0x0f57('0x4a')];if(!_0x43f68e['query']['hasOwnProperty']('nolimit')){_0x4007d7['limit']=qs[_0x0f57('0x38')](_0x43f68e['query'][_0x0f57('0x38')]);_0x4007d7['offset']=qs['offset'](_0x43f68e['query'][_0x0f57('0x1b')]);}return _0x36ad44[_0x0f57('0x4d')](_0x4007d7);}})['then'](function(_0x893a37){if(_0x893a37){return _0x893a37?{'count':_0x1682f1,'rows':_0x893a37}:null;}})[_0x0f57('0x23')](respondWithResult(_0x43e279,null))[_0x0f57('0x46')](handleError(_0x43e279,null));};exports[_0x0f57('0x4e')]=function(_0x495b27,_0x167a3c,_0x10ff11){var _0x1b8000={};var _0x5d88b9={};var _0x4618b2;var _0x4d3889;return db[_0x0f57('0x3f')]['findOne']({'where':{'id':_0x495b27['params']['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x167a3c,null))[_0x0f57('0x23')](function(_0x1a301e){if(_0x1a301e){_0x4618b2=_0x1a301e;_0x5d88b9[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x5d88b9['query']=_[_0x0f57('0x31')](_0x495b27[_0x0f57('0x30')]);_0x5d88b9[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x5d88b9[_0x0f57('0x2f')],_0x5d88b9[_0x0f57('0x30')]);_0x1b8000[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x5d88b9['model'],qs[_0x0f57('0x35')](_0x495b27['query'][_0x0f57('0x35')]));_0x1b8000[_0x0f57('0x34')]=_0x1b8000['attributes']['length']?_0x1b8000[_0x0f57('0x34')]:_0x5d88b9[_0x0f57('0x2f')];_0x1b8000['order']=qs[_0x0f57('0x3a')](_0x495b27[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x1b8000['where']=qs['filters'](_[_0x0f57('0x4b')](_0x495b27[_0x0f57('0x30')],_0x5d88b9[_0x0f57('0x32')]));if(_0x495b27['query'][_0x0f57('0x3b')]){_0x1b8000['where']=_[_0x0f57('0x3d')](_0x1b8000['where'],{'$or':_[_0x0f57('0x2b')](_0x1b8000['attributes'],function(_0x153884){var _0x3c6453={};_0x3c6453[_0x153884]={'$like':'%'+_0x495b27['query']['filter']+'%'};return _0x3c6453;})});}_0x1b8000=_[_0x0f57('0x3d')]({},_0x1b8000,_0x495b27['options']);return _0x4618b2[_0x0f57('0x4e')](_0x1b8000);}})[_0x0f57('0x23')](function(_0x2f8763){if(_0x2f8763){_0x4d3889=_0x2f8763[_0x0f57('0x4a')];if(!_0x495b27[_0x0f57('0x30')][_0x0f57('0x36')](_0x0f57('0x37'))){_0x1b8000[_0x0f57('0x38')]=qs['limit'](_0x495b27[_0x0f57('0x30')][_0x0f57('0x38')]);_0x1b8000[_0x0f57('0x1b')]=qs[_0x0f57('0x1b')](_0x495b27[_0x0f57('0x30')]['offset']);}return _0x4618b2[_0x0f57('0x4e')](_0x1b8000);}})[_0x0f57('0x23')](function(_0x117762){if(_0x117762){return _0x117762?{'count':_0x4d3889,'rows':_0x117762}:null;}})[_0x0f57('0x23')](respondWithResult(_0x167a3c,null))[_0x0f57('0x46')](handleError(_0x167a3c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 132b28f..1487ecf 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 _0x9bb6=['path','rimraf','exports','define','SugarcrmConfiguration','util','api','bluebird','request-promise'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x9bb6,0xb0));var _0x69bb=function(_0x3a1d7d,_0x11dfbd){_0x3a1d7d=_0x3a1d7d-0x0;var _0x2af564=_0x9bb6[_0x3a1d7d];return _0x2af564;};'use strict';var _=require('lodash');var util=require(_0x69bb('0x0'));var logger=require('../../config/logger')(_0x69bb('0x1'));var moment=require('moment');var BPromise=require(_0x69bb('0x2'));var rp=require(_0x69bb('0x3'));var fs=require('fs');var path=require(_0x69bb('0x4'));var rimraf=require(_0x69bb('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x69bb('0x6')]=function(_0x55aa2b,_0x325566){return _0x55aa2b[_0x69bb('0x7')](_0x69bb('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61ec=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x61ec,0x193));var _0xc61e=function(_0x5848b0,_0x4883e8){_0x5848b0=_0x5848b0-0x0;var _0x3840e7=_0x61ec[_0x5848b0];return _0x3840e7;};'use strict';var _=require(_0xc61e('0x0'));var util=require(_0xc61e('0x1'));var logger=require(_0xc61e('0x2'))(_0xc61e('0x3'));var moment=require(_0xc61e('0x4'));var BPromise=require(_0xc61e('0x5'));var rp=require(_0xc61e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc61e('0x7'));var config=require(_0xc61e('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xc61e('0x9')]=function(_0x2b791c,_0x4f8a77){return _0x2b791c[_0xc61e('0xa')](_0xc61e('0xb'),attributes,{'tableName':_0xc61e('0xc'),'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 ea33bc0..8439c8d 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 _0x2bf6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x9f2a69,_0x5158db){var _0x1365e6=function(_0x1ae01f){while(--_0x1ae01f){_0x9f2a69['push'](_0x9f2a69['shift']());}};_0x1365e6(++_0x5158db);}(_0x2bf6,0x163));var _0x62bf=function(_0x5ee4d5,_0x5873a3){_0x5ee4d5=_0x5ee4d5-0x0;var _0x241a05=_0x2bf6[_0x5ee4d5];return _0x241a05;};'use strict';var _=require('lodash');var util=require(_0x62bf('0x0'));var moment=require(_0x62bf('0x1'));var BPromise=require(_0x62bf('0x2'));var rs=require(_0x62bf('0x3'));var fs=require('fs');var Redis=require(_0x62bf('0x4'));var db=require(_0x62bf('0x5'))['db'];var utils=require(_0x62bf('0x6'));var logger=require(_0x62bf('0x7'))('rpc');var config=require(_0x62bf('0x8'));var jayson=require(_0x62bf('0x9'));var client=jayson[_0x62bf('0xa')][_0x62bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d8000,_0xc6a24b,_0x2a264e){return new BPromise(function(_0x8b91fe,_0x4e669e){return client[_0x62bf('0xc')](_0x4d8000,_0x2a264e)[_0x62bf('0xd')](function(_0x336aa9){logger['info'](_0x62bf('0xe'),_0xc6a24b,'request\x20sent');logger[_0x62bf('0xf')](_0x62bf('0x10'),_0xc6a24b,_0x62bf('0x11'),JSON['stringify'](_0x336aa9));if(_0x336aa9[_0x62bf('0x12')]){if(_0x336aa9['error'][_0x62bf('0x13')]===0x1f4){logger[_0x62bf('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc6a24b,_0x336aa9[_0x62bf('0x12')]['message']);return _0x4e669e(_0x336aa9[_0x62bf('0x12')]['message']);}logger[_0x62bf('0x12')](_0x62bf('0xe'),_0xc6a24b,_0x336aa9['error'][_0x62bf('0x14')]);return _0x8b91fe(_0x336aa9[_0x62bf('0x12')][_0x62bf('0x14')]);}else{logger[_0x62bf('0x15')](_0x62bf('0xe'),_0xc6a24b,_0x62bf('0x11'));_0x8b91fe(_0x336aa9[_0x62bf('0x16')][_0x62bf('0x14')]);}})[_0x62bf('0x17')](function(_0x544d17){logger['error'](_0x62bf('0xe'),_0xc6a24b,_0x544d17);_0x4e669e(_0x544d17);});});} \ No newline at end of file +var _0xa38f=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0xa38f,0x8b));var _0xfa38=function(_0x2a523b,_0x218e6c){_0x2a523b=_0x2a523b-0x0;var _0x3f70ab=_0xa38f[_0x2a523b];return _0x3f70ab;};'use strict';var _=require(_0xfa38('0x0'));var util=require(_0xfa38('0x1'));var moment=require('moment');var BPromise=require(_0xfa38('0x2'));var rs=require(_0xfa38('0x3'));var fs=require('fs');var Redis=require(_0xfa38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa38('0x5'));var logger=require(_0xfa38('0x6'))('rpc');var config=require(_0xfa38('0x7'));var jayson=require(_0xfa38('0x8'));var client=jayson['client'][_0xfa38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d68fa,_0x28202d,_0x4c659b){return new BPromise(function(_0x5df4f4,_0x1d80af){return client['request'](_0x1d68fa,_0x4c659b)[_0xfa38('0xa')](function(_0x40cb01){logger[_0xfa38('0xb')](_0xfa38('0xc'),_0x28202d,_0xfa38('0xd'));logger[_0xfa38('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x28202d,_0xfa38('0xd'),JSON[_0xfa38('0xf')](_0x40cb01));if(_0x40cb01[_0xfa38('0x10')]){if(_0x40cb01[_0xfa38('0x10')][_0xfa38('0x11')]===0x1f4){logger[_0xfa38('0x10')](_0xfa38('0xc'),_0x28202d,_0x40cb01[_0xfa38('0x10')][_0xfa38('0x12')]);return _0x1d80af(_0x40cb01[_0xfa38('0x10')][_0xfa38('0x12')]);}logger[_0xfa38('0x10')](_0xfa38('0xc'),_0x28202d,_0x40cb01[_0xfa38('0x10')]['message']);return _0x5df4f4(_0x40cb01[_0xfa38('0x10')]['message']);}else{logger[_0xfa38('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x28202d,_0xfa38('0xd'));_0x5df4f4(_0x40cb01['result'][_0xfa38('0x12')]);}})[_0xfa38('0x13')](function(_0x5188a1){logger['error'](_0xfa38('0xc'),_0x28202d,_0x5188a1);_0x1d80af(_0x5188a1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index fbf4104..af51836 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 _0xbe84=['index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbe84,0xaa));var _0x4be8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe84[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4be8('0x0'));var util=require(_0x4be8('0x1'));var path=require('path');var timeout=require(_0x4be8('0x2'));var express=require(_0x4be8('0x3'));var router=express[_0x4be8('0x4')]();var fs_extra=require(_0x4be8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4be8('0x6'));var config=require(_0x4be8('0x7'));var controller=require(_0x4be8('0x8'));router['get']('/',auth[_0x4be8('0x9')](),controller[_0x4be8('0xa')]);router[_0x4be8('0xb')](_0x4be8('0xc'),auth[_0x4be8('0x9')](),controller[_0x4be8('0xd')]);router[_0x4be8('0xe')]('/',auth['isAuthenticated'](),controller[_0x4be8('0xf')]);router[_0x4be8('0x10')]('/:id',auth[_0x4be8('0x9')](),controller[_0x4be8('0x11')]);router['delete'](_0x4be8('0xc'),auth[_0x4be8('0x9')](),controller[_0x4be8('0x12')]);module[_0x4be8('0x13')]=router; \ No newline at end of file +var _0xd688=['index','get','/:id','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x53f74c,_0xd71010){var _0x467bc0=function(_0x58ab34){while(--_0x58ab34){_0x53f74c['push'](_0x53f74c['shift']());}};_0x467bc0(++_0xd71010);}(_0xd688,0xf1));var _0x8d68=function(_0x10f691,_0x125add){_0x10f691=_0x10f691-0x0;var _0x398fdc=_0xd688[_0x10f691];return _0x398fdc;};'use strict';var multer=require(_0x8d68('0x0'));var util=require(_0x8d68('0x1'));var path=require(_0x8d68('0x2'));var timeout=require(_0x8d68('0x3'));var express=require(_0x8d68('0x4'));var router=express[_0x8d68('0x5')]();var fs_extra=require(_0x8d68('0x6'));var auth=require(_0x8d68('0x7'));var interaction=require(_0x8d68('0x8'));var config=require(_0x8d68('0x9'));var controller=require(_0x8d68('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x8d68('0xb')]);router[_0x8d68('0xc')](_0x8d68('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8d68('0xe')]('/',auth[_0x8d68('0xf')](),controller[_0x8d68('0x10')]);router['put'](_0x8d68('0xd'),auth['isAuthenticated'](),controller[_0x8d68('0x11')]);router[_0x8d68('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8d68('0x13')]);module[_0x8d68('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index acc10b2..68d5b44 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 _0xf2e1=['STRING','ENUM','variable','BOOLEAN','customVariable','picklist','string'];(function(_0x1ad6f5,_0x563ff4){var _0x2c23bd=function(_0x4f3c33){while(--_0x4f3c33){_0x1ad6f5['push'](_0x1ad6f5['shift']());}};_0x2c23bd(++_0x563ff4);}(_0xf2e1,0x115));var _0x1f2e=function(_0x4d9043,_0x13dadc){_0x4d9043=_0x4d9043-0x0;var _0xeae030=_0xf2e1[_0x4d9043];return _0xeae030;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0x1f2e('0x0'),'keyValue',_0x1f2e('0x1')),'defaultValue':_0x1f2e('0x2')},'content':{'type':Sequelize[_0x1f2e('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1f2e('0x4')](_0x1f2e('0x2'),_0x1f2e('0x5'),_0x1f2e('0x0'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1f2e('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1f2e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f2e('0x3')]}}; \ No newline at end of file +var _0x4271=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x51a38e,_0x13fa4f){var _0x49308d=function(_0x15d4a0){while(--_0x15d4a0){_0x51a38e['push'](_0x51a38e['shift']());}};_0x49308d(++_0x13fa4f);}(_0x4271,0x1c1));var _0x1427=function(_0x2ecc09,_0x39f700){_0x2ecc09=_0x2ecc09-0x0;var _0x384ff7=_0x4271[_0x2ecc09];return _0x384ff7;};'use strict';var Sequelize=require(_0x1427('0x0'));module['exports']={'type':{'type':Sequelize[_0x1427('0x1')](_0x1427('0x2'),_0x1427('0x3'),'customVariable',_0x1427('0x4'),_0x1427('0x5')),'defaultValue':_0x1427('0x2')},'content':{'type':Sequelize[_0x1427('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1427('0x1')]('string',_0x1427('0x3'),_0x1427('0x7'))},'keyContent':{'type':Sequelize[_0x1427('0x6')]},'idField':{'type':Sequelize[_0x1427('0x6')]},'nameField':{'type':Sequelize[_0x1427('0x6')]},'customField':{'type':Sequelize[_0x1427('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1427('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 09a9619..cb583b0 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 _0x06a4=['model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','update','then','error','stack','name','index','SugarcrmField','fieldName','type','key'];(function(_0x1eedbb,_0x20faa2){var _0x2e1030=function(_0x5d00b9){while(--_0x5d00b9){_0x1eedbb['push'](_0x1eedbb['shift']());}};_0x2e1030(++_0x20faa2);}(_0x06a4,0x1f2));var _0x406a=function(_0x572644,_0x543d79){_0x572644=_0x572644-0x0;var _0x17efa9=_0x06a4[_0x572644];return _0x17efa9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x406a('0x0'));var rp=require(_0x406a('0x1'));var moment=require(_0x406a('0x2'));var BPromise=require(_0x406a('0x3'));var Mustache=require(_0x406a('0x4'));var util=require(_0x406a('0x5'));var path=require(_0x406a('0x6'));var sox=require('sox');var csv=require(_0x406a('0x7'));var ejs=require(_0x406a('0x8'));var fs=require('fs');var fs_extra=require(_0x406a('0x9'));var _=require(_0x406a('0xa'));var squel=require(_0x406a('0xb'));var crypto=require(_0x406a('0xc'));var jsforce=require(_0x406a('0xd'));var deskjs=require(_0x406a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x406a('0xf'));var Papa=require(_0x406a('0x10'));var Redis=require('ioredis');var authService=require(_0x406a('0x11'));var qs=require(_0x406a('0x12'));var as=require(_0x406a('0x13'));var hardwareService=require(_0x406a('0x14'));var logger=require(_0x406a('0x15'))(_0x406a('0x16'));var utils=require(_0x406a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x406a('0x18'));var db=require(_0x406a('0x19'))['db'];function respondWithStatusCode(_0x352a2b,_0x28c884){_0x28c884=_0x28c884||0xcc;return function(_0x935c39){if(_0x935c39){return _0x352a2b[_0x406a('0x1a')](_0x28c884);}return _0x352a2b['status'](_0x28c884)[_0x406a('0x1b')]();};}function respondWithResult(_0x1bb6be,_0x2c86f6){_0x2c86f6=_0x2c86f6||0xc8;return function(_0x25edb4){if(_0x25edb4){return _0x1bb6be['status'](_0x2c86f6)[_0x406a('0x1c')](_0x25edb4);}};}function respondWithFilteredResult(_0x902852,_0x30e1b4){return function(_0x575147){if(_0x575147){var _0x3aa821=typeof _0x30e1b4[_0x406a('0x1d')]==='undefined'&&typeof _0x30e1b4[_0x406a('0x1e')]===_0x406a('0x1f');var _0x448a88=_0x575147[_0x406a('0x20')];var _0x59d3ed=_0x3aa821?0x0:_0x30e1b4[_0x406a('0x1d')];var _0x2f9304=_0x3aa821?_0x575147['count']:_0x30e1b4[_0x406a('0x1d')]+_0x30e1b4[_0x406a('0x1e')];var _0x1491a4;if(_0x2f9304>=_0x448a88){_0x2f9304=_0x448a88;_0x1491a4=0xc8;}else{_0x1491a4=0xce;}_0x902852[_0x406a('0x21')](_0x1491a4);return _0x902852[_0x406a('0x22')](_0x406a('0x23'),_0x59d3ed+'-'+_0x2f9304+'/'+_0x448a88)['json'](_0x575147);}return null;};}function patchUpdates(_0x39be60){return function(_0xc95a76){try{jsonpatch['apply'](_0xc95a76,_0x39be60,!![]);}catch(_0x3fc6b0){return BPromise[_0x406a('0x24')](_0x3fc6b0);}return _0xc95a76[_0x406a('0x25')]();};}function saveUpdates(_0xd24ae8,_0x5403da){return function(_0x418f43){if(_0x418f43){return _0x418f43[_0x406a('0x26')](_0xd24ae8)[_0x406a('0x27')](function(_0x5b66){return _0x5b66;});}return null;};}function removeEntity(_0x3d8a0e,_0x3957d2){return function(_0x47ba3a){if(_0x47ba3a){return _0x47ba3a['destroy']()[_0x406a('0x27')](function(){_0x3d8a0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x230362,_0x2b6e0a){return function(_0x3f62b1){if(!_0x3f62b1){_0x230362[_0x406a('0x1a')](0x194);}return _0x3f62b1;};}function handleError(_0xea86fb,_0x336eb9){_0x336eb9=_0x336eb9||0x1f4;return function(_0x41c6ba){logger[_0x406a('0x28')](_0x41c6ba[_0x406a('0x29')]);if(_0x41c6ba['name']){delete _0x41c6ba[_0x406a('0x2a')];}_0xea86fb[_0x406a('0x21')](_0x336eb9)['send'](_0x41c6ba);};}exports[_0x406a('0x2b')]=function(_0x3ce36c,_0x242a88){var _0xa07150={},_0x6ae423={},_0xf7ec68={'count':0x0,'rows':[]};var _0x1c7168=_['map'](db[_0x406a('0x2c')]['rawAttributes'],function(_0x5ecd8f){return{'name':_0x5ecd8f[_0x406a('0x2d')],'type':_0x5ecd8f[_0x406a('0x2e')][_0x406a('0x2f')]};});_0x6ae423[_0x406a('0x30')]=_[_0x406a('0x31')](_0x1c7168,_0x406a('0x2a'));_0x6ae423[_0x406a('0x32')]=_[_0x406a('0x33')](_0x3ce36c[_0x406a('0x32')]);_0x6ae423[_0x406a('0x34')]=_[_0x406a('0x35')](_0x6ae423[_0x406a('0x30')],_0x6ae423[_0x406a('0x32')]);_0xa07150['attributes']=_[_0x406a('0x35')](_0x6ae423[_0x406a('0x30')],qs['fields'](_0x3ce36c[_0x406a('0x32')][_0x406a('0x36')]));_0xa07150[_0x406a('0x37')]=_0xa07150[_0x406a('0x37')]['length']?_0xa07150[_0x406a('0x37')]:_0x6ae423[_0x406a('0x30')];if(!_0x3ce36c[_0x406a('0x32')][_0x406a('0x38')](_0x406a('0x39'))){_0xa07150[_0x406a('0x1e')]=qs[_0x406a('0x1e')](_0x3ce36c['query'][_0x406a('0x1e')]);_0xa07150[_0x406a('0x1d')]=qs[_0x406a('0x1d')](_0x3ce36c[_0x406a('0x32')][_0x406a('0x1d')]);}_0xa07150[_0x406a('0x3a')]=qs[_0x406a('0x3b')](_0x3ce36c[_0x406a('0x32')][_0x406a('0x3b')]);_0xa07150['where']=qs[_0x406a('0x34')](_[_0x406a('0x3c')](_0x3ce36c[_0x406a('0x32')],_0x6ae423['filters']),_0x1c7168);if(_0x3ce36c['query'][_0x406a('0x3d')]){_0xa07150[_0x406a('0x3e')]=_[_0x406a('0x3f')](_0xa07150['where'],{'$or':_[_0x406a('0x31')](_0x1c7168,function(_0x2ad539){if(_0x2ad539[_0x406a('0x2e')]!==_0x406a('0x40')){var _0x286762={};_0x286762[_0x2ad539['name']]={'$like':'%'+_0x3ce36c[_0x406a('0x32')][_0x406a('0x3d')]+'%'};return _0x286762;}})});}_0xa07150=_[_0x406a('0x3f')]({},_0xa07150,_0x3ce36c[_0x406a('0x41')]);var _0x1db536={'where':_0xa07150[_0x406a('0x3e')]};return db['SugarcrmField'][_0x406a('0x20')](_0x1db536)[_0x406a('0x27')](function(_0x277a1a){_0xf7ec68['count']=_0x277a1a;if(_0x3ce36c['query'][_0x406a('0x42')]){_0xa07150[_0x406a('0x43')]=[{'all':!![]}];}return db[_0x406a('0x2c')][_0x406a('0x44')](_0xa07150);})[_0x406a('0x27')](function(_0xd5ffc){_0xf7ec68[_0x406a('0x45')]=_0xd5ffc;return _0xf7ec68;})[_0x406a('0x27')](respondWithFilteredResult(_0x242a88,_0xa07150))['catch'](handleError(_0x242a88,null));};exports['show']=function(_0x1c19e0,_0x5a64f9){var _0x3d484d={'raw':!![],'where':{'id':_0x1c19e0[_0x406a('0x46')]['id']}},_0x3fb75c={};_0x3fb75c[_0x406a('0x30')]=_[_0x406a('0x33')](db[_0x406a('0x2c')][_0x406a('0x47')]);_0x3fb75c['query']=_['keys'](_0x1c19e0[_0x406a('0x32')]);_0x3fb75c[_0x406a('0x34')]=_[_0x406a('0x35')](_0x3fb75c[_0x406a('0x30')],_0x3fb75c[_0x406a('0x32')]);_0x3d484d['attributes']=_[_0x406a('0x35')](_0x3fb75c[_0x406a('0x30')],qs[_0x406a('0x36')](_0x1c19e0[_0x406a('0x32')][_0x406a('0x36')]));_0x3d484d[_0x406a('0x37')]=_0x3d484d[_0x406a('0x37')][_0x406a('0x48')]?_0x3d484d['attributes']:_0x3fb75c[_0x406a('0x30')];if(_0x1c19e0[_0x406a('0x32')][_0x406a('0x42')]){_0x3d484d['include']=[{'all':!![]}];}_0x3d484d=_[_0x406a('0x3f')]({},_0x3d484d,_0x1c19e0['options']);return db[_0x406a('0x2c')][_0x406a('0x49')](_0x3d484d)[_0x406a('0x27')](handleEntityNotFound(_0x5a64f9,null))[_0x406a('0x27')](respondWithResult(_0x5a64f9,null))[_0x406a('0x4a')](handleError(_0x5a64f9,null));};exports[_0x406a('0x4b')]=function(_0x230b55,_0x522cc5){return db[_0x406a('0x2c')][_0x406a('0x4b')](_0x230b55['body'],{})[_0x406a('0x27')](respondWithResult(_0x522cc5,0xc9))[_0x406a('0x4a')](handleError(_0x522cc5,null));};exports['update']=function(_0x474804,_0x3f6e0f){if(_0x474804['body']['id']){delete _0x474804['body']['id'];}return db[_0x406a('0x2c')]['find']({'where':{'id':_0x474804[_0x406a('0x46')]['id']}})[_0x406a('0x27')](handleEntityNotFound(_0x3f6e0f,null))[_0x406a('0x27')](saveUpdates(_0x474804[_0x406a('0x4c')],null))[_0x406a('0x27')](respondWithResult(_0x3f6e0f,null))[_0x406a('0x4a')](handleError(_0x3f6e0f,null));};exports[_0x406a('0x4d')]=function(_0x5c3db8,_0x206b0c){return db[_0x406a('0x2c')][_0x406a('0x49')]({'where':{'id':_0x5c3db8[_0x406a('0x46')]['id']}})[_0x406a('0x27')](handleEntityNotFound(_0x206b0c,null))[_0x406a('0x27')](removeEntity(_0x206b0c,null))[_0x406a('0x4a')](handleError(_0x206b0c,null));}; \ No newline at end of file +var _0xeb5b=['body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','include','find','create'];(function(_0x57767f,_0x1cf845){var _0x474012=function(_0x592bd5){while(--_0x592bd5){_0x57767f['push'](_0x57767f['shift']());}};_0x474012(++_0x1cf845);}(_0xeb5b,0xeb));var _0xbeb5=function(_0x180e76,_0x6b0954){_0x180e76=_0x180e76-0x0;var _0x4465a6=_0xeb5b[_0x180e76];return _0x4465a6;};'use strict';var emlformat=require(_0xbeb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbeb5('0x1'));var jsonpatch=require(_0xbeb5('0x2'));var rp=require('request-promise');var moment=require(_0xbeb5('0x3'));var BPromise=require(_0xbeb5('0x4'));var Mustache=require(_0xbeb5('0x5'));var util=require(_0xbeb5('0x6'));var path=require(_0xbeb5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbeb5('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb5('0x9'));var _=require(_0xbeb5('0xa'));var squel=require(_0xbeb5('0xb'));var crypto=require(_0xbeb5('0xc'));var jsforce=require(_0xbeb5('0xd'));var deskjs=require(_0xbeb5('0xe'));var toCsv=require(_0xbeb5('0xf'));var querystring=require(_0xbeb5('0x10'));var Papa=require(_0xbeb5('0x11'));var Redis=require(_0xbeb5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbeb5('0x13'));var as=require(_0xbeb5('0x14'));var hardwareService=require(_0xbeb5('0x15'));var logger=require(_0xbeb5('0x16'))(_0xbeb5('0x17'));var utils=require(_0xbeb5('0x18'));var config=require(_0xbeb5('0x19'));var licenseUtil=require(_0xbeb5('0x1a'));var db=require(_0xbeb5('0x1b'))['db'];function respondWithStatusCode(_0x2ccb83,_0x558500){_0x558500=_0x558500||0xcc;return function(_0x6b14b6){if(_0x6b14b6){return _0x2ccb83[_0xbeb5('0x1c')](_0x558500);}return _0x2ccb83[_0xbeb5('0x1d')](_0x558500)[_0xbeb5('0x1e')]();};}function respondWithResult(_0x16fc94,_0x34922d){_0x34922d=_0x34922d||0xc8;return function(_0x2dc58d){if(_0x2dc58d){return _0x16fc94['status'](_0x34922d)[_0xbeb5('0x1f')](_0x2dc58d);}};}function respondWithFilteredResult(_0x41be30,_0x1e6174){return function(_0x5ec694){if(_0x5ec694){var _0x52f2c8=typeof _0x1e6174[_0xbeb5('0x20')]===_0xbeb5('0x21')&&typeof _0x1e6174[_0xbeb5('0x22')]==='undefined';var _0xb51707=_0x5ec694[_0xbeb5('0x23')];var _0x311de4=_0x52f2c8?0x0:_0x1e6174[_0xbeb5('0x20')];var _0x4b303d=_0x52f2c8?_0x5ec694[_0xbeb5('0x23')]:_0x1e6174[_0xbeb5('0x20')]+_0x1e6174[_0xbeb5('0x22')];var _0x4b417a;if(_0x4b303d>=_0xb51707){_0x4b303d=_0xb51707;_0x4b417a=0xc8;}else{_0x4b417a=0xce;}_0x41be30[_0xbeb5('0x1d')](_0x4b417a);return _0x41be30[_0xbeb5('0x24')]('Content-Range',_0x311de4+'-'+_0x4b303d+'/'+_0xb51707)['json'](_0x5ec694);}return null;};}function patchUpdates(_0x3f274e){return function(_0x349cc8){try{jsonpatch[_0xbeb5('0x25')](_0x349cc8,_0x3f274e,!![]);}catch(_0x127816){return BPromise[_0xbeb5('0x26')](_0x127816);}return _0x349cc8['save']();};}function saveUpdates(_0x1f3bec,_0xd3387b){return function(_0x454fdf){if(_0x454fdf){return _0x454fdf[_0xbeb5('0x27')](_0x1f3bec)[_0xbeb5('0x28')](function(_0x533254){return _0x533254;});}return null;};}function removeEntity(_0x5f47ed,_0xc53995){return function(_0x19c0ee){if(_0x19c0ee){return _0x19c0ee[_0xbeb5('0x29')]()[_0xbeb5('0x28')](function(){_0x5f47ed[_0xbeb5('0x1d')](0xcc)[_0xbeb5('0x1e')]();});}};}function handleEntityNotFound(_0x4faf35,_0x4ebbf2){return function(_0x4e98fd){if(!_0x4e98fd){_0x4faf35[_0xbeb5('0x1c')](0x194);}return _0x4e98fd;};}function handleError(_0x138abd,_0x559e1d){_0x559e1d=_0x559e1d||0x1f4;return function(_0x15e81d){logger[_0xbeb5('0x2a')](_0x15e81d[_0xbeb5('0x2b')]);if(_0x15e81d['name']){delete _0x15e81d[_0xbeb5('0x2c')];}_0x138abd[_0xbeb5('0x1d')](_0x559e1d)['send'](_0x15e81d);};}exports['index']=function(_0x54f7b1,_0x614f6b){var _0x37659a={},_0x2a1bb7={},_0x286804={'count':0x0,'rows':[]};var _0xf5de1f=_[_0xbeb5('0x2d')](db[_0xbeb5('0x2e')][_0xbeb5('0x2f')],function(_0x3bee89){return{'name':_0x3bee89[_0xbeb5('0x30')],'type':_0x3bee89[_0xbeb5('0x31')][_0xbeb5('0x32')]};});_0x2a1bb7[_0xbeb5('0x33')]=_[_0xbeb5('0x2d')](_0xf5de1f,_0xbeb5('0x2c'));_0x2a1bb7[_0xbeb5('0x34')]=_[_0xbeb5('0x35')](_0x54f7b1[_0xbeb5('0x34')]);_0x2a1bb7[_0xbeb5('0x36')]=_[_0xbeb5('0x37')](_0x2a1bb7[_0xbeb5('0x33')],_0x2a1bb7[_0xbeb5('0x34')]);_0x37659a[_0xbeb5('0x38')]=_[_0xbeb5('0x37')](_0x2a1bb7[_0xbeb5('0x33')],qs[_0xbeb5('0x39')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x39')]));_0x37659a[_0xbeb5('0x38')]=_0x37659a[_0xbeb5('0x38')]['length']?_0x37659a['attributes']:_0x2a1bb7[_0xbeb5('0x33')];if(!_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x3a')](_0xbeb5('0x3b'))){_0x37659a[_0xbeb5('0x22')]=qs[_0xbeb5('0x22')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x22')]);_0x37659a['offset']=qs['offset'](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x20')]);}_0x37659a[_0xbeb5('0x3c')]=qs[_0xbeb5('0x3d')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x3d')]);_0x37659a[_0xbeb5('0x3e')]=qs[_0xbeb5('0x36')](_[_0xbeb5('0x3f')](_0x54f7b1[_0xbeb5('0x34')],_0x2a1bb7['filters']),_0xf5de1f);if(_0x54f7b1['query'][_0xbeb5('0x40')]){_0x37659a['where']=_['merge'](_0x37659a['where'],{'$or':_[_0xbeb5('0x2d')](_0xf5de1f,function(_0x5d12bc){if(_0x5d12bc[_0xbeb5('0x31')]!==_0xbeb5('0x41')){var _0xc2be2c={};_0xc2be2c[_0x5d12bc[_0xbeb5('0x2c')]]={'$like':'%'+_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x40')]+'%'};return _0xc2be2c;}})});}_0x37659a=_[_0xbeb5('0x42')]({},_0x37659a,_0x54f7b1[_0xbeb5('0x43')]);var _0x5de262={'where':_0x37659a['where']};return db[_0xbeb5('0x2e')]['count'](_0x5de262)[_0xbeb5('0x28')](function(_0x224a4b){_0x286804[_0xbeb5('0x23')]=_0x224a4b;if(_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x44')]){_0x37659a['include']=[{'all':!![]}];}return db[_0xbeb5('0x2e')]['findAll'](_0x37659a);})[_0xbeb5('0x28')](function(_0x49862b){_0x286804[_0xbeb5('0x45')]=_0x49862b;return _0x286804;})['then'](respondWithFilteredResult(_0x614f6b,_0x37659a))[_0xbeb5('0x46')](handleError(_0x614f6b,null));};exports[_0xbeb5('0x47')]=function(_0x1ddbcb,_0x496b12){var _0x521a5f={'raw':!![],'where':{'id':_0x1ddbcb[_0xbeb5('0x48')]['id']}},_0x18253b={};_0x18253b[_0xbeb5('0x33')]=_[_0xbeb5('0x35')](db[_0xbeb5('0x2e')]['rawAttributes']);_0x18253b[_0xbeb5('0x34')]=_[_0xbeb5('0x35')](_0x1ddbcb[_0xbeb5('0x34')]);_0x18253b['filters']=_['intersection'](_0x18253b[_0xbeb5('0x33')],_0x18253b['query']);_0x521a5f[_0xbeb5('0x38')]=_[_0xbeb5('0x37')](_0x18253b['model'],qs['fields'](_0x1ddbcb[_0xbeb5('0x34')]['fields']));_0x521a5f['attributes']=_0x521a5f[_0xbeb5('0x38')][_0xbeb5('0x49')]?_0x521a5f[_0xbeb5('0x38')]:_0x18253b[_0xbeb5('0x33')];if(_0x1ddbcb[_0xbeb5('0x34')][_0xbeb5('0x44')]){_0x521a5f[_0xbeb5('0x4a')]=[{'all':!![]}];}_0x521a5f=_[_0xbeb5('0x42')]({},_0x521a5f,_0x1ddbcb['options']);return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')](_0x521a5f)[_0xbeb5('0x28')](handleEntityNotFound(_0x496b12,null))[_0xbeb5('0x28')](respondWithResult(_0x496b12,null))['catch'](handleError(_0x496b12,null));};exports[_0xbeb5('0x4c')]=function(_0x97aea9,_0x300e16){return db[_0xbeb5('0x2e')][_0xbeb5('0x4c')](_0x97aea9[_0xbeb5('0x4d')],{})[_0xbeb5('0x28')](respondWithResult(_0x300e16,0xc9))[_0xbeb5('0x46')](handleError(_0x300e16,null));};exports[_0xbeb5('0x27')]=function(_0x58e38f,_0x49b92c){if(_0x58e38f[_0xbeb5('0x4d')]['id']){delete _0x58e38f[_0xbeb5('0x4d')]['id'];}return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')]({'where':{'id':_0x58e38f[_0xbeb5('0x48')]['id']}})[_0xbeb5('0x28')](handleEntityNotFound(_0x49b92c,null))['then'](saveUpdates(_0x58e38f['body'],null))['then'](respondWithResult(_0x49b92c,null))[_0xbeb5('0x46')](handleError(_0x49b92c,null));};exports[_0xbeb5('0x29')]=function(_0x1c0b11,_0x383c23){return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')]({'where':{'id':_0x1c0b11[_0xbeb5('0x48')]['id']}})[_0xbeb5('0x28')](handleEntityNotFound(_0x383c23,null))['then'](removeEntity(_0x383c23,null))[_0xbeb5('0x46')](handleError(_0x383c23,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cf4656b..04d8d82 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 _0xd142=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','api','moment','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports'];(function(_0x5a9d2b,_0x64b8b8){var _0x55a4a5=function(_0x589406){while(--_0x589406){_0x5a9d2b['push'](_0x5a9d2b['shift']());}};_0x55a4a5(++_0x64b8b8);}(_0xd142,0xef));var _0x2d14=function(_0x3cac61,_0x62fed0){_0x3cac61=_0x3cac61-0x0;var _0x570b82=_0xd142[_0x3cac61];return _0x570b82;};'use strict';var _=require('lodash');var util=require(_0x2d14('0x0'));var logger=require('../../config/logger')(_0x2d14('0x1'));var moment=require(_0x2d14('0x2'));var BPromise=require(_0x2d14('0x3'));var rp=require(_0x2d14('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d14('0x5'));var config=require('../../config/environment');var attributes=require(_0x2d14('0x6'));module[_0x2d14('0x7')]=function(_0x396415,_0x128f22){return _0x396415[_0x2d14('0x8')](_0x2d14('0x9'),attributes,{'tableName':_0x2d14('0xa'),'paranoid':![],'indexes':[{'name':_0x2d14('0xb'),'fields':['idField',_0x2d14('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc378=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x19c71e,_0x513c5b){var _0xf7df9b=function(_0x367349){while(--_0x367349){_0x19c71e['push'](_0x19c71e['shift']());}};_0xf7df9b(++_0x513c5b);}(_0xc378,0x166));var _0x8c37=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xc378[_0x183256];return _0x5394a2;};'use strict';var _=require(_0x8c37('0x0'));var util=require(_0x8c37('0x1'));var logger=require(_0x8c37('0x2'))(_0x8c37('0x3'));var moment=require(_0x8c37('0x4'));var BPromise=require(_0x8c37('0x5'));var rp=require(_0x8c37('0x6'));var fs=require('fs');var path=require(_0x8c37('0x7'));var rimraf=require(_0x8c37('0x8'));var config=require(_0x8c37('0x9'));var attributes=require(_0x8c37('0xa'));module[_0x8c37('0xb')]=function(_0x551d3d,_0x4d2375){return _0x551d3d[_0x8c37('0xc')](_0x8c37('0xd'),attributes,{'tableName':_0x8c37('0xe'),'paranoid':![],'indexes':[{'name':_0x8c37('0xf'),'fields':[_0x8c37('0x10'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 3767296..4f93f18 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 _0x7892=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x50d966,_0x2e9b8c){var _0x5393e9=function(_0x52e4fc){while(--_0x52e4fc){_0x50d966['push'](_0x50d966['shift']());}};_0x5393e9(++_0x2e9b8c);}(_0x7892,0x67));var _0x2789=function(_0x327d7a,_0x1b7157){_0x327d7a=_0x327d7a-0x0;var _0x3dfce7=_0x7892[_0x327d7a];return _0x3dfce7;};'use strict';var _=require(_0x2789('0x0'));var util=require(_0x2789('0x1'));var moment=require(_0x2789('0x2'));var BPromise=require(_0x2789('0x3'));var rs=require(_0x2789('0x4'));var fs=require('fs');var Redis=require(_0x2789('0x5'));var db=require(_0x2789('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2789('0x7'))(_0x2789('0x8'));var config=require(_0x2789('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4717,_0x43844a,_0x39b91a){return new BPromise(function(_0xf315e7,_0x335eb8){return client[_0x2789('0xa')](_0x3b4717,_0x39b91a)['then'](function(_0x4970bf){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x43844a,_0x2789('0xb'));logger[_0x2789('0xc')](_0x2789('0xd'),_0x43844a,_0x2789('0xb'),JSON[_0x2789('0xe')](_0x4970bf));if(_0x4970bf[_0x2789('0xf')]){if(_0x4970bf[_0x2789('0xf')][_0x2789('0x10')]===0x1f4){logger[_0x2789('0xf')](_0x2789('0x11'),_0x43844a,_0x4970bf[_0x2789('0xf')][_0x2789('0x12')]);return _0x335eb8(_0x4970bf['error']['message']);}logger[_0x2789('0xf')](_0x2789('0x11'),_0x43844a,_0x4970bf[_0x2789('0xf')][_0x2789('0x12')]);return _0xf315e7(_0x4970bf[_0x2789('0xf')]['message']);}else{logger['info'](_0x2789('0x11'),_0x43844a,'request\x20sent');_0xf315e7(_0x4970bf[_0x2789('0x13')][_0x2789('0x12')]);}})[_0x2789('0x14')](function(_0x1ef056){logger['error'](_0x2789('0x11'),_0x43844a,_0x1ef056);_0x335eb8(_0x1ef056);});});} \ No newline at end of file +var _0xf769=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xf769,0x74));var _0x9f76=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xf769[_0x2f57b2];return _0x5ace77;};'use strict';var _=require('lodash');var util=require(_0x9f76('0x0'));var moment=require(_0x9f76('0x1'));var BPromise=require(_0x9f76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f76('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f76('0x4'))(_0x9f76('0x5'));var config=require(_0x9f76('0x6'));var jayson=require(_0x9f76('0x7'));var client=jayson[_0x9f76('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7bb0,_0x34da6e,_0x368e9a){return new BPromise(function(_0x46fa95,_0x213074){return client['request'](_0x4a7bb0,_0x368e9a)[_0x9f76('0x9')](function(_0x407376){logger[_0x9f76('0xa')](_0x9f76('0xb'),_0x34da6e,_0x9f76('0xc'));logger[_0x9f76('0xd')](_0x9f76('0xe'),_0x34da6e,_0x9f76('0xc'),JSON[_0x9f76('0xf')](_0x407376));if(_0x407376[_0x9f76('0x10')]){if(_0x407376[_0x9f76('0x10')][_0x9f76('0x11')]===0x1f4){logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);return _0x213074(_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);}logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);return _0x46fa95(_0x407376['error'][_0x9f76('0x12')]);}else{logger[_0x9f76('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x34da6e,_0x9f76('0xc'));_0x46fa95(_0x407376[_0x9f76('0x13')]['message']);}})['catch'](function(_0x2fd9a5){logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x2fd9a5);_0x213074(_0x2fd9a5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 49b0d73..6bb56f1 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 _0xac8b=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b932c,_0x13e10b){var _0x253ff9=function(_0x5b3136){while(--_0x5b3136){_0x5b932c['push'](_0x5b932c['shift']());}};_0x253ff9(++_0x13e10b);}(_0xac8b,0x1c2));var _0xbac8=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xac8b[_0x1abb09];return _0xea1c07;};'use strict';var multer=require('multer');var util=require(_0xbac8('0x0'));var path=require(_0xbac8('0x1'));var timeout=require('connect-timeout');var express=require(_0xbac8('0x2'));var router=express[_0xbac8('0x3')]();var fs_extra=require(_0xbac8('0x4'));var auth=require(_0xbac8('0x5'));var interaction=require(_0xbac8('0x6'));var config=require(_0xbac8('0x7'));var controller=require(_0xbac8('0x8'));router[_0xbac8('0x9')]('/',auth[_0xbac8('0xa')](),controller[_0xbac8('0xb')]);router[_0xbac8('0x9')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller['show']);router[_0xbac8('0x9')](_0xbac8('0xd'),auth[_0xbac8('0xa')](),controller[_0xbac8('0xe')]);router[_0xbac8('0x9')](_0xbac8('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xbac8('0x10')]('/',auth['isAuthenticated'](),controller[_0xbac8('0x11')]);router[_0xbac8('0x10')](_0xbac8('0xd'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x12')]);router[_0xbac8('0x13')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x14')]);router[_0xbac8('0x15')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x16')]);module[_0xbac8('0x17')]=router; \ No newline at end of file +var _0x8aaa=['get','index','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x4be251,_0x2b3902){var _0x360a46=function(_0x3b3b02){while(--_0x3b3b02){_0x4be251['push'](_0x4be251['shift']());}};_0x360a46(++_0x2b3902);}(_0x8aaa,0x64));var _0xa8aa=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x8aaa[_0x30f07a];return _0xb38461;};'use strict';var multer=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var path=require(_0xa8aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8aa('0x3'));var router=express[_0xa8aa('0x4')]();var fs_extra=require(_0xa8aa('0x5'));var auth=require(_0xa8aa('0x6'));var interaction=require(_0xa8aa('0x7'));var config=require(_0xa8aa('0x8'));var controller=require(_0xa8aa('0x9'));router[_0xa8aa('0xa')]('/',auth['isAuthenticated'](),controller[_0xa8aa('0xb')]);router['get']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xd')]);router['get'](_0xa8aa('0xe'),auth[_0xa8aa('0xc')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xf')]);router[_0xa8aa('0x10')]('/',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x11')]);router[_0xa8aa('0x10')](_0xa8aa('0xe'),auth['isAuthenticated'](),controller[_0xa8aa('0x12')]);router['put'](_0xa8aa('0x13'),auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x14')]);router['delete']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 429c60d..53700c1 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 _0x95b0=['exports','STRING','HelpDesk','sequelize'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x95b0,0x157));var _0x095b=function(_0x41c236,_0x121047){_0x41c236=_0x41c236-0x0;var _0x370d59=_0x95b0[_0x41c236];return _0x370d59;};'use strict';var Sequelize=require(_0x095b('0x0'));module[_0x095b('0x1')]={'name':{'type':Sequelize[_0x095b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x095b('0x2')]},'username':{'type':Sequelize[_0x095b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x095b('0x2')],'allowNull':![],'defaultValue':_0x095b('0x3')},'remoteUri':{'type':Sequelize[_0x095b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x095b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x095b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xce0a=['sequelize','exports','STRING'];(function(_0x13a4bf,_0x56cb27){var _0x2933d6=function(_0x4a966f){while(--_0x4a966f){_0x13a4bf['push'](_0x13a4bf['shift']());}};_0x2933d6(++_0x56cb27);}(_0xce0a,0xcc));var _0xace0=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0xce0a[_0x529059];return _0x156bc2;};'use strict';var Sequelize=require(_0xace0('0x0'));module[_0xace0('0x1')]={'name':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xace0('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xace0('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 d719885..fa9d329 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 _0xe77b=['lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','end','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','result','token','describe','autogenerated','reference','owner','remove','includes','false','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra'];(function(_0x2c8cf7,_0x43b1fa){var _0x56c530=function(_0x64cb23){while(--_0x64cb23){_0x2c8cf7['push'](_0x2c8cf7['shift']());}};_0x56c530(++_0x43b1fa);}(_0xe77b,0x147));var _0xbe77=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe77b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe77('0x0'));var zipdir=require(_0xbe77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe77('0x2'));var moment=require(_0xbe77('0x3'));var BPromise=require(_0xbe77('0x4'));var Mustache=require('mustache');var util=require(_0xbe77('0x5'));var path=require('path');var sox=require(_0xbe77('0x6'));var csv=require(_0xbe77('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe77('0x8'));var _=require(_0xbe77('0x9'));var squel=require('squel');var crypto=require(_0xbe77('0xa'));var jsforce=require(_0xbe77('0xb'));var deskjs=require(_0xbe77('0xc'));var toCsv=require(_0xbe77('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbe77('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbe77('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe77('0xf'));var logger=require(_0xbe77('0x10'))(_0xbe77('0x11'));var utils=require(_0xbe77('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbe77('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbe77('0x14'));function respondWithStatusCode(_0x2f608a,_0xf0a642){_0xf0a642=_0xf0a642||0xcc;return function(_0x453e97){if(_0x453e97){return _0x2f608a['sendStatus'](_0xf0a642);}return _0x2f608a[_0xbe77('0x15')](_0xf0a642)['end']();};}function respondWithResult(_0x10659f,_0x9e1023){_0x9e1023=_0x9e1023||0xc8;return function(_0x216746){if(_0x216746){return _0x10659f[_0xbe77('0x15')](_0x9e1023)['json'](_0x216746);}};}function respondWithFilteredResult(_0x56b0aa,_0x34f778){return function(_0x3039ca){if(_0x3039ca){var _0x14f7a3=typeof _0x34f778['offset']===_0xbe77('0x16')&&typeof _0x34f778[_0xbe77('0x17')]==='undefined';var _0x447fd5=_0x3039ca[_0xbe77('0x18')];var _0x17e644=_0x14f7a3?0x0:_0x34f778[_0xbe77('0x19')];var _0x2ddac9=_0x14f7a3?_0x3039ca['count']:_0x34f778['offset']+_0x34f778['limit'];var _0x2d6136;if(_0x2ddac9>=_0x447fd5){_0x2ddac9=_0x447fd5;_0x2d6136=0xc8;}else{_0x2d6136=0xce;}_0x56b0aa[_0xbe77('0x15')](_0x2d6136);return _0x56b0aa[_0xbe77('0x1a')](_0xbe77('0x1b'),_0x17e644+'-'+_0x2ddac9+'/'+_0x447fd5)['json'](_0x3039ca);}return null;};}function patchUpdates(_0x3fd328){return function(_0xca48f){try{jsonpatch[_0xbe77('0x1c')](_0xca48f,_0x3fd328,!![]);}catch(_0x54324f){return BPromise['reject'](_0x54324f);}return _0xca48f['save']();};}function saveUpdates(_0x48c259,_0x42c28c){return function(_0x1ccf83){if(_0x1ccf83){return _0x1ccf83['update'](_0x48c259)[_0xbe77('0x1d')](function(_0x4ac276){return _0x4ac276;});}return null;};}function removeEntity(_0x3ef429,_0x427640){return function(_0x3942e6){if(_0x3942e6){return _0x3942e6[_0xbe77('0x1e')]()[_0xbe77('0x1d')](function(){_0x3ef429['status'](0xcc)[_0xbe77('0x1f')]();});}};}function handleEntityNotFound(_0x10449a,_0x5cad4b){return function(_0x3f2955){if(!_0x3f2955){_0x10449a[_0xbe77('0x20')](0x194);}return _0x3f2955;};}function handleError(_0x2c350f,_0x1427e7){_0x1427e7=_0x1427e7||0x1f4;return function(_0x47d288){logger[_0xbe77('0x21')](_0x47d288[_0xbe77('0x22')]);if(_0x47d288['name']){delete _0x47d288[_0xbe77('0x23')];}_0x2c350f['status'](_0x1427e7)[_0xbe77('0x24')](_0x47d288);};}exports[_0xbe77('0x25')]=function(_0x2d735b,_0x356c76){var _0x5c376a={},_0x173b0c={},_0x48a719={'count':0x0,'rows':[]};var _0x562757=_[_0xbe77('0x26')](db[_0xbe77('0x27')][_0xbe77('0x28')],function(_0xebbd7a){return{'name':_0xebbd7a[_0xbe77('0x29')],'type':_0xebbd7a['type']['key']};});_0x173b0c[_0xbe77('0x2a')]=_[_0xbe77('0x26')](_0x562757,'name');_0x173b0c[_0xbe77('0x2b')]=_[_0xbe77('0x2c')](_0x2d735b['query']);_0x173b0c[_0xbe77('0x2d')]=_[_0xbe77('0x2e')](_0x173b0c[_0xbe77('0x2a')],_0x173b0c[_0xbe77('0x2b')]);_0x5c376a[_0xbe77('0x2f')]=_[_0xbe77('0x2e')](_0x173b0c[_0xbe77('0x2a')],qs['fields'](_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x30')]));_0x5c376a[_0xbe77('0x2f')]=_0x5c376a[_0xbe77('0x2f')][_0xbe77('0x31')]?_0x5c376a[_0xbe77('0x2f')]:_0x173b0c[_0xbe77('0x2a')];if(!_0x2d735b['query']['hasOwnProperty'](_0xbe77('0x32'))){_0x5c376a['limit']=qs['limit'](_0x2d735b['query'][_0xbe77('0x17')]);_0x5c376a[_0xbe77('0x19')]=qs['offset'](_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x19')]);}_0x5c376a[_0xbe77('0x33')]=qs[_0xbe77('0x34')](_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x34')]);_0x5c376a[_0xbe77('0x35')]=qs[_0xbe77('0x2d')](_[_0xbe77('0x36')](_0x2d735b['query'],_0x173b0c[_0xbe77('0x2d')]),_0x562757);if(_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x37')]){_0x5c376a['where']=_['merge'](_0x5c376a['where'],{'$or':_[_0xbe77('0x26')](_0x562757,function(_0x3edf6c){if(_0x3edf6c[_0xbe77('0x38')]!==_0xbe77('0x39')){var _0x58558b={};_0x58558b[_0x3edf6c[_0xbe77('0x23')]]={'$like':'%'+_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x37')]+'%'};return _0x58558b;}})});}_0x5c376a=_[_0xbe77('0x3a')]({},_0x5c376a,_0x2d735b[_0xbe77('0x3b')]);var _0x76f6b5={'where':_0x5c376a[_0xbe77('0x35')]};return db[_0xbe77('0x27')][_0xbe77('0x18')](_0x76f6b5)[_0xbe77('0x1d')](function(_0x4b669c){_0x48a719['count']=_0x4b669c;if(_0x2d735b[_0xbe77('0x2b')][_0xbe77('0x3c')]){_0x5c376a[_0xbe77('0x3d')]=[{'all':!![]}];}return db[_0xbe77('0x27')][_0xbe77('0x3e')](_0x5c376a);})[_0xbe77('0x1d')](function(_0x53629b){_0x48a719[_0xbe77('0x3f')]=_0x53629b;return _0x48a719;})[_0xbe77('0x1d')](respondWithFilteredResult(_0x356c76,_0x5c376a))[_0xbe77('0x40')](handleError(_0x356c76,null));};exports['show']=function(_0x549bf7,_0x84ff77){var _0x5e1ce9={'raw':![],'where':{'id':_0x549bf7[_0xbe77('0x41')]['id']}},_0x17d0e2={};_0x17d0e2[_0xbe77('0x2a')]=_[_0xbe77('0x2c')](db[_0xbe77('0x27')]['rawAttributes']);_0x17d0e2['query']=_[_0xbe77('0x2c')](_0x549bf7[_0xbe77('0x2b')]);_0x17d0e2[_0xbe77('0x2d')]=_['intersection'](_0x17d0e2['model'],_0x17d0e2[_0xbe77('0x2b')]);_0x5e1ce9[_0xbe77('0x2f')]=_[_0xbe77('0x2e')](_0x17d0e2[_0xbe77('0x2a')],qs[_0xbe77('0x30')](_0x549bf7[_0xbe77('0x2b')][_0xbe77('0x30')]));_0x5e1ce9[_0xbe77('0x2f')]=_0x5e1ce9[_0xbe77('0x2f')][_0xbe77('0x31')]?_0x5e1ce9['attributes']:_0x17d0e2[_0xbe77('0x2a')];if(_0x549bf7[_0xbe77('0x2b')][_0xbe77('0x3c')]){_0x5e1ce9[_0xbe77('0x3d')]=[{'all':!![]}];}_0x5e1ce9=_[_0xbe77('0x3a')]({},_0x5e1ce9,_0x549bf7['options']);return db[_0xbe77('0x27')]['find'](_0x5e1ce9)[_0xbe77('0x1d')](handleEntityNotFound(_0x84ff77,null))[_0xbe77('0x1d')](respondWithResult(_0x84ff77,null))['catch'](handleError(_0x84ff77,null));};exports[_0xbe77('0x42')]=function(_0x659977,_0xf8ed68){return db[_0xbe77('0x27')][_0xbe77('0x42')](_0x659977[_0xbe77('0x43')],{})[_0xbe77('0x1d')](respondWithResult(_0xf8ed68,0xc9))[_0xbe77('0x40')](handleError(_0xf8ed68,null));};exports[_0xbe77('0x44')]=function(_0xc0d5f9,_0x56fa2a){if(_0xc0d5f9[_0xbe77('0x43')]['id']){delete _0xc0d5f9[_0xbe77('0x43')]['id'];}return db[_0xbe77('0x27')]['find']({'where':{'id':_0xc0d5f9[_0xbe77('0x41')]['id']}})[_0xbe77('0x1d')](handleEntityNotFound(_0x56fa2a,null))[_0xbe77('0x1d')](saveUpdates(_0xc0d5f9[_0xbe77('0x43')],null))[_0xbe77('0x1d')](respondWithResult(_0x56fa2a,null))[_0xbe77('0x40')](handleError(_0x56fa2a,null));};exports[_0xbe77('0x1e')]=function(_0x1f2155,_0x128e7a){return db[_0xbe77('0x27')][_0xbe77('0x45')]({'where':{'id':_0x1f2155[_0xbe77('0x41')]['id']}})[_0xbe77('0x1d')](handleEntityNotFound(_0x128e7a,null))[_0xbe77('0x1d')](removeEntity(_0x128e7a,null))[_0xbe77('0x40')](handleError(_0x128e7a,null));};exports[_0xbe77('0x46')]=function(_0x41cec9,_0x17e508,_0x1b483e){var _0x13fb94={};var _0x52724e={};var _0xf7d571;var _0x11a604;return db[_0xbe77('0x27')][_0xbe77('0x47')]({'where':{'id':_0x41cec9[_0xbe77('0x41')]['id']}})['then'](handleEntityNotFound(_0x17e508,null))['then'](function(_0x5c5426){if(_0x5c5426){_0xf7d571=_0x5c5426;_0x52724e[_0xbe77('0x2a')]=_[_0xbe77('0x2c')](db[_0xbe77('0x48')][_0xbe77('0x28')]);_0x52724e['query']=_['keys'](_0x41cec9[_0xbe77('0x2b')]);_0x52724e[_0xbe77('0x2d')]=_[_0xbe77('0x2e')](_0x52724e[_0xbe77('0x2a')],_0x52724e['query']);_0x13fb94['attributes']=_[_0xbe77('0x2e')](_0x52724e[_0xbe77('0x2a')],qs[_0xbe77('0x30')](_0x41cec9['query'][_0xbe77('0x30')]));_0x13fb94[_0xbe77('0x2f')]=_0x13fb94[_0xbe77('0x2f')][_0xbe77('0x31')]?_0x13fb94[_0xbe77('0x2f')]:_0x52724e[_0xbe77('0x2a')];_0x13fb94[_0xbe77('0x33')]=qs[_0xbe77('0x34')](_0x41cec9[_0xbe77('0x2b')][_0xbe77('0x34')]);_0x13fb94[_0xbe77('0x35')]=qs[_0xbe77('0x2d')](_[_0xbe77('0x36')](_0x41cec9[_0xbe77('0x2b')],_0x52724e[_0xbe77('0x2d')]));if(_0x41cec9[_0xbe77('0x2b')][_0xbe77('0x37')]){_0x13fb94[_0xbe77('0x35')]=_[_0xbe77('0x3a')](_0x13fb94[_0xbe77('0x35')],{'$or':_[_0xbe77('0x26')](_0x13fb94[_0xbe77('0x2f')],function(_0x44d14f){var _0x4f79a3={};_0x4f79a3[_0x44d14f]={'$like':'%'+_0x41cec9['query']['filter']+'%'};return _0x4f79a3;})});}_0x13fb94=_[_0xbe77('0x3a')]({},_0x13fb94,_0x41cec9['options']);return _0xf7d571[_0xbe77('0x46')](_0x13fb94);}})['then'](function(_0x58080d){if(_0x58080d){_0x11a604=_0x58080d[_0xbe77('0x31')];if(!_0x41cec9[_0xbe77('0x2b')]['hasOwnProperty'](_0xbe77('0x32'))){_0x13fb94[_0xbe77('0x17')]=qs[_0xbe77('0x17')](_0x41cec9[_0xbe77('0x2b')]['limit']);_0x13fb94[_0xbe77('0x19')]=qs[_0xbe77('0x19')](_0x41cec9[_0xbe77('0x2b')]['offset']);}return _0xf7d571[_0xbe77('0x46')](_0x13fb94);}})[_0xbe77('0x1d')](function(_0x210471){if(_0x210471){return _0x210471?{'count':_0x11a604,'rows':_0x210471}:null;}})[_0xbe77('0x1d')](respondWithResult(_0x17e508,null))[_0xbe77('0x40')](handleError(_0x17e508,null));};exports[_0xbe77('0x49')]=function(_0x46ca0b,_0x358963,_0x1b2f15){if(_0x46ca0b[_0xbe77('0x43')]['id']){delete _0x46ca0b[_0xbe77('0x43')]['id'];}return db[_0xbe77('0x27')][_0xbe77('0x47')]({'where':{'id':_0x46ca0b['params']['id']}})[_0xbe77('0x1d')](handleEntityNotFound(_0x358963,null))[_0xbe77('0x1d')](function(_0x525dbe){if(_0x525dbe){_0x46ca0b[_0xbe77('0x43')][_0xbe77('0x4a')]=_0x525dbe['id'];_0x46ca0b['body'][_0xbe77('0x4b')]=integrations['getSubjects'](_0x46ca0b[_0xbe77('0x43')][_0xbe77('0x4c')],_0x46ca0b[_0xbe77('0x43')]['type']);_0x46ca0b[_0xbe77('0x43')][_0xbe77('0x4d')]=integrations['getDescriptions'](_0x46ca0b[_0xbe77('0x43')]['channel'],_0x46ca0b[_0xbe77('0x43')][_0xbe77('0x38')]);return db[_0xbe77('0x48')][_0xbe77('0x42')](_0x46ca0b[_0xbe77('0x43')],{'include':[{'model':db['VtigerField'],'as':_0xbe77('0x4b')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xbe77('0x1d')](respondWithResult(_0x358963,null))['catch'](handleError(_0x358963,null));};var md5=require(_0xbe77('0x4e'));exports[_0xbe77('0x4f')]=function(_0x281c45,_0x1be3ad,_0x32c542){var _0x36009e=null;var _0x5f5369=null;var _0xcf9727=null;var _0x19c3d8=null;var _0x12b86a='';return db[_0xbe77('0x27')]['findOne']({'where':{'id':_0x281c45[_0xbe77('0x41')]['id']},'attributes':['id',_0xbe77('0x23'),_0xbe77('0x50'),_0xbe77('0x51'),_0xbe77('0x52'),'remoteUri',_0xbe77('0x53'),'accessKey']})[_0xbe77('0x1d')](handleEntityNotFound(_0x1be3ad,null))[_0xbe77('0x1d')](function(_0x28ac93){if(_0x28ac93){_0x36009e=_0x28ac93['username'];_0x5f5369=_0x28ac93[_0xbe77('0x54')];_0xcf9727=_0x28ac93[_0xbe77('0x52')];_0x12b86a=_0x28ac93[_0xbe77('0x55')];var _0x586a7f=_0x12b86a[_0xbe77('0x56')](-0x1);if(_0x586a7f==='/'){_0x12b86a=_0x12b86a[_0xbe77('0x57')](0x0,_0x12b86a[_0xbe77('0x58')](_0x586a7f));}_0x19c3d8=util[_0xbe77('0x59')](_0xbe77('0x5a'),_0x12b86a);var _0x134446={'method':_0xbe77('0x5b'),'uri':_0x19c3d8,'qs':{'operation':_0xbe77('0x5c'),'username':_0x28ac93[_0xbe77('0x50')]},'json':!![]};return rp(_0x134446);}})['then'](function(_0x111b95){if(_0x111b95['success']){var _0x1789a5={'method':_0xbe77('0x5d'),'uri':_0x19c3d8,'form':{'operation':'login','username':_0x36009e,'accessKey':md5(_0x111b95[_0xbe77('0x5e')][_0xbe77('0x5f')]+_0x5f5369)},'json':!![]};return rp(_0x1789a5);}})[_0xbe77('0x1d')](function(_0x473d21){if(_0x473d21['success']){var _0x5cf35b={'method':_0xbe77('0x5b'),'uri':_0x19c3d8,'qs':{'operation':_0xbe77('0x60'),'username':_0x36009e,'sessionName':_0x473d21[_0xbe77('0x5e')]['sessionName'],'elementType':_0xcf9727},'json':!![]};return rp(_0x5cf35b);}})['then'](function(_0x4318dc){if(_0x4318dc['success']){var _0x505818=[_0xbe77('0x61'),_0xbe77('0x62'),_0xbe77('0x63')];_[_0xbe77('0x64')](_0x4318dc[_0xbe77('0x5e')]['fields'],function(_0x4965d0){return _0x505818[_0xbe77('0x65')](_0x4965d0['type'][_0xbe77('0x23')]);});_['remove'](_0x4318dc[_0xbe77('0x5e')]['fields'],function(_0x4dd80f){return _0x4dd80f['editable']===_0xbe77('0x66');});return{'count':_0x4318dc[_0xbe77('0x5e')][_0xbe77('0x30')][_0xbe77('0x31')],'rows':_[_0xbe77('0x26')](_0x4318dc[_0xbe77('0x5e')]['fields'],function(_0x555669){return{'id':_0x555669['name'],'name':_0x555669[_0xbe77('0x67')],'custom':_['startsWith'](_0x555669['name'],'cf_')?!![]:![],'options':_0x555669[_0xbe77('0x38')][_0xbe77('0x23')]===_0xbe77('0x68')&&_0x555669['type']['picklistValues']['length']>0x0?_[_0xbe77('0x26')](_0x555669[_0xbe77('0x38')][_0xbe77('0x69')],function(_0x382a1b){return{'name':_0x382a1b[_0xbe77('0x67')],'value':_0x382a1b[_0xbe77('0x6a')]};}):[]};})};}})[_0xbe77('0x1d')](respondWithResult(_0x1be3ad,null))[_0xbe77('0x40')](function(_0x366590){console[_0xbe77('0x6b')](_0xbe77('0x6c')+_0x366590);var _0x5090f6=_0x281c45[_0xbe77('0x2b')]['test']?0x1f4:_0x366590['statusCode']||0x1f4;logger['error'](_0xbe77('0x6d'),_0xbe77('0x4f'),_0x5090f6,JSON['stringify'](_0x366590));delete _0x366590[_0xbe77('0x23')];if(_0x5090f6===0x191){_0x5090f6=0x190;}_0x1be3ad[_0xbe77('0x15')](_0x5090f6)['send'](_0x281c45[_0xbe77('0x2b')][_0xbe77('0x6e')]?{'message':_0xbe77('0x6f'),'statusCode':_0x366590['statusCode']}:_0x366590);});}; \ No newline at end of file +var _0x8c5a=['apply','reject','save','then','sendStatus','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','destroy','findOne','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','getFields','description','remoteUri','accessKey','username','slice','substring','format','getchallenge','POST','login','result','token','success','includes','remove','editable','false','label','startsWith','cf_','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x8c5a,0x13c));var _0xa8c5=function(_0x298c8d,_0x3aa00b){_0x298c8d=_0x298c8d-0x0;var _0x178e04=_0x8c5a[_0x298c8d];return _0x178e04;};'use strict';var emlformat=require(_0xa8c5('0x0'));var rimraf=require(_0xa8c5('0x1'));var zipdir=require(_0xa8c5('0x2'));var jsonpatch=require(_0xa8c5('0x3'));var rp=require('request-promise');var moment=require(_0xa8c5('0x4'));var BPromise=require(_0xa8c5('0x5'));var Mustache=require(_0xa8c5('0x6'));var util=require(_0xa8c5('0x7'));var path=require(_0xa8c5('0x8'));var sox=require('sox');var csv=require(_0xa8c5('0x9'));var ejs=require(_0xa8c5('0xa'));var fs=require('fs');var fs_extra=require(_0xa8c5('0xb'));var _=require(_0xa8c5('0xc'));var squel=require('squel');var crypto=require(_0xa8c5('0xd'));var jsforce=require(_0xa8c5('0xe'));var deskjs=require(_0xa8c5('0xf'));var toCsv=require(_0xa8c5('0x9'));var querystring=require(_0xa8c5('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8c5('0x11'));var authService=require(_0xa8c5('0x12'));var qs=require(_0xa8c5('0x13'));var as=require(_0xa8c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa8c5('0x15'));var config=require(_0xa8c5('0x16'));var licenseUtil=require(_0xa8c5('0x17'));var db=require(_0xa8c5('0x18'))['db'];var integrations=require(_0xa8c5('0x19'));function respondWithStatusCode(_0x32eaf6,_0x504ba9){_0x504ba9=_0x504ba9||0xcc;return function(_0x3ab757){if(_0x3ab757){return _0x32eaf6['sendStatus'](_0x504ba9);}return _0x32eaf6['status'](_0x504ba9)[_0xa8c5('0x1a')]();};}function respondWithResult(_0x14c8a7,_0x184e61){_0x184e61=_0x184e61||0xc8;return function(_0x1a8f84){if(_0x1a8f84){return _0x14c8a7[_0xa8c5('0x1b')](_0x184e61)['json'](_0x1a8f84);}};}function respondWithFilteredResult(_0x2af8d8,_0x4a5b53){return function(_0x553249){if(_0x553249){var _0x1f660c=typeof _0x4a5b53[_0xa8c5('0x1c')]===_0xa8c5('0x1d')&&typeof _0x4a5b53[_0xa8c5('0x1e')]===_0xa8c5('0x1d');var _0x259cc8=_0x553249[_0xa8c5('0x1f')];var _0x42c4bd=_0x1f660c?0x0:_0x4a5b53['offset'];var _0x3f0660=_0x1f660c?_0x553249[_0xa8c5('0x1f')]:_0x4a5b53['offset']+_0x4a5b53[_0xa8c5('0x1e')];var _0x3e0c5c;if(_0x3f0660>=_0x259cc8){_0x3f0660=_0x259cc8;_0x3e0c5c=0xc8;}else{_0x3e0c5c=0xce;}_0x2af8d8['status'](_0x3e0c5c);return _0x2af8d8[_0xa8c5('0x20')](_0xa8c5('0x21'),_0x42c4bd+'-'+_0x3f0660+'/'+_0x259cc8)[_0xa8c5('0x22')](_0x553249);}return null;};}function patchUpdates(_0xf7634){return function(_0x273558){try{jsonpatch[_0xa8c5('0x23')](_0x273558,_0xf7634,!![]);}catch(_0x55f318){return BPromise[_0xa8c5('0x24')](_0x55f318);}return _0x273558[_0xa8c5('0x25')]();};}function saveUpdates(_0xfa75b0,_0x475ee1){return function(_0x3815eb){if(_0x3815eb){return _0x3815eb['update'](_0xfa75b0)[_0xa8c5('0x26')](function(_0x3dedc0){return _0x3dedc0;});}return null;};}function removeEntity(_0x5b1cfd,_0x5add14){return function(_0x168eb2){if(_0x168eb2){return _0x168eb2['destroy']()[_0xa8c5('0x26')](function(){_0x5b1cfd[_0xa8c5('0x1b')](0xcc)[_0xa8c5('0x1a')]();});}};}function handleEntityNotFound(_0x4f0429,_0x245468){return function(_0x305e97){if(!_0x305e97){_0x4f0429[_0xa8c5('0x27')](0x194);}return _0x305e97;};}function handleError(_0x415680,_0xe170ab){_0xe170ab=_0xe170ab||0x1f4;return function(_0x1881de){logger[_0xa8c5('0x28')](_0x1881de[_0xa8c5('0x29')]);if(_0x1881de[_0xa8c5('0x2a')]){delete _0x1881de[_0xa8c5('0x2a')];}_0x415680[_0xa8c5('0x1b')](_0xe170ab)[_0xa8c5('0x2b')](_0x1881de);};}exports[_0xa8c5('0x2c')]=function(_0x1d5fed,_0xc5a9c1){var _0x28934d={},_0x2bc6b8={},_0x27f526={'count':0x0,'rows':[]};var _0x523891=_['map'](db[_0xa8c5('0x2d')][_0xa8c5('0x2e')],function(_0x318dc0){return{'name':_0x318dc0[_0xa8c5('0x2f')],'type':_0x318dc0[_0xa8c5('0x30')]['key']};});_0x2bc6b8[_0xa8c5('0x31')]=_[_0xa8c5('0x32')](_0x523891,_0xa8c5('0x2a'));_0x2bc6b8[_0xa8c5('0x33')]=_['keys'](_0x1d5fed['query']);_0x2bc6b8[_0xa8c5('0x34')]=_[_0xa8c5('0x35')](_0x2bc6b8[_0xa8c5('0x31')],_0x2bc6b8['query']);_0x28934d[_0xa8c5('0x36')]=_['intersection'](_0x2bc6b8[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x37')]));_0x28934d[_0xa8c5('0x36')]=_0x28934d[_0xa8c5('0x36')][_0xa8c5('0x38')]?_0x28934d[_0xa8c5('0x36')]:_0x2bc6b8[_0xa8c5('0x31')];if(!_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x39')](_0xa8c5('0x3a'))){_0x28934d['limit']=qs[_0xa8c5('0x1e')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x1e')]);_0x28934d['offset']=qs['offset'](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x1c')]);}_0x28934d[_0xa8c5('0x3b')]=qs[_0xa8c5('0x3c')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x3c')]);_0x28934d['where']=qs[_0xa8c5('0x34')](_[_0xa8c5('0x3d')](_0x1d5fed['query'],_0x2bc6b8[_0xa8c5('0x34')]),_0x523891);if(_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x3e')]){_0x28934d[_0xa8c5('0x3f')]=_[_0xa8c5('0x40')](_0x28934d[_0xa8c5('0x3f')],{'$or':_[_0xa8c5('0x32')](_0x523891,function(_0x4705f1){if(_0x4705f1[_0xa8c5('0x30')]!==_0xa8c5('0x41')){var _0x256dfb={};_0x256dfb[_0x4705f1['name']]={'$like':'%'+_0x1d5fed['query'][_0xa8c5('0x3e')]+'%'};return _0x256dfb;}})});}_0x28934d=_['merge']({},_0x28934d,_0x1d5fed[_0xa8c5('0x42')]);var _0x42b943={'where':_0x28934d[_0xa8c5('0x3f')]};return db[_0xa8c5('0x2d')]['count'](_0x42b943)[_0xa8c5('0x26')](function(_0x1e16ae){_0x27f526[_0xa8c5('0x1f')]=_0x1e16ae;if(_0x1d5fed['query'][_0xa8c5('0x43')]){_0x28934d['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xa8c5('0x44')](_0x28934d);})[_0xa8c5('0x26')](function(_0x4c612f){_0x27f526[_0xa8c5('0x45')]=_0x4c612f;return _0x27f526;})['then'](respondWithFilteredResult(_0xc5a9c1,_0x28934d))[_0xa8c5('0x46')](handleError(_0xc5a9c1,null));};exports['show']=function(_0x13f21d,_0x309c56){var _0x4605b6={'raw':![],'where':{'id':_0x13f21d['params']['id']}},_0x451e51={};_0x451e51[_0xa8c5('0x31')]=_[_0xa8c5('0x47')](db[_0xa8c5('0x2d')]['rawAttributes']);_0x451e51[_0xa8c5('0x33')]=_[_0xa8c5('0x47')](_0x13f21d[_0xa8c5('0x33')]);_0x451e51['filters']=_[_0xa8c5('0x35')](_0x451e51[_0xa8c5('0x31')],_0x451e51['query']);_0x4605b6[_0xa8c5('0x36')]=_[_0xa8c5('0x35')](_0x451e51[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x13f21d['query'][_0xa8c5('0x37')]));_0x4605b6['attributes']=_0x4605b6[_0xa8c5('0x36')][_0xa8c5('0x38')]?_0x4605b6[_0xa8c5('0x36')]:_0x451e51[_0xa8c5('0x31')];if(_0x13f21d[_0xa8c5('0x33')]['includeAll']){_0x4605b6[_0xa8c5('0x48')]=[{'all':!![]}];}_0x4605b6=_[_0xa8c5('0x40')]({},_0x4605b6,_0x13f21d['options']);return db['VtigerAccount'][_0xa8c5('0x49')](_0x4605b6)[_0xa8c5('0x26')](handleEntityNotFound(_0x309c56,null))[_0xa8c5('0x26')](respondWithResult(_0x309c56,null))[_0xa8c5('0x46')](handleError(_0x309c56,null));};exports[_0xa8c5('0x4a')]=function(_0x26a227,_0x1a622c){return db[_0xa8c5('0x2d')][_0xa8c5('0x4a')](_0x26a227[_0xa8c5('0x4b')],{})[_0xa8c5('0x26')](respondWithResult(_0x1a622c,0xc9))[_0xa8c5('0x46')](handleError(_0x1a622c,null));};exports['update']=function(_0x582694,_0x3cfde2){if(_0x582694[_0xa8c5('0x4b')]['id']){delete _0x582694[_0xa8c5('0x4b')]['id'];}return db[_0xa8c5('0x2d')]['find']({'where':{'id':_0x582694[_0xa8c5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3cfde2,null))['then'](saveUpdates(_0x582694[_0xa8c5('0x4b')],null))['then'](respondWithResult(_0x3cfde2,null))['catch'](handleError(_0x3cfde2,null));};exports[_0xa8c5('0x4d')]=function(_0x25debb,_0x51f42c){return db[_0xa8c5('0x2d')][_0xa8c5('0x49')]({'where':{'id':_0x25debb['params']['id']}})[_0xa8c5('0x26')](handleEntityNotFound(_0x51f42c,null))['then'](removeEntity(_0x51f42c,null))[_0xa8c5('0x46')](handleError(_0x51f42c,null));};exports['getConfigurations']=function(_0x2f9afa,_0x8c3ed1,_0xb479f8){var _0x1e47af={};var _0x59e193={};var _0x340e21;var _0x699f6;return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x2f9afa[_0xa8c5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8c3ed1,null))[_0xa8c5('0x26')](function(_0x1ff059){if(_0x1ff059){_0x340e21=_0x1ff059;_0x59e193[_0xa8c5('0x31')]=_[_0xa8c5('0x47')](db['VtigerConfiguration'][_0xa8c5('0x2e')]);_0x59e193[_0xa8c5('0x33')]=_[_0xa8c5('0x47')](_0x2f9afa[_0xa8c5('0x33')]);_0x59e193[_0xa8c5('0x34')]=_[_0xa8c5('0x35')](_0x59e193[_0xa8c5('0x31')],_0x59e193[_0xa8c5('0x33')]);_0x1e47af[_0xa8c5('0x36')]=_[_0xa8c5('0x35')](_0x59e193[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x37')]));_0x1e47af[_0xa8c5('0x36')]=_0x1e47af[_0xa8c5('0x36')]['length']?_0x1e47af[_0xa8c5('0x36')]:_0x59e193['model'];_0x1e47af[_0xa8c5('0x3b')]=qs[_0xa8c5('0x3c')](_0x2f9afa['query'][_0xa8c5('0x3c')]);_0x1e47af[_0xa8c5('0x3f')]=qs[_0xa8c5('0x34')](_[_0xa8c5('0x3d')](_0x2f9afa[_0xa8c5('0x33')],_0x59e193['filters']));if(_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x3e')]){_0x1e47af['where']=_['merge'](_0x1e47af['where'],{'$or':_[_0xa8c5('0x32')](_0x1e47af[_0xa8c5('0x36')],function(_0x34da0d){var _0x52adb5={};_0x52adb5[_0x34da0d]={'$like':'%'+_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x3e')]+'%'};return _0x52adb5;})});}_0x1e47af=_[_0xa8c5('0x40')]({},_0x1e47af,_0x2f9afa[_0xa8c5('0x42')]);return _0x340e21[_0xa8c5('0x4f')](_0x1e47af);}})[_0xa8c5('0x26')](function(_0x3c2db1){if(_0x3c2db1){_0x699f6=_0x3c2db1[_0xa8c5('0x38')];if(!_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x39')](_0xa8c5('0x3a'))){_0x1e47af[_0xa8c5('0x1e')]=qs[_0xa8c5('0x1e')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x1e')]);_0x1e47af[_0xa8c5('0x1c')]=qs[_0xa8c5('0x1c')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x1c')]);}return _0x340e21[_0xa8c5('0x4f')](_0x1e47af);}})['then'](function(_0x54855a){if(_0x54855a){return _0x54855a?{'count':_0x699f6,'rows':_0x54855a}:null;}})[_0xa8c5('0x26')](respondWithResult(_0x8c3ed1,null))[_0xa8c5('0x46')](handleError(_0x8c3ed1,null));};exports[_0xa8c5('0x50')]=function(_0x2cff4e,_0x5b8a78,_0x5cef5c){if(_0x2cff4e[_0xa8c5('0x4b')]['id']){delete _0x2cff4e[_0xa8c5('0x4b')]['id'];}return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x2cff4e[_0xa8c5('0x4c')]['id']}})[_0xa8c5('0x26')](handleEntityNotFound(_0x5b8a78,null))['then'](function(_0x2bdae4){if(_0x2bdae4){_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x51')]=_0x2bdae4['id'];_0x2cff4e[_0xa8c5('0x4b')]['Subjects']=integrations[_0xa8c5('0x52')](_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x53')],_0x2cff4e[_0xa8c5('0x4b')]['type']);_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x54')]=integrations[_0xa8c5('0x55')](_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x53')],_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x30')]);return db[_0xa8c5('0x56')][_0xa8c5('0x4a')](_0x2cff4e[_0xa8c5('0x4b')],{'include':[{'model':db[_0xa8c5('0x57')],'as':_0xa8c5('0x58')},{'model':db[_0xa8c5('0x57')],'as':_0xa8c5('0x54')}]});}return null;})[_0xa8c5('0x26')](respondWithResult(_0x5b8a78,null))[_0xa8c5('0x46')](handleError(_0x5b8a78,null));};var md5=require('md5');exports[_0xa8c5('0x59')]=function(_0x41bac0,_0x23852b,_0x30f55e){var _0x1caec4=null;var _0x6866ea=null;var _0x574874=null;var _0x5a1cc6=null;var _0x2995a8='';return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x41bac0[_0xa8c5('0x4c')]['id']},'attributes':['id',_0xa8c5('0x2a'),'username',_0xa8c5('0x5a'),'moduleName',_0xa8c5('0x5b'),'serverUrl',_0xa8c5('0x5c')]})[_0xa8c5('0x26')](handleEntityNotFound(_0x23852b,null))['then'](function(_0x5361e0){if(_0x5361e0){_0x1caec4=_0x5361e0[_0xa8c5('0x5d')];_0x6866ea=_0x5361e0[_0xa8c5('0x5c')];_0x574874=_0x5361e0['moduleName'];_0x2995a8=_0x5361e0['remoteUri'];var _0x283a53=_0x2995a8[_0xa8c5('0x5e')](-0x1);if(_0x283a53==='/'){_0x2995a8=_0x2995a8[_0xa8c5('0x5f')](0x0,_0x2995a8['lastIndexOf'](_0x283a53));}_0x5a1cc6=util[_0xa8c5('0x60')]('%s/webservice.php',_0x2995a8);var _0x4398ad={'method':'GET','uri':_0x5a1cc6,'qs':{'operation':_0xa8c5('0x61'),'username':_0x5361e0[_0xa8c5('0x5d')]},'json':!![]};return rp(_0x4398ad);}})[_0xa8c5('0x26')](function(_0x11d679){if(_0x11d679['success']){var _0x5be379={'method':_0xa8c5('0x62'),'uri':_0x5a1cc6,'form':{'operation':_0xa8c5('0x63'),'username':_0x1caec4,'accessKey':md5(_0x11d679[_0xa8c5('0x64')][_0xa8c5('0x65')]+_0x6866ea)},'json':!![]};return rp(_0x5be379);}})['then'](function(_0x521f7d){if(_0x521f7d[_0xa8c5('0x66')]){var _0x7384c2={'method':'GET','uri':_0x5a1cc6,'qs':{'operation':'describe','username':_0x1caec4,'sessionName':_0x521f7d[_0xa8c5('0x64')]['sessionName'],'elementType':_0x574874},'json':!![]};return rp(_0x7384c2);}})[_0xa8c5('0x26')](function(_0x6d8cd7){if(_0x6d8cd7[_0xa8c5('0x66')]){var _0x311b00=['autogenerated','reference','owner'];_['remove'](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x32f6f2){return _0x311b00[_0xa8c5('0x67')](_0x32f6f2[_0xa8c5('0x30')][_0xa8c5('0x2a')]);});_[_0xa8c5('0x68')](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x2f634f){return _0x2f634f[_0xa8c5('0x69')]===_0xa8c5('0x6a');});return{'count':_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')][_0xa8c5('0x38')],'rows':_[_0xa8c5('0x32')](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x20cc1f){return{'id':_0x20cc1f[_0xa8c5('0x2a')],'name':_0x20cc1f[_0xa8c5('0x6b')],'custom':_[_0xa8c5('0x6c')](_0x20cc1f[_0xa8c5('0x2a')],_0xa8c5('0x6d'))?!![]:![],'options':_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x2a')]==='picklist'&&_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x6e')][_0xa8c5('0x38')]>0x0?_['map'](_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x6e')],function(_0x23baba){return{'name':_0x23baba[_0xa8c5('0x6b')],'value':_0x23baba[_0xa8c5('0x6f')]};}):[]};})};}})[_0xa8c5('0x26')](respondWithResult(_0x23852b,null))[_0xa8c5('0x46')](function(_0x43b687){console['log']('vTiger\x20error:\x20'+_0x43b687);var _0x13cb4f=_0x41bac0[_0xa8c5('0x33')][_0xa8c5('0x70')]?0x1f4:_0x43b687[_0xa8c5('0x71')]||0x1f4;logger[_0xa8c5('0x28')](_0xa8c5('0x72'),_0xa8c5('0x59'),_0x13cb4f,JSON[_0xa8c5('0x73')](_0x43b687));delete _0x43b687[_0xa8c5('0x2a')];if(_0x13cb4f===0x191){_0x13cb4f=0x190;}_0x23852b[_0xa8c5('0x1b')](_0x13cb4f)[_0xa8c5('0x2b')](_0x41bac0[_0xa8c5('0x33')][_0xa8c5('0x70')]?{'message':_0xa8c5('0x74'),'statusCode':_0x43b687['statusCode']}:_0x43b687);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index d8bfb97..bf64b3b 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 _0xcea4=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x572bba,_0x1c7270){var _0x10cd7c=function(_0x5baeb0){while(--_0x5baeb0){_0x572bba['push'](_0x572bba['shift']());}};_0x10cd7c(++_0x1c7270);}(_0xcea4,0x8f));var _0x4cea=function(_0x23d50e,_0x378059){_0x23d50e=_0x23d50e-0x0;var _0x1ce88f=_0xcea4[_0x23d50e];return _0x1ce88f;};'use strict';var _=require(_0x4cea('0x0'));var util=require(_0x4cea('0x1'));var logger=require(_0x4cea('0x2'))(_0x4cea('0x3'));var moment=require(_0x4cea('0x4'));var BPromise=require(_0x4cea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4cea('0x6'));var config=require(_0x4cea('0x7'));var attributes=require(_0x4cea('0x8'));var integrations=require(_0x4cea('0x9'));module[_0x4cea('0xa')]=function(_0x1eb41b,_0x118aee){return _0x1eb41b[_0x4cea('0xb')](_0x4cea('0xc'),attributes,{'tableName':_0x4cea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2c5=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b3611,_0x3af5e1){var _0x344c6d=function(_0x239981){while(--_0x239981){_0x3b3611['push'](_0x3b3611['shift']());}};_0x344c6d(++_0x3af5e1);}(_0xf2c5,0x6d));var _0x5f2c=function(_0x215083,_0x4cc12f){_0x215083=_0x215083-0x0;var _0x16b3cf=_0xf2c5[_0x215083];return _0x16b3cf;};'use strict';var _=require(_0x5f2c('0x0'));var util=require(_0x5f2c('0x1'));var logger=require(_0x5f2c('0x2'))('api');var moment=require(_0x5f2c('0x3'));var BPromise=require(_0x5f2c('0x4'));var rp=require(_0x5f2c('0x5'));var fs=require('fs');var path=require(_0x5f2c('0x6'));var rimraf=require(_0x5f2c('0x7'));var config=require(_0x5f2c('0x8'));var attributes=require(_0x5f2c('0x9'));var integrations=require(_0x5f2c('0xa'));module[_0x5f2c('0xb')]=function(_0x30b823,_0x580efb){return _0x30b823[_0x5f2c('0xc')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 0ab5664..0c7da73 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 _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x45b5f7,_0x355b47){var _0x1856f7=function(_0x1ac8dd){while(--_0x1ac8dd){_0x45b5f7['push'](_0x45b5f7['shift']());}};_0x1856f7(++_0x355b47);}(_0xd87e,0x1bf));var _0xed87=function(_0x19d24e,_0x48638d){_0x19d24e=_0x19d24e-0x0;var _0x28c4f2=_0xd87e[_0x19d24e];return _0x28c4f2;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});}; \ No newline at end of file +var _0x236c=['jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x25cd84,_0x568fe2){var _0xb0788f=function(_0x253173){while(--_0x253173){_0x25cd84['push'](_0x25cd84['shift']());}};_0xb0788f(++_0x568fe2);}(_0x236c,0x155));var _0xc236=function(_0x3b1f3d,_0x323833){_0x3b1f3d=_0x3b1f3d-0x0;var _0x408aa2=_0x236c[_0x3b1f3d];return _0x408aa2;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});}exports[_0xc236('0x18')]=function(_0x76f45){var _0x11ec65=this;return new Promise(function(_0x541a20,_0x13b432){return db['VtigerAccount']['findAll']({'raw':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'limit':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')]['limit']||null:null,'include':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x76f45[_0xc236('0x19')][_0xc236('0x1d')],function(_0x3a315b){return{'model':db[_0x3a315b[_0xc236('0x1f')]],'as':_0x3a315b['as'],'attributes':_0x3a315b[_0xc236('0x1c')],'include':_0x3a315b[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x3a315b['include'],function(_0x308cd6){return{'model':db[_0x308cd6[_0xc236('0x1f')]],'as':_0x308cd6['as'],'attributes':_0x308cd6[_0xc236('0x1c')],'include':_0x308cd6[_0xc236('0x1d')]?_['map'](_0x308cd6[_0xc236('0x1d')],function(_0x5da4b2){return{'model':db[_0x5da4b2['model']],'as':_0x5da4b2['as'],'attributes':_0x5da4b2[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36e578){logger['info'](_0xc236('0x18'),_0x76f45);logger['debug'](_0xc236('0x18'),_0x76f45,JSON[_0xc236('0x12')](_0x36e578));_0x541a20(_0x36e578);})['catch'](function(_0x5a61b5){logger[_0xc236('0x13')](_0xc236('0x18'),_0x5a61b5[_0xc236('0x15')],_0x76f45);_0x13b432(_0x11ec65[_0xc236('0x13')](0x1f4,_0x5a61b5['message']));});});};exports['ShowVtigerAccount']=function(_0x28ffa5){var _0x53b767=this;return new Promise(function(_0x2c756f,_0x4ddc87){return db[_0xc236('0x20')][_0xc236('0x21')]({'raw':_0x28ffa5['options']?_0x28ffa5['options'][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'include':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')]['include']?_['map'](_0x28ffa5['options'][_0xc236('0x1d')],function(_0xfda1f9){return{'model':db[_0xfda1f9[_0xc236('0x1f')]],'as':_0xfda1f9['as'],'attributes':_0xfda1f9[_0xc236('0x1c')],'include':_0xfda1f9[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0xfda1f9[_0xc236('0x1d')],function(_0x5761de){return{'model':db[_0x5761de[_0xc236('0x1f')]],'as':_0x5761de['as'],'attributes':_0x5761de[_0xc236('0x1c')],'include':_0x5761de[_0xc236('0x1d')]?_['map'](_0x5761de[_0xc236('0x1d')],function(_0x2a8f33){return{'model':db[_0x2a8f33[_0xc236('0x1f')]],'as':_0x2a8f33['as'],'attributes':_0x2a8f33[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12348b){logger[_0xc236('0xd')](_0xc236('0x22'),_0x28ffa5);logger[_0xc236('0x10')](_0xc236('0x22'),_0x28ffa5,JSON[_0xc236('0x12')](_0x12348b));_0x2c756f(_0x12348b);})[_0xc236('0x17')](function(_0x11ca1c){logger[_0xc236('0x13')](_0xc236('0x22'),_0x11ca1c[_0xc236('0x15')],_0x28ffa5);_0x4ddc87(_0x53b767[_0xc236('0x13')](0x1f4,_0x11ca1c[_0xc236('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 69d8702..6d7c0f5 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 _0x2587=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','destroy','multer','util','path','connect-timeout'];(function(_0x206f02,_0x36f322){var _0x8a2663=function(_0x5ac031){while(--_0x5ac031){_0x206f02['push'](_0x206f02['shift']());}};_0x8a2663(++_0x36f322);}(_0x2587,0x1ca));var _0x7258=function(_0x5e0914,_0x481afe){_0x5e0914=_0x5e0914-0x0;var _0x5eebff=_0x2587[_0x5e0914];return _0x5eebff;};'use strict';var multer=require(_0x7258('0x0'));var util=require(_0x7258('0x1'));var path=require(_0x7258('0x2'));var timeout=require(_0x7258('0x3'));var express=require(_0x7258('0x4'));var router=express['Router']();var fs_extra=require(_0x7258('0x5'));var auth=require(_0x7258('0x6'));var interaction=require(_0x7258('0x7'));var config=require('../../config/environment');var controller=require(_0x7258('0x8'));router[_0x7258('0x9')]('/',auth[_0x7258('0xa')](),controller[_0x7258('0xb')]);router[_0x7258('0x9')](_0x7258('0xc'),auth[_0x7258('0xa')](),controller[_0x7258('0xd')]);router[_0x7258('0x9')]('/:id/fields',auth[_0x7258('0xa')](),controller[_0x7258('0xe')]);router['get'](_0x7258('0xf'),auth[_0x7258('0xa')](),controller['getSubjects']);router['get'](_0x7258('0x10'),auth['isAuthenticated'](),controller[_0x7258('0x11')]);router[_0x7258('0x12')]('/',auth[_0x7258('0xa')](),controller[_0x7258('0x13')]);router[_0x7258('0x14')](_0x7258('0xc'),auth[_0x7258('0xa')](),controller['update']);router['delete'](_0x7258('0xc'),auth[_0x7258('0xa')](),controller[_0x7258('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf8f9=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getFields','/:id/subjects','getDescriptions','create','put','update','exports','util'];(function(_0x9ea933,_0x565d76){var _0x4fdcd0=function(_0x1b1b59){while(--_0x1b1b59){_0x9ea933['push'](_0x9ea933['shift']());}};_0x4fdcd0(++_0x565d76);}(_0xf8f9,0x87));var _0x9f8f=function(_0x3be520,_0x46739c){_0x3be520=_0x3be520-0x0;var _0x1f7381=_0xf8f9[_0x3be520];return _0x1f7381;};'use strict';var multer=require('multer');var util=require(_0x9f8f('0x0'));var path=require(_0x9f8f('0x1'));var timeout=require(_0x9f8f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f8f('0x3'));var interaction=require(_0x9f8f('0x4'));var config=require(_0x9f8f('0x5'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x9f8f('0x6')](),controller['index']);router[_0x9f8f('0x7')](_0x9f8f('0x8'),auth['isAuthenticated'](),controller[_0x9f8f('0x9')]);router[_0x9f8f('0x7')]('/:id/fields',auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xa')]);router['get'](_0x9f8f('0xb'),auth[_0x9f8f('0x6')](),controller['getSubjects']);router[_0x9f8f('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9f8f('0xc')]);router['post']('/',auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xd')]);router[_0x9f8f('0xe')](_0x9f8f('0x8'),auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xf')]);router['delete']('/:id',auth[_0x9f8f('0x6')](),controller['destroy']);module[_0x9f8f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6ca2c33..e4fc829 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 _0xed12=['STRING','exports'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xed12,0x177));var _0x2ed1=function(_0xe2b3e2,_0x56a05a){_0xe2b3e2=_0xe2b3e2-0x0;var _0x384e3f=_0xed12[_0xe2b3e2];return _0x384e3f;};'use strict';var Sequelize=require('sequelize');module[_0x2ed1('0x0')]={'name':{'type':Sequelize[_0x2ed1('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe619=['sequelize','exports','STRING'];(function(_0x5ad0fc,_0x35b8cd){var _0x3c8d05=function(_0x5bea89){while(--_0x5bea89){_0x5ad0fc['push'](_0x5ad0fc['shift']());}};_0x3c8d05(++_0x35b8cd);}(_0xe619,0x1e0));var _0x9e61=function(_0x30f020,_0x7d2cfa){_0x30f020=_0x30f020-0x0;var _0x3933c0=_0xe619[_0x30f020];return _0x3933c0;};'use strict';var Sequelize=require(_0x9e61('0x0'));module[_0x9e61('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e61('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 56e8c14..7b8dce6 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 _0xf2e2=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','VtigerConfiguration','findAll','catch','params','keys','includeAll','include','find','create','body','getFields','findOne','VtigerField','options','hasOwnProperty','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0xf2e2,0x1ce));var _0x2f2e=function(_0x37ed92,_0x8e5252){_0x37ed92=_0x37ed92-0x0;var _0x5a1125=_0xf2e2[_0x37ed92];return _0x5a1125;};'use strict';var emlformat=require(_0x2f2e('0x0'));var rimraf=require(_0x2f2e('0x1'));var zipdir=require(_0x2f2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f2e('0x3'));var moment=require('moment');var BPromise=require(_0x2f2e('0x4'));var Mustache=require(_0x2f2e('0x5'));var util=require(_0x2f2e('0x6'));var path=require(_0x2f2e('0x7'));var sox=require(_0x2f2e('0x8'));var csv=require(_0x2f2e('0x9'));var ejs=require(_0x2f2e('0xa'));var fs=require('fs');var fs_extra=require(_0x2f2e('0xb'));var _=require('lodash');var squel=require(_0x2f2e('0xc'));var crypto=require(_0x2f2e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2f2e('0x9'));var querystring=require(_0x2f2e('0xe'));var Papa=require(_0x2f2e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2f2e('0x10'));var as=require(_0x2f2e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f2e('0x12'));var utils=require(_0x2f2e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2f2e('0x14'));var db=require(_0x2f2e('0x15'))['db'];function respondWithStatusCode(_0x29361f,_0x5b8e24){_0x5b8e24=_0x5b8e24||0xcc;return function(_0x1c2f93){if(_0x1c2f93){return _0x29361f[_0x2f2e('0x16')](_0x5b8e24);}return _0x29361f[_0x2f2e('0x17')](_0x5b8e24)[_0x2f2e('0x18')]();};}function respondWithResult(_0x5aca0e,_0x49a993){_0x49a993=_0x49a993||0xc8;return function(_0x2cd121){if(_0x2cd121){return _0x5aca0e[_0x2f2e('0x17')](_0x49a993)[_0x2f2e('0x19')](_0x2cd121);}};}function respondWithFilteredResult(_0x5de20,_0x1664f8){return function(_0x4cf3dc){if(_0x4cf3dc){var _0x3fcdb8=typeof _0x1664f8['offset']==='undefined'&&typeof _0x1664f8[_0x2f2e('0x1a')]===_0x2f2e('0x1b');var _0x100cb2=_0x4cf3dc[_0x2f2e('0x1c')];var _0x1347c5=_0x3fcdb8?0x0:_0x1664f8[_0x2f2e('0x1d')];var _0x452dd6=_0x3fcdb8?_0x4cf3dc['count']:_0x1664f8[_0x2f2e('0x1d')]+_0x1664f8['limit'];var _0x504589;if(_0x452dd6>=_0x100cb2){_0x452dd6=_0x100cb2;_0x504589=0xc8;}else{_0x504589=0xce;}_0x5de20['status'](_0x504589);return _0x5de20[_0x2f2e('0x1e')](_0x2f2e('0x1f'),_0x1347c5+'-'+_0x452dd6+'/'+_0x100cb2)[_0x2f2e('0x19')](_0x4cf3dc);}return null;};}function patchUpdates(_0x5674b8){return function(_0x34b5ac){try{jsonpatch[_0x2f2e('0x20')](_0x34b5ac,_0x5674b8,!![]);}catch(_0x138146){return BPromise[_0x2f2e('0x21')](_0x138146);}return _0x34b5ac[_0x2f2e('0x22')]();};}function saveUpdates(_0x1d5b01,_0x4ff3db){return function(_0x77f6d5){if(_0x77f6d5){return _0x77f6d5[_0x2f2e('0x23')](_0x1d5b01)[_0x2f2e('0x24')](function(_0x5637b0){return _0x5637b0;});}return null;};}function removeEntity(_0x671e39,_0x88b99f){return function(_0x50920a){if(_0x50920a){return _0x50920a[_0x2f2e('0x25')]()['then'](function(){_0x671e39[_0x2f2e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x238071,_0x849a62){return function(_0x368244){if(!_0x368244){_0x238071[_0x2f2e('0x16')](0x194);}return _0x368244;};}function handleError(_0x250f42,_0x15f374){_0x15f374=_0x15f374||0x1f4;return function(_0x1e78cf){logger['error'](_0x1e78cf[_0x2f2e('0x26')]);if(_0x1e78cf[_0x2f2e('0x27')]){delete _0x1e78cf[_0x2f2e('0x27')];}_0x250f42[_0x2f2e('0x17')](_0x15f374)[_0x2f2e('0x28')](_0x1e78cf);};}exports[_0x2f2e('0x29')]=function(_0x5f5a79,_0x5f9ee1){var _0x374bee={},_0x1de4f5={},_0x4a34f5={'count':0x0,'rows':[]};var _0x281d48=_['map'](db['VtigerConfiguration'][_0x2f2e('0x2a')],function(_0x373e05){return{'name':_0x373e05['fieldName'],'type':_0x373e05[_0x2f2e('0x2b')][_0x2f2e('0x2c')]};});_0x1de4f5[_0x2f2e('0x2d')]=_[_0x2f2e('0x2e')](_0x281d48,_0x2f2e('0x27'));_0x1de4f5[_0x2f2e('0x2f')]=_['keys'](_0x5f5a79[_0x2f2e('0x2f')]);_0x1de4f5[_0x2f2e('0x30')]=_[_0x2f2e('0x31')](_0x1de4f5[_0x2f2e('0x2d')],_0x1de4f5[_0x2f2e('0x2f')]);_0x374bee[_0x2f2e('0x32')]=_['intersection'](_0x1de4f5[_0x2f2e('0x2d')],qs[_0x2f2e('0x33')](_0x5f5a79[_0x2f2e('0x2f')]['fields']));_0x374bee[_0x2f2e('0x32')]=_0x374bee[_0x2f2e('0x32')][_0x2f2e('0x34')]?_0x374bee[_0x2f2e('0x32')]:_0x1de4f5[_0x2f2e('0x2d')];if(!_0x5f5a79['query']['hasOwnProperty'](_0x2f2e('0x35'))){_0x374bee['limit']=qs[_0x2f2e('0x1a')](_0x5f5a79['query'][_0x2f2e('0x1a')]);_0x374bee[_0x2f2e('0x1d')]=qs[_0x2f2e('0x1d')](_0x5f5a79[_0x2f2e('0x2f')]['offset']);}_0x374bee['order']=qs[_0x2f2e('0x36')](_0x5f5a79[_0x2f2e('0x2f')][_0x2f2e('0x36')]);_0x374bee[_0x2f2e('0x37')]=qs[_0x2f2e('0x30')](_[_0x2f2e('0x38')](_0x5f5a79[_0x2f2e('0x2f')],_0x1de4f5[_0x2f2e('0x30')]),_0x281d48);if(_0x5f5a79[_0x2f2e('0x2f')]['filter']){_0x374bee[_0x2f2e('0x37')]=_[_0x2f2e('0x39')](_0x374bee[_0x2f2e('0x37')],{'$or':_[_0x2f2e('0x2e')](_0x281d48,function(_0x539a33){if(_0x539a33[_0x2f2e('0x2b')]!==_0x2f2e('0x3a')){var _0x4727a1={};_0x4727a1[_0x539a33[_0x2f2e('0x27')]]={'$like':'%'+_0x5f5a79[_0x2f2e('0x2f')][_0x2f2e('0x3b')]+'%'};return _0x4727a1;}})});}_0x374bee=_['merge']({},_0x374bee,_0x5f5a79['options']);var _0x535c89={'where':_0x374bee['where']};return db[_0x2f2e('0x3c')][_0x2f2e('0x1c')](_0x535c89)[_0x2f2e('0x24')](function(_0x167ecb){_0x4a34f5[_0x2f2e('0x1c')]=_0x167ecb;if(_0x5f5a79['query']['includeAll']){_0x374bee['include']=[{'all':!![]}];}return db[_0x2f2e('0x3c')][_0x2f2e('0x3d')](_0x374bee);})[_0x2f2e('0x24')](function(_0x3255e4){_0x4a34f5['rows']=_0x3255e4;return _0x4a34f5;})[_0x2f2e('0x24')](respondWithFilteredResult(_0x5f9ee1,_0x374bee))[_0x2f2e('0x3e')](handleError(_0x5f9ee1,null));};exports['show']=function(_0x4ebaef,_0x325caf){var _0x4d081a={'raw':![],'where':{'id':_0x4ebaef[_0x2f2e('0x3f')]['id']}},_0x54a6e5={};_0x54a6e5['model']=_[_0x2f2e('0x40')](db['VtigerConfiguration'][_0x2f2e('0x2a')]);_0x54a6e5[_0x2f2e('0x2f')]=_[_0x2f2e('0x40')](_0x4ebaef[_0x2f2e('0x2f')]);_0x54a6e5[_0x2f2e('0x30')]=_[_0x2f2e('0x31')](_0x54a6e5[_0x2f2e('0x2d')],_0x54a6e5[_0x2f2e('0x2f')]);_0x4d081a[_0x2f2e('0x32')]=_['intersection'](_0x54a6e5[_0x2f2e('0x2d')],qs[_0x2f2e('0x33')](_0x4ebaef[_0x2f2e('0x2f')]['fields']));_0x4d081a[_0x2f2e('0x32')]=_0x4d081a[_0x2f2e('0x32')][_0x2f2e('0x34')]?_0x4d081a['attributes']:_0x54a6e5[_0x2f2e('0x2d')];if(_0x4ebaef[_0x2f2e('0x2f')][_0x2f2e('0x41')]){_0x4d081a[_0x2f2e('0x42')]=[{'all':!![]}];}_0x4d081a=_[_0x2f2e('0x39')]({},_0x4d081a,_0x4ebaef['options']);return db[_0x2f2e('0x3c')][_0x2f2e('0x43')](_0x4d081a)['then'](handleEntityNotFound(_0x325caf,null))['then'](respondWithResult(_0x325caf,null))['catch'](handleError(_0x325caf,null));};exports[_0x2f2e('0x44')]=function(_0x411004,_0x5c498b){return db[_0x2f2e('0x3c')]['create'](_0x411004[_0x2f2e('0x45')],{})[_0x2f2e('0x24')](respondWithResult(_0x5c498b,0xc9))[_0x2f2e('0x3e')](handleError(_0x5c498b,null));};exports[_0x2f2e('0x23')]=function(_0x211e5f,_0xab40){if(_0x211e5f[_0x2f2e('0x45')]['id']){delete _0x211e5f[_0x2f2e('0x45')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x211e5f[_0x2f2e('0x3f')]['id']}})[_0x2f2e('0x24')](handleEntityNotFound(_0xab40,null))[_0x2f2e('0x24')](saveUpdates(_0x211e5f[_0x2f2e('0x45')],null))[_0x2f2e('0x24')](respondWithResult(_0xab40,null))[_0x2f2e('0x3e')](handleError(_0xab40,null));};exports[_0x2f2e('0x25')]=function(_0x5a53cc,_0x3abe2e){return db[_0x2f2e('0x3c')][_0x2f2e('0x43')]({'where':{'id':_0x5a53cc[_0x2f2e('0x3f')]['id']}})[_0x2f2e('0x24')](handleEntityNotFound(_0x3abe2e,null))[_0x2f2e('0x24')](removeEntity(_0x3abe2e,null))[_0x2f2e('0x3e')](handleError(_0x3abe2e,null));};exports[_0x2f2e('0x46')]=function(_0x48ac4d,_0x5c72f2,_0xe3616b){var _0x18935c={};var _0x3db5e5={};var _0x2affa9;var _0x384303;return db[_0x2f2e('0x3c')][_0x2f2e('0x47')]({'where':{'id':_0x48ac4d['params']['id']}})[_0x2f2e('0x24')](handleEntityNotFound(_0x5c72f2,null))[_0x2f2e('0x24')](function(_0x49569e){if(_0x49569e){_0x2affa9=_0x49569e;_0x3db5e5['model']=_['keys'](db[_0x2f2e('0x48')][_0x2f2e('0x2a')]);_0x3db5e5[_0x2f2e('0x2f')]=_[_0x2f2e('0x40')](_0x48ac4d[_0x2f2e('0x2f')]);_0x3db5e5[_0x2f2e('0x30')]=_['intersection'](_0x3db5e5[_0x2f2e('0x2d')],_0x3db5e5[_0x2f2e('0x2f')]);_0x18935c['attributes']=_[_0x2f2e('0x31')](_0x3db5e5[_0x2f2e('0x2d')],qs['fields'](_0x48ac4d[_0x2f2e('0x2f')]['fields']));_0x18935c['attributes']=_0x18935c[_0x2f2e('0x32')]['length']?_0x18935c['attributes']:_0x3db5e5[_0x2f2e('0x2d')];_0x18935c['order']=qs[_0x2f2e('0x36')](_0x48ac4d[_0x2f2e('0x2f')]['sort']);_0x18935c[_0x2f2e('0x37')]=qs[_0x2f2e('0x30')](_['pick'](_0x48ac4d[_0x2f2e('0x2f')],_0x3db5e5[_0x2f2e('0x30')]));if(_0x48ac4d[_0x2f2e('0x2f')][_0x2f2e('0x3b')]){_0x18935c[_0x2f2e('0x37')]=_[_0x2f2e('0x39')](_0x18935c['where'],{'$or':_[_0x2f2e('0x2e')](_0x18935c[_0x2f2e('0x32')],function(_0x36ba06){var _0x25f4f9={};_0x25f4f9[_0x36ba06]={'$like':'%'+_0x48ac4d[_0x2f2e('0x2f')][_0x2f2e('0x3b')]+'%'};return _0x25f4f9;})});}_0x18935c=_['merge']({},_0x18935c,_0x48ac4d[_0x2f2e('0x49')]);return _0x2affa9[_0x2f2e('0x46')](_0x18935c);}})[_0x2f2e('0x24')](function(_0x3fcd78){if(_0x3fcd78){_0x384303=_0x3fcd78[_0x2f2e('0x34')];if(!_0x48ac4d[_0x2f2e('0x2f')][_0x2f2e('0x4a')](_0x2f2e('0x35'))){_0x18935c[_0x2f2e('0x1a')]=qs['limit'](_0x48ac4d[_0x2f2e('0x2f')][_0x2f2e('0x1a')]);_0x18935c['offset']=qs['offset'](_0x48ac4d[_0x2f2e('0x2f')][_0x2f2e('0x1d')]);}return _0x2affa9[_0x2f2e('0x46')](_0x18935c);}})['then'](function(_0x3fa61d){if(_0x3fa61d){return _0x3fa61d?{'count':_0x384303,'rows':_0x3fa61d}:null;}})[_0x2f2e('0x24')](respondWithResult(_0x5c72f2,null))['catch'](handleError(_0x5c72f2,null));};exports['getSubjects']=function(_0x195e95,_0x4bb840,_0x14886a){var _0x586225={};var _0xbb24={};var _0x331126;var _0x1076ba;return db[_0x2f2e('0x3c')][_0x2f2e('0x47')]({'where':{'id':_0x195e95[_0x2f2e('0x3f')]['id']}})[_0x2f2e('0x24')](handleEntityNotFound(_0x4bb840,null))[_0x2f2e('0x24')](function(_0x1acab9){if(_0x1acab9){_0x331126=_0x1acab9;_0xbb24['model']=_['keys'](db[_0x2f2e('0x48')]['rawAttributes']);_0xbb24[_0x2f2e('0x2f')]=_[_0x2f2e('0x40')](_0x195e95['query']);_0xbb24[_0x2f2e('0x30')]=_[_0x2f2e('0x31')](_0xbb24[_0x2f2e('0x2d')],_0xbb24[_0x2f2e('0x2f')]);_0x586225[_0x2f2e('0x32')]=_[_0x2f2e('0x31')](_0xbb24[_0x2f2e('0x2d')],qs[_0x2f2e('0x33')](_0x195e95[_0x2f2e('0x2f')][_0x2f2e('0x33')]));_0x586225['attributes']=_0x586225[_0x2f2e('0x32')][_0x2f2e('0x34')]?_0x586225[_0x2f2e('0x32')]:_0xbb24[_0x2f2e('0x2d')];_0x586225[_0x2f2e('0x4b')]=qs['sort'](_0x195e95[_0x2f2e('0x2f')][_0x2f2e('0x36')]);_0x586225[_0x2f2e('0x37')]=qs[_0x2f2e('0x30')](_[_0x2f2e('0x38')](_0x195e95['query'],_0xbb24['filters']));if(_0x195e95[_0x2f2e('0x2f')][_0x2f2e('0x3b')]){_0x586225[_0x2f2e('0x37')]=_['merge'](_0x586225['where'],{'$or':_[_0x2f2e('0x2e')](_0x586225['attributes'],function(_0x2309f9){var _0x46dbe2={};_0x46dbe2[_0x2309f9]={'$like':'%'+_0x195e95['query'][_0x2f2e('0x3b')]+'%'};return _0x46dbe2;})});}_0x586225=_[_0x2f2e('0x39')]({},_0x586225,_0x195e95['options']);return _0x331126[_0x2f2e('0x4c')](_0x586225);}})['then'](function(_0x5465ee){if(_0x5465ee){_0x1076ba=_0x5465ee[_0x2f2e('0x34')];if(!_0x195e95['query'][_0x2f2e('0x4a')](_0x2f2e('0x35'))){_0x586225[_0x2f2e('0x1a')]=qs[_0x2f2e('0x1a')](_0x195e95[_0x2f2e('0x2f')][_0x2f2e('0x1a')]);_0x586225[_0x2f2e('0x1d')]=qs[_0x2f2e('0x1d')](_0x195e95[_0x2f2e('0x2f')][_0x2f2e('0x1d')]);}return _0x331126[_0x2f2e('0x4c')](_0x586225);}})[_0x2f2e('0x24')](function(_0x246cfb){if(_0x246cfb){return _0x246cfb?{'count':_0x1076ba,'rows':_0x246cfb}:null;}})['then'](respondWithResult(_0x4bb840,null))['catch'](handleError(_0x4bb840,null));};exports[_0x2f2e('0x4d')]=function(_0xf52a67,_0x38d434,_0x2db6ae){var _0x37e472={};var _0x6ddc06={};var _0x39cd60;var _0x57f0a6;return db['VtigerConfiguration'][_0x2f2e('0x47')]({'where':{'id':_0xf52a67[_0x2f2e('0x3f')]['id']}})[_0x2f2e('0x24')](handleEntityNotFound(_0x38d434,null))[_0x2f2e('0x24')](function(_0x55c4ff){if(_0x55c4ff){_0x39cd60=_0x55c4ff;_0x6ddc06[_0x2f2e('0x2d')]=_[_0x2f2e('0x40')](db[_0x2f2e('0x48')][_0x2f2e('0x2a')]);_0x6ddc06[_0x2f2e('0x2f')]=_[_0x2f2e('0x40')](_0xf52a67['query']);_0x6ddc06[_0x2f2e('0x30')]=_[_0x2f2e('0x31')](_0x6ddc06['model'],_0x6ddc06['query']);_0x37e472['attributes']=_[_0x2f2e('0x31')](_0x6ddc06[_0x2f2e('0x2d')],qs['fields'](_0xf52a67[_0x2f2e('0x2f')][_0x2f2e('0x33')]));_0x37e472['attributes']=_0x37e472['attributes'][_0x2f2e('0x34')]?_0x37e472['attributes']:_0x6ddc06[_0x2f2e('0x2d')];_0x37e472['order']=qs[_0x2f2e('0x36')](_0xf52a67[_0x2f2e('0x2f')]['sort']);_0x37e472[_0x2f2e('0x37')]=qs['filters'](_['pick'](_0xf52a67[_0x2f2e('0x2f')],_0x6ddc06[_0x2f2e('0x30')]));if(_0xf52a67[_0x2f2e('0x2f')]['filter']){_0x37e472['where']=_['merge'](_0x37e472[_0x2f2e('0x37')],{'$or':_[_0x2f2e('0x2e')](_0x37e472[_0x2f2e('0x32')],function(_0x3f36b2){var _0x585d30={};_0x585d30[_0x3f36b2]={'$like':'%'+_0xf52a67['query'][_0x2f2e('0x3b')]+'%'};return _0x585d30;})});}_0x37e472=_[_0x2f2e('0x39')]({},_0x37e472,_0xf52a67['options']);return _0x39cd60[_0x2f2e('0x4d')](_0x37e472);}})['then'](function(_0x392694){if(_0x392694){_0x57f0a6=_0x392694[_0x2f2e('0x34')];if(!_0xf52a67['query'][_0x2f2e('0x4a')](_0x2f2e('0x35'))){_0x37e472[_0x2f2e('0x1a')]=qs[_0x2f2e('0x1a')](_0xf52a67[_0x2f2e('0x2f')][_0x2f2e('0x1a')]);_0x37e472['offset']=qs[_0x2f2e('0x1d')](_0xf52a67[_0x2f2e('0x2f')][_0x2f2e('0x1d')]);}return _0x39cd60['getDescriptions'](_0x37e472);}})['then'](function(_0x353f7c){if(_0x353f7c){return _0x353f7c?{'count':_0x57f0a6,'rows':_0x353f7c}:null;}})[_0x2f2e('0x24')](respondWithResult(_0x38d434,null))[_0x2f2e('0x3e')](handleError(_0x38d434,null));}; \ No newline at end of file +var _0x72e3=['end','error','stack','name','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','include','VtigerConfiguration','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','params','findOne','length','sort','filter','getFields','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy'];(function(_0x272eb9,_0x36b494){var _0x4d2120=function(_0x2af811){while(--_0x2af811){_0x272eb9['push'](_0x272eb9['shift']());}};_0x4d2120(++_0x36b494);}(_0x72e3,0x1b7));var _0x372e=function(_0x27d1ae,_0x2e03dd){_0x27d1ae=_0x27d1ae-0x0;var _0x49e658=_0x72e3[_0x27d1ae];return _0x49e658;};'use strict';var emlformat=require(_0x372e('0x0'));var rimraf=require(_0x372e('0x1'));var zipdir=require(_0x372e('0x2'));var jsonpatch=require(_0x372e('0x3'));var rp=require(_0x372e('0x4'));var moment=require(_0x372e('0x5'));var BPromise=require(_0x372e('0x6'));var Mustache=require(_0x372e('0x7'));var util=require('util');var path=require(_0x372e('0x8'));var sox=require('sox');var csv=require(_0x372e('0x9'));var ejs=require(_0x372e('0xa'));var fs=require('fs');var fs_extra=require(_0x372e('0xb'));var _=require(_0x372e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x372e('0xd'));var deskjs=require(_0x372e('0xe'));var toCsv=require(_0x372e('0x9'));var querystring=require(_0x372e('0xf'));var Papa=require('papaparse');var Redis=require(_0x372e('0x10'));var authService=require(_0x372e('0x11'));var qs=require(_0x372e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x372e('0x13'));var utils=require(_0x372e('0x14'));var config=require(_0x372e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103c9c,_0x3a7e07){_0x3a7e07=_0x3a7e07||0xcc;return function(_0x355760){if(_0x355760){return _0x103c9c[_0x372e('0x16')](_0x3a7e07);}return _0x103c9c[_0x372e('0x17')](_0x3a7e07)['end']();};}function respondWithResult(_0xa1ef5f,_0x21c0bd){_0x21c0bd=_0x21c0bd||0xc8;return function(_0xe5fff){if(_0xe5fff){return _0xa1ef5f[_0x372e('0x17')](_0x21c0bd)[_0x372e('0x18')](_0xe5fff);}};}function respondWithFilteredResult(_0x54e64a,_0x161b45){return function(_0x97ab89){if(_0x97ab89){var _0x559e0b=typeof _0x161b45[_0x372e('0x19')]==='undefined'&&typeof _0x161b45[_0x372e('0x1a')]===_0x372e('0x1b');var _0x471de0=_0x97ab89[_0x372e('0x1c')];var _0x3c2f81=_0x559e0b?0x0:_0x161b45[_0x372e('0x19')];var _0xf2b941=_0x559e0b?_0x97ab89[_0x372e('0x1c')]:_0x161b45[_0x372e('0x19')]+_0x161b45['limit'];var _0x1f81e3;if(_0xf2b941>=_0x471de0){_0xf2b941=_0x471de0;_0x1f81e3=0xc8;}else{_0x1f81e3=0xce;}_0x54e64a[_0x372e('0x17')](_0x1f81e3);return _0x54e64a['set']('Content-Range',_0x3c2f81+'-'+_0xf2b941+'/'+_0x471de0)[_0x372e('0x18')](_0x97ab89);}return null;};}function patchUpdates(_0xe28082){return function(_0x400a68){try{jsonpatch[_0x372e('0x1d')](_0x400a68,_0xe28082,!![]);}catch(_0x4ae02a){return BPromise[_0x372e('0x1e')](_0x4ae02a);}return _0x400a68[_0x372e('0x1f')]();};}function saveUpdates(_0x59931a,_0x675cd3){return function(_0x46102a){if(_0x46102a){return _0x46102a[_0x372e('0x20')](_0x59931a)[_0x372e('0x21')](function(_0x1d3be9){return _0x1d3be9;});}return null;};}function removeEntity(_0x34af21,_0x3d9e78){return function(_0x44ab92){if(_0x44ab92){return _0x44ab92[_0x372e('0x22')]()[_0x372e('0x21')](function(){_0x34af21[_0x372e('0x17')](0xcc)[_0x372e('0x23')]();});}};}function handleEntityNotFound(_0x139b53,_0x57852d){return function(_0x44d19e){if(!_0x44d19e){_0x139b53['sendStatus'](0x194);}return _0x44d19e;};}function handleError(_0x4eee56,_0x13e9cc){_0x13e9cc=_0x13e9cc||0x1f4;return function(_0x4b7321){logger[_0x372e('0x24')](_0x4b7321[_0x372e('0x25')]);if(_0x4b7321[_0x372e('0x26')]){delete _0x4b7321[_0x372e('0x26')];}_0x4eee56[_0x372e('0x17')](_0x13e9cc)['send'](_0x4b7321);};}exports[_0x372e('0x27')]=function(_0x24e524,_0x595b78){var _0x2cdde3={},_0x42ca8f={},_0x453ed4={'count':0x0,'rows':[]};var _0x52e93c=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0xee8dde){return{'name':_0xee8dde[_0x372e('0x28')],'type':_0xee8dde[_0x372e('0x29')][_0x372e('0x2a')]};});_0x42ca8f[_0x372e('0x2b')]=_[_0x372e('0x2c')](_0x52e93c,_0x372e('0x26'));_0x42ca8f[_0x372e('0x2d')]=_['keys'](_0x24e524[_0x372e('0x2d')]);_0x42ca8f[_0x372e('0x2e')]=_[_0x372e('0x2f')](_0x42ca8f[_0x372e('0x2b')],_0x42ca8f[_0x372e('0x2d')]);_0x2cdde3['attributes']=_[_0x372e('0x2f')](_0x42ca8f[_0x372e('0x2b')],qs[_0x372e('0x30')](_0x24e524[_0x372e('0x2d')][_0x372e('0x30')]));_0x2cdde3[_0x372e('0x31')]=_0x2cdde3[_0x372e('0x31')]['length']?_0x2cdde3[_0x372e('0x31')]:_0x42ca8f[_0x372e('0x2b')];if(!_0x24e524[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x2cdde3[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0x24e524[_0x372e('0x2d')]['limit']);_0x2cdde3['offset']=qs[_0x372e('0x19')](_0x24e524[_0x372e('0x2d')][_0x372e('0x19')]);}_0x2cdde3[_0x372e('0x34')]=qs['sort'](_0x24e524[_0x372e('0x2d')]['sort']);_0x2cdde3[_0x372e('0x35')]=qs['filters'](_[_0x372e('0x36')](_0x24e524[_0x372e('0x2d')],_0x42ca8f[_0x372e('0x2e')]),_0x52e93c);if(_0x24e524[_0x372e('0x2d')]['filter']){_0x2cdde3[_0x372e('0x35')]=_[_0x372e('0x37')](_0x2cdde3[_0x372e('0x35')],{'$or':_['map'](_0x52e93c,function(_0x21e977){if(_0x21e977[_0x372e('0x29')]!==_0x372e('0x38')){var _0x3f7adc={};_0x3f7adc[_0x21e977[_0x372e('0x26')]]={'$like':'%'+_0x24e524[_0x372e('0x2d')]['filter']+'%'};return _0x3f7adc;}})});}_0x2cdde3=_[_0x372e('0x37')]({},_0x2cdde3,_0x24e524[_0x372e('0x39')]);var _0x50c042={'where':_0x2cdde3[_0x372e('0x35')]};return db['VtigerConfiguration']['count'](_0x50c042)[_0x372e('0x21')](function(_0x44fc77){_0x453ed4[_0x372e('0x1c')]=_0x44fc77;if(_0x24e524['query']['includeAll']){_0x2cdde3[_0x372e('0x3a')]=[{'all':!![]}];}return db[_0x372e('0x3b')][_0x372e('0x3c')](_0x2cdde3);})[_0x372e('0x21')](function(_0x96e129){_0x453ed4[_0x372e('0x3d')]=_0x96e129;return _0x453ed4;})['then'](respondWithFilteredResult(_0x595b78,_0x2cdde3))[_0x372e('0x3e')](handleError(_0x595b78,null));};exports[_0x372e('0x3f')]=function(_0x291023,_0x3768c2){var _0x57765a={'raw':![],'where':{'id':_0x291023['params']['id']}},_0x2edeeb={};_0x2edeeb[_0x372e('0x2b')]=_[_0x372e('0x40')](db[_0x372e('0x3b')][_0x372e('0x41')]);_0x2edeeb[_0x372e('0x2d')]=_['keys'](_0x291023[_0x372e('0x2d')]);_0x2edeeb[_0x372e('0x2e')]=_['intersection'](_0x2edeeb[_0x372e('0x2b')],_0x2edeeb[_0x372e('0x2d')]);_0x57765a[_0x372e('0x31')]=_[_0x372e('0x2f')](_0x2edeeb['model'],qs['fields'](_0x291023[_0x372e('0x2d')]['fields']));_0x57765a[_0x372e('0x31')]=_0x57765a['attributes']['length']?_0x57765a[_0x372e('0x31')]:_0x2edeeb[_0x372e('0x2b')];if(_0x291023[_0x372e('0x2d')][_0x372e('0x42')]){_0x57765a['include']=[{'all':!![]}];}_0x57765a=_['merge']({},_0x57765a,_0x291023[_0x372e('0x39')]);return db[_0x372e('0x3b')][_0x372e('0x43')](_0x57765a)['then'](handleEntityNotFound(_0x3768c2,null))[_0x372e('0x21')](respondWithResult(_0x3768c2,null))['catch'](handleError(_0x3768c2,null));};exports['create']=function(_0x299a60,_0x1d696d){return db[_0x372e('0x3b')][_0x372e('0x44')](_0x299a60[_0x372e('0x45')],{})[_0x372e('0x21')](respondWithResult(_0x1d696d,0xc9))[_0x372e('0x3e')](handleError(_0x1d696d,null));};exports[_0x372e('0x20')]=function(_0x117627,_0x3e651e){if(_0x117627[_0x372e('0x45')]['id']){delete _0x117627[_0x372e('0x45')]['id'];}return db[_0x372e('0x3b')][_0x372e('0x43')]({'where':{'id':_0x117627[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x3e651e,null))[_0x372e('0x21')](saveUpdates(_0x117627[_0x372e('0x45')],null))[_0x372e('0x21')](respondWithResult(_0x3e651e,null))[_0x372e('0x3e')](handleError(_0x3e651e,null));};exports['destroy']=function(_0x4ee5fe,_0x525111){return db[_0x372e('0x3b')]['find']({'where':{'id':_0x4ee5fe['params']['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x525111,null))[_0x372e('0x21')](removeEntity(_0x525111,null))[_0x372e('0x3e')](handleError(_0x525111,null));};exports['getFields']=function(_0x966604,_0x2de533,_0x20f605){var _0x209c4d={};var _0x1dc76f={};var _0x463311;var _0x50eedd;return db['VtigerConfiguration'][_0x372e('0x47')]({'where':{'id':_0x966604[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x2de533,null))[_0x372e('0x21')](function(_0x5a1767){if(_0x5a1767){_0x463311=_0x5a1767;_0x1dc76f[_0x372e('0x2b')]=_[_0x372e('0x40')](db['VtigerField'][_0x372e('0x41')]);_0x1dc76f[_0x372e('0x2d')]=_['keys'](_0x966604[_0x372e('0x2d')]);_0x1dc76f['filters']=_['intersection'](_0x1dc76f[_0x372e('0x2b')],_0x1dc76f[_0x372e('0x2d')]);_0x209c4d[_0x372e('0x31')]=_['intersection'](_0x1dc76f[_0x372e('0x2b')],qs['fields'](_0x966604['query'][_0x372e('0x30')]));_0x209c4d['attributes']=_0x209c4d[_0x372e('0x31')][_0x372e('0x48')]?_0x209c4d['attributes']:_0x1dc76f[_0x372e('0x2b')];_0x209c4d[_0x372e('0x34')]=qs['sort'](_0x966604[_0x372e('0x2d')][_0x372e('0x49')]);_0x209c4d[_0x372e('0x35')]=qs['filters'](_[_0x372e('0x36')](_0x966604['query'],_0x1dc76f[_0x372e('0x2e')]));if(_0x966604[_0x372e('0x2d')][_0x372e('0x4a')]){_0x209c4d[_0x372e('0x35')]=_[_0x372e('0x37')](_0x209c4d['where'],{'$or':_[_0x372e('0x2c')](_0x209c4d[_0x372e('0x31')],function(_0x388c35){var _0x5958c8={};_0x5958c8[_0x388c35]={'$like':'%'+_0x966604['query']['filter']+'%'};return _0x5958c8;})});}_0x209c4d=_[_0x372e('0x37')]({},_0x209c4d,_0x966604[_0x372e('0x39')]);return _0x463311[_0x372e('0x4b')](_0x209c4d);}})[_0x372e('0x21')](function(_0x31d129){if(_0x31d129){_0x50eedd=_0x31d129[_0x372e('0x48')];if(!_0x966604['query'][_0x372e('0x32')](_0x372e('0x33'))){_0x209c4d['limit']=qs[_0x372e('0x1a')](_0x966604['query'][_0x372e('0x1a')]);_0x209c4d[_0x372e('0x19')]=qs[_0x372e('0x19')](_0x966604[_0x372e('0x2d')][_0x372e('0x19')]);}return _0x463311[_0x372e('0x4b')](_0x209c4d);}})[_0x372e('0x21')](function(_0x461cc5){if(_0x461cc5){return _0x461cc5?{'count':_0x50eedd,'rows':_0x461cc5}:null;}})[_0x372e('0x21')](respondWithResult(_0x2de533,null))[_0x372e('0x3e')](handleError(_0x2de533,null));};exports[_0x372e('0x4c')]=function(_0x1648f0,_0x1e7611,_0x540e3b){var _0x538255={};var _0x22bc6c={};var _0x4d066f;var _0x1dbd12;return db[_0x372e('0x3b')][_0x372e('0x47')]({'where':{'id':_0x1648f0[_0x372e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e7611,null))[_0x372e('0x21')](function(_0x5902ad){if(_0x5902ad){_0x4d066f=_0x5902ad;_0x22bc6c[_0x372e('0x2b')]=_['keys'](db[_0x372e('0x4d')][_0x372e('0x41')]);_0x22bc6c[_0x372e('0x2d')]=_[_0x372e('0x40')](_0x1648f0[_0x372e('0x2d')]);_0x22bc6c['filters']=_[_0x372e('0x2f')](_0x22bc6c[_0x372e('0x2b')],_0x22bc6c[_0x372e('0x2d')]);_0x538255['attributes']=_[_0x372e('0x2f')](_0x22bc6c[_0x372e('0x2b')],qs['fields'](_0x1648f0['query'][_0x372e('0x30')]));_0x538255[_0x372e('0x31')]=_0x538255[_0x372e('0x31')][_0x372e('0x48')]?_0x538255[_0x372e('0x31')]:_0x22bc6c[_0x372e('0x2b')];_0x538255[_0x372e('0x34')]=qs['sort'](_0x1648f0[_0x372e('0x2d')][_0x372e('0x49')]);_0x538255[_0x372e('0x35')]=qs[_0x372e('0x2e')](_[_0x372e('0x36')](_0x1648f0['query'],_0x22bc6c[_0x372e('0x2e')]));if(_0x1648f0[_0x372e('0x2d')]['filter']){_0x538255[_0x372e('0x35')]=_[_0x372e('0x37')](_0x538255[_0x372e('0x35')],{'$or':_['map'](_0x538255[_0x372e('0x31')],function(_0x188f96){var _0x204bb7={};_0x204bb7[_0x188f96]={'$like':'%'+_0x1648f0[_0x372e('0x2d')][_0x372e('0x4a')]+'%'};return _0x204bb7;})});}_0x538255=_[_0x372e('0x37')]({},_0x538255,_0x1648f0['options']);return _0x4d066f[_0x372e('0x4c')](_0x538255);}})[_0x372e('0x21')](function(_0x368680){if(_0x368680){_0x1dbd12=_0x368680['length'];if(!_0x1648f0[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x538255[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0x1648f0['query'][_0x372e('0x1a')]);_0x538255[_0x372e('0x19')]=qs[_0x372e('0x19')](_0x1648f0['query'][_0x372e('0x19')]);}return _0x4d066f[_0x372e('0x4c')](_0x538255);}})[_0x372e('0x21')](function(_0x113072){if(_0x113072){return _0x113072?{'count':_0x1dbd12,'rows':_0x113072}:null;}})[_0x372e('0x21')](respondWithResult(_0x1e7611,null))[_0x372e('0x3e')](handleError(_0x1e7611,null));};exports[_0x372e('0x4e')]=function(_0xb4a76f,_0x392335,_0x393886){var _0x2f12d4={};var _0x51f111={};var _0x3d01e7;var _0xc6f05f;return db[_0x372e('0x3b')][_0x372e('0x47')]({'where':{'id':_0xb4a76f[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x392335,null))[_0x372e('0x21')](function(_0x4964e6){if(_0x4964e6){_0x3d01e7=_0x4964e6;_0x51f111[_0x372e('0x2b')]=_[_0x372e('0x40')](db['VtigerField'][_0x372e('0x41')]);_0x51f111[_0x372e('0x2d')]=_[_0x372e('0x40')](_0xb4a76f[_0x372e('0x2d')]);_0x51f111['filters']=_[_0x372e('0x2f')](_0x51f111[_0x372e('0x2b')],_0x51f111[_0x372e('0x2d')]);_0x2f12d4[_0x372e('0x31')]=_[_0x372e('0x2f')](_0x51f111[_0x372e('0x2b')],qs[_0x372e('0x30')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x30')]));_0x2f12d4['attributes']=_0x2f12d4['attributes'][_0x372e('0x48')]?_0x2f12d4[_0x372e('0x31')]:_0x51f111[_0x372e('0x2b')];_0x2f12d4[_0x372e('0x34')]=qs[_0x372e('0x49')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x49')]);_0x2f12d4['where']=qs[_0x372e('0x2e')](_[_0x372e('0x36')](_0xb4a76f[_0x372e('0x2d')],_0x51f111[_0x372e('0x2e')]));if(_0xb4a76f[_0x372e('0x2d')][_0x372e('0x4a')]){_0x2f12d4[_0x372e('0x35')]=_['merge'](_0x2f12d4['where'],{'$or':_[_0x372e('0x2c')](_0x2f12d4['attributes'],function(_0x1fe72b){var _0x3973b8={};_0x3973b8[_0x1fe72b]={'$like':'%'+_0xb4a76f['query'][_0x372e('0x4a')]+'%'};return _0x3973b8;})});}_0x2f12d4=_['merge']({},_0x2f12d4,_0xb4a76f[_0x372e('0x39')]);return _0x3d01e7[_0x372e('0x4e')](_0x2f12d4);}})[_0x372e('0x21')](function(_0x1ee327){if(_0x1ee327){_0xc6f05f=_0x1ee327[_0x372e('0x48')];if(!_0xb4a76f[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x2f12d4[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x1a')]);_0x2f12d4[_0x372e('0x19')]=qs[_0x372e('0x19')](_0xb4a76f[_0x372e('0x2d')]['offset']);}return _0x3d01e7[_0x372e('0x4e')](_0x2f12d4);}})[_0x372e('0x21')](function(_0x240586){if(_0x240586){return _0x240586?{'count':_0xc6f05f,'rows':_0x240586}:null;}})['then'](respondWithResult(_0x392335,null))[_0x372e('0x3e')](handleError(_0x392335,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 56cd91c..3c825fb 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 _0x4df8=['VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define'];(function(_0x495630,_0x44449a){var _0x3da3ff=function(_0x133d91){while(--_0x133d91){_0x495630['push'](_0x495630['shift']());}};_0x3da3ff(++_0x44449a);}(_0x4df8,0xf2));var _0x84df=function(_0x5e3342,_0x5ceda0){_0x5e3342=_0x5e3342-0x0;var _0x572836=_0x4df8[_0x5e3342];return _0x572836;};'use strict';var _=require(_0x84df('0x0'));var util=require(_0x84df('0x1'));var logger=require('../../config/logger')(_0x84df('0x2'));var moment=require(_0x84df('0x3'));var BPromise=require(_0x84df('0x4'));var rp=require(_0x84df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84df('0x6'));var config=require(_0x84df('0x7'));var attributes=require(_0x84df('0x8'));module['exports']=function(_0x2ed108,_0x48e873){return _0x2ed108[_0x84df('0x9')](_0x84df('0xa'),attributes,{'tableName':_0x84df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe70c=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d90e5,_0x148062){var _0x1dd518=function(_0x5d1bb9){while(--_0x5d1bb9){_0x4d90e5['push'](_0x4d90e5['shift']());}};_0x1dd518(++_0x148062);}(_0xe70c,0x69));var _0xce70=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe70c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xce70('0x0'));var util=require(_0xce70('0x1'));var logger=require(_0xce70('0x2'))(_0xce70('0x3'));var moment=require(_0xce70('0x4'));var BPromise=require(_0xce70('0x5'));var rp=require(_0xce70('0x6'));var fs=require('fs');var path=require(_0xce70('0x7'));var rimraf=require(_0xce70('0x8'));var config=require(_0xce70('0x9'));var attributes=require(_0xce70('0xa'));module[_0xce70('0xb')]=function(_0x4606d8,_0x4eb5f9){return _0x4606d8[_0xce70('0xc')]('VtigerConfiguration',attributes,{'tableName':_0xce70('0xd'),'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 ec3c614..4ce73e4 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 _0x8d7d=['message','VtigerConfiguration,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e8690,_0x5c6b4c){var _0x414bea=function(_0x6284dd){while(--_0x6284dd){_0x1e8690['push'](_0x1e8690['shift']());}};_0x414bea(++_0x5c6b4c);}(_0x8d7d,0x1b8));var _0xd8d7=function(_0x338328,_0x3d5c10){_0x338328=_0x338328-0x0;var _0x127e38=_0x8d7d[_0x338328];return _0x127e38;};'use strict';var _=require('lodash');var util=require(_0xd8d7('0x0'));var moment=require(_0xd8d7('0x1'));var BPromise=require(_0xd8d7('0x2'));var rs=require(_0xd8d7('0x3'));var fs=require('fs');var Redis=require(_0xd8d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8d7('0x5'));var logger=require(_0xd8d7('0x6'))(_0xd8d7('0x7'));var config=require(_0xd8d7('0x8'));var jayson=require(_0xd8d7('0x9'));var client=jayson[_0xd8d7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x506db0,_0x724265,_0x2aa0bf){return new BPromise(function(_0x213fe4,_0x2f5c8a){return client[_0xd8d7('0xb')](_0x506db0,_0x2aa0bf)[_0xd8d7('0xc')](function(_0x25e0e6){logger[_0xd8d7('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x724265,_0xd8d7('0xe'));logger[_0xd8d7('0xf')](_0xd8d7('0x10'),_0x724265,'request\x20sent',JSON[_0xd8d7('0x11')](_0x25e0e6));if(_0x25e0e6['error']){if(_0x25e0e6[_0xd8d7('0x12')][_0xd8d7('0x13')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x724265,_0x25e0e6[_0xd8d7('0x12')]['message']);return _0x2f5c8a(_0x25e0e6[_0xd8d7('0x12')][_0xd8d7('0x14')]);}logger[_0xd8d7('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x724265,_0x25e0e6[_0xd8d7('0x12')][_0xd8d7('0x14')]);return _0x213fe4(_0x25e0e6[_0xd8d7('0x12')]['message']);}else{logger[_0xd8d7('0xd')](_0xd8d7('0x15'),_0x724265,_0xd8d7('0xe'));_0x213fe4(_0x25e0e6[_0xd8d7('0x16')][_0xd8d7('0x14')]);}})['catch'](function(_0x59a4e2){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x724265,_0x59a4e2);_0x2f5c8a(_0x59a4e2);});});} \ No newline at end of file +var _0x36de=['http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xd6239c,_0x4c2400){var _0x281c50=function(_0x5640e7){while(--_0x5640e7){_0xd6239c['push'](_0xd6239c['shift']());}};_0x281c50(++_0x4c2400);}(_0x36de,0x19a));var _0xe36d=function(_0x143659,_0x5d75f3){_0x143659=_0x143659-0x0;var _0x1f6d91=_0x36de[_0x143659];return _0x1f6d91;};'use strict';var _=require('lodash');var util=require(_0xe36d('0x0'));var moment=require(_0xe36d('0x1'));var BPromise=require(_0xe36d('0x2'));var rs=require(_0xe36d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe36d('0x4'))('rpc');var config=require(_0xe36d('0x5'));var jayson=require(_0xe36d('0x6'));var client=jayson[_0xe36d('0x7')][_0xe36d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x134dc8,_0x48fe37,_0x7a6ef){return new BPromise(function(_0x3b8e4d,_0x434b7c){return client['request'](_0x134dc8,_0x7a6ef)[_0xe36d('0x9')](function(_0x34eae9){logger[_0xe36d('0xa')](_0xe36d('0xb'),_0x48fe37,'request\x20sent');logger[_0xe36d('0xc')](_0xe36d('0xd'),_0x48fe37,_0xe36d('0xe'),JSON['stringify'](_0x34eae9));if(_0x34eae9['error']){if(_0x34eae9['error']['code']===0x1f4){logger[_0xe36d('0xf')](_0xe36d('0xb'),_0x48fe37,_0x34eae9[_0xe36d('0xf')][_0xe36d('0x10')]);return _0x434b7c(_0x34eae9[_0xe36d('0xf')][_0xe36d('0x10')]);}logger[_0xe36d('0xf')](_0xe36d('0xb'),_0x48fe37,_0x34eae9['error']['message']);return _0x3b8e4d(_0x34eae9['error'][_0xe36d('0x10')]);}else{logger[_0xe36d('0xa')](_0xe36d('0xb'),_0x48fe37,_0xe36d('0xe'));_0x3b8e4d(_0x34eae9[_0xe36d('0x11')][_0xe36d('0x10')]);}})[_0xe36d('0x12')](function(_0x310e91){logger[_0xe36d('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x48fe37,_0x310e91);_0x434b7c(_0x310e91);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 73d91ff..e3760fc 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 _0x5970=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1e7e7d,_0x26a06d){var _0x1d54ad=function(_0x4c210e){while(--_0x4c210e){_0x1e7e7d['push'](_0x1e7e7d['shift']());}};_0x1d54ad(++_0x26a06d);}(_0x5970,0x1f3));var _0x0597=function(_0x3cdc96,_0x2c1770){_0x3cdc96=_0x3cdc96-0x0;var _0x4c04dd=_0x5970[_0x3cdc96];return _0x4c04dd;};'use strict';var multer=require(_0x0597('0x0'));var util=require(_0x0597('0x1'));var path=require('path');var timeout=require(_0x0597('0x2'));var express=require(_0x0597('0x3'));var router=express[_0x0597('0x4')]();var fs_extra=require(_0x0597('0x5'));var auth=require(_0x0597('0x6'));var interaction=require(_0x0597('0x7'));var config=require('../../config/environment');var controller=require(_0x0597('0x8'));router[_0x0597('0x9')]('/',auth[_0x0597('0xa')](),controller['index']);router[_0x0597('0x9')](_0x0597('0xb'),auth['isAuthenticated'](),controller[_0x0597('0xc')]);router[_0x0597('0xd')]('/',auth['isAuthenticated'](),controller[_0x0597('0xe')]);router['put'](_0x0597('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0597('0xf')](_0x0597('0xb'),auth[_0x0597('0xa')](),controller[_0x0597('0x10')]);module[_0x0597('0x11')]=router; \ No newline at end of file +var _0xc83b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x5c9fc7,_0x5c34b3){var _0x51cf5f=function(_0x4153a7){while(--_0x4153a7){_0x5c9fc7['push'](_0x5c9fc7['shift']());}};_0x51cf5f(++_0x5c34b3);}(_0xc83b,0x13d));var _0xbc83=function(_0x218cd7,_0x18fe6d){_0x218cd7=_0x218cd7-0x0;var _0xb5a5fb=_0xc83b[_0x218cd7];return _0xb5a5fb;};'use strict';var multer=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var path=require(_0xbc83('0x2'));var timeout=require(_0xbc83('0x3'));var express=require('express');var router=express[_0xbc83('0x4')]();var fs_extra=require(_0xbc83('0x5'));var auth=require(_0xbc83('0x6'));var interaction=require(_0xbc83('0x7'));var config=require('../../config/environment');var controller=require(_0xbc83('0x8'));router['get']('/',auth[_0xbc83('0x9')](),controller[_0xbc83('0xa')]);router[_0xbc83('0xb')]('/:id',auth[_0xbc83('0x9')](),controller[_0xbc83('0xc')]);router[_0xbc83('0xd')]('/',auth[_0xbc83('0x9')](),controller['create']);router[_0xbc83('0xe')](_0xbc83('0xf'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x10')]);router[_0xbc83('0x11')](_0xbc83('0xf'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x12')]);module[_0xbc83('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 39a9e4e..c35d93b 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 _0xa22f=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xa22f,0xc3));var _0xfa22=function(_0x229450,_0x4d9d71){_0x229450=_0x229450-0x0;var _0x5e0484=_0xa22f[_0x229450];return _0x5e0484;};'use strict';var Sequelize=require(_0xfa22('0x0'));module[_0xfa22('0x1')]={'type':{'type':Sequelize[_0xfa22('0x2')](_0xfa22('0x3'),_0xfa22('0x4'),_0xfa22('0x5'),_0xfa22('0x6'),_0xfa22('0x7')),'defaultValue':_0xfa22('0x3')},'content':{'type':Sequelize[_0xfa22('0x8')]},'key':{'type':Sequelize[_0xfa22('0x8')]},'keyType':{'type':Sequelize[_0xfa22('0x2')](_0xfa22('0x3'),'variable',_0xfa22('0x5'))},'keyContent':{'type':Sequelize[_0xfa22('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfa22('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd96d=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1cc34f,_0x27dbf2){var _0x333522=function(_0x3e4943){while(--_0x3e4943){_0x1cc34f['push'](_0x1cc34f['shift']());}};_0x333522(++_0x27dbf2);}(_0xd96d,0x19b));var _0xdd96=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd96d[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xdd96('0x0'));module['exports']={'type':{'type':Sequelize[_0xdd96('0x1')](_0xdd96('0x2'),_0xdd96('0x3'),_0xdd96('0x4'),_0xdd96('0x5'),_0xdd96('0x6')),'defaultValue':_0xdd96('0x2')},'content':{'type':Sequelize[_0xdd96('0x7')]},'key':{'type':Sequelize[_0xdd96('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdd96('0x2'),_0xdd96('0x3'),_0xdd96('0x4'))},'keyContent':{'type':Sequelize[_0xdd96('0x7')]},'idField':{'type':Sequelize[_0xdd96('0x7')]},'nameField':{'type':Sequelize[_0xdd96('0x7')]},'customField':{'type':Sequelize[_0xdd96('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd96('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ea66915..76b7977 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 _0xb3f5=['api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','count','includeAll','findAll','show','params','length','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0xb3f5,0x16a));var _0x5b3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5b3f('0x0'));var rimraf=require(_0x5b3f('0x1'));var zipdir=require(_0x5b3f('0x2'));var jsonpatch=require(_0x5b3f('0x3'));var rp=require(_0x5b3f('0x4'));var moment=require(_0x5b3f('0x5'));var BPromise=require(_0x5b3f('0x6'));var Mustache=require(_0x5b3f('0x7'));var util=require(_0x5b3f('0x8'));var path=require(_0x5b3f('0x9'));var sox=require(_0x5b3f('0xa'));var csv=require(_0x5b3f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b3f('0xc'));var _=require(_0x5b3f('0xd'));var squel=require(_0x5b3f('0xe'));var crypto=require(_0x5b3f('0xf'));var jsforce=require(_0x5b3f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5b3f('0xb'));var querystring=require(_0x5b3f('0x11'));var Papa=require(_0x5b3f('0x12'));var Redis=require('ioredis');var authService=require(_0x5b3f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5b3f('0x14'));var hardwareService=require(_0x5b3f('0x15'));var logger=require(_0x5b3f('0x16'))(_0x5b3f('0x17'));var utils=require(_0x5b3f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5b3f('0x19'));var db=require(_0x5b3f('0x1a'))['db'];function respondWithStatusCode(_0x1ac70f,_0x28c6b0){_0x28c6b0=_0x28c6b0||0xcc;return function(_0x558b48){if(_0x558b48){return _0x1ac70f['sendStatus'](_0x28c6b0);}return _0x1ac70f[_0x5b3f('0x1b')](_0x28c6b0)[_0x5b3f('0x1c')]();};}function respondWithResult(_0x5b9d36,_0x2e5b29){_0x2e5b29=_0x2e5b29||0xc8;return function(_0x2ee63f){if(_0x2ee63f){return _0x5b9d36[_0x5b3f('0x1b')](_0x2e5b29)['json'](_0x2ee63f);}};}function respondWithFilteredResult(_0x4c51ed,_0x6f70f5){return function(_0xbaad17){if(_0xbaad17){var _0xd8cc1a=typeof _0x6f70f5[_0x5b3f('0x1d')]===_0x5b3f('0x1e')&&typeof _0x6f70f5[_0x5b3f('0x1f')]===_0x5b3f('0x1e');var _0x51665=_0xbaad17['count'];var _0x453585=_0xd8cc1a?0x0:_0x6f70f5[_0x5b3f('0x1d')];var _0x465a11=_0xd8cc1a?_0xbaad17['count']:_0x6f70f5[_0x5b3f('0x1d')]+_0x6f70f5[_0x5b3f('0x1f')];var _0x5d618f;if(_0x465a11>=_0x51665){_0x465a11=_0x51665;_0x5d618f=0xc8;}else{_0x5d618f=0xce;}_0x4c51ed[_0x5b3f('0x1b')](_0x5d618f);return _0x4c51ed[_0x5b3f('0x20')](_0x5b3f('0x21'),_0x453585+'-'+_0x465a11+'/'+_0x51665)[_0x5b3f('0x22')](_0xbaad17);}return null;};}function patchUpdates(_0xe73b5b){return function(_0x2256ec){try{jsonpatch[_0x5b3f('0x23')](_0x2256ec,_0xe73b5b,!![]);}catch(_0x54ba61){return BPromise[_0x5b3f('0x24')](_0x54ba61);}return _0x2256ec[_0x5b3f('0x25')]();};}function saveUpdates(_0x48e758,_0x43249d){return function(_0x4b2009){if(_0x4b2009){return _0x4b2009[_0x5b3f('0x26')](_0x48e758)['then'](function(_0x2ee8c9){return _0x2ee8c9;});}return null;};}function removeEntity(_0x3bb81c,_0x1da231){return function(_0x48a572){if(_0x48a572){return _0x48a572[_0x5b3f('0x27')]()[_0x5b3f('0x28')](function(){_0x3bb81c[_0x5b3f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x111679,_0xc6eedc){return function(_0x2876ae){if(!_0x2876ae){_0x111679[_0x5b3f('0x29')](0x194);}return _0x2876ae;};}function handleError(_0x252e72,_0x57738a){_0x57738a=_0x57738a||0x1f4;return function(_0x281be2){logger[_0x5b3f('0x2a')](_0x281be2[_0x5b3f('0x2b')]);if(_0x281be2[_0x5b3f('0x2c')]){delete _0x281be2['name'];}_0x252e72[_0x5b3f('0x1b')](_0x57738a)[_0x5b3f('0x2d')](_0x281be2);};}exports['index']=function(_0x1d38d7,_0x423a05){var _0xac85={},_0xb15827={},_0x5d5b45={'count':0x0,'rows':[]};var _0x1a461c=_[_0x5b3f('0x2e')](db[_0x5b3f('0x2f')][_0x5b3f('0x30')],function(_0x43b0ea){return{'name':_0x43b0ea[_0x5b3f('0x31')],'type':_0x43b0ea[_0x5b3f('0x32')][_0x5b3f('0x33')]};});_0xb15827['model']=_[_0x5b3f('0x2e')](_0x1a461c,_0x5b3f('0x2c'));_0xb15827[_0x5b3f('0x34')]=_[_0x5b3f('0x35')](_0x1d38d7[_0x5b3f('0x34')]);_0xb15827['filters']=_['intersection'](_0xb15827[_0x5b3f('0x36')],_0xb15827[_0x5b3f('0x34')]);_0xac85[_0x5b3f('0x37')]=_[_0x5b3f('0x38')](_0xb15827['model'],qs['fields'](_0x1d38d7['query'][_0x5b3f('0x39')]));_0xac85[_0x5b3f('0x37')]=_0xac85[_0x5b3f('0x37')]['length']?_0xac85[_0x5b3f('0x37')]:_0xb15827[_0x5b3f('0x36')];if(!_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x3a')](_0x5b3f('0x3b'))){_0xac85['limit']=qs[_0x5b3f('0x1f')](_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x1f')]);_0xac85['offset']=qs[_0x5b3f('0x1d')](_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x1d')]);}_0xac85[_0x5b3f('0x3c')]=qs[_0x5b3f('0x3d')](_0x1d38d7['query'][_0x5b3f('0x3d')]);_0xac85['where']=qs['filters'](_['pick'](_0x1d38d7[_0x5b3f('0x34')],_0xb15827['filters']),_0x1a461c);if(_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x3e')]){_0xac85[_0x5b3f('0x3f')]=_['merge'](_0xac85[_0x5b3f('0x3f')],{'$or':_[_0x5b3f('0x2e')](_0x1a461c,function(_0x5512ac){if(_0x5512ac[_0x5b3f('0x32')]!==_0x5b3f('0x40')){var _0x3228f0={};_0x3228f0[_0x5512ac[_0x5b3f('0x2c')]]={'$like':'%'+_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x3e')]+'%'};return _0x3228f0;}})});}_0xac85=_[_0x5b3f('0x41')]({},_0xac85,_0x1d38d7['options']);var _0x5a222b={'where':_0xac85[_0x5b3f('0x3f')]};return db[_0x5b3f('0x2f')][_0x5b3f('0x42')](_0x5a222b)[_0x5b3f('0x28')](function(_0xab4366){_0x5d5b45[_0x5b3f('0x42')]=_0xab4366;if(_0x1d38d7[_0x5b3f('0x34')][_0x5b3f('0x43')]){_0xac85['include']=[{'all':!![]}];}return db[_0x5b3f('0x2f')][_0x5b3f('0x44')](_0xac85);})['then'](function(_0xa70acc){_0x5d5b45['rows']=_0xa70acc;return _0x5d5b45;})['then'](respondWithFilteredResult(_0x423a05,_0xac85))['catch'](handleError(_0x423a05,null));};exports[_0x5b3f('0x45')]=function(_0x3043e9,_0x3357d0){var _0xbc136={'raw':!![],'where':{'id':_0x3043e9[_0x5b3f('0x46')]['id']}},_0x338ed9={};_0x338ed9['model']=_[_0x5b3f('0x35')](db[_0x5b3f('0x2f')][_0x5b3f('0x30')]);_0x338ed9[_0x5b3f('0x34')]=_[_0x5b3f('0x35')](_0x3043e9[_0x5b3f('0x34')]);_0x338ed9['filters']=_[_0x5b3f('0x38')](_0x338ed9[_0x5b3f('0x36')],_0x338ed9[_0x5b3f('0x34')]);_0xbc136[_0x5b3f('0x37')]=_[_0x5b3f('0x38')](_0x338ed9['model'],qs[_0x5b3f('0x39')](_0x3043e9['query'][_0x5b3f('0x39')]));_0xbc136[_0x5b3f('0x37')]=_0xbc136[_0x5b3f('0x37')][_0x5b3f('0x47')]?_0xbc136[_0x5b3f('0x37')]:_0x338ed9[_0x5b3f('0x36')];if(_0x3043e9[_0x5b3f('0x34')][_0x5b3f('0x43')]){_0xbc136[_0x5b3f('0x48')]=[{'all':!![]}];}_0xbc136=_[_0x5b3f('0x41')]({},_0xbc136,_0x3043e9['options']);return db[_0x5b3f('0x2f')][_0x5b3f('0x49')](_0xbc136)[_0x5b3f('0x28')](handleEntityNotFound(_0x3357d0,null))['then'](respondWithResult(_0x3357d0,null))[_0x5b3f('0x4a')](handleError(_0x3357d0,null));};exports['create']=function(_0x5edf4d,_0x5ed054){return db[_0x5b3f('0x2f')][_0x5b3f('0x4b')](_0x5edf4d['body'],{})[_0x5b3f('0x28')](respondWithResult(_0x5ed054,0xc9))[_0x5b3f('0x4a')](handleError(_0x5ed054,null));};exports['update']=function(_0x5ef9fb,_0x2449b2){if(_0x5ef9fb['body']['id']){delete _0x5ef9fb['body']['id'];}return db[_0x5b3f('0x2f')]['find']({'where':{'id':_0x5ef9fb['params']['id']}})[_0x5b3f('0x28')](handleEntityNotFound(_0x2449b2,null))[_0x5b3f('0x28')](saveUpdates(_0x5ef9fb[_0x5b3f('0x4c')],null))[_0x5b3f('0x28')](respondWithResult(_0x2449b2,null))[_0x5b3f('0x4a')](handleError(_0x2449b2,null));};exports[_0x5b3f('0x27')]=function(_0x576e35,_0x5255da){return db[_0x5b3f('0x2f')][_0x5b3f('0x49')]({'where':{'id':_0x576e35[_0x5b3f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5255da,null))[_0x5b3f('0x28')](removeEntity(_0x5255da,null))['catch'](handleError(_0x5255da,null));}; \ No newline at end of file +var _0x7211=['then','error','stack','name','index','map','VtigerField','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x7211,0x194));var _0x1721=function(_0x396068,_0x36f609){_0x396068=_0x396068-0x0;var _0x4b7783=_0x7211[_0x396068];return _0x4b7783;};'use strict';var emlformat=require(_0x1721('0x0'));var rimraf=require(_0x1721('0x1'));var zipdir=require(_0x1721('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1721('0x3'));var moment=require(_0x1721('0x4'));var BPromise=require(_0x1721('0x5'));var Mustache=require(_0x1721('0x6'));var util=require(_0x1721('0x7'));var path=require(_0x1721('0x8'));var sox=require(_0x1721('0x9'));var csv=require('to-csv');var ejs=require(_0x1721('0xa'));var fs=require('fs');var fs_extra=require(_0x1721('0xb'));var _=require(_0x1721('0xc'));var squel=require(_0x1721('0xd'));var crypto=require(_0x1721('0xe'));var jsforce=require(_0x1721('0xf'));var deskjs=require(_0x1721('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1721('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1721('0x12'));var hardwareService=require(_0x1721('0x13'));var logger=require(_0x1721('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1721('0x15'));var licenseUtil=require(_0x1721('0x16'));var db=require(_0x1721('0x17'))['db'];function respondWithStatusCode(_0x3a21dd,_0x1b50ef){_0x1b50ef=_0x1b50ef||0xcc;return function(_0x562db5){if(_0x562db5){return _0x3a21dd[_0x1721('0x18')](_0x1b50ef);}return _0x3a21dd[_0x1721('0x19')](_0x1b50ef)[_0x1721('0x1a')]();};}function respondWithResult(_0x1a3c6b,_0x2d9c3d){_0x2d9c3d=_0x2d9c3d||0xc8;return function(_0x5de1d6){if(_0x5de1d6){return _0x1a3c6b[_0x1721('0x19')](_0x2d9c3d)[_0x1721('0x1b')](_0x5de1d6);}};}function respondWithFilteredResult(_0xc4cb6c,_0x499fc7){return function(_0x401408){if(_0x401408){var _0x88ce1=typeof _0x499fc7[_0x1721('0x1c')]===_0x1721('0x1d')&&typeof _0x499fc7[_0x1721('0x1e')]===_0x1721('0x1d');var _0x202325=_0x401408['count'];var _0x3c9dc5=_0x88ce1?0x0:_0x499fc7['offset'];var _0x2fb93b=_0x88ce1?_0x401408[_0x1721('0x1f')]:_0x499fc7[_0x1721('0x1c')]+_0x499fc7[_0x1721('0x1e')];var _0x4209f4;if(_0x2fb93b>=_0x202325){_0x2fb93b=_0x202325;_0x4209f4=0xc8;}else{_0x4209f4=0xce;}_0xc4cb6c['status'](_0x4209f4);return _0xc4cb6c['set']('Content-Range',_0x3c9dc5+'-'+_0x2fb93b+'/'+_0x202325)[_0x1721('0x1b')](_0x401408);}return null;};}function patchUpdates(_0x332d6e){return function(_0x3aad10){try{jsonpatch[_0x1721('0x20')](_0x3aad10,_0x332d6e,!![]);}catch(_0x31aca9){return BPromise[_0x1721('0x21')](_0x31aca9);}return _0x3aad10['save']();};}function saveUpdates(_0x3cf917,_0x58109c){return function(_0x52bf00){if(_0x52bf00){return _0x52bf00['update'](_0x3cf917)[_0x1721('0x22')](function(_0x391ff9){return _0x391ff9;});}return null;};}function removeEntity(_0x54d1ff,_0x5e311e){return function(_0x23cf4b){if(_0x23cf4b){return _0x23cf4b['destroy']()[_0x1721('0x22')](function(){_0x54d1ff[_0x1721('0x19')](0xcc)[_0x1721('0x1a')]();});}};}function handleEntityNotFound(_0x58f62d,_0x1c2239){return function(_0x5ceec4){if(!_0x5ceec4){_0x58f62d[_0x1721('0x18')](0x194);}return _0x5ceec4;};}function handleError(_0x4aa791,_0x277ac4){_0x277ac4=_0x277ac4||0x1f4;return function(_0x352b6c){logger[_0x1721('0x23')](_0x352b6c[_0x1721('0x24')]);if(_0x352b6c['name']){delete _0x352b6c[_0x1721('0x25')];}_0x4aa791['status'](_0x277ac4)['send'](_0x352b6c);};}exports[_0x1721('0x26')]=function(_0x47b22b,_0x2b832b){var _0x4004e4={},_0x24cf03={},_0x2dba6f={'count':0x0,'rows':[]};var _0x244b3d=_[_0x1721('0x27')](db[_0x1721('0x28')][_0x1721('0x29')],function(_0x36d169){return{'name':_0x36d169['fieldName'],'type':_0x36d169['type'][_0x1721('0x2a')]};});_0x24cf03['model']=_[_0x1721('0x27')](_0x244b3d,_0x1721('0x25'));_0x24cf03[_0x1721('0x2b')]=_[_0x1721('0x2c')](_0x47b22b[_0x1721('0x2b')]);_0x24cf03[_0x1721('0x2d')]=_[_0x1721('0x2e')](_0x24cf03[_0x1721('0x2f')],_0x24cf03[_0x1721('0x2b')]);_0x4004e4[_0x1721('0x30')]=_['intersection'](_0x24cf03[_0x1721('0x2f')],qs[_0x1721('0x31')](_0x47b22b[_0x1721('0x2b')][_0x1721('0x31')]));_0x4004e4[_0x1721('0x30')]=_0x4004e4['attributes'][_0x1721('0x32')]?_0x4004e4[_0x1721('0x30')]:_0x24cf03[_0x1721('0x2f')];if(!_0x47b22b[_0x1721('0x2b')][_0x1721('0x33')](_0x1721('0x34'))){_0x4004e4['limit']=qs[_0x1721('0x1e')](_0x47b22b[_0x1721('0x2b')]['limit']);_0x4004e4[_0x1721('0x1c')]=qs[_0x1721('0x1c')](_0x47b22b['query'][_0x1721('0x1c')]);}_0x4004e4[_0x1721('0x35')]=qs['sort'](_0x47b22b[_0x1721('0x2b')]['sort']);_0x4004e4[_0x1721('0x36')]=qs[_0x1721('0x2d')](_[_0x1721('0x37')](_0x47b22b[_0x1721('0x2b')],_0x24cf03[_0x1721('0x2d')]),_0x244b3d);if(_0x47b22b[_0x1721('0x2b')][_0x1721('0x38')]){_0x4004e4[_0x1721('0x36')]=_[_0x1721('0x39')](_0x4004e4[_0x1721('0x36')],{'$or':_[_0x1721('0x27')](_0x244b3d,function(_0x15cfbf){if(_0x15cfbf[_0x1721('0x3a')]!==_0x1721('0x3b')){var _0x240325={};_0x240325[_0x15cfbf[_0x1721('0x25')]]={'$like':'%'+_0x47b22b['query'][_0x1721('0x38')]+'%'};return _0x240325;}})});}_0x4004e4=_[_0x1721('0x39')]({},_0x4004e4,_0x47b22b[_0x1721('0x3c')]);var _0xe8efbe={'where':_0x4004e4[_0x1721('0x36')]};return db[_0x1721('0x28')][_0x1721('0x1f')](_0xe8efbe)[_0x1721('0x22')](function(_0x4d706e){_0x2dba6f[_0x1721('0x1f')]=_0x4d706e;if(_0x47b22b[_0x1721('0x2b')][_0x1721('0x3d')]){_0x4004e4[_0x1721('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x1721('0x3f')](_0x4004e4);})[_0x1721('0x22')](function(_0x117865){_0x2dba6f[_0x1721('0x40')]=_0x117865;return _0x2dba6f;})[_0x1721('0x22')](respondWithFilteredResult(_0x2b832b,_0x4004e4))[_0x1721('0x41')](handleError(_0x2b832b,null));};exports[_0x1721('0x42')]=function(_0x3b006a,_0x377361){var _0x194333={'raw':!![],'where':{'id':_0x3b006a['params']['id']}},_0x43308f={};_0x43308f['model']=_[_0x1721('0x2c')](db['VtigerField']['rawAttributes']);_0x43308f[_0x1721('0x2b')]=_[_0x1721('0x2c')](_0x3b006a[_0x1721('0x2b')]);_0x43308f[_0x1721('0x2d')]=_[_0x1721('0x2e')](_0x43308f[_0x1721('0x2f')],_0x43308f[_0x1721('0x2b')]);_0x194333[_0x1721('0x30')]=_['intersection'](_0x43308f[_0x1721('0x2f')],qs['fields'](_0x3b006a[_0x1721('0x2b')][_0x1721('0x31')]));_0x194333[_0x1721('0x30')]=_0x194333[_0x1721('0x30')][_0x1721('0x32')]?_0x194333[_0x1721('0x30')]:_0x43308f[_0x1721('0x2f')];if(_0x3b006a[_0x1721('0x2b')][_0x1721('0x3d')]){_0x194333[_0x1721('0x3e')]=[{'all':!![]}];}_0x194333=_[_0x1721('0x39')]({},_0x194333,_0x3b006a[_0x1721('0x3c')]);return db['VtigerField'][_0x1721('0x43')](_0x194333)[_0x1721('0x22')](handleEntityNotFound(_0x377361,null))[_0x1721('0x22')](respondWithResult(_0x377361,null))[_0x1721('0x41')](handleError(_0x377361,null));};exports[_0x1721('0x44')]=function(_0x171e38,_0x9092cc){return db['VtigerField'][_0x1721('0x44')](_0x171e38[_0x1721('0x45')],{})[_0x1721('0x22')](respondWithResult(_0x9092cc,0xc9))[_0x1721('0x41')](handleError(_0x9092cc,null));};exports[_0x1721('0x46')]=function(_0x590d55,_0x1e0b19){if(_0x590d55[_0x1721('0x45')]['id']){delete _0x590d55[_0x1721('0x45')]['id'];}return db[_0x1721('0x28')][_0x1721('0x43')]({'where':{'id':_0x590d55[_0x1721('0x47')]['id']}})[_0x1721('0x22')](handleEntityNotFound(_0x1e0b19,null))[_0x1721('0x22')](saveUpdates(_0x590d55[_0x1721('0x45')],null))[_0x1721('0x22')](respondWithResult(_0x1e0b19,null))[_0x1721('0x41')](handleError(_0x1e0b19,null));};exports[_0x1721('0x48')]=function(_0x54f28e,_0x5088e4){return db[_0x1721('0x28')][_0x1721('0x43')]({'where':{'id':_0x54f28e[_0x1721('0x47')]['id']}})[_0x1721('0x22')](handleEntityNotFound(_0x5088e4,null))[_0x1721('0x22')](removeEntity(_0x5088e4,null))[_0x1721('0x41')](handleError(_0x5088e4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 4293e1c..49b2315 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 _0x155a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','vtiger_unique_index','FieldId'];(function(_0x205733,_0x350fa4){var _0x433f84=function(_0x5108d3){while(--_0x5108d3){_0x205733['push'](_0x205733['shift']());}};_0x433f84(++_0x350fa4);}(_0x155a,0x96));var _0xa155=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x155a[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xa155('0x0'));var util=require(_0xa155('0x1'));var logger=require(_0xa155('0x2'))(_0xa155('0x3'));var moment=require(_0xa155('0x4'));var BPromise=require(_0xa155('0x5'));var rp=require(_0xa155('0x6'));var fs=require('fs');var path=require(_0xa155('0x7'));var rimraf=require(_0xa155('0x8'));var config=require(_0xa155('0x9'));var attributes=require(_0xa155('0xa'));module['exports']=function(_0x5236ac,_0x5a85f8){return _0x5236ac[_0xa155('0xb')](_0xa155('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xa155('0xd'),'fields':['idField',_0xa155('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bc1=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x5bc1,0x193));var _0x15bc=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0x5bc1[_0x295583];return _0x4c2ae6;};'use strict';var _=require(_0x15bc('0x0'));var util=require(_0x15bc('0x1'));var logger=require(_0x15bc('0x2'))(_0x15bc('0x3'));var moment=require(_0x15bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x15bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15bc('0x6'));var config=require(_0x15bc('0x7'));var attributes=require(_0x15bc('0x8'));module[_0x15bc('0x9')]=function(_0x11e88c,_0x394641){return _0x11e88c[_0x15bc('0xa')](_0x15bc('0xb'),attributes,{'tableName':_0x15bc('0xc'),'paranoid':![],'indexes':[{'name':_0x15bc('0xd'),'fields':[_0x15bc('0xe'),_0x15bc('0xf')],'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 e94ee93..09f7d94 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 _0x7d48=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x4e69ad,_0x42469f){var _0x52bf84=function(_0x535849){while(--_0x535849){_0x4e69ad['push'](_0x4e69ad['shift']());}};_0x52bf84(++_0x42469f);}(_0x7d48,0xd8));var _0x87d4=function(_0x2c5828,_0x1f5fcf){_0x2c5828=_0x2c5828-0x0;var _0x538aad=_0x7d48[_0x2c5828];return _0x538aad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x87d4('0x0'));var BPromise=require(_0x87d4('0x1'));var rs=require(_0x87d4('0x2'));var fs=require('fs');var Redis=require(_0x87d4('0x3'));var db=require(_0x87d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x87d4('0x5'));var config=require(_0x87d4('0x6'));var jayson=require(_0x87d4('0x7'));var client=jayson[_0x87d4('0x8')][_0x87d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4377f3,_0xcfff87,_0x10d6b6){return new BPromise(function(_0x212305,_0x1bb91e){return client['request'](_0x4377f3,_0x10d6b6)[_0x87d4('0xa')](function(_0x1b517b){logger[_0x87d4('0xb')]('VtigerField,\x20%s,\x20%s',_0xcfff87,_0x87d4('0xc'));logger[_0x87d4('0xd')](_0x87d4('0xe'),_0xcfff87,_0x87d4('0xc'),JSON[_0x87d4('0xf')](_0x1b517b));if(_0x1b517b[_0x87d4('0x10')]){if(_0x1b517b[_0x87d4('0x10')][_0x87d4('0x11')]===0x1f4){logger['error'](_0x87d4('0x12'),_0xcfff87,_0x1b517b[_0x87d4('0x10')][_0x87d4('0x13')]);return _0x1bb91e(_0x1b517b['error'][_0x87d4('0x13')]);}logger[_0x87d4('0x10')]('VtigerField,\x20%s,\x20%s',_0xcfff87,_0x1b517b[_0x87d4('0x10')][_0x87d4('0x13')]);return _0x212305(_0x1b517b[_0x87d4('0x10')][_0x87d4('0x13')]);}else{logger[_0x87d4('0xb')](_0x87d4('0x12'),_0xcfff87,'request\x20sent');_0x212305(_0x1b517b[_0x87d4('0x14')][_0x87d4('0x13')]);}})['catch'](function(_0x240e7b){logger[_0x87d4('0x10')](_0x87d4('0x12'),_0xcfff87,_0x240e7b);_0x1bb91e(_0x240e7b);});});} \ No newline at end of file +var _0xb50e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x58755a,_0x44f1b8){var _0x27d13a=function(_0x4d0546){while(--_0x4d0546){_0x58755a['push'](_0x58755a['shift']());}};_0x27d13a(++_0x44f1b8);}(_0xb50e,0xee));var _0xeb50=function(_0x216c2f,_0xaf2d0e){_0x216c2f=_0x216c2f-0x0;var _0x1b6b9a=_0xb50e[_0x216c2f];return _0x1b6b9a;};'use strict';var _=require('lodash');var util=require(_0xeb50('0x0'));var moment=require('moment');var BPromise=require(_0xeb50('0x1'));var rs=require(_0xeb50('0x2'));var fs=require('fs');var Redis=require(_0xeb50('0x3'));var db=require(_0xeb50('0x4'))['db'];var utils=require(_0xeb50('0x5'));var logger=require('../../config/logger')(_0xeb50('0x6'));var config=require(_0xeb50('0x7'));var jayson=require(_0xeb50('0x8'));var client=jayson['client'][_0xeb50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39976d,_0x12cccb,_0x1e6d13){return new BPromise(function(_0x3fe654,_0x3f40cd){return client[_0xeb50('0xa')](_0x39976d,_0x1e6d13)[_0xeb50('0xb')](function(_0x483a54){logger[_0xeb50('0xc')](_0xeb50('0xd'),_0x12cccb,_0xeb50('0xe'));logger[_0xeb50('0xf')](_0xeb50('0x10'),_0x12cccb,_0xeb50('0xe'),JSON[_0xeb50('0x11')](_0x483a54));if(_0x483a54[_0xeb50('0x12')]){if(_0x483a54[_0xeb50('0x12')][_0xeb50('0x13')]===0x1f4){logger[_0xeb50('0x12')]('VtigerField,\x20%s,\x20%s',_0x12cccb,_0x483a54[_0xeb50('0x12')][_0xeb50('0x14')]);return _0x3f40cd(_0x483a54['error']['message']);}logger['error'](_0xeb50('0xd'),_0x12cccb,_0x483a54['error'][_0xeb50('0x14')]);return _0x3fe654(_0x483a54[_0xeb50('0x12')]['message']);}else{logger['info'](_0xeb50('0xd'),_0x12cccb,_0xeb50('0xe'));_0x3fe654(_0x483a54[_0xeb50('0x15')][_0xeb50('0x14')]);}})['catch'](function(_0x2d91fe){logger[_0xeb50('0x12')](_0xeb50('0xd'),_0x12cccb,_0x2d91fe);_0x3f40cd(_0x2d91fe);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 70a2e96..89c4d5f 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 _0x8b6b=['update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','/:id'];(function(_0x242e41,_0x2beb78){var _0x171510=function(_0x4d8a5a){while(--_0x4d8a5a){_0x242e41['push'](_0x242e41['shift']());}};_0x171510(++_0x2beb78);}(_0x8b6b,0x13d));var _0xb8b6=function(_0x51e49e,_0x2e95d2){_0x51e49e=_0x51e49e-0x0;var _0x429917=_0x8b6b[_0x51e49e];return _0x429917;};'use strict';var multer=require('multer');var util=require(_0xb8b6('0x0'));var path=require(_0xb8b6('0x1'));var timeout=require(_0xb8b6('0x2'));var express=require(_0xb8b6('0x3'));var router=express[_0xb8b6('0x4')]();var fs_extra=require(_0xb8b6('0x5'));var auth=require(_0xb8b6('0x6'));var interaction=require(_0xb8b6('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xb8b6('0x8')]('/',auth[_0xb8b6('0x9')](),controller['index']);router[_0xb8b6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb8b6('0xa')]);router[_0xb8b6('0x8')]('/:id/configurations',auth[_0xb8b6('0x9')](),controller[_0xb8b6('0xb')]);router[_0xb8b6('0x8')](_0xb8b6('0xc'),auth[_0xb8b6('0x9')](),controller[_0xb8b6('0xd')]);router['post']('/',auth[_0xb8b6('0x9')](),controller[_0xb8b6('0xe')]);router['post'](_0xb8b6('0xf'),auth[_0xb8b6('0x9')](),controller[_0xb8b6('0x10')]);router[_0xb8b6('0x11')](_0xb8b6('0x12'),auth[_0xb8b6('0x9')](),controller[_0xb8b6('0x13')]);router[_0xb8b6('0x14')](_0xb8b6('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x250c=['getConfigurations','/:id/fields','getFields','create','/:id/configurations','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x390d3b,_0x24bddb){var _0x5f201c=function(_0x15998c){while(--_0x15998c){_0x390d3b['push'](_0x390d3b['shift']());}};_0x5f201c(++_0x24bddb);}(_0x250c,0x191));var _0xc250=function(_0x4add72,_0x95a9dc){_0x4add72=_0x4add72-0x0;var _0x1ab1d7=_0x250c[_0x4add72];return _0x1ab1d7;};'use strict';var multer=require('multer');var util=require(_0xc250('0x0'));var path=require(_0xc250('0x1'));var timeout=require(_0xc250('0x2'));var express=require(_0xc250('0x3'));var router=express[_0xc250('0x4')]();var fs_extra=require(_0xc250('0x5'));var auth=require(_0xc250('0x6'));var interaction=require(_0xc250('0x7'));var config=require('../../config/environment');var controller=require(_0xc250('0x8'));router[_0xc250('0x9')]('/',auth[_0xc250('0xa')](),controller['index']);router['get'](_0xc250('0xb'),auth[_0xc250('0xa')](),controller[_0xc250('0xc')]);router[_0xc250('0x9')]('/:id/configurations',auth[_0xc250('0xa')](),controller[_0xc250('0xd')]);router[_0xc250('0x9')](_0xc250('0xe'),auth[_0xc250('0xa')](),controller[_0xc250('0xf')]);router['post']('/',auth[_0xc250('0xa')](),controller[_0xc250('0x10')]);router['post'](_0xc250('0x11'),auth[_0xc250('0xa')](),controller['addConfiguration']);router[_0xc250('0x12')](_0xc250('0xb'),auth[_0xc250('0xa')](),controller[_0xc250('0x13')]);router[_0xc250('0x14')]('/:id',auth[_0xc250('0xa')](),controller[_0xc250('0x15')]);module[_0xc250('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 58befa1..06a10f7 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 _0x9c63=['exports','STRING','ENUM','password','token','newTab','integrationTab','sequelize'];(function(_0x158f64,_0x2d49fb){var _0x3b5ef1=function(_0x519b2f){while(--_0x519b2f){_0x158f64['push'](_0x158f64['shift']());}};_0x3b5ef1(++_0x2d49fb);}(_0x9c63,0x1a7));var _0x39c6=function(_0x54b8b5,_0x896520){_0x54b8b5=_0x54b8b5-0x0;var _0x3bc7a1=_0x9c63[_0x54b8b5];return _0x3bc7a1;};'use strict';var Sequelize=require(_0x39c6('0x0'));module[_0x39c6('0x1')]={'name':{'type':Sequelize[_0x39c6('0x2')]},'description':{'type':Sequelize[_0x39c6('0x2')]},'username':{'type':Sequelize[_0x39c6('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x39c6('0x2')]},'token':{'type':Sequelize[_0x39c6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x39c6('0x3')](_0x39c6('0x4'),_0x39c6('0x5')),'defaultValue':_0x39c6('0x4')},'serverUrl':{'type':Sequelize[_0x39c6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x39c6('0x3')]('integrationTab',_0x39c6('0x6')),'defaultValue':_0x39c6('0x7')}}; \ No newline at end of file +var _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x41ec,0x143));var _0xc41e=function(_0x178dac,_0x4e893b){_0x178dac=_0x178dac-0x0;var _0x19a2cb=_0x41ec[_0x178dac];return _0x19a2cb;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5a213f6..bd3b8fb 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 _0xe511=['getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','create','getFields','username','password','authType','remoteUri','substring','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','send','test','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','stack','index','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','findAll','catch','show','params','rawAttributes','fields','options','body','find','nolimit'];(function(_0x56c024,_0x2d2949){var _0x16b5ec=function(_0x5706e1){while(--_0x5706e1){_0x56c024['push'](_0x56c024['shift']());}};_0x16b5ec(++_0x2d2949);}(_0xe511,0x16f));var _0x1e51=function(_0x4d2a51,_0x4b208c){_0x4d2a51=_0x4d2a51-0x0;var _0x7d9ab2=_0xe511[_0x4d2a51];return _0x7d9ab2;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];var integrations=require(_0x1e51('0x18'));function respondWithStatusCode(_0x5544eb,_0x408a77){_0x408a77=_0x408a77||0xcc;return function(_0x102f01){if(_0x102f01){return _0x5544eb[_0x1e51('0x19')](_0x408a77);}return _0x5544eb[_0x1e51('0x1a')](_0x408a77)[_0x1e51('0x1b')]();};}function respondWithResult(_0x32945d,_0x441c70){_0x441c70=_0x441c70||0xc8;return function(_0x467e77){if(_0x467e77){return _0x32945d[_0x1e51('0x1a')](_0x441c70)[_0x1e51('0x1c')](_0x467e77);}};}function respondWithFilteredResult(_0x5a5c07,_0x3b01b7){return function(_0x24db4f){if(_0x24db4f){var _0x4526b4=typeof _0x3b01b7['offset']===_0x1e51('0x1d')&&typeof _0x3b01b7['limit']==='undefined';var _0x1f6f4e=_0x24db4f[_0x1e51('0x1e')];var _0x40ae4c=_0x4526b4?0x0:_0x3b01b7[_0x1e51('0x1f')];var _0x4d1aae=_0x4526b4?_0x24db4f[_0x1e51('0x1e')]:_0x3b01b7['offset']+_0x3b01b7[_0x1e51('0x20')];var _0x4a9272;if(_0x4d1aae>=_0x1f6f4e){_0x4d1aae=_0x1f6f4e;_0x4a9272=0xc8;}else{_0x4a9272=0xce;}_0x5a5c07[_0x1e51('0x1a')](_0x4a9272);return _0x5a5c07[_0x1e51('0x21')](_0x1e51('0x22'),_0x40ae4c+'-'+_0x4d1aae+'/'+_0x1f6f4e)[_0x1e51('0x1c')](_0x24db4f);}return null;};}function patchUpdates(_0x506f40){return function(_0x5223c3){try{jsonpatch['apply'](_0x5223c3,_0x506f40,!![]);}catch(_0x548c32){return BPromise[_0x1e51('0x23')](_0x548c32);}return _0x5223c3['save']();};}function saveUpdates(_0x3f7340,_0x28aacb){return function(_0x415154){if(_0x415154){return _0x415154[_0x1e51('0x24')](_0x3f7340)[_0x1e51('0x25')](function(_0xf9298){return _0xf9298;});}return null;};}function removeEntity(_0x270adf,_0x461d3d){return function(_0x4bcdd3){if(_0x4bcdd3){return _0x4bcdd3['destroy']()[_0x1e51('0x25')](function(){_0x270adf[_0x1e51('0x1a')](0xcc)[_0x1e51('0x1b')]();});}};}function handleEntityNotFound(_0x1386db,_0x505d79){return function(_0x54d031){if(!_0x54d031){_0x1386db['sendStatus'](0x194);}return _0x54d031;};}function handleError(_0x1eb83f,_0x2a1561){_0x2a1561=_0x2a1561||0x1f4;return function(_0x433c2d){logger['error'](_0x433c2d[_0x1e51('0x26')]);if(_0x433c2d['name']){delete _0x433c2d['name'];}_0x1eb83f[_0x1e51('0x1a')](_0x2a1561)['send'](_0x433c2d);};}exports[_0x1e51('0x27')]=function(_0x1eb79f,_0x56722f){var _0x3e6ef2={},_0x10ee23={},_0x71c7af={'count':0x0,'rows':[]};var _0x6862d1=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x20eb9b){return{'name':_0x20eb9b[_0x1e51('0x28')],'type':_0x20eb9b[_0x1e51('0x29')][_0x1e51('0x2a')]};});_0x10ee23[_0x1e51('0x2b')]=_[_0x1e51('0x2c')](_0x6862d1,_0x1e51('0x2d'));_0x10ee23[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x1eb79f[_0x1e51('0x2e')]);_0x10ee23[_0x1e51('0x30')]=_['intersection'](_0x10ee23[_0x1e51('0x2b')],_0x10ee23[_0x1e51('0x2e')]);_0x3e6ef2[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x10ee23[_0x1e51('0x2b')],qs['fields'](_0x1eb79f[_0x1e51('0x2e')]['fields']));_0x3e6ef2[_0x1e51('0x31')]=_0x3e6ef2[_0x1e51('0x31')][_0x1e51('0x33')]?_0x3e6ef2['attributes']:_0x10ee23[_0x1e51('0x2b')];if(!_0x1eb79f['query'][_0x1e51('0x34')]('nolimit')){_0x3e6ef2['limit']=qs[_0x1e51('0x20')](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x3e6ef2['offset']=qs[_0x1e51('0x1f')](_0x1eb79f['query'][_0x1e51('0x1f')]);}_0x3e6ef2[_0x1e51('0x35')]=qs['sort'](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x3e6ef2[_0x1e51('0x37')]=qs[_0x1e51('0x30')](_[_0x1e51('0x38')](_0x1eb79f[_0x1e51('0x2e')],_0x10ee23['filters']),_0x6862d1);if(_0x1eb79f['query'][_0x1e51('0x39')]){_0x3e6ef2['where']=_[_0x1e51('0x3a')](_0x3e6ef2[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x6862d1,function(_0xcfa1d8){if(_0xcfa1d8[_0x1e51('0x29')]!==_0x1e51('0x3b')){var _0x845a62={};_0x845a62[_0xcfa1d8[_0x1e51('0x2d')]]={'$like':'%'+_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x845a62;}})});}_0x3e6ef2=_[_0x1e51('0x3a')]({},_0x3e6ef2,_0x1eb79f['options']);var _0x29a689={'where':_0x3e6ef2['where']};return db[_0x1e51('0x3c')][_0x1e51('0x1e')](_0x29a689)[_0x1e51('0x25')](function(_0x471386){_0x71c7af[_0x1e51('0x1e')]=_0x471386;if(_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x3e6ef2[_0x1e51('0x3e')]=[{'all':!![]}];}return db[_0x1e51('0x3c')][_0x1e51('0x3f')](_0x3e6ef2);})[_0x1e51('0x25')](function(_0x5b4b3f){_0x71c7af['rows']=_0x5b4b3f;return _0x71c7af;})[_0x1e51('0x25')](respondWithFilteredResult(_0x56722f,_0x3e6ef2))[_0x1e51('0x40')](handleError(_0x56722f,null));};exports[_0x1e51('0x41')]=function(_0x4650e4,_0x1ef3d3){var _0x1a9e0d={'raw':![],'where':{'id':_0x4650e4[_0x1e51('0x42')]['id']}},_0x25592c={};_0x25592c['model']=_[_0x1e51('0x2f')](db[_0x1e51('0x3c')][_0x1e51('0x43')]);_0x25592c[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x4650e4[_0x1e51('0x2e')]);_0x25592c[_0x1e51('0x30')]=_['intersection'](_0x25592c[_0x1e51('0x2b')],_0x25592c[_0x1e51('0x2e')]);_0x1a9e0d['attributes']=_[_0x1e51('0x32')](_0x25592c[_0x1e51('0x2b')],qs[_0x1e51('0x44')](_0x4650e4['query'][_0x1e51('0x44')]));_0x1a9e0d[_0x1e51('0x31')]=_0x1a9e0d[_0x1e51('0x31')][_0x1e51('0x33')]?_0x1a9e0d[_0x1e51('0x31')]:_0x25592c[_0x1e51('0x2b')];if(_0x4650e4[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x1a9e0d[_0x1e51('0x3e')]=[{'all':!![]}];}_0x1a9e0d=_['merge']({},_0x1a9e0d,_0x4650e4[_0x1e51('0x45')]);return db[_0x1e51('0x3c')]['find'](_0x1a9e0d)[_0x1e51('0x25')](handleEntityNotFound(_0x1ef3d3,null))[_0x1e51('0x25')](respondWithResult(_0x1ef3d3,null))[_0x1e51('0x40')](handleError(_0x1ef3d3,null));};exports['create']=function(_0x44468a,_0x4634de){return db[_0x1e51('0x3c')]['create'](_0x44468a[_0x1e51('0x46')],{})['then'](respondWithResult(_0x4634de,0xc9))['catch'](handleError(_0x4634de,null));};exports['update']=function(_0x169e6c,_0x2e79ca){if(_0x169e6c['body']['id']){delete _0x169e6c['body']['id'];}return db[_0x1e51('0x3c')][_0x1e51('0x47')]({'where':{'id':_0x169e6c[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x2e79ca,null))[_0x1e51('0x25')](saveUpdates(_0x169e6c[_0x1e51('0x46')],null))['then'](respondWithResult(_0x2e79ca,null))[_0x1e51('0x40')](handleError(_0x2e79ca,null));};exports['destroy']=function(_0xf6bd35,_0x43589a){return db['ZendeskAccount']['find']({'where':{'id':_0xf6bd35['params']['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x43589a,null))[_0x1e51('0x25')](removeEntity(_0x43589a,null))[_0x1e51('0x40')](handleError(_0x43589a,null));};exports['getConfigurations']=function(_0x2fdee1,_0x1fe669,_0x4226da){var _0x2100d4={};var _0x1ccb55={};var _0x12584c;var _0x32fe1f;return db[_0x1e51('0x3c')]['findOne']({'where':{'id':_0x2fdee1[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x1fe669,null))[_0x1e51('0x25')](function(_0x213edb){if(_0x213edb){_0x12584c=_0x213edb;_0x1ccb55[_0x1e51('0x2b')]=_[_0x1e51('0x2f')](db['ZendeskConfiguration'][_0x1e51('0x43')]);_0x1ccb55['query']=_['keys'](_0x2fdee1['query']);_0x1ccb55[_0x1e51('0x30')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],_0x1ccb55['query']);_0x2100d4[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],qs['fields'](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x44')]));_0x2100d4[_0x1e51('0x31')]=_0x2100d4['attributes'][_0x1e51('0x33')]?_0x2100d4[_0x1e51('0x31')]:_0x1ccb55[_0x1e51('0x2b')];_0x2100d4[_0x1e51('0x35')]=qs[_0x1e51('0x36')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x2100d4[_0x1e51('0x37')]=qs['filters'](_[_0x1e51('0x38')](_0x2fdee1[_0x1e51('0x2e')],_0x1ccb55['filters']));if(_0x2fdee1['query']['filter']){_0x2100d4[_0x1e51('0x37')]=_[_0x1e51('0x3a')](_0x2100d4[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x2100d4[_0x1e51('0x31')],function(_0x3c322c){var _0x45b649={};_0x45b649[_0x3c322c]={'$like':'%'+_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x45b649;})});}_0x2100d4=_['merge']({},_0x2100d4,_0x2fdee1['options']);return _0x12584c['getConfigurations'](_0x2100d4);}})[_0x1e51('0x25')](function(_0x4048a4){if(_0x4048a4){_0x32fe1f=_0x4048a4['length'];if(!_0x2fdee1['query'][_0x1e51('0x34')](_0x1e51('0x48'))){_0x2100d4['limit']=qs[_0x1e51('0x20')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x2100d4[_0x1e51('0x1f')]=qs[_0x1e51('0x1f')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x1f')]);}return _0x12584c[_0x1e51('0x49')](_0x2100d4);}})[_0x1e51('0x25')](function(_0x32863f){if(_0x32863f){return _0x32863f?{'count':_0x32fe1f,'rows':_0x32863f}:null;}})['then'](respondWithResult(_0x1fe669,null))[_0x1e51('0x40')](handleError(_0x1fe669,null));};exports[_0x1e51('0x4a')]=function(_0x3657a2,_0x402bbd,_0xc720e2){if(_0x3657a2[_0x1e51('0x46')]['id']){delete _0x3657a2['body']['id'];}return db['ZendeskAccount'][_0x1e51('0x4b')]({'where':{'id':_0x3657a2[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x402bbd,null))[_0x1e51('0x25')](function(_0x52a439){if(_0x52a439){_0x3657a2['body']['AccountId']=_0x52a439['id'];_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4c')]=integrations[_0x1e51('0x4d')](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2['body'][_0x1e51('0x29')]);_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4f')]=integrations['getDescriptions'](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2[_0x1e51('0x46')]['type']);return db[_0x1e51('0x50')][_0x1e51('0x51')](_0x3657a2['body'],{'include':[{'model':db['ZendeskField'],'as':_0x1e51('0x4c')},{'model':db['ZendeskField'],'as':_0x1e51('0x4f')}]});}return null;})['then'](respondWithResult(_0x402bbd,null))[_0x1e51('0x40')](handleError(_0x402bbd,null));};exports[_0x1e51('0x52')]=function(_0x35f12e,_0x457e4a,_0x5142ed){var _0x37f3e6='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x35f12e[_0x1e51('0x42')]['id']},'attributes':['id',_0x1e51('0x53'),_0x1e51('0x54'),'token',_0x1e51('0x55'),_0x1e51('0x56')]})[_0x1e51('0x25')](handleEntityNotFound(_0x457e4a,null))[_0x1e51('0x25')](function(_0x5b76ae){if(_0x5b76ae){_0x37f3e6=_0x5b76ae[_0x1e51('0x56')];var _0x5ef17b=_0x37f3e6['slice'](-0x1);if(_0x5ef17b==='/'){_0x37f3e6=_0x37f3e6[_0x1e51('0x57')](0x0,_0x37f3e6['lastIndexOf'](_0x5ef17b));}var _0x35ece9={'method':'GET','uri':util[_0x1e51('0x58')]('%s/%s',_0x37f3e6,_0x1e51('0x59')),'json':!![]};switch(_0x5b76ae[_0x1e51('0x55')]){case'password':_0x35ece9[_0x1e51('0x5a')]={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5c'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x54')]))[_0x1e51('0x5d')]('base64'))};break;case _0x1e51('0x5e'):_0x35ece9['headers']={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5f'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x5e')]))[_0x1e51('0x5d')](_0x1e51('0x60')))};break;default:throw new db['Sequelize'][(_0x1e51('0x61'))](_0x1e51('0x62'));}return rp(_0x35ece9);}})[_0x1e51('0x25')](function(_0x4c6920){if(_0x4c6920){var _0x4da887=[_0x1e51('0x63'),_0x1e51('0x64'),'group',_0x1e51('0x65')];_[_0x1e51('0x66')](_0x4c6920['ticket_fields'],function(_0x5eb939){return _0x4da887[_0x1e51('0x67')](_0x5eb939[_0x1e51('0x29')]);});return{'count':_0x4c6920[_0x1e51('0x59')][_0x1e51('0x33')],'rows':_[_0x1e51('0x2c')](_0x4c6920[_0x1e51('0x59')],function(_0x3718d9){return{'id':_0x3718d9['id'],'name':_0x3718d9['position']>0x7?_0x3718d9['title']:_0x3718d9[_0x1e51('0x29')],'custom':_0x3718d9[_0x1e51('0x68')]>0x7?!![]:![],'options':_0x3718d9['system_field_options']?_0x3718d9[_0x1e51('0x69')]:_0x3718d9[_0x1e51('0x6a')]?_0x3718d9['custom_field_options']:[]};})};}})[_0x1e51('0x25')](respondWithResult(_0x457e4a,null))['catch'](function(_0x34b98f){var _0x561812=_0x35f12e['query']['test']?0x1f4:_0x34b98f['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1e51('0x52'),_0x561812,JSON['stringify'](_0x34b98f));delete _0x34b98f[_0x1e51('0x2d')];if(_0x561812===0x191){_0x561812=0x190;}_0x457e4a['status'](_0x561812)[_0x1e51('0x6b')](_0x35f12e[_0x1e51('0x2e')][_0x1e51('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x34b98f[_0x1e51('0x6d')]}:_0x34b98f);});}; \ No newline at end of file +var _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xb58b,0x1f1));var _0xbb58=function(_0x18a908,_0x1ef543){_0x18a908=_0x18a908-0x0;var _0x3d0d41=_0xb58b[_0x18a908];return _0x3d0d41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 72b2426..1118f0e 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 _0x44bd=['moment','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x44bd,0x6c));var _0xd44b=function(_0x128e7e,_0x2f9b63){_0x128e7e=_0x128e7e-0x0;var _0x4ab22e=_0x44bd[_0x128e7e];return _0x4ab22e;};'use strict';var _=require(_0xd44b('0x0'));var util=require(_0xd44b('0x1'));var logger=require(_0xd44b('0x2'))(_0xd44b('0x3'));var moment=require(_0xd44b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd44b('0x5'));var rimraf=require(_0xd44b('0x6'));var config=require(_0xd44b('0x7'));var attributes=require(_0xd44b('0x8'));var integrations=require(_0xd44b('0x9'));module[_0xd44b('0xa')]=function(_0x58ce68,_0x4a031a){return _0x58ce68[_0xd44b('0xb')](_0xd44b('0xc'),attributes,{'tableName':_0xd44b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dcf=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50efe3,_0x1905f0){var _0x216f61=function(_0x27730a){while(--_0x27730a){_0x50efe3['push'](_0x50efe3['shift']());}};_0x216f61(++_0x1905f0);}(_0x8dcf,0x80));var _0xf8dc=function(_0x13a441,_0x422a55){_0x13a441=_0x13a441-0x0;var _0x17726f=_0x8dcf[_0x13a441];return _0x17726f;};'use strict';var _=require(_0xf8dc('0x0'));var util=require(_0xf8dc('0x1'));var logger=require(_0xf8dc('0x2'))(_0xf8dc('0x3'));var moment=require(_0xf8dc('0x4'));var BPromise=require(_0xf8dc('0x5'));var rp=require(_0xf8dc('0x6'));var fs=require('fs');var path=require(_0xf8dc('0x7'));var rimraf=require('rimraf');var config=require(_0xf8dc('0x8'));var attributes=require(_0xf8dc('0x9'));var integrations=require(_0xf8dc('0xa'));module[_0xf8dc('0xb')]=function(_0x11d549,_0x5abf75){return _0x11d549[_0xf8dc('0xc')](_0xf8dc('0xd'),attributes,{'tableName':_0xf8dc('0xe'),'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 cf6cb7e..6955419 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 _0x33fa=['jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','ZendeskAccount','find','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x33fa,0xd0));var _0xa33f=function(_0xd0baae,_0x3020f4){_0xd0baae=_0xd0baae-0x0;var _0x538549=_0x33fa[_0xd0baae];return _0x538549;};'use strict';var _=require(_0xa33f('0x0'));var util=require(_0xa33f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa33f('0x2'));var fs=require('fs');var Redis=require(_0xa33f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa33f('0x4'));var logger=require(_0xa33f('0x5'))(_0xa33f('0x6'));var config=require(_0xa33f('0x7'));var jayson=require(_0xa33f('0x8'));var client=jayson[_0xa33f('0x9')][_0xa33f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10892f,_0xaaf4a2,_0x59e581){return new BPromise(function(_0x6b67af,_0x20f097){return client[_0xa33f('0xb')](_0x10892f,_0x59e581)[_0xa33f('0xc')](function(_0xd19e30){logger[_0xa33f('0xd')](_0xa33f('0xe'),_0xaaf4a2,_0xa33f('0xf'));logger[_0xa33f('0x10')](_0xa33f('0x11'),_0xaaf4a2,_0xa33f('0xf'),JSON['stringify'](_0xd19e30));if(_0xd19e30[_0xa33f('0x12')]){if(_0xd19e30[_0xa33f('0x12')][_0xa33f('0x13')]===0x1f4){logger['error'](_0xa33f('0xe'),_0xaaf4a2,_0xd19e30[_0xa33f('0x12')]['message']);return _0x20f097(_0xd19e30['error'][_0xa33f('0x14')]);}logger['error'](_0xa33f('0xe'),_0xaaf4a2,_0xd19e30['error']['message']);return _0x6b67af(_0xd19e30['error'][_0xa33f('0x14')]);}else{logger[_0xa33f('0xd')](_0xa33f('0xe'),_0xaaf4a2,_0xa33f('0xf'));_0x6b67af(_0xd19e30[_0xa33f('0x15')][_0xa33f('0x14')]);}})[_0xa33f('0x16')](function(_0x14e2b0){logger['error'](_0xa33f('0xe'),_0xaaf4a2,_0x14e2b0);_0x20f097(_0x14e2b0);});});}exports['GetZendeskAccount']=function(_0x41d171){var _0x10c55c=this;return new Promise(function(_0x545d75,_0x2d07a3){return db['ZendeskAccount']['findAll']({'raw':_0x41d171[_0xa33f('0x17')]?_0x41d171[_0xa33f('0x17')][_0xa33f('0x18')]===undefined?!![]:![]:!![],'where':_0x41d171[_0xa33f('0x17')]?_0x41d171[_0xa33f('0x17')][_0xa33f('0x19')]||null:null,'attributes':_0x41d171['options']?_0x41d171['options'][_0xa33f('0x1a')]||null:null,'limit':_0x41d171[_0xa33f('0x17')]?_0x41d171[_0xa33f('0x17')][_0xa33f('0x1b')]||null:null,'include':_0x41d171[_0xa33f('0x17')]?_0x41d171[_0xa33f('0x17')]['include']?_['map'](_0x41d171[_0xa33f('0x17')]['include'],function(_0x520811){return{'model':db[_0x520811['model']],'as':_0x520811['as'],'attributes':_0x520811['attributes'],'include':_0x520811[_0xa33f('0x1c')]?_[_0xa33f('0x1d')](_0x520811['include'],function(_0x2dc7cf){return{'model':db[_0x2dc7cf[_0xa33f('0x1e')]],'as':_0x2dc7cf['as'],'attributes':_0x2dc7cf['attributes'],'include':_0x2dc7cf[_0xa33f('0x1c')]?_[_0xa33f('0x1d')](_0x2dc7cf[_0xa33f('0x1c')],function(_0x4ec7cd){return{'model':db[_0x4ec7cd['model']],'as':_0x4ec7cd['as'],'attributes':_0x4ec7cd[_0xa33f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa33f('0xc')](function(_0x33665c){logger[_0xa33f('0xd')](_0xa33f('0x1f'),_0x41d171);logger[_0xa33f('0x10')](_0xa33f('0x1f'),_0x41d171,JSON[_0xa33f('0x20')](_0x33665c));_0x545d75(_0x33665c);})[_0xa33f('0x16')](function(_0x569369){logger['error'](_0xa33f('0x1f'),_0x569369[_0xa33f('0x14')],_0x41d171);_0x2d07a3(_0x10c55c['error'](0x1f4,_0x569369[_0xa33f('0x14')]));});});};exports[_0xa33f('0x21')]=function(_0x86d051){var _0x284daa=this;return new Promise(function(_0xabd600,_0x191807){return db[_0xa33f('0x22')][_0xa33f('0x23')]({'raw':_0x86d051[_0xa33f('0x17')]?_0x86d051[_0xa33f('0x17')][_0xa33f('0x18')]===undefined?!![]:![]:!![],'where':_0x86d051[_0xa33f('0x17')]?_0x86d051[_0xa33f('0x17')][_0xa33f('0x19')]||null:null,'attributes':_0x86d051['options']?_0x86d051[_0xa33f('0x17')][_0xa33f('0x1a')]||null:null,'include':_0x86d051[_0xa33f('0x17')]?_0x86d051[_0xa33f('0x17')][_0xa33f('0x1c')]?_[_0xa33f('0x1d')](_0x86d051[_0xa33f('0x17')]['include'],function(_0x5ee8b1){return{'model':db[_0x5ee8b1[_0xa33f('0x1e')]],'as':_0x5ee8b1['as'],'attributes':_0x5ee8b1[_0xa33f('0x1a')],'include':_0x5ee8b1['include']?_['map'](_0x5ee8b1[_0xa33f('0x1c')],function(_0x38524d){return{'model':db[_0x38524d[_0xa33f('0x1e')]],'as':_0x38524d['as'],'attributes':_0x38524d['attributes'],'include':_0x38524d[_0xa33f('0x1c')]?_[_0xa33f('0x1d')](_0x38524d['include'],function(_0xe6dddf){return{'model':db[_0xe6dddf[_0xa33f('0x1e')]],'as':_0xe6dddf['as'],'attributes':_0xe6dddf[_0xa33f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa33f('0xc')](function(_0x2a1bab){logger[_0xa33f('0xd')](_0xa33f('0x21'),_0x86d051);logger['debug'](_0xa33f('0x21'),_0x86d051,JSON['stringify'](_0x2a1bab));_0xabd600(_0x2a1bab);})['catch'](function(_0x444f94){logger[_0xa33f('0x12')](_0xa33f('0x21'),_0x444f94[_0xa33f('0x14')],_0x86d051);_0x191807(_0x284daa[_0xa33f('0x12')](0x1f4,_0x444f94[_0xa33f('0x14')]));});});}; \ No newline at end of file +var _0x8a62=['catch','ZendeskAccount','findAll','options','raw','attributes','include','map','model','GetZendeskAccount','debug','find','where','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x142b0d,_0x18330d){var _0x26886a=function(_0x3f07ec){while(--_0x3f07ec){_0x142b0d['push'](_0x142b0d['shift']());}};_0x26886a(++_0x18330d);}(_0x8a62,0x18f));var _0x28a6=function(_0x11a069,_0x2060be){_0x11a069=_0x11a069-0x0;var _0x14a423=_0x8a62[_0x11a069];return _0x14a423;};'use strict';var _=require(_0x28a6('0x0'));var util=require('util');var moment=require(_0x28a6('0x1'));var BPromise=require(_0x28a6('0x2'));var rs=require(_0x28a6('0x3'));var fs=require('fs');var Redis=require(_0x28a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28a6('0x5'));var logger=require(_0x28a6('0x6'))(_0x28a6('0x7'));var config=require(_0x28a6('0x8'));var jayson=require(_0x28a6('0x9'));var client=jayson[_0x28a6('0xa')][_0x28a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x97d860,_0x5ae651,_0x38bbb0){return new BPromise(function(_0x1e8c79,_0x2bef20){return client['request'](_0x97d860,_0x38bbb0)[_0x28a6('0xc')](function(_0x5accd2){logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,'request\x20sent');logger['debug'](_0x28a6('0xf'),_0x5ae651,'request\x20sent',JSON[_0x28a6('0x10')](_0x5accd2));if(_0x5accd2['error']){if(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x12')]===0x1f4){logger['error'](_0x28a6('0xe'),_0x5ae651,_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);return _0x2bef20(_0x5accd2[_0x28a6('0x11')]['message']);}logger[_0x28a6('0x11')](_0x28a6('0xe'),_0x5ae651,_0x5accd2['error']['message']);return _0x1e8c79(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);}else{logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,_0x28a6('0x14'));_0x1e8c79(_0x5accd2['result'][_0x28a6('0x13')]);}})[_0x28a6('0x15')](function(_0x2cc484){logger[_0x28a6('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5ae651,_0x2cc484);_0x2bef20(_0x2cc484);});});}exports['GetZendeskAccount']=function(_0x5433ca){var _0x2b4d7d=this;return new Promise(function(_0xa0919f,_0x5328c9){return db[_0x28a6('0x16')][_0x28a6('0x17')]({'raw':_0x5433ca[_0x28a6('0x18')]?_0x5433ca['options'][_0x28a6('0x19')]===undefined?!![]:![]:!![],'where':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')]['where']||null:null,'attributes':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')][_0x28a6('0x1a')]||null:null,'limit':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')]['limit']||null:null,'include':_0x5433ca['options']?_0x5433ca[_0x28a6('0x18')][_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x5433ca['options'][_0x28a6('0x1b')],function(_0x47d051){return{'model':db[_0x47d051[_0x28a6('0x1d')]],'as':_0x47d051['as'],'attributes':_0x47d051[_0x28a6('0x1a')],'include':_0x47d051['include']?_[_0x28a6('0x1c')](_0x47d051[_0x28a6('0x1b')],function(_0x48f976){return{'model':db[_0x48f976[_0x28a6('0x1d')]],'as':_0x48f976['as'],'attributes':_0x48f976[_0x28a6('0x1a')],'include':_0x48f976[_0x28a6('0x1b')]?_['map'](_0x48f976[_0x28a6('0x1b')],function(_0x21f6d4){return{'model':db[_0x21f6d4['model']],'as':_0x21f6d4['as'],'attributes':_0x21f6d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48daba){logger[_0x28a6('0xd')](_0x28a6('0x1e'),_0x5433ca);logger[_0x28a6('0x1f')](_0x28a6('0x1e'),_0x5433ca,JSON[_0x28a6('0x10')](_0x48daba));_0xa0919f(_0x48daba);})[_0x28a6('0x15')](function(_0x50cd4e){logger[_0x28a6('0x11')]('GetZendeskAccount',_0x50cd4e['message'],_0x5433ca);_0x5328c9(_0x2b4d7d[_0x28a6('0x11')](0x1f4,_0x50cd4e[_0x28a6('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x4716a1){var _0x11c5af=this;return new Promise(function(_0x301b69,_0x46b70f){return db[_0x28a6('0x16')][_0x28a6('0x20')]({'raw':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x21')]||null:null,'attributes':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1a')]||null:null,'include':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1b')],function(_0x3965bf){return{'model':db[_0x3965bf[_0x28a6('0x1d')]],'as':_0x3965bf['as'],'attributes':_0x3965bf[_0x28a6('0x1a')],'include':_0x3965bf[_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x3965bf[_0x28a6('0x1b')],function(_0x19cb42){return{'model':db[_0x19cb42[_0x28a6('0x1d')]],'as':_0x19cb42['as'],'attributes':_0x19cb42[_0x28a6('0x1a')],'include':_0x19cb42[_0x28a6('0x1b')]?_['map'](_0x19cb42['include'],function(_0x268adf){return{'model':db[_0x268adf[_0x28a6('0x1d')]],'as':_0x268adf['as'],'attributes':_0x268adf[_0x28a6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x286287){logger[_0x28a6('0xd')](_0x28a6('0x22'),_0x4716a1);logger[_0x28a6('0x1f')](_0x28a6('0x22'),_0x4716a1,JSON[_0x28a6('0x10')](_0x286287));_0x301b69(_0x286287);})[_0x28a6('0x15')](function(_0x349702){logger[_0x28a6('0x11')]('ShowZendeskAccount',_0x349702[_0x28a6('0x13')],_0x4716a1);_0x46b70f(_0x11c5af[_0x28a6('0x11')](0x1f4,_0x349702[_0x28a6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b13c1e0..186a426 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 _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x1eeb15,_0x539688){var _0x12a9ce=function(_0x3933de){while(--_0x3933de){_0x1eeb15['push'](_0x1eeb15['shift']());}};_0x12a9ce(++_0x539688);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xcb91[_0x1f27df];return _0x286ee2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ab6ea,_0x5dd72d){var _0x11aeb1=function(_0x17da6e){while(--_0x17da6e){_0x4ab6ea['push'](_0x4ab6ea['shift']());}};_0x11aeb1(++_0x5dd72d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xe5b5[_0x25bca6];return _0x3f8d02;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 605f364..a688135 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 _0xd84b=['sequelize','STRING'];(function(_0x2b8d5b,_0x62fcaa){var _0x261bbf=function(_0x28441d){while(--_0x28441d){_0x2b8d5b['push'](_0x2b8d5b['shift']());}};_0x261bbf(++_0x62fcaa);}(_0xd84b,0xc0));var _0xbd84=function(_0x3a5d65,_0x30ce02){_0x3a5d65=_0x3a5d65-0x0;var _0x7b8e61=_0xd84b[_0x3a5d65];return _0x7b8e61;};'use strict';var Sequelize=require(_0xbd84('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd84('0x1')]},'description':{'type':Sequelize[_0xbd84('0x1')]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index bbf9d2e..38fa986 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 _0xfe3a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','setTags','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xfe3a,0x1e7));var _0xafe3=function(_0x193f85,_0x4c61fb){_0x193f85=_0x193f85-0x0;var _0x4a6979=_0xfe3a[_0x193f85];return _0x4a6979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafe3('0x0'));var zipdir=require(_0xafe3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafe3('0x2'));var moment=require(_0xafe3('0x3'));var BPromise=require(_0xafe3('0x4'));var Mustache=require(_0xafe3('0x5'));var util=require(_0xafe3('0x6'));var path=require(_0xafe3('0x7'));var sox=require(_0xafe3('0x8'));var csv=require(_0xafe3('0x9'));var ejs=require(_0xafe3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafe3('0xb'));var squel=require(_0xafe3('0xc'));var crypto=require(_0xafe3('0xd'));var jsforce=require(_0xafe3('0xe'));var deskjs=require(_0xafe3('0xf'));var toCsv=require(_0xafe3('0x9'));var querystring=require(_0xafe3('0x10'));var Papa=require(_0xafe3('0x11'));var Redis=require(_0xafe3('0x12'));var authService=require(_0xafe3('0x13'));var qs=require(_0xafe3('0x14'));var as=require(_0xafe3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafe3('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xafe3('0x17'));var licenseUtil=require(_0xafe3('0x18'));var db=require(_0xafe3('0x19'))['db'];function respondWithStatusCode(_0x5a86d3,_0x550896){_0x550896=_0x550896||0xcc;return function(_0x2bdce0){if(_0x2bdce0){return _0x5a86d3[_0xafe3('0x1a')](_0x550896);}return _0x5a86d3[_0xafe3('0x1b')](_0x550896)['end']();};}function respondWithResult(_0x4bf20c,_0x331445){_0x331445=_0x331445||0xc8;return function(_0xf38e96){if(_0xf38e96){return _0x4bf20c[_0xafe3('0x1b')](_0x331445)[_0xafe3('0x1c')](_0xf38e96);}};}function respondWithFilteredResult(_0x3ab84e,_0x3d6c72){return function(_0x48ed29){if(_0x48ed29){var _0x5608e7=typeof _0x3d6c72[_0xafe3('0x1d')]==='undefined'&&typeof _0x3d6c72['limit']==='undefined';var _0x54d8a2=_0x48ed29[_0xafe3('0x1e')];var _0x47d886=_0x5608e7?0x0:_0x3d6c72['offset'];var _0x19670c=_0x5608e7?_0x48ed29[_0xafe3('0x1e')]:_0x3d6c72[_0xafe3('0x1d')]+_0x3d6c72[_0xafe3('0x1f')];var _0x495a2d;if(_0x19670c>=_0x54d8a2){_0x19670c=_0x54d8a2;_0x495a2d=0xc8;}else{_0x495a2d=0xce;}_0x3ab84e['status'](_0x495a2d);return _0x3ab84e[_0xafe3('0x20')]('Content-Range',_0x47d886+'-'+_0x19670c+'/'+_0x54d8a2)['json'](_0x48ed29);}return null;};}function patchUpdates(_0xf50709){return function(_0x35f105){try{jsonpatch[_0xafe3('0x21')](_0x35f105,_0xf50709,!![]);}catch(_0x405568){return BPromise[_0xafe3('0x22')](_0x405568);}return _0x35f105[_0xafe3('0x23')]();};}function saveUpdates(_0x56eb95,_0x59dc92){return function(_0xd09ec){if(_0xd09ec){return _0xd09ec[_0xafe3('0x24')](_0x56eb95)[_0xafe3('0x25')](function(_0xacd9a8){return _0xacd9a8;});}return null;};}function removeEntity(_0xdea329,_0x47c5cf){return function(_0x557763){if(_0x557763){return _0x557763[_0xafe3('0x26')]()['then'](function(){_0xdea329['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3084ca,_0x44e41f){return function(_0x14f059){if(!_0x14f059){_0x3084ca[_0xafe3('0x1a')](0x194);}return _0x14f059;};}function handleError(_0x3cd594,_0x366e66){_0x366e66=_0x366e66||0x1f4;return function(_0x145fd1){logger[_0xafe3('0x27')](_0x145fd1['stack']);if(_0x145fd1[_0xafe3('0x28')]){delete _0x145fd1[_0xafe3('0x28')];}_0x3cd594[_0xafe3('0x1b')](_0x366e66)[_0xafe3('0x29')](_0x145fd1);};}exports[_0xafe3('0x2a')]=function(_0x4d6dd1,_0x1dee03){var _0x334d65={},_0x5a8a65={},_0x494738={'count':0x0,'rows':[]};var _0x51e55c=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x1006cf){return{'name':_0x1006cf[_0xafe3('0x2b')],'type':_0x1006cf[_0xafe3('0x2c')][_0xafe3('0x2d')]};});_0x5a8a65[_0xafe3('0x2e')]=_[_0xafe3('0x2f')](_0x51e55c,_0xafe3('0x28'));_0x5a8a65['query']=_[_0xafe3('0x30')](_0x4d6dd1[_0xafe3('0x31')]);_0x5a8a65[_0xafe3('0x32')]=_[_0xafe3('0x33')](_0x5a8a65['model'],_0x5a8a65['query']);_0x334d65[_0xafe3('0x34')]=_[_0xafe3('0x33')](_0x5a8a65[_0xafe3('0x2e')],qs[_0xafe3('0x35')](_0x4d6dd1[_0xafe3('0x31')]['fields']));_0x334d65[_0xafe3('0x34')]=_0x334d65['attributes'][_0xafe3('0x36')]?_0x334d65[_0xafe3('0x34')]:_0x5a8a65[_0xafe3('0x2e')];if(!_0x4d6dd1[_0xafe3('0x31')][_0xafe3('0x37')](_0xafe3('0x38'))){_0x334d65[_0xafe3('0x1f')]=qs[_0xafe3('0x1f')](_0x4d6dd1['query'][_0xafe3('0x1f')]);_0x334d65[_0xafe3('0x1d')]=qs[_0xafe3('0x1d')](_0x4d6dd1[_0xafe3('0x31')][_0xafe3('0x1d')]);}_0x334d65[_0xafe3('0x39')]=qs[_0xafe3('0x3a')](_0x4d6dd1[_0xafe3('0x31')]['sort']);_0x334d65[_0xafe3('0x3b')]=qs[_0xafe3('0x32')](_[_0xafe3('0x3c')](_0x4d6dd1['query'],_0x5a8a65['filters']),_0x51e55c);if(_0x4d6dd1[_0xafe3('0x31')][_0xafe3('0x3d')]){_0x334d65['where']=_[_0xafe3('0x3e')](_0x334d65[_0xafe3('0x3b')],{'$or':_[_0xafe3('0x2f')](_0x51e55c,function(_0x19392){if(_0x19392[_0xafe3('0x2c')]!==_0xafe3('0x3f')){var _0x225de4={};_0x225de4[_0x19392['name']]={'$like':'%'+_0x4d6dd1[_0xafe3('0x31')][_0xafe3('0x3d')]+'%'};return _0x225de4;}})});}_0x334d65=_[_0xafe3('0x3e')]({},_0x334d65,_0x4d6dd1[_0xafe3('0x40')]);var _0x31a28d={'where':_0x334d65['where']};return db['ZendeskConfiguration'][_0xafe3('0x1e')](_0x31a28d)[_0xafe3('0x25')](function(_0x403c77){_0x494738['count']=_0x403c77;if(_0x4d6dd1[_0xafe3('0x31')]['includeAll']){_0x334d65['include']=[{'all':!![]}];}return db[_0xafe3('0x41')][_0xafe3('0x42')](_0x334d65);})[_0xafe3('0x25')](function(_0x54edf2){_0x494738['rows']=_0x54edf2;return _0x494738;})['then'](respondWithFilteredResult(_0x1dee03,_0x334d65))[_0xafe3('0x43')](handleError(_0x1dee03,null));};exports[_0xafe3('0x44')]=function(_0x5793a8,_0x186477){var _0x214008={'raw':![],'where':{'id':_0x5793a8[_0xafe3('0x45')]['id']}},_0x1fd7c9={};_0x1fd7c9[_0xafe3('0x2e')]=_[_0xafe3('0x30')](db[_0xafe3('0x41')][_0xafe3('0x46')]);_0x1fd7c9['query']=_[_0xafe3('0x30')](_0x5793a8[_0xafe3('0x31')]);_0x1fd7c9[_0xafe3('0x32')]=_[_0xafe3('0x33')](_0x1fd7c9['model'],_0x1fd7c9['query']);_0x214008['attributes']=_[_0xafe3('0x33')](_0x1fd7c9['model'],qs['fields'](_0x5793a8[_0xafe3('0x31')][_0xafe3('0x35')]));_0x214008[_0xafe3('0x34')]=_0x214008[_0xafe3('0x34')][_0xafe3('0x36')]?_0x214008[_0xafe3('0x34')]:_0x1fd7c9[_0xafe3('0x2e')];if(_0x5793a8['query'][_0xafe3('0x47')]){_0x214008[_0xafe3('0x48')]=[{'all':!![]}];}_0x214008=_[_0xafe3('0x3e')]({},_0x214008,_0x5793a8[_0xafe3('0x40')]);return db[_0xafe3('0x41')][_0xafe3('0x49')](_0x214008)[_0xafe3('0x25')](handleEntityNotFound(_0x186477,null))[_0xafe3('0x25')](respondWithResult(_0x186477,null))['catch'](handleError(_0x186477,null));};exports[_0xafe3('0x4a')]=function(_0x5267b4,_0x2e2933){return db[_0xafe3('0x41')][_0xafe3('0x4a')](_0x5267b4[_0xafe3('0x4b')],{})['then'](respondWithResult(_0x2e2933,0xc9))[_0xafe3('0x43')](handleError(_0x2e2933,null));};exports[_0xafe3('0x24')]=function(_0x274870,_0x1ac0bf){if(_0x274870[_0xafe3('0x4b')]['id']){delete _0x274870[_0xafe3('0x4b')]['id'];}return db[_0xafe3('0x41')]['find']({'where':{'id':_0x274870[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x1ac0bf,null))['then'](saveUpdates(_0x274870[_0xafe3('0x4b')],null))['then'](respondWithResult(_0x1ac0bf,null))[_0xafe3('0x43')](handleError(_0x1ac0bf,null));};exports[_0xafe3('0x26')]=function(_0x30da9e,_0x259056){return db[_0xafe3('0x41')][_0xafe3('0x49')]({'where':{'id':_0x30da9e[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x259056,null))[_0xafe3('0x25')](removeEntity(_0x259056,null))[_0xafe3('0x43')](handleError(_0x259056,null));};exports[_0xafe3('0x4c')]=function(_0x3b9e52,_0x4850ea,_0x245c31){var _0x3eeef2={};var _0x47fbab={};var _0x1b3497;var _0x54787b;return db[_0xafe3('0x41')]['findOne']({'where':{'id':_0x3b9e52[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x4850ea,null))[_0xafe3('0x25')](function(_0x37dbae){if(_0x37dbae){_0x1b3497=_0x37dbae;_0x47fbab[_0xafe3('0x2e')]=_[_0xafe3('0x30')](db[_0xafe3('0x4d')]['rawAttributes']);_0x47fbab['query']=_[_0xafe3('0x30')](_0x3b9e52[_0xafe3('0x31')]);_0x47fbab[_0xafe3('0x32')]=_[_0xafe3('0x33')](_0x47fbab[_0xafe3('0x2e')],_0x47fbab['query']);_0x3eeef2[_0xafe3('0x34')]=_[_0xafe3('0x33')](_0x47fbab['model'],qs[_0xafe3('0x35')](_0x3b9e52[_0xafe3('0x31')][_0xafe3('0x35')]));_0x3eeef2[_0xafe3('0x34')]=_0x3eeef2['attributes'][_0xafe3('0x36')]?_0x3eeef2[_0xafe3('0x34')]:_0x47fbab[_0xafe3('0x2e')];_0x3eeef2[_0xafe3('0x39')]=qs[_0xafe3('0x3a')](_0x3b9e52[_0xafe3('0x31')]['sort']);_0x3eeef2[_0xafe3('0x3b')]=qs[_0xafe3('0x32')](_[_0xafe3('0x3c')](_0x3b9e52[_0xafe3('0x31')],_0x47fbab[_0xafe3('0x32')]));if(_0x3b9e52[_0xafe3('0x31')]['filter']){_0x3eeef2['where']=_[_0xafe3('0x3e')](_0x3eeef2['where'],{'$or':_[_0xafe3('0x2f')](_0x3eeef2['attributes'],function(_0x58434d){var _0xfaf057={};_0xfaf057[_0x58434d]={'$like':'%'+_0x3b9e52[_0xafe3('0x31')]['filter']+'%'};return _0xfaf057;})});}_0x3eeef2=_[_0xafe3('0x3e')]({},_0x3eeef2,_0x3b9e52['options']);return _0x1b3497[_0xafe3('0x4c')](_0x3eeef2);}})[_0xafe3('0x25')](function(_0x5e6943){if(_0x5e6943){_0x54787b=_0x5e6943[_0xafe3('0x36')];if(!_0x3b9e52[_0xafe3('0x31')][_0xafe3('0x37')](_0xafe3('0x38'))){_0x3eeef2[_0xafe3('0x1f')]=qs['limit'](_0x3b9e52[_0xafe3('0x31')][_0xafe3('0x1f')]);_0x3eeef2[_0xafe3('0x1d')]=qs[_0xafe3('0x1d')](_0x3b9e52[_0xafe3('0x31')][_0xafe3('0x1d')]);}return _0x1b3497[_0xafe3('0x4c')](_0x3eeef2);}})[_0xafe3('0x25')](function(_0x3c47b4){if(_0x3c47b4){return _0x3c47b4?{'count':_0x54787b,'rows':_0x3c47b4}:null;}})['then'](respondWithResult(_0x4850ea,null))[_0xafe3('0x43')](handleError(_0x4850ea,null));};exports['getSubjects']=function(_0x4c969d,_0x2198db,_0x222bc9){var _0x21216b={};var _0x52b706={};var _0x2032a0;var _0x532bee;return db[_0xafe3('0x41')]['findOne']({'where':{'id':_0x4c969d[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x2198db,null))['then'](function(_0x158f41){if(_0x158f41){_0x2032a0=_0x158f41;_0x52b706[_0xafe3('0x2e')]=_[_0xafe3('0x30')](db['ZendeskField'][_0xafe3('0x46')]);_0x52b706['query']=_[_0xafe3('0x30')](_0x4c969d[_0xafe3('0x31')]);_0x52b706['filters']=_[_0xafe3('0x33')](_0x52b706[_0xafe3('0x2e')],_0x52b706[_0xafe3('0x31')]);_0x21216b[_0xafe3('0x34')]=_['intersection'](_0x52b706[_0xafe3('0x2e')],qs['fields'](_0x4c969d[_0xafe3('0x31')]['fields']));_0x21216b['attributes']=_0x21216b[_0xafe3('0x34')]['length']?_0x21216b[_0xafe3('0x34')]:_0x52b706['model'];_0x21216b['order']=qs[_0xafe3('0x3a')](_0x4c969d['query'][_0xafe3('0x3a')]);_0x21216b[_0xafe3('0x3b')]=qs[_0xafe3('0x32')](_['pick'](_0x4c969d[_0xafe3('0x31')],_0x52b706[_0xafe3('0x32')]));if(_0x4c969d['query'][_0xafe3('0x3d')]){_0x21216b[_0xafe3('0x3b')]=_['merge'](_0x21216b['where'],{'$or':_[_0xafe3('0x2f')](_0x21216b[_0xafe3('0x34')],function(_0xe5169a){var _0xe8a9e9={};_0xe8a9e9[_0xe5169a]={'$like':'%'+_0x4c969d[_0xafe3('0x31')][_0xafe3('0x3d')]+'%'};return _0xe8a9e9;})});}_0x21216b=_['merge']({},_0x21216b,_0x4c969d[_0xafe3('0x40')]);return _0x2032a0[_0xafe3('0x4e')](_0x21216b);}})[_0xafe3('0x25')](function(_0x7f4a35){if(_0x7f4a35){_0x532bee=_0x7f4a35[_0xafe3('0x36')];if(!_0x4c969d[_0xafe3('0x31')][_0xafe3('0x37')](_0xafe3('0x38'))){_0x21216b['limit']=qs[_0xafe3('0x1f')](_0x4c969d['query'][_0xafe3('0x1f')]);_0x21216b[_0xafe3('0x1d')]=qs[_0xafe3('0x1d')](_0x4c969d[_0xafe3('0x31')][_0xafe3('0x1d')]);}return _0x2032a0[_0xafe3('0x4e')](_0x21216b);}})['then'](function(_0x594a2d){if(_0x594a2d){return _0x594a2d?{'count':_0x532bee,'rows':_0x594a2d}:null;}})[_0xafe3('0x25')](respondWithResult(_0x2198db,null))[_0xafe3('0x43')](handleError(_0x2198db,null));};exports['getDescriptions']=function(_0x157283,_0x447640,_0x2bd079){var _0x2f11ff={};var _0x1134fc={};var _0x541ed2;var _0x433f84;return db[_0xafe3('0x41')][_0xafe3('0x4f')]({'where':{'id':_0x157283[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x447640,null))[_0xafe3('0x25')](function(_0x334777){if(_0x334777){_0x541ed2=_0x334777;_0x1134fc['model']=_[_0xafe3('0x30')](db[_0xafe3('0x4d')][_0xafe3('0x46')]);_0x1134fc[_0xafe3('0x31')]=_[_0xafe3('0x30')](_0x157283[_0xafe3('0x31')]);_0x1134fc[_0xafe3('0x32')]=_[_0xafe3('0x33')](_0x1134fc[_0xafe3('0x2e')],_0x1134fc[_0xafe3('0x31')]);_0x2f11ff[_0xafe3('0x34')]=_[_0xafe3('0x33')](_0x1134fc[_0xafe3('0x2e')],qs[_0xafe3('0x35')](_0x157283['query']['fields']));_0x2f11ff['attributes']=_0x2f11ff[_0xafe3('0x34')]['length']?_0x2f11ff[_0xafe3('0x34')]:_0x1134fc['model'];_0x2f11ff[_0xafe3('0x39')]=qs[_0xafe3('0x3a')](_0x157283[_0xafe3('0x31')][_0xafe3('0x3a')]);_0x2f11ff[_0xafe3('0x3b')]=qs[_0xafe3('0x32')](_['pick'](_0x157283[_0xafe3('0x31')],_0x1134fc[_0xafe3('0x32')]));if(_0x157283[_0xafe3('0x31')][_0xafe3('0x3d')]){_0x2f11ff[_0xafe3('0x3b')]=_[_0xafe3('0x3e')](_0x2f11ff[_0xafe3('0x3b')],{'$or':_[_0xafe3('0x2f')](_0x2f11ff[_0xafe3('0x34')],function(_0x52f427){var _0x1ebd73={};_0x1ebd73[_0x52f427]={'$like':'%'+_0x157283[_0xafe3('0x31')][_0xafe3('0x3d')]+'%'};return _0x1ebd73;})});}_0x2f11ff=_['merge']({},_0x2f11ff,_0x157283[_0xafe3('0x40')]);return _0x541ed2[_0xafe3('0x50')](_0x2f11ff);}})[_0xafe3('0x25')](function(_0x1e3e9c){if(_0x1e3e9c){_0x433f84=_0x1e3e9c[_0xafe3('0x36')];if(!_0x157283['query'][_0xafe3('0x37')](_0xafe3('0x38'))){_0x2f11ff['limit']=qs[_0xafe3('0x1f')](_0x157283[_0xafe3('0x31')][_0xafe3('0x1f')]);_0x2f11ff[_0xafe3('0x1d')]=qs[_0xafe3('0x1d')](_0x157283[_0xafe3('0x31')]['offset']);}return _0x541ed2[_0xafe3('0x50')](_0x2f11ff);}})[_0xafe3('0x25')](function(_0x40bf42){if(_0x40bf42){return _0x40bf42?{'count':_0x433f84,'rows':_0x40bf42}:null;}})[_0xafe3('0x25')](respondWithResult(_0x447640,null))[_0xafe3('0x43')](handleError(_0x447640,null));};exports[_0xafe3('0x51')]=function(_0x460aa5,_0x187eb9,_0x1faa78){var _0x1d1072={};var _0x249771={};var _0x41570b;var _0x477ee8;return db[_0xafe3('0x41')][_0xafe3('0x4f')]({'where':{'id':_0x460aa5[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x187eb9,null))[_0xafe3('0x25')](function(_0x408c59){if(_0x408c59){_0x41570b=_0x408c59;_0x249771['model']=_[_0xafe3('0x30')](db['Tag'][_0xafe3('0x46')]);_0x249771[_0xafe3('0x31')]=_[_0xafe3('0x30')](_0x460aa5[_0xafe3('0x31')]);_0x249771[_0xafe3('0x32')]=_[_0xafe3('0x33')](_0x249771['model'],_0x249771[_0xafe3('0x31')]);_0x1d1072['attributes']=_[_0xafe3('0x33')](_0x249771[_0xafe3('0x2e')],qs[_0xafe3('0x35')](_0x460aa5[_0xafe3('0x31')]['fields']));_0x1d1072[_0xafe3('0x34')]=_0x1d1072[_0xafe3('0x34')][_0xafe3('0x36')]?_0x1d1072[_0xafe3('0x34')]:_0x249771[_0xafe3('0x2e')];_0x1d1072[_0xafe3('0x39')]=qs[_0xafe3('0x3a')](_0x460aa5[_0xafe3('0x31')]['sort']);_0x1d1072[_0xafe3('0x3b')]=qs['filters'](_[_0xafe3('0x3c')](_0x460aa5[_0xafe3('0x31')],_0x249771['filters']));if(_0x460aa5[_0xafe3('0x31')]['filter']){_0x1d1072[_0xafe3('0x3b')]=_['merge'](_0x1d1072[_0xafe3('0x3b')],{'$or':_['map'](_0x1d1072[_0xafe3('0x34')],function(_0x4b335b){var _0x3ace92={};_0x3ace92[_0x4b335b]={'$like':'%'+_0x460aa5[_0xafe3('0x31')][_0xafe3('0x3d')]+'%'};return _0x3ace92;})});}_0x1d1072=_['merge']({},_0x1d1072,_0x460aa5[_0xafe3('0x40')]);return _0x41570b[_0xafe3('0x51')](_0x1d1072);}})[_0xafe3('0x25')](function(_0x32a21d){if(_0x32a21d){_0x477ee8=_0x32a21d[_0xafe3('0x36')];if(!_0x460aa5[_0xafe3('0x31')][_0xafe3('0x37')](_0xafe3('0x38'))){_0x1d1072[_0xafe3('0x1f')]=qs[_0xafe3('0x1f')](_0x460aa5[_0xafe3('0x31')]['limit']);_0x1d1072[_0xafe3('0x1d')]=qs[_0xafe3('0x1d')](_0x460aa5['query'][_0xafe3('0x1d')]);}return _0x41570b[_0xafe3('0x51')](_0x1d1072);}})['then'](function(_0x4890b0){if(_0x4890b0){return _0x4890b0?{'count':_0x477ee8,'rows':_0x4890b0}:null;}})[_0xafe3('0x25')](respondWithResult(_0x187eb9,null))[_0xafe3('0x43')](handleError(_0x187eb9,null));};exports['setTags']=function(_0x936744,_0x4977bb,_0x560c0d){if(_0x936744[_0xafe3('0x4b')]['id']){delete _0x936744[_0xafe3('0x4b')]['id'];}return db['ZendeskConfiguration'][_0xafe3('0x4f')]({'where':{'id':_0x936744[_0xafe3('0x45')]['id']}})[_0xafe3('0x25')](handleEntityNotFound(_0x4977bb,null))[_0xafe3('0x25')](function(_0x1b31ee){if(_0x1b31ee){return _0x1b31ee[_0xafe3('0x52')](_0x936744[_0xafe3('0x4b')]['ids']||[]);}return null;})[_0xafe3('0x25')](respondWithResult(_0x4977bb,null))['catch'](handleError(_0x4977bb,null));}; \ No newline at end of file +var _0x63c0=['show','params','length','includeAll','find','create','body','getFields','ZendeskField','getSubjects','findOne','order','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x63c0,0x66));var _0x063c=function(_0x235186,_0xf3fdc2){_0x235186=_0x235186-0x0;var _0x103007=_0x63c0[_0x235186];return _0x103007;};'use strict';var emlformat=require(_0x063c('0x0'));var rimraf=require(_0x063c('0x1'));var zipdir=require(_0x063c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x063c('0x3'));var moment=require('moment');var BPromise=require(_0x063c('0x4'));var Mustache=require(_0x063c('0x5'));var util=require(_0x063c('0x6'));var path=require(_0x063c('0x7'));var sox=require('sox');var csv=require(_0x063c('0x8'));var ejs=require(_0x063c('0x9'));var fs=require('fs');var fs_extra=require(_0x063c('0xa'));var _=require(_0x063c('0xb'));var squel=require(_0x063c('0xc'));var crypto=require(_0x063c('0xd'));var jsforce=require(_0x063c('0xe'));var deskjs=require(_0x063c('0xf'));var toCsv=require(_0x063c('0x8'));var querystring=require(_0x063c('0x10'));var Papa=require('papaparse');var Redis=require(_0x063c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x063c('0x12'));var as=require(_0x063c('0x13'));var hardwareService=require(_0x063c('0x14'));var logger=require(_0x063c('0x15'))(_0x063c('0x16'));var utils=require(_0x063c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x063c('0x18'));var db=require(_0x063c('0x19'))['db'];function respondWithStatusCode(_0x1407ab,_0x553728){_0x553728=_0x553728||0xcc;return function(_0x36f5e4){if(_0x36f5e4){return _0x1407ab[_0x063c('0x1a')](_0x553728);}return _0x1407ab[_0x063c('0x1b')](_0x553728)[_0x063c('0x1c')]();};}function respondWithResult(_0x1ee0dc,_0xa7e5e6){_0xa7e5e6=_0xa7e5e6||0xc8;return function(_0x240936){if(_0x240936){return _0x1ee0dc['status'](_0xa7e5e6)[_0x063c('0x1d')](_0x240936);}};}function respondWithFilteredResult(_0x157bd0,_0x4cfac6){return function(_0x501c48){if(_0x501c48){var _0xd9c07e=typeof _0x4cfac6['offset']===_0x063c('0x1e')&&typeof _0x4cfac6['limit']===_0x063c('0x1e');var _0x46c838=_0x501c48['count'];var _0x18c0bd=_0xd9c07e?0x0:_0x4cfac6['offset'];var _0x4fecab=_0xd9c07e?_0x501c48[_0x063c('0x1f')]:_0x4cfac6[_0x063c('0x20')]+_0x4cfac6[_0x063c('0x21')];var _0x2240aa;if(_0x4fecab>=_0x46c838){_0x4fecab=_0x46c838;_0x2240aa=0xc8;}else{_0x2240aa=0xce;}_0x157bd0[_0x063c('0x1b')](_0x2240aa);return _0x157bd0[_0x063c('0x22')](_0x063c('0x23'),_0x18c0bd+'-'+_0x4fecab+'/'+_0x46c838)[_0x063c('0x1d')](_0x501c48);}return null;};}function patchUpdates(_0x182fe2){return function(_0x544595){try{jsonpatch[_0x063c('0x24')](_0x544595,_0x182fe2,!![]);}catch(_0x119cb9){return BPromise[_0x063c('0x25')](_0x119cb9);}return _0x544595[_0x063c('0x26')]();};}function saveUpdates(_0x453133,_0x5c7420){return function(_0xe343fe){if(_0xe343fe){return _0xe343fe[_0x063c('0x27')](_0x453133)['then'](function(_0x9ea72b){return _0x9ea72b;});}return null;};}function removeEntity(_0x24c323,_0x40f5f1){return function(_0x186c9d){if(_0x186c9d){return _0x186c9d[_0x063c('0x28')]()[_0x063c('0x29')](function(){_0x24c323[_0x063c('0x1b')](0xcc)[_0x063c('0x1c')]();});}};}function handleEntityNotFound(_0x34982c,_0x1227a2){return function(_0x45777c){if(!_0x45777c){_0x34982c['sendStatus'](0x194);}return _0x45777c;};}function handleError(_0x2f0b1a,_0x4f391e){_0x4f391e=_0x4f391e||0x1f4;return function(_0xc0a549){logger['error'](_0xc0a549['stack']);if(_0xc0a549[_0x063c('0x2a')]){delete _0xc0a549[_0x063c('0x2a')];}_0x2f0b1a[_0x063c('0x1b')](_0x4f391e)[_0x063c('0x2b')](_0xc0a549);};}exports['index']=function(_0x3bf612,_0x4cebb4){var _0x2221e0={},_0x41fff2={},_0x46c6dd={'count':0x0,'rows':[]};var _0x39242c=_['map'](db[_0x063c('0x2c')][_0x063c('0x2d')],function(_0x588166){return{'name':_0x588166[_0x063c('0x2e')],'type':_0x588166[_0x063c('0x2f')][_0x063c('0x30')]};});_0x41fff2[_0x063c('0x31')]=_[_0x063c('0x32')](_0x39242c,_0x063c('0x2a'));_0x41fff2[_0x063c('0x33')]=_[_0x063c('0x34')](_0x3bf612[_0x063c('0x33')]);_0x41fff2['filters']=_[_0x063c('0x35')](_0x41fff2[_0x063c('0x31')],_0x41fff2[_0x063c('0x33')]);_0x2221e0['attributes']=_[_0x063c('0x35')](_0x41fff2[_0x063c('0x31')],qs[_0x063c('0x36')](_0x3bf612[_0x063c('0x33')]['fields']));_0x2221e0[_0x063c('0x37')]=_0x2221e0[_0x063c('0x37')]['length']?_0x2221e0[_0x063c('0x37')]:_0x41fff2[_0x063c('0x31')];if(!_0x3bf612[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x2221e0[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x3bf612[_0x063c('0x33')][_0x063c('0x21')]);_0x2221e0[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x3bf612['query'][_0x063c('0x20')]);}_0x2221e0['order']=qs['sort'](_0x3bf612[_0x063c('0x33')][_0x063c('0x3a')]);_0x2221e0[_0x063c('0x3b')]=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x3bf612[_0x063c('0x33')],_0x41fff2[_0x063c('0x3c')]),_0x39242c);if(_0x3bf612[_0x063c('0x33')][_0x063c('0x3e')]){_0x2221e0[_0x063c('0x3b')]=_['merge'](_0x2221e0[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x39242c,function(_0x5100d7){if(_0x5100d7['type']!==_0x063c('0x3f')){var _0x56f68f={};_0x56f68f[_0x5100d7[_0x063c('0x2a')]]={'$like':'%'+_0x3bf612['query'][_0x063c('0x3e')]+'%'};return _0x56f68f;}})});}_0x2221e0=_[_0x063c('0x40')]({},_0x2221e0,_0x3bf612[_0x063c('0x41')]);var _0x37a7cd={'where':_0x2221e0['where']};return db[_0x063c('0x2c')][_0x063c('0x1f')](_0x37a7cd)[_0x063c('0x29')](function(_0x1d1181){_0x46c6dd[_0x063c('0x1f')]=_0x1d1181;if(_0x3bf612[_0x063c('0x33')]['includeAll']){_0x2221e0[_0x063c('0x42')]=[{'all':!![]}];}return db[_0x063c('0x2c')][_0x063c('0x43')](_0x2221e0);})[_0x063c('0x29')](function(_0x153aa3){_0x46c6dd[_0x063c('0x44')]=_0x153aa3;return _0x46c6dd;})[_0x063c('0x29')](respondWithFilteredResult(_0x4cebb4,_0x2221e0))[_0x063c('0x45')](handleError(_0x4cebb4,null));};exports[_0x063c('0x46')]=function(_0x4f21a9,_0x458f7a){var _0x51ac05={'raw':![],'where':{'id':_0x4f21a9[_0x063c('0x47')]['id']}},_0x1425de={};_0x1425de[_0x063c('0x31')]=_['keys'](db[_0x063c('0x2c')][_0x063c('0x2d')]);_0x1425de['query']=_[_0x063c('0x34')](_0x4f21a9[_0x063c('0x33')]);_0x1425de['filters']=_[_0x063c('0x35')](_0x1425de['model'],_0x1425de[_0x063c('0x33')]);_0x51ac05[_0x063c('0x37')]=_[_0x063c('0x35')](_0x1425de[_0x063c('0x31')],qs[_0x063c('0x36')](_0x4f21a9['query'][_0x063c('0x36')]));_0x51ac05['attributes']=_0x51ac05[_0x063c('0x37')][_0x063c('0x48')]?_0x51ac05['attributes']:_0x1425de['model'];if(_0x4f21a9[_0x063c('0x33')][_0x063c('0x49')]){_0x51ac05[_0x063c('0x42')]=[{'all':!![]}];}_0x51ac05=_[_0x063c('0x40')]({},_0x51ac05,_0x4f21a9[_0x063c('0x41')]);return db[_0x063c('0x2c')][_0x063c('0x4a')](_0x51ac05)[_0x063c('0x29')](handleEntityNotFound(_0x458f7a,null))[_0x063c('0x29')](respondWithResult(_0x458f7a,null))[_0x063c('0x45')](handleError(_0x458f7a,null));};exports[_0x063c('0x4b')]=function(_0x25efb7,_0x18d9c2){return db[_0x063c('0x2c')][_0x063c('0x4b')](_0x25efb7[_0x063c('0x4c')],{})[_0x063c('0x29')](respondWithResult(_0x18d9c2,0xc9))['catch'](handleError(_0x18d9c2,null));};exports[_0x063c('0x27')]=function(_0x20bfa6,_0x291f0a){if(_0x20bfa6[_0x063c('0x4c')]['id']){delete _0x20bfa6[_0x063c('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x063c('0x4a')]({'where':{'id':_0x20bfa6[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x291f0a,null))[_0x063c('0x29')](saveUpdates(_0x20bfa6['body'],null))[_0x063c('0x29')](respondWithResult(_0x291f0a,null))[_0x063c('0x45')](handleError(_0x291f0a,null));};exports['destroy']=function(_0x1382ec,_0x3dc9c7){return db['ZendeskConfiguration']['find']({'where':{'id':_0x1382ec[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x3dc9c7,null))['then'](removeEntity(_0x3dc9c7,null))['catch'](handleError(_0x3dc9c7,null));};exports[_0x063c('0x4d')]=function(_0x1feeff,_0x23fd92,_0x1f6f17){var _0x4393b8={};var _0x3a417d={};var _0x4761fe;var _0xb4a128;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1feeff[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x23fd92,null))[_0x063c('0x29')](function(_0x1ed94f){if(_0x1ed94f){_0x4761fe=_0x1ed94f;_0x3a417d['model']=_[_0x063c('0x34')](db[_0x063c('0x4e')][_0x063c('0x2d')]);_0x3a417d[_0x063c('0x33')]=_['keys'](_0x1feeff['query']);_0x3a417d['filters']=_[_0x063c('0x35')](_0x3a417d['model'],_0x3a417d[_0x063c('0x33')]);_0x4393b8[_0x063c('0x37')]=_[_0x063c('0x35')](_0x3a417d['model'],qs[_0x063c('0x36')](_0x1feeff[_0x063c('0x33')][_0x063c('0x36')]));_0x4393b8[_0x063c('0x37')]=_0x4393b8[_0x063c('0x37')][_0x063c('0x48')]?_0x4393b8[_0x063c('0x37')]:_0x3a417d[_0x063c('0x31')];_0x4393b8['order']=qs[_0x063c('0x3a')](_0x1feeff[_0x063c('0x33')][_0x063c('0x3a')]);_0x4393b8['where']=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x1feeff[_0x063c('0x33')],_0x3a417d['filters']));if(_0x1feeff[_0x063c('0x33')]['filter']){_0x4393b8[_0x063c('0x3b')]=_[_0x063c('0x40')](_0x4393b8[_0x063c('0x3b')],{'$or':_['map'](_0x4393b8[_0x063c('0x37')],function(_0x5433e4){var _0x1192a0={};_0x1192a0[_0x5433e4]={'$like':'%'+_0x1feeff['query'][_0x063c('0x3e')]+'%'};return _0x1192a0;})});}_0x4393b8=_[_0x063c('0x40')]({},_0x4393b8,_0x1feeff[_0x063c('0x41')]);return _0x4761fe['getFields'](_0x4393b8);}})[_0x063c('0x29')](function(_0x8ae62f){if(_0x8ae62f){_0xb4a128=_0x8ae62f['length'];if(!_0x1feeff[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x4393b8[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x1feeff['query'][_0x063c('0x21')]);_0x4393b8['offset']=qs[_0x063c('0x20')](_0x1feeff[_0x063c('0x33')]['offset']);}return _0x4761fe['getFields'](_0x4393b8);}})[_0x063c('0x29')](function(_0x3b6b86){if(_0x3b6b86){return _0x3b6b86?{'count':_0xb4a128,'rows':_0x3b6b86}:null;}})[_0x063c('0x29')](respondWithResult(_0x23fd92,null))[_0x063c('0x45')](handleError(_0x23fd92,null));};exports[_0x063c('0x4f')]=function(_0x389bf0,_0x743212,_0x578ba0){var _0x56ec5e={};var _0x10573d={};var _0x2b089c;var _0x4b5cb2;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x389bf0[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x743212,null))[_0x063c('0x29')](function(_0x1b50f9){if(_0x1b50f9){_0x2b089c=_0x1b50f9;_0x10573d['model']=_[_0x063c('0x34')](db['ZendeskField']['rawAttributes']);_0x10573d['query']=_[_0x063c('0x34')](_0x389bf0[_0x063c('0x33')]);_0x10573d[_0x063c('0x3c')]=_['intersection'](_0x10573d[_0x063c('0x31')],_0x10573d[_0x063c('0x33')]);_0x56ec5e[_0x063c('0x37')]=_[_0x063c('0x35')](_0x10573d['model'],qs[_0x063c('0x36')](_0x389bf0[_0x063c('0x33')]['fields']));_0x56ec5e[_0x063c('0x37')]=_0x56ec5e[_0x063c('0x37')][_0x063c('0x48')]?_0x56ec5e[_0x063c('0x37')]:_0x10573d[_0x063c('0x31')];_0x56ec5e[_0x063c('0x51')]=qs['sort'](_0x389bf0['query'][_0x063c('0x3a')]);_0x56ec5e[_0x063c('0x3b')]=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x389bf0['query'],_0x10573d[_0x063c('0x3c')]));if(_0x389bf0['query'][_0x063c('0x3e')]){_0x56ec5e['where']=_['merge'](_0x56ec5e[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x56ec5e['attributes'],function(_0x30520c){var _0x3eadc0={};_0x3eadc0[_0x30520c]={'$like':'%'+_0x389bf0['query'][_0x063c('0x3e')]+'%'};return _0x3eadc0;})});}_0x56ec5e=_[_0x063c('0x40')]({},_0x56ec5e,_0x389bf0['options']);return _0x2b089c[_0x063c('0x4f')](_0x56ec5e);}})['then'](function(_0x4b32c1){if(_0x4b32c1){_0x4b5cb2=_0x4b32c1[_0x063c('0x48')];if(!_0x389bf0['query']['hasOwnProperty'](_0x063c('0x39'))){_0x56ec5e['limit']=qs['limit'](_0x389bf0[_0x063c('0x33')][_0x063c('0x21')]);_0x56ec5e[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x389bf0[_0x063c('0x33')]['offset']);}return _0x2b089c[_0x063c('0x4f')](_0x56ec5e);}})[_0x063c('0x29')](function(_0x4211ff){if(_0x4211ff){return _0x4211ff?{'count':_0x4b5cb2,'rows':_0x4211ff}:null;}})['then'](respondWithResult(_0x743212,null))[_0x063c('0x45')](handleError(_0x743212,null));};exports[_0x063c('0x52')]=function(_0x4b29e9,_0x410fb2,_0x40ab2b){var _0x18517e={};var _0x19b352={};var _0x82343f;var _0x41f92d;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x4b29e9[_0x063c('0x47')]['id']}})['then'](handleEntityNotFound(_0x410fb2,null))[_0x063c('0x29')](function(_0x141530){if(_0x141530){_0x82343f=_0x141530;_0x19b352[_0x063c('0x31')]=_['keys'](db['ZendeskField'][_0x063c('0x2d')]);_0x19b352[_0x063c('0x33')]=_[_0x063c('0x34')](_0x4b29e9[_0x063c('0x33')]);_0x19b352[_0x063c('0x3c')]=_[_0x063c('0x35')](_0x19b352[_0x063c('0x31')],_0x19b352['query']);_0x18517e[_0x063c('0x37')]=_[_0x063c('0x35')](_0x19b352[_0x063c('0x31')],qs[_0x063c('0x36')](_0x4b29e9['query'][_0x063c('0x36')]));_0x18517e[_0x063c('0x37')]=_0x18517e['attributes']['length']?_0x18517e['attributes']:_0x19b352[_0x063c('0x31')];_0x18517e['order']=qs[_0x063c('0x3a')](_0x4b29e9['query'][_0x063c('0x3a')]);_0x18517e[_0x063c('0x3b')]=qs['filters'](_[_0x063c('0x3d')](_0x4b29e9[_0x063c('0x33')],_0x19b352[_0x063c('0x3c')]));if(_0x4b29e9['query']['filter']){_0x18517e['where']=_[_0x063c('0x40')](_0x18517e[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x18517e['attributes'],function(_0x206530){var _0x30e01d={};_0x30e01d[_0x206530]={'$like':'%'+_0x4b29e9[_0x063c('0x33')][_0x063c('0x3e')]+'%'};return _0x30e01d;})});}_0x18517e=_[_0x063c('0x40')]({},_0x18517e,_0x4b29e9[_0x063c('0x41')]);return _0x82343f[_0x063c('0x52')](_0x18517e);}})[_0x063c('0x29')](function(_0x8db9e5){if(_0x8db9e5){_0x41f92d=_0x8db9e5[_0x063c('0x48')];if(!_0x4b29e9[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x18517e[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x4b29e9['query']['limit']);_0x18517e['offset']=qs['offset'](_0x4b29e9[_0x063c('0x33')][_0x063c('0x20')]);}return _0x82343f[_0x063c('0x52')](_0x18517e);}})[_0x063c('0x29')](function(_0x1210bf){if(_0x1210bf){return _0x1210bf?{'count':_0x41f92d,'rows':_0x1210bf}:null;}})[_0x063c('0x29')](respondWithResult(_0x410fb2,null))[_0x063c('0x45')](handleError(_0x410fb2,null));};exports[_0x063c('0x53')]=function(_0x3c5288,_0x131909,_0xade72f){var _0x16e8b7={};var _0x4ca36e={};var _0x55ada2;var _0x2ab32e;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x3c5288[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x131909,null))['then'](function(_0x4f5ff2){if(_0x4f5ff2){_0x55ada2=_0x4f5ff2;_0x4ca36e[_0x063c('0x31')]=_[_0x063c('0x34')](db['Tag']['rawAttributes']);_0x4ca36e['query']=_[_0x063c('0x34')](_0x3c5288['query']);_0x4ca36e[_0x063c('0x3c')]=_[_0x063c('0x35')](_0x4ca36e['model'],_0x4ca36e['query']);_0x16e8b7[_0x063c('0x37')]=_[_0x063c('0x35')](_0x4ca36e[_0x063c('0x31')],qs['fields'](_0x3c5288[_0x063c('0x33')][_0x063c('0x36')]));_0x16e8b7[_0x063c('0x37')]=_0x16e8b7[_0x063c('0x37')][_0x063c('0x48')]?_0x16e8b7[_0x063c('0x37')]:_0x4ca36e[_0x063c('0x31')];_0x16e8b7['order']=qs[_0x063c('0x3a')](_0x3c5288[_0x063c('0x33')]['sort']);_0x16e8b7[_0x063c('0x3b')]=qs['filters'](_[_0x063c('0x3d')](_0x3c5288[_0x063c('0x33')],_0x4ca36e['filters']));if(_0x3c5288['query'][_0x063c('0x3e')]){_0x16e8b7[_0x063c('0x3b')]=_[_0x063c('0x40')](_0x16e8b7[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x16e8b7['attributes'],function(_0x13dde7){var _0x250b36={};_0x250b36[_0x13dde7]={'$like':'%'+_0x3c5288[_0x063c('0x33')][_0x063c('0x3e')]+'%'};return _0x250b36;})});}_0x16e8b7=_[_0x063c('0x40')]({},_0x16e8b7,_0x3c5288[_0x063c('0x41')]);return _0x55ada2[_0x063c('0x53')](_0x16e8b7);}})[_0x063c('0x29')](function(_0x12a0d4){if(_0x12a0d4){_0x2ab32e=_0x12a0d4[_0x063c('0x48')];if(!_0x3c5288[_0x063c('0x33')]['hasOwnProperty'](_0x063c('0x39'))){_0x16e8b7[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x3c5288['query']['limit']);_0x16e8b7[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x3c5288[_0x063c('0x33')][_0x063c('0x20')]);}return _0x55ada2['getTags'](_0x16e8b7);}})[_0x063c('0x29')](function(_0x333090){if(_0x333090){return _0x333090?{'count':_0x2ab32e,'rows':_0x333090}:null;}})[_0x063c('0x29')](respondWithResult(_0x131909,null))[_0x063c('0x45')](handleError(_0x131909,null));};exports['setTags']=function(_0x2d9c22,_0x36a1e1,_0x47ee40){if(_0x2d9c22[_0x063c('0x4c')]['id']){delete _0x2d9c22[_0x063c('0x4c')]['id'];}return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x2d9c22['params']['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x36a1e1,null))['then'](function(_0x3e5321){if(_0x3e5321){return _0x3e5321[_0x063c('0x54')](_0x2d9c22[_0x063c('0x4c')][_0x063c('0x55')]||[]);}return null;})[_0x063c('0x29')](respondWithResult(_0x36a1e1,null))[_0x063c('0x45')](handleError(_0x36a1e1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1aa8ce4..79faee3 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 _0xe1e3=['exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x5cd65a,_0x301f8f){var _0x1606f8=function(_0x573494){while(--_0x573494){_0x5cd65a['push'](_0x5cd65a['shift']());}};_0x1606f8(++_0x301f8f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xab0346,_0x2f1ef1){_0xab0346=_0xab0346-0x0;var _0x4bfe92=_0xe1e3[_0xab0346];return _0x4bfe92;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var logger=require('../../config/logger')(_0x3e1e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var attributes=require(_0x3e1e('0x6'));module[_0x3e1e('0x7')]=function(_0x40d6d8,_0x25701f){return _0x40d6d8['define'](_0x3e1e('0x8'),attributes,{'tableName':_0x3e1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe511=['bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','api'];(function(_0x5a8624,_0xc3b173){var _0x373959=function(_0x1f191c){while(--_0x1f191c){_0x5a8624['push'](_0x5a8624['shift']());}};_0x373959(++_0xc3b173);}(_0xe511,0x16f));var _0x1e51=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0xe511[_0x382168];return _0x3ecf7e;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index f0bc696..26a6c5a 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 _0xa424=['../../config/logger','rpc','../../config/environment','client','request','then','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x130ffd,_0x40592a){var _0x4d21b3=function(_0x33a36e){while(--_0x33a36e){_0x130ffd['push'](_0x130ffd['shift']());}};_0x4d21b3(++_0x40592a);}(_0xa424,0x160));var _0x4a42=function(_0x28613d,_0x3574b5){_0x28613d=_0x28613d-0x0;var _0x3f77f0=_0xa424[_0x28613d];return _0x3f77f0;};'use strict';var _=require(_0x4a42('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a42('0x1'));var rs=require(_0x4a42('0x2'));var fs=require('fs');var Redis=require(_0x4a42('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a42('0x4'));var logger=require(_0x4a42('0x5'))(_0x4a42('0x6'));var config=require(_0x4a42('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a42('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45ff10,_0x449829,_0x5bbeeb){return new BPromise(function(_0x394438,_0xe51b23){return client[_0x4a42('0x9')](_0x45ff10,_0x5bbeeb)[_0x4a42('0xa')](function(_0x1dee46){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x449829,'request\x20sent');logger[_0x4a42('0xb')](_0x4a42('0xc'),_0x449829,'request\x20sent',JSON['stringify'](_0x1dee46));if(_0x1dee46[_0x4a42('0xd')]){if(_0x1dee46[_0x4a42('0xd')][_0x4a42('0xe')]===0x1f4){logger[_0x4a42('0xd')](_0x4a42('0xf'),_0x449829,_0x1dee46[_0x4a42('0xd')][_0x4a42('0x10')]);return _0xe51b23(_0x1dee46[_0x4a42('0xd')][_0x4a42('0x10')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x449829,_0x1dee46[_0x4a42('0xd')][_0x4a42('0x10')]);return _0x394438(_0x1dee46[_0x4a42('0xd')]['message']);}else{logger[_0x4a42('0x11')](_0x4a42('0xf'),_0x449829,_0x4a42('0x12'));_0x394438(_0x1dee46[_0x4a42('0x13')][_0x4a42('0x10')]);}})[_0x4a42('0x14')](function(_0x16cef6){logger[_0x4a42('0xd')](_0x4a42('0xf'),_0x449829,_0x16cef6);_0xe51b23(_0x16cef6);});});} \ No newline at end of file +var _0x8445=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x8445,0xc2));var _0x5844=function(_0x62ff29,_0x5b5d4c){_0x62ff29=_0x62ff29-0x0;var _0x63583b=_0x8445[_0x62ff29];return _0x63583b;};'use strict';var _=require(_0x5844('0x0'));var util=require(_0x5844('0x1'));var moment=require('moment');var BPromise=require(_0x5844('0x2'));var rs=require(_0x5844('0x3'));var fs=require('fs');var Redis=require(_0x5844('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5844('0x5'));var logger=require(_0x5844('0x6'))('rpc');var config=require(_0x5844('0x7'));var jayson=require(_0x5844('0x8'));var client=jayson[_0x5844('0x9')][_0x5844('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19c5ef,_0x455360,_0x5dbbaa){return new BPromise(function(_0x57af83,_0x3ec542){return client[_0x5844('0xb')](_0x19c5ef,_0x5dbbaa)['then'](function(_0x44194b){logger[_0x5844('0xc')](_0x5844('0xd'),_0x455360,_0x5844('0xe'));logger[_0x5844('0xf')](_0x5844('0x10'),_0x455360,_0x5844('0xe'),JSON['stringify'](_0x44194b));if(_0x44194b[_0x5844('0x11')]){if(_0x44194b[_0x5844('0x11')][_0x5844('0x12')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);return _0x3ec542(_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);}logger[_0x5844('0x11')](_0x5844('0xd'),_0x455360,_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);return _0x57af83(_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);}else{logger[_0x5844('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x5844('0xe'));_0x57af83(_0x44194b[_0x5844('0x14')]['message']);}})[_0x5844('0x15')](function(_0x5729da){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x5729da);_0x3ec542(_0x5729da);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ca624e0..ba94205 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 _0x0c66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','show','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x300696,_0xdc8616){var _0x397507=function(_0x5667b9){while(--_0x5667b9){_0x300696['push'](_0x300696['shift']());}};_0x397507(++_0xdc8616);}(_0x0c66,0x12d));var _0x60c6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x0c66[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0x60c6('0x0'));var util=require(_0x60c6('0x1'));var path=require(_0x60c6('0x2'));var timeout=require(_0x60c6('0x3'));var express=require('express');var router=express[_0x60c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x60c6('0x5'));var interaction=require(_0x60c6('0x6'));var config=require(_0x60c6('0x7'));var controller=require(_0x60c6('0x8'));router['get']('/',auth[_0x60c6('0x9')](),controller[_0x60c6('0xa')]);router[_0x60c6('0xb')]('/:id',auth[_0x60c6('0x9')](),controller[_0x60c6('0xc')]);router['post']('/',auth[_0x60c6('0x9')](),controller['create']);router['put'](_0x60c6('0xd'),auth[_0x60c6('0x9')](),controller[_0x60c6('0xe')]);router['delete'](_0x60c6('0xd'),auth[_0x60c6('0x9')](),controller[_0x60c6('0xf')]);module[_0x60c6('0x10')]=router; \ No newline at end of file +var _0xbd46=['show','post','create','put','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x1c783f,_0x1dded1){var _0x3c6b68=function(_0x2ac1b3){while(--_0x2ac1b3){_0x1c783f['push'](_0x1c783f['shift']());}};_0x3c6b68(++_0x1dded1);}(_0xbd46,0x114));var _0x6bd4=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0xbd46[_0x48961c];return _0x1d895d;};'use strict';var multer=require('multer');var util=require(_0x6bd4('0x0'));var path=require(_0x6bd4('0x1'));var timeout=require(_0x6bd4('0x2'));var express=require(_0x6bd4('0x3'));var router=express[_0x6bd4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6bd4('0x5'));var interaction=require(_0x6bd4('0x6'));var config=require('../../config/environment');var controller=require(_0x6bd4('0x7'));router[_0x6bd4('0x8')]('/',auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xa')]);router[_0x6bd4('0x8')](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xc')]);router[_0x6bd4('0xd')]('/',auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xe')]);router[_0x6bd4('0xf')](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0x10')]);router['delete'](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0x11')]);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 7733c91..0840c53 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 _0xe412=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x437e60,_0x2c7134){var _0x2b78c4=function(_0x39bab4){while(--_0x39bab4){_0x437e60['push'](_0x437e60['shift']());}};_0x2b78c4(++_0x2c7134);}(_0xe412,0xab));var _0x2e41=function(_0x2cdbbb,_0x570b6e){_0x2cdbbb=_0x2cdbbb-0x0;var _0x237bc1=_0xe412[_0x2cdbbb];return _0x237bc1;};'use strict';var Sequelize=require(_0x2e41('0x0'));module[_0x2e41('0x1')]={'type':{'type':Sequelize[_0x2e41('0x2')](_0x2e41('0x3'),'variable',_0x2e41('0x4'),_0x2e41('0x5'),'picklist'),'defaultValue':_0x2e41('0x3')},'content':{'type':Sequelize[_0x2e41('0x6')]},'key':{'type':Sequelize[_0x2e41('0x6')]},'keyType':{'type':Sequelize[_0x2e41('0x2')]('string',_0x2e41('0x7'),_0x2e41('0x4'))},'keyContent':{'type':Sequelize[_0x2e41('0x6')]},'idField':{'type':Sequelize[_0x2e41('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2e41('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e41('0x6')]}}; \ No newline at end of file +var _0x7086=['STRING','customVariable','sequelize','ENUM','string','variable','picklist'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7086,0xbf));var _0x6708=function(_0x3a5172,_0x5bf89c){_0x3a5172=_0x3a5172-0x0;var _0x21cd9d=_0x7086[_0x3a5172];return _0x21cd9d;};'use strict';var Sequelize=require(_0x6708('0x0'));module['exports']={'type':{'type':Sequelize[_0x6708('0x1')](_0x6708('0x2'),_0x6708('0x3'),'customVariable','keyValue',_0x6708('0x4')),'defaultValue':_0x6708('0x2')},'content':{'type':Sequelize[_0x6708('0x5')]},'key':{'type':Sequelize[_0x6708('0x5')]},'keyType':{'type':Sequelize[_0x6708('0x1')]('string','variable',_0x6708('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6708('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 33e6db9..1e5a3fb 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 _0x5bb7=['limit','set','Content-Range','save','update','then','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x5bb7,0xc2));var _0x75bb=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x5bb7[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0x75bb('0x0'));var rimraf=require(_0x75bb('0x1'));var zipdir=require(_0x75bb('0x2'));var jsonpatch=require(_0x75bb('0x3'));var rp=require(_0x75bb('0x4'));var moment=require(_0x75bb('0x5'));var BPromise=require(_0x75bb('0x6'));var Mustache=require(_0x75bb('0x7'));var util=require(_0x75bb('0x8'));var path=require(_0x75bb('0x9'));var sox=require(_0x75bb('0xa'));var csv=require(_0x75bb('0xb'));var ejs=require(_0x75bb('0xc'));var fs=require('fs');var fs_extra=require(_0x75bb('0xd'));var _=require('lodash');var squel=require(_0x75bb('0xe'));var crypto=require('crypto');var jsforce=require(_0x75bb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x75bb('0xb'));var querystring=require(_0x75bb('0x10'));var Papa=require('papaparse');var Redis=require(_0x75bb('0x11'));var authService=require(_0x75bb('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75bb('0x13'));var logger=require('../../config/logger')(_0x75bb('0x14'));var utils=require('../../config/utils');var config=require(_0x75bb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x75bb('0x16'))['db'];function respondWithStatusCode(_0x2f006d,_0x270418){_0x270418=_0x270418||0xcc;return function(_0x33dad6){if(_0x33dad6){return _0x2f006d[_0x75bb('0x17')](_0x270418);}return _0x2f006d[_0x75bb('0x18')](_0x270418)['end']();};}function respondWithResult(_0x1eecd1,_0x40ecaa){_0x40ecaa=_0x40ecaa||0xc8;return function(_0x328d30){if(_0x328d30){return _0x1eecd1[_0x75bb('0x18')](_0x40ecaa)[_0x75bb('0x19')](_0x328d30);}};}function respondWithFilteredResult(_0xe0cb6,_0x590e00){return function(_0x19eac8){if(_0x19eac8){var _0x4e91c5=typeof _0x590e00['offset']===_0x75bb('0x1a')&&typeof _0x590e00['limit']===_0x75bb('0x1a');var _0x1a1f31=_0x19eac8['count'];var _0x446759=_0x4e91c5?0x0:_0x590e00[_0x75bb('0x1b')];var _0x4166f1=_0x4e91c5?_0x19eac8['count']:_0x590e00['offset']+_0x590e00[_0x75bb('0x1c')];var _0x4654c5;if(_0x4166f1>=_0x1a1f31){_0x4166f1=_0x1a1f31;_0x4654c5=0xc8;}else{_0x4654c5=0xce;}_0xe0cb6[_0x75bb('0x18')](_0x4654c5);return _0xe0cb6[_0x75bb('0x1d')](_0x75bb('0x1e'),_0x446759+'-'+_0x4166f1+'/'+_0x1a1f31)[_0x75bb('0x19')](_0x19eac8);}return null;};}function patchUpdates(_0x38c3ea){return function(_0x1562fa){try{jsonpatch['apply'](_0x1562fa,_0x38c3ea,!![]);}catch(_0x3da770){return BPromise['reject'](_0x3da770);}return _0x1562fa[_0x75bb('0x1f')]();};}function saveUpdates(_0x443040,_0x58e1a5){return function(_0x50f51e){if(_0x50f51e){return _0x50f51e[_0x75bb('0x20')](_0x443040)[_0x75bb('0x21')](function(_0x285fdc){return _0x285fdc;});}return null;};}function removeEntity(_0x273581,_0x4cf7b3){return function(_0x89dee2){if(_0x89dee2){return _0x89dee2['destroy']()[_0x75bb('0x21')](function(){_0x273581[_0x75bb('0x18')](0xcc)[_0x75bb('0x22')]();});}};}function handleEntityNotFound(_0x3c4242,_0x51d0e2){return function(_0x5b5efa){if(!_0x5b5efa){_0x3c4242['sendStatus'](0x194);}return _0x5b5efa;};}function handleError(_0x5701be,_0x508c7e){_0x508c7e=_0x508c7e||0x1f4;return function(_0x3fa808){logger[_0x75bb('0x23')](_0x3fa808[_0x75bb('0x24')]);if(_0x3fa808[_0x75bb('0x25')]){delete _0x3fa808['name'];}_0x5701be[_0x75bb('0x18')](_0x508c7e)[_0x75bb('0x26')](_0x3fa808);};}exports['index']=function(_0x5649f4,_0x453948){var _0x56907d={},_0x484a72={},_0x1ecbb0={'count':0x0,'rows':[]};var _0xcb1bf9=_[_0x75bb('0x27')](db[_0x75bb('0x28')][_0x75bb('0x29')],function(_0xbe9bfe){return{'name':_0xbe9bfe[_0x75bb('0x2a')],'type':_0xbe9bfe[_0x75bb('0x2b')][_0x75bb('0x2c')]};});_0x484a72['model']=_[_0x75bb('0x27')](_0xcb1bf9,_0x75bb('0x25'));_0x484a72[_0x75bb('0x2d')]=_[_0x75bb('0x2e')](_0x5649f4['query']);_0x484a72['filters']=_[_0x75bb('0x2f')](_0x484a72[_0x75bb('0x30')],_0x484a72[_0x75bb('0x2d')]);_0x56907d[_0x75bb('0x31')]=_[_0x75bb('0x2f')](_0x484a72['model'],qs[_0x75bb('0x32')](_0x5649f4[_0x75bb('0x2d')][_0x75bb('0x32')]));_0x56907d['attributes']=_0x56907d[_0x75bb('0x31')][_0x75bb('0x33')]?_0x56907d[_0x75bb('0x31')]:_0x484a72['model'];if(!_0x5649f4['query'][_0x75bb('0x34')](_0x75bb('0x35'))){_0x56907d['limit']=qs[_0x75bb('0x1c')](_0x5649f4[_0x75bb('0x2d')][_0x75bb('0x1c')]);_0x56907d[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x5649f4[_0x75bb('0x2d')][_0x75bb('0x1b')]);}_0x56907d[_0x75bb('0x36')]=qs[_0x75bb('0x37')](_0x5649f4[_0x75bb('0x2d')]['sort']);_0x56907d[_0x75bb('0x38')]=qs['filters'](_[_0x75bb('0x39')](_0x5649f4['query'],_0x484a72[_0x75bb('0x3a')]),_0xcb1bf9);if(_0x5649f4[_0x75bb('0x2d')][_0x75bb('0x3b')]){_0x56907d[_0x75bb('0x38')]=_[_0x75bb('0x3c')](_0x56907d[_0x75bb('0x38')],{'$or':_[_0x75bb('0x27')](_0xcb1bf9,function(_0x24c996){if(_0x24c996[_0x75bb('0x2b')]!==_0x75bb('0x3d')){var _0x2e845e={};_0x2e845e[_0x24c996[_0x75bb('0x25')]]={'$like':'%'+_0x5649f4[_0x75bb('0x2d')][_0x75bb('0x3b')]+'%'};return _0x2e845e;}})});}_0x56907d=_[_0x75bb('0x3c')]({},_0x56907d,_0x5649f4[_0x75bb('0x3e')]);var _0x59a78f={'where':_0x56907d['where']};return db['ZendeskField'][_0x75bb('0x3f')](_0x59a78f)[_0x75bb('0x21')](function(_0x48c0f7){_0x1ecbb0[_0x75bb('0x3f')]=_0x48c0f7;if(_0x5649f4['query'][_0x75bb('0x40')]){_0x56907d[_0x75bb('0x41')]=[{'all':!![]}];}return db[_0x75bb('0x28')][_0x75bb('0x42')](_0x56907d);})['then'](function(_0x2cb196){_0x1ecbb0[_0x75bb('0x43')]=_0x2cb196;return _0x1ecbb0;})['then'](respondWithFilteredResult(_0x453948,_0x56907d))[_0x75bb('0x44')](handleError(_0x453948,null));};exports['show']=function(_0x4c8173,_0x11968e){var _0x31a43c={'raw':!![],'where':{'id':_0x4c8173[_0x75bb('0x45')]['id']}},_0x345ad0={};_0x345ad0[_0x75bb('0x30')]=_['keys'](db[_0x75bb('0x28')][_0x75bb('0x29')]);_0x345ad0['query']=_[_0x75bb('0x2e')](_0x4c8173['query']);_0x345ad0[_0x75bb('0x3a')]=_[_0x75bb('0x2f')](_0x345ad0[_0x75bb('0x30')],_0x345ad0[_0x75bb('0x2d')]);_0x31a43c['attributes']=_['intersection'](_0x345ad0['model'],qs[_0x75bb('0x32')](_0x4c8173[_0x75bb('0x2d')]['fields']));_0x31a43c[_0x75bb('0x31')]=_0x31a43c[_0x75bb('0x31')][_0x75bb('0x33')]?_0x31a43c[_0x75bb('0x31')]:_0x345ad0[_0x75bb('0x30')];if(_0x4c8173[_0x75bb('0x2d')]['includeAll']){_0x31a43c['include']=[{'all':!![]}];}_0x31a43c=_[_0x75bb('0x3c')]({},_0x31a43c,_0x4c8173['options']);return db['ZendeskField'][_0x75bb('0x46')](_0x31a43c)['then'](handleEntityNotFound(_0x11968e,null))['then'](respondWithResult(_0x11968e,null))['catch'](handleError(_0x11968e,null));};exports[_0x75bb('0x47')]=function(_0x4fb027,_0x2e0ef5){return db[_0x75bb('0x28')]['create'](_0x4fb027['body'],{})[_0x75bb('0x21')](respondWithResult(_0x2e0ef5,0xc9))[_0x75bb('0x44')](handleError(_0x2e0ef5,null));};exports['update']=function(_0x40fce3,_0x3496cc){if(_0x40fce3[_0x75bb('0x48')]['id']){delete _0x40fce3[_0x75bb('0x48')]['id'];}return db[_0x75bb('0x28')][_0x75bb('0x46')]({'where':{'id':_0x40fce3['params']['id']}})[_0x75bb('0x21')](handleEntityNotFound(_0x3496cc,null))[_0x75bb('0x21')](saveUpdates(_0x40fce3['body'],null))['then'](respondWithResult(_0x3496cc,null))['catch'](handleError(_0x3496cc,null));};exports[_0x75bb('0x49')]=function(_0x567bc2,_0x187a2d){return db['ZendeskField'][_0x75bb('0x46')]({'where':{'id':_0x567bc2[_0x75bb('0x45')]['id']}})['then'](handleEntityNotFound(_0x187a2d,null))[_0x75bb('0x21')](removeEntity(_0x187a2d,null))[_0x75bb('0x44')](handleError(_0x187a2d,null));}; \ No newline at end of file +var _0xc8ae=['show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','status','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch'];(function(_0x3555e7,_0x4f1bfd){var _0x1cb906=function(_0xb7d345){while(--_0xb7d345){_0x3555e7['push'](_0x3555e7['shift']());}};_0x1cb906(++_0x4f1bfd);}(_0xc8ae,0x1c2));var _0xec8a=function(_0x574cc5,_0x44c3e3){_0x574cc5=_0x574cc5-0x0;var _0x2398cc=_0xc8ae[_0x574cc5];return _0x2398cc;};'use strict';var emlformat=require(_0xec8a('0x0'));var rimraf=require(_0xec8a('0x1'));var zipdir=require(_0xec8a('0x2'));var jsonpatch=require(_0xec8a('0x3'));var rp=require(_0xec8a('0x4'));var moment=require('moment');var BPromise=require(_0xec8a('0x5'));var Mustache=require('mustache');var util=require(_0xec8a('0x6'));var path=require(_0xec8a('0x7'));var sox=require(_0xec8a('0x8'));var csv=require(_0xec8a('0x9'));var ejs=require(_0xec8a('0xa'));var fs=require('fs');var fs_extra=require(_0xec8a('0xb'));var _=require(_0xec8a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec8a('0xd'));var deskjs=require(_0xec8a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec8a('0xf'));var Redis=require(_0xec8a('0x10'));var authService=require(_0xec8a('0x11'));var qs=require(_0xec8a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec8a('0x13'));var logger=require(_0xec8a('0x14'))(_0xec8a('0x15'));var utils=require('../../config/utils');var config=require(_0xec8a('0x16'));var licenseUtil=require(_0xec8a('0x17'));var db=require(_0xec8a('0x18'))['db'];function respondWithStatusCode(_0x43e9aa,_0x5d4ddf){_0x5d4ddf=_0x5d4ddf||0xcc;return function(_0x2d2653){if(_0x2d2653){return _0x43e9aa[_0xec8a('0x19')](_0x5d4ddf);}return _0x43e9aa['status'](_0x5d4ddf)[_0xec8a('0x1a')]();};}function respondWithResult(_0x4317dd,_0x932ed1){_0x932ed1=_0x932ed1||0xc8;return function(_0x519eca){if(_0x519eca){return _0x4317dd['status'](_0x932ed1)['json'](_0x519eca);}};}function respondWithFilteredResult(_0x1ee52b,_0x2e9edd){return function(_0x13a2d5){if(_0x13a2d5){var _0x4de2b9=typeof _0x2e9edd[_0xec8a('0x1b')]===_0xec8a('0x1c')&&typeof _0x2e9edd[_0xec8a('0x1d')]===_0xec8a('0x1c');var _0x5d7aa7=_0x13a2d5['count'];var _0x13b4fa=_0x4de2b9?0x0:_0x2e9edd[_0xec8a('0x1b')];var _0x115323=_0x4de2b9?_0x13a2d5['count']:_0x2e9edd['offset']+_0x2e9edd[_0xec8a('0x1d')];var _0x59753b;if(_0x115323>=_0x5d7aa7){_0x115323=_0x5d7aa7;_0x59753b=0xc8;}else{_0x59753b=0xce;}_0x1ee52b[_0xec8a('0x1e')](_0x59753b);return _0x1ee52b[_0xec8a('0x1f')](_0xec8a('0x20'),_0x13b4fa+'-'+_0x115323+'/'+_0x5d7aa7)[_0xec8a('0x21')](_0x13a2d5);}return null;};}function patchUpdates(_0x4a1cd2){return function(_0x13855b){try{jsonpatch[_0xec8a('0x22')](_0x13855b,_0x4a1cd2,!![]);}catch(_0x267af8){return BPromise[_0xec8a('0x23')](_0x267af8);}return _0x13855b['save']();};}function saveUpdates(_0x3f914d,_0x3d29cc){return function(_0x558508){if(_0x558508){return _0x558508[_0xec8a('0x24')](_0x3f914d)[_0xec8a('0x25')](function(_0x323759){return _0x323759;});}return null;};}function removeEntity(_0x1cd198,_0x190108){return function(_0x31ea81){if(_0x31ea81){return _0x31ea81[_0xec8a('0x26')]()[_0xec8a('0x25')](function(){_0x1cd198[_0xec8a('0x1e')](0xcc)[_0xec8a('0x1a')]();});}};}function handleEntityNotFound(_0x228c81,_0x15ee8c){return function(_0x5dad7b){if(!_0x5dad7b){_0x228c81['sendStatus'](0x194);}return _0x5dad7b;};}function handleError(_0x20eaae,_0x18d3c5){_0x18d3c5=_0x18d3c5||0x1f4;return function(_0x55e428){logger[_0xec8a('0x27')](_0x55e428[_0xec8a('0x28')]);if(_0x55e428[_0xec8a('0x29')]){delete _0x55e428[_0xec8a('0x29')];}_0x20eaae['status'](_0x18d3c5)['send'](_0x55e428);};}exports[_0xec8a('0x2a')]=function(_0x1d4f67,_0x5f2f70){var _0x786e51={},_0x2d7a50={},_0x51652a={'count':0x0,'rows':[]};var _0x16ce4d=_[_0xec8a('0x2b')](db[_0xec8a('0x2c')][_0xec8a('0x2d')],function(_0xa149a1){return{'name':_0xa149a1[_0xec8a('0x2e')],'type':_0xa149a1[_0xec8a('0x2f')][_0xec8a('0x30')]};});_0x2d7a50[_0xec8a('0x31')]=_[_0xec8a('0x2b')](_0x16ce4d,_0xec8a('0x29'));_0x2d7a50[_0xec8a('0x32')]=_[_0xec8a('0x33')](_0x1d4f67[_0xec8a('0x32')]);_0x2d7a50[_0xec8a('0x34')]=_[_0xec8a('0x35')](_0x2d7a50[_0xec8a('0x31')],_0x2d7a50[_0xec8a('0x32')]);_0x786e51['attributes']=_[_0xec8a('0x35')](_0x2d7a50['model'],qs[_0xec8a('0x36')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x36')]));_0x786e51[_0xec8a('0x37')]=_0x786e51[_0xec8a('0x37')]['length']?_0x786e51[_0xec8a('0x37')]:_0x2d7a50[_0xec8a('0x31')];if(!_0x1d4f67[_0xec8a('0x32')]['hasOwnProperty'](_0xec8a('0x38'))){_0x786e51['limit']=qs[_0xec8a('0x1d')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x1d')]);_0x786e51['offset']=qs['offset'](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x1b')]);}_0x786e51['order']=qs[_0xec8a('0x39')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x39')]);_0x786e51[_0xec8a('0x3a')]=qs[_0xec8a('0x34')](_[_0xec8a('0x3b')](_0x1d4f67[_0xec8a('0x32')],_0x2d7a50[_0xec8a('0x34')]),_0x16ce4d);if(_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x3c')]){_0x786e51['where']=_[_0xec8a('0x3d')](_0x786e51[_0xec8a('0x3a')],{'$or':_[_0xec8a('0x2b')](_0x16ce4d,function(_0x3c21e7){if(_0x3c21e7[_0xec8a('0x2f')]!=='VIRTUAL'){var _0x23e182={};_0x23e182[_0x3c21e7[_0xec8a('0x29')]]={'$like':'%'+_0x1d4f67['query'][_0xec8a('0x3c')]+'%'};return _0x23e182;}})});}_0x786e51=_[_0xec8a('0x3d')]({},_0x786e51,_0x1d4f67['options']);var _0x1c888e={'where':_0x786e51[_0xec8a('0x3a')]};return db[_0xec8a('0x2c')][_0xec8a('0x3e')](_0x1c888e)['then'](function(_0x581d6b){_0x51652a['count']=_0x581d6b;if(_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x3f')]){_0x786e51[_0xec8a('0x40')]=[{'all':!![]}];}return db[_0xec8a('0x2c')][_0xec8a('0x41')](_0x786e51);})[_0xec8a('0x25')](function(_0x1fe0b8){_0x51652a[_0xec8a('0x42')]=_0x1fe0b8;return _0x51652a;})[_0xec8a('0x25')](respondWithFilteredResult(_0x5f2f70,_0x786e51))[_0xec8a('0x43')](handleError(_0x5f2f70,null));};exports[_0xec8a('0x44')]=function(_0x283749,_0x3475c9){var _0x3260ba={'raw':!![],'where':{'id':_0x283749[_0xec8a('0x45')]['id']}},_0x41a91b={};_0x41a91b['model']=_[_0xec8a('0x33')](db[_0xec8a('0x2c')]['rawAttributes']);_0x41a91b['query']=_['keys'](_0x283749[_0xec8a('0x32')]);_0x41a91b[_0xec8a('0x34')]=_[_0xec8a('0x35')](_0x41a91b[_0xec8a('0x31')],_0x41a91b[_0xec8a('0x32')]);_0x3260ba[_0xec8a('0x37')]=_['intersection'](_0x41a91b[_0xec8a('0x31')],qs[_0xec8a('0x36')](_0x283749[_0xec8a('0x32')]['fields']));_0x3260ba[_0xec8a('0x37')]=_0x3260ba[_0xec8a('0x37')][_0xec8a('0x46')]?_0x3260ba[_0xec8a('0x37')]:_0x41a91b[_0xec8a('0x31')];if(_0x283749[_0xec8a('0x32')][_0xec8a('0x3f')]){_0x3260ba[_0xec8a('0x40')]=[{'all':!![]}];}_0x3260ba=_[_0xec8a('0x3d')]({},_0x3260ba,_0x283749['options']);return db[_0xec8a('0x2c')][_0xec8a('0x47')](_0x3260ba)[_0xec8a('0x25')](handleEntityNotFound(_0x3475c9,null))[_0xec8a('0x25')](respondWithResult(_0x3475c9,null))[_0xec8a('0x43')](handleError(_0x3475c9,null));};exports[_0xec8a('0x48')]=function(_0x197667,_0x505718){return db['ZendeskField']['create'](_0x197667[_0xec8a('0x49')],{})[_0xec8a('0x25')](respondWithResult(_0x505718,0xc9))[_0xec8a('0x43')](handleError(_0x505718,null));};exports[_0xec8a('0x24')]=function(_0x44ab59,_0x4f5db4){if(_0x44ab59[_0xec8a('0x49')]['id']){delete _0x44ab59[_0xec8a('0x49')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x44ab59['params']['id']}})[_0xec8a('0x25')](handleEntityNotFound(_0x4f5db4,null))['then'](saveUpdates(_0x44ab59[_0xec8a('0x49')],null))['then'](respondWithResult(_0x4f5db4,null))[_0xec8a('0x43')](handleError(_0x4f5db4,null));};exports[_0xec8a('0x26')]=function(_0x111e64,_0x88f773){return db[_0xec8a('0x2c')]['find']({'where':{'id':_0x111e64['params']['id']}})[_0xec8a('0x25')](handleEntityNotFound(_0x88f773,null))['then'](removeEntity(_0x88f773,null))[_0xec8a('0x43')](handleError(_0x88f773,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2c8bc35..5091634 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 _0xb955=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x5b2bb6,_0x2c59d3){var _0x45e623=function(_0x5118ea){while(--_0x5118ea){_0x5b2bb6['push'](_0x5b2bb6['shift']());}};_0x45e623(++_0x2c59d3);}(_0xb955,0x71));var _0x5b95=function(_0x1f53ef,_0x43a2b6){_0x1f53ef=_0x1f53ef-0x0;var _0x4650d0=_0xb955[_0x1f53ef];return _0x4650d0;};'use strict';var _=require(_0x5b95('0x0'));var util=require(_0x5b95('0x1'));var logger=require(_0x5b95('0x2'))(_0x5b95('0x3'));var moment=require(_0x5b95('0x4'));var BPromise=require(_0x5b95('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b95('0x6'));var rimraf=require(_0x5b95('0x7'));var config=require(_0x5b95('0x8'));var attributes=require(_0x5b95('0x9'));module['exports']=function(_0x31d3a7,_0x87b19b){return _0x31d3a7[_0x5b95('0xa')](_0x5b95('0xb'),attributes,{'tableName':_0x5b95('0xc'),'paranoid':![],'indexes':[{'name':_0x5b95('0xd'),'fields':[_0x5b95('0xe'),_0x5b95('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields'];(function(_0x709ab8,_0x44dc36){var _0x2660f5=function(_0x3ef0f7){while(--_0x3ef0f7){_0x709ab8['push'](_0x709ab8['shift']());}};_0x2660f5(++_0x44dc36);}(_0xbec5,0x16f));var _0x5bec=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0xbec5[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require(_0x5bec('0x2'))('api');var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5bec('0x6'));var attributes=require(_0x5bec('0x7'));module[_0x5bec('0x8')]=function(_0x4e9686,_0x3162d1){return _0x4e9686['define'](_0x5bec('0x9'),attributes,{'tableName':_0x5bec('0xa'),'paranoid':![],'indexes':[{'name':_0x5bec('0xb'),'fields':[_0x5bec('0xc'),_0x5bec('0xd')],'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 fa78558..56d7257 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 _0x2e9b=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util'];(function(_0x8aa23e,_0x5e58c2){var _0x5efbb3=function(_0x9a0d24){while(--_0x9a0d24){_0x8aa23e['push'](_0x8aa23e['shift']());}};_0x5efbb3(++_0x5e58c2);}(_0x2e9b,0xc4));var _0xb2e9=function(_0x2f2796,_0x5c42a4){_0x2f2796=_0x2f2796-0x0;var _0x309cb6=_0x2e9b[_0x2f2796];return _0x309cb6;};'use strict';var _=require(_0xb2e9('0x0'));var util=require(_0xb2e9('0x1'));var moment=require(_0xb2e9('0x2'));var BPromise=require(_0xb2e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2e9('0x5'));var logger=require(_0xb2e9('0x6'))(_0xb2e9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2e9('0x8')][_0xb2e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe38b9,_0x42ca95,_0xc51faf){return new BPromise(function(_0x63e669,_0x2f7f28){return client[_0xb2e9('0xa')](_0xe38b9,_0xc51faf)[_0xb2e9('0xb')](function(_0x43a2b3){logger['info'](_0xb2e9('0xc'),_0x42ca95,_0xb2e9('0xd'));logger[_0xb2e9('0xe')](_0xb2e9('0xf'),_0x42ca95,'request\x20sent',JSON['stringify'](_0x43a2b3));if(_0x43a2b3[_0xb2e9('0x10')]){if(_0x43a2b3[_0xb2e9('0x10')][_0xb2e9('0x11')]===0x1f4){logger[_0xb2e9('0x10')](_0xb2e9('0xc'),_0x42ca95,_0x43a2b3[_0xb2e9('0x10')]['message']);return _0x2f7f28(_0x43a2b3['error']['message']);}logger[_0xb2e9('0x10')](_0xb2e9('0xc'),_0x42ca95,_0x43a2b3[_0xb2e9('0x10')]['message']);return _0x63e669(_0x43a2b3[_0xb2e9('0x10')][_0xb2e9('0x12')]);}else{logger[_0xb2e9('0x13')]('ZendeskField,\x20%s,\x20%s',_0x42ca95,'request\x20sent');_0x63e669(_0x43a2b3[_0xb2e9('0x14')][_0xb2e9('0x12')]);}})[_0xb2e9('0x15')](function(_0x135ff6){logger['error'](_0xb2e9('0xc'),_0x42ca95,_0x135ff6);_0x2f7f28(_0x135ff6);});});} \ No newline at end of file +var _0x489d=['result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x41e351,_0x76d509){var _0x59f58a=function(_0x4334f0){while(--_0x4334f0){_0x41e351['push'](_0x41e351['shift']());}};_0x59f58a(++_0x76d509);}(_0x489d,0x177));var _0xd489=function(_0x3fd4b2,_0xf797d0){_0x3fd4b2=_0x3fd4b2-0x0;var _0x4dff94=_0x489d[_0x3fd4b2];return _0x4dff94;};'use strict';var _=require('lodash');var util=require(_0xd489('0x0'));var moment=require(_0xd489('0x1'));var BPromise=require(_0xd489('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd489('0x3'));var db=require(_0xd489('0x4'))['db'];var utils=require(_0xd489('0x5'));var logger=require(_0xd489('0x6'))(_0xd489('0x7'));var config=require(_0xd489('0x8'));var jayson=require(_0xd489('0x9'));var client=jayson['client'][_0xd489('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x276795,_0x24f775,_0x365b9d){return new BPromise(function(_0x4d39bc,_0x235e21){return client[_0xd489('0xb')](_0x276795,_0x365b9d)[_0xd489('0xc')](function(_0x19e010){logger['info'](_0xd489('0xd'),_0x24f775,_0xd489('0xe'));logger[_0xd489('0xf')](_0xd489('0x10'),_0x24f775,'request\x20sent',JSON[_0xd489('0x11')](_0x19e010));if(_0x19e010[_0xd489('0x12')]){if(_0x19e010['error'][_0xd489('0x13')]===0x1f4){logger[_0xd489('0x12')](_0xd489('0xd'),_0x24f775,_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);return _0x235e21(_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);}logger['error'](_0xd489('0xd'),_0x24f775,_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);return _0x4d39bc(_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);}else{logger['info'](_0xd489('0xd'),_0x24f775,_0xd489('0xe'));_0x4d39bc(_0x19e010[_0xd489('0x15')][_0xd489('0x14')]);}})['catch'](function(_0x4e7987){logger[_0xd489('0x12')](_0xd489('0xd'),_0x24f775,_0x4e7987);_0x235e21(_0x4e7987);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4d17a7a..c2733bf 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 _0xf306=['express','Router','../../config/environment','./intZohoAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util'];(function(_0x2fad1b,_0x426aae){var _0x3d6865=function(_0x3d7fe4){while(--_0x3d7fe4){_0x2fad1b['push'](_0x2fad1b['shift']());}};_0x3d6865(++_0x426aae);}(_0xf306,0x141));var _0x6f30=function(_0x2b8549,_0x28f62a){_0x2b8549=_0x2b8549-0x0;var _0x337bc8=_0xf306[_0x2b8549];return _0x337bc8;};'use strict';var multer=require(_0x6f30('0x0'));var util=require(_0x6f30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f30('0x2'));var router=express[_0x6f30('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f30('0x4'));var controller=require(_0x6f30('0x5'));router['get']('/',auth[_0x6f30('0x6')](),controller['index']);router[_0x6f30('0x7')](_0x6f30('0x8'),auth[_0x6f30('0x6')](),controller[_0x6f30('0x9')]);router['get'](_0x6f30('0xa'),auth[_0x6f30('0x6')](),controller['getConfigurations']);router[_0x6f30('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x6f30('0xb')]);router[_0x6f30('0xc')]('/',auth['isAuthenticated'](),controller[_0x6f30('0xd')]);router[_0x6f30('0xc')](_0x6f30('0xa'),auth[_0x6f30('0x6')](),controller[_0x6f30('0xe')]);router[_0x6f30('0xf')](_0x6f30('0x8'),auth[_0x6f30('0x6')](),controller[_0x6f30('0x10')]);router['delete'](_0x6f30('0x8'),auth[_0x6f30('0x6')](),controller[_0x6f30('0x11')]);module[_0x6f30('0x12')]=router; \ No newline at end of file +var _0xab21=['destroy','exports','multer','util','connect-timeout','express','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete'];(function(_0x1865d4,_0x569a81){var _0x1f0e1c=function(_0x57887d){while(--_0x57887d){_0x1865d4['push'](_0x1865d4['shift']());}};_0x1f0e1c(++_0x569a81);}(_0xab21,0x10a));var _0x1ab2=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xab21[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x1ab2('0x0'));var util=require(_0x1ab2('0x1'));var path=require('path');var timeout=require(_0x1ab2('0x2'));var express=require(_0x1ab2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1ab2('0x4'));var controller=require(_0x1ab2('0x5'));router[_0x1ab2('0x6')]('/',auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x8')]);router[_0x1ab2('0x6')](_0x1ab2('0x9'),auth['isAuthenticated'](),controller[_0x1ab2('0xa')]);router['get'](_0x1ab2('0xb'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0xc')]);router['get'](_0x1ab2('0xd'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0xe')]);router[_0x1ab2('0xf')]('/',auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x10')]);router[_0x1ab2('0xf')](_0x1ab2('0xb'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x11')]);router[_0x1ab2('0x12')](_0x1ab2('0x9'),auth[_0x1ab2('0x7')](),controller['update']);router[_0x1ab2('0x13')](_0x1ab2('0x9'),auth['isAuthenticated'](),controller[_0x1ab2('0x14')]);module[_0x1ab2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index aa85f5e..49250c8 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 _0x99e9=['exports','STRING'];(function(_0x3df920,_0x49b512){var _0x20ae4c=function(_0x234d5e){while(--_0x234d5e){_0x3df920['push'](_0x3df920['shift']());}};_0x20ae4c(++_0x49b512);}(_0x99e9,0xb4));var _0x999e=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x99e9[_0x31b9cf];return _0x357b8a;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x41bb,0xc5));var _0xb41b=function(_0x592077,_0x457090){_0x592077=_0x592077-0x0;var _0x19099f=_0x41bb[_0x592077];return _0x19099f;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 95e7cfb..9661afb 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 _0x2274=['slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Result','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','params','destroy','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com'];(function(_0x4aa4a5,_0x2504df){var _0x2784bf=function(_0x359691){while(--_0x359691){_0x4aa4a5['push'](_0x4aa4a5['shift']());}};_0x2784bf(++_0x2504df);}(_0x2274,0x9f));var _0x4227=function(_0x2b1781,_0x56f47f){_0x2b1781=_0x2b1781-0x0;var _0x474335=_0x2274[_0x2b1781];return _0x474335;};'use strict';var emlformat=require(_0x4227('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4227('0x1'));var rp=require(_0x4227('0x2'));var moment=require(_0x4227('0x3'));var BPromise=require(_0x4227('0x4'));var Mustache=require(_0x4227('0x5'));var util=require(_0x4227('0x6'));var path=require(_0x4227('0x7'));var sox=require(_0x4227('0x8'));var csv=require(_0x4227('0x9'));var ejs=require(_0x4227('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4227('0xb'));var squel=require(_0x4227('0xc'));var crypto=require(_0x4227('0xd'));var jsforce=require(_0x4227('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4227('0x9'));var querystring=require(_0x4227('0xf'));var Papa=require(_0x4227('0x10'));var Redis=require(_0x4227('0x11'));var authService=require(_0x4227('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4227('0x13'));var hardwareService=require(_0x4227('0x14'));var logger=require('../../config/logger')(_0x4227('0x15'));var utils=require(_0x4227('0x16'));var config=require(_0x4227('0x17'));var licenseUtil=require(_0x4227('0x18'));var db=require(_0x4227('0x19'))['db'];var integrations=require(_0x4227('0x1a'));function respondWithStatusCode(_0x11f51b,_0x2d8f49){_0x2d8f49=_0x2d8f49||0xcc;return function(_0x543ea6){if(_0x543ea6){return _0x11f51b[_0x4227('0x1b')](_0x2d8f49);}return _0x11f51b['status'](_0x2d8f49)[_0x4227('0x1c')]();};}function respondWithResult(_0x2a4f78,_0x5aaae8){_0x5aaae8=_0x5aaae8||0xc8;return function(_0xd75943){if(_0xd75943){return _0x2a4f78[_0x4227('0x1d')](_0x5aaae8)[_0x4227('0x1e')](_0xd75943);}};}function respondWithFilteredResult(_0x18d4e0,_0x3bc6e2){return function(_0x24bc9a){if(_0x24bc9a){var _0x1404b6=typeof _0x3bc6e2[_0x4227('0x1f')]===_0x4227('0x20')&&typeof _0x3bc6e2[_0x4227('0x21')]===_0x4227('0x20');var _0x40c631=_0x24bc9a[_0x4227('0x22')];var _0x3e5ac4=_0x1404b6?0x0:_0x3bc6e2[_0x4227('0x1f')];var _0x35918e=_0x1404b6?_0x24bc9a[_0x4227('0x22')]:_0x3bc6e2[_0x4227('0x1f')]+_0x3bc6e2[_0x4227('0x21')];var _0x14249e;if(_0x35918e>=_0x40c631){_0x35918e=_0x40c631;_0x14249e=0xc8;}else{_0x14249e=0xce;}_0x18d4e0['status'](_0x14249e);return _0x18d4e0[_0x4227('0x23')](_0x4227('0x24'),_0x3e5ac4+'-'+_0x35918e+'/'+_0x40c631)['json'](_0x24bc9a);}return null;};}function patchUpdates(_0x4231ab){return function(_0x5f46cd){try{jsonpatch[_0x4227('0x25')](_0x5f46cd,_0x4231ab,!![]);}catch(_0x30515a){return BPromise[_0x4227('0x26')](_0x30515a);}return _0x5f46cd[_0x4227('0x27')]();};}function saveUpdates(_0x315fcb,_0x18c66c){return function(_0x9ac2cc){if(_0x9ac2cc){return _0x9ac2cc[_0x4227('0x28')](_0x315fcb)[_0x4227('0x29')](function(_0x27676e){return _0x27676e;});}return null;};}function removeEntity(_0x103eee,_0x57f964){return function(_0x3046e7){if(_0x3046e7){return _0x3046e7['destroy']()[_0x4227('0x29')](function(){_0x103eee[_0x4227('0x1d')](0xcc)[_0x4227('0x1c')]();});}};}function handleEntityNotFound(_0x122aa4,_0x53f67e){return function(_0x36bd9f){if(!_0x36bd9f){_0x122aa4[_0x4227('0x1b')](0x194);}return _0x36bd9f;};}function handleError(_0x1bea20,_0x472f00){_0x472f00=_0x472f00||0x1f4;return function(_0x1fe896){logger[_0x4227('0x2a')](_0x1fe896[_0x4227('0x2b')]);if(_0x1fe896[_0x4227('0x2c')]){delete _0x1fe896[_0x4227('0x2c')];}_0x1bea20[_0x4227('0x1d')](_0x472f00)[_0x4227('0x2d')](_0x1fe896);};}exports[_0x4227('0x2e')]=function(_0x2d822a,_0x147a03){var _0xa734d2={},_0x5d782a={},_0x861896={'count':0x0,'rows':[]};var _0x1b3986=_[_0x4227('0x2f')](db[_0x4227('0x30')]['rawAttributes'],function(_0x5892a8){return{'name':_0x5892a8[_0x4227('0x31')],'type':_0x5892a8[_0x4227('0x32')][_0x4227('0x33')]};});_0x5d782a[_0x4227('0x34')]=_['map'](_0x1b3986,_0x4227('0x2c'));_0x5d782a[_0x4227('0x35')]=_['keys'](_0x2d822a[_0x4227('0x35')]);_0x5d782a[_0x4227('0x36')]=_[_0x4227('0x37')](_0x5d782a[_0x4227('0x34')],_0x5d782a[_0x4227('0x35')]);_0xa734d2['attributes']=_['intersection'](_0x5d782a[_0x4227('0x34')],qs[_0x4227('0x38')](_0x2d822a['query'][_0x4227('0x38')]));_0xa734d2[_0x4227('0x39')]=_0xa734d2['attributes'][_0x4227('0x3a')]?_0xa734d2[_0x4227('0x39')]:_0x5d782a[_0x4227('0x34')];if(!_0x2d822a[_0x4227('0x35')][_0x4227('0x3b')](_0x4227('0x3c'))){_0xa734d2[_0x4227('0x21')]=qs[_0x4227('0x21')](_0x2d822a[_0x4227('0x35')]['limit']);_0xa734d2[_0x4227('0x1f')]=qs[_0x4227('0x1f')](_0x2d822a['query'][_0x4227('0x1f')]);}_0xa734d2[_0x4227('0x3d')]=qs[_0x4227('0x3e')](_0x2d822a['query']['sort']);_0xa734d2['where']=qs[_0x4227('0x36')](_[_0x4227('0x3f')](_0x2d822a[_0x4227('0x35')],_0x5d782a[_0x4227('0x36')]),_0x1b3986);if(_0x2d822a['query'][_0x4227('0x40')]){_0xa734d2['where']=_[_0x4227('0x41')](_0xa734d2[_0x4227('0x42')],{'$or':_['map'](_0x1b3986,function(_0x3f06c7){if(_0x3f06c7[_0x4227('0x32')]!=='VIRTUAL'){var _0x48eebb={};_0x48eebb[_0x3f06c7['name']]={'$like':'%'+_0x2d822a[_0x4227('0x35')][_0x4227('0x40')]+'%'};return _0x48eebb;}})});}_0xa734d2=_[_0x4227('0x41')]({},_0xa734d2,_0x2d822a[_0x4227('0x43')]);var _0x2111f9={'where':_0xa734d2[_0x4227('0x42')]};return db[_0x4227('0x30')]['count'](_0x2111f9)['then'](function(_0xaa6973){_0x861896['count']=_0xaa6973;if(_0x2d822a['query'][_0x4227('0x44')]){_0xa734d2[_0x4227('0x45')]=[{'all':!![]}];}return db['ZohoAccount'][_0x4227('0x46')](_0xa734d2);})[_0x4227('0x29')](function(_0xd8312a){_0x861896['rows']=_0xd8312a;return _0x861896;})[_0x4227('0x29')](respondWithFilteredResult(_0x147a03,_0xa734d2))[_0x4227('0x47')](handleError(_0x147a03,null));};exports[_0x4227('0x48')]=function(_0xcdc849,_0x6982ab){var _0x358b85={'raw':![],'where':{'id':_0xcdc849['params']['id']}},_0x4d40fb={};_0x4d40fb[_0x4227('0x34')]=_['keys'](db[_0x4227('0x30')][_0x4227('0x49')]);_0x4d40fb[_0x4227('0x35')]=_[_0x4227('0x4a')](_0xcdc849['query']);_0x4d40fb['filters']=_[_0x4227('0x37')](_0x4d40fb[_0x4227('0x34')],_0x4d40fb[_0x4227('0x35')]);_0x358b85['attributes']=_[_0x4227('0x37')](_0x4d40fb[_0x4227('0x34')],qs[_0x4227('0x38')](_0xcdc849[_0x4227('0x35')]['fields']));_0x358b85['attributes']=_0x358b85[_0x4227('0x39')]['length']?_0x358b85[_0x4227('0x39')]:_0x4d40fb[_0x4227('0x34')];if(_0xcdc849[_0x4227('0x35')][_0x4227('0x44')]){_0x358b85['include']=[{'all':!![]}];}_0x358b85=_['merge']({},_0x358b85,_0xcdc849[_0x4227('0x43')]);return db[_0x4227('0x30')][_0x4227('0x4b')](_0x358b85)[_0x4227('0x29')](handleEntityNotFound(_0x6982ab,null))['then'](respondWithResult(_0x6982ab,null))[_0x4227('0x47')](handleError(_0x6982ab,null));};exports['create']=function(_0x560c3f,_0x3afe6b){return db[_0x4227('0x30')][_0x4227('0x4c')](_0x560c3f['body'],{})[_0x4227('0x29')](respondWithResult(_0x3afe6b,0xc9))[_0x4227('0x47')](handleError(_0x3afe6b,null));};exports[_0x4227('0x28')]=function(_0x4c4da8,_0xf2a3e7){if(_0x4c4da8['body']['id']){delete _0x4c4da8[_0x4227('0x4d')]['id'];}return db[_0x4227('0x30')][_0x4227('0x4b')]({'where':{'id':_0x4c4da8[_0x4227('0x4e')]['id']}})[_0x4227('0x29')](handleEntityNotFound(_0xf2a3e7,null))[_0x4227('0x29')](saveUpdates(_0x4c4da8[_0x4227('0x4d')],null))[_0x4227('0x29')](respondWithResult(_0xf2a3e7,null))[_0x4227('0x47')](handleError(_0xf2a3e7,null));};exports[_0x4227('0x4f')]=function(_0x2d94df,_0x689ee2){return db[_0x4227('0x30')]['find']({'where':{'id':_0x2d94df['params']['id']}})[_0x4227('0x29')](handleEntityNotFound(_0x689ee2,null))[_0x4227('0x29')](removeEntity(_0x689ee2,null))[_0x4227('0x47')](handleError(_0x689ee2,null));};exports[_0x4227('0x50')]=function(_0x5b52d2,_0x302b33,_0x2352ca){var _0x2fbb39={};var _0x966a65={};var _0x24d22a;var _0x3ec048;return db[_0x4227('0x30')][_0x4227('0x51')]({'where':{'id':_0x5b52d2[_0x4227('0x4e')]['id']}})[_0x4227('0x29')](handleEntityNotFound(_0x302b33,null))[_0x4227('0x29')](function(_0x395cc9){if(_0x395cc9){_0x24d22a=_0x395cc9;_0x966a65[_0x4227('0x34')]=_['keys'](db['ZohoConfiguration'][_0x4227('0x49')]);_0x966a65[_0x4227('0x35')]=_['keys'](_0x5b52d2['query']);_0x966a65[_0x4227('0x36')]=_[_0x4227('0x37')](_0x966a65['model'],_0x966a65[_0x4227('0x35')]);_0x2fbb39[_0x4227('0x39')]=_[_0x4227('0x37')](_0x966a65[_0x4227('0x34')],qs[_0x4227('0x38')](_0x5b52d2['query'][_0x4227('0x38')]));_0x2fbb39[_0x4227('0x39')]=_0x2fbb39[_0x4227('0x39')]['length']?_0x2fbb39[_0x4227('0x39')]:_0x966a65[_0x4227('0x34')];_0x2fbb39[_0x4227('0x3d')]=qs['sort'](_0x5b52d2[_0x4227('0x35')][_0x4227('0x3e')]);_0x2fbb39[_0x4227('0x42')]=qs[_0x4227('0x36')](_[_0x4227('0x3f')](_0x5b52d2[_0x4227('0x35')],_0x966a65[_0x4227('0x36')]));if(_0x5b52d2['query']['filter']){_0x2fbb39[_0x4227('0x42')]=_['merge'](_0x2fbb39[_0x4227('0x42')],{'$or':_[_0x4227('0x2f')](_0x2fbb39[_0x4227('0x39')],function(_0x424ff0){var _0x1271c5={};_0x1271c5[_0x424ff0]={'$like':'%'+_0x5b52d2[_0x4227('0x35')]['filter']+'%'};return _0x1271c5;})});}_0x2fbb39=_['merge']({},_0x2fbb39,_0x5b52d2['options']);return _0x24d22a[_0x4227('0x50')](_0x2fbb39);}})[_0x4227('0x29')](function(_0x333ada){if(_0x333ada){_0x3ec048=_0x333ada['length'];if(!_0x5b52d2[_0x4227('0x35')][_0x4227('0x3b')](_0x4227('0x3c'))){_0x2fbb39['limit']=qs[_0x4227('0x21')](_0x5b52d2['query'][_0x4227('0x21')]);_0x2fbb39[_0x4227('0x1f')]=qs[_0x4227('0x1f')](_0x5b52d2[_0x4227('0x35')][_0x4227('0x1f')]);}return _0x24d22a['getConfigurations'](_0x2fbb39);}})['then'](function(_0x3a4fac){if(_0x3a4fac){return _0x3a4fac?{'count':_0x3ec048,'rows':_0x3a4fac}:null;}})['then'](respondWithResult(_0x302b33,null))[_0x4227('0x47')](handleError(_0x302b33,null));};exports[_0x4227('0x52')]=function(_0x4ec161,_0x4edde9,_0x3d6517){if(_0x4ec161['body']['id']){delete _0x4ec161['body']['id'];}return db[_0x4227('0x30')][_0x4227('0x51')]({'where':{'id':_0x4ec161[_0x4227('0x4e')]['id']}})[_0x4227('0x29')](handleEntityNotFound(_0x4edde9,null))[_0x4227('0x29')](function(_0x10e4bc){if(_0x10e4bc){_0x4ec161[_0x4227('0x4d')]['AccountId']=_0x10e4bc['id'];_0x4ec161[_0x4227('0x4d')][_0x4227('0x53')]=integrations[_0x4227('0x54')](_0x4ec161[_0x4227('0x4d')][_0x4227('0x55')],_0x4ec161[_0x4227('0x4d')][_0x4227('0x32')]);_0x4ec161[_0x4227('0x4d')][_0x4227('0x56')]=integrations['getDescriptions'](_0x4ec161[_0x4227('0x4d')][_0x4227('0x55')],_0x4ec161[_0x4227('0x4d')][_0x4227('0x32')]);return db[_0x4227('0x57')][_0x4227('0x4c')](_0x4ec161[_0x4227('0x4d')],{'include':[{'model':db[_0x4227('0x58')],'as':_0x4227('0x53')},{'model':db['ZohoField'],'as':_0x4227('0x56')}]});}return null;})[_0x4227('0x29')](respondWithResult(_0x4edde9,null))['catch'](handleError(_0x4edde9,null));};function getAccessToken(_0x563eb1){return new Promise(function(_0x4fd42d,_0x1e59f7){var _0x4f1d94;switch(_0x563eb1[_0x4227('0x59')]){case'US':_0x4f1d94='https://accounts.zoho.com';break;case'AU':_0x4f1d94='https://accounts.zoho.com.au';break;case'EU':_0x4f1d94='https://accounts.zoho.eu';break;case'IN':_0x4f1d94=_0x4227('0x5a');break;case'CN':_0x4f1d94=_0x4227('0x5b');break;default:_0x4f1d94=_0x4227('0x5c');break;}var _0x521bc8={'method':'POST','uri':_0x4f1d94+_0x4227('0x5d'),'qs':{'refresh_token':_0x563eb1[_0x4227('0x5e')],'client_id':_0x563eb1[_0x4227('0x5f')],'client_secret':_0x563eb1[_0x4227('0x60')],'grant_type':_0x4227('0x61')},'json':!![]};return rp(_0x521bc8)[_0x4227('0x29')](function(_0x2a2234){if(_0x2a2234[_0x4227('0x62')]){_0x4fd42d(_0x2a2234[_0x4227('0x62')]);}else{_0x1e59f7(_0x4227('0x63'));}})[_0x4227('0x47')](function(_0x1bf354){_0x1e59f7(_0x1bf354);});});}exports['getFields']=function(_0x6c5534,_0x588da6,_0x2140f4){var _0x1e8178,_0x232e1f,_0x5cc1fc,_0x2dcfae,_0x58eed3;return db['ZohoAccount'][_0x4227('0x51')]({'where':{'id':_0x6c5534['params']['id']},'attributes':['id',_0x4227('0x64'),'zone',_0x4227('0x5f'),_0x4227('0x60'),_0x4227('0x65'),_0x4227('0x66'),_0x4227('0x5e')]})[_0x4227('0x29')](handleEntityNotFound(_0x588da6,null))[_0x4227('0x29')](function(_0x411bd0){_0x58eed3=_0x411bd0;_0x1e8178=_0x58eed3['host'];_0x232e1f=_0x1e8178===_0x4227('0x67')?'eu':_0x4227('0x68');_0x5cc1fc=_0x58eed3[_0x4227('0x65')];var _0x1224f5=_0x5cc1fc[_0x4227('0x69')](-0x1);if(_0x1224f5==='/'||_0x1224f5==='\x5c'||_0x1224f5===':'){_0x5cc1fc=_0x5cc1fc[_0x4227('0x6a')](0x0,_0x5cc1fc[_0x4227('0x6b')](_0x1224f5));}if(!_0x58eed3[_0x4227('0x5e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x58eed3);})[_0x4227('0x29')](function(_0x4ad027){if(_0x4ad027){return rp({'method':_0x4227('0x6c'),'uri':util['format'](_0x4227('0x6d'),_0x232e1f),'qs':{'module':_0x4227('0x6e')},'headers':{'Authorization':_0x4227('0x6f')+_0x4ad027},'json':!![]});}})['then'](function(_0x279bd8){if(_0x279bd8){if(_0x279bd8['response']&&_0x279bd8[_0x4227('0x70')]['error']){throw new Error(_0x279bd8[_0x4227('0x70')][_0x4227('0x2a')][_0x4227('0x71')]);}var _0x8b1ab7=[];var _0x4b7847=[];var _0x11b6fc=[_0x4227('0x72'),'Subject',_0x4227('0x73'),_0x4227('0x74'),'Call_Duration',_0x4227('0x75'),'Call_Start_Time','Call_Type'];_0x4b7847=_['remove'](_0x279bd8[_0x4227('0x38')],function(_0x128caf){return _0x11b6fc[_0x4227('0x76')](_0x128caf[_0x4227('0x77')]);});for(var _0x243c76=0x0;_0x243c76<_0x4b7847[_0x4227('0x3a')];_0x243c76++){if(_0x4b7847[_0x243c76]['system_mandatory']===![]){_0x8b1ab7[_0x4227('0x78')]({'id':_0x4b7847[_0x243c76]['id'],'name':_0x4b7847[_0x243c76][_0x4227('0x79')],'custom':_0x4b7847[_0x243c76][_0x4227('0x7a')],'options':_0x4b7847[_0x243c76][_0x4227('0x7b')]===_0x4227('0x7c')&&_0x4b7847[_0x243c76][_0x4227('0x7d')]['length']>-0x1?_[_0x4227('0x2f')](_0x4b7847[_0x243c76][_0x4227('0x7d')],function(_0x2d4fbc){return{'name':_0x2d4fbc,'value':_0x2d4fbc};}):[]});}}return{'count':_0x8b1ab7[_0x4227('0x3a')],'rows':_0x8b1ab7};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x588da6,null))[_0x4227('0x47')](function(_0x17e039){var _0x502815=_0x6c5534[_0x4227('0x35')][_0x4227('0x7e')]?0x1f4:_0x17e039[_0x4227('0x7f')]||0x1f4;logger['error'](_0x4227('0x80'),_0x4227('0x81'),_0x502815,JSON[_0x4227('0x82')](_0x17e039));delete _0x17e039[_0x4227('0x2c')];if(_0x502815===0x191){_0x502815=0x190;}_0x588da6['status'](_0x502815)[_0x4227('0x2d')](_0x6c5534[_0x4227('0x35')][_0x4227('0x7e')]?{'message':_0x4227('0x83'),'statusCode':_0x17e039[_0x4227('0x7f')]}:_0x17e039);});}; \ No newline at end of file +var _0xdcfe=['sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','then','error','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','create','body','update','find','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','refreshToken','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x16bf11,_0x461f7b){var _0x30e784=function(_0x14beb3){while(--_0x14beb3){_0x16bf11['push'](_0x16bf11['shift']());}};_0x30e784(++_0x461f7b);}(_0xdcfe,0x17b));var _0xedcf=function(_0x1a0aab,_0x1f75dd){_0x1a0aab=_0x1a0aab-0x0;var _0x87f61c=_0xdcfe[_0x1a0aab];return _0x87f61c;};'use strict';var emlformat=require(_0xedcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedcf('0x1'));var jsonpatch=require(_0xedcf('0x2'));var rp=require(_0xedcf('0x3'));var moment=require(_0xedcf('0x4'));var BPromise=require(_0xedcf('0x5'));var Mustache=require(_0xedcf('0x6'));var util=require('util');var path=require(_0xedcf('0x7'));var sox=require(_0xedcf('0x8'));var csv=require(_0xedcf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedcf('0xa'));var _=require(_0xedcf('0xb'));var squel=require('squel');var crypto=require(_0xedcf('0xc'));var jsforce=require(_0xedcf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0x9'));var querystring=require(_0xedcf('0xe'));var Papa=require(_0xedcf('0xf'));var Redis=require('ioredis');var authService=require(_0xedcf('0x10'));var qs=require(_0xedcf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xedcf('0x12'))('api');var utils=require(_0xedcf('0x13'));var config=require(_0xedcf('0x14'));var licenseUtil=require(_0xedcf('0x15'));var db=require(_0xedcf('0x16'))['db'];var integrations=require(_0xedcf('0x17'));function respondWithStatusCode(_0x38f13b,_0x406aa9){_0x406aa9=_0x406aa9||0xcc;return function(_0xc3f6c5){if(_0xc3f6c5){return _0x38f13b[_0xedcf('0x18')](_0x406aa9);}return _0x38f13b['status'](_0x406aa9)['end']();};}function respondWithResult(_0x4ea5c1,_0x46bcc4){_0x46bcc4=_0x46bcc4||0xc8;return function(_0x36474e){if(_0x36474e){return _0x4ea5c1[_0xedcf('0x19')](_0x46bcc4)[_0xedcf('0x1a')](_0x36474e);}};}function respondWithFilteredResult(_0x1edd92,_0x323d52){return function(_0x2e27a6){if(_0x2e27a6){var _0x37928e=typeof _0x323d52[_0xedcf('0x1b')]==='undefined'&&typeof _0x323d52[_0xedcf('0x1c')]===_0xedcf('0x1d');var _0x315d0d=_0x2e27a6[_0xedcf('0x1e')];var _0x1ad115=_0x37928e?0x0:_0x323d52[_0xedcf('0x1b')];var _0x1e8c36=_0x37928e?_0x2e27a6[_0xedcf('0x1e')]:_0x323d52[_0xedcf('0x1b')]+_0x323d52[_0xedcf('0x1c')];var _0x13937d;if(_0x1e8c36>=_0x315d0d){_0x1e8c36=_0x315d0d;_0x13937d=0xc8;}else{_0x13937d=0xce;}_0x1edd92[_0xedcf('0x19')](_0x13937d);return _0x1edd92[_0xedcf('0x1f')](_0xedcf('0x20'),_0x1ad115+'-'+_0x1e8c36+'/'+_0x315d0d)[_0xedcf('0x1a')](_0x2e27a6);}return null;};}function patchUpdates(_0x533a80){return function(_0x3f57a0){try{jsonpatch['apply'](_0x3f57a0,_0x533a80,!![]);}catch(_0x47d8b0){return BPromise[_0xedcf('0x21')](_0x47d8b0);}return _0x3f57a0['save']();};}function saveUpdates(_0x4c51a9,_0x4f76f2){return function(_0x44ae6f){if(_0x44ae6f){return _0x44ae6f['update'](_0x4c51a9)[_0xedcf('0x22')](function(_0x273d17){return _0x273d17;});}return null;};}function removeEntity(_0x3e20ba,_0x590093){return function(_0xadc3f0){if(_0xadc3f0){return _0xadc3f0['destroy']()[_0xedcf('0x22')](function(){_0x3e20ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb81d,_0x2d38da){return function(_0x41ae9f){if(!_0x41ae9f){_0x5bb81d[_0xedcf('0x18')](0x194);}return _0x41ae9f;};}function handleError(_0x47916d,_0x44e8b0){_0x44e8b0=_0x44e8b0||0x1f4;return function(_0x43abdd){logger[_0xedcf('0x23')](_0x43abdd['stack']);if(_0x43abdd[_0xedcf('0x24')]){delete _0x43abdd['name'];}_0x47916d[_0xedcf('0x19')](_0x44e8b0)[_0xedcf('0x25')](_0x43abdd);};}exports[_0xedcf('0x26')]=function(_0x358c4b,_0x48d5ec){var _0x3f8b4d={},_0x43a734={},_0x2125f7={'count':0x0,'rows':[]};var _0x3c5841=_[_0xedcf('0x27')](db[_0xedcf('0x28')]['rawAttributes'],function(_0x4fde7e){return{'name':_0x4fde7e[_0xedcf('0x29')],'type':_0x4fde7e[_0xedcf('0x2a')][_0xedcf('0x2b')]};});_0x43a734[_0xedcf('0x2c')]=_[_0xedcf('0x27')](_0x3c5841,'name');_0x43a734[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x358c4b[_0xedcf('0x2d')]);_0x43a734[_0xedcf('0x2f')]=_[_0xedcf('0x30')](_0x43a734[_0xedcf('0x2c')],_0x43a734['query']);_0x3f8b4d['attributes']=_['intersection'](_0x43a734[_0xedcf('0x2c')],qs['fields'](_0x358c4b['query'][_0xedcf('0x31')]));_0x3f8b4d['attributes']=_0x3f8b4d[_0xedcf('0x32')][_0xedcf('0x33')]?_0x3f8b4d[_0xedcf('0x32')]:_0x43a734[_0xedcf('0x2c')];if(!_0x358c4b[_0xedcf('0x2d')]['hasOwnProperty'](_0xedcf('0x34'))){_0x3f8b4d['limit']=qs[_0xedcf('0x1c')](_0x358c4b[_0xedcf('0x2d')]['limit']);_0x3f8b4d[_0xedcf('0x1b')]=qs[_0xedcf('0x1b')](_0x358c4b['query'][_0xedcf('0x1b')]);}_0x3f8b4d[_0xedcf('0x35')]=qs[_0xedcf('0x36')](_0x358c4b[_0xedcf('0x2d')][_0xedcf('0x36')]);_0x3f8b4d[_0xedcf('0x37')]=qs[_0xedcf('0x2f')](_[_0xedcf('0x38')](_0x358c4b[_0xedcf('0x2d')],_0x43a734[_0xedcf('0x2f')]),_0x3c5841);if(_0x358c4b['query'][_0xedcf('0x39')]){_0x3f8b4d[_0xedcf('0x37')]=_[_0xedcf('0x3a')](_0x3f8b4d['where'],{'$or':_[_0xedcf('0x27')](_0x3c5841,function(_0x7e274a){if(_0x7e274a[_0xedcf('0x2a')]!==_0xedcf('0x3b')){var _0x30d013={};_0x30d013[_0x7e274a[_0xedcf('0x24')]]={'$like':'%'+_0x358c4b['query'][_0xedcf('0x39')]+'%'};return _0x30d013;}})});}_0x3f8b4d=_[_0xedcf('0x3a')]({},_0x3f8b4d,_0x358c4b[_0xedcf('0x3c')]);var _0x119ef9={'where':_0x3f8b4d[_0xedcf('0x37')]};return db['ZohoAccount']['count'](_0x119ef9)[_0xedcf('0x22')](function(_0x4a7469){_0x2125f7[_0xedcf('0x1e')]=_0x4a7469;if(_0x358c4b[_0xedcf('0x2d')]['includeAll']){_0x3f8b4d[_0xedcf('0x3d')]=[{'all':!![]}];}return db[_0xedcf('0x28')]['findAll'](_0x3f8b4d);})[_0xedcf('0x22')](function(_0x4b6276){_0x2125f7[_0xedcf('0x3e')]=_0x4b6276;return _0x2125f7;})[_0xedcf('0x22')](respondWithFilteredResult(_0x48d5ec,_0x3f8b4d))[_0xedcf('0x3f')](handleError(_0x48d5ec,null));};exports['show']=function(_0x203275,_0x1582a4){var _0x556a42={'raw':![],'where':{'id':_0x203275[_0xedcf('0x40')]['id']}},_0x16e543={};_0x16e543[_0xedcf('0x2c')]=_[_0xedcf('0x2e')](db['ZohoAccount'][_0xedcf('0x41')]);_0x16e543[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x203275[_0xedcf('0x2d')]);_0x16e543[_0xedcf('0x2f')]=_[_0xedcf('0x30')](_0x16e543[_0xedcf('0x2c')],_0x16e543['query']);_0x556a42[_0xedcf('0x32')]=_['intersection'](_0x16e543[_0xedcf('0x2c')],qs[_0xedcf('0x31')](_0x203275[_0xedcf('0x2d')][_0xedcf('0x31')]));_0x556a42[_0xedcf('0x32')]=_0x556a42[_0xedcf('0x32')][_0xedcf('0x33')]?_0x556a42[_0xedcf('0x32')]:_0x16e543[_0xedcf('0x2c')];if(_0x203275[_0xedcf('0x2d')]['includeAll']){_0x556a42['include']=[{'all':!![]}];}_0x556a42=_['merge']({},_0x556a42,_0x203275[_0xedcf('0x3c')]);return db[_0xedcf('0x28')]['find'](_0x556a42)[_0xedcf('0x22')](handleEntityNotFound(_0x1582a4,null))[_0xedcf('0x22')](respondWithResult(_0x1582a4,null))[_0xedcf('0x3f')](handleError(_0x1582a4,null));};exports[_0xedcf('0x42')]=function(_0x4c199a,_0x20152a){return db[_0xedcf('0x28')][_0xedcf('0x42')](_0x4c199a[_0xedcf('0x43')],{})[_0xedcf('0x22')](respondWithResult(_0x20152a,0xc9))[_0xedcf('0x3f')](handleError(_0x20152a,null));};exports[_0xedcf('0x44')]=function(_0x236171,_0x5b92f0){if(_0x236171['body']['id']){delete _0x236171[_0xedcf('0x43')]['id'];}return db[_0xedcf('0x28')][_0xedcf('0x45')]({'where':{'id':_0x236171[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x5b92f0,null))[_0xedcf('0x22')](saveUpdates(_0x236171[_0xedcf('0x43')],null))[_0xedcf('0x22')](respondWithResult(_0x5b92f0,null))[_0xedcf('0x3f')](handleError(_0x5b92f0,null));};exports[_0xedcf('0x46')]=function(_0x468a07,_0x16924a){return db[_0xedcf('0x28')][_0xedcf('0x45')]({'where':{'id':_0x468a07[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x16924a,null))[_0xedcf('0x22')](removeEntity(_0x16924a,null))[_0xedcf('0x3f')](handleError(_0x16924a,null));};exports[_0xedcf('0x47')]=function(_0x12ee55,_0xb680a1,_0x4cd4c3){var _0x47bc8d={};var _0x1c6dba={};var _0x4c827d;var _0x350bf9;return db['ZohoAccount'][_0xedcf('0x48')]({'where':{'id':_0x12ee55[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0xb680a1,null))[_0xedcf('0x22')](function(_0x22ee1d){if(_0x22ee1d){_0x4c827d=_0x22ee1d;_0x1c6dba['model']=_[_0xedcf('0x2e')](db['ZohoConfiguration']['rawAttributes']);_0x1c6dba[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x12ee55['query']);_0x1c6dba[_0xedcf('0x2f')]=_['intersection'](_0x1c6dba[_0xedcf('0x2c')],_0x1c6dba[_0xedcf('0x2d')]);_0x47bc8d[_0xedcf('0x32')]=_['intersection'](_0x1c6dba[_0xedcf('0x2c')],qs[_0xedcf('0x31')](_0x12ee55[_0xedcf('0x2d')][_0xedcf('0x31')]));_0x47bc8d[_0xedcf('0x32')]=_0x47bc8d['attributes'][_0xedcf('0x33')]?_0x47bc8d[_0xedcf('0x32')]:_0x1c6dba[_0xedcf('0x2c')];_0x47bc8d[_0xedcf('0x35')]=qs[_0xedcf('0x36')](_0x12ee55['query'][_0xedcf('0x36')]);_0x47bc8d[_0xedcf('0x37')]=qs[_0xedcf('0x2f')](_[_0xedcf('0x38')](_0x12ee55[_0xedcf('0x2d')],_0x1c6dba[_0xedcf('0x2f')]));if(_0x12ee55[_0xedcf('0x2d')]['filter']){_0x47bc8d[_0xedcf('0x37')]=_[_0xedcf('0x3a')](_0x47bc8d['where'],{'$or':_[_0xedcf('0x27')](_0x47bc8d[_0xedcf('0x32')],function(_0x4c6844){var _0x26ca95={};_0x26ca95[_0x4c6844]={'$like':'%'+_0x12ee55['query']['filter']+'%'};return _0x26ca95;})});}_0x47bc8d=_[_0xedcf('0x3a')]({},_0x47bc8d,_0x12ee55['options']);return _0x4c827d['getConfigurations'](_0x47bc8d);}})['then'](function(_0x55eacf){if(_0x55eacf){_0x350bf9=_0x55eacf['length'];if(!_0x12ee55['query'][_0xedcf('0x49')]('nolimit')){_0x47bc8d[_0xedcf('0x1c')]=qs['limit'](_0x12ee55[_0xedcf('0x2d')]['limit']);_0x47bc8d['offset']=qs[_0xedcf('0x1b')](_0x12ee55[_0xedcf('0x2d')][_0xedcf('0x1b')]);}return _0x4c827d[_0xedcf('0x47')](_0x47bc8d);}})['then'](function(_0x199a63){if(_0x199a63){return _0x199a63?{'count':_0x350bf9,'rows':_0x199a63}:null;}})['then'](respondWithResult(_0xb680a1,null))[_0xedcf('0x3f')](handleError(_0xb680a1,null));};exports[_0xedcf('0x4a')]=function(_0x280b61,_0x4d1a27,_0x45dfd4){if(_0x280b61[_0xedcf('0x43')]['id']){delete _0x280b61['body']['id'];}return db[_0xedcf('0x28')]['findOne']({'where':{'id':_0x280b61[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x4d1a27,null))[_0xedcf('0x22')](function(_0xfb2eaa){if(_0xfb2eaa){_0x280b61[_0xedcf('0x43')][_0xedcf('0x4b')]=_0xfb2eaa['id'];_0x280b61[_0xedcf('0x43')]['Subjects']=integrations[_0xedcf('0x4c')](_0x280b61[_0xedcf('0x43')][_0xedcf('0x4d')],_0x280b61[_0xedcf('0x43')][_0xedcf('0x2a')]);_0x280b61['body']['Descriptions']=integrations[_0xedcf('0x4e')](_0x280b61[_0xedcf('0x43')][_0xedcf('0x4d')],_0x280b61[_0xedcf('0x43')][_0xedcf('0x2a')]);return db[_0xedcf('0x4f')][_0xedcf('0x42')](_0x280b61[_0xedcf('0x43')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0xedcf('0x50')],'as':_0xedcf('0x51')}]});}return null;})[_0xedcf('0x22')](respondWithResult(_0x4d1a27,null))[_0xedcf('0x3f')](handleError(_0x4d1a27,null));};function getAccessToken(_0x238308){return new Promise(function(_0x31217f,_0x300678){var _0x3b2b7e;switch(_0x238308['zone']){case'US':_0x3b2b7e=_0xedcf('0x52');break;case'AU':_0x3b2b7e=_0xedcf('0x53');break;case'EU':_0x3b2b7e='https://accounts.zoho.eu';break;case'IN':_0x3b2b7e=_0xedcf('0x54');break;case'CN':_0x3b2b7e=_0xedcf('0x55');break;default:_0x3b2b7e=_0xedcf('0x56');break;}var _0x19c801={'method':_0xedcf('0x57'),'uri':_0x3b2b7e+_0xedcf('0x58'),'qs':{'refresh_token':_0x238308['refreshToken'],'client_id':_0x238308[_0xedcf('0x59')],'client_secret':_0x238308[_0xedcf('0x5a')],'grant_type':_0xedcf('0x5b')},'json':!![]};return rp(_0x19c801)['then'](function(_0x344ecb){if(_0x344ecb[_0xedcf('0x5c')]){_0x31217f(_0x344ecb[_0xedcf('0x5c')]);}else{_0x300678('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xedcf('0x3f')](function(_0x151515){_0x300678(_0x151515);});});}exports['getFields']=function(_0xe4d715,_0x5f1519,_0x9e354e){var _0x5358f5,_0x4fd4db,_0x3b290e,_0x352968,_0x6cd88;return db['ZohoAccount'][_0xedcf('0x48')]({'where':{'id':_0xe4d715[_0xedcf('0x40')]['id']},'attributes':['id',_0xedcf('0x5d'),_0xedcf('0x5e'),_0xedcf('0x59'),_0xedcf('0x5a'),_0xedcf('0x5f'),_0xedcf('0x60'),'refreshToken']})[_0xedcf('0x22')](handleEntityNotFound(_0x5f1519,null))[_0xedcf('0x22')](function(_0x7ab072){_0x6cd88=_0x7ab072;_0x5358f5=_0x6cd88[_0xedcf('0x5d')];_0x4fd4db=_0x5358f5===_0xedcf('0x61')?'eu':_0xedcf('0x62');_0x3b290e=_0x6cd88[_0xedcf('0x5f')];var _0x509ad7=_0x3b290e[_0xedcf('0x63')](-0x1);if(_0x509ad7==='/'||_0x509ad7==='\x5c'||_0x509ad7===':'){_0x3b290e=_0x3b290e[_0xedcf('0x64')](0x0,_0x3b290e[_0xedcf('0x65')](_0x509ad7));}if(!_0x6cd88[_0xedcf('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x6cd88);})[_0xedcf('0x22')](function(_0x16eb5b){if(_0x16eb5b){return rp({'method':'GET','uri':util[_0xedcf('0x67')](_0xedcf('0x68'),_0x4fd4db),'qs':{'module':'Calls'},'headers':{'Authorization':_0xedcf('0x69')+_0x16eb5b},'json':!![]});}})[_0xedcf('0x22')](function(_0x53d2d7){if(_0x53d2d7){if(_0x53d2d7['response']&&_0x53d2d7['response'][_0xedcf('0x23')]){throw new Error(_0x53d2d7[_0xedcf('0x6a')][_0xedcf('0x23')]['message']);}var _0x1926eb=[];var _0x382209=[];var _0xf212e0=[_0xedcf('0x6b'),_0xedcf('0x6c'),_0xedcf('0x6d'),_0xedcf('0x6e'),_0xedcf('0x6f'),_0xedcf('0x70'),'Call_Start_Time',_0xedcf('0x71')];_0x382209=_[_0xedcf('0x72')](_0x53d2d7[_0xedcf('0x31')],function(_0xd3b3d0){return _0xf212e0[_0xedcf('0x73')](_0xd3b3d0[_0xedcf('0x74')]);});for(var _0x5d0b22=0x0;_0x5d0b22<_0x382209[_0xedcf('0x33')];_0x5d0b22++){if(_0x382209[_0x5d0b22][_0xedcf('0x75')]===![]){_0x1926eb[_0xedcf('0x76')]({'id':_0x382209[_0x5d0b22]['id'],'name':_0x382209[_0x5d0b22]['display_label'],'custom':_0x382209[_0x5d0b22][_0xedcf('0x77')],'options':_0x382209[_0x5d0b22][_0xedcf('0x78')]===_0xedcf('0x79')&&_0x382209[_0x5d0b22][_0xedcf('0x7a')][_0xedcf('0x33')]>-0x1?_[_0xedcf('0x27')](_0x382209[_0x5d0b22][_0xedcf('0x7a')],function(_0x2b66d2){return{'name':_0x2b66d2,'value':_0x2b66d2};}):[]});}}return{'count':_0x1926eb[_0xedcf('0x33')],'rows':_0x1926eb};}else{return{'count':0x0,'rows':[]};}})[_0xedcf('0x22')](respondWithResult(_0x5f1519,null))[_0xedcf('0x3f')](function(_0x34c6c0){var _0xc18999=_0xe4d715[_0xedcf('0x2d')][_0xedcf('0x7b')]?0x1f4:_0x34c6c0[_0xedcf('0x7c')]||0x1f4;logger[_0xedcf('0x23')](_0xedcf('0x7d'),_0xedcf('0x7e'),_0xc18999,JSON[_0xedcf('0x7f')](_0x34c6c0));delete _0x34c6c0[_0xedcf('0x24')];if(_0xc18999===0x191){_0xc18999=0x190;}_0x5f1519[_0xedcf('0x19')](_0xc18999)[_0xedcf('0x25')](_0xe4d715[_0xedcf('0x2d')]['test']?{'message':_0xedcf('0x80'),'statusCode':_0x34c6c0[_0xedcf('0x7c')]}:_0x34c6c0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 8b962a5..fe76e4b 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 _0xe47d=['application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','parse','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code'];(function(_0x12f35c,_0x500384){var _0x3a318a=function(_0x2cd13e){while(--_0x2cd13e){_0x12f35c['push'](_0x12f35c['shift']());}};_0x3a318a(++_0x500384);}(_0xe47d,0x1c5));var _0xde47=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xe47d[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require(_0xde47('0x0'));var util=require(_0xde47('0x1'));var logger=require(_0xde47('0x2'))(_0xde47('0x3'));var moment=require(_0xde47('0x4'));var BPromise=require(_0xde47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde47('0x6'));var rimraf=require(_0xde47('0x7'));var config=require(_0xde47('0x8'));var attributes=require(_0xde47('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xde47('0xa')]=function(_0x487ae2,_0x37f305){return _0x487ae2[_0xde47('0xb')](_0xde47('0xc'),attributes,{'tableName':_0xde47('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x432407,_0x5ad910,_0x44e5db){if(_0x432407[_0xde47('0xe')](_0xde47('0xf'))||_0x432407[_0xde47('0xe')](_0xde47('0x10'))||_0x432407[_0xde47('0xe')](_0xde47('0x11'))||_0x432407[_0xde47('0xe')](_0xde47('0x12'))||_0x432407['changed'](_0xde47('0x13'))||_0x432407['changed'](_0xde47('0x14'))){var _0x3b573c,_0x17fd78;_0x3b573c=_0x432407['serverUrl'];var _0x364a84=_0x3b573c[_0xde47('0x15')](-0x1);if(_0x364a84==='/'||_0x364a84==='\x5c'||_0x364a84===':'){_0x3b573c=_0x3b573c['substring'](0x0,_0x3b573c[_0xde47('0x16')](_0x364a84));}switch(_0x432407[_0xde47('0xf')]){case'US':_0x17fd78=_0xde47('0x17');break;case'AU':_0x17fd78=_0xde47('0x18');break;case'IN':_0x17fd78=_0xde47('0x19');break;case'CN':_0x17fd78=_0xde47('0x1a');break;default:_0x17fd78=_0xde47('0x1b');break;}var _0x273b09={'method':_0xde47('0x1c'),'uri':_0x17fd78+_0xde47('0x1d'),'form':{'grant_type':_0xde47('0x1e'),'client_id':_0x432407[_0xde47('0x11')],'client_secret':_0x432407[_0xde47('0x12')],'redirect_uri':_0x432407['serverUrl'],'code':_0x432407[_0xde47('0x13')]},'headers':{'Content-Type':_0xde47('0x1f')}};return rp(_0x273b09)[_0xde47('0x20')](function(_0x23753b){var _0x442249=JSON['parse'](_0x23753b);if(_0x442249[_0xde47('0x21')]){_0x432407[_0xde47('0x22')]=_0x442249[_0xde47('0x21')];logger[_0xde47('0x23')](util[_0xde47('0x24')](_0xde47('0x25'),_0x432407[_0xde47('0x26')],_0x432407['id']));}else{logger[_0xde47('0x27')](util[_0xde47('0x24')](_0xde47('0x28'),_0x432407[_0xde47('0x26')],_0x432407['id']),util[_0xde47('0x29')](_0x442249,{'showHidden':![],'depth':null}));}return _0x44e5db(null,_0x5ad910);})[_0xde47('0x2a')](function(_0x5148a0){logger[_0xde47('0x27')](util[_0xde47('0x24')](_0xde47('0x28'),_0x432407[_0xde47('0x26')],_0x432407['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x44e5db(_0x5148a0);});}else{return _0x44e5db(null,_0x5ad910);}},'beforeUpdate':function(_0x3ee42e,_0x3eb9d6,_0x2a532f){if(_0x3ee42e[_0xde47('0xe')](_0xde47('0xf'))||_0x3ee42e[_0xde47('0xe')]('serverUrl')||_0x3ee42e[_0xde47('0xe')]('clientId')||_0x3ee42e[_0xde47('0xe')]('clientSecret')||_0x3ee42e[_0xde47('0xe')]('code')||_0x3ee42e[_0xde47('0xe')](_0xde47('0x14'))){var _0x37b8e9,_0x1b5399;_0x37b8e9=_0x3ee42e[_0xde47('0x10')];var _0x153f47=_0x37b8e9['slice'](-0x1);if(_0x153f47==='/'||_0x153f47==='\x5c'||_0x153f47===':'){_0x37b8e9=_0x37b8e9['substring'](0x0,_0x37b8e9[_0xde47('0x16')](_0x153f47));}switch(_0x3ee42e[_0xde47('0xf')]){case'US':_0x1b5399=_0xde47('0x17');break;case'AU':_0x1b5399=_0xde47('0x18');break;case'IN':_0x1b5399=_0xde47('0x19');break;case'CN':_0x1b5399='https://accounts.zoho.com.cn';break;default:_0x1b5399=_0xde47('0x1b');break;}var _0x536ac7={'method':_0xde47('0x1c'),'uri':_0x1b5399+_0xde47('0x1d'),'form':{'grant_type':_0xde47('0x1e'),'client_id':_0x3ee42e['clientId'],'client_secret':_0x3ee42e[_0xde47('0x12')],'redirect_uri':_0x3ee42e[_0xde47('0x10')],'code':_0x3ee42e['code']},'headers':{'Content-Type':_0xde47('0x1f')}};return rp(_0x536ac7)[_0xde47('0x20')](function(_0x181601){var _0x5ca7a2=JSON[_0xde47('0x2b')](_0x181601);if(_0x5ca7a2[_0xde47('0x21')]){_0x3ee42e[_0xde47('0x22')]=_0x5ca7a2['refresh_token'];logger[_0xde47('0x23')](util[_0xde47('0x24')](_0xde47('0x25'),_0x3ee42e[_0xde47('0x26')],_0x3ee42e['id']));}else{logger['error'](util[_0xde47('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3ee42e[_0xde47('0x26')],_0x3ee42e['id']),util[_0xde47('0x29')](_0x5ca7a2,{'showHidden':![],'depth':null}));}return _0x2a532f(null,_0x3eb9d6);})[_0xde47('0x2a')](function(_0x24f25e){logger[_0xde47('0x27')](util[_0xde47('0x24')](_0xde47('0x28'),_0x3ee42e[_0xde47('0x26')],_0x3ee42e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2a532f(_0x24f25e);});}else{return _0x2a532f(null,_0x3eb9d6);}}}});}; \ No newline at end of file +var _0xba0b=['/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','lastIndexOf','then','info','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xba0b,0xc1));var _0xbba0=function(_0xc78e4,_0x21d43a){_0xc78e4=_0xc78e4-0x0;var _0x4ce621=_0xba0b[_0xc78e4];return _0x4ce621;};'use strict';var _=require(_0xbba0('0x0'));var util=require(_0xbba0('0x1'));var logger=require(_0xbba0('0x2'))(_0xbba0('0x3'));var moment=require(_0xbba0('0x4'));var BPromise=require('bluebird');var rp=require(_0xbba0('0x5'));var fs=require('fs');var path=require(_0xbba0('0x6'));var rimraf=require('rimraf');var config=require(_0xbba0('0x7'));var attributes=require(_0xbba0('0x8'));var integrations=require(_0xbba0('0x9'));module[_0xbba0('0xa')]=function(_0xae29cb,_0x174127){return _0xae29cb[_0xbba0('0xb')](_0xbba0('0xc'),attributes,{'tableName':_0xbba0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22bc5,_0x438929,_0x1d802c){if(_0x22bc5[_0xbba0('0xe')]('zone')||_0x22bc5[_0xbba0('0xe')]('serverUrl')||_0x22bc5[_0xbba0('0xe')](_0xbba0('0xf'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x10'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x11'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x12'))){var _0x1ee68d,_0x1740f0;_0x1ee68d=_0x22bc5[_0xbba0('0x13')];var _0x1c7d33=_0x1ee68d['slice'](-0x1);if(_0x1c7d33==='/'||_0x1c7d33==='\x5c'||_0x1c7d33===':'){_0x1ee68d=_0x1ee68d[_0xbba0('0x14')](0x0,_0x1ee68d['lastIndexOf'](_0x1c7d33));}switch(_0x22bc5['zone']){case'US':_0x1740f0=_0xbba0('0x15');break;case'AU':_0x1740f0=_0xbba0('0x16');break;case'IN':_0x1740f0=_0xbba0('0x17');break;case'CN':_0x1740f0=_0xbba0('0x18');break;default:_0x1740f0=_0xbba0('0x19');break;}var _0x1be72b={'method':_0xbba0('0x1a'),'uri':_0x1740f0+_0xbba0('0x1b'),'form':{'grant_type':_0xbba0('0x1c'),'client_id':_0x22bc5[_0xbba0('0xf')],'client_secret':_0x22bc5[_0xbba0('0x10')],'redirect_uri':_0x22bc5[_0xbba0('0x13')],'code':_0x22bc5['code']},'headers':{'Content-Type':_0xbba0('0x1d')}};return rp(_0x1be72b)['then'](function(_0x260df0){var _0x5957c4=JSON[_0xbba0('0x1e')](_0x260df0);if(_0x5957c4[_0xbba0('0x1f')]){_0x22bc5[_0xbba0('0x20')]=_0x5957c4[_0xbba0('0x1f')];logger['info'](util[_0xbba0('0x21')](_0xbba0('0x22'),_0x22bc5[_0xbba0('0x23')],_0x22bc5['id']));}else{logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x22bc5[_0xbba0('0x23')],_0x22bc5['id']),util[_0xbba0('0x26')](_0x5957c4,{'showHidden':![],'depth':null}));}return _0x1d802c(null,_0x438929);})[_0xbba0('0x27')](function(_0x4a7a5b){logger[_0xbba0('0x24')](util['format'](_0xbba0('0x25'),_0x22bc5['name'],_0x22bc5['id']),util[_0xbba0('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d802c(_0x4a7a5b);});}else{return _0x1d802c(null,_0x438929);}},'beforeUpdate':function(_0x53bebd,_0x57eda9,_0x7d7252){if(_0x53bebd['changed'](_0xbba0('0x28'))||_0x53bebd['changed'](_0xbba0('0x13'))||_0x53bebd[_0xbba0('0xe')]('clientId')||_0x53bebd[_0xbba0('0xe')](_0xbba0('0x10'))||_0x53bebd[_0xbba0('0xe')]('code')||_0x53bebd[_0xbba0('0xe')](_0xbba0('0x12'))){var _0x329dec,_0x4a731a;_0x329dec=_0x53bebd[_0xbba0('0x13')];var _0x52e18c=_0x329dec['slice'](-0x1);if(_0x52e18c==='/'||_0x52e18c==='\x5c'||_0x52e18c===':'){_0x329dec=_0x329dec[_0xbba0('0x14')](0x0,_0x329dec[_0xbba0('0x29')](_0x52e18c));}switch(_0x53bebd[_0xbba0('0x28')]){case'US':_0x4a731a=_0xbba0('0x15');break;case'AU':_0x4a731a=_0xbba0('0x16');break;case'IN':_0x4a731a=_0xbba0('0x17');break;case'CN':_0x4a731a='https://accounts.zoho.com.cn';break;default:_0x4a731a='https://accounts.zoho.eu';break;}var _0x2b9d87={'method':_0xbba0('0x1a'),'uri':_0x4a731a+_0xbba0('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x53bebd[_0xbba0('0xf')],'client_secret':_0x53bebd[_0xbba0('0x10')],'redirect_uri':_0x53bebd[_0xbba0('0x13')],'code':_0x53bebd[_0xbba0('0x11')]},'headers':{'Content-Type':_0xbba0('0x1d')}};return rp(_0x2b9d87)[_0xbba0('0x2a')](function(_0x41e9e0){var _0x126c39=JSON[_0xbba0('0x1e')](_0x41e9e0);if(_0x126c39[_0xbba0('0x1f')]){_0x53bebd[_0xbba0('0x20')]=_0x126c39['refresh_token'];logger[_0xbba0('0x2b')](util[_0xbba0('0x21')](_0xbba0('0x22'),_0x53bebd['name'],_0x53bebd['id']));}else{logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x53bebd['name'],_0x53bebd['id']),util[_0xbba0('0x26')](_0x126c39,{'showHidden':![],'depth':null}));}return _0x7d7252(null,_0x57eda9);})['catch'](function(_0x36a340){logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x53bebd[_0xbba0('0x23')],_0x53bebd['id']),util[_0xbba0('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x7d7252(_0x36a340);});}else{return _0x7d7252(null,_0x57eda9);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 666a5e3..62c9181 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 _0x1aab=['options','raw','where','attributes','map','include','model','then','find','ShowZohoAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1aab,0x122));var _0xb1aa=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x1aab[_0x590a38];return _0xf36626;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});}exports[_0xb1aa('0x16')]=function(_0x1d1450){var _0x471116=this;return new Promise(function(_0x2c67f3,_0x19aa4c){return db[_0xb1aa('0x17')][_0xb1aa('0x18')]({'raw':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1b')]||null:null,'attributes':_0x1d1450['options']?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1c')]||null:null,'limit':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')]['limit']||null:null,'include':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')]['include']?_[_0xb1aa('0x1d')](_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1e')],function(_0x5f2aa7){return{'model':db[_0x5f2aa7['model']],'as':_0x5f2aa7['as'],'attributes':_0x5f2aa7[_0xb1aa('0x1c')],'include':_0x5f2aa7[_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x5f2aa7[_0xb1aa('0x1e')],function(_0x3a9c9e){return{'model':db[_0x3a9c9e[_0xb1aa('0x1f')]],'as':_0x3a9c9e['as'],'attributes':_0x3a9c9e[_0xb1aa('0x1c')],'include':_0x3a9c9e[_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x3a9c9e[_0xb1aa('0x1e')],function(_0x1cd714){return{'model':db[_0x1cd714[_0xb1aa('0x1f')]],'as':_0x1cd714['as'],'attributes':_0x1cd714[_0xb1aa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x20')](function(_0x40c7ff){logger['info'](_0xb1aa('0x16'),_0x1d1450);logger[_0xb1aa('0xd')](_0xb1aa('0x16'),_0x1d1450,JSON[_0xb1aa('0xf')](_0x40c7ff));_0x2c67f3(_0x40c7ff);})['catch'](function(_0xa4a319){logger[_0xb1aa('0x10')]('GetZohoAccount',_0xa4a319[_0xb1aa('0x13')],_0x1d1450);_0x19aa4c(_0x471116[_0xb1aa('0x10')](0x1f4,_0xa4a319[_0xb1aa('0x13')]));});});};exports['ShowZohoAccount']=function(_0x25df88){var _0x120cc3=this;return new Promise(function(_0x4a785e,_0x4b8b7c){return db[_0xb1aa('0x17')][_0xb1aa('0x21')]({'raw':_0x25df88[_0xb1aa('0x19')]?_0x25df88[_0xb1aa('0x19')][_0xb1aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x25df88[_0xb1aa('0x19')]?_0x25df88['options'][_0xb1aa('0x1b')]||null:null,'attributes':_0x25df88['options']?_0x25df88['options']['attributes']||null:null,'include':_0x25df88[_0xb1aa('0x19')]?_0x25df88[_0xb1aa('0x19')][_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x25df88[_0xb1aa('0x19')]['include'],function(_0x27a466){return{'model':db[_0x27a466[_0xb1aa('0x1f')]],'as':_0x27a466['as'],'attributes':_0x27a466[_0xb1aa('0x1c')],'include':_0x27a466['include']?_['map'](_0x27a466['include'],function(_0x4307b0){return{'model':db[_0x4307b0[_0xb1aa('0x1f')]],'as':_0x4307b0['as'],'attributes':_0x4307b0[_0xb1aa('0x1c')],'include':_0x4307b0[_0xb1aa('0x1e')]?_['map'](_0x4307b0[_0xb1aa('0x1e')],function(_0x8b71c){return{'model':db[_0x8b71c[_0xb1aa('0x1f')]],'as':_0x8b71c['as'],'attributes':_0x8b71c[_0xb1aa('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18989e){logger[_0xb1aa('0xb')](_0xb1aa('0x22'),_0x25df88);logger['debug'](_0xb1aa('0x22'),_0x25df88,JSON[_0xb1aa('0xf')](_0x18989e));_0x4a785e(_0x18989e);})[_0xb1aa('0x15')](function(_0x480ee3){logger[_0xb1aa('0x10')](_0xb1aa('0x22'),_0x480ee3[_0xb1aa('0x13')],_0x25df88);_0x4b8b7c(_0x120cc3[_0xb1aa('0x10')](0x1f4,_0x480ee3[_0xb1aa('0x13')]));});});}; \ No newline at end of file +var _0xcaf2=['raw','attributes','limit','include','map','model','GetZohoAccount','stringify','catch','ShowZohoAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ZohoAccount','options'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcaf2,0x8a));var _0x2caf=function(_0x52a58c,_0x102224){_0x52a58c=_0x52a58c-0x0;var _0x3e826a=_0xcaf2[_0x52a58c];return _0x3e826a;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['GetZohoAccount']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['findAll']({'raw':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')]['where']||null:null,'attributes':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'limit':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x18')]||null:null,'include':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x4a33fc[_0x2caf('0x15')]['include'],function(_0x296305){return{'model':db[_0x296305[_0x2caf('0x1b')]],'as':_0x296305['as'],'attributes':_0x296305[_0x2caf('0x17')],'include':_0x296305[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x296305[_0x2caf('0x19')],function(_0x392196){return{'model':db[_0x392196[_0x2caf('0x1b')]],'as':_0x392196['as'],'attributes':_0x392196[_0x2caf('0x17')],'include':_0x392196[_0x2caf('0x19')]?_['map'](_0x392196[_0x2caf('0x19')],function(_0x325eda){return{'model':db[_0x325eda[_0x2caf('0x1b')]],'as':_0x325eda['as'],'attributes':_0x325eda[_0x2caf('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2caf('0xa')](function(_0x17d3c6){logger[_0x2caf('0xb')](_0x2caf('0x1c'),_0x4a33fc);logger[_0x2caf('0xe')](_0x2caf('0x1c'),_0x4a33fc,JSON[_0x2caf('0x1d')](_0x17d3c6));_0x58047b(_0x17d3c6);})[_0x2caf('0x1e')](function(_0x158d60){logger['error'](_0x2caf('0x1c'),_0x158d60[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x158d60[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1f')]=function(_0x1f52bf){var _0x3812cd=this;return new Promise(function(_0x524e0c,_0x21b3c4){return db[_0x2caf('0x14')]['find']({'raw':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')]['where']||null:null,'attributes':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'include':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')],function(_0x20818e){return{'model':db[_0x20818e['model']],'as':_0x20818e['as'],'attributes':_0x20818e[_0x2caf('0x17')],'include':_0x20818e[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x20818e[_0x2caf('0x19')],function(_0x17c1b4){return{'model':db[_0x17c1b4[_0x2caf('0x1b')]],'as':_0x17c1b4['as'],'attributes':_0x17c1b4[_0x2caf('0x17')],'include':_0x17c1b4[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x17c1b4[_0x2caf('0x19')],function(_0x105ec7){return{'model':db[_0x105ec7[_0x2caf('0x1b')]],'as':_0x105ec7['as'],'attributes':_0x105ec7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x410020){logger[_0x2caf('0xb')](_0x2caf('0x1f'),_0x1f52bf);logger[_0x2caf('0xe')]('ShowZohoAccount',_0x1f52bf,JSON[_0x2caf('0x1d')](_0x410020));_0x524e0c(_0x410020);})[_0x2caf('0x1e')](function(_0x4568f9){logger[_0x2caf('0x10')](_0x2caf('0x1f'),_0x4568f9[_0x2caf('0x12')],_0x1f52bf);_0x21b3c4(_0x3812cd[_0x2caf('0x10')](0x1f4,_0x4568f9[_0x2caf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 02f6ffc..4f174f8 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 _0xc55b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/descriptions','getDescriptions','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4d83c5,_0x11a178){var _0x5a1752=function(_0x4bedf5){while(--_0x4bedf5){_0x4d83c5['push'](_0x4d83c5['shift']());}};_0x5a1752(++_0x11a178);}(_0xc55b,0x1de));var _0xbc55=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xc55b[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xbc55('0x0'));var util=require(_0xbc55('0x1'));var path=require(_0xbc55('0x2'));var timeout=require(_0xbc55('0x3'));var express=require(_0xbc55('0x4'));var router=express[_0xbc55('0x5')]();var fs_extra=require(_0xbc55('0x6'));var auth=require(_0xbc55('0x7'));var interaction=require(_0xbc55('0x8'));var config=require('../../config/environment');var controller=require(_0xbc55('0x9'));router[_0xbc55('0xa')]('/',auth[_0xbc55('0xb')](),controller[_0xbc55('0xc')]);router[_0xbc55('0xa')](_0xbc55('0xd'),auth[_0xbc55('0xb')](),controller[_0xbc55('0xe')]);router[_0xbc55('0xa')]('/:id/fields',auth[_0xbc55('0xb')](),controller['getFields']);router[_0xbc55('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xbc55('0xa')](_0xbc55('0xf'),auth[_0xbc55('0xb')](),controller[_0xbc55('0x10')]);router['post']('/',auth[_0xbc55('0xb')](),controller['create']);router[_0xbc55('0x11')](_0xbc55('0xd'),auth[_0xbc55('0xb')](),controller['update']);router[_0xbc55('0x12')]('/:id',auth[_0xbc55('0xb')](),controller[_0xbc55('0x13')]);module[_0xbc55('0x14')]=router; \ No newline at end of file +var _0x3032=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3d986d,_0x573a8c){var _0xf78f48=function(_0x169517){while(--_0x169517){_0x3d986d['push'](_0x3d986d['shift']());}};_0xf78f48(++_0x573a8c);}(_0x3032,0x95));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2303('0x0'));var util=require(_0x2303('0x1'));var path=require(_0x2303('0x2'));var timeout=require(_0x2303('0x3'));var express=require(_0x2303('0x4'));var router=express['Router']();var fs_extra=require(_0x2303('0x5'));var auth=require(_0x2303('0x6'));var interaction=require(_0x2303('0x7'));var config=require(_0x2303('0x8'));var controller=require(_0x2303('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2303('0xa')]);router[_0x2303('0xb')](_0x2303('0xc'),auth[_0x2303('0xd')](),controller['show']);router['get'](_0x2303('0xe'),auth[_0x2303('0xd')](),controller[_0x2303('0xf')]);router[_0x2303('0xb')](_0x2303('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x2303('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2303('0x11')]);router['post']('/',auth[_0x2303('0xd')](),controller[_0x2303('0x12')]);router[_0x2303('0x13')](_0x2303('0xc'),auth[_0x2303('0xd')](),controller[_0x2303('0x14')]);router['delete'](_0x2303('0xc'),auth[_0x2303('0xd')](),controller['destroy']);module[_0x2303('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index a46ddf6..786e4e9 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 _0xb483=['nothing','lead','ENUM','STRING','sequelize','exports','contact'];(function(_0x3f9552,_0x3f7686){var _0x398355=function(_0x1bf64a){while(--_0x1bf64a){_0x3f9552['push'](_0x3f9552['shift']());}};_0x398355(++_0x3f7686);}(_0xb483,0x107));var _0x3b48=function(_0x2e382c,_0x3c19d6){_0x2e382c=_0x2e382c-0x0;var _0x2a248d=_0xb483[_0x2e382c];return _0x2a248d;};'use strict';var Sequelize=require(_0x3b48('0x0'));module[_0x3b48('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x3b48('0x2'),_0x3b48('0x3')),'defaultValue':_0x3b48('0x4')},'moduleSearch':{'type':Sequelize[_0x3b48('0x5')]('contact_lead',_0x3b48('0x2'),_0x3b48('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x3b48('0x6')]}}; \ No newline at end of file +var _0x480c=['STRING','contact','nothing','ENUM','contact_lead','lead'];(function(_0x44f662,_0x1bbe00){var _0x55af2a=function(_0x3f95ad){while(--_0x3f95ad){_0x44f662['push'](_0x44f662['shift']());}};_0x55af2a(++_0x1bbe00);}(_0x480c,0xcc));var _0xc480=function(_0x57f57a,_0x39d796){_0x57f57a=_0x57f57a-0x0;var _0x544e7c=_0x480c[_0x57f57a];return _0x544e7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc480('0x0')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xc480('0x1'),_0xc480('0x2')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xc480('0x3')](_0xc480('0x4'),_0xc480('0x1'),_0xc480('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xc480('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 81267f2..0809e44 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 _0xeea9=['fields','length','nolimit','order','sort','filters','pick','filter','merge','options','where','includeAll','include','findAll','catch','show','params','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes'];(function(_0x1681f8,_0xb1f14f){var _0x37539a=function(_0xed6b29){while(--_0xed6b29){_0x1681f8['push'](_0x1681f8['shift']());}};_0x37539a(++_0xb1f14f);}(_0xeea9,0x19a));var _0x9eea=function(_0xe9099e,_0x3e387d){_0xe9099e=_0xe9099e-0x0;var _0x25fedd=_0xeea9[_0xe9099e];return _0x25fedd;};'use strict';var emlformat=require(_0x9eea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9eea('0x1'));var jsonpatch=require(_0x9eea('0x2'));var rp=require(_0x9eea('0x3'));var moment=require(_0x9eea('0x4'));var BPromise=require(_0x9eea('0x5'));var Mustache=require(_0x9eea('0x6'));var util=require('util');var path=require(_0x9eea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9eea('0x8'));var fs=require('fs');var fs_extra=require(_0x9eea('0x9'));var _=require(_0x9eea('0xa'));var squel=require(_0x9eea('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9eea('0xc'));var toCsv=require(_0x9eea('0xd'));var querystring=require(_0x9eea('0xe'));var Papa=require(_0x9eea('0xf'));var Redis=require(_0x9eea('0x10'));var authService=require(_0x9eea('0x11'));var qs=require(_0x9eea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9eea('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9eea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9eea('0x15'));var db=require(_0x9eea('0x16'))['db'];function respondWithStatusCode(_0x1efefd,_0x469c9b){_0x469c9b=_0x469c9b||0xcc;return function(_0x48a701){if(_0x48a701){return _0x1efefd['sendStatus'](_0x469c9b);}return _0x1efefd[_0x9eea('0x17')](_0x469c9b)[_0x9eea('0x18')]();};}function respondWithResult(_0x59bca4,_0x2155d1){_0x2155d1=_0x2155d1||0xc8;return function(_0x5367a7){if(_0x5367a7){return _0x59bca4['status'](_0x2155d1)[_0x9eea('0x19')](_0x5367a7);}};}function respondWithFilteredResult(_0x19ddf2,_0x124992){return function(_0x290d1b){if(_0x290d1b){var _0x4f8cbe=typeof _0x124992[_0x9eea('0x1a')]===_0x9eea('0x1b')&&typeof _0x124992['limit']===_0x9eea('0x1b');var _0x577b36=_0x290d1b[_0x9eea('0x1c')];var _0x3b0289=_0x4f8cbe?0x0:_0x124992[_0x9eea('0x1a')];var _0x5390d4=_0x4f8cbe?_0x290d1b[_0x9eea('0x1c')]:_0x124992[_0x9eea('0x1a')]+_0x124992[_0x9eea('0x1d')];var _0xdf0a0c;if(_0x5390d4>=_0x577b36){_0x5390d4=_0x577b36;_0xdf0a0c=0xc8;}else{_0xdf0a0c=0xce;}_0x19ddf2[_0x9eea('0x17')](_0xdf0a0c);return _0x19ddf2[_0x9eea('0x1e')](_0x9eea('0x1f'),_0x3b0289+'-'+_0x5390d4+'/'+_0x577b36)[_0x9eea('0x19')](_0x290d1b);}return null;};}function patchUpdates(_0x204bc0){return function(_0x487a10){try{jsonpatch[_0x9eea('0x20')](_0x487a10,_0x204bc0,!![]);}catch(_0x35d630){return BPromise['reject'](_0x35d630);}return _0x487a10['save']();};}function saveUpdates(_0x2308da,_0x4ef74f){return function(_0x57c666){if(_0x57c666){return _0x57c666[_0x9eea('0x21')](_0x2308da)[_0x9eea('0x22')](function(_0x1e3200){return _0x1e3200;});}return null;};}function removeEntity(_0x3f7c83,_0xae2701){return function(_0x3a6008){if(_0x3a6008){return _0x3a6008[_0x9eea('0x23')]()['then'](function(){_0x3f7c83[_0x9eea('0x17')](0xcc)[_0x9eea('0x18')]();});}};}function handleEntityNotFound(_0x384f30,_0x1b9df3){return function(_0x44f961){if(!_0x44f961){_0x384f30[_0x9eea('0x24')](0x194);}return _0x44f961;};}function handleError(_0x4d580a,_0x3e0bfb){_0x3e0bfb=_0x3e0bfb||0x1f4;return function(_0x437145){logger[_0x9eea('0x25')](_0x437145[_0x9eea('0x26')]);if(_0x437145[_0x9eea('0x27')]){delete _0x437145[_0x9eea('0x27')];}_0x4d580a['status'](_0x3e0bfb)[_0x9eea('0x28')](_0x437145);};}exports[_0x9eea('0x29')]=function(_0x59ea98,_0x2fbe87){var _0x22ecc3={},_0x38369e={},_0x362c78={'count':0x0,'rows':[]};var _0x2527b5=_['map'](db[_0x9eea('0x2a')][_0x9eea('0x2b')],function(_0x327f0f){return{'name':_0x327f0f[_0x9eea('0x2c')],'type':_0x327f0f[_0x9eea('0x2d')]['key']};});_0x38369e[_0x9eea('0x2e')]=_[_0x9eea('0x2f')](_0x2527b5,'name');_0x38369e[_0x9eea('0x30')]=_[_0x9eea('0x31')](_0x59ea98[_0x9eea('0x30')]);_0x38369e['filters']=_[_0x9eea('0x32')](_0x38369e[_0x9eea('0x2e')],_0x38369e[_0x9eea('0x30')]);_0x22ecc3[_0x9eea('0x33')]=_[_0x9eea('0x32')](_0x38369e[_0x9eea('0x2e')],qs[_0x9eea('0x34')](_0x59ea98[_0x9eea('0x30')][_0x9eea('0x34')]));_0x22ecc3[_0x9eea('0x33')]=_0x22ecc3['attributes'][_0x9eea('0x35')]?_0x22ecc3['attributes']:_0x38369e['model'];if(!_0x59ea98[_0x9eea('0x30')]['hasOwnProperty'](_0x9eea('0x36'))){_0x22ecc3[_0x9eea('0x1d')]=qs[_0x9eea('0x1d')](_0x59ea98[_0x9eea('0x30')][_0x9eea('0x1d')]);_0x22ecc3[_0x9eea('0x1a')]=qs[_0x9eea('0x1a')](_0x59ea98[_0x9eea('0x30')][_0x9eea('0x1a')]);}_0x22ecc3[_0x9eea('0x37')]=qs[_0x9eea('0x38')](_0x59ea98[_0x9eea('0x30')]['sort']);_0x22ecc3['where']=qs[_0x9eea('0x39')](_[_0x9eea('0x3a')](_0x59ea98[_0x9eea('0x30')],_0x38369e[_0x9eea('0x39')]),_0x2527b5);if(_0x59ea98['query'][_0x9eea('0x3b')]){_0x22ecc3['where']=_['merge'](_0x22ecc3['where'],{'$or':_['map'](_0x2527b5,function(_0xb255){if(_0xb255[_0x9eea('0x2d')]!=='VIRTUAL'){var _0x27a8b1={};_0x27a8b1[_0xb255[_0x9eea('0x27')]]={'$like':'%'+_0x59ea98[_0x9eea('0x30')][_0x9eea('0x3b')]+'%'};return _0x27a8b1;}})});}_0x22ecc3=_[_0x9eea('0x3c')]({},_0x22ecc3,_0x59ea98[_0x9eea('0x3d')]);var _0x3c8986={'where':_0x22ecc3[_0x9eea('0x3e')]};return db[_0x9eea('0x2a')][_0x9eea('0x1c')](_0x3c8986)['then'](function(_0x26256f){_0x362c78[_0x9eea('0x1c')]=_0x26256f;if(_0x59ea98[_0x9eea('0x30')][_0x9eea('0x3f')]){_0x22ecc3[_0x9eea('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x9eea('0x41')](_0x22ecc3);})[_0x9eea('0x22')](function(_0x587949){_0x362c78['rows']=_0x587949;return _0x362c78;})[_0x9eea('0x22')](respondWithFilteredResult(_0x2fbe87,_0x22ecc3))[_0x9eea('0x42')](handleError(_0x2fbe87,null));};exports[_0x9eea('0x43')]=function(_0x1a05d8,_0x1150cc){var _0x457ff1={'raw':![],'where':{'id':_0x1a05d8[_0x9eea('0x44')]['id']}},_0x59b287={};_0x59b287[_0x9eea('0x2e')]=_['keys'](db[_0x9eea('0x2a')]['rawAttributes']);_0x59b287[_0x9eea('0x30')]=_[_0x9eea('0x31')](_0x1a05d8[_0x9eea('0x30')]);_0x59b287[_0x9eea('0x39')]=_['intersection'](_0x59b287[_0x9eea('0x2e')],_0x59b287[_0x9eea('0x30')]);_0x457ff1[_0x9eea('0x33')]=_[_0x9eea('0x32')](_0x59b287[_0x9eea('0x2e')],qs[_0x9eea('0x34')](_0x1a05d8['query'][_0x9eea('0x34')]));_0x457ff1['attributes']=_0x457ff1[_0x9eea('0x33')]['length']?_0x457ff1[_0x9eea('0x33')]:_0x59b287['model'];if(_0x1a05d8[_0x9eea('0x30')]['includeAll']){_0x457ff1[_0x9eea('0x40')]=[{'all':!![]}];}_0x457ff1=_[_0x9eea('0x3c')]({},_0x457ff1,_0x1a05d8[_0x9eea('0x3d')]);return db[_0x9eea('0x2a')]['find'](_0x457ff1)[_0x9eea('0x22')](handleEntityNotFound(_0x1150cc,null))[_0x9eea('0x22')](respondWithResult(_0x1150cc,null))['catch'](handleError(_0x1150cc,null));};exports['create']=function(_0x442847,_0x266d5f){return db[_0x9eea('0x2a')][_0x9eea('0x45')](_0x442847[_0x9eea('0x46')],{})['then'](respondWithResult(_0x266d5f,0xc9))[_0x9eea('0x42')](handleError(_0x266d5f,null));};exports[_0x9eea('0x21')]=function(_0x4bc616,_0x4da01b){if(_0x4bc616['body']['id']){delete _0x4bc616[_0x9eea('0x46')]['id'];}return db[_0x9eea('0x2a')]['find']({'where':{'id':_0x4bc616[_0x9eea('0x44')]['id']}})[_0x9eea('0x22')](handleEntityNotFound(_0x4da01b,null))[_0x9eea('0x22')](saveUpdates(_0x4bc616[_0x9eea('0x46')],null))[_0x9eea('0x22')](respondWithResult(_0x4da01b,null))[_0x9eea('0x42')](handleError(_0x4da01b,null));};exports['destroy']=function(_0x2051fb,_0x51ebcb){return db[_0x9eea('0x2a')]['find']({'where':{'id':_0x2051fb[_0x9eea('0x44')]['id']}})[_0x9eea('0x22')](handleEntityNotFound(_0x51ebcb,null))[_0x9eea('0x22')](removeEntity(_0x51ebcb,null))['catch'](handleError(_0x51ebcb,null));};exports[_0x9eea('0x47')]=function(_0x381f2a,_0x4ba0e4,_0x1adb70){var _0x126f38={};var _0x1cde6e={};var _0x209bb2;var _0x47edbc;return db[_0x9eea('0x2a')][_0x9eea('0x48')]({'where':{'id':_0x381f2a[_0x9eea('0x44')]['id']}})[_0x9eea('0x22')](handleEntityNotFound(_0x4ba0e4,null))[_0x9eea('0x22')](function(_0x97c1d4){if(_0x97c1d4){_0x209bb2=_0x97c1d4;_0x1cde6e[_0x9eea('0x2e')]=_[_0x9eea('0x31')](db[_0x9eea('0x49')][_0x9eea('0x2b')]);_0x1cde6e[_0x9eea('0x30')]=_[_0x9eea('0x31')](_0x381f2a['query']);_0x1cde6e[_0x9eea('0x39')]=_[_0x9eea('0x32')](_0x1cde6e[_0x9eea('0x2e')],_0x1cde6e[_0x9eea('0x30')]);_0x126f38[_0x9eea('0x33')]=_[_0x9eea('0x32')](_0x1cde6e[_0x9eea('0x2e')],qs[_0x9eea('0x34')](_0x381f2a[_0x9eea('0x30')][_0x9eea('0x34')]));_0x126f38[_0x9eea('0x33')]=_0x126f38[_0x9eea('0x33')][_0x9eea('0x35')]?_0x126f38[_0x9eea('0x33')]:_0x1cde6e[_0x9eea('0x2e')];_0x126f38[_0x9eea('0x37')]=qs['sort'](_0x381f2a[_0x9eea('0x30')][_0x9eea('0x38')]);_0x126f38[_0x9eea('0x3e')]=qs['filters'](_[_0x9eea('0x3a')](_0x381f2a['query'],_0x1cde6e[_0x9eea('0x39')]));if(_0x381f2a[_0x9eea('0x30')]['filter']){_0x126f38[_0x9eea('0x3e')]=_[_0x9eea('0x3c')](_0x126f38['where'],{'$or':_[_0x9eea('0x2f')](_0x126f38[_0x9eea('0x33')],function(_0x512dea){var _0x51739c={};_0x51739c[_0x512dea]={'$like':'%'+_0x381f2a['query'][_0x9eea('0x3b')]+'%'};return _0x51739c;})});}_0x126f38=_['merge']({},_0x126f38,_0x381f2a['options']);return _0x209bb2[_0x9eea('0x47')](_0x126f38);}})[_0x9eea('0x22')](function(_0x5e2f7f){if(_0x5e2f7f){_0x47edbc=_0x5e2f7f['length'];if(!_0x381f2a[_0x9eea('0x30')][_0x9eea('0x4a')](_0x9eea('0x36'))){_0x126f38['limit']=qs[_0x9eea('0x1d')](_0x381f2a[_0x9eea('0x30')][_0x9eea('0x1d')]);_0x126f38[_0x9eea('0x1a')]=qs[_0x9eea('0x1a')](_0x381f2a['query'][_0x9eea('0x1a')]);}return _0x209bb2[_0x9eea('0x47')](_0x126f38);}})[_0x9eea('0x22')](function(_0x349cb9){if(_0x349cb9){return _0x349cb9?{'count':_0x47edbc,'rows':_0x349cb9}:null;}})[_0x9eea('0x22')](respondWithResult(_0x4ba0e4,null))[_0x9eea('0x42')](handleError(_0x4ba0e4,null));};exports['getSubjects']=function(_0x44086a,_0x21354a,_0x8d27aa){var _0x1daeb2={};var _0x32f930={};var _0x4e4816;var _0x4ee04d;return db[_0x9eea('0x2a')][_0x9eea('0x48')]({'where':{'id':_0x44086a[_0x9eea('0x44')]['id']}})['then'](handleEntityNotFound(_0x21354a,null))[_0x9eea('0x22')](function(_0x5f1442){if(_0x5f1442){_0x4e4816=_0x5f1442;_0x32f930[_0x9eea('0x2e')]=_[_0x9eea('0x31')](db[_0x9eea('0x49')][_0x9eea('0x2b')]);_0x32f930['query']=_['keys'](_0x44086a[_0x9eea('0x30')]);_0x32f930[_0x9eea('0x39')]=_[_0x9eea('0x32')](_0x32f930['model'],_0x32f930[_0x9eea('0x30')]);_0x1daeb2[_0x9eea('0x33')]=_[_0x9eea('0x32')](_0x32f930['model'],qs['fields'](_0x44086a['query'][_0x9eea('0x34')]));_0x1daeb2[_0x9eea('0x33')]=_0x1daeb2[_0x9eea('0x33')]['length']?_0x1daeb2[_0x9eea('0x33')]:_0x32f930[_0x9eea('0x2e')];_0x1daeb2['order']=qs['sort'](_0x44086a[_0x9eea('0x30')]['sort']);_0x1daeb2[_0x9eea('0x3e')]=qs['filters'](_[_0x9eea('0x3a')](_0x44086a['query'],_0x32f930[_0x9eea('0x39')]));if(_0x44086a[_0x9eea('0x30')][_0x9eea('0x3b')]){_0x1daeb2[_0x9eea('0x3e')]=_['merge'](_0x1daeb2[_0x9eea('0x3e')],{'$or':_[_0x9eea('0x2f')](_0x1daeb2[_0x9eea('0x33')],function(_0x38da1b){var _0xfc0e9a={};_0xfc0e9a[_0x38da1b]={'$like':'%'+_0x44086a[_0x9eea('0x30')][_0x9eea('0x3b')]+'%'};return _0xfc0e9a;})});}_0x1daeb2=_['merge']({},_0x1daeb2,_0x44086a[_0x9eea('0x3d')]);return _0x4e4816[_0x9eea('0x4b')](_0x1daeb2);}})['then'](function(_0x3aaee9){if(_0x3aaee9){_0x4ee04d=_0x3aaee9[_0x9eea('0x35')];if(!_0x44086a['query'][_0x9eea('0x4a')](_0x9eea('0x36'))){_0x1daeb2[_0x9eea('0x1d')]=qs[_0x9eea('0x1d')](_0x44086a[_0x9eea('0x30')]['limit']);_0x1daeb2[_0x9eea('0x1a')]=qs[_0x9eea('0x1a')](_0x44086a[_0x9eea('0x30')]['offset']);}return _0x4e4816[_0x9eea('0x4b')](_0x1daeb2);}})['then'](function(_0x4e7c90){if(_0x4e7c90){return _0x4e7c90?{'count':_0x4ee04d,'rows':_0x4e7c90}:null;}})['then'](respondWithResult(_0x21354a,null))['catch'](handleError(_0x21354a,null));};exports[_0x9eea('0x4c')]=function(_0x28c695,_0x2bde71,_0x25a526){var _0x26b8e5={};var _0x481760={};var _0x869b8a;var _0x31f9b5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x28c695['params']['id']}})[_0x9eea('0x22')](handleEntityNotFound(_0x2bde71,null))[_0x9eea('0x22')](function(_0x4eb66d){if(_0x4eb66d){_0x869b8a=_0x4eb66d;_0x481760[_0x9eea('0x2e')]=_[_0x9eea('0x31')](db['ZohoField'][_0x9eea('0x2b')]);_0x481760['query']=_['keys'](_0x28c695['query']);_0x481760[_0x9eea('0x39')]=_[_0x9eea('0x32')](_0x481760[_0x9eea('0x2e')],_0x481760[_0x9eea('0x30')]);_0x26b8e5[_0x9eea('0x33')]=_[_0x9eea('0x32')](_0x481760['model'],qs['fields'](_0x28c695['query'][_0x9eea('0x34')]));_0x26b8e5['attributes']=_0x26b8e5['attributes'][_0x9eea('0x35')]?_0x26b8e5[_0x9eea('0x33')]:_0x481760[_0x9eea('0x2e')];_0x26b8e5[_0x9eea('0x37')]=qs[_0x9eea('0x38')](_0x28c695[_0x9eea('0x30')][_0x9eea('0x38')]);_0x26b8e5[_0x9eea('0x3e')]=qs[_0x9eea('0x39')](_[_0x9eea('0x3a')](_0x28c695[_0x9eea('0x30')],_0x481760[_0x9eea('0x39')]));if(_0x28c695[_0x9eea('0x30')]['filter']){_0x26b8e5[_0x9eea('0x3e')]=_['merge'](_0x26b8e5['where'],{'$or':_[_0x9eea('0x2f')](_0x26b8e5[_0x9eea('0x33')],function(_0x227903){var _0xe52434={};_0xe52434[_0x227903]={'$like':'%'+_0x28c695[_0x9eea('0x30')][_0x9eea('0x3b')]+'%'};return _0xe52434;})});}_0x26b8e5=_[_0x9eea('0x3c')]({},_0x26b8e5,_0x28c695[_0x9eea('0x3d')]);return _0x869b8a['getDescriptions'](_0x26b8e5);}})['then'](function(_0x444f00){if(_0x444f00){_0x31f9b5=_0x444f00[_0x9eea('0x35')];if(!_0x28c695[_0x9eea('0x30')][_0x9eea('0x4a')]('nolimit')){_0x26b8e5[_0x9eea('0x1d')]=qs['limit'](_0x28c695['query'][_0x9eea('0x1d')]);_0x26b8e5[_0x9eea('0x1a')]=qs[_0x9eea('0x1a')](_0x28c695[_0x9eea('0x30')]['offset']);}return _0x869b8a[_0x9eea('0x4c')](_0x26b8e5);}})[_0x9eea('0x22')](function(_0x8081c8){if(_0x8081c8){return _0x8081c8?{'count':_0x31f9b5,'rows':_0x8081c8}:null;}})['then'](respondWithResult(_0x2bde71,null))[_0x9eea('0x42')](handleError(_0x2bde71,null));}; \ No newline at end of file +var _0xf3b6=['nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','keys','options','find','create','params','body','findOne','ZohoField','pick','getFields'];(function(_0x4c0833,_0x2f9b00){var _0x3c24f9=function(_0x18568b){while(--_0x18568b){_0x4c0833['push'](_0x4c0833['shift']());}};_0x3c24f9(++_0x2f9b00);}(_0xf3b6,0xf0));var _0x6f3b=function(_0x4eb6d7,_0x46d1c5){_0x4eb6d7=_0x4eb6d7-0x0;var _0x18cfbc=_0xf3b6[_0x4eb6d7];return _0x18cfbc;};'use strict';var emlformat=require(_0x6f3b('0x0'));var rimraf=require(_0x6f3b('0x1'));var zipdir=require(_0x6f3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f3b('0x3'));var moment=require(_0x6f3b('0x4'));var BPromise=require(_0x6f3b('0x5'));var Mustache=require(_0x6f3b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6f3b('0x7'));var csv=require('to-csv');var ejs=require(_0x6f3b('0x8'));var fs=require('fs');var fs_extra=require(_0x6f3b('0x9'));var _=require(_0x6f3b('0xa'));var squel=require(_0x6f3b('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f3b('0xc'));var deskjs=require(_0x6f3b('0xd'));var toCsv=require(_0x6f3b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f3b('0xf'));var authService=require(_0x6f3b('0x10'));var qs=require(_0x6f3b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f3b('0x12'))(_0x6f3b('0x13'));var utils=require(_0x6f3b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f3b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3521d0,_0x275cd){_0x275cd=_0x275cd||0xcc;return function(_0xeaa436){if(_0xeaa436){return _0x3521d0[_0x6f3b('0x16')](_0x275cd);}return _0x3521d0[_0x6f3b('0x17')](_0x275cd)[_0x6f3b('0x18')]();};}function respondWithResult(_0x58a27e,_0x394547){_0x394547=_0x394547||0xc8;return function(_0x5e0e5c){if(_0x5e0e5c){return _0x58a27e[_0x6f3b('0x17')](_0x394547)[_0x6f3b('0x19')](_0x5e0e5c);}};}function respondWithFilteredResult(_0x23f92d,_0x56f5cb){return function(_0x4a3f4d){if(_0x4a3f4d){var _0x50c867=typeof _0x56f5cb['offset']===_0x6f3b('0x1a')&&typeof _0x56f5cb['limit']==='undefined';var _0x50f386=_0x4a3f4d[_0x6f3b('0x1b')];var _0x5414c3=_0x50c867?0x0:_0x56f5cb[_0x6f3b('0x1c')];var _0x104761=_0x50c867?_0x4a3f4d[_0x6f3b('0x1b')]:_0x56f5cb[_0x6f3b('0x1c')]+_0x56f5cb[_0x6f3b('0x1d')];var _0x407982;if(_0x104761>=_0x50f386){_0x104761=_0x50f386;_0x407982=0xc8;}else{_0x407982=0xce;}_0x23f92d[_0x6f3b('0x17')](_0x407982);return _0x23f92d[_0x6f3b('0x1e')](_0x6f3b('0x1f'),_0x5414c3+'-'+_0x104761+'/'+_0x50f386)[_0x6f3b('0x19')](_0x4a3f4d);}return null;};}function patchUpdates(_0x5652ab){return function(_0x3e0b56){try{jsonpatch[_0x6f3b('0x20')](_0x3e0b56,_0x5652ab,!![]);}catch(_0x49af22){return BPromise[_0x6f3b('0x21')](_0x49af22);}return _0x3e0b56['save']();};}function saveUpdates(_0x12fcf7,_0x3aeac9){return function(_0x362409){if(_0x362409){return _0x362409[_0x6f3b('0x22')](_0x12fcf7)['then'](function(_0x708f0a){return _0x708f0a;});}return null;};}function removeEntity(_0x1b30af,_0x27cda0){return function(_0x2b5c87){if(_0x2b5c87){return _0x2b5c87[_0x6f3b('0x23')]()[_0x6f3b('0x24')](function(){_0x1b30af[_0x6f3b('0x17')](0xcc)[_0x6f3b('0x18')]();});}};}function handleEntityNotFound(_0x41449d,_0x4a55db){return function(_0xe606c9){if(!_0xe606c9){_0x41449d[_0x6f3b('0x16')](0x194);}return _0xe606c9;};}function handleError(_0x3090ba,_0xc3348c){_0xc3348c=_0xc3348c||0x1f4;return function(_0x1b9b3f){logger[_0x6f3b('0x25')](_0x1b9b3f['stack']);if(_0x1b9b3f[_0x6f3b('0x26')]){delete _0x1b9b3f[_0x6f3b('0x26')];}_0x3090ba[_0x6f3b('0x17')](_0xc3348c)[_0x6f3b('0x27')](_0x1b9b3f);};}exports[_0x6f3b('0x28')]=function(_0x2e0d54,_0x15719f){var _0x500dab={},_0x529159={},_0x36df51={'count':0x0,'rows':[]};var _0x30297e=_[_0x6f3b('0x29')](db['ZohoConfiguration'][_0x6f3b('0x2a')],function(_0x215553){return{'name':_0x215553[_0x6f3b('0x2b')],'type':_0x215553['type']['key']};});_0x529159[_0x6f3b('0x2c')]=_[_0x6f3b('0x29')](_0x30297e,_0x6f3b('0x26'));_0x529159[_0x6f3b('0x2d')]=_['keys'](_0x2e0d54[_0x6f3b('0x2d')]);_0x529159[_0x6f3b('0x2e')]=_[_0x6f3b('0x2f')](_0x529159[_0x6f3b('0x2c')],_0x529159[_0x6f3b('0x2d')]);_0x500dab[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x529159['model'],qs[_0x6f3b('0x31')](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x500dab[_0x6f3b('0x30')]=_0x500dab[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x500dab[_0x6f3b('0x30')]:_0x529159[_0x6f3b('0x2c')];if(!_0x2e0d54['query'][_0x6f3b('0x33')]('nolimit')){_0x500dab[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x2e0d54['query'][_0x6f3b('0x1d')]);_0x500dab[_0x6f3b('0x1c')]=qs['offset'](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x1c')]);}_0x500dab[_0x6f3b('0x34')]=qs[_0x6f3b('0x35')](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x500dab[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_['pick'](_0x2e0d54[_0x6f3b('0x2d')],_0x529159[_0x6f3b('0x2e')]),_0x30297e);if(_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x37')]){_0x500dab[_0x6f3b('0x36')]=_['merge'](_0x500dab[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x30297e,function(_0x2d8a39){if(_0x2d8a39[_0x6f3b('0x38')]!==_0x6f3b('0x39')){var _0x3fe98d={};_0x3fe98d[_0x2d8a39[_0x6f3b('0x26')]]={'$like':'%'+_0x2e0d54['query'][_0x6f3b('0x37')]+'%'};return _0x3fe98d;}})});}_0x500dab=_[_0x6f3b('0x3a')]({},_0x500dab,_0x2e0d54['options']);var _0xf85b5d={'where':_0x500dab[_0x6f3b('0x36')]};return db[_0x6f3b('0x3b')][_0x6f3b('0x1b')](_0xf85b5d)[_0x6f3b('0x24')](function(_0x1e06d0){_0x36df51['count']=_0x1e06d0;if(_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x3c')]){_0x500dab[_0x6f3b('0x3d')]=[{'all':!![]}];}return db[_0x6f3b('0x3b')][_0x6f3b('0x3e')](_0x500dab);})[_0x6f3b('0x24')](function(_0x530d70){_0x36df51[_0x6f3b('0x3f')]=_0x530d70;return _0x36df51;})['then'](respondWithFilteredResult(_0x15719f,_0x500dab))[_0x6f3b('0x40')](handleError(_0x15719f,null));};exports[_0x6f3b('0x41')]=function(_0x37f7de,_0x2305b3){var _0x44d56f={'raw':![],'where':{'id':_0x37f7de['params']['id']}},_0x210a21={};_0x210a21[_0x6f3b('0x2c')]=_[_0x6f3b('0x42')](db[_0x6f3b('0x3b')][_0x6f3b('0x2a')]);_0x210a21[_0x6f3b('0x2d')]=_['keys'](_0x37f7de[_0x6f3b('0x2d')]);_0x210a21[_0x6f3b('0x2e')]=_[_0x6f3b('0x2f')](_0x210a21[_0x6f3b('0x2c')],_0x210a21[_0x6f3b('0x2d')]);_0x44d56f[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x210a21[_0x6f3b('0x2c')],qs[_0x6f3b('0x31')](_0x37f7de[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x44d56f[_0x6f3b('0x30')]=_0x44d56f[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x44d56f[_0x6f3b('0x30')]:_0x210a21['model'];if(_0x37f7de[_0x6f3b('0x2d')]['includeAll']){_0x44d56f['include']=[{'all':!![]}];}_0x44d56f=_[_0x6f3b('0x3a')]({},_0x44d56f,_0x37f7de[_0x6f3b('0x43')]);return db['ZohoConfiguration'][_0x6f3b('0x44')](_0x44d56f)[_0x6f3b('0x24')](handleEntityNotFound(_0x2305b3,null))[_0x6f3b('0x24')](respondWithResult(_0x2305b3,null))['catch'](handleError(_0x2305b3,null));};exports[_0x6f3b('0x45')]=function(_0x557060,_0x467046){return db[_0x6f3b('0x3b')][_0x6f3b('0x45')](_0x557060['body'],{})[_0x6f3b('0x24')](respondWithResult(_0x467046,0xc9))[_0x6f3b('0x40')](handleError(_0x467046,null));};exports['update']=function(_0x2b3bce,_0x40224e){if(_0x2b3bce['body']['id']){delete _0x2b3bce['body']['id'];}return db[_0x6f3b('0x3b')]['find']({'where':{'id':_0x2b3bce[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x40224e,null))[_0x6f3b('0x24')](saveUpdates(_0x2b3bce[_0x6f3b('0x47')],null))[_0x6f3b('0x24')](respondWithResult(_0x40224e,null))[_0x6f3b('0x40')](handleError(_0x40224e,null));};exports[_0x6f3b('0x23')]=function(_0x3c224c,_0x24a94a){return db[_0x6f3b('0x3b')][_0x6f3b('0x44')]({'where':{'id':_0x3c224c[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x24a94a,null))[_0x6f3b('0x24')](removeEntity(_0x24a94a,null))['catch'](handleError(_0x24a94a,null));};exports['getFields']=function(_0x5b4ee9,_0x38db5f,_0x5b4a2d){var _0x18359f={};var _0x27f0f9={};var _0x409b0e;var _0x52cfe6;return db[_0x6f3b('0x3b')][_0x6f3b('0x48')]({'where':{'id':_0x5b4ee9[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x38db5f,null))[_0x6f3b('0x24')](function(_0x52369d){if(_0x52369d){_0x409b0e=_0x52369d;_0x27f0f9[_0x6f3b('0x2c')]=_['keys'](db[_0x6f3b('0x49')]['rawAttributes']);_0x27f0f9[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x5b4ee9['query']);_0x27f0f9[_0x6f3b('0x2e')]=_['intersection'](_0x27f0f9[_0x6f3b('0x2c')],_0x27f0f9[_0x6f3b('0x2d')]);_0x18359f[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x27f0f9[_0x6f3b('0x2c')],qs['fields'](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x18359f['attributes']=_0x18359f[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x18359f[_0x6f3b('0x30')]:_0x27f0f9['model'];_0x18359f['order']=qs['sort'](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x18359f[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x5b4ee9[_0x6f3b('0x2d')],_0x27f0f9[_0x6f3b('0x2e')]));if(_0x5b4ee9[_0x6f3b('0x2d')]['filter']){_0x18359f['where']=_[_0x6f3b('0x3a')](_0x18359f[_0x6f3b('0x36')],{'$or':_['map'](_0x18359f[_0x6f3b('0x30')],function(_0xc6cc49){var _0xda6604={};_0xda6604[_0xc6cc49]={'$like':'%'+_0x5b4ee9['query'][_0x6f3b('0x37')]+'%'};return _0xda6604;})});}_0x18359f=_[_0x6f3b('0x3a')]({},_0x18359f,_0x5b4ee9['options']);return _0x409b0e[_0x6f3b('0x4b')](_0x18359f);}})[_0x6f3b('0x24')](function(_0x158045){if(_0x158045){_0x52cfe6=_0x158045[_0x6f3b('0x32')];if(!_0x5b4ee9['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x18359f[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x1d')]);_0x18359f[_0x6f3b('0x1c')]=qs[_0x6f3b('0x1c')](_0x5b4ee9[_0x6f3b('0x2d')]['offset']);}return _0x409b0e[_0x6f3b('0x4b')](_0x18359f);}})[_0x6f3b('0x24')](function(_0x39dda0){if(_0x39dda0){return _0x39dda0?{'count':_0x52cfe6,'rows':_0x39dda0}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x38db5f,null))[_0x6f3b('0x40')](handleError(_0x38db5f,null));};exports[_0x6f3b('0x4d')]=function(_0x53471d,_0x35d0ac,_0x22f53f){var _0x4cdcdd={};var _0x33b283={};var _0x49de7a;var _0xcad5cb;return db[_0x6f3b('0x3b')][_0x6f3b('0x48')]({'where':{'id':_0x53471d['params']['id']}})[_0x6f3b('0x24')](handleEntityNotFound(_0x35d0ac,null))['then'](function(_0x54a6e5){if(_0x54a6e5){_0x49de7a=_0x54a6e5;_0x33b283['model']=_[_0x6f3b('0x42')](db[_0x6f3b('0x49')][_0x6f3b('0x2a')]);_0x33b283[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x53471d[_0x6f3b('0x2d')]);_0x33b283['filters']=_[_0x6f3b('0x2f')](_0x33b283['model'],_0x33b283[_0x6f3b('0x2d')]);_0x4cdcdd[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x33b283[_0x6f3b('0x2c')],qs[_0x6f3b('0x31')](_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x4cdcdd[_0x6f3b('0x30')]=_0x4cdcdd['attributes']['length']?_0x4cdcdd[_0x6f3b('0x30')]:_0x33b283[_0x6f3b('0x2c')];_0x4cdcdd['order']=qs[_0x6f3b('0x35')](_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x4cdcdd[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x53471d[_0x6f3b('0x2d')],_0x33b283[_0x6f3b('0x2e')]));if(_0x53471d['query'][_0x6f3b('0x37')]){_0x4cdcdd[_0x6f3b('0x36')]=_[_0x6f3b('0x3a')](_0x4cdcdd[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x4cdcdd[_0x6f3b('0x30')],function(_0x103fa0){var _0x3490bc={};_0x3490bc[_0x103fa0]={'$like':'%'+_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x37')]+'%'};return _0x3490bc;})});}_0x4cdcdd=_['merge']({},_0x4cdcdd,_0x53471d[_0x6f3b('0x43')]);return _0x49de7a['getSubjects'](_0x4cdcdd);}})[_0x6f3b('0x24')](function(_0x2b71d1){if(_0x2b71d1){_0xcad5cb=_0x2b71d1['length'];if(!_0x53471d['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x4cdcdd[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x53471d['query'][_0x6f3b('0x1d')]);_0x4cdcdd['offset']=qs[_0x6f3b('0x1c')](_0x53471d[_0x6f3b('0x2d')]['offset']);}return _0x49de7a[_0x6f3b('0x4d')](_0x4cdcdd);}})[_0x6f3b('0x24')](function(_0x3d6aa3){if(_0x3d6aa3){return _0x3d6aa3?{'count':_0xcad5cb,'rows':_0x3d6aa3}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x35d0ac,null))[_0x6f3b('0x40')](handleError(_0x35d0ac,null));};exports[_0x6f3b('0x4e')]=function(_0x257acb,_0x4f4627,_0x185ff2){var _0x3de655={};var _0x996abd={};var _0x44ca8e;var _0x5c64fa;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x257acb[_0x6f3b('0x46')]['id']}})[_0x6f3b('0x24')](handleEntityNotFound(_0x4f4627,null))[_0x6f3b('0x24')](function(_0x286480){if(_0x286480){_0x44ca8e=_0x286480;_0x996abd[_0x6f3b('0x2c')]=_[_0x6f3b('0x42')](db[_0x6f3b('0x49')][_0x6f3b('0x2a')]);_0x996abd[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x257acb[_0x6f3b('0x2d')]);_0x996abd['filters']=_[_0x6f3b('0x2f')](_0x996abd[_0x6f3b('0x2c')],_0x996abd[_0x6f3b('0x2d')]);_0x3de655[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x996abd['model'],qs[_0x6f3b('0x31')](_0x257acb['query'][_0x6f3b('0x31')]));_0x3de655[_0x6f3b('0x30')]=_0x3de655[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x3de655['attributes']:_0x996abd[_0x6f3b('0x2c')];_0x3de655['order']=qs[_0x6f3b('0x35')](_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x3de655['where']=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x257acb[_0x6f3b('0x2d')],_0x996abd[_0x6f3b('0x2e')]));if(_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x37')]){_0x3de655[_0x6f3b('0x36')]=_['merge'](_0x3de655[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x3de655[_0x6f3b('0x30')],function(_0x12121c){var _0x1f33ed={};_0x1f33ed[_0x12121c]={'$like':'%'+_0x257acb['query'][_0x6f3b('0x37')]+'%'};return _0x1f33ed;})});}_0x3de655=_[_0x6f3b('0x3a')]({},_0x3de655,_0x257acb[_0x6f3b('0x43')]);return _0x44ca8e[_0x6f3b('0x4e')](_0x3de655);}})[_0x6f3b('0x24')](function(_0x67c5a8){if(_0x67c5a8){_0x5c64fa=_0x67c5a8[_0x6f3b('0x32')];if(!_0x257acb['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x3de655['limit']=qs['limit'](_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x1d')]);_0x3de655[_0x6f3b('0x1c')]=qs[_0x6f3b('0x1c')](_0x257acb['query']['offset']);}return _0x44ca8e[_0x6f3b('0x4e')](_0x3de655);}})['then'](function(_0x2a95cf){if(_0x2a95cf){return _0x2a95cf?{'count':_0x5c64fa,'rows':_0x2a95cf}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x4f4627,null))[_0x6f3b('0x40')](handleError(_0x4f4627,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f347223..52ec5dc 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 _0x616d=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash'];(function(_0x44b792,_0x176619){var _0x2fd913=function(_0x375b16){while(--_0x375b16){_0x44b792['push'](_0x44b792['shift']());}};_0x2fd913(++_0x176619);}(_0x616d,0x81));var _0xd616=function(_0x3cccf1,_0x1ab506){_0x3cccf1=_0x3cccf1-0x0;var _0x3799be=_0x616d[_0x3cccf1];return _0x3799be;};'use strict';var _=require(_0xd616('0x0'));var util=require(_0xd616('0x1'));var logger=require('../../config/logger')(_0xd616('0x2'));var moment=require(_0xd616('0x3'));var BPromise=require(_0xd616('0x4'));var rp=require(_0xd616('0x5'));var fs=require('fs');var path=require(_0xd616('0x6'));var rimraf=require(_0xd616('0x7'));var config=require(_0xd616('0x8'));var attributes=require(_0xd616('0x9'));module[_0xd616('0xa')]=function(_0x122054,_0x3a9554){return _0x122054[_0xd616('0xb')]('ZohoConfiguration',attributes,{'tableName':_0xd616('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd25c=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x464b94,_0x3e4b53){var _0x1d53b4=function(_0x1bc83b){while(--_0x1bc83b){_0x464b94['push'](_0x464b94['shift']());}};_0x1d53b4(++_0x3e4b53);}(_0xd25c,0x12d));var _0xcd25=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xd25c[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xcd25('0x0'));var util=require(_0xcd25('0x1'));var logger=require(_0xcd25('0x2'))('api');var moment=require(_0xcd25('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd25('0x4'));var fs=require('fs');var path=require(_0xcd25('0x5'));var rimraf=require(_0xcd25('0x6'));var config=require(_0xcd25('0x7'));var attributes=require(_0xcd25('0x8'));module[_0xcd25('0x9')]=function(_0x487bdc,_0x737f04){return _0x487bdc[_0xcd25('0xa')](_0xcd25('0xb'),attributes,{'tableName':_0xcd25('0xc'),'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 f3508b6..9bdfb42 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 _0x24c6=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4c2faa,_0x1925eb){var _0x5328ff=function(_0x4241fe){while(--_0x4241fe){_0x4c2faa['push'](_0x4c2faa['shift']());}};_0x5328ff(++_0x1925eb);}(_0x24c6,0x14b));var _0x624c=function(_0x1aecf7,_0x41c2df){_0x1aecf7=_0x1aecf7-0x0;var _0x1fdc44=_0x24c6[_0x1aecf7];return _0x1fdc44;};'use strict';var _=require('lodash');var util=require(_0x624c('0x0'));var moment=require(_0x624c('0x1'));var BPromise=require(_0x624c('0x2'));var rs=require(_0x624c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x624c('0x4'))(_0x624c('0x5'));var config=require(_0x624c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x624c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2911bd,_0x3bf4fb,_0x54aa9b){return new BPromise(function(_0x1541e7,_0x324abd){return client[_0x624c('0x8')](_0x2911bd,_0x54aa9b)['then'](function(_0x1b9f70){logger[_0x624c('0x9')](_0x624c('0xa'),_0x3bf4fb,_0x624c('0xb'));logger[_0x624c('0xc')](_0x624c('0xd'),_0x3bf4fb,_0x624c('0xb'),JSON[_0x624c('0xe')](_0x1b9f70));if(_0x1b9f70[_0x624c('0xf')]){if(_0x1b9f70[_0x624c('0xf')][_0x624c('0x10')]===0x1f4){logger[_0x624c('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x3bf4fb,_0x1b9f70[_0x624c('0xf')][_0x624c('0x11')]);return _0x324abd(_0x1b9f70[_0x624c('0xf')][_0x624c('0x11')]);}logger['error'](_0x624c('0xa'),_0x3bf4fb,_0x1b9f70[_0x624c('0xf')][_0x624c('0x11')]);return _0x1541e7(_0x1b9f70[_0x624c('0xf')]['message']);}else{logger[_0x624c('0x9')](_0x624c('0xa'),_0x3bf4fb,_0x624c('0xb'));_0x1541e7(_0x1b9f70[_0x624c('0x12')][_0x624c('0x11')]);}})[_0x624c('0x13')](function(_0x58c2d1){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3bf4fb,_0x58c2d1);_0x324abd(_0x58c2d1);});});} \ No newline at end of file +var _0xce6b=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xce6b,0xf0));var _0xbce6=function(_0x291307,_0x594da6){_0x291307=_0x291307-0x0;var _0x4d5f6a=_0xce6b[_0x291307];return _0x4d5f6a;};'use strict';var _=require(_0xbce6('0x0'));var util=require('util');var moment=require(_0xbce6('0x1'));var BPromise=require(_0xbce6('0x2'));var rs=require(_0xbce6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbce6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce6('0x5'))(_0xbce6('0x6'));var config=require(_0xbce6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbce6('0x8')][_0xbce6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20ce3e,_0x1f5244,_0x5729f7){return new BPromise(function(_0x134aa4,_0x2db0d2){return client[_0xbce6('0xa')](_0x20ce3e,_0x5729f7)[_0xbce6('0xb')](function(_0x4f20e8){logger[_0xbce6('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0xbce6('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1f5244,'request\x20sent',JSON[_0xbce6('0xe')](_0x4f20e8));if(_0x4f20e8['error']){if(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x10')]===0x1f4){logger['error'](_0xbce6('0x11'),_0x1f5244,_0x4f20e8['error']['message']);return _0x2db0d2(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x12')]);}logger['error'](_0xbce6('0x11'),_0x1f5244,_0x4f20e8['error'][_0xbce6('0x12')]);return _0x134aa4(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x12')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0xbce6('0xd'));_0x134aa4(_0x4f20e8['result'][_0xbce6('0x12')]);}})[_0xbce6('0x13')](function(_0x32638b){logger[_0xbce6('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0x32638b);_0x2db0d2(_0x32638b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e7e693b..26094b5 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 _0x712b=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','show','put','/:id','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x712b,0xd4));var _0xb712=function(_0x2e2c3d,_0x86efac){_0x2e2c3d=_0x2e2c3d-0x0;var _0x2b9c92=_0x712b[_0x2e2c3d];return _0x2b9c92;};'use strict';var multer=require(_0xb712('0x0'));var util=require('util');var path=require(_0xb712('0x1'));var timeout=require(_0xb712('0x2'));var express=require(_0xb712('0x3'));var router=express[_0xb712('0x4')]();var fs_extra=require(_0xb712('0x5'));var auth=require(_0xb712('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb712('0x7'));var controller=require(_0xb712('0x8'));router['get']('/',auth[_0xb712('0x9')](),controller[_0xb712('0xa')]);router[_0xb712('0xb')]('/:id',auth[_0xb712('0x9')](),controller[_0xb712('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb712('0xd')](_0xb712('0xe'),auth[_0xb712('0x9')](),controller[_0xb712('0xf')]);router['delete'](_0xb712('0xe'),auth[_0xb712('0x9')](),controller[_0xb712('0x10')]);module[_0xb712('0x11')]=router; \ No newline at end of file +var _0x8933=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x2494dc,_0x515019){var _0x5518c5=function(_0x58ccfb){while(--_0x58ccfb){_0x2494dc['push'](_0x2494dc['shift']());}};_0x5518c5(++_0x515019);}(_0x8933,0x124));var _0x3893=function(_0x3cb422,_0x44afda){_0x3cb422=_0x3cb422-0x0;var _0x42c12e=_0x8933[_0x3cb422];return _0x42c12e;};'use strict';var multer=require(_0x3893('0x0'));var util=require(_0x3893('0x1'));var path=require('path');var timeout=require(_0x3893('0x2'));var express=require(_0x3893('0x3'));var router=express[_0x3893('0x4')]();var fs_extra=require(_0x3893('0x5'));var auth=require(_0x3893('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3893('0x7'));router[_0x3893('0x8')]('/',auth['isAuthenticated'](),controller[_0x3893('0x9')]);router[_0x3893('0x8')](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0xc')]);router[_0x3893('0xd')]('/',auth[_0x3893('0xb')](),controller['create']);router['put'](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0xe')]);router[_0x3893('0xf')](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0x10')]);module[_0x3893('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 90ba7e5..3baa9cd 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 _0xdc92=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0xf8f772,_0x26d95e){var _0x27583f=function(_0x39d1f1){while(--_0x39d1f1){_0xf8f772['push'](_0xf8f772['shift']());}};_0x27583f(++_0x26d95e);}(_0xdc92,0xda));var _0x2dc9=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xdc92[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require(_0x2dc9('0x0'));module[_0x2dc9('0x1')]={'type':{'type':Sequelize[_0x2dc9('0x2')](_0x2dc9('0x3'),_0x2dc9('0x4'),_0x2dc9('0x5'),_0x2dc9('0x6'),_0x2dc9('0x7')),'defaultValue':_0x2dc9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2dc9('0x8')]},'keyType':{'type':Sequelize[_0x2dc9('0x2')](_0x2dc9('0x3'),_0x2dc9('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2dc9('0x8')]},'idField':{'type':Sequelize[_0x2dc9('0x8')]},'nameField':{'type':Sequelize[_0x2dc9('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5ee2=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x47a34e,_0x314cca){var _0x3fb5b0=function(_0xe44837){while(--_0xe44837){_0x47a34e['push'](_0x47a34e['shift']());}};_0x3fb5b0(++_0x314cca);}(_0x5ee2,0x89));var _0x25ee=function(_0x109b18,_0x365978){_0x109b18=_0x109b18-0x0;var _0x33e9f3=_0x5ee2[_0x109b18];return _0x33e9f3;};'use strict';var Sequelize=require(_0x25ee('0x0'));module[_0x25ee('0x1')]={'type':{'type':Sequelize[_0x25ee('0x2')](_0x25ee('0x3'),_0x25ee('0x4'),_0x25ee('0x5'),_0x25ee('0x6'),_0x25ee('0x7')),'defaultValue':_0x25ee('0x3')},'content':{'type':Sequelize[_0x25ee('0x8')]},'key':{'type':Sequelize[_0x25ee('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x25ee('0x4'),_0x25ee('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x25ee('0x8')]},'customField':{'type':Sequelize[_0x25ee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25ee('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 65f4246..6f7dd61 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 _0x45ca=['intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','status','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','model','keys','query','filters','attributes'];(function(_0x374b56,_0x564b00){var _0x4d65ff=function(_0x4d4439){while(--_0x4d4439){_0x374b56['push'](_0x374b56['shift']());}};_0x4d65ff(++_0x564b00);}(_0x45ca,0xfa));var _0xa45c=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x45ca[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require(_0xa45c('0x0'));var rimraf=require(_0xa45c('0x1'));var zipdir=require(_0xa45c('0x2'));var jsonpatch=require(_0xa45c('0x3'));var rp=require(_0xa45c('0x4'));var moment=require(_0xa45c('0x5'));var BPromise=require(_0xa45c('0x6'));var Mustache=require('mustache');var util=require(_0xa45c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa45c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa45c('0x9'));var _=require(_0xa45c('0xa'));var squel=require(_0xa45c('0xb'));var crypto=require(_0xa45c('0xc'));var jsforce=require(_0xa45c('0xd'));var deskjs=require(_0xa45c('0xe'));var toCsv=require(_0xa45c('0x8'));var querystring=require(_0xa45c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa45c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa45c('0x11'));var hardwareService=require(_0xa45c('0x12'));var logger=require(_0xa45c('0x13'))(_0xa45c('0x14'));var utils=require(_0xa45c('0x15'));var config=require(_0xa45c('0x16'));var licenseUtil=require(_0xa45c('0x17'));var db=require(_0xa45c('0x18'))['db'];function respondWithStatusCode(_0x586723,_0xad029e){_0xad029e=_0xad029e||0xcc;return function(_0x43bc3a){if(_0x43bc3a){return _0x586723['sendStatus'](_0xad029e);}return _0x586723['status'](_0xad029e)[_0xa45c('0x19')]();};}function respondWithResult(_0x3efd47,_0x44aade){_0x44aade=_0x44aade||0xc8;return function(_0xe672){if(_0xe672){return _0x3efd47['status'](_0x44aade)[_0xa45c('0x1a')](_0xe672);}};}function respondWithFilteredResult(_0x2a464a,_0x520b59){return function(_0x2e3fc2){if(_0x2e3fc2){var _0x4b146a=typeof _0x520b59[_0xa45c('0x1b')]===_0xa45c('0x1c')&&typeof _0x520b59['limit']===_0xa45c('0x1c');var _0x56b0f0=_0x2e3fc2['count'];var _0x20f26a=_0x4b146a?0x0:_0x520b59[_0xa45c('0x1b')];var _0x30f613=_0x4b146a?_0x2e3fc2['count']:_0x520b59[_0xa45c('0x1b')]+_0x520b59[_0xa45c('0x1d')];var _0x2cc886;if(_0x30f613>=_0x56b0f0){_0x30f613=_0x56b0f0;_0x2cc886=0xc8;}else{_0x2cc886=0xce;}_0x2a464a[_0xa45c('0x1e')](_0x2cc886);return _0x2a464a['set'](_0xa45c('0x1f'),_0x20f26a+'-'+_0x30f613+'/'+_0x56b0f0)['json'](_0x2e3fc2);}return null;};}function patchUpdates(_0x157481){return function(_0x2145d7){try{jsonpatch['apply'](_0x2145d7,_0x157481,!![]);}catch(_0x3c8ef4){return BPromise[_0xa45c('0x20')](_0x3c8ef4);}return _0x2145d7[_0xa45c('0x21')]();};}function saveUpdates(_0x2ad87a,_0x47a6ca){return function(_0x33c7ef){if(_0x33c7ef){return _0x33c7ef['update'](_0x2ad87a)[_0xa45c('0x22')](function(_0x4b005a){return _0x4b005a;});}return null;};}function removeEntity(_0x26c463,_0x326512){return function(_0x8037f2){if(_0x8037f2){return _0x8037f2[_0xa45c('0x23')]()[_0xa45c('0x22')](function(){_0x26c463[_0xa45c('0x1e')](0xcc)[_0xa45c('0x19')]();});}};}function handleEntityNotFound(_0x442122,_0x3e00c8){return function(_0x27d575){if(!_0x27d575){_0x442122[_0xa45c('0x24')](0x194);}return _0x27d575;};}function handleError(_0x5ca0ba,_0x21bad1){_0x21bad1=_0x21bad1||0x1f4;return function(_0x41189c){logger[_0xa45c('0x25')](_0x41189c[_0xa45c('0x26')]);if(_0x41189c[_0xa45c('0x27')]){delete _0x41189c['name'];}_0x5ca0ba['status'](_0x21bad1)[_0xa45c('0x28')](_0x41189c);};}exports[_0xa45c('0x29')]=function(_0x5b6d74,_0x312b10){var _0x5e3cce={},_0x4d0f29={},_0x22be0d={'count':0x0,'rows':[]};var _0x5c3385=_['map'](db[_0xa45c('0x2a')][_0xa45c('0x2b')],function(_0x2fb838){return{'name':_0x2fb838[_0xa45c('0x2c')],'type':_0x2fb838['type']['key']};});_0x4d0f29[_0xa45c('0x2d')]=_['map'](_0x5c3385,'name');_0x4d0f29['query']=_[_0xa45c('0x2e')](_0x5b6d74[_0xa45c('0x2f')]);_0x4d0f29[_0xa45c('0x30')]=_['intersection'](_0x4d0f29[_0xa45c('0x2d')],_0x4d0f29[_0xa45c('0x2f')]);_0x5e3cce[_0xa45c('0x31')]=_[_0xa45c('0x32')](_0x4d0f29['model'],qs[_0xa45c('0x33')](_0x5b6d74['query'][_0xa45c('0x33')]));_0x5e3cce[_0xa45c('0x31')]=_0x5e3cce[_0xa45c('0x31')][_0xa45c('0x34')]?_0x5e3cce[_0xa45c('0x31')]:_0x4d0f29[_0xa45c('0x2d')];if(!_0x5b6d74[_0xa45c('0x2f')][_0xa45c('0x35')](_0xa45c('0x36'))){_0x5e3cce[_0xa45c('0x1d')]=qs['limit'](_0x5b6d74[_0xa45c('0x2f')][_0xa45c('0x1d')]);_0x5e3cce[_0xa45c('0x1b')]=qs[_0xa45c('0x1b')](_0x5b6d74[_0xa45c('0x2f')][_0xa45c('0x1b')]);}_0x5e3cce[_0xa45c('0x37')]=qs['sort'](_0x5b6d74[_0xa45c('0x2f')]['sort']);_0x5e3cce[_0xa45c('0x38')]=qs[_0xa45c('0x30')](_[_0xa45c('0x39')](_0x5b6d74[_0xa45c('0x2f')],_0x4d0f29[_0xa45c('0x30')]),_0x5c3385);if(_0x5b6d74[_0xa45c('0x2f')][_0xa45c('0x3a')]){_0x5e3cce[_0xa45c('0x38')]=_[_0xa45c('0x3b')](_0x5e3cce[_0xa45c('0x38')],{'$or':_[_0xa45c('0x3c')](_0x5c3385,function(_0x433dd4){if(_0x433dd4['type']!==_0xa45c('0x3d')){var _0x5b401d={};_0x5b401d[_0x433dd4['name']]={'$like':'%'+_0x5b6d74['query'][_0xa45c('0x3a')]+'%'};return _0x5b401d;}})});}_0x5e3cce=_[_0xa45c('0x3b')]({},_0x5e3cce,_0x5b6d74[_0xa45c('0x3e')]);var _0x3beed7={'where':_0x5e3cce[_0xa45c('0x38')]};return db['ZohoField'][_0xa45c('0x3f')](_0x3beed7)[_0xa45c('0x22')](function(_0x28efb8){_0x22be0d[_0xa45c('0x3f')]=_0x28efb8;if(_0x5b6d74['query'][_0xa45c('0x40')]){_0x5e3cce[_0xa45c('0x41')]=[{'all':!![]}];}return db[_0xa45c('0x2a')][_0xa45c('0x42')](_0x5e3cce);})['then'](function(_0x5a362b){_0x22be0d[_0xa45c('0x43')]=_0x5a362b;return _0x22be0d;})['then'](respondWithFilteredResult(_0x312b10,_0x5e3cce))[_0xa45c('0x44')](handleError(_0x312b10,null));};exports[_0xa45c('0x45')]=function(_0x34a6c8,_0x3c5487){var _0x51bee4={'raw':!![],'where':{'id':_0x34a6c8[_0xa45c('0x46')]['id']}},_0x357ebe={};_0x357ebe[_0xa45c('0x2d')]=_[_0xa45c('0x2e')](db['ZohoField']['rawAttributes']);_0x357ebe[_0xa45c('0x2f')]=_[_0xa45c('0x2e')](_0x34a6c8['query']);_0x357ebe[_0xa45c('0x30')]=_[_0xa45c('0x32')](_0x357ebe[_0xa45c('0x2d')],_0x357ebe[_0xa45c('0x2f')]);_0x51bee4['attributes']=_['intersection'](_0x357ebe[_0xa45c('0x2d')],qs[_0xa45c('0x33')](_0x34a6c8[_0xa45c('0x2f')][_0xa45c('0x33')]));_0x51bee4[_0xa45c('0x31')]=_0x51bee4[_0xa45c('0x31')][_0xa45c('0x34')]?_0x51bee4[_0xa45c('0x31')]:_0x357ebe[_0xa45c('0x2d')];if(_0x34a6c8[_0xa45c('0x2f')][_0xa45c('0x40')]){_0x51bee4['include']=[{'all':!![]}];}_0x51bee4=_[_0xa45c('0x3b')]({},_0x51bee4,_0x34a6c8[_0xa45c('0x3e')]);return db[_0xa45c('0x2a')][_0xa45c('0x47')](_0x51bee4)[_0xa45c('0x22')](handleEntityNotFound(_0x3c5487,null))[_0xa45c('0x22')](respondWithResult(_0x3c5487,null))[_0xa45c('0x44')](handleError(_0x3c5487,null));};exports[_0xa45c('0x48')]=function(_0x2bc589,_0x383760){return db[_0xa45c('0x2a')]['create'](_0x2bc589['body'],{})[_0xa45c('0x22')](respondWithResult(_0x383760,0xc9))[_0xa45c('0x44')](handleError(_0x383760,null));};exports[_0xa45c('0x49')]=function(_0x76404b,_0x22436f){if(_0x76404b[_0xa45c('0x4a')]['id']){delete _0x76404b[_0xa45c('0x4a')]['id'];}return db[_0xa45c('0x2a')][_0xa45c('0x47')]({'where':{'id':_0x76404b[_0xa45c('0x46')]['id']}})[_0xa45c('0x22')](handleEntityNotFound(_0x22436f,null))[_0xa45c('0x22')](saveUpdates(_0x76404b[_0xa45c('0x4a')],null))[_0xa45c('0x22')](respondWithResult(_0x22436f,null))[_0xa45c('0x44')](handleError(_0x22436f,null));};exports['destroy']=function(_0x2b6d2a,_0xc08d92){return db[_0xa45c('0x2a')][_0xa45c('0x47')]({'where':{'id':_0x2b6d2a[_0xa45c('0x46')]['id']}})[_0xa45c('0x22')](handleEntityNotFound(_0xc08d92,null))[_0xa45c('0x22')](removeEntity(_0xc08d92,null))['catch'](handleError(_0xc08d92,null));}; \ No newline at end of file +var _0x0a71=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x277180,_0x3a33c3){var _0x45cd8f=function(_0x1adc59){while(--_0x1adc59){_0x277180['push'](_0x277180['shift']());}};_0x45cd8f(++_0x3a33c3);}(_0x0a71,0x122));var _0x10a7=function(_0xeb2ea,_0x429b45){_0xeb2ea=_0xeb2ea-0x0;var _0x347a31=_0x0a71[_0xeb2ea];return _0x347a31;};'use strict';var emlformat=require(_0x10a7('0x0'));var rimraf=require(_0x10a7('0x1'));var zipdir=require(_0x10a7('0x2'));var jsonpatch=require(_0x10a7('0x3'));var rp=require(_0x10a7('0x4'));var moment=require('moment');var BPromise=require(_0x10a7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x10a7('0x6'));var csv=require(_0x10a7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10a7('0x8'));var _=require(_0x10a7('0x9'));var squel=require(_0x10a7('0xa'));var crypto=require(_0x10a7('0xb'));var jsforce=require(_0x10a7('0xc'));var deskjs=require(_0x10a7('0xd'));var toCsv=require(_0x10a7('0x7'));var querystring=require(_0x10a7('0xe'));var Papa=require(_0x10a7('0xf'));var Redis=require(_0x10a7('0x10'));var authService=require(_0x10a7('0x11'));var qs=require(_0x10a7('0x12'));var as=require(_0x10a7('0x13'));var hardwareService=require(_0x10a7('0x14'));var logger=require(_0x10a7('0x15'))(_0x10a7('0x16'));var utils=require(_0x10a7('0x17'));var config=require(_0x10a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x10a7('0x19'))['db'];function respondWithStatusCode(_0x1979a1,_0x19d2b2){_0x19d2b2=_0x19d2b2||0xcc;return function(_0x245063){if(_0x245063){return _0x1979a1[_0x10a7('0x1a')](_0x19d2b2);}return _0x1979a1[_0x10a7('0x1b')](_0x19d2b2)[_0x10a7('0x1c')]();};}function respondWithResult(_0x59248e,_0x3ac4c0){_0x3ac4c0=_0x3ac4c0||0xc8;return function(_0x362ccb){if(_0x362ccb){return _0x59248e[_0x10a7('0x1b')](_0x3ac4c0)['json'](_0x362ccb);}};}function respondWithFilteredResult(_0x33fa73,_0x3962b3){return function(_0x3ad443){if(_0x3ad443){var _0x2a799a=typeof _0x3962b3[_0x10a7('0x1d')]==='undefined'&&typeof _0x3962b3[_0x10a7('0x1e')]===_0x10a7('0x1f');var _0x1d5da0=_0x3ad443[_0x10a7('0x20')];var _0x25f0ce=_0x2a799a?0x0:_0x3962b3['offset'];var _0x3ee726=_0x2a799a?_0x3ad443[_0x10a7('0x20')]:_0x3962b3[_0x10a7('0x1d')]+_0x3962b3[_0x10a7('0x1e')];var _0x251e27;if(_0x3ee726>=_0x1d5da0){_0x3ee726=_0x1d5da0;_0x251e27=0xc8;}else{_0x251e27=0xce;}_0x33fa73['status'](_0x251e27);return _0x33fa73['set'](_0x10a7('0x21'),_0x25f0ce+'-'+_0x3ee726+'/'+_0x1d5da0)[_0x10a7('0x22')](_0x3ad443);}return null;};}function patchUpdates(_0x2e269f){return function(_0x35c050){try{jsonpatch['apply'](_0x35c050,_0x2e269f,!![]);}catch(_0x1e9cd3){return BPromise[_0x10a7('0x23')](_0x1e9cd3);}return _0x35c050[_0x10a7('0x24')]();};}function saveUpdates(_0x3dac5d,_0xb118b7){return function(_0x204a27){if(_0x204a27){return _0x204a27[_0x10a7('0x25')](_0x3dac5d)['then'](function(_0x2b6c60){return _0x2b6c60;});}return null;};}function removeEntity(_0x1fc851,_0x37a9f4){return function(_0xac8099){if(_0xac8099){return _0xac8099[_0x10a7('0x26')]()[_0x10a7('0x27')](function(){_0x1fc851['status'](0xcc)[_0x10a7('0x1c')]();});}};}function handleEntityNotFound(_0x274f6f,_0x81bbcf){return function(_0x537a5d){if(!_0x537a5d){_0x274f6f['sendStatus'](0x194);}return _0x537a5d;};}function handleError(_0x15b454,_0x5d6c1d){_0x5d6c1d=_0x5d6c1d||0x1f4;return function(_0x4f33dc){logger[_0x10a7('0x28')](_0x4f33dc[_0x10a7('0x29')]);if(_0x4f33dc[_0x10a7('0x2a')]){delete _0x4f33dc['name'];}_0x15b454['status'](_0x5d6c1d)[_0x10a7('0x2b')](_0x4f33dc);};}exports['index']=function(_0x30176e,_0x4bce06){var _0x578d80={},_0x4efeb7={},_0x67200c={'count':0x0,'rows':[]};var _0x4b372b=_[_0x10a7('0x2c')](db[_0x10a7('0x2d')][_0x10a7('0x2e')],function(_0x9fc2e1){return{'name':_0x9fc2e1[_0x10a7('0x2f')],'type':_0x9fc2e1[_0x10a7('0x30')]['key']};});_0x4efeb7[_0x10a7('0x31')]=_[_0x10a7('0x2c')](_0x4b372b,_0x10a7('0x2a'));_0x4efeb7[_0x10a7('0x32')]=_['keys'](_0x30176e['query']);_0x4efeb7[_0x10a7('0x33')]=_[_0x10a7('0x34')](_0x4efeb7[_0x10a7('0x31')],_0x4efeb7['query']);_0x578d80['attributes']=_['intersection'](_0x4efeb7['model'],qs[_0x10a7('0x35')](_0x30176e['query']['fields']));_0x578d80[_0x10a7('0x36')]=_0x578d80[_0x10a7('0x36')][_0x10a7('0x37')]?_0x578d80[_0x10a7('0x36')]:_0x4efeb7[_0x10a7('0x31')];if(!_0x30176e['query']['hasOwnProperty'](_0x10a7('0x38'))){_0x578d80['limit']=qs[_0x10a7('0x1e')](_0x30176e[_0x10a7('0x32')][_0x10a7('0x1e')]);_0x578d80[_0x10a7('0x1d')]=qs[_0x10a7('0x1d')](_0x30176e[_0x10a7('0x32')][_0x10a7('0x1d')]);}_0x578d80[_0x10a7('0x39')]=qs['sort'](_0x30176e['query']['sort']);_0x578d80[_0x10a7('0x3a')]=qs[_0x10a7('0x33')](_[_0x10a7('0x3b')](_0x30176e[_0x10a7('0x32')],_0x4efeb7[_0x10a7('0x33')]),_0x4b372b);if(_0x30176e['query']['filter']){_0x578d80[_0x10a7('0x3a')]=_[_0x10a7('0x3c')](_0x578d80['where'],{'$or':_[_0x10a7('0x2c')](_0x4b372b,function(_0x39b712){if(_0x39b712[_0x10a7('0x30')]!=='VIRTUAL'){var _0x5105e1={};_0x5105e1[_0x39b712[_0x10a7('0x2a')]]={'$like':'%'+_0x30176e['query'][_0x10a7('0x3d')]+'%'};return _0x5105e1;}})});}_0x578d80=_[_0x10a7('0x3c')]({},_0x578d80,_0x30176e[_0x10a7('0x3e')]);var _0x18f6bc={'where':_0x578d80[_0x10a7('0x3a')]};return db[_0x10a7('0x2d')][_0x10a7('0x20')](_0x18f6bc)[_0x10a7('0x27')](function(_0x3c2e56){_0x67200c[_0x10a7('0x20')]=_0x3c2e56;if(_0x30176e[_0x10a7('0x32')][_0x10a7('0x3f')]){_0x578d80[_0x10a7('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0x10a7('0x41')](_0x578d80);})[_0x10a7('0x27')](function(_0x2e6f54){_0x67200c[_0x10a7('0x42')]=_0x2e6f54;return _0x67200c;})[_0x10a7('0x27')](respondWithFilteredResult(_0x4bce06,_0x578d80))[_0x10a7('0x43')](handleError(_0x4bce06,null));};exports[_0x10a7('0x44')]=function(_0x41bc17,_0x109ebb){var _0x45d548={'raw':!![],'where':{'id':_0x41bc17[_0x10a7('0x45')]['id']}},_0x41c24d={};_0x41c24d[_0x10a7('0x31')]=_[_0x10a7('0x46')](db[_0x10a7('0x2d')][_0x10a7('0x2e')]);_0x41c24d['query']=_[_0x10a7('0x46')](_0x41bc17[_0x10a7('0x32')]);_0x41c24d[_0x10a7('0x33')]=_['intersection'](_0x41c24d[_0x10a7('0x31')],_0x41c24d['query']);_0x45d548['attributes']=_[_0x10a7('0x34')](_0x41c24d[_0x10a7('0x31')],qs['fields'](_0x41bc17[_0x10a7('0x32')]['fields']));_0x45d548[_0x10a7('0x36')]=_0x45d548[_0x10a7('0x36')][_0x10a7('0x37')]?_0x45d548['attributes']:_0x41c24d[_0x10a7('0x31')];if(_0x41bc17['query']['includeAll']){_0x45d548[_0x10a7('0x40')]=[{'all':!![]}];}_0x45d548=_[_0x10a7('0x3c')]({},_0x45d548,_0x41bc17[_0x10a7('0x3e')]);return db[_0x10a7('0x2d')][_0x10a7('0x47')](_0x45d548)[_0x10a7('0x27')](handleEntityNotFound(_0x109ebb,null))[_0x10a7('0x27')](respondWithResult(_0x109ebb,null))['catch'](handleError(_0x109ebb,null));};exports[_0x10a7('0x48')]=function(_0x14cc57,_0x111107){return db[_0x10a7('0x2d')]['create'](_0x14cc57[_0x10a7('0x49')],{})[_0x10a7('0x27')](respondWithResult(_0x111107,0xc9))[_0x10a7('0x43')](handleError(_0x111107,null));};exports[_0x10a7('0x25')]=function(_0x52a455,_0x347cc9){if(_0x52a455[_0x10a7('0x49')]['id']){delete _0x52a455[_0x10a7('0x49')]['id'];}return db[_0x10a7('0x2d')][_0x10a7('0x47')]({'where':{'id':_0x52a455[_0x10a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x347cc9,null))['then'](saveUpdates(_0x52a455['body'],null))[_0x10a7('0x27')](respondWithResult(_0x347cc9,null))[_0x10a7('0x43')](handleError(_0x347cc9,null));};exports['destroy']=function(_0x28f9fb,_0x56b872){return db[_0x10a7('0x2d')][_0x10a7('0x47')]({'where':{'id':_0x28f9fb[_0x10a7('0x45')]['id']}})[_0x10a7('0x27')](handleEntityNotFound(_0x56b872,null))[_0x10a7('0x27')](removeEntity(_0x56b872,null))['catch'](handleError(_0x56b872,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 768a5a1..ba37697 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 _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x343e07,_0x32ff6b){var _0x28c0a7=function(_0x5db7eb){while(--_0x5db7eb){_0x343e07['push'](_0x343e07['shift']());}};_0x28c0a7(++_0x32ff6b);}(_0x57ca,0x108));var _0xa57c=function(_0x2aee5d,_0x487ce9){_0x2aee5d=_0x2aee5d-0x0;var _0x4fe74b=_0x57ca[_0x2aee5d];return _0x4fe74b;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['exports','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x44c381,_0x1189ce){var _0x209d80=function(_0x6239e4){while(--_0x6239e4){_0x44c381['push'](_0x44c381['shift']());}};_0x209d80(++_0x1189ce);}(_0x8952,0x17e));var _0x2895=function(_0x3d2e6a,_0x2fbbed){_0x3d2e6a=_0x3d2e6a-0x0;var _0x51df7b=_0x8952[_0x3d2e6a];return _0x51df7b;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZohoField.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZohoField',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb'),_0x2895('0xc')],'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 b95b8cc..57dd82e 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 _0x8c20=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x430216,_0xea1437){var _0x1cb983=function(_0x27dad0){while(--_0x27dad0){_0x430216['push'](_0x430216['shift']());}};_0x1cb983(++_0xea1437);}(_0x8c20,0x1b1));var _0x08c2=function(_0x1005d4,_0x5199ab){_0x1005d4=_0x1005d4-0x0;var _0x421977=_0x8c20[_0x1005d4];return _0x421977;};'use strict';var _=require(_0x08c2('0x0'));var util=require(_0x08c2('0x1'));var moment=require(_0x08c2('0x2'));var BPromise=require(_0x08c2('0x3'));var rs=require(_0x08c2('0x4'));var fs=require('fs');var Redis=require(_0x08c2('0x5'));var db=require(_0x08c2('0x6'))['db'];var utils=require(_0x08c2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x08c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x08c2('0x9')][_0x08c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ddbe,_0x4fe84c,_0x40ffb8){return new BPromise(function(_0x5c365e,_0x4ff7b8){return client[_0x08c2('0xb')](_0x57ddbe,_0x40ffb8)[_0x08c2('0xc')](function(_0x335262){logger[_0x08c2('0xd')](_0x08c2('0xe'),_0x4fe84c,_0x08c2('0xf'));logger['debug'](_0x08c2('0x10'),_0x4fe84c,'request\x20sent',JSON[_0x08c2('0x11')](_0x335262));if(_0x335262[_0x08c2('0x12')]){if(_0x335262[_0x08c2('0x12')][_0x08c2('0x13')]===0x1f4){logger[_0x08c2('0x12')](_0x08c2('0xe'),_0x4fe84c,_0x335262[_0x08c2('0x12')]['message']);return _0x4ff7b8(_0x335262[_0x08c2('0x12')][_0x08c2('0x14')]);}logger[_0x08c2('0x12')]('ZohoField,\x20%s,\x20%s',_0x4fe84c,_0x335262['error']['message']);return _0x5c365e(_0x335262[_0x08c2('0x12')][_0x08c2('0x14')]);}else{logger[_0x08c2('0xd')](_0x08c2('0xe'),_0x4fe84c,_0x08c2('0xf'));_0x5c365e(_0x335262[_0x08c2('0x15')][_0x08c2('0x14')]);}})[_0x08c2('0x16')](function(_0x330558){logger[_0x08c2('0x12')](_0x08c2('0xe'),_0x4fe84c,_0x330558);_0x4ff7b8(_0x330558);});});} \ No newline at end of file +var _0xdcbc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5723fe,_0xb98831){var _0x41a589=function(_0x1ad7be){while(--_0x1ad7be){_0x5723fe['push'](_0x5723fe['shift']());}};_0x41a589(++_0xb98831);}(_0xdcbc,0x97));var _0xcdcb=function(_0x2c1851,_0x22b210){_0x2c1851=_0x2c1851-0x0;var _0x570e5a=_0xdcbc[_0x2c1851];return _0x570e5a;};'use strict';var _=require(_0xcdcb('0x0'));var util=require(_0xcdcb('0x1'));var moment=require(_0xcdcb('0x2'));var BPromise=require(_0xcdcb('0x3'));var rs=require(_0xcdcb('0x4'));var fs=require('fs');var Redis=require(_0xcdcb('0x5'));var db=require(_0xcdcb('0x6'))['db'];var utils=require(_0xcdcb('0x7'));var logger=require(_0xcdcb('0x8'))(_0xcdcb('0x9'));var config=require(_0xcdcb('0xa'));var jayson=require(_0xcdcb('0xb'));var client=jayson[_0xcdcb('0xc')][_0xcdcb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2fea2,_0x96970f,_0x126113){return new BPromise(function(_0x41384c,_0x2e4aaf){return client[_0xcdcb('0xe')](_0x2fea2,_0x126113)['then'](function(_0x365c0a){logger['info'](_0xcdcb('0xf'),_0x96970f,'request\x20sent');logger[_0xcdcb('0x10')](_0xcdcb('0x11'),_0x96970f,_0xcdcb('0x12'),JSON[_0xcdcb('0x13')](_0x365c0a));if(_0x365c0a[_0xcdcb('0x14')]){if(_0x365c0a['error'][_0xcdcb('0x15')]===0x1f4){logger[_0xcdcb('0x14')]('ZohoField,\x20%s,\x20%s',_0x96970f,_0x365c0a['error'][_0xcdcb('0x16')]);return _0x2e4aaf(_0x365c0a['error'][_0xcdcb('0x16')]);}logger[_0xcdcb('0x14')](_0xcdcb('0xf'),_0x96970f,_0x365c0a[_0xcdcb('0x14')][_0xcdcb('0x16')]);return _0x41384c(_0x365c0a[_0xcdcb('0x14')][_0xcdcb('0x16')]);}else{logger[_0xcdcb('0x17')](_0xcdcb('0xf'),_0x96970f,_0xcdcb('0x12'));_0x41384c(_0x365c0a[_0xcdcb('0x18')]['message']);}})[_0xcdcb('0x19')](function(_0xc59ffb){logger[_0xcdcb('0x14')](_0xcdcb('0xf'),_0x96970f,_0xc59ffb);_0x2e4aaf(_0xc59ffb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index da45702..529a24b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x567751,_0x4287c3){var _0x21a84c=function(_0x2471d4){while(--_0x2471d4){_0x567751['push'](_0x567751['shift']());}};_0x21a84c(++_0x4287c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x311825,_0x40d25f){var _0x178115=function(_0x42b995){while(--_0x42b995){_0x311825['push'](_0x311825['shift']());}};_0x178115(++_0x40d25f);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 0a4a2d1..d11cbf5 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 _0xc719=['STRING','unique_name_and_version','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0xc719,0x1d2));var _0x9c71=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xc719[_0x57fa7e];return _0x320671;};'use strict';var Sequelize=require(_0x9c71('0x0'));module[_0x9c71('0x1')]={'name':{'type':Sequelize[_0x9c71('0x2')],'allowNull':![],'unique':_0x9c71('0x3')},'version':{'type':Sequelize[_0x9c71('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x9c71('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x9c71('0x2')]},'path':{'type':Sequelize[_0x9c71('0x2')]},'type':{'type':Sequelize[_0x9c71('0x2')]},'size':{'type':Sequelize[_0x9c71('0x4')]},'active':{'type':Sequelize[_0x9c71('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x9c71('0x2')]},'logo':{'type':Sequelize[_0x9c71('0x2')]},'state':{'type':Sequelize[_0x9c71('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x9c71('0x2')]},'title':{'type':Sequelize[_0x9c71('0x2')]},'remoteUri':{'type':Sequelize[_0x9c71('0x2')]},'link':{'type':Sequelize[_0x9c71('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x2c94=['unique_name_and_version','INTEGER','state','sequelize','STRING'];(function(_0x5334e2,_0x411d9a){var _0x277c98=function(_0x507ee2){while(--_0x507ee2){_0x5334e2['push'](_0x5334e2['shift']());}};_0x277c98(++_0x411d9a);}(_0x2c94,0xa3));var _0x42c9=function(_0x533fdb,_0x340586){_0x533fdb=_0x533fdb-0x0;var _0x393de1=_0x2c94[_0x533fdb];return _0x393de1;};'use strict';var Sequelize=require(_0x42c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x42c9('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x42c9('0x1')],'allowNull':![],'unique':_0x42c9('0x2')},'main':{'type':Sequelize[_0x42c9('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x42c9('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x42c9('0x1')]},'size':{'type':Sequelize[_0x42c9('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x42c9('0x1')]},'logo':{'type':Sequelize[_0x42c9('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x42c9('0x4')},'description':{'type':Sequelize[_0x42c9('0x1')]},'title':{'type':Sequelize[_0x42c9('0x1')]},'remoteUri':{'type':Sequelize[_0x42c9('0x1')]},'link':{'type':Sequelize[_0x42c9('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 b6defa4..f709dff 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 _0x7880=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit'];(function(_0x431a24,_0xdb94f4){var _0x24ae58=function(_0x4934cc){while(--_0x4934cc){_0x431a24['push'](_0x431a24['shift']());}};_0x24ae58(++_0xdb94f4);}(_0x7880,0x1f4));var _0x0788=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x7880[_0xcc26d2];return _0x3841e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['Integration'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));}; \ No newline at end of file +var _0xb016=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Integration','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body'];(function(_0x1784b5,_0xafadc3){var _0x443c98=function(_0x43cf2b){while(--_0x43cf2b){_0x1784b5['push'](_0x1784b5['shift']());}};_0x443c98(++_0xafadc3);}(_0xb016,0x159));var _0x6b01=function(_0x2c2dc4,_0x3a9559){_0x2c2dc4=_0x2c2dc4-0x0;var _0x476244=_0xb016[_0x2c2dc4];return _0x476244;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['Integration'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c298f3b..5f5ab0d 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 _0x3c17=['path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x12b756,_0x43f6f3){var _0x40cc2e=function(_0x4cbae3){while(--_0x4cbae3){_0x12b756['push'](_0x12b756['shift']());}};_0x40cc2e(++_0x43f6f3);}(_0x3c17,0x1cf));var _0x73c1=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x3c17[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var logger=require(_0x73c1('0x1'))('api');var moment=require(_0x73c1('0x2'));var BPromise=require(_0x73c1('0x3'));var rp=require(_0x73c1('0x4'));var fs=require('fs');var path=require(_0x73c1('0x5'));var rimraf=require(_0x73c1('0x6'));var config=require(_0x73c1('0x7'));var attributes=require(_0x73c1('0x8'));module[_0x73c1('0x9')]=function(_0x2a90f1,_0x28d520){return _0x2a90f1['define'](_0x73c1('0xa'),attributes,{'tableName':_0x73c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5317=['exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x4eaff9,_0x391464){var _0x156fce=function(_0x55be1d){while(--_0x55be1d){_0x4eaff9['push'](_0x4eaff9['shift']());}};_0x156fce(++_0x391464);}(_0x5317,0x1c4));var _0x7531=function(_0xf502aa,_0x4ba0da){_0xf502aa=_0xf502aa-0x0;var _0x2a3ab4=_0x5317[_0xf502aa];return _0x2a3ab4;};'use strict';var _=require(_0x7531('0x0'));var util=require(_0x7531('0x1'));var logger=require(_0x7531('0x2'))(_0x7531('0x3'));var moment=require(_0x7531('0x4'));var BPromise=require(_0x7531('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7531('0x6'));var rimraf=require(_0x7531('0x7'));var config=require(_0x7531('0x8'));var attributes=require(_0x7531('0x9'));module[_0x7531('0xa')]=function(_0x1a8e5e,_0x383c83){return _0x1a8e5e[_0x7531('0xb')](_0x7531('0xc'),attributes,{'tableName':_0x7531('0xd'),'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 1cc062f..7776e41 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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x1ffc32,_0x2f4724){var _0x6dd4a2=function(_0x3c92cb){while(--_0x3c92cb){_0x1ffc32['push'](_0x1ffc32['shift']());}};_0x6dd4a2(++_0x2f4724);}(_0xba34,0x119));var _0x4ba3=function(_0x6dbc3e,_0x352946){_0x6dbc3e=_0x6dbc3e-0x0;var _0x6baa0a=_0xba34[_0x6dbc3e];return _0x6baa0a;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file +var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x484e94,_0x503356){var _0x18c80c=function(_0x1481de){while(--_0x1481de){_0x484e94['push'](_0x484e94['shift']());}};_0x18c80c(++_0x503356);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 902166b..71d0003 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x48eb11,_0x2a697c){var _0x2b1a9c=function(_0x10da82){while(--_0x10da82){_0x48eb11['push'](_0x48eb11['shift']());}};_0x2b1a9c(++_0x2a697c);}(_0x1a85,0x178));var _0x51a8=function(_0x1cf1c7,_0x1e0f72){_0x1cf1c7=_0x1cf1c7-0x0;var _0x362b0a=_0x1a85[_0x1cf1c7];return _0x362b0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x476c6c,_0x434db8){var _0xbb94db=function(_0x4be12){while(--_0x4be12){_0x476c6c['push'](_0x476c6c['shift']());}};_0xbb94db(++_0x434db8);}(_0xadb5,0xad));var _0x5adb=function(_0x1f1b12,_0x3e5337){_0x1f1b12=_0x1f1b12-0x0;var _0x574c7b=_0xadb5[_0x1f1b12];return _0x574c7b;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c23aec7..3e043ab 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 _0x4b9b=['ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','TEXT'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x4b9b,0xe0));var _0xb4b9=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x4b9b[_0xf0ec6e];return _0x8bbc27;};'use strict';var Sequelize=require(_0xb4b9('0x0'));module[_0xb4b9('0x1')]={'integration':{'type':Sequelize[_0xb4b9('0x2')]},'eventChannel':{'type':Sequelize[_0xb4b9('0x2')]},'exitStatus':{'type':Sequelize[_0xb4b9('0x2')]},'ticketId':{'type':Sequelize[_0xb4b9('0x2')]},'integrationId':{'type':Sequelize[_0xb4b9('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb4b9('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb4b9('0x2')]},'interface':{'type':Sequelize[_0xb4b9('0x2')]},'membername':{'type':Sequelize[_0xb4b9('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb4b9('0x4')]},'agentconnectAt':{'type':Sequelize[_0xb4b9('0x4')]},'holdtime':{'type':Sequelize[_0xb4b9('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb4b9('0x4')]},'talktime':{'type':Sequelize[_0xb4b9('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb4b9('0x3')]},'reason':{'type':Sequelize[_0xb4b9('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb4b9('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb4b9('0x4')]},'lastevent':{'type':Sequelize[_0xb4b9('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb4b9('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb4b9('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb4b9('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb4b9('0x2')]},'exten':{'type':Sequelize[_0xb4b9('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb4b9('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xb4b9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb4b9('0x2')]},'destcalleridname':{'type':Sequelize[_0xb4b9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb4b9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb4b9('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb4b9('0x2')]},'destcontext':{'type':Sequelize[_0xb4b9('0x2')]},'destexten':{'type':Sequelize[_0xb4b9('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xb4b9('0x2')]},'inReplyTo':{'type':Sequelize[_0xb4b9('0x2')]},'subject':{'type':Sequelize[_0xb4b9('0x2')]},'from':{'type':Sequelize[_0xb4b9('0x2')]},'to':{'type':Sequelize[_0xb4b9('0x2')]},'cc':{'type':Sequelize[_0xb4b9('0x2')]},'attachment':{'type':Sequelize[_0xb4b9('0x5')]},'html':{'type':Sequelize[_0xb4b9('0x5')]},'text':{'type':Sequelize[_0xb4b9('0x5')]},'status':{'type':Sequelize[_0xb4b9('0x6')](_0xb4b9('0x7'),'SENDING',_0xb4b9('0x8'),_0xb4b9('0x9'))},'url':{'type':Sequelize[_0xb4b9('0x2')]},'app':{'type':Sequelize[_0xb4b9('0x2')]},'appdata':{'type':Sequelize[_0xb4b9('0x2')]},'projectId':{'type':Sequelize[_0xb4b9('0x3')]}}; \ No newline at end of file +var _0x50ef=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING'];(function(_0x3d8dab,_0x33c953){var _0x2ae93a=function(_0x23af88){while(--_0x23af88){_0x3d8dab['push'](_0x3d8dab['shift']());}};_0x2ae93a(++_0x33c953);}(_0x50ef,0x173));var _0xf50e=function(_0xe2b986,_0x3c52bc){_0xe2b986=_0xe2b986-0x0;var _0x32cd20=_0x50ef[_0xe2b986];return _0x32cd20;};'use strict';var Sequelize=require(_0xf50e('0x0'));module[_0xf50e('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf50e('0x2')]},'exitStatus':{'type':Sequelize[_0xf50e('0x2')]},'ticketId':{'type':Sequelize[_0xf50e('0x2')]},'integrationId':{'type':Sequelize[_0xf50e('0x3')]},'contacts':{'type':Sequelize[_0xf50e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf50e('0x2')]},'calleridname':{'type':Sequelize[_0xf50e('0x2')]},'queue':{'type':Sequelize[_0xf50e('0x2')]},'interface':{'type':Sequelize[_0xf50e('0x2')]},'membername':{'type':Sequelize[_0xf50e('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf50e('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf50e('0x4')]},'holdtime':{'type':Sequelize[_0xf50e('0x3')]},'agentcomplete':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf50e('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf50e('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf50e('0x4')]},'agentdump':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf50e('0x2')]},'channelstate':{'type':Sequelize[_0xf50e('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf50e('0x2')]},'language':{'type':Sequelize[_0xf50e('0x2')]},'accountcode':{'type':Sequelize[_0xf50e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf50e('0x2')]},'priority':{'type':Sequelize[_0xf50e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf50e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf50e('0x2')]},'destcalleridname':{'type':Sequelize[_0xf50e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf50e('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xf50e('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf50e('0x2')]},'destpriority':{'type':Sequelize[_0xf50e('0x2')]},'destuniqueid':{'type':Sequelize[_0xf50e('0x2')]},'messageId':{'type':Sequelize[_0xf50e('0x2')]},'inReplyTo':{'type':Sequelize[_0xf50e('0x2')]},'subject':{'type':Sequelize[_0xf50e('0x2')]},'from':{'type':Sequelize[_0xf50e('0x2')]},'to':{'type':Sequelize[_0xf50e('0x2')]},'cc':{'type':Sequelize[_0xf50e('0x2')]},'attachment':{'type':Sequelize[_0xf50e('0x6')]},'html':{'type':Sequelize[_0xf50e('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xf50e('0x7')](_0xf50e('0x8'),_0xf50e('0x9'),_0xf50e('0xa'),'FAILED')},'url':{'type':Sequelize[_0xf50e('0x2')]},'app':{'type':Sequelize[_0xf50e('0x2')]},'appdata':{'type':Sequelize[_0xf50e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ca565ba..84317f5 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 _0x3daf=['request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','catch','intersection','includeAll','options','find','create','body','params','eml-format','zip-dir','fast-json-patch'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0x3daf,0x89));var _0xf3da=function(_0x34f84f,_0x33d76d){_0x34f84f=_0x34f84f-0x0;var _0x473acd=_0x3daf[_0x34f84f];return _0x473acd;};'use strict';var emlformat=require(_0xf3da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3da('0x1'));var jsonpatch=require(_0xf3da('0x2'));var rp=require(_0xf3da('0x3'));var moment=require(_0xf3da('0x4'));var BPromise=require(_0xf3da('0x5'));var Mustache=require(_0xf3da('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf3da('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3da('0x8'));var _=require(_0xf3da('0x9'));var squel=require(_0xf3da('0xa'));var crypto=require('crypto');var jsforce=require(_0xf3da('0xb'));var deskjs=require(_0xf3da('0xc'));var toCsv=require(_0xf3da('0xd'));var querystring=require(_0xf3da('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3da('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf3da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3da('0x11'))('api');var utils=require(_0xf3da('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf3da('0x13'))['db'];function respondWithStatusCode(_0x26585b,_0x6bcf55){_0x6bcf55=_0x6bcf55||0xcc;return function(_0x3e361d){if(_0x3e361d){return _0x26585b['sendStatus'](_0x6bcf55);}return _0x26585b['status'](_0x6bcf55)[_0xf3da('0x14')]();};}function respondWithResult(_0x4ef44a,_0x11335b){_0x11335b=_0x11335b||0xc8;return function(_0xe373f3){if(_0xe373f3){return _0x4ef44a[_0xf3da('0x15')](_0x11335b)[_0xf3da('0x16')](_0xe373f3);}};}function respondWithFilteredResult(_0x4e7ff4,_0x4291c6){return function(_0x426e73){if(_0x426e73){var _0x2d43a0=typeof _0x4291c6[_0xf3da('0x17')]===_0xf3da('0x18')&&typeof _0x4291c6['limit']===_0xf3da('0x18');var _0x2c50ce=_0x426e73['count'];var _0xf63e57=_0x2d43a0?0x0:_0x4291c6[_0xf3da('0x17')];var _0x28772b=_0x2d43a0?_0x426e73[_0xf3da('0x19')]:_0x4291c6[_0xf3da('0x17')]+_0x4291c6[_0xf3da('0x1a')];var _0x42b907;if(_0x28772b>=_0x2c50ce){_0x28772b=_0x2c50ce;_0x42b907=0xc8;}else{_0x42b907=0xce;}_0x4e7ff4['status'](_0x42b907);return _0x4e7ff4[_0xf3da('0x1b')](_0xf3da('0x1c'),_0xf63e57+'-'+_0x28772b+'/'+_0x2c50ce)[_0xf3da('0x16')](_0x426e73);}return null;};}function patchUpdates(_0x1e7a14){return function(_0x2365d7){try{jsonpatch['apply'](_0x2365d7,_0x1e7a14,!![]);}catch(_0x51b5fc){return BPromise[_0xf3da('0x1d')](_0x51b5fc);}return _0x2365d7[_0xf3da('0x1e')]();};}function saveUpdates(_0x479609,_0xb0d802){return function(_0x38662e){if(_0x38662e){return _0x38662e[_0xf3da('0x1f')](_0x479609)[_0xf3da('0x20')](function(_0x2f2470){return _0x2f2470;});}return null;};}function removeEntity(_0x27c237,_0x22779d){return function(_0x2c215d){if(_0x2c215d){return _0x2c215d['destroy']()['then'](function(){_0x27c237['status'](0xcc)[_0xf3da('0x14')]();});}};}function handleEntityNotFound(_0x53bae0,_0x67cd20){return function(_0x55b8a9){if(!_0x55b8a9){_0x53bae0['sendStatus'](0x194);}return _0x55b8a9;};}function handleError(_0x3d3c57,_0x102ecf){_0x102ecf=_0x102ecf||0x1f4;return function(_0x1a6383){logger[_0xf3da('0x21')](_0x1a6383[_0xf3da('0x22')]);if(_0x1a6383[_0xf3da('0x23')]){delete _0x1a6383['name'];}_0x3d3c57[_0xf3da('0x15')](_0x102ecf)[_0xf3da('0x24')](_0x1a6383);};}exports[_0xf3da('0x25')]=function(_0x4bc4a6,_0x59f829){var _0x20b8ee={},_0x25871e={},_0xc3cd77={'count':0x0,'rows':[]};var _0x5ede07=_['map'](db[_0xf3da('0x26')][_0xf3da('0x27')],function(_0x54a48e){return{'name':_0x54a48e[_0xf3da('0x28')],'type':_0x54a48e['type'][_0xf3da('0x29')]};});_0x25871e[_0xf3da('0x2a')]=_['map'](_0x5ede07,_0xf3da('0x23'));_0x25871e[_0xf3da('0x2b')]=_[_0xf3da('0x2c')](_0x4bc4a6['query']);_0x25871e[_0xf3da('0x2d')]=_['intersection'](_0x25871e['model'],_0x25871e[_0xf3da('0x2b')]);_0x20b8ee[_0xf3da('0x2e')]=_['intersection'](_0x25871e[_0xf3da('0x2a')],qs[_0xf3da('0x2f')](_0x4bc4a6[_0xf3da('0x2b')][_0xf3da('0x2f')]));_0x20b8ee[_0xf3da('0x2e')]=_0x20b8ee['attributes'][_0xf3da('0x30')]?_0x20b8ee[_0xf3da('0x2e')]:_0x25871e[_0xf3da('0x2a')];if(!_0x4bc4a6[_0xf3da('0x2b')][_0xf3da('0x31')](_0xf3da('0x32'))){_0x20b8ee[_0xf3da('0x1a')]=qs[_0xf3da('0x1a')](_0x4bc4a6['query'][_0xf3da('0x1a')]);_0x20b8ee[_0xf3da('0x17')]=qs[_0xf3da('0x17')](_0x4bc4a6['query'][_0xf3da('0x17')]);}_0x20b8ee[_0xf3da('0x33')]=qs[_0xf3da('0x34')](_0x4bc4a6[_0xf3da('0x2b')]['sort']);_0x20b8ee[_0xf3da('0x35')]=qs[_0xf3da('0x2d')](_[_0xf3da('0x36')](_0x4bc4a6['query'],_0x25871e[_0xf3da('0x2d')]),_0x5ede07);if(_0x4bc4a6['query'][_0xf3da('0x37')]){_0x20b8ee[_0xf3da('0x35')]=_[_0xf3da('0x38')](_0x20b8ee[_0xf3da('0x35')],{'$or':_[_0xf3da('0x39')](_0x5ede07,function(_0xda6008){if(_0xda6008['type']!==_0xf3da('0x3a')){var _0xa8d5df={};_0xa8d5df[_0xda6008[_0xf3da('0x23')]]={'$like':'%'+_0x4bc4a6[_0xf3da('0x2b')][_0xf3da('0x37')]+'%'};return _0xa8d5df;}})});}_0x20b8ee=_[_0xf3da('0x38')]({},_0x20b8ee,_0x4bc4a6['options']);var _0x481d56={'where':_0x20b8ee[_0xf3da('0x35')]};return db[_0xf3da('0x26')][_0xf3da('0x19')](_0x481d56)[_0xf3da('0x20')](function(_0x46271f){_0xc3cd77[_0xf3da('0x19')]=_0x46271f;if(_0x4bc4a6[_0xf3da('0x2b')]['includeAll']){_0x20b8ee[_0xf3da('0x3b')]=[{'all':!![]}];}return db[_0xf3da('0x26')][_0xf3da('0x3c')](_0x20b8ee);})[_0xf3da('0x20')](function(_0xbd010b){_0xc3cd77[_0xf3da('0x3d')]=_0xbd010b;return _0xc3cd77;})[_0xf3da('0x20')](respondWithFilteredResult(_0x59f829,_0x20b8ee))[_0xf3da('0x3e')](handleError(_0x59f829,null));};exports['show']=function(_0x358e93,_0x3fdfe6){var _0x2ad90e={'raw':![],'where':{'id':_0x358e93['params']['id']}},_0x49022d={};_0x49022d['model']=_[_0xf3da('0x2c')](db[_0xf3da('0x26')][_0xf3da('0x27')]);_0x49022d[_0xf3da('0x2b')]=_[_0xf3da('0x2c')](_0x358e93['query']);_0x49022d[_0xf3da('0x2d')]=_['intersection'](_0x49022d[_0xf3da('0x2a')],_0x49022d[_0xf3da('0x2b')]);_0x2ad90e[_0xf3da('0x2e')]=_[_0xf3da('0x3f')](_0x49022d[_0xf3da('0x2a')],qs[_0xf3da('0x2f')](_0x358e93[_0xf3da('0x2b')][_0xf3da('0x2f')]));_0x2ad90e[_0xf3da('0x2e')]=_0x2ad90e[_0xf3da('0x2e')][_0xf3da('0x30')]?_0x2ad90e[_0xf3da('0x2e')]:_0x49022d[_0xf3da('0x2a')];if(_0x358e93[_0xf3da('0x2b')][_0xf3da('0x40')]){_0x2ad90e[_0xf3da('0x3b')]=[{'all':!![]}];}_0x2ad90e=_[_0xf3da('0x38')]({},_0x2ad90e,_0x358e93[_0xf3da('0x41')]);return db[_0xf3da('0x26')][_0xf3da('0x42')](_0x2ad90e)['then'](handleEntityNotFound(_0x3fdfe6,null))[_0xf3da('0x20')](respondWithResult(_0x3fdfe6,null))['catch'](handleError(_0x3fdfe6,null));};exports[_0xf3da('0x43')]=function(_0x2085c9,_0x937bc){return db[_0xf3da('0x26')][_0xf3da('0x43')](_0x2085c9['body'],{})[_0xf3da('0x20')](respondWithResult(_0x937bc,0xc9))[_0xf3da('0x3e')](handleError(_0x937bc,null));};exports[_0xf3da('0x1f')]=function(_0x265421,_0x4b5849){if(_0x265421['body']['id']){delete _0x265421[_0xf3da('0x44')]['id'];}return db[_0xf3da('0x26')]['find']({'where':{'id':_0x265421[_0xf3da('0x45')]['id']}})[_0xf3da('0x20')](handleEntityNotFound(_0x4b5849,null))[_0xf3da('0x20')](saveUpdates(_0x265421['body'],null))[_0xf3da('0x20')](respondWithResult(_0x4b5849,null))['catch'](handleError(_0x4b5849,null));};exports['destroy']=function(_0x532932,_0x490998){return db['IntegrationReport'][_0xf3da('0x42')]({'where':{'id':_0x532932[_0xf3da('0x45')]['id']}})[_0xf3da('0x20')](handleEntityNotFound(_0x490998,null))['then'](removeEntity(_0x490998,null))['catch'](handleError(_0x490998,null));};exports['describe']=function(_0x2ddae5,_0x3d79ef){return db[_0xf3da('0x26')]['describe']()[_0xf3da('0x20')](respondWithResult(_0x3d79ef,null))['catch'](handleError(_0x3d79ef,null));}; \ No newline at end of file +var _0xf492=['then','destroy','end','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf492,0x111));var _0x2f49=function(_0x1839e2,_0xeb2fb3){_0x1839e2=_0x1839e2-0x0;var _0x9378cb=_0xf492[_0x1839e2];return _0x9378cb;};'use strict';var emlformat=require(_0x2f49('0x0'));var rimraf=require(_0x2f49('0x1'));var zipdir=require(_0x2f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f49('0x3'));var moment=require(_0x2f49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f49('0x5'));var util=require(_0x2f49('0x6'));var path=require(_0x2f49('0x7'));var sox=require(_0x2f49('0x8'));var csv=require(_0x2f49('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f49('0xa'));var _=require(_0x2f49('0xb'));var squel=require(_0x2f49('0xc'));var crypto=require(_0x2f49('0xd'));var jsforce=require(_0x2f49('0xe'));var deskjs=require(_0x2f49('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2f49('0x10'));var Papa=require(_0x2f49('0x11'));var Redis=require(_0x2f49('0x12'));var authService=require(_0x2f49('0x13'));var qs=require(_0x2f49('0x14'));var as=require(_0x2f49('0x15'));var hardwareService=require(_0x2f49('0x16'));var logger=require(_0x2f49('0x17'))(_0x2f49('0x18'));var utils=require(_0x2f49('0x19'));var config=require(_0x2f49('0x1a'));var licenseUtil=require(_0x2f49('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b486,_0x10c41b){_0x10c41b=_0x10c41b||0xcc;return function(_0x5e77ce){if(_0x5e77ce){return _0x53b486[_0x2f49('0x1c')](_0x10c41b);}return _0x53b486[_0x2f49('0x1d')](_0x10c41b)['end']();};}function respondWithResult(_0x164f78,_0x194840){_0x194840=_0x194840||0xc8;return function(_0x37e46e){if(_0x37e46e){return _0x164f78[_0x2f49('0x1d')](_0x194840)[_0x2f49('0x1e')](_0x37e46e);}};}function respondWithFilteredResult(_0x34df0e,_0x1f1a21){return function(_0x135476){if(_0x135476){var _0x3a7f5d=typeof _0x1f1a21['offset']===_0x2f49('0x1f')&&typeof _0x1f1a21[_0x2f49('0x20')]===_0x2f49('0x1f');var _0x25012e=_0x135476[_0x2f49('0x21')];var _0x28920=_0x3a7f5d?0x0:_0x1f1a21['offset'];var _0x440c26=_0x3a7f5d?_0x135476[_0x2f49('0x21')]:_0x1f1a21['offset']+_0x1f1a21[_0x2f49('0x20')];var _0x46c69c;if(_0x440c26>=_0x25012e){_0x440c26=_0x25012e;_0x46c69c=0xc8;}else{_0x46c69c=0xce;}_0x34df0e['status'](_0x46c69c);return _0x34df0e['set'](_0x2f49('0x22'),_0x28920+'-'+_0x440c26+'/'+_0x25012e)[_0x2f49('0x1e')](_0x135476);}return null;};}function patchUpdates(_0x29d70c){return function(_0x36c73a){try{jsonpatch[_0x2f49('0x23')](_0x36c73a,_0x29d70c,!![]);}catch(_0x4cc9a5){return BPromise[_0x2f49('0x24')](_0x4cc9a5);}return _0x36c73a[_0x2f49('0x25')]();};}function saveUpdates(_0x33ab06,_0x3a7a11){return function(_0x86a95a){if(_0x86a95a){return _0x86a95a[_0x2f49('0x26')](_0x33ab06)[_0x2f49('0x27')](function(_0x2cbf42){return _0x2cbf42;});}return null;};}function removeEntity(_0x40f312,_0x313b3a){return function(_0x4368bf){if(_0x4368bf){return _0x4368bf[_0x2f49('0x28')]()[_0x2f49('0x27')](function(){_0x40f312[_0x2f49('0x1d')](0xcc)[_0x2f49('0x29')]();});}};}function handleEntityNotFound(_0x44c80e,_0x2ac132){return function(_0x501e6d){if(!_0x501e6d){_0x44c80e[_0x2f49('0x1c')](0x194);}return _0x501e6d;};}function handleError(_0x9a92df,_0x172450){_0x172450=_0x172450||0x1f4;return function(_0x1f9bec){logger['error'](_0x1f9bec[_0x2f49('0x2a')]);if(_0x1f9bec[_0x2f49('0x2b')]){delete _0x1f9bec[_0x2f49('0x2b')];}_0x9a92df['status'](_0x172450)[_0x2f49('0x2c')](_0x1f9bec);};}exports[_0x2f49('0x2d')]=function(_0x5d4100,_0x577b0f){var _0x28d089={},_0x43c349={},_0x310198={'count':0x0,'rows':[]};var _0x34f14d=_[_0x2f49('0x2e')](db[_0x2f49('0x2f')][_0x2f49('0x30')],function(_0x236c06){return{'name':_0x236c06[_0x2f49('0x31')],'type':_0x236c06['type'][_0x2f49('0x32')]};});_0x43c349[_0x2f49('0x33')]=_['map'](_0x34f14d,_0x2f49('0x2b'));_0x43c349[_0x2f49('0x34')]=_[_0x2f49('0x35')](_0x5d4100[_0x2f49('0x34')]);_0x43c349[_0x2f49('0x36')]=_[_0x2f49('0x37')](_0x43c349[_0x2f49('0x33')],_0x43c349[_0x2f49('0x34')]);_0x28d089[_0x2f49('0x38')]=_[_0x2f49('0x37')](_0x43c349[_0x2f49('0x33')],qs[_0x2f49('0x39')](_0x5d4100[_0x2f49('0x34')][_0x2f49('0x39')]));_0x28d089['attributes']=_0x28d089['attributes'][_0x2f49('0x3a')]?_0x28d089[_0x2f49('0x38')]:_0x43c349[_0x2f49('0x33')];if(!_0x5d4100[_0x2f49('0x34')][_0x2f49('0x3b')]('nolimit')){_0x28d089[_0x2f49('0x20')]=qs['limit'](_0x5d4100['query'][_0x2f49('0x20')]);_0x28d089[_0x2f49('0x3c')]=qs[_0x2f49('0x3c')](_0x5d4100[_0x2f49('0x34')]['offset']);}_0x28d089[_0x2f49('0x3d')]=qs[_0x2f49('0x3e')](_0x5d4100[_0x2f49('0x34')][_0x2f49('0x3e')]);_0x28d089[_0x2f49('0x3f')]=qs[_0x2f49('0x36')](_[_0x2f49('0x40')](_0x5d4100['query'],_0x43c349[_0x2f49('0x36')]),_0x34f14d);if(_0x5d4100[_0x2f49('0x34')][_0x2f49('0x41')]){_0x28d089[_0x2f49('0x3f')]=_['merge'](_0x28d089['where'],{'$or':_[_0x2f49('0x2e')](_0x34f14d,function(_0x5ebd75){if(_0x5ebd75[_0x2f49('0x42')]!==_0x2f49('0x43')){var _0x5bbc5a={};_0x5bbc5a[_0x5ebd75[_0x2f49('0x2b')]]={'$like':'%'+_0x5d4100[_0x2f49('0x34')][_0x2f49('0x41')]+'%'};return _0x5bbc5a;}})});}_0x28d089=_[_0x2f49('0x44')]({},_0x28d089,_0x5d4100[_0x2f49('0x45')]);var _0x11d036={'where':_0x28d089['where']};return db[_0x2f49('0x2f')][_0x2f49('0x21')](_0x11d036)[_0x2f49('0x27')](function(_0x2d8ac9){_0x310198[_0x2f49('0x21')]=_0x2d8ac9;if(_0x5d4100[_0x2f49('0x34')]['includeAll']){_0x28d089['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x2f49('0x46')](_0x28d089);})[_0x2f49('0x27')](function(_0x5472ba){_0x310198[_0x2f49('0x47')]=_0x5472ba;return _0x310198;})['then'](respondWithFilteredResult(_0x577b0f,_0x28d089))[_0x2f49('0x48')](handleError(_0x577b0f,null));};exports['show']=function(_0x4ec323,_0x20ac43){var _0x5721f0={'raw':![],'where':{'id':_0x4ec323[_0x2f49('0x49')]['id']}},_0x3010e1={};_0x3010e1['model']=_[_0x2f49('0x35')](db[_0x2f49('0x2f')]['rawAttributes']);_0x3010e1['query']=_[_0x2f49('0x35')](_0x4ec323[_0x2f49('0x34')]);_0x3010e1[_0x2f49('0x36')]=_[_0x2f49('0x37')](_0x3010e1[_0x2f49('0x33')],_0x3010e1[_0x2f49('0x34')]);_0x5721f0[_0x2f49('0x38')]=_[_0x2f49('0x37')](_0x3010e1[_0x2f49('0x33')],qs[_0x2f49('0x39')](_0x4ec323[_0x2f49('0x34')]['fields']));_0x5721f0['attributes']=_0x5721f0[_0x2f49('0x38')][_0x2f49('0x3a')]?_0x5721f0['attributes']:_0x3010e1[_0x2f49('0x33')];if(_0x4ec323[_0x2f49('0x34')]['includeAll']){_0x5721f0['include']=[{'all':!![]}];}_0x5721f0=_[_0x2f49('0x44')]({},_0x5721f0,_0x4ec323[_0x2f49('0x45')]);return db[_0x2f49('0x2f')][_0x2f49('0x4a')](_0x5721f0)[_0x2f49('0x27')](handleEntityNotFound(_0x20ac43,null))['then'](respondWithResult(_0x20ac43,null))[_0x2f49('0x48')](handleError(_0x20ac43,null));};exports[_0x2f49('0x4b')]=function(_0x55a312,_0x22b413){return db[_0x2f49('0x2f')][_0x2f49('0x4b')](_0x55a312[_0x2f49('0x4c')],{})['then'](respondWithResult(_0x22b413,0xc9))['catch'](handleError(_0x22b413,null));};exports['update']=function(_0x1c0db2,_0x35f162){if(_0x1c0db2[_0x2f49('0x4c')]['id']){delete _0x1c0db2[_0x2f49('0x4c')]['id'];}return db[_0x2f49('0x2f')][_0x2f49('0x4a')]({'where':{'id':_0x1c0db2[_0x2f49('0x49')]['id']}})['then'](handleEntityNotFound(_0x35f162,null))[_0x2f49('0x27')](saveUpdates(_0x1c0db2[_0x2f49('0x4c')],null))[_0x2f49('0x27')](respondWithResult(_0x35f162,null))['catch'](handleError(_0x35f162,null));};exports[_0x2f49('0x28')]=function(_0x3810b8,_0x50f3a8){return db[_0x2f49('0x2f')][_0x2f49('0x4a')]({'where':{'id':_0x3810b8[_0x2f49('0x49')]['id']}})['then'](handleEntityNotFound(_0x50f3a8,null))[_0x2f49('0x27')](removeEntity(_0x50f3a8,null))[_0x2f49('0x48')](handleError(_0x50f3a8,null));};exports[_0x2f49('0x4d')]=function(_0x339bbc,_0x54f46b){return db['IntegrationReport'][_0x2f49('0x4d')]()[_0x2f49('0x27')](respondWithResult(_0x54f46b,null))[_0x2f49('0x48')](handleError(_0x54f46b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c02c6ef..384b4f2 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 _0x1b00=['define','report_integration','lodash','util','bluebird','request-promise','../../config/environment','./integrationReport.attributes'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x1b00,0x1c2));var _0x01b0=function(_0x13266c,_0x41db14){_0x13266c=_0x13266c-0x0;var _0x3afa06=_0x1b00[_0x13266c];return _0x3afa06;};'use strict';var _=require(_0x01b0('0x0'));var util=require(_0x01b0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x01b0('0x2'));var rp=require(_0x01b0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01b0('0x4'));var attributes=require(_0x01b0('0x5'));module['exports']=function(_0x41ae57,_0x3171cf){return _0x41ae57[_0x01b0('0x6')]('IntegrationReport',attributes,{'tableName':_0x01b0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1c4=['rimraf','./integrationReport.attributes','define','IntegrationReport','lodash','util','../../config/logger','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb1c4,0x82));var _0x4b1c=function(_0x2cce1b,_0x59842e){_0x2cce1b=_0x2cce1b-0x0;var _0x2b8215=_0xb1c4[_0x2cce1b];return _0x2b8215;};'use strict';var _=require(_0x4b1c('0x0'));var util=require(_0x4b1c('0x1'));var logger=require(_0x4b1c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b1c('0x3'));var fs=require('fs');var path=require(_0x4b1c('0x4'));var rimraf=require(_0x4b1c('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b1c('0x6'));module['exports']=function(_0x47ae3f,_0x28a794){return _0x47ae3f[_0x4b1c('0x7')](_0x4b1c('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 246f87d..9e735fc 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x3f8a[_0x57e18a];return _0x1181c7;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5223c2,_0xe0d88f){var _0x10f398=function(_0x15e4ae){while(--_0x15e4ae){_0x5223c2['push'](_0x5223c2['shift']());}};_0x10f398(++_0xe0d88f);}(_0x2ef3,0xba));var _0x32ef=function(_0x23a385,_0x1ba009){_0x23a385=_0x23a385-0x0;var _0x280dbc=_0x2ef3[_0x23a385];return _0x280dbc;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ecb2d53..89c196a 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 _0x029b=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','post','create','addInterval','/:id/sub_intervals/create_many','put','update','delete','/:id'];(function(_0x79998c,_0x51c7b4){var _0xcbcd85=function(_0x2b287d){while(--_0x2b287d){_0x79998c['push'](_0x79998c['shift']());}};_0xcbcd85(++_0x51c7b4);}(_0x029b,0x66));var _0xb029=function(_0x49ae2c,_0x44c1af){_0x49ae2c=_0x49ae2c-0x0;var _0x184124=_0x029b[_0x49ae2c];return _0x184124;};'use strict';var multer=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var path=require('path');var timeout=require(_0xb029('0x2'));var express=require(_0xb029('0x3'));var router=express['Router']();var fs_extra=require(_0xb029('0x4'));var auth=require(_0xb029('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb029('0x6'));router[_0xb029('0x7')]('/',auth[_0xb029('0x8')](),controller[_0xb029('0x9')]);router[_0xb029('0x7')]('/:id',auth[_0xb029('0x8')](),controller['show']);router[_0xb029('0x7')]('/:id/sub_intervals',auth[_0xb029('0x8')](),controller['getIntervals']);router[_0xb029('0xa')]('/',auth['isAuthenticated'](),controller[_0xb029('0xb')]);router[_0xb029('0xa')]('/:id/sub_intervals',auth[_0xb029('0x8')](),controller[_0xb029('0xc')]);router[_0xb029('0xa')](_0xb029('0xd'),auth[_0xb029('0x8')](),controller['addIntervals']);router[_0xb029('0xe')]('/:id',auth[_0xb029('0x8')](),controller[_0xb029('0xf')]);router[_0xb029('0x10')](_0xb029('0x11'),auth['isAuthenticated'](),controller[_0xb029('0x12')]);module[_0xb029('0x13')]=router; \ No newline at end of file +var _0x8daf=['post','create','addInterval','addIntervals','put','update','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8daf,0x15c));var _0xf8da=function(_0x1e8a13,_0x150633){_0x1e8a13=_0x1e8a13-0x0;var _0x1b5c34=_0x8daf[_0x1e8a13];return _0x1b5c34;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf8da('0x0'));var router=express[_0xf8da('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf8da('0x2'));var interaction=require(_0xf8da('0x3'));var config=require(_0xf8da('0x4'));var controller=require(_0xf8da('0x5'));router[_0xf8da('0x6')]('/',auth[_0xf8da('0x7')](),controller[_0xf8da('0x8')]);router[_0xf8da('0x6')](_0xf8da('0x9'),auth['isAuthenticated'](),controller[_0xf8da('0xa')]);router['get'](_0xf8da('0xb'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xf8da('0xc')]('/',auth[_0xf8da('0x7')](),controller[_0xf8da('0xd')]);router[_0xf8da('0xc')](_0xf8da('0xb'),auth[_0xf8da('0x7')](),controller[_0xf8da('0xe')]);router[_0xf8da('0xc')]('/:id/sub_intervals/create_many',auth[_0xf8da('0x7')](),controller[_0xf8da('0xf')]);router[_0xf8da('0x10')](_0xf8da('0x9'),auth['isAuthenticated'](),controller[_0xf8da('0x11')]);router['delete'](_0xf8da('0x9'),auth[_0xf8da('0x7')](),controller[_0xf8da('0x12')]);module[_0xf8da('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index aeaba23..d64221e 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 _0xe767=['sequelize','exports','STRING'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xe767,0xbd));var _0x7e76=function(_0x39d300,_0x11c0e0){_0x39d300=_0x39d300-0x0;var _0x400063=_0xe767[_0x39d300];return _0x400063;};'use strict';var Sequelize=require(_0x7e76('0x0'));module[_0x7e76('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7e76('0x2')]},'interval':{'type':Sequelize[_0x7e76('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x078b=['sequelize','STRING'];(function(_0x345d30,_0xb4c29c){var _0x2d1aa1=function(_0x3e9438){while(--_0x3e9438){_0x345d30['push'](_0x345d30['shift']());}};_0x2d1aa1(++_0xb4c29c);}(_0x078b,0x18a));var _0xb078=function(_0x4e791e,_0x12eb01){_0x4e791e=_0x4e791e-0x0;var _0x4009f5=_0x078b[_0x4e791e];return _0x4009f5;};'use strict';var Sequelize=require(_0xb078('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb078('0x1')]},'interval':{'type':Sequelize[_0xb078('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 fd44577..d1d83b8 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 _0xc155=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','error','name','send','index','map','Interval','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','addIntervals','findOne','sequelize','bulkCreate','eml-format','rimraf','zip-dir'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0xc155,0x117));var _0x5c15=function(_0x10fdb2,_0x252191){_0x10fdb2=_0x10fdb2-0x0;var _0x537c32=_0xc155[_0x10fdb2];return _0x537c32;};'use strict';var emlformat=require(_0x5c15('0x0'));var rimraf=require(_0x5c15('0x1'));var zipdir=require(_0x5c15('0x2'));var jsonpatch=require(_0x5c15('0x3'));var rp=require(_0x5c15('0x4'));var moment=require(_0x5c15('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c15('0x6'));var util=require(_0x5c15('0x7'));var path=require(_0x5c15('0x8'));var sox=require(_0x5c15('0x9'));var csv=require(_0x5c15('0xa'));var ejs=require(_0x5c15('0xb'));var fs=require('fs');var fs_extra=require(_0x5c15('0xc'));var _=require(_0x5c15('0xd'));var squel=require('squel');var crypto=require(_0x5c15('0xe'));var jsforce=require(_0x5c15('0xf'));var deskjs=require(_0x5c15('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5c15('0x11'));var Papa=require(_0x5c15('0x12'));var Redis=require(_0x5c15('0x13'));var authService=require(_0x5c15('0x14'));var qs=require(_0x5c15('0x15'));var as=require(_0x5c15('0x16'));var hardwareService=require(_0x5c15('0x17'));var logger=require(_0x5c15('0x18'))(_0x5c15('0x19'));var utils=require(_0x5c15('0x1a'));var config=require(_0x5c15('0x1b'));var licenseUtil=require(_0x5c15('0x1c'));var db=require(_0x5c15('0x1d'))['db'];var extensions=require(_0x5c15('0x1e'));function respondWithStatusCode(_0x39d5bd,_0x46d00e){_0x46d00e=_0x46d00e||0xcc;return function(_0x4bd78d){if(_0x4bd78d){return _0x39d5bd[_0x5c15('0x1f')](_0x46d00e);}return _0x39d5bd['status'](_0x46d00e)[_0x5c15('0x20')]();};}function respondWithResult(_0x259f66,_0x2a5a18){_0x2a5a18=_0x2a5a18||0xc8;return function(_0x5d62c9){if(_0x5d62c9){return _0x259f66[_0x5c15('0x21')](_0x2a5a18)[_0x5c15('0x22')](_0x5d62c9);}};}function respondWithFilteredResult(_0x1d1482,_0x362025){return function(_0x5baf53){if(_0x5baf53){var _0x1efcb5=typeof _0x362025[_0x5c15('0x23')]===_0x5c15('0x24')&&typeof _0x362025[_0x5c15('0x25')]===_0x5c15('0x24');var _0x46d390=_0x5baf53[_0x5c15('0x26')];var _0x4e3b5a=_0x1efcb5?0x0:_0x362025[_0x5c15('0x23')];var _0x4db7c9=_0x1efcb5?_0x5baf53[_0x5c15('0x26')]:_0x362025[_0x5c15('0x23')]+_0x362025['limit'];var _0x1da2d8;if(_0x4db7c9>=_0x46d390){_0x4db7c9=_0x46d390;_0x1da2d8=0xc8;}else{_0x1da2d8=0xce;}_0x1d1482[_0x5c15('0x21')](_0x1da2d8);return _0x1d1482[_0x5c15('0x27')]('Content-Range',_0x4e3b5a+'-'+_0x4db7c9+'/'+_0x46d390)[_0x5c15('0x22')](_0x5baf53);}return null;};}function patchUpdates(_0x52d163){return function(_0x3dd137){try{jsonpatch[_0x5c15('0x28')](_0x3dd137,_0x52d163,!![]);}catch(_0x18cd29){return BPromise[_0x5c15('0x29')](_0x18cd29);}return _0x3dd137[_0x5c15('0x2a')]();};}function saveUpdates(_0x11c0d8,_0x151680){return function(_0x2b6dd){if(_0x2b6dd){return _0x2b6dd[_0x5c15('0x2b')](_0x11c0d8)[_0x5c15('0x2c')](function(_0x56f5c1){return _0x56f5c1;});}return null;};}function removeEntity(_0x6ec0e,_0x44bd89){return function(_0x37103e){if(_0x37103e){return _0x37103e[_0x5c15('0x2d')]()[_0x5c15('0x2c')](function(){var _0x456360=_0x37103e[_0x5c15('0x2e')]({'plain':!![]});var _0x18e706='Intervals';return db['UserProfileResource'][_0x5c15('0x2d')]({'where':{'type':_0x18e706,'resourceId':_0x456360['id']}})['then'](function(){return _0x37103e;});})[_0x5c15('0x2c')](function(){_0x6ec0e[_0x5c15('0x21')](0xcc)[_0x5c15('0x20')]();});}};}function handleEntityNotFound(_0x4f5f6f,_0x435658){return function(_0x4676a6){if(!_0x4676a6){_0x4f5f6f[_0x5c15('0x1f')](0x194);}return _0x4676a6;};}function handleError(_0x3268a3,_0x1c6d5a){_0x1c6d5a=_0x1c6d5a||0x1f4;return function(_0xa5c90a){logger[_0x5c15('0x2f')](_0xa5c90a['stack']);if(_0xa5c90a[_0x5c15('0x30')]){delete _0xa5c90a[_0x5c15('0x30')];}_0x3268a3['status'](_0x1c6d5a)[_0x5c15('0x31')](_0xa5c90a);};}exports[_0x5c15('0x32')]=function(_0x2b811b,_0x12430c){var _0x46eb90={},_0x2a13f2={},_0x147531={'count':0x0,'rows':[]};var _0x1f301f=_[_0x5c15('0x33')](db[_0x5c15('0x34')]['rawAttributes'],function(_0xdb0d2c){return{'name':_0xdb0d2c['fieldName'],'type':_0xdb0d2c[_0x5c15('0x35')]['key']};});_0x2a13f2['model']=_[_0x5c15('0x33')](_0x1f301f,_0x5c15('0x30'));_0x2a13f2[_0x5c15('0x36')]=_[_0x5c15('0x37')](_0x2b811b[_0x5c15('0x36')]);_0x2a13f2['filters']=_[_0x5c15('0x38')](_0x2a13f2[_0x5c15('0x39')],_0x2a13f2[_0x5c15('0x36')]);_0x46eb90[_0x5c15('0x3a')]=_['intersection'](_0x2a13f2[_0x5c15('0x39')],qs[_0x5c15('0x3b')](_0x2b811b[_0x5c15('0x36')]['fields']));_0x46eb90['attributes']=_0x46eb90[_0x5c15('0x3a')][_0x5c15('0x3c')]?_0x46eb90[_0x5c15('0x3a')]:_0x2a13f2['model'];if(!_0x2b811b[_0x5c15('0x36')][_0x5c15('0x3d')](_0x5c15('0x3e'))){_0x46eb90[_0x5c15('0x25')]=qs[_0x5c15('0x25')](_0x2b811b['query'][_0x5c15('0x25')]);_0x46eb90[_0x5c15('0x23')]=qs[_0x5c15('0x23')](_0x2b811b[_0x5c15('0x36')][_0x5c15('0x23')]);}_0x46eb90[_0x5c15('0x3f')]=qs['sort'](_0x2b811b[_0x5c15('0x36')][_0x5c15('0x40')]);_0x46eb90[_0x5c15('0x41')]=qs[_0x5c15('0x42')](_[_0x5c15('0x43')](_0x2b811b[_0x5c15('0x36')],_0x2a13f2[_0x5c15('0x42')]),_0x1f301f);if(_0x2b811b[_0x5c15('0x36')]['filter']){_0x46eb90['where']=_[_0x5c15('0x44')](_0x46eb90[_0x5c15('0x41')],{'$or':_[_0x5c15('0x33')](_0x1f301f,function(_0x504db1){if(_0x504db1['type']!==_0x5c15('0x45')){var _0x155f52={};_0x155f52[_0x504db1[_0x5c15('0x30')]]={'$like':'%'+_0x2b811b[_0x5c15('0x36')][_0x5c15('0x46')]+'%'};return _0x155f52;}})});}_0x46eb90=_[_0x5c15('0x44')]({},_0x46eb90,_0x2b811b[_0x5c15('0x47')]);var _0x1d5935={'where':_0x46eb90['where']};return db[_0x5c15('0x34')][_0x5c15('0x26')](_0x1d5935)[_0x5c15('0x2c')](function(_0x2a1760){_0x147531[_0x5c15('0x26')]=_0x2a1760;if(_0x2b811b[_0x5c15('0x36')]['includeAll']){_0x46eb90['include']=[{'all':!![]}];}return db[_0x5c15('0x34')][_0x5c15('0x48')](_0x46eb90);})[_0x5c15('0x2c')](function(_0xfab835){_0x147531[_0x5c15('0x49')]=_0xfab835;return _0x147531;})[_0x5c15('0x2c')](respondWithFilteredResult(_0x12430c,_0x46eb90))[_0x5c15('0x4a')](handleError(_0x12430c,null));};exports[_0x5c15('0x4b')]=function(_0x124595,_0x515927){var _0x1b5284={'raw':!![],'where':{'id':_0x124595['params']['id']}},_0x188905={};_0x188905[_0x5c15('0x39')]=_['keys'](db[_0x5c15('0x34')][_0x5c15('0x4c')]);_0x188905[_0x5c15('0x36')]=_[_0x5c15('0x37')](_0x124595['query']);_0x188905[_0x5c15('0x42')]=_['intersection'](_0x188905[_0x5c15('0x39')],_0x188905['query']);_0x1b5284[_0x5c15('0x3a')]=_['intersection'](_0x188905[_0x5c15('0x39')],qs['fields'](_0x124595['query'][_0x5c15('0x3b')]));_0x1b5284[_0x5c15('0x3a')]=_0x1b5284[_0x5c15('0x3a')][_0x5c15('0x3c')]?_0x1b5284['attributes']:_0x188905[_0x5c15('0x39')];if(_0x124595['query'][_0x5c15('0x4d')]){_0x1b5284[_0x5c15('0x4e')]=[{'all':!![]}];}_0x1b5284=_[_0x5c15('0x44')]({},_0x1b5284,_0x124595[_0x5c15('0x47')]);return db[_0x5c15('0x34')][_0x5c15('0x4f')](_0x1b5284)[_0x5c15('0x2c')](handleEntityNotFound(_0x515927,null))['then'](respondWithResult(_0x515927,null))[_0x5c15('0x4a')](handleError(_0x515927,null));};exports[_0x5c15('0x50')]=function(_0x3cbd10,_0x5ce30f){return db[_0x5c15('0x34')]['create'](_0x3cbd10[_0x5c15('0x51')],{})['then'](function(_0x5d0cba){var _0x278b6b=_0x3cbd10['user']['get']({'plain':!![]});if(!_0x278b6b)throw new Error(_0x5c15('0x52'));if(_0x278b6b[_0x5c15('0x53')]==='user'){var _0x39bada=_0x5d0cba[_0x5c15('0x2e')]({'plain':!![]});var _0xbf978d=_0x5c15('0x54');return db[_0x5c15('0x55')][_0x5c15('0x4f')]({'where':{'name':_0xbf978d,'userProfileId':_0x278b6b['userProfileId']},'raw':!![]})[_0x5c15('0x2c')](function(_0x1458e0){if(_0x1458e0&&_0x1458e0['autoAssociation']===0x0){return db['UserProfileResource'][_0x5c15('0x50')]({'name':_0x39bada[_0x5c15('0x30')],'resourceId':_0x39bada['id'],'type':_0x1458e0['name'],'sectionId':_0x1458e0['id']},{})[_0x5c15('0x2c')](function(){return _0x5d0cba;});}else{return _0x5d0cba;}})['catch'](function(_0x297c70){logger['error'](_0x5c15('0x56'),_0x297c70);throw _0x297c70;});}return _0x5d0cba;})['then'](respondWithResult(_0x5ce30f,0xc9))['catch'](handleError(_0x5ce30f,null));};exports['update']=function(_0x5ea8c1,_0x496a14){if(_0x5ea8c1['body']['id']){delete _0x5ea8c1[_0x5c15('0x51')]['id'];}return db[_0x5c15('0x34')][_0x5c15('0x4f')]({'where':{'id':_0x5ea8c1[_0x5c15('0x57')]['id']}})[_0x5c15('0x2c')](handleEntityNotFound(_0x496a14,null))[_0x5c15('0x2c')](saveUpdates(_0x5ea8c1[_0x5c15('0x51')],null))['then'](respondWithResult(_0x496a14,null))[_0x5c15('0x4a')](handleError(_0x496a14,null));};exports[_0x5c15('0x2d')]=function(_0x54a46c,_0x14fdcb){return db['Interval'][_0x5c15('0x4f')]({'where':{'id':_0x54a46c[_0x5c15('0x57')]['id']}})[_0x5c15('0x2c')](handleEntityNotFound(_0x14fdcb,null))['then'](removeEntity(_0x14fdcb,null))['catch'](handleError(_0x14fdcb,null));};exports[_0x5c15('0x58')]=function(_0xc52445,_0x4d1091,_0x2ccb8f){if(_0xc52445[_0x5c15('0x51')]['id']){delete _0xc52445[_0x5c15('0x51')]['id'];}return db[_0x5c15('0x34')]['find']({'where':{'id':_0xc52445[_0x5c15('0x57')]['id']}})[_0x5c15('0x2c')](handleEntityNotFound(_0x4d1091,null))[_0x5c15('0x2c')](function(_0x5c82d3){if(_0x5c82d3){_0xc52445[_0x5c15('0x51')]['IntervalId']=_0x5c82d3['id'];return db[_0x5c15('0x34')][_0x5c15('0x50')](_0xc52445[_0x5c15('0x51')]);}})[_0x5c15('0x2c')](respondWithResult(_0x4d1091,null))['catch'](handleError(_0x4d1091,null));};exports[_0x5c15('0x59')]=function(_0x4ba939,_0x1c7430,_0x562376){var _0x190937={};var _0x14bf0a={};var _0x5462a2;var _0x23bef0;return db[_0x5c15('0x34')]['findOne']({'where':{'id':_0x4ba939[_0x5c15('0x57')]['id']}})[_0x5c15('0x2c')](handleEntityNotFound(_0x1c7430,null))[_0x5c15('0x2c')](function(_0x4b8cc1){if(_0x4b8cc1){_0x5462a2=_0x4b8cc1;_0x14bf0a['model']=_[_0x5c15('0x37')](db[_0x5c15('0x34')]['rawAttributes']);_0x14bf0a[_0x5c15('0x36')]=_[_0x5c15('0x37')](_0x4ba939[_0x5c15('0x36')]);_0x14bf0a[_0x5c15('0x42')]=_[_0x5c15('0x38')](_0x14bf0a[_0x5c15('0x39')],_0x14bf0a['query']);_0x190937[_0x5c15('0x3a')]=_[_0x5c15('0x38')](_0x14bf0a[_0x5c15('0x39')],qs['fields'](_0x4ba939[_0x5c15('0x36')][_0x5c15('0x3b')]));_0x190937['attributes']=_0x190937[_0x5c15('0x3a')][_0x5c15('0x3c')]?_0x190937['attributes']:_0x14bf0a[_0x5c15('0x39')];_0x190937[_0x5c15('0x3f')]=qs[_0x5c15('0x40')](_0x4ba939[_0x5c15('0x36')]['sort']);_0x190937['where']=qs[_0x5c15('0x42')](_[_0x5c15('0x43')](_0x4ba939[_0x5c15('0x36')],_0x14bf0a[_0x5c15('0x42')]));if(_0x4ba939[_0x5c15('0x36')]['filter']){_0x190937[_0x5c15('0x41')]=_[_0x5c15('0x44')](_0x190937[_0x5c15('0x41')],{'$or':_['map'](_0x190937[_0x5c15('0x3a')],function(_0x438d70){var _0x4ff423={};_0x4ff423[_0x438d70]={'$like':'%'+_0x4ba939['query'][_0x5c15('0x46')]+'%'};return _0x4ff423;})});}_0x190937=_[_0x5c15('0x44')]({},_0x190937,_0x4ba939[_0x5c15('0x47')]);return _0x5462a2[_0x5c15('0x59')](_0x190937);}})[_0x5c15('0x2c')](function(_0x2e2fea){if(_0x2e2fea){_0x23bef0=_0x2e2fea[_0x5c15('0x3c')];if(!_0x4ba939[_0x5c15('0x36')][_0x5c15('0x3d')](_0x5c15('0x3e'))){_0x190937[_0x5c15('0x25')]=qs[_0x5c15('0x25')](_0x4ba939[_0x5c15('0x36')][_0x5c15('0x25')]);_0x190937[_0x5c15('0x23')]=qs[_0x5c15('0x23')](_0x4ba939[_0x5c15('0x36')]['offset']);}return _0x5462a2['getIntervals'](_0x190937);}})[_0x5c15('0x2c')](function(_0x588dfa){if(_0x588dfa){return _0x588dfa?{'count':_0x23bef0,'rows':_0x588dfa}:null;}})['then'](respondWithResult(_0x1c7430,null))['catch'](handleError(_0x1c7430,null));};exports[_0x5c15('0x5a')]=function(_0x45ffed,_0x1eb54a,_0x14e82a){return db[_0x5c15('0x34')][_0x5c15('0x5b')]({'where':{'id':_0x45ffed[_0x5c15('0x57')]['id']}})[_0x5c15('0x2c')](handleEntityNotFound(_0x1eb54a,null))[_0x5c15('0x2c')](function(_0x4e4429){if(_0x4e4429){return db[_0x5c15('0x5c')]['transaction'](function(_0x5c6359){return db[_0x5c15('0x34')][_0x5c15('0x2d')]({'where':{'IntervalId':_0x45ffed['params']['id']},'transaction':_0x5c6359})[_0x5c15('0x2c')](function(_0x2971ac){var _0xb56e69=_[_0x5c15('0x33')](_0x45ffed['body'],function(_0x18c3bf){delete _0x18c3bf['id'];_0x18c3bf['IntervalId']=_0x45ffed[_0x5c15('0x57')]['id'];return _0x18c3bf;});return db[_0x5c15('0x34')][_0x5c15('0x5d')](_0xb56e69,{'transaction':_0x5c6359});});})[_0x5c15('0x2c')](function(){return db[_0x5c15('0x34')][_0x5c15('0x48')]({'where':{'IntervalId':_0x45ffed[_0x5c15('0x57')]['id']}});});}})[_0x5c15('0x2c')](respondWithResult(_0x1eb54a,null))[_0x5c15('0x4a')](handleError(_0x1eb54a,null));}; \ No newline at end of file +var _0xfbf0=['getIntervals','findOne','filter','map','nolimit','addIntervals','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','get','Intervals','UserProfileResource','destroy','end','error','stack','name','send','index','Interval','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId'];(function(_0x4f5e02,_0x46a006){var _0x3f44bf=function(_0x12c071){while(--_0x12c071){_0x4f5e02['push'](_0x4f5e02['shift']());}};_0x3f44bf(++_0x46a006);}(_0xfbf0,0xc0));var _0x0fbf=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xfbf0[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0x0fbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fbf('0x1'));var jsonpatch=require(_0x0fbf('0x2'));var rp=require(_0x0fbf('0x3'));var moment=require(_0x0fbf('0x4'));var BPromise=require(_0x0fbf('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0fbf('0x6'));var sox=require(_0x0fbf('0x7'));var csv=require(_0x0fbf('0x8'));var ejs=require(_0x0fbf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fbf('0xa'));var squel=require(_0x0fbf('0xb'));var crypto=require('crypto');var jsforce=require(_0x0fbf('0xc'));var deskjs=require(_0x0fbf('0xd'));var toCsv=require(_0x0fbf('0x8'));var querystring=require(_0x0fbf('0xe'));var Papa=require(_0x0fbf('0xf'));var Redis=require(_0x0fbf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fbf('0x11'));var as=require(_0x0fbf('0x12'));var hardwareService=require(_0x0fbf('0x13'));var logger=require(_0x0fbf('0x14'))('api');var utils=require(_0x0fbf('0x15'));var config=require(_0x0fbf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fbf('0x17'))['db'];var extensions=require(_0x0fbf('0x18'));function respondWithStatusCode(_0x11a556,_0x5769e8){_0x5769e8=_0x5769e8||0xcc;return function(_0x2d2e5f){if(_0x2d2e5f){return _0x11a556[_0x0fbf('0x19')](_0x5769e8);}return _0x11a556[_0x0fbf('0x1a')](_0x5769e8)['end']();};}function respondWithResult(_0x30c6b9,_0x13b0d9){_0x13b0d9=_0x13b0d9||0xc8;return function(_0x239f62){if(_0x239f62){return _0x30c6b9[_0x0fbf('0x1a')](_0x13b0d9)[_0x0fbf('0x1b')](_0x239f62);}};}function respondWithFilteredResult(_0x40003e,_0x17030f){return function(_0x172011){if(_0x172011){var _0x4df18f=typeof _0x17030f[_0x0fbf('0x1c')]===_0x0fbf('0x1d')&&typeof _0x17030f[_0x0fbf('0x1e')]===_0x0fbf('0x1d');var _0x14b4fe=_0x172011[_0x0fbf('0x1f')];var _0xe790e9=_0x4df18f?0x0:_0x17030f['offset'];var _0x2f10e6=_0x4df18f?_0x172011['count']:_0x17030f['offset']+_0x17030f[_0x0fbf('0x1e')];var _0x4e7cd3;if(_0x2f10e6>=_0x14b4fe){_0x2f10e6=_0x14b4fe;_0x4e7cd3=0xc8;}else{_0x4e7cd3=0xce;}_0x40003e['status'](_0x4e7cd3);return _0x40003e[_0x0fbf('0x20')]('Content-Range',_0xe790e9+'-'+_0x2f10e6+'/'+_0x14b4fe)[_0x0fbf('0x1b')](_0x172011);}return null;};}function patchUpdates(_0x357ace){return function(_0x16274a){try{jsonpatch[_0x0fbf('0x21')](_0x16274a,_0x357ace,!![]);}catch(_0x5bcaa0){return BPromise[_0x0fbf('0x22')](_0x5bcaa0);}return _0x16274a['save']();};}function saveUpdates(_0x47ac0d,_0x4d1d44){return function(_0x114af6){if(_0x114af6){return _0x114af6[_0x0fbf('0x23')](_0x47ac0d)[_0x0fbf('0x24')](function(_0x571d16){return _0x571d16;});}return null;};}function removeEntity(_0x4dff3b,_0x878f10){return function(_0x38b23e){if(_0x38b23e){return _0x38b23e['destroy']()[_0x0fbf('0x24')](function(){var _0x84a931=_0x38b23e[_0x0fbf('0x25')]({'plain':!![]});var _0x43e37a=_0x0fbf('0x26');return db[_0x0fbf('0x27')][_0x0fbf('0x28')]({'where':{'type':_0x43e37a,'resourceId':_0x84a931['id']}})[_0x0fbf('0x24')](function(){return _0x38b23e;});})[_0x0fbf('0x24')](function(){_0x4dff3b[_0x0fbf('0x1a')](0xcc)[_0x0fbf('0x29')]();});}};}function handleEntityNotFound(_0x1140e8,_0x3e7e40){return function(_0x53b53c){if(!_0x53b53c){_0x1140e8['sendStatus'](0x194);}return _0x53b53c;};}function handleError(_0x2a9edd,_0xd889c0){_0xd889c0=_0xd889c0||0x1f4;return function(_0xaaa859){logger[_0x0fbf('0x2a')](_0xaaa859[_0x0fbf('0x2b')]);if(_0xaaa859[_0x0fbf('0x2c')]){delete _0xaaa859['name'];}_0x2a9edd[_0x0fbf('0x1a')](_0xd889c0)[_0x0fbf('0x2d')](_0xaaa859);};}exports[_0x0fbf('0x2e')]=function(_0x4a6427,_0x7b9769){var _0x1d2240={},_0xf8138={},_0x4cebd0={'count':0x0,'rows':[]};var _0x2fc2a1=_['map'](db[_0x0fbf('0x2f')][_0x0fbf('0x30')],function(_0xeca243){return{'name':_0xeca243['fieldName'],'type':_0xeca243[_0x0fbf('0x31')][_0x0fbf('0x32')]};});_0xf8138[_0x0fbf('0x33')]=_['map'](_0x2fc2a1,_0x0fbf('0x2c'));_0xf8138[_0x0fbf('0x34')]=_[_0x0fbf('0x35')](_0x4a6427['query']);_0xf8138[_0x0fbf('0x36')]=_['intersection'](_0xf8138[_0x0fbf('0x33')],_0xf8138[_0x0fbf('0x34')]);_0x1d2240[_0x0fbf('0x37')]=_[_0x0fbf('0x38')](_0xf8138['model'],qs['fields'](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x39')]));_0x1d2240[_0x0fbf('0x37')]=_0x1d2240['attributes']['length']?_0x1d2240[_0x0fbf('0x37')]:_0xf8138['model'];if(!_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x3a')]('nolimit')){_0x1d2240[_0x0fbf('0x1e')]=qs[_0x0fbf('0x1e')](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x1e')]);_0x1d2240['offset']=qs[_0x0fbf('0x1c')](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x1c')]);}_0x1d2240[_0x0fbf('0x3b')]=qs[_0x0fbf('0x3c')](_0x4a6427['query']['sort']);_0x1d2240[_0x0fbf('0x3d')]=qs[_0x0fbf('0x36')](_[_0x0fbf('0x3e')](_0x4a6427['query'],_0xf8138[_0x0fbf('0x36')]),_0x2fc2a1);if(_0x4a6427[_0x0fbf('0x34')]['filter']){_0x1d2240['where']=_[_0x0fbf('0x3f')](_0x1d2240[_0x0fbf('0x3d')],{'$or':_['map'](_0x2fc2a1,function(_0x20b49c){if(_0x20b49c[_0x0fbf('0x31')]!==_0x0fbf('0x40')){var _0x185b5d={};_0x185b5d[_0x20b49c[_0x0fbf('0x2c')]]={'$like':'%'+_0x4a6427[_0x0fbf('0x34')]['filter']+'%'};return _0x185b5d;}})});}_0x1d2240=_[_0x0fbf('0x3f')]({},_0x1d2240,_0x4a6427[_0x0fbf('0x41')]);var _0x1f5ac9={'where':_0x1d2240[_0x0fbf('0x3d')]};return db[_0x0fbf('0x2f')]['count'](_0x1f5ac9)[_0x0fbf('0x24')](function(_0x231064){_0x4cebd0[_0x0fbf('0x1f')]=_0x231064;if(_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x42')]){_0x1d2240['include']=[{'all':!![]}];}return db['Interval'][_0x0fbf('0x43')](_0x1d2240);})[_0x0fbf('0x24')](function(_0x1b00d1){_0x4cebd0[_0x0fbf('0x44')]=_0x1b00d1;return _0x4cebd0;})[_0x0fbf('0x24')](respondWithFilteredResult(_0x7b9769,_0x1d2240))[_0x0fbf('0x45')](handleError(_0x7b9769,null));};exports[_0x0fbf('0x46')]=function(_0xdb619b,_0x4b6d43){var _0x3b990e={'raw':!![],'where':{'id':_0xdb619b[_0x0fbf('0x47')]['id']}},_0xa4cdda={};_0xa4cdda[_0x0fbf('0x33')]=_[_0x0fbf('0x35')](db[_0x0fbf('0x2f')][_0x0fbf('0x30')]);_0xa4cdda['query']=_[_0x0fbf('0x35')](_0xdb619b[_0x0fbf('0x34')]);_0xa4cdda['filters']=_[_0x0fbf('0x38')](_0xa4cdda['model'],_0xa4cdda[_0x0fbf('0x34')]);_0x3b990e[_0x0fbf('0x37')]=_['intersection'](_0xa4cdda[_0x0fbf('0x33')],qs[_0x0fbf('0x39')](_0xdb619b[_0x0fbf('0x34')]['fields']));_0x3b990e['attributes']=_0x3b990e[_0x0fbf('0x37')][_0x0fbf('0x48')]?_0x3b990e[_0x0fbf('0x37')]:_0xa4cdda['model'];if(_0xdb619b[_0x0fbf('0x34')]['includeAll']){_0x3b990e[_0x0fbf('0x49')]=[{'all':!![]}];}_0x3b990e=_[_0x0fbf('0x3f')]({},_0x3b990e,_0xdb619b['options']);return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')](_0x3b990e)['then'](handleEntityNotFound(_0x4b6d43,null))[_0x0fbf('0x24')](respondWithResult(_0x4b6d43,null))[_0x0fbf('0x45')](handleError(_0x4b6d43,null));};exports[_0x0fbf('0x4b')]=function(_0x2ee0c6,_0x1c7b80){return db[_0x0fbf('0x2f')]['create'](_0x2ee0c6[_0x0fbf('0x4c')],{})['then'](function(_0x346cf1){var _0x4d2db7=_0x2ee0c6['user'][_0x0fbf('0x25')]({'plain':!![]});if(!_0x4d2db7)throw new Error(_0x0fbf('0x4d'));if(_0x4d2db7[_0x0fbf('0x4e')]==='user'){var _0x356220=_0x346cf1[_0x0fbf('0x25')]({'plain':!![]});var _0x238092=_0x0fbf('0x26');return db[_0x0fbf('0x4f')][_0x0fbf('0x4a')]({'where':{'name':_0x238092,'userProfileId':_0x4d2db7['userProfileId']},'raw':!![]})[_0x0fbf('0x24')](function(_0x5d414f){if(_0x5d414f&&_0x5d414f[_0x0fbf('0x50')]===0x0){return db[_0x0fbf('0x27')][_0x0fbf('0x4b')]({'name':_0x356220[_0x0fbf('0x2c')],'resourceId':_0x356220['id'],'type':_0x5d414f[_0x0fbf('0x2c')],'sectionId':_0x5d414f['id']},{})['then'](function(){return _0x346cf1;});}else{return _0x346cf1;}})[_0x0fbf('0x45')](function(_0x205ae9){logger[_0x0fbf('0x2a')](_0x0fbf('0x51'),_0x205ae9);throw _0x205ae9;});}return _0x346cf1;})[_0x0fbf('0x24')](respondWithResult(_0x1c7b80,0xc9))[_0x0fbf('0x45')](handleError(_0x1c7b80,null));};exports[_0x0fbf('0x23')]=function(_0x281894,_0x28a732){if(_0x281894[_0x0fbf('0x4c')]['id']){delete _0x281894[_0x0fbf('0x4c')]['id'];}return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x281894[_0x0fbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x28a732,null))['then'](saveUpdates(_0x281894[_0x0fbf('0x4c')],null))[_0x0fbf('0x24')](respondWithResult(_0x28a732,null))[_0x0fbf('0x45')](handleError(_0x28a732,null));};exports['destroy']=function(_0x48b772,_0x4f40f9){return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x48b772[_0x0fbf('0x47')]['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x4f40f9,null))[_0x0fbf('0x24')](removeEntity(_0x4f40f9,null))[_0x0fbf('0x45')](handleError(_0x4f40f9,null));};exports[_0x0fbf('0x52')]=function(_0x249bab,_0x28d433,_0x36be40){if(_0x249bab['body']['id']){delete _0x249bab[_0x0fbf('0x4c')]['id'];}return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x249bab['params']['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x28d433,null))[_0x0fbf('0x24')](function(_0x41f9b3){if(_0x41f9b3){_0x249bab[_0x0fbf('0x4c')][_0x0fbf('0x53')]=_0x41f9b3['id'];return db[_0x0fbf('0x2f')][_0x0fbf('0x4b')](_0x249bab[_0x0fbf('0x4c')]);}})[_0x0fbf('0x24')](respondWithResult(_0x28d433,null))[_0x0fbf('0x45')](handleError(_0x28d433,null));};exports[_0x0fbf('0x54')]=function(_0x3076b9,_0x4f2865,_0x4a62dd){var _0x2cb19a={};var _0xa736d5={};var _0x3ccaff;var _0x42bc50;return db[_0x0fbf('0x2f')][_0x0fbf('0x55')]({'where':{'id':_0x3076b9[_0x0fbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f2865,null))[_0x0fbf('0x24')](function(_0x39b46e){if(_0x39b46e){_0x3ccaff=_0x39b46e;_0xa736d5[_0x0fbf('0x33')]=_[_0x0fbf('0x35')](db[_0x0fbf('0x2f')][_0x0fbf('0x30')]);_0xa736d5['query']=_['keys'](_0x3076b9[_0x0fbf('0x34')]);_0xa736d5[_0x0fbf('0x36')]=_['intersection'](_0xa736d5[_0x0fbf('0x33')],_0xa736d5[_0x0fbf('0x34')]);_0x2cb19a['attributes']=_[_0x0fbf('0x38')](_0xa736d5[_0x0fbf('0x33')],qs[_0x0fbf('0x39')](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x39')]));_0x2cb19a[_0x0fbf('0x37')]=_0x2cb19a[_0x0fbf('0x37')]['length']?_0x2cb19a['attributes']:_0xa736d5[_0x0fbf('0x33')];_0x2cb19a[_0x0fbf('0x3b')]=qs[_0x0fbf('0x3c')](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x3c')]);_0x2cb19a[_0x0fbf('0x3d')]=qs[_0x0fbf('0x36')](_['pick'](_0x3076b9[_0x0fbf('0x34')],_0xa736d5[_0x0fbf('0x36')]));if(_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x56')]){_0x2cb19a[_0x0fbf('0x3d')]=_[_0x0fbf('0x3f')](_0x2cb19a[_0x0fbf('0x3d')],{'$or':_[_0x0fbf('0x57')](_0x2cb19a[_0x0fbf('0x37')],function(_0x4de5c7){var _0x29df24={};_0x29df24[_0x4de5c7]={'$like':'%'+_0x3076b9['query']['filter']+'%'};return _0x29df24;})});}_0x2cb19a=_['merge']({},_0x2cb19a,_0x3076b9['options']);return _0x3ccaff[_0x0fbf('0x54')](_0x2cb19a);}})[_0x0fbf('0x24')](function(_0x40d9a7){if(_0x40d9a7){_0x42bc50=_0x40d9a7['length'];if(!_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x3a')](_0x0fbf('0x58'))){_0x2cb19a[_0x0fbf('0x1e')]=qs[_0x0fbf('0x1e')](_0x3076b9['query'][_0x0fbf('0x1e')]);_0x2cb19a[_0x0fbf('0x1c')]=qs['offset'](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x1c')]);}return _0x3ccaff[_0x0fbf('0x54')](_0x2cb19a);}})[_0x0fbf('0x24')](function(_0x41b984){if(_0x41b984){return _0x41b984?{'count':_0x42bc50,'rows':_0x41b984}:null;}})['then'](respondWithResult(_0x4f2865,null))[_0x0fbf('0x45')](handleError(_0x4f2865,null));};exports[_0x0fbf('0x59')]=function(_0x47a0df,_0x21e657,_0x3f5a15){return db[_0x0fbf('0x2f')][_0x0fbf('0x55')]({'where':{'id':_0x47a0df[_0x0fbf('0x47')]['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x21e657,null))[_0x0fbf('0x24')](function(_0x57dd3e){if(_0x57dd3e){return db['sequelize'][_0x0fbf('0x5a')](function(_0x48821d){return db['Interval'][_0x0fbf('0x28')]({'where':{'IntervalId':_0x47a0df[_0x0fbf('0x47')]['id']},'transaction':_0x48821d})['then'](function(_0x25961b){var _0x3835ff=_['map'](_0x47a0df[_0x0fbf('0x4c')],function(_0x3ac306){delete _0x3ac306['id'];_0x3ac306[_0x0fbf('0x53')]=_0x47a0df[_0x0fbf('0x47')]['id'];return _0x3ac306;});return db['Interval'][_0x0fbf('0x5b')](_0x3835ff,{'transaction':_0x48821d});});})['then'](function(){return db[_0x0fbf('0x2f')][_0x0fbf('0x43')]({'where':{'IntervalId':_0x47a0df[_0x0fbf('0x47')]['id']}});});}})[_0x0fbf('0x24')](respondWithResult(_0x21e657,null))[_0x0fbf('0x45')](handleError(_0x21e657,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index da42e24..d06508e 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 _0x981e=['string','getIntervals','then','all','map','ifTime','./interval.attributes','../../utils/iftime','iftime','exports','define','Interval','rewrite','interval'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x981e,0x1c6));var _0xe981=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x981e[_0x42cae2];return _0x5f256f;};'use strict';var attributes=require(_0xe981('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xe981('0x1'))[_0xe981('0x2')];module[_0xe981('0x3')]=function(_0xe2a28e){return _0xe2a28e[_0xe981('0x4')](_0xe981('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3348c6){extensions['rewrite'](_0xe2a28e,_0x3348c6);},'afterBulkCreate':function(_0x4edd01,_0x5716f5,_0x15eeeb){_0x15eeeb();extensions[_0xe981('0x6')](_0xe2a28e,_0x4edd01[0x0]);},'afterUpdate':function(_0x2305bc){extensions[_0xe981('0x6')](_0xe2a28e,_0x2305bc);},'afterDestroy':function(_0x59e83e){extensions[_0xe981('0x6')](_0xe2a28e,_0x59e83e);}},'instanceMethods':{'ifTime':function(_0xaa19fe=undefined,_0x40bb89=new Date()){if(typeof this[_0xe981('0x7')]===_0xe981('0x8')){return iftime(this[_0xe981('0x7')],_0xaa19fe,_0x40bb89);}else{return this[_0xe981('0x9')]()[_0xe981('0xa')](function(_0xd72cf7){return Promise[_0xe981('0xb')](_0xd72cf7[_0xe981('0xc')](function(_0x5205f2){return _0x5205f2[_0xe981('0xd')](_0xaa19fe,_0x40bb89);}));})[_0xe981('0xa')](function(_0x2910a5){return _0x2910a5['reduce'](function(_0x23b841,_0x5e830f){return _0x23b841||_0x5e830f;},![]);});}}}});}; \ No newline at end of file +var _0x439a=['define','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','all','reduce','iftime','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x439a,0x8e));var _0xa439=function(_0x124da8,_0x2f4adf){_0x124da8=_0x124da8-0x0;var _0x470b89=_0x439a[_0x124da8];return _0x470b89;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xa439('0x0')];module[_0xa439('0x1')]=function(_0x1a435b){return _0x1a435b[_0xa439('0x2')](_0xa439('0x3'),attributes,{'tableName':_0xa439('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xaba966){extensions[_0xa439('0x5')](_0x1a435b,_0xaba966);},'afterBulkCreate':function(_0x315421,_0x152ab7,_0xa7c814){_0xa7c814();extensions['rewrite'](_0x1a435b,_0x315421[0x0]);},'afterUpdate':function(_0x3b9e5d){extensions[_0xa439('0x5')](_0x1a435b,_0x3b9e5d);},'afterDestroy':function(_0x5b5f40){extensions[_0xa439('0x5')](_0x1a435b,_0x5b5f40);}},'instanceMethods':{'ifTime':function(_0x7514a7=undefined,_0x14aa63=new Date()){if(typeof this['interval']===_0xa439('0x6')){return iftime(this[_0xa439('0x7')],_0x7514a7,_0x14aa63);}else{return this[_0xa439('0x8')]()[_0xa439('0x9')](function(_0x56e0ec){return Promise[_0xa439('0xa')](_0x56e0ec['map'](function(_0x131ec1){return _0x131ec1['ifTime'](_0x7514a7,_0x14aa63);}));})[_0xa439('0x9')](function(_0x2297b5){return _0x2297b5[_0xa439('0xb')](function(_0x2d5823,_0x2931c1){return _0x2d5823||_0x2931c1;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 5350b4b..503726f 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 _0x16e8=['error','message','ShowInterval','find','Interval','ifTime','reduce','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','format','resolve','lodash','util','../../config/logger','rpc','GetInterval','findAll','raw','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x16e8,0x173));var _0x816e=function(_0x105699,_0x10f48e){_0x105699=_0x105699-0x0;var _0x53c233=_0x16e8[_0x105699];return _0x53c233;};'use strict';var _=require(_0x816e('0x0'));var util=require(_0x816e('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require(_0x816e('0x2'))(_0x816e('0x3'));exports[_0x816e('0x4')]=function(_0x3ff53d){var _0x1f35fe=this;return new Promise(function(_0x4fd2ba,_0x32bfac){return db['Interval'][_0x816e('0x5')]({'raw':_0x3ff53d['options']?_0x3ff53d['options'][_0x816e('0x6')]===undefined?!![]:![]:!![],'where':_0x3ff53d[_0x816e('0x7')]?_0x3ff53d['options'][_0x816e('0x8')]||null:null,'attributes':_0x3ff53d[_0x816e('0x7')]?_0x3ff53d[_0x816e('0x7')][_0x816e('0x9')]||null:null,'limit':_0x3ff53d[_0x816e('0x7')]?_0x3ff53d[_0x816e('0x7')][_0x816e('0xa')]||null:null,'include':_0x3ff53d[_0x816e('0x7')]?_0x3ff53d[_0x816e('0x7')][_0x816e('0xb')]?_[_0x816e('0xc')](_0x3ff53d['options']['include'],function(_0x24fcd2){return{'model':db[_0x24fcd2[_0x816e('0xd')]],'as':_0x24fcd2['as'],'attributes':_0x24fcd2[_0x816e('0x9')],'include':_0x24fcd2[_0x816e('0xb')]?_[_0x816e('0xc')](_0x24fcd2[_0x816e('0xb')],function(_0x4614b1){return{'model':db[_0x4614b1[_0x816e('0xd')]],'as':_0x4614b1['as'],'attributes':_0x4614b1['attributes'],'include':_0x4614b1[_0x816e('0xb')]?_[_0x816e('0xc')](_0x4614b1[_0x816e('0xb')],function(_0x2bcbeb){return{'model':db[_0x2bcbeb[_0x816e('0xd')]],'as':_0x2bcbeb['as'],'attributes':_0x2bcbeb[_0x816e('0x9')]};}):[]};}):[]};}):[]:[]})[_0x816e('0xe')](function(_0x5957a5){logger[_0x816e('0xf')]('GetInterval',_0x3ff53d);logger[_0x816e('0x10')](_0x816e('0x4'),_0x3ff53d,JSON[_0x816e('0x11')](_0x5957a5));_0x4fd2ba(_0x5957a5);})[_0x816e('0x12')](function(_0x58418e){logger[_0x816e('0x13')](_0x816e('0x4'),_0x58418e[_0x816e('0x14')],_0x3ff53d);_0x32bfac(_0x1f35fe['error'](0x1f4,_0x58418e['message']));});});};exports[_0x816e('0x15')]=function(_0x7c85d9){var _0x3f8421=this;return new Promise(function(_0x47ba97,_0x5b99c7){return db['Interval'][_0x816e('0x16')]({'raw':_0x7c85d9[_0x816e('0x7')]?_0x7c85d9[_0x816e('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x7c85d9[_0x816e('0x7')]?_0x7c85d9[_0x816e('0x7')][_0x816e('0x8')]||null:null,'attributes':_0x7c85d9['options']?_0x7c85d9['options'][_0x816e('0x9')]||null:null,'include':_0x7c85d9[_0x816e('0x7')]?_0x7c85d9['options'][_0x816e('0xb')]?_[_0x816e('0xc')](_0x7c85d9[_0x816e('0x7')]['include'],function(_0x4ce592){return{'model':db[_0x4ce592['model']],'as':_0x4ce592['as'],'attributes':_0x4ce592[_0x816e('0x9')],'include':_0x4ce592['include']?_[_0x816e('0xc')](_0x4ce592[_0x816e('0xb')],function(_0x3c32eb){return{'model':db[_0x3c32eb['model']],'as':_0x3c32eb['as'],'attributes':_0x3c32eb['attributes'],'include':_0x3c32eb[_0x816e('0xb')]?_[_0x816e('0xc')](_0x3c32eb[_0x816e('0xb')],function(_0x58939f){return{'model':db[_0x58939f[_0x816e('0xd')]],'as':_0x58939f['as'],'attributes':_0x58939f[_0x816e('0x9')]};}):[]};}):[]};}):[]:[]})[_0x816e('0xe')](function(_0x19cf7){logger['info'](_0x816e('0x15'),_0x7c85d9);logger[_0x816e('0x10')](_0x816e('0x15'),_0x7c85d9,JSON[_0x816e('0x11')](_0x19cf7));_0x47ba97(_0x19cf7);})[_0x816e('0x12')](function(_0x80426e){logger[_0x816e('0x13')](_0x816e('0x15'),_0x80426e[_0x816e('0x14')],_0x7c85d9);_0x5b99c7(_0x3f8421[_0x816e('0x13')](0x1f4,_0x80426e[_0x816e('0x14')]));});});};function checkArrayOfIntervals(_0x491575,_0x3a4e5b){var _0x2c4502=[];return db[_0x816e('0x17')][_0x816e('0x5')]({'where':{'id':_0x491575}})['then'](function(_0x3423f8){_0x2c4502=_0x3423f8;return Promise['all'](_0x2c4502['map'](function(_0x421f86){return _0x421f86[_0x816e('0x18')](_0x3a4e5b);}));})[_0x816e('0xe')](function(_0x570b61){var _0x3f2cc8=_0x570b61[_0x816e('0x19')](function(_0x2f7a75,_0x43b090){return _0x2f7a75||_0x43b090;},![]);logger[_0x816e('0xf')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x2c4502['map'](function(_0x830ef0){return _0x830ef0[_0x816e('0x1a')];})[_0x816e('0x1b')](',\x20'),_0x2c4502[_0x816e('0xc')](function(_0x435248){return _0x435248['id'];})[_0x816e('0x1b')](',\x20')));return _0x3f2cc8;});}function checkSingleInterval(_0xc6c075,_0x146098){return db[_0x816e('0x17')]['findById'](_0xc6c075)[_0x816e('0xe')](function(_0x170328){if(_0x170328){logger[_0x816e('0xf')](util['format'](_0x816e('0x1c'),_0x170328[_0x816e('0x1a')],_0x170328['id']));return _0x170328['ifTime'](_0x146098);}});}exports[_0x816e('0x1d')]=function(_0xfcd09){var _0x1e52d0=_0xfcd09[_0x816e('0x1e')];var _0x2e52f0=Array[_0x816e('0x1f')](_0xfcd09[_0x816e('0x20')])?_0xfcd09[_0x816e('0x20')]:typeof _0xfcd09[_0x816e('0x20')]===_0x816e('0x21')?[_0xfcd09[_0x816e('0x20')]]:[];var _0x2c586d=_0xfcd09[_0x816e('0x22')]||undefined;var _0x54a5c2=![];if(_0x2e52f0[_0x816e('0x23')]){logger[_0x816e('0xf')](util['format'](_0x816e('0x24'),_0x2e52f0[_0x816e('0x1b')](';\x20')));}if(_0x2c586d){logger[_0x816e('0xf')](util[_0x816e('0x25')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x2c586d));}logger[_0x816e('0x10')]('Iftime',_0x54a5c2);logger['silly'](_0x816e('0x1d'),_0xfcd09);return Promise[_0x816e('0x26')]()[_0x816e('0xe')](function(){if(Array[_0x816e('0x1f')](_0x1e52d0)){return checkArrayOfIntervals(_0x1e52d0,_0x2c586d);}else if(_0x1e52d0){return checkSingleInterval(_0x1e52d0,_0x2c586d);}})[_0x816e('0xe')](function(_0x4cdfc0){var _0x5906d4=_0x2e52f0[_0x816e('0x19')](function(_0x530686,_0x43b7ac){return _0x530686||iftime(_0x43b7ac,_0x2c586d);},![]);_0x54a5c2=_0x4cdfc0||_0x5906d4;return _0x54a5c2;})[_0x816e('0x12')](function(_0x42390c){logger[_0x816e('0x13')](_0x816e('0x1d'),_0xfcd09,_0x42390c);throw this[_0x816e('0x13')](0x1f4,_0x42390c[_0x816e('0x14')]);});}; \ No newline at end of file +var _0xc20b=['error','message','ShowInterval','find','findAll','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','GetInterval','Interval','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','catch'];(function(_0x2417f9,_0x803ba4){var _0x142d82=function(_0xd430d1){while(--_0xd430d1){_0x2417f9['push'](_0x2417f9['shift']());}};_0x142d82(++_0x803ba4);}(_0xc20b,0x19a));var _0xbc20=function(_0x416e13,_0x42c655){_0x416e13=_0x416e13-0x0;var _0x1386f3=_0xc20b[_0x416e13];return _0x1386f3;};'use strict';var _=require(_0xbc20('0x0'));var util=require(_0xbc20('0x1'));var db=require(_0xbc20('0x2'))['db'];var iftime=require(_0xbc20('0x3'))['iftime'];var logger=require(_0xbc20('0x4'))('rpc');exports[_0xbc20('0x5')]=function(_0x102161){var _0x53a607=this;return new Promise(function(_0x24c9a8,_0x3b8420){return db[_0xbc20('0x6')]['findAll']({'raw':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0x8')]===undefined?!![]:![]:!![],'where':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0x9')]||null:null,'attributes':_0x102161[_0xbc20('0x7')]?_0x102161['options'][_0xbc20('0xa')]||null:null,'limit':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0xb')]||null:null,'include':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')]['include']?_[_0xbc20('0xc')](_0x102161[_0xbc20('0x7')][_0xbc20('0xd')],function(_0xfc3de4){return{'model':db[_0xfc3de4[_0xbc20('0xe')]],'as':_0xfc3de4['as'],'attributes':_0xfc3de4['attributes'],'include':_0xfc3de4[_0xbc20('0xd')]?_[_0xbc20('0xc')](_0xfc3de4['include'],function(_0x453c6e){return{'model':db[_0x453c6e[_0xbc20('0xe')]],'as':_0x453c6e['as'],'attributes':_0x453c6e[_0xbc20('0xa')],'include':_0x453c6e[_0xbc20('0xd')]?_['map'](_0x453c6e[_0xbc20('0xd')],function(_0x5e3775){return{'model':db[_0x5e3775[_0xbc20('0xe')]],'as':_0x5e3775['as'],'attributes':_0x5e3775[_0xbc20('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbc20('0xf')](function(_0x4b0a17){logger[_0xbc20('0x10')](_0xbc20('0x5'),_0x102161);logger[_0xbc20('0x11')](_0xbc20('0x5'),_0x102161,JSON[_0xbc20('0x12')](_0x4b0a17));_0x24c9a8(_0x4b0a17);})[_0xbc20('0x13')](function(_0x9f547b){logger[_0xbc20('0x14')](_0xbc20('0x5'),_0x9f547b[_0xbc20('0x15')],_0x102161);_0x3b8420(_0x53a607['error'](0x1f4,_0x9f547b[_0xbc20('0x15')]));});});};exports[_0xbc20('0x16')]=function(_0x2e0e92){var _0x5084f8=this;return new Promise(function(_0x44f5f3,_0x5099c5){return db[_0xbc20('0x6')][_0xbc20('0x17')]({'raw':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0x9')]||null:null,'attributes':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xa')]||null:null,'include':_0x2e0e92['options']?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xd')]?_['map'](_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xd')],function(_0x491eec){return{'model':db[_0x491eec['model']],'as':_0x491eec['as'],'attributes':_0x491eec[_0xbc20('0xa')],'include':_0x491eec[_0xbc20('0xd')]?_['map'](_0x491eec[_0xbc20('0xd')],function(_0x1208e2){return{'model':db[_0x1208e2[_0xbc20('0xe')]],'as':_0x1208e2['as'],'attributes':_0x1208e2[_0xbc20('0xa')],'include':_0x1208e2[_0xbc20('0xd')]?_[_0xbc20('0xc')](_0x1208e2[_0xbc20('0xd')],function(_0x30279d){return{'model':db[_0x30279d['model']],'as':_0x30279d['as'],'attributes':_0x30279d[_0xbc20('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbc20('0xf')](function(_0x31040d){logger['info'](_0xbc20('0x16'),_0x2e0e92);logger[_0xbc20('0x11')](_0xbc20('0x16'),_0x2e0e92,JSON[_0xbc20('0x12')](_0x31040d));_0x44f5f3(_0x31040d);})[_0xbc20('0x13')](function(_0x1068a8){logger[_0xbc20('0x14')](_0xbc20('0x16'),_0x1068a8[_0xbc20('0x15')],_0x2e0e92);_0x5099c5(_0x5084f8['error'](0x1f4,_0x1068a8[_0xbc20('0x15')]));});});};function checkArrayOfIntervals(_0x425524,_0x37f55b){var _0x2b2922=[];return db['Interval'][_0xbc20('0x18')]({'where':{'id':_0x425524}})['then'](function(_0xe6fb75){_0x2b2922=_0xe6fb75;return Promise[_0xbc20('0x19')](_0x2b2922[_0xbc20('0xc')](function(_0x45c70d){return _0x45c70d['ifTime'](_0x37f55b);}));})['then'](function(_0x3976ef){var _0x554b1d=_0x3976ef[_0xbc20('0x1a')](function(_0x55df96,_0x48064f){return _0x55df96||_0x48064f;},![]);logger[_0xbc20('0x10')](util[_0xbc20('0x1b')](_0xbc20('0x1c'),_0x2b2922[_0xbc20('0xc')](function(_0xb17ef2){return _0xb17ef2[_0xbc20('0x1d')];})['join'](',\x20'),_0x2b2922[_0xbc20('0xc')](function(_0x49753f){return _0x49753f['id'];})[_0xbc20('0x1e')](',\x20')));return _0x554b1d;});}function checkSingleInterval(_0x544601,_0x4e07ca){return db[_0xbc20('0x6')]['findById'](_0x544601)['then'](function(_0x4e6a5d){if(_0x4e6a5d){logger['info'](util[_0xbc20('0x1b')](_0xbc20('0x1f'),_0x4e6a5d[_0xbc20('0x1d')],_0x4e6a5d['id']));return _0x4e6a5d[_0xbc20('0x20')](_0x4e07ca);}});}exports['IntervalIftime']=function(_0xe424d){var _0x22dca4=_0xe424d[_0xbc20('0x21')];var _0x586429=Array[_0xbc20('0x22')](_0xe424d['intervals'])?_0xe424d['intervals']:typeof _0xe424d[_0xbc20('0x23')]===_0xbc20('0x24')?[_0xe424d['intervals']]:[];var _0x49379b=_0xe424d[_0xbc20('0x25')]||undefined;var _0x54748c=![];if(_0x586429[_0xbc20('0x26')]){logger['info'](util['format'](_0xbc20('0x27'),_0x586429[_0xbc20('0x1e')](';\x20')));}if(_0x49379b){logger[_0xbc20('0x10')](util[_0xbc20('0x1b')](_0xbc20('0x28'),_0x49379b));}logger['debug']('Iftime',_0x54748c);logger[_0xbc20('0x29')](_0xbc20('0x2a'),_0xe424d);return Promise['resolve']()[_0xbc20('0xf')](function(){if(Array[_0xbc20('0x22')](_0x22dca4)){return checkArrayOfIntervals(_0x22dca4,_0x49379b);}else if(_0x22dca4){return checkSingleInterval(_0x22dca4,_0x49379b);}})[_0xbc20('0xf')](function(_0xce4b3f){var _0x1705dd=_0x586429[_0xbc20('0x1a')](function(_0xdf9ece,_0x2cf2f5){return _0xdf9ece||iftime(_0x2cf2f5,_0x49379b);},![]);_0x54748c=_0xce4b3f||_0x1705dd;return _0x54748c;})[_0xbc20('0x13')](function(_0x1ac5fd){logger[_0xbc20('0x14')](_0xbc20('0x2a'),_0xe424d,_0x1ac5fd);throw this[_0xbc20('0x14')](0x1f4,_0x1ac5fd['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ea5f4d0..0b9229f 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xff28cc,_0x2f80b8){_0xff28cc=_0xff28cc-0x0;var _0x43d801=_0x5f2f[_0xff28cc];return _0x43d801;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a1e5740..5bd013c 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 _0x859b=['Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','request','setEncoding','utf8','data','end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','key','MOTGUI'];(function(_0x55b35d,_0x55fbb8){var _0x599818=function(_0x131d18){while(--_0x131d18){_0x55b35d['push'](_0x55b35d['shift']());}};_0x599818(++_0x55fbb8);}(_0x859b,0x9e));var _0xb859=function(_0x5ef2db,_0x21cb97){_0x5ef2db=_0x5ef2db-0x0;var _0x47eb89=_0x859b[_0x5ef2db];return _0x47eb89;};'use strict';var BPromise=require(_0xb859('0x0'));var https=require('https');var logger=require(_0xb859('0x1'))(_0xb859('0x2'));var USERNAME=_0xb859('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5dba3e,_0x239e78){var _0x2f4f59={'fields':{'project':{'key':_0x5dba3e[_0xb859('0x4')]||_0xb859('0x5')},'summary':(_0x5dba3e['summary']||_0xb859('0x6'))+_0xb859('0x7')+_0x5dba3e['ip'],'description':_0x5dba3e[_0xb859('0x8')]||JSON[_0xb859('0x9')](_0x5dba3e),'issuetype':{'name':_0x5dba3e['issuetype']||_0xb859('0xa')}}};_0x2f4f59[_0xb859('0xb')]['customfield_11500']=_0x5dba3e[_0xb859('0xc')];_0x2f4f59[_0xb859('0xb')][_0xb859('0xd')]=_0x5dba3e['oldToken'];_0x2f4f59[_0xb859('0xb')][_0xb859('0xe')]=_0x5dba3e['newToken'];_0x2f4f59[_0xb859('0xb')][_0xb859('0xf')]=_0x5dba3e[_0xb859('0x10')];_0x2f4f59['fields'][_0xb859('0x11')]=_0x5dba3e[_0xb859('0x12')];_0x2f4f59[_0xb859('0xb')][_0xb859('0x13')]=_0x5dba3e['ip'];var _0x2ea651={'host':_0xb859('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xb859('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xb859('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x16898a=JSON['stringify'](_0x2f4f59);var _0x544421=https[_0xb859('0x17')](_0x2ea651,function(_0x11a71b){_0x11a71b[_0xb859('0x18')](_0xb859('0x19'));var _0x250ec4='';_0x11a71b['on'](_0xb859('0x1a'),function(_0x2b7a44){_0x250ec4+=_0x2b7a44;});_0x11a71b['on'](_0xb859('0x1b'),function(){if(_0x239e78){return _0x239e78[_0xb859('0x1c')](_0x11a71b['statusCode'])[_0xb859('0x1d')](JSON[_0xb859('0x1e')](_0x250ec4));}});});_0x544421['on']('error',function(_0x15a995){if(_0x239e78){return _0x239e78['status'](0x1f4)[_0xb859('0x1d')]({'errors':[{'message':_0xb859('0x1f'),'type':'api.jira'}]});}});_0x544421[_0xb859('0x20')](_0x16898a);_0x544421[_0xb859('0x1b')]();}exports[_0xb859('0x21')]=openIssue;exports[_0xb859('0x22')]=function(_0x41b768,_0x105de6){_0x41b768[_0xb859('0x23')]['ip']=_0x41b768[_0xb859('0x24')][_0xb859('0x25')]||_0x41b768[_0xb859('0x26')][_0xb859('0x27')]||_0x41b768[_0xb859('0x28')]['remoteAddress']||_0x41b768[_0xb859('0x26')][_0xb859('0x28')]['remoteAddress'];return openIssue(_0x41b768[_0xb859('0x23')],_0x105de6);}; \ No newline at end of file +var _0x0273=['customfield_10102','POST','application/json','Basic\x20','toString','base64','stringify','request','utf8','data','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','MOTGUI','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504'];(function(_0x802ff7,_0x3ca9cc){var _0xa81f15=function(_0x3429fc){while(--_0x3429fc){_0x802ff7['push'](_0x802ff7['shift']());}};_0xa81f15(++_0x3ca9cc);}(_0x0273,0xe9));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3027('0x0'));var https=require(_0x3027('0x1'));var logger=require(_0x3027('0x2'))(_0x3027('0x3'));var USERNAME=_0x3027('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x56ba95,_0x600cd1){var _0x2b44f3={'fields':{'project':{'key':_0x56ba95['key']||_0x3027('0x5')},'summary':(_0x56ba95['summary']||_0x3027('0x6'))+_0x3027('0x7')+_0x56ba95['ip'],'description':_0x56ba95['description']||JSON['stringify'](_0x56ba95),'issuetype':{'name':_0x56ba95[_0x3027('0x8')]||_0x3027('0x9')}}};_0x2b44f3[_0x3027('0xa')][_0x3027('0xb')]=_0x56ba95[_0x3027('0xc')];_0x2b44f3['fields'][_0x3027('0xd')]=_0x56ba95[_0x3027('0xe')];_0x2b44f3[_0x3027('0xa')]['customfield_11502']=_0x56ba95[_0x3027('0xf')];_0x2b44f3[_0x3027('0xa')][_0x3027('0x10')]=_0x56ba95[_0x3027('0x11')];_0x2b44f3[_0x3027('0xa')][_0x3027('0x12')]=_0x56ba95['reason'];_0x2b44f3[_0x3027('0xa')][_0x3027('0x13')]=_0x56ba95['ip'];var _0x1d9972={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x3027('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x3027('0x15'),'Authorization':_0x3027('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x3027('0x17')](_0x3027('0x18'))}};var _0x459763=JSON[_0x3027('0x19')](_0x2b44f3);var _0x4fd1bd=https[_0x3027('0x1a')](_0x1d9972,function(_0x81eebe){_0x81eebe['setEncoding'](_0x3027('0x1b'));var _0x1fb50e='';_0x81eebe['on'](_0x3027('0x1c'),function(_0x97a4ba){_0x1fb50e+=_0x97a4ba;});_0x81eebe['on'](_0x3027('0x1d'),function(){if(_0x600cd1){return _0x600cd1['status'](_0x81eebe[_0x3027('0x1e')])[_0x3027('0x1f')](JSON['parse'](_0x1fb50e));}});});_0x4fd1bd['on']('error',function(_0x283d62){if(_0x600cd1){return _0x600cd1[_0x3027('0x20')](0x1f4)[_0x3027('0x1f')]({'errors':[{'message':_0x3027('0x21'),'type':_0x3027('0x22')}]});}});_0x4fd1bd[_0x3027('0x23')](_0x459763);_0x4fd1bd[_0x3027('0x1d')]();}exports[_0x3027('0x24')]=openIssue;exports[_0x3027('0x25')]=function(_0x4e6880,_0x366dd6){_0x4e6880[_0x3027('0x26')]['ip']=_0x4e6880['headers']['x-forwarded-for']||_0x4e6880['connection'][_0x3027('0x27')]||_0x4e6880[_0x3027('0x28')]['remoteAddress']||_0x4e6880[_0x3027('0x29')]['socket'][_0x3027('0x27')];return openIssue(_0x4e6880[_0x3027('0x26')],_0x366dd6);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9c6daf0..98fe25e 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 _0xe14d=['isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x404459,_0x2a7cd1){var _0x44641f=function(_0x3518be){while(--_0x3518be){_0x404459['push'](_0x404459['shift']());}};_0x44641f(++_0x2a7cd1);}(_0xe14d,0x1ee));var _0xde14=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe14d[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/describe',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')]('/',auth[_0xde14('0xa')](),controller['create']);router[_0xde14('0x10')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x11')]);router[_0xde14('0x12')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x596921,_0x71146d){var _0x4b3ed0=function(_0x4c591c){while(--_0x4c591c){_0x596921['push'](_0x596921['shift']());}};_0x4b3ed0(++_0x71146d);}(_0x91a7,0xe7));var _0x791a=function(_0x4c2fcc,_0x3050fb){_0x4c2fcc=_0x4c2fcc-0x0;var _0x1e23fa=_0x91a7[_0x4c2fcc];return _0x1e23fa;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);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 178a6d1..5f2d6ae 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x233c88,_0x3af100){_0x233c88=_0x233c88-0x0;var _0x5bb333=_0x7a54[_0x233c88];return _0x5bb333;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1a5bb8,_0x46d858){_0x1a5bb8=_0x1a5bb8-0x0;var _0x4ab559=_0x7a54[_0x1a5bb8];return _0x4ab559;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 1d5d588..8cad8e2 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 _0x7118=['stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x28868e,_0x1217a7){var _0xde3a7d=function(_0x41744a){while(--_0x41744a){_0x28868e['push'](_0x28868e['shift']());}};_0xde3a7d(++_0x1217a7);}(_0x7118,0x159));var _0x8711=function(_0x2227c1,_0x3a1b27){_0x2227c1=_0x2227c1-0x0;var _0x120f5b=_0x7118[_0x2227c1];return _0x120f5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8711('0x0'));var jsonpatch=require(_0x8711('0x1'));var rp=require('request-promise');var moment=require(_0x8711('0x2'));var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8711('0x9'));var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x13'));var logger=require(_0x8711('0x14'))(_0x8711('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8711('0x16'));var db=require(_0x8711('0x17'))['db'];function respondWithStatusCode(_0x5d2c38,_0x49b241){_0x49b241=_0x49b241||0xcc;return function(_0x11adb0){if(_0x11adb0){return _0x5d2c38[_0x8711('0x18')](_0x49b241);}return _0x5d2c38[_0x8711('0x19')](_0x49b241)[_0x8711('0x1a')]();};}function respondWithResult(_0xc0a891,_0x22f434){_0x22f434=_0x22f434||0xc8;return function(_0x16b742){if(_0x16b742){return _0xc0a891['status'](_0x22f434)[_0x8711('0x1b')](_0x16b742);}};}function respondWithFilteredResult(_0x363bcd,_0x13f394){return function(_0x2e12ec){if(_0x2e12ec){var _0x3ab905=typeof _0x13f394[_0x8711('0x1c')]==='undefined'&&typeof _0x13f394[_0x8711('0x1d')]===_0x8711('0x1e');var _0x1c2cb5=_0x2e12ec[_0x8711('0x1f')];var _0x19a157=_0x3ab905?0x0:_0x13f394['offset'];var _0x5b2bf8=_0x3ab905?_0x2e12ec['count']:_0x13f394[_0x8711('0x1c')]+_0x13f394[_0x8711('0x1d')];var _0x2f6134;if(_0x5b2bf8>=_0x1c2cb5){_0x5b2bf8=_0x1c2cb5;_0x2f6134=0xc8;}else{_0x2f6134=0xce;}_0x363bcd['status'](_0x2f6134);return _0x363bcd['set'](_0x8711('0x20'),_0x19a157+'-'+_0x5b2bf8+'/'+_0x1c2cb5)[_0x8711('0x1b')](_0x2e12ec);}return null;};}function patchUpdates(_0x1209e0){return function(_0x44b948){try{jsonpatch[_0x8711('0x21')](_0x44b948,_0x1209e0,!![]);}catch(_0x270081){return BPromise[_0x8711('0x22')](_0x270081);}return _0x44b948[_0x8711('0x23')]();};}function saveUpdates(_0xace829,_0x41369d){return function(_0x4a35f5){if(_0x4a35f5){return _0x4a35f5[_0x8711('0x24')](_0xace829)[_0x8711('0x25')](function(_0x3302b9){return _0x3302b9;});}return null;};}function removeEntity(_0x939ef3,_0x4cf830){return function(_0x27cafd){if(_0x27cafd){return _0x27cafd[_0x8711('0x26')]()[_0x8711('0x25')](function(){_0x939ef3['status'](0xcc)[_0x8711('0x1a')]();});}};}function handleEntityNotFound(_0x17bf7f,_0x3e8281){return function(_0x217197){if(!_0x217197){_0x17bf7f[_0x8711('0x18')](0x194);}return _0x217197;};}function handleError(_0x514956,_0x494683){_0x494683=_0x494683||0x1f4;return function(_0x515a74){logger[_0x8711('0x27')](_0x515a74[_0x8711('0x28')]);if(_0x515a74[_0x8711('0x29')]){delete _0x515a74[_0x8711('0x29')];}_0x514956[_0x8711('0x19')](_0x494683)[_0x8711('0x2a')](_0x515a74);};}exports[_0x8711('0x2b')]=function(_0x3ca2b5,_0x398097){var _0x47e7b7={},_0x27db5d={},_0x591380={'count':0x0,'rows':[]};var _0x28c2d5=_[_0x8711('0x2c')](db[_0x8711('0x2d')]['rawAttributes'],function(_0x440bc8){return{'name':_0x440bc8['fieldName'],'type':_0x440bc8[_0x8711('0x2e')][_0x8711('0x2f')]};});_0x27db5d[_0x8711('0x30')]=_['map'](_0x28c2d5,'name');_0x27db5d[_0x8711('0x31')]=_[_0x8711('0x32')](_0x3ca2b5[_0x8711('0x31')]);_0x27db5d[_0x8711('0x33')]=_[_0x8711('0x34')](_0x27db5d[_0x8711('0x30')],_0x27db5d[_0x8711('0x31')]);_0x47e7b7[_0x8711('0x35')]=_[_0x8711('0x34')](_0x27db5d[_0x8711('0x30')],qs['fields'](_0x3ca2b5[_0x8711('0x31')][_0x8711('0x36')]));_0x47e7b7[_0x8711('0x35')]=_0x47e7b7[_0x8711('0x35')][_0x8711('0x37')]?_0x47e7b7[_0x8711('0x35')]:_0x27db5d[_0x8711('0x30')];if(!_0x3ca2b5[_0x8711('0x31')][_0x8711('0x38')](_0x8711('0x39'))){_0x47e7b7['limit']=qs[_0x8711('0x1d')](_0x3ca2b5[_0x8711('0x31')][_0x8711('0x1d')]);_0x47e7b7[_0x8711('0x1c')]=qs[_0x8711('0x1c')](_0x3ca2b5['query'][_0x8711('0x1c')]);}_0x47e7b7[_0x8711('0x3a')]=qs[_0x8711('0x3b')](_0x3ca2b5['query'][_0x8711('0x3b')]);_0x47e7b7[_0x8711('0x3c')]=qs[_0x8711('0x33')](_[_0x8711('0x3d')](_0x3ca2b5[_0x8711('0x31')],_0x27db5d[_0x8711('0x33')]),_0x28c2d5);if(_0x3ca2b5[_0x8711('0x31')]['filter']){_0x47e7b7[_0x8711('0x3c')]=_[_0x8711('0x3e')](_0x47e7b7[_0x8711('0x3c')],{'$or':_[_0x8711('0x2c')](_0x28c2d5,function(_0x5a7e83){if(_0x5a7e83['type']!==_0x8711('0x3f')){var _0x18b82a={};_0x18b82a[_0x5a7e83[_0x8711('0x29')]]={'$like':'%'+_0x3ca2b5[_0x8711('0x31')][_0x8711('0x40')]+'%'};return _0x18b82a;}})});}_0x47e7b7=_[_0x8711('0x3e')]({},_0x47e7b7,_0x3ca2b5[_0x8711('0x41')]);var _0x2db474={'where':_0x47e7b7[_0x8711('0x3c')]};return db[_0x8711('0x2d')][_0x8711('0x1f')](_0x2db474)[_0x8711('0x25')](function(_0x1efd42){_0x591380[_0x8711('0x1f')]=_0x1efd42;if(_0x3ca2b5[_0x8711('0x31')][_0x8711('0x42')]){_0x47e7b7[_0x8711('0x43')]=[{'all':!![]}];}return db[_0x8711('0x2d')][_0x8711('0x44')](_0x47e7b7);})[_0x8711('0x25')](function(_0x2fb5e8){_0x591380['rows']=_0x2fb5e8;return _0x591380;})[_0x8711('0x25')](respondWithFilteredResult(_0x398097,_0x47e7b7))['catch'](handleError(_0x398097,null));};exports[_0x8711('0x45')]=function(_0x3d9562,_0x121971){var _0x38c0c4={'raw':!![],'where':{'id':_0x3d9562[_0x8711('0x46')]['id']}},_0x5f2c0c={};_0x5f2c0c[_0x8711('0x30')]=_[_0x8711('0x32')](db[_0x8711('0x2d')][_0x8711('0x47')]);_0x5f2c0c[_0x8711('0x31')]=_['keys'](_0x3d9562[_0x8711('0x31')]);_0x5f2c0c[_0x8711('0x33')]=_[_0x8711('0x34')](_0x5f2c0c[_0x8711('0x30')],_0x5f2c0c['query']);_0x38c0c4[_0x8711('0x35')]=_[_0x8711('0x34')](_0x5f2c0c[_0x8711('0x30')],qs[_0x8711('0x36')](_0x3d9562[_0x8711('0x31')]['fields']));_0x38c0c4['attributes']=_0x38c0c4[_0x8711('0x35')][_0x8711('0x37')]?_0x38c0c4['attributes']:_0x5f2c0c[_0x8711('0x30')];if(_0x3d9562[_0x8711('0x31')][_0x8711('0x42')]){_0x38c0c4[_0x8711('0x43')]=[{'all':!![]}];}_0x38c0c4=_['merge']({},_0x38c0c4,_0x3d9562[_0x8711('0x41')]);return db[_0x8711('0x2d')][_0x8711('0x48')](_0x38c0c4)['then'](handleEntityNotFound(_0x121971,null))[_0x8711('0x25')](respondWithResult(_0x121971,null))[_0x8711('0x49')](handleError(_0x121971,null));};exports['create']=function(_0x3e9ab1,_0x14a815){return db['JscriptyAnswerReport'][_0x8711('0x4a')](_0x3e9ab1[_0x8711('0x4b')],{})['then'](respondWithResult(_0x14a815,0xc9))[_0x8711('0x49')](handleError(_0x14a815,null));};exports[_0x8711('0x24')]=function(_0x1c55d8,_0x17a3f5){if(_0x1c55d8['body']['id']){delete _0x1c55d8[_0x8711('0x4b')]['id'];}return db[_0x8711('0x2d')]['find']({'where':{'id':_0x1c55d8[_0x8711('0x46')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x17a3f5,null))['then'](saveUpdates(_0x1c55d8['body'],null))['then'](respondWithResult(_0x17a3f5,null))['catch'](handleError(_0x17a3f5,null));};exports[_0x8711('0x26')]=function(_0x2efca0,_0x1c83f7){return db[_0x8711('0x2d')][_0x8711('0x48')]({'where':{'id':_0x2efca0[_0x8711('0x46')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x1c83f7,null))['then'](removeEntity(_0x1c83f7,null))['catch'](handleError(_0x1c83f7,null));};exports['describe']=function(_0x3b9e2b,_0x867599){return db[_0x8711('0x2d')][_0x8711('0x4c')]()[_0x8711('0x25')](respondWithResult(_0x867599,null))[_0x8711('0x49')](handleError(_0x867599,null));}; \ No newline at end of file +var _0x22da=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22da,0x80));var _0xa22d=function(_0x3bc530,_0xf2338c){_0x3bc530=_0x3bc530-0x0;var _0x2b7382=_0x22da[_0x3bc530];return _0x2b7382;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa22d('0x0'));var jsonpatch=require(_0xa22d('0x1'));var rp=require(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa22d('0x4'));var util=require(_0xa22d('0x5'));var path=require(_0xa22d('0x6'));var sox=require(_0xa22d('0x7'));var csv=require('to-csv');var ejs=require(_0xa22d('0x8'));var fs=require('fs');var fs_extra=require(_0xa22d('0x9'));var _=require('lodash');var squel=require(_0xa22d('0xa'));var crypto=require(_0xa22d('0xb'));var jsforce=require(_0xa22d('0xc'));var deskjs=require(_0xa22d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa22d('0xe'));var Redis=require(_0xa22d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa22d('0x10'));var as=require(_0xa22d('0x11'));var hardwareService=require(_0xa22d('0x12'));var logger=require(_0xa22d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa22d('0x14'));var licenseUtil=require(_0xa22d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184309,_0x515d6c){_0x515d6c=_0x515d6c||0xcc;return function(_0x983182){if(_0x983182){return _0x184309[_0xa22d('0x16')](_0x515d6c);}return _0x184309[_0xa22d('0x17')](_0x515d6c)['end']();};}function respondWithResult(_0x174a3f,_0x20d7f3){_0x20d7f3=_0x20d7f3||0xc8;return function(_0xc0d11d){if(_0xc0d11d){return _0x174a3f[_0xa22d('0x17')](_0x20d7f3)[_0xa22d('0x18')](_0xc0d11d);}};}function respondWithFilteredResult(_0x4dfa44,_0x132b1d){return function(_0x1b8627){if(_0x1b8627){var _0x2af5c6=typeof _0x132b1d[_0xa22d('0x19')]===_0xa22d('0x1a')&&typeof _0x132b1d[_0xa22d('0x1b')]===_0xa22d('0x1a');var _0x5e56a6=_0x1b8627[_0xa22d('0x1c')];var _0x3d78b9=_0x2af5c6?0x0:_0x132b1d[_0xa22d('0x19')];var _0x1ed22e=_0x2af5c6?_0x1b8627[_0xa22d('0x1c')]:_0x132b1d[_0xa22d('0x19')]+_0x132b1d[_0xa22d('0x1b')];var _0x184604;if(_0x1ed22e>=_0x5e56a6){_0x1ed22e=_0x5e56a6;_0x184604=0xc8;}else{_0x184604=0xce;}_0x4dfa44['status'](_0x184604);return _0x4dfa44[_0xa22d('0x1d')](_0xa22d('0x1e'),_0x3d78b9+'-'+_0x1ed22e+'/'+_0x5e56a6)[_0xa22d('0x18')](_0x1b8627);}return null;};}function patchUpdates(_0x4ed606){return function(_0x4c0aed){try{jsonpatch['apply'](_0x4c0aed,_0x4ed606,!![]);}catch(_0x2cd394){return BPromise[_0xa22d('0x1f')](_0x2cd394);}return _0x4c0aed[_0xa22d('0x20')]();};}function saveUpdates(_0x5071e1,_0x389675){return function(_0x45f528){if(_0x45f528){return _0x45f528[_0xa22d('0x21')](_0x5071e1)['then'](function(_0xdb2773){return _0xdb2773;});}return null;};}function removeEntity(_0x1088ea,_0x502219){return function(_0x24701d){if(_0x24701d){return _0x24701d[_0xa22d('0x22')]()[_0xa22d('0x23')](function(){_0x1088ea[_0xa22d('0x17')](0xcc)[_0xa22d('0x24')]();});}};}function handleEntityNotFound(_0x1c83e8,_0x55f1ce){return function(_0x58aa49){if(!_0x58aa49){_0x1c83e8['sendStatus'](0x194);}return _0x58aa49;};}function handleError(_0x70bfb8,_0x2e4b26){_0x2e4b26=_0x2e4b26||0x1f4;return function(_0x2fe9e0){logger[_0xa22d('0x25')](_0x2fe9e0[_0xa22d('0x26')]);if(_0x2fe9e0[_0xa22d('0x27')]){delete _0x2fe9e0[_0xa22d('0x27')];}_0x70bfb8[_0xa22d('0x17')](_0x2e4b26)[_0xa22d('0x28')](_0x2fe9e0);};}exports[_0xa22d('0x29')]=function(_0x594ac5,_0x5ba48b){var _0xf687b9={},_0x4d460f={},_0x550dd7={'count':0x0,'rows':[]};var _0x1d7b33=_[_0xa22d('0x2a')](db[_0xa22d('0x2b')][_0xa22d('0x2c')],function(_0x1614f4){return{'name':_0x1614f4[_0xa22d('0x2d')],'type':_0x1614f4[_0xa22d('0x2e')][_0xa22d('0x2f')]};});_0x4d460f['model']=_[_0xa22d('0x2a')](_0x1d7b33,_0xa22d('0x27'));_0x4d460f[_0xa22d('0x30')]=_[_0xa22d('0x31')](_0x594ac5[_0xa22d('0x30')]);_0x4d460f[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4d460f[_0xa22d('0x34')],_0x4d460f[_0xa22d('0x30')]);_0xf687b9[_0xa22d('0x35')]=_['intersection'](_0x4d460f[_0xa22d('0x34')],qs[_0xa22d('0x36')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x36')]));_0xf687b9[_0xa22d('0x35')]=_0xf687b9[_0xa22d('0x35')]['length']?_0xf687b9[_0xa22d('0x35')]:_0x4d460f[_0xa22d('0x34')];if(!_0x594ac5['query'][_0xa22d('0x37')]('nolimit')){_0xf687b9[_0xa22d('0x1b')]=qs[_0xa22d('0x1b')](_0x594ac5['query'][_0xa22d('0x1b')]);_0xf687b9['offset']=qs[_0xa22d('0x19')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x19')]);}_0xf687b9[_0xa22d('0x38')]=qs[_0xa22d('0x39')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x39')]);_0xf687b9[_0xa22d('0x3a')]=qs['filters'](_[_0xa22d('0x3b')](_0x594ac5[_0xa22d('0x30')],_0x4d460f['filters']),_0x1d7b33);if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]){_0xf687b9['where']=_['merge'](_0xf687b9[_0xa22d('0x3a')],{'$or':_[_0xa22d('0x2a')](_0x1d7b33,function(_0x109944){if(_0x109944[_0xa22d('0x2e')]!==_0xa22d('0x3d')){var _0x180c37={};_0x180c37[_0x109944[_0xa22d('0x27')]]={'$like':'%'+_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]+'%'};return _0x180c37;}})});}_0xf687b9=_[_0xa22d('0x3e')]({},_0xf687b9,_0x594ac5['options']);var _0x36287a={'where':_0xf687b9[_0xa22d('0x3a')]};return db[_0xa22d('0x2b')][_0xa22d('0x1c')](_0x36287a)['then'](function(_0x11e608){_0x550dd7['count']=_0x11e608;if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3f')]){_0xf687b9[_0xa22d('0x40')]=[{'all':!![]}];}return db[_0xa22d('0x2b')][_0xa22d('0x41')](_0xf687b9);})[_0xa22d('0x23')](function(_0x55034d){_0x550dd7[_0xa22d('0x42')]=_0x55034d;return _0x550dd7;})[_0xa22d('0x23')](respondWithFilteredResult(_0x5ba48b,_0xf687b9))['catch'](handleError(_0x5ba48b,null));};exports[_0xa22d('0x43')]=function(_0x2e44c3,_0x5404d1){var _0x42a36b={'raw':!![],'where':{'id':_0x2e44c3[_0xa22d('0x44')]['id']}},_0x4aebbe={};_0x4aebbe[_0xa22d('0x34')]=_[_0xa22d('0x31')](db['JscriptyAnswerReport'][_0xa22d('0x2c')]);_0x4aebbe[_0xa22d('0x30')]=_['keys'](_0x2e44c3[_0xa22d('0x30')]);_0x4aebbe[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],_0x4aebbe[_0xa22d('0x30')]);_0x42a36b[_0xa22d('0x35')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],qs['fields'](_0x2e44c3['query'][_0xa22d('0x36')]));_0x42a36b['attributes']=_0x42a36b[_0xa22d('0x35')]['length']?_0x42a36b[_0xa22d('0x35')]:_0x4aebbe['model'];if(_0x2e44c3[_0xa22d('0x30')][_0xa22d('0x3f')]){_0x42a36b[_0xa22d('0x40')]=[{'all':!![]}];}_0x42a36b=_[_0xa22d('0x3e')]({},_0x42a36b,_0x2e44c3[_0xa22d('0x45')]);return db[_0xa22d('0x2b')][_0xa22d('0x46')](_0x42a36b)[_0xa22d('0x23')](handleEntityNotFound(_0x5404d1,null))[_0xa22d('0x23')](respondWithResult(_0x5404d1,null))[_0xa22d('0x47')](handleError(_0x5404d1,null));};exports['create']=function(_0x5f488e,_0x132be8){return db['JscriptyAnswerReport'][_0xa22d('0x48')](_0x5f488e['body'],{})[_0xa22d('0x23')](respondWithResult(_0x132be8,0xc9))[_0xa22d('0x47')](handleError(_0x132be8,null));};exports['update']=function(_0x4a1d04,_0x37e2b2){if(_0x4a1d04['body']['id']){delete _0x4a1d04[_0xa22d('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xa22d('0x46')]({'where':{'id':_0x4a1d04[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x37e2b2,null))[_0xa22d('0x23')](saveUpdates(_0x4a1d04[_0xa22d('0x49')],null))[_0xa22d('0x23')](respondWithResult(_0x37e2b2,null))[_0xa22d('0x47')](handleError(_0x37e2b2,null));};exports[_0xa22d('0x22')]=function(_0x45672b,_0x5e5847){return db[_0xa22d('0x2b')][_0xa22d('0x46')]({'where':{'id':_0x45672b[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x5e5847,null))[_0xa22d('0x23')](removeEntity(_0x5e5847,null))[_0xa22d('0x47')](handleError(_0x5e5847,null));};exports[_0xa22d('0x4a')]=function(_0x432d39,_0x134e7a){return db[_0xa22d('0x2b')]['describe']()[_0xa22d('0x23')](respondWithResult(_0x134e7a,null))[_0xa22d('0x47')](handleError(_0x134e7a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e5c6d5e..f5f44ea 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 _0xe00f=['./jscriptyAnswerReport.attributes','exports','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbd1afb,_0x335cfa){var _0x410182=function(_0x5b09a7){while(--_0x5b09a7){_0xbd1afb['push'](_0xbd1afb['shift']());}};_0x410182(++_0x335cfa);}(_0xe00f,0x15f));var _0xfe00=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0xe00f[_0x45346d];return _0x5ce7ca;};'use strict';var _=require(_0xfe00('0x0'));var util=require(_0xfe00('0x1'));var logger=require(_0xfe00('0x2'))(_0xfe00('0x3'));var moment=require('moment');var BPromise=require(_0xfe00('0x4'));var rp=require(_0xfe00('0x5'));var fs=require('fs');var path=require(_0xfe00('0x6'));var rimraf=require(_0xfe00('0x7'));var config=require(_0xfe00('0x8'));var attributes=require(_0xfe00('0x9'));module[_0xfe00('0xa')]=function(_0x544edf,_0x5664a0){return _0x544edf['define']('JscriptyAnswerReport',attributes,{'tableName':_0xfe00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ee5=['./jscriptyAnswerReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x35a27d,_0x5c68fd){var _0xd70155=function(_0xb78ae4){while(--_0xb78ae4){_0x35a27d['push'](_0x35a27d['shift']());}};_0xd70155(++_0x5c68fd);}(_0x6ee5,0x16b));var _0x56ee=function(_0x2ae89f,_0x470a01){_0x2ae89f=_0x2ae89f-0x0;var _0x333ebc=_0x6ee5[_0x2ae89f];return _0x333ebc;};'use strict';var _=require(_0x56ee('0x0'));var util=require(_0x56ee('0x1'));var logger=require(_0x56ee('0x2'))(_0x56ee('0x3'));var moment=require(_0x56ee('0x4'));var BPromise=require(_0x56ee('0x5'));var rp=require(_0x56ee('0x6'));var fs=require('fs');var path=require(_0x56ee('0x7'));var rimraf=require('rimraf');var config=require(_0x56ee('0x8'));var attributes=require(_0x56ee('0x9'));module[_0x56ee('0xa')]=function(_0x42893a,_0x42445a){return _0x42893a[_0x56ee('0xb')]('JscriptyAnswerReport',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 cccd96b..248ecc5 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 _0x5944=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x5944,0x18d));var _0x4594=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5944[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x4594('0x0'));var util=require(_0x4594('0x1'));var moment=require('moment');var BPromise=require(_0x4594('0x2'));var rs=require(_0x4594('0x3'));var fs=require('fs');var Redis=require(_0x4594('0x4'));var db=require(_0x4594('0x5'))['db'];var utils=require(_0x4594('0x6'));var logger=require(_0x4594('0x7'))(_0x4594('0x8'));var config=require(_0x4594('0x9'));var jayson=require(_0x4594('0xa'));var client=jayson[_0x4594('0xb')][_0x4594('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7f5b05,_0x3bde86,_0x2be0e4){return new BPromise(function(_0x43f364,_0x57c355){return client[_0x4594('0xd')](_0x7f5b05,_0x2be0e4)[_0x4594('0xe')](function(_0x37bbb4){logger['info'](_0x4594('0xf'),_0x3bde86,_0x4594('0x10'));logger['debug'](_0x4594('0x11'),_0x3bde86,_0x4594('0x10'),JSON[_0x4594('0x12')](_0x37bbb4));if(_0x37bbb4[_0x4594('0x13')]){if(_0x37bbb4[_0x4594('0x13')][_0x4594('0x14')]===0x1f4){logger[_0x4594('0x13')](_0x4594('0xf'),_0x3bde86,_0x37bbb4[_0x4594('0x13')][_0x4594('0x15')]);return _0x57c355(_0x37bbb4[_0x4594('0x13')][_0x4594('0x15')]);}logger[_0x4594('0x13')](_0x4594('0xf'),_0x3bde86,_0x37bbb4['error'][_0x4594('0x15')]);return _0x43f364(_0x37bbb4['error'][_0x4594('0x15')]);}else{logger[_0x4594('0x16')](_0x4594('0xf'),_0x3bde86,_0x4594('0x10'));_0x43f364(_0x37bbb4[_0x4594('0x17')][_0x4594('0x15')]);}})[_0x4594('0x18')](function(_0x368228){logger['error'](_0x4594('0xf'),_0x3bde86,_0x368228);_0x57c355(_0x368228);});});} \ No newline at end of file +var _0x3bf2=['lodash','util','randomstring','ioredis','rpc','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x15e06d,_0x4a6f77){var _0xdd4cde=function(_0x302ee9){while(--_0x302ee9){_0x15e06d['push'](_0x15e06d['shift']());}};_0xdd4cde(++_0x4a6f77);}(_0x3bf2,0xab));var _0x23bf=function(_0x7b360c,_0x5cec49){_0x7b360c=_0x7b360c-0x0;var _0x2dad8e=_0x3bf2[_0x7b360c];return _0x2dad8e;};'use strict';var _=require(_0x23bf('0x0'));var util=require(_0x23bf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x23bf('0x2'));var fs=require('fs');var Redis=require(_0x23bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23bf('0x4'));var config=require('../../config/environment');var jayson=require(_0x23bf('0x5'));var client=jayson['client'][_0x23bf('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11fd5b,_0x1ec858,_0x9fedd7){return new BPromise(function(_0x15df8f,_0x12e2d8){return client[_0x23bf('0x7')](_0x11fd5b,_0x9fedd7)[_0x23bf('0x8')](function(_0x3e2117){logger['info'](_0x23bf('0x9'),_0x1ec858,_0x23bf('0xa'));logger[_0x23bf('0xb')](_0x23bf('0xc'),_0x1ec858,_0x23bf('0xa'),JSON['stringify'](_0x3e2117));if(_0x3e2117[_0x23bf('0xd')]){if(_0x3e2117[_0x23bf('0xd')][_0x23bf('0xe')]===0x1f4){logger[_0x23bf('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ec858,_0x3e2117['error']['message']);return _0x12e2d8(_0x3e2117[_0x23bf('0xd')]['message']);}logger['error'](_0x23bf('0x9'),_0x1ec858,_0x3e2117['error'][_0x23bf('0xf')]);return _0x15df8f(_0x3e2117['error'][_0x23bf('0xf')]);}else{logger[_0x23bf('0x10')](_0x23bf('0x9'),_0x1ec858,'request\x20sent');_0x15df8f(_0x3e2117[_0x23bf('0x11')][_0x23bf('0xf')]);}})[_0x23bf('0x12')](function(_0x5e3622){logger[_0x23bf('0xd')](_0x23bf('0x9'),_0x1ec858,_0x5e3622);_0x12e2d8(_0x5e3622);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 114dc46..9a55c69 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 _0x8ed2=['clone','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSessions','30s','create','post','/:id/clone'];(function(_0x5cb029,_0x4801c7){var _0x32cb75=function(_0x575306){while(--_0x575306){_0x5cb029['push'](_0x5cb029['shift']());}};_0x32cb75(++_0x4801c7);}(_0x8ed2,0x14f));var _0x28ed=function(_0x4aa6be,_0x42a921){_0x4aa6be=_0x4aa6be-0x0;var _0x2960d2=_0x8ed2[_0x4aa6be];return _0x2960d2;};'use strict';var multer=require(_0x28ed('0x0'));var util=require(_0x28ed('0x1'));var path=require(_0x28ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x28ed('0x3'));var router=express['Router']();var fs_extra=require(_0x28ed('0x4'));var auth=require(_0x28ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x28ed('0x6'));var controller=require('./jscriptyProject.controller');router[_0x28ed('0x7')]('/',auth[_0x28ed('0x8')](),controller[_0x28ed('0x9')]);router[_0x28ed('0x7')](_0x28ed('0xa'),auth[_0x28ed('0x8')](),controller[_0x28ed('0xb')]);router[_0x28ed('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x28ed('0xc')]);router['get']('/:id/answers',auth[_0x28ed('0x8')](),controller['getAnswers']);router[_0x28ed('0x7')]('/:id/summary',auth[_0x28ed('0x8')](),timeout(_0x28ed('0xd')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller[_0x28ed('0xe')]);router[_0x28ed('0xf')](_0x28ed('0x10'),auth[_0x28ed('0x8')](),controller[_0x28ed('0x11')]);router[_0x28ed('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x28ed('0x13')]);router[_0x28ed('0x14')](_0x28ed('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x28ed('0x15')]=router; \ No newline at end of file +var _0xe11f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','exports','multer','path','express','Router','fs-extra'];(function(_0x370284,_0x3348d5){var _0x1445c8=function(_0x573a25){while(--_0x573a25){_0x370284['push'](_0x370284['shift']());}};_0x1445c8(++_0x3348d5);}(_0xe11f,0x1e9));var _0xfe11=function(_0x4339df,_0x568b7d){_0x4339df=_0x4339df-0x0;var _0x38c44c=_0xe11f[_0x4339df];return _0x38c44c;};'use strict';var multer=require(_0xfe11('0x0'));var util=require('util');var path=require(_0xfe11('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe11('0x2'));var router=express[_0xfe11('0x3')]();var fs_extra=require(_0xfe11('0x4'));var auth=require(_0xfe11('0x5'));var interaction=require(_0xfe11('0x6'));var config=require(_0xfe11('0x7'));var controller=require(_0xfe11('0x8'));router[_0xfe11('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe11('0xa')]);router[_0xfe11('0x9')](_0xfe11('0xb'),auth[_0xfe11('0xc')](),controller[_0xfe11('0xd')]);router[_0xfe11('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0xfe11('0xe')]);router[_0xfe11('0x9')](_0xfe11('0xf'),auth[_0xfe11('0xc')](),controller[_0xfe11('0x10')]);router[_0xfe11('0x9')](_0xfe11('0x11'),auth[_0xfe11('0xc')](),timeout(_0xfe11('0x12')),controller['getSummary']);router['post']('/',auth[_0xfe11('0xc')](),controller['create']);router[_0xfe11('0x13')](_0xfe11('0x14'),auth[_0xfe11('0xc')](),controller[_0xfe11('0x15')]);router[_0xfe11('0x16')]('/:id',auth[_0xfe11('0xc')](),controller[_0xfe11('0x17')]);router[_0xfe11('0x18')](_0xfe11('0xb'),auth[_0xfe11('0xc')](),controller['destroy']);module[_0xfe11('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 17fee67..9c22c9e 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 _0xf7d6=['name','description','BOOLEAN','util','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x42c9a8,_0x269ad8){var _0xd8d52e=function(_0x1fefdb){while(--_0x1fefdb){_0x42c9a8['push'](_0x42c9a8['shift']());}};_0xd8d52e(++_0x269ad8);}(_0xf7d6,0x13e));var _0x6f7d=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xf7d6[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x6f7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f7d('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x6f7d('0x1')]},'formData':{'type':Sequelize[_0x6f7d('0x2')](_0x6f7d('0x3')),'set':function(_0x113fef){if(_[_0x6f7d('0x4')](_0x113fef)){this[_0x6f7d('0x5')]('formData',JSON[_0x6f7d('0x6')](_0x113fef));}else if(_[_0x6f7d('0x7')](_0x113fef)){this[_0x6f7d('0x5')]('formData',_0x113fef);}else{this['setDataValue'](_0x6f7d('0x8'),util[_0x6f7d('0x9')](_0x6f7d('0xa'),this[_0x6f7d('0xb')](_0x6f7d('0xc'))||'',this['getDataValue'](_0x6f7d('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6f7d('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xb747=['BOOLEAN','sequelize','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x4f67e3,_0x32b097){var _0x5cedc0=function(_0x3cb7dc){while(--_0x3cb7dc){_0x4f67e3['push'](_0x4f67e3['shift']());}};_0x5cedc0(++_0x32b097);}(_0xb747,0x1f1));var _0x7b74=function(_0x4929fd,_0x2c9d98){_0x4929fd=_0x4929fd-0x0;var _0x1a700d=_0xb747[_0x4929fd];return _0x1a700d;};'use strict';var Sequelize=require(_0x7b74('0x0'));var _=require('lodash');var util=require('util');module[_0x7b74('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7b74('0x2')},'description':{'type':Sequelize[_0x7b74('0x3')]},'formData':{'type':Sequelize[_0x7b74('0x4')](_0x7b74('0x5')),'set':function(_0x2e68fb){if(_[_0x7b74('0x6')](_0x2e68fb)){this[_0x7b74('0x7')](_0x7b74('0x8'),JSON[_0x7b74('0x9')](_0x2e68fb));}else if(_[_0x7b74('0xa')](_0x2e68fb)){this[_0x7b74('0x7')](_0x7b74('0x8'),_0x2e68fb);}else{this['setDataValue'](_0x7b74('0x8'),util[_0x7b74('0xb')](_0x7b74('0xc'),this[_0x7b74('0xd')](_0x7b74('0x2'))||'',this[_0x7b74('0xd')](_0x7b74('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7b74('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 165d143..00fa0db 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 _0x02a4=['includeAll','rows','catch','show','params','intersection','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','error','clone','keys','createdAt','updatedAt','omit','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','filter','JscriptySessionReport','getAnswers','nolimit','ProjectId','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Projects','then','end','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','model','query','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','options'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x02a4,0x19d));var _0x402a=function(_0x467cc2,_0x3fb983){_0x467cc2=_0x467cc2-0x0;var _0x12ddbb=_0x02a4[_0x467cc2];return _0x12ddbb;};'use strict';var emlformat=require(_0x402a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x402a('0x1'));var rp=require(_0x402a('0x2'));var moment=require(_0x402a('0x3'));var BPromise=require(_0x402a('0x4'));var Mustache=require(_0x402a('0x5'));var util=require('util');var path=require(_0x402a('0x6'));var sox=require(_0x402a('0x7'));var csv=require(_0x402a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x402a('0x9'));var _=require(_0x402a('0xa'));var squel=require(_0x402a('0xb'));var crypto=require('crypto');var jsforce=require(_0x402a('0xc'));var deskjs=require(_0x402a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x402a('0xe'));var Papa=require(_0x402a('0xf'));var Redis=require(_0x402a('0x10'));var authService=require(_0x402a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x402a('0x12'))(_0x402a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x402a('0x14'));var db=require(_0x402a('0x15'))['db'];function respondWithStatusCode(_0x4b84f9,_0x394f73){_0x394f73=_0x394f73||0xcc;return function(_0x433eaa){if(_0x433eaa){return _0x4b84f9[_0x402a('0x16')](_0x394f73);}return _0x4b84f9['status'](_0x394f73)['end']();};}function respondWithResult(_0x419840,_0x429504){_0x429504=_0x429504||0xc8;return function(_0x171523){if(_0x171523){return _0x419840[_0x402a('0x17')](_0x429504)[_0x402a('0x18')](_0x171523);}};}function respondWithFilteredResult(_0x4dd0e9,_0x4897dc){return function(_0x1ef004){if(_0x1ef004){var _0x5dc2ae=typeof _0x4897dc[_0x402a('0x19')]===_0x402a('0x1a')&&typeof _0x4897dc[_0x402a('0x1b')]===_0x402a('0x1a');var _0x514acb=_0x1ef004[_0x402a('0x1c')];var _0x4d4941=_0x5dc2ae?0x0:_0x4897dc[_0x402a('0x19')];var _0x3df24a=_0x5dc2ae?_0x1ef004[_0x402a('0x1c')]:_0x4897dc[_0x402a('0x19')]+_0x4897dc[_0x402a('0x1b')];var _0x5bc0ab;if(_0x3df24a>=_0x514acb){_0x3df24a=_0x514acb;_0x5bc0ab=0xc8;}else{_0x5bc0ab=0xce;}_0x4dd0e9['status'](_0x5bc0ab);return _0x4dd0e9['set']('Content-Range',_0x4d4941+'-'+_0x3df24a+'/'+_0x514acb)['json'](_0x1ef004);}return null;};}function patchUpdates(_0x3a1f9c){return function(_0x1ca806){try{jsonpatch[_0x402a('0x1d')](_0x1ca806,_0x3a1f9c,!![]);}catch(_0x550eb0){return BPromise[_0x402a('0x1e')](_0x550eb0);}return _0x1ca806[_0x402a('0x1f')]();};}function saveUpdates(_0x46db73,_0x8b8dec){return function(_0x573d83){if(_0x573d83){return _0x573d83[_0x402a('0x20')](_0x46db73)['then'](function(_0x3e82c4){return _0x3e82c4;});}return null;};}function removeEntity(_0x406462,_0x1022b2){return function(_0x417aa5){if(_0x417aa5){return _0x417aa5[_0x402a('0x21')]()['then'](function(){var _0x34445e=_0x417aa5[_0x402a('0x22')]({'plain':!![]});var _0x521a7e=_0x402a('0x23');return db['UserProfileResource'][_0x402a('0x21')]({'where':{'type':_0x521a7e,'resourceId':_0x34445e['id']}})[_0x402a('0x24')](function(){return _0x417aa5;});})['then'](function(){_0x406462['status'](0xcc)[_0x402a('0x25')]();});}};}function handleEntityNotFound(_0x4910fa,_0x3ed63d){return function(_0x568956){if(!_0x568956){_0x4910fa[_0x402a('0x16')](0x194);}return _0x568956;};}function handleError(_0x4c82d3,_0x1fcba1){_0x1fcba1=_0x1fcba1||0x1f4;return function(_0x4d4e96){logger['error'](_0x4d4e96[_0x402a('0x26')]);if(_0x4d4e96['name']){delete _0x4d4e96[_0x402a('0x27')];}_0x4c82d3[_0x402a('0x17')](_0x1fcba1)['send'](_0x4d4e96);};}exports[_0x402a('0x28')]=function(_0x6ac4fa,_0x40f81c){var _0x441536={},_0xff80a7={},_0x302387={'count':0x0,'rows':[]};var _0x75b2ae=_['map'](db[_0x402a('0x29')][_0x402a('0x2a')],function(_0x131fa3){return{'name':_0x131fa3[_0x402a('0x2b')],'type':_0x131fa3[_0x402a('0x2c')]['key']};});_0xff80a7[_0x402a('0x2d')]=_['map'](_0x75b2ae,_0x402a('0x27'));_0xff80a7[_0x402a('0x2e')]=_['keys'](_0x6ac4fa[_0x402a('0x2e')]);_0xff80a7[_0x402a('0x2f')]=_['intersection'](_0xff80a7[_0x402a('0x2d')],_0xff80a7['query']);_0x441536['attributes']=_['intersection'](_0xff80a7[_0x402a('0x2d')],qs[_0x402a('0x30')](_0x6ac4fa['query'][_0x402a('0x30')]));_0x441536[_0x402a('0x31')]=_0x441536[_0x402a('0x31')]['length']?_0x441536[_0x402a('0x31')]:_0xff80a7[_0x402a('0x2d')];if(!_0x6ac4fa[_0x402a('0x2e')][_0x402a('0x32')]('nolimit')){_0x441536[_0x402a('0x1b')]=qs[_0x402a('0x1b')](_0x6ac4fa[_0x402a('0x2e')][_0x402a('0x1b')]);_0x441536[_0x402a('0x19')]=qs['offset'](_0x6ac4fa['query'][_0x402a('0x19')]);}_0x441536[_0x402a('0x33')]=qs[_0x402a('0x34')](_0x6ac4fa[_0x402a('0x2e')][_0x402a('0x34')]);_0x441536[_0x402a('0x35')]=qs[_0x402a('0x2f')](_[_0x402a('0x36')](_0x6ac4fa[_0x402a('0x2e')],_0xff80a7['filters']),_0x75b2ae);if(_0x6ac4fa['query']['filter']){_0x441536[_0x402a('0x35')]=_[_0x402a('0x37')](_0x441536[_0x402a('0x35')],{'$or':_[_0x402a('0x38')](_0x75b2ae,function(_0x339e64){if(_0x339e64[_0x402a('0x2c')]!==_0x402a('0x39')){var _0x58d36e={};_0x58d36e[_0x339e64[_0x402a('0x27')]]={'$like':'%'+_0x6ac4fa[_0x402a('0x2e')]['filter']+'%'};return _0x58d36e;}})});}_0x441536=_['merge']({},_0x441536,_0x6ac4fa[_0x402a('0x3a')]);var _0x50f81f={'where':_0x441536[_0x402a('0x35')]};return db[_0x402a('0x29')][_0x402a('0x1c')](_0x50f81f)[_0x402a('0x24')](function(_0x42bcc0){_0x302387[_0x402a('0x1c')]=_0x42bcc0;if(_0x6ac4fa[_0x402a('0x2e')][_0x402a('0x3b')]){_0x441536['include']=[{'all':!![]}];}return db[_0x402a('0x29')]['findAll'](_0x441536);})[_0x402a('0x24')](function(_0x93daa0){_0x302387[_0x402a('0x3c')]=_0x93daa0;return _0x302387;})[_0x402a('0x24')](respondWithFilteredResult(_0x40f81c,_0x441536))[_0x402a('0x3d')](handleError(_0x40f81c,null));};exports[_0x402a('0x3e')]=function(_0x14fc36,_0x2f8019){var _0xf6db94={'raw':![],'where':{'id':_0x14fc36[_0x402a('0x3f')]['id']}},_0x5f5670={};_0x5f5670[_0x402a('0x2d')]=_['keys'](db['JscriptyProject'][_0x402a('0x2a')]);_0x5f5670[_0x402a('0x2e')]=_['keys'](_0x14fc36[_0x402a('0x2e')]);_0x5f5670[_0x402a('0x2f')]=_[_0x402a('0x40')](_0x5f5670[_0x402a('0x2d')],_0x5f5670[_0x402a('0x2e')]);_0xf6db94['attributes']=_['intersection'](_0x5f5670[_0x402a('0x2d')],qs['fields'](_0x14fc36[_0x402a('0x2e')][_0x402a('0x30')]));_0xf6db94[_0x402a('0x31')]=_0xf6db94['attributes'][_0x402a('0x41')]?_0xf6db94[_0x402a('0x31')]:_0x5f5670['model'];if(_0x14fc36[_0x402a('0x2e')]['includeAll']){_0xf6db94[_0x402a('0x42')]=[{'all':!![]}];}_0xf6db94=_[_0x402a('0x37')]({},_0xf6db94,_0x14fc36[_0x402a('0x3a')]);return db[_0x402a('0x29')]['find'](_0xf6db94)['then'](handleEntityNotFound(_0x2f8019,null))[_0x402a('0x24')](respondWithResult(_0x2f8019,null))[_0x402a('0x3d')](handleError(_0x2f8019,null));};exports[_0x402a('0x43')]=function(_0x41b419,_0x4aea5a){return db[_0x402a('0x29')][_0x402a('0x43')](_0x41b419[_0x402a('0x44')],{})[_0x402a('0x24')](function(_0x92632a){var _0x243fe0=_0x41b419['user'][_0x402a('0x22')]({'plain':!![]});if(!_0x243fe0)throw new Error(_0x402a('0x45'));if(_0x243fe0[_0x402a('0x46')]===_0x402a('0x47')){var _0x5202c3=_0x92632a[_0x402a('0x22')]({'plain':!![]});var _0x2db3c1=_0x402a('0x23');return db['UserProfileSection'][_0x402a('0x48')]({'where':{'name':_0x2db3c1,'userProfileId':_0x243fe0['userProfileId']},'raw':!![]})[_0x402a('0x24')](function(_0x1910ef){if(_0x1910ef&&_0x1910ef['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5202c3['name'],'resourceId':_0x5202c3['id'],'type':_0x1910ef['name'],'sectionId':_0x1910ef['id']},{})['then'](function(){return _0x92632a;});}else{return _0x92632a;}})[_0x402a('0x3d')](function(_0x3c4686){logger[_0x402a('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c4686);throw _0x3c4686;});}return _0x92632a;})[_0x402a('0x24')](respondWithResult(_0x4aea5a,0xc9))['catch'](handleError(_0x4aea5a,null));};exports[_0x402a('0x4a')]=function(_0x829339,_0x1ccbfd){var _0x446d7c={'where':{'id':_0x829339[_0x402a('0x3f')]['id']}},_0x4bbf37={};_0x4bbf37['model']=_[_0x402a('0x4b')](db['JscriptyProject']['rawAttributes']);_0x446d7c[_0x402a('0x31')]=_['intersection'](_0x4bbf37['model'],qs['fields'](_0x829339[_0x402a('0x2e')][_0x402a('0x30')]));_0x446d7c['attributes']=_0x446d7c['attributes'][_0x402a('0x41')]?_0x446d7c[_0x402a('0x31')]:_0x4bbf37[_0x402a('0x2d')];if(_0x829339[_0x402a('0x2e')]['includeAll']){_0x446d7c[_0x402a('0x42')]=[{'all':!![]}];}_0x446d7c=_[_0x402a('0x37')]({},_0x446d7c,_0x829339['options']);return db[_0x402a('0x29')][_0x402a('0x48')](_0x446d7c)[_0x402a('0x24')](handleEntityNotFound(_0x1ccbfd,null))['then'](function(_0x239757){if(_0x239757){var _0x3add8c=_0x239757[_0x402a('0x22')]({'plain':!![]});_0x3add8c=qs['omit'](_0x3add8c,['id',_0x402a('0x4c'),_0x402a('0x4d')]);_0x829339[_0x402a('0x44')]=_[_0x402a('0x4e')](_0x829339[_0x402a('0x44')],['id',_0x402a('0x4c'),_0x402a('0x4d')]);return db[_0x402a('0x29')][_0x402a('0x43')](_[_0x402a('0x37')](_0x3add8c,_0x829339['body']),{'include':_0x829339[_0x402a('0x2e')][_0x402a('0x3b')]?[{'all':!![]}]:undefined})[_0x402a('0x24')](function(_0x56664f){var _0x51fdbf=_0x829339[_0x402a('0x47')][_0x402a('0x22')]({'plain':!![]});if(!_0x51fdbf)throw new Error(_0x402a('0x45'));if(_0x51fdbf[_0x402a('0x46')]===_0x402a('0x47')){var _0x531f3f=_0x56664f[_0x402a('0x22')]({'plain':!![]});var _0x547b71=_0x402a('0x23');return db[_0x402a('0x4f')]['find']({'where':{'name':_0x547b71,'userProfileId':_0x51fdbf[_0x402a('0x50')]},'raw':!![]})[_0x402a('0x24')](function(_0x94a77c){if(_0x94a77c&&_0x94a77c[_0x402a('0x51')]===0x0){return db[_0x402a('0x52')]['create']({'name':_0x531f3f[_0x402a('0x27')],'resourceId':_0x531f3f['id'],'type':_0x94a77c[_0x402a('0x27')],'sectionId':_0x94a77c['id']},{})[_0x402a('0x24')](function(){return _0x56664f;});}else{return _0x56664f;}})[_0x402a('0x3d')](function(_0x19c166){logger[_0x402a('0x49')](_0x402a('0x53'),_0x19c166);throw _0x19c166;});}return _0x56664f;});}})[_0x402a('0x24')](respondWithResult(_0x1ccbfd,0xc9))[_0x402a('0x3d')](handleError(_0x1ccbfd,null));};exports[_0x402a('0x20')]=function(_0x3a937d,_0x58165e){if(_0x3a937d['body']['id']){delete _0x3a937d[_0x402a('0x44')]['id'];}return db['JscriptyProject'][_0x402a('0x48')]({'where':{'id':_0x3a937d[_0x402a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x58165e,null))[_0x402a('0x24')](saveUpdates(_0x3a937d[_0x402a('0x44')],null))[_0x402a('0x24')](respondWithResult(_0x58165e,null))['catch'](handleError(_0x58165e,null));};exports[_0x402a('0x21')]=function(_0x1b2dde,_0x4881f3){return db[_0x402a('0x29')][_0x402a('0x48')]({'where':{'id':_0x1b2dde[_0x402a('0x3f')]['id']}})[_0x402a('0x24')](handleEntityNotFound(_0x4881f3,null))[_0x402a('0x24')](removeEntity(_0x4881f3,null))[_0x402a('0x3d')](handleError(_0x4881f3,null));};exports[_0x402a('0x54')]=function(_0x61ff05,_0x56b02e,_0x5c38b2){var _0x282c50={'raw':!![],'where':{}};var _0xe7ade4={};var _0x34ba76={'count':0x0,'rows':[]};return db[_0x402a('0x29')][_0x402a('0x55')]({'where':{'id':_0x61ff05['params']['id']}})['then'](handleEntityNotFound(_0x56b02e,null))[_0x402a('0x24')](function(_0x5db717){if(_0x5db717){_0xe7ade4[_0x402a('0x2d')]=_[_0x402a('0x4b')](db['JscriptySessionReport'][_0x402a('0x2a')]);_0xe7ade4[_0x402a('0x2e')]=_['keys'](_0x61ff05[_0x402a('0x2e')]);_0xe7ade4['filters']=_['intersection'](_0xe7ade4[_0x402a('0x2d')],_0xe7ade4[_0x402a('0x2e')]);_0x282c50[_0x402a('0x31')]=_[_0x402a('0x40')](_0xe7ade4[_0x402a('0x2d')],qs['fields'](_0x61ff05[_0x402a('0x2e')]['fields']));_0x282c50['attributes']=_0x282c50[_0x402a('0x31')]['length']?_0x282c50[_0x402a('0x31')]:_0xe7ade4['model'];if(!_0x61ff05['query']['hasOwnProperty']('nolimit')){_0x282c50['limit']=qs[_0x402a('0x1b')](_0x61ff05['query']['limit']);_0x282c50['offset']=qs[_0x402a('0x19')](_0x61ff05[_0x402a('0x2e')]['offset']);}_0x282c50[_0x402a('0x33')]=qs['sort'](_0x61ff05[_0x402a('0x2e')][_0x402a('0x34')]);_0x282c50[_0x402a('0x35')]=qs[_0x402a('0x2f')](_['pick'](_0x61ff05['query'],_0xe7ade4[_0x402a('0x2f')]));_0x282c50[_0x402a('0x35')]['ProjectId']=_0x5db717['id'];if(_0x61ff05['query'][_0x402a('0x56')]){_0x282c50[_0x402a('0x35')]=_['merge'](_0x282c50['where'],{'$or':_[_0x402a('0x38')](_0x282c50[_0x402a('0x31')],function(_0x3f990a){var _0x354148={};_0x354148[_0x3f990a]={'$like':'%'+_0x61ff05[_0x402a('0x2e')][_0x402a('0x56')]+'%'};return _0x354148;})});}_0x282c50=_[_0x402a('0x37')]({},_0x282c50,_0x61ff05[_0x402a('0x3a')]);return db[_0x402a('0x57')][_0x402a('0x1c')]({'where':_0x282c50['where']})[_0x402a('0x24')](function(_0x275a39){_0x34ba76['count']=_0x275a39;if(_0x61ff05[_0x402a('0x2e')][_0x402a('0x3b')]){_0x282c50['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x282c50);})[_0x402a('0x24')](function(_0x2dfb32){_0x34ba76[_0x402a('0x3c')]=_0x2dfb32;return _0x34ba76;});}})[_0x402a('0x24')](respondWithFilteredResult(_0x56b02e,_0x282c50))[_0x402a('0x3d')](handleError(_0x56b02e,null));};exports[_0x402a('0x58')]=function(_0x5585e3,_0x3a435e,_0x10e6c3){var _0x4e0ab0={'raw':!![],'where':{}};var _0x2b742d={};var _0x484bf8={'count':0x0,'rows':[]};return db[_0x402a('0x29')][_0x402a('0x55')]({'where':{'id':_0x5585e3[_0x402a('0x3f')]['id']}})[_0x402a('0x24')](handleEntityNotFound(_0x3a435e,null))[_0x402a('0x24')](function(_0x24b6bd){if(_0x24b6bd){_0x2b742d[_0x402a('0x2d')]=_[_0x402a('0x4b')](db['JscriptyAnswerReport']['rawAttributes']);_0x2b742d[_0x402a('0x2e')]=_[_0x402a('0x4b')](_0x5585e3[_0x402a('0x2e')]);_0x2b742d[_0x402a('0x2f')]=_['intersection'](_0x2b742d[_0x402a('0x2d')],_0x2b742d[_0x402a('0x2e')]);_0x4e0ab0[_0x402a('0x31')]=_['intersection'](_0x2b742d[_0x402a('0x2d')],qs['fields'](_0x5585e3[_0x402a('0x2e')][_0x402a('0x30')]));_0x4e0ab0[_0x402a('0x31')]=_0x4e0ab0['attributes'][_0x402a('0x41')]?_0x4e0ab0[_0x402a('0x31')]:_0x2b742d['model'];if(!_0x5585e3[_0x402a('0x2e')][_0x402a('0x32')](_0x402a('0x59'))){_0x4e0ab0['limit']=qs['limit'](_0x5585e3[_0x402a('0x2e')]['limit']);_0x4e0ab0['offset']=qs['offset'](_0x5585e3['query'][_0x402a('0x19')]);}_0x4e0ab0[_0x402a('0x33')]=qs[_0x402a('0x34')](_0x5585e3['query'][_0x402a('0x34')]);_0x4e0ab0['where']=qs[_0x402a('0x2f')](_[_0x402a('0x36')](_0x5585e3['query'],_0x2b742d[_0x402a('0x2f')]));_0x4e0ab0[_0x402a('0x35')][_0x402a('0x5a')]=_0x24b6bd['id'];if(_0x5585e3[_0x402a('0x2e')][_0x402a('0x56')]){_0x4e0ab0['where']=_[_0x402a('0x37')](_0x4e0ab0[_0x402a('0x35')],{'$or':_[_0x402a('0x38')](_0x4e0ab0[_0x402a('0x31')],function(_0x536fce){var _0x3da0aa={};_0x3da0aa[_0x536fce]={'$like':'%'+_0x5585e3[_0x402a('0x2e')]['filter']+'%'};return _0x3da0aa;})});}_0x4e0ab0=_['merge']({},_0x4e0ab0,_0x5585e3['options']);return db['JscriptyAnswerReport'][_0x402a('0x1c')]({'where':_0x4e0ab0[_0x402a('0x35')]})[_0x402a('0x24')](function(_0x15ce4b){_0x484bf8[_0x402a('0x1c')]=_0x15ce4b;if(_0x5585e3['query'][_0x402a('0x3b')]){_0x4e0ab0[_0x402a('0x42')]=[{'all':!![]}];}return db[_0x402a('0x5b')][_0x402a('0x5c')](_0x4e0ab0);})[_0x402a('0x24')](function(_0x335f2e){_0x484bf8[_0x402a('0x3c')]=_0x335f2e;return _0x484bf8;});}})[_0x402a('0x24')](respondWithFilteredResult(_0x3a435e,_0x4e0ab0))[_0x402a('0x3d')](handleError(_0x3a435e,null));};function char(_0x5f5d00){return _0x402a('0x5d')===typeof _0x5f5d00?String[_0x402a('0x5e')][_0x402a('0x1d')](null,arguments):_0x5f5d00;}function needsEncapsulation(_0x221979){return!!_0x221979&&(_0x221979[_0x402a('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x221979['toString']()[_0x402a('0x60')](char(0xa))>=0x0||_0x221979[_0x402a('0x5f')]()[_0x402a('0x60')](char(0x2c))>=0x0||_0x221979['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xef5d1a){var _0x4a9175=char(0x22),_0x225613='\x5c'+char(0x22),_0x2313a7=_0xef5d1a[_0x402a('0x5f')]()[_0x402a('0x61')](new RegExp(_0x4a9175,'g'),_0x225613);return _0x4a9175+_0x2313a7+_0x4a9175;}exports[_0x402a('0x62')]=function(_0x1f32fd,_0x703881,_0x5b42be){var _0x5df617,_0x123f2f;var _0x1b884c={'where':{'ProjectId':_0x1f32fd[_0x402a('0x3f')]['id']}};if(_0x1f32fd[_0x402a('0x2e')][_0x402a('0x63')]){_0x1b884c[_0x402a('0x35')]['starttime']=JSON[_0x402a('0x64')](_0x1f32fd[_0x402a('0x2e')][_0x402a('0x63')]);}return db[_0x402a('0x57')]['findAll'](_0x1b884c)['then'](handleEntityNotFound(_0x703881,null))['then'](function(_0x250fb7){if(_0x250fb7){_0x5df617=_0x250fb7;return db['JscriptyQuestionReport'][_0x402a('0x5c')]({'where':{'SessionId':{'$in':_['map'](_0x5df617,'id')},'ProjectId':_0x1f32fd[_0x402a('0x3f')]['id']},'order':_0x402a('0x65')});}})['then'](handleEntityNotFound(_0x703881,null))['then'](function(_0x499c79){if(_0x499c79){_0x123f2f=_0x499c79;var _0x517c97={};for(var _0x1223e9=0x0,_0x4414f0=_0x123f2f[_0x402a('0x41')];_0x1223e9<_0x4414f0;_0x1223e9++){if(!_0x517c97[_0x402a('0x32')](_0x123f2f[_0x1223e9][_0x402a('0x66')])){_0x517c97[_0x123f2f[_0x1223e9][_0x402a('0x66')]]=needsEncapsulation(_0x123f2f[_0x1223e9][_0x402a('0x67')])?encapsulate(_0x123f2f[_0x1223e9][_0x402a('0x67')]):_0x123f2f[_0x1223e9][_0x402a('0x67')];}}var _0x50ec2e=[],_0x1aca12={};for(var _0x401641=0x0,_0x448523=_0x5df617['length'];_0x401641<_0x448523;_0x401641++){_0x1aca12={'ProjectId':_0x1f32fd[_0x402a('0x3f')]['id'],'SessionId':_0x5df617[_0x401641]['id'],'StartTime':moment(_0x5df617[_0x401641][_0x402a('0x68')])[_0x402a('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x26db94=0x0,_0x358102=_0x123f2f['length'];_0x26db94<_0x358102;_0x26db94++){if(_0x123f2f[_0x26db94][_0x402a('0x6a')]==_0x5df617[_0x401641]['id']&&_0x517c97[_0x402a('0x32')](_0x123f2f[_0x26db94]['questionId'])){_0x1aca12[_0x517c97[_0x123f2f[_0x26db94][_0x402a('0x66')]]]=_0x123f2f[_0x26db94][_0x402a('0x6b')];}}for(var _0x2b1e20 in _0x517c97){if(!_0x1aca12[_0x402a('0x32')](_0x517c97[_0x2b1e20])){_0x1aca12[_0x517c97[_0x2b1e20]]=null;}}_0x50ec2e[_0x402a('0x6c')](_0x1aca12);}return _0x50ec2e;}})['then'](function(_0x1e9788){if(!_[_0x402a('0x6d')](_0x1e9788)){var _0x1d3ae3=toCsv(_0x1e9788);var _0x4793fd=Date['now']();fs['writeFileSync'](util[_0x402a('0x69')](_0x402a('0x6e'),_0x1f32fd[_0x402a('0x3f')]['id'],_0x4793fd),_0x1d3ae3);_0x703881[_0x402a('0x6f')](_0x402a('0x70'),_0x402a('0x71')+util[_0x402a('0x69')](_0x402a('0x72'),_0x1f32fd['params']['id'],_0x4793fd));_0x703881[_0x402a('0x6f')](_0x402a('0x73'),_0x402a('0x74'));return _0x703881[_0x402a('0x75')](util[_0x402a('0x69')](_0x402a('0x6e'),_0x1f32fd['params']['id'],_0x4793fd));}else{return _0x703881[_0x402a('0x16')](0xcc);}})[_0x402a('0x3d')](handleError(_0x703881,null));}; \ No newline at end of file +var _0x6b1e=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','update','destroy','get','Projects','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','findAll','catch','params','keys','includeAll','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x190ceb,_0x2345b2){var _0x5ce806=function(_0x432853){while(--_0x432853){_0x190ceb['push'](_0x190ceb['shift']());}};_0x5ce806(++_0x2345b2);}(_0x6b1e,0xd3));var _0xe6b1=function(_0x33606a,_0x195f9c){_0x33606a=_0x33606a-0x0;var _0x3f40af=_0x6b1e[_0x33606a];return _0x3f40af;};'use strict';var emlformat=require(_0xe6b1('0x0'));var rimraf=require(_0xe6b1('0x1'));var zipdir=require(_0xe6b1('0x2'));var jsonpatch=require(_0xe6b1('0x3'));var rp=require(_0xe6b1('0x4'));var moment=require(_0xe6b1('0x5'));var BPromise=require(_0xe6b1('0x6'));var Mustache=require(_0xe6b1('0x7'));var util=require(_0xe6b1('0x8'));var path=require(_0xe6b1('0x9'));var sox=require(_0xe6b1('0xa'));var csv=require(_0xe6b1('0xb'));var ejs=require(_0xe6b1('0xc'));var fs=require('fs');var fs_extra=require(_0xe6b1('0xd'));var _=require(_0xe6b1('0xe'));var squel=require('squel');var crypto=require(_0xe6b1('0xf'));var jsforce=require(_0xe6b1('0x10'));var deskjs=require(_0xe6b1('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6b1('0x12'));var Redis=require(_0xe6b1('0x13'));var authService=require(_0xe6b1('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6b1('0x15'));var logger=require(_0xe6b1('0x16'))(_0xe6b1('0x17'));var utils=require(_0xe6b1('0x18'));var config=require(_0xe6b1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6b1('0x1a'))['db'];function respondWithStatusCode(_0x17268,_0x36a29b){_0x36a29b=_0x36a29b||0xcc;return function(_0x16b737){if(_0x16b737){return _0x17268[_0xe6b1('0x1b')](_0x36a29b);}return _0x17268[_0xe6b1('0x1c')](_0x36a29b)[_0xe6b1('0x1d')]();};}function respondWithResult(_0x476e37,_0xbaba4c){_0xbaba4c=_0xbaba4c||0xc8;return function(_0x18b02f){if(_0x18b02f){return _0x476e37[_0xe6b1('0x1c')](_0xbaba4c)[_0xe6b1('0x1e')](_0x18b02f);}};}function respondWithFilteredResult(_0x50c4ce,_0x4cd915){return function(_0x51f1fc){if(_0x51f1fc){var _0x18aca4=typeof _0x4cd915[_0xe6b1('0x1f')]==='undefined'&&typeof _0x4cd915[_0xe6b1('0x20')]==='undefined';var _0x2697d2=_0x51f1fc[_0xe6b1('0x21')];var _0x23de8f=_0x18aca4?0x0:_0x4cd915['offset'];var _0x106ff9=_0x18aca4?_0x51f1fc['count']:_0x4cd915[_0xe6b1('0x1f')]+_0x4cd915[_0xe6b1('0x20')];var _0x1121ce;if(_0x106ff9>=_0x2697d2){_0x106ff9=_0x2697d2;_0x1121ce=0xc8;}else{_0x1121ce=0xce;}_0x50c4ce['status'](_0x1121ce);return _0x50c4ce['set']('Content-Range',_0x23de8f+'-'+_0x106ff9+'/'+_0x2697d2)['json'](_0x51f1fc);}return null;};}function patchUpdates(_0xe853c){return function(_0x10263a){try{jsonpatch[_0xe6b1('0x22')](_0x10263a,_0xe853c,!![]);}catch(_0x265ad6){return BPromise[_0xe6b1('0x23')](_0x265ad6);}return _0x10263a['save']();};}function saveUpdates(_0x6a7bb,_0x511fbb){return function(_0x307cac){if(_0x307cac){return _0x307cac[_0xe6b1('0x24')](_0x6a7bb)['then'](function(_0x233065){return _0x233065;});}return null;};}function removeEntity(_0x511482,_0xb8aa86){return function(_0x44f5c3){if(_0x44f5c3){return _0x44f5c3[_0xe6b1('0x25')]()['then'](function(){var _0x1480c4=_0x44f5c3[_0xe6b1('0x26')]({'plain':!![]});var _0x5d3731=_0xe6b1('0x27');return db[_0xe6b1('0x28')][_0xe6b1('0x25')]({'where':{'type':_0x5d3731,'resourceId':_0x1480c4['id']}})['then'](function(){return _0x44f5c3;});})[_0xe6b1('0x29')](function(){_0x511482[_0xe6b1('0x1c')](0xcc)[_0xe6b1('0x1d')]();});}};}function handleEntityNotFound(_0x4ac1e3,_0x33e718){return function(_0x36921a){if(!_0x36921a){_0x4ac1e3[_0xe6b1('0x1b')](0x194);}return _0x36921a;};}function handleError(_0x1b088c,_0x2ca04d){_0x2ca04d=_0x2ca04d||0x1f4;return function(_0x3dd04a){logger['error'](_0x3dd04a[_0xe6b1('0x2a')]);if(_0x3dd04a[_0xe6b1('0x2b')]){delete _0x3dd04a[_0xe6b1('0x2b')];}_0x1b088c[_0xe6b1('0x1c')](_0x2ca04d)[_0xe6b1('0x2c')](_0x3dd04a);};}exports[_0xe6b1('0x2d')]=function(_0x3a153c,_0x5c2514){var _0x49b974={},_0x2352f6={},_0x2e8b7c={'count':0x0,'rows':[]};var _0x5f0786=_[_0xe6b1('0x2e')](db[_0xe6b1('0x2f')][_0xe6b1('0x30')],function(_0x370a62){return{'name':_0x370a62[_0xe6b1('0x31')],'type':_0x370a62[_0xe6b1('0x32')][_0xe6b1('0x33')]};});_0x2352f6[_0xe6b1('0x34')]=_[_0xe6b1('0x2e')](_0x5f0786,_0xe6b1('0x2b'));_0x2352f6[_0xe6b1('0x35')]=_['keys'](_0x3a153c['query']);_0x2352f6['filters']=_[_0xe6b1('0x36')](_0x2352f6['model'],_0x2352f6[_0xe6b1('0x35')]);_0x49b974[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x2352f6[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0x49b974[_0xe6b1('0x37')]=_0x49b974[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x49b974[_0xe6b1('0x37')]:_0x2352f6[_0xe6b1('0x34')];if(!_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x49b974[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0x3a153c['query'][_0xe6b1('0x20')]);_0x49b974[_0xe6b1('0x1f')]=qs[_0xe6b1('0x1f')](_0x3a153c[_0xe6b1('0x35')]['offset']);}_0x49b974[_0xe6b1('0x3c')]=qs[_0xe6b1('0x3d')](_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x49b974['where']=qs[_0xe6b1('0x3e')](_[_0xe6b1('0x3f')](_0x3a153c['query'],_0x2352f6[_0xe6b1('0x3e')]),_0x5f0786);if(_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x40')]){_0x49b974[_0xe6b1('0x41')]=_['merge'](_0x49b974[_0xe6b1('0x41')],{'$or':_[_0xe6b1('0x2e')](_0x5f0786,function(_0x124bb5){if(_0x124bb5[_0xe6b1('0x32')]!==_0xe6b1('0x42')){var _0x58ef3c={};_0x58ef3c[_0x124bb5[_0xe6b1('0x2b')]]={'$like':'%'+_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x40')]+'%'};return _0x58ef3c;}})});}_0x49b974=_[_0xe6b1('0x43')]({},_0x49b974,_0x3a153c[_0xe6b1('0x44')]);var _0x353e74={'where':_0x49b974[_0xe6b1('0x41')]};return db[_0xe6b1('0x2f')][_0xe6b1('0x21')](_0x353e74)[_0xe6b1('0x29')](function(_0x3c4b08){_0x2e8b7c[_0xe6b1('0x21')]=_0x3c4b08;if(_0x3a153c['query']['includeAll']){_0x49b974['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xe6b1('0x45')](_0x49b974);})[_0xe6b1('0x29')](function(_0x11958c){_0x2e8b7c['rows']=_0x11958c;return _0x2e8b7c;})[_0xe6b1('0x29')](respondWithFilteredResult(_0x5c2514,_0x49b974))[_0xe6b1('0x46')](handleError(_0x5c2514,null));};exports['show']=function(_0x5e4597,_0xa799bd){var _0x13c5f6={'raw':![],'where':{'id':_0x5e4597[_0xe6b1('0x47')]['id']}},_0x11f7fa={};_0x11f7fa['model']=_['keys'](db['JscriptyProject'][_0xe6b1('0x30')]);_0x11f7fa[_0xe6b1('0x35')]=_[_0xe6b1('0x48')](_0x5e4597[_0xe6b1('0x35')]);_0x11f7fa[_0xe6b1('0x3e')]=_[_0xe6b1('0x36')](_0x11f7fa['model'],_0x11f7fa[_0xe6b1('0x35')]);_0x13c5f6[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x11f7fa[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x5e4597[_0xe6b1('0x35')]['fields']));_0x13c5f6[_0xe6b1('0x37')]=_0x13c5f6[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x13c5f6[_0xe6b1('0x37')]:_0x11f7fa[_0xe6b1('0x34')];if(_0x5e4597['query'][_0xe6b1('0x49')]){_0x13c5f6[_0xe6b1('0x4a')]=[{'all':!![]}];}_0x13c5f6=_['merge']({},_0x13c5f6,_0x5e4597[_0xe6b1('0x44')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')](_0x13c5f6)[_0xe6b1('0x29')](handleEntityNotFound(_0xa799bd,null))[_0xe6b1('0x29')](respondWithResult(_0xa799bd,null))[_0xe6b1('0x46')](handleError(_0xa799bd,null));};exports[_0xe6b1('0x4c')]=function(_0x363592,_0x533608){return db[_0xe6b1('0x2f')][_0xe6b1('0x4c')](_0x363592['body'],{})[_0xe6b1('0x29')](function(_0x2199a6){var _0x363ad4=_0x363592[_0xe6b1('0x4d')][_0xe6b1('0x26')]({'plain':!![]});if(!_0x363ad4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x363ad4[_0xe6b1('0x4e')]===_0xe6b1('0x4d')){var _0x2135ec=_0x2199a6['get']({'plain':!![]});var _0x337a74=_0xe6b1('0x27');return db[_0xe6b1('0x4f')][_0xe6b1('0x4b')]({'where':{'name':_0x337a74,'userProfileId':_0x363ad4[_0xe6b1('0x50')]},'raw':!![]})['then'](function(_0xe7f621){if(_0xe7f621&&_0xe7f621[_0xe6b1('0x51')]===0x0){return db[_0xe6b1('0x28')][_0xe6b1('0x4c')]({'name':_0x2135ec[_0xe6b1('0x2b')],'resourceId':_0x2135ec['id'],'type':_0xe7f621[_0xe6b1('0x2b')],'sectionId':_0xe7f621['id']},{})[_0xe6b1('0x29')](function(){return _0x2199a6;});}else{return _0x2199a6;}})['catch'](function(_0x119cef){logger[_0xe6b1('0x52')](_0xe6b1('0x53'),_0x119cef);throw _0x119cef;});}return _0x2199a6;})['then'](respondWithResult(_0x533608,0xc9))[_0xe6b1('0x46')](handleError(_0x533608,null));};exports['clone']=function(_0x25e1c7,_0xb07fff){var _0xe57aa5={'where':{'id':_0x25e1c7[_0xe6b1('0x47')]['id']}},_0x88b783={};_0x88b783[_0xe6b1('0x34')]=_[_0xe6b1('0x48')](db[_0xe6b1('0x2f')]['rawAttributes']);_0xe57aa5[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x88b783[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x25e1c7[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0xe57aa5[_0xe6b1('0x37')]=_0xe57aa5[_0xe6b1('0x37')]['length']?_0xe57aa5[_0xe6b1('0x37')]:_0x88b783[_0xe6b1('0x34')];if(_0x25e1c7[_0xe6b1('0x35')][_0xe6b1('0x49')]){_0xe57aa5[_0xe6b1('0x4a')]=[{'all':!![]}];}_0xe57aa5=_[_0xe6b1('0x43')]({},_0xe57aa5,_0x25e1c7[_0xe6b1('0x44')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')](_0xe57aa5)['then'](handleEntityNotFound(_0xb07fff,null))[_0xe6b1('0x29')](function(_0xfa4f2b){if(_0xfa4f2b){var _0x187453=_0xfa4f2b[_0xe6b1('0x26')]({'plain':!![]});_0x187453=qs[_0xe6b1('0x54')](_0x187453,['id',_0xe6b1('0x55'),_0xe6b1('0x56')]);_0x25e1c7['body']=_[_0xe6b1('0x54')](_0x25e1c7[_0xe6b1('0x57')],['id',_0xe6b1('0x55'),_0xe6b1('0x56')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4c')](_[_0xe6b1('0x43')](_0x187453,_0x25e1c7[_0xe6b1('0x57')]),{'include':_0x25e1c7['query'][_0xe6b1('0x49')]?[{'all':!![]}]:undefined})[_0xe6b1('0x29')](function(_0x112b2e){var _0x54e0b3=_0x25e1c7[_0xe6b1('0x4d')][_0xe6b1('0x26')]({'plain':!![]});if(!_0x54e0b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54e0b3['role']===_0xe6b1('0x4d')){var _0x38803f=_0x112b2e[_0xe6b1('0x26')]({'plain':!![]});var _0x165b12=_0xe6b1('0x27');return db['UserProfileSection'][_0xe6b1('0x4b')]({'where':{'name':_0x165b12,'userProfileId':_0x54e0b3['userProfileId']},'raw':!![]})['then'](function(_0x1198e5){if(_0x1198e5&&_0x1198e5[_0xe6b1('0x51')]===0x0){return db[_0xe6b1('0x28')][_0xe6b1('0x4c')]({'name':_0x38803f[_0xe6b1('0x2b')],'resourceId':_0x38803f['id'],'type':_0x1198e5[_0xe6b1('0x2b')],'sectionId':_0x1198e5['id']},{})[_0xe6b1('0x29')](function(){return _0x112b2e;});}else{return _0x112b2e;}})[_0xe6b1('0x46')](function(_0xc6d092){logger[_0xe6b1('0x52')](_0xe6b1('0x53'),_0xc6d092);throw _0xc6d092;});}return _0x112b2e;});}})[_0xe6b1('0x29')](respondWithResult(_0xb07fff,0xc9))['catch'](handleError(_0xb07fff,null));};exports[_0xe6b1('0x24')]=function(_0x526e4c,_0x2799a4){if(_0x526e4c[_0xe6b1('0x57')]['id']){delete _0x526e4c[_0xe6b1('0x57')]['id'];}return db[_0xe6b1('0x2f')]['find']({'where':{'id':_0x526e4c['params']['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x2799a4,null))['then'](saveUpdates(_0x526e4c['body'],null))['then'](respondWithResult(_0x2799a4,null))[_0xe6b1('0x46')](handleError(_0x2799a4,null));};exports['destroy']=function(_0x410b9e,_0xca9809){return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')]({'where':{'id':_0x410b9e['params']['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0xca9809,null))[_0xe6b1('0x29')](removeEntity(_0xca9809,null))[_0xe6b1('0x46')](handleError(_0xca9809,null));};exports[_0xe6b1('0x58')]=function(_0xa6259,_0x12ef99,_0x1ddfa3){var _0x1d460f={'raw':!![],'where':{}};var _0x2022d4={};var _0x376d67={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe6b1('0x59')]({'where':{'id':_0xa6259[_0xe6b1('0x47')]['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x12ef99,null))[_0xe6b1('0x29')](function(_0x25be40){if(_0x25be40){_0x2022d4[_0xe6b1('0x34')]=_['keys'](db['JscriptySessionReport'][_0xe6b1('0x30')]);_0x2022d4['query']=_[_0xe6b1('0x48')](_0xa6259[_0xe6b1('0x35')]);_0x2022d4['filters']=_['intersection'](_0x2022d4[_0xe6b1('0x34')],_0x2022d4[_0xe6b1('0x35')]);_0x1d460f[_0xe6b1('0x37')]=_['intersection'](_0x2022d4[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0xa6259['query']['fields']));_0x1d460f[_0xe6b1('0x37')]=_0x1d460f[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x1d460f[_0xe6b1('0x37')]:_0x2022d4[_0xe6b1('0x34')];if(!_0xa6259[_0xe6b1('0x35')][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x1d460f[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0xa6259[_0xe6b1('0x35')]['limit']);_0x1d460f['offset']=qs[_0xe6b1('0x1f')](_0xa6259['query'][_0xe6b1('0x1f')]);}_0x1d460f['order']=qs[_0xe6b1('0x3d')](_0xa6259[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x1d460f['where']=qs[_0xe6b1('0x3e')](_[_0xe6b1('0x3f')](_0xa6259['query'],_0x2022d4['filters']));_0x1d460f[_0xe6b1('0x41')]['ProjectId']=_0x25be40['id'];if(_0xa6259['query'][_0xe6b1('0x40')]){_0x1d460f[_0xe6b1('0x41')]=_[_0xe6b1('0x43')](_0x1d460f['where'],{'$or':_[_0xe6b1('0x2e')](_0x1d460f[_0xe6b1('0x37')],function(_0x2e6702){var _0x2a8f88={};_0x2a8f88[_0x2e6702]={'$like':'%'+_0xa6259['query'][_0xe6b1('0x40')]+'%'};return _0x2a8f88;})});}_0x1d460f=_[_0xe6b1('0x43')]({},_0x1d460f,_0xa6259['options']);return db[_0xe6b1('0x5a')][_0xe6b1('0x21')]({'where':_0x1d460f[_0xe6b1('0x41')]})[_0xe6b1('0x29')](function(_0x8ddf3a){_0x376d67[_0xe6b1('0x21')]=_0x8ddf3a;if(_0xa6259['query'][_0xe6b1('0x49')]){_0x1d460f[_0xe6b1('0x4a')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe6b1('0x45')](_0x1d460f);})[_0xe6b1('0x29')](function(_0x268aed){_0x376d67[_0xe6b1('0x5b')]=_0x268aed;return _0x376d67;});}})[_0xe6b1('0x29')](respondWithFilteredResult(_0x12ef99,_0x1d460f))[_0xe6b1('0x46')](handleError(_0x12ef99,null));};exports[_0xe6b1('0x5c')]=function(_0x46d77b,_0x4f277d,_0x5a631c){var _0x5764c9={'raw':!![],'where':{}};var _0x3adb15={};var _0x33096d={'count':0x0,'rows':[]};return db[_0xe6b1('0x2f')][_0xe6b1('0x59')]({'where':{'id':_0x46d77b[_0xe6b1('0x47')]['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x4f277d,null))[_0xe6b1('0x29')](function(_0xe2a333){if(_0xe2a333){_0x3adb15[_0xe6b1('0x34')]=_[_0xe6b1('0x48')](db[_0xe6b1('0x5d')][_0xe6b1('0x30')]);_0x3adb15['query']=_[_0xe6b1('0x48')](_0x46d77b['query']);_0x3adb15[_0xe6b1('0x3e')]=_[_0xe6b1('0x36')](_0x3adb15[_0xe6b1('0x34')],_0x3adb15['query']);_0x5764c9[_0xe6b1('0x37')]=_['intersection'](_0x3adb15[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0x5764c9[_0xe6b1('0x37')]=_0x5764c9[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x5764c9[_0xe6b1('0x37')]:_0x3adb15[_0xe6b1('0x34')];if(!_0x46d77b['query'][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x5764c9[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x20')]);_0x5764c9[_0xe6b1('0x1f')]=qs[_0xe6b1('0x1f')](_0x46d77b['query'][_0xe6b1('0x1f')]);}_0x5764c9[_0xe6b1('0x3c')]=qs[_0xe6b1('0x3d')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x5764c9[_0xe6b1('0x41')]=qs[_0xe6b1('0x3e')](_['pick'](_0x46d77b[_0xe6b1('0x35')],_0x3adb15[_0xe6b1('0x3e')]));_0x5764c9[_0xe6b1('0x41')]['ProjectId']=_0xe2a333['id'];if(_0x46d77b['query']['filter']){_0x5764c9['where']=_[_0xe6b1('0x43')](_0x5764c9[_0xe6b1('0x41')],{'$or':_[_0xe6b1('0x2e')](_0x5764c9['attributes'],function(_0x4d8dc8){var _0x2c523b={};_0x2c523b[_0x4d8dc8]={'$like':'%'+_0x46d77b['query'][_0xe6b1('0x40')]+'%'};return _0x2c523b;})});}_0x5764c9=_[_0xe6b1('0x43')]({},_0x5764c9,_0x46d77b['options']);return db['JscriptyAnswerReport'][_0xe6b1('0x21')]({'where':_0x5764c9[_0xe6b1('0x41')]})[_0xe6b1('0x29')](function(_0x1780e0){_0x33096d[_0xe6b1('0x21')]=_0x1780e0;if(_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x49')]){_0x5764c9[_0xe6b1('0x4a')]=[{'all':!![]}];}return db[_0xe6b1('0x5d')][_0xe6b1('0x45')](_0x5764c9);})[_0xe6b1('0x29')](function(_0x396259){_0x33096d['rows']=_0x396259;return _0x33096d;});}})[_0xe6b1('0x29')](respondWithFilteredResult(_0x4f277d,_0x5764c9))[_0xe6b1('0x46')](handleError(_0x4f277d,null));};function char(_0x3e39fa){return _0xe6b1('0x5e')===typeof _0x3e39fa?String['fromCharCode'][_0xe6b1('0x22')](null,arguments):_0x3e39fa;}function needsEncapsulation(_0x535cd6){return!!_0x535cd6&&(_0x535cd6[_0xe6b1('0x5f')]()[_0xe6b1('0x60')](char(0xd))>=0x0||_0x535cd6[_0xe6b1('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x535cd6['toString']()[_0xe6b1('0x60')](char(0x2c))>=0x0||_0x535cd6[_0xe6b1('0x5f')]()[_0xe6b1('0x60')](char(0x22))>=0x0);}function encapsulate(_0xde7f3d){var _0x462acd=char(0x22),_0x4a5534='\x5c'+char(0x22),_0x4a6729=_0xde7f3d[_0xe6b1('0x5f')]()['replace'](new RegExp(_0x462acd,'g'),_0x4a5534);return _0x462acd+_0x4a6729+_0x462acd;}exports[_0xe6b1('0x61')]=function(_0x18cd66,_0x1f19d7,_0x511f4b){var _0x3ca99c,_0x373e96;var _0x5e7c0e={'where':{'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id']}};if(_0x18cd66['query']['startTime']){_0x5e7c0e[_0xe6b1('0x41')][_0xe6b1('0x62')]=JSON[_0xe6b1('0x63')](_0x18cd66[_0xe6b1('0x35')][_0xe6b1('0x64')]);}return db[_0xe6b1('0x5a')]['findAll'](_0x5e7c0e)[_0xe6b1('0x29')](handleEntityNotFound(_0x1f19d7,null))[_0xe6b1('0x29')](function(_0x30d567){if(_0x30d567){_0x3ca99c=_0x30d567;return db[_0xe6b1('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xe6b1('0x2e')](_0x3ca99c,'id')},'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x1f19d7,null))['then'](function(_0x3ee576){if(_0x3ee576){_0x373e96=_0x3ee576;var _0x2e443b={};for(var _0x73092d=0x0,_0x5c76be=_0x373e96[_0xe6b1('0x39')];_0x73092d<_0x5c76be;_0x73092d++){if(!_0x2e443b['hasOwnProperty'](_0x373e96[_0x73092d][_0xe6b1('0x66')])){_0x2e443b[_0x373e96[_0x73092d]['questionId']]=needsEncapsulation(_0x373e96[_0x73092d][_0xe6b1('0x67')])?encapsulate(_0x373e96[_0x73092d]['question']):_0x373e96[_0x73092d][_0xe6b1('0x67')];}}var _0x3883fc=[],_0x1e4d9f={};for(var _0x3b2296=0x0,_0x165d7f=_0x3ca99c['length'];_0x3b2296<_0x165d7f;_0x3b2296++){_0x1e4d9f={'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id'],'SessionId':_0x3ca99c[_0x3b2296]['id'],'StartTime':moment(_0x3ca99c[_0x3b2296][_0xe6b1('0x62')])[_0xe6b1('0x68')](_0xe6b1('0x69'))};for(var _0xd9c6bd=0x0,_0x4a5f2b=_0x373e96[_0xe6b1('0x39')];_0xd9c6bd<_0x4a5f2b;_0xd9c6bd++){if(_0x373e96[_0xd9c6bd]['SessionId']==_0x3ca99c[_0x3b2296]['id']&&_0x2e443b['hasOwnProperty'](_0x373e96[_0xd9c6bd][_0xe6b1('0x66')])){_0x1e4d9f[_0x2e443b[_0x373e96[_0xd9c6bd][_0xe6b1('0x66')]]]=_0x373e96[_0xd9c6bd][_0xe6b1('0x6a')];}}for(var _0x37ad90 in _0x2e443b){if(!_0x1e4d9f[_0xe6b1('0x3a')](_0x2e443b[_0x37ad90])){_0x1e4d9f[_0x2e443b[_0x37ad90]]=null;}}_0x3883fc['push'](_0x1e4d9f);}return _0x3883fc;}})[_0xe6b1('0x29')](function(_0x364c44){if(!_[_0xe6b1('0x6b')](_0x364c44)){var _0x2182de=toCsv(_0x364c44);var _0xbce7cf=Date[_0xe6b1('0x6c')]();fs[_0xe6b1('0x6d')](util[_0xe6b1('0x68')](_0xe6b1('0x6e'),_0x18cd66[_0xe6b1('0x47')]['id'],_0xbce7cf),_0x2182de);_0x1f19d7['setHeader'](_0xe6b1('0x6f'),'attachment;\x20filename='+util[_0xe6b1('0x68')](_0xe6b1('0x70'),_0x18cd66[_0xe6b1('0x47')]['id'],_0xbce7cf));_0x1f19d7[_0xe6b1('0x71')]('Content-type',_0xe6b1('0x72'));return _0x1f19d7['download'](util[_0xe6b1('0x68')](_0xe6b1('0x6e'),_0x18cd66['params']['id'],_0xbce7cf));}else{return _0x1f19d7[_0xe6b1('0x1b')](0xcc);}})['catch'](handleError(_0x1f19d7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 7ff3259..aa307d4 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 _0x4074=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x157712,_0xc29e01){var _0x23e9d9=function(_0x492bf5){while(--_0x492bf5){_0x157712['push'](_0x157712['shift']());}};_0x23e9d9(++_0xc29e01);}(_0x4074,0xf0));var _0x4407=function(_0x40f9ca,_0x1eeec0){_0x40f9ca=_0x40f9ca-0x0;var _0x37b71f=_0x4074[_0x40f9ca];return _0x37b71f;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d25=['path','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d25,0xba));var _0x51d2=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x1d25[_0x1d1219];return _0x5b5b89;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require('bluebird');var rp=require(_0x51d2('0x5'));var fs=require('fs');var path=require(_0x51d2('0x6'));var rimraf=require('rimraf');var config=require(_0x51d2('0x7'));var attributes=require(_0x51d2('0x8'));module[_0x51d2('0x9')]=function(_0x407091,_0x449fec){return _0x407091[_0x51d2('0xa')]('JscriptyProject',attributes,{'tableName':_0x51d2('0xb'),'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 eca569f..d19f0fd 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x87b9be,_0x21f311){var _0x5a0b89=function(_0x529266){while(--_0x529266){_0x87b9be['push'](_0x87b9be['shift']());}};_0x5a0b89(++_0x21f311);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4375af,_0x1c9918){var _0x138c81=function(_0x2db49c){while(--_0x2db49c){_0x4375af['push'](_0x4375af['shift']());}};_0x138c81(++_0x1c9918);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58437f,_0x52723b){_0x58437f=_0x58437f-0x0;var _0x2f13ef=_0xf4eb[_0x58437f];return _0x2f13ef;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index dad98a3..47bca4d 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 _0x35c1=['multer','util','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports'];(function(_0x59d88c,_0x44a315){var _0x32ba75=function(_0x388308){while(--_0x388308){_0x59d88c['push'](_0x59d88c['shift']());}};_0x32ba75(++_0x44a315);}(_0x35c1,0x156));var _0x135c=function(_0x6b44b0,_0x5d293b){_0x6b44b0=_0x6b44b0-0x0;var _0x559f60=_0x35c1[_0x6b44b0];return _0x559f60;};'use strict';var multer=require(_0x135c('0x0'));var util=require(_0x135c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x135c('0x2'));var router=express[_0x135c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x135c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x135c('0x5'));var controller=require(_0x135c('0x6'));router[_0x135c('0x7')]('/',auth[_0x135c('0x8')](),controller[_0x135c('0x9')]);router[_0x135c('0x7')](_0x135c('0xa'),auth[_0x135c('0x8')](),controller[_0x135c('0xb')]);router['get'](_0x135c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x135c('0xd')]('/',auth[_0x135c('0x8')](),controller['create']);router[_0x135c('0xe')]('/:id',auth[_0x135c('0x8')](),controller[_0x135c('0xf')]);router[_0x135c('0x10')]('/:id',auth[_0x135c('0x8')](),controller[_0x135c('0x11')]);module[_0x135c('0x12')]=router; \ No newline at end of file +var _0xc8ae=['../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc8ae,0x73));var _0xec8a=function(_0x1898d8,_0x20eabe){_0x1898d8=_0x1898d8-0x0;var _0x41e35c=_0xc8ae[_0x1898d8];return _0x41e35c;};'use strict';var multer=require('multer');var util=require(_0xec8a('0x0'));var path=require(_0xec8a('0x1'));var timeout=require(_0xec8a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xec8a('0x3'));var auth=require(_0xec8a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xec8a('0x5'));var controller=require(_0xec8a('0x6'));router['get']('/',auth[_0xec8a('0x7')](),controller[_0xec8a('0x8')]);router[_0xec8a('0x9')]('/describe',auth[_0xec8a('0x7')](),controller[_0xec8a('0xa')]);router[_0xec8a('0x9')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0xc')]);router[_0xec8a('0xd')]('/',auth[_0xec8a('0x7')](),controller[_0xec8a('0xe')]);router[_0xec8a('0xf')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0x10')]);router[_0xec8a('0x11')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0x12')]);module[_0xec8a('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c5c1e90..fb1a179 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x4c521b,_0x8ad473){_0x4c521b=_0x4c521b-0x0;var _0x3b4386=_0x7a54[_0x4c521b];return _0x3b4386;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x30e85a,_0x38e5b9){_0x30e85a=_0x30e85a-0x0;var _0x59770d=_0x7a54[_0x30e85a];return _0x59770d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 8a71ac2..c21c0ba 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 _0x059d=['moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','error','index','map','JscriptyQuestionReport','fieldName','key','keys','query','filters','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','name','options','then','includeAll','include','findAll','catch','show','rawAttributes','intersection','create','body','params','find','describe','eml-format','rimraf','fast-json-patch'];(function(_0x291f7b,_0x50ab8a){var _0x988074=function(_0x50824c){while(--_0x50824c){_0x291f7b['push'](_0x291f7b['shift']());}};_0x988074(++_0x50ab8a);}(_0x059d,0x8f));var _0xd059=function(_0x4fdbf5,_0x396648){_0x4fdbf5=_0x4fdbf5-0x0;var _0x1a859a=_0x059d[_0x4fdbf5];return _0x1a859a;};'use strict';var emlformat=require(_0xd059('0x0'));var rimraf=require(_0xd059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd059('0x2'));var rp=require('request-promise');var moment=require(_0xd059('0x3'));var BPromise=require(_0xd059('0x4'));var Mustache=require(_0xd059('0x5'));var util=require(_0xd059('0x6'));var path=require('path');var sox=require(_0xd059('0x7'));var csv=require('to-csv');var ejs=require(_0xd059('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd059('0x9'));var squel=require('squel');var crypto=require(_0xd059('0xa'));var jsforce=require(_0xd059('0xb'));var deskjs=require(_0xd059('0xc'));var toCsv=require(_0xd059('0xd'));var querystring=require(_0xd059('0xe'));var Papa=require('papaparse');var Redis=require(_0xd059('0xf'));var authService=require(_0xd059('0x10'));var qs=require(_0xd059('0x11'));var as=require(_0xd059('0x12'));var hardwareService=require(_0xd059('0x13'));var logger=require(_0xd059('0x14'))(_0xd059('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd059('0x16'));var db=require(_0xd059('0x17'))['db'];function respondWithStatusCode(_0x307807,_0x41cca8){_0x41cca8=_0x41cca8||0xcc;return function(_0x149642){if(_0x149642){return _0x307807['sendStatus'](_0x41cca8);}return _0x307807[_0xd059('0x18')](_0x41cca8)[_0xd059('0x19')]();};}function respondWithResult(_0x4ea292,_0x16c837){_0x16c837=_0x16c837||0xc8;return function(_0x143247){if(_0x143247){return _0x4ea292['status'](_0x16c837)[_0xd059('0x1a')](_0x143247);}};}function respondWithFilteredResult(_0x28703f,_0x331528){return function(_0x381bbd){if(_0x381bbd){var _0x2e7ce0=typeof _0x331528[_0xd059('0x1b')]==='undefined'&&typeof _0x331528[_0xd059('0x1c')]===_0xd059('0x1d');var _0x4bf98c=_0x381bbd[_0xd059('0x1e')];var _0x46e6e5=_0x2e7ce0?0x0:_0x331528[_0xd059('0x1b')];var _0xdb48cc=_0x2e7ce0?_0x381bbd[_0xd059('0x1e')]:_0x331528['offset']+_0x331528['limit'];var _0x3e4021;if(_0xdb48cc>=_0x4bf98c){_0xdb48cc=_0x4bf98c;_0x3e4021=0xc8;}else{_0x3e4021=0xce;}_0x28703f[_0xd059('0x18')](_0x3e4021);return _0x28703f[_0xd059('0x1f')]('Content-Range',_0x46e6e5+'-'+_0xdb48cc+'/'+_0x4bf98c)['json'](_0x381bbd);}return null;};}function patchUpdates(_0x29ceff){return function(_0x592496){try{jsonpatch[_0xd059('0x20')](_0x592496,_0x29ceff,!![]);}catch(_0x634b8b){return BPromise[_0xd059('0x21')](_0x634b8b);}return _0x592496[_0xd059('0x22')]();};}function saveUpdates(_0x3a656d,_0x135c2a){return function(_0x44d45c){if(_0x44d45c){return _0x44d45c[_0xd059('0x23')](_0x3a656d)['then'](function(_0x39f8ca){return _0x39f8ca;});}return null;};}function removeEntity(_0x2ad182,_0x4bb23f){return function(_0x3bfa2b){if(_0x3bfa2b){return _0x3bfa2b[_0xd059('0x24')]()['then'](function(){_0x2ad182[_0xd059('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eea25,_0x4e731f){return function(_0xf09619){if(!_0xf09619){_0x3eea25['sendStatus'](0x194);}return _0xf09619;};}function handleError(_0x6a7060,_0x5145ce){_0x5145ce=_0x5145ce||0x1f4;return function(_0x11b961){logger[_0xd059('0x25')](_0x11b961['stack']);if(_0x11b961['name']){delete _0x11b961['name'];}_0x6a7060[_0xd059('0x18')](_0x5145ce)['send'](_0x11b961);};}exports[_0xd059('0x26')]=function(_0x184dc6,_0x581377){var _0x4cb4f4={},_0x1bc0a0={},_0xb97665={'count':0x0,'rows':[]};var _0x3bea44=_[_0xd059('0x27')](db[_0xd059('0x28')]['rawAttributes'],function(_0x278287){return{'name':_0x278287[_0xd059('0x29')],'type':_0x278287['type'][_0xd059('0x2a')]};});_0x1bc0a0['model']=_[_0xd059('0x27')](_0x3bea44,'name');_0x1bc0a0['query']=_[_0xd059('0x2b')](_0x184dc6[_0xd059('0x2c')]);_0x1bc0a0[_0xd059('0x2d')]=_['intersection'](_0x1bc0a0['model'],_0x1bc0a0[_0xd059('0x2c')]);_0x4cb4f4['attributes']=_['intersection'](_0x1bc0a0['model'],qs['fields'](_0x184dc6['query'][_0xd059('0x2e')]));_0x4cb4f4[_0xd059('0x2f')]=_0x4cb4f4[_0xd059('0x2f')][_0xd059('0x30')]?_0x4cb4f4[_0xd059('0x2f')]:_0x1bc0a0[_0xd059('0x31')];if(!_0x184dc6[_0xd059('0x2c')][_0xd059('0x32')](_0xd059('0x33'))){_0x4cb4f4['limit']=qs['limit'](_0x184dc6['query'][_0xd059('0x1c')]);_0x4cb4f4[_0xd059('0x1b')]=qs[_0xd059('0x1b')](_0x184dc6[_0xd059('0x2c')]['offset']);}_0x4cb4f4[_0xd059('0x34')]=qs['sort'](_0x184dc6[_0xd059('0x2c')][_0xd059('0x35')]);_0x4cb4f4[_0xd059('0x36')]=qs[_0xd059('0x2d')](_[_0xd059('0x37')](_0x184dc6['query'],_0x1bc0a0[_0xd059('0x2d')]),_0x3bea44);if(_0x184dc6[_0xd059('0x2c')][_0xd059('0x38')]){_0x4cb4f4[_0xd059('0x36')]=_['merge'](_0x4cb4f4['where'],{'$or':_[_0xd059('0x27')](_0x3bea44,function(_0x53cc2e){if(_0x53cc2e[_0xd059('0x39')]!=='VIRTUAL'){var _0x13d94e={};_0x13d94e[_0x53cc2e[_0xd059('0x3a')]]={'$like':'%'+_0x184dc6[_0xd059('0x2c')][_0xd059('0x38')]+'%'};return _0x13d94e;}})});}_0x4cb4f4=_['merge']({},_0x4cb4f4,_0x184dc6[_0xd059('0x3b')]);var _0x21e8f3={'where':_0x4cb4f4['where']};return db['JscriptyQuestionReport']['count'](_0x21e8f3)[_0xd059('0x3c')](function(_0x129f46){_0xb97665['count']=_0x129f46;if(_0x184dc6[_0xd059('0x2c')][_0xd059('0x3d')]){_0x4cb4f4[_0xd059('0x3e')]=[{'all':!![]}];}return db[_0xd059('0x28')][_0xd059('0x3f')](_0x4cb4f4);})['then'](function(_0x414cd6){_0xb97665['rows']=_0x414cd6;return _0xb97665;})['then'](respondWithFilteredResult(_0x581377,_0x4cb4f4))[_0xd059('0x40')](handleError(_0x581377,null));};exports[_0xd059('0x41')]=function(_0x1cab7b,_0x1c7d69){var _0x25c620={'raw':!![],'where':{'id':_0x1cab7b['params']['id']}},_0x33a3a7={};_0x33a3a7[_0xd059('0x31')]=_[_0xd059('0x2b')](db[_0xd059('0x28')][_0xd059('0x42')]);_0x33a3a7[_0xd059('0x2c')]=_[_0xd059('0x2b')](_0x1cab7b['query']);_0x33a3a7[_0xd059('0x2d')]=_[_0xd059('0x43')](_0x33a3a7[_0xd059('0x31')],_0x33a3a7[_0xd059('0x2c')]);_0x25c620['attributes']=_[_0xd059('0x43')](_0x33a3a7['model'],qs[_0xd059('0x2e')](_0x1cab7b[_0xd059('0x2c')]['fields']));_0x25c620[_0xd059('0x2f')]=_0x25c620['attributes'][_0xd059('0x30')]?_0x25c620[_0xd059('0x2f')]:_0x33a3a7[_0xd059('0x31')];if(_0x1cab7b['query']['includeAll']){_0x25c620[_0xd059('0x3e')]=[{'all':!![]}];}_0x25c620=_['merge']({},_0x25c620,_0x1cab7b[_0xd059('0x3b')]);return db[_0xd059('0x28')]['find'](_0x25c620)[_0xd059('0x3c')](handleEntityNotFound(_0x1c7d69,null))[_0xd059('0x3c')](respondWithResult(_0x1c7d69,null))[_0xd059('0x40')](handleError(_0x1c7d69,null));};exports[_0xd059('0x44')]=function(_0x7e4783,_0xff26fb){return db[_0xd059('0x28')][_0xd059('0x44')](_0x7e4783[_0xd059('0x45')],{})[_0xd059('0x3c')](respondWithResult(_0xff26fb,0xc9))[_0xd059('0x40')](handleError(_0xff26fb,null));};exports['update']=function(_0x464299,_0x2e0634){if(_0x464299[_0xd059('0x45')]['id']){delete _0x464299['body']['id'];}return db[_0xd059('0x28')]['find']({'where':{'id':_0x464299[_0xd059('0x46')]['id']}})[_0xd059('0x3c')](handleEntityNotFound(_0x2e0634,null))[_0xd059('0x3c')](saveUpdates(_0x464299[_0xd059('0x45')],null))[_0xd059('0x3c')](respondWithResult(_0x2e0634,null))[_0xd059('0x40')](handleError(_0x2e0634,null));};exports[_0xd059('0x24')]=function(_0xe9651b,_0x5787f5){return db[_0xd059('0x28')][_0xd059('0x47')]({'where':{'id':_0xe9651b[_0xd059('0x46')]['id']}})['then'](handleEntityNotFound(_0x5787f5,null))[_0xd059('0x3c')](removeEntity(_0x5787f5,null))[_0xd059('0x40')](handleError(_0x5787f5,null));};exports[_0xd059('0x48')]=function(_0x427da6,_0xf51a44){return db[_0xd059('0x28')][_0xd059('0x48')]()[_0xd059('0x3c')](respondWithResult(_0xf51a44,null))[_0xd059('0x40')](handleError(_0xf51a44,null));}; \ No newline at end of file +var _0xe98c=['create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','findAll','catch','params','length','include','merge','find'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xe98c,0x1c6));var _0xce98=function(_0x59f6be,_0x472a09){_0x59f6be=_0x59f6be-0x0;var _0x2aef59=_0xe98c[_0x59f6be];return _0x2aef59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce98('0x0'));var zipdir=require(_0xce98('0x1'));var jsonpatch=require(_0xce98('0x2'));var rp=require(_0xce98('0x3'));var moment=require('moment');var BPromise=require(_0xce98('0x4'));var Mustache=require(_0xce98('0x5'));var util=require(_0xce98('0x6'));var path=require(_0xce98('0x7'));var sox=require(_0xce98('0x8'));var csv=require(_0xce98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce98('0xa'));var _=require(_0xce98('0xb'));var squel=require(_0xce98('0xc'));var crypto=require(_0xce98('0xd'));var jsforce=require(_0xce98('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce98('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce98('0xf'));var authService=require(_0xce98('0x10'));var qs=require(_0xce98('0x11'));var as=require(_0xce98('0x12'));var hardwareService=require(_0xce98('0x13'));var logger=require(_0xce98('0x14'))(_0xce98('0x15'));var utils=require(_0xce98('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce98('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281f7c,_0xc6222d){_0xc6222d=_0xc6222d||0xcc;return function(_0xbd86d8){if(_0xbd86d8){return _0x281f7c[_0xce98('0x18')](_0xc6222d);}return _0x281f7c[_0xce98('0x19')](_0xc6222d)[_0xce98('0x1a')]();};}function respondWithResult(_0x22fa21,_0x6b1163){_0x6b1163=_0x6b1163||0xc8;return function(_0xe59a16){if(_0xe59a16){return _0x22fa21[_0xce98('0x19')](_0x6b1163)[_0xce98('0x1b')](_0xe59a16);}};}function respondWithFilteredResult(_0x1a9a9c,_0x3b94fc){return function(_0x3a72fa){if(_0x3a72fa){var _0x4601a5=typeof _0x3b94fc[_0xce98('0x1c')]===_0xce98('0x1d')&&typeof _0x3b94fc[_0xce98('0x1e')]===_0xce98('0x1d');var _0x29f629=_0x3a72fa[_0xce98('0x1f')];var _0x17d7e9=_0x4601a5?0x0:_0x3b94fc['offset'];var _0x11ecd2=_0x4601a5?_0x3a72fa[_0xce98('0x1f')]:_0x3b94fc[_0xce98('0x1c')]+_0x3b94fc[_0xce98('0x1e')];var _0x74336e;if(_0x11ecd2>=_0x29f629){_0x11ecd2=_0x29f629;_0x74336e=0xc8;}else{_0x74336e=0xce;}_0x1a9a9c[_0xce98('0x19')](_0x74336e);return _0x1a9a9c['set']('Content-Range',_0x17d7e9+'-'+_0x11ecd2+'/'+_0x29f629)[_0xce98('0x1b')](_0x3a72fa);}return null;};}function patchUpdates(_0xd05505){return function(_0x19fc56){try{jsonpatch[_0xce98('0x20')](_0x19fc56,_0xd05505,!![]);}catch(_0x32f4bd){return BPromise[_0xce98('0x21')](_0x32f4bd);}return _0x19fc56[_0xce98('0x22')]();};}function saveUpdates(_0x1c0bd8,_0x839600){return function(_0xa18e7b){if(_0xa18e7b){return _0xa18e7b[_0xce98('0x23')](_0x1c0bd8)[_0xce98('0x24')](function(_0x2e5d58){return _0x2e5d58;});}return null;};}function removeEntity(_0x3f4b1a,_0x4cea28){return function(_0xbdfd60){if(_0xbdfd60){return _0xbdfd60['destroy']()['then'](function(){_0x3f4b1a[_0xce98('0x19')](0xcc)[_0xce98('0x1a')]();});}};}function handleEntityNotFound(_0x9e1b7e,_0x266b60){return function(_0x21e8b3){if(!_0x21e8b3){_0x9e1b7e[_0xce98('0x18')](0x194);}return _0x21e8b3;};}function handleError(_0x2753c7,_0x1cbe02){_0x1cbe02=_0x1cbe02||0x1f4;return function(_0x234406){logger[_0xce98('0x25')](_0x234406[_0xce98('0x26')]);if(_0x234406['name']){delete _0x234406[_0xce98('0x27')];}_0x2753c7[_0xce98('0x19')](_0x1cbe02)[_0xce98('0x28')](_0x234406);};}exports[_0xce98('0x29')]=function(_0x3c4cfc,_0x2d7a16){var _0x1caa52={},_0x32a0a8={},_0x37eadd={'count':0x0,'rows':[]};var _0xd55217=_[_0xce98('0x2a')](db[_0xce98('0x2b')][_0xce98('0x2c')],function(_0x4ce974){return{'name':_0x4ce974[_0xce98('0x2d')],'type':_0x4ce974[_0xce98('0x2e')][_0xce98('0x2f')]};});_0x32a0a8[_0xce98('0x30')]=_['map'](_0xd55217,_0xce98('0x27'));_0x32a0a8[_0xce98('0x31')]=_[_0xce98('0x32')](_0x3c4cfc['query']);_0x32a0a8[_0xce98('0x33')]=_['intersection'](_0x32a0a8[_0xce98('0x30')],_0x32a0a8[_0xce98('0x31')]);_0x1caa52[_0xce98('0x34')]=_[_0xce98('0x35')](_0x32a0a8[_0xce98('0x30')],qs[_0xce98('0x36')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x36')]));_0x1caa52[_0xce98('0x34')]=_0x1caa52[_0xce98('0x34')]['length']?_0x1caa52['attributes']:_0x32a0a8[_0xce98('0x30')];if(!_0x3c4cfc['query'][_0xce98('0x37')](_0xce98('0x38'))){_0x1caa52[_0xce98('0x1e')]=qs['limit'](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x1e')]);_0x1caa52[_0xce98('0x1c')]=qs[_0xce98('0x1c')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x1c')]);}_0x1caa52[_0xce98('0x39')]=qs[_0xce98('0x3a')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3a')]);_0x1caa52[_0xce98('0x3b')]=qs[_0xce98('0x33')](_['pick'](_0x3c4cfc[_0xce98('0x31')],_0x32a0a8['filters']),_0xd55217);if(_0x3c4cfc[_0xce98('0x31')]['filter']){_0x1caa52['where']=_['merge'](_0x1caa52['where'],{'$or':_['map'](_0xd55217,function(_0x1636c1){if(_0x1636c1[_0xce98('0x2e')]!==_0xce98('0x3c')){var _0x19b583={};_0x19b583[_0x1636c1[_0xce98('0x27')]]={'$like':'%'+_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3d')]+'%'};return _0x19b583;}})});}_0x1caa52=_['merge']({},_0x1caa52,_0x3c4cfc[_0xce98('0x3e')]);var _0x11b51b={'where':_0x1caa52['where']};return db[_0xce98('0x2b')][_0xce98('0x1f')](_0x11b51b)[_0xce98('0x24')](function(_0x4c25b8){_0x37eadd[_0xce98('0x1f')]=_0x4c25b8;if(_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3f')]){_0x1caa52['include']=[{'all':!![]}];}return db[_0xce98('0x2b')][_0xce98('0x40')](_0x1caa52);})[_0xce98('0x24')](function(_0x58f03e){_0x37eadd['rows']=_0x58f03e;return _0x37eadd;})[_0xce98('0x24')](respondWithFilteredResult(_0x2d7a16,_0x1caa52))[_0xce98('0x41')](handleError(_0x2d7a16,null));};exports['show']=function(_0x2f839c,_0x16f3e7){var _0xbf5914={'raw':!![],'where':{'id':_0x2f839c[_0xce98('0x42')]['id']}},_0xca343f={};_0xca343f[_0xce98('0x30')]=_[_0xce98('0x32')](db['JscriptyQuestionReport'][_0xce98('0x2c')]);_0xca343f[_0xce98('0x31')]=_[_0xce98('0x32')](_0x2f839c[_0xce98('0x31')]);_0xca343f[_0xce98('0x33')]=_[_0xce98('0x35')](_0xca343f[_0xce98('0x30')],_0xca343f[_0xce98('0x31')]);_0xbf5914[_0xce98('0x34')]=_[_0xce98('0x35')](_0xca343f[_0xce98('0x30')],qs[_0xce98('0x36')](_0x2f839c[_0xce98('0x31')][_0xce98('0x36')]));_0xbf5914[_0xce98('0x34')]=_0xbf5914[_0xce98('0x34')][_0xce98('0x43')]?_0xbf5914[_0xce98('0x34')]:_0xca343f['model'];if(_0x2f839c[_0xce98('0x31')][_0xce98('0x3f')]){_0xbf5914[_0xce98('0x44')]=[{'all':!![]}];}_0xbf5914=_[_0xce98('0x45')]({},_0xbf5914,_0x2f839c['options']);return db[_0xce98('0x2b')][_0xce98('0x46')](_0xbf5914)[_0xce98('0x24')](handleEntityNotFound(_0x16f3e7,null))[_0xce98('0x24')](respondWithResult(_0x16f3e7,null))[_0xce98('0x41')](handleError(_0x16f3e7,null));};exports[_0xce98('0x47')]=function(_0x1bedaf,_0x38690c){return db[_0xce98('0x2b')][_0xce98('0x47')](_0x1bedaf['body'],{})['then'](respondWithResult(_0x38690c,0xc9))[_0xce98('0x41')](handleError(_0x38690c,null));};exports[_0xce98('0x23')]=function(_0x14ba60,_0x4ce36c){if(_0x14ba60[_0xce98('0x48')]['id']){delete _0x14ba60[_0xce98('0x48')]['id'];}return db[_0xce98('0x2b')][_0xce98('0x46')]({'where':{'id':_0x14ba60[_0xce98('0x42')]['id']}})[_0xce98('0x24')](handleEntityNotFound(_0x4ce36c,null))[_0xce98('0x24')](saveUpdates(_0x14ba60[_0xce98('0x48')],null))[_0xce98('0x24')](respondWithResult(_0x4ce36c,null))['catch'](handleError(_0x4ce36c,null));};exports[_0xce98('0x49')]=function(_0x552982,_0x387caa){return db['JscriptyQuestionReport'][_0xce98('0x46')]({'where':{'id':_0x552982[_0xce98('0x42')]['id']}})[_0xce98('0x24')](handleEntityNotFound(_0x387caa,null))[_0xce98('0x24')](removeEntity(_0x387caa,null))[_0xce98('0x41')](handleError(_0x387caa,null));};exports[_0xce98('0x4a')]=function(_0x49046d,_0x10251f){return db[_0xce98('0x2b')]['describe']()[_0xce98('0x24')](respondWithResult(_0x10251f,null))[_0xce98('0x41')](handleError(_0x10251f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1342255..8e12942 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 _0xdef1=['bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdef1,0x1b4));var _0x1def=function(_0x234fb0,_0x563158){_0x234fb0=_0x234fb0-0x0;var _0x24cc55=_0xdef1[_0x234fb0];return _0x24cc55;};'use strict';var _=require(_0x1def('0x0'));var util=require(_0x1def('0x1'));var logger=require(_0x1def('0x2'))(_0x1def('0x3'));var moment=require('moment');var BPromise=require(_0x1def('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1def('0x5'));var rimraf=require(_0x1def('0x6'));var config=require('../../config/environment');var attributes=require(_0x1def('0x7'));module[_0x1def('0x8')]=function(_0x58d87c,_0xbe27ed){return _0x58d87c['define'](_0x1def('0x9'),attributes,{'tableName':_0x1def('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fe7=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x7fe7,0x1e7));var _0x77fe=function(_0x12605e,_0x3d8305){_0x12605e=_0x12605e-0x0;var _0x35fb69=_0x7fe7[_0x12605e];return _0x35fb69;};'use strict';var _=require(_0x77fe('0x0'));var util=require(_0x77fe('0x1'));var logger=require('../../config/logger')(_0x77fe('0x2'));var moment=require(_0x77fe('0x3'));var BPromise=require(_0x77fe('0x4'));var rp=require(_0x77fe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77fe('0x6'));var config=require(_0x77fe('0x7'));var attributes=require(_0x77fe('0x8'));module[_0x77fe('0x9')]=function(_0x58906f,_0x9ded71){return _0x58906f[_0x77fe('0xa')](_0x77fe('0xb'),attributes,{'tableName':_0x77fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index ab83e34..fc51983 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 _0x7057=['../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x11033b,_0x24a21f){var _0x24974e=function(_0x3d4a6e){while(--_0x3d4a6e){_0x11033b['push'](_0x11033b['shift']());}};_0x24974e(++_0x24a21f);}(_0x7057,0x1f1));var _0x7705=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7057[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7705('0x0'));var util=require('util');var moment=require(_0x7705('0x1'));var BPromise=require(_0x7705('0x2'));var rs=require(_0x7705('0x3'));var fs=require('fs');var Redis=require(_0x7705('0x4'));var db=require(_0x7705('0x5'))['db'];var utils=require(_0x7705('0x6'));var logger=require(_0x7705('0x7'))(_0x7705('0x8'));var config=require(_0x7705('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7705('0xa')][_0x7705('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x286f66,_0x3f12aa,_0x3fb02b){return new BPromise(function(_0x198ba3,_0x370856){return client[_0x7705('0xc')](_0x286f66,_0x3fb02b)[_0x7705('0xd')](function(_0xc041ff){logger[_0x7705('0xe')](_0x7705('0xf'),_0x3f12aa,_0x7705('0x10'));logger[_0x7705('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3f12aa,_0x7705('0x10'),JSON[_0x7705('0x12')](_0xc041ff));if(_0xc041ff[_0x7705('0x13')]){if(_0xc041ff[_0x7705('0x13')][_0x7705('0x14')]===0x1f4){logger[_0x7705('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3f12aa,_0xc041ff['error']['message']);return _0x370856(_0xc041ff[_0x7705('0x13')][_0x7705('0x15')]);}logger[_0x7705('0x13')](_0x7705('0xf'),_0x3f12aa,_0xc041ff[_0x7705('0x13')][_0x7705('0x15')]);return _0x198ba3(_0xc041ff[_0x7705('0x13')][_0x7705('0x15')]);}else{logger[_0x7705('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3f12aa,_0x7705('0x10'));_0x198ba3(_0xc041ff['result']['message']);}})['catch'](function(_0x56afe4){logger[_0x7705('0x13')](_0x7705('0xf'),_0x3f12aa,_0x56afe4);_0x370856(_0x56afe4);});});} \ No newline at end of file +var _0x1e5a=['../../config/environment','jayson/promise','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1283eb,_0x89559){var _0x574965=function(_0x4dc614){while(--_0x4dc614){_0x1283eb['push'](_0x1283eb['shift']());}};_0x574965(++_0x89559);}(_0x1e5a,0xd4));var _0xa1e5=function(_0x249315,_0x16a14d){_0x249315=_0x249315-0x0;var _0x27a2f2=_0x1e5a[_0x249315];return _0x27a2f2;};'use strict';var _=require('lodash');var util=require(_0xa1e5('0x0'));var moment=require('moment');var BPromise=require(_0xa1e5('0x1'));var rs=require(_0xa1e5('0x2'));var fs=require('fs');var Redis=require(_0xa1e5('0x3'));var db=require(_0xa1e5('0x4'))['db'];var utils=require(_0xa1e5('0x5'));var logger=require(_0xa1e5('0x6'))(_0xa1e5('0x7'));var config=require(_0xa1e5('0x8'));var jayson=require(_0xa1e5('0x9'));var client=jayson['client'][_0xa1e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x543339,_0x242685,_0x1de3fd){return new BPromise(function(_0x42949f,_0xf21862){return client[_0xa1e5('0xb')](_0x543339,_0x1de3fd)[_0xa1e5('0xc')](function(_0x5181ff){logger['info'](_0xa1e5('0xd'),_0x242685,_0xa1e5('0xe'));logger['debug'](_0xa1e5('0xf'),_0x242685,_0xa1e5('0xe'),JSON[_0xa1e5('0x10')](_0x5181ff));if(_0x5181ff['error']){if(_0x5181ff['error']['code']===0x1f4){logger[_0xa1e5('0x11')](_0xa1e5('0xd'),_0x242685,_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);return _0xf21862(_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x242685,_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);return _0x42949f(_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);}else{logger[_0xa1e5('0x13')](_0xa1e5('0xd'),_0x242685,_0xa1e5('0xe'));_0x42949f(_0x5181ff[_0xa1e5('0x14')][_0xa1e5('0x12')]);}})[_0xa1e5('0x15')](function(_0x573b01){logger[_0xa1e5('0x11')](_0xa1e5('0xd'),_0x242685,_0x573b01);_0xf21862(_0x573b01);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f66800c..0bd52e4 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 _0x7d6f=['describe','/:id','isAuthenticated','show','/:id/questions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x17d090,_0x4fc0c7){var _0x1c89b8=function(_0x22b90a){while(--_0x22b90a){_0x17d090['push'](_0x17d090['shift']());}};_0x1c89b8(++_0x4fc0c7);}(_0x7d6f,0xc4));var _0xf7d6=function(_0xfaa329,_0x1c3a4b){_0xfaa329=_0xfaa329-0x0;var _0x59805b=_0x7d6f[_0xfaa329];return _0x59805b;};'use strict';var multer=require(_0xf7d6('0x0'));var util=require(_0xf7d6('0x1'));var path=require(_0xf7d6('0x2'));var timeout=require('connect-timeout');var express=require(_0xf7d6('0x3'));var router=express[_0xf7d6('0x4')]();var fs_extra=require(_0xf7d6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf7d6('0x6'));var config=require(_0xf7d6('0x7'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf7d6('0x8')]);router[_0xf7d6('0x9')](_0xf7d6('0xa'),auth['isAuthenticated'](),controller[_0xf7d6('0xb')]);router['get'](_0xf7d6('0xc'),auth[_0xf7d6('0xd')](),controller[_0xf7d6('0xe')]);router[_0xf7d6('0x9')](_0xf7d6('0xf'),auth[_0xf7d6('0xd')](),controller['getQuestions']);router[_0xf7d6('0x10')]('/',auth[_0xf7d6('0xd')](),controller[_0xf7d6('0x11')]);router[_0xf7d6('0x12')](_0xf7d6('0xc'),auth[_0xf7d6('0xd')](),controller[_0xf7d6('0x13')]);router[_0xf7d6('0x14')](_0xf7d6('0xc'),auth['isAuthenticated'](),controller[_0xf7d6('0x15')]);module[_0xf7d6('0x16')]=router; \ No newline at end of file +var _0xa566=['/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0xef33b7,_0x161990){var _0x166c0d=function(_0x1c0d94){while(--_0x1c0d94){_0xef33b7['push'](_0xef33b7['shift']());}};_0x166c0d(++_0x161990);}(_0xa566,0x12c));var _0x6a56=function(_0x191e50,_0x28a44d){_0x191e50=_0x191e50-0x0;var _0x477fca=_0xa566[_0x191e50];return _0x477fca;};'use strict';var multer=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var timeout=require(_0x6a56('0x3'));var express=require(_0x6a56('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a56('0x5'));var interaction=require(_0x6a56('0x6'));var config=require(_0x6a56('0x7'));var controller=require(_0x6a56('0x8'));router[_0x6a56('0x9')]('/',auth[_0x6a56('0xa')](),controller[_0x6a56('0xb')]);router[_0x6a56('0x9')](_0x6a56('0xc'),auth['isAuthenticated'](),controller[_0x6a56('0xd')]);router[_0x6a56('0x9')](_0x6a56('0xe'),auth['isAuthenticated'](),controller[_0x6a56('0xf')]);router['get'](_0x6a56('0x10'),auth[_0x6a56('0xa')](),controller[_0x6a56('0x11')]);router[_0x6a56('0x12')]('/',auth[_0x6a56('0xa')](),controller[_0x6a56('0x13')]);router[_0x6a56('0x14')](_0x6a56('0xe'),auth[_0x6a56('0xa')](),controller['update']);router[_0x6a56('0x15')](_0x6a56('0xe'),auth[_0x6a56('0xa')](),controller[_0x6a56('0x16')]);module[_0x6a56('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 54d708d..05829e0 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 _0x604c=['DATE','setDataValue','format','STRING','moment','exports'];(function(_0x53de12,_0xdd481a){var _0x437439=function(_0x2940f9){while(--_0x2940f9){_0x53de12['push'](_0x53de12['shift']());}};_0x437439(++_0xdd481a);}(_0x604c,0x1f0));var _0xc604=function(_0x5937cc,_0x19ce5a){_0x5937cc=_0x5937cc-0x0;var _0x200b89=_0x604c[_0x5937cc];return _0x200b89;};'use strict';var moment=require(_0xc604('0x0'));var Sequelize=require('sequelize');module[_0xc604('0x1')]={'starttime':{'type':Sequelize[_0xc604('0x2')],'set':function(_0x3a8128){this['setDataValue']('starttime',_0x3a8128);this[_0xc604('0x3')]('endtime',moment()[_0xc604('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xc604('0x2')]},'membername':{'type':Sequelize[_0xc604('0x5')]},'projectname':{'type':Sequelize[_0xc604('0x5')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc604('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x685b=['DATE','starttime','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x685b,0xbd));var _0xb685=function(_0x18d60d,_0x5dd41a){_0x18d60d=_0x18d60d-0x0;var _0x215743=_0x685b[_0x18d60d];return _0x215743;};'use strict';var moment=require(_0xb685('0x0'));var Sequelize=require(_0xb685('0x1'));module[_0xb685('0x2')]={'starttime':{'type':Sequelize[_0xb685('0x3')],'set':function(_0x11637c){this['setDataValue'](_0xb685('0x4'),_0x11637c);this[_0xb685('0x5')]('endtime',moment()['format'](_0xb685('0x6')));}},'endtime':{'type':Sequelize[_0xb685('0x3')]},'membername':{'type':Sequelize[_0xb685('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb685('0x7')]},'uniqueid':{'type':Sequelize[_0xb685('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 393fe56..a4e7c31 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 _0xbca8=['../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','options','JscriptySessionReport','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getQuestions','hasOwnProperty','pick','SessionId','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0xbca8,0x122));var _0x8bca=function(_0x12b79d,_0x14a4dd){_0x12b79d=_0x12b79d-0x0;var _0x469b87=_0xbca8[_0x12b79d];return _0x469b87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bca('0x0'));var zipdir=require(_0x8bca('0x1'));var jsonpatch=require(_0x8bca('0x2'));var rp=require(_0x8bca('0x3'));var moment=require(_0x8bca('0x4'));var BPromise=require(_0x8bca('0x5'));var Mustache=require(_0x8bca('0x6'));var util=require(_0x8bca('0x7'));var path=require(_0x8bca('0x8'));var sox=require(_0x8bca('0x9'));var csv=require(_0x8bca('0xa'));var ejs=require(_0x8bca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bca('0xc'));var squel=require(_0x8bca('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8bca('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require('ioredis');var authService=require(_0x8bca('0x11'));var qs=require(_0x8bca('0x12'));var as=require(_0x8bca('0x13'));var hardwareService=require(_0x8bca('0x14'));var logger=require('../../config/logger')(_0x8bca('0x15'));var utils=require(_0x8bca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8bca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x434f3,_0x38e756){_0x38e756=_0x38e756||0xcc;return function(_0x431753){if(_0x431753){return _0x434f3[_0x8bca('0x18')](_0x38e756);}return _0x434f3[_0x8bca('0x19')](_0x38e756)['end']();};}function respondWithResult(_0x514712,_0xf16bb0){_0xf16bb0=_0xf16bb0||0xc8;return function(_0x3d9e0c){if(_0x3d9e0c){return _0x514712[_0x8bca('0x19')](_0xf16bb0)['json'](_0x3d9e0c);}};}function respondWithFilteredResult(_0x531fe0,_0xc9ac4e){return function(_0x1065f7){if(_0x1065f7){var _0x4a3112=typeof _0xc9ac4e[_0x8bca('0x1a')]===_0x8bca('0x1b')&&typeof _0xc9ac4e[_0x8bca('0x1c')]===_0x8bca('0x1b');var _0x4cbec7=_0x1065f7[_0x8bca('0x1d')];var _0x564337=_0x4a3112?0x0:_0xc9ac4e[_0x8bca('0x1a')];var _0x2eba4c=_0x4a3112?_0x1065f7[_0x8bca('0x1d')]:_0xc9ac4e['offset']+_0xc9ac4e[_0x8bca('0x1c')];var _0x2ed3f2;if(_0x2eba4c>=_0x4cbec7){_0x2eba4c=_0x4cbec7;_0x2ed3f2=0xc8;}else{_0x2ed3f2=0xce;}_0x531fe0['status'](_0x2ed3f2);return _0x531fe0[_0x8bca('0x1e')](_0x8bca('0x1f'),_0x564337+'-'+_0x2eba4c+'/'+_0x4cbec7)['json'](_0x1065f7);}return null;};}function patchUpdates(_0x2bdc67){return function(_0x43cfd8){try{jsonpatch[_0x8bca('0x20')](_0x43cfd8,_0x2bdc67,!![]);}catch(_0x1d05b7){return BPromise[_0x8bca('0x21')](_0x1d05b7);}return _0x43cfd8[_0x8bca('0x22')]();};}function saveUpdates(_0x4836f8,_0x4270e8){return function(_0x1e53a3){if(_0x1e53a3){return _0x1e53a3[_0x8bca('0x23')](_0x4836f8)['then'](function(_0x543c37){return _0x543c37;});}return null;};}function removeEntity(_0x4d5b67,_0x5ea0c2){return function(_0xcaad5b){if(_0xcaad5b){return _0xcaad5b[_0x8bca('0x24')]()['then'](function(){_0x4d5b67[_0x8bca('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554135,_0x25df58){return function(_0x55d4f5){if(!_0x55d4f5){_0x554135[_0x8bca('0x18')](0x194);}return _0x55d4f5;};}function handleError(_0x493ad5,_0xf65f9b){_0xf65f9b=_0xf65f9b||0x1f4;return function(_0xb04232){logger[_0x8bca('0x25')](_0xb04232[_0x8bca('0x26')]);if(_0xb04232[_0x8bca('0x27')]){delete _0xb04232['name'];}_0x493ad5[_0x8bca('0x19')](_0xf65f9b)['send'](_0xb04232);};}exports[_0x8bca('0x28')]=function(_0x20f9fd,_0x228feb){var _0x51524f={},_0x9f16be={},_0x4326d6={'count':0x0,'rows':[]};var _0x104311=_[_0x8bca('0x29')](db['JscriptySessionReport'][_0x8bca('0x2a')],function(_0x4d6592){return{'name':_0x4d6592['fieldName'],'type':_0x4d6592['type'][_0x8bca('0x2b')]};});_0x9f16be[_0x8bca('0x2c')]=_['map'](_0x104311,_0x8bca('0x27'));_0x9f16be['query']=_['keys'](_0x20f9fd[_0x8bca('0x2d')]);_0x9f16be[_0x8bca('0x2e')]=_[_0x8bca('0x2f')](_0x9f16be[_0x8bca('0x2c')],_0x9f16be[_0x8bca('0x2d')]);_0x51524f[_0x8bca('0x30')]=_[_0x8bca('0x2f')](_0x9f16be[_0x8bca('0x2c')],qs[_0x8bca('0x31')](_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x31')]));_0x51524f['attributes']=_0x51524f[_0x8bca('0x30')][_0x8bca('0x32')]?_0x51524f[_0x8bca('0x30')]:_0x9f16be[_0x8bca('0x2c')];if(!_0x20f9fd['query']['hasOwnProperty'](_0x8bca('0x33'))){_0x51524f[_0x8bca('0x1c')]=qs['limit'](_0x20f9fd['query'][_0x8bca('0x1c')]);_0x51524f[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x1a')]);}_0x51524f[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x51524f['where']=qs[_0x8bca('0x2e')](_['pick'](_0x20f9fd[_0x8bca('0x2d')],_0x9f16be['filters']),_0x104311);if(_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x36')]){_0x51524f[_0x8bca('0x37')]=_[_0x8bca('0x38')](_0x51524f[_0x8bca('0x37')],{'$or':_[_0x8bca('0x29')](_0x104311,function(_0x28e8cb){if(_0x28e8cb[_0x8bca('0x39')]!=='VIRTUAL'){var _0x112612={};_0x112612[_0x28e8cb[_0x8bca('0x27')]]={'$like':'%'+_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x36')]+'%'};return _0x112612;}})});}_0x51524f=_[_0x8bca('0x38')]({},_0x51524f,_0x20f9fd[_0x8bca('0x3a')]);var _0x3fb441={'where':_0x51524f[_0x8bca('0x37')]};return db[_0x8bca('0x3b')][_0x8bca('0x1d')](_0x3fb441)[_0x8bca('0x3c')](function(_0x251d63){_0x4326d6['count']=_0x251d63;if(_0x20f9fd[_0x8bca('0x2d')][_0x8bca('0x3d')]){_0x51524f[_0x8bca('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x8bca('0x3f')](_0x51524f);})[_0x8bca('0x3c')](function(_0x5c32f0){_0x4326d6[_0x8bca('0x40')]=_0x5c32f0;return _0x4326d6;})[_0x8bca('0x3c')](respondWithFilteredResult(_0x228feb,_0x51524f))[_0x8bca('0x41')](handleError(_0x228feb,null));};exports[_0x8bca('0x42')]=function(_0x23b292,_0x1373dd){var _0x594a96={'raw':!![],'where':{'id':_0x23b292[_0x8bca('0x43')]['id']}},_0x1a7527={};_0x1a7527[_0x8bca('0x2c')]=_[_0x8bca('0x44')](db[_0x8bca('0x3b')][_0x8bca('0x2a')]);_0x1a7527[_0x8bca('0x2d')]=_[_0x8bca('0x44')](_0x23b292[_0x8bca('0x2d')]);_0x1a7527[_0x8bca('0x2e')]=_[_0x8bca('0x2f')](_0x1a7527[_0x8bca('0x2c')],_0x1a7527[_0x8bca('0x2d')]);_0x594a96[_0x8bca('0x30')]=_['intersection'](_0x1a7527[_0x8bca('0x2c')],qs[_0x8bca('0x31')](_0x23b292[_0x8bca('0x2d')][_0x8bca('0x31')]));_0x594a96[_0x8bca('0x30')]=_0x594a96[_0x8bca('0x30')][_0x8bca('0x32')]?_0x594a96[_0x8bca('0x30')]:_0x1a7527[_0x8bca('0x2c')];if(_0x23b292[_0x8bca('0x2d')][_0x8bca('0x3d')]){_0x594a96[_0x8bca('0x3e')]=[{'all':!![]}];}_0x594a96=_[_0x8bca('0x38')]({},_0x594a96,_0x23b292[_0x8bca('0x3a')]);return db[_0x8bca('0x3b')][_0x8bca('0x45')](_0x594a96)['then'](handleEntityNotFound(_0x1373dd,null))['then'](respondWithResult(_0x1373dd,null))[_0x8bca('0x41')](handleError(_0x1373dd,null));};exports[_0x8bca('0x46')]=function(_0x31232b,_0x23124c){return db[_0x8bca('0x3b')][_0x8bca('0x46')](_0x31232b[_0x8bca('0x47')],{})[_0x8bca('0x3c')](respondWithResult(_0x23124c,0xc9))[_0x8bca('0x41')](handleError(_0x23124c,null));};exports[_0x8bca('0x23')]=function(_0x313866,_0x55f9bb){if(_0x313866['body']['id']){delete _0x313866['body']['id'];}return db[_0x8bca('0x3b')][_0x8bca('0x45')]({'where':{'id':_0x313866[_0x8bca('0x43')]['id']}})[_0x8bca('0x3c')](handleEntityNotFound(_0x55f9bb,null))['then'](saveUpdates(_0x313866[_0x8bca('0x47')],null))[_0x8bca('0x3c')](respondWithResult(_0x55f9bb,null))[_0x8bca('0x41')](handleError(_0x55f9bb,null));};exports[_0x8bca('0x24')]=function(_0x5b47a7,_0x31abaa){return db[_0x8bca('0x3b')]['find']({'where':{'id':_0x5b47a7[_0x8bca('0x43')]['id']}})[_0x8bca('0x3c')](handleEntityNotFound(_0x31abaa,null))[_0x8bca('0x3c')](removeEntity(_0x31abaa,null))['catch'](handleError(_0x31abaa,null));};exports[_0x8bca('0x48')]=function(_0x44a892,_0x520c27){return db[_0x8bca('0x3b')]['describe']()[_0x8bca('0x3c')](respondWithResult(_0x520c27,null))['catch'](handleError(_0x520c27,null));};exports[_0x8bca('0x49')]=function(_0x4174af,_0x4f01c6,_0x472467){var _0x1a7832={'raw':!![],'where':{}};var _0x1f6481={};var _0x1045f9={'count':0x0,'rows':[]};return db[_0x8bca('0x3b')]['findOne']({'where':{'id':_0x4174af[_0x8bca('0x43')]['id']}})[_0x8bca('0x3c')](handleEntityNotFound(_0x4f01c6,null))[_0x8bca('0x3c')](function(_0x30f670){if(_0x30f670){_0x1f6481[_0x8bca('0x2c')]=_['keys'](db['JscriptyQuestionReport'][_0x8bca('0x2a')]);_0x1f6481[_0x8bca('0x2d')]=_['keys'](_0x4174af[_0x8bca('0x2d')]);_0x1f6481['filters']=_['intersection'](_0x1f6481[_0x8bca('0x2c')],_0x1f6481[_0x8bca('0x2d')]);_0x1a7832[_0x8bca('0x30')]=_[_0x8bca('0x2f')](_0x1f6481[_0x8bca('0x2c')],qs[_0x8bca('0x31')](_0x4174af['query']['fields']));_0x1a7832['attributes']=_0x1a7832[_0x8bca('0x30')][_0x8bca('0x32')]?_0x1a7832[_0x8bca('0x30')]:_0x1f6481['model'];if(!_0x4174af[_0x8bca('0x2d')][_0x8bca('0x4a')](_0x8bca('0x33'))){_0x1a7832[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x4174af[_0x8bca('0x2d')][_0x8bca('0x1c')]);_0x1a7832[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x4174af[_0x8bca('0x2d')][_0x8bca('0x1a')]);}_0x1a7832[_0x8bca('0x34')]=qs['sort'](_0x4174af[_0x8bca('0x2d')]['sort']);_0x1a7832['where']=qs[_0x8bca('0x2e')](_[_0x8bca('0x4b')](_0x4174af[_0x8bca('0x2d')],_0x1f6481[_0x8bca('0x2e')]));_0x1a7832['where'][_0x8bca('0x4c')]=_0x30f670['id'];if(_0x4174af[_0x8bca('0x2d')][_0x8bca('0x36')]){_0x1a7832[_0x8bca('0x37')]=_['merge'](_0x1a7832[_0x8bca('0x37')],{'$or':_[_0x8bca('0x29')](_0x1a7832[_0x8bca('0x30')],function(_0x533922){var _0x32f19c={};_0x32f19c[_0x533922]={'$like':'%'+_0x4174af['query'][_0x8bca('0x36')]+'%'};return _0x32f19c;})});}_0x1a7832=_[_0x8bca('0x38')]({},_0x1a7832,_0x4174af[_0x8bca('0x3a')]);return db['JscriptyQuestionReport'][_0x8bca('0x1d')]({'where':_0x1a7832['where']})['then'](function(_0x30e0a1){_0x1045f9[_0x8bca('0x1d')]=_0x30e0a1;if(_0x4174af['query']['includeAll']){_0x1a7832[_0x8bca('0x3e')]=[{'all':!![]}];}return db[_0x8bca('0x4d')][_0x8bca('0x3f')](_0x1a7832);})[_0x8bca('0x3c')](function(_0x3e959c){_0x1045f9['rows']=_0x3e959c;return _0x1045f9;});}})['then'](respondWithFilteredResult(_0x4f01c6,_0x1a7832))[_0x8bca('0x41')](handleError(_0x4f01c6,null));}; \ No newline at end of file +var _0xf4cd=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','reject','save','update','then','destroy','end','stack','name','map','JscriptySessionReport','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId'];(function(_0xb47911,_0x4499e6){var _0x312020=function(_0x45d7aa){while(--_0x45d7aa){_0xb47911['push'](_0xb47911['shift']());}};_0x312020(++_0x4499e6);}(_0xf4cd,0xe1));var _0xdf4c=function(_0x123b0f,_0x36d71e){_0x123b0f=_0x123b0f-0x0;var _0x40de58=_0xf4cd[_0x123b0f];return _0x40de58;};'use strict';var emlformat=require(_0xdf4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf4c('0x2'));var moment=require(_0xdf4c('0x3'));var BPromise=require(_0xdf4c('0x4'));var Mustache=require(_0xdf4c('0x5'));var util=require(_0xdf4c('0x6'));var path=require(_0xdf4c('0x7'));var sox=require(_0xdf4c('0x8'));var csv=require(_0xdf4c('0x9'));var ejs=require(_0xdf4c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf4c('0xb'));var _=require(_0xdf4c('0xc'));var squel=require(_0xdf4c('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf4c('0x9'));var querystring=require('querystring');var Papa=require(_0xdf4c('0xf'));var Redis=require('ioredis');var authService=require(_0xdf4c('0x10'));var qs=require(_0xdf4c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf4c('0x12'));var logger=require(_0xdf4c('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf4c('0x14'))['db'];function respondWithStatusCode(_0x9c88e0,_0x5a3628){_0x5a3628=_0x5a3628||0xcc;return function(_0x50aff8){if(_0x50aff8){return _0x9c88e0[_0xdf4c('0x15')](_0x5a3628);}return _0x9c88e0['status'](_0x5a3628)['end']();};}function respondWithResult(_0x4c5e47,_0x369a7f){_0x369a7f=_0x369a7f||0xc8;return function(_0x5255cf){if(_0x5255cf){return _0x4c5e47['status'](_0x369a7f)[_0xdf4c('0x16')](_0x5255cf);}};}function respondWithFilteredResult(_0x2f00c8,_0x58c0ef){return function(_0x421e4a){if(_0x421e4a){var _0x8d9a42=typeof _0x58c0ef['offset']==='undefined'&&typeof _0x58c0ef[_0xdf4c('0x17')]===_0xdf4c('0x18');var _0x55ecde=_0x421e4a[_0xdf4c('0x19')];var _0x72c1ca=_0x8d9a42?0x0:_0x58c0ef[_0xdf4c('0x1a')];var _0x288091=_0x8d9a42?_0x421e4a['count']:_0x58c0ef[_0xdf4c('0x1a')]+_0x58c0ef[_0xdf4c('0x17')];var _0x59957e;if(_0x288091>=_0x55ecde){_0x288091=_0x55ecde;_0x59957e=0xc8;}else{_0x59957e=0xce;}_0x2f00c8[_0xdf4c('0x1b')](_0x59957e);return _0x2f00c8[_0xdf4c('0x1c')](_0xdf4c('0x1d'),_0x72c1ca+'-'+_0x288091+'/'+_0x55ecde)[_0xdf4c('0x16')](_0x421e4a);}return null;};}function patchUpdates(_0x332bc0){return function(_0x19e373){try{jsonpatch['apply'](_0x19e373,_0x332bc0,!![]);}catch(_0x546b98){return BPromise[_0xdf4c('0x1e')](_0x546b98);}return _0x19e373[_0xdf4c('0x1f')]();};}function saveUpdates(_0x5cc899,_0xf69fee){return function(_0x39269a){if(_0x39269a){return _0x39269a[_0xdf4c('0x20')](_0x5cc899)[_0xdf4c('0x21')](function(_0x3ee760){return _0x3ee760;});}return null;};}function removeEntity(_0x4bd7b6,_0x3fb7d7){return function(_0x5418f4){if(_0x5418f4){return _0x5418f4[_0xdf4c('0x22')]()[_0xdf4c('0x21')](function(){_0x4bd7b6[_0xdf4c('0x1b')](0xcc)[_0xdf4c('0x23')]();});}};}function handleEntityNotFound(_0x35e050,_0x21e23e){return function(_0x37b78d){if(!_0x37b78d){_0x35e050[_0xdf4c('0x15')](0x194);}return _0x37b78d;};}function handleError(_0x271e5a,_0x26c972){_0x26c972=_0x26c972||0x1f4;return function(_0x14de1e){logger['error'](_0x14de1e[_0xdf4c('0x24')]);if(_0x14de1e['name']){delete _0x14de1e[_0xdf4c('0x25')];}_0x271e5a[_0xdf4c('0x1b')](_0x26c972)['send'](_0x14de1e);};}exports['index']=function(_0x5d721d,_0x5ec36d){var _0x25b625={},_0x4e2cbf={},_0x38b452={'count':0x0,'rows':[]};var _0x5b40c0=_[_0xdf4c('0x26')](db[_0xdf4c('0x27')]['rawAttributes'],function(_0x31735b){return{'name':_0x31735b['fieldName'],'type':_0x31735b[_0xdf4c('0x28')][_0xdf4c('0x29')]};});_0x4e2cbf['model']=_[_0xdf4c('0x26')](_0x5b40c0,_0xdf4c('0x25'));_0x4e2cbf[_0xdf4c('0x2a')]=_[_0xdf4c('0x2b')](_0x5d721d[_0xdf4c('0x2a')]);_0x4e2cbf['filters']=_[_0xdf4c('0x2c')](_0x4e2cbf[_0xdf4c('0x2d')],_0x4e2cbf['query']);_0x25b625[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x4e2cbf[_0xdf4c('0x2d')],qs[_0xdf4c('0x2f')](_0x5d721d['query'][_0xdf4c('0x2f')]));_0x25b625['attributes']=_0x25b625['attributes'][_0xdf4c('0x30')]?_0x25b625[_0xdf4c('0x2e')]:_0x4e2cbf[_0xdf4c('0x2d')];if(!_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x31')](_0xdf4c('0x32'))){_0x25b625[_0xdf4c('0x17')]=qs['limit'](_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x17')]);_0x25b625[_0xdf4c('0x1a')]=qs[_0xdf4c('0x1a')](_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x1a')]);}_0x25b625[_0xdf4c('0x33')]=qs[_0xdf4c('0x34')](_0x5d721d['query'][_0xdf4c('0x34')]);_0x25b625['where']=qs['filters'](_[_0xdf4c('0x35')](_0x5d721d['query'],_0x4e2cbf[_0xdf4c('0x36')]),_0x5b40c0);if(_0x5d721d[_0xdf4c('0x2a')]['filter']){_0x25b625['where']=_[_0xdf4c('0x37')](_0x25b625[_0xdf4c('0x38')],{'$or':_[_0xdf4c('0x26')](_0x5b40c0,function(_0x145555){if(_0x145555[_0xdf4c('0x28')]!=='VIRTUAL'){var _0x1a7fdb={};_0x1a7fdb[_0x145555[_0xdf4c('0x25')]]={'$like':'%'+_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x39')]+'%'};return _0x1a7fdb;}})});}_0x25b625=_['merge']({},_0x25b625,_0x5d721d[_0xdf4c('0x3a')]);var _0x55c7ed={'where':_0x25b625['where']};return db[_0xdf4c('0x27')][_0xdf4c('0x19')](_0x55c7ed)[_0xdf4c('0x21')](function(_0x9c8221){_0x38b452[_0xdf4c('0x19')]=_0x9c8221;if(_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x3b')]){_0x25b625[_0xdf4c('0x3c')]=[{'all':!![]}];}return db[_0xdf4c('0x27')][_0xdf4c('0x3d')](_0x25b625);})[_0xdf4c('0x21')](function(_0x336490){_0x38b452[_0xdf4c('0x3e')]=_0x336490;return _0x38b452;})['then'](respondWithFilteredResult(_0x5ec36d,_0x25b625))[_0xdf4c('0x3f')](handleError(_0x5ec36d,null));};exports[_0xdf4c('0x40')]=function(_0x1cf23e,_0x16e3d1){var _0x479e2a={'raw':!![],'where':{'id':_0x1cf23e[_0xdf4c('0x41')]['id']}},_0x140fe={};_0x140fe[_0xdf4c('0x2d')]=_[_0xdf4c('0x2b')](db[_0xdf4c('0x27')]['rawAttributes']);_0x140fe[_0xdf4c('0x2a')]=_['keys'](_0x1cf23e[_0xdf4c('0x2a')]);_0x140fe[_0xdf4c('0x36')]=_[_0xdf4c('0x2c')](_0x140fe[_0xdf4c('0x2d')],_0x140fe[_0xdf4c('0x2a')]);_0x479e2a[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x140fe['model'],qs[_0xdf4c('0x2f')](_0x1cf23e[_0xdf4c('0x2a')][_0xdf4c('0x2f')]));_0x479e2a['attributes']=_0x479e2a['attributes'][_0xdf4c('0x30')]?_0x479e2a[_0xdf4c('0x2e')]:_0x140fe[_0xdf4c('0x2d')];if(_0x1cf23e['query'][_0xdf4c('0x3b')]){_0x479e2a[_0xdf4c('0x3c')]=[{'all':!![]}];}_0x479e2a=_[_0xdf4c('0x37')]({},_0x479e2a,_0x1cf23e[_0xdf4c('0x3a')]);return db[_0xdf4c('0x27')][_0xdf4c('0x42')](_0x479e2a)[_0xdf4c('0x21')](handleEntityNotFound(_0x16e3d1,null))['then'](respondWithResult(_0x16e3d1,null))[_0xdf4c('0x3f')](handleError(_0x16e3d1,null));};exports[_0xdf4c('0x43')]=function(_0x954032,_0x1903c8){return db['JscriptySessionReport'][_0xdf4c('0x43')](_0x954032['body'],{})[_0xdf4c('0x21')](respondWithResult(_0x1903c8,0xc9))[_0xdf4c('0x3f')](handleError(_0x1903c8,null));};exports[_0xdf4c('0x20')]=function(_0x14a969,_0x14f152){if(_0x14a969[_0xdf4c('0x44')]['id']){delete _0x14a969['body']['id'];}return db[_0xdf4c('0x27')]['find']({'where':{'id':_0x14a969[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x14f152,null))['then'](saveUpdates(_0x14a969[_0xdf4c('0x44')],null))[_0xdf4c('0x21')](respondWithResult(_0x14f152,null))['catch'](handleError(_0x14f152,null));};exports[_0xdf4c('0x22')]=function(_0x4f1352,_0x253d7d){return db[_0xdf4c('0x27')][_0xdf4c('0x42')]({'where':{'id':_0x4f1352[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x253d7d,null))['then'](removeEntity(_0x253d7d,null))[_0xdf4c('0x3f')](handleError(_0x253d7d,null));};exports[_0xdf4c('0x45')]=function(_0x210251,_0x4d19af){return db[_0xdf4c('0x27')][_0xdf4c('0x45')]()[_0xdf4c('0x21')](respondWithResult(_0x4d19af,null))['catch'](handleError(_0x4d19af,null));};exports[_0xdf4c('0x46')]=function(_0x2524f5,_0x385722,_0x2662fe){var _0x18d8ac={'raw':!![],'where':{}};var _0x5d61={};var _0x50bc18={'count':0x0,'rows':[]};return db[_0xdf4c('0x27')][_0xdf4c('0x47')]({'where':{'id':_0x2524f5[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x385722,null))['then'](function(_0x5ad98b){if(_0x5ad98b){_0x5d61[_0xdf4c('0x2d')]=_[_0xdf4c('0x2b')](db[_0xdf4c('0x48')][_0xdf4c('0x49')]);_0x5d61['query']=_[_0xdf4c('0x2b')](_0x2524f5['query']);_0x5d61[_0xdf4c('0x36')]=_[_0xdf4c('0x2c')](_0x5d61[_0xdf4c('0x2d')],_0x5d61[_0xdf4c('0x2a')]);_0x18d8ac[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x5d61['model'],qs['fields'](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x2f')]));_0x18d8ac['attributes']=_0x18d8ac[_0xdf4c('0x2e')][_0xdf4c('0x30')]?_0x18d8ac['attributes']:_0x5d61['model'];if(!_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x31')](_0xdf4c('0x32'))){_0x18d8ac['limit']=qs[_0xdf4c('0x17')](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x17')]);_0x18d8ac[_0xdf4c('0x1a')]=qs[_0xdf4c('0x1a')](_0x2524f5['query'][_0xdf4c('0x1a')]);}_0x18d8ac[_0xdf4c('0x33')]=qs[_0xdf4c('0x34')](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x34')]);_0x18d8ac['where']=qs[_0xdf4c('0x36')](_[_0xdf4c('0x35')](_0x2524f5[_0xdf4c('0x2a')],_0x5d61['filters']));_0x18d8ac[_0xdf4c('0x38')][_0xdf4c('0x4a')]=_0x5ad98b['id'];if(_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x39')]){_0x18d8ac[_0xdf4c('0x38')]=_['merge'](_0x18d8ac[_0xdf4c('0x38')],{'$or':_[_0xdf4c('0x26')](_0x18d8ac[_0xdf4c('0x2e')],function(_0x2035c1){var _0x3b14ce={};_0x3b14ce[_0x2035c1]={'$like':'%'+_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x39')]+'%'};return _0x3b14ce;})});}_0x18d8ac=_[_0xdf4c('0x37')]({},_0x18d8ac,_0x2524f5[_0xdf4c('0x3a')]);return db[_0xdf4c('0x48')][_0xdf4c('0x19')]({'where':_0x18d8ac[_0xdf4c('0x38')]})[_0xdf4c('0x21')](function(_0x2de406){_0x50bc18[_0xdf4c('0x19')]=_0x2de406;if(_0x2524f5[_0xdf4c('0x2a')]['includeAll']){_0x18d8ac[_0xdf4c('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x18d8ac);})[_0xdf4c('0x21')](function(_0x4fd82c){_0x50bc18[_0xdf4c('0x3e')]=_0x4fd82c;return _0x50bc18;});}})[_0xdf4c('0x21')](respondWithFilteredResult(_0x385722,_0x18d8ac))[_0xdf4c('0x3f')](handleError(_0x385722,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 6b07206..caaf0d7 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 _0xda19=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x523aa8,_0x1b8aa1){var _0xb8aef0=function(_0x37bec6){while(--_0x37bec6){_0x523aa8['push'](_0x523aa8['shift']());}};_0xb8aef0(++_0x1b8aa1);}(_0xda19,0xd5));var _0x9da1=function(_0x32b4cf,_0x93dbfe){_0x32b4cf=_0x32b4cf-0x0;var _0x404cec=_0xda19[_0x32b4cf];return _0x404cec;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xed1c,0xe4));var _0xced1=function(_0xc60341,_0x521316){_0xc60341=_0xc60341-0x0;var _0x309ee7=_0xed1c[_0xc60341];return _0x309ee7;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'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 97f64aa..0e739c0 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 _0x3e24=['info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x15cae3,_0x458cb9){var _0x20596f=function(_0x1ad3e6){while(--_0x1ad3e6){_0x15cae3['push'](_0x15cae3['shift']());}};_0x20596f(++_0x458cb9);}(_0x3e24,0x167));var _0x43e2=function(_0x20ee5a,_0x409903){_0x20ee5a=_0x20ee5a-0x0;var _0x4573bf=_0x3e24[_0x20ee5a];return _0x4573bf;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});} \ No newline at end of file +var _0x27a0=['message','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x8e276f,_0x356cc2){var _0x2da08d=function(_0x3f69fd){while(--_0x3f69fd){_0x8e276f['push'](_0x8e276f['shift']());}};_0x2da08d(++_0x356cc2);}(_0x27a0,0xbf));var _0x027a=function(_0x4eb934,_0x13097f){_0x4eb934=_0x4eb934-0x0;var _0x3b763b=_0x27a0[_0x4eb934];return _0x3b763b;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('JscriptySessionReport,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index cac9846..854d676 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 _0x3458=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','connect-timeout'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3458,0x1b7));var _0x8345=function(_0x276ae3,_0x2cbbb8){_0x276ae3=_0x276ae3-0x0;var _0x1e7b5b=_0x3458[_0x276ae3];return _0x1e7b5b;};'use strict';var multer=require(_0x8345('0x0'));var util=require(_0x8345('0x1'));var path=require('path');var timeout=require(_0x8345('0x2'));var express=require('express');var router=express[_0x8345('0x3')]();var fs_extra=require(_0x8345('0x4'));var auth=require(_0x8345('0x5'));var interaction=require(_0x8345('0x6'));var config=require(_0x8345('0x7'));var controller=require(_0x8345('0x8'));router[_0x8345('0x9')]('/',controller['index']);router[_0x8345('0xa')](_0x8345('0xb'),auth[_0x8345('0xc')](),controller[_0x8345('0xd')]);router[_0x8345('0x9')](_0x8345('0xe'),auth['isAuthenticated'](),controller[_0x8345('0xf')]);module[_0x8345('0x10')]=router; \ No newline at end of file +var _0x1c8f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','isAuthenticated','update','/download_log_file','multer','util','path'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x1c8f,0x12d));var _0xf1c8=function(_0x4ef5c3,_0x33c488){_0x4ef5c3=_0x4ef5c3-0x0;var _0x4254ad=_0x1c8f[_0x4ef5c3];return _0x4254ad;};'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 fs_extra=require(_0xf1c8('0x6'));var auth=require(_0xf1c8('0x7'));var interaction=require(_0xf1c8('0x8'));var config=require(_0xf1c8('0x9'));var controller=require(_0xf1c8('0xa'));router[_0xf1c8('0xb')]('/',controller['index']);router[_0xf1c8('0xc')]('/:id',auth[_0xf1c8('0xd')](),controller[_0xf1c8('0xe')]);router[_0xf1c8('0xb')](_0xf1c8('0xf'),auth[_0xf1c8('0xd')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ec0eaaa..b1e40c6 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 _0x6e6f=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x5b94c5,_0x396323){var _0x1d9efd=function(_0x4796ca){while(--_0x4796ca){_0x5b94c5['push'](_0x5b94c5['shift']());}};_0x1d9efd(++_0x396323);}(_0x6e6f,0x11d));var _0xf6e6=function(_0x188edb,_0x19fed6){_0x188edb=_0x188edb-0x0;var _0x669a3d=_0x6e6f[_0x188edb];return _0x669a3d;};'use strict';var Sequelize=require(_0xf6e6('0x0'));module[_0xf6e6('0x1')]={'license':{'type':Sequelize[_0xf6e6('0x2')]},'data1':{'type':Sequelize[_0xf6e6('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xf6e6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x697a=['STRING','sequelize','exports','TEXT'];(function(_0x2e3587,_0x22c529){var _0x39d4a3=function(_0x922d6a){while(--_0x922d6a){_0x2e3587['push'](_0x2e3587['shift']());}};_0x39d4a3(++_0x22c529);}(_0x697a,0x1b1));var _0xa697=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x697a[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xa697('0x0'));module[_0xa697('0x1')]={'license':{'type':Sequelize[_0xa697('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xa697('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 0cd7908..ed3a78f 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 _0xa1d6=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','then','name','send','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','getLicense','body','find','params','get','checkLicense','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir'];(function(_0x2e7aa6,_0x53491c){var _0x3c277d=function(_0x282332){while(--_0x282332){_0x2e7aa6['push'](_0x2e7aa6['shift']());}};_0x3c277d(++_0x53491c);}(_0xa1d6,0xcc));var _0x6a1d=function(_0x4588e3,_0x323256){_0x4588e3=_0x4588e3-0x0;var _0x241516=_0xa1d6[_0x4588e3];return _0x241516;};'use strict';var emlformat=require(_0x6a1d('0x0'));var rimraf=require(_0x6a1d('0x1'));var zipdir=require(_0x6a1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a1d('0x3'));var moment=require(_0x6a1d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6a1d('0x5'));var util=require(_0x6a1d('0x6'));var path=require(_0x6a1d('0x7'));var sox=require('sox');var csv=require(_0x6a1d('0x8'));var ejs=require(_0x6a1d('0x9'));var fs=require('fs');var fs_extra=require(_0x6a1d('0xa'));var _=require(_0x6a1d('0xb'));var squel=require(_0x6a1d('0xc'));var crypto=require(_0x6a1d('0xd'));var jsforce=require(_0x6a1d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6a1d('0x8'));var querystring=require('querystring');var Papa=require(_0x6a1d('0xf'));var Redis=require(_0x6a1d('0x10'));var authService=require(_0x6a1d('0x11'));var qs=require(_0x6a1d('0x12'));var as=require(_0x6a1d('0x13'));var hardwareService=require(_0x6a1d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6a1d('0x15'));var config=require(_0x6a1d('0x16'));var licenseUtil=require(_0x6a1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0590f,_0x4cd47d){_0x4cd47d=_0x4cd47d||0xcc;return function(_0x217468){if(_0x217468){return _0xf0590f[_0x6a1d('0x18')](_0x4cd47d);}return _0xf0590f['status'](_0x4cd47d)[_0x6a1d('0x19')]();};}function respondWithResult(_0x38ddea,_0x5e6d53){_0x5e6d53=_0x5e6d53||0xc8;return function(_0x13b152){if(_0x13b152){return _0x38ddea['status'](_0x5e6d53)[_0x6a1d('0x1a')](_0x13b152);}};}function respondWithFilteredResult(_0x47a278,_0x25aba6){return function(_0xb45e07){if(_0xb45e07){var _0x500e06=typeof _0x25aba6[_0x6a1d('0x1b')]===_0x6a1d('0x1c')&&typeof _0x25aba6[_0x6a1d('0x1d')]===_0x6a1d('0x1c');var _0x42f0bc=_0xb45e07[_0x6a1d('0x1e')];var _0x2a16ce=_0x500e06?0x0:_0x25aba6[_0x6a1d('0x1b')];var _0xe5b024=_0x500e06?_0xb45e07['count']:_0x25aba6['offset']+_0x25aba6[_0x6a1d('0x1d')];var _0x1bffea;if(_0xe5b024>=_0x42f0bc){_0xe5b024=_0x42f0bc;_0x1bffea=0xc8;}else{_0x1bffea=0xce;}_0x47a278[_0x6a1d('0x1f')](_0x1bffea);return _0x47a278[_0x6a1d('0x20')](_0x6a1d('0x21'),_0x2a16ce+'-'+_0xe5b024+'/'+_0x42f0bc)[_0x6a1d('0x1a')](_0xb45e07);}return null;};}function patchUpdates(_0x171298){return function(_0x2d00a7){try{jsonpatch['apply'](_0x2d00a7,_0x171298,!![]);}catch(_0x5c8fc0){return BPromise['reject'](_0x5c8fc0);}return _0x2d00a7[_0x6a1d('0x22')]();};}function saveUpdates(_0x42d877,_0x329db7){return function(_0xd263bd){if(_0xd263bd){return _0xd263bd[_0x6a1d('0x23')](_0x42d877)[_0x6a1d('0x24')](function(_0x34c7a9){return _0x34c7a9;});}return null;};}function removeEntity(_0x16100a,_0x27974f){return function(_0x584c95){if(_0x584c95){return _0x584c95['destroy']()[_0x6a1d('0x24')](function(){_0x16100a['status'](0xcc)[_0x6a1d('0x19')]();});}};}function handleEntityNotFound(_0x4c4442,_0x31a863){return function(_0x7327f7){if(!_0x7327f7){_0x4c4442[_0x6a1d('0x18')](0x194);}return _0x7327f7;};}function handleError(_0x14d573,_0x18b443){_0x18b443=_0x18b443||0x1f4;return function(_0x37ac64){logger['error'](_0x37ac64['stack']);if(_0x37ac64[_0x6a1d('0x25')]){delete _0x37ac64[_0x6a1d('0x25')];}_0x14d573['status'](_0x18b443)[_0x6a1d('0x26')](_0x37ac64);};}var utilLicense=require(_0x6a1d('0x17'));exports[_0x6a1d('0x27')]=function(_0x24e7e9,_0x4e7233){var _0xca69f8={'raw':!![],'where':{'id':0x1}},_0x1b25c1={};_0x1b25c1[_0x6a1d('0x28')]=_[_0x6a1d('0x29')](db['License'][_0x6a1d('0x2a')]);_0x1b25c1['query']=_['keys'](_0x24e7e9[_0x6a1d('0x2b')]);_0x1b25c1[_0x6a1d('0x2c')]=_[_0x6a1d('0x2d')](_0x1b25c1[_0x6a1d('0x28')],_0x1b25c1['query']);_0xca69f8['attributes']=_['intersection'](_0x1b25c1[_0x6a1d('0x28')],qs[_0x6a1d('0x2e')](_0x24e7e9[_0x6a1d('0x2b')][_0x6a1d('0x2e')]));_0xca69f8[_0x6a1d('0x2f')]=_0xca69f8['attributes'][_0x6a1d('0x30')]?_0xca69f8['attributes']:_0x1b25c1['model'];_0xca69f8=_[_0x6a1d('0x31')]({},_0xca69f8,_0x24e7e9['options']);return utilLicense[_0x6a1d('0x32')](_0xca69f8)['then'](respondWithResult(_0x4e7233,null))['catch'](handleError(_0x4e7233,null));};exports[_0x6a1d('0x23')]=function(_0xbc0797,_0x8f89e3){if(_0xbc0797[_0x6a1d('0x33')]['id']){delete _0xbc0797[_0x6a1d('0x33')]['id'];}return db['License'][_0x6a1d('0x34')]({'where':{'id':_0xbc0797[_0x6a1d('0x35')]['id']}})[_0x6a1d('0x24')](handleEntityNotFound(_0x8f89e3,null))[_0x6a1d('0x24')](function(_0x2c0c3e){var _0x16781a=_0x2c0c3e[_0x6a1d('0x36')]({'plain':!![]});return utilLicense[_0x6a1d('0x37')](_0x16781a,_0xbc0797[_0x6a1d('0x33')][_0x6a1d('0x38')]);})['then'](function(_0x1f8e73){if(!_0x1f8e73[_0x6a1d('0x39')]){return saveUpdates(_0xbc0797[_0x6a1d('0x33')],null);}return _0x1f8e73;})[_0x6a1d('0x24')](respondWithResult(_0x8f89e3,null))[_0x6a1d('0x3a')](handleError(_0x8f89e3,null));};exports[_0x6a1d('0x3b')]=function(_0x14ce32,_0x50c2b1){var _0x56c3b5=_0x6a1d('0x3c');var _0x327f25=path[_0x6a1d('0x3d')](_0x6a1d('0x3e'),_0x6a1d('0x3f'),'xcally',_0x56c3b5);_0x50c2b1[_0x6a1d('0x40')]('Content-disposition',_0x6a1d('0x41')+_0x56c3b5);_0x50c2b1[_0x6a1d('0x20')](_0x6a1d('0x42'),_0x6a1d('0x43'));_0x50c2b1[_0x6a1d('0x44')](_0x327f25);}; \ No newline at end of file +var _0xf599=['path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','License','query','filters','intersection','fields','attributes','merge','options','getLicense','body','find','params','get','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x518093,_0x849a77){var _0x34b038=function(_0x1bf5d8){while(--_0x1bf5d8){_0x518093['push'](_0x518093['shift']());}};_0x34b038(++_0x849a77);}(_0xf599,0x122));var _0x9f59=function(_0x518189,_0x280941){_0x518189=_0x518189-0x0;var _0x14f749=_0xf599[_0x518189];return _0x14f749;};'use strict';var emlformat=require(_0x9f59('0x0'));var rimraf=require(_0x9f59('0x1'));var zipdir=require(_0x9f59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f59('0x3'));var moment=require(_0x9f59('0x4'));var BPromise=require(_0x9f59('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9f59('0x6'));var sox=require(_0x9f59('0x7'));var csv=require(_0x9f59('0x8'));var ejs=require(_0x9f59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f59('0xa'));var squel=require(_0x9f59('0xb'));var crypto=require('crypto');var jsforce=require(_0x9f59('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f59('0xd'));var Redis=require(_0x9f59('0xe'));var authService=require(_0x9f59('0xf'));var qs=require(_0x9f59('0x10'));var as=require(_0x9f59('0x11'));var hardwareService=require(_0x9f59('0x12'));var logger=require(_0x9f59('0x13'))(_0x9f59('0x14'));var utils=require(_0x9f59('0x15'));var config=require(_0x9f59('0x16'));var licenseUtil=require(_0x9f59('0x17'));var db=require(_0x9f59('0x18'))['db'];function respondWithStatusCode(_0x4d3b20,_0x428c1f){_0x428c1f=_0x428c1f||0xcc;return function(_0x15344a){if(_0x15344a){return _0x4d3b20['sendStatus'](_0x428c1f);}return _0x4d3b20['status'](_0x428c1f)[_0x9f59('0x19')]();};}function respondWithResult(_0x1edad4,_0x226f7b){_0x226f7b=_0x226f7b||0xc8;return function(_0x3c43dc){if(_0x3c43dc){return _0x1edad4[_0x9f59('0x1a')](_0x226f7b)[_0x9f59('0x1b')](_0x3c43dc);}};}function respondWithFilteredResult(_0x9d7b7,_0x2614bb){return function(_0x42ffd2){if(_0x42ffd2){var _0x4583b8=typeof _0x2614bb[_0x9f59('0x1c')]===_0x9f59('0x1d')&&typeof _0x2614bb[_0x9f59('0x1e')]===_0x9f59('0x1d');var _0x535530=_0x42ffd2[_0x9f59('0x1f')];var _0x4eb265=_0x4583b8?0x0:_0x2614bb[_0x9f59('0x1c')];var _0x534444=_0x4583b8?_0x42ffd2[_0x9f59('0x1f')]:_0x2614bb[_0x9f59('0x1c')]+_0x2614bb[_0x9f59('0x1e')];var _0xc3bbd4;if(_0x534444>=_0x535530){_0x534444=_0x535530;_0xc3bbd4=0xc8;}else{_0xc3bbd4=0xce;}_0x9d7b7[_0x9f59('0x1a')](_0xc3bbd4);return _0x9d7b7[_0x9f59('0x20')]('Content-Range',_0x4eb265+'-'+_0x534444+'/'+_0x535530)[_0x9f59('0x1b')](_0x42ffd2);}return null;};}function patchUpdates(_0x5830ab){return function(_0x8921ac){try{jsonpatch[_0x9f59('0x21')](_0x8921ac,_0x5830ab,!![]);}catch(_0x4ede0a){return BPromise[_0x9f59('0x22')](_0x4ede0a);}return _0x8921ac[_0x9f59('0x23')]();};}function saveUpdates(_0x38805f,_0x4e5ac8){return function(_0x1559b1){if(_0x1559b1){return _0x1559b1[_0x9f59('0x24')](_0x38805f)[_0x9f59('0x25')](function(_0x321a86){return _0x321a86;});}return null;};}function removeEntity(_0x361fb1,_0x39fc16){return function(_0x964022){if(_0x964022){return _0x964022[_0x9f59('0x26')]()['then'](function(){_0x361fb1['status'](0xcc)[_0x9f59('0x19')]();});}};}function handleEntityNotFound(_0x3cf2d2,_0x7e9938){return function(_0x2284d5){if(!_0x2284d5){_0x3cf2d2[_0x9f59('0x27')](0x194);}return _0x2284d5;};}function handleError(_0x1b8652,_0x222d1a){_0x222d1a=_0x222d1a||0x1f4;return function(_0x3d7315){logger[_0x9f59('0x28')](_0x3d7315[_0x9f59('0x29')]);if(_0x3d7315[_0x9f59('0x2a')]){delete _0x3d7315['name'];}_0x1b8652[_0x9f59('0x1a')](_0x222d1a)[_0x9f59('0x2b')](_0x3d7315);};}var utilLicense=require(_0x9f59('0x17'));exports[_0x9f59('0x2c')]=function(_0x139f22,_0x369b77){var _0x264e56={'raw':!![],'where':{'id':0x1}},_0x359a63={};_0x359a63[_0x9f59('0x2d')]=_[_0x9f59('0x2e')](db[_0x9f59('0x2f')]['rawAttributes']);_0x359a63[_0x9f59('0x30')]=_[_0x9f59('0x2e')](_0x139f22[_0x9f59('0x30')]);_0x359a63[_0x9f59('0x31')]=_['intersection'](_0x359a63[_0x9f59('0x2d')],_0x359a63['query']);_0x264e56['attributes']=_[_0x9f59('0x32')](_0x359a63[_0x9f59('0x2d')],qs[_0x9f59('0x33')](_0x139f22['query']['fields']));_0x264e56[_0x9f59('0x34')]=_0x264e56[_0x9f59('0x34')]['length']?_0x264e56['attributes']:_0x359a63[_0x9f59('0x2d')];_0x264e56=_[_0x9f59('0x35')]({},_0x264e56,_0x139f22[_0x9f59('0x36')]);return utilLicense[_0x9f59('0x37')](_0x264e56)['then'](respondWithResult(_0x369b77,null))['catch'](handleError(_0x369b77,null));};exports['update']=function(_0x275e1c,_0x1d6c38){if(_0x275e1c[_0x9f59('0x38')]['id']){delete _0x275e1c[_0x9f59('0x38')]['id'];}return db['License'][_0x9f59('0x39')]({'where':{'id':_0x275e1c[_0x9f59('0x3a')]['id']}})[_0x9f59('0x25')](handleEntityNotFound(_0x1d6c38,null))['then'](function(_0x1ed7c0){var _0x4a4df1=_0x1ed7c0[_0x9f59('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x4a4df1,_0x275e1c[_0x9f59('0x38')][_0x9f59('0x3c')]);})[_0x9f59('0x25')](function(_0x4a5ac4){if(!_0x4a5ac4[_0x9f59('0x3d')]){return saveUpdates(_0x275e1c[_0x9f59('0x38')],null);}return _0x4a5ac4;})['then'](respondWithResult(_0x1d6c38,null))[_0x9f59('0x3e')](handleError(_0x1d6c38,null));};exports[_0x9f59('0x3f')]=function(_0x687959,_0x19ecfe){var _0x5c22b3=_0x9f59('0x40');var _0x369a5b=path[_0x9f59('0x41')](_0x9f59('0x42'),_0x9f59('0x43'),_0x9f59('0x44'),_0x5c22b3);_0x19ecfe[_0x9f59('0x45')](_0x9f59('0x46'),_0x9f59('0x47')+_0x5c22b3);_0x19ecfe[_0x9f59('0x20')](_0x9f59('0x48'),'text/plain');_0x19ecfe[_0x9f59('0x49')](_0x369a5b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 85c082d..01acff3 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 _0x6ac4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','util','../../config/logger','api'];(function(_0x488f1b,_0x5dfa62){var _0x32211a=function(_0x4ffd8b){while(--_0x4ffd8b){_0x488f1b['push'](_0x488f1b['shift']());}};_0x32211a(++_0x5dfa62);}(_0x6ac4,0x10b));var _0x46ac=function(_0x2bbd6c,_0x4430c0){_0x2bbd6c=_0x2bbd6c-0x0;var _0x22d0a9=_0x6ac4[_0x2bbd6c];return _0x22d0a9;};'use strict';var _=require('lodash');var util=require(_0x46ac('0x0'));var logger=require(_0x46ac('0x1'))(_0x46ac('0x2'));var moment=require(_0x46ac('0x3'));var BPromise=require(_0x46ac('0x4'));var rp=require(_0x46ac('0x5'));var fs=require('fs');var path=require(_0x46ac('0x6'));var rimraf=require(_0x46ac('0x7'));var config=require(_0x46ac('0x8'));var attributes=require('./license.attributes');module['exports']=function(_0x83d18b,_0x4a244e){return _0x83d18b[_0x46ac('0x9')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d5a=['request-promise','path','../../config/environment','./license.attributes','exports','define','License','util','../../config/logger','bluebird'];(function(_0x425af8,_0x366c35){var _0x5c2eb1=function(_0x44785f){while(--_0x44785f){_0x425af8['push'](_0x425af8['shift']());}};_0x5c2eb1(++_0x366c35);}(_0x5d5a,0x101));var _0xa5d5=function(_0x388a8b,_0x4ae93b){_0x388a8b=_0x388a8b-0x0;var _0x3f6ebe=_0x5d5a[_0x388a8b];return _0x3f6ebe;};'use strict';var _=require('lodash');var util=require(_0xa5d5('0x0'));var logger=require(_0xa5d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa5d5('0x2'));var rp=require(_0xa5d5('0x3'));var fs=require('fs');var path=require(_0xa5d5('0x4'));var rimraf=require('rimraf');var config=require(_0xa5d5('0x5'));var attributes=require(_0xa5d5('0x6'));module[_0xa5d5('0x7')]=function(_0x4342b2,_0x259a5e){return _0x4342b2[_0xa5d5('0x8')](_0xa5d5('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 42b8ec4..43b5b27 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 _0x7f78=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch'];(function(_0x520db8,_0x4606b5){var _0x4e658b=function(_0x7453d0){while(--_0x7453d0){_0x520db8['push'](_0x520db8['shift']());}};_0x4e658b(++_0x4606b5);}(_0x7f78,0x1f4));var _0x87f7=function(_0x6dd9e4,_0x1ad429){_0x6dd9e4=_0x6dd9e4-0x0;var _0x108b07=_0x7f78[_0x6dd9e4];return _0x108b07;};'use strict';var _=require('lodash');var util=require(_0x87f7('0x0'));var moment=require(_0x87f7('0x1'));var BPromise=require(_0x87f7('0x2'));var rs=require(_0x87f7('0x3'));var fs=require('fs');var Redis=require(_0x87f7('0x4'));var db=require(_0x87f7('0x5'))['db'];var utils=require(_0x87f7('0x6'));var logger=require(_0x87f7('0x7'))(_0x87f7('0x8'));var config=require(_0x87f7('0x9'));var jayson=require(_0x87f7('0xa'));var client=jayson[_0x87f7('0xb')][_0x87f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9a88,_0x1dc0a1,_0xaae4de){return new BPromise(function(_0x4c169a,_0x4db787){return client[_0x87f7('0xd')](_0x1a9a88,_0xaae4de)[_0x87f7('0xe')](function(_0x54145d){logger['info']('License,\x20%s,\x20%s',_0x1dc0a1,_0x87f7('0xf'));logger[_0x87f7('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x1dc0a1,_0x87f7('0xf'),JSON[_0x87f7('0x11')](_0x54145d));if(_0x54145d[_0x87f7('0x12')]){if(_0x54145d['error'][_0x87f7('0x13')]===0x1f4){logger[_0x87f7('0x12')](_0x87f7('0x14'),_0x1dc0a1,_0x54145d[_0x87f7('0x12')][_0x87f7('0x15')]);return _0x4db787(_0x54145d[_0x87f7('0x12')]['message']);}logger[_0x87f7('0x12')]('License,\x20%s,\x20%s',_0x1dc0a1,_0x54145d[_0x87f7('0x12')]['message']);return _0x4c169a(_0x54145d['error'][_0x87f7('0x15')]);}else{logger[_0x87f7('0x16')](_0x87f7('0x14'),_0x1dc0a1,_0x87f7('0xf'));_0x4c169a(_0x54145d[_0x87f7('0x17')][_0x87f7('0x15')]);}})[_0x87f7('0x18')](function(_0x3d58e0){logger[_0x87f7('0x12')](_0x87f7('0x14'),_0x1dc0a1,_0x3d58e0);_0x4db787(_0x3d58e0);});});} \ No newline at end of file +var _0x7d2e=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s'];(function(_0x13022a,_0x295704){var _0x454d7f=function(_0x34195a){while(--_0x34195a){_0x13022a['push'](_0x13022a['shift']());}};_0x454d7f(++_0x295704);}(_0x7d2e,0xb6));var _0xe7d2=function(_0x549c39,_0x1f88de){_0x549c39=_0x549c39-0x0;var _0xb88b84=_0x7d2e[_0x549c39];return _0xb88b84;};'use strict';var _=require('lodash');var util=require(_0xe7d2('0x0'));var moment=require(_0xe7d2('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7d2('0x2'));var fs=require('fs');var Redis=require(_0xe7d2('0x3'));var db=require(_0xe7d2('0x4'))['db'];var utils=require(_0xe7d2('0x5'));var logger=require(_0xe7d2('0x6'))(_0xe7d2('0x7'));var config=require(_0xe7d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7d2('0x9')][_0xe7d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b2890,_0x36c9fb,_0x56129a){return new BPromise(function(_0x227304,_0x3d5884){return client[_0xe7d2('0xb')](_0x4b2890,_0x56129a)['then'](function(_0x206bd8){logger[_0xe7d2('0xc')](_0xe7d2('0xd'),_0x36c9fb,_0xe7d2('0xe'));logger['debug'](_0xe7d2('0xf'),_0x36c9fb,_0xe7d2('0xe'),JSON[_0xe7d2('0x10')](_0x206bd8));if(_0x206bd8[_0xe7d2('0x11')]){if(_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x12')]===0x1f4){logger[_0xe7d2('0x11')](_0xe7d2('0xd'),_0x36c9fb,_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);return _0x3d5884(_0x206bd8['error'][_0xe7d2('0x13')]);}logger[_0xe7d2('0x11')](_0xe7d2('0xd'),_0x36c9fb,_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);return _0x227304(_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);}else{logger[_0xe7d2('0xc')](_0xe7d2('0xd'),_0x36c9fb,_0xe7d2('0xe'));_0x227304(_0x206bd8[_0xe7d2('0x14')][_0xe7d2('0x13')]);}})[_0xe7d2('0x15')](function(_0x40d5fc){logger['error'](_0xe7d2('0xd'),_0x36c9fb,_0x40d5fc);_0x3d5884(_0x40d5fc);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index ec712dc..4c0fd0e 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 _0x3480=['path','connect-timeout','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','create','addImap','addSmtp','addInteraction','addApplications','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','util'];(function(_0x25b79e,_0xb744f0){var _0x2bb51d=function(_0x5eb9d5){while(--_0x5eb9d5){_0x25b79e['push'](_0x25b79e['shift']());}};_0x2bb51d(++_0xb744f0);}(_0x3480,0x199));var _0x0348=function(_0x284a9f,_0x319ffe){_0x284a9f=_0x284a9f-0x0;var _0x2d6b98=_0x3480[_0x284a9f];return _0x2d6b98;};'use strict';var multer=require('multer');var util=require(_0x0348('0x0'));var path=require(_0x0348('0x1'));var timeout=require(_0x0348('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0348('0x3'));var controller=require(_0x0348('0x4'));router[_0x0348('0x5')]('/',auth[_0x0348('0x6')](),controller[_0x0348('0x7')]);router[_0x0348('0x5')](_0x0348('0x8'),auth[_0x0348('0x6')](),controller['describe']);router[_0x0348('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0348('0x5')](_0x0348('0x9'),auth[_0x0348('0x6')](),controller[_0x0348('0xa')]);router[_0x0348('0x5')](_0x0348('0xb'),auth[_0x0348('0x6')](),controller[_0x0348('0xc')]);router[_0x0348('0x5')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0348('0xd')]);router[_0x0348('0x5')](_0x0348('0xe'),auth[_0x0348('0x6')](),controller[_0x0348('0xf')]);router[_0x0348('0x5')](_0x0348('0x10'),auth[_0x0348('0x6')](),controller[_0x0348('0x11')]);router[_0x0348('0x5')](_0x0348('0x12'),auth[_0x0348('0x6')](),controller['getApplications']);router['get'](_0x0348('0x13'),auth[_0x0348('0x6')](),controller[_0x0348('0x14')]);router[_0x0348('0x5')](_0x0348('0x15'),auth[_0x0348('0x6')](),controller['verifySmtp']);router[_0x0348('0x5')](_0x0348('0x16'),auth[_0x0348('0x6')](),controller[_0x0348('0x17')]);router[_0x0348('0x18')](_0x0348('0x9'),auth[_0x0348('0x6')](),controller[_0x0348('0x19')]);router[_0x0348('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0x0348('0x6')](),controller[_0x0348('0x1a')]);router[_0x0348('0x18')]('/:id/in_servers',auth[_0x0348('0x6')](),controller[_0x0348('0x1b')]);router['post'](_0x0348('0xe'),auth[_0x0348('0x6')](),controller[_0x0348('0x1c')]);router[_0x0348('0x18')]('/:id/interactions',auth[_0x0348('0x6')](),controller[_0x0348('0x1d')]);router['post'](_0x0348('0x12'),auth['isAuthenticated'](),controller[_0x0348('0x1e')]);router[_0x0348('0x18')]('/:id/send',auth[_0x0348('0x6')](),controller['send']);router['post'](_0x0348('0x16'),auth[_0x0348('0x6')](),controller['addAgents']);router[_0x0348('0x1f')](_0x0348('0x20'),auth[_0x0348('0x6')](),controller[_0x0348('0x21')]);router[_0x0348('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x0348('0x23')]);router[_0x0348('0x22')]('/:id/canned_answers',auth[_0x0348('0x6')](),controller[_0x0348('0x24')]);router[_0x0348('0x22')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0348('0x25')]);router['delete'](_0x0348('0xe'),auth[_0x0348('0x6')](),controller['removeSmtp']);router[_0x0348('0x22')](_0x0348('0x20'),auth[_0x0348('0x6')](),controller[_0x0348('0x26')]);router[_0x0348('0x22')](_0x0348('0x16'),auth[_0x0348('0x6')](),controller[_0x0348('0x27')]);module[_0x0348('0x28')]=router; \ No newline at end of file +var _0xe1c3=['delete','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/dispositions','addDisposition','addAnswer','post','/:id/in_servers','addImap','/:id/out_servers','/:id/interactions','/:id/applications','/:id/send','send','/:id/users','addAgents','put','update'];(function(_0x266537,_0x1262b6){var _0xb25080=function(_0x4246d1){while(--_0x4246d1){_0x266537['push'](_0x266537['shift']());}};_0xb25080(++_0x1262b6);}(_0xe1c3,0x1ea));var _0x3e1c=function(_0x366c56,_0x23f34a){_0x366c56=_0x366c56-0x0;var _0x1673b7=_0xe1c3[_0x366c56];return _0x1673b7;};'use strict';var multer=require(_0x3e1c('0x0'));var util=require(_0x3e1c('0x1'));var path=require('path');var timeout=require(_0x3e1c('0x2'));var express=require(_0x3e1c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e1c('0x4'));var config=require(_0x3e1c('0x5'));var controller=require(_0x3e1c('0x6'));router[_0x3e1c('0x7')]('/',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x9')]);router[_0x3e1c('0x7')](_0x3e1c('0xa'),auth[_0x3e1c('0x8')](),controller['describe']);router[_0x3e1c('0x7')](_0x3e1c('0xb'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0xc')]);router[_0x3e1c('0x7')]('/:id/dispositions',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0xd')]);router['get'](_0x3e1c('0xe'),auth['isAuthenticated'](),controller[_0x3e1c('0xf')]);router['get']('/:id/in_servers',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x10')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x3e1c('0x11')]);router[_0x3e1c('0x7')]('/:id/interactions',auth[_0x3e1c('0x8')](),controller['getInteractions']);router[_0x3e1c('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3e1c('0x12')]);router[_0x3e1c('0x7')](_0x3e1c('0x13'),auth['isAuthenticated'](),controller[_0x3e1c('0x14')]);router['get'](_0x3e1c('0x15'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x16')]);router[_0x3e1c('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post'](_0x3e1c('0x17'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x18')]);router['post'](_0x3e1c('0xe'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x19')]);router[_0x3e1c('0x1a')]('/',auth[_0x3e1c('0x8')](),controller['create']);router[_0x3e1c('0x1a')](_0x3e1c('0x1b'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x1c')]);router[_0x3e1c('0x1a')](_0x3e1c('0x1d'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x3e1c('0x1a')](_0x3e1c('0x1e'),auth[_0x3e1c('0x8')](),controller['addInteraction']);router[_0x3e1c('0x1a')](_0x3e1c('0x1f'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x3e1c('0x20'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x21')]);router[_0x3e1c('0x1a')](_0x3e1c('0x22'),auth['isAuthenticated'](),controller[_0x3e1c('0x23')]);router[_0x3e1c('0x24')](_0x3e1c('0xb'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x25')]);router['delete'](_0x3e1c('0x17'),auth[_0x3e1c('0x8')](),controller['removeDispositions']);router[_0x3e1c('0x26')](_0x3e1c('0xe'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x27')]);router['delete'](_0x3e1c('0x1b'),auth['isAuthenticated'](),controller[_0x3e1c('0x28')]);router[_0x3e1c('0x26')](_0x3e1c('0x1d'),auth['isAuthenticated'](),controller[_0x3e1c('0x29')]);router[_0x3e1c('0x26')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3e1c('0x26')](_0x3e1c('0x22'),auth['isAuthenticated'](),controller[_0x3e1c('0x2a')]);module[_0x3e1c('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index bc408fd..6b41c4c 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 _0x2b07=['BOOLEAN','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','hotmail','outlook365','provider','custom','sequelize','exports','STRING','TEXT'];(function(_0x4f676e,_0x571ace){var _0x542a9b=function(_0x31a202){while(--_0x31a202){_0x4f676e['push'](_0x4f676e['shift']());}};_0x542a9b(++_0x571ace);}(_0x2b07,0x7c));var _0x72b0=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x2b07[_0x1e5cc3];return _0x15c596;};'use strict';var Sequelize=require(_0x72b0('0x0'));module[_0x72b0('0x1')]={'description':{'type':Sequelize[_0x72b0('0x2')]},'name':{'type':Sequelize[_0x72b0('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x72b0('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x72b0('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x72b0('0x3')]},'markAsUnread':{'type':Sequelize[_0x72b0('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x72b0('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x72b0('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x72b0('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x72b0('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x72b0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x72b0('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x72b0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x72b0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x72b0('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x72b0('0x4')],'defaultValue':![],'comment':_0x72b0('0x8'),'set':function(_0x5624e0){if(!_0x5624e0)this[_0x72b0('0x9')](_0x72b0('0xa'),null);this[_0x72b0('0x9')](_0x72b0('0xb'),_0x5624e0);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x72b0('0xc'),'yahoo',_0x72b0('0xd')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x72b0('0xe')))return _0x72b0('0xf');return this['getDataValue'](_0x72b0('0xe'));},'set':function(_0x5482fa){if(_0x5482fa==='custom')_0x5482fa=null;return this['setDataValue']('provider',_0x5482fa);}}}; \ No newline at end of file +var _0x08ef=['outlook365','getDataValue','provider','custom','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','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo'];(function(_0x53df07,_0x43e242){var _0x14055e=function(_0x2b49e3){while(--_0x2b49e3){_0x53df07['push'](_0x53df07['shift']());}};_0x14055e(++_0x43e242);}(_0x08ef,0x130));var _0xf08e=function(_0x5f1f8f,_0x25acba){_0x5f1f8f=_0x5f1f8f-0x0;var _0x4435fb=_0x08ef[_0x5f1f8f];return _0x4435fb;};'use strict';var Sequelize=require(_0xf08e('0x0'));module[_0xf08e('0x1')]={'description':{'type':Sequelize[_0xf08e('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf08e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf08e('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf08e('0x4')]},'markAsUnread':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf08e('0x2')],'allowNull':![],'defaultValue':_0xf08e('0x5')},'fontSize':{'type':Sequelize[_0xf08e('0x6')](0x2)[_0xf08e('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf08e('0x4')],'defaultValue':function(){return _0xf08e('0x8');}},'notificationSound':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'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[_0xf08e('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf08e('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![],'comment':_0xf08e('0xa'),'set':function(_0x4318c3){if(!_0x4318c3)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf08e('0xb')](_0xf08e('0xc'),_0x4318c3);}},'provider':{'type':Sequelize[_0xf08e('0xd')]('gmail',_0xf08e('0xe'),_0xf08e('0xf'),_0xf08e('0x10')),'defaultValue':null,'get':function(){if(!this[_0xf08e('0x11')](_0xf08e('0x12')))return _0xf08e('0x13');return this['getDataValue'](_0xf08e('0x12'));},'set':function(_0x2a31f5){if(_0x2a31f5==='custom')_0x2a31f5=null;return this['setDataValue'](_0xf08e('0x12'),_0x2a31f5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8a64782..a096369 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 _0x5c08=['util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','set','Content-Range','json','update','MailAccounts','UserProfileResource','destroy','stack','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','gmail','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','MailServerIn','include','find','catch','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','order','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','isNil','active','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','basename','sendMail','List\x20not\x20found','subject','attach','out','Interaction','Messages','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird'];(function(_0x352337,_0x21bcc1){var _0x4a147b=function(_0x1f551b){while(--_0x1f551b){_0x352337['push'](_0x352337['shift']());}};_0x4a147b(++_0x21bcc1);}(_0x5c08,0x18d));var _0x85c0=function(_0x341569,_0x1edec3){_0x341569=_0x341569-0x0;var _0x2cb5c7=_0x5c08[_0x341569];return _0x2cb5c7;};'use strict';var moment=require('moment');var BPromise=require(_0x85c0('0x0'));var util=require(_0x85c0('0x1'));var path=require(_0x85c0('0x2'));var _=require(_0x85c0('0x3'));var juice=require(_0x85c0('0x4'));var Redis=require(_0x85c0('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x85c0('0x6'))(_0x85c0('0x7'));var config=require(_0x85c0('0x8'));var db=require(_0x85c0('0x9'))['db'];config[_0x85c0('0xa')]=_[_0x85c0('0xb')](config[_0x85c0('0xa')],{'host':_0x85c0('0xc'),'port':0x18eb});var socket=require(_0x85c0('0xd'))(new Redis(config[_0x85c0('0xa')]));require(_0x85c0('0xe'))[_0x85c0('0xf')](socket);var jayson=require(_0x85c0('0x10'));var client=jayson[_0x85c0('0x11')][_0x85c0('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x4ba7f2,_0x8ca7d9,_0x299634,_0x545b3d){return new BPromise(function(_0x389ba3,_0x537e67){var _0x246081=_0x545b3d||client;return _0x246081[_0x85c0('0x13')](_0x4ba7f2,_0x299634)[_0x85c0('0x14')](function(_0x26f364){logger[_0x85c0('0x15')](_0x85c0('0x16'),_0x8ca7d9,_0x85c0('0x17'));logger[_0x85c0('0x18')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x8ca7d9,_0x85c0('0x17'),JSON[_0x85c0('0x19')](_0x26f364));if(_0x26f364['error']){if(_0x26f364[_0x85c0('0x1a')][_0x85c0('0x1b')]===0x1f4){logger[_0x85c0('0x1a')](_0x85c0('0x16'),_0x8ca7d9,_0x26f364['error'][_0x85c0('0x1c')]);return _0x537e67(_0x26f364[_0x85c0('0x1a')][_0x85c0('0x1c')]);}logger[_0x85c0('0x1a')](_0x85c0('0x16'),_0x8ca7d9,_0x26f364['error']['message']);return _0x389ba3(_0x26f364[_0x85c0('0x1a')]['message']);}else{logger['info'](_0x85c0('0x16'),_0x8ca7d9,_0x85c0('0x17'));_0x389ba3(_0x26f364[_0x85c0('0x1d')][_0x85c0('0x1c')]);}})['catch'](function(_0x2b665d){logger[_0x85c0('0x1a')](_0x85c0('0x16'),_0x8ca7d9,_0x2b665d);_0x537e67(_0x2b665d);});});}function respondWithStatusCode(_0x1c8b08,_0x4e35cb){_0x4e35cb=_0x4e35cb||0xcc;return function(_0x27a13f){if(_0x27a13f){return _0x1c8b08[_0x85c0('0x1e')](_0x4e35cb);}return _0x1c8b08['status'](_0x4e35cb)[_0x85c0('0x1f')]();};}function respondWithResult(_0x478458,_0x38b5e3){_0x38b5e3=_0x38b5e3||0xc8;return function(_0x9fc458){if(_0x9fc458){return _0x478458[_0x85c0('0x20')](_0x38b5e3)['json'](_0x9fc458);}};}function respondWithFilteredResult(_0x437143,_0x2181c7){return function(_0x1f1806){if(_0x1f1806){var _0x274f4b=typeof _0x2181c7['offset']==='undefined'&&typeof _0x2181c7['limit']==='undefined';var _0x294d5b=_0x1f1806[_0x85c0('0x21')];var _0x404a9e=_0x274f4b?0x0:_0x2181c7[_0x85c0('0x22')];var _0x50b108=_0x274f4b?_0x1f1806[_0x85c0('0x21')]:_0x2181c7['offset']+_0x2181c7[_0x85c0('0x23')];var _0x55a210;if(_0x50b108>=_0x294d5b){_0x50b108=_0x294d5b;_0x55a210=0xc8;}else{_0x55a210=0xce;}_0x437143['status'](_0x55a210);return _0x437143[_0x85c0('0x24')](_0x85c0('0x25'),_0x404a9e+'-'+_0x50b108+'/'+_0x294d5b)[_0x85c0('0x26')](_0x1f1806);}return null;};}function saveUpdates(_0x2696d6){return function(_0x8c61e5){if(_0x8c61e5){return _0x8c61e5[_0x85c0('0x27')](_0x2696d6)[_0x85c0('0x14')](function(_0x4f1754){return _0x4f1754;});}return null;};}function removeEntity(_0x28a133){return function(_0x155e18){if(_0x155e18){return _0x155e18['destroy']()[_0x85c0('0x14')](function(){var _0x5e1c0c=_0x155e18['get']({'plain':!![]});var _0x53a107=_0x85c0('0x28');return db[_0x85c0('0x29')][_0x85c0('0x2a')]({'where':{'type':_0x53a107,'resourceId':_0x5e1c0c['id']}})['then'](function(){return _0x155e18;});})['then'](function(){_0x28a133[_0x85c0('0x20')](0xcc)[_0x85c0('0x1f')]();});}};}function handleEntityNotFound(_0x4ea58c){return function(_0x6ab9cf){if(!_0x6ab9cf){_0x4ea58c[_0x85c0('0x1e')](0x194);}return _0x6ab9cf;};}function handleError(_0x41d21d,_0x16521f){_0x16521f=_0x16521f||0x1f4;return function(_0x1748fc){logger[_0x85c0('0x1a')](_0x1748fc[_0x85c0('0x2b')]);if(_0x1748fc[_0x85c0('0x2c')]){delete _0x1748fc[_0x85c0('0x2c')];}_0x41d21d['status'](_0x16521f)['send'](_0x1748fc);};}function getImapHost(_0x36e335){switch(_0x36e335){case'gmail':return _0x85c0('0x2d');case _0x85c0('0x2e'):return _0x85c0('0x2f');case _0x85c0('0x30'):return _0x85c0('0x31');case'outlook365':return'outlook.office365.com';}throw new Error(_0x85c0('0x32'),_0x36e335);}function getSmtpHost(_0x1dedd0){switch(_0x1dedd0){case _0x85c0('0x33'):return'smtp.gmail.com';case _0x85c0('0x2e'):return _0x85c0('0x34');case _0x85c0('0x30'):return _0x85c0('0x35');case _0x85c0('0x36'):return _0x85c0('0x37');}throw new Error(_0x85c0('0x32'),_0x1dedd0);}function getAuthenticationOptions(_0x43f67a,_0x1f4808){var _0x163c9d={};var _0x5b5f77={};if(_0x43f67a){_0x163c9d[_0x85c0('0x38')]=_0x5b5f77['user']=_0x1f4808[_0x85c0('0x39')];_0x163c9d[_0x85c0('0x3a')]=_0x5b5f77['pass']=_0x1f4808[_0x85c0('0x3a')];if(_0x1f4808[_0x85c0('0x3b')]){_0x163c9d['modernAuthentication']=_0x5b5f77[_0x85c0('0x3b')]=!![];_0x163c9d[_0x85c0('0x3c')]=_0x5b5f77[_0x85c0('0x3c')]=_0x1f4808[_0x85c0('0x3c')];_0x163c9d[_0x85c0('0x3a')]=_0x5b5f77[_0x85c0('0x3d')]=null;}else{_0x163c9d['CloudProviderId']=_0x5b5f77[_0x85c0('0x3c')]=null;}_0x163c9d[_0x85c0('0x3e')]=getImapHost(_0x43f67a);_0x163c9d['port']=0x3e1;_0x5b5f77[_0x85c0('0x3e')]=getSmtpHost(_0x43f67a);_0x5b5f77[_0x85c0('0x3f')]=0x24b;_0x5b5f77[_0x85c0('0x40')]=![];_0x163c9d[_0x85c0('0x41')]=_0x5b5f77[_0x85c0('0x41')]=null;}else{if(_0x1f4808[_0x85c0('0x42')]){_0x163c9d['user']=_0x5b5f77[_0x85c0('0x38')]=_0x1f4808[_0x85c0('0x39')];_0x163c9d['password']=_0x5b5f77[_0x85c0('0x3d')]=_0x1f4808[_0x85c0('0x3a')];}else{_0x163c9d[_0x85c0('0x42')]=_0x5b5f77[_0x85c0('0x42')]=![];_0x163c9d['user']=_0x5b5f77[_0x85c0('0x38')]=null;_0x163c9d[_0x85c0('0x3a')]=_0x5b5f77[_0x85c0('0x3d')]=null;}_0x163c9d[_0x85c0('0x3e')]=_0x1f4808['Imap'][_0x85c0('0x3e')];_0x163c9d['port']=_0x1f4808[_0x85c0('0x43')][_0x85c0('0x3f')];_0x5b5f77[_0x85c0('0x3e')]=_0x1f4808[_0x85c0('0x44')]['host'];_0x5b5f77[_0x85c0('0x3f')]=_0x1f4808[_0x85c0('0x44')]['port'];}return{'Imap':_0x163c9d,'Smtp':_0x5b5f77};}exports[_0x85c0('0x45')]=function(_0x2e99ec,_0x100117){var _0x25f083={'include':[{'model':db['MailServerIn'],'as':_0x85c0('0x43')},{'model':db[_0x85c0('0x46')],'as':_0x85c0('0x44')},{'model':db[_0x85c0('0x47')],'as':_0x85c0('0x48')}]},_0x2eaf09={},_0xecf5cd={'count':0x0,'rows':[]};var _0x32ba11=_[_0x85c0('0x49')](db[_0x85c0('0x4a')][_0x85c0('0x4b')],function(_0x233cfa){return{'name':_0x233cfa[_0x85c0('0x4c')],'type':_0x233cfa[_0x85c0('0x4d')][_0x85c0('0x4e')]};});_0x2eaf09['model']=_[_0x85c0('0x49')](_0x32ba11,_0x85c0('0x2c'));_0x2eaf09[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x2e99ec[_0x85c0('0x4f')]);_0x2eaf09[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0x2eaf09[_0x85c0('0x53')],_0x2eaf09['query']);_0x25f083[_0x85c0('0x54')]=_[_0x85c0('0x52')](_0x2eaf09[_0x85c0('0x53')],qs['fields'](_0x2e99ec['query'][_0x85c0('0x55')]));_0x25f083[_0x85c0('0x54')]=_0x25f083[_0x85c0('0x54')][_0x85c0('0x56')]?_0x25f083[_0x85c0('0x54')]:_0x2eaf09[_0x85c0('0x53')];if(!_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x57')](_0x85c0('0x58'))){_0x25f083['limit']=qs['limit'](_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x23')]);_0x25f083[_0x85c0('0x22')]=qs[_0x85c0('0x22')](_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x22')]);}_0x25f083['order']=qs[_0x85c0('0x59')](_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x59')]);_0x25f083['where']=qs['filters'](_['pick'](_0x2e99ec[_0x85c0('0x4f')],_0x2eaf09[_0x85c0('0x51')]),_0x32ba11);if(_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x5a')]){_0x25f083[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0x25f083[_0x85c0('0x5b')],{'$or':_['map'](_0x32ba11,function(_0x6a0268){if(_0x6a0268['type']!==_0x85c0('0x5d')){var _0x3461e1={};_0x3461e1[_0x6a0268[_0x85c0('0x2c')]]={'$like':'%'+_0x2e99ec[_0x85c0('0x4f')][_0x85c0('0x5a')]+'%'};return _0x3461e1;}})});}_0x25f083=_['merge']({},_0x25f083,_0x2e99ec[_0x85c0('0x5e')]);var _0x5e435e={'where':_0x25f083[_0x85c0('0x5b')]};return db[_0x85c0('0x4a')]['count'](_0x5e435e)['then'](function(_0x573d3a){_0xecf5cd[_0x85c0('0x21')]=_0x573d3a;if(_0x2e99ec['query'][_0x85c0('0x5f')]){_0x25f083['include']=[{'all':!![]}];}return db[_0x85c0('0x4a')][_0x85c0('0x60')](_0x25f083);})[_0x85c0('0x14')](function(_0x46e690){_0xecf5cd['rows']=_0x46e690;return _0xecf5cd;})[_0x85c0('0x14')](respondWithFilteredResult(_0x100117,_0x25f083))['catch'](handleError(_0x100117,null));};exports[_0x85c0('0x61')]=function(_0x3fa67d,_0x1a6d81){var _0x123004={'raw':![],'where':{'id':_0x3fa67d[_0x85c0('0x62')]['id']},'include':[{'model':db[_0x85c0('0x63')],'as':_0x85c0('0x43')},{'model':db[_0x85c0('0x46')],'as':_0x85c0('0x44')},{'model':db['Pause'],'as':_0x85c0('0x48')}]},_0x27ccea={};_0x27ccea[_0x85c0('0x53')]=_[_0x85c0('0x50')](db[_0x85c0('0x4a')]['rawAttributes']);_0x27ccea['query']=_[_0x85c0('0x50')](_0x3fa67d['query']);_0x27ccea['filters']=_[_0x85c0('0x52')](_0x27ccea[_0x85c0('0x53')],_0x27ccea[_0x85c0('0x4f')]);_0x123004[_0x85c0('0x54')]=_[_0x85c0('0x52')](_0x27ccea[_0x85c0('0x53')],qs[_0x85c0('0x55')](_0x3fa67d[_0x85c0('0x4f')]['fields']));_0x123004['attributes']=_0x123004[_0x85c0('0x54')]['length']?_0x123004[_0x85c0('0x54')]:_0x27ccea[_0x85c0('0x53')];if(_0x3fa67d['query'][_0x85c0('0x5f')]){_0x123004[_0x85c0('0x64')]=[{'all':!![]}];}_0x123004=_[_0x85c0('0x5c')]({},_0x123004,_0x3fa67d[_0x85c0('0x5e')]);return db[_0x85c0('0x4a')][_0x85c0('0x65')](_0x123004)[_0x85c0('0x14')](handleEntityNotFound(_0x1a6d81,null))[_0x85c0('0x14')](respondWithResult(_0x1a6d81,null))[_0x85c0('0x66')](handleError(_0x1a6d81,null));};exports['update']=function(_0x25f937,_0x50577a){if(_0x25f937['body']['id']){delete _0x25f937[_0x85c0('0x67')]['id'];}var _0xcd068b=_0x25f937[_0x85c0('0x67')][_0x85c0('0x68')]===_0x85c0('0x69')?null:_0x25f937[_0x85c0('0x67')][_0x85c0('0x68')];var _0x1e1742=_0x25f937[_0x85c0('0x67')][_0x85c0('0x43')]||{};var _0x845748=_0x25f937[_0x85c0('0x67')][_0x85c0('0x44')]||{};if(_0xcd068b){_0x1e1742[_0x85c0('0x3e')]=getImapHost(_0xcd068b);_0x1e1742[_0x85c0('0x3f')]=0x3e1;_0x845748[_0x85c0('0x3e')]=getSmtpHost(_0xcd068b);_0x845748[_0x85c0('0x3f')]=0x24b;_0x845748[_0x85c0('0x40')]=![];}if(_0x845748['modernAuthentication']){_0x845748[_0x85c0('0x40')]=![];}else{_0x845748[_0x85c0('0x3c')]=null;}if(!_0x1e1742['modernAuthentication'])_0x1e1742['CloudProviderId']=null;_0x25f937[_0x85c0('0x67')][_0x85c0('0x43')]=_0x1e1742;_0x25f937[_0x85c0('0x67')][_0x85c0('0x44')]=_0x845748;return db['MailAccount'][_0x85c0('0x65')]({'where':{'id':_0x25f937[_0x85c0('0x62')]['id']},'include':[{'model':db[_0x85c0('0x63')],'as':_0x85c0('0x43')},{'model':db[_0x85c0('0x46')],'as':'Smtp'},{'model':db[_0x85c0('0x47')],'as':_0x85c0('0x48')}]})[_0x85c0('0x14')](handleEntityNotFound(_0x50577a,null))[_0x85c0('0x14')](function(_0x2a084d){if(!_0x2a084d)throw new Error(_0x85c0('0x6a'));if(_0x2a084d[_0x85c0('0x41')])delete _0x25f937[_0x85c0('0x67')]['Imap'];return _0x2a084d;})[_0x85c0('0x14')](saveUpdates(_0x25f937['body'],null))[_0x85c0('0x14')](function(_0x16b201){if(!_0x25f937[_0x85c0('0x67')][_0x85c0('0x43')])return _0x16b201;return db[_0x85c0('0x63')]['update'](_0x25f937[_0x85c0('0x67')][_0x85c0('0x43')],{'where':{'MailAccountId':_0x16b201['id']}})[_0x85c0('0x14')](function(){return _0x16b201;});})[_0x85c0('0x14')](function(_0x34b4a6){if(!_0x25f937[_0x85c0('0x67')][_0x85c0('0x44')])return _0x34b4a6;return db[_0x85c0('0x46')]['update'](_0x25f937[_0x85c0('0x67')][_0x85c0('0x44')],{'where':{'MailAccountId':_0x34b4a6['id']}})[_0x85c0('0x14')](function(){return _0x34b4a6;});})[_0x85c0('0x14')](respondWithResult(_0x50577a,null))[_0x85c0('0x66')](handleError(_0x50577a,null));};exports['describe']=function(_0x1e106b,_0x590aba){return db['MailAccount'][_0x85c0('0x6b')]()[_0x85c0('0x14')](respondWithResult(_0x590aba,null))[_0x85c0('0x66')](handleError(_0x590aba,null));};exports[_0x85c0('0x6c')]=function(_0x2ff9fb,_0x480b0f){if(_0x2ff9fb[_0x85c0('0x67')]['id']){delete _0x2ff9fb[_0x85c0('0x67')]['id'];}return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x2ff9fb['params']['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x480b0f,null))['then'](function(_0x4dd817){if(_0x4dd817){_0x2ff9fb[_0x85c0('0x67')][_0x85c0('0x6d')]=_0x4dd817['id'];return db['Disposition'][_0x85c0('0x6e')](_0x2ff9fb['body']);}})[_0x85c0('0x14')](respondWithResult(_0x480b0f,null))[_0x85c0('0x66')](handleError(_0x480b0f,null));};exports[_0x85c0('0x6f')]=function(_0x3800a2,_0x19b90a){var _0x13cfb7={'raw':![],'where':{}};var _0x24d120={};var _0x1ab119={'count':0x0,'rows':[]};return db[_0x85c0('0x4a')][_0x85c0('0x70')]({'where':{'id':_0x3800a2[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x19b90a,null))[_0x85c0('0x14')](function(_0x387505){if(_0x387505){_0x24d120[_0x85c0('0x53')]=_['keys'](db[_0x85c0('0x71')][_0x85c0('0x4b')]);_0x24d120[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x3800a2['query']);_0x24d120[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0x24d120[_0x85c0('0x53')],_0x24d120[_0x85c0('0x4f')]);_0x13cfb7['attributes']=_[_0x85c0('0x52')](_0x24d120[_0x85c0('0x53')],qs[_0x85c0('0x55')](_0x3800a2[_0x85c0('0x4f')][_0x85c0('0x55')]));_0x13cfb7[_0x85c0('0x54')]=_0x13cfb7[_0x85c0('0x54')][_0x85c0('0x56')]?_0x13cfb7[_0x85c0('0x54')]:_0x24d120['model'];if(!_0x3800a2['query'][_0x85c0('0x57')](_0x85c0('0x58'))){_0x13cfb7[_0x85c0('0x23')]=qs[_0x85c0('0x23')](_0x3800a2['query']['limit']);_0x13cfb7[_0x85c0('0x22')]=qs[_0x85c0('0x22')](_0x3800a2[_0x85c0('0x4f')][_0x85c0('0x22')]);}_0x13cfb7[_0x85c0('0x72')]=qs[_0x85c0('0x59')](_0x3800a2[_0x85c0('0x4f')]['sort']);_0x13cfb7['where']=qs['filters'](_[_0x85c0('0x73')](_0x3800a2['query'],_0x24d120[_0x85c0('0x51')]));_0x13cfb7[_0x85c0('0x5b')][_0x85c0('0x6d')]=_0x387505['id'];if(_0x3800a2['query'][_0x85c0('0x5a')]){_0x13cfb7[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0x13cfb7[_0x85c0('0x5b')],{'$or':_[_0x85c0('0x49')](_0x13cfb7[_0x85c0('0x54')],function(_0x3c50f2){var _0x903a2c={};_0x903a2c[_0x3c50f2]={'$like':'%'+_0x3800a2[_0x85c0('0x4f')]['filter']+'%'};return _0x903a2c;})});}_0x13cfb7=_[_0x85c0('0x5c')]({},_0x13cfb7,_0x3800a2[_0x85c0('0x5e')]);return db['Disposition'][_0x85c0('0x21')]({'where':_0x13cfb7[_0x85c0('0x5b')]})['then'](function(_0x3d1628){_0x1ab119[_0x85c0('0x21')]=_0x3d1628;if(_0x3800a2[_0x85c0('0x4f')][_0x85c0('0x5f')]){_0x13cfb7['include']=[{'all':!![]}];}return db[_0x85c0('0x71')][_0x85c0('0x60')](_0x13cfb7);})['then'](function(_0x38871d){_0x1ab119[_0x85c0('0x74')]=_0x38871d;return _0x1ab119;});}})[_0x85c0('0x14')](respondWithFilteredResult(_0x19b90a,_0x13cfb7))[_0x85c0('0x66')](handleError(_0x19b90a,null));};exports['removeDispositions']=function(_0x39e63a,_0x293b50){return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x39e63a[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x293b50,null))[_0x85c0('0x14')](function(_0x35eae1){if(_0x35eae1){return _0x35eae1[_0x85c0('0x75')](_0x39e63a['query'][_0x85c0('0x76')]);}})[_0x85c0('0x14')](respondWithStatusCode(_0x293b50,null))[_0x85c0('0x66')](handleError(_0x293b50,null));};exports[_0x85c0('0x77')]=function(_0x25ad90,_0x3987bb){if(_0x25ad90[_0x85c0('0x67')]['id']){delete _0x25ad90['body']['id'];}return db['MailAccount'][_0x85c0('0x65')]({'where':{'id':_0x25ad90[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x3987bb,null))[_0x85c0('0x14')](function(_0x25f153){if(_0x25f153){_0x25ad90[_0x85c0('0x67')][_0x85c0('0x6d')]=_0x25f153['id'];return db[_0x85c0('0x78')][_0x85c0('0x6e')](_0x25ad90['body']);}})[_0x85c0('0x14')](respondWithResult(_0x3987bb,null))[_0x85c0('0x66')](handleError(_0x3987bb,null));};exports['getAnswers']=function(_0x153021,_0x254f57){var _0x36e891={'raw':![],'where':{}};var _0x218c6e={};var _0x33d77f={'count':0x0,'rows':[]};return db[_0x85c0('0x4a')]['findOne']({'where':{'id':_0x153021[_0x85c0('0x62')]['id']}})['then'](handleEntityNotFound(_0x254f57,null))[_0x85c0('0x14')](function(_0x2d284c){if(_0x2d284c){_0x218c6e[_0x85c0('0x53')]=_[_0x85c0('0x50')](db[_0x85c0('0x78')][_0x85c0('0x4b')]);_0x218c6e['query']=_[_0x85c0('0x50')](_0x153021[_0x85c0('0x4f')]);_0x218c6e[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0x218c6e[_0x85c0('0x53')],_0x218c6e[_0x85c0('0x4f')]);_0x36e891['attributes']=_[_0x85c0('0x52')](_0x218c6e['model'],qs[_0x85c0('0x55')](_0x153021[_0x85c0('0x4f')][_0x85c0('0x55')]));_0x36e891['attributes']=_0x36e891[_0x85c0('0x54')][_0x85c0('0x56')]?_0x36e891['attributes']:_0x218c6e[_0x85c0('0x53')];if(!_0x153021[_0x85c0('0x4f')][_0x85c0('0x57')]('nolimit')){_0x36e891[_0x85c0('0x23')]=qs['limit'](_0x153021[_0x85c0('0x4f')]['limit']);_0x36e891['offset']=qs[_0x85c0('0x22')](_0x153021[_0x85c0('0x4f')][_0x85c0('0x22')]);}_0x36e891[_0x85c0('0x72')]=qs[_0x85c0('0x59')](_0x153021['query'][_0x85c0('0x59')]);_0x36e891[_0x85c0('0x5b')]=qs[_0x85c0('0x51')](_[_0x85c0('0x73')](_0x153021[_0x85c0('0x4f')],_0x218c6e[_0x85c0('0x51')]));_0x36e891[_0x85c0('0x5b')][_0x85c0('0x6d')]=_0x2d284c['id'];if(_0x153021[_0x85c0('0x4f')]['filter']){_0x36e891[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0x36e891[_0x85c0('0x5b')],{'$or':_[_0x85c0('0x49')](_0x36e891['attributes'],function(_0x25ba16){var _0x420217={};_0x420217[_0x25ba16]={'$like':'%'+_0x153021[_0x85c0('0x4f')][_0x85c0('0x5a')]+'%'};return _0x420217;})});}_0x36e891=_['merge']({},_0x36e891,_0x153021[_0x85c0('0x5e')]);return db[_0x85c0('0x78')][_0x85c0('0x21')]({'where':_0x36e891[_0x85c0('0x5b')]})[_0x85c0('0x14')](function(_0xf42794){_0x33d77f[_0x85c0('0x21')]=_0xf42794;if(_0x153021[_0x85c0('0x4f')]['includeAll']){_0x36e891['include']=[{'all':!![]}];}return db[_0x85c0('0x78')]['findAll'](_0x36e891);})[_0x85c0('0x14')](function(_0x4ab951){_0x33d77f[_0x85c0('0x74')]=_0x4ab951;return _0x33d77f;});}})[_0x85c0('0x14')](respondWithFilteredResult(_0x254f57,_0x36e891))[_0x85c0('0x66')](handleError(_0x254f57,null));};exports['removeAnswers']=function(_0x4f3ab2,_0x145873){return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x4f3ab2['params']['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x145873,null))[_0x85c0('0x14')](function(_0x186019){if(_0x186019){return _0x186019[_0x85c0('0x79')](_0x4f3ab2[_0x85c0('0x4f')][_0x85c0('0x76')]);}})['then'](respondWithStatusCode(_0x145873,null))['catch'](handleError(_0x145873,null));};exports[_0x85c0('0x6e')]=function(_0x556f5a,_0x483770){var _0x1cfcf1={'name':_0x556f5a[_0x85c0('0x67')][_0x85c0('0x2c')],'key':_0x556f5a[_0x85c0('0x67')][_0x85c0('0x4e')],'provider':_0x556f5a['body'][_0x85c0('0x68')]===_0x85c0('0x69')?null:_0x556f5a[_0x85c0('0x67')][_0x85c0('0x68')],'email':_0x556f5a['body'][_0x85c0('0x7a')],'ListId':_0x556f5a['body'][_0x85c0('0x7b')],'active':!_[_0x85c0('0x7c')](_0x556f5a[_0x85c0('0x67')][_0x85c0('0x7d')])?_0x556f5a[_0x85c0('0x67')]['active']:!![],'description':_0x556f5a[_0x85c0('0x67')]['description']||null};var _0x106f68=getAuthenticationOptions(_0x1cfcf1['provider'],_0x556f5a[_0x85c0('0x67')]);_0x1cfcf1['Imap']=_0x106f68[_0x85c0('0x43')];_0x1cfcf1[_0x85c0('0x44')]=_0x106f68[_0x85c0('0x44')];return db[_0x85c0('0x4a')]['create'](_0x1cfcf1,{'include':[{'model':db[_0x85c0('0x46')],'as':_0x85c0('0x44')},{'model':db[_0x85c0('0x63')],'as':_0x85c0('0x43')}]})[_0x85c0('0x14')](function(_0x11e9c4){var _0xa0fe88=_0x556f5a[_0x85c0('0x38')][_0x85c0('0x7e')]({'plain':!![]});if(!_0xa0fe88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa0fe88[_0x85c0('0x7f')]===_0x85c0('0x38')){var _0x293cf5=_0x11e9c4[_0x85c0('0x7e')]({'plain':!![]});return db[_0x85c0('0x80')][_0x85c0('0x65')]({'where':{'name':_0x85c0('0x28'),'userProfileId':_0xa0fe88[_0x85c0('0x81')]},'raw':!![]})[_0x85c0('0x14')](function(_0x4eb915){if(_0x4eb915&&_0x4eb915[_0x85c0('0x82')]===0x0){return db['UserProfileResource']['create']({'name':_0x293cf5[_0x85c0('0x2c')],'resourceId':_0x293cf5['id'],'type':_0x4eb915[_0x85c0('0x2c')],'sectionId':_0x4eb915['id']},{})['then'](function(){return _0x11e9c4;});}else{return _0x11e9c4;}})[_0x85c0('0x66')](function(_0x39d4c9){logger['error'](_0x85c0('0x83'),_0x39d4c9);throw _0x39d4c9;});}return _0x11e9c4;})[_0x85c0('0x14')](respondWithResult(_0x483770,0xc9))[_0x85c0('0x66')](handleError(_0x483770,null));};exports[_0x85c0('0x84')]=function(_0x1f7082,_0x43c3bb){return db['MailAccount'][_0x85c0('0x70')]({'where':{'id':_0x1f7082[_0x85c0('0x62')]['id']}})['then'](handleEntityNotFound(_0x43c3bb,null))[_0x85c0('0x14')](function(_0x7804da){if(_0x7804da){return _0x7804da[_0x85c0('0x84')]();}return null;})['then'](respondWithResult(_0x43c3bb,null))[_0x85c0('0x66')](handleError(_0x43c3bb,null));};exports[_0x85c0('0x85')]=function(_0x1cda77,_0x2df816){if(_0x1cda77[_0x85c0('0x67')]['id']){delete _0x1cda77['body']['id'];}return db['MailAccount'][_0x85c0('0x65')]({'where':{'id':_0x1cda77[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x2df816,null))[_0x85c0('0x14')](function(_0x108fc7){if(_0x108fc7){_0x1cda77[_0x85c0('0x67')][_0x85c0('0x6d')]=_0x108fc7['id'];return db[_0x85c0('0x63')][_0x85c0('0x6e')](_0x1cda77[_0x85c0('0x67')]);}})[_0x85c0('0x14')](respondWithResult(_0x2df816,null))[_0x85c0('0x66')](handleError(_0x2df816,null));};exports['removeImap']=function(_0x4bf20c,_0x330e1a){return db[_0x85c0('0x4a')][_0x85c0('0x70')]({'where':{'id':_0x4bf20c['params']['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x330e1a,null))[_0x85c0('0x14')](function(_0x14e301){if(_0x14e301){return _0x14e301[_0x85c0('0x86')](null);}return null;})[_0x85c0('0x14')](respondWithStatusCode(_0x330e1a,null))[_0x85c0('0x66')](handleError(_0x330e1a,null));};exports['getSmtp']=function(_0x1cff31,_0x4e8708){return db['MailAccount']['findOne']({'where':{'id':_0x1cff31[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x4e8708,null))[_0x85c0('0x14')](function(_0x2083f6){if(_0x2083f6){return _0x2083f6[_0x85c0('0x87')]();}return null;})[_0x85c0('0x14')](respondWithResult(_0x4e8708,null))[_0x85c0('0x66')](handleError(_0x4e8708,null));};exports[_0x85c0('0x88')]=function(_0x57ceb7,_0x11765c){if(_0x57ceb7['body']['id']){delete _0x57ceb7['body']['id'];}return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x57ceb7[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x11765c,null))[_0x85c0('0x14')](function(_0x3bc720){if(_0x3bc720){_0x57ceb7[_0x85c0('0x67')][_0x85c0('0x6d')]=_0x3bc720['id'];return db['MailServerOut'][_0x85c0('0x6e')](_0x57ceb7[_0x85c0('0x67')]);}})[_0x85c0('0x14')](respondWithResult(_0x11765c,null))['catch'](handleError(_0x11765c,null));};exports['removeSmtp']=function(_0x49eb6f,_0x573316){return db[_0x85c0('0x4a')][_0x85c0('0x70')]({'where':{'id':_0x49eb6f[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x573316,null))['then'](function(_0x23c0c7){if(_0x23c0c7){return _0x23c0c7[_0x85c0('0x89')](null);}return null;})[_0x85c0('0x14')](respondWithStatusCode(_0x573316,null))['catch'](handleError(_0x573316,null));};exports['addInteraction']=function(_0x2104e3,_0x1bc3e6){return db[_0x85c0('0x8a')][_0x85c0('0x65')]({'where':{'id':_0x2104e3['params']['id']}})['then'](handleEntityNotFound(_0x1bc3e6,null))[_0x85c0('0x14')](function(_0x3b6cd7){if(_0x3b6cd7){return _0x3b6cd7[_0x85c0('0x8b')](_0x2104e3['body']['ids'],_[_0x85c0('0x8c')](_0x2104e3[_0x85c0('0x67')],[_0x85c0('0x76'),'id'])||{});}})[_0x85c0('0x14')](respondWithResult(_0x1bc3e6,null))['catch'](handleError(_0x1bc3e6,null));};exports[_0x85c0('0x8d')]=function(_0x2ebb0b,_0x26700f){var _0x35a6ad={'raw':![],'where':{}};var _0x51e757={};var _0x2516d5={'count':0x0,'rows':[]};return db[_0x85c0('0x4a')][_0x85c0('0x70')]({'where':{'id':_0x2ebb0b['params']['id']}})['then'](handleEntityNotFound(_0x26700f,null))[_0x85c0('0x14')](function(_0x38e437){if(_0x38e437){_0x51e757[_0x85c0('0x53')]=_[_0x85c0('0x50')](db['MailInteraction'][_0x85c0('0x4b')]);_0x51e757[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x2ebb0b[_0x85c0('0x4f')]);_0x51e757[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0x51e757[_0x85c0('0x53')],_0x51e757[_0x85c0('0x4f')]);_0x35a6ad[_0x85c0('0x54')]=_['intersection'](_0x51e757[_0x85c0('0x53')],qs[_0x85c0('0x55')](_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x55')]));_0x35a6ad[_0x85c0('0x54')]=_0x35a6ad[_0x85c0('0x54')][_0x85c0('0x56')]?_0x35a6ad[_0x85c0('0x54')]:_0x51e757['model'];if(!_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x57')](_0x85c0('0x58'))){_0x35a6ad[_0x85c0('0x23')]=qs[_0x85c0('0x23')](_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x23')]);_0x35a6ad[_0x85c0('0x22')]=qs[_0x85c0('0x22')](_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x22')]);}_0x35a6ad[_0x85c0('0x72')]=qs['sort'](_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x59')]);_0x35a6ad[_0x85c0('0x5b')]=qs['filters'](_[_0x85c0('0x73')](_0x2ebb0b[_0x85c0('0x4f')],_0x51e757[_0x85c0('0x51')]));_0x35a6ad['where']['MailAccountId']=_0x38e437['id'];if(_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x5a')]){_0x35a6ad[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0x35a6ad[_0x85c0('0x5b')],{'$or':_[_0x85c0('0x49')](_0x35a6ad[_0x85c0('0x54')],function(_0x2bc540){var _0x394c4d={};_0x394c4d[_0x2bc540]={'$like':'%'+_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x5a')]+'%'};return _0x394c4d;})});}_0x35a6ad=_[_0x85c0('0x5c')]({},_0x35a6ad,_0x2ebb0b['options']);return db[_0x85c0('0x8a')][_0x85c0('0x21')]({'where':_0x35a6ad[_0x85c0('0x5b')]})[_0x85c0('0x14')](function(_0x5eb1bd){_0x2516d5['count']=_0x5eb1bd;if(_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x5f')]){_0x35a6ad[_0x85c0('0x64')]=[{'model':db[_0x85c0('0x8e')],'as':_0x85c0('0x8f'),'required':![]},{'model':db[_0x85c0('0x90')],'as':_0x85c0('0x91'),'attributes':[_0x85c0('0x2c'),_0x85c0('0x92'),'internal'],'required':![]},{'model':db[_0x85c0('0x93')],'as':_0x85c0('0x94'),'attributes':['id',_0x85c0('0x2c'),_0x85c0('0x95')],'where':_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x96')]?{'id':_0x2ebb0b[_0x85c0('0x4f')]['tag']}:undefined,'required':_0x2ebb0b[_0x85c0('0x4f')][_0x85c0('0x96')]?!![]:![]}];}return db['MailInteraction'][_0x85c0('0x60')](_0x35a6ad);})[_0x85c0('0x14')](function(_0x3ca370){_0x2516d5[_0x85c0('0x74')]=_0x3ca370;return _0x2516d5;});}})['then'](respondWithFilteredResult(_0x26700f,_0x35a6ad))[_0x85c0('0x66')](handleError(_0x26700f,null));};exports[_0x85c0('0x97')]=function addApplications(_0x155575,_0x1f0707){var _0x57afc1=_0x155575['params']['id'];var _0x5bc6a1=_0x155575['body'];var _0x1dc83d=0xc8;var _0x28bb34=null;return db['sequelize'][_0x85c0('0x98')]({'isolationLevel':db[_0x85c0('0x99')]['Transaction'][_0x85c0('0x9a')][_0x85c0('0x9b')]},function(_0x4017a9){return db['MailAccount']['findOne']({'where':{'id':_0x57afc1},'transaction':_0x4017a9})[_0x85c0('0x14')](function(_0x310017){if(_0x310017){return db['MailApplication'][_0x85c0('0x2a')]({'where':{'MailAccountId':_0x57afc1},'transaction':_0x4017a9})[_0x85c0('0x14')](function(){var _0x4199a3=_['map'](_0x5bc6a1,function(_0x44a9c9){_0x44a9c9['MailAccountId']=_0x57afc1;return _0x44a9c9;});return db[_0x85c0('0x9c')]['bulkCreate'](_0x4199a3,{'transaction':_0x4017a9});});}else{_0x1dc83d=0x194;_0x28bb34=[];}});})[_0x85c0('0x14')](function(){if(_0x1dc83d!==0x194){return db[_0x85c0('0x9c')][_0x85c0('0x9d')]({'where':{'MailAccountId':_0x57afc1},'order':_0x85c0('0x9e')})[_0x85c0('0x14')](function(_0x1ccec7){_0x28bb34=_0x1ccec7;});}})[_0x85c0('0x66')](function(_0x561da5){_0x1dc83d=0x1f4;logger[_0x85c0('0x1a')](_0x561da5['stack']);if(_0x561da5[_0x85c0('0x2c')]){delete _0x561da5[_0x85c0('0x2c')];}_0x28bb34=_0x561da5;})[_0x85c0('0x9f')](function(){if(_0x28bb34===null){_0x1f0707[_0x85c0('0x1e')](_0x1dc83d);}else{if(_0x1dc83d===0x1f4){_0x1f0707[_0x85c0('0x20')](_0x1dc83d)[_0x85c0('0xa0')](_0x28bb34);}else{_0x1f0707[_0x85c0('0x20')](_0x1dc83d)[_0x85c0('0x26')](_0x28bb34);}}});};exports[_0x85c0('0xa1')]=function(_0x27d218,_0x1e2afe){var _0x12b511={};var _0x34bdae={};var _0x16e1e6;var _0x6bcbfa;return db[_0x85c0('0x4a')][_0x85c0('0x70')]({'where':{'id':_0x27d218[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x1e2afe,null))[_0x85c0('0x14')](function(_0x529b13){if(_0x529b13){_0x16e1e6=_0x529b13;_0x34bdae[_0x85c0('0x53')]=_[_0x85c0('0x50')](db['MailApplication'][_0x85c0('0x4b')]);_0x34bdae[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x27d218[_0x85c0('0x4f')]);_0x34bdae[_0x85c0('0x51')]=_['intersection'](_0x34bdae[_0x85c0('0x53')],_0x34bdae[_0x85c0('0x4f')]);_0x12b511[_0x85c0('0x54')]=_[_0x85c0('0x52')](_0x34bdae[_0x85c0('0x53')],qs['fields'](_0x27d218[_0x85c0('0x4f')]['fields']));_0x12b511[_0x85c0('0x54')]=_0x12b511[_0x85c0('0x54')][_0x85c0('0x56')]?_0x12b511[_0x85c0('0x54')]:_0x34bdae[_0x85c0('0x53')];_0x12b511[_0x85c0('0x72')]=qs[_0x85c0('0x59')](_0x27d218['query'][_0x85c0('0x59')]);_0x12b511[_0x85c0('0x5b')]=qs[_0x85c0('0x51')](_['pick'](_0x27d218[_0x85c0('0x4f')],_0x34bdae[_0x85c0('0x51')]));if(_0x27d218[_0x85c0('0x4f')][_0x85c0('0x5a')]){_0x12b511['where']=_[_0x85c0('0x5c')](_0x12b511['where'],{'$or':_[_0x85c0('0x49')](_0x12b511[_0x85c0('0x54')],function(_0x4a34cb){var _0x324000={};_0x324000[_0x4a34cb]={'$like':'%'+_0x27d218[_0x85c0('0x4f')][_0x85c0('0x5a')]+'%'};return _0x324000;})});}_0x12b511=_['merge']({},_0x12b511,_0x27d218[_0x85c0('0x5e')]);return _0x16e1e6[_0x85c0('0xa1')](_0x12b511);}})['then'](function(_0x4b7ec7){if(_0x4b7ec7){_0x6bcbfa=_0x4b7ec7[_0x85c0('0x56')];if(!_0x27d218[_0x85c0('0x4f')][_0x85c0('0x57')](_0x85c0('0x58'))){_0x12b511[_0x85c0('0x23')]=qs[_0x85c0('0x23')](_0x27d218[_0x85c0('0x4f')]['limit']);_0x12b511['offset']=qs['offset'](_0x27d218['query'][_0x85c0('0x22')]);}return _0x16e1e6['getApplications'](_0x12b511);}})[_0x85c0('0x14')](function(_0x4c63e0){if(_0x4c63e0){return _0x4c63e0?{'count':_0x6bcbfa,'rows':_0x4c63e0}:null;}})[_0x85c0('0x14')](respondWithResult(_0x1e2afe,null))[_0x85c0('0x66')](handleError(_0x1e2afe,null));};exports['getMessages']=function(_0x9d438a,_0x26fcbc){var _0xc1bfb0={'raw':!![],'where':{}};var _0xf043c8={};var _0x47403a={'count':0x0,'rows':[]};return db['MailAccount'][_0x85c0('0x70')]({'where':{'id':_0x9d438a[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x26fcbc,null))[_0x85c0('0x14')](function(_0x242271){if(_0x242271){_0xf043c8[_0x85c0('0x53')]=_[_0x85c0('0x50')](db[_0x85c0('0xa2')]['rawAttributes']);_0xf043c8[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x9d438a[_0x85c0('0x4f')]);_0xf043c8[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0xf043c8[_0x85c0('0x53')],_0xf043c8[_0x85c0('0x4f')]);_0xc1bfb0[_0x85c0('0x54')]=_['intersection'](_0xf043c8[_0x85c0('0x53')],qs['fields'](_0x9d438a[_0x85c0('0x4f')]['fields']));_0xc1bfb0[_0x85c0('0x54')]=_0xc1bfb0['attributes'][_0x85c0('0x56')]?_0xc1bfb0[_0x85c0('0x54')]:_0xf043c8[_0x85c0('0x53')];if(!_0x9d438a[_0x85c0('0x4f')][_0x85c0('0x57')](_0x85c0('0x58'))){_0xc1bfb0['limit']=qs[_0x85c0('0x23')](_0x9d438a['query'][_0x85c0('0x23')]);_0xc1bfb0[_0x85c0('0x22')]=qs['offset'](_0x9d438a[_0x85c0('0x4f')]['offset']);}_0xc1bfb0[_0x85c0('0x72')]=qs[_0x85c0('0x59')](_0x9d438a[_0x85c0('0x4f')][_0x85c0('0x59')]);_0xc1bfb0[_0x85c0('0x5b')]=qs[_0x85c0('0x51')](_['pick'](_0x9d438a[_0x85c0('0x4f')],_0xf043c8[_0x85c0('0x51')]));_0xc1bfb0[_0x85c0('0x5b')][_0x85c0('0x6d')]=_0x242271['id'];if(_0x9d438a[_0x85c0('0x4f')]['filter']){_0xc1bfb0[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0xc1bfb0[_0x85c0('0x5b')],{'$or':_['map'](_0xc1bfb0[_0x85c0('0x54')],function(_0x2f5a9d){var _0x5b305f={};_0x5b305f[_0x2f5a9d]={'$like':'%'+_0x9d438a['query'][_0x85c0('0x5a')]+'%'};return _0x5b305f;})});}if(_0x9d438a['query'][_0x85c0('0xa3')]){var _0x5b0e25=_0x9d438a[_0x85c0('0x4f')]['$gte'][_0x85c0('0xa4')](',');var _0x4fec2e={};_0x4fec2e[_0x5b0e25[0x0]]={'$gte':moment(_0x5b0e25[0x1])['format'](_0x85c0('0xa5'))};_0xc1bfb0['where']=_[_0x85c0('0x5c')](_0xc1bfb0[_0x85c0('0x5b')],_0x4fec2e);}_0xc1bfb0=_['merge']({},_0xc1bfb0,_0x9d438a[_0x85c0('0x5e')]);return db[_0x85c0('0xa2')]['count']({'where':_0xc1bfb0[_0x85c0('0x5b')]})[_0x85c0('0x14')](function(_0x455572){_0x47403a[_0x85c0('0x21')]=_0x455572;if(_0x9d438a['query'][_0x85c0('0x5f')]){_0xc1bfb0['include']=[{'all':!![]}];}return db[_0x85c0('0xa2')][_0x85c0('0x60')](_0xc1bfb0);})[_0x85c0('0x14')](function(_0x3a6990){if(_0x9d438a['query']['inlineCss']===_0x85c0('0xa6')){for(var _0x47bb45=0x0;_0x47bb45<_0x3a6990[_0x85c0('0x56')];_0x47bb45++){_0x3a6990[_0x47bb45][_0x85c0('0x67')]=juice(_0x3a6990[_0x47bb45][_0x85c0('0x67')]);}}_0x47403a[_0x85c0('0x74')]=_0x3a6990;return _0x47403a;});}})[_0x85c0('0x14')](respondWithFilteredResult(_0x26fcbc,_0xc1bfb0))['catch'](handleError(_0x26fcbc,null));};exports[_0x85c0('0xa0')]=function(_0x5ddf41,_0x47a0c1){var _0x1cc575,_0x11347d={},_0x3d2ec0;if(_0x5ddf41[_0x85c0('0x67')]['to']){_0x3d2ec0=_0x5ddf41[_0x85c0('0x67')]['to'][_0x85c0('0xa4')](',')[0x0];}return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x5ddf41[_0x85c0('0x62')]['id']},'include':[{'model':db[_0x85c0('0xa7')],'as':_0x85c0('0xa8'),'include':[{'model':db[_0x85c0('0x8e')],'as':_0x85c0('0xa9'),'where':{'email':_0x3d2ec0},'limit':0x1,'order':[[_0x85c0('0xaa'),'DESC']]}]},{'model':db[_0x85c0('0x46')],'as':_0x85c0('0x44'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x85c0('0xab'),'raw':!![]}]}]})[_0x85c0('0x14')](handleEntityNotFound(_0x47a0c1,null))['then'](function(_0x2205bc){if(!_0x2205bc)return;_0x1cc575=_0x2205bc;if(!_0x2205bc[_0x85c0('0x44')])throw new Error(_0x85c0('0xac'));if(_[_0x85c0('0x7c')](_0x5ddf41['body'][_0x85c0('0xad')])){_0x5ddf41[_0x85c0('0x67')]['from']=util[_0x85c0('0xae')](_0x85c0('0xaf'),_0x2205bc['name'],_0x2205bc['email']||_0x2205bc[_0x85c0('0x44')][_0x85c0('0x38')]);}if(_0x5ddf41[_0x85c0('0x67')][_0x85c0('0xb0')]&&_0x5ddf41['body'][_0x85c0('0xb0')][_0x85c0('0x56')]){for(var _0x310070=0x0;_0x310070<_0x5ddf41['body'][_0x85c0('0xb0')][_0x85c0('0x56')];_0x310070+=0x1){_0x5ddf41['body'][_0x85c0('0xb0')][_0x310070]={'filename':_0x5ddf41[_0x85c0('0x67')][_0x85c0('0xb0')][_0x310070][_0x85c0('0x2c')],'path':path[_0x85c0('0xb1')](config[_0x85c0('0xb2')],'server/files/attachments',_0x5ddf41['body'][_0x85c0('0xb0')][_0x310070][_0x85c0('0xb3')])};}}var _0x2c78a5=_0x2205bc['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x85c0('0xb4'),{'account':_0x2c78a5,'message':_0x5ddf41[_0x85c0('0x67')]});})[_0x85c0('0x14')](function(_0x1bf996){if(!_0x1bf996)return;_0x11347d=_0x1bf996;if(!_0x1cc575[_0x85c0('0xa8')])throw new Error(_0x85c0('0xb5'));if(_0x1cc575['List'][_0x85c0('0xa9')]['length'])return _0x1cc575[_0x85c0('0xa8')][_0x85c0('0xa9')][0x0];return db[_0x85c0('0x8e')]['create'](_[_0x85c0('0xb')](_0x5ddf41['body'],{'firstName':_0x5ddf41[_0x85c0('0x67')]['to'],'email':_0x5ddf41[_0x85c0('0x67')]['to'],'phone':_0x5ddf41['body']['to'],'ListId':_0x1cc575[_0x85c0('0x7b')]}));})['then'](function(_0x3a9c58){if(!_0x3a9c58)return;var _0x4becff={'UserId':_0x5ddf41[_0x85c0('0x38')]['id'],'ContactId':_0x3a9c58['id'],'MailAccountId':_0x1cc575['id'],'inReplyTo':_0x11347d['messageId'],'to':_0x5ddf41['body'][_0x85c0('0xad')],'cc':_0x5ddf41[_0x85c0('0x67')]['cc'],'subject':_0x5ddf41[_0x85c0('0x67')][_0x85c0('0xb6')],'attach':_0x5ddf41[_0x85c0('0x67')][_0x85c0('0xb7')],'firstMsgDirection':_0x85c0('0xb8'),'lastMsgAt':moment()[_0x85c0('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_['merge'](_0x5ddf41[_0x85c0('0x67')],{'messageId':_0x11347d['messageId'],'sentAt':moment()[_0x85c0('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x1cc575['id'],'UserId':_0x5ddf41[_0x85c0('0x38')]['id'],'ContactId':_0x3a9c58['id']})]};if(_0x5ddf41[_0x85c0('0x67')][_0x85c0('0xb9')]){_0x4becff=_['merge'](_0x4becff,_0x5ddf41['body'][_0x85c0('0xb9')]);}return db[_0x85c0('0x8a')]['create'](_0x4becff,{'include':[{'model':db[_0x85c0('0xa2')],'as':_0x85c0('0xba')}]});})[_0x85c0('0x14')](respondWithResult(_0x47a0c1,null))[_0x85c0('0x66')](handleError(_0x47a0c1,null));};exports['verifySmtp']=function(_0x59f7b1,_0x2727bd){return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x59f7b1[_0x85c0('0x62')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x85c0('0x44'),'raw':!![],'include':[{'model':db[_0x85c0('0xab')],'as':_0x85c0('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2727bd,null))[_0x85c0('0x14')](function(_0x27b13a){if(!_0x27b13a[_0x85c0('0x44')])return;var _0x237134=_0x27b13a[_0x85c0('0xbb')]();return respondWithRpcPromise(_0x85c0('0xbc'),'verifySmtp',{'account':_0x237134});})[_0x85c0('0x14')](respondWithResult(_0x2727bd,null))['catch'](handleError(_0x2727bd,null));};exports['destroy']=function(_0x53e375,_0x3dcdb6){return db['MailAccount'][_0x85c0('0x65')]({'where':{'id':_0x53e375['params']['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x3dcdb6,null))['then'](function(_0x30afe8){if(_0x30afe8&&_0x30afe8[_0x85c0('0x41')]){throw new db[(_0x85c0('0xbd'))][(_0x85c0('0xbe'))](_0x85c0('0xbf'));}return _0x30afe8;})[_0x85c0('0x14')](removeEntity(_0x3dcdb6,null))[_0x85c0('0x66')](handleError(_0x3dcdb6,null));};exports['addAgents']=function(_0x46b68e,_0x40d346){return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x46b68e[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x40d346,null))[_0x85c0('0x14')](function(_0x2eb551){if(_0x2eb551){return _0x2eb551[_0x85c0('0xc0')](_0x46b68e[_0x85c0('0x67')][_0x85c0('0x76')],_['omit'](_0x46b68e[_0x85c0('0x67')],[_0x85c0('0x76'),'id'])||{})['spread'](function(_0x162626){for(var _0x35f213=0x0;_0x35f213<_0x46b68e[_0x85c0('0x67')]['ids']['length'];_0x35f213+=0x1){socket[_0x85c0('0xc1')](_0x85c0('0xc2'),{'UserId':Number(_0x46b68e[_0x85c0('0x67')][_0x85c0('0x76')][_0x35f213]),'MailAccountId':Number(_0x46b68e[_0x85c0('0x62')]['id'])});}return _0x162626;});}})[_0x85c0('0x14')](respondWithResult(_0x40d346,null))[_0x85c0('0x66')](handleError(_0x40d346,null));};exports[_0x85c0('0xc3')]=function(_0x1a277e,_0x5f413a){return db[_0x85c0('0x4a')][_0x85c0('0x65')]({'where':{'id':_0x1a277e[_0x85c0('0x62')]['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x5f413a,null))[_0x85c0('0x14')](function(_0x53c0c2){if(_0x53c0c2){return _0x53c0c2[_0x85c0('0xc3')](_0x1a277e['query'][_0x85c0('0x76')])[_0x85c0('0x14')](function(){if(_[_0x85c0('0xc4')](_0x1a277e[_0x85c0('0x4f')]['ids'])){for(var _0x5c1c38=0x0;_0x5c1c38<_0x1a277e[_0x85c0('0x4f')][_0x85c0('0x76')][_0x85c0('0x56')];_0x5c1c38+=0x1){socket[_0x85c0('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x1a277e['query'][_0x85c0('0x76')][_0x5c1c38]),'MailAccountId':Number(_0x1a277e[_0x85c0('0x62')]['id'])});}}else{socket[_0x85c0('0xc1')](_0x85c0('0xc5'),{'UserId':Number(_0x1a277e[_0x85c0('0x4f')][_0x85c0('0x76')]),'MailAccountId':Number(_0x1a277e[_0x85c0('0x62')]['id'])});}});}})[_0x85c0('0x14')](respondWithStatusCode(_0x5f413a,null))[_0x85c0('0x66')](handleError(_0x5f413a,null));};exports[_0x85c0('0xc6')]=function(_0x554509,_0x2b8211){var _0x37b6e2={};var _0x1ab056={};var _0x363b58;var _0x1d9d0d;return db[_0x85c0('0x4a')]['findOne']({'where':{'id':_0x554509['params']['id']}})[_0x85c0('0x14')](handleEntityNotFound(_0x2b8211,null))[_0x85c0('0x14')](function(_0x3cd750){if(_0x3cd750){_0x363b58=_0x3cd750;_0x1ab056['model']=_[_0x85c0('0x50')](db[_0x85c0('0x90')][_0x85c0('0x4b')]);_0x1ab056[_0x85c0('0x4f')]=_[_0x85c0('0x50')](_0x554509[_0x85c0('0x4f')]);_0x1ab056[_0x85c0('0x51')]=_[_0x85c0('0x52')](_0x1ab056[_0x85c0('0x53')],_0x1ab056['query']);_0x37b6e2[_0x85c0('0x54')]=_[_0x85c0('0x52')](_0x1ab056[_0x85c0('0x53')],qs['fields'](_0x554509[_0x85c0('0x4f')][_0x85c0('0x55')]));_0x37b6e2[_0x85c0('0x54')]=_0x37b6e2[_0x85c0('0x54')][_0x85c0('0x56')]?_0x37b6e2[_0x85c0('0x54')]:_0x1ab056[_0x85c0('0x53')];_0x37b6e2[_0x85c0('0x72')]=qs[_0x85c0('0x59')](_0x554509[_0x85c0('0x4f')][_0x85c0('0x59')]);_0x37b6e2[_0x85c0('0x5b')]=qs['filters'](_[_0x85c0('0x73')](_0x554509[_0x85c0('0x4f')],_0x1ab056['filters']));if(_0x554509[_0x85c0('0x4f')]['filter']){_0x37b6e2[_0x85c0('0x5b')]=_[_0x85c0('0x5c')](_0x37b6e2[_0x85c0('0x5b')],{'$or':_[_0x85c0('0x49')](_0x37b6e2['attributes'],function(_0x31eb0e){var _0x51b294={};_0x51b294[_0x31eb0e]={'$like':'%'+_0x554509[_0x85c0('0x4f')]['filter']+'%'};return _0x51b294;})});}_0x37b6e2=_[_0x85c0('0x5c')]({},_0x37b6e2,_0x554509[_0x85c0('0x5e')]);return _0x363b58['getAgents'](_0x37b6e2);}})['then'](function(_0x2b303e){if(_0x2b303e){_0x1d9d0d=_0x2b303e[_0x85c0('0x56')];if(!_0x554509[_0x85c0('0x4f')][_0x85c0('0x57')](_0x85c0('0x58'))){_0x37b6e2[_0x85c0('0x23')]=qs[_0x85c0('0x23')](_0x554509[_0x85c0('0x4f')][_0x85c0('0x23')]);_0x37b6e2['offset']=qs['offset'](_0x554509[_0x85c0('0x4f')]['offset']);}return _0x363b58[_0x85c0('0xc6')](_0x37b6e2);}})['then'](function(_0x4349d1){if(_0x4349d1){return _0x4349d1?{'count':_0x1d9d0d,'rows':_0x4349d1}:null;}})[_0x85c0('0x14')](respondWithResult(_0x2b8211,null))[_0x85c0('0x66')](handleError(_0x2b8211,null));}; \ No newline at end of file +var _0xa269=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','params','Pause','find','body','provider','secure','describe','addDisposition','create','findOne','Disposition','MailAccountId','includeAll','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','custom','isNil','active','description','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','stack','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','List','defaults','ListId','from','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','./mailAccount.socket','register','jayson/promise','client','request','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','then','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','user','username','password','modernAuthentication','CloudProviderId','port','host','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes'];(function(_0x41609c,_0x599d97){var _0x445945=function(_0x159f51){while(--_0x159f51){_0x41609c['push'](_0x41609c['shift']());}};_0x445945(++_0x599d97);}(_0xa269,0x73));var _0x9a26=function(_0x11d975,_0x3f0dc1){_0x11d975=_0x11d975-0x0;var _0x2d63bb=_0xa269[_0x11d975];return _0x2d63bb;};'use strict';var moment=require(_0x9a26('0x0'));var BPromise=require(_0x9a26('0x1'));var util=require(_0x9a26('0x2'));var path=require(_0x9a26('0x3'));var _=require(_0x9a26('0x4'));var juice=require(_0x9a26('0x5'));var Redis=require(_0x9a26('0x6'));var qs=require(_0x9a26('0x7'));var logger=require(_0x9a26('0x8'))('api');var config=require('../../config/environment');var db=require(_0x9a26('0x9'))['db'];config[_0x9a26('0xa')]=_['defaults'](config['redis'],{'host':_0x9a26('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a26('0xa')]));require(_0x9a26('0xc'))[_0x9a26('0xd')](socket);var jayson=require(_0x9a26('0xe'));var client=jayson[_0x9a26('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3019d2,_0x497734,_0x164ab9,_0x5d05b3){return new BPromise(function(_0x33782d,_0xe17a84){var _0x407773=_0x5d05b3||client;return _0x407773[_0x9a26('0x10')](_0x3019d2,_0x164ab9)['then'](function(_0x9cd59f){logger['info'](_0x9a26('0x11'),_0x497734,_0x9a26('0x12'));logger['debug'](_0x9a26('0x13'),_0x497734,'request\x20sent',JSON[_0x9a26('0x14')](_0x9cd59f));if(_0x9cd59f[_0x9a26('0x15')]){if(_0x9cd59f[_0x9a26('0x15')][_0x9a26('0x16')]===0x1f4){logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x9cd59f[_0x9a26('0x15')]['message']);return _0xe17a84(_0x9cd59f[_0x9a26('0x15')]['message']);}logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x9cd59f[_0x9a26('0x15')]['message']);return _0x33782d(_0x9cd59f['error'][_0x9a26('0x17')]);}else{logger['info'](_0x9a26('0x11'),_0x497734,_0x9a26('0x12'));_0x33782d(_0x9cd59f[_0x9a26('0x18')][_0x9a26('0x17')]);}})['catch'](function(_0x63f973){logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x63f973);_0xe17a84(_0x63f973);});});}function respondWithStatusCode(_0x204fa3,_0x17194e){_0x17194e=_0x17194e||0xcc;return function(_0x4dcb15){if(_0x4dcb15){return _0x204fa3['sendStatus'](_0x17194e);}return _0x204fa3[_0x9a26('0x19')](_0x17194e)[_0x9a26('0x1a')]();};}function respondWithResult(_0x224060,_0x5fc130){_0x5fc130=_0x5fc130||0xc8;return function(_0x48a755){if(_0x48a755){return _0x224060[_0x9a26('0x19')](_0x5fc130)[_0x9a26('0x1b')](_0x48a755);}};}function respondWithFilteredResult(_0x18aa24,_0x285d0e){return function(_0x6b771d){if(_0x6b771d){var _0x54ed31=typeof _0x285d0e[_0x9a26('0x1c')]==='undefined'&&typeof _0x285d0e[_0x9a26('0x1d')]===_0x9a26('0x1e');var _0x407880=_0x6b771d[_0x9a26('0x1f')];var _0xf047f3=_0x54ed31?0x0:_0x285d0e[_0x9a26('0x1c')];var _0x3cd6df=_0x54ed31?_0x6b771d[_0x9a26('0x1f')]:_0x285d0e['offset']+_0x285d0e[_0x9a26('0x1d')];var _0x23cf5f;if(_0x3cd6df>=_0x407880){_0x3cd6df=_0x407880;_0x23cf5f=0xc8;}else{_0x23cf5f=0xce;}_0x18aa24['status'](_0x23cf5f);return _0x18aa24[_0x9a26('0x20')](_0x9a26('0x21'),_0xf047f3+'-'+_0x3cd6df+'/'+_0x407880)[_0x9a26('0x1b')](_0x6b771d);}return null;};}function saveUpdates(_0x59115a){return function(_0x50fad3){if(_0x50fad3){return _0x50fad3[_0x9a26('0x22')](_0x59115a)['then'](function(_0x5e3af0){return _0x5e3af0;});}return null;};}function removeEntity(_0x42e89f){return function(_0xb846a1){if(_0xb846a1){return _0xb846a1[_0x9a26('0x23')]()['then'](function(){var _0x4135fa=_0xb846a1[_0x9a26('0x24')]({'plain':!![]});var _0x499c14=_0x9a26('0x25');return db['UserProfileResource'][_0x9a26('0x23')]({'where':{'type':_0x499c14,'resourceId':_0x4135fa['id']}})[_0x9a26('0x26')](function(){return _0xb846a1;});})['then'](function(){_0x42e89f[_0x9a26('0x19')](0xcc)[_0x9a26('0x1a')]();});}};}function handleEntityNotFound(_0x1bbdd5){return function(_0x2e4dcf){if(!_0x2e4dcf){_0x1bbdd5['sendStatus'](0x194);}return _0x2e4dcf;};}function handleError(_0x23dec3,_0x5ac9b7){_0x5ac9b7=_0x5ac9b7||0x1f4;return function(_0x286fed){logger[_0x9a26('0x15')](_0x286fed['stack']);if(_0x286fed['name']){delete _0x286fed['name'];}_0x23dec3[_0x9a26('0x19')](_0x5ac9b7)[_0x9a26('0x27')](_0x286fed);};}function getImapHost(_0x2703a4){switch(_0x2703a4){case _0x9a26('0x28'):return _0x9a26('0x29');case _0x9a26('0x2a'):return'imap.mail.yahoo.com';case _0x9a26('0x2b'):return _0x9a26('0x2c');case _0x9a26('0x2d'):return _0x9a26('0x2e');}throw new Error(_0x9a26('0x2f'),_0x2703a4);}function getSmtpHost(_0x173878){switch(_0x173878){case _0x9a26('0x28'):return _0x9a26('0x30');case'yahoo':return'smtp.mail.yahoo.com';case _0x9a26('0x2b'):return _0x9a26('0x31');case _0x9a26('0x2d'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x173878);}function getAuthenticationOptions(_0x1bfffd,_0x390659){var _0x81748e={};var _0x5c57be={};if(_0x1bfffd){_0x81748e[_0x9a26('0x32')]=_0x5c57be[_0x9a26('0x32')]=_0x390659[_0x9a26('0x33')];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=_0x390659[_0x9a26('0x34')];if(_0x390659['modernAuthentication']){_0x81748e[_0x9a26('0x35')]=_0x5c57be[_0x9a26('0x35')]=!![];_0x81748e[_0x9a26('0x36')]=_0x5c57be[_0x9a26('0x36')]=_0x390659[_0x9a26('0x36')];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=null;}else{_0x81748e[_0x9a26('0x36')]=_0x5c57be[_0x9a26('0x36')]=null;}_0x81748e['host']=getImapHost(_0x1bfffd);_0x81748e[_0x9a26('0x37')]=0x3e1;_0x5c57be[_0x9a26('0x38')]=getSmtpHost(_0x1bfffd);_0x5c57be[_0x9a26('0x37')]=0x24b;_0x5c57be['secure']=![];_0x81748e[_0x9a26('0x39')]=_0x5c57be[_0x9a26('0x39')]=null;}else{if(_0x390659[_0x9a26('0x3a')]){_0x81748e[_0x9a26('0x32')]=_0x5c57be[_0x9a26('0x32')]=_0x390659['username'];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=_0x390659['password'];}else{_0x81748e[_0x9a26('0x3a')]=_0x5c57be[_0x9a26('0x3a')]=![];_0x81748e[_0x9a26('0x32')]=_0x5c57be['user']=null;_0x81748e[_0x9a26('0x34')]=_0x5c57be[_0x9a26('0x3b')]=null;}_0x81748e[_0x9a26('0x38')]=_0x390659[_0x9a26('0x3c')][_0x9a26('0x38')];_0x81748e[_0x9a26('0x37')]=_0x390659['Imap'][_0x9a26('0x37')];_0x5c57be['host']=_0x390659[_0x9a26('0x3d')][_0x9a26('0x38')];_0x5c57be[_0x9a26('0x37')]=_0x390659[_0x9a26('0x3d')]['port'];}return{'Imap':_0x81748e,'Smtp':_0x5c57be};}exports[_0x9a26('0x3e')]=function(_0x36af55,_0x37098e){var _0x57ab07={'include':[{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db['Pause'],'as':_0x9a26('0x41')}]},_0x15e688={},_0x7c3be2={'count':0x0,'rows':[]};var _0x5c4ff6=_[_0x9a26('0x42')](db[_0x9a26('0x43')][_0x9a26('0x44')],function(_0x1dc5d5){return{'name':_0x1dc5d5[_0x9a26('0x45')],'type':_0x1dc5d5['type'][_0x9a26('0x46')]};});_0x15e688[_0x9a26('0x47')]=_[_0x9a26('0x42')](_0x5c4ff6,_0x9a26('0x48'));_0x15e688[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x36af55[_0x9a26('0x49')]);_0x15e688['filters']=_[_0x9a26('0x4b')](_0x15e688[_0x9a26('0x47')],_0x15e688['query']);_0x57ab07[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x15e688[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x57ab07[_0x9a26('0x4c')]=_0x57ab07['attributes'][_0x9a26('0x4e')]?_0x57ab07[_0x9a26('0x4c')]:_0x15e688['model'];if(!_0x36af55[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x57ab07[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x57ab07[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x57ab07[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x52')]);_0x57ab07[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x36af55['query'],_0x15e688[_0x9a26('0x54')]),_0x5c4ff6);if(_0x36af55[_0x9a26('0x49')][_0x9a26('0x56')]){_0x57ab07[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x57ab07[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x5c4ff6,function(_0x2a8549){if(_0x2a8549[_0x9a26('0x58')]!==_0x9a26('0x59')){var _0x5ad033={};_0x5ad033[_0x2a8549[_0x9a26('0x48')]]={'$like':'%'+_0x36af55[_0x9a26('0x49')]['filter']+'%'};return _0x5ad033;}})});}_0x57ab07=_['merge']({},_0x57ab07,_0x36af55[_0x9a26('0x5a')]);var _0x5259e2={'where':_0x57ab07['where']};return db[_0x9a26('0x43')][_0x9a26('0x1f')](_0x5259e2)[_0x9a26('0x26')](function(_0x3e5317){_0x7c3be2[_0x9a26('0x1f')]=_0x3e5317;if(_0x36af55[_0x9a26('0x49')]['includeAll']){_0x57ab07['include']=[{'all':!![]}];}return db[_0x9a26('0x43')]['findAll'](_0x57ab07);})[_0x9a26('0x26')](function(_0x20d6ba){_0x7c3be2[_0x9a26('0x5b')]=_0x20d6ba;return _0x7c3be2;})[_0x9a26('0x26')](respondWithFilteredResult(_0x37098e,_0x57ab07))[_0x9a26('0x5c')](handleError(_0x37098e,null));};exports[_0x9a26('0x5d')]=function(_0x2ad4ba,_0x5299d0){var _0xb3897b={'raw':![],'where':{'id':_0x2ad4ba[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db[_0x9a26('0x5f')],'as':_0x9a26('0x41')}]},_0x281192={};_0x281192['model']=_['keys'](db['MailAccount'][_0x9a26('0x44')]);_0x281192['query']=_[_0x9a26('0x4a')](_0x2ad4ba[_0x9a26('0x49')]);_0x281192[_0x9a26('0x54')]=_['intersection'](_0x281192[_0x9a26('0x47')],_0x281192[_0x9a26('0x49')]);_0xb3897b[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x281192[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x2ad4ba['query'][_0x9a26('0x4d')]));_0xb3897b[_0x9a26('0x4c')]=_0xb3897b[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0xb3897b['attributes']:_0x281192['model'];if(_0x2ad4ba[_0x9a26('0x49')]['includeAll']){_0xb3897b['include']=[{'all':!![]}];}_0xb3897b=_[_0x9a26('0x57')]({},_0xb3897b,_0x2ad4ba[_0x9a26('0x5a')]);return db['MailAccount'][_0x9a26('0x60')](_0xb3897b)[_0x9a26('0x26')](handleEntityNotFound(_0x5299d0,null))[_0x9a26('0x26')](respondWithResult(_0x5299d0,null))['catch'](handleError(_0x5299d0,null));};exports[_0x9a26('0x22')]=function(_0x2a8d67,_0x5a0868){if(_0x2a8d67[_0x9a26('0x61')]['id']){delete _0x2a8d67[_0x9a26('0x61')]['id'];}var _0x2b2dfc=_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x62')]==='custom'?null:_0x2a8d67[_0x9a26('0x61')]['provider'];var _0x3f42d0=_0x2a8d67['body']['Imap']||{};var _0x3ae7e0=_0x2a8d67[_0x9a26('0x61')]['Smtp']||{};if(_0x2b2dfc){_0x3f42d0['host']=getImapHost(_0x2b2dfc);_0x3f42d0['port']=0x3e1;_0x3ae7e0[_0x9a26('0x38')]=getSmtpHost(_0x2b2dfc);_0x3ae7e0[_0x9a26('0x37')]=0x24b;_0x3ae7e0['secure']=![];}if(_0x3ae7e0['modernAuthentication']){_0x3ae7e0[_0x9a26('0x63')]=![];}else{_0x3ae7e0[_0x9a26('0x36')]=null;}if(!_0x3f42d0[_0x9a26('0x35')])_0x3f42d0[_0x9a26('0x36')]=null;_0x2a8d67[_0x9a26('0x61')]['Imap']=_0x3f42d0;_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3d')]=_0x3ae7e0;return db[_0x9a26('0x43')]['find']({'where':{'id':_0x2a8d67[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x3f')],'as':'Imap'},{'model':db[_0x9a26('0x40')],'as':'Smtp'},{'model':db[_0x9a26('0x5f')],'as':_0x9a26('0x41')}]})[_0x9a26('0x26')](handleEntityNotFound(_0x5a0868,null))[_0x9a26('0x26')](function(_0x5ae534){if(!_0x5ae534)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5ae534['service'])delete _0x2a8d67['body'][_0x9a26('0x3c')];return _0x5ae534;})['then'](saveUpdates(_0x2a8d67[_0x9a26('0x61')],null))[_0x9a26('0x26')](function(_0x1361cf){if(!_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3c')])return _0x1361cf;return db['MailServerIn'][_0x9a26('0x22')](_0x2a8d67[_0x9a26('0x61')]['Imap'],{'where':{'MailAccountId':_0x1361cf['id']}})[_0x9a26('0x26')](function(){return _0x1361cf;});})[_0x9a26('0x26')](function(_0x3b7e99){if(!_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3d')])return _0x3b7e99;return db[_0x9a26('0x40')][_0x9a26('0x22')](_0x2a8d67['body'][_0x9a26('0x3d')],{'where':{'MailAccountId':_0x3b7e99['id']}})[_0x9a26('0x26')](function(){return _0x3b7e99;});})['then'](respondWithResult(_0x5a0868,null))['catch'](handleError(_0x5a0868,null));};exports[_0x9a26('0x64')]=function(_0x5eb2ff,_0x538145){return db['MailAccount'][_0x9a26('0x64')]()['then'](respondWithResult(_0x538145,null))['catch'](handleError(_0x538145,null));};exports[_0x9a26('0x65')]=function(_0x465614,_0x670c92){if(_0x465614[_0x9a26('0x61')]['id']){delete _0x465614['body']['id'];}return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x465614['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x670c92,null))[_0x9a26('0x26')](function(_0x2dde90){if(_0x2dde90){_0x465614[_0x9a26('0x61')]['MailAccountId']=_0x2dde90['id'];return db['Disposition'][_0x9a26('0x66')](_0x465614[_0x9a26('0x61')]);}})[_0x9a26('0x26')](respondWithResult(_0x670c92,null))['catch'](handleError(_0x670c92,null));};exports['getDispositions']=function(_0x228a8a,_0x126110){var _0x3f4e1c={'raw':![],'where':{}};var _0x196fa2={};var _0x39c251={'count':0x0,'rows':[]};return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x228a8a[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x126110,null))[_0x9a26('0x26')](function(_0x2234a1){if(_0x2234a1){_0x196fa2['model']=_[_0x9a26('0x4a')](db[_0x9a26('0x68')][_0x9a26('0x44')]);_0x196fa2[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x228a8a[_0x9a26('0x49')]);_0x196fa2['filters']=_[_0x9a26('0x4b')](_0x196fa2[_0x9a26('0x47')],_0x196fa2[_0x9a26('0x49')]);_0x3f4e1c[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x196fa2[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x3f4e1c[_0x9a26('0x4c')]=_0x3f4e1c[_0x9a26('0x4c')]['length']?_0x3f4e1c['attributes']:_0x196fa2[_0x9a26('0x47')];if(!_0x228a8a[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x3f4e1c[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x228a8a['query']['limit']);_0x3f4e1c[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x3f4e1c[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x52')]);_0x3f4e1c[_0x9a26('0x53')]=qs['filters'](_[_0x9a26('0x55')](_0x228a8a[_0x9a26('0x49')],_0x196fa2[_0x9a26('0x54')]));_0x3f4e1c[_0x9a26('0x53')][_0x9a26('0x69')]=_0x2234a1['id'];if(_0x228a8a[_0x9a26('0x49')][_0x9a26('0x56')]){_0x3f4e1c[_0x9a26('0x53')]=_['merge'](_0x3f4e1c[_0x9a26('0x53')],{'$or':_['map'](_0x3f4e1c[_0x9a26('0x4c')],function(_0x13654a){var _0x25685b={};_0x25685b[_0x13654a]={'$like':'%'+_0x228a8a[_0x9a26('0x49')]['filter']+'%'};return _0x25685b;})});}_0x3f4e1c=_[_0x9a26('0x57')]({},_0x3f4e1c,_0x228a8a[_0x9a26('0x5a')]);return db[_0x9a26('0x68')][_0x9a26('0x1f')]({'where':_0x3f4e1c[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x2af862){_0x39c251[_0x9a26('0x1f')]=_0x2af862;if(_0x228a8a[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x3f4e1c[_0x9a26('0x6b')]=[{'all':!![]}];}return db[_0x9a26('0x68')][_0x9a26('0x6c')](_0x3f4e1c);})['then'](function(_0x854809){_0x39c251[_0x9a26('0x5b')]=_0x854809;return _0x39c251;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x126110,_0x3f4e1c))[_0x9a26('0x5c')](handleError(_0x126110,null));};exports['removeDispositions']=function(_0x50a95a,_0x18f6b4){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x50a95a['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x18f6b4,null))[_0x9a26('0x26')](function(_0x32f0d1){if(_0x32f0d1){return _0x32f0d1[_0x9a26('0x6d')](_0x50a95a['query'][_0x9a26('0x6e')]);}})[_0x9a26('0x26')](respondWithStatusCode(_0x18f6b4,null))['catch'](handleError(_0x18f6b4,null));};exports[_0x9a26('0x6f')]=function(_0x2278a2,_0x264b97){if(_0x2278a2[_0x9a26('0x61')]['id']){delete _0x2278a2['body']['id'];}return db[_0x9a26('0x43')]['find']({'where':{'id':_0x2278a2[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x264b97,null))['then'](function(_0x4a4467){if(_0x4a4467){_0x2278a2[_0x9a26('0x61')]['MailAccountId']=_0x4a4467['id'];return db[_0x9a26('0x70')][_0x9a26('0x66')](_0x2278a2['body']);}})[_0x9a26('0x26')](respondWithResult(_0x264b97,null))[_0x9a26('0x5c')](handleError(_0x264b97,null));};exports['getAnswers']=function(_0xc49144,_0x56b9a0){var _0x2b7651={'raw':![],'where':{}};var _0x1367e9={};var _0x362891={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0xc49144[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x56b9a0,null))[_0x9a26('0x26')](function(_0xb336ad){if(_0xb336ad){_0x1367e9[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x70')][_0x9a26('0x44')]);_0x1367e9[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0xc49144[_0x9a26('0x49')]);_0x1367e9[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x1367e9[_0x9a26('0x47')],_0x1367e9[_0x9a26('0x49')]);_0x2b7651['attributes']=_[_0x9a26('0x4b')](_0x1367e9['model'],qs['fields'](_0xc49144[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x2b7651['attributes']=_0x2b7651[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x2b7651[_0x9a26('0x4c')]:_0x1367e9['model'];if(!_0xc49144[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x2b7651[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0xc49144[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x2b7651['offset']=qs[_0x9a26('0x1c')](_0xc49144[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x2b7651[_0x9a26('0x51')]=qs['sort'](_0xc49144['query'][_0x9a26('0x52')]);_0x2b7651[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0xc49144['query'],_0x1367e9[_0x9a26('0x54')]));_0x2b7651[_0x9a26('0x53')][_0x9a26('0x69')]=_0xb336ad['id'];if(_0xc49144[_0x9a26('0x49')][_0x9a26('0x56')]){_0x2b7651[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x2b7651['where'],{'$or':_[_0x9a26('0x42')](_0x2b7651[_0x9a26('0x4c')],function(_0x33283c){var _0x1c61e4={};_0x1c61e4[_0x33283c]={'$like':'%'+_0xc49144[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x1c61e4;})});}_0x2b7651=_[_0x9a26('0x57')]({},_0x2b7651,_0xc49144[_0x9a26('0x5a')]);return db['CannedAnswer'][_0x9a26('0x1f')]({'where':_0x2b7651[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x16c3eb){_0x362891[_0x9a26('0x1f')]=_0x16c3eb;if(_0xc49144['query'][_0x9a26('0x6a')]){_0x2b7651[_0x9a26('0x6b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9a26('0x6c')](_0x2b7651);})[_0x9a26('0x26')](function(_0x3e5de0){_0x362891['rows']=_0x3e5de0;return _0x362891;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x56b9a0,_0x2b7651))[_0x9a26('0x5c')](handleError(_0x56b9a0,null));};exports[_0x9a26('0x71')]=function(_0x3946d6,_0x433019){return db['MailAccount']['find']({'where':{'id':_0x3946d6[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x433019,null))['then'](function(_0x1f705a){if(_0x1f705a){return _0x1f705a[_0x9a26('0x71')](_0x3946d6[_0x9a26('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x433019,null))[_0x9a26('0x5c')](handleError(_0x433019,null));};exports[_0x9a26('0x66')]=function(_0x56441b,_0x407d53){var _0x3c5d12={'name':_0x56441b[_0x9a26('0x61')][_0x9a26('0x48')],'key':_0x56441b[_0x9a26('0x61')][_0x9a26('0x46')],'provider':_0x56441b[_0x9a26('0x61')][_0x9a26('0x62')]===_0x9a26('0x72')?null:_0x56441b[_0x9a26('0x61')][_0x9a26('0x62')],'email':_0x56441b['body']['email'],'ListId':_0x56441b['body']['ListId'],'active':!_[_0x9a26('0x73')](_0x56441b['body']['active'])?_0x56441b[_0x9a26('0x61')][_0x9a26('0x74')]:!![],'description':_0x56441b['body'][_0x9a26('0x75')]||null};var _0x4a6164=getAuthenticationOptions(_0x3c5d12[_0x9a26('0x62')],_0x56441b[_0x9a26('0x61')]);_0x3c5d12[_0x9a26('0x3c')]=_0x4a6164[_0x9a26('0x3c')];_0x3c5d12['Smtp']=_0x4a6164[_0x9a26('0x3d')];return db[_0x9a26('0x43')][_0x9a26('0x66')](_0x3c5d12,{'include':[{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')}]})['then'](function(_0xae9964){var _0x3d64df=_0x56441b[_0x9a26('0x32')]['get']({'plain':!![]});if(!_0x3d64df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d64df['role']===_0x9a26('0x32')){var _0x3298cc=_0xae9964[_0x9a26('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x9a26('0x60')]({'where':{'name':_0x9a26('0x25'),'userProfileId':_0x3d64df['userProfileId']},'raw':!![]})['then'](function(_0x515cfa){if(_0x515cfa&&_0x515cfa[_0x9a26('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x3298cc[_0x9a26('0x48')],'resourceId':_0x3298cc['id'],'type':_0x515cfa['name'],'sectionId':_0x515cfa['id']},{})[_0x9a26('0x26')](function(){return _0xae9964;});}else{return _0xae9964;}})[_0x9a26('0x5c')](function(_0x3a9788){logger[_0x9a26('0x15')](_0x9a26('0x77'),_0x3a9788);throw _0x3a9788;});}return _0xae9964;})[_0x9a26('0x26')](respondWithResult(_0x407d53,0xc9))['catch'](handleError(_0x407d53,null));};exports[_0x9a26('0x78')]=function(_0x1ae0cd,_0x1eb8a1){return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x1ae0cd[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x1eb8a1,null))[_0x9a26('0x26')](function(_0x560e8f){if(_0x560e8f){return _0x560e8f[_0x9a26('0x78')]();}return null;})['then'](respondWithResult(_0x1eb8a1,null))[_0x9a26('0x5c')](handleError(_0x1eb8a1,null));};exports[_0x9a26('0x79')]=function(_0x52de18,_0x902f17){if(_0x52de18['body']['id']){delete _0x52de18[_0x9a26('0x61')]['id'];}return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x52de18[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x902f17,null))[_0x9a26('0x26')](function(_0x190337){if(_0x190337){_0x52de18[_0x9a26('0x61')]['MailAccountId']=_0x190337['id'];return db[_0x9a26('0x3f')][_0x9a26('0x66')](_0x52de18['body']);}})['then'](respondWithResult(_0x902f17,null))[_0x9a26('0x5c')](handleError(_0x902f17,null));};exports[_0x9a26('0x7a')]=function(_0x18de52,_0x178e52){return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x18de52[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x178e52,null))['then'](function(_0x841857){if(_0x841857){return _0x841857[_0x9a26('0x7b')](null);}return null;})[_0x9a26('0x26')](respondWithStatusCode(_0x178e52,null))['catch'](handleError(_0x178e52,null));};exports[_0x9a26('0x7c')]=function(_0x2f6ace,_0x37cc8e){return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x2f6ace['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x37cc8e,null))[_0x9a26('0x26')](function(_0x14858e){if(_0x14858e){return _0x14858e[_0x9a26('0x7c')]();}return null;})[_0x9a26('0x26')](respondWithResult(_0x37cc8e,null))[_0x9a26('0x5c')](handleError(_0x37cc8e,null));};exports['addSmtp']=function(_0x56ce56,_0x23c85e){if(_0x56ce56[_0x9a26('0x61')]['id']){delete _0x56ce56[_0x9a26('0x61')]['id'];}return db['MailAccount'][_0x9a26('0x60')]({'where':{'id':_0x56ce56['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x23c85e,null))[_0x9a26('0x26')](function(_0x3aa789){if(_0x3aa789){_0x56ce56[_0x9a26('0x61')][_0x9a26('0x69')]=_0x3aa789['id'];return db['MailServerOut']['create'](_0x56ce56[_0x9a26('0x61')]);}})['then'](respondWithResult(_0x23c85e,null))[_0x9a26('0x5c')](handleError(_0x23c85e,null));};exports[_0x9a26('0x7d')]=function(_0x19ad7d,_0x94540){return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x19ad7d[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x94540,null))[_0x9a26('0x26')](function(_0x367733){if(_0x367733){return _0x367733['setSmtp'](null);}return null;})[_0x9a26('0x26')](respondWithStatusCode(_0x94540,null))[_0x9a26('0x5c')](handleError(_0x94540,null));};exports[_0x9a26('0x7e')]=function(_0x4b748b,_0x566631){return db[_0x9a26('0x7f')][_0x9a26('0x60')]({'where':{'id':_0x4b748b[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x566631,null))[_0x9a26('0x26')](function(_0x1866a7){if(_0x1866a7){return _0x1866a7['addInteraction'](_0x4b748b['body']['ids'],_['omit'](_0x4b748b[_0x9a26('0x61')],[_0x9a26('0x6e'),'id'])||{});}})[_0x9a26('0x26')](respondWithResult(_0x566631,null))['catch'](handleError(_0x566631,null));};exports[_0x9a26('0x80')]=function(_0x63e08d,_0x40f72b){var _0x4fd1fb={'raw':![],'where':{}};var _0x2ee842={};var _0x231db6={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x63e08d[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x40f72b,null))[_0x9a26('0x26')](function(_0x364b3f){if(_0x364b3f){_0x2ee842[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x7f')][_0x9a26('0x44')]);_0x2ee842[_0x9a26('0x49')]=_['keys'](_0x63e08d[_0x9a26('0x49')]);_0x2ee842[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x2ee842['model'],_0x2ee842[_0x9a26('0x49')]);_0x4fd1fb[_0x9a26('0x4c')]=_['intersection'](_0x2ee842['model'],qs[_0x9a26('0x4d')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x4fd1fb[_0x9a26('0x4c')]=_0x4fd1fb[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x4fd1fb[_0x9a26('0x4c')]:_0x2ee842[_0x9a26('0x47')];if(!_0x63e08d[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x4fd1fb['limit']=qs[_0x9a26('0x1d')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x4fd1fb[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x4fd1fb['order']=qs[_0x9a26('0x52')](_0x63e08d['query'][_0x9a26('0x52')]);_0x4fd1fb[_0x9a26('0x53')]=qs['filters'](_['pick'](_0x63e08d[_0x9a26('0x49')],_0x2ee842['filters']));_0x4fd1fb[_0x9a26('0x53')][_0x9a26('0x69')]=_0x364b3f['id'];if(_0x63e08d[_0x9a26('0x49')]['filter']){_0x4fd1fb['where']=_[_0x9a26('0x57')](_0x4fd1fb['where'],{'$or':_[_0x9a26('0x42')](_0x4fd1fb['attributes'],function(_0x2b3599){var _0x4c62ad={};_0x4c62ad[_0x2b3599]={'$like':'%'+_0x63e08d['query'][_0x9a26('0x56')]+'%'};return _0x4c62ad;})});}_0x4fd1fb=_[_0x9a26('0x57')]({},_0x4fd1fb,_0x63e08d[_0x9a26('0x5a')]);return db[_0x9a26('0x7f')][_0x9a26('0x1f')]({'where':_0x4fd1fb[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x579032){_0x231db6[_0x9a26('0x1f')]=_0x579032;if(_0x63e08d[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x4fd1fb['include']=[{'model':db[_0x9a26('0x81')],'as':_0x9a26('0x82'),'required':![]},{'model':db['User'],'as':_0x9a26('0x83'),'attributes':['name',_0x9a26('0x84'),_0x9a26('0x85')],'required':![]},{'model':db[_0x9a26('0x86')],'as':_0x9a26('0x87'),'attributes':['id',_0x9a26('0x48'),_0x9a26('0x88')],'where':_0x63e08d['query']['tag']?{'id':_0x63e08d['query'][_0x9a26('0x89')]}:undefined,'required':_0x63e08d[_0x9a26('0x49')][_0x9a26('0x89')]?!![]:![]}];}return db[_0x9a26('0x7f')]['findAll'](_0x4fd1fb);})[_0x9a26('0x26')](function(_0x59d694){_0x231db6[_0x9a26('0x5b')]=_0x59d694;return _0x231db6;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x40f72b,_0x4fd1fb))[_0x9a26('0x5c')](handleError(_0x40f72b,null));};exports[_0x9a26('0x8a')]=function addApplications(_0x496d40,_0x1b81e6){var _0x2dd5b8=_0x496d40[_0x9a26('0x5e')]['id'];var _0x54e1dd=_0x496d40[_0x9a26('0x61')];var _0x3cf1f3=0xc8;var _0x4f8142=null;return db[_0x9a26('0x8b')][_0x9a26('0x8c')]({'isolationLevel':db[_0x9a26('0x8b')][_0x9a26('0x8d')][_0x9a26('0x8e')]['READ_COMMITTED']},function(_0x308cd5){return db['MailAccount']['findOne']({'where':{'id':_0x2dd5b8},'transaction':_0x308cd5})[_0x9a26('0x26')](function(_0x4895cd){if(_0x4895cd){return db['MailApplication'][_0x9a26('0x23')]({'where':{'MailAccountId':_0x2dd5b8},'transaction':_0x308cd5})[_0x9a26('0x26')](function(){var _0x463adb=_[_0x9a26('0x42')](_0x54e1dd,function(_0x26e157){_0x26e157['MailAccountId']=_0x2dd5b8;return _0x26e157;});return db[_0x9a26('0x8f')][_0x9a26('0x90')](_0x463adb,{'transaction':_0x308cd5});});}else{_0x3cf1f3=0x194;_0x4f8142=[];}});})[_0x9a26('0x26')](function(){if(_0x3cf1f3!==0x194){return db[_0x9a26('0x8f')]['findAndCountAll']({'where':{'MailAccountId':_0x2dd5b8},'order':'priority'})[_0x9a26('0x26')](function(_0x5d5bbe){_0x4f8142=_0x5d5bbe;});}})[_0x9a26('0x5c')](function(_0x4e1965){_0x3cf1f3=0x1f4;logger[_0x9a26('0x15')](_0x4e1965[_0x9a26('0x91')]);if(_0x4e1965[_0x9a26('0x48')]){delete _0x4e1965[_0x9a26('0x48')];}_0x4f8142=_0x4e1965;})[_0x9a26('0x92')](function(){if(_0x4f8142===null){_0x1b81e6['sendStatus'](_0x3cf1f3);}else{if(_0x3cf1f3===0x1f4){_0x1b81e6[_0x9a26('0x19')](_0x3cf1f3)[_0x9a26('0x27')](_0x4f8142);}else{_0x1b81e6['status'](_0x3cf1f3)[_0x9a26('0x1b')](_0x4f8142);}}});};exports[_0x9a26('0x93')]=function(_0x2fef99,_0x4717df){var _0x32bd80={};var _0x20ccad={};var _0x282869;var _0x58594b;return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x2fef99[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x4717df,null))[_0x9a26('0x26')](function(_0x5a7d42){if(_0x5a7d42){_0x282869=_0x5a7d42;_0x20ccad[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x8f')][_0x9a26('0x44')]);_0x20ccad[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x2fef99['query']);_0x20ccad[_0x9a26('0x54')]=_['intersection'](_0x20ccad[_0x9a26('0x47')],_0x20ccad['query']);_0x32bd80[_0x9a26('0x4c')]=_['intersection'](_0x20ccad[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x2fef99['query'][_0x9a26('0x4d')]));_0x32bd80[_0x9a26('0x4c')]=_0x32bd80[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x32bd80[_0x9a26('0x4c')]:_0x20ccad[_0x9a26('0x47')];_0x32bd80['order']=qs[_0x9a26('0x52')](_0x2fef99['query'][_0x9a26('0x52')]);_0x32bd80['where']=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x2fef99[_0x9a26('0x49')],_0x20ccad[_0x9a26('0x54')]));if(_0x2fef99[_0x9a26('0x49')]['filter']){_0x32bd80[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x32bd80[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x32bd80[_0x9a26('0x4c')],function(_0x31b0c4){var _0x1bc9cf={};_0x1bc9cf[_0x31b0c4]={'$like':'%'+_0x2fef99[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x1bc9cf;})});}_0x32bd80=_['merge']({},_0x32bd80,_0x2fef99[_0x9a26('0x5a')]);return _0x282869['getApplications'](_0x32bd80);}})['then'](function(_0x700774){if(_0x700774){_0x58594b=_0x700774[_0x9a26('0x4e')];if(!_0x2fef99[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x32bd80[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x2fef99[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x32bd80[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x2fef99[_0x9a26('0x49')]['offset']);}return _0x282869[_0x9a26('0x93')](_0x32bd80);}})[_0x9a26('0x26')](function(_0x1b3b6e){if(_0x1b3b6e){return _0x1b3b6e?{'count':_0x58594b,'rows':_0x1b3b6e}:null;}})[_0x9a26('0x26')](respondWithResult(_0x4717df,null))[_0x9a26('0x5c')](handleError(_0x4717df,null));};exports[_0x9a26('0x94')]=function(_0x586a0e,_0x2738f4){var _0x110dc2={'raw':!![],'where':{}};var _0x3c46c3={};var _0x1b258d={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x586a0e[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x2738f4,null))[_0x9a26('0x26')](function(_0x2b687d){if(_0x2b687d){_0x3c46c3[_0x9a26('0x47')]=_[_0x9a26('0x4a')](db['MailMessage'][_0x9a26('0x44')]);_0x3c46c3[_0x9a26('0x49')]=_['keys'](_0x586a0e[_0x9a26('0x49')]);_0x3c46c3[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x3c46c3[_0x9a26('0x47')],_0x3c46c3['query']);_0x110dc2[_0x9a26('0x4c')]=_['intersection'](_0x3c46c3['model'],qs[_0x9a26('0x4d')](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x110dc2[_0x9a26('0x4c')]=_0x110dc2['attributes'][_0x9a26('0x4e')]?_0x110dc2[_0x9a26('0x4c')]:_0x3c46c3['model'];if(!_0x586a0e[_0x9a26('0x49')]['hasOwnProperty'](_0x9a26('0x50'))){_0x110dc2[_0x9a26('0x1d')]=qs['limit'](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x110dc2[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x110dc2['order']=qs['sort'](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x52')]);_0x110dc2[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x586a0e['query'],_0x3c46c3[_0x9a26('0x54')]));_0x110dc2[_0x9a26('0x53')][_0x9a26('0x69')]=_0x2b687d['id'];if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x56')]){_0x110dc2[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x110dc2['where'],{'$or':_[_0x9a26('0x42')](_0x110dc2[_0x9a26('0x4c')],function(_0x3f2a19){var _0xf343d2={};_0xf343d2[_0x3f2a19]={'$like':'%'+_0x586a0e[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0xf343d2;})});}if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x95')]){var _0x2ead32=_0x586a0e[_0x9a26('0x49')][_0x9a26('0x95')][_0x9a26('0x96')](',');var _0x4514b7={};_0x4514b7[_0x2ead32[0x0]]={'$gte':moment(_0x2ead32[0x1])['format'](_0x9a26('0x97'))};_0x110dc2['where']=_[_0x9a26('0x57')](_0x110dc2['where'],_0x4514b7);}_0x110dc2=_[_0x9a26('0x57')]({},_0x110dc2,_0x586a0e['options']);return db[_0x9a26('0x98')][_0x9a26('0x1f')]({'where':_0x110dc2[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x1a85ee){_0x1b258d[_0x9a26('0x1f')]=_0x1a85ee;if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x110dc2['include']=[{'all':!![]}];}return db['MailMessage'][_0x9a26('0x6c')](_0x110dc2);})[_0x9a26('0x26')](function(_0x1d213f){if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x99')]===_0x9a26('0x9a')){for(var _0x2f0e7c=0x0;_0x2f0e7c<_0x1d213f[_0x9a26('0x4e')];_0x2f0e7c++){_0x1d213f[_0x2f0e7c]['body']=juice(_0x1d213f[_0x2f0e7c][_0x9a26('0x61')]);}}_0x1b258d[_0x9a26('0x5b')]=_0x1d213f;return _0x1b258d;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x2738f4,_0x110dc2))[_0x9a26('0x5c')](handleError(_0x2738f4,null));};exports['send']=function(_0x13360a,_0x26dad3){var _0x422b67,_0x140903={},_0x3120c2;if(_0x13360a[_0x9a26('0x61')]['to']){_0x3120c2=_0x13360a['body']['to'][_0x9a26('0x96')](',')[0x0];}return db[_0x9a26('0x43')]['find']({'where':{'id':_0x13360a[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9a26('0x9c'),'where':{'email':_0x3120c2},'limit':0x1,'order':[[_0x9a26('0x9d'),_0x9a26('0x9e')]]}]},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d'),'raw':!![],'include':[{'model':db[_0x9a26('0x9f')],'as':_0x9a26('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x26dad3,null))['then'](function(_0xc4f041){if(!_0xc4f041)return;_0x422b67=_0xc4f041;if(!_0xc4f041[_0x9a26('0x3d')])throw new Error(_0x9a26('0xa0'));if(_[_0x9a26('0x73')](_0x13360a['body']['from'])){_0x13360a[_0x9a26('0x61')]['from']=util[_0x9a26('0xa1')](_0x9a26('0xa2'),_0xc4f041['name'],_0xc4f041['email']||_0xc4f041['Smtp'][_0x9a26('0x32')]);}if(_0x13360a['body'][_0x9a26('0xa3')]&&_0x13360a[_0x9a26('0x61')]['attachments']['length']){for(var _0x5c22c4=0x0;_0x5c22c4<_0x13360a['body'][_0x9a26('0xa3')][_0x9a26('0x4e')];_0x5c22c4+=0x1){_0x13360a['body'][_0x9a26('0xa3')][_0x5c22c4]={'filename':_0x13360a[_0x9a26('0x61')][_0x9a26('0xa3')][_0x5c22c4]['name'],'path':path[_0x9a26('0xa4')](config[_0x9a26('0xa5')],_0x9a26('0xa6'),_0x13360a[_0x9a26('0x61')][_0x9a26('0xa3')][_0x5c22c4][_0x9a26('0xa7')])};}}var _0x3b2b1b=_0xc4f041[_0x9a26('0xa8')]();return respondWithRpcPromise(_0x9a26('0xa9'),_0x9a26('0xaa'),{'account':_0x3b2b1b,'message':_0x13360a[_0x9a26('0x61')]});})['then'](function(_0xf7b570){if(!_0xf7b570)return;_0x140903=_0xf7b570;if(!_0x422b67['List'])throw new Error(_0x9a26('0xab'));if(_0x422b67[_0x9a26('0xac')][_0x9a26('0x9c')]['length'])return _0x422b67[_0x9a26('0xac')]['Contacts'][0x0];return db[_0x9a26('0x81')]['create'](_[_0x9a26('0xad')](_0x13360a[_0x9a26('0x61')],{'firstName':_0x13360a[_0x9a26('0x61')]['to'],'email':_0x13360a['body']['to'],'phone':_0x13360a[_0x9a26('0x61')]['to'],'ListId':_0x422b67[_0x9a26('0xae')]}));})[_0x9a26('0x26')](function(_0x3c4ffa){if(!_0x3c4ffa)return;var _0x4de762={'UserId':_0x13360a['user']['id'],'ContactId':_0x3c4ffa['id'],'MailAccountId':_0x422b67['id'],'inReplyTo':_0x140903['messageId'],'to':_0x13360a[_0x9a26('0x61')][_0x9a26('0xaf')],'cc':_0x13360a[_0x9a26('0x61')]['cc'],'subject':_0x13360a[_0x9a26('0x61')][_0x9a26('0xb0')],'attach':_0x13360a[_0x9a26('0x61')]['attach'],'firstMsgDirection':_0x9a26('0xb1'),'lastMsgAt':moment()[_0x9a26('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9a26('0xb1'),'Messages':[_[_0x9a26('0x57')](_0x13360a[_0x9a26('0x61')],{'messageId':_0x140903['messageId'],'sentAt':moment()[_0x9a26('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x422b67['id'],'UserId':_0x13360a[_0x9a26('0x32')]['id'],'ContactId':_0x3c4ffa['id']})]};if(_0x13360a[_0x9a26('0x61')][_0x9a26('0xb2')]){_0x4de762=_[_0x9a26('0x57')](_0x4de762,_0x13360a['body'][_0x9a26('0xb2')]);}return db[_0x9a26('0x7f')]['create'](_0x4de762,{'include':[{'model':db[_0x9a26('0x98')],'as':_0x9a26('0xb3')}]});})['then'](respondWithResult(_0x26dad3,null))[_0x9a26('0x5c')](handleError(_0x26dad3,null));};exports[_0x9a26('0xb4')]=function(_0x5c76ac,_0x3e2a14){return db[_0x9a26('0x43')]['find']({'where':{'id':_0x5c76ac['params']['id']},'include':[{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x9a26('0x26')](handleEntityNotFound(_0x3e2a14,null))[_0x9a26('0x26')](function(_0xa0aa2b){if(!_0xa0aa2b[_0x9a26('0x3d')])return;var _0x7541bb=_0xa0aa2b[_0x9a26('0xa8')]();return respondWithRpcPromise(_0x9a26('0xb5'),_0x9a26('0xb4'),{'account':_0x7541bb});})[_0x9a26('0x26')](respondWithResult(_0x3e2a14,null))[_0x9a26('0x5c')](handleError(_0x3e2a14,null));};exports['destroy']=function(_0x469ea9,_0x4aa0aa){return db[_0x9a26('0x43')]['find']({'where':{'id':_0x469ea9[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4aa0aa,null))[_0x9a26('0x26')](function(_0x563b88){if(_0x563b88&&_0x563b88[_0x9a26('0x39')]){throw new db['Sequelize'][(_0x9a26('0xb6'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x563b88;})[_0x9a26('0x26')](removeEntity(_0x4aa0aa,null))[_0x9a26('0x5c')](handleError(_0x4aa0aa,null));};exports[_0x9a26('0xb7')]=function(_0x292bb7,_0x8dcd22){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x292bb7[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x8dcd22,null))[_0x9a26('0x26')](function(_0x4da630){if(_0x4da630){return _0x4da630[_0x9a26('0xb7')](_0x292bb7['body'][_0x9a26('0x6e')],_['omit'](_0x292bb7[_0x9a26('0x61')],[_0x9a26('0x6e'),'id'])||{})[_0x9a26('0xb8')](function(_0x580dbb){for(var _0x5c66e4=0x0;_0x5c66e4<_0x292bb7['body'][_0x9a26('0x6e')][_0x9a26('0x4e')];_0x5c66e4+=0x1){socket[_0x9a26('0xb9')](_0x9a26('0xba'),{'UserId':Number(_0x292bb7[_0x9a26('0x61')][_0x9a26('0x6e')][_0x5c66e4]),'MailAccountId':Number(_0x292bb7['params']['id'])});}return _0x580dbb;});}})[_0x9a26('0x26')](respondWithResult(_0x8dcd22,null))[_0x9a26('0x5c')](handleError(_0x8dcd22,null));};exports[_0x9a26('0xbb')]=function(_0x3ad826,_0x188d82){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x3ad826[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x188d82,null))[_0x9a26('0x26')](function(_0x19be15){if(_0x19be15){return _0x19be15[_0x9a26('0xbb')](_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')])[_0x9a26('0x26')](function(){if(_[_0x9a26('0xbc')](_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')])){for(var _0xef35fd=0x0;_0xef35fd<_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')]['length'];_0xef35fd+=0x1){socket[_0x9a26('0xb9')](_0x9a26('0xbd'),{'UserId':Number(_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')][_0xef35fd]),'MailAccountId':Number(_0x3ad826[_0x9a26('0x5e')]['id'])});}}else{socket[_0x9a26('0xb9')](_0x9a26('0xbd'),{'UserId':Number(_0x3ad826['query']['ids']),'MailAccountId':Number(_0x3ad826['params']['id'])});}});}})['then'](respondWithStatusCode(_0x188d82,null))[_0x9a26('0x5c')](handleError(_0x188d82,null));};exports['getAgents']=function(_0x23f8de,_0x43e453){var _0x36fdae={};var _0xda028c={};var _0x4789cc;var _0x446b07;return db[_0x9a26('0x43')]['findOne']({'where':{'id':_0x23f8de[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x43e453,null))['then'](function(_0xdb7b3b){if(_0xdb7b3b){_0x4789cc=_0xdb7b3b;_0xda028c[_0x9a26('0x47')]=_[_0x9a26('0x4a')](db[_0x9a26('0xbe')][_0x9a26('0x44')]);_0xda028c[_0x9a26('0x49')]=_['keys'](_0x23f8de[_0x9a26('0x49')]);_0xda028c['filters']=_[_0x9a26('0x4b')](_0xda028c['model'],_0xda028c[_0x9a26('0x49')]);_0x36fdae[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0xda028c['model'],qs[_0x9a26('0x4d')](_0x23f8de[_0x9a26('0x49')]['fields']));_0x36fdae[_0x9a26('0x4c')]=_0x36fdae[_0x9a26('0x4c')]['length']?_0x36fdae[_0x9a26('0x4c')]:_0xda028c[_0x9a26('0x47')];_0x36fdae[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x23f8de[_0x9a26('0x49')]['sort']);_0x36fdae[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_['pick'](_0x23f8de[_0x9a26('0x49')],_0xda028c['filters']));if(_0x23f8de[_0x9a26('0x49')][_0x9a26('0x56')]){_0x36fdae[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x36fdae[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x36fdae['attributes'],function(_0x5176ef){var _0x4a3d6d={};_0x4a3d6d[_0x5176ef]={'$like':'%'+_0x23f8de[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x4a3d6d;})});}_0x36fdae=_['merge']({},_0x36fdae,_0x23f8de[_0x9a26('0x5a')]);return _0x4789cc[_0x9a26('0xbf')](_0x36fdae);}})[_0x9a26('0x26')](function(_0x20e05d){if(_0x20e05d){_0x446b07=_0x20e05d['length'];if(!_0x23f8de['query'][_0x9a26('0x4f')]('nolimit')){_0x36fdae[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x23f8de[_0x9a26('0x49')]['limit']);_0x36fdae['offset']=qs[_0x9a26('0x1c')](_0x23f8de[_0x9a26('0x49')][_0x9a26('0x1c')]);}return _0x4789cc['getAgents'](_0x36fdae);}})[_0x9a26('0x26')](function(_0x4990c3){if(_0x4990c3){return _0x4990c3?{'count':_0x446b07,'rows':_0x4990c3}:null;}})[_0x9a26('0x26')](respondWithResult(_0x43e453,null))['catch'](handleError(_0x43e453,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b75acf3..a86702a 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 _0xe558=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x556d89,_0x2941bd){var _0x55239b=function(_0x1e0bae){while(--_0x1e0bae){_0x556d89['push'](_0x556d89['shift']());}};_0x55239b(++_0x2941bd);}(_0xe558,0x70));var _0x8e55=function(_0x3df4c9,_0xd60207){_0x3df4c9=_0x3df4c9-0x0;var _0x3472f6=_0xe558[_0x3df4c9];return _0x3472f6;};'use strict';var EventEmitter=require(_0x8e55('0x0'));var MailAccount=require(_0x8e55('0x1'))['db'][_0x8e55('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8e55('0x3')](0x0);var events={'afterCreate':_0x8e55('0x4'),'afterUpdate':_0x8e55('0x5'),'afterDestroy':_0x8e55('0x6')};function emitEvent(_0x3a5285){return function(_0x28c870,_0x5bc807,_0xf125cc){MailAccountEvents[_0x8e55('0x7')](_0x3a5285+':'+_0x28c870['id'],_0x28c870);MailAccountEvents[_0x8e55('0x7')](_0x3a5285,_0x28c870);_0xf125cc(null);};}for(var e in events){if(events[_0x8e55('0x8')](e)){var event=events[e];MailAccount[_0x8e55('0x9')](e,emitEvent(event));}}module[_0x8e55('0xa')]=MailAccountEvents; \ No newline at end of file +var _0x6363=['emit','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','update','remove'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0x6363,0x13a));var _0x3636=function(_0x550155,_0x46a009){_0x550155=_0x550155-0x0;var _0xf6526a=_0x6363[_0x550155];return _0xf6526a;};'use strict';var EventEmitter=require(_0x3636('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x3636('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3636('0x2')](0x0);var events={'afterCreate':_0x3636('0x3'),'afterUpdate':_0x3636('0x4'),'afterDestroy':_0x3636('0x5')};function emitEvent(_0x684396){return function(_0x1335a2,_0xdf836f,_0x1e62e9){MailAccountEvents[_0x3636('0x6')](_0x684396+':'+_0x1335a2['id'],_0x1335a2);MailAccountEvents[_0x3636('0x6')](_0x684396,_0x1335a2);_0x1e62e9(null);};}for(var e in events){if(events[_0x3636('0x7')](e)){var event=events[e];MailAccount[_0x3636('0x8')](e,emitEvent(event));}}module[_0x3636('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index da3a6f7..2c757a7 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 _0xe421=['port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','MailAccount','service','provider','host','Smtp'];(function(_0x308a9a,_0xd452bb){var _0xf317d1=function(_0x2df45c){while(--_0x2df45c){_0x308a9a['push'](_0x308a9a['shift']());}};_0xf317d1(++_0xd452bb);}(_0xe421,0x136));var _0x1e42=function(_0x3f2699,_0x8b3956){_0x3f2699=_0x3f2699-0x0;var _0x36932a=_0xe421[_0x3f2699];return _0x36932a;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x26cca3){return _0x26cca3['define'](_0x1e42('0x0'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3e5d4b=this;var _0x30731f={'id':_0x3e5d4b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3e5d4b['provider']!=='custom'){_0x30731f[_0x1e42('0x1')]=_0x3e5d4b[_0x1e42('0x2')];}else{_0x30731f[_0x1e42('0x3')]=_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0x3')];_0x30731f[_0x1e42('0x5')]=_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0x5')];_0x30731f['secure']=_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0x6')];}if(_0x3e5d4b['Smtp'][_0x1e42('0x7')]){if(_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0x8')]){if(!_0x3e5d4b['Smtp'][_0x1e42('0x9')])throw new Error(_0x1e42('0xa'));_0x30731f[_0x1e42('0xb')]={'type':'OAuth2','user':_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0xc')],'accessToken':_0x3e5d4b['Smtp'][_0x1e42('0x9')][_0x1e42('0xd')]};}else{_0x30731f[_0x1e42('0xb')]={'user':_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0xc')],'pass':_0x3e5d4b[_0x1e42('0x4')][_0x1e42('0xe')]};}}return _0x30731f;}}});}; \ No newline at end of file +var _0x2999=['mail_accounts','provider','custom','service','port','Smtp','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','exports','MailAccount'];(function(_0x14e001,_0x569bf){var _0x2c09da=function(_0x2efab1){while(--_0x2efab1){_0x14e001['push'](_0x14e001['shift']());}};_0x2c09da(++_0x569bf);}(_0x2999,0x157));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x9299('0x0')]=function(_0x10f206){return _0x10f206['define'](_0x9299('0x1'),attributes,{'tableName':_0x9299('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3d7f57=this;var _0x4d1f87={'id':_0x3d7f57['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d7f57[_0x9299('0x3')]!==_0x9299('0x4')){_0x4d1f87[_0x9299('0x5')]=_0x3d7f57['provider'];}else{_0x4d1f87['host']=_0x3d7f57['Smtp']['host'];_0x4d1f87[_0x9299('0x6')]=_0x3d7f57[_0x9299('0x7')][_0x9299('0x6')];_0x4d1f87[_0x9299('0x8')]=_0x3d7f57[_0x9299('0x7')][_0x9299('0x8')];}if(_0x3d7f57['Smtp']['authentication']){if(_0x3d7f57[_0x9299('0x7')][_0x9299('0x9')]){if(!_0x3d7f57[_0x9299('0x7')][_0x9299('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x4d1f87[_0x9299('0xb')]={'type':'OAuth2','user':_0x3d7f57[_0x9299('0x7')][_0x9299('0xc')],'accessToken':_0x3d7f57[_0x9299('0x7')]['CloudProvider'][_0x9299('0xd')]};}else{_0x4d1f87[_0x9299('0xb')]={'user':_0x3d7f57['Smtp']['user'],'pass':_0x3d7f57['Smtp'][_0x9299('0xe')]};}}return _0x4d1f87;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 187597d..ad0ce49 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 _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5f2f,0x73));var _0xf5f2=function(_0x479a83,_0x2c8226){_0x479a83=_0x479a83-0x0;var _0x36d90b=_0x5f2f[_0x479a83];return _0x36d90b;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file +var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x254e6e,_0x430741){var _0x21d732=function(_0x2cb3d4){while(--_0x2cb3d4){_0x254e6e['push'](_0x254e6e['shift']());}};_0x21d732(++_0x430741);}(_0x687b,0x14a));var _0xb687=function(_0x42bd43,_0x59fb77){_0x42bd43=_0x42bd43-0x0;var _0x421e88=_0x687b[_0x42bd43];return _0x421e88;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e544de6..b721787 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 _0xa0a3=['save','remove','emit','removeListener','register','length'];(function(_0x3a52a8,_0x51edd4){var _0x44ebbc=function(_0x27e311){while(--_0x27e311){_0x3a52a8['push'](_0x3a52a8['shift']());}};_0x44ebbc(++_0x51edd4);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x1fb94f,_0x2812e7){_0x1fb94f=_0x1fb94f-0x0;var _0x2a1bd0=_0xa0a3[_0x1fb94f];return _0x2a1bd0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3a0a('0x0'),_0x3a0a('0x1'),'update'];function createListener(_0x640eba,_0xd101d5){return function(_0x15bad5){_0xd101d5[_0x3a0a('0x2')](_0x640eba,_0x15bad5);};}function removeListener(_0x4f9090,_0x7f2ad7){return function(){MailAccountEvents[_0x3a0a('0x3')](_0x4f9090,_0x7f2ad7);};}exports[_0x3a0a('0x4')]=function(_0xa047cf){for(var _0x3d7dc7=0x0,_0x4719d=events[_0x3a0a('0x5')];_0x3d7dc7<_0x4719d;_0x3d7dc7++){var _0x1766c1=events[_0x3d7dc7];var _0x5d98d3=createListener('mailAccount:'+_0x1766c1,_0xa047cf);MailAccountEvents['on'](_0x1766c1,_0x5d98d3);}}; \ No newline at end of file +var _0x50d1=['emit','length','mailAccount:','save','remove','update'];(function(_0x39cc66,_0x4e9a07){var _0x44eaaa=function(_0x3f4582){while(--_0x3f4582){_0x39cc66['push'](_0x39cc66['shift']());}};_0x44eaaa(++_0x4e9a07);}(_0x50d1,0xf3));var _0x150d=function(_0x899324,_0x2979c0){_0x899324=_0x899324-0x0;var _0x1e5000=_0x50d1[_0x899324];return _0x1e5000;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x150d('0x0'),_0x150d('0x1'),_0x150d('0x2')];function createListener(_0x4bac16,_0xbe5d9f){return function(_0x2de52f){_0xbe5d9f[_0x150d('0x3')](_0x4bac16,_0x2de52f);};}function removeListener(_0x46f6ce,_0x192f54){return function(){MailAccountEvents['removeListener'](_0x46f6ce,_0x192f54);};}exports['register']=function(_0x37af08){for(var _0x199c23=0x0,_0x43215f=events[_0x150d('0x4')];_0x199c23<_0x43215f;_0x199c23++){var _0x1a0cb3=events[_0x199c23];var _0x17811d=createListener(_0x150d('0x5')+_0x1a0cb3,_0x37af08);MailAccountEvents['on'](_0x1a0cb3,_0x17811d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3bb2040..f8d4350 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 _0xcfcc=['delete','destroy','multer','path','express','fs-extra','../../components/interaction/service','/:id','isAuthenticated','show','put'];(function(_0x54a28a,_0x1ba1fe){var _0x3da1f1=function(_0x7231b5){while(--_0x7231b5){_0x54a28a['push'](_0x54a28a['shift']());}};_0x3da1f1(++_0x1ba1fe);}(_0xcfcc,0x16d));var _0xccfc=function(_0x19ab0c,_0x18829b){_0x19ab0c=_0x19ab0c-0x0;var _0x4aa890=_0xcfcc[_0x19ab0c];return _0x4aa890;};'use strict';var multer=require(_0xccfc('0x0'));var util=require('util');var path=require(_0xccfc('0x1'));var timeout=require('connect-timeout');var express=require(_0xccfc('0x2'));var router=express['Router']();var fs_extra=require(_0xccfc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xccfc('0x4'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0xccfc('0x5'),auth[_0xccfc('0x6')](),controller[_0xccfc('0x7')]);router[_0xccfc('0x8')](_0xccfc('0x5'),auth['isAuthenticated'](),controller['update']);router[_0xccfc('0x9')]('/:id',auth[_0xccfc('0x6')](),controller[_0xccfc('0xa')]);module['exports']=router; \ No newline at end of file +var _0xa041=['multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','/:id','update','delete','destroy','exports'];(function(_0x5162dc,_0x3f7428){var _0x2851a9=function(_0x5b9210){while(--_0x5b9210){_0x5162dc['push'](_0x5162dc['shift']());}};_0x2851a9(++_0x3f7428);}(_0xa041,0x16c));var _0x1a04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa041[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1a04('0x0'));var util=require('util');var path=require(_0x1a04('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1a04('0x2'));var auth=require(_0x1a04('0x3'));var interaction=require(_0x1a04('0x4'));var config=require(_0x1a04('0x5'));var controller=require(_0x1a04('0x6'));router[_0x1a04('0x7')]('/:id',auth[_0x1a04('0x8')](),controller['show']);router['put'](_0x1a04('0x9'),auth[_0x1a04('0x8')](),controller[_0x1a04('0xa')]);router[_0x1a04('0xb')](_0x1a04('0x9'),auth[_0x1a04('0x8')](),controller[_0x1a04('0xc')]);module[_0x1a04('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 1dd3d6a..33ea4f9 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 _0x48b1=['TEXT','STRING','sequelize','exports','INTEGER','noop'];(function(_0x1d58f0,_0x1a82db){var _0x2105a4=function(_0x5950b7){while(--_0x5950b7){_0x1d58f0['push'](_0x1d58f0['shift']());}};_0x2105a4(++_0x1a82db);}(_0x48b1,0x1b8));var _0x148b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x148b('0x0'));module[_0x148b('0x1')]={'priority':{'type':Sequelize[_0x148b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x148b('0x3')},'appdata':{'type':Sequelize[_0x148b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x148b('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x96d6=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0xeffa08,_0x544edc){var _0x426e43=function(_0x2eddc1){while(--_0x2eddc1){_0xeffa08['push'](_0xeffa08['shift']());}};_0x426e43(++_0x544edc);}(_0x96d6,0xdc));var _0x696d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x96d6[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x696d('0x0'));module[_0x696d('0x1')]={'priority':{'type':Sequelize[_0x696d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x696d('0x3')},'appdata':{'type':Sequelize[_0x696d('0x4')]()},'description':{'type':Sequelize[_0x696d('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x696d('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7956c7a..8603a56 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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x58391a,_0x3cc666){var _0xe02c18=function(_0x5c1887){while(--_0x5c1887){_0x58391a['push'](_0x58391a['shift']());}};_0xe02c18(++_0x3cc666);}(_0x9bde,0xe1));var _0xe9bd=function(_0xaee78d,_0x554f13){_0xaee78d=_0xaee78d-0x0;var _0x490e3a=_0x9bde[_0xaee78d];return _0x490e3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x5429e6,_0x1f78fe){var _0x3c6711=function(_0x2aca23){while(--_0x2aca23){_0x5429e6['push'](_0x5429e6['shift']());}};_0x3c6711(++_0x1f78fe);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b5327f8..34471df 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 _0x0cfb=['bluebird','request-promise','../../config/environment','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x39752b,_0x41c9f0){var _0x221636=function(_0x430b2b){while(--_0x430b2b){_0x39752b['push'](_0x39752b['shift']());}};_0x221636(++_0x41c9f0);}(_0x0cfb,0x110));var _0xb0cf=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0cfb[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xb0cf('0x0'));var util=require('util');var logger=require(_0xb0cf('0x1'))('api');var moment=require(_0xb0cf('0x2'));var BPromise=require(_0xb0cf('0x3'));var rp=require(_0xb0cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0cf('0x5'));var attributes=require('./mailApplication.attributes');module[_0xb0cf('0x6')]=function(_0x4d3db6,_0x320046){return _0x4d3db6[_0xb0cf('0x7')](_0xb0cf('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0cf('0x9'),'collate':_0xb0cf('0xa')});}; \ No newline at end of file +var _0x9419=['../../config/logger','api','moment','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x9419,0x1b7));var _0x9941=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x9419[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0x9941('0x0'));var util=require('util');var logger=require(_0x9941('0x1'))(_0x9941('0x2'));var moment=require(_0x9941('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9941('0x4'));var attributes=require(_0x9941('0x5'));module[_0x9941('0x6')]=function(_0x151edd,_0x2be7b2){return _0x151edd[_0x9941('0x7')](_0x9941('0x8'),attributes,{'tableName':_0x9941('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9941('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7dc4e45..967850c 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 _0xd817=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','body','options','raw','attributes','lodash','util','moment','bluebird'];(function(_0x16fdcd,_0x207cf2){var _0x2c3fe8=function(_0x55e6f3){while(--_0x55e6f3){_0x16fdcd['push'](_0x16fdcd['shift']());}};_0x2c3fe8(++_0x207cf2);}(_0xd817,0xce));var _0x7d81=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xd817[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require(_0x7d81('0x0'));var util=require(_0x7d81('0x1'));var moment=require(_0x7d81('0x2'));var BPromise=require(_0x7d81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d81('0x4'));var db=require(_0x7d81('0x5'))['db'];var utils=require(_0x7d81('0x6'));var logger=require(_0x7d81('0x7'))(_0x7d81('0x8'));var config=require(_0x7d81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d81('0xa')][_0x7d81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3716b4,_0x4559ce,_0x3d97e0){return new BPromise(function(_0x1c22cf,_0x5045b1){return client[_0x7d81('0xc')](_0x3716b4,_0x3d97e0)[_0x7d81('0xd')](function(_0x363883){logger[_0x7d81('0xe')](_0x7d81('0xf'),_0x4559ce,_0x7d81('0x10'));logger[_0x7d81('0x11')](_0x7d81('0x12'),_0x4559ce,_0x7d81('0x10'),JSON[_0x7d81('0x13')](_0x363883));if(_0x363883[_0x7d81('0x14')]){if(_0x363883[_0x7d81('0x14')][_0x7d81('0x15')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x4559ce,_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);return _0x5045b1(_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);}logger[_0x7d81('0x14')](_0x7d81('0xf'),_0x4559ce,_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);return _0x1c22cf(_0x363883['error'][_0x7d81('0x16')]);}else{logger[_0x7d81('0xe')](_0x7d81('0xf'),_0x4559ce,_0x7d81('0x10'));_0x1c22cf(_0x363883[_0x7d81('0x17')][_0x7d81('0x16')]);}})[_0x7d81('0x18')](function(_0x526a99){logger[_0x7d81('0x14')]('MailApplication,\x20%s,\x20%s',_0x4559ce,_0x526a99);_0x5045b1(_0x526a99);});});}exports[_0x7d81('0x19')]=function(_0xa57b8c){var _0x263134=this;return new Promise(function(_0x21e5c6,_0x43e7f0){return db['MailApplication']['update'](_0xa57b8c[_0x7d81('0x1a')],{'raw':_0xa57b8c['options']?_0xa57b8c[_0x7d81('0x1b')][_0x7d81('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa57b8c[_0x7d81('0x1b')]?_0xa57b8c[_0x7d81('0x1b')]['where']||null:null,'attributes':_0xa57b8c[_0x7d81('0x1b')]?_0xa57b8c[_0x7d81('0x1b')][_0x7d81('0x1d')]||null:null,'limit':_0xa57b8c[_0x7d81('0x1b')]?_0xa57b8c[_0x7d81('0x1b')]['limit']||null:null})['then'](function(_0x28e71e){logger[_0x7d81('0xe')](_0x7d81('0x19'),_0xa57b8c);logger['debug'](_0x7d81('0x19'),_0xa57b8c,JSON['stringify'](_0x28e71e));_0x21e5c6(_0x28e71e);})[_0x7d81('0x18')](function(_0x21156d){logger[_0x7d81('0x14')](_0x7d81('0x19'),_0x21156d[_0x7d81('0x16')],_0xa57b8c);_0x43e7f0(_0x263134[_0x7d81('0x14')](0x1f4,_0x21156d[_0x7d81('0x16')]));});});}; \ No newline at end of file +var _0xde72=['MailApplication,\x20%s,\x20%s','message','result','catch','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0x3ed219,_0x40ff55){var _0x4953d7=function(_0xb7da7f){while(--_0xb7da7f){_0x3ed219['push'](_0x3ed219['shift']());}};_0x4953d7(++_0x40ff55);}(_0xde72,0x1ac));var _0x2de7=function(_0x2716b3,_0x856b60){_0x2716b3=_0x2716b3-0x0;var _0x33fb97=_0xde72[_0x2716b3];return _0x33fb97;};'use strict';var _=require(_0x2de7('0x0'));var util=require(_0x2de7('0x1'));var moment=require(_0x2de7('0x2'));var BPromise=require(_0x2de7('0x3'));var rs=require(_0x2de7('0x4'));var fs=require('fs');var Redis=require(_0x2de7('0x5'));var db=require(_0x2de7('0x6'))['db'];var utils=require(_0x2de7('0x7'));var logger=require('../../config/logger')(_0x2de7('0x8'));var config=require(_0x2de7('0x9'));var jayson=require(_0x2de7('0xa'));var client=jayson[_0x2de7('0xb')][_0x2de7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x139f85,_0x2aa1c7,_0x17a90e){return new BPromise(function(_0x25b94d,_0x3e01d4){return client[_0x2de7('0xd')](_0x139f85,_0x17a90e)[_0x2de7('0xe')](function(_0x4b773c){logger[_0x2de7('0xf')]('MailApplication,\x20%s,\x20%s',_0x2aa1c7,_0x2de7('0x10'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x2aa1c7,_0x2de7('0x10'),JSON[_0x2de7('0x11')](_0x4b773c));if(_0x4b773c[_0x2de7('0x12')]){if(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x13')]===0x1f4){logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x4b773c['error'][_0x2de7('0x15')]);return _0x3e01d4(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x15')]);}logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x4b773c[_0x2de7('0x12')]['message']);return _0x25b94d(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x15')]);}else{logger[_0x2de7('0xf')](_0x2de7('0x14'),_0x2aa1c7,'request\x20sent');_0x25b94d(_0x4b773c[_0x2de7('0x16')]['message']);}})[_0x2de7('0x17')](function(_0x214579){logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x214579);_0x3e01d4(_0x214579);});});}exports['UpdateMailApplication']=function(_0x3c5e34){var _0x764f1b=this;return new Promise(function(_0x48d18f,_0xcf3405){return db[_0x2de7('0x18')][_0x2de7('0x19')](_0x3c5e34[_0x2de7('0x1a')],{'raw':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34['options'][_0x2de7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c5e34['options']?_0x3c5e34[_0x2de7('0x1b')][_0x2de7('0x1d')]||null:null,'attributes':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34['options']['attributes']||null:null,'limit':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34[_0x2de7('0x1b')][_0x2de7('0x1e')]||null:null})['then'](function(_0x5ec840){logger[_0x2de7('0xf')]('UpdateMailApplication',_0x3c5e34);logger['debug'](_0x2de7('0x1f'),_0x3c5e34,JSON[_0x2de7('0x11')](_0x5ec840));_0x48d18f(_0x5ec840);})['catch'](function(_0x216b14){logger[_0x2de7('0x12')](_0x2de7('0x1f'),_0x216b14[_0x2de7('0x15')],_0x3c5e34);_0xcf3405(_0x764f1b[_0x2de7('0x12')](0x1f4,_0x216b14[_0x2de7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0fe8635..aa1d411 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 _0xea8a=['get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/interaction/service','./mailInteraction.controller'];(function(_0x8e52f8,_0x263800){var _0x207335=function(_0x482ba6){while(--_0x482ba6){_0x8e52f8['push'](_0x8e52f8['shift']());}};_0x207335(++_0x263800);}(_0xea8a,0x10b));var _0xaea8=function(_0x1cb5cf,_0x3eaea8){_0x1cb5cf=_0x1cb5cf-0x0;var _0x35a284=_0xea8a[_0x1cb5cf];return _0x35a284;};'use strict';var express=require('express');var router=express[_0xaea8('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0xaea8('0x1'));var controller=require(_0xaea8('0x2'));router[_0xaea8('0x3')]('/',auth[_0xaea8('0x4')](),controller['index']);router[_0xaea8('0x3')](_0xaea8('0x5'),auth[_0xaea8('0x4')](),controller[_0xaea8('0x6')]);router[_0xaea8('0x3')](_0xaea8('0x7'),auth[_0xaea8('0x4')](),controller[_0xaea8('0x8')]);router[_0xaea8('0x3')](_0xaea8('0x9'),auth['isAuthenticated'](),controller[_0xaea8('0xa')]);router[_0xaea8('0x3')](_0xaea8('0xb'),auth[_0xaea8('0x4')](),controller['download']);router[_0xaea8('0xc')]('/',auth[_0xaea8('0x4')](),controller['create']);router['post'](_0xaea8('0x9'),auth['isAuthenticated'](),controller[_0xaea8('0xd')]);router['post'](_0xaea8('0xe'),auth[_0xaea8('0x4')](),interaction['tracked'](_0xaea8('0xf'),_0xaea8('0x10')),controller[_0xaea8('0x11')]);router[_0xaea8('0x12')](_0xaea8('0x7'),auth['isAuthenticated'](),interaction[_0xaea8('0x13')](_0xaea8('0xf'),_0xaea8('0x14')),controller[_0xaea8('0x15')]);router[_0xaea8('0x16')](_0xaea8('0x7'),auth[_0xaea8('0x4')](),interaction[_0xaea8('0x13')](_0xaea8('0xf'),_0xaea8('0x17')),controller[_0xaea8('0x18')]);router['delete'](_0xaea8('0xe'),auth['isAuthenticated'](),controller[_0xaea8('0x19')]);module[_0xaea8('0x1a')]=router; \ No newline at end of file +var _0xe559=['mail','mailinteraction:addtags','addTags','put','/:id','update','delete','mailinteraction:destroy','removeTags','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x4dbc75,_0x385ed7){var _0x309a56=function(_0x3d7795){while(--_0x3d7795){_0x4dbc75['push'](_0x4dbc75['shift']());}};_0x309a56(++_0x385ed7);}(_0xe559,0x1c9));var _0x9e55=function(_0x4f344c,_0x510a88){_0x4f344c=_0x4f344c-0x0;var _0x31b89e=_0xe559[_0x4f344c];return _0x31b89e;};'use strict';var express=require(_0x9e55('0x0'));var router=express['Router']();var auth=require(_0x9e55('0x1'));var interaction=require(_0x9e55('0x2'));var controller=require(_0x9e55('0x3'));router['get']('/',auth[_0x9e55('0x4')](),controller[_0x9e55('0x5')]);router[_0x9e55('0x6')](_0x9e55('0x7'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x8')]);router[_0x9e55('0x6')]('/:id',auth[_0x9e55('0x4')](),controller[_0x9e55('0x9')]);router['get'](_0x9e55('0xa'),auth[_0x9e55('0x4')](),controller[_0x9e55('0xb')]);router[_0x9e55('0x6')](_0x9e55('0xc'),auth[_0x9e55('0x4')](),controller[_0x9e55('0xd')]);router[_0x9e55('0xe')]('/',auth[_0x9e55('0x4')](),controller[_0x9e55('0xf')]);router[_0x9e55('0xe')](_0x9e55('0xa'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x10')]);router[_0x9e55('0xe')](_0x9e55('0x11'),auth['isAuthenticated'](),interaction[_0x9e55('0x12')](_0x9e55('0x13'),_0x9e55('0x14')),controller[_0x9e55('0x15')]);router[_0x9e55('0x16')](_0x9e55('0x17'),auth['isAuthenticated'](),interaction[_0x9e55('0x12')]('mail','mailinteraction:update'),controller[_0x9e55('0x18')]);router[_0x9e55('0x19')](_0x9e55('0x17'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x9e55('0x1a')),controller['destroy']);router[_0x9e55('0x19')](_0x9e55('0x11'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x1b')]);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 9708117..45006b0 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 _0xec83=['exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out','sequelize','iconv'];(function(_0x5015d4,_0x1aae87){var _0x2b8076=function(_0x30a0a6){while(--_0x30a0a6){_0x5015d4['push'](_0x5015d4['shift']());}};_0x2b8076(++_0x1aae87);}(_0xec83,0xfa));var _0x3ec8=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0xec83[_0x43de22];return _0x4b15ee;};'use strict';var Sequelize=require(_0x3ec8('0x0'));var iconv=require(_0x3ec8('0x1'));module[_0x3ec8('0x2')]={'closed':{'type':Sequelize[_0x3ec8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ec8('0x4')]},'disposition':{'type':Sequelize[_0x3ec8('0x5')]},'secondDisposition':{'type':Sequelize[_0x3ec8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3ec8('0x5')]},'note':{'type':Sequelize[_0x3ec8('0x5')]},'inReplyTo':{'type':Sequelize[_0x3ec8('0x5')](0x1fe)},'to':{'type':Sequelize[_0x3ec8('0x5')]},'cc':{'type':Sequelize[_0x3ec8('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3ec8('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3ec8('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3ec8('0x7')]('in',_0x3ec8('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3ec8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3ec8('0x7')]('in',_0x3ec8('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3ec8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x871e=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x1c7f3a,_0x2ca32e){var _0x51f02e=function(_0x59fa50){while(--_0x59fa50){_0x1c7f3a['push'](_0x1c7f3a['shift']());}};_0x51f02e(++_0x2ca32e);}(_0x871e,0x1b0));var _0xe871=function(_0x55bb17,_0xecb8e6){_0x55bb17=_0x55bb17-0x0;var _0x3a72e8=_0x871e[_0x55bb17];return _0x3a72e8;};'use strict';var Sequelize=require(_0xe871('0x0'));var iconv=require('iconv');module[_0xe871('0x1')]={'closed':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe871('0x3')]},'disposition':{'type':Sequelize[_0xe871('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe871('0x4')]},'note':{'type':Sequelize[_0xe871('0x4')]},'inReplyTo':{'type':Sequelize[_0xe871('0x4')](0x1fe)},'to':{'type':Sequelize[_0xe871('0x4')]},'cc':{'type':Sequelize[_0xe871('0x5')](_0xe871('0x6'))},'subject':{'type':Sequelize[_0xe871('0x5')]()},'attach':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe871('0x3')]},'substatus':{'type':Sequelize[_0xe871('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe871('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe871('0x7')]('in',_0xe871('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ba0fc6b..656234f 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 _0x4091=['../../config/logger','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','error','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','user','catch','params','model','keys','filters','intersection','attributes','includeAll','include','options','find','create','body','destroy','describe','addMessage','ids','getMessages','findOne','fields','length','hasOwnProperty','nolimit','order','sort','pick','MailInteractionId','filter','where','merge','$gte','split','format','MailMessage','inlineCss','true','rows','addTags','setTags','spread','Tag','mailInteractionTags:save','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','attachments','push','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs'];(function(_0x4850b5,_0x49b3c1){var _0x2ae1f9=function(_0x167c37){while(--_0x167c37){_0x4850b5['push'](_0x4850b5['shift']());}};_0x2ae1f9(++_0x49b3c1);}(_0x4091,0x6c));var _0x1409=function(_0x46275a,_0x157c56){_0x46275a=_0x46275a-0x0;var _0x1b6b39=_0x4091[_0x46275a];return _0x1b6b39;};'use strict';var emlformat=require(_0x1409('0x0'));var rimraf=require(_0x1409('0x1'));var zipdir=require(_0x1409('0x2'));var moment=require(_0x1409('0x3'));var BPromise=require(_0x1409('0x4'));var util=require(_0x1409('0x5'));var path=require(_0x1409('0x6'));var fs=require('fs');var _=require(_0x1409('0x7'));var juice=require(_0x1409('0x8'));var Redis=require('ioredis');var interaction=require(_0x1409('0x9'));var qs=require(_0x1409('0xa'));var logger=require(_0x1409('0xb'))('api');var config=require(_0x1409('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x1409('0xd'));config[_0x1409('0xe')]=_[_0x1409('0xf')](config['redis'],{'host':_0x1409('0x10'),'port':0x18eb});var socket=require(_0x1409('0x11'))(new Redis(config['redis']));require(_0x1409('0x12'))[_0x1409('0x13')](socket);function respondWithStatusCode(_0x222ccb,_0x3bd792){_0x3bd792=_0x3bd792||0xcc;return function(_0x3560f3){if(_0x3560f3){return _0x222ccb[_0x1409('0x14')](_0x3bd792);}return _0x222ccb[_0x1409('0x15')](_0x3bd792)[_0x1409('0x16')]();};}function respondWithResult(_0x28e872,_0xe72617){_0xe72617=_0xe72617||0xc8;return function(_0x4ffef5){if(_0x4ffef5){return _0x28e872['status'](_0xe72617)[_0x1409('0x17')](_0x4ffef5);}};}function respondWithFilteredResult(_0xe27d27,_0xf36192){return function(_0x138ca2){if(_0x138ca2){var _0x1a2040=typeof _0xf36192[_0x1409('0x18')]===_0x1409('0x19')&&typeof _0xf36192['limit']===_0x1409('0x19');var _0x597805=_0x138ca2[_0x1409('0x1a')];var _0x4ff07e=_0x1a2040?0x0:_0xf36192['offset'];var _0x489fcf=_0x1a2040?_0x138ca2[_0x1409('0x1a')]:_0xf36192[_0x1409('0x18')]+_0xf36192[_0x1409('0x1b')];var _0x369a28;if(_0x489fcf>=_0x597805){_0x489fcf=_0x597805;_0x369a28=0xc8;}else{_0x369a28=0xce;}_0xe27d27[_0x1409('0x15')](_0x369a28);return _0xe27d27[_0x1409('0x1c')](_0x1409('0x1d'),_0x4ff07e+'-'+_0x489fcf+'/'+_0x597805)['json'](_0x138ca2);}return null;};}function saveUpdates(_0x1765ed){return function(_0x118c65){if(_0x118c65){return _0x118c65[_0x1409('0x1e')](_0x1765ed)['then'](function(_0x3bb81f){return _0x3bb81f;});}return null;};}function removeEntity(_0x3bfd1e){return function(_0x434c9a){if(_0x434c9a){return _0x434c9a['destroy']()[_0x1409('0x1f')](function(){_0x3bfd1e[_0x1409('0x15')](0xcc)[_0x1409('0x16')]();});}};}function handleEntityNotFound(_0x3357b9){return function(_0x3574ce){if(!_0x3574ce){_0x3357b9[_0x1409('0x14')](0x194);}return _0x3574ce;};}function handleError(_0x3eeae8,_0x5d50a8){_0x5d50a8=_0x5d50a8||0x1f4;return function(_0x5a2328){logger[_0x1409('0x20')](_0x5a2328['stack']);if(_0x5a2328[_0x1409('0x21')]){delete _0x5a2328[_0x1409('0x21')];}_0x3eeae8[_0x1409('0x15')](_0x5d50a8)[_0x1409('0x22')](_0x5a2328);};}exports[_0x1409('0x23')]=function(_0x469ad3,_0x1e5aa8){var _0x5edcdc={};var _0x5a67c4=_[_0x1409('0x24')](db[_0x1409('0x25')][_0x1409('0x26')],function(_0x32f0b6){return{'name':_0x32f0b6[_0x1409('0x27')],'type':_0x32f0b6[_0x1409('0x28')][_0x1409('0x29')]};});_0x5edcdc=qs[_0x1409('0x2a')](_0x5a67c4,_0x469ad3);return interaction[_0x1409('0x2b')](_0x1409('0x2c'),_0x469ad3[_0x1409('0x2d')],_0x469ad3[_0x1409('0x2e')],_0x5edcdc,_0x5a67c4)[_0x1409('0x1f')](respondWithFilteredResult(_0x1e5aa8,_0x5edcdc))[_0x1409('0x2f')](handleError(_0x1e5aa8,null));};exports['show']=function(_0xaebf9e,_0x53e9e0){var _0x3d9900={'raw':![],'where':{'id':_0xaebf9e[_0x1409('0x30')]['id']}},_0x4422a3={};_0x4422a3[_0x1409('0x31')]=_[_0x1409('0x32')](db[_0x1409('0x25')][_0x1409('0x26')]);_0x4422a3[_0x1409('0x2d')]=_['keys'](_0xaebf9e[_0x1409('0x2d')]);_0x4422a3[_0x1409('0x33')]=_[_0x1409('0x34')](_0x4422a3[_0x1409('0x31')],_0x4422a3['query']);_0x3d9900[_0x1409('0x35')]=_[_0x1409('0x34')](_0x4422a3[_0x1409('0x31')],qs['fields'](_0xaebf9e[_0x1409('0x2d')]['fields']));_0x3d9900[_0x1409('0x35')]=_0x3d9900[_0x1409('0x35')]['length']?_0x3d9900[_0x1409('0x35')]:_0x4422a3[_0x1409('0x31')];if(_0xaebf9e[_0x1409('0x2d')][_0x1409('0x36')]){_0x3d9900[_0x1409('0x37')]=[{'all':!![]}];}_0x3d9900=_['merge']({},_0x3d9900,_0xaebf9e[_0x1409('0x38')]);return db['MailInteraction'][_0x1409('0x39')](_0x3d9900)['then'](handleEntityNotFound(_0x53e9e0,null))['then'](respondWithResult(_0x53e9e0,null))[_0x1409('0x2f')](handleError(_0x53e9e0,null));};exports[_0x1409('0x3a')]=function(_0x74c3f9,_0x3dbd9a){return db[_0x1409('0x25')][_0x1409('0x3a')](_0x74c3f9['body'],{})['then'](respondWithResult(_0x3dbd9a,0xc9))['catch'](handleError(_0x3dbd9a,null));};exports['update']=function(_0x1e561c,_0xdc82af){if(_0x1e561c['body']['id']){delete _0x1e561c[_0x1409('0x3b')]['id'];}return db['MailInteraction'][_0x1409('0x39')]({'where':{'id':_0x1e561c[_0x1409('0x30')]['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0xdc82af,null))[_0x1409('0x1f')](saveUpdates(_0x1e561c[_0x1409('0x3b')],null))[_0x1409('0x1f')](respondWithResult(_0xdc82af,null))[_0x1409('0x2f')](handleError(_0xdc82af,null));};exports[_0x1409('0x3c')]=function(_0x57c8ce,_0x36eb0f){return db[_0x1409('0x25')]['find']({'where':{'id':_0x57c8ce[_0x1409('0x30')]['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0x36eb0f,null))[_0x1409('0x1f')](removeEntity(_0x36eb0f,null))[_0x1409('0x2f')](handleError(_0x36eb0f,null));};exports[_0x1409('0x3d')]=function(_0x493e7e,_0x233d74){return db[_0x1409('0x25')][_0x1409('0x3d')]()[_0x1409('0x1f')](respondWithResult(_0x233d74,null))[_0x1409('0x2f')](handleError(_0x233d74,null));};exports['addMessage']=function(_0x2ccee5,_0x4c8eeb){return db['MailMessage'][_0x1409('0x39')]({'where':{'id':_0x2ccee5[_0x1409('0x30')]['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0x4c8eeb,null))[_0x1409('0x1f')](function(_0x48b794){if(_0x48b794){return _0x48b794[_0x1409('0x3e')](_0x2ccee5[_0x1409('0x3b')][_0x1409('0x3f')],_['omit'](_0x2ccee5['body'],['ids','id'])||{});}})[_0x1409('0x1f')](respondWithResult(_0x4c8eeb,null))[_0x1409('0x2f')](handleError(_0x4c8eeb,null));};exports[_0x1409('0x40')]=function(_0x5d0e75,_0x53f18b){var _0x4d27e9={'raw':![],'where':{}};var _0x1ce789={};var _0x4e2244={'count':0x0,'rows':[]};return db['MailInteraction'][_0x1409('0x41')]({'where':{'id':_0x5d0e75[_0x1409('0x30')]['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0x53f18b,null))[_0x1409('0x1f')](function(_0x48f8b5){if(_0x48f8b5){_0x1ce789['model']=_[_0x1409('0x32')](db['MailMessage'][_0x1409('0x26')]);_0x1ce789[_0x1409('0x2d')]=_[_0x1409('0x32')](_0x5d0e75[_0x1409('0x2d')]);_0x1ce789[_0x1409('0x33')]=_[_0x1409('0x34')](_0x1ce789[_0x1409('0x31')],_0x1ce789[_0x1409('0x2d')]);_0x4d27e9[_0x1409('0x35')]=_[_0x1409('0x34')](_0x1ce789[_0x1409('0x31')],qs[_0x1409('0x42')](_0x5d0e75['query']['fields']));_0x4d27e9[_0x1409('0x35')]=_0x4d27e9[_0x1409('0x35')][_0x1409('0x43')]?_0x4d27e9[_0x1409('0x35')]:_0x1ce789[_0x1409('0x31')];if(!_0x5d0e75[_0x1409('0x2d')][_0x1409('0x44')](_0x1409('0x45'))){_0x4d27e9[_0x1409('0x1b')]=qs[_0x1409('0x1b')](_0x5d0e75[_0x1409('0x2d')][_0x1409('0x1b')]);_0x4d27e9['offset']=qs[_0x1409('0x18')](_0x5d0e75[_0x1409('0x2d')]['offset']);}_0x4d27e9[_0x1409('0x46')]=qs[_0x1409('0x47')](_0x5d0e75[_0x1409('0x2d')][_0x1409('0x47')]);_0x4d27e9['where']=qs[_0x1409('0x33')](_[_0x1409('0x48')](_0x5d0e75['query'],_0x1ce789[_0x1409('0x33')]));_0x4d27e9['where'][_0x1409('0x49')]=_0x48f8b5['id'];if(_0x5d0e75[_0x1409('0x2d')][_0x1409('0x4a')]){_0x4d27e9[_0x1409('0x4b')]=_[_0x1409('0x4c')](_0x4d27e9[_0x1409('0x4b')],{'$or':_[_0x1409('0x24')](_0x4d27e9['attributes'],function(_0x2d8e17){var _0x494ce5={};_0x494ce5[_0x2d8e17]={'$like':'%'+_0x5d0e75['query'][_0x1409('0x4a')]+'%'};return _0x494ce5;})});}if(_0x5d0e75[_0x1409('0x2d')][_0x1409('0x4d')]){var _0x54039d=_0x5d0e75[_0x1409('0x2d')][_0x1409('0x4d')][_0x1409('0x4e')](',');var _0x5d88ee={};_0x5d88ee[_0x54039d[0x0]]={'$gte':moment(_0x54039d[0x1])[_0x1409('0x4f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d27e9[_0x1409('0x4b')]=_[_0x1409('0x4c')](_0x4d27e9[_0x1409('0x4b')],_0x5d88ee);}_0x4d27e9=_[_0x1409('0x4c')]({},_0x4d27e9,_0x5d0e75[_0x1409('0x38')]);return db[_0x1409('0x50')][_0x1409('0x1a')]({'where':_0x4d27e9[_0x1409('0x4b')]})[_0x1409('0x1f')](function(_0x2791b0){_0x4e2244[_0x1409('0x1a')]=_0x2791b0;if(_0x5d0e75[_0x1409('0x2d')][_0x1409('0x36')]){_0x4d27e9[_0x1409('0x37')]=[{'all':!![]}];}return db[_0x1409('0x50')][_0x1409('0x2b')](_0x4d27e9);})[_0x1409('0x1f')](function(_0x4b3420){if(_0x5d0e75[_0x1409('0x2d')][_0x1409('0x51')]===_0x1409('0x52')){for(var _0x4d0b23=0x0;_0x4d0b23<_0x4b3420[_0x1409('0x43')];_0x4d0b23++){_0x4b3420[_0x4d0b23][_0x1409('0x3b')]=juice(_0x4b3420[_0x4d0b23][_0x1409('0x3b')]);}}_0x4e2244[_0x1409('0x53')]=_0x4b3420;return _0x4e2244;});}})[_0x1409('0x1f')](respondWithFilteredResult(_0x53f18b,_0x4d27e9))[_0x1409('0x2f')](handleError(_0x53f18b,null));};exports[_0x1409('0x54')]=function(_0x30b49,_0x1829ed){return db[_0x1409('0x25')][_0x1409('0x39')]({'where':{'id':_0x30b49['params']['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0x1829ed,null))[_0x1409('0x1f')](function(_0x1cb01b){if(_0x1cb01b){return _0x1cb01b[_0x1409('0x55')](_0x30b49[_0x1409('0x3b')][_0x1409('0x3f')],_['omit'](_0x30b49[_0x1409('0x3b')],[_0x1409('0x3f'),'id'])||{})[_0x1409('0x56')](function(){return db[_0x1409('0x57')][_0x1409('0x2b')]({'attributes':['id',_0x1409('0x21'),'color'],'where':{'id':_0x30b49[_0x1409('0x3b')][_0x1409('0x3f')]}});})[_0x1409('0x1f')](function(_0x2d8a72){socket['emit'](_0x1409('0x58'),{'id':Number(_0x30b49['params']['id']),'tags':_0x2d8a72||[]});return{'id':Number(_0x30b49[_0x1409('0x30')]['id']),'tags':_0x2d8a72||[]};});}})[_0x1409('0x1f')](respondWithResult(_0x1829ed,null))[_0x1409('0x2f')](handleError(_0x1829ed,null));};exports['removeTags']=function(_0x47e9de,_0x28a398){return db[_0x1409('0x25')][_0x1409('0x39')]({'where':{'id':_0x47e9de['params']['id']}})[_0x1409('0x1f')](handleEntityNotFound(_0x28a398,null))[_0x1409('0x1f')](function(_0x366a85){if(_0x366a85){return _0x366a85['removeTags'](_0x47e9de[_0x1409('0x2d')][_0x1409('0x3f')]);}})[_0x1409('0x1f')](respondWithStatusCode(_0x28a398,null))[_0x1409('0x2f')](handleError(_0x28a398,null));};exports[_0x1409('0x59')]=function(_0x1d2fdc,_0x2edbbc){var _0x24c4b1=moment()[_0x1409('0x5a')]()['toString']();var _0x13bf94=path[_0x1409('0x5b')](config[_0x1409('0x5c')],_0x1409('0x5d'),_0x1409('0x5e'),_0x1409('0x5f'));var _0x5bb142=path[_0x1409('0x5b')](config['root'],_0x1409('0x5d'),'files','attachments');var _0x575845=path[_0x1409('0x5b')](_0x13bf94,_0x24c4b1);var _0x58641b=util['format'](_0x1409('0x60'),_0x1d2fdc[_0x1409('0x30')]['id'],_0x24c4b1);var _0x23e399=path[_0x1409('0x5b')](_0x13bf94,_0x58641b);var _0x79fc76=[];if(_0x1d2fdc[_0x1409('0x2d')][_0x1409('0x61')]){_0x79fc76[_0x1409('0x62')]({'model':db['Attachment'],'as':_0x1409('0x63'),'raw':!![]});}var _0x12f77c=[{'model':db['MailMessage'],'as':_0x1409('0x64'),'attributes':['id','body',_0x1409('0x65'),'to','cc',_0x1409('0x66'),'subject',_0x1409('0x67')],'where':{'secret':![]},'order':qs[_0x1409('0x47')]('id'),'include':_0x79fc76}];return db[_0x1409('0x25')][_0x1409('0x39')]({'where':{'id':_0x1d2fdc[_0x1409('0x30')]['id']},'include':_0x12f77c})[_0x1409('0x1f')](handleEntityNotFound(_0x2edbbc,null))['then'](function(_0xb57f35){if(_0xb57f35&&_0xb57f35['Messages']){var _0x31152d=_0xb57f35[_0x1409('0x68')]({'plain':!![]});fs[_0x1409('0x69')](_0x575845);return BPromise[_0x1409('0x6a')](_0x31152d[_0x1409('0x64')],function(_0x19152d,_0x4092d8){var _0x52085a={'from':_0x19152d['from'],'to':_0x19152d['to']||'missing.recipient@your.company.com','subject':_0x19152d[_0x1409('0x6b')],'html':htmlEntities[_0x1409('0x6c')](_0x19152d[_0x1409('0x3b')]),'headers':{'Date':moment(_0x19152d[_0x1409('0x67')])[_0x1409('0x4f')](_0x1409('0x6d'))},'attachments':[]};if(_0x19152d['cc']){_0x52085a['headers']['Cc']=_0x19152d['cc'];}if(_0x19152d[_0x1409('0x66')]){_0x52085a[_0x1409('0x6e')][_0x1409('0x6f')]=_0x19152d[_0x1409('0x66')];}return new BPromise(function(_0x1b83ee,_0x56b43a){if(_0x19152d[_0x1409('0x63')]){for(var _0x45a602=0x0;_0x45a602<_0x19152d[_0x1409('0x63')][_0x1409('0x43')];_0x45a602++){var _0x47df0b=_0x19152d[_0x1409('0x63')][_0x45a602];var _0x5dfb6a=path[_0x1409('0x5b')](_0x5bb142,_0x47df0b[_0x1409('0x70')]);if(fs[_0x1409('0x71')](_0x5dfb6a)){_0x52085a[_0x1409('0x61')]['push']({'name':_0x47df0b['name'],'contentType':_0x47df0b[_0x1409('0x28')],'data':fs[_0x1409('0x72')](_0x5dfb6a)});}}}emlformat[_0x1409('0x73')](_0x52085a,function(_0x2cf3d8,_0xe9ccca){if(_0x2cf3d8)return _0x56b43a(_0x2cf3d8);fs[_0x1409('0x74')](path['join'](_0x575845,util[_0x1409('0x4f')](_0x1409('0x75'),_0x4092d8)),_0xe9ccca);return _0x1b83ee(_0xe9ccca);});});})['then'](function(){return new BPromise(function(_0x4f5f05,_0x1356d0){zipdir(_0x575845,{'saveTo':_0x23e399},function(_0x5f0917,_0x210c1d){if(_0x5f0917)return _0x1356d0(_0x5f0917);return _0x4f5f05(_0x210c1d);});})[_0x1409('0x1f')](function(){return new BPromise(function(_0x38eefa,_0x52025a){rimraf(_0x575845,function(_0x25c730){if(_0x25c730)_0x52025a(_0x25c730);return _0x38eefa();});});})[_0x1409('0x1f')](function(){return _0x2edbbc[_0x1409('0x59')](_0x23e399,_0x58641b,function(_0x5e8272){if(!_0x5e8272)fs[_0x1409('0x76')](_0x23e399);});});});}else{return _0x2edbbc[_0x1409('0x14')](0xc8);}})[_0x1409('0x2f')](handleError(_0x2edbbc,null));}; \ No newline at end of file +var _0x80e6=['findAll','mail','query','catch','model','keys','MailInteraction','filters','intersection','attributes','fields','include','merge','options','create','body','params','destroy','find','describe','addMessage','MailMessage','ids','findOne','length','hasOwnProperty','nolimit','limit','sort','where','MailInteractionId','filter','$gte','split','format','includeAll','inlineCss','true','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','missing.recipient@your.company.com','headers','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x80e6,0x120));var _0x680e=function(_0x42a42c,_0x3a0391){_0x42a42c=_0x42a42c-0x0;var _0x871f2f=_0x80e6[_0x42a42c];return _0x871f2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x680e('0x0'));var zipdir=require('zip-dir');var moment=require(_0x680e('0x1'));var BPromise=require(_0x680e('0x2'));var util=require('util');var path=require(_0x680e('0x3'));var fs=require('fs');var _=require(_0x680e('0x4'));var juice=require(_0x680e('0x5'));var Redis=require(_0x680e('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x680e('0x7'));var logger=require('../../config/logger')(_0x680e('0x8'));var config=require('../../config/environment');var db=require(_0x680e('0x9'))['db'];var htmlEntities=require(_0x680e('0xa'));config[_0x680e('0xb')]=_[_0x680e('0xc')](config[_0x680e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x680e('0xd'))(new Redis(config[_0x680e('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x11bc2f,_0x30b3d7){_0x30b3d7=_0x30b3d7||0xcc;return function(_0x4489c5){if(_0x4489c5){return _0x11bc2f[_0x680e('0xe')](_0x30b3d7);}return _0x11bc2f[_0x680e('0xf')](_0x30b3d7)[_0x680e('0x10')]();};}function respondWithResult(_0x5211cd,_0x193b35){_0x193b35=_0x193b35||0xc8;return function(_0x201be5){if(_0x201be5){return _0x5211cd[_0x680e('0xf')](_0x193b35)[_0x680e('0x11')](_0x201be5);}};}function respondWithFilteredResult(_0x181d2f,_0x25d9d4){return function(_0x6f6c9c){if(_0x6f6c9c){var _0x4d2de2=typeof _0x25d9d4[_0x680e('0x12')]==='undefined'&&typeof _0x25d9d4['limit']===_0x680e('0x13');var _0x45c3dc=_0x6f6c9c[_0x680e('0x14')];var _0x248525=_0x4d2de2?0x0:_0x25d9d4[_0x680e('0x12')];var _0x2e83d9=_0x4d2de2?_0x6f6c9c['count']:_0x25d9d4['offset']+_0x25d9d4['limit'];var _0x1a1469;if(_0x2e83d9>=_0x45c3dc){_0x2e83d9=_0x45c3dc;_0x1a1469=0xc8;}else{_0x1a1469=0xce;}_0x181d2f[_0x680e('0xf')](_0x1a1469);return _0x181d2f[_0x680e('0x15')](_0x680e('0x16'),_0x248525+'-'+_0x2e83d9+'/'+_0x45c3dc)[_0x680e('0x11')](_0x6f6c9c);}return null;};}function saveUpdates(_0x5d97b2){return function(_0x4630b2){if(_0x4630b2){return _0x4630b2[_0x680e('0x17')](_0x5d97b2)[_0x680e('0x18')](function(_0x464441){return _0x464441;});}return null;};}function removeEntity(_0x20a10f){return function(_0x99ba30){if(_0x99ba30){return _0x99ba30['destroy']()[_0x680e('0x18')](function(){_0x20a10f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19c616){return function(_0x472130){if(!_0x472130){_0x19c616[_0x680e('0xe')](0x194);}return _0x472130;};}function handleError(_0x532785,_0xeec072){_0xeec072=_0xeec072||0x1f4;return function(_0x4d8716){logger[_0x680e('0x19')](_0x4d8716[_0x680e('0x1a')]);if(_0x4d8716[_0x680e('0x1b')]){delete _0x4d8716[_0x680e('0x1b')];}_0x532785[_0x680e('0xf')](_0xeec072)[_0x680e('0x1c')](_0x4d8716);};}exports[_0x680e('0x1d')]=function(_0x57342b,_0x24e12a){var _0x4c5d34={};var _0x31bfeb=_[_0x680e('0x1e')](db['MailInteraction'][_0x680e('0x1f')],function(_0x5c3ce1){return{'name':_0x5c3ce1[_0x680e('0x20')],'type':_0x5c3ce1[_0x680e('0x21')][_0x680e('0x22')]};});_0x4c5d34=qs[_0x680e('0x23')](_0x31bfeb,_0x57342b);return interaction[_0x680e('0x24')](_0x680e('0x25'),_0x57342b[_0x680e('0x26')],_0x57342b['user'],_0x4c5d34,_0x31bfeb)['then'](respondWithFilteredResult(_0x24e12a,_0x4c5d34))[_0x680e('0x27')](handleError(_0x24e12a,null));};exports['show']=function(_0x1568f8,_0x4a63b9){var _0x253a9e={'raw':![],'where':{'id':_0x1568f8['params']['id']}},_0x52a311={};_0x52a311[_0x680e('0x28')]=_[_0x680e('0x29')](db[_0x680e('0x2a')][_0x680e('0x1f')]);_0x52a311[_0x680e('0x26')]=_[_0x680e('0x29')](_0x1568f8[_0x680e('0x26')]);_0x52a311[_0x680e('0x2b')]=_[_0x680e('0x2c')](_0x52a311[_0x680e('0x28')],_0x52a311[_0x680e('0x26')]);_0x253a9e[_0x680e('0x2d')]=_[_0x680e('0x2c')](_0x52a311[_0x680e('0x28')],qs['fields'](_0x1568f8['query'][_0x680e('0x2e')]));_0x253a9e[_0x680e('0x2d')]=_0x253a9e[_0x680e('0x2d')]['length']?_0x253a9e[_0x680e('0x2d')]:_0x52a311['model'];if(_0x1568f8['query']['includeAll']){_0x253a9e[_0x680e('0x2f')]=[{'all':!![]}];}_0x253a9e=_[_0x680e('0x30')]({},_0x253a9e,_0x1568f8[_0x680e('0x31')]);return db[_0x680e('0x2a')]['find'](_0x253a9e)[_0x680e('0x18')](handleEntityNotFound(_0x4a63b9,null))[_0x680e('0x18')](respondWithResult(_0x4a63b9,null))[_0x680e('0x27')](handleError(_0x4a63b9,null));};exports[_0x680e('0x32')]=function(_0x5c8c04,_0x4e7d35){return db[_0x680e('0x2a')]['create'](_0x5c8c04[_0x680e('0x33')],{})[_0x680e('0x18')](respondWithResult(_0x4e7d35,0xc9))[_0x680e('0x27')](handleError(_0x4e7d35,null));};exports['update']=function(_0x410e71,_0x204b8e){if(_0x410e71[_0x680e('0x33')]['id']){delete _0x410e71[_0x680e('0x33')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x410e71[_0x680e('0x34')]['id']}})['then'](handleEntityNotFound(_0x204b8e,null))[_0x680e('0x18')](saveUpdates(_0x410e71[_0x680e('0x33')],null))['then'](respondWithResult(_0x204b8e,null))[_0x680e('0x27')](handleError(_0x204b8e,null));};exports[_0x680e('0x35')]=function(_0x289382,_0x1895a0){return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x289382['params']['id']}})['then'](handleEntityNotFound(_0x1895a0,null))[_0x680e('0x18')](removeEntity(_0x1895a0,null))[_0x680e('0x27')](handleError(_0x1895a0,null));};exports[_0x680e('0x37')]=function(_0x1132e9,_0x26132c){return db[_0x680e('0x2a')]['describe']()[_0x680e('0x18')](respondWithResult(_0x26132c,null))[_0x680e('0x27')](handleError(_0x26132c,null));};exports[_0x680e('0x38')]=function(_0x2bc147,_0x1e0975){return db[_0x680e('0x39')]['find']({'where':{'id':_0x2bc147[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x1e0975,null))['then'](function(_0x24da3d){if(_0x24da3d){return _0x24da3d[_0x680e('0x38')](_0x2bc147[_0x680e('0x33')][_0x680e('0x3a')],_['omit'](_0x2bc147['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1e0975,null))[_0x680e('0x27')](handleError(_0x1e0975,null));};exports['getMessages']=function(_0x2ecc73,_0x3ba785){var _0x51dd09={'raw':![],'where':{}};var _0x1092fd={};var _0xe02198={'count':0x0,'rows':[]};return db[_0x680e('0x2a')][_0x680e('0x3b')]({'where':{'id':_0x2ecc73[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x3ba785,null))[_0x680e('0x18')](function(_0x4d8b31){if(_0x4d8b31){_0x1092fd[_0x680e('0x28')]=_[_0x680e('0x29')](db[_0x680e('0x39')][_0x680e('0x1f')]);_0x1092fd[_0x680e('0x26')]=_[_0x680e('0x29')](_0x2ecc73['query']);_0x1092fd[_0x680e('0x2b')]=_[_0x680e('0x2c')](_0x1092fd[_0x680e('0x28')],_0x1092fd[_0x680e('0x26')]);_0x51dd09[_0x680e('0x2d')]=_[_0x680e('0x2c')](_0x1092fd[_0x680e('0x28')],qs[_0x680e('0x2e')](_0x2ecc73[_0x680e('0x26')]['fields']));_0x51dd09[_0x680e('0x2d')]=_0x51dd09[_0x680e('0x2d')][_0x680e('0x3c')]?_0x51dd09[_0x680e('0x2d')]:_0x1092fd[_0x680e('0x28')];if(!_0x2ecc73['query'][_0x680e('0x3d')](_0x680e('0x3e'))){_0x51dd09[_0x680e('0x3f')]=qs['limit'](_0x2ecc73[_0x680e('0x26')][_0x680e('0x3f')]);_0x51dd09[_0x680e('0x12')]=qs['offset'](_0x2ecc73[_0x680e('0x26')]['offset']);}_0x51dd09['order']=qs[_0x680e('0x40')](_0x2ecc73['query'][_0x680e('0x40')]);_0x51dd09[_0x680e('0x41')]=qs[_0x680e('0x2b')](_['pick'](_0x2ecc73[_0x680e('0x26')],_0x1092fd['filters']));_0x51dd09[_0x680e('0x41')][_0x680e('0x42')]=_0x4d8b31['id'];if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x43')]){_0x51dd09[_0x680e('0x41')]=_[_0x680e('0x30')](_0x51dd09[_0x680e('0x41')],{'$or':_['map'](_0x51dd09[_0x680e('0x2d')],function(_0x5b8e7d){var _0x1ed61a={};_0x1ed61a[_0x5b8e7d]={'$like':'%'+_0x2ecc73[_0x680e('0x26')][_0x680e('0x43')]+'%'};return _0x1ed61a;})});}if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x44')]){var _0x2caf92=_0x2ecc73[_0x680e('0x26')]['$gte'][_0x680e('0x45')](',');var _0x3420e2={};_0x3420e2[_0x2caf92[0x0]]={'$gte':moment(_0x2caf92[0x1])[_0x680e('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x51dd09['where']=_[_0x680e('0x30')](_0x51dd09['where'],_0x3420e2);}_0x51dd09=_[_0x680e('0x30')]({},_0x51dd09,_0x2ecc73[_0x680e('0x31')]);return db[_0x680e('0x39')]['count']({'where':_0x51dd09[_0x680e('0x41')]})[_0x680e('0x18')](function(_0x1e6dba){_0xe02198[_0x680e('0x14')]=_0x1e6dba;if(_0x2ecc73['query'][_0x680e('0x47')]){_0x51dd09['include']=[{'all':!![]}];}return db[_0x680e('0x39')][_0x680e('0x24')](_0x51dd09);})[_0x680e('0x18')](function(_0x3b1afa){if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x48')]===_0x680e('0x49')){for(var _0x38b869=0x0;_0x38b869<_0x3b1afa['length'];_0x38b869++){_0x3b1afa[_0x38b869]['body']=juice(_0x3b1afa[_0x38b869]['body']);}}_0xe02198[_0x680e('0x4a')]=_0x3b1afa;return _0xe02198;});}})[_0x680e('0x18')](respondWithFilteredResult(_0x3ba785,_0x51dd09))[_0x680e('0x27')](handleError(_0x3ba785,null));};exports[_0x680e('0x4b')]=function(_0x13c1b4,_0x43a600){return db[_0x680e('0x2a')]['find']({'where':{'id':_0x13c1b4[_0x680e('0x34')]['id']}})['then'](handleEntityNotFound(_0x43a600,null))[_0x680e('0x18')](function(_0x1a8896){if(_0x1a8896){return _0x1a8896[_0x680e('0x4c')](_0x13c1b4[_0x680e('0x33')][_0x680e('0x3a')],_['omit'](_0x13c1b4[_0x680e('0x33')],[_0x680e('0x3a'),'id'])||{})[_0x680e('0x4d')](function(){return db['Tag'][_0x680e('0x24')]({'attributes':['id',_0x680e('0x1b'),_0x680e('0x4e')],'where':{'id':_0x13c1b4[_0x680e('0x33')][_0x680e('0x3a')]}});})['then'](function(_0x27e5c4){socket[_0x680e('0x4f')](_0x680e('0x50'),{'id':Number(_0x13c1b4[_0x680e('0x34')]['id']),'tags':_0x27e5c4||[]});return{'id':Number(_0x13c1b4[_0x680e('0x34')]['id']),'tags':_0x27e5c4||[]};});}})[_0x680e('0x18')](respondWithResult(_0x43a600,null))[_0x680e('0x27')](handleError(_0x43a600,null));};exports[_0x680e('0x51')]=function(_0x1cfef5,_0x14ab59){return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x1cfef5[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x14ab59,null))['then'](function(_0x374886){if(_0x374886){return _0x374886[_0x680e('0x51')](_0x1cfef5[_0x680e('0x26')][_0x680e('0x3a')]);}})[_0x680e('0x18')](respondWithStatusCode(_0x14ab59,null))[_0x680e('0x27')](handleError(_0x14ab59,null));};exports[_0x680e('0x52')]=function(_0x2487de,_0x5011a4){var _0x5444a4=moment()[_0x680e('0x53')]()[_0x680e('0x54')]();var _0x117e11=path[_0x680e('0x55')](config[_0x680e('0x56')],_0x680e('0x57'),_0x680e('0x58'),_0x680e('0x59'));var _0x372910=path[_0x680e('0x55')](config[_0x680e('0x56')],_0x680e('0x57'),'files',_0x680e('0x5a'));var _0x4ac10f=path['join'](_0x117e11,_0x5444a4);var _0x246e62=util['format']('transcript-%d-%s.zip',_0x2487de[_0x680e('0x34')]['id'],_0x5444a4);var _0xb72e88=path[_0x680e('0x55')](_0x117e11,_0x246e62);var _0x1ce60b=[];if(_0x2487de[_0x680e('0x26')][_0x680e('0x5a')]){_0x1ce60b[_0x680e('0x5b')]({'model':db[_0x680e('0x5c')],'as':_0x680e('0x5d'),'raw':!![]});}var _0x3aebdb=[{'model':db['MailMessage'],'as':_0x680e('0x5e'),'attributes':['id',_0x680e('0x33'),_0x680e('0x5f'),'to','cc',_0x680e('0x60'),_0x680e('0x61'),_0x680e('0x62')],'where':{'secret':![]},'order':qs[_0x680e('0x40')]('id'),'include':_0x1ce60b}];return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x2487de[_0x680e('0x34')]['id']},'include':_0x3aebdb})[_0x680e('0x18')](handleEntityNotFound(_0x5011a4,null))['then'](function(_0xe340d7){if(_0xe340d7&&_0xe340d7[_0x680e('0x5e')]){var _0x2af460=_0xe340d7['get']({'plain':!![]});fs[_0x680e('0x63')](_0x4ac10f);return BPromise['each'](_0x2af460[_0x680e('0x5e')],function(_0x288d54,_0x223776){var _0x24511b={'from':_0x288d54['from'],'to':_0x288d54['to']||_0x680e('0x64'),'subject':_0x288d54[_0x680e('0x61')],'html':htmlEntities['decode'](_0x288d54['body']),'headers':{'Date':moment(_0x288d54['createdAt'])[_0x680e('0x46')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x288d54['cc']){_0x24511b[_0x680e('0x65')]['Cc']=_0x288d54['cc'];}if(_0x288d54['bcc']){_0x24511b[_0x680e('0x65')]['Bcc']=_0x288d54[_0x680e('0x60')];}return new BPromise(function(_0x4d84c3,_0x2a1adf){if(_0x288d54[_0x680e('0x5d')]){for(var _0x3c6766=0x0;_0x3c6766<_0x288d54[_0x680e('0x5d')][_0x680e('0x3c')];_0x3c6766++){var _0x2de410=_0x288d54[_0x680e('0x5d')][_0x3c6766];var _0x57f2a2=path['join'](_0x372910,_0x2de410[_0x680e('0x66')]);if(fs['existsSync'](_0x57f2a2)){_0x24511b[_0x680e('0x5a')]['push']({'name':_0x2de410[_0x680e('0x1b')],'contentType':_0x2de410[_0x680e('0x21')],'data':fs[_0x680e('0x67')](_0x57f2a2)});}}}emlformat[_0x680e('0x68')](_0x24511b,function(_0x416aa7,_0x109852){if(_0x416aa7)return _0x2a1adf(_0x416aa7);fs[_0x680e('0x69')](path[_0x680e('0x55')](_0x4ac10f,util[_0x680e('0x46')](_0x680e('0x6a'),_0x223776)),_0x109852);return _0x4d84c3(_0x109852);});});})[_0x680e('0x18')](function(){return new BPromise(function(_0x45878f,_0x5c5ad8){zipdir(_0x4ac10f,{'saveTo':_0xb72e88},function(_0x704baa,_0x115113){if(_0x704baa)return _0x5c5ad8(_0x704baa);return _0x45878f(_0x115113);});})[_0x680e('0x18')](function(){return new BPromise(function(_0x4692cd,_0x561db9){rimraf(_0x4ac10f,function(_0x294d16){if(_0x294d16)_0x561db9(_0x294d16);return _0x4692cd();});});})[_0x680e('0x18')](function(){return _0x5011a4[_0x680e('0x52')](_0xb72e88,_0x246e62,function(_0xdd6533){if(!_0xdd6533)fs[_0x680e('0x6b')](_0xb72e88);});});});}else{return _0x5011a4['sendStatus'](0xc8);}})[_0x680e('0x27')](handleError(_0x5011a4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9836e15..468a01f 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 _0x5104=['exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x5104,0x1bb));var _0x4510=function(_0xe7400f,_0x573b7d){_0xe7400f=_0xe7400f-0x0;var _0x2990f7=_0x5104[_0xe7400f];return _0x2990f7;};'use strict';var EventEmitter=require(_0x4510('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4510('0x1')];var MailMessage=require(_0x4510('0x2'))['db'][_0x4510('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4510('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4510('0x5')};function emitEvent(_0x3d6e06){return function(_0x572c75,_0x3e0d2c,_0x115aed){_0x572c75['getUsers']({'attributes':['id'],'raw':!![]})[_0x4510('0x6')](function(_0x27b5d8){_0x572c75[_0x4510('0x7')](_0x4510('0x8'),_0x27b5d8[_0x4510('0x9')](function(_0x2d5640){return{'id':_0x2d5640['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x572c75['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4510('0x6')](function(_0x290cb8){_0x572c75[_0x4510('0x7')](_0x4510('0xa'),_0x290cb8[_0x4510('0xb')]);MailInteractionEvents[_0x4510('0xc')](_0x3d6e06+':'+_0x572c75['id'],_0x572c75);MailInteractionEvents[_0x4510('0xc')](_0x3d6e06,_0x572c75);_0x115aed(null);})[_0x4510('0xd')](_0x115aed(null));};}for(var e in events){if(events[_0x4510('0xe')](e)){var event=events[e];MailInteraction[_0x4510('0xf')](e,emitEvent(event));}}module[_0x4510('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x6b7f=['catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','length','emit'];(function(_0x4db098,_0x2272b1){var _0x941ba2=function(_0x4e2593){while(--_0x4e2593){_0x4db098['push'](_0x4db098['shift']());}};_0x941ba2(++_0x2272b1);}(_0x6b7f,0x64));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xf6b7('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xf6b7('0x0'))['db'][_0xf6b7('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf6b7('0x2')](0x0);var events={'afterCreate':_0xf6b7('0x3'),'afterUpdate':_0xf6b7('0x4'),'afterDestroy':_0xf6b7('0x5')};function emitEvent(_0x1ebbef){return function(_0x2abdfa,_0x5df4d1,_0x10bcc5){_0x2abdfa['getUsers']({'attributes':['id'],'raw':!![]})[_0xf6b7('0x6')](function(_0x2b15f9){_0x2abdfa[_0xf6b7('0x7')]('Users',_0x2b15f9[_0xf6b7('0x8')](function(_0x5231b2){return{'id':_0x5231b2['id']};}));return MailMessage[_0xf6b7('0x9')]({'where':{'MailInteractionId':_0x2abdfa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2639ed){_0x2abdfa[_0xf6b7('0x7')]('unreadMessages',_0x2639ed[_0xf6b7('0xa')]);MailInteractionEvents[_0xf6b7('0xb')](_0x1ebbef+':'+_0x2abdfa['id'],_0x2abdfa);MailInteractionEvents['emit'](_0x1ebbef,_0x2abdfa);_0x10bcc5(null);})[_0xf6b7('0xc')](_0x10bcc5(null));};}for(var e in events){if(events[_0xf6b7('0xd')](e)){var event=events[e];MailInteraction[_0xf6b7('0xe')](e,emitEvent(event));}}module[_0xf6b7('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 823b7b1..5114c6c 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 _0xf2ea=['path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','MailMessage','update','then','utf8mb4','lodash','../../config/logger','request-promise'];(function(_0x30f30f,_0x1cce2e){var _0x5b65e1=function(_0x5c1c72){while(--_0x5c1c72){_0x30f30f['push'](_0x30f30f['shift']());}};_0x5b65e1(++_0x1cce2e);}(_0xf2ea,0xb3));var _0xaf2e=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xf2ea[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xaf2e('0x0'));var util=require('util');var logger=require(_0xaf2e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf2e('0x2'));var fs=require('fs');var path=require(_0xaf2e('0x3'));var rimraf=require(_0xaf2e('0x4'));var config=require('../../config/environment');var attributes=require(_0xaf2e('0x5'));module[_0xaf2e('0x6')]=function(_0x2945cc,_0xf501e0){return _0x2945cc[_0xaf2e('0x7')](_0xaf2e('0x8'),attributes,{'tableName':_0xaf2e('0x9'),'paranoid':![],'indexes':[{'name':_0xaf2e('0xa'),'fields':[_0xaf2e('0xb'),'to'],'type':_0xaf2e('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5301c2,_0x85d7f9,_0xa971ab){if(_0x5301c2[_0xaf2e('0xd')]){_0x5301c2[_0xaf2e('0xe')]=moment()[_0xaf2e('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5301c2[_0xaf2e('0x10')]){_0x5301c2['closedAt']=moment()[_0xaf2e('0xf')](_0xaf2e('0x11'));}_0xa971ab(null,_0x85d7f9);},'beforeUpdate':function(_0x49d422,_0x262c30,_0x33f6e2){if(_0x49d422[_0xaf2e('0x12')](_0xaf2e('0xd'))){_0x49d422['substatusAt']=_0x49d422[_0xaf2e('0xd')]?moment()[_0xaf2e('0xf')](_0xaf2e('0x11')):null;}if(_0x49d422['changed'](_0xaf2e('0x10'))){_0x49d422[_0xaf2e('0x13')]=moment()[_0xaf2e('0xf')](_0xaf2e('0x11'));_0x49d422[_0xaf2e('0xd')]=null;_0x49d422[_0xaf2e('0xe')]=null;}_0x33f6e2(null,_0x49d422);},'afterUpdate':function(_0x55c189,_0x5000ef,_0x570384){var _0x398887=_0x2945cc[_0xaf2e('0x14')];var _0x2676b3=_0x55c189[_0xaf2e('0x15')]({'plain':!![]});if(_0x2676b3['closed']){return _0x398887[_0xaf2e('0x16')][_0xaf2e('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x2676b3['id']}})[_0xaf2e('0x18')](function(){_0x570384();})['catch'](function(_0x46a79a){_0x570384(_0x46a79a);});}else{_0x570384();}}},'charset':_0xaf2e('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7aaf=['substatusAt','models','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x7aaf,0x11a));var _0xf7aa=function(_0x324392,_0x2dfc37){_0x324392=_0x324392-0x0;var _0x4557eb=_0x7aaf[_0x324392];return _0x4557eb;};'use strict';var _=require(_0xf7aa('0x0'));var util=require(_0xf7aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf7aa('0x2'));var BPromise=require(_0xf7aa('0x3'));var rp=require(_0xf7aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7aa('0x5'));var attributes=require(_0xf7aa('0x6'));module['exports']=function(_0x38a8ed,_0x3b7810){return _0x38a8ed['define'](_0xf7aa('0x7'),attributes,{'tableName':_0xf7aa('0x8'),'paranoid':![],'indexes':[{'name':_0xf7aa('0x9'),'fields':[_0xf7aa('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16f624,_0x55b2d9,_0x1da5fb){if(_0x16f624['substatus']){_0x16f624['substatusAt']=moment()[_0xf7aa('0xb')](_0xf7aa('0xc'));}if(_0x16f624[_0xf7aa('0xd')]){_0x16f624[_0xf7aa('0xe')]=moment()['format'](_0xf7aa('0xc'));}_0x1da5fb(null,_0x55b2d9);},'beforeUpdate':function(_0x313c74,_0x5b142e,_0x455779){if(_0x313c74[_0xf7aa('0xf')](_0xf7aa('0x10'))){_0x313c74[_0xf7aa('0x11')]=_0x313c74['substatus']?moment()[_0xf7aa('0xb')](_0xf7aa('0xc')):null;}if(_0x313c74[_0xf7aa('0xf')]('closed')){_0x313c74[_0xf7aa('0xe')]=moment()['format'](_0xf7aa('0xc'));_0x313c74[_0xf7aa('0x10')]=null;_0x313c74[_0xf7aa('0x11')]=null;}_0x455779(null,_0x313c74);},'afterUpdate':function(_0x5abd5a,_0x3a0b85,_0x40d155){var _0x2bcf66=_0x38a8ed[_0xf7aa('0x12')];var _0x28e8a1=_0x5abd5a['get']({'plain':!![]});if(_0x28e8a1['closed']){return _0x2bcf66['MailMessage'][_0xf7aa('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x28e8a1['id']}})['then'](function(){_0x40d155();})[_0xf7aa('0x14')](function(_0x3f3e2a){_0x40d155(_0x3f3e2a);});}else{_0x40d155();}}},'charset':_0xf7aa('0x15'),'collate':_0xf7aa('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 683e0e6..801a46f 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 _0x02a7=['ids','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x553ac9,_0x45b83e){var _0x5235f3=function(_0xb0b6d4){while(--_0xb0b6d4){_0x553ac9['push'](_0x553ac9['shift']());}};_0x5235f3(++_0x45b83e);}(_0x02a7,0x7a));var _0x702a=function(_0x473f6e,_0x18879e){_0x473f6e=_0x473f6e-0x0;var _0x1b00af=_0x02a7[_0x473f6e];return _0x1b00af;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x702a('0x1'));var fs=require('fs');var Redis=require(_0x702a('0x2'));var db=require(_0x702a('0x3'))['db'];var utils=require(_0x702a('0x4'));var logger=require(_0x702a('0x5'))(_0x702a('0x6'));var config=require(_0x702a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x702a('0x8')]['http']({'port':0x232a});config[_0x702a('0x9')]=_[_0x702a('0xa')](config[_0x702a('0x9')],{'host':_0x702a('0xb'),'port':0x18eb});var socket=require(_0x702a('0xc'))(new Redis(config[_0x702a('0x9')]));require(_0x702a('0xd'))['register'](socket);function respondWithRpcPromise(_0x15acfb,_0x5293c6,_0x5c83a4){return new BPromise(function(_0x302c23,_0x3b81cb){return client[_0x702a('0xe')](_0x15acfb,_0x5c83a4)[_0x702a('0xf')](function(_0x534ae1){logger[_0x702a('0x10')](_0x702a('0x11'),_0x5293c6,_0x702a('0x12'));logger[_0x702a('0x13')](_0x702a('0x14'),_0x5293c6,_0x702a('0x12'),JSON[_0x702a('0x15')](_0x534ae1));if(_0x534ae1['error']){if(_0x534ae1['error'][_0x702a('0x16')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5293c6,_0x534ae1['error']['message']);return _0x3b81cb(_0x534ae1['error'][_0x702a('0x17')]);}logger[_0x702a('0x18')](_0x702a('0x11'),_0x5293c6,_0x534ae1['error']['message']);return _0x302c23(_0x534ae1['error'][_0x702a('0x17')]);}else{logger[_0x702a('0x10')](_0x702a('0x11'),_0x5293c6,'request\x20sent');_0x302c23(_0x534ae1[_0x702a('0x19')]['message']);}})[_0x702a('0x1a')](function(_0x2c3b0d){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5293c6,_0x2c3b0d);_0x3b81cb(_0x2c3b0d);});});}exports[_0x702a('0x1b')]=function(_0x18b8a0){var _0x1845a2=this;return new Promise(function(_0x2765d0,_0x332254){return db[_0x702a('0x1c')][_0x702a('0x1d')](_0x18b8a0[_0x702a('0x1e')],{'raw':_0x18b8a0[_0x702a('0x1f')]?_0x18b8a0[_0x702a('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b8a0[_0x702a('0x1f')]?_0x18b8a0[_0x702a('0x1f')][_0x702a('0x20')]||null:null,'attributes':_0x18b8a0[_0x702a('0x1f')]?_0x18b8a0[_0x702a('0x1f')][_0x702a('0x21')]||null:null,'limit':_0x18b8a0[_0x702a('0x1f')]?_0x18b8a0[_0x702a('0x1f')][_0x702a('0x22')]||null:null})['then'](function(_0xc5329a){logger[_0x702a('0x10')]('UpdateMailInteraction',_0x18b8a0);logger[_0x702a('0x13')](_0x702a('0x1b'),_0x18b8a0,JSON[_0x702a('0x15')](_0xc5329a));_0x2765d0(_0xc5329a);})[_0x702a('0x1a')](function(_0x3d4ed0){logger[_0x702a('0x18')]('UpdateMailInteraction',_0x3d4ed0[_0x702a('0x17')],_0x18b8a0);_0x332254(_0x1845a2[_0x702a('0x18')](0x1f4,_0x3d4ed0['message']));});});};exports[_0x702a('0x23')]=function(_0x854763){return new Promise(function(_0xaa1f3d,_0x21ba99){return db[_0x702a('0x1c')][_0x702a('0x24')]({'where':_0x854763[_0x702a('0x1f')]?_0x854763['options'][_0x702a('0x20')]||null:null})[_0x702a('0xf')](function(_0x6ac060){if(_0x6ac060){return _0x6ac060[_0x702a('0x25')](_0x854763[_0x702a('0x1e')][_0x702a('0x26')],_['omit'](_0x854763[_0x702a('0x1e')],[_0x702a('0x26'),'id'])||{});}})['spread'](function(_0x584e57){logger[_0x702a('0x10')](_0x702a('0x27'),_0x854763);logger['debug'](_0x702a('0x27'),_0x854763,JSON['stringify'](_0x584e57));_0xaa1f3d(_0x584e57);})['catch'](function(_0x3bcf4c){logger[_0x702a('0x18')](_0x702a('0x27'),_0x3bcf4c['message'],_0x854763);_0x21ba99(_this[_0x702a('0x18')](0x1f4,_0x3bcf4c[_0x702a('0x17')]));});});}; \ No newline at end of file +var _0x4649=['omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x4ba0ef,_0x23d774){var _0x2465fc=function(_0x2d840a){while(--_0x2d840a){_0x4ba0ef['push'](_0x4ba0ef['shift']());}};_0x2465fc(++_0x23d774);}(_0x4649,0x199));var _0x9464=function(_0x222043,_0x4e436d){_0x222043=_0x222043-0x0;var _0xfbe4b3=_0x4649[_0x222043];return _0xfbe4b3;};'use strict';var _=require(_0x9464('0x0'));var util=require('util');var moment=require(_0x9464('0x1'));var BPromise=require(_0x9464('0x2'));var rs=require(_0x9464('0x3'));var fs=require('fs');var Redis=require(_0x9464('0x4'));var db=require(_0x9464('0x5'))['db'];var utils=require(_0x9464('0x6'));var logger=require(_0x9464('0x7'))('rpc');var config=require(_0x9464('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9464('0x9')][_0x9464('0xa')]({'port':0x232a});config[_0x9464('0xb')]=_[_0x9464('0xc')](config['redis'],{'host':_0x9464('0xd'),'port':0x18eb});var socket=require(_0x9464('0xe'))(new Redis(config[_0x9464('0xb')]));require(_0x9464('0xf'))[_0x9464('0x10')](socket);function respondWithRpcPromise(_0x5d850a,_0x2480cb,_0x5a4436){return new BPromise(function(_0x1dc525,_0x13bef3){return client[_0x9464('0x11')](_0x5d850a,_0x5a4436)[_0x9464('0x12')](function(_0x7c211d){logger[_0x9464('0x13')]('MailInteraction,\x20%s,\x20%s',_0x2480cb,_0x9464('0x14'));logger[_0x9464('0x15')](_0x9464('0x16'),_0x2480cb,_0x9464('0x14'),JSON[_0x9464('0x17')](_0x7c211d));if(_0x7c211d['error']){if(_0x7c211d[_0x9464('0x18')][_0x9464('0x19')]===0x1f4){logger[_0x9464('0x18')](_0x9464('0x1a'),_0x2480cb,_0x7c211d[_0x9464('0x18')][_0x9464('0x1b')]);return _0x13bef3(_0x7c211d['error']['message']);}logger['error'](_0x9464('0x1a'),_0x2480cb,_0x7c211d['error']['message']);return _0x1dc525(_0x7c211d['error'][_0x9464('0x1b')]);}else{logger[_0x9464('0x13')](_0x9464('0x1a'),_0x2480cb,_0x9464('0x14'));_0x1dc525(_0x7c211d[_0x9464('0x1c')][_0x9464('0x1b')]);}})[_0x9464('0x1d')](function(_0x588430){logger[_0x9464('0x18')](_0x9464('0x1a'),_0x2480cb,_0x588430);_0x13bef3(_0x588430);});});}exports[_0x9464('0x1e')]=function(_0x11e019){var _0x427ed7=this;return new Promise(function(_0xf0eca5,_0x2ce7e6){return db[_0x9464('0x1f')][_0x9464('0x20')](_0x11e019[_0x9464('0x21')],{'raw':_0x11e019[_0x9464('0x22')]?_0x11e019['options'][_0x9464('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11e019['options']?_0x11e019[_0x9464('0x22')][_0x9464('0x24')]||null:null,'attributes':_0x11e019[_0x9464('0x22')]?_0x11e019[_0x9464('0x22')]['attributes']||null:null,'limit':_0x11e019['options']?_0x11e019[_0x9464('0x22')][_0x9464('0x25')]||null:null})[_0x9464('0x12')](function(_0x1f1b0c){logger[_0x9464('0x13')](_0x9464('0x1e'),_0x11e019);logger[_0x9464('0x15')](_0x9464('0x1e'),_0x11e019,JSON[_0x9464('0x17')](_0x1f1b0c));_0xf0eca5(_0x1f1b0c);})['catch'](function(_0x5549f0){logger[_0x9464('0x18')](_0x9464('0x1e'),_0x5549f0['message'],_0x11e019);_0x2ce7e6(_0x427ed7[_0x9464('0x18')](0x1f4,_0x5549f0['message']));});});};exports[_0x9464('0x26')]=function(_0xf82f6c){return new Promise(function(_0x321a8a,_0x37a1e2){return db[_0x9464('0x1f')][_0x9464('0x27')]({'where':_0xf82f6c[_0x9464('0x22')]?_0xf82f6c[_0x9464('0x22')][_0x9464('0x24')]||null:null})[_0x9464('0x12')](function(_0x2c0e07){if(_0x2c0e07){return _0x2c0e07[_0x9464('0x28')](_0xf82f6c[_0x9464('0x21')]['ids'],_[_0x9464('0x29')](_0xf82f6c[_0x9464('0x21')],[_0x9464('0x2a'),'id'])||{});}})[_0x9464('0x2b')](function(_0x38c5ac){logger[_0x9464('0x13')](_0x9464('0x2c'),_0xf82f6c);logger[_0x9464('0x15')](_0x9464('0x2c'),_0xf82f6c,JSON[_0x9464('0x17')](_0x38c5ac));_0x321a8a(_0x38c5ac);})[_0x9464('0x1d')](function(_0x120fe3){logger[_0x9464('0x18')](_0x9464('0x2c'),_0x120fe3[_0x9464('0x1b')],_0xf82f6c);_0x37a1e2(_this[_0x9464('0x18')](0x1f4,_0x120fe3[_0x9464('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index ce00dd0..6d3bf67 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 _0x02c6=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x508986,_0x43d040){var _0x25d13a=function(_0x514412){while(--_0x514412){_0x508986['push'](_0x508986['shift']());}};_0x25d13a(++_0x43d040);}(_0x02c6,0x162));var _0x602c=function(_0x2d8ca8,_0x22bcb6){_0x2d8ca8=_0x2d8ca8-0x0;var _0x268164=_0x02c6[_0x2d8ca8];return _0x268164;};'use strict';var MailInteractionEvents=require(_0x602c('0x0'));var events=[_0x602c('0x1'),_0x602c('0x2'),_0x602c('0x3')];function createListener(_0x563bf4,_0x267e84){return function(_0x3b2ac3){_0x267e84[_0x602c('0x4')](_0x563bf4,_0x3b2ac3);};}function removeListener(_0x58550c,_0x5744e5){return function(){MailInteractionEvents[_0x602c('0x5')](_0x58550c,_0x5744e5);};}exports['register']=function(_0x4fb20b){for(var _0xa67f26=0x0,_0x4775ac=events[_0x602c('0x6')];_0xa67f26<_0x4775ac;_0xa67f26++){var _0xf671bd=events[_0xa67f26];var _0x4928ec=createListener(_0x602c('0x7')+_0xf671bd,_0x4fb20b);MailInteractionEvents['on'](_0xf671bd,_0x4928ec);}}; \ No newline at end of file +var _0x09d8=['register','length','mailInteraction:','./mailInteraction.events','update'];(function(_0x533a4f,_0x4b9ddc){var _0x32fd1e=function(_0x373f64){while(--_0x373f64){_0x533a4f['push'](_0x533a4f['shift']());}};_0x32fd1e(++_0x4b9ddc);}(_0x09d8,0x12f));var _0x809d=function(_0x3f3663,_0xa80fa8){_0x3f3663=_0x3f3663-0x0;var _0x3b9dd0=_0x09d8[_0x3f3663];return _0x3b9dd0;};'use strict';var MailInteractionEvents=require(_0x809d('0x0'));var events=['save','remove',_0x809d('0x1')];function createListener(_0x425182,_0x474d96){return function(_0x1a85dc){_0x474d96['emit'](_0x425182,_0x1a85dc);};}function removeListener(_0x585699,_0x5814ae){return function(){MailInteractionEvents['removeListener'](_0x585699,_0x5814ae);};}exports[_0x809d('0x2')]=function(_0x555bf7){for(var _0x4655be=0x0,_0xce8bd9=events[_0x809d('0x3')];_0x4655be<_0xce8bd9;_0x4655be++){var _0x3cb42c=events[_0x4655be];var _0x1e21c6=createListener(_0x809d('0x4')+_0x3cb42c,_0x555bf7);MailInteractionEvents['on'](_0x3cb42c,_0x1e21c6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b043057..8261089 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 _0x09dd=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','get','/:id','show','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete'];(function(_0x5e7648,_0x2aa20d){var _0x28431b=function(_0x687a63){while(--_0x687a63){_0x5e7648['push'](_0x5e7648['shift']());}};_0x28431b(++_0x2aa20d);}(_0x09dd,0xb7));var _0xd09d=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0x09dd[_0x55969b];return _0x3d7fc1;};'use strict';var multer=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var path=require(_0xd09d('0x2'));var timeout=require(_0xd09d('0x3'));var express=require(_0xd09d('0x4'));var router=express[_0xd09d('0x5')]();var fs_extra=require(_0xd09d('0x6'));var auth=require(_0xd09d('0x7'));var interaction=require(_0xd09d('0x8'));var config=require('../../config/environment');var controller=require(_0xd09d('0x9'));router['get']('/',auth[_0xd09d('0xa')](),controller['index']);router[_0xd09d('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xd09d('0xc'),auth['isAuthenticated'](),controller[_0xd09d('0xd')]);router[_0xd09d('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xd09d('0xe')]('/',auth[_0xd09d('0xa')](),interaction[_0xd09d('0xf')](_0xd09d('0x10'),_0xd09d('0x11')),controller[_0xd09d('0x12')]);router[_0xd09d('0x13')]('/:id',auth[_0xd09d('0xa')](),controller[_0xd09d('0x14')]);router[_0xd09d('0x13')](_0xd09d('0x15'),auth[_0xd09d('0xa')](),controller['accept']);router[_0xd09d('0x13')](_0xd09d('0x16'),auth[_0xd09d('0xa')](),controller[_0xd09d('0x17')]);router[_0xd09d('0x18')]('/:id',auth[_0xd09d('0xa')](),controller[_0xd09d('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3f9b=['Router','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','/:id','update','put','/:id/accept','accept','destroy','exports','path','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x25b57c,_0x585294){_0x25b57c=_0x25b57c-0x0;var _0x5860ed=_0x3f9b[_0x25b57c];return _0x5860ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3f9('0x0'));var timeout=require('connect-timeout');var express=require(_0xb3f9('0x1'));var router=express[_0xb3f9('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3f9('0x3'));var controller=require(_0xb3f9('0x4'));router[_0xb3f9('0x5')]('/',auth['isAuthenticated'](),controller[_0xb3f9('0x6')]);router[_0xb3f9('0x5')](_0xb3f9('0x7'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x9')]);router['get']('/:id',auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xa')]);router['get'](_0xb3f9('0xb'),auth['isAuthenticated'](),controller['download']);router[_0xb3f9('0xc')]('/',auth[_0xb3f9('0x8')](),interaction[_0xb3f9('0xd')](_0xb3f9('0xe'),_0xb3f9('0xf')),controller[_0xb3f9('0x10')]);router['put'](_0xb3f9('0x11'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x12')]);router[_0xb3f9('0x13')](_0xb3f9('0x14'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x15')]);router[_0xb3f9('0x13')]('/:id/reject',auth[_0xb3f9('0x8')](),controller['reject']);router['delete'](_0xb3f9('0x11'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x16')]);module[_0xb3f9('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 6f21e7e..b378ca1 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 _0x0ca4=['TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','exports'];(function(_0x782bc0,_0x2247f8){var _0x500efc=function(_0x2cd038){while(--_0x2cd038){_0x782bc0['push'](_0x782bc0['shift']());}};_0x500efc(++_0x2247f8);}(_0x0ca4,0xa7));var _0x40ca=function(_0x53518a,_0x1c2c14){_0x53518a=_0x53518a-0x0;var _0x4930aa=_0x0ca4[_0x53518a];return _0x4930aa;};'use strict';var Sequelize=require(_0x40ca('0x0'));var _=require('lodash');module[_0x40ca('0x1')]={'body':{'type':Sequelize[_0x40ca('0x2')](_0x40ca('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x40ca('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x40ca('0x5')]('in',_0x40ca('0x6')),'defaultValue':_0x40ca('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x40ca('0x7')](0x1fe)},'from':{'type':Sequelize[_0x40ca('0x7')]},'to':{'type':Sequelize[_0x40ca('0x2')](_0x40ca('0x3'))},'cc':{'type':Sequelize[_0x40ca('0x2')]('long')},'bcc':{'type':Sequelize[_0x40ca('0x2')](_0x40ca('0x3'))},'subject':{'type':Sequelize[_0x40ca('0x2')]},'sentAt':{'type':Sequelize[_0x40ca('0x8')]},'attach':{'type':Sequelize[_0x40ca('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x40ca('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x40ca('0x8')]},'originTo':{'type':Sequelize[_0x40ca('0x2')](_0x40ca('0x3'))},'originCc':{'type':Sequelize[_0x40ca('0x2')](_0x40ca('0x3'))},'originChannel':{'type':Sequelize[_0x40ca('0x5')](_0x40ca('0xb'),_0x40ca('0xc')),'defaultValue':_0x40ca('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x6ff0=['TEXT','long','medium','out','STRING','DATE','BOOLEAN','ENUM','Chat','Email','sequelize','lodash','exports'];(function(_0x457643,_0x20fba7){var _0x10c4ed=function(_0x4046da){while(--_0x4046da){_0x457643['push'](_0x457643['shift']());}};_0x10c4ed(++_0x20fba7);}(_0x6ff0,0x128));var _0x06ff=function(_0x5f1de4,_0x47c201){_0x5f1de4=_0x5f1de4-0x0;var _0x1aeaf0=_0x6ff0[_0x5f1de4];return _0x1aeaf0;};'use strict';var Sequelize=require(_0x06ff('0x0'));var _=require(_0x06ff('0x1'));module[_0x06ff('0x2')]={'body':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x06ff('0x6')),'defaultValue':_0x06ff('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x06ff('0x7')](0x1fe)},'from':{'type':Sequelize[_0x06ff('0x7')]},'to':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x06ff('0x4'))},'bcc':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x06ff('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x06ff('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x06ff('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'originChannel':{'type':Sequelize[_0x06ff('0xa')]('Email',_0x06ff('0xb')),'defaultValue':_0x06ff('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2e2575a..86b9536 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 _0xb661=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','body','find','params','describe','direction','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','updatedAt','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','Contacts','create','ListId','List\x20not\x20found','SendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','format','UserId','user','MailInteraction','MailInteractionId','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','contact','interface','rejectmessage','toString','server','tmp','files','from','bcc','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','undefined','count','limit','set','Content-Range','json','then','end','sendStatus','name','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x514137,_0xa8df92){var _0xe75f90=function(_0x36b1da){while(--_0x36b1da){_0x514137['push'](_0x514137['shift']());}};_0xe75f90(++_0xa8df92);}(_0xb661,0x10a));var _0x1b66=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xb661[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require(_0x1b66('0x0'));var moment=require(_0x1b66('0x1'));var BPromise=require(_0x1b66('0x2'));var util=require(_0x1b66('0x3'));var path=require(_0x1b66('0x4'));var fs=require('fs');var _=require(_0x1b66('0x5'));var Redis=require(_0x1b66('0x6'));var htmlToText=require('html-to-text');var qs=require(_0x1b66('0x7'));var logger=require('../../config/logger')(_0x1b66('0x8'));var interaction_log=require(_0x1b66('0x9'))(_0x1b66('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1b66('0xb')]=_[_0x1b66('0xc')](config[_0x1b66('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b66('0xb')]));var htmlEntities=require(_0x1b66('0xd'));require(_0x1b66('0xe'))[_0x1b66('0xf')](socket);var jayson=require(_0x1b66('0x10'));var client=jayson['client'][_0x1b66('0x11')]({'port':0x232c});var client9003=jayson[_0x1b66('0x12')]['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51b35,_0xfaa588,_0x48c704,_0x539aa6){return new BPromise(function(_0x31d8bd,_0x3b6707){var _0x171cc5=_0x539aa6||client;return _0x171cc5[_0x1b66('0x13')](_0x51b35,_0x48c704)['then'](function(_0x4af8ae){logger[_0x1b66('0x14')](_0x1b66('0x15'),_0xfaa588,_0x1b66('0x16'));logger[_0x1b66('0x17')](_0x1b66('0x18'),_0xfaa588,_0x1b66('0x16'),JSON[_0x1b66('0x19')](_0x4af8ae));if(_0x4af8ae[_0x1b66('0x1a')]){if(_0x4af8ae[_0x1b66('0x1a')][_0x1b66('0x1b')]===0x1f4){logger['error'](_0x1b66('0x15'),_0xfaa588,_0x4af8ae[_0x1b66('0x1a')]['message']);return _0x3b6707(_0x4af8ae[_0x1b66('0x1a')][_0x1b66('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0xfaa588,_0x4af8ae['error']['message']);return _0x31d8bd(_0x4af8ae[_0x1b66('0x1a')][_0x1b66('0x1c')]);}else{logger[_0x1b66('0x14')](_0x1b66('0x15'),_0xfaa588,_0x1b66('0x16'));_0x31d8bd(_0x4af8ae[_0x1b66('0x1d')][_0x1b66('0x1c')]);}})['catch'](function(_0x1a6923){logger[_0x1b66('0x1a')]('MailMessage,\x20%s,\x20%s',_0xfaa588,_0x1a6923);_0x3b6707(_0x1a6923);});});}function respondWithResult(_0x45e27e,_0x3c964b){_0x3c964b=_0x3c964b||0xc8;return function(_0x5ad9d3){if(_0x5ad9d3){return _0x45e27e[_0x1b66('0x1e')](_0x3c964b)['json'](_0x5ad9d3);}};}function respondWithFilteredResult(_0x198954,_0x2bf143){return function(_0x38583a){if(_0x38583a){var _0x50e1cd=typeof _0x2bf143[_0x1b66('0x1f')]===_0x1b66('0x20')&&typeof _0x2bf143['limit']===_0x1b66('0x20');var _0x38db00=_0x38583a[_0x1b66('0x21')];var _0x3e26cf=_0x50e1cd?0x0:_0x2bf143[_0x1b66('0x1f')];var _0x5e402c=_0x50e1cd?_0x38583a['count']:_0x2bf143['offset']+_0x2bf143[_0x1b66('0x22')];var _0x3847aa;if(_0x5e402c>=_0x38db00){_0x5e402c=_0x38db00;_0x3847aa=0xc8;}else{_0x3847aa=0xce;}_0x198954[_0x1b66('0x1e')](_0x3847aa);return _0x198954[_0x1b66('0x23')](_0x1b66('0x24'),_0x3e26cf+'-'+_0x5e402c+'/'+_0x38db00)[_0x1b66('0x25')](_0x38583a);}return null;};}function saveUpdates(_0x52070b){return function(_0x1ded29){if(_0x1ded29){return _0x1ded29['update'](_0x52070b)[_0x1b66('0x26')](function(_0x3a2637){return _0x3a2637;});}return null;};}function removeEntity(_0x16a8c9){return function(_0x46ac1e){if(_0x46ac1e){return _0x46ac1e['destroy']()[_0x1b66('0x26')](function(){_0x16a8c9['status'](0xcc)[_0x1b66('0x27')]();});}};}function handleEntityNotFound(_0xc586b3){return function(_0x2fe838){if(!_0x2fe838){_0xc586b3[_0x1b66('0x28')](0x194);}return _0x2fe838;};}function handleError(_0x11b056,_0xe4e42e){_0xe4e42e=_0xe4e42e||0x1f4;return function(_0x531946){logger['error'](_0x531946['stack']);if(_0x531946[_0x1b66('0x29')]){delete _0x531946[_0x1b66('0x29')];}_0x11b056['status'](_0xe4e42e)['send'](_0x531946);};}exports['index']=function(_0x1ae1bd,_0x415aef){var _0x19236a={},_0x10c715={},_0x47bd1e={'count':0x0,'rows':[]};var _0x32ca34=_[_0x1b66('0x2a')](db[_0x1b66('0x2b')][_0x1b66('0x2c')],function(_0x4beb59){return{'name':_0x4beb59[_0x1b66('0x2d')],'type':_0x4beb59[_0x1b66('0x2e')][_0x1b66('0x2f')]};});_0x10c715[_0x1b66('0x30')]=_['map'](_0x32ca34,'name');_0x10c715[_0x1b66('0x31')]=_[_0x1b66('0x32')](_0x1ae1bd['query']);_0x10c715[_0x1b66('0x33')]=_[_0x1b66('0x34')](_0x10c715['model'],_0x10c715[_0x1b66('0x31')]);_0x19236a[_0x1b66('0x35')]=_['intersection'](_0x10c715[_0x1b66('0x30')],qs[_0x1b66('0x36')](_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x36')]));_0x19236a['attributes']=_0x19236a[_0x1b66('0x35')][_0x1b66('0x37')]?_0x19236a['attributes']:_0x10c715[_0x1b66('0x30')];if(!_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x38')](_0x1b66('0x39'))){_0x19236a[_0x1b66('0x22')]=qs[_0x1b66('0x22')](_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x22')]);_0x19236a[_0x1b66('0x1f')]=qs[_0x1b66('0x1f')](_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x1f')]);}_0x19236a[_0x1b66('0x3a')]=qs[_0x1b66('0x3b')](_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x3b')]);_0x19236a[_0x1b66('0x3c')]=qs['filters'](_[_0x1b66('0x3d')](_0x1ae1bd[_0x1b66('0x31')],_0x10c715[_0x1b66('0x33')]),_0x32ca34);if(_0x1ae1bd[_0x1b66('0x31')]['filter']){_0x19236a[_0x1b66('0x3c')]=_[_0x1b66('0x3e')](_0x19236a[_0x1b66('0x3c')],{'$or':_[_0x1b66('0x2a')](_0x32ca34,function(_0x7b98cd){if(_0x7b98cd[_0x1b66('0x2e')]!=='VIRTUAL'){var _0x564cc7={};_0x564cc7[_0x7b98cd[_0x1b66('0x29')]]={'$like':'%'+_0x1ae1bd['query'][_0x1b66('0x3f')]+'%'};return _0x564cc7;}})});}_0x19236a=_['merge']({},_0x19236a,_0x1ae1bd[_0x1b66('0x40')]);var _0x10622e={'where':_0x19236a[_0x1b66('0x3c')]};return db[_0x1b66('0x2b')][_0x1b66('0x21')](_0x10622e)['then'](function(_0x43509f){_0x47bd1e[_0x1b66('0x21')]=_0x43509f;if(_0x1ae1bd[_0x1b66('0x31')][_0x1b66('0x41')]){_0x19236a[_0x1b66('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0x1b66('0x43')](_0x19236a);})[_0x1b66('0x26')](function(_0x246d49){_0x47bd1e[_0x1b66('0x44')]=_0x246d49;return _0x47bd1e;})[_0x1b66('0x26')](respondWithFilteredResult(_0x415aef,_0x19236a))[_0x1b66('0x45')](handleError(_0x415aef,null));};exports[_0x1b66('0x46')]=function(_0x14446f,_0x48b94c){var _0x4e9eaa={'raw':!![],'where':{'id':_0x14446f['params']['id']}},_0x41cd57={};_0x41cd57[_0x1b66('0x30')]=_[_0x1b66('0x32')](db[_0x1b66('0x2b')][_0x1b66('0x2c')]);_0x41cd57[_0x1b66('0x31')]=_[_0x1b66('0x32')](_0x14446f[_0x1b66('0x31')]);_0x41cd57[_0x1b66('0x33')]=_[_0x1b66('0x34')](_0x41cd57[_0x1b66('0x30')],_0x41cd57[_0x1b66('0x31')]);_0x4e9eaa[_0x1b66('0x35')]=_[_0x1b66('0x34')](_0x41cd57[_0x1b66('0x30')],qs[_0x1b66('0x36')](_0x14446f['query'][_0x1b66('0x36')]));_0x4e9eaa[_0x1b66('0x35')]=_0x4e9eaa[_0x1b66('0x35')][_0x1b66('0x37')]?_0x4e9eaa[_0x1b66('0x35')]:_0x41cd57[_0x1b66('0x30')];if(_0x14446f[_0x1b66('0x31')][_0x1b66('0x41')]){_0x4e9eaa[_0x1b66('0x42')]=[{'all':!![]}];}_0x4e9eaa=_[_0x1b66('0x3e')]({},_0x4e9eaa,_0x14446f[_0x1b66('0x40')]);return db[_0x1b66('0x2b')]['find'](_0x4e9eaa)[_0x1b66('0x26')](handleEntityNotFound(_0x48b94c,null))[_0x1b66('0x26')](respondWithResult(_0x48b94c,null))[_0x1b66('0x45')](handleError(_0x48b94c,null));};exports['update']=function(_0x579eed,_0x3fa4a1){if(_0x579eed[_0x1b66('0x47')]['id']){delete _0x579eed[_0x1b66('0x47')]['id'];}return db[_0x1b66('0x2b')][_0x1b66('0x48')]({'where':{'id':_0x579eed[_0x1b66('0x49')]['id']}})['then'](handleEntityNotFound(_0x3fa4a1,null))[_0x1b66('0x26')](saveUpdates(_0x579eed['body'],null))['then'](respondWithResult(_0x3fa4a1,null))[_0x1b66('0x45')](handleError(_0x3fa4a1,null));};exports['destroy']=function(_0x299620,_0x5dd057){return db[_0x1b66('0x2b')][_0x1b66('0x48')]({'where':{'id':_0x299620[_0x1b66('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dd057,null))['then'](removeEntity(_0x5dd057,null))[_0x1b66('0x45')](handleError(_0x5dd057,null));};exports[_0x1b66('0x4a')]=function(_0x81dcd2,_0x193029){return db[_0x1b66('0x2b')]['describe']()[_0x1b66('0x26')](respondWithResult(_0x193029,null))[_0x1b66('0x45')](handleError(_0x193029,null));};exports['create']=function(_0x10f235,_0x597061){return db[_0x1b66('0x2b')]['create'](_0x10f235[_0x1b66('0x47')])['then'](function(_0x331ceb){if(_0x331ceb){if(_0x331ceb[_0x1b66('0x4b')]==='out'&&!_0x331ceb[_0x1b66('0x4c')]){var _0x240baf,_0x255968,_0x10cba3;if(_0x10f235[_0x1b66('0x47')]['to']){_0x255968=_0x10f235[_0x1b66('0x47')]['to'][_0x1b66('0x4d')](',')[0x0];}return db[_0x1b66('0x4e')][_0x1b66('0x4f')]({'where':{'id':_0x331ceb[_0x1b66('0x50')]},'include':[{'model':db['CmList'],'as':_0x1b66('0x51'),'include':[{'model':db[_0x1b66('0x52')],'as':'Contacts','where':{'email':_0x255968},'limit':0x1,'order':[[_0x1b66('0x53'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x1b66('0x54'),'raw':!![],'include':[{'model':db[_0x1b66('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0x1b66('0x26')](function(_0x2d23d6){_0x240baf=_0x2d23d6;if(!_0x240baf||!_0x240baf['Smtp'])return;var _0x4650e9=_0x240baf[_0x1b66('0x56')]();if(_0x10f235[_0x1b66('0x47')][_0x1b66('0x57')]&&_0x10f235[_0x1b66('0x47')]['attachments'][_0x1b66('0x37')]){for(var _0x4a025e=0x0;_0x4a025e<_0x10f235[_0x1b66('0x47')]['attachments']['length'];_0x4a025e+=0x1){_0x10f235[_0x1b66('0x47')][_0x1b66('0x57')][_0x4a025e]={'filename':_0x10f235[_0x1b66('0x47')]['attachments'][_0x4a025e][_0x1b66('0x29')],'path':path[_0x1b66('0x58')](config[_0x1b66('0x59')],_0x1b66('0x5a'),_0x10f235['body'][_0x1b66('0x57')][_0x4a025e][_0x1b66('0x5b')])};}}_0x10cba3={'account':_0x4650e9,'message':_0x10f235[_0x1b66('0x47')]};return;})[_0x1b66('0x26')](function(){if(_0x240baf['List']){if(_0x240baf['List'][_0x1b66('0x5c')][_0x1b66('0x37')]){return _0x240baf['List']['Contacts'][0x0];}else{return db['CmContact'][_0x1b66('0x5d')](_['defaults'](_0x10f235[_0x1b66('0x47')],{'firstName':_0x10f235[_0x1b66('0x47')]['to'],'email':_0x10f235['body']['to'],'phone':_0x10f235['body']['to'],'ListId':_0x240baf[_0x1b66('0x5e')]}));}}else{throw new Error(_0x1b66('0x5f'));}})[_0x1b66('0x26')](function(){if(_0x10cba3){return respondWithRpcPromise(_0x1b66('0x60'),'sendMail',_0x10cba3,client9003)[_0x1b66('0x26')](function(_0x53981a){return _0x331ceb[_0x1b66('0x61')]({'read':!![],'messageId':_0x53981a[_0x1b66('0x62')],'sentAt':moment()['format'](_0x1b66('0x63'))});})[_0x1b66('0x45')](function(_0x14538e){logger[_0x1b66('0x1a')]('%s',JSON[_0x1b66('0x19')](_0x14538e));return _0x331ceb;});}return _0x331ceb;});}return _0x331ceb;}})[_0x1b66('0x26')](respondWithResult(_0x597061,0xc9))[_0x1b66('0x45')](handleError(_0x597061,null));};exports['accept']=function(_0xa14ba9,_0x85f270){var _0x59c252={'agent':{},'channel':_0x1b66('0x64')};if(_0xa14ba9[_0x1b66('0x47')]['id']){delete _0xa14ba9[_0x1b66('0x47')]['id'];}_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x65')]=!![];_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x66')]=moment()[_0x1b66('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x68')]=_0xa14ba9['body'][_0x1b66('0x68')]||_0xa14ba9[_0x1b66('0x69')]['id'];_0x59c252['agent']['id']=_0xa14ba9['body']['UserId'];return db[_0x1b66('0x2b')][_0x1b66('0x48')]({'where':{'id':_0xa14ba9[_0x1b66('0x49')]['id'],'UserId':null}})[_0x1b66('0x26')](handleEntityNotFound(_0x85f270,null))[_0x1b66('0x26')](saveUpdates(_0xa14ba9[_0x1b66('0x47')],null))[_0x1b66('0x26')](function(_0x1a1b5b){if(_0x1a1b5b){_0x59c252[_0x1b66('0x1c')]=_0x1a1b5b['get']({'plain':!![]});return db[_0x1b66('0x6a')][_0x1b66('0x48')]({'where':{'id':_0x1a1b5b[_0x1b66('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x85f270,null))['then'](function(_0xf64386){if(_0xf64386){return _0xf64386[_0x1b66('0x61')]({'UserId':_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x68')],'read1stAt':_[_0x1b66('0x6c')](_0xf64386['read1stAt'])?moment()['format'](_0x1b66('0x63')):undefined});}return null;})[_0x1b66('0x26')](function(_0x230ec3){if(_0x230ec3){_0x59c252[_0x1b66('0x6d')]=_0x230ec3[_0x1b66('0x6e')]({'plain':!![]});interaction_log[_0x1b66('0x14')](_0x1b66('0x6f'),_0xa14ba9[_0x1b66('0x69')]['id'],_0xa14ba9[_0x1b66('0x69')][_0x1b66('0x29')],_0xa14ba9[_0x1b66('0x69')][_0x1b66('0x70')],_0x59c252[_0x1b66('0x6d')]['id'],_0xa14ba9['body']?JSON[_0x1b66('0x19')](_0xa14ba9['body']):_0x1b66('0x71'));return respondWithRpcPromise(_0x1b66('0x72'),_0x1b66('0x73'),_0x59c252);}return null;})[_0x1b66('0x26')](function(_0x3c9503){var _0x19caa1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c9503[_0x1b66('0x1c')][_0x1b66('0x74')];return db[_0x1b66('0x75')]['query'](_0x19caa1,{'type':db[_0x1b66('0x76')]['QueryTypes'][_0x1b66('0x77')],'raw':!![]})['then'](function(_0x5a604f){return _0x5a604f;});})[_0x1b66('0x26')](function(_0x1e3a95){if(_0x1e3a95){_0x59c252[_0x1b66('0x1c')]['contact']=_0x1e3a95[0x0];if(!_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x68')])return;return db[_0x1b66('0x78')][_0x1b66('0x48')]({'where':{'id':_0xa14ba9[_0x1b66('0x47')]['UserId'],'role':_0x1b66('0x79')},'attributes':['id',_0x1b66('0x29'),_0x1b66('0x7a'),_0x1b66('0x7b'),_0x1b66('0x7c')],'raw':!![]});}return null;})[_0x1b66('0x26')](function(_0x345921){if(!_0x345921)return null;_0x59c252[_0x1b66('0x1c')]['agent']=_0x345921;return _0x59c252;})[_0x1b66('0x26')](function(_0x10b8ea){if(_0x10b8ea){if(_0xa14ba9[_0x1b66('0x47')][_0x1b66('0x7d')]){_0x59c252[_0x1b66('0x1c')]['interface']=util['format'](_0x1b66('0x7e'),_0xa14ba9['user']['name']);_0x59c252[_0x1b66('0x1c')][_0x1b66('0x7f')]=_0x59c252['channel'];_0x59c252[_0x1b66('0x1c')][_0x1b66('0x80')]=_0x59c252[_0x1b66('0x7f')];_0x59c252[_0x1b66('0x1c')][_0x1b66('0x81')]=_0x1b66('0x82');_0x59c252[_0x1b66('0x1c')]['body']=htmlToText[_0x1b66('0x83')](_0x59c252[_0x1b66('0x1c')][_0x1b66('0x47')]);return respondWithRpcPromise(_0x1b66('0x84'),_0x1b66('0x84'),{'event':_0x1b66('0x85'),'message':_0x59c252['message']},client9002)[_0x1b66('0x26')](function(){return _0x59c252;});}return _0x59c252;}return null;})['then'](respondWithResult(_0x85f270,null))['catch'](handleError(_0x85f270,null));};exports[_0x1b66('0x86')]=function(_0x4147fc,_0x44fb56){var _0x3a6b35={'agent':{},'channel':_0x1b66('0x64')};if(_0x4147fc[_0x1b66('0x47')]['id']){delete _0x4147fc[_0x1b66('0x47')]['id'];}_0x4147fc[_0x1b66('0x47')][_0x1b66('0x68')]=_0x4147fc[_0x1b66('0x47')]['UserId']||_0x4147fc[_0x1b66('0x69')]['id'];_0x3a6b35[_0x1b66('0x79')]['id']=_0x4147fc[_0x1b66('0x47')][_0x1b66('0x68')];return db['MailMessage'][_0x1b66('0x48')]({'where':{'id':_0x4147fc[_0x1b66('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44fb56,null))[_0x1b66('0x26')](function(_0x53d730){if(_0x53d730){_0x3a6b35[_0x1b66('0x1c')]=_0x53d730[_0x1b66('0x6e')]({'plain':!![]});return db[_0x1b66('0x6a')][_0x1b66('0x48')]({'where':{'id':_0x53d730['MailInteractionId']}});}return null;})[_0x1b66('0x26')](handleEntityNotFound(_0x44fb56,null))['then'](function(_0x58bd48){if(_0x58bd48){_0x3a6b35['interaction']=_0x58bd48['get']({'plain':!![]});interaction_log['info'](_0x1b66('0x87'),_0x4147fc['user']['id'],_0x4147fc[_0x1b66('0x69')][_0x1b66('0x29')],_0x4147fc[_0x1b66('0x69')][_0x1b66('0x70')],_0x3a6b35[_0x1b66('0x6d')]['id'],_0x4147fc[_0x1b66('0x47')]?JSON[_0x1b66('0x19')](_0x4147fc[_0x1b66('0x47')]):_0x1b66('0x71'));return respondWithRpcPromise(_0x1b66('0x88'),_0x1b66('0x89'),_0x3a6b35);}return null;})[_0x1b66('0x26')](function(_0xd0a446){var _0x2f42bf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd0a446['message']['ContactId'];return db['sequelize']['query'](_0x2f42bf,{'type':db[_0x1b66('0x76')][_0x1b66('0x8a')][_0x1b66('0x77')],'raw':!![]})[_0x1b66('0x26')](function(_0x3260a6){return _0x3260a6;});})[_0x1b66('0x26')](function(_0xa53dba){if(_0xa53dba){_0x3a6b35[_0x1b66('0x1c')][_0x1b66('0x8b')]=_0xa53dba[0x0];if(!_0x4147fc[_0x1b66('0x47')][_0x1b66('0x68')])return;return db['User'][_0x1b66('0x48')]({'where':{'id':_0x4147fc[_0x1b66('0x47')]['UserId'],'role':'agent'},'attributes':['id',_0x1b66('0x29'),_0x1b66('0x7a'),_0x1b66('0x7b'),_0x1b66('0x7c')],'raw':!![]});}return null;})[_0x1b66('0x26')](function(_0x269aed){if(!_0x269aed)return null;_0x3a6b35[_0x1b66('0x1c')]['agent']=_0x269aed;return _0x3a6b35;})['then'](function(_0x48637e){if(_0x48637e){_0x48637e['message'][_0x1b66('0x8c')]=util[_0x1b66('0x67')]('SIP/%s',_0x4147fc[_0x1b66('0x69')][_0x1b66('0x29')]);_0x48637e[_0x1b66('0x1c')][_0x1b66('0x7f')]=_0x3a6b35['channel'];_0x48637e[_0x1b66('0x1c')][_0x1b66('0x80')]=_0x3a6b35[_0x1b66('0x7f')];_0x48637e[_0x1b66('0x1c')]['event']=_0x1b66('0x86');_0x48637e[_0x1b66('0x1c')][_0x1b66('0x47')]=htmlToText[_0x1b66('0x83')](_0x3a6b35[_0x1b66('0x1c')]['body']);respondWithRpcPromise(_0x1b66('0x84'),'EventManager',{'event':_0x1b66('0x8d'),'message':_0x48637e['message']},client9002);return _0x3a6b35;}return null;})[_0x1b66('0x26')](respondWithResult(_0x44fb56,null))[_0x1b66('0x45')](handleError(_0x44fb56,null));};exports['download']=function(_0x15ad81,_0x2c57f7){var _0x20467e=moment()['unix']()[_0x1b66('0x8e')]();var _0x3efddd=path[_0x1b66('0x58')](config[_0x1b66('0x59')],_0x1b66('0x8f'),'files',_0x1b66('0x90'));var _0x171255=path[_0x1b66('0x58')](config[_0x1b66('0x59')],_0x1b66('0x8f'),_0x1b66('0x91'),_0x1b66('0x57'));var _0x4af4ad=util[_0x1b66('0x67')]('message-%s.eml',_0x20467e);return db[_0x1b66('0x2b')]['find']({'where':{'id':_0x15ad81[_0x1b66('0x49')]['id']},'attributes':['id','body',_0x1b66('0x92'),'to','cc',_0x1b66('0x93'),'subject',_0x1b66('0x94')],'include':_0x15ad81[_0x1b66('0x31')][_0x1b66('0x57')]?[{'model':db[_0x1b66('0x95')],'as':'Attachments'}]:undefined})[_0x1b66('0x26')](handleEntityNotFound(_0x2c57f7,null))[_0x1b66('0x26')](function(_0x3d51c3){if(_0x3d51c3){var _0x510046=_0x3d51c3;var _0x555f09={'from':_0x510046[_0x1b66('0x92')],'to':_0x510046['to'],'subject':_0x510046['subject'],'html':htmlEntities['decode'](_0x510046[_0x1b66('0x47')]),'headers':{'Date':moment(_0x510046[_0x1b66('0x94')])[_0x1b66('0x67')](_0x1b66('0x96'))},'attachments':[]};if(_0x3d51c3['cc']){_0x555f09[_0x1b66('0x97')]['Cc']=_0x3d51c3['cc'];}if(_0x3d51c3[_0x1b66('0x93')]){_0x555f09['headers'][_0x1b66('0x98')]=_0x3d51c3[_0x1b66('0x93')];}return new BPromise(function(_0x54c2f5,_0x7bc8e7){if(_0x3d51c3[_0x1b66('0x99')]){for(var _0x3e622a=0x0;_0x3e622a<_0x3d51c3[_0x1b66('0x99')][_0x1b66('0x37')];_0x3e622a++){var _0x33726b=_0x3d51c3['Attachments'][_0x3e622a];var _0x4b25a9=path[_0x1b66('0x58')](_0x171255,_0x33726b[_0x1b66('0x5b')]);if(fs[_0x1b66('0x9a')](_0x4b25a9)){_0x555f09[_0x1b66('0x57')][_0x1b66('0x9b')]({'name':_0x33726b[_0x1b66('0x29')],'contentType':_0x33726b[_0x1b66('0x2e')],'data':fs[_0x1b66('0x9c')](_0x4b25a9)});}}}emlformat[_0x1b66('0x9d')](_0x555f09,function(_0x4f6035,_0x21254c){if(_0x4f6035)return _0x7bc8e7(_0x4f6035);fs[_0x1b66('0x9e')](path['join'](_0x3efddd,_0x4af4ad),_0x21254c);return _0x54c2f5(_0x21254c);});});}})['then'](function(_0x5cbef9){if(_0x5cbef9){return _0x2c57f7['download'](path[_0x1b66('0x58')](_0x3efddd,_0x4af4ad),_0x4af4ad,function(_0x11fdc9){if(!_0x11fdc9)fs[_0x1b66('0x9f')](path[_0x1b66('0x58')](_0x3efddd,_0x4af4ad));});}})['catch'](handleError(_0x2c57f7,null));}; \ No newline at end of file +var _0x1ab8=['create','ListId','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','read','readAt','format','UserId','agent','get','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','fromString','EventManager','mail','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','motionChannel','reject','download','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','MailMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','out','secret','split','findOne','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List'];(function(_0x3d11ed,_0x47a4b8){var _0xbbd56c=function(_0x49b4d7){while(--_0x49b4d7){_0x3d11ed['push'](_0x3d11ed['shift']());}};_0xbbd56c(++_0x47a4b8);}(_0x1ab8,0xe2));var _0x81ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1ab8[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x81ab('0x0'));var moment=require(_0x81ab('0x1'));var BPromise=require(_0x81ab('0x2'));var util=require(_0x81ab('0x3'));var path=require(_0x81ab('0x4'));var fs=require('fs');var _=require(_0x81ab('0x5'));var Redis=require(_0x81ab('0x6'));var htmlToText=require('html-to-text');var qs=require(_0x81ab('0x7'));var logger=require(_0x81ab('0x8'))(_0x81ab('0x9'));var interaction_log=require(_0x81ab('0x8'))(_0x81ab('0xa'));var config=require(_0x81ab('0xb'));var db=require(_0x81ab('0xc'))['db'];config[_0x81ab('0xd')]=_[_0x81ab('0xe')](config[_0x81ab('0xd')],{'host':_0x81ab('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81ab('0xd')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x81ab('0x10')](socket);var jayson=require(_0x81ab('0x11'));var client=jayson['client'][_0x81ab('0x12')]({'port':0x232c});var client9003=jayson[_0x81ab('0x13')][_0x81ab('0x12')]({'port':0x232b});var client9002=jayson[_0x81ab('0x13')][_0x81ab('0x12')]({'port':0x232a});function respondWithRpcPromise(_0xa4a95f,_0x11ce36,_0x6590b6,_0x543d76){return new BPromise(function(_0x3c55c2,_0x5a7c93){var _0x5cb23b=_0x543d76||client;return _0x5cb23b[_0x81ab('0x14')](_0xa4a95f,_0x6590b6)[_0x81ab('0x15')](function(_0xbf088){logger[_0x81ab('0x16')](_0x81ab('0x17'),_0x11ce36,_0x81ab('0x18'));logger[_0x81ab('0x19')](_0x81ab('0x1a'),_0x11ce36,_0x81ab('0x18'),JSON[_0x81ab('0x1b')](_0xbf088));if(_0xbf088['error']){if(_0xbf088['error'][_0x81ab('0x1c')]===0x1f4){logger['error'](_0x81ab('0x17'),_0x11ce36,_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);return _0x5a7c93(_0xbf088['error'][_0x81ab('0x1e')]);}logger[_0x81ab('0x1d')](_0x81ab('0x17'),_0x11ce36,_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);return _0x3c55c2(_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);}else{logger[_0x81ab('0x16')](_0x81ab('0x17'),_0x11ce36,_0x81ab('0x18'));_0x3c55c2(_0xbf088[_0x81ab('0x1f')][_0x81ab('0x1e')]);}})[_0x81ab('0x20')](function(_0x546805){logger[_0x81ab('0x1d')]('MailMessage,\x20%s,\x20%s',_0x11ce36,_0x546805);_0x5a7c93(_0x546805);});});}function respondWithResult(_0x241ae9,_0x36f895){_0x36f895=_0x36f895||0xc8;return function(_0x23f88f){if(_0x23f88f){return _0x241ae9[_0x81ab('0x21')](_0x36f895)['json'](_0x23f88f);}};}function respondWithFilteredResult(_0x5191c5,_0x5ea440){return function(_0x13a90d){if(_0x13a90d){var _0x5a4ada=typeof _0x5ea440[_0x81ab('0x22')]===_0x81ab('0x23')&&typeof _0x5ea440[_0x81ab('0x24')]===_0x81ab('0x23');var _0x568dbf=_0x13a90d[_0x81ab('0x25')];var _0x8c7b9d=_0x5a4ada?0x0:_0x5ea440['offset'];var _0x1ec884=_0x5a4ada?_0x13a90d[_0x81ab('0x25')]:_0x5ea440['offset']+_0x5ea440['limit'];var _0x2cebf5;if(_0x1ec884>=_0x568dbf){_0x1ec884=_0x568dbf;_0x2cebf5=0xc8;}else{_0x2cebf5=0xce;}_0x5191c5[_0x81ab('0x21')](_0x2cebf5);return _0x5191c5['set'](_0x81ab('0x26'),_0x8c7b9d+'-'+_0x1ec884+'/'+_0x568dbf)[_0x81ab('0x27')](_0x13a90d);}return null;};}function saveUpdates(_0x5bc197){return function(_0x494b2b){if(_0x494b2b){return _0x494b2b[_0x81ab('0x28')](_0x5bc197)[_0x81ab('0x15')](function(_0x553c90){return _0x553c90;});}return null;};}function removeEntity(_0x5df743){return function(_0x3afec1){if(_0x3afec1){return _0x3afec1[_0x81ab('0x29')]()['then'](function(){_0x5df743['status'](0xcc)[_0x81ab('0x2a')]();});}};}function handleEntityNotFound(_0x105a35){return function(_0x1806e9){if(!_0x1806e9){_0x105a35[_0x81ab('0x2b')](0x194);}return _0x1806e9;};}function handleError(_0x245cfb,_0x3cfa75){_0x3cfa75=_0x3cfa75||0x1f4;return function(_0x33bcea){logger['error'](_0x33bcea[_0x81ab('0x2c')]);if(_0x33bcea['name']){delete _0x33bcea[_0x81ab('0x2d')];}_0x245cfb[_0x81ab('0x21')](_0x3cfa75)[_0x81ab('0x2e')](_0x33bcea);};}exports['index']=function(_0x33c012,_0x125f41){var _0x44f8da={},_0x4f12bf={},_0x50107c={'count':0x0,'rows':[]};var _0x4f6c0d=_['map'](db['MailMessage'][_0x81ab('0x2f')],function(_0x3817a2){return{'name':_0x3817a2[_0x81ab('0x30')],'type':_0x3817a2[_0x81ab('0x31')]['key']};});_0x4f12bf[_0x81ab('0x32')]=_[_0x81ab('0x33')](_0x4f6c0d,_0x81ab('0x2d'));_0x4f12bf[_0x81ab('0x34')]=_[_0x81ab('0x35')](_0x33c012[_0x81ab('0x34')]);_0x4f12bf[_0x81ab('0x36')]=_['intersection'](_0x4f12bf['model'],_0x4f12bf['query']);_0x44f8da[_0x81ab('0x37')]=_['intersection'](_0x4f12bf[_0x81ab('0x32')],qs[_0x81ab('0x38')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x38')]));_0x44f8da[_0x81ab('0x37')]=_0x44f8da[_0x81ab('0x37')][_0x81ab('0x39')]?_0x44f8da[_0x81ab('0x37')]:_0x4f12bf[_0x81ab('0x32')];if(!_0x33c012[_0x81ab('0x34')][_0x81ab('0x3a')](_0x81ab('0x3b'))){_0x44f8da[_0x81ab('0x24')]=qs[_0x81ab('0x24')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x24')]);_0x44f8da[_0x81ab('0x22')]=qs[_0x81ab('0x22')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x22')]);}_0x44f8da['order']=qs[_0x81ab('0x3c')](_0x33c012['query'][_0x81ab('0x3c')]);_0x44f8da[_0x81ab('0x3d')]=qs[_0x81ab('0x36')](_['pick'](_0x33c012[_0x81ab('0x34')],_0x4f12bf[_0x81ab('0x36')]),_0x4f6c0d);if(_0x33c012['query'][_0x81ab('0x3e')]){_0x44f8da[_0x81ab('0x3d')]=_[_0x81ab('0x3f')](_0x44f8da[_0x81ab('0x3d')],{'$or':_['map'](_0x4f6c0d,function(_0x33ce80){if(_0x33ce80[_0x81ab('0x31')]!=='VIRTUAL'){var _0x4c75a4={};_0x4c75a4[_0x33ce80[_0x81ab('0x2d')]]={'$like':'%'+_0x33c012[_0x81ab('0x34')][_0x81ab('0x3e')]+'%'};return _0x4c75a4;}})});}_0x44f8da=_[_0x81ab('0x3f')]({},_0x44f8da,_0x33c012[_0x81ab('0x40')]);var _0xdf476b={'where':_0x44f8da[_0x81ab('0x3d')]};return db[_0x81ab('0x41')][_0x81ab('0x25')](_0xdf476b)[_0x81ab('0x15')](function(_0x96710e){_0x50107c[_0x81ab('0x25')]=_0x96710e;if(_0x33c012[_0x81ab('0x34')][_0x81ab('0x42')]){_0x44f8da[_0x81ab('0x43')]=[{'all':!![]}];}return db[_0x81ab('0x41')][_0x81ab('0x44')](_0x44f8da);})[_0x81ab('0x15')](function(_0xcf4770){_0x50107c[_0x81ab('0x45')]=_0xcf4770;return _0x50107c;})[_0x81ab('0x15')](respondWithFilteredResult(_0x125f41,_0x44f8da))[_0x81ab('0x20')](handleError(_0x125f41,null));};exports[_0x81ab('0x46')]=function(_0x5cb380,_0x3bfc64){var _0x1f4cba={'raw':!![],'where':{'id':_0x5cb380['params']['id']}},_0x37da2c={};_0x37da2c[_0x81ab('0x32')]=_['keys'](db[_0x81ab('0x41')][_0x81ab('0x2f')]);_0x37da2c[_0x81ab('0x34')]=_[_0x81ab('0x35')](_0x5cb380[_0x81ab('0x34')]);_0x37da2c[_0x81ab('0x36')]=_[_0x81ab('0x47')](_0x37da2c['model'],_0x37da2c[_0x81ab('0x34')]);_0x1f4cba[_0x81ab('0x37')]=_[_0x81ab('0x47')](_0x37da2c['model'],qs['fields'](_0x5cb380['query'][_0x81ab('0x38')]));_0x1f4cba[_0x81ab('0x37')]=_0x1f4cba['attributes'][_0x81ab('0x39')]?_0x1f4cba['attributes']:_0x37da2c[_0x81ab('0x32')];if(_0x5cb380[_0x81ab('0x34')][_0x81ab('0x42')]){_0x1f4cba['include']=[{'all':!![]}];}_0x1f4cba=_[_0x81ab('0x3f')]({},_0x1f4cba,_0x5cb380[_0x81ab('0x40')]);return db[_0x81ab('0x41')][_0x81ab('0x48')](_0x1f4cba)['then'](handleEntityNotFound(_0x3bfc64,null))[_0x81ab('0x15')](respondWithResult(_0x3bfc64,null))[_0x81ab('0x20')](handleError(_0x3bfc64,null));};exports[_0x81ab('0x28')]=function(_0xf09b38,_0x1f65c3){if(_0xf09b38[_0x81ab('0x49')]['id']){delete _0xf09b38[_0x81ab('0x49')]['id'];}return db[_0x81ab('0x41')][_0x81ab('0x48')]({'where':{'id':_0xf09b38[_0x81ab('0x4a')]['id']}})[_0x81ab('0x15')](handleEntityNotFound(_0x1f65c3,null))[_0x81ab('0x15')](saveUpdates(_0xf09b38[_0x81ab('0x49')],null))['then'](respondWithResult(_0x1f65c3,null))[_0x81ab('0x20')](handleError(_0x1f65c3,null));};exports[_0x81ab('0x29')]=function(_0x45ac65,_0x16a89f){return db['MailMessage'][_0x81ab('0x48')]({'where':{'id':_0x45ac65[_0x81ab('0x4a')]['id']}})[_0x81ab('0x15')](handleEntityNotFound(_0x16a89f,null))[_0x81ab('0x15')](removeEntity(_0x16a89f,null))[_0x81ab('0x20')](handleError(_0x16a89f,null));};exports[_0x81ab('0x4b')]=function(_0x45fff7,_0x5efae5){return db[_0x81ab('0x41')]['describe']()[_0x81ab('0x15')](respondWithResult(_0x5efae5,null))[_0x81ab('0x20')](handleError(_0x5efae5,null));};exports['create']=function(_0x417680,_0x23cb2d){return db[_0x81ab('0x41')]['create'](_0x417680[_0x81ab('0x49')])[_0x81ab('0x15')](function(_0x13edeb){if(_0x13edeb){if(_0x13edeb['direction']===_0x81ab('0x4c')&&!_0x13edeb[_0x81ab('0x4d')]){var _0x20d53c,_0x10a5e0,_0x4f2389;if(_0x417680[_0x81ab('0x49')]['to']){_0x10a5e0=_0x417680['body']['to'][_0x81ab('0x4e')](',')[0x0];}return db['MailAccount'][_0x81ab('0x4f')]({'where':{'id':_0x13edeb['MailAccountId']},'include':[{'model':db[_0x81ab('0x50')],'as':'List','include':[{'model':db[_0x81ab('0x51')],'as':_0x81ab('0x52'),'where':{'email':_0x10a5e0},'limit':0x1,'order':[[_0x81ab('0x53'),_0x81ab('0x54')]]}]},{'model':db['MailServerOut'],'as':_0x81ab('0x55'),'raw':!![],'include':[{'model':db[_0x81ab('0x56')],'as':_0x81ab('0x56'),'raw':!![]}]}]})[_0x81ab('0x15')](function(_0x12755b){_0x20d53c=_0x12755b;if(!_0x20d53c||!_0x20d53c['Smtp'])return;var _0x427b41=_0x20d53c[_0x81ab('0x57')]();if(_0x417680[_0x81ab('0x49')][_0x81ab('0x58')]&&_0x417680[_0x81ab('0x49')][_0x81ab('0x58')][_0x81ab('0x39')]){for(var _0x2bab9a=0x0;_0x2bab9a<_0x417680[_0x81ab('0x49')]['attachments']['length'];_0x2bab9a+=0x1){_0x417680[_0x81ab('0x49')]['attachments'][_0x2bab9a]={'filename':_0x417680['body'][_0x81ab('0x58')][_0x2bab9a][_0x81ab('0x2d')],'path':path[_0x81ab('0x59')](config[_0x81ab('0x5a')],_0x81ab('0x5b'),_0x417680[_0x81ab('0x49')]['attachments'][_0x2bab9a][_0x81ab('0x5c')])};}}_0x4f2389={'account':_0x427b41,'message':_0x417680[_0x81ab('0x49')]};return;})[_0x81ab('0x15')](function(){if(_0x20d53c[_0x81ab('0x5d')]){if(_0x20d53c[_0x81ab('0x5d')][_0x81ab('0x52')][_0x81ab('0x39')]){return _0x20d53c['List']['Contacts'][0x0];}else{return db[_0x81ab('0x51')][_0x81ab('0x5e')](_[_0x81ab('0xe')](_0x417680[_0x81ab('0x49')],{'firstName':_0x417680[_0x81ab('0x49')]['to'],'email':_0x417680[_0x81ab('0x49')]['to'],'phone':_0x417680[_0x81ab('0x49')]['to'],'ListId':_0x20d53c[_0x81ab('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x81ab('0x15')](function(){if(_0x4f2389){return respondWithRpcPromise(_0x81ab('0x60'),_0x81ab('0x61'),_0x4f2389,client9003)[_0x81ab('0x15')](function(_0x39a19c){return _0x13edeb[_0x81ab('0x28')]({'read':!![],'messageId':_0x39a19c['messageId'],'sentAt':moment()['format'](_0x81ab('0x62'))});})[_0x81ab('0x20')](function(_0x306293){logger[_0x81ab('0x1d')]('%s',JSON['stringify'](_0x306293));return _0x13edeb;});}return _0x13edeb;});}return _0x13edeb;}})[_0x81ab('0x15')](respondWithResult(_0x23cb2d,0xc9))[_0x81ab('0x20')](handleError(_0x23cb2d,null));};exports['accept']=function(_0x49d8ad,_0x187602){var _0x2ecd4f={'agent':{},'channel':'mail'};if(_0x49d8ad[_0x81ab('0x49')]['id']){delete _0x49d8ad[_0x81ab('0x49')]['id'];}_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x63')]=!![];_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x64')]=moment()[_0x81ab('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')]=_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')]||_0x49d8ad['user']['id'];_0x2ecd4f[_0x81ab('0x67')]['id']=_0x49d8ad['body'][_0x81ab('0x66')];return db[_0x81ab('0x41')]['find']({'where':{'id':_0x49d8ad[_0x81ab('0x4a')]['id'],'UserId':null}})[_0x81ab('0x15')](handleEntityNotFound(_0x187602,null))[_0x81ab('0x15')](saveUpdates(_0x49d8ad[_0x81ab('0x49')],null))['then'](function(_0x13e878){if(_0x13e878){_0x2ecd4f[_0x81ab('0x1e')]=_0x13e878[_0x81ab('0x68')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x13e878['MailInteractionId']}});}return null;})[_0x81ab('0x15')](handleEntityNotFound(_0x187602,null))[_0x81ab('0x15')](function(_0xe44ab6){if(_0xe44ab6){return _0xe44ab6[_0x81ab('0x28')]({'UserId':_0x49d8ad['body']['UserId'],'read1stAt':_[_0x81ab('0x69')](_0xe44ab6[_0x81ab('0x6a')])?moment()[_0x81ab('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4d9477){if(_0x4d9477){_0x2ecd4f[_0x81ab('0x6b')]=_0x4d9477[_0x81ab('0x68')]({'plain':!![]});interaction_log[_0x81ab('0x16')](_0x81ab('0x6c'),_0x49d8ad[_0x81ab('0x6d')]['id'],_0x49d8ad['user'][_0x81ab('0x2d')],_0x49d8ad[_0x81ab('0x6d')][_0x81ab('0x6e')],_0x2ecd4f['interaction']['id'],_0x49d8ad['body']?JSON[_0x81ab('0x1b')](_0x49d8ad[_0x81ab('0x49')]):_0x81ab('0x6f'));return respondWithRpcPromise(_0x81ab('0x70'),'acceptMessage',_0x2ecd4f);}return null;})[_0x81ab('0x15')](function(_0x123894){var _0xbb45ea=_0x81ab('0x71')+_0x123894['message'][_0x81ab('0x72')];return db[_0x81ab('0x73')]['query'](_0xbb45ea,{'type':db['Sequelize'][_0x81ab('0x74')][_0x81ab('0x75')],'raw':!![]})[_0x81ab('0x15')](function(_0x52e639){return _0x52e639;});})[_0x81ab('0x15')](function(_0x44ff65){if(_0x44ff65){_0x2ecd4f['message'][_0x81ab('0x76')]=_0x44ff65[0x0];if(!_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')])return;return db[_0x81ab('0x77')][_0x81ab('0x48')]({'where':{'id':_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')],'role':'agent'},'attributes':['id',_0x81ab('0x2d'),_0x81ab('0x78'),_0x81ab('0x79'),_0x81ab('0x7a')],'raw':!![]});}return null;})['then'](function(_0x2a257d){if(!_0x2a257d)return null;_0x2ecd4f['message'][_0x81ab('0x67')]=_0x2a257d;return _0x2ecd4f;})[_0x81ab('0x15')](function(_0x3e7e00){if(_0x3e7e00){if(_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x7b')]){_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7c')]=util[_0x81ab('0x65')](_0x81ab('0x7d'),_0x49d8ad[_0x81ab('0x6d')][_0x81ab('0x2d')]);_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7e')]=_0x2ecd4f[_0x81ab('0x7e')];_0x2ecd4f['message']['motionChannel']=_0x2ecd4f['channel'];_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7f')]=_0x81ab('0x80');_0x2ecd4f['message'][_0x81ab('0x49')]=htmlToText[_0x81ab('0x81')](_0x2ecd4f[_0x81ab('0x1e')]['body']);return respondWithRpcPromise(_0x81ab('0x82'),_0x81ab('0x82'),{'event':'acceptmessage','message':_0x2ecd4f[_0x81ab('0x1e')]},client9002)[_0x81ab('0x15')](function(){return _0x2ecd4f;});}return _0x2ecd4f;}return null;})[_0x81ab('0x15')](respondWithResult(_0x187602,null))[_0x81ab('0x20')](handleError(_0x187602,null));};exports['reject']=function(_0x4c8b86,_0x4decf7){var _0x119d2c={'agent':{},'channel':_0x81ab('0x83')};if(_0x4c8b86['body']['id']){delete _0x4c8b86[_0x81ab('0x49')]['id'];}_0x4c8b86['body'][_0x81ab('0x66')]=_0x4c8b86[_0x81ab('0x49')]['UserId']||_0x4c8b86[_0x81ab('0x6d')]['id'];_0x119d2c[_0x81ab('0x67')]['id']=_0x4c8b86['body']['UserId'];return db[_0x81ab('0x41')][_0x81ab('0x48')]({'where':{'id':_0x4c8b86[_0x81ab('0x4a')]['id'],'UserId':null}})[_0x81ab('0x15')](handleEntityNotFound(_0x4decf7,null))[_0x81ab('0x15')](function(_0x730486){if(_0x730486){_0x119d2c[_0x81ab('0x1e')]=_0x730486[_0x81ab('0x68')]({'plain':!![]});return db[_0x81ab('0x84')][_0x81ab('0x48')]({'where':{'id':_0x730486[_0x81ab('0x85')]}});}return null;})['then'](handleEntityNotFound(_0x4decf7,null))[_0x81ab('0x15')](function(_0x46472b){if(_0x46472b){_0x119d2c[_0x81ab('0x6b')]=_0x46472b[_0x81ab('0x68')]({'plain':!![]});interaction_log[_0x81ab('0x16')](_0x81ab('0x86'),_0x4c8b86[_0x81ab('0x6d')]['id'],_0x4c8b86[_0x81ab('0x6d')][_0x81ab('0x2d')],_0x4c8b86['user']['role'],_0x119d2c['interaction']['id'],_0x4c8b86[_0x81ab('0x49')]?JSON['stringify'](_0x4c8b86['body']):_0x81ab('0x6f'));return respondWithRpcPromise(_0x81ab('0x87'),_0x81ab('0x88'),_0x119d2c);}return null;})[_0x81ab('0x15')](function(_0x1f5ce0){var _0xfd5dd7=_0x81ab('0x71')+_0x1f5ce0[_0x81ab('0x1e')][_0x81ab('0x72')];return db[_0x81ab('0x73')]['query'](_0xfd5dd7,{'type':db[_0x81ab('0x89')][_0x81ab('0x74')]['SELECT'],'raw':!![]})[_0x81ab('0x15')](function(_0x53a4c1){return _0x53a4c1;});})[_0x81ab('0x15')](function(_0x49fcab){if(_0x49fcab){_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x76')]=_0x49fcab[0x0];if(!_0x4c8b86['body'][_0x81ab('0x66')])return;return db['User']['find']({'where':{'id':_0x4c8b86[_0x81ab('0x49')][_0x81ab('0x66')],'role':'agent'},'attributes':['id',_0x81ab('0x2d'),_0x81ab('0x78'),_0x81ab('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0xc99dc1){if(!_0xc99dc1)return null;_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x67')]=_0xc99dc1;return _0x119d2c;})[_0x81ab('0x15')](function(_0x5baa03){if(_0x5baa03){_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x7c')]=util[_0x81ab('0x65')](_0x81ab('0x7d'),_0x4c8b86[_0x81ab('0x6d')][_0x81ab('0x2d')]);_0x5baa03['message'][_0x81ab('0x7e')]=_0x119d2c[_0x81ab('0x7e')];_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x8a')]=_0x119d2c[_0x81ab('0x7e')];_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x7f')]=_0x81ab('0x8b');_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x49')]=htmlToText[_0x81ab('0x81')](_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x49')]);respondWithRpcPromise(_0x81ab('0x82'),'EventManager',{'event':'rejectmessage','message':_0x5baa03[_0x81ab('0x1e')]},client9002);return _0x119d2c;}return null;})['then'](respondWithResult(_0x4decf7,null))['catch'](handleError(_0x4decf7,null));};exports[_0x81ab('0x8c')]=function(_0x29cbed,_0x4e713e){var _0x1a3cc6=moment()['unix']()[_0x81ab('0x8d')]();var _0xb32bc9=path[_0x81ab('0x59')](config[_0x81ab('0x5a')],'server',_0x81ab('0x8e'),_0x81ab('0x8f'));var _0x4e41a9=path['join'](config[_0x81ab('0x5a')],_0x81ab('0x90'),_0x81ab('0x8e'),'attachments');var _0x26ae34=util[_0x81ab('0x65')](_0x81ab('0x91'),_0x1a3cc6);return db[_0x81ab('0x41')]['find']({'where':{'id':_0x29cbed[_0x81ab('0x4a')]['id']},'attributes':['id',_0x81ab('0x49'),_0x81ab('0x92'),'to','cc',_0x81ab('0x93'),_0x81ab('0x94'),_0x81ab('0x95')],'include':_0x29cbed[_0x81ab('0x34')]['attachments']?[{'model':db[_0x81ab('0x96')],'as':'Attachments'}]:undefined})[_0x81ab('0x15')](handleEntityNotFound(_0x4e713e,null))[_0x81ab('0x15')](function(_0x314e6a){if(_0x314e6a){var _0x3004ad=_0x314e6a;var _0xd78866={'from':_0x3004ad[_0x81ab('0x92')],'to':_0x3004ad['to'],'subject':_0x3004ad[_0x81ab('0x94')],'html':htmlEntities[_0x81ab('0x97')](_0x3004ad[_0x81ab('0x49')]),'headers':{'Date':moment(_0x3004ad['createdAt'])[_0x81ab('0x65')](_0x81ab('0x98'))},'attachments':[]};if(_0x314e6a['cc']){_0xd78866['headers']['Cc']=_0x314e6a['cc'];}if(_0x314e6a[_0x81ab('0x93')]){_0xd78866['headers'][_0x81ab('0x99')]=_0x314e6a[_0x81ab('0x93')];}return new BPromise(function(_0x4afe61,_0x2697ff){if(_0x314e6a[_0x81ab('0x9a')]){for(var _0x34ef98=0x0;_0x34ef98<_0x314e6a[_0x81ab('0x9a')][_0x81ab('0x39')];_0x34ef98++){var _0x16247f=_0x314e6a[_0x81ab('0x9a')][_0x34ef98];var _0x44fa17=path['join'](_0x4e41a9,_0x16247f[_0x81ab('0x5c')]);if(fs[_0x81ab('0x9b')](_0x44fa17)){_0xd78866[_0x81ab('0x58')][_0x81ab('0x9c')]({'name':_0x16247f[_0x81ab('0x2d')],'contentType':_0x16247f[_0x81ab('0x31')],'data':fs[_0x81ab('0x9d')](_0x44fa17)});}}}emlformat['build'](_0xd78866,function(_0x12dd7d,_0xa29d5d){if(_0x12dd7d)return _0x2697ff(_0x12dd7d);fs[_0x81ab('0x9e')](path['join'](_0xb32bc9,_0x26ae34),_0xa29d5d);return _0x4afe61(_0xa29d5d);});});}})[_0x81ab('0x15')](function(_0x2f2eb2){if(_0x2f2eb2){return _0x4e713e['download'](path[_0x81ab('0x59')](_0xb32bc9,_0x26ae34),_0x26ae34,function(_0xe298ed){if(!_0xe298ed)fs[_0x81ab('0x9f')](path[_0x81ab('0x59')](_0xb32bc9,_0x26ae34));});}})['catch'](handleError(_0x4e713e,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 2c967b3..e2064c4 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 _0x9e52=['../../mysqldb','MailMessage','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9e52,0xaa));var _0x29e5=function(_0x41cbcd,_0x2b455a){_0x41cbcd=_0x41cbcd-0x0;var _0x24f13a=_0x9e52[_0x41cbcd];return _0x24f13a;};'use strict';var EventEmitter=require(_0x29e5('0x0'));var MailMessage=require(_0x29e5('0x1'))['db'][_0x29e5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x29e5('0x3'),'afterDestroy':_0x29e5('0x4')};function emitEvent(_0x3d8e79){return function(_0x35d2e7,_0x282d1f,_0x3be517){MailMessageEvents['emit'](_0x3d8e79+':'+_0x35d2e7['id'],_0x35d2e7);MailMessageEvents[_0x29e5('0x5')](_0x3d8e79,_0x35d2e7);_0x3be517(null);};}for(var e in events){if(events[_0x29e5('0x6')](e)){var event=events[e];MailMessage[_0x29e5('0x7')](e,emitEvent(event));}}module[_0x29e5('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x4d6a=['exports','../../mysqldb','save','update','remove','emit','hook'];(function(_0x262b56,_0x489281){var _0x106c6e=function(_0x42dd25){while(--_0x42dd25){_0x262b56['push'](_0x262b56['shift']());}};_0x106c6e(++_0x489281);}(_0x4d6a,0xd3));var _0xa4d6=function(_0x5aa295,_0x370e55){_0x5aa295=_0x5aa295-0x0;var _0x236b89=_0x4d6a[_0x5aa295];return _0x236b89;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xa4d6('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4d6('0x1'),'afterUpdate':_0xa4d6('0x2'),'afterDestroy':_0xa4d6('0x3')};function emitEvent(_0x3b4cc6){return function(_0x5917c5,_0x265fb4,_0x306c8f){MailMessageEvents[_0xa4d6('0x4')](_0x3b4cc6+':'+_0x5917c5['id'],_0x5917c5);MailMessageEvents[_0xa4d6('0x4')](_0x3b4cc6,_0x5917c5);_0x306c8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xa4d6('0x5')](e,emitEvent(event));}}module[_0xa4d6('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index c6d1258..3372922 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 _0x7df9=['catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailMessage.attributes','exports','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','then','update','createdAt'];(function(_0x134229,_0x198c73){var _0x169966=function(_0x597ac0){while(--_0x597ac0){_0x134229['push'](_0x134229['shift']());}};_0x169966(++_0x198c73);}(_0x7df9,0xa3));var _0x97df=function(_0x165b54,_0x28895d){_0x165b54=_0x165b54-0x0;var _0x396a8=_0x7df9[_0x165b54];return _0x396a8;};'use strict';var _=require(_0x97df('0x0'));var util=require(_0x97df('0x1'));var logger=require(_0x97df('0x2'))(_0x97df('0x3'));var moment=require(_0x97df('0x4'));var BPromise=require('bluebird');var rp=require(_0x97df('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x97df('0x6'));var rimraf=require('rimraf');var config=require(_0x97df('0x7'));var attributes=require(_0x97df('0x8'));module[_0x97df('0x9')]=function(_0x2b9ce0,_0x48a5a6){return _0x2b9ce0['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x97df('0xa')]},{'name':_0x97df('0xb'),'fields':[_0x97df('0xc'),_0x97df('0xd')],'type':_0x97df('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x594d90,_0x227499,_0x336c4f){if(_0x594d90[_0x97df('0xf')]){_0x594d90[_0x97df('0xc')]=htmlToText[_0x97df('0x10')](_0x594d90[_0x97df('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x336c4f(null,_0x227499);},'afterCreate':function(_0x197fb5,_0x1762a6,_0x7b3586){var _0x25c89e=_0x2b9ce0[_0x97df('0x11')];var _0x52d355=_0x197fb5[_0x97df('0x12')]({'plain':!![]});if(_0x52d355[_0x97df('0x13')]['toLowerCase']()==='in'||_0x52d355[_0x97df('0x13')][_0x97df('0x14')]()===_0x97df('0x15')&&!_0x52d355[_0x97df('0x16')]&&!_['isNil'](_0x52d355[_0x97df('0x17')])){_0x25c89e[_0x97df('0x18')][_0x97df('0x19')]({'where':{'id':_0x52d355['MailInteractionId']}})[_0x97df('0x1a')](function(_0x5d27ce){if(_0x5d27ce){_0x5d27ce[_0x97df('0x1b')]({'lastMsgAt':_0x52d355[_0x97df('0x1c')],'lastMsgDirection':_0x52d355['direction'][_0x97df('0x14')]()});}})[_0x97df('0x1d')](function(_0x368349){console['error'](_0x368349);});}_0x7b3586();}},'charset':_0x97df('0x1e'),'collate':_0x97df('0x1f')});}; \ No newline at end of file +var _0x601e=['secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','direction','toLowerCase','out'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x601e,0x18a));var _0xe601=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0x601e[_0x50fda9];return _0x36b92b;};'use strict';var _=require(_0xe601('0x0'));var util=require(_0xe601('0x1'));var logger=require('../../config/logger')(_0xe601('0x2'));var moment=require(_0xe601('0x3'));var BPromise=require(_0xe601('0x4'));var rp=require(_0xe601('0x5'));var htmlToText=require(_0xe601('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe601('0x7'));var config=require('../../config/environment');var attributes=require(_0xe601('0x8'));module[_0xe601('0x9')]=function(_0x4266e4,_0x1f64b8){return _0x4266e4[_0xe601('0xa')]('MailMessage',attributes,{'tableName':_0xe601('0xb'),'paranoid':![],'indexes':[{'name':_0xe601('0xc'),'fields':[_0xe601('0xc')]},{'name':_0xe601('0xd'),'fields':[_0xe601('0xe'),_0xe601('0xf')],'type':_0xe601('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e3db2,_0x5aa042,_0x318cb5){if(_0x5e3db2['body']){_0x5e3db2[_0xe601('0xe')]=htmlToText[_0xe601('0x11')](_0x5e3db2[_0xe601('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x318cb5(null,_0x5aa042);},'afterCreate':function(_0x32a96d,_0x54798c,_0x356e2d){var _0x239e5f=_0x4266e4['models'];var _0x10c590=_0x32a96d['get']({'plain':!![]});if(_0x10c590[_0xe601('0x13')]['toLowerCase']()==='in'||_0x10c590['direction'][_0xe601('0x14')]()===_0xe601('0x15')&&!_0x10c590[_0xe601('0x16')]&&!_['isNil'](_0x10c590[_0xe601('0x17')])){_0x239e5f[_0xe601('0x18')][_0xe601('0x19')]({'where':{'id':_0x10c590[_0xe601('0x1a')]}})['then'](function(_0x47d785){if(_0x47d785){_0x47d785[_0xe601('0x1b')]({'lastMsgAt':_0x10c590[_0xe601('0x1c')],'lastMsgDirection':_0x10c590[_0xe601('0x13')][_0xe601('0x14')]()});}})[_0xe601('0x1d')](function(_0x4e16fd){console[_0xe601('0x1e')](_0x4e16fd);});}_0x356e2d();}},'charset':_0xe601('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index f4ada34..e269ff0 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 _0x4024=['debug','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2d3954,_0x13d066){var _0x54a52a=function(_0x50d6b0){while(--_0x50d6b0){_0x2d3954['push'](_0x2d3954['shift']());}};_0x54a52a(++_0x13d066);}(_0x4024,0x89));var _0x4402=function(_0x15c32d,_0x1bb90f){_0x15c32d=_0x15c32d-0x0;var _0x175994=_0x4024[_0x15c32d];return _0x175994;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')](_0x5cb0c5[_0x4402('0x17')],{'raw':_0x5cb0c5['options']?_0x5cb0c5[_0x4402('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6f1f72){logger[_0x4402('0x12')](_0x4402('0x14'),_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x6f1f72));_0x4e0340(_0x6f1f72);})[_0x4402('0x13')](function(_0x6b1fc5){logger[_0x4402('0xf')]('CreateMailMessage',_0x6b1fc5[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459['error'](0x1f4,_0x6b1fc5[_0x4402('0x11')]));});});}; \ No newline at end of file +var _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dc704,_0x420ef8){var _0xe12eb3=function(_0x34a350){while(--_0x34a350){_0x4dc704['push'](_0x4dc704['shift']());}};_0xe12eb3(++_0x420ef8);}(_0x5c3c,0x132));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 51c7021..f7125a2 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 _0x4ee1=['length','./mailMessage.events','save','emit','register'];(function(_0xe6ec8a,_0x44f4c7){var _0x255b1e=function(_0x4743f1){while(--_0x4743f1){_0xe6ec8a['push'](_0xe6ec8a['shift']());}};_0x255b1e(++_0x44f4c7);}(_0x4ee1,0x1a5));var _0x14ee=function(_0x35e12d,_0x34e988){_0x35e12d=_0x35e12d-0x0;var _0x47bd07=_0x4ee1[_0x35e12d];return _0x47bd07;};'use strict';var MailMessageEvents=require(_0x14ee('0x0'));var events=[_0x14ee('0x1'),'remove','update'];function createListener(_0x4b556a,_0x224785){return function(_0xf51f85){_0x224785[_0x14ee('0x2')](_0x4b556a,_0xf51f85);};}function removeListener(_0x329582,_0x31b2e5){return function(){MailMessageEvents['removeListener'](_0x329582,_0x31b2e5);};}exports[_0x14ee('0x3')]=function(_0x299402){for(var _0x58046b=0x0,_0x28cd44=events[_0x14ee('0x4')];_0x58046b<_0x28cd44;_0x58046b++){var _0x5b3cee=events[_0x58046b];var _0x53f5cf=createListener('mailMessage:'+_0x5b3cee,_0x299402);MailMessageEvents['on'](_0x5b3cee,_0x53f5cf);}}; \ No newline at end of file +var _0x34ad=['./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x22fb20,_0x3a7406){var _0x59065e=function(_0x419250){while(--_0x419250){_0x22fb20['push'](_0x22fb20['shift']());}};_0x59065e(++_0x3a7406);}(_0x34ad,0x181));var _0xd34a=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0x34ad[_0x250071];return _0x34e574;};'use strict';var MailMessageEvents=require(_0xd34a('0x0'));var events=[_0xd34a('0x1'),_0xd34a('0x2'),_0xd34a('0x3')];function createListener(_0x523878,_0x430aed){return function(_0x2aa7d8){_0x430aed[_0xd34a('0x4')](_0x523878,_0x2aa7d8);};}function removeListener(_0x487e69,_0x2fe32a){return function(){MailMessageEvents[_0xd34a('0x5')](_0x487e69,_0x2fe32a);};}exports[_0xd34a('0x6')]=function(_0x200419){for(var _0x533822=0x0,_0x4b8326=events['length'];_0x533822<_0x4b8326;_0x533822++){var _0x42557b=events[_0x533822];var _0x2d62ce=createListener('mailMessage:'+_0x42557b,_0x200419);MailMessageEvents['on'](_0x42557b,_0x2d62ce);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1c14126..6a96bf1 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 _0xee50=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','/:id','update','destroy','delete','removeTeams','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members'];(function(_0x4e3bc0,_0x349c7d){var _0x1c9e3a=function(_0x9596c0){while(--_0x9596c0){_0x4e3bc0['push'](_0x4e3bc0['shift']());}};_0x1c9e3a(++_0x349c7d);}(_0xee50,0xd1));var _0x0ee5=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xee50[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require(_0x0ee5('0x0'));var path=require(_0x0ee5('0x1'));var timeout=require(_0x0ee5('0x2'));var express=require(_0x0ee5('0x3'));var router=express['Router']();var fs_extra=require(_0x0ee5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ee5('0x5'));var config=require(_0x0ee5('0x6'));var controller=require(_0x0ee5('0x7'));router[_0x0ee5('0x8')]('/',auth[_0x0ee5('0x9')](),controller[_0x0ee5('0xa')]);router['get'](_0x0ee5('0xb'),auth[_0x0ee5('0x9')](),controller[_0x0ee5('0xc')]);router[_0x0ee5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0ee5('0xd')]);router[_0x0ee5('0x8')](_0x0ee5('0xe'),auth['isAuthenticated'](),controller[_0x0ee5('0xf')]);router['get'](_0x0ee5('0x10'),auth[_0x0ee5('0x9')](),controller[_0x0ee5('0x11')]);router[_0x0ee5('0x8')](_0x0ee5('0x12'),auth[_0x0ee5('0x9')](),controller['getAgents']);router[_0x0ee5('0x13')]('/',auth[_0x0ee5('0x9')](),controller[_0x0ee5('0x14')]);router[_0x0ee5('0x13')](_0x0ee5('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x0ee5('0x13')](_0x0ee5('0x12'),auth[_0x0ee5('0x9')](),controller[_0x0ee5('0x15')]);router[_0x0ee5('0x16')](_0x0ee5('0x17'),auth[_0x0ee5('0x9')](),controller[_0x0ee5('0x18')]);router['delete'](_0x0ee5('0x17'),auth['isAuthenticated'](),controller[_0x0ee5('0x19')]);router[_0x0ee5('0x1a')]('/:id/teams',auth[_0x0ee5('0x9')](),controller[_0x0ee5('0x1b')]);router[_0x0ee5('0x1a')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x625d=['getAgents','post','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','show','getMembers','/:id/teams','getTeams'];(function(_0x31c1de,_0x5e926a){var _0x135cf1=function(_0x52f28c){while(--_0x52f28c){_0x31c1de['push'](_0x31c1de['shift']());}};_0x135cf1(++_0x5e926a);}(_0x625d,0x1e8));var _0xd625=function(_0xd8768,_0x3fedcb){_0xd8768=_0xd8768-0x0;var _0x46228f=_0x625d[_0xd8768];return _0x46228f;};'use strict';var multer=require(_0xd625('0x0'));var util=require(_0xd625('0x1'));var path=require(_0xd625('0x2'));var timeout=require(_0xd625('0x3'));var express=require(_0xd625('0x4'));var router=express[_0xd625('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd625('0x6'));var interaction=require(_0xd625('0x7'));var config=require('../../config/environment');var controller=require(_0xd625('0x8'));router[_0xd625('0x9')]('/',auth[_0xd625('0xa')](),controller[_0xd625('0xb')]);router[_0xd625('0x9')]('/describe',auth[_0xd625('0xa')](),controller['describe']);router[_0xd625('0x9')]('/:id',auth[_0xd625('0xa')](),controller[_0xd625('0xc')]);router[_0xd625('0x9')]('/:id/members',auth[_0xd625('0xa')](),controller[_0xd625('0xd')]);router[_0xd625('0x9')](_0xd625('0xe'),auth['isAuthenticated'](),controller[_0xd625('0xf')]);router[_0xd625('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xd625('0x10')]);router[_0xd625('0x11')]('/',auth[_0xd625('0xa')](),controller['create']);router[_0xd625('0x11')](_0xd625('0xe'),auth[_0xd625('0xa')](),controller[_0xd625('0x12')]);router[_0xd625('0x11')](_0xd625('0x13'),auth['isAuthenticated'](),controller[_0xd625('0x14')]);router[_0xd625('0x15')]('/:id',auth[_0xd625('0xa')](),controller[_0xd625('0x16')]);router[_0xd625('0x17')](_0xd625('0x18'),auth[_0xd625('0xa')](),controller[_0xd625('0x19')]);router['delete'](_0xd625('0xe'),auth[_0xd625('0xa')](),controller[_0xd625('0x1a')]);router['delete'](_0xd625('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd625('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index b626f3d..ff053b8 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 _0xe4e5=['STRING','name','roundrobin','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e5,0x67));var _0x5e4e=function(_0x282d8f,_0x576bb7){_0x282d8f=_0x282d8f-0x0;var _0x3a79cb=_0xe4e5[_0x282d8f];return _0x3a79cb;};'use strict';var Sequelize=require('sequelize');module[_0x5e4e('0x0')]={'name':{'type':Sequelize[_0x5e4e('0x1')],'unique':_0x5e4e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5e4e('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5e4e('0x3'))}}; \ No newline at end of file +var _0xb0c5=['name','INTEGER','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x23a9f5,_0x49a481){var _0x5b9ed9=function(_0x39142c){while(--_0x39142c){_0x23a9f5['push'](_0x23a9f5['shift']());}};_0x5b9ed9(++_0x49a481);}(_0xb0c5,0x1e0));var _0x5b0c=function(_0x11d9af,_0x2415d8){_0x11d9af=_0x11d9af-0x0;var _0x14b992=_0xb0c5[_0x11d9af];return _0x14b992;};'use strict';var Sequelize=require(_0x5b0c('0x0'));module[_0x5b0c('0x1')]={'name':{'type':Sequelize[_0x5b0c('0x2')],'unique':_0x5b0c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5b0c('0x2')]},'timeout':{'type':Sequelize[_0x5b0c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5b0c('0x5'),_0x5b0c('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 59ec1b6..953215d 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 _0xd1a8=['TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','mailPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xd1a8,0x9a));var _0x8d1a=function(_0x1a8329,_0x330805){_0x1a8329=_0x1a8329-0x0;var _0x41123e=_0xd1a8[_0x1a8329];return _0x41123e;};'use strict';var emlformat=require(_0x8d1a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d1a('0x1'));var moment=require(_0x8d1a('0x2'));var BPromise=require(_0x8d1a('0x3'));var Mustache=require(_0x8d1a('0x4'));var util=require(_0x8d1a('0x5'));var path=require('path');var sox=require(_0x8d1a('0x6'));var csv=require(_0x8d1a('0x7'));var ejs=require(_0x8d1a('0x8'));var fs=require('fs');var fs_extra=require(_0x8d1a('0x9'));var _=require(_0x8d1a('0xa'));var squel=require(_0x8d1a('0xb'));var crypto=require(_0x8d1a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d1a('0x7'));var querystring=require(_0x8d1a('0xd'));var Papa=require('papaparse');var Redis=require(_0x8d1a('0xe'));var authService=require(_0x8d1a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8d1a('0x10'));var hardwareService=require(_0x8d1a('0x11'));var logger=require(_0x8d1a('0x12'))(_0x8d1a('0x13'));var utils=require(_0x8d1a('0x14'));var config=require(_0x8d1a('0x15'));var licenseUtil=require(_0x8d1a('0x16'));var db=require(_0x8d1a('0x17'))['db'];config[_0x8d1a('0x18')]=_[_0x8d1a('0x19')](config[_0x8d1a('0x18')],{'host':_0x8d1a('0x1a'),'port':0x18eb});var socket=require(_0x8d1a('0x1b'))(new Redis(config[_0x8d1a('0x18')]));require('./mailQueue.socket')[_0x8d1a('0x1c')](socket);function respondWithStatusCode(_0x3cfa54,_0x21994b){_0x21994b=_0x21994b||0xcc;return function(_0x1d7e27){if(_0x1d7e27){return _0x3cfa54[_0x8d1a('0x1d')](_0x21994b);}return _0x3cfa54[_0x8d1a('0x1e')](_0x21994b)[_0x8d1a('0x1f')]();};}function respondWithResult(_0x1cfaef,_0x1f936f){_0x1f936f=_0x1f936f||0xc8;return function(_0x2d8b1d){if(_0x2d8b1d){return _0x1cfaef[_0x8d1a('0x1e')](_0x1f936f)[_0x8d1a('0x20')](_0x2d8b1d);}};}function respondWithFilteredResult(_0x18ff65,_0x278fab){return function(_0x22439c){if(_0x22439c){var _0x341247=typeof _0x278fab[_0x8d1a('0x21')]===_0x8d1a('0x22')&&typeof _0x278fab[_0x8d1a('0x23')]==='undefined';var _0x58c5a4=_0x22439c[_0x8d1a('0x24')];var _0xd69103=_0x341247?0x0:_0x278fab['offset'];var _0x50d514=_0x341247?_0x22439c[_0x8d1a('0x24')]:_0x278fab[_0x8d1a('0x21')]+_0x278fab['limit'];var _0x52bd04;if(_0x50d514>=_0x58c5a4){_0x50d514=_0x58c5a4;_0x52bd04=0xc8;}else{_0x52bd04=0xce;}_0x18ff65[_0x8d1a('0x1e')](_0x52bd04);return _0x18ff65['set']('Content-Range',_0xd69103+'-'+_0x50d514+'/'+_0x58c5a4)['json'](_0x22439c);}return null;};}function patchUpdates(_0x44c0d2){return function(_0x4720c8){try{jsonpatch[_0x8d1a('0x25')](_0x4720c8,_0x44c0d2,!![]);}catch(_0x26f64d){return BPromise[_0x8d1a('0x26')](_0x26f64d);}return _0x4720c8['save']();};}function saveUpdates(_0x3dde95,_0x2ed74c){return function(_0x529fec){if(_0x529fec){return _0x529fec[_0x8d1a('0x27')](_0x3dde95)[_0x8d1a('0x28')](function(_0xb75ba7){return _0xb75ba7;});}return null;};}function removeEntity(_0x38c71b,_0x4a0bc1){return function(_0x53a1e8){if(_0x53a1e8){return _0x53a1e8[_0x8d1a('0x29')]()[_0x8d1a('0x28')](function(){var _0xc2517e=_0x53a1e8[_0x8d1a('0x2a')]({'plain':!![]});var _0x477a1c='MailQueues';return db[_0x8d1a('0x2b')][_0x8d1a('0x29')]({'where':{'type':_0x477a1c,'resourceId':_0xc2517e['id']}})['then'](function(){return _0x53a1e8;});})['then'](function(){_0x38c71b[_0x8d1a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7aed38,_0x459c3d){return function(_0x7eade2){if(!_0x7eade2){_0x7aed38[_0x8d1a('0x1d')](0x194);}return _0x7eade2;};}function handleError(_0x24cc58,_0x35ed8c){_0x35ed8c=_0x35ed8c||0x1f4;return function(_0x42bb77){logger[_0x8d1a('0x2c')](_0x42bb77[_0x8d1a('0x2d')]);if(_0x42bb77[_0x8d1a('0x2e')]){delete _0x42bb77[_0x8d1a('0x2e')];}_0x24cc58['status'](_0x35ed8c)[_0x8d1a('0x2f')](_0x42bb77);};}exports[_0x8d1a('0x30')]=function(_0x662968,_0x2a2698){var _0x43bf4b={},_0x181130={},_0x2be00b={'count':0x0,'rows':[]};var _0x292b23=_[_0x8d1a('0x31')](db[_0x8d1a('0x32')][_0x8d1a('0x33')],function(_0x33b9a3){return{'name':_0x33b9a3[_0x8d1a('0x34')],'type':_0x33b9a3['type']['key']};});_0x181130['model']=_['map'](_0x292b23,'name');_0x181130[_0x8d1a('0x35')]=_[_0x8d1a('0x36')](_0x662968[_0x8d1a('0x35')]);_0x181130['filters']=_[_0x8d1a('0x37')](_0x181130[_0x8d1a('0x38')],_0x181130[_0x8d1a('0x35')]);_0x43bf4b[_0x8d1a('0x39')]=_[_0x8d1a('0x37')](_0x181130[_0x8d1a('0x38')],qs[_0x8d1a('0x3a')](_0x662968[_0x8d1a('0x35')][_0x8d1a('0x3a')]));_0x43bf4b[_0x8d1a('0x39')]=_0x43bf4b[_0x8d1a('0x39')][_0x8d1a('0x3b')]?_0x43bf4b[_0x8d1a('0x39')]:_0x181130[_0x8d1a('0x38')];if(!_0x662968[_0x8d1a('0x35')][_0x8d1a('0x3c')](_0x8d1a('0x3d'))){_0x43bf4b[_0x8d1a('0x23')]=qs[_0x8d1a('0x23')](_0x662968[_0x8d1a('0x35')][_0x8d1a('0x23')]);_0x43bf4b['offset']=qs[_0x8d1a('0x21')](_0x662968[_0x8d1a('0x35')]['offset']);}_0x43bf4b[_0x8d1a('0x3e')]=qs[_0x8d1a('0x3f')](_0x662968[_0x8d1a('0x35')][_0x8d1a('0x3f')]);_0x43bf4b['where']=qs[_0x8d1a('0x40')](_[_0x8d1a('0x41')](_0x662968['query'],_0x181130['filters']),_0x292b23);if(_0x662968['query'][_0x8d1a('0x42')]){_0x43bf4b[_0x8d1a('0x43')]=_[_0x8d1a('0x44')](_0x43bf4b[_0x8d1a('0x43')],{'$or':_[_0x8d1a('0x31')](_0x292b23,function(_0x58faa4){if(_0x58faa4[_0x8d1a('0x45')]!==_0x8d1a('0x46')){var _0x6e187e={};_0x6e187e[_0x58faa4[_0x8d1a('0x2e')]]={'$like':'%'+_0x662968[_0x8d1a('0x35')][_0x8d1a('0x42')]+'%'};return _0x6e187e;}})});}_0x43bf4b=_[_0x8d1a('0x44')]({},_0x43bf4b,_0x662968['options']);var _0x596f77={'where':_0x43bf4b['where']};return db[_0x8d1a('0x32')]['count'](_0x596f77)[_0x8d1a('0x28')](function(_0x326a43){_0x2be00b[_0x8d1a('0x24')]=_0x326a43;if(_0x662968[_0x8d1a('0x35')][_0x8d1a('0x47')]){_0x43bf4b['include']=[{'all':!![]}];}return db[_0x8d1a('0x32')][_0x8d1a('0x48')](_0x43bf4b);})['then'](function(_0x28b661){_0x2be00b[_0x8d1a('0x49')]=_0x28b661;return _0x2be00b;})[_0x8d1a('0x28')](respondWithFilteredResult(_0x2a2698,_0x43bf4b))[_0x8d1a('0x4a')](handleError(_0x2a2698,null));};exports[_0x8d1a('0x4b')]=function(_0xa77b07,_0x35ef72){var _0x440bbc={'raw':!![],'where':{'id':_0xa77b07['params']['id']}},_0x4335ef={};_0x4335ef[_0x8d1a('0x38')]=_[_0x8d1a('0x36')](db[_0x8d1a('0x32')][_0x8d1a('0x33')]);_0x4335ef['query']=_[_0x8d1a('0x36')](_0xa77b07[_0x8d1a('0x35')]);_0x4335ef[_0x8d1a('0x40')]=_[_0x8d1a('0x37')](_0x4335ef[_0x8d1a('0x38')],_0x4335ef[_0x8d1a('0x35')]);_0x440bbc['attributes']=_[_0x8d1a('0x37')](_0x4335ef[_0x8d1a('0x38')],qs[_0x8d1a('0x3a')](_0xa77b07[_0x8d1a('0x35')][_0x8d1a('0x3a')]));_0x440bbc[_0x8d1a('0x39')]=_0x440bbc[_0x8d1a('0x39')][_0x8d1a('0x3b')]?_0x440bbc[_0x8d1a('0x39')]:_0x4335ef[_0x8d1a('0x38')];if(_0xa77b07[_0x8d1a('0x35')]['includeAll']){_0x440bbc[_0x8d1a('0x4c')]=[{'all':!![]}];}_0x440bbc=_[_0x8d1a('0x44')]({},_0x440bbc,_0xa77b07[_0x8d1a('0x4d')]);return db['MailQueue'][_0x8d1a('0x4e')](_0x440bbc)[_0x8d1a('0x28')](handleEntityNotFound(_0x35ef72,null))[_0x8d1a('0x28')](respondWithResult(_0x35ef72,null))[_0x8d1a('0x4a')](handleError(_0x35ef72,null));};exports[_0x8d1a('0x4f')]=function(_0x4e39c6,_0x143ee8){return db[_0x8d1a('0x32')]['create'](_0x4e39c6['body'],{})['then'](function(_0x40e4f8){var _0x465825=_0x4e39c6[_0x8d1a('0x50')][_0x8d1a('0x2a')]({'plain':!![]});if(!_0x465825)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x465825[_0x8d1a('0x51')]===_0x8d1a('0x50')){var _0x45fb98=_0x40e4f8[_0x8d1a('0x2a')]({'plain':!![]});var _0x4d8880='MailQueues';return db[_0x8d1a('0x52')][_0x8d1a('0x4e')]({'where':{'name':_0x4d8880,'userProfileId':_0x465825[_0x8d1a('0x53')]},'raw':!![]})['then'](function(_0x228c37){if(_0x228c37&&_0x228c37[_0x8d1a('0x54')]===0x0){return db[_0x8d1a('0x2b')]['create']({'name':_0x45fb98[_0x8d1a('0x2e')],'resourceId':_0x45fb98['id'],'type':_0x228c37[_0x8d1a('0x2e')],'sectionId':_0x228c37['id']},{})[_0x8d1a('0x28')](function(){return _0x40e4f8;});}else{return _0x40e4f8;}})[_0x8d1a('0x4a')](function(_0x5712ed){logger['error'](_0x8d1a('0x55'),_0x5712ed);throw _0x5712ed;});}return _0x40e4f8;})[_0x8d1a('0x28')](respondWithResult(_0x143ee8,0xc9))[_0x8d1a('0x4a')](handleError(_0x143ee8,null));};exports['update']=function(_0x214908,_0xa5ebd3){if(_0x214908[_0x8d1a('0x56')]['id']){delete _0x214908[_0x8d1a('0x56')]['id'];}return db[_0x8d1a('0x32')][_0x8d1a('0x4e')]({'where':{'id':_0x214908[_0x8d1a('0x57')]['id']}})[_0x8d1a('0x28')](handleEntityNotFound(_0xa5ebd3,null))['then'](saveUpdates(_0x214908[_0x8d1a('0x56')],null))[_0x8d1a('0x28')](respondWithResult(_0xa5ebd3,null))['catch'](handleError(_0xa5ebd3,null));};exports[_0x8d1a('0x29')]=function(_0x5c3f02,_0x5db5f0){return db[_0x8d1a('0x32')][_0x8d1a('0x4e')]({'where':{'id':_0x5c3f02['params']['id']}})[_0x8d1a('0x28')](handleEntityNotFound(_0x5db5f0,null))['then'](removeEntity(_0x5db5f0,null))['catch'](handleError(_0x5db5f0,null));};exports['describe']=function(_0x3f255b,_0x2e027d){return db['MailQueue'][_0x8d1a('0x58')]()[_0x8d1a('0x28')](respondWithResult(_0x2e027d,null))[_0x8d1a('0x4a')](handleError(_0x2e027d,null));};exports['getMembers']=function(_0x2fd7de,_0x5c7a39,_0x530c37){var _0x133b52={'raw':!![],'where':{}},_0xfbf33f={},_0xa0a5e6;return db[_0x8d1a('0x32')][_0x8d1a('0x59')]({'where':{'id':_0x2fd7de[_0x8d1a('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c7a39,null))[_0x8d1a('0x28')](function(_0x122b9b){if(_0x122b9b){_0xa0a5e6=_0x122b9b['get']({'plain':!![]});_0xfbf33f[_0x8d1a('0x38')]=_[_0x8d1a('0x36')](db['UserMailQueue']['rawAttributes']);_0xfbf33f['query']=_['keys'](_0x2fd7de[_0x8d1a('0x35')]);_0xfbf33f[_0x8d1a('0x40')]=_['intersection'](_0xfbf33f['model'],_0xfbf33f[_0x8d1a('0x35')]);_0x133b52[_0x8d1a('0x39')]=_[_0x8d1a('0x37')](_0xfbf33f[_0x8d1a('0x38')],qs[_0x8d1a('0x3a')](_0x2fd7de[_0x8d1a('0x35')][_0x8d1a('0x3a')]));_0x133b52['attributes']=_0x133b52['attributes']['length']?_0x133b52[_0x8d1a('0x39')]:_0xfbf33f[_0x8d1a('0x38')];if(!_0x2fd7de[_0x8d1a('0x35')][_0x8d1a('0x3c')](_0x8d1a('0x3d'))){_0x133b52[_0x8d1a('0x23')]=qs[_0x8d1a('0x23')](_0x2fd7de[_0x8d1a('0x35')]['limit']);_0x133b52[_0x8d1a('0x21')]=qs[_0x8d1a('0x21')](_0x2fd7de['query']['offset']);}_0x133b52[_0x8d1a('0x3e')]=qs['sort'](_0x2fd7de[_0x8d1a('0x35')][_0x8d1a('0x3f')]);_0x133b52[_0x8d1a('0x43')]=qs[_0x8d1a('0x40')](_['pick'](_0x2fd7de[_0x8d1a('0x35')],_0xfbf33f[_0x8d1a('0x40')]));_0x133b52[_0x8d1a('0x43')][_0x8d1a('0x5a')]=_0x122b9b['id'];if(_0x2fd7de[_0x8d1a('0x35')]['filter']){_0x133b52[_0x8d1a('0x43')]=_['merge'](_0x133b52[_0x8d1a('0x43')],{'$or':_['map'](_0x133b52['attributes'],function(_0x13654c){var _0x1e2595={};_0x1e2595[_0x13654c]={'$like':'%'+_0x2fd7de[_0x8d1a('0x35')][_0x8d1a('0x42')]+'%'};return _0x1e2595;})});}_0x133b52=_['merge']({},_0x133b52,_0x2fd7de['options']);return db[_0x8d1a('0x5b')]['findAll'](_0x133b52);}})[_0x8d1a('0x28')](function(_0x4ca649){if(_0x4ca649){return db[_0x8d1a('0x5c')][_0x8d1a('0x5d')]({'where':{'id':_[_0x8d1a('0x31')](_0x4ca649,_0x8d1a('0x5e')),'role':'agent'},'attributes':['id',_0x8d1a('0x2e'),_0x8d1a('0x5f'),'updatedAt',_0x8d1a('0x60')]});}})[_0x8d1a('0x28')](function(_0xf002af){if(_0xf002af){return{'count':_0xf002af[_0x8d1a('0x24')],'rows':_['map'](_0xf002af[_0x8d1a('0x49')],function(_0x40e076){return{'membername':_0x40e076[_0x8d1a('0x2e')],'UserId':_0x40e076['id'],'queue_name':_0xa0a5e6[_0x8d1a('0x2e')],'MailQueueId':_0xa0a5e6['id'],'interface':util[_0x8d1a('0x61')]('%s/%s',_0x8d1a('0x62'),_0x40e076['name']),'penalty':0x0,'paused':_0x40e076[_0x8d1a('0x5f')],'createdAt':_0x40e076['createdAt'],'updatedAt':_0x40e076[_0x8d1a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d1a('0x28')](respondWithFilteredResult(_0x5c7a39,_0x133b52))[_0x8d1a('0x4a')](handleError(_0x5c7a39,null));};exports[_0x8d1a('0x64')]=function(_0x85a330,_0x1f656d,_0x43088f){var _0xc07600={};var _0x26e1cc={};var _0xa1a20d;var _0x24ebd8;return db[_0x8d1a('0x32')][_0x8d1a('0x59')]({'where':{'id':_0x85a330[_0x8d1a('0x57')]['id']}})[_0x8d1a('0x28')](handleEntityNotFound(_0x1f656d,null))['then'](function(_0x231d87){if(_0x231d87){_0xa1a20d=_0x231d87;_0x26e1cc['model']=_[_0x8d1a('0x36')](db[_0x8d1a('0x65')][_0x8d1a('0x33')]);_0x26e1cc[_0x8d1a('0x35')]=_['keys'](_0x85a330[_0x8d1a('0x35')]);_0x26e1cc[_0x8d1a('0x40')]=_[_0x8d1a('0x37')](_0x26e1cc[_0x8d1a('0x38')],_0x26e1cc[_0x8d1a('0x35')]);_0xc07600[_0x8d1a('0x39')]=_[_0x8d1a('0x37')](_0x26e1cc[_0x8d1a('0x38')],qs[_0x8d1a('0x3a')](_0x85a330['query'][_0x8d1a('0x3a')]));_0xc07600['attributes']=_0xc07600[_0x8d1a('0x39')][_0x8d1a('0x3b')]?_0xc07600[_0x8d1a('0x39')]:_0x26e1cc[_0x8d1a('0x38')];_0xc07600[_0x8d1a('0x3e')]=qs['sort'](_0x85a330[_0x8d1a('0x35')][_0x8d1a('0x3f')]);_0xc07600[_0x8d1a('0x43')]=qs['filters'](_['pick'](_0x85a330[_0x8d1a('0x35')],_0x26e1cc[_0x8d1a('0x40')]));if(_0x85a330['query'][_0x8d1a('0x42')]){_0xc07600['where']=_['merge'](_0xc07600[_0x8d1a('0x43')],{'$or':_[_0x8d1a('0x31')](_0xc07600['attributes'],function(_0x6adbe7){var _0x498e2c={};_0x498e2c[_0x6adbe7]={'$like':'%'+_0x85a330[_0x8d1a('0x35')][_0x8d1a('0x42')]+'%'};return _0x498e2c;})});}_0xc07600=_[_0x8d1a('0x44')]({},_0xc07600,_0x85a330[_0x8d1a('0x4d')]);return _0xa1a20d['getTeams'](_0xc07600);}})[_0x8d1a('0x28')](function(_0x3657f7){if(_0x3657f7){_0x24ebd8=_0x3657f7[_0x8d1a('0x3b')];if(!_0x85a330[_0x8d1a('0x35')][_0x8d1a('0x3c')]('nolimit')){_0xc07600[_0x8d1a('0x23')]=qs[_0x8d1a('0x23')](_0x85a330['query']['limit']);_0xc07600[_0x8d1a('0x21')]=qs[_0x8d1a('0x21')](_0x85a330[_0x8d1a('0x35')][_0x8d1a('0x21')]);}return _0xa1a20d[_0x8d1a('0x64')](_0xc07600);}})[_0x8d1a('0x28')](function(_0x230ebb){if(_0x230ebb){return _0x230ebb?{'count':_0x24ebd8,'rows':_0x230ebb}:null;}})[_0x8d1a('0x28')](respondWithResult(_0x1f656d,null))['catch'](handleError(_0x1f656d,null));};exports[_0x8d1a('0x66')]=function(_0x21e394,_0x349a84,_0x4f8915){var _0x2c3fc1=_0x21e394[_0x8d1a('0x56')][_0x8d1a('0x67')];return db[_0x8d1a('0x65')]['findAll']({'where':{'id':_0x2c3fc1},'attributes':['id'],'include':[{'model':db[_0x8d1a('0x5c')],'as':_0x8d1a('0x68'),'attributes':['id',_0x8d1a('0x2e'),_0x8d1a('0x69'),_0x8d1a('0x6a'),_0x8d1a('0x6b')],'raw':!![]}]})[_0x8d1a('0x28')](function(_0x44ce25){if(_0x44ce25){var _0x2cb69b=_['flatMap'](_0x44ce25,function(_0x4d7129){var _0x19ca1c=_0x4d7129[_0x8d1a('0x2a')]({'plain':!![]});return _0x19ca1c[_0x8d1a('0x68')];});return db['MailQueue'][_0x8d1a('0x4e')]({'where':{'id':_0x21e394['params']['id']}})[_0x8d1a('0x28')](function(_0x4a3b06){return db[_0x8d1a('0x6c')]['transaction'](function(_0x4579da){return _0x4a3b06[_0x8d1a('0x66')](_0x2c3fc1,{'transaction':_0x4579da})[_0x8d1a('0x28')](function(){return BPromise['each'](_0x2cb69b,function(_0x286a44){return db[_0x8d1a('0x5b')][_0x8d1a('0x6d')]({'where':{'UserId':_0x286a44['id'],'MailQueueId':_0x21e394[_0x8d1a('0x57')]['id']},'transaction':_0x4579da});});})[_0x8d1a('0x28')](function(){_0x2cb69b[_0x8d1a('0x6e')](function(_0x3ae587){socket['emit'](_0x8d1a('0x6f'),{'UserId':_0x3ae587['id'],'MailQueueId':_0x4a3b06['id']});});});});});}})['then'](respondWithStatusCode(_0x349a84,null))[_0x8d1a('0x4a')](handleError(_0x349a84,null));};exports[_0x8d1a('0x70')]=function(_0x17d55b,_0x4d1364,_0x218589){return db['Team'][_0x8d1a('0x48')]({'where':{'id':_0x17d55b[_0x8d1a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8d1a('0x5c')],'as':_0x8d1a('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8d1a('0x28')](handleEntityNotFound(_0x4d1364,null))[_0x8d1a('0x28')](function(_0x4740f0){var _0xadc9e3=_[_0x8d1a('0x31')](_0x4740f0,'id');var _0x1d1eba=[];var _0x23f1cd=[];var _0x50cb9b=squel[_0x8d1a('0x71')]();_0x50cb9b[_0x8d1a('0x72')](_0x8d1a('0x73'))[_0x8d1a('0x74')](_0x8d1a('0x75'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x17d55b['params']['id']);for(var _0x38f448=0x0;_0x38f448<_0x4740f0[_0x8d1a('0x3b')];_0x38f448+=0x1){let _0x136e09=_0x4740f0[_0x38f448];for(var _0x4bebb0=0x0;_0x4bebb0<_0x136e09['Agents']['length'];_0x4bebb0+=0x1){let _0x389cd7=_0x136e09[_0x8d1a('0x68')][_0x4bebb0];var _0x3ea5c2=_0x50cb9b[_0x8d1a('0x76')]();_0x3ea5c2[_0x8d1a('0x43')](_0x8d1a('0x77'),_0x389cd7['id']);_0x23f1cd[_0x8d1a('0x78')](db[_0x8d1a('0x6c')][_0x8d1a('0x35')](_0x3ea5c2[_0x8d1a('0x79')](),{'type':db['sequelize'][_0x8d1a('0x7a')][_0x8d1a('0x7b')]})[_0x8d1a('0x28')](function(_0x260f69){if(_0x260f69[_0x8d1a('0x3b')]===0x1){return _0x389cd7['id'];}else{var _0x1db625=_['every'](_[_0x8d1a('0x31')](_0x260f69,_0x8d1a('0x7c')),function(_0x5dd1f4){return _[_0x8d1a('0x7d')](_0xadc9e3,_0x5dd1f4);});if(_0x1db625){return _0x389cd7['id'];}}}));}}return BPromise[_0x8d1a('0x7e')](_0x23f1cd)[_0x8d1a('0x28')](function(_0xbf2b9b){_0x1d1eba=_(_0x1d1eba)[_0x8d1a('0x7f')](_0xbf2b9b)[_0x8d1a('0x80')]()[_0x8d1a('0x81')]();return db[_0x8d1a('0x32')][_0x8d1a('0x4e')]({'where':{'id':_0x17d55b[_0x8d1a('0x57')]['id']}})[_0x8d1a('0x28')](function(_0x332673){return db[_0x8d1a('0x6c')][_0x8d1a('0x82')](function(_0x1cf00){return _0x332673[_0x8d1a('0x70')](_0x17d55b[_0x8d1a('0x35')]['ids'],{'transaction':_0x1cf00})[_0x8d1a('0x28')](function(){if(!_[_0x8d1a('0x83')](_0x1d1eba)){return _0x332673[_0x8d1a('0x84')](_0x1d1eba,{'transaction':_0x1cf00});}})['then'](function(){_0x1d1eba[_0x8d1a('0x6e')](function(_0x2cb964){socket[_0x8d1a('0x85')](_0x8d1a('0x86'),{'UserId':_0x2cb964,'MailQueueId':_0x332673['id']});});});});});});})[_0x8d1a('0x28')](respondWithStatusCode(_0x4d1364,null))[_0x8d1a('0x4a')](handleError(_0x4d1364,null));};exports[_0x8d1a('0x87')]=function(_0x935eb4,_0x317021,_0x4ba4f9){return db[_0x8d1a('0x32')][_0x8d1a('0x4e')]({'where':{'id':_0x935eb4['params']['id']}})['then'](handleEntityNotFound(_0x317021,null))['then'](function(_0x4095e6){if(_0x4095e6){return _0x4095e6[_0x8d1a('0x87')](_0x935eb4[_0x8d1a('0x56')][_0x8d1a('0x67')],_[_0x8d1a('0x88')](_0x935eb4[_0x8d1a('0x56')],[_0x8d1a('0x67'),'id'])||{})[_0x8d1a('0x89')](function(_0x3de58e){for(var _0x4515c9=0x0;_0x4515c9<_0x935eb4[_0x8d1a('0x56')][_0x8d1a('0x67')][_0x8d1a('0x3b')];_0x4515c9+=0x1){socket[_0x8d1a('0x85')]('userMailQueue:save',{'UserId':Number(_0x935eb4[_0x8d1a('0x56')][_0x8d1a('0x67')][_0x4515c9]),'MailQueueId':Number(_0x935eb4['params']['id'])});}return _0x3de58e;});}})['then'](respondWithResult(_0x317021,null))['catch'](handleError(_0x317021,null));};exports['removeAgents']=function(_0x268170,_0x2e347a,_0x5017ea){return db[_0x8d1a('0x32')][_0x8d1a('0x4e')]({'where':{'id':_0x268170['params']['id']}})['then'](handleEntityNotFound(_0x2e347a,null))['then'](function(_0x2b5a1f){if(_0x2b5a1f){return _0x2b5a1f[_0x8d1a('0x84')](_0x268170['query'][_0x8d1a('0x67')])['then'](function(){if(_['isArray'](_0x268170['query'][_0x8d1a('0x67')])){for(var _0x57dfe9=0x0;_0x57dfe9<_0x268170[_0x8d1a('0x35')][_0x8d1a('0x67')][_0x8d1a('0x3b')];_0x57dfe9+=0x1){socket['emit'](_0x8d1a('0x86'),{'UserId':Number(_0x268170[_0x8d1a('0x35')]['ids'][_0x57dfe9]),'MailQueueId':Number(_0x268170['params']['id'])});}}else{socket[_0x8d1a('0x85')](_0x8d1a('0x86'),{'UserId':Number(_0x268170[_0x8d1a('0x35')][_0x8d1a('0x67')]),'MailQueueId':Number(_0x268170['params']['id'])});}});}})[_0x8d1a('0x28')](respondWithStatusCode(_0x2e347a,null))[_0x8d1a('0x4a')](handleError(_0x2e347a,null));};exports[_0x8d1a('0x8a')]=function(_0x1be5a0,_0x5c53fe,_0x281304){var _0x42ad25={};var _0x1320e6={};var _0x35da48;var _0x467f7e;return db[_0x8d1a('0x32')][_0x8d1a('0x59')]({'where':{'id':_0x1be5a0['params']['id']}})[_0x8d1a('0x28')](handleEntityNotFound(_0x5c53fe,null))[_0x8d1a('0x28')](function(_0x338b6a){if(_0x338b6a){_0x35da48=_0x338b6a;_0x1320e6[_0x8d1a('0x38')]=_[_0x8d1a('0x36')](db[_0x8d1a('0x5c')][_0x8d1a('0x33')]);_0x1320e6['query']=_[_0x8d1a('0x36')](_0x1be5a0[_0x8d1a('0x35')]);_0x1320e6['filters']=_[_0x8d1a('0x37')](_0x1320e6['model'],_0x1320e6[_0x8d1a('0x35')]);_0x42ad25[_0x8d1a('0x39')]=_[_0x8d1a('0x37')](_0x1320e6[_0x8d1a('0x38')],qs[_0x8d1a('0x3a')](_0x1be5a0[_0x8d1a('0x35')]['fields']));_0x42ad25[_0x8d1a('0x39')]=_0x42ad25['attributes']['length']?_0x42ad25[_0x8d1a('0x39')]:_0x1320e6[_0x8d1a('0x38')];_0x42ad25[_0x8d1a('0x3e')]=qs[_0x8d1a('0x3f')](_0x1be5a0[_0x8d1a('0x35')][_0x8d1a('0x3f')]);_0x42ad25[_0x8d1a('0x43')]=qs['filters'](_[_0x8d1a('0x41')](_0x1be5a0[_0x8d1a('0x35')],_0x1320e6[_0x8d1a('0x40')]));if(_0x1be5a0[_0x8d1a('0x35')]['filter']){_0x42ad25[_0x8d1a('0x43')]=_[_0x8d1a('0x44')](_0x42ad25['where'],{'$or':_[_0x8d1a('0x31')](_0x42ad25[_0x8d1a('0x39')],function(_0x23c235){var _0x3212e1={};_0x3212e1[_0x23c235]={'$like':'%'+_0x1be5a0[_0x8d1a('0x35')][_0x8d1a('0x42')]+'%'};return _0x3212e1;})});}_0x42ad25=_[_0x8d1a('0x44')]({},_0x42ad25,_0x1be5a0[_0x8d1a('0x4d')]);return _0x35da48[_0x8d1a('0x8a')](_0x42ad25);}})[_0x8d1a('0x28')](function(_0x2ea1ac){if(_0x2ea1ac){_0x467f7e=_0x2ea1ac[_0x8d1a('0x3b')];if(!_0x1be5a0[_0x8d1a('0x35')]['hasOwnProperty']('nolimit')){_0x42ad25['limit']=qs[_0x8d1a('0x23')](_0x1be5a0[_0x8d1a('0x35')][_0x8d1a('0x23')]);_0x42ad25['offset']=qs[_0x8d1a('0x21')](_0x1be5a0[_0x8d1a('0x35')][_0x8d1a('0x21')]);}return _0x35da48[_0x8d1a('0x8a')](_0x42ad25);}})[_0x8d1a('0x28')](function(_0x2665a2){if(_0x2665a2){return _0x2665a2?{'count':_0x467f7e,'rows':_0x2665a2}:null;}})['then'](respondWithResult(_0x5c53fe,null))[_0x8d1a('0x4a')](handleError(_0x5c53fe,null));}; \ No newline at end of file +var _0x9314=['online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','MailQueues','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','MailQueue','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','options','UserMailQueue','UserId','agent','updatedAt','format','SIP','mailPause','createdAt','getTeams','keys','addTeams','ids','Team','Agents'];(function(_0x1643db,_0x42b03a){var _0x45117b=function(_0x471a00){while(--_0x471a00){_0x1643db['push'](_0x1643db['shift']());}};_0x45117b(++_0x42b03a);}(_0x9314,0xb2));var _0x4931=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9314[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x4931('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4931('0x1'));var jsonpatch=require(_0x4931('0x2'));var rp=require(_0x4931('0x3'));var moment=require(_0x4931('0x4'));var BPromise=require(_0x4931('0x5'));var Mustache=require(_0x4931('0x6'));var util=require(_0x4931('0x7'));var path=require(_0x4931('0x8'));var sox=require(_0x4931('0x9'));var csv=require(_0x4931('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4931('0xb'));var _=require(_0x4931('0xc'));var squel=require(_0x4931('0xd'));var crypto=require(_0x4931('0xe'));var jsforce=require(_0x4931('0xf'));var deskjs=require(_0x4931('0x10'));var toCsv=require(_0x4931('0xa'));var querystring=require(_0x4931('0x11'));var Papa=require(_0x4931('0x12'));var Redis=require(_0x4931('0x13'));var authService=require(_0x4931('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4931('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4931('0x16'))(_0x4931('0x17'));var utils=require('../../config/utils');var config=require(_0x4931('0x18'));var licenseUtil=require(_0x4931('0x19'));var db=require(_0x4931('0x1a'))['db'];config[_0x4931('0x1b')]=_[_0x4931('0x1c')](config[_0x4931('0x1b')],{'host':_0x4931('0x1d'),'port':0x18eb});var socket=require(_0x4931('0x1e'))(new Redis(config[_0x4931('0x1b')]));require(_0x4931('0x1f'))[_0x4931('0x20')](socket);function respondWithStatusCode(_0x5796e0,_0x2c2eab){_0x2c2eab=_0x2c2eab||0xcc;return function(_0x231727){if(_0x231727){return _0x5796e0[_0x4931('0x21')](_0x2c2eab);}return _0x5796e0[_0x4931('0x22')](_0x2c2eab)[_0x4931('0x23')]();};}function respondWithResult(_0x19b80d,_0x544e51){_0x544e51=_0x544e51||0xc8;return function(_0x13851f){if(_0x13851f){return _0x19b80d[_0x4931('0x22')](_0x544e51)['json'](_0x13851f);}};}function respondWithFilteredResult(_0x53084a,_0x1858bf){return function(_0x4edd97){if(_0x4edd97){var _0x45bd6f=typeof _0x1858bf[_0x4931('0x24')]===_0x4931('0x25')&&typeof _0x1858bf[_0x4931('0x26')]==='undefined';var _0x25493f=_0x4edd97[_0x4931('0x27')];var _0x22f156=_0x45bd6f?0x0:_0x1858bf['offset'];var _0x4cba9c=_0x45bd6f?_0x4edd97[_0x4931('0x27')]:_0x1858bf[_0x4931('0x24')]+_0x1858bf['limit'];var _0x15947e;if(_0x4cba9c>=_0x25493f){_0x4cba9c=_0x25493f;_0x15947e=0xc8;}else{_0x15947e=0xce;}_0x53084a[_0x4931('0x22')](_0x15947e);return _0x53084a['set'](_0x4931('0x28'),_0x22f156+'-'+_0x4cba9c+'/'+_0x25493f)['json'](_0x4edd97);}return null;};}function patchUpdates(_0x329dc0){return function(_0x495ec1){try{jsonpatch[_0x4931('0x29')](_0x495ec1,_0x329dc0,!![]);}catch(_0x218d93){return BPromise[_0x4931('0x2a')](_0x218d93);}return _0x495ec1[_0x4931('0x2b')]();};}function saveUpdates(_0x251bf5,_0x25bc6d){return function(_0x42cc8){if(_0x42cc8){return _0x42cc8[_0x4931('0x2c')](_0x251bf5)[_0x4931('0x2d')](function(_0x51521f){return _0x51521f;});}return null;};}function removeEntity(_0xc92044,_0x41fdb6){return function(_0x382a42){if(_0x382a42){return _0x382a42[_0x4931('0x2e')]()[_0x4931('0x2d')](function(){var _0x3b8592=_0x382a42['get']({'plain':!![]});var _0xe6ac13=_0x4931('0x2f');return db['UserProfileResource'][_0x4931('0x2e')]({'where':{'type':_0xe6ac13,'resourceId':_0x3b8592['id']}})['then'](function(){return _0x382a42;});})[_0x4931('0x2d')](function(){_0xc92044[_0x4931('0x22')](0xcc)[_0x4931('0x23')]();});}};}function handleEntityNotFound(_0x4598c4,_0x459018){return function(_0x2acbe2){if(!_0x2acbe2){_0x4598c4[_0x4931('0x21')](0x194);}return _0x2acbe2;};}function handleError(_0x585c9a,_0x4b040e){_0x4b040e=_0x4b040e||0x1f4;return function(_0x5b7291){logger[_0x4931('0x30')](_0x5b7291[_0x4931('0x31')]);if(_0x5b7291['name']){delete _0x5b7291[_0x4931('0x32')];}_0x585c9a['status'](_0x4b040e)[_0x4931('0x33')](_0x5b7291);};}exports[_0x4931('0x34')]=function(_0x400ca1,_0x95dbbf){var _0x319a99={},_0x2e8b40={},_0x5df392={'count':0x0,'rows':[]};var _0x5e13e9=_['map'](db['MailQueue'][_0x4931('0x35')],function(_0x309639){return{'name':_0x309639[_0x4931('0x36')],'type':_0x309639[_0x4931('0x37')][_0x4931('0x38')]};});_0x2e8b40[_0x4931('0x39')]=_[_0x4931('0x3a')](_0x5e13e9,_0x4931('0x32'));_0x2e8b40[_0x4931('0x3b')]=_['keys'](_0x400ca1[_0x4931('0x3b')]);_0x2e8b40[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x2e8b40['model'],_0x2e8b40['query']);_0x319a99[_0x4931('0x3e')]=_['intersection'](_0x2e8b40['model'],qs[_0x4931('0x3f')](_0x400ca1[_0x4931('0x3b')][_0x4931('0x3f')]));_0x319a99['attributes']=_0x319a99[_0x4931('0x3e')][_0x4931('0x40')]?_0x319a99[_0x4931('0x3e')]:_0x2e8b40[_0x4931('0x39')];if(!_0x400ca1[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x319a99['limit']=qs[_0x4931('0x26')](_0x400ca1[_0x4931('0x3b')]['limit']);_0x319a99[_0x4931('0x24')]=qs['offset'](_0x400ca1[_0x4931('0x3b')][_0x4931('0x24')]);}_0x319a99['order']=qs[_0x4931('0x43')](_0x400ca1[_0x4931('0x3b')][_0x4931('0x43')]);_0x319a99[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0x400ca1['query'],_0x2e8b40['filters']),_0x5e13e9);if(_0x400ca1['query'][_0x4931('0x46')]){_0x319a99[_0x4931('0x44')]=_['merge'](_0x319a99['where'],{'$or':_['map'](_0x5e13e9,function(_0x3ffca2){if(_0x3ffca2['type']!==_0x4931('0x47')){var _0x111bc4={};_0x111bc4[_0x3ffca2[_0x4931('0x32')]]={'$like':'%'+_0x400ca1['query'][_0x4931('0x46')]+'%'};return _0x111bc4;}})});}_0x319a99=_[_0x4931('0x48')]({},_0x319a99,_0x400ca1['options']);var _0x49402e={'where':_0x319a99[_0x4931('0x44')]};return db[_0x4931('0x49')][_0x4931('0x27')](_0x49402e)[_0x4931('0x2d')](function(_0x12f8d7){_0x5df392[_0x4931('0x27')]=_0x12f8d7;if(_0x400ca1[_0x4931('0x3b')][_0x4931('0x4a')]){_0x319a99[_0x4931('0x4b')]=[{'all':!![]}];}return db[_0x4931('0x49')][_0x4931('0x4c')](_0x319a99);})[_0x4931('0x2d')](function(_0x230763){_0x5df392[_0x4931('0x4d')]=_0x230763;return _0x5df392;})['then'](respondWithFilteredResult(_0x95dbbf,_0x319a99))[_0x4931('0x4e')](handleError(_0x95dbbf,null));};exports[_0x4931('0x4f')]=function(_0x470209,_0x2e6159){var _0xd39faf={'raw':!![],'where':{'id':_0x470209['params']['id']}},_0x2ce271={};_0x2ce271['model']=_['keys'](db['MailQueue'][_0x4931('0x35')]);_0x2ce271[_0x4931('0x3b')]=_['keys'](_0x470209[_0x4931('0x3b')]);_0x2ce271[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x2ce271[_0x4931('0x39')],_0x2ce271[_0x4931('0x3b')]);_0xd39faf['attributes']=_[_0x4931('0x3d')](_0x2ce271[_0x4931('0x39')],qs[_0x4931('0x3f')](_0x470209[_0x4931('0x3b')]['fields']));_0xd39faf[_0x4931('0x3e')]=_0xd39faf[_0x4931('0x3e')][_0x4931('0x40')]?_0xd39faf[_0x4931('0x3e')]:_0x2ce271[_0x4931('0x39')];if(_0x470209['query'][_0x4931('0x4a')]){_0xd39faf[_0x4931('0x4b')]=[{'all':!![]}];}_0xd39faf=_['merge']({},_0xd39faf,_0x470209['options']);return db[_0x4931('0x49')][_0x4931('0x50')](_0xd39faf)[_0x4931('0x2d')](handleEntityNotFound(_0x2e6159,null))['then'](respondWithResult(_0x2e6159,null))[_0x4931('0x4e')](handleError(_0x2e6159,null));};exports['create']=function(_0x1c258a,_0x21960f){return db['MailQueue'][_0x4931('0x51')](_0x1c258a[_0x4931('0x52')],{})[_0x4931('0x2d')](function(_0x5bb46f){var _0x18c65d=_0x1c258a[_0x4931('0x53')][_0x4931('0x54')]({'plain':!![]});if(!_0x18c65d)throw new Error(_0x4931('0x55'));if(_0x18c65d[_0x4931('0x56')]===_0x4931('0x53')){var _0x5077da=_0x5bb46f['get']({'plain':!![]});var _0x571129='MailQueues';return db[_0x4931('0x57')]['find']({'where':{'name':_0x571129,'userProfileId':_0x18c65d[_0x4931('0x58')]},'raw':!![]})[_0x4931('0x2d')](function(_0xa26fc5){if(_0xa26fc5&&_0xa26fc5[_0x4931('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x5077da['name'],'resourceId':_0x5077da['id'],'type':_0xa26fc5['name'],'sectionId':_0xa26fc5['id']},{})[_0x4931('0x2d')](function(){return _0x5bb46f;});}else{return _0x5bb46f;}})[_0x4931('0x4e')](function(_0x567685){logger[_0x4931('0x30')](_0x4931('0x5a'),_0x567685);throw _0x567685;});}return _0x5bb46f;})['then'](respondWithResult(_0x21960f,0xc9))[_0x4931('0x4e')](handleError(_0x21960f,null));};exports[_0x4931('0x2c')]=function(_0x415224,_0x220f85){if(_0x415224[_0x4931('0x52')]['id']){delete _0x415224[_0x4931('0x52')]['id'];}return db['MailQueue'][_0x4931('0x50')]({'where':{'id':_0x415224[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x220f85,null))['then'](saveUpdates(_0x415224['body'],null))[_0x4931('0x2d')](respondWithResult(_0x220f85,null))['catch'](handleError(_0x220f85,null));};exports[_0x4931('0x2e')]=function(_0x51f146,_0x3a8f8a){return db['MailQueue']['find']({'where':{'id':_0x51f146[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3a8f8a,null))['then'](removeEntity(_0x3a8f8a,null))[_0x4931('0x4e')](handleError(_0x3a8f8a,null));};exports[_0x4931('0x5c')]=function(_0x12c165,_0x522d5f){return db[_0x4931('0x49')][_0x4931('0x5c')]()[_0x4931('0x2d')](respondWithResult(_0x522d5f,null))['catch'](handleError(_0x522d5f,null));};exports[_0x4931('0x5d')]=function(_0xaa0a96,_0x223771,_0x127d99){var _0x5a44b3={'raw':!![],'where':{}},_0x7fdddb={},_0x909eea;return db[_0x4931('0x49')][_0x4931('0x5e')]({'where':{'id':_0xaa0a96[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x223771,null))[_0x4931('0x2d')](function(_0x38b604){if(_0x38b604){_0x909eea=_0x38b604[_0x4931('0x54')]({'plain':!![]});_0x7fdddb['model']=_['keys'](db['UserMailQueue'][_0x4931('0x35')]);_0x7fdddb[_0x4931('0x3b')]=_['keys'](_0xaa0a96[_0x4931('0x3b')]);_0x7fdddb['filters']=_[_0x4931('0x3d')](_0x7fdddb[_0x4931('0x39')],_0x7fdddb[_0x4931('0x3b')]);_0x5a44b3['attributes']=_[_0x4931('0x3d')](_0x7fdddb[_0x4931('0x39')],qs[_0x4931('0x3f')](_0xaa0a96[_0x4931('0x3b')][_0x4931('0x3f')]));_0x5a44b3[_0x4931('0x3e')]=_0x5a44b3['attributes'][_0x4931('0x40')]?_0x5a44b3['attributes']:_0x7fdddb['model'];if(!_0xaa0a96['query']['hasOwnProperty'](_0x4931('0x42'))){_0x5a44b3[_0x4931('0x26')]=qs['limit'](_0xaa0a96['query'][_0x4931('0x26')]);_0x5a44b3['offset']=qs[_0x4931('0x24')](_0xaa0a96[_0x4931('0x3b')][_0x4931('0x24')]);}_0x5a44b3['order']=qs[_0x4931('0x43')](_0xaa0a96[_0x4931('0x3b')]['sort']);_0x5a44b3[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0xaa0a96[_0x4931('0x3b')],_0x7fdddb[_0x4931('0x3c')]));_0x5a44b3[_0x4931('0x44')]['MailQueueId']=_0x38b604['id'];if(_0xaa0a96[_0x4931('0x3b')][_0x4931('0x46')]){_0x5a44b3['where']=_[_0x4931('0x48')](_0x5a44b3[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x5a44b3['attributes'],function(_0x49474a){var _0x15862f={};_0x15862f[_0x49474a]={'$like':'%'+_0xaa0a96[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x15862f;})});}_0x5a44b3=_['merge']({},_0x5a44b3,_0xaa0a96[_0x4931('0x5f')]);return db[_0x4931('0x60')][_0x4931('0x4c')](_0x5a44b3);}})[_0x4931('0x2d')](function(_0x3e68e3){if(_0x3e68e3){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x3e68e3,_0x4931('0x61')),'role':_0x4931('0x62')},'attributes':['id',_0x4931('0x32'),'mailPause',_0x4931('0x63'),'createdAt']});}})['then'](function(_0x4da9c9){if(_0x4da9c9){return{'count':_0x4da9c9[_0x4931('0x27')],'rows':_[_0x4931('0x3a')](_0x4da9c9[_0x4931('0x4d')],function(_0x1d8cca){return{'membername':_0x1d8cca[_0x4931('0x32')],'UserId':_0x1d8cca['id'],'queue_name':_0x909eea[_0x4931('0x32')],'MailQueueId':_0x909eea['id'],'interface':util[_0x4931('0x64')]('%s/%s',_0x4931('0x65'),_0x1d8cca[_0x4931('0x32')]),'penalty':0x0,'paused':_0x1d8cca[_0x4931('0x66')],'createdAt':_0x1d8cca[_0x4931('0x67')],'updatedAt':_0x1d8cca[_0x4931('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4931('0x2d')](respondWithFilteredResult(_0x223771,_0x5a44b3))['catch'](handleError(_0x223771,null));};exports[_0x4931('0x68')]=function(_0x15d7ab,_0x483f9b,_0x5cb18a){var _0x2ed1bd={};var _0x4f25ec={};var _0x47caaa;var _0x255054;return db[_0x4931('0x49')][_0x4931('0x5e')]({'where':{'id':_0x15d7ab[_0x4931('0x5b')]['id']}})['then'](handleEntityNotFound(_0x483f9b,null))[_0x4931('0x2d')](function(_0x516e69){if(_0x516e69){_0x47caaa=_0x516e69;_0x4f25ec[_0x4931('0x39')]=_[_0x4931('0x69')](db['Team'][_0x4931('0x35')]);_0x4f25ec['query']=_[_0x4931('0x69')](_0x15d7ab[_0x4931('0x3b')]);_0x4f25ec[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x4f25ec[_0x4931('0x39')],_0x4f25ec[_0x4931('0x3b')]);_0x2ed1bd['attributes']=_[_0x4931('0x3d')](_0x4f25ec[_0x4931('0x39')],qs[_0x4931('0x3f')](_0x15d7ab[_0x4931('0x3b')][_0x4931('0x3f')]));_0x2ed1bd[_0x4931('0x3e')]=_0x2ed1bd[_0x4931('0x3e')][_0x4931('0x40')]?_0x2ed1bd[_0x4931('0x3e')]:_0x4f25ec[_0x4931('0x39')];_0x2ed1bd['order']=qs[_0x4931('0x43')](_0x15d7ab[_0x4931('0x3b')][_0x4931('0x43')]);_0x2ed1bd[_0x4931('0x44')]=qs[_0x4931('0x3c')](_['pick'](_0x15d7ab['query'],_0x4f25ec[_0x4931('0x3c')]));if(_0x15d7ab[_0x4931('0x3b')][_0x4931('0x46')]){_0x2ed1bd['where']=_['merge'](_0x2ed1bd[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x2ed1bd[_0x4931('0x3e')],function(_0x3bb375){var _0x51067a={};_0x51067a[_0x3bb375]={'$like':'%'+_0x15d7ab[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x51067a;})});}_0x2ed1bd=_['merge']({},_0x2ed1bd,_0x15d7ab[_0x4931('0x5f')]);return _0x47caaa['getTeams'](_0x2ed1bd);}})[_0x4931('0x2d')](function(_0x3e58af){if(_0x3e58af){_0x255054=_0x3e58af[_0x4931('0x40')];if(!_0x15d7ab[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x2ed1bd['limit']=qs[_0x4931('0x26')](_0x15d7ab['query'][_0x4931('0x26')]);_0x2ed1bd[_0x4931('0x24')]=qs['offset'](_0x15d7ab[_0x4931('0x3b')]['offset']);}return _0x47caaa[_0x4931('0x68')](_0x2ed1bd);}})['then'](function(_0x2d1800){if(_0x2d1800){return _0x2d1800?{'count':_0x255054,'rows':_0x2d1800}:null;}})[_0x4931('0x2d')](respondWithResult(_0x483f9b,null))['catch'](handleError(_0x483f9b,null));};exports[_0x4931('0x6a')]=function(_0xe6a4a3,_0x551e5e,_0x576be9){var _0x30ad2a=_0xe6a4a3[_0x4931('0x52')][_0x4931('0x6b')];return db[_0x4931('0x6c')][_0x4931('0x4c')]({'where':{'id':_0x30ad2a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4931('0x6d'),'attributes':['id',_0x4931('0x32'),_0x4931('0x6e'),_0x4931('0x6f'),_0x4931('0x70')],'raw':!![]}]})[_0x4931('0x2d')](function(_0x590900){if(_0x590900){var _0x114ca7=_[_0x4931('0x71')](_0x590900,function(_0x258f98){var _0x227297=_0x258f98['get']({'plain':!![]});return _0x227297[_0x4931('0x6d')];});return db[_0x4931('0x49')][_0x4931('0x50')]({'where':{'id':_0xe6a4a3[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](function(_0x504ca2){return db[_0x4931('0x72')]['transaction'](function(_0x105dbb){return _0x504ca2[_0x4931('0x6a')](_0x30ad2a,{'transaction':_0x105dbb})['then'](function(){return BPromise[_0x4931('0x73')](_0x114ca7,function(_0x4ff5ca){return db[_0x4931('0x60')][_0x4931('0x74')]({'where':{'UserId':_0x4ff5ca['id'],'MailQueueId':_0xe6a4a3[_0x4931('0x5b')]['id']},'transaction':_0x105dbb});});})[_0x4931('0x2d')](function(){_0x114ca7[_0x4931('0x75')](function(_0x3f9359){socket['emit']('userMailQueue:save',{'UserId':_0x3f9359['id'],'MailQueueId':_0x504ca2['id']});});});});});}})['then'](respondWithStatusCode(_0x551e5e,null))[_0x4931('0x4e')](handleError(_0x551e5e,null));};exports[_0x4931('0x76')]=function(_0x2b10bd,_0x3babd9,_0x4d13e7){return db[_0x4931('0x6c')][_0x4931('0x4c')]({'where':{'id':_0x2b10bd[_0x4931('0x3b')][_0x4931('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4931('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x4931('0x2d')](handleEntityNotFound(_0x3babd9,null))[_0x4931('0x2d')](function(_0x466616){var _0xb416c7=_[_0x4931('0x3a')](_0x466616,'id');var _0x46a649=[];var _0x5ce722=[];var _0x170faa=squel[_0x4931('0x77')]();_0x170faa['field']('tq.TeamId')[_0x4931('0x78')]('team_has_mail_queues','tq')[_0x4931('0x79')](_0x4931('0x7a'),'ut',_0x4931('0x7b'))[_0x4931('0x44')]('MailQueueId\x20=\x20?',_0x2b10bd['params']['id']);for(var _0x33dbaa=0x0;_0x33dbaa<_0x466616[_0x4931('0x40')];_0x33dbaa+=0x1){let _0x3d3476=_0x466616[_0x33dbaa];for(var _0x18cf5d=0x0;_0x18cf5d<_0x3d3476[_0x4931('0x6d')][_0x4931('0x40')];_0x18cf5d+=0x1){let _0x281fdc=_0x3d3476['Agents'][_0x18cf5d];var _0x2cb693=_0x170faa[_0x4931('0x7c')]();_0x2cb693[_0x4931('0x44')]('ut.UserId\x20=\x20?',_0x281fdc['id']);_0x5ce722[_0x4931('0x7d')](db['sequelize'][_0x4931('0x3b')](_0x2cb693[_0x4931('0x7e')](),{'type':db[_0x4931('0x72')][_0x4931('0x7f')][_0x4931('0x80')]})[_0x4931('0x2d')](function(_0x257fbd){if(_0x257fbd[_0x4931('0x40')]===0x1){return _0x281fdc['id'];}else{var _0x171797=_[_0x4931('0x81')](_['map'](_0x257fbd,_0x4931('0x82')),function(_0x4a75d2){return _[_0x4931('0x83')](_0xb416c7,_0x4a75d2);});if(_0x171797){return _0x281fdc['id'];}}}));}}return BPromise['all'](_0x5ce722)['then'](function(_0x1070d1){_0x46a649=_(_0x46a649)['union'](_0x1070d1)['compact']()['value']();return db[_0x4931('0x49')]['find']({'where':{'id':_0x2b10bd[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](function(_0x3cab73){return db[_0x4931('0x72')][_0x4931('0x84')](function(_0xc1cd33){return _0x3cab73[_0x4931('0x76')](_0x2b10bd[_0x4931('0x3b')][_0x4931('0x6b')],{'transaction':_0xc1cd33})['then'](function(){if(!_[_0x4931('0x85')](_0x46a649)){return _0x3cab73[_0x4931('0x86')](_0x46a649,{'transaction':_0xc1cd33});}})[_0x4931('0x2d')](function(){_0x46a649[_0x4931('0x75')](function(_0x2853ca){socket[_0x4931('0x87')](_0x4931('0x88'),{'UserId':_0x2853ca,'MailQueueId':_0x3cab73['id']});});});});});});})['then'](respondWithStatusCode(_0x3babd9,null))[_0x4931('0x4e')](handleError(_0x3babd9,null));};exports[_0x4931('0x89')]=function(_0x3c21a6,_0x3122f8,_0x57a3e8){return db[_0x4931('0x49')][_0x4931('0x50')]({'where':{'id':_0x3c21a6[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3122f8,null))[_0x4931('0x2d')](function(_0x573797){if(_0x573797){return _0x573797[_0x4931('0x89')](_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')],_[_0x4931('0x8a')](_0x3c21a6['body'],[_0x4931('0x6b'),'id'])||{})[_0x4931('0x8b')](function(_0x3fd9f5){for(var _0x7fb89d=0x0;_0x7fb89d<_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')][_0x4931('0x40')];_0x7fb89d+=0x1){socket[_0x4931('0x87')](_0x4931('0x8c'),{'UserId':Number(_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')][_0x7fb89d]),'MailQueueId':Number(_0x3c21a6[_0x4931('0x5b')]['id'])});}return _0x3fd9f5;});}})['then'](respondWithResult(_0x3122f8,null))[_0x4931('0x4e')](handleError(_0x3122f8,null));};exports['removeAgents']=function(_0x310e68,_0x3c11f0,_0x5b3793){return db[_0x4931('0x49')]['find']({'where':{'id':_0x310e68[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3c11f0,null))[_0x4931('0x2d')](function(_0x133ffc){if(_0x133ffc){return _0x133ffc[_0x4931('0x86')](_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')])[_0x4931('0x2d')](function(){if(_[_0x4931('0x8d')](_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')])){for(var _0x4b9273=0x0;_0x4b9273<_0x310e68[_0x4931('0x3b')]['ids']['length'];_0x4b9273+=0x1){socket[_0x4931('0x87')](_0x4931('0x88'),{'UserId':Number(_0x310e68[_0x4931('0x3b')]['ids'][_0x4b9273]),'MailQueueId':Number(_0x310e68['params']['id'])});}}else{socket[_0x4931('0x87')]('userMailQueue:remove',{'UserId':Number(_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')]),'MailQueueId':Number(_0x310e68[_0x4931('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c11f0,null))['catch'](handleError(_0x3c11f0,null));};exports[_0x4931('0x8e')]=function(_0x177853,_0xeed7f1,_0xabbb24){var _0x3bbf9f={};var _0x2473f4={};var _0x4d66d9;var _0x25fcfe;return db['MailQueue'][_0x4931('0x5e')]({'where':{'id':_0x177853[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0xeed7f1,null))[_0x4931('0x2d')](function(_0x41c769){if(_0x41c769){_0x4d66d9=_0x41c769;_0x2473f4[_0x4931('0x39')]=_[_0x4931('0x69')](db[_0x4931('0x8f')][_0x4931('0x35')]);_0x2473f4[_0x4931('0x3b')]=_['keys'](_0x177853[_0x4931('0x3b')]);_0x2473f4['filters']=_[_0x4931('0x3d')](_0x2473f4[_0x4931('0x39')],_0x2473f4[_0x4931('0x3b')]);_0x3bbf9f[_0x4931('0x3e')]=_['intersection'](_0x2473f4['model'],qs[_0x4931('0x3f')](_0x177853[_0x4931('0x3b')]['fields']));_0x3bbf9f['attributes']=_0x3bbf9f[_0x4931('0x3e')][_0x4931('0x40')]?_0x3bbf9f[_0x4931('0x3e')]:_0x2473f4['model'];_0x3bbf9f['order']=qs[_0x4931('0x43')](_0x177853[_0x4931('0x3b')][_0x4931('0x43')]);_0x3bbf9f[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0x177853[_0x4931('0x3b')],_0x2473f4[_0x4931('0x3c')]));if(_0x177853['query'][_0x4931('0x46')]){_0x3bbf9f[_0x4931('0x44')]=_['merge'](_0x3bbf9f[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x3bbf9f[_0x4931('0x3e')],function(_0xb5cf40){var _0x3eec7a={};_0x3eec7a[_0xb5cf40]={'$like':'%'+_0x177853[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x3eec7a;})});}_0x3bbf9f=_[_0x4931('0x48')]({},_0x3bbf9f,_0x177853[_0x4931('0x5f')]);return _0x4d66d9[_0x4931('0x8e')](_0x3bbf9f);}})[_0x4931('0x2d')](function(_0xbb5d38){if(_0xbb5d38){_0x25fcfe=_0xbb5d38[_0x4931('0x40')];if(!_0x177853[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x3bbf9f[_0x4931('0x26')]=qs[_0x4931('0x26')](_0x177853[_0x4931('0x3b')][_0x4931('0x26')]);_0x3bbf9f['offset']=qs[_0x4931('0x24')](_0x177853[_0x4931('0x3b')][_0x4931('0x24')]);}return _0x4d66d9[_0x4931('0x8e')](_0x3bbf9f);}})[_0x4931('0x2d')](function(_0x22f580){if(_0x22f580){return _0x22f580?{'count':_0x25fcfe,'rows':_0x22f580}:null;}})['then'](respondWithResult(_0xeed7f1,null))[_0x4931('0x4e')](handleError(_0xeed7f1,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 3abbfcf..c171e56 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 _0x9a79=['remove','emit','hook','events','MailQueue','setMaxListeners','save','update'];(function(_0x5a02d8,_0x404eb1){var _0x103ee7=function(_0x3b8c7a){while(--_0x3b8c7a){_0x5a02d8['push'](_0x5a02d8['shift']());}};_0x103ee7(++_0x404eb1);}(_0x9a79,0xc3));var _0x99a7=function(_0x4bc6bc,_0x4519bd){_0x4bc6bc=_0x4bc6bc-0x0;var _0x54bf9e=_0x9a79[_0x4bc6bc];return _0x54bf9e;};'use strict';var EventEmitter=require(_0x99a7('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x99a7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x99a7('0x2')](0x0);var events={'afterCreate':_0x99a7('0x3'),'afterUpdate':_0x99a7('0x4'),'afterDestroy':_0x99a7('0x5')};function emitEvent(_0x4e827d){return function(_0x26b36e,_0x34e303,_0x34d382){MailQueueEvents[_0x99a7('0x6')](_0x4e827d+':'+_0x26b36e['id'],_0x26b36e);MailQueueEvents['emit'](_0x4e827d,_0x26b36e);_0x34d382(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x99a7('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x9142=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue'];(function(_0x3d1ac3,_0x2d49c4){var _0x312663=function(_0x3c48f8){while(--_0x3c48f8){_0x3d1ac3['push'](_0x3d1ac3['shift']());}};_0x312663(++_0x2d49c4);}(_0x9142,0x72));var _0x2914=function(_0x4f2729,_0x1b08a6){_0x4f2729=_0x4f2729-0x0;var _0x1fdcd6=_0x9142[_0x4f2729];return _0x1fdcd6;};'use strict';var EventEmitter=require(_0x2914('0x0'));var MailQueue=require(_0x2914('0x1'))['db'][_0x2914('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2914('0x3'),'afterUpdate':_0x2914('0x4'),'afterDestroy':_0x2914('0x5')};function emitEvent(_0x263fde){return function(_0x47a80f,_0x42518b,_0xcb2515){MailQueueEvents[_0x2914('0x6')](_0x263fde+':'+_0x47a80f['id'],_0x47a80f);MailQueueEvents[_0x2914('0x6')](_0x263fde,_0x47a80f);_0xcb2515(null);};}for(var e in events){if(events[_0x2914('0x7')](e)){var event=events[e];MailQueue[_0x2914('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d954bc9..461cc27 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 _0x1d33=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d33,0x1e0));var _0x31d3=function(_0x2c7e4e,_0x24848a){_0x2c7e4e=_0x2c7e4e-0x0;var _0x3a0270=_0x1d33[_0x2c7e4e];return _0x3a0270;};'use strict';var _=require(_0x31d3('0x0'));var util=require('util');var logger=require(_0x31d3('0x1'))(_0x31d3('0x2'));var moment=require(_0x31d3('0x3'));var BPromise=require(_0x31d3('0x4'));var rp=require(_0x31d3('0x5'));var fs=require('fs');var path=require(_0x31d3('0x6'));var rimraf=require('rimraf');var config=require(_0x31d3('0x7'));var attributes=require(_0x31d3('0x8'));module[_0x31d3('0x9')]=function(_0x36a82a,_0x168a5a){return _0x36a82a['define'](_0x31d3('0xa'),attributes,{'tableName':_0x31d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d7=['exports','define','MailQueue','mail_queues','lodash','request-promise','../../config/environment','./mailQueue.attributes'];(function(_0x356f1d,_0x202df6){var _0x24b7e2=function(_0x13edcf){while(--_0x13edcf){_0x356f1d['push'](_0x356f1d['shift']());}};_0x24b7e2(++_0x202df6);}(_0x69d7,0xcc));var _0x769d=function(_0x466051,_0x20663e){_0x466051=_0x466051-0x0;var _0x393818=_0x69d7[_0x466051];return _0x393818;};'use strict';var _=require(_0x769d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x769d('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x769d('0x2'));var attributes=require(_0x769d('0x3'));module[_0x769d('0x4')]=function(_0x2da310,_0x6a221c){return _0x2da310[_0x769d('0x5')](_0x769d('0x6'),attributes,{'tableName':_0x769d('0x7'),'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 65f5a2f..7dc838e 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 _0x4c58=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailQueue','MailQueue','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x26ef4a,_0x40e33c){var _0x24f5c5=function(_0x419314){while(--_0x419314){_0x26ef4a['push'](_0x26ef4a['shift']());}};_0x24f5c5(++_0x40e33c);}(_0x4c58,0xed));var _0x84c5=function(_0x5ee348,_0x28c870){_0x5ee348=_0x5ee348-0x0;var _0x1e755c=_0x4c58[_0x5ee348];return _0x1e755c;};'use strict';var _=require(_0x84c5('0x0'));var util=require('util');var moment=require(_0x84c5('0x1'));var BPromise=require(_0x84c5('0x2'));var rs=require(_0x84c5('0x3'));var fs=require('fs');var Redis=require(_0x84c5('0x4'));var db=require(_0x84c5('0x5'))['db'];var utils=require(_0x84c5('0x6'));var logger=require(_0x84c5('0x7'))('rpc');var config=require(_0x84c5('0x8'));var jayson=require(_0x84c5('0x9'));var client=jayson[_0x84c5('0xa')][_0x84c5('0xb')]({'port':0x232a});config[_0x84c5('0xc')]=_[_0x84c5('0xd')](config[_0x84c5('0xc')],{'host':_0x84c5('0xe'),'port':0x18eb});var socket=require(_0x84c5('0xf'))(new Redis(config[_0x84c5('0xc')]));require(_0x84c5('0x10'))[_0x84c5('0x11')](socket);function respondWithRpcPromise(_0x6acec6,_0x26ba48,_0x2ff065){return new BPromise(function(_0x4ef3f9,_0x248f82){return client[_0x84c5('0x12')](_0x6acec6,_0x2ff065)[_0x84c5('0x13')](function(_0x49d147){logger[_0x84c5('0x14')](_0x84c5('0x15'),_0x26ba48,_0x84c5('0x16'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x26ba48,_0x84c5('0x16'),JSON[_0x84c5('0x17')](_0x49d147));if(_0x49d147['error']){if(_0x49d147[_0x84c5('0x18')][_0x84c5('0x19')]===0x1f4){logger[_0x84c5('0x18')](_0x84c5('0x15'),_0x26ba48,_0x49d147[_0x84c5('0x18')][_0x84c5('0x1a')]);return _0x248f82(_0x49d147[_0x84c5('0x18')]['message']);}logger[_0x84c5('0x18')](_0x84c5('0x15'),_0x26ba48,_0x49d147[_0x84c5('0x18')][_0x84c5('0x1a')]);return _0x4ef3f9(_0x49d147['error']['message']);}else{logger[_0x84c5('0x14')](_0x84c5('0x15'),_0x26ba48,'request\x20sent');_0x4ef3f9(_0x49d147['result'][_0x84c5('0x1a')]);}})[_0x84c5('0x1b')](function(_0x46f19e){logger[_0x84c5('0x18')](_0x84c5('0x15'),_0x26ba48,_0x46f19e);_0x248f82(_0x46f19e);});});}exports[_0x84c5('0x1c')]=function(_0x25412d){var _0x1ce70b=this;return new Promise(function(_0x38c45e,_0x386f46){return db['MailQueue'][_0x84c5('0x1d')]({'raw':_0x25412d[_0x84c5('0x1e')]?_0x25412d['options'][_0x84c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x25412d['options']?_0x25412d[_0x84c5('0x1e')]['where']||null:null,'attributes':_0x25412d[_0x84c5('0x1e')]?_0x25412d[_0x84c5('0x1e')][_0x84c5('0x20')]||null:null,'limit':_0x25412d[_0x84c5('0x1e')]?_0x25412d[_0x84c5('0x1e')][_0x84c5('0x21')]||null:null,'include':_0x25412d[_0x84c5('0x1e')]?_0x25412d[_0x84c5('0x1e')][_0x84c5('0x22')]?_[_0x84c5('0x23')](_0x25412d[_0x84c5('0x1e')][_0x84c5('0x22')],function(_0x272598){return{'model':db[_0x272598[_0x84c5('0x24')]],'as':_0x272598['as'],'attributes':_0x272598[_0x84c5('0x20')],'include':_0x272598[_0x84c5('0x22')]?_[_0x84c5('0x23')](_0x272598['include'],function(_0x4deb9c){return{'model':db[_0x4deb9c[_0x84c5('0x24')]],'as':_0x4deb9c['as'],'attributes':_0x4deb9c[_0x84c5('0x20')],'include':_0x4deb9c[_0x84c5('0x22')]?_['map'](_0x4deb9c['include'],function(_0x540b36){return{'model':db[_0x540b36['model']],'as':_0x540b36['as'],'attributes':_0x540b36[_0x84c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x84c5('0x13')](function(_0xb9252b){logger[_0x84c5('0x14')](_0x84c5('0x1c'),_0x25412d);logger[_0x84c5('0x25')](_0x84c5('0x1c'),_0x25412d,JSON[_0x84c5('0x17')](_0xb9252b));_0x38c45e(_0xb9252b);})[_0x84c5('0x1b')](function(_0x29c804){logger['error'](_0x84c5('0x1c'),_0x29c804['message'],_0x25412d);_0x386f46(_0x1ce70b[_0x84c5('0x18')](0x1f4,_0x29c804[_0x84c5('0x1a')]));});});};exports[_0x84c5('0x26')]=function(_0x275d4a){var _0x1083f0=this;return new Promise(function(_0x2ecd6f,_0x2aba8d){return db[_0x84c5('0x27')]['find']({'raw':_0x275d4a['options']?_0x275d4a[_0x84c5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x275d4a[_0x84c5('0x1e')]?_0x275d4a[_0x84c5('0x1e')][_0x84c5('0x28')]||null:null,'attributes':_0x275d4a[_0x84c5('0x1e')]?_0x275d4a[_0x84c5('0x1e')][_0x84c5('0x20')]||null:null,'include':_0x275d4a[_0x84c5('0x1e')]?_0x275d4a['options']['include']?_[_0x84c5('0x23')](_0x275d4a[_0x84c5('0x1e')][_0x84c5('0x22')],function(_0x209103){return{'model':db[_0x209103[_0x84c5('0x24')]],'as':_0x209103['as'],'attributes':_0x209103['attributes'],'include':_0x209103[_0x84c5('0x22')]?_[_0x84c5('0x23')](_0x209103[_0x84c5('0x22')],function(_0x4ad588){return{'model':db[_0x4ad588[_0x84c5('0x24')]],'as':_0x4ad588['as'],'attributes':_0x4ad588[_0x84c5('0x20')],'include':_0x4ad588[_0x84c5('0x22')]?_['map'](_0x4ad588['include'],function(_0x158607){return{'model':db[_0x158607[_0x84c5('0x24')]],'as':_0x158607['as'],'attributes':_0x158607[_0x84c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x84c5('0x13')](function(_0x3b51ba){logger[_0x84c5('0x14')]('ShowMailQueue',_0x275d4a);logger[_0x84c5('0x25')](_0x84c5('0x26'),_0x275d4a,JSON[_0x84c5('0x17')](_0x3b51ba));_0x2ecd6f(_0x3b51ba);})[_0x84c5('0x1b')](function(_0x5662d0){logger[_0x84c5('0x18')](_0x84c5('0x26'),_0x5662d0[_0x84c5('0x1a')],_0x275d4a);_0x2aba8d(_0x1083f0[_0x84c5('0x18')](0x1f4,_0x5662d0[_0x84c5('0x1a')]));});});}; \ No newline at end of file +var _0x6780=['GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','then','info','stringify','find','where','ShowMailQueue','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x54b268,_0x5c29e4){var _0x49b935=function(_0x2ca36e){while(--_0x2ca36e){_0x54b268['push'](_0x54b268['shift']());}};_0x49b935(++_0x5c29e4);}(_0x6780,0x121));var _0x0678=function(_0x411696,_0x766af7){_0x411696=_0x411696-0x0;var _0xc3d57b=_0x6780[_0x411696];return _0xc3d57b;};'use strict';var _=require(_0x0678('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0678('0x1'));var rs=require(_0x0678('0x2'));var fs=require('fs');var Redis=require(_0x0678('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0678('0x4'));var logger=require('../../config/logger')(_0x0678('0x5'));var config=require(_0x0678('0x6'));var jayson=require(_0x0678('0x7'));var client=jayson[_0x0678('0x8')][_0x0678('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0678('0xa')],{'host':_0x0678('0xb'),'port':0x18eb});var socket=require(_0x0678('0xc'))(new Redis(config[_0x0678('0xa')]));require(_0x0678('0xd'))[_0x0678('0xe')](socket);function respondWithRpcPromise(_0x47ba74,_0x30b6ed,_0x4b399e){return new BPromise(function(_0x28b521,_0x2c4a19){return client[_0x0678('0xf')](_0x47ba74,_0x4b399e)['then'](function(_0x1624b0){logger['info'](_0x0678('0x10'),_0x30b6ed,_0x0678('0x11'));logger[_0x0678('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x30b6ed,_0x0678('0x11'),JSON['stringify'](_0x1624b0));if(_0x1624b0[_0x0678('0x13')]){if(_0x1624b0[_0x0678('0x13')][_0x0678('0x14')]===0x1f4){logger[_0x0678('0x13')](_0x0678('0x10'),_0x30b6ed,_0x1624b0['error'][_0x0678('0x15')]);return _0x2c4a19(_0x1624b0[_0x0678('0x13')]['message']);}logger[_0x0678('0x13')]('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x1624b0['error']['message']);return _0x28b521(_0x1624b0[_0x0678('0x13')][_0x0678('0x15')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x0678('0x11'));_0x28b521(_0x1624b0['result'][_0x0678('0x15')]);}})[_0x0678('0x16')](function(_0x12d515){logger[_0x0678('0x13')]('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x12d515);_0x2c4a19(_0x12d515);});});}exports[_0x0678('0x17')]=function(_0x3c7ded){var _0x3af85c=this;return new Promise(function(_0x3f8c20,_0x3e3511){return db[_0x0678('0x18')][_0x0678('0x19')]({'raw':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c7ded['options']?_0x3c7ded[_0x0678('0x1a')]['where']||null:null,'attributes':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1c')]||null:null,'limit':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1d')]||null:null,'include':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x3c7ded['options'][_0x0678('0x1e')],function(_0x44daea){return{'model':db[_0x44daea[_0x0678('0x20')]],'as':_0x44daea['as'],'attributes':_0x44daea['attributes'],'include':_0x44daea[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x44daea['include'],function(_0x199706){return{'model':db[_0x199706['model']],'as':_0x199706['as'],'attributes':_0x199706['attributes'],'include':_0x199706['include']?_['map'](_0x199706[_0x0678('0x1e')],function(_0x11b330){return{'model':db[_0x11b330['model']],'as':_0x11b330['as'],'attributes':_0x11b330[_0x0678('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0678('0x21')](function(_0x14a79d){logger[_0x0678('0x22')](_0x0678('0x17'),_0x3c7ded);logger[_0x0678('0x12')]('GetMailQueue',_0x3c7ded,JSON[_0x0678('0x23')](_0x14a79d));_0x3f8c20(_0x14a79d);})['catch'](function(_0x25a326){logger['error']('GetMailQueue',_0x25a326[_0x0678('0x15')],_0x3c7ded);_0x3e3511(_0x3af85c['error'](0x1f4,_0x25a326[_0x0678('0x15')]));});});};exports['ShowMailQueue']=function(_0x10aeeb){var _0x1f5f12=this;return new Promise(function(_0x39b8ca,_0x438187){return db[_0x0678('0x18')][_0x0678('0x24')]({'raw':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb['options'][_0x0678('0x1b')]===undefined?!![]:![]:!![],'where':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x25')]||null:null,'attributes':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1c')]||null:null,'include':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1e')],function(_0x52f2a1){return{'model':db[_0x52f2a1[_0x0678('0x20')]],'as':_0x52f2a1['as'],'attributes':_0x52f2a1[_0x0678('0x1c')],'include':_0x52f2a1[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x52f2a1[_0x0678('0x1e')],function(_0x29071e){return{'model':db[_0x29071e[_0x0678('0x20')]],'as':_0x29071e['as'],'attributes':_0x29071e['attributes'],'include':_0x29071e[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x29071e['include'],function(_0x5e1a8e){return{'model':db[_0x5e1a8e['model']],'as':_0x5e1a8e['as'],'attributes':_0x5e1a8e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0678('0x21')](function(_0x404733){logger['info'](_0x0678('0x26'),_0x10aeeb);logger['debug'](_0x0678('0x26'),_0x10aeeb,JSON['stringify'](_0x404733));_0x39b8ca(_0x404733);})[_0x0678('0x16')](function(_0x1dee9c){logger[_0x0678('0x13')]('ShowMailQueue',_0x1dee9c['message'],_0x10aeeb);_0x438187(_0x1f5f12[_0x0678('0x13')](0x1f4,_0x1dee9c[_0x0678('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e67a7dd..a2a37aa 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 _0x5e6c=['save','remove','update','register','length','mailQueue:','./mailQueue.events'];(function(_0x3a58a1,_0x26ceac){var _0x530a3e=function(_0x4a5549){while(--_0x4a5549){_0x3a58a1['push'](_0x3a58a1['shift']());}};_0x530a3e(++_0x26ceac);}(_0x5e6c,0x1b8));var _0xc5e6=function(_0x388927,_0x442897){_0x388927=_0x388927-0x0;var _0x4dc39d=_0x5e6c[_0x388927];return _0x4dc39d;};'use strict';var MailQueueEvents=require(_0xc5e6('0x0'));var events=[_0xc5e6('0x1'),_0xc5e6('0x2'),_0xc5e6('0x3')];function createListener(_0x10f3e4,_0xf5d4b3){return function(_0xdb4fae){_0xf5d4b3['emit'](_0x10f3e4,_0xdb4fae);};}function removeListener(_0x3aaf95,_0x491e50){return function(){MailQueueEvents['removeListener'](_0x3aaf95,_0x491e50);};}exports[_0xc5e6('0x4')]=function(_0x590a6a){for(var _0x57fb60=0x0,_0x165948=events[_0xc5e6('0x5')];_0x57fb60<_0x165948;_0x57fb60++){var _0x24f428=events[_0x57fb60];var _0x2986ab=createListener(_0xc5e6('0x6')+_0x24f428,_0x590a6a);MailQueueEvents['on'](_0x24f428,_0x2986ab);}}; \ No newline at end of file +var _0xf612=['register','length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener'];(function(_0x40682e,_0x2a4b75){var _0x5d6eab=function(_0x378004){while(--_0x378004){_0x40682e['push'](_0x40682e['shift']());}};_0x5d6eab(++_0x2a4b75);}(_0xf612,0x14b));var _0x2f61=function(_0x3dc15b,_0xca4cda){_0x3dc15b=_0x3dc15b-0x0;var _0x223cdf=_0xf612[_0x3dc15b];return _0x223cdf;};'use strict';var MailQueueEvents=require(_0x2f61('0x0'));var events=['save',_0x2f61('0x1'),_0x2f61('0x2')];function createListener(_0x43a157,_0x422781){return function(_0x4ef27c){_0x422781[_0x2f61('0x3')](_0x43a157,_0x4ef27c);};}function removeListener(_0x2bb367,_0x1cfaab){return function(){MailQueueEvents[_0x2f61('0x4')](_0x2bb367,_0x1cfaab);};}exports[_0x2f61('0x5')]=function(_0x3a5eba){for(var _0x51986d=0x0,_0x9d4f08=events[_0x2f61('0x6')];_0x51986d<_0x9d4f08;_0x51986d++){var _0x369643=events[_0x51986d];var _0x5aa2ee=createListener(_0x2f61('0x7')+_0x369643,_0x3a5eba);MailQueueEvents['on'](_0x369643,_0x5aa2ee);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7561f16..3920561 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 _0x3fca=['./mailQueueReport.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x3fca,0x199));var _0xa3fc=function(_0x3fbdae,_0x573656){_0x3fbdae=_0x3fbdae-0x0;var _0x588031=_0x3fca[_0x3fbdae];return _0x588031;};'use strict';var multer=require(_0xa3fc('0x0'));var util=require(_0xa3fc('0x1'));var path=require(_0xa3fc('0x2'));var timeout=require(_0xa3fc('0x3'));var express=require(_0xa3fc('0x4'));var router=express[_0xa3fc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa3fc('0x6'));var interaction=require(_0xa3fc('0x7'));var config=require(_0xa3fc('0x8'));var controller=require(_0xa3fc('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa3fc('0xa')]);router[_0xa3fc('0xb')](_0xa3fc('0xc'),auth[_0xa3fc('0xd')](),controller[_0xa3fc('0xe')]);router[_0xa3fc('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa3fc('0xf')]('/',auth[_0xa3fc('0xd')](),controller[_0xa3fc('0x10')]);router[_0xa3fc('0x11')](_0xa3fc('0x12'),auth[_0xa3fc('0xd')](),controller[_0xa3fc('0x13')]);router['delete'](_0xa3fc('0x12'),auth[_0xa3fc('0xd')](),controller[_0xa3fc('0x14')]);module[_0xa3fc('0x15')]=router; \ No newline at end of file +var _0xe08b=['update','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','create','put','/:id'];(function(_0x2366ca,_0x1275b4){var _0x28bb9d=function(_0x45017e){while(--_0x45017e){_0x2366ca['push'](_0x2366ca['shift']());}};_0x28bb9d(++_0x1275b4);}(_0xe08b,0xd3));var _0xbe08=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xe08b[_0x521929];return _0x632436;};'use strict';var multer=require(_0xbe08('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe08('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbe08('0x2'));var interaction=require(_0xbe08('0x3'));var config=require(_0xbe08('0x4'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xbe08('0x5')](),controller[_0xbe08('0x6')]);router[_0xbe08('0x7')](_0xbe08('0x8'),auth[_0xbe08('0x5')](),controller['describe']);router[_0xbe08('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbe08('0x9')]);router['post']('/',auth[_0xbe08('0x5')](),controller[_0xbe08('0xa')]);router[_0xbe08('0xb')](_0xbe08('0xc'),auth['isAuthenticated'](),controller[_0xbe08('0xd')]);router['delete'](_0xbe08('0xc'),auth[_0xbe08('0x5')](),controller[_0xbe08('0xe')]);module[_0xbe08('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5301096..7433eab 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 _0x310b=['STRING','DATE','moment','exports'];(function(_0x3961f7,_0x549dd4){var _0x2bdea0=function(_0x547b8f){while(--_0x547b8f){_0x3961f7['push'](_0x3961f7['shift']());}};_0x2bdea0(++_0x549dd4);}(_0x310b,0x19e));var _0xb310=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x310b[_0xa8883];return _0x479426;};'use strict';var moment=require(_0xb310('0x0'));var Sequelize=require('sequelize');module[_0xb310('0x1')]={'uniqueid':{'type':Sequelize[_0xb310('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb310('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb310('0x3')]},'reason':{'type':Sequelize[_0xb310('0x2')]}}; \ No newline at end of file +var _0xae02=['exports','STRING','DATE','moment','sequelize'];(function(_0x23f50b,_0x54dd96){var _0x29ddc1=function(_0x4e3d73){while(--_0x4e3d73){_0x23f50b['push'](_0x23f50b['shift']());}};_0x29ddc1(++_0x54dd96);}(_0xae02,0xb7));var _0x2ae0=function(_0x3348ed,_0x3c4f28){_0x3348ed=_0x3348ed-0x0;var _0xace2a8=_0xae02[_0x3348ed];return _0xace2a8;};'use strict';var moment=require(_0x2ae0('0x0'));var Sequelize=require(_0x2ae0('0x1'));module[_0x2ae0('0x2')]={'uniqueid':{'type':Sequelize[_0x2ae0('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2ae0('0x4')]},'leaveAt':{'type':Sequelize[_0x2ae0('0x4')]},'acceptAt':{'type':Sequelize[_0x2ae0('0x4')]},'exitAt':{'type':Sequelize[_0x2ae0('0x4')]},'reason':{'type':Sequelize[_0x2ae0('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bd822cb..e9ff458 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 _0x0b0e=['merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0x4109e8,_0x450578){var _0x55a635=function(_0x2fde78){while(--_0x2fde78){_0x4109e8['push'](_0x4109e8['shift']());}};_0x55a635(++_0x450578);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x0b0e[_0x2b1551];return _0x2fc2a1;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));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('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['MailQueueReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['MailQueueReport'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['MailQueueReport']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};exports[_0xe0b0('0x4a')]=function(_0x54cf7b,_0x4b65d1){return db[_0xe0b0('0x2a')][_0xe0b0('0x4a')]()[_0xe0b0('0x23')](respondWithResult(_0x4b65d1,null))[_0xe0b0('0x43')](handleError(_0x4b65d1,null));}; \ No newline at end of file +var _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x1d0e07,_0x2037e9){var _0x8912e0=function(_0x3b1c66){while(--_0x3b1c66){_0x1d0e07['push'](_0x1d0e07['shift']());}};_0x8912e0(++_0x2037e9);}(_0xbff5,0x1bc));var _0x5bff=function(_0x557388,_0x1e36c9){_0x557388=_0x557388-0x0;var _0x2c2411=_0xbff5[_0x557388];return _0x2c2411;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));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('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](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('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 0713190..ceb10c7 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 _0x91f1=['define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x91f1,0x160));var _0x191f=function(_0x203294,_0x1fc628){_0x203294=_0x203294-0x0;var _0x745f0e=_0x91f1[_0x203294];return _0x745f0e;};'use strict';var _=require('lodash');var util=require(_0x191f('0x0'));var logger=require(_0x191f('0x1'))(_0x191f('0x2'));var moment=require(_0x191f('0x3'));var BPromise=require(_0x191f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x191f('0x5'));var config=require(_0x191f('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x191f('0x7')]=function(_0x469509,_0x2b104d){return _0x469509[_0x191f('0x8')](_0x191f('0x9'),attributes,{'tableName':_0x191f('0xa'),'paranoid':![],'indexes':[{'name':_0x191f('0xb'),'fields':[_0x191f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1bb4=['./mailQueueReport.attributes','define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x985b60,_0x3dde28){var _0x1227df=function(_0x391431){while(--_0x391431){_0x985b60['push'](_0x985b60['shift']());}};_0x1227df(++_0x3dde28);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x53df61,_0xca26f5){_0x53df61=_0x53df61-0x0;var _0x466435=_0x1bb4[_0x53df61];return _0x466435;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var logger=require(_0x41bb('0x2'))(_0x41bb('0x3'));var moment=require(_0x41bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x41bb('0x7'));module['exports']=function(_0x232b17,_0x3ab646){return _0x232b17[_0x41bb('0x8')]('MailQueueReport',attributes,{'tableName':_0x41bb('0x9'),'paranoid':![],'indexes':[{'name':_0x41bb('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b29310d..46729da 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1b81fe,_0xdfbe1b){var _0x8920b1=function(_0x21ba01){while(--_0x21ba01){_0x1b81fe['push'](_0x1b81fe['shift']());}};_0x8920b1(++_0xdfbe1b);}(_0xadb5,0xad));var _0x5adb=function(_0x4d179f,_0x5c68f3){_0x4d179f=_0x4d179f-0x0;var _0x4c99d6=_0xadb5[_0x4d179f];return _0x4c99d6;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x470ce2,_0x4b3815){var _0x739076=function(_0x1f16f3){while(--_0x1f16f3){_0x470ce2['push'](_0x470ce2['shift']());}};_0x739076(++_0x4b3815);}(_0x2ef3,0xba));var _0x32ef=function(_0x2eebc3,_0xc2acdf){_0x2eebc3=_0x2eebc3-0x0;var _0x1a7f81=_0x2ef3[_0x2eebc3];return _0x1a7f81;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index bd1e8ae..195f957 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3054f1,_0x1c160b){var _0x51f5eb=function(_0x27a9a4){while(--_0x27a9a4){_0x3054f1['push'](_0x3054f1['shift']());}};_0x51f5eb(++_0x1c160b);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d5201,_0x28ccfc){var _0x163d60=function(_0x22a702){while(--_0x22a702){_0x2d5201['push'](_0x2d5201['shift']());}};_0x163d60(++_0x28ccfc);}(_0xe706,0xa3));var _0x6e70=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0xe706[_0xe5b349];return _0x26b0ad;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0e51992..5b5318f 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 _0xad0a=['INTEGER','INBOX','exports','STRING','BOOLEAN'];(function(_0x4c71f5,_0x2c2601){var _0xde53f7=function(_0x3e93d4){while(--_0x3e93d4){_0x4c71f5['push'](_0x4c71f5['shift']());}};_0xde53f7(++_0x2c2601);}(_0xad0a,0xe3));var _0xaad0=function(_0xb057ca,_0x19cd08){_0xb057ca=_0xb057ca-0x0;var _0x4be66f=_0xad0a[_0xb057ca];return _0x4be66f;};'use strict';var Sequelize=require('sequelize');module[_0xaad0('0x0')]={'description':{'type':Sequelize[_0xaad0('0x1')]},'host':{'type':Sequelize[_0xaad0('0x1')]},'authentication':{'type':Sequelize[_0xaad0('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xaad0('0x1')]},'port':{'type':Sequelize[_0xaad0('0x3')]},'tls':{'type':Sequelize[_0xaad0('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaad0('0x1')],'defaultValue':_0xaad0('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaad0('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xaad0('0x1')]},'modernAuthentication':{'type':Sequelize[_0xaad0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x42ef=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e1c9c,_0x277057){var _0x651232=function(_0x24d6c6){while(--_0x24d6c6){_0x3e1c9c['push'](_0x3e1c9c['shift']());}};_0x651232(++_0x277057);}(_0x42ef,0x18e));var _0xf42e=function(_0x224fe5,_0x51fd03){_0x224fe5=_0x224fe5-0x0;var _0x4735a9=_0x42ef[_0x224fe5];return _0x4735a9;};'use strict';var Sequelize=require(_0xf42e('0x0'));module[_0xf42e('0x1')]={'description':{'type':Sequelize[_0xf42e('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf42e('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf42e('0x4')]},'tls':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xf42e('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf42e('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf42e('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1e7f79d..d4f62e7 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 _0x56fe=['define','MailServerIn','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x592281,_0xb4f4c6){var _0x919037=function(_0x4c7077){while(--_0x4c7077){_0x592281['push'](_0x592281['shift']());}};_0x919037(++_0xb4f4c6);}(_0x56fe,0x1f1));var _0xe56f=function(_0x28c368,_0x41dad4){_0x28c368=_0x28c368-0x0;var _0x59e75f=_0x56fe[_0x28c368];return _0x59e75f;};'use strict';var _=require(_0xe56f('0x0'));var util=require(_0xe56f('0x1'));var logger=require('../../config/logger')(_0xe56f('0x2'));var moment=require(_0xe56f('0x3'));var BPromise=require(_0xe56f('0x4'));var rp=require(_0xe56f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe56f('0x6'));var attributes=require(_0xe56f('0x7'));module[_0xe56f('0x8')]=function(_0xe445a6,_0x6699d){return _0xe445a6[_0xe56f('0x9')](_0xe56f('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbabb=['request-promise','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','api','moment','bluebird'];(function(_0x36d1c1,_0x4e6866){var _0x19883d=function(_0x594e1d){while(--_0x594e1d){_0x36d1c1['push'](_0x36d1c1['shift']());}};_0x19883d(++_0x4e6866);}(_0xbabb,0x1e0));var _0xbbab=function(_0x43b55d,_0x47055e){_0x43b55d=_0x43b55d-0x0;var _0x5a8eea=_0xbabb[_0x43b55d];return _0x5a8eea;};'use strict';var _=require(_0xbbab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbbab('0x1'));var moment=require(_0xbbab('0x2'));var BPromise=require(_0xbbab('0x3'));var rp=require(_0xbbab('0x4'));var fs=require('fs');var path=require(_0xbbab('0x5'));var rimraf=require('rimraf');var config=require(_0xbbab('0x6'));var attributes=require(_0xbbab('0x7'));module[_0xbbab('0x8')]=function(_0x4200c8,_0x1e9e31){return _0x4200c8['define'](_0xbbab('0x9'),attributes,{'tableName':_0xbbab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index f09296e..134572c 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 _0xf330=['raw','attributes','limit','map','include','model','debug','GetMailServerIn','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailServerIn','options'];(function(_0x11643a,_0x46c5ec){var _0x3f2ece=function(_0x3886e7){while(--_0x3886e7){_0x11643a['push'](_0x11643a['shift']());}};_0x3f2ece(++_0x46c5ec);}(_0xf330,0x147));var _0x0f33=function(_0x29f83d,_0x5a8df2){_0x29f83d=_0x29f83d-0x0;var _0x146c40=_0xf330[_0x29f83d];return _0x146c40;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f33('0x0'));var BPromise=require(_0x0f33('0x1'));var rs=require(_0x0f33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f33('0x3'))['db'];var utils=require(_0x0f33('0x4'));var logger=require('../../config/logger')(_0x0f33('0x5'));var config=require('../../config/environment');var jayson=require(_0x0f33('0x6'));var client=jayson[_0x0f33('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4512b9,_0x4225e8,_0x4ebb93){return new BPromise(function(_0x56b673,_0x10b9cb){return client['request'](_0x4512b9,_0x4ebb93)[_0x0f33('0x8')](function(_0x5790d5){logger[_0x0f33('0x9')](_0x0f33('0xa'),_0x4225e8,'request\x20sent');logger['debug'](_0x0f33('0xb'),_0x4225e8,_0x0f33('0xc'),JSON[_0x0f33('0xd')](_0x5790d5));if(_0x5790d5[_0x0f33('0xe')]){if(_0x5790d5[_0x0f33('0xe')][_0x0f33('0xf')]===0x1f4){logger[_0x0f33('0xe')](_0x0f33('0xa'),_0x4225e8,_0x5790d5['error'][_0x0f33('0x10')]);return _0x10b9cb(_0x5790d5[_0x0f33('0xe')][_0x0f33('0x10')]);}logger['error'](_0x0f33('0xa'),_0x4225e8,_0x5790d5[_0x0f33('0xe')][_0x0f33('0x10')]);return _0x56b673(_0x5790d5['error'][_0x0f33('0x10')]);}else{logger[_0x0f33('0x9')](_0x0f33('0xa'),_0x4225e8,_0x0f33('0xc'));_0x56b673(_0x5790d5[_0x0f33('0x11')][_0x0f33('0x10')]);}})[_0x0f33('0x12')](function(_0x39c609){logger['error'](_0x0f33('0xa'),_0x4225e8,_0x39c609);_0x10b9cb(_0x39c609);});});}exports['GetMailServerIn']=function(_0x5540f6){var _0x19f26b=this;return new Promise(function(_0x35d2d4,_0x585c31){return db[_0x0f33('0x13')]['findAll']({'raw':_0x5540f6['options']?_0x5540f6[_0x0f33('0x14')][_0x0f33('0x15')]===undefined?!![]:![]:!![],'where':_0x5540f6['options']?_0x5540f6[_0x0f33('0x14')]['where']||null:null,'attributes':_0x5540f6[_0x0f33('0x14')]?_0x5540f6[_0x0f33('0x14')][_0x0f33('0x16')]||null:null,'limit':_0x5540f6[_0x0f33('0x14')]?_0x5540f6[_0x0f33('0x14')][_0x0f33('0x17')]||null:null,'include':_0x5540f6[_0x0f33('0x14')]?_0x5540f6[_0x0f33('0x14')]['include']?_[_0x0f33('0x18')](_0x5540f6['options'][_0x0f33('0x19')],function(_0x106410){return{'model':db[_0x106410[_0x0f33('0x1a')]],'as':_0x106410['as'],'attributes':_0x106410['attributes'],'include':_0x106410[_0x0f33('0x19')]?_['map'](_0x106410[_0x0f33('0x19')],function(_0xf4461b){return{'model':db[_0xf4461b[_0x0f33('0x1a')]],'as':_0xf4461b['as'],'attributes':_0xf4461b['attributes'],'include':_0xf4461b[_0x0f33('0x19')]?_[_0x0f33('0x18')](_0xf4461b['include'],function(_0x1e84a0){return{'model':db[_0x1e84a0['model']],'as':_0x1e84a0['as'],'attributes':_0x1e84a0[_0x0f33('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0f33('0x8')](function(_0x5aebef){logger[_0x0f33('0x9')]('GetMailServerIn',_0x5540f6);logger[_0x0f33('0x1b')](_0x0f33('0x1c'),_0x5540f6,JSON[_0x0f33('0xd')](_0x5aebef));_0x35d2d4(_0x5aebef);})[_0x0f33('0x12')](function(_0x17feb5){logger[_0x0f33('0xe')]('GetMailServerIn',_0x17feb5['message'],_0x5540f6);_0x585c31(_0x19f26b[_0x0f33('0xe')](0x1f4,_0x17feb5[_0x0f33('0x10')]));});});}; \ No newline at end of file +var _0xc17f=['MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xc17f,0xb8));var _0xfc17=function(_0x2b5784,_0x3fcb61){_0x2b5784=_0x2b5784-0x0;var _0x234ef2=_0xc17f[_0x2b5784];return _0x234ef2;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc17('0x6'));var logger=require(_0xfc17('0x7'))(_0xfc17('0x8'));var config=require(_0xfc17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc17('0xa')][_0xfc17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21c2ef,_0x11fa33,_0x404ee0){return new BPromise(function(_0x3cd590,_0x149054){return client[_0xfc17('0xc')](_0x21c2ef,_0x404ee0)['then'](function(_0x33bd35){logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x11fa33,_0xfc17('0xf'),JSON[_0xfc17('0x10')](_0x33bd35));if(_0x33bd35[_0xfc17('0x11')]){if(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x12')]===0x1f4){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);return _0x149054(_0x33bd35[_0xfc17('0x11')]['message']);}logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')]['message']);return _0x3cd590(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);}else{logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));_0x3cd590(_0x33bd35[_0xfc17('0x14')][_0xfc17('0x13')]);}})[_0xfc17('0x15')](function(_0x35f947){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x35f947);_0x149054(_0x35f947);});});}exports[_0xfc17('0x16')]=function(_0x2bbb0e){var _0x5b2c7c=this;return new Promise(function(_0x544740,_0x2aa3a2){return db[_0xfc17('0x17')][_0xfc17('0x18')]({'raw':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')]['where']||null:null,'attributes':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1b')]||null:null,'limit':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1c')]||null:null,'include':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x2bbb0e['options'][_0xfc17('0x1d')],function(_0x2285df){return{'model':db[_0x2285df[_0xfc17('0x1f')]],'as':_0x2285df['as'],'attributes':_0x2285df[_0xfc17('0x1b')],'include':_0x2285df[_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x2285df['include'],function(_0x1cab65){return{'model':db[_0x1cab65[_0xfc17('0x1f')]],'as':_0x1cab65['as'],'attributes':_0x1cab65['attributes'],'include':_0x1cab65[_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x1cab65['include'],function(_0x4e4cf5){return{'model':db[_0x4e4cf5[_0xfc17('0x1f')]],'as':_0x4e4cf5['as'],'attributes':_0x4e4cf5[_0xfc17('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4301c3){logger[_0xfc17('0xd')]('GetMailServerIn',_0x2bbb0e);logger[_0xfc17('0x20')](_0xfc17('0x16'),_0x2bbb0e,JSON['stringify'](_0x4301c3));_0x544740(_0x4301c3);})[_0xfc17('0x15')](function(_0xfbd493){logger['error']('GetMailServerIn',_0xfbd493[_0xfc17('0x13')],_0x2bbb0e);_0x2aa3a2(_0x5b2c7c[_0xfc17('0x11')](0x1f4,_0xfbd493[_0xfc17('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 611ee05..372856a 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x594a49,_0x49ef64){_0x594a49=_0x594a49-0x0;var _0x80a900=_0x7a54[_0x594a49];return _0x80a900;};'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 fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0f6ca10..e70a2c6 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 _0x1339=['BOOLEAN','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1339,0x1ed));var _0x9133=function(_0x346e9d,_0x545f59){_0x346e9d=_0x346e9d-0x0;var _0x2b56a2=_0x1339[_0x346e9d];return _0x2b56a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9133('0x0')]},'host':{'type':Sequelize[_0x9133('0x0')]},'user':{'type':Sequelize[_0x9133('0x0')]},'pass':{'type':Sequelize[_0x9133('0x0')]},'port':{'type':Sequelize[_0x9133('0x1')]},'secure':{'type':Sequelize[_0x9133('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x9133('0x0')]},'authentication':{'type':Sequelize[_0x9133('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0bb5=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0bb5,0x148));var _0x50bb=function(_0x4b5d2f,_0x4ae600){_0x4b5d2f=_0x4b5d2f-0x0;var _0x351bc8=_0x0bb5[_0x4b5d2f];return _0x351bc8;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x50bb('0x2')]},'pass':{'type':Sequelize[_0x50bb('0x2')]},'port':{'type':Sequelize[_0x50bb('0x3')]},'secure':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x50bb('0x2')]},'authentication':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x50bb('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 7de4a2b..ee43f05 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 _0xb865=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','MailServerOut','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1eaf15,_0x187a54){var _0x5900e6=function(_0x491913){while(--_0x491913){_0x1eaf15['push'](_0x1eaf15['shift']());}};_0x5900e6(++_0x187a54);}(_0xb865,0xf8));var _0x5b86=function(_0x100a95,_0x3188df){_0x100a95=_0x100a95-0x0;var _0x19c632=_0xb865[_0x100a95];return _0x19c632;};'use strict';var emlformat=require(_0x5b86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b86('0x1'));var jsonpatch=require(_0x5b86('0x2'));var rp=require(_0x5b86('0x3'));var moment=require(_0x5b86('0x4'));var BPromise=require(_0x5b86('0x5'));var Mustache=require(_0x5b86('0x6'));var util=require(_0x5b86('0x7'));var path=require(_0x5b86('0x8'));var sox=require(_0x5b86('0x9'));var csv=require(_0x5b86('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b86('0xb'));var _=require('lodash');var squel=require(_0x5b86('0xc'));var crypto=require(_0x5b86('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b86('0xe'));var toCsv=require(_0x5b86('0xa'));var querystring=require(_0x5b86('0xf'));var Papa=require(_0x5b86('0x10'));var Redis=require(_0x5b86('0x11'));var authService=require(_0x5b86('0x12'));var qs=require(_0x5b86('0x13'));var as=require(_0x5b86('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b86('0x15'))('api');var utils=require(_0x5b86('0x16'));var config=require(_0x5b86('0x17'));var licenseUtil=require(_0x5b86('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x115141,_0x555cfb){_0x555cfb=_0x555cfb||0xcc;return function(_0x531fdd){if(_0x531fdd){return _0x115141[_0x5b86('0x19')](_0x555cfb);}return _0x115141[_0x5b86('0x1a')](_0x555cfb)['end']();};}function respondWithResult(_0x203021,_0x4d0482){_0x4d0482=_0x4d0482||0xc8;return function(_0x3a2f08){if(_0x3a2f08){return _0x203021[_0x5b86('0x1a')](_0x4d0482)[_0x5b86('0x1b')](_0x3a2f08);}};}function respondWithFilteredResult(_0x2c041e,_0x477542){return function(_0x2a7799){if(_0x2a7799){var _0x24628f=typeof _0x477542['offset']==='undefined'&&typeof _0x477542[_0x5b86('0x1c')]===_0x5b86('0x1d');var _0x439ad4=_0x2a7799[_0x5b86('0x1e')];var _0x1f7f5e=_0x24628f?0x0:_0x477542[_0x5b86('0x1f')];var _0xc832a2=_0x24628f?_0x2a7799[_0x5b86('0x1e')]:_0x477542[_0x5b86('0x1f')]+_0x477542[_0x5b86('0x1c')];var _0x15a1b1;if(_0xc832a2>=_0x439ad4){_0xc832a2=_0x439ad4;_0x15a1b1=0xc8;}else{_0x15a1b1=0xce;}_0x2c041e[_0x5b86('0x1a')](_0x15a1b1);return _0x2c041e[_0x5b86('0x20')](_0x5b86('0x21'),_0x1f7f5e+'-'+_0xc832a2+'/'+_0x439ad4)[_0x5b86('0x1b')](_0x2a7799);}return null;};}function patchUpdates(_0x2756d2){return function(_0x5eb14d){try{jsonpatch['apply'](_0x5eb14d,_0x2756d2,!![]);}catch(_0x4272a9){return BPromise['reject'](_0x4272a9);}return _0x5eb14d[_0x5b86('0x22')]();};}function saveUpdates(_0xe80928,_0x5cc245){return function(_0x4fd82e){if(_0x4fd82e){return _0x4fd82e[_0x5b86('0x23')](_0xe80928)[_0x5b86('0x24')](function(_0x1903fe){return _0x1903fe;});}return null;};}function removeEntity(_0x48f919,_0x4f512d){return function(_0x57c034){if(_0x57c034){return _0x57c034[_0x5b86('0x25')]()[_0x5b86('0x24')](function(){_0x48f919[_0x5b86('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4185f8,_0x2f7d64){return function(_0x4cbaca){if(!_0x4cbaca){_0x4185f8[_0x5b86('0x19')](0x194);}return _0x4cbaca;};}function handleError(_0x8aa9d5,_0x45867e){_0x45867e=_0x45867e||0x1f4;return function(_0x3c7cf3){logger[_0x5b86('0x26')](_0x3c7cf3[_0x5b86('0x27')]);if(_0x3c7cf3[_0x5b86('0x28')]){delete _0x3c7cf3[_0x5b86('0x28')];}_0x8aa9d5['status'](_0x45867e)[_0x5b86('0x29')](_0x3c7cf3);};}exports[_0x5b86('0x2a')]=function(_0x51f200,_0x102a77){var _0x2e8ced={},_0x11e939={},_0x57e37e={'count':0x0,'rows':[]};var _0x474693=_[_0x5b86('0x2b')](db['MailServerOut'][_0x5b86('0x2c')],function(_0x442d72){return{'name':_0x442d72['fieldName'],'type':_0x442d72[_0x5b86('0x2d')][_0x5b86('0x2e')]};});_0x11e939[_0x5b86('0x2f')]=_[_0x5b86('0x2b')](_0x474693,'name');_0x11e939[_0x5b86('0x30')]=_[_0x5b86('0x31')](_0x51f200[_0x5b86('0x30')]);_0x11e939[_0x5b86('0x32')]=_[_0x5b86('0x33')](_0x11e939['model'],_0x11e939['query']);_0x2e8ced[_0x5b86('0x34')]=_[_0x5b86('0x33')](_0x11e939[_0x5b86('0x2f')],qs[_0x5b86('0x35')](_0x51f200['query'][_0x5b86('0x35')]));_0x2e8ced[_0x5b86('0x34')]=_0x2e8ced[_0x5b86('0x34')][_0x5b86('0x36')]?_0x2e8ced[_0x5b86('0x34')]:_0x11e939[_0x5b86('0x2f')];if(!_0x51f200[_0x5b86('0x30')][_0x5b86('0x37')](_0x5b86('0x38'))){_0x2e8ced[_0x5b86('0x1c')]=qs[_0x5b86('0x1c')](_0x51f200[_0x5b86('0x30')][_0x5b86('0x1c')]);_0x2e8ced['offset']=qs[_0x5b86('0x1f')](_0x51f200[_0x5b86('0x30')][_0x5b86('0x1f')]);}_0x2e8ced[_0x5b86('0x39')]=qs['sort'](_0x51f200[_0x5b86('0x30')][_0x5b86('0x3a')]);_0x2e8ced[_0x5b86('0x3b')]=qs['filters'](_[_0x5b86('0x3c')](_0x51f200[_0x5b86('0x30')],_0x11e939[_0x5b86('0x32')]),_0x474693);if(_0x51f200['query']['filter']){_0x2e8ced[_0x5b86('0x3b')]=_[_0x5b86('0x3d')](_0x2e8ced[_0x5b86('0x3b')],{'$or':_[_0x5b86('0x2b')](_0x474693,function(_0x153b91){if(_0x153b91[_0x5b86('0x2d')]!==_0x5b86('0x3e')){var _0xd22b2a={};_0xd22b2a[_0x153b91[_0x5b86('0x28')]]={'$like':'%'+_0x51f200[_0x5b86('0x30')][_0x5b86('0x3f')]+'%'};return _0xd22b2a;}})});}_0x2e8ced=_[_0x5b86('0x3d')]({},_0x2e8ced,_0x51f200[_0x5b86('0x40')]);var _0x471b06={'where':_0x2e8ced[_0x5b86('0x3b')]};return db['MailServerOut'][_0x5b86('0x1e')](_0x471b06)[_0x5b86('0x24')](function(_0x2d12f8){_0x57e37e[_0x5b86('0x1e')]=_0x2d12f8;if(_0x51f200[_0x5b86('0x30')][_0x5b86('0x41')]){_0x2e8ced[_0x5b86('0x42')]=[{'all':!![]}];}return db[_0x5b86('0x43')][_0x5b86('0x44')](_0x2e8ced);})[_0x5b86('0x24')](function(_0x3e82e9){_0x57e37e[_0x5b86('0x45')]=_0x3e82e9;return _0x57e37e;})[_0x5b86('0x24')](respondWithFilteredResult(_0x102a77,_0x2e8ced))[_0x5b86('0x46')](handleError(_0x102a77,null));};exports[_0x5b86('0x47')]=function(_0x305768,_0x26d511){var _0x20e89e={'raw':!![],'where':{'id':_0x305768[_0x5b86('0x48')]['id']}},_0x41445a={};_0x41445a[_0x5b86('0x2f')]=_[_0x5b86('0x31')](db['MailServerOut'][_0x5b86('0x2c')]);_0x41445a['query']=_[_0x5b86('0x31')](_0x305768[_0x5b86('0x30')]);_0x41445a[_0x5b86('0x32')]=_[_0x5b86('0x33')](_0x41445a[_0x5b86('0x2f')],_0x41445a['query']);_0x20e89e[_0x5b86('0x34')]=_[_0x5b86('0x33')](_0x41445a[_0x5b86('0x2f')],qs[_0x5b86('0x35')](_0x305768[_0x5b86('0x30')][_0x5b86('0x35')]));_0x20e89e[_0x5b86('0x34')]=_0x20e89e[_0x5b86('0x34')][_0x5b86('0x36')]?_0x20e89e[_0x5b86('0x34')]:_0x41445a[_0x5b86('0x2f')];if(_0x305768['query'][_0x5b86('0x41')]){_0x20e89e[_0x5b86('0x42')]=[{'all':!![]}];}_0x20e89e=_[_0x5b86('0x3d')]({},_0x20e89e,_0x305768[_0x5b86('0x40')]);return db[_0x5b86('0x43')][_0x5b86('0x49')](_0x20e89e)[_0x5b86('0x24')](handleEntityNotFound(_0x26d511,null))[_0x5b86('0x24')](respondWithResult(_0x26d511,null))[_0x5b86('0x46')](handleError(_0x26d511,null));};exports[_0x5b86('0x4a')]=function(_0x9b8d82,_0x4654c1){return db[_0x5b86('0x43')][_0x5b86('0x4a')](_0x9b8d82[_0x5b86('0x4b')],{})[_0x5b86('0x24')](respondWithResult(_0x4654c1,0xc9))[_0x5b86('0x46')](handleError(_0x4654c1,null));};exports['update']=function(_0x323440,_0x134691){if(_0x323440[_0x5b86('0x4b')]['id']){delete _0x323440[_0x5b86('0x4b')]['id'];}return db[_0x5b86('0x43')][_0x5b86('0x49')]({'where':{'id':_0x323440[_0x5b86('0x48')]['id']}})[_0x5b86('0x24')](handleEntityNotFound(_0x134691,null))[_0x5b86('0x24')](saveUpdates(_0x323440[_0x5b86('0x4b')],null))[_0x5b86('0x24')](respondWithResult(_0x134691,null))[_0x5b86('0x46')](handleError(_0x134691,null));};exports['destroy']=function(_0x284786,_0x10b410){return db['MailServerOut'][_0x5b86('0x49')]({'where':{'id':_0x284786[_0x5b86('0x48')]['id']}})[_0x5b86('0x24')](handleEntityNotFound(_0x10b410,null))['then'](removeEntity(_0x10b410,null))['catch'](handleError(_0x10b410,null));}; \ No newline at end of file +var _0x4ea0=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','send','index','MailServerOut','rawAttributes','fieldName','type','key','map','name','query','keys','filters','model','attributes','fields','length','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4ea0,0x16b));var _0x04ea=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x4ea0[_0x483102];return _0x5cc885;};'use strict';var emlformat=require(_0x04ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04ea('0x1'));var jsonpatch=require(_0x04ea('0x2'));var rp=require('request-promise');var moment=require(_0x04ea('0x3'));var BPromise=require(_0x04ea('0x4'));var Mustache=require(_0x04ea('0x5'));var util=require(_0x04ea('0x6'));var path=require(_0x04ea('0x7'));var sox=require(_0x04ea('0x8'));var csv=require(_0x04ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04ea('0xa'));var _=require(_0x04ea('0xb'));var squel=require(_0x04ea('0xc'));var crypto=require(_0x04ea('0xd'));var jsforce=require(_0x04ea('0xe'));var deskjs=require(_0x04ea('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04ea('0x10'));var qs=require(_0x04ea('0x11'));var as=require(_0x04ea('0x12'));var hardwareService=require(_0x04ea('0x13'));var logger=require(_0x04ea('0x14'))(_0x04ea('0x15'));var utils=require(_0x04ea('0x16'));var config=require(_0x04ea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x04ea('0x18'))['db'];function respondWithStatusCode(_0xbc3894,_0x325b9b){_0x325b9b=_0x325b9b||0xcc;return function(_0x96dee2){if(_0x96dee2){return _0xbc3894[_0x04ea('0x19')](_0x325b9b);}return _0xbc3894[_0x04ea('0x1a')](_0x325b9b)[_0x04ea('0x1b')]();};}function respondWithResult(_0x4cbb60,_0x10991b){_0x10991b=_0x10991b||0xc8;return function(_0x1fdfc4){if(_0x1fdfc4){return _0x4cbb60[_0x04ea('0x1a')](_0x10991b)[_0x04ea('0x1c')](_0x1fdfc4);}};}function respondWithFilteredResult(_0x2c2116,_0x1b4a23){return function(_0x30e9c1){if(_0x30e9c1){var _0x2a64ae=typeof _0x1b4a23[_0x04ea('0x1d')]==='undefined'&&typeof _0x1b4a23[_0x04ea('0x1e')]===_0x04ea('0x1f');var _0x2ef994=_0x30e9c1[_0x04ea('0x20')];var _0x1139b5=_0x2a64ae?0x0:_0x1b4a23[_0x04ea('0x1d')];var _0x20a89e=_0x2a64ae?_0x30e9c1['count']:_0x1b4a23[_0x04ea('0x1d')]+_0x1b4a23['limit'];var _0x55c368;if(_0x20a89e>=_0x2ef994){_0x20a89e=_0x2ef994;_0x55c368=0xc8;}else{_0x55c368=0xce;}_0x2c2116[_0x04ea('0x1a')](_0x55c368);return _0x2c2116['set'](_0x04ea('0x21'),_0x1139b5+'-'+_0x20a89e+'/'+_0x2ef994)[_0x04ea('0x1c')](_0x30e9c1);}return null;};}function patchUpdates(_0x1e8c8f){return function(_0x96b47e){try{jsonpatch[_0x04ea('0x22')](_0x96b47e,_0x1e8c8f,!![]);}catch(_0x272f84){return BPromise[_0x04ea('0x23')](_0x272f84);}return _0x96b47e[_0x04ea('0x24')]();};}function saveUpdates(_0x1380ea,_0x141fba){return function(_0x43bba0){if(_0x43bba0){return _0x43bba0[_0x04ea('0x25')](_0x1380ea)['then'](function(_0x44e988){return _0x44e988;});}return null;};}function removeEntity(_0x3fc262,_0x38070e){return function(_0x3b77bc){if(_0x3b77bc){return _0x3b77bc['destroy']()[_0x04ea('0x26')](function(){_0x3fc262[_0x04ea('0x1a')](0xcc)[_0x04ea('0x1b')]();});}};}function handleEntityNotFound(_0x49e922,_0xd5592a){return function(_0x330293){if(!_0x330293){_0x49e922[_0x04ea('0x19')](0x194);}return _0x330293;};}function handleError(_0x4e7c62,_0x4abada){_0x4abada=_0x4abada||0x1f4;return function(_0x2e3444){logger[_0x04ea('0x27')](_0x2e3444[_0x04ea('0x28')]);if(_0x2e3444['name']){delete _0x2e3444['name'];}_0x4e7c62[_0x04ea('0x1a')](_0x4abada)[_0x04ea('0x29')](_0x2e3444);};}exports[_0x04ea('0x2a')]=function(_0x1f7dfc,_0x5dc52c){var _0x20180f={},_0x3d836b={},_0x50e21d={'count':0x0,'rows':[]};var _0x596cd8=_['map'](db[_0x04ea('0x2b')][_0x04ea('0x2c')],function(_0x26528c){return{'name':_0x26528c[_0x04ea('0x2d')],'type':_0x26528c[_0x04ea('0x2e')][_0x04ea('0x2f')]};});_0x3d836b['model']=_[_0x04ea('0x30')](_0x596cd8,_0x04ea('0x31'));_0x3d836b[_0x04ea('0x32')]=_[_0x04ea('0x33')](_0x1f7dfc['query']);_0x3d836b[_0x04ea('0x34')]=_['intersection'](_0x3d836b[_0x04ea('0x35')],_0x3d836b[_0x04ea('0x32')]);_0x20180f[_0x04ea('0x36')]=_['intersection'](_0x3d836b['model'],qs[_0x04ea('0x37')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x37')]));_0x20180f['attributes']=_0x20180f[_0x04ea('0x36')][_0x04ea('0x38')]?_0x20180f[_0x04ea('0x36')]:_0x3d836b[_0x04ea('0x35')];if(!_0x1f7dfc[_0x04ea('0x32')]['hasOwnProperty']('nolimit')){_0x20180f[_0x04ea('0x1e')]=qs[_0x04ea('0x1e')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x1e')]);_0x20180f[_0x04ea('0x1d')]=qs['offset'](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x1d')]);}_0x20180f['order']=qs[_0x04ea('0x39')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x39')]);_0x20180f['where']=qs[_0x04ea('0x34')](_[_0x04ea('0x3a')](_0x1f7dfc[_0x04ea('0x32')],_0x3d836b[_0x04ea('0x34')]),_0x596cd8);if(_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x3b')]){_0x20180f['where']=_[_0x04ea('0x3c')](_0x20180f[_0x04ea('0x3d')],{'$or':_[_0x04ea('0x30')](_0x596cd8,function(_0x518880){if(_0x518880[_0x04ea('0x2e')]!==_0x04ea('0x3e')){var _0x2a4b23={};_0x2a4b23[_0x518880[_0x04ea('0x31')]]={'$like':'%'+_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x3b')]+'%'};return _0x2a4b23;}})});}_0x20180f=_[_0x04ea('0x3c')]({},_0x20180f,_0x1f7dfc[_0x04ea('0x3f')]);var _0x12ce9d={'where':_0x20180f['where']};return db[_0x04ea('0x2b')][_0x04ea('0x20')](_0x12ce9d)['then'](function(_0x5ee985){_0x50e21d[_0x04ea('0x20')]=_0x5ee985;if(_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x40')]){_0x20180f['include']=[{'all':!![]}];}return db[_0x04ea('0x2b')]['findAll'](_0x20180f);})[_0x04ea('0x26')](function(_0xd5c104){_0x50e21d[_0x04ea('0x41')]=_0xd5c104;return _0x50e21d;})['then'](respondWithFilteredResult(_0x5dc52c,_0x20180f))[_0x04ea('0x42')](handleError(_0x5dc52c,null));};exports[_0x04ea('0x43')]=function(_0x464fd0,_0x162239){var _0x5ac141={'raw':!![],'where':{'id':_0x464fd0[_0x04ea('0x44')]['id']}},_0x12611a={};_0x12611a[_0x04ea('0x35')]=_[_0x04ea('0x33')](db['MailServerOut'][_0x04ea('0x2c')]);_0x12611a[_0x04ea('0x32')]=_[_0x04ea('0x33')](_0x464fd0[_0x04ea('0x32')]);_0x12611a['filters']=_['intersection'](_0x12611a['model'],_0x12611a['query']);_0x5ac141[_0x04ea('0x36')]=_[_0x04ea('0x45')](_0x12611a['model'],qs[_0x04ea('0x37')](_0x464fd0[_0x04ea('0x32')]['fields']));_0x5ac141[_0x04ea('0x36')]=_0x5ac141['attributes'][_0x04ea('0x38')]?_0x5ac141[_0x04ea('0x36')]:_0x12611a['model'];if(_0x464fd0[_0x04ea('0x32')][_0x04ea('0x40')]){_0x5ac141['include']=[{'all':!![]}];}_0x5ac141=_[_0x04ea('0x3c')]({},_0x5ac141,_0x464fd0[_0x04ea('0x3f')]);return db['MailServerOut']['find'](_0x5ac141)[_0x04ea('0x26')](handleEntityNotFound(_0x162239,null))[_0x04ea('0x26')](respondWithResult(_0x162239,null))['catch'](handleError(_0x162239,null));};exports[_0x04ea('0x46')]=function(_0x126d76,_0x4a512a){return db['MailServerOut'][_0x04ea('0x46')](_0x126d76[_0x04ea('0x47')],{})['then'](respondWithResult(_0x4a512a,0xc9))[_0x04ea('0x42')](handleError(_0x4a512a,null));};exports[_0x04ea('0x25')]=function(_0x17d361,_0x530b79){if(_0x17d361[_0x04ea('0x47')]['id']){delete _0x17d361[_0x04ea('0x47')]['id'];}return db['MailServerOut'][_0x04ea('0x48')]({'where':{'id':_0x17d361['params']['id']}})['then'](handleEntityNotFound(_0x530b79,null))[_0x04ea('0x26')](saveUpdates(_0x17d361[_0x04ea('0x47')],null))['then'](respondWithResult(_0x530b79,null))[_0x04ea('0x42')](handleError(_0x530b79,null));};exports[_0x04ea('0x49')]=function(_0xbbe860,_0x181cbe){return db[_0x04ea('0x2b')][_0x04ea('0x48')]({'where':{'id':_0xbbe860[_0x04ea('0x44')]['id']}})[_0x04ea('0x26')](handleEntityNotFound(_0x181cbe,null))[_0x04ea('0x26')](removeEntity(_0x181cbe,null))[_0x04ea('0x42')](handleError(_0x181cbe,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 5006967..e21d7af 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 _0xd547=['./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xd547,0xdc));var _0x7d54=function(_0x468c3d,_0x4cb0c8){_0x468c3d=_0x468c3d-0x0;var _0x461549=_0xd547[_0x468c3d];return _0x461549;};'use strict';var _=require('lodash');var util=require(_0x7d54('0x0'));var logger=require(_0x7d54('0x1'))(_0x7d54('0x2'));var moment=require(_0x7d54('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d54('0x4'));var fs=require('fs');var path=require(_0x7d54('0x5'));var rimraf=require(_0x7d54('0x6'));var config=require(_0x7d54('0x7'));var attributes=require(_0x7d54('0x8'));module[_0x7d54('0x9')]=function(_0x58da8e,_0x2940ca){return _0x58da8e['define'](_0x7d54('0xa'),attributes,{'tableName':_0x7d54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd9=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out'];(function(_0x1fbde3,_0x59da39){var _0x2b092f=function(_0x18bd24){while(--_0x18bd24){_0x1fbde3['push'](_0x1fbde3['shift']());}};_0x2b092f(++_0x59da39);}(_0x3cd9,0xc0));var _0x93cd=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x3cd9[_0x37cc52];return _0x2b4a90;};'use strict';var _=require(_0x93cd('0x0'));var util=require(_0x93cd('0x1'));var logger=require(_0x93cd('0x2'))(_0x93cd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x93cd('0x4'));var fs=require('fs');var path=require(_0x93cd('0x5'));var rimraf=require('rimraf');var config=require(_0x93cd('0x6'));var attributes=require(_0x93cd('0x7'));module[_0x93cd('0x8')]=function(_0x14dd2e,_0x13152e){return _0x14dd2e[_0x93cd('0x9')](_0x93cd('0xa'),attributes,{'tableName':_0x93cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index e3385a0..4e5b42e 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4d91d6,_0x49071f){var _0x2bfee3=function(_0x3a2020){while(--_0x3a2020){_0x4d91d6['push'](_0x4d91d6['shift']());}};_0x2bfee3(++_0x49071f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x127d1d,_0x32fcdc){_0x127d1d=_0x127d1d-0x0;var _0x5848a3=_0x5f2f[_0x127d1d];return _0x5848a3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x418d65,_0x69d05c){var _0x3bb5e4=function(_0x43b92b){while(--_0x43b92b){_0x418d65['push'](_0x418d65['shift']());}};_0x3bb5e4(++_0x69d05c);}(_0x2ef3,0xba));var _0x32ef=function(_0x3641d1,_0x351017){_0x3641d1=_0x3641d1-0x0;var _0x336508=_0x2ef3[_0x3641d1];return _0x336508;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ece2d93..9411f67 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 _0xd6aa=['Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','/describe','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x6c3a85,_0x11061e){var _0x8969fb=function(_0x4a57c5){while(--_0x4a57c5){_0x6c3a85['push'](_0x6c3a85['shift']());}};_0x8969fb(++_0x11061e);}(_0xd6aa,0xe6));var _0xad6a=function(_0x4ebff3,_0x327a1a){_0x4ebff3=_0x4ebff3-0x0;var _0x1b419d=_0xd6aa[_0x4ebff3];return _0x1b419d;};'use strict';var multer=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var path=require('path');var timeout=require(_0xad6a('0x2'));var express=require(_0xad6a('0x3'));var router=express[_0xad6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xad6a('0x5'));var interaction=require(_0xad6a('0x6'));var config=require('../../config/environment');var controller=require(_0xad6a('0x7'));router[_0xad6a('0x8')]('/',auth[_0xad6a('0x9')](),controller['index']);router['get'](_0xad6a('0xa'),auth[_0xad6a('0x9')](),controller['describe']);router[_0xad6a('0x8')]('/:id',auth[_0xad6a('0x9')](),controller['show']);router[_0xad6a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xad6a('0xc')]('/:id',auth[_0xad6a('0x9')](),controller[_0xad6a('0xd')]);router[_0xad6a('0xe')](_0xad6a('0xf'),auth[_0xad6a('0x9')](),controller[_0xad6a('0x10')]);module[_0xad6a('0x11')]=router; \ No newline at end of file +var _0x0f69=['fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x0f69,0x175));var _0x90f6=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x0f69[_0x456fb1];return _0x4083d6;};'use strict';var multer=require(_0x90f6('0x0'));var util=require(_0x90f6('0x1'));var path=require('path');var timeout=require(_0x90f6('0x2'));var express=require(_0x90f6('0x3'));var router=express[_0x90f6('0x4')]();var fs_extra=require(_0x90f6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x90f6('0x6'));var config=require(_0x90f6('0x7'));var controller=require(_0x90f6('0x8'));router['get']('/',auth[_0x90f6('0x9')](),controller[_0x90f6('0xa')]);router[_0x90f6('0xb')](_0x90f6('0xc'),auth[_0x90f6('0x9')](),controller[_0x90f6('0xd')]);router[_0x90f6('0xb')]('/:id',auth[_0x90f6('0x9')](),controller[_0x90f6('0xe')]);router[_0x90f6('0xf')]('/',auth[_0x90f6('0x9')](),controller[_0x90f6('0x10')]);router[_0x90f6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x90f6('0x12')]);router[_0x90f6('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x90f6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 9b90b0b..d2dcdee 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 _0x8ca9=['sequelize','exports','STRING','name'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0x8ca9,0x9c));var _0x98ca=function(_0x2ffc18,_0x25327b){_0x2ffc18=_0x2ffc18-0x0;var _0x13dad7=_0x8ca9[_0x2ffc18];return _0x13dad7;};'use strict';var Sequelize=require(_0x98ca('0x0'));module[_0x98ca('0x1')]={'name':{'type':Sequelize[_0x98ca('0x2')],'unique':_0x98ca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x98ca('0x2')]}}; \ No newline at end of file +var _0xe714=['name','sequelize','STRING'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe714,0xe2));var _0x4e71=function(_0x16ef16,_0x3b9d9a){_0x16ef16=_0x16ef16-0x0;var _0x53714e=_0xe714[_0x16ef16];return _0x53714e;};'use strict';var Sequelize=require(_0x4e71('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e71('0x1')],'unique':_0x4e71('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4e71('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3655634..b825923 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 _0x3324=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','where','merge','VIRTUAL','filter','options','MailSubstatus','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring'];(function(_0x3eaa6e,_0x554e7e){var _0x26bc33=function(_0x524909){while(--_0x524909){_0x3eaa6e['push'](_0x3eaa6e['shift']());}};_0x26bc33(++_0x554e7e);}(_0x3324,0x15e));var _0x4332=function(_0x1ef9ef,_0x197016){_0x1ef9ef=_0x1ef9ef-0x0;var _0x1f42b8=_0x3324[_0x1ef9ef];return _0x1f42b8;};'use strict';var emlformat=require(_0x4332('0x0'));var rimraf=require(_0x4332('0x1'));var zipdir=require(_0x4332('0x2'));var jsonpatch=require(_0x4332('0x3'));var rp=require('request-promise');var moment=require(_0x4332('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4332('0x5'));var util=require(_0x4332('0x6'));var path=require(_0x4332('0x7'));var sox=require(_0x4332('0x8'));var csv=require(_0x4332('0x9'));var ejs=require(_0x4332('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4332('0xb'));var squel=require('squel');var crypto=require(_0x4332('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4332('0xd'));var toCsv=require(_0x4332('0x9'));var querystring=require(_0x4332('0xe'));var Papa=require('papaparse');var Redis=require(_0x4332('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4332('0x10'));var as=require(_0x4332('0x11'));var hardwareService=require(_0x4332('0x12'));var logger=require(_0x4332('0x13'))(_0x4332('0x14'));var utils=require('../../config/utils');var config=require(_0x4332('0x15'));var licenseUtil=require(_0x4332('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58d8db,_0x263aef){_0x263aef=_0x263aef||0xcc;return function(_0x2b476c){if(_0x2b476c){return _0x58d8db['sendStatus'](_0x263aef);}return _0x58d8db[_0x4332('0x17')](_0x263aef)[_0x4332('0x18')]();};}function respondWithResult(_0x5add2d,_0x56cf55){_0x56cf55=_0x56cf55||0xc8;return function(_0xd81549){if(_0xd81549){return _0x5add2d[_0x4332('0x17')](_0x56cf55)[_0x4332('0x19')](_0xd81549);}};}function respondWithFilteredResult(_0x2911e9,_0x11fd9c){return function(_0x52784c){if(_0x52784c){var _0x3bb0e8=typeof _0x11fd9c[_0x4332('0x1a')]===_0x4332('0x1b')&&typeof _0x11fd9c[_0x4332('0x1c')]===_0x4332('0x1b');var _0x308317=_0x52784c['count'];var _0x47aed5=_0x3bb0e8?0x0:_0x11fd9c[_0x4332('0x1a')];var _0x290361=_0x3bb0e8?_0x52784c[_0x4332('0x1d')]:_0x11fd9c[_0x4332('0x1a')]+_0x11fd9c[_0x4332('0x1c')];var _0x5dca43;if(_0x290361>=_0x308317){_0x290361=_0x308317;_0x5dca43=0xc8;}else{_0x5dca43=0xce;}_0x2911e9[_0x4332('0x17')](_0x5dca43);return _0x2911e9[_0x4332('0x1e')]('Content-Range',_0x47aed5+'-'+_0x290361+'/'+_0x308317)[_0x4332('0x19')](_0x52784c);}return null;};}function patchUpdates(_0x3d1563){return function(_0x58e3dd){try{jsonpatch[_0x4332('0x1f')](_0x58e3dd,_0x3d1563,!![]);}catch(_0x3886db){return BPromise[_0x4332('0x20')](_0x3886db);}return _0x58e3dd[_0x4332('0x21')]();};}function saveUpdates(_0x172864,_0x52f259){return function(_0x28e37c){if(_0x28e37c){return _0x28e37c[_0x4332('0x22')](_0x172864)[_0x4332('0x23')](function(_0xd01902){return _0xd01902;});}return null;};}function removeEntity(_0x4ad2d7,_0x578b99){return function(_0x1a8841){if(_0x1a8841){return _0x1a8841[_0x4332('0x24')]()[_0x4332('0x23')](function(){_0x4ad2d7[_0x4332('0x17')](0xcc)[_0x4332('0x18')]();});}};}function handleEntityNotFound(_0x529eaa,_0x2569ec){return function(_0x18299e){if(!_0x18299e){_0x529eaa[_0x4332('0x25')](0x194);}return _0x18299e;};}function handleError(_0x48cf7a,_0x27b401){_0x27b401=_0x27b401||0x1f4;return function(_0x540c17){logger['error'](_0x540c17['stack']);if(_0x540c17[_0x4332('0x26')]){delete _0x540c17[_0x4332('0x26')];}_0x48cf7a[_0x4332('0x17')](_0x27b401)[_0x4332('0x27')](_0x540c17);};}exports[_0x4332('0x28')]=function(_0x171132,_0x513652){var _0x1221fc={},_0x5ce804={},_0xa9ad0a={'count':0x0,'rows':[]};var _0x5db779=_[_0x4332('0x29')](db['MailSubstatus'][_0x4332('0x2a')],function(_0x1afeec){return{'name':_0x1afeec[_0x4332('0x2b')],'type':_0x1afeec[_0x4332('0x2c')][_0x4332('0x2d')]};});_0x5ce804[_0x4332('0x2e')]=_[_0x4332('0x29')](_0x5db779,_0x4332('0x26'));_0x5ce804[_0x4332('0x2f')]=_[_0x4332('0x30')](_0x171132[_0x4332('0x2f')]);_0x5ce804[_0x4332('0x31')]=_[_0x4332('0x32')](_0x5ce804[_0x4332('0x2e')],_0x5ce804[_0x4332('0x2f')]);_0x1221fc[_0x4332('0x33')]=_[_0x4332('0x32')](_0x5ce804[_0x4332('0x2e')],qs[_0x4332('0x34')](_0x171132[_0x4332('0x2f')]['fields']));_0x1221fc[_0x4332('0x33')]=_0x1221fc[_0x4332('0x33')][_0x4332('0x35')]?_0x1221fc['attributes']:_0x5ce804['model'];if(!_0x171132[_0x4332('0x2f')]['hasOwnProperty']('nolimit')){_0x1221fc[_0x4332('0x1c')]=qs[_0x4332('0x1c')](_0x171132[_0x4332('0x2f')][_0x4332('0x1c')]);_0x1221fc[_0x4332('0x1a')]=qs[_0x4332('0x1a')](_0x171132['query']['offset']);}_0x1221fc['order']=qs[_0x4332('0x36')](_0x171132[_0x4332('0x2f')][_0x4332('0x36')]);_0x1221fc['where']=qs['filters'](_[_0x4332('0x37')](_0x171132[_0x4332('0x2f')],_0x5ce804[_0x4332('0x31')]),_0x5db779);if(_0x171132[_0x4332('0x2f')]['filter']){_0x1221fc[_0x4332('0x38')]=_[_0x4332('0x39')](_0x1221fc['where'],{'$or':_[_0x4332('0x29')](_0x5db779,function(_0x1ac5fd){if(_0x1ac5fd[_0x4332('0x2c')]!==_0x4332('0x3a')){var _0xd19e70={};_0xd19e70[_0x1ac5fd[_0x4332('0x26')]]={'$like':'%'+_0x171132[_0x4332('0x2f')][_0x4332('0x3b')]+'%'};return _0xd19e70;}})});}_0x1221fc=_['merge']({},_0x1221fc,_0x171132[_0x4332('0x3c')]);var _0x1c6bf0={'where':_0x1221fc[_0x4332('0x38')]};return db[_0x4332('0x3d')]['count'](_0x1c6bf0)[_0x4332('0x23')](function(_0x2601b5){_0xa9ad0a[_0x4332('0x1d')]=_0x2601b5;if(_0x171132['query']['includeAll']){_0x1221fc[_0x4332('0x3e')]=[{'all':!![]}];}return db[_0x4332('0x3d')][_0x4332('0x3f')](_0x1221fc);})[_0x4332('0x23')](function(_0x56bc8c){_0xa9ad0a[_0x4332('0x40')]=_0x56bc8c;return _0xa9ad0a;})['then'](respondWithFilteredResult(_0x513652,_0x1221fc))[_0x4332('0x41')](handleError(_0x513652,null));};exports[_0x4332('0x42')]=function(_0x38fe10,_0x4331f8){var _0x1819dc={'raw':!![],'where':{'id':_0x38fe10[_0x4332('0x43')]['id']}},_0x523d2c={};_0x523d2c[_0x4332('0x2e')]=_[_0x4332('0x30')](db[_0x4332('0x3d')][_0x4332('0x2a')]);_0x523d2c[_0x4332('0x2f')]=_[_0x4332('0x30')](_0x38fe10['query']);_0x523d2c['filters']=_[_0x4332('0x32')](_0x523d2c[_0x4332('0x2e')],_0x523d2c[_0x4332('0x2f')]);_0x1819dc[_0x4332('0x33')]=_[_0x4332('0x32')](_0x523d2c['model'],qs[_0x4332('0x34')](_0x38fe10[_0x4332('0x2f')]['fields']));_0x1819dc[_0x4332('0x33')]=_0x1819dc[_0x4332('0x33')][_0x4332('0x35')]?_0x1819dc[_0x4332('0x33')]:_0x523d2c[_0x4332('0x2e')];if(_0x38fe10[_0x4332('0x2f')][_0x4332('0x44')]){_0x1819dc[_0x4332('0x3e')]=[{'all':!![]}];}_0x1819dc=_['merge']({},_0x1819dc,_0x38fe10[_0x4332('0x3c')]);return db[_0x4332('0x3d')]['find'](_0x1819dc)['then'](handleEntityNotFound(_0x4331f8,null))[_0x4332('0x23')](respondWithResult(_0x4331f8,null))[_0x4332('0x41')](handleError(_0x4331f8,null));};exports['create']=function(_0x5d748a,_0xf2188f){return db['MailSubstatus'][_0x4332('0x45')](_0x5d748a[_0x4332('0x46')],{})[_0x4332('0x23')](respondWithResult(_0xf2188f,0xc9))['catch'](handleError(_0xf2188f,null));};exports['update']=function(_0x594d49,_0x242620){if(_0x594d49[_0x4332('0x46')]['id']){delete _0x594d49['body']['id'];}return db['MailSubstatus'][_0x4332('0x47')]({'where':{'id':_0x594d49[_0x4332('0x43')]['id']}})[_0x4332('0x23')](handleEntityNotFound(_0x242620,null))[_0x4332('0x23')](saveUpdates(_0x594d49[_0x4332('0x46')],null))['then'](respondWithResult(_0x242620,null))[_0x4332('0x41')](handleError(_0x242620,null));};exports['destroy']=function(_0x5bd5ae,_0x4d0120){return db[_0x4332('0x3d')][_0x4332('0x47')]({'where':{'id':_0x5bd5ae[_0x4332('0x43')]['id']}})[_0x4332('0x23')](handleEntityNotFound(_0x4d0120,null))['then'](removeEntity(_0x4d0120,null))[_0x4332('0x41')](handleError(_0x4d0120,null));};exports[_0x4332('0x48')]=function(_0x31e9a9,_0x151bff){return db[_0x4332('0x3d')][_0x4332('0x48')]()['then'](respondWithResult(_0x151bff,null))[_0x4332('0x41')](handleError(_0x151bff,null));}; \ No newline at end of file +var _0x5867=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5867,0x9c));var _0x7586=function(_0x2869fc,_0x219d71){_0x2869fc=_0x2869fc-0x0;var _0x233d89=_0x5867[_0x2869fc];return _0x233d89;};'use strict';var emlformat=require(_0x7586('0x0'));var rimraf=require(_0x7586('0x1'));var zipdir=require(_0x7586('0x2'));var jsonpatch=require(_0x7586('0x3'));var rp=require('request-promise');var moment=require(_0x7586('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7586('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7586('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7586('0x7'));var _=require('lodash');var squel=require(_0x7586('0x8'));var crypto=require(_0x7586('0x9'));var jsforce=require(_0x7586('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7586('0xb'));var Papa=require(_0x7586('0xc'));var Redis=require(_0x7586('0xd'));var authService=require(_0x7586('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7586('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7586('0x10'));var utils=require('../../config/utils');var config=require(_0x7586('0x11'));var licenseUtil=require(_0x7586('0x12'));var db=require(_0x7586('0x13'))['db'];function respondWithStatusCode(_0x160cec,_0x4ff82c){_0x4ff82c=_0x4ff82c||0xcc;return function(_0x33c2e9){if(_0x33c2e9){return _0x160cec[_0x7586('0x14')](_0x4ff82c);}return _0x160cec[_0x7586('0x15')](_0x4ff82c)[_0x7586('0x16')]();};}function respondWithResult(_0x1914b1,_0x65c847){_0x65c847=_0x65c847||0xc8;return function(_0x3d1c80){if(_0x3d1c80){return _0x1914b1[_0x7586('0x15')](_0x65c847)[_0x7586('0x17')](_0x3d1c80);}};}function respondWithFilteredResult(_0x129482,_0x1bc4dd){return function(_0x29c6f){if(_0x29c6f){var _0x263cee=typeof _0x1bc4dd[_0x7586('0x18')]===_0x7586('0x19')&&typeof _0x1bc4dd['limit']===_0x7586('0x19');var _0x5ee909=_0x29c6f[_0x7586('0x1a')];var _0x5f1991=_0x263cee?0x0:_0x1bc4dd['offset'];var _0x3bcd45=_0x263cee?_0x29c6f['count']:_0x1bc4dd[_0x7586('0x18')]+_0x1bc4dd[_0x7586('0x1b')];var _0x485ab3;if(_0x3bcd45>=_0x5ee909){_0x3bcd45=_0x5ee909;_0x485ab3=0xc8;}else{_0x485ab3=0xce;}_0x129482['status'](_0x485ab3);return _0x129482[_0x7586('0x1c')](_0x7586('0x1d'),_0x5f1991+'-'+_0x3bcd45+'/'+_0x5ee909)['json'](_0x29c6f);}return null;};}function patchUpdates(_0x9a5f40){return function(_0x46d0ba){try{jsonpatch[_0x7586('0x1e')](_0x46d0ba,_0x9a5f40,!![]);}catch(_0x220f2a){return BPromise[_0x7586('0x1f')](_0x220f2a);}return _0x46d0ba[_0x7586('0x20')]();};}function saveUpdates(_0x38e07a,_0x3a7047){return function(_0x31c05f){if(_0x31c05f){return _0x31c05f['update'](_0x38e07a)['then'](function(_0x2a86f0){return _0x2a86f0;});}return null;};}function removeEntity(_0x35fc81,_0x1d83d3){return function(_0x3b04cd){if(_0x3b04cd){return _0x3b04cd[_0x7586('0x21')]()[_0x7586('0x22')](function(){_0x35fc81[_0x7586('0x15')](0xcc)[_0x7586('0x16')]();});}};}function handleEntityNotFound(_0x32a2e6,_0x11837d){return function(_0x2568d3){if(!_0x2568d3){_0x32a2e6[_0x7586('0x14')](0x194);}return _0x2568d3;};}function handleError(_0x578116,_0x5bc30d){_0x5bc30d=_0x5bc30d||0x1f4;return function(_0x4b81ce){logger[_0x7586('0x23')](_0x4b81ce[_0x7586('0x24')]);if(_0x4b81ce[_0x7586('0x25')]){delete _0x4b81ce[_0x7586('0x25')];}_0x578116['status'](_0x5bc30d)['send'](_0x4b81ce);};}exports['index']=function(_0x424034,_0x37b6cf){var _0x4ccd9c={},_0x31f65d={},_0x166dfe={'count':0x0,'rows':[]};var _0xb4e84e=_[_0x7586('0x26')](db[_0x7586('0x27')][_0x7586('0x28')],function(_0x55fc9f){return{'name':_0x55fc9f[_0x7586('0x29')],'type':_0x55fc9f[_0x7586('0x2a')][_0x7586('0x2b')]};});_0x31f65d[_0x7586('0x2c')]=_[_0x7586('0x26')](_0xb4e84e,_0x7586('0x25'));_0x31f65d[_0x7586('0x2d')]=_['keys'](_0x424034[_0x7586('0x2d')]);_0x31f65d[_0x7586('0x2e')]=_[_0x7586('0x2f')](_0x31f65d['model'],_0x31f65d['query']);_0x4ccd9c[_0x7586('0x30')]=_['intersection'](_0x31f65d[_0x7586('0x2c')],qs[_0x7586('0x31')](_0x424034[_0x7586('0x2d')][_0x7586('0x31')]));_0x4ccd9c['attributes']=_0x4ccd9c[_0x7586('0x30')]['length']?_0x4ccd9c[_0x7586('0x30')]:_0x31f65d['model'];if(!_0x424034['query'][_0x7586('0x32')](_0x7586('0x33'))){_0x4ccd9c[_0x7586('0x1b')]=qs[_0x7586('0x1b')](_0x424034['query'][_0x7586('0x1b')]);_0x4ccd9c['offset']=qs[_0x7586('0x18')](_0x424034['query']['offset']);}_0x4ccd9c['order']=qs[_0x7586('0x34')](_0x424034[_0x7586('0x2d')]['sort']);_0x4ccd9c[_0x7586('0x35')]=qs['filters'](_['pick'](_0x424034[_0x7586('0x2d')],_0x31f65d[_0x7586('0x2e')]),_0xb4e84e);if(_0x424034['query'][_0x7586('0x36')]){_0x4ccd9c[_0x7586('0x35')]=_[_0x7586('0x37')](_0x4ccd9c[_0x7586('0x35')],{'$or':_[_0x7586('0x26')](_0xb4e84e,function(_0x5d312f){if(_0x5d312f[_0x7586('0x2a')]!==_0x7586('0x38')){var _0xbf5541={};_0xbf5541[_0x5d312f['name']]={'$like':'%'+_0x424034[_0x7586('0x2d')][_0x7586('0x36')]+'%'};return _0xbf5541;}})});}_0x4ccd9c=_['merge']({},_0x4ccd9c,_0x424034[_0x7586('0x39')]);var _0x4cb14f={'where':_0x4ccd9c[_0x7586('0x35')]};return db[_0x7586('0x27')][_0x7586('0x1a')](_0x4cb14f)[_0x7586('0x22')](function(_0x451e95){_0x166dfe['count']=_0x451e95;if(_0x424034[_0x7586('0x2d')][_0x7586('0x3a')]){_0x4ccd9c[_0x7586('0x3b')]=[{'all':!![]}];}return db[_0x7586('0x27')]['findAll'](_0x4ccd9c);})[_0x7586('0x22')](function(_0xde2093){_0x166dfe[_0x7586('0x3c')]=_0xde2093;return _0x166dfe;})[_0x7586('0x22')](respondWithFilteredResult(_0x37b6cf,_0x4ccd9c))[_0x7586('0x3d')](handleError(_0x37b6cf,null));};exports['show']=function(_0x3b2fae,_0xc86729){var _0x3ae7a7={'raw':!![],'where':{'id':_0x3b2fae[_0x7586('0x3e')]['id']}},_0x180457={};_0x180457['model']=_['keys'](db[_0x7586('0x27')][_0x7586('0x28')]);_0x180457[_0x7586('0x2d')]=_[_0x7586('0x3f')](_0x3b2fae['query']);_0x180457['filters']=_[_0x7586('0x2f')](_0x180457[_0x7586('0x2c')],_0x180457[_0x7586('0x2d')]);_0x3ae7a7[_0x7586('0x30')]=_[_0x7586('0x2f')](_0x180457['model'],qs[_0x7586('0x31')](_0x3b2fae[_0x7586('0x2d')][_0x7586('0x31')]));_0x3ae7a7[_0x7586('0x30')]=_0x3ae7a7[_0x7586('0x30')][_0x7586('0x40')]?_0x3ae7a7['attributes']:_0x180457[_0x7586('0x2c')];if(_0x3b2fae['query'][_0x7586('0x3a')]){_0x3ae7a7[_0x7586('0x3b')]=[{'all':!![]}];}_0x3ae7a7=_[_0x7586('0x37')]({},_0x3ae7a7,_0x3b2fae[_0x7586('0x39')]);return db['MailSubstatus'][_0x7586('0x41')](_0x3ae7a7)[_0x7586('0x22')](handleEntityNotFound(_0xc86729,null))['then'](respondWithResult(_0xc86729,null))['catch'](handleError(_0xc86729,null));};exports[_0x7586('0x42')]=function(_0x24fcce,_0x28e49f){return db[_0x7586('0x27')]['create'](_0x24fcce[_0x7586('0x43')],{})[_0x7586('0x22')](respondWithResult(_0x28e49f,0xc9))[_0x7586('0x3d')](handleError(_0x28e49f,null));};exports[_0x7586('0x44')]=function(_0x554bef,_0x3c117d){if(_0x554bef[_0x7586('0x43')]['id']){delete _0x554bef[_0x7586('0x43')]['id'];}return db[_0x7586('0x27')]['find']({'where':{'id':_0x554bef[_0x7586('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c117d,null))[_0x7586('0x22')](saveUpdates(_0x554bef[_0x7586('0x43')],null))[_0x7586('0x22')](respondWithResult(_0x3c117d,null))[_0x7586('0x3d')](handleError(_0x3c117d,null));};exports[_0x7586('0x21')]=function(_0x34d04d,_0x56a425){return db[_0x7586('0x27')][_0x7586('0x41')]({'where':{'id':_0x34d04d[_0x7586('0x3e')]['id']}})['then'](handleEntityNotFound(_0x56a425,null))[_0x7586('0x22')](removeEntity(_0x56a425,null))[_0x7586('0x3d')](handleError(_0x56a425,null));};exports[_0x7586('0x45')]=function(_0x24494,_0x320921){return db[_0x7586('0x27')][_0x7586('0x45')]()['then'](respondWithResult(_0x320921,null))['catch'](handleError(_0x320921,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 54d1dd7..c56bdf1 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x491a=['events','../../mysqldb','MailSubstatus','update','emit','exports'];(function(_0x3d03e4,_0x2b855c){var _0x227fea=function(_0x36e419){while(--_0x36e419){_0x3d03e4['push'](_0x3d03e4['shift']());}};_0x227fea(++_0x2b855c);}(_0x491a,0x1c2));var _0xa491=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0x491a[_0x1fd4d7];return _0x7efe8a;};'use strict';var EventEmitter=require(_0xa491('0x0'));var MailSubstatus=require(_0xa491('0x1'))['db'][_0xa491('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xa491('0x3')};function emitEvent(_0x1c2ff5){return function(_0x89e2da,_0x59837c,_0x2aa3f8){MailSubstatusEvents[_0xa491('0x4')](_0x1c2ff5+':'+_0x89e2da['id'],_0x89e2da);MailSubstatusEvents[_0xa491('0x4')](_0x1c2ff5,_0x89e2da);_0x2aa3f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xa491('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x7bad=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7bad,0x159));var _0xd7ba=function(_0x500861,_0x488886){_0x500861=_0x500861-0x0;var _0x3919fd=_0x7bad[_0x500861];return _0x3919fd;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xd7ba('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd7ba('0x1')](0x0);var events={'afterUpdate':_0xd7ba('0x2')};function emitEvent(_0x380ff5){return function(_0x4dd47b,_0x498afc,_0x28caf2){MailSubstatusEvents['emit'](_0x380ff5+':'+_0x4dd47b['id'],_0x4dd47b);MailSubstatusEvents['emit'](_0x380ff5,_0x4dd47b);_0x28caf2(null);};}for(var e in events){if(events[_0xd7ba('0x3')](e)){var event=events[e];MailSubstatus[_0xd7ba('0x4')](e,emitEvent(event));}}module[_0xd7ba('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2155d97..8d37bc2 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 _0x7816=['update','name','mailSubstatus','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x7816,0x13f));var _0x6781=function(_0x5e82ae,_0x1bf62f){_0x5e82ae=_0x5e82ae-0x0;var _0x2e3d18=_0x7816[_0x5e82ae];return _0x2e3d18;};'use strict';var attributes=require(_0x6781('0x0'));module[_0x6781('0x1')]=function(_0x358ae1){var _0x4750a8=_0x358ae1[_0x6781('0x2')];return _0x358ae1[_0x6781('0x3')]('MailSubstatus',attributes,{'tableName':_0x6781('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xbced80,_0x894852,_0x35785d){return _0x4750a8['Condition'][_0x6781('0x5')]({'value':_0xbced80[_0x6781('0x6')]},{'where':{'field':_0x6781('0x7'),'value':_0xbced80['_previousDataValues'][_0x6781('0x6')]}})['then'](function(){_0x35785d();})[_0x6781('0x8')](function(_0x1a6570){_0x35785d(_0x1a6570);});}}});}; \ No newline at end of file +var _0x04c6=['_previousDataValues','then','catch','exports','models','define','Condition','update','name','mailSubstatus'];(function(_0x194fc0,_0x492fdb){var _0x52476b=function(_0xfd1713){while(--_0xfd1713){_0x194fc0['push'](_0x194fc0['shift']());}};_0x52476b(++_0x492fdb);}(_0x04c6,0xc1));var _0x604c=function(_0x44414a,_0x16fdca){_0x44414a=_0x44414a-0x0;var _0x32ac6e=_0x04c6[_0x44414a];return _0x32ac6e;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x604c('0x0')]=function(_0x194201){var _0x2dd879=_0x194201[_0x604c('0x1')];return _0x194201[_0x604c('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x27ab5c,_0x5a48fe,_0x1b0da3){return _0x2dd879[_0x604c('0x3')][_0x604c('0x4')]({'value':_0x27ab5c[_0x604c('0x5')]},{'where':{'field':_0x604c('0x6'),'value':_0x27ab5c[_0x604c('0x7')][_0x604c('0x5')]}})[_0x604c('0x8')](function(){_0x1b0da3();})[_0x604c('0x9')](function(_0x506992){_0x1b0da3(_0x506992);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 50253d5..8499b12 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 _0x8b9e=['../../config/utils','rpc','client','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b9e,0x19e));var _0xe8b9=function(_0x1d2c76,_0x4fd0e5){_0x1d2c76=_0x1d2c76-0x0;var _0x4cf6fc=_0x8b9e[_0x1d2c76];return _0x4cf6fc;};'use strict';var _=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var moment=require(_0xe8b9('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8b9('0x3'));var fs=require('fs');var Redis=require(_0xe8b9('0x4'));var db=require(_0xe8b9('0x5'))['db'];var utils=require(_0xe8b9('0x6'));var logger=require('../../config/logger')(_0xe8b9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe8b9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13ec84,_0x731c80,_0x1ce327){return new BPromise(function(_0x2374e9,_0x1039dd){return client[_0xe8b9('0x9')](_0x13ec84,_0x1ce327)['then'](function(_0x151d1c){logger[_0xe8b9('0xa')](_0xe8b9('0xb'),_0x731c80,_0xe8b9('0xc'));logger[_0xe8b9('0xd')](_0xe8b9('0xe'),_0x731c80,'request\x20sent',JSON['stringify'](_0x151d1c));if(_0x151d1c[_0xe8b9('0xf')]){if(_0x151d1c[_0xe8b9('0xf')][_0xe8b9('0x10')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x731c80,_0x151d1c['error'][_0xe8b9('0x11')]);return _0x1039dd(_0x151d1c[_0xe8b9('0xf')][_0xe8b9('0x11')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x731c80,_0x151d1c[_0xe8b9('0xf')][_0xe8b9('0x11')]);return _0x2374e9(_0x151d1c[_0xe8b9('0xf')][_0xe8b9('0x11')]);}else{logger[_0xe8b9('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x731c80,_0xe8b9('0xc'));_0x2374e9(_0x151d1c[_0xe8b9('0x12')][_0xe8b9('0x11')]);}})[_0xe8b9('0x13')](function(_0x46ed49){logger[_0xe8b9('0xf')](_0xe8b9('0xb'),_0x731c80,_0x46ed49);_0x1039dd(_0x46ed49);});});} \ No newline at end of file +var _0x7d31=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x7d31,0x165));var _0x17d3=function(_0x5dd778,_0x5045e8){_0x5dd778=_0x5dd778-0x0;var _0x359c75=_0x7d31[_0x5dd778];return _0x359c75;};'use strict';var _=require(_0x17d3('0x0'));var util=require('util');var moment=require(_0x17d3('0x1'));var BPromise=require(_0x17d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17d3('0x3'));var db=require(_0x17d3('0x4'))['db'];var utils=require(_0x17d3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x17d3('0x6'));var jayson=require(_0x17d3('0x7'));var client=jayson[_0x17d3('0x8')][_0x17d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59037e,_0x59fd09,_0x2a92fd){return new BPromise(function(_0x326597,_0x3b2097){return client['request'](_0x59037e,_0x2a92fd)[_0x17d3('0xa')](function(_0x127759){logger[_0x17d3('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x17d3('0xc'));logger[_0x17d3('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x59fd09,'request\x20sent',JSON[_0x17d3('0xe')](_0x127759));if(_0x127759[_0x17d3('0xf')]){if(_0x127759[_0x17d3('0xf')][_0x17d3('0x10')]===0x1f4){logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);return _0x3b2097(_0x127759['error'][_0x17d3('0x11')]);}logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);return _0x326597(_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);}else{logger[_0x17d3('0xb')](_0x17d3('0x12'),_0x59fd09,_0x17d3('0xc'));_0x326597(_0x127759[_0x17d3('0x13')][_0x17d3('0x11')]);}})[_0x17d3('0x14')](function(_0x46db29){logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x46db29);_0x3b2097(_0x46db29);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 79edc05..d4b3213 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 _0x03be=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','index','describe'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0x03be,0x143));var _0xe03b=function(_0x2e0d63,_0x2fe00f){_0x2e0d63=_0x2e0d63-0x0;var _0xf4943d=_0x03be[_0x2e0d63];return _0xf4943d;};'use strict';var multer=require(_0xe03b('0x0'));var util=require(_0xe03b('0x1'));var path=require(_0xe03b('0x2'));var timeout=require(_0xe03b('0x3'));var express=require(_0xe03b('0x4'));var router=express[_0xe03b('0x5')]();var fs_extra=require(_0xe03b('0x6'));var auth=require(_0xe03b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe03b('0x8'));router[_0xe03b('0x9')]('/',auth[_0xe03b('0xa')](),controller[_0xe03b('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe03b('0xc')]);router[_0xe03b('0x9')](_0xe03b('0xd'),auth[_0xe03b('0xa')](),controller[_0xe03b('0xe')]);router[_0xe03b('0xf')]('/',auth['isAuthenticated'](),controller[_0xe03b('0x10')]);router[_0xe03b('0x11')](_0xe03b('0xd'),auth[_0xe03b('0xa')](),controller[_0xe03b('0x12')]);router[_0xe03b('0x13')](_0xe03b('0xd'),auth[_0xe03b('0xa')](),controller[_0xe03b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8788=['get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','./mailTransferReport.controller'];(function(_0x2a3ffc,_0x3c2b77){var _0x22a20d=function(_0x52e470){while(--_0x52e470){_0x2a3ffc['push'](_0x2a3ffc['shift']());}};_0x22a20d(++_0x3c2b77);}(_0x8788,0xf6));var _0x8878=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x8788[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x8878('0x0'));var util=require('util');var path=require(_0x8878('0x1'));var timeout=require('connect-timeout');var express=require(_0x8878('0x2'));var router=express['Router']();var fs_extra=require(_0x8878('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8878('0x4'));var config=require('../../config/environment');var controller=require(_0x8878('0x5'));router[_0x8878('0x6')]('/',auth[_0x8878('0x7')](),controller['index']);router['get'](_0x8878('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x8878('0x6')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0xa')]);router[_0x8878('0xb')]('/',auth[_0x8878('0x7')](),controller[_0x8878('0xc')]);router[_0x8878('0xd')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0xe')]);router[_0x8878('0xf')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0x10')]);module[_0x8878('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 44d0b88..fe6a3a1 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x777641,_0x19607d){var _0x54a378=function(_0x501b92){while(--_0x501b92){_0x777641['push'](_0x777641['shift']());}};_0x54a378(++_0x19607d);}(_0x34e8,0x12c));var _0x834e=function(_0x3de875,_0x3b5a25){_0x3de875=_0x3de875-0x0;var _0x467e9d=_0x34e8[_0x3de875];return _0x467e9d;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x20c4de,_0x569bc0){var _0x4b0281=function(_0x83d393){while(--_0x83d393){_0x20c4de['push'](_0x20c4de['shift']());}};_0x4b0281(++_0x569bc0);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ab23a,_0x12d3f9){_0x4ab23a=_0x4ab23a-0x0;var _0x11cd33=_0xedd9[_0x4ab23a];return _0x11cd33;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index d1f7e59..d08d830 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 _0x16ad=['status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x16ad,0xc2));var _0xd16a=function(_0x3cf9ea,_0x3db697){_0x3cf9ea=_0x3cf9ea-0x0;var _0x3c2def=_0x16ad[_0x3cf9ea];return _0x3c2def;};'use strict';var emlformat=require(_0xd16a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd16a('0x1'));var rp=require(_0xd16a('0x2'));var moment=require(_0xd16a('0x3'));var BPromise=require(_0xd16a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd16a('0x5'));var sox=require('sox');var csv=require(_0xd16a('0x6'));var ejs=require(_0xd16a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd16a('0x8'));var squel=require(_0xd16a('0x9'));var crypto=require(_0xd16a('0xa'));var jsforce=require(_0xd16a('0xb'));var deskjs=require(_0xd16a('0xc'));var toCsv=require(_0xd16a('0x6'));var querystring=require('querystring');var Papa=require(_0xd16a('0xd'));var Redis=require(_0xd16a('0xe'));var authService=require(_0xd16a('0xf'));var qs=require(_0xd16a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd16a('0x11'));var logger=require(_0xd16a('0x12'))(_0xd16a('0x13'));var utils=require(_0xd16a('0x14'));var config=require(_0xd16a('0x15'));var licenseUtil=require(_0xd16a('0x16'));var db=require(_0xd16a('0x17'))['db'];function respondWithStatusCode(_0x36cbbd,_0x3f1237){_0x3f1237=_0x3f1237||0xcc;return function(_0x1f670e){if(_0x1f670e){return _0x36cbbd[_0xd16a('0x18')](_0x3f1237);}return _0x36cbbd[_0xd16a('0x19')](_0x3f1237)['end']();};}function respondWithResult(_0x67ac09,_0xf782b7){_0xf782b7=_0xf782b7||0xc8;return function(_0x2df0f6){if(_0x2df0f6){return _0x67ac09[_0xd16a('0x19')](_0xf782b7)[_0xd16a('0x1a')](_0x2df0f6);}};}function respondWithFilteredResult(_0x581276,_0x23c788){return function(_0x5a5f19){if(_0x5a5f19){var _0x26c1cb=typeof _0x23c788['offset']===_0xd16a('0x1b')&&typeof _0x23c788['limit']===_0xd16a('0x1b');var _0x381fa4=_0x5a5f19[_0xd16a('0x1c')];var _0x5c9351=_0x26c1cb?0x0:_0x23c788[_0xd16a('0x1d')];var _0x313e9e=_0x26c1cb?_0x5a5f19['count']:_0x23c788[_0xd16a('0x1d')]+_0x23c788['limit'];var _0x2004d8;if(_0x313e9e>=_0x381fa4){_0x313e9e=_0x381fa4;_0x2004d8=0xc8;}else{_0x2004d8=0xce;}_0x581276[_0xd16a('0x19')](_0x2004d8);return _0x581276[_0xd16a('0x1e')](_0xd16a('0x1f'),_0x5c9351+'-'+_0x313e9e+'/'+_0x381fa4)['json'](_0x5a5f19);}return null;};}function patchUpdates(_0x2b2021){return function(_0x11f49f){try{jsonpatch[_0xd16a('0x20')](_0x11f49f,_0x2b2021,!![]);}catch(_0xbd2890){return BPromise[_0xd16a('0x21')](_0xbd2890);}return _0x11f49f['save']();};}function saveUpdates(_0x2c1330,_0x3f9719){return function(_0x3cb087){if(_0x3cb087){return _0x3cb087[_0xd16a('0x22')](_0x2c1330)[_0xd16a('0x23')](function(_0x51e6de){return _0x51e6de;});}return null;};}function removeEntity(_0x2663e6,_0x15956d){return function(_0x2a32f9){if(_0x2a32f9){return _0x2a32f9['destroy']()[_0xd16a('0x23')](function(){_0x2663e6[_0xd16a('0x19')](0xcc)[_0xd16a('0x24')]();});}};}function handleEntityNotFound(_0x226a62,_0x111bad){return function(_0x12b9b8){if(!_0x12b9b8){_0x226a62[_0xd16a('0x18')](0x194);}return _0x12b9b8;};}function handleError(_0x2c53a3,_0x2eaad6){_0x2eaad6=_0x2eaad6||0x1f4;return function(_0x49ace3){logger['error'](_0x49ace3['stack']);if(_0x49ace3[_0xd16a('0x25')]){delete _0x49ace3['name'];}_0x2c53a3[_0xd16a('0x19')](_0x2eaad6)['send'](_0x49ace3);};}exports[_0xd16a('0x26')]=function(_0xe8cdd3,_0x2cb085){var _0x34bfb9={},_0x41bff2={},_0x4ab4e0={'count':0x0,'rows':[]};var _0xe3a399=_[_0xd16a('0x27')](db[_0xd16a('0x28')][_0xd16a('0x29')],function(_0x2be0cd){return{'name':_0x2be0cd[_0xd16a('0x2a')],'type':_0x2be0cd[_0xd16a('0x2b')][_0xd16a('0x2c')]};});_0x41bff2[_0xd16a('0x2d')]=_[_0xd16a('0x27')](_0xe3a399,_0xd16a('0x25'));_0x41bff2[_0xd16a('0x2e')]=_[_0xd16a('0x2f')](_0xe8cdd3[_0xd16a('0x2e')]);_0x41bff2[_0xd16a('0x30')]=_[_0xd16a('0x31')](_0x41bff2[_0xd16a('0x2d')],_0x41bff2['query']);_0x34bfb9[_0xd16a('0x32')]=_[_0xd16a('0x31')](_0x41bff2[_0xd16a('0x2d')],qs[_0xd16a('0x33')](_0xe8cdd3['query'][_0xd16a('0x33')]));_0x34bfb9['attributes']=_0x34bfb9[_0xd16a('0x32')][_0xd16a('0x34')]?_0x34bfb9[_0xd16a('0x32')]:_0x41bff2['model'];if(!_0xe8cdd3[_0xd16a('0x2e')]['hasOwnProperty'](_0xd16a('0x35'))){_0x34bfb9[_0xd16a('0x36')]=qs[_0xd16a('0x36')](_0xe8cdd3[_0xd16a('0x2e')]['limit']);_0x34bfb9[_0xd16a('0x1d')]=qs['offset'](_0xe8cdd3[_0xd16a('0x2e')][_0xd16a('0x1d')]);}_0x34bfb9[_0xd16a('0x37')]=qs[_0xd16a('0x38')](_0xe8cdd3[_0xd16a('0x2e')][_0xd16a('0x38')]);_0x34bfb9['where']=qs[_0xd16a('0x30')](_[_0xd16a('0x39')](_0xe8cdd3['query'],_0x41bff2['filters']),_0xe3a399);if(_0xe8cdd3[_0xd16a('0x2e')][_0xd16a('0x3a')]){_0x34bfb9['where']=_[_0xd16a('0x3b')](_0x34bfb9['where'],{'$or':_[_0xd16a('0x27')](_0xe3a399,function(_0x1474c5){if(_0x1474c5['type']!=='VIRTUAL'){var _0x9971f={};_0x9971f[_0x1474c5[_0xd16a('0x25')]]={'$like':'%'+_0xe8cdd3[_0xd16a('0x2e')][_0xd16a('0x3a')]+'%'};return _0x9971f;}})});}_0x34bfb9=_[_0xd16a('0x3b')]({},_0x34bfb9,_0xe8cdd3[_0xd16a('0x3c')]);var _0x2cf1aa={'where':_0x34bfb9[_0xd16a('0x3d')]};return db[_0xd16a('0x28')][_0xd16a('0x1c')](_0x2cf1aa)['then'](function(_0x51f51e){_0x4ab4e0['count']=_0x51f51e;if(_0xe8cdd3[_0xd16a('0x2e')][_0xd16a('0x3e')]){_0x34bfb9[_0xd16a('0x3f')]=[{'all':!![]}];}return db[_0xd16a('0x28')][_0xd16a('0x40')](_0x34bfb9);})['then'](function(_0x1c43ad){_0x4ab4e0[_0xd16a('0x41')]=_0x1c43ad;return _0x4ab4e0;})['then'](respondWithFilteredResult(_0x2cb085,_0x34bfb9))[_0xd16a('0x42')](handleError(_0x2cb085,null));};exports[_0xd16a('0x43')]=function(_0xdb052a,_0x1624ab){var _0x171a15={'raw':!![],'where':{'id':_0xdb052a[_0xd16a('0x44')]['id']}},_0x3ee2d4={};_0x3ee2d4[_0xd16a('0x2d')]=_[_0xd16a('0x2f')](db[_0xd16a('0x28')][_0xd16a('0x29')]);_0x3ee2d4[_0xd16a('0x2e')]=_[_0xd16a('0x2f')](_0xdb052a[_0xd16a('0x2e')]);_0x3ee2d4[_0xd16a('0x30')]=_[_0xd16a('0x31')](_0x3ee2d4[_0xd16a('0x2d')],_0x3ee2d4[_0xd16a('0x2e')]);_0x171a15[_0xd16a('0x32')]=_['intersection'](_0x3ee2d4[_0xd16a('0x2d')],qs[_0xd16a('0x33')](_0xdb052a['query'][_0xd16a('0x33')]));_0x171a15[_0xd16a('0x32')]=_0x171a15[_0xd16a('0x32')][_0xd16a('0x34')]?_0x171a15[_0xd16a('0x32')]:_0x3ee2d4['model'];if(_0xdb052a[_0xd16a('0x2e')][_0xd16a('0x3e')]){_0x171a15[_0xd16a('0x3f')]=[{'all':!![]}];}_0x171a15=_[_0xd16a('0x3b')]({},_0x171a15,_0xdb052a[_0xd16a('0x3c')]);return db[_0xd16a('0x28')]['find'](_0x171a15)[_0xd16a('0x23')](handleEntityNotFound(_0x1624ab,null))[_0xd16a('0x23')](respondWithResult(_0x1624ab,null))[_0xd16a('0x42')](handleError(_0x1624ab,null));};exports['create']=function(_0x3bc030,_0x130906){return db[_0xd16a('0x28')][_0xd16a('0x45')](_0x3bc030['body'],{})[_0xd16a('0x23')](respondWithResult(_0x130906,0xc9))[_0xd16a('0x42')](handleError(_0x130906,null));};exports[_0xd16a('0x22')]=function(_0x48405f,_0x4a7bd1){if(_0x48405f[_0xd16a('0x46')]['id']){delete _0x48405f[_0xd16a('0x46')]['id'];}return db[_0xd16a('0x28')][_0xd16a('0x47')]({'where':{'id':_0x48405f[_0xd16a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a7bd1,null))[_0xd16a('0x23')](saveUpdates(_0x48405f[_0xd16a('0x46')],null))['then'](respondWithResult(_0x4a7bd1,null))[_0xd16a('0x42')](handleError(_0x4a7bd1,null));};exports['destroy']=function(_0x106184,_0x410836){return db[_0xd16a('0x28')][_0xd16a('0x47')]({'where':{'id':_0x106184[_0xd16a('0x44')]['id']}})[_0xd16a('0x23')](handleEntityNotFound(_0x410836,null))[_0xd16a('0x23')](removeEntity(_0x410836,null))['catch'](handleError(_0x410836,null));};exports[_0xd16a('0x48')]=function(_0x5909f4,_0x170f2e){return db[_0xd16a('0x28')][_0xd16a('0x48')]()[_0xd16a('0x23')](respondWithResult(_0x170f2e,null))[_0xd16a('0x42')](handleError(_0x170f2e,null));}; \ No newline at end of file +var _0xa02b=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','MailTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','attributes','options','find','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4e1269,_0x197395){var _0x293b6a=function(_0x5ac937){while(--_0x5ac937){_0x4e1269['push'](_0x4e1269['shift']());}};_0x293b6a(++_0x197395);}(_0xa02b,0x1ba));var _0xba02=function(_0x3ba671,_0x40d517){_0x3ba671=_0x3ba671-0x0;var _0x1a610d=_0xa02b[_0x3ba671];return _0x1a610d;};'use strict';var emlformat=require(_0xba02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba02('0x2'));var moment=require(_0xba02('0x3'));var BPromise=require(_0xba02('0x4'));var Mustache=require('mustache');var util=require(_0xba02('0x5'));var path=require(_0xba02('0x6'));var sox=require(_0xba02('0x7'));var csv=require(_0xba02('0x8'));var ejs=require(_0xba02('0x9'));var fs=require('fs');var fs_extra=require(_0xba02('0xa'));var _=require(_0xba02('0xb'));var squel=require(_0xba02('0xc'));var crypto=require(_0xba02('0xd'));var jsforce=require(_0xba02('0xe'));var deskjs=require(_0xba02('0xf'));var toCsv=require(_0xba02('0x8'));var querystring=require(_0xba02('0x10'));var Papa=require(_0xba02('0x11'));var Redis=require(_0xba02('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba02('0x13'));var as=require(_0xba02('0x14'));var hardwareService=require(_0xba02('0x15'));var logger=require(_0xba02('0x16'))(_0xba02('0x17'));var utils=require('../../config/utils');var config=require(_0xba02('0x18'));var licenseUtil=require(_0xba02('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a551a,_0x3244e9){_0x3244e9=_0x3244e9||0xcc;return function(_0x4d1ade){if(_0x4d1ade){return _0x1a551a['sendStatus'](_0x3244e9);}return _0x1a551a[_0xba02('0x1a')](_0x3244e9)['end']();};}function respondWithResult(_0x5564de,_0x48cb04){_0x48cb04=_0x48cb04||0xc8;return function(_0x3a99d7){if(_0x3a99d7){return _0x5564de[_0xba02('0x1a')](_0x48cb04)[_0xba02('0x1b')](_0x3a99d7);}};}function respondWithFilteredResult(_0x37b945,_0x247af0){return function(_0x5480bf){if(_0x5480bf){var _0x5dced7=typeof _0x247af0['offset']===_0xba02('0x1c')&&typeof _0x247af0[_0xba02('0x1d')]===_0xba02('0x1c');var _0x1ed230=_0x5480bf[_0xba02('0x1e')];var _0x3eb3c0=_0x5dced7?0x0:_0x247af0['offset'];var _0x23a639=_0x5dced7?_0x5480bf[_0xba02('0x1e')]:_0x247af0[_0xba02('0x1f')]+_0x247af0['limit'];var _0x5483aa;if(_0x23a639>=_0x1ed230){_0x23a639=_0x1ed230;_0x5483aa=0xc8;}else{_0x5483aa=0xce;}_0x37b945[_0xba02('0x1a')](_0x5483aa);return _0x37b945['set'](_0xba02('0x20'),_0x3eb3c0+'-'+_0x23a639+'/'+_0x1ed230)[_0xba02('0x1b')](_0x5480bf);}return null;};}function patchUpdates(_0x55fa4b){return function(_0x444f16){try{jsonpatch['apply'](_0x444f16,_0x55fa4b,!![]);}catch(_0x1af46f){return BPromise[_0xba02('0x21')](_0x1af46f);}return _0x444f16[_0xba02('0x22')]();};}function saveUpdates(_0x5b25f6,_0x3a9978){return function(_0x6491f8){if(_0x6491f8){return _0x6491f8[_0xba02('0x23')](_0x5b25f6)[_0xba02('0x24')](function(_0x51dfa8){return _0x51dfa8;});}return null;};}function removeEntity(_0x7826f5,_0x30ef02){return function(_0x1700fb){if(_0x1700fb){return _0x1700fb[_0xba02('0x25')]()['then'](function(){_0x7826f5[_0xba02('0x1a')](0xcc)[_0xba02('0x26')]();});}};}function handleEntityNotFound(_0x421e4f,_0x13d20e){return function(_0x1a83e6){if(!_0x1a83e6){_0x421e4f[_0xba02('0x27')](0x194);}return _0x1a83e6;};}function handleError(_0x3b7fe3,_0xd5c667){_0xd5c667=_0xd5c667||0x1f4;return function(_0x5e0a29){logger[_0xba02('0x28')](_0x5e0a29[_0xba02('0x29')]);if(_0x5e0a29[_0xba02('0x2a')]){delete _0x5e0a29[_0xba02('0x2a')];}_0x3b7fe3[_0xba02('0x1a')](_0xd5c667)['send'](_0x5e0a29);};}exports[_0xba02('0x2b')]=function(_0x2e2fb4,_0x3dfbfb){var _0x52e673={},_0x485694={},_0x443fde={'count':0x0,'rows':[]};var _0x7580b5=_['map'](db[_0xba02('0x2c')][_0xba02('0x2d')],function(_0x5a227b){return{'name':_0x5a227b[_0xba02('0x2e')],'type':_0x5a227b['type'][_0xba02('0x2f')]};});_0x485694[_0xba02('0x30')]=_[_0xba02('0x31')](_0x7580b5,_0xba02('0x2a'));_0x485694[_0xba02('0x32')]=_[_0xba02('0x33')](_0x2e2fb4[_0xba02('0x32')]);_0x485694[_0xba02('0x34')]=_['intersection'](_0x485694['model'],_0x485694[_0xba02('0x32')]);_0x52e673['attributes']=_[_0xba02('0x35')](_0x485694[_0xba02('0x30')],qs[_0xba02('0x36')](_0x2e2fb4[_0xba02('0x32')][_0xba02('0x36')]));_0x52e673['attributes']=_0x52e673['attributes'][_0xba02('0x37')]?_0x52e673['attributes']:_0x485694[_0xba02('0x30')];if(!_0x2e2fb4[_0xba02('0x32')][_0xba02('0x38')](_0xba02('0x39'))){_0x52e673[_0xba02('0x1d')]=qs[_0xba02('0x1d')](_0x2e2fb4['query']['limit']);_0x52e673[_0xba02('0x1f')]=qs[_0xba02('0x1f')](_0x2e2fb4['query'][_0xba02('0x1f')]);}_0x52e673[_0xba02('0x3a')]=qs[_0xba02('0x3b')](_0x2e2fb4[_0xba02('0x32')][_0xba02('0x3b')]);_0x52e673[_0xba02('0x3c')]=qs[_0xba02('0x34')](_['pick'](_0x2e2fb4[_0xba02('0x32')],_0x485694[_0xba02('0x34')]),_0x7580b5);if(_0x2e2fb4['query'][_0xba02('0x3d')]){_0x52e673['where']=_[_0xba02('0x3e')](_0x52e673['where'],{'$or':_[_0xba02('0x31')](_0x7580b5,function(_0x461561){if(_0x461561[_0xba02('0x3f')]!==_0xba02('0x40')){var _0x341918={};_0x341918[_0x461561[_0xba02('0x2a')]]={'$like':'%'+_0x2e2fb4[_0xba02('0x32')][_0xba02('0x3d')]+'%'};return _0x341918;}})});}_0x52e673=_[_0xba02('0x3e')]({},_0x52e673,_0x2e2fb4['options']);var _0x1c9c86={'where':_0x52e673[_0xba02('0x3c')]};return db[_0xba02('0x2c')][_0xba02('0x1e')](_0x1c9c86)['then'](function(_0x91cfd3){_0x443fde[_0xba02('0x1e')]=_0x91cfd3;if(_0x2e2fb4['query'][_0xba02('0x41')]){_0x52e673['include']=[{'all':!![]}];}return db[_0xba02('0x2c')][_0xba02('0x42')](_0x52e673);})[_0xba02('0x24')](function(_0x4d7a79){_0x443fde[_0xba02('0x43')]=_0x4d7a79;return _0x443fde;})[_0xba02('0x24')](respondWithFilteredResult(_0x3dfbfb,_0x52e673))[_0xba02('0x44')](handleError(_0x3dfbfb,null));};exports[_0xba02('0x45')]=function(_0x3dc6d0,_0x21dabe){var _0x55e233={'raw':!![],'where':{'id':_0x3dc6d0[_0xba02('0x46')]['id']}},_0x322ea6={};_0x322ea6[_0xba02('0x30')]=_[_0xba02('0x33')](db[_0xba02('0x2c')]['rawAttributes']);_0x322ea6[_0xba02('0x32')]=_['keys'](_0x3dc6d0[_0xba02('0x32')]);_0x322ea6['filters']=_[_0xba02('0x35')](_0x322ea6[_0xba02('0x30')],_0x322ea6['query']);_0x55e233[_0xba02('0x47')]=_['intersection'](_0x322ea6[_0xba02('0x30')],qs[_0xba02('0x36')](_0x3dc6d0[_0xba02('0x32')][_0xba02('0x36')]));_0x55e233['attributes']=_0x55e233[_0xba02('0x47')][_0xba02('0x37')]?_0x55e233['attributes']:_0x322ea6[_0xba02('0x30')];if(_0x3dc6d0[_0xba02('0x32')][_0xba02('0x41')]){_0x55e233['include']=[{'all':!![]}];}_0x55e233=_[_0xba02('0x3e')]({},_0x55e233,_0x3dc6d0[_0xba02('0x48')]);return db[_0xba02('0x2c')][_0xba02('0x49')](_0x55e233)[_0xba02('0x24')](handleEntityNotFound(_0x21dabe,null))[_0xba02('0x24')](respondWithResult(_0x21dabe,null))[_0xba02('0x44')](handleError(_0x21dabe,null));};exports['create']=function(_0x2a7592,_0x1efb1b){return db[_0xba02('0x2c')]['create'](_0x2a7592[_0xba02('0x4a')],{})[_0xba02('0x24')](respondWithResult(_0x1efb1b,0xc9))['catch'](handleError(_0x1efb1b,null));};exports[_0xba02('0x23')]=function(_0x2209e6,_0x1a28a2){if(_0x2209e6[_0xba02('0x4a')]['id']){delete _0x2209e6[_0xba02('0x4a')]['id'];}return db[_0xba02('0x2c')]['find']({'where':{'id':_0x2209e6[_0xba02('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a28a2,null))[_0xba02('0x24')](saveUpdates(_0x2209e6[_0xba02('0x4a')],null))[_0xba02('0x24')](respondWithResult(_0x1a28a2,null))[_0xba02('0x44')](handleError(_0x1a28a2,null));};exports['destroy']=function(_0xfbeafa,_0x2c6b61){return db[_0xba02('0x2c')][_0xba02('0x49')]({'where':{'id':_0xfbeafa[_0xba02('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6b61,null))['then'](removeEntity(_0x2c6b61,null))[_0xba02('0x44')](handleError(_0x2c6b61,null));};exports['describe']=function(_0x3b9b8f,_0x1c319f){return db[_0xba02('0x2c')][_0xba02('0x4b')]()[_0xba02('0x24')](respondWithResult(_0x1c319f,null))[_0xba02('0x44')](handleError(_0x1c319f,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1c61690..6339ffc 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 _0xb3c2=['report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3c2,0x152));var _0x2b3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3c2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2b3c('0x0'));var util=require(_0x2b3c('0x1'));var logger=require('../../config/logger')(_0x2b3c('0x2'));var moment=require(_0x2b3c('0x3'));var BPromise=require(_0x2b3c('0x4'));var rp=require(_0x2b3c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b3c('0x6'));var config=require(_0x2b3c('0x7'));var attributes=require(_0x2b3c('0x8'));module[_0x2b3c('0x9')]=function(_0x45937a,_0x4c8010){return _0x45937a[_0x2b3c('0xa')](_0x2b3c('0xb'),attributes,{'tableName':_0x2b3c('0xc'),'paranoid':![],'indexes':[{'name':_0x2b3c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x684d=['api','bluebird','path','rimraf','../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x684d,0x174));var _0xd684=function(_0x7397ae,_0x47a49d){_0x7397ae=_0x7397ae-0x0;var _0x5c8635=_0x684d[_0x7397ae];return _0x5c8635;};'use strict';var _=require('lodash');var util=require(_0xd684('0x0'));var logger=require(_0xd684('0x1'))(_0xd684('0x2'));var moment=require('moment');var BPromise=require(_0xd684('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd684('0x4'));var rimraf=require(_0xd684('0x5'));var config=require(_0xd684('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0xd684('0x7')]=function(_0x5f50ac,_0x3bf907){return _0x5f50ac['define'](_0xd684('0x8'),attributes,{'tableName':_0xd684('0x9'),'paranoid':![],'indexes':[{'name':_0xd684('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 171cd1d..58bae8a 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 _0x0718=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0718,0xa1));var _0x8071=function(_0x313a00,_0x107929){_0x313a00=_0x313a00-0x0;var _0x46d07b=_0x0718[_0x313a00];return _0x46d07b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8071('0x0'));var BPromise=require('bluebird');var rs=require(_0x8071('0x1'));var fs=require('fs');var Redis=require(_0x8071('0x2'));var db=require(_0x8071('0x3'))['db'];var utils=require(_0x8071('0x4'));var logger=require(_0x8071('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8071('0x6'));var client=jayson[_0x8071('0x7')][_0x8071('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c3167,_0x51b87a,_0x4a0443){return new BPromise(function(_0x517f82,_0x1e4f36){return client[_0x8071('0x9')](_0x1c3167,_0x4a0443)[_0x8071('0xa')](function(_0x55989e){logger[_0x8071('0xb')](_0x8071('0xc'),_0x51b87a,_0x8071('0xd'));logger[_0x8071('0xe')](_0x8071('0xf'),_0x51b87a,_0x8071('0xd'),JSON[_0x8071('0x10')](_0x55989e));if(_0x55989e['error']){if(_0x55989e[_0x8071('0x11')][_0x8071('0x12')]===0x1f4){logger[_0x8071('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x51b87a,_0x55989e['error'][_0x8071('0x13')]);return _0x1e4f36(_0x55989e[_0x8071('0x11')][_0x8071('0x13')]);}logger[_0x8071('0x11')](_0x8071('0xc'),_0x51b87a,_0x55989e[_0x8071('0x11')][_0x8071('0x13')]);return _0x517f82(_0x55989e[_0x8071('0x11')]['message']);}else{logger[_0x8071('0xb')](_0x8071('0xc'),_0x51b87a,_0x8071('0xd'));_0x517f82(_0x55989e[_0x8071('0x14')][_0x8071('0x13')]);}})[_0x8071('0x15')](function(_0x1441ea){logger[_0x8071('0x11')](_0x8071('0xc'),_0x51b87a,_0x1441ea);_0x1e4f36(_0x1441ea);});});} \ No newline at end of file +var _0x0a20=['request\x20sent','debug','stringify','error','message','result','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x3b7bdb,_0x31cd72){var _0x3b27b8=function(_0x15b214){while(--_0x15b214){_0x3b7bdb['push'](_0x3b7bdb['shift']());}};_0x3b27b8(++_0x31cd72);}(_0x0a20,0x6a));var _0x00a2=function(_0x168c36,_0x8a04b6){_0x168c36=_0x168c36-0x0;var _0x17d5f4=_0x0a20[_0x168c36];return _0x17d5f4;};'use strict';var _=require(_0x00a2('0x0'));var util=require(_0x00a2('0x1'));var moment=require(_0x00a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00a2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x00a2('0x4'));var logger=require('../../config/logger')(_0x00a2('0x5'));var config=require(_0x00a2('0x6'));var jayson=require(_0x00a2('0x7'));var client=jayson[_0x00a2('0x8')][_0x00a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c7a5b,_0x2a8f65,_0x202184){return new BPromise(function(_0xfac293,_0x1cbeb1){return client[_0x00a2('0xa')](_0x2c7a5b,_0x202184)[_0x00a2('0xb')](function(_0xfb49ae){logger[_0x00a2('0xc')](_0x00a2('0xd'),_0x2a8f65,_0x00a2('0xe'));logger[_0x00a2('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2a8f65,_0x00a2('0xe'),JSON[_0x00a2('0x10')](_0xfb49ae));if(_0xfb49ae['error']){if(_0xfb49ae[_0x00a2('0x11')]['code']===0x1f4){logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0xfb49ae['error'][_0x00a2('0x12')]);return _0x1cbeb1(_0xfb49ae[_0x00a2('0x11')][_0x00a2('0x12')]);}logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0xfb49ae['error'][_0x00a2('0x12')]);return _0xfac293(_0xfb49ae[_0x00a2('0x11')][_0x00a2('0x12')]);}else{logger[_0x00a2('0xc')](_0x00a2('0xd'),_0x2a8f65,'request\x20sent');_0xfac293(_0xfb49ae[_0x00a2('0x13')][_0x00a2('0x12')]);}})['catch'](function(_0x19bede){logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0x19bede);_0x1cbeb1(_0x19bede);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index fe1636d..74f4c7a 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 _0x0ff8=['fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ff8,0xed));var _0x80ff=function(_0x456da0,_0x279430){_0x456da0=_0x456da0-0x0;var _0xe9b7cd=_0x0ff8[_0x456da0];return _0xe9b7cd;};'use strict';var multer=require(_0x80ff('0x0'));var util=require(_0x80ff('0x1'));var path=require(_0x80ff('0x2'));var timeout=require(_0x80ff('0x3'));var express=require(_0x80ff('0x4'));var router=express['Router']();var fs_extra=require(_0x80ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80ff('0x6'));var config=require(_0x80ff('0x7'));var controller=require(_0x80ff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x80ff('0x9')]);router['get'](_0x80ff('0xa'),auth[_0x80ff('0xb')](),controller[_0x80ff('0xc')]);router[_0x80ff('0xd')](_0x80ff('0xe'),auth[_0x80ff('0xb')](),controller[_0x80ff('0xf')]);router['post']('/',auth[_0x80ff('0xb')](),controller[_0x80ff('0x10')]);router[_0x80ff('0x11')]('/:id',auth[_0x80ff('0xb')](),controller[_0x80ff('0x12')]);router[_0x80ff('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x80ff('0x14')]);module[_0x80ff('0x15')]=router; \ No newline at end of file +var _0x1e95=['put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','describe','/:id','show','post','create'];(function(_0x428ba2,_0x2b75d7){var _0xe74e21=function(_0x4f409c){while(--_0x4f409c){_0x428ba2['push'](_0x428ba2['shift']());}};_0xe74e21(++_0x2b75d7);}(_0x1e95,0x11a));var _0x51e9=function(_0x9a7209,_0x1d172d){_0x9a7209=_0x9a7209-0x0;var _0x5c95af=_0x1e95[_0x9a7209];return _0x5c95af;};'use strict';var multer=require(_0x51e9('0x0'));var util=require(_0x51e9('0x1'));var path=require(_0x51e9('0x2'));var timeout=require(_0x51e9('0x3'));var express=require(_0x51e9('0x4'));var router=express[_0x51e9('0x5')]();var fs_extra=require(_0x51e9('0x6'));var auth=require(_0x51e9('0x7'));var interaction=require(_0x51e9('0x8'));var config=require(_0x51e9('0x9'));var controller=require(_0x51e9('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x51e9('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x51e9('0xc')]);router[_0x51e9('0xb')](_0x51e9('0xd'),auth['isAuthenticated'](),controller[_0x51e9('0xe')]);router[_0x51e9('0xf')]('/',auth['isAuthenticated'](),controller[_0x51e9('0x10')]);router[_0x51e9('0x11')](_0x51e9('0xd'),auth[_0x51e9('0x12')](),controller[_0x51e9('0x13')]);router[_0x51e9('0x14')](_0x51e9('0xd'),auth['isAuthenticated'](),controller[_0x51e9('0x15')]);module[_0x51e9('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 7eb98d4..f1b9ebc 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 _0x75fd=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x75fd,0x197));var _0xd75f=function(_0x34a1cf,_0xcdd7ea){_0x34a1cf=_0x34a1cf-0x0;var _0x1e5c38=_0x75fd[_0x34a1cf];return _0x1e5c38;};'use strict';var Sequelize=require(_0xd75f('0x0'));var moment=require('moment');module[_0xd75f('0x1')]={'channel':{'type':Sequelize[_0xd75f('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd75f('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xd75f('0x3'),'comment':_0xd75f('0x4')},'duration':{'type':Sequelize[_0xd75f('0x5')]},'enterAt':{'type':Sequelize[_0xd75f('0x6')]},'exitAt':{'type':Sequelize[_0xd75f('0x6')],'set':function(_0x16776b){var _0x5b96b0=moment(_0x16776b);var _0x4613eb=moment(this[_0xd75f('0x7')](_0xd75f('0x8')));var _0x14d6a3=_0x5b96b0[_0xd75f('0x9')](_0x4613eb,_0xd75f('0xa'));this['setDataValue'](_0xd75f('0xb'),_0x16776b);this[_0xd75f('0xc')]('duration',_0x14d6a3>=0x0?_0x14d6a3:null);}},'data1':{'type':Sequelize[_0xd75f('0x2')],'comment':_0xd75f('0xd')},'data2':{'type':Sequelize[_0xd75f('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xd75f('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0xd75f('0xe')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xd75f('0x2')]},'internal':{'type':Sequelize[_0xd75f('0x5')]},'uniqueid':{'type':Sequelize[_0xd75f('0x2')]}}; \ No newline at end of file +var _0x2c8e=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[destination]','talk:[dial\x20string]','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x2b387f,_0x33441c){var _0x3d4834=function(_0x1437db){while(--_0x1437db){_0x2b387f['push'](_0x2b387f['shift']());}};_0x3d4834(++_0x33441c);}(_0x2c8e,0x144));var _0xe2c8=function(_0x2c4f21,_0x4344a3){_0x2c4f21=_0x2c4f21-0x0;var _0x16bdc6=_0x2c8e[_0x2c4f21];return _0x16bdc6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xe2c8('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe2c8('0x1')]},'interface':{'type':Sequelize[_0xe2c8('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xe2c8('0x2'),'comment':_0xe2c8('0x3')},'duration':{'type':Sequelize[_0xe2c8('0x4')]},'enterAt':{'type':Sequelize[_0xe2c8('0x5')]},'exitAt':{'type':Sequelize[_0xe2c8('0x5')],'set':function(_0x1e0f2e){var _0x16626f=moment(_0x1e0f2e);var _0x7f4719=moment(this[_0xe2c8('0x6')](_0xe2c8('0x7')));var _0x412fd7=_0x16626f[_0xe2c8('0x8')](_0x7f4719,_0xe2c8('0x9'));this[_0xe2c8('0xa')](_0xe2c8('0xb'),_0x1e0f2e);this[_0xe2c8('0xa')](_0xe2c8('0xc'),_0x412fd7>=0x0?_0x412fd7:null);}},'data1':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xe2c8('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0xe2c8('0xe')},'data5':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xe2c8('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe2c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e3436fc..84f4a6d 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x34e8,0x12c));var _0x834e=function(_0x51920a,_0x40bd94){_0x51920a=_0x51920a-0x0;var _0x474d6f=_0x34e8[_0x51920a];return _0x474d6f;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));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('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=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 licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x34e8,0x12c));var _0x834e=function(_0x14b12a,_0x186a49){_0x14b12a=_0x14b12a-0x0;var _0x3a7003=_0x34e8[_0x14b12a];return _0x3a7003;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));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('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=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 licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 888e652..8bec703 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 _0x63b1=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x63b1,0x177));var _0x163b=function(_0x592673,_0x10efcf){_0x592673=_0x592673-0x0;var _0x35388f=_0x63b1[_0x592673];return _0x35388f;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var logger=require(_0x163b('0x2'))(_0x163b('0x3'));var moment=require('moment');var BPromise=require(_0x163b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x163b('0x5'));var rimraf=require(_0x163b('0x6'));var config=require(_0x163b('0x7'));var attributes=require(_0x163b('0x8'));module[_0x163b('0x9')]=function(_0x455dac,_0x27de79){return _0x455dac[_0x163b('0xa')](_0x163b('0xb'),attributes,{'tableName':_0x163b('0xc'),'paranoid':![],'indexes':[{'name':_0x163b('0xd'),'fields':['membername',_0x163b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc22d=['./memberReport.attributes','exports','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x3aeae6,_0x201d94){var _0xc3594=function(_0x585f54){while(--_0x585f54){_0x3aeae6['push'](_0x3aeae6['shift']());}};_0xc3594(++_0x201d94);}(_0xc22d,0x172));var _0xdc22=function(_0x2149dd,_0x498100){_0x2149dd=_0x2149dd-0x0;var _0x248b01=_0xc22d[_0x2149dd];return _0x248b01;};'use strict';var _=require(_0xdc22('0x0'));var util=require(_0xdc22('0x1'));var logger=require(_0xdc22('0x2'))(_0xdc22('0x3'));var moment=require('moment');var BPromise=require(_0xdc22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc22('0x5'));var config=require(_0xdc22('0x6'));var attributes=require(_0xdc22('0x7'));module[_0xdc22('0x8')]=function(_0x4dc993,_0x556e1f){return _0x4dc993['define'](_0xdc22('0x9'),attributes,{'tableName':_0xdc22('0xa'),'paranoid':![],'indexes':[{'name':_0xdc22('0xb'),'fields':['membername',_0xdc22('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 80c57fa..171f599 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 _0xb2ad=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMemberReport','options','raw','attributes','limit','map','include','model','info','debug','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','where','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d84b1,_0x599872){var _0x54fa39=function(_0x48ef05){while(--_0x48ef05){_0x1d84b1['push'](_0x1d84b1['shift']());}};_0x54fa39(++_0x599872);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x20cd32,_0x5a17d3){_0x20cd32=_0x20cd32-0x0;var _0x1fe102=_0xb2ad[_0x20cd32];return _0x1fe102;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var moment=require('moment');var BPromise=require(_0xdb2a('0x1'));var rs=require(_0xdb2a('0x2'));var fs=require('fs');var Redis=require(_0xdb2a('0x3'));var db=require(_0xdb2a('0x4'))['db'];var utils=require(_0xdb2a('0x5'));var logger=require('../../config/logger')(_0xdb2a('0x6'));var config=require(_0xdb2a('0x7'));var jayson=require(_0xdb2a('0x8'));var client=jayson[_0xdb2a('0x9')][_0xdb2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6649,_0x4f8127,_0x2ed71e){return new BPromise(function(_0xc23925,_0x78ee){return client['request'](_0x4e6649,_0x2ed71e)[_0xdb2a('0xb')](function(_0x29f542){logger['info'](_0xdb2a('0xc'),_0x4f8127,_0xdb2a('0xd'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x4f8127,_0xdb2a('0xd'),JSON[_0xdb2a('0xe')](_0x29f542));if(_0x29f542[_0xdb2a('0xf')]){if(_0x29f542['error'][_0xdb2a('0x10')]===0x1f4){logger[_0xdb2a('0xf')]('MemberReport,\x20%s,\x20%s',_0x4f8127,_0x29f542['error']['message']);return _0x78ee(_0x29f542[_0xdb2a('0xf')]['message']);}logger[_0xdb2a('0xf')](_0xdb2a('0xc'),_0x4f8127,_0x29f542['error'][_0xdb2a('0x11')]);return _0xc23925(_0x29f542['error']['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x4f8127,_0xdb2a('0xd'));_0xc23925(_0x29f542[_0xdb2a('0x12')]['message']);}})['catch'](function(_0x21cb82){logger[_0xdb2a('0xf')](_0xdb2a('0xc'),_0x4f8127,_0x21cb82);_0x78ee(_0x21cb82);});});}exports[_0xdb2a('0x13')]=function(_0x52508d){var _0x2bc67d=this;return new Promise(function(_0x2de4cf,_0x1f6111){return db['MemberReport']['findAll']({'raw':_0x52508d[_0xdb2a('0x14')]?_0x52508d[_0xdb2a('0x14')][_0xdb2a('0x15')]===undefined?!![]:![]:!![],'where':_0x52508d[_0xdb2a('0x14')]?_0x52508d[_0xdb2a('0x14')]['where']||null:null,'attributes':_0x52508d[_0xdb2a('0x14')]?_0x52508d['options'][_0xdb2a('0x16')]||null:null,'limit':_0x52508d['options']?_0x52508d['options'][_0xdb2a('0x17')]||null:null,'include':_0x52508d[_0xdb2a('0x14')]?_0x52508d[_0xdb2a('0x14')]['include']?_[_0xdb2a('0x18')](_0x52508d[_0xdb2a('0x14')][_0xdb2a('0x19')],function(_0x391378){return{'model':db[_0x391378[_0xdb2a('0x1a')]],'as':_0x391378['as'],'attributes':_0x391378[_0xdb2a('0x16')],'include':_0x391378['include']?_[_0xdb2a('0x18')](_0x391378[_0xdb2a('0x19')],function(_0x5f00fb){return{'model':db[_0x5f00fb[_0xdb2a('0x1a')]],'as':_0x5f00fb['as'],'attributes':_0x5f00fb[_0xdb2a('0x16')],'include':_0x5f00fb[_0xdb2a('0x19')]?_[_0xdb2a('0x18')](_0x5f00fb['include'],function(_0xc50c3d){return{'model':db[_0xc50c3d[_0xdb2a('0x1a')]],'as':_0xc50c3d['as'],'attributes':_0xc50c3d[_0xdb2a('0x16')]};}):[]};}):[]};}):[]:[]})[_0xdb2a('0xb')](function(_0x4ed637){logger[_0xdb2a('0x1b')](_0xdb2a('0x13'),_0x52508d);logger[_0xdb2a('0x1c')](_0xdb2a('0x13'),_0x52508d,JSON[_0xdb2a('0xe')](_0x4ed637));_0x2de4cf(_0x4ed637);})['catch'](function(_0x852103){logger[_0xdb2a('0xf')](_0xdb2a('0x13'),_0x852103[_0xdb2a('0x11')],_0x52508d);_0x1f6111(_0x2bc67d[_0xdb2a('0xf')](0x1f4,_0x852103[_0xdb2a('0x11')]));});});};exports[_0xdb2a('0x1d')]=function(_0x2b01e5){var _0x3c55cc=this;return new Promise(function(_0x24b30a,_0x39c5cc){return db[_0xdb2a('0x1e')][_0xdb2a('0x1f')](_0x2b01e5[_0xdb2a('0x20')],{'raw':_0x2b01e5[_0xdb2a('0x14')]?_0x2b01e5[_0xdb2a('0x14')][_0xdb2a('0x15')]===undefined?!![]:![]:!![]})[_0xdb2a('0xb')](function(_0x1053d0){logger[_0xdb2a('0x1b')]('CreateMemberReport',_0x2b01e5);logger[_0xdb2a('0x1c')](_0xdb2a('0x1d'),_0x2b01e5,JSON[_0xdb2a('0xe')](_0x1053d0));_0x24b30a(_0x1053d0);})['catch'](function(_0x49ec05){logger[_0xdb2a('0xf')](_0xdb2a('0x1d'),_0x49ec05[_0xdb2a('0x11')],_0x2b01e5);_0x39c5cc(_0x3c55cc[_0xdb2a('0xf')](0x1f4,_0x49ec05[_0xdb2a('0x11')]));});});};exports[_0xdb2a('0x21')]=function(_0xaeb30b){var _0x17bec7=this;return new Promise(function(_0x185297,_0x444cc2){return db[_0xdb2a('0x1e')][_0xdb2a('0x22')](_0xaeb30b[_0xdb2a('0x20')],{'raw':_0xaeb30b[_0xdb2a('0x14')]?_0xaeb30b['options'][_0xdb2a('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaeb30b['options']?_0xaeb30b['options'][_0xdb2a('0x23')]||null:null,'attributes':_0xaeb30b[_0xdb2a('0x14')]?_0xaeb30b[_0xdb2a('0x14')][_0xdb2a('0x16')]||null:null,'limit':_0xaeb30b[_0xdb2a('0x14')]?_0xaeb30b['options']['limit']||null:null})[_0xdb2a('0xb')](function(_0x4ad3bc){logger['info'](_0xdb2a('0x21'),_0xaeb30b);logger[_0xdb2a('0x1c')](_0xdb2a('0x21'),_0xaeb30b,JSON['stringify'](_0x4ad3bc));_0x185297(_0x4ad3bc);})[_0xdb2a('0x24')](function(_0x91d489){logger[_0xdb2a('0xf')]('UpdateMemberReport',_0x91d489[_0xdb2a('0x11')],_0xaeb30b);_0x444cc2(_0x17bec7[_0xdb2a('0xf')](0x1f4,_0x91d489[_0xdb2a('0x11')]));});});}; \ No newline at end of file +var _0xe015=['http','request','then','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','UpdateMemberReport','body','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xe015,0x13b));var _0x5e01=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe015[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var config=require(_0x5e01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5e01('0x8')][_0x5e01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de678,_0x48b05c,_0x414f73){return new BPromise(function(_0x3aeaef,_0x1420c2){return client[_0x5e01('0xa')](_0x4de678,_0x414f73)[_0x5e01('0xb')](function(_0x36bd7e){logger['info'](_0x5e01('0xc'),_0x48b05c,'request\x20sent');logger[_0x5e01('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x48b05c,_0x5e01('0xe'),JSON[_0x5e01('0xf')](_0x36bd7e));if(_0x36bd7e['error']){if(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x11')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x48b05c,_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);return _0x1420c2(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);}logger[_0x5e01('0x10')](_0x5e01('0xc'),_0x48b05c,_0x36bd7e['error'][_0x5e01('0x12')]);return _0x3aeaef(_0x36bd7e['error']['message']);}else{logger[_0x5e01('0x13')](_0x5e01('0xc'),_0x48b05c,'request\x20sent');_0x3aeaef(_0x36bd7e[_0x5e01('0x14')]['message']);}})[_0x5e01('0x15')](function(_0x5e4058){logger[_0x5e01('0x10')]('MemberReport,\x20%s,\x20%s',_0x48b05c,_0x5e4058);_0x1420c2(_0x5e4058);});});}exports[_0x5e01('0x16')]=function(_0x5eda1d){var _0x509c07=this;return new Promise(function(_0x35a002,_0x42b4f8){return db['MemberReport'][_0x5e01('0x17')]({'raw':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![],'where':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x1a')]||null:null,'attributes':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d['options'][_0x5e01('0x1b')]||null:null,'limit':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d['options'][_0x5e01('0x1c')]||null:null,'include':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x1d')]?_[_0x5e01('0x1e')](_0x5eda1d[_0x5e01('0x18')]['include'],function(_0x329315){return{'model':db[_0x329315[_0x5e01('0x1f')]],'as':_0x329315['as'],'attributes':_0x329315[_0x5e01('0x1b')],'include':_0x329315[_0x5e01('0x1d')]?_['map'](_0x329315[_0x5e01('0x1d')],function(_0x23264f){return{'model':db[_0x23264f[_0x5e01('0x1f')]],'as':_0x23264f['as'],'attributes':_0x23264f['attributes'],'include':_0x23264f[_0x5e01('0x1d')]?_[_0x5e01('0x1e')](_0x23264f[_0x5e01('0x1d')],function(_0x28344a){return{'model':db[_0x28344a['model']],'as':_0x28344a['as'],'attributes':_0x28344a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e01('0xb')](function(_0x5f01dd){logger[_0x5e01('0x13')](_0x5e01('0x16'),_0x5eda1d);logger[_0x5e01('0xd')](_0x5e01('0x16'),_0x5eda1d,JSON['stringify'](_0x5f01dd));_0x35a002(_0x5f01dd);})['catch'](function(_0x4a4a9f){logger['error'](_0x5e01('0x16'),_0x4a4a9f['message'],_0x5eda1d);_0x42b4f8(_0x509c07[_0x5e01('0x10')](0x1f4,_0x4a4a9f[_0x5e01('0x12')]));});});};exports[_0x5e01('0x20')]=function(_0x494da9){var _0x393bf0=this;return new Promise(function(_0x36d7a8,_0x44b818){return db[_0x5e01('0x21')]['create'](_0x494da9['body'],{'raw':_0x494da9[_0x5e01('0x18')]?_0x494da9[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![]})[_0x5e01('0xb')](function(_0x350659){logger[_0x5e01('0x13')](_0x5e01('0x20'),_0x494da9);logger[_0x5e01('0xd')](_0x5e01('0x20'),_0x494da9,JSON[_0x5e01('0xf')](_0x350659));_0x36d7a8(_0x350659);})[_0x5e01('0x15')](function(_0x161b96){logger['error'](_0x5e01('0x20'),_0x161b96[_0x5e01('0x12')],_0x494da9);_0x44b818(_0x393bf0[_0x5e01('0x10')](0x1f4,_0x161b96['message']));});});};exports[_0x5e01('0x22')]=function(_0x12a1f4){var _0x5cca68=this;return new Promise(function(_0x3cc642,_0x2c38af){return db[_0x5e01('0x21')]['update'](_0x12a1f4[_0x5e01('0x23')],{'raw':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1a')]||null:null,'attributes':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1b')]||null:null,'limit':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1c')]||null:null})[_0x5e01('0xb')](function(_0x260901){logger['info'](_0x5e01('0x22'),_0x12a1f4);logger['debug']('UpdateMemberReport',_0x12a1f4,JSON[_0x5e01('0xf')](_0x260901));_0x3cc642(_0x260901);})[_0x5e01('0x15')](function(_0x120b7b){logger[_0x5e01('0x10')](_0x5e01('0x22'),_0x120b7b['message'],_0x12a1f4);_0x2c38af(_0x5cca68[_0x5e01('0x10')](0x1f4,_0x120b7b[_0x5e01('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e3d6985..6752521 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 _0x57c2=['../../components/auth/service','../../config/environment','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x498e3c,_0x2455c4){var _0x1e5f5f=function(_0x1d981b){while(--_0x1d981b){_0x498e3c['push'](_0x498e3c['shift']());}};_0x1e5f5f(++_0x2455c4);}(_0x57c2,0x113));var _0x257c=function(_0x12acef,_0x1c8876){_0x12acef=_0x12acef-0x0;var _0x225f0d=_0x57c2[_0x12acef];return _0x225f0d;};'use strict';var multer=require(_0x257c('0x0'));var util=require('util');var path=require(_0x257c('0x1'));var timeout=require(_0x257c('0x2'));var express=require(_0x257c('0x3'));var router=express['Router']();var fs_extra=require(_0x257c('0x4'));var auth=require(_0x257c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x257c('0x6'));var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0x257c('0x7')]=router; \ No newline at end of file +var _0x2a96=['../../config/environment','./migration.controller','get','index','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a1365,_0x2b383a){var _0xc7d258=function(_0x285bd1){while(--_0x285bd1){_0x5a1365['push'](_0x5a1365['shift']());}};_0xc7d258(++_0x2b383a);}(_0x2a96,0xb8));var _0x62a9=function(_0x1595ff,_0x238718){_0x1595ff=_0x1595ff-0x0;var _0x571b9d=_0x2a96[_0x1595ff];return _0x571b9d;};'use strict';var multer=require(_0x62a9('0x0'));var util=require(_0x62a9('0x1'));var path=require(_0x62a9('0x2'));var timeout=require(_0x62a9('0x3'));var express=require(_0x62a9('0x4'));var router=express['Router']();var fs_extra=require(_0x62a9('0x5'));var auth=require(_0x62a9('0x6'));var interaction=require(_0x62a9('0x7'));var config=require(_0x62a9('0x8'));var controller=require(_0x62a9('0x9'));router[_0x62a9('0xa')]('/',controller[_0x62a9('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9c30fb3..92528a7 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 _0xb78b=['STRING','version','sequelize','exports'];(function(_0x114265,_0x559cc4){var _0x45bb01=function(_0x92c7a9){while(--_0x92c7a9){_0x114265['push'](_0x114265['shift']());}};_0x45bb01(++_0x559cc4);}(_0xb78b,0x1a2));var _0xbb78=function(_0x2b633e,_0x5db23f){_0x2b633e=_0x2b633e-0x0;var _0x371240=_0xb78b[_0x2b633e];return _0x371240;};'use strict';var Sequelize=require(_0xbb78('0x0'));module[_0xbb78('0x1')]={'version':{'type':Sequelize[_0xbb78('0x2')],'unique':_0xbb78('0x3')}}; \ No newline at end of file +var _0xe306=['version','sequelize','exports','STRING'];(function(_0x416237,_0x3c6f82){var _0x5991e1=function(_0x2b766b){while(--_0x2b766b){_0x416237['push'](_0x416237['shift']());}};_0x5991e1(++_0x3c6f82);}(_0xe306,0xa9));var _0x6e30=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xe306[_0x1d6a82];return _0x5834ac;};'use strict';var Sequelize=require(_0x6e30('0x0'));module[_0x6e30('0x1')]={'version':{'type':Sequelize[_0x6e30('0x2')],'unique':_0x6e30('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8615c1f..3fdc31a 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 _0xb76c=['name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack'];(function(_0x5c9bbc,_0x1c8307){var _0x53a157=function(_0x3a3260){while(--_0x3a3260){_0x5c9bbc['push'](_0x5c9bbc['shift']());}};_0x53a157(++_0x1c8307);}(_0xb76c,0xf7));var _0xcb76=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xb76c[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0xcb76('0x0'));var rimraf=require(_0xcb76('0x1'));var zipdir=require(_0xcb76('0x2'));var jsonpatch=require(_0xcb76('0x3'));var rp=require(_0xcb76('0x4'));var moment=require(_0xcb76('0x5'));var BPromise=require(_0xcb76('0x6'));var Mustache=require('mustache');var util=require(_0xcb76('0x7'));var path=require(_0xcb76('0x8'));var sox=require(_0xcb76('0x9'));var csv=require(_0xcb76('0xa'));var ejs=require(_0xcb76('0xb'));var fs=require('fs');var fs_extra=require(_0xcb76('0xc'));var _=require(_0xcb76('0xd'));var squel=require(_0xcb76('0xe'));var crypto=require(_0xcb76('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb76('0xa'));var querystring=require('querystring');var Papa=require(_0xcb76('0x10'));var Redis=require(_0xcb76('0x11'));var authService=require(_0xcb76('0x12'));var qs=require(_0xcb76('0x13'));var as=require(_0xcb76('0x14'));var hardwareService=require(_0xcb76('0x15'));var logger=require(_0xcb76('0x16'))(_0xcb76('0x17'));var utils=require(_0xcb76('0x18'));var config=require(_0xcb76('0x19'));var licenseUtil=require(_0xcb76('0x1a'));var db=require(_0xcb76('0x1b'))['db'];function respondWithStatusCode(_0x12b13a,_0x27c738){_0x27c738=_0x27c738||0xcc;return function(_0x4dd583){if(_0x4dd583){return _0x12b13a['sendStatus'](_0x27c738);}return _0x12b13a['status'](_0x27c738)[_0xcb76('0x1c')]();};}function respondWithResult(_0x80d0bc,_0x3c5ea8){_0x3c5ea8=_0x3c5ea8||0xc8;return function(_0x592a24){if(_0x592a24){return _0x80d0bc[_0xcb76('0x1d')](_0x3c5ea8)[_0xcb76('0x1e')](_0x592a24);}};}function respondWithFilteredResult(_0xa920f1,_0x15c083){return function(_0xb7519){if(_0xb7519){var _0x5b9438=typeof _0x15c083[_0xcb76('0x1f')]==='undefined'&&typeof _0x15c083[_0xcb76('0x20')]===_0xcb76('0x21');var _0x2ffa5b=_0xb7519[_0xcb76('0x22')];var _0x340afa=_0x5b9438?0x0:_0x15c083[_0xcb76('0x1f')];var _0xab3f06=_0x5b9438?_0xb7519[_0xcb76('0x22')]:_0x15c083[_0xcb76('0x1f')]+_0x15c083['limit'];var _0x45dba2;if(_0xab3f06>=_0x2ffa5b){_0xab3f06=_0x2ffa5b;_0x45dba2=0xc8;}else{_0x45dba2=0xce;}_0xa920f1[_0xcb76('0x1d')](_0x45dba2);return _0xa920f1[_0xcb76('0x23')]('Content-Range',_0x340afa+'-'+_0xab3f06+'/'+_0x2ffa5b)[_0xcb76('0x1e')](_0xb7519);}return null;};}function patchUpdates(_0x49c765){return function(_0x5958d9){try{jsonpatch[_0xcb76('0x24')](_0x5958d9,_0x49c765,!![]);}catch(_0x5ccb82){return BPromise[_0xcb76('0x25')](_0x5ccb82);}return _0x5958d9[_0xcb76('0x26')]();};}function saveUpdates(_0xf51596,_0x4bd3c4){return function(_0x30cbef){if(_0x30cbef){return _0x30cbef[_0xcb76('0x27')](_0xf51596)['then'](function(_0x55afeb){return _0x55afeb;});}return null;};}function removeEntity(_0x1571c5,_0x62d49b){return function(_0x212c0f){if(_0x212c0f){return _0x212c0f[_0xcb76('0x28')]()[_0xcb76('0x29')](function(){_0x1571c5[_0xcb76('0x1d')](0xcc)[_0xcb76('0x1c')]();});}};}function handleEntityNotFound(_0x4220c5,_0x22d6a1){return function(_0x5acbaa){if(!_0x5acbaa){_0x4220c5[_0xcb76('0x2a')](0x194);}return _0x5acbaa;};}function handleError(_0x401c6a,_0x49917e){_0x49917e=_0x49917e||0x1f4;return function(_0x292c8d){logger[_0xcb76('0x2b')](_0x292c8d[_0xcb76('0x2c')]);if(_0x292c8d[_0xcb76('0x2d')]){delete _0x292c8d[_0xcb76('0x2d')];}_0x401c6a[_0xcb76('0x1d')](_0x49917e)[_0xcb76('0x2e')](_0x292c8d);};}exports[_0xcb76('0x2f')]=function(_0x142bf9,_0x2a8587){var _0x27cb1b={},_0xf280d3={},_0x14cc4b={'count':0x0,'rows':[]};var _0x35806b=_[_0xcb76('0x30')](db[_0xcb76('0x31')][_0xcb76('0x32')],function(_0x4ecb5a){return{'name':_0x4ecb5a[_0xcb76('0x33')],'type':_0x4ecb5a['type'][_0xcb76('0x34')]};});_0xf280d3[_0xcb76('0x35')]=_[_0xcb76('0x30')](_0x35806b,'name');_0xf280d3[_0xcb76('0x36')]=_[_0xcb76('0x37')](_0x142bf9['query']);_0xf280d3['filters']=_[_0xcb76('0x38')](_0xf280d3[_0xcb76('0x35')],_0xf280d3['query']);_0x27cb1b[_0xcb76('0x39')]=_['intersection'](_0xf280d3['model'],qs['fields'](_0x142bf9[_0xcb76('0x36')]['fields']));_0x27cb1b[_0xcb76('0x39')]=_0x27cb1b[_0xcb76('0x39')][_0xcb76('0x3a')]?_0x27cb1b[_0xcb76('0x39')]:_0xf280d3[_0xcb76('0x35')];if(!_0x142bf9[_0xcb76('0x36')][_0xcb76('0x3b')](_0xcb76('0x3c'))){_0x27cb1b[_0xcb76('0x20')]=qs[_0xcb76('0x20')](_0x142bf9[_0xcb76('0x36')][_0xcb76('0x20')]);_0x27cb1b[_0xcb76('0x1f')]=qs[_0xcb76('0x1f')](_0x142bf9['query'][_0xcb76('0x1f')]);}_0x27cb1b[_0xcb76('0x3d')]=qs['sort'](_0x142bf9[_0xcb76('0x36')][_0xcb76('0x3e')]);_0x27cb1b[_0xcb76('0x3f')]=qs[_0xcb76('0x40')](_['pick'](_0x142bf9['query'],_0xf280d3['filters']),_0x35806b);if(_0x142bf9[_0xcb76('0x36')][_0xcb76('0x41')]){_0x27cb1b[_0xcb76('0x3f')]=_[_0xcb76('0x42')](_0x27cb1b[_0xcb76('0x3f')],{'$or':_[_0xcb76('0x30')](_0x35806b,function(_0x1e4d2d){if(_0x1e4d2d['type']!=='VIRTUAL'){var _0xd79130={};_0xd79130[_0x1e4d2d[_0xcb76('0x2d')]]={'$like':'%'+_0x142bf9['query'][_0xcb76('0x41')]+'%'};return _0xd79130;}})});}_0x27cb1b=_['merge']({},_0x27cb1b,_0x142bf9[_0xcb76('0x43')]);var _0x39af7e={'where':_0x27cb1b[_0xcb76('0x3f')]};return db['Migration'][_0xcb76('0x22')](_0x39af7e)[_0xcb76('0x29')](function(_0x1730bb){_0x14cc4b[_0xcb76('0x22')]=_0x1730bb;if(_0x142bf9[_0xcb76('0x36')][_0xcb76('0x44')]){_0x27cb1b[_0xcb76('0x45')]=[{'all':!![]}];}return db[_0xcb76('0x31')][_0xcb76('0x46')](_0x27cb1b);})[_0xcb76('0x29')](function(_0x44759c){_0x14cc4b[_0xcb76('0x47')]=_0x44759c;return _0x14cc4b;})[_0xcb76('0x29')](respondWithFilteredResult(_0x2a8587,_0x27cb1b))[_0xcb76('0x48')](handleError(_0x2a8587,null));}; \ No newline at end of file +var _0x593f=['options','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','Migration','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x593f,0x1e1));var _0xf593=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x593f[_0x44216d];return _0xeca523;};'use strict';var emlformat=require(_0xf593('0x0'));var rimraf=require(_0xf593('0x1'));var zipdir=require(_0xf593('0x2'));var jsonpatch=require(_0xf593('0x3'));var rp=require(_0xf593('0x4'));var moment=require('moment');var BPromise=require(_0xf593('0x5'));var Mustache=require(_0xf593('0x6'));var util=require(_0xf593('0x7'));var path=require('path');var sox=require(_0xf593('0x8'));var csv=require(_0xf593('0x9'));var ejs=require(_0xf593('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf593('0xb'));var squel=require(_0xf593('0xc'));var crypto=require('crypto');var jsforce=require(_0xf593('0xd'));var deskjs=require(_0xf593('0xe'));var toCsv=require(_0xf593('0x9'));var querystring=require(_0xf593('0xf'));var Papa=require(_0xf593('0x10'));var Redis=require(_0xf593('0x11'));var authService=require(_0xf593('0x12'));var qs=require(_0xf593('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf593('0x14'));var logger=require('../../config/logger')(_0xf593('0x15'));var utils=require('../../config/utils');var config=require(_0xf593('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf593('0x17'))['db'];function respondWithStatusCode(_0xc852a6,_0x1c70eb){_0x1c70eb=_0x1c70eb||0xcc;return function(_0x5e15ee){if(_0x5e15ee){return _0xc852a6[_0xf593('0x18')](_0x1c70eb);}return _0xc852a6[_0xf593('0x19')](_0x1c70eb)['end']();};}function respondWithResult(_0x984580,_0x4ae654){_0x4ae654=_0x4ae654||0xc8;return function(_0x5276d6){if(_0x5276d6){return _0x984580[_0xf593('0x19')](_0x4ae654)[_0xf593('0x1a')](_0x5276d6);}};}function respondWithFilteredResult(_0x34070,_0x46f8aa){return function(_0x44462b){if(_0x44462b){var _0x444769=typeof _0x46f8aa[_0xf593('0x1b')]===_0xf593('0x1c')&&typeof _0x46f8aa[_0xf593('0x1d')]===_0xf593('0x1c');var _0x5a2fb7=_0x44462b[_0xf593('0x1e')];var _0x49c0ea=_0x444769?0x0:_0x46f8aa[_0xf593('0x1b')];var _0x1444f9=_0x444769?_0x44462b[_0xf593('0x1e')]:_0x46f8aa[_0xf593('0x1b')]+_0x46f8aa[_0xf593('0x1d')];var _0x5ee60d;if(_0x1444f9>=_0x5a2fb7){_0x1444f9=_0x5a2fb7;_0x5ee60d=0xc8;}else{_0x5ee60d=0xce;}_0x34070[_0xf593('0x19')](_0x5ee60d);return _0x34070[_0xf593('0x1f')](_0xf593('0x20'),_0x49c0ea+'-'+_0x1444f9+'/'+_0x5a2fb7)['json'](_0x44462b);}return null;};}function patchUpdates(_0x1b274d){return function(_0x1866b3){try{jsonpatch['apply'](_0x1866b3,_0x1b274d,!![]);}catch(_0xb05e59){return BPromise[_0xf593('0x21')](_0xb05e59);}return _0x1866b3[_0xf593('0x22')]();};}function saveUpdates(_0x3551da,_0x373243){return function(_0x392b6d){if(_0x392b6d){return _0x392b6d['update'](_0x3551da)[_0xf593('0x23')](function(_0xb4bae4){return _0xb4bae4;});}return null;};}function removeEntity(_0x32ee41,_0x48a1f6){return function(_0x345820){if(_0x345820){return _0x345820[_0xf593('0x24')]()['then'](function(){_0x32ee41[_0xf593('0x19')](0xcc)[_0xf593('0x25')]();});}};}function handleEntityNotFound(_0x1883d0,_0x173dd9){return function(_0x27d716){if(!_0x27d716){_0x1883d0[_0xf593('0x18')](0x194);}return _0x27d716;};}function handleError(_0x4dd039,_0x424654){_0x424654=_0x424654||0x1f4;return function(_0x2c0909){logger[_0xf593('0x26')](_0x2c0909[_0xf593('0x27')]);if(_0x2c0909[_0xf593('0x28')]){delete _0x2c0909['name'];}_0x4dd039[_0xf593('0x19')](_0x424654)[_0xf593('0x29')](_0x2c0909);};}exports[_0xf593('0x2a')]=function(_0x4497c6,_0x38a3f1){var _0x39f7fa={},_0x49a5cd={},_0x1ad4eb={'count':0x0,'rows':[]};var _0x518d3d=_[_0xf593('0x2b')](db[_0xf593('0x2c')]['rawAttributes'],function(_0x1a3902){return{'name':_0x1a3902['fieldName'],'type':_0x1a3902[_0xf593('0x2d')][_0xf593('0x2e')]};});_0x49a5cd[_0xf593('0x2f')]=_[_0xf593('0x2b')](_0x518d3d,_0xf593('0x28'));_0x49a5cd[_0xf593('0x30')]=_['keys'](_0x4497c6[_0xf593('0x30')]);_0x49a5cd[_0xf593('0x31')]=_[_0xf593('0x32')](_0x49a5cd[_0xf593('0x2f')],_0x49a5cd[_0xf593('0x30')]);_0x39f7fa['attributes']=_['intersection'](_0x49a5cd['model'],qs[_0xf593('0x33')](_0x4497c6[_0xf593('0x30')][_0xf593('0x33')]));_0x39f7fa['attributes']=_0x39f7fa['attributes'][_0xf593('0x34')]?_0x39f7fa[_0xf593('0x35')]:_0x49a5cd['model'];if(!_0x4497c6[_0xf593('0x30')][_0xf593('0x36')](_0xf593('0x37'))){_0x39f7fa[_0xf593('0x1d')]=qs['limit'](_0x4497c6[_0xf593('0x30')]['limit']);_0x39f7fa[_0xf593('0x1b')]=qs[_0xf593('0x1b')](_0x4497c6['query'][_0xf593('0x1b')]);}_0x39f7fa[_0xf593('0x38')]=qs[_0xf593('0x39')](_0x4497c6['query'][_0xf593('0x39')]);_0x39f7fa[_0xf593('0x3a')]=qs[_0xf593('0x31')](_[_0xf593('0x3b')](_0x4497c6[_0xf593('0x30')],_0x49a5cd[_0xf593('0x31')]),_0x518d3d);if(_0x4497c6[_0xf593('0x30')][_0xf593('0x3c')]){_0x39f7fa[_0xf593('0x3a')]=_[_0xf593('0x3d')](_0x39f7fa[_0xf593('0x3a')],{'$or':_[_0xf593('0x2b')](_0x518d3d,function(_0x1aa29a){if(_0x1aa29a[_0xf593('0x2d')]!==_0xf593('0x3e')){var _0x164c3f={};_0x164c3f[_0x1aa29a[_0xf593('0x28')]]={'$like':'%'+_0x4497c6[_0xf593('0x30')][_0xf593('0x3c')]+'%'};return _0x164c3f;}})});}_0x39f7fa=_[_0xf593('0x3d')]({},_0x39f7fa,_0x4497c6[_0xf593('0x3f')]);var _0x35d365={'where':_0x39f7fa[_0xf593('0x3a')]};return db[_0xf593('0x2c')][_0xf593('0x1e')](_0x35d365)[_0xf593('0x23')](function(_0x2817dd){_0x1ad4eb['count']=_0x2817dd;if(_0x4497c6[_0xf593('0x30')][_0xf593('0x40')]){_0x39f7fa[_0xf593('0x41')]=[{'all':!![]}];}return db[_0xf593('0x2c')][_0xf593('0x42')](_0x39f7fa);})[_0xf593('0x23')](function(_0x584dd7){_0x1ad4eb['rows']=_0x584dd7;return _0x1ad4eb;})[_0xf593('0x23')](respondWithFilteredResult(_0x38a3f1,_0x39f7fa))[_0xf593('0x43')](handleError(_0x38a3f1,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 849d503..b1134d2 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 _0x635b=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash'];(function(_0x3f2ebf,_0x5bd45a){var _0x3fc2bf=function(_0x154f6e){while(--_0x154f6e){_0x3f2ebf['push'](_0x3f2ebf['shift']());}};_0x3fc2bf(++_0x5bd45a);}(_0x635b,0x8e));var _0xb635=function(_0x1817a0,_0x2c41da){_0x1817a0=_0x1817a0-0x0;var _0x216dc4=_0x635b[_0x1817a0];return _0x216dc4;};'use strict';var _=require(_0xb635('0x0'));var util=require(_0xb635('0x1'));var logger=require(_0xb635('0x2'))(_0xb635('0x3'));var moment=require(_0xb635('0x4'));var BPromise=require('bluebird');var rp=require(_0xb635('0x5'));var fs=require('fs');var path=require(_0xb635('0x6'));var rimraf=require(_0xb635('0x7'));var config=require(_0xb635('0x8'));var attributes=require(_0xb635('0x9'));module[_0xb635('0xa')]=function(_0x59ff62,_0x3b1df0){return _0x59ff62[_0xb635('0xb')]('Migration',attributes,{'tableName':_0xb635('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42bc=['bluebird','rimraf','../../config/environment','./migration.attributes','migrations','lodash','../../config/logger','api','moment'];(function(_0x383def,_0x3ae0f0){var _0x54979e=function(_0x2746d7){while(--_0x2746d7){_0x383def['push'](_0x383def['shift']());}};_0x54979e(++_0x3ae0f0);}(_0x42bc,0x10a));var _0xc42b=function(_0x2dd628,_0x3c22e4){_0x2dd628=_0x2dd628-0x0;var _0x2e138c=_0x42bc[_0x2dd628];return _0x2e138c;};'use strict';var _=require(_0xc42b('0x0'));var util=require('util');var logger=require(_0xc42b('0x1'))(_0xc42b('0x2'));var moment=require(_0xc42b('0x3'));var BPromise=require(_0xc42b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc42b('0x5'));var config=require(_0xc42b('0x6'));var attributes=require(_0xc42b('0x7'));module['exports']=function(_0x11d153,_0x335707){return _0x11d153['define']('Migration',attributes,{'tableName':_0xc42b('0x8'),'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 af0751e..07660b7 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 _0xdca3=['code','message','Migration,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c0dcd,_0x1975b0){var _0x13da9c=function(_0x344698){while(--_0x344698){_0x1c0dcd['push'](_0x1c0dcd['shift']());}};_0x13da9c(++_0x1975b0);}(_0xdca3,0x64));var _0x3dca=function(_0x3bd138,_0x244943){_0x3bd138=_0x3bd138-0x0;var _0x250080=_0xdca3[_0x3bd138];return _0x250080;};'use strict';var _=require(_0x3dca('0x0'));var util=require('util');var moment=require(_0x3dca('0x1'));var BPromise=require(_0x3dca('0x2'));var rs=require(_0x3dca('0x3'));var fs=require('fs');var Redis=require(_0x3dca('0x4'));var db=require(_0x3dca('0x5'))['db'];var utils=require(_0x3dca('0x6'));var logger=require(_0x3dca('0x7'))(_0x3dca('0x8'));var config=require(_0x3dca('0x9'));var jayson=require(_0x3dca('0xa'));var client=jayson[_0x3dca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4234a1,_0x5d52c3,_0x57264a){return new BPromise(function(_0xdea879,_0x576218){return client[_0x3dca('0xc')](_0x4234a1,_0x57264a)[_0x3dca('0xd')](function(_0x123b66){logger[_0x3dca('0xe')]('Migration,\x20%s,\x20%s',_0x5d52c3,_0x3dca('0xf'));logger[_0x3dca('0x10')](_0x3dca('0x11'),_0x5d52c3,_0x3dca('0xf'),JSON[_0x3dca('0x12')](_0x123b66));if(_0x123b66[_0x3dca('0x13')]){if(_0x123b66['error'][_0x3dca('0x14')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x5d52c3,_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);return _0x576218(_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);}logger[_0x3dca('0x13')](_0x3dca('0x16'),_0x5d52c3,_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);return _0xdea879(_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);}else{logger[_0x3dca('0xe')](_0x3dca('0x16'),_0x5d52c3,_0x3dca('0xf'));_0xdea879(_0x123b66['result']['message']);}})[_0x3dca('0x17')](function(_0xb5b508){logger[_0x3dca('0x13')](_0x3dca('0x16'),_0x5d52c3,_0xb5b508);_0x576218(_0xb5b508);});});} \ No newline at end of file +var _0x3189=['../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x52c536,_0x26689a){var _0x17e2e9=function(_0x449100){while(--_0x449100){_0x52c536['push'](_0x52c536['shift']());}};_0x17e2e9(++_0x26689a);}(_0x3189,0xae));var _0x9318=function(_0x450eab,_0x4e6ae4){_0x450eab=_0x450eab-0x0;var _0x4859b8=_0x3189[_0x450eab];return _0x4859b8;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var moment=require('moment');var BPromise=require(_0x9318('0x2'));var rs=require(_0x9318('0x3'));var fs=require('fs');var Redis=require(_0x9318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9318('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9318('0x6'));var jayson=require(_0x9318('0x7'));var client=jayson['client'][_0x9318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bb3c3,_0x4dbe95,_0x2f6831){return new BPromise(function(_0x324307,_0x1bfed6){return client['request'](_0x4bb3c3,_0x2f6831)[_0x9318('0x9')](function(_0x2e8d1c){logger[_0x9318('0xa')](_0x9318('0xb'),_0x4dbe95,'request\x20sent');logger['debug'](_0x9318('0xc'),_0x4dbe95,'request\x20sent',JSON[_0x9318('0xd')](_0x2e8d1c));if(_0x2e8d1c[_0x9318('0xe')]){if(_0x2e8d1c[_0x9318('0xe')]['code']===0x1f4){logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c['error'][_0x9318('0xf')]);return _0x1bfed6(_0x2e8d1c['error'][_0x9318('0xf')]);}logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c[_0x9318('0xe')][_0x9318('0xf')]);return _0x324307(_0x2e8d1c[_0x9318('0xe')]['message']);}else{logger['info'](_0x9318('0xb'),_0x4dbe95,_0x9318('0x10'));_0x324307(_0x2e8d1c['result'][_0x9318('0xf')]);}})[_0x9318('0x11')](function(_0x5e1238){logger[_0x9318('0xe')](_0x9318('0xb'),_0x4dbe95,_0x5e1238);_0x1bfed6(_0x5e1238);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index a9c0ea7..b436d99 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 _0x7b77=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x876ede,_0x41acdb){var _0x4f9e39=function(_0x20f2a0){while(--_0x20f2a0){_0x876ede['push'](_0x876ede['shift']());}};_0x4f9e39(++_0x41acdb);}(_0x7b77,0x179));var _0x77b7=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x7b77[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var path=require(_0x77b7('0x2'));var timeout=require(_0x77b7('0x3'));var express=require('express');var router=express[_0x77b7('0x4')]();var fs_extra=require(_0x77b7('0x5'));var auth=require(_0x77b7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x77b7('0x7'));var controller=require(_0x77b7('0x8'));router[_0x77b7('0x9')]('/',auth[_0x77b7('0xa')](),controller[_0x77b7('0xb')]);router[_0x77b7('0x9')]('/:id',auth[_0x77b7('0xa')](),controller[_0x77b7('0xc')]);router[_0x77b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x77b7('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x77b7('0xf')]);router[_0x77b7('0x10')]('/:id',auth[_0x77b7('0xa')](),controller[_0x77b7('0x11')]);module[_0x77b7('0x12')]=router; \ No newline at end of file +var _0xe797=['./network.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe6ba3b,_0x58e953){var _0x19adbe=function(_0x3ec442){while(--_0x3ec442){_0xe6ba3b['push'](_0xe6ba3b['shift']());}};_0x19adbe(++_0x58e953);}(_0xe797,0x12a));var _0x7e79=function(_0x345736,_0x3817c2){_0x345736=_0x345736-0x0;var _0x36ca70=_0xe797[_0x345736];return _0x36ca70;};'use strict';var multer=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var path=require(_0x7e79('0x2'));var timeout=require(_0x7e79('0x3'));var express=require(_0x7e79('0x4'));var router=express[_0x7e79('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7e79('0x6'));var interaction=require(_0x7e79('0x7'));var config=require('../../config/environment');var controller=require(_0x7e79('0x8'));router[_0x7e79('0x9')]('/',auth[_0x7e79('0xa')](),controller['index']);router['get'](_0x7e79('0xb'),auth[_0x7e79('0xa')](),controller['show']);router['post']('/',auth[_0x7e79('0xa')](),controller[_0x7e79('0xc')]);router[_0x7e79('0xd')]('/:id',auth[_0x7e79('0xa')](),controller[_0x7e79('0xe')]);router[_0x7e79('0xf')](_0x7e79('0xb'),auth[_0x7e79('0xa')](),controller[_0x7e79('0x10')]);module[_0x7e79('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 2856be1..25c0df2 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 _0x033a=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0x388b56,_0x447c34){var _0x1f0d4c=function(_0x2d26e3){while(--_0x2d26e3){_0x388b56['push'](_0x388b56['shift']());}};_0x1f0d4c(++_0x447c34);}(_0x033a,0x14b));var _0xa033=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0x033a[_0x430f44];return _0x1f6b0f;};'use strict';var Sequelize=require(_0xa033('0x0'));module[_0xa033('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa033('0x2'),'externip',_0xa033('0x3'),_0xa033('0x4'))},'value':{'type':Sequelize[_0xa033('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa033('0x5')]}}; \ No newline at end of file +var _0x0cc5=['externip','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0cc5,0xd5));var _0x50cc=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x0cc5[_0xf91841];return _0x4b9c44;};'use strict';var Sequelize=require(_0x50cc('0x0'));module[_0x50cc('0x1')]={'type':{'type':Sequelize[_0x50cc('0x2')](_0x50cc('0x3'),_0x50cc('0x4'),'stun',_0x50cc('0x5'))},'value':{'type':Sequelize[_0x50cc('0x6')]},'username':{'type':Sequelize[_0x50cc('0x6')]},'password':{'type':Sequelize[_0x50cc('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index bf64585..dac07e9 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 _0xa7b7=['../../mysqldb','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','json','offset','undefined','limit','count','status','Content-Range','update','end','sendStatus','stack','name','send','Network','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','show','params','length','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','res_stun_monitor.so','TURN','chan_sip.so','destroy','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x1f9364,_0x203cbd){var _0x3b63a3=function(_0xa440bf){while(--_0xa440bf){_0x1f9364['push'](_0x1f9364['shift']());}};_0x3b63a3(++_0x203cbd);}(_0xa7b7,0xf8));var _0x7a7b=function(_0x156430,_0x4165d4){_0x156430=_0x156430-0x0;var _0x536d73=_0xa7b7[_0x156430];return _0x536d73;};'use strict';var util=require(_0x7a7b('0x0'));var path=require(_0x7a7b('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a7b('0x2'));var qs=require(_0x7a7b('0x3'));var logger=require(_0x7a7b('0x4'))(_0x7a7b('0x5'));var config=require(_0x7a7b('0x6'));var db=require(_0x7a7b('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7a7b('0x8')][_0x7a7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53263c,_0x36f5ea,_0x5ca9e5,_0x35b316){return new Promise(function(_0x1a1d70,_0x8f5bf5){var _0x42aa8a=_0x35b316||client;return _0x42aa8a['request'](_0x53263c,_0x5ca9e5)[_0x7a7b('0xa')](function(_0x24af0b){logger['info'](_0x7a7b('0xb'),_0x36f5ea,_0x7a7b('0xc'));logger[_0x7a7b('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x36f5ea,_0x7a7b('0xc'),JSON[_0x7a7b('0xe')](_0x24af0b));if(_0x24af0b[_0x7a7b('0xf')]){if(_0x24af0b[_0x7a7b('0xf')][_0x7a7b('0x10')]===0x1f4){logger['error'](_0x7a7b('0xb'),_0x36f5ea,_0x24af0b['error'][_0x7a7b('0x11')]);return _0x8f5bf5(_0x24af0b[_0x7a7b('0xf')]['message']);}logger[_0x7a7b('0xf')](_0x7a7b('0xb'),_0x36f5ea,_0x24af0b['error'][_0x7a7b('0x11')]);return _0x1a1d70(_0x24af0b[_0x7a7b('0xf')][_0x7a7b('0x11')]);}else{logger[_0x7a7b('0x12')]('Network,\x20%s,\x20%s',_0x36f5ea,'request\x20sent');_0x1a1d70(_0x24af0b[_0x7a7b('0x13')][_0x7a7b('0x11')]);}})[_0x7a7b('0x14')](function(_0x50e52a){logger[_0x7a7b('0xf')](_0x7a7b('0xb'),_0x36f5ea,_0x50e52a);_0x8f5bf5(_0x50e52a);});});}function respondWithResult(_0xcdd838,_0x40fecf){_0x40fecf=_0x40fecf||0xc8;return function(_0x440537){if(_0x440537){return _0xcdd838['status'](_0x40fecf)[_0x7a7b('0x15')](_0x440537);}};}function respondWithFilteredResult(_0x4f0d67,_0x2c5592){return function(_0x2feb84){if(_0x2feb84){var _0x5d14b8=typeof _0x2c5592[_0x7a7b('0x16')]===_0x7a7b('0x17')&&typeof _0x2c5592[_0x7a7b('0x18')]===_0x7a7b('0x17');var _0x507acc=_0x2feb84[_0x7a7b('0x19')];var _0x342864=_0x5d14b8?0x0:_0x2c5592['offset'];var _0x5a37c4=_0x5d14b8?_0x2feb84[_0x7a7b('0x19')]:_0x2c5592[_0x7a7b('0x16')]+_0x2c5592[_0x7a7b('0x18')];var _0x198631;if(_0x5a37c4>=_0x507acc){_0x5a37c4=_0x507acc;_0x198631=0xc8;}else{_0x198631=0xce;}_0x4f0d67[_0x7a7b('0x1a')](_0x198631);return _0x4f0d67['set'](_0x7a7b('0x1b'),_0x342864+'-'+_0x5a37c4+'/'+_0x507acc)[_0x7a7b('0x15')](_0x2feb84);}return null;};}function saveUpdates(_0x4abf28){return function(_0x1e69aa){if(_0x1e69aa){return _0x1e69aa[_0x7a7b('0x1c')](_0x4abf28)[_0x7a7b('0xa')](function(_0x2dfed0){return _0x2dfed0;});}return null;};}function removeEntity(_0x308ad0){return function(_0x42099f){if(_0x42099f){return _0x42099f['destroy']()[_0x7a7b('0xa')](function(){_0x308ad0[_0x7a7b('0x1a')](0xcc)[_0x7a7b('0x1d')]();});}};}function handleEntityNotFound(_0x55c199){return function(_0x12ab58){if(!_0x12ab58){_0x55c199[_0x7a7b('0x1e')](0x194);}return _0x12ab58;};}function handleError(_0x54af9e,_0x4e28ef){_0x4e28ef=_0x4e28ef||0x1f4;return function(_0x653e5a){logger[_0x7a7b('0xf')](_0x653e5a[_0x7a7b('0x1f')]);if(_0x653e5a[_0x7a7b('0x20')]){delete _0x653e5a[_0x7a7b('0x20')];}_0x54af9e[_0x7a7b('0x1a')](_0x4e28ef)[_0x7a7b('0x21')](_0x653e5a);};}exports['index']=function(_0x519bb5,_0x5d7a6c){var _0x56d690={},_0xfaa8b0={},_0x2b20b9={'count':0x0,'rows':[]};var _0x163899=_['map'](db[_0x7a7b('0x22')][_0x7a7b('0x23')],function(_0x502b1b){return{'name':_0x502b1b[_0x7a7b('0x24')],'type':_0x502b1b[_0x7a7b('0x25')][_0x7a7b('0x26')]};});_0xfaa8b0[_0x7a7b('0x27')]=_[_0x7a7b('0x28')](_0x163899,'name');_0xfaa8b0[_0x7a7b('0x29')]=_[_0x7a7b('0x2a')](_0x519bb5[_0x7a7b('0x29')]);_0xfaa8b0[_0x7a7b('0x2b')]=_[_0x7a7b('0x2c')](_0xfaa8b0['model'],_0xfaa8b0[_0x7a7b('0x29')]);_0x56d690[_0x7a7b('0x2d')]=_[_0x7a7b('0x2c')](_0xfaa8b0[_0x7a7b('0x27')],qs['fields'](_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x2e')]));_0x56d690[_0x7a7b('0x2d')]=_0x56d690['attributes']['length']?_0x56d690['attributes']:_0xfaa8b0[_0x7a7b('0x27')];if(!_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x2f')]('nolimit')){_0x56d690[_0x7a7b('0x18')]=qs[_0x7a7b('0x18')](_0x519bb5[_0x7a7b('0x29')]['limit']);_0x56d690[_0x7a7b('0x16')]=qs['offset'](_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x16')]);}_0x56d690[_0x7a7b('0x30')]=qs[_0x7a7b('0x31')](_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x31')]);_0x56d690['where']=qs[_0x7a7b('0x2b')](_[_0x7a7b('0x32')](_0x519bb5[_0x7a7b('0x29')],_0xfaa8b0[_0x7a7b('0x2b')]),_0x163899);if(_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x33')]){_0x56d690['where']=_[_0x7a7b('0x34')](_0x56d690[_0x7a7b('0x35')],{'$or':_[_0x7a7b('0x28')](_0x163899,function(_0x15eca4){if(_0x15eca4[_0x7a7b('0x25')]!==_0x7a7b('0x36')){var _0xd34ec2={};_0xd34ec2[_0x15eca4[_0x7a7b('0x20')]]={'$like':'%'+_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x33')]+'%'};return _0xd34ec2;}})});}_0x56d690=_[_0x7a7b('0x34')]({},_0x56d690,_0x519bb5['options']);var _0x3bdacd={'where':_0x56d690[_0x7a7b('0x35')]};return db[_0x7a7b('0x22')][_0x7a7b('0x19')](_0x3bdacd)[_0x7a7b('0xa')](function(_0x4d9e87){_0x2b20b9['count']=_0x4d9e87;if(_0x519bb5[_0x7a7b('0x29')][_0x7a7b('0x37')]){_0x56d690[_0x7a7b('0x38')]=[{'all':!![]}];}return db[_0x7a7b('0x22')][_0x7a7b('0x39')](_0x56d690);})[_0x7a7b('0xa')](function(_0x1935f6){_0x2b20b9['rows']=_0x1935f6;return _0x2b20b9;})[_0x7a7b('0xa')](respondWithFilteredResult(_0x5d7a6c,_0x56d690))[_0x7a7b('0x14')](handleError(_0x5d7a6c,null));};exports[_0x7a7b('0x3a')]=function(_0xdf987d,_0x4ff1e4){var _0x1e5625={'raw':!![],'where':{'id':_0xdf987d[_0x7a7b('0x3b')]['id']}},_0x1a51db={};_0x1a51db[_0x7a7b('0x27')]=_[_0x7a7b('0x2a')](db[_0x7a7b('0x22')]['rawAttributes']);_0x1a51db[_0x7a7b('0x29')]=_[_0x7a7b('0x2a')](_0xdf987d[_0x7a7b('0x29')]);_0x1a51db[_0x7a7b('0x2b')]=_[_0x7a7b('0x2c')](_0x1a51db['model'],_0x1a51db[_0x7a7b('0x29')]);_0x1e5625[_0x7a7b('0x2d')]=_[_0x7a7b('0x2c')](_0x1a51db[_0x7a7b('0x27')],qs[_0x7a7b('0x2e')](_0xdf987d[_0x7a7b('0x29')]['fields']));_0x1e5625['attributes']=_0x1e5625[_0x7a7b('0x2d')][_0x7a7b('0x3c')]?_0x1e5625[_0x7a7b('0x2d')]:_0x1a51db[_0x7a7b('0x27')];if(_0xdf987d[_0x7a7b('0x29')][_0x7a7b('0x37')]){_0x1e5625[_0x7a7b('0x38')]=[{'all':!![]}];}_0x1e5625=_[_0x7a7b('0x34')]({},_0x1e5625,_0xdf987d[_0x7a7b('0x3d')]);return db[_0x7a7b('0x22')][_0x7a7b('0x3e')](_0x1e5625)[_0x7a7b('0xa')](handleEntityNotFound(_0x4ff1e4,null))[_0x7a7b('0xa')](respondWithResult(_0x4ff1e4,null))['catch'](handleError(_0x4ff1e4,null));};exports[_0x7a7b('0x3f')]=function(_0x15394d,_0xf6cf0a){var _0x4aa2fc;return db[_0x7a7b('0x22')]['create'](_0x15394d['body'],{'raw':!![]})['then'](function(_0x26fdfa){_0x4aa2fc=_0x26fdfa;return db[_0x7a7b('0x22')][_0x7a7b('0x39')]({'where':{'type':_0x15394d[_0x7a7b('0x40')]['type']},'raw':!![]});})[_0x7a7b('0xa')](function(_0x2359ab){if(_0x4aa2fc[_0x7a7b('0x25')][_0x7a7b('0x41')]()==_0x7a7b('0x42')){var _0x21e5bb=fs[_0x7a7b('0x43')](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],'server/files/templates/stun_multiple.ejs'),_0x7a7b('0x46'));var _0x4302a3=ejs[_0x7a7b('0x47')](_0x21e5bb,{'networks':_0x2359ab||[]});fs[_0x7a7b('0x48')](_0x7a7b('0x49'),_0x4302a3);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x3f'),{'module':'res_stun_monitor.so'});}else if(_0x4aa2fc[_0x7a7b('0x25')][_0x7a7b('0x41')]()=='TURN'){var _0x21f9fb=fs[_0x7a7b('0x43')](path[_0x7a7b('0x44')](config['root'],_0x7a7b('0x4b')),_0x7a7b('0x46'));var _0x2641ca=ejs['render'](_0x21f9fb,{'networks':_0x2359ab||[]});fs[_0x7a7b('0x48')](_0x7a7b('0x4c'),_0x2641ca);return respondWithRpcPromise(_0x7a7b('0x4a'),'create',{'module':'res_stun_monitor.so'});}else{var _0x35e9e3=fs[_0x7a7b('0x43')](path['join'](config[_0x7a7b('0x45')],_0x7a7b('0x4d')),_0x7a7b('0x46'));var _0x18dfe5=ejs[_0x7a7b('0x47')](_0x35e9e3,{'networks':_0x2359ab||[]});fs[_0x7a7b('0x48')](util[_0x7a7b('0x4e')](_0x7a7b('0x4f'),_0x15394d['body'][_0x7a7b('0x25')][_0x7a7b('0x50')]()),_0x18dfe5);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x3f'),{'module':'chan_sip.so'});}})[_0x7a7b('0xa')](function(){return _0x4aa2fc;})[_0x7a7b('0xa')](respondWithResult(_0xf6cf0a,0xc9))[_0x7a7b('0x14')](handleError(_0xf6cf0a,null));};exports['update']=function(_0x456ecc,_0x33e4d0){var _0x1234b1;return db['Network']['find']({'where':{'id':_0x456ecc[_0x7a7b('0x3b')]['id']}})[_0x7a7b('0xa')](handleEntityNotFound(_0x33e4d0,null))[_0x7a7b('0xa')](saveUpdates(_0x456ecc[_0x7a7b('0x40')],null))[_0x7a7b('0xa')](function(_0xf06d5f){if(_0xf06d5f){_0x1234b1=_0xf06d5f;return db['Network'][_0x7a7b('0x39')]({'where':{'type':_0x1234b1[_0x7a7b('0x25')]},'raw':!![]});}return null;})[_0x7a7b('0xa')](function(_0x2d6a5a){if(_0x1234b1[_0x7a7b('0x25')][_0x7a7b('0x41')]()==_0x7a7b('0x42')){var _0x3a65ef=fs['readFileSync'](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],'server/files/templates/stun_multiple.ejs'),_0x7a7b('0x46'));var _0x4e125d=ejs[_0x7a7b('0x47')](_0x3a65ef,{'networks':_0x2d6a5a||[]});fs[_0x7a7b('0x48')]('/etc/asterisk/stun_xcally.conf',_0x4e125d);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x1c'),{'module':_0x7a7b('0x51')});}else if(_0x1234b1['type'][_0x7a7b('0x41')]()==_0x7a7b('0x52')){var _0x5dc944=fs[_0x7a7b('0x43')](path['join'](config['root'],_0x7a7b('0x4b')),'utf8');var _0x71437e=ejs[_0x7a7b('0x47')](_0x5dc944,{'networks':_0x2d6a5a||[]});fs[_0x7a7b('0x48')](_0x7a7b('0x4c'),_0x71437e);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x1c'),{'module':_0x7a7b('0x51')});}else{var _0x46fc49=fs['readFileSync'](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],_0x7a7b('0x4d')),_0x7a7b('0x46'));var _0x2470c9=ejs[_0x7a7b('0x47')](_0x46fc49,{'networks':_0x2d6a5a||[]});fs['writeFileSync'](util[_0x7a7b('0x4e')](_0x7a7b('0x4f'),_0x456ecc[_0x7a7b('0x40')][_0x7a7b('0x25')][_0x7a7b('0x50')]()),_0x2470c9);return respondWithRpcPromise('Reload',_0x7a7b('0x1c'),{'module':_0x7a7b('0x53')});}})[_0x7a7b('0xa')](function(_0x5b3431){if(_0x5b3431){return _0x1234b1;}return null;})[_0x7a7b('0xa')](respondWithResult(_0x33e4d0,null))[_0x7a7b('0x14')](handleError(_0x33e4d0,null));};exports[_0x7a7b('0x54')]=function(_0x574aa3,_0x1b6fdb){var _0x3f0395;return db[_0x7a7b('0x22')][_0x7a7b('0x3e')]({'where':{'id':_0x574aa3['params']['id']}})['then'](function(_0x2cfbac){_0x3f0395=_0x2cfbac;return _0x2cfbac;})[_0x7a7b('0xa')](handleEntityNotFound(_0x1b6fdb,null))['then'](removeEntity(_0x1b6fdb,null))['then'](function(){if(_0x3f0395){return db[_0x7a7b('0x22')][_0x7a7b('0x39')]({'where':{'type':_0x3f0395[_0x7a7b('0x25')]},'raw':!![]});}})[_0x7a7b('0xa')](function(_0x3cf57b){if(_0x3f0395['type'][_0x7a7b('0x41')]()==_0x7a7b('0x42')){var _0x1f0505=fs['readFileSync'](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],'server/files/templates/stun_multiple.ejs'),_0x7a7b('0x46'));var _0x4b1b85=ejs[_0x7a7b('0x47')](_0x1f0505,{'networks':_0x3cf57b||[]});fs[_0x7a7b('0x48')](_0x7a7b('0x49'),_0x4b1b85);return respondWithRpcPromise('Reload','destroy',{'module':_0x7a7b('0x51')});}else if(_0x3f0395[_0x7a7b('0x25')][_0x7a7b('0x41')]()=='TURN'){var _0x165449=fs[_0x7a7b('0x43')](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],_0x7a7b('0x4b')),'utf8');var _0x86355=ejs[_0x7a7b('0x47')](_0x165449,{'networks':_0x3cf57b||[]});fs[_0x7a7b('0x48')](_0x7a7b('0x4c'),_0x86355);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x54'),{'module':'res_stun_monitor.so'});}else{var _0x158420=fs[_0x7a7b('0x43')](path[_0x7a7b('0x44')](config[_0x7a7b('0x45')],_0x7a7b('0x4d')),_0x7a7b('0x46'));var _0x48bbab=ejs['render'](_0x158420,{'networks':_0x3cf57b||[]});fs[_0x7a7b('0x48')](util[_0x7a7b('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x3f0395['type']['toLowerCase']()),_0x48bbab);return respondWithRpcPromise(_0x7a7b('0x4a'),_0x7a7b('0x54'),{'module':_0x7a7b('0x53')});}})[_0x7a7b('0x14')](handleError(_0x1b6fdb,null));}; \ No newline at end of file +var _0xe825=['undefined','limit','count','set','update','then','destroy','end','sendStatus','name','index','map','Network','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','show','params','options','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','catch','status','json','offset'];(function(_0x57b804,_0x2eb3b1){var _0x8b6d8=function(_0x1bca0a){while(--_0x1bca0a){_0x57b804['push'](_0x57b804['shift']());}};_0x8b6d8(++_0x2eb3b1);}(_0xe825,0x1cf));var _0x5e82=function(_0x8e971e,_0xd060a7){_0x8e971e=_0x8e971e-0x0;var _0x52228c=_0xe825[_0x8e971e];return _0x52228c;};'use strict';var util=require(_0x5e82('0x0'));var path=require(_0x5e82('0x1'));var ejs=require(_0x5e82('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x5e82('0x3'));var logger=require(_0x5e82('0x4'))(_0x5e82('0x5'));var config=require(_0x5e82('0x6'));var db=require(_0x5e82('0x7'))['db'];var jayson=require(_0x5e82('0x8'));var client=jayson['client'][_0x5e82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa7b39f,_0xb9a05f,_0x1b7f20,_0x46d9b5){return new Promise(function(_0x32a7de,_0x2648d9){var _0x5e57fe=_0x46d9b5||client;return _0x5e57fe['request'](_0xa7b39f,_0x1b7f20)['then'](function(_0x4cb9bc){logger[_0x5e82('0xa')]('Network,\x20%s,\x20%s',_0xb9a05f,'request\x20sent');logger[_0x5e82('0xb')](_0x5e82('0xc'),_0xb9a05f,_0x5e82('0xd'),JSON[_0x5e82('0xe')](_0x4cb9bc));if(_0x4cb9bc[_0x5e82('0xf')]){if(_0x4cb9bc[_0x5e82('0xf')][_0x5e82('0x10')]===0x1f4){logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x4cb9bc[_0x5e82('0xf')]['message']);return _0x2648d9(_0x4cb9bc['error'][_0x5e82('0x12')]);}logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x4cb9bc[_0x5e82('0xf')][_0x5e82('0x12')]);return _0x32a7de(_0x4cb9bc['error'][_0x5e82('0x12')]);}else{logger[_0x5e82('0xa')]('Network,\x20%s,\x20%s',_0xb9a05f,'request\x20sent');_0x32a7de(_0x4cb9bc['result']['message']);}})[_0x5e82('0x13')](function(_0x5f22df){logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x5f22df);_0x2648d9(_0x5f22df);});});}function respondWithResult(_0x2ad5d3,_0x1d7248){_0x1d7248=_0x1d7248||0xc8;return function(_0x1f5c82){if(_0x1f5c82){return _0x2ad5d3[_0x5e82('0x14')](_0x1d7248)[_0x5e82('0x15')](_0x1f5c82);}};}function respondWithFilteredResult(_0x4de248,_0x4153b0){return function(_0x3ea237){if(_0x3ea237){var _0x2d74ae=typeof _0x4153b0[_0x5e82('0x16')]===_0x5e82('0x17')&&typeof _0x4153b0[_0x5e82('0x18')]===_0x5e82('0x17');var _0x4c0651=_0x3ea237[_0x5e82('0x19')];var _0x48d70b=_0x2d74ae?0x0:_0x4153b0[_0x5e82('0x16')];var _0x55d94f=_0x2d74ae?_0x3ea237[_0x5e82('0x19')]:_0x4153b0[_0x5e82('0x16')]+_0x4153b0['limit'];var _0x3a5a1b;if(_0x55d94f>=_0x4c0651){_0x55d94f=_0x4c0651;_0x3a5a1b=0xc8;}else{_0x3a5a1b=0xce;}_0x4de248[_0x5e82('0x14')](_0x3a5a1b);return _0x4de248[_0x5e82('0x1a')]('Content-Range',_0x48d70b+'-'+_0x55d94f+'/'+_0x4c0651)[_0x5e82('0x15')](_0x3ea237);}return null;};}function saveUpdates(_0x169fb7){return function(_0xc8182e){if(_0xc8182e){return _0xc8182e[_0x5e82('0x1b')](_0x169fb7)[_0x5e82('0x1c')](function(_0x4b748c){return _0x4b748c;});}return null;};}function removeEntity(_0x5e6a5e){return function(_0x3baca2){if(_0x3baca2){return _0x3baca2[_0x5e82('0x1d')]()['then'](function(){_0x5e6a5e[_0x5e82('0x14')](0xcc)[_0x5e82('0x1e')]();});}};}function handleEntityNotFound(_0x37049c){return function(_0x3798a9){if(!_0x3798a9){_0x37049c[_0x5e82('0x1f')](0x194);}return _0x3798a9;};}function handleError(_0x5eccc0,_0x70b09a){_0x70b09a=_0x70b09a||0x1f4;return function(_0x447a8a){logger[_0x5e82('0xf')](_0x447a8a['stack']);if(_0x447a8a[_0x5e82('0x20')]){delete _0x447a8a[_0x5e82('0x20')];}_0x5eccc0['status'](_0x70b09a)['send'](_0x447a8a);};}exports[_0x5e82('0x21')]=function(_0x4fd736,_0x501e88){var _0x58e4af={},_0x114c9b={},_0xd83e9a={'count':0x0,'rows':[]};var _0x56f373=_[_0x5e82('0x22')](db[_0x5e82('0x23')][_0x5e82('0x24')],function(_0x4ec133){return{'name':_0x4ec133[_0x5e82('0x25')],'type':_0x4ec133[_0x5e82('0x26')]['key']};});_0x114c9b[_0x5e82('0x27')]=_['map'](_0x56f373,_0x5e82('0x20'));_0x114c9b['query']=_[_0x5e82('0x28')](_0x4fd736['query']);_0x114c9b[_0x5e82('0x29')]=_[_0x5e82('0x2a')](_0x114c9b[_0x5e82('0x27')],_0x114c9b[_0x5e82('0x2b')]);_0x58e4af['attributes']=_[_0x5e82('0x2a')](_0x114c9b[_0x5e82('0x27')],qs[_0x5e82('0x2c')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x2c')]));_0x58e4af[_0x5e82('0x2d')]=_0x58e4af['attributes'][_0x5e82('0x2e')]?_0x58e4af[_0x5e82('0x2d')]:_0x114c9b[_0x5e82('0x27')];if(!_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x2f')]('nolimit')){_0x58e4af[_0x5e82('0x18')]=qs['limit'](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x18')]);_0x58e4af[_0x5e82('0x16')]=qs[_0x5e82('0x16')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x16')]);}_0x58e4af[_0x5e82('0x30')]=qs[_0x5e82('0x31')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x31')]);_0x58e4af['where']=qs['filters'](_['pick'](_0x4fd736[_0x5e82('0x2b')],_0x114c9b[_0x5e82('0x29')]),_0x56f373);if(_0x4fd736['query'][_0x5e82('0x32')]){_0x58e4af[_0x5e82('0x33')]=_['merge'](_0x58e4af[_0x5e82('0x33')],{'$or':_[_0x5e82('0x22')](_0x56f373,function(_0xc7d559){if(_0xc7d559[_0x5e82('0x26')]!=='VIRTUAL'){var _0x2feef9={};_0x2feef9[_0xc7d559[_0x5e82('0x20')]]={'$like':'%'+_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x32')]+'%'};return _0x2feef9;}})});}_0x58e4af=_[_0x5e82('0x34')]({},_0x58e4af,_0x4fd736['options']);var _0x47b10d={'where':_0x58e4af[_0x5e82('0x33')]};return db[_0x5e82('0x23')][_0x5e82('0x19')](_0x47b10d)['then'](function(_0x2e732b){_0xd83e9a['count']=_0x2e732b;if(_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x35')]){_0x58e4af[_0x5e82('0x36')]=[{'all':!![]}];}return db[_0x5e82('0x23')][_0x5e82('0x37')](_0x58e4af);})[_0x5e82('0x1c')](function(_0x2c701a){_0xd83e9a['rows']=_0x2c701a;return _0xd83e9a;})['then'](respondWithFilteredResult(_0x501e88,_0x58e4af))[_0x5e82('0x13')](handleError(_0x501e88,null));};exports[_0x5e82('0x38')]=function(_0x464f51,_0x161168){var _0x537b5e={'raw':!![],'where':{'id':_0x464f51[_0x5e82('0x39')]['id']}},_0x598cb5={};_0x598cb5[_0x5e82('0x27')]=_[_0x5e82('0x28')](db[_0x5e82('0x23')][_0x5e82('0x24')]);_0x598cb5[_0x5e82('0x2b')]=_[_0x5e82('0x28')](_0x464f51[_0x5e82('0x2b')]);_0x598cb5[_0x5e82('0x29')]=_[_0x5e82('0x2a')](_0x598cb5['model'],_0x598cb5[_0x5e82('0x2b')]);_0x537b5e[_0x5e82('0x2d')]=_[_0x5e82('0x2a')](_0x598cb5['model'],qs[_0x5e82('0x2c')](_0x464f51[_0x5e82('0x2b')][_0x5e82('0x2c')]));_0x537b5e[_0x5e82('0x2d')]=_0x537b5e[_0x5e82('0x2d')][_0x5e82('0x2e')]?_0x537b5e['attributes']:_0x598cb5['model'];if(_0x464f51['query'][_0x5e82('0x35')]){_0x537b5e[_0x5e82('0x36')]=[{'all':!![]}];}_0x537b5e=_[_0x5e82('0x34')]({},_0x537b5e,_0x464f51[_0x5e82('0x3a')]);return db['Network']['find'](_0x537b5e)[_0x5e82('0x1c')](handleEntityNotFound(_0x161168,null))[_0x5e82('0x1c')](respondWithResult(_0x161168,null))[_0x5e82('0x13')](handleError(_0x161168,null));};exports[_0x5e82('0x3b')]=function(_0x4cf065,_0x5613bf){var _0x2d9560;return db[_0x5e82('0x23')][_0x5e82('0x3b')](_0x4cf065[_0x5e82('0x3c')],{'raw':!![]})['then'](function(_0x1ed83d){_0x2d9560=_0x1ed83d;return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x4cf065[_0x5e82('0x3c')][_0x5e82('0x26')]},'raw':!![]});})[_0x5e82('0x1c')](function(_0x304eda){if(_0x2d9560['type'][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x2a8e47=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x42')),_0x5e82('0x43'));var _0x108ba5=ejs[_0x5e82('0x44')](_0x2a8e47,{'networks':_0x304eda||[]});fs[_0x5e82('0x45')](_0x5e82('0x46'),_0x108ba5);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x3b'),{'module':'res_stun_monitor.so'});}else if(_0x2d9560[_0x5e82('0x26')][_0x5e82('0x3d')]()=='TURN'){var _0x2845e1=fs[_0x5e82('0x3f')](path['join'](config[_0x5e82('0x41')],_0x5e82('0x48')),_0x5e82('0x43'));var _0x19873d=ejs[_0x5e82('0x44')](_0x2845e1,{'networks':_0x304eda||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x19873d);return respondWithRpcPromise('Reload',_0x5e82('0x3b'),{'module':_0x5e82('0x4a')});}else{var _0xdfe02a=fs['readFileSync'](path[_0x5e82('0x40')](config['root'],_0x5e82('0x4b')),_0x5e82('0x43'));var _0x30a82e=ejs[_0x5e82('0x44')](_0xdfe02a,{'networks':_0x304eda||[]});fs['writeFileSync'](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x4cf065[_0x5e82('0x3c')]['type'][_0x5e82('0x4e')]()),_0x30a82e);return respondWithRpcPromise(_0x5e82('0x47'),'create',{'module':_0x5e82('0x4f')});}})[_0x5e82('0x1c')](function(){return _0x2d9560;})[_0x5e82('0x1c')](respondWithResult(_0x5613bf,0xc9))[_0x5e82('0x13')](handleError(_0x5613bf,null));};exports[_0x5e82('0x1b')]=function(_0x902ec5,_0x4c1f9a){var _0x1f9d05;return db[_0x5e82('0x23')]['find']({'where':{'id':_0x902ec5[_0x5e82('0x39')]['id']}})[_0x5e82('0x1c')](handleEntityNotFound(_0x4c1f9a,null))[_0x5e82('0x1c')](saveUpdates(_0x902ec5[_0x5e82('0x3c')],null))['then'](function(_0x5b0c88){if(_0x5b0c88){_0x1f9d05=_0x5b0c88;return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x1f9d05['type']},'raw':!![]});}return null;})[_0x5e82('0x1c')](function(_0x31a78a){if(_0x1f9d05['type'][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x2f36f8=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config['root'],_0x5e82('0x42')),'utf8');var _0x33cd71=ejs[_0x5e82('0x44')](_0x2f36f8,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')]('/etc/asterisk/stun_xcally.conf',_0x33cd71);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1b'),{'module':_0x5e82('0x4a')});}else if(_0x1f9d05['type']['toUpperCase']()==_0x5e82('0x50')){var _0x10680b=fs['readFileSync'](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x48')),'utf8');var _0x21bec1=ejs['render'](_0x10680b,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x21bec1);return respondWithRpcPromise(_0x5e82('0x47'),'update',{'module':_0x5e82('0x4a')});}else{var _0x2ac4a1=fs['readFileSync'](path['join'](config[_0x5e82('0x41')],_0x5e82('0x4b')),_0x5e82('0x43'));var _0x2c46b4=ejs[_0x5e82('0x44')](_0x2ac4a1,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x902ec5[_0x5e82('0x3c')][_0x5e82('0x26')]['toLowerCase']()),_0x2c46b4);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1b'),{'module':_0x5e82('0x4f')});}})[_0x5e82('0x1c')](function(_0x2b025a){if(_0x2b025a){return _0x1f9d05;}return null;})['then'](respondWithResult(_0x4c1f9a,null))['catch'](handleError(_0x4c1f9a,null));};exports[_0x5e82('0x1d')]=function(_0x4a7cca,_0x1cdc4f){var _0x3639b3;return db[_0x5e82('0x23')]['find']({'where':{'id':_0x4a7cca[_0x5e82('0x39')]['id']}})[_0x5e82('0x1c')](function(_0x38bb5b){_0x3639b3=_0x38bb5b;return _0x38bb5b;})[_0x5e82('0x1c')](handleEntityNotFound(_0x1cdc4f,null))[_0x5e82('0x1c')](removeEntity(_0x1cdc4f,null))[_0x5e82('0x1c')](function(){if(_0x3639b3){return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x3639b3[_0x5e82('0x26')]},'raw':!![]});}})['then'](function(_0x4466b2){if(_0x3639b3[_0x5e82('0x26')][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x556a76=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x42')),_0x5e82('0x43'));var _0x1b095e=ejs[_0x5e82('0x44')](_0x556a76,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](_0x5e82('0x46'),_0x1b095e);return respondWithRpcPromise(_0x5e82('0x47'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3639b3[_0x5e82('0x26')][_0x5e82('0x3d')]()==_0x5e82('0x50')){var _0x292098=fs['readFileSync'](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x48')),_0x5e82('0x43'));var _0x3bf3aa=ejs[_0x5e82('0x44')](_0x292098,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x3bf3aa);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1d'),{'module':_0x5e82('0x4a')});}else{var _0x5be0a4=fs[_0x5e82('0x3f')](path['join'](config[_0x5e82('0x41')],'server/files/templates/network.ejs'),_0x5e82('0x43'));var _0x4d324e=ejs[_0x5e82('0x44')](_0x5be0a4,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x3639b3[_0x5e82('0x26')][_0x5e82('0x4e')]()),_0x4d324e);return respondWithRpcPromise(_0x5e82('0x47'),'destroy',{'module':_0x5e82('0x4f')});}})['catch'](handleError(_0x1cdc4f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f5f1fae..e47b520 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 _0xa0bc=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','moment','bluebird'];(function(_0x420b5c,_0x57ad37){var _0x51760b=function(_0xfe381e){while(--_0xfe381e){_0x420b5c['push'](_0x420b5c['shift']());}};_0x51760b(++_0x57ad37);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a24=['util','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','network','lodash'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x6a24,0xd1));var _0x46a2=function(_0x45a237,_0x16e04f){_0x45a237=_0x45a237-0x0;var _0x48b798=_0x6a24[_0x45a237];return _0x48b798;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('Network',attributes,{'tableName':_0x46a2('0x9'),'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 a7f4014..5322789 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cfbc4,_0xb63f18){var _0x1fd580=function(_0x112bcc){while(--_0x112bcc){_0x5cfbc4['push'](_0x5cfbc4['shift']());}};_0x1fd580(++_0xb63f18);}(_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']('Network,\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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x2fcabd,_0x1191f5){_0x2fcabd=_0x2fcabd-0x0;var _0x21e872=_0x7a54[_0x2fcabd];return _0x21e872;};'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')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 48f1269..0e90d6a 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 _0x411a=['/:id/applications','getApplications','/:id/interactions','post','create','/:id/notify','notify','/:id/users','send','put','update','delete','/:id','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x3a1565,_0x176cd8){var _0xc4cb70=function(_0x38cd6f){while(--_0x38cd6f){_0x3a1565['push'](_0x3a1565['shift']());}};_0xc4cb70(++_0x176cd8);}(_0x411a,0xf6));var _0xa411=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x411a[_0xf4666e];return _0x1853f1;};'use strict';var multer=require(_0xa411('0x0'));var util=require(_0xa411('0x1'));var path=require(_0xa411('0x2'));var timeout=require(_0xa411('0x3'));var express=require(_0xa411('0x4'));var router=express[_0xa411('0x5')]();var fs_extra=require(_0xa411('0x6'));var auth=require(_0xa411('0x7'));var interaction=require(_0xa411('0x8'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xa411('0x9')]('/',auth[_0xa411('0xa')](),controller[_0xa411('0xb')]);router[_0xa411('0x9')](_0xa411('0xc'),auth['isAuthenticated'](),controller[_0xa411('0xd')]);router['get']('/:id',auth[_0xa411('0xa')](),controller[_0xa411('0xe')]);router[_0xa411('0x9')](_0xa411('0xf'),auth[_0xa411('0xa')](),controller[_0xa411('0x10')]);router['get'](_0xa411('0x11'),auth[_0xa411('0xa')](),controller['getAnswers']);router[_0xa411('0x9')](_0xa411('0x12'),auth[_0xa411('0xa')](),controller[_0xa411('0x13')]);router[_0xa411('0x9')](_0xa411('0x14'),auth[_0xa411('0xa')](),controller['getInteractions']);router[_0xa411('0x9')]('/:id/users',auth[_0xa411('0xa')](),controller['getAgents']);router[_0xa411('0x15')]('/',auth[_0xa411('0xa')](),controller[_0xa411('0x16')]);router[_0xa411('0x15')](_0xa411('0xf'),auth[_0xa411('0xa')](),controller['addDisposition']);router[_0xa411('0x15')](_0xa411('0x11'),auth[_0xa411('0xa')](),controller['addAnswer']);router[_0xa411('0x15')](_0xa411('0x17'),controller[_0xa411('0x18')]);router['post']('/:id/applications',auth[_0xa411('0xa')](),controller['addApplications']);router[_0xa411('0x15')](_0xa411('0x19'),auth[_0xa411('0xa')](),controller['addAgents']);router[_0xa411('0x15')]('/:id/send',auth[_0xa411('0xa')](),controller[_0xa411('0x1a')]);router[_0xa411('0x1b')]('/:id',auth[_0xa411('0xa')](),controller[_0xa411('0x1c')]);router[_0xa411('0x1d')](_0xa411('0x1e'),auth['isAuthenticated'](),controller['destroy']);router[_0xa411('0x1d')](_0xa411('0xf'),auth[_0xa411('0xa')](),controller[_0xa411('0x1f')]);router[_0xa411('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xa411('0x1d')](_0xa411('0x19'),auth[_0xa411('0xa')](),controller['removeAgents']);module[_0xa411('0x20')]=router; \ No newline at end of file +var _0x94ad=['/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','notify','addApplications','addAgents','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x530f5d,_0x35df7f){var _0x2c1900=function(_0x14ea32){while(--_0x14ea32){_0x530f5d['push'](_0x530f5d['shift']());}};_0x2c1900(++_0x35df7f);}(_0x94ad,0x115));var _0xd94a=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x94ad[_0x49d41c];return _0xb64c5f;};'use strict';var multer=require(_0xd94a('0x0'));var util=require(_0xd94a('0x1'));var path=require(_0xd94a('0x2'));var timeout=require(_0xd94a('0x3'));var express=require(_0xd94a('0x4'));var router=express[_0xd94a('0x5')]();var fs_extra=require(_0xd94a('0x6'));var auth=require(_0xd94a('0x7'));var interaction=require(_0xd94a('0x8'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xd94a('0x9')]('/',auth[_0xd94a('0xa')](),controller['index']);router[_0xd94a('0x9')](_0xd94a('0xb'),auth['isAuthenticated'](),controller[_0xd94a('0xc')]);router[_0xd94a('0x9')](_0xd94a('0xd'),auth['isAuthenticated'](),controller[_0xd94a('0xe')]);router[_0xd94a('0x9')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x10')]);router[_0xd94a('0x9')](_0xd94a('0x11'),auth['isAuthenticated'](),controller[_0xd94a('0x12')]);router[_0xd94a('0x9')](_0xd94a('0x13'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x14')]);router[_0xd94a('0x9')](_0xd94a('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xd94a('0x9')](_0xd94a('0x16'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x17')]);router[_0xd94a('0x18')]('/',auth[_0xd94a('0xa')](),controller[_0xd94a('0x19')]);router[_0xd94a('0x18')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1a')]);router[_0xd94a('0x18')](_0xd94a('0x11'),auth[_0xd94a('0xa')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0xd94a('0x1b')]);router['post'](_0xd94a('0x13'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1c')]);router[_0xd94a('0x18')](_0xd94a('0x16'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1d')]);router[_0xd94a('0x18')]('/:id/send',auth[_0xd94a('0xa')](),controller[_0xd94a('0x1e')]);router[_0xd94a('0x1f')]('/:id',auth[_0xd94a('0xa')](),controller['update']);router[_0xd94a('0x20')](_0xd94a('0xd'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x21')]);router[_0xd94a('0x20')](_0xd94a('0xf'),auth['isAuthenticated'](),controller[_0xd94a('0x22')]);router[_0xd94a('0x20')](_0xd94a('0x11'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x23')]);router[_0xd94a('0x20')]('/:id/users',auth[_0xd94a('0xa')](),controller[_0xd94a('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3945f3b..5f3220e 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 _0x509d=['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','sequelize','randomstring','exports','STRING'];(function(_0x5e9250,_0x147e30){var _0x369f39=function(_0x580f58){while(--_0x580f58){_0x5e9250['push'](_0x5e9250['shift']());}};_0x369f39(++_0x147e30);}(_0x509d,0x14c));var _0xd509=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x509d[_0x4667b2];return _0x1070f2;};'use strict';var Sequelize=require(_0xd509('0x0'));var rs=require(_0xd509('0x1'));module[_0xd509('0x2')]={'name':{'type':Sequelize[_0xd509('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd509('0x3')],'defaultValue':function(){return rs[_0xd509('0x4')]();}},'replyUri':{'type':Sequelize[_0xd509('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd509('0x5')],'defaultValue':function(){return _0xd509('0x6');}},'notificationSound':{'type':Sequelize[_0xd509('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd509('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd509('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd509('0x3')]},'queueTransfer':{'type':Sequelize[_0xd509('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd509('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd509('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd509('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd509('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xd509('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd509('0xa'),'set':function(_0x1b2a86){if(!_0x1b2a86)this['setDataValue'](_0xd509('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x1b2a86);}}}; \ No newline at end of file +var _0x5b6b=['STRING','name','generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x5b6b,0x1d4));var _0xb5b6=function(_0x5368b0,_0x4c44b6){_0x5368b0=_0x5368b0-0x0;var _0x489ace=_0x5b6b[_0x5368b0];return _0x489ace;};'use strict';var Sequelize=require(_0xb5b6('0x0'));var rs=require(_0xb5b6('0x1'));module['exports']={'name':{'type':Sequelize[_0xb5b6('0x2')],'unique':_0xb5b6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb5b6('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb5b6('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb5b6('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb5b6('0x2')]},'queueTransfer':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5b6('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![],'comment':_0xb5b6('0x7'),'set':function(_0x5152df){if(!_0x5152df)this[_0xb5b6('0x8')]('mandatoryDispositionPauseId',null);this[_0xb5b6('0x8')](_0xb5b6('0x9'),_0x5152df);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 62c9295..4dd4ab0 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 _0xcea5=['autoclose','push','close','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','stack','finally','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','DESC','Applications','account','applications','list','orderBy','priority','asc','Contacts','from','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcea5,0xed));var _0x5cea=function(_0x192145,_0xe7d79c){_0x192145=_0x192145-0x0;var _0x5086a5=_0xcea5[_0x192145];return _0x5086a5;};'use strict';var emlformat=require(_0x5cea('0x0'));var rimraf=require(_0x5cea('0x1'));var zipdir=require(_0x5cea('0x2'));var jsonpatch=require(_0x5cea('0x3'));var rp=require(_0x5cea('0x4'));var moment=require('moment');var BPromise=require(_0x5cea('0x5'));var Mustache=require(_0x5cea('0x6'));var util=require(_0x5cea('0x7'));var path=require(_0x5cea('0x8'));var sox=require('sox');var csv=require(_0x5cea('0x9'));var ejs=require(_0x5cea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5cea('0xb'));var deskjs=require(_0x5cea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cea('0xd'));var Papa=require('papaparse');var Redis=require(_0x5cea('0xe'));var authService=require(_0x5cea('0xf'));var qs=require(_0x5cea('0x10'));var as=require(_0x5cea('0x11'));var hardwareService=require(_0x5cea('0x12'));var logger=require(_0x5cea('0x13'))(_0x5cea('0x14'));var utils=require(_0x5cea('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5cea('0x16'));var db=require(_0x5cea('0x17'))['db'];config[_0x5cea('0x18')]=_[_0x5cea('0x19')](config[_0x5cea('0x18')],{'host':_0x5cea('0x1a'),'port':0x18eb});var socket=require(_0x5cea('0x1b'))(new Redis(config[_0x5cea('0x18')]));require(_0x5cea('0x1c'))[_0x5cea('0x1d')](socket);var jayson=require(_0x5cea('0x1e'));var client=jayson[_0x5cea('0x1f')][_0x5cea('0x20')]({'port':0x232c});var client9002=jayson[_0x5cea('0x1f')][_0x5cea('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x84a9c4,_0x1c9a30,_0x209046,_0x44f9c0){return new BPromise(function(_0x9a670,_0x3eee17){var _0x326b50=_0x44f9c0||client;return _0x326b50[_0x5cea('0x21')](_0x84a9c4,_0x209046)[_0x5cea('0x22')](function(_0xd2a67e){logger[_0x5cea('0x23')](_0x5cea('0x24'),_0x1c9a30,_0x5cea('0x25'));logger[_0x5cea('0x26')](_0x5cea('0x27'),_0x1c9a30,'request\x20sent',JSON[_0x5cea('0x28')](_0xd2a67e));if(_0xd2a67e['error']){if(_0xd2a67e[_0x5cea('0x29')][_0x5cea('0x2a')]===0x1f4){logger[_0x5cea('0x29')](_0x5cea('0x24'),_0x1c9a30,_0xd2a67e['error'][_0x5cea('0x2b')]);return _0x3eee17(_0xd2a67e['error'][_0x5cea('0x2b')]);}logger[_0x5cea('0x29')](_0x5cea('0x24'),_0x1c9a30,_0xd2a67e[_0x5cea('0x29')][_0x5cea('0x2b')]);return _0x9a670(_0xd2a67e[_0x5cea('0x29')][_0x5cea('0x2b')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1c9a30,_0x5cea('0x25'));_0x9a670(_0xd2a67e[_0x5cea('0x2c')]['message']);}})[_0x5cea('0x2d')](function(_0x21708c){logger[_0x5cea('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x1c9a30,_0x21708c);_0x3eee17(_0x21708c);});});}function respondWithStatusCode(_0x5d36d7,_0x168052){_0x168052=_0x168052||0xcc;return function(_0x1b295f){if(_0x1b295f){return _0x5d36d7[_0x5cea('0x2e')](_0x168052);}return _0x5d36d7['status'](_0x168052)[_0x5cea('0x2f')]();};}function respondWithResult(_0xaddd21,_0x2e9f9a){_0x2e9f9a=_0x2e9f9a||0xc8;return function(_0x3bcee2){if(_0x3bcee2){return _0xaddd21['status'](_0x2e9f9a)[_0x5cea('0x30')](_0x3bcee2);}};}function respondWithFilteredResult(_0x18c4e5,_0x282054){return function(_0x370c0c){if(_0x370c0c){var _0x1f2dd1=typeof _0x282054[_0x5cea('0x31')]===_0x5cea('0x32')&&typeof _0x282054[_0x5cea('0x33')]==='undefined';var _0x5e17af=_0x370c0c[_0x5cea('0x34')];var _0x122639=_0x1f2dd1?0x0:_0x282054[_0x5cea('0x31')];var _0x3592ab=_0x1f2dd1?_0x370c0c[_0x5cea('0x34')]:_0x282054['offset']+_0x282054[_0x5cea('0x33')];var _0xfcbc13;if(_0x3592ab>=_0x5e17af){_0x3592ab=_0x5e17af;_0xfcbc13=0xc8;}else{_0xfcbc13=0xce;}_0x18c4e5[_0x5cea('0x35')](_0xfcbc13);return _0x18c4e5[_0x5cea('0x36')](_0x5cea('0x37'),_0x122639+'-'+_0x3592ab+'/'+_0x5e17af)[_0x5cea('0x30')](_0x370c0c);}return null;};}function patchUpdates(_0x37aa73){return function(_0x16704d){try{jsonpatch[_0x5cea('0x38')](_0x16704d,_0x37aa73,!![]);}catch(_0x1efa2b){return BPromise[_0x5cea('0x39')](_0x1efa2b);}return _0x16704d['save']();};}function saveUpdates(_0x39d233,_0x411c77){return function(_0x1e2163){if(_0x1e2163){return _0x1e2163[_0x5cea('0x3a')](_0x39d233)['then'](function(_0x10d3ec){return _0x10d3ec;});}return null;};}function removeEntity(_0x3745cd,_0xdbe6fd){return function(_0xc08209){if(_0xc08209){return _0xc08209[_0x5cea('0x3b')]()[_0x5cea('0x22')](function(){var _0x9ebaf4=_0xc08209[_0x5cea('0x3c')]({'plain':!![]});var _0x324e4b=_0x5cea('0x3d');return db[_0x5cea('0x3e')][_0x5cea('0x3b')]({'where':{'type':_0x324e4b,'resourceId':_0x9ebaf4['id']}})[_0x5cea('0x22')](function(){return _0xc08209;});})[_0x5cea('0x22')](function(){_0x3745cd['status'](0xcc)[_0x5cea('0x2f')]();});}};}function handleEntityNotFound(_0x35baf5,_0x1742b1){return function(_0x7ad292){if(!_0x7ad292){_0x35baf5[_0x5cea('0x2e')](0x194);}return _0x7ad292;};}function handleError(_0x43a73d,_0x2f1edb){_0x2f1edb=_0x2f1edb||0x1f4;return function(_0x4c3342){logger[_0x5cea('0x29')](_0x4c3342['stack']);if(_0x4c3342[_0x5cea('0x3f')]){delete _0x4c3342[_0x5cea('0x3f')];}_0x43a73d[_0x5cea('0x35')](_0x2f1edb)['send'](_0x4c3342);};}exports[_0x5cea('0x40')]=function(_0x55118a,_0x3df2d0){var _0x532211={'include':[{'model':db[_0x5cea('0x41')],'as':_0x5cea('0x42')}]},_0x5895d1={},_0x4bda52={'count':0x0,'rows':[]};var _0x347f11=_['map'](db[_0x5cea('0x43')][_0x5cea('0x44')],function(_0x1b1ea7){return{'name':_0x1b1ea7['fieldName'],'type':_0x1b1ea7[_0x5cea('0x45')][_0x5cea('0x46')]};});_0x5895d1[_0x5cea('0x47')]=_[_0x5cea('0x48')](_0x347f11,_0x5cea('0x3f'));_0x5895d1[_0x5cea('0x49')]=_[_0x5cea('0x4a')](_0x55118a[_0x5cea('0x49')]);_0x5895d1[_0x5cea('0x4b')]=_[_0x5cea('0x4c')](_0x5895d1[_0x5cea('0x47')],_0x5895d1[_0x5cea('0x49')]);_0x532211[_0x5cea('0x4d')]=_[_0x5cea('0x4c')](_0x5895d1['model'],qs[_0x5cea('0x4e')](_0x55118a['query']['fields']));_0x532211[_0x5cea('0x4d')]=_0x532211['attributes'][_0x5cea('0x4f')]?_0x532211[_0x5cea('0x4d')]:_0x5895d1[_0x5cea('0x47')];if(!_0x55118a['query'][_0x5cea('0x50')](_0x5cea('0x51'))){_0x532211[_0x5cea('0x33')]=qs[_0x5cea('0x33')](_0x55118a[_0x5cea('0x49')][_0x5cea('0x33')]);_0x532211[_0x5cea('0x31')]=qs['offset'](_0x55118a['query']['offset']);}_0x532211[_0x5cea('0x52')]=qs[_0x5cea('0x53')](_0x55118a[_0x5cea('0x49')]['sort']);_0x532211['where']=qs[_0x5cea('0x4b')](_['pick'](_0x55118a['query'],_0x5895d1[_0x5cea('0x4b')]),_0x347f11);if(_0x55118a[_0x5cea('0x49')][_0x5cea('0x54')]){_0x532211['where']=_[_0x5cea('0x55')](_0x532211[_0x5cea('0x56')],{'$or':_[_0x5cea('0x48')](_0x347f11,function(_0x597f1c){if(_0x597f1c['type']!==_0x5cea('0x57')){var _0x28515b={};_0x28515b[_0x597f1c['name']]={'$like':'%'+_0x55118a[_0x5cea('0x49')]['filter']+'%'};return _0x28515b;}})});}_0x532211=_['merge']({},_0x532211,_0x55118a[_0x5cea('0x58')]);var _0x441872={'where':_0x532211[_0x5cea('0x56')]};return db[_0x5cea('0x43')][_0x5cea('0x34')](_0x441872)[_0x5cea('0x22')](function(_0x41a5d5){_0x4bda52[_0x5cea('0x34')]=_0x41a5d5;if(_0x55118a['query'][_0x5cea('0x59')]){_0x532211[_0x5cea('0x5a')]=[{'all':!![]}];}return db[_0x5cea('0x43')][_0x5cea('0x5b')](_0x532211);})['then'](function(_0x1ca9b0){_0x4bda52[_0x5cea('0x5c')]=_0x1ca9b0;return _0x4bda52;})[_0x5cea('0x22')](respondWithFilteredResult(_0x3df2d0,_0x532211))[_0x5cea('0x2d')](handleError(_0x3df2d0,null));};exports['show']=function(_0x5b144b,_0xb5baa1){var _0x2ff7a2={'raw':![],'where':{'id':_0x5b144b[_0x5cea('0x5d')]['id']},'include':[{'model':db[_0x5cea('0x41')],'as':_0x5cea('0x42')}]},_0x31a7aa={};_0x31a7aa['model']=_['keys'](db[_0x5cea('0x43')][_0x5cea('0x44')]);_0x31a7aa[_0x5cea('0x49')]=_[_0x5cea('0x4a')](_0x5b144b[_0x5cea('0x49')]);_0x31a7aa[_0x5cea('0x4b')]=_[_0x5cea('0x4c')](_0x31a7aa['model'],_0x31a7aa[_0x5cea('0x49')]);_0x2ff7a2[_0x5cea('0x4d')]=_['intersection'](_0x31a7aa['model'],qs[_0x5cea('0x4e')](_0x5b144b[_0x5cea('0x49')]['fields']));_0x2ff7a2['attributes']=_0x2ff7a2[_0x5cea('0x4d')][_0x5cea('0x4f')]?_0x2ff7a2['attributes']:_0x31a7aa[_0x5cea('0x47')];if(_0x5b144b[_0x5cea('0x49')][_0x5cea('0x59')]){_0x2ff7a2[_0x5cea('0x5a')]=[{'all':!![]}];}_0x2ff7a2=_[_0x5cea('0x55')]({},_0x2ff7a2,_0x5b144b[_0x5cea('0x58')]);return db['OpenchannelAccount']['find'](_0x2ff7a2)[_0x5cea('0x22')](handleEntityNotFound(_0xb5baa1,null))[_0x5cea('0x22')](respondWithResult(_0xb5baa1,null))[_0x5cea('0x2d')](handleError(_0xb5baa1,null));};exports[_0x5cea('0x5e')]=function(_0x1a2311,_0x533711){return db[_0x5cea('0x43')][_0x5cea('0x5e')](_0x1a2311[_0x5cea('0x5f')],{})[_0x5cea('0x22')](function(_0x35cfed){var _0x250980=_0x1a2311['user']['get']({'plain':!![]});if(!_0x250980)throw new Error(_0x5cea('0x60'));if(_0x250980['role']===_0x5cea('0x61')){var _0x1425b3=_0x35cfed['get']({'plain':!![]});var _0x58389d=_0x5cea('0x3d');return db['UserProfileSection'][_0x5cea('0x62')]({'where':{'name':_0x58389d,'userProfileId':_0x250980[_0x5cea('0x63')]},'raw':!![]})['then'](function(_0x854753){if(_0x854753&&_0x854753[_0x5cea('0x64')]===0x0){return db['UserProfileResource'][_0x5cea('0x5e')]({'name':_0x1425b3[_0x5cea('0x3f')],'resourceId':_0x1425b3['id'],'type':_0x854753[_0x5cea('0x3f')],'sectionId':_0x854753['id']},{})[_0x5cea('0x22')](function(){return _0x35cfed;});}else{return _0x35cfed;}})[_0x5cea('0x2d')](function(_0x448e88){logger[_0x5cea('0x29')](_0x5cea('0x65'),_0x448e88);throw _0x448e88;});}return _0x35cfed;})[_0x5cea('0x22')](respondWithResult(_0x533711,0xc9))[_0x5cea('0x2d')](handleError(_0x533711,null));};exports[_0x5cea('0x3a')]=function(_0x5d89d2,_0x2d0755){if(_0x5d89d2[_0x5cea('0x5f')]['id']){delete _0x5d89d2['body']['id'];}return db[_0x5cea('0x43')][_0x5cea('0x62')]({'where':{'id':_0x5d89d2[_0x5cea('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x5cea('0x42')}]})[_0x5cea('0x22')](handleEntityNotFound(_0x2d0755,null))[_0x5cea('0x22')](saveUpdates(_0x5d89d2[_0x5cea('0x5f')],null))[_0x5cea('0x22')](respondWithResult(_0x2d0755,null))[_0x5cea('0x2d')](handleError(_0x2d0755,null));};exports[_0x5cea('0x3b')]=function(_0x5c438a,_0x5d21e8){return db['OpenchannelAccount'][_0x5cea('0x62')]({'where':{'id':_0x5c438a[_0x5cea('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5d21e8,null))[_0x5cea('0x22')](removeEntity(_0x5d21e8,null))[_0x5cea('0x2d')](handleError(_0x5d21e8,null));};exports['describe']=function(_0x4fad4f,_0x3be9d3){return db[_0x5cea('0x43')][_0x5cea('0x66')]()['then'](respondWithResult(_0x3be9d3,null))[_0x5cea('0x2d')](handleError(_0x3be9d3,null));};exports[_0x5cea('0x67')]=function(_0x20b056,_0x1e9ac3,_0x33ec9a){if(_0x20b056[_0x5cea('0x5f')]['id']){delete _0x20b056[_0x5cea('0x5f')]['id'];}return db[_0x5cea('0x43')][_0x5cea('0x62')]({'where':{'id':_0x20b056['params']['id']}})['then'](handleEntityNotFound(_0x1e9ac3,null))[_0x5cea('0x22')](function(_0x37ec2e){if(_0x37ec2e){_0x20b056[_0x5cea('0x5f')][_0x5cea('0x68')]=_0x37ec2e['id'];return db[_0x5cea('0x69')][_0x5cea('0x5e')](_0x20b056[_0x5cea('0x5f')]);}})['then'](respondWithResult(_0x1e9ac3,null))['catch'](handleError(_0x1e9ac3,null));};exports[_0x5cea('0x6a')]=function(_0x94dbd3,_0xe9dd60,_0x5ad3c6){var _0x3a1ba2={'raw':![],'where':{}};var _0x5c7244={};var _0x1a4f87={'count':0x0,'rows':[]};return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x94dbd3[_0x5cea('0x5d')]['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0xe9dd60,null))[_0x5cea('0x22')](function(_0x6b71c2){if(_0x6b71c2){_0x5c7244[_0x5cea('0x47')]=_[_0x5cea('0x4a')](db[_0x5cea('0x69')][_0x5cea('0x44')]);_0x5c7244[_0x5cea('0x49')]=_['keys'](_0x94dbd3['query']);_0x5c7244['filters']=_['intersection'](_0x5c7244[_0x5cea('0x47')],_0x5c7244[_0x5cea('0x49')]);_0x3a1ba2[_0x5cea('0x4d')]=_['intersection'](_0x5c7244[_0x5cea('0x47')],qs[_0x5cea('0x4e')](_0x94dbd3['query'][_0x5cea('0x4e')]));_0x3a1ba2[_0x5cea('0x4d')]=_0x3a1ba2['attributes'][_0x5cea('0x4f')]?_0x3a1ba2[_0x5cea('0x4d')]:_0x5c7244[_0x5cea('0x47')];if(!_0x94dbd3['query'][_0x5cea('0x50')](_0x5cea('0x51'))){_0x3a1ba2[_0x5cea('0x33')]=qs[_0x5cea('0x33')](_0x94dbd3[_0x5cea('0x49')][_0x5cea('0x33')]);_0x3a1ba2['offset']=qs[_0x5cea('0x31')](_0x94dbd3[_0x5cea('0x49')][_0x5cea('0x31')]);}_0x3a1ba2[_0x5cea('0x52')]=qs[_0x5cea('0x53')](_0x94dbd3[_0x5cea('0x49')][_0x5cea('0x53')]);_0x3a1ba2[_0x5cea('0x56')]=qs['filters'](_[_0x5cea('0x6c')](_0x94dbd3[_0x5cea('0x49')],_0x5c7244[_0x5cea('0x4b')]));_0x3a1ba2[_0x5cea('0x56')][_0x5cea('0x68')]=_0x6b71c2['id'];if(_0x94dbd3['query'][_0x5cea('0x54')]){_0x3a1ba2[_0x5cea('0x56')]=_[_0x5cea('0x55')](_0x3a1ba2[_0x5cea('0x56')],{'$or':_['map'](_0x3a1ba2['attributes'],function(_0x67ac90){var _0x1c206d={};_0x1c206d[_0x67ac90]={'$like':'%'+_0x94dbd3[_0x5cea('0x49')]['filter']+'%'};return _0x1c206d;})});}_0x3a1ba2=_[_0x5cea('0x55')]({},_0x3a1ba2,_0x94dbd3['options']);return db[_0x5cea('0x69')][_0x5cea('0x34')]({'where':_0x3a1ba2[_0x5cea('0x56')]})[_0x5cea('0x22')](function(_0x2624f3){_0x1a4f87['count']=_0x2624f3;if(_0x94dbd3[_0x5cea('0x49')][_0x5cea('0x59')]){_0x3a1ba2['include']=[{'all':!![]}];}return db[_0x5cea('0x69')][_0x5cea('0x5b')](_0x3a1ba2);})[_0x5cea('0x22')](function(_0x595180){_0x1a4f87['rows']=_0x595180;return _0x1a4f87;});}})[_0x5cea('0x22')](respondWithFilteredResult(_0xe9dd60,_0x3a1ba2))[_0x5cea('0x2d')](handleError(_0xe9dd60,null));};exports[_0x5cea('0x6d')]=function(_0x2cd339,_0x496a6a,_0x585bcb){return db[_0x5cea('0x43')]['find']({'where':{'id':_0x2cd339['params']['id']}})['then'](handleEntityNotFound(_0x496a6a,null))[_0x5cea('0x22')](function(_0x18fa7a){if(_0x18fa7a){return _0x18fa7a[_0x5cea('0x6d')](_0x2cd339[_0x5cea('0x49')][_0x5cea('0x6e')]);}})[_0x5cea('0x22')](respondWithStatusCode(_0x496a6a,null))[_0x5cea('0x2d')](handleError(_0x496a6a,null));};exports[_0x5cea('0x6f')]=function(_0x5ce7fc,_0x2bab60,_0xb2a4a1){if(_0x5ce7fc[_0x5cea('0x5f')]['id']){delete _0x5ce7fc['body']['id'];}return db['OpenchannelAccount'][_0x5cea('0x62')]({'where':{'id':_0x5ce7fc[_0x5cea('0x5d')]['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x2bab60,null))[_0x5cea('0x22')](function(_0xd8eb0){if(_0xd8eb0){_0x5ce7fc[_0x5cea('0x5f')]['OpenchannelAccountId']=_0xd8eb0['id'];return db[_0x5cea('0x70')]['create'](_0x5ce7fc[_0x5cea('0x5f')]);}})[_0x5cea('0x22')](respondWithResult(_0x2bab60,null))[_0x5cea('0x2d')](handleError(_0x2bab60,null));};exports[_0x5cea('0x71')]=function(_0x46491e,_0x15fb07,_0x1b7418){var _0x387ec7={'raw':![],'where':{}};var _0x5b81bb={};var _0x3a6d9c={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x46491e['params']['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x15fb07,null))[_0x5cea('0x22')](function(_0x546385){if(_0x546385){_0x5b81bb['model']=_[_0x5cea('0x4a')](db[_0x5cea('0x70')][_0x5cea('0x44')]);_0x5b81bb[_0x5cea('0x49')]=_[_0x5cea('0x4a')](_0x46491e[_0x5cea('0x49')]);_0x5b81bb[_0x5cea('0x4b')]=_[_0x5cea('0x4c')](_0x5b81bb['model'],_0x5b81bb[_0x5cea('0x49')]);_0x387ec7[_0x5cea('0x4d')]=_[_0x5cea('0x4c')](_0x5b81bb[_0x5cea('0x47')],qs[_0x5cea('0x4e')](_0x46491e[_0x5cea('0x49')][_0x5cea('0x4e')]));_0x387ec7[_0x5cea('0x4d')]=_0x387ec7['attributes'][_0x5cea('0x4f')]?_0x387ec7[_0x5cea('0x4d')]:_0x5b81bb[_0x5cea('0x47')];if(!_0x46491e[_0x5cea('0x49')][_0x5cea('0x50')](_0x5cea('0x51'))){_0x387ec7[_0x5cea('0x33')]=qs[_0x5cea('0x33')](_0x46491e[_0x5cea('0x49')][_0x5cea('0x33')]);_0x387ec7['offset']=qs[_0x5cea('0x31')](_0x46491e[_0x5cea('0x49')]['offset']);}_0x387ec7['order']=qs[_0x5cea('0x53')](_0x46491e[_0x5cea('0x49')][_0x5cea('0x53')]);_0x387ec7[_0x5cea('0x56')]=qs[_0x5cea('0x4b')](_['pick'](_0x46491e[_0x5cea('0x49')],_0x5b81bb[_0x5cea('0x4b')]));_0x387ec7[_0x5cea('0x56')]['OpenchannelAccountId']=_0x546385['id'];if(_0x46491e[_0x5cea('0x49')][_0x5cea('0x54')]){_0x387ec7[_0x5cea('0x56')]=_['merge'](_0x387ec7[_0x5cea('0x56')],{'$or':_[_0x5cea('0x48')](_0x387ec7[_0x5cea('0x4d')],function(_0x18e041){var _0x5d6382={};_0x5d6382[_0x18e041]={'$like':'%'+_0x46491e[_0x5cea('0x49')][_0x5cea('0x54')]+'%'};return _0x5d6382;})});}_0x387ec7=_[_0x5cea('0x55')]({},_0x387ec7,_0x46491e[_0x5cea('0x58')]);return db[_0x5cea('0x70')][_0x5cea('0x34')]({'where':_0x387ec7[_0x5cea('0x56')]})[_0x5cea('0x22')](function(_0x4cc3bc){_0x3a6d9c[_0x5cea('0x34')]=_0x4cc3bc;if(_0x46491e[_0x5cea('0x49')]['includeAll']){_0x387ec7[_0x5cea('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5cea('0x5b')](_0x387ec7);})[_0x5cea('0x22')](function(_0xd69ee1){_0x3a6d9c[_0x5cea('0x5c')]=_0xd69ee1;return _0x3a6d9c;});}})['then'](respondWithFilteredResult(_0x15fb07,_0x387ec7))[_0x5cea('0x2d')](handleError(_0x15fb07,null));};exports[_0x5cea('0x72')]=function(_0x4f8c6a,_0x26fe73,_0x5ec0af){return db['OpenchannelAccount']['find']({'where':{'id':_0x4f8c6a[_0x5cea('0x5d')]['id']}})['then'](handleEntityNotFound(_0x26fe73,null))[_0x5cea('0x22')](function(_0x56f00f){if(_0x56f00f){return _0x56f00f[_0x5cea('0x72')](_0x4f8c6a['query'][_0x5cea('0x6e')]);}})[_0x5cea('0x22')](respondWithStatusCode(_0x26fe73,null))['catch'](handleError(_0x26fe73,null));};exports['notify']=function(_0x391f60,_0x7f925b,_0x161b15){var _0x24ff4c={'body':_0x391f60['body'],'channel':'openchannel'};var _0x40a17a=[];var _0x373cd7=[];var _0x16fb20={};var _0x3e9233=![];return db['CmContact'][_0x5cea('0x66')]()[_0x5cea('0x22')](function(_0x1172ca){if(!_0x1172ca){throw new db['Sequelize'][(_0x5cea('0x73'))](_0x5cea('0x74'));}_0x40a17a=_[_0x5cea('0x75')](_['keys'](_0x1172ca),[_0x5cea('0x76'),_0x5cea('0x77')]);_0x373cd7=_[_0x5cea('0x75')](_[_0x5cea('0x4a')](_0x1172ca),[_0x5cea('0x76'),_0x5cea('0x77'),'CompanyId','ListId']);if(_0x391f60['body']['id']){delete _0x391f60[_0x5cea('0x5f')]['id'];}if(_[_0x5cea('0x78')](_0x391f60[_0x5cea('0x5f')]['from'])){throw new db['Sequelize']['ValidationError'](_0x5cea('0x79'));}if(_[_0x5cea('0x78')](_0x391f60[_0x5cea('0x5f')][_0x5cea('0x5f')])||_0x391f60[_0x5cea('0x5f')]['body']===''){throw new db['Sequelize'][(_0x5cea('0x73'))](_0x5cea('0x7a'));}if(_[_0x5cea('0x78')](_0x391f60[_0x5cea('0x5f')]['mapKey'])){throw new db[(_0x5cea('0x7b'))]['ValidationError'](_0x5cea('0x7c')+_0x373cd7);}if(!_['includes'](_0x373cd7,_0x391f60[_0x5cea('0x5f')][_0x5cea('0x7d')])){throw new db[(_0x5cea('0x7b'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x373cd7);}_0x16fb20[_0x391f60[_0x5cea('0x5f')][_0x5cea('0x7d')]]=_0x391f60[_0x5cea('0x5f')]['from'];})[_0x5cea('0x22')](function(){return db['OpenchannelAccount'][_0x5cea('0x62')]({'where':{'id':_0x391f60['params']['id']},'include':[{'model':db[_0x5cea('0x7e')],'as':_0x5cea('0x7f'),'include':[{'model':db[_0x5cea('0x80')],'as':'Contacts','where':_0x16fb20,'limit':0x1,'order':[[_0x5cea('0x77'),_0x5cea('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0x5cea('0x82')}]});})[_0x5cea('0x22')](handleEntityNotFound(_0x7f925b,null))[_0x5cea('0x22')](function(_0x200a19){if(_0x200a19&&_0x200a19[_0x5cea('0x7f')]){_0x24ff4c[_0x5cea('0x83')]=_0x200a19;_0x24ff4c[_0x5cea('0x84')]=_0x200a19[_0x5cea('0x82')];_0x24ff4c[_0x5cea('0x85')]=_0x200a19[_0x5cea('0x7f')];_0x24ff4c[_0x5cea('0x84')]=_[_0x5cea('0x86')](_0x24ff4c[_0x5cea('0x84')],[_0x5cea('0x87')],[_0x5cea('0x88')]);if(_0x24ff4c[_0x5cea('0x83')][_0x5cea('0x82')]){delete _0x24ff4c[_0x5cea('0x83')][_0x5cea('0x82')];}if(_0x24ff4c['account'][_0x5cea('0x7f')]&&_0x24ff4c[_0x5cea('0x83')]['List'][_0x5cea('0x89')]['length']){return _0x24ff4c[_0x5cea('0x83')][_0x5cea('0x7f')]['Contacts'][0x0];}var _0x1352f6=_[_0x5cea('0x19')](_0x391f60['body'],{'firstName':_0x391f60[_0x5cea('0x5f')][_0x5cea('0x8a')],'ListId':_0x200a19[_0x5cea('0x8b')]});_0x1352f6[_0x391f60['body']['mapKey']]=_0x391f60[_0x5cea('0x5f')][_0x5cea('0x8a')];return db[_0x5cea('0x80')][_0x5cea('0x5e')](_0x1352f6,{'fields':_0x40a17a,'raw':!![]});}})['then'](handleEntityNotFound(_0x7f925b,null))[_0x5cea('0x22')](function(_0x23cddf){_0x24ff4c[_0x5cea('0x8c')]=_0x23cddf;if(_0x23cddf){var _0x2bcfbb={'ContactId':_0x23cddf['id'],'OpenchannelAccountId':_0x391f60[_0x5cea('0x5d')]['id'],'from':(_0x23cddf['firstName']||'')+'\x20'+(_0x23cddf[_0x5cea('0x8d')]||'')};var _0x35d787={'OpenchannelAccountId':_0x391f60['params']['id'],'closed':![]};if(_0x391f60[_0x5cea('0x5f')]['threadId']){_0x35d787[_0x5cea('0x8e')]=_0x391f60[_0x5cea('0x5f')][_0x5cea('0x8e')];return db[_0x5cea('0x8f')][_0x5cea('0x62')]({'where':_0x35d787})[_0x5cea('0x22')](function(_0x1db1b6){if(_0x1db1b6){return[_0x1db1b6,![]];}_0x2bcfbb[_0x5cea('0x8e')]=_0x391f60[_0x5cea('0x5f')][_0x5cea('0x8e')];_0x2bcfbb[_0x5cea('0x90')]=_0x391f60[_0x5cea('0x5f')][_0x5cea('0x90')];return db['OpenchannelInteraction'][_0x5cea('0x5e')](_0x2bcfbb)[_0x5cea('0x22')](function(_0x4d2e13){return[_0x4d2e13,!![]];});});}else{_0x35d787[_0x5cea('0x8e')]=null;}_0x35d787['ContactId']=_0x23cddf['id'];return db['OpenchannelInteraction']['find']({'where':_0x35d787})[_0x5cea('0x22')](function(_0xd2f789){if(_0xd2f789){return[_0xd2f789,![]];}return db[_0x5cea('0x8f')][_0x5cea('0x5e')](_0x2bcfbb)['then'](function(_0x3cb6fd){return[_0x3cb6fd,!![]];});});}})[_0x5cea('0x91')](function(_0x5a78c5,_0x21b25d){if(_0x5a78c5){_0x3e9233=_0x21b25d;if(!_0x21b25d){var _0x38220f={'from':(_0x24ff4c['contact']['firstName']||'')+'\x20'+(_0x24ff4c[_0x5cea('0x8c')][_0x5cea('0x8d')]||'')};if(_0x391f60['body']['threadId']&&_0x391f60['body'][_0x5cea('0x92')]&&_0x391f60[_0x5cea('0x5f')][_0x5cea('0x8e')]!=_0x391f60['body'][_0x5cea('0x92')]){_0x38220f['threadId']=_0x391f60[_0x5cea('0x5f')][_0x5cea('0x92')];}return _0x5a78c5[_0x5cea('0x3a')](_0x38220f);}else{return _0x5a78c5;}}})['then'](function(_0x47a672){_0x24ff4c[_0x5cea('0x93')]=_0x47a672['get']({'plain':!![]});_0x24ff4c['interaction'][_0x5cea('0x94')]=_0x3e9233;if(_0x24ff4c[_0x5cea('0x93')][_0x5cea('0x94')]){if(_0x24ff4c[_0x5cea('0x83')][_0x5cea('0x95')]){_0x24ff4c[_0x5cea('0x84')][_0x5cea('0x96')]({'id':0x0,'priority':_0x24ff4c[_0x5cea('0x84')][_0x5cea('0x4f')]+0x1,'app':_0x5cea('0x97'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x5cea('0x5e')]({'body':_0x391f60[_0x5cea('0x5f')][_0x5cea('0x5f')],'OpenchannelAccountId':_0x391f60[_0x5cea('0x5d')]['id'],'OpenchannelInteractionId':_0x47a672['id'],'direction':'in','ContactId':_0x24ff4c[_0x5cea('0x8c')]['id'],'AttachmentId':_0x391f60[_0x5cea('0x5f')][_0x5cea('0x98')]});})[_0x5cea('0x22')](function(_0x7d942b){_0x24ff4c['message']=_0x7d942b;if(_0x24ff4c['interaction'][_0x5cea('0x99')]){return db['User'][_0x5cea('0x62')]({'attributes':['id','name'],'where':{'id':_0x24ff4c[_0x5cea('0x93')][_0x5cea('0x99')]}})['then'](function(_0x4ee6de){if(_0x4ee6de){_0x24ff4c[_0x5cea('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5cea('0x9a'),'appdata':_0x4ee6de[_0x5cea('0x3f')]+','+(_0x24ff4c['account'][_0x5cea('0x9b')]||0xa),'interval':_0x5cea('0x9c')});_0x24ff4c[_0x5cea('0x9d')]=![];}return respondWithRpcPromise('Start',_0x5cea('0x9e'),_0x24ff4c);});}return respondWithRpcPromise(_0x5cea('0x9f'),'startRouting',_0x24ff4c);})[_0x5cea('0x22')](function(_0x1b98bb){respondWithRpcPromise(_0x5cea('0xa0'),_0x5cea('0xa0'),{'event':_0x5cea('0xa1'),'message':_0x1b98bb},client9002);return _0x1b98bb;})[_0x5cea('0x22')](respondWithResult(_0x7f925b,null))[_0x5cea('0x2d')](handleError(_0x7f925b,null));};exports['addApplications']=function(_0x435094,_0x88c122){var _0x2c9669=_0x435094[_0x5cea('0x5d')]['id'];var _0x22bfd7=_0x435094[_0x5cea('0x5f')];var _0xf9b4f=0xc8;var _0x1e2148=null;return db[_0x5cea('0xa2')][_0x5cea('0xa3')]({'isolationLevel':db['sequelize'][_0x5cea('0xa4')][_0x5cea('0xa5')][_0x5cea('0xa6')]},function(_0x34971d){return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x2c9669},'transaction':_0x34971d})[_0x5cea('0x22')](function(_0x476f0f){if(_0x476f0f){return db['OpenchannelApplication'][_0x5cea('0x3b')]({'where':{'OpenchannelAccountId':_0x2c9669},'transaction':_0x34971d})[_0x5cea('0x22')](function(){var _0x2fa36c=_[_0x5cea('0x48')](_0x22bfd7,function(_0x3ffb53){_0x3ffb53[_0x5cea('0x68')]=_0x2c9669;return _0x3ffb53;});return db[_0x5cea('0xa7')][_0x5cea('0xa8')](_0x2fa36c,{'transaction':_0x34971d});});}else{_0xf9b4f=0x194;_0x1e2148=[];}});})[_0x5cea('0x22')](function(){if(_0xf9b4f!==0x194){return db[_0x5cea('0xa7')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2c9669},'order':_0x5cea('0x87')})['then'](function(_0x575f6a){_0x1e2148=_0x575f6a;});}})['catch'](function(_0x56cd77){_0xf9b4f=0x1f4;logger[_0x5cea('0x29')](_0x56cd77[_0x5cea('0xa9')]);if(_0x56cd77[_0x5cea('0x3f')]){delete _0x56cd77[_0x5cea('0x3f')];}_0x1e2148=_0x56cd77;})[_0x5cea('0xaa')](function(){if(_0x1e2148===null){_0x88c122[_0x5cea('0x2e')](_0xf9b4f);}else{if(_0xf9b4f===0x1f4){_0x88c122[_0x5cea('0x35')](_0xf9b4f)[_0x5cea('0xab')](_0x1e2148);}else{_0x88c122[_0x5cea('0x35')](_0xf9b4f)[_0x5cea('0x30')](_0x1e2148);}}});};exports[_0x5cea('0xac')]=function(_0x4812f7,_0x5ba304,_0x4a3490){var _0x544b23={};var _0x3fb0e2={};var _0x218030;var _0x57f7db;return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x4812f7['params']['id']}})['then'](handleEntityNotFound(_0x5ba304,null))['then'](function(_0x44e5f2){if(_0x44e5f2){_0x218030=_0x44e5f2;_0x3fb0e2[_0x5cea('0x47')]=_[_0x5cea('0x4a')](db[_0x5cea('0xa7')][_0x5cea('0x44')]);_0x3fb0e2['query']=_['keys'](_0x4812f7[_0x5cea('0x49')]);_0x3fb0e2[_0x5cea('0x4b')]=_[_0x5cea('0x4c')](_0x3fb0e2[_0x5cea('0x47')],_0x3fb0e2[_0x5cea('0x49')]);_0x544b23['attributes']=_['intersection'](_0x3fb0e2[_0x5cea('0x47')],qs[_0x5cea('0x4e')](_0x4812f7[_0x5cea('0x49')]['fields']));_0x544b23[_0x5cea('0x4d')]=_0x544b23['attributes'][_0x5cea('0x4f')]?_0x544b23[_0x5cea('0x4d')]:_0x3fb0e2[_0x5cea('0x47')];_0x544b23[_0x5cea('0x52')]=qs['sort'](_0x4812f7[_0x5cea('0x49')][_0x5cea('0x53')]);_0x544b23['where']=qs[_0x5cea('0x4b')](_[_0x5cea('0x6c')](_0x4812f7['query'],_0x3fb0e2['filters']));if(_0x4812f7[_0x5cea('0x49')][_0x5cea('0x54')]){_0x544b23[_0x5cea('0x56')]=_[_0x5cea('0x55')](_0x544b23['where'],{'$or':_[_0x5cea('0x48')](_0x544b23['attributes'],function(_0x23806f){var _0x568f1f={};_0x568f1f[_0x23806f]={'$like':'%'+_0x4812f7['query'][_0x5cea('0x54')]+'%'};return _0x568f1f;})});}_0x544b23=_[_0x5cea('0x55')]({},_0x544b23,_0x4812f7[_0x5cea('0x58')]);return _0x218030[_0x5cea('0xac')](_0x544b23);}})[_0x5cea('0x22')](function(_0x2e833f){if(_0x2e833f){_0x57f7db=_0x2e833f['length'];if(!_0x4812f7['query']['hasOwnProperty'](_0x5cea('0x51'))){_0x544b23[_0x5cea('0x33')]=qs[_0x5cea('0x33')](_0x4812f7['query'][_0x5cea('0x33')]);_0x544b23[_0x5cea('0x31')]=qs['offset'](_0x4812f7[_0x5cea('0x49')][_0x5cea('0x31')]);}return _0x218030[_0x5cea('0xac')](_0x544b23);}})[_0x5cea('0x22')](function(_0x46ab0c){if(_0x46ab0c){return _0x46ab0c?{'count':_0x57f7db,'rows':_0x46ab0c}:null;}})['then'](respondWithResult(_0x5ba304,null))[_0x5cea('0x2d')](handleError(_0x5ba304,null));};exports[_0x5cea('0xad')]=function(_0x390509,_0x3f1ba8,_0x4fa260){var _0x345982={'raw':![],'where':{}};var _0x52e567={};var _0x12d81f={'count':0x0,'rows':[]};return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x390509[_0x5cea('0x5d')]['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x3f1ba8,null))[_0x5cea('0x22')](function(_0x3f0945){if(_0x3f0945){_0x52e567['model']=_[_0x5cea('0x4a')](db[_0x5cea('0x8f')][_0x5cea('0x44')]);_0x52e567[_0x5cea('0x49')]=_[_0x5cea('0x4a')](_0x390509[_0x5cea('0x49')]);_0x52e567[_0x5cea('0x4b')]=_[_0x5cea('0x4c')](_0x52e567[_0x5cea('0x47')],_0x52e567[_0x5cea('0x49')]);_0x345982[_0x5cea('0x4d')]=_[_0x5cea('0x4c')](_0x52e567[_0x5cea('0x47')],qs['fields'](_0x390509[_0x5cea('0x49')][_0x5cea('0x4e')]));_0x345982[_0x5cea('0x4d')]=_0x345982[_0x5cea('0x4d')][_0x5cea('0x4f')]?_0x345982[_0x5cea('0x4d')]:_0x52e567['model'];if(!_0x390509[_0x5cea('0x49')]['hasOwnProperty'](_0x5cea('0x51'))){_0x345982[_0x5cea('0x33')]=qs['limit'](_0x390509['query'][_0x5cea('0x33')]);_0x345982[_0x5cea('0x31')]=qs[_0x5cea('0x31')](_0x390509[_0x5cea('0x49')][_0x5cea('0x31')]);}_0x345982['order']=qs['sort'](_0x390509['query'][_0x5cea('0x53')]);_0x345982['where']=qs[_0x5cea('0x4b')](_[_0x5cea('0x6c')](_0x390509[_0x5cea('0x49')],_0x52e567[_0x5cea('0x4b')]));_0x345982['where'][_0x5cea('0x68')]=_0x3f0945['id'];if(_0x390509[_0x5cea('0x49')][_0x5cea('0x54')]){_0x345982['where']=_[_0x5cea('0x55')](_0x345982[_0x5cea('0x56')],{'$or':_['map'](_0x345982['attributes'],function(_0x1cf3ef){var _0x42f4f1={};_0x42f4f1[_0x1cf3ef]={'$like':'%'+_0x390509['query'][_0x5cea('0x54')]+'%'};return _0x42f4f1;})});}_0x345982=_[_0x5cea('0x55')]({},_0x345982,_0x390509[_0x5cea('0x58')]);return db['OpenchannelInteraction']['count']({'where':_0x345982[_0x5cea('0x56')]})['then'](function(_0x5ddd8b){_0x12d81f['count']=_0x5ddd8b;if(_0x390509[_0x5cea('0x49')]['includeAll']){_0x345982[_0x5cea('0x5a')]=[{'model':db['CmContact'],'as':_0x5cea('0xae'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x5cea('0xaf'),_0x5cea('0xb0')],'required':![]},{'model':db[_0x5cea('0xb1')],'as':_0x5cea('0xb2'),'attributes':['id',_0x5cea('0x3f'),_0x5cea('0xb3')],'where':_0x390509[_0x5cea('0x49')][_0x5cea('0xb4')]?{'id':_0x390509[_0x5cea('0x49')]['tag']}:undefined,'required':_0x390509['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x345982);})[_0x5cea('0x22')](function(_0x194214){_0x12d81f[_0x5cea('0x5c')]=_0x194214;return _0x12d81f;});}})[_0x5cea('0x22')](respondWithFilteredResult(_0x3f1ba8,_0x345982))[_0x5cea('0x2d')](handleError(_0x3f1ba8,null));};exports[_0x5cea('0xb5')]=function(_0x17e65e,_0x3a5cb0,_0x2d99bd){return db[_0x5cea('0x43')]['find']({'where':{'id':_0x17e65e[_0x5cea('0x5d')]['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x3a5cb0,null))[_0x5cea('0x22')](function(_0x54b991){if(_0x54b991){return _0x54b991['addAgents'](_0x17e65e[_0x5cea('0x5f')]['ids'],_[_0x5cea('0xb6')](_0x17e65e[_0x5cea('0x5f')],['ids','id'])||{})[_0x5cea('0x91')](function(_0x507185){for(var _0xf09034=0x0;_0xf09034<_0x17e65e[_0x5cea('0x5f')][_0x5cea('0x6e')][_0x5cea('0x4f')];_0xf09034+=0x1){socket[_0x5cea('0xb7')](_0x5cea('0xb8'),{'UserId':Number(_0x17e65e[_0x5cea('0x5f')][_0x5cea('0x6e')][_0xf09034]),'OpenchannelAccountId':Number(_0x17e65e['params']['id'])});}return _0x507185;});}})[_0x5cea('0x22')](respondWithResult(_0x3a5cb0,null))['catch'](handleError(_0x3a5cb0,null));};exports[_0x5cea('0xb9')]=function(_0x259379,_0x53e083,_0x2742a2){return db[_0x5cea('0x43')]['find']({'where':{'id':_0x259379['params']['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x53e083,null))[_0x5cea('0x22')](function(_0x19c80e){if(_0x19c80e){return _0x19c80e[_0x5cea('0xb9')](_0x259379[_0x5cea('0x49')][_0x5cea('0x6e')])[_0x5cea('0x22')](function(){if(_[_0x5cea('0xba')](_0x259379[_0x5cea('0x49')][_0x5cea('0x6e')])){for(var _0x4120d1=0x0;_0x4120d1<_0x259379[_0x5cea('0x49')][_0x5cea('0x6e')][_0x5cea('0x4f')];_0x4120d1+=0x1){socket['emit'](_0x5cea('0xbb'),{'UserId':Number(_0x259379[_0x5cea('0x49')][_0x5cea('0x6e')][_0x4120d1]),'OpenchannelAccountId':Number(_0x259379[_0x5cea('0x5d')]['id'])});}}else{socket[_0x5cea('0xb7')](_0x5cea('0xbb'),{'UserId':Number(_0x259379[_0x5cea('0x49')][_0x5cea('0x6e')]),'OpenchannelAccountId':Number(_0x259379[_0x5cea('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x53e083,null))[_0x5cea('0x2d')](handleError(_0x53e083,null));};exports[_0x5cea('0xbc')]=function(_0x448912,_0x15570e,_0x6b3a4f){var _0x4bd613={};var _0x5ed837={};var _0x3b1b80;var _0x451884;return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x448912[_0x5cea('0x5d')]['id']}})[_0x5cea('0x22')](handleEntityNotFound(_0x15570e,null))[_0x5cea('0x22')](function(_0x191642){if(_0x191642){_0x3b1b80=_0x191642;_0x5ed837[_0x5cea('0x47')]=_[_0x5cea('0x4a')](db['User'][_0x5cea('0x44')]);_0x5ed837[_0x5cea('0x49')]=_[_0x5cea('0x4a')](_0x448912[_0x5cea('0x49')]);_0x5ed837[_0x5cea('0x4b')]=_['intersection'](_0x5ed837['model'],_0x5ed837['query']);_0x4bd613[_0x5cea('0x4d')]=_[_0x5cea('0x4c')](_0x5ed837['model'],qs[_0x5cea('0x4e')](_0x448912['query'][_0x5cea('0x4e')]));_0x4bd613['attributes']=_0x4bd613['attributes'][_0x5cea('0x4f')]?_0x4bd613[_0x5cea('0x4d')]:_0x5ed837[_0x5cea('0x47')];_0x4bd613['order']=qs[_0x5cea('0x53')](_0x448912[_0x5cea('0x49')][_0x5cea('0x53')]);_0x4bd613[_0x5cea('0x56')]=qs[_0x5cea('0x4b')](_[_0x5cea('0x6c')](_0x448912[_0x5cea('0x49')],_0x5ed837[_0x5cea('0x4b')]));if(_0x448912[_0x5cea('0x49')][_0x5cea('0x54')]){_0x4bd613['where']=_[_0x5cea('0x55')](_0x4bd613[_0x5cea('0x56')],{'$or':_[_0x5cea('0x48')](_0x4bd613['attributes'],function(_0x4dacb9){var _0x5ac566={};_0x5ac566[_0x4dacb9]={'$like':'%'+_0x448912[_0x5cea('0x49')][_0x5cea('0x54')]+'%'};return _0x5ac566;})});}_0x4bd613=_[_0x5cea('0x55')]({},_0x4bd613,_0x448912[_0x5cea('0x58')]);return _0x3b1b80[_0x5cea('0xbc')](_0x4bd613);}})[_0x5cea('0x22')](function(_0x3dcaa4){if(_0x3dcaa4){_0x451884=_0x3dcaa4[_0x5cea('0x4f')];if(!_0x448912[_0x5cea('0x49')][_0x5cea('0x50')](_0x5cea('0x51'))){_0x4bd613['limit']=qs['limit'](_0x448912[_0x5cea('0x49')][_0x5cea('0x33')]);_0x4bd613[_0x5cea('0x31')]=qs[_0x5cea('0x31')](_0x448912[_0x5cea('0x49')][_0x5cea('0x31')]);}return _0x3b1b80[_0x5cea('0xbc')](_0x4bd613);}})[_0x5cea('0x22')](function(_0x261627){if(_0x261627){return _0x261627?{'count':_0x451884,'rows':_0x261627}:null;}})[_0x5cea('0x22')](respondWithResult(_0x15570e,null))[_0x5cea('0x2d')](handleError(_0x15570e,null));};exports[_0x5cea('0xab')]=function(_0x54d01a,_0x144ff1,_0x3632a5){var _0x18d77f,_0x2f05f8,_0x5e1f86;if(_[_0x5cea('0x78')](_0x54d01a[_0x5cea('0x5f')][_0x5cea('0x5f')])||_0x54d01a[_0x5cea('0x5f')]['body']===''){throw new db[(_0x5cea('0x7b'))][(_0x5cea('0x73'))](_0x5cea('0x7a'));}if(_[_0x5cea('0x78')](_0x54d01a['body']['to'])){}_0x18d77f=_0x54d01a[_0x5cea('0x5f')]['to'];return db[_0x5cea('0x43')][_0x5cea('0x6b')]({'where':{'id':_0x54d01a[_0x5cea('0x5d')]['id']}})['then'](handleEntityNotFound(_0x144ff1,null))[_0x5cea('0x22')](function(_0x50f248){if(_0x50f248){return db[_0x5cea('0x43')]['find']({'where':{'id':_0x50f248['id']},'include':[{'model':db[_0x5cea('0x7e')],'as':_0x5cea('0x7f'),'include':[{'model':db[_0x5cea('0x80')],'as':_0x5cea('0x89'),'where':{[_0x50f248[_0x5cea('0x7d')]]:_0x18d77f},'limit':0x1,'order':[[_0x5cea('0x77'),'DESC']]}]}]})[_0x5cea('0x22')](handleEntityNotFound(_0x144ff1,null))[_0x5cea('0x22')](function(_0x2d1885){if(_0x2d1885&&_0x2d1885[_0x5cea('0x7f')]){_0x2f05f8=_0x2d1885[_0x5cea('0x3c')]({'plain':!![]});if(_0x2f05f8[_0x5cea('0x7f')]&&_0x2f05f8[_0x5cea('0x7f')][_0x5cea('0x89')]['length']){return _0x2f05f8['List'][_0x5cea('0x89')][0x0];}return db[_0x5cea('0x80')]['create'](_[_0x5cea('0x19')](_0x54d01a[_0x5cea('0x5f')],{'firstName':_0x18d77f,[_0x2d1885['mapKey']]:_0x18d77f,'phone':_0x18d77f,'ListId':_0x2f05f8[_0x5cea('0x8b')]}));}})[_0x5cea('0x22')](handleEntityNotFound(_0x144ff1,null))[_0x5cea('0x22')](function(_0x28ab5d){if(_0x28ab5d){_0x5e1f86=_0x28ab5d;return db['OpenchannelInteraction'][_0x5cea('0x62')]({'where':{'ContactId':_0x5e1f86['id'],'closed':![],'OpenchannelAccountId':_0x2f05f8['id']}})[_0x5cea('0x22')](function(_0x54444a){if(_0x54444a){return[_0x54444a,![]];}return db[_0x5cea('0x8f')][_0x5cea('0x5e')]({'UserId':_0x54d01a['user']['id'],'ContactId':_0x5e1f86['id'],'OpenchannelAccountId':_0x2f05f8['id'],'lastMsgDirection':_0x5cea('0xbd'),'firstMsgDirection':'out','Messages':[_[_0x5cea('0x55')](_0x54d01a[_0x5cea('0x5f')],{'read':![],'body':_0x54d01a[_0x5cea('0x5f')][_0x5cea('0x5f')],'OpenchannelAccountId':_0x2f05f8['id'],'UserId':_0x54d01a['user']['id'],'ContactId':_0x5e1f86['id']})]},{'include':[{'model':db[_0x5cea('0xbe')],'as':_0x5cea('0xbf')}]})[_0x5cea('0x22')](function(_0xb1410e){return[_0xb1410e,!![]];});});}})[_0x5cea('0x91')](function(_0x5a54d9,_0x307a0c){if(_0x307a0c){return _0x5a54d9;}return db[_0x5cea('0xbe')][_0x5cea('0x5e')](_['merge'](_0x54d01a[_0x5cea('0x5f')],{'read':![],'body':_0x54d01a['body'][_0x5cea('0x5f')],'OpenchannelAccountId':_0x2f05f8['id'],'OpenchannelInteractionId':_0x5a54d9['id'],'UserId':_0x54d01a[_0x5cea('0x61')]['id'],'ContactId':_0x5e1f86['id']}))[_0x5cea('0x22')](function(_0x1486a1){_0x5a54d9[_0x5cea('0xc0')]['Messages']=[];_0x5a54d9[_0x5cea('0xc0')][_0x5cea('0xbf')]['push'](_0x1486a1['dataValues']);return _0x5a54d9;});});}})[_0x5cea('0x22')](respondWithResult(_0x144ff1,null))[_0x5cea('0x2d')](handleError(_0x144ff1,null));}; \ No newline at end of file +var _0xd8ee=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','Pause','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','Disposition','getDispositions','findOne','hasOwnProperty','includeAll','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','ids','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','List','account','list','applications','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','agent','forcedOwnership','Start','startRouting','EventManager','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','User','Owner','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','defaults','ListId','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x32945a,_0x3919d5){var _0x2941d4=function(_0x5cd8ca){while(--_0x5cd8ca){_0x32945a['push'](_0x32945a['shift']());}};_0x2941d4(++_0x3919d5);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x424c15,_0x4e1f19){_0x424c15=_0x424c15-0x0;var _0xc61cf9=_0xd8ee[_0x424c15];return _0xc61cf9;};'use strict';var emlformat=require(_0xed8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed8e('0x1'));var jsonpatch=require(_0xed8e('0x2'));var rp=require(_0xed8e('0x3'));var moment=require('moment');var BPromise=require(_0xed8e('0x4'));var Mustache=require(_0xed8e('0x5'));var util=require(_0xed8e('0x6'));var path=require(_0xed8e('0x7'));var sox=require(_0xed8e('0x8'));var csv=require(_0xed8e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed8e('0xa'));var _=require(_0xed8e('0xb'));var squel=require(_0xed8e('0xc'));var crypto=require(_0xed8e('0xd'));var jsforce=require(_0xed8e('0xe'));var deskjs=require(_0xed8e('0xf'));var toCsv=require(_0xed8e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed8e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed8e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed8e('0x12'))(_0xed8e('0x13'));var utils=require('../../config/utils');var config=require(_0xed8e('0x14'));var licenseUtil=require(_0xed8e('0x15'));var db=require('../../mysqldb')['db'];config[_0xed8e('0x16')]=_['defaults'](config[_0xed8e('0x16')],{'host':_0xed8e('0x17'),'port':0x18eb});var socket=require(_0xed8e('0x18'))(new Redis(config[_0xed8e('0x16')]));require(_0xed8e('0x19'))[_0xed8e('0x1a')](socket);var jayson=require(_0xed8e('0x1b'));var client=jayson[_0xed8e('0x1c')][_0xed8e('0x1d')]({'port':0x232c});var client9002=jayson[_0xed8e('0x1c')][_0xed8e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x28dd7b,_0x280499,_0x4cefe4,_0x35f69d){return new BPromise(function(_0x51a804,_0x27f63b){var _0xec2257=_0x35f69d||client;return _0xec2257['request'](_0x28dd7b,_0x4cefe4)[_0xed8e('0x1e')](function(_0x167924){logger[_0xed8e('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x280499,'request\x20sent');logger['debug'](_0xed8e('0x20'),_0x280499,_0xed8e('0x21'),JSON[_0xed8e('0x22')](_0x167924));if(_0x167924[_0xed8e('0x23')]){if(_0x167924['error']['code']===0x1f4){logger[_0xed8e('0x23')](_0xed8e('0x24'),_0x280499,_0x167924[_0xed8e('0x23')][_0xed8e('0x25')]);return _0x27f63b(_0x167924[_0xed8e('0x23')]['message']);}logger['error'](_0xed8e('0x24'),_0x280499,_0x167924['error'][_0xed8e('0x25')]);return _0x51a804(_0x167924[_0xed8e('0x23')]['message']);}else{logger[_0xed8e('0x1f')](_0xed8e('0x24'),_0x280499,'request\x20sent');_0x51a804(_0x167924[_0xed8e('0x26')]['message']);}})['catch'](function(_0x26c644){logger[_0xed8e('0x23')](_0xed8e('0x24'),_0x280499,_0x26c644);_0x27f63b(_0x26c644);});});}function respondWithStatusCode(_0x91cfdc,_0x177e05){_0x177e05=_0x177e05||0xcc;return function(_0xbbecf4){if(_0xbbecf4){return _0x91cfdc[_0xed8e('0x27')](_0x177e05);}return _0x91cfdc[_0xed8e('0x28')](_0x177e05)[_0xed8e('0x29')]();};}function respondWithResult(_0x2be2be,_0x2bd5ee){_0x2bd5ee=_0x2bd5ee||0xc8;return function(_0x4be629){if(_0x4be629){return _0x2be2be['status'](_0x2bd5ee)['json'](_0x4be629);}};}function respondWithFilteredResult(_0x3ce206,_0x177d69){return function(_0x56ca88){if(_0x56ca88){var _0x112f4b=typeof _0x177d69['offset']===_0xed8e('0x2a')&&typeof _0x177d69[_0xed8e('0x2b')]===_0xed8e('0x2a');var _0xb99b19=_0x56ca88[_0xed8e('0x2c')];var _0x432f03=_0x112f4b?0x0:_0x177d69[_0xed8e('0x2d')];var _0x8970df=_0x112f4b?_0x56ca88[_0xed8e('0x2c')]:_0x177d69['offset']+_0x177d69[_0xed8e('0x2b')];var _0x120eab;if(_0x8970df>=_0xb99b19){_0x8970df=_0xb99b19;_0x120eab=0xc8;}else{_0x120eab=0xce;}_0x3ce206[_0xed8e('0x28')](_0x120eab);return _0x3ce206[_0xed8e('0x2e')](_0xed8e('0x2f'),_0x432f03+'-'+_0x8970df+'/'+_0xb99b19)[_0xed8e('0x30')](_0x56ca88);}return null;};}function patchUpdates(_0x1e2907){return function(_0x2c7994){try{jsonpatch[_0xed8e('0x31')](_0x2c7994,_0x1e2907,!![]);}catch(_0x2c7687){return BPromise[_0xed8e('0x32')](_0x2c7687);}return _0x2c7994[_0xed8e('0x33')]();};}function saveUpdates(_0x10be92,_0x320a35){return function(_0x2c1546){if(_0x2c1546){return _0x2c1546[_0xed8e('0x34')](_0x10be92)[_0xed8e('0x1e')](function(_0x3e7e80){return _0x3e7e80;});}return null;};}function removeEntity(_0x255516,_0xb63e7e){return function(_0x43c7de){if(_0x43c7de){return _0x43c7de[_0xed8e('0x35')]()[_0xed8e('0x1e')](function(){var _0x1127d2=_0x43c7de[_0xed8e('0x36')]({'plain':!![]});var _0x49623c=_0xed8e('0x37');return db[_0xed8e('0x38')][_0xed8e('0x35')]({'where':{'type':_0x49623c,'resourceId':_0x1127d2['id']}})[_0xed8e('0x1e')](function(){return _0x43c7de;});})[_0xed8e('0x1e')](function(){_0x255516['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9f9e,_0x529e45){return function(_0x13ebf1){if(!_0x13ebf1){_0x1b9f9e[_0xed8e('0x27')](0x194);}return _0x13ebf1;};}function handleError(_0x402971,_0x438c1d){_0x438c1d=_0x438c1d||0x1f4;return function(_0x379220){logger[_0xed8e('0x23')](_0x379220[_0xed8e('0x39')]);if(_0x379220[_0xed8e('0x3a')]){delete _0x379220[_0xed8e('0x3a')];}_0x402971['status'](_0x438c1d)['send'](_0x379220);};}exports[_0xed8e('0x3b')]=function(_0x2760ca,_0x2874ac){var _0x1bac81={'include':[{'model':db['Pause'],'as':_0xed8e('0x3c')}]},_0x116423={},_0x5b2837={'count':0x0,'rows':[]};var _0x2eca2a=_[_0xed8e('0x3d')](db[_0xed8e('0x3e')][_0xed8e('0x3f')],function(_0x14dbff){return{'name':_0x14dbff[_0xed8e('0x40')],'type':_0x14dbff[_0xed8e('0x41')][_0xed8e('0x42')]};});_0x116423[_0xed8e('0x43')]=_['map'](_0x2eca2a,_0xed8e('0x3a'));_0x116423['query']=_[_0xed8e('0x44')](_0x2760ca[_0xed8e('0x45')]);_0x116423[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x116423[_0xed8e('0x43')],_0x116423['query']);_0x1bac81['attributes']=_[_0xed8e('0x47')](_0x116423['model'],qs[_0xed8e('0x48')](_0x2760ca['query'][_0xed8e('0x48')]));_0x1bac81[_0xed8e('0x49')]=_0x1bac81[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x1bac81[_0xed8e('0x49')]:_0x116423[_0xed8e('0x43')];if(!_0x2760ca['query']['hasOwnProperty'](_0xed8e('0x4b'))){_0x1bac81[_0xed8e('0x2b')]=qs['limit'](_0x2760ca[_0xed8e('0x45')][_0xed8e('0x2b')]);_0x1bac81[_0xed8e('0x2d')]=qs['offset'](_0x2760ca['query'][_0xed8e('0x2d')]);}_0x1bac81[_0xed8e('0x4c')]=qs['sort'](_0x2760ca[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x1bac81[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2760ca[_0xed8e('0x45')],_0x116423[_0xed8e('0x46')]),_0x2eca2a);if(_0x2760ca[_0xed8e('0x45')][_0xed8e('0x50')]){_0x1bac81[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x1bac81['where'],{'$or':_[_0xed8e('0x3d')](_0x2eca2a,function(_0xebe3c9){if(_0xebe3c9[_0xed8e('0x41')]!==_0xed8e('0x52')){var _0x43c4b4={};_0x43c4b4[_0xebe3c9['name']]={'$like':'%'+_0x2760ca[_0xed8e('0x45')]['filter']+'%'};return _0x43c4b4;}})});}_0x1bac81=_[_0xed8e('0x51')]({},_0x1bac81,_0x2760ca['options']);var _0x42a6df={'where':_0x1bac81[_0xed8e('0x4e')]};return db[_0xed8e('0x3e')][_0xed8e('0x2c')](_0x42a6df)[_0xed8e('0x1e')](function(_0x9bdfff){_0x5b2837[_0xed8e('0x2c')]=_0x9bdfff;if(_0x2760ca[_0xed8e('0x45')]['includeAll']){_0x1bac81['include']=[{'all':!![]}];}return db[_0xed8e('0x3e')][_0xed8e('0x53')](_0x1bac81);})['then'](function(_0x183bae){_0x5b2837[_0xed8e('0x54')]=_0x183bae;return _0x5b2837;})[_0xed8e('0x1e')](respondWithFilteredResult(_0x2874ac,_0x1bac81))[_0xed8e('0x55')](handleError(_0x2874ac,null));};exports[_0xed8e('0x56')]=function(_0x49c962,_0x45694b){var _0x342198={'raw':![],'where':{'id':_0x49c962['params']['id']},'include':[{'model':db[_0xed8e('0x57')],'as':_0xed8e('0x3c')}]},_0x17bd9b={};_0x17bd9b[_0xed8e('0x43')]=_[_0xed8e('0x44')](db['OpenchannelAccount'][_0xed8e('0x3f')]);_0x17bd9b[_0xed8e('0x45')]=_[_0xed8e('0x44')](_0x49c962['query']);_0x17bd9b['filters']=_['intersection'](_0x17bd9b[_0xed8e('0x43')],_0x17bd9b[_0xed8e('0x45')]);_0x342198[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x17bd9b[_0xed8e('0x43')],qs['fields'](_0x49c962[_0xed8e('0x45')][_0xed8e('0x48')]));_0x342198['attributes']=_0x342198[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x342198['attributes']:_0x17bd9b['model'];if(_0x49c962['query']['includeAll']){_0x342198[_0xed8e('0x58')]=[{'all':!![]}];}_0x342198=_[_0xed8e('0x51')]({},_0x342198,_0x49c962[_0xed8e('0x59')]);return db[_0xed8e('0x3e')][_0xed8e('0x5a')](_0x342198)[_0xed8e('0x1e')](handleEntityNotFound(_0x45694b,null))[_0xed8e('0x1e')](respondWithResult(_0x45694b,null))[_0xed8e('0x55')](handleError(_0x45694b,null));};exports['create']=function(_0x5cdd78,_0x5b1b9f){return db['OpenchannelAccount'][_0xed8e('0x5b')](_0x5cdd78[_0xed8e('0x5c')],{})[_0xed8e('0x1e')](function(_0x48dddf){var _0x3da66b=_0x5cdd78[_0xed8e('0x5d')][_0xed8e('0x36')]({'plain':!![]});if(!_0x3da66b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da66b[_0xed8e('0x5e')]===_0xed8e('0x5d')){var _0x116b60=_0x48dddf[_0xed8e('0x36')]({'plain':!![]});var _0x4727fe=_0xed8e('0x37');return db[_0xed8e('0x5f')][_0xed8e('0x5a')]({'where':{'name':_0x4727fe,'userProfileId':_0x3da66b[_0xed8e('0x60')]},'raw':!![]})[_0xed8e('0x1e')](function(_0x4fc90f){if(_0x4fc90f&&_0x4fc90f[_0xed8e('0x61')]===0x0){return db['UserProfileResource'][_0xed8e('0x5b')]({'name':_0x116b60[_0xed8e('0x3a')],'resourceId':_0x116b60['id'],'type':_0x4fc90f[_0xed8e('0x3a')],'sectionId':_0x4fc90f['id']},{})[_0xed8e('0x1e')](function(){return _0x48dddf;});}else{return _0x48dddf;}})[_0xed8e('0x55')](function(_0x2681ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2681ef);throw _0x2681ef;});}return _0x48dddf;})[_0xed8e('0x1e')](respondWithResult(_0x5b1b9f,0xc9))['catch'](handleError(_0x5b1b9f,null));};exports['update']=function(_0x21d518,_0x3a4dbd){if(_0x21d518['body']['id']){delete _0x21d518[_0xed8e('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x21d518['params']['id']},'include':[{'model':db[_0xed8e('0x57')],'as':_0xed8e('0x3c')}]})[_0xed8e('0x1e')](handleEntityNotFound(_0x3a4dbd,null))[_0xed8e('0x1e')](saveUpdates(_0x21d518[_0xed8e('0x5c')],null))[_0xed8e('0x1e')](respondWithResult(_0x3a4dbd,null))[_0xed8e('0x55')](handleError(_0x3a4dbd,null));};exports['destroy']=function(_0xc4696,_0x3aec9e){return db['OpenchannelAccount'][_0xed8e('0x5a')]({'where':{'id':_0xc4696[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3aec9e,null))['then'](removeEntity(_0x3aec9e,null))[_0xed8e('0x55')](handleError(_0x3aec9e,null));};exports['describe']=function(_0x47b0a4,_0x3af02a){return db[_0xed8e('0x3e')][_0xed8e('0x63')]()[_0xed8e('0x1e')](respondWithResult(_0x3af02a,null))[_0xed8e('0x55')](handleError(_0x3af02a,null));};exports['addDisposition']=function(_0x34ac5b,_0x3b40d9,_0x51eb53){if(_0x34ac5b[_0xed8e('0x5c')]['id']){delete _0x34ac5b[_0xed8e('0x5c')]['id'];}return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x34ac5b[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3b40d9,null))[_0xed8e('0x1e')](function(_0x5eff5){if(_0x5eff5){_0x34ac5b[_0xed8e('0x5c')]['OpenchannelAccountId']=_0x5eff5['id'];return db[_0xed8e('0x64')][_0xed8e('0x5b')](_0x34ac5b[_0xed8e('0x5c')]);}})['then'](respondWithResult(_0x3b40d9,null))[_0xed8e('0x55')](handleError(_0x3b40d9,null));};exports[_0xed8e('0x65')]=function(_0x3cdbaa,_0x19c0cd,_0xd5a94){var _0x214fb1={'raw':![],'where':{}};var _0x313e09={};var _0x10102a={'count':0x0,'rows':[]};return db[_0xed8e('0x3e')][_0xed8e('0x66')]({'where':{'id':_0x3cdbaa[_0xed8e('0x62')]['id']}})['then'](handleEntityNotFound(_0x19c0cd,null))['then'](function(_0x627dcc){if(_0x627dcc){_0x313e09[_0xed8e('0x43')]=_['keys'](db['Disposition'][_0xed8e('0x3f')]);_0x313e09['query']=_[_0xed8e('0x44')](_0x3cdbaa['query']);_0x313e09[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x313e09['model'],_0x313e09[_0xed8e('0x45')]);_0x214fb1[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x313e09[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x48')]));_0x214fb1[_0xed8e('0x49')]=_0x214fb1[_0xed8e('0x49')]['length']?_0x214fb1['attributes']:_0x313e09[_0xed8e('0x43')];if(!_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x214fb1['limit']=qs['limit'](_0x3cdbaa[_0xed8e('0x45')]['limit']);_0x214fb1[_0xed8e('0x2d')]=qs['offset'](_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x214fb1[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x3cdbaa[_0xed8e('0x45')]['sort']);_0x214fb1[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x3cdbaa[_0xed8e('0x45')],_0x313e09[_0xed8e('0x46')]));_0x214fb1[_0xed8e('0x4e')]['OpenchannelAccountId']=_0x627dcc['id'];if(_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x50')]){_0x214fb1[_0xed8e('0x4e')]=_['merge'](_0x214fb1[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x214fb1[_0xed8e('0x49')],function(_0x1eb26b){var _0x3a7960={};_0x3a7960[_0x1eb26b]={'$like':'%'+_0x3cdbaa['query']['filter']+'%'};return _0x3a7960;})});}_0x214fb1=_[_0xed8e('0x51')]({},_0x214fb1,_0x3cdbaa[_0xed8e('0x59')]);return db[_0xed8e('0x64')][_0xed8e('0x2c')]({'where':_0x214fb1[_0xed8e('0x4e')]})[_0xed8e('0x1e')](function(_0x593a30){_0x10102a['count']=_0x593a30;if(_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x68')]){_0x214fb1[_0xed8e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xed8e('0x53')](_0x214fb1);})[_0xed8e('0x1e')](function(_0x1ddfe5){_0x10102a[_0xed8e('0x54')]=_0x1ddfe5;return _0x10102a;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x19c0cd,_0x214fb1))['catch'](handleError(_0x19c0cd,null));};exports[_0xed8e('0x69')]=function(_0x2bdbf,_0x12d547,_0x17e6cf){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x2bdbf[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x12d547,null))[_0xed8e('0x1e')](function(_0x46c4cf){if(_0x46c4cf){return _0x46c4cf[_0xed8e('0x69')](_0x2bdbf[_0xed8e('0x45')]['ids']);}})[_0xed8e('0x1e')](respondWithStatusCode(_0x12d547,null))[_0xed8e('0x55')](handleError(_0x12d547,null));};exports[_0xed8e('0x6a')]=function(_0x1d0624,_0x55dbe9,_0x47e11a){if(_0x1d0624[_0xed8e('0x5c')]['id']){delete _0x1d0624[_0xed8e('0x5c')]['id'];}return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1d0624['params']['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x55dbe9,null))[_0xed8e('0x1e')](function(_0x3ed53d){if(_0x3ed53d){_0x1d0624[_0xed8e('0x5c')][_0xed8e('0x6b')]=_0x3ed53d['id'];return db[_0xed8e('0x6c')][_0xed8e('0x5b')](_0x1d0624[_0xed8e('0x5c')]);}})[_0xed8e('0x1e')](respondWithResult(_0x55dbe9,null))[_0xed8e('0x55')](handleError(_0x55dbe9,null));};exports[_0xed8e('0x6d')]=function(_0x4d8eb1,_0x3b945e,_0x5db453){var _0x151e30={'raw':![],'where':{}};var _0x34bee8={};var _0x2c9a4e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x4d8eb1[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3b945e,null))[_0xed8e('0x1e')](function(_0xe7a3d1){if(_0xe7a3d1){_0x34bee8[_0xed8e('0x43')]=_['keys'](db['CannedAnswer'][_0xed8e('0x3f')]);_0x34bee8['query']=_[_0xed8e('0x44')](_0x4d8eb1['query']);_0x34bee8[_0xed8e('0x46')]=_['intersection'](_0x34bee8[_0xed8e('0x43')],_0x34bee8[_0xed8e('0x45')]);_0x151e30['attributes']=_[_0xed8e('0x47')](_0x34bee8[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x48')]));_0x151e30[_0xed8e('0x49')]=_0x151e30['attributes']['length']?_0x151e30[_0xed8e('0x49')]:_0x34bee8['model'];if(!_0x4d8eb1[_0xed8e('0x45')]['hasOwnProperty'](_0xed8e('0x4b'))){_0x151e30[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x4d8eb1[_0xed8e('0x45')]['limit']);_0x151e30[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x151e30[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x4d8eb1['query'][_0xed8e('0x4d')]);_0x151e30[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x4d8eb1['query'],_0x34bee8[_0xed8e('0x46')]));_0x151e30[_0xed8e('0x4e')]['OpenchannelAccountId']=_0xe7a3d1['id'];if(_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x50')]){_0x151e30['where']=_[_0xed8e('0x51')](_0x151e30[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x151e30[_0xed8e('0x49')],function(_0x56a6c7){var _0x49170f={};_0x49170f[_0x56a6c7]={'$like':'%'+_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x50')]+'%'};return _0x49170f;})});}_0x151e30=_[_0xed8e('0x51')]({},_0x151e30,_0x4d8eb1['options']);return db[_0xed8e('0x6c')][_0xed8e('0x2c')]({'where':_0x151e30[_0xed8e('0x4e')]})['then'](function(_0x1ffdf5){_0x2c9a4e[_0xed8e('0x2c')]=_0x1ffdf5;if(_0x4d8eb1['query']['includeAll']){_0x151e30[_0xed8e('0x58')]=[{'all':!![]}];}return db[_0xed8e('0x6c')][_0xed8e('0x53')](_0x151e30);})[_0xed8e('0x1e')](function(_0x5003c3){_0x2c9a4e['rows']=_0x5003c3;return _0x2c9a4e;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x3b945e,_0x151e30))[_0xed8e('0x55')](handleError(_0x3b945e,null));};exports['removeAnswers']=function(_0x1850c2,_0x35bd1b,_0x144a5e){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1850c2[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x35bd1b,null))[_0xed8e('0x1e')](function(_0x4896a0){if(_0x4896a0){return _0x4896a0['removeAnswers'](_0x1850c2['query'][_0xed8e('0x6e')]);}})[_0xed8e('0x1e')](respondWithStatusCode(_0x35bd1b,null))[_0xed8e('0x55')](handleError(_0x35bd1b,null));};exports['notify']=function(_0x1fcb9b,_0x4b8840,_0x1a7be1){var _0x211bbf={'body':_0x1fcb9b[_0xed8e('0x5c')],'channel':_0xed8e('0x6f')};var _0x44f6bf=[];var _0x336238=[];var _0x3bec6c={};var _0x56298c=![];return db[_0xed8e('0x70')][_0xed8e('0x63')]()[_0xed8e('0x1e')](function(_0x17312f){if(!_0x17312f){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0x73'));}_0x44f6bf=_[_0xed8e('0x74')](_[_0xed8e('0x44')](_0x17312f),[_0xed8e('0x75'),_0xed8e('0x76')]);_0x336238=_[_0xed8e('0x74')](_[_0xed8e('0x44')](_0x17312f),[_0xed8e('0x75'),_0xed8e('0x76'),_0xed8e('0x77'),'ListId']);if(_0x1fcb9b['body']['id']){delete _0x1fcb9b[_0xed8e('0x5c')]['id'];}if(_['isNil'](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')])){throw new db['Sequelize'][(_0xed8e('0x72'))](_0xed8e('0x79'));}if(_['isNil'](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x5c')])||_0x1fcb9b[_0xed8e('0x5c')]['body']===''){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xed8e('0x7a')](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x7b')])){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0x7c')+_0x336238);}if(!_['includes'](_0x336238,_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x7b')])){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x336238);}_0x3bec6c[_0x1fcb9b['body'][_0xed8e('0x7b')]]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')];})['then'](function(){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1fcb9b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xed8e('0x7d'),'where':_0x3bec6c,'limit':0x1,'order':[['updatedAt',_0xed8e('0x7e')]]}]},{'model':db[_0xed8e('0x7f')],'as':_0xed8e('0x80')}]});})[_0xed8e('0x1e')](handleEntityNotFound(_0x4b8840,null))[_0xed8e('0x1e')](function(_0x1a7009){if(_0x1a7009&&_0x1a7009[_0xed8e('0x81')]){_0x211bbf[_0xed8e('0x82')]=_0x1a7009;_0x211bbf['applications']=_0x1a7009['Applications'];_0x211bbf[_0xed8e('0x83')]=_0x1a7009['List'];_0x211bbf[_0xed8e('0x84')]=_[_0xed8e('0x85')](_0x211bbf[_0xed8e('0x84')],[_0xed8e('0x86')],[_0xed8e('0x87')]);if(_0x211bbf[_0xed8e('0x82')]['Applications']){delete _0x211bbf[_0xed8e('0x82')][_0xed8e('0x80')];}if(_0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]&&_0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]['Contacts']['length']){return _0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]['Contacts'][0x0];}var _0xcde89e=_['defaults'](_0x1fcb9b[_0xed8e('0x5c')],{'firstName':_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')],'ListId':_0x1a7009['ListId']});_0xcde89e[_0x1fcb9b[_0xed8e('0x5c')]['mapKey']]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')];return db[_0xed8e('0x70')][_0xed8e('0x5b')](_0xcde89e,{'fields':_0x44f6bf,'raw':!![]});}})[_0xed8e('0x1e')](handleEntityNotFound(_0x4b8840,null))[_0xed8e('0x1e')](function(_0x379218){_0x211bbf['contact']=_0x379218;if(_0x379218){var _0x42711f={'ContactId':_0x379218['id'],'OpenchannelAccountId':_0x1fcb9b['params']['id'],'from':(_0x379218[_0xed8e('0x88')]||'')+'\x20'+(_0x379218[_0xed8e('0x89')]||'')};var _0x3807b0={'OpenchannelAccountId':_0x1fcb9b[_0xed8e('0x62')]['id'],'closed':![]};if(_0x1fcb9b['body'][_0xed8e('0x8a')]){_0x3807b0[_0xed8e('0x8a')]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x8a')];return db[_0xed8e('0x8b')]['find']({'where':_0x3807b0})[_0xed8e('0x1e')](function(_0x32367f){if(_0x32367f){return[_0x32367f,![]];}_0x42711f[_0xed8e('0x8a')]=_0x1fcb9b['body']['threadId'];_0x42711f[_0xed8e('0x8c')]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x8c')];return db[_0xed8e('0x8b')][_0xed8e('0x5b')](_0x42711f)[_0xed8e('0x1e')](function(_0x388dde){return[_0x388dde,!![]];});});}else{_0x3807b0[_0xed8e('0x8a')]=null;}_0x3807b0[_0xed8e('0x8d')]=_0x379218['id'];return db[_0xed8e('0x8b')][_0xed8e('0x5a')]({'where':_0x3807b0})[_0xed8e('0x1e')](function(_0x40f045){if(_0x40f045){return[_0x40f045,![]];}return db['OpenchannelInteraction'][_0xed8e('0x5b')](_0x42711f)[_0xed8e('0x1e')](function(_0x5b8dd7){return[_0x5b8dd7,!![]];});});}})[_0xed8e('0x8e')](function(_0x4894e8,_0x5efec7){if(_0x4894e8){_0x56298c=_0x5efec7;if(!_0x5efec7){var _0x380bb7={'from':(_0x211bbf[_0xed8e('0x8f')][_0xed8e('0x88')]||'')+'\x20'+(_0x211bbf[_0xed8e('0x8f')][_0xed8e('0x89')]||'')};if(_0x1fcb9b['body'][_0xed8e('0x8a')]&&_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x90')]&&_0x1fcb9b['body']['threadId']!=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x90')]){_0x380bb7[_0xed8e('0x8a')]=_0x1fcb9b['body'][_0xed8e('0x90')];}return _0x4894e8[_0xed8e('0x34')](_0x380bb7);}else{return _0x4894e8;}}})[_0xed8e('0x1e')](function(_0x9d342e){_0x211bbf[_0xed8e('0x91')]=_0x9d342e[_0xed8e('0x36')]({'plain':!![]});_0x211bbf[_0xed8e('0x91')][_0xed8e('0x92')]=_0x56298c;if(_0x211bbf[_0xed8e('0x91')][_0xed8e('0x92')]){if(_0x211bbf[_0xed8e('0x82')][_0xed8e('0x93')]){_0x211bbf[_0xed8e('0x84')][_0xed8e('0x94')]({'id':0x0,'priority':_0x211bbf[_0xed8e('0x84')][_0xed8e('0x4a')]+0x1,'app':_0xed8e('0x95'),'appdata':_0xed8e('0x96'),'interval':_0xed8e('0x97')});}}return db[_0xed8e('0x98')][_0xed8e('0x5b')]({'body':_0x1fcb9b['body'][_0xed8e('0x5c')],'OpenchannelAccountId':_0x1fcb9b['params']['id'],'OpenchannelInteractionId':_0x9d342e['id'],'direction':'in','ContactId':_0x211bbf[_0xed8e('0x8f')]['id'],'AttachmentId':_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x99')]});})['then'](function(_0x5f3e8a){_0x211bbf[_0xed8e('0x25')]=_0x5f3e8a;if(_0x211bbf[_0xed8e('0x91')]['UserId']){return db['User']['find']({'attributes':['id',_0xed8e('0x3a')],'where':{'id':_0x211bbf[_0xed8e('0x91')][_0xed8e('0x9a')]}})[_0xed8e('0x1e')](function(_0x14fa08){if(_0x14fa08){_0x211bbf[_0xed8e('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0xed8e('0x9b'),'appdata':_0x14fa08[_0xed8e('0x3a')]+','+(_0x211bbf[_0xed8e('0x82')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x211bbf[_0xed8e('0x9c')]=![];}return respondWithRpcPromise(_0xed8e('0x9d'),_0xed8e('0x9e'),_0x211bbf);});}return respondWithRpcPromise(_0xed8e('0x9d'),_0xed8e('0x9e'),_0x211bbf);})[_0xed8e('0x1e')](function(_0x3a92fc){respondWithRpcPromise(_0xed8e('0x9f'),'EventManager',{'event':'notify','message':_0x3a92fc},client9002);return _0x3a92fc;})[_0xed8e('0x1e')](respondWithResult(_0x4b8840,null))[_0xed8e('0x55')](handleError(_0x4b8840,null));};exports['addApplications']=function(_0x477812,_0xad91dd){var _0x4d3738=_0x477812[_0xed8e('0x62')]['id'];var _0x340203=_0x477812['body'];var _0x43cb76=0xc8;var _0x3e18c4=null;return db[_0xed8e('0xa0')]['transaction']({'isolationLevel':db[_0xed8e('0xa0')]['Transaction'][_0xed8e('0xa1')][_0xed8e('0xa2')]},function(_0x353aae){return db[_0xed8e('0x3e')][_0xed8e('0x66')]({'where':{'id':_0x4d3738},'transaction':_0x353aae})[_0xed8e('0x1e')](function(_0x1615a7){if(_0x1615a7){return db['OpenchannelApplication'][_0xed8e('0x35')]({'where':{'OpenchannelAccountId':_0x4d3738},'transaction':_0x353aae})[_0xed8e('0x1e')](function(){var _0x101238=_[_0xed8e('0x3d')](_0x340203,function(_0x15aa91){_0x15aa91[_0xed8e('0x6b')]=_0x4d3738;return _0x15aa91;});return db[_0xed8e('0x7f')][_0xed8e('0xa3')](_0x101238,{'transaction':_0x353aae});});}else{_0x43cb76=0x194;_0x3e18c4=[];}});})[_0xed8e('0x1e')](function(){if(_0x43cb76!==0x194){return db[_0xed8e('0x7f')][_0xed8e('0xa4')]({'where':{'OpenchannelAccountId':_0x4d3738},'order':'priority'})[_0xed8e('0x1e')](function(_0x38a251){_0x3e18c4=_0x38a251;});}})[_0xed8e('0x55')](function(_0x6649b9){_0x43cb76=0x1f4;logger[_0xed8e('0x23')](_0x6649b9['stack']);if(_0x6649b9['name']){delete _0x6649b9[_0xed8e('0x3a')];}_0x3e18c4=_0x6649b9;})[_0xed8e('0xa5')](function(){if(_0x3e18c4===null){_0xad91dd[_0xed8e('0x27')](_0x43cb76);}else{if(_0x43cb76===0x1f4){_0xad91dd['status'](_0x43cb76)['send'](_0x3e18c4);}else{_0xad91dd[_0xed8e('0x28')](_0x43cb76)['json'](_0x3e18c4);}}});};exports[_0xed8e('0xa6')]=function(_0x1352b4,_0x15b21a,_0x3ff7ba){var _0x81d053={};var _0xf32e33={};var _0x2dcc8a;var _0x392cea;return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x1352b4[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x15b21a,null))['then'](function(_0x9f5ed9){if(_0x9f5ed9){_0x2dcc8a=_0x9f5ed9;_0xf32e33[_0xed8e('0x43')]=_[_0xed8e('0x44')](db['OpenchannelApplication'][_0xed8e('0x3f')]);_0xf32e33['query']=_[_0xed8e('0x44')](_0x1352b4[_0xed8e('0x45')]);_0xf32e33[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0xf32e33[_0xed8e('0x43')],_0xf32e33[_0xed8e('0x45')]);_0x81d053[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0xf32e33[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x1352b4['query'][_0xed8e('0x48')]));_0x81d053[_0xed8e('0x49')]=_0x81d053[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x81d053[_0xed8e('0x49')]:_0xf32e33[_0xed8e('0x43')];_0x81d053[_0xed8e('0x4c')]=qs['sort'](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x81d053[_0xed8e('0x4e')]=qs['filters'](_[_0xed8e('0x4f')](_0x1352b4[_0xed8e('0x45')],_0xf32e33[_0xed8e('0x46')]));if(_0x1352b4['query'][_0xed8e('0x50')]){_0x81d053[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x81d053[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x81d053['attributes'],function(_0x7caa64){var _0x3964c3={};_0x3964c3[_0x7caa64]={'$like':'%'+_0x1352b4[_0xed8e('0x45')]['filter']+'%'};return _0x3964c3;})});}_0x81d053=_[_0xed8e('0x51')]({},_0x81d053,_0x1352b4[_0xed8e('0x59')]);return _0x2dcc8a[_0xed8e('0xa6')](_0x81d053);}})[_0xed8e('0x1e')](function(_0x53ec47){if(_0x53ec47){_0x392cea=_0x53ec47['length'];if(!_0x1352b4[_0xed8e('0x45')]['hasOwnProperty']('nolimit')){_0x81d053[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x2b')]);_0x81d053[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x2d')]);}return _0x2dcc8a['getApplications'](_0x81d053);}})[_0xed8e('0x1e')](function(_0x59d438){if(_0x59d438){return _0x59d438?{'count':_0x392cea,'rows':_0x59d438}:null;}})[_0xed8e('0x1e')](respondWithResult(_0x15b21a,null))[_0xed8e('0x55')](handleError(_0x15b21a,null));};exports[_0xed8e('0xa7')]=function(_0x2837c6,_0x90e8e2,_0x4570a6){var _0x369872={'raw':![],'where':{}};var _0x248826={};var _0x4f275d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x2837c6[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x90e8e2,null))['then'](function(_0x56e210){if(_0x56e210){_0x248826[_0xed8e('0x43')]=_[_0xed8e('0x44')](db[_0xed8e('0x8b')][_0xed8e('0x3f')]);_0x248826['query']=_[_0xed8e('0x44')](_0x2837c6['query']);_0x248826[_0xed8e('0x46')]=_['intersection'](_0x248826[_0xed8e('0x43')],_0x248826[_0xed8e('0x45')]);_0x369872[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x248826[_0xed8e('0x43')],qs['fields'](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x48')]));_0x369872['attributes']=_0x369872[_0xed8e('0x49')]['length']?_0x369872[_0xed8e('0x49')]:_0x248826[_0xed8e('0x43')];if(!_0x2837c6['query'][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x369872[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x2837c6['query'][_0xed8e('0x2b')]);_0x369872[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x369872[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x369872['where']=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2837c6[_0xed8e('0x45')],_0x248826[_0xed8e('0x46')]));_0x369872[_0xed8e('0x4e')][_0xed8e('0x6b')]=_0x56e210['id'];if(_0x2837c6[_0xed8e('0x45')][_0xed8e('0x50')]){_0x369872['where']=_['merge'](_0x369872[_0xed8e('0x4e')],{'$or':_['map'](_0x369872[_0xed8e('0x49')],function(_0x5c35ef){var _0x145b1f={};_0x145b1f[_0x5c35ef]={'$like':'%'+_0x2837c6[_0xed8e('0x45')][_0xed8e('0x50')]+'%'};return _0x145b1f;})});}_0x369872=_['merge']({},_0x369872,_0x2837c6[_0xed8e('0x59')]);return db[_0xed8e('0x8b')][_0xed8e('0x2c')]({'where':_0x369872[_0xed8e('0x4e')]})['then'](function(_0x57a39a){_0x4f275d[_0xed8e('0x2c')]=_0x57a39a;if(_0x2837c6[_0xed8e('0x45')][_0xed8e('0x68')]){_0x369872[_0xed8e('0x58')]=[{'model':db[_0xed8e('0x70')],'as':'Contact','required':![]},{'model':db[_0xed8e('0xa8')],'as':_0xed8e('0xa9'),'attributes':[_0xed8e('0x3a'),_0xed8e('0xaa'),_0xed8e('0xab')],'required':![]},{'model':db['Tag'],'as':_0xed8e('0xac'),'attributes':['id',_0xed8e('0x3a'),_0xed8e('0xad')],'where':_0x2837c6[_0xed8e('0x45')][_0xed8e('0xae')]?{'id':_0x2837c6[_0xed8e('0x45')]['tag']}:undefined,'required':_0x2837c6[_0xed8e('0x45')][_0xed8e('0xae')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xed8e('0x53')](_0x369872);})['then'](function(_0x33d032){_0x4f275d['rows']=_0x33d032;return _0x4f275d;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x90e8e2,_0x369872))[_0xed8e('0x55')](handleError(_0x90e8e2,null));};exports['addAgents']=function(_0x576387,_0x3729fb,_0x4e353a){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x576387[_0xed8e('0x62')]['id']}})['then'](handleEntityNotFound(_0x3729fb,null))[_0xed8e('0x1e')](function(_0x1d2bdc){if(_0x1d2bdc){return _0x1d2bdc[_0xed8e('0xaf')](_0x576387[_0xed8e('0x5c')][_0xed8e('0x6e')],_['omit'](_0x576387[_0xed8e('0x5c')],['ids','id'])||{})[_0xed8e('0x8e')](function(_0x37e59f){for(var _0x57c0d8=0x0;_0x57c0d8<_0x576387['body']['ids'][_0xed8e('0x4a')];_0x57c0d8+=0x1){socket[_0xed8e('0xb0')](_0xed8e('0xb1'),{'UserId':Number(_0x576387[_0xed8e('0x5c')][_0xed8e('0x6e')][_0x57c0d8]),'OpenchannelAccountId':Number(_0x576387[_0xed8e('0x62')]['id'])});}return _0x37e59f;});}})[_0xed8e('0x1e')](respondWithResult(_0x3729fb,null))[_0xed8e('0x55')](handleError(_0x3729fb,null));};exports[_0xed8e('0xb2')]=function(_0x15d584,_0x2e20bb,_0x33b3e7){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x15d584[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x2e20bb,null))[_0xed8e('0x1e')](function(_0x361827){if(_0x361827){return _0x361827[_0xed8e('0xb2')](_0x15d584[_0xed8e('0x45')]['ids'])[_0xed8e('0x1e')](function(){if(_['isArray'](_0x15d584[_0xed8e('0x45')]['ids'])){for(var _0xe8e6c8=0x0;_0xe8e6c8<_0x15d584['query'][_0xed8e('0x6e')][_0xed8e('0x4a')];_0xe8e6c8+=0x1){socket[_0xed8e('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x15d584['query'][_0xed8e('0x6e')][_0xe8e6c8]),'OpenchannelAccountId':Number(_0x15d584['params']['id'])});}}else{socket[_0xed8e('0xb0')](_0xed8e('0xb3'),{'UserId':Number(_0x15d584[_0xed8e('0x45')][_0xed8e('0x6e')]),'OpenchannelAccountId':Number(_0x15d584[_0xed8e('0x62')]['id'])});}});}})[_0xed8e('0x1e')](respondWithStatusCode(_0x2e20bb,null))[_0xed8e('0x55')](handleError(_0x2e20bb,null));};exports[_0xed8e('0xb4')]=function(_0x2c86e8,_0x397b5e,_0x36bcbb){var _0x46eafa={};var _0x1ee1d0={};var _0x3b272c;var _0x5742f6;return db[_0xed8e('0x3e')]['findOne']({'where':{'id':_0x2c86e8[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x397b5e,null))[_0xed8e('0x1e')](function(_0x510b9d){if(_0x510b9d){_0x3b272c=_0x510b9d;_0x1ee1d0[_0xed8e('0x43')]=_[_0xed8e('0x44')](db[_0xed8e('0xa8')]['rawAttributes']);_0x1ee1d0[_0xed8e('0x45')]=_[_0xed8e('0x44')](_0x2c86e8[_0xed8e('0x45')]);_0x1ee1d0[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x1ee1d0[_0xed8e('0x43')],_0x1ee1d0[_0xed8e('0x45')]);_0x46eafa['attributes']=_['intersection'](_0x1ee1d0[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x2c86e8[_0xed8e('0x45')]['fields']));_0x46eafa['attributes']=_0x46eafa[_0xed8e('0x49')]['length']?_0x46eafa['attributes']:_0x1ee1d0['model'];_0x46eafa[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x2c86e8[_0xed8e('0x45')]['sort']);_0x46eafa[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2c86e8[_0xed8e('0x45')],_0x1ee1d0['filters']));if(_0x2c86e8[_0xed8e('0x45')][_0xed8e('0x50')]){_0x46eafa[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x46eafa[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x46eafa[_0xed8e('0x49')],function(_0x1bb460){var _0x105f5e={};_0x105f5e[_0x1bb460]={'$like':'%'+_0x2c86e8['query']['filter']+'%'};return _0x105f5e;})});}_0x46eafa=_[_0xed8e('0x51')]({},_0x46eafa,_0x2c86e8[_0xed8e('0x59')]);return _0x3b272c[_0xed8e('0xb4')](_0x46eafa);}})['then'](function(_0x5d7adf){if(_0x5d7adf){_0x5742f6=_0x5d7adf[_0xed8e('0x4a')];if(!_0x2c86e8[_0xed8e('0x45')][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x46eafa[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x2c86e8['query'][_0xed8e('0x2b')]);_0x46eafa[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x2c86e8[_0xed8e('0x45')]['offset']);}return _0x3b272c[_0xed8e('0xb4')](_0x46eafa);}})[_0xed8e('0x1e')](function(_0x110f23){if(_0x110f23){return _0x110f23?{'count':_0x5742f6,'rows':_0x110f23}:null;}})[_0xed8e('0x1e')](respondWithResult(_0x397b5e,null))[_0xed8e('0x55')](handleError(_0x397b5e,null));};exports[_0xed8e('0xb5')]=function(_0x171a29,_0x348e1c,_0x55eef3){var _0x343abc,_0x511174,_0x26b17a;if(_['isNil'](_0x171a29['body'][_0xed8e('0x5c')])||_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')]===''){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0xb6'));}if(_[_0xed8e('0x7a')](_0x171a29[_0xed8e('0x5c')]['to'])){}_0x343abc=_0x171a29[_0xed8e('0x5c')]['to'];return db[_0xed8e('0x3e')]['findOne']({'where':{'id':_0x171a29[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))['then'](function(_0x3461e0){if(_0x3461e0){return db[_0xed8e('0x3e')]['find']({'where':{'id':_0x3461e0['id']},'include':[{'model':db[_0xed8e('0xb7')],'as':'List','include':[{'model':db[_0xed8e('0x70')],'as':_0xed8e('0x7d'),'where':{[_0x3461e0[_0xed8e('0x7b')]]:_0x343abc},'limit':0x1,'order':[[_0xed8e('0x76'),_0xed8e('0x7e')]]}]}]})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))[_0xed8e('0x1e')](function(_0x2b565c){if(_0x2b565c&&_0x2b565c[_0xed8e('0x81')]){_0x511174=_0x2b565c[_0xed8e('0x36')]({'plain':!![]});if(_0x511174[_0xed8e('0x81')]&&_0x511174[_0xed8e('0x81')][_0xed8e('0x7d')][_0xed8e('0x4a')]){return _0x511174['List'][_0xed8e('0x7d')][0x0];}return db[_0xed8e('0x70')][_0xed8e('0x5b')](_[_0xed8e('0xb8')](_0x171a29[_0xed8e('0x5c')],{'firstName':_0x343abc,[_0x2b565c[_0xed8e('0x7b')]]:_0x343abc,'phone':_0x343abc,'ListId':_0x511174[_0xed8e('0xb9')]}));}})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))['then'](function(_0x2206bc){if(_0x2206bc){_0x26b17a=_0x2206bc;return db[_0xed8e('0x8b')][_0xed8e('0x5a')]({'where':{'ContactId':_0x26b17a['id'],'closed':![],'OpenchannelAccountId':_0x511174['id']}})[_0xed8e('0x1e')](function(_0x1228a6){if(_0x1228a6){return[_0x1228a6,![]];}return db[_0xed8e('0x8b')][_0xed8e('0x5b')]({'UserId':_0x171a29['user']['id'],'ContactId':_0x26b17a['id'],'OpenchannelAccountId':_0x511174['id'],'lastMsgDirection':'out','firstMsgDirection':_0xed8e('0xba'),'Messages':[_[_0xed8e('0x51')](_0x171a29['body'],{'read':![],'body':_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')],'OpenchannelAccountId':_0x511174['id'],'UserId':_0x171a29[_0xed8e('0x5d')]['id'],'ContactId':_0x26b17a['id']})]},{'include':[{'model':db[_0xed8e('0x98')],'as':_0xed8e('0xbb')}]})[_0xed8e('0x1e')](function(_0x40819a){return[_0x40819a,!![]];});});}})['spread'](function(_0x3f8d83,_0x13cfab){if(_0x13cfab){return _0x3f8d83;}return db[_0xed8e('0x98')][_0xed8e('0x5b')](_[_0xed8e('0x51')](_0x171a29[_0xed8e('0x5c')],{'read':![],'body':_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')],'OpenchannelAccountId':_0x511174['id'],'OpenchannelInteractionId':_0x3f8d83['id'],'UserId':_0x171a29[_0xed8e('0x5d')]['id'],'ContactId':_0x26b17a['id']}))['then'](function(_0x485dd8){_0x3f8d83['dataValues'][_0xed8e('0xbb')]=[];_0x3f8d83[_0xed8e('0xbc')][_0xed8e('0xbb')][_0xed8e('0x94')](_0x485dd8[_0xed8e('0xbc')]);return _0x3f8d83;});});}})['then'](respondWithResult(_0x348e1c,null))['catch'](handleError(_0x348e1c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index b3aa9b9..c1e5764 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','OpenchannelAccount','setMaxListeners'];(function(_0x55852e,_0x35e58d){var _0x3ced5d=function(_0x465d3c){while(--_0x465d3c){_0x55852e['push'](_0x55852e['shift']());}};_0x3ced5d(++_0x35e58d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0xcb91[_0xd816e2];return _0x1f5924;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x1cb9('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){OpenchannelAccountEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);OpenchannelAccountEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];OpenchannelAccount[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x6324=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit'];(function(_0x59e1e9,_0x3c3840){var _0x2bd878=function(_0x3c66a3){while(--_0x3c66a3){_0x59e1e9['push'](_0x59e1e9['shift']());}};_0x2bd878(++_0x3c3840);}(_0x6324,0x142));var _0x4632=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x6324[_0x35b7d4];return _0x4e8cee;};'use strict';var EventEmitter=require(_0x4632('0x0'));var OpenchannelAccount=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bea40){return function(_0x54c200,_0x13b218,_0x592e39){OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40+':'+_0x54c200['id'],_0x54c200);OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40,_0x54c200);_0x592e39(null);};}for(var e in events){if(events[_0x4632('0x6')](e)){var event=events[e];OpenchannelAccount[_0x4632('0x7')](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 0880161..a69dcaf 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 _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x39e5ff,_0x5c404e){var _0x332f9a=function(_0x2e7792){while(--_0x2e7792){_0x39e5ff['push'](_0x39e5ff['shift']());}};_0x332f9a(++_0x5c404e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x407270,_0x389e7c){var _0x2f25db=function(_0x5119cd){while(--_0x5119cd){_0x407270['push'](_0x407270['shift']());}};_0x2f25db(++_0x389e7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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':'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 a778fe2..0456f23 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 _0x6cb4=['register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1cd1d1,_0x52d54f){var _0x589132=function(_0xd8ab73){while(--_0xd8ab73){_0x1cd1d1['push'](_0x1cd1d1['shift']());}};_0x589132(++_0x52d54f);}(_0x6cb4,0xff));var _0x46cb=function(_0x39924b,_0x5a0b35){_0x39924b=_0x39924b-0x0;var _0x2236d=_0x6cb4[_0x39924b];return _0x2236d;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./openchannelAccount.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});} \ No newline at end of file +var _0xe130=['then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe130,0x127));var _0x0e13=function(_0x173d17,_0x1617f6){_0x173d17=_0x173d17-0x0;var _0x49abf9=_0xe130[_0x173d17];return _0x49abf9;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});config[_0x0e13('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e13('0xc'))(new Redis(config[_0x0e13('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2906e9,_0x124e0d,_0x3aad73){return new BPromise(function(_0x2e385d,_0x53f9a9){return client['request'](_0x2906e9,_0x3aad73)[_0x0e13('0xd')](function(_0x37a04e){logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');logger[_0x0e13('0x10')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x124e0d,_0x0e13('0x11'),JSON[_0x0e13('0x12')](_0x37a04e));if(_0x37a04e[_0x0e13('0x13')]){if(_0x37a04e[_0x0e13('0x13')][_0x0e13('0x14')]===0x1f4){logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x53f9a9(_0x37a04e['error'][_0x0e13('0x15')]);}logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x2e385d(_0x37a04e[_0x0e13('0x13')]['message']);}else{logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');_0x2e385d(_0x37a04e['result'][_0x0e13('0x15')]);}})['catch'](function(_0x2063ca){logger['error'](_0x0e13('0xf'),_0x124e0d,_0x2063ca);_0x53f9a9(_0x2063ca);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index de675ba..1ec7d0e 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 _0xd1d4=['save','update','emit','removeListener','register','length','./openchannelAccount.events'];(function(_0x5b1d35,_0x325242){var _0x2c2965=function(_0x3ae9d0){while(--_0x3ae9d0){_0x5b1d35['push'](_0x5b1d35['shift']());}};_0x2c2965(++_0x325242);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd1d4[_0x5f0089];return _0x193892;};'use strict';var OpenchannelAccountEvents=require(_0x4d1d('0x0'));var events=[_0x4d1d('0x1'),'remove',_0x4d1d('0x2')];function createListener(_0x54f44c,_0x5ed209){return function(_0x2fdf2e){_0x5ed209[_0x4d1d('0x3')](_0x54f44c,_0x2fdf2e);};}function removeListener(_0x260e6a,_0x3bcfda){return function(){OpenchannelAccountEvents[_0x4d1d('0x4')](_0x260e6a,_0x3bcfda);};}exports[_0x4d1d('0x5')]=function(_0x30466a){for(var _0xb8a403=0x0,_0x1547d5=events[_0x4d1d('0x6')];_0xb8a403<_0x1547d5;_0xb8a403++){var _0x23f6c4=events[_0xb8a403];var _0x54da0f=createListener('openchannelAccount:'+_0x23f6c4,_0x30466a);OpenchannelAccountEvents['on'](_0x23f6c4,_0x54da0f);}}; \ No newline at end of file +var _0x9090=['remove','update','emit','register','length','./openchannelAccount.events','save'];(function(_0x2d5e39,_0x39b71d){var _0x4260f0=function(_0x37d89f){while(--_0x37d89f){_0x2d5e39['push'](_0x2d5e39['shift']());}};_0x4260f0(++_0x39b71d);}(_0x9090,0x17f));var _0x0909=function(_0x3bf120,_0x58885e){_0x3bf120=_0x3bf120-0x0;var _0x3c92cc=_0x9090[_0x3bf120];return _0x3c92cc;};'use strict';var OpenchannelAccountEvents=require(_0x0909('0x0'));var events=[_0x0909('0x1'),_0x0909('0x2'),_0x0909('0x3')];function createListener(_0x27eba2,_0x5466c8){return function(_0x51923f){_0x5466c8[_0x0909('0x4')](_0x27eba2,_0x51923f);};}function removeListener(_0x289665,_0x29bc19){return function(){OpenchannelAccountEvents['removeListener'](_0x289665,_0x29bc19);};}exports[_0x0909('0x5')]=function(_0x42af40){for(var _0x5317db=0x0,_0x41d8fc=events[_0x0909('0x6')];_0x5317db<_0x41d8fc;_0x5317db++){var _0x32bf48=events[_0x5317db];var _0x1755ee=createListener('openchannelAccount:'+_0x32bf48,_0x42af40);OpenchannelAccountEvents['on'](_0x32bf48,_0x1755ee);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 52cb7bd..9974f4d 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 _0xb7af=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','show','post','isAuthenticated','create','put','destroy','exports','multer'];(function(_0x2fc8a8,_0x71c3a2){var _0x3597b4=function(_0x41c345){while(--_0x41c345){_0x2fc8a8['push'](_0x2fc8a8['shift']());}};_0x3597b4(++_0x71c3a2);}(_0xb7af,0x1c1));var _0xfb7a=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0xb7af[_0xbf5e16];return _0x5975a5;};'use strict';var multer=require(_0xfb7a('0x0'));var util=require('util');var path=require(_0xfb7a('0x1'));var timeout=require(_0xfb7a('0x2'));var express=require(_0xfb7a('0x3'));var router=express[_0xfb7a('0x4')]();var fs_extra=require(_0xfb7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7a('0x6'));var config=require(_0xfb7a('0x7'));var controller=require(_0xfb7a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfb7a('0x9')](_0xfb7a('0xa'),auth['isAuthenticated'](),controller[_0xfb7a('0xb')]);router[_0xfb7a('0xc')]('/',auth[_0xfb7a('0xd')](),controller[_0xfb7a('0xe')]);router[_0xfb7a('0xf')]('/:id',auth[_0xfb7a('0xd')](),controller['update']);router['delete'](_0xfb7a('0xa'),auth[_0xfb7a('0xd')](),controller[_0xfb7a('0x10')]);module[_0xfb7a('0x11')]=router; \ No newline at end of file +var _0xaae0=['/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x3b90bb,_0x24cb38){var _0x45ef92=function(_0x4472bb){while(--_0x4472bb){_0x3b90bb['push'](_0x3b90bb['shift']());}};_0x45ef92(++_0x24cb38);}(_0xaae0,0x72));var _0x0aae=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaae0[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x0aae('0x0'));var util=require(_0x0aae('0x1'));var path=require(_0x0aae('0x2'));var timeout=require(_0x0aae('0x3'));var express=require('express');var router=express[_0x0aae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0aae('0x5'));var interaction=require(_0x0aae('0x6'));var config=require(_0x0aae('0x7'));var controller=require(_0x0aae('0x8'));router[_0x0aae('0x9')]('/',auth[_0x0aae('0xa')](),controller[_0x0aae('0xb')]);router['get'](_0x0aae('0xc'),auth[_0x0aae('0xa')](),controller['show']);router['post']('/',auth[_0x0aae('0xa')](),controller['create']);router[_0x0aae('0xd')]('/:id',auth[_0x0aae('0xa')](),controller[_0x0aae('0xe')]);router[_0x0aae('0xf')](_0x0aae('0xc'),auth[_0x0aae('0xa')](),controller[_0x0aae('0x10')]);module[_0x0aae('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index fa1dae6..8820e17 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 _0x685c=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x1202a6,_0x29b04e){var _0x31dc2a=function(_0x9f5c31){while(--_0x9f5c31){_0x1202a6['push'](_0x1202a6['shift']());}};_0x31dc2a(++_0x29b04e);}(_0x685c,0xd3));var _0xc685=function(_0x3c5dd5,_0x26e153){_0x3c5dd5=_0x3c5dd5-0x0;var _0xf9fcdb=_0x685c[_0x3c5dd5];return _0xf9fcdb;};'use strict';var Sequelize=require(_0xc685('0x0'));module[_0xc685('0x1')]={'priority':{'type':Sequelize[_0xc685('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc685('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc685('0x4')]()},'description':{'type':Sequelize[_0xc685('0x3')]},'interval':{'type':Sequelize[_0xc685('0x3')],'defaultValue':_0xc685('0x5')}}; \ No newline at end of file +var _0x02a7=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x3b2879,_0x4071fa){var _0x4f46f0=function(_0x1dc691){while(--_0x1dc691){_0x3b2879['push'](_0x3b2879['shift']());}};_0x4f46f0(++_0x4071fa);}(_0x02a7,0x12d));var _0x702a=function(_0x46b031,_0x50794c){_0x46b031=_0x46b031-0x0;var _0x59126d=_0x02a7[_0x46b031];return _0x59126d;};'use strict';var Sequelize=require(_0x702a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x702a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x702a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x702a('0x3')]()},'description':{'type':Sequelize[_0x702a('0x2')]},'interval':{'type':Sequelize[_0x702a('0x2')],'defaultValue':_0x702a('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index bfca633..cfe4fb7 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 _0x5e1e=['apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','fields','include','find','catch','create','body','params','eml-format','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','limit','undefined','count','set','Content-Range','json'];(function(_0x3140fa,_0x4c9cdd){var _0x30551e=function(_0x275987){while(--_0x275987){_0x3140fa['push'](_0x3140fa['shift']());}};_0x30551e(++_0x4c9cdd);}(_0x5e1e,0x101));var _0xe5e1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5e1e[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0xe5e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5e1('0x2'));var moment=require(_0xe5e1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe5e1('0x4'));var sox=require(_0xe5e1('0x5'));var csv=require(_0xe5e1('0x6'));var ejs=require(_0xe5e1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5e1('0x8'));var squel=require(_0xe5e1('0x9'));var crypto=require(_0xe5e1('0xa'));var jsforce=require(_0xe5e1('0xb'));var deskjs=require(_0xe5e1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe5e1('0xd'));var Papa=require(_0xe5e1('0xe'));var Redis=require('ioredis');var authService=require(_0xe5e1('0xf'));var qs=require(_0xe5e1('0x10'));var as=require(_0xe5e1('0x11'));var hardwareService=require(_0xe5e1('0x12'));var logger=require('../../config/logger')(_0xe5e1('0x13'));var utils=require('../../config/utils');var config=require(_0xe5e1('0x14'));var licenseUtil=require(_0xe5e1('0x15'));var db=require(_0xe5e1('0x16'))['db'];function respondWithStatusCode(_0x48a2ba,_0x43f870){_0x43f870=_0x43f870||0xcc;return function(_0x12d878){if(_0x12d878){return _0x48a2ba[_0xe5e1('0x17')](_0x43f870);}return _0x48a2ba['status'](_0x43f870)['end']();};}function respondWithResult(_0x4129ea,_0x3290d0){_0x3290d0=_0x3290d0||0xc8;return function(_0x1accdc){if(_0x1accdc){return _0x4129ea['status'](_0x3290d0)['json'](_0x1accdc);}};}function respondWithFilteredResult(_0x477988,_0x110000){return function(_0xad53f5){if(_0xad53f5){var _0x5d5b47=typeof _0x110000[_0xe5e1('0x18')]==='undefined'&&typeof _0x110000[_0xe5e1('0x19')]===_0xe5e1('0x1a');var _0x5bb7d1=_0xad53f5[_0xe5e1('0x1b')];var _0x48b946=_0x5d5b47?0x0:_0x110000[_0xe5e1('0x18')];var _0x2dec72=_0x5d5b47?_0xad53f5[_0xe5e1('0x1b')]:_0x110000[_0xe5e1('0x18')]+_0x110000['limit'];var _0x97cc4d;if(_0x2dec72>=_0x5bb7d1){_0x2dec72=_0x5bb7d1;_0x97cc4d=0xc8;}else{_0x97cc4d=0xce;}_0x477988['status'](_0x97cc4d);return _0x477988[_0xe5e1('0x1c')](_0xe5e1('0x1d'),_0x48b946+'-'+_0x2dec72+'/'+_0x5bb7d1)[_0xe5e1('0x1e')](_0xad53f5);}return null;};}function patchUpdates(_0x2a08f3){return function(_0x4590bd){try{jsonpatch[_0xe5e1('0x1f')](_0x4590bd,_0x2a08f3,!![]);}catch(_0x147106){return BPromise[_0xe5e1('0x20')](_0x147106);}return _0x4590bd[_0xe5e1('0x21')]();};}function saveUpdates(_0xe54fd9,_0x140ada){return function(_0x37ac2a){if(_0x37ac2a){return _0x37ac2a[_0xe5e1('0x22')](_0xe54fd9)[_0xe5e1('0x23')](function(_0x4c5be8){return _0x4c5be8;});}return null;};}function removeEntity(_0x4005fe,_0x339587){return function(_0xab3560){if(_0xab3560){return _0xab3560[_0xe5e1('0x24')]()[_0xe5e1('0x23')](function(){_0x4005fe[_0xe5e1('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x475c37,_0x4676a6){return function(_0x55d136){if(!_0x55d136){_0x475c37[_0xe5e1('0x17')](0x194);}return _0x55d136;};}function handleError(_0x4c426e,_0x1dfacb){_0x1dfacb=_0x1dfacb||0x1f4;return function(_0x16f628){logger[_0xe5e1('0x26')](_0x16f628[_0xe5e1('0x27')]);if(_0x16f628[_0xe5e1('0x28')]){delete _0x16f628[_0xe5e1('0x28')];}_0x4c426e[_0xe5e1('0x25')](_0x1dfacb)[_0xe5e1('0x29')](_0x16f628);};}exports[_0xe5e1('0x2a')]=function(_0xef3f76,_0x3d1685){var _0x5998d3={},_0x382f59={},_0x16f5e9={'count':0x0,'rows':[]};var _0x41ee7f=_[_0xe5e1('0x2b')](db[_0xe5e1('0x2c')][_0xe5e1('0x2d')],function(_0x3b7268){return{'name':_0x3b7268[_0xe5e1('0x2e')],'type':_0x3b7268[_0xe5e1('0x2f')]['key']};});_0x382f59[_0xe5e1('0x30')]=_['map'](_0x41ee7f,_0xe5e1('0x28'));_0x382f59[_0xe5e1('0x31')]=_[_0xe5e1('0x32')](_0xef3f76[_0xe5e1('0x31')]);_0x382f59['filters']=_[_0xe5e1('0x33')](_0x382f59[_0xe5e1('0x30')],_0x382f59[_0xe5e1('0x31')]);_0x5998d3[_0xe5e1('0x34')]=_[_0xe5e1('0x33')](_0x382f59[_0xe5e1('0x30')],qs['fields'](_0xef3f76['query']['fields']));_0x5998d3[_0xe5e1('0x34')]=_0x5998d3[_0xe5e1('0x34')][_0xe5e1('0x35')]?_0x5998d3['attributes']:_0x382f59[_0xe5e1('0x30')];if(!_0xef3f76['query']['hasOwnProperty'](_0xe5e1('0x36'))){_0x5998d3[_0xe5e1('0x19')]=qs[_0xe5e1('0x19')](_0xef3f76[_0xe5e1('0x31')][_0xe5e1('0x19')]);_0x5998d3[_0xe5e1('0x18')]=qs[_0xe5e1('0x18')](_0xef3f76[_0xe5e1('0x31')][_0xe5e1('0x18')]);}_0x5998d3[_0xe5e1('0x37')]=qs['sort'](_0xef3f76[_0xe5e1('0x31')][_0xe5e1('0x38')]);_0x5998d3[_0xe5e1('0x39')]=qs['filters'](_['pick'](_0xef3f76['query'],_0x382f59[_0xe5e1('0x3a')]),_0x41ee7f);if(_0xef3f76[_0xe5e1('0x31')][_0xe5e1('0x3b')]){_0x5998d3[_0xe5e1('0x39')]=_[_0xe5e1('0x3c')](_0x5998d3[_0xe5e1('0x39')],{'$or':_[_0xe5e1('0x2b')](_0x41ee7f,function(_0x3fd2b3){if(_0x3fd2b3[_0xe5e1('0x2f')]!==_0xe5e1('0x3d')){var _0x4095e9={};_0x4095e9[_0x3fd2b3[_0xe5e1('0x28')]]={'$like':'%'+_0xef3f76[_0xe5e1('0x31')]['filter']+'%'};return _0x4095e9;}})});}_0x5998d3=_[_0xe5e1('0x3c')]({},_0x5998d3,_0xef3f76[_0xe5e1('0x3e')]);var _0x305ab4={'where':_0x5998d3[_0xe5e1('0x39')]};return db[_0xe5e1('0x2c')][_0xe5e1('0x1b')](_0x305ab4)[_0xe5e1('0x23')](function(_0x3b8b22){_0x16f5e9[_0xe5e1('0x1b')]=_0x3b8b22;if(_0xef3f76[_0xe5e1('0x31')][_0xe5e1('0x3f')]){_0x5998d3['include']=[{'all':!![]}];}return db[_0xe5e1('0x2c')][_0xe5e1('0x40')](_0x5998d3);})[_0xe5e1('0x23')](function(_0x170067){_0x16f5e9['rows']=_0x170067;return _0x16f5e9;})['then'](respondWithFilteredResult(_0x3d1685,_0x5998d3))['catch'](handleError(_0x3d1685,null));};exports['show']=function(_0x35997a,_0x42625f){var _0x2bdfbd={'raw':!![],'where':{'id':_0x35997a['params']['id']}},_0x56cb1f={};_0x56cb1f['model']=_[_0xe5e1('0x32')](db[_0xe5e1('0x2c')][_0xe5e1('0x2d')]);_0x56cb1f[_0xe5e1('0x31')]=_[_0xe5e1('0x32')](_0x35997a[_0xe5e1('0x31')]);_0x56cb1f[_0xe5e1('0x3a')]=_['intersection'](_0x56cb1f[_0xe5e1('0x30')],_0x56cb1f['query']);_0x2bdfbd[_0xe5e1('0x34')]=_['intersection'](_0x56cb1f[_0xe5e1('0x30')],qs[_0xe5e1('0x41')](_0x35997a['query'][_0xe5e1('0x41')]));_0x2bdfbd['attributes']=_0x2bdfbd[_0xe5e1('0x34')][_0xe5e1('0x35')]?_0x2bdfbd[_0xe5e1('0x34')]:_0x56cb1f[_0xe5e1('0x30')];if(_0x35997a[_0xe5e1('0x31')][_0xe5e1('0x3f')]){_0x2bdfbd[_0xe5e1('0x42')]=[{'all':!![]}];}_0x2bdfbd=_[_0xe5e1('0x3c')]({},_0x2bdfbd,_0x35997a[_0xe5e1('0x3e')]);return db[_0xe5e1('0x2c')][_0xe5e1('0x43')](_0x2bdfbd)[_0xe5e1('0x23')](handleEntityNotFound(_0x42625f,null))[_0xe5e1('0x23')](respondWithResult(_0x42625f,null))[_0xe5e1('0x44')](handleError(_0x42625f,null));};exports[_0xe5e1('0x45')]=function(_0x4270d5,_0x3223af){return db[_0xe5e1('0x2c')]['create'](_0x4270d5['body'],{})[_0xe5e1('0x23')](respondWithResult(_0x3223af,0xc9))['catch'](handleError(_0x3223af,null));};exports[_0xe5e1('0x22')]=function(_0x2c9798,_0x47ca83){if(_0x2c9798[_0xe5e1('0x46')]['id']){delete _0x2c9798[_0xe5e1('0x46')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x2c9798[_0xe5e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x47ca83,null))[_0xe5e1('0x23')](saveUpdates(_0x2c9798[_0xe5e1('0x46')],null))[_0xe5e1('0x23')](respondWithResult(_0x47ca83,null))['catch'](handleError(_0x47ca83,null));};exports[_0xe5e1('0x24')]=function(_0x36c907,_0x4bb8d4){return db['OpenchannelApplication']['find']({'where':{'id':_0x36c907[_0xe5e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bb8d4,null))[_0xe5e1('0x23')](removeEntity(_0x4bb8d4,null))[_0xe5e1('0x44')](handleError(_0x4bb8d4,null));}; \ No newline at end of file +var _0xbb93=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash'];(function(_0x454130,_0xaef2dd){var _0x4ae1a7=function(_0x2f1a0e){while(--_0x2f1a0e){_0x454130['push'](_0x454130['shift']());}};_0x4ae1a7(++_0xaef2dd);}(_0xbb93,0x171));var _0x3bb9=function(_0x16e229,_0x36a3c4){_0x16e229=_0x16e229-0x0;var _0x509eec=_0xbb93[_0x16e229];return _0x509eec;};'use strict';var emlformat=require(_0x3bb9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bb9('0x1'));var jsonpatch=require(_0x3bb9('0x2'));var rp=require(_0x3bb9('0x3'));var moment=require(_0x3bb9('0x4'));var BPromise=require(_0x3bb9('0x5'));var Mustache=require(_0x3bb9('0x6'));var util=require('util');var path=require(_0x3bb9('0x7'));var sox=require(_0x3bb9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bb9('0x9'));var _=require(_0x3bb9('0xa'));var squel=require(_0x3bb9('0xb'));var crypto=require(_0x3bb9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3bb9('0xd'));var toCsv=require(_0x3bb9('0xe'));var querystring=require(_0x3bb9('0xf'));var Papa=require(_0x3bb9('0x10'));var Redis=require(_0x3bb9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3bb9('0x12'));var hardwareService=require(_0x3bb9('0x13'));var logger=require(_0x3bb9('0x14'))(_0x3bb9('0x15'));var utils=require(_0x3bb9('0x16'));var config=require(_0x3bb9('0x17'));var licenseUtil=require(_0x3bb9('0x18'));var db=require(_0x3bb9('0x19'))['db'];function respondWithStatusCode(_0x10e4c5,_0x363f7d){_0x363f7d=_0x363f7d||0xcc;return function(_0x29da64){if(_0x29da64){return _0x10e4c5[_0x3bb9('0x1a')](_0x363f7d);}return _0x10e4c5[_0x3bb9('0x1b')](_0x363f7d)[_0x3bb9('0x1c')]();};}function respondWithResult(_0x15d22f,_0x29f75c){_0x29f75c=_0x29f75c||0xc8;return function(_0x16231f){if(_0x16231f){return _0x15d22f[_0x3bb9('0x1b')](_0x29f75c)['json'](_0x16231f);}};}function respondWithFilteredResult(_0x2cbefd,_0x1571f1){return function(_0x5ca1e6){if(_0x5ca1e6){var _0xf86243=typeof _0x1571f1[_0x3bb9('0x1d')]==='undefined'&&typeof _0x1571f1[_0x3bb9('0x1e')]===_0x3bb9('0x1f');var _0x13a597=_0x5ca1e6['count'];var _0x269e8b=_0xf86243?0x0:_0x1571f1[_0x3bb9('0x1d')];var _0x316628=_0xf86243?_0x5ca1e6[_0x3bb9('0x20')]:_0x1571f1['offset']+_0x1571f1['limit'];var _0x51e9c2;if(_0x316628>=_0x13a597){_0x316628=_0x13a597;_0x51e9c2=0xc8;}else{_0x51e9c2=0xce;}_0x2cbefd[_0x3bb9('0x1b')](_0x51e9c2);return _0x2cbefd[_0x3bb9('0x21')](_0x3bb9('0x22'),_0x269e8b+'-'+_0x316628+'/'+_0x13a597)['json'](_0x5ca1e6);}return null;};}function patchUpdates(_0x480e91){return function(_0x6a03b5){try{jsonpatch[_0x3bb9('0x23')](_0x6a03b5,_0x480e91,!![]);}catch(_0x2bfd5e){return BPromise[_0x3bb9('0x24')](_0x2bfd5e);}return _0x6a03b5[_0x3bb9('0x25')]();};}function saveUpdates(_0x56571f,_0x13378a){return function(_0x3abbdb){if(_0x3abbdb){return _0x3abbdb['update'](_0x56571f)['then'](function(_0x20c875){return _0x20c875;});}return null;};}function removeEntity(_0x407028,_0x5eba62){return function(_0x2b072f){if(_0x2b072f){return _0x2b072f[_0x3bb9('0x26')]()['then'](function(){_0x407028[_0x3bb9('0x1b')](0xcc)[_0x3bb9('0x1c')]();});}};}function handleEntityNotFound(_0x2ce9cc,_0x334eb3){return function(_0x3f4b2d){if(!_0x3f4b2d){_0x2ce9cc['sendStatus'](0x194);}return _0x3f4b2d;};}function handleError(_0x3f447f,_0x3ee392){_0x3ee392=_0x3ee392||0x1f4;return function(_0x55ab73){logger['error'](_0x55ab73[_0x3bb9('0x27')]);if(_0x55ab73['name']){delete _0x55ab73[_0x3bb9('0x28')];}_0x3f447f[_0x3bb9('0x1b')](_0x3ee392)[_0x3bb9('0x29')](_0x55ab73);};}exports[_0x3bb9('0x2a')]=function(_0x531ae6,_0x5bad9c){var _0x3a6187={},_0x491285={},_0x1e8eae={'count':0x0,'rows':[]};var _0x2c9a98=_[_0x3bb9('0x2b')](db[_0x3bb9('0x2c')][_0x3bb9('0x2d')],function(_0x4b8d67){return{'name':_0x4b8d67[_0x3bb9('0x2e')],'type':_0x4b8d67[_0x3bb9('0x2f')]['key']};});_0x491285['model']=_[_0x3bb9('0x2b')](_0x2c9a98,'name');_0x491285['query']=_[_0x3bb9('0x30')](_0x531ae6[_0x3bb9('0x31')]);_0x491285[_0x3bb9('0x32')]=_[_0x3bb9('0x33')](_0x491285[_0x3bb9('0x34')],_0x491285[_0x3bb9('0x31')]);_0x3a6187[_0x3bb9('0x35')]=_[_0x3bb9('0x33')](_0x491285[_0x3bb9('0x34')],qs[_0x3bb9('0x36')](_0x531ae6['query']['fields']));_0x3a6187[_0x3bb9('0x35')]=_0x3a6187[_0x3bb9('0x35')][_0x3bb9('0x37')]?_0x3a6187[_0x3bb9('0x35')]:_0x491285['model'];if(!_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x38')]('nolimit')){_0x3a6187[_0x3bb9('0x1e')]=qs[_0x3bb9('0x1e')](_0x531ae6['query'][_0x3bb9('0x1e')]);_0x3a6187[_0x3bb9('0x1d')]=qs['offset'](_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x1d')]);}_0x3a6187[_0x3bb9('0x39')]=qs[_0x3bb9('0x3a')](_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x3a')]);_0x3a6187[_0x3bb9('0x3b')]=qs[_0x3bb9('0x32')](_['pick'](_0x531ae6[_0x3bb9('0x31')],_0x491285[_0x3bb9('0x32')]),_0x2c9a98);if(_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x3c')]){_0x3a6187['where']=_[_0x3bb9('0x3d')](_0x3a6187[_0x3bb9('0x3b')],{'$or':_[_0x3bb9('0x2b')](_0x2c9a98,function(_0x581735){if(_0x581735[_0x3bb9('0x2f')]!==_0x3bb9('0x3e')){var _0x32bd25={};_0x32bd25[_0x581735[_0x3bb9('0x28')]]={'$like':'%'+_0x531ae6['query'][_0x3bb9('0x3c')]+'%'};return _0x32bd25;}})});}_0x3a6187=_[_0x3bb9('0x3d')]({},_0x3a6187,_0x531ae6[_0x3bb9('0x3f')]);var _0x170d18={'where':_0x3a6187[_0x3bb9('0x3b')]};return db[_0x3bb9('0x2c')]['count'](_0x170d18)[_0x3bb9('0x40')](function(_0x41923c){_0x1e8eae[_0x3bb9('0x20')]=_0x41923c;if(_0x531ae6['query'][_0x3bb9('0x41')]){_0x3a6187[_0x3bb9('0x42')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3bb9('0x43')](_0x3a6187);})['then'](function(_0x4fafe6){_0x1e8eae[_0x3bb9('0x44')]=_0x4fafe6;return _0x1e8eae;})[_0x3bb9('0x40')](respondWithFilteredResult(_0x5bad9c,_0x3a6187))[_0x3bb9('0x45')](handleError(_0x5bad9c,null));};exports[_0x3bb9('0x46')]=function(_0x36932a,_0x41bd50){var _0x3eda43={'raw':!![],'where':{'id':_0x36932a[_0x3bb9('0x47')]['id']}},_0x9f96bd={};_0x9f96bd[_0x3bb9('0x34')]=_['keys'](db[_0x3bb9('0x2c')][_0x3bb9('0x2d')]);_0x9f96bd[_0x3bb9('0x31')]=_[_0x3bb9('0x30')](_0x36932a['query']);_0x9f96bd[_0x3bb9('0x32')]=_[_0x3bb9('0x33')](_0x9f96bd['model'],_0x9f96bd[_0x3bb9('0x31')]);_0x3eda43[_0x3bb9('0x35')]=_[_0x3bb9('0x33')](_0x9f96bd[_0x3bb9('0x34')],qs[_0x3bb9('0x36')](_0x36932a[_0x3bb9('0x31')][_0x3bb9('0x36')]));_0x3eda43[_0x3bb9('0x35')]=_0x3eda43[_0x3bb9('0x35')]['length']?_0x3eda43[_0x3bb9('0x35')]:_0x9f96bd[_0x3bb9('0x34')];if(_0x36932a[_0x3bb9('0x31')][_0x3bb9('0x41')]){_0x3eda43[_0x3bb9('0x42')]=[{'all':!![]}];}_0x3eda43=_[_0x3bb9('0x3d')]({},_0x3eda43,_0x36932a[_0x3bb9('0x3f')]);return db['OpenchannelApplication'][_0x3bb9('0x48')](_0x3eda43)[_0x3bb9('0x40')](handleEntityNotFound(_0x41bd50,null))[_0x3bb9('0x40')](respondWithResult(_0x41bd50,null))[_0x3bb9('0x45')](handleError(_0x41bd50,null));};exports[_0x3bb9('0x49')]=function(_0x2dd93a,_0x45bda7){return db[_0x3bb9('0x2c')]['create'](_0x2dd93a[_0x3bb9('0x4a')],{})['then'](respondWithResult(_0x45bda7,0xc9))[_0x3bb9('0x45')](handleError(_0x45bda7,null));};exports[_0x3bb9('0x4b')]=function(_0x215aa7,_0x1a86df){if(_0x215aa7[_0x3bb9('0x4a')]['id']){delete _0x215aa7[_0x3bb9('0x4a')]['id'];}return db[_0x3bb9('0x2c')][_0x3bb9('0x48')]({'where':{'id':_0x215aa7[_0x3bb9('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a86df,null))['then'](saveUpdates(_0x215aa7[_0x3bb9('0x4a')],null))[_0x3bb9('0x40')](respondWithResult(_0x1a86df,null))[_0x3bb9('0x45')](handleError(_0x1a86df,null));};exports['destroy']=function(_0x4cfbc8,_0xc13089){return db['OpenchannelApplication'][_0x3bb9('0x48')]({'where':{'id':_0x4cfbc8[_0x3bb9('0x47')]['id']}})[_0x3bb9('0x40')](handleEntityNotFound(_0xc13089,null))[_0x3bb9('0x40')](removeEntity(_0xc13089,null))['catch'](handleError(_0xc13089,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1e28f4e..ffcdace 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 _0x2098=['moment','bluebird','request-promise','../../config/environment','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2098,0x151));var _0x8209=function(_0x29f63b,_0x4aae71){_0x29f63b=_0x29f63b-0x0;var _0x3a0768=_0x2098[_0x29f63b];return _0x3a0768;};'use strict';var _=require(_0x8209('0x0'));var util=require(_0x8209('0x1'));var logger=require(_0x8209('0x2'))('api');var moment=require(_0x8209('0x3'));var BPromise=require(_0x8209('0x4'));var rp=require(_0x8209('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8209('0x6'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x21753a,_0x3124c2){return _0x21753a[_0x8209('0x7')](_0x8209('0x8'),attributes,{'tableName':_0x8209('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8974=['bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3860e8,_0x1c9a64){var _0x583f4d=function(_0x3dc6f2){while(--_0x3dc6f2){_0x3860e8['push'](_0x3860e8['shift']());}};_0x583f4d(++_0x1c9a64);}(_0x8974,0xdc));var _0x4897=function(_0xa8651c,_0x28b10a){_0xa8651c=_0xa8651c-0x0;var _0x3467c9=_0x8974[_0xa8651c];return _0x3467c9;};'use strict';var _=require(_0x4897('0x0'));var util=require(_0x4897('0x1'));var logger=require('../../config/logger')(_0x4897('0x2'));var moment=require(_0x4897('0x3'));var BPromise=require(_0x4897('0x4'));var rp=require(_0x4897('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4897('0x6'));var config=require(_0x4897('0x7'));var attributes=require(_0x4897('0x8'));module[_0x4897('0x9')]=function(_0x2a0172,_0x3c1fe9){return _0x2a0172[_0x4897('0xa')](_0x4897('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4897('0xc'),'collate':_0x4897('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 25aca0a..7ad1235 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 _0x96bf=['where','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','options'];(function(_0x3bf428,_0x43a591){var _0x2b18a7=function(_0xd49b27){while(--_0xd49b27){_0x3bf428['push'](_0x3bf428['shift']());}};_0x2b18a7(++_0x43a591);}(_0x96bf,0x143));var _0xf96b=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x96bf[_0x45fe9c];return _0x233d48;};'use strict';var _=require('lodash');var util=require(_0xf96b('0x0'));var moment=require(_0xf96b('0x1'));var BPromise=require(_0xf96b('0x2'));var rs=require(_0xf96b('0x3'));var fs=require('fs');var Redis=require(_0xf96b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf96b('0x5'));var logger=require(_0xf96b('0x6'))(_0xf96b('0x7'));var config=require('../../config/environment');var jayson=require(_0xf96b('0x8'));var client=jayson['client'][_0xf96b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a4692,_0x741ba7,_0x491c29){return new BPromise(function(_0x299ee,_0x28f758){return client[_0xf96b('0xa')](_0x5a4692,_0x491c29)[_0xf96b('0xb')](function(_0x3d1d1d){logger[_0xf96b('0xc')](_0xf96b('0xd'),_0x741ba7,_0xf96b('0xe'));logger[_0xf96b('0xf')](_0xf96b('0x10'),_0x741ba7,_0xf96b('0xe'),JSON[_0xf96b('0x11')](_0x3d1d1d));if(_0x3d1d1d[_0xf96b('0x12')]){if(_0x3d1d1d[_0xf96b('0x12')][_0xf96b('0x13')]===0x1f4){logger[_0xf96b('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x741ba7,_0x3d1d1d[_0xf96b('0x12')][_0xf96b('0x14')]);return _0x28f758(_0x3d1d1d[_0xf96b('0x12')][_0xf96b('0x14')]);}logger[_0xf96b('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x741ba7,_0x3d1d1d[_0xf96b('0x12')][_0xf96b('0x14')]);return _0x299ee(_0x3d1d1d[_0xf96b('0x12')][_0xf96b('0x14')]);}else{logger[_0xf96b('0xc')](_0xf96b('0xd'),_0x741ba7,_0xf96b('0xe'));_0x299ee(_0x3d1d1d[_0xf96b('0x15')]['message']);}})['catch'](function(_0x514ce1){logger['error'](_0xf96b('0xd'),_0x741ba7,_0x514ce1);_0x28f758(_0x514ce1);});});}exports[_0xf96b('0x16')]=function(_0x552794){var _0x17c01b=this;return new Promise(function(_0x1c3b8d,_0x36788d){return db[_0xf96b('0x17')]['update'](_0x552794['body'],{'raw':_0x552794[_0xf96b('0x18')]?_0x552794[_0xf96b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x552794[_0xf96b('0x18')]?_0x552794[_0xf96b('0x18')][_0xf96b('0x19')]||null:null,'attributes':_0x552794[_0xf96b('0x18')]?_0x552794['options'][_0xf96b('0x1a')]||null:null,'limit':_0x552794[_0xf96b('0x18')]?_0x552794[_0xf96b('0x18')][_0xf96b('0x1b')]||null:null})[_0xf96b('0xb')](function(_0x4251a3){logger[_0xf96b('0xc')](_0xf96b('0x16'),_0x552794);logger[_0xf96b('0xf')](_0xf96b('0x16'),_0x552794,JSON['stringify'](_0x4251a3));_0x1c3b8d(_0x4251a3);})[_0xf96b('0x1c')](function(_0x200ca4){logger[_0xf96b('0x12')](_0xf96b('0x16'),_0x200ca4['message'],_0x552794);_0x36788d(_0x17c01b[_0xf96b('0x12')](0x1f4,_0x200ca4['message']));});});}; \ No newline at end of file +var _0x296a=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3aa8c3,_0x298581){var _0x538ad2=function(_0x459d56){while(--_0x459d56){_0x3aa8c3['push'](_0x3aa8c3['shift']());}};_0x538ad2(++_0x298581);}(_0x296a,0x15a));var _0xa296=function(_0x396a8e,_0x354607){_0x396a8e=_0x396a8e-0x0;var _0xa0d55b=_0x296a[_0x396a8e];return _0xa0d55b;};'use strict';var _=require(_0xa296('0x0'));var util=require(_0xa296('0x1'));var moment=require(_0xa296('0x2'));var BPromise=require(_0xa296('0x3'));var rs=require(_0xa296('0x4'));var fs=require('fs');var Redis=require(_0xa296('0x5'));var db=require(_0xa296('0x6'))['db'];var utils=require(_0xa296('0x7'));var logger=require(_0xa296('0x8'))(_0xa296('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa296('0xa')][_0xa296('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48cb37,_0x39f79c,_0x4836f5){return new BPromise(function(_0x5d0bf0,_0x169ca1){return client[_0xa296('0xc')](_0x48cb37,_0x4836f5)[_0xa296('0xd')](function(_0x518c8f){logger[_0xa296('0xe')](_0xa296('0xf'),_0x39f79c,_0xa296('0x10'));logger['debug'](_0xa296('0x11'),_0x39f79c,'request\x20sent',JSON[_0xa296('0x12')](_0x518c8f));if(_0x518c8f['error']){if(_0x518c8f[_0xa296('0x13')]['code']===0x1f4){logger[_0xa296('0x13')](_0xa296('0xf'),_0x39f79c,_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);return _0x169ca1(_0x518c8f['error'][_0xa296('0x14')]);}logger[_0xa296('0x13')](_0xa296('0xf'),_0x39f79c,_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);return _0x5d0bf0(_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);}else{logger[_0xa296('0xe')](_0xa296('0xf'),_0x39f79c,_0xa296('0x10'));_0x5d0bf0(_0x518c8f[_0xa296('0x15')][_0xa296('0x14')]);}})[_0xa296('0x16')](function(_0x56be18){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x39f79c,_0x56be18);_0x169ca1(_0x56be18);});});}exports[_0xa296('0x17')]=function(_0x9e7055){var _0x4a84f2=this;return new Promise(function(_0x53203c,_0x23d8df){return db[_0xa296('0x18')][_0xa296('0x19')](_0x9e7055[_0xa296('0x1a')],{'raw':_0x9e7055[_0xa296('0x1b')]?_0x9e7055[_0xa296('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e7055[_0xa296('0x1b')]?_0x9e7055[_0xa296('0x1b')]['where']||null:null,'attributes':_0x9e7055['options']?_0x9e7055[_0xa296('0x1b')]['attributes']||null:null,'limit':_0x9e7055['options']?_0x9e7055['options'][_0xa296('0x1c')]||null:null})[_0xa296('0xd')](function(_0x3db539){logger[_0xa296('0xe')](_0xa296('0x17'),_0x9e7055);logger[_0xa296('0x1d')](_0xa296('0x17'),_0x9e7055,JSON[_0xa296('0x12')](_0x3db539));_0x53203c(_0x3db539);})[_0xa296('0x16')](function(_0x3deeb3){logger[_0xa296('0x13')]('UpdateOpenchannelApplication',_0x3deeb3[_0xa296('0x14')],_0x9e7055);_0x23d8df(_0x4a84f2[_0xa296('0x13')](0x1f4,_0x3deeb3['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 86e004f..40093c0 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 _0xb40c=['openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','download','post','create','addMessage','tracked'];(function(_0x296187,_0x66707b){var _0x4565d2=function(_0xb3f7cb){while(--_0xb3f7cb){_0x296187['push'](_0x296187['shift']());}};_0x4565d2(++_0x66707b);}(_0xb40c,0xea));var _0xcb40=function(_0x6bf179,_0x5e35d4){_0x6bf179=_0x6bf179-0x0;var _0x23a085=_0xb40c[_0x6bf179];return _0x23a085;};'use strict';var multer=require(_0xcb40('0x0'));var util=require('util');var path=require(_0xcb40('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb40('0x2'));var router=express['Router']();var fs_extra=require(_0xcb40('0x3'));var auth=require(_0xcb40('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcb40('0x5'));var controller=require(_0xcb40('0x6'));router[_0xcb40('0x7')]('/',auth[_0xcb40('0x8')](),controller['index']);router['get'](_0xcb40('0x9'),auth[_0xcb40('0x8')](),controller['describe']);router[_0xcb40('0x7')]('/:id',auth[_0xcb40('0x8')](),controller[_0xcb40('0xa')]);router[_0xcb40('0x7')](_0xcb40('0xb'),auth[_0xcb40('0x8')](),controller[_0xcb40('0xc')]);router[_0xcb40('0x7')]('/:id/download',auth[_0xcb40('0x8')](),controller[_0xcb40('0xd')]);router[_0xcb40('0xe')]('/',auth[_0xcb40('0x8')](),controller[_0xcb40('0xf')]);router['post'](_0xcb40('0xb'),auth['isAuthenticated'](),controller[_0xcb40('0x10')]);router[_0xcb40('0xe')]('/:id/tags',auth[_0xcb40('0x8')](),interaction[_0xcb40('0x11')](_0xcb40('0x12'),_0xcb40('0x13')),controller[_0xcb40('0x14')]);router[_0xcb40('0x15')](_0xcb40('0x16'),auth[_0xcb40('0x8')](),interaction[_0xcb40('0x11')](_0xcb40('0x12'),'openchannelinteraction:update'),controller[_0xcb40('0x17')]);router['delete'](_0xcb40('0x16'),auth[_0xcb40('0x8')](),interaction['tracked'](_0xcb40('0x12'),_0xcb40('0x18')),controller[_0xcb40('0x19')]);router['delete'](_0xcb40('0x1a'),auth['isAuthenticated'](),controller['removeTags']);module[_0xcb40('0x1b')]=router; \ No newline at end of file +var _0x26c9=['getMessages','/:id/download','download','post','/:id/messages','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xafb06e,_0x2d1f57){var _0x37b6f2=function(_0x1e0fd1){while(--_0x1e0fd1){_0xafb06e['push'](_0xafb06e['shift']());}};_0x37b6f2(++_0x2d1f57);}(_0x26c9,0x19d));var _0x926c=function(_0x58d1ba,_0x16d0a7){_0x58d1ba=_0x58d1ba-0x0;var _0x199fdc=_0x26c9[_0x58d1ba];return _0x199fdc;};'use strict';var multer=require(_0x926c('0x0'));var util=require(_0x926c('0x1'));var path=require(_0x926c('0x2'));var timeout=require(_0x926c('0x3'));var express=require(_0x926c('0x4'));var router=express[_0x926c('0x5')]();var fs_extra=require(_0x926c('0x6'));var auth=require(_0x926c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x926c('0x8'));var controller=require(_0x926c('0x9'));router[_0x926c('0xa')]('/',auth[_0x926c('0xb')](),controller[_0x926c('0xc')]);router[_0x926c('0xa')](_0x926c('0xd'),auth['isAuthenticated'](),controller[_0x926c('0xe')]);router[_0x926c('0xa')](_0x926c('0xf'),auth[_0x926c('0xb')](),controller['show']);router[_0x926c('0xa')]('/:id/messages',auth[_0x926c('0xb')](),controller[_0x926c('0x10')]);router['get'](_0x926c('0x11'),auth[_0x926c('0xb')](),controller[_0x926c('0x12')]);router['post']('/',auth[_0x926c('0xb')](),controller['create']);router[_0x926c('0x13')](_0x926c('0x14'),auth[_0x926c('0xb')](),controller['addMessage']);router[_0x926c('0x13')](_0x926c('0x15'),auth['isAuthenticated'](),interaction[_0x926c('0x16')]('openchannel',_0x926c('0x17')),controller['addTags']);router[_0x926c('0x18')](_0x926c('0xf'),auth[_0x926c('0xb')](),interaction[_0x926c('0x16')](_0x926c('0x19'),_0x926c('0x1a')),controller[_0x926c('0x1b')]);router[_0x926c('0x1c')](_0x926c('0xf'),auth[_0x926c('0xb')](),interaction[_0x926c('0x16')](_0x926c('0x19'),_0x926c('0x1d')),controller[_0x926c('0x1e')]);router[_0x926c('0x1c')](_0x926c('0x15'),auth['isAuthenticated'](),controller[_0x926c('0x1f')]);module[_0x926c('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index e7c8230..8ba080f 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 _0x949d=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x949d,0x162));var _0xd949=function(_0xad2086,_0x40a8ef){_0xad2086=_0xad2086-0x0;var _0x10b76b=_0x949d[_0xad2086];return _0x10b76b;};'use strict';var Sequelize=require(_0xd949('0x0'));module[_0xd949('0x1')]={'closed':{'type':Sequelize[_0xd949('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd949('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd949('0x4')]},'note':{'type':Sequelize[_0xd949('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xd949('0x4')]},'externalUrl':{'type':Sequelize[_0xd949('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xd949('0x5')]('in',_0xd949('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xd949('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd949('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xd949('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe64a=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3898d9,_0x12b009){var _0x41ec09=function(_0x1190c2){while(--_0x1190c2){_0x3898d9['push'](_0x3898d9['shift']());}};_0x41ec09(++_0x12b009);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xae64('0x0'));module[_0xae64('0x1')]={'closed':{'type':Sequelize[_0xae64('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae64('0x3')]},'disposition':{'type':Sequelize[_0xae64('0x4')]},'secondDisposition':{'type':Sequelize[_0xae64('0x4')]},'thirdDisposition':{'type':Sequelize[_0xae64('0x4')]},'note':{'type':Sequelize[_0xae64('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xae64('0x5')]('in',_0xae64('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xae64('0x5')]('in',_0xae64('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xae64('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xae64('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3b6df85..e01b3d2 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 _0xc87a=['include','merge','options','find','catch','create','body','destroy','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','Account','Owner','fullname','N.A.','closed','closedAt','threadId','Public','Private','basename','createReadStream','createWriteStream','out','System','read','value','renderFile','views','transcript-','.pdf','Openchannel','error','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','stack','name','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','openchannel','user','show','query','from','params','model','keys','filters','intersection','attributes','fields','length'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xc87a,0xcd));var _0xac87=function(_0x533883,_0x438734){_0x533883=_0x533883-0x0;var _0x4108f5=_0xc87a[_0x533883];return _0x4108f5;};'use strict';var rimraf=require(_0xac87('0x0'));var zipdir=require(_0xac87('0x1'));var moment=require(_0xac87('0x2'));var util=require(_0xac87('0x3'));var path=require(_0xac87('0x4'));var ejs=require(_0xac87('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xac87('0x6'));var qs=require(_0xac87('0x7'));var pdf=require(_0xac87('0x8'));var logger=require(_0xac87('0x9'))(_0xac87('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xac87('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xac87('0xc'))(new Redis(config['redis']));require(_0xac87('0xd'))[_0xac87('0xe')](socket);function respondWithStatusCode(_0x3335b5,_0x456b1d){_0x456b1d=_0x456b1d||0xcc;return function(_0x2eba40){if(_0x2eba40){return _0x3335b5[_0xac87('0xf')](_0x456b1d);}return _0x3335b5[_0xac87('0x10')](_0x456b1d)[_0xac87('0x11')]();};}function respondWithResult(_0x4b8f65,_0x5950a3){_0x5950a3=_0x5950a3||0xc8;return function(_0x296c29){if(_0x296c29){return _0x4b8f65[_0xac87('0x10')](_0x5950a3)[_0xac87('0x12')](_0x296c29);}};}function respondWithFilteredResult(_0x17d052,_0x8693c8){return function(_0x1565e1){if(_0x1565e1){var _0x2fada3=typeof _0x8693c8['offset']==='undefined'&&typeof _0x8693c8['limit']===_0xac87('0x13');var _0x153499=_0x1565e1[_0xac87('0x14')];var _0x3f2c1d=_0x2fada3?0x0:_0x8693c8[_0xac87('0x15')];var _0x803ec0=_0x2fada3?_0x1565e1[_0xac87('0x14')]:_0x8693c8[_0xac87('0x15')]+_0x8693c8[_0xac87('0x16')];var _0x4bbb43;if(_0x803ec0>=_0x153499){_0x803ec0=_0x153499;_0x4bbb43=0xc8;}else{_0x4bbb43=0xce;}_0x17d052['status'](_0x4bbb43);return _0x17d052[_0xac87('0x17')](_0xac87('0x18'),_0x3f2c1d+'-'+_0x803ec0+'/'+_0x153499)[_0xac87('0x12')](_0x1565e1);}return null;};}function saveUpdates(_0x2b3557){return function(_0x5c0cde){if(_0x5c0cde){return _0x5c0cde[_0xac87('0x19')](_0x2b3557)[_0xac87('0x1a')](function(_0x485686){return _0x485686;});}return null;};}function removeEntity(_0x2ccef1){return function(_0x2fb2be){if(_0x2fb2be){return _0x2fb2be['destroy']()[_0xac87('0x1a')](function(){_0x2ccef1[_0xac87('0x10')](0xcc)[_0xac87('0x11')]();});}};}function handleEntityNotFound(_0x357c7d){return function(_0x550c96){if(!_0x550c96){_0x357c7d[_0xac87('0xf')](0x194);}return _0x550c96;};}function handleError(_0x2eb8c0,_0x36934f){_0x36934f=_0x36934f||0x1f4;return function(_0x24cf35){logger['error'](_0x24cf35[_0xac87('0x1b')]);if(_0x24cf35[_0xac87('0x1c')]){delete _0x24cf35[_0xac87('0x1c')];}_0x2eb8c0[_0xac87('0x10')](_0x36934f)['send'](_0x24cf35);};}exports['index']=function(_0x4c7075,_0x4a3d21){var _0x581bd9={};var _0x50e740=_[_0xac87('0x1d')](db[_0xac87('0x1e')][_0xac87('0x1f')],function(_0x2aae9e){return{'name':_0x2aae9e['fieldName'],'type':_0x2aae9e[_0xac87('0x20')][_0xac87('0x21')]};});_0x581bd9=qs[_0xac87('0x22')](_0x50e740,_0x4c7075);return interaction[_0xac87('0x23')](_0xac87('0x24'),_0x4c7075['query'],_0x4c7075[_0xac87('0x25')],_0x581bd9,_0x50e740)[_0xac87('0x1a')](respondWithFilteredResult(_0x4a3d21,_0x581bd9))['catch'](handleError(_0x4a3d21,null));};exports[_0xac87('0x26')]=function(_0x412ddc,_0x31c694){var _0x324b48={};if(_0x412ddc[_0xac87('0x27')][_0xac87('0x20')]&&_0x412ddc[_0xac87('0x27')]['type']==='from'){_0x324b48[_0xac87('0x28')]=_0x412ddc[_0xac87('0x29')]['id'];}else{_0x324b48['id']=_0x412ddc[_0xac87('0x29')]['id'];}var _0x115c9f={'raw':![],'where':_0x324b48},_0x192e47={};_0x192e47[_0xac87('0x2a')]=_['keys'](db[_0xac87('0x1e')][_0xac87('0x1f')]);_0x192e47['query']=_[_0xac87('0x2b')](_0x412ddc[_0xac87('0x27')]);_0x192e47[_0xac87('0x2c')]=_[_0xac87('0x2d')](_0x192e47['model'],_0x192e47[_0xac87('0x27')]);_0x115c9f[_0xac87('0x2e')]=_['intersection'](_0x192e47[_0xac87('0x2a')],qs[_0xac87('0x2f')](_0x412ddc[_0xac87('0x27')][_0xac87('0x2f')]));_0x115c9f[_0xac87('0x2e')]=_0x115c9f[_0xac87('0x2e')][_0xac87('0x30')]?_0x115c9f[_0xac87('0x2e')]:_0x192e47[_0xac87('0x2a')];if(_0x412ddc[_0xac87('0x27')]['includeAll']){_0x115c9f[_0xac87('0x31')]=[{'all':!![]}];}_0x115c9f=_[_0xac87('0x32')]({},_0x115c9f,_0x412ddc[_0xac87('0x33')]);return db[_0xac87('0x1e')][_0xac87('0x34')](_0x115c9f)['then'](handleEntityNotFound(_0x31c694,null))['then'](respondWithResult(_0x31c694,null))[_0xac87('0x35')](handleError(_0x31c694,null));};exports[_0xac87('0x36')]=function(_0x904137,_0x1701c6){return db[_0xac87('0x1e')]['create'](_0x904137[_0xac87('0x37')],{})[_0xac87('0x1a')](respondWithResult(_0x1701c6,0xc9))[_0xac87('0x35')](handleError(_0x1701c6,null));};exports[_0xac87('0x19')]=function(_0xfb73c2,_0x528e89){if(_0xfb73c2[_0xac87('0x37')]['id']){delete _0xfb73c2['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0xfb73c2[_0xac87('0x29')]['id']}})[_0xac87('0x1a')](handleEntityNotFound(_0x528e89,null))[_0xac87('0x1a')](saveUpdates(_0xfb73c2[_0xac87('0x37')],null))[_0xac87('0x1a')](respondWithResult(_0x528e89,null))[_0xac87('0x35')](handleError(_0x528e89,null));};exports[_0xac87('0x38')]=function(_0xc7f507,_0x9d41ba){return db[_0xac87('0x1e')][_0xac87('0x34')]({'where':{'id':_0xc7f507[_0xac87('0x29')]['id']}})['then'](handleEntityNotFound(_0x9d41ba,null))['then'](removeEntity(_0x9d41ba,null))[_0xac87('0x35')](handleError(_0x9d41ba,null));};exports[_0xac87('0x39')]=function(_0xe1df8d,_0x303817){return db[_0xac87('0x1e')][_0xac87('0x39')]()[_0xac87('0x1a')](respondWithResult(_0x303817,null))[_0xac87('0x35')](handleError(_0x303817,null));};exports[_0xac87('0x3a')]=function(_0x21f949,_0x33ae94){return db[_0xac87('0x3b')][_0xac87('0x34')]({'where':{'id':_0x21f949['params']['id']}})[_0xac87('0x1a')](handleEntityNotFound(_0x33ae94,null))[_0xac87('0x1a')](function(_0x3cd9fe){if(_0x3cd9fe){return _0x3cd9fe[_0xac87('0x3a')](_0x21f949['body']['ids'],_[_0xac87('0x3c')](_0x21f949[_0xac87('0x37')],[_0xac87('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x33ae94,null))['catch'](handleError(_0x33ae94,null));};exports[_0xac87('0x3e')]=function(_0x431bad,_0x1454d5){var _0x14b0f4={'raw':![],'where':{}};var _0x3ff019={};var _0x21c1ba={'count':0x0,'rows':[]};return db[_0xac87('0x1e')][_0xac87('0x3f')]({'where':{'id':_0x431bad['params']['id']}})['then'](handleEntityNotFound(_0x1454d5,null))[_0xac87('0x1a')](function(_0x505fab){if(_0x505fab){_0x3ff019[_0xac87('0x2a')]=_['keys'](db[_0xac87('0x3b')][_0xac87('0x1f')]);_0x3ff019[_0xac87('0x27')]=_[_0xac87('0x2b')](_0x431bad[_0xac87('0x27')]);_0x3ff019['filters']=_[_0xac87('0x2d')](_0x3ff019[_0xac87('0x2a')],_0x3ff019['query']);_0x14b0f4['attributes']=_[_0xac87('0x2d')](_0x3ff019[_0xac87('0x2a')],qs[_0xac87('0x2f')](_0x431bad[_0xac87('0x27')][_0xac87('0x2f')]));_0x14b0f4[_0xac87('0x2e')]=_0x14b0f4[_0xac87('0x2e')][_0xac87('0x30')]?_0x14b0f4['attributes']:_0x3ff019['model'];if(!_0x431bad[_0xac87('0x27')][_0xac87('0x40')](_0xac87('0x41'))){_0x14b0f4[_0xac87('0x16')]=qs[_0xac87('0x16')](_0x431bad[_0xac87('0x27')][_0xac87('0x16')]);_0x14b0f4[_0xac87('0x15')]=qs[_0xac87('0x15')](_0x431bad['query'][_0xac87('0x15')]);}_0x14b0f4['order']=qs[_0xac87('0x42')](_0x431bad[_0xac87('0x27')][_0xac87('0x42')]);_0x14b0f4['where']=qs[_0xac87('0x2c')](_['pick'](_0x431bad[_0xac87('0x27')],_0x3ff019['filters']));_0x14b0f4[_0xac87('0x43')][_0xac87('0x44')]=_0x505fab['id'];if(_0x431bad[_0xac87('0x27')][_0xac87('0x45')]){_0x14b0f4[_0xac87('0x43')]=_[_0xac87('0x32')](_0x14b0f4['where'],{'$or':_[_0xac87('0x1d')](_0x14b0f4[_0xac87('0x2e')],function(_0x16f428){var _0x6cec62={};_0x6cec62[_0x16f428]={'$like':'%'+_0x431bad[_0xac87('0x27')][_0xac87('0x45')]+'%'};return _0x6cec62;})});}if(_0x431bad[_0xac87('0x27')]['$gte']){var _0x3356a1=_0x431bad[_0xac87('0x27')][_0xac87('0x46')][_0xac87('0x47')](',');var _0x425612={};_0x425612[_0x3356a1[0x0]]={'$gte':moment(_0x3356a1[0x1])[_0xac87('0x48')](_0xac87('0x49'))};_0x14b0f4[_0xac87('0x43')]=_[_0xac87('0x32')](_0x14b0f4[_0xac87('0x43')],_0x425612);}_0x14b0f4=_[_0xac87('0x32')]({},_0x14b0f4,_0x431bad['options']);return db[_0xac87('0x3b')][_0xac87('0x14')]({'where':_0x14b0f4['where']})['then'](function(_0x1fdc63){_0x21c1ba[_0xac87('0x14')]=_0x1fdc63;if(_0x431bad[_0xac87('0x27')][_0xac87('0x4a')]){_0x14b0f4[_0xac87('0x31')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xac87('0x23')](_0x14b0f4);})[_0xac87('0x1a')](function(_0x404fc5){_0x21c1ba[_0xac87('0x4b')]=_0x404fc5;return _0x21c1ba;});}})[_0xac87('0x1a')](respondWithFilteredResult(_0x1454d5,_0x14b0f4))[_0xac87('0x35')](handleError(_0x1454d5,null));};exports[_0xac87('0x4c')]=function(_0x13a125,_0x406af6){return db[_0xac87('0x1e')][_0xac87('0x34')]({'where':{'id':_0x13a125['params']['id']}})[_0xac87('0x1a')](handleEntityNotFound(_0x406af6,null))[_0xac87('0x1a')](function(_0x1abd17){if(_0x1abd17){return _0x1abd17['setTags'](_0x13a125[_0xac87('0x37')][_0xac87('0x3d')],_[_0xac87('0x3c')](_0x13a125[_0xac87('0x37')],[_0xac87('0x3d'),'id'])||{})[_0xac87('0x4d')](function(){return db[_0xac87('0x4e')][_0xac87('0x23')]({'attributes':['id',_0xac87('0x1c'),_0xac87('0x4f')],'where':{'id':_0x13a125[_0xac87('0x37')]['ids']}});})[_0xac87('0x1a')](function(_0x213874){socket[_0xac87('0x50')](_0xac87('0x51'),{'id':Number(_0x13a125['params']['id']),'tags':_0x213874||[]});return{'id':Number(_0x13a125[_0xac87('0x29')]['id']),'tags':_0x213874||[]};});}})[_0xac87('0x1a')](respondWithResult(_0x406af6,null))[_0xac87('0x35')](handleError(_0x406af6,null));};exports[_0xac87('0x52')]=function(_0x12dc98,_0x4e6a3d){return db['OpenchannelInteraction'][_0xac87('0x34')]({'where':{'id':_0x12dc98[_0xac87('0x29')]['id']}})[_0xac87('0x1a')](handleEntityNotFound(_0x4e6a3d,null))['then'](function(_0x59f9f7){if(_0x59f9f7){return _0x59f9f7['removeTags'](_0x12dc98[_0xac87('0x27')][_0xac87('0x3d')]);}})[_0xac87('0x1a')](respondWithStatusCode(_0x4e6a3d,null))[_0xac87('0x35')](handleError(_0x4e6a3d,null));};exports[_0xac87('0x53')]=function(_0x5f1de3,_0x40e661){var _0x459d6a=moment()[_0xac87('0x54')]()[_0xac87('0x55')]();var _0x2cf1ec=path[_0xac87('0x56')](config[_0xac87('0x57')],_0xac87('0x58'),_0xac87('0x59'),_0xac87('0x5a'));var _0x528c9e=path['join'](config[_0xac87('0x57')],_0xac87('0x58'),'files',_0xac87('0x5b'));var _0x24c859=path['join'](_0x2cf1ec,_0x459d6a);var _0x145d6f=util[_0xac87('0x48')](_0xac87('0x5c'),_0x5f1de3[_0xac87('0x29')]['id'],_0x459d6a);var _0x2ffa50=path[_0xac87('0x56')](_0x2cf1ec,_0x145d6f);var _0x156d8f=[];_0x156d8f[_0xac87('0x5d')]({'model':db[_0xac87('0x5e')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x156d8f[_0xac87('0x5d')]({'model':db[_0xac87('0x5f')],'as':_0xac87('0x60'),'attributes':['id',_0xac87('0x61'),_0xac87('0x62')],'raw':!![]});if(_0x5f1de3['query'][_0xac87('0x5b')]){_0x156d8f[_0xac87('0x5d')]({'model':db['Attachment'],'as':_0xac87('0x63'),'raw':!![]});}var _0x573163=[{'model':db[_0xac87('0x3b')],'as':_0xac87('0x64'),'attributes':['id',_0xac87('0x37'),_0xac87('0x65'),_0xac87('0x66'),_0xac87('0x67'),'read'],'include':_0x156d8f}];_0x573163[_0xac87('0x5d')]({'model':db['OpenchannelAccount'],'as':_0xac87('0x68'),'attributes':['id',_0xac87('0x1c')]});_0x573163[_0xac87('0x5d')]({'model':db['User'],'as':_0xac87('0x69'),'attributes':['id',_0xac87('0x6a')]});return db['OpenchannelInteraction'][_0xac87('0x34')]({'where':{'id':_0x5f1de3[_0xac87('0x29')]['id']},'include':_0x573163})[_0xac87('0x1a')](handleEntityNotFound(_0x40e661,null))['then'](function(_0x1be252){if(_0x1be252){var _0x56038a=_0x1be252['get']({'plain':!![]});fs['mkdirSync'](_0x24c859);var _0x12c47f={'channel':'Openchannel','account':_0x56038a[_0xac87('0x68')][_0xac87('0x1c')],'agent':_0x56038a['Owner']?_0x56038a[_0xac87('0x69')][_0xac87('0x6a')]:_0xac87('0x6b'),'createdAt':moment(_0x56038a[_0xac87('0x65')])['format'](_0xac87('0x49'))[_0xac87('0x55')](),'closedAt':_0x56038a[_0xac87('0x6c')]?moment(_0x56038a[_0xac87('0x6d')])['format'](_0xac87('0x49'))['toString']():'','disposition':_0x56038a['disposition'],'visibility':_0x56038a[_0xac87('0x6e')]?_0xac87('0x6f'):_0xac87('0x70'),'messages':_(_0x56038a[_0xac87('0x64')])[_0xac87('0x45')]({'secret':![]})[_0xac87('0x1d')](function(_0x20af67){if(_0x20af67[_0xac87('0x63')]){var _0x2e0239=path[_0xac87('0x56')](_0x528c9e,_0x20af67[_0xac87('0x63')][_0xac87('0x71')]);if(fs['existsSync'](_0x2e0239)){fs[_0xac87('0x72')](_0x2e0239)['pipe'](fs[_0xac87('0x73')](path['join'](_0x24c859,_0x20af67[_0xac87('0x63')][_0xac87('0x71')])));}}return{'date':moment(_0x20af67[_0xac87('0x65')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x20af67[_0xac87('0x66')]===_0xac87('0x74')?_0x20af67['User']?_0x20af67[_0xac87('0x5e')][_0xac87('0x6a')]:_0xac87('0x75'):_0x20af67['Contact']['firstName']+(_0x20af67['Contact'][_0xac87('0x62')]?'\x20'+_0x20af67[_0xac87('0x60')][_0xac87('0x62')]:''),'body':_0x20af67[_0xac87('0x63')]?_0x20af67[_0xac87('0x63')]['basename']:_0x20af67[_0xac87('0x37')],'direction':_0x20af67['direction']===_0xac87('0x74')?'A':'C','secret':_0x20af67[_0xac87('0x67')],'read':_0x20af67[_0xac87('0x76')],'attachment':_0x20af67['Attachment']};})[_0xac87('0x77')]()};return ejs[_0xac87('0x78')](path['join'](config[_0xac87('0x57')],_0xac87('0x58'),_0xac87('0x79'),'downloadInteraction.ejs'),{'interaction':_0x12c47f})[_0xac87('0x1a')](function(_0x2667cd){var _0x31df8f=path[_0xac87('0x56')](_0x24c859,_0xac87('0x7a')+_0x56038a['id']+'-'+_0x459d6a+_0xac87('0x7b'));var _0x1277aa={'path':_0x31df8f,'channel':_0xac87('0x7c'),'interactionId':_0x56038a['id']};return pdf['createPdfFromHTML'](_0x2667cd,_0x1277aa);})['then'](function(){return new Promise(function(_0x8f6c62,_0x509351){zipdir(_0x24c859,{'saveTo':_0x2ffa50},function(_0x3c6a28,_0x2799d7){if(_0x3c6a28)return _0x509351(_0x3c6a28);return _0x8f6c62(_0x2799d7);});})[_0xac87('0x1a')](function(){return new Promise(function(_0x48d30a,_0x2d4c65){rimraf(_0x24c859,function(_0x1e3624){if(_0x1e3624)_0x2d4c65(_0x1e3624);return _0x48d30a();});});})[_0xac87('0x1a')](function(){return _0x40e661[_0xac87('0x53')](_0x2ffa50,_0x145d6f,function(_0x159ec2){if(_0x159ec2){logger[_0xac87('0x7d')]('Unable\x20to\x20delete\x20zip\x20file',_0x159ec2);}else{fs[_0xac87('0x7e')](_0x2ffa50);}});});});}else{return _0x40e661['sendStatus'](0xc8);}})[_0xac87('0x35')](handleError(_0x40e661,null));}; \ No newline at end of file +var _0x5fae=['redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','then','destroy','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','tmp','files','attachments','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','Openchannel','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults'];(function(_0x34e9c8,_0x1d2f14){var _0x570baa=function(_0x4f8913){while(--_0x4f8913){_0x34e9c8['push'](_0x34e9c8['shift']());}};_0x570baa(++_0x1d2f14);}(_0x5fae,0x77));var _0xe5fa=function(_0x1eedae,_0xf9d3f2){_0x1eedae=_0x1eedae-0x0;var _0x40b674=_0x5fae[_0x1eedae];return _0x40b674;};'use strict';var rimraf=require(_0xe5fa('0x0'));var zipdir=require(_0xe5fa('0x1'));var moment=require(_0xe5fa('0x2'));var util=require('util');var path=require(_0xe5fa('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe5fa('0x4'));var Redis=require(_0xe5fa('0x5'));var interaction=require(_0xe5fa('0x6'));var qs=require(_0xe5fa('0x7'));var pdf=require(_0xe5fa('0x8'));var logger=require(_0xe5fa('0x9'))(_0xe5fa('0xa'));var config=require(_0xe5fa('0xb'));var db=require(_0xe5fa('0xc'))['db'];config['redis']=_[_0xe5fa('0xd')](config[_0xe5fa('0xe')],{'host':_0xe5fa('0xf'),'port':0x18eb});var socket=require(_0xe5fa('0x10'))(new Redis(config[_0xe5fa('0xe')]));require('./openchannelInteraction.socket')[_0xe5fa('0x11')](socket);function respondWithStatusCode(_0x26a9cd,_0x825c3a){_0x825c3a=_0x825c3a||0xcc;return function(_0xd4cfb1){if(_0xd4cfb1){return _0x26a9cd[_0xe5fa('0x12')](_0x825c3a);}return _0x26a9cd[_0xe5fa('0x13')](_0x825c3a)[_0xe5fa('0x14')]();};}function respondWithResult(_0x2e1615,_0x53a96a){_0x53a96a=_0x53a96a||0xc8;return function(_0x221920){if(_0x221920){return _0x2e1615[_0xe5fa('0x13')](_0x53a96a)[_0xe5fa('0x15')](_0x221920);}};}function respondWithFilteredResult(_0x5b935b,_0x17c495){return function(_0x27028a){if(_0x27028a){var _0x31062b=typeof _0x17c495[_0xe5fa('0x16')]==='undefined'&&typeof _0x17c495[_0xe5fa('0x17')]==='undefined';var _0x130c04=_0x27028a[_0xe5fa('0x18')];var _0xae1d3d=_0x31062b?0x0:_0x17c495[_0xe5fa('0x16')];var _0xb7408a=_0x31062b?_0x27028a['count']:_0x17c495[_0xe5fa('0x16')]+_0x17c495[_0xe5fa('0x17')];var _0x2d5c11;if(_0xb7408a>=_0x130c04){_0xb7408a=_0x130c04;_0x2d5c11=0xc8;}else{_0x2d5c11=0xce;}_0x5b935b[_0xe5fa('0x13')](_0x2d5c11);return _0x5b935b[_0xe5fa('0x19')](_0xe5fa('0x1a'),_0xae1d3d+'-'+_0xb7408a+'/'+_0x130c04)[_0xe5fa('0x15')](_0x27028a);}return null;};}function saveUpdates(_0x34d48b){return function(_0x58d9ff){if(_0x58d9ff){return _0x58d9ff['update'](_0x34d48b)[_0xe5fa('0x1b')](function(_0x514712){return _0x514712;});}return null;};}function removeEntity(_0x4c0f55){return function(_0x3a1729){if(_0x3a1729){return _0x3a1729[_0xe5fa('0x1c')]()[_0xe5fa('0x1b')](function(){_0x4c0f55[_0xe5fa('0x13')](0xcc)[_0xe5fa('0x14')]();});}};}function handleEntityNotFound(_0x2fafa5){return function(_0x1345e2){if(!_0x1345e2){_0x2fafa5[_0xe5fa('0x12')](0x194);}return _0x1345e2;};}function handleError(_0x1d2ad4,_0x1f77e2){_0x1f77e2=_0x1f77e2||0x1f4;return function(_0x18779e){logger[_0xe5fa('0x1d')](_0x18779e[_0xe5fa('0x1e')]);if(_0x18779e[_0xe5fa('0x1f')]){delete _0x18779e[_0xe5fa('0x1f')];}_0x1d2ad4[_0xe5fa('0x13')](_0x1f77e2)[_0xe5fa('0x20')](_0x18779e);};}exports['index']=function(_0x42b6e2,_0x554d33){var _0x36ce68={};var _0xbe2203=_[_0xe5fa('0x21')](db[_0xe5fa('0x22')][_0xe5fa('0x23')],function(_0x353651){return{'name':_0x353651[_0xe5fa('0x24')],'type':_0x353651[_0xe5fa('0x25')]['key']};});_0x36ce68=qs[_0xe5fa('0x26')](_0xbe2203,_0x42b6e2);return interaction[_0xe5fa('0x27')](_0xe5fa('0x28'),_0x42b6e2[_0xe5fa('0x29')],_0x42b6e2[_0xe5fa('0x2a')],_0x36ce68,_0xbe2203)['then'](respondWithFilteredResult(_0x554d33,_0x36ce68))[_0xe5fa('0x2b')](handleError(_0x554d33,null));};exports[_0xe5fa('0x2c')]=function(_0x2ac563,_0xf738c3){var _0x2b0d0d={};if(_0x2ac563[_0xe5fa('0x29')][_0xe5fa('0x25')]&&_0x2ac563[_0xe5fa('0x29')][_0xe5fa('0x25')]==='from'){_0x2b0d0d['from']=_0x2ac563[_0xe5fa('0x2d')]['id'];}else{_0x2b0d0d['id']=_0x2ac563[_0xe5fa('0x2d')]['id'];}var _0x4d423d={'raw':![],'where':_0x2b0d0d},_0x197b2a={};_0x197b2a[_0xe5fa('0x2e')]=_['keys'](db[_0xe5fa('0x22')][_0xe5fa('0x23')]);_0x197b2a['query']=_[_0xe5fa('0x2f')](_0x2ac563[_0xe5fa('0x29')]);_0x197b2a[_0xe5fa('0x30')]=_[_0xe5fa('0x31')](_0x197b2a['model'],_0x197b2a[_0xe5fa('0x29')]);_0x4d423d[_0xe5fa('0x32')]=_[_0xe5fa('0x31')](_0x197b2a[_0xe5fa('0x2e')],qs[_0xe5fa('0x33')](_0x2ac563['query'][_0xe5fa('0x33')]));_0x4d423d[_0xe5fa('0x32')]=_0x4d423d[_0xe5fa('0x32')][_0xe5fa('0x34')]?_0x4d423d[_0xe5fa('0x32')]:_0x197b2a['model'];if(_0x2ac563['query'][_0xe5fa('0x35')]){_0x4d423d[_0xe5fa('0x36')]=[{'all':!![]}];}_0x4d423d=_[_0xe5fa('0x37')]({},_0x4d423d,_0x2ac563[_0xe5fa('0x38')]);return db[_0xe5fa('0x22')][_0xe5fa('0x39')](_0x4d423d)[_0xe5fa('0x1b')](handleEntityNotFound(_0xf738c3,null))[_0xe5fa('0x1b')](respondWithResult(_0xf738c3,null))[_0xe5fa('0x2b')](handleError(_0xf738c3,null));};exports[_0xe5fa('0x3a')]=function(_0x4eeab3,_0x24678d){return db[_0xe5fa('0x22')][_0xe5fa('0x3a')](_0x4eeab3[_0xe5fa('0x3b')],{})[_0xe5fa('0x1b')](respondWithResult(_0x24678d,0xc9))[_0xe5fa('0x2b')](handleError(_0x24678d,null));};exports[_0xe5fa('0x3c')]=function(_0x1c2a09,_0x46b17f){if(_0x1c2a09[_0xe5fa('0x3b')]['id']){delete _0x1c2a09[_0xe5fa('0x3b')]['id'];}return db['OpenchannelInteraction'][_0xe5fa('0x39')]({'where':{'id':_0x1c2a09[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x46b17f,null))[_0xe5fa('0x1b')](saveUpdates(_0x1c2a09['body'],null))[_0xe5fa('0x1b')](respondWithResult(_0x46b17f,null))[_0xe5fa('0x2b')](handleError(_0x46b17f,null));};exports['destroy']=function(_0x500419,_0x5013eb){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x500419[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x5013eb,null))[_0xe5fa('0x1b')](removeEntity(_0x5013eb,null))[_0xe5fa('0x2b')](handleError(_0x5013eb,null));};exports[_0xe5fa('0x3d')]=function(_0x6afcad,_0x174b06){return db['OpenchannelInteraction']['describe']()[_0xe5fa('0x1b')](respondWithResult(_0x174b06,null))['catch'](handleError(_0x174b06,null));};exports[_0xe5fa('0x3e')]=function(_0x29eaf5,_0x13ec42){return db['OpenchannelMessage'][_0xe5fa('0x39')]({'where':{'id':_0x29eaf5['params']['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x13ec42,null))[_0xe5fa('0x1b')](function(_0x25635b){if(_0x25635b){return _0x25635b[_0xe5fa('0x3e')](_0x29eaf5[_0xe5fa('0x3b')][_0xe5fa('0x3f')],_[_0xe5fa('0x40')](_0x29eaf5[_0xe5fa('0x3b')],[_0xe5fa('0x3f'),'id'])||{});}})[_0xe5fa('0x1b')](respondWithResult(_0x13ec42,null))[_0xe5fa('0x2b')](handleError(_0x13ec42,null));};exports['getMessages']=function(_0x21092b,_0x16323c){var _0x1698a1={'raw':![],'where':{}};var _0x52b544={};var _0x497c40={'count':0x0,'rows':[]};return db[_0xe5fa('0x22')]['findOne']({'where':{'id':_0x21092b[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x16323c,null))[_0xe5fa('0x1b')](function(_0x4b77b6){if(_0x4b77b6){_0x52b544['model']=_['keys'](db[_0xe5fa('0x41')][_0xe5fa('0x23')]);_0x52b544['query']=_[_0xe5fa('0x2f')](_0x21092b[_0xe5fa('0x29')]);_0x52b544[_0xe5fa('0x30')]=_['intersection'](_0x52b544[_0xe5fa('0x2e')],_0x52b544[_0xe5fa('0x29')]);_0x1698a1[_0xe5fa('0x32')]=_[_0xe5fa('0x31')](_0x52b544[_0xe5fa('0x2e')],qs[_0xe5fa('0x33')](_0x21092b['query'][_0xe5fa('0x33')]));_0x1698a1[_0xe5fa('0x32')]=_0x1698a1[_0xe5fa('0x32')][_0xe5fa('0x34')]?_0x1698a1[_0xe5fa('0x32')]:_0x52b544[_0xe5fa('0x2e')];if(!_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x42')](_0xe5fa('0x43'))){_0x1698a1[_0xe5fa('0x17')]=qs[_0xe5fa('0x17')](_0x21092b[_0xe5fa('0x29')]['limit']);_0x1698a1[_0xe5fa('0x16')]=qs[_0xe5fa('0x16')](_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x16')]);}_0x1698a1[_0xe5fa('0x44')]=qs[_0xe5fa('0x45')](_0x21092b[_0xe5fa('0x29')]['sort']);_0x1698a1[_0xe5fa('0x46')]=qs[_0xe5fa('0x30')](_[_0xe5fa('0x47')](_0x21092b[_0xe5fa('0x29')],_0x52b544['filters']));_0x1698a1[_0xe5fa('0x46')][_0xe5fa('0x48')]=_0x4b77b6['id'];if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x49')]){_0x1698a1['where']=_[_0xe5fa('0x37')](_0x1698a1[_0xe5fa('0x46')],{'$or':_[_0xe5fa('0x21')](_0x1698a1[_0xe5fa('0x32')],function(_0x6a2635){var _0x5c22cd={};_0x5c22cd[_0x6a2635]={'$like':'%'+_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x49')]+'%'};return _0x5c22cd;})});}if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x4a')]){var _0x3ffde8=_0x21092b['query'][_0xe5fa('0x4a')][_0xe5fa('0x4b')](',');var _0x5dc233={};_0x5dc233[_0x3ffde8[0x0]]={'$gte':moment(_0x3ffde8[0x1])['format'](_0xe5fa('0x4c'))};_0x1698a1[_0xe5fa('0x46')]=_['merge'](_0x1698a1['where'],_0x5dc233);}_0x1698a1=_[_0xe5fa('0x37')]({},_0x1698a1,_0x21092b['options']);return db['OpenchannelMessage']['count']({'where':_0x1698a1[_0xe5fa('0x46')]})[_0xe5fa('0x1b')](function(_0x38146f){_0x497c40[_0xe5fa('0x18')]=_0x38146f;if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x35')]){_0x1698a1[_0xe5fa('0x36')]=[{'all':!![]}];}return db[_0xe5fa('0x41')][_0xe5fa('0x27')](_0x1698a1);})['then'](function(_0x48fa49){_0x497c40[_0xe5fa('0x4d')]=_0x48fa49;return _0x497c40;});}})['then'](respondWithFilteredResult(_0x16323c,_0x1698a1))[_0xe5fa('0x2b')](handleError(_0x16323c,null));};exports[_0xe5fa('0x4e')]=function(_0x111fba,_0x41d9e2){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x111fba[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x41d9e2,null))[_0xe5fa('0x1b')](function(_0x1f4159){if(_0x1f4159){return _0x1f4159[_0xe5fa('0x4f')](_0x111fba['body'][_0xe5fa('0x3f')],_['omit'](_0x111fba['body'],[_0xe5fa('0x3f'),'id'])||{})[_0xe5fa('0x50')](function(){return db[_0xe5fa('0x51')]['findAll']({'attributes':['id',_0xe5fa('0x1f'),_0xe5fa('0x52')],'where':{'id':_0x111fba[_0xe5fa('0x3b')][_0xe5fa('0x3f')]}});})[_0xe5fa('0x1b')](function(_0x595b83){socket[_0xe5fa('0x53')](_0xe5fa('0x54'),{'id':Number(_0x111fba['params']['id']),'tags':_0x595b83||[]});return{'id':Number(_0x111fba[_0xe5fa('0x2d')]['id']),'tags':_0x595b83||[]};});}})[_0xe5fa('0x1b')](respondWithResult(_0x41d9e2,null))[_0xe5fa('0x2b')](handleError(_0x41d9e2,null));};exports[_0xe5fa('0x55')]=function(_0x219080,_0x481d0c){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x219080[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x481d0c,null))['then'](function(_0x3cf8f5){if(_0x3cf8f5){return _0x3cf8f5['removeTags'](_0x219080[_0xe5fa('0x29')][_0xe5fa('0x3f')]);}})[_0xe5fa('0x1b')](respondWithStatusCode(_0x481d0c,null))[_0xe5fa('0x2b')](handleError(_0x481d0c,null));};exports[_0xe5fa('0x56')]=function(_0x5e40f1,_0x22c11d){var _0x412967=moment()[_0xe5fa('0x57')]()[_0xe5fa('0x58')]();var _0x22c858=path['join'](config[_0xe5fa('0x59')],'server','files',_0xe5fa('0x5a'));var _0x3abca5=path['join'](config['root'],'server',_0xe5fa('0x5b'),_0xe5fa('0x5c'));var _0x74fa6b=path[_0xe5fa('0x5d')](_0x22c858,_0x412967);var _0xaebc37=util[_0xe5fa('0x5e')](_0xe5fa('0x5f'),_0x5e40f1['params']['id'],_0x412967);var _0x3b7428=path['join'](_0x22c858,_0xaebc37);var _0x5c3032=[];_0x5c3032[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x61')],'as':_0xe5fa('0x61'),'attributes':['id',_0xe5fa('0x62')],'raw':!![]});_0x5c3032[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x63')],'as':_0xe5fa('0x64'),'attributes':['id',_0xe5fa('0x65'),'lastName'],'raw':!![]});if(_0x5e40f1[_0xe5fa('0x29')][_0xe5fa('0x5c')]){_0x5c3032[_0xe5fa('0x60')]({'model':db['Attachment'],'as':_0xe5fa('0x66'),'raw':!![]});}var _0x3cd553=[{'model':db[_0xe5fa('0x41')],'as':_0xe5fa('0x67'),'attributes':['id',_0xe5fa('0x3b'),_0xe5fa('0x68'),_0xe5fa('0x69'),_0xe5fa('0x6a'),_0xe5fa('0x6b')],'include':_0x5c3032}];_0x3cd553['push']({'model':db[_0xe5fa('0x6c')],'as':_0xe5fa('0x6d'),'attributes':['id','name']});_0x3cd553[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x61')],'as':_0xe5fa('0x6e'),'attributes':['id',_0xe5fa('0x62')]});return db['OpenchannelInteraction'][_0xe5fa('0x39')]({'where':{'id':_0x5e40f1['params']['id']},'include':_0x3cd553})['then'](handleEntityNotFound(_0x22c11d,null))[_0xe5fa('0x1b')](function(_0x2dd96d){if(_0x2dd96d){var _0x4aed6a=_0x2dd96d[_0xe5fa('0x6f')]({'plain':!![]});fs['mkdirSync'](_0x74fa6b);var _0x270bbe={'channel':_0xe5fa('0x70'),'account':_0x4aed6a[_0xe5fa('0x6d')][_0xe5fa('0x1f')],'agent':_0x4aed6a[_0xe5fa('0x6e')]?_0x4aed6a[_0xe5fa('0x6e')][_0xe5fa('0x62')]:'N.A.','createdAt':moment(_0x4aed6a['createdAt'])[_0xe5fa('0x5e')](_0xe5fa('0x4c'))[_0xe5fa('0x58')](),'closedAt':_0x4aed6a[_0xe5fa('0x71')]?moment(_0x4aed6a[_0xe5fa('0x72')])[_0xe5fa('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe5fa('0x58')]():'','disposition':_0x4aed6a[_0xe5fa('0x73')],'visibility':_0x4aed6a[_0xe5fa('0x74')]?'Public':_0xe5fa('0x75'),'messages':_(_0x4aed6a['Messages'])['filter']({'secret':![]})[_0xe5fa('0x21')](function(_0x5e59b1){if(_0x5e59b1[_0xe5fa('0x66')]){var _0x228a77=path['join'](_0x3abca5,_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')]);if(fs[_0xe5fa('0x77')](_0x228a77)){fs[_0xe5fa('0x78')](_0x228a77)[_0xe5fa('0x79')](fs[_0xe5fa('0x7a')](path[_0xe5fa('0x5d')](_0x74fa6b,_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')])));}}return{'date':moment(_0x5e59b1[_0xe5fa('0x68')])[_0xe5fa('0x5e')](_0xe5fa('0x4c'))[_0xe5fa('0x58')](),'sender':_0x5e59b1['direction']===_0xe5fa('0x7b')?_0x5e59b1[_0xe5fa('0x61')]?_0x5e59b1[_0xe5fa('0x61')]['fullname']:'System':_0x5e59b1[_0xe5fa('0x64')][_0xe5fa('0x65')]+(_0x5e59b1[_0xe5fa('0x64')]['lastName']?'\x20'+_0x5e59b1['Contact'][_0xe5fa('0x7c')]:''),'body':_0x5e59b1[_0xe5fa('0x66')]?_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')]:_0x5e59b1[_0xe5fa('0x3b')],'direction':_0x5e59b1[_0xe5fa('0x69')]===_0xe5fa('0x7b')?'A':'C','secret':_0x5e59b1[_0xe5fa('0x6a')],'read':_0x5e59b1['read'],'attachment':_0x5e59b1[_0xe5fa('0x66')]};})[_0xe5fa('0x7d')]()};return ejs[_0xe5fa('0x7e')](path[_0xe5fa('0x5d')](config[_0xe5fa('0x59')],'server',_0xe5fa('0x7f'),_0xe5fa('0x80')),{'interaction':_0x270bbe})['then'](function(_0x2b9f3d){var _0x1b8d4a=path[_0xe5fa('0x5d')](_0x74fa6b,_0xe5fa('0x81')+_0x4aed6a['id']+'-'+_0x412967+_0xe5fa('0x82'));var _0x158a16={'path':_0x1b8d4a,'channel':_0xe5fa('0x70'),'interactionId':_0x4aed6a['id']};return pdf[_0xe5fa('0x83')](_0x2b9f3d,_0x158a16);})[_0xe5fa('0x1b')](function(){return new Promise(function(_0x565dbc,_0x1011d2){zipdir(_0x74fa6b,{'saveTo':_0x3b7428},function(_0x1c2afe,_0x1455e5){if(_0x1c2afe)return _0x1011d2(_0x1c2afe);return _0x565dbc(_0x1455e5);});})[_0xe5fa('0x1b')](function(){return new Promise(function(_0x41826c,_0x386a1b){rimraf(_0x74fa6b,function(_0x8e0018){if(_0x8e0018)_0x386a1b(_0x8e0018);return _0x41826c();});});})['then'](function(){return _0x22c11d[_0xe5fa('0x56')](_0x3b7428,_0xaebc37,function(_0x3d0000){if(_0x3d0000){logger[_0xe5fa('0x1d')](_0xe5fa('0x84'),_0x3d0000);}else{fs['unlinkSync'](_0x3b7428);}});});});}else{return _0x22c11d[_0xe5fa('0x12')](0xc8);}})[_0xe5fa('0x2b')](handleError(_0x22c11d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 865ac25..e6d514c 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 _0x857c=['remove','getUsers','then','Users','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','update'];(function(_0x1f6702,_0x48787c){var _0x9a7d50=function(_0x579480){while(--_0x579480){_0x1f6702['push'](_0x1f6702['shift']());}};_0x9a7d50(++_0x48787c);}(_0x857c,0x19b));var _0xc857=function(_0x453a81,_0xa594c1){_0x453a81=_0x453a81-0x0;var _0x4812e6=_0x857c[_0x453a81];return _0x4812e6;};'use strict';var EventEmitter=require(_0xc857('0x0'));var OpenchannelInteraction=require(_0xc857('0x1'))['db'][_0xc857('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc857('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc857('0x4'),'afterDestroy':_0xc857('0x5')};function emitEvent(_0x594578){return function(_0x3d67d7,_0x55a7bb,_0x1bb43d){_0x3d67d7[_0xc857('0x6')]({'attributes':['id'],'raw':!![]})[_0xc857('0x7')](function(_0x310449){_0x3d67d7['setDataValue'](_0xc857('0x8'),_0x310449['map'](function(_0x99d091){return{'id':_0x99d091['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3d67d7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc857('0x7')](function(_0x2a0b62){_0x3d67d7['setDataValue']('unreadMessages',_0x2a0b62['length']);OpenchannelInteractionEvents[_0xc857('0x9')](_0x594578+':'+_0x3d67d7['id'],_0x3d67d7);OpenchannelInteractionEvents['emit'](_0x594578,_0x3d67d7);_0x1bb43d(null);})[_0xc857('0xa')](_0x1bb43d(null));};}for(var e in events){if(events[_0xc857('0xb')](e)){var event=events[e];OpenchannelInteraction[_0xc857('0xc')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5eff=['catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x501fde,_0x1ee95c){var _0x248bbe=function(_0x55dca6){while(--_0x55dca6){_0x501fde['push'](_0x501fde['shift']());}};_0x248bbe(++_0x1ee95c);}(_0x5eff,0xd2));var _0xf5ef=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x5eff[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require(_0xf5ef('0x0'));var OpenchannelInteraction=require(_0xf5ef('0x1'))['db'][_0xf5ef('0x2')];var OpenchannelMessage=require(_0xf5ef('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf5ef('0x3')](0x0);var events={'afterCreate':_0xf5ef('0x4'),'afterUpdate':_0xf5ef('0x5'),'afterDestroy':_0xf5ef('0x6')};function emitEvent(_0x5c653c){return function(_0x22c0cf,_0x263592,_0x42fb84){_0x22c0cf['getUsers']({'attributes':['id'],'raw':!![]})[_0xf5ef('0x7')](function(_0x34b03d){_0x22c0cf[_0xf5ef('0x8')](_0xf5ef('0x9'),_0x34b03d[_0xf5ef('0xa')](function(_0x5646fc){return{'id':_0x5646fc['id']};}));return OpenchannelMessage[_0xf5ef('0xb')]({'where':{'OpenchannelInteractionId':_0x22c0cf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf5ef('0x7')](function(_0x11c264){_0x22c0cf[_0xf5ef('0x8')](_0xf5ef('0xc'),_0x11c264[_0xf5ef('0xd')]);OpenchannelInteractionEvents['emit'](_0x5c653c+':'+_0x22c0cf['id'],_0x22c0cf);OpenchannelInteractionEvents['emit'](_0x5c653c,_0x22c0cf);_0x42fb84(null);})[_0xf5ef('0xe')](_0x42fb84(null));};}for(var e in events){if(events[_0xf5ef('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9876c93..e8b0690 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 _0xdf97=['utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xdf97,0x11d));var _0x7df9=function(_0x144310,_0x3f3931){_0x144310=_0x144310-0x0;var _0x3ac520=_0xdf97[_0x144310];return _0x3ac520;};'use strict';var _=require('lodash');var util=require(_0x7df9('0x0'));var logger=require(_0x7df9('0x1'))(_0x7df9('0x2'));var moment=require(_0x7df9('0x3'));var BPromise=require(_0x7df9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7df9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7df9('0x6'));module['exports']=function(_0x1840e0,_0x1db556){return _0x1840e0['define'](_0x7df9('0x7'),attributes,{'tableName':_0x7df9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7df9('0x9'),'collate':_0x7df9('0xa'),'hooks':{'beforeUpdate':function(_0x3bd2d9,_0x3db607,_0x35e3eb){if(_0x3bd2d9[_0x7df9('0xb')]('closed')){_0x3bd2d9['closedAt']=moment()[_0x7df9('0xc')](_0x7df9('0xd'));}_0x35e3eb(null,_0x3bd2d9);}}});}; \ No newline at end of file +var _0xad60=['api','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger'];(function(_0x59ebcc,_0x29dc7c){var _0x5a5356=function(_0x50928f){while(--_0x50928f){_0x59ebcc['push'](_0x59ebcc['shift']());}};_0x5a5356(++_0x29dc7c);}(_0xad60,0x19f));var _0x0ad6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xad60[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ad6('0x0'))(_0x0ad6('0x1'));var moment=require('moment');var BPromise=require(_0x0ad6('0x2'));var rp=require(_0x0ad6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad6('0x4'));var config=require('../../config/environment');var attributes=require(_0x0ad6('0x5'));module[_0x0ad6('0x6')]=function(_0x2a5a88,_0x245a04){return _0x2a5a88[_0x0ad6('0x7')](_0x0ad6('0x8'),attributes,{'tableName':_0x0ad6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ad6('0xa'),'collate':_0x0ad6('0xb'),'hooks':{'beforeUpdate':function(_0x480325,_0x41d2bf,_0xb5eb02){if(_0x480325[_0x0ad6('0xc')](_0x0ad6('0xd'))){_0x480325['closedAt']=moment()[_0x0ad6('0xe')](_0x0ad6('0xf'));}_0xb5eb02(null,_0x480325);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a6bbcc5..69c20c4 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 _0xf51a=['find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','limit','then','debug','AddTagsToOpenchannelInteraction'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf51a,0x16d));var _0xaf51=function(_0x2fdec1,_0x5ded03){_0x2fdec1=_0x2fdec1-0x0;var _0xd12ec1=_0xf51a[_0x2fdec1];return _0xd12ec1;};'use strict';var _=require(_0xaf51('0x0'));var util=require('util');var moment=require(_0xaf51('0x1'));var BPromise=require(_0xaf51('0x2'));var rs=require(_0xaf51('0x3'));var fs=require('fs');var Redis=require(_0xaf51('0x4'));var db=require(_0xaf51('0x5'))['db'];var utils=require(_0xaf51('0x6'));var logger=require(_0xaf51('0x7'))(_0xaf51('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf51('0x9')]['http']({'port':0x232a});config[_0xaf51('0xa')]=_[_0xaf51('0xb')](config[_0xaf51('0xa')],{'host':_0xaf51('0xc'),'port':0x18eb});var socket=require(_0xaf51('0xd'))(new Redis(config[_0xaf51('0xa')]));require('./openchannelInteraction.socket')[_0xaf51('0xe')](socket);function respondWithRpcPromise(_0x36471d,_0x136fb4,_0x367e4e){return new BPromise(function(_0x3f5ca3,_0x334711){return client[_0xaf51('0xf')](_0x36471d,_0x367e4e)['then'](function(_0x80980c){logger[_0xaf51('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x136fb4,_0xaf51('0x11'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x136fb4,_0xaf51('0x11'),JSON[_0xaf51('0x12')](_0x80980c));if(_0x80980c['error']){if(_0x80980c[_0xaf51('0x13')][_0xaf51('0x14')]===0x1f4){logger[_0xaf51('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x136fb4,_0x80980c[_0xaf51('0x13')][_0xaf51('0x15')]);return _0x334711(_0x80980c[_0xaf51('0x13')][_0xaf51('0x15')]);}logger['error'](_0xaf51('0x16'),_0x136fb4,_0x80980c[_0xaf51('0x13')][_0xaf51('0x15')]);return _0x3f5ca3(_0x80980c[_0xaf51('0x13')]['message']);}else{logger[_0xaf51('0x10')](_0xaf51('0x16'),_0x136fb4,_0xaf51('0x11'));_0x3f5ca3(_0x80980c[_0xaf51('0x17')]['message']);}})[_0xaf51('0x18')](function(_0xba73d4){logger['error'](_0xaf51('0x16'),_0x136fb4,_0xba73d4);_0x334711(_0xba73d4);});});}exports[_0xaf51('0x19')]=function(_0x3a9a32){var _0x22177f=this;return new Promise(function(_0x37d042,_0x1616e2){return db[_0xaf51('0x1a')]['update'](_0x3a9a32[_0xaf51('0x1b')],{'raw':_0x3a9a32['options']?_0x3a9a32[_0xaf51('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a9a32[_0xaf51('0x1c')]?_0x3a9a32[_0xaf51('0x1c')][_0xaf51('0x1d')]||null:null,'attributes':_0x3a9a32[_0xaf51('0x1c')]?_0x3a9a32[_0xaf51('0x1c')][_0xaf51('0x1e')]||null:null,'limit':_0x3a9a32[_0xaf51('0x1c')]?_0x3a9a32['options'][_0xaf51('0x1f')]||null:null})[_0xaf51('0x20')](function(_0x1a9ee1){logger['info'](_0xaf51('0x19'),_0x3a9a32);logger[_0xaf51('0x21')](_0xaf51('0x19'),_0x3a9a32,JSON[_0xaf51('0x12')](_0x1a9ee1));_0x37d042(_0x1a9ee1);})[_0xaf51('0x18')](function(_0x566fd7){logger[_0xaf51('0x13')](_0xaf51('0x19'),_0x566fd7['message'],_0x3a9a32);_0x1616e2(_0x22177f[_0xaf51('0x13')](0x1f4,_0x566fd7[_0xaf51('0x15')]));});});};exports[_0xaf51('0x22')]=function(_0x3a0491){return new Promise(function(_0x3ac3df,_0x56c1ba){return db[_0xaf51('0x1a')][_0xaf51('0x23')]({'where':_0x3a0491['options']?_0x3a0491[_0xaf51('0x1c')]['where']||null:null})[_0xaf51('0x20')](function(_0x4fc84a){if(_0x4fc84a){return _0x4fc84a[_0xaf51('0x24')](_0x3a0491[_0xaf51('0x1b')][_0xaf51('0x25')],_[_0xaf51('0x26')](_0x3a0491['body'],[_0xaf51('0x25'),'id'])||{});}})['spread'](function(_0x10ed7d){logger[_0xaf51('0x10')](_0xaf51('0x27'),_0x3a0491);logger[_0xaf51('0x21')]('AddTags',_0x3a0491,JSON[_0xaf51('0x12')](_0x10ed7d));_0x3ac3df(_0x10ed7d);})[_0xaf51('0x18')](function(_0x1d4785){logger[_0xaf51('0x13')](_0xaf51('0x27'),_0x1d4785['message'],_0x3a0491);_0x56c1ba(_this['error'](0x1f4,_0x1d4785[_0xaf51('0x15')]));});});}; \ No newline at end of file +var _0xe7b6=['request\x20sent','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','stringify','catch','AddTagsToOpenchannelInteraction','addTags','omit','ids','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2e5069,_0x3a1115){var _0x2f00ad=function(_0x3cba4f){while(--_0x3cba4f){_0x2e5069['push'](_0x2e5069['shift']());}};_0x2f00ad(++_0x3a1115);}(_0xe7b6,0x170));var _0x6e7b=function(_0x2bcedb,_0x545cf4){_0x2bcedb=_0x2bcedb-0x0;var _0x1c7e2e=_0xe7b6[_0x2bcedb];return _0x1c7e2e;};'use strict';var _=require(_0x6e7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e7b('0x1'));var fs=require('fs');var Redis=require(_0x6e7b('0x2'));var db=require(_0x6e7b('0x3'))['db'];var utils=require(_0x6e7b('0x4'));var logger=require(_0x6e7b('0x5'))(_0x6e7b('0x6'));var config=require(_0x6e7b('0x7'));var jayson=require(_0x6e7b('0x8'));var client=jayson[_0x6e7b('0x9')][_0x6e7b('0xa')]({'port':0x232a});config[_0x6e7b('0xb')]=_[_0x6e7b('0xc')](config[_0x6e7b('0xb')],{'host':_0x6e7b('0xd'),'port':0x18eb});var socket=require(_0x6e7b('0xe'))(new Redis(config[_0x6e7b('0xb')]));require(_0x6e7b('0xf'))['register'](socket);function respondWithRpcPromise(_0x1542c6,_0x1520a5,_0x3ebec6){return new BPromise(function(_0x115d78,_0xc62534){return client[_0x6e7b('0x10')](_0x1542c6,_0x3ebec6)['then'](function(_0x1a32c4){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1520a5,'request\x20sent');logger[_0x6e7b('0x11')](_0x6e7b('0x12'),_0x1520a5,_0x6e7b('0x13'),JSON['stringify'](_0x1a32c4));if(_0x1a32c4['error']){if(_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x15')]===0x1f4){logger[_0x6e7b('0x14')](_0x6e7b('0x16'),_0x1520a5,_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);return _0xc62534(_0x1a32c4['error']['message']);}logger[_0x6e7b('0x14')](_0x6e7b('0x16'),_0x1520a5,_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);return _0x115d78(_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);}else{logger[_0x6e7b('0x18')](_0x6e7b('0x16'),_0x1520a5,_0x6e7b('0x13'));_0x115d78(_0x1a32c4[_0x6e7b('0x19')]['message']);}})['catch'](function(_0x15c9c4){logger['error'](_0x6e7b('0x16'),_0x1520a5,_0x15c9c4);_0xc62534(_0x15c9c4);});});}exports[_0x6e7b('0x1a')]=function(_0x4f7c4b){var _0x444464=this;return new Promise(function(_0x585cd9,_0x511629){return db[_0x6e7b('0x1b')][_0x6e7b('0x1c')](_0x4f7c4b[_0x6e7b('0x1d')],{'raw':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b[_0x6e7b('0x1e')][_0x6e7b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b['options'][_0x6e7b('0x20')]||null:null,'attributes':_0x4f7c4b['options']?_0x4f7c4b[_0x6e7b('0x1e')][_0x6e7b('0x21')]||null:null,'limit':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b['options'][_0x6e7b('0x22')]||null:null})[_0x6e7b('0x23')](function(_0x2b123d){logger[_0x6e7b('0x18')](_0x6e7b('0x1a'),_0x4f7c4b);logger[_0x6e7b('0x11')](_0x6e7b('0x1a'),_0x4f7c4b,JSON[_0x6e7b('0x24')](_0x2b123d));_0x585cd9(_0x2b123d);})[_0x6e7b('0x25')](function(_0xd26c31){logger['error'](_0x6e7b('0x1a'),_0xd26c31[_0x6e7b('0x17')],_0x4f7c4b);_0x511629(_0x444464[_0x6e7b('0x14')](0x1f4,_0xd26c31[_0x6e7b('0x17')]));});});};exports[_0x6e7b('0x26')]=function(_0x38115c){return new Promise(function(_0xe898d4,_0x382d31){return db[_0x6e7b('0x1b')]['find']({'where':_0x38115c[_0x6e7b('0x1e')]?_0x38115c[_0x6e7b('0x1e')]['where']||null:null})[_0x6e7b('0x23')](function(_0x53f864){if(_0x53f864){return _0x53f864[_0x6e7b('0x27')](_0x38115c[_0x6e7b('0x1d')]['ids'],_[_0x6e7b('0x28')](_0x38115c[_0x6e7b('0x1d')],[_0x6e7b('0x29'),'id'])||{});}})['spread'](function(_0x437b6e){logger['info']('AddTags',_0x38115c);logger[_0x6e7b('0x11')](_0x6e7b('0x2a'),_0x38115c,JSON[_0x6e7b('0x24')](_0x437b6e));_0xe898d4(_0x437b6e);})['catch'](function(_0xe3a380){logger['error'](_0x6e7b('0x2a'),_0xe3a380[_0x6e7b('0x17')],_0x38115c);_0x382d31(_this['error'](0x1f4,_0xe3a380[_0x6e7b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a20c77a..290545f 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 _0xde57=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x449158,_0x44e1b0){var _0x1f3c3a=function(_0x5f1053){while(--_0x5f1053){_0x449158['push'](_0x449158['shift']());}};_0x1f3c3a(++_0x44e1b0);}(_0xde57,0x199));var _0x7de5=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0xde57[_0x4ec13d];return _0x3c3fa7;};'use strict';var OpenchannelInteractionEvents=require(_0x7de5('0x0'));var events=[_0x7de5('0x1'),_0x7de5('0x2'),_0x7de5('0x3')];function createListener(_0x413705,_0x1a2244){return function(_0x48f222){_0x1a2244[_0x7de5('0x4')](_0x413705,_0x48f222);};}function removeListener(_0x253405,_0x39c007){return function(){OpenchannelInteractionEvents[_0x7de5('0x5')](_0x253405,_0x39c007);};}exports[_0x7de5('0x6')]=function(_0x1d39e3){for(var _0x2a317e=0x0,_0x66ab8b=events[_0x7de5('0x7')];_0x2a317e<_0x66ab8b;_0x2a317e++){var _0xc619d6=events[_0x2a317e];var _0x19ac99=createListener(_0x7de5('0x8')+_0xc619d6,_0x1d39e3);OpenchannelInteractionEvents['on'](_0xc619d6,_0x19ac99);}}; \ No newline at end of file +var _0x6650=['update','emit','register','./openchannelInteraction.events','save','remove'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x6650,0x1a1));var _0x0665=function(_0x5e16f8,_0x3c55b3){_0x5e16f8=_0x5e16f8-0x0;var _0x10c885=_0x6650[_0x5e16f8];return _0x10c885;};'use strict';var OpenchannelInteractionEvents=require(_0x0665('0x0'));var events=[_0x0665('0x1'),_0x0665('0x2'),_0x0665('0x3')];function createListener(_0xbe4722,_0x44bed7){return function(_0x9f9c90){_0x44bed7[_0x0665('0x4')](_0xbe4722,_0x9f9c90);};}function removeListener(_0x5d0a51,_0x406971){return function(){OpenchannelInteractionEvents['removeListener'](_0x5d0a51,_0x406971);};}exports[_0x0665('0x5')]=function(_0x323486){for(var _0x46d84a=0x0,_0x4cdcc6=events['length'];_0x46d84a<_0x4cdcc6;_0x46d84a++){var _0x53f696=events[_0x46d84a];var _0x58ed97=createListener('openchannelInteraction:'+_0x53f696,_0x323486);OpenchannelInteractionEvents['on'](_0x53f696,_0x58ed97);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index c40e119..6b72a8d 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x155345,_0x41a07b){_0x155345=_0x155345-0x0;var _0x2fb119=_0x70e0[_0x155345];return _0x2fb119;};'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 fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x58eca9,_0x219608){var _0x25a12e=function(_0x1d3695){while(--_0x1d3695){_0x58eca9['push'](_0x58eca9['shift']());}};_0x25a12e(++_0x219608);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xcb91[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index d0ece72..af7ebfc 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 _0x7497=['TEXT','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x240201,_0xfcdaa1){var _0x24fe3c=function(_0x5a9e8b){while(--_0x5a9e8b){_0x240201['push'](_0x240201['shift']());}};_0x24fe3c(++_0xfcdaa1);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7749('0x0'));module[_0x7749('0x1')]={'body':{'type':Sequelize[_0x7749('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7749('0x3')]('in',_0x7749('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7749('0x5')]},'providerName':{'type':Sequelize[_0x7749('0x6')]},'providerResponse':{'type':Sequelize[_0x7749('0x2')]}}; \ No newline at end of file +var _0x1678=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x56c59b,_0x27a5c0){var _0x1f3095=function(_0x2a71a0){while(--_0x2a71a0){_0x56c59b['push'](_0x56c59b['shift']());}};_0x1f3095(++_0x27a5c0);}(_0x1678,0x17b));var _0x8167=function(_0xe67313,_0x32599a){_0xe67313=_0xe67313-0x0;var _0x1d9a1f=_0x1678[_0xe67313];return _0x1d9a1f;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'body':{'type':Sequelize[_0x8167('0x2')](_0x8167('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8167('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8167('0x5')),'defaultValue':_0x8167('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8167('0x6')]},'providerName':{'type':Sequelize[_0x8167('0x7')]},'providerResponse':{'type':Sequelize[_0x8167('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a0be11b..9092371 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 _0x1174=['json','undefined','limit','offset','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','OpenchannelMessage','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','format','role','null','AcceptMessage','QueryTypes','SELECT','contact','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','sequelize','Sequelize','User','fullname','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status'];(function(_0x329a7a,_0x21c078){var _0x506ad5=function(_0x12c8a0){while(--_0x12c8a0){_0x329a7a['push'](_0x329a7a['shift']());}};_0x506ad5(++_0x21c078);}(_0x1174,0x146));var _0x4117=function(_0x222245,_0x334f8a){_0x222245=_0x222245-0x0;var _0x271de6=_0x1174[_0x222245];return _0x271de6;};'use strict';var emlformat=require(_0x4117('0x0'));var rimraf=require(_0x4117('0x1'));var zipdir=require(_0x4117('0x2'));var jsonpatch=require(_0x4117('0x3'));var rp=require(_0x4117('0x4'));var moment=require(_0x4117('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4117('0x6'));var util=require(_0x4117('0x7'));var path=require(_0x4117('0x8'));var sox=require(_0x4117('0x9'));var csv=require(_0x4117('0xa'));var ejs=require(_0x4117('0xb'));var fs=require('fs');var fs_extra=require(_0x4117('0xc'));var _=require('lodash');var squel=require(_0x4117('0xd'));var crypto=require(_0x4117('0xe'));var jsforce=require(_0x4117('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4117('0xa'));var querystring=require(_0x4117('0x10'));var Papa=require(_0x4117('0x11'));var Redis=require('ioredis');var authService=require(_0x4117('0x12'));var qs=require(_0x4117('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4117('0x14'))(_0x4117('0x15'));var utils=require(_0x4117('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4117('0x17'));var db=require(_0x4117('0x18'))['db'];config['redis']=_[_0x4117('0x19')](config[_0x4117('0x1a')],{'host':_0x4117('0x1b'),'port':0x18eb});var socket=require(_0x4117('0x1c'))(new Redis(config[_0x4117('0x1a')]));require(_0x4117('0x1d'))['register'](socket);var jayson=require(_0x4117('0x1e'));var client=jayson[_0x4117('0x1f')][_0x4117('0x20')]({'port':0x232c});var client9002=jayson[_0x4117('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bd3b,_0x1e8ced,_0x491af4,_0x509c17){return new BPromise(function(_0x5bdbfb,_0x44f136){var _0x4aebd2=_0x509c17||client;return _0x4aebd2['request'](_0x32bd3b,_0x491af4)[_0x4117('0x21')](function(_0x44ca51){logger[_0x4117('0x22')](_0x4117('0x23'),_0x1e8ced,_0x4117('0x24'));logger[_0x4117('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1e8ced,_0x4117('0x24'),JSON[_0x4117('0x26')](_0x44ca51));if(_0x44ca51[_0x4117('0x27')]){if(_0x44ca51[_0x4117('0x27')]['code']===0x1f4){logger[_0x4117('0x27')](_0x4117('0x23'),_0x1e8ced,_0x44ca51[_0x4117('0x27')][_0x4117('0x28')]);return _0x44f136(_0x44ca51[_0x4117('0x27')][_0x4117('0x28')]);}logger['error'](_0x4117('0x23'),_0x1e8ced,_0x44ca51[_0x4117('0x27')][_0x4117('0x28')]);return _0x5bdbfb(_0x44ca51[_0x4117('0x27')]['message']);}else{logger[_0x4117('0x22')](_0x4117('0x23'),_0x1e8ced,'request\x20sent');_0x5bdbfb(_0x44ca51['result']['message']);}})['catch'](function(_0x14eb7a){logger[_0x4117('0x27')](_0x4117('0x23'),_0x1e8ced,_0x14eb7a);_0x44f136(_0x14eb7a);});});}function respondWithStatusCode(_0x4109b4,_0x3e3f48){_0x3e3f48=_0x3e3f48||0xcc;return function(_0x37b6da){if(_0x37b6da){return _0x4109b4[_0x4117('0x29')](_0x3e3f48);}return _0x4109b4[_0x4117('0x2a')](_0x3e3f48)['end']();};}function respondWithResult(_0x358d9b,_0x4f6cb1){_0x4f6cb1=_0x4f6cb1||0xc8;return function(_0x23a4b9){if(_0x23a4b9){return _0x358d9b[_0x4117('0x2a')](_0x4f6cb1)[_0x4117('0x2b')](_0x23a4b9);}};}function respondWithFilteredResult(_0x1082db,_0x18f142){return function(_0x2932e9){if(_0x2932e9){var _0x4f882c=typeof _0x18f142['offset']===_0x4117('0x2c')&&typeof _0x18f142[_0x4117('0x2d')]===_0x4117('0x2c');var _0x1b2c82=_0x2932e9['count'];var _0xedaee7=_0x4f882c?0x0:_0x18f142[_0x4117('0x2e')];var _0x4de93e=_0x4f882c?_0x2932e9['count']:_0x18f142[_0x4117('0x2e')]+_0x18f142[_0x4117('0x2d')];var _0x2983d3;if(_0x4de93e>=_0x1b2c82){_0x4de93e=_0x1b2c82;_0x2983d3=0xc8;}else{_0x2983d3=0xce;}_0x1082db[_0x4117('0x2a')](_0x2983d3);return _0x1082db['set']('Content-Range',_0xedaee7+'-'+_0x4de93e+'/'+_0x1b2c82)[_0x4117('0x2b')](_0x2932e9);}return null;};}function patchUpdates(_0x36c2ce){return function(_0x4a5bca){try{jsonpatch[_0x4117('0x2f')](_0x4a5bca,_0x36c2ce,!![]);}catch(_0x31d32f){return BPromise[_0x4117('0x30')](_0x31d32f);}return _0x4a5bca[_0x4117('0x31')]();};}function saveUpdates(_0x491029,_0x21acde){return function(_0x9d598d){if(_0x9d598d){return _0x9d598d[_0x4117('0x32')](_0x491029)[_0x4117('0x21')](function(_0x2cd0ca){return _0x2cd0ca;});}return null;};}function removeEntity(_0x2c55f0,_0x2e6cd6){return function(_0x167cdd){if(_0x167cdd){return _0x167cdd['destroy']()[_0x4117('0x21')](function(){_0x2c55f0[_0x4117('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46cd95,_0x1d0c21){return function(_0x1c3909){if(!_0x1c3909){_0x46cd95[_0x4117('0x29')](0x194);}return _0x1c3909;};}function handleError(_0x103037,_0x4ce9b4){_0x4ce9b4=_0x4ce9b4||0x1f4;return function(_0x42da4a){logger[_0x4117('0x27')](_0x42da4a[_0x4117('0x33')]);if(_0x42da4a[_0x4117('0x34')]){delete _0x42da4a['name'];}_0x103037['status'](_0x4ce9b4)[_0x4117('0x35')](_0x42da4a);};}exports[_0x4117('0x36')]=function(_0xdc20a1,_0xc22f07){var _0x207c59={},_0x450ae9={},_0x35d25d={'count':0x0,'rows':[]};var _0x4297a3=_[_0x4117('0x37')](db['OpenchannelMessage'][_0x4117('0x38')],function(_0x228711){return{'name':_0x228711[_0x4117('0x39')],'type':_0x228711[_0x4117('0x3a')]['key']};});_0x450ae9[_0x4117('0x3b')]=_[_0x4117('0x37')](_0x4297a3,'name');_0x450ae9['query']=_[_0x4117('0x3c')](_0xdc20a1[_0x4117('0x3d')]);_0x450ae9[_0x4117('0x3e')]=_[_0x4117('0x3f')](_0x450ae9[_0x4117('0x3b')],_0x450ae9[_0x4117('0x3d')]);_0x207c59[_0x4117('0x40')]=_[_0x4117('0x3f')](_0x450ae9[_0x4117('0x3b')],qs[_0x4117('0x41')](_0xdc20a1[_0x4117('0x3d')][_0x4117('0x41')]));_0x207c59[_0x4117('0x40')]=_0x207c59['attributes'][_0x4117('0x42')]?_0x207c59[_0x4117('0x40')]:_0x450ae9[_0x4117('0x3b')];if(!_0xdc20a1['query'][_0x4117('0x43')](_0x4117('0x44'))){_0x207c59[_0x4117('0x2d')]=qs[_0x4117('0x2d')](_0xdc20a1[_0x4117('0x3d')][_0x4117('0x2d')]);_0x207c59[_0x4117('0x2e')]=qs['offset'](_0xdc20a1['query'][_0x4117('0x2e')]);}_0x207c59[_0x4117('0x45')]=qs[_0x4117('0x46')](_0xdc20a1['query'][_0x4117('0x46')]);_0x207c59[_0x4117('0x47')]=qs['filters'](_[_0x4117('0x48')](_0xdc20a1['query'],_0x450ae9[_0x4117('0x3e')]),_0x4297a3);if(_0xdc20a1['query'][_0x4117('0x49')]){_0x207c59[_0x4117('0x47')]=_[_0x4117('0x4a')](_0x207c59[_0x4117('0x47')],{'$or':_[_0x4117('0x37')](_0x4297a3,function(_0x598144){if(_0x598144['type']!=='VIRTUAL'){var _0x11a3d9={};_0x11a3d9[_0x598144[_0x4117('0x34')]]={'$like':'%'+_0xdc20a1[_0x4117('0x3d')][_0x4117('0x49')]+'%'};return _0x11a3d9;}})});}_0x207c59=_[_0x4117('0x4a')]({},_0x207c59,_0xdc20a1['options']);var _0x5035ab={'where':_0x207c59[_0x4117('0x47')]};return db[_0x4117('0x4b')][_0x4117('0x4c')](_0x5035ab)[_0x4117('0x21')](function(_0x3f12db){_0x35d25d[_0x4117('0x4c')]=_0x3f12db;if(_0xdc20a1[_0x4117('0x3d')][_0x4117('0x4d')]){_0x207c59[_0x4117('0x4e')]=[{'all':!![]}];}return db[_0x4117('0x4b')][_0x4117('0x4f')](_0x207c59);})[_0x4117('0x21')](function(_0x27bebc){_0x35d25d[_0x4117('0x50')]=_0x27bebc;return _0x35d25d;})[_0x4117('0x21')](respondWithFilteredResult(_0xc22f07,_0x207c59))['catch'](handleError(_0xc22f07,null));};exports[_0x4117('0x51')]=function(_0x2b309d,_0x38ff3e){var _0x2912df={'raw':!![],'where':{'id':_0x2b309d[_0x4117('0x52')]['id']}},_0x5c8968={};_0x5c8968['model']=_[_0x4117('0x3c')](db[_0x4117('0x4b')][_0x4117('0x38')]);_0x5c8968[_0x4117('0x3d')]=_[_0x4117('0x3c')](_0x2b309d[_0x4117('0x3d')]);_0x5c8968[_0x4117('0x3e')]=_[_0x4117('0x3f')](_0x5c8968[_0x4117('0x3b')],_0x5c8968['query']);_0x2912df[_0x4117('0x40')]=_[_0x4117('0x3f')](_0x5c8968[_0x4117('0x3b')],qs[_0x4117('0x41')](_0x2b309d[_0x4117('0x3d')]['fields']));_0x2912df[_0x4117('0x40')]=_0x2912df[_0x4117('0x40')][_0x4117('0x42')]?_0x2912df[_0x4117('0x40')]:_0x5c8968[_0x4117('0x3b')];if(_0x2b309d['query']['includeAll']){_0x2912df[_0x4117('0x4e')]=[{'all':!![]}];}_0x2912df=_[_0x4117('0x4a')]({},_0x2912df,_0x2b309d[_0x4117('0x53')]);return db[_0x4117('0x4b')][_0x4117('0x54')](_0x2912df)[_0x4117('0x21')](handleEntityNotFound(_0x38ff3e,null))[_0x4117('0x21')](respondWithResult(_0x38ff3e,null))[_0x4117('0x55')](handleError(_0x38ff3e,null));};exports['create']=function(_0x95c5d7,_0x4ddb06){return db['OpenchannelMessage'][_0x4117('0x56')](_0x95c5d7['body'],{})['then'](respondWithResult(_0x4ddb06,0xc9))[_0x4117('0x55')](handleError(_0x4ddb06,null));};exports[_0x4117('0x32')]=function(_0x251cd2,_0x37aa38){if(_0x251cd2[_0x4117('0x57')]['id']){delete _0x251cd2[_0x4117('0x57')]['id'];}return db[_0x4117('0x4b')]['find']({'where':{'id':_0x251cd2[_0x4117('0x52')]['id']}})[_0x4117('0x21')](handleEntityNotFound(_0x37aa38,null))[_0x4117('0x21')](saveUpdates(_0x251cd2[_0x4117('0x57')],null))[_0x4117('0x21')](respondWithResult(_0x37aa38,null))[_0x4117('0x55')](handleError(_0x37aa38,null));};exports['destroy']=function(_0x27b0d8,_0x2cd560){return db[_0x4117('0x4b')][_0x4117('0x54')]({'where':{'id':_0x27b0d8[_0x4117('0x52')]['id']}})[_0x4117('0x21')](handleEntityNotFound(_0x2cd560,null))[_0x4117('0x21')](removeEntity(_0x2cd560,null))[_0x4117('0x55')](handleError(_0x2cd560,null));};exports['describe']=function(_0x2824ec,_0x46a89a){return db[_0x4117('0x4b')][_0x4117('0x58')]()['then'](respondWithResult(_0x46a89a,null))[_0x4117('0x55')](handleError(_0x46a89a,null));};var interaction_log=require(_0x4117('0x14'))('openchannel-interactions');exports[_0x4117('0x59')]=function(_0x54dd21,_0x2ff304,_0x2f2413){var _0x603db0={'agent':{},'channel':'openchannel'};if(_0x54dd21['body']['id']){delete _0x54dd21['body']['id'];}_0x54dd21['body'][_0x4117('0x5a')]=!![];_0x54dd21[_0x4117('0x57')]['readAt']=moment()['format'](_0x4117('0x5b'));_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')]=_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')]||_0x54dd21[_0x4117('0x5d')]['id'];_0x603db0['agent']['id']=_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')];return db['OpenchannelMessage'][_0x4117('0x54')]({'where':{'id':_0x54dd21['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ff304,null))[_0x4117('0x21')](saveUpdates(_0x54dd21[_0x4117('0x57')],null))['then'](function(_0x294391){if(_0x294391){_0x603db0['message']=_0x294391[_0x4117('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x4117('0x54')]({'where':{'id':_0x294391[_0x4117('0x5f')]}});}return null;})[_0x4117('0x21')](handleEntityNotFound(_0x2ff304,null))[_0x4117('0x21')](function(_0x4ee469){if(_0x4ee469){return _0x4ee469['update']({'UserId':_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')],'read1stAt':_['isNil'](_0x4ee469['read1stAt'])?moment()[_0x4117('0x60')](_0x4117('0x5b')):undefined});}return null;})[_0x4117('0x21')](function(_0x4024a0){if(_0x4024a0){_0x603db0['interaction']=_0x4024a0[_0x4117('0x5e')]({'plain':!![]});interaction_log[_0x4117('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54dd21[_0x4117('0x5d')]['id'],_0x54dd21[_0x4117('0x5d')]['name'],_0x54dd21[_0x4117('0x5d')][_0x4117('0x61')],_0x603db0['interaction']['id'],_0x54dd21[_0x4117('0x57')]?JSON[_0x4117('0x26')](_0x54dd21[_0x4117('0x57')]):_0x4117('0x62'));return respondWithRpcPromise(_0x4117('0x63'),'acceptMessage',_0x603db0);}return null;})[_0x4117('0x21')](function(_0x34ac49){var _0x273920='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34ac49['message']['ContactId'];return db['sequelize'][_0x4117('0x3d')](_0x273920,{'type':db['Sequelize'][_0x4117('0x64')][_0x4117('0x65')],'raw':!![]})[_0x4117('0x21')](function(_0x54f008){return _0x54f008;});})['then'](function(_0x1e02ba){if(_0x1e02ba){_0x603db0[_0x4117('0x28')][_0x4117('0x66')]=_0x1e02ba[0x0];if(!_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')])return;return db['User'][_0x4117('0x54')]({'where':{'id':_0x54dd21[_0x4117('0x57')][_0x4117('0x5c')],'role':'agent'},'attributes':['id','name','fullname',_0x4117('0x67'),_0x4117('0x68')],'raw':!![]});}return null;})[_0x4117('0x21')](function(_0x5ee9d0){if(!_0x5ee9d0)return null;_0x603db0['message'][_0x4117('0x69')]=_0x5ee9d0;return _0x603db0;})[_0x4117('0x21')](function(_0x3a161f){if(_0x3a161f){if(_0x54dd21['body'][_0x4117('0x6a')]){_0x603db0['message'][_0x4117('0x6b')]=util[_0x4117('0x60')](_0x4117('0x6c'),_0x54dd21[_0x4117('0x5d')][_0x4117('0x34')]);_0x603db0[_0x4117('0x28')][_0x4117('0x6d')]=_0x603db0[_0x4117('0x6d')];_0x603db0[_0x4117('0x28')][_0x4117('0x6e')]=_0x603db0['channel'];_0x603db0['message'][_0x4117('0x6f')]=_0x4117('0x59');return respondWithRpcPromise(_0x4117('0x70'),_0x4117('0x70'),{'event':_0x4117('0x71'),'message':_0x603db0[_0x4117('0x28')]},client9002)[_0x4117('0x21')](function(){return _0x603db0;});}return _0x603db0;}return null;})[_0x4117('0x21')](respondWithResult(_0x2ff304,null))[_0x4117('0x55')](handleError(_0x2ff304,null));};var interaction_log=require(_0x4117('0x14'))(_0x4117('0x72'));exports[_0x4117('0x30')]=function(_0x52d04c,_0x466645,_0x207b19){var _0x28f6c6={'agent':{},'channel':'openchannel'};if(_0x52d04c['body']['id']){delete _0x52d04c['body']['id'];}_0x52d04c[_0x4117('0x57')][_0x4117('0x5c')]=_0x52d04c[_0x4117('0x57')][_0x4117('0x5c')]||_0x52d04c['user']['id'];_0x28f6c6[_0x4117('0x69')]['id']=_0x52d04c[_0x4117('0x57')]['UserId'];return db[_0x4117('0x4b')][_0x4117('0x54')]({'where':{'id':_0x52d04c[_0x4117('0x52')]['id'],'UserId':null}})[_0x4117('0x21')](handleEntityNotFound(_0x466645,null))['then'](function(_0xe62493){if(_0xe62493){_0x28f6c6['message']=_0xe62493['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xe62493[_0x4117('0x5f')]}});}return null;})[_0x4117('0x21')](handleEntityNotFound(_0x466645,null))[_0x4117('0x21')](function(_0x4a5778){if(_0x4a5778){_0x28f6c6['interaction']=_0x4a5778[_0x4117('0x5e')]({'plain':!![]});interaction_log['info'](_0x4117('0x73'),_0x52d04c[_0x4117('0x5d')]['id'],_0x52d04c[_0x4117('0x5d')][_0x4117('0x34')],_0x52d04c[_0x4117('0x5d')][_0x4117('0x61')],_0x28f6c6[_0x4117('0x74')]['id'],_0x52d04c[_0x4117('0x57')]?JSON[_0x4117('0x26')](_0x52d04c[_0x4117('0x57')]):_0x4117('0x62'));return respondWithRpcPromise(_0x4117('0x75'),'rejectMessage',_0x28f6c6);}return null;})[_0x4117('0x21')](function(_0x5b1a83){var _0x3c63d8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b1a83[_0x4117('0x28')]['ContactId'];return db[_0x4117('0x76')][_0x4117('0x3d')](_0x3c63d8,{'type':db[_0x4117('0x77')]['QueryTypes'][_0x4117('0x65')],'raw':!![]})[_0x4117('0x21')](function(_0x578c08){return _0x578c08;});})[_0x4117('0x21')](function(_0x1993d9){if(_0x1993d9){_0x28f6c6['message']['contact']=_0x1993d9[0x0];if(!_0x52d04c[_0x4117('0x57')][_0x4117('0x5c')])return;return db[_0x4117('0x78')][_0x4117('0x54')]({'where':{'id':_0x52d04c[_0x4117('0x57')][_0x4117('0x5c')],'role':_0x4117('0x69')},'attributes':['id','name',_0x4117('0x79'),_0x4117('0x67'),'internal'],'raw':!![]});}return null;})[_0x4117('0x21')](function(_0x5ea09a){if(!_0x5ea09a)return null;_0x28f6c6[_0x4117('0x28')][_0x4117('0x69')]=_0x5ea09a;return _0x28f6c6;})[_0x4117('0x21')](function(_0x2d44be){if(_0x2d44be){_0x2d44be['message'][_0x4117('0x6b')]=util[_0x4117('0x60')](_0x4117('0x6c'),_0x52d04c[_0x4117('0x5d')]['name']);_0x2d44be[_0x4117('0x28')][_0x4117('0x6d')]=_0x28f6c6[_0x4117('0x6d')];_0x2d44be[_0x4117('0x28')][_0x4117('0x6e')]=_0x28f6c6[_0x4117('0x6d')];_0x2d44be['message']['event']=_0x4117('0x30');respondWithRpcPromise(_0x4117('0x70'),_0x4117('0x70'),{'event':_0x4117('0x7a'),'message':_0x2d44be['message']},client9002);return _0x28f6c6;}return null;})[_0x4117('0x21')](respondWithResult(_0x466645,null))[_0x4117('0x55')](handleError(_0x466645,null));}; \ No newline at end of file +var _0x95bb=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','rows','show','params','length','merge','find','body','describe','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x48ec91,_0x212edc){var _0x22766c=function(_0x136751){while(--_0x136751){_0x48ec91['push'](_0x48ec91['shift']());}};_0x22766c(++_0x212edc);}(_0x95bb,0xed));var _0xb95b=function(_0x153e72,_0x22bed5){_0x153e72=_0x153e72-0x0;var _0x2fd233=_0x95bb[_0x153e72];return _0x2fd233;};'use strict';var emlformat=require(_0xb95b('0x0'));var rimraf=require(_0xb95b('0x1'));var zipdir=require(_0xb95b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb95b('0x3'));var moment=require(_0xb95b('0x4'));var BPromise=require(_0xb95b('0x5'));var Mustache=require(_0xb95b('0x6'));var util=require('util');var path=require(_0xb95b('0x7'));var sox=require(_0xb95b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95b('0x9'));var _=require(_0xb95b('0xa'));var squel=require(_0xb95b('0xb'));var crypto=require(_0xb95b('0xc'));var jsforce=require(_0xb95b('0xd'));var deskjs=require(_0xb95b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb95b('0xf'));var Papa=require(_0xb95b('0x10'));var Redis=require('ioredis');var authService=require(_0xb95b('0x11'));var qs=require(_0xb95b('0x12'));var as=require(_0xb95b('0x13'));var hardwareService=require(_0xb95b('0x14'));var logger=require(_0xb95b('0x15'))('api');var utils=require(_0xb95b('0x16'));var config=require(_0xb95b('0x17'));var licenseUtil=require(_0xb95b('0x18'));var db=require(_0xb95b('0x19'))['db'];config['redis']=_[_0xb95b('0x1a')](config['redis'],{'host':_0xb95b('0x1b'),'port':0x18eb});var socket=require(_0xb95b('0x1c'))(new Redis(config[_0xb95b('0x1d')]));require(_0xb95b('0x1e'))[_0xb95b('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb95b('0x20')][_0xb95b('0x21')]({'port':0x232c});var client9002=jayson[_0xb95b('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x142f23,_0x5254da,_0x5d56ec,_0xa009a8){return new BPromise(function(_0x2b3fee,_0x1103e4){var _0xa7ff6=_0xa009a8||client;return _0xa7ff6['request'](_0x142f23,_0x5d56ec)[_0xb95b('0x22')](function(_0x58c3ee){logger[_0xb95b('0x23')](_0xb95b('0x24'),_0x5254da,'request\x20sent');logger[_0xb95b('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5254da,_0xb95b('0x26'),JSON['stringify'](_0x58c3ee));if(_0x58c3ee[_0xb95b('0x27')]){if(_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x28')]===0x1f4){logger[_0xb95b('0x27')](_0xb95b('0x24'),_0x5254da,_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);return _0x1103e4(_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);}logger['error'](_0xb95b('0x24'),_0x5254da,_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);return _0x2b3fee(_0x58c3ee[_0xb95b('0x27')]['message']);}else{logger[_0xb95b('0x23')](_0xb95b('0x24'),_0x5254da,_0xb95b('0x26'));_0x2b3fee(_0x58c3ee[_0xb95b('0x2a')][_0xb95b('0x29')]);}})[_0xb95b('0x2b')](function(_0x329318){logger[_0xb95b('0x27')](_0xb95b('0x24'),_0x5254da,_0x329318);_0x1103e4(_0x329318);});});}function respondWithStatusCode(_0x503338,_0x38b5b4){_0x38b5b4=_0x38b5b4||0xcc;return function(_0x4d14f0){if(_0x4d14f0){return _0x503338['sendStatus'](_0x38b5b4);}return _0x503338[_0xb95b('0x2c')](_0x38b5b4)['end']();};}function respondWithResult(_0x391435,_0x3cc327){_0x3cc327=_0x3cc327||0xc8;return function(_0x4380bb){if(_0x4380bb){return _0x391435[_0xb95b('0x2c')](_0x3cc327)[_0xb95b('0x2d')](_0x4380bb);}};}function respondWithFilteredResult(_0x4bc66c,_0x1ce409){return function(_0xa0ec19){if(_0xa0ec19){var _0x9b9159=typeof _0x1ce409['offset']===_0xb95b('0x2e')&&typeof _0x1ce409[_0xb95b('0x2f')]===_0xb95b('0x2e');var _0x854b73=_0xa0ec19['count'];var _0x45f41a=_0x9b9159?0x0:_0x1ce409['offset'];var _0x2b4d22=_0x9b9159?_0xa0ec19[_0xb95b('0x30')]:_0x1ce409[_0xb95b('0x31')]+_0x1ce409[_0xb95b('0x2f')];var _0x46c519;if(_0x2b4d22>=_0x854b73){_0x2b4d22=_0x854b73;_0x46c519=0xc8;}else{_0x46c519=0xce;}_0x4bc66c[_0xb95b('0x2c')](_0x46c519);return _0x4bc66c[_0xb95b('0x32')](_0xb95b('0x33'),_0x45f41a+'-'+_0x2b4d22+'/'+_0x854b73)[_0xb95b('0x2d')](_0xa0ec19);}return null;};}function patchUpdates(_0x3c4ac7){return function(_0x3d4aa4){try{jsonpatch[_0xb95b('0x34')](_0x3d4aa4,_0x3c4ac7,!![]);}catch(_0x3e7825){return BPromise[_0xb95b('0x35')](_0x3e7825);}return _0x3d4aa4[_0xb95b('0x36')]();};}function saveUpdates(_0x180929,_0x18ddaf){return function(_0x83ac2b){if(_0x83ac2b){return _0x83ac2b[_0xb95b('0x37')](_0x180929)[_0xb95b('0x22')](function(_0x3d7807){return _0x3d7807;});}return null;};}function removeEntity(_0x1ab692,_0x2ea0d6){return function(_0x373bf){if(_0x373bf){return _0x373bf[_0xb95b('0x38')]()[_0xb95b('0x22')](function(){_0x1ab692[_0xb95b('0x2c')](0xcc)[_0xb95b('0x39')]();});}};}function handleEntityNotFound(_0x1aca83,_0x16f882){return function(_0x30521c){if(!_0x30521c){_0x1aca83['sendStatus'](0x194);}return _0x30521c;};}function handleError(_0x3ece8d,_0x46becc){_0x46becc=_0x46becc||0x1f4;return function(_0x39bc6f){logger[_0xb95b('0x27')](_0x39bc6f[_0xb95b('0x3a')]);if(_0x39bc6f[_0xb95b('0x3b')]){delete _0x39bc6f[_0xb95b('0x3b')];}_0x3ece8d[_0xb95b('0x2c')](_0x46becc)[_0xb95b('0x3c')](_0x39bc6f);};}exports['index']=function(_0x228c90,_0x705da7){var _0x4e8bde={},_0x14f10b={},_0x3f43d3={'count':0x0,'rows':[]};var _0x2ea8ea=_[_0xb95b('0x3d')](db[_0xb95b('0x3e')][_0xb95b('0x3f')],function(_0x48a47d){return{'name':_0x48a47d[_0xb95b('0x40')],'type':_0x48a47d['type'][_0xb95b('0x41')]};});_0x14f10b['model']=_['map'](_0x2ea8ea,'name');_0x14f10b[_0xb95b('0x42')]=_[_0xb95b('0x43')](_0x228c90[_0xb95b('0x42')]);_0x14f10b['filters']=_[_0xb95b('0x44')](_0x14f10b['model'],_0x14f10b[_0xb95b('0x42')]);_0x4e8bde[_0xb95b('0x45')]=_[_0xb95b('0x44')](_0x14f10b['model'],qs[_0xb95b('0x46')](_0x228c90[_0xb95b('0x42')][_0xb95b('0x46')]));_0x4e8bde[_0xb95b('0x45')]=_0x4e8bde[_0xb95b('0x45')]['length']?_0x4e8bde[_0xb95b('0x45')]:_0x14f10b[_0xb95b('0x47')];if(!_0x228c90['query'][_0xb95b('0x48')](_0xb95b('0x49'))){_0x4e8bde['limit']=qs[_0xb95b('0x2f')](_0x228c90[_0xb95b('0x42')][_0xb95b('0x2f')]);_0x4e8bde['offset']=qs['offset'](_0x228c90['query'][_0xb95b('0x31')]);}_0x4e8bde[_0xb95b('0x4a')]=qs['sort'](_0x228c90[_0xb95b('0x42')][_0xb95b('0x4b')]);_0x4e8bde['where']=qs[_0xb95b('0x4c')](_[_0xb95b('0x4d')](_0x228c90[_0xb95b('0x42')],_0x14f10b['filters']),_0x2ea8ea);if(_0x228c90['query'][_0xb95b('0x4e')]){_0x4e8bde[_0xb95b('0x4f')]=_['merge'](_0x4e8bde[_0xb95b('0x4f')],{'$or':_[_0xb95b('0x3d')](_0x2ea8ea,function(_0x5ebdc1){if(_0x5ebdc1[_0xb95b('0x50')]!==_0xb95b('0x51')){var _0x675165={};_0x675165[_0x5ebdc1[_0xb95b('0x3b')]]={'$like':'%'+_0x228c90[_0xb95b('0x42')][_0xb95b('0x4e')]+'%'};return _0x675165;}})});}_0x4e8bde=_['merge']({},_0x4e8bde,_0x228c90[_0xb95b('0x52')]);var _0xda6a01={'where':_0x4e8bde[_0xb95b('0x4f')]};return db[_0xb95b('0x3e')][_0xb95b('0x30')](_0xda6a01)[_0xb95b('0x22')](function(_0x4661cd){_0x3f43d3[_0xb95b('0x30')]=_0x4661cd;if(_0x228c90['query'][_0xb95b('0x53')]){_0x4e8bde[_0xb95b('0x54')]=[{'all':!![]}];}return db[_0xb95b('0x3e')]['findAll'](_0x4e8bde);})['then'](function(_0x37e8e6){_0x3f43d3[_0xb95b('0x55')]=_0x37e8e6;return _0x3f43d3;})['then'](respondWithFilteredResult(_0x705da7,_0x4e8bde))['catch'](handleError(_0x705da7,null));};exports[_0xb95b('0x56')]=function(_0x487f16,_0x26708b){var _0x723a00={'raw':!![],'where':{'id':_0x487f16[_0xb95b('0x57')]['id']}},_0x11e92e={};_0x11e92e['model']=_[_0xb95b('0x43')](db[_0xb95b('0x3e')][_0xb95b('0x3f')]);_0x11e92e['query']=_[_0xb95b('0x43')](_0x487f16[_0xb95b('0x42')]);_0x11e92e['filters']=_[_0xb95b('0x44')](_0x11e92e[_0xb95b('0x47')],_0x11e92e[_0xb95b('0x42')]);_0x723a00[_0xb95b('0x45')]=_[_0xb95b('0x44')](_0x11e92e['model'],qs[_0xb95b('0x46')](_0x487f16[_0xb95b('0x42')][_0xb95b('0x46')]));_0x723a00['attributes']=_0x723a00[_0xb95b('0x45')][_0xb95b('0x58')]?_0x723a00[_0xb95b('0x45')]:_0x11e92e[_0xb95b('0x47')];if(_0x487f16[_0xb95b('0x42')][_0xb95b('0x53')]){_0x723a00['include']=[{'all':!![]}];}_0x723a00=_[_0xb95b('0x59')]({},_0x723a00,_0x487f16['options']);return db[_0xb95b('0x3e')][_0xb95b('0x5a')](_0x723a00)[_0xb95b('0x22')](handleEntityNotFound(_0x26708b,null))[_0xb95b('0x22')](respondWithResult(_0x26708b,null))[_0xb95b('0x2b')](handleError(_0x26708b,null));};exports['create']=function(_0x15ca15,_0x11a082){return db[_0xb95b('0x3e')]['create'](_0x15ca15[_0xb95b('0x5b')],{})['then'](respondWithResult(_0x11a082,0xc9))[_0xb95b('0x2b')](handleError(_0x11a082,null));};exports[_0xb95b('0x37')]=function(_0x3d48ce,_0x289d6b){if(_0x3d48ce[_0xb95b('0x5b')]['id']){delete _0x3d48ce[_0xb95b('0x5b')]['id'];}return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x3d48ce['params']['id']}})[_0xb95b('0x22')](handleEntityNotFound(_0x289d6b,null))[_0xb95b('0x22')](saveUpdates(_0x3d48ce[_0xb95b('0x5b')],null))['then'](respondWithResult(_0x289d6b,null))[_0xb95b('0x2b')](handleError(_0x289d6b,null));};exports[_0xb95b('0x38')]=function(_0x3fd68a,_0x5ef228){return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x3fd68a[_0xb95b('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ef228,null))[_0xb95b('0x22')](removeEntity(_0x5ef228,null))['catch'](handleError(_0x5ef228,null));};exports[_0xb95b('0x5c')]=function(_0x278cff,_0x3ec880){return db[_0xb95b('0x3e')][_0xb95b('0x5c')]()[_0xb95b('0x22')](respondWithResult(_0x3ec880,null))[_0xb95b('0x2b')](handleError(_0x3ec880,null));};var interaction_log=require(_0xb95b('0x15'))('openchannel-interactions');exports[_0xb95b('0x5d')]=function(_0x349fde,_0x21d5a9,_0xccfd0b){var _0xf7f663={'agent':{},'channel':_0xb95b('0x5e')};if(_0x349fde[_0xb95b('0x5b')]['id']){delete _0x349fde[_0xb95b('0x5b')]['id'];}_0x349fde[_0xb95b('0x5b')]['read']=!![];_0x349fde[_0xb95b('0x5b')][_0xb95b('0x5f')]=moment()[_0xb95b('0x60')](_0xb95b('0x61'));_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')]=_0x349fde['body'][_0xb95b('0x62')]||_0x349fde[_0xb95b('0x63')]['id'];_0xf7f663[_0xb95b('0x64')]['id']=_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x349fde[_0xb95b('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21d5a9,null))['then'](saveUpdates(_0x349fde['body'],null))['then'](function(_0x38ab19){if(_0x38ab19){_0xf7f663['message']=_0x38ab19[_0xb95b('0x65')]({'plain':!![]});return db[_0xb95b('0x66')][_0xb95b('0x5a')]({'where':{'id':_0x38ab19[_0xb95b('0x67')]}});}return null;})[_0xb95b('0x22')](handleEntityNotFound(_0x21d5a9,null))[_0xb95b('0x22')](function(_0x4d14a9){if(_0x4d14a9){return _0x4d14a9['update']({'UserId':_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')],'read1stAt':_[_0xb95b('0x68')](_0x4d14a9[_0xb95b('0x69')])?moment()[_0xb95b('0x60')](_0xb95b('0x61')):undefined});}return null;})['then'](function(_0x46bbfe){if(_0x46bbfe){_0xf7f663[_0xb95b('0x6a')]=_0x46bbfe['get']({'plain':!![]});interaction_log[_0xb95b('0x23')](_0xb95b('0x6b'),_0x349fde[_0xb95b('0x63')]['id'],_0x349fde[_0xb95b('0x63')][_0xb95b('0x3b')],_0x349fde[_0xb95b('0x63')][_0xb95b('0x6c')],_0xf7f663[_0xb95b('0x6a')]['id'],_0x349fde[_0xb95b('0x5b')]?JSON['stringify'](_0x349fde[_0xb95b('0x5b')]):_0xb95b('0x6d'));return respondWithRpcPromise(_0xb95b('0x6e'),'acceptMessage',_0xf7f663);}return null;})[_0xb95b('0x22')](function(_0x4d902a){var _0x5a9c2a=_0xb95b('0x6f')+_0x4d902a[_0xb95b('0x29')][_0xb95b('0x70')];return db['sequelize'][_0xb95b('0x42')](_0x5a9c2a,{'type':db[_0xb95b('0x71')]['QueryTypes'][_0xb95b('0x72')],'raw':!![]})[_0xb95b('0x22')](function(_0x41479b){return _0x41479b;});})[_0xb95b('0x22')](function(_0x335e4f){if(_0x335e4f){_0xf7f663[_0xb95b('0x29')][_0xb95b('0x73')]=_0x335e4f[0x0];if(!_0x349fde[_0xb95b('0x5b')]['UserId'])return;return db['User'][_0xb95b('0x5a')]({'where':{'id':_0x349fde['body'][_0xb95b('0x62')],'role':_0xb95b('0x64')},'attributes':['id',_0xb95b('0x3b'),_0xb95b('0x74'),'email',_0xb95b('0x75')],'raw':!![]});}return null;})[_0xb95b('0x22')](function(_0x428897){if(!_0x428897)return null;_0xf7f663[_0xb95b('0x29')]['agent']=_0x428897;return _0xf7f663;})[_0xb95b('0x22')](function(_0x28542e){if(_0x28542e){if(_0x349fde[_0xb95b('0x5b')][_0xb95b('0x76')]){_0xf7f663[_0xb95b('0x29')][_0xb95b('0x77')]=util[_0xb95b('0x60')](_0xb95b('0x78'),_0x349fde['user'][_0xb95b('0x3b')]);_0xf7f663['message'][_0xb95b('0x79')]=_0xf7f663[_0xb95b('0x79')];_0xf7f663[_0xb95b('0x29')]['motionChannel']=_0xf7f663['channel'];_0xf7f663[_0xb95b('0x29')][_0xb95b('0x7a')]='accept';return respondWithRpcPromise(_0xb95b('0x7b'),_0xb95b('0x7b'),{'event':_0xb95b('0x7c'),'message':_0xf7f663[_0xb95b('0x29')]},client9002)['then'](function(){return _0xf7f663;});}return _0xf7f663;}return null;})[_0xb95b('0x22')](respondWithResult(_0x21d5a9,null))[_0xb95b('0x2b')](handleError(_0x21d5a9,null));};var interaction_log=require(_0xb95b('0x15'))('openchannel-interactions');exports['reject']=function(_0x414536,_0x1b7e0e,_0x23871b){var _0x3c7e34={'agent':{},'channel':_0xb95b('0x5e')};if(_0x414536['body']['id']){delete _0x414536[_0xb95b('0x5b')]['id'];}_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')]=_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')]||_0x414536[_0xb95b('0x63')]['id'];_0x3c7e34[_0xb95b('0x64')]['id']=_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')];return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x414536[_0xb95b('0x57')]['id'],'UserId':null}})[_0xb95b('0x22')](handleEntityNotFound(_0x1b7e0e,null))['then'](function(_0x55ecf7){if(_0x55ecf7){_0x3c7e34['message']=_0x55ecf7[_0xb95b('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb95b('0x5a')]({'where':{'id':_0x55ecf7[_0xb95b('0x67')]}});}return null;})[_0xb95b('0x22')](handleEntityNotFound(_0x1b7e0e,null))['then'](function(_0x2d9052){if(_0x2d9052){_0x3c7e34[_0xb95b('0x6a')]=_0x2d9052[_0xb95b('0x65')]({'plain':!![]});interaction_log[_0xb95b('0x23')](_0xb95b('0x7d'),_0x414536[_0xb95b('0x63')]['id'],_0x414536[_0xb95b('0x63')][_0xb95b('0x3b')],_0x414536[_0xb95b('0x63')][_0xb95b('0x6c')],_0x3c7e34[_0xb95b('0x6a')]['id'],_0x414536['body']?JSON[_0xb95b('0x7e')](_0x414536[_0xb95b('0x5b')]):_0xb95b('0x6d'));return respondWithRpcPromise('RejectMessage',_0xb95b('0x7f'),_0x3c7e34);}return null;})['then'](function(_0x454f45){var _0x25e07e=_0xb95b('0x6f')+_0x454f45[_0xb95b('0x29')]['ContactId'];return db['sequelize']['query'](_0x25e07e,{'type':db[_0xb95b('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb95b('0x22')](function(_0x2a50fb){return _0x2a50fb;});})[_0xb95b('0x22')](function(_0x25a825){if(_0x25a825){_0x3c7e34[_0xb95b('0x29')]['contact']=_0x25a825[0x0];if(!_0x414536['body'][_0xb95b('0x62')])return;return db[_0xb95b('0x80')][_0xb95b('0x5a')]({'where':{'id':_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')],'role':_0xb95b('0x64')},'attributes':['id',_0xb95b('0x3b'),_0xb95b('0x74'),'email',_0xb95b('0x75')],'raw':!![]});}return null;})['then'](function(_0x1ebdc7){if(!_0x1ebdc7)return null;_0x3c7e34[_0xb95b('0x29')]['agent']=_0x1ebdc7;return _0x3c7e34;})[_0xb95b('0x22')](function(_0xb8a60d){if(_0xb8a60d){_0xb8a60d[_0xb95b('0x29')]['interface']=util[_0xb95b('0x60')](_0xb95b('0x78'),_0x414536[_0xb95b('0x63')][_0xb95b('0x3b')]);_0xb8a60d['message'][_0xb95b('0x79')]=_0x3c7e34[_0xb95b('0x79')];_0xb8a60d[_0xb95b('0x29')][_0xb95b('0x81')]=_0x3c7e34[_0xb95b('0x79')];_0xb8a60d[_0xb95b('0x29')][_0xb95b('0x7a')]=_0xb95b('0x35');respondWithRpcPromise(_0xb95b('0x7b'),_0xb95b('0x7b'),{'event':_0xb95b('0x82'),'message':_0xb8a60d[_0xb95b('0x29')]},client9002);return _0x3c7e34;}return null;})[_0xb95b('0x22')](respondWithResult(_0x1b7e0e,null))[_0xb95b('0x2b')](handleError(_0x1b7e0e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 84951cf..01999b1 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 _0x6f78=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3734da,_0x463cf2){var _0x1944c8=function(_0x14322e){while(--_0x14322e){_0x3734da['push'](_0x3734da['shift']());}};_0x1944c8(++_0x463cf2);}(_0x6f78,0x158));var _0x86f7=function(_0x359cbf,_0x16f257){_0x359cbf=_0x359cbf-0x0;var _0x16f2be=_0x6f78[_0x359cbf];return _0x16f2be;};'use strict';var EventEmitter=require(_0x86f7('0x0'));var OpenchannelMessage=require(_0x86f7('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x86f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x86f7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x62ca30){return function(_0x31cf76,_0x54a71c,_0x14b63a){OpenchannelMessageEvents[_0x86f7('0x4')](_0x62ca30+':'+_0x31cf76['id'],_0x31cf76);OpenchannelMessageEvents[_0x86f7('0x4')](_0x62ca30,_0x31cf76);_0x14b63a(null);};}for(var e in events){if(events[_0x86f7('0x5')](e)){var event=events[e];OpenchannelMessage[_0x86f7('0x6')](e,emitEvent(event));}}module[_0x86f7('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe3aa=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xe3aa,0x9f));var _0xae3a=function(_0x171e51,_0x2c4d43){_0x171e51=_0x171e51-0x0;var _0x27b1ea=_0xe3aa[_0x171e51];return _0x27b1ea;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xae3a('0x0'))['db'][_0xae3a('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xae3a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae3a('0x3'),'afterDestroy':_0xae3a('0x4')};function emitEvent(_0x4b97a){return function(_0x5d5e2b,_0x5939d2,_0x2a6566){OpenchannelMessageEvents[_0xae3a('0x5')](_0x4b97a+':'+_0x5d5e2b['id'],_0x5d5e2b);OpenchannelMessageEvents[_0xae3a('0x5')](_0x4b97a,_0x5d5e2b);_0x2a6566(null);};}for(var e in events){if(events[_0xae3a('0x6')](e)){var event=events[e];OpenchannelMessage[_0xae3a('0x7')](e,emitEvent(event));}}module[_0xae3a('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 6163bd9..00741bf 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 _0xb403=['keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','method','GET','POST','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb403,0x10b));var _0x3b40=function(_0x4b634f,_0x4c0372){_0x4b634f=_0x4b634f-0x0;var _0x302e3c=_0xb403[_0x4b634f];return _0x302e3c;};'use strict';var _=require(_0x3b40('0x0'));var util=require('util');var logger=require(_0x3b40('0x1'))(_0x3b40('0x2'));var moment=require('moment');var BPromise=require(_0x3b40('0x3'));var rp=require(_0x3b40('0x4'));var fs=require('fs');var path=require(_0x3b40('0x5'));var rimraf=require(_0x3b40('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x88bce0,_0x17bbc7){return _0x88bce0['define'](_0x3b40('0x7'),attributes,{'tableName':_0x3b40('0x8'),'paranoid':![],'indexes':[{'name':_0x3b40('0x9'),'fields':[_0x3b40('0xa')],'type':_0x3b40('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48f36a,_0x32bdc4,_0x55ef42){var _0x12da84=_0x88bce0[_0x3b40('0xc')];var _0x453006=_0x48f36a[_0x3b40('0xd')]({'plain':!![]});if(_0x453006[_0x3b40('0xe')]['toLowerCase']()==='in'||_0x453006[_0x3b40('0xe')][_0x3b40('0xf')]()===_0x3b40('0x10')&&!_0x453006[_0x3b40('0x11')]&&!_[_0x3b40('0x12')](_0x453006['UserId'])){_0x12da84[_0x3b40('0x13')][_0x3b40('0x14')]({'where':{'id':_0x453006[_0x3b40('0x15')]}})[_0x3b40('0x16')](function(_0xe8114a){if(_0xe8114a){_0xe8114a[_0x3b40('0x17')]({'lastMsgAt':_0x453006[_0x3b40('0x18')],'lastMsgDirection':_0x453006[_0x3b40('0xe')]['toLowerCase']()});}})[_0x3b40('0x19')](function(_0x3ca79c){console[_0x3b40('0x1a')](_0x3ca79c);});}if(_0x453006[_0x3b40('0xe')]===_0x3b40('0x10')&&!_0x453006[_0x3b40('0x11')]){var _0xb5019d;_0x12da84[_0x3b40('0x1b')][_0x3b40('0x1c')]()['then'](function(_0xb3124e){return _0x12da84[_0x3b40('0x1d')]['find']({'where':{'id':_0x453006[_0x3b40('0x1e')]},'include':[{'model':_0x12da84[_0x3b40('0x13')],'as':_0x3b40('0x1f'),'where':{'id':_0x453006[_0x3b40('0x15')]},'limit':0x1,'include':[{'model':_0x12da84['CmContact'],'as':_0x3b40('0x20'),'attributes':_[_0x3b40('0x21')](_0xb3124e)}]}]});})['then'](function(_0x24bf57){_0xb5019d=_0x24bf57['get']({'plain':!![]});if(_0xb5019d&&_0xb5019d[_0x3b40('0x22')]){logger[_0x3b40('0x23')](_0x3b40('0x24'),_0x3b40('0x25'),util[_0x3b40('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x453006['id'],_0xb5019d['replyUri']));if(_0xb5019d[_0x3b40('0x1f')]&&_0xb5019d[_0x3b40('0x1f')][_0x3b40('0x27')]){_0x453006[_0x3b40('0x28')]=_[_0x3b40('0x29')](_0xb5019d[_0x3b40('0x1f')][0x0],'Contact');_0x453006['Contact']=_0xb5019d[_0x3b40('0x1f')][0x0]['Contact'];}var _0x32bdc4={'method':'POST','uri':encodeURI(_0xb5019d[_0x3b40('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32bdc4[_0x3b40('0x2a')]){case _0x3b40('0x2b'):_0x32bdc4['qs']=_0x453006;break;case _0x3b40('0x2c'):_0x32bdc4[_0x3b40('0xa')]=_0x453006;break;}return rp(_0x32bdc4)[_0x3b40('0x16')](function(_0x52944b){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3b40('0x25'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x453006['id'],_0xb5019d[_0x3b40('0x22')]));if(_0x52944b[_0x3b40('0xa')][_0x3b40('0x2d')]&&_0x52944b[_0x3b40('0xa')]['threadId']!=_0x453006[_0x3b40('0x28')][_0x3b40('0x2d')]){return _0x12da84[_0x3b40('0x13')][_0x3b40('0x17')]({'threadId':_0x52944b[_0x3b40('0xa')]['threadId']},{'where':{'id':_0x453006[_0x3b40('0x28')]['id']}});}else{return;}})['then'](function(){return _0x48f36a[_0x3b40('0x17')]({'read':!![]});})[_0x3b40('0x19')](function(_0x3c2180){logger['error'](_0x3b40('0x24'),_0x3b40('0x25'),util[_0x3b40('0x2e')](_0x3c2180,{'showHidden':![],'depth':null}));_0x55ef42();});}else{_0x55ef42();}})[_0x3b40('0x2f')](function(){_0x55ef42();});}else{_0x55ef42();}}},'charset':_0x3b40('0x30'),'collate':_0x3b40('0x31')});}; \ No newline at end of file +var _0xd8b8=['OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','Contact','method','GET','POST','body','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','FULLTEXT','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','replyUri','info'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xd8b8,0x1a9));var _0x8d8b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd8b8[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x8d8b('0x0'));var util=require(_0x8d8b('0x1'));var logger=require(_0x8d8b('0x2'))(_0x8d8b('0x3'));var moment=require(_0x8d8b('0x4'));var BPromise=require(_0x8d8b('0x5'));var rp=require(_0x8d8b('0x6'));var fs=require('fs');var path=require(_0x8d8b('0x7'));var rimraf=require('rimraf');var config=require(_0x8d8b('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x8d8b('0x9')]=function(_0x19b73e,_0x4a52ad){return _0x19b73e[_0x8d8b('0xa')](_0x8d8b('0xb'),attributes,{'tableName':_0x8d8b('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x8d8b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b90ad,_0x29581f,_0x191f35){var _0x5d700d=_0x19b73e['models'];var _0x4e8838=_0x2b90ad[_0x8d8b('0xe')]({'plain':!![]});if(_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()==='in'||_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()==='out'&&!_0x4e8838['secret']&&!_[_0x8d8b('0x11')](_0x4e8838[_0x8d8b('0x12')])){_0x5d700d[_0x8d8b('0x13')]['findOne']({'where':{'id':_0x4e8838['OpenchannelInteractionId']}})[_0x8d8b('0x14')](function(_0x5ec8fa){if(_0x5ec8fa){_0x5ec8fa[_0x8d8b('0x15')]({'lastMsgAt':_0x4e8838[_0x8d8b('0x16')],'lastMsgDirection':_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()});}})[_0x8d8b('0x17')](function(_0x3f7851){console[_0x8d8b('0x18')](_0x3f7851);});}if(_0x4e8838[_0x8d8b('0xf')]===_0x8d8b('0x19')&&!_0x4e8838[_0x8d8b('0x1a')]){var _0x14a328;_0x5d700d[_0x8d8b('0x1b')]['describe']()[_0x8d8b('0x14')](function(_0x310b0c){return _0x5d700d[_0x8d8b('0x1c')][_0x8d8b('0x1d')]({'where':{'id':_0x4e8838[_0x8d8b('0x1e')]},'include':[{'model':_0x5d700d[_0x8d8b('0x13')],'as':'Interactions','where':{'id':_0x4e8838[_0x8d8b('0x1f')]},'limit':0x1,'include':[{'model':_0x5d700d[_0x8d8b('0x1b')],'as':'Contact','attributes':_['keys'](_0x310b0c)}]}]});})[_0x8d8b('0x14')](function(_0x51a8e9){_0x14a328=_0x51a8e9[_0x8d8b('0xe')]({'plain':!![]});if(_0x14a328&&_0x14a328[_0x8d8b('0x20')]){logger[_0x8d8b('0x21')](_0x8d8b('0x22'),'afterCreate',util[_0x8d8b('0x23')](_0x8d8b('0x24'),_0x4e8838['id'],_0x14a328[_0x8d8b('0x20')]));if(_0x14a328[_0x8d8b('0x25')]&&_0x14a328['Interactions'][_0x8d8b('0x26')]){_0x4e8838['Interaction']=_[_0x8d8b('0x27')](_0x14a328[_0x8d8b('0x25')][0x0],_0x8d8b('0x28'));_0x4e8838[_0x8d8b('0x28')]=_0x14a328[_0x8d8b('0x25')][0x0][_0x8d8b('0x28')];}var _0x29581f={'method':'POST','uri':encodeURI(_0x14a328[_0x8d8b('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x29581f[_0x8d8b('0x29')]){case _0x8d8b('0x2a'):_0x29581f['qs']=_0x4e8838;break;case _0x8d8b('0x2b'):_0x29581f[_0x8d8b('0x2c')]=_0x4e8838;break;}return rp(_0x29581f)[_0x8d8b('0x14')](function(_0x30f6e0){logger['info'](_0x8d8b('0x22'),_0x8d8b('0x2d'),util['format'](_0x8d8b('0x2e'),_0x4e8838['id'],_0x14a328['replyUri']));if(_0x30f6e0[_0x8d8b('0x2c')][_0x8d8b('0x2f')]&&_0x30f6e0[_0x8d8b('0x2c')]['threadId']!=_0x4e8838[_0x8d8b('0x30')]['threadId']){return _0x5d700d['OpenchannelInteraction'][_0x8d8b('0x15')]({'threadId':_0x30f6e0[_0x8d8b('0x2c')]['threadId']},{'where':{'id':_0x4e8838[_0x8d8b('0x30')]['id']}});}else{return;}})[_0x8d8b('0x14')](function(){return _0x2b90ad[_0x8d8b('0x15')]({'read':!![]});})[_0x8d8b('0x17')](function(_0x57c295){logger[_0x8d8b('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x8d8b('0x2d'),util['inspect'](_0x57c295,{'showHidden':![],'depth':null}));_0x191f35();});}else{_0x191f35();}})[_0x8d8b('0x31')](function(){_0x191f35();});}else{_0x191f35();}}},'charset':'utf8mb4','collate':_0x8d8b('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ca3b9d4..a27ace5 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x11bfc8,_0xc95100){var _0x4ad0bd=function(_0x1b9907){while(--_0x1b9907){_0x11bfc8['push'](_0x11bfc8['shift']());}};_0x4ad0bd(++_0xc95100);}(_0x1261,0x144));var _0x1126=function(_0x4f6afc,_0x4dfa88){_0x4f6afc=_0x4f6afc-0x0;var _0x256eeb=_0x1261[_0x4f6afc];return _0x256eeb;};'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']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','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','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x76e73f,_0x1873ac){var _0x2a56fc=function(_0x46b459){while(--_0x46b459){_0x76e73f['push'](_0x76e73f['shift']());}};_0x2a56fc(++_0x1873ac);}(_0x7a54,0x106));var _0x47a5=function(_0x2aae26,_0x332117){_0x2aae26=_0x2aae26-0x0;var _0x562ec6=_0x7a54[_0x2aae26];return _0x562ec6;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1018b52..8934021 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 _0x9d3e=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x9d3e,0x1c3));var _0xe9d3=function(_0x49af5a,_0xdac72){_0x49af5a=_0x49af5a-0x0;var _0x5e8982=_0x9d3e[_0x49af5a];return _0x5e8982;};'use strict';var OpenchannelMessageEvents=require(_0xe9d3('0x0'));var events=[_0xe9d3('0x1'),_0xe9d3('0x2'),_0xe9d3('0x3')];function createListener(_0x2be465,_0x38c5f4){return function(_0x1ece9c){_0x38c5f4[_0xe9d3('0x4')](_0x2be465,_0x1ece9c);};}function removeListener(_0x4c067e,_0x3be476){return function(){OpenchannelMessageEvents[_0xe9d3('0x5')](_0x4c067e,_0x3be476);};}exports[_0xe9d3('0x6')]=function(_0x11c97b){for(var _0x36b7ba=0x0,_0x2af894=events[_0xe9d3('0x7')];_0x36b7ba<_0x2af894;_0x36b7ba++){var _0x5d44dc=events[_0x36b7ba];var _0x448288=createListener(_0xe9d3('0x8')+_0x5d44dc,_0x11c97b);OpenchannelMessageEvents['on'](_0x5d44dc,_0x448288);}}; \ No newline at end of file +var _0x24ce=['register','openchannelMessage:','save','remove','update','emit','removeListener'];(function(_0x3af0f0,_0x57c1c2){var _0x5104dd=function(_0x35b734){while(--_0x35b734){_0x3af0f0['push'](_0x3af0f0['shift']());}};_0x5104dd(++_0x57c1c2);}(_0x24ce,0x1de));var _0xe24c=function(_0x3d234a,_0x56c809){_0x3d234a=_0x3d234a-0x0;var _0x2ab76a=_0x24ce[_0x3d234a];return _0x2ab76a;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe24c('0x0'),_0xe24c('0x1'),_0xe24c('0x2')];function createListener(_0x1ce128,_0x493bd8){return function(_0x5d60b2){_0x493bd8[_0xe24c('0x3')](_0x1ce128,_0x5d60b2);};}function removeListener(_0x48f802,_0x4d6727){return function(){OpenchannelMessageEvents[_0xe24c('0x4')](_0x48f802,_0x4d6727);};}exports[_0xe24c('0x5')]=function(_0x6f92e0){for(var _0x1ac59c=0x0,_0xe1d970=events['length'];_0x1ac59c<_0xe1d970;_0x1ac59c++){var _0x6d00e=events[_0x1ac59c];var _0x2d8dde=createListener(_0xe24c('0x6')+_0x6d00e,_0x6f92e0);OpenchannelMessageEvents['on'](_0x6d00e,_0x2d8dde);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 58bc717..2c42d54 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 _0xd422=['addAgents','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addTeams'];(function(_0x3c0084,_0x1e37eb){var _0x356f94=function(_0xfccbcc){while(--_0xfccbcc){_0x3c0084['push'](_0x3c0084['shift']());}};_0x356f94(++_0x1e37eb);}(_0xd422,0x13e));var _0x2d42=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xd422[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x2d42('0x0'));var util=require('util');var path=require(_0x2d42('0x1'));var timeout=require(_0x2d42('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2d42('0x3'));var auth=require(_0x2d42('0x4'));var interaction=require(_0x2d42('0x5'));var config=require(_0x2d42('0x6'));var controller=require(_0x2d42('0x7'));router['get']('/',auth[_0x2d42('0x8')](),controller['index']);router['get'](_0x2d42('0x9'),auth['isAuthenticated'](),controller[_0x2d42('0xa')]);router[_0x2d42('0xb')](_0x2d42('0xc'),auth[_0x2d42('0x8')](),controller[_0x2d42('0xd')]);router[_0x2d42('0xb')](_0x2d42('0xe'),auth['isAuthenticated'](),controller[_0x2d42('0xf')]);router[_0x2d42('0xb')](_0x2d42('0x10'),auth[_0x2d42('0x8')](),controller[_0x2d42('0x11')]);router[_0x2d42('0xb')]('/:id/users',auth[_0x2d42('0x8')](),controller['getAgents']);router[_0x2d42('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d42('0x12')](_0x2d42('0x10'),auth['isAuthenticated'](),controller[_0x2d42('0x13')]);router[_0x2d42('0x12')]('/:id/users',auth[_0x2d42('0x8')](),controller[_0x2d42('0x14')]);router['put'](_0x2d42('0xc'),auth[_0x2d42('0x8')](),controller[_0x2d42('0x15')]);router[_0x2d42('0x16')]('/:id',auth[_0x2d42('0x8')](),controller[_0x2d42('0x17')]);router['delete']('/:id/teams',auth[_0x2d42('0x8')](),controller['removeTeams']);router[_0x2d42('0x16')]('/:id/users',auth[_0x2d42('0x8')](),controller[_0x2d42('0x18')]);module[_0x2d42('0x19')]=router; \ No newline at end of file +var _0xb2ea=['../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e23cd,_0x7c5cb3){var _0x32a2f4=function(_0x3f358d){while(--_0x3f358d){_0x2e23cd['push'](_0x2e23cd['shift']());}};_0x32a2f4(++_0x7c5cb3);}(_0xb2ea,0x7c));var _0xab2e=function(_0x3baaf2,_0x894e3d){_0x3baaf2=_0x3baaf2-0x0;var _0x50e8b0=_0xb2ea[_0x3baaf2];return _0x50e8b0;};'use strict';var multer=require(_0xab2e('0x0'));var util=require(_0xab2e('0x1'));var path=require(_0xab2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xab2e('0x3'));var router=express[_0xab2e('0x4')]();var fs_extra=require(_0xab2e('0x5'));var auth=require(_0xab2e('0x6'));var interaction=require(_0xab2e('0x7'));var config=require(_0xab2e('0x8'));var controller=require(_0xab2e('0x9'));router[_0xab2e('0xa')]('/',auth[_0xab2e('0xb')](),controller[_0xab2e('0xc')]);router[_0xab2e('0xa')](_0xab2e('0xd'),auth[_0xab2e('0xb')](),controller[_0xab2e('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab2e('0xa')](_0xab2e('0xf'),auth['isAuthenticated'](),controller[_0xab2e('0x10')]);router['get'](_0xab2e('0x11'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x12')]);router[_0xab2e('0xa')]('/:id/users',auth[_0xab2e('0xb')](),controller[_0xab2e('0x13')]);router[_0xab2e('0x14')]('/',auth[_0xab2e('0xb')](),controller[_0xab2e('0x15')]);router[_0xab2e('0x14')](_0xab2e('0x11'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x16')]);router[_0xab2e('0x14')](_0xab2e('0x17'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x18')]);router[_0xab2e('0x19')]('/:id',auth[_0xab2e('0xb')](),controller[_0xab2e('0x1a')]);router[_0xab2e('0x1b')](_0xab2e('0x1c'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x1d')]);router[_0xab2e('0x1b')]('/:id/teams',auth[_0xab2e('0xb')](),controller[_0xab2e('0x1e')]);router[_0xab2e('0x1b')](_0xab2e('0x17'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x1f')]);module[_0xab2e('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index cd0fb3b..6dd41ef 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 _0x9e4d=['sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9e4d,0xc0));var _0xd9e4=function(_0x1cdf49,_0xe1aafb){_0x1cdf49=_0x1cdf49-0x0;var _0x5cd17d=_0x9e4d[_0x1cdf49];return _0x5cd17d;};'use strict';var Sequelize=require(_0xd9e4('0x0'));module[_0xd9e4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd9e4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd9e4('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9e4('0x4')](_0xd9e4('0x5'),_0xd9e4('0x6'),_0xd9e4('0x7'))}}; \ No newline at end of file +var _0x0a1b=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0xbf7a0a,_0x1d22e9){var _0x31b1ed=function(_0x3721fa){while(--_0x3721fa){_0xbf7a0a['push'](_0xbf7a0a['shift']());}};_0x31b1ed(++_0x1d22e9);}(_0x0a1b,0x1ee));var _0xb0a1=function(_0x38babc,_0x51eee5){_0x38babc=_0x38babc-0x0;var _0x5777a9=_0x0a1b[_0x38babc];return _0x5777a9;};'use strict';var Sequelize=require(_0xb0a1('0x0'));module[_0xb0a1('0x1')]={'name':{'type':Sequelize[_0xb0a1('0x2')],'unique':_0xb0a1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb0a1('0x2')]},'timeout':{'type':Sequelize[_0xb0a1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb0a1('0x5')](_0xb0a1('0x6'),_0xb0a1('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f70d5df..fa5f49a 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 _0xdee4=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','OpenchannelQueue','includeAll','rows','catch','show','options','create','body','user','role','OpenchannelQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','length','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','Team','pick','getTeams','addTeams','findAll','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x4b57a9,_0x241578){var _0x55ca62=function(_0x17d9e2){while(--_0x17d9e2){_0x4b57a9['push'](_0x4b57a9['shift']());}};_0x55ca62(++_0x241578);}(_0xdee4,0x7d));var _0x4dee=function(_0x43b08c,_0x15e99e){_0x43b08c=_0x43b08c-0x0;var _0x3c2958=_0xdee4[_0x43b08c];return _0x3c2958;};'use strict';var emlformat=require(_0x4dee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dee('0x1'));var jsonpatch=require(_0x4dee('0x2'));var rp=require(_0x4dee('0x3'));var moment=require('moment');var BPromise=require(_0x4dee('0x4'));var Mustache=require('mustache');var util=require(_0x4dee('0x5'));var path=require(_0x4dee('0x6'));var sox=require(_0x4dee('0x7'));var csv=require(_0x4dee('0x8'));var ejs=require(_0x4dee('0x9'));var fs=require('fs');var fs_extra=require(_0x4dee('0xa'));var _=require(_0x4dee('0xb'));var squel=require(_0x4dee('0xc'));var crypto=require(_0x4dee('0xd'));var jsforce=require(_0x4dee('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4dee('0x8'));var querystring=require(_0x4dee('0xf'));var Papa=require(_0x4dee('0x10'));var Redis=require(_0x4dee('0x11'));var authService=require(_0x4dee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4dee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4dee('0x14'));var utils=require('../../config/utils');var config=require(_0x4dee('0x15'));var licenseUtil=require(_0x4dee('0x16'));var db=require(_0x4dee('0x17'))['db'];config['redis']=_['defaults'](config[_0x4dee('0x18')],{'host':_0x4dee('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4dee('0x18')]));require(_0x4dee('0x1a'))[_0x4dee('0x1b')](socket);function respondWithStatusCode(_0x250afd,_0x9fc2cb){_0x9fc2cb=_0x9fc2cb||0xcc;return function(_0x2e14ca){if(_0x2e14ca){return _0x250afd[_0x4dee('0x1c')](_0x9fc2cb);}return _0x250afd[_0x4dee('0x1d')](_0x9fc2cb)[_0x4dee('0x1e')]();};}function respondWithResult(_0x1a34ee,_0xf660a9){_0xf660a9=_0xf660a9||0xc8;return function(_0x19c14f){if(_0x19c14f){return _0x1a34ee[_0x4dee('0x1d')](_0xf660a9)[_0x4dee('0x1f')](_0x19c14f);}};}function respondWithFilteredResult(_0x355909,_0x149123){return function(_0x5ac9f2){if(_0x5ac9f2){var _0x217113=typeof _0x149123[_0x4dee('0x20')]==='undefined'&&typeof _0x149123[_0x4dee('0x21')]===_0x4dee('0x22');var _0x4ea8dc=_0x5ac9f2[_0x4dee('0x23')];var _0x21cb12=_0x217113?0x0:_0x149123[_0x4dee('0x20')];var _0x1599cc=_0x217113?_0x5ac9f2[_0x4dee('0x23')]:_0x149123[_0x4dee('0x20')]+_0x149123['limit'];var _0x11c143;if(_0x1599cc>=_0x4ea8dc){_0x1599cc=_0x4ea8dc;_0x11c143=0xc8;}else{_0x11c143=0xce;}_0x355909['status'](_0x11c143);return _0x355909['set'](_0x4dee('0x24'),_0x21cb12+'-'+_0x1599cc+'/'+_0x4ea8dc)[_0x4dee('0x1f')](_0x5ac9f2);}return null;};}function patchUpdates(_0x49e01d){return function(_0x13611c){try{jsonpatch[_0x4dee('0x25')](_0x13611c,_0x49e01d,!![]);}catch(_0x4d5467){return BPromise['reject'](_0x4d5467);}return _0x13611c[_0x4dee('0x26')]();};}function saveUpdates(_0x1e875a,_0x3b6348){return function(_0x185ff4){if(_0x185ff4){return _0x185ff4[_0x4dee('0x27')](_0x1e875a)[_0x4dee('0x28')](function(_0x5325c5){return _0x5325c5;});}return null;};}function removeEntity(_0x449299,_0x1e044b){return function(_0x46fdc8){if(_0x46fdc8){return _0x46fdc8[_0x4dee('0x29')]()[_0x4dee('0x28')](function(){var _0x39089e=_0x46fdc8[_0x4dee('0x2a')]({'plain':!![]});var _0x17a656='OpenchannelQueues';return db[_0x4dee('0x2b')][_0x4dee('0x29')]({'where':{'type':_0x17a656,'resourceId':_0x39089e['id']}})[_0x4dee('0x28')](function(){return _0x46fdc8;});})[_0x4dee('0x28')](function(){_0x449299[_0x4dee('0x1d')](0xcc)[_0x4dee('0x1e')]();});}};}function handleEntityNotFound(_0xd52f3a,_0x43194e){return function(_0x1a0715){if(!_0x1a0715){_0xd52f3a[_0x4dee('0x1c')](0x194);}return _0x1a0715;};}function handleError(_0x4ec5fb,_0x612b76){_0x612b76=_0x612b76||0x1f4;return function(_0x2a04c8){logger[_0x4dee('0x2c')](_0x2a04c8[_0x4dee('0x2d')]);if(_0x2a04c8['name']){delete _0x2a04c8[_0x4dee('0x2e')];}_0x4ec5fb[_0x4dee('0x1d')](_0x612b76)[_0x4dee('0x2f')](_0x2a04c8);};}exports['index']=function(_0x2e5a29,_0x75c572){var _0x2373b2={},_0x241e88={},_0x2285a6={'count':0x0,'rows':[]};var _0x10c119=_[_0x4dee('0x30')](db['OpenchannelQueue'][_0x4dee('0x31')],function(_0x43bb65){return{'name':_0x43bb65[_0x4dee('0x32')],'type':_0x43bb65[_0x4dee('0x33')][_0x4dee('0x34')]};});_0x241e88[_0x4dee('0x35')]=_[_0x4dee('0x30')](_0x10c119,_0x4dee('0x2e'));_0x241e88['query']=_[_0x4dee('0x36')](_0x2e5a29[_0x4dee('0x37')]);_0x241e88[_0x4dee('0x38')]=_[_0x4dee('0x39')](_0x241e88[_0x4dee('0x35')],_0x241e88[_0x4dee('0x37')]);_0x2373b2[_0x4dee('0x3a')]=_[_0x4dee('0x39')](_0x241e88[_0x4dee('0x35')],qs[_0x4dee('0x3b')](_0x2e5a29[_0x4dee('0x37')][_0x4dee('0x3b')]));_0x2373b2[_0x4dee('0x3a')]=_0x2373b2[_0x4dee('0x3a')]['length']?_0x2373b2[_0x4dee('0x3a')]:_0x241e88['model'];if(!_0x2e5a29['query'][_0x4dee('0x3c')](_0x4dee('0x3d'))){_0x2373b2[_0x4dee('0x21')]=qs['limit'](_0x2e5a29[_0x4dee('0x37')][_0x4dee('0x21')]);_0x2373b2[_0x4dee('0x20')]=qs[_0x4dee('0x20')](_0x2e5a29[_0x4dee('0x37')][_0x4dee('0x20')]);}_0x2373b2[_0x4dee('0x3e')]=qs['sort'](_0x2e5a29['query'][_0x4dee('0x3f')]);_0x2373b2[_0x4dee('0x40')]=qs['filters'](_['pick'](_0x2e5a29[_0x4dee('0x37')],_0x241e88[_0x4dee('0x38')]),_0x10c119);if(_0x2e5a29['query'][_0x4dee('0x41')]){_0x2373b2[_0x4dee('0x40')]=_[_0x4dee('0x42')](_0x2373b2['where'],{'$or':_['map'](_0x10c119,function(_0x280cd3){if(_0x280cd3[_0x4dee('0x33')]!==_0x4dee('0x43')){var _0x5a5a1c={};_0x5a5a1c[_0x280cd3[_0x4dee('0x2e')]]={'$like':'%'+_0x2e5a29['query']['filter']+'%'};return _0x5a5a1c;}})});}_0x2373b2=_[_0x4dee('0x42')]({},_0x2373b2,_0x2e5a29['options']);var _0x2caa10={'where':_0x2373b2[_0x4dee('0x40')]};return db[_0x4dee('0x44')][_0x4dee('0x23')](_0x2caa10)['then'](function(_0x56013f){_0x2285a6[_0x4dee('0x23')]=_0x56013f;if(_0x2e5a29[_0x4dee('0x37')][_0x4dee('0x45')]){_0x2373b2['include']=[{'all':!![]}];}return db[_0x4dee('0x44')]['findAll'](_0x2373b2);})['then'](function(_0x38e298){_0x2285a6[_0x4dee('0x46')]=_0x38e298;return _0x2285a6;})[_0x4dee('0x28')](respondWithFilteredResult(_0x75c572,_0x2373b2))[_0x4dee('0x47')](handleError(_0x75c572,null));};exports[_0x4dee('0x48')]=function(_0x120268,_0x3a12bc){var _0x47464c={'raw':!![],'where':{'id':_0x120268['params']['id']}},_0x417188={};_0x417188[_0x4dee('0x35')]=_['keys'](db['OpenchannelQueue'][_0x4dee('0x31')]);_0x417188[_0x4dee('0x37')]=_[_0x4dee('0x36')](_0x120268[_0x4dee('0x37')]);_0x417188[_0x4dee('0x38')]=_[_0x4dee('0x39')](_0x417188[_0x4dee('0x35')],_0x417188[_0x4dee('0x37')]);_0x47464c['attributes']=_[_0x4dee('0x39')](_0x417188['model'],qs['fields'](_0x120268[_0x4dee('0x37')][_0x4dee('0x3b')]));_0x47464c[_0x4dee('0x3a')]=_0x47464c[_0x4dee('0x3a')]['length']?_0x47464c[_0x4dee('0x3a')]:_0x417188[_0x4dee('0x35')];if(_0x120268[_0x4dee('0x37')][_0x4dee('0x45')]){_0x47464c['include']=[{'all':!![]}];}_0x47464c=_[_0x4dee('0x42')]({},_0x47464c,_0x120268[_0x4dee('0x49')]);return db[_0x4dee('0x44')]['find'](_0x47464c)['then'](handleEntityNotFound(_0x3a12bc,null))[_0x4dee('0x28')](respondWithResult(_0x3a12bc,null))[_0x4dee('0x47')](handleError(_0x3a12bc,null));};exports[_0x4dee('0x4a')]=function(_0x909881,_0x2eea0e){return db['OpenchannelQueue'][_0x4dee('0x4a')](_0x909881[_0x4dee('0x4b')],{})[_0x4dee('0x28')](function(_0x5f1488){var _0x2679aa=_0x909881[_0x4dee('0x4c')][_0x4dee('0x2a')]({'plain':!![]});if(!_0x2679aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2679aa[_0x4dee('0x4d')]===_0x4dee('0x4c')){var _0x6c7c64=_0x5f1488[_0x4dee('0x2a')]({'plain':!![]});var _0x259f5f=_0x4dee('0x4e');return db['UserProfileSection'][_0x4dee('0x4f')]({'where':{'name':_0x259f5f,'userProfileId':_0x2679aa[_0x4dee('0x50')]},'raw':!![]})[_0x4dee('0x28')](function(_0x1fe9d5){if(_0x1fe9d5&&_0x1fe9d5[_0x4dee('0x51')]===0x0){return db[_0x4dee('0x2b')][_0x4dee('0x4a')]({'name':_0x6c7c64['name'],'resourceId':_0x6c7c64['id'],'type':_0x1fe9d5[_0x4dee('0x2e')],'sectionId':_0x1fe9d5['id']},{})[_0x4dee('0x28')](function(){return _0x5f1488;});}else{return _0x5f1488;}})[_0x4dee('0x47')](function(_0x2f924c){logger[_0x4dee('0x2c')](_0x4dee('0x52'),_0x2f924c);throw _0x2f924c;});}return _0x5f1488;})['then'](respondWithResult(_0x2eea0e,0xc9))[_0x4dee('0x47')](handleError(_0x2eea0e,null));};exports['update']=function(_0x4664fa,_0x4588c1){if(_0x4664fa[_0x4dee('0x4b')]['id']){delete _0x4664fa[_0x4dee('0x4b')]['id'];}return db['OpenchannelQueue'][_0x4dee('0x4f')]({'where':{'id':_0x4664fa[_0x4dee('0x53')]['id']}})[_0x4dee('0x28')](handleEntityNotFound(_0x4588c1,null))['then'](saveUpdates(_0x4664fa['body'],null))[_0x4dee('0x28')](respondWithResult(_0x4588c1,null))[_0x4dee('0x47')](handleError(_0x4588c1,null));};exports['destroy']=function(_0x210aaa,_0x2eb665){return db[_0x4dee('0x44')][_0x4dee('0x4f')]({'where':{'id':_0x210aaa[_0x4dee('0x53')]['id']}})[_0x4dee('0x28')](handleEntityNotFound(_0x2eb665,null))[_0x4dee('0x28')](removeEntity(_0x2eb665,null))[_0x4dee('0x47')](handleError(_0x2eb665,null));};exports['describe']=function(_0x105f58,_0x374c0d){return db[_0x4dee('0x44')][_0x4dee('0x54')]()[_0x4dee('0x28')](respondWithResult(_0x374c0d,null))[_0x4dee('0x47')](handleError(_0x374c0d,null));};exports[_0x4dee('0x55')]=function(_0x4819be,_0xb6a3b0,_0xe62401){var _0x37d491={'raw':!![],'where':{}},_0x1e0898={},_0x4dce45;return db['OpenchannelQueue'][_0x4dee('0x56')]({'where':{'id':_0x4819be[_0x4dee('0x53')]['id']}})['then'](handleEntityNotFound(_0xb6a3b0,null))[_0x4dee('0x28')](function(_0x870288){if(_0x870288){_0x4dce45=_0x870288[_0x4dee('0x2a')]({'plain':!![]});_0x1e0898['model']=_[_0x4dee('0x36')](db[_0x4dee('0x57')]['rawAttributes']);_0x1e0898['query']=_['keys'](_0x4819be[_0x4dee('0x37')]);_0x1e0898[_0x4dee('0x38')]=_[_0x4dee('0x39')](_0x1e0898[_0x4dee('0x35')],_0x1e0898[_0x4dee('0x37')]);_0x37d491[_0x4dee('0x3a')]=_[_0x4dee('0x39')](_0x1e0898[_0x4dee('0x35')],qs['fields'](_0x4819be[_0x4dee('0x37')][_0x4dee('0x3b')]));_0x37d491[_0x4dee('0x3a')]=_0x37d491[_0x4dee('0x3a')][_0x4dee('0x58')]?_0x37d491['attributes']:_0x1e0898[_0x4dee('0x35')];if(!_0x4819be['query'][_0x4dee('0x3c')]('nolimit')){_0x37d491['limit']=qs[_0x4dee('0x21')](_0x4819be[_0x4dee('0x37')]['limit']);_0x37d491[_0x4dee('0x20')]=qs['offset'](_0x4819be[_0x4dee('0x37')]['offset']);}_0x37d491[_0x4dee('0x3e')]=qs[_0x4dee('0x3f')](_0x4819be['query'][_0x4dee('0x3f')]);_0x37d491['where']=qs[_0x4dee('0x38')](_['pick'](_0x4819be[_0x4dee('0x37')],_0x1e0898['filters']));_0x37d491[_0x4dee('0x40')][_0x4dee('0x59')]=_0x870288['id'];if(_0x4819be[_0x4dee('0x37')][_0x4dee('0x41')]){_0x37d491[_0x4dee('0x40')]=_[_0x4dee('0x42')](_0x37d491['where'],{'$or':_[_0x4dee('0x30')](_0x37d491[_0x4dee('0x3a')],function(_0x2dbe13){var _0x10e95e={};_0x10e95e[_0x2dbe13]={'$like':'%'+_0x4819be[_0x4dee('0x37')][_0x4dee('0x41')]+'%'};return _0x10e95e;})});}_0x37d491=_[_0x4dee('0x42')]({},_0x37d491,_0x4819be[_0x4dee('0x49')]);return db['UserOpenchannelQueue']['findAll'](_0x37d491);}})[_0x4dee('0x28')](function(_0x339c15){if(_0x339c15){return db[_0x4dee('0x5a')][_0x4dee('0x5b')]({'where':{'id':_[_0x4dee('0x30')](_0x339c15,_0x4dee('0x5c')),'role':_0x4dee('0x5d')},'attributes':['id',_0x4dee('0x2e'),_0x4dee('0x5e'),_0x4dee('0x5f'),_0x4dee('0x60')]});}})[_0x4dee('0x28')](function(_0x4fdf07){if(_0x4fdf07){return{'count':_0x4fdf07[_0x4dee('0x23')],'rows':_['map'](_0x4fdf07['rows'],function(_0x2c34b9){return{'membername':_0x2c34b9[_0x4dee('0x2e')],'UserId':_0x2c34b9['id'],'queue_name':_0x4dce45[_0x4dee('0x2e')],'OpenchannelQueueId':_0x4dce45['id'],'interface':util[_0x4dee('0x61')]('%s/%s',_0x4dee('0x62'),_0x2c34b9[_0x4dee('0x2e')]),'penalty':0x0,'paused':_0x2c34b9['openchannelPause'],'createdAt':_0x2c34b9[_0x4dee('0x60')],'updatedAt':_0x2c34b9[_0x4dee('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb6a3b0,_0x37d491))[_0x4dee('0x47')](handleError(_0xb6a3b0,null));};exports['getTeams']=function(_0x51d2ad,_0x58d8f3,_0x185d31){var _0x2780c3={};var _0x667e74={};var _0x9de4b;var _0x53a50e;return db[_0x4dee('0x44')][_0x4dee('0x56')]({'where':{'id':_0x51d2ad['params']['id']}})[_0x4dee('0x28')](handleEntityNotFound(_0x58d8f3,null))['then'](function(_0x39894d){if(_0x39894d){_0x9de4b=_0x39894d;_0x667e74[_0x4dee('0x35')]=_[_0x4dee('0x36')](db[_0x4dee('0x63')][_0x4dee('0x31')]);_0x667e74['query']=_[_0x4dee('0x36')](_0x51d2ad[_0x4dee('0x37')]);_0x667e74['filters']=_[_0x4dee('0x39')](_0x667e74[_0x4dee('0x35')],_0x667e74[_0x4dee('0x37')]);_0x2780c3[_0x4dee('0x3a')]=_[_0x4dee('0x39')](_0x667e74[_0x4dee('0x35')],qs['fields'](_0x51d2ad[_0x4dee('0x37')][_0x4dee('0x3b')]));_0x2780c3[_0x4dee('0x3a')]=_0x2780c3[_0x4dee('0x3a')]['length']?_0x2780c3[_0x4dee('0x3a')]:_0x667e74[_0x4dee('0x35')];_0x2780c3['order']=qs[_0x4dee('0x3f')](_0x51d2ad[_0x4dee('0x37')][_0x4dee('0x3f')]);_0x2780c3[_0x4dee('0x40')]=qs[_0x4dee('0x38')](_[_0x4dee('0x64')](_0x51d2ad['query'],_0x667e74['filters']));if(_0x51d2ad['query'][_0x4dee('0x41')]){_0x2780c3['where']=_['merge'](_0x2780c3[_0x4dee('0x40')],{'$or':_[_0x4dee('0x30')](_0x2780c3[_0x4dee('0x3a')],function(_0x3c60cc){var _0x53bfaf={};_0x53bfaf[_0x3c60cc]={'$like':'%'+_0x51d2ad[_0x4dee('0x37')][_0x4dee('0x41')]+'%'};return _0x53bfaf;})});}_0x2780c3=_[_0x4dee('0x42')]({},_0x2780c3,_0x51d2ad[_0x4dee('0x49')]);return _0x9de4b[_0x4dee('0x65')](_0x2780c3);}})[_0x4dee('0x28')](function(_0x46c773){if(_0x46c773){_0x53a50e=_0x46c773['length'];if(!_0x51d2ad['query'][_0x4dee('0x3c')]('nolimit')){_0x2780c3[_0x4dee('0x21')]=qs[_0x4dee('0x21')](_0x51d2ad[_0x4dee('0x37')][_0x4dee('0x21')]);_0x2780c3[_0x4dee('0x20')]=qs[_0x4dee('0x20')](_0x51d2ad[_0x4dee('0x37')][_0x4dee('0x20')]);}return _0x9de4b[_0x4dee('0x65')](_0x2780c3);}})[_0x4dee('0x28')](function(_0x3cc1a4){if(_0x3cc1a4){return _0x3cc1a4?{'count':_0x53a50e,'rows':_0x3cc1a4}:null;}})['then'](respondWithResult(_0x58d8f3,null))[_0x4dee('0x47')](handleError(_0x58d8f3,null));};exports[_0x4dee('0x66')]=function(_0x1cdf88,_0x1c8755,_0x1ced0d){var _0x400990=_0x1cdf88['body']['ids'];return db['Team'][_0x4dee('0x67')]({'where':{'id':_0x400990},'attributes':['id'],'include':[{'model':db[_0x4dee('0x5a')],'as':_0x4dee('0x68'),'attributes':['id',_0x4dee('0x2e'),_0x4dee('0x69'),_0x4dee('0x6a'),_0x4dee('0x6b')],'raw':!![]}]})[_0x4dee('0x28')](function(_0x3540be){if(_0x3540be){var _0x59ea64=_[_0x4dee('0x6c')](_0x3540be,function(_0x4ee64c){var _0x3b2427=_0x4ee64c['get']({'plain':!![]});return _0x3b2427['Agents'];});return db[_0x4dee('0x44')][_0x4dee('0x4f')]({'where':{'id':_0x1cdf88[_0x4dee('0x53')]['id']}})[_0x4dee('0x28')](function(_0x57a137){return db[_0x4dee('0x6d')]['transaction'](function(_0x4c8a69){return _0x57a137[_0x4dee('0x66')](_0x400990,{'transaction':_0x4c8a69})[_0x4dee('0x28')](function(){return BPromise[_0x4dee('0x6e')](_0x59ea64,function(_0x1d3e9c){return db['UserOpenchannelQueue'][_0x4dee('0x6f')]({'where':{'UserId':_0x1d3e9c['id'],'OpenchannelQueueId':_0x1cdf88[_0x4dee('0x53')]['id']},'transaction':_0x4c8a69});});})[_0x4dee('0x28')](function(){_0x59ea64[_0x4dee('0x70')](function(_0x2eed4b){socket[_0x4dee('0x71')](_0x4dee('0x72'),{'UserId':_0x2eed4b['id'],'OpenchannelQueueId':_0x57a137['id']});});});});});}})[_0x4dee('0x28')](respondWithStatusCode(_0x1c8755,null))[_0x4dee('0x47')](handleError(_0x1c8755,null));};exports[_0x4dee('0x73')]=function(_0x29902a,_0x21c742,_0x53f7dd){return db['Team'][_0x4dee('0x67')]({'where':{'id':_0x29902a['query'][_0x4dee('0x74')]},'attributes':['id'],'include':[{'model':db[_0x4dee('0x5a')],'as':_0x4dee('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21c742,null))[_0x4dee('0x28')](function(_0x114511){var _0x5aab19=_['map'](_0x114511,'id');var _0x22fecc=[];var _0x124de8=[];var _0x59d2b0=squel[_0x4dee('0x75')]();_0x59d2b0[_0x4dee('0x76')](_0x4dee('0x77'))[_0x4dee('0x78')](_0x4dee('0x79'),'tq')[_0x4dee('0x7a')](_0x4dee('0x7b'),'ut',_0x4dee('0x7c'))['where']('OpenchannelQueueId\x20=\x20?',_0x29902a[_0x4dee('0x53')]['id']);for(var _0x5a486d=0x0;_0x5a486d<_0x114511['length'];_0x5a486d+=0x1){let _0x5b1c7a=_0x114511[_0x5a486d];for(var _0x48e0aa=0x0;_0x48e0aa<_0x5b1c7a[_0x4dee('0x68')][_0x4dee('0x58')];_0x48e0aa+=0x1){let _0x2e0c59=_0x5b1c7a['Agents'][_0x48e0aa];var _0x801ae8=_0x59d2b0['clone']();_0x801ae8[_0x4dee('0x40')](_0x4dee('0x7d'),_0x2e0c59['id']);_0x124de8[_0x4dee('0x7e')](db[_0x4dee('0x6d')][_0x4dee('0x37')](_0x801ae8[_0x4dee('0x7f')](),{'type':db[_0x4dee('0x6d')][_0x4dee('0x80')][_0x4dee('0x81')]})[_0x4dee('0x28')](function(_0x32a94e){if(_0x32a94e[_0x4dee('0x58')]===0x1){return _0x2e0c59['id'];}else{var _0x5c76d1=_[_0x4dee('0x82')](_[_0x4dee('0x30')](_0x32a94e,'TeamId'),function(_0x1020ed){return _['includes'](_0x5aab19,_0x1020ed);});if(_0x5c76d1){return _0x2e0c59['id'];}}}));}}return BPromise['all'](_0x124de8)[_0x4dee('0x28')](function(_0x546260){_0x22fecc=_(_0x22fecc)[_0x4dee('0x83')](_0x546260)[_0x4dee('0x84')]()[_0x4dee('0x85')]();return db[_0x4dee('0x44')][_0x4dee('0x4f')]({'where':{'id':_0x29902a[_0x4dee('0x53')]['id']}})[_0x4dee('0x28')](function(_0x441c24){return db[_0x4dee('0x6d')][_0x4dee('0x86')](function(_0x4226df){return _0x441c24[_0x4dee('0x73')](_0x29902a[_0x4dee('0x37')][_0x4dee('0x74')],{'transaction':_0x4226df})[_0x4dee('0x28')](function(){if(!_[_0x4dee('0x87')](_0x22fecc)){return _0x441c24[_0x4dee('0x88')](_0x22fecc,{'transaction':_0x4226df});}})[_0x4dee('0x28')](function(){_0x22fecc[_0x4dee('0x70')](function(_0x5c6e10){socket[_0x4dee('0x71')](_0x4dee('0x89'),{'UserId':_0x5c6e10,'OpenchannelQueueId':_0x441c24['id']});});});});});});})[_0x4dee('0x28')](respondWithStatusCode(_0x21c742,null))[_0x4dee('0x47')](handleError(_0x21c742,null));};exports[_0x4dee('0x8a')]=function(_0x5f501f,_0x57e27d,_0xe01c43){return db[_0x4dee('0x44')][_0x4dee('0x4f')]({'where':{'id':_0x5f501f['params']['id']}})[_0x4dee('0x28')](handleEntityNotFound(_0x57e27d,null))[_0x4dee('0x28')](function(_0x3d9430){if(_0x3d9430){return _0x3d9430[_0x4dee('0x8a')](_0x5f501f['body']['ids'],_[_0x4dee('0x8b')](_0x5f501f[_0x4dee('0x4b')],[_0x4dee('0x74'),'id'])||{})[_0x4dee('0x8c')](function(_0x467b04){for(var _0x2523c0=0x0;_0x2523c0<_0x5f501f['body'][_0x4dee('0x74')][_0x4dee('0x58')];_0x2523c0+=0x1){socket[_0x4dee('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x5f501f['body'][_0x4dee('0x74')][_0x2523c0]),'OpenchannelQueueId':Number(_0x5f501f[_0x4dee('0x53')]['id'])});}return _0x467b04;});}})['then'](respondWithResult(_0x57e27d,null))['catch'](handleError(_0x57e27d,null));};exports[_0x4dee('0x88')]=function(_0x3ee5cf,_0x282414,_0x21e27a){return db[_0x4dee('0x44')][_0x4dee('0x4f')]({'where':{'id':_0x3ee5cf[_0x4dee('0x53')]['id']}})[_0x4dee('0x28')](handleEntityNotFound(_0x282414,null))[_0x4dee('0x28')](function(_0x36f1ad){if(_0x36f1ad){return _0x36f1ad[_0x4dee('0x88')](_0x3ee5cf[_0x4dee('0x37')][_0x4dee('0x74')])[_0x4dee('0x28')](function(){if(_['isArray'](_0x3ee5cf['query'][_0x4dee('0x74')])){for(var _0x372a7c=0x0;_0x372a7c<_0x3ee5cf[_0x4dee('0x37')]['ids']['length'];_0x372a7c+=0x1){socket['emit'](_0x4dee('0x89'),{'UserId':Number(_0x3ee5cf[_0x4dee('0x37')]['ids'][_0x372a7c]),'OpenchannelQueueId':Number(_0x3ee5cf[_0x4dee('0x53')]['id'])});}}else{socket['emit'](_0x4dee('0x89'),{'UserId':Number(_0x3ee5cf[_0x4dee('0x37')][_0x4dee('0x74')]),'OpenchannelQueueId':Number(_0x3ee5cf[_0x4dee('0x53')]['id'])});}});}})[_0x4dee('0x28')](respondWithStatusCode(_0x282414,null))['catch'](handleError(_0x282414,null));};exports[_0x4dee('0x8d')]=function(_0x4a96f8,_0x3a5d75,_0x525fad){var _0x1c4d8c={};var _0x349a33={};var _0x520fb2;var _0x14b7de;return db[_0x4dee('0x44')][_0x4dee('0x56')]({'where':{'id':_0x4a96f8[_0x4dee('0x53')]['id']}})['then'](handleEntityNotFound(_0x3a5d75,null))[_0x4dee('0x28')](function(_0x3d269d){if(_0x3d269d){_0x520fb2=_0x3d269d;_0x349a33[_0x4dee('0x35')]=_[_0x4dee('0x36')](db['User'][_0x4dee('0x31')]);_0x349a33[_0x4dee('0x37')]=_[_0x4dee('0x36')](_0x4a96f8[_0x4dee('0x37')]);_0x349a33[_0x4dee('0x38')]=_['intersection'](_0x349a33[_0x4dee('0x35')],_0x349a33['query']);_0x1c4d8c[_0x4dee('0x3a')]=_[_0x4dee('0x39')](_0x349a33['model'],qs[_0x4dee('0x3b')](_0x4a96f8[_0x4dee('0x37')]['fields']));_0x1c4d8c[_0x4dee('0x3a')]=_0x1c4d8c[_0x4dee('0x3a')][_0x4dee('0x58')]?_0x1c4d8c['attributes']:_0x349a33['model'];_0x1c4d8c[_0x4dee('0x3e')]=qs['sort'](_0x4a96f8[_0x4dee('0x37')][_0x4dee('0x3f')]);_0x1c4d8c[_0x4dee('0x40')]=qs['filters'](_[_0x4dee('0x64')](_0x4a96f8[_0x4dee('0x37')],_0x349a33[_0x4dee('0x38')]));if(_0x4a96f8[_0x4dee('0x37')]['filter']){_0x1c4d8c[_0x4dee('0x40')]=_[_0x4dee('0x42')](_0x1c4d8c[_0x4dee('0x40')],{'$or':_[_0x4dee('0x30')](_0x1c4d8c[_0x4dee('0x3a')],function(_0x2df31c){var _0x2c0efd={};_0x2c0efd[_0x2df31c]={'$like':'%'+_0x4a96f8[_0x4dee('0x37')][_0x4dee('0x41')]+'%'};return _0x2c0efd;})});}_0x1c4d8c=_[_0x4dee('0x42')]({},_0x1c4d8c,_0x4a96f8[_0x4dee('0x49')]);return _0x520fb2[_0x4dee('0x8d')](_0x1c4d8c);}})['then'](function(_0x252756){if(_0x252756){_0x14b7de=_0x252756[_0x4dee('0x58')];if(!_0x4a96f8['query'][_0x4dee('0x3c')](_0x4dee('0x3d'))){_0x1c4d8c[_0x4dee('0x21')]=qs[_0x4dee('0x21')](_0x4a96f8['query'][_0x4dee('0x21')]);_0x1c4d8c[_0x4dee('0x20')]=qs[_0x4dee('0x20')](_0x4a96f8[_0x4dee('0x37')][_0x4dee('0x20')]);}return _0x520fb2['getAgents'](_0x1c4d8c);}})[_0x4dee('0x28')](function(_0x585c44){if(_0x585c44){return _0x585c44?{'count':_0x14b7de,'rows':_0x585c44}:null;}})[_0x4dee('0x28')](respondWithResult(_0x3a5d75,null))[_0x4dee('0x47')](handleError(_0x3a5d75,null));}; \ No newline at end of file +var _0xcdab=['fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','rows','format','%s/%s','SIP','openchannelPause','updatedAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5dfe60,_0x5818df){var _0x1bf845=function(_0x23c200){while(--_0x23c200){_0x5dfe60['push'](_0x5dfe60['shift']());}};_0x1bf845(++_0x5818df);}(_0xcdab,0x10c));var _0xbcda=function(_0x1d606d,_0x376e51){_0x1d606d=_0x1d606d-0x0;var _0x3c38bd=_0xcdab[_0x1d606d];return _0x3c38bd;};'use strict';var emlformat=require(_0xbcda('0x0'));var rimraf=require(_0xbcda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbcda('0x2'));var rp=require(_0xbcda('0x3'));var moment=require(_0xbcda('0x4'));var BPromise=require(_0xbcda('0x5'));var Mustache=require(_0xbcda('0x6'));var util=require(_0xbcda('0x7'));var path=require(_0xbcda('0x8'));var sox=require(_0xbcda('0x9'));var csv=require(_0xbcda('0xa'));var ejs=require(_0xbcda('0xb'));var fs=require('fs');var fs_extra=require(_0xbcda('0xc'));var _=require(_0xbcda('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbcda('0xe'));var deskjs=require(_0xbcda('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbcda('0x10'));var Redis=require(_0xbcda('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbcda('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcda('0x13'));var logger=require(_0xbcda('0x14'))('api');var utils=require(_0xbcda('0x15'));var config=require(_0xbcda('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbcda('0x17')]=_[_0xbcda('0x18')](config[_0xbcda('0x17')],{'host':_0xbcda('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcda('0x17')]));require(_0xbcda('0x1a'))[_0xbcda('0x1b')](socket);function respondWithStatusCode(_0x29c079,_0x55b7ff){_0x55b7ff=_0x55b7ff||0xcc;return function(_0x584032){if(_0x584032){return _0x29c079['sendStatus'](_0x55b7ff);}return _0x29c079[_0xbcda('0x1c')](_0x55b7ff)[_0xbcda('0x1d')]();};}function respondWithResult(_0x14e45f,_0x202c93){_0x202c93=_0x202c93||0xc8;return function(_0x10d85c){if(_0x10d85c){return _0x14e45f[_0xbcda('0x1c')](_0x202c93)[_0xbcda('0x1e')](_0x10d85c);}};}function respondWithFilteredResult(_0x1c74d2,_0x5c699f){return function(_0xaffe30){if(_0xaffe30){var _0xcab36c=typeof _0x5c699f[_0xbcda('0x1f')]===_0xbcda('0x20')&&typeof _0x5c699f[_0xbcda('0x21')]===_0xbcda('0x20');var _0x1f6d9c=_0xaffe30[_0xbcda('0x22')];var _0x33002b=_0xcab36c?0x0:_0x5c699f['offset'];var _0x15b210=_0xcab36c?_0xaffe30[_0xbcda('0x22')]:_0x5c699f['offset']+_0x5c699f['limit'];var _0x4c92b3;if(_0x15b210>=_0x1f6d9c){_0x15b210=_0x1f6d9c;_0x4c92b3=0xc8;}else{_0x4c92b3=0xce;}_0x1c74d2[_0xbcda('0x1c')](_0x4c92b3);return _0x1c74d2['set']('Content-Range',_0x33002b+'-'+_0x15b210+'/'+_0x1f6d9c)['json'](_0xaffe30);}return null;};}function patchUpdates(_0x2dc3a2){return function(_0x120641){try{jsonpatch[_0xbcda('0x23')](_0x120641,_0x2dc3a2,!![]);}catch(_0x450e1d){return BPromise['reject'](_0x450e1d);}return _0x120641[_0xbcda('0x24')]();};}function saveUpdates(_0xcaa1d3,_0x4e22ea){return function(_0x105a14){if(_0x105a14){return _0x105a14[_0xbcda('0x25')](_0xcaa1d3)[_0xbcda('0x26')](function(_0x317fbc){return _0x317fbc;});}return null;};}function removeEntity(_0x540dce,_0x115015){return function(_0x290047){if(_0x290047){return _0x290047[_0xbcda('0x27')]()[_0xbcda('0x26')](function(){var _0xd290b0=_0x290047[_0xbcda('0x28')]({'plain':!![]});var _0x348f42=_0xbcda('0x29');return db[_0xbcda('0x2a')]['destroy']({'where':{'type':_0x348f42,'resourceId':_0xd290b0['id']}})['then'](function(){return _0x290047;});})[_0xbcda('0x26')](function(){_0x540dce['status'](0xcc)[_0xbcda('0x1d')]();});}};}function handleEntityNotFound(_0x43f612,_0x48c54b){return function(_0x22ded1){if(!_0x22ded1){_0x43f612[_0xbcda('0x2b')](0x194);}return _0x22ded1;};}function handleError(_0x2425d1,_0x42e149){_0x42e149=_0x42e149||0x1f4;return function(_0x59c294){logger[_0xbcda('0x2c')](_0x59c294['stack']);if(_0x59c294[_0xbcda('0x2d')]){delete _0x59c294[_0xbcda('0x2d')];}_0x2425d1['status'](_0x42e149)[_0xbcda('0x2e')](_0x59c294);};}exports[_0xbcda('0x2f')]=function(_0x3ba406,_0x57393b){var _0x2cbcc9={},_0x2df3d8={},_0x5731ef={'count':0x0,'rows':[]};var _0x1cda17=_[_0xbcda('0x30')](db[_0xbcda('0x31')][_0xbcda('0x32')],function(_0x3eb093){return{'name':_0x3eb093[_0xbcda('0x33')],'type':_0x3eb093[_0xbcda('0x34')][_0xbcda('0x35')]};});_0x2df3d8['model']=_['map'](_0x1cda17,_0xbcda('0x2d'));_0x2df3d8[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x3ba406[_0xbcda('0x36')]);_0x2df3d8[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x2df3d8[_0xbcda('0x3a')],_0x2df3d8['query']);_0x2cbcc9[_0xbcda('0x3b')]=_[_0xbcda('0x39')](_0x2df3d8[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x3ba406[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x2cbcc9[_0xbcda('0x3b')]=_0x2cbcc9[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x2cbcc9[_0xbcda('0x3b')]:_0x2df3d8[_0xbcda('0x3a')];if(!_0x3ba406[_0xbcda('0x36')][_0xbcda('0x3e')](_0xbcda('0x3f'))){_0x2cbcc9[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x3ba406['query'][_0xbcda('0x21')]);_0x2cbcc9[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x3ba406[_0xbcda('0x36')]['offset']);}_0x2cbcc9[_0xbcda('0x40')]=qs[_0xbcda('0x41')](_0x3ba406[_0xbcda('0x36')][_0xbcda('0x41')]);_0x2cbcc9[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_[_0xbcda('0x43')](_0x3ba406[_0xbcda('0x36')],_0x2df3d8[_0xbcda('0x38')]),_0x1cda17);if(_0x3ba406[_0xbcda('0x36')][_0xbcda('0x44')]){_0x2cbcc9[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x2cbcc9['where'],{'$or':_[_0xbcda('0x30')](_0x1cda17,function(_0x404d34){if(_0x404d34[_0xbcda('0x34')]!==_0xbcda('0x46')){var _0x2becc6={};_0x2becc6[_0x404d34[_0xbcda('0x2d')]]={'$like':'%'+_0x3ba406[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x2becc6;}})});}_0x2cbcc9=_[_0xbcda('0x45')]({},_0x2cbcc9,_0x3ba406[_0xbcda('0x47')]);var _0x2c32af={'where':_0x2cbcc9[_0xbcda('0x42')]};return db[_0xbcda('0x31')]['count'](_0x2c32af)['then'](function(_0x4f7c52){_0x5731ef[_0xbcda('0x22')]=_0x4f7c52;if(_0x3ba406[_0xbcda('0x36')][_0xbcda('0x48')]){_0x2cbcc9['include']=[{'all':!![]}];}return db[_0xbcda('0x31')][_0xbcda('0x49')](_0x2cbcc9);})[_0xbcda('0x26')](function(_0x518955){_0x5731ef['rows']=_0x518955;return _0x5731ef;})[_0xbcda('0x26')](respondWithFilteredResult(_0x57393b,_0x2cbcc9))[_0xbcda('0x4a')](handleError(_0x57393b,null));};exports[_0xbcda('0x4b')]=function(_0x245b96,_0x52e0c2){var _0x1c915a={'raw':!![],'where':{'id':_0x245b96[_0xbcda('0x4c')]['id']}},_0x22ad22={};_0x22ad22[_0xbcda('0x3a')]=_['keys'](db[_0xbcda('0x31')][_0xbcda('0x32')]);_0x22ad22[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x245b96['query']);_0x22ad22[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x22ad22['model'],_0x22ad22['query']);_0x1c915a[_0xbcda('0x3b')]=_['intersection'](_0x22ad22['model'],qs[_0xbcda('0x3c')](_0x245b96[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x1c915a[_0xbcda('0x3b')]=_0x1c915a[_0xbcda('0x3b')]['length']?_0x1c915a[_0xbcda('0x3b')]:_0x22ad22[_0xbcda('0x3a')];if(_0x245b96[_0xbcda('0x36')]['includeAll']){_0x1c915a[_0xbcda('0x4d')]=[{'all':!![]}];}_0x1c915a=_[_0xbcda('0x45')]({},_0x1c915a,_0x245b96[_0xbcda('0x47')]);return db[_0xbcda('0x31')][_0xbcda('0x4e')](_0x1c915a)[_0xbcda('0x26')](handleEntityNotFound(_0x52e0c2,null))['then'](respondWithResult(_0x52e0c2,null))['catch'](handleError(_0x52e0c2,null));};exports[_0xbcda('0x4f')]=function(_0x52b4e9,_0xa52bbe){return db['OpenchannelQueue'][_0xbcda('0x4f')](_0x52b4e9[_0xbcda('0x50')],{})[_0xbcda('0x26')](function(_0x28897e){var _0x1e266f=_0x52b4e9[_0xbcda('0x51')][_0xbcda('0x28')]({'plain':!![]});if(!_0x1e266f)throw new Error(_0xbcda('0x52'));if(_0x1e266f[_0xbcda('0x53')]===_0xbcda('0x51')){var _0x4506fa=_0x28897e[_0xbcda('0x28')]({'plain':!![]});var _0x14840d=_0xbcda('0x29');return db[_0xbcda('0x54')][_0xbcda('0x4e')]({'where':{'name':_0x14840d,'userProfileId':_0x1e266f[_0xbcda('0x55')]},'raw':!![]})[_0xbcda('0x26')](function(_0x105fad){if(_0x105fad&&_0x105fad[_0xbcda('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x4506fa[_0xbcda('0x2d')],'resourceId':_0x4506fa['id'],'type':_0x105fad[_0xbcda('0x2d')],'sectionId':_0x105fad['id']},{})[_0xbcda('0x26')](function(){return _0x28897e;});}else{return _0x28897e;}})[_0xbcda('0x4a')](function(_0xae62e7){logger[_0xbcda('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xae62e7);throw _0xae62e7;});}return _0x28897e;})['then'](respondWithResult(_0xa52bbe,0xc9))[_0xbcda('0x4a')](handleError(_0xa52bbe,null));};exports[_0xbcda('0x25')]=function(_0x57578e,_0x18d9cb){if(_0x57578e['body']['id']){delete _0x57578e[_0xbcda('0x50')]['id'];}return db[_0xbcda('0x31')]['find']({'where':{'id':_0x57578e[_0xbcda('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18d9cb,null))['then'](saveUpdates(_0x57578e[_0xbcda('0x50')],null))['then'](respondWithResult(_0x18d9cb,null))[_0xbcda('0x4a')](handleError(_0x18d9cb,null));};exports[_0xbcda('0x27')]=function(_0x1b9c6d,_0x239f6a){return db[_0xbcda('0x31')]['find']({'where':{'id':_0x1b9c6d[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x239f6a,null))['then'](removeEntity(_0x239f6a,null))[_0xbcda('0x4a')](handleError(_0x239f6a,null));};exports[_0xbcda('0x57')]=function(_0x43277a,_0x1fc02a){return db['OpenchannelQueue'][_0xbcda('0x57')]()[_0xbcda('0x26')](respondWithResult(_0x1fc02a,null))[_0xbcda('0x4a')](handleError(_0x1fc02a,null));};exports[_0xbcda('0x58')]=function(_0x2ac4d4,_0x2993c9,_0x457bb7){var _0x1d1da5={'raw':!![],'where':{}},_0x2cc6a1={},_0x3051df;return db[_0xbcda('0x31')][_0xbcda('0x59')]({'where':{'id':_0x2ac4d4['params']['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x2993c9,null))[_0xbcda('0x26')](function(_0x3f37d8){if(_0x3f37d8){_0x3051df=_0x3f37d8['get']({'plain':!![]});_0x2cc6a1[_0xbcda('0x3a')]=_['keys'](db[_0xbcda('0x5a')][_0xbcda('0x32')]);_0x2cc6a1[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x2ac4d4[_0xbcda('0x36')]);_0x2cc6a1[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x2cc6a1[_0xbcda('0x3a')],_0x2cc6a1[_0xbcda('0x36')]);_0x1d1da5['attributes']=_['intersection'](_0x2cc6a1[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x1d1da5['attributes']=_0x1d1da5[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x1d1da5[_0xbcda('0x3b')]:_0x2cc6a1[_0xbcda('0x3a')];if(!_0x2ac4d4['query'][_0xbcda('0x3e')]('nolimit')){_0x1d1da5[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x2ac4d4['query']['limit']);_0x1d1da5[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x2ac4d4['query'][_0xbcda('0x1f')]);}_0x1d1da5[_0xbcda('0x40')]=qs[_0xbcda('0x41')](_0x2ac4d4[_0xbcda('0x36')]['sort']);_0x1d1da5[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_['pick'](_0x2ac4d4[_0xbcda('0x36')],_0x2cc6a1['filters']));_0x1d1da5[_0xbcda('0x42')][_0xbcda('0x5b')]=_0x3f37d8['id'];if(_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x44')]){_0x1d1da5[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x1d1da5[_0xbcda('0x42')],{'$or':_[_0xbcda('0x30')](_0x1d1da5[_0xbcda('0x3b')],function(_0x40cf74){var _0x557df5={};_0x557df5[_0x40cf74]={'$like':'%'+_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x557df5;})});}_0x1d1da5=_['merge']({},_0x1d1da5,_0x2ac4d4[_0xbcda('0x47')]);return db[_0xbcda('0x5a')][_0xbcda('0x49')](_0x1d1da5);}})['then'](function(_0x11c3bd){if(_0x11c3bd){return db[_0xbcda('0x5c')][_0xbcda('0x5d')]({'where':{'id':_['map'](_0x11c3bd,_0xbcda('0x5e')),'role':_0xbcda('0x5f')},'attributes':['id',_0xbcda('0x2d'),'openchannelPause','updatedAt',_0xbcda('0x60')]});}})[_0xbcda('0x26')](function(_0x491e73){if(_0x491e73){return{'count':_0x491e73[_0xbcda('0x22')],'rows':_['map'](_0x491e73[_0xbcda('0x61')],function(_0x4066ee){return{'membername':_0x4066ee['name'],'UserId':_0x4066ee['id'],'queue_name':_0x3051df['name'],'OpenchannelQueueId':_0x3051df['id'],'interface':util[_0xbcda('0x62')](_0xbcda('0x63'),_0xbcda('0x64'),_0x4066ee['name']),'penalty':0x0,'paused':_0x4066ee[_0xbcda('0x65')],'createdAt':_0x4066ee[_0xbcda('0x60')],'updatedAt':_0x4066ee[_0xbcda('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbcda('0x26')](respondWithFilteredResult(_0x2993c9,_0x1d1da5))[_0xbcda('0x4a')](handleError(_0x2993c9,null));};exports[_0xbcda('0x67')]=function(_0x4718d8,_0x134151,_0xc3edb0){var _0x197fa2={};var _0x41415e={};var _0x531019;var _0xaa2874;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4718d8[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x134151,null))[_0xbcda('0x26')](function(_0x1eeb36){if(_0x1eeb36){_0x531019=_0x1eeb36;_0x41415e[_0xbcda('0x3a')]=_[_0xbcda('0x37')](db[_0xbcda('0x68')]['rawAttributes']);_0x41415e[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x4718d8['query']);_0x41415e[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x41415e[_0xbcda('0x3a')],_0x41415e[_0xbcda('0x36')]);_0x197fa2[_0xbcda('0x3b')]=_[_0xbcda('0x39')](_0x41415e[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x197fa2[_0xbcda('0x3b')]=_0x197fa2[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x197fa2[_0xbcda('0x3b')]:_0x41415e[_0xbcda('0x3a')];_0x197fa2['order']=qs[_0xbcda('0x41')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x41')]);_0x197fa2['where']=qs[_0xbcda('0x38')](_[_0xbcda('0x43')](_0x4718d8[_0xbcda('0x36')],_0x41415e[_0xbcda('0x38')]));if(_0x4718d8[_0xbcda('0x36')][_0xbcda('0x44')]){_0x197fa2[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x197fa2[_0xbcda('0x42')],{'$or':_['map'](_0x197fa2[_0xbcda('0x3b')],function(_0x244ff7){var _0x20f408={};_0x20f408[_0x244ff7]={'$like':'%'+_0x4718d8[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x20f408;})});}_0x197fa2=_[_0xbcda('0x45')]({},_0x197fa2,_0x4718d8['options']);return _0x531019['getTeams'](_0x197fa2);}})[_0xbcda('0x26')](function(_0x132dff){if(_0x132dff){_0xaa2874=_0x132dff[_0xbcda('0x3d')];if(!_0x4718d8[_0xbcda('0x36')]['hasOwnProperty'](_0xbcda('0x3f'))){_0x197fa2[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x21')]);_0x197fa2[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x1f')]);}return _0x531019['getTeams'](_0x197fa2);}})[_0xbcda('0x26')](function(_0x217233){if(_0x217233){return _0x217233?{'count':_0xaa2874,'rows':_0x217233}:null;}})[_0xbcda('0x26')](respondWithResult(_0x134151,null))[_0xbcda('0x4a')](handleError(_0x134151,null));};exports['addTeams']=function(_0x19fded,_0x32f07a,_0x3ea444){var _0x5b4339=_0x19fded[_0xbcda('0x50')]['ids'];return db[_0xbcda('0x68')][_0xbcda('0x49')]({'where':{'id':_0x5b4339},'attributes':['id'],'include':[{'model':db[_0xbcda('0x5c')],'as':_0xbcda('0x69'),'attributes':['id','name',_0xbcda('0x6a'),_0xbcda('0x6b'),_0xbcda('0x6c')],'raw':!![]}]})[_0xbcda('0x26')](function(_0xead492){if(_0xead492){var _0x3f2d06=_[_0xbcda('0x6d')](_0xead492,function(_0x5716ee){var _0x1a67f6=_0x5716ee['get']({'plain':!![]});return _0x1a67f6[_0xbcda('0x69')];});return db[_0xbcda('0x31')][_0xbcda('0x4e')]({'where':{'id':_0x19fded[_0xbcda('0x4c')]['id']}})['then'](function(_0xb487a){return db[_0xbcda('0x6e')][_0xbcda('0x6f')](function(_0x877d77){return _0xb487a[_0xbcda('0x70')](_0x5b4339,{'transaction':_0x877d77})[_0xbcda('0x26')](function(){return BPromise[_0xbcda('0x71')](_0x3f2d06,function(_0x3e4820){return db[_0xbcda('0x5a')]['findOrCreate']({'where':{'UserId':_0x3e4820['id'],'OpenchannelQueueId':_0x19fded[_0xbcda('0x4c')]['id']},'transaction':_0x877d77});});})[_0xbcda('0x26')](function(){_0x3f2d06[_0xbcda('0x72')](function(_0xd5c61a){socket[_0xbcda('0x73')](_0xbcda('0x74'),{'UserId':_0xd5c61a['id'],'OpenchannelQueueId':_0xb487a['id']});});});});});}})['then'](respondWithStatusCode(_0x32f07a,null))[_0xbcda('0x4a')](handleError(_0x32f07a,null));};exports[_0xbcda('0x75')]=function(_0x2011ba,_0x2e49f1,_0x168223){return db[_0xbcda('0x68')][_0xbcda('0x49')]({'where':{'id':_0x2011ba[_0xbcda('0x36')][_0xbcda('0x76')]},'attributes':['id'],'include':[{'model':db[_0xbcda('0x5c')],'as':_0xbcda('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e49f1,null))[_0xbcda('0x26')](function(_0x8174b4){var _0x49a7cf=_[_0xbcda('0x30')](_0x8174b4,'id');var _0x4515ba=[];var _0x4841eb=[];var _0x54222c=squel[_0xbcda('0x77')]();_0x54222c[_0xbcda('0x78')](_0xbcda('0x79'))[_0xbcda('0x7a')]('team_has_openchannel_queues','tq')[_0xbcda('0x7b')]('user_has_teams','ut',_0xbcda('0x7c'))[_0xbcda('0x42')](_0xbcda('0x7d'),_0x2011ba[_0xbcda('0x4c')]['id']);for(var _0x340718=0x0;_0x340718<_0x8174b4[_0xbcda('0x3d')];_0x340718+=0x1){let _0x407f71=_0x8174b4[_0x340718];for(var _0x59a140=0x0;_0x59a140<_0x407f71['Agents'][_0xbcda('0x3d')];_0x59a140+=0x1){let _0x44ed16=_0x407f71[_0xbcda('0x69')][_0x59a140];var _0x3f52e2=_0x54222c[_0xbcda('0x7e')]();_0x3f52e2['where'](_0xbcda('0x7f'),_0x44ed16['id']);_0x4841eb['push'](db[_0xbcda('0x6e')][_0xbcda('0x36')](_0x3f52e2[_0xbcda('0x80')](),{'type':db[_0xbcda('0x6e')][_0xbcda('0x81')]['SELECT']})[_0xbcda('0x26')](function(_0x43aa41){if(_0x43aa41[_0xbcda('0x3d')]===0x1){return _0x44ed16['id'];}else{var _0x1f851c=_[_0xbcda('0x82')](_['map'](_0x43aa41,_0xbcda('0x83')),function(_0x430ad0){return _['includes'](_0x49a7cf,_0x430ad0);});if(_0x1f851c){return _0x44ed16['id'];}}}));}}return BPromise[_0xbcda('0x84')](_0x4841eb)[_0xbcda('0x26')](function(_0xc62c2e){_0x4515ba=_(_0x4515ba)['union'](_0xc62c2e)['compact']()[_0xbcda('0x85')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x2011ba[_0xbcda('0x4c')]['id']}})['then'](function(_0xde1557){return db[_0xbcda('0x6e')]['transaction'](function(_0x4bf194){return _0xde1557[_0xbcda('0x75')](_0x2011ba[_0xbcda('0x36')][_0xbcda('0x76')],{'transaction':_0x4bf194})['then'](function(){if(!_[_0xbcda('0x86')](_0x4515ba)){return _0xde1557[_0xbcda('0x87')](_0x4515ba,{'transaction':_0x4bf194});}})['then'](function(){_0x4515ba[_0xbcda('0x72')](function(_0x14a632){socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':_0x14a632,'OpenchannelQueueId':_0xde1557['id']});});});});});});})['then'](respondWithStatusCode(_0x2e49f1,null))[_0xbcda('0x4a')](handleError(_0x2e49f1,null));};exports[_0xbcda('0x89')]=function(_0x8f67bf,_0x270d00,_0x53e77b){return db[_0xbcda('0x31')][_0xbcda('0x4e')]({'where':{'id':_0x8f67bf[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x270d00,null))['then'](function(_0x57ec74){if(_0x57ec74){return _0x57ec74[_0xbcda('0x89')](_0x8f67bf[_0xbcda('0x50')]['ids'],_['omit'](_0x8f67bf['body'],['ids','id'])||{})['spread'](function(_0x736b04){for(var _0xaaeb0=0x0;_0xaaeb0<_0x8f67bf[_0xbcda('0x50')]['ids'][_0xbcda('0x3d')];_0xaaeb0+=0x1){socket[_0xbcda('0x73')](_0xbcda('0x74'),{'UserId':Number(_0x8f67bf[_0xbcda('0x50')][_0xbcda('0x76')][_0xaaeb0]),'OpenchannelQueueId':Number(_0x8f67bf['params']['id'])});}return _0x736b04;});}})[_0xbcda('0x26')](respondWithResult(_0x270d00,null))[_0xbcda('0x4a')](handleError(_0x270d00,null));};exports[_0xbcda('0x87')]=function(_0x1b0f00,_0x13cc68,_0x409476){return db[_0xbcda('0x31')]['find']({'where':{'id':_0x1b0f00[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x13cc68,null))[_0xbcda('0x26')](function(_0x287509){if(_0x287509){return _0x287509['removeAgents'](_0x1b0f00[_0xbcda('0x36')][_0xbcda('0x76')])[_0xbcda('0x26')](function(){if(_[_0xbcda('0x8a')](_0x1b0f00[_0xbcda('0x36')]['ids'])){for(var _0x5cea1a=0x0;_0x5cea1a<_0x1b0f00[_0xbcda('0x36')]['ids'][_0xbcda('0x3d')];_0x5cea1a+=0x1){socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':Number(_0x1b0f00['query'][_0xbcda('0x76')][_0x5cea1a]),'OpenchannelQueueId':Number(_0x1b0f00[_0xbcda('0x4c')]['id'])});}}else{socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':Number(_0x1b0f00['query']['ids']),'OpenchannelQueueId':Number(_0x1b0f00['params']['id'])});}});}})[_0xbcda('0x26')](respondWithStatusCode(_0x13cc68,null))['catch'](handleError(_0x13cc68,null));};exports[_0xbcda('0x8b')]=function(_0x32830d,_0x5a4889,_0x4ff757){var _0x43323e={};var _0x3e3553={};var _0x51f9f3;var _0x3da074;return db[_0xbcda('0x31')][_0xbcda('0x59')]({'where':{'id':_0x32830d[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x5a4889,null))['then'](function(_0x4dbaa0){if(_0x4dbaa0){_0x51f9f3=_0x4dbaa0;_0x3e3553[_0xbcda('0x3a')]=_[_0xbcda('0x37')](db[_0xbcda('0x5c')][_0xbcda('0x32')]);_0x3e3553[_0xbcda('0x36')]=_['keys'](_0x32830d['query']);_0x3e3553[_0xbcda('0x38')]=_['intersection'](_0x3e3553[_0xbcda('0x3a')],_0x3e3553['query']);_0x43323e[_0xbcda('0x3b')]=_['intersection'](_0x3e3553[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x43323e[_0xbcda('0x3b')]=_0x43323e[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x43323e[_0xbcda('0x3b')]:_0x3e3553[_0xbcda('0x3a')];_0x43323e['order']=qs[_0xbcda('0x41')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x41')]);_0x43323e[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_['pick'](_0x32830d[_0xbcda('0x36')],_0x3e3553[_0xbcda('0x38')]));if(_0x32830d[_0xbcda('0x36')][_0xbcda('0x44')]){_0x43323e['where']=_['merge'](_0x43323e['where'],{'$or':_[_0xbcda('0x30')](_0x43323e['attributes'],function(_0x19e3b9){var _0x13144f={};_0x13144f[_0x19e3b9]={'$like':'%'+_0x32830d[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x13144f;})});}_0x43323e=_[_0xbcda('0x45')]({},_0x43323e,_0x32830d[_0xbcda('0x47')]);return _0x51f9f3['getAgents'](_0x43323e);}})[_0xbcda('0x26')](function(_0x54594b){if(_0x54594b){_0x3da074=_0x54594b[_0xbcda('0x3d')];if(!_0x32830d[_0xbcda('0x36')][_0xbcda('0x3e')]('nolimit')){_0x43323e['limit']=qs[_0xbcda('0x21')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x21')]);_0x43323e[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x1f')]);}return _0x51f9f3[_0xbcda('0x8b')](_0x43323e);}})[_0xbcda('0x26')](function(_0x3bedda){if(_0x3bedda){return _0x3bedda?{'count':_0x3da074,'rows':_0x3bedda}:null;}})[_0xbcda('0x26')](respondWithResult(_0x5a4889,null))[_0xbcda('0x4a')](handleError(_0x5a4889,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8122d5f..8893090 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 _0xb7f6=['OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2a0e1e,_0x208bc6){var _0x4f7063=function(_0x2eb876){while(--_0x2eb876){_0x2a0e1e['push'](_0x2a0e1e['shift']());}};_0x4f7063(++_0x208bc6);}(_0xb7f6,0x1db));var _0x6b7f=function(_0x3bc257,_0x55e53c){_0x3bc257=_0x3bc257-0x0;var _0x4ae7c5=_0xb7f6[_0x3bc257];return _0x4ae7c5;};'use strict';var EventEmitter=require(_0x6b7f('0x0'));var OpenchannelQueue=require(_0x6b7f('0x1'))['db'][_0x6b7f('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6b7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b7f('0x4'),'afterDestroy':_0x6b7f('0x5')};function emitEvent(_0x25d5fc){return function(_0x5c4919,_0x25c3eb,_0x4b4705){OpenchannelQueueEvents[_0x6b7f('0x6')](_0x25d5fc+':'+_0x5c4919['id'],_0x5c4919);OpenchannelQueueEvents[_0x6b7f('0x6')](_0x25d5fc,_0x5c4919);_0x4b4705(null);};}for(var e in events){if(events[_0x6b7f('0x7')](e)){var event=events[e];OpenchannelQueue[_0x6b7f('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x70bc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x19d91f,_0xd81865){var _0xfc0bf2=function(_0x3c6e13){while(--_0x3c6e13){_0x19d91f['push'](_0x19d91f['shift']());}};_0xfc0bf2(++_0xd81865);}(_0x70bc,0x72));var _0xc70b=function(_0x444cd7,_0x34abe7){_0x444cd7=_0x444cd7-0x0;var _0x2fe0f6=_0x70bc[_0x444cd7];return _0x2fe0f6;};'use strict';var EventEmitter=require(_0xc70b('0x0'));var OpenchannelQueue=require(_0xc70b('0x1'))['db'][_0xc70b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc70b('0x3')](0x0);var events={'afterCreate':_0xc70b('0x4'),'afterUpdate':_0xc70b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ecf6f){return function(_0x4b62cc,_0x5e356f,_0x33752a){OpenchannelQueueEvents['emit'](_0x4ecf6f+':'+_0x4b62cc['id'],_0x4b62cc);OpenchannelQueueEvents[_0xc70b('0x6')](_0x4ecf6f,_0x4b62cc);_0x33752a(null);};}for(var e in events){if(events[_0xc70b('0x7')](e)){var event=events[e];OpenchannelQueue[_0xc70b('0x8')](e,emitEvent(event));}}module[_0xc70b('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f189792..9ec8a82 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 _0x77e8=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment'];(function(_0x545ced,_0x2eb3d3){var _0x40da32=function(_0x2eb6ef){while(--_0x2eb6ef){_0x545ced['push'](_0x545ced['shift']());}};_0x40da32(++_0x2eb3d3);}(_0x77e8,0x17c));var _0x877e=function(_0x200af4,_0x8416e8){_0x200af4=_0x200af4-0x0;var _0x3831b6=_0x77e8[_0x200af4];return _0x3831b6;};'use strict';var _=require('lodash');var util=require(_0x877e('0x0'));var logger=require(_0x877e('0x1'))(_0x877e('0x2'));var moment=require(_0x877e('0x3'));var BPromise=require('bluebird');var rp=require(_0x877e('0x4'));var fs=require('fs');var path=require(_0x877e('0x5'));var rimraf=require(_0x877e('0x6'));var config=require(_0x877e('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x877e('0x8')]=function(_0x18524e,_0x449a6c){return _0x18524e[_0x877e('0x9')](_0x877e('0xa'),attributes,{'tableName':_0x877e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ac=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x22f6a4,_0x233227){var _0x1c7d20=function(_0x37ec49){while(--_0x37ec49){_0x22f6a4['push'](_0x22f6a4['shift']());}};_0x1c7d20(++_0x233227);}(_0xd2ac,0x1ac));var _0xcd2a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd2ac[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcd2a('0x0'));var util=require(_0xcd2a('0x1'));var logger=require(_0xcd2a('0x2'))(_0xcd2a('0x3'));var moment=require(_0xcd2a('0x4'));var BPromise=require(_0xcd2a('0x5'));var rp=require(_0xcd2a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd2a('0x7'));var config=require(_0xcd2a('0x8'));var attributes=require(_0xcd2a('0x9'));module['exports']=function(_0x27bf63,_0x78bcbe){return _0x27bf63[_0xcd2a('0xa')](_0xcd2a('0xb'),attributes,{'tableName':_0xcd2a('0xc'),'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 c32f715..39b0abe 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 _0xb973=['register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','map','model','include','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket'];(function(_0x5ec594,_0x4aae4d){var _0x24b9de=function(_0x3fb282){while(--_0x3fb282){_0x5ec594['push'](_0x5ec594['shift']());}};_0x24b9de(++_0x4aae4d);}(_0xb973,0x1bc));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b97('0x0'));var util=require(_0x3b97('0x1'));var moment=require(_0x3b97('0x2'));var BPromise=require(_0x3b97('0x3'));var rs=require(_0x3b97('0x4'));var fs=require('fs');var Redis=require(_0x3b97('0x5'));var db=require(_0x3b97('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3b97('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3b97('0x8')],{'host':_0x3b97('0x9'),'port':0x18eb});var socket=require(_0x3b97('0xa'))(new Redis(config['redis']));require(_0x3b97('0xb'))[_0x3b97('0xc')](socket);function respondWithRpcPromise(_0x3dfd49,_0x8aebe7,_0x445ae5){return new BPromise(function(_0x2499f8,_0x52db0e){return client[_0x3b97('0xd')](_0x3dfd49,_0x445ae5)[_0x3b97('0xe')](function(_0x2d72ea){logger[_0x3b97('0xf')](_0x3b97('0x10'),_0x8aebe7,_0x3b97('0x11'));logger[_0x3b97('0x12')](_0x3b97('0x13'),_0x8aebe7,_0x3b97('0x11'),JSON[_0x3b97('0x14')](_0x2d72ea));if(_0x2d72ea[_0x3b97('0x15')]){if(_0x2d72ea[_0x3b97('0x15')][_0x3b97('0x16')]===0x1f4){logger['error'](_0x3b97('0x10'),_0x8aebe7,_0x2d72ea[_0x3b97('0x15')][_0x3b97('0x17')]);return _0x52db0e(_0x2d72ea[_0x3b97('0x15')]['message']);}logger[_0x3b97('0x15')](_0x3b97('0x10'),_0x8aebe7,_0x2d72ea[_0x3b97('0x15')][_0x3b97('0x17')]);return _0x2499f8(_0x2d72ea['error']['message']);}else{logger[_0x3b97('0xf')](_0x3b97('0x10'),_0x8aebe7,_0x3b97('0x11'));_0x2499f8(_0x2d72ea[_0x3b97('0x18')][_0x3b97('0x17')]);}})['catch'](function(_0x3d0d09){logger[_0x3b97('0x15')](_0x3b97('0x10'),_0x8aebe7,_0x3d0d09);_0x52db0e(_0x3d0d09);});});}exports[_0x3b97('0x19')]=function(_0x35df00){var _0x4fd96a=this;return new Promise(function(_0x24f59c,_0x1c9601){return db[_0x3b97('0x1a')][_0x3b97('0x1b')]({'raw':_0x35df00[_0x3b97('0x1c')]?_0x35df00[_0x3b97('0x1c')][_0x3b97('0x1d')]===undefined?!![]:![]:!![],'where':_0x35df00[_0x3b97('0x1c')]?_0x35df00[_0x3b97('0x1c')][_0x3b97('0x1e')]||null:null,'attributes':_0x35df00[_0x3b97('0x1c')]?_0x35df00[_0x3b97('0x1c')][_0x3b97('0x1f')]||null:null,'limit':_0x35df00[_0x3b97('0x1c')]?_0x35df00[_0x3b97('0x1c')]['limit']||null:null,'include':_0x35df00[_0x3b97('0x1c')]?_0x35df00[_0x3b97('0x1c')]['include']?_[_0x3b97('0x20')](_0x35df00['options']['include'],function(_0x117e0b){return{'model':db[_0x117e0b[_0x3b97('0x21')]],'as':_0x117e0b['as'],'attributes':_0x117e0b[_0x3b97('0x1f')],'include':_0x117e0b[_0x3b97('0x22')]?_[_0x3b97('0x20')](_0x117e0b[_0x3b97('0x22')],function(_0x406cbd){return{'model':db[_0x406cbd['model']],'as':_0x406cbd['as'],'attributes':_0x406cbd[_0x3b97('0x1f')],'include':_0x406cbd[_0x3b97('0x22')]?_[_0x3b97('0x20')](_0x406cbd[_0x3b97('0x22')],function(_0x424a9a){return{'model':db[_0x424a9a[_0x3b97('0x21')]],'as':_0x424a9a['as'],'attributes':_0x424a9a[_0x3b97('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x259873){logger['info']('GetOpenchannelQueue',_0x35df00);logger['debug'](_0x3b97('0x19'),_0x35df00,JSON[_0x3b97('0x14')](_0x259873));_0x24f59c(_0x259873);})[_0x3b97('0x23')](function(_0x299f58){logger[_0x3b97('0x15')]('GetOpenchannelQueue',_0x299f58[_0x3b97('0x17')],_0x35df00);_0x1c9601(_0x4fd96a['error'](0x1f4,_0x299f58[_0x3b97('0x17')]));});});};exports[_0x3b97('0x24')]=function(_0x587478){var _0x2d7628=this;return new Promise(function(_0x6e68f7,_0x54dd75){return db['OpenchannelQueue'][_0x3b97('0x25')]({'raw':_0x587478[_0x3b97('0x1c')]?_0x587478['options'][_0x3b97('0x1d')]===undefined?!![]:![]:!![],'where':_0x587478[_0x3b97('0x1c')]?_0x587478['options']['where']||null:null,'attributes':_0x587478[_0x3b97('0x1c')]?_0x587478['options']['attributes']||null:null,'include':_0x587478[_0x3b97('0x1c')]?_0x587478[_0x3b97('0x1c')][_0x3b97('0x22')]?_['map'](_0x587478[_0x3b97('0x1c')][_0x3b97('0x22')],function(_0x534762){return{'model':db[_0x534762['model']],'as':_0x534762['as'],'attributes':_0x534762[_0x3b97('0x1f')],'include':_0x534762[_0x3b97('0x22')]?_[_0x3b97('0x20')](_0x534762[_0x3b97('0x22')],function(_0x2dccc2){return{'model':db[_0x2dccc2[_0x3b97('0x21')]],'as':_0x2dccc2['as'],'attributes':_0x2dccc2[_0x3b97('0x1f')],'include':_0x2dccc2[_0x3b97('0x22')]?_[_0x3b97('0x20')](_0x2dccc2[_0x3b97('0x22')],function(_0x3d1f2c){return{'model':db[_0x3d1f2c[_0x3b97('0x21')]],'as':_0x3d1f2c['as'],'attributes':_0x3d1f2c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a918d){logger[_0x3b97('0xf')]('ShowOpenchannelQueue',_0x587478);logger[_0x3b97('0x12')](_0x3b97('0x24'),_0x587478,JSON[_0x3b97('0x14')](_0x4a918d));_0x6e68f7(_0x4a918d);})[_0x3b97('0x23')](function(_0x518dbd){logger[_0x3b97('0x15')](_0x3b97('0x24'),_0x518dbd['message'],_0x587478);_0x54dd75(_0x2d7628['error'](0x1f4,_0x518dbd[_0x3b97('0x17')]));});});}; \ No newline at end of file +var _0xcba1=['stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','model','map','then','where','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x212311,_0xa91e89){var _0x3d67a4=function(_0x22536c){while(--_0x22536c){_0x212311['push'](_0x212311['shift']());}};_0x3d67a4(++_0xa91e89);}(_0xcba1,0x1c1));var _0x1cba=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xcba1[_0x404957];return _0x4e0365;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cba('0x0'));var BPromise=require(_0x1cba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cba('0x2'));var db=require(_0x1cba('0x3'))['db'];var utils=require(_0x1cba('0x4'));var logger=require(_0x1cba('0x5'))(_0x1cba('0x6'));var config=require(_0x1cba('0x7'));var jayson=require(_0x1cba('0x8'));var client=jayson[_0x1cba('0x9')]['http']({'port':0x232a});config[_0x1cba('0xa')]=_[_0x1cba('0xb')](config['redis'],{'host':_0x1cba('0xc'),'port':0x18eb});var socket=require(_0x1cba('0xd'))(new Redis(config[_0x1cba('0xa')]));require('./openchannelQueue.socket')[_0x1cba('0xe')](socket);function respondWithRpcPromise(_0x4f21b3,_0x395407,_0x12a751){return new BPromise(function(_0x524936,_0x4f7696){return client[_0x1cba('0xf')](_0x4f21b3,_0x12a751)['then'](function(_0x437b69){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x395407,_0x1cba('0x10'));logger[_0x1cba('0x11')](_0x1cba('0x12'),_0x395407,_0x1cba('0x10'),JSON[_0x1cba('0x13')](_0x437b69));if(_0x437b69[_0x1cba('0x14')]){if(_0x437b69[_0x1cba('0x14')][_0x1cba('0x15')]===0x1f4){logger[_0x1cba('0x14')](_0x1cba('0x16'),_0x395407,_0x437b69[_0x1cba('0x14')]['message']);return _0x4f7696(_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);}logger[_0x1cba('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x395407,_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);return _0x524936(_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);}else{logger[_0x1cba('0x18')](_0x1cba('0x16'),_0x395407,_0x1cba('0x10'));_0x524936(_0x437b69[_0x1cba('0x19')][_0x1cba('0x17')]);}})[_0x1cba('0x1a')](function(_0x3201ec){logger[_0x1cba('0x14')](_0x1cba('0x16'),_0x395407,_0x3201ec);_0x4f7696(_0x3201ec);});});}exports[_0x1cba('0x1b')]=function(_0x1c8250){var _0x15a4af=this;return new Promise(function(_0x24c5fa,_0x5beee9){return db[_0x1cba('0x1c')][_0x1cba('0x1d')]({'raw':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250['options'][_0x1cba('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250['options']['where']||null:null,'attributes':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x20')]||null:null,'limit':_0x1c8250['options']?_0x1c8250[_0x1cba('0x1e')]['limit']||null:null,'include':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x21')]?_['map'](_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x21')],function(_0x36f544){return{'model':db[_0x36f544[_0x1cba('0x22')]],'as':_0x36f544['as'],'attributes':_0x36f544[_0x1cba('0x20')],'include':_0x36f544[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x36f544[_0x1cba('0x21')],function(_0x17f19e){return{'model':db[_0x17f19e['model']],'as':_0x17f19e['as'],'attributes':_0x17f19e['attributes'],'include':_0x17f19e[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x17f19e[_0x1cba('0x21')],function(_0xb2563b){return{'model':db[_0xb2563b[_0x1cba('0x22')]],'as':_0xb2563b['as'],'attributes':_0xb2563b[_0x1cba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1cba('0x24')](function(_0x543336){logger['info']('GetOpenchannelQueue',_0x1c8250);logger['debug'](_0x1cba('0x1b'),_0x1c8250,JSON['stringify'](_0x543336));_0x24c5fa(_0x543336);})[_0x1cba('0x1a')](function(_0x4494b6){logger[_0x1cba('0x14')](_0x1cba('0x1b'),_0x4494b6['message'],_0x1c8250);_0x5beee9(_0x15a4af[_0x1cba('0x14')](0x1f4,_0x4494b6[_0x1cba('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x40c8a0){var _0x1e123e=this;return new Promise(function(_0x54b1fb,_0x5e660c){return db[_0x1cba('0x1c')]['find']({'raw':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x1f')]===undefined?!![]:![]:!![],'where':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x25')]||null:null,'attributes':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')]['attributes']||null:null,'include':_0x40c8a0['options']?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x21')],function(_0x15dd62){return{'model':db[_0x15dd62[_0x1cba('0x22')]],'as':_0x15dd62['as'],'attributes':_0x15dd62[_0x1cba('0x20')],'include':_0x15dd62[_0x1cba('0x21')]?_['map'](_0x15dd62[_0x1cba('0x21')],function(_0x485887){return{'model':db[_0x485887[_0x1cba('0x22')]],'as':_0x485887['as'],'attributes':_0x485887[_0x1cba('0x20')],'include':_0x485887[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x485887['include'],function(_0x285295){return{'model':db[_0x285295['model']],'as':_0x285295['as'],'attributes':_0x285295[_0x1cba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1cba('0x24')](function(_0x395c61){logger['info'](_0x1cba('0x26'),_0x40c8a0);logger[_0x1cba('0x11')]('ShowOpenchannelQueue',_0x40c8a0,JSON[_0x1cba('0x13')](_0x395c61));_0x54b1fb(_0x395c61);})['catch'](function(_0xac81de){logger[_0x1cba('0x14')](_0x1cba('0x26'),_0xac81de['message'],_0x40c8a0);_0x5e660c(_0x1e123e['error'](0x1f4,_0xac81de['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3249579..84b848b 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 _0x27a4=['register','length','remove','emit','removeListener'];(function(_0x1d1eab,_0x4000d5){var _0x35c2e0=function(_0x401481){while(--_0x401481){_0x1d1eab['push'](_0x1d1eab['shift']());}};_0x35c2e0(++_0x4000d5);}(_0x27a4,0x1ab));var _0x427a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x27a4[_0x1cc8fe];return _0x230054;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x427a('0x0'),'update'];function createListener(_0x4151e1,_0x398588){return function(_0x5b3f0b){_0x398588[_0x427a('0x1')](_0x4151e1,_0x5b3f0b);};}function removeListener(_0x2b509d,_0x479db5){return function(){OpenchannelQueueEvents[_0x427a('0x2')](_0x2b509d,_0x479db5);};}exports[_0x427a('0x3')]=function(_0x48cf75){for(var _0x39347b=0x0,_0x4f467c=events[_0x427a('0x4')];_0x39347b<_0x4f467c;_0x39347b++){var _0x2168cc=events[_0x39347b];var _0xb2ae2e=createListener('openchannelQueue:'+_0x2168cc,_0x48cf75);OpenchannelQueueEvents['on'](_0x2168cc,_0xb2ae2e);}}; \ No newline at end of file +var _0x3f2e=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x5894cf,_0x5b71db){var _0x5afcf3=function(_0x9a15ea){while(--_0x9a15ea){_0x5894cf['push'](_0x5894cf['shift']());}};_0x5afcf3(++_0x5b71db);}(_0x3f2e,0x143));var _0xe3f2=function(_0xf57e93,_0x459863){_0xf57e93=_0xf57e93-0x0;var _0x15228b=_0x3f2e[_0xf57e93];return _0x15228b;};'use strict';var OpenchannelQueueEvents=require(_0xe3f2('0x0'));var events=[_0xe3f2('0x1'),_0xe3f2('0x2'),_0xe3f2('0x3')];function createListener(_0x3f1d2e,_0x521a87){return function(_0x4bc024){_0x521a87[_0xe3f2('0x4')](_0x3f1d2e,_0x4bc024);};}function removeListener(_0x95f7bd,_0x11bf5a){return function(){OpenchannelQueueEvents[_0xe3f2('0x5')](_0x95f7bd,_0x11bf5a);};}exports[_0xe3f2('0x6')]=function(_0xc4f276){for(var _0x2df36f=0x0,_0x14cd90=events[_0xe3f2('0x7')];_0x2df36f<_0x14cd90;_0x2df36f++){var _0x2e2327=events[_0x2df36f];var _0x5dfd83=createListener(_0xe3f2('0x8')+_0x2e2327,_0xc4f276);OpenchannelQueueEvents['on'](_0x2e2327,_0x5dfd83);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2e129b5..eb81725 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 _0x2273=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x39aec2,_0x2c1ed9){var _0x36c904=function(_0x4d29fa){while(--_0x4d29fa){_0x39aec2['push'](_0x39aec2['shift']());}};_0x36c904(++_0x2c1ed9);}(_0x2273,0xc2));var _0x3227=function(_0x5c4172,_0x2e8348){_0x5c4172=_0x5c4172-0x0;var _0x110de4=_0x2273[_0x5c4172];return _0x110de4;};'use strict';var multer=require('multer');var util=require(_0x3227('0x0'));var path=require('path');var timeout=require(_0x3227('0x1'));var express=require(_0x3227('0x2'));var router=express[_0x3227('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3227('0x4'));var interaction=require(_0x3227('0x5'));var config=require(_0x3227('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x3227('0x7')](),controller['index']);router[_0x3227('0x8')]('/describe',auth[_0x3227('0x7')](),controller[_0x3227('0x9')]);router[_0x3227('0x8')](_0x3227('0xa'),auth[_0x3227('0x7')](),controller[_0x3227('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3227('0xc')]);router[_0x3227('0xd')](_0x3227('0xa'),auth['isAuthenticated'](),controller[_0x3227('0xe')]);router[_0x3227('0xf')](_0x3227('0xa'),auth[_0x3227('0x7')](),controller[_0x3227('0x10')]);module[_0x3227('0x11')]=router; \ No newline at end of file +var _0x1b10=['../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1b10,0x18a));var _0x01b1=function(_0xd4b888,_0x1aea0a){_0xd4b888=_0xd4b888-0x0;var _0x3a77f4=_0x1b10[_0xd4b888];return _0x3a77f4;};'use strict';var multer=require(_0x01b1('0x0'));var util=require(_0x01b1('0x1'));var path=require('path');var timeout=require(_0x01b1('0x2'));var express=require(_0x01b1('0x3'));var router=express['Router']();var fs_extra=require(_0x01b1('0x4'));var auth=require(_0x01b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x01b1('0x6'));var controller=require(_0x01b1('0x7'));router['get']('/',auth[_0x01b1('0x8')](),controller[_0x01b1('0x9')]);router[_0x01b1('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x01b1('0xb')]);router[_0x01b1('0xa')](_0x01b1('0xc'),auth['isAuthenticated'](),controller[_0x01b1('0xd')]);router[_0x01b1('0xe')]('/',auth[_0x01b1('0x8')](),controller['create']);router[_0x01b1('0xf')](_0x01b1('0xc'),auth[_0x01b1('0x8')](),controller['update']);router[_0x01b1('0x10')](_0x01b1('0xc'),auth['isAuthenticated'](),controller[_0x01b1('0x11')]);module[_0x01b1('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 62cdb6d..66519a4 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 _0x3710=['DATE','moment','STRING'];(function(_0x1d1ce2,_0x11ba1d){var _0x357e03=function(_0x34e55a){while(--_0x34e55a){_0x1d1ce2['push'](_0x1d1ce2['shift']());}};_0x357e03(++_0x11ba1d);}(_0x3710,0x17e));var _0x0371=function(_0x4b437d,_0x51446d){_0x4b437d=_0x4b437d-0x0;var _0x4822e3=_0x3710[_0x4b437d];return _0x4822e3;};'use strict';var moment=require(_0x0371('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0371('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0371('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0371('0x2')]},'acceptAt':{'type':Sequelize[_0x0371('0x2')]},'exitAt':{'type':Sequelize[_0x0371('0x2')]},'reason':{'type':Sequelize[_0x0371('0x1')]}}; \ No newline at end of file +var _0x60b0=['sequelize','exports','STRING','DATE','moment'];(function(_0x49058d,_0x3ef29d){var _0x46ff41=function(_0x38a00f){while(--_0x38a00f){_0x49058d['push'](_0x49058d['shift']());}};_0x46ff41(++_0x3ef29d);}(_0x60b0,0x77));var _0x060b=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x60b0[_0x5f0501];return _0x3c2c45;};'use strict';var moment=require(_0x060b('0x0'));var Sequelize=require(_0x060b('0x1'));module[_0x060b('0x2')]={'uniqueid':{'type':Sequelize[_0x060b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x060b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x060b('0x4')]},'acceptAt':{'type':Sequelize[_0x060b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'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 0a04a85..d34a70d 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 _0x3c01=['destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','status','set','Content-Range','json','apply','reject','update','then'];(function(_0x331cdd,_0x54a027){var _0xfaa28=function(_0x2b94f5){while(--_0x2b94f5){_0x331cdd['push'](_0x331cdd['shift']());}};_0xfaa28(++_0x54a027);}(_0x3c01,0x1a3));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13c0('0x0'));var zipdir=require(_0x13c0('0x1'));var jsonpatch=require(_0x13c0('0x2'));var rp=require(_0x13c0('0x3'));var moment=require('moment');var BPromise=require(_0x13c0('0x4'));var Mustache=require(_0x13c0('0x5'));var util=require(_0x13c0('0x6'));var path=require(_0x13c0('0x7'));var sox=require('sox');var csv=require(_0x13c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13c0('0x9'));var _=require(_0x13c0('0xa'));var squel=require(_0x13c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x13c0('0xc'));var deskjs=require(_0x13c0('0xd'));var toCsv=require(_0x13c0('0x8'));var querystring=require(_0x13c0('0xe'));var Papa=require(_0x13c0('0xf'));var Redis=require(_0x13c0('0x10'));var authService=require(_0x13c0('0x11'));var qs=require(_0x13c0('0x12'));var as=require(_0x13c0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13c0('0x14'))(_0x13c0('0x15'));var utils=require(_0x13c0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x13c0('0x17'));var db=require(_0x13c0('0x18'))['db'];function respondWithStatusCode(_0x2acc2c,_0x233610){_0x233610=_0x233610||0xcc;return function(_0x374295){if(_0x374295){return _0x2acc2c['sendStatus'](_0x233610);}return _0x2acc2c['status'](_0x233610)[_0x13c0('0x19')]();};}function respondWithResult(_0x38877e,_0x580712){_0x580712=_0x580712||0xc8;return function(_0x14a32c){if(_0x14a32c){return _0x38877e['status'](_0x580712)['json'](_0x14a32c);}};}function respondWithFilteredResult(_0x274b65,_0x5daa86){return function(_0xbd4b6d){if(_0xbd4b6d){var _0x212a2e=typeof _0x5daa86[_0x13c0('0x1a')]===_0x13c0('0x1b')&&typeof _0x5daa86[_0x13c0('0x1c')]==='undefined';var _0x2d802c=_0xbd4b6d['count'];var _0x31360d=_0x212a2e?0x0:_0x5daa86[_0x13c0('0x1a')];var _0x56725e=_0x212a2e?_0xbd4b6d['count']:_0x5daa86[_0x13c0('0x1a')]+_0x5daa86['limit'];var _0x4ff4d8;if(_0x56725e>=_0x2d802c){_0x56725e=_0x2d802c;_0x4ff4d8=0xc8;}else{_0x4ff4d8=0xce;}_0x274b65[_0x13c0('0x1d')](_0x4ff4d8);return _0x274b65[_0x13c0('0x1e')](_0x13c0('0x1f'),_0x31360d+'-'+_0x56725e+'/'+_0x2d802c)[_0x13c0('0x20')](_0xbd4b6d);}return null;};}function patchUpdates(_0x539bd7){return function(_0x4181bf){try{jsonpatch[_0x13c0('0x21')](_0x4181bf,_0x539bd7,!![]);}catch(_0x3b7270){return BPromise[_0x13c0('0x22')](_0x3b7270);}return _0x4181bf['save']();};}function saveUpdates(_0x3a2a5f,_0x33ce4a){return function(_0x5f4939){if(_0x5f4939){return _0x5f4939[_0x13c0('0x23')](_0x3a2a5f)[_0x13c0('0x24')](function(_0x35a65a){return _0x35a65a;});}return null;};}function removeEntity(_0x377f3f,_0x243ca5){return function(_0x29acbc){if(_0x29acbc){return _0x29acbc[_0x13c0('0x25')]()[_0x13c0('0x24')](function(){_0x377f3f[_0x13c0('0x1d')](0xcc)[_0x13c0('0x19')]();});}};}function handleEntityNotFound(_0x1e8bc8,_0x1d5f2c){return function(_0x1a5a27){if(!_0x1a5a27){_0x1e8bc8[_0x13c0('0x26')](0x194);}return _0x1a5a27;};}function handleError(_0x1dd552,_0x4732c3){_0x4732c3=_0x4732c3||0x1f4;return function(_0x411532){logger[_0x13c0('0x27')](_0x411532[_0x13c0('0x28')]);if(_0x411532[_0x13c0('0x29')]){delete _0x411532[_0x13c0('0x29')];}_0x1dd552[_0x13c0('0x1d')](_0x4732c3)[_0x13c0('0x2a')](_0x411532);};}exports[_0x13c0('0x2b')]=function(_0x130daf,_0x3b78fe){var _0xe14d7c={},_0x36391d={},_0x3ffd3b={'count':0x0,'rows':[]};var _0x273f77=_[_0x13c0('0x2c')](db[_0x13c0('0x2d')]['rawAttributes'],function(_0x22f47d){return{'name':_0x22f47d[_0x13c0('0x2e')],'type':_0x22f47d[_0x13c0('0x2f')]['key']};});_0x36391d[_0x13c0('0x30')]=_[_0x13c0('0x2c')](_0x273f77,_0x13c0('0x29'));_0x36391d[_0x13c0('0x31')]=_[_0x13c0('0x32')](_0x130daf['query']);_0x36391d['filters']=_[_0x13c0('0x33')](_0x36391d[_0x13c0('0x30')],_0x36391d[_0x13c0('0x31')]);_0xe14d7c[_0x13c0('0x34')]=_[_0x13c0('0x33')](_0x36391d[_0x13c0('0x30')],qs[_0x13c0('0x35')](_0x130daf[_0x13c0('0x31')][_0x13c0('0x35')]));_0xe14d7c[_0x13c0('0x34')]=_0xe14d7c[_0x13c0('0x34')][_0x13c0('0x36')]?_0xe14d7c[_0x13c0('0x34')]:_0x36391d[_0x13c0('0x30')];if(!_0x130daf[_0x13c0('0x31')][_0x13c0('0x37')](_0x13c0('0x38'))){_0xe14d7c[_0x13c0('0x1c')]=qs[_0x13c0('0x1c')](_0x130daf['query'][_0x13c0('0x1c')]);_0xe14d7c[_0x13c0('0x1a')]=qs[_0x13c0('0x1a')](_0x130daf[_0x13c0('0x31')][_0x13c0('0x1a')]);}_0xe14d7c[_0x13c0('0x39')]=qs['sort'](_0x130daf[_0x13c0('0x31')][_0x13c0('0x3a')]);_0xe14d7c[_0x13c0('0x3b')]=qs[_0x13c0('0x3c')](_['pick'](_0x130daf[_0x13c0('0x31')],_0x36391d[_0x13c0('0x3c')]),_0x273f77);if(_0x130daf['query'][_0x13c0('0x3d')]){_0xe14d7c[_0x13c0('0x3b')]=_[_0x13c0('0x3e')](_0xe14d7c['where'],{'$or':_[_0x13c0('0x2c')](_0x273f77,function(_0x308155){if(_0x308155[_0x13c0('0x2f')]!==_0x13c0('0x3f')){var _0xfc9d49={};_0xfc9d49[_0x308155['name']]={'$like':'%'+_0x130daf[_0x13c0('0x31')][_0x13c0('0x3d')]+'%'};return _0xfc9d49;}})});}_0xe14d7c=_['merge']({},_0xe14d7c,_0x130daf[_0x13c0('0x40')]);var _0x424b32={'where':_0xe14d7c[_0x13c0('0x3b')]};return db[_0x13c0('0x2d')][_0x13c0('0x41')](_0x424b32)['then'](function(_0x57b2cb){_0x3ffd3b[_0x13c0('0x41')]=_0x57b2cb;if(_0x130daf['query'][_0x13c0('0x42')]){_0xe14d7c['include']=[{'all':!![]}];}return db[_0x13c0('0x2d')][_0x13c0('0x43')](_0xe14d7c);})['then'](function(_0x58096f){_0x3ffd3b[_0x13c0('0x44')]=_0x58096f;return _0x3ffd3b;})['then'](respondWithFilteredResult(_0x3b78fe,_0xe14d7c))[_0x13c0('0x45')](handleError(_0x3b78fe,null));};exports['show']=function(_0x22bf9c,_0x57424b){var _0x46e8d7={'raw':!![],'where':{'id':_0x22bf9c[_0x13c0('0x46')]['id']}},_0x1bded3={};_0x1bded3[_0x13c0('0x30')]=_[_0x13c0('0x32')](db['OpenchannelQueueReport']['rawAttributes']);_0x1bded3['query']=_[_0x13c0('0x32')](_0x22bf9c[_0x13c0('0x31')]);_0x1bded3[_0x13c0('0x3c')]=_[_0x13c0('0x33')](_0x1bded3['model'],_0x1bded3[_0x13c0('0x31')]);_0x46e8d7[_0x13c0('0x34')]=_[_0x13c0('0x33')](_0x1bded3[_0x13c0('0x30')],qs[_0x13c0('0x35')](_0x22bf9c[_0x13c0('0x31')][_0x13c0('0x35')]));_0x46e8d7[_0x13c0('0x34')]=_0x46e8d7[_0x13c0('0x34')][_0x13c0('0x36')]?_0x46e8d7['attributes']:_0x1bded3['model'];if(_0x22bf9c[_0x13c0('0x31')][_0x13c0('0x42')]){_0x46e8d7[_0x13c0('0x47')]=[{'all':!![]}];}_0x46e8d7=_[_0x13c0('0x3e')]({},_0x46e8d7,_0x22bf9c[_0x13c0('0x40')]);return db[_0x13c0('0x2d')][_0x13c0('0x48')](_0x46e8d7)[_0x13c0('0x24')](handleEntityNotFound(_0x57424b,null))[_0x13c0('0x24')](respondWithResult(_0x57424b,null))[_0x13c0('0x45')](handleError(_0x57424b,null));};exports[_0x13c0('0x49')]=function(_0x485aa4,_0xf29b30){return db[_0x13c0('0x2d')]['create'](_0x485aa4['body'],{})['then'](respondWithResult(_0xf29b30,0xc9))[_0x13c0('0x45')](handleError(_0xf29b30,null));};exports[_0x13c0('0x23')]=function(_0xba1843,_0x20f771){if(_0xba1843['body']['id']){delete _0xba1843[_0x13c0('0x4a')]['id'];}return db[_0x13c0('0x2d')][_0x13c0('0x48')]({'where':{'id':_0xba1843[_0x13c0('0x46')]['id']}})[_0x13c0('0x24')](handleEntityNotFound(_0x20f771,null))[_0x13c0('0x24')](saveUpdates(_0xba1843[_0x13c0('0x4a')],null))['then'](respondWithResult(_0x20f771,null))[_0x13c0('0x45')](handleError(_0x20f771,null));};exports[_0x13c0('0x25')]=function(_0x11dc79,_0x5c8617){return db[_0x13c0('0x2d')]['find']({'where':{'id':_0x11dc79['params']['id']}})['then'](handleEntityNotFound(_0x5c8617,null))['then'](removeEntity(_0x5c8617,null))[_0x13c0('0x45')](handleError(_0x5c8617,null));};exports['describe']=function(_0xc2b90f,_0x54e3e8){return db['OpenchannelQueueReport'][_0x13c0('0x4b')]()['then'](respondWithResult(_0x54e3e8,null))['catch'](handleError(_0x54e3e8,null));}; \ No newline at end of file +var _0xaebd=['rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x188128,_0xc8a300){var _0x367d22=function(_0x504d1d){while(--_0x504d1d){_0x188128['push'](_0x188128['shift']());}};_0x367d22(++_0xc8a300);}(_0xaebd,0x17b));var _0xdaeb=function(_0x341466,_0x52f2b0){_0x341466=_0x341466-0x0;var _0x2248a0=_0xaebd[_0x341466];return _0x2248a0;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require(_0xdaeb('0x1'));var zipdir=require(_0xdaeb('0x2'));var jsonpatch=require(_0xdaeb('0x3'));var rp=require(_0xdaeb('0x4'));var moment=require(_0xdaeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x6'));var util=require(_0xdaeb('0x7'));var path=require(_0xdaeb('0x8'));var sox=require('sox');var csv=require(_0xdaeb('0x9'));var ejs=require(_0xdaeb('0xa'));var fs=require('fs');var fs_extra=require(_0xdaeb('0xb'));var _=require(_0xdaeb('0xc'));var squel=require(_0xdaeb('0xd'));var crypto=require('crypto');var jsforce=require(_0xdaeb('0xe'));var deskjs=require(_0xdaeb('0xf'));var toCsv=require(_0xdaeb('0x9'));var querystring=require(_0xdaeb('0x10'));var Papa=require(_0xdaeb('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdaeb('0x12'));var hardwareService=require(_0xdaeb('0x13'));var logger=require(_0xdaeb('0x14'))(_0xdaeb('0x15'));var utils=require(_0xdaeb('0x16'));var config=require(_0xdaeb('0x17'));var licenseUtil=require(_0xdaeb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e0ef,_0x8ef751){_0x8ef751=_0x8ef751||0xcc;return function(_0xc48937){if(_0xc48937){return _0x19e0ef[_0xdaeb('0x19')](_0x8ef751);}return _0x19e0ef[_0xdaeb('0x1a')](_0x8ef751)['end']();};}function respondWithResult(_0xa40f0f,_0x19a6a2){_0x19a6a2=_0x19a6a2||0xc8;return function(_0x56e015){if(_0x56e015){return _0xa40f0f[_0xdaeb('0x1a')](_0x19a6a2)[_0xdaeb('0x1b')](_0x56e015);}};}function respondWithFilteredResult(_0x5a7f04,_0x3f0575){return function(_0x1659b5){if(_0x1659b5){var _0x2285dc=typeof _0x3f0575[_0xdaeb('0x1c')]===_0xdaeb('0x1d')&&typeof _0x3f0575['limit']===_0xdaeb('0x1d');var _0x63036c=_0x1659b5['count'];var _0x114d60=_0x2285dc?0x0:_0x3f0575[_0xdaeb('0x1c')];var _0x4ba793=_0x2285dc?_0x1659b5[_0xdaeb('0x1e')]:_0x3f0575[_0xdaeb('0x1c')]+_0x3f0575[_0xdaeb('0x1f')];var _0x44ad78;if(_0x4ba793>=_0x63036c){_0x4ba793=_0x63036c;_0x44ad78=0xc8;}else{_0x44ad78=0xce;}_0x5a7f04[_0xdaeb('0x1a')](_0x44ad78);return _0x5a7f04[_0xdaeb('0x20')]('Content-Range',_0x114d60+'-'+_0x4ba793+'/'+_0x63036c)['json'](_0x1659b5);}return null;};}function patchUpdates(_0x4987fc){return function(_0x3ea449){try{jsonpatch['apply'](_0x3ea449,_0x4987fc,!![]);}catch(_0x4a564d){return BPromise[_0xdaeb('0x21')](_0x4a564d);}return _0x3ea449[_0xdaeb('0x22')]();};}function saveUpdates(_0x598dc1,_0x1163ca){return function(_0x1dd54b){if(_0x1dd54b){return _0x1dd54b[_0xdaeb('0x23')](_0x598dc1)[_0xdaeb('0x24')](function(_0x1fd72b){return _0x1fd72b;});}return null;};}function removeEntity(_0x931a7b,_0x2b16b4){return function(_0x2f7f62){if(_0x2f7f62){return _0x2f7f62[_0xdaeb('0x25')]()[_0xdaeb('0x24')](function(){_0x931a7b[_0xdaeb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27739b,_0xdd68e6){return function(_0xc45e40){if(!_0xc45e40){_0x27739b[_0xdaeb('0x19')](0x194);}return _0xc45e40;};}function handleError(_0x4993f3,_0x5882ff){_0x5882ff=_0x5882ff||0x1f4;return function(_0x5805cc){logger['error'](_0x5805cc[_0xdaeb('0x26')]);if(_0x5805cc['name']){delete _0x5805cc[_0xdaeb('0x27')];}_0x4993f3[_0xdaeb('0x1a')](_0x5882ff)[_0xdaeb('0x28')](_0x5805cc);};}exports[_0xdaeb('0x29')]=function(_0x4f4327,_0x31d07c){var _0x509df9={},_0x31b52e={},_0x17dbf0={'count':0x0,'rows':[]};var _0x1d40aa=_[_0xdaeb('0x2a')](db[_0xdaeb('0x2b')][_0xdaeb('0x2c')],function(_0x182ced){return{'name':_0x182ced[_0xdaeb('0x2d')],'type':_0x182ced[_0xdaeb('0x2e')][_0xdaeb('0x2f')]};});_0x31b52e[_0xdaeb('0x30')]=_[_0xdaeb('0x2a')](_0x1d40aa,_0xdaeb('0x27'));_0x31b52e[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x4f4327[_0xdaeb('0x31')]);_0x31b52e[_0xdaeb('0x33')]=_[_0xdaeb('0x34')](_0x31b52e[_0xdaeb('0x30')],_0x31b52e['query']);_0x509df9[_0xdaeb('0x35')]=_['intersection'](_0x31b52e[_0xdaeb('0x30')],qs['fields'](_0x4f4327['query']['fields']));_0x509df9[_0xdaeb('0x35')]=_0x509df9[_0xdaeb('0x35')][_0xdaeb('0x36')]?_0x509df9[_0xdaeb('0x35')]:_0x31b52e[_0xdaeb('0x30')];if(!_0x4f4327[_0xdaeb('0x31')]['hasOwnProperty'](_0xdaeb('0x37'))){_0x509df9[_0xdaeb('0x1f')]=qs[_0xdaeb('0x1f')](_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x1f')]);_0x509df9[_0xdaeb('0x1c')]=qs['offset'](_0x4f4327[_0xdaeb('0x31')]['offset']);}_0x509df9[_0xdaeb('0x38')]=qs[_0xdaeb('0x39')](_0x4f4327['query'][_0xdaeb('0x39')]);_0x509df9['where']=qs[_0xdaeb('0x33')](_['pick'](_0x4f4327[_0xdaeb('0x31')],_0x31b52e[_0xdaeb('0x33')]),_0x1d40aa);if(_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3a')]){_0x509df9[_0xdaeb('0x3b')]=_[_0xdaeb('0x3c')](_0x509df9[_0xdaeb('0x3b')],{'$or':_['map'](_0x1d40aa,function(_0x1526f8){if(_0x1526f8[_0xdaeb('0x2e')]!==_0xdaeb('0x3d')){var _0x2b20d5={};_0x2b20d5[_0x1526f8['name']]={'$like':'%'+_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3a')]+'%'};return _0x2b20d5;}})});}_0x509df9=_[_0xdaeb('0x3c')]({},_0x509df9,_0x4f4327[_0xdaeb('0x3e')]);var _0x311874={'where':_0x509df9[_0xdaeb('0x3b')]};return db[_0xdaeb('0x2b')][_0xdaeb('0x1e')](_0x311874)['then'](function(_0x3808d1){_0x17dbf0[_0xdaeb('0x1e')]=_0x3808d1;if(_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3f')]){_0x509df9[_0xdaeb('0x40')]=[{'all':!![]}];}return db[_0xdaeb('0x2b')]['findAll'](_0x509df9);})[_0xdaeb('0x24')](function(_0xf570ba){_0x17dbf0[_0xdaeb('0x41')]=_0xf570ba;return _0x17dbf0;})[_0xdaeb('0x24')](respondWithFilteredResult(_0x31d07c,_0x509df9))[_0xdaeb('0x42')](handleError(_0x31d07c,null));};exports[_0xdaeb('0x43')]=function(_0x57196c,_0x26297f){var _0x3668f0={'raw':!![],'where':{'id':_0x57196c[_0xdaeb('0x44')]['id']}},_0x27ab6d={};_0x27ab6d['model']=_[_0xdaeb('0x32')](db[_0xdaeb('0x2b')]['rawAttributes']);_0x27ab6d[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x57196c['query']);_0x27ab6d[_0xdaeb('0x33')]=_[_0xdaeb('0x34')](_0x27ab6d['model'],_0x27ab6d[_0xdaeb('0x31')]);_0x3668f0[_0xdaeb('0x35')]=_[_0xdaeb('0x34')](_0x27ab6d[_0xdaeb('0x30')],qs['fields'](_0x57196c[_0xdaeb('0x31')][_0xdaeb('0x45')]));_0x3668f0[_0xdaeb('0x35')]=_0x3668f0[_0xdaeb('0x35')][_0xdaeb('0x36')]?_0x3668f0[_0xdaeb('0x35')]:_0x27ab6d['model'];if(_0x57196c['query'][_0xdaeb('0x3f')]){_0x3668f0['include']=[{'all':!![]}];}_0x3668f0=_[_0xdaeb('0x3c')]({},_0x3668f0,_0x57196c[_0xdaeb('0x3e')]);return db[_0xdaeb('0x2b')][_0xdaeb('0x46')](_0x3668f0)[_0xdaeb('0x24')](handleEntityNotFound(_0x26297f,null))[_0xdaeb('0x24')](respondWithResult(_0x26297f,null))[_0xdaeb('0x42')](handleError(_0x26297f,null));};exports[_0xdaeb('0x47')]=function(_0x2c6884,_0xe7f505){return db['OpenchannelQueueReport'][_0xdaeb('0x47')](_0x2c6884[_0xdaeb('0x48')],{})[_0xdaeb('0x24')](respondWithResult(_0xe7f505,0xc9))[_0xdaeb('0x42')](handleError(_0xe7f505,null));};exports[_0xdaeb('0x23')]=function(_0x473f83,_0x3b21f7){if(_0x473f83[_0xdaeb('0x48')]['id']){delete _0x473f83[_0xdaeb('0x48')]['id'];}return db['OpenchannelQueueReport'][_0xdaeb('0x46')]({'where':{'id':_0x473f83[_0xdaeb('0x44')]['id']}})[_0xdaeb('0x24')](handleEntityNotFound(_0x3b21f7,null))[_0xdaeb('0x24')](saveUpdates(_0x473f83[_0xdaeb('0x48')],null))['then'](respondWithResult(_0x3b21f7,null))[_0xdaeb('0x42')](handleError(_0x3b21f7,null));};exports[_0xdaeb('0x25')]=function(_0x559a3f,_0x3b95fd){return db[_0xdaeb('0x2b')][_0xdaeb('0x46')]({'where':{'id':_0x559a3f['params']['id']}})[_0xdaeb('0x24')](handleEntityNotFound(_0x3b95fd,null))[_0xdaeb('0x24')](removeEntity(_0x3b95fd,null))[_0xdaeb('0x42')](handleError(_0x3b95fd,null));};exports[_0xdaeb('0x49')]=function(_0x5d9ccd,_0x17a113){return db[_0xdaeb('0x2b')][_0xdaeb('0x49')]()[_0xdaeb('0x24')](respondWithResult(_0x17a113,null))[_0xdaeb('0x42')](handleError(_0x17a113,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4ff6610..78d821a 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2c6706,_0x21bb65){var _0x2f2930=function(_0x504c71){while(--_0x504c71){_0x2c6706['push'](_0x2c6706['shift']());}};_0x2f2930(++_0x21bb65);}(_0x1261,0x144));var _0x1126=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x1261[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x4c2709,_0x4ebcdc){var _0x534ce1=function(_0x34b005){while(--_0x34b005){_0x4c2709['push'](_0x4c2709['shift']());}};_0x534ce1(++_0x4ebcdc);}(_0x326f,0xd1));var _0xf326=function(_0x2d7f3a,_0x37fb7b){_0x2d7f3a=_0x2d7f3a-0x0;var _0x57a9e4=_0x326f[_0x2d7f3a];return _0x57a9e4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5fec54b..a02678c 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 _0x2b65=['jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x2b65,0x131));var _0x52b6=function(_0x276232,_0x20b6b8){_0x276232=_0x276232-0x0;var _0x427024=_0x2b65[_0x276232];return _0x427024;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}exports[_0x52b6('0x18')]=function(_0x2fa3ed){var _0x9bab0a=this;return new Promise(function(_0x47d203,_0x36d376){return db[_0x52b6('0x19')]['create'](_0x2fa3ed['body'],{'raw':_0x2fa3ed[_0x52b6('0x1a')]?_0x2fa3ed['options'][_0x52b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2e472f){logger[_0x52b6('0xe')](_0x52b6('0x18'),_0x2fa3ed);logger[_0x52b6('0x10')]('CreateOpenchannelQueueReport',_0x2fa3ed,JSON[_0x52b6('0x1c')](_0x2e472f));_0x47d203(_0x2e472f);})[_0x52b6('0x17')](function(_0x1246db){logger[_0x52b6('0x12')](_0x52b6('0x18'),_0x1246db[_0x52b6('0x15')],_0x2fa3ed);_0x36d376(_0x9bab0a[_0x52b6('0x12')](0x1f4,_0x1246db[_0x52b6('0x15')]));});});};exports[_0x52b6('0x1d')]=function(_0x55aa4c){var _0x2a97c0=this;return new Promise(function(_0x2ff6f4,_0x3a2fb0){return db[_0x52b6('0x19')][_0x52b6('0x1e')](_0x55aa4c[_0x52b6('0x1f')],{'raw':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x20')]||null:null,'attributes':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x21')]||null:null,'limit':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c['options'][_0x52b6('0x22')]||null:null})[_0x52b6('0xd')](function(_0x1716b6){logger[_0x52b6('0xe')](_0x52b6('0x1d'),_0x55aa4c);logger[_0x52b6('0x10')](_0x52b6('0x1d'),_0x55aa4c,JSON['stringify'](_0x1716b6));_0x2ff6f4(_0x1716b6);})[_0x52b6('0x17')](function(_0x42ac9b){logger['error'](_0x52b6('0x1d'),_0x42ac9b[_0x52b6('0x15')],_0x55aa4c);_0x3a2fb0(_0x2a97c0[_0x52b6('0x12')](0x1f4,_0x42ac9b[_0x52b6('0x15')]));});});}; \ No newline at end of file +var _0x0447=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','raw','then','UpdateOpenchannelQueueReport','update','body','options','where','attributes','limit','catch','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0447,0x8b));var _0x7044=function(_0x3599fc,_0x5455e8){_0x3599fc=_0x3599fc-0x0;var _0x5991c7=_0x0447[_0x3599fc];return _0x5991c7;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rs=require(_0x7044('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7044('0x5'))['db'];var utils=require(_0x7044('0x6'));var logger=require(_0x7044('0x7'))(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require(_0x7044('0xa'));var client=jayson[_0x7044('0xb')][_0x7044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b8cb,_0x51de50,_0x72d341){return new BPromise(function(_0x42d53b,_0x2a2b36){return client[_0x7044('0xd')](_0x66b8cb,_0x72d341)['then'](function(_0x41616d){logger[_0x7044('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x51de50,_0x7044('0xf'));logger[_0x7044('0x10')](_0x7044('0x11'),_0x51de50,_0x7044('0xf'),JSON['stringify'](_0x41616d));if(_0x41616d[_0x7044('0x12')]){if(_0x41616d['error']['code']===0x1f4){logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')][_0x7044('0x14')]);return _0x2a2b36(_0x41616d[_0x7044('0x12')]['message']);}logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')]['message']);return _0x42d53b(_0x41616d['error'][_0x7044('0x14')]);}else{logger[_0x7044('0xe')](_0x7044('0x13'),_0x51de50,_0x7044('0xf'));_0x42d53b(_0x41616d[_0x7044('0x15')][_0x7044('0x14')]);}})['catch'](function(_0xdae8a){logger[_0x7044('0x12')](_0x7044('0x13'),_0x51de50,_0xdae8a);_0x2a2b36(_0xdae8a);});});}exports[_0x7044('0x16')]=function(_0x219486){var _0x3f373c=this;return new Promise(function(_0x4df89b,_0x1f300e){return db[_0x7044('0x17')][_0x7044('0x18')](_0x219486['body'],{'raw':_0x219486['options']?_0x219486['options'][_0x7044('0x19')]===undefined?!![]:![]:!![]})[_0x7044('0x1a')](function(_0x2c5dcb){logger[_0x7044('0xe')](_0x7044('0x16'),_0x219486);logger['debug'](_0x7044('0x16'),_0x219486,JSON['stringify'](_0x2c5dcb));_0x4df89b(_0x2c5dcb);})['catch'](function(_0x3db88b){logger[_0x7044('0x12')](_0x7044('0x16'),_0x3db88b[_0x7044('0x14')],_0x219486);_0x1f300e(_0x3f373c[_0x7044('0x12')](0x1f4,_0x3db88b[_0x7044('0x14')]));});});};exports[_0x7044('0x1b')]=function(_0x9452a1){var _0x4271b5=this;return new Promise(function(_0x5e2c9a,_0x5d7d8a){return db[_0x7044('0x17')][_0x7044('0x1c')](_0x9452a1[_0x7044('0x1d')],{'raw':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x1f')]||null:null,'attributes':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x20')]||null:null,'limit':_0x9452a1['options']?_0x9452a1[_0x7044('0x1e')][_0x7044('0x21')]||null:null})[_0x7044('0x1a')](function(_0x1a75ff){logger['info'](_0x7044('0x1b'),_0x9452a1);logger['debug']('UpdateOpenchannelQueueReport',_0x9452a1,JSON['stringify'](_0x1a75ff));_0x5e2c9a(_0x1a75ff);})[_0x7044('0x22')](function(_0x55ea91){logger[_0x7044('0x12')](_0x7044('0x1b'),_0x55ea91['message'],_0x9452a1);_0x5d7d8a(_0x4271b5['error'](0x1f4,_0x55ea91[_0x7044('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 04308ba..80ca362 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 _0xf46d=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x20ab29,_0x12dfdc){var _0x5406e4=function(_0xab5b9c){while(--_0xab5b9c){_0x20ab29['push'](_0x20ab29['shift']());}};_0x5406e4(++_0x12dfdc);}(_0xf46d,0x140));var _0xdf46=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0xf46d[_0x55c00d];return _0x254a8f;};'use strict';var multer=require(_0xdf46('0x0'));var util=require(_0xdf46('0x1'));var path=require('path');var timeout=require(_0xdf46('0x2'));var express=require(_0xdf46('0x3'));var router=express[_0xdf46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf46('0x5'));var interaction=require(_0xdf46('0x6'));var config=require(_0xdf46('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xdf46('0x8')]('/',auth[_0xdf46('0x9')](),controller['index']);router[_0xdf46('0x8')](_0xdf46('0xa'),auth['isAuthenticated'](),controller[_0xdf46('0xb')]);router[_0xdf46('0x8')]('/:id',auth[_0xdf46('0x9')](),controller[_0xdf46('0xc')]);router[_0xdf46('0xd')]('/',auth[_0xdf46('0x9')](),controller[_0xdf46('0xe')]);router[_0xdf46('0xf')](_0xdf46('0x10'),auth[_0xdf46('0x9')](),controller['update']);router[_0xdf46('0x11')](_0xdf46('0x10'),auth[_0xdf46('0x9')](),controller[_0xdf46('0x12')]);module[_0xdf46('0x13')]=router; \ No newline at end of file +var _0x2fe8=['post','create','put','/:id','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2fe8,0xfd));var _0x82fe=function(_0x456465,_0x3b6929){_0x456465=_0x456465-0x0;var _0x208338=_0x2fe8[_0x456465];return _0x208338;};'use strict';var multer=require('multer');var util=require(_0x82fe('0x0'));var path=require(_0x82fe('0x1'));var timeout=require(_0x82fe('0x2'));var express=require(_0x82fe('0x3'));var router=express['Router']();var fs_extra=require(_0x82fe('0x4'));var auth=require(_0x82fe('0x5'));var interaction=require(_0x82fe('0x6'));var config=require('../../config/environment');var controller=require(_0x82fe('0x7'));router[_0x82fe('0x8')]('/',auth[_0x82fe('0x9')](),controller[_0x82fe('0xa')]);router[_0x82fe('0x8')](_0x82fe('0xb'),auth[_0x82fe('0x9')](),controller[_0x82fe('0xc')]);router[_0x82fe('0x8')]('/:id',auth[_0x82fe('0x9')](),controller['show']);router[_0x82fe('0xd')]('/',auth[_0x82fe('0x9')](),controller[_0x82fe('0xe')]);router[_0x82fe('0xf')](_0x82fe('0x10'),auth[_0x82fe('0x9')](),controller[_0x82fe('0x11')]);router[_0x82fe('0x12')](_0x82fe('0x10'),auth[_0x82fe('0x9')](),controller['destroy']);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 4065aaa..3d89113 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4d8199,_0x2ff8af){var _0x356a64=function(_0x45060a){while(--_0x45060a){_0x4d8199['push'](_0x4d8199['shift']());}};_0x356a64(++_0x2ff8af);}(_0xaa88,0x137));var _0x8aa8=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0xaa88[_0x2fdce0];return _0x36f07e;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4841da,_0x1a5d31){var _0x8befd1=function(_0x17c9fc){while(--_0x17c9fc){_0x4841da['push'](_0x4841da['shift']());}};_0x8befd1(++_0x1a5d31);}(_0x34e8,0x12c));var _0x834e=function(_0x334117,_0x358db7){_0x334117=_0x334117-0x0;var _0x158162=_0x34e8[_0x334117];return _0x158162;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1b04a2e..f222e3b 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 _0x67d3=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','OpenchannelTransferReport','catch','show','params','keys','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x67d3,0x1a4));var _0x367d=function(_0x4e648d,_0x37d3ce){_0x4e648d=_0x4e648d-0x0;var _0x2d229d=_0x67d3[_0x4e648d];return _0x2d229d;};'use strict';var emlformat=require(_0x367d('0x0'));var rimraf=require(_0x367d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x367d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x367d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x367d('0x4'));var csv=require(_0x367d('0x5'));var ejs=require(_0x367d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x367d('0x7'));var squel=require(_0x367d('0x8'));var crypto=require(_0x367d('0x9'));var jsforce=require(_0x367d('0xa'));var deskjs=require(_0x367d('0xb'));var toCsv=require(_0x367d('0x5'));var querystring=require(_0x367d('0xc'));var Papa=require(_0x367d('0xd'));var Redis=require('ioredis');var authService=require(_0x367d('0xe'));var qs=require(_0x367d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x367d('0x10'));var logger=require('../../config/logger')(_0x367d('0x11'));var utils=require(_0x367d('0x12'));var config=require(_0x367d('0x13'));var licenseUtil=require(_0x367d('0x14'));var db=require(_0x367d('0x15'))['db'];function respondWithStatusCode(_0x51d77c,_0x3c7ef0){_0x3c7ef0=_0x3c7ef0||0xcc;return function(_0x54193b){if(_0x54193b){return _0x51d77c[_0x367d('0x16')](_0x3c7ef0);}return _0x51d77c[_0x367d('0x17')](_0x3c7ef0)[_0x367d('0x18')]();};}function respondWithResult(_0x510138,_0x41bb9f){_0x41bb9f=_0x41bb9f||0xc8;return function(_0x24c0e9){if(_0x24c0e9){return _0x510138['status'](_0x41bb9f)[_0x367d('0x19')](_0x24c0e9);}};}function respondWithFilteredResult(_0x9ef726,_0xe7885d){return function(_0x5a9ecf){if(_0x5a9ecf){var _0x4a26b9=typeof _0xe7885d[_0x367d('0x1a')]===_0x367d('0x1b')&&typeof _0xe7885d[_0x367d('0x1c')]===_0x367d('0x1b');var _0x514435=_0x5a9ecf[_0x367d('0x1d')];var _0x52c19b=_0x4a26b9?0x0:_0xe7885d[_0x367d('0x1a')];var _0xea6af4=_0x4a26b9?_0x5a9ecf[_0x367d('0x1d')]:_0xe7885d[_0x367d('0x1a')]+_0xe7885d[_0x367d('0x1c')];var _0x4b7c0c;if(_0xea6af4>=_0x514435){_0xea6af4=_0x514435;_0x4b7c0c=0xc8;}else{_0x4b7c0c=0xce;}_0x9ef726['status'](_0x4b7c0c);return _0x9ef726[_0x367d('0x1e')](_0x367d('0x1f'),_0x52c19b+'-'+_0xea6af4+'/'+_0x514435)[_0x367d('0x19')](_0x5a9ecf);}return null;};}function patchUpdates(_0x225e10){return function(_0x3de75a){try{jsonpatch[_0x367d('0x20')](_0x3de75a,_0x225e10,!![]);}catch(_0x46f69c){return BPromise[_0x367d('0x21')](_0x46f69c);}return _0x3de75a[_0x367d('0x22')]();};}function saveUpdates(_0x1d7888,_0x35de8b){return function(_0x211db6){if(_0x211db6){return _0x211db6[_0x367d('0x23')](_0x1d7888)[_0x367d('0x24')](function(_0x43f73b){return _0x43f73b;});}return null;};}function removeEntity(_0x3f6b5d,_0x5d377b){return function(_0x258096){if(_0x258096){return _0x258096[_0x367d('0x25')]()[_0x367d('0x24')](function(){_0x3f6b5d[_0x367d('0x17')](0xcc)[_0x367d('0x18')]();});}};}function handleEntityNotFound(_0x320c9d,_0x3df218){return function(_0x2b33fa){if(!_0x2b33fa){_0x320c9d[_0x367d('0x16')](0x194);}return _0x2b33fa;};}function handleError(_0x10bc47,_0xd279aa){_0xd279aa=_0xd279aa||0x1f4;return function(_0x3e2d7e){logger[_0x367d('0x26')](_0x3e2d7e['stack']);if(_0x3e2d7e[_0x367d('0x27')]){delete _0x3e2d7e['name'];}_0x10bc47[_0x367d('0x17')](_0xd279aa)[_0x367d('0x28')](_0x3e2d7e);};}exports[_0x367d('0x29')]=function(_0x5efc97,_0x5f67fc){var _0x1f89ff={},_0x152f40={},_0x4bb67f={'count':0x0,'rows':[]};var _0x5b4022=_[_0x367d('0x2a')](db['OpenchannelTransferReport']['rawAttributes'],function(_0xe83aa1){return{'name':_0xe83aa1[_0x367d('0x2b')],'type':_0xe83aa1[_0x367d('0x2c')][_0x367d('0x2d')]};});_0x152f40['model']=_['map'](_0x5b4022,'name');_0x152f40[_0x367d('0x2e')]=_['keys'](_0x5efc97[_0x367d('0x2e')]);_0x152f40['filters']=_[_0x367d('0x2f')](_0x152f40[_0x367d('0x30')],_0x152f40['query']);_0x1f89ff[_0x367d('0x31')]=_['intersection'](_0x152f40[_0x367d('0x30')],qs[_0x367d('0x32')](_0x5efc97[_0x367d('0x2e')]['fields']));_0x1f89ff['attributes']=_0x1f89ff[_0x367d('0x31')][_0x367d('0x33')]?_0x1f89ff['attributes']:_0x152f40[_0x367d('0x30')];if(!_0x5efc97[_0x367d('0x2e')][_0x367d('0x34')](_0x367d('0x35'))){_0x1f89ff[_0x367d('0x1c')]=qs[_0x367d('0x1c')](_0x5efc97[_0x367d('0x2e')]['limit']);_0x1f89ff['offset']=qs[_0x367d('0x1a')](_0x5efc97[_0x367d('0x2e')][_0x367d('0x1a')]);}_0x1f89ff[_0x367d('0x36')]=qs[_0x367d('0x37')](_0x5efc97[_0x367d('0x2e')]['sort']);_0x1f89ff[_0x367d('0x38')]=qs[_0x367d('0x39')](_[_0x367d('0x3a')](_0x5efc97['query'],_0x152f40['filters']),_0x5b4022);if(_0x5efc97[_0x367d('0x2e')]['filter']){_0x1f89ff['where']=_[_0x367d('0x3b')](_0x1f89ff[_0x367d('0x38')],{'$or':_[_0x367d('0x2a')](_0x5b4022,function(_0x410ed5){if(_0x410ed5[_0x367d('0x2c')]!==_0x367d('0x3c')){var _0x24e612={};_0x24e612[_0x410ed5[_0x367d('0x27')]]={'$like':'%'+_0x5efc97[_0x367d('0x2e')][_0x367d('0x3d')]+'%'};return _0x24e612;}})});}_0x1f89ff=_[_0x367d('0x3b')]({},_0x1f89ff,_0x5efc97['options']);var _0x5e2892={'where':_0x1f89ff[_0x367d('0x38')]};return db['OpenchannelTransferReport'][_0x367d('0x1d')](_0x5e2892)[_0x367d('0x24')](function(_0x1bf717){_0x4bb67f['count']=_0x1bf717;if(_0x5efc97[_0x367d('0x2e')][_0x367d('0x3e')]){_0x1f89ff[_0x367d('0x3f')]=[{'all':!![]}];}return db[_0x367d('0x40')]['findAll'](_0x1f89ff);})[_0x367d('0x24')](function(_0x172659){_0x4bb67f['rows']=_0x172659;return _0x4bb67f;})[_0x367d('0x24')](respondWithFilteredResult(_0x5f67fc,_0x1f89ff))[_0x367d('0x41')](handleError(_0x5f67fc,null));};exports[_0x367d('0x42')]=function(_0x41b8b1,_0x1ffbaa){var _0x20412f={'raw':!![],'where':{'id':_0x41b8b1[_0x367d('0x43')]['id']}},_0x2ef00f={};_0x2ef00f[_0x367d('0x30')]=_[_0x367d('0x44')](db[_0x367d('0x40')]['rawAttributes']);_0x2ef00f[_0x367d('0x2e')]=_[_0x367d('0x44')](_0x41b8b1[_0x367d('0x2e')]);_0x2ef00f[_0x367d('0x39')]=_[_0x367d('0x2f')](_0x2ef00f[_0x367d('0x30')],_0x2ef00f[_0x367d('0x2e')]);_0x20412f[_0x367d('0x31')]=_[_0x367d('0x2f')](_0x2ef00f[_0x367d('0x30')],qs[_0x367d('0x32')](_0x41b8b1['query'][_0x367d('0x32')]));_0x20412f[_0x367d('0x31')]=_0x20412f[_0x367d('0x31')]['length']?_0x20412f['attributes']:_0x2ef00f[_0x367d('0x30')];if(_0x41b8b1[_0x367d('0x2e')][_0x367d('0x3e')]){_0x20412f[_0x367d('0x3f')]=[{'all':!![]}];}_0x20412f=_[_0x367d('0x3b')]({},_0x20412f,_0x41b8b1[_0x367d('0x45')]);return db[_0x367d('0x40')][_0x367d('0x46')](_0x20412f)['then'](handleEntityNotFound(_0x1ffbaa,null))[_0x367d('0x24')](respondWithResult(_0x1ffbaa,null))[_0x367d('0x41')](handleError(_0x1ffbaa,null));};exports[_0x367d('0x47')]=function(_0x3f9178,_0x1e4325){return db[_0x367d('0x40')][_0x367d('0x47')](_0x3f9178[_0x367d('0x48')],{})['then'](respondWithResult(_0x1e4325,0xc9))[_0x367d('0x41')](handleError(_0x1e4325,null));};exports[_0x367d('0x23')]=function(_0x308e7e,_0x50244c){if(_0x308e7e[_0x367d('0x48')]['id']){delete _0x308e7e[_0x367d('0x48')]['id'];}return db[_0x367d('0x40')][_0x367d('0x46')]({'where':{'id':_0x308e7e[_0x367d('0x43')]['id']}})['then'](handleEntityNotFound(_0x50244c,null))[_0x367d('0x24')](saveUpdates(_0x308e7e[_0x367d('0x48')],null))[_0x367d('0x24')](respondWithResult(_0x50244c,null))[_0x367d('0x41')](handleError(_0x50244c,null));};exports[_0x367d('0x25')]=function(_0x51225b,_0x52d00c){return db['OpenchannelTransferReport'][_0x367d('0x46')]({'where':{'id':_0x51225b[_0x367d('0x43')]['id']}})[_0x367d('0x24')](handleEntityNotFound(_0x52d00c,null))['then'](removeEntity(_0x52d00c,null))[_0x367d('0x41')](handleError(_0x52d00c,null));};exports[_0x367d('0x49')]=function(_0x351566,_0x483dbb){return db[_0x367d('0x40')]['describe']()[_0x367d('0x24')](respondWithResult(_0x483dbb,null))[_0x367d('0x41')](handleError(_0x483dbb,null));}; \ No newline at end of file +var _0x519e=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','OpenchannelTransferReport','fieldName','type','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x519e,0x172));var _0xe519=function(_0x526b0e,_0x1e768c){_0x526b0e=_0x526b0e-0x0;var _0x149436=_0x519e[_0x526b0e];return _0x149436;};'use strict';var emlformat=require(_0xe519('0x0'));var rimraf=require(_0xe519('0x1'));var zipdir=require(_0xe519('0x2'));var jsonpatch=require(_0xe519('0x3'));var rp=require(_0xe519('0x4'));var moment=require(_0xe519('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe519('0x6'));var util=require(_0xe519('0x7'));var path=require(_0xe519('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe519('0x9'));var fs=require('fs');var fs_extra=require(_0xe519('0xa'));var _=require(_0xe519('0xb'));var squel=require('squel');var crypto=require(_0xe519('0xc'));var jsforce=require(_0xe519('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe519('0xe'));var querystring=require(_0xe519('0xf'));var Papa=require('papaparse');var Redis=require(_0xe519('0x10'));var authService=require(_0xe519('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe519('0x12'));var hardwareService=require(_0xe519('0x13'));var logger=require(_0xe519('0x14'))(_0xe519('0x15'));var utils=require(_0xe519('0x16'));var config=require(_0xe519('0x17'));var licenseUtil=require(_0xe519('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7bb6,_0x5d4849){_0x5d4849=_0x5d4849||0xcc;return function(_0x174aa0){if(_0x174aa0){return _0x3d7bb6[_0xe519('0x19')](_0x5d4849);}return _0x3d7bb6['status'](_0x5d4849)[_0xe519('0x1a')]();};}function respondWithResult(_0x2342ad,_0x4a6086){_0x4a6086=_0x4a6086||0xc8;return function(_0x41a9b2){if(_0x41a9b2){return _0x2342ad[_0xe519('0x1b')](_0x4a6086)[_0xe519('0x1c')](_0x41a9b2);}};}function respondWithFilteredResult(_0x27b7b3,_0x9ce81){return function(_0x456000){if(_0x456000){var _0x69bedc=typeof _0x9ce81[_0xe519('0x1d')]===_0xe519('0x1e')&&typeof _0x9ce81[_0xe519('0x1f')]===_0xe519('0x1e');var _0x5e1ac1=_0x456000[_0xe519('0x20')];var _0x16753e=_0x69bedc?0x0:_0x9ce81[_0xe519('0x1d')];var _0x31ebfd=_0x69bedc?_0x456000['count']:_0x9ce81['offset']+_0x9ce81[_0xe519('0x1f')];var _0x384869;if(_0x31ebfd>=_0x5e1ac1){_0x31ebfd=_0x5e1ac1;_0x384869=0xc8;}else{_0x384869=0xce;}_0x27b7b3['status'](_0x384869);return _0x27b7b3[_0xe519('0x21')](_0xe519('0x22'),_0x16753e+'-'+_0x31ebfd+'/'+_0x5e1ac1)[_0xe519('0x1c')](_0x456000);}return null;};}function patchUpdates(_0x5d6eaf){return function(_0x244608){try{jsonpatch[_0xe519('0x23')](_0x244608,_0x5d6eaf,!![]);}catch(_0x24e5a5){return BPromise[_0xe519('0x24')](_0x24e5a5);}return _0x244608[_0xe519('0x25')]();};}function saveUpdates(_0x51a7aa,_0xd471d9){return function(_0x72a4cb){if(_0x72a4cb){return _0x72a4cb[_0xe519('0x26')](_0x51a7aa)[_0xe519('0x27')](function(_0x11bf2c){return _0x11bf2c;});}return null;};}function removeEntity(_0x3c9f47,_0x16ec7d){return function(_0x94191c){if(_0x94191c){return _0x94191c[_0xe519('0x28')]()[_0xe519('0x27')](function(){_0x3c9f47[_0xe519('0x1b')](0xcc)[_0xe519('0x1a')]();});}};}function handleEntityNotFound(_0x45924a,_0x502a95){return function(_0x81de04){if(!_0x81de04){_0x45924a[_0xe519('0x19')](0x194);}return _0x81de04;};}function handleError(_0x1a8f87,_0x4a2b4d){_0x4a2b4d=_0x4a2b4d||0x1f4;return function(_0x4fd817){logger[_0xe519('0x29')](_0x4fd817[_0xe519('0x2a')]);if(_0x4fd817['name']){delete _0x4fd817['name'];}_0x1a8f87[_0xe519('0x1b')](_0x4a2b4d)['send'](_0x4fd817);};}exports[_0xe519('0x2b')]=function(_0x49f261,_0x511fd3){var _0x3cbd9b={},_0x4f53b0={},_0x28ea4b={'count':0x0,'rows':[]};var _0x1a24ad=_['map'](db[_0xe519('0x2c')]['rawAttributes'],function(_0x1157bc){return{'name':_0x1157bc[_0xe519('0x2d')],'type':_0x1157bc[_0xe519('0x2e')]['key']};});_0x4f53b0[_0xe519('0x2f')]=_[_0xe519('0x30')](_0x1a24ad,_0xe519('0x31'));_0x4f53b0['query']=_[_0xe519('0x32')](_0x49f261[_0xe519('0x33')]);_0x4f53b0[_0xe519('0x34')]=_[_0xe519('0x35')](_0x4f53b0[_0xe519('0x2f')],_0x4f53b0[_0xe519('0x33')]);_0x3cbd9b[_0xe519('0x36')]=_[_0xe519('0x35')](_0x4f53b0['model'],qs['fields'](_0x49f261[_0xe519('0x33')][_0xe519('0x37')]));_0x3cbd9b[_0xe519('0x36')]=_0x3cbd9b[_0xe519('0x36')][_0xe519('0x38')]?_0x3cbd9b[_0xe519('0x36')]:_0x4f53b0[_0xe519('0x2f')];if(!_0x49f261[_0xe519('0x33')]['hasOwnProperty'](_0xe519('0x39'))){_0x3cbd9b['limit']=qs[_0xe519('0x1f')](_0x49f261[_0xe519('0x33')]['limit']);_0x3cbd9b['offset']=qs[_0xe519('0x1d')](_0x49f261['query'][_0xe519('0x1d')]);}_0x3cbd9b['order']=qs['sort'](_0x49f261[_0xe519('0x33')][_0xe519('0x3a')]);_0x3cbd9b[_0xe519('0x3b')]=qs['filters'](_[_0xe519('0x3c')](_0x49f261['query'],_0x4f53b0['filters']),_0x1a24ad);if(_0x49f261['query'][_0xe519('0x3d')]){_0x3cbd9b[_0xe519('0x3b')]=_['merge'](_0x3cbd9b[_0xe519('0x3b')],{'$or':_[_0xe519('0x30')](_0x1a24ad,function(_0x47d19c){if(_0x47d19c[_0xe519('0x2e')]!=='VIRTUAL'){var _0x2c3589={};_0x2c3589[_0x47d19c[_0xe519('0x31')]]={'$like':'%'+_0x49f261['query'][_0xe519('0x3d')]+'%'};return _0x2c3589;}})});}_0x3cbd9b=_[_0xe519('0x3e')]({},_0x3cbd9b,_0x49f261[_0xe519('0x3f')]);var _0x592c3c={'where':_0x3cbd9b['where']};return db[_0xe519('0x2c')][_0xe519('0x20')](_0x592c3c)[_0xe519('0x27')](function(_0x39dc28){_0x28ea4b[_0xe519('0x20')]=_0x39dc28;if(_0x49f261[_0xe519('0x33')][_0xe519('0x40')]){_0x3cbd9b[_0xe519('0x41')]=[{'all':!![]}];}return db[_0xe519('0x2c')][_0xe519('0x42')](_0x3cbd9b);})['then'](function(_0x33767d){_0x28ea4b['rows']=_0x33767d;return _0x28ea4b;})['then'](respondWithFilteredResult(_0x511fd3,_0x3cbd9b))[_0xe519('0x43')](handleError(_0x511fd3,null));};exports[_0xe519('0x44')]=function(_0x1db306,_0x8a195e){var _0x45ff1c={'raw':!![],'where':{'id':_0x1db306[_0xe519('0x45')]['id']}},_0x30d4ec={};_0x30d4ec[_0xe519('0x2f')]=_['keys'](db['OpenchannelTransferReport'][_0xe519('0x46')]);_0x30d4ec[_0xe519('0x33')]=_[_0xe519('0x32')](_0x1db306[_0xe519('0x33')]);_0x30d4ec[_0xe519('0x34')]=_[_0xe519('0x35')](_0x30d4ec[_0xe519('0x2f')],_0x30d4ec['query']);_0x45ff1c[_0xe519('0x36')]=_[_0xe519('0x35')](_0x30d4ec['model'],qs[_0xe519('0x37')](_0x1db306[_0xe519('0x33')][_0xe519('0x37')]));_0x45ff1c[_0xe519('0x36')]=_0x45ff1c[_0xe519('0x36')][_0xe519('0x38')]?_0x45ff1c[_0xe519('0x36')]:_0x30d4ec['model'];if(_0x1db306['query'][_0xe519('0x40')]){_0x45ff1c[_0xe519('0x41')]=[{'all':!![]}];}_0x45ff1c=_[_0xe519('0x3e')]({},_0x45ff1c,_0x1db306[_0xe519('0x3f')]);return db[_0xe519('0x2c')][_0xe519('0x47')](_0x45ff1c)['then'](handleEntityNotFound(_0x8a195e,null))[_0xe519('0x27')](respondWithResult(_0x8a195e,null))[_0xe519('0x43')](handleError(_0x8a195e,null));};exports[_0xe519('0x48')]=function(_0x1f90a2,_0x254537){return db[_0xe519('0x2c')][_0xe519('0x48')](_0x1f90a2[_0xe519('0x49')],{})[_0xe519('0x27')](respondWithResult(_0x254537,0xc9))[_0xe519('0x43')](handleError(_0x254537,null));};exports[_0xe519('0x26')]=function(_0x488003,_0x39f92a){if(_0x488003['body']['id']){delete _0x488003['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x488003[_0xe519('0x45')]['id']}})[_0xe519('0x27')](handleEntityNotFound(_0x39f92a,null))['then'](saveUpdates(_0x488003[_0xe519('0x49')],null))[_0xe519('0x27')](respondWithResult(_0x39f92a,null))[_0xe519('0x43')](handleError(_0x39f92a,null));};exports[_0xe519('0x28')]=function(_0x1b85d2,_0x33d228){return db[_0xe519('0x2c')][_0xe519('0x47')]({'where':{'id':_0x1b85d2[_0xe519('0x45')]['id']}})[_0xe519('0x27')](handleEntityNotFound(_0x33d228,null))['then'](removeEntity(_0x33d228,null))[_0xe519('0x43')](handleError(_0x33d228,null));};exports['describe']=function(_0x1fe531,_0x1238ce){return db[_0xe519('0x2c')]['describe']()['then'](respondWithResult(_0x1238ce,null))['catch'](handleError(_0x1238ce,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 539b244..0f0ad23 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 _0x9f94=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x239a9b,_0x34fc09){var _0x56d797=function(_0x33f928){while(--_0x33f928){_0x239a9b['push'](_0x239a9b['shift']());}};_0x56d797(++_0x34fc09);}(_0x9f94,0x1c0));var _0x49f9=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9f94[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var logger=require(_0x49f9('0x2'))(_0x49f9('0x3'));var moment=require(_0x49f9('0x4'));var BPromise=require(_0x49f9('0x5'));var rp=require(_0x49f9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49f9('0x7'));var config=require(_0x49f9('0x8'));var attributes=require(_0x49f9('0x9'));module[_0x49f9('0xa')]=function(_0x5a6240,_0x13608d){return _0x5a6240[_0x49f9('0xb')](_0x49f9('0xc'),attributes,{'tableName':_0x49f9('0xd'),'paranoid':![],'indexes':[{'name':_0x49f9('0xe'),'fields':[_0x49f9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7048=['../../config/logger','bluebird','path','rimraf','exports','report_openchannel_transfer','uniqueid','lodash'];(function(_0x1da243,_0xdfdfb8){var _0x3ebf50=function(_0x4b6555){while(--_0x4b6555){_0x1da243['push'](_0x1da243['shift']());}};_0x3ebf50(++_0xdfdfb8);}(_0x7048,0xaf));var _0x8704=function(_0x549c5c,_0x4acd40){_0x549c5c=_0x549c5c-0x0;var _0x2c8a18=_0x7048[_0x549c5c];return _0x2c8a18;};'use strict';var _=require(_0x8704('0x0'));var util=require('util');var logger=require(_0x8704('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8704('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8704('0x3'));var rimraf=require(_0x8704('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x8704('0x5')]=function(_0x10920f,_0x54edad){return _0x10920f['define']('OpenchannelTransferReport',attributes,{'tableName':_0x8704('0x6'),'paranoid':![],'indexes':[{'name':_0x8704('0x7'),'fields':[_0x8704('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 559125b..a5e0f00 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 _0x8784=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x144aab,_0x11101d){var _0xbc43ea=function(_0x557084){while(--_0x557084){_0x144aab['push'](_0x144aab['shift']());}};_0xbc43ea(++_0x11101d);}(_0x8784,0x172));var _0x4878=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x8784[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var moment=require('moment');var BPromise=require(_0x4878('0x2'));var rs=require(_0x4878('0x3'));var fs=require('fs');var Redis=require(_0x4878('0x4'));var db=require(_0x4878('0x5'))['db'];var utils=require(_0x4878('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4878('0x7'));var jayson=require(_0x4878('0x8'));var client=jayson[_0x4878('0x9')][_0x4878('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe22936,_0x4148dd,_0x131e82){return new BPromise(function(_0x35cd6a,_0x29d02e){return client['request'](_0xe22936,_0x131e82)[_0x4878('0xb')](function(_0xfe196b){logger[_0x4878('0xc')](_0x4878('0xd'),_0x4148dd,_0x4878('0xe'));logger[_0x4878('0xf')](_0x4878('0x10'),_0x4148dd,_0x4878('0xe'),JSON[_0x4878('0x11')](_0xfe196b));if(_0xfe196b[_0x4878('0x12')]){if(_0xfe196b[_0x4878('0x12')][_0x4878('0x13')]===0x1f4){logger['error'](_0x4878('0xd'),_0x4148dd,_0xfe196b[_0x4878('0x12')][_0x4878('0x14')]);return _0x29d02e(_0xfe196b['error'][_0x4878('0x14')]);}logger[_0x4878('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4148dd,_0xfe196b[_0x4878('0x12')]['message']);return _0x35cd6a(_0xfe196b['error'][_0x4878('0x14')]);}else{logger[_0x4878('0xc')](_0x4878('0xd'),_0x4148dd,_0x4878('0xe'));_0x35cd6a(_0xfe196b[_0x4878('0x15')]['message']);}})[_0x4878('0x16')](function(_0x25282f){logger['error'](_0x4878('0xd'),_0x4148dd,_0x25282f);_0x29d02e(_0x25282f);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3473d4,_0x3b0da8){_0x3473d4=_0x3473d4-0x0;var _0x53372e=_0x1cb9[_0x3473d4];return _0x53372e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 434fa5d..0068b14 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 _0xaaa2=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','put','update','delete'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0xaaa2,0xac));var _0x2aaa=function(_0x355a8f,_0x1437c9){_0x355a8f=_0x355a8f-0x0;var _0x49c40f=_0xaaa2[_0x355a8f];return _0x49c40f;};'use strict';var multer=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var path=require(_0x2aaa('0x2'));var timeout=require(_0x2aaa('0x3'));var express=require(_0x2aaa('0x4'));var router=express[_0x2aaa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2aaa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2aaa('0x7'));var controller=require(_0x2aaa('0x8'));router[_0x2aaa('0x9')]('/',auth[_0x2aaa('0xa')](),controller[_0x2aaa('0xb')]);router[_0x2aaa('0x9')]('/:id',auth[_0x2aaa('0xa')](),controller['show']);router['post']('/',auth[_0x2aaa('0xa')](),controller['create']);router[_0x2aaa('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x2aaa('0xd')]);router[_0x2aaa('0xe')]('/:id',auth[_0x2aaa('0xa')](),controller[_0x2aaa('0xf')]);module[_0x2aaa('0x10')]=router; \ No newline at end of file +var _0xc6a9=['post','put','update','delete','destroy','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xc6a9,0x140));var _0x9c6a=function(_0x34ae7d,_0x359c6f){_0x34ae7d=_0x34ae7d-0x0;var _0x5d4f3d=_0xc6a9[_0x34ae7d];return _0x5d4f3d;};'use strict';var multer=require('multer');var util=require(_0x9c6a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c6a('0x1')]();var fs_extra=require(_0x9c6a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9c6a('0x3'));var config=require(_0x9c6a('0x4'));var controller=require(_0x9c6a('0x5'));router[_0x9c6a('0x6')]('/',auth[_0x9c6a('0x7')](),controller['index']);router[_0x9c6a('0x6')](_0x9c6a('0x8'),auth[_0x9c6a('0x7')](),controller[_0x9c6a('0x9')]);router[_0x9c6a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c6a('0xb')]('/:id',auth[_0x9c6a('0x7')](),controller[_0x9c6a('0xc')]);router[_0x9c6a('0xd')](_0x9c6a('0x8'),auth[_0x9c6a('0x7')](),controller[_0x9c6a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 243d113..11d329b 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 _0x9342=['STRING','sequelize'];(function(_0x2ac5e5,_0x1909fc){var _0x47f776=function(_0x2eaf5f){while(--_0x2eaf5f){_0x2ac5e5['push'](_0x2ac5e5['shift']());}};_0x47f776(++_0x1909fc);}(_0x9342,0x16f));var _0x2934=function(_0x17965b,_0x99c7fe){_0x17965b=_0x17965b-0x0;var _0xa998bc=_0x9342[_0x17965b];return _0xa998bc;};'use strict';var Sequelize=require(_0x2934('0x0'));module['exports']={'name':{'type':Sequelize[_0x2934('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2934('0x1')]}}; \ No newline at end of file +var _0x8a73=['name','sequelize','exports','STRING'];(function(_0x23b65e,_0x5a54ba){var _0xddd6fd=function(_0x339cfb){while(--_0x339cfb){_0x23b65e['push'](_0x23b65e['shift']());}};_0xddd6fd(++_0x5a54ba);}(_0x8a73,0xe1));var _0x38a7=function(_0x42bd88,_0x2e0120){_0x42bd88=_0x42bd88-0x0;var _0x545142=_0x8a73[_0x42bd88];return _0x545142;};'use strict';var Sequelize=require(_0x38a7('0x0'));module[_0x38a7('0x1')]={'name':{'type':Sequelize[_0x38a7('0x2')],'unique':_0x38a7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x38a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 53d8e1a..75e6b9f 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 _0x56b4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','get','Pauses','UserProfileResource','error','stack','name','index','Pause','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis'];(function(_0x5b110c,_0x1ff704){var _0x272c9c=function(_0x166b13){while(--_0x166b13){_0x5b110c['push'](_0x5b110c['shift']());}};_0x272c9c(++_0x1ff704);}(_0x56b4,0x98));var _0x456b=function(_0x84503,_0x1abf35){_0x84503=_0x84503-0x0;var _0x2edb40=_0x56b4[_0x84503];return _0x2edb40;};'use strict';var emlformat=require(_0x456b('0x0'));var rimraf=require(_0x456b('0x1'));var zipdir=require(_0x456b('0x2'));var jsonpatch=require(_0x456b('0x3'));var rp=require(_0x456b('0x4'));var moment=require(_0x456b('0x5'));var BPromise=require(_0x456b('0x6'));var Mustache=require(_0x456b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x456b('0x8'));var csv=require(_0x456b('0x9'));var ejs=require(_0x456b('0xa'));var fs=require('fs');var fs_extra=require(_0x456b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x456b('0xc'));var jsforce=require(_0x456b('0xd'));var deskjs=require(_0x456b('0xe'));var toCsv=require(_0x456b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x456b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x456b('0x10'));var as=require(_0x456b('0x11'));var hardwareService=require(_0x456b('0x12'));var logger=require('../../config/logger')(_0x456b('0x13'));var utils=require(_0x456b('0x14'));var config=require(_0x456b('0x15'));var licenseUtil=require(_0x456b('0x16'));var db=require(_0x456b('0x17'))['db'];function respondWithStatusCode(_0x16f584,_0x39c410){_0x39c410=_0x39c410||0xcc;return function(_0x310562){if(_0x310562){return _0x16f584[_0x456b('0x18')](_0x39c410);}return _0x16f584[_0x456b('0x19')](_0x39c410)[_0x456b('0x1a')]();};}function respondWithResult(_0x22bee9,_0x5f43cd){_0x5f43cd=_0x5f43cd||0xc8;return function(_0x27f03d){if(_0x27f03d){return _0x22bee9[_0x456b('0x19')](_0x5f43cd)[_0x456b('0x1b')](_0x27f03d);}};}function respondWithFilteredResult(_0x335e58,_0x46db3c){return function(_0x38a714){if(_0x38a714){var _0x30bf27=typeof _0x46db3c[_0x456b('0x1c')]===_0x456b('0x1d')&&typeof _0x46db3c[_0x456b('0x1e')]===_0x456b('0x1d');var _0x1a8629=_0x38a714[_0x456b('0x1f')];var _0x571603=_0x30bf27?0x0:_0x46db3c[_0x456b('0x1c')];var _0x19c6fc=_0x30bf27?_0x38a714['count']:_0x46db3c['offset']+_0x46db3c[_0x456b('0x1e')];var _0x32c505;if(_0x19c6fc>=_0x1a8629){_0x19c6fc=_0x1a8629;_0x32c505=0xc8;}else{_0x32c505=0xce;}_0x335e58[_0x456b('0x19')](_0x32c505);return _0x335e58[_0x456b('0x20')](_0x456b('0x21'),_0x571603+'-'+_0x19c6fc+'/'+_0x1a8629)[_0x456b('0x1b')](_0x38a714);}return null;};}function patchUpdates(_0x1c3f07){return function(_0x137b2d){try{jsonpatch[_0x456b('0x22')](_0x137b2d,_0x1c3f07,!![]);}catch(_0x406e2b){return BPromise['reject'](_0x406e2b);}return _0x137b2d['save']();};}function saveUpdates(_0x151bbe,_0x24b0f1){return function(_0x33cbdb){if(_0x33cbdb){return _0x33cbdb[_0x456b('0x23')](_0x151bbe)['then'](function(_0x4ea2cb){return _0x4ea2cb;});}return null;};}function removeEntity(_0x336673,_0x2c093f){return function(_0x4c32d4){if(_0x4c32d4){return _0x4c32d4[_0x456b('0x24')]()[_0x456b('0x25')](function(){var _0x5787a9=_0x4c32d4[_0x456b('0x26')]({'plain':!![]});var _0x150370=_0x456b('0x27');return db[_0x456b('0x28')][_0x456b('0x24')]({'where':{'type':_0x150370,'resourceId':_0x5787a9['id']}})[_0x456b('0x25')](function(){return _0x4c32d4;});})[_0x456b('0x25')](function(){_0x336673[_0x456b('0x19')](0xcc)[_0x456b('0x1a')]();});}};}function handleEntityNotFound(_0x183f65,_0x277560){return function(_0x37f58e){if(!_0x37f58e){_0x183f65[_0x456b('0x18')](0x194);}return _0x37f58e;};}function handleError(_0xedbdfd,_0x477a){_0x477a=_0x477a||0x1f4;return function(_0x362907){logger[_0x456b('0x29')](_0x362907[_0x456b('0x2a')]);if(_0x362907[_0x456b('0x2b')]){delete _0x362907[_0x456b('0x2b')];}_0xedbdfd[_0x456b('0x19')](_0x477a)['send'](_0x362907);};}exports[_0x456b('0x2c')]=function(_0x1f4603,_0x300406){var _0x19866c={},_0x1d6114={},_0x38540e={'count':0x0,'rows':[]};var _0x4a9c57=_['map'](db[_0x456b('0x2d')]['rawAttributes'],function(_0x5ef64b){return{'name':_0x5ef64b[_0x456b('0x2e')],'type':_0x5ef64b[_0x456b('0x2f')][_0x456b('0x30')]};});_0x1d6114[_0x456b('0x31')]=_['map'](_0x4a9c57,_0x456b('0x2b'));_0x1d6114[_0x456b('0x32')]=_[_0x456b('0x33')](_0x1f4603['query']);_0x1d6114['filters']=_['intersection'](_0x1d6114[_0x456b('0x31')],_0x1d6114[_0x456b('0x32')]);_0x19866c[_0x456b('0x34')]=_[_0x456b('0x35')](_0x1d6114[_0x456b('0x31')],qs[_0x456b('0x36')](_0x1f4603[_0x456b('0x32')]['fields']));_0x19866c[_0x456b('0x34')]=_0x19866c[_0x456b('0x34')][_0x456b('0x37')]?_0x19866c[_0x456b('0x34')]:_0x1d6114[_0x456b('0x31')];if(!_0x1f4603[_0x456b('0x32')][_0x456b('0x38')](_0x456b('0x39'))){_0x19866c[_0x456b('0x1e')]=qs['limit'](_0x1f4603[_0x456b('0x32')][_0x456b('0x1e')]);_0x19866c['offset']=qs['offset'](_0x1f4603[_0x456b('0x32')]['offset']);}_0x19866c[_0x456b('0x3a')]=qs[_0x456b('0x3b')](_0x1f4603[_0x456b('0x32')]['sort']);_0x19866c[_0x456b('0x3c')]=qs['filters'](_[_0x456b('0x3d')](_0x1f4603[_0x456b('0x32')],_0x1d6114[_0x456b('0x3e')]),_0x4a9c57);if(_0x1f4603[_0x456b('0x32')][_0x456b('0x3f')]){_0x19866c[_0x456b('0x3c')]=_[_0x456b('0x40')](_0x19866c['where'],{'$or':_[_0x456b('0x41')](_0x4a9c57,function(_0x2f63fb){if(_0x2f63fb[_0x456b('0x2f')]!=='VIRTUAL'){var _0x24d46c={};_0x24d46c[_0x2f63fb[_0x456b('0x2b')]]={'$like':'%'+_0x1f4603[_0x456b('0x32')][_0x456b('0x3f')]+'%'};return _0x24d46c;}})});}_0x19866c=_[_0x456b('0x40')]({},_0x19866c,_0x1f4603['options']);var _0x29349f={'where':_0x19866c[_0x456b('0x3c')]};return db[_0x456b('0x2d')][_0x456b('0x1f')](_0x29349f)[_0x456b('0x25')](function(_0xe8e02e){_0x38540e[_0x456b('0x1f')]=_0xe8e02e;if(_0x1f4603['query'][_0x456b('0x42')]){_0x19866c[_0x456b('0x43')]=[{'all':!![]}];}return db[_0x456b('0x2d')][_0x456b('0x44')](_0x19866c);})[_0x456b('0x25')](function(_0x3498f0){_0x38540e[_0x456b('0x45')]=_0x3498f0;return _0x38540e;})[_0x456b('0x25')](respondWithFilteredResult(_0x300406,_0x19866c))[_0x456b('0x46')](handleError(_0x300406,null));};exports[_0x456b('0x47')]=function(_0xe7fd86,_0x5c3a18){var _0x12fac7={'raw':!![],'where':{'id':_0xe7fd86[_0x456b('0x48')]['id']}},_0x28e97e={};_0x28e97e[_0x456b('0x31')]=_[_0x456b('0x33')](db[_0x456b('0x2d')][_0x456b('0x49')]);_0x28e97e['query']=_[_0x456b('0x33')](_0xe7fd86[_0x456b('0x32')]);_0x28e97e[_0x456b('0x3e')]=_[_0x456b('0x35')](_0x28e97e['model'],_0x28e97e[_0x456b('0x32')]);_0x12fac7['attributes']=_[_0x456b('0x35')](_0x28e97e[_0x456b('0x31')],qs['fields'](_0xe7fd86['query']['fields']));_0x12fac7[_0x456b('0x34')]=_0x12fac7['attributes'][_0x456b('0x37')]?_0x12fac7[_0x456b('0x34')]:_0x28e97e[_0x456b('0x31')];if(_0xe7fd86[_0x456b('0x32')]['includeAll']){_0x12fac7[_0x456b('0x43')]=[{'all':!![]}];}_0x12fac7=_['merge']({},_0x12fac7,_0xe7fd86[_0x456b('0x4a')]);return db[_0x456b('0x2d')]['find'](_0x12fac7)[_0x456b('0x25')](handleEntityNotFound(_0x5c3a18,null))['then'](respondWithResult(_0x5c3a18,null))[_0x456b('0x46')](handleError(_0x5c3a18,null));};exports[_0x456b('0x4b')]=function(_0x2822dd,_0x1a75b6){return db[_0x456b('0x2d')]['create'](_0x2822dd['body'],{})[_0x456b('0x25')](function(_0x4fe08d){var _0xc05b9=_0x2822dd[_0x456b('0x4c')][_0x456b('0x26')]({'plain':!![]});if(!_0xc05b9)throw new Error(_0x456b('0x4d'));if(_0xc05b9['role']==='user'){var _0x169b85=_0x4fe08d[_0x456b('0x26')]({'plain':!![]});var _0x52cd7c=_0x456b('0x27');return db[_0x456b('0x4e')][_0x456b('0x4f')]({'where':{'name':_0x52cd7c,'userProfileId':_0xc05b9[_0x456b('0x50')]},'raw':!![]})[_0x456b('0x25')](function(_0x3db0bd){if(_0x3db0bd&&_0x3db0bd[_0x456b('0x51')]===0x0){return db['UserProfileResource'][_0x456b('0x4b')]({'name':_0x169b85[_0x456b('0x2b')],'resourceId':_0x169b85['id'],'type':_0x3db0bd[_0x456b('0x2b')],'sectionId':_0x3db0bd['id']},{})[_0x456b('0x25')](function(){return _0x4fe08d;});}else{return _0x4fe08d;}})['catch'](function(_0x3a6107){logger['error'](_0x456b('0x52'),_0x3a6107);throw _0x3a6107;});}return _0x4fe08d;})[_0x456b('0x25')](respondWithResult(_0x1a75b6,0xc9))[_0x456b('0x46')](handleError(_0x1a75b6,null));};exports[_0x456b('0x23')]=function(_0x2efa0f,_0x57d043){if(_0x2efa0f[_0x456b('0x53')]['id']){delete _0x2efa0f[_0x456b('0x53')]['id'];}return db[_0x456b('0x2d')]['find']({'where':{'id':_0x2efa0f[_0x456b('0x48')]['id']}})[_0x456b('0x25')](handleEntityNotFound(_0x57d043,null))[_0x456b('0x25')](saveUpdates(_0x2efa0f[_0x456b('0x53')],null))[_0x456b('0x25')](respondWithResult(_0x57d043,null))[_0x456b('0x46')](handleError(_0x57d043,null));};exports[_0x456b('0x24')]=function(_0x473729,_0x392e65){return db['Pause']['find']({'where':{'id':_0x473729[_0x456b('0x48')]['id']}})['then'](handleEntityNotFound(_0x392e65,null))[_0x456b('0x25')](removeEntity(_0x392e65,null))[_0x456b('0x46')](handleError(_0x392e65,null));}; \ No newline at end of file +var _0x0071=['request-promise','moment','bluebird','util','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Pauses','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0071,0x19c));var _0x1007=function(_0xcadb77,_0x87039e){_0xcadb77=_0xcadb77-0x0;var _0x540ae1=_0x0071[_0xcadb77];return _0x540ae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1007('0x0'));var zipdir=require(_0x1007('0x1'));var jsonpatch=require(_0x1007('0x2'));var rp=require(_0x1007('0x3'));var moment=require(_0x1007('0x4'));var BPromise=require(_0x1007('0x5'));var Mustache=require('mustache');var util=require(_0x1007('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1007('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1007('0x8'));var squel=require('squel');var crypto=require(_0x1007('0x9'));var jsforce=require(_0x1007('0xa'));var deskjs=require(_0x1007('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1007('0xc'));var Redis=require(_0x1007('0xd'));var authService=require(_0x1007('0xe'));var qs=require(_0x1007('0xf'));var as=require(_0x1007('0x10'));var hardwareService=require(_0x1007('0x11'));var logger=require(_0x1007('0x12'))(_0x1007('0x13'));var utils=require(_0x1007('0x14'));var config=require(_0x1007('0x15'));var licenseUtil=require(_0x1007('0x16'));var db=require(_0x1007('0x17'))['db'];function respondWithStatusCode(_0x17af60,_0x2664a9){_0x2664a9=_0x2664a9||0xcc;return function(_0x2ce594){if(_0x2ce594){return _0x17af60['sendStatus'](_0x2664a9);}return _0x17af60[_0x1007('0x18')](_0x2664a9)[_0x1007('0x19')]();};}function respondWithResult(_0xc3dad5,_0x3de126){_0x3de126=_0x3de126||0xc8;return function(_0x3d69e6){if(_0x3d69e6){return _0xc3dad5[_0x1007('0x18')](_0x3de126)['json'](_0x3d69e6);}};}function respondWithFilteredResult(_0x4459b1,_0x160bdd){return function(_0x5191f4){if(_0x5191f4){var _0x5c4be5=typeof _0x160bdd[_0x1007('0x1a')]===_0x1007('0x1b')&&typeof _0x160bdd['limit']===_0x1007('0x1b');var _0x2fa4bb=_0x5191f4[_0x1007('0x1c')];var _0x22b116=_0x5c4be5?0x0:_0x160bdd[_0x1007('0x1a')];var _0x115d7c=_0x5c4be5?_0x5191f4['count']:_0x160bdd['offset']+_0x160bdd[_0x1007('0x1d')];var _0x187165;if(_0x115d7c>=_0x2fa4bb){_0x115d7c=_0x2fa4bb;_0x187165=0xc8;}else{_0x187165=0xce;}_0x4459b1[_0x1007('0x18')](_0x187165);return _0x4459b1[_0x1007('0x1e')](_0x1007('0x1f'),_0x22b116+'-'+_0x115d7c+'/'+_0x2fa4bb)['json'](_0x5191f4);}return null;};}function patchUpdates(_0x3193cd){return function(_0x20b3e3){try{jsonpatch[_0x1007('0x20')](_0x20b3e3,_0x3193cd,!![]);}catch(_0x808028){return BPromise[_0x1007('0x21')](_0x808028);}return _0x20b3e3[_0x1007('0x22')]();};}function saveUpdates(_0x575b8d,_0x409e39){return function(_0x5b501d){if(_0x5b501d){return _0x5b501d['update'](_0x575b8d)[_0x1007('0x23')](function(_0x385334){return _0x385334;});}return null;};}function removeEntity(_0x2249af,_0x508d5d){return function(_0x5478ff){if(_0x5478ff){return _0x5478ff[_0x1007('0x24')]()[_0x1007('0x23')](function(){var _0x2e9bbe=_0x5478ff[_0x1007('0x25')]({'plain':!![]});var _0x3a8394=_0x1007('0x26');return db['UserProfileResource'][_0x1007('0x24')]({'where':{'type':_0x3a8394,'resourceId':_0x2e9bbe['id']}})['then'](function(){return _0x5478ff;});})[_0x1007('0x23')](function(){_0x2249af[_0x1007('0x18')](0xcc)[_0x1007('0x19')]();});}};}function handleEntityNotFound(_0x306d77,_0x3fe7b8){return function(_0x5ad50a){if(!_0x5ad50a){_0x306d77[_0x1007('0x27')](0x194);}return _0x5ad50a;};}function handleError(_0x2252d9,_0xcf54c3){_0xcf54c3=_0xcf54c3||0x1f4;return function(_0xc4df81){logger[_0x1007('0x28')](_0xc4df81[_0x1007('0x29')]);if(_0xc4df81[_0x1007('0x2a')]){delete _0xc4df81[_0x1007('0x2a')];}_0x2252d9[_0x1007('0x18')](_0xcf54c3)[_0x1007('0x2b')](_0xc4df81);};}exports[_0x1007('0x2c')]=function(_0x5a5185,_0x59a6c3){var _0x3a3042={},_0x43eecc={},_0x35d068={'count':0x0,'rows':[]};var _0x1a0494=_[_0x1007('0x2d')](db[_0x1007('0x2e')][_0x1007('0x2f')],function(_0x20739f){return{'name':_0x20739f['fieldName'],'type':_0x20739f['type'][_0x1007('0x30')]};});_0x43eecc[_0x1007('0x31')]=_[_0x1007('0x2d')](_0x1a0494,_0x1007('0x2a'));_0x43eecc['query']=_['keys'](_0x5a5185[_0x1007('0x32')]);_0x43eecc['filters']=_['intersection'](_0x43eecc[_0x1007('0x31')],_0x43eecc[_0x1007('0x32')]);_0x3a3042[_0x1007('0x33')]=_[_0x1007('0x34')](_0x43eecc[_0x1007('0x31')],qs[_0x1007('0x35')](_0x5a5185[_0x1007('0x32')][_0x1007('0x35')]));_0x3a3042[_0x1007('0x33')]=_0x3a3042[_0x1007('0x33')][_0x1007('0x36')]?_0x3a3042['attributes']:_0x43eecc['model'];if(!_0x5a5185['query'][_0x1007('0x37')]('nolimit')){_0x3a3042[_0x1007('0x1d')]=qs['limit'](_0x5a5185['query'][_0x1007('0x1d')]);_0x3a3042[_0x1007('0x1a')]=qs[_0x1007('0x1a')](_0x5a5185[_0x1007('0x32')][_0x1007('0x1a')]);}_0x3a3042[_0x1007('0x38')]=qs[_0x1007('0x39')](_0x5a5185['query'][_0x1007('0x39')]);_0x3a3042['where']=qs['filters'](_[_0x1007('0x3a')](_0x5a5185[_0x1007('0x32')],_0x43eecc[_0x1007('0x3b')]),_0x1a0494);if(_0x5a5185[_0x1007('0x32')][_0x1007('0x3c')]){_0x3a3042[_0x1007('0x3d')]=_[_0x1007('0x3e')](_0x3a3042[_0x1007('0x3d')],{'$or':_[_0x1007('0x2d')](_0x1a0494,function(_0x5cc9e0){if(_0x5cc9e0['type']!==_0x1007('0x3f')){var _0x4b8ed1={};_0x4b8ed1[_0x5cc9e0[_0x1007('0x2a')]]={'$like':'%'+_0x5a5185['query']['filter']+'%'};return _0x4b8ed1;}})});}_0x3a3042=_['merge']({},_0x3a3042,_0x5a5185[_0x1007('0x40')]);var _0xc3c02b={'where':_0x3a3042[_0x1007('0x3d')]};return db[_0x1007('0x2e')][_0x1007('0x1c')](_0xc3c02b)[_0x1007('0x23')](function(_0x2d26da){_0x35d068[_0x1007('0x1c')]=_0x2d26da;if(_0x5a5185[_0x1007('0x32')][_0x1007('0x41')]){_0x3a3042[_0x1007('0x42')]=[{'all':!![]}];}return db['Pause'][_0x1007('0x43')](_0x3a3042);})[_0x1007('0x23')](function(_0x3d1d0d){_0x35d068[_0x1007('0x44')]=_0x3d1d0d;return _0x35d068;})[_0x1007('0x23')](respondWithFilteredResult(_0x59a6c3,_0x3a3042))[_0x1007('0x45')](handleError(_0x59a6c3,null));};exports[_0x1007('0x46')]=function(_0x26fe5d,_0xd8544e){var _0x21edd0={'raw':!![],'where':{'id':_0x26fe5d['params']['id']}},_0xd8462b={};_0xd8462b[_0x1007('0x31')]=_[_0x1007('0x47')](db[_0x1007('0x2e')]['rawAttributes']);_0xd8462b['query']=_['keys'](_0x26fe5d[_0x1007('0x32')]);_0xd8462b[_0x1007('0x3b')]=_[_0x1007('0x34')](_0xd8462b[_0x1007('0x31')],_0xd8462b[_0x1007('0x32')]);_0x21edd0[_0x1007('0x33')]=_[_0x1007('0x34')](_0xd8462b['model'],qs[_0x1007('0x35')](_0x26fe5d[_0x1007('0x32')]['fields']));_0x21edd0[_0x1007('0x33')]=_0x21edd0[_0x1007('0x33')][_0x1007('0x36')]?_0x21edd0[_0x1007('0x33')]:_0xd8462b['model'];if(_0x26fe5d['query']['includeAll']){_0x21edd0[_0x1007('0x42')]=[{'all':!![]}];}_0x21edd0=_[_0x1007('0x3e')]({},_0x21edd0,_0x26fe5d['options']);return db[_0x1007('0x2e')][_0x1007('0x48')](_0x21edd0)[_0x1007('0x23')](handleEntityNotFound(_0xd8544e,null))['then'](respondWithResult(_0xd8544e,null))[_0x1007('0x45')](handleError(_0xd8544e,null));};exports[_0x1007('0x49')]=function(_0x5684bc,_0x35fa6a){return db['Pause'][_0x1007('0x49')](_0x5684bc[_0x1007('0x4a')],{})['then'](function(_0x10aca2){var _0x3ba900=_0x5684bc[_0x1007('0x4b')][_0x1007('0x25')]({'plain':!![]});if(!_0x3ba900)throw new Error(_0x1007('0x4c'));if(_0x3ba900['role']==='user'){var _0x5e1842=_0x10aca2[_0x1007('0x25')]({'plain':!![]});var _0x326bde=_0x1007('0x26');return db[_0x1007('0x4d')]['find']({'where':{'name':_0x326bde,'userProfileId':_0x3ba900['userProfileId']},'raw':!![]})[_0x1007('0x23')](function(_0xdae89){if(_0xdae89&&_0xdae89[_0x1007('0x4e')]===0x0){return db[_0x1007('0x4f')][_0x1007('0x49')]({'name':_0x5e1842['name'],'resourceId':_0x5e1842['id'],'type':_0xdae89['name'],'sectionId':_0xdae89['id']},{})['then'](function(){return _0x10aca2;});}else{return _0x10aca2;}})['catch'](function(_0x29979){logger[_0x1007('0x28')](_0x1007('0x50'),_0x29979);throw _0x29979;});}return _0x10aca2;})[_0x1007('0x23')](respondWithResult(_0x35fa6a,0xc9))[_0x1007('0x45')](handleError(_0x35fa6a,null));};exports[_0x1007('0x51')]=function(_0x5869f3,_0x596d0b){if(_0x5869f3[_0x1007('0x4a')]['id']){delete _0x5869f3[_0x1007('0x4a')]['id'];}return db[_0x1007('0x2e')][_0x1007('0x48')]({'where':{'id':_0x5869f3[_0x1007('0x52')]['id']}})['then'](handleEntityNotFound(_0x596d0b,null))[_0x1007('0x23')](saveUpdates(_0x5869f3[_0x1007('0x4a')],null))[_0x1007('0x23')](respondWithResult(_0x596d0b,null))[_0x1007('0x45')](handleError(_0x596d0b,null));};exports[_0x1007('0x24')]=function(_0x509e3a,_0x16cec3){return db[_0x1007('0x2e')]['find']({'where':{'id':_0x509e3a['params']['id']}})[_0x1007('0x23')](handleEntityNotFound(_0x16cec3,null))[_0x1007('0x23')](removeEntity(_0x16cec3,null))['catch'](handleError(_0x16cec3,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1fa0d64..c08b0e8 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_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'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x1c1f09,_0x5ef7d2){var _0x5e449e=function(_0xcaa5a){while(--_0xcaa5a){_0x1c1f09['push'](_0x1c1f09['shift']());}};_0x5e449e(++_0x5ef7d2);}(_0x326f,0xd1));var _0xf326=function(_0x5570af,_0x56e352){_0x5570af=_0x5570af-0x0;var _0x38b434=_0x326f[_0x5570af];return _0x38b434;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 4774071..b6414e0 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4f90a0,_0x5715c4){var _0x4ab42f=function(_0xa1dc16){while(--_0xa1dc16){_0x4f90a0['push'](_0x4f90a0['shift']());}};_0x4ab42f(++_0x5715c4);}(_0x7a54,0x106));var _0x47a5=function(_0x39177b,_0x5ef62a){_0x39177b=_0x39177b-0x0;var _0x1fac9c=_0x7a54[_0x39177b];return _0x1fac9c;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x216905,_0x106b0b){var _0x4d5cd1=function(_0x46d419){while(--_0x46d419){_0x216905['push'](_0x216905['shift']());}};_0x4d5cd1(++_0x106b0b);}(_0x7a54,0x106));var _0x47a5=function(_0x395a08,_0x56f13f){_0x395a08=_0x395a08-0x0;var _0x32d417=_0x7a54[_0x395a08];return _0x32d417;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b6df526..8b8e75e 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 _0xc874=['originalname','extname','now','post','single','webhookPost','/:id','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','/webhook','webhookGet','isAuthenticated','/:id/download','download','diskStorage','root','server/files/plugins','format','%s-%s%s','basename'];(function(_0x2a9977,_0x959630){var _0x40857b=function(_0x3b88b9){while(--_0x3b88b9){_0x2a9977['push'](_0x2a9977['shift']());}};_0x40857b(++_0x959630);}(_0xc874,0x154));var _0x4c87=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0xc874[_0x3ab353];return _0x1e2285;};'use strict';var multer=require(_0x4c87('0x0'));var util=require('util');var path=require(_0x4c87('0x1'));var timeout=require(_0x4c87('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c87('0x3'));var auth=require(_0x4c87('0x4'));var interaction=require(_0x4c87('0x5'));var config=require('../../config/environment');var controller=require(_0x4c87('0x6'));router[_0x4c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x8')]);router[_0x4c87('0x7')](_0x4c87('0x9'),controller[_0x4c87('0xa')]);router[_0x4c87('0x7')]('/:id',auth[_0x4c87('0xb')](),controller['show']);router[_0x4c87('0x7')](_0x4c87('0xc'),auth[_0x4c87('0xb')](),controller[_0x4c87('0xd')]);var upload=multer({'storage':multer[_0x4c87('0xe')]({'destination':function(_0x548e1a,_0x1fcc99,_0x2b82cb){_0x2b82cb(null,path['join'](config[_0x4c87('0xf')],_0x4c87('0x10')));},'filename':function(_0x1e0530,_0x3b01bb,_0x3a2aa2){_0x3b01bb['originalname']=_0x3b01bb['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3a2aa2(null,util[_0x4c87('0x11')](_0x4c87('0x12'),path[_0x4c87('0x13')](_0x3b01bb[_0x4c87('0x14')],path[_0x4c87('0x15')](_0x3b01bb[_0x4c87('0x14')])),Date[_0x4c87('0x16')](),path[_0x4c87('0x15')](_0x3b01bb['originalname'])));}})});router[_0x4c87('0x17')]('/',upload[_0x4c87('0x18')]('file'),controller['upload']);router[_0x4c87('0x17')](_0x4c87('0x9'),controller[_0x4c87('0x19')]);router['put'](_0x4c87('0x1a'),auth['isAuthenticated'](),controller[_0x4c87('0x1b')]);router[_0x4c87('0x1c')](_0x4c87('0x1a'),auth[_0x4c87('0xb')](),controller['delete']);module[_0x4c87('0x1d')]=router; \ No newline at end of file +var _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2123,0x190));var _0x3212=function(_0x307a68,_0x3991c5){_0x307a68=_0x307a68-0x0;var _0x5d23fd=_0x2123[_0x307a68];return _0x5d23fd;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ccc2860..332930b 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 _0x4a4c=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x4a4c,0x92));var _0xc4a4=function(_0x540773,_0x43253b){_0x540773=_0x540773-0x0;var _0x113dba=_0x4a4c[_0x540773];return _0x113dba;};'use strict';var Sequelize=require(_0xc4a4('0x0'));module[_0xc4a4('0x1')]={'name':{'type':Sequelize[_0xc4a4('0x2')]},'type':{'type':Sequelize[_0xc4a4('0x3')](_0xc4a4('0x4'),_0xc4a4('0x5'))},'description':{'type':Sequelize[_0xc4a4('0x6')]},'version':{'type':Sequelize[_0xc4a4('0x6')]},'path':{'type':Sequelize[_0xc4a4('0x2')],'comment':_0xc4a4('0x7')},'active':{'type':Sequelize[_0xc4a4('0x8')],'defaultValue':0x0,'comment':_0xc4a4('0x9')},'sidebar':{'type':Sequelize[_0xc4a4('0x3')](_0xc4a4('0xa'),_0xc4a4('0xb'),_0xc4a4('0xc'),_0xc4a4('0xd')),'defaultValue':_0xc4a4('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xc4a4('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xc4a4('0x2')]},'scriptName':{'type':Sequelize[_0xc4a4('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x820a=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','TEXT','STRING'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x820a,0x187));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa820('0x0'));module[_0xa820('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa820('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xa820('0x3')]},'path':{'type':Sequelize[_0xa820('0x4')],'comment':_0xa820('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa820('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xa820('0x7'),_0xa820('0x8'),_0xa820('0x9'),_0xa820('0xa')),'defaultValue':_0xa820('0x9'),'comment':_0xa820('0xb')},'icon':{'type':Sequelize[_0xa820('0x4')]},'adminUrl':{'type':Sequelize[_0xa820('0x4')]},'agentUrl':{'type':Sequelize[_0xa820('0x4')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa820('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b43a237..18cca0f 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 _0xcf2a=['update','destroy','then','get','Plugins','UserProfileResource','sendStatus','error','name','send','map','Plugin','rawAttributes','fieldName','key','model','keys','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','rows','catch','show','intersection','find','download','params','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','reject','save'];(function(_0x341b0e,_0x22bc63){var _0x165837=function(_0x58bc92){while(--_0x58bc92){_0x341b0e['push'](_0x341b0e['shift']());}};_0x165837(++_0x22bc63);}(_0xcf2a,0x1db));var _0xacf2=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xcf2a[_0x28aea5];return _0x6a55f9;};'use strict';var emlformat=require(_0xacf2('0x0'));var rimraf=require(_0xacf2('0x1'));var zipdir=require(_0xacf2('0x2'));var jsonpatch=require(_0xacf2('0x3'));var rp=require(_0xacf2('0x4'));var moment=require(_0xacf2('0x5'));var BPromise=require(_0xacf2('0x6'));var Mustache=require(_0xacf2('0x7'));var util=require('util');var path=require(_0xacf2('0x8'));var sox=require('sox');var csv=require(_0xacf2('0x9'));var ejs=require(_0xacf2('0xa'));var fs=require('fs');var fs_extra=require(_0xacf2('0xb'));var _=require(_0xacf2('0xc'));var squel=require(_0xacf2('0xd'));var crypto=require(_0xacf2('0xe'));var jsforce=require(_0xacf2('0xf'));var deskjs=require(_0xacf2('0x10'));var toCsv=require(_0xacf2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xacf2('0x11'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xacf2('0x12'));var authService=require(_0xacf2('0x13'));var qs=require(_0xacf2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacf2('0x15'));var logger=require(_0xacf2('0x16'))(_0xacf2('0x17'));var utils=require(_0xacf2('0x18'));var config=require(_0xacf2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xacf2('0x1a'))['db'];config[_0xacf2('0x1b')]=_['defaults'](config[_0xacf2('0x1b')],{'host':_0xacf2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacf2('0x1b')]));require(_0xacf2('0x1d'))[_0xacf2('0x1e')](socket);function respondWithStatusCode(_0x2455b2,_0x500312){_0x500312=_0x500312||0xcc;return function(_0x9af82){if(_0x9af82){return _0x2455b2['sendStatus'](_0x500312);}return _0x2455b2[_0xacf2('0x1f')](_0x500312)['end']();};}function respondWithResult(_0x8921e2,_0x1d9113){_0x1d9113=_0x1d9113||0xc8;return function(_0x572611){if(_0x572611){return _0x8921e2[_0xacf2('0x1f')](_0x1d9113)[_0xacf2('0x20')](_0x572611);}};}function respondWithFilteredResult(_0x25e1de,_0x1a7d89){return function(_0x50591){if(_0x50591){var _0x4c68ee=typeof _0x1a7d89[_0xacf2('0x21')]==='undefined'&&typeof _0x1a7d89[_0xacf2('0x22')]===_0xacf2('0x23');var _0x43c440=_0x50591[_0xacf2('0x24')];var _0x59b2ce=_0x4c68ee?0x0:_0x1a7d89['offset'];var _0xcb9e00=_0x4c68ee?_0x50591[_0xacf2('0x24')]:_0x1a7d89[_0xacf2('0x21')]+_0x1a7d89[_0xacf2('0x22')];var _0x56aae3;if(_0xcb9e00>=_0x43c440){_0xcb9e00=_0x43c440;_0x56aae3=0xc8;}else{_0x56aae3=0xce;}_0x25e1de['status'](_0x56aae3);return _0x25e1de[_0xacf2('0x25')](_0xacf2('0x26'),_0x59b2ce+'-'+_0xcb9e00+'/'+_0x43c440)[_0xacf2('0x20')](_0x50591);}return null;};}function patchUpdates(_0x5d2c23){return function(_0x42d7d3){try{jsonpatch['apply'](_0x42d7d3,_0x5d2c23,!![]);}catch(_0x364df6){return BPromise[_0xacf2('0x27')](_0x364df6);}return _0x42d7d3[_0xacf2('0x28')]();};}function saveUpdates(_0x4ceccc,_0x4ad224){return function(_0x32952b){if(_0x32952b){return _0x32952b[_0xacf2('0x29')](_0x4ceccc)['then'](function(_0x5f58b3){return _0x5f58b3;});}return null;};}function removeEntity(_0x3a3325,_0x45e33a){return function(_0x67ba6f){if(_0x67ba6f){return _0x67ba6f[_0xacf2('0x2a')]()[_0xacf2('0x2b')](function(){var _0x307326=_0x67ba6f[_0xacf2('0x2c')]({'plain':!![]});var _0x2e8ef1=_0xacf2('0x2d');return db[_0xacf2('0x2e')][_0xacf2('0x2a')]({'where':{'type':_0x2e8ef1,'resourceId':_0x307326['id']}})[_0xacf2('0x2b')](function(){return _0x67ba6f;});})[_0xacf2('0x2b')](function(){_0x3a3325[_0xacf2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c03f9,_0x520e26){return function(_0x704d21){if(!_0x704d21){_0x1c03f9[_0xacf2('0x2f')](0x194);}return _0x704d21;};}function handleError(_0x8912dd,_0x3ca0db){_0x3ca0db=_0x3ca0db||0x1f4;return function(_0xe0bdb){logger[_0xacf2('0x30')](_0xe0bdb['stack']);if(_0xe0bdb[_0xacf2('0x31')]){delete _0xe0bdb[_0xacf2('0x31')];}_0x8912dd[_0xacf2('0x1f')](_0x3ca0db)[_0xacf2('0x32')](_0xe0bdb);};}exports['index']=function(_0x477b4c,_0x3fd90b){var _0x2dc9aa={},_0x3964bb={},_0x302b2e={'count':0x0,'rows':[]};var _0x1c8a0e=_[_0xacf2('0x33')](db[_0xacf2('0x34')][_0xacf2('0x35')],function(_0xeb46c9){return{'name':_0xeb46c9[_0xacf2('0x36')],'type':_0xeb46c9['type'][_0xacf2('0x37')]};});_0x3964bb[_0xacf2('0x38')]=_[_0xacf2('0x33')](_0x1c8a0e,_0xacf2('0x31'));_0x3964bb['query']=_[_0xacf2('0x39')](_0x477b4c[_0xacf2('0x3a')]);_0x3964bb['filters']=_['intersection'](_0x3964bb[_0xacf2('0x38')],_0x3964bb[_0xacf2('0x3a')]);_0x2dc9aa['attributes']=_['intersection'](_0x3964bb[_0xacf2('0x38')],qs[_0xacf2('0x3b')](_0x477b4c['query']['fields']));_0x2dc9aa['attributes']=_0x2dc9aa[_0xacf2('0x3c')][_0xacf2('0x3d')]?_0x2dc9aa[_0xacf2('0x3c')]:_0x3964bb[_0xacf2('0x38')];if(!_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x3e')]('nolimit')){_0x2dc9aa[_0xacf2('0x22')]=qs[_0xacf2('0x22')](_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x22')]);_0x2dc9aa['offset']=qs[_0xacf2('0x21')](_0x477b4c[_0xacf2('0x3a')]['offset']);}_0x2dc9aa[_0xacf2('0x3f')]=qs[_0xacf2('0x40')](_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x40')]);_0x2dc9aa[_0xacf2('0x41')]=qs[_0xacf2('0x42')](_[_0xacf2('0x43')](_0x477b4c[_0xacf2('0x3a')],_0x3964bb['filters']),_0x1c8a0e);if(_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x44')]){_0x2dc9aa[_0xacf2('0x41')]=_['merge'](_0x2dc9aa[_0xacf2('0x41')],{'$or':_[_0xacf2('0x33')](_0x1c8a0e,function(_0x38305f){if(_0x38305f[_0xacf2('0x45')]!=='VIRTUAL'){var _0x18ecdf={};_0x18ecdf[_0x38305f['name']]={'$like':'%'+_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x44')]+'%'};return _0x18ecdf;}})});}_0x2dc9aa=_[_0xacf2('0x46')]({},_0x2dc9aa,_0x477b4c[_0xacf2('0x47')]);var _0x397044={'where':_0x2dc9aa['where']};return db[_0xacf2('0x34')][_0xacf2('0x24')](_0x397044)['then'](function(_0x340a2f){_0x302b2e[_0xacf2('0x24')]=_0x340a2f;if(_0x477b4c[_0xacf2('0x3a')][_0xacf2('0x48')]){_0x2dc9aa[_0xacf2('0x49')]=[{'all':!![]}];}return db[_0xacf2('0x34')]['findAll'](_0x2dc9aa);})[_0xacf2('0x2b')](function(_0x50d8e3){_0x302b2e[_0xacf2('0x4a')]=_0x50d8e3;return _0x302b2e;})[_0xacf2('0x2b')](respondWithFilteredResult(_0x3fd90b,_0x2dc9aa))[_0xacf2('0x4b')](handleError(_0x3fd90b,null));};exports[_0xacf2('0x4c')]=function(_0x13d816,_0x1bb4f4){var _0x5852e4={'raw':!![],'where':{'id':_0x13d816['params']['id']}},_0x2be6be={};_0x2be6be[_0xacf2('0x38')]=_[_0xacf2('0x39')](db[_0xacf2('0x34')][_0xacf2('0x35')]);_0x2be6be[_0xacf2('0x3a')]=_[_0xacf2('0x39')](_0x13d816[_0xacf2('0x3a')]);_0x2be6be[_0xacf2('0x42')]=_[_0xacf2('0x4d')](_0x2be6be[_0xacf2('0x38')],_0x2be6be[_0xacf2('0x3a')]);_0x5852e4[_0xacf2('0x3c')]=_[_0xacf2('0x4d')](_0x2be6be[_0xacf2('0x38')],qs[_0xacf2('0x3b')](_0x13d816[_0xacf2('0x3a')][_0xacf2('0x3b')]));_0x5852e4[_0xacf2('0x3c')]=_0x5852e4['attributes']['length']?_0x5852e4[_0xacf2('0x3c')]:_0x2be6be[_0xacf2('0x38')];if(_0x13d816[_0xacf2('0x3a')][_0xacf2('0x48')]){_0x5852e4[_0xacf2('0x49')]=[{'all':!![]}];}_0x5852e4=_[_0xacf2('0x46')]({},_0x5852e4,_0x13d816[_0xacf2('0x47')]);return db['Plugin'][_0xacf2('0x4e')](_0x5852e4)[_0xacf2('0x2b')](handleEntityNotFound(_0x1bb4f4,null))[_0xacf2('0x2b')](respondWithResult(_0x1bb4f4,null))[_0xacf2('0x4b')](handleError(_0x1bb4f4,null));};exports[_0xacf2('0x4f')]=function(_0x2aa8c5,_0x47098f,_0x551337){return db[_0xacf2('0x34')][_0xacf2('0x4e')]({'where':{'id':_0x2aa8c5[_0xacf2('0x50')]['id']},'attributes':[_0xacf2('0x31'),'path'],'raw':!![]})[_0xacf2('0x2b')](handleEntityNotFound(_0x47098f,null))['then'](function(_0x18237f){if(_0x18237f){var _0x257f51=path[_0xacf2('0x51')](config[_0xacf2('0x52')],_0xacf2('0x53'),util[_0xacf2('0x54')]('%s.zip',path[_0xacf2('0x55')](_0x18237f[_0xacf2('0x8')])));var _0x3e3476=fs[_0xacf2('0x56')](_0x257f51);var _0x58d583=archiver(_0xacf2('0x57'),{'zlib':{'level':0x9}});_0x58d583['on'](_0xacf2('0x58'),function(_0x5543a3){if(_0x5543a3[_0xacf2('0x59')]===_0xacf2('0x5a')){logger[_0xacf2('0x30')](_0x5543a3);}else{throw new db[(_0xacf2('0x5b'))][(_0xacf2('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x58d583['on'](_0xacf2('0x30'),function(_0xeff567){throw new db[(_0xacf2('0x5b'))][(_0xacf2('0x5c'))](_0xacf2('0x5d'));});_0x58d583[_0xacf2('0x5e')](_0x3e3476);_0x58d583[_0xacf2('0x5f')](_0xacf2('0x60'),{'cwd':path[_0xacf2('0x51')](config[_0xacf2('0x52')],_0xacf2('0x53'),path[_0xacf2('0x61')](_0x18237f[_0xacf2('0x8')])),'ignore':[path[_0xacf2('0x51')](path[_0xacf2('0x55')](_0x18237f[_0xacf2('0x8')]),_0xacf2('0x62')),path[_0xacf2('0x51')](path[_0xacf2('0x55')](_0x18237f[_0xacf2('0x8')]),_0xacf2('0x63'))],'nodir':!![]})[_0xacf2('0x64')]();_0x3e3476['on']('close',function(){if(!fs[_0xacf2('0x65')](_0x257f51)){throw new db[(_0xacf2('0x5b'))]['Error'](_0xacf2('0x66'));}return _0x47098f[_0xacf2('0x4f')](_0x257f51,util['format'](_0xacf2('0x67'),path['basename'](_0x18237f[_0xacf2('0x8')])),function(_0x4f7556){if(_0x4f7556){throw new db[(_0xacf2('0x5b'))][(_0xacf2('0x5c'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xacf2('0x68')](_0x257f51);logger[_0xacf2('0x69')]('Download\x20completed');logger['info'](_0xacf2('0x6a'));});});}return null;})[_0xacf2('0x4b')](handleError(_0x47098f,null));};exports[_0xacf2('0x6b')]=function(_0x69990f,_0x164732,_0x42e4ee){var _0x121b95=path[_0xacf2('0x55')](_0x69990f[_0xacf2('0x6c')]['filename'],path[_0xacf2('0x6d')](_0x69990f['file'][_0xacf2('0x6e')]));var _0x1a8bd2=path[_0xacf2('0x51')](config[_0xacf2('0x52')],_0xacf2('0x53'),_0x69990f[_0xacf2('0x6c')][_0xacf2('0x6e')]);var _0x43afe7=path[_0xacf2('0x51')](config['root'],'server/files/plugins',_0x121b95);logger[_0xacf2('0x69')](_0xacf2('0x6f'),_0x1a8bd2);logger[_0xacf2('0x69')](_0xacf2('0x70'),_0x43afe7);try{fs['chmodSync'](_0x1a8bd2,parseInt(_0xacf2('0x71'),0x8));extract(_0x1a8bd2,{'dir':_0x43afe7},function(_0x255d72){if(_0x255d72){logger[_0xacf2('0x30')](_0x255d72);handleError(_0x255d72,!![]);};var _0x3b1d00=fs[_0xacf2('0x72')](_0x43afe7);if(_0x3b1d00[_0xacf2('0x3d')]>0x1){removeReferences(_0x1a8bd2,_0x43afe7);logger['error'](_0xacf2('0x73'));return _0x42e4ee(new Error(_0xacf2('0x73')));}var _0x19b956=fs['lstatSync'](path['join'](_0x43afe7,_0x3b1d00[0x0]));if(_0x19b956[_0xacf2('0x74')]()){removeReferences(_0x1a8bd2,_0x43afe7);logger[_0xacf2('0x30')](_0xacf2('0x73'));return _0x42e4ee(new Error('Invalid\x20plugin\x20structure'));}if(_0x19b956['isDirectory']()){var _0x19a7d4=fs[_0xacf2('0x72')](path[_0xacf2('0x51')](_0x43afe7,_0x3b1d00[0x0]));if(_0x19a7d4[_0xacf2('0x3d')]===0x0){removeReferences(_0x1a8bd2,_0x43afe7);logger[_0xacf2('0x30')]('Invalid\x20plugin\x20structure');return _0x42e4ee(new Error(_0xacf2('0x73')));}var _0x35d86c=_0x19a7d4[_0xacf2('0x75')](function(_0x1837cf){return _0x1837cf==='manifest.json';});if(!_0x35d86c){return _0x42e4ee(new Error(_0xacf2('0x76')));}var _0x409830=fs[_0xacf2('0x77')](path[_0xacf2('0x51')](_0x43afe7,_0x3b1d00[0x0],_0xacf2('0x78')));var _0x4f63bd=JSON[_0xacf2('0x79')](_0x409830);if(_0xacf2('0x23')==typeof _0x4f63bd[_0xacf2('0x31')]){return _0x42e4ee(new Error(_0xacf2('0x7a')));}if(_0xacf2('0x23')==typeof _0x4f63bd['type']){return _0x42e4ee(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xacf2('0x23')==typeof _0x4f63bd['version']){return _0x42e4ee(new Error(_0xacf2('0x7b')));}if(_0xacf2('0x23')==typeof _0x4f63bd['parameters']){return _0x42e4ee(new Error(_0xacf2('0x7c')));}if(_0x4f63bd[_0xacf2('0x45')]===_0xacf2('0x7d')){if(_0xacf2('0x23')==typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')]){return _0x42e4ee(new Error(_0xacf2('0x80')));}if('undefined'==typeof _0x4f63bd[_0xacf2('0x7e')]['views']['admin']&&_0xacf2('0x23')==typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')][_0xacf2('0x81')]){return _0x42e4ee(new Error(_0xacf2('0x82')));}}else if(_0x4f63bd[_0xacf2('0x45')]===_0xacf2('0x83')){if(_0xacf2('0x23')==typeof _0x4f63bd[_0xacf2('0x7e')]['scriptName']){return _0x42e4ee(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x4f63bd[_0xacf2('0x7e')]['scriptPath']){return _0x42e4ee(new Error(_0xacf2('0x84')));}}else{return _0x42e4ee(new Error(_0xacf2('0x85')));}var _0x578da1=_0x4f63bd[_0xacf2('0x31')];var _0x1ded58=_0x4f63bd[_0xacf2('0x86')];var _0x401a23=_0x4f63bd[_0xacf2('0x45')];var _0x271591=_0x4f63bd['sidebar']?_0x4f63bd[_0xacf2('0x87')]:_0xacf2('0x88');var _0x26c522=_0x4f63bd[_0xacf2('0x89')]?_0x4f63bd['icon']:_0xacf2('0x8a');var _0x1792ee='';var _0x4ec64f='';var _0x3b0fdf='';var _0x59352d='';var _0x4f3cac=_0x4f63bd[_0xacf2('0x8b')];if(_0x401a23==='html'){if(_0xacf2('0x23')!=typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')]['admin']){var _0x1ebab0=_0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')][_0xacf2('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1ebab0)){_0x1792ee=path[_0xacf2('0x51')](_0xacf2('0x8d'),_0x121b95,_0x3b1d00[0x0],_0x1ebab0);}else{_0x1792ee=_0x1ebab0;}}else{logger['info'](_0xacf2('0x8e'));}if(_0xacf2('0x23')!=typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')]['agent']){var _0x54cbd2=_0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')][_0xacf2('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xacf2('0x8f')](_0x54cbd2)){_0x4ec64f=path[_0xacf2('0x51')]('plugins',_0x121b95,_0x3b1d00[0x0],_0x54cbd2);}else{_0x4ec64f=_0x54cbd2;}}else{logger['info'](_0xacf2('0x90'));}}else if(_0x401a23===_0xacf2('0x83')){_0x3b0fdf=_0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x91')];_0x59352d=_0x4f63bd[_0xacf2('0x7e')]['scriptPath'];if(_0xacf2('0x23')!=typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')]){if(_0xacf2('0x23')!=typeof _0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')][_0xacf2('0x8c')]){var _0x1ebab0=_0x4f63bd[_0xacf2('0x7e')][_0xacf2('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xacf2('0x8f')](_0x1ebab0)){_0x1792ee=path[_0xacf2('0x51')](_0xacf2('0x8d'),_0x121b95,_0x3b1d00[0x0],_0x1ebab0);}else{_0x1792ee=_0x1ebab0;}}if(_0xacf2('0x23')!=typeof _0x4f63bd[_0xacf2('0x7e')]['views'][_0xacf2('0x81')]){var _0x54cbd2=_0x4f63bd['parameters']['views'][_0xacf2('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x54cbd2)){_0x4ec64f=path[_0xacf2('0x51')]('plugins',_0x121b95,_0x3b1d00[0x0],_0x54cbd2);}else{_0x4ec64f=_0x54cbd2;}}}}var _0x44bdf9={'name':_0x578da1,'description':_0x1ded58,'path':path['join'](_0x121b95,_0x3b1d00[0x0]),'type':_0x401a23,'sidebar':_0x271591,'icon':_0x26c522,'adminUrl':_0x1792ee,'agentUrl':_0x4ec64f,'scriptName':_0x3b0fdf,'scriptPath':_0x59352d,'version':_0x4f3cac};removeReferences(_0x1a8bd2,null);return db[_0xacf2('0x34')][_0xacf2('0x92')](_0x44bdf9)[_0xacf2('0x2b')](function(_0x4d2a62){var _0xac10e9={'role':_0x69990f['body'][_0xacf2('0x93')],'userProfileId':_0x69990f[_0xacf2('0x94')][_0xacf2('0x95')]};if(!_0xac10e9)throw new Error(_0xacf2('0x96'));if(_0xac10e9[_0xacf2('0x93')]==='user'){var _0x42036e=_0x4d2a62[_0xacf2('0x2c')]({'plain':!![]});return db[_0xacf2('0x97')][_0xacf2('0x4e')]({'where':{'name':_0xacf2('0x2d'),'userProfileId':_0xac10e9[_0xacf2('0x95')]},'raw':!![]})[_0xacf2('0x2b')](function(_0x467d0b){if(_0x467d0b&&_0x467d0b[_0xacf2('0x98')]===0x0){return db[_0xacf2('0x2e')][_0xacf2('0x92')]({'name':_0x42036e[_0xacf2('0x31')],'resourceId':_0x42036e['id'],'type':_0x467d0b[_0xacf2('0x31')],'sectionId':_0x467d0b['id']},{})[_0xacf2('0x2b')](function(){return _0x4d2a62;});}else{return _0x4d2a62;}})[_0xacf2('0x4b')](function(_0x113af2){logger['error'](_0xacf2('0x99'),_0x113af2);throw _0x113af2;});}return _0x4d2a62;})[_0xacf2('0x2b')](respondWithResult(_0x164732,null))[_0xacf2('0x4b')](handleError(_0x164732,null));}});}catch(_0x163db2){_0x164732[_0xacf2('0x1f')](0x1f4)[_0xacf2('0x32')](_0x163db2);}};function removeReferences(_0x440068,_0x194f2c){try{if(_0x440068){fs['unlinkSync'](_0x440068);logger[_0xacf2('0x69')](_0xacf2('0x9a'));}if(_0x194f2c){rimraf(_0x194f2c,function(){});logger['info'](_0xacf2('0x9b'));}}catch(_0x447612){logger[_0xacf2('0x30')](_0x447612);}}exports[_0xacf2('0x29')]=function(_0x20ca56,_0x5cf9f2,_0x3e5219){return db['Plugin'][_0xacf2('0x4e')]({'where':{'id':_0x20ca56[_0xacf2('0x50')]['id']}})['then'](handleEntityNotFound(_0x5cf9f2,null))[_0xacf2('0x2b')](saveUpdates(_0x20ca56[_0xacf2('0x94')],null))[_0xacf2('0x2b')](respondWithResult(_0x5cf9f2,null))[_0xacf2('0x4b')](handleError(_0x5cf9f2,null));};exports[_0xacf2('0x9c')]=function(_0x2e1d35,_0x11623f,_0x54331e){return db[_0xacf2('0x34')][_0xacf2('0x4e')]({'where':{'id':_0x2e1d35[_0xacf2('0x50')]['id']}})[_0xacf2('0x2b')](function(_0x3c8e8a){if(_0x3c8e8a){return _0x3c8e8a[_0xacf2('0x2a')]();}})[_0xacf2('0x2b')](function(_0x59faf5){rimraf(path[_0xacf2('0x51')](config[_0xacf2('0x52')],_0xacf2('0x53'),path['dirname'](_0x59faf5[_0xacf2('0x8')])),function(){});return _0x59faf5;})[_0xacf2('0x2b')](handleEntityNotFound(_0x11623f,null))[_0xacf2('0x2b')](respondWithStatusCode(_0x11623f,null))[_0xacf2('0x4b')](handleError(_0x11623f,null));};exports['webhookGet']=function(_0xc7a59a,_0x58fb6a,_0x10cfb7){return BPromise['resolve']()[_0xacf2('0x2b')](function(){if(!_0xc7a59a[_0xacf2('0x3a')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xc7a59a[_0xacf2('0x3a')][_0xacf2('0x9d')]){throw new Error(_0xacf2('0x9e'));}var _0x206bdf=_0xc7a59a[_0xacf2('0x3a')][_0xacf2('0x9f')]?_0xc7a59a[_0xacf2('0x3a')][_0xacf2('0x9f')]+':'+_0xc7a59a['query'][_0xacf2('0x9d')]:_0xacf2('0xa0')+_0xc7a59a[_0xacf2('0x3a')][_0xacf2('0x9d')];var _0x510079=_0xc7a59a[_0xacf2('0x3a')]['json']?_0xc7a59a['query']['json']:!![];var _0xbd7779=_0xc7a59a[_0xacf2('0x3a')][_0xacf2('0xa1')]?_0xc7a59a['query'][_0xacf2('0xa1')]:null;var _0x300112={'method':_0xc7a59a[_0xacf2('0xa2')],'uri':util[_0xacf2('0x54')](_0xacf2('0xa3'),_0x206bdf,_0xc7a59a[_0xacf2('0x3a')]['path']),'json':_0x510079,'resolveWithFullResponse':!![],'encoding':_0xbd7779,'qs':_0xc7a59a[_0xacf2('0x3a')]};if(_0xc7a59a[_0xacf2('0xa4')]){_0x300112[_0xacf2('0xa4')]=_0xc7a59a[_0xacf2('0xa4')];if(_0x300112[_0xacf2('0xa4')]['content-length']){delete _0x300112[_0xacf2('0xa4')][_0xacf2('0xa5')];}}if(_0x300112[_0xacf2('0xa4')][_0xacf2('0xa6')]){delete _0x300112[_0xacf2('0xa4')][_0xacf2('0xa6')];}return rp(_0x300112);})[_0xacf2('0x2b')](function(_0x2b95fe){if(_0x2b95fe){_0x58fb6a[_0xacf2('0x25')](_0x2b95fe[_0xacf2('0xa4')]);logger[_0xacf2('0x69')](_0x2b95fe[_0xacf2('0x94')]);if(_[_0xacf2('0xa7')](_0xc7a59a[_0xacf2('0x3a')]['path'],_0xacf2('0x4f'))&&_0x2b95fe[_0xacf2('0xa8')]==0x1f4){return _0x58fb6a['sendStatus'](_0x2b95fe[_0xacf2('0xa8')]);}else{return _0x58fb6a[_0xacf2('0x1f')](_0x2b95fe['statusCode'])['send'](_0x2b95fe[_0xacf2('0x94')]);}}else{return _0x58fb6a[_0xacf2('0x2f')](0xc8);}})[_0xacf2('0x4b')](handleError(_0x58fb6a,null));};exports[_0xacf2('0xa9')]=function(_0x1a224b,_0x11dec4,_0x40eb46){return BPromise[_0xacf2('0xaa')]()[_0xacf2('0x2b')](function(){if(!_0x1a224b['query'][_0xacf2('0x8')]){throw new Error(_0xacf2('0xab'));}if(!_0x1a224b[_0xacf2('0x3a')]['port']){throw new Error(_0xacf2('0x9e'));}var _0x2b633e=_0x1a224b[_0xacf2('0x3a')][_0xacf2('0x9f')]?_0x1a224b[_0xacf2('0x3a')][_0xacf2('0x9f')]+':'+_0x1a224b['query']['port']:_0xacf2('0xa0')+_0x1a224b[_0xacf2('0x3a')][_0xacf2('0x9d')];var _0x3144b3=_0x1a224b[_0xacf2('0x3a')][_0xacf2('0x20')]?_0x1a224b[_0xacf2('0x3a')]['json']:!![];var _0x244343=_0x1a224b['query']['encoding']?_0x1a224b[_0xacf2('0x3a')]['encoding']:null;var _0xedb93e={'method':_0x1a224b['method'],'uri':util[_0xacf2('0x54')]('%s%s',_0x2b633e,_0x1a224b[_0xacf2('0x3a')]['path']),'json':_0x3144b3,'resolveWithFullResponse':!![],'encoding':_0x244343,'body':_0x1a224b[_0xacf2('0x94')]};if(_0x1a224b[_0xacf2('0xa4')]){_0xedb93e[_0xacf2('0xa4')]=_0x1a224b[_0xacf2('0xa4')];if(_0xedb93e[_0xacf2('0xa4')][_0xacf2('0xa5')]){delete _0xedb93e[_0xacf2('0xa4')][_0xacf2('0xa5')];}}if(_0xedb93e[_0xacf2('0xa4')][_0xacf2('0xa6')]){delete _0xedb93e[_0xacf2('0xa4')][_0xacf2('0xa6')];}return rp(_0xedb93e);})['then'](function(_0x255aa2){if(_0x255aa2){_0x11dec4['set'](_0x255aa2['headers']);logger['info'](_0x255aa2[_0xacf2('0x94')]);return _0x11dec4[_0xacf2('0x1f')](_0x255aa2['statusCode'])[_0xacf2('0x32')](_0x255aa2[_0xacf2('0x94')]);}else{return _0x11dec4[_0xacf2('0x2f')](0xc8);}})['catch'](handleError(_0x11dec4,null));}; \ No newline at end of file +var _0x60ed=['Plugins','end','error','stack','name','send','index','map','Plugin','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','include','findAll','catch','show','rawAttributes','includeAll','find','params','server/files/plugins','format','%s.zip','basename','zip','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','method','statusCode','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x1a87bd,_0x51ea95){var _0x6a2313=function(_0x1aa260){while(--_0x1aa260){_0x1a87bd['push'](_0x1a87bd['shift']());}};_0x6a2313(++_0x51ea95);}(_0x60ed,0x1db));var _0xd60e=function(_0x4650ab,_0x25ec31){_0x4650ab=_0x4650ab-0x0;var _0x672ad4=_0x60ed[_0x4650ab];return _0x672ad4;};'use strict';var emlformat=require(_0xd60e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd60e('0x1'));var rp=require(_0xd60e('0x2'));var moment=require(_0xd60e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd60e('0x4'));var path=require(_0xd60e('0x5'));var sox=require(_0xd60e('0x6'));var csv=require(_0xd60e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd60e('0x8'));var squel=require(_0xd60e('0x9'));var crypto=require(_0xd60e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd60e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd60e('0xc'));var Papa=require('papaparse');var extract=require(_0xd60e('0xd'));var rimraf=require(_0xd60e('0xe'));var archiver=require(_0xd60e('0xf'));var Redis=require(_0xd60e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd60e('0x11'));var as=require(_0xd60e('0x12'));var hardwareService=require(_0xd60e('0x13'));var logger=require('../../config/logger')(_0xd60e('0x14'));var utils=require(_0xd60e('0x15'));var config=require(_0xd60e('0x16'));var licenseUtil=require(_0xd60e('0x17'));var db=require(_0xd60e('0x18'))['db'];config[_0xd60e('0x19')]=_[_0xd60e('0x1a')](config[_0xd60e('0x19')],{'host':_0xd60e('0x1b'),'port':0x18eb});var socket=require(_0xd60e('0x1c'))(new Redis(config['redis']));require(_0xd60e('0x1d'))[_0xd60e('0x1e')](socket);function respondWithStatusCode(_0x3cfc03,_0x3dbcbd){_0x3dbcbd=_0x3dbcbd||0xcc;return function(_0x3d66e6){if(_0x3d66e6){return _0x3cfc03[_0xd60e('0x1f')](_0x3dbcbd);}return _0x3cfc03[_0xd60e('0x20')](_0x3dbcbd)['end']();};}function respondWithResult(_0x3ad839,_0x4e49d9){_0x4e49d9=_0x4e49d9||0xc8;return function(_0x55fdac){if(_0x55fdac){return _0x3ad839['status'](_0x4e49d9)[_0xd60e('0x21')](_0x55fdac);}};}function respondWithFilteredResult(_0x12458c,_0x60c61f){return function(_0x13f887){if(_0x13f887){var _0x1cedad=typeof _0x60c61f['offset']===_0xd60e('0x22')&&typeof _0x60c61f['limit']===_0xd60e('0x22');var _0x5addb3=_0x13f887[_0xd60e('0x23')];var _0x4d529f=_0x1cedad?0x0:_0x60c61f['offset'];var _0x2754e5=_0x1cedad?_0x13f887[_0xd60e('0x23')]:_0x60c61f[_0xd60e('0x24')]+_0x60c61f[_0xd60e('0x25')];var _0x1253c9;if(_0x2754e5>=_0x5addb3){_0x2754e5=_0x5addb3;_0x1253c9=0xc8;}else{_0x1253c9=0xce;}_0x12458c[_0xd60e('0x20')](_0x1253c9);return _0x12458c[_0xd60e('0x26')](_0xd60e('0x27'),_0x4d529f+'-'+_0x2754e5+'/'+_0x5addb3)[_0xd60e('0x21')](_0x13f887);}return null;};}function patchUpdates(_0x4b20b3){return function(_0x3dc3a7){try{jsonpatch[_0xd60e('0x28')](_0x3dc3a7,_0x4b20b3,!![]);}catch(_0x256cdc){return BPromise[_0xd60e('0x29')](_0x256cdc);}return _0x3dc3a7[_0xd60e('0x2a')]();};}function saveUpdates(_0x364be2,_0x2009d6){return function(_0x14fed3){if(_0x14fed3){return _0x14fed3[_0xd60e('0x2b')](_0x364be2)[_0xd60e('0x2c')](function(_0x1b2947){return _0x1b2947;});}return null;};}function removeEntity(_0x4ed6fb,_0x1930d2){return function(_0x43f3c9){if(_0x43f3c9){return _0x43f3c9[_0xd60e('0x2d')]()['then'](function(){var _0x532c19=_0x43f3c9[_0xd60e('0x2e')]({'plain':!![]});var _0xdded74=_0xd60e('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0xdded74,'resourceId':_0x532c19['id']}})[_0xd60e('0x2c')](function(){return _0x43f3c9;});})[_0xd60e('0x2c')](function(){_0x4ed6fb[_0xd60e('0x20')](0xcc)[_0xd60e('0x30')]();});}};}function handleEntityNotFound(_0xa2c6ac,_0x476b56){return function(_0x226f37){if(!_0x226f37){_0xa2c6ac['sendStatus'](0x194);}return _0x226f37;};}function handleError(_0x318605,_0x161a82){_0x161a82=_0x161a82||0x1f4;return function(_0x2d4e16){logger[_0xd60e('0x31')](_0x2d4e16[_0xd60e('0x32')]);if(_0x2d4e16[_0xd60e('0x33')]){delete _0x2d4e16['name'];}_0x318605[_0xd60e('0x20')](_0x161a82)[_0xd60e('0x34')](_0x2d4e16);};}exports[_0xd60e('0x35')]=function(_0x228943,_0x3be3f8){var _0x577129={},_0x1b8b96={},_0xaf8856={'count':0x0,'rows':[]};var _0x13c3ef=_[_0xd60e('0x36')](db[_0xd60e('0x37')]['rawAttributes'],function(_0x55a509){return{'name':_0x55a509[_0xd60e('0x38')],'type':_0x55a509['type'][_0xd60e('0x39')]};});_0x1b8b96[_0xd60e('0x3a')]=_[_0xd60e('0x36')](_0x13c3ef,'name');_0x1b8b96[_0xd60e('0x3b')]=_[_0xd60e('0x3c')](_0x228943[_0xd60e('0x3b')]);_0x1b8b96[_0xd60e('0x3d')]=_[_0xd60e('0x3e')](_0x1b8b96[_0xd60e('0x3a')],_0x1b8b96['query']);_0x577129[_0xd60e('0x3f')]=_['intersection'](_0x1b8b96[_0xd60e('0x3a')],qs[_0xd60e('0x40')](_0x228943['query'][_0xd60e('0x40')]));_0x577129[_0xd60e('0x3f')]=_0x577129[_0xd60e('0x3f')][_0xd60e('0x41')]?_0x577129['attributes']:_0x1b8b96[_0xd60e('0x3a')];if(!_0x228943[_0xd60e('0x3b')][_0xd60e('0x42')](_0xd60e('0x43'))){_0x577129[_0xd60e('0x25')]=qs[_0xd60e('0x25')](_0x228943['query'][_0xd60e('0x25')]);_0x577129[_0xd60e('0x24')]=qs[_0xd60e('0x24')](_0x228943[_0xd60e('0x3b')]['offset']);}_0x577129[_0xd60e('0x44')]=qs['sort'](_0x228943['query'][_0xd60e('0x45')]);_0x577129[_0xd60e('0x46')]=qs[_0xd60e('0x3d')](_[_0xd60e('0x47')](_0x228943[_0xd60e('0x3b')],_0x1b8b96['filters']),_0x13c3ef);if(_0x228943[_0xd60e('0x3b')]['filter']){_0x577129['where']=_[_0xd60e('0x48')](_0x577129[_0xd60e('0x46')],{'$or':_['map'](_0x13c3ef,function(_0x39166a){if(_0x39166a[_0xd60e('0x49')]!=='VIRTUAL'){var _0x3cd0ab={};_0x3cd0ab[_0x39166a[_0xd60e('0x33')]]={'$like':'%'+_0x228943['query'][_0xd60e('0x4a')]+'%'};return _0x3cd0ab;}})});}_0x577129=_['merge']({},_0x577129,_0x228943[_0xd60e('0x4b')]);var _0x110e98={'where':_0x577129[_0xd60e('0x46')]};return db[_0xd60e('0x37')]['count'](_0x110e98)[_0xd60e('0x2c')](function(_0x7222cc){_0xaf8856[_0xd60e('0x23')]=_0x7222cc;if(_0x228943[_0xd60e('0x3b')]['includeAll']){_0x577129[_0xd60e('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0xd60e('0x4d')](_0x577129);})[_0xd60e('0x2c')](function(_0x2336c2){_0xaf8856['rows']=_0x2336c2;return _0xaf8856;})[_0xd60e('0x2c')](respondWithFilteredResult(_0x3be3f8,_0x577129))[_0xd60e('0x4e')](handleError(_0x3be3f8,null));};exports[_0xd60e('0x4f')]=function(_0x51ce77,_0x2cddbf){var _0x5e868c={'raw':!![],'where':{'id':_0x51ce77['params']['id']}},_0x23ac7e={};_0x23ac7e[_0xd60e('0x3a')]=_['keys'](db[_0xd60e('0x37')][_0xd60e('0x50')]);_0x23ac7e[_0xd60e('0x3b')]=_[_0xd60e('0x3c')](_0x51ce77['query']);_0x23ac7e['filters']=_[_0xd60e('0x3e')](_0x23ac7e[_0xd60e('0x3a')],_0x23ac7e[_0xd60e('0x3b')]);_0x5e868c[_0xd60e('0x3f')]=_[_0xd60e('0x3e')](_0x23ac7e[_0xd60e('0x3a')],qs[_0xd60e('0x40')](_0x51ce77[_0xd60e('0x3b')][_0xd60e('0x40')]));_0x5e868c['attributes']=_0x5e868c['attributes'][_0xd60e('0x41')]?_0x5e868c['attributes']:_0x23ac7e['model'];if(_0x51ce77[_0xd60e('0x3b')][_0xd60e('0x51')]){_0x5e868c[_0xd60e('0x4c')]=[{'all':!![]}];}_0x5e868c=_['merge']({},_0x5e868c,_0x51ce77[_0xd60e('0x4b')]);return db[_0xd60e('0x37')][_0xd60e('0x52')](_0x5e868c)[_0xd60e('0x2c')](handleEntityNotFound(_0x2cddbf,null))[_0xd60e('0x2c')](respondWithResult(_0x2cddbf,null))[_0xd60e('0x4e')](handleError(_0x2cddbf,null));};exports['download']=function(_0x777529,_0x2af747,_0x3c2061){return db[_0xd60e('0x37')]['find']({'where':{'id':_0x777529[_0xd60e('0x53')]['id']},'attributes':[_0xd60e('0x33'),_0xd60e('0x5')],'raw':!![]})[_0xd60e('0x2c')](handleEntityNotFound(_0x2af747,null))[_0xd60e('0x2c')](function(_0x59b070){if(_0x59b070){var _0x5d596e=path['join'](config['root'],_0xd60e('0x54'),util[_0xd60e('0x55')](_0xd60e('0x56'),path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')])));var _0x2f45ec=fs['createWriteStream'](_0x5d596e);var _0x725b5b=archiver(_0xd60e('0x58'),{'zlib':{'level':0x9}});_0x725b5b['on']('warning',function(_0x4158a5){if(_0x4158a5[_0xd60e('0x59')]===_0xd60e('0x5a')){logger['error'](_0x4158a5);}else{throw new db['Sequelize'][(_0xd60e('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x725b5b['on'](_0xd60e('0x31'),function(_0x1d1fd0){throw new db[(_0xd60e('0x5c'))][(_0xd60e('0x5b'))](_0xd60e('0x5d'));});_0x725b5b['pipe'](_0x2f45ec);_0x725b5b[_0xd60e('0x5e')](_0xd60e('0x5f'),{'cwd':path[_0xd60e('0x60')](config['root'],_0xd60e('0x54'),path[_0xd60e('0x61')](_0x59b070[_0xd60e('0x5')])),'ignore':[path[_0xd60e('0x60')](path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')]),_0xd60e('0x62')),path['join'](path[_0xd60e('0x57')](_0x59b070['path']),_0xd60e('0x63'))],'nodir':!![]})['finalize']();_0x2f45ec['on']('close',function(){if(!fs[_0xd60e('0x64')](_0x5d596e)){throw new db[(_0xd60e('0x5c'))][(_0xd60e('0x5b'))](_0xd60e('0x65'));}return _0x2af747[_0xd60e('0x66')](_0x5d596e,util[_0xd60e('0x55')]('%s.zip',path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')])),function(_0x3c14bb){if(_0x3c14bb){throw new db['Sequelize'][(_0xd60e('0x5b'))](_0xd60e('0x67'));}fs[_0xd60e('0x68')](_0x5d596e);logger[_0xd60e('0x69')](_0xd60e('0x6a'));logger[_0xd60e('0x69')](_0xd60e('0x6b'));});});}return null;})['catch'](handleError(_0x2af747,null));};exports[_0xd60e('0x6c')]=function(_0x50904d,_0x50f2ef,_0x50bb4e){var _0x11e13f=path[_0xd60e('0x57')](_0x50904d['file'][_0xd60e('0x6d')],path[_0xd60e('0x6e')](_0x50904d[_0xd60e('0x6f')][_0xd60e('0x6d')]));var _0x296619=path['join'](config[_0xd60e('0x70')],_0xd60e('0x54'),_0x50904d[_0xd60e('0x6f')]['filename']);var _0x5c157a=path[_0xd60e('0x60')](config[_0xd60e('0x70')],_0xd60e('0x54'),_0x11e13f);logger[_0xd60e('0x69')](_0xd60e('0x71'),_0x296619);logger[_0xd60e('0x69')](_0xd60e('0x72'),_0x5c157a);try{fs['chmodSync'](_0x296619,parseInt('0777',0x8));extract(_0x296619,{'dir':_0x5c157a},function(_0x46c8ec){if(_0x46c8ec){logger[_0xd60e('0x31')](_0x46c8ec);handleError(_0x46c8ec,!![]);};var _0x2e716a=fs[_0xd60e('0x73')](_0x5c157a);if(_0x2e716a[_0xd60e('0x41')]>0x1){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}var _0x1613a5=fs[_0xd60e('0x75')](path['join'](_0x5c157a,_0x2e716a[0x0]));if(_0x1613a5['isFile']()){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}if(_0x1613a5[_0xd60e('0x76')]()){var _0x3ebd0b=fs['readdirSync'](path[_0xd60e('0x60')](_0x5c157a,_0x2e716a[0x0]));if(_0x3ebd0b[_0xd60e('0x41')]===0x0){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}var _0xee3352=_0x3ebd0b['some'](function(_0x151129){return _0x151129===_0xd60e('0x77');});if(!_0xee3352){return _0x50bb4e(new Error(_0xd60e('0x78')));}var _0x29a939=fs['readFileSync'](path[_0xd60e('0x60')](_0x5c157a,_0x2e716a[0x0],_0xd60e('0x77')));var _0x1a9ae3=JSON[_0xd60e('0x79')](_0x29a939);if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x33')]){return _0x50bb4e(new Error(_0xd60e('0x7a')));}if(_0xd60e('0x22')==typeof _0x1a9ae3['type']){return _0x50bb4e(new Error(_0xd60e('0x7b')));}if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x7c')]){return _0x50bb4e(new Error(_0xd60e('0x7d')));}if(_0xd60e('0x22')==typeof _0x1a9ae3['parameters']){return _0x50bb4e(new Error(_0xd60e('0x7e')));}if(_0x1a9ae3[_0xd60e('0x49')]===_0xd60e('0x7f')){if('undefined'==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]){return _0x50bb4e(new Error(_0xd60e('0x82')));}if('undefined'==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x83')]&&_0xd60e('0x22')==typeof _0x1a9ae3['parameters'][_0xd60e('0x81')][_0xd60e('0x84')]){return _0x50bb4e(new Error(_0xd60e('0x85')));}}else if(_0x1a9ae3[_0xd60e('0x49')]===_0xd60e('0x86')){if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x80')]['scriptName']){return _0x50bb4e(new Error(_0xd60e('0x87')));}if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x88')]){return _0x50bb4e(new Error(_0xd60e('0x89')));}}else{return _0x50bb4e(new Error(_0xd60e('0x8a')));}var _0x110c65=_0x1a9ae3[_0xd60e('0x33')];var _0x902c58=_0x1a9ae3[_0xd60e('0x8b')];var _0x405415=_0x1a9ae3[_0xd60e('0x49')];var _0xa34a5c=_0x1a9ae3[_0xd60e('0x8c')]?_0x1a9ae3['sidebar']:_0xd60e('0x8d');var _0x21df51=_0x1a9ae3[_0xd60e('0x8e')]?_0x1a9ae3['icon']:_0xd60e('0x8f');var _0x569bbe='';var _0x4afd5e='';var _0x458c8e='';var _0x38c450='';var _0x9b5e44=_0x1a9ae3['version'];if(_0x405415===_0xd60e('0x7f')){if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x83')]){var _0x2a7c2f=_0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x2a7c2f)){_0x569bbe=path[_0xd60e('0x60')](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x2a7c2f);}else{_0x569bbe=_0x2a7c2f;}}else{logger[_0xd60e('0x69')](_0xd60e('0x92'));}if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x84')]){var _0x1da356=_0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x1da356)){_0x4afd5e=path[_0xd60e('0x60')]('plugins',_0x11e13f,_0x2e716a[0x0],_0x1da356);}else{_0x4afd5e=_0x1da356;}}else{logger[_0xd60e('0x69')](_0xd60e('0x93'));}}else if(_0x405415===_0xd60e('0x86')){_0x458c8e=_0x1a9ae3['parameters'][_0xd60e('0x94')];_0x38c450=_0x1a9ae3['parameters']['scriptPath'];if('undefined'!=typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]){if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]['admin']){var _0x2a7c2f=_0x1a9ae3['parameters']['views'][_0xd60e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x2a7c2f)){_0x569bbe=path['join'](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x2a7c2f);}else{_0x569bbe=_0x2a7c2f;}}if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views']['agent']){var _0x1da356=_0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1da356)){_0x4afd5e=path['join'](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x1da356);}else{_0x4afd5e=_0x1da356;}}}}var _0x79a8a4={'name':_0x110c65,'description':_0x902c58,'path':path['join'](_0x11e13f,_0x2e716a[0x0]),'type':_0x405415,'sidebar':_0xa34a5c,'icon':_0x21df51,'adminUrl':_0x569bbe,'agentUrl':_0x4afd5e,'scriptName':_0x458c8e,'scriptPath':_0x38c450,'version':_0x9b5e44};removeReferences(_0x296619,null);return db[_0xd60e('0x37')][_0xd60e('0x95')](_0x79a8a4)[_0xd60e('0x2c')](function(_0x5eceb6){var _0x1705a5={'role':_0x50904d['body'][_0xd60e('0x96')],'userProfileId':_0x50904d[_0xd60e('0x97')][_0xd60e('0x98')]};if(!_0x1705a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1705a5[_0xd60e('0x96')]===_0xd60e('0x99')){var _0xf76354=_0x5eceb6[_0xd60e('0x2e')]({'plain':!![]});return db[_0xd60e('0x9a')][_0xd60e('0x52')]({'where':{'name':'Plugins','userProfileId':_0x1705a5['userProfileId']},'raw':!![]})[_0xd60e('0x2c')](function(_0x2ed652){if(_0x2ed652&&_0x2ed652[_0xd60e('0x9b')]===0x0){return db['UserProfileResource']['create']({'name':_0xf76354[_0xd60e('0x33')],'resourceId':_0xf76354['id'],'type':_0x2ed652[_0xd60e('0x33')],'sectionId':_0x2ed652['id']},{})[_0xd60e('0x2c')](function(){return _0x5eceb6;});}else{return _0x5eceb6;}})[_0xd60e('0x4e')](function(_0x3e03fc){logger[_0xd60e('0x31')](_0xd60e('0x9c'),_0x3e03fc);throw _0x3e03fc;});}return _0x5eceb6;})[_0xd60e('0x2c')](respondWithResult(_0x50f2ef,null))[_0xd60e('0x4e')](handleError(_0x50f2ef,null));}});}catch(_0x328dda){_0x50f2ef[_0xd60e('0x20')](0x1f4)[_0xd60e('0x34')](_0x328dda);}};function removeReferences(_0x4474cc,_0x510f60){try{if(_0x4474cc){fs[_0xd60e('0x68')](_0x4474cc);logger[_0xd60e('0x69')]('Zip\x20archive\x20removed');}if(_0x510f60){rimraf(_0x510f60,function(){});logger[_0xd60e('0x69')](_0xd60e('0x9d'));}}catch(_0x554b1d){logger[_0xd60e('0x31')](_0x554b1d);}}exports[_0xd60e('0x2b')]=function(_0x24b7ec,_0x52855a,_0x11c901){return db['Plugin'][_0xd60e('0x52')]({'where':{'id':_0x24b7ec['params']['id']}})[_0xd60e('0x2c')](handleEntityNotFound(_0x52855a,null))[_0xd60e('0x2c')](saveUpdates(_0x24b7ec[_0xd60e('0x97')],null))[_0xd60e('0x2c')](respondWithResult(_0x52855a,null))['catch'](handleError(_0x52855a,null));};exports[_0xd60e('0x9e')]=function(_0x5c1792,_0x583c47,_0x5a33f5){return db[_0xd60e('0x37')][_0xd60e('0x52')]({'where':{'id':_0x5c1792['params']['id']}})[_0xd60e('0x2c')](function(_0x2f2d9d){if(_0x2f2d9d){return _0x2f2d9d[_0xd60e('0x2d')]();}})[_0xd60e('0x2c')](function(_0x2ffc8f){rimraf(path[_0xd60e('0x60')](config[_0xd60e('0x70')],'server/files/plugins',path['dirname'](_0x2ffc8f[_0xd60e('0x5')])),function(){});return _0x2ffc8f;})['then'](handleEntityNotFound(_0x583c47,null))[_0xd60e('0x2c')](respondWithStatusCode(_0x583c47,null))[_0xd60e('0x4e')](handleError(_0x583c47,null));};exports[_0xd60e('0x9f')]=function(_0x4c58b0,_0x1a2650,_0x19c2b9){return BPromise[_0xd60e('0xa0')]()['then'](function(){if(!_0x4c58b0[_0xd60e('0x3b')]['path']){throw new Error(_0xd60e('0xa1'));}if(!_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')]){throw new Error(_0xd60e('0xa3'));}var _0x1960c4=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa4')]?_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa4')]+':'+_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')]:_0xd60e('0xa5')+_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')];var _0x518f65=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x21')]?_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x21')]:!![];var _0x203e95=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa6')]?_0x4c58b0[_0xd60e('0x3b')]['encoding']:null;var _0x5f3c16={'method':_0x4c58b0['method'],'uri':util['format'](_0xd60e('0xa7'),_0x1960c4,_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x5')]),'json':_0x518f65,'resolveWithFullResponse':!![],'encoding':_0x203e95,'qs':_0x4c58b0['query']};if(_0x4c58b0[_0xd60e('0xa8')]){_0x5f3c16[_0xd60e('0xa8')]=_0x4c58b0[_0xd60e('0xa8')];if(_0x5f3c16['headers'][_0xd60e('0xa9')]){delete _0x5f3c16['headers']['content-length'];}}if(_0x5f3c16['headers'][_0xd60e('0xaa')]){delete _0x5f3c16[_0xd60e('0xa8')][_0xd60e('0xaa')];}return rp(_0x5f3c16);})['then'](function(_0x2fe77f){if(_0x2fe77f){_0x1a2650[_0xd60e('0x26')](_0x2fe77f[_0xd60e('0xa8')]);logger[_0xd60e('0x69')](_0x2fe77f[_0xd60e('0x97')]);if(_[_0xd60e('0xab')](_0x4c58b0['query'][_0xd60e('0x5')],'download')&&_0x2fe77f['statusCode']==0x1f4){return _0x1a2650[_0xd60e('0x1f')](_0x2fe77f['statusCode']);}else{return _0x1a2650[_0xd60e('0x20')](_0x2fe77f['statusCode'])[_0xd60e('0x34')](_0x2fe77f['body']);}}else{return _0x1a2650[_0xd60e('0x1f')](0xc8);}})[_0xd60e('0x4e')](handleError(_0x1a2650,null));};exports['webhookPost']=function(_0x35d4a5,_0x28b807,_0x18f136){return BPromise[_0xd60e('0xa0')]()['then'](function(){if(!_0x35d4a5['query'][_0xd60e('0x5')]){throw new Error(_0xd60e('0xa1'));}if(!_0x35d4a5[_0xd60e('0x3b')]['port']){throw new Error(_0xd60e('0xa3'));}var _0x49c354=_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0xa4')]?_0x35d4a5[_0xd60e('0x3b')]['hostname']+':'+_0x35d4a5[_0xd60e('0x3b')]['port']:_0xd60e('0xa5')+_0x35d4a5['query']['port'];var _0x20a5d7=_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0x21')]?_0x35d4a5[_0xd60e('0x3b')]['json']:!![];var _0x6b973f=_0x35d4a5[_0xd60e('0x3b')]['encoding']?_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0xa6')]:null;var _0x136c1d={'method':_0x35d4a5[_0xd60e('0xac')],'uri':util[_0xd60e('0x55')]('%s%s',_0x49c354,_0x35d4a5['query'][_0xd60e('0x5')]),'json':_0x20a5d7,'resolveWithFullResponse':!![],'encoding':_0x6b973f,'body':_0x35d4a5[_0xd60e('0x97')]};if(_0x35d4a5['headers']){_0x136c1d[_0xd60e('0xa8')]=_0x35d4a5[_0xd60e('0xa8')];if(_0x136c1d[_0xd60e('0xa8')]['content-length']){delete _0x136c1d[_0xd60e('0xa8')][_0xd60e('0xa9')];}}if(_0x136c1d['headers']['content-type']){delete _0x136c1d[_0xd60e('0xa8')][_0xd60e('0xaa')];}return rp(_0x136c1d);})['then'](function(_0x420822){if(_0x420822){_0x28b807[_0xd60e('0x26')](_0x420822[_0xd60e('0xa8')]);logger['info'](_0x420822[_0xd60e('0x97')]);return _0x28b807[_0xd60e('0x20')](_0x420822[_0xd60e('0xad')])[_0xd60e('0x34')](_0x420822['body']);}else{return _0x28b807['sendStatus'](0xc8);}})[_0xd60e('0x4e')](handleError(_0x28b807,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 166a470..aeda1d7 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 _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','Plugin'];(function(_0x19bd96,_0xdd0e6){var _0x2b5b25=function(_0x4342fb){while(--_0x4342fb){_0x19bd96['push'](_0x19bd96['shift']());}};_0x2b5b25(++_0xdd0e6);}(_0xdd68,0x196));var _0x8dd6=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0xdd68[_0x3b2369];return _0x5a1367;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var Plugin=require('../../mysqldb')['db'][_0x8dd6('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){PluginEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);PluginEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x8dd6('0x7')]=PluginEvents; \ No newline at end of file +var _0x13f5=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x513f('0x0'));var Plugin=require(_0x513f('0x1'))['db'][_0x513f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x513f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x513f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c30ef){return function(_0xd61dcf,_0x10ae9e,_0x3a9531){PluginEvents[_0x513f('0x5')](_0x5c30ef+':'+_0xd61dcf['id'],_0xd61dcf);PluginEvents[_0x513f('0x5')](_0x5c30ef,_0xd61dcf);_0x3a9531(null);};}for(var e in events){if(events[_0x513f('0x6')](e)){var event=events[e];Plugin[_0x513f('0x7')](e,emitEvent(event));}}module[_0x513f('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 6bb8937..185ece3 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 _0xb9f0=['util','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','lodash'];(function(_0x463683,_0x403c60){var _0x1c7fa1=function(_0x224c11){while(--_0x224c11){_0x463683['push'](_0x463683['shift']());}};_0x1c7fa1(++_0x403c60);}(_0xb9f0,0x1df));var _0x0b9f=function(_0x34d6bd,_0x55b744){_0x34d6bd=_0x34d6bd-0x0;var _0x248396=_0xb9f0[_0x34d6bd];return _0x248396;};'use strict';var _=require(_0x0b9f('0x0'));var util=require(_0x0b9f('0x1'));var logger=require('../../config/logger')(_0x0b9f('0x2'));var moment=require(_0x0b9f('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b9f('0x4'));var fs=require('fs');var path=require(_0x0b9f('0x5'));var rimraf=require(_0x0b9f('0x6'));var config=require(_0x0b9f('0x7'));var attributes=require(_0x0b9f('0x8'));module[_0x0b9f('0x9')]=function(_0x73bb6f,_0x5d4f9b){return _0x73bb6f[_0x0b9f('0xa')]('Plugin',attributes,{'tableName':_0x0b9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f4a=['./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2492f,_0x40f73c){var _0x32372c=function(_0x423de8){while(--_0x423de8){_0x2492f['push'](_0x2492f['shift']());}};_0x32372c(++_0x40f73c);}(_0x6f4a,0x155));var _0xa6f4=function(_0x3824ed,_0x466288){_0x3824ed=_0x3824ed-0x0;var _0x1ae4d3=_0x6f4a[_0x3824ed];return _0x1ae4d3;};'use strict';var _=require('lodash');var util=require(_0xa6f4('0x0'));var logger=require(_0xa6f4('0x1'))(_0xa6f4('0x2'));var moment=require(_0xa6f4('0x3'));var BPromise=require(_0xa6f4('0x4'));var rp=require(_0xa6f4('0x5'));var fs=require('fs');var path=require(_0xa6f4('0x6'));var rimraf=require(_0xa6f4('0x7'));var config=require(_0xa6f4('0x8'));var attributes=require(_0xa6f4('0x9'));module[_0xa6f4('0xa')]=function(_0x16f48c,_0x266b73){return _0x16f48c[_0xa6f4('0xb')](_0xa6f4('0xc'),attributes,{'tableName':_0xa6f4('0xd'),'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 df01151..ce6e4a8 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 _0x7a97=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','moment','randomstring'];(function(_0x37914d,_0x4209c0){var _0x2b4118=function(_0x10de2){while(--_0x10de2){_0x37914d['push'](_0x37914d['shift']());}};_0x2b4118(++_0x4209c0);}(_0x7a97,0x9e));var _0x77a9=function(_0x2d1284,_0x12d78a){_0x2d1284=_0x2d1284-0x0;var _0x552b69=_0x7a97[_0x2d1284];return _0x552b69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x77a9('0x0'));var BPromise=require('bluebird');var rs=require(_0x77a9('0x1'));var fs=require('fs');var Redis=require(_0x77a9('0x2'));var db=require(_0x77a9('0x3'))['db'];var utils=require(_0x77a9('0x4'));var logger=require(_0x77a9('0x5'))(_0x77a9('0x6'));var config=require(_0x77a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77a9('0x8')]['http']({'port':0x232a});config[_0x77a9('0x9')]=_['defaults'](config[_0x77a9('0x9')],{'host':_0x77a9('0xa'),'port':0x18eb});var socket=require(_0x77a9('0xb'))(new Redis(config['redis']));require(_0x77a9('0xc'))[_0x77a9('0xd')](socket);function respondWithRpcPromise(_0x13674d,_0x570ba4,_0x5d1dff){return new BPromise(function(_0x1ad625,_0x13f49e){return client[_0x77a9('0xe')](_0x13674d,_0x5d1dff)['then'](function(_0x2f2246){logger[_0x77a9('0xf')](_0x77a9('0x10'),_0x570ba4,_0x77a9('0x11'));logger[_0x77a9('0x12')](_0x77a9('0x13'),_0x570ba4,_0x77a9('0x11'),JSON['stringify'](_0x2f2246));if(_0x2f2246[_0x77a9('0x14')]){if(_0x2f2246[_0x77a9('0x14')][_0x77a9('0x15')]===0x1f4){logger[_0x77a9('0x14')](_0x77a9('0x10'),_0x570ba4,_0x2f2246[_0x77a9('0x14')][_0x77a9('0x16')]);return _0x13f49e(_0x2f2246[_0x77a9('0x14')]['message']);}logger['error'](_0x77a9('0x10'),_0x570ba4,_0x2f2246[_0x77a9('0x14')][_0x77a9('0x16')]);return _0x1ad625(_0x2f2246['error'][_0x77a9('0x16')]);}else{logger[_0x77a9('0xf')](_0x77a9('0x10'),_0x570ba4,'request\x20sent');_0x1ad625(_0x2f2246[_0x77a9('0x17')][_0x77a9('0x16')]);}})[_0x77a9('0x18')](function(_0x41a12c){logger[_0x77a9('0x14')](_0x77a9('0x10'),_0x570ba4,_0x41a12c);_0x13f49e(_0x41a12c);});});}exports[_0x77a9('0x19')]=function(_0x5eef23){var _0x35edc0=this;return new Promise(function(_0x2ba22d,_0x39107f){return db[_0x77a9('0x1a')][_0x77a9('0x1b')](_0x5eef23[_0x77a9('0x1c')],{'raw':_0x5eef23['options']?_0x5eef23[_0x77a9('0x1d')][_0x77a9('0x1e')]===undefined?!![]:![]:!![]})[_0x77a9('0x1f')](function(_0x1ef734){logger[_0x77a9('0xf')](_0x77a9('0x19'),_0x5eef23);logger[_0x77a9('0x12')]('CreatePlugin',_0x5eef23,JSON['stringify'](_0x1ef734));_0x2ba22d(_0x1ef734);})[_0x77a9('0x18')](function(_0x2d195e){logger[_0x77a9('0x14')](_0x77a9('0x19'),_0x2d195e[_0x77a9('0x16')],_0x5eef23);_0x39107f(_0x35edc0['error'](0x1f4,_0x2d195e[_0x77a9('0x16')]));});});}; \ No newline at end of file +var _0xfbba=['Plugin,\x20%s,\x20%s','info','catch','CreatePlugin','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x583e98,_0x264428){var _0x186295=function(_0x86921c){while(--_0x86921c){_0x583e98['push'](_0x583e98['shift']());}};_0x186295(++_0x264428);}(_0xfbba,0x118));var _0xafbb=function(_0x32efa9,_0x18788a){_0x32efa9=_0x32efa9-0x0;var _0x806f65=_0xfbba[_0x32efa9];return _0x806f65;};'use strict';var _=require('lodash');var util=require(_0xafbb('0x0'));var moment=require(_0xafbb('0x1'));var BPromise=require(_0xafbb('0x2'));var rs=require(_0xafbb('0x3'));var fs=require('fs');var Redis=require(_0xafbb('0x4'));var db=require(_0xafbb('0x5'))['db'];var utils=require(_0xafbb('0x6'));var logger=require(_0xafbb('0x7'))(_0xafbb('0x8'));var config=require(_0xafbb('0x9'));var jayson=require(_0xafbb('0xa'));var client=jayson[_0xafbb('0xb')][_0xafbb('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xafbb('0xd')],{'host':_0xafbb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafbb('0xd')]));require(_0xafbb('0xf'))[_0xafbb('0x10')](socket);function respondWithRpcPromise(_0x26914b,_0xfa481,_0x25d83a){return new BPromise(function(_0x53376c,_0x3d962e){return client[_0xafbb('0x11')](_0x26914b,_0x25d83a)[_0xafbb('0x12')](function(_0x169c94){logger['info']('Plugin,\x20%s,\x20%s',_0xfa481,_0xafbb('0x13'));logger[_0xafbb('0x14')](_0xafbb('0x15'),_0xfa481,_0xafbb('0x13'),JSON[_0xafbb('0x16')](_0x169c94));if(_0x169c94['error']){if(_0x169c94['error'][_0xafbb('0x17')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xfa481,_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);return _0x3d962e(_0x169c94['error'][_0xafbb('0x19')]);}logger[_0xafbb('0x18')](_0xafbb('0x1a'),_0xfa481,_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);return _0x53376c(_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);}else{logger[_0xafbb('0x1b')](_0xafbb('0x1a'),_0xfa481,_0xafbb('0x13'));_0x53376c(_0x169c94['result'][_0xafbb('0x19')]);}})[_0xafbb('0x1c')](function(_0x326328){logger[_0xafbb('0x18')]('Plugin,\x20%s,\x20%s',_0xfa481,_0x326328);_0x3d962e(_0x326328);});});}exports[_0xafbb('0x1d')]=function(_0x1cd268){var _0x560f7f=this;return new Promise(function(_0x5ed59f,_0x1101f5){return db['Plugin'][_0xafbb('0x1e')](_0x1cd268[_0xafbb('0x1f')],{'raw':_0x1cd268[_0xafbb('0x20')]?_0x1cd268[_0xafbb('0x20')][_0xafbb('0x21')]===undefined?!![]:![]:!![]})[_0xafbb('0x12')](function(_0x30ef2c){logger[_0xafbb('0x1b')]('CreatePlugin',_0x1cd268);logger[_0xafbb('0x14')]('CreatePlugin',_0x1cd268,JSON[_0xafbb('0x16')](_0x30ef2c));_0x5ed59f(_0x30ef2c);})[_0xafbb('0x1c')](function(_0x17f265){logger[_0xafbb('0x18')](_0xafbb('0x1d'),_0x17f265[_0xafbb('0x19')],_0x1cd268);_0x1101f5(_0x560f7f['error'](0x1f4,_0x17f265['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0c970a9..e6e5fce 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 _0xc74d=['remove','update','emit','removeListener','register','plugin:','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc74d,0x126));var _0xdc74=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc74d[_0x178e48];return _0x440d7e;};'use strict';var PluginEvents=require(_0xdc74('0x0'));var events=[_0xdc74('0x1'),_0xdc74('0x2'),_0xdc74('0x3')];function createListener(_0x12581b,_0x1af138){return function(_0x3fa5c9){_0x1af138[_0xdc74('0x4')](_0x12581b,_0x3fa5c9);};}function removeListener(_0x2c91af,_0x4c6b9e){return function(){PluginEvents[_0xdc74('0x5')](_0x2c91af,_0x4c6b9e);};}exports[_0xdc74('0x6')]=function(_0x451331){for(var _0xe81b23=0x0,_0x194227=events['length'];_0xe81b23<_0x194227;_0xe81b23++){var _0x26a771=events[_0xe81b23];var _0x691186=createListener(_0xdc74('0x7')+_0x26a771,_0x451331);PluginEvents['on'](_0x26a771,_0x691186);}}; \ No newline at end of file +var _0x0324=['removeListener','register','length','plugin:','./plugin.events','emit'];(function(_0x24655a,_0x7fa437){var _0x5f4ad4=function(_0x5a3f70){while(--_0x5a3f70){_0x24655a['push'](_0x24655a['shift']());}};_0x5f4ad4(++_0x7fa437);}(_0x0324,0x148));var _0x4032=function(_0x4b3dd1,_0x21edc3){_0x4b3dd1=_0x4b3dd1-0x0;var _0x21598a=_0x0324[_0x4b3dd1];return _0x21598a;};'use strict';var PluginEvents=require(_0x4032('0x0'));var events=['save','remove','update'];function createListener(_0x2ac231,_0x336f64){return function(_0x2ee51f){_0x336f64[_0x4032('0x1')](_0x2ac231,_0x2ee51f);};}function removeListener(_0x269573,_0x2f958d){return function(){PluginEvents[_0x4032('0x2')](_0x269573,_0x2f958d);};}exports[_0x4032('0x3')]=function(_0x479859){for(var _0x3c8e1e=0x0,_0x14cf95=events[_0x4032('0x4')];_0x3c8e1e<_0x14cf95;_0x3c8e1e++){var _0x18e0c1=events[_0x3c8e1e];var _0x2b1e59=createListener(_0x4032('0x5')+_0x18e0c1,_0x479859);PluginEvents['on'](_0x18e0c1,_0x2b1e59);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d9a146c..31d7171 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(_0xe0a43b,_0xddcb99){var _0x212ae5=function(_0x158720){while(--_0x158720){_0xe0a43b['push'](_0xe0a43b['shift']());}};_0x212ae5(++_0xddcb99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x30e063,_0xb1d240){var _0x1439f5=function(_0x473e6c){while(--_0x473e6c){_0x30e063['push'](_0x30e063['shift']());}};_0x1439f5(++_0xb1d240);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 f24a5b7..f97466f 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 _0xb332=['dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20id','lodash','../../config/logger','api','child_process','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','list','reject','motion2','length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb332,0xd9));var _0x2b33=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xb332[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0x2b33('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var path=require('path');var exec=require(_0x2b33('0x3'))['exec'];var BPromise=require(_0x2b33('0x4'));function handleEntityNotFound(_0x4c6634,_0x34b111){return function(_0x5e5e86){if(!_0x5e5e86){_0x4c6634[_0x2b33('0x5')](0x194);;}return _0x5e5e86;};}function respondWithResult(_0x22d66,_0x478214){_0x478214=_0x478214||0xc8;return function(_0x461d44){if(_0x461d44){return _0x22d66['status'](_0x478214)['json'](_0x461d44);}return null;};}function handleError(_0x4302b7,_0x5f29ab){_0x5f29ab=_0x5f29ab||0x1f4;return function(_0xb3aeab){logger[_0x2b33('0x6')](_0xb3aeab[_0x2b33('0x7')]);if(_0xb3aeab[_0x2b33('0x8')]){delete _0xb3aeab['name'];}_0x4302b7[_0x2b33('0x9')](_0x5f29ab)[_0x2b33('0xa')](_0xb3aeab);};}function execChildProcess(){return new BPromise(function(_0x1be19d,_0x1d83a6){exec(_0x2b33('0xb'),function(_0xf1e5e5,_0x5251b,_0x2b106e){logger[_0x2b33('0xc')](_0x5251b);logger[_0x2b33('0xc')](_0x2b106e);if(_0xf1e5e5){logger[_0x2b33('0x6')](_0xf1e5e5);return _0x1d83a6(_0xf1e5e5);}return _0x1be19d(_0x5251b);});});}exports['index']=function(_0x183773,_0xa44d45){return pm2[_0x2b33('0xd')]()['then'](function(_0x173c75){if(_0x173c75){var _0x4d39db=_[_0x2b33('0xe')](_0x173c75,function(_0x17292f){return _0x17292f[_0x2b33('0x8')]==='express'||_0x17292f['name']===_0x2b33('0xf');});return{'rows':_0x4d39db,'count':_0x4d39db[_0x2b33('0x10')]};}return null;})[_0x2b33('0x11')](respondWithResult(_0xa44d45,null))[_0x2b33('0x12')](handleError(_0xa44d45,null));};exports[_0x2b33('0x13')]=function(_0x4d69d0,_0x554ab3){return pm2['describe'](_0x4d69d0[_0x2b33('0x14')]['id'])['then'](respondWithResult(_0x554ab3,null))['then'](handleEntityNotFound(_0x554ab3,null))[_0x2b33('0x12')](handleError(_0x554ab3,null));};exports[_0x2b33('0x15')]=function(_0x205d8f,_0x539c5f){if(_0x205d8f[_0x2b33('0x16')]['name']&&_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]){var _0x8c8dc2=path[_0x2b33('0x18')](__dirname,_0x2b33('0x19'),_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]);var _0x4fb725=process[_0x2b33('0x1a')]();process[_0x2b33('0x1b')](path[_0x2b33('0x1c')](_0x8c8dc2));return execChildProcess()[_0x2b33('0x11')](function(_0x58998e){process[_0x2b33('0x1b')](_0x4fb725);return pm2[_0x2b33('0x1d')]({'name':_0x205d8f[_0x2b33('0x16')]['name'],'script':_0x8c8dc2});})[_0x2b33('0x11')](function(_0x1b9a48){pm2[_0x2b33('0x1e')]();return _0x1b9a48[0x0];})[_0x2b33('0x11')](respondWithResult(_0x539c5f,0xc9))['catch'](handleError(_0x539c5f,null));}else{return _0x539c5f[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x1f')});}};exports['update']=function(_0x2e74d0,_0x341e0e){if(_0x2e74d0['body']['id']){delete _0x2e74d0[_0x2b33('0x16')]['id'];}var _0x53c2ad={'online':_0x2b33('0x20'),'stopped':'stop'};if(_0x53c2ad[_0x2b33('0x21')](_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')])){return pm2[_0x53c2ad[_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')]]](_0x2e74d0[_0x2b33('0x14')]['id'])[_0x2b33('0x11')](respondWithResult(_0x341e0e,0xc8))[_0x2b33('0x12')](handleError(_0x341e0e,null));}else{return _0x341e0e[_0x2b33('0x9')](0x1f4)[_0x2b33('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x106ea0,_0x2a081c){if(_0x106ea0[_0x2b33('0x16')]['id']){delete _0x106ea0[_0x2b33('0x16')]['id'];}if(_0x106ea0[_0x2b33('0x14')]['id']){return pm2['delete'](_0x106ea0['params']['id'])[_0x2b33('0x11')](function(_0x3d2aaa){pm2[_0x2b33('0x1e')]();return _0x3d2aaa[0x0];})[_0x2b33('0x11')](respondWithResult(_0x2a081c,null))[_0x2b33('0x12')](handleError(_0x2a081c,null));}else{return _0x2a081c[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x22')});}}; \ No newline at end of file +var _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0x54ef,0x112));var _0xf54e=function(_0x14962f,_0xf109c5){_0x14962f=_0x14962f-0x0;var _0x532300=_0x54ef[_0x14962f];return _0x532300;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bb22f1f..1a311f1 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cd2=['express','Router','./realtime.controller','get','getAgents','getQueues','exports'];(function(_0x170679,_0x20c787){var _0x5db9c0=function(_0x375a4c){while(--_0x375a4c){_0x170679['push'](_0x170679['shift']());}};_0x5db9c0(++_0x20c787);}(_0x8cd2,0x149));var _0x28cd=function(_0x49aa99,_0x4ef618){_0x49aa99=_0x49aa99-0x0;var _0x1786d7=_0x8cd2[_0x49aa99];return _0x1786d7;};'use strict';var express=require(_0x28cd('0x0'));var router=express[_0x28cd('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x28cd('0x2'));router[_0x28cd('0x3')]('/agents',auth['isAuthenticated'](),controller[_0x28cd('0x4')]);router[_0x28cd('0x3')]('/queues',auth['isAuthenticated'](),controller[_0x28cd('0x5')]);module[_0x28cd('0x6')]=router; \ No newline at end of file +var _0x632b=['isAuthenticated','get','/queues','getQueues','exports','express','./realtime.controller','/agents'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x632b,0x14d));var _0xb632=function(_0x3f38b4,_0x3ade17){_0x3f38b4=_0x3f38b4-0x0;var _0x4cf7eb=_0x632b[_0x3f38b4];return _0x4cf7eb;};'use strict';var express=require(_0xb632('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xb632('0x1'));router['get'](_0xb632('0x2'),auth[_0xb632('0x3')](),controller['getAgents']);router[_0xb632('0x4')](_0xb632('0x5'),auth[_0xb632('0x3')](),controller[_0xb632('0x6')]);module[_0xb632('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 9c03ba9..61332c5 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59b5=['role','userProfileId','Agents','assign','UserProfile','getResources','findAndCountAll','rows','map','find','filterAgentAttributes','globalStatus','getAgentStatus','Status','getQueues','resolve','startCase','name','voice','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','catch','lodash','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','rawAttributes','fieldName','type','agent','getOptions','raw','push','sequelize','literal','forEach','Pause','where','merge','user'];(function(_0x49e558,_0x56e935){var _0x44c9d4=function(_0x9245e7){while(--_0x9245e7){_0x49e558['push'](_0x49e558['shift']());}};_0x44c9d4(++_0x56e935);}(_0x59b5,0xba));var _0x559b=function(_0x44cbc5,_0x5bf31f){_0x44cbc5=_0x44cbc5-0x0;var _0x3fba89=_0x59b5[_0x44cbc5];return _0x3fba89;};'use strict';var _=require(_0x559b('0x0'));var util=require('util');var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x559b('0x1'));var db=require(_0x559b('0x2'))['db'];var APIBadRequestError=require(_0x559b('0x3'))[_0x559b('0x4')];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x4409b9,_0xe48c43){return function(_0x3e41b0){if(_0x3e41b0){var _0x3fc726=typeof _0xe48c43[_0x559b('0x5')]===_0x559b('0x6')&&typeof _0xe48c43[_0x559b('0x7')]===_0x559b('0x6');var _0x26c825=_0x3e41b0[_0x559b('0x8')];var _0x4f69df=_0x3fc726?0x0:_0xe48c43[_0x559b('0x5')];var _0x49737f=_0x3fc726?_0x3e41b0['count']:_0xe48c43[_0x559b('0x5')]+_0xe48c43[_0x559b('0x7')];var _0x5695ff;if(_0x49737f>=_0x26c825){_0x49737f=_0x26c825;_0x5695ff=0xc8;}else{_0x5695ff=0xce;}_0x4409b9[_0x559b('0x9')](_0x5695ff);return _0x4409b9[_0x559b('0xa')](_0x559b('0xb'),_0x4f69df+'-'+_0x49737f+'/'+_0x26c825)[_0x559b('0xc')](_0x3e41b0);}return null;};}exports[_0x559b('0xd')]=function(_0x3a36dd,_0x3adf3c){var _0x312a06={'count':0x0,'rows':[]};var _0x104fb7={};var _0x266f74;var _0x34345f=utils[_0x559b('0xe')]();var _0x58e8e0;var _0x3af130;var _0x3ffcd9=_0x3a36dd[_0x559b('0xf')][_0x559b('0x10')];var _0xe9f593=_0x3a36dd['query'][_0x559b('0x11')];var _0x4da12e=_0x3a36dd[_0x559b('0xf')][_0x559b('0x12')];var _0x250cbb=_0xe9f593===_0x559b('0x13')||_0xe9f593===_0x559b('0x14')?!![]:![];var _0x57ccdc=[];var _0x4b348d;var _0x5188b5;Promise['resolve']()[_0x559b('0x15')](function(){if(_0x3a36dd[_0x559b('0xf')][_0x559b('0x16')]){if(!utils[_0x559b('0x17')](_0x3a36dd[_0x559b('0xf')][_0x559b('0x16')])){throw new APIBadRequestError(util[_0x559b('0x18')](_0x559b('0x19'),_0x3a36dd['query'][_0x559b('0x16')]));}_0x266f74=_0x3a36dd['query'][_0x559b('0x16')][_0x559b('0x1a')]();}if(!_0x3a36dd[_0x559b('0xf')][_0x559b('0x1b')]||!_0x3a36dd[_0x559b('0xf')]['sort'][_0x559b('0x1c')]('globalStatus')){_0x3a36dd['query'][_0x559b('0x1b')]=rta['validateSortParameter'](_0x3a36dd[_0x559b('0xf')][_0x559b('0x1b')]);return;}var _0x7201e0=rta['getUpdatedSortOptions'](_0x3a36dd[_0x559b('0xf')][_0x559b('0x1b')]);_0x3a36dd[_0x559b('0xf')][_0x559b('0x1b')]=_0x7201e0[_0x559b('0x1d')][_0x559b('0x1e')](',');_0x4b348d=_0x7201e0[_0x559b('0x1f')];})[_0x559b('0x15')](function(){if(!_0x3ffcd9){return[];}return rta[_0x559b('0x20')](_0x3ffcd9,_0x266f74);})[_0x559b('0x15')](function(_0x56f2c6){_0x57ccdc=_0x56f2c6;return rta[_0x559b('0x21')]();})[_0x559b('0x15')](function(_0x184ded){_0x3af130=_0x184ded['rows'];if((!_0xe9f593||_0x250cbb)&&!_0x4b348d){return _0x57ccdc;}if(_0x4b348d&&!_0xe9f593){return rta[_0x559b('0x22')](_0x3af130,_0x57ccdc,_0x4b348d);}else{return rta[_0x559b('0x23')](_0x3af130,_0x57ccdc,_0xe9f593);}})[_0x559b('0x15')](function(_0x528f01){_0x57ccdc=_0x528f01;var _0x27285d=![];if(_0x57ccdc[_0x559b('0x24')]===0x0){if(_0x3ffcd9||_0xe9f593){_0x27285d=!![];}if(_0x250cbb){_0x27285d=![];}}if(_0x27285d){return _0x312a06;}var _0x38d8fe=_['map'](db['User'][_0x559b('0x25')],function(_0xcf3175){return{'name':_0xcf3175[_0x559b('0x26')],'type':_0xcf3175[_0x559b('0x27')]['key']};});_0x3a36dd[_0x559b('0xf')]['role']=_0x559b('0x28');_0x3a36dd[_0x559b('0xf')]['online']=!![];_0x104fb7=qs[_0x559b('0x29')](_0x38d8fe,_0x3a36dd);_0x104fb7[_0x559b('0x2a')]=!![];var _0xe7605d=[];if(_0x57ccdc[_0x559b('0x24')]>0x0){_0xe7605d[_0x559b('0x2b')]({'id':{'$in':_0x57ccdc}});if(_0x4b348d&&!_0xe9f593){_0x5188b5=[db[_0x559b('0x2c')][_0x559b('0x2d')]('FIELD(id,'+_0x57ccdc+')')];_0x104fb7['order']=_0x5188b5;}}if(_0x250cbb){_0x34345f[_0x559b('0x2e')](function(_0x4fda49){var _0x5d7c02=!![];if(_0xe9f593===_0x559b('0x14')&&_0x266f74!==_0x4fda49){_0x5d7c02=![];}_0xe7605d[_0x559b('0x2b')]({[_0x4fda49+_0x559b('0x2f')]:_0x5d7c02});});if(_0x4da12e){_0xe7605d[_0x559b('0x2b')]({'pauseType':_0x4da12e});}}else if(_0xe9f593){_0x34345f['forEach'](function(_0x447ace){_0xe7605d[_0x559b('0x2b')]({[_0x447ace+_0x559b('0x2f')]:![]});});}_0x104fb7[_0x559b('0x30')]=_[_0x559b('0x31')](_0x104fb7[_0x559b('0x30')],{'$and':_0xe7605d});if(_0x3a36dd[_0x559b('0x32')][_0x559b('0x33')]===_0x559b('0x32')){var _0x59769b={'params':{'id':_0x3a36dd['user'][_0x559b('0x34')]},'query':{'section':_0x559b('0x35'),'role':_0x559b('0x28'),'online':!![],'raw':!![],'ids':_0x57ccdc,'customSorting':_0x5188b5}};if(_0x250cbb){_0x59769b[_0x559b('0xf')]['extraQueryConditions']=_0xe7605d;}_0x59769b[_0x559b('0xf')]=Object[_0x559b('0x36')](_0x59769b[_0x559b('0xf')],_0x3a36dd[_0x559b('0xf')]);delete _0x59769b[_0x559b('0xf')]['id'];return db[_0x559b('0x37')][_0x559b('0x38')](_0x59769b);}return db['User'][_0x559b('0x39')](_0x104fb7);})[_0x559b('0x15')](function(_0x347029){_0x312a06[_0x559b('0x8')]=_0x347029[_0x559b('0x8')];_0x58e8e0=_0x347029[_0x559b('0x3a')];return _0x58e8e0[_0x559b('0x3b')](function(_0x252b12){var _0x190235=_[_0x559b('0x3c')](_0x3af130,['id',_0x252b12['id']]);if(_0x190235){var _0x24e612=rta[_0x559b('0x3d')](_0x190235);_['merge'](_0x252b12,_0x24e612);}_0x252b12[_0x559b('0x3e')]=rta[_0x559b('0x3f')](_0x252b12);if(_0x252b12[_0x559b('0x3e')][_0x559b('0x1c')]('pause')){_0x34345f['forEach'](function(_0x3a446e){if(_0x252b12[_0x3a446e+'Pause']){_0x252b12[_0x3a446e+_0x559b('0x40')]=_0x559b('0x13');}});}return _0x252b12;});})[_0x559b('0x15')](function(_0x1a7c66){if(!_0x4b348d||_0x5188b5){return _0x1a7c66;}return rta['sortAgentsByStatus'](_0x1a7c66,_0x4b348d);})[_0x559b('0x15')](function(_0x196be6){var _0x34c50b=null;if(_0x3a36dd[_0x559b('0xf')][_0x559b('0x1d')]){var _0x44f760=_0x3a36dd[_0x559b('0xf')]['fields']['split'](',');_0x34c50b=_0x196be6[_0x559b('0x3b')](function(_0x16352e){return _['pick'](_0x16352e,_0x44f760);});}_0x312a06[_0x559b('0x3a')]=_0x34c50b||_0x196be6;return _0x312a06;})[_0x559b('0x15')](respondWithFilteredResult(_0x3adf3c,_0x104fb7))['catch'](APIHandleError(_0x3adf3c));};exports[_0x559b('0x41')]=function(_0x3151ab,_0x28c75d){var _0x45ff9a={'count':0x0,'rows':[]};var _0x90dd14={};var _0x555d1f;var _0x55fe89;var _0x4f3791;Promise[_0x559b('0x42')]()[_0x559b('0x15')](function(){if(_0x3151ab[_0x559b('0xf')]['channel']){if(!utils[_0x559b('0x17')](_0x3151ab[_0x559b('0xf')]['channel'])){throw new APIBadRequestError(util[_0x559b('0x18')](_0x559b('0x19'),_0x3151ab[_0x559b('0xf')][_0x559b('0x16')]));}_0x555d1f=_0x3151ab['query'][_0x559b('0x16')]['toLowerCase']();}var _0x9ae75f=_[_0x559b('0x43')](_0x555d1f)+'Queue';var _0x2ebe88=_[_0x559b('0x3b')](db[_0x9ae75f][_0x559b('0x25')],function(_0x4dec0f){return{'name':_0x4dec0f[_0x559b('0x26')],'type':_0x4dec0f['type']['key']};});if(!_0x3151ab[_0x559b('0xf')][_0x559b('0x1d')]){var _0x43f967=['id',_0x559b('0x44')];if(_0x555d1f===_0x559b('0x45')){_0x43f967[_0x559b('0x2b')](_0x559b('0x27'));if(_0x3151ab[_0x559b('0xf')][_0x559b('0x27')]===_0x559b('0x46')){_0x43f967['push']([_0x559b('0x47'),_0x559b('0x48')]);}}_0x3151ab[_0x559b('0xf')][_0x559b('0x1d')]=_0x43f967[_0x559b('0x1e')](',');}_0x90dd14=qs[_0x559b('0x29')](_0x2ebe88,_0x3151ab);if(_0x3151ab[_0x559b('0x32')][_0x559b('0x33')]===_0x559b('0x32')){var _0xb1fc40={'params':{'id':_0x3151ab['user']['userProfileId']},'query':{'section':_0x555d1f===_0x559b('0x45')&&_0x3151ab['query'][_0x559b('0x27')]===_0x559b('0x46')?_0x559b('0x49'):_[_0x559b('0x43')](_0x555d1f)+_0x559b('0x4a'),'type':_0x3151ab[_0x559b('0xf')][_0x559b('0x27')],'nolimit':!![],'sort':_0x559b('0x44'),'filter':_0x3151ab[_0x559b('0xf')][_0x559b('0x4b')]}};return db[_0x559b('0x37')][_0x559b('0x38')](_0xb1fc40);}return db[_0x9ae75f]['findAndCountAll'](_0x90dd14);})[_0x559b('0x15')](function(_0x1e530e){_0x45ff9a['count']=_0x1e530e[_0x559b('0x8')];_0x55fe89=_0x1e530e[_0x559b('0x3a')];return rtq[_0x559b('0x4c')](_0x3151ab,_0x555d1f);})[_0x559b('0x15')](function(_0xe1e5c4){_0x4f3791=_0xe1e5c4[_0x559b('0x3a')];return rtq[_0x559b('0x4d')](_0x55fe89,_0x4f3791,_0x555d1f,_0x3151ab['query'][_0x559b('0x27')]);})[_0x559b('0x15')](function(_0x3c8c18){_0x45ff9a[_0x559b('0x3a')]=_0x3c8c18;return _0x45ff9a;})[_0x559b('0x15')](respondWithFilteredResult(_0x28c75d,_0x90dd14))[_0x559b('0x4e')](APIHandleError(_0x28c75d));}; \ No newline at end of file +var _0x236b=['Queue','name','outbound','dialMethod','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','findAndCountAll','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','limit','count','status','set','json','getChannels','globalQueueFilter','pauseTypeFilter','pause','resolve','query','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','length','sequelize','FIELD(id,','forEach','*pause','push','Pause','where','merge','user','assign','UserProfile','rows','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase'];(function(_0x203eb0,_0x288756){var _0x51a005=function(_0x431821){while(--_0x431821){_0x203eb0['push'](_0x203eb0['shift']());}};_0x51a005(++_0x288756);}(_0x236b,0x198));var _0xb236=function(_0x3dd399,_0x1268b5){_0x3dd399=_0x3dd399-0x0;var _0x1b6283=_0x236b[_0x3dd399];return _0x1b6283;};'use strict';var _=require('lodash');var util=require(_0xb236('0x0'));var rta=require(_0xb236('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0xb236('0x2'));var utils=require(_0xb236('0x3'));var db=require(_0xb236('0x4'))['db'];var APIBadRequestError=require(_0xb236('0x5'))[_0xb236('0x6')];var APIHandleError=require(_0xb236('0x5'))['handleError'];function respondWithFilteredResult(_0x4ffe26,_0x1fd7ab){return function(_0x411435){if(_0x411435){var _0x39c843=typeof _0x1fd7ab[_0xb236('0x7')]==='undefined'&&typeof _0x1fd7ab[_0xb236('0x8')]==='undefined';var _0x558d81=_0x411435[_0xb236('0x9')];var _0x5892fd=_0x39c843?0x0:_0x1fd7ab[_0xb236('0x7')];var _0x3f9162=_0x39c843?_0x411435['count']:_0x1fd7ab[_0xb236('0x7')]+_0x1fd7ab[_0xb236('0x8')];var _0x316283;if(_0x3f9162>=_0x558d81){_0x3f9162=_0x558d81;_0x316283=0xc8;}else{_0x316283=0xce;}_0x4ffe26[_0xb236('0xa')](_0x316283);return _0x4ffe26[_0xb236('0xb')]('Content-Range',_0x5892fd+'-'+_0x3f9162+'/'+_0x558d81)[_0xb236('0xc')](_0x411435);}return null;};}exports['getAgents']=function(_0x55845a,_0x269b38){var _0x28dd08={'count':0x0,'rows':[]};var _0x4c9c3f={};var _0x204d6d;var _0x1ad36d=utils[_0xb236('0xd')]();var _0x285e75;var _0xc2413d;var _0xa02480=_0x55845a['query'][_0xb236('0xe')];var _0x446fbb=_0x55845a['query']['globalStatusFilter'];var _0x4084ce=_0x55845a['query'][_0xb236('0xf')];var _0x42eb7e=_0x446fbb===_0xb236('0x10')||_0x446fbb==='*pause'?!![]:![];var _0x3934e8=[];var _0x2f3baa;var _0x42f56b;Promise[_0xb236('0x11')]()['then'](function(){if(_0x55845a[_0xb236('0x12')][_0xb236('0x13')]){if(!utils[_0xb236('0x14')](_0x55845a[_0xb236('0x12')][_0xb236('0x13')])){throw new APIBadRequestError(util[_0xb236('0x15')](_0xb236('0x16'),_0x55845a['query'][_0xb236('0x13')]));}_0x204d6d=_0x55845a['query'][_0xb236('0x13')][_0xb236('0x17')]();}if(!_0x55845a[_0xb236('0x12')][_0xb236('0x18')]||!_0x55845a[_0xb236('0x12')][_0xb236('0x18')][_0xb236('0x19')](_0xb236('0x1a'))){_0x55845a[_0xb236('0x12')]['sort']=rta['validateSortParameter'](_0x55845a[_0xb236('0x12')]['sort']);return;}var _0x4b9c15=rta[_0xb236('0x1b')](_0x55845a[_0xb236('0x12')]['sort']);_0x55845a[_0xb236('0x12')][_0xb236('0x18')]=_0x4b9c15[_0xb236('0x1c')][_0xb236('0x1d')](',');_0x2f3baa=_0x4b9c15[_0xb236('0x1e')];})[_0xb236('0x1f')](function(){if(!_0xa02480){return[];}return rta[_0xb236('0x20')](_0xa02480,_0x204d6d);})[_0xb236('0x1f')](function(_0x5ece9c){_0x3934e8=_0x5ece9c;return rta[_0xb236('0x21')]();})[_0xb236('0x1f')](function(_0x283b15){_0xc2413d=_0x283b15['rows'];if((!_0x446fbb||_0x42eb7e)&&!_0x2f3baa){return _0x3934e8;}if(_0x2f3baa&&!_0x446fbb){return rta['getSortedAgentsIdsByStatus'](_0xc2413d,_0x3934e8,_0x2f3baa);}else{return rta[_0xb236('0x22')](_0xc2413d,_0x3934e8,_0x446fbb);}})[_0xb236('0x1f')](function(_0x2814e8){_0x3934e8=_0x2814e8;var _0x1b831e=![];if(_0x3934e8['length']===0x0){if(_0xa02480||_0x446fbb){_0x1b831e=!![];}if(_0x42eb7e){_0x1b831e=![];}}if(_0x1b831e){return _0x28dd08;}var _0x2377d4=_[_0xb236('0x23')](db[_0xb236('0x24')][_0xb236('0x25')],function(_0x381cad){return{'name':_0x381cad[_0xb236('0x26')],'type':_0x381cad[_0xb236('0x27')][_0xb236('0x28')]};});_0x55845a[_0xb236('0x12')][_0xb236('0x29')]=_0xb236('0x2a');_0x55845a[_0xb236('0x12')][_0xb236('0x2b')]=!![];_0x4c9c3f=qs[_0xb236('0x2c')](_0x2377d4,_0x55845a);_0x4c9c3f['raw']=!![];var _0x2710d5=[];if(_0x3934e8[_0xb236('0x2d')]>0x0){_0x2710d5['push']({'id':{'$in':_0x3934e8}});if(_0x2f3baa&&!_0x446fbb){_0x42f56b=[db[_0xb236('0x2e')]['literal'](_0xb236('0x2f')+_0x3934e8+')')];_0x4c9c3f[_0xb236('0x1e')]=_0x42f56b;}}if(_0x42eb7e){_0x1ad36d[_0xb236('0x30')](function(_0x23733d){var _0x345631=!![];if(_0x446fbb===_0xb236('0x31')&&_0x204d6d!==_0x23733d){_0x345631=![];}_0x2710d5[_0xb236('0x32')]({[_0x23733d+_0xb236('0x33')]:_0x345631});});if(_0x4084ce){_0x2710d5['push']({'pauseType':_0x4084ce});}}else if(_0x446fbb){_0x1ad36d['forEach'](function(_0x3298fa){_0x2710d5[_0xb236('0x32')]({[_0x3298fa+'Pause']:![]});});}_0x4c9c3f[_0xb236('0x34')]=_[_0xb236('0x35')](_0x4c9c3f['where'],{'$and':_0x2710d5});if(_0x55845a[_0xb236('0x36')][_0xb236('0x29')]===_0xb236('0x36')){var _0x29faa0={'params':{'id':_0x55845a[_0xb236('0x36')]['userProfileId']},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x3934e8,'customSorting':_0x42f56b}};if(_0x42eb7e){_0x29faa0[_0xb236('0x12')]['extraQueryConditions']=_0x2710d5;}_0x29faa0[_0xb236('0x12')]=Object[_0xb236('0x37')](_0x29faa0['query'],_0x55845a['query']);delete _0x29faa0[_0xb236('0x12')]['id'];return db[_0xb236('0x38')]['getResources'](_0x29faa0);}return db[_0xb236('0x24')]['findAndCountAll'](_0x4c9c3f);})[_0xb236('0x1f')](function(_0x2531e4){_0x28dd08[_0xb236('0x9')]=_0x2531e4[_0xb236('0x9')];_0x285e75=_0x2531e4[_0xb236('0x39')];return _0x285e75[_0xb236('0x23')](function(_0x18157a){var _0xf0effd=_['find'](_0xc2413d,['id',_0x18157a['id']]);if(_0xf0effd){var _0x40ff3c=rta[_0xb236('0x3a')](_0xf0effd);_[_0xb236('0x35')](_0x18157a,_0x40ff3c);}_0x18157a[_0xb236('0x1a')]=rta[_0xb236('0x3b')](_0x18157a);if(_0x18157a['globalStatus'][_0xb236('0x19')](_0xb236('0x10'))){_0x1ad36d[_0xb236('0x30')](function(_0x55aa0f){if(_0x18157a[_0x55aa0f+_0xb236('0x33')]){_0x18157a[_0x55aa0f+_0xb236('0x3c')]=_0xb236('0x10');}});}return _0x18157a;});})[_0xb236('0x1f')](function(_0x57b422){if(!_0x2f3baa||_0x42f56b){return _0x57b422;}return rta[_0xb236('0x3d')](_0x57b422,_0x2f3baa);})[_0xb236('0x1f')](function(_0x131942){var _0xc16656=null;if(_0x55845a[_0xb236('0x12')][_0xb236('0x1c')]){var _0x489780=_0x55845a[_0xb236('0x12')]['fields']['split'](',');_0xc16656=_0x131942[_0xb236('0x23')](function(_0x223a62){return _[_0xb236('0x3e')](_0x223a62,_0x489780);});}_0x28dd08['rows']=_0xc16656||_0x131942;return _0x28dd08;})[_0xb236('0x1f')](respondWithFilteredResult(_0x269b38,_0x4c9c3f))[_0xb236('0x3f')](APIHandleError(_0x269b38));};exports[_0xb236('0x40')]=function(_0x5876fc,_0x3948ff){var _0x19a63a={'count':0x0,'rows':[]};var _0xc325d3={};var _0x4b5f78;var _0x33e727;var _0x48dc91;Promise[_0xb236('0x11')]()['then'](function(){if(_0x5876fc['query'][_0xb236('0x13')]){if(!utils[_0xb236('0x14')](_0x5876fc[_0xb236('0x12')]['channel'])){throw new APIBadRequestError(util[_0xb236('0x15')](_0xb236('0x16'),_0x5876fc[_0xb236('0x12')]['channel']));}_0x4b5f78=_0x5876fc[_0xb236('0x12')][_0xb236('0x13')][_0xb236('0x17')]();}var _0x54f2b9=_[_0xb236('0x41')](_0x4b5f78)+_0xb236('0x42');var _0x145c5e=_[_0xb236('0x23')](db[_0x54f2b9][_0xb236('0x25')],function(_0x2a1329){return{'name':_0x2a1329[_0xb236('0x26')],'type':_0x2a1329[_0xb236('0x27')][_0xb236('0x28')]};});if(!_0x5876fc[_0xb236('0x12')][_0xb236('0x1c')]){var _0x29fe47=['id',_0xb236('0x43')];if(_0x4b5f78==='voice'){_0x29fe47[_0xb236('0x32')](_0xb236('0x27'));if(_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]===_0xb236('0x44')){_0x29fe47['push'](['dialActive',_0xb236('0x45')]);}}_0x5876fc['query']['fields']=_0x29fe47[_0xb236('0x1d')](',');}_0xc325d3=qs[_0xb236('0x2c')](_0x145c5e,_0x5876fc);if(_0x5876fc[_0xb236('0x36')]['role']===_0xb236('0x36')){var _0x28ff4c={'params':{'id':_0x5876fc['user'][_0xb236('0x46')]},'query':{'section':_0x4b5f78===_0xb236('0x47')&&_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]===_0xb236('0x44')?_0xb236('0x48'):_['startCase'](_0x4b5f78)+_0xb236('0x49'),'type':_0x5876fc[_0xb236('0x12')][_0xb236('0x27')],'nolimit':!![],'sort':_0xb236('0x43'),'filter':_0x5876fc[_0xb236('0x12')][_0xb236('0x4a')]}};return db[_0xb236('0x38')][_0xb236('0x4b')](_0x28ff4c);}return db[_0x54f2b9][_0xb236('0x4c')](_0xc325d3);})['then'](function(_0x4b2a6e){_0x19a63a['count']=_0x4b2a6e[_0xb236('0x9')];_0x33e727=_0x4b2a6e[_0xb236('0x39')];return rtq[_0xb236('0x4d')](_0x5876fc,_0x4b5f78);})[_0xb236('0x1f')](function(_0x456f83){_0x48dc91=_0x456f83[_0xb236('0x39')];return rtq[_0xb236('0x4e')](_0x33e727,_0x48dc91,_0x4b5f78,_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]);})[_0xb236('0x1f')](function(_0x3fe224){_0x19a63a[_0xb236('0x39')]=_0x3fe224;return _0x19a63a;})[_0xb236('0x1f')](respondWithFilteredResult(_0x3948ff,_0xc325d3))[_0xb236('0x3f')](APIHandleError(_0x3948ff));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index a3cf254..c5315e9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2cd980,_0x1c026a){var _0x316ea6=function(_0x45d6de){while(--_0x45d6de){_0x2cd980['push'](_0x2cd980['shift']());}};_0x316ea6(++_0x1c026a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x508c10,_0x5a15f0){var _0x3108b5=function(_0x4bccaa){while(--_0x4bccaa){_0x508c10['push'](_0x508c10['shift']());}};_0x3108b5(++_0x5a15f0);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('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 bce3b1d..5116e44 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 _0x2d06=['INTEGER','STRING','DATE','exports'];(function(_0x123654,_0x2f2ea7){var _0x42de86=function(_0x488c44){while(--_0x488c44){_0x123654['push'](_0x123654['shift']());}};_0x42de86(++_0x2f2ea7);}(_0x2d06,0x157));var _0x62d0=function(_0x16af3b,_0x5651d3){_0x16af3b=_0x16af3b-0x0;var _0x5a83d4=_0x2d06[_0x16af3b];return _0x5a83d4;};'use strict';var Sequelize=require('sequelize');module[_0x62d0('0x0')]={'state':{'type':Sequelize[_0x62d0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x62d0('0x2')]},'scheduledat':{'type':Sequelize[_0x62d0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x62d0('0x3')]},'responsetime':{'type':Sequelize[_0x62d0('0x3')]},'ringtime':{'type':Sequelize[_0x62d0('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x62d0('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x62d0('0x2')]}}; \ No newline at end of file +var _0x0dee=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x0dee,0xf7));var _0xe0de=function(_0x5871fe,_0xed78a3){_0x5871fe=_0x5871fe-0x0;var _0x1517fd=_0x0dee[_0x5871fe];return _0x1517fd;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe0de('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xe0de('0x2')]},'starttime':{'type':Sequelize[_0xe0de('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe0de('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe0de('0x2')]},'campaigntype':{'type':Sequelize[_0xe0de('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 982583f..3b1fedb 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 _0x1293=['bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','api','moment'];(function(_0x20a15,_0x45537d){var _0x5d09b5=function(_0x36f699){while(--_0x36f699){_0x20a15['push'](_0x20a15['shift']());}};_0x5d09b5(++_0x45537d);}(_0x1293,0x105));var _0x3129=function(_0xa7e669,_0x2a73d6){_0xa7e669=_0xa7e669-0x0;var _0x329ae2=_0x1293[_0xa7e669];return _0x329ae2;};'use strict';var _=require(_0x3129('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3129('0x1'));var moment=require(_0x3129('0x2'));var BPromise=require(_0x3129('0x3'));var rp=require(_0x3129('0x4'));var fs=require('fs');var path=require(_0x3129('0x5'));var rimraf=require('rimraf');var config=require(_0x3129('0x6'));var attributes=require(_0x3129('0x7'));module['exports']=function(_0x5e85e0,_0xc029a1){return _0x5e85e0[_0x3129('0x8')](_0x3129('0x9'),attributes,{'tableName':_0x3129('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4108=['exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x536d6c,_0xca1336){var _0x414887=function(_0x557d21){while(--_0x557d21){_0x536d6c['push'](_0x536d6c['shift']());}};_0x414887(++_0xca1336);}(_0x4108,0xb7));var _0x8410=function(_0x3f01b8,_0x441c76){_0x3f01b8=_0x3f01b8-0x0;var _0x1b4c8e=_0x4108[_0x3f01b8];return _0x1b4c8e;};'use strict';var _=require(_0x8410('0x0'));var util=require(_0x8410('0x1'));var logger=require(_0x8410('0x2'))(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require(_0x8410('0x5'));var rp=require(_0x8410('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8410('0x7'));var config=require(_0x8410('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x8410('0x9')]=function(_0x3f4172,_0x470521){return _0x3f4172[_0x8410('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x8410('0xb'),'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 1e47b55..94382bc 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 _0x1680=['options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1680,0x84));var _0x0168=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x1680[_0x1529a3];return _0x1a0d4b;};'use strict';var _=require(_0x0168('0x0'));var util=require(_0x0168('0x1'));var moment=require(_0x0168('0x2'));var BPromise=require(_0x0168('0x3'));var rs=require(_0x0168('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0168('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0168('0x6'))('rpc');var config=require(_0x0168('0x7'));var jayson=require(_0x0168('0x8'));var client=jayson[_0x0168('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5522f2,_0x5dc5ed,_0x473fec){return new BPromise(function(_0x12152e,_0x210d50){return client[_0x0168('0xa')](_0x5522f2,_0x473fec)['then'](function(_0x2ed43e){logger[_0x0168('0xb')](_0x0168('0xc'),_0x5dc5ed,_0x0168('0xd'));logger['debug'](_0x0168('0xe'),_0x5dc5ed,_0x0168('0xd'),JSON['stringify'](_0x2ed43e));if(_0x2ed43e[_0x0168('0xf')]){if(_0x2ed43e[_0x0168('0xf')][_0x0168('0x10')]===0x1f4){logger[_0x0168('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dc5ed,_0x2ed43e[_0x0168('0xf')][_0x0168('0x11')]);return _0x210d50(_0x2ed43e['error']['message']);}logger[_0x0168('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dc5ed,_0x2ed43e[_0x0168('0xf')][_0x0168('0x11')]);return _0x12152e(_0x2ed43e[_0x0168('0xf')][_0x0168('0x11')]);}else{logger['info'](_0x0168('0xc'),_0x5dc5ed,'request\x20sent');_0x12152e(_0x2ed43e[_0x0168('0x12')][_0x0168('0x11')]);}})[_0x0168('0x13')](function(_0x549154){logger[_0x0168('0xf')](_0x0168('0xc'),_0x5dc5ed,_0x549154);_0x210d50(_0x549154);});});}exports[_0x0168('0x14')]=function(_0x2aa2bd){var _0x63ed0d=this;return new Promise(function(_0x4d57c6,_0x15ec1b){return db[_0x0168('0x15')][_0x0168('0x16')](_0x2aa2bd[_0x0168('0x17')],{'raw':_0x2aa2bd[_0x0168('0x18')]?_0x2aa2bd[_0x0168('0x18')][_0x0168('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3351ef){logger[_0x0168('0xb')](_0x0168('0x14'),_0x2aa2bd);logger['debug'](_0x0168('0x14'),_0x2aa2bd,JSON['stringify'](_0x3351ef));_0x4d57c6(_0x3351ef);})[_0x0168('0x13')](function(_0x576b11){logger[_0x0168('0xf')](_0x0168('0x14'),_0x576b11[_0x0168('0x11')],_0x2aa2bd);_0x15ec1b(_0x63ed0d[_0x0168('0xf')](0x1f4,_0x576b11[_0x0168('0x11')]));});});}; \ No newline at end of file +var _0xf783=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xf783,0x19b));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3f78('0x0'));var util=require('util');var moment=require(_0x3f78('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f78('0x2'));var db=require(_0x3f78('0x3'))['db'];var utils=require(_0x3f78('0x4'));var logger=require(_0x3f78('0x5'))('rpc');var config=require(_0x3f78('0x6'));var jayson=require(_0x3f78('0x7'));var client=jayson['client'][_0x3f78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4616b5,_0x5f14bd,_0x5e6413){return new BPromise(function(_0x582ab5,_0x706a80){return client[_0x3f78('0x9')](_0x4616b5,_0x5e6413)[_0x3f78('0xa')](function(_0x1f4af2){logger[_0x3f78('0xb')](_0x3f78('0xc'),_0x5f14bd,'request\x20sent');logger[_0x3f78('0xd')](_0x3f78('0xe'),_0x5f14bd,_0x3f78('0xf'),JSON[_0x3f78('0x10')](_0x1f4af2));if(_0x1f4af2[_0x3f78('0x11')]){if(_0x1f4af2['error'][_0x3f78('0x12')]===0x1f4){logger[_0x3f78('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x5f14bd,_0x1f4af2[_0x3f78('0x11')]['message']);return _0x706a80(_0x1f4af2['error']['message']);}logger[_0x3f78('0x11')](_0x3f78('0xc'),_0x5f14bd,_0x1f4af2[_0x3f78('0x11')][_0x3f78('0x13')]);return _0x582ab5(_0x1f4af2[_0x3f78('0x11')]['message']);}else{logger[_0x3f78('0xb')](_0x3f78('0xc'),_0x5f14bd,_0x3f78('0xf'));_0x582ab5(_0x1f4af2['result'][_0x3f78('0x13')]);}})[_0x3f78('0x14')](function(_0x2ce87d){logger['error'](_0x3f78('0xc'),_0x5f14bd,_0x2ce87d);_0x706a80(_0x2ce87d);});});}exports[_0x3f78('0x15')]=function(_0xb63982){var _0x1aacbb=this;return new Promise(function(_0xbd90b5,_0x43b528){return db[_0x3f78('0x16')][_0x3f78('0x17')](_0xb63982[_0x3f78('0x18')],{'raw':_0xb63982[_0x3f78('0x19')]?_0xb63982[_0x3f78('0x19')][_0x3f78('0x1a')]===undefined?!![]:![]:!![]})[_0x3f78('0xa')](function(_0x24ca69){logger[_0x3f78('0xb')](_0x3f78('0x15'),_0xb63982);logger['debug']('CreateReportAgentPreview',_0xb63982,JSON[_0x3f78('0x10')](_0x24ca69));_0xbd90b5(_0x24ca69);})[_0x3f78('0x14')](function(_0x31cfee){logger[_0x3f78('0x11')](_0x3f78('0x15'),_0x31cfee[_0x3f78('0x13')],_0xb63982);_0x43b528(_0x1aacbb[_0x3f78('0x11')](0x1f4,_0x31cfee['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f767d15..801bd09 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 _0x3fa0=['chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','agentNotify','exports','util','path','express','Router','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x3fa0,0x100));var _0x03fa=function(_0x10bf7d,_0x34cd03){_0x10bf7d=_0x10bf7d-0x0;var _0x35a485=_0x3fa0[_0x10bf7d];return _0x35a485;};'use strict';var multer=require('multer');var util=require(_0x03fa('0x0'));var path=require(_0x03fa('0x1'));var express=require(_0x03fa('0x2'));var router=express[_0x03fa('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get']('/voice/channels',auth[_0x03fa('0x4')](),controller[_0x03fa('0x5')]);router[_0x03fa('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x03fa('0x4')](),controller[_0x03fa('0x7')]);router[_0x03fa('0x6')](_0x03fa('0x8'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x9')]);router[_0x03fa('0x6')](_0x03fa('0xa'),auth['isAuthenticated'](),controller[_0x03fa('0xb')]);router['get']('/chat/queues',auth[_0x03fa('0x4')](),controller[_0x03fa('0xc')]);router[_0x03fa('0x6')](_0x03fa('0xd'),auth[_0x03fa('0x4')](),controller[_0x03fa('0xe')]);router['get'](_0x03fa('0xf'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x10')]);router['get'](_0x03fa('0x11'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x12')]);router['get'](_0x03fa('0x13'),auth['isAuthenticated'](),controller[_0x03fa('0x14')]);router[_0x03fa('0x6')](_0x03fa('0x15'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x16')]);router[_0x03fa('0x6')](_0x03fa('0x17'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x18')]);router['get'](_0x03fa('0x19'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x1a')]);router[_0x03fa('0x6')](_0x03fa('0x1b'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x1c')]);router[_0x03fa('0x6')](_0x03fa('0x1d'),auth['isAuthenticated'](),controller[_0x03fa('0x1e')]);router[_0x03fa('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x03fa('0x6')](_0x03fa('0x1f'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x20')]);router[_0x03fa('0x6')](_0x03fa('0x21'),auth[_0x03fa('0x4')](),controller['showVoiceQueues']);router[_0x03fa('0x22')](_0x03fa('0x21'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x23')]);router[_0x03fa('0x6')](_0x03fa('0x24'),auth['isAuthenticated'](),controller[_0x03fa('0x25')]);router[_0x03fa('0x6')]('/outbound/channels',auth[_0x03fa('0x4')](),controller[_0x03fa('0x26')]);router[_0x03fa('0x6')](_0x03fa('0x27'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x28')]);router[_0x03fa('0x22')](_0x03fa('0x29'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x2a')]);router[_0x03fa('0x6')]('/telephones',auth[_0x03fa('0x4')](),controller[_0x03fa('0x2b')]);router[_0x03fa('0x6')]('/trunks',auth['isAuthenticated'](),controller[_0x03fa('0x2c')]);router[_0x03fa('0x6')](_0x03fa('0x2d'),auth['isAuthenticated'](),controller['campaigns']);router['get'](_0x03fa('0x2e'),auth[_0x03fa('0x4')](),controller['faxAccounts']);router[_0x03fa('0x6')](_0x03fa('0x2f'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x30')]);router[_0x03fa('0x6')](_0x03fa('0x31'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x03fa('0x6')](_0x03fa('0x32'),auth['isAuthenticated'](),controller[_0x03fa('0x33')]);router[_0x03fa('0x6')](_0x03fa('0x34'),auth[_0x03fa('0x4')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x03fa('0x6')](_0x03fa('0x35'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x36')]);router[_0x03fa('0x6')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x03fa('0x6')](_0x03fa('0x37'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x38')]);router[_0x03fa('0x39')](_0x03fa('0x3a'),auth['isAuthenticated'](),controller[_0x03fa('0x3b')](_0x03fa('0x3c')));router[_0x03fa('0x6')](_0x03fa('0x3d'),auth['isAuthenticated'](),controller[_0x03fa('0x3e')]);router[_0x03fa('0x39')](_0x03fa('0x3f'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x3b')](_0x03fa('0x40')));router['get'](_0x03fa('0x41'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x42')]);router[_0x03fa('0x39')](_0x03fa('0x43'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x3b')]('fax'));router[_0x03fa('0x6')](_0x03fa('0x44'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x45')]);router[_0x03fa('0x39')]('/openchannel/queues/:id/notify',auth[_0x03fa('0x4')](),controller['queueNotify']('openchannel'));router[_0x03fa('0x6')](_0x03fa('0x46'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x47')]);router['post'](_0x03fa('0x48'),auth[_0x03fa('0x4')](),controller['queueNotify'](_0x03fa('0x49')));router[_0x03fa('0x39')](_0x03fa('0x4a'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x3b')](_0x03fa('0x4b')));router[_0x03fa('0x6')](_0x03fa('0x4c'),auth[_0x03fa('0x4')](),controller[_0x03fa('0x4d')]);router[_0x03fa('0x6')]('/whatsapp/queues/:id',auth[_0x03fa('0x4')](),controller['showWhatsappQueues']);router[_0x03fa('0x39')]('/agents/:id/notify',auth[_0x03fa('0x4')](),controller[_0x03fa('0x4e')]);module[_0x03fa('0x4f')]=router; \ No newline at end of file +var _0xaff1=['/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','showChatQueues','/fax/queues/:id/notify','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','/campaigns','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions'];(function(_0x43ea10,_0x30897e){var _0x54a1b1=function(_0x1d35bf){while(--_0x1d35bf){_0x43ea10['push'](_0x43ea10['shift']());}};_0x54a1b1(++_0x30897e);}(_0xaff1,0x130));var _0x1aff=function(_0x184d1c,_0x4a7a34){_0x184d1c=_0x184d1c-0x0;var _0x20c6b6=_0xaff1[_0x184d1c];return _0x20c6b6;};'use strict';var multer=require(_0x1aff('0x0'));var util=require(_0x1aff('0x1'));var path=require(_0x1aff('0x2'));var express=require(_0x1aff('0x3'));var router=express[_0x1aff('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x1aff('0x5'));router[_0x1aff('0x6')](_0x1aff('0x7'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x9')]);router[_0x1aff('0x6')](_0x1aff('0xa'),auth[_0x1aff('0x8')](),controller['voiceChannelMixMonitor']);router[_0x1aff('0x6')](_0x1aff('0xb'),auth[_0x1aff('0x8')](),controller[_0x1aff('0xc')]);router[_0x1aff('0x6')](_0x1aff('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x1aff('0x6')](_0x1aff('0xe'),auth[_0x1aff('0x8')](),controller[_0x1aff('0xf')]);router[_0x1aff('0x6')]('/mail/queues',auth[_0x1aff('0x8')](),controller['mailQueues']);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x1aff('0x10')]);router[_0x1aff('0x6')]('/openchannel/queues',auth[_0x1aff('0x8')](),controller[_0x1aff('0x11')]);router[_0x1aff('0x6')](_0x1aff('0x12'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x13')]);router['get'](_0x1aff('0x14'),auth[_0x1aff('0x8')](),controller['whatsappQueues']);router['get'](_0x1aff('0x15'),auth[_0x1aff('0x8')](),controller['faxQueues']);router[_0x1aff('0x6')](_0x1aff('0x16'),auth[_0x1aff('0x8')](),controller['voiceQueuesPreview']);router[_0x1aff('0x6')]('/voice/queues/channels',auth[_0x1aff('0x8')](),controller[_0x1aff('0x17')]);router[_0x1aff('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x1aff('0x8')](),controller[_0x1aff('0x18')]);router[_0x1aff('0x6')](_0x1aff('0x19'),auth[_0x1aff('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x1aff('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1aff('0x8')](),controller[_0x1aff('0x1a')]);router[_0x1aff('0x6')](_0x1aff('0x1b'),auth['isAuthenticated'](),controller[_0x1aff('0x1c')]);router['put']('/voice/queues/:id',auth[_0x1aff('0x8')](),controller['updateVoiceQueue']);router[_0x1aff('0x6')](_0x1aff('0x1d'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x1e')]);router[_0x1aff('0x6')]('/outbound/channels',auth[_0x1aff('0x8')](),controller[_0x1aff('0x1f')]);router[_0x1aff('0x6')](_0x1aff('0x20'),auth['isAuthenticated'](),controller[_0x1aff('0x21')]);router['put'](_0x1aff('0x22'),auth[_0x1aff('0x8')](),controller['agentCapacity']);router[_0x1aff('0x6')]('/telephones',auth[_0x1aff('0x8')](),controller[_0x1aff('0x23')]);router[_0x1aff('0x6')](_0x1aff('0x24'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x25')]);router[_0x1aff('0x6')](_0x1aff('0x26'),auth['isAuthenticated'](),controller['campaigns']);router[_0x1aff('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x1aff('0x6')](_0x1aff('0x27'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x1aff('0x6')](_0x1aff('0x28'),auth[_0x1aff('0x8')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x1aff('0x29'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x2a')]);router[_0x1aff('0x6')](_0x1aff('0x2b'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x1aff('0x6')](_0x1aff('0x2c'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x2d')]);router['get'](_0x1aff('0x2e'),auth['isAuthenticated'](),controller[_0x1aff('0x2f')]);router[_0x1aff('0x30')](_0x1aff('0x31'),auth['isAuthenticated'](),controller[_0x1aff('0x32')](_0x1aff('0x33')));router['get'](_0x1aff('0x34'),auth['isAuthenticated'](),controller[_0x1aff('0x35')]);router[_0x1aff('0x30')]('/chat/queues/:id/notify',auth[_0x1aff('0x8')](),controller[_0x1aff('0x32')]('chat'));router['get']('/chat/queues/:id',auth[_0x1aff('0x8')](),controller[_0x1aff('0x36')]);router['post'](_0x1aff('0x37'),auth[_0x1aff('0x8')](),controller['queueNotify']('fax'));router[_0x1aff('0x6')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x1aff('0x30')](_0x1aff('0x38'),auth['isAuthenticated'](),controller[_0x1aff('0x32')](_0x1aff('0x39')));router['get'](_0x1aff('0x3a'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post'](_0x1aff('0x3b'),auth[_0x1aff('0x8')](),controller['queueNotify'](_0x1aff('0x3c')));router[_0x1aff('0x30')](_0x1aff('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x1aff('0x3e')));router[_0x1aff('0x6')](_0x1aff('0x3f'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x40')]);router[_0x1aff('0x6')](_0x1aff('0x41'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x1aff('0x30')](_0x1aff('0x42'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x43')]);module[_0x1aff('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 91541e3..ef7130a 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 _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed1f,0x6a));var _0xfed1=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xed1f[_0x45783c];return _0x1161da;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));}; \ No newline at end of file +var _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x5a6a1c,_0xb802eb){var _0x132a0e=function(_0x4c3280){while(--_0x4c3280){_0x5a6a1c['push'](_0x5a6a1c['shift']());}};_0x132a0e(++_0xb802eb);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5acc85b..f1d627f 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 _0x67ed=['../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67ed,0x101));var _0xd67e=function(_0x50e095,_0x1e1fd6){_0x50e095=_0x50e095-0x0;var _0xc0d9fa=_0x67ed[_0x50e095];return _0xc0d9fa;};'use strict';var multer=require(_0xd67e('0x0'));var util=require('util');var path=require(_0xd67e('0x1'));var timeout=require(_0xd67e('0x2'));var express=require(_0xd67e('0x3'));var router=express[_0xd67e('0x4')]();var fs_extra=require(_0xd67e('0x5'));var auth=require(_0xd67e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd67e('0x7'));var controller=require(_0xd67e('0x8'));router['get']('/',auth[_0xd67e('0x9')](),controller[_0xd67e('0xa')]);router[_0xd67e('0xb')](_0xd67e('0xc'),auth[_0xd67e('0x9')](),controller[_0xd67e('0xd')]);router['get'](_0xd67e('0xe'),auth[_0xd67e('0x9')](),controller[_0xd67e('0xf')]);router[_0xd67e('0x10')]('/',auth[_0xd67e('0x9')](),controller[_0xd67e('0x11')]);router[_0xd67e('0x12')](_0xd67e('0xc'),auth[_0xd67e('0x9')](),controller['update']);router[_0xd67e('0x13')](_0xd67e('0xc'),auth['isAuthenticated'](),controller[_0xd67e('0x14')]);module[_0xd67e('0x15')]=router; \ No newline at end of file +var _0xfc97=['/:id','show','run','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xfc97,0xf1));var _0x7fc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc97[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x7fc9('0x0'));var path=require(_0x7fc9('0x1'));var timeout=require(_0x7fc9('0x2'));var express=require(_0x7fc9('0x3'));var router=express[_0x7fc9('0x4')]();var fs_extra=require(_0x7fc9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7fc9('0x6'));var config=require(_0x7fc9('0x7'));var controller=require(_0x7fc9('0x8'));router[_0x7fc9('0x9')]('/',auth[_0x7fc9('0xa')](),controller['index']);router[_0x7fc9('0x9')](_0x7fc9('0xb'),auth[_0x7fc9('0xa')](),controller[_0x7fc9('0xc')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x7fc9('0xd')]);router[_0x7fc9('0xe')]('/',auth['isAuthenticated'](),controller[_0x7fc9('0xf')]);router[_0x7fc9('0x10')]('/:id',auth[_0x7fc9('0xa')](),controller[_0x7fc9('0x11')]);router[_0x7fc9('0x12')](_0x7fc9('0xb'),auth[_0x7fc9('0xa')](),controller[_0x7fc9('0x13')]);module[_0x7fc9('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index ef53b28..bce4e0a 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 _0xdc7a=['days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0xdc7a,0x193));var _0xadc7=function(_0x2c07fb,_0x5ccb42){_0x2c07fb=_0x2c07fb-0x0;var _0x384859=_0xdc7a[_0x2c07fb];return _0x384859;};'use strict';var Sequelize=require(_0xadc7('0x0'));module[_0xadc7('0x1')]={'name':{'type':Sequelize[_0xadc7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xadc7('0x2')]},'active':{'type':Sequelize[_0xadc7('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xadc7('0x2')],'allowNull':![],'defaultValue':_0xadc7('0x4')},'startAt':{'type':Sequelize[_0xadc7('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xadc7('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xadc7('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xadc7('0x7')](_0xadc7('0x8'),'quarters',_0xadc7('0x9'),_0xadc7('0xa'),_0xadc7('0xb'),'hours','minutes'),'allowNull':![],'defaultValue':_0xadc7('0xb')},'output':{'type':Sequelize['ENUM'](_0xadc7('0xc'),_0xadc7('0xd'),_0xadc7('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xadc7('0xf'),_0xadc7('0x10')),'allowNull':![],'defaultValue':_0xadc7('0xf')},'sendMail':{'type':Sequelize[_0xadc7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xadc7('0x2')]},'cc':{'type':Sequelize[_0xadc7('0x11')]},'bcc':{'type':Sequelize[_0xadc7('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xadc7('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2b4d=['ENUM','years','quarters','months','weeks','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x2b4d,0x189));var _0xd2b4=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x2b4d[_0x200827];return _0x120047;};'use strict';var Sequelize=require(_0xd2b4('0x0'));module[_0xd2b4('0x1')]={'name':{'type':Sequelize[_0xd2b4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd2b4('0x2')]},'active':{'type':Sequelize[_0xd2b4('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd2b4('0x2')],'allowNull':![],'defaultValue':_0xd2b4('0x4')},'startAt':{'type':Sequelize[_0xd2b4('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd2b4('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd2b4('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd2b4('0x7')](_0xd2b4('0x8'),_0xd2b4('0x9'),_0xd2b4('0xa'),_0xd2b4('0xb'),'days',_0xd2b4('0xc'),_0xd2b4('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xd2b4('0x7')](_0xd2b4('0xe'),_0xd2b4('0xf'),_0xd2b4('0x10')),'allowNull':![],'defaultValue':_0xd2b4('0xe')},'type':{'type':Sequelize['ENUM'](_0xd2b4('0x11'),_0xd2b4('0x12')),'allowNull':![],'defaultValue':_0xd2b4('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xd2b4('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd2b4('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xd2b4('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index ee7228f..60aae94 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 _0x025e=['util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','Scheduler','UserProfileResource','stack','name','send','Schedule','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','keys','length','find','create','body','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x025e,0x99));var _0xe025=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x025e[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xe025('0x0'));var rimraf=require(_0xe025('0x1'));var zipdir=require(_0xe025('0x2'));var jsonpatch=require(_0xe025('0x3'));var rp=require(_0xe025('0x4'));var moment=require(_0xe025('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe025('0x6'));var util=require(_0xe025('0x7'));var path=require(_0xe025('0x8'));var sox=require('sox');var csv=require(_0xe025('0x9'));var ejs=require(_0xe025('0xa'));var fs=require('fs');var fs_extra=require(_0xe025('0xb'));var _=require(_0xe025('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe025('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe025('0x9'));var querystring=require(_0xe025('0xe'));var Papa=require(_0xe025('0xf'));var Redis=require(_0xe025('0x10'));var authService=require(_0xe025('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe025('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe025('0x13'))(_0xe025('0x14'));var utils=require('../../config/utils');var config=require(_0xe025('0x15'));var licenseUtil=require(_0xe025('0x16'));var db=require(_0xe025('0x17'))['db'];function respondWithStatusCode(_0x51b213,_0x17960e){_0x17960e=_0x17960e||0xcc;return function(_0x55ab34){if(_0x55ab34){return _0x51b213[_0xe025('0x18')](_0x17960e);}return _0x51b213['status'](_0x17960e)[_0xe025('0x19')]();};}function respondWithResult(_0x4ac5f2,_0x44d3a5){_0x44d3a5=_0x44d3a5||0xc8;return function(_0x4d6d31){if(_0x4d6d31){return _0x4ac5f2[_0xe025('0x1a')](_0x44d3a5)[_0xe025('0x1b')](_0x4d6d31);}};}function respondWithFilteredResult(_0x447f8e,_0x2cf4be){return function(_0x57b5ab){if(_0x57b5ab){var _0x3b6e71=typeof _0x2cf4be['offset']===_0xe025('0x1c')&&typeof _0x2cf4be['limit']===_0xe025('0x1c');var _0x5b4c46=_0x57b5ab[_0xe025('0x1d')];var _0xa46ed2=_0x3b6e71?0x0:_0x2cf4be[_0xe025('0x1e')];var _0x24991c=_0x3b6e71?_0x57b5ab[_0xe025('0x1d')]:_0x2cf4be['offset']+_0x2cf4be[_0xe025('0x1f')];var _0x1954d1;if(_0x24991c>=_0x5b4c46){_0x24991c=_0x5b4c46;_0x1954d1=0xc8;}else{_0x1954d1=0xce;}_0x447f8e['status'](_0x1954d1);return _0x447f8e['set'](_0xe025('0x20'),_0xa46ed2+'-'+_0x24991c+'/'+_0x5b4c46)[_0xe025('0x1b')](_0x57b5ab);}return null;};}function patchUpdates(_0x27ccf7){return function(_0x4226a5){try{jsonpatch['apply'](_0x4226a5,_0x27ccf7,!![]);}catch(_0x30efe0){return BPromise[_0xe025('0x21')](_0x30efe0);}return _0x4226a5[_0xe025('0x22')]();};}function saveUpdates(_0x41ee4e,_0x28b730){return function(_0x5efc2e){if(_0x5efc2e){return _0x5efc2e['update'](_0x41ee4e)[_0xe025('0x23')](function(_0x100ddd){return _0x100ddd;});}return null;};}function removeEntity(_0x286904,_0x3521bf){return function(_0xe667d){if(_0xe667d){return _0xe667d[_0xe025('0x24')]()[_0xe025('0x23')](function(){var _0x2d377a=_0xe667d['get']({'plain':!![]});var _0x3e34d8=_0xe025('0x25');return db[_0xe025('0x26')][_0xe025('0x24')]({'where':{'type':_0x3e34d8,'resourceId':_0x2d377a['id']}})[_0xe025('0x23')](function(){return _0xe667d;});})['then'](function(){_0x286904[_0xe025('0x1a')](0xcc)[_0xe025('0x19')]();});}};}function handleEntityNotFound(_0x25c67f,_0x59b880){return function(_0x1175cf){if(!_0x1175cf){_0x25c67f[_0xe025('0x18')](0x194);}return _0x1175cf;};}function handleError(_0x59d67e,_0x5caac4){_0x5caac4=_0x5caac4||0x1f4;return function(_0x55de91){logger['error'](_0x55de91[_0xe025('0x27')]);if(_0x55de91[_0xe025('0x28')]){delete _0x55de91[_0xe025('0x28')];}_0x59d67e['status'](_0x5caac4)[_0xe025('0x29')](_0x55de91);};}exports['index']=function(_0x2e9b0a,_0x885640){var _0x5dd289={},_0xbe49d1={},_0x1e98ed={'count':0x0,'rows':[]};var _0x111cd1=_['map'](db[_0xe025('0x2a')][_0xe025('0x2b')],function(_0x2e6c6f){return{'name':_0x2e6c6f[_0xe025('0x2c')],'type':_0x2e6c6f[_0xe025('0x2d')][_0xe025('0x2e')]};});_0xbe49d1[_0xe025('0x2f')]=_[_0xe025('0x30')](_0x111cd1,_0xe025('0x28'));_0xbe49d1[_0xe025('0x31')]=_['keys'](_0x2e9b0a[_0xe025('0x31')]);_0xbe49d1[_0xe025('0x32')]=_[_0xe025('0x33')](_0xbe49d1[_0xe025('0x2f')],_0xbe49d1['query']);_0x5dd289[_0xe025('0x34')]=_['intersection'](_0xbe49d1[_0xe025('0x2f')],qs[_0xe025('0x35')](_0x2e9b0a[_0xe025('0x31')][_0xe025('0x35')]));_0x5dd289['attributes']=_0x5dd289['attributes']['length']?_0x5dd289[_0xe025('0x34')]:_0xbe49d1[_0xe025('0x2f')];if(!_0x2e9b0a[_0xe025('0x31')]['hasOwnProperty']('nolimit')){_0x5dd289[_0xe025('0x1f')]=qs[_0xe025('0x1f')](_0x2e9b0a[_0xe025('0x31')][_0xe025('0x1f')]);_0x5dd289[_0xe025('0x1e')]=qs[_0xe025('0x1e')](_0x2e9b0a['query'][_0xe025('0x1e')]);}_0x5dd289[_0xe025('0x36')]=qs[_0xe025('0x37')](_0x2e9b0a[_0xe025('0x31')][_0xe025('0x37')]);_0x5dd289[_0xe025('0x38')]=qs[_0xe025('0x32')](_[_0xe025('0x39')](_0x2e9b0a['query'],_0xbe49d1[_0xe025('0x32')]),_0x111cd1);if(_0x2e9b0a['query'][_0xe025('0x3a')]){_0x5dd289['where']=_[_0xe025('0x3b')](_0x5dd289[_0xe025('0x38')],{'$or':_[_0xe025('0x30')](_0x111cd1,function(_0x3328ff){if(_0x3328ff[_0xe025('0x2d')]!==_0xe025('0x3c')){var _0x41547a={};_0x41547a[_0x3328ff['name']]={'$like':'%'+_0x2e9b0a[_0xe025('0x31')][_0xe025('0x3a')]+'%'};return _0x41547a;}})});}_0x5dd289=_['merge']({},_0x5dd289,_0x2e9b0a[_0xe025('0x3d')]);var _0x35e442={'where':_0x5dd289['where']};return db[_0xe025('0x2a')][_0xe025('0x1d')](_0x35e442)['then'](function(_0x200ffa){_0x1e98ed[_0xe025('0x1d')]=_0x200ffa;if(_0x2e9b0a[_0xe025('0x31')]['includeAll']){_0x5dd289[_0xe025('0x3e')]=[{'all':!![]}];}return db[_0xe025('0x2a')]['findAll'](_0x5dd289);})['then'](function(_0x5e0845){_0x1e98ed['rows']=_0x5e0845;return _0x1e98ed;})[_0xe025('0x23')](respondWithFilteredResult(_0x885640,_0x5dd289))[_0xe025('0x3f')](handleError(_0x885640,null));};exports[_0xe025('0x40')]=function(_0xff8bc7,_0x5f2f8b){var _0x35a46d={'raw':![],'where':{'id':_0xff8bc7['params']['id']}},_0x20d95e={};_0x20d95e[_0xe025('0x2f')]=_[_0xe025('0x41')](db[_0xe025('0x2a')][_0xe025('0x2b')]);_0x20d95e[_0xe025('0x31')]=_[_0xe025('0x41')](_0xff8bc7[_0xe025('0x31')]);_0x20d95e[_0xe025('0x32')]=_[_0xe025('0x33')](_0x20d95e['model'],_0x20d95e[_0xe025('0x31')]);_0x35a46d[_0xe025('0x34')]=_['intersection'](_0x20d95e[_0xe025('0x2f')],qs[_0xe025('0x35')](_0xff8bc7[_0xe025('0x31')][_0xe025('0x35')]));_0x35a46d[_0xe025('0x34')]=_0x35a46d[_0xe025('0x34')][_0xe025('0x42')]?_0x35a46d[_0xe025('0x34')]:_0x20d95e[_0xe025('0x2f')];if(_0xff8bc7['query']['includeAll']){_0x35a46d[_0xe025('0x3e')]=[{'all':!![]}];}_0x35a46d=_[_0xe025('0x3b')]({},_0x35a46d,_0xff8bc7[_0xe025('0x3d')]);return db[_0xe025('0x2a')][_0xe025('0x43')](_0x35a46d)[_0xe025('0x23')](handleEntityNotFound(_0x5f2f8b,null))[_0xe025('0x23')](respondWithResult(_0x5f2f8b,null))[_0xe025('0x3f')](handleError(_0x5f2f8b,null));};exports[_0xe025('0x44')]=function(_0x55cb49,_0x264411){return db[_0xe025('0x2a')][_0xe025('0x44')](_0x55cb49[_0xe025('0x45')],{})[_0xe025('0x23')](function(_0x5b6e01){var _0x2d5469=_0x55cb49[_0xe025('0x46')][_0xe025('0x47')]({'plain':!![]});if(!_0x2d5469)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5469['role']===_0xe025('0x46')){var _0xae029d=_0x5b6e01[_0xe025('0x47')]({'plain':!![]});var _0x5772be=_0xe025('0x25');return db['UserProfileSection'][_0xe025('0x43')]({'where':{'name':_0x5772be,'userProfileId':_0x2d5469[_0xe025('0x48')]},'raw':!![]})[_0xe025('0x23')](function(_0x230984){if(_0x230984&&_0x230984[_0xe025('0x49')]===0x0){return db[_0xe025('0x26')]['create']({'name':_0xae029d[_0xe025('0x28')],'resourceId':_0xae029d['id'],'type':_0x230984['name'],'sectionId':_0x230984['id']},{})[_0xe025('0x23')](function(){return _0x5b6e01;});}else{return _0x5b6e01;}})['catch'](function(_0x794f8e){logger[_0xe025('0x4a')](_0xe025('0x4b'),_0x794f8e);throw _0x794f8e;});}return _0x5b6e01;})[_0xe025('0x23')](respondWithResult(_0x264411,0xc9))[_0xe025('0x3f')](handleError(_0x264411,null));};exports[_0xe025('0x4c')]=function(_0x1f82f9,_0x549823){if(_0x1f82f9[_0xe025('0x45')]['id']){delete _0x1f82f9['body']['id'];}return db[_0xe025('0x2a')]['find']({'where':{'id':_0x1f82f9[_0xe025('0x4d')]['id']}})[_0xe025('0x23')](handleEntityNotFound(_0x549823,null))['then'](saveUpdates(_0x1f82f9[_0xe025('0x45')],null))[_0xe025('0x23')](respondWithResult(_0x549823,null))[_0xe025('0x3f')](handleError(_0x549823,null));};exports[_0xe025('0x24')]=function(_0x42b76e,_0x3b118b){return db['Schedule']['find']({'where':{'id':_0x42b76e['params']['id']}})['then'](handleEntityNotFound(_0x3b118b,null))['then'](removeEntity(_0x3b118b,null))[_0xe025('0x3f')](handleError(_0x3b118b,null));};exports['run']=function(_0x2818dc,_0x43b3c2,_0x3613ec){var _0x25299c=require(_0xe025('0x4e'));return db[_0xe025('0x2a')][_0xe025('0x43')]({'where':{'id':_0x2818dc[_0xe025('0x4d')]['id']},'raw':!![]})[_0xe025('0x23')](handleEntityNotFound(_0x43b3c2,null))[_0xe025('0x23')](function(){_0x25299c[_0xe025('0x4f')](_0x2818dc[_0xe025('0x4d')]['id']);})[_0xe025('0x23')](respondWithStatusCode(_0x43b3c2,null))['catch'](handleError(_0x43b3c2,null));}; \ No newline at end of file +var _0x57a7=['merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','../../config/schedule','run','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','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/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','get','Scheduler','UserProfileResource','destroy','error','send','Schedule','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x57a7,0x11a));var _0x757a=function(_0x178fc3,_0x208005){_0x178fc3=_0x178fc3-0x0;var _0x3ee5ef=_0x57a7[_0x178fc3];return _0x3ee5ef;};'use strict';var emlformat=require(_0x757a('0x0'));var rimraf=require(_0x757a('0x1'));var zipdir=require(_0x757a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x757a('0x3'));var moment=require(_0x757a('0x4'));var BPromise=require(_0x757a('0x5'));var Mustache=require(_0x757a('0x6'));var util=require(_0x757a('0x7'));var path=require('path');var sox=require(_0x757a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x757a('0x9'));var _=require(_0x757a('0xa'));var squel=require(_0x757a('0xb'));var crypto=require(_0x757a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x757a('0xd'));var toCsv=require(_0x757a('0xe'));var querystring=require(_0x757a('0xf'));var Papa=require(_0x757a('0x10'));var Redis=require(_0x757a('0x11'));var authService=require(_0x757a('0x12'));var qs=require(_0x757a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x757a('0x14'));var logger=require(_0x757a('0x15'))(_0x757a('0x16'));var utils=require(_0x757a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x757a('0x18'));var db=require(_0x757a('0x19'))['db'];function respondWithStatusCode(_0x6e38f,_0x345948){_0x345948=_0x345948||0xcc;return function(_0x23c0ab){if(_0x23c0ab){return _0x6e38f[_0x757a('0x1a')](_0x345948);}return _0x6e38f[_0x757a('0x1b')](_0x345948)[_0x757a('0x1c')]();};}function respondWithResult(_0x3fc1c6,_0x1bf805){_0x1bf805=_0x1bf805||0xc8;return function(_0x5c2aaa){if(_0x5c2aaa){return _0x3fc1c6[_0x757a('0x1b')](_0x1bf805)['json'](_0x5c2aaa);}};}function respondWithFilteredResult(_0x2d5273,_0x55da69){return function(_0x56cd1f){if(_0x56cd1f){var _0x3adb3b=typeof _0x55da69['offset']===_0x757a('0x1d')&&typeof _0x55da69[_0x757a('0x1e')]==='undefined';var _0x274c2e=_0x56cd1f[_0x757a('0x1f')];var _0x478a2b=_0x3adb3b?0x0:_0x55da69[_0x757a('0x20')];var _0x12bd78=_0x3adb3b?_0x56cd1f['count']:_0x55da69[_0x757a('0x20')]+_0x55da69['limit'];var _0x4faa04;if(_0x12bd78>=_0x274c2e){_0x12bd78=_0x274c2e;_0x4faa04=0xc8;}else{_0x4faa04=0xce;}_0x2d5273[_0x757a('0x1b')](_0x4faa04);return _0x2d5273[_0x757a('0x21')](_0x757a('0x22'),_0x478a2b+'-'+_0x12bd78+'/'+_0x274c2e)[_0x757a('0x23')](_0x56cd1f);}return null;};}function patchUpdates(_0x52ff59){return function(_0x507717){try{jsonpatch[_0x757a('0x24')](_0x507717,_0x52ff59,!![]);}catch(_0x27bee2){return BPromise[_0x757a('0x25')](_0x27bee2);}return _0x507717[_0x757a('0x26')]();};}function saveUpdates(_0x23a997,_0x450bc2){return function(_0x2d0ed5){if(_0x2d0ed5){return _0x2d0ed5['update'](_0x23a997)[_0x757a('0x27')](function(_0x72817a){return _0x72817a;});}return null;};}function removeEntity(_0x1518e6,_0x21babb){return function(_0x11af35){if(_0x11af35){return _0x11af35['destroy']()[_0x757a('0x27')](function(){var _0x23817b=_0x11af35[_0x757a('0x28')]({'plain':!![]});var _0x5805ce=_0x757a('0x29');return db[_0x757a('0x2a')][_0x757a('0x2b')]({'where':{'type':_0x5805ce,'resourceId':_0x23817b['id']}})[_0x757a('0x27')](function(){return _0x11af35;});})[_0x757a('0x27')](function(){_0x1518e6[_0x757a('0x1b')](0xcc)[_0x757a('0x1c')]();});}};}function handleEntityNotFound(_0x251d11,_0x588ed8){return function(_0x1c9625){if(!_0x1c9625){_0x251d11[_0x757a('0x1a')](0x194);}return _0x1c9625;};}function handleError(_0x407066,_0x4e247f){_0x4e247f=_0x4e247f||0x1f4;return function(_0x18a275){logger[_0x757a('0x2c')](_0x18a275['stack']);if(_0x18a275['name']){delete _0x18a275['name'];}_0x407066[_0x757a('0x1b')](_0x4e247f)[_0x757a('0x2d')](_0x18a275);};}exports['index']=function(_0x581569,_0x336f80){var _0x1e5a5a={},_0x4be54d={},_0x117264={'count':0x0,'rows':[]};var _0x28d6da=_['map'](db[_0x757a('0x2e')][_0x757a('0x2f')],function(_0xffe3ca){return{'name':_0xffe3ca[_0x757a('0x30')],'type':_0xffe3ca[_0x757a('0x31')][_0x757a('0x32')]};});_0x4be54d[_0x757a('0x33')]=_[_0x757a('0x34')](_0x28d6da,_0x757a('0x35'));_0x4be54d[_0x757a('0x36')]=_['keys'](_0x581569[_0x757a('0x36')]);_0x4be54d['filters']=_[_0x757a('0x37')](_0x4be54d[_0x757a('0x33')],_0x4be54d['query']);_0x1e5a5a[_0x757a('0x38')]=_[_0x757a('0x37')](_0x4be54d['model'],qs[_0x757a('0x39')](_0x581569[_0x757a('0x36')][_0x757a('0x39')]));_0x1e5a5a[_0x757a('0x38')]=_0x1e5a5a[_0x757a('0x38')]['length']?_0x1e5a5a[_0x757a('0x38')]:_0x4be54d[_0x757a('0x33')];if(!_0x581569[_0x757a('0x36')][_0x757a('0x3a')](_0x757a('0x3b'))){_0x1e5a5a['limit']=qs[_0x757a('0x1e')](_0x581569['query'][_0x757a('0x1e')]);_0x1e5a5a[_0x757a('0x20')]=qs[_0x757a('0x20')](_0x581569[_0x757a('0x36')][_0x757a('0x20')]);}_0x1e5a5a[_0x757a('0x3c')]=qs[_0x757a('0x3d')](_0x581569['query']['sort']);_0x1e5a5a[_0x757a('0x3e')]=qs['filters'](_[_0x757a('0x3f')](_0x581569['query'],_0x4be54d[_0x757a('0x40')]),_0x28d6da);if(_0x581569[_0x757a('0x36')][_0x757a('0x41')]){_0x1e5a5a['where']=_[_0x757a('0x42')](_0x1e5a5a[_0x757a('0x3e')],{'$or':_[_0x757a('0x34')](_0x28d6da,function(_0x1a25bb){if(_0x1a25bb[_0x757a('0x31')]!==_0x757a('0x43')){var _0x1c631f={};_0x1c631f[_0x1a25bb['name']]={'$like':'%'+_0x581569[_0x757a('0x36')][_0x757a('0x41')]+'%'};return _0x1c631f;}})});}_0x1e5a5a=_['merge']({},_0x1e5a5a,_0x581569[_0x757a('0x44')]);var _0x3148cd={'where':_0x1e5a5a[_0x757a('0x3e')]};return db['Schedule']['count'](_0x3148cd)[_0x757a('0x27')](function(_0xf44ab5){_0x117264[_0x757a('0x1f')]=_0xf44ab5;if(_0x581569['query']['includeAll']){_0x1e5a5a[_0x757a('0x45')]=[{'all':!![]}];}return db[_0x757a('0x2e')][_0x757a('0x46')](_0x1e5a5a);})['then'](function(_0x3848aa){_0x117264[_0x757a('0x47')]=_0x3848aa;return _0x117264;})[_0x757a('0x27')](respondWithFilteredResult(_0x336f80,_0x1e5a5a))[_0x757a('0x48')](handleError(_0x336f80,null));};exports[_0x757a('0x49')]=function(_0x19af3c,_0x14a908){var _0x2d8355={'raw':![],'where':{'id':_0x19af3c['params']['id']}},_0x2ef0ae={};_0x2ef0ae[_0x757a('0x33')]=_['keys'](db[_0x757a('0x2e')]['rawAttributes']);_0x2ef0ae[_0x757a('0x36')]=_[_0x757a('0x4a')](_0x19af3c[_0x757a('0x36')]);_0x2ef0ae[_0x757a('0x40')]=_[_0x757a('0x37')](_0x2ef0ae[_0x757a('0x33')],_0x2ef0ae[_0x757a('0x36')]);_0x2d8355['attributes']=_['intersection'](_0x2ef0ae[_0x757a('0x33')],qs[_0x757a('0x39')](_0x19af3c[_0x757a('0x36')][_0x757a('0x39')]));_0x2d8355['attributes']=_0x2d8355[_0x757a('0x38')]['length']?_0x2d8355[_0x757a('0x38')]:_0x2ef0ae[_0x757a('0x33')];if(_0x19af3c[_0x757a('0x36')][_0x757a('0x4b')]){_0x2d8355[_0x757a('0x45')]=[{'all':!![]}];}_0x2d8355=_[_0x757a('0x42')]({},_0x2d8355,_0x19af3c[_0x757a('0x44')]);return db['Schedule'][_0x757a('0x4c')](_0x2d8355)[_0x757a('0x27')](handleEntityNotFound(_0x14a908,null))[_0x757a('0x27')](respondWithResult(_0x14a908,null))[_0x757a('0x48')](handleError(_0x14a908,null));};exports[_0x757a('0x4d')]=function(_0x55f259,_0x5e6a8b){return db[_0x757a('0x2e')][_0x757a('0x4d')](_0x55f259[_0x757a('0x4e')],{})[_0x757a('0x27')](function(_0x748203){var _0x7a2e88=_0x55f259['user']['get']({'plain':!![]});if(!_0x7a2e88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7a2e88[_0x757a('0x4f')]==='user'){var _0x4c047a=_0x748203[_0x757a('0x28')]({'plain':!![]});var _0x20b43e='Scheduler';return db[_0x757a('0x50')]['find']({'where':{'name':_0x20b43e,'userProfileId':_0x7a2e88[_0x757a('0x51')]},'raw':!![]})[_0x757a('0x27')](function(_0x4430f4){if(_0x4430f4&&_0x4430f4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4c047a['name'],'resourceId':_0x4c047a['id'],'type':_0x4430f4[_0x757a('0x35')],'sectionId':_0x4430f4['id']},{})[_0x757a('0x27')](function(){return _0x748203;});}else{return _0x748203;}})['catch'](function(_0x1db92e){logger[_0x757a('0x2c')](_0x757a('0x52'),_0x1db92e);throw _0x1db92e;});}return _0x748203;})[_0x757a('0x27')](respondWithResult(_0x5e6a8b,0xc9))['catch'](handleError(_0x5e6a8b,null));};exports[_0x757a('0x53')]=function(_0x12c041,_0x3e1305){if(_0x12c041[_0x757a('0x4e')]['id']){delete _0x12c041[_0x757a('0x4e')]['id'];}return db[_0x757a('0x2e')]['find']({'where':{'id':_0x12c041[_0x757a('0x54')]['id']}})[_0x757a('0x27')](handleEntityNotFound(_0x3e1305,null))[_0x757a('0x27')](saveUpdates(_0x12c041['body'],null))[_0x757a('0x27')](respondWithResult(_0x3e1305,null))['catch'](handleError(_0x3e1305,null));};exports[_0x757a('0x2b')]=function(_0x218821,_0x5e8c80){return db['Schedule'][_0x757a('0x4c')]({'where':{'id':_0x218821[_0x757a('0x54')]['id']}})[_0x757a('0x27')](handleEntityNotFound(_0x5e8c80,null))['then'](removeEntity(_0x5e8c80,null))['catch'](handleError(_0x5e8c80,null));};exports['run']=function(_0x405f28,_0x2f5990,_0x374e70){var _0x3d02d9=require(_0x757a('0x55'));return db[_0x757a('0x2e')]['find']({'where':{'id':_0x405f28[_0x757a('0x54')]['id']},'raw':!![]})[_0x757a('0x27')](handleEntityNotFound(_0x2f5990,null))[_0x757a('0x27')](function(){_0x3d02d9[_0x757a('0x56')](_0x405f28[_0x757a('0x54')]['id']);})[_0x757a('0x27')](respondWithStatusCode(_0x2f5990,null))['catch'](handleError(_0x2f5990,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6abcb62..bf07d4c 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 _0xcc66=['path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1ce8e8,_0x48d5bb){var _0x545c39=function(_0x5bb7d0){while(--_0x5bb7d0){_0x1ce8e8['push'](_0x1ce8e8['shift']());}};_0x545c39(++_0x48d5bb);}(_0xcc66,0x1d4));var _0x6cc6=function(_0x259b24,_0x17127a){_0x259b24=_0x259b24-0x0;var _0x3dec70=_0xcc66[_0x259b24];return _0x3dec70;};'use strict';var _=require(_0x6cc6('0x0'));var util=require(_0x6cc6('0x1'));var logger=require(_0x6cc6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6cc6('0x3'));var rp=require(_0x6cc6('0x4'));var fs=require('fs');var path=require(_0x6cc6('0x5'));var rimraf=require('rimraf');var config=require(_0x6cc6('0x6'));var attributes=require(_0x6cc6('0x7'));module['exports']=function(_0x119315,_0x574cc5){return _0x119315[_0x6cc6('0x8')](_0x6cc6('0x9'),attributes,{'tableName':_0x6cc6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe509=['Schedule','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0xe509,0x14b));var _0x9e50=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xe509[_0x3ba422];return _0x20b5dd;};'use strict';var _=require(_0x9e50('0x0'));var util=require(_0x9e50('0x1'));var logger=require(_0x9e50('0x2'))(_0x9e50('0x3'));var moment=require(_0x9e50('0x4'));var BPromise=require(_0x9e50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e50('0x6'));var rimraf=require('rimraf');var config=require(_0x9e50('0x7'));var attributes=require('./schedule.attributes');module[_0x9e50('0x8')]=function(_0x8df99f,_0x341f83){return _0x8df99f['define'](_0x9e50('0x9'),attributes,{'tableName':'tools_schedules','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 1fa0f41..cf646cb 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 _0xa35f=['bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1f3fd8,_0x50bb37){var _0x385f23=function(_0x17f694){while(--_0x17f694){_0x1f3fd8['push'](_0x1f3fd8['shift']());}};_0x385f23(++_0x50bb37);}(_0xa35f,0x1b6));var _0xfa35=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0xa35f[_0x1c06f4];return _0x1a727e;};'use strict';var _=require(_0xfa35('0x0'));var util=require(_0xfa35('0x1'));var moment=require(_0xfa35('0x2'));var BPromise=require(_0xfa35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa35('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa35('0x5'))(_0xfa35('0x6'));var config=require(_0xfa35('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfa35('0x8')][_0xfa35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37eb70,_0x293af9,_0x363db8){return new BPromise(function(_0x2fb2bf,_0x39ddf2){return client[_0xfa35('0xa')](_0x37eb70,_0x363db8)[_0xfa35('0xb')](function(_0x103d3a){logger[_0xfa35('0xc')](_0xfa35('0xd'),_0x293af9,_0xfa35('0xe'));logger['debug'](_0xfa35('0xf'),_0x293af9,_0xfa35('0xe'),JSON[_0xfa35('0x10')](_0x103d3a));if(_0x103d3a[_0xfa35('0x11')]){if(_0x103d3a[_0xfa35('0x11')][_0xfa35('0x12')]===0x1f4){logger['error'](_0xfa35('0xd'),_0x293af9,_0x103d3a['error'][_0xfa35('0x13')]);return _0x39ddf2(_0x103d3a[_0xfa35('0x11')][_0xfa35('0x13')]);}logger[_0xfa35('0x11')]('Schedule,\x20%s,\x20%s',_0x293af9,_0x103d3a[_0xfa35('0x11')]['message']);return _0x2fb2bf(_0x103d3a[_0xfa35('0x11')][_0xfa35('0x13')]);}else{logger[_0xfa35('0xc')]('Schedule,\x20%s,\x20%s',_0x293af9,_0xfa35('0xe'));_0x2fb2bf(_0x103d3a['result'][_0xfa35('0x13')]);}})[_0xfa35('0x14')](function(_0x1318b7){logger[_0xfa35('0x11')](_0xfa35('0xd'),_0x293af9,_0x1318b7);_0x39ddf2(_0x1318b7);});});} \ No newline at end of file +var _0x1026=['error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1026,0x148));var _0x6102=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x1026[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0x6102('0x0'));var util=require(_0x6102('0x1'));var moment=require('moment');var BPromise=require(_0x6102('0x2'));var rs=require(_0x6102('0x3'));var fs=require('fs');var Redis=require(_0x6102('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6102('0x5'));var logger=require('../../config/logger')(_0x6102('0x6'));var config=require(_0x6102('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6102('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14ae81,_0x1c5d67,_0x3455b0){return new BPromise(function(_0x19078b,_0x427e0d){return client[_0x6102('0x9')](_0x14ae81,_0x3455b0)['then'](function(_0x50bf58){logger[_0x6102('0xa')](_0x6102('0xb'),_0x1c5d67,_0x6102('0xc'));logger['debug'](_0x6102('0xd'),_0x1c5d67,_0x6102('0xc'),JSON['stringify'](_0x50bf58));if(_0x50bf58[_0x6102('0xe')]){if(_0x50bf58[_0x6102('0xe')]['code']===0x1f4){logger['error'](_0x6102('0xb'),_0x1c5d67,_0x50bf58['error'][_0x6102('0xf')]);return _0x427e0d(_0x50bf58[_0x6102('0xe')][_0x6102('0xf')]);}logger[_0x6102('0xe')](_0x6102('0xb'),_0x1c5d67,_0x50bf58[_0x6102('0xe')]['message']);return _0x19078b(_0x50bf58[_0x6102('0xe')]['message']);}else{logger[_0x6102('0xa')](_0x6102('0xb'),_0x1c5d67,'request\x20sent');_0x19078b(_0x50bf58[_0x6102('0x10')][_0x6102('0xf')]);}})[_0x6102('0x11')](function(_0x55782e){logger[_0x6102('0xe')](_0x6102('0xb'),_0x1c5d67,_0x55782e);_0x427e0d(_0x55782e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 302f5cf..a0e35fb 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 _0x3c70=['index','/describe','describe','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x10a8d8,_0x28f292){var _0x3b2b79=function(_0x55a3fe){while(--_0x55a3fe){_0x10a8d8['push'](_0x10a8d8['shift']());}};_0x3b2b79(++_0x28f292);}(_0x3c70,0x1e8));var _0x03c7=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x3c70[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var path=require(_0x03c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x03c7('0x3'));var router=express[_0x03c7('0x4')]();var fs_extra=require(_0x03c7('0x5'));var auth=require(_0x03c7('0x6'));var interaction=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var controller=require(_0x03c7('0x9'));router[_0x03c7('0xa')]('/',auth[_0x03c7('0xb')](),controller[_0x03c7('0xc')]);router[_0x03c7('0xa')](_0x03c7('0xd'),auth[_0x03c7('0xb')](),controller[_0x03c7('0xe')]);router[_0x03c7('0xa')]('/:id',auth[_0x03c7('0xb')](),controller[_0x03c7('0xf')]);router[_0x03c7('0xa')](_0x03c7('0x10'),auth[_0x03c7('0xb')](),controller[_0x03c7('0x11')]);router[_0x03c7('0x12')]('/',auth[_0x03c7('0xb')](),controller[_0x03c7('0x13')]);router['put'](_0x03c7('0x14'),auth['isAuthenticated'](),controller[_0x03c7('0x15')]);router[_0x03c7('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x03c7('0x17')]);module[_0x03c7('0x18')]=router; \ No newline at end of file +var _0x7935=['get','index','isAuthenticated','describe','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x421689,_0x3a81ff){var _0x1df39d=function(_0x31e135){while(--_0x31e135){_0x421689['push'](_0x421689['shift']());}};_0x1df39d(++_0x3a81ff);}(_0x7935,0x18e));var _0x5793=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x7935[_0x5e8eae];return _0xdd09cd;};'use strict';var multer=require(_0x5793('0x0'));var util=require(_0x5793('0x1'));var path=require('path');var timeout=require(_0x5793('0x2'));var express=require(_0x5793('0x3'));var router=express[_0x5793('0x4')]();var fs_extra=require(_0x5793('0x5'));var auth=require(_0x5793('0x6'));var interaction=require(_0x5793('0x7'));var config=require(_0x5793('0x8'));var controller=require(_0x5793('0x9'));router[_0x5793('0xa')]('/',auth['isAuthenticated'](),controller[_0x5793('0xb')]);router['get']('/describe',auth[_0x5793('0xc')](),controller[_0x5793('0xd')]);router[_0x5793('0xa')]('/:id',auth[_0x5793('0xc')](),controller[_0x5793('0xe')]);router[_0x5793('0xa')](_0x5793('0xf'),auth['isAuthenticated'](),controller[_0x5793('0x10')]);router[_0x5793('0x11')]('/',auth[_0x5793('0xc')](),controller[_0x5793('0x12')]);router[_0x5793('0x13')](_0x5793('0x14'),auth[_0x5793('0xc')](),controller[_0x5793('0x15')]);router[_0x5793('0x16')](_0x5793('0x14'),auth[_0x5793('0xc')](),controller[_0x5793('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 71f9395..7837a71 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 _0xf277=['updatedAt','sequelize','moment','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','duration','DATE','startedAt','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf277,0x1e1));var _0x7f27=function(_0x594b48,_0x34afd5){_0x594b48=_0x594b48-0x0;var _0x3110b7=_0xf277[_0x594b48];return _0x3110b7;};'use strict';var Sequelize=require(_0x7f27('0x0'));var moment=require(_0x7f27('0x1'));var path=require('path');var config=require(_0x7f27('0x2'));module['exports']={'format':{'type':Sequelize[_0x7f27('0x3')],'get':function(){return this[_0x7f27('0x4')](_0x7f27('0x5'))?path[_0x7f27('0x6')](this[_0x7f27('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x7f27('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x7f27('0x7')],'set':function(_0x39dcee){var _0x480cd6=_0x39dcee[_0x7f27('0x8')](/\\/g,'/');this[_0x7f27('0x9')]('value',_0x480cd6);}},'rating':{'type':Sequelize[_0x7f27('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7f27('0xa')],'set':function(_0x8ecc84){this[_0x7f27('0x9')]('startedAt',moment()['subtract'](_0x8ecc84,'ms'));this[_0x7f27('0x9')]('closedAt',moment());this[_0x7f27('0x9')](_0x7f27('0xb'),_0x8ecc84);}},'startedAt':{'type':Sequelize[_0x7f27('0xc')],'get':function(){return moment(this[_0x7f27('0x4')](_0x7f27('0xd')))[_0x7f27('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x7f27('0xf')]();}},'closedAt':{'type':Sequelize[_0x7f27('0xc')],'get':function(){return moment(this['getDataValue'](_0x7f27('0x10')))[_0x7f27('0xe')](_0x7f27('0x11'))[_0x7f27('0xf')]();}},'createdAt':{'type':Sequelize[_0x7f27('0xc')],'get':function(){return moment(this[_0x7f27('0x4')](_0x7f27('0x12')))[_0x7f27('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x7f27('0xf')]();}},'updatedAt':{'type':Sequelize[_0x7f27('0xc')],'get':function(){return moment(this['getDataValue'](_0x7f27('0x13')))[_0x7f27('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x7f27('0xf')]();}}}; \ No newline at end of file +var _0x7d37=['replace','INTEGER','setDataValue','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','extname','STRING'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x7d37,0x1db));var _0x77d3=function(_0x5c1f3e,_0x318920){_0x5c1f3e=_0x5c1f3e-0x0;var _0x2fbff6=_0x7d37[_0x5c1f3e];return _0x2fbff6;};'use strict';var Sequelize=require(_0x77d3('0x0'));var moment=require(_0x77d3('0x1'));var path=require(_0x77d3('0x2'));var config=require('../../config/environment');module[_0x77d3('0x3')]={'format':{'type':Sequelize[_0x77d3('0x4')],'get':function(){return this[_0x77d3('0x5')]('value')?path[_0x77d3('0x6')](this[_0x77d3('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x77d3('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x77d3('0x7')],'set':function(_0x519c6e){var _0x40235d=_0x519c6e[_0x77d3('0x8')](/\\/g,'/');this['setDataValue']('value',_0x40235d);}},'rating':{'type':Sequelize[_0x77d3('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x77d3('0x9')],'set':function(_0x506caa){this[_0x77d3('0xa')]('startedAt',moment()[_0x77d3('0xb')](_0x506caa,'ms'));this['setDataValue'](_0x77d3('0xc'),moment());this['setDataValue'](_0x77d3('0xd'),_0x506caa);}},'startedAt':{'type':Sequelize[_0x77d3('0xe')],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0xf')))[_0x77d3('0x10')](_0x77d3('0x11'))[_0x77d3('0x12')]();}},'closedAt':{'type':Sequelize[_0x77d3('0xe')],'get':function(){return moment(this[_0x77d3('0x5')]('closedAt'))[_0x77d3('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0x13')))[_0x77d3('0x10')](_0x77d3('0x11'))[_0x77d3('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x77d3('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index db8755e..1836012 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 _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x36974d,_0xfc8cad){var _0x459ad7=function(_0xf5e029){while(--_0xf5e029){_0x36974d['push'](_0x36974d['shift']());}};_0x459ad7(++_0xfc8cad);}(_0xbd50,0x196));var _0x0bd5=function(_0xf81b9a,_0x536bf6){_0xf81b9a=_0xf81b9a-0x0;var _0x2105a4=_0xbd50[_0xf81b9a];return _0x2105a4;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file +var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 52476aa..ba07f5f 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 _0x1524=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x4c2222,_0x36b84f){var _0x5424ef=function(_0x175c64){while(--_0x175c64){_0x4c2222['push'](_0x4c2222['shift']());}};_0x5424ef(++_0x36b84f);}(_0x1524,0x70));var _0x4152=function(_0x33ba78,_0xbcaa2d){_0x33ba78=_0x33ba78-0x0;var _0x24a8a8=_0x1524[_0x33ba78];return _0x24a8a8;};'use strict';var _=require(_0x4152('0x0'));var util=require(_0x4152('0x1'));var logger=require(_0x4152('0x2'))(_0x4152('0x3'));var moment=require(_0x4152('0x4'));var BPromise=require(_0x4152('0x5'));var rp=require(_0x4152('0x6'));var fs=require('fs');var path=require(_0x4152('0x7'));var rimraf=require(_0x4152('0x8'));var config=require(_0x4152('0x9'));var attributes=require(_0x4152('0xa'));module[_0x4152('0xb')]=function(_0x6e15d8,_0x516271){return _0x6e15d8[_0x4152('0xc')](_0x4152('0xd'),attributes,{'tableName':_0x4152('0xe'),'paranoid':![],'indexes':[{'name':_0x4152('0xf'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x55ba=['util','../../config/logger','api','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x36258e,_0x3c60ab){var _0x476be9=function(_0x48014a){while(--_0x48014a){_0x36258e['push'](_0x36258e['shift']());}};_0x476be9(++_0x3c60ab);}(_0x55ba,0x6d));var _0xa55b=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x55ba[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0xa55b('0x0'));var util=require(_0xa55b('0x1'));var logger=require(_0xa55b('0x2'))(_0xa55b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa55b('0x4'));var rimraf=require(_0xa55b('0x5'));var config=require('../../config/environment');var attributes=require(_0xa55b('0x6'));module['exports']=function(_0xeb91ae,_0x15b21c){return _0xeb91ae[_0xa55b('0x7')](_0xa55b('0x8'),attributes,{'tableName':_0xa55b('0x9'),'paranoid':![],'indexes':[{'name':_0xa55b('0xa'),'fields':[_0xa55b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 03187ed..e061358 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 _0xaac4=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x421526,_0x368eca){var _0xc44c07=function(_0x31b0cc){while(--_0x31b0cc){_0x421526['push'](_0x421526['shift']());}};_0xc44c07(++_0x368eca);}(_0xaac4,0x164));var _0x4aac=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xaac4[_0x4c06a3];return _0x7ff53c;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var moment=require(_0x4aac('0x2'));var BPromise=require(_0x4aac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4aac('0x4'));var logger=require(_0x4aac('0x5'))(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var jayson=require(_0x4aac('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e2def,_0x2f76df,_0xb7283d){return new BPromise(function(_0x3dac6f,_0x6dd91d){return client[_0x4aac('0x9')](_0x3e2def,_0xb7283d)[_0x4aac('0xa')](function(_0x4a52d9){logger[_0x4aac('0xb')](_0x4aac('0xc'),_0x2f76df,'request\x20sent');logger[_0x4aac('0xd')](_0x4aac('0xe'),_0x2f76df,'request\x20sent',JSON[_0x4aac('0xf')](_0x4a52d9));if(_0x4a52d9['error']){if(_0x4a52d9['error'][_0x4aac('0x10')]===0x1f4){logger[_0x4aac('0x11')](_0x4aac('0xc'),_0x2f76df,_0x4a52d9[_0x4aac('0x11')][_0x4aac('0x12')]);return _0x6dd91d(_0x4a52d9['error']['message']);}logger[_0x4aac('0x11')](_0x4aac('0xc'),_0x2f76df,_0x4a52d9[_0x4aac('0x11')]['message']);return _0x3dac6f(_0x4a52d9[_0x4aac('0x11')]['message']);}else{logger[_0x4aac('0xb')](_0x4aac('0xc'),_0x2f76df,_0x4aac('0x13'));_0x3dac6f(_0x4a52d9[_0x4aac('0x14')][_0x4aac('0x12')]);}})[_0x4aac('0x15')](function(_0x1378aa){logger[_0x4aac('0x11')](_0x4aac('0xc'),_0x2f76df,_0x1378aa);_0x6dd91d(_0x1378aa);});});} \ No newline at end of file +var _0x26f4=['client','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x26f4,0xcc));var _0x426f=function(_0x486c31,_0x1fb2bd){_0x486c31=_0x486c31-0x0;var _0x1a61f6=_0x26f4[_0x486c31];return _0x1a61f6;};'use strict';var _=require(_0x426f('0x0'));var util=require(_0x426f('0x1'));var moment=require(_0x426f('0x2'));var BPromise=require(_0x426f('0x3'));var rs=require(_0x426f('0x4'));var fs=require('fs');var Redis=require(_0x426f('0x5'));var db=require(_0x426f('0x6'))['db'];var utils=require(_0x426f('0x7'));var logger=require(_0x426f('0x8'))(_0x426f('0x9'));var config=require(_0x426f('0xa'));var jayson=require(_0x426f('0xb'));var client=jayson[_0x426f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bdb0e,_0x471f4b,_0x21cbac){return new BPromise(function(_0xe54893,_0x3a485b){return client['request'](_0x1bdb0e,_0x21cbac)[_0x426f('0xd')](function(_0x51cdb5){logger['info'](_0x426f('0xe'),_0x471f4b,_0x426f('0xf'));logger[_0x426f('0x10')](_0x426f('0x11'),_0x471f4b,_0x426f('0xf'),JSON[_0x426f('0x12')](_0x51cdb5));if(_0x51cdb5[_0x426f('0x13')]){if(_0x51cdb5[_0x426f('0x13')][_0x426f('0x14')]===0x1f4){logger[_0x426f('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x471f4b,_0x51cdb5[_0x426f('0x13')]['message']);return _0x3a485b(_0x51cdb5[_0x426f('0x13')][_0x426f('0x15')]);}logger[_0x426f('0x13')](_0x426f('0xe'),_0x471f4b,_0x51cdb5['error']['message']);return _0xe54893(_0x51cdb5['error'][_0x426f('0x15')]);}else{logger[_0x426f('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x471f4b,_0x426f('0xf'));_0xe54893(_0x51cdb5[_0x426f('0x17')][_0x426f('0x15')]);}})['catch'](function(_0x2378eb){logger[_0x426f('0x13')](_0x426f('0xe'),_0x471f4b,_0x2378eb);_0x3a485b(_0x2378eb);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b724070..cc6dcb3 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 _0xfbda=['%s%s','logo','originalname','post','file','addLogo','diskStorage','join','root','logologin','extname','addLogoLogin','preferred','single','addPreferred','favicon','addFavicon','put','isAuthenticated','update','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','server/files/images/logos/','format'];(function(_0x4faa19,_0xff2e9e){var _0x5e751b=function(_0x584955){while(--_0x584955){_0x4faa19['push'](_0x4faa19['shift']());}};_0x5e751b(++_0xff2e9e);}(_0xfbda,0x6c));var _0xafbd=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xfbda[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xafbd('0x0'));var util=require('util');var path=require(_0xafbd('0x1'));var timeout=require(_0xafbd('0x2'));var express=require('express');var router=express[_0xafbd('0x3')]();var fs_extra=require(_0xafbd('0x4'));var auth=require(_0xafbd('0x5'));var interaction=require(_0xafbd('0x6'));var config=require(_0xafbd('0x7'));var controller=require(_0xafbd('0x8'));router[_0xafbd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xafbd('0x9')](_0xafbd('0xa'),controller['getDate']);router[_0xafbd('0x9')](_0xafbd('0xb'),controller[_0xafbd('0xc')]);router[_0xafbd('0x9')](_0xafbd('0xd'),controller[_0xafbd('0xe')]);router[_0xafbd('0x9')](_0xafbd('0xf'),controller[_0xafbd('0x10')]);router[_0xafbd('0x9')](_0xafbd('0x11'),controller[_0xafbd('0x12')]);router[_0xafbd('0x9')](_0xafbd('0x13'),controller['getPreferred']);router['get'](_0xafbd('0x14'),controller[_0xafbd('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x268875,_0x60f2d0,_0x544157){_0x544157(null,path['join'](config['root'],_0xafbd('0x16')));},'filename':function(_0x5530c1,_0x27e202,_0x205ab1){_0x205ab1(null,util[_0xafbd('0x17')](_0xafbd('0x18'),_0xafbd('0x19'),path['extname'](_0x27e202[_0xafbd('0x1a')])));}})});router[_0xafbd('0x1b')](_0xafbd('0xd'),upload['single'](_0xafbd('0x1c')),controller[_0xafbd('0x1d')]);var upload=multer({'storage':multer[_0xafbd('0x1e')]({'destination':function(_0x1291e6,_0x27eb15,_0x386b41){_0x386b41(null,path[_0xafbd('0x1f')](config[_0xafbd('0x20')],'server/files/images/logos/'));},'filename':function(_0x4217e5,_0x1d1060,_0x38bace){_0x38bace(null,util[_0xafbd('0x17')]('%s%s',_0xafbd('0x21'),path[_0xafbd('0x22')](_0x1d1060[_0xafbd('0x1a')])));}})});router[_0xafbd('0x1b')](_0xafbd('0xf'),upload['single'](_0xafbd('0x1c')),controller[_0xafbd('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5858fb,_0xf28026,_0x21e75b){_0x21e75b(null,path[_0xafbd('0x1f')](config[_0xafbd('0x20')],_0xafbd('0x16')));},'filename':function(_0x1714a1,_0x53fce1,_0xdcb6d5){_0xdcb6d5(null,util[_0xafbd('0x17')]('%s%s',_0xafbd('0x24'),path['extname'](_0x53fce1['originalname'])));}})});router[_0xafbd('0x1b')]('/:id/preferred',upload[_0xafbd('0x25')](_0xafbd('0x1c')),controller[_0xafbd('0x26')]);var upload=multer({'storage':multer[_0xafbd('0x1e')]({'destination':function(_0xb53fc3,_0x482aaf,_0x44eb85){_0x44eb85(null,path[_0xafbd('0x1f')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3a4c18,_0x537df9,_0x1f2270){_0x1f2270(null,util[_0xafbd('0x17')](_0xafbd('0x18'),_0xafbd('0x27'),path['extname'](_0x537df9['originalname'])));}})});router[_0xafbd('0x1b')](_0xafbd('0x14'),upload[_0xafbd('0x25')](_0xafbd('0x1c')),controller[_0xafbd('0x28')]);router[_0xafbd('0x29')](_0xafbd('0xb'),auth[_0xafbd('0x2a')](),controller[_0xafbd('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x6b37=['gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','format','%s%s','logo','extname','originalname','single','file','addLogo','join','server/files/images/logos/','logologin','preferred','post','addPreferred','favicon','addFavicon','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr'];(function(_0x470cce,_0x92ab62){var _0x371fbd=function(_0x255649){while(--_0x255649){_0x470cce['push'](_0x470cce['shift']());}};_0x371fbd(++_0x92ab62);}(_0x6b37,0x90));var _0x76b3=function(_0x565060,_0x5ac753){_0x565060=_0x565060-0x0;var _0xe6e453=_0x6b37[_0x565060];return _0xe6e453;};'use strict';var multer=require(_0x76b3('0x0'));var util=require(_0x76b3('0x1'));var path=require(_0x76b3('0x2'));var timeout=require(_0x76b3('0x3'));var express=require('express');var router=express[_0x76b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76b3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x76b3('0x6'));router[_0x76b3('0x7')]('/',auth[_0x76b3('0x8')](),controller[_0x76b3('0x9')]);router[_0x76b3('0x7')](_0x76b3('0xa'),controller['getDate']);router[_0x76b3('0x7')](_0x76b3('0xb'),controller[_0x76b3('0xc')]);router[_0x76b3('0x7')]('/:id/logo',controller['getLogo']);router[_0x76b3('0x7')](_0x76b3('0xd'),controller[_0x76b3('0xe')]);router[_0x76b3('0x7')](_0x76b3('0xf'),controller[_0x76b3('0x10')]);router['get'](_0x76b3('0x11'),controller[_0x76b3('0x12')]);router[_0x76b3('0x7')](_0x76b3('0x13'),controller[_0x76b3('0x14')]);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x216019,_0x13b06,_0x5a3cb8){_0x5a3cb8(null,path['join'](config[_0x76b3('0x16')],'server/files/images/logos/'));},'filename':function(_0x5a195b,_0x2f39b8,_0x4bf862){_0x4bf862(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x19'),path[_0x76b3('0x1a')](_0x2f39b8[_0x76b3('0x1b')])));}})});router['post']('/:id/logo',upload[_0x76b3('0x1c')](_0x76b3('0x1d')),controller[_0x76b3('0x1e')]);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x444d30,_0x3f6634,_0x1efc31){_0x1efc31(null,path[_0x76b3('0x1f')](config[_0x76b3('0x16')],_0x76b3('0x20')));},'filename':function(_0x568bb7,_0x504b15,_0x4b21d9){_0x4b21d9(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x21'),path[_0x76b3('0x1a')](_0x504b15['originalname'])));}})});router['post']('/:id/logo_login',upload['single'](_0x76b3('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x59d951,_0x188298,_0x2922d8){_0x2922d8(null,path['join'](config[_0x76b3('0x16')],_0x76b3('0x20')));},'filename':function(_0x1f7797,_0x2e4a53,_0x43012d){_0x43012d(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x22'),path[_0x76b3('0x1a')](_0x2e4a53['originalname'])));}})});router[_0x76b3('0x23')](_0x76b3('0x11'),upload[_0x76b3('0x1c')](_0x76b3('0x1d')),controller[_0x76b3('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cc127,_0x4670f1,_0x4b1974){_0x4b1974(null,path[_0x76b3('0x1f')](config[_0x76b3('0x16')],'server/files/images/logos/'));},'filename':function(_0x399626,_0x355a3a,_0x1e2ff8){_0x1e2ff8(null,util['format'](_0x76b3('0x18'),_0x76b3('0x25'),path[_0x76b3('0x1a')](_0x355a3a['originalname'])));}})});router[_0x76b3('0x23')](_0x76b3('0x13'),upload['single'](_0x76b3('0x1d')),controller[_0x76b3('0x26')]);router['put']('/:id',auth[_0x76b3('0x8')](),controller['update']);module[_0x76b3('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d118a13..24ecc2c 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x303e49,_0x45e239){var _0x4fff7a=function(_0xf81d23){while(--_0xf81d23){_0x303e49['push'](_0x303e49['shift']());}};_0x4fff7a(++_0x45e239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5a3f8b,_0x30aef7){var _0x42bacc=function(_0x2b461e){while(--_0x2b461e){_0x5a3f8b['push'](_0x5a3f8b['shift']());}};_0x42bacc(++_0x30aef7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 84bd956..8a65f64 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 _0x20ef=['api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','offset','undefined','count','limit','set','apply','save','update','destroy','end','name','send','map','Setting','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','addLogo','file','logo','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultLoginLogo','default_loginLogo.svg','default','download','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x36d955,_0x2a6d31){var _0x1a9a6b=function(_0x3189d5){while(--_0x3189d5){_0x36d955['push'](_0x36d955['shift']());}};_0x1a9a6b(++_0x2a6d31);}(_0x20ef,0xe6));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf20e('0x0'));var rimraf=require(_0xf20e('0x1'));var zipdir=require(_0xf20e('0x2'));var jsonpatch=require(_0xf20e('0x3'));var rp=require(_0xf20e('0x4'));var moment=require(_0xf20e('0x5'));var BPromise=require(_0xf20e('0x6'));var Mustache=require(_0xf20e('0x7'));var util=require(_0xf20e('0x8'));var path=require(_0xf20e('0x9'));var sox=require(_0xf20e('0xa'));var csv=require(_0xf20e('0xb'));var ejs=require(_0xf20e('0xc'));var fs=require('fs');var fs_extra=require(_0xf20e('0xd'));var _=require(_0xf20e('0xe'));var squel=require(_0xf20e('0xf'));var crypto=require('crypto');var jsforce=require(_0xf20e('0x10'));var deskjs=require(_0xf20e('0x11'));var toCsv=require(_0xf20e('0xb'));var querystring=require(_0xf20e('0x12'));var Papa=require(_0xf20e('0x13'));var Redis=require(_0xf20e('0x14'));var authService=require(_0xf20e('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf20e('0x16'));var hardwareService=require(_0xf20e('0x17'));var logger=require('../../config/logger')(_0xf20e('0x18'));var utils=require(_0xf20e('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf20e('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf20e('0x1b'));var client=jayson[_0xf20e('0x1c')][_0xf20e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x19d8a5,_0x493e60,_0xf761ec,_0xb510d4){return new BPromise(function(_0x4facb2,_0x13c407){var _0xe89778=_0xb510d4||client;return _0xe89778[_0xf20e('0x1e')](_0x19d8a5,_0xf761ec)[_0xf20e('0x1f')](function(_0x780268){logger[_0xf20e('0x20')](_0xf20e('0x21'),_0x493e60,_0xf20e('0x22'));logger[_0xf20e('0x23')](_0xf20e('0x24'),_0x493e60,_0xf20e('0x22'),JSON[_0xf20e('0x25')](_0x780268));if(_0x780268['error']){if(_0x780268['error'][_0xf20e('0x26')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x493e60,_0x780268[_0xf20e('0x27')][_0xf20e('0x28')]);return _0x13c407(_0x780268[_0xf20e('0x27')][_0xf20e('0x28')]);}logger[_0xf20e('0x27')](_0xf20e('0x21'),_0x493e60,_0x780268['error'][_0xf20e('0x28')]);return _0x4facb2(_0x780268[_0xf20e('0x27')]['message']);}else{logger[_0xf20e('0x20')](_0xf20e('0x21'),_0x493e60,_0xf20e('0x22'));_0x4facb2(_0x780268[_0xf20e('0x29')][_0xf20e('0x28')]);}})['catch'](function(_0x332ba2){logger[_0xf20e('0x27')]('Setting,\x20%s,\x20%s',_0x493e60,_0x332ba2);_0x13c407(_0x332ba2);});});}function respondWithStatusCode(_0x2cc57d,_0x35d484){_0x35d484=_0x35d484||0xcc;return function(_0xe73b3e){if(_0xe73b3e){return _0x2cc57d[_0xf20e('0x2a')](_0x35d484);}return _0x2cc57d['status'](_0x35d484)['end']();};}function respondWithResult(_0x21535d,_0x50825f){_0x50825f=_0x50825f||0xc8;return function(_0x44e683){if(_0x44e683){return _0x21535d[_0xf20e('0x2b')](_0x50825f)['json'](_0x44e683);}};}function respondWithFilteredResult(_0x1b4df5,_0x2c9127){return function(_0x37226a){if(_0x37226a){var _0x23280a=typeof _0x2c9127[_0xf20e('0x2c')]===_0xf20e('0x2d')&&typeof _0x2c9127['limit']==='undefined';var _0x7a06d2=_0x37226a[_0xf20e('0x2e')];var _0x22cc11=_0x23280a?0x0:_0x2c9127[_0xf20e('0x2c')];var _0x589a11=_0x23280a?_0x37226a['count']:_0x2c9127[_0xf20e('0x2c')]+_0x2c9127[_0xf20e('0x2f')];var _0x392823;if(_0x589a11>=_0x7a06d2){_0x589a11=_0x7a06d2;_0x392823=0xc8;}else{_0x392823=0xce;}_0x1b4df5['status'](_0x392823);return _0x1b4df5[_0xf20e('0x30')]('Content-Range',_0x22cc11+'-'+_0x589a11+'/'+_0x7a06d2)['json'](_0x37226a);}return null;};}function patchUpdates(_0x42599a){return function(_0x4d96cb){try{jsonpatch[_0xf20e('0x31')](_0x4d96cb,_0x42599a,!![]);}catch(_0x3208e6){return BPromise['reject'](_0x3208e6);}return _0x4d96cb[_0xf20e('0x32')]();};}function saveUpdates(_0x2dd42d,_0xfb876e){return function(_0x25cb08){if(_0x25cb08){return _0x25cb08[_0xf20e('0x33')](_0x2dd42d)[_0xf20e('0x1f')](function(_0x2f1c3d){return _0x2f1c3d;});}return null;};}function removeEntity(_0x4efb96,_0x223d66){return function(_0x2ca591){if(_0x2ca591){return _0x2ca591[_0xf20e('0x34')]()[_0xf20e('0x1f')](function(){_0x4efb96[_0xf20e('0x2b')](0xcc)[_0xf20e('0x35')]();});}};}function handleEntityNotFound(_0x97fb43,_0xc4536){return function(_0x338cdc){if(!_0x338cdc){_0x97fb43[_0xf20e('0x2a')](0x194);}return _0x338cdc;};}function handleError(_0x23f199,_0x1e0b34){_0x1e0b34=_0x1e0b34||0x1f4;return function(_0x23eaf1){logger[_0xf20e('0x27')](_0x23eaf1['stack']);if(_0x23eaf1[_0xf20e('0x36')]){delete _0x23eaf1[_0xf20e('0x36')];}_0x23f199[_0xf20e('0x2b')](_0x1e0b34)[_0xf20e('0x37')](_0x23eaf1);};}exports['index']=function(_0x39c233,_0x50d428){var _0x51a668={},_0x385318={},_0x3f25ec={'count':0x0,'rows':[]};var _0x3725d9=_[_0xf20e('0x38')](db[_0xf20e('0x39')]['rawAttributes'],function(_0xf641cd){return{'name':_0xf641cd[_0xf20e('0x3a')],'type':_0xf641cd[_0xf20e('0x3b')][_0xf20e('0x3c')]};});_0x385318[_0xf20e('0x3d')]=_[_0xf20e('0x38')](_0x3725d9,'name');_0x385318[_0xf20e('0x3e')]=_[_0xf20e('0x3f')](_0x39c233['query']);_0x385318[_0xf20e('0x40')]=_[_0xf20e('0x41')](_0x385318['model'],_0x385318['query']);_0x51a668[_0xf20e('0x42')]=_[_0xf20e('0x41')](_0x385318[_0xf20e('0x3d')],qs[_0xf20e('0x43')](_0x39c233[_0xf20e('0x3e')][_0xf20e('0x43')]));_0x51a668['attributes']=_0x51a668[_0xf20e('0x42')][_0xf20e('0x44')]?_0x51a668[_0xf20e('0x42')]:_0x385318[_0xf20e('0x3d')];if(!_0x39c233[_0xf20e('0x3e')][_0xf20e('0x45')](_0xf20e('0x46'))){_0x51a668['limit']=qs[_0xf20e('0x2f')](_0x39c233[_0xf20e('0x3e')][_0xf20e('0x2f')]);_0x51a668['offset']=qs[_0xf20e('0x2c')](_0x39c233[_0xf20e('0x3e')][_0xf20e('0x2c')]);}_0x51a668['order']=qs[_0xf20e('0x47')](_0x39c233[_0xf20e('0x3e')][_0xf20e('0x47')]);_0x51a668[_0xf20e('0x48')]=qs[_0xf20e('0x40')](_['pick'](_0x39c233[_0xf20e('0x3e')],_0x385318['filters']),_0x3725d9);if(_0x39c233['query'][_0xf20e('0x49')]){_0x51a668['where']=_['merge'](_0x51a668[_0xf20e('0x48')],{'$or':_[_0xf20e('0x38')](_0x3725d9,function(_0xea997f){if(_0xea997f[_0xf20e('0x3b')]!==_0xf20e('0x4a')){var _0x1d483d={};_0x1d483d[_0xea997f[_0xf20e('0x36')]]={'$like':'%'+_0x39c233['query']['filter']+'%'};return _0x1d483d;}})});}_0x51a668=_[_0xf20e('0x4b')]({},_0x51a668,_0x39c233[_0xf20e('0x4c')]);var _0x303199={'where':_0x51a668[_0xf20e('0x48')]};return db[_0xf20e('0x39')][_0xf20e('0x2e')](_0x303199)['then'](function(_0x4b650f){_0x3f25ec[_0xf20e('0x2e')]=_0x4b650f;if(_0x39c233[_0xf20e('0x3e')][_0xf20e('0x4d')]){_0x51a668[_0xf20e('0x4e')]=[{'all':!![]}];}return db[_0xf20e('0x39')][_0xf20e('0x4f')](_0x51a668);})[_0xf20e('0x1f')](function(_0x53b084){_0x3f25ec[_0xf20e('0x50')]=_0x53b084;return _0x3f25ec;})['then'](respondWithFilteredResult(_0x50d428,_0x51a668))[_0xf20e('0x51')](handleError(_0x50d428,null));};exports[_0xf20e('0x52')]=function(_0x273e72,_0x4e6f6c){var _0x3348bc={'raw':![],'where':{'id':_0x273e72[_0xf20e('0x53')]['id']}},_0x53cf2a={};_0x53cf2a['model']=_[_0xf20e('0x3f')](db[_0xf20e('0x39')][_0xf20e('0x54')]);_0x53cf2a['query']=_[_0xf20e('0x3f')](_0x273e72['query']);_0x53cf2a[_0xf20e('0x40')]=_[_0xf20e('0x41')](_0x53cf2a[_0xf20e('0x3d')],_0x53cf2a['query']);_0x3348bc['attributes']=_[_0xf20e('0x41')](_0x53cf2a['model'],qs[_0xf20e('0x43')](_0x273e72['query']['fields']));_0x3348bc[_0xf20e('0x42')]=_0x3348bc[_0xf20e('0x42')]['length']?_0x3348bc[_0xf20e('0x42')]:_0x53cf2a[_0xf20e('0x3d')];if(_0x273e72[_0xf20e('0x3e')]['includeAll']){_0x3348bc['include']=[{'all':!![]}];}_0x3348bc=_[_0xf20e('0x4b')]({},_0x3348bc,_0x273e72['options']);return db[_0xf20e('0x39')][_0xf20e('0x55')](_0x3348bc)[_0xf20e('0x1f')](handleEntityNotFound(_0x4e6f6c,null))[_0xf20e('0x1f')](respondWithResult(_0x4e6f6c,null))['catch'](handleError(_0x4e6f6c,null));};exports[_0xf20e('0x33')]=function(_0x1d0153,_0xce3625){if(_0x1d0153['body']['id']){delete _0x1d0153[_0xf20e('0x56')]['id'];}return db['Setting'][_0xf20e('0x55')]({'where':{'id':_0x1d0153[_0xf20e('0x53')]['id']}})['then'](handleEntityNotFound(_0xce3625,null))[_0xf20e('0x1f')](saveUpdates(_0x1d0153[_0xf20e('0x56')],null))[_0xf20e('0x1f')](respondWithResult(_0xce3625,null))[_0xf20e('0x51')](handleError(_0xce3625,null));};exports[_0xf20e('0x57')]=function(_0x57f18a,_0x1be20e,_0x2ed202){if(_0x57f18a[_0xf20e('0x58')]&&_0x57f18a[_0xf20e('0x58')]['filename']){_0x57f18a[_0xf20e('0x56')][_0xf20e('0x59')]=_0x57f18a[_0xf20e('0x58')][_0xf20e('0x5a')];}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x57f18a[_0xf20e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1be20e,null))['then'](saveUpdates(_0x57f18a[_0xf20e('0x56')],null))['then'](respondWithResult(_0x1be20e,null))[_0xf20e('0x51')](handleError(_0x1be20e,null));};exports[_0xf20e('0x5b')]=function(_0x2bf911,_0x11f0b4,_0x20b778){if(_0x2bf911['file']&&_0x2bf911[_0xf20e('0x58')][_0xf20e('0x5a')]){_0x2bf911['body']['loginLogo']=_0x2bf911[_0xf20e('0x58')][_0xf20e('0x5a')];}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x2bf911[_0xf20e('0x53')]['id']}})[_0xf20e('0x1f')](handleEntityNotFound(_0x11f0b4,null))[_0xf20e('0x1f')](saveUpdates(_0x2bf911['body'],null))['then'](respondWithResult(_0x11f0b4,null))[_0xf20e('0x51')](handleError(_0x11f0b4,null));};var utilLicense=require(_0xf20e('0x1a'));exports[_0xf20e('0x5c')]=function(_0x2cd25a,_0x4974a6,_0x4d7b2d){var _0x258345=_0xf20e('0x5d');var _0x26cbe0={'custom':![]};return utilLicense[_0xf20e('0x5e')]()[_0xf20e('0x1f')](function(_0x25a30b){if(_0x25a30b){_0x26cbe0=_0x25a30b;}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x2cd25a['params']['id']},'attributes':[_0xf20e('0x59'),_0xf20e('0x5f'),_0xf20e('0x60'),_0xf20e('0x61'),_0xf20e('0x62'),'defaultLoginLogo',_0xf20e('0x63'),_0xf20e('0x64')],'raw':!![]});})[_0xf20e('0x1f')](handleEntityNotFound(_0x4974a6,null))[_0xf20e('0x1f')](function(_0x4371bd){if(_0x4371bd){var _0x11825b=_0x4371bd[_0xf20e('0x59')]&&fs['existsSync'](path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x258345,_[_0xf20e('0x67')](_0x4371bd['logo'])))?path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x258345,_['toLower'](_0x4371bd['logo'])):path[_0xf20e('0x65')](config['root'],_0x258345,_[_0xf20e('0x67')](_0xf20e('0x68')));var _0x4e4d40='default'+_[_0xf20e('0x69')](_0xf20e('0x59'));if(_0x4371bd[_0x4e4d40]||!_0x26cbe0[_0xf20e('0x6a')]){_0x11825b=path['join'](config['root'],_0x258345,_['toLower'](_0xf20e('0x68')));}if(!fs[_0xf20e('0x6b')](_0x11825b)){throw new db[(_0xf20e('0x6c'))][(_0xf20e('0x6d'))](_[_0xf20e('0x69')](_0xf20e('0x59'))+_0xf20e('0x6e'));}return _0x4974a6['download'](_0x11825b);}})[_0xf20e('0x51')](handleError(_0x4974a6,null));};var utilLicense=require(_0xf20e('0x1a'));exports[_0xf20e('0x6f')]=function(_0x463fdd,_0x39ddaf,_0x5710c2){var _0x494cfa=_0xf20e('0x5d');var _0x1cc5dc={'custom':![]};return utilLicense[_0xf20e('0x5e')]()['then'](function(_0x30fd14){if(_0x30fd14){_0x1cc5dc=_0x30fd14;}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x463fdd[_0xf20e('0x53')]['id']},'attributes':[_0xf20e('0x59'),_0xf20e('0x5f'),'preferred',_0xf20e('0x61'),_0xf20e('0x62'),_0xf20e('0x70'),_0xf20e('0x63'),_0xf20e('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x39ddaf,null))[_0xf20e('0x1f')](function(_0x4c81ef){if(_0x4c81ef){var _0x5d3076=_0x4c81ef[_0xf20e('0x5f')]&&fs[_0xf20e('0x6b')](path['join'](config[_0xf20e('0x66')],_0x494cfa,_[_0xf20e('0x67')](_0x4c81ef[_0xf20e('0x5f')])))?path[_0xf20e('0x65')](config['root'],_0x494cfa,_['toLower'](_0x4c81ef['loginLogo'])):path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x494cfa,_[_0xf20e('0x67')](_0xf20e('0x71')));var _0x5d6c01=_0xf20e('0x72')+_[_0xf20e('0x69')]('loginLogo');if(_0x4c81ef[_0x5d6c01]||!_0x1cc5dc[_0xf20e('0x6a')]){_0x5d3076=path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x494cfa,_[_0xf20e('0x67')](_0xf20e('0x71')));}if(!fs[_0xf20e('0x6b')](_0x5d3076)){throw new db[(_0xf20e('0x6c'))]['ValidationError'](_[_0xf20e('0x69')](_0xf20e('0x5f'))+_0xf20e('0x6e'));}return _0x39ddaf[_0xf20e('0x73')](_0x5d3076);}})[_0xf20e('0x51')](handleError(_0x39ddaf,null));};exports[_0xf20e('0x74')]=function(_0x20f9f8,_0x283a95){return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x20f9f8[_0xf20e('0x53')]['id']},'attributes':[_0xf20e('0x75')]})[_0xf20e('0x1f')](respondWithResult(_0x283a95,null))[_0xf20e('0x51')](handleError(_0x283a95,null));};exports['addPreferred']=function(_0x3832a4,_0x1599f3,_0x6e1260){if(_0x3832a4[_0xf20e('0x58')]&&_0x3832a4[_0xf20e('0x58')][_0xf20e('0x5a')]){_0x3832a4['body'][_0xf20e('0x60')]=_0x3832a4[_0xf20e('0x58')]['filename'];}return db[_0xf20e('0x39')]['find']({'where':{'id':_0x3832a4[_0xf20e('0x53')]['id']}})[_0xf20e('0x1f')](handleEntityNotFound(_0x1599f3,null))[_0xf20e('0x1f')](saveUpdates(_0x3832a4[_0xf20e('0x56')],null))['then'](respondWithResult(_0x1599f3,null))['catch'](handleError(_0x1599f3,null));};var utilLicense=require(_0xf20e('0x1a'));exports[_0xf20e('0x76')]=function(_0x38a351,_0x273d9b,_0x599749){var _0x7f98eb='server/files/images/logos';var _0x55da2e={'custom':![]};return utilLicense[_0xf20e('0x5e')]()[_0xf20e('0x1f')](function(_0x13884f){if(_0x13884f){_0x55da2e=_0x13884f;}return db[_0xf20e('0x39')]['find']({'where':{'id':_0x38a351['params']['id']},'attributes':[_0xf20e('0x59'),_0xf20e('0x5f'),'preferred',_0xf20e('0x61'),_0xf20e('0x62'),_0xf20e('0x70'),_0xf20e('0x63'),'defaultFavicon'],'raw':!![]});})[_0xf20e('0x1f')](handleEntityNotFound(_0x273d9b,null))[_0xf20e('0x1f')](function(_0x27b4d2){if(_0x27b4d2){var _0x41c163=_0x27b4d2[_0xf20e('0x60')]&&fs['existsSync'](path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x7f98eb,_[_0xf20e('0x67')](_0x27b4d2[_0xf20e('0x60')])))?path[_0xf20e('0x65')](config['root'],_0x7f98eb,_[_0xf20e('0x67')](_0x27b4d2[_0xf20e('0x60')])):path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x7f98eb,_['toLower'](_0xf20e('0x77')));var _0x26faee=_0xf20e('0x72')+_[_0xf20e('0x69')]('preferred');if(_0x27b4d2[_0x26faee]||!_0x55da2e[_0xf20e('0x6a')]||!_0x55da2e['preferred']){_0x41c163=path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x7f98eb,_[_0xf20e('0x67')](_0xf20e('0x77')));}if(!fs[_0xf20e('0x6b')](_0x41c163)){throw new db[(_0xf20e('0x6c'))][(_0xf20e('0x6d'))](_['upperFirst'](_0xf20e('0x60'))+_0xf20e('0x6e'));}return _0x273d9b['download'](_0x41c163);}})['catch'](handleError(_0x273d9b,null));};exports[_0xf20e('0x78')]=function(_0x4c6865,_0x4eb8dc,_0x1c89f3){if(_0x4c6865['file']&&_0x4c6865[_0xf20e('0x58')][_0xf20e('0x5a')]){_0x4c6865[_0xf20e('0x56')][_0xf20e('0x61')]=_0x4c6865['file']['filename'];}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x4c6865[_0xf20e('0x53')]['id']}})[_0xf20e('0x1f')](handleEntityNotFound(_0x4eb8dc,null))['then'](saveUpdates(_0x4c6865[_0xf20e('0x56')],null))[_0xf20e('0x1f')](respondWithResult(_0x4eb8dc,null))[_0xf20e('0x51')](handleError(_0x4eb8dc,null));};var utilLicense=require('../../config/license/util');exports[_0xf20e('0x79')]=function(_0x3ef6b7,_0x355e53,_0x3b28d5){var _0x8a1a=_0xf20e('0x5d');var _0x14103f={'custom':![]};return utilLicense[_0xf20e('0x5e')]()['then'](function(_0x18fb36){if(_0x18fb36){_0x14103f=_0x18fb36;}return db[_0xf20e('0x39')][_0xf20e('0x55')]({'where':{'id':_0x3ef6b7['params']['id']},'attributes':['logo','loginLogo',_0xf20e('0x60'),_0xf20e('0x61'),_0xf20e('0x62'),_0xf20e('0x70'),_0xf20e('0x63'),_0xf20e('0x64')],'raw':!![]});})[_0xf20e('0x1f')](handleEntityNotFound(_0x355e53,null))[_0xf20e('0x1f')](function(_0x5a4419){if(_0x5a4419){var _0x2305b4=_0x5a4419[_0xf20e('0x61')]&&fs[_0xf20e('0x6b')](path['join'](config[_0xf20e('0x66')],_0x8a1a,_[_0xf20e('0x67')](_0x5a4419[_0xf20e('0x61')])))?path[_0xf20e('0x65')](config['root'],_0x8a1a,_[_0xf20e('0x67')](_0x5a4419[_0xf20e('0x61')])):path[_0xf20e('0x65')](config[_0xf20e('0x66')],_0x8a1a,_[_0xf20e('0x67')]('default_favicon.ico'));var _0x332f6d=_0xf20e('0x72')+_[_0xf20e('0x69')](_0xf20e('0x61'));if(_0x5a4419[_0x332f6d]||!_0x14103f[_0xf20e('0x6a')]){_0x2305b4=path[_0xf20e('0x65')](config['root'],_0x8a1a,_[_0xf20e('0x67')](_0xf20e('0x7a')));}if(!fs[_0xf20e('0x6b')](_0x2305b4)){throw new db[(_0xf20e('0x6c'))][(_0xf20e('0x6d'))](_['upperFirst'](_0xf20e('0x61'))+'\x20not\x20found');}return _0x355e53[_0xf20e('0x73')](_0x2305b4);}})['catch'](handleError(_0x355e53,null));};exports[_0xf20e('0x7b')]=function(_0x4afaaf,_0x5d0584){var _0x45924d={'offset':moment()[_0xf20e('0x7c')]()};_0x45924d[_0xf20e('0x7d')]=moment()[_0xf20e('0x7c')](_0x45924d[_0xf20e('0x2c')])['format'](_0xf20e('0x7e'));return _0x5d0584[_0xf20e('0x2b')](0xc8)[_0xf20e('0x37')](_0x45924d);}; \ No newline at end of file +var _0xd5ec=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','keys','includeAll','find','update','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','default','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','sendStatus','stack','name','send','index','map','Setting','rawAttributes'];(function(_0x4d9fdb,_0x4fbf99){var _0x49d254=function(_0x224011){while(--_0x224011){_0x4d9fdb['push'](_0x4d9fdb['shift']());}};_0x49d254(++_0x4fbf99);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xd5ec[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0xcd5e('0x0'));var rimraf=require(_0xcd5e('0x1'));var zipdir=require(_0xcd5e('0x2'));var jsonpatch=require(_0xcd5e('0x3'));var rp=require('request-promise');var moment=require(_0xcd5e('0x4'));var BPromise=require(_0xcd5e('0x5'));var Mustache=require(_0xcd5e('0x6'));var util=require(_0xcd5e('0x7'));var path=require(_0xcd5e('0x8'));var sox=require(_0xcd5e('0x9'));var csv=require(_0xcd5e('0xa'));var ejs=require(_0xcd5e('0xb'));var fs=require('fs');var fs_extra=require(_0xcd5e('0xc'));var _=require(_0xcd5e('0xd'));var squel=require(_0xcd5e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5e('0xf'));var toCsv=require(_0xcd5e('0xa'));var querystring=require(_0xcd5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xcd5e('0x11'));var authService=require(_0xcd5e('0x12'));var qs=require(_0xcd5e('0x13'));var as=require(_0xcd5e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5e('0x15'))('api');var utils=require(_0xcd5e('0x16'));var config=require(_0xcd5e('0x17'));var licenseUtil=require(_0xcd5e('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcd5e('0x19'));var client=jayson[_0xcd5e('0x1a')][_0xcd5e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x576716,_0x44a8b8,_0x1a933d,_0x25f0b8){return new BPromise(function(_0x32f947,_0x4203a9){var _0x38b33c=_0x25f0b8||client;return _0x38b33c['request'](_0x576716,_0x1a933d)[_0xcd5e('0x1c')](function(_0x40a6de){logger[_0xcd5e('0x1d')]('Setting,\x20%s,\x20%s',_0x44a8b8,'request\x20sent');logger[_0xcd5e('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x44a8b8,_0xcd5e('0x1f'),JSON[_0xcd5e('0x20')](_0x40a6de));if(_0x40a6de[_0xcd5e('0x21')]){if(_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x22')]===0x1f4){logger[_0xcd5e('0x21')](_0xcd5e('0x23'),_0x44a8b8,_0x40a6de[_0xcd5e('0x21')]['message']);return _0x4203a9(_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x24')]);}logger['error'](_0xcd5e('0x23'),_0x44a8b8,_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x24')]);return _0x32f947(_0x40a6de[_0xcd5e('0x21')]['message']);}else{logger[_0xcd5e('0x1d')](_0xcd5e('0x23'),_0x44a8b8,_0xcd5e('0x1f'));_0x32f947(_0x40a6de['result']['message']);}})[_0xcd5e('0x25')](function(_0xa5ce29){logger[_0xcd5e('0x21')](_0xcd5e('0x23'),_0x44a8b8,_0xa5ce29);_0x4203a9(_0xa5ce29);});});}function respondWithStatusCode(_0x88e21d,_0x3f2f15){_0x3f2f15=_0x3f2f15||0xcc;return function(_0x109209){if(_0x109209){return _0x88e21d['sendStatus'](_0x3f2f15);}return _0x88e21d[_0xcd5e('0x26')](_0x3f2f15)[_0xcd5e('0x27')]();};}function respondWithResult(_0x28cc4f,_0x1b5a89){_0x1b5a89=_0x1b5a89||0xc8;return function(_0x57e339){if(_0x57e339){return _0x28cc4f[_0xcd5e('0x26')](_0x1b5a89)[_0xcd5e('0x28')](_0x57e339);}};}function respondWithFilteredResult(_0x2371b8,_0x4d4125){return function(_0x8930c7){if(_0x8930c7){var _0x335758=typeof _0x4d4125[_0xcd5e('0x29')]===_0xcd5e('0x2a')&&typeof _0x4d4125[_0xcd5e('0x2b')]===_0xcd5e('0x2a');var _0x572527=_0x8930c7['count'];var _0x44ac50=_0x335758?0x0:_0x4d4125[_0xcd5e('0x29')];var _0x1d3752=_0x335758?_0x8930c7[_0xcd5e('0x2c')]:_0x4d4125[_0xcd5e('0x29')]+_0x4d4125[_0xcd5e('0x2b')];var _0x1576af;if(_0x1d3752>=_0x572527){_0x1d3752=_0x572527;_0x1576af=0xc8;}else{_0x1576af=0xce;}_0x2371b8[_0xcd5e('0x26')](_0x1576af);return _0x2371b8[_0xcd5e('0x2d')]('Content-Range',_0x44ac50+'-'+_0x1d3752+'/'+_0x572527)['json'](_0x8930c7);}return null;};}function patchUpdates(_0x495d42){return function(_0x1f03d3){try{jsonpatch[_0xcd5e('0x2e')](_0x1f03d3,_0x495d42,!![]);}catch(_0x5ec598){return BPromise[_0xcd5e('0x2f')](_0x5ec598);}return _0x1f03d3['save']();};}function saveUpdates(_0x366fc8,_0x1cacc5){return function(_0x7cee7d){if(_0x7cee7d){return _0x7cee7d['update'](_0x366fc8)[_0xcd5e('0x1c')](function(_0x3c2d2b){return _0x3c2d2b;});}return null;};}function removeEntity(_0x2f9c40,_0x2d8d90){return function(_0x3ecda5){if(_0x3ecda5){return _0x3ecda5['destroy']()[_0xcd5e('0x1c')](function(){_0x2f9c40[_0xcd5e('0x26')](0xcc)[_0xcd5e('0x27')]();});}};}function handleEntityNotFound(_0x3b51be,_0x19f81c){return function(_0x541be1){if(!_0x541be1){_0x3b51be[_0xcd5e('0x30')](0x194);}return _0x541be1;};}function handleError(_0x46ae80,_0x4e84d1){_0x4e84d1=_0x4e84d1||0x1f4;return function(_0x3af373){logger[_0xcd5e('0x21')](_0x3af373[_0xcd5e('0x31')]);if(_0x3af373[_0xcd5e('0x32')]){delete _0x3af373[_0xcd5e('0x32')];}_0x46ae80[_0xcd5e('0x26')](_0x4e84d1)[_0xcd5e('0x33')](_0x3af373);};}exports[_0xcd5e('0x34')]=function(_0x1af318,_0x498c0b){var _0x22c8d0={},_0x1edab8={},_0xdf5e2a={'count':0x0,'rows':[]};var _0x39b7f6=_[_0xcd5e('0x35')](db[_0xcd5e('0x36')][_0xcd5e('0x37')],function(_0x2e59e3){return{'name':_0x2e59e3[_0xcd5e('0x38')],'type':_0x2e59e3[_0xcd5e('0x39')][_0xcd5e('0x3a')]};});_0x1edab8[_0xcd5e('0x3b')]=_[_0xcd5e('0x35')](_0x39b7f6,_0xcd5e('0x32'));_0x1edab8[_0xcd5e('0x3c')]=_['keys'](_0x1af318[_0xcd5e('0x3c')]);_0x1edab8[_0xcd5e('0x3d')]=_[_0xcd5e('0x3e')](_0x1edab8[_0xcd5e('0x3b')],_0x1edab8[_0xcd5e('0x3c')]);_0x22c8d0[_0xcd5e('0x3f')]=_[_0xcd5e('0x3e')](_0x1edab8[_0xcd5e('0x3b')],qs[_0xcd5e('0x40')](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x40')]));_0x22c8d0[_0xcd5e('0x3f')]=_0x22c8d0[_0xcd5e('0x3f')][_0xcd5e('0x41')]?_0x22c8d0[_0xcd5e('0x3f')]:_0x1edab8['model'];if(!_0x1af318['query'][_0xcd5e('0x42')](_0xcd5e('0x43'))){_0x22c8d0['limit']=qs[_0xcd5e('0x2b')](_0x1af318[_0xcd5e('0x3c')]['limit']);_0x22c8d0['offset']=qs[_0xcd5e('0x29')](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x29')]);}_0x22c8d0[_0xcd5e('0x44')]=qs['sort'](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x45')]);_0x22c8d0[_0xcd5e('0x46')]=qs[_0xcd5e('0x3d')](_[_0xcd5e('0x47')](_0x1af318[_0xcd5e('0x3c')],_0x1edab8['filters']),_0x39b7f6);if(_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x48')]){_0x22c8d0[_0xcd5e('0x46')]=_[_0xcd5e('0x49')](_0x22c8d0[_0xcd5e('0x46')],{'$or':_['map'](_0x39b7f6,function(_0x190891){if(_0x190891[_0xcd5e('0x39')]!=='VIRTUAL'){var _0x2c7f60={};_0x2c7f60[_0x190891[_0xcd5e('0x32')]]={'$like':'%'+_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x48')]+'%'};return _0x2c7f60;}})});}_0x22c8d0=_[_0xcd5e('0x49')]({},_0x22c8d0,_0x1af318[_0xcd5e('0x4a')]);var _0xca5628={'where':_0x22c8d0['where']};return db['Setting'][_0xcd5e('0x2c')](_0xca5628)[_0xcd5e('0x1c')](function(_0x5bbd0c){_0xdf5e2a[_0xcd5e('0x2c')]=_0x5bbd0c;if(_0x1af318[_0xcd5e('0x3c')]['includeAll']){_0x22c8d0[_0xcd5e('0x4b')]=[{'all':!![]}];}return db[_0xcd5e('0x36')][_0xcd5e('0x4c')](_0x22c8d0);})[_0xcd5e('0x1c')](function(_0x598503){_0xdf5e2a['rows']=_0x598503;return _0xdf5e2a;})[_0xcd5e('0x1c')](respondWithFilteredResult(_0x498c0b,_0x22c8d0))[_0xcd5e('0x25')](handleError(_0x498c0b,null));};exports[_0xcd5e('0x4d')]=function(_0x3b8b45,_0x2c625a){var _0x18f89a={'raw':![],'where':{'id':_0x3b8b45['params']['id']}},_0x1326a2={};_0x1326a2[_0xcd5e('0x3b')]=_[_0xcd5e('0x4e')](db[_0xcd5e('0x36')][_0xcd5e('0x37')]);_0x1326a2[_0xcd5e('0x3c')]=_[_0xcd5e('0x4e')](_0x3b8b45[_0xcd5e('0x3c')]);_0x1326a2['filters']=_[_0xcd5e('0x3e')](_0x1326a2[_0xcd5e('0x3b')],_0x1326a2[_0xcd5e('0x3c')]);_0x18f89a['attributes']=_[_0xcd5e('0x3e')](_0x1326a2[_0xcd5e('0x3b')],qs[_0xcd5e('0x40')](_0x3b8b45[_0xcd5e('0x3c')][_0xcd5e('0x40')]));_0x18f89a[_0xcd5e('0x3f')]=_0x18f89a[_0xcd5e('0x3f')][_0xcd5e('0x41')]?_0x18f89a[_0xcd5e('0x3f')]:_0x1326a2[_0xcd5e('0x3b')];if(_0x3b8b45['query'][_0xcd5e('0x4f')]){_0x18f89a[_0xcd5e('0x4b')]=[{'all':!![]}];}_0x18f89a=_['merge']({},_0x18f89a,_0x3b8b45['options']);return db['Setting'][_0xcd5e('0x50')](_0x18f89a)[_0xcd5e('0x1c')](handleEntityNotFound(_0x2c625a,null))['then'](respondWithResult(_0x2c625a,null))[_0xcd5e('0x25')](handleError(_0x2c625a,null));};exports[_0xcd5e('0x51')]=function(_0x4cac4f,_0x4a3ab0){if(_0x4cac4f[_0xcd5e('0x52')]['id']){delete _0x4cac4f['body']['id'];}return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x4cac4f[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x4a3ab0,null))[_0xcd5e('0x1c')](saveUpdates(_0x4cac4f['body'],null))[_0xcd5e('0x1c')](respondWithResult(_0x4a3ab0,null))['catch'](handleError(_0x4a3ab0,null));};exports[_0xcd5e('0x54')]=function(_0x54babc,_0x6b946d,_0x3dd5c7){if(_0x54babc[_0xcd5e('0x55')]&&_0x54babc['file'][_0xcd5e('0x56')]){_0x54babc[_0xcd5e('0x52')][_0xcd5e('0x57')]=_0x54babc[_0xcd5e('0x55')][_0xcd5e('0x56')];}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x54babc[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x6b946d,null))[_0xcd5e('0x1c')](saveUpdates(_0x54babc[_0xcd5e('0x52')],null))[_0xcd5e('0x1c')](respondWithResult(_0x6b946d,null))[_0xcd5e('0x25')](handleError(_0x6b946d,null));};exports[_0xcd5e('0x58')]=function(_0x455609,_0x39cc5d,_0x46ebe4){if(_0x455609[_0xcd5e('0x55')]&&_0x455609['file'][_0xcd5e('0x56')]){_0x455609['body'][_0xcd5e('0x59')]=_0x455609[_0xcd5e('0x55')][_0xcd5e('0x56')];}return db['Setting']['find']({'where':{'id':_0x455609[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x39cc5d,null))[_0xcd5e('0x1c')](saveUpdates(_0x455609[_0xcd5e('0x52')],null))['then'](respondWithResult(_0x39cc5d,null))['catch'](handleError(_0x39cc5d,null));};var utilLicense=require(_0xcd5e('0x18'));exports[_0xcd5e('0x5a')]=function(_0x30e56e,_0x42e97a,_0x4f9737){var _0x4afece='server/files/images/logos';var _0xa423b5={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()['then'](function(_0x53fbd3){if(_0x53fbd3){_0xa423b5=_0x53fbd3;}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x30e56e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),_0xcd5e('0x59'),'preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),_0xcd5e('0x5e'),'defaultPreferred',_0xcd5e('0x5f')],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x42e97a,null))[_0xcd5e('0x1c')](function(_0x34e01e){if(_0x34e01e){var _0x52d756=_0x34e01e[_0xcd5e('0x57')]&&fs['existsSync'](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')](_0x34e01e[_0xcd5e('0x57')])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_['toLower'](_0x34e01e[_0xcd5e('0x57')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')](_0xcd5e('0x63')));var _0x523d38='default'+_[_0xcd5e('0x64')](_0xcd5e('0x57'));if(_0x34e01e[_0x523d38]||!_0xa423b5[_0xcd5e('0x65')]){_0x52d756=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')]('default_logo.svg'));}if(!fs[_0xcd5e('0x66')](_0x52d756)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_[_0xcd5e('0x64')]('logo')+_0xcd5e('0x69'));}return _0x42e97a[_0xcd5e('0x6a')](_0x52d756);}})[_0xcd5e('0x25')](handleError(_0x42e97a,null));};var utilLicense=require('../../config/license/util');exports[_0xcd5e('0x6b')]=function(_0x1396ba,_0x7695d0,_0x4d03f6){var _0x1fe9b3='server/files/images/logos';var _0x5e08ba={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()[_0xcd5e('0x1c')](function(_0x32cbc3){if(_0x32cbc3){_0x5e08ba=_0x32cbc3;}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x1396ba[_0xcd5e('0x53')]['id']},'attributes':['logo',_0xcd5e('0x59'),'preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),'defaultLoginLogo',_0xcd5e('0x6c'),_0xcd5e('0x5f')],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x7695d0,null))[_0xcd5e('0x1c')](function(_0x50a1fb){if(_0x50a1fb){var _0x1eed62=_0x50a1fb[_0xcd5e('0x59')]&&fs[_0xcd5e('0x66')](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0x50a1fb['loginLogo'])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0x50a1fb[_0xcd5e('0x59')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0xcd5e('0x6d')));var _0x9825aa=_0xcd5e('0x6e')+_[_0xcd5e('0x64')](_0xcd5e('0x59'));if(_0x50a1fb[_0x9825aa]||!_0x5e08ba['custom']){_0x1eed62=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_['toLower'](_0xcd5e('0x6d')));}if(!fs[_0xcd5e('0x66')](_0x1eed62)){throw new db[(_0xcd5e('0x67'))]['ValidationError'](_[_0xcd5e('0x64')](_0xcd5e('0x59'))+_0xcd5e('0x69'));}return _0x7695d0[_0xcd5e('0x6a')](_0x1eed62);}})[_0xcd5e('0x25')](handleError(_0x7695d0,null));};exports['gdpr']=function(_0x477f07,_0x528e83){return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x477f07[_0xcd5e('0x53')]['id']},'attributes':['securePassword']})[_0xcd5e('0x1c')](respondWithResult(_0x528e83,null))['catch'](handleError(_0x528e83,null));};exports['addPreferred']=function(_0x46a555,_0x5e5de5,_0x2d3b4d){if(_0x46a555[_0xcd5e('0x55')]&&_0x46a555[_0xcd5e('0x55')]['filename']){_0x46a555[_0xcd5e('0x52')][_0xcd5e('0x6f')]=_0x46a555['file'][_0xcd5e('0x56')];}return db['Setting'][_0xcd5e('0x50')]({'where':{'id':_0x46a555[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x5e5de5,null))[_0xcd5e('0x1c')](saveUpdates(_0x46a555[_0xcd5e('0x52')],null))[_0xcd5e('0x1c')](respondWithResult(_0x5e5de5,null))['catch'](handleError(_0x5e5de5,null));};var utilLicense=require('../../config/license/util');exports[_0xcd5e('0x70')]=function(_0x1c9f3e,_0x278865,_0x2e4c51){var _0x45177f='server/files/images/logos';var _0x1341c0={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()[_0xcd5e('0x1c')](function(_0x2071e4){if(_0x2071e4){_0x1341c0=_0x2071e4;}return db['Setting']['find']({'where':{'id':_0x1c9f3e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),'loginLogo','preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),_0xcd5e('0x5e'),_0xcd5e('0x6c'),'defaultFavicon'],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x278865,null))[_0xcd5e('0x1c')](function(_0x5bda13){if(_0x5bda13){var _0x47f2f2=_0x5bda13[_0xcd5e('0x6f')]&&fs['existsSync'](path[_0xcd5e('0x60')](config['root'],_0x45177f,_[_0xcd5e('0x62')](_0x5bda13['preferred'])))?path[_0xcd5e('0x60')](config['root'],_0x45177f,_[_0xcd5e('0x62')](_0x5bda13[_0xcd5e('0x6f')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x45177f,_['toLower'](_0xcd5e('0x71')));var _0x1b4803=_0xcd5e('0x6e')+_['upperFirst'](_0xcd5e('0x6f'));if(_0x5bda13[_0x1b4803]||!_0x1341c0['custom']||!_0x1341c0[_0xcd5e('0x6f')]){_0x47f2f2=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x45177f,_[_0xcd5e('0x62')]('default_preferred.png'));}if(!fs['existsSync'](_0x47f2f2)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_['upperFirst'](_0xcd5e('0x6f'))+'\x20not\x20found');}return _0x278865[_0xcd5e('0x6a')](_0x47f2f2);}})[_0xcd5e('0x25')](handleError(_0x278865,null));};exports['addFavicon']=function(_0x32b171,_0x44ce88,_0x2b1ea9){if(_0x32b171[_0xcd5e('0x55')]&&_0x32b171[_0xcd5e('0x55')][_0xcd5e('0x56')]){_0x32b171[_0xcd5e('0x52')][_0xcd5e('0x5c')]=_0x32b171[_0xcd5e('0x55')]['filename'];}return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x32b171[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x44ce88,null))[_0xcd5e('0x1c')](saveUpdates(_0x32b171['body'],null))[_0xcd5e('0x1c')](respondWithResult(_0x44ce88,null))[_0xcd5e('0x25')](handleError(_0x44ce88,null));};var utilLicense=require(_0xcd5e('0x18'));exports[_0xcd5e('0x72')]=function(_0x216d9e,_0xdef40d,_0x5aff0e){var _0x164b35='server/files/images/logos';var _0x5a8427={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xe1fbcd){if(_0xe1fbcd){_0x5a8427=_0xe1fbcd;}return db['Setting'][_0xcd5e('0x50')]({'where':{'id':_0x216d9e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),_0xcd5e('0x59'),_0xcd5e('0x6f'),'favicon',_0xcd5e('0x5d'),_0xcd5e('0x5e'),_0xcd5e('0x6c'),_0xcd5e('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0xdef40d,null))['then'](function(_0x25e546){if(_0x25e546){var _0x5b6ef2=_0x25e546[_0xcd5e('0x5c')]&&fs['existsSync'](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x164b35,_[_0xcd5e('0x62')](_0x25e546['favicon'])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x164b35,_[_0xcd5e('0x62')](_0x25e546['favicon'])):path[_0xcd5e('0x60')](config['root'],_0x164b35,_[_0xcd5e('0x62')](_0xcd5e('0x73')));var _0x1cf08c='default'+_[_0xcd5e('0x64')](_0xcd5e('0x5c'));if(_0x25e546[_0x1cf08c]||!_0x5a8427[_0xcd5e('0x65')]){_0x5b6ef2=path[_0xcd5e('0x60')](config['root'],_0x164b35,_[_0xcd5e('0x62')](_0xcd5e('0x73')));}if(!fs[_0xcd5e('0x66')](_0x5b6ef2)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_[_0xcd5e('0x64')](_0xcd5e('0x5c'))+_0xcd5e('0x69'));}return _0xdef40d['download'](_0x5b6ef2);}})[_0xcd5e('0x25')](handleError(_0xdef40d,null));};exports[_0xcd5e('0x74')]=function(_0x1b5073,_0x15b0b4){var _0x2bc18a={'offset':moment()[_0xcd5e('0x75')]()};_0x2bc18a[_0xcd5e('0x76')]=moment()[_0xcd5e('0x75')](_0x2bc18a[_0xcd5e('0x29')])[_0xcd5e('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x15b0b4[_0xcd5e('0x26')](0xc8)[_0xcd5e('0x33')](_0x2bc18a);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4d10719..d83c469 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1bf8e3,_0x53d853){var _0x24d515=function(_0x1c8767){while(--_0x1c8767){_0x1bf8e3['push'](_0x1bf8e3['shift']());}};_0x24d515(++_0x53d853);}(_0xedd9,0xfc));var _0x9edd=function(_0x395f2c,_0x50271c){_0x395f2c=_0x395f2c-0x0;var _0x185525=_0xedd9[_0x395f2c];return _0x185525;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'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 89e7b42..6f59494 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 _0x8c04=['ShowSetting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x2a8f1b,_0x5dcf87){var _0x534bf2=function(_0x3b3005){while(--_0x3b3005){_0x2a8f1b['push'](_0x2a8f1b['shift']());}};_0x534bf2(++_0x5dcf87);}(_0x8c04,0x174));var _0x48c0=function(_0x4e8e31,_0x497e28){_0x4e8e31=_0x4e8e31-0x0;var _0x3a47ac=_0x8c04[_0x4e8e31];return _0x3a47ac;};'use strict';var _=require(_0x48c0('0x0'));var util=require(_0x48c0('0x1'));var moment=require(_0x48c0('0x2'));var BPromise=require(_0x48c0('0x3'));var rs=require(_0x48c0('0x4'));var fs=require('fs');var Redis=require(_0x48c0('0x5'));var db=require(_0x48c0('0x6'))['db'];var utils=require(_0x48c0('0x7'));var logger=require(_0x48c0('0x8'))(_0x48c0('0x9'));var config=require(_0x48c0('0xa'));var jayson=require(_0x48c0('0xb'));var client=jayson[_0x48c0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e4312,_0x8e66ed,_0x45d466){return new BPromise(function(_0x59569e,_0x14ebb0){return client['request'](_0x1e4312,_0x45d466)[_0x48c0('0xd')](function(_0x5c509b){logger['info'](_0x48c0('0xe'),_0x8e66ed,_0x48c0('0xf'));logger[_0x48c0('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x8e66ed,_0x48c0('0xf'),JSON[_0x48c0('0x11')](_0x5c509b));if(_0x5c509b['error']){if(_0x5c509b[_0x48c0('0x12')][_0x48c0('0x13')]===0x1f4){logger[_0x48c0('0x12')](_0x48c0('0xe'),_0x8e66ed,_0x5c509b['error'][_0x48c0('0x14')]);return _0x14ebb0(_0x5c509b[_0x48c0('0x12')][_0x48c0('0x14')]);}logger[_0x48c0('0x12')](_0x48c0('0xe'),_0x8e66ed,_0x5c509b[_0x48c0('0x12')]['message']);return _0x59569e(_0x5c509b[_0x48c0('0x12')][_0x48c0('0x14')]);}else{logger[_0x48c0('0x15')](_0x48c0('0xe'),_0x8e66ed,_0x48c0('0xf'));_0x59569e(_0x5c509b[_0x48c0('0x16')][_0x48c0('0x14')]);}})[_0x48c0('0x17')](function(_0x4d31f9){logger[_0x48c0('0x12')]('Setting,\x20%s,\x20%s',_0x8e66ed,_0x4d31f9);_0x14ebb0(_0x4d31f9);});});}exports[_0x48c0('0x18')]=function(_0x55d335){var _0x226dbe=this;return new Promise(function(_0x570cba,_0x20849b){return db['Setting'][_0x48c0('0x19')]({'raw':_0x55d335[_0x48c0('0x1a')]?_0x55d335[_0x48c0('0x1a')][_0x48c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x55d335['options']?_0x55d335['options'][_0x48c0('0x1c')]||null:null,'attributes':_0x55d335['options']?_0x55d335[_0x48c0('0x1a')][_0x48c0('0x1d')]||null:null,'include':_0x55d335[_0x48c0('0x1a')]?_0x55d335[_0x48c0('0x1a')][_0x48c0('0x1e')]?_[_0x48c0('0x1f')](_0x55d335[_0x48c0('0x1a')][_0x48c0('0x1e')],function(_0x5d942c){return{'model':db[_0x5d942c[_0x48c0('0x20')]],'as':_0x5d942c['as'],'attributes':_0x5d942c['attributes'],'include':_0x5d942c[_0x48c0('0x1e')]?_[_0x48c0('0x1f')](_0x5d942c['include'],function(_0x51ae32){return{'model':db[_0x51ae32[_0x48c0('0x20')]],'as':_0x51ae32['as'],'attributes':_0x51ae32[_0x48c0('0x1d')],'include':_0x51ae32[_0x48c0('0x1e')]?_[_0x48c0('0x1f')](_0x51ae32['include'],function(_0x36d71c){return{'model':db[_0x36d71c[_0x48c0('0x20')]],'as':_0x36d71c['as'],'attributes':_0x36d71c[_0x48c0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14bb77){logger[_0x48c0('0x15')](_0x48c0('0x18'),_0x55d335);logger[_0x48c0('0x10')](_0x48c0('0x18'),_0x55d335,JSON['stringify'](_0x14bb77));_0x570cba(_0x14bb77);})[_0x48c0('0x17')](function(_0x2e6402){logger[_0x48c0('0x12')](_0x48c0('0x18'),_0x2e6402[_0x48c0('0x14')],_0x55d335);_0x20849b(_0x226dbe[_0x48c0('0x12')](0x1f4,_0x2e6402['message']));});});}; \ No newline at end of file +var _0xde31=['ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4d51f4,_0x3be8c1){var _0x7a3ad3=function(_0x3dffbd){while(--_0x3dffbd){_0x4d51f4['push'](_0x4d51f4['shift']());}};_0x7a3ad3(++_0x3be8c1);}(_0xde31,0x155));var _0x1de3=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xde31[_0x22b8a3];return _0x199a0c;};'use strict';var _=require(_0x1de3('0x0'));var util=require(_0x1de3('0x1'));var moment=require(_0x1de3('0x2'));var BPromise=require(_0x1de3('0x3'));var rs=require(_0x1de3('0x4'));var fs=require('fs');var Redis=require(_0x1de3('0x5'));var db=require(_0x1de3('0x6'))['db'];var utils=require(_0x1de3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1de3('0x8'));var jayson=require(_0x1de3('0x9'));var client=jayson[_0x1de3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc51f,_0x5c876f,_0x2275d2){return new BPromise(function(_0xdabac5,_0x52d8a0){return client[_0x1de3('0xb')](_0x3cc51f,_0x2275d2)[_0x1de3('0xc')](function(_0x2dce76){logger[_0x1de3('0xd')](_0x1de3('0xe'),_0x5c876f,_0x1de3('0xf'));logger['debug'](_0x1de3('0x10'),_0x5c876f,_0x1de3('0xf'),JSON['stringify'](_0x2dce76));if(_0x2dce76[_0x1de3('0x11')]){if(_0x2dce76[_0x1de3('0x11')][_0x1de3('0x12')]===0x1f4){logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0x2dce76[_0x1de3('0x11')][_0x1de3('0x13')]);return _0x52d8a0(_0x2dce76[_0x1de3('0x11')]['message']);}logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0x2dce76[_0x1de3('0x11')]['message']);return _0xdabac5(_0x2dce76[_0x1de3('0x11')][_0x1de3('0x13')]);}else{logger[_0x1de3('0xd')](_0x1de3('0xe'),_0x5c876f,_0x1de3('0xf'));_0xdabac5(_0x2dce76[_0x1de3('0x14')][_0x1de3('0x13')]);}})[_0x1de3('0x15')](function(_0xe499ae){logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0xe499ae);_0x52d8a0(_0xe499ae);});});}exports[_0x1de3('0x16')]=function(_0x21def9){var _0xd8b73f=this;return new Promise(function(_0x8e1340,_0x41f532){return db[_0x1de3('0x17')][_0x1de3('0x18')]({'raw':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1b')]||null:null,'attributes':_0x21def9[_0x1de3('0x19')]?_0x21def9['options'][_0x1de3('0x1c')]||null:null,'include':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x21def9[_0x1de3('0x19')][_0x1de3('0x1d')],function(_0x26289f){return{'model':db[_0x26289f['model']],'as':_0x26289f['as'],'attributes':_0x26289f[_0x1de3('0x1c')],'include':_0x26289f[_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x26289f[_0x1de3('0x1d')],function(_0x39f25d){return{'model':db[_0x39f25d['model']],'as':_0x39f25d['as'],'attributes':_0x39f25d[_0x1de3('0x1c')],'include':_0x39f25d[_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x39f25d[_0x1de3('0x1d')],function(_0x548db1){return{'model':db[_0x548db1[_0x1de3('0x1f')]],'as':_0x548db1['as'],'attributes':_0x548db1[_0x1de3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1de3('0xc')](function(_0x52e132){logger[_0x1de3('0xd')]('ShowSetting',_0x21def9);logger['debug']('ShowSetting',_0x21def9,JSON[_0x1de3('0x20')](_0x52e132));_0x8e1340(_0x52e132);})[_0x1de3('0x15')](function(_0x3797f6){logger[_0x1de3('0x11')](_0x1de3('0x16'),_0x3797f6['message'],_0x21def9);_0x41f532(_0xd8b73f[_0x1de3('0x11')](0x1f4,_0x3797f6[_0x1de3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 2441dd6..c6e0ca3 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf494,0x1c6));var _0x4f49=function(_0xcc464a,_0x58cec3){_0xcc464a=_0xcc464a-0x0;var _0x58f48a=_0xf494[_0xcc464a];return _0x58f48a;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x470e3f,_0x3b513d){_0x470e3f=_0x470e3f-0x0;var _0x4fd22b=_0xf494[_0x470e3f];return _0x4fd22b;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 755deb8..2dfc00f 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 _0xb05c=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','plivo','clickatell','bandwidth','csc','TEXT'];(function(_0x3132a9,_0x243da2){var _0x44c409=function(_0x582972){while(--_0x582972){_0x3132a9['push'](_0x3132a9['shift']());}};_0x44c409(++_0x243da2);}(_0xb05c,0x86));var _0xcb05=function(_0x484cb9,_0x103489){_0x484cb9=_0x484cb9-0x0;var _0x59517e=_0xb05c[_0x484cb9];return _0x59517e;};'use strict';var Sequelize=require(_0xcb05('0x0'));var rs=require('randomstring');module[_0xcb05('0x1')]={'name':{'type':Sequelize[_0xcb05('0x2')],'unique':_0xcb05('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xcb05('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xcb05('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcb05('0x4')]();}},'phone':{'type':Sequelize[_0xcb05('0x2')]},'type':{'type':Sequelize[_0xcb05('0x5')](_0xcb05('0x6'),_0xcb05('0x7'),'connectel','clicksend',_0xcb05('0x8'),_0xcb05('0x9'),_0xcb05('0xa'),_0xcb05('0xb'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xcb05('0x2')]},'authId':{'type':Sequelize[_0xcb05('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xcb05('0x2')]},'accountId':{'type':Sequelize[_0xcb05('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xcb05('0x2')]},'notificationTemplate':{'type':Sequelize[_0xcb05('0xc')],'defaultValue':function(){return _0xcb05('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcb05('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcb05('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xcb05('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcb05('0xe')],'comment':_0xcb05('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xcb05('0xf')],'defaultValue':![],'comment':_0xcb05('0x11'),'set':function(_0x4a9fe2){if(!_0x4a9fe2)this[_0xcb05('0x12')](_0xcb05('0x13'),null);this[_0xcb05('0x12')](_0xcb05('0x14'),_0x4a9fe2);}}}; \ No newline at end of file +var _0x6023=['name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6023,0x105));var _0x3602=function(_0x2e2b43,_0x55bd4c){_0x2e2b43=_0x2e2b43-0x0;var _0x56e57e=_0x6023[_0x2e2b43];return _0x56e57e;};'use strict';var Sequelize=require(_0x3602('0x0'));var rs=require(_0x3602('0x1'));module[_0x3602('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3602('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3602('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x3602('0x4')],'defaultValue':function(){return rs[_0x3602('0x5')]();}},'phone':{'type':Sequelize[_0x3602('0x4')]},'type':{'type':Sequelize[_0x3602('0x6')](_0x3602('0x7'),'skebby',_0x3602('0x8'),_0x3602('0x9'),_0x3602('0xa'),'clickatell',_0x3602('0xb'),_0x3602('0xc'),_0x3602('0xd'),_0x3602('0xe'))},'accountSid':{'type':Sequelize[_0x3602('0x4')]},'authId':{'type':Sequelize[_0x3602('0x4')]},'authToken':{'type':Sequelize[_0x3602('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x3602('0x4')]},'password':{'type':Sequelize[_0x3602('0x4')]},'apiKey':{'type':Sequelize[_0x3602('0x4')]},'applicationId':{'type':Sequelize[_0x3602('0x4')]},'accountId':{'type':Sequelize[_0x3602('0x4')]},'senderString':{'type':Sequelize[_0x3602('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3602('0xf')],'defaultValue':function(){return _0x3602('0x10');}},'notificationSound':{'type':Sequelize[_0x3602('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3602('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3602('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3602('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![],'comment':_0x3602('0x13'),'set':function(_0x1cd7b7){if(!_0x1cd7b7)this[_0x3602('0x14')]('mandatoryDispositionPauseId',null);this[_0x3602('0x14')](_0x3602('0x15'),_0x1cd7b7);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cd02d03..6e7f15b 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 _0x593d=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','SmsInteraction','interaction','created','autoclose','push','unmanaged','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','tag','to\x20is\x20mandatory','List','DESC','out','SmsMessage','Messages','spread','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','SmsAccount','findAll','rows','show','params','options','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','order','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','mobile','type','twilio','From','Body','messageId','MessageSid','skebby','sender','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x41355f,_0xecbc5){var _0x42329a=function(_0x376150){while(--_0x376150){_0x41355f['push'](_0x41355f['shift']());}};_0x42329a(++_0xecbc5);}(_0x593d,0x129));var _0xd593=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x593d[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xd593('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd593('0x1'));var jsonpatch=require(_0xd593('0x2'));var rp=require(_0xd593('0x3'));var moment=require(_0xd593('0x4'));var BPromise=require(_0xd593('0x5'));var Mustache=require(_0xd593('0x6'));var util=require(_0xd593('0x7'));var path=require(_0xd593('0x8'));var sox=require(_0xd593('0x9'));var csv=require(_0xd593('0xa'));var ejs=require(_0xd593('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd593('0xc'));var squel=require('squel');var crypto=require(_0xd593('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd593('0xe'));var toCsv=require(_0xd593('0xa'));var querystring=require(_0xd593('0xf'));var Papa=require(_0xd593('0x10'));var Redis=require('ioredis');var authService=require(_0xd593('0x11'));var qs=require(_0xd593('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd593('0x13'));var logger=require('../../config/logger')(_0xd593('0x14'));var utils=require(_0xd593('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd593('0x16'));var db=require(_0xd593('0x17'))['db'];config[_0xd593('0x18')]=_[_0xd593('0x19')](config[_0xd593('0x18')],{'host':_0xd593('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd593('0x18')]));require(_0xd593('0x1b'))['register'](socket);var jayson=require(_0xd593('0x1c'));var client=jayson['client'][_0xd593('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4f368f,_0x17d37e,_0x160bc5,_0x557d56){return new BPromise(function(_0x4fd233,_0x313a23){var _0x4f9bf5=_0x557d56||client;return _0x4f9bf5[_0xd593('0x1e')](_0x4f368f,_0x160bc5)[_0xd593('0x1f')](function(_0x41cff9){logger[_0xd593('0x20')](_0xd593('0x21'),_0x17d37e,_0xd593('0x22'));logger['debug'](_0xd593('0x23'),_0x17d37e,_0xd593('0x22'),JSON[_0xd593('0x24')](_0x41cff9));if(_0x41cff9[_0xd593('0x25')]){if(_0x41cff9[_0xd593('0x25')]['code']===0x1f4){logger[_0xd593('0x25')]('SmsAccount,\x20%s,\x20%s',_0x17d37e,_0x41cff9[_0xd593('0x25')]['message']);return _0x313a23(_0x41cff9['error'][_0xd593('0x26')]);}logger[_0xd593('0x25')](_0xd593('0x21'),_0x17d37e,_0x41cff9[_0xd593('0x25')][_0xd593('0x26')]);return _0x4fd233(_0x41cff9[_0xd593('0x25')][_0xd593('0x26')]);}else{logger[_0xd593('0x20')]('SmsAccount,\x20%s,\x20%s',_0x17d37e,_0xd593('0x22'));_0x4fd233(_0x41cff9[_0xd593('0x27')][_0xd593('0x26')]);}})[_0xd593('0x28')](function(_0x54b00e){logger[_0xd593('0x25')](_0xd593('0x21'),_0x17d37e,_0x54b00e);_0x313a23(_0x54b00e);});});}function respondWithStatusCode(_0x19f775,_0x7ab639){_0x7ab639=_0x7ab639||0xcc;return function(_0x304554){if(_0x304554){return _0x19f775[_0xd593('0x29')](_0x7ab639);}return _0x19f775[_0xd593('0x2a')](_0x7ab639)[_0xd593('0x2b')]();};}function respondWithResult(_0x5c6586,_0x18c1a4){_0x18c1a4=_0x18c1a4||0xc8;return function(_0x2ef917){if(_0x2ef917){return _0x5c6586['status'](_0x18c1a4)[_0xd593('0x2c')](_0x2ef917);}};}function respondWithFilteredResult(_0x5250b5,_0x4b22da){return function(_0x956317){if(_0x956317){var _0x4c3626=typeof _0x4b22da['offset']===_0xd593('0x2d')&&typeof _0x4b22da['limit']==='undefined';var _0x1482d5=_0x956317[_0xd593('0x2e')];var _0x4ee34f=_0x4c3626?0x0:_0x4b22da[_0xd593('0x2f')];var _0x409942=_0x4c3626?_0x956317[_0xd593('0x2e')]:_0x4b22da[_0xd593('0x2f')]+_0x4b22da[_0xd593('0x30')];var _0x752c8d;if(_0x409942>=_0x1482d5){_0x409942=_0x1482d5;_0x752c8d=0xc8;}else{_0x752c8d=0xce;}_0x5250b5['status'](_0x752c8d);return _0x5250b5[_0xd593('0x31')]('Content-Range',_0x4ee34f+'-'+_0x409942+'/'+_0x1482d5)[_0xd593('0x2c')](_0x956317);}return null;};}function patchUpdates(_0x2a11a0){return function(_0x2bed89){try{jsonpatch[_0xd593('0x32')](_0x2bed89,_0x2a11a0,!![]);}catch(_0x22536b){return BPromise[_0xd593('0x33')](_0x22536b);}return _0x2bed89[_0xd593('0x34')]();};}function saveUpdates(_0x2260af,_0x2c06dd){return function(_0x55812f){if(_0x55812f){return _0x55812f[_0xd593('0x35')](_0x2260af)['then'](function(_0x4cfd58){return _0x4cfd58;});}return null;};}function removeEntity(_0x31a232,_0x2b0298){return function(_0x580f9f){if(_0x580f9f){return _0x580f9f[_0xd593('0x36')]()[_0xd593('0x1f')](function(){var _0x271f6=_0x580f9f['get']({'plain':!![]});var _0x29f8c6=_0xd593('0x37');return db['UserProfileResource'][_0xd593('0x36')]({'where':{'type':_0x29f8c6,'resourceId':_0x271f6['id']}})['then'](function(){return _0x580f9f;});})[_0xd593('0x1f')](function(){_0x31a232[_0xd593('0x2a')](0xcc)[_0xd593('0x2b')]();});}};}function handleEntityNotFound(_0x186ced,_0x9d0beb){return function(_0x50ec9e){if(!_0x50ec9e){_0x186ced['sendStatus'](0x194);}return _0x50ec9e;};}function handleError(_0x57e09c,_0x2b887d){_0x2b887d=_0x2b887d||0x1f4;return function(_0xd9840b){logger[_0xd593('0x25')](_0xd9840b[_0xd593('0x38')]);if(_0xd9840b[_0xd593('0x39')]){delete _0xd9840b[_0xd593('0x39')];}_0x57e09c[_0xd593('0x2a')](_0x2b887d)[_0xd593('0x3a')](_0xd9840b);};}exports[_0xd593('0x3b')]=function(_0xf18b7f,_0xff97aa){var _0x20d949={'include':[{'model':db[_0xd593('0x3c')],'as':_0xd593('0x3d')}]},_0x19bd20={},_0x16cb46={'count':0x0,'rows':[]};var _0xe11228=_['map'](db['SmsAccount'][_0xd593('0x3e')],function(_0x19e47f){return{'name':_0x19e47f['fieldName'],'type':_0x19e47f['type'][_0xd593('0x3f')]};});_0x19bd20[_0xd593('0x40')]=_[_0xd593('0x41')](_0xe11228,_0xd593('0x39'));_0x19bd20[_0xd593('0x42')]=_[_0xd593('0x43')](_0xf18b7f[_0xd593('0x42')]);_0x19bd20[_0xd593('0x44')]=_[_0xd593('0x45')](_0x19bd20[_0xd593('0x40')],_0x19bd20['query']);_0x20d949[_0xd593('0x46')]=_[_0xd593('0x45')](_0x19bd20[_0xd593('0x40')],qs[_0xd593('0x47')](_0xf18b7f[_0xd593('0x42')][_0xd593('0x47')]));_0x20d949[_0xd593('0x46')]=_0x20d949[_0xd593('0x46')][_0xd593('0x48')]?_0x20d949[_0xd593('0x46')]:_0x19bd20['model'];if(!_0xf18b7f[_0xd593('0x42')][_0xd593('0x49')]('nolimit')){_0x20d949['limit']=qs[_0xd593('0x30')](_0xf18b7f[_0xd593('0x42')][_0xd593('0x30')]);_0x20d949['offset']=qs[_0xd593('0x2f')](_0xf18b7f['query'][_0xd593('0x2f')]);}_0x20d949['order']=qs[_0xd593('0x4a')](_0xf18b7f[_0xd593('0x42')][_0xd593('0x4a')]);_0x20d949[_0xd593('0x4b')]=qs[_0xd593('0x44')](_['pick'](_0xf18b7f[_0xd593('0x42')],_0x19bd20[_0xd593('0x44')]),_0xe11228);if(_0xf18b7f['query'][_0xd593('0x4c')]){_0x20d949['where']=_[_0xd593('0x4d')](_0x20d949[_0xd593('0x4b')],{'$or':_[_0xd593('0x41')](_0xe11228,function(_0x38ad8f){if(_0x38ad8f['type']!==_0xd593('0x4e')){var _0x2a27e9={};_0x2a27e9[_0x38ad8f[_0xd593('0x39')]]={'$like':'%'+_0xf18b7f[_0xd593('0x42')][_0xd593('0x4c')]+'%'};return _0x2a27e9;}})});}_0x20d949=_['merge']({},_0x20d949,_0xf18b7f['options']);var _0x584a1f={'where':_0x20d949[_0xd593('0x4b')]};return db['SmsAccount'][_0xd593('0x2e')](_0x584a1f)[_0xd593('0x1f')](function(_0x21b9d3){_0x16cb46[_0xd593('0x2e')]=_0x21b9d3;if(_0xf18b7f[_0xd593('0x42')][_0xd593('0x4f')]){_0x20d949[_0xd593('0x50')]=[{'all':!![]}];}return db[_0xd593('0x51')][_0xd593('0x52')](_0x20d949);})[_0xd593('0x1f')](function(_0x5ab0d7){_0x16cb46[_0xd593('0x53')]=_0x5ab0d7;return _0x16cb46;})[_0xd593('0x1f')](respondWithFilteredResult(_0xff97aa,_0x20d949))[_0xd593('0x28')](handleError(_0xff97aa,null));};exports[_0xd593('0x54')]=function(_0x61cbce,_0x54f1a5){var _0x183995={'raw':![],'where':{'id':_0x61cbce[_0xd593('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x29aaf8={};_0x29aaf8['model']=_['keys'](db['SmsAccount'][_0xd593('0x3e')]);_0x29aaf8[_0xd593('0x42')]=_[_0xd593('0x43')](_0x61cbce[_0xd593('0x42')]);_0x29aaf8[_0xd593('0x44')]=_[_0xd593('0x45')](_0x29aaf8[_0xd593('0x40')],_0x29aaf8[_0xd593('0x42')]);_0x183995[_0xd593('0x46')]=_[_0xd593('0x45')](_0x29aaf8['model'],qs[_0xd593('0x47')](_0x61cbce[_0xd593('0x42')][_0xd593('0x47')]));_0x183995['attributes']=_0x183995[_0xd593('0x46')]['length']?_0x183995[_0xd593('0x46')]:_0x29aaf8[_0xd593('0x40')];if(_0x61cbce[_0xd593('0x42')][_0xd593('0x4f')]){_0x183995[_0xd593('0x50')]=[{'all':!![]}];}_0x183995=_[_0xd593('0x4d')]({},_0x183995,_0x61cbce[_0xd593('0x56')]);return db[_0xd593('0x51')]['find'](_0x183995)[_0xd593('0x1f')](handleEntityNotFound(_0x54f1a5,null))[_0xd593('0x1f')](respondWithResult(_0x54f1a5,null))[_0xd593('0x28')](handleError(_0x54f1a5,null));};exports['create']=function(_0x4bd395,_0x1cedc8){return db[_0xd593('0x51')]['create'](_0x4bd395['body'],{})[_0xd593('0x1f')](function(_0x538674){var _0x1bc61e=_0x4bd395[_0xd593('0x57')][_0xd593('0x58')]({'plain':!![]});if(!_0x1bc61e)throw new Error(_0xd593('0x59'));if(_0x1bc61e[_0xd593('0x5a')]===_0xd593('0x57')){var _0x3820e4=_0x538674[_0xd593('0x58')]({'plain':!![]});var _0x297179=_0xd593('0x37');return db[_0xd593('0x5b')][_0xd593('0x5c')]({'where':{'name':_0x297179,'userProfileId':_0x1bc61e['userProfileId']},'raw':!![]})[_0xd593('0x1f')](function(_0x442cf6){if(_0x442cf6&&_0x442cf6[_0xd593('0x5d')]===0x0){return db['UserProfileResource'][_0xd593('0x5e')]({'name':_0x3820e4['name'],'resourceId':_0x3820e4['id'],'type':_0x442cf6[_0xd593('0x39')],'sectionId':_0x442cf6['id']},{})[_0xd593('0x1f')](function(){return _0x538674;});}else{return _0x538674;}})[_0xd593('0x28')](function(_0x2b429d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b429d);throw _0x2b429d;});}return _0x538674;})[_0xd593('0x1f')](respondWithResult(_0x1cedc8,0xc9))['catch'](handleError(_0x1cedc8,null));};exports[_0xd593('0x35')]=function(_0x518527,_0x5d7f30){if(_0x518527[_0xd593('0x5f')]['id']){delete _0x518527[_0xd593('0x5f')]['id'];}return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x518527[_0xd593('0x55')]['id']},'include':[{'model':db[_0xd593('0x3c')],'as':_0xd593('0x3d')}]})['then'](handleEntityNotFound(_0x5d7f30,null))[_0xd593('0x1f')](saveUpdates(_0x518527[_0xd593('0x5f')],null))[_0xd593('0x1f')](respondWithResult(_0x5d7f30,null))[_0xd593('0x28')](handleError(_0x5d7f30,null));};exports[_0xd593('0x36')]=function(_0x4357a4,_0x557b91){return db['SmsAccount'][_0xd593('0x5c')]({'where':{'id':_0x4357a4['params']['id']}})['then'](handleEntityNotFound(_0x557b91,null))['then'](removeEntity(_0x557b91,null))[_0xd593('0x28')](handleError(_0x557b91,null));};exports[_0xd593('0x60')]=function(_0x4edc16,_0x55b3db){return db[_0xd593('0x51')][_0xd593('0x60')]()[_0xd593('0x1f')](respondWithResult(_0x55b3db,null))['catch'](handleError(_0x55b3db,null));};exports[_0xd593('0x61')]=function(_0x36056c,_0x603f0c,_0x57a6b5){if(_0x36056c[_0xd593('0x5f')]['id']){delete _0x36056c['body']['id'];}return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x36056c[_0xd593('0x55')]['id']}})['then'](handleEntityNotFound(_0x603f0c,null))[_0xd593('0x1f')](function(_0x3b9486){if(_0x3b9486){_0x36056c['body'][_0xd593('0x62')]=_0x3b9486['id'];return db[_0xd593('0x63')][_0xd593('0x5e')](_0x36056c[_0xd593('0x5f')]);}})[_0xd593('0x1f')](respondWithResult(_0x603f0c,null))[_0xd593('0x28')](handleError(_0x603f0c,null));};exports[_0xd593('0x64')]=function(_0x502151,_0x1c54e4,_0x436278){var _0x4d6e8d={'raw':![],'where':{}};var _0x4680f5={};var _0x286f61={'count':0x0,'rows':[]};return db[_0xd593('0x51')][_0xd593('0x65')]({'where':{'id':_0x502151[_0xd593('0x55')]['id']}})['then'](handleEntityNotFound(_0x1c54e4,null))[_0xd593('0x1f')](function(_0x29d300){if(_0x29d300){_0x4680f5[_0xd593('0x40')]=_[_0xd593('0x43')](db[_0xd593('0x63')]['rawAttributes']);_0x4680f5[_0xd593('0x42')]=_['keys'](_0x502151['query']);_0x4680f5['filters']=_[_0xd593('0x45')](_0x4680f5[_0xd593('0x40')],_0x4680f5[_0xd593('0x42')]);_0x4d6e8d[_0xd593('0x46')]=_[_0xd593('0x45')](_0x4680f5[_0xd593('0x40')],qs['fields'](_0x502151[_0xd593('0x42')][_0xd593('0x47')]));_0x4d6e8d[_0xd593('0x46')]=_0x4d6e8d['attributes'][_0xd593('0x48')]?_0x4d6e8d[_0xd593('0x46')]:_0x4680f5[_0xd593('0x40')];if(!_0x502151[_0xd593('0x42')]['hasOwnProperty'](_0xd593('0x66'))){_0x4d6e8d[_0xd593('0x30')]=qs[_0xd593('0x30')](_0x502151['query'][_0xd593('0x30')]);_0x4d6e8d[_0xd593('0x2f')]=qs[_0xd593('0x2f')](_0x502151[_0xd593('0x42')][_0xd593('0x2f')]);}_0x4d6e8d[_0xd593('0x67')]=qs[_0xd593('0x4a')](_0x502151[_0xd593('0x42')][_0xd593('0x4a')]);_0x4d6e8d[_0xd593('0x4b')]=qs[_0xd593('0x44')](_[_0xd593('0x68')](_0x502151[_0xd593('0x42')],_0x4680f5[_0xd593('0x44')]));_0x4d6e8d['where'][_0xd593('0x62')]=_0x29d300['id'];if(_0x502151['query'][_0xd593('0x4c')]){_0x4d6e8d[_0xd593('0x4b')]=_[_0xd593('0x4d')](_0x4d6e8d[_0xd593('0x4b')],{'$or':_[_0xd593('0x41')](_0x4d6e8d[_0xd593('0x46')],function(_0x512bd4){var _0x153d8a={};_0x153d8a[_0x512bd4]={'$like':'%'+_0x502151[_0xd593('0x42')][_0xd593('0x4c')]+'%'};return _0x153d8a;})});}_0x4d6e8d=_[_0xd593('0x4d')]({},_0x4d6e8d,_0x502151[_0xd593('0x56')]);return db[_0xd593('0x63')][_0xd593('0x2e')]({'where':_0x4d6e8d['where']})[_0xd593('0x1f')](function(_0x3e537e){_0x286f61[_0xd593('0x2e')]=_0x3e537e;if(_0x502151[_0xd593('0x42')][_0xd593('0x4f')]){_0x4d6e8d[_0xd593('0x50')]=[{'all':!![]}];}return db[_0xd593('0x63')]['findAll'](_0x4d6e8d);})[_0xd593('0x1f')](function(_0x2d203b){_0x286f61['rows']=_0x2d203b;return _0x286f61;});}})[_0xd593('0x1f')](respondWithFilteredResult(_0x1c54e4,_0x4d6e8d))[_0xd593('0x28')](handleError(_0x1c54e4,null));};exports[_0xd593('0x69')]=function(_0x1137fd,_0x30b277,_0x2c7d2f){return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x1137fd[_0xd593('0x55')]['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x30b277,null))['then'](function(_0x5713f3){if(_0x5713f3){return _0x5713f3[_0xd593('0x69')](_0x1137fd[_0xd593('0x42')][_0xd593('0x6a')]);}})[_0xd593('0x1f')](respondWithStatusCode(_0x30b277,null))[_0xd593('0x28')](handleError(_0x30b277,null));};exports['addAnswer']=function(_0x1e5210,_0x285dac,_0x760c8e){if(_0x1e5210[_0xd593('0x5f')]['id']){delete _0x1e5210[_0xd593('0x5f')]['id'];}return db['SmsAccount'][_0xd593('0x5c')]({'where':{'id':_0x1e5210[_0xd593('0x55')]['id']}})['then'](handleEntityNotFound(_0x285dac,null))[_0xd593('0x1f')](function(_0x1777f5){if(_0x1777f5){_0x1e5210[_0xd593('0x5f')][_0xd593('0x62')]=_0x1777f5['id'];return db[_0xd593('0x6b')][_0xd593('0x5e')](_0x1e5210[_0xd593('0x5f')]);}})[_0xd593('0x1f')](respondWithResult(_0x285dac,null))[_0xd593('0x28')](handleError(_0x285dac,null));};exports[_0xd593('0x6c')]=function(_0x1169b1,_0x53beb7,_0x23ef77){var _0xb2f060={'raw':![],'where':{}};var _0x282c03={};var _0x1b2713={'count':0x0,'rows':[]};return db[_0xd593('0x51')][_0xd593('0x65')]({'where':{'id':_0x1169b1[_0xd593('0x55')]['id']}})['then'](handleEntityNotFound(_0x53beb7,null))[_0xd593('0x1f')](function(_0x12791a){if(_0x12791a){_0x282c03['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x282c03[_0xd593('0x42')]=_['keys'](_0x1169b1[_0xd593('0x42')]);_0x282c03[_0xd593('0x44')]=_[_0xd593('0x45')](_0x282c03[_0xd593('0x40')],_0x282c03['query']);_0xb2f060[_0xd593('0x46')]=_[_0xd593('0x45')](_0x282c03[_0xd593('0x40')],qs['fields'](_0x1169b1[_0xd593('0x42')][_0xd593('0x47')]));_0xb2f060['attributes']=_0xb2f060['attributes']['length']?_0xb2f060['attributes']:_0x282c03[_0xd593('0x40')];if(!_0x1169b1[_0xd593('0x42')][_0xd593('0x49')](_0xd593('0x66'))){_0xb2f060[_0xd593('0x30')]=qs[_0xd593('0x30')](_0x1169b1[_0xd593('0x42')]['limit']);_0xb2f060[_0xd593('0x2f')]=qs[_0xd593('0x2f')](_0x1169b1[_0xd593('0x42')][_0xd593('0x2f')]);}_0xb2f060[_0xd593('0x67')]=qs['sort'](_0x1169b1[_0xd593('0x42')][_0xd593('0x4a')]);_0xb2f060[_0xd593('0x4b')]=qs[_0xd593('0x44')](_[_0xd593('0x68')](_0x1169b1[_0xd593('0x42')],_0x282c03[_0xd593('0x44')]));_0xb2f060[_0xd593('0x4b')]['SmsAccountId']=_0x12791a['id'];if(_0x1169b1[_0xd593('0x42')][_0xd593('0x4c')]){_0xb2f060['where']=_['merge'](_0xb2f060[_0xd593('0x4b')],{'$or':_['map'](_0xb2f060[_0xd593('0x46')],function(_0x204a5a){var _0x428673={};_0x428673[_0x204a5a]={'$like':'%'+_0x1169b1['query']['filter']+'%'};return _0x428673;})});}_0xb2f060=_[_0xd593('0x4d')]({},_0xb2f060,_0x1169b1['options']);return db[_0xd593('0x6b')][_0xd593('0x2e')]({'where':_0xb2f060[_0xd593('0x4b')]})[_0xd593('0x1f')](function(_0x23c842){_0x1b2713[_0xd593('0x2e')]=_0x23c842;if(_0x1169b1[_0xd593('0x42')][_0xd593('0x4f')]){_0xb2f060[_0xd593('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd593('0x52')](_0xb2f060);})[_0xd593('0x1f')](function(_0x40ba30){_0x1b2713[_0xd593('0x53')]=_0x40ba30;return _0x1b2713;});}})['then'](respondWithFilteredResult(_0x53beb7,_0xb2f060))[_0xd593('0x28')](handleError(_0x53beb7,null));};exports[_0xd593('0x6d')]=function(_0x56b50c,_0x46186c,_0x2247d1){return db[_0xd593('0x51')]['find']({'where':{'id':_0x56b50c['params']['id']}})['then'](handleEntityNotFound(_0x46186c,null))['then'](function(_0x46a278){if(_0x46a278){return _0x46a278[_0xd593('0x6d')](_0x56b50c[_0xd593('0x42')][_0xd593('0x6a')]);}})[_0xd593('0x1f')](respondWithStatusCode(_0x46186c,null))['catch'](handleError(_0x46186c,null));};exports[_0xd593('0x6e')]=function(_0x29c588,_0x2981df,_0x2714d2){var _0x1cba26={'channel':_0xd593('0x6f')};var _0x30e7f3=[];var _0x9d543e=[];var _0x593544={};return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x29c588['params']['id']},'include':[{'model':db[_0xd593('0x70')],'as':_0xd593('0x71')}]})[_0xd593('0x1f')](handleEntityNotFound(_0x2981df,null))[_0xd593('0x1f')](function(_0x4be877){_0x1cba26['account']=_0x4be877;_0x1cba26[_0xd593('0x72')]=_['orderBy'](_0x4be877[_0xd593('0x71')],[_0xd593('0x73')],[_0xd593('0x74')]);if(_0x1cba26['account']['Applications']){delete _0x1cba26[_0xd593('0x75')][_0xd593('0x71')];}return db[_0xd593('0x76')][_0xd593('0x60')]();})[_0xd593('0x1f')](function(_0x1c4cfc){if(!_0x1c4cfc){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0x79'));}_0x30e7f3=_['difference'](_[_0xd593('0x43')](_0x1c4cfc),['createdAt',_0xd593('0x7a')]);_0x9d543e=_[_0xd593('0x7b')](_[_0xd593('0x43')](_0x1c4cfc),['createdAt','updatedAt',_0xd593('0x7c'),_0xd593('0x7d')]);_0x1cba26[_0xd593('0x5f')]={'mapKey':_0xd593('0x7e')};if(_0x1cba26[_0xd593('0x75')][_0xd593('0x7f')]){switch(_0x1cba26[_0xd593('0x75')]['type']){case _0xd593('0x80'):_0x1cba26[_0xd593('0x5f')]['from']=_0x29c588[_0xd593('0x5f')][_0xd593('0x81')];_0x1cba26[_0xd593('0x5f')]['body']=_0x29c588['body'][_0xd593('0x82')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x83')]=_0x29c588['body'][_0xd593('0x84')];break;case _0xd593('0x85'):_0x1cba26[_0xd593('0x5f')]['from']='+'+_0x29c588[_0xd593('0x5f')][_0xd593('0x86')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')]['text'];break;case _0xd593('0x87'):_0x1cba26['body'][_0xd593('0x88')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x88')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x26')];break;case _0xd593('0x89'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')]=_0x29c588['body'][_0xd593('0x88')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x5f')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x83')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x8a')];break;case _0xd593('0x8b'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')]=_0x29c588[_0xd593('0x5f')]['From'];_0x1cba26['body'][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x8c')];_0x1cba26['body'][_0xd593('0x83')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x8d')];break;case _0xd593('0x8e'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')]='+'+_0x29c588[_0xd593('0x5f')][_0xd593('0x8f')][0x0]['from'];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x8f')][0x0]['text'];_0x1cba26['body'][_0xd593('0x83')]=_0x29c588['body'][_0xd593('0x8f')][0x0][_0xd593('0x83')];break;case _0xd593('0x90'):_0x1cba26[_0xd593('0x5f')]['from']=_0x29c588[_0xd593('0x5f')][_0xd593('0x91')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')]['segmentedMessage']['message'];break;case _0xd593('0x92'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x93')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][_0xd593('0x94')];_0x1cba26['body'][_0xd593('0x83')]=_0x29c588['body'][_0xd593('0x95')];break;case _0xd593('0x96'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x83')]=_0x29c588['body'][0x0][_0xd593('0x26')]['id'];_0x1cba26[_0xd593('0x5f')]['from']=_0x29c588['body'][0x0]['message'][_0xd593('0x88')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')][0x0]['message'][_0xd593('0x94')];break;case _0xd593('0x97'):_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')]=_0x29c588['body'][_0xd593('0x88')];_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]=_0x29c588[_0xd593('0x5f')]['message'];_0x1cba26[_0xd593('0x5f')]['messageId']=_0x29c588[_0xd593('0x5f')][_0xd593('0x98')];break;}}if(_0x1cba26[_0xd593('0x5f')]['id']){delete _0x1cba26['body']['id'];}if(_[_0xd593('0x99')](_0x1cba26['body'][_0xd593('0x88')])){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0x9a'));}if(_[_0xd593('0x99')](_0x1cba26[_0xd593('0x5f')]['body'])||_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')]===''){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0x9b'));}if(_[_0xd593('0x99')](_0x1cba26[_0xd593('0x5f')][_0xd593('0x9c')])){throw new db[(_0xd593('0x77'))]['ValidationError'](_0xd593('0x9d')+_0x9d543e);}if(!_[_0xd593('0x9e')](_0x9d543e,_0x1cba26[_0xd593('0x5f')]['mapKey'])){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0x9f')+_0x9d543e);}_0x593544[_0x1cba26[_0xd593('0x5f')][_0xd593('0x9c')]]=_0x1cba26['body'][_0xd593('0x88')];return db[_0xd593('0xa0')][_0xd593('0x5c')]({'where':{'id':_0x1cba26['account'][_0xd593('0x7d')]},'include':[{'model':db[_0xd593('0x76')],'as':'Contacts','where':_0x593544,'limit':0x1,'order':[[_0xd593('0x7a'),'DESC']]}]});})['then'](handleEntityNotFound(_0x2981df,null))[_0xd593('0x1f')](function(_0x25b82b){if(_0x25b82b){_0x1cba26[_0xd593('0xa1')]=_[_0xd593('0xa2')](_0x25b82b,['Contacts']);if(_0x25b82b[_0xd593('0xa3')][_0xd593('0x48')]){return _0x25b82b[_0xd593('0xa3')][0x0];}var _0x44f2ba=_[_0xd593('0x19')](_0x1cba26['body'],{'firstName':_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')],'ListId':_0x25b82b['id']});_0x44f2ba[_0x1cba26[_0xd593('0x5f')][_0xd593('0x9c')]]=_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')];return db[_0xd593('0x76')]['create'](_0x44f2ba,{'fields':_0x30e7f3,'raw':!![]});}})[_0xd593('0x1f')](handleEntityNotFound(_0x2981df,null))[_0xd593('0x1f')](function(_0x46243d){if(_0x46243d){_0x1cba26['contact']=_0x46243d;var _0xd74fbd={'ContactId':_0x46243d['id'],'phone':_0x1cba26[_0xd593('0x5f')][_0xd593('0x88')],'SmsAccountId':_0x29c588[_0xd593('0x55')]['id']};var _0x379685={'ContactId':_0x46243d['id'],'SmsAccountId':_0x29c588[_0xd593('0x55')]['id'],'closed':![]};return db['SmsInteraction'][_0xd593('0x5c')]({'where':_0x379685})[_0xd593('0x1f')](function(_0x477e5c){if(_0x477e5c){return[_0x477e5c,![]];}return db[_0xd593('0xa4')][_0xd593('0x5e')](_0xd74fbd)[_0xd593('0x1f')](function(_0x3f0910){return[_0x3f0910,!![]];});});}})['spread'](function(_0x21bf78,_0x424b41){_0x1cba26[_0xd593('0xa5')]=_0x21bf78[_0xd593('0x58')]({'plain':!![]});_0x1cba26['interaction'][_0xd593('0xa6')]=![];if(_0x424b41){if(_0x1cba26[_0xd593('0x75')][_0xd593('0xa7')]){_0x1cba26['applications'][_0xd593('0xa8')]({'id':0x0,'priority':_0x1cba26[_0xd593('0x72')]['length']+0x1,'app':'close','appdata':_0xd593('0xa9'),'interval':'*,*,*,*'});}_0x1cba26[_0xd593('0xa5')]['created']=!![];}return db['SmsMessage'][_0xd593('0x5e')]({'phone':_0x1cba26['body'][_0xd593('0x88')],'messageId':_0x1cba26[_0xd593('0x5f')][_0xd593('0x83')],'body':_0x1cba26[_0xd593('0x5f')][_0xd593('0x5f')],'SmsAccountId':_0x29c588[_0xd593('0x55')]['id'],'SmsInteractionId':_0x21bf78['id'],'direction':'in','ContactId':_0x21bf78[_0xd593('0xaa')],'AttachmentId':_0x1cba26[_0xd593('0x5f')][_0xd593('0xab')]});})[_0xd593('0x1f')](function(_0x183749){_0x1cba26[_0xd593('0x26')]=_0x183749;if(_0x1cba26[_0xd593('0xa5')][_0xd593('0xac')]){return db[_0xd593('0xad')][_0xd593('0x5c')]({'attributes':['id','name'],'where':{'id':_0x1cba26['interaction']['UserId']}})[_0xd593('0x1f')](function(_0x1af44e){if(_0x1af44e){_0x1cba26[_0xd593('0x72')][_0xd593('0xae')]({'id':0x0,'priority':0x0,'app':_0xd593('0xaf'),'appdata':_0x1af44e[_0xd593('0x39')]+','+(_0x1cba26['account'][_0xd593('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd593('0xb1'),_0xd593('0xb2'),_0x1cba26);});}return respondWithRpcPromise(_0xd593('0xb1'),_0xd593('0xb2'),_0x1cba26);})['then'](function(_0x54a05b){if(_0x54a05b){var _0x4d7834=0xc8;var _0x3cf4a4='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cf4a4,_0x4d7834,'entity\x20found');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3cf4a4,_0x4d7834,_0xd593('0xb3'),JSON['stringify'](_0x54a05b));if(_0x1cba26[_0xd593('0x75')][_0xd593('0x7f')]===_0xd593('0x80')){return _0x2981df['status'](_0x4d7834)[_0xd593('0x31')](_0xd593('0xb4'),_0xd593('0xb5'))[_0xd593('0x3a')](_0xd593('0xb6'));}else{return _0x2981df[_0xd593('0x2a')](_0x4d7834)[_0xd593('0x2c')](_0x54a05b);}}})[_0xd593('0x28')](handleError(_0x2981df,null));};exports[_0xd593('0xb7')]=function(_0x45fb39,_0x14874e){var _0x26ca68=_0x45fb39['params']['id'];var _0x5c44b3=_0x45fb39[_0xd593('0x5f')];var _0x14b4cd=0xc8;var _0x1f3dec=null;return db[_0xd593('0xb8')][_0xd593('0xb9')]({'isolationLevel':db[_0xd593('0xb8')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x41f4a5){return db[_0xd593('0x51')][_0xd593('0x65')]({'where':{'id':_0x26ca68},'transaction':_0x41f4a5})[_0xd593('0x1f')](function(_0xea1d00){if(_0xea1d00){return db[_0xd593('0x70')]['destroy']({'where':{'SmsAccountId':_0x26ca68},'transaction':_0x41f4a5})[_0xd593('0x1f')](function(){var _0x4000bd=_[_0xd593('0x41')](_0x5c44b3,function(_0x3aa70a){_0x3aa70a[_0xd593('0x62')]=_0x26ca68;return _0x3aa70a;});return db[_0xd593('0x70')][_0xd593('0xba')](_0x4000bd,{'transaction':_0x41f4a5});});}else{_0x14b4cd=0x194;_0x1f3dec=[];}});})[_0xd593('0x1f')](function(){if(_0x14b4cd!==0x194){return db[_0xd593('0x70')]['findAndCountAll']({'where':{'SmsAccountId':_0x26ca68},'order':_0xd593('0x73')})[_0xd593('0x1f')](function(_0x2d46bf){_0x1f3dec=_0x2d46bf;});}})['catch'](function(_0x3d79ee){_0x14b4cd=0x1f4;logger[_0xd593('0x25')](_0x3d79ee[_0xd593('0x38')]);if(_0x3d79ee['name']){delete _0x3d79ee[_0xd593('0x39')];}_0x1f3dec=_0x3d79ee;})[_0xd593('0xbb')](function(){if(_0x1f3dec===null){_0x14874e[_0xd593('0x29')](_0x14b4cd);}else{if(_0x14b4cd===0x1f4){_0x14874e[_0xd593('0x2a')](_0x14b4cd)['send'](_0x1f3dec);}else{_0x14874e[_0xd593('0x2a')](_0x14b4cd)[_0xd593('0x2c')](_0x1f3dec);}}});};exports[_0xd593('0xbc')]=function(_0x2a1f32,_0x21b117,_0x1c7e22){var _0x488034={};var _0x11e93f={};var _0xb6a39f;var _0x3deba3;return db['SmsAccount'][_0xd593('0x65')]({'where':{'id':_0x2a1f32['params']['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x21b117,null))['then'](function(_0x2a2605){if(_0x2a2605){_0xb6a39f=_0x2a2605;_0x11e93f[_0xd593('0x40')]=_['keys'](db[_0xd593('0x70')][_0xd593('0x3e')]);_0x11e93f['query']=_['keys'](_0x2a1f32[_0xd593('0x42')]);_0x11e93f[_0xd593('0x44')]=_['intersection'](_0x11e93f[_0xd593('0x40')],_0x11e93f['query']);_0x488034[_0xd593('0x46')]=_['intersection'](_0x11e93f[_0xd593('0x40')],qs['fields'](_0x2a1f32[_0xd593('0x42')][_0xd593('0x47')]));_0x488034[_0xd593('0x46')]=_0x488034[_0xd593('0x46')][_0xd593('0x48')]?_0x488034[_0xd593('0x46')]:_0x11e93f[_0xd593('0x40')];_0x488034[_0xd593('0x67')]=qs['sort'](_0x2a1f32[_0xd593('0x42')]['sort']);_0x488034[_0xd593('0x4b')]=qs['filters'](_[_0xd593('0x68')](_0x2a1f32[_0xd593('0x42')],_0x11e93f['filters']));if(_0x2a1f32[_0xd593('0x42')][_0xd593('0x4c')]){_0x488034[_0xd593('0x4b')]=_[_0xd593('0x4d')](_0x488034['where'],{'$or':_[_0xd593('0x41')](_0x488034[_0xd593('0x46')],function(_0x32d24a){var _0x57900b={};_0x57900b[_0x32d24a]={'$like':'%'+_0x2a1f32[_0xd593('0x42')][_0xd593('0x4c')]+'%'};return _0x57900b;})});}_0x488034=_[_0xd593('0x4d')]({},_0x488034,_0x2a1f32[_0xd593('0x56')]);return _0xb6a39f[_0xd593('0xbc')](_0x488034);}})['then'](function(_0x212177){if(_0x212177){_0x3deba3=_0x212177[_0xd593('0x48')];if(!_0x2a1f32[_0xd593('0x42')]['hasOwnProperty'](_0xd593('0x66'))){_0x488034[_0xd593('0x30')]=qs[_0xd593('0x30')](_0x2a1f32[_0xd593('0x42')][_0xd593('0x30')]);_0x488034['offset']=qs[_0xd593('0x2f')](_0x2a1f32[_0xd593('0x42')][_0xd593('0x2f')]);}return _0xb6a39f[_0xd593('0xbc')](_0x488034);}})[_0xd593('0x1f')](function(_0x451b90){if(_0x451b90){return _0x451b90?{'count':_0x3deba3,'rows':_0x451b90}:null;}})[_0xd593('0x1f')](respondWithResult(_0x21b117,null))[_0xd593('0x28')](handleError(_0x21b117,null));};exports[_0xd593('0xbd')]=function(_0x4eff5e,_0x1e738b,_0x5bd0ae){var _0x5da671={'raw':![],'where':{}};var _0xd82ae4={};var _0xe6f395={'count':0x0,'rows':[]};return db[_0xd593('0x51')]['findOne']({'where':{'id':_0x4eff5e[_0xd593('0x55')]['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x1e738b,null))[_0xd593('0x1f')](function(_0x3b8a00){if(_0x3b8a00){_0xd82ae4[_0xd593('0x40')]=_[_0xd593('0x43')](db[_0xd593('0xa4')]['rawAttributes']);_0xd82ae4[_0xd593('0x42')]=_[_0xd593('0x43')](_0x4eff5e[_0xd593('0x42')]);_0xd82ae4[_0xd593('0x44')]=_[_0xd593('0x45')](_0xd82ae4[_0xd593('0x40')],_0xd82ae4[_0xd593('0x42')]);_0x5da671['attributes']=_['intersection'](_0xd82ae4[_0xd593('0x40')],qs['fields'](_0x4eff5e['query'][_0xd593('0x47')]));_0x5da671[_0xd593('0x46')]=_0x5da671[_0xd593('0x46')][_0xd593('0x48')]?_0x5da671[_0xd593('0x46')]:_0xd82ae4['model'];if(!_0x4eff5e[_0xd593('0x42')]['hasOwnProperty'](_0xd593('0x66'))){_0x5da671[_0xd593('0x30')]=qs[_0xd593('0x30')](_0x4eff5e[_0xd593('0x42')][_0xd593('0x30')]);_0x5da671['offset']=qs[_0xd593('0x2f')](_0x4eff5e['query']['offset']);}_0x5da671['order']=qs[_0xd593('0x4a')](_0x4eff5e[_0xd593('0x42')][_0xd593('0x4a')]);_0x5da671['where']=qs['filters'](_[_0xd593('0x68')](_0x4eff5e['query'],_0xd82ae4['filters']));_0x5da671[_0xd593('0x4b')][_0xd593('0x62')]=_0x3b8a00['id'];if(_0x4eff5e['query'][_0xd593('0x4c')]){_0x5da671['where']=_[_0xd593('0x4d')](_0x5da671['where'],{'$or':_[_0xd593('0x41')](_0x5da671['attributes'],function(_0x34570b){var _0x50fde3={};_0x50fde3[_0x34570b]={'$like':'%'+_0x4eff5e[_0xd593('0x42')]['filter']+'%'};return _0x50fde3;})});}_0x5da671=_[_0xd593('0x4d')]({},_0x5da671,_0x4eff5e['options']);return db[_0xd593('0xa4')][_0xd593('0x2e')]({'where':_0x5da671[_0xd593('0x4b')]})[_0xd593('0x1f')](function(_0xbc1f24){_0xe6f395['count']=_0xbc1f24;if(_0x4eff5e[_0xd593('0x42')]['includeAll']){_0x5da671[_0xd593('0x50')]=[{'model':db[_0xd593('0x76')],'as':_0xd593('0xbe'),'required':![]},{'model':db[_0xd593('0xad')],'as':_0xd593('0xbf'),'attributes':[_0xd593('0x39'),_0xd593('0xc0'),'internal'],'required':![]},{'model':db[_0xd593('0xc1')],'as':'Tags','attributes':['id','name','color'],'where':_0x4eff5e[_0xd593('0x42')][_0xd593('0xc2')]?{'id':_0x4eff5e[_0xd593('0x42')][_0xd593('0xc2')]}:undefined,'required':_0x4eff5e['query'][_0xd593('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0xd593('0x52')](_0x5da671);})[_0xd593('0x1f')](function(_0x2c1f92){_0xe6f395['rows']=_0x2c1f92;return _0xe6f395;});}})[_0xd593('0x1f')](respondWithFilteredResult(_0x1e738b,_0x5da671))['catch'](handleError(_0x1e738b,null));};exports[_0xd593('0x3a')]=function(_0x54b8ac,_0x4e1b3f,_0x7137cc){var _0x2f94a8,_0x45ba52,_0x9d6fcd;if(_[_0xd593('0x99')](_0x54b8ac[_0xd593('0x5f')][_0xd593('0x5f')])||_0x54b8ac[_0xd593('0x5f')][_0xd593('0x5f')]===''){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0x9b'));}if(_[_0xd593('0x99')](_0x54b8ac[_0xd593('0x5f')]['to'])){throw new db[(_0xd593('0x77'))][(_0xd593('0x78'))](_0xd593('0xc3'));}_0x2f94a8=_0x54b8ac[_0xd593('0x5f')]['to'];return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x54b8ac[_0xd593('0x55')]['id']},'include':[{'model':db[_0xd593('0xa0')],'as':_0xd593('0xc4'),'include':[{'model':db[_0xd593('0x76')],'as':_0xd593('0xa3'),'where':{'mobile':_0x2f94a8},'limit':0x1,'order':[['updatedAt',_0xd593('0xc5')]]}]}]})[_0xd593('0x1f')](handleEntityNotFound(_0x4e1b3f,null))['then'](function(_0x42002a){if(_0x42002a&&_0x42002a[_0xd593('0xc4')]){_0x45ba52=_0x42002a['get']({'plain':!![]});if(_0x45ba52['List']&&_0x45ba52[_0xd593('0xc4')][_0xd593('0xa3')]['length']){return _0x45ba52[_0xd593('0xc4')][_0xd593('0xa3')][0x0];}return db['CmContact']['create'](_[_0xd593('0x19')](_0x54b8ac[_0xd593('0x5f')],{'firstName':_0x2f94a8,'mobile':_0x2f94a8,'phone':_0x2f94a8,'ListId':_0x45ba52['ListId']}));}})['then'](handleEntityNotFound(_0x4e1b3f,null))[_0xd593('0x1f')](function(_0x1f94ec){if(_0x1f94ec){_0x9d6fcd=_0x1f94ec;return db[_0xd593('0xa4')][_0xd593('0x5c')]({'where':{'ContactId':_0x9d6fcd['id'],'closed':![],'SmsAccountId':_0x45ba52['id']}})[_0xd593('0x1f')](function(_0x10f933){if(_0x10f933){return[_0x10f933,![]];}return db[_0xd593('0xa4')][_0xd593('0x5e')]({'UserId':_0x54b8ac[_0xd593('0x57')]['id'],'ContactId':_0x9d6fcd['id'],'SmsAccountId':_0x45ba52['id'],'phone':_0x2f94a8,'firstMsgDirection':_0xd593('0xc6'),'Messages':[_['merge'](_0x54b8ac[_0xd593('0x5f')],{'read':![],'body':_0x54b8ac['body']['body'],'phone':_0x2f94a8,'SmsAccountId':_0x45ba52['id'],'UserId':_0x54b8ac[_0xd593('0x57')]['id'],'ContactId':_0x9d6fcd['id']})]},{'include':[{'model':db[_0xd593('0xc7')],'as':_0xd593('0xc8')}]})[_0xd593('0x1f')](function(_0x319974){return[_0x319974,!![]];});});}})[_0xd593('0xc9')](function(_0x1bfc3f,_0x267e9d){if(_0x267e9d){return _0x1bfc3f;}return db[_0xd593('0xc7')]['create'](_['merge'](_0x54b8ac[_0xd593('0x5f')],{'read':![],'body':_0x54b8ac[_0xd593('0x5f')][_0xd593('0x5f')],'phone':_0x2f94a8,'SmsAccountId':_0x45ba52['id'],'SmsInteractionId':_0x1bfc3f['id'],'UserId':_0x54b8ac[_0xd593('0x57')]['id'],'ContactId':_0x9d6fcd['id']}))[_0xd593('0x1f')](function(_0x3c3eb0){_0x1bfc3f[_0xd593('0xca')]['Messages']=[];_0x1bfc3f[_0xd593('0xca')]['Messages'][_0xd593('0xa8')](_0x3c3eb0['dataValues']);return _0x1bfc3f;});})[_0xd593('0x1f')](respondWithResult(_0x4e1b3f,null))[_0xd593('0x28')](handleError(_0x4e1b3f,null));};exports[_0xd593('0x2a')]=function(_0x5dfe46,_0x3be700,_0x99f34f){if(_0x5dfe46[_0xd593('0x5f')]['id']){delete _0x5dfe46['body']['id'];}var _0x31a94e,_0x5d72dd,_0x20ce44;return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x5dfe46[_0xd593('0x55')]['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x3be700,null))[_0xd593('0x1f')](function(_0x2018f0){if(_0x2018f0){_0x20ce44=_0x2018f0;logger[_0xd593('0xcb')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd593('0x2a'),_0xd593('0xcc'),_0x2018f0[_0xd593('0x7f')],util[_0xd593('0xcd')](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2018f0[_0xd593('0x7f')]){case _0xd593('0x85'):if(_0x5dfe46[_0xd593('0x5f')][_0xd593('0xce')]&&_0x5dfe46[_0xd593('0x5f')][_0xd593('0x2a')]){_0x5d72dd=_0x5dfe46['body'][_0xd593('0x2a')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x5dfe46[_0xd593('0x5f')]['skebby_dispatch_id']}});}break;case _0xd593('0x87'):if(_0x5dfe46[_0xd593('0x5f')][_0xd593('0xcf')]&&_0x5dfe46[_0xd593('0x5f')][_0xd593('0xd0')]){_0x5d72dd=_0x5dfe46[_0xd593('0x5f')][_0xd593('0xd0')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x5dfe46[_0xd593('0x5f')][_0xd593('0xcf')]}});}break;case _0xd593('0x89'):if(_0x5dfe46['body'][_0xd593('0x8a')]&&_0x5dfe46[_0xd593('0x5f')][_0xd593('0xd1')]){_0x5d72dd=_0x5dfe46[_0xd593('0x5f')][_0xd593('0xd1')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x5dfe46['body'][_0xd593('0x8a')]}});}break;case _0xd593('0x8e'):var _0x4bc453=_0x5dfe46['body']['results'][0x0];if(_0x4bc453[_0xd593('0x83')]&&_0x4bc453[_0xd593('0x2a')][_0xd593('0xd2')]===_0xd593('0xd3')){_0x5d72dd=_0x4bc453[_0xd593('0x2a')][_0xd593('0xd2')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x4bc453['messageId']}});}break;case _0xd593('0x92'):if(_0x5dfe46['body'][_0xd593('0x83')]&&_0x5dfe46['body']['status']){_0x5d72dd=_0x5dfe46['body'][_0xd593('0x2a')];return db[_0xd593('0xc7')]['find']({'where':{'messageId':_0x5dfe46[_0xd593('0x5f')]['messageId']}});}break;case _0xd593('0x96'):if(_0x5dfe46[_0xd593('0x5f')][0x0][_0xd593('0x26')]['id']){_0x5d72dd=_0x5dfe46[_0xd593('0x5f')][0x0][_0xd593('0x7f')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x5dfe46[_0xd593('0x5f')][0x0]['message']['id']}});}break;case _0xd593('0x97'):if(_0x5dfe46['body'][_0xd593('0xd4')]&&_0x5dfe46[_0xd593('0x5f')][_0xd593('0x2a')]){_0x5d72dd=_0x5dfe46[_0xd593('0x5f')][_0xd593('0x2a')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x5dfe46[_0xd593('0x5f')][_0xd593('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x3be700,null))[_0xd593('0x1f')](function(_0x2eabfc){if(_0x2eabfc){_0x31a94e=_0x2eabfc;switch(_0x20ce44[_0xd593('0x7f')]){case'skebby':if(_0x5d72dd===_0xd593('0xd3')){return _0x31a94e['update']({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),'status',_0xd593('0x85'),util[_0xd593('0xcd')](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xd593('0x87'):if(_0x5d72dd==='1'){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),_0xd593('0x2a'),_0xd593('0x85'),util[_0xd593('0xcd')](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5dfe46['body'][_0xd593('0xd5')]&&_0x5d72dd>=0xc8&&_0x5d72dd<=0xce){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger['error'](_0xd593('0x23'),_0xd593('0x2a'),_0xd593('0x89'),util['inspect'](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x585cb8=_0x5dfe46[_0xd593('0x5f')][_0xd593('0x8f')][0x0];if(_0x585cb8[_0xd593('0x2a')]['groupName']===_0xd593('0xd3')){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),_0xd593('0x2a'),_0xd593('0x8e'),util[_0xd593('0xcd')](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xd593('0x92'):if(_0x5d72dd==_0xd593('0xd6')||_0x5d72dd==_0xd593('0xd7')){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),_0xd593('0x2a'),_0xd593('0x92'),util['inspect'](_0x5dfe46['body'],{'showHidden':![],'depth':null}));}break;case _0xd593('0x96'):if(_0x5d72dd==_0xd593('0xd8')){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd593('0x96'),util[_0xd593('0xcd')](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xd593('0x97'):if(_0x5d72dd===_0xd593('0xd9')||_0x5d72dd==='ACCEPTD'){return _0x31a94e[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),_0xd593('0x2a'),_0xd593('0x97'),util['inspect'](_0x5dfe46[_0xd593('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x31a94e;}})['then'](respondWithResult(_0x3be700,null))[_0xd593('0x28')](handleError(_0x3be700,null));};exports[_0xd593('0xda')]=function(_0x268049,_0x298bfa,_0x35fbe0){var _0x484471,_0x1049f4,_0x1d3221;return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x268049[_0xd593('0x55')]['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x298bfa,null))[_0xd593('0x1f')](function(_0x37e7a9){if(_0x37e7a9){_0x1d3221=_0x37e7a9;logger['debug'](_0xd593('0x23'),'status',_0xd593('0xcc'),_0x37e7a9[_0xd593('0x7f')],util[_0xd593('0xcd')](_0x268049[_0xd593('0x42')],{'showHidden':![],'depth':null}));switch(_0x37e7a9[_0xd593('0x7f')]){case _0xd593('0x90'):if(_0x268049['query'][_0xd593('0xdb')]&&_0x268049['query']['state']){_0x1049f4=_0x268049[_0xd593('0x42')][_0xd593('0xdc')];return db[_0xd593('0xc7')][_0xd593('0x5c')]({'where':{'messageId':_0x268049[_0xd593('0x42')][_0xd593('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x298bfa,null))['then'](function(_0x208748){if(_0x208748){_0x484471=_0x208748;switch(_0x1d3221[_0xd593('0x7f')]){case _0xd593('0x90'):if(_0x1049f4==='2'||_0x1049f4==='6'){return _0x484471[_0xd593('0x35')]({'read':!![]});}else{logger[_0xd593('0x25')](_0xd593('0x23'),'status',_0xd593('0x90'),util[_0xd593('0xcd')](_0x268049[_0xd593('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x484471;}})[_0xd593('0x1f')](respondWithResult(_0x298bfa,null))[_0xd593('0x28')](handleError(_0x298bfa,null));};exports[_0xd593('0xdd')]=function(_0x3389fb,_0x81389b,_0x25ac91){return db[_0xd593('0x51')][_0xd593('0x5c')]({'where':{'id':_0x3389fb['params']['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x81389b,null))[_0xd593('0x1f')](function(_0x3040b1){if(_0x3040b1){return _0x3040b1[_0xd593('0xdd')](_0x3389fb[_0xd593('0x5f')][_0xd593('0x6a')],_['omit'](_0x3389fb[_0xd593('0x5f')],[_0xd593('0x6a'),'id'])||{})[_0xd593('0xc9')](function(_0x1e0893){for(var _0xc763d2=0x0;_0xc763d2<_0x3389fb[_0xd593('0x5f')][_0xd593('0x6a')][_0xd593('0x48')];_0xc763d2+=0x1){socket['emit'](_0xd593('0xde'),{'UserId':Number(_0x3389fb[_0xd593('0x5f')][_0xd593('0x6a')][_0xc763d2]),'SmsAccountId':Number(_0x3389fb[_0xd593('0x55')]['id'])});}return _0x1e0893;});}})['then'](respondWithResult(_0x81389b,null))['catch'](handleError(_0x81389b,null));};exports['removeAgents']=function(_0x5d0829,_0x3b092a,_0x448247){return db[_0xd593('0x51')]['find']({'where':{'id':_0x5d0829[_0xd593('0x55')]['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x3b092a,null))['then'](function(_0x410ca9){if(_0x410ca9){return _0x410ca9[_0xd593('0xdf')](_0x5d0829[_0xd593('0x42')]['ids'])['then'](function(){if(_[_0xd593('0xe0')](_0x5d0829['query'][_0xd593('0x6a')])){for(var _0x216c45=0x0;_0x216c45<_0x5d0829[_0xd593('0x42')][_0xd593('0x6a')]['length'];_0x216c45+=0x1){socket[_0xd593('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x5d0829[_0xd593('0x42')]['ids'][_0x216c45]),'SmsAccountId':Number(_0x5d0829[_0xd593('0x55')]['id'])});}}else{socket['emit'](_0xd593('0xe2'),{'UserId':Number(_0x5d0829[_0xd593('0x42')][_0xd593('0x6a')]),'SmsAccountId':Number(_0x5d0829['params']['id'])});}});}})[_0xd593('0x1f')](respondWithStatusCode(_0x3b092a,null))[_0xd593('0x28')](handleError(_0x3b092a,null));};exports[_0xd593('0xe3')]=function(_0x288b04,_0x6a4302,_0x22f9f7){var _0x4d0b9a={};var _0x1b35e9={};var _0x13f642;var _0x2a4e3b;return db[_0xd593('0x51')][_0xd593('0x65')]({'where':{'id':_0x288b04['params']['id']}})[_0xd593('0x1f')](handleEntityNotFound(_0x6a4302,null))[_0xd593('0x1f')](function(_0xc5563e){if(_0xc5563e){_0x13f642=_0xc5563e;_0x1b35e9[_0xd593('0x40')]=_[_0xd593('0x43')](db[_0xd593('0xad')][_0xd593('0x3e')]);_0x1b35e9[_0xd593('0x42')]=_['keys'](_0x288b04[_0xd593('0x42')]);_0x1b35e9[_0xd593('0x44')]=_[_0xd593('0x45')](_0x1b35e9['model'],_0x1b35e9[_0xd593('0x42')]);_0x4d0b9a[_0xd593('0x46')]=_[_0xd593('0x45')](_0x1b35e9[_0xd593('0x40')],qs['fields'](_0x288b04[_0xd593('0x42')][_0xd593('0x47')]));_0x4d0b9a[_0xd593('0x46')]=_0x4d0b9a['attributes'][_0xd593('0x48')]?_0x4d0b9a['attributes']:_0x1b35e9[_0xd593('0x40')];_0x4d0b9a[_0xd593('0x67')]=qs[_0xd593('0x4a')](_0x288b04[_0xd593('0x42')][_0xd593('0x4a')]);_0x4d0b9a[_0xd593('0x4b')]=qs[_0xd593('0x44')](_['pick'](_0x288b04[_0xd593('0x42')],_0x1b35e9[_0xd593('0x44')]));if(_0x288b04[_0xd593('0x42')]['filter']){_0x4d0b9a[_0xd593('0x4b')]=_['merge'](_0x4d0b9a[_0xd593('0x4b')],{'$or':_[_0xd593('0x41')](_0x4d0b9a[_0xd593('0x46')],function(_0x2aeb14){var _0x374e56={};_0x374e56[_0x2aeb14]={'$like':'%'+_0x288b04[_0xd593('0x42')][_0xd593('0x4c')]+'%'};return _0x374e56;})});}_0x4d0b9a=_['merge']({},_0x4d0b9a,_0x288b04['options']);return _0x13f642[_0xd593('0xe3')](_0x4d0b9a);}})[_0xd593('0x1f')](function(_0x16cccc){if(_0x16cccc){_0x2a4e3b=_0x16cccc['length'];if(!_0x288b04[_0xd593('0x42')][_0xd593('0x49')](_0xd593('0x66'))){_0x4d0b9a[_0xd593('0x30')]=qs[_0xd593('0x30')](_0x288b04[_0xd593('0x42')][_0xd593('0x30')]);_0x4d0b9a[_0xd593('0x2f')]=qs[_0xd593('0x2f')](_0x288b04[_0xd593('0x42')][_0xd593('0x2f')]);}return _0x13f642[_0xd593('0xe3')](_0x4d0b9a);}})[_0xd593('0x1f')](function(_0xe5c19b){if(_0xe5c19b){return _0xe5c19b?{'count':_0x2a4e3b,'rows':_0xe5c19b}:null;}})[_0xd593('0x1f')](respondWithResult(_0x6a4302,null))['catch'](handleError(_0x6a4302,null));}; \ No newline at end of file +var _0xcb33=['destroy','SmsAccounts','UserProfileResource','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','params','mandatoryDispositionPause','keys','fields','find','create','body','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','twilio','From','Body','MessageSid','skebby','from','sender','text','connectel','clicksend','plivo','MessageUUID','infobip','results','messageId','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','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','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','pick','Contact','User','Owner','fullname','internal','Tag','Tags','tag','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','clickatell','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','state','csc','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','json','limit','count','status','set','Content-Range','apply','reject','save','update','then'];(function(_0x2986d9,_0x542e58){var _0x2fbd2c=function(_0x988538){while(--_0x988538){_0x2986d9['push'](_0x2986d9['shift']());}};_0x2fbd2c(++_0x542e58);}(_0xcb33,0xae));var _0x3cb3=function(_0x1f860e,_0x19efa5){_0x1f860e=_0x1f860e-0x0;var _0x1d16d6=_0xcb33[_0x1f860e];return _0x1d16d6;};'use strict';var emlformat=require(_0x3cb3('0x0'));var rimraf=require(_0x3cb3('0x1'));var zipdir=require(_0x3cb3('0x2'));var jsonpatch=require(_0x3cb3('0x3'));var rp=require('request-promise');var moment=require(_0x3cb3('0x4'));var BPromise=require(_0x3cb3('0x5'));var Mustache=require('mustache');var util=require(_0x3cb3('0x6'));var path=require(_0x3cb3('0x7'));var sox=require(_0x3cb3('0x8'));var csv=require(_0x3cb3('0x9'));var ejs=require(_0x3cb3('0xa'));var fs=require('fs');var fs_extra=require(_0x3cb3('0xb'));var _=require(_0x3cb3('0xc'));var squel=require('squel');var crypto=require(_0x3cb3('0xd'));var jsforce=require(_0x3cb3('0xe'));var deskjs=require(_0x3cb3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3cb3('0x10'));var Papa=require(_0x3cb3('0x11'));var Redis=require(_0x3cb3('0x12'));var authService=require(_0x3cb3('0x13'));var qs=require(_0x3cb3('0x14'));var as=require(_0x3cb3('0x15'));var hardwareService=require(_0x3cb3('0x16'));var logger=require(_0x3cb3('0x17'))('api');var utils=require(_0x3cb3('0x18'));var config=require(_0x3cb3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3cb3('0x1a'))['db'];config['redis']=_[_0x3cb3('0x1b')](config[_0x3cb3('0x1c')],{'host':_0x3cb3('0x1d'),'port':0x18eb});var socket=require(_0x3cb3('0x1e'))(new Redis(config[_0x3cb3('0x1c')]));require(_0x3cb3('0x1f'))[_0x3cb3('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3cb3('0x21')][_0x3cb3('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x34739d,_0x4a340c,_0x251049,_0xf83850){return new BPromise(function(_0x272f01,_0x12f52f){var _0xfa8bf7=_0xf83850||client;return _0xfa8bf7[_0x3cb3('0x23')](_0x34739d,_0x251049)['then'](function(_0x3e714d){logger[_0x3cb3('0x24')](_0x3cb3('0x25'),_0x4a340c,_0x3cb3('0x26'));logger[_0x3cb3('0x27')](_0x3cb3('0x28'),_0x4a340c,'request\x20sent',JSON['stringify'](_0x3e714d));if(_0x3e714d[_0x3cb3('0x29')]){if(_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2a')]===0x1f4){logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s',_0x4a340c,_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);return _0x12f52f(_0x3e714d[_0x3cb3('0x29')]['message']);}logger[_0x3cb3('0x29')](_0x3cb3('0x25'),_0x4a340c,_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);return _0x272f01(_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);}else{logger[_0x3cb3('0x24')](_0x3cb3('0x25'),_0x4a340c,_0x3cb3('0x26'));_0x272f01(_0x3e714d[_0x3cb3('0x2c')][_0x3cb3('0x2b')]);}})[_0x3cb3('0x2d')](function(_0x173325){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4a340c,_0x173325);_0x12f52f(_0x173325);});});}function respondWithStatusCode(_0x36c188,_0x96279d){_0x96279d=_0x96279d||0xcc;return function(_0x336c6d){if(_0x336c6d){return _0x36c188[_0x3cb3('0x2e')](_0x96279d);}return _0x36c188['status'](_0x96279d)[_0x3cb3('0x2f')]();};}function respondWithResult(_0x543ae8,_0x3f67e4){_0x3f67e4=_0x3f67e4||0xc8;return function(_0x4c480a){if(_0x4c480a){return _0x543ae8['status'](_0x3f67e4)[_0x3cb3('0x30')](_0x4c480a);}};}function respondWithFilteredResult(_0x19004a,_0x339a65){return function(_0x31a01d){if(_0x31a01d){var _0x58e33f=typeof _0x339a65['offset']==='undefined'&&typeof _0x339a65[_0x3cb3('0x31')]==='undefined';var _0x9639e6=_0x31a01d[_0x3cb3('0x32')];var _0x43963c=_0x58e33f?0x0:_0x339a65['offset'];var _0x3a2b99=_0x58e33f?_0x31a01d[_0x3cb3('0x32')]:_0x339a65['offset']+_0x339a65['limit'];var _0x4a6ad4;if(_0x3a2b99>=_0x9639e6){_0x3a2b99=_0x9639e6;_0x4a6ad4=0xc8;}else{_0x4a6ad4=0xce;}_0x19004a[_0x3cb3('0x33')](_0x4a6ad4);return _0x19004a[_0x3cb3('0x34')](_0x3cb3('0x35'),_0x43963c+'-'+_0x3a2b99+'/'+_0x9639e6)[_0x3cb3('0x30')](_0x31a01d);}return null;};}function patchUpdates(_0x594219){return function(_0x25e586){try{jsonpatch[_0x3cb3('0x36')](_0x25e586,_0x594219,!![]);}catch(_0x59692c){return BPromise[_0x3cb3('0x37')](_0x59692c);}return _0x25e586[_0x3cb3('0x38')]();};}function saveUpdates(_0xb5430,_0x1f987c){return function(_0x5a383a){if(_0x5a383a){return _0x5a383a[_0x3cb3('0x39')](_0xb5430)[_0x3cb3('0x3a')](function(_0x71cf8c){return _0x71cf8c;});}return null;};}function removeEntity(_0x358b5b,_0x429441){return function(_0x5d41c0){if(_0x5d41c0){return _0x5d41c0[_0x3cb3('0x3b')]()[_0x3cb3('0x3a')](function(){var _0x229433=_0x5d41c0['get']({'plain':!![]});var _0x4ad27a=_0x3cb3('0x3c');return db[_0x3cb3('0x3d')][_0x3cb3('0x3b')]({'where':{'type':_0x4ad27a,'resourceId':_0x229433['id']}})[_0x3cb3('0x3a')](function(){return _0x5d41c0;});})[_0x3cb3('0x3a')](function(){_0x358b5b[_0x3cb3('0x33')](0xcc)[_0x3cb3('0x2f')]();});}};}function handleEntityNotFound(_0x4b2a98,_0x2edb66){return function(_0x494e9c){if(!_0x494e9c){_0x4b2a98[_0x3cb3('0x2e')](0x194);}return _0x494e9c;};}function handleError(_0x3ed687,_0x2c0b14){_0x2c0b14=_0x2c0b14||0x1f4;return function(_0x55c2d9){logger['error'](_0x55c2d9['stack']);if(_0x55c2d9[_0x3cb3('0x3e')]){delete _0x55c2d9[_0x3cb3('0x3e')];}_0x3ed687[_0x3cb3('0x33')](_0x2c0b14)[_0x3cb3('0x3f')](_0x55c2d9);};}exports[_0x3cb3('0x40')]=function(_0x2f026c,_0x32f914){var _0x50fa2c={'include':[{'model':db[_0x3cb3('0x41')],'as':'mandatoryDispositionPause'}]},_0x309e45={},_0x123821={'count':0x0,'rows':[]};var _0x50bd6e=_[_0x3cb3('0x42')](db[_0x3cb3('0x43')][_0x3cb3('0x44')],function(_0x579fe1){return{'name':_0x579fe1[_0x3cb3('0x45')],'type':_0x579fe1[_0x3cb3('0x46')][_0x3cb3('0x47')]};});_0x309e45[_0x3cb3('0x48')]=_[_0x3cb3('0x42')](_0x50bd6e,_0x3cb3('0x3e'));_0x309e45[_0x3cb3('0x49')]=_['keys'](_0x2f026c[_0x3cb3('0x49')]);_0x309e45[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x309e45['model'],_0x309e45['query']);_0x50fa2c[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x309e45['model'],qs['fields'](_0x2f026c['query']['fields']));_0x50fa2c[_0x3cb3('0x4c')]=_0x50fa2c[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x50fa2c[_0x3cb3('0x4c')]:_0x309e45['model'];if(!_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0x50fa2c[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x50fa2c[_0x3cb3('0x50')]=qs['offset'](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x50')]);}_0x50fa2c[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x52')]);_0x50fa2c[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_['pick'](_0x2f026c[_0x3cb3('0x49')],_0x309e45[_0x3cb3('0x4a')]),_0x50bd6e);if(_0x2f026c['query'][_0x3cb3('0x54')]){_0x50fa2c[_0x3cb3('0x53')]=_['merge'](_0x50fa2c[_0x3cb3('0x53')],{'$or':_['map'](_0x50bd6e,function(_0x1545fd){if(_0x1545fd[_0x3cb3('0x46')]!=='VIRTUAL'){var _0x2e4598={};_0x2e4598[_0x1545fd[_0x3cb3('0x3e')]]={'$like':'%'+_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x2e4598;}})});}_0x50fa2c=_[_0x3cb3('0x55')]({},_0x50fa2c,_0x2f026c[_0x3cb3('0x56')]);var _0xf0fc8={'where':_0x50fa2c[_0x3cb3('0x53')]};return db[_0x3cb3('0x43')][_0x3cb3('0x32')](_0xf0fc8)[_0x3cb3('0x3a')](function(_0x3e7913){_0x123821['count']=_0x3e7913;if(_0x2f026c['query'][_0x3cb3('0x57')]){_0x50fa2c[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x43')][_0x3cb3('0x59')](_0x50fa2c);})[_0x3cb3('0x3a')](function(_0x589210){_0x123821['rows']=_0x589210;return _0x123821;})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x32f914,_0x50fa2c))[_0x3cb3('0x2d')](handleError(_0x32f914,null));};exports['show']=function(_0x1575b2,_0x2daaa1){var _0x4c2d8a={'raw':![],'where':{'id':_0x1575b2[_0x3cb3('0x5a')]['id']},'include':[{'model':db[_0x3cb3('0x41')],'as':_0x3cb3('0x5b')}]},_0x5af24a={};_0x5af24a['model']=_[_0x3cb3('0x5c')](db[_0x3cb3('0x43')][_0x3cb3('0x44')]);_0x5af24a[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x1575b2[_0x3cb3('0x49')]);_0x5af24a['filters']=_['intersection'](_0x5af24a[_0x3cb3('0x48')],_0x5af24a[_0x3cb3('0x49')]);_0x4c2d8a[_0x3cb3('0x4c')]=_['intersection'](_0x5af24a[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x1575b2['query']['fields']));_0x4c2d8a[_0x3cb3('0x4c')]=_0x4c2d8a['attributes']['length']?_0x4c2d8a[_0x3cb3('0x4c')]:_0x5af24a[_0x3cb3('0x48')];if(_0x1575b2['query'][_0x3cb3('0x57')]){_0x4c2d8a['include']=[{'all':!![]}];}_0x4c2d8a=_[_0x3cb3('0x55')]({},_0x4c2d8a,_0x1575b2[_0x3cb3('0x56')]);return db[_0x3cb3('0x43')][_0x3cb3('0x5e')](_0x4c2d8a)[_0x3cb3('0x3a')](handleEntityNotFound(_0x2daaa1,null))[_0x3cb3('0x3a')](respondWithResult(_0x2daaa1,null))['catch'](handleError(_0x2daaa1,null));};exports[_0x3cb3('0x5f')]=function(_0x15aa08,_0x1f4c00){return db[_0x3cb3('0x43')]['create'](_0x15aa08[_0x3cb3('0x60')],{})['then'](function(_0x150525){var _0x38623c=_0x15aa08[_0x3cb3('0x61')][_0x3cb3('0x62')]({'plain':!![]});if(!_0x38623c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38623c[_0x3cb3('0x63')]==='user'){var _0x59949e=_0x150525[_0x3cb3('0x62')]({'plain':!![]});var _0x3d6736=_0x3cb3('0x3c');return db['UserProfileSection'][_0x3cb3('0x5e')]({'where':{'name':_0x3d6736,'userProfileId':_0x38623c[_0x3cb3('0x64')]},'raw':!![]})[_0x3cb3('0x3a')](function(_0x4f12f6){if(_0x4f12f6&&_0x4f12f6['autoAssociation']===0x0){return db[_0x3cb3('0x3d')][_0x3cb3('0x5f')]({'name':_0x59949e[_0x3cb3('0x3e')],'resourceId':_0x59949e['id'],'type':_0x4f12f6[_0x3cb3('0x3e')],'sectionId':_0x4f12f6['id']},{})['then'](function(){return _0x150525;});}else{return _0x150525;}})['catch'](function(_0x33077a){logger['error'](_0x3cb3('0x65'),_0x33077a);throw _0x33077a;});}return _0x150525;})[_0x3cb3('0x3a')](respondWithResult(_0x1f4c00,0xc9))[_0x3cb3('0x2d')](handleError(_0x1f4c00,null));};exports[_0x3cb3('0x39')]=function(_0x4c4a9c,_0x3c25c9){if(_0x4c4a9c[_0x3cb3('0x60')]['id']){delete _0x4c4a9c[_0x3cb3('0x60')]['id'];}return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x4c4a9c[_0x3cb3('0x5a')]['id']},'include':[{'model':db[_0x3cb3('0x41')],'as':_0x3cb3('0x5b')}]})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3c25c9,null))['then'](saveUpdates(_0x4c4a9c[_0x3cb3('0x60')],null))[_0x3cb3('0x3a')](respondWithResult(_0x3c25c9,null))['catch'](handleError(_0x3c25c9,null));};exports[_0x3cb3('0x3b')]=function(_0x1d8efc,_0xa3c660){return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x1d8efc['params']['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0xa3c660,null))['then'](removeEntity(_0xa3c660,null))[_0x3cb3('0x2d')](handleError(_0xa3c660,null));};exports[_0x3cb3('0x66')]=function(_0x320615,_0x112ccf){return db[_0x3cb3('0x43')]['describe']()[_0x3cb3('0x3a')](respondWithResult(_0x112ccf,null))[_0x3cb3('0x2d')](handleError(_0x112ccf,null));};exports[_0x3cb3('0x67')]=function(_0x5d1f20,_0x24ad31,_0x56eaa6){if(_0x5d1f20['body']['id']){delete _0x5d1f20['body']['id'];}return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x5d1f20[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x24ad31,null))[_0x3cb3('0x3a')](function(_0x42ca0d){if(_0x42ca0d){_0x5d1f20[_0x3cb3('0x60')][_0x3cb3('0x68')]=_0x42ca0d['id'];return db['Disposition'][_0x3cb3('0x5f')](_0x5d1f20[_0x3cb3('0x60')]);}})[_0x3cb3('0x3a')](respondWithResult(_0x24ad31,null))[_0x3cb3('0x2d')](handleError(_0x24ad31,null));};exports[_0x3cb3('0x69')]=function(_0x4737eb,_0x4d6461,_0x12933e){var _0x4d5819={'raw':![],'where':{}};var _0x2827d9={};var _0x1774ee={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4737eb[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x4d6461,null))[_0x3cb3('0x3a')](function(_0x164596){if(_0x164596){_0x2827d9[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0x6a')][_0x3cb3('0x44')]);_0x2827d9[_0x3cb3('0x49')]=_['keys'](_0x4737eb['query']);_0x2827d9[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x2827d9[_0x3cb3('0x48')],_0x2827d9[_0x3cb3('0x49')]);_0x4d5819[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x2827d9[_0x3cb3('0x48')],qs['fields'](_0x4737eb[_0x3cb3('0x49')]['fields']));_0x4d5819[_0x3cb3('0x4c')]=_0x4d5819[_0x3cb3('0x4c')]['length']?_0x4d5819[_0x3cb3('0x4c')]:_0x2827d9[_0x3cb3('0x48')];if(!_0x4737eb[_0x3cb3('0x49')]['hasOwnProperty']('nolimit')){_0x4d5819['limit']=qs[_0x3cb3('0x31')](_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x4d5819[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4737eb[_0x3cb3('0x49')]['offset']);}_0x4d5819['order']=qs['sort'](_0x4737eb[_0x3cb3('0x49')]['sort']);_0x4d5819[_0x3cb3('0x53')]=qs['filters'](_['pick'](_0x4737eb[_0x3cb3('0x49')],_0x2827d9[_0x3cb3('0x4a')]));_0x4d5819['where'][_0x3cb3('0x68')]=_0x164596['id'];if(_0x4737eb[_0x3cb3('0x49')]['filter']){_0x4d5819[_0x3cb3('0x53')]=_[_0x3cb3('0x55')](_0x4d5819[_0x3cb3('0x53')],{'$or':_['map'](_0x4d5819['attributes'],function(_0x7f2ebe){var _0x1926bb={};_0x1926bb[_0x7f2ebe]={'$like':'%'+_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x1926bb;})});}_0x4d5819=_['merge']({},_0x4d5819,_0x4737eb[_0x3cb3('0x56')]);return db[_0x3cb3('0x6a')][_0x3cb3('0x32')]({'where':_0x4d5819[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0x108536){_0x1774ee[_0x3cb3('0x32')]=_0x108536;if(_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x4d5819[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x6a')][_0x3cb3('0x59')](_0x4d5819);})[_0x3cb3('0x3a')](function(_0x503ae3){_0x1774ee[_0x3cb3('0x6b')]=_0x503ae3;return _0x1774ee;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x4d6461,_0x4d5819))[_0x3cb3('0x2d')](handleError(_0x4d6461,null));};exports[_0x3cb3('0x6c')]=function(_0x4c9c4c,_0x17d625,_0x12ad51){return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x4c9c4c['params']['id']}})['then'](handleEntityNotFound(_0x17d625,null))['then'](function(_0x2414ea){if(_0x2414ea){return _0x2414ea[_0x3cb3('0x6c')](_0x4c9c4c[_0x3cb3('0x49')][_0x3cb3('0x6d')]);}})[_0x3cb3('0x3a')](respondWithStatusCode(_0x17d625,null))['catch'](handleError(_0x17d625,null));};exports[_0x3cb3('0x6e')]=function(_0x476017,_0x316aba,_0x254e3b){if(_0x476017[_0x3cb3('0x60')]['id']){delete _0x476017['body']['id'];}return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x476017[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x316aba,null))[_0x3cb3('0x3a')](function(_0x2441d8){if(_0x2441d8){_0x476017[_0x3cb3('0x60')][_0x3cb3('0x68')]=_0x2441d8['id'];return db['CannedAnswer']['create'](_0x476017[_0x3cb3('0x60')]);}})[_0x3cb3('0x3a')](respondWithResult(_0x316aba,null))['catch'](handleError(_0x316aba,null));};exports['getAnswers']=function(_0x4db0f5,_0x1e3249,_0x4367f3){var _0x276110={'raw':![],'where':{}};var _0x2b7295={};var _0x2802ed={'count':0x0,'rows':[]};return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x4db0f5[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e3249,null))[_0x3cb3('0x3a')](function(_0x45cde3){if(_0x45cde3){_0x2b7295[_0x3cb3('0x48')]=_['keys'](db['CannedAnswer'][_0x3cb3('0x44')]);_0x2b7295[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x4db0f5[_0x3cb3('0x49')]);_0x2b7295[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x2b7295[_0x3cb3('0x48')],_0x2b7295['query']);_0x276110['attributes']=_[_0x3cb3('0x4b')](_0x2b7295[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x4db0f5[_0x3cb3('0x49')]['fields']));_0x276110[_0x3cb3('0x4c')]=_0x276110[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x276110[_0x3cb3('0x4c')]:_0x2b7295[_0x3cb3('0x48')];if(!_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0x276110[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x4db0f5[_0x3cb3('0x49')]['limit']);_0x276110[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x50')]);}_0x276110[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x4db0f5[_0x3cb3('0x49')]['sort']);_0x276110['where']=qs[_0x3cb3('0x4a')](_['pick'](_0x4db0f5[_0x3cb3('0x49')],_0x2b7295[_0x3cb3('0x4a')]));_0x276110[_0x3cb3('0x53')][_0x3cb3('0x68')]=_0x45cde3['id'];if(_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x54')]){_0x276110[_0x3cb3('0x53')]=_['merge'](_0x276110[_0x3cb3('0x53')],{'$or':_[_0x3cb3('0x42')](_0x276110[_0x3cb3('0x4c')],function(_0x3b226c){var _0x4f4cb5={};_0x4f4cb5[_0x3b226c]={'$like':'%'+_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x4f4cb5;})});}_0x276110=_[_0x3cb3('0x55')]({},_0x276110,_0x4db0f5[_0x3cb3('0x56')]);return db[_0x3cb3('0x70')][_0x3cb3('0x32')]({'where':_0x276110[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0xa60685){_0x2802ed[_0x3cb3('0x32')]=_0xa60685;if(_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x276110[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x70')][_0x3cb3('0x59')](_0x276110);})[_0x3cb3('0x3a')](function(_0x3f8730){_0x2802ed[_0x3cb3('0x6b')]=_0x3f8730;return _0x2802ed;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x1e3249,_0x276110))[_0x3cb3('0x2d')](handleError(_0x1e3249,null));};exports[_0x3cb3('0x71')]=function(_0x52c2e2,_0x2a560c,_0x55cd97){return db['SmsAccount'][_0x3cb3('0x5e')]({'where':{'id':_0x52c2e2['params']['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x2a560c,null))['then'](function(_0x5133a4){if(_0x5133a4){return _0x5133a4[_0x3cb3('0x71')](_0x52c2e2[_0x3cb3('0x49')][_0x3cb3('0x6d')]);}})['then'](respondWithStatusCode(_0x2a560c,null))['catch'](handleError(_0x2a560c,null));};exports['notify']=function(_0x13321d,_0xc7163d,_0x12aada){var _0x24e949={'channel':_0x3cb3('0x72')};var _0x53d5fa=[];var _0x2afbce=[];var _0x28a9ce={};return db['SmsAccount']['find']({'where':{'id':_0x13321d[_0x3cb3('0x5a')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x3cb3('0x73')}]})['then'](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x5587a1){_0x24e949[_0x3cb3('0x74')]=_0x5587a1;_0x24e949[_0x3cb3('0x75')]=_[_0x3cb3('0x76')](_0x5587a1['Applications'],[_0x3cb3('0x77')],[_0x3cb3('0x78')]);if(_0x24e949['account'][_0x3cb3('0x73')]){delete _0x24e949[_0x3cb3('0x74')][_0x3cb3('0x73')];}return db[_0x3cb3('0x79')][_0x3cb3('0x66')]();})[_0x3cb3('0x3a')](function(_0xb13c43){if(!_0xb13c43){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))]('no\x20available\x20attributes');}_0x53d5fa=_[_0x3cb3('0x7c')](_[_0x3cb3('0x5c')](_0xb13c43),['createdAt',_0x3cb3('0x7d')]);_0x2afbce=_['difference'](_['keys'](_0xb13c43),[_0x3cb3('0x7e'),_0x3cb3('0x7d'),_0x3cb3('0x7f'),_0x3cb3('0x80')]);_0x24e949[_0x3cb3('0x60')]={'mapKey':'mobile'};if(_0x24e949[_0x3cb3('0x74')][_0x3cb3('0x46')]){switch(_0x24e949[_0x3cb3('0x74')]['type']){case _0x3cb3('0x81'):_0x24e949[_0x3cb3('0x60')]['from']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x82')];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x83')];_0x24e949['body']['messageId']=_0x13321d['body'][_0x3cb3('0x84')];break;case _0x3cb3('0x85'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]='+'+_0x13321d['body'][_0x3cb3('0x87')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x88')];break;case _0x3cb3('0x89'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x2b')];break;case _0x3cb3('0x8a'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d['body'][_0x3cb3('0x86')];_0x24e949['body'][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x60')];_0x24e949[_0x3cb3('0x60')]['messageId']=_0x13321d[_0x3cb3('0x60')]['message_id'];break;case _0x3cb3('0x8b'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')]['From'];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')]['Text'];_0x24e949[_0x3cb3('0x60')]['messageId']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x8c')];break;case _0x3cb3('0x8d'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]='+'+_0x13321d['body'][_0x3cb3('0x8e')][0x0][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0][_0x3cb3('0x88')];_0x24e949['body'][_0x3cb3('0x8f')]=_0x13321d['body']['results'][0x0][_0x3cb3('0x8f')];break;case'csc':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d['body'][_0x3cb3('0x90')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x91')][_0x3cb3('0x2b')];break;case'clickatell':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x92')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x88')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x93')];break;case _0x3cb3('0x94'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id'];_0x24e949[_0x3cb3('0x60')]['from']=_0x13321d['body'][0x0]['message'][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')][_0x3cb3('0x88')];break;case _0x3cb3('0x95'):_0x24e949['body']['from']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x2b')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d['body'][_0x3cb3('0x96')];break;}}if(_0x24e949['body']['id']){delete _0x24e949['body']['id'];}if(_['isNil'](_0x24e949['body']['from'])){throw new db[(_0x3cb3('0x7a'))]['ValidationError'](_0x3cb3('0x97'));}if(_[_0x3cb3('0x98')](_0x24e949[_0x3cb3('0x60')]['body'])||_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]===''){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x99'));}if(_[_0x3cb3('0x98')](_0x24e949['body'][_0x3cb3('0x9a')])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x9b')+_0x2afbce);}if(!_[_0x3cb3('0x9c')](_0x2afbce,_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x9a')])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x9d')+_0x2afbce);}_0x28a9ce[_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x9a')]]=_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')];return db['CmList'][_0x3cb3('0x5e')]({'where':{'id':_0x24e949[_0x3cb3('0x74')][_0x3cb3('0x80')]},'include':[{'model':db['CmContact'],'as':_0x3cb3('0x9e'),'where':_0x28a9ce,'limit':0x1,'order':[['updatedAt',_0x3cb3('0x9f')]]}]});})[_0x3cb3('0x3a')](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x328108){if(_0x328108){_0x24e949['list']=_['omit'](_0x328108,[_0x3cb3('0x9e')]);if(_0x328108[_0x3cb3('0x9e')]['length']){return _0x328108[_0x3cb3('0x9e')][0x0];}var _0x1b1db5=_[_0x3cb3('0x1b')](_0x24e949['body'],{'firstName':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')],'ListId':_0x328108['id']});_0x1b1db5[_0x24e949[_0x3cb3('0x60')]['mapKey']]=_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')];return db[_0x3cb3('0x79')][_0x3cb3('0x5f')](_0x1b1db5,{'fields':_0x53d5fa,'raw':!![]});}})[_0x3cb3('0x3a')](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x155b5f){if(_0x155b5f){_0x24e949[_0x3cb3('0xa0')]=_0x155b5f;var _0x94587b={'ContactId':_0x155b5f['id'],'phone':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')],'SmsAccountId':_0x13321d[_0x3cb3('0x5a')]['id']};var _0x53c906={'ContactId':_0x155b5f['id'],'SmsAccountId':_0x13321d['params']['id'],'closed':![]};return db[_0x3cb3('0xa1')][_0x3cb3('0x5e')]({'where':_0x53c906})['then'](function(_0x285706){if(_0x285706){return[_0x285706,![]];}return db['SmsInteraction'][_0x3cb3('0x5f')](_0x94587b)['then'](function(_0x2240ba){return[_0x2240ba,!![]];});});}})[_0x3cb3('0xa2')](function(_0x7d39f4,_0x2d12ae){_0x24e949[_0x3cb3('0xa3')]=_0x7d39f4[_0x3cb3('0x62')]({'plain':!![]});_0x24e949['interaction'][_0x3cb3('0xa4')]=![];if(_0x2d12ae){if(_0x24e949[_0x3cb3('0x74')]['autoclose']){_0x24e949[_0x3cb3('0x75')][_0x3cb3('0xa5')]({'id':0x0,'priority':_0x24e949[_0x3cb3('0x75')][_0x3cb3('0x4d')]+0x1,'app':_0x3cb3('0xa6'),'appdata':_0x3cb3('0xa7'),'interval':_0x3cb3('0xa8')});}_0x24e949[_0x3cb3('0xa3')][_0x3cb3('0xa4')]=!![];}return db[_0x3cb3('0xa9')][_0x3cb3('0x5f')]({'phone':_0x24e949['body'][_0x3cb3('0x86')],'messageId':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')],'body':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')],'SmsAccountId':_0x13321d[_0x3cb3('0x5a')]['id'],'SmsInteractionId':_0x7d39f4['id'],'direction':'in','ContactId':_0x7d39f4[_0x3cb3('0xaa')],'AttachmentId':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0xab')]});})['then'](function(_0x54c8e7){_0x24e949[_0x3cb3('0x2b')]=_0x54c8e7;if(_0x24e949[_0x3cb3('0xa3')]['UserId']){return db['User'][_0x3cb3('0x5e')]({'attributes':['id',_0x3cb3('0x3e')],'where':{'id':_0x24e949[_0x3cb3('0xa3')][_0x3cb3('0xac')]}})[_0x3cb3('0x3a')](function(_0x8b92b4){if(_0x8b92b4){_0x24e949['applications'][_0x3cb3('0xad')]({'id':0x0,'priority':0x0,'app':_0x3cb3('0xae'),'appdata':_0x8b92b4[_0x3cb3('0x3e')]+','+(_0x24e949['account'][_0x3cb3('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3cb3('0xb0'),'startRouting',_0x24e949);});}return respondWithRpcPromise(_0x3cb3('0xb0'),_0x3cb3('0xb1'),_0x24e949);})['then'](function(_0x2d4bfa){if(_0x2d4bfa){var _0x45f686=0xc8;var _0x10d3f7=_0x3cb3('0xb2');logger['info'](_0x3cb3('0x28'),_0x10d3f7,_0x45f686,_0x3cb3('0xb3'));logger[_0x3cb3('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x10d3f7,_0x45f686,_0x3cb3('0xb3'),JSON['stringify'](_0x2d4bfa));if(_0x24e949['account'][_0x3cb3('0x46')]==='twilio'){return _0xc7163d[_0x3cb3('0x33')](_0x45f686)[_0x3cb3('0x34')](_0x3cb3('0xb4'),'text/xml')[_0x3cb3('0x3f')](_0x3cb3('0xb5'));}else{return _0xc7163d['status'](_0x45f686)['json'](_0x2d4bfa);}}})['catch'](handleError(_0xc7163d,null));};exports[_0x3cb3('0xb6')]=function(_0x5a6bf5,_0x34e093){var _0x5d3308=_0x5a6bf5['params']['id'];var _0x5c6e0c=_0x5a6bf5[_0x3cb3('0x60')];var _0x3af2d0=0xc8;var _0x5a611b=null;return db[_0x3cb3('0xb7')][_0x3cb3('0xb8')]({'isolationLevel':db[_0x3cb3('0xb7')][_0x3cb3('0xb9')]['ISOLATION_LEVELS'][_0x3cb3('0xba')]},function(_0x4998d0){return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x5d3308},'transaction':_0x4998d0})[_0x3cb3('0x3a')](function(_0x5288de){if(_0x5288de){return db[_0x3cb3('0xbb')][_0x3cb3('0x3b')]({'where':{'SmsAccountId':_0x5d3308},'transaction':_0x4998d0})['then'](function(){var _0x19dcce=_[_0x3cb3('0x42')](_0x5c6e0c,function(_0xf3d69d){_0xf3d69d[_0x3cb3('0x68')]=_0x5d3308;return _0xf3d69d;});return db[_0x3cb3('0xbb')][_0x3cb3('0xbc')](_0x19dcce,{'transaction':_0x4998d0});});}else{_0x3af2d0=0x194;_0x5a611b=[];}});})[_0x3cb3('0x3a')](function(){if(_0x3af2d0!==0x194){return db[_0x3cb3('0xbb')][_0x3cb3('0xbd')]({'where':{'SmsAccountId':_0x5d3308},'order':_0x3cb3('0x77')})[_0x3cb3('0x3a')](function(_0x5be21a){_0x5a611b=_0x5be21a;});}})['catch'](function(_0x2945c1){_0x3af2d0=0x1f4;logger[_0x3cb3('0x29')](_0x2945c1[_0x3cb3('0xbe')]);if(_0x2945c1[_0x3cb3('0x3e')]){delete _0x2945c1[_0x3cb3('0x3e')];}_0x5a611b=_0x2945c1;})[_0x3cb3('0xbf')](function(){if(_0x5a611b===null){_0x34e093[_0x3cb3('0x2e')](_0x3af2d0);}else{if(_0x3af2d0===0x1f4){_0x34e093[_0x3cb3('0x33')](_0x3af2d0)[_0x3cb3('0x3f')](_0x5a611b);}else{_0x34e093['status'](_0x3af2d0)['json'](_0x5a611b);}}});};exports[_0x3cb3('0xc0')]=function(_0x3c5489,_0x3e1ee5,_0x2a45d9){var _0x225d2a={};var _0x9609f3={};var _0x604bc4;var _0x12b571;return db['SmsAccount']['findOne']({'where':{'id':_0x3c5489[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3e1ee5,null))[_0x3cb3('0x3a')](function(_0x4b3e9f){if(_0x4b3e9f){_0x604bc4=_0x4b3e9f;_0x9609f3['model']=_[_0x3cb3('0x5c')](db[_0x3cb3('0xbb')][_0x3cb3('0x44')]);_0x9609f3[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x3c5489[_0x3cb3('0x49')]);_0x9609f3[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x9609f3[_0x3cb3('0x48')],_0x9609f3[_0x3cb3('0x49')]);_0x225d2a[_0x3cb3('0x4c')]=_['intersection'](_0x9609f3[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x5d')]));_0x225d2a[_0x3cb3('0x4c')]=_0x225d2a[_0x3cb3('0x4c')]['length']?_0x225d2a[_0x3cb3('0x4c')]:_0x9609f3['model'];_0x225d2a[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x3c5489[_0x3cb3('0x49')]['sort']);_0x225d2a[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_[_0x3cb3('0xc1')](_0x3c5489['query'],_0x9609f3['filters']));if(_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x54')]){_0x225d2a[_0x3cb3('0x53')]=_['merge'](_0x225d2a[_0x3cb3('0x53')],{'$or':_[_0x3cb3('0x42')](_0x225d2a[_0x3cb3('0x4c')],function(_0x4d88d9){var _0x1bb043={};_0x1bb043[_0x4d88d9]={'$like':'%'+_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x1bb043;})});}_0x225d2a=_[_0x3cb3('0x55')]({},_0x225d2a,_0x3c5489[_0x3cb3('0x56')]);return _0x604bc4['getApplications'](_0x225d2a);}})[_0x3cb3('0x3a')](function(_0x3a292d){if(_0x3a292d){_0x12b571=_0x3a292d[_0x3cb3('0x4d')];if(!_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x4e')]('nolimit')){_0x225d2a[_0x3cb3('0x31')]=qs['limit'](_0x3c5489[_0x3cb3('0x49')]['limit']);_0x225d2a['offset']=qs[_0x3cb3('0x50')](_0x3c5489['query'][_0x3cb3('0x50')]);}return _0x604bc4[_0x3cb3('0xc0')](_0x225d2a);}})[_0x3cb3('0x3a')](function(_0x35a8d3){if(_0x35a8d3){return _0x35a8d3?{'count':_0x12b571,'rows':_0x35a8d3}:null;}})[_0x3cb3('0x3a')](respondWithResult(_0x3e1ee5,null))[_0x3cb3('0x2d')](handleError(_0x3e1ee5,null));};exports['getInteractions']=function(_0x13fe6b,_0x3a07e3,_0x4d38bd){var _0x42034e={'raw':![],'where':{}};var _0x13f237={};var _0x2f20a7={'count':0x0,'rows':[]};return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x13fe6b[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3a07e3,null))[_0x3cb3('0x3a')](function(_0x4ff320){if(_0x4ff320){_0x13f237[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0xa1')][_0x3cb3('0x44')]);_0x13f237[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x13fe6b['query']);_0x13f237['filters']=_[_0x3cb3('0x4b')](_0x13f237['model'],_0x13f237['query']);_0x42034e[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x13f237[_0x3cb3('0x48')],qs['fields'](_0x13fe6b['query'][_0x3cb3('0x5d')]));_0x42034e['attributes']=_0x42034e[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x42034e[_0x3cb3('0x4c')]:_0x13f237[_0x3cb3('0x48')];if(!_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x4e')]('nolimit')){_0x42034e[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x42034e[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x13fe6b['query'][_0x3cb3('0x50')]);}_0x42034e[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x52')]);_0x42034e[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_[_0x3cb3('0xc1')](_0x13fe6b[_0x3cb3('0x49')],_0x13f237[_0x3cb3('0x4a')]));_0x42034e[_0x3cb3('0x53')][_0x3cb3('0x68')]=_0x4ff320['id'];if(_0x13fe6b[_0x3cb3('0x49')]['filter']){_0x42034e[_0x3cb3('0x53')]=_['merge'](_0x42034e[_0x3cb3('0x53')],{'$or':_['map'](_0x42034e['attributes'],function(_0x1bbf65){var _0x4e2d0b={};_0x4e2d0b[_0x1bbf65]={'$like':'%'+_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x4e2d0b;})});}_0x42034e=_[_0x3cb3('0x55')]({},_0x42034e,_0x13fe6b['options']);return db[_0x3cb3('0xa1')][_0x3cb3('0x32')]({'where':_0x42034e[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0x4534a6){_0x2f20a7[_0x3cb3('0x32')]=_0x4534a6;if(_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x42034e[_0x3cb3('0x58')]=[{'model':db['CmContact'],'as':_0x3cb3('0xc2'),'required':![]},{'model':db[_0x3cb3('0xc3')],'as':_0x3cb3('0xc4'),'attributes':[_0x3cb3('0x3e'),_0x3cb3('0xc5'),_0x3cb3('0xc6')],'required':![]},{'model':db[_0x3cb3('0xc7')],'as':_0x3cb3('0xc8'),'attributes':['id','name','color'],'where':_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0xc9')]?{'id':_0x13fe6b['query'][_0x3cb3('0xc9')]}:undefined,'required':_0x13fe6b['query'][_0x3cb3('0xc9')]?!![]:![]}];}return db[_0x3cb3('0xa1')][_0x3cb3('0x59')](_0x42034e);})[_0x3cb3('0x3a')](function(_0x54f527){_0x2f20a7[_0x3cb3('0x6b')]=_0x54f527;return _0x2f20a7;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x3a07e3,_0x42034e))[_0x3cb3('0x2d')](handleError(_0x3a07e3,null));};exports[_0x3cb3('0x3f')]=function(_0x1bc22,_0x581427,_0x1981d3){var _0x3c2cb6,_0x9d990c,_0x55cf4d;if(_['isNil'](_0x1bc22[_0x3cb3('0x60')]['body'])||_0x1bc22[_0x3cb3('0x60')][_0x3cb3('0x60')]===''){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x99'));}if(_['isNil'](_0x1bc22[_0x3cb3('0x60')]['to'])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))]('to\x20is\x20mandatory');}_0x3c2cb6=_0x1bc22[_0x3cb3('0x60')]['to'];return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x1bc22['params']['id']},'include':[{'model':db[_0x3cb3('0xca')],'as':_0x3cb3('0xcb'),'include':[{'model':db['CmContact'],'as':_0x3cb3('0x9e'),'where':{'mobile':_0x3c2cb6},'limit':0x1,'order':[[_0x3cb3('0x7d'),_0x3cb3('0x9f')]]}]}]})[_0x3cb3('0x3a')](handleEntityNotFound(_0x581427,null))[_0x3cb3('0x3a')](function(_0x393c16){if(_0x393c16&&_0x393c16['List']){_0x9d990c=_0x393c16['get']({'plain':!![]});if(_0x9d990c[_0x3cb3('0xcb')]&&_0x9d990c['List']['Contacts']['length']){return _0x9d990c[_0x3cb3('0xcb')][_0x3cb3('0x9e')][0x0];}return db['CmContact'][_0x3cb3('0x5f')](_[_0x3cb3('0x1b')](_0x1bc22[_0x3cb3('0x60')],{'firstName':_0x3c2cb6,'mobile':_0x3c2cb6,'phone':_0x3c2cb6,'ListId':_0x9d990c[_0x3cb3('0x80')]}));}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x581427,null))[_0x3cb3('0x3a')](function(_0x47c69f){if(_0x47c69f){_0x55cf4d=_0x47c69f;return db['SmsInteraction'][_0x3cb3('0x5e')]({'where':{'ContactId':_0x55cf4d['id'],'closed':![],'SmsAccountId':_0x9d990c['id']}})[_0x3cb3('0x3a')](function(_0x34c87b){if(_0x34c87b){return[_0x34c87b,![]];}return db[_0x3cb3('0xa1')][_0x3cb3('0x5f')]({'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id'],'SmsAccountId':_0x9d990c['id'],'phone':_0x3c2cb6,'firstMsgDirection':_0x3cb3('0xcc'),'Messages':[_[_0x3cb3('0x55')](_0x1bc22[_0x3cb3('0x60')],{'read':![],'body':_0x1bc22[_0x3cb3('0x60')][_0x3cb3('0x60')],'phone':_0x3c2cb6,'SmsAccountId':_0x9d990c['id'],'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id']})]},{'include':[{'model':db[_0x3cb3('0xa9')],'as':_0x3cb3('0xcd')}]})['then'](function(_0x2d080f){return[_0x2d080f,!![]];});});}})[_0x3cb3('0xa2')](function(_0x5ea4ad,_0x482621){if(_0x482621){return _0x5ea4ad;}return db[_0x3cb3('0xa9')][_0x3cb3('0x5f')](_[_0x3cb3('0x55')](_0x1bc22[_0x3cb3('0x60')],{'read':![],'body':_0x1bc22['body'][_0x3cb3('0x60')],'phone':_0x3c2cb6,'SmsAccountId':_0x9d990c['id'],'SmsInteractionId':_0x5ea4ad['id'],'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id']}))['then'](function(_0x187318){_0x5ea4ad[_0x3cb3('0xce')][_0x3cb3('0xcd')]=[];_0x5ea4ad[_0x3cb3('0xce')][_0x3cb3('0xcd')][_0x3cb3('0xa5')](_0x187318[_0x3cb3('0xce')]);return _0x5ea4ad;});})[_0x3cb3('0x3a')](respondWithResult(_0x581427,null))[_0x3cb3('0x2d')](handleError(_0x581427,null));};exports[_0x3cb3('0x33')]=function(_0x2550dd,_0x1e5ce4,_0x5e265d){if(_0x2550dd['body']['id']){delete _0x2550dd[_0x3cb3('0x60')]['id'];}var _0x32211a,_0x1f6b0d,_0x4f4798;return db['SmsAccount'][_0x3cb3('0x5e')]({'where':{'id':_0x2550dd[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x1e5ce4,null))[_0x3cb3('0x3a')](function(_0x4162a4){if(_0x4162a4){_0x4f4798=_0x4162a4;logger['debug'](_0x3cb3('0x28'),'status',_0x3cb3('0xcf'),_0x4162a4[_0x3cb3('0x46')],util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));switch(_0x4162a4[_0x3cb3('0x46')]){case _0x3cb3('0x85'):if(_0x2550dd['body'][_0x3cb3('0xd1')]&&_0x2550dd['body'][_0x3cb3('0x33')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x33')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')]['skebby_dispatch_id']}});}break;case _0x3cb3('0x89'):if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd2')]&&_0x2550dd['body'][_0x3cb3('0xd3')]){_0x1f6b0d=_0x2550dd['body'][_0x3cb3('0xd3')];return db[_0x3cb3('0xa9')]['find']({'where':{'messageId':_0x2550dd['body'][_0x3cb3('0xd2')]}});}break;case'clicksend':if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd4')]&&_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd5')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd5')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd4')]}});}break;case _0x3cb3('0x8d'):var _0x29389b=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0];if(_0x29389b[_0x3cb3('0x8f')]&&_0x29389b[_0x3cb3('0x33')][_0x3cb3('0xd6')]==='DELIVERED'){_0x1f6b0d=_0x29389b['status'][_0x3cb3('0xd6')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x29389b[_0x3cb3('0x8f')]}});}break;case _0x3cb3('0xd7'):if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8f')]&&_0x2550dd['body'][_0x3cb3('0x33')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x33')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8f')]}});}break;case'bandwidth':if(_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id']){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x46')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id']}});}break;case _0x3cb3('0x95'):if(_0x2550dd['body'][_0x3cb3('0xd8')]&&_0x2550dd[_0x3cb3('0x60')]['status']){_0x1f6b0d=_0x2550dd['body']['status'];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1e5ce4,null))[_0x3cb3('0x3a')](function(_0x1680de){if(_0x1680de){_0x32211a=_0x1680de;switch(_0x4f4798[_0x3cb3('0x46')]){case _0x3cb3('0x85'):if(_0x1f6b0d==='DELIVERED'){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')](_0x3cb3('0x28'),_0x3cb3('0x33'),'skebby',util['inspect'](_0x2550dd['body'],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x89'):if(_0x1f6b0d==='1'){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')](_0x3cb3('0x28'),'status',_0x3cb3('0x85'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x8a'):if(!_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd9')]&&_0x1f6b0d>=0xc8&&_0x1f6b0d<=0xce){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),'clicksend',util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x8d'):var _0x32018e=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0];if(_0x32018e[_0x3cb3('0x33')][_0x3cb3('0xd6')]===_0x3cb3('0xda')){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0xd7'):if(_0x1f6b0d==_0x3cb3('0xdb')||_0x1f6b0d=='RECEIVED_BY_RECIPIENT'){return _0x32211a['update']({'read':!![]});}else{logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),_0x3cb3('0xd7'),util[_0x3cb3('0xd0')](_0x2550dd['body'],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x94'):if(_0x1f6b0d==_0x3cb3('0xdc')){return _0x32211a['update']({'read':!![]});}else{logger['error'](_0x3cb3('0x28'),_0x3cb3('0x33'),_0x3cb3('0x94'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x95'):if(_0x1f6b0d==='DELIVRD'||_0x1f6b0d===_0x3cb3('0xdd')){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),_0x3cb3('0x95'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x32211a;}})[_0x3cb3('0x3a')](respondWithResult(_0x1e5ce4,null))['catch'](handleError(_0x1e5ce4,null));};exports[_0x3cb3('0xde')]=function(_0x3d235e,_0x11b025,_0x5d8d83){var _0x3b857a,_0x2e4cd0,_0x322d73;return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x3d235e[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x11b025,null))[_0x3cb3('0x3a')](function(_0x5e981e){if(_0x5e981e){_0x322d73=_0x5e981e;logger['debug'](_0x3cb3('0x28'),_0x3cb3('0x33'),'received\x20delivery\x20report\x20from',_0x5e981e[_0x3cb3('0x46')],util[_0x3cb3('0xd0')](_0x3d235e[_0x3cb3('0x49')],{'showHidden':![],'depth':null}));switch(_0x5e981e[_0x3cb3('0x46')]){case'csc':if(_0x3d235e[_0x3cb3('0x49')]['message-id']&&_0x3d235e[_0x3cb3('0x49')][_0x3cb3('0xdf')]){_0x2e4cd0=_0x3d235e[_0x3cb3('0x49')][_0x3cb3('0xdf')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x3d235e[_0x3cb3('0x49')]['message-id']}});}break;}}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x11b025,null))['then'](function(_0x60d3cb){if(_0x60d3cb){_0x3b857a=_0x60d3cb;switch(_0x322d73['type']){case'csc':if(_0x2e4cd0==='2'||_0x2e4cd0==='6'){return _0x3b857a['update']({'read':!![]});}else{logger['error'](_0x3cb3('0x28'),_0x3cb3('0x33'),_0x3cb3('0xe0'),util[_0x3cb3('0xd0')](_0x3d235e[_0x3cb3('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x3b857a;}})[_0x3cb3('0x3a')](respondWithResult(_0x11b025,null))[_0x3cb3('0x2d')](handleError(_0x11b025,null));};exports[_0x3cb3('0xe1')]=function(_0x590e94,_0x4b6b4b,_0x56e301){return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x590e94[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b6b4b,null))[_0x3cb3('0x3a')](function(_0x51a0ff){if(_0x51a0ff){return _0x51a0ff[_0x3cb3('0xe1')](_0x590e94[_0x3cb3('0x60')][_0x3cb3('0x6d')],_[_0x3cb3('0xe2')](_0x590e94[_0x3cb3('0x60')],['ids','id'])||{})[_0x3cb3('0xa2')](function(_0x92d785){for(var _0x395828=0x0;_0x395828<_0x590e94[_0x3cb3('0x60')]['ids'][_0x3cb3('0x4d')];_0x395828+=0x1){socket[_0x3cb3('0xe3')](_0x3cb3('0xe4'),{'UserId':Number(_0x590e94[_0x3cb3('0x60')][_0x3cb3('0x6d')][_0x395828]),'SmsAccountId':Number(_0x590e94[_0x3cb3('0x5a')]['id'])});}return _0x92d785;});}})[_0x3cb3('0x3a')](respondWithResult(_0x4b6b4b,null))['catch'](handleError(_0x4b6b4b,null));};exports[_0x3cb3('0xe5')]=function(_0x5cf4b3,_0xa23f19,_0x8e1c80){return db['SmsAccount']['find']({'where':{'id':_0x5cf4b3[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa23f19,null))[_0x3cb3('0x3a')](function(_0x1ca95f){if(_0x1ca95f){return _0x1ca95f['removeAgents'](_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')])[_0x3cb3('0x3a')](function(){if(_[_0x3cb3('0xe6')](_0x5cf4b3['query'][_0x3cb3('0x6d')])){for(var _0x21232c=0x0;_0x21232c<_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')][_0x3cb3('0x4d')];_0x21232c+=0x1){socket[_0x3cb3('0xe3')](_0x3cb3('0xe7'),{'UserId':Number(_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')][_0x21232c]),'SmsAccountId':Number(_0x5cf4b3[_0x3cb3('0x5a')]['id'])});}}else{socket[_0x3cb3('0xe3')](_0x3cb3('0xe7'),{'UserId':Number(_0x5cf4b3['query'][_0x3cb3('0x6d')]),'SmsAccountId':Number(_0x5cf4b3[_0x3cb3('0x5a')]['id'])});}});}})[_0x3cb3('0x3a')](respondWithStatusCode(_0xa23f19,null))['catch'](handleError(_0xa23f19,null));};exports[_0x3cb3('0xe8')]=function(_0x4157b7,_0x649d2a,_0x337753){var _0xbc9c81={};var _0xb000b9={};var _0x265f71;var _0x4a413d;return db[_0x3cb3('0x43')]['findOne']({'where':{'id':_0x4157b7[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x649d2a,null))[_0x3cb3('0x3a')](function(_0x4188c6){if(_0x4188c6){_0x265f71=_0x4188c6;_0xb000b9[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0xc3')][_0x3cb3('0x44')]);_0xb000b9[_0x3cb3('0x49')]=_['keys'](_0x4157b7['query']);_0xb000b9['filters']=_[_0x3cb3('0x4b')](_0xb000b9[_0x3cb3('0x48')],_0xb000b9[_0x3cb3('0x49')]);_0xbc9c81[_0x3cb3('0x4c')]=_['intersection'](_0xb000b9[_0x3cb3('0x48')],qs['fields'](_0x4157b7['query'][_0x3cb3('0x5d')]));_0xbc9c81[_0x3cb3('0x4c')]=_0xbc9c81[_0x3cb3('0x4c')]['length']?_0xbc9c81[_0x3cb3('0x4c')]:_0xb000b9['model'];_0xbc9c81['order']=qs['sort'](_0x4157b7[_0x3cb3('0x49')]['sort']);_0xbc9c81[_0x3cb3('0x53')]=qs['filters'](_['pick'](_0x4157b7[_0x3cb3('0x49')],_0xb000b9[_0x3cb3('0x4a')]));if(_0x4157b7['query'][_0x3cb3('0x54')]){_0xbc9c81[_0x3cb3('0x53')]=_[_0x3cb3('0x55')](_0xbc9c81['where'],{'$or':_[_0x3cb3('0x42')](_0xbc9c81['attributes'],function(_0x2e8126){var _0x47d358={};_0x47d358[_0x2e8126]={'$like':'%'+_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x47d358;})});}_0xbc9c81=_[_0x3cb3('0x55')]({},_0xbc9c81,_0x4157b7[_0x3cb3('0x56')]);return _0x265f71['getAgents'](_0xbc9c81);}})[_0x3cb3('0x3a')](function(_0x59ae61){if(_0x59ae61){_0x4a413d=_0x59ae61['length'];if(!_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0xbc9c81['limit']=qs['limit'](_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0xbc9c81[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x50')]);}return _0x265f71[_0x3cb3('0xe8')](_0xbc9c81);}})[_0x3cb3('0x3a')](function(_0x52a564){if(_0x52a564){return _0x52a564?{'count':_0x4a413d,'rows':_0x52a564}:null;}})[_0x3cb3('0x3a')](respondWithResult(_0x649d2a,null))[_0x3cb3('0x2d')](handleError(_0x649d2a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ff18a38..1afd820 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 _0xf4bf=['remove','emit','hasOwnProperty','exports','save'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xf4bf,0x11c));var _0xff4b=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xf4bf[_0x4dc7b9];return _0x3ab114;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff4b('0x0'),'afterUpdate':'update','afterDestroy':_0xff4b('0x1')};function emitEvent(_0x61ba3a){return function(_0x5ea11a,_0x1051af,_0x3ea11d){SmsAccountEvents[_0xff4b('0x2')](_0x61ba3a+':'+_0x5ea11a['id'],_0x5ea11a);SmsAccountEvents['emit'](_0x61ba3a,_0x5ea11a);_0x3ea11d(null);};}for(var e in events){if(events[_0xff4b('0x3')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xff4b('0x4')]=SmsAccountEvents; \ No newline at end of file +var _0xdf50=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdf50,0x14a));var _0x0df5=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0xdf50[_0x4fa291];return _0x506d9b;};'use strict';var EventEmitter=require(_0x0df5('0x0'));var SmsAccount=require(_0x0df5('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0df5('0x2')](0x0);var events={'afterCreate':_0x0df5('0x3'),'afterUpdate':'update','afterDestroy':_0x0df5('0x4')};function emitEvent(_0x335066){return function(_0x11171b,_0x6bd121,_0x556068){SmsAccountEvents[_0x0df5('0x5')](_0x335066+':'+_0x11171b['id'],_0x11171b);SmsAccountEvents['emit'](_0x335066,_0x11171b);_0x556068(null);};}for(var e in events){if(events[_0x0df5('0x6')](e)){var event=events[e];SmsAccount[_0x0df5('0x7')](e,emitEvent(event));}}module[_0x0df5('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6fb3fc7..b98b0bc 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 _0xd5a8=['exports','define','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x3e1a9e,_0x147132){var _0x330883=function(_0x222c3a){while(--_0x222c3a){_0x3e1a9e['push'](_0x3e1a9e['shift']());}};_0x330883(++_0x147132);}(_0xd5a8,0x8f));var _0x8d5a=function(_0x1373f5,_0x30a026){_0x1373f5=_0x1373f5-0x0;var _0x549b54=_0xd5a8[_0x1373f5];return _0x549b54;};'use strict';var _=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var logger=require(_0x8d5a('0x2'))(_0x8d5a('0x3'));var moment=require(_0x8d5a('0x4'));var BPromise=require(_0x8d5a('0x5'));var rp=require(_0x8d5a('0x6'));var fs=require('fs');var path=require(_0x8d5a('0x7'));var rimraf=require(_0x8d5a('0x8'));var config=require(_0x8d5a('0x9'));var attributes=require(_0x8d5a('0xa'));module[_0x8d5a('0xb')]=function(_0x152760,_0x5a6739){return _0x152760[_0x8d5a('0xc')]('SmsAccount',attributes,{'tableName':_0x8d5a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6472=['exports','define','SmsAccount','sms_accounts','util','../../config/logger','api','path','rimraf','./smsAccount.attributes'];(function(_0x598f1f,_0xa7d1c){var _0x26d77d=function(_0x176e50){while(--_0x176e50){_0x598f1f['push'](_0x598f1f['shift']());}};_0x26d77d(++_0xa7d1c);}(_0x6472,0xcc));var _0x2647=function(_0x4e69fd,_0x3b110f){_0x4e69fd=_0x4e69fd-0x0;var _0x46d3a1=_0x6472[_0x4e69fd];return _0x46d3a1;};'use strict';var _=require('lodash');var util=require(_0x2647('0x0'));var logger=require(_0x2647('0x1'))(_0x2647('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2647('0x3'));var rimraf=require(_0x2647('0x4'));var config=require('../../config/environment');var attributes=require(_0x2647('0x5'));module[_0x2647('0x6')]=function(_0x416306,_0x3f83e9){return _0x416306[_0x2647('0x7')](_0x2647('0x8'),attributes,{'tableName':_0x2647('0x9'),'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 d810265..79a9f86 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 _0x6006=['jayson/promise','client','http','redis','localhost','./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','options','attributes','include','map','model','ShowSmsAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x29ae06,_0x377bcf){var _0x3b5b65=function(_0x472462){while(--_0x472462){_0x29ae06['push'](_0x29ae06['shift']());}};_0x3b5b65(++_0x377bcf);}(_0x6006,0x164));var _0x6600=function(_0x1a04ef,_0x541e36){_0x1a04ef=_0x1a04ef-0x0;var _0x3b8f4c=_0x6006[_0x1a04ef];return _0x3b8f4c;};'use strict';var _=require('lodash');var util=require(_0x6600('0x0'));var moment=require(_0x6600('0x1'));var BPromise=require(_0x6600('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6600('0x3'));var db=require(_0x6600('0x4'))['db'];var utils=require(_0x6600('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6600('0x6'));var jayson=require(_0x6600('0x7'));var client=jayson[_0x6600('0x8')][_0x6600('0x9')]({'port':0x232a});config[_0x6600('0xa')]=_['defaults'](config[_0x6600('0xa')],{'host':_0x6600('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6600('0xa')]));require(_0x6600('0xc'))[_0x6600('0xd')](socket);function respondWithRpcPromise(_0x4d6150,_0x391e7c,_0x352ced){return new BPromise(function(_0x1d231c,_0x25ffbe){return client[_0x6600('0xe')](_0x4d6150,_0x352ced)[_0x6600('0xf')](function(_0x4d1eb3){logger[_0x6600('0x10')](_0x6600('0x11'),_0x391e7c,'request\x20sent');logger[_0x6600('0x12')](_0x6600('0x13'),_0x391e7c,_0x6600('0x14'),JSON[_0x6600('0x15')](_0x4d1eb3));if(_0x4d1eb3[_0x6600('0x16')]){if(_0x4d1eb3['error'][_0x6600('0x17')]===0x1f4){logger['error'](_0x6600('0x11'),_0x391e7c,_0x4d1eb3[_0x6600('0x16')][_0x6600('0x18')]);return _0x25ffbe(_0x4d1eb3[_0x6600('0x16')]['message']);}logger[_0x6600('0x16')](_0x6600('0x11'),_0x391e7c,_0x4d1eb3[_0x6600('0x16')][_0x6600('0x18')]);return _0x1d231c(_0x4d1eb3[_0x6600('0x16')]['message']);}else{logger[_0x6600('0x10')](_0x6600('0x11'),_0x391e7c,_0x6600('0x14'));_0x1d231c(_0x4d1eb3[_0x6600('0x19')]['message']);}})[_0x6600('0x1a')](function(_0x12f0e4){logger[_0x6600('0x16')](_0x6600('0x11'),_0x391e7c,_0x12f0e4);_0x25ffbe(_0x12f0e4);});});}exports['ShowSmsAccount']=function(_0x13e702){var _0xfe4f12=this;return new Promise(function(_0x17a775,_0xdc098d){return db['SmsAccount']['find']({'raw':_0x13e702[_0x6600('0x1b')]?_0x13e702[_0x6600('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x13e702[_0x6600('0x1b')]?_0x13e702[_0x6600('0x1b')]['where']||null:null,'attributes':_0x13e702[_0x6600('0x1b')]?_0x13e702[_0x6600('0x1b')][_0x6600('0x1c')]||null:null,'include':_0x13e702[_0x6600('0x1b')]?_0x13e702['options'][_0x6600('0x1d')]?_[_0x6600('0x1e')](_0x13e702[_0x6600('0x1b')][_0x6600('0x1d')],function(_0x67c755){return{'model':db[_0x67c755[_0x6600('0x1f')]],'as':_0x67c755['as'],'attributes':_0x67c755['attributes'],'include':_0x67c755['include']?_[_0x6600('0x1e')](_0x67c755[_0x6600('0x1d')],function(_0x71f1d){return{'model':db[_0x71f1d[_0x6600('0x1f')]],'as':_0x71f1d['as'],'attributes':_0x71f1d[_0x6600('0x1c')],'include':_0x71f1d[_0x6600('0x1d')]?_['map'](_0x71f1d['include'],function(_0x15ae23){return{'model':db[_0x15ae23[_0x6600('0x1f')]],'as':_0x15ae23['as'],'attributes':_0x15ae23['attributes']};}):[]};}):[]};}):[]:[]})[_0x6600('0xf')](function(_0x373aa4){logger[_0x6600('0x10')](_0x6600('0x20'),_0x13e702);logger[_0x6600('0x12')](_0x6600('0x20'),_0x13e702,JSON['stringify'](_0x373aa4));_0x17a775(_0x373aa4);})[_0x6600('0x1a')](function(_0x4a99a1){logger[_0x6600('0x16')](_0x6600('0x20'),_0x4a99a1[_0x6600('0x18')],_0x13e702);_0xdc098d(_0xfe4f12[_0x6600('0x16')](0x1f4,_0x4a99a1[_0x6600('0x18')]));});});}; \ No newline at end of file +var _0xb3b3=['options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','ShowSmsAccount','SmsAccount'];(function(_0x451088,_0x1ac428){var _0x5b0f45=function(_0x59c48e){while(--_0x59c48e){_0x451088['push'](_0x451088['shift']());}};_0x5b0f45(++_0x1ac428);}(_0xb3b3,0x1dc));var _0x3b3b=function(_0x272952,_0x4d06ca){_0x272952=_0x272952-0x0;var _0x4ae95a=_0xb3b3[_0x272952];return _0x4ae95a;};'use strict';var _=require(_0x3b3b('0x0'));var util=require(_0x3b3b('0x1'));var moment=require(_0x3b3b('0x2'));var BPromise=require(_0x3b3b('0x3'));var rs=require(_0x3b3b('0x4'));var fs=require('fs');var Redis=require(_0x3b3b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b3b('0x6'));var logger=require(_0x3b3b('0x7'))(_0x3b3b('0x8'));var config=require('../../config/environment');var jayson=require(_0x3b3b('0x9'));var client=jayson['client'][_0x3b3b('0xa')]({'port':0x232a});config[_0x3b3b('0xb')]=_[_0x3b3b('0xc')](config['redis'],{'host':_0x3b3b('0xd'),'port':0x18eb});var socket=require(_0x3b3b('0xe'))(new Redis(config[_0x3b3b('0xb')]));require('./smsAccount.socket')[_0x3b3b('0xf')](socket);function respondWithRpcPromise(_0x5105ae,_0x1ec84a,_0x3cb84e){return new BPromise(function(_0x47dcc4,_0x40367e){return client[_0x3b3b('0x10')](_0x5105ae,_0x3cb84e)[_0x3b3b('0x11')](function(_0x4ab6b4){logger[_0x3b3b('0x12')](_0x3b3b('0x13'),_0x1ec84a,_0x3b3b('0x14'));logger[_0x3b3b('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ec84a,_0x3b3b('0x14'),JSON['stringify'](_0x4ab6b4));if(_0x4ab6b4[_0x3b3b('0x16')]){if(_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x17')]===0x1f4){logger[_0x3b3b('0x16')](_0x3b3b('0x13'),_0x1ec84a,_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);return _0x40367e(_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);}logger[_0x3b3b('0x16')](_0x3b3b('0x13'),_0x1ec84a,_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);return _0x47dcc4(_0x4ab6b4[_0x3b3b('0x16')]['message']);}else{logger[_0x3b3b('0x12')](_0x3b3b('0x13'),_0x1ec84a,_0x3b3b('0x14'));_0x47dcc4(_0x4ab6b4['result']['message']);}})[_0x3b3b('0x19')](function(_0x37d7d3){logger[_0x3b3b('0x16')]('SmsAccount,\x20%s,\x20%s',_0x1ec84a,_0x37d7d3);_0x40367e(_0x37d7d3);});});}exports[_0x3b3b('0x1a')]=function(_0x588ee3){var _0xcd520d=this;return new Promise(function(_0xc8e334,_0x123aec){return db[_0x3b3b('0x1b')]['find']({'raw':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3['options'][_0x3b3b('0x1d')]===undefined?!![]:![]:!![],'where':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3['options'][_0x3b3b('0x1e')]||null:null,'attributes':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x1f')]||null:null,'include':_0x588ee3['options']?_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x20')],function(_0x318247){return{'model':db[_0x318247[_0x3b3b('0x22')]],'as':_0x318247['as'],'attributes':_0x318247['attributes'],'include':_0x318247[_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x318247[_0x3b3b('0x20')],function(_0x57d0ed){return{'model':db[_0x57d0ed[_0x3b3b('0x22')]],'as':_0x57d0ed['as'],'attributes':_0x57d0ed[_0x3b3b('0x1f')],'include':_0x57d0ed[_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x57d0ed[_0x3b3b('0x20')],function(_0x4a94b5){return{'model':db[_0x4a94b5[_0x3b3b('0x22')]],'as':_0x4a94b5['as'],'attributes':_0x4a94b5[_0x3b3b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x360f4d){logger['info']('ShowSmsAccount',_0x588ee3);logger[_0x3b3b('0x15')](_0x3b3b('0x1a'),_0x588ee3,JSON[_0x3b3b('0x23')](_0x360f4d));_0xc8e334(_0x360f4d);})[_0x3b3b('0x19')](function(_0x21455d){logger[_0x3b3b('0x16')](_0x3b3b('0x1a'),_0x21455d['message'],_0x588ee3);_0x123aec(_0xcd520d['error'](0x1f4,_0x21455d[_0x3b3b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fcb9e94..57677d8 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 _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 64153ba..357b1be 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x764397,_0x13654c){var _0x138255=function(_0x4d75d0){while(--_0x4d75d0){_0x764397['push'](_0x764397['shift']());}};_0x138255(++_0x13654c);}(_0x3e74,0x175));var _0x43e7=function(_0x4fbde6,_0x3499b2){_0x4fbde6=_0x4fbde6-0x0;var _0x4d18f5=_0x3e74[_0x4fbde6];return _0x4d18f5;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 09f08a8..325727d 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 _0xfba3=['STRING','*,*,*,*','sequelize','TEXT'];(function(_0x215b9f,_0x484ce3){var _0x4ad616=function(_0x77bbb1){while(--_0x77bbb1){_0x215b9f['push'](_0x215b9f['shift']());}};_0x4ad616(++_0x484ce3);}(_0xfba3,0x152));var _0x3fba=function(_0x2bb345,_0x487bc1){_0x2bb345=_0x2bb345-0x0;var _0xee5264=_0xfba3[_0x2bb345];return _0xee5264;};'use strict';var Sequelize=require(_0x3fba('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3fba('0x1')]()},'description':{'type':Sequelize[_0x3fba('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3fba('0x3')}}; \ No newline at end of file +var _0xd7b3=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x392e7e,_0x3b6ae6){var _0x1bd6bc=function(_0x2c2aba){while(--_0x2c2aba){_0x392e7e['push'](_0x392e7e['shift']());}};_0x1bd6bc(++_0x3b6ae6);}(_0xd7b3,0x1e7));var _0x3d7b=function(_0x469ce9,_0x4a9239){_0x469ce9=_0x469ce9-0x0;var _0x180ebe=_0xd7b3[_0x469ce9];return _0x180ebe;};'use strict';var Sequelize=require(_0x3d7b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3d7b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3d7b('0x2')],'allowNull':![],'defaultValue':_0x3d7b('0x3')},'appdata':{'type':Sequelize[_0x3d7b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1740319..0473703 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 _0x2568=['reject','save','update','destroy','status','end','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','findAll','catch','show','params','include','options','SmsApplication','body','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','count','limit','set','Content-Range'];(function(_0x5d0b40,_0x5c1ac6){var _0x16259b=function(_0x22661b){while(--_0x22661b){_0x5d0b40['push'](_0x5d0b40['shift']());}};_0x16259b(++_0x5c1ac6);}(_0x2568,0x192));var _0x8256=function(_0x3738ae,_0x7a360e){_0x3738ae=_0x3738ae-0x0;var _0x38e539=_0x2568[_0x3738ae];return _0x38e539;};'use strict';var emlformat=require(_0x8256('0x0'));var rimraf=require(_0x8256('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8256('0x2'));var rp=require(_0x8256('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8256('0x4'));var path=require(_0x8256('0x5'));var sox=require('sox');var csv=require(_0x8256('0x6'));var ejs=require(_0x8256('0x7'));var fs=require('fs');var fs_extra=require(_0x8256('0x8'));var _=require(_0x8256('0x9'));var squel=require(_0x8256('0xa'));var crypto=require(_0x8256('0xb'));var jsforce=require(_0x8256('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8256('0x6'));var querystring=require(_0x8256('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8256('0xe'));var qs=require(_0x8256('0xf'));var as=require(_0x8256('0x10'));var hardwareService=require(_0x8256('0x11'));var logger=require(_0x8256('0x12'))(_0x8256('0x13'));var utils=require(_0x8256('0x14'));var config=require(_0x8256('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8256('0x16'))['db'];function respondWithStatusCode(_0x5e4be1,_0xf74664){_0xf74664=_0xf74664||0xcc;return function(_0x22354d){if(_0x22354d){return _0x5e4be1[_0x8256('0x17')](_0xf74664);}return _0x5e4be1['status'](_0xf74664)['end']();};}function respondWithResult(_0xeae90b,_0x43f9a7){_0x43f9a7=_0x43f9a7||0xc8;return function(_0x22ad3b){if(_0x22ad3b){return _0xeae90b['status'](_0x43f9a7)['json'](_0x22ad3b);}};}function respondWithFilteredResult(_0x1f0caa,_0x3772b4){return function(_0x4d9e7f){if(_0x4d9e7f){var _0x460464=typeof _0x3772b4[_0x8256('0x18')]===_0x8256('0x19')&&typeof _0x3772b4['limit']==='undefined';var _0x1942dd=_0x4d9e7f[_0x8256('0x1a')];var _0x3c44dd=_0x460464?0x0:_0x3772b4[_0x8256('0x18')];var _0x18c2c9=_0x460464?_0x4d9e7f['count']:_0x3772b4['offset']+_0x3772b4[_0x8256('0x1b')];var _0x5ab950;if(_0x18c2c9>=_0x1942dd){_0x18c2c9=_0x1942dd;_0x5ab950=0xc8;}else{_0x5ab950=0xce;}_0x1f0caa['status'](_0x5ab950);return _0x1f0caa[_0x8256('0x1c')](_0x8256('0x1d'),_0x3c44dd+'-'+_0x18c2c9+'/'+_0x1942dd)['json'](_0x4d9e7f);}return null;};}function patchUpdates(_0x3c1fb5){return function(_0x143051){try{jsonpatch['apply'](_0x143051,_0x3c1fb5,!![]);}catch(_0x2d4c54){return BPromise[_0x8256('0x1e')](_0x2d4c54);}return _0x143051[_0x8256('0x1f')]();};}function saveUpdates(_0x2e8da5,_0x3b5747){return function(_0x5e42a9){if(_0x5e42a9){return _0x5e42a9[_0x8256('0x20')](_0x2e8da5)['then'](function(_0x3f9f59){return _0x3f9f59;});}return null;};}function removeEntity(_0x32b331,_0x50d6a8){return function(_0xfa8c2f){if(_0xfa8c2f){return _0xfa8c2f[_0x8256('0x21')]()['then'](function(){_0x32b331[_0x8256('0x22')](0xcc)[_0x8256('0x23')]();});}};}function handleEntityNotFound(_0x39981d,_0x4b2d91){return function(_0x476001){if(!_0x476001){_0x39981d[_0x8256('0x17')](0x194);}return _0x476001;};}function handleError(_0x53a345,_0x574b90){_0x574b90=_0x574b90||0x1f4;return function(_0x486832){logger['error'](_0x486832[_0x8256('0x24')]);if(_0x486832[_0x8256('0x25')]){delete _0x486832[_0x8256('0x25')];}_0x53a345[_0x8256('0x22')](_0x574b90)[_0x8256('0x26')](_0x486832);};}exports[_0x8256('0x27')]=function(_0x30d888,_0x325ad8){var _0x49eb01={},_0x1a4ec6={},_0x443e9d={'count':0x0,'rows':[]};var _0x4727fb=_['map'](db['SmsApplication'][_0x8256('0x28')],function(_0x1e4f43){return{'name':_0x1e4f43['fieldName'],'type':_0x1e4f43[_0x8256('0x29')][_0x8256('0x2a')]};});_0x1a4ec6[_0x8256('0x2b')]=_[_0x8256('0x2c')](_0x4727fb,_0x8256('0x25'));_0x1a4ec6[_0x8256('0x2d')]=_[_0x8256('0x2e')](_0x30d888[_0x8256('0x2d')]);_0x1a4ec6['filters']=_['intersection'](_0x1a4ec6['model'],_0x1a4ec6[_0x8256('0x2d')]);_0x49eb01[_0x8256('0x2f')]=_[_0x8256('0x30')](_0x1a4ec6['model'],qs[_0x8256('0x31')](_0x30d888['query']['fields']));_0x49eb01[_0x8256('0x2f')]=_0x49eb01[_0x8256('0x2f')][_0x8256('0x32')]?_0x49eb01[_0x8256('0x2f')]:_0x1a4ec6[_0x8256('0x2b')];if(!_0x30d888[_0x8256('0x2d')][_0x8256('0x33')](_0x8256('0x34'))){_0x49eb01[_0x8256('0x1b')]=qs[_0x8256('0x1b')](_0x30d888[_0x8256('0x2d')][_0x8256('0x1b')]);_0x49eb01[_0x8256('0x18')]=qs[_0x8256('0x18')](_0x30d888[_0x8256('0x2d')][_0x8256('0x18')]);}_0x49eb01[_0x8256('0x35')]=qs[_0x8256('0x36')](_0x30d888['query'][_0x8256('0x36')]);_0x49eb01[_0x8256('0x37')]=qs[_0x8256('0x38')](_[_0x8256('0x39')](_0x30d888[_0x8256('0x2d')],_0x1a4ec6[_0x8256('0x38')]),_0x4727fb);if(_0x30d888['query'][_0x8256('0x3a')]){_0x49eb01['where']=_[_0x8256('0x3b')](_0x49eb01[_0x8256('0x37')],{'$or':_['map'](_0x4727fb,function(_0x33d3d0){if(_0x33d3d0[_0x8256('0x29')]!==_0x8256('0x3c')){var _0x4869db={};_0x4869db[_0x33d3d0[_0x8256('0x25')]]={'$like':'%'+_0x30d888[_0x8256('0x2d')][_0x8256('0x3a')]+'%'};return _0x4869db;}})});}_0x49eb01=_['merge']({},_0x49eb01,_0x30d888['options']);var _0x19500e={'where':_0x49eb01[_0x8256('0x37')]};return db['SmsApplication'][_0x8256('0x1a')](_0x19500e)[_0x8256('0x3d')](function(_0x207097){_0x443e9d[_0x8256('0x1a')]=_0x207097;if(_0x30d888[_0x8256('0x2d')][_0x8256('0x3e')]){_0x49eb01['include']=[{'all':!![]}];}return db['SmsApplication'][_0x8256('0x3f')](_0x49eb01);})[_0x8256('0x3d')](function(_0xd706a8){_0x443e9d['rows']=_0xd706a8;return _0x443e9d;})[_0x8256('0x3d')](respondWithFilteredResult(_0x325ad8,_0x49eb01))[_0x8256('0x40')](handleError(_0x325ad8,null));};exports[_0x8256('0x41')]=function(_0x4d40fa,_0x2362dd){var _0x133110={'raw':!![],'where':{'id':_0x4d40fa[_0x8256('0x42')]['id']}},_0x1e04f8={};_0x1e04f8[_0x8256('0x2b')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x1e04f8[_0x8256('0x2d')]=_[_0x8256('0x2e')](_0x4d40fa['query']);_0x1e04f8[_0x8256('0x38')]=_[_0x8256('0x30')](_0x1e04f8[_0x8256('0x2b')],_0x1e04f8[_0x8256('0x2d')]);_0x133110[_0x8256('0x2f')]=_[_0x8256('0x30')](_0x1e04f8['model'],qs['fields'](_0x4d40fa[_0x8256('0x2d')]['fields']));_0x133110[_0x8256('0x2f')]=_0x133110[_0x8256('0x2f')][_0x8256('0x32')]?_0x133110[_0x8256('0x2f')]:_0x1e04f8[_0x8256('0x2b')];if(_0x4d40fa[_0x8256('0x2d')]['includeAll']){_0x133110[_0x8256('0x43')]=[{'all':!![]}];}_0x133110=_[_0x8256('0x3b')]({},_0x133110,_0x4d40fa[_0x8256('0x44')]);return db[_0x8256('0x45')]['find'](_0x133110)[_0x8256('0x3d')](handleEntityNotFound(_0x2362dd,null))['then'](respondWithResult(_0x2362dd,null))['catch'](handleError(_0x2362dd,null));};exports['create']=function(_0x3571f9,_0x41fb00){return db[_0x8256('0x45')]['create'](_0x3571f9[_0x8256('0x46')],{})[_0x8256('0x3d')](respondWithResult(_0x41fb00,0xc9))[_0x8256('0x40')](handleError(_0x41fb00,null));};exports[_0x8256('0x20')]=function(_0x9dc2ce,_0x4c352e){if(_0x9dc2ce[_0x8256('0x46')]['id']){delete _0x9dc2ce['body']['id'];}return db[_0x8256('0x45')][_0x8256('0x47')]({'where':{'id':_0x9dc2ce[_0x8256('0x42')]['id']}})[_0x8256('0x3d')](handleEntityNotFound(_0x4c352e,null))['then'](saveUpdates(_0x9dc2ce[_0x8256('0x46')],null))['then'](respondWithResult(_0x4c352e,null))[_0x8256('0x40')](handleError(_0x4c352e,null));};exports[_0x8256('0x21')]=function(_0x8d311c,_0x5b245f){return db[_0x8256('0x45')][_0x8256('0x47')]({'where':{'id':_0x8d311c[_0x8256('0x42')]['id']}})[_0x8256('0x3d')](handleEntityNotFound(_0x5b245f,null))[_0x8256('0x3d')](removeEntity(_0x5b245f,null))['catch'](handleError(_0x5b245f,null));}; \ No newline at end of file +var _0x73ac=['params','keys','length','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x73ac,0x96));var _0xc73a=function(_0x2babfb,_0x4eb972){_0x2babfb=_0x2babfb-0x0;var _0x54e450=_0x73ac[_0x2babfb];return _0x54e450;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc73a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc73a('0x1'));var rp=require(_0xc73a('0x2'));var moment=require(_0xc73a('0x3'));var BPromise=require(_0xc73a('0x4'));var Mustache=require(_0xc73a('0x5'));var util=require(_0xc73a('0x6'));var path=require(_0xc73a('0x7'));var sox=require(_0xc73a('0x8'));var csv=require(_0xc73a('0x9'));var ejs=require(_0xc73a('0xa'));var fs=require('fs');var fs_extra=require(_0xc73a('0xb'));var _=require('lodash');var squel=require(_0xc73a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc73a('0xd'));var toCsv=require(_0xc73a('0x9'));var querystring=require(_0xc73a('0xe'));var Papa=require(_0xc73a('0xf'));var Redis=require(_0xc73a('0x10'));var authService=require(_0xc73a('0x11'));var qs=require(_0xc73a('0x12'));var as=require(_0xc73a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc73a('0x14'));var utils=require(_0xc73a('0x15'));var config=require(_0xc73a('0x16'));var licenseUtil=require(_0xc73a('0x17'));var db=require(_0xc73a('0x18'))['db'];function respondWithStatusCode(_0x4e96fb,_0x2a829a){_0x2a829a=_0x2a829a||0xcc;return function(_0x5bc650){if(_0x5bc650){return _0x4e96fb[_0xc73a('0x19')](_0x2a829a);}return _0x4e96fb[_0xc73a('0x1a')](_0x2a829a)[_0xc73a('0x1b')]();};}function respondWithResult(_0x165514,_0x267e9f){_0x267e9f=_0x267e9f||0xc8;return function(_0x2ba49d){if(_0x2ba49d){return _0x165514[_0xc73a('0x1a')](_0x267e9f)[_0xc73a('0x1c')](_0x2ba49d);}};}function respondWithFilteredResult(_0x590984,_0x4a5bf8){return function(_0xc72abf){if(_0xc72abf){var _0xdea62c=typeof _0x4a5bf8[_0xc73a('0x1d')]==='undefined'&&typeof _0x4a5bf8[_0xc73a('0x1e')]==='undefined';var _0x572992=_0xc72abf[_0xc73a('0x1f')];var _0x3542bf=_0xdea62c?0x0:_0x4a5bf8[_0xc73a('0x1d')];var _0x4015be=_0xdea62c?_0xc72abf[_0xc73a('0x1f')]:_0x4a5bf8['offset']+_0x4a5bf8[_0xc73a('0x1e')];var _0x751b63;if(_0x4015be>=_0x572992){_0x4015be=_0x572992;_0x751b63=0xc8;}else{_0x751b63=0xce;}_0x590984[_0xc73a('0x1a')](_0x751b63);return _0x590984[_0xc73a('0x20')](_0xc73a('0x21'),_0x3542bf+'-'+_0x4015be+'/'+_0x572992)['json'](_0xc72abf);}return null;};}function patchUpdates(_0x40505d){return function(_0x685f90){try{jsonpatch[_0xc73a('0x22')](_0x685f90,_0x40505d,!![]);}catch(_0x18f6a8){return BPromise[_0xc73a('0x23')](_0x18f6a8);}return _0x685f90[_0xc73a('0x24')]();};}function saveUpdates(_0x41d0d1,_0x908931){return function(_0x244584){if(_0x244584){return _0x244584[_0xc73a('0x25')](_0x41d0d1)[_0xc73a('0x26')](function(_0x5319ad){return _0x5319ad;});}return null;};}function removeEntity(_0x39e9d3,_0x177d90){return function(_0x5f5d84){if(_0x5f5d84){return _0x5f5d84['destroy']()['then'](function(){_0x39e9d3[_0xc73a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dadfb,_0x1e4e49){return function(_0x5035ac){if(!_0x5035ac){_0x1dadfb[_0xc73a('0x19')](0x194);}return _0x5035ac;};}function handleError(_0x5a5305,_0x48ef28){_0x48ef28=_0x48ef28||0x1f4;return function(_0x5e12fd){logger['error'](_0x5e12fd[_0xc73a('0x27')]);if(_0x5e12fd[_0xc73a('0x28')]){delete _0x5e12fd[_0xc73a('0x28')];}_0x5a5305[_0xc73a('0x1a')](_0x48ef28)[_0xc73a('0x29')](_0x5e12fd);};}exports['index']=function(_0x4ebd36,_0x48af28){var _0x5681d1={},_0x23fd44={},_0x188cb2={'count':0x0,'rows':[]};var _0x3eedcb=_[_0xc73a('0x2a')](db[_0xc73a('0x2b')][_0xc73a('0x2c')],function(_0xfc7db4){return{'name':_0xfc7db4[_0xc73a('0x2d')],'type':_0xfc7db4[_0xc73a('0x2e')][_0xc73a('0x2f')]};});_0x23fd44['model']=_[_0xc73a('0x2a')](_0x3eedcb,_0xc73a('0x28'));_0x23fd44[_0xc73a('0x30')]=_['keys'](_0x4ebd36[_0xc73a('0x30')]);_0x23fd44[_0xc73a('0x31')]=_[_0xc73a('0x32')](_0x23fd44['model'],_0x23fd44[_0xc73a('0x30')]);_0x5681d1[_0xc73a('0x33')]=_[_0xc73a('0x32')](_0x23fd44[_0xc73a('0x34')],qs[_0xc73a('0x35')](_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x35')]));_0x5681d1[_0xc73a('0x33')]=_0x5681d1[_0xc73a('0x33')]['length']?_0x5681d1[_0xc73a('0x33')]:_0x23fd44['model'];if(!_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x36')]('nolimit')){_0x5681d1[_0xc73a('0x1e')]=qs[_0xc73a('0x1e')](_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x1e')]);_0x5681d1[_0xc73a('0x1d')]=qs['offset'](_0x4ebd36['query'][_0xc73a('0x1d')]);}_0x5681d1[_0xc73a('0x37')]=qs[_0xc73a('0x38')](_0x4ebd36[_0xc73a('0x30')]['sort']);_0x5681d1[_0xc73a('0x39')]=qs[_0xc73a('0x31')](_['pick'](_0x4ebd36[_0xc73a('0x30')],_0x23fd44['filters']),_0x3eedcb);if(_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3a')]){_0x5681d1[_0xc73a('0x39')]=_[_0xc73a('0x3b')](_0x5681d1['where'],{'$or':_[_0xc73a('0x2a')](_0x3eedcb,function(_0x555c7e){if(_0x555c7e[_0xc73a('0x2e')]!==_0xc73a('0x3c')){var _0x2e9dad={};_0x2e9dad[_0x555c7e[_0xc73a('0x28')]]={'$like':'%'+_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3a')]+'%'};return _0x2e9dad;}})});}_0x5681d1=_[_0xc73a('0x3b')]({},_0x5681d1,_0x4ebd36[_0xc73a('0x3d')]);var _0x2b3167={'where':_0x5681d1[_0xc73a('0x39')]};return db['SmsApplication'][_0xc73a('0x1f')](_0x2b3167)[_0xc73a('0x26')](function(_0x4fb4df){_0x188cb2[_0xc73a('0x1f')]=_0x4fb4df;if(_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3e')]){_0x5681d1[_0xc73a('0x3f')]=[{'all':!![]}];}return db[_0xc73a('0x2b')][_0xc73a('0x40')](_0x5681d1);})['then'](function(_0x3e38ba){_0x188cb2['rows']=_0x3e38ba;return _0x188cb2;})[_0xc73a('0x26')](respondWithFilteredResult(_0x48af28,_0x5681d1))[_0xc73a('0x41')](handleError(_0x48af28,null));};exports['show']=function(_0x307f7f,_0x427a61){var _0x1a6fe9={'raw':!![],'where':{'id':_0x307f7f[_0xc73a('0x42')]['id']}},_0x164626={};_0x164626[_0xc73a('0x34')]=_[_0xc73a('0x43')](db[_0xc73a('0x2b')]['rawAttributes']);_0x164626[_0xc73a('0x30')]=_['keys'](_0x307f7f['query']);_0x164626[_0xc73a('0x31')]=_['intersection'](_0x164626[_0xc73a('0x34')],_0x164626[_0xc73a('0x30')]);_0x1a6fe9['attributes']=_[_0xc73a('0x32')](_0x164626[_0xc73a('0x34')],qs['fields'](_0x307f7f[_0xc73a('0x30')][_0xc73a('0x35')]));_0x1a6fe9[_0xc73a('0x33')]=_0x1a6fe9['attributes'][_0xc73a('0x44')]?_0x1a6fe9['attributes']:_0x164626[_0xc73a('0x34')];if(_0x307f7f['query'][_0xc73a('0x3e')]){_0x1a6fe9[_0xc73a('0x3f')]=[{'all':!![]}];}_0x1a6fe9=_['merge']({},_0x1a6fe9,_0x307f7f[_0xc73a('0x3d')]);return db[_0xc73a('0x2b')]['find'](_0x1a6fe9)[_0xc73a('0x26')](handleEntityNotFound(_0x427a61,null))['then'](respondWithResult(_0x427a61,null))[_0xc73a('0x41')](handleError(_0x427a61,null));};exports[_0xc73a('0x45')]=function(_0x2ad8c0,_0x3ddeb6){return db[_0xc73a('0x2b')]['create'](_0x2ad8c0[_0xc73a('0x46')],{})[_0xc73a('0x26')](respondWithResult(_0x3ddeb6,0xc9))['catch'](handleError(_0x3ddeb6,null));};exports[_0xc73a('0x25')]=function(_0x5d8a9d,_0x5c3b6f){if(_0x5d8a9d[_0xc73a('0x46')]['id']){delete _0x5d8a9d[_0xc73a('0x46')]['id'];}return db[_0xc73a('0x2b')]['find']({'where':{'id':_0x5d8a9d[_0xc73a('0x42')]['id']}})[_0xc73a('0x26')](handleEntityNotFound(_0x5c3b6f,null))[_0xc73a('0x26')](saveUpdates(_0x5d8a9d[_0xc73a('0x46')],null))['then'](respondWithResult(_0x5c3b6f,null))[_0xc73a('0x41')](handleError(_0x5c3b6f,null));};exports[_0xc73a('0x47')]=function(_0x1018b1,_0x44b730){return db[_0xc73a('0x2b')]['find']({'where':{'id':_0x1018b1[_0xc73a('0x42')]['id']}})[_0xc73a('0x26')](handleEntityNotFound(_0x44b730,null))[_0xc73a('0x26')](removeEntity(_0x44b730,null))[_0xc73a('0x41')](handleError(_0x44b730,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7984e24..6a04555 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 _0x37ba=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x33f072,_0x43f623){var _0x493ccd=function(_0x41e75d){while(--_0x41e75d){_0x33f072['push'](_0x33f072['shift']());}};_0x493ccd(++_0x43f623);}(_0x37ba,0x113));var _0xa37b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x37ba[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xa37b('0x0'));var util=require('util');var logger=require(_0xa37b('0x1'))('api');var moment=require(_0xa37b('0x2'));var BPromise=require('bluebird');var rp=require(_0xa37b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa37b('0x4'));var config=require(_0xa37b('0x5'));var attributes=require(_0xa37b('0x6'));module[_0xa37b('0x7')]=function(_0x4e070c,_0x33fd7d){return _0x4e070c[_0xa37b('0x8')](_0xa37b('0x9'),attributes,{'tableName':_0xa37b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa37b('0xb'),'collate':_0xa37b('0xc')});}; \ No newline at end of file +var _0x6d56=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6d56,0x198));var _0x66d5=function(_0x40a1c7,_0x25e2f1){_0x40a1c7=_0x40a1c7-0x0;var _0x2c93bc=_0x6d56[_0x40a1c7];return _0x2c93bc;};'use strict';var _=require(_0x66d5('0x0'));var util=require(_0x66d5('0x1'));var logger=require(_0x66d5('0x2'))(_0x66d5('0x3'));var moment=require('moment');var BPromise=require(_0x66d5('0x4'));var rp=require(_0x66d5('0x5'));var fs=require('fs');var path=require(_0x66d5('0x6'));var rimraf=require(_0x66d5('0x7'));var config=require('../../config/environment');var attributes=require(_0x66d5('0x8'));module[_0x66d5('0x9')]=function(_0xf1a095,_0x2e76d1){return _0xf1a095[_0x66d5('0xa')](_0x66d5('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66d5('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 9e95b64..ebd12f7 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 _0x17a7=['SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x344e99,_0x530098){var _0x172d28=function(_0x1e68f4){while(--_0x1e68f4){_0x344e99['push'](_0x344e99['shift']());}};_0x172d28(++_0x530098);}(_0x17a7,0xc2));var _0x717a=function(_0x5217df,_0x4360ff){_0x5217df=_0x5217df-0x0;var _0x2b308d=_0x17a7[_0x5217df];return _0x2b308d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('SmsApplication,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});} \ No newline at end of file +var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x377d49,_0x273eb6){var _0x3fe875=function(_0xb98d0f){while(--_0xb98d0f){_0x377d49['push'](_0x377d49['shift']());}};_0x3fe875(++_0x273eb6);}(_0x4910,0x1d9));var _0x0491=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4910[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7d1ab62..dcc1262 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 _0x2032=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x19cfac,_0x3745dc){var _0x25d2a5=function(_0x2bad78){while(--_0x2bad78){_0x19cfac['push'](_0x19cfac['shift']());}};_0x25d2a5(++_0x3745dc);}(_0x2032,0xd9));var _0x2203=function(_0x288a1d,_0x4f954c){_0x288a1d=_0x288a1d-0x0;var _0x4f480e=_0x2032[_0x288a1d];return _0x4f480e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2203('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction[_0x2203('0x19')](_0x2203('0x14'),_0x2203('0x1a')),controller[_0x2203('0x1b')]);router['delete'](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x1c')),controller['destroy']);router[_0x2203('0x1d')]('/:id/tags',auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);module[_0x2203('0x1f')]=router; \ No newline at end of file +var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('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 586b59f..3fce183 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 _0x9330=['sequelize','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x501864,_0xb33d3f){var _0x32bfc0=function(_0x1f9395){while(--_0x1f9395){_0x501864['push'](_0x501864['shift']());}};_0x32bfc0(++_0xb33d3f);}(_0x9330,0x14a));var _0x0933=function(_0xacb4c1,_0x48e800){_0xacb4c1=_0xacb4c1-0x0;var _0x49ff5b=_0x9330[_0xacb4c1];return _0x49ff5b;};'use strict';var Sequelize=require(_0x0933('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x0933('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0933('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0933('0x2')]},'note':{'type':Sequelize[_0x0933('0x2')]},'phone':{'type':Sequelize[_0x0933('0x2')]},'read1stAt':{'type':Sequelize[_0x0933('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0933('0x4')]('in',_0x0933('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0933('0x4')]('in',_0x0933('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0933('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c7b=['ENUM','out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x580120,_0x19adcc){var _0x522749=function(_0x38ddb1){while(--_0x38ddb1){_0x580120['push'](_0x580120['shift']());}};_0x522749(++_0x19adcc);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x1a7de0,_0x2517f0){_0x1a7de0=_0x1a7de0-0x0;var _0x12838d=_0x6c7b[_0x1a7de0];return _0x12838d;};'use strict';var Sequelize=require(_0xb6c7('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb6c7('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'note':{'type':Sequelize[_0xb6c7('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb6c7('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in',_0xb6c7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb6c7('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb6c7('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 53bfc0c..d8e5534 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 _0x1949=['count','Content-Range','then','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','params','model','keys','filters','attributes','fields','length','includeAll','include','options','create','update','body','find','destroy','describe','addMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','order','where','pick','SmsInteractionId','merge','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','addTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','CmContact','Contact','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','Sms','N.A.','closedAt','format','disposition','out','System','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit'];(function(_0x1da55c,_0x49a42d){var _0x25c267=function(_0x276051){while(--_0x276051){_0x1da55c['push'](_0x1da55c['shift']());}};_0x25c267(++_0x49a42d);}(_0x1949,0x1ca));var _0x9194=function(_0x12d080,_0x568283){_0x12d080=_0x12d080-0x0;var _0x2088b1=_0x1949[_0x12d080];return _0x2088b1;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x9194('0x0'));var BPromise=require(_0x9194('0x1'));var util=require(_0x9194('0x2'));var path=require(_0x9194('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x9194('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x9194('0x5'));var pdf=require(_0x9194('0x6'));var logger=require(_0x9194('0x7'))(_0x9194('0x8'));var config=require(_0x9194('0x9'));var db=require(_0x9194('0xa'))['db'];config[_0x9194('0xb')]=_[_0x9194('0xc')](config[_0x9194('0xb')],{'host':_0x9194('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9194('0xb')]));require(_0x9194('0xe'))[_0x9194('0xf')](socket);function respondWithStatusCode(_0x3d303b,_0x55a667){_0x55a667=_0x55a667||0xcc;return function(_0x29df46){if(_0x29df46){return _0x3d303b[_0x9194('0x10')](_0x55a667);}return _0x3d303b[_0x9194('0x11')](_0x55a667)[_0x9194('0x12')]();};}function respondWithResult(_0x218222,_0x59c5b0){_0x59c5b0=_0x59c5b0||0xc8;return function(_0xae45d3){if(_0xae45d3){return _0x218222[_0x9194('0x11')](_0x59c5b0)[_0x9194('0x13')](_0xae45d3);}};}function respondWithFilteredResult(_0x1766fe,_0x311d83){return function(_0x4a10f9){if(_0x4a10f9){var _0xfa12d=typeof _0x311d83[_0x9194('0x14')]==='undefined'&&typeof _0x311d83[_0x9194('0x15')]==='undefined';var _0x1d4d88=_0x4a10f9['count'];var _0x48a84d=_0xfa12d?0x0:_0x311d83[_0x9194('0x14')];var _0x1fe445=_0xfa12d?_0x4a10f9[_0x9194('0x16')]:_0x311d83['offset']+_0x311d83[_0x9194('0x15')];var _0x436baa;if(_0x1fe445>=_0x1d4d88){_0x1fe445=_0x1d4d88;_0x436baa=0xc8;}else{_0x436baa=0xce;}_0x1766fe[_0x9194('0x11')](_0x436baa);return _0x1766fe['set'](_0x9194('0x17'),_0x48a84d+'-'+_0x1fe445+'/'+_0x1d4d88)[_0x9194('0x13')](_0x4a10f9);}return null;};}function saveUpdates(_0x11b2d3){return function(_0x11b85c){if(_0x11b85c){return _0x11b85c['update'](_0x11b2d3)[_0x9194('0x18')](function(_0xef3e87){return _0xef3e87;});}return null;};}function removeEntity(_0x37697c){return function(_0x9cf735){if(_0x9cf735){return _0x9cf735['destroy']()[_0x9194('0x18')](function(){_0x37697c['status'](0xcc)[_0x9194('0x12')]();});}};}function handleEntityNotFound(_0xfc7c01){return function(_0x542abc){if(!_0x542abc){_0xfc7c01[_0x9194('0x10')](0x194);}return _0x542abc;};}function handleError(_0xd90b99,_0x4e0c6f){_0x4e0c6f=_0x4e0c6f||0x1f4;return function(_0x2289c5){logger[_0x9194('0x19')](_0x2289c5[_0x9194('0x1a')]);if(_0x2289c5['name']){delete _0x2289c5[_0x9194('0x1b')];}_0xd90b99[_0x9194('0x11')](_0x4e0c6f)[_0x9194('0x1c')](_0x2289c5);};}exports[_0x9194('0x1d')]=function(_0x5d5259,_0x1ed3ed){var _0x33c8b0={};var _0x412287=_[_0x9194('0x1e')](db[_0x9194('0x1f')][_0x9194('0x20')],function(_0x4959ba){return{'name':_0x4959ba[_0x9194('0x21')],'type':_0x4959ba[_0x9194('0x22')][_0x9194('0x23')]};});_0x33c8b0=qs[_0x9194('0x24')](_0x412287,_0x5d5259);return interaction[_0x9194('0x25')]('sms',_0x5d5259[_0x9194('0x26')],_0x5d5259[_0x9194('0x27')],_0x33c8b0,_0x412287)['then'](respondWithFilteredResult(_0x1ed3ed,_0x33c8b0))[_0x9194('0x28')](handleError(_0x1ed3ed,null));};exports[_0x9194('0x29')]=function(_0x1f1be8,_0x44992d){var _0x42c823={'raw':![],'where':{'id':_0x1f1be8[_0x9194('0x2a')]['id']}},_0xf34a70={};_0xf34a70[_0x9194('0x2b')]=_[_0x9194('0x2c')](db[_0x9194('0x1f')][_0x9194('0x20')]);_0xf34a70[_0x9194('0x26')]=_[_0x9194('0x2c')](_0x1f1be8[_0x9194('0x26')]);_0xf34a70[_0x9194('0x2d')]=_['intersection'](_0xf34a70[_0x9194('0x2b')],_0xf34a70['query']);_0x42c823[_0x9194('0x2e')]=_['intersection'](_0xf34a70[_0x9194('0x2b')],qs['fields'](_0x1f1be8[_0x9194('0x26')][_0x9194('0x2f')]));_0x42c823[_0x9194('0x2e')]=_0x42c823['attributes'][_0x9194('0x30')]?_0x42c823[_0x9194('0x2e')]:_0xf34a70[_0x9194('0x2b')];if(_0x1f1be8[_0x9194('0x26')][_0x9194('0x31')]){_0x42c823[_0x9194('0x32')]=[{'all':!![]}];}_0x42c823=_['merge']({},_0x42c823,_0x1f1be8[_0x9194('0x33')]);return db[_0x9194('0x1f')]['find'](_0x42c823)[_0x9194('0x18')](handleEntityNotFound(_0x44992d,null))['then'](respondWithResult(_0x44992d,null))[_0x9194('0x28')](handleError(_0x44992d,null));};exports[_0x9194('0x34')]=function(_0x9482db,_0x1905f1){return db[_0x9194('0x1f')]['create'](_0x9482db['body'],{})[_0x9194('0x18')](respondWithResult(_0x1905f1,0xc9))[_0x9194('0x28')](handleError(_0x1905f1,null));};exports[_0x9194('0x35')]=function(_0x5a8354,_0x4ea85){if(_0x5a8354['body']['id']){delete _0x5a8354[_0x9194('0x36')]['id'];}return db[_0x9194('0x1f')][_0x9194('0x37')]({'where':{'id':_0x5a8354['params']['id']}})[_0x9194('0x18')](handleEntityNotFound(_0x4ea85,null))[_0x9194('0x18')](saveUpdates(_0x5a8354[_0x9194('0x36')],null))['then'](respondWithResult(_0x4ea85,null))['catch'](handleError(_0x4ea85,null));};exports[_0x9194('0x38')]=function(_0x547670,_0x6ba75f){return db[_0x9194('0x1f')]['find']({'where':{'id':_0x547670[_0x9194('0x2a')]['id']}})['then'](handleEntityNotFound(_0x6ba75f,null))[_0x9194('0x18')](removeEntity(_0x6ba75f,null))[_0x9194('0x28')](handleError(_0x6ba75f,null));};exports[_0x9194('0x39')]=function(_0x272702,_0x103ba4){return db[_0x9194('0x1f')][_0x9194('0x39')]()[_0x9194('0x18')](respondWithResult(_0x103ba4,null))['catch'](handleError(_0x103ba4,null));};exports[_0x9194('0x3a')]=function(_0x1eeb82,_0x39d42c){return db['SmsMessage'][_0x9194('0x37')]({'where':{'id':_0x1eeb82[_0x9194('0x2a')]['id']}})[_0x9194('0x18')](handleEntityNotFound(_0x39d42c,null))['then'](function(_0x5abded){if(_0x5abded){return _0x5abded[_0x9194('0x3a')](_0x1eeb82[_0x9194('0x36')][_0x9194('0x3b')],_[_0x9194('0x3c')](_0x1eeb82['body'],['ids','id'])||{});}})[_0x9194('0x18')](respondWithResult(_0x39d42c,null))[_0x9194('0x28')](handleError(_0x39d42c,null));};exports[_0x9194('0x3d')]=function(_0x5aa3b5,_0x529ae7){var _0x55c54f={'raw':![],'where':{}};var _0x1857fb={};var _0x1f4996={'count':0x0,'rows':[]};return db[_0x9194('0x1f')][_0x9194('0x3e')]({'where':{'id':_0x5aa3b5['params']['id']}})[_0x9194('0x18')](handleEntityNotFound(_0x529ae7,null))[_0x9194('0x18')](function(_0x30f0a9){if(_0x30f0a9){_0x1857fb[_0x9194('0x2b')]=_[_0x9194('0x2c')](db['SmsMessage'][_0x9194('0x20')]);_0x1857fb[_0x9194('0x26')]=_['keys'](_0x5aa3b5['query']);_0x1857fb['filters']=_[_0x9194('0x3f')](_0x1857fb[_0x9194('0x2b')],_0x1857fb[_0x9194('0x26')]);_0x55c54f[_0x9194('0x2e')]=_['intersection'](_0x1857fb[_0x9194('0x2b')],qs['fields'](_0x5aa3b5['query'][_0x9194('0x2f')]));_0x55c54f['attributes']=_0x55c54f[_0x9194('0x2e')]['length']?_0x55c54f[_0x9194('0x2e')]:_0x1857fb[_0x9194('0x2b')];if(!_0x5aa3b5[_0x9194('0x26')][_0x9194('0x40')](_0x9194('0x41'))){_0x55c54f['limit']=qs[_0x9194('0x15')](_0x5aa3b5[_0x9194('0x26')][_0x9194('0x15')]);_0x55c54f[_0x9194('0x14')]=qs['offset'](_0x5aa3b5[_0x9194('0x26')][_0x9194('0x14')]);}_0x55c54f[_0x9194('0x42')]=qs['sort'](_0x5aa3b5['query']['sort']);_0x55c54f[_0x9194('0x43')]=qs[_0x9194('0x2d')](_[_0x9194('0x44')](_0x5aa3b5[_0x9194('0x26')],_0x1857fb[_0x9194('0x2d')]));_0x55c54f[_0x9194('0x43')][_0x9194('0x45')]=_0x30f0a9['id'];if(_0x5aa3b5[_0x9194('0x26')]['filter']){_0x55c54f[_0x9194('0x43')]=_[_0x9194('0x46')](_0x55c54f[_0x9194('0x43')],{'$or':_['map'](_0x55c54f[_0x9194('0x2e')],function(_0x237bef){var _0x4e95e8={};_0x4e95e8[_0x237bef]={'$like':'%'+_0x5aa3b5[_0x9194('0x26')][_0x9194('0x47')]+'%'};return _0x4e95e8;})});}if(_0x5aa3b5[_0x9194('0x26')][_0x9194('0x48')]){var _0x3dd96e=_0x5aa3b5[_0x9194('0x26')][_0x9194('0x48')]['split'](',');var _0x5f3293={};_0x5f3293[_0x3dd96e[0x0]]={'$gte':moment(_0x3dd96e[0x1])['format'](_0x9194('0x49'))};_0x55c54f[_0x9194('0x43')]=_[_0x9194('0x46')](_0x55c54f[_0x9194('0x43')],_0x5f3293);}_0x55c54f=_[_0x9194('0x46')]({},_0x55c54f,_0x5aa3b5[_0x9194('0x33')]);return db['SmsMessage'][_0x9194('0x16')]({'where':_0x55c54f[_0x9194('0x43')]})[_0x9194('0x18')](function(_0x3bba5d){_0x1f4996['count']=_0x3bba5d;if(_0x5aa3b5['query'][_0x9194('0x31')]){_0x55c54f[_0x9194('0x32')]=[{'all':!![]}];}return db[_0x9194('0x4a')][_0x9194('0x25')](_0x55c54f);})[_0x9194('0x18')](function(_0x228865){_0x1f4996['rows']=_0x228865;return _0x1f4996;});}})[_0x9194('0x18')](respondWithFilteredResult(_0x529ae7,_0x55c54f))['catch'](handleError(_0x529ae7,null));};exports[_0x9194('0x4b')]=function(_0x54cf27,_0x55acd9){return db[_0x9194('0x1f')][_0x9194('0x37')]({'where':{'id':_0x54cf27['params']['id']}})['then'](handleEntityNotFound(_0x55acd9,null))[_0x9194('0x18')](function(_0x5aa935){if(_0x5aa935){return _0x5aa935['setTags'](_0x54cf27[_0x9194('0x36')]['ids'],_['omit'](_0x54cf27[_0x9194('0x36')],[_0x9194('0x3b'),'id'])||{})[_0x9194('0x4c')](function(){return db[_0x9194('0x4d')][_0x9194('0x25')]({'attributes':['id',_0x9194('0x1b'),_0x9194('0x4e')],'where':{'id':_0x54cf27['body'][_0x9194('0x3b')]}});})[_0x9194('0x18')](function(_0x336e36){socket[_0x9194('0x4f')]('smsInteractionTags:save',{'id':Number(_0x54cf27[_0x9194('0x2a')]['id']),'tags':_0x336e36||[]});return{'id':Number(_0x54cf27[_0x9194('0x2a')]['id']),'tags':_0x336e36||[]};});}})[_0x9194('0x18')](respondWithResult(_0x55acd9,null))[_0x9194('0x28')](handleError(_0x55acd9,null));};exports[_0x9194('0x50')]=function(_0x4fc26b,_0x170d10){return db['SmsInteraction'][_0x9194('0x37')]({'where':{'id':_0x4fc26b['params']['id']}})[_0x9194('0x18')](handleEntityNotFound(_0x170d10,null))[_0x9194('0x18')](function(_0x6dcc74){if(_0x6dcc74){return _0x6dcc74[_0x9194('0x50')](_0x4fc26b[_0x9194('0x26')][_0x9194('0x3b')]);}})[_0x9194('0x18')](respondWithStatusCode(_0x170d10,null))[_0x9194('0x28')](handleError(_0x170d10,null));};exports[_0x9194('0x51')]=function(_0x433508,_0x15b7b6){var _0x1bf700=moment()[_0x9194('0x52')]()[_0x9194('0x53')]();var _0x6f8a11=path[_0x9194('0x54')](config[_0x9194('0x55')],_0x9194('0x56'),'files',_0x9194('0x57'));var _0x219ca3=path[_0x9194('0x54')](_0x6f8a11,_0x1bf700);var _0x14004e=util['format'](_0x9194('0x58'),_0x433508[_0x9194('0x2a')]['id'],_0x1bf700);var _0x3b4ced=path[_0x9194('0x54')](_0x6f8a11,_0x14004e);var _0x4e177e=[];_0x4e177e[_0x9194('0x59')]({'model':db[_0x9194('0x5a')],'as':_0x9194('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x4e177e[_0x9194('0x59')]({'model':db[_0x9194('0x5b')],'as':_0x9194('0x5c'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x19eb58=[{'model':db[_0x9194('0x4a')],'as':_0x9194('0x5d'),'attributes':['id','body',_0x9194('0x5e'),_0x9194('0x5f'),_0x9194('0x60'),_0x9194('0x61')],'include':_0x4e177e}];_0x19eb58[_0x9194('0x59')]({'model':db[_0x9194('0x62')],'as':_0x9194('0x63'),'attributes':['id',_0x9194('0x1b')]});_0x19eb58[_0x9194('0x59')]({'model':db[_0x9194('0x5a')],'as':_0x9194('0x64'),'attributes':['id',_0x9194('0x65')]});return db[_0x9194('0x1f')]['find']({'where':{'id':_0x433508[_0x9194('0x2a')]['id']},'include':_0x19eb58})[_0x9194('0x18')](handleEntityNotFound(_0x15b7b6,null))[_0x9194('0x18')](function(_0x1b3124){if(_0x1b3124){var _0x3e6f61=_0x1b3124[_0x9194('0x66')]({'plain':!![]});fs[_0x9194('0x67')](_0x219ca3);var _0x4fb67e={'channel':_0x9194('0x68'),'account':_0x3e6f61['Account']['name'],'agent':_0x3e6f61[_0x9194('0x64')]?_0x3e6f61[_0x9194('0x64')][_0x9194('0x65')]:_0x9194('0x69'),'createdAt':moment(_0x3e6f61[_0x9194('0x5e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9194('0x53')](),'closedAt':_0x3e6f61['closed']?moment(_0x3e6f61[_0x9194('0x6a')])[_0x9194('0x6b')](_0x9194('0x49'))[_0x9194('0x53')]():'','disposition':_0x3e6f61[_0x9194('0x6c')],'messages':_(_0x3e6f61[_0x9194('0x5d')])[_0x9194('0x47')]({'secret':![]})[_0x9194('0x1e')](function(_0x3b59cc){return{'date':moment(_0x3b59cc['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9194('0x53')](),'sender':_0x3b59cc[_0x9194('0x5f')]===_0x9194('0x6d')?_0x3b59cc[_0x9194('0x5a')]?_0x3b59cc[_0x9194('0x5a')][_0x9194('0x65')]:_0x9194('0x6e'):_0x3b59cc[_0x9194('0x5c')]['firstName']+(_0x3b59cc[_0x9194('0x5c')][_0x9194('0x6f')]?'\x20'+_0x3b59cc[_0x9194('0x5c')][_0x9194('0x6f')]:''),'body':_0x3b59cc['body'],'direction':_0x3b59cc[_0x9194('0x5f')]===_0x9194('0x6d')?'A':'C','secret':_0x3b59cc[_0x9194('0x60')],'read':_0x3b59cc['read']};})[_0x9194('0x70')]()};return ejs['renderFile'](path[_0x9194('0x54')](config[_0x9194('0x55')],'server',_0x9194('0x71'),_0x9194('0x72')),{'interaction':_0x4fb67e})[_0x9194('0x18')](function(_0x3eac5a){var _0x54af8f=path['join'](_0x219ca3,_0x9194('0x73')+_0x3e6f61['id']+'-'+_0x1bf700+_0x9194('0x74'));var _0x3a4034={'path':_0x54af8f,'channel':_0x9194('0x68'),'interactionId':_0x3e6f61['id']};return pdf['createPdfFromHTML'](_0x3eac5a,_0x3a4034);})[_0x9194('0x18')](function(){return new BPromise(function(_0x5ce156,_0x368d9a){zipdir(_0x219ca3,{'saveTo':_0x3b4ced},function(_0x32b7e6,_0x2fb436){if(_0x32b7e6)return _0x368d9a(_0x32b7e6);return _0x5ce156(_0x2fb436);});})['then'](function(){return new BPromise(function(_0x4a323f,_0x478871){rimraf(_0x219ca3,function(_0x2c0e0a){if(_0x2c0e0a)_0x478871(_0x2c0e0a);return _0x4a323f();});});})[_0x9194('0x18')](function(){return _0x15b7b6[_0x9194('0x51')](_0x3b4ced,_0x14004e,function(_0x574591){if(_0x574591){console[_0x9194('0x75')](_0x9194('0x76'),_0x574591);}else{fs[_0x9194('0x77')](_0x3b4ced);}});});});}else{return _0x15b7b6['sendStatus'](0xc8);}})[_0x9194('0x28')](handleError(_0x15b7b6,null));}; \ No newline at end of file +var _0x3bf5=['unix','toString','join','root','files','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','Account','Owner','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','update','then','destroy','error','name','send','index','map','SmsInteraction','fieldName','key','getOptions','sms','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','describe','addMessage','ids','omit','findOne','SmsMessage','filters','hasOwnProperty','order','sort','where','SmsInteractionId','filter','$gte','split','format','rows','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x3bf5,0x17e));var _0x53bf=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x3bf5[_0x29db36];return _0x234e87;};'use strict';var rimraf=require(_0x53bf('0x0'));var zipdir=require(_0x53bf('0x1'));var moment=require('moment');var BPromise=require(_0x53bf('0x2'));var util=require(_0x53bf('0x3'));var path=require('path');var ejs=require(_0x53bf('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x53bf('0x5'));var qs=require(_0x53bf('0x6'));var pdf=require(_0x53bf('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x53bf('0x8'));var db=require(_0x53bf('0x9'))['db'];config[_0x53bf('0xa')]=_[_0x53bf('0xb')](config['redis'],{'host':_0x53bf('0xc'),'port':0x18eb});var socket=require(_0x53bf('0xd'))(new Redis(config[_0x53bf('0xa')]));require('./smsInteraction.socket')[_0x53bf('0xe')](socket);function respondWithStatusCode(_0x190f38,_0x564636){_0x564636=_0x564636||0xcc;return function(_0x42a09c){if(_0x42a09c){return _0x190f38[_0x53bf('0xf')](_0x564636);}return _0x190f38[_0x53bf('0x10')](_0x564636)[_0x53bf('0x11')]();};}function respondWithResult(_0x4e6b73,_0x42c2c3){_0x42c2c3=_0x42c2c3||0xc8;return function(_0x504e79){if(_0x504e79){return _0x4e6b73[_0x53bf('0x10')](_0x42c2c3)[_0x53bf('0x12')](_0x504e79);}};}function respondWithFilteredResult(_0x37b4dd,_0x50604e){return function(_0x489b58){if(_0x489b58){var _0x21b7a4=typeof _0x50604e[_0x53bf('0x13')]===_0x53bf('0x14')&&typeof _0x50604e['limit']===_0x53bf('0x14');var _0xb83711=_0x489b58[_0x53bf('0x15')];var _0x4d304c=_0x21b7a4?0x0:_0x50604e[_0x53bf('0x13')];var _0x5b7fbe=_0x21b7a4?_0x489b58[_0x53bf('0x15')]:_0x50604e[_0x53bf('0x13')]+_0x50604e[_0x53bf('0x16')];var _0x2fc977;if(_0x5b7fbe>=_0xb83711){_0x5b7fbe=_0xb83711;_0x2fc977=0xc8;}else{_0x2fc977=0xce;}_0x37b4dd[_0x53bf('0x10')](_0x2fc977);return _0x37b4dd['set']('Content-Range',_0x4d304c+'-'+_0x5b7fbe+'/'+_0xb83711)[_0x53bf('0x12')](_0x489b58);}return null;};}function saveUpdates(_0x2f05ed){return function(_0x5ab601){if(_0x5ab601){return _0x5ab601[_0x53bf('0x17')](_0x2f05ed)[_0x53bf('0x18')](function(_0xf6f7b0){return _0xf6f7b0;});}return null;};}function removeEntity(_0x574429){return function(_0x5248d1){if(_0x5248d1){return _0x5248d1[_0x53bf('0x19')]()[_0x53bf('0x18')](function(){_0x574429[_0x53bf('0x10')](0xcc)[_0x53bf('0x11')]();});}};}function handleEntityNotFound(_0x3be89e){return function(_0x3af640){if(!_0x3af640){_0x3be89e['sendStatus'](0x194);}return _0x3af640;};}function handleError(_0x3f4d70,_0xe381f3){_0xe381f3=_0xe381f3||0x1f4;return function(_0x5bb33a){logger[_0x53bf('0x1a')](_0x5bb33a['stack']);if(_0x5bb33a[_0x53bf('0x1b')]){delete _0x5bb33a[_0x53bf('0x1b')];}_0x3f4d70[_0x53bf('0x10')](_0xe381f3)[_0x53bf('0x1c')](_0x5bb33a);};}exports[_0x53bf('0x1d')]=function(_0x30e863,_0x1030ea){var _0x280dda={};var _0x31221d=_[_0x53bf('0x1e')](db[_0x53bf('0x1f')]['rawAttributes'],function(_0x380451){return{'name':_0x380451[_0x53bf('0x20')],'type':_0x380451['type'][_0x53bf('0x21')]};});_0x280dda=qs[_0x53bf('0x22')](_0x31221d,_0x30e863);return interaction['findAll'](_0x53bf('0x23'),_0x30e863[_0x53bf('0x24')],_0x30e863[_0x53bf('0x25')],_0x280dda,_0x31221d)[_0x53bf('0x18')](respondWithFilteredResult(_0x1030ea,_0x280dda))['catch'](handleError(_0x1030ea,null));};exports[_0x53bf('0x26')]=function(_0xf18bd5,_0x53de98){var _0x46555b={'raw':![],'where':{'id':_0xf18bd5[_0x53bf('0x27')]['id']}},_0x153f12={};_0x153f12[_0x53bf('0x28')]=_[_0x53bf('0x29')](db[_0x53bf('0x1f')]['rawAttributes']);_0x153f12[_0x53bf('0x24')]=_[_0x53bf('0x29')](_0xf18bd5[_0x53bf('0x24')]);_0x153f12['filters']=_[_0x53bf('0x2a')](_0x153f12['model'],_0x153f12['query']);_0x46555b[_0x53bf('0x2b')]=_[_0x53bf('0x2a')](_0x153f12[_0x53bf('0x28')],qs[_0x53bf('0x2c')](_0xf18bd5[_0x53bf('0x24')][_0x53bf('0x2c')]));_0x46555b['attributes']=_0x46555b[_0x53bf('0x2b')][_0x53bf('0x2d')]?_0x46555b[_0x53bf('0x2b')]:_0x153f12['model'];if(_0xf18bd5[_0x53bf('0x24')][_0x53bf('0x2e')]){_0x46555b[_0x53bf('0x2f')]=[{'all':!![]}];}_0x46555b=_[_0x53bf('0x30')]({},_0x46555b,_0xf18bd5['options']);return db[_0x53bf('0x1f')][_0x53bf('0x31')](_0x46555b)[_0x53bf('0x18')](handleEntityNotFound(_0x53de98,null))[_0x53bf('0x18')](respondWithResult(_0x53de98,null))[_0x53bf('0x32')](handleError(_0x53de98,null));};exports[_0x53bf('0x33')]=function(_0x47ca55,_0x4109ad){return db[_0x53bf('0x1f')][_0x53bf('0x33')](_0x47ca55[_0x53bf('0x34')],{})[_0x53bf('0x18')](respondWithResult(_0x4109ad,0xc9))[_0x53bf('0x32')](handleError(_0x4109ad,null));};exports[_0x53bf('0x17')]=function(_0x547b55,_0x27ed85){if(_0x547b55['body']['id']){delete _0x547b55[_0x53bf('0x34')]['id'];}return db['SmsInteraction'][_0x53bf('0x31')]({'where':{'id':_0x547b55[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x27ed85,null))['then'](saveUpdates(_0x547b55[_0x53bf('0x34')],null))[_0x53bf('0x18')](respondWithResult(_0x27ed85,null))['catch'](handleError(_0x27ed85,null));};exports[_0x53bf('0x19')]=function(_0x33a79b,_0x3458aa){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x33a79b[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x3458aa,null))[_0x53bf('0x18')](removeEntity(_0x3458aa,null))['catch'](handleError(_0x3458aa,null));};exports[_0x53bf('0x35')]=function(_0xdded86,_0x21c023){return db['SmsInteraction']['describe']()[_0x53bf('0x18')](respondWithResult(_0x21c023,null))[_0x53bf('0x32')](handleError(_0x21c023,null));};exports[_0x53bf('0x36')]=function(_0x1ff7f3,_0x305100){return db['SmsMessage'][_0x53bf('0x31')]({'where':{'id':_0x1ff7f3[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x305100,null))[_0x53bf('0x18')](function(_0x385e1b){if(_0x385e1b){return _0x385e1b['addMessage'](_0x1ff7f3['body'][_0x53bf('0x37')],_[_0x53bf('0x38')](_0x1ff7f3['body'],[_0x53bf('0x37'),'id'])||{});}})['then'](respondWithResult(_0x305100,null))['catch'](handleError(_0x305100,null));};exports['getMessages']=function(_0x3a0602,_0x3d98d2){var _0x50a6d9={'raw':![],'where':{}};var _0x1a2367={};var _0x5c199b={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x53bf('0x39')]({'where':{'id':_0x3a0602[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x3d98d2,null))['then'](function(_0x4f4678){if(_0x4f4678){_0x1a2367['model']=_['keys'](db[_0x53bf('0x3a')]['rawAttributes']);_0x1a2367[_0x53bf('0x24')]=_[_0x53bf('0x29')](_0x3a0602[_0x53bf('0x24')]);_0x1a2367[_0x53bf('0x3b')]=_[_0x53bf('0x2a')](_0x1a2367[_0x53bf('0x28')],_0x1a2367['query']);_0x50a6d9['attributes']=_['intersection'](_0x1a2367[_0x53bf('0x28')],qs['fields'](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x2c')]));_0x50a6d9['attributes']=_0x50a6d9[_0x53bf('0x2b')][_0x53bf('0x2d')]?_0x50a6d9['attributes']:_0x1a2367[_0x53bf('0x28')];if(!_0x3a0602['query'][_0x53bf('0x3c')]('nolimit')){_0x50a6d9[_0x53bf('0x16')]=qs[_0x53bf('0x16')](_0x3a0602['query'][_0x53bf('0x16')]);_0x50a6d9[_0x53bf('0x13')]=qs[_0x53bf('0x13')](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x13')]);}_0x50a6d9[_0x53bf('0x3d')]=qs[_0x53bf('0x3e')](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x3e')]);_0x50a6d9[_0x53bf('0x3f')]=qs[_0x53bf('0x3b')](_['pick'](_0x3a0602[_0x53bf('0x24')],_0x1a2367[_0x53bf('0x3b')]));_0x50a6d9['where'][_0x53bf('0x40')]=_0x4f4678['id'];if(_0x3a0602[_0x53bf('0x24')][_0x53bf('0x41')]){_0x50a6d9['where']=_[_0x53bf('0x30')](_0x50a6d9[_0x53bf('0x3f')],{'$or':_[_0x53bf('0x1e')](_0x50a6d9[_0x53bf('0x2b')],function(_0x411856){var _0x827a82={};_0x827a82[_0x411856]={'$like':'%'+_0x3a0602[_0x53bf('0x24')][_0x53bf('0x41')]+'%'};return _0x827a82;})});}if(_0x3a0602['query']['$gte']){var _0x477b48=_0x3a0602[_0x53bf('0x24')][_0x53bf('0x42')][_0x53bf('0x43')](',');var _0x249614={};_0x249614[_0x477b48[0x0]]={'$gte':moment(_0x477b48[0x1])[_0x53bf('0x44')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50a6d9[_0x53bf('0x3f')]=_[_0x53bf('0x30')](_0x50a6d9['where'],_0x249614);}_0x50a6d9=_[_0x53bf('0x30')]({},_0x50a6d9,_0x3a0602['options']);return db[_0x53bf('0x3a')][_0x53bf('0x15')]({'where':_0x50a6d9[_0x53bf('0x3f')]})[_0x53bf('0x18')](function(_0x38cd4a){_0x5c199b[_0x53bf('0x15')]=_0x38cd4a;if(_0x3a0602[_0x53bf('0x24')][_0x53bf('0x2e')]){_0x50a6d9[_0x53bf('0x2f')]=[{'all':!![]}];}return db[_0x53bf('0x3a')]['findAll'](_0x50a6d9);})[_0x53bf('0x18')](function(_0x4127da){_0x5c199b[_0x53bf('0x45')]=_0x4127da;return _0x5c199b;});}})[_0x53bf('0x18')](respondWithFilteredResult(_0x3d98d2,_0x50a6d9))[_0x53bf('0x32')](handleError(_0x3d98d2,null));};exports[_0x53bf('0x46')]=function(_0x4d144e,_0x59d864){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x4d144e[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x59d864,null))[_0x53bf('0x18')](function(_0x4ae3ae){if(_0x4ae3ae){return _0x4ae3ae['setTags'](_0x4d144e[_0x53bf('0x34')][_0x53bf('0x37')],_[_0x53bf('0x38')](_0x4d144e[_0x53bf('0x34')],[_0x53bf('0x37'),'id'])||{})[_0x53bf('0x47')](function(){return db[_0x53bf('0x48')]['findAll']({'attributes':['id','name',_0x53bf('0x49')],'where':{'id':_0x4d144e[_0x53bf('0x34')][_0x53bf('0x37')]}});})[_0x53bf('0x18')](function(_0x5b0823){socket[_0x53bf('0x4a')](_0x53bf('0x4b'),{'id':Number(_0x4d144e[_0x53bf('0x27')]['id']),'tags':_0x5b0823||[]});return{'id':Number(_0x4d144e[_0x53bf('0x27')]['id']),'tags':_0x5b0823||[]};});}})['then'](respondWithResult(_0x59d864,null))['catch'](handleError(_0x59d864,null));};exports['removeTags']=function(_0x50aafc,_0x7bb73){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x50aafc[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x7bb73,null))['then'](function(_0x29af85){if(_0x29af85){return _0x29af85[_0x53bf('0x4c')](_0x50aafc[_0x53bf('0x24')][_0x53bf('0x37')]);}})[_0x53bf('0x18')](respondWithStatusCode(_0x7bb73,null))[_0x53bf('0x32')](handleError(_0x7bb73,null));};exports[_0x53bf('0x4d')]=function(_0x196ef1,_0x2f91bc){var _0xd56760=moment()[_0x53bf('0x4e')]()[_0x53bf('0x4f')]();var _0x43a787=path[_0x53bf('0x50')](config[_0x53bf('0x51')],'server',_0x53bf('0x52'),'tmp');var _0x7ca19b=path['join'](_0x43a787,_0xd56760);var _0x45c27e=util[_0x53bf('0x44')](_0x53bf('0x53'),_0x196ef1[_0x53bf('0x27')]['id'],_0xd56760);var _0x523e2b=path[_0x53bf('0x50')](_0x43a787,_0x45c27e);var _0x1bed6e=[];_0x1bed6e[_0x53bf('0x54')]({'model':db[_0x53bf('0x55')],'as':_0x53bf('0x55'),'attributes':['id','fullname'],'raw':!![]});_0x1bed6e[_0x53bf('0x54')]({'model':db[_0x53bf('0x56')],'as':_0x53bf('0x57'),'attributes':['id',_0x53bf('0x58'),_0x53bf('0x59')],'raw':!![]});var _0xbdc28e=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x53bf('0x34'),_0x53bf('0x5a'),_0x53bf('0x5b'),_0x53bf('0x5c'),_0x53bf('0x5d')],'include':_0x1bed6e}];_0xbdc28e[_0x53bf('0x54')]({'model':db['SmsAccount'],'as':_0x53bf('0x5e'),'attributes':['id',_0x53bf('0x1b')]});_0xbdc28e[_0x53bf('0x54')]({'model':db[_0x53bf('0x55')],'as':_0x53bf('0x5f'),'attributes':['id','fullname']});return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x196ef1[_0x53bf('0x27')]['id']},'include':_0xbdc28e})[_0x53bf('0x18')](handleEntityNotFound(_0x2f91bc,null))[_0x53bf('0x18')](function(_0x4e7e41){if(_0x4e7e41){var _0x979ae3=_0x4e7e41['get']({'plain':!![]});fs[_0x53bf('0x60')](_0x7ca19b);var _0x58a82a={'channel':_0x53bf('0x61'),'account':_0x979ae3[_0x53bf('0x5e')]['name'],'agent':_0x979ae3[_0x53bf('0x5f')]?_0x979ae3[_0x53bf('0x5f')]['fullname']:_0x53bf('0x62'),'createdAt':moment(_0x979ae3[_0x53bf('0x5a')])[_0x53bf('0x44')](_0x53bf('0x63'))[_0x53bf('0x4f')](),'closedAt':_0x979ae3[_0x53bf('0x64')]?moment(_0x979ae3['closedAt'])[_0x53bf('0x44')](_0x53bf('0x63'))[_0x53bf('0x4f')]():'','disposition':_0x979ae3[_0x53bf('0x65')],'messages':_(_0x979ae3[_0x53bf('0x66')])[_0x53bf('0x41')]({'secret':![]})['map'](function(_0x2cb640){return{'date':moment(_0x2cb640[_0x53bf('0x5a')])[_0x53bf('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2cb640[_0x53bf('0x5b')]===_0x53bf('0x67')?_0x2cb640[_0x53bf('0x55')]?_0x2cb640[_0x53bf('0x55')]['fullname']:_0x53bf('0x68'):_0x2cb640[_0x53bf('0x57')][_0x53bf('0x58')]+(_0x2cb640['Contact']['lastName']?'\x20'+_0x2cb640['Contact'][_0x53bf('0x59')]:''),'body':_0x2cb640[_0x53bf('0x34')],'direction':_0x2cb640[_0x53bf('0x5b')]==='out'?'A':'C','secret':_0x2cb640['secret'],'read':_0x2cb640[_0x53bf('0x5d')]};})[_0x53bf('0x69')]()};return ejs[_0x53bf('0x6a')](path[_0x53bf('0x50')](config[_0x53bf('0x51')],'server',_0x53bf('0x6b'),_0x53bf('0x6c')),{'interaction':_0x58a82a})[_0x53bf('0x18')](function(_0x38d82a){var _0x590d3e=path['join'](_0x7ca19b,_0x53bf('0x6d')+_0x979ae3['id']+'-'+_0xd56760+_0x53bf('0x6e'));var _0x52616b={'path':_0x590d3e,'channel':_0x53bf('0x61'),'interactionId':_0x979ae3['id']};return pdf[_0x53bf('0x6f')](_0x38d82a,_0x52616b);})[_0x53bf('0x18')](function(){return new BPromise(function(_0x29b500,_0x381a7f){zipdir(_0x7ca19b,{'saveTo':_0x523e2b},function(_0x253808,_0x3d8b35){if(_0x253808)return _0x381a7f(_0x253808);return _0x29b500(_0x3d8b35);});})[_0x53bf('0x18')](function(){return new BPromise(function(_0x578262,_0x4ae296){rimraf(_0x7ca19b,function(_0x2af1e4){if(_0x2af1e4)_0x4ae296(_0x2af1e4);return _0x578262();});});})[_0x53bf('0x18')](function(){return _0x2f91bc[_0x53bf('0x4d')](_0x523e2b,_0x45c27e,function(_0x4ee6f8){if(_0x4ee6f8){console[_0x53bf('0x70')](_0x53bf('0x71'),_0x4ee6f8);}else{fs[_0x53bf('0x72')](_0x523e2b);}});});});}else{return _0x2f91bc['sendStatus'](0xc8);}})[_0x53bf('0x32')](handleError(_0x2f91bc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1631dbf..a958be3 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 _0x3d04=['SmsInteraction','SmsMessage','setMaxListeners','save','update','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x43d0('0x0'));var SmsInteraction=require(_0x43d0('0x1'))['db'][_0x43d0('0x2')];var SmsMessage=require(_0x43d0('0x1'))['db'][_0x43d0('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x43d0('0x4')](0x0);var events={'afterCreate':_0x43d0('0x5'),'afterUpdate':_0x43d0('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2a4d4c){return function(_0x1a75d4,_0x746f5e,_0x617bf){_0x1a75d4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x50919e){_0x1a75d4['setDataValue'](_0x43d0('0x7'),_0x50919e[_0x43d0('0x8')](function(_0x331421){return{'id':_0x331421['id']};}));return SmsMessage[_0x43d0('0x9')]({'where':{'SmsInteractionId':_0x1a75d4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43d0('0xa')](function(_0x4d75d9){_0x1a75d4['setDataValue'](_0x43d0('0xb'),_0x4d75d9['length']);SmsInteractionEvents['emit'](_0x2a4d4c+':'+_0x1a75d4['id'],_0x1a75d4);SmsInteractionEvents[_0x43d0('0xc')](_0x2a4d4c,_0x1a75d4);_0x617bf(null);})[_0x43d0('0xd')](_0x617bf(null));};}for(var e in events){if(events[_0x43d0('0xe')](e)){var event=events[e];SmsInteraction[_0x43d0('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xcf2f=['setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2838ee,_0x5eb6db){_0x2838ee=_0x2838ee-0x0;var _0x400a83=_0xcf2f[_0x2838ee];return _0x400a83;};'use strict';var EventEmitter=require(_0xfcf2('0x0'));var SmsInteraction=require(_0xfcf2('0x1'))['db'][_0xfcf2('0x2')];var SmsMessage=require(_0xfcf2('0x1'))['db'][_0xfcf2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfcf2('0x4'),'afterUpdate':_0xfcf2('0x5'),'afterDestroy':_0xfcf2('0x6')};function emitEvent(_0x34bcaf){return function(_0x179e60,_0x167a77,_0x1e6d99){_0x179e60[_0xfcf2('0x7')]({'attributes':['id'],'raw':!![]})[_0xfcf2('0x8')](function(_0x157f48){_0x179e60[_0xfcf2('0x9')](_0xfcf2('0xa'),_0x157f48[_0xfcf2('0xb')](function(_0x13ce18){return{'id':_0x13ce18['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x179e60['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d6fc9){_0x179e60[_0xfcf2('0x9')](_0xfcf2('0xc'),_0x4d6fc9['length']);SmsInteractionEvents[_0xfcf2('0xd')](_0x34bcaf+':'+_0x179e60['id'],_0x179e60);SmsInteractionEvents[_0xfcf2('0xd')](_0x34bcaf,_0x179e60);_0x1e6d99(null);})[_0xfcf2('0xe')](_0x1e6d99(null));};}for(var e in events){if(events[_0xfcf2('0xf')](e)){var event=events[e];SmsInteraction['hook'](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 9314e28..1601441 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 _0xa0ac=['moment','bluebird','request-promise','rimraf','exports','define','SmsInteraction','sms_interactions','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x100325,_0x346070){var _0x1d42e9=function(_0x489d86){while(--_0x489d86){_0x100325['push'](_0x100325['shift']());}};_0x1d42e9(++_0x346070);}(_0xa0ac,0x9a));var _0xca0a=function(_0x263901,_0x325b0b){_0x263901=_0x263901-0x0;var _0x2240a2=_0xa0ac[_0x263901];return _0x2240a2;};'use strict';var _=require(_0xca0a('0x0'));var util=require(_0xca0a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca0a('0x2'));var BPromise=require(_0xca0a('0x3'));var rp=require(_0xca0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca0a('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xca0a('0x6')]=function(_0x13f830,_0x2e2b27){return _0x13f830[_0xca0a('0x7')](_0xca0a('0x8'),attributes,{'tableName':_0xca0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d0dbd,_0x6ed3da,_0x1b7ef7){if(_0x3d0dbd['changed']('closed')){_0x3d0dbd[_0xca0a('0xa')]=moment()['format'](_0xca0a('0xb'));}_0x1b7ef7(null,_0x3d0dbd);}}});}; \ No newline at end of file +var _0x6055=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction'];(function(_0x437cc3,_0x3d2627){var _0x4da099=function(_0x1def1f){while(--_0x1def1f){_0x437cc3['push'](_0x437cc3['shift']());}};_0x4da099(++_0x3d2627);}(_0x6055,0x6c));var _0x5605=function(_0x50e071,_0x5945d5){_0x50e071=_0x50e071-0x0;var _0x4d13d0=_0x6055[_0x50e071];return _0x4d13d0;};'use strict';var _=require(_0x5605('0x0'));var util=require(_0x5605('0x1'));var logger=require(_0x5605('0x2'))(_0x5605('0x3'));var moment=require(_0x5605('0x4'));var BPromise=require('bluebird');var rp=require(_0x5605('0x5'));var fs=require('fs');var path=require(_0x5605('0x6'));var rimraf=require(_0x5605('0x7'));var config=require(_0x5605('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x5605('0x9')]=function(_0x4c193b,_0x479aca){return _0x4c193b['define'](_0x5605('0xa'),attributes,{'tableName':_0x5605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x253da3,_0x4c982c,_0x2aba7d){if(_0x253da3[_0x5605('0xc')](_0x5605('0xd'))){_0x253da3[_0x5605('0xe')]=moment()[_0x5605('0xf')](_0x5605('0x10'));}_0x2aba7d(null,_0x253da3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d75a1d7..91bf278 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 _0xbf18=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request'];(function(_0x94d8b5,_0x5733ea){var _0x4f7dab=function(_0x5ea960){while(--_0x5ea960){_0x94d8b5['push'](_0x94d8b5['shift']());}};_0x4f7dab(++_0x5733ea);}(_0xbf18,0x102));var _0x8bf1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbf18[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8bf1('0x0'));var util=require(_0x8bf1('0x1'));var moment=require(_0x8bf1('0x2'));var BPromise=require(_0x8bf1('0x3'));var rs=require(_0x8bf1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bf1('0x5'))['db'];var utils=require(_0x8bf1('0x6'));var logger=require(_0x8bf1('0x7'))('rpc');var config=require(_0x8bf1('0x8'));var jayson=require(_0x8bf1('0x9'));var client=jayson[_0x8bf1('0xa')][_0x8bf1('0xb')]({'port':0x232a});config[_0x8bf1('0xc')]=_[_0x8bf1('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8bf1('0xe'))(new Redis(config['redis']));require(_0x8bf1('0xf'))[_0x8bf1('0x10')](socket);function respondWithRpcPromise(_0x48fed8,_0x4ab08b,_0x3ebeac){return new BPromise(function(_0x2b1c4c,_0x548a6e){return client[_0x8bf1('0x11')](_0x48fed8,_0x3ebeac)[_0x8bf1('0x12')](function(_0x435578){logger[_0x8bf1('0x13')](_0x8bf1('0x14'),_0x4ab08b,_0x8bf1('0x15'));logger[_0x8bf1('0x16')](_0x8bf1('0x17'),_0x4ab08b,_0x8bf1('0x15'),JSON[_0x8bf1('0x18')](_0x435578));if(_0x435578[_0x8bf1('0x19')]){if(_0x435578['error'][_0x8bf1('0x1a')]===0x1f4){logger[_0x8bf1('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x4ab08b,_0x435578['error'][_0x8bf1('0x1b')]);return _0x548a6e(_0x435578[_0x8bf1('0x19')]['message']);}logger[_0x8bf1('0x19')](_0x8bf1('0x14'),_0x4ab08b,_0x435578[_0x8bf1('0x19')]['message']);return _0x2b1c4c(_0x435578['error']['message']);}else{logger[_0x8bf1('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x4ab08b,_0x8bf1('0x15'));_0x2b1c4c(_0x435578[_0x8bf1('0x1c')][_0x8bf1('0x1b')]);}})[_0x8bf1('0x1d')](function(_0xe9bbc){logger[_0x8bf1('0x19')](_0x8bf1('0x14'),_0x4ab08b,_0xe9bbc);_0x548a6e(_0xe9bbc);});});}exports[_0x8bf1('0x1e')]=function(_0x23406b){var _0x5a694b=this;return new Promise(function(_0x364db4,_0x366a84){return db[_0x8bf1('0x1f')][_0x8bf1('0x20')](_0x23406b['body'],{'raw':_0x23406b[_0x8bf1('0x21')]?_0x23406b[_0x8bf1('0x21')][_0x8bf1('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23406b['options']?_0x23406b[_0x8bf1('0x21')][_0x8bf1('0x23')]||null:null,'attributes':_0x23406b[_0x8bf1('0x21')]?_0x23406b[_0x8bf1('0x21')][_0x8bf1('0x24')]||null:null,'limit':_0x23406b[_0x8bf1('0x21')]?_0x23406b['options'][_0x8bf1('0x25')]||null:null})[_0x8bf1('0x12')](function(_0x1635da){logger[_0x8bf1('0x13')]('UpdateSmsInteraction',_0x23406b);logger['debug'](_0x8bf1('0x1e'),_0x23406b,JSON[_0x8bf1('0x18')](_0x1635da));_0x364db4(_0x1635da);})[_0x8bf1('0x1d')](function(_0x6ccd8d){logger[_0x8bf1('0x19')](_0x8bf1('0x1e'),_0x6ccd8d['message'],_0x23406b);_0x366a84(_0x5a694b['error'](0x1f4,_0x6ccd8d[_0x8bf1('0x1b')]));});});};exports[_0x8bf1('0x26')]=function(_0x141915){return new Promise(function(_0x3d8750,_0x235669){return db[_0x8bf1('0x1f')][_0x8bf1('0x27')]({'where':_0x141915[_0x8bf1('0x21')]?_0x141915[_0x8bf1('0x21')][_0x8bf1('0x23')]||null:null})[_0x8bf1('0x12')](function(_0x558746){if(_0x558746){return _0x558746[_0x8bf1('0x28')](_0x141915[_0x8bf1('0x29')][_0x8bf1('0x2a')],_[_0x8bf1('0x2b')](_0x141915['body'],[_0x8bf1('0x2a'),'id'])||{});}})[_0x8bf1('0x2c')](function(_0x544e27){logger['info'](_0x8bf1('0x2d'),_0x141915);logger[_0x8bf1('0x16')]('AddTags',_0x141915,JSON['stringify'](_0x544e27));_0x3d8750(_0x544e27);})['catch'](function(_0x5c7bb1){logger[_0x8bf1('0x19')](_0x8bf1('0x2d'),_0x5c7bb1[_0x8bf1('0x1b')],_0x141915);_0x235669(_this[_0x8bf1('0x19')](0x1f4,_0x5c7bb1[_0x8bf1('0x1b')]));});});}; \ No newline at end of file +var _0xced8=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsInteraction.socket','request','then'];(function(_0x2de4d7,_0x481696){var _0x38be2a=function(_0x21ba6d){while(--_0x21ba6d){_0x2de4d7['push'](_0x2de4d7['shift']());}};_0x38be2a(++_0x481696);}(_0xced8,0xae));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8ced('0x0'));var moment=require(_0x8ced('0x1'));var BPromise=require(_0x8ced('0x2'));var rs=require(_0x8ced('0x3'));var fs=require('fs');var Redis=require(_0x8ced('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ced('0x5'));var logger=require(_0x8ced('0x6'))(_0x8ced('0x7'));var config=require(_0x8ced('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ced('0x9')][_0x8ced('0xa')]({'port':0x232a});config[_0x8ced('0xb')]=_['defaults'](config[_0x8ced('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ced('0xc'))(new Redis(config[_0x8ced('0xb')]));require(_0x8ced('0xd'))['register'](socket);function respondWithRpcPromise(_0x424eed,_0x348522,_0x5b2969){return new BPromise(function(_0x20e064,_0x5b3480){return client[_0x8ced('0xe')](_0x424eed,_0x5b2969)[_0x8ced('0xf')](function(_0x2db798){logger[_0x8ced('0x10')](_0x8ced('0x11'),_0x348522,_0x8ced('0x12'));logger[_0x8ced('0x13')](_0x8ced('0x14'),_0x348522,_0x8ced('0x12'),JSON['stringify'](_0x2db798));if(_0x2db798[_0x8ced('0x15')]){if(_0x2db798[_0x8ced('0x15')]['code']===0x1f4){logger['error'](_0x8ced('0x11'),_0x348522,_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);return _0x5b3480(_0x2db798['error'][_0x8ced('0x16')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x348522,_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);return _0x20e064(_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);}else{logger[_0x8ced('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x348522,'request\x20sent');_0x20e064(_0x2db798[_0x8ced('0x17')][_0x8ced('0x16')]);}})[_0x8ced('0x18')](function(_0x202a7c){logger[_0x8ced('0x15')](_0x8ced('0x11'),_0x348522,_0x202a7c);_0x5b3480(_0x202a7c);});});}exports[_0x8ced('0x19')]=function(_0x37aa0e){var _0x3d82d9=this;return new Promise(function(_0x3bc21d,_0x3f666e){return db[_0x8ced('0x1a')]['update'](_0x37aa0e[_0x8ced('0x1b')],{'raw':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e['options'][_0x8ced('0x1d')]||null:null,'attributes':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')][_0x8ced('0x1e')]||null:null,'limit':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')]['limit']||null:null})[_0x8ced('0xf')](function(_0x1585f6){logger['info'](_0x8ced('0x19'),_0x37aa0e);logger[_0x8ced('0x13')]('UpdateSmsInteraction',_0x37aa0e,JSON[_0x8ced('0x1f')](_0x1585f6));_0x3bc21d(_0x1585f6);})['catch'](function(_0x5c8a0c){logger[_0x8ced('0x15')](_0x8ced('0x19'),_0x5c8a0c[_0x8ced('0x16')],_0x37aa0e);_0x3f666e(_0x3d82d9['error'](0x1f4,_0x5c8a0c['message']));});});};exports[_0x8ced('0x20')]=function(_0x1cf6e0){return new Promise(function(_0x575a17,_0x35e53d){return db[_0x8ced('0x1a')][_0x8ced('0x21')]({'where':_0x1cf6e0[_0x8ced('0x1c')]?_0x1cf6e0[_0x8ced('0x1c')][_0x8ced('0x1d')]||null:null})[_0x8ced('0xf')](function(_0x1ed073){if(_0x1ed073){return _0x1ed073[_0x8ced('0x22')](_0x1cf6e0[_0x8ced('0x1b')][_0x8ced('0x23')],_[_0x8ced('0x24')](_0x1cf6e0[_0x8ced('0x1b')],[_0x8ced('0x23'),'id'])||{});}})['spread'](function(_0x288633){logger['info'](_0x8ced('0x25'),_0x1cf6e0);logger[_0x8ced('0x13')](_0x8ced('0x25'),_0x1cf6e0,JSON[_0x8ced('0x1f')](_0x288633));_0x575a17(_0x288633);})[_0x8ced('0x18')](function(_0x182ee7){logger[_0x8ced('0x15')](_0x8ced('0x25'),_0x182ee7[_0x8ced('0x16')],_0x1cf6e0);_0x35e53d(_this[_0x8ced('0x15')](0x1f4,_0x182ee7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 312df89..9ef2804 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 _0xe207=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x27472b,_0x1e5ca1){var _0x249243=function(_0x5b304f){while(--_0x5b304f){_0x27472b['push'](_0x27472b['shift']());}};_0x249243(++_0x1e5ca1);}(_0xe207,0x1e5));var _0x7e20=function(_0x40ce28,_0x1c7514){_0x40ce28=_0x40ce28-0x0;var _0x5be237=_0xe207[_0x40ce28];return _0x5be237;};'use strict';var SmsInteractionEvents=require(_0x7e20('0x0'));var events=[_0x7e20('0x1'),_0x7e20('0x2'),_0x7e20('0x3')];function createListener(_0x115a32,_0x463f41){return function(_0x445ff7){_0x463f41[_0x7e20('0x4')](_0x115a32,_0x445ff7);};}function removeListener(_0x238a70,_0x24648b){return function(){SmsInteractionEvents['removeListener'](_0x238a70,_0x24648b);};}exports['register']=function(_0xd12cf2){for(var _0x12e915=0x0,_0x56c0c9=events[_0x7e20('0x5')];_0x12e915<_0x56c0c9;_0x12e915++){var _0x4d121a=events[_0x12e915];var _0x324c4=createListener(_0x7e20('0x6')+_0x4d121a,_0xd12cf2);SmsInteractionEvents['on'](_0x4d121a,_0x324c4);}}; \ No newline at end of file +var _0x613c=['length','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5730f3,_0x8cf6ac){var _0xf3a5da=function(_0x24d78b){while(--_0x24d78b){_0x5730f3['push'](_0x5730f3['shift']());}};_0xf3a5da(++_0x8cf6ac);}(_0x613c,0x141));var _0xc613=function(_0x1be7d1,_0x4ac868){_0x1be7d1=_0x1be7d1-0x0;var _0x2bf9b2=_0x613c[_0x1be7d1];return _0x2bf9b2;};'use strict';var SmsInteractionEvents=require(_0xc613('0x0'));var events=[_0xc613('0x1'),_0xc613('0x2'),_0xc613('0x3')];function createListener(_0x468752,_0x3a63f4){return function(_0x3a9f81){_0x3a63f4[_0xc613('0x4')](_0x468752,_0x3a9f81);};}function removeListener(_0x1482be,_0x46ae70){return function(){SmsInteractionEvents[_0xc613('0x5')](_0x1482be,_0x46ae70);};}exports[_0xc613('0x6')]=function(_0x179761){for(var _0x944a53=0x0,_0x4164cd=events[_0xc613('0x7')];_0x944a53<_0x4164cd;_0x944a53++){var _0x2b6708=events[_0x944a53];var _0x3fb483=createListener('smsInteraction:'+_0x2b6708,_0x179761);SmsInteractionEvents['on'](_0x2b6708,_0x3fb483);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d180c9f..9a772ae 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 _0x9f37=['get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','./smsMessage.controller'];(function(_0x2bd9db,_0x2f6076){var _0x28441e=function(_0x354695){while(--_0x354695){_0x2bd9db['push'](_0x2bd9db['shift']());}};_0x28441e(++_0x2f6076);}(_0x9f37,0xb6));var _0x79f3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x9f37[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require(_0x79f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x79f3('0x3'));var router=express['Router']();var fs_extra=require(_0x79f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x79f3('0x5'));var config=require('../../config/environment');var controller=require(_0x79f3('0x6'));router[_0x79f3('0x7')]('/',auth[_0x79f3('0x8')](),controller['index']);router[_0x79f3('0x7')](_0x79f3('0x9'),auth[_0x79f3('0x8')](),controller[_0x79f3('0xa')]);router['get'](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0xc')]);router[_0x79f3('0xd')]('/',auth[_0x79f3('0x8')](),interaction[_0x79f3('0xe')](_0x79f3('0xf'),_0x79f3('0x10')),controller[_0x79f3('0x11')]);router['post']('/:id/status',controller[_0x79f3('0x12')]);router['put'](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x13')]);router[_0x79f3('0x14')](_0x79f3('0x15'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x16')]);router[_0x79f3('0x14')](_0x79f3('0x17'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x18')]);router[_0x79f3('0x19')](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1399=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','index','get','/describe','describe','isAuthenticated','show','tracked','create','post','/:id/status','status','put','accept','/:id/reject','reject','destroy','exports'];(function(_0x3b63bd,_0x34e3b1){var _0x26053c=function(_0x5e3022){while(--_0x5e3022){_0x3b63bd['push'](_0x3b63bd['shift']());}};_0x26053c(++_0x34e3b1);}(_0x1399,0x16c));var _0x9139=function(_0x1fddd6,_0x35c1c8){_0x1fddd6=_0x1fddd6-0x0;var _0xdd2ba2=_0x1399[_0x1fddd6];return _0xdd2ba2;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require('path');var timeout=require(_0x9139('0x2'));var express=require('express');var router=express[_0x9139('0x3')]();var fs_extra=require(_0x9139('0x4'));var auth=require(_0x9139('0x5'));var interaction=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var controller=require(_0x9139('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9139('0x9')]);router[_0x9139('0xa')](_0x9139('0xb'),auth['isAuthenticated'](),controller[_0x9139('0xc')]);router['get']('/:id',auth[_0x9139('0xd')](),controller[_0x9139('0xe')]);router['post']('/',auth[_0x9139('0xd')](),interaction[_0x9139('0xf')]('sms','smsmessage:create'),controller[_0x9139('0x10')]);router[_0x9139('0x11')](_0x9139('0x12'),controller[_0x9139('0x13')]);router[_0x9139('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9139('0x14')]('/:id/accept',auth[_0x9139('0xd')](),controller[_0x9139('0x15')]);router[_0x9139('0x14')](_0x9139('0x16'),auth['isAuthenticated'](),controller[_0x9139('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9139('0x18')]);module[_0x9139('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 35650b4..a702fda 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 _0x689c=['out','STRING','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5ccec4,_0x2c28ac){var _0xee7754=function(_0x5cbef1){while(--_0x5cbef1){_0x5ccec4['push'](_0x5ccec4['shift']());}};_0xee7754(++_0x2c28ac);}(_0x689c,0x9e));var _0xc689=function(_0x577f25,_0x309337){_0x577f25=_0x577f25-0x0;var _0x476aa5=_0x689c[_0x577f25];return _0x476aa5;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc689('0x0')](_0xc689('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc689('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc689('0x3')]('in',_0xc689('0x4')),'defaultValue':_0xc689('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc689('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc689('0x5')]},'providerResponse':{'type':Sequelize[_0xc689('0x0')]}}; \ No newline at end of file +var _0x2303=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x2303,0x75));var _0x3230=function(_0x47d18a,_0xd53074){_0x47d18a=_0x47d18a-0x0;var _0x130c43=_0x2303[_0x47d18a];return _0x130c43;};'use strict';var Sequelize=require(_0x3230('0x0'));module[_0x3230('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3230('0x2')),'defaultValue':_0x3230('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3230('0x3')](0xbe)},'phone':{'type':Sequelize[_0x3230('0x3')]},'readAt':{'type':Sequelize[_0x3230('0x4')]},'secret':{'type':Sequelize[_0x3230('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3230('0x3')]},'providerResponse':{'type':Sequelize[_0x3230('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 12434e9..14b28ee 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 _0x4efb=['apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','include','rows','show','params','SmsMessage','fields','length','includeAll','merge','create','body','find','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','interface','format','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','internal','SIP/%s','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','plivio','groupName','DELIVERED','infobip','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x4efb,0xfa));var _0xb4ef=function(_0x511d8b,_0x596662){_0x511d8b=_0x511d8b-0x0;var _0x1f8e88=_0x4efb[_0x511d8b];return _0x1f8e88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4ef('0x0'));var zipdir=require(_0xb4ef('0x1'));var jsonpatch=require(_0xb4ef('0x2'));var rp=require('request-promise');var moment=require(_0xb4ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4ef('0x4'));var util=require(_0xb4ef('0x5'));var path=require('path');var sox=require(_0xb4ef('0x6'));var csv=require('to-csv');var ejs=require(_0xb4ef('0x7'));var fs=require('fs');var fs_extra=require(_0xb4ef('0x8'));var _=require(_0xb4ef('0x9'));var squel=require(_0xb4ef('0xa'));var crypto=require(_0xb4ef('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb4ef('0xc'));var toCsv=require(_0xb4ef('0xd'));var querystring=require(_0xb4ef('0xe'));var Papa=require(_0xb4ef('0xf'));var Redis=require(_0xb4ef('0x10'));var authService=require(_0xb4ef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4ef('0x13'))(_0xb4ef('0x14'));var utils=require(_0xb4ef('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb4ef('0x16'));var db=require(_0xb4ef('0x17'))['db'];config[_0xb4ef('0x18')]=_[_0xb4ef('0x19')](config[_0xb4ef('0x18')],{'host':_0xb4ef('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4ef('0x18')]));require('./smsMessage.socket')[_0xb4ef('0x1b')](socket);var jayson=require(_0xb4ef('0x1c'));var client=jayson[_0xb4ef('0x1d')][_0xb4ef('0x1e')]({'port':0x232c});var client9002=jayson[_0xb4ef('0x1d')][_0xb4ef('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x187370,_0x4a20a6,_0x3c9671,_0x6a401a){return new BPromise(function(_0x3cb21e,_0x2b9b20){var _0x3cc3b7=_0x6a401a||client;return _0x3cc3b7[_0xb4ef('0x1f')](_0x187370,_0x3c9671)['then'](function(_0x1d8bca){logger[_0xb4ef('0x20')](_0xb4ef('0x21'),_0x4a20a6,_0xb4ef('0x22'));logger[_0xb4ef('0x23')](_0xb4ef('0x24'),_0x4a20a6,_0xb4ef('0x22'),JSON['stringify'](_0x1d8bca));if(_0x1d8bca[_0xb4ef('0x25')]){if(_0x1d8bca['error'][_0xb4ef('0x26')]===0x1f4){logger[_0xb4ef('0x25')](_0xb4ef('0x21'),_0x4a20a6,_0x1d8bca[_0xb4ef('0x25')][_0xb4ef('0x27')]);return _0x2b9b20(_0x1d8bca[_0xb4ef('0x25')][_0xb4ef('0x27')]);}logger[_0xb4ef('0x25')](_0xb4ef('0x21'),_0x4a20a6,_0x1d8bca[_0xb4ef('0x25')]['message']);return _0x3cb21e(_0x1d8bca[_0xb4ef('0x25')][_0xb4ef('0x27')]);}else{logger['info'](_0xb4ef('0x21'),_0x4a20a6,'request\x20sent');_0x3cb21e(_0x1d8bca[_0xb4ef('0x28')]['message']);}})[_0xb4ef('0x29')](function(_0x4b702d){logger[_0xb4ef('0x25')](_0xb4ef('0x21'),_0x4a20a6,_0x4b702d);_0x2b9b20(_0x4b702d);});});}function respondWithStatusCode(_0x50e25a,_0x5e3a6b){_0x5e3a6b=_0x5e3a6b||0xcc;return function(_0x7e0dd0){if(_0x7e0dd0){return _0x50e25a[_0xb4ef('0x2a')](_0x5e3a6b);}return _0x50e25a[_0xb4ef('0x2b')](_0x5e3a6b)[_0xb4ef('0x2c')]();};}function respondWithResult(_0x3e0917,_0x594747){_0x594747=_0x594747||0xc8;return function(_0x4e3cb2){if(_0x4e3cb2){return _0x3e0917['status'](_0x594747)[_0xb4ef('0x2d')](_0x4e3cb2);}};}function respondWithFilteredResult(_0x16d6cc,_0x4ce2c5){return function(_0x145476){if(_0x145476){var _0x2a5f05=typeof _0x4ce2c5[_0xb4ef('0x2e')]==='undefined'&&typeof _0x4ce2c5['limit']===_0xb4ef('0x2f');var _0x27b3fb=_0x145476[_0xb4ef('0x30')];var _0x4db567=_0x2a5f05?0x0:_0x4ce2c5[_0xb4ef('0x2e')];var _0x465f91=_0x2a5f05?_0x145476[_0xb4ef('0x30')]:_0x4ce2c5[_0xb4ef('0x2e')]+_0x4ce2c5['limit'];var _0x14160f;if(_0x465f91>=_0x27b3fb){_0x465f91=_0x27b3fb;_0x14160f=0xc8;}else{_0x14160f=0xce;}_0x16d6cc[_0xb4ef('0x2b')](_0x14160f);return _0x16d6cc['set'](_0xb4ef('0x31'),_0x4db567+'-'+_0x465f91+'/'+_0x27b3fb)['json'](_0x145476);}return null;};}function patchUpdates(_0x1545d3){return function(_0x3f13ec){try{jsonpatch[_0xb4ef('0x32')](_0x3f13ec,_0x1545d3,!![]);}catch(_0x11278d){return BPromise[_0xb4ef('0x33')](_0x11278d);}return _0x3f13ec[_0xb4ef('0x34')]();};}function saveUpdates(_0x597d00,_0x30f4a0){return function(_0x2252e5){if(_0x2252e5){return _0x2252e5[_0xb4ef('0x35')](_0x597d00)[_0xb4ef('0x36')](function(_0x518a7c){return _0x518a7c;});}return null;};}function removeEntity(_0xe1f26c,_0x49e78a){return function(_0x37daa0){if(_0x37daa0){return _0x37daa0[_0xb4ef('0x37')]()[_0xb4ef('0x36')](function(){_0xe1f26c['status'](0xcc)[_0xb4ef('0x2c')]();});}};}function handleEntityNotFound(_0x23e348,_0x36c1b4){return function(_0x88311f){if(!_0x88311f){_0x23e348['sendStatus'](0x194);}return _0x88311f;};}function handleError(_0x1fa01c,_0x332413){_0x332413=_0x332413||0x1f4;return function(_0x478084){logger[_0xb4ef('0x25')](_0x478084[_0xb4ef('0x38')]);if(_0x478084['name']){delete _0x478084[_0xb4ef('0x39')];}_0x1fa01c[_0xb4ef('0x2b')](_0x332413)[_0xb4ef('0x3a')](_0x478084);};}exports[_0xb4ef('0x3b')]=function(_0x3e02e4,_0x5a4904){var _0x5389c0={},_0x4b4ec9={},_0x1ba436={'count':0x0,'rows':[]};var _0x519658=_[_0xb4ef('0x3c')](db['SmsMessage']['rawAttributes'],function(_0x1e589e){return{'name':_0x1e589e[_0xb4ef('0x3d')],'type':_0x1e589e[_0xb4ef('0x3e')][_0xb4ef('0x3f')]};});_0x4b4ec9[_0xb4ef('0x40')]=_['map'](_0x519658,'name');_0x4b4ec9[_0xb4ef('0x41')]=_[_0xb4ef('0x42')](_0x3e02e4[_0xb4ef('0x41')]);_0x4b4ec9[_0xb4ef('0x43')]=_[_0xb4ef('0x44')](_0x4b4ec9[_0xb4ef('0x40')],_0x4b4ec9['query']);_0x5389c0[_0xb4ef('0x45')]=_[_0xb4ef('0x44')](_0x4b4ec9['model'],qs['fields'](_0x3e02e4[_0xb4ef('0x41')]['fields']));_0x5389c0[_0xb4ef('0x45')]=_0x5389c0[_0xb4ef('0x45')]['length']?_0x5389c0[_0xb4ef('0x45')]:_0x4b4ec9['model'];if(!_0x3e02e4[_0xb4ef('0x41')][_0xb4ef('0x46')](_0xb4ef('0x47'))){_0x5389c0['limit']=qs[_0xb4ef('0x48')](_0x3e02e4[_0xb4ef('0x41')]['limit']);_0x5389c0['offset']=qs[_0xb4ef('0x2e')](_0x3e02e4[_0xb4ef('0x41')][_0xb4ef('0x2e')]);}_0x5389c0[_0xb4ef('0x49')]=qs[_0xb4ef('0x4a')](_0x3e02e4[_0xb4ef('0x41')][_0xb4ef('0x4a')]);_0x5389c0[_0xb4ef('0x4b')]=qs[_0xb4ef('0x43')](_[_0xb4ef('0x4c')](_0x3e02e4['query'],_0x4b4ec9[_0xb4ef('0x43')]),_0x519658);if(_0x3e02e4['query']['filter']){_0x5389c0['where']=_['merge'](_0x5389c0[_0xb4ef('0x4b')],{'$or':_[_0xb4ef('0x3c')](_0x519658,function(_0xec9f35){if(_0xec9f35[_0xb4ef('0x3e')]!=='VIRTUAL'){var _0x447f4d={};_0x447f4d[_0xec9f35[_0xb4ef('0x39')]]={'$like':'%'+_0x3e02e4[_0xb4ef('0x41')][_0xb4ef('0x4d')]+'%'};return _0x447f4d;}})});}_0x5389c0=_['merge']({},_0x5389c0,_0x3e02e4[_0xb4ef('0x4e')]);var _0x588ae2={'where':_0x5389c0[_0xb4ef('0x4b')]};return db['SmsMessage'][_0xb4ef('0x30')](_0x588ae2)['then'](function(_0x357d9d){_0x1ba436['count']=_0x357d9d;if(_0x3e02e4[_0xb4ef('0x41')]['includeAll']){_0x5389c0[_0xb4ef('0x4f')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x5389c0);})[_0xb4ef('0x36')](function(_0x4ae7bd){_0x1ba436[_0xb4ef('0x50')]=_0x4ae7bd;return _0x1ba436;})['then'](respondWithFilteredResult(_0x5a4904,_0x5389c0))[_0xb4ef('0x29')](handleError(_0x5a4904,null));};exports[_0xb4ef('0x51')]=function(_0x1cd3c3,_0x5da32d){var _0x12f2e2={'raw':!![],'where':{'id':_0x1cd3c3[_0xb4ef('0x52')]['id']}},_0x4662be={};_0x4662be[_0xb4ef('0x40')]=_['keys'](db[_0xb4ef('0x53')]['rawAttributes']);_0x4662be['query']=_[_0xb4ef('0x42')](_0x1cd3c3[_0xb4ef('0x41')]);_0x4662be[_0xb4ef('0x43')]=_['intersection'](_0x4662be[_0xb4ef('0x40')],_0x4662be[_0xb4ef('0x41')]);_0x12f2e2[_0xb4ef('0x45')]=_[_0xb4ef('0x44')](_0x4662be[_0xb4ef('0x40')],qs['fields'](_0x1cd3c3['query'][_0xb4ef('0x54')]));_0x12f2e2['attributes']=_0x12f2e2[_0xb4ef('0x45')][_0xb4ef('0x55')]?_0x12f2e2[_0xb4ef('0x45')]:_0x4662be['model'];if(_0x1cd3c3[_0xb4ef('0x41')][_0xb4ef('0x56')]){_0x12f2e2['include']=[{'all':!![]}];}_0x12f2e2=_[_0xb4ef('0x57')]({},_0x12f2e2,_0x1cd3c3['options']);return db[_0xb4ef('0x53')]['find'](_0x12f2e2)[_0xb4ef('0x36')](handleEntityNotFound(_0x5da32d,null))[_0xb4ef('0x36')](respondWithResult(_0x5da32d,null))[_0xb4ef('0x29')](handleError(_0x5da32d,null));};exports['create']=function(_0x2dca79,_0x2caacd){return db[_0xb4ef('0x53')][_0xb4ef('0x58')](_0x2dca79[_0xb4ef('0x59')],{})[_0xb4ef('0x36')](respondWithResult(_0x2caacd,0xc9))['catch'](handleError(_0x2caacd,null));};exports[_0xb4ef('0x35')]=function(_0x507d7c,_0x38db2a){if(_0x507d7c[_0xb4ef('0x59')]['id']){delete _0x507d7c[_0xb4ef('0x59')]['id'];}return db[_0xb4ef('0x53')][_0xb4ef('0x5a')]({'where':{'id':_0x507d7c[_0xb4ef('0x52')]['id']}})[_0xb4ef('0x36')](handleEntityNotFound(_0x38db2a,null))[_0xb4ef('0x36')](saveUpdates(_0x507d7c[_0xb4ef('0x59')],null))[_0xb4ef('0x36')](respondWithResult(_0x38db2a,null))[_0xb4ef('0x29')](handleError(_0x38db2a,null));};exports[_0xb4ef('0x37')]=function(_0xd20996,_0x3d059d){return db[_0xb4ef('0x53')][_0xb4ef('0x5a')]({'where':{'id':_0xd20996['params']['id']}})[_0xb4ef('0x36')](handleEntityNotFound(_0x3d059d,null))['then'](removeEntity(_0x3d059d,null))[_0xb4ef('0x29')](handleError(_0x3d059d,null));};exports[_0xb4ef('0x5b')]=function(_0x402493,_0x22c73b){return db['SmsMessage'][_0xb4ef('0x5b')]()[_0xb4ef('0x36')](respondWithResult(_0x22c73b,null))[_0xb4ef('0x29')](handleError(_0x22c73b,null));};var interaction_log=require(_0xb4ef('0x13'))(_0xb4ef('0x5c'));exports[_0xb4ef('0x5d')]=function(_0x1c7c90,_0x503fe9,_0x286ec3){var _0x308db7={'agent':{},'channel':_0xb4ef('0x5e')};if(_0x1c7c90[_0xb4ef('0x59')]['id']){delete _0x1c7c90['body']['id'];}_0x1c7c90[_0xb4ef('0x59')][_0xb4ef('0x5f')]=!![];_0x1c7c90[_0xb4ef('0x59')]['readAt']=moment()['format'](_0xb4ef('0x60'));_0x1c7c90[_0xb4ef('0x59')][_0xb4ef('0x61')]=_0x1c7c90[_0xb4ef('0x59')]['UserId']||_0x1c7c90[_0xb4ef('0x62')]['id'];_0x308db7[_0xb4ef('0x63')]['id']=_0x1c7c90['body'][_0xb4ef('0x61')];return db[_0xb4ef('0x53')]['find']({'where':{'id':_0x1c7c90[_0xb4ef('0x52')]['id'],'UserId':null}})[_0xb4ef('0x36')](handleEntityNotFound(_0x503fe9,null))[_0xb4ef('0x36')](saveUpdates(_0x1c7c90[_0xb4ef('0x59')],null))[_0xb4ef('0x36')](function(_0x1f6f66){if(_0x1f6f66){_0x308db7[_0xb4ef('0x27')]=_0x1f6f66[_0xb4ef('0x64')]({'plain':!![]});return db[_0xb4ef('0x65')][_0xb4ef('0x5a')]({'where':{'id':_0x1f6f66[_0xb4ef('0x66')]}});}return null;})[_0xb4ef('0x36')](handleEntityNotFound(_0x503fe9,null))[_0xb4ef('0x36')](function(_0x27237c){if(_0x27237c){return _0x27237c[_0xb4ef('0x35')]({'UserId':_0x1c7c90[_0xb4ef('0x59')]['UserId'],'read1stAt':_[_0xb4ef('0x67')](_0x27237c[_0xb4ef('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb4ef('0x36')](function(_0x364982){if(_0x364982){_0x308db7[_0xb4ef('0x69')]=_0x364982[_0xb4ef('0x64')]({'plain':!![]});interaction_log[_0xb4ef('0x20')](_0xb4ef('0x6a'),_0x1c7c90[_0xb4ef('0x62')]['id'],_0x1c7c90['user'][_0xb4ef('0x39')],_0x1c7c90[_0xb4ef('0x62')][_0xb4ef('0x6b')],_0x308db7[_0xb4ef('0x69')]['id'],_0x1c7c90['body']?JSON[_0xb4ef('0x6c')](_0x1c7c90[_0xb4ef('0x59')]):_0xb4ef('0x6d'));return respondWithRpcPromise(_0xb4ef('0x6e'),_0xb4ef('0x6f'),_0x308db7);}return null;})[_0xb4ef('0x36')](function(_0x5b93c0){var _0x197a0f=_0xb4ef('0x70')+_0x5b93c0['message'][_0xb4ef('0x71')];return db['sequelize'][_0xb4ef('0x41')](_0x197a0f,{'type':db['Sequelize'][_0xb4ef('0x72')][_0xb4ef('0x73')],'raw':!![]})[_0xb4ef('0x36')](function(_0x42e1b6){return _0x42e1b6;});})[_0xb4ef('0x36')](function(_0x57a953){if(_0x57a953){_0x308db7[_0xb4ef('0x27')][_0xb4ef('0x74')]=_0x57a953[0x0];if(!_0x1c7c90[_0xb4ef('0x59')]['UserId'])return;return db[_0xb4ef('0x75')]['find']({'where':{'id':_0x1c7c90[_0xb4ef('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0xb4ef('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xb4ef('0x36')](function(_0x40c8fb){if(!_0x40c8fb)return null;_0x308db7['message']['agent']=_0x40c8fb;return _0x308db7;})[_0xb4ef('0x36')](function(_0x31bfeb){if(_0x31bfeb){if(_0x1c7c90[_0xb4ef('0x59')]['manual']){_0x308db7['message'][_0xb4ef('0x77')]=util[_0xb4ef('0x78')]('SIP/%s',_0x1c7c90['user']['name']);_0x308db7[_0xb4ef('0x27')][_0xb4ef('0x79')]=_0x308db7[_0xb4ef('0x79')];_0x308db7[_0xb4ef('0x27')][_0xb4ef('0x7a')]=_0x308db7[_0xb4ef('0x79')];_0x308db7[_0xb4ef('0x27')][_0xb4ef('0x7b')]=_0xb4ef('0x5d');return respondWithRpcPromise(_0xb4ef('0x7c'),_0xb4ef('0x7c'),{'event':_0xb4ef('0x7d'),'message':_0x308db7[_0xb4ef('0x27')]},client9002)[_0xb4ef('0x36')](function(){return _0x308db7;});}return _0x308db7;}return null;})[_0xb4ef('0x36')](respondWithResult(_0x503fe9,null))[_0xb4ef('0x29')](handleError(_0x503fe9,null));};var interaction_log=require(_0xb4ef('0x13'))('sms-interactions');exports[_0xb4ef('0x33')]=function(_0x4b82ea,_0x12b04e,_0x1c84ba){var _0x55de43={'agent':{},'channel':_0xb4ef('0x5e')};if(_0x4b82ea['body']['id']){delete _0x4b82ea[_0xb4ef('0x59')]['id'];}_0x4b82ea[_0xb4ef('0x59')]['UserId']=_0x4b82ea[_0xb4ef('0x59')][_0xb4ef('0x61')]||_0x4b82ea[_0xb4ef('0x62')]['id'];_0x55de43[_0xb4ef('0x63')]['id']=_0x4b82ea[_0xb4ef('0x59')][_0xb4ef('0x61')];return db[_0xb4ef('0x53')][_0xb4ef('0x5a')]({'where':{'id':_0x4b82ea['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12b04e,null))['then'](function(_0x288ee7){if(_0x288ee7){_0x55de43[_0xb4ef('0x27')]=_0x288ee7['get']({'plain':!![]});return db['SmsInteraction'][_0xb4ef('0x5a')]({'where':{'id':_0x288ee7[_0xb4ef('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x12b04e,null))[_0xb4ef('0x36')](function(_0x58408f){if(_0x58408f){_0x55de43[_0xb4ef('0x69')]=_0x58408f[_0xb4ef('0x64')]({'plain':!![]});interaction_log['info'](_0xb4ef('0x7e'),_0x4b82ea[_0xb4ef('0x62')]['id'],_0x4b82ea[_0xb4ef('0x62')][_0xb4ef('0x39')],_0x4b82ea[_0xb4ef('0x62')]['role'],_0x55de43[_0xb4ef('0x69')]['id'],_0x4b82ea[_0xb4ef('0x59')]?JSON[_0xb4ef('0x6c')](_0x4b82ea['body']):'null');return respondWithRpcPromise(_0xb4ef('0x7f'),_0xb4ef('0x80'),_0x55de43);}return null;})[_0xb4ef('0x36')](function(_0x369804){var _0x210ddf=_0xb4ef('0x70')+_0x369804[_0xb4ef('0x27')][_0xb4ef('0x71')];return db[_0xb4ef('0x81')][_0xb4ef('0x41')](_0x210ddf,{'type':db[_0xb4ef('0x82')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2dcfee){return _0x2dcfee;});})['then'](function(_0x366aed){if(_0x366aed){_0x55de43[_0xb4ef('0x27')][_0xb4ef('0x74')]=_0x366aed[0x0];if(!_0x4b82ea['body'][_0xb4ef('0x61')])return;return db[_0xb4ef('0x75')][_0xb4ef('0x5a')]({'where':{'id':_0x4b82ea[_0xb4ef('0x59')][_0xb4ef('0x61')],'role':_0xb4ef('0x63')},'attributes':['id',_0xb4ef('0x39'),'fullname',_0xb4ef('0x83'),_0xb4ef('0x84')],'raw':!![]});}return null;})[_0xb4ef('0x36')](function(_0x35e239){if(!_0x35e239)return null;_0x55de43[_0xb4ef('0x27')][_0xb4ef('0x63')]=_0x35e239;return _0x55de43;})[_0xb4ef('0x36')](function(_0x342c78){if(_0x342c78){_0x342c78['message'][_0xb4ef('0x77')]=util[_0xb4ef('0x78')](_0xb4ef('0x85'),_0x4b82ea[_0xb4ef('0x62')]['name']);_0x342c78[_0xb4ef('0x27')]['channel']=_0x55de43[_0xb4ef('0x79')];_0x342c78[_0xb4ef('0x27')][_0xb4ef('0x7a')]=_0x55de43['channel'];_0x342c78['message'][_0xb4ef('0x7b')]=_0xb4ef('0x33');respondWithRpcPromise(_0xb4ef('0x7c'),_0xb4ef('0x7c'),{'event':'rejectmessage','message':_0x342c78['message']},client9002);return _0x55de43;}return null;})['then'](respondWithResult(_0x12b04e,null))['catch'](handleError(_0x12b04e,null));};exports[_0xb4ef('0x2b')]=function(_0x2df886,_0x5c9e03,_0xa09e86){if(_0x2df886[_0xb4ef('0x59')]['id']){delete _0x2df886['body']['id'];}var _0x45ca3a;return db[_0xb4ef('0x53')]['find']({'where':{'id':_0x2df886[_0xb4ef('0x52')]['id']}})['then'](handleEntityNotFound(_0x5c9e03,null))[_0xb4ef('0x36')](function(_0x2b16dd){if(_0x2b16dd){_0x45ca3a=_0x2b16dd;return db['SmsAccount'][_0xb4ef('0x5a')]({'where':{'id':_0x2b16dd[_0xb4ef('0x86')]}});}})[_0xb4ef('0x36')](handleEntityNotFound(_0x5c9e03,null))[_0xb4ef('0x36')](function(_0x195a25){if(_0x195a25){logger[_0xb4ef('0x23')](_0xb4ef('0x24'),_0xb4ef('0x2b'),_0xb4ef('0x87'),_0x195a25[_0xb4ef('0x3e')],util[_0xb4ef('0x88')](_0x2df886[_0xb4ef('0x59')],{'showHidden':![],'depth':null}));switch(_0x195a25[_0xb4ef('0x3e')]){case _0xb4ef('0x89'):if(_0x2df886[_0xb4ef('0x59')][_0xb4ef('0x8a')]&&_0x2df886[_0xb4ef('0x59')][_0xb4ef('0x8a')]===_0x45ca3a[_0xb4ef('0x8b')]){return _0x45ca3a[_0xb4ef('0x35')]({'read':!![]});}else{logger[_0xb4ef('0x25')](_0xb4ef('0x8c'),'status','twilio',util['inspect'](_0x2df886[_0xb4ef('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb4ef('0x8d'):if(_0x2df886[_0xb4ef('0x59')][_0xb4ef('0x8e')]&&_0x2df886[_0xb4ef('0x59')][_0xb4ef('0x8e')]===_0x45ca3a['messageId']&&_['indexOf']([_0xb4ef('0x8f'),_0xb4ef('0x90')],_0x2df886[_0xb4ef('0x59')][_0xb4ef('0x91')])>=0x0){return _0x45ca3a[_0xb4ef('0x35')]({'read':!![]});}else{logger[_0xb4ef('0x25')](_0xb4ef('0x8c'),'status',_0xb4ef('0x92'),util[_0xb4ef('0x88')](_0x2df886[_0xb4ef('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xd1ccc8=_0x2df886[_0xb4ef('0x59')]['results'][0x0];if(_0xd1ccc8[_0xb4ef('0x2b')][_0xb4ef('0x93')]===_0xb4ef('0x94')){return _0x45ca3a[_0xb4ef('0x35')]({'read':!![]});}else{logger[_0xb4ef('0x25')](_0xb4ef('0x8c'),_0xb4ef('0x2b'),_0xb4ef('0x95'),util[_0xb4ef('0x88')](_0x2df886[_0xb4ef('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x45ca3a;}})['then'](respondWithResult(_0x5c9e03,null))[_0xb4ef('0x29')](handleError(_0x5c9e03,null));}; \ No newline at end of file +var _0x88c7=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','options','SmsMessage','findAll','rows','catch','params','includeAll','include','find','create','body','describe','sms-interactions','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','fullname','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','get','SmsInteractionId','null','RejectMessage','sequelize','SELECT','contact','email','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x88c7,0x6f));var _0x788c=function(_0x371108,_0x5e74cd){_0x371108=_0x371108-0x0;var _0x4ee008=_0x88c7[_0x371108];return _0x4ee008;};'use strict';var emlformat=require(_0x788c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x788c('0x1'));var rp=require(_0x788c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x788c('0x3'));var util=require(_0x788c('0x4'));var path=require('path');var sox=require(_0x788c('0x5'));var csv=require(_0x788c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x788c('0x7'));var _=require(_0x788c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x788c('0x9'));var deskjs=require(_0x788c('0xa'));var toCsv=require(_0x788c('0x6'));var querystring=require(_0x788c('0xb'));var Papa=require(_0x788c('0xc'));var Redis=require('ioredis');var authService=require(_0x788c('0xd'));var qs=require(_0x788c('0xe'));var as=require(_0x788c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x788c('0x10'))(_0x788c('0x11'));var utils=require(_0x788c('0x12'));var config=require(_0x788c('0x13'));var licenseUtil=require(_0x788c('0x14'));var db=require(_0x788c('0x15'))['db'];config['redis']=_[_0x788c('0x16')](config['redis'],{'host':_0x788c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x788c('0x18')]));require(_0x788c('0x19'))[_0x788c('0x1a')](socket);var jayson=require(_0x788c('0x1b'));var client=jayson[_0x788c('0x1c')][_0x788c('0x1d')]({'port':0x232c});var client9002=jayson[_0x788c('0x1c')][_0x788c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2b6e32,_0x41d920,_0x67dc6c,_0xa118b5){return new BPromise(function(_0x2c57c3,_0x5c942e){var _0x2f3b41=_0xa118b5||client;return _0x2f3b41[_0x788c('0x1e')](_0x2b6e32,_0x67dc6c)[_0x788c('0x1f')](function(_0x2988df){logger[_0x788c('0x20')](_0x788c('0x21'),_0x41d920,_0x788c('0x22'));logger[_0x788c('0x23')](_0x788c('0x24'),_0x41d920,_0x788c('0x22'),JSON['stringify'](_0x2988df));if(_0x2988df[_0x788c('0x25')]){if(_0x2988df[_0x788c('0x25')][_0x788c('0x26')]===0x1f4){logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);return _0x5c942e(_0x2988df[_0x788c('0x25')]['message']);}logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);return _0x2c57c3(_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);}else{logger[_0x788c('0x20')](_0x788c('0x21'),_0x41d920,'request\x20sent');_0x2c57c3(_0x2988df[_0x788c('0x28')][_0x788c('0x27')]);}})['catch'](function(_0x14e2f1){logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x14e2f1);_0x5c942e(_0x14e2f1);});});}function respondWithStatusCode(_0x5cc1b7,_0x29e4f3){_0x29e4f3=_0x29e4f3||0xcc;return function(_0xfa09c8){if(_0xfa09c8){return _0x5cc1b7[_0x788c('0x29')](_0x29e4f3);}return _0x5cc1b7[_0x788c('0x2a')](_0x29e4f3)[_0x788c('0x2b')]();};}function respondWithResult(_0x2ea11c,_0x271218){_0x271218=_0x271218||0xc8;return function(_0x12fdbc){if(_0x12fdbc){return _0x2ea11c[_0x788c('0x2a')](_0x271218)['json'](_0x12fdbc);}};}function respondWithFilteredResult(_0x4380f4,_0x57966d){return function(_0x297ea6){if(_0x297ea6){var _0x18b271=typeof _0x57966d[_0x788c('0x2c')]===_0x788c('0x2d')&&typeof _0x57966d[_0x788c('0x2e')]===_0x788c('0x2d');var _0x3fcc37=_0x297ea6[_0x788c('0x2f')];var _0x4d41ac=_0x18b271?0x0:_0x57966d[_0x788c('0x2c')];var _0x4e9b20=_0x18b271?_0x297ea6[_0x788c('0x2f')]:_0x57966d[_0x788c('0x2c')]+_0x57966d[_0x788c('0x2e')];var _0x3a0de3;if(_0x4e9b20>=_0x3fcc37){_0x4e9b20=_0x3fcc37;_0x3a0de3=0xc8;}else{_0x3a0de3=0xce;}_0x4380f4[_0x788c('0x2a')](_0x3a0de3);return _0x4380f4[_0x788c('0x30')]('Content-Range',_0x4d41ac+'-'+_0x4e9b20+'/'+_0x3fcc37)[_0x788c('0x31')](_0x297ea6);}return null;};}function patchUpdates(_0x5e4378){return function(_0x46999f){try{jsonpatch['apply'](_0x46999f,_0x5e4378,!![]);}catch(_0x4245ce){return BPromise['reject'](_0x4245ce);}return _0x46999f[_0x788c('0x32')]();};}function saveUpdates(_0x54d0bf,_0x50b8f1){return function(_0xafbbc4){if(_0xafbbc4){return _0xafbbc4[_0x788c('0x33')](_0x54d0bf)['then'](function(_0x40b93d){return _0x40b93d;});}return null;};}function removeEntity(_0x45a0d4,_0x52921a){return function(_0x1a4ce8){if(_0x1a4ce8){return _0x1a4ce8['destroy']()['then'](function(){_0x45a0d4[_0x788c('0x2a')](0xcc)[_0x788c('0x2b')]();});}};}function handleEntityNotFound(_0x3caa2e,_0x581a67){return function(_0x4bf35c){if(!_0x4bf35c){_0x3caa2e[_0x788c('0x29')](0x194);}return _0x4bf35c;};}function handleError(_0x412717,_0x4ab290){_0x4ab290=_0x4ab290||0x1f4;return function(_0x4d31c1){logger['error'](_0x4d31c1[_0x788c('0x34')]);if(_0x4d31c1['name']){delete _0x4d31c1[_0x788c('0x35')];}_0x412717[_0x788c('0x2a')](_0x4ab290)[_0x788c('0x36')](_0x4d31c1);};}exports[_0x788c('0x37')]=function(_0x9a0da7,_0x46549){var _0x583ede={},_0x3aaf49={},_0x4709bf={'count':0x0,'rows':[]};var _0x162715=_['map'](db['SmsMessage'][_0x788c('0x38')],function(_0x58f4db){return{'name':_0x58f4db['fieldName'],'type':_0x58f4db[_0x788c('0x39')][_0x788c('0x3a')]};});_0x3aaf49[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x162715,_0x788c('0x35'));_0x3aaf49[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x9a0da7['query']);_0x3aaf49['filters']=_[_0x788c('0x3f')](_0x3aaf49[_0x788c('0x3b')],_0x3aaf49['query']);_0x583ede[_0x788c('0x40')]=_[_0x788c('0x3f')](_0x3aaf49[_0x788c('0x3b')],qs['fields'](_0x9a0da7[_0x788c('0x3d')][_0x788c('0x41')]));_0x583ede[_0x788c('0x40')]=_0x583ede[_0x788c('0x40')][_0x788c('0x42')]?_0x583ede[_0x788c('0x40')]:_0x3aaf49[_0x788c('0x3b')];if(!_0x9a0da7[_0x788c('0x3d')][_0x788c('0x43')](_0x788c('0x44'))){_0x583ede[_0x788c('0x2e')]=qs[_0x788c('0x2e')](_0x9a0da7[_0x788c('0x3d')]['limit']);_0x583ede[_0x788c('0x2c')]=qs[_0x788c('0x2c')](_0x9a0da7[_0x788c('0x3d')]['offset']);}_0x583ede['order']=qs[_0x788c('0x45')](_0x9a0da7[_0x788c('0x3d')]['sort']);_0x583ede[_0x788c('0x46')]=qs[_0x788c('0x47')](_[_0x788c('0x48')](_0x9a0da7[_0x788c('0x3d')],_0x3aaf49[_0x788c('0x47')]),_0x162715);if(_0x9a0da7['query']['filter']){_0x583ede[_0x788c('0x46')]=_['merge'](_0x583ede[_0x788c('0x46')],{'$or':_[_0x788c('0x3c')](_0x162715,function(_0x243b70){if(_0x243b70[_0x788c('0x39')]!=='VIRTUAL'){var _0x3d012b={};_0x3d012b[_0x243b70[_0x788c('0x35')]]={'$like':'%'+_0x9a0da7[_0x788c('0x3d')]['filter']+'%'};return _0x3d012b;}})});}_0x583ede=_[_0x788c('0x49')]({},_0x583ede,_0x9a0da7[_0x788c('0x4a')]);var _0x275d1c={'where':_0x583ede[_0x788c('0x46')]};return db[_0x788c('0x4b')][_0x788c('0x2f')](_0x275d1c)[_0x788c('0x1f')](function(_0x1fe905){_0x4709bf['count']=_0x1fe905;if(_0x9a0da7['query']['includeAll']){_0x583ede['include']=[{'all':!![]}];}return db['SmsMessage'][_0x788c('0x4c')](_0x583ede);})['then'](function(_0xe947f2){_0x4709bf[_0x788c('0x4d')]=_0xe947f2;return _0x4709bf;})[_0x788c('0x1f')](respondWithFilteredResult(_0x46549,_0x583ede))[_0x788c('0x4e')](handleError(_0x46549,null));};exports['show']=function(_0x41307c,_0x17e84c){var _0x2a67b0={'raw':!![],'where':{'id':_0x41307c[_0x788c('0x4f')]['id']}},_0x28cfb5={};_0x28cfb5[_0x788c('0x3b')]=_[_0x788c('0x3e')](db[_0x788c('0x4b')][_0x788c('0x38')]);_0x28cfb5[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x41307c['query']);_0x28cfb5['filters']=_[_0x788c('0x3f')](_0x28cfb5[_0x788c('0x3b')],_0x28cfb5[_0x788c('0x3d')]);_0x2a67b0['attributes']=_['intersection'](_0x28cfb5[_0x788c('0x3b')],qs[_0x788c('0x41')](_0x41307c[_0x788c('0x3d')][_0x788c('0x41')]));_0x2a67b0['attributes']=_0x2a67b0['attributes']['length']?_0x2a67b0[_0x788c('0x40')]:_0x28cfb5[_0x788c('0x3b')];if(_0x41307c[_0x788c('0x3d')][_0x788c('0x50')]){_0x2a67b0[_0x788c('0x51')]=[{'all':!![]}];}_0x2a67b0=_['merge']({},_0x2a67b0,_0x41307c[_0x788c('0x4a')]);return db[_0x788c('0x4b')][_0x788c('0x52')](_0x2a67b0)[_0x788c('0x1f')](handleEntityNotFound(_0x17e84c,null))[_0x788c('0x1f')](respondWithResult(_0x17e84c,null))[_0x788c('0x4e')](handleError(_0x17e84c,null));};exports[_0x788c('0x53')]=function(_0xa71323,_0x206424){return db['SmsMessage'][_0x788c('0x53')](_0xa71323[_0x788c('0x54')],{})['then'](respondWithResult(_0x206424,0xc9))[_0x788c('0x4e')](handleError(_0x206424,null));};exports[_0x788c('0x33')]=function(_0x40e0f0,_0x5f3583){if(_0x40e0f0[_0x788c('0x54')]['id']){delete _0x40e0f0['body']['id'];}return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x40e0f0[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x5f3583,null))[_0x788c('0x1f')](saveUpdates(_0x40e0f0[_0x788c('0x54')],null))[_0x788c('0x1f')](respondWithResult(_0x5f3583,null))['catch'](handleError(_0x5f3583,null));};exports['destroy']=function(_0x1b492a,_0x4a7ca8){return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x1b492a[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x4a7ca8,null))[_0x788c('0x1f')](removeEntity(_0x4a7ca8,null))[_0x788c('0x4e')](handleError(_0x4a7ca8,null));};exports[_0x788c('0x55')]=function(_0x484998,_0x131ff8){return db[_0x788c('0x4b')]['describe']()['then'](respondWithResult(_0x131ff8,null))[_0x788c('0x4e')](handleError(_0x131ff8,null));};var interaction_log=require(_0x788c('0x10'))(_0x788c('0x56'));exports['accept']=function(_0x439e29,_0x8497cb,_0x4b6e8d){var _0x2734d5={'agent':{},'channel':_0x788c('0x57')};if(_0x439e29[_0x788c('0x54')]['id']){delete _0x439e29[_0x788c('0x54')]['id'];}_0x439e29['body']['read']=!![];_0x439e29[_0x788c('0x54')][_0x788c('0x58')]=moment()[_0x788c('0x59')](_0x788c('0x5a'));_0x439e29['body'][_0x788c('0x5b')]=_0x439e29[_0x788c('0x54')][_0x788c('0x5b')]||_0x439e29[_0x788c('0x5c')]['id'];_0x2734d5[_0x788c('0x5d')]['id']=_0x439e29[_0x788c('0x54')][_0x788c('0x5b')];return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x439e29['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x8497cb,null))[_0x788c('0x1f')](saveUpdates(_0x439e29[_0x788c('0x54')],null))[_0x788c('0x1f')](function(_0x3fd07a){if(_0x3fd07a){_0x2734d5[_0x788c('0x27')]=_0x3fd07a['get']({'plain':!![]});return db[_0x788c('0x5e')][_0x788c('0x52')]({'where':{'id':_0x3fd07a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x8497cb,null))['then'](function(_0x54487b){if(_0x54487b){return _0x54487b[_0x788c('0x33')]({'UserId':_0x439e29['body'][_0x788c('0x5b')],'read1stAt':_['isNil'](_0x54487b['read1stAt'])?moment()['format'](_0x788c('0x5a')):undefined});}return null;})[_0x788c('0x1f')](function(_0x1d62e7){if(_0x1d62e7){_0x2734d5[_0x788c('0x5f')]=_0x1d62e7['get']({'plain':!![]});interaction_log[_0x788c('0x20')](_0x788c('0x60'),_0x439e29[_0x788c('0x5c')]['id'],_0x439e29['user'][_0x788c('0x35')],_0x439e29[_0x788c('0x5c')][_0x788c('0x61')],_0x2734d5['interaction']['id'],_0x439e29[_0x788c('0x54')]?JSON[_0x788c('0x62')](_0x439e29[_0x788c('0x54')]):'null');return respondWithRpcPromise(_0x788c('0x63'),_0x788c('0x64'),_0x2734d5);}return null;})[_0x788c('0x1f')](function(_0x5a3906){var _0x201d45=_0x788c('0x65')+_0x5a3906[_0x788c('0x27')][_0x788c('0x66')];return db['sequelize'][_0x788c('0x3d')](_0x201d45,{'type':db[_0x788c('0x67')][_0x788c('0x68')]['SELECT'],'raw':!![]})[_0x788c('0x1f')](function(_0x5b5192){return _0x5b5192;});})['then'](function(_0x2d4a5d){if(_0x2d4a5d){_0x2734d5[_0x788c('0x27')]['contact']=_0x2d4a5d[0x0];if(!_0x439e29[_0x788c('0x54')][_0x788c('0x5b')])return;return db[_0x788c('0x69')]['find']({'where':{'id':_0x439e29[_0x788c('0x54')][_0x788c('0x5b')],'role':'agent'},'attributes':['id',_0x788c('0x35'),_0x788c('0x6a'),'email',_0x788c('0x6b')],'raw':!![]});}return null;})[_0x788c('0x1f')](function(_0x484bf2){if(!_0x484bf2)return null;_0x2734d5[_0x788c('0x27')][_0x788c('0x5d')]=_0x484bf2;return _0x2734d5;})[_0x788c('0x1f')](function(_0x2370a9){if(_0x2370a9){if(_0x439e29[_0x788c('0x54')][_0x788c('0x6c')]){_0x2734d5[_0x788c('0x27')][_0x788c('0x6d')]=util[_0x788c('0x59')]('SIP/%s',_0x439e29['user'][_0x788c('0x35')]);_0x2734d5[_0x788c('0x27')]['channel']=_0x2734d5[_0x788c('0x6e')];_0x2734d5[_0x788c('0x27')][_0x788c('0x6f')]=_0x2734d5['channel'];_0x2734d5[_0x788c('0x27')][_0x788c('0x70')]=_0x788c('0x71');return respondWithRpcPromise(_0x788c('0x72'),_0x788c('0x72'),{'event':_0x788c('0x73'),'message':_0x2734d5[_0x788c('0x27')]},client9002)[_0x788c('0x1f')](function(){return _0x2734d5;});}return _0x2734d5;}return null;})['then'](respondWithResult(_0x8497cb,null))[_0x788c('0x4e')](handleError(_0x8497cb,null));};var interaction_log=require('../../config/logger')(_0x788c('0x56'));exports[_0x788c('0x74')]=function(_0x4e286a,_0x4687fe,_0x563b13){var _0x13b901={'agent':{},'channel':_0x788c('0x57')};if(_0x4e286a[_0x788c('0x54')]['id']){delete _0x4e286a[_0x788c('0x54')]['id'];}_0x4e286a[_0x788c('0x54')][_0x788c('0x5b')]=_0x4e286a[_0x788c('0x54')][_0x788c('0x5b')]||_0x4e286a[_0x788c('0x5c')]['id'];_0x13b901['agent']['id']=_0x4e286a['body']['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x4e286a[_0x788c('0x4f')]['id'],'UserId':null}})[_0x788c('0x1f')](handleEntityNotFound(_0x4687fe,null))[_0x788c('0x1f')](function(_0x4cad59){if(_0x4cad59){_0x13b901[_0x788c('0x27')]=_0x4cad59[_0x788c('0x75')]({'plain':!![]});return db[_0x788c('0x5e')][_0x788c('0x52')]({'where':{'id':_0x4cad59[_0x788c('0x76')]}});}return null;})[_0x788c('0x1f')](handleEntityNotFound(_0x4687fe,null))[_0x788c('0x1f')](function(_0x45f761){if(_0x45f761){_0x13b901[_0x788c('0x5f')]=_0x45f761[_0x788c('0x75')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e286a[_0x788c('0x5c')]['id'],_0x4e286a[_0x788c('0x5c')][_0x788c('0x35')],_0x4e286a[_0x788c('0x5c')][_0x788c('0x61')],_0x13b901[_0x788c('0x5f')]['id'],_0x4e286a[_0x788c('0x54')]?JSON[_0x788c('0x62')](_0x4e286a[_0x788c('0x54')]):_0x788c('0x77'));return respondWithRpcPromise(_0x788c('0x78'),'rejectMessage',_0x13b901);}return null;})[_0x788c('0x1f')](function(_0x365d69){var _0x403ea9=_0x788c('0x65')+_0x365d69[_0x788c('0x27')][_0x788c('0x66')];return db[_0x788c('0x79')][_0x788c('0x3d')](_0x403ea9,{'type':db[_0x788c('0x67')][_0x788c('0x68')][_0x788c('0x7a')],'raw':!![]})['then'](function(_0x2487c9){return _0x2487c9;});})[_0x788c('0x1f')](function(_0x2cb153){if(_0x2cb153){_0x13b901['message'][_0x788c('0x7b')]=_0x2cb153[0x0];if(!_0x4e286a['body'][_0x788c('0x5b')])return;return db['User'][_0x788c('0x52')]({'where':{'id':_0x4e286a['body'][_0x788c('0x5b')],'role':_0x788c('0x5d')},'attributes':['id',_0x788c('0x35'),_0x788c('0x6a'),_0x788c('0x7c'),'internal'],'raw':!![]});}return null;})[_0x788c('0x1f')](function(_0x8c6d17){if(!_0x8c6d17)return null;_0x13b901['message'][_0x788c('0x5d')]=_0x8c6d17;return _0x13b901;})[_0x788c('0x1f')](function(_0x425fdd){if(_0x425fdd){_0x425fdd['message']['interface']=util[_0x788c('0x59')](_0x788c('0x7d'),_0x4e286a['user']['name']);_0x425fdd[_0x788c('0x27')][_0x788c('0x6e')]=_0x13b901[_0x788c('0x6e')];_0x425fdd[_0x788c('0x27')][_0x788c('0x6f')]=_0x13b901[_0x788c('0x6e')];_0x425fdd[_0x788c('0x27')][_0x788c('0x70')]=_0x788c('0x74');respondWithRpcPromise(_0x788c('0x72'),_0x788c('0x72'),{'event':_0x788c('0x7e'),'message':_0x425fdd[_0x788c('0x27')]},client9002);return _0x13b901;}return null;})[_0x788c('0x1f')](respondWithResult(_0x4687fe,null))[_0x788c('0x4e')](handleError(_0x4687fe,null));};exports[_0x788c('0x2a')]=function(_0x248995,_0x55da35,_0x2e271f){if(_0x248995['body']['id']){delete _0x248995['body']['id'];}var _0x136dc6;return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x248995[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x55da35,null))['then'](function(_0xb656a3){if(_0xb656a3){_0x136dc6=_0xb656a3;return db[_0x788c('0x7f')]['find']({'where':{'id':_0xb656a3[_0x788c('0x80')]}});}})[_0x788c('0x1f')](handleEntityNotFound(_0x55da35,null))[_0x788c('0x1f')](function(_0x3be8a3){if(_0x3be8a3){logger[_0x788c('0x23')](_0x788c('0x24'),_0x788c('0x2a'),_0x788c('0x81'),_0x3be8a3[_0x788c('0x39')],util[_0x788c('0x82')](_0x248995['body'],{'showHidden':![],'depth':null}));switch(_0x3be8a3[_0x788c('0x39')]){case _0x788c('0x83'):if(_0x248995[_0x788c('0x54')]['MessageSid']&&_0x248995[_0x788c('0x54')]['MessageSid']===_0x136dc6[_0x788c('0x84')]){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger['error'](_0x788c('0x85'),_0x788c('0x2a'),'twilio',util[_0x788c('0x82')](_0x248995[_0x788c('0x54')],{'showHidden':![],'depth':null}));}break;case _0x788c('0x86'):if(_0x248995[_0x788c('0x54')]['MessageUUID']&&_0x248995['body']['MessageUUID']===_0x136dc6[_0x788c('0x84')]&&_['indexOf']([_0x788c('0x87'),_0x788c('0x88')],_0x248995[_0x788c('0x54')][_0x788c('0x89')])>=0x0){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger[_0x788c('0x25')](_0x788c('0x85'),_0x788c('0x2a'),_0x788c('0x8a'),util['inspect'](_0x248995['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x13fff3=_0x248995[_0x788c('0x54')][_0x788c('0x8b')][0x0];if(_0x13fff3[_0x788c('0x2a')][_0x788c('0x8c')]===_0x788c('0x8d')){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger[_0x788c('0x25')](_0x788c('0x85'),'status',_0x788c('0x8e'),util[_0x788c('0x82')](_0x248995[_0x788c('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x136dc6;}})[_0x788c('0x1f')](respondWithResult(_0x55da35,null))['catch'](handleError(_0x55da35,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4dfab07..c0e9c25 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 _0x7e1e=['../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x7e1e,0xa7));var _0xe7e1=function(_0x1e40e2,_0x1a2ce2){_0x1e40e2=_0x1e40e2-0x0;var _0x1962e7=_0x7e1e[_0x1e40e2];return _0x1962e7;};'use strict';var EventEmitter=require(_0xe7e1('0x0'));var SmsMessage=require(_0xe7e1('0x1'))['db'][_0xe7e1('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe7e1('0x3')](0x0);var events={'afterCreate':_0xe7e1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5393c7){return function(_0x56acf0,_0x59e221,_0x1eb7fe){SmsMessageEvents[_0xe7e1('0x5')](_0x5393c7+':'+_0x56acf0['id'],_0x56acf0);SmsMessageEvents[_0xe7e1('0x5')](_0x5393c7,_0x56acf0);_0x1eb7fe(null);};}for(var e in events){if(events[_0xe7e1('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xe7e1('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x5818=['events','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x5818,0xa8));var _0x8581=function(_0x369a3a,_0x32dae9){_0x369a3a=_0x369a3a-0x0;var _0x3cbf33=_0x5818[_0x369a3a];return _0x3cbf33;};'use strict';var EventEmitter=require(_0x8581('0x0'));var SmsMessage=require(_0x8581('0x1'))['db'][_0x8581('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8581('0x3')](0x0);var events={'afterCreate':_0x8581('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x145fbd){return function(_0x2acb8f,_0x181139,_0x342027){SmsMessageEvents[_0x8581('0x5')](_0x145fbd+':'+_0x2acb8f['id'],_0x2acb8f);SmsMessageEvents[_0x8581('0x5')](_0x145fbd,_0x2acb8f);_0x342027(null);};}for(var e in events){if(events[_0x8581('0x6')](e)){var event=events[e];SmsMessage[_0x8581('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7676656..afecd35 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 _0x21ab=['uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','then','update','error','type','twilio','accountSid','authToken','phone','remote','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','session_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','%s:%s','format','toString','base64','http_code','data','queued_count','head','messages','message_id','deliveryReport','clickSend','plivo','token','POST','authId','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','/auth/1/session','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','text','keys','sort','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','apiKey'];(function(_0x1cbce8,_0x26ae0b){var _0xb150c4=function(_0x3ab6ba){while(--_0x3ab6ba){_0x1cbce8['push'](_0x1cbce8['shift']());}};_0xb150c4(++_0x26ae0b);}(_0x21ab,0x1cc));var _0xb21a=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0x21ab[_0x5bd4f6];return _0x33a165;};'use strict';var _=require('lodash');var util=require(_0xb21a('0x0'));var logger=require(_0xb21a('0x1'))(_0xb21a('0x2'));var moment=require(_0xb21a('0x3'));var BPromise=require(_0xb21a('0x4'));var rp=require(_0xb21a('0x5'));var fs=require('fs');var path=require(_0xb21a('0x6'));var rimraf=require(_0xb21a('0x7'));var config=require(_0xb21a('0x8'));var attributes=require(_0xb21a('0x9'));module['exports']=function(_0x559ee0,_0x31834b){return _0x559ee0[_0xb21a('0xa')](_0xb21a('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb21a('0xc')]},{'name':'fti_sms_messages','fields':[_0xb21a('0xd')],'type':_0xb21a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f78c2,_0x321310,_0x219c9b){var _0x3b0ebe=_0x559ee0[_0xb21a('0xf')];var _0x5e0d75=_0x1f78c2[_0xb21a('0x10')]({'plain':!![]});if(_0x5e0d75[_0xb21a('0x11')][_0xb21a('0x12')]()==='in'||_0x5e0d75['direction'][_0xb21a('0x12')]()===_0xb21a('0x13')&&!_0x5e0d75[_0xb21a('0x14')]&&!_[_0xb21a('0x15')](_0x5e0d75[_0xb21a('0x16')])&&!_[_0xb21a('0x15')](_0x5e0d75['SmsInteractionId'])){_0x3b0ebe['SmsInteraction']['findOne']({'where':{'id':_0x5e0d75[_0xb21a('0x17')]}})[_0xb21a('0x18')](function(_0x45518e){if(_0x45518e){_0x45518e[_0xb21a('0x19')]({'lastMsgAt':_0x5e0d75['createdAt'],'lastMsgDirection':_0x5e0d75['direction'][_0xb21a('0x12')]()});}})['catch'](function(_0x25981d){console[_0xb21a('0x1a')](_0x25981d);});}if(_0x5e0d75[_0xb21a('0x11')]==='out'&&!_0x5e0d75[_0xb21a('0x14')]){var _0x210237;_0x3b0ebe['SmsAccount']['find']({'where':{'id':_0x5e0d75['SmsAccountId']},'raw':!![]})[_0xb21a('0x18')](function(_0x4e8060){_0x210237=_0x4e8060;if(_0x210237&&_0x210237[_0xb21a('0x1b')]){switch(_0x210237['type']){case _0xb21a('0x1c'):var _0x4ec7f6=require(_0xb21a('0x1c'));if(_0x210237[_0xb21a('0x1d')]&&_0x210237[_0xb21a('0x1e')]&&_0x210237[_0xb21a('0x1f')]){var _0x3cf2f9=new _0x4ec7f6(_0x210237['accountSid'],_0x210237[_0xb21a('0x1e')]);_0x3cf2f9['messages']['create']({'body':_0x5e0d75[_0xb21a('0xd')],'to':_0x5e0d75[_0xb21a('0x1f')],'from':_0x210237['phone'],'statusCallback':_0x210237[_0xb21a('0x20')]+'/api/sms/messages/'+_0x5e0d75['id']+_0xb21a('0x21')+_0x210237['token']})[_0xb21a('0x18')](function(_0x1133fc){if(_0x1133fc[_0xb21a('0x22')]){return _0x1f78c2[_0xb21a('0x19')]({'messageId':_0x1133fc[_0xb21a('0x22')]});}})[_0xb21a('0x23')](function(_0xa454bc){logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x1c'),util[_0xb21a('0x26')](_0xa454bc,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate',_0xb21a('0x1c'),_0xb21a('0x27'));}break;case _0xb21a('0x28'):var _0x501174='https://api.skebby.it/API/v1.0/REST/';if(_0x210237[_0xb21a('0x29')]&&_0x210237[_0xb21a('0x2a')]){var _0x2ee081={'recipient':[_0x5e0d75[_0xb21a('0x1f')]],'message':_0x5e0d75[_0xb21a('0xd')],'message_type':_0x210237['smsMethod']};if(_0x210237[_0xb21a('0x2b')]&&_0x210237[_0xb21a('0x2b')]!=='SI'){_0x2ee081['sender']=_0x210237[_0xb21a('0x1f')];}var _0xf3e2f1={'url':_0x501174+_0xb21a('0x2c')+_0x210237[_0xb21a('0x29')]+_0xb21a('0x2d')+_0x210237[_0xb21a('0x2a')],'method':_0xb21a('0x2e')};rp(_0xf3e2f1)['then'](function(_0x5d7980){var _0x50f2d7=_0x5d7980['split'](';');var _0x4141ee={'user_key':_0x50f2d7[0x0],'session_key':_0x50f2d7[0x1]};_0xf3e2f1={'url':_0x501174+'sms','method':'POST','headers':{'user_key':_0x4141ee['user_key'],'Session_key':_0x4141ee[_0xb21a('0x2f')]},'json':!![],'body':_0x2ee081};return rp(_0xf3e2f1);})[_0xb21a('0x18')](function(_0x50a247){if(_0x50a247['total_sent']>=0x1){var _0x3b3a8a={'messageId':_0x50a247[_0xb21a('0x30')]};if(_0x210237[_0xb21a('0x2b')]!=='GP'||!_0x210237['deliveryReport']){_0x3b3a8a[_0xb21a('0x31')]=!![];}return _0x1f78c2[_0xb21a('0x19')](_0x3b3a8a);}else{return logger[_0xb21a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb21a('0x25'),_0xb21a('0x28'),util[_0xb21a('0x26')](_0x50a247,{'showHidden':![],'depth':null}));}})[_0xb21a('0x23')](function(_0x20b388){return logger['error'](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x28'),util[_0xb21a('0x26')](_0x20b388,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x28'),_0xb21a('0x32'));}break;case _0xb21a('0x33'):if(_0x210237[_0xb21a('0x1e')]){var _0x4b5412={'recipient':_0x5e0d75[_0xb21a('0x1f')],'message':_0x5e0d75[_0xb21a('0xd')],'sender':_0x210237[_0xb21a('0x34')]||_0x210237[_0xb21a('0x1f')],'authorization':_0x210237['authToken']};var _0x321310={'method':'POST','uri':_0xb21a('0x35'),'body':_0x4b5412,'json':!![]};rp(_0x321310)[_0xb21a('0x18')](function(_0x50a546){var _0xaa48d7={'messageId':_0x50a546[_0xb21a('0x36')]};if(!_0x210237['deliveryReport']){_0xaa48d7[_0xb21a('0x31')]=!![];}return _0x1f78c2['update'](_0xaa48d7);})[_0xb21a('0x23')](function(_0x13fb19){logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x33'),util[_0xb21a('0x26')](_0x13fb19,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb21a('0x25'),_0xb21a('0x33'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x210237['username']&&_0x210237[_0xb21a('0x2a')]){var _0x4b5412={'messages':[{'source':_0xb21a('0x37'),'to':_0x5e0d75[_0xb21a('0x1f')],'body':_0x5e0d75['body'],'from':_0x210237[_0xb21a('0x34')]||_0x210237[_0xb21a('0x1f')]}]};var _0x40b801=util['format'](_0xb21a('0x38'),_0x210237[_0xb21a('0x29')],_0x210237[_0xb21a('0x2a')]);var _0x321310={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4b5412,'headers':{'Authorization':util[_0xb21a('0x39')]('Basic\x20%s',new Buffer(_0x40b801)[_0xb21a('0x3a')](_0xb21a('0x3b')))},'json':!![]};rp(_0x321310)['then'](function(_0x4e18de){if(_0x4e18de[_0xb21a('0x3c')]>=0xc8&&_0x4e18de[_0xb21a('0x3c')]<=0xce){if(_0x4e18de[_0xb21a('0x3d')]&&_0x4e18de['data'][_0xb21a('0x3e')]>0x0){var _0x567bf6=_[_0xb21a('0x3f')](_0x4e18de[_0xb21a('0x3d')][_0xb21a('0x40')]);var _0x15bd54={'messageId':_0x567bf6[_0xb21a('0x41')]};if(!_0x210237[_0xb21a('0x42')]){_0x15bd54['read']=!![];}return _0x1f78c2[_0xb21a('0x19')](_0x15bd54);}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x43'),util['inspect'](_0x4e18de,{'showHidden':![],'depth':null}));}}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate','clickSend',util[_0xb21a('0x26')](_0x4e18de,{'showHidden':![],'depth':null}));}})[_0xb21a('0x23')](function(_0x563d02){logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate','clickSend',util[_0xb21a('0x26')](_0x563d02,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x43'),_0xb21a('0x32'));}break;case _0xb21a('0x44'):if(_0x210237['authId']&&_0x210237[_0xb21a('0x1e')]){var _0x4b5412={'dst':_0x5e0d75[_0xb21a('0x1f')],'text':_0x5e0d75[_0xb21a('0xd')],'src':_0x210237[_0xb21a('0x34')]||_0x210237[_0xb21a('0x1f')],'url':_0x210237[_0xb21a('0x20')]+'/api/sms/messages/'+_0x5e0d75['id']+_0xb21a('0x21')+_0x210237[_0xb21a('0x45')]};var _0x40b801=util['format'](_0xb21a('0x38'),_0x210237['authId'],_0x210237[_0xb21a('0x1e')]);var _0x321310={'method':_0xb21a('0x46'),'uri':util[_0xb21a('0x39')]('https://api.plivo.com/v1/Account/%s/Message/',_0x210237[_0xb21a('0x47')]),'body':_0x4b5412,'headers':{'Authorization':util['format'](_0xb21a('0x48'),new Buffer(_0x40b801)['toString']('base64'))},'json':!![]};rp(_0x321310)['then'](function(_0x42115e){var _0x45c17c={'messageId':_0x42115e[_0xb21a('0x49')][0x0]};return _0x1f78c2[_0xb21a('0x19')](_0x45c17c);})[_0xb21a('0x23')](function(_0x31e1b3){logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),'plivo',util[_0xb21a('0x26')](_0x31e1b3,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x44'),_0xb21a('0x4a'));}break;case'infobip':if(_0x210237[_0xb21a('0x29')]&&_0x210237[_0xb21a('0x2a')]){if(_0x210237['baseUrl']){var _0x59c341={'method':_0xb21a('0x46'),'uri':_0x210237['baseUrl']+_0xb21a('0x4b'),'body':{'username':_0x210237['username'],'password':_0x210237[_0xb21a('0x2a')]},'json':!![]};return rp(_0x59c341)[_0xb21a('0x18')](function(_0xfa1f74){var _0x361140={'method':'POST','uri':_0x210237[_0xb21a('0x4c')]+_0xb21a('0x4d'),'body':{'messages':[{'from':_0x210237[_0xb21a('0x1f')],'destinations':[{'to':_0x5e0d75[_0xb21a('0x1f')]}],'text':_0x5e0d75[_0xb21a('0xd')],'notifyUrl':_0x210237[_0xb21a('0x20')]+'/api/sms/messages/'+_0x5e0d75['id']+_0xb21a('0x21')+_0x210237['token'],'notifyContentType':_0xb21a('0x4e'),'callbackData':_0x210237[_0xb21a('0x1f')]+';'+_0x5e0d75[_0xb21a('0xd')]}]},'headers':{'Authorization':_0xb21a('0x4f')+_0xfa1f74[_0xb21a('0x45')]},'json':!![]};return rp(_0x361140)[_0xb21a('0x18')](function(_0x24289a){if(_0x24289a[_0xb21a('0x40')]){var _0x590809={'messageId':_0x24289a['messages'][0x0][_0xb21a('0xc')]};if(!_0x210237[_0xb21a('0x42')]){_0x590809[_0xb21a('0x31')]=!![];}return _0x1f78c2[_0xb21a('0x19')](_0x590809);}else{return logger['error'](_0xb21a('0x24'),_0xb21a('0x25'),'infobip',util[_0xb21a('0x26')](_0x24289a,{'showHidden':![],'depth':null}));}});})[_0xb21a('0x23')](function(_0x192d12){return logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x50'),util[_0xb21a('0x26')](_0x192d12,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0xb21a('0x51'));}}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),'infobip',_0xb21a('0x32'));}break;case _0xb21a('0x52'):var _0x3809ed=require('crypto');if(_0x210237['apiKey']){var _0x575f65={};_0x575f65['login']=_0x210237[_0xb21a('0x29')];_0x575f65[_0xb21a('0x1f')]=_0x5e0d75['phone'];_0x575f65['sender']=_0x210237['phone'];_0x575f65[_0xb21a('0x53')]=_0x5e0d75[_0xb21a('0xd')];_0x575f65['timestamp']=+new Date();var _0x43b996='';var _0x46a3c4='';var _0xbbea81=Object[_0xb21a('0x54')](_0x575f65);_0xbbea81[_0xb21a('0x55')]();for(var _0x47d379=0x0;_0x47d379<_0xbbea81['length'];_0x47d379++){if(_0x43b996!=''){_0x43b996+='&';}_0x43b996+=_0xbbea81[_0x47d379]+'='+encodeURIComponent(_0x575f65[_0xbbea81[_0x47d379]]);_0x46a3c4+=_0x575f65[_0xbbea81[_0x47d379]];}_0x46a3c4+=_0x210237['apiKey'];_0x46a3c4=_0x3809ed[_0xb21a('0x56')](_0xb21a('0x57'))[_0xb21a('0x19')](_0x46a3c4)[_0xb21a('0x58')](_0xb21a('0x59'));if(_0x43b996!==''){_0x43b996+='&';}_0x43b996+=_0xb21a('0x5a')+_0x46a3c4;var _0xf3e2f1={'method':'GET','uri':_0x210237['baseUrl']+'/external/get/send.php?'+_0x43b996,'json':!![]};return rp(_0xf3e2f1)[_0xb21a('0x18')](function(_0x17ccec){var _0x9b2055=Object[_0xb21a('0x54')](_0x17ccec);if(_0x17ccec[_0x9b2055[0x0]][_0xb21a('0x1a')]&&parseInt(_0x17ccec[_0x9b2055[0x0]][_0xb21a('0x1a')])===0x0){var _0x4b6b84={'messageId':_0x17ccec[_0x9b2055[0x0]][_0xb21a('0x5b')]};if(!_0x210237[_0xb21a('0x42')]){_0x4b6b84[_0xb21a('0x31')]=!![];}return _0x1f78c2['update'](_0x4b6b84);}else{return logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate',_0xb21a('0x52'),util[_0xb21a('0x26')](_0x17ccec['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0xa176cb){return logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x52'),util[_0xb21a('0x26')](_0xa176cb,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x52'),_0xb21a('0x5c'));}break;case'clickatell':if(_0x210237['apiKey']){var _0xea12bf={'method':_0xb21a('0x46'),'uri':_0xb21a('0x5d'),'headers':{'Authorization':_0x210237[_0xb21a('0x5e')]},'body':{'content':_0x5e0d75[_0xb21a('0xd')],'to':[_0x5e0d75[_0xb21a('0x1f')]],'from':_0x210237['phone'],'binary':![],'clientMessageId':_0xb21a('0x5f'),'charset':_0xb21a('0x60')},'json':!![]};rp(_0xea12bf)[_0xb21a('0x18')](function(_0x561e4c){if(!_0x561e4c[_0xb21a('0x1a')]){var _0x4b7e17={'messageId':_0x561e4c[_0xb21a('0x40')][0x0][_0xb21a('0x61')]};if(!_0x210237[_0xb21a('0x42')]){_0x4b7e17[_0xb21a('0x31')]=!![];}return _0x1f78c2[_0xb21a('0x19')](_0x4b7e17);}else{return logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate','clickatell',util['inspect'](_0x561e4c['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x32a885){return logger['error'](_0xb21a('0x24'),_0xb21a('0x25'),'clickatell',util[_0xb21a('0x26')](_0x32a885,{'showHidden':![],'depth':null}));});}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),'afterCreate',_0xb21a('0x62'),_0xb21a('0x5c'));}break;case _0xb21a('0x63'):if(_0x210237[_0xb21a('0x29')]&&_0x210237[_0xb21a('0x2a')]){var _0x40b801=util['format'](_0xb21a('0x38'),_0x210237['username'],_0x210237['password']);var _0x321310={'method':_0xb21a('0x46'),'uri':_0xb21a('0x64')+_0x210237['accountId']+_0xb21a('0x65'),'body':{'to':[_0x5e0d75[_0xb21a('0x1f')]],'text':_0x5e0d75[_0xb21a('0xd')],'from':_0x210237[_0xb21a('0x1f')],'applicationId':_0x210237[_0xb21a('0x66')]},'headers':{'Authorization':util[_0xb21a('0x39')](_0xb21a('0x48'),new Buffer(_0x40b801)['toString'](_0xb21a('0x3b')))},'json':!![]};rp(_0x321310)[_0xb21a('0x18')](function(_0x2638f0){if(_0x2638f0['id']){var _0x3c7586={'messageId':_0x2638f0['id']};return _0x1f78c2[_0xb21a('0x19')](_0x3c7586);}else{logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),'bandwidth',util[_0xb21a('0x26')](_0x2638f0,{'showHidden':![],'depth':null}));}})[_0xb21a('0x23')](function(_0x55dba4){logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x63'),util[_0xb21a('0x26')](_0x55dba4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb21a('0x24'),_0xb21a('0x25'),_0xb21a('0x63'),_0xb21a('0x32'));}break;case _0xb21a('0x67'):if(_0x210237['apiKey']){var _0x4e1a93={};var _0xf3e2f1={'method':_0xb21a('0x46'),'uri':_0xb21a('0x68'),'headers':{'Authorization':_0xb21a('0x69')+_0x210237[_0xb21a('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x210237['phone'],'to':_0x5e0d75[_0xb21a('0x1f')],'text':_0x5e0d75['body']},'json':!![]};return rp(_0xf3e2f1)[_0xb21a('0x18')](function(_0x5e8c4a){if(_0x5e8c4a['code']==0xca){_0x4e1a93[_0xb21a('0x6a')]=_0x5e8c4a;var _0x1b8747={'method':_0xb21a('0x46'),'uri':_0xb21a('0x6b'),'headers':{'Authorization':_0xb21a('0x69')+_0x210237[_0xb21a('0x5e')],'Content-Type':_0xb21a('0x4e')},'body':{'refid':_0x4e1a93[_0xb21a('0x6a')]['refid']},'json':!![]};return rp(_0x1b8747)['then'](function(_0x7c3dfe){_0x4e1a93['status']=_0x7c3dfe;var _0xf58ead={'messageId':_0x4e1a93[_0xb21a('0x6a')]['refid'],'read':!![]};return _0x1f78c2[_0xb21a('0x19')](_0xf58ead);});}else{return logger[_0xb21a('0x1a')](_0xb21a('0x24'),_0xb21a('0x25'),'intelepeer',util[_0xb21a('0x26')](_0x5e8c4a,{'showHidden':![],'depth':null}));}})[_0xb21a('0x23')](function(_0x14b336){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb21a('0x67'),util[_0xb21a('0x26')](_0x14b336,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb21a('0x25'),_0xb21a('0x67'),_0xb21a('0x6c'));}break;}}})[_0xb21a('0x6d')](function(){_0x219c9b();});}else{_0x219c9b();}}},'charset':'utf8mb4','collate':_0xb21a('0x6e')});}; \ No newline at end of file +var _0x487c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','SmsInteractionId','findOne','update','createdAt','catch','error','out','find','then','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','token','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','session_key','total_sent','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x487c,0x1d6));var _0xc487=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x487c[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xc487('0x0'));var util=require(_0xc487('0x1'));var logger=require(_0xc487('0x2'))(_0xc487('0x3'));var moment=require(_0xc487('0x4'));var BPromise=require('bluebird');var rp=require(_0xc487('0x5'));var fs=require('fs');var path=require(_0xc487('0x6'));var rimraf=require(_0xc487('0x7'));var config=require(_0xc487('0x8'));var attributes=require('./smsMessage.attributes');module[_0xc487('0x9')]=function(_0x4fd09d,_0x52a4e7){return _0x4fd09d[_0xc487('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc487('0xb'),'fields':[_0xc487('0xb')]},{'name':_0xc487('0xc'),'fields':[_0xc487('0xd')],'type':_0xc487('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x271ee7,_0x5ab020,_0x322ff9){var _0x2e3477=_0x4fd09d['models'];var _0x28625a=_0x271ee7[_0xc487('0xf')]({'plain':!![]});if(_0x28625a[_0xc487('0x10')][_0xc487('0x11')]()==='in'||_0x28625a[_0xc487('0x10')]['toLowerCase']()==='out'&&!_0x28625a[_0xc487('0x12')]&&!_[_0xc487('0x13')](_0x28625a['UserId'])&&!_[_0xc487('0x13')](_0x28625a[_0xc487('0x14')])){_0x2e3477['SmsInteraction'][_0xc487('0x15')]({'where':{'id':_0x28625a[_0xc487('0x14')]}})['then'](function(_0x519286){if(_0x519286){_0x519286[_0xc487('0x16')]({'lastMsgAt':_0x28625a[_0xc487('0x17')],'lastMsgDirection':_0x28625a[_0xc487('0x10')][_0xc487('0x11')]()});}})[_0xc487('0x18')](function(_0x55aab2){console[_0xc487('0x19')](_0x55aab2);});}if(_0x28625a['direction']===_0xc487('0x1a')&&!_0x28625a[_0xc487('0x12')]){var _0x2777fa;_0x2e3477['SmsAccount'][_0xc487('0x1b')]({'where':{'id':_0x28625a['SmsAccountId']},'raw':!![]})[_0xc487('0x1c')](function(_0x259783){_0x2777fa=_0x259783;if(_0x2777fa&&_0x2777fa[_0xc487('0x1d')]){switch(_0x2777fa[_0xc487('0x1d')]){case'twilio':var _0x439f96=require(_0xc487('0x1e'));if(_0x2777fa[_0xc487('0x1f')]&&_0x2777fa[_0xc487('0x20')]&&_0x2777fa[_0xc487('0x21')]){var _0x1d7fcf=new _0x439f96(_0x2777fa[_0xc487('0x1f')],_0x2777fa[_0xc487('0x20')]);_0x1d7fcf[_0xc487('0x22')]['create']({'body':_0x28625a[_0xc487('0xd')],'to':_0x28625a[_0xc487('0x21')],'from':_0x2777fa['phone'],'statusCallback':_0x2777fa['remote']+_0xc487('0x23')+_0x28625a['id']+'/status?token='+_0x2777fa[_0xc487('0x24')]})['then'](function(_0x3a584e){if(_0x3a584e['sid']){return _0x271ee7[_0xc487('0x16')]({'messageId':_0x3a584e['sid']});}})[_0xc487('0x18')](function(_0x1b7e60){logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),'twilio',util['inspect'](_0x1b7e60,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x1e'),_0xc487('0x27'));}break;case _0xc487('0x28'):var _0x8bc364=_0xc487('0x29');if(_0x2777fa[_0xc487('0x2a')]&&_0x2777fa[_0xc487('0x2b')]){var _0x3e3cf1={'recipient':[_0x28625a[_0xc487('0x21')]],'message':_0x28625a[_0xc487('0xd')],'message_type':_0x2777fa['smsMethod']};if(_0x2777fa[_0xc487('0x2c')]&&_0x2777fa['smsMethod']!=='SI'){_0x3e3cf1[_0xc487('0x2d')]=_0x2777fa['phone'];}var _0x860e6f={'url':_0x8bc364+_0xc487('0x2e')+_0x2777fa[_0xc487('0x2a')]+_0xc487('0x2f')+_0x2777fa[_0xc487('0x2b')],'method':'GET'};rp(_0x860e6f)[_0xc487('0x1c')](function(_0x12c19e){var _0x289013=_0x12c19e[_0xc487('0x30')](';');var _0x1c0963={'user_key':_0x289013[0x0],'session_key':_0x289013[0x1]};_0x860e6f={'url':_0x8bc364+_0xc487('0x31'),'method':_0xc487('0x32'),'headers':{'user_key':_0x1c0963['user_key'],'Session_key':_0x1c0963[_0xc487('0x33')]},'json':!![],'body':_0x3e3cf1};return rp(_0x860e6f);})['then'](function(_0x529f09){if(_0x529f09[_0xc487('0x34')]>=0x1){var _0x3efd66={'messageId':_0x529f09['internal_order_id']};if(_0x2777fa[_0xc487('0x2c')]!=='GP'||!_0x2777fa[_0xc487('0x35')]){_0x3efd66[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x3efd66);}else{return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x28'),util[_0xc487('0x37')](_0x529f09,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x230c3e){return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x28'),util[_0xc487('0x37')](_0x230c3e,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x28'),_0xc487('0x38'));}break;case'connectel':if(_0x2777fa['authToken']){var _0x27f29b={'recipient':_0x28625a['phone'],'message':_0x28625a['body'],'sender':_0x2777fa[_0xc487('0x39')]||_0x2777fa[_0xc487('0x21')],'authorization':_0x2777fa[_0xc487('0x20')]};var _0x5ab020={'method':'POST','uri':_0xc487('0x3a'),'body':_0x27f29b,'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x4a9f72){var _0x364f27={'messageId':_0x4a9f72[_0xc487('0x3b')]};if(!_0x2777fa[_0xc487('0x35')]){_0x364f27['read']=!![];}return _0x271ee7[_0xc487('0x16')](_0x364f27);})[_0xc487('0x18')](function(_0x3a01ae){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x3c'),util['inspect'](_0x3a01ae,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xc487('0x3d'):if(_0x2777fa['username']&&_0x2777fa[_0xc487('0x2b')]){var _0x27f29b={'messages':[{'source':_0xc487('0x3e'),'to':_0x28625a[_0xc487('0x21')],'body':_0x28625a[_0xc487('0xd')],'from':_0x2777fa['senderString']||_0x2777fa[_0xc487('0x21')]}]};var _0x55f498=util[_0xc487('0x3f')](_0xc487('0x40'),_0x2777fa[_0xc487('0x2a')],_0x2777fa['password']);var _0x5ab020={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x27f29b,'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x46982b){if(_0x46982b[_0xc487('0x43')]>=0xc8&&_0x46982b[_0xc487('0x43')]<=0xce){if(_0x46982b[_0xc487('0x44')]&&_0x46982b[_0xc487('0x44')][_0xc487('0x45')]>0x0){var _0x49c37e=_['head'](_0x46982b[_0xc487('0x44')][_0xc487('0x22')]);var _0x15e5e0={'messageId':_0x49c37e[_0xc487('0x46')]};if(!_0x2777fa['deliveryReport']){_0x15e5e0[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x15e5e0);}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util['inspect'](_0x46982b,{'showHidden':![],'depth':null}));}}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util[_0xc487('0x37')](_0x46982b,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x155e3f){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util[_0xc487('0x37')](_0x155e3f,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xc487('0x48'):if(_0x2777fa[_0xc487('0x49')]&&_0x2777fa['authToken']){var _0x27f29b={'dst':_0x28625a[_0xc487('0x21')],'text':_0x28625a['body'],'src':_0x2777fa[_0xc487('0x39')]||_0x2777fa['phone'],'url':_0x2777fa[_0xc487('0x4a')]+_0xc487('0x23')+_0x28625a['id']+_0xc487('0x4b')+_0x2777fa[_0xc487('0x24')]};var _0x55f498=util['format'](_0xc487('0x40'),_0x2777fa['authId'],_0x2777fa[_0xc487('0x20')]);var _0x5ab020={'method':'POST','uri':util[_0xc487('0x3f')](_0xc487('0x4c'),_0x2777fa[_0xc487('0x49')]),'body':_0x27f29b,'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x2dd0e6){var _0x452aa4={'messageId':_0x2dd0e6[_0xc487('0x4d')][0x0]};return _0x271ee7['update'](_0x452aa4);})[_0xc487('0x18')](function(_0x2f44a1){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x48'),util[_0xc487('0x37')](_0x2f44a1,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc487('0x4e'):if(_0x2777fa['username']&&_0x2777fa[_0xc487('0x2b')]){if(_0x2777fa[_0xc487('0x4f')]){var _0xb9d4c3={'method':_0xc487('0x32'),'uri':_0x2777fa[_0xc487('0x4f')]+_0xc487('0x50'),'body':{'username':_0x2777fa[_0xc487('0x2a')],'password':_0x2777fa[_0xc487('0x2b')]},'json':!![]};return rp(_0xb9d4c3)[_0xc487('0x1c')](function(_0x339742){var _0x2258ec={'method':'POST','uri':_0x2777fa['baseUrl']+_0xc487('0x51'),'body':{'messages':[{'from':_0x2777fa[_0xc487('0x21')],'destinations':[{'to':_0x28625a[_0xc487('0x21')]}],'text':_0x28625a[_0xc487('0xd')],'notifyUrl':_0x2777fa[_0xc487('0x4a')]+'/api/sms/messages/'+_0x28625a['id']+'/status?token='+_0x2777fa[_0xc487('0x24')],'notifyContentType':_0xc487('0x52'),'callbackData':_0x2777fa[_0xc487('0x21')]+';'+_0x28625a[_0xc487('0xd')]}]},'headers':{'Authorization':_0xc487('0x53')+_0x339742[_0xc487('0x24')]},'json':!![]};return rp(_0x2258ec)['then'](function(_0x39a405){if(_0x39a405[_0xc487('0x22')]){var _0xc03e9={'messageId':_0x39a405[_0xc487('0x22')][0x0][_0xc487('0xb')]};if(!_0x2777fa[_0xc487('0x35')]){_0xc03e9[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0xc03e9);}else{return logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x4e'),util['inspect'](_0x39a405,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x497f65){return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),util[_0xc487('0x37')](_0x497f65,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),_0xc487('0x54'));}}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),_0xc487('0x38'));}break;case _0xc487('0x55'):var _0x32465c=require('crypto');if(_0x2777fa[_0xc487('0x56')]){var _0x5327f7={};_0x5327f7[_0xc487('0x57')]=_0x2777fa[_0xc487('0x2a')];_0x5327f7[_0xc487('0x21')]=_0x28625a[_0xc487('0x21')];_0x5327f7['sender']=_0x2777fa[_0xc487('0x21')];_0x5327f7[_0xc487('0x58')]=_0x28625a['body'];_0x5327f7[_0xc487('0x59')]=+new Date();var _0x3233d7='';var _0x364879='';var _0xaf7b46=Object[_0xc487('0x5a')](_0x5327f7);_0xaf7b46['sort']();for(var _0x33efcb=0x0;_0x33efcb<_0xaf7b46[_0xc487('0x5b')];_0x33efcb++){if(_0x3233d7!=''){_0x3233d7+='&';}_0x3233d7+=_0xaf7b46[_0x33efcb]+'='+encodeURIComponent(_0x5327f7[_0xaf7b46[_0x33efcb]]);_0x364879+=_0x5327f7[_0xaf7b46[_0x33efcb]];}_0x364879+=_0x2777fa[_0xc487('0x56')];_0x364879=_0x32465c[_0xc487('0x5c')](_0xc487('0x5d'))[_0xc487('0x16')](_0x364879)[_0xc487('0x5e')](_0xc487('0x5f'));if(_0x3233d7!==''){_0x3233d7+='&';}_0x3233d7+=_0xc487('0x60')+_0x364879;var _0x860e6f={'method':_0xc487('0x61'),'uri':_0x2777fa[_0xc487('0x4f')]+_0xc487('0x62')+_0x3233d7,'json':!![]};return rp(_0x860e6f)['then'](function(_0x91726c){var _0x19bd6f=Object['keys'](_0x91726c);if(_0x91726c[_0x19bd6f[0x0]][_0xc487('0x19')]&&parseInt(_0x91726c[_0x19bd6f[0x0]]['error'])===0x0){var _0x355b50={'messageId':_0x91726c[_0x19bd6f[0x0]][_0xc487('0x63')]};if(!_0x2777fa[_0xc487('0x35')]){_0x355b50[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x355b50);}else{return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate','csc',util[_0xc487('0x37')](_0x91726c[_0xc487('0x19')],{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x117b77){return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x55'),util[_0xc487('0x37')](_0x117b77,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x55'),_0xc487('0x64'));}break;case'clickatell':if(_0x2777fa[_0xc487('0x56')]){var _0x3365a5={'method':_0xc487('0x32'),'uri':_0xc487('0x65'),'headers':{'Authorization':_0x2777fa['apiKey']},'body':{'content':_0x28625a['body'],'to':[_0x28625a[_0xc487('0x21')]],'from':_0x2777fa[_0xc487('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xc487('0x66')},'json':!![]};rp(_0x3365a5)[_0xc487('0x1c')](function(_0x3e3052){if(!_0x3e3052[_0xc487('0x19')]){var _0x30133b={'messageId':_0x3e3052[_0xc487('0x22')][0x0]['apiMessageId']};if(!_0x2777fa[_0xc487('0x35')]){_0x30133b[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x30133b);}else{return logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x67'),util[_0xc487('0x37')](_0x3e3052['error'],{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x320404){return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x67'),util[_0xc487('0x37')](_0x320404,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x67'),_0xc487('0x64'));}break;case _0xc487('0x68'):if(_0x2777fa[_0xc487('0x2a')]&&_0x2777fa[_0xc487('0x2b')]){var _0x55f498=util[_0xc487('0x3f')]('%s:%s',_0x2777fa['username'],_0x2777fa[_0xc487('0x2b')]);var _0x5ab020={'method':_0xc487('0x32'),'uri':_0xc487('0x69')+_0x2777fa[_0xc487('0x6a')]+_0xc487('0x6b'),'body':{'to':[_0x28625a[_0xc487('0x21')]],'text':_0x28625a['body'],'from':_0x2777fa[_0xc487('0x21')],'applicationId':_0x2777fa['applicationId']},'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x214856){if(_0x214856['id']){var _0x1ae642={'messageId':_0x214856['id']};return _0x271ee7[_0xc487('0x16')](_0x1ae642);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x68'),util['inspect'](_0x214856,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2af077){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x68'),util[_0xc487('0x37')](_0x2af077,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xc487('0x6c'):if(_0x2777fa[_0xc487('0x56')]){var _0x6c3a2b={};var _0x860e6f={'method':'POST','uri':_0xc487('0x6d'),'headers':{'Authorization':_0xc487('0x6e')+_0x2777fa[_0xc487('0x56')],'Content-Type':_0xc487('0x52')},'body':{'from':_0x2777fa[_0xc487('0x21')],'to':_0x28625a[_0xc487('0x21')],'text':_0x28625a[_0xc487('0xd')]},'json':!![]};return rp(_0x860e6f)[_0xc487('0x1c')](function(_0x39c16c){if(_0x39c16c['code']==0xca){_0x6c3a2b[_0xc487('0x6f')]=_0x39c16c;var _0x2b0f99={'method':_0xc487('0x32'),'uri':_0xc487('0x70'),'headers':{'Authorization':_0xc487('0x6e')+_0x2777fa[_0xc487('0x56')],'Content-Type':_0xc487('0x52')},'body':{'refid':_0x6c3a2b[_0xc487('0x6f')][_0xc487('0x71')]},'json':!![]};return rp(_0x2b0f99)[_0xc487('0x1c')](function(_0x5da46b){_0x6c3a2b[_0xc487('0x72')]=_0x5da46b;var _0x4ee566={'messageId':_0x6c3a2b[_0xc487('0x6f')][_0xc487('0x71')],'read':!![]};return _0x271ee7['update'](_0x4ee566);});}else{return logger['error'](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x6c'),util[_0xc487('0x37')](_0x39c16c,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0xc22f8d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc487('0x6c'),util['inspect'](_0xc22f8d,{'showHidden':![],'depth':null}));});}else{return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate','intelepeer',_0xc487('0x73'));}break;}}})[_0xc487('0x74')](function(){_0x322ff9();});}else{_0x322ff9();}}},'charset':_0xc487('0x75'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9f1c346..ad7cd89 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 _0xd667=['stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd667,0x18b));var _0x7d66=function(_0x1f057d,_0x47e3ad){_0x1f057d=_0x1f057d-0x0;var _0x5a7b87=_0xd667[_0x1f057d];return _0x5a7b87;};'use strict';var _=require(_0x7d66('0x0'));var util=require(_0x7d66('0x1'));var moment=require('moment');var BPromise=require(_0x7d66('0x2'));var rs=require(_0x7d66('0x3'));var fs=require('fs');var Redis=require(_0x7d66('0x4'));var db=require(_0x7d66('0x5'))['db'];var utils=require(_0x7d66('0x6'));var logger=require(_0x7d66('0x7'))(_0x7d66('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d66('0x9')][_0x7d66('0xa')]({'port':0x232a});config[_0x7d66('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7d66('0xc'))(new Redis(config[_0x7d66('0xb')]));require('./smsMessage.socket')[_0x7d66('0xd')](socket);function respondWithRpcPromise(_0x59eff1,_0x2e35f5,_0x4ef855){return new BPromise(function(_0x1f7464,_0xdb9f1c){return client[_0x7d66('0xe')](_0x59eff1,_0x4ef855)[_0x7d66('0xf')](function(_0x549e0f){logger[_0x7d66('0x10')](_0x7d66('0x11'),_0x2e35f5,_0x7d66('0x12'));logger[_0x7d66('0x13')](_0x7d66('0x14'),_0x2e35f5,_0x7d66('0x12'),JSON[_0x7d66('0x15')](_0x549e0f));if(_0x549e0f[_0x7d66('0x16')]){if(_0x549e0f[_0x7d66('0x16')][_0x7d66('0x17')]===0x1f4){logger[_0x7d66('0x16')](_0x7d66('0x11'),_0x2e35f5,_0x549e0f[_0x7d66('0x16')]['message']);return _0xdb9f1c(_0x549e0f[_0x7d66('0x16')][_0x7d66('0x18')]);}logger['error'](_0x7d66('0x11'),_0x2e35f5,_0x549e0f['error'][_0x7d66('0x18')]);return _0x1f7464(_0x549e0f[_0x7d66('0x16')][_0x7d66('0x18')]);}else{logger[_0x7d66('0x10')](_0x7d66('0x11'),_0x2e35f5,_0x7d66('0x12'));_0x1f7464(_0x549e0f[_0x7d66('0x19')][_0x7d66('0x18')]);}})[_0x7d66('0x1a')](function(_0x7fcff9){logger[_0x7d66('0x16')](_0x7d66('0x11'),_0x2e35f5,_0x7fcff9);_0xdb9f1c(_0x7fcff9);});});}exports[_0x7d66('0x1b')]=function(_0x3c2283){var _0x211ec7=this;return new Promise(function(_0x5e75fc,_0x224b35){return db[_0x7d66('0x1c')][_0x7d66('0x1d')](_0x3c2283[_0x7d66('0x1e')],{'raw':_0x3c2283[_0x7d66('0x1f')]?_0x3c2283[_0x7d66('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2a119b){logger[_0x7d66('0x10')](_0x7d66('0x1b'),_0x3c2283);logger[_0x7d66('0x13')](_0x7d66('0x1b'),_0x3c2283,JSON[_0x7d66('0x15')](_0x2a119b));_0x5e75fc(_0x2a119b);})[_0x7d66('0x1a')](function(_0x261d5b){logger[_0x7d66('0x16')]('CreateSmsMessage',_0x261d5b['message'],_0x3c2283);_0x224b35(_0x211ec7[_0x7d66('0x16')](0x1f4,_0x261d5b[_0x7d66('0x18')]));});});}; \ No newline at end of file +var _0xb92f=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsMessage','create','options','raw','then','CreateSmsMessage','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xb92f,0x158));var _0xfb92=function(_0x3e8618,_0x2010c7){_0x3e8618=_0x3e8618-0x0;var _0x4882ff=_0xb92f[_0x3e8618];return _0x4882ff;};'use strict';var _=require('lodash');var util=require(_0xfb92('0x0'));var moment=require(_0xfb92('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb92('0x2'));var fs=require('fs');var Redis=require(_0xfb92('0x3'));var db=require(_0xfb92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb92('0x5'))(_0xfb92('0x6'));var config=require(_0xfb92('0x7'));var jayson=require(_0xfb92('0x8'));var client=jayson[_0xfb92('0x9')]['http']({'port':0x232a});config[_0xfb92('0xa')]=_[_0xfb92('0xb')](config[_0xfb92('0xa')],{'host':_0xfb92('0xc'),'port':0x18eb});var socket=require(_0xfb92('0xd'))(new Redis(config[_0xfb92('0xa')]));require(_0xfb92('0xe'))['register'](socket);function respondWithRpcPromise(_0x8edf2b,_0x5a27a8,_0x359855){return new BPromise(function(_0x8b4330,_0x345fc0){return client[_0xfb92('0xf')](_0x8edf2b,_0x359855)['then'](function(_0x467a33){logger[_0xfb92('0x10')](_0xfb92('0x11'),_0x5a27a8,'request\x20sent');logger['debug'](_0xfb92('0x12'),_0x5a27a8,_0xfb92('0x13'),JSON[_0xfb92('0x14')](_0x467a33));if(_0x467a33[_0xfb92('0x15')]){if(_0x467a33[_0xfb92('0x15')][_0xfb92('0x16')]===0x1f4){logger['error'](_0xfb92('0x11'),_0x5a27a8,_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);return _0x345fc0(_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);}logger[_0xfb92('0x15')](_0xfb92('0x11'),_0x5a27a8,_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);return _0x8b4330(_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);}else{logger[_0xfb92('0x10')](_0xfb92('0x11'),_0x5a27a8,'request\x20sent');_0x8b4330(_0x467a33['result']['message']);}})[_0xfb92('0x18')](function(_0x39ef5d){logger['error'](_0xfb92('0x11'),_0x5a27a8,_0x39ef5d);_0x345fc0(_0x39ef5d);});});}exports['CreateSmsMessage']=function(_0x5ad00b){var _0xa047f6=this;return new Promise(function(_0x1e2860,_0x24d46e){return db[_0xfb92('0x19')][_0xfb92('0x1a')](_0x5ad00b['body'],{'raw':_0x5ad00b[_0xfb92('0x1b')]?_0x5ad00b['options'][_0xfb92('0x1c')]===undefined?!![]:![]:!![]})[_0xfb92('0x1d')](function(_0x279c70){logger[_0xfb92('0x10')](_0xfb92('0x1e'),_0x5ad00b);logger[_0xfb92('0x1f')](_0xfb92('0x1e'),_0x5ad00b,JSON[_0xfb92('0x14')](_0x279c70));_0x1e2860(_0x279c70);})[_0xfb92('0x18')](function(_0x17b77d){logger['error']('CreateSmsMessage',_0x17b77d[_0xfb92('0x17')],_0x5ad00b);_0x24d46e(_0xa047f6[_0xfb92('0x15')](0x1f4,_0x17b77d[_0xfb92('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 51a11da..73471dd 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 _0x21c9=['removeListener','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x3899be,_0x160c27){var _0x4a77e5=function(_0x1cc12f){while(--_0x1cc12f){_0x3899be['push'](_0x3899be['shift']());}};_0x4a77e5(++_0x160c27);}(_0x21c9,0x10c));var _0x921c=function(_0x2555e5,_0xd91f0a){_0x2555e5=_0x2555e5-0x0;var _0x1a97ec=_0x21c9[_0x2555e5];return _0x1a97ec;};'use strict';var SmsMessageEvents=require(_0x921c('0x0'));var events=[_0x921c('0x1'),_0x921c('0x2'),_0x921c('0x3')];function createListener(_0x30b84f,_0x5d8f33){return function(_0x4d0512){_0x5d8f33[_0x921c('0x4')](_0x30b84f,_0x4d0512);};}function removeListener(_0x3eef39,_0x45f3b1){return function(){SmsMessageEvents[_0x921c('0x5')](_0x3eef39,_0x45f3b1);};}exports['register']=function(_0x214d8e){for(var _0x2d72a7=0x0,_0x4b02a1=events['length'];_0x2d72a7<_0x4b02a1;_0x2d72a7++){var _0x49238e=events[_0x2d72a7];var _0x310a72=createListener(_0x921c('0x6')+_0x49238e,_0x214d8e);SmsMessageEvents['on'](_0x49238e,_0x310a72);}}; \ No newline at end of file +var _0x0e27=['save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x0e27,0x160));var _0x70e2=function(_0x4940f7,_0xeef48b){_0x4940f7=_0x4940f7-0x0;var _0x1e2e08=_0x0e27[_0x4940f7];return _0x1e2e08;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x70e2('0x0'),_0x70e2('0x1'),_0x70e2('0x2')];function createListener(_0x4ba4ff,_0x491e97){return function(_0xe2547a){_0x491e97[_0x70e2('0x3')](_0x4ba4ff,_0xe2547a);};}function removeListener(_0x2320ed,_0x3424eb){return function(){SmsMessageEvents[_0x70e2('0x4')](_0x2320ed,_0x3424eb);};}exports[_0x70e2('0x5')]=function(_0x5e139d){for(var _0x35bdc6=0x0,_0x4284f1=events[_0x70e2('0x6')];_0x35bdc6<_0x4284f1;_0x35bdc6++){var _0x15651f=events[_0x35bdc6];var _0x4fd080=createListener(_0x70e2('0x7')+_0x15651f,_0x5e139d);SmsMessageEvents['on'](_0x15651f,_0x4fd080);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5a88903..789bf6c 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 _0x098a=['post','addTeams','addAgents','put','/:id','update','delete','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x452bcf,_0x62ad6b){var _0x4fcff5=function(_0x5215bb){while(--_0x5215bb){_0x452bcf['push'](_0x452bcf['shift']());}};_0x4fcff5(++_0x62ad6b);}(_0x098a,0x10d));var _0xa098=function(_0x36b257,_0x10d661){_0x36b257=_0x36b257-0x0;var _0xbaf692=_0x098a[_0x36b257];return _0xbaf692;};'use strict';var multer=require(_0xa098('0x0'));var util=require(_0xa098('0x1'));var path=require('path');var timeout=require(_0xa098('0x2'));var express=require(_0xa098('0x3'));var router=express['Router']();var fs_extra=require(_0xa098('0x4'));var auth=require(_0xa098('0x5'));var interaction=require(_0xa098('0x6'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xa098('0x7')]('/',auth[_0xa098('0x8')](),controller['index']);router[_0xa098('0x7')](_0xa098('0x9'),auth[_0xa098('0x8')](),controller[_0xa098('0xa')]);router[_0xa098('0x7')]('/:id',auth[_0xa098('0x8')](),controller[_0xa098('0xb')]);router['get'](_0xa098('0xc'),auth[_0xa098('0x8')](),controller[_0xa098('0xd')]);router[_0xa098('0x7')](_0xa098('0xe'),auth[_0xa098('0x8')](),controller[_0xa098('0xf')]);router[_0xa098('0x7')](_0xa098('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa098('0x11')]('/',auth[_0xa098('0x8')](),controller['create']);router[_0xa098('0x11')](_0xa098('0xe'),auth[_0xa098('0x8')](),controller[_0xa098('0x12')]);router[_0xa098('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xa098('0x13')]);router[_0xa098('0x14')](_0xa098('0x15'),auth[_0xa098('0x8')](),controller[_0xa098('0x16')]);router['delete'](_0xa098('0x15'),auth[_0xa098('0x8')](),controller['destroy']);router[_0xa098('0x17')]('/:id/teams',auth[_0xa098('0x8')](),controller['removeTeams']);router[_0xa098('0x17')](_0xa098('0x10'),auth[_0xa098('0x8')](),controller[_0xa098('0x18')]);module[_0xa098('0x19')]=router; \ No newline at end of file +var _0xf795=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/members','getMembers','/:id/teams'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0xf795,0x15b));var _0x5f79=function(_0x2fb8d3,_0x2ec153){_0x2fb8d3=_0x2fb8d3-0x0;var _0x278bec=_0xf795[_0x2fb8d3];return _0x278bec;};'use strict';var multer=require(_0x5f79('0x0'));var util=require('util');var path=require(_0x5f79('0x1'));var timeout=require(_0x5f79('0x2'));var express=require(_0x5f79('0x3'));var router=express['Router']();var fs_extra=require(_0x5f79('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f79('0x5'));var config=require(_0x5f79('0x6'));var controller=require(_0x5f79('0x7'));router['get']('/',auth[_0x5f79('0x8')](),controller[_0x5f79('0x9')]);router['get'](_0x5f79('0xa'),auth['isAuthenticated'](),controller[_0x5f79('0xb')]);router[_0x5f79('0xc')](_0x5f79('0xd'),auth[_0x5f79('0x8')](),controller['show']);router[_0x5f79('0xc')](_0x5f79('0xe'),auth[_0x5f79('0x8')](),controller[_0x5f79('0xf')]);router[_0x5f79('0xc')](_0x5f79('0x10'),auth['isAuthenticated'](),controller[_0x5f79('0x11')]);router['get'](_0x5f79('0x12'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x13')]);router[_0x5f79('0x14')]('/',auth[_0x5f79('0x8')](),controller[_0x5f79('0x15')]);router[_0x5f79('0x14')](_0x5f79('0x10'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x16')]);router['post'](_0x5f79('0x12'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x17')]);router['put'](_0x5f79('0xd'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x18')]);router['delete'](_0x5f79('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x5f79('0x19')](_0x5f79('0x10'),auth[_0x5f79('0x8')](),controller['removeTeams']);router[_0x5f79('0x19')]('/:id/users',auth[_0x5f79('0x8')](),controller[_0x5f79('0x1a')]);module[_0x5f79('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c80618d..057fbfa 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 _0x9e6e=['beepall','roundrobin','STRING','INTEGER','ENUM','rrmemory'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x9e6e,0xc2));var _0xe9e6=function(_0x261062,_0x4145b9){_0x261062=_0x261062-0x0;var _0x38ef4f=_0x9e6e[_0x261062];return _0x38ef4f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe9e6('0x0')]},'timeout':{'type':Sequelize[_0xe9e6('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe9e6('0x2')](_0xe9e6('0x3'),_0xe9e6('0x4'),_0xe9e6('0x5'))}}; \ No newline at end of file +var _0xe132=['exports','ENUM','rrmemory','beepall'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xe132,0x13c));var _0x2e13=function(_0x275d16,_0x1d42a6){_0x275d16=_0x275d16-0x0;var _0x2a4873=_0xe132[_0x275d16];return _0x2a4873;};'use strict';var Sequelize=require('sequelize');module[_0x2e13('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e13('0x1')](_0x2e13('0x2'),_0x2e13('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d021da1..5f93d3d 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 _0xbb4d=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','catch','show','params','intersection','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileSection','find','userProfileId','UserProfileResource','error','describe','getMembers','findOne','hasOwnProperty','UserSmsQueue','findAll','User','findAndCountAll','smsPause','updatedAt','createdAt','rows','%s/%s','Team','getTeams','ids','Agents','online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0xbb4d,0x19f));var _0xdbb4=function(_0x278679,_0x1eb219){_0x278679=_0x278679-0x0;var _0x4874aa=_0xbb4d[_0x278679];return _0x4874aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbb4('0x0'));var zipdir=require(_0xdbb4('0x1'));var jsonpatch=require(_0xdbb4('0x2'));var rp=require(_0xdbb4('0x3'));var moment=require(_0xdbb4('0x4'));var BPromise=require(_0xdbb4('0x5'));var Mustache=require('mustache');var util=require(_0xdbb4('0x6'));var path=require(_0xdbb4('0x7'));var sox=require(_0xdbb4('0x8'));var csv=require(_0xdbb4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbb4('0xa'));var _=require(_0xdbb4('0xb'));var squel=require(_0xdbb4('0xc'));var crypto=require(_0xdbb4('0xd'));var jsforce=require(_0xdbb4('0xe'));var deskjs=require(_0xdbb4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdbb4('0x10'));var Papa=require(_0xdbb4('0x11'));var Redis=require(_0xdbb4('0x12'));var authService=require(_0xdbb4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdbb4('0x14'));var hardwareService=require(_0xdbb4('0x15'));var logger=require(_0xdbb4('0x16'))(_0xdbb4('0x17'));var utils=require(_0xdbb4('0x18'));var config=require(_0xdbb4('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdbb4('0x1a')],{'host':_0xdbb4('0x1b'),'port':0x18eb});var socket=require(_0xdbb4('0x1c'))(new Redis(config[_0xdbb4('0x1a')]));require(_0xdbb4('0x1d'))[_0xdbb4('0x1e')](socket);function respondWithStatusCode(_0x5a3f47,_0x13c769){_0x13c769=_0x13c769||0xcc;return function(_0x11af11){if(_0x11af11){return _0x5a3f47[_0xdbb4('0x1f')](_0x13c769);}return _0x5a3f47[_0xdbb4('0x20')](_0x13c769)[_0xdbb4('0x21')]();};}function respondWithResult(_0x2dfa83,_0x3e1e57){_0x3e1e57=_0x3e1e57||0xc8;return function(_0x3f3a82){if(_0x3f3a82){return _0x2dfa83[_0xdbb4('0x20')](_0x3e1e57)[_0xdbb4('0x22')](_0x3f3a82);}};}function respondWithFilteredResult(_0x42a297,_0x465fdb){return function(_0x323ae0){if(_0x323ae0){var _0x1da36c=typeof _0x465fdb[_0xdbb4('0x23')]===_0xdbb4('0x24')&&typeof _0x465fdb[_0xdbb4('0x25')]===_0xdbb4('0x24');var _0x4bdb0a=_0x323ae0[_0xdbb4('0x26')];var _0x2596c9=_0x1da36c?0x0:_0x465fdb['offset'];var _0x22e0d2=_0x1da36c?_0x323ae0[_0xdbb4('0x26')]:_0x465fdb[_0xdbb4('0x23')]+_0x465fdb[_0xdbb4('0x25')];var _0x535477;if(_0x22e0d2>=_0x4bdb0a){_0x22e0d2=_0x4bdb0a;_0x535477=0xc8;}else{_0x535477=0xce;}_0x42a297[_0xdbb4('0x20')](_0x535477);return _0x42a297[_0xdbb4('0x27')](_0xdbb4('0x28'),_0x2596c9+'-'+_0x22e0d2+'/'+_0x4bdb0a)[_0xdbb4('0x22')](_0x323ae0);}return null;};}function patchUpdates(_0x4fa166){return function(_0x460755){try{jsonpatch[_0xdbb4('0x29')](_0x460755,_0x4fa166,!![]);}catch(_0x4c080b){return BPromise[_0xdbb4('0x2a')](_0x4c080b);}return _0x460755[_0xdbb4('0x2b')]();};}function saveUpdates(_0x6a1199,_0x2e6fc1){return function(_0x59aed1){if(_0x59aed1){return _0x59aed1[_0xdbb4('0x2c')](_0x6a1199)[_0xdbb4('0x2d')](function(_0xd2c648){return _0xd2c648;});}return null;};}function removeEntity(_0x2510b1,_0x1979fb){return function(_0x147a23){if(_0x147a23){return _0x147a23[_0xdbb4('0x2e')]()[_0xdbb4('0x2d')](function(){var _0x5e6be1=_0x147a23[_0xdbb4('0x2f')]({'plain':!![]});var _0x164b2c='SmsQueues';return db['UserProfileResource'][_0xdbb4('0x2e')]({'where':{'type':_0x164b2c,'resourceId':_0x5e6be1['id']}})[_0xdbb4('0x2d')](function(){return _0x147a23;});})['then'](function(){_0x2510b1[_0xdbb4('0x20')](0xcc)[_0xdbb4('0x21')]();});}};}function handleEntityNotFound(_0x433add,_0x155839){return function(_0x1fcc8c){if(!_0x1fcc8c){_0x433add[_0xdbb4('0x1f')](0x194);}return _0x1fcc8c;};}function handleError(_0x17d403,_0x49ae7c){_0x49ae7c=_0x49ae7c||0x1f4;return function(_0x1ed9fa){logger['error'](_0x1ed9fa['stack']);if(_0x1ed9fa['name']){delete _0x1ed9fa[_0xdbb4('0x30')];}_0x17d403['status'](_0x49ae7c)['send'](_0x1ed9fa);};}exports[_0xdbb4('0x31')]=function(_0x211ecd,_0x4f6f77){var _0x45a105={},_0x1aa8cd={},_0x18e1f3={'count':0x0,'rows':[]};var _0x2be27b=_[_0xdbb4('0x32')](db['SmsQueue'][_0xdbb4('0x33')],function(_0x579b77){return{'name':_0x579b77[_0xdbb4('0x34')],'type':_0x579b77[_0xdbb4('0x35')][_0xdbb4('0x36')]};});_0x1aa8cd[_0xdbb4('0x37')]=_[_0xdbb4('0x32')](_0x2be27b,_0xdbb4('0x30'));_0x1aa8cd[_0xdbb4('0x38')]=_[_0xdbb4('0x39')](_0x211ecd[_0xdbb4('0x38')]);_0x1aa8cd[_0xdbb4('0x3a')]=_['intersection'](_0x1aa8cd['model'],_0x1aa8cd['query']);_0x45a105[_0xdbb4('0x3b')]=_['intersection'](_0x1aa8cd[_0xdbb4('0x37')],qs['fields'](_0x211ecd['query']['fields']));_0x45a105[_0xdbb4('0x3b')]=_0x45a105[_0xdbb4('0x3b')][_0xdbb4('0x3c')]?_0x45a105[_0xdbb4('0x3b')]:_0x1aa8cd[_0xdbb4('0x37')];if(!_0x211ecd[_0xdbb4('0x38')]['hasOwnProperty'](_0xdbb4('0x3d'))){_0x45a105[_0xdbb4('0x25')]=qs[_0xdbb4('0x25')](_0x211ecd[_0xdbb4('0x38')][_0xdbb4('0x25')]);_0x45a105[_0xdbb4('0x23')]=qs[_0xdbb4('0x23')](_0x211ecd['query'][_0xdbb4('0x23')]);}_0x45a105[_0xdbb4('0x3e')]=qs[_0xdbb4('0x3f')](_0x211ecd['query'][_0xdbb4('0x3f')]);_0x45a105[_0xdbb4('0x40')]=qs[_0xdbb4('0x3a')](_[_0xdbb4('0x41')](_0x211ecd[_0xdbb4('0x38')],_0x1aa8cd[_0xdbb4('0x3a')]),_0x2be27b);if(_0x211ecd[_0xdbb4('0x38')][_0xdbb4('0x42')]){_0x45a105[_0xdbb4('0x40')]=_[_0xdbb4('0x43')](_0x45a105[_0xdbb4('0x40')],{'$or':_[_0xdbb4('0x32')](_0x2be27b,function(_0x65adfb){if(_0x65adfb[_0xdbb4('0x35')]!==_0xdbb4('0x44')){var _0x1a619e={};_0x1a619e[_0x65adfb[_0xdbb4('0x30')]]={'$like':'%'+_0x211ecd[_0xdbb4('0x38')]['filter']+'%'};return _0x1a619e;}})});}_0x45a105=_[_0xdbb4('0x43')]({},_0x45a105,_0x211ecd[_0xdbb4('0x45')]);var _0x3186b={'where':_0x45a105['where']};return db[_0xdbb4('0x46')][_0xdbb4('0x26')](_0x3186b)[_0xdbb4('0x2d')](function(_0x2bc1fd){_0x18e1f3['count']=_0x2bc1fd;if(_0x211ecd[_0xdbb4('0x38')][_0xdbb4('0x47')]){_0x45a105[_0xdbb4('0x48')]=[{'all':!![]}];}return db[_0xdbb4('0x46')]['findAll'](_0x45a105);})[_0xdbb4('0x2d')](function(_0x3d5fce){_0x18e1f3['rows']=_0x3d5fce;return _0x18e1f3;})[_0xdbb4('0x2d')](respondWithFilteredResult(_0x4f6f77,_0x45a105))[_0xdbb4('0x49')](handleError(_0x4f6f77,null));};exports[_0xdbb4('0x4a')]=function(_0x4ab9a5,_0x5af774){var _0x3a6f16={'raw':!![],'where':{'id':_0x4ab9a5[_0xdbb4('0x4b')]['id']}},_0x179be4={};_0x179be4['model']=_[_0xdbb4('0x39')](db[_0xdbb4('0x46')]['rawAttributes']);_0x179be4['query']=_[_0xdbb4('0x39')](_0x4ab9a5[_0xdbb4('0x38')]);_0x179be4[_0xdbb4('0x3a')]=_[_0xdbb4('0x4c')](_0x179be4[_0xdbb4('0x37')],_0x179be4[_0xdbb4('0x38')]);_0x3a6f16[_0xdbb4('0x3b')]=_[_0xdbb4('0x4c')](_0x179be4[_0xdbb4('0x37')],qs['fields'](_0x4ab9a5[_0xdbb4('0x38')][_0xdbb4('0x4d')]));_0x3a6f16[_0xdbb4('0x3b')]=_0x3a6f16[_0xdbb4('0x3b')][_0xdbb4('0x3c')]?_0x3a6f16[_0xdbb4('0x3b')]:_0x179be4[_0xdbb4('0x37')];if(_0x4ab9a5['query'][_0xdbb4('0x47')]){_0x3a6f16[_0xdbb4('0x48')]=[{'all':!![]}];}_0x3a6f16=_[_0xdbb4('0x43')]({},_0x3a6f16,_0x4ab9a5[_0xdbb4('0x45')]);return db[_0xdbb4('0x46')]['find'](_0x3a6f16)[_0xdbb4('0x2d')](handleEntityNotFound(_0x5af774,null))[_0xdbb4('0x2d')](respondWithResult(_0x5af774,null))['catch'](handleError(_0x5af774,null));};exports[_0xdbb4('0x4e')]=function(_0x41c23a,_0x5dec0){return db[_0xdbb4('0x46')][_0xdbb4('0x4e')](_0x41c23a[_0xdbb4('0x4f')],{})[_0xdbb4('0x2d')](function(_0x54a4dc){var _0x5b78ae=_0x41c23a[_0xdbb4('0x50')][_0xdbb4('0x2f')]({'plain':!![]});if(!_0x5b78ae)throw new Error(_0xdbb4('0x51'));if(_0x5b78ae['role']===_0xdbb4('0x50')){var _0x4d0065=_0x54a4dc[_0xdbb4('0x2f')]({'plain':!![]});var _0x28f8a2=_0xdbb4('0x52');return db[_0xdbb4('0x53')][_0xdbb4('0x54')]({'where':{'name':_0x28f8a2,'userProfileId':_0x5b78ae[_0xdbb4('0x55')]},'raw':!![]})[_0xdbb4('0x2d')](function(_0x312e88){if(_0x312e88&&_0x312e88['autoAssociation']===0x0){return db[_0xdbb4('0x56')]['create']({'name':_0x4d0065[_0xdbb4('0x30')],'resourceId':_0x4d0065['id'],'type':_0x312e88[_0xdbb4('0x30')],'sectionId':_0x312e88['id']},{})[_0xdbb4('0x2d')](function(){return _0x54a4dc;});}else{return _0x54a4dc;}})[_0xdbb4('0x49')](function(_0x29aa2f){logger[_0xdbb4('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29aa2f);throw _0x29aa2f;});}return _0x54a4dc;})[_0xdbb4('0x2d')](respondWithResult(_0x5dec0,0xc9))[_0xdbb4('0x49')](handleError(_0x5dec0,null));};exports[_0xdbb4('0x2c')]=function(_0x57675e,_0x27b00f){if(_0x57675e['body']['id']){delete _0x57675e[_0xdbb4('0x4f')]['id'];}return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x57675e[_0xdbb4('0x4b')]['id']}})[_0xdbb4('0x2d')](handleEntityNotFound(_0x27b00f,null))[_0xdbb4('0x2d')](saveUpdates(_0x57675e[_0xdbb4('0x4f')],null))['then'](respondWithResult(_0x27b00f,null))['catch'](handleError(_0x27b00f,null));};exports[_0xdbb4('0x2e')]=function(_0x535160,_0x45e6d1){return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x535160[_0xdbb4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45e6d1,null))['then'](removeEntity(_0x45e6d1,null))[_0xdbb4('0x49')](handleError(_0x45e6d1,null));};exports[_0xdbb4('0x58')]=function(_0x4e3dd3,_0x2e30c8){return db[_0xdbb4('0x46')]['describe']()[_0xdbb4('0x2d')](respondWithResult(_0x2e30c8,null))[_0xdbb4('0x49')](handleError(_0x2e30c8,null));};exports[_0xdbb4('0x59')]=function(_0x238618,_0x43424c,_0x4c3540){var _0x1c6b8e={'raw':!![],'where':{}},_0x2e8b03={},_0x468f51;return db[_0xdbb4('0x46')][_0xdbb4('0x5a')]({'where':{'id':_0x238618['params']['id']}})[_0xdbb4('0x2d')](handleEntityNotFound(_0x43424c,null))[_0xdbb4('0x2d')](function(_0x5ef58d){if(_0x5ef58d){_0x468f51=_0x5ef58d[_0xdbb4('0x2f')]({'plain':!![]});_0x2e8b03['model']=_[_0xdbb4('0x39')](db['UserSmsQueue'][_0xdbb4('0x33')]);_0x2e8b03[_0xdbb4('0x38')]=_[_0xdbb4('0x39')](_0x238618['query']);_0x2e8b03[_0xdbb4('0x3a')]=_[_0xdbb4('0x4c')](_0x2e8b03[_0xdbb4('0x37')],_0x2e8b03[_0xdbb4('0x38')]);_0x1c6b8e['attributes']=_[_0xdbb4('0x4c')](_0x2e8b03[_0xdbb4('0x37')],qs[_0xdbb4('0x4d')](_0x238618[_0xdbb4('0x38')]['fields']));_0x1c6b8e[_0xdbb4('0x3b')]=_0x1c6b8e['attributes'][_0xdbb4('0x3c')]?_0x1c6b8e[_0xdbb4('0x3b')]:_0x2e8b03[_0xdbb4('0x37')];if(!_0x238618['query'][_0xdbb4('0x5b')](_0xdbb4('0x3d'))){_0x1c6b8e[_0xdbb4('0x25')]=qs['limit'](_0x238618[_0xdbb4('0x38')][_0xdbb4('0x25')]);_0x1c6b8e[_0xdbb4('0x23')]=qs[_0xdbb4('0x23')](_0x238618['query']['offset']);}_0x1c6b8e[_0xdbb4('0x3e')]=qs[_0xdbb4('0x3f')](_0x238618['query'][_0xdbb4('0x3f')]);_0x1c6b8e['where']=qs[_0xdbb4('0x3a')](_[_0xdbb4('0x41')](_0x238618[_0xdbb4('0x38')],_0x2e8b03[_0xdbb4('0x3a')]));_0x1c6b8e[_0xdbb4('0x40')]['SmsQueueId']=_0x5ef58d['id'];if(_0x238618[_0xdbb4('0x38')]['filter']){_0x1c6b8e[_0xdbb4('0x40')]=_[_0xdbb4('0x43')](_0x1c6b8e[_0xdbb4('0x40')],{'$or':_[_0xdbb4('0x32')](_0x1c6b8e['attributes'],function(_0x48483e){var _0x20e0d2={};_0x20e0d2[_0x48483e]={'$like':'%'+_0x238618[_0xdbb4('0x38')][_0xdbb4('0x42')]+'%'};return _0x20e0d2;})});}_0x1c6b8e=_['merge']({},_0x1c6b8e,_0x238618[_0xdbb4('0x45')]);return db[_0xdbb4('0x5c')][_0xdbb4('0x5d')](_0x1c6b8e);}})[_0xdbb4('0x2d')](function(_0x15b771){if(_0x15b771){return db[_0xdbb4('0x5e')][_0xdbb4('0x5f')]({'where':{'id':_[_0xdbb4('0x32')](_0x15b771,'UserId'),'role':'agent'},'attributes':['id',_0xdbb4('0x30'),_0xdbb4('0x60'),_0xdbb4('0x61'),_0xdbb4('0x62')]});}})['then'](function(_0x38c6f5){if(_0x38c6f5){return{'count':_0x38c6f5['count'],'rows':_[_0xdbb4('0x32')](_0x38c6f5[_0xdbb4('0x63')],function(_0x278848){return{'membername':_0x278848[_0xdbb4('0x30')],'UserId':_0x278848['id'],'queue_name':_0x468f51[_0xdbb4('0x30')],'SmsQueueId':_0x468f51['id'],'interface':util['format'](_0xdbb4('0x64'),'SIP',_0x278848[_0xdbb4('0x30')]),'penalty':0x0,'paused':_0x278848[_0xdbb4('0x60')],'createdAt':_0x278848[_0xdbb4('0x62')],'updatedAt':_0x278848[_0xdbb4('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdbb4('0x2d')](respondWithFilteredResult(_0x43424c,_0x1c6b8e))[_0xdbb4('0x49')](handleError(_0x43424c,null));};exports['getTeams']=function(_0x96e596,_0x28a969,_0x45a535){var _0x1d53e7={};var _0x5363f0={};var _0x45103d;var _0x4a2b75;return db[_0xdbb4('0x46')]['findOne']({'where':{'id':_0x96e596[_0xdbb4('0x4b')]['id']}})[_0xdbb4('0x2d')](handleEntityNotFound(_0x28a969,null))[_0xdbb4('0x2d')](function(_0x34dbe6){if(_0x34dbe6){_0x45103d=_0x34dbe6;_0x5363f0[_0xdbb4('0x37')]=_[_0xdbb4('0x39')](db[_0xdbb4('0x65')]['rawAttributes']);_0x5363f0[_0xdbb4('0x38')]=_[_0xdbb4('0x39')](_0x96e596['query']);_0x5363f0[_0xdbb4('0x3a')]=_[_0xdbb4('0x4c')](_0x5363f0[_0xdbb4('0x37')],_0x5363f0[_0xdbb4('0x38')]);_0x1d53e7[_0xdbb4('0x3b')]=_['intersection'](_0x5363f0['model'],qs[_0xdbb4('0x4d')](_0x96e596['query'][_0xdbb4('0x4d')]));_0x1d53e7[_0xdbb4('0x3b')]=_0x1d53e7['attributes'][_0xdbb4('0x3c')]?_0x1d53e7[_0xdbb4('0x3b')]:_0x5363f0[_0xdbb4('0x37')];_0x1d53e7[_0xdbb4('0x3e')]=qs['sort'](_0x96e596[_0xdbb4('0x38')][_0xdbb4('0x3f')]);_0x1d53e7[_0xdbb4('0x40')]=qs[_0xdbb4('0x3a')](_['pick'](_0x96e596['query'],_0x5363f0[_0xdbb4('0x3a')]));if(_0x96e596['query']['filter']){_0x1d53e7['where']=_[_0xdbb4('0x43')](_0x1d53e7[_0xdbb4('0x40')],{'$or':_[_0xdbb4('0x32')](_0x1d53e7[_0xdbb4('0x3b')],function(_0xd1304f){var _0x2ac506={};_0x2ac506[_0xd1304f]={'$like':'%'+_0x96e596[_0xdbb4('0x38')][_0xdbb4('0x42')]+'%'};return _0x2ac506;})});}_0x1d53e7=_['merge']({},_0x1d53e7,_0x96e596[_0xdbb4('0x45')]);return _0x45103d[_0xdbb4('0x66')](_0x1d53e7);}})[_0xdbb4('0x2d')](function(_0xaa9cde){if(_0xaa9cde){_0x4a2b75=_0xaa9cde[_0xdbb4('0x3c')];if(!_0x96e596[_0xdbb4('0x38')][_0xdbb4('0x5b')](_0xdbb4('0x3d'))){_0x1d53e7[_0xdbb4('0x25')]=qs[_0xdbb4('0x25')](_0x96e596['query']['limit']);_0x1d53e7['offset']=qs[_0xdbb4('0x23')](_0x96e596[_0xdbb4('0x38')]['offset']);}return _0x45103d[_0xdbb4('0x66')](_0x1d53e7);}})[_0xdbb4('0x2d')](function(_0x5a2e3f){if(_0x5a2e3f){return _0x5a2e3f?{'count':_0x4a2b75,'rows':_0x5a2e3f}:null;}})[_0xdbb4('0x2d')](respondWithResult(_0x28a969,null))[_0xdbb4('0x49')](handleError(_0x28a969,null));};exports['addTeams']=function(_0x4a15d4,_0x2896f2,_0x4b3260){var _0x27bb21=_0x4a15d4[_0xdbb4('0x4f')][_0xdbb4('0x67')];return db['Team']['findAll']({'where':{'id':_0x27bb21},'attributes':['id'],'include':[{'model':db[_0xdbb4('0x5e')],'as':_0xdbb4('0x68'),'attributes':['id','name',_0xdbb4('0x69'),_0xdbb4('0x6a'),_0xdbb4('0x6b')],'raw':!![]}]})[_0xdbb4('0x2d')](function(_0x59601d){if(_0x59601d){var _0x1bdea5=_['flatMap'](_0x59601d,function(_0x48e70f){var _0x2fb9c2=_0x48e70f[_0xdbb4('0x2f')]({'plain':!![]});return _0x2fb9c2['Agents'];});return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x4a15d4[_0xdbb4('0x4b')]['id']}})['then'](function(_0x493cc7){return db[_0xdbb4('0x6c')]['transaction'](function(_0x107f84){return _0x493cc7[_0xdbb4('0x6d')](_0x27bb21,{'transaction':_0x107f84})['then'](function(){return BPromise[_0xdbb4('0x6e')](_0x1bdea5,function(_0x43c899){return db[_0xdbb4('0x5c')][_0xdbb4('0x6f')]({'where':{'UserId':_0x43c899['id'],'SmsQueueId':_0x4a15d4[_0xdbb4('0x4b')]['id']},'transaction':_0x107f84});});})[_0xdbb4('0x2d')](function(){_0x1bdea5[_0xdbb4('0x70')](function(_0x571100){socket[_0xdbb4('0x71')](_0xdbb4('0x72'),{'UserId':_0x571100['id'],'SmsQueueId':_0x493cc7['id']});});});});});}})['then'](respondWithStatusCode(_0x2896f2,null))['catch'](handleError(_0x2896f2,null));};exports['removeTeams']=function(_0x97fbcf,_0x5cdf56,_0x5da2e2){return db['Team'][_0xdbb4('0x5d')]({'where':{'id':_0x97fbcf[_0xdbb4('0x38')][_0xdbb4('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5cdf56,null))['then'](function(_0x535c62){var _0x36b1cc=_[_0xdbb4('0x32')](_0x535c62,'id');var _0x11e5fd=[];var _0x4c92e0=[];var _0x428efb=squel[_0xdbb4('0x73')]();_0x428efb[_0xdbb4('0x74')](_0xdbb4('0x75'))[_0xdbb4('0x76')](_0xdbb4('0x77'),'tq')[_0xdbb4('0x78')](_0xdbb4('0x79'),'ut',_0xdbb4('0x7a'))[_0xdbb4('0x40')](_0xdbb4('0x7b'),_0x97fbcf[_0xdbb4('0x4b')]['id']);for(var _0x3b64bd=0x0;_0x3b64bd<_0x535c62[_0xdbb4('0x3c')];_0x3b64bd+=0x1){let _0x1c8cf1=_0x535c62[_0x3b64bd];for(var _0x268a6b=0x0;_0x268a6b<_0x1c8cf1[_0xdbb4('0x68')]['length'];_0x268a6b+=0x1){let _0x131c0c=_0x1c8cf1[_0xdbb4('0x68')][_0x268a6b];var _0xabe430=_0x428efb[_0xdbb4('0x7c')]();_0xabe430[_0xdbb4('0x40')]('ut.UserId\x20=\x20?',_0x131c0c['id']);_0x4c92e0[_0xdbb4('0x7d')](db['sequelize'][_0xdbb4('0x38')](_0xabe430[_0xdbb4('0x7e')](),{'type':db[_0xdbb4('0x6c')][_0xdbb4('0x7f')][_0xdbb4('0x80')]})[_0xdbb4('0x2d')](function(_0x2b7ad6){if(_0x2b7ad6[_0xdbb4('0x3c')]===0x1){return _0x131c0c['id'];}else{var _0xc5a96d=_[_0xdbb4('0x81')](_['map'](_0x2b7ad6,'TeamId'),function(_0x2d8232){return _[_0xdbb4('0x82')](_0x36b1cc,_0x2d8232);});if(_0xc5a96d){return _0x131c0c['id'];}}}));}}return BPromise['all'](_0x4c92e0)[_0xdbb4('0x2d')](function(_0x349eee){_0x11e5fd=_(_0x11e5fd)[_0xdbb4('0x83')](_0x349eee)[_0xdbb4('0x84')]()[_0xdbb4('0x85')]();return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x97fbcf[_0xdbb4('0x4b')]['id']}})[_0xdbb4('0x2d')](function(_0x308240){return db['sequelize']['transaction'](function(_0x4bdc71){return _0x308240['removeTeams'](_0x97fbcf[_0xdbb4('0x38')][_0xdbb4('0x67')],{'transaction':_0x4bdc71})['then'](function(){if(!_[_0xdbb4('0x86')](_0x11e5fd)){return _0x308240[_0xdbb4('0x87')](_0x11e5fd,{'transaction':_0x4bdc71});}})[_0xdbb4('0x2d')](function(){_0x11e5fd['forEach'](function(_0x4f9fb1){socket[_0xdbb4('0x71')](_0xdbb4('0x88'),{'UserId':_0x4f9fb1,'SmsQueueId':_0x308240['id']});});});});});});})[_0xdbb4('0x2d')](respondWithStatusCode(_0x5cdf56,null))['catch'](handleError(_0x5cdf56,null));};exports[_0xdbb4('0x89')]=function(_0x1399d0,_0x578491,_0x5b1674){return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x1399d0[_0xdbb4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x578491,null))[_0xdbb4('0x2d')](function(_0x543c74){if(_0x543c74){return _0x543c74[_0xdbb4('0x89')](_0x1399d0[_0xdbb4('0x4f')][_0xdbb4('0x67')],_[_0xdbb4('0x8a')](_0x1399d0[_0xdbb4('0x4f')],['ids','id'])||{})[_0xdbb4('0x8b')](function(_0x53e025){for(var _0x3ac192=0x0;_0x3ac192<_0x1399d0[_0xdbb4('0x4f')][_0xdbb4('0x67')][_0xdbb4('0x3c')];_0x3ac192+=0x1){socket[_0xdbb4('0x71')](_0xdbb4('0x72'),{'UserId':Number(_0x1399d0[_0xdbb4('0x4f')][_0xdbb4('0x67')][_0x3ac192]),'SmsQueueId':Number(_0x1399d0[_0xdbb4('0x4b')]['id'])});}return _0x53e025;});}})['then'](respondWithResult(_0x578491,null))[_0xdbb4('0x49')](handleError(_0x578491,null));};exports[_0xdbb4('0x87')]=function(_0x4616f6,_0x411df3,_0x4daeb8){return db[_0xdbb4('0x46')][_0xdbb4('0x54')]({'where':{'id':_0x4616f6[_0xdbb4('0x4b')]['id']}})[_0xdbb4('0x2d')](handleEntityNotFound(_0x411df3,null))[_0xdbb4('0x2d')](function(_0xbc94a2){if(_0xbc94a2){return _0xbc94a2[_0xdbb4('0x87')](_0x4616f6[_0xdbb4('0x38')][_0xdbb4('0x67')])[_0xdbb4('0x2d')](function(){if(_[_0xdbb4('0x8c')](_0x4616f6['query']['ids'])){for(var _0x4602e4=0x0;_0x4602e4<_0x4616f6[_0xdbb4('0x38')][_0xdbb4('0x67')]['length'];_0x4602e4+=0x1){socket[_0xdbb4('0x71')](_0xdbb4('0x88'),{'UserId':Number(_0x4616f6[_0xdbb4('0x38')]['ids'][_0x4602e4]),'SmsQueueId':Number(_0x4616f6['params']['id'])});}}else{socket[_0xdbb4('0x71')]('userSmsQueue:remove',{'UserId':Number(_0x4616f6[_0xdbb4('0x38')][_0xdbb4('0x67')]),'SmsQueueId':Number(_0x4616f6[_0xdbb4('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x411df3,null))['catch'](handleError(_0x411df3,null));};exports['getAgents']=function(_0x5a51f1,_0x297476,_0x51a6a5){var _0x4f81ed={};var _0x29b78f={};var _0x301b39;var _0x1c46be;return db[_0xdbb4('0x46')][_0xdbb4('0x5a')]({'where':{'id':_0x5a51f1[_0xdbb4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x297476,null))[_0xdbb4('0x2d')](function(_0x48ac80){if(_0x48ac80){_0x301b39=_0x48ac80;_0x29b78f[_0xdbb4('0x37')]=_['keys'](db[_0xdbb4('0x5e')][_0xdbb4('0x33')]);_0x29b78f[_0xdbb4('0x38')]=_[_0xdbb4('0x39')](_0x5a51f1[_0xdbb4('0x38')]);_0x29b78f[_0xdbb4('0x3a')]=_[_0xdbb4('0x4c')](_0x29b78f['model'],_0x29b78f[_0xdbb4('0x38')]);_0x4f81ed[_0xdbb4('0x3b')]=_[_0xdbb4('0x4c')](_0x29b78f[_0xdbb4('0x37')],qs['fields'](_0x5a51f1[_0xdbb4('0x38')]['fields']));_0x4f81ed[_0xdbb4('0x3b')]=_0x4f81ed[_0xdbb4('0x3b')][_0xdbb4('0x3c')]?_0x4f81ed[_0xdbb4('0x3b')]:_0x29b78f[_0xdbb4('0x37')];_0x4f81ed[_0xdbb4('0x3e')]=qs[_0xdbb4('0x3f')](_0x5a51f1[_0xdbb4('0x38')][_0xdbb4('0x3f')]);_0x4f81ed[_0xdbb4('0x40')]=qs[_0xdbb4('0x3a')](_[_0xdbb4('0x41')](_0x5a51f1[_0xdbb4('0x38')],_0x29b78f[_0xdbb4('0x3a')]));if(_0x5a51f1[_0xdbb4('0x38')]['filter']){_0x4f81ed['where']=_[_0xdbb4('0x43')](_0x4f81ed[_0xdbb4('0x40')],{'$or':_['map'](_0x4f81ed[_0xdbb4('0x3b')],function(_0xaf1757){var _0x1a2fbd={};_0x1a2fbd[_0xaf1757]={'$like':'%'+_0x5a51f1[_0xdbb4('0x38')][_0xdbb4('0x42')]+'%'};return _0x1a2fbd;})});}_0x4f81ed=_[_0xdbb4('0x43')]({},_0x4f81ed,_0x5a51f1[_0xdbb4('0x45')]);return _0x301b39[_0xdbb4('0x8d')](_0x4f81ed);}})[_0xdbb4('0x2d')](function(_0x99107a){if(_0x99107a){_0x1c46be=_0x99107a[_0xdbb4('0x3c')];if(!_0x5a51f1[_0xdbb4('0x38')]['hasOwnProperty']('nolimit')){_0x4f81ed['limit']=qs[_0xdbb4('0x25')](_0x5a51f1[_0xdbb4('0x38')][_0xdbb4('0x25')]);_0x4f81ed[_0xdbb4('0x23')]=qs[_0xdbb4('0x23')](_0x5a51f1['query'][_0xdbb4('0x23')]);}return _0x301b39['getAgents'](_0x4f81ed);}})['then'](function(_0x49e5ab){if(_0x49e5ab){return _0x49e5ab?{'count':_0x1c46be,'rows':_0x49e5ab}:null;}})[_0xdbb4('0x2d')](respondWithResult(_0x297476,null))['catch'](handleError(_0x297476,null));}; \ No newline at end of file +var _0xdc6f=['count','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','params','keys','attributes','fields','include','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit'];(function(_0x312b37,_0x19f474){var _0x2e5f91=function(_0x19473d){while(--_0x19473d){_0x312b37['push'](_0x312b37['shift']());}};_0x2e5f91(++_0x19f474);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x284b22,_0x1e0f2c){_0x284b22=_0x284b22-0x0;var _0x261e08=_0xdc6f[_0x284b22];return _0x261e08;};'use strict';var emlformat=require(_0xfdc6('0x0'));var rimraf=require(_0xfdc6('0x1'));var zipdir=require(_0xfdc6('0x2'));var jsonpatch=require(_0xfdc6('0x3'));var rp=require(_0xfdc6('0x4'));var moment=require(_0xfdc6('0x5'));var BPromise=require(_0xfdc6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfdc6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdc6('0x8'));var fs=require('fs');var fs_extra=require(_0xfdc6('0x9'));var _=require(_0xfdc6('0xa'));var squel=require('squel');var crypto=require(_0xfdc6('0xb'));var jsforce=require(_0xfdc6('0xc'));var deskjs=require(_0xfdc6('0xd'));var toCsv=require(_0xfdc6('0xe'));var querystring=require(_0xfdc6('0xf'));var Papa=require(_0xfdc6('0x10'));var Redis=require(_0xfdc6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdc6('0x12'));var logger=require(_0xfdc6('0x13'))(_0xfdc6('0x14'));var utils=require(_0xfdc6('0x15'));var config=require(_0xfdc6('0x16'));var licenseUtil=require(_0xfdc6('0x17'));var db=require(_0xfdc6('0x18'))['db'];config[_0xfdc6('0x19')]=_['defaults'](config['redis'],{'host':_0xfdc6('0x1a'),'port':0x18eb});var socket=require(_0xfdc6('0x1b'))(new Redis(config['redis']));require(_0xfdc6('0x1c'))[_0xfdc6('0x1d')](socket);function respondWithStatusCode(_0x1bc93b,_0x108b96){_0x108b96=_0x108b96||0xcc;return function(_0x2d65fa){if(_0x2d65fa){return _0x1bc93b[_0xfdc6('0x1e')](_0x108b96);}return _0x1bc93b['status'](_0x108b96)['end']();};}function respondWithResult(_0x30d29f,_0x54242f){_0x54242f=_0x54242f||0xc8;return function(_0x2d1096){if(_0x2d1096){return _0x30d29f[_0xfdc6('0x1f')](_0x54242f)[_0xfdc6('0x20')](_0x2d1096);}};}function respondWithFilteredResult(_0x27f792,_0x1aab92){return function(_0x8edff2){if(_0x8edff2){var _0x162f4c=typeof _0x1aab92[_0xfdc6('0x21')]===_0xfdc6('0x22')&&typeof _0x1aab92[_0xfdc6('0x23')]===_0xfdc6('0x22');var _0x5162f0=_0x8edff2['count'];var _0x2c153e=_0x162f4c?0x0:_0x1aab92[_0xfdc6('0x21')];var _0x3ee545=_0x162f4c?_0x8edff2[_0xfdc6('0x24')]:_0x1aab92[_0xfdc6('0x21')]+_0x1aab92['limit'];var _0x2c47f9;if(_0x3ee545>=_0x5162f0){_0x3ee545=_0x5162f0;_0x2c47f9=0xc8;}else{_0x2c47f9=0xce;}_0x27f792[_0xfdc6('0x1f')](_0x2c47f9);return _0x27f792['set'](_0xfdc6('0x25'),_0x2c153e+'-'+_0x3ee545+'/'+_0x5162f0)[_0xfdc6('0x20')](_0x8edff2);}return null;};}function patchUpdates(_0xc99016){return function(_0xa3b96){try{jsonpatch[_0xfdc6('0x26')](_0xa3b96,_0xc99016,!![]);}catch(_0x4c0c17){return BPromise[_0xfdc6('0x27')](_0x4c0c17);}return _0xa3b96[_0xfdc6('0x28')]();};}function saveUpdates(_0x8a370d,_0x5e1d9e){return function(_0x2e3144){if(_0x2e3144){return _0x2e3144[_0xfdc6('0x29')](_0x8a370d)[_0xfdc6('0x2a')](function(_0x4af107){return _0x4af107;});}return null;};}function removeEntity(_0x40906b,_0x4854dd){return function(_0x3bc238){if(_0x3bc238){return _0x3bc238[_0xfdc6('0x2b')]()[_0xfdc6('0x2a')](function(){var _0x7c0a84=_0x3bc238[_0xfdc6('0x2c')]({'plain':!![]});var _0x3ed8ac=_0xfdc6('0x2d');return db[_0xfdc6('0x2e')][_0xfdc6('0x2b')]({'where':{'type':_0x3ed8ac,'resourceId':_0x7c0a84['id']}})[_0xfdc6('0x2a')](function(){return _0x3bc238;});})['then'](function(){_0x40906b['status'](0xcc)[_0xfdc6('0x2f')]();});}};}function handleEntityNotFound(_0x4fbfe6,_0x5678e7){return function(_0x381a12){if(!_0x381a12){_0x4fbfe6[_0xfdc6('0x1e')](0x194);}return _0x381a12;};}function handleError(_0x3d87a7,_0x1a099b){_0x1a099b=_0x1a099b||0x1f4;return function(_0x55cdc0){logger[_0xfdc6('0x30')](_0x55cdc0['stack']);if(_0x55cdc0[_0xfdc6('0x31')]){delete _0x55cdc0[_0xfdc6('0x31')];}_0x3d87a7[_0xfdc6('0x1f')](_0x1a099b)[_0xfdc6('0x32')](_0x55cdc0);};}exports[_0xfdc6('0x33')]=function(_0x3171f7,_0x2062cd){var _0x17d5d0={},_0x31bb01={},_0x348559={'count':0x0,'rows':[]};var _0x1f000b=_[_0xfdc6('0x34')](db[_0xfdc6('0x35')][_0xfdc6('0x36')],function(_0x37883c){return{'name':_0x37883c[_0xfdc6('0x37')],'type':_0x37883c[_0xfdc6('0x38')][_0xfdc6('0x39')]};});_0x31bb01[_0xfdc6('0x3a')]=_[_0xfdc6('0x34')](_0x1f000b,_0xfdc6('0x31'));_0x31bb01[_0xfdc6('0x3b')]=_['keys'](_0x3171f7[_0xfdc6('0x3b')]);_0x31bb01[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x31bb01['model'],_0x31bb01[_0xfdc6('0x3b')]);_0x17d5d0['attributes']=_[_0xfdc6('0x3d')](_0x31bb01['model'],qs['fields'](_0x3171f7['query']['fields']));_0x17d5d0['attributes']=_0x17d5d0['attributes'][_0xfdc6('0x3e')]?_0x17d5d0['attributes']:_0x31bb01['model'];if(!_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x17d5d0[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x3171f7['query'][_0xfdc6('0x23')]);_0x17d5d0[_0xfdc6('0x21')]=qs['offset'](_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x21')]);}_0x17d5d0[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x3171f7['query'][_0xfdc6('0x42')]);_0x17d5d0['where']=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x3171f7[_0xfdc6('0x3b')],_0x31bb01['filters']),_0x1f000b);if(_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x17d5d0[_0xfdc6('0x45')]=_['merge'](_0x17d5d0[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x1f000b,function(_0x54cec2){if(_0x54cec2[_0xfdc6('0x38')]!==_0xfdc6('0x46')){var _0x50ae7c={};_0x50ae7c[_0x54cec2['name']]={'$like':'%'+_0x3171f7['query'][_0xfdc6('0x44')]+'%'};return _0x50ae7c;}})});}_0x17d5d0=_[_0xfdc6('0x47')]({},_0x17d5d0,_0x3171f7['options']);var _0x2cc0ae={'where':_0x17d5d0[_0xfdc6('0x45')]};return db[_0xfdc6('0x35')][_0xfdc6('0x24')](_0x2cc0ae)['then'](function(_0x140ece){_0x348559[_0xfdc6('0x24')]=_0x140ece;if(_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x48')]){_0x17d5d0['include']=[{'all':!![]}];}return db['SmsQueue'][_0xfdc6('0x49')](_0x17d5d0);})[_0xfdc6('0x2a')](function(_0x207bac){_0x348559[_0xfdc6('0x4a')]=_0x207bac;return _0x348559;})[_0xfdc6('0x2a')](respondWithFilteredResult(_0x2062cd,_0x17d5d0))['catch'](handleError(_0x2062cd,null));};exports['show']=function(_0x3d84af,_0xd83fb8){var _0x35ac4f={'raw':!![],'where':{'id':_0x3d84af[_0xfdc6('0x4b')]['id']}},_0x151100={};_0x151100[_0xfdc6('0x3a')]=_['keys'](db[_0xfdc6('0x35')][_0xfdc6('0x36')]);_0x151100[_0xfdc6('0x3b')]=_[_0xfdc6('0x4c')](_0x3d84af[_0xfdc6('0x3b')]);_0x151100[_0xfdc6('0x3c')]=_['intersection'](_0x151100[_0xfdc6('0x3a')],_0x151100[_0xfdc6('0x3b')]);_0x35ac4f[_0xfdc6('0x4d')]=_['intersection'](_0x151100[_0xfdc6('0x3a')],qs[_0xfdc6('0x4e')](_0x3d84af[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x35ac4f['attributes']=_0x35ac4f[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x35ac4f[_0xfdc6('0x4d')]:_0x151100[_0xfdc6('0x3a')];if(_0x3d84af[_0xfdc6('0x3b')][_0xfdc6('0x48')]){_0x35ac4f[_0xfdc6('0x4f')]=[{'all':!![]}];}_0x35ac4f=_[_0xfdc6('0x47')]({},_0x35ac4f,_0x3d84af[_0xfdc6('0x50')]);return db['SmsQueue']['find'](_0x35ac4f)[_0xfdc6('0x2a')](handleEntityNotFound(_0xd83fb8,null))[_0xfdc6('0x2a')](respondWithResult(_0xd83fb8,null))[_0xfdc6('0x51')](handleError(_0xd83fb8,null));};exports[_0xfdc6('0x52')]=function(_0x232cca,_0x5b7aca){return db['SmsQueue'][_0xfdc6('0x52')](_0x232cca[_0xfdc6('0x53')],{})[_0xfdc6('0x2a')](function(_0x336c6b){var _0xd80c8a=_0x232cca['user'][_0xfdc6('0x2c')]({'plain':!![]});if(!_0xd80c8a)throw new Error(_0xfdc6('0x54'));if(_0xd80c8a[_0xfdc6('0x55')]==='user'){var _0x442b22=_0x336c6b[_0xfdc6('0x2c')]({'plain':!![]});var _0x342a51='SmsQueues';return db[_0xfdc6('0x56')]['find']({'where':{'name':_0x342a51,'userProfileId':_0xd80c8a[_0xfdc6('0x57')]},'raw':!![]})['then'](function(_0x72960e){if(_0x72960e&&_0x72960e['autoAssociation']===0x0){return db['UserProfileResource'][_0xfdc6('0x52')]({'name':_0x442b22[_0xfdc6('0x31')],'resourceId':_0x442b22['id'],'type':_0x72960e[_0xfdc6('0x31')],'sectionId':_0x72960e['id']},{})[_0xfdc6('0x2a')](function(){return _0x336c6b;});}else{return _0x336c6b;}})[_0xfdc6('0x51')](function(_0x19f566){logger[_0xfdc6('0x30')](_0xfdc6('0x58'),_0x19f566);throw _0x19f566;});}return _0x336c6b;})['then'](respondWithResult(_0x5b7aca,0xc9))['catch'](handleError(_0x5b7aca,null));};exports[_0xfdc6('0x29')]=function(_0x39ce70,_0x348f66){if(_0x39ce70[_0xfdc6('0x53')]['id']){delete _0x39ce70[_0xfdc6('0x53')]['id'];}return db['SmsQueue'][_0xfdc6('0x59')]({'where':{'id':_0x39ce70[_0xfdc6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x348f66,null))[_0xfdc6('0x2a')](saveUpdates(_0x39ce70[_0xfdc6('0x53')],null))['then'](respondWithResult(_0x348f66,null))[_0xfdc6('0x51')](handleError(_0x348f66,null));};exports[_0xfdc6('0x2b')]=function(_0x37dcbf,_0x4efa35){return db[_0xfdc6('0x35')][_0xfdc6('0x59')]({'where':{'id':_0x37dcbf[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x4efa35,null))[_0xfdc6('0x2a')](removeEntity(_0x4efa35,null))[_0xfdc6('0x51')](handleError(_0x4efa35,null));};exports['describe']=function(_0x426524,_0x4b4817){return db[_0xfdc6('0x35')][_0xfdc6('0x5a')]()[_0xfdc6('0x2a')](respondWithResult(_0x4b4817,null))['catch'](handleError(_0x4b4817,null));};exports[_0xfdc6('0x5b')]=function(_0x549236,_0x3279b5,_0x5701ba){var _0x299d7a={'raw':!![],'where':{}},_0x4744d1={},_0x3524cc;return db[_0xfdc6('0x35')][_0xfdc6('0x5c')]({'where':{'id':_0x549236[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3279b5,null))[_0xfdc6('0x2a')](function(_0x5480f2){if(_0x5480f2){_0x3524cc=_0x5480f2[_0xfdc6('0x2c')]({'plain':!![]});_0x4744d1[_0xfdc6('0x3a')]=_[_0xfdc6('0x4c')](db[_0xfdc6('0x5d')][_0xfdc6('0x36')]);_0x4744d1[_0xfdc6('0x3b')]=_[_0xfdc6('0x4c')](_0x549236['query']);_0x4744d1[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x4744d1[_0xfdc6('0x3a')],_0x4744d1[_0xfdc6('0x3b')]);_0x299d7a[_0xfdc6('0x4d')]=_['intersection'](_0x4744d1[_0xfdc6('0x3a')],qs[_0xfdc6('0x4e')](_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x299d7a[_0xfdc6('0x4d')]=_0x299d7a['attributes'][_0xfdc6('0x3e')]?_0x299d7a[_0xfdc6('0x4d')]:_0x4744d1[_0xfdc6('0x3a')];if(!_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x299d7a[_0xfdc6('0x23')]=qs['limit'](_0x549236['query'][_0xfdc6('0x23')]);_0x299d7a[_0xfdc6('0x21')]=qs['offset'](_0x549236['query'][_0xfdc6('0x21')]);}_0x299d7a['order']=qs[_0xfdc6('0x42')](_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x299d7a['where']=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x549236[_0xfdc6('0x3b')],_0x4744d1[_0xfdc6('0x3c')]));_0x299d7a[_0xfdc6('0x45')][_0xfdc6('0x5e')]=_0x5480f2['id'];if(_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x299d7a[_0xfdc6('0x45')]=_[_0xfdc6('0x47')](_0x299d7a['where'],{'$or':_['map'](_0x299d7a[_0xfdc6('0x4d')],function(_0x25630f){var _0x178e07={};_0x178e07[_0x25630f]={'$like':'%'+_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x44')]+'%'};return _0x178e07;})});}_0x299d7a=_[_0xfdc6('0x47')]({},_0x299d7a,_0x549236[_0xfdc6('0x50')]);return db[_0xfdc6('0x5d')][_0xfdc6('0x49')](_0x299d7a);}})[_0xfdc6('0x2a')](function(_0x483952){if(_0x483952){return db[_0xfdc6('0x5f')][_0xfdc6('0x60')]({'where':{'id':_[_0xfdc6('0x34')](_0x483952,_0xfdc6('0x61')),'role':'agent'},'attributes':['id',_0xfdc6('0x31'),_0xfdc6('0x62'),'updatedAt',_0xfdc6('0x63')]});}})[_0xfdc6('0x2a')](function(_0x44742b){if(_0x44742b){return{'count':_0x44742b[_0xfdc6('0x24')],'rows':_['map'](_0x44742b[_0xfdc6('0x4a')],function(_0x197cf0){return{'membername':_0x197cf0[_0xfdc6('0x31')],'UserId':_0x197cf0['id'],'queue_name':_0x3524cc[_0xfdc6('0x31')],'SmsQueueId':_0x3524cc['id'],'interface':util['format'](_0xfdc6('0x64'),_0xfdc6('0x65'),_0x197cf0[_0xfdc6('0x31')]),'penalty':0x0,'paused':_0x197cf0[_0xfdc6('0x62')],'createdAt':_0x197cf0[_0xfdc6('0x63')],'updatedAt':_0x197cf0[_0xfdc6('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfdc6('0x2a')](respondWithFilteredResult(_0x3279b5,_0x299d7a))[_0xfdc6('0x51')](handleError(_0x3279b5,null));};exports[_0xfdc6('0x67')]=function(_0x233676,_0x57fe20,_0x11528d){var _0x44e188={};var _0x1199a0={};var _0x40ac51;var _0x2ee02a;return db[_0xfdc6('0x35')]['findOne']({'where':{'id':_0x233676[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x57fe20,null))[_0xfdc6('0x2a')](function(_0x44dc7f){if(_0x44dc7f){_0x40ac51=_0x44dc7f;_0x1199a0['model']=_[_0xfdc6('0x4c')](db[_0xfdc6('0x68')]['rawAttributes']);_0x1199a0['query']=_[_0xfdc6('0x4c')](_0x233676[_0xfdc6('0x3b')]);_0x1199a0[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x1199a0['model'],_0x1199a0['query']);_0x44e188[_0xfdc6('0x4d')]=_[_0xfdc6('0x3d')](_0x1199a0[_0xfdc6('0x3a')],qs['fields'](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x44e188['attributes']=_0x44e188[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x44e188[_0xfdc6('0x4d')]:_0x1199a0[_0xfdc6('0x3a')];_0x44e188[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x44e188['where']=qs['filters'](_['pick'](_0x233676[_0xfdc6('0x3b')],_0x1199a0['filters']));if(_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x44e188[_0xfdc6('0x45')]=_[_0xfdc6('0x47')](_0x44e188[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x44e188[_0xfdc6('0x4d')],function(_0xe696c7){var _0x94ca1a={};_0x94ca1a[_0xe696c7]={'$like':'%'+_0x233676[_0xfdc6('0x3b')]['filter']+'%'};return _0x94ca1a;})});}_0x44e188=_[_0xfdc6('0x47')]({},_0x44e188,_0x233676['options']);return _0x40ac51[_0xfdc6('0x67')](_0x44e188);}})[_0xfdc6('0x2a')](function(_0x501484){if(_0x501484){_0x2ee02a=_0x501484[_0xfdc6('0x3e')];if(!_0x233676['query'][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x44e188[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x23')]);_0x44e188[_0xfdc6('0x21')]=qs[_0xfdc6('0x21')](_0x233676[_0xfdc6('0x3b')]['offset']);}return _0x40ac51[_0xfdc6('0x67')](_0x44e188);}})[_0xfdc6('0x2a')](function(_0x257ea7){if(_0x257ea7){return _0x257ea7?{'count':_0x2ee02a,'rows':_0x257ea7}:null;}})[_0xfdc6('0x2a')](respondWithResult(_0x57fe20,null))[_0xfdc6('0x51')](handleError(_0x57fe20,null));};exports[_0xfdc6('0x69')]=function(_0x3afb42,_0x4e73ea,_0x32d17d){var _0x37d7af=_0x3afb42['body'][_0xfdc6('0x6a')];return db[_0xfdc6('0x68')][_0xfdc6('0x49')]({'where':{'id':_0x37d7af},'attributes':['id'],'include':[{'model':db[_0xfdc6('0x5f')],'as':_0xfdc6('0x6b'),'attributes':['id','name',_0xfdc6('0x6c'),_0xfdc6('0x6d'),'interface'],'raw':!![]}]})[_0xfdc6('0x2a')](function(_0x3a20e0){if(_0x3a20e0){var _0x597b67=_[_0xfdc6('0x6e')](_0x3a20e0,function(_0x558e37){var _0x5f52d4=_0x558e37['get']({'plain':!![]});return _0x5f52d4['Agents'];});return db['SmsQueue'][_0xfdc6('0x59')]({'where':{'id':_0x3afb42[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](function(_0x570b46){return db[_0xfdc6('0x6f')]['transaction'](function(_0x1a4992){return _0x570b46[_0xfdc6('0x69')](_0x37d7af,{'transaction':_0x1a4992})[_0xfdc6('0x2a')](function(){return BPromise[_0xfdc6('0x70')](_0x597b67,function(_0x3c94be){return db[_0xfdc6('0x5d')][_0xfdc6('0x71')]({'where':{'UserId':_0x3c94be['id'],'SmsQueueId':_0x3afb42[_0xfdc6('0x4b')]['id']},'transaction':_0x1a4992});});})['then'](function(){_0x597b67['forEach'](function(_0x3ee182){socket[_0xfdc6('0x72')](_0xfdc6('0x73'),{'UserId':_0x3ee182['id'],'SmsQueueId':_0x570b46['id']});});});});});}})[_0xfdc6('0x2a')](respondWithStatusCode(_0x4e73ea,null))[_0xfdc6('0x51')](handleError(_0x4e73ea,null));};exports['removeTeams']=function(_0x4421b2,_0x3d29a9,_0xb6cdb7){return db['Team'][_0xfdc6('0x49')]({'where':{'id':_0x4421b2[_0xfdc6('0x3b')][_0xfdc6('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xfdc6('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3d29a9,null))[_0xfdc6('0x2a')](function(_0x4cca4d){var _0x299f59=_['map'](_0x4cca4d,'id');var _0x32799e=[];var _0x1ce533=[];var _0x527ef2=squel[_0xfdc6('0x74')]();_0x527ef2[_0xfdc6('0x75')](_0xfdc6('0x76'))[_0xfdc6('0x77')](_0xfdc6('0x78'),'tq')[_0xfdc6('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfdc6('0x45')](_0xfdc6('0x7a'),_0x4421b2['params']['id']);for(var _0x1241cd=0x0;_0x1241cd<_0x4cca4d[_0xfdc6('0x3e')];_0x1241cd+=0x1){let _0x2ccfc1=_0x4cca4d[_0x1241cd];for(var _0x3cbda7=0x0;_0x3cbda7<_0x2ccfc1['Agents'][_0xfdc6('0x3e')];_0x3cbda7+=0x1){let _0x5cc301=_0x2ccfc1[_0xfdc6('0x6b')][_0x3cbda7];var _0x6fbfde=_0x527ef2[_0xfdc6('0x7b')]();_0x6fbfde['where'](_0xfdc6('0x7c'),_0x5cc301['id']);_0x1ce533[_0xfdc6('0x7d')](db[_0xfdc6('0x6f')][_0xfdc6('0x3b')](_0x6fbfde[_0xfdc6('0x7e')](),{'type':db['sequelize'][_0xfdc6('0x7f')][_0xfdc6('0x80')]})['then'](function(_0x1750a6){if(_0x1750a6[_0xfdc6('0x3e')]===0x1){return _0x5cc301['id'];}else{var _0x337dcb=_['every'](_['map'](_0x1750a6,_0xfdc6('0x81')),function(_0x9d5f55){return _[_0xfdc6('0x82')](_0x299f59,_0x9d5f55);});if(_0x337dcb){return _0x5cc301['id'];}}}));}}return BPromise[_0xfdc6('0x83')](_0x1ce533)['then'](function(_0x447295){_0x32799e=_(_0x32799e)[_0xfdc6('0x84')](_0x447295)[_0xfdc6('0x85')]()[_0xfdc6('0x86')]();return db[_0xfdc6('0x35')]['find']({'where':{'id':_0x4421b2[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](function(_0x14a93b){return db[_0xfdc6('0x6f')]['transaction'](function(_0x50387f){return _0x14a93b[_0xfdc6('0x87')](_0x4421b2[_0xfdc6('0x3b')][_0xfdc6('0x6a')],{'transaction':_0x50387f})[_0xfdc6('0x2a')](function(){if(!_[_0xfdc6('0x88')](_0x32799e)){return _0x14a93b['removeAgents'](_0x32799e,{'transaction':_0x50387f});}})[_0xfdc6('0x2a')](function(){_0x32799e[_0xfdc6('0x89')](function(_0x17e58c){socket['emit'](_0xfdc6('0x8a'),{'UserId':_0x17e58c,'SmsQueueId':_0x14a93b['id']});});});});});});})[_0xfdc6('0x2a')](respondWithStatusCode(_0x3d29a9,null))[_0xfdc6('0x51')](handleError(_0x3d29a9,null));};exports[_0xfdc6('0x8b')]=function(_0x78d41e,_0x3534e7,_0x2b68db){return db[_0xfdc6('0x35')]['find']({'where':{'id':_0x78d41e[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3534e7,null))[_0xfdc6('0x2a')](function(_0x3eafa0){if(_0x3eafa0){return _0x3eafa0[_0xfdc6('0x8b')](_0x78d41e[_0xfdc6('0x53')][_0xfdc6('0x6a')],_[_0xfdc6('0x8c')](_0x78d41e[_0xfdc6('0x53')],[_0xfdc6('0x6a'),'id'])||{})[_0xfdc6('0x8d')](function(_0x57e24b){for(var _0xed3c5f=0x0;_0xed3c5f<_0x78d41e[_0xfdc6('0x53')][_0xfdc6('0x6a')][_0xfdc6('0x3e')];_0xed3c5f+=0x1){socket['emit'](_0xfdc6('0x73'),{'UserId':Number(_0x78d41e['body'][_0xfdc6('0x6a')][_0xed3c5f]),'SmsQueueId':Number(_0x78d41e[_0xfdc6('0x4b')]['id'])});}return _0x57e24b;});}})['then'](respondWithResult(_0x3534e7,null))[_0xfdc6('0x51')](handleError(_0x3534e7,null));};exports[_0xfdc6('0x8e')]=function(_0x5b23ef,_0x46a275,_0x3bb3e2){return db[_0xfdc6('0x35')][_0xfdc6('0x59')]({'where':{'id':_0x5b23ef[_0xfdc6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46a275,null))[_0xfdc6('0x2a')](function(_0xe008f6){if(_0xe008f6){return _0xe008f6['removeAgents'](_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')])[_0xfdc6('0x2a')](function(){if(_[_0xfdc6('0x8f')](_0x5b23ef[_0xfdc6('0x3b')]['ids'])){for(var _0x4da025=0x0;_0x4da025<_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')][_0xfdc6('0x3e')];_0x4da025+=0x1){socket[_0xfdc6('0x72')](_0xfdc6('0x8a'),{'UserId':Number(_0x5b23ef['query']['ids'][_0x4da025]),'SmsQueueId':Number(_0x5b23ef['params']['id'])});}}else{socket['emit'](_0xfdc6('0x8a'),{'UserId':Number(_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')]),'SmsQueueId':Number(_0x5b23ef[_0xfdc6('0x4b')]['id'])});}});}})[_0xfdc6('0x2a')](respondWithStatusCode(_0x46a275,null))[_0xfdc6('0x51')](handleError(_0x46a275,null));};exports['getAgents']=function(_0x3662c3,_0x4e86ac,_0xf7b1a8){var _0x2566c3={};var _0xa50260={};var _0x4bddae;var _0x1aa670;return db[_0xfdc6('0x35')][_0xfdc6('0x5c')]({'where':{'id':_0x3662c3['params']['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x4e86ac,null))[_0xfdc6('0x2a')](function(_0x30b29c){if(_0x30b29c){_0x4bddae=_0x30b29c;_0xa50260[_0xfdc6('0x3a')]=_[_0xfdc6('0x4c')](db[_0xfdc6('0x5f')][_0xfdc6('0x36')]);_0xa50260['query']=_[_0xfdc6('0x4c')](_0x3662c3['query']);_0xa50260[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0xa50260[_0xfdc6('0x3a')],_0xa50260[_0xfdc6('0x3b')]);_0x2566c3[_0xfdc6('0x4d')]=_[_0xfdc6('0x3d')](_0xa50260['model'],qs[_0xfdc6('0x4e')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x2566c3[_0xfdc6('0x4d')]=_0x2566c3[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x2566c3[_0xfdc6('0x4d')]:_0xa50260['model'];_0x2566c3[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x2566c3[_0xfdc6('0x45')]=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x3662c3[_0xfdc6('0x3b')],_0xa50260['filters']));if(_0x3662c3['query']['filter']){_0x2566c3['where']=_[_0xfdc6('0x47')](_0x2566c3[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x2566c3[_0xfdc6('0x4d')],function(_0x28e25b){var _0x21f20e={};_0x21f20e[_0x28e25b]={'$like':'%'+_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x44')]+'%'};return _0x21f20e;})});}_0x2566c3=_['merge']({},_0x2566c3,_0x3662c3['options']);return _0x4bddae[_0xfdc6('0x90')](_0x2566c3);}})['then'](function(_0x180aab){if(_0x180aab){_0x1aa670=_0x180aab['length'];if(!_0x3662c3[_0xfdc6('0x3b')]['hasOwnProperty'](_0xfdc6('0x40'))){_0x2566c3[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x23')]);_0x2566c3[_0xfdc6('0x21')]=qs[_0xfdc6('0x21')](_0x3662c3['query'][_0xfdc6('0x21')]);}return _0x4bddae[_0xfdc6('0x90')](_0x2566c3);}})[_0xfdc6('0x2a')](function(_0x4a1360){if(_0x4a1360){return _0x4a1360?{'count':_0x1aa670,'rows':_0x4a1360}:null;}})[_0xfdc6('0x2a')](respondWithResult(_0x4e86ac,null))[_0xfdc6('0x51')](handleError(_0x4e86ac,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 6b0440d..abb879b 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 _0x7b59=['save','update','remove','emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x17d229,_0x265a8f){var _0x2318da=function(_0x4a9fd5){while(--_0x4a9fd5){_0x17d229['push'](_0x17d229['shift']());}};_0x2318da(++_0x265a8f);}(_0x7b59,0xb0));var _0x97b5=function(_0x4193ef,_0x1df925){_0x4193ef=_0x4193ef-0x0;var _0x1aab60=_0x7b59[_0x4193ef];return _0x1aab60;};'use strict';var EventEmitter=require(_0x97b5('0x0'));var SmsQueue=require(_0x97b5('0x1'))['db'][_0x97b5('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x97b5('0x3')](0x0);var events={'afterCreate':_0x97b5('0x4'),'afterUpdate':_0x97b5('0x5'),'afterDestroy':_0x97b5('0x6')};function emitEvent(_0x32bf61){return function(_0x73e584,_0x588b6f,_0x59f88e){SmsQueueEvents[_0x97b5('0x7')](_0x32bf61+':'+_0x73e584['id'],_0x73e584);SmsQueueEvents['emit'](_0x32bf61,_0x73e584);_0x59f88e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x97b5('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x707d=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x1732a4,_0x596d24){var _0x4687de=function(_0x363e01){while(--_0x363e01){_0x1732a4['push'](_0x1732a4['shift']());}};_0x4687de(++_0x596d24);}(_0x707d,0xfa));var _0xd707=function(_0x2ba59f,_0x529f75){_0x2ba59f=_0x2ba59f-0x0;var _0x18a3d7=_0x707d[_0x2ba59f];return _0x18a3d7;};'use strict';var EventEmitter=require(_0xd707('0x0'));var SmsQueue=require(_0xd707('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd707('0x2')](0x0);var events={'afterCreate':_0xd707('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x406eac){return function(_0x21a030,_0x2e11ca,_0x38f26c){SmsQueueEvents[_0xd707('0x4')](_0x406eac+':'+_0x21a030['id'],_0x21a030);SmsQueueEvents[_0xd707('0x4')](_0x406eac,_0x21a030);_0x38f26c(null);};}for(var e in events){if(events[_0xd707('0x5')](e)){var event=events[e];SmsQueue[_0xd707('0x6')](e,emitEvent(event));}}module[_0xd707('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 6142e22..7f31f27 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 _0xc589=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','sms_queues'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc589,0xd2));var _0x9c58=function(_0x1254d9,_0x48a6eb){_0x1254d9=_0x1254d9-0x0;var _0x51e934=_0xc589[_0x1254d9];return _0x51e934;};'use strict';var _=require(_0x9c58('0x0'));var util=require(_0x9c58('0x1'));var logger=require(_0x9c58('0x2'))(_0x9c58('0x3'));var moment=require('moment');var BPromise=require(_0x9c58('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c58('0x5'));var rimraf=require(_0x9c58('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x9c58('0x7')]=function(_0x53e168,_0x1aa0b5){return _0x53e168[_0x9c58('0x8')]('SmsQueue',attributes,{'tableName':_0x9c58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ab9=['sms_queues','lodash','../../config/logger','api','moment','bluebird','exports','define','SmsQueue'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x2ab9,0x64));var _0x92ab=function(_0x53cb13,_0x250d12){_0x53cb13=_0x53cb13-0x0;var _0x2c08ca=_0x2ab9[_0x53cb13];return _0x2c08ca;};'use strict';var _=require(_0x92ab('0x0'));var util=require('util');var logger=require(_0x92ab('0x1'))(_0x92ab('0x2'));var moment=require(_0x92ab('0x3'));var BPromise=require(_0x92ab('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('./smsQueue.attributes');module[_0x92ab('0x5')]=function(_0x1c2a15,_0x76b54f){return _0x1c2a15[_0x92ab('0x6')](_0x92ab('0x7'),attributes,{'tableName':_0x92ab('0x8'),'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 4e0d9fb..f0cfc2e 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 _0x2c38=['GetSmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowSmsQueue','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x40c091,_0x223f24){var _0x51ff31=function(_0x320bdd){while(--_0x320bdd){_0x40c091['push'](_0x40c091['shift']());}};_0x51ff31(++_0x223f24);}(_0x2c38,0x146));var _0x82c3=function(_0x603220,_0x3428a9){_0x603220=_0x603220-0x0;var _0x135f2e=_0x2c38[_0x603220];return _0x135f2e;};'use strict';var _=require(_0x82c3('0x0'));var util=require(_0x82c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x82c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82c3('0x3'))['db'];var utils=require(_0x82c3('0x4'));var logger=require('../../config/logger')(_0x82c3('0x5'));var config=require(_0x82c3('0x6'));var jayson=require(_0x82c3('0x7'));var client=jayson['client'][_0x82c3('0x8')]({'port':0x232a});config[_0x82c3('0x9')]=_['defaults'](config[_0x82c3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x82c3('0xa'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x82c3('0xb')](socket);function respondWithRpcPromise(_0xfeb67b,_0x104cff,_0x1d110f){return new BPromise(function(_0x1fc3b7,_0x247ac3){return client[_0x82c3('0xc')](_0xfeb67b,_0x1d110f)[_0x82c3('0xd')](function(_0x542238){logger[_0x82c3('0xe')]('SmsQueue,\x20%s,\x20%s',_0x104cff,'request\x20sent');logger[_0x82c3('0xf')](_0x82c3('0x10'),_0x104cff,_0x82c3('0x11'),JSON[_0x82c3('0x12')](_0x542238));if(_0x542238[_0x82c3('0x13')]){if(_0x542238[_0x82c3('0x13')]['code']===0x1f4){logger[_0x82c3('0x13')](_0x82c3('0x14'),_0x104cff,_0x542238[_0x82c3('0x13')][_0x82c3('0x15')]);return _0x247ac3(_0x542238[_0x82c3('0x13')][_0x82c3('0x15')]);}logger['error'](_0x82c3('0x14'),_0x104cff,_0x542238['error'][_0x82c3('0x15')]);return _0x1fc3b7(_0x542238[_0x82c3('0x13')][_0x82c3('0x15')]);}else{logger['info'](_0x82c3('0x14'),_0x104cff,_0x82c3('0x11'));_0x1fc3b7(_0x542238[_0x82c3('0x16')]['message']);}})[_0x82c3('0x17')](function(_0x47048d){logger['error']('SmsQueue,\x20%s,\x20%s',_0x104cff,_0x47048d);_0x247ac3(_0x47048d);});});}exports[_0x82c3('0x18')]=function(_0x16dfaf){var _0x3da85d=this;return new Promise(function(_0x8960c7,_0x3bd7e9){return db['SmsQueue'][_0x82c3('0x19')]({'raw':_0x16dfaf[_0x82c3('0x1a')]?_0x16dfaf[_0x82c3('0x1a')][_0x82c3('0x1b')]===undefined?!![]:![]:!![],'where':_0x16dfaf['options']?_0x16dfaf[_0x82c3('0x1a')][_0x82c3('0x1c')]||null:null,'attributes':_0x16dfaf[_0x82c3('0x1a')]?_0x16dfaf[_0x82c3('0x1a')]['attributes']||null:null,'limit':_0x16dfaf[_0x82c3('0x1a')]?_0x16dfaf[_0x82c3('0x1a')][_0x82c3('0x1d')]||null:null,'include':_0x16dfaf[_0x82c3('0x1a')]?_0x16dfaf['options'][_0x82c3('0x1e')]?_[_0x82c3('0x1f')](_0x16dfaf['options']['include'],function(_0x5ef2ce){return{'model':db[_0x5ef2ce[_0x82c3('0x20')]],'as':_0x5ef2ce['as'],'attributes':_0x5ef2ce[_0x82c3('0x21')],'include':_0x5ef2ce[_0x82c3('0x1e')]?_[_0x82c3('0x1f')](_0x5ef2ce['include'],function(_0x1e6996){return{'model':db[_0x1e6996[_0x82c3('0x20')]],'as':_0x1e6996['as'],'attributes':_0x1e6996[_0x82c3('0x21')],'include':_0x1e6996[_0x82c3('0x1e')]?_['map'](_0x1e6996['include'],function(_0xf1b25){return{'model':db[_0xf1b25[_0x82c3('0x20')]],'as':_0xf1b25['as'],'attributes':_0xf1b25['attributes']};}):[]};}):[]};}):[]:[]})[_0x82c3('0xd')](function(_0x4cc6b4){logger['info'](_0x82c3('0x18'),_0x16dfaf);logger['debug']('GetSmsQueue',_0x16dfaf,JSON[_0x82c3('0x12')](_0x4cc6b4));_0x8960c7(_0x4cc6b4);})[_0x82c3('0x17')](function(_0x35c890){logger[_0x82c3('0x13')](_0x82c3('0x18'),_0x35c890[_0x82c3('0x15')],_0x16dfaf);_0x3bd7e9(_0x3da85d[_0x82c3('0x13')](0x1f4,_0x35c890[_0x82c3('0x15')]));});});};exports[_0x82c3('0x22')]=function(_0x276ccb){var _0x1d456e=this;return new Promise(function(_0x59d18f,_0x1376eb){return db['SmsQueue']['find']({'raw':_0x276ccb[_0x82c3('0x1a')]?_0x276ccb[_0x82c3('0x1a')][_0x82c3('0x1b')]===undefined?!![]:![]:!![],'where':_0x276ccb[_0x82c3('0x1a')]?_0x276ccb[_0x82c3('0x1a')][_0x82c3('0x1c')]||null:null,'attributes':_0x276ccb[_0x82c3('0x1a')]?_0x276ccb[_0x82c3('0x1a')][_0x82c3('0x21')]||null:null,'include':_0x276ccb['options']?_0x276ccb[_0x82c3('0x1a')]['include']?_['map'](_0x276ccb['options'][_0x82c3('0x1e')],function(_0x2ce0e9){return{'model':db[_0x2ce0e9['model']],'as':_0x2ce0e9['as'],'attributes':_0x2ce0e9[_0x82c3('0x21')],'include':_0x2ce0e9[_0x82c3('0x1e')]?_[_0x82c3('0x1f')](_0x2ce0e9[_0x82c3('0x1e')],function(_0x16418f){return{'model':db[_0x16418f[_0x82c3('0x20')]],'as':_0x16418f['as'],'attributes':_0x16418f[_0x82c3('0x21')],'include':_0x16418f[_0x82c3('0x1e')]?_[_0x82c3('0x1f')](_0x16418f['include'],function(_0x54f0da){return{'model':db[_0x54f0da['model']],'as':_0x54f0da['as'],'attributes':_0x54f0da[_0x82c3('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f47c4){logger[_0x82c3('0xe')](_0x82c3('0x22'),_0x276ccb);logger[_0x82c3('0xf')]('ShowSmsQueue',_0x276ccb,JSON[_0x82c3('0x12')](_0x1f47c4));_0x59d18f(_0x1f47c4);})[_0x82c3('0x17')](function(_0x187160){logger[_0x82c3('0x13')](_0x82c3('0x22'),_0x187160[_0x82c3('0x15')],_0x276ccb);_0x1376eb(_0x1d456e[_0x82c3('0x13')](0x1f4,_0x187160['message']));});});}; \ No newline at end of file +var _0xc404=['message','result','GetSmsQueue','findAll','options','attributes','limit','include','map','model','raw','where','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a7521,_0x2d1d5e){var _0x3d6e6a=function(_0x1ea2b8){while(--_0x1ea2b8){_0x5a7521['push'](_0x5a7521['shift']());}};_0x3d6e6a(++_0x2d1d5e);}(_0xc404,0x1ee));var _0x4c40=function(_0x1dceff,_0x2737f6){_0x1dceff=_0x1dceff-0x0;var _0x4057da=_0xc404[_0x1dceff];return _0x4057da;};'use strict';var _=require(_0x4c40('0x0'));var util=require(_0x4c40('0x1'));var moment=require(_0x4c40('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c40('0x3'));var fs=require('fs');var Redis=require(_0x4c40('0x4'));var db=require(_0x4c40('0x5'))['db'];var utils=require(_0x4c40('0x6'));var logger=require(_0x4c40('0x7'))(_0x4c40('0x8'));var config=require(_0x4c40('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c40('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4c40('0xb')](config[_0x4c40('0xc')],{'host':_0x4c40('0xd'),'port':0x18eb});var socket=require(_0x4c40('0xe'))(new Redis(config[_0x4c40('0xc')]));require(_0x4c40('0xf'))['register'](socket);function respondWithRpcPromise(_0x113aa9,_0x361340,_0x7866a8){return new BPromise(function(_0x162bc4,_0x42ab74){return client['request'](_0x113aa9,_0x7866a8)[_0x4c40('0x10')](function(_0x30f8e5){logger[_0x4c40('0x11')](_0x4c40('0x12'),_0x361340,_0x4c40('0x13'));logger[_0x4c40('0x14')](_0x4c40('0x15'),_0x361340,_0x4c40('0x13'),JSON[_0x4c40('0x16')](_0x30f8e5));if(_0x30f8e5['error']){if(_0x30f8e5[_0x4c40('0x17')]['code']===0x1f4){logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x30f8e5['error'][_0x4c40('0x18')]);return _0x42ab74(_0x30f8e5[_0x4c40('0x17')][_0x4c40('0x18')]);}logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x30f8e5[_0x4c40('0x17')]['message']);return _0x162bc4(_0x30f8e5[_0x4c40('0x17')][_0x4c40('0x18')]);}else{logger[_0x4c40('0x11')](_0x4c40('0x12'),_0x361340,_0x4c40('0x13'));_0x162bc4(_0x30f8e5[_0x4c40('0x19')][_0x4c40('0x18')]);}})['catch'](function(_0x3af627){logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x3af627);_0x42ab74(_0x3af627);});});}exports[_0x4c40('0x1a')]=function(_0x29188b){var _0x1cd22b=this;return new Promise(function(_0x58aef4,_0x5097ec){return db['SmsQueue'][_0x4c40('0x1b')]({'raw':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')]['where']||null:null,'attributes':_0x29188b[_0x4c40('0x1c')]?_0x29188b['options'][_0x4c40('0x1d')]||null:null,'limit':_0x29188b['options']?_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1e')]||null:null,'include':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1f')],function(_0x4e0b73){return{'model':db[_0x4e0b73[_0x4c40('0x21')]],'as':_0x4e0b73['as'],'attributes':_0x4e0b73['attributes'],'include':_0x4e0b73[_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x4e0b73[_0x4c40('0x1f')],function(_0x46b095){return{'model':db[_0x46b095[_0x4c40('0x21')]],'as':_0x46b095['as'],'attributes':_0x46b095[_0x4c40('0x1d')],'include':_0x46b095['include']?_['map'](_0x46b095[_0x4c40('0x1f')],function(_0xf86af2){return{'model':db[_0xf86af2[_0x4c40('0x21')]],'as':_0xf86af2['as'],'attributes':_0xf86af2[_0x4c40('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a9f9){logger['info'](_0x4c40('0x1a'),_0x29188b);logger[_0x4c40('0x14')](_0x4c40('0x1a'),_0x29188b,JSON[_0x4c40('0x16')](_0x19a9f9));_0x58aef4(_0x19a9f9);})['catch'](function(_0x3fc1d5){logger[_0x4c40('0x17')](_0x4c40('0x1a'),_0x3fc1d5[_0x4c40('0x18')],_0x29188b);_0x5097ec(_0x1cd22b[_0x4c40('0x17')](0x1f4,_0x3fc1d5[_0x4c40('0x18')]));});});};exports['ShowSmsQueue']=function(_0x3e54c4){var _0x862b01=this;return new Promise(function(_0x25f049,_0x6220d9){return db['SmsQueue']['find']({'raw':_0x3e54c4['options']?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x22')]===undefined?!![]:![]:!![],'where':_0x3e54c4[_0x4c40('0x1c')]?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x23')]||null:null,'attributes':_0x3e54c4[_0x4c40('0x1c')]?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1d')]||null:null,'include':_0x3e54c4['options']?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1f')],function(_0x2ab95f){return{'model':db[_0x2ab95f[_0x4c40('0x21')]],'as':_0x2ab95f['as'],'attributes':_0x2ab95f[_0x4c40('0x1d')],'include':_0x2ab95f[_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x2ab95f[_0x4c40('0x1f')],function(_0x3c8311){return{'model':db[_0x3c8311['model']],'as':_0x3c8311['as'],'attributes':_0x3c8311[_0x4c40('0x1d')],'include':_0x3c8311['include']?_[_0x4c40('0x20')](_0x3c8311[_0x4c40('0x1f')],function(_0x512ef3){return{'model':db[_0x512ef3[_0x4c40('0x21')]],'as':_0x512ef3['as'],'attributes':_0x512ef3[_0x4c40('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4c40('0x10')](function(_0xbd71de){logger[_0x4c40('0x11')]('ShowSmsQueue',_0x3e54c4);logger[_0x4c40('0x14')](_0x4c40('0x24'),_0x3e54c4,JSON['stringify'](_0xbd71de));_0x25f049(_0xbd71de);})['catch'](function(_0xe55202){logger['error']('ShowSmsQueue',_0xe55202['message'],_0x3e54c4);_0x6220d9(_0x862b01[_0x4c40('0x17')](0x1f4,_0xe55202[_0x4c40('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 65e6a13..3cc1210 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 _0x7676=['./smsQueue.events','save','update','emit','removeListener','register'];(function(_0x1b8dd3,_0x3b04d7){var _0x1ffb13=function(_0x3d3cc0){while(--_0x3d3cc0){_0x1b8dd3['push'](_0x1b8dd3['shift']());}};_0x1ffb13(++_0x3b04d7);}(_0x7676,0x1e0));var _0x6767=function(_0x22675f,_0x422038){_0x22675f=_0x22675f-0x0;var _0x563a09=_0x7676[_0x22675f];return _0x563a09;};'use strict';var SmsQueueEvents=require(_0x6767('0x0'));var events=[_0x6767('0x1'),'remove',_0x6767('0x2')];function createListener(_0x3c07a5,_0x2b41eb){return function(_0x475986){_0x2b41eb[_0x6767('0x3')](_0x3c07a5,_0x475986);};}function removeListener(_0x25ae27,_0x356535){return function(){SmsQueueEvents[_0x6767('0x4')](_0x25ae27,_0x356535);};}exports[_0x6767('0x5')]=function(_0x2fe144){for(var _0x473e77=0x0,_0x59c726=events['length'];_0x473e77<_0x59c726;_0x473e77++){var _0x2b4cf8=events[_0x473e77];var _0x2f6d11=createListener('smsQueue:'+_0x2b4cf8,_0x2fe144);SmsQueueEvents['on'](_0x2b4cf8,_0x2f6d11);}}; \ No newline at end of file +var _0xbe8c=['remove','update','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe8c,0x7e));var _0xcbe8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe8c[_0x167cc1];return _0x10bc4b;};'use strict';var SmsQueueEvents=require(_0xcbe8('0x0'));var events=[_0xcbe8('0x1'),_0xcbe8('0x2'),_0xcbe8('0x3')];function createListener(_0xb1a270,_0x4e1e9f){return function(_0x9a6615){_0x4e1e9f['emit'](_0xb1a270,_0x9a6615);};}function removeListener(_0x2079c6,_0x57a790){return function(){SmsQueueEvents[_0xcbe8('0x4')](_0x2079c6,_0x57a790);};}exports[_0xcbe8('0x5')]=function(_0x441ee5){for(var _0x40864e=0x0,_0x5a28a0=events[_0xcbe8('0x6')];_0x40864e<_0x5a28a0;_0x40864e++){var _0x3dcb44=events[_0x40864e];var _0x54eb84=createListener(_0xcbe8('0x7')+_0x3dcb44,_0x441ee5);SmsQueueEvents['on'](_0x3dcb44,_0x54eb84);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 0a6ae1e..816de19 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 _0xd90b=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x59104e,_0x416d05){var _0x59deb2=function(_0x56c9bb){while(--_0x56c9bb){_0x59104e['push'](_0x59104e['shift']());}};_0x59deb2(++_0x416d05);}(_0xd90b,0xbd));var _0xbd90=function(_0x5a7433,_0x3d38e7){_0x5a7433=_0x5a7433-0x0;var _0x11cba0=_0xd90b[_0x5a7433];return _0x11cba0;};'use strict';var multer=require(_0xbd90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbd90('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd90('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xbd90('0x3'));var config=require(_0xbd90('0x4'));var controller=require(_0xbd90('0x5'));router[_0xbd90('0x6')]('/',auth[_0xbd90('0x7')](),controller[_0xbd90('0x8')]);router['get'](_0xbd90('0x9'),auth[_0xbd90('0x7')](),controller[_0xbd90('0xa')]);router[_0xbd90('0x6')](_0xbd90('0xb'),auth[_0xbd90('0x7')](),controller[_0xbd90('0xc')]);router[_0xbd90('0xd')]('/',auth[_0xbd90('0x7')](),controller[_0xbd90('0xe')]);router[_0xbd90('0xf')]('/:id',auth[_0xbd90('0x7')](),controller[_0xbd90('0x10')]);router['delete']('/:id',auth[_0xbd90('0x7')](),controller[_0xbd90('0x11')]);module[_0xbd90('0x12')]=router; \ No newline at end of file +var _0x43e8=['/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x542bcd,_0x3ab9f2){var _0x2fba28=function(_0x23b419){while(--_0x23b419){_0x542bcd['push'](_0x542bcd['shift']());}};_0x2fba28(++_0x3ab9f2);}(_0x43e8,0x81));var _0x843e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x43e8[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x843e('0x0'));var util=require(_0x843e('0x1'));var path=require(_0x843e('0x2'));var timeout=require('connect-timeout');var express=require(_0x843e('0x3'));var router=express[_0x843e('0x4')]();var fs_extra=require(_0x843e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x843e('0x6'));var config=require(_0x843e('0x7'));var controller=require('./smsQueueReport.controller');router[_0x843e('0x8')]('/',auth[_0x843e('0x9')](),controller[_0x843e('0xa')]);router[_0x843e('0x8')](_0x843e('0xb'),auth[_0x843e('0x9')](),controller[_0x843e('0xc')]);router['get']('/:id',auth[_0x843e('0x9')](),controller[_0x843e('0xd')]);router[_0x843e('0xe')]('/',auth['isAuthenticated'](),controller[_0x843e('0xf')]);router[_0x843e('0x10')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller[_0x843e('0x12')]);router[_0x843e('0x13')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller['destroy']);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 05955c9..b44e54f 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 _0x64d0=['sequelize','exports','STRING','DATE','moment'];(function(_0x2197bb,_0x2d7033){var _0x255158=function(_0x45dcbb){while(--_0x45dcbb){_0x2197bb['push'](_0x2197bb['shift']());}};_0x255158(++_0x2d7033);}(_0x64d0,0x171));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x064d('0x0'));var Sequelize=require(_0x064d('0x1'));module[_0x064d('0x2')]={'uniqueid':{'type':Sequelize[_0x064d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x064d('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x064d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x064d('0x4')]},'reason':{'type':Sequelize[_0x064d('0x3')]}}; \ No newline at end of file +var _0x416d=['sequelize','STRING','DATE','moment'];(function(_0x276046,_0x45655f){var _0xa92e4c=function(_0x48b60e){while(--_0x48b60e){_0x276046['push'](_0x276046['shift']());}};_0xa92e4c(++_0x45655f);}(_0x416d,0x1b7));var _0xd416=function(_0x3b69e3,_0x40bb88){_0x3b69e3=_0x3b69e3-0x0;var _0x1f5b5e=_0x416d[_0x3b69e3];return _0x1f5b5e;};'use strict';var moment=require(_0xd416('0x0'));var Sequelize=require(_0xd416('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd416('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd416('0x2')]},'joinAt':{'type':Sequelize[_0xd416('0x3')]},'leaveAt':{'type':Sequelize[_0xd416('0x3')]},'acceptAt':{'type':Sequelize[_0xd416('0x3')]},'exitAt':{'type':Sequelize[_0xd416('0x3')]},'reason':{'type':Sequelize[_0xd416('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 92f8019..b72890d 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 _0x80b1=['then','destroy','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','update','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','save'];(function(_0x3eb36c,_0x190bd0){var _0x429a15=function(_0x890841){while(--_0x890841){_0x3eb36c['push'](_0x3eb36c['shift']());}};_0x429a15(++_0x190bd0);}(_0x80b1,0x146));var _0x180b=function(_0x1adda4,_0x537884){_0x1adda4=_0x1adda4-0x0;var _0x4f9025=_0x80b1[_0x1adda4];return _0x4f9025;};'use strict';var emlformat=require(_0x180b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x180b('0x1'));var rp=require(_0x180b('0x2'));var moment=require(_0x180b('0x3'));var BPromise=require(_0x180b('0x4'));var Mustache=require(_0x180b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x180b('0x6'));var ejs=require(_0x180b('0x7'));var fs=require('fs');var fs_extra=require(_0x180b('0x8'));var _=require(_0x180b('0x9'));var squel=require(_0x180b('0xa'));var crypto=require(_0x180b('0xb'));var jsforce=require(_0x180b('0xc'));var deskjs=require(_0x180b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x180b('0xe'));var Papa=require(_0x180b('0xf'));var Redis=require(_0x180b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x180b('0x11'));var as=require(_0x180b('0x12'));var hardwareService=require(_0x180b('0x13'));var logger=require(_0x180b('0x14'))(_0x180b('0x15'));var utils=require(_0x180b('0x16'));var config=require(_0x180b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6939,_0x1b59a7){_0x1b59a7=_0x1b59a7||0xcc;return function(_0x1bdd75){if(_0x1bdd75){return _0x5c6939[_0x180b('0x18')](_0x1b59a7);}return _0x5c6939[_0x180b('0x19')](_0x1b59a7)[_0x180b('0x1a')]();};}function respondWithResult(_0x5026da,_0x312883){_0x312883=_0x312883||0xc8;return function(_0x5014a3){if(_0x5014a3){return _0x5026da[_0x180b('0x19')](_0x312883)[_0x180b('0x1b')](_0x5014a3);}};}function respondWithFilteredResult(_0x1aa6d4,_0x5c989c){return function(_0x1434e8){if(_0x1434e8){var _0x580d73=typeof _0x5c989c[_0x180b('0x1c')]===_0x180b('0x1d')&&typeof _0x5c989c[_0x180b('0x1e')]===_0x180b('0x1d');var _0x3abecd=_0x1434e8[_0x180b('0x1f')];var _0x45f620=_0x580d73?0x0:_0x5c989c[_0x180b('0x1c')];var _0x3bd2e6=_0x580d73?_0x1434e8['count']:_0x5c989c[_0x180b('0x1c')]+_0x5c989c[_0x180b('0x1e')];var _0x284163;if(_0x3bd2e6>=_0x3abecd){_0x3bd2e6=_0x3abecd;_0x284163=0xc8;}else{_0x284163=0xce;}_0x1aa6d4[_0x180b('0x19')](_0x284163);return _0x1aa6d4['set']('Content-Range',_0x45f620+'-'+_0x3bd2e6+'/'+_0x3abecd)['json'](_0x1434e8);}return null;};}function patchUpdates(_0x545f86){return function(_0x15caa4){try{jsonpatch[_0x180b('0x20')](_0x15caa4,_0x545f86,!![]);}catch(_0x24f5e6){return BPromise['reject'](_0x24f5e6);}return _0x15caa4[_0x180b('0x21')]();};}function saveUpdates(_0x6aa374,_0x4fd6d2){return function(_0x139d36){if(_0x139d36){return _0x139d36['update'](_0x6aa374)[_0x180b('0x22')](function(_0x27681f){return _0x27681f;});}return null;};}function removeEntity(_0x29e3e0,_0x25d98e){return function(_0x3a7255){if(_0x3a7255){return _0x3a7255[_0x180b('0x23')]()[_0x180b('0x22')](function(){_0x29e3e0[_0x180b('0x19')](0xcc)[_0x180b('0x1a')]();});}};}function handleEntityNotFound(_0x2f722a,_0x1e3635){return function(_0x3061ba){if(!_0x3061ba){_0x2f722a[_0x180b('0x18')](0x194);}return _0x3061ba;};}function handleError(_0x112abc,_0xa6b723){_0xa6b723=_0xa6b723||0x1f4;return function(_0x114d16){logger[_0x180b('0x24')](_0x114d16['stack']);if(_0x114d16[_0x180b('0x25')]){delete _0x114d16[_0x180b('0x25')];}_0x112abc['status'](_0xa6b723)[_0x180b('0x26')](_0x114d16);};}exports['index']=function(_0x1ed270,_0x2f7f39){var _0x1f2f6b={},_0x21ba5b={},_0x4a751f={'count':0x0,'rows':[]};var _0x523973=_[_0x180b('0x27')](db[_0x180b('0x28')][_0x180b('0x29')],function(_0x47c720){return{'name':_0x47c720[_0x180b('0x2a')],'type':_0x47c720[_0x180b('0x2b')][_0x180b('0x2c')]};});_0x21ba5b['model']=_['map'](_0x523973,_0x180b('0x25'));_0x21ba5b[_0x180b('0x2d')]=_[_0x180b('0x2e')](_0x1ed270[_0x180b('0x2d')]);_0x21ba5b['filters']=_[_0x180b('0x2f')](_0x21ba5b[_0x180b('0x30')],_0x21ba5b[_0x180b('0x2d')]);_0x1f2f6b[_0x180b('0x31')]=_['intersection'](_0x21ba5b['model'],qs['fields'](_0x1ed270[_0x180b('0x2d')][_0x180b('0x32')]));_0x1f2f6b[_0x180b('0x31')]=_0x1f2f6b['attributes']['length']?_0x1f2f6b[_0x180b('0x31')]:_0x21ba5b[_0x180b('0x30')];if(!_0x1ed270[_0x180b('0x2d')]['hasOwnProperty'](_0x180b('0x33'))){_0x1f2f6b[_0x180b('0x1e')]=qs[_0x180b('0x1e')](_0x1ed270['query'][_0x180b('0x1e')]);_0x1f2f6b[_0x180b('0x1c')]=qs[_0x180b('0x1c')](_0x1ed270[_0x180b('0x2d')][_0x180b('0x1c')]);}_0x1f2f6b['order']=qs['sort'](_0x1ed270[_0x180b('0x2d')][_0x180b('0x34')]);_0x1f2f6b[_0x180b('0x35')]=qs[_0x180b('0x36')](_[_0x180b('0x37')](_0x1ed270[_0x180b('0x2d')],_0x21ba5b[_0x180b('0x36')]),_0x523973);if(_0x1ed270[_0x180b('0x2d')][_0x180b('0x38')]){_0x1f2f6b[_0x180b('0x35')]=_[_0x180b('0x39')](_0x1f2f6b['where'],{'$or':_['map'](_0x523973,function(_0x457ab4){if(_0x457ab4['type']!==_0x180b('0x3a')){var _0x31b1a3={};_0x31b1a3[_0x457ab4[_0x180b('0x25')]]={'$like':'%'+_0x1ed270['query'][_0x180b('0x38')]+'%'};return _0x31b1a3;}})});}_0x1f2f6b=_[_0x180b('0x39')]({},_0x1f2f6b,_0x1ed270[_0x180b('0x3b')]);var _0x3ce5c0={'where':_0x1f2f6b[_0x180b('0x35')]};return db['SmsQueueReport'][_0x180b('0x1f')](_0x3ce5c0)[_0x180b('0x22')](function(_0x5561eb){_0x4a751f[_0x180b('0x1f')]=_0x5561eb;if(_0x1ed270['query'][_0x180b('0x3c')]){_0x1f2f6b[_0x180b('0x3d')]=[{'all':!![]}];}return db[_0x180b('0x28')][_0x180b('0x3e')](_0x1f2f6b);})[_0x180b('0x22')](function(_0x178b15){_0x4a751f['rows']=_0x178b15;return _0x4a751f;})[_0x180b('0x22')](respondWithFilteredResult(_0x2f7f39,_0x1f2f6b))[_0x180b('0x3f')](handleError(_0x2f7f39,null));};exports[_0x180b('0x40')]=function(_0x5d11ac,_0x364acd){var _0x545bcb={'raw':!![],'where':{'id':_0x5d11ac[_0x180b('0x41')]['id']}},_0x2f2f83={};_0x2f2f83[_0x180b('0x30')]=_[_0x180b('0x2e')](db[_0x180b('0x28')][_0x180b('0x29')]);_0x2f2f83[_0x180b('0x2d')]=_[_0x180b('0x2e')](_0x5d11ac['query']);_0x2f2f83[_0x180b('0x36')]=_['intersection'](_0x2f2f83[_0x180b('0x30')],_0x2f2f83[_0x180b('0x2d')]);_0x545bcb[_0x180b('0x31')]=_[_0x180b('0x2f')](_0x2f2f83['model'],qs[_0x180b('0x32')](_0x5d11ac[_0x180b('0x2d')][_0x180b('0x32')]));_0x545bcb[_0x180b('0x31')]=_0x545bcb[_0x180b('0x31')][_0x180b('0x42')]?_0x545bcb[_0x180b('0x31')]:_0x2f2f83['model'];if(_0x5d11ac[_0x180b('0x2d')][_0x180b('0x3c')]){_0x545bcb['include']=[{'all':!![]}];}_0x545bcb=_[_0x180b('0x39')]({},_0x545bcb,_0x5d11ac[_0x180b('0x3b')]);return db[_0x180b('0x28')][_0x180b('0x43')](_0x545bcb)[_0x180b('0x22')](handleEntityNotFound(_0x364acd,null))['then'](respondWithResult(_0x364acd,null))[_0x180b('0x3f')](handleError(_0x364acd,null));};exports[_0x180b('0x44')]=function(_0x27685a,_0x5763ad){return db[_0x180b('0x28')][_0x180b('0x44')](_0x27685a['body'],{})[_0x180b('0x22')](respondWithResult(_0x5763ad,0xc9))['catch'](handleError(_0x5763ad,null));};exports[_0x180b('0x45')]=function(_0x537bd5,_0x151891){if(_0x537bd5[_0x180b('0x46')]['id']){delete _0x537bd5[_0x180b('0x46')]['id'];}return db['SmsQueueReport'][_0x180b('0x43')]({'where':{'id':_0x537bd5['params']['id']}})[_0x180b('0x22')](handleEntityNotFound(_0x151891,null))[_0x180b('0x22')](saveUpdates(_0x537bd5[_0x180b('0x46')],null))[_0x180b('0x22')](respondWithResult(_0x151891,null))[_0x180b('0x3f')](handleError(_0x151891,null));};exports[_0x180b('0x23')]=function(_0x438adb,_0x118bc8){return db['SmsQueueReport'][_0x180b('0x43')]({'where':{'id':_0x438adb[_0x180b('0x41')]['id']}})['then'](handleEntityNotFound(_0x118bc8,null))[_0x180b('0x22')](removeEntity(_0x118bc8,null))[_0x180b('0x3f')](handleError(_0x118bc8,null));};exports[_0x180b('0x47')]=function(_0x4e441e,_0x3b2a56){return db['SmsQueueReport'][_0x180b('0x47')]()['then'](respondWithResult(_0x3b2a56,null))[_0x180b('0x3f')](handleError(_0x3b2a56,null));}; \ No newline at end of file +var _0x0bd8=['includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','options'];(function(_0x36e10d,_0x21bef5){var _0xc713a2=function(_0x1661d1){while(--_0x1661d1){_0x36e10d['push'](_0x36e10d['shift']());}};_0xc713a2(++_0x21bef5);}(_0x0bd8,0xe0));var _0x80bd=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x0bd8[_0x1778e1];return _0x2bc4c6;};'use strict';var emlformat=require(_0x80bd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x80bd('0x1'));var rp=require(_0x80bd('0x2'));var moment=require(_0x80bd('0x3'));var BPromise=require(_0x80bd('0x4'));var Mustache=require('mustache');var util=require(_0x80bd('0x5'));var path=require(_0x80bd('0x6'));var sox=require('sox');var csv=require(_0x80bd('0x7'));var ejs=require(_0x80bd('0x8'));var fs=require('fs');var fs_extra=require(_0x80bd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x80bd('0xa'));var jsforce=require(_0x80bd('0xb'));var deskjs=require(_0x80bd('0xc'));var toCsv=require(_0x80bd('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80bd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80bd('0xe'));var as=require(_0x80bd('0xf'));var hardwareService=require(_0x80bd('0x10'));var logger=require(_0x80bd('0x11'))(_0x80bd('0x12'));var utils=require(_0x80bd('0x13'));var config=require(_0x80bd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x80bd('0x15'))['db'];function respondWithStatusCode(_0x54c335,_0x15175a){_0x15175a=_0x15175a||0xcc;return function(_0x363c21){if(_0x363c21){return _0x54c335[_0x80bd('0x16')](_0x15175a);}return _0x54c335[_0x80bd('0x17')](_0x15175a)[_0x80bd('0x18')]();};}function respondWithResult(_0x4aba69,_0x17470e){_0x17470e=_0x17470e||0xc8;return function(_0x27e8ef){if(_0x27e8ef){return _0x4aba69[_0x80bd('0x17')](_0x17470e)['json'](_0x27e8ef);}};}function respondWithFilteredResult(_0x2248fc,_0x1ce543){return function(_0x124166){if(_0x124166){var _0x102df9=typeof _0x1ce543[_0x80bd('0x19')]==='undefined'&&typeof _0x1ce543[_0x80bd('0x1a')]===_0x80bd('0x1b');var _0x3994c3=_0x124166[_0x80bd('0x1c')];var _0x3c34bf=_0x102df9?0x0:_0x1ce543[_0x80bd('0x19')];var _0x230711=_0x102df9?_0x124166[_0x80bd('0x1c')]:_0x1ce543[_0x80bd('0x19')]+_0x1ce543['limit'];var _0x1f26a2;if(_0x230711>=_0x3994c3){_0x230711=_0x3994c3;_0x1f26a2=0xc8;}else{_0x1f26a2=0xce;}_0x2248fc[_0x80bd('0x17')](_0x1f26a2);return _0x2248fc[_0x80bd('0x1d')]('Content-Range',_0x3c34bf+'-'+_0x230711+'/'+_0x3994c3)['json'](_0x124166);}return null;};}function patchUpdates(_0x17987b){return function(_0x535389){try{jsonpatch[_0x80bd('0x1e')](_0x535389,_0x17987b,!![]);}catch(_0x3955fe){return BPromise['reject'](_0x3955fe);}return _0x535389[_0x80bd('0x1f')]();};}function saveUpdates(_0x1bad33,_0x4627dd){return function(_0x1c8d5b){if(_0x1c8d5b){return _0x1c8d5b[_0x80bd('0x20')](_0x1bad33)[_0x80bd('0x21')](function(_0x44441e){return _0x44441e;});}return null;};}function removeEntity(_0x274cb9,_0x13b71d){return function(_0x91fc18){if(_0x91fc18){return _0x91fc18['destroy']()['then'](function(){_0x274cb9[_0x80bd('0x17')](0xcc)[_0x80bd('0x18')]();});}};}function handleEntityNotFound(_0xfdadb1,_0x2ff227){return function(_0x1746d7){if(!_0x1746d7){_0xfdadb1['sendStatus'](0x194);}return _0x1746d7;};}function handleError(_0x137b45,_0x53a354){_0x53a354=_0x53a354||0x1f4;return function(_0x343828){logger['error'](_0x343828[_0x80bd('0x22')]);if(_0x343828[_0x80bd('0x23')]){delete _0x343828[_0x80bd('0x23')];}_0x137b45[_0x80bd('0x17')](_0x53a354)[_0x80bd('0x24')](_0x343828);};}exports[_0x80bd('0x25')]=function(_0x4bc1fc,_0x10c56b){var _0x20eb41={},_0x569d3b={},_0x4ced77={'count':0x0,'rows':[]};var _0x5cef0f=_[_0x80bd('0x26')](db[_0x80bd('0x27')][_0x80bd('0x28')],function(_0x4a8088){return{'name':_0x4a8088['fieldName'],'type':_0x4a8088['type'][_0x80bd('0x29')]};});_0x569d3b[_0x80bd('0x2a')]=_[_0x80bd('0x26')](_0x5cef0f,'name');_0x569d3b[_0x80bd('0x2b')]=_[_0x80bd('0x2c')](_0x4bc1fc[_0x80bd('0x2b')]);_0x569d3b[_0x80bd('0x2d')]=_[_0x80bd('0x2e')](_0x569d3b['model'],_0x569d3b[_0x80bd('0x2b')]);_0x20eb41[_0x80bd('0x2f')]=_[_0x80bd('0x2e')](_0x569d3b[_0x80bd('0x2a')],qs[_0x80bd('0x30')](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x30')]));_0x20eb41[_0x80bd('0x2f')]=_0x20eb41['attributes'][_0x80bd('0x31')]?_0x20eb41[_0x80bd('0x2f')]:_0x569d3b[_0x80bd('0x2a')];if(!_0x4bc1fc['query'][_0x80bd('0x32')](_0x80bd('0x33'))){_0x20eb41[_0x80bd('0x1a')]=qs[_0x80bd('0x1a')](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x1a')]);_0x20eb41['offset']=qs['offset'](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x19')]);}_0x20eb41[_0x80bd('0x34')]=qs['sort'](_0x4bc1fc[_0x80bd('0x2b')]['sort']);_0x20eb41[_0x80bd('0x35')]=qs['filters'](_[_0x80bd('0x36')](_0x4bc1fc[_0x80bd('0x2b')],_0x569d3b['filters']),_0x5cef0f);if(_0x4bc1fc[_0x80bd('0x2b')]['filter']){_0x20eb41[_0x80bd('0x35')]=_['merge'](_0x20eb41[_0x80bd('0x35')],{'$or':_['map'](_0x5cef0f,function(_0xd6c2f7){if(_0xd6c2f7[_0x80bd('0x37')]!==_0x80bd('0x38')){var _0x515c22={};_0x515c22[_0xd6c2f7[_0x80bd('0x23')]]={'$like':'%'+_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x39')]+'%'};return _0x515c22;}})});}_0x20eb41=_[_0x80bd('0x3a')]({},_0x20eb41,_0x4bc1fc[_0x80bd('0x3b')]);var _0x2f87f5={'where':_0x20eb41[_0x80bd('0x35')]};return db[_0x80bd('0x27')][_0x80bd('0x1c')](_0x2f87f5)[_0x80bd('0x21')](function(_0x280071){_0x4ced77['count']=_0x280071;if(_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x3c')]){_0x20eb41['include']=[{'all':!![]}];}return db[_0x80bd('0x27')][_0x80bd('0x3d')](_0x20eb41);})[_0x80bd('0x21')](function(_0x3429ad){_0x4ced77[_0x80bd('0x3e')]=_0x3429ad;return _0x4ced77;})[_0x80bd('0x21')](respondWithFilteredResult(_0x10c56b,_0x20eb41))[_0x80bd('0x3f')](handleError(_0x10c56b,null));};exports[_0x80bd('0x40')]=function(_0x50ad68,_0x565318){var _0x1acb72={'raw':!![],'where':{'id':_0x50ad68[_0x80bd('0x41')]['id']}},_0x645b81={};_0x645b81[_0x80bd('0x2a')]=_[_0x80bd('0x2c')](db[_0x80bd('0x27')]['rawAttributes']);_0x645b81[_0x80bd('0x2b')]=_[_0x80bd('0x2c')](_0x50ad68[_0x80bd('0x2b')]);_0x645b81[_0x80bd('0x2d')]=_[_0x80bd('0x2e')](_0x645b81['model'],_0x645b81[_0x80bd('0x2b')]);_0x1acb72[_0x80bd('0x2f')]=_[_0x80bd('0x2e')](_0x645b81[_0x80bd('0x2a')],qs[_0x80bd('0x30')](_0x50ad68[_0x80bd('0x2b')][_0x80bd('0x30')]));_0x1acb72['attributes']=_0x1acb72[_0x80bd('0x2f')][_0x80bd('0x31')]?_0x1acb72[_0x80bd('0x2f')]:_0x645b81[_0x80bd('0x2a')];if(_0x50ad68['query'][_0x80bd('0x3c')]){_0x1acb72[_0x80bd('0x42')]=[{'all':!![]}];}_0x1acb72=_[_0x80bd('0x3a')]({},_0x1acb72,_0x50ad68['options']);return db[_0x80bd('0x27')][_0x80bd('0x43')](_0x1acb72)[_0x80bd('0x21')](handleEntityNotFound(_0x565318,null))['then'](respondWithResult(_0x565318,null))[_0x80bd('0x3f')](handleError(_0x565318,null));};exports[_0x80bd('0x44')]=function(_0x59d403,_0x4529ee){return db[_0x80bd('0x27')][_0x80bd('0x44')](_0x59d403[_0x80bd('0x45')],{})[_0x80bd('0x21')](respondWithResult(_0x4529ee,0xc9))[_0x80bd('0x3f')](handleError(_0x4529ee,null));};exports[_0x80bd('0x20')]=function(_0x58691a,_0x16fb62){if(_0x58691a[_0x80bd('0x45')]['id']){delete _0x58691a[_0x80bd('0x45')]['id'];}return db[_0x80bd('0x27')][_0x80bd('0x43')]({'where':{'id':_0x58691a[_0x80bd('0x41')]['id']}})[_0x80bd('0x21')](handleEntityNotFound(_0x16fb62,null))['then'](saveUpdates(_0x58691a[_0x80bd('0x45')],null))[_0x80bd('0x21')](respondWithResult(_0x16fb62,null))[_0x80bd('0x3f')](handleError(_0x16fb62,null));};exports['destroy']=function(_0x3b1b26,_0x9b8d20){return db[_0x80bd('0x27')][_0x80bd('0x43')]({'where':{'id':_0x3b1b26[_0x80bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x9b8d20,null))[_0x80bd('0x21')](removeEntity(_0x9b8d20,null))[_0x80bd('0x3f')](handleError(_0x9b8d20,null));};exports[_0x80bd('0x46')]=function(_0xd566be,_0x1acd9c){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x1acd9c,null))[_0x80bd('0x3f')](handleError(_0x1acd9c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0c3b1a2..6423d08 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_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':[{'name':_0x3071('0xc'),'fields':[_0x3071('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 ae94495..f864ec8 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 _0x1f26=['request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','create','options','raw','update','body','where','attributes','limit','UpdateSmsQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2d5aca,_0x19beca){var _0x24ae42=function(_0x35b99c){while(--_0x35b99c){_0x2d5aca['push'](_0x2d5aca['shift']());}};_0x24ae42(++_0x19beca);}(_0x1f26,0x76));var _0x61f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x61f2('0x0'));var BPromise=require(_0x61f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61f2('0x2'));var db=require(_0x61f2('0x3'))['db'];var utils=require(_0x61f2('0x4'));var logger=require('../../config/logger')(_0x61f2('0x5'));var config=require(_0x61f2('0x6'));var jayson=require(_0x61f2('0x7'));var client=jayson[_0x61f2('0x8')][_0x61f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d3c87,_0x3699a4,_0x3337ec){return new BPromise(function(_0x324afa,_0x2f48da){return client[_0x61f2('0xa')](_0x2d3c87,_0x3337ec)[_0x61f2('0xb')](function(_0x49cccc){logger[_0x61f2('0xc')](_0x61f2('0xd'),_0x3699a4,_0x61f2('0xe'));logger[_0x61f2('0xf')](_0x61f2('0x10'),_0x3699a4,_0x61f2('0xe'),JSON[_0x61f2('0x11')](_0x49cccc));if(_0x49cccc['error']){if(_0x49cccc[_0x61f2('0x12')]['code']===0x1f4){logger[_0x61f2('0x12')](_0x61f2('0xd'),_0x3699a4,_0x49cccc[_0x61f2('0x12')][_0x61f2('0x13')]);return _0x2f48da(_0x49cccc[_0x61f2('0x12')][_0x61f2('0x13')]);}logger[_0x61f2('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x3699a4,_0x49cccc[_0x61f2('0x12')][_0x61f2('0x13')]);return _0x324afa(_0x49cccc[_0x61f2('0x12')]['message']);}else{logger[_0x61f2('0xc')](_0x61f2('0xd'),_0x3699a4,'request\x20sent');_0x324afa(_0x49cccc[_0x61f2('0x14')][_0x61f2('0x13')]);}})[_0x61f2('0x15')](function(_0x57f809){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3699a4,_0x57f809);_0x2f48da(_0x57f809);});});}exports[_0x61f2('0x16')]=function(_0x2adfc9){var _0xb3a312=this;return new Promise(function(_0x5c0767,_0x2deb87){return db['SmsQueueReport'][_0x61f2('0x17')](_0x2adfc9['body'],{'raw':_0x2adfc9[_0x61f2('0x18')]?_0x2adfc9[_0x61f2('0x18')][_0x61f2('0x19')]===undefined?!![]:![]:!![]})[_0x61f2('0xb')](function(_0xca26e1){logger[_0x61f2('0xc')](_0x61f2('0x16'),_0x2adfc9);logger[_0x61f2('0xf')]('CreateSmsQueueReport',_0x2adfc9,JSON[_0x61f2('0x11')](_0xca26e1));_0x5c0767(_0xca26e1);})[_0x61f2('0x15')](function(_0x5c0c32){logger['error'](_0x61f2('0x16'),_0x5c0c32['message'],_0x2adfc9);_0x2deb87(_0xb3a312[_0x61f2('0x12')](0x1f4,_0x5c0c32['message']));});});};exports['UpdateSmsQueueReport']=function(_0xd88b63){var _0x23707a=this;return new Promise(function(_0x48d294,_0x29cffa){return db['SmsQueueReport'][_0x61f2('0x1a')](_0xd88b63[_0x61f2('0x1b')],{'raw':_0xd88b63[_0x61f2('0x18')]?_0xd88b63[_0x61f2('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd88b63[_0x61f2('0x18')]?_0xd88b63[_0x61f2('0x18')][_0x61f2('0x1c')]||null:null,'attributes':_0xd88b63['options']?_0xd88b63[_0x61f2('0x18')][_0x61f2('0x1d')]||null:null,'limit':_0xd88b63[_0x61f2('0x18')]?_0xd88b63[_0x61f2('0x18')][_0x61f2('0x1e')]||null:null})[_0x61f2('0xb')](function(_0x49f9f1){logger[_0x61f2('0xc')](_0x61f2('0x1f'),_0xd88b63);logger[_0x61f2('0xf')](_0x61f2('0x1f'),_0xd88b63,JSON[_0x61f2('0x11')](_0x49f9f1));_0x48d294(_0x49f9f1);})['catch'](function(_0x5c642f){logger[_0x61f2('0x12')]('UpdateSmsQueueReport',_0x5c642f['message'],_0xd88b63);_0x29cffa(_0x23707a[_0x61f2('0x12')](0x1f4,_0x5c642f[_0x61f2('0x13')]));});});}; \ No newline at end of file +var _0x9e67=['SmsQueueReport','create','body','options','raw','then','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x486e40,_0x1e58a0){var _0x48f516=function(_0x374993){while(--_0x374993){_0x486e40['push'](_0x486e40['shift']());}};_0x48f516(++_0x1e58a0);}(_0x9e67,0x1db));var _0x79e6=function(_0xe3ffe9,_0x86ddef){_0xe3ffe9=_0xe3ffe9-0x0;var _0x53c321=_0x9e67[_0xe3ffe9];return _0x53c321;};'use strict';var _=require(_0x79e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x79e6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79e6('0x2'));var db=require(_0x79e6('0x3'))['db'];var utils=require(_0x79e6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x79e6('0x5'));var jayson=require(_0x79e6('0x6'));var client=jayson[_0x79e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3777,_0xc08c3e,_0x3d10fe){return new BPromise(function(_0xa3977c,_0x921274){return client[_0x79e6('0x8')](_0x5f3777,_0x3d10fe)['then'](function(_0x400771){logger[_0x79e6('0x9')](_0x79e6('0xa'),_0xc08c3e,_0x79e6('0xb'));logger[_0x79e6('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xc08c3e,_0x79e6('0xb'),JSON['stringify'](_0x400771));if(_0x400771[_0x79e6('0xd')]){if(_0x400771['error'][_0x79e6('0xe')]===0x1f4){logger['error'](_0x79e6('0xa'),_0xc08c3e,_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);return _0x921274(_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);}logger['error'](_0x79e6('0xa'),_0xc08c3e,_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);return _0xa3977c(_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);}else{logger[_0x79e6('0x9')](_0x79e6('0xa'),_0xc08c3e,_0x79e6('0xb'));_0xa3977c(_0x400771[_0x79e6('0x10')][_0x79e6('0xf')]);}})[_0x79e6('0x11')](function(_0x429626){logger[_0x79e6('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0xc08c3e,_0x429626);_0x921274(_0x429626);});});}exports['CreateSmsQueueReport']=function(_0x5dfc06){var _0x5b9014=this;return new Promise(function(_0x30f1e5,_0x347679){return db[_0x79e6('0x12')][_0x79e6('0x13')](_0x5dfc06[_0x79e6('0x14')],{'raw':_0x5dfc06[_0x79e6('0x15')]?_0x5dfc06[_0x79e6('0x15')][_0x79e6('0x16')]===undefined?!![]:![]:!![]})[_0x79e6('0x17')](function(_0x295169){logger['info'](_0x79e6('0x18'),_0x5dfc06);logger[_0x79e6('0xc')](_0x79e6('0x18'),_0x5dfc06,JSON[_0x79e6('0x19')](_0x295169));_0x30f1e5(_0x295169);})['catch'](function(_0x3e0eae){logger[_0x79e6('0xd')]('CreateSmsQueueReport',_0x3e0eae['message'],_0x5dfc06);_0x347679(_0x5b9014[_0x79e6('0xd')](0x1f4,_0x3e0eae[_0x79e6('0xf')]));});});};exports[_0x79e6('0x1a')]=function(_0x34492b){var _0x2d7107=this;return new Promise(function(_0x24ef74,_0x24f421){return db[_0x79e6('0x12')][_0x79e6('0x1b')](_0x34492b[_0x79e6('0x14')],{'raw':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['where']||null:null,'attributes':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['attributes']||null:null,'limit':_0x34492b['options']?_0x34492b[_0x79e6('0x15')][_0x79e6('0x1c')]||null:null})[_0x79e6('0x17')](function(_0x3f3b76){logger[_0x79e6('0x9')](_0x79e6('0x1a'),_0x34492b);logger[_0x79e6('0xc')](_0x79e6('0x1a'),_0x34492b,JSON[_0x79e6('0x19')](_0x3f3b76));_0x24ef74(_0x3f3b76);})[_0x79e6('0x11')](function(_0x1ec8e6){logger[_0x79e6('0xd')](_0x79e6('0x1a'),_0x1ec8e6['message'],_0x34492b);_0x24f421(_0x2d7107[_0x79e6('0xd')](0x1f4,_0x1ec8e6[_0x79e6('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 40a6acc..92f4788 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 _0x84ab=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','/describe','describe','isAuthenticated','post','create','update','delete','/:id','destroy','multer'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x84ab,0x12f));var _0xb84a=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x84ab[_0x310504];return _0x5b36d0;};'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 fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0x9')]('/:id',auth[_0xb84a('0xc')](),controller['show']);router[_0xb84a('0xd')]('/',auth[_0xb84a('0xc')](),controller[_0xb84a('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0xf')]);router[_0xb84a('0x10')](_0xb84a('0x11'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5ad3=['isAuthenticated','index','describe','create','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0xf17ab9,_0x487d77){var _0x4d0bd8=function(_0x3b213a){while(--_0x3b213a){_0xf17ab9['push'](_0xf17ab9['shift']());}};_0x4d0bd8(++_0x487d77);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x5ad3[_0x585133];return _0x18254a;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/describe',auth[_0x35ad('0xb')](),controller[_0x35ad('0xd')]);router[_0x35ad('0xa')]('/:id',auth[_0x35ad('0xb')](),controller['show']);router['post']('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xe')]);router['put'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['update']);router['delete'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['destroy']);module[_0x35ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 25d8a76..f85075a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x61a02a,_0x1e79f6){var _0x23cc6d=function(_0x2297cf){while(--_0x2297cf){_0x61a02a['push'](_0x61a02a['shift']());}};_0x23cc6d(++_0x1e79f6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xcb91[_0x3e0dc4];return _0x586111;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xeb67cb,_0x3facda){var _0xc8fe96=function(_0x4074a2){while(--_0x4074a2){_0xeb67cb['push'](_0xeb67cb['shift']());}};_0xc8fe96(++_0x3facda);}(_0x54ef,0x112));var _0xf54e=function(_0x1c670a,_0x4d9930){_0x1c670a=_0x1c670a-0x0;var _0xf6cb06=_0x54ef[_0x1c670a];return _0xf6cb06;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4d99c42..e26c792 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 _0xba96=['set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba96,0x129));var _0x6ba9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xba96[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ba9('0x0'));var zipdir=require(_0x6ba9('0x1'));var jsonpatch=require(_0x6ba9('0x2'));var rp=require(_0x6ba9('0x3'));var moment=require(_0x6ba9('0x4'));var BPromise=require(_0x6ba9('0x5'));var Mustache=require(_0x6ba9('0x6'));var util=require(_0x6ba9('0x7'));var path=require(_0x6ba9('0x8'));var sox=require(_0x6ba9('0x9'));var csv=require(_0x6ba9('0xa'));var ejs=require(_0x6ba9('0xb'));var fs=require('fs');var fs_extra=require(_0x6ba9('0xc'));var _=require(_0x6ba9('0xd'));var squel=require(_0x6ba9('0xe'));var crypto=require(_0x6ba9('0xf'));var jsforce=require(_0x6ba9('0x10'));var deskjs=require(_0x6ba9('0x11'));var toCsv=require(_0x6ba9('0xa'));var querystring=require(_0x6ba9('0x12'));var Papa=require(_0x6ba9('0x13'));var Redis=require(_0x6ba9('0x14'));var authService=require(_0x6ba9('0x15'));var qs=require(_0x6ba9('0x16'));var as=require(_0x6ba9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6ba9('0x18'));var config=require(_0x6ba9('0x19'));var licenseUtil=require(_0x6ba9('0x1a'));var db=require(_0x6ba9('0x1b'))['db'];function respondWithStatusCode(_0x51630b,_0x1730c1){_0x1730c1=_0x1730c1||0xcc;return function(_0x5a5d35){if(_0x5a5d35){return _0x51630b[_0x6ba9('0x1c')](_0x1730c1);}return _0x51630b[_0x6ba9('0x1d')](_0x1730c1)[_0x6ba9('0x1e')]();};}function respondWithResult(_0x4bc2cd,_0x470429){_0x470429=_0x470429||0xc8;return function(_0x25872d){if(_0x25872d){return _0x4bc2cd[_0x6ba9('0x1d')](_0x470429)['json'](_0x25872d);}};}function respondWithFilteredResult(_0xe47089,_0x5cbfee){return function(_0x539877){if(_0x539877){var _0x1ddd2e=typeof _0x5cbfee[_0x6ba9('0x1f')]===_0x6ba9('0x20')&&typeof _0x5cbfee[_0x6ba9('0x21')]===_0x6ba9('0x20');var _0x5ed1bc=_0x539877['count'];var _0x2e7378=_0x1ddd2e?0x0:_0x5cbfee[_0x6ba9('0x1f')];var _0x5c2001=_0x1ddd2e?_0x539877[_0x6ba9('0x22')]:_0x5cbfee[_0x6ba9('0x1f')]+_0x5cbfee[_0x6ba9('0x21')];var _0x327b45;if(_0x5c2001>=_0x5ed1bc){_0x5c2001=_0x5ed1bc;_0x327b45=0xc8;}else{_0x327b45=0xce;}_0xe47089[_0x6ba9('0x1d')](_0x327b45);return _0xe47089[_0x6ba9('0x23')](_0x6ba9('0x24'),_0x2e7378+'-'+_0x5c2001+'/'+_0x5ed1bc)[_0x6ba9('0x25')](_0x539877);}return null;};}function patchUpdates(_0x5eda43){return function(_0x34a2c2){try{jsonpatch[_0x6ba9('0x26')](_0x34a2c2,_0x5eda43,!![]);}catch(_0xc761a8){return BPromise[_0x6ba9('0x27')](_0xc761a8);}return _0x34a2c2[_0x6ba9('0x28')]();};}function saveUpdates(_0x2a6c70,_0x26e0e0){return function(_0x5ceaf0){if(_0x5ceaf0){return _0x5ceaf0[_0x6ba9('0x29')](_0x2a6c70)['then'](function(_0x28ba62){return _0x28ba62;});}return null;};}function removeEntity(_0x28c35e,_0x3bba44){return function(_0x287e2e){if(_0x287e2e){return _0x287e2e['destroy']()[_0x6ba9('0x2a')](function(){_0x28c35e[_0x6ba9('0x1d')](0xcc)[_0x6ba9('0x1e')]();});}};}function handleEntityNotFound(_0x4a95ac,_0x526b0f){return function(_0x5ada15){if(!_0x5ada15){_0x4a95ac[_0x6ba9('0x1c')](0x194);}return _0x5ada15;};}function handleError(_0x11d930,_0x117924){_0x117924=_0x117924||0x1f4;return function(_0x1c3542){logger[_0x6ba9('0x2b')](_0x1c3542[_0x6ba9('0x2c')]);if(_0x1c3542[_0x6ba9('0x2d')]){delete _0x1c3542[_0x6ba9('0x2d')];}_0x11d930['status'](_0x117924)[_0x6ba9('0x2e')](_0x1c3542);};}exports[_0x6ba9('0x2f')]=function(_0x19d84c,_0x285b3f){var _0x2f5591={},_0x5d5b71={},_0x5011f8={'count':0x0,'rows':[]};var _0x16efa6=_[_0x6ba9('0x30')](db[_0x6ba9('0x31')]['rawAttributes'],function(_0x20669c){return{'name':_0x20669c[_0x6ba9('0x32')],'type':_0x20669c[_0x6ba9('0x33')][_0x6ba9('0x34')]};});_0x5d5b71[_0x6ba9('0x35')]=_[_0x6ba9('0x30')](_0x16efa6,'name');_0x5d5b71[_0x6ba9('0x36')]=_[_0x6ba9('0x37')](_0x19d84c['query']);_0x5d5b71[_0x6ba9('0x38')]=_['intersection'](_0x5d5b71[_0x6ba9('0x35')],_0x5d5b71[_0x6ba9('0x36')]);_0x2f5591['attributes']=_[_0x6ba9('0x39')](_0x5d5b71[_0x6ba9('0x35')],qs[_0x6ba9('0x3a')](_0x19d84c[_0x6ba9('0x36')][_0x6ba9('0x3a')]));_0x2f5591[_0x6ba9('0x3b')]=_0x2f5591[_0x6ba9('0x3b')]['length']?_0x2f5591[_0x6ba9('0x3b')]:_0x5d5b71[_0x6ba9('0x35')];if(!_0x19d84c[_0x6ba9('0x36')][_0x6ba9('0x3c')](_0x6ba9('0x3d'))){_0x2f5591[_0x6ba9('0x21')]=qs[_0x6ba9('0x21')](_0x19d84c['query'][_0x6ba9('0x21')]);_0x2f5591['offset']=qs[_0x6ba9('0x1f')](_0x19d84c[_0x6ba9('0x36')][_0x6ba9('0x1f')]);}_0x2f5591[_0x6ba9('0x3e')]=qs[_0x6ba9('0x3f')](_0x19d84c[_0x6ba9('0x36')][_0x6ba9('0x3f')]);_0x2f5591[_0x6ba9('0x40')]=qs[_0x6ba9('0x38')](_['pick'](_0x19d84c['query'],_0x5d5b71[_0x6ba9('0x38')]),_0x16efa6);if(_0x19d84c[_0x6ba9('0x36')][_0x6ba9('0x41')]){_0x2f5591['where']=_[_0x6ba9('0x42')](_0x2f5591[_0x6ba9('0x40')],{'$or':_[_0x6ba9('0x30')](_0x16efa6,function(_0x11a354){if(_0x11a354[_0x6ba9('0x33')]!==_0x6ba9('0x43')){var _0x291b2d={};_0x291b2d[_0x11a354[_0x6ba9('0x2d')]]={'$like':'%'+_0x19d84c['query']['filter']+'%'};return _0x291b2d;}})});}_0x2f5591=_['merge']({},_0x2f5591,_0x19d84c[_0x6ba9('0x44')]);var _0x2eb189={'where':_0x2f5591['where']};return db[_0x6ba9('0x31')][_0x6ba9('0x22')](_0x2eb189)[_0x6ba9('0x2a')](function(_0x4937d1){_0x5011f8[_0x6ba9('0x22')]=_0x4937d1;if(_0x19d84c['query'][_0x6ba9('0x45')]){_0x2f5591[_0x6ba9('0x46')]=[{'all':!![]}];}return db[_0x6ba9('0x31')][_0x6ba9('0x47')](_0x2f5591);})[_0x6ba9('0x2a')](function(_0x45dd75){_0x5011f8[_0x6ba9('0x48')]=_0x45dd75;return _0x5011f8;})[_0x6ba9('0x2a')](respondWithFilteredResult(_0x285b3f,_0x2f5591))[_0x6ba9('0x49')](handleError(_0x285b3f,null));};exports[_0x6ba9('0x4a')]=function(_0x3eb4d8,_0x43ed32){var _0x4928cb={'raw':!![],'where':{'id':_0x3eb4d8[_0x6ba9('0x4b')]['id']}},_0x2413b4={};_0x2413b4[_0x6ba9('0x35')]=_['keys'](db['SmsTransferReport'][_0x6ba9('0x4c')]);_0x2413b4[_0x6ba9('0x36')]=_[_0x6ba9('0x37')](_0x3eb4d8[_0x6ba9('0x36')]);_0x2413b4[_0x6ba9('0x38')]=_[_0x6ba9('0x39')](_0x2413b4[_0x6ba9('0x35')],_0x2413b4[_0x6ba9('0x36')]);_0x4928cb[_0x6ba9('0x3b')]=_[_0x6ba9('0x39')](_0x2413b4['model'],qs[_0x6ba9('0x3a')](_0x3eb4d8[_0x6ba9('0x36')]['fields']));_0x4928cb[_0x6ba9('0x3b')]=_0x4928cb[_0x6ba9('0x3b')][_0x6ba9('0x4d')]?_0x4928cb[_0x6ba9('0x3b')]:_0x2413b4['model'];if(_0x3eb4d8[_0x6ba9('0x36')][_0x6ba9('0x45')]){_0x4928cb['include']=[{'all':!![]}];}_0x4928cb=_[_0x6ba9('0x42')]({},_0x4928cb,_0x3eb4d8[_0x6ba9('0x44')]);return db[_0x6ba9('0x31')][_0x6ba9('0x4e')](_0x4928cb)[_0x6ba9('0x2a')](handleEntityNotFound(_0x43ed32,null))['then'](respondWithResult(_0x43ed32,null))[_0x6ba9('0x49')](handleError(_0x43ed32,null));};exports['create']=function(_0x3dbfb0,_0x5bd200){return db[_0x6ba9('0x31')][_0x6ba9('0x4f')](_0x3dbfb0[_0x6ba9('0x50')],{})['then'](respondWithResult(_0x5bd200,0xc9))[_0x6ba9('0x49')](handleError(_0x5bd200,null));};exports[_0x6ba9('0x29')]=function(_0xc45c64,_0x4c60b3){if(_0xc45c64['body']['id']){delete _0xc45c64['body']['id'];}return db[_0x6ba9('0x31')][_0x6ba9('0x4e')]({'where':{'id':_0xc45c64[_0x6ba9('0x4b')]['id']}})[_0x6ba9('0x2a')](handleEntityNotFound(_0x4c60b3,null))[_0x6ba9('0x2a')](saveUpdates(_0xc45c64[_0x6ba9('0x50')],null))[_0x6ba9('0x2a')](respondWithResult(_0x4c60b3,null))[_0x6ba9('0x49')](handleError(_0x4c60b3,null));};exports[_0x6ba9('0x51')]=function(_0x37d0fe,_0x2d7650){return db[_0x6ba9('0x31')][_0x6ba9('0x4e')]({'where':{'id':_0x37d0fe[_0x6ba9('0x4b')]['id']}})[_0x6ba9('0x2a')](handleEntityNotFound(_0x2d7650,null))['then'](removeEntity(_0x2d7650,null))[_0x6ba9('0x49')](handleError(_0x2d7650,null));};exports[_0x6ba9('0x52')]=function(_0x53845a,_0x9eebac){return db['SmsTransferReport'][_0x6ba9('0x52')]()[_0x6ba9('0x2a')](respondWithResult(_0x9eebac,null))[_0x6ba9('0x49')](handleError(_0x9eebac,null));}; \ No newline at end of file +var _0x1b1c=['undefined','limit','count','json','apply','reject','save','then','destroy','end','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x281757,_0xbea91c){var _0x5a3214=function(_0x1e81e4){while(--_0x1e81e4){_0x281757['push'](_0x281757['shift']());}};_0x5a3214(++_0xbea91c);}(_0x1b1c,0xbd));var _0xc1b1=function(_0x1a9504,_0x3c5149){_0x1a9504=_0x1a9504-0x0;var _0x6a8ed4=_0x1b1c[_0x1a9504];return _0x6a8ed4;};'use strict';var emlformat=require(_0xc1b1('0x0'));var rimraf=require(_0xc1b1('0x1'));var zipdir=require(_0xc1b1('0x2'));var jsonpatch=require(_0xc1b1('0x3'));var rp=require(_0xc1b1('0x4'));var moment=require(_0xc1b1('0x5'));var BPromise=require(_0xc1b1('0x6'));var Mustache=require(_0xc1b1('0x7'));var util=require(_0xc1b1('0x8'));var path=require(_0xc1b1('0x9'));var sox=require(_0xc1b1('0xa'));var csv=require(_0xc1b1('0xb'));var ejs=require(_0xc1b1('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1b1('0xd'));var squel=require(_0xc1b1('0xe'));var crypto=require(_0xc1b1('0xf'));var jsforce=require(_0xc1b1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1b1('0x11'));var Redis=require(_0xc1b1('0x12'));var authService=require(_0xc1b1('0x13'));var qs=require(_0xc1b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc1b1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1b1('0x16'));var db=require(_0xc1b1('0x17'))['db'];function respondWithStatusCode(_0x3fd85a,_0x141b15){_0x141b15=_0x141b15||0xcc;return function(_0x8c0dc0){if(_0x8c0dc0){return _0x3fd85a[_0xc1b1('0x18')](_0x141b15);}return _0x3fd85a['status'](_0x141b15)['end']();};}function respondWithResult(_0x5258de,_0x5a74ec){_0x5a74ec=_0x5a74ec||0xc8;return function(_0x4ef934){if(_0x4ef934){return _0x5258de[_0xc1b1('0x19')](_0x5a74ec)['json'](_0x4ef934);}};}function respondWithFilteredResult(_0x5d99bd,_0x36fc73){return function(_0x413bd9){if(_0x413bd9){var _0x134fc9=typeof _0x36fc73[_0xc1b1('0x1a')]===_0xc1b1('0x1b')&&typeof _0x36fc73[_0xc1b1('0x1c')]===_0xc1b1('0x1b');var _0xc5a66d=_0x413bd9[_0xc1b1('0x1d')];var _0x2c6a0f=_0x134fc9?0x0:_0x36fc73[_0xc1b1('0x1a')];var _0x12c5b2=_0x134fc9?_0x413bd9[_0xc1b1('0x1d')]:_0x36fc73['offset']+_0x36fc73[_0xc1b1('0x1c')];var _0x405ba1;if(_0x12c5b2>=_0xc5a66d){_0x12c5b2=_0xc5a66d;_0x405ba1=0xc8;}else{_0x405ba1=0xce;}_0x5d99bd[_0xc1b1('0x19')](_0x405ba1);return _0x5d99bd['set']('Content-Range',_0x2c6a0f+'-'+_0x12c5b2+'/'+_0xc5a66d)[_0xc1b1('0x1e')](_0x413bd9);}return null;};}function patchUpdates(_0x4750f7){return function(_0x3ab6bc){try{jsonpatch[_0xc1b1('0x1f')](_0x3ab6bc,_0x4750f7,!![]);}catch(_0x1d510f){return BPromise[_0xc1b1('0x20')](_0x1d510f);}return _0x3ab6bc[_0xc1b1('0x21')]();};}function saveUpdates(_0x1b1009,_0x5521e1){return function(_0x4291da){if(_0x4291da){return _0x4291da['update'](_0x1b1009)[_0xc1b1('0x22')](function(_0x57d0fc){return _0x57d0fc;});}return null;};}function removeEntity(_0x419670,_0x43056f){return function(_0x512fd5){if(_0x512fd5){return _0x512fd5[_0xc1b1('0x23')]()['then'](function(){_0x419670['status'](0xcc)[_0xc1b1('0x24')]();});}};}function handleEntityNotFound(_0x44e881,_0x2e6dda){return function(_0x345bcb){if(!_0x345bcb){_0x44e881[_0xc1b1('0x18')](0x194);}return _0x345bcb;};}function handleError(_0x98d092,_0x63e388){_0x63e388=_0x63e388||0x1f4;return function(_0x172267){logger[_0xc1b1('0x25')](_0x172267['stack']);if(_0x172267[_0xc1b1('0x26')]){delete _0x172267[_0xc1b1('0x26')];}_0x98d092['status'](_0x63e388)[_0xc1b1('0x27')](_0x172267);};}exports['index']=function(_0x53af8a,_0x2c280e){var _0x2dd4da={},_0x119c69={},_0x138939={'count':0x0,'rows':[]};var _0x36d594=_[_0xc1b1('0x28')](db[_0xc1b1('0x29')][_0xc1b1('0x2a')],function(_0x39c64a){return{'name':_0x39c64a[_0xc1b1('0x2b')],'type':_0x39c64a[_0xc1b1('0x2c')][_0xc1b1('0x2d')]};});_0x119c69[_0xc1b1('0x2e')]=_['map'](_0x36d594,_0xc1b1('0x26'));_0x119c69[_0xc1b1('0x2f')]=_[_0xc1b1('0x30')](_0x53af8a['query']);_0x119c69[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x119c69[_0xc1b1('0x2e')],_0x119c69[_0xc1b1('0x2f')]);_0x2dd4da[_0xc1b1('0x33')]=_['intersection'](_0x119c69[_0xc1b1('0x2e')],qs[_0xc1b1('0x34')](_0x53af8a[_0xc1b1('0x2f')]['fields']));_0x2dd4da[_0xc1b1('0x33')]=_0x2dd4da[_0xc1b1('0x33')][_0xc1b1('0x35')]?_0x2dd4da[_0xc1b1('0x33')]:_0x119c69[_0xc1b1('0x2e')];if(!_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x36')](_0xc1b1('0x37'))){_0x2dd4da[_0xc1b1('0x1c')]=qs[_0xc1b1('0x1c')](_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x1c')]);_0x2dd4da[_0xc1b1('0x1a')]=qs['offset'](_0x53af8a['query'][_0xc1b1('0x1a')]);}_0x2dd4da['order']=qs[_0xc1b1('0x38')](_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x38')]);_0x2dd4da[_0xc1b1('0x39')]=qs[_0xc1b1('0x31')](_[_0xc1b1('0x3a')](_0x53af8a[_0xc1b1('0x2f')],_0x119c69[_0xc1b1('0x31')]),_0x36d594);if(_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x3b')]){_0x2dd4da[_0xc1b1('0x39')]=_[_0xc1b1('0x3c')](_0x2dd4da['where'],{'$or':_['map'](_0x36d594,function(_0x231aa3){if(_0x231aa3[_0xc1b1('0x2c')]!==_0xc1b1('0x3d')){var _0x3bc46e={};_0x3bc46e[_0x231aa3[_0xc1b1('0x26')]]={'$like':'%'+_0x53af8a[_0xc1b1('0x2f')]['filter']+'%'};return _0x3bc46e;}})});}_0x2dd4da=_['merge']({},_0x2dd4da,_0x53af8a['options']);var _0x55d4c6={'where':_0x2dd4da[_0xc1b1('0x39')]};return db['SmsTransferReport'][_0xc1b1('0x1d')](_0x55d4c6)[_0xc1b1('0x22')](function(_0x1bf933){_0x138939[_0xc1b1('0x1d')]=_0x1bf933;if(_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x3e')]){_0x2dd4da[_0xc1b1('0x3f')]=[{'all':!![]}];}return db[_0xc1b1('0x29')]['findAll'](_0x2dd4da);})[_0xc1b1('0x22')](function(_0x14a744){_0x138939[_0xc1b1('0x40')]=_0x14a744;return _0x138939;})['then'](respondWithFilteredResult(_0x2c280e,_0x2dd4da))[_0xc1b1('0x41')](handleError(_0x2c280e,null));};exports['show']=function(_0x27d16f,_0x44097e){var _0x427d70={'raw':!![],'where':{'id':_0x27d16f[_0xc1b1('0x42')]['id']}},_0x19df90={};_0x19df90[_0xc1b1('0x2e')]=_['keys'](db[_0xc1b1('0x29')][_0xc1b1('0x2a')]);_0x19df90['query']=_['keys'](_0x27d16f[_0xc1b1('0x2f')]);_0x19df90[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x19df90[_0xc1b1('0x2e')],_0x19df90[_0xc1b1('0x2f')]);_0x427d70[_0xc1b1('0x33')]=_['intersection'](_0x19df90[_0xc1b1('0x2e')],qs[_0xc1b1('0x34')](_0x27d16f[_0xc1b1('0x2f')][_0xc1b1('0x34')]));_0x427d70[_0xc1b1('0x33')]=_0x427d70[_0xc1b1('0x33')]['length']?_0x427d70[_0xc1b1('0x33')]:_0x19df90[_0xc1b1('0x2e')];if(_0x27d16f['query'][_0xc1b1('0x3e')]){_0x427d70[_0xc1b1('0x3f')]=[{'all':!![]}];}_0x427d70=_[_0xc1b1('0x3c')]({},_0x427d70,_0x27d16f[_0xc1b1('0x43')]);return db[_0xc1b1('0x29')][_0xc1b1('0x44')](_0x427d70)[_0xc1b1('0x22')](handleEntityNotFound(_0x44097e,null))['then'](respondWithResult(_0x44097e,null))['catch'](handleError(_0x44097e,null));};exports[_0xc1b1('0x45')]=function(_0x3e404a,_0x2a6a6f){return db[_0xc1b1('0x29')][_0xc1b1('0x45')](_0x3e404a[_0xc1b1('0x46')],{})[_0xc1b1('0x22')](respondWithResult(_0x2a6a6f,0xc9))[_0xc1b1('0x41')](handleError(_0x2a6a6f,null));};exports[_0xc1b1('0x47')]=function(_0x396699,_0x28345d){if(_0x396699[_0xc1b1('0x46')]['id']){delete _0x396699[_0xc1b1('0x46')]['id'];}return db['SmsTransferReport'][_0xc1b1('0x44')]({'where':{'id':_0x396699[_0xc1b1('0x42')]['id']}})[_0xc1b1('0x22')](handleEntityNotFound(_0x28345d,null))[_0xc1b1('0x22')](saveUpdates(_0x396699['body'],null))[_0xc1b1('0x22')](respondWithResult(_0x28345d,null))[_0xc1b1('0x41')](handleError(_0x28345d,null));};exports[_0xc1b1('0x23')]=function(_0x2bb3f2,_0x5398c6){return db['SmsTransferReport'][_0xc1b1('0x44')]({'where':{'id':_0x2bb3f2[_0xc1b1('0x42')]['id']}})[_0xc1b1('0x22')](handleEntityNotFound(_0x5398c6,null))[_0xc1b1('0x22')](removeEntity(_0x5398c6,null))[_0xc1b1('0x41')](handleError(_0x5398c6,null));};exports['describe']=function(_0x4e6275,_0x3bc487){return db[_0xc1b1('0x29')]['describe']()[_0xc1b1('0x22')](respondWithResult(_0x3bc487,null))['catch'](handleError(_0x3bc487,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e2c5a53..1f93d95 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 _0xc5dd=['bluebird','request-promise','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc5dd,0x170));var _0xdc5d=function(_0x1963ac,_0x552b94){_0x1963ac=_0x1963ac-0x0;var _0x48a984=_0xc5dd[_0x1963ac];return _0x48a984;};'use strict';var _=require(_0xdc5d('0x0'));var util=require(_0xdc5d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdc5d('0x2'));var rp=require(_0xdc5d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc5d('0x4'));var attributes=require('./smsTransferReport.attributes');module[_0xdc5d('0x5')]=function(_0xd0bcd1,_0x240792){return _0xd0bcd1[_0xdc5d('0x6')](_0xdc5d('0x7'),attributes,{'tableName':_0xdc5d('0x8'),'paranoid':![],'indexes':[{'name':_0xdc5d('0x9'),'fields':[_0xdc5d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b68=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','lodash','util'];(function(_0x39dc44,_0x3ef280){var _0x1e7404=function(_0x12121f){while(--_0x12121f){_0x39dc44['push'](_0x39dc44['shift']());}};_0x1e7404(++_0x3ef280);}(_0x4b68,0x129));var _0x84b6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b68[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var logger=require(_0x84b6('0x2'))(_0x84b6('0x3'));var moment=require(_0x84b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x84b6('0x5'));var fs=require('fs');var path=require(_0x84b6('0x6'));var rimraf=require(_0x84b6('0x7'));var config=require(_0x84b6('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x84b6('0x9')]=function(_0x2a0007,_0x539956){return _0x2a0007[_0x84b6('0xa')]('SmsTransferReport',attributes,{'tableName':_0x84b6('0xb'),'paranoid':![],'indexes':[{'name':_0x84b6('0xc'),'fields':[_0x84b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 58c511a..0da7888 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 _0x165d=['request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http'];(function(_0x35e345,_0x7940f6){var _0xf68955=function(_0x51d7ea){while(--_0x51d7ea){_0x35e345['push'](_0x35e345['shift']());}};_0xf68955(++_0x7940f6);}(_0x165d,0x14a));var _0xd165=function(_0x9172a0,_0xda92fd){_0x9172a0=_0x9172a0-0x0;var _0x363a35=_0x165d[_0x9172a0];return _0x363a35;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var moment=require(_0xd165('0x2'));var BPromise=require(_0xd165('0x3'));var rs=require(_0xd165('0x4'));var fs=require('fs');var Redis=require(_0xd165('0x5'));var db=require(_0xd165('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd165('0x7'))(_0xd165('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2305bc,_0x4dccaa,_0x5eec53){return new BPromise(function(_0x3fd82e,_0x41a937){return client[_0xd165('0xa')](_0x2305bc,_0x5eec53)[_0xd165('0xb')](function(_0x3a29a0){logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,_0xd165('0xe'));logger['debug'](_0xd165('0xf'),_0x4dccaa,_0xd165('0xe'),JSON[_0xd165('0x10')](_0x3a29a0));if(_0x3a29a0['error']){if(_0x3a29a0[_0xd165('0x11')]['code']===0x1f4){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')][_0xd165('0x12')]);return _0x41a937(_0x3a29a0['error']['message']);}logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')]['message']);return _0x3fd82e(_0x3a29a0['error']['message']);}else{logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,'request\x20sent');_0x3fd82e(_0x3a29a0[_0xd165('0x13')][_0xd165('0x12')]);}})['catch'](function(_0x522b83){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x522b83);_0x41a937(_0x522b83);});});} \ No newline at end of file +var _0xd13e=['SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x399381,_0x51ccc4){var _0x324d90=function(_0x4aba7d){while(--_0x4aba7d){_0x399381['push'](_0x399381['shift']());}};_0x324d90(++_0x51ccc4);}(_0xd13e,0x193));var _0xed13=function(_0x1773a6,_0x5252ec){_0x1773a6=_0x1773a6-0x0;var _0x5efa0f=_0xd13e[_0x1773a6];return _0x5efa0f;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 63a28a3..7fc37f7 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 _0x8175=['get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','%s-%s%s','extname','post','single','create','put','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c3ef1,_0x4943bb){var _0x37d419=function(_0x50b3b7){while(--_0x50b3b7){_0x5c3ef1['push'](_0x5c3ef1['shift']());}};_0x37d419(++_0x4943bb);}(_0x8175,0x1cc));var _0x5817=function(_0xf7c93e,_0x586f4b){_0xf7c93e=_0xf7c93e-0x0;var _0x2e3b2a=_0x8175[_0xf7c93e];return _0x2e3b2a;};'use strict';var multer=require(_0x5817('0x0'));var util=require(_0x5817('0x1'));var path=require('path');var timeout=require(_0x5817('0x2'));var express=require(_0x5817('0x3'));var router=express['Router']();var fs_extra=require(_0x5817('0x4'));var auth=require(_0x5817('0x5'));var interaction=require(_0x5817('0x6'));var config=require(_0x5817('0x7'));var controller=require('./sound.controller');router[_0x5817('0x8')]('/',auth[_0x5817('0x9')](),controller[_0x5817('0xa')]);router['get'](_0x5817('0xb'),auth[_0x5817('0x9')](),controller[_0x5817('0xc')]);router[_0x5817('0x8')]('/:id/download',auth[_0x5817('0x9')](),controller[_0x5817('0xd')]);var upload=multer({'storage':multer[_0x5817('0xe')]({'destination':function(_0x4547de,_0x4279d1,_0x1cfae4){_0x1cfae4(null,path[_0x5817('0xf')](config[_0x5817('0x10')],_0x5817('0x11')));},'filename':function(_0x473464,_0x4eea2,_0x2f1d35){_0x4eea2[_0x5817('0x12')]=_0x4eea2[_0x5817('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f1d35(null,util['format'](_0x5817('0x13'),path['basename'](_0x4eea2[_0x5817('0x12')],path[_0x5817('0x14')](_0x4eea2[_0x5817('0x12')])),Date['now'](),path[_0x5817('0x14')](_0x4eea2[_0x5817('0x12')])));}})});router[_0x5817('0x15')]('/',upload[_0x5817('0x16')]('file'),controller[_0x5817('0x17')]);router[_0x5817('0x18')](_0x5817('0xb'),auth[_0x5817('0x9')](),controller['update']);router[_0x5817('0x19')]('/:id',auth[_0x5817('0x9')](),controller[_0x5817('0x19')]);module['exports']=router; \ No newline at end of file +var _0xb8e2=['../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x39c0df,_0x1c2556){var _0x1f216e=function(_0x59b89f){while(--_0x59b89f){_0x39c0df['push'](_0x39c0df['shift']());}};_0x1f216e(++_0x1c2556);}(_0xb8e2,0x9e));var _0x2b8e=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xb8e2[_0x113a6c];return _0x1ac632;};'use strict';var multer=require(_0x2b8e('0x0'));var util=require(_0x2b8e('0x1'));var path=require(_0x2b8e('0x2'));var timeout=require(_0x2b8e('0x3'));var express=require(_0x2b8e('0x4'));var router=express[_0x2b8e('0x5')]();var fs_extra=require(_0x2b8e('0x6'));var auth=require(_0x2b8e('0x7'));var interaction=require(_0x2b8e('0x8'));var config=require('../../config/environment');var controller=require(_0x2b8e('0x9'));router[_0x2b8e('0xa')]('/',auth[_0x2b8e('0xb')](),controller['index']);router['get'](_0x2b8e('0xc'),auth[_0x2b8e('0xb')](),controller[_0x2b8e('0xd')]);router[_0x2b8e('0xa')]('/:id/download',auth[_0x2b8e('0xb')](),controller[_0x2b8e('0xe')]);var upload=multer({'storage':multer[_0x2b8e('0xf')]({'destination':function(_0x268166,_0x2aedf6,_0x45c98a){_0x45c98a(null,path[_0x2b8e('0x10')](config[_0x2b8e('0x11')],_0x2b8e('0x12')));},'filename':function(_0x33d31e,_0x4d4c76,_0x565ea6){_0x4d4c76[_0x2b8e('0x13')]=_0x4d4c76[_0x2b8e('0x13')][_0x2b8e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x565ea6(null,util[_0x2b8e('0x15')](_0x2b8e('0x16'),path[_0x2b8e('0x17')](_0x4d4c76[_0x2b8e('0x13')],path['extname'](_0x4d4c76[_0x2b8e('0x13')])),Date[_0x2b8e('0x18')](),path['extname'](_0x4d4c76['originalname'])));}})});router[_0x2b8e('0x19')]('/',upload[_0x2b8e('0x1a')](_0x2b8e('0x1b')),controller[_0x2b8e('0x1c')]);router[_0x2b8e('0x1d')](_0x2b8e('0xc'),auth['isAuthenticated'](),controller[_0x2b8e('0x1e')]);router[_0x2b8e('0x1f')](_0x2b8e('0xc'),auth[_0x2b8e('0xb')](),controller[_0x2b8e('0x1f')]);module[_0x2b8e('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 31e8b7a..868f248 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 _0x38da=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x33df91,_0x565a62){var _0x12308f=function(_0x3b7e94){while(--_0x3b7e94){_0x33df91['push'](_0x33df91['shift']());}};_0x12308f(++_0x565a62);}(_0x38da,0x73));var _0xa38d=function(_0x4a2689,_0x314a16){_0x4a2689=_0x4a2689-0x0;var _0x463450=_0x38da[_0x4a2689];return _0x463450;};'use strict';var Sequelize=require(_0xa38d('0x0'));module[_0xa38d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa38d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa38d('0x3')]},'display_name':{'type':Sequelize[_0xa38d('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xa38d('0x4')]},'original_sampleCount':{'type':Sequelize[_0xa38d('0x5')]},'original_channelCount':{'type':Sequelize[_0xa38d('0x6')]},'original_bitRate':{'type':Sequelize[_0xa38d('0x5')]},'original_sampleRate':{'type':Sequelize[_0xa38d('0x6')]},'converted_format':{'type':Sequelize[_0xa38d('0x3')]},'converted_duration':{'type':Sequelize[_0xa38d('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa38d('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xa38d('0x6')]}}; \ No newline at end of file +var _0xdf37=['BIGINT','exports','STRING','name','FLOAT','INTEGER'];(function(_0x4d0698,_0x130f98){var _0x3c81ef=function(_0x2b3332){while(--_0x2b3332){_0x4d0698['push'](_0x4d0698['shift']());}};_0x3c81ef(++_0x130f98);}(_0xdf37,0xfd));var _0x7df3=function(_0x50dd33,_0x4c3ed9){_0x50dd33=_0x50dd33-0x0;var _0x31d32b=_0xdf37[_0x50dd33];return _0x31d32b;};'use strict';var Sequelize=require('sequelize');module[_0x7df3('0x0')]={'name':{'type':Sequelize[_0x7df3('0x1')],'unique':_0x7df3('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7df3('0x1')]},'display_name':{'type':Sequelize[_0x7df3('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x7df3('0x1')]},'original_format':{'type':Sequelize[_0x7df3('0x1')]},'original_duration':{'type':Sequelize[_0x7df3('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x7df3('0x4')]},'original_bitRate':{'type':Sequelize[_0x7df3('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x7df3('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x7df3('0x5')]},'converted_channelCount':{'type':Sequelize[_0x7df3('0x4')]},'converted_bitRate':{'type':Sequelize[_0x7df3('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x7df3('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d9532d6..eed747b 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 _0x5437=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','download','server/files/sounds/converted','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','unlinkSync','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','model','query','keys'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x5437,0xc4));var _0x7543=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x5437[_0x528575];return _0x3063b7;};'use strict';var emlformat=require(_0x7543('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7543('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7543('0x2'));var BPromise=require(_0x7543('0x3'));var Mustache=require(_0x7543('0x4'));var util=require(_0x7543('0x5'));var path=require(_0x7543('0x6'));var sox=require(_0x7543('0x7'));var csv=require('to-csv');var ejs=require(_0x7543('0x8'));var fs=require('fs');var fs_extra=require(_0x7543('0x9'));var _=require(_0x7543('0xa'));var squel=require(_0x7543('0xb'));var crypto=require(_0x7543('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7543('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7543('0xe'));var Papa=require('papaparse');var Redis=require(_0x7543('0xf'));var authService=require(_0x7543('0x10'));var qs=require(_0x7543('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7543('0x12'));var logger=require(_0x7543('0x13'))(_0x7543('0x14'));var utils=require(_0x7543('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7543('0x16'));var db=require(_0x7543('0x17'))['db'];function respondWithStatusCode(_0x5c1b41,_0x46387c){_0x46387c=_0x46387c||0xcc;return function(_0x2a8516){if(_0x2a8516){return _0x5c1b41[_0x7543('0x18')](_0x46387c);}return _0x5c1b41[_0x7543('0x19')](_0x46387c)[_0x7543('0x1a')]();};}function respondWithResult(_0x2d9f5c,_0x1e49fa){_0x1e49fa=_0x1e49fa||0xc8;return function(_0x21bc6a){if(_0x21bc6a){return _0x2d9f5c[_0x7543('0x19')](_0x1e49fa)[_0x7543('0x1b')](_0x21bc6a);}};}function respondWithFilteredResult(_0x27bd74,_0x4d7ab3){return function(_0xd8bc4){if(_0xd8bc4){var _0x3ca3e0=typeof _0x4d7ab3[_0x7543('0x1c')]===_0x7543('0x1d')&&typeof _0x4d7ab3[_0x7543('0x1e')]===_0x7543('0x1d');var _0x34374f=_0xd8bc4['count'];var _0x4ecc8f=_0x3ca3e0?0x0:_0x4d7ab3[_0x7543('0x1c')];var _0x22b0a8=_0x3ca3e0?_0xd8bc4[_0x7543('0x1f')]:_0x4d7ab3[_0x7543('0x1c')]+_0x4d7ab3[_0x7543('0x1e')];var _0x3f38ba;if(_0x22b0a8>=_0x34374f){_0x22b0a8=_0x34374f;_0x3f38ba=0xc8;}else{_0x3f38ba=0xce;}_0x27bd74['status'](_0x3f38ba);return _0x27bd74[_0x7543('0x20')](_0x7543('0x21'),_0x4ecc8f+'-'+_0x22b0a8+'/'+_0x34374f)['json'](_0xd8bc4);}return null;};}function patchUpdates(_0xa73033){return function(_0x30c140){try{jsonpatch[_0x7543('0x22')](_0x30c140,_0xa73033,!![]);}catch(_0x4d24b4){return BPromise[_0x7543('0x23')](_0x4d24b4);}return _0x30c140[_0x7543('0x24')]();};}function saveUpdates(_0x34ca04,_0x5a3c9c){return function(_0x338048){if(_0x338048){return _0x338048[_0x7543('0x25')](_0x34ca04)[_0x7543('0x26')](function(_0x22d5e9){return _0x22d5e9;});}return null;};}function removeEntity(_0x19b5b6,_0x2bde98){return function(_0x321661){if(_0x321661){return _0x321661[_0x7543('0x27')]()[_0x7543('0x26')](function(){var _0x13ac0a=_0x321661[_0x7543('0x28')]({'plain':!![]});var _0x22e5bd=_0x7543('0x29');return db['UserProfileResource'][_0x7543('0x27')]({'where':{'type':_0x22e5bd,'resourceId':_0x13ac0a['id']}})[_0x7543('0x26')](function(){return _0x321661;});})[_0x7543('0x26')](function(){_0x19b5b6[_0x7543('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff0d93,_0x1f7911){return function(_0x26c6e0){if(!_0x26c6e0){_0xff0d93[_0x7543('0x18')](0x194);}return _0x26c6e0;};}function handleError(_0x4d348d,_0x5525e2){_0x5525e2=_0x5525e2||0x1f4;return function(_0x4f7e98){logger[_0x7543('0x2a')](_0x4f7e98[_0x7543('0x2b')]);if(_0x4f7e98[_0x7543('0x2c')]){delete _0x4f7e98['name'];}_0x4d348d['status'](_0x5525e2)[_0x7543('0x2d')](_0x4f7e98);};}exports[_0x7543('0x2e')]=function(_0x56dfa2,_0x17deb3){var _0x43fb51={},_0x5b4f88={},_0x47a09a={'count':0x0,'rows':[]};var _0x16f107=_[_0x7543('0x2f')](db[_0x7543('0x30')][_0x7543('0x31')],function(_0x3a4488){return{'name':_0x3a4488[_0x7543('0x32')],'type':_0x3a4488['type']['key']};});_0x5b4f88[_0x7543('0x33')]=_[_0x7543('0x2f')](_0x16f107,_0x7543('0x2c'));_0x5b4f88[_0x7543('0x34')]=_[_0x7543('0x35')](_0x56dfa2[_0x7543('0x34')]);_0x5b4f88[_0x7543('0x36')]=_[_0x7543('0x37')](_0x5b4f88[_0x7543('0x33')],_0x5b4f88[_0x7543('0x34')]);_0x43fb51[_0x7543('0x38')]=_[_0x7543('0x37')](_0x5b4f88[_0x7543('0x33')],qs[_0x7543('0x39')](_0x56dfa2[_0x7543('0x34')][_0x7543('0x39')]));_0x43fb51[_0x7543('0x38')]=_0x43fb51[_0x7543('0x38')][_0x7543('0x3a')]?_0x43fb51[_0x7543('0x38')]:_0x5b4f88[_0x7543('0x33')];if(!_0x56dfa2[_0x7543('0x34')][_0x7543('0x3b')]('nolimit')){_0x43fb51[_0x7543('0x1e')]=qs[_0x7543('0x1e')](_0x56dfa2[_0x7543('0x34')]['limit']);_0x43fb51[_0x7543('0x1c')]=qs[_0x7543('0x1c')](_0x56dfa2[_0x7543('0x34')][_0x7543('0x1c')]);}_0x43fb51[_0x7543('0x3c')]=qs[_0x7543('0x3d')](_0x56dfa2[_0x7543('0x34')]['sort']);_0x43fb51[_0x7543('0x3e')]=qs[_0x7543('0x36')](_['pick'](_0x56dfa2[_0x7543('0x34')],_0x5b4f88[_0x7543('0x36')]),_0x16f107);if(_0x56dfa2[_0x7543('0x34')][_0x7543('0x3f')]){_0x43fb51[_0x7543('0x3e')]=_['merge'](_0x43fb51[_0x7543('0x3e')],{'$or':_['map'](_0x16f107,function(_0x3fe1c5){if(_0x3fe1c5['type']!==_0x7543('0x40')){var _0x15e669={};_0x15e669[_0x3fe1c5[_0x7543('0x2c')]]={'$like':'%'+_0x56dfa2[_0x7543('0x34')][_0x7543('0x3f')]+'%'};return _0x15e669;}})});}_0x43fb51=_['merge']({},_0x43fb51,_0x56dfa2[_0x7543('0x41')]);var _0x882b06={'where':_0x43fb51[_0x7543('0x3e')]};return db[_0x7543('0x30')][_0x7543('0x1f')](_0x882b06)[_0x7543('0x26')](function(_0x58ce9e){_0x47a09a[_0x7543('0x1f')]=_0x58ce9e;if(_0x56dfa2['query'][_0x7543('0x42')]){_0x43fb51['include']=[{'all':!![]}];}return db[_0x7543('0x30')][_0x7543('0x43')](_0x43fb51);})[_0x7543('0x26')](function(_0x5f432f){_0x47a09a[_0x7543('0x44')]=_0x5f432f;return _0x47a09a;})[_0x7543('0x26')](respondWithFilteredResult(_0x17deb3,_0x43fb51))['catch'](handleError(_0x17deb3,null));};exports[_0x7543('0x45')]=function(_0x33a241,_0x3b7abc){var _0xc91bb5={'raw':!![],'where':{'id':_0x33a241[_0x7543('0x46')]['id']}},_0x27acc0={};_0x27acc0[_0x7543('0x33')]=_['keys'](db['Sound']['rawAttributes']);_0x27acc0[_0x7543('0x34')]=_[_0x7543('0x35')](_0x33a241[_0x7543('0x34')]);_0x27acc0[_0x7543('0x36')]=_['intersection'](_0x27acc0['model'],_0x27acc0['query']);_0xc91bb5[_0x7543('0x38')]=_['intersection'](_0x27acc0[_0x7543('0x33')],qs[_0x7543('0x39')](_0x33a241[_0x7543('0x34')][_0x7543('0x39')]));_0xc91bb5[_0x7543('0x38')]=_0xc91bb5[_0x7543('0x38')][_0x7543('0x3a')]?_0xc91bb5[_0x7543('0x38')]:_0x27acc0[_0x7543('0x33')];if(_0x33a241[_0x7543('0x34')]['includeAll']){_0xc91bb5[_0x7543('0x47')]=[{'all':!![]}];}_0xc91bb5=_['merge']({},_0xc91bb5,_0x33a241['options']);return db[_0x7543('0x30')][_0x7543('0x48')](_0xc91bb5)['then'](handleEntityNotFound(_0x3b7abc,null))[_0x7543('0x26')](respondWithResult(_0x3b7abc,null))[_0x7543('0x49')](handleError(_0x3b7abc,null));};exports['download']=function(_0x56cbca,_0x3e7f94,_0x1d1054){return db[_0x7543('0x30')][_0x7543('0x48')]({'where':{'id':_0x56cbca[_0x7543('0x46')]['id']},'attributes':[_0x7543('0x2c'),_0x7543('0x4a'),_0x7543('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3e7f94,null))[_0x7543('0x26')](function(_0x444dd4){if(_0x444dd4){if(!fs[_0x7543('0x4c')](path[_0x7543('0x4d')](config[_0x7543('0x4e')],'server/files/sounds/converted',_0x444dd4[_0x7543('0x4a')]+'.'+_0x444dd4[_0x7543('0x4b')]))){throw new db[(_0x7543('0x4f'))][(_0x7543('0x50'))](_0x7543('0x51'));}return _0x3e7f94[_0x7543('0x52')](path[_0x7543('0x4d')](config[_0x7543('0x4e')],_0x7543('0x53'),util[_0x7543('0x54')](_0x7543('0x55'),_0x444dd4['save_name'],_0x444dd4['converted_format'])),util[_0x7543('0x54')]('%s.%s',_0x444dd4['name'],_0x444dd4[_0x7543('0x4b')]));}return null;})[_0x7543('0x49')](handleError(_0x3e7f94,null));};exports[_0x7543('0x56')]=function(_0x2833f9,_0x102685,_0x25cd1b){var _0x54056c={'name':path['basename'](_0x2833f9[_0x7543('0x57')][_0x7543('0x58')],path[_0x7543('0x59')](_0x2833f9[_0x7543('0x57')][_0x7543('0x58')])),'save_name':path[_0x7543('0x5a')](_0x2833f9['file'][_0x7543('0x5b')],path[_0x7543('0x59')](_0x2833f9['file'][_0x7543('0x5b')])),'original_format':path[_0x7543('0x59')](_0x2833f9[_0x7543('0x57')][_0x7543('0x58')])[_0x7543('0x5c')](0x1),'converted_format':_0x7543('0x5d')};var _0x169f76=path[_0x7543('0x4d')](config[_0x7543('0x4e')],_0x7543('0x5e'),_0x2833f9['file']['filename']);var _0x16f1ea=path[_0x7543('0x4d')](config[_0x7543('0x4e')],'server/files/sounds/converted',util[_0x7543('0x54')](_0x7543('0x55'),path[_0x7543('0x5a')](_0x2833f9[_0x7543('0x57')][_0x7543('0x5b')],path[_0x7543('0x59')](_0x2833f9[_0x7543('0x57')][_0x7543('0x5b')])),_0x54056c[_0x7543('0x4b')]));logger[_0x7543('0x5f')](_0x7543('0x60'),_0x169f76);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x16f1ea);try{fs['chmodSync'](_0x169f76,parseInt(_0x7543('0x61'),0x8));var _0x1b0378=sox[_0x7543('0x62')](_0x169f76,_0x16f1ea,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b0378['on']('error',function(_0x261399){fs['unlinkSync'](_0x169f76);_0x102685[_0x7543('0x19')](0x1f4)[_0x7543('0x2d')](_0x261399);});_0x1b0378['on'](_0x7543('0x63'),function(_0x45f0f4){_0x54056c['original_duration']=isNaN(_0x45f0f4[_0x7543('0x64')])?null:_0x45f0f4[_0x7543('0x64')]*0x3e8;_0x54056c[_0x7543('0x65')]=isNaN(_0x45f0f4[_0x7543('0x66')])?null:_0x45f0f4['sampleCount'];_0x54056c[_0x7543('0x67')]=isNaN(_0x45f0f4[_0x7543('0x68')])?null:_0x45f0f4['channelCount'];_0x54056c[_0x7543('0x69')]=isNaN(_0x45f0f4[_0x7543('0x6a')])?null:_0x45f0f4[_0x7543('0x6a')];_0x54056c[_0x7543('0x6b')]=isNaN(_0x45f0f4['sampleRate'])?null:_0x45f0f4[_0x7543('0x6c')];});_0x1b0378['on'](_0x7543('0x6d'),function(_0x24a4f7){_0x54056c[_0x7543('0x6e')]=isNaN(_0x24a4f7[_0x7543('0x64')])?null:_0x24a4f7['duration']*0x3e8;_0x54056c[_0x7543('0x6f')]=isNaN(_0x24a4f7[_0x7543('0x66')])?null:_0x24a4f7[_0x7543('0x66')];_0x54056c['converted_channelCount']=isNaN(_0x24a4f7[_0x7543('0x68')])?null:_0x24a4f7[_0x7543('0x68')];_0x54056c[_0x7543('0x70')]=isNaN(_0x24a4f7[_0x7543('0x6a')])?null:_0x24a4f7[_0x7543('0x6a')];_0x54056c[_0x7543('0x71')]=isNaN(_0x24a4f7[_0x7543('0x6c')])?null:_0x24a4f7[_0x7543('0x6c')];});_0x1b0378['on'](_0x7543('0x1a'),function(){fs[_0x7543('0x72')](_0x16f1ea,parseInt(_0x7543('0x61'),0x8));return db[_0x7543('0x30')]['create'](_0x54056c)['then'](function(_0x487aa1){var _0x174878={'role':_0x2833f9[_0x7543('0x73')]['role'],'userProfileId':_0x2833f9[_0x7543('0x73')][_0x7543('0x74')]};if(!_0x174878)throw new Error(_0x7543('0x75'));if(_0x174878['role']===_0x7543('0x76')){var _0x18015d=_0x487aa1[_0x7543('0x28')]({'plain':!![]});return db[_0x7543('0x77')]['find']({'where':{'name':_0x7543('0x29'),'userProfileId':_0x174878[_0x7543('0x74')]},'raw':!![]})[_0x7543('0x26')](function(_0x48caa6){if(_0x48caa6&&_0x48caa6[_0x7543('0x78')]===0x0){return db[_0x7543('0x79')]['create']({'name':_0x18015d[_0x7543('0x2c')],'resourceId':_0x18015d['id'],'type':_0x48caa6[_0x7543('0x2c')],'sectionId':_0x48caa6['id']},{})[_0x7543('0x26')](function(){return _0x487aa1;});}else{return _0x487aa1;}})[_0x7543('0x49')](function(_0x40c4ed){logger[_0x7543('0x2a')](_0x7543('0x7a'),_0x40c4ed);throw _0x40c4ed;});}return _0x487aa1;})['then'](respondWithResult(_0x102685,null))['catch'](handleError(_0x102685,null));});_0x1b0378[_0x7543('0x7b')]();}catch(_0x500e24){_0x102685[_0x7543('0x19')](0x1f4)[_0x7543('0x2d')](_0x500e24);}};exports[_0x7543('0x25')]=function(_0x3e7f1b,_0x327412,_0x59e6e8){return db[_0x7543('0x30')][_0x7543('0x48')]({'where':{'id':_0x3e7f1b[_0x7543('0x46')]['id']}})[_0x7543('0x26')](handleEntityNotFound(_0x327412,null))[_0x7543('0x26')](saveUpdates(_['pick'](_0x3e7f1b['body'],[_0x7543('0x2c'),'description']),null))[_0x7543('0x26')](respondWithResult(_0x327412,null))[_0x7543('0x49')](handleError(_0x327412,null));};exports['delete']=function(_0x23ada9,_0x7831f8,_0x3ffb5a){return db[_0x7543('0x30')]['find']({'where':{'id':_0x23ada9[_0x7543('0x46')]['id']}})[_0x7543('0x26')](function(_0x40e32f){if(_0x40e32f){return _0x40e32f[_0x7543('0x27')]();}})['then'](function(_0x26fb1d){var _0x3c8cc9=path[_0x7543('0x4d')](config[_0x7543('0x4e')],_0x7543('0x5e'),util[_0x7543('0x54')](_0x7543('0x55'),_0x26fb1d[_0x7543('0x4a')],_0x26fb1d['original_format']));var _0x19d09b=path[_0x7543('0x4d')](config[_0x7543('0x4e')],_0x7543('0x53'),util[_0x7543('0x54')](_0x7543('0x55'),_0x26fb1d[_0x7543('0x4a')],_0x26fb1d[_0x7543('0x4b')]));fs[_0x7543('0x7c')](_0x3c8cc9);fs[_0x7543('0x7c')](_0x19d09b);return _0x26fb1d;})[_0x7543('0x26')](function(_0x500c48){if(_0x500c48){return _0x7831f8[_0x7543('0x19')](0xcc)[_0x7543('0x1a')]();}})['then'](handleEntityNotFound(_0x7831f8,null))[_0x7543('0x49')](handleError(_0x7831f8,null));}; \ No newline at end of file +var _0x8f32=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','Sound','rows','catch','params','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','originalname','file','filename','extname','wav','server/files/sounds/original','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','start','pick','description','original_format','eml-format','rimraf'];(function(_0x304207,_0x3ba39d){var _0x6b7cbf=function(_0x28e460){while(--_0x28e460){_0x304207['push'](_0x304207['shift']());}};_0x6b7cbf(++_0x3ba39d);}(_0x8f32,0xfa));var _0x28f3=function(_0x5c2b1e,_0x310ba2){_0x5c2b1e=_0x5c2b1e-0x0;var _0x5ea165=_0x8f32[_0x5c2b1e];return _0x5ea165;};'use strict';var emlformat=require(_0x28f3('0x0'));var rimraf=require(_0x28f3('0x1'));var zipdir=require(_0x28f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28f3('0x3'));var moment=require(_0x28f3('0x4'));var BPromise=require(_0x28f3('0x5'));var Mustache=require(_0x28f3('0x6'));var util=require(_0x28f3('0x7'));var path=require(_0x28f3('0x8'));var sox=require(_0x28f3('0x9'));var csv=require(_0x28f3('0xa'));var ejs=require(_0x28f3('0xb'));var fs=require('fs');var fs_extra=require(_0x28f3('0xc'));var _=require(_0x28f3('0xd'));var squel=require(_0x28f3('0xe'));var crypto=require(_0x28f3('0xf'));var jsforce=require(_0x28f3('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28f3('0x11'));var Papa=require(_0x28f3('0x12'));var Redis=require(_0x28f3('0x13'));var authService=require(_0x28f3('0x14'));var qs=require(_0x28f3('0x15'));var as=require(_0x28f3('0x16'));var hardwareService=require(_0x28f3('0x17'));var logger=require(_0x28f3('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x28f3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x28f3('0x1a'))['db'];function respondWithStatusCode(_0x19e621,_0x48e172){_0x48e172=_0x48e172||0xcc;return function(_0x4ed6ea){if(_0x4ed6ea){return _0x19e621[_0x28f3('0x1b')](_0x48e172);}return _0x19e621[_0x28f3('0x1c')](_0x48e172)[_0x28f3('0x1d')]();};}function respondWithResult(_0x59c50c,_0x388a9f){_0x388a9f=_0x388a9f||0xc8;return function(_0x5735af){if(_0x5735af){return _0x59c50c[_0x28f3('0x1c')](_0x388a9f)[_0x28f3('0x1e')](_0x5735af);}};}function respondWithFilteredResult(_0x508b0a,_0x5649e8){return function(_0x2be275){if(_0x2be275){var _0x2399ea=typeof _0x5649e8[_0x28f3('0x1f')]===_0x28f3('0x20')&&typeof _0x5649e8['limit']==='undefined';var _0xe6574f=_0x2be275[_0x28f3('0x21')];var _0x5673b2=_0x2399ea?0x0:_0x5649e8[_0x28f3('0x1f')];var _0x118ad6=_0x2399ea?_0x2be275[_0x28f3('0x21')]:_0x5649e8['offset']+_0x5649e8[_0x28f3('0x22')];var _0x422d4b;if(_0x118ad6>=_0xe6574f){_0x118ad6=_0xe6574f;_0x422d4b=0xc8;}else{_0x422d4b=0xce;}_0x508b0a['status'](_0x422d4b);return _0x508b0a[_0x28f3('0x23')](_0x28f3('0x24'),_0x5673b2+'-'+_0x118ad6+'/'+_0xe6574f)[_0x28f3('0x1e')](_0x2be275);}return null;};}function patchUpdates(_0x160c25){return function(_0x377960){try{jsonpatch[_0x28f3('0x25')](_0x377960,_0x160c25,!![]);}catch(_0x4dce6f){return BPromise[_0x28f3('0x26')](_0x4dce6f);}return _0x377960['save']();};}function saveUpdates(_0x466d02,_0x23f4ef){return function(_0x45e3cc){if(_0x45e3cc){return _0x45e3cc[_0x28f3('0x27')](_0x466d02)[_0x28f3('0x28')](function(_0x189c76){return _0x189c76;});}return null;};}function removeEntity(_0x206bdb,_0x47969f){return function(_0x54302d){if(_0x54302d){return _0x54302d[_0x28f3('0x29')]()[_0x28f3('0x28')](function(){var _0x2fd26a=_0x54302d[_0x28f3('0x2a')]({'plain':!![]});var _0x2fd553=_0x28f3('0x2b');return db[_0x28f3('0x2c')][_0x28f3('0x29')]({'where':{'type':_0x2fd553,'resourceId':_0x2fd26a['id']}})[_0x28f3('0x28')](function(){return _0x54302d;});})[_0x28f3('0x28')](function(){_0x206bdb[_0x28f3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188bc0,_0x2dfab0){return function(_0x3d4662){if(!_0x3d4662){_0x188bc0[_0x28f3('0x1b')](0x194);}return _0x3d4662;};}function handleError(_0x3b788e,_0x5738a4){_0x5738a4=_0x5738a4||0x1f4;return function(_0x152f8b){logger[_0x28f3('0x2d')](_0x152f8b[_0x28f3('0x2e')]);if(_0x152f8b[_0x28f3('0x2f')]){delete _0x152f8b[_0x28f3('0x2f')];}_0x3b788e[_0x28f3('0x1c')](_0x5738a4)['send'](_0x152f8b);};}exports[_0x28f3('0x30')]=function(_0x3aa6b2,_0xb20a60){var _0x55f254={},_0x739b90={},_0x2a0a41={'count':0x0,'rows':[]};var _0x1c97b1=_[_0x28f3('0x31')](db['Sound'][_0x28f3('0x32')],function(_0x47c8d7){return{'name':_0x47c8d7['fieldName'],'type':_0x47c8d7[_0x28f3('0x33')][_0x28f3('0x34')]};});_0x739b90[_0x28f3('0x35')]=_['map'](_0x1c97b1,_0x28f3('0x2f'));_0x739b90[_0x28f3('0x36')]=_[_0x28f3('0x37')](_0x3aa6b2[_0x28f3('0x36')]);_0x739b90[_0x28f3('0x38')]=_[_0x28f3('0x39')](_0x739b90[_0x28f3('0x35')],_0x739b90['query']);_0x55f254[_0x28f3('0x3a')]=_[_0x28f3('0x39')](_0x739b90['model'],qs[_0x28f3('0x3b')](_0x3aa6b2['query'][_0x28f3('0x3b')]));_0x55f254['attributes']=_0x55f254[_0x28f3('0x3a')][_0x28f3('0x3c')]?_0x55f254[_0x28f3('0x3a')]:_0x739b90[_0x28f3('0x35')];if(!_0x3aa6b2['query'][_0x28f3('0x3d')]('nolimit')){_0x55f254['limit']=qs[_0x28f3('0x22')](_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x22')]);_0x55f254[_0x28f3('0x1f')]=qs[_0x28f3('0x1f')](_0x3aa6b2['query']['offset']);}_0x55f254[_0x28f3('0x3e')]=qs[_0x28f3('0x3f')](_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x3f')]);_0x55f254[_0x28f3('0x40')]=qs[_0x28f3('0x38')](_['pick'](_0x3aa6b2['query'],_0x739b90[_0x28f3('0x38')]),_0x1c97b1);if(_0x3aa6b2[_0x28f3('0x36')]['filter']){_0x55f254[_0x28f3('0x40')]=_[_0x28f3('0x41')](_0x55f254[_0x28f3('0x40')],{'$or':_[_0x28f3('0x31')](_0x1c97b1,function(_0x4c3421){if(_0x4c3421[_0x28f3('0x33')]!==_0x28f3('0x42')){var _0xd1be17={};_0xd1be17[_0x4c3421['name']]={'$like':'%'+_0x3aa6b2['query']['filter']+'%'};return _0xd1be17;}})});}_0x55f254=_[_0x28f3('0x41')]({},_0x55f254,_0x3aa6b2[_0x28f3('0x43')]);var _0x275be1={'where':_0x55f254['where']};return db['Sound'][_0x28f3('0x21')](_0x275be1)[_0x28f3('0x28')](function(_0x5a4942){_0x2a0a41[_0x28f3('0x21')]=_0x5a4942;if(_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x44')]){_0x55f254[_0x28f3('0x45')]=[{'all':!![]}];}return db[_0x28f3('0x46')]['findAll'](_0x55f254);})['then'](function(_0x480a9c){_0x2a0a41[_0x28f3('0x47')]=_0x480a9c;return _0x2a0a41;})['then'](respondWithFilteredResult(_0xb20a60,_0x55f254))[_0x28f3('0x48')](handleError(_0xb20a60,null));};exports['show']=function(_0x153275,_0x5268ee){var _0xc64a37={'raw':!![],'where':{'id':_0x153275[_0x28f3('0x49')]['id']}},_0x2be482={};_0x2be482[_0x28f3('0x35')]=_[_0x28f3('0x37')](db['Sound'][_0x28f3('0x32')]);_0x2be482['query']=_['keys'](_0x153275['query']);_0x2be482[_0x28f3('0x38')]=_['intersection'](_0x2be482[_0x28f3('0x35')],_0x2be482[_0x28f3('0x36')]);_0xc64a37[_0x28f3('0x3a')]=_[_0x28f3('0x39')](_0x2be482['model'],qs['fields'](_0x153275[_0x28f3('0x36')]['fields']));_0xc64a37['attributes']=_0xc64a37[_0x28f3('0x3a')]['length']?_0xc64a37['attributes']:_0x2be482['model'];if(_0x153275[_0x28f3('0x36')][_0x28f3('0x44')]){_0xc64a37['include']=[{'all':!![]}];}_0xc64a37=_[_0x28f3('0x41')]({},_0xc64a37,_0x153275['options']);return db[_0x28f3('0x46')][_0x28f3('0x4a')](_0xc64a37)[_0x28f3('0x28')](handleEntityNotFound(_0x5268ee,null))[_0x28f3('0x28')](respondWithResult(_0x5268ee,null))[_0x28f3('0x48')](handleError(_0x5268ee,null));};exports[_0x28f3('0x4b')]=function(_0x1d0265,_0x2ef0b0,_0x3b70f8){return db[_0x28f3('0x46')][_0x28f3('0x4a')]({'where':{'id':_0x1d0265['params']['id']},'attributes':[_0x28f3('0x2f'),'save_name',_0x28f3('0x4c')],'raw':!![]})[_0x28f3('0x28')](handleEntityNotFound(_0x2ef0b0,null))[_0x28f3('0x28')](function(_0x580fa3){if(_0x580fa3){if(!fs[_0x28f3('0x4d')](path[_0x28f3('0x4e')](config[_0x28f3('0x4f')],_0x28f3('0x50'),_0x580fa3[_0x28f3('0x51')]+'.'+_0x580fa3[_0x28f3('0x4c')]))){throw new db[(_0x28f3('0x52'))][(_0x28f3('0x53'))](_0x28f3('0x54'));}return _0x2ef0b0['download'](path[_0x28f3('0x4e')](config['root'],'server/files/sounds/converted',util[_0x28f3('0x55')]('%s.%s',_0x580fa3['save_name'],_0x580fa3[_0x28f3('0x4c')])),util['format'](_0x28f3('0x56'),_0x580fa3[_0x28f3('0x2f')],_0x580fa3[_0x28f3('0x4c')]));}return null;})[_0x28f3('0x48')](handleError(_0x2ef0b0,null));};exports['create']=function(_0x15ae27,_0x1522ef,_0xb41b2c){var _0x1268ad={'name':path['basename'](_0x15ae27['file'][_0x28f3('0x57')],path['extname'](_0x15ae27['file'][_0x28f3('0x57')])),'save_name':path['basename'](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')],path[_0x28f3('0x5a')](_0x15ae27['file']['filename'])),'original_format':path[_0x28f3('0x5a')](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x57')])['substring'](0x1),'converted_format':_0x28f3('0x5b')};var _0x1440c1=path['join'](config[_0x28f3('0x4f')],_0x28f3('0x5c'),_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')]);var _0x5932f3=path[_0x28f3('0x4e')](config[_0x28f3('0x4f')],_0x28f3('0x50'),util['format']('%s.%s',path[_0x28f3('0x5d')](_0x15ae27[_0x28f3('0x58')]['filename'],path[_0x28f3('0x5a')](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')])),_0x1268ad[_0x28f3('0x4c')]));logger[_0x28f3('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x1440c1);logger[_0x28f3('0x5e')](_0x28f3('0x5f'),_0x5932f3);try{fs[_0x28f3('0x60')](_0x1440c1,parseInt(_0x28f3('0x61'),0x8));var _0x85b0b4=sox['transcode'](_0x1440c1,_0x5932f3,{'sampleRate':0x1f40,'format':_0x28f3('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x85b0b4['on'](_0x28f3('0x2d'),function(_0x323cf8){fs[_0x28f3('0x62')](_0x1440c1);_0x1522ef[_0x28f3('0x1c')](0x1f4)[_0x28f3('0x63')](_0x323cf8);});_0x85b0b4['on'](_0x28f3('0x64'),function(_0xeb01c3){_0x1268ad[_0x28f3('0x65')]=isNaN(_0xeb01c3[_0x28f3('0x66')])?null:_0xeb01c3[_0x28f3('0x66')]*0x3e8;_0x1268ad['original_sampleCount']=isNaN(_0xeb01c3[_0x28f3('0x67')])?null:_0xeb01c3[_0x28f3('0x67')];_0x1268ad[_0x28f3('0x68')]=isNaN(_0xeb01c3['channelCount'])?null:_0xeb01c3[_0x28f3('0x69')];_0x1268ad['original_bitRate']=isNaN(_0xeb01c3[_0x28f3('0x6a')])?null:_0xeb01c3[_0x28f3('0x6a')];_0x1268ad['original_sampleRate']=isNaN(_0xeb01c3['sampleRate'])?null:_0xeb01c3[_0x28f3('0x6b')];});_0x85b0b4['on'](_0x28f3('0x6c'),function(_0x567f33){_0x1268ad[_0x28f3('0x6d')]=isNaN(_0x567f33['duration'])?null:_0x567f33[_0x28f3('0x66')]*0x3e8;_0x1268ad[_0x28f3('0x6e')]=isNaN(_0x567f33[_0x28f3('0x67')])?null:_0x567f33[_0x28f3('0x67')];_0x1268ad[_0x28f3('0x6f')]=isNaN(_0x567f33[_0x28f3('0x69')])?null:_0x567f33[_0x28f3('0x69')];_0x1268ad[_0x28f3('0x70')]=isNaN(_0x567f33['bitRate'])?null:_0x567f33['bitRate'];_0x1268ad[_0x28f3('0x71')]=isNaN(_0x567f33[_0x28f3('0x6b')])?null:_0x567f33[_0x28f3('0x6b')];});_0x85b0b4['on'](_0x28f3('0x1d'),function(){fs[_0x28f3('0x60')](_0x5932f3,parseInt(_0x28f3('0x61'),0x8));return db[_0x28f3('0x46')][_0x28f3('0x72')](_0x1268ad)[_0x28f3('0x28')](function(_0xbd142b){var _0xf3fe95={'role':_0x15ae27['body']['role'],'userProfileId':_0x15ae27[_0x28f3('0x73')][_0x28f3('0x74')]};if(!_0xf3fe95)throw new Error(_0x28f3('0x75'));if(_0xf3fe95[_0x28f3('0x76')]===_0x28f3('0x77')){var _0x3f47a8=_0xbd142b['get']({'plain':!![]});return db[_0x28f3('0x78')][_0x28f3('0x4a')]({'where':{'name':_0x28f3('0x2b'),'userProfileId':_0xf3fe95['userProfileId']},'raw':!![]})['then'](function(_0x4f9cd4){if(_0x4f9cd4&&_0x4f9cd4[_0x28f3('0x79')]===0x0){return db[_0x28f3('0x2c')]['create']({'name':_0x3f47a8[_0x28f3('0x2f')],'resourceId':_0x3f47a8['id'],'type':_0x4f9cd4[_0x28f3('0x2f')],'sectionId':_0x4f9cd4['id']},{})[_0x28f3('0x28')](function(){return _0xbd142b;});}else{return _0xbd142b;}})[_0x28f3('0x48')](function(_0x2af646){logger[_0x28f3('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2af646);throw _0x2af646;});}return _0xbd142b;})[_0x28f3('0x28')](respondWithResult(_0x1522ef,null))[_0x28f3('0x48')](handleError(_0x1522ef,null));});_0x85b0b4[_0x28f3('0x7a')]();}catch(_0x567ec0){_0x1522ef[_0x28f3('0x1c')](0x1f4)[_0x28f3('0x63')](_0x567ec0);}};exports['update']=function(_0x19971d,_0x4e8e1c,_0x15d173){return db[_0x28f3('0x46')]['find']({'where':{'id':_0x19971d[_0x28f3('0x49')]['id']}})[_0x28f3('0x28')](handleEntityNotFound(_0x4e8e1c,null))[_0x28f3('0x28')](saveUpdates(_[_0x28f3('0x7b')](_0x19971d[_0x28f3('0x73')],['name',_0x28f3('0x7c')]),null))[_0x28f3('0x28')](respondWithResult(_0x4e8e1c,null))[_0x28f3('0x48')](handleError(_0x4e8e1c,null));};exports['delete']=function(_0x55af59,_0x428fa9,_0x239155){return db[_0x28f3('0x46')][_0x28f3('0x4a')]({'where':{'id':_0x55af59[_0x28f3('0x49')]['id']}})[_0x28f3('0x28')](function(_0xdba4fb){if(_0xdba4fb){return _0xdba4fb[_0x28f3('0x29')]();}})[_0x28f3('0x28')](function(_0x173d91){var _0x2283c3=path[_0x28f3('0x4e')](config['root'],'server/files/sounds/original',util[_0x28f3('0x55')]('%s.%s',_0x173d91[_0x28f3('0x51')],_0x173d91[_0x28f3('0x7d')]));var _0x5f5518=path['join'](config[_0x28f3('0x4f')],_0x28f3('0x50'),util[_0x28f3('0x55')](_0x28f3('0x56'),_0x173d91[_0x28f3('0x51')],_0x173d91[_0x28f3('0x4c')]));fs[_0x28f3('0x62')](_0x2283c3);fs[_0x28f3('0x62')](_0x5f5518);return _0x173d91;})[_0x28f3('0x28')](function(_0x4e5e40){if(_0x4e5e40){return _0x428fa9[_0x28f3('0x1c')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x428fa9,null))[_0x28f3('0x48')](handleError(_0x428fa9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f860dd5..b51013d 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 _0x0bd6=['tools_sounds','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define'];(function(_0x5b6185,_0x120b18){var _0x4708be=function(_0x3983f6){while(--_0x3983f6){_0x5b6185['push'](_0x5b6185['shift']());}};_0x4708be(++_0x120b18);}(_0x0bd6,0xe8));var _0x60bd=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0bd6[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x60bd('0x0'));var util=require('util');var logger=require(_0x60bd('0x1'))('api');var moment=require(_0x60bd('0x2'));var BPromise=require(_0x60bd('0x3'));var rp=require(_0x60bd('0x4'));var fs=require('fs');var path=require(_0x60bd('0x5'));var rimraf=require('rimraf');var config=require(_0x60bd('0x6'));var attributes=require(_0x60bd('0x7'));module[_0x60bd('0x8')]=function(_0x538ac4,_0x5224c7){return _0x538ac4[_0x60bd('0x9')]('Sound',attributes,{'tableName':_0x60bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd9d=['../../config/logger','api','moment','bluebird','path','exports','define','Sound','tools_sounds','lodash','util'];(function(_0x5b166e,_0xb1c1cd){var _0x2805b1=function(_0x34f8d8){while(--_0x34f8d8){_0x5b166e['push'](_0x5b166e['shift']());}};_0x2805b1(++_0xb1c1cd);}(_0xfd9d,0xa3));var _0xdfd9=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0xfd9d[_0x3fe393];return _0x534d14;};'use strict';var _=require(_0xdfd9('0x0'));var util=require(_0xdfd9('0x1'));var logger=require(_0xdfd9('0x2'))(_0xdfd9('0x3'));var moment=require(_0xdfd9('0x4'));var BPromise=require(_0xdfd9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfd9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xdfd9('0x7')]=function(_0xd4432a,_0x1f4cbb){return _0xd4432a[_0xdfd9('0x8')](_0xdfd9('0x9'),attributes,{'tableName':_0xdfd9('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 00673a0..51b2d22 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 _0x7ac3=['catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7ac3,0x191));var _0x37ac=function(_0x26f85a,_0x462a12){_0x26f85a=_0x26f85a-0x0;var _0x3d3bed=_0x7ac3[_0x26f85a];return _0x3d3bed;};'use strict';var _=require(_0x37ac('0x0'));var util=require(_0x37ac('0x1'));var moment=require('moment');var BPromise=require(_0x37ac('0x2'));var rs=require(_0x37ac('0x3'));var fs=require('fs');var Redis=require(_0x37ac('0x4'));var db=require(_0x37ac('0x5'))['db'];var utils=require(_0x37ac('0x6'));var logger=require(_0x37ac('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x37ac('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x563cce,_0x1b0199,_0x5cb7f6){return new BPromise(function(_0x25f7af,_0x424068){return client['request'](_0x563cce,_0x5cb7f6)[_0x37ac('0x9')](function(_0x45de84){logger[_0x37ac('0xa')](_0x37ac('0xb'),_0x1b0199,_0x37ac('0xc'));logger['debug'](_0x37ac('0xd'),_0x1b0199,_0x37ac('0xc'),JSON[_0x37ac('0xe')](_0x45de84));if(_0x45de84[_0x37ac('0xf')]){if(_0x45de84[_0x37ac('0xf')][_0x37ac('0x10')]===0x1f4){logger[_0x37ac('0xf')](_0x37ac('0xb'),_0x1b0199,_0x45de84[_0x37ac('0xf')][_0x37ac('0x11')]);return _0x424068(_0x45de84[_0x37ac('0xf')]['message']);}logger[_0x37ac('0xf')](_0x37ac('0xb'),_0x1b0199,_0x45de84[_0x37ac('0xf')][_0x37ac('0x11')]);return _0x25f7af(_0x45de84[_0x37ac('0xf')]['message']);}else{logger[_0x37ac('0xa')]('Sound,\x20%s,\x20%s',_0x1b0199,_0x37ac('0xc'));_0x25f7af(_0x45de84[_0x37ac('0x12')][_0x37ac('0x11')]);}})[_0x37ac('0x13')](function(_0x788519){logger[_0x37ac('0xf')](_0x37ac('0xb'),_0x1b0199,_0x788519);_0x424068(_0x788519);});});}exports[_0x37ac('0x14')]=function(_0x2c0e1e){var _0x5a9c12=this;return new Promise(function(_0x58bc98,_0xad2c8d){return db[_0x37ac('0x15')][_0x37ac('0x16')]({'raw':_0x2c0e1e[_0x37ac('0x17')]?_0x2c0e1e[_0x37ac('0x17')][_0x37ac('0x18')]===undefined?!![]:![]:!![],'where':_0x2c0e1e[_0x37ac('0x17')]?_0x2c0e1e[_0x37ac('0x17')]['where']||null:null,'attributes':_0x2c0e1e[_0x37ac('0x17')]?_0x2c0e1e[_0x37ac('0x17')][_0x37ac('0x19')]||null:null,'include':_0x2c0e1e[_0x37ac('0x17')]?_0x2c0e1e[_0x37ac('0x17')][_0x37ac('0x1a')]?_[_0x37ac('0x1b')](_0x2c0e1e[_0x37ac('0x17')][_0x37ac('0x1a')],function(_0x249160){return{'model':db[_0x249160[_0x37ac('0x1c')]],'as':_0x249160['as'],'attributes':_0x249160[_0x37ac('0x19')],'include':_0x249160[_0x37ac('0x1a')]?_['map'](_0x249160[_0x37ac('0x1a')],function(_0x2579d2){return{'model':db[_0x2579d2[_0x37ac('0x1c')]],'as':_0x2579d2['as'],'attributes':_0x2579d2[_0x37ac('0x19')],'include':_0x2579d2[_0x37ac('0x1a')]?_[_0x37ac('0x1b')](_0x2579d2[_0x37ac('0x1a')],function(_0xa30040){return{'model':db[_0xa30040['model']],'as':_0xa30040['as'],'attributes':_0xa30040[_0x37ac('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x482f80){logger[_0x37ac('0xa')](_0x37ac('0x14'),_0x2c0e1e);logger[_0x37ac('0x1d')](_0x37ac('0x14'),_0x2c0e1e,JSON[_0x37ac('0xe')](_0x482f80));_0x58bc98(_0x482f80);})['catch'](function(_0x405b87){logger['error'](_0x37ac('0x14'),_0x405b87[_0x37ac('0x11')],_0x2c0e1e);_0xad2c8d(_0x5a9c12['error'](0x1f4,_0x405b87[_0x37ac('0x11')]));});});}; \ No newline at end of file +var _0x5daf=['attributes','include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowSound','Sound','find','options','raw','where'];(function(_0x4ef504,_0x5265c9){var _0xd73102=function(_0x6d9780){while(--_0x6d9780){_0x4ef504['push'](_0x4ef504['shift']());}};_0xd73102(++_0x5265c9);}(_0x5daf,0x1e5));var _0xf5da=function(_0x3eb2e2,_0x3351c6){_0x3eb2e2=_0x3eb2e2-0x0;var _0x105148=_0x5daf[_0x3eb2e2];return _0x105148;};'use strict';var _=require(_0xf5da('0x0'));var util=require('util');var moment=require(_0xf5da('0x1'));var BPromise=require(_0xf5da('0x2'));var rs=require(_0xf5da('0x3'));var fs=require('fs');var Redis=require(_0xf5da('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf5da('0x5'))(_0xf5da('0x6'));var config=require(_0xf5da('0x7'));var jayson=require(_0xf5da('0x8'));var client=jayson[_0xf5da('0x9')][_0xf5da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x180513,_0x5c4c63,_0x142c0e){return new BPromise(function(_0x7c7299,_0x18b285){return client[_0xf5da('0xb')](_0x180513,_0x142c0e)['then'](function(_0xa96f3a){logger[_0xf5da('0xc')](_0xf5da('0xd'),_0x5c4c63,'request\x20sent');logger[_0xf5da('0xe')](_0xf5da('0xf'),_0x5c4c63,_0xf5da('0x10'),JSON[_0xf5da('0x11')](_0xa96f3a));if(_0xa96f3a[_0xf5da('0x12')]){if(_0xa96f3a[_0xf5da('0x12')]['code']===0x1f4){logger[_0xf5da('0x12')](_0xf5da('0xd'),_0x5c4c63,_0xa96f3a[_0xf5da('0x12')][_0xf5da('0x13')]);return _0x18b285(_0xa96f3a['error']['message']);}logger[_0xf5da('0x12')](_0xf5da('0xd'),_0x5c4c63,_0xa96f3a[_0xf5da('0x12')][_0xf5da('0x13')]);return _0x7c7299(_0xa96f3a[_0xf5da('0x12')]['message']);}else{logger[_0xf5da('0xc')](_0xf5da('0xd'),_0x5c4c63,'request\x20sent');_0x7c7299(_0xa96f3a['result']['message']);}})[_0xf5da('0x14')](function(_0x247804){logger['error'](_0xf5da('0xd'),_0x5c4c63,_0x247804);_0x18b285(_0x247804);});});}exports[_0xf5da('0x15')]=function(_0x3dd8e8){var _0x411aed=this;return new Promise(function(_0x73f276,_0x2e1160){return db[_0xf5da('0x16')][_0xf5da('0x17')]({'raw':_0x3dd8e8['options']?_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x19')]===undefined?!![]:![]:!![],'where':_0x3dd8e8[_0xf5da('0x18')]?_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x1a')]||null:null,'attributes':_0x3dd8e8[_0xf5da('0x18')]?_0x3dd8e8['options'][_0xf5da('0x1b')]||null:null,'include':_0x3dd8e8['options']?_0x3dd8e8['options'][_0xf5da('0x1c')]?_['map'](_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x1c')],function(_0x1df806){return{'model':db[_0x1df806['model']],'as':_0x1df806['as'],'attributes':_0x1df806[_0xf5da('0x1b')],'include':_0x1df806[_0xf5da('0x1c')]?_[_0xf5da('0x1d')](_0x1df806[_0xf5da('0x1c')],function(_0x11389b){return{'model':db[_0x11389b[_0xf5da('0x1e')]],'as':_0x11389b['as'],'attributes':_0x11389b['attributes'],'include':_0x11389b[_0xf5da('0x1c')]?_['map'](_0x11389b[_0xf5da('0x1c')],function(_0x177567){return{'model':db[_0x177567[_0xf5da('0x1e')]],'as':_0x177567['as'],'attributes':_0x177567[_0xf5da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf5da('0x1f')](function(_0x13ccd2){logger[_0xf5da('0xc')](_0xf5da('0x15'),_0x3dd8e8);logger[_0xf5da('0xe')](_0xf5da('0x15'),_0x3dd8e8,JSON[_0xf5da('0x11')](_0x13ccd2));_0x73f276(_0x13ccd2);})[_0xf5da('0x14')](function(_0x50b1a8){logger[_0xf5da('0x12')](_0xf5da('0x15'),_0x50b1a8[_0xf5da('0x13')],_0x3dd8e8);_0x2e1160(_0x411aed[_0xf5da('0x12')](0x1f4,_0x50b1a8[_0xf5da('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f58e63b..385be89 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x2d582c,_0x424a15){var _0x37e92a=function(_0x142fb1){while(--_0x142fb1){_0x2d582c['push'](_0x2d582c['shift']());}};_0x37e92a(++_0x424a15);}(_0x4fc2,0x111));var _0x24fc=function(_0x59ce09,_0x4a9863){_0x59ce09=_0x59ce09-0x0;var _0x23e766=_0x4fc2[_0x59ce09];return _0x23e766;};'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 fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa7879c,_0x4dc1d9){var _0x576d61=function(_0x54d9f0){while(--_0x54d9f0){_0xa7879c['push'](_0xa7879c['shift']());}};_0x576d61(++_0x4dc1d9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x0b0e[_0x39e283];return _0x7de89f;};'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 fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 7adc5b0..06b95fd 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 _0x158f=['STRING','TEXT','exports','medium','out'];(function(_0x26f306,_0x227d7a){var _0x86ade3=function(_0x5b1135){while(--_0x5b1135){_0x26f306['push'](_0x26f306['shift']());}};_0x86ade3(++_0x227d7a);}(_0x158f,0x84));var _0xf158=function(_0xc18ce1,_0x329f9b){_0xc18ce1=_0xc18ce1-0x0;var _0x12ea8b=_0x158f[_0xc18ce1];return _0x12ea8b;};'use strict';var Sequelize=require('sequelize');module[_0xf158('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xf158('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf158('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0xf158('0x3')]},'providerResponse':{'type':Sequelize[_0xf158('0x4')]}}; \ No newline at end of file +var _0x6249=['sequelize','exports','STRING','medium','out'];(function(_0x29830b,_0x5e641b){var _0x2273db=function(_0xdfbe35){while(--_0xdfbe35){_0x29830b['push'](_0x29830b['shift']());}};_0x2273db(++_0x5e641b);}(_0x6249,0x8c));var _0x9624=function(_0x440845,_0x3b1852){_0x440845=_0x440845-0x0;var _0x105a87=_0x6249[_0x440845];return _0x105a87;};'use strict';var Sequelize=require(_0x9624('0x0'));module[_0x9624('0x1')]={'uniqueid':{'type':Sequelize[_0x9624('0x2')]},'body':{'type':Sequelize['TEXT'](_0x9624('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9624('0x4')),'defaultValue':_0x9624('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9624('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 59f0919..7ba795f 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 _0x5f76=['eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','offset','count','set','json','apply','reject','update','then','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','SquareMessage','catch','params','includeAll','find','create','body','destroy'];(function(_0x55938e,_0x1cbcdc){var _0x34ccac=function(_0x121cff){while(--_0x121cff){_0x55938e['push'](_0x55938e['shift']());}};_0x34ccac(++_0x1cbcdc);}(_0x5f76,0x8e));var _0x65f7=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x5f76[_0x1e4f2f];return _0xccea89;};'use strict';var emlformat=require(_0x65f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x65f7('0x1'));var rp=require(_0x65f7('0x2'));var moment=require('moment');var BPromise=require(_0x65f7('0x3'));var Mustache=require(_0x65f7('0x4'));var util=require(_0x65f7('0x5'));var path=require('path');var sox=require(_0x65f7('0x6'));var csv=require(_0x65f7('0x7'));var ejs=require(_0x65f7('0x8'));var fs=require('fs');var fs_extra=require(_0x65f7('0x9'));var _=require(_0x65f7('0xa'));var squel=require(_0x65f7('0xb'));var crypto=require(_0x65f7('0xc'));var jsforce=require(_0x65f7('0xd'));var deskjs=require(_0x65f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x65f7('0xf'));var Papa=require(_0x65f7('0x10'));var Redis=require(_0x65f7('0x11'));var authService=require(_0x65f7('0x12'));var qs=require(_0x65f7('0x13'));var as=require(_0x65f7('0x14'));var hardwareService=require(_0x65f7('0x15'));var logger=require('../../config/logger')(_0x65f7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f7('0x17'));var db=require(_0x65f7('0x18'))['db'];function respondWithStatusCode(_0x54520d,_0x43b0ff){_0x43b0ff=_0x43b0ff||0xcc;return function(_0x4a8137){if(_0x4a8137){return _0x54520d[_0x65f7('0x19')](_0x43b0ff);}return _0x54520d[_0x65f7('0x1a')](_0x43b0ff)[_0x65f7('0x1b')]();};}function respondWithResult(_0x4853c7,_0x43dc56){_0x43dc56=_0x43dc56||0xc8;return function(_0x522f0c){if(_0x522f0c){return _0x4853c7[_0x65f7('0x1a')](_0x43dc56)['json'](_0x522f0c);}};}function respondWithFilteredResult(_0x1c3812,_0x4e4101){return function(_0x110e69){if(_0x110e69){var _0x268a38=typeof _0x4e4101['offset']==='undefined'&&typeof _0x4e4101[_0x65f7('0x1c')]==='undefined';var _0x3e3c40=_0x110e69['count'];var _0x4c437b=_0x268a38?0x0:_0x4e4101[_0x65f7('0x1d')];var _0x193d23=_0x268a38?_0x110e69[_0x65f7('0x1e')]:_0x4e4101[_0x65f7('0x1d')]+_0x4e4101[_0x65f7('0x1c')];var _0x43f4f7;if(_0x193d23>=_0x3e3c40){_0x193d23=_0x3e3c40;_0x43f4f7=0xc8;}else{_0x43f4f7=0xce;}_0x1c3812['status'](_0x43f4f7);return _0x1c3812[_0x65f7('0x1f')]('Content-Range',_0x4c437b+'-'+_0x193d23+'/'+_0x3e3c40)[_0x65f7('0x20')](_0x110e69);}return null;};}function patchUpdates(_0x593c0c){return function(_0x95d985){try{jsonpatch[_0x65f7('0x21')](_0x95d985,_0x593c0c,!![]);}catch(_0x4bb65b){return BPromise[_0x65f7('0x22')](_0x4bb65b);}return _0x95d985['save']();};}function saveUpdates(_0x285e4e,_0x126236){return function(_0x3d1583){if(_0x3d1583){return _0x3d1583[_0x65f7('0x23')](_0x285e4e)[_0x65f7('0x24')](function(_0x32a5dc){return _0x32a5dc;});}return null;};}function removeEntity(_0x57d4e1,_0x18d37f){return function(_0x23bb73){if(_0x23bb73){return _0x23bb73['destroy']()[_0x65f7('0x24')](function(){_0x57d4e1[_0x65f7('0x1a')](0xcc)[_0x65f7('0x1b')]();});}};}function handleEntityNotFound(_0x214ea2,_0x86da65){return function(_0x169bc0){if(!_0x169bc0){_0x214ea2[_0x65f7('0x19')](0x194);}return _0x169bc0;};}function handleError(_0xf30285,_0x474fba){_0x474fba=_0x474fba||0x1f4;return function(_0x1c4736){logger[_0x65f7('0x25')](_0x1c4736[_0x65f7('0x26')]);if(_0x1c4736[_0x65f7('0x27')]){delete _0x1c4736[_0x65f7('0x27')];}_0xf30285['status'](_0x474fba)[_0x65f7('0x28')](_0x1c4736);};}exports[_0x65f7('0x29')]=function(_0x1490fc,_0x32f005){var _0x57770a={},_0x37b3e7={},_0x432f3a={'count':0x0,'rows':[]};var _0x5c0b5b=_['map'](db['SquareMessage'][_0x65f7('0x2a')],function(_0x26c562){return{'name':_0x26c562['fieldName'],'type':_0x26c562[_0x65f7('0x2b')][_0x65f7('0x2c')]};});_0x37b3e7['model']=_[_0x65f7('0x2d')](_0x5c0b5b,_0x65f7('0x27'));_0x37b3e7[_0x65f7('0x2e')]=_[_0x65f7('0x2f')](_0x1490fc['query']);_0x37b3e7[_0x65f7('0x30')]=_[_0x65f7('0x31')](_0x37b3e7[_0x65f7('0x32')],_0x37b3e7[_0x65f7('0x2e')]);_0x57770a['attributes']=_[_0x65f7('0x31')](_0x37b3e7[_0x65f7('0x32')],qs[_0x65f7('0x33')](_0x1490fc[_0x65f7('0x2e')][_0x65f7('0x33')]));_0x57770a[_0x65f7('0x34')]=_0x57770a[_0x65f7('0x34')][_0x65f7('0x35')]?_0x57770a[_0x65f7('0x34')]:_0x37b3e7[_0x65f7('0x32')];if(!_0x1490fc[_0x65f7('0x2e')][_0x65f7('0x36')]('nolimit')){_0x57770a[_0x65f7('0x1c')]=qs['limit'](_0x1490fc[_0x65f7('0x2e')]['limit']);_0x57770a[_0x65f7('0x1d')]=qs['offset'](_0x1490fc['query']['offset']);}_0x57770a['order']=qs['sort'](_0x1490fc[_0x65f7('0x2e')][_0x65f7('0x37')]);_0x57770a[_0x65f7('0x38')]=qs['filters'](_[_0x65f7('0x39')](_0x1490fc['query'],_0x37b3e7['filters']),_0x5c0b5b);if(_0x1490fc[_0x65f7('0x2e')][_0x65f7('0x3a')]){_0x57770a[_0x65f7('0x38')]=_['merge'](_0x57770a[_0x65f7('0x38')],{'$or':_['map'](_0x5c0b5b,function(_0xd89f1){if(_0xd89f1[_0x65f7('0x2b')]!==_0x65f7('0x3b')){var _0x1cb307={};_0x1cb307[_0xd89f1[_0x65f7('0x27')]]={'$like':'%'+_0x1490fc[_0x65f7('0x2e')][_0x65f7('0x3a')]+'%'};return _0x1cb307;}})});}_0x57770a=_[_0x65f7('0x3c')]({},_0x57770a,_0x1490fc[_0x65f7('0x3d')]);var _0x17326c={'where':_0x57770a[_0x65f7('0x38')]};return db['SquareMessage'][_0x65f7('0x1e')](_0x17326c)['then'](function(_0x2eb3eb){_0x432f3a[_0x65f7('0x1e')]=_0x2eb3eb;if(_0x1490fc[_0x65f7('0x2e')]['includeAll']){_0x57770a[_0x65f7('0x3e')]=[{'all':!![]}];}return db[_0x65f7('0x3f')]['findAll'](_0x57770a);})[_0x65f7('0x24')](function(_0xb673d1){_0x432f3a['rows']=_0xb673d1;return _0x432f3a;})[_0x65f7('0x24')](respondWithFilteredResult(_0x32f005,_0x57770a))[_0x65f7('0x40')](handleError(_0x32f005,null));};exports['show']=function(_0x2ec981,_0x35d51b){var _0x325288={'raw':!![],'where':{'id':_0x2ec981[_0x65f7('0x41')]['id']}},_0x360be3={};_0x360be3['model']=_[_0x65f7('0x2f')](db['SquareMessage'][_0x65f7('0x2a')]);_0x360be3[_0x65f7('0x2e')]=_['keys'](_0x2ec981[_0x65f7('0x2e')]);_0x360be3[_0x65f7('0x30')]=_[_0x65f7('0x31')](_0x360be3['model'],_0x360be3[_0x65f7('0x2e')]);_0x325288[_0x65f7('0x34')]=_[_0x65f7('0x31')](_0x360be3[_0x65f7('0x32')],qs['fields'](_0x2ec981[_0x65f7('0x2e')]['fields']));_0x325288[_0x65f7('0x34')]=_0x325288[_0x65f7('0x34')][_0x65f7('0x35')]?_0x325288[_0x65f7('0x34')]:_0x360be3[_0x65f7('0x32')];if(_0x2ec981[_0x65f7('0x2e')][_0x65f7('0x42')]){_0x325288[_0x65f7('0x3e')]=[{'all':!![]}];}_0x325288=_[_0x65f7('0x3c')]({},_0x325288,_0x2ec981['options']);return db[_0x65f7('0x3f')][_0x65f7('0x43')](_0x325288)[_0x65f7('0x24')](handleEntityNotFound(_0x35d51b,null))[_0x65f7('0x24')](respondWithResult(_0x35d51b,null))['catch'](handleError(_0x35d51b,null));};exports['create']=function(_0x190c2a,_0x8fe472){return db[_0x65f7('0x3f')][_0x65f7('0x44')](_0x190c2a[_0x65f7('0x45')],{})['then'](respondWithResult(_0x8fe472,0xc9))[_0x65f7('0x40')](handleError(_0x8fe472,null));};exports[_0x65f7('0x23')]=function(_0x45262e,_0xb624b0){if(_0x45262e['body']['id']){delete _0x45262e['body']['id'];}return db[_0x65f7('0x3f')][_0x65f7('0x43')]({'where':{'id':_0x45262e[_0x65f7('0x41')]['id']}})[_0x65f7('0x24')](handleEntityNotFound(_0xb624b0,null))[_0x65f7('0x24')](saveUpdates(_0x45262e[_0x65f7('0x45')],null))[_0x65f7('0x24')](respondWithResult(_0xb624b0,null))[_0x65f7('0x40')](handleError(_0xb624b0,null));};exports[_0x65f7('0x46')]=function(_0x2430f4,_0x3b02b9){return db[_0x65f7('0x3f')]['find']({'where':{'id':_0x2430f4[_0x65f7('0x41')]['id']}})[_0x65f7('0x24')](handleEntityNotFound(_0x3b02b9,null))[_0x65f7('0x24')](removeEntity(_0x3b02b9,null))[_0x65f7('0x40')](handleError(_0x3b02b9,null));}; \ No newline at end of file +var _0xa3d5=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','SquareMessage','rawAttributes','fieldName','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x538e5c,_0x485e0a){var _0x36b805=function(_0xf0e3a1){while(--_0xf0e3a1){_0x538e5c['push'](_0x538e5c['shift']());}};_0x36b805(++_0x485e0a);}(_0xa3d5,0xc7));var _0x5a3d=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0xa3d5[_0x412342];return _0x3e62cb;};'use strict';var emlformat=require(_0x5a3d('0x0'));var rimraf=require(_0x5a3d('0x1'));var zipdir=require(_0x5a3d('0x2'));var jsonpatch=require(_0x5a3d('0x3'));var rp=require('request-promise');var moment=require(_0x5a3d('0x4'));var BPromise=require(_0x5a3d('0x5'));var Mustache=require(_0x5a3d('0x6'));var util=require(_0x5a3d('0x7'));var path=require(_0x5a3d('0x8'));var sox=require(_0x5a3d('0x9'));var csv=require(_0x5a3d('0xa'));var ejs=require(_0x5a3d('0xb'));var fs=require('fs');var fs_extra=require(_0x5a3d('0xc'));var _=require(_0x5a3d('0xd'));var squel=require(_0x5a3d('0xe'));var crypto=require(_0x5a3d('0xf'));var jsforce=require(_0x5a3d('0x10'));var deskjs=require(_0x5a3d('0x11'));var toCsv=require(_0x5a3d('0xa'));var querystring=require(_0x5a3d('0x12'));var Papa=require(_0x5a3d('0x13'));var Redis=require(_0x5a3d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5a3d('0x15'));var hardwareService=require(_0x5a3d('0x16'));var logger=require(_0x5a3d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5a3d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429ec0,_0x36d8f0){_0x36d8f0=_0x36d8f0||0xcc;return function(_0x49e402){if(_0x49e402){return _0x429ec0[_0x5a3d('0x19')](_0x36d8f0);}return _0x429ec0[_0x5a3d('0x1a')](_0x36d8f0)[_0x5a3d('0x1b')]();};}function respondWithResult(_0x320c10,_0x5768d9){_0x5768d9=_0x5768d9||0xc8;return function(_0x2d98af){if(_0x2d98af){return _0x320c10[_0x5a3d('0x1a')](_0x5768d9)['json'](_0x2d98af);}};}function respondWithFilteredResult(_0x5969e6,_0x4a50ec){return function(_0x57d983){if(_0x57d983){var _0x1c0c8c=typeof _0x4a50ec['offset']===_0x5a3d('0x1c')&&typeof _0x4a50ec['limit']===_0x5a3d('0x1c');var _0x94f958=_0x57d983[_0x5a3d('0x1d')];var _0x8089b3=_0x1c0c8c?0x0:_0x4a50ec[_0x5a3d('0x1e')];var _0x5abd56=_0x1c0c8c?_0x57d983['count']:_0x4a50ec['offset']+_0x4a50ec[_0x5a3d('0x1f')];var _0x554340;if(_0x5abd56>=_0x94f958){_0x5abd56=_0x94f958;_0x554340=0xc8;}else{_0x554340=0xce;}_0x5969e6[_0x5a3d('0x1a')](_0x554340);return _0x5969e6['set'](_0x5a3d('0x20'),_0x8089b3+'-'+_0x5abd56+'/'+_0x94f958)['json'](_0x57d983);}return null;};}function patchUpdates(_0xd20643){return function(_0x3a0c16){try{jsonpatch[_0x5a3d('0x21')](_0x3a0c16,_0xd20643,!![]);}catch(_0x1692c9){return BPromise[_0x5a3d('0x22')](_0x1692c9);}return _0x3a0c16[_0x5a3d('0x23')]();};}function saveUpdates(_0x3dec8f,_0x2df983){return function(_0x5805b3){if(_0x5805b3){return _0x5805b3[_0x5a3d('0x24')](_0x3dec8f)[_0x5a3d('0x25')](function(_0x3de7a9){return _0x3de7a9;});}return null;};}function removeEntity(_0x299cdc,_0x52678f){return function(_0x519a04){if(_0x519a04){return _0x519a04[_0x5a3d('0x26')]()[_0x5a3d('0x25')](function(){_0x299cdc['status'](0xcc)[_0x5a3d('0x1b')]();});}};}function handleEntityNotFound(_0x1d1c99,_0x16bc13){return function(_0x593280){if(!_0x593280){_0x1d1c99[_0x5a3d('0x19')](0x194);}return _0x593280;};}function handleError(_0x52f391,_0x2aa64d){_0x2aa64d=_0x2aa64d||0x1f4;return function(_0x5e6c1e){logger['error'](_0x5e6c1e[_0x5a3d('0x27')]);if(_0x5e6c1e['name']){delete _0x5e6c1e['name'];}_0x52f391['status'](_0x2aa64d)[_0x5a3d('0x28')](_0x5e6c1e);};}exports['index']=function(_0x3f504b,_0x9fbd47){var _0xa45266={},_0x274a2d={},_0x1e7237={'count':0x0,'rows':[]};var _0x4f6392=_[_0x5a3d('0x29')](db[_0x5a3d('0x2a')][_0x5a3d('0x2b')],function(_0x4a3f2e){return{'name':_0x4a3f2e[_0x5a3d('0x2c')],'type':_0x4a3f2e['type']['key']};});_0x274a2d[_0x5a3d('0x2d')]=_[_0x5a3d('0x29')](_0x4f6392,_0x5a3d('0x2e'));_0x274a2d[_0x5a3d('0x2f')]=_['keys'](_0x3f504b[_0x5a3d('0x2f')]);_0x274a2d[_0x5a3d('0x30')]=_[_0x5a3d('0x31')](_0x274a2d[_0x5a3d('0x2d')],_0x274a2d[_0x5a3d('0x2f')]);_0xa45266['attributes']=_[_0x5a3d('0x31')](_0x274a2d[_0x5a3d('0x2d')],qs[_0x5a3d('0x32')](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x32')]));_0xa45266[_0x5a3d('0x33')]=_0xa45266[_0x5a3d('0x33')][_0x5a3d('0x34')]?_0xa45266['attributes']:_0x274a2d[_0x5a3d('0x2d')];if(!_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x35')]('nolimit')){_0xa45266[_0x5a3d('0x1f')]=qs[_0x5a3d('0x1f')](_0x3f504b[_0x5a3d('0x2f')]['limit']);_0xa45266[_0x5a3d('0x1e')]=qs['offset'](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x1e')]);}_0xa45266[_0x5a3d('0x36')]=qs['sort'](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x37')]);_0xa45266[_0x5a3d('0x38')]=qs[_0x5a3d('0x30')](_[_0x5a3d('0x39')](_0x3f504b[_0x5a3d('0x2f')],_0x274a2d['filters']),_0x4f6392);if(_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x3a')]){_0xa45266[_0x5a3d('0x38')]=_[_0x5a3d('0x3b')](_0xa45266[_0x5a3d('0x38')],{'$or':_[_0x5a3d('0x29')](_0x4f6392,function(_0x41bf1a){if(_0x41bf1a[_0x5a3d('0x3c')]!=='VIRTUAL'){var _0x459005={};_0x459005[_0x41bf1a[_0x5a3d('0x2e')]]={'$like':'%'+_0x3f504b['query']['filter']+'%'};return _0x459005;}})});}_0xa45266=_[_0x5a3d('0x3b')]({},_0xa45266,_0x3f504b[_0x5a3d('0x3d')]);var _0x51e578={'where':_0xa45266[_0x5a3d('0x38')]};return db[_0x5a3d('0x2a')][_0x5a3d('0x1d')](_0x51e578)[_0x5a3d('0x25')](function(_0x268556){_0x1e7237[_0x5a3d('0x1d')]=_0x268556;if(_0x3f504b['query'][_0x5a3d('0x3e')]){_0xa45266[_0x5a3d('0x3f')]=[{'all':!![]}];}return db[_0x5a3d('0x2a')][_0x5a3d('0x40')](_0xa45266);})[_0x5a3d('0x25')](function(_0x293a58){_0x1e7237[_0x5a3d('0x41')]=_0x293a58;return _0x1e7237;})[_0x5a3d('0x25')](respondWithFilteredResult(_0x9fbd47,_0xa45266))['catch'](handleError(_0x9fbd47,null));};exports[_0x5a3d('0x42')]=function(_0x1c79fc,_0x3b392b){var _0xada0db={'raw':!![],'where':{'id':_0x1c79fc[_0x5a3d('0x43')]['id']}},_0x2d1033={};_0x2d1033[_0x5a3d('0x2d')]=_[_0x5a3d('0x44')](db[_0x5a3d('0x2a')]['rawAttributes']);_0x2d1033['query']=_[_0x5a3d('0x44')](_0x1c79fc[_0x5a3d('0x2f')]);_0x2d1033[_0x5a3d('0x30')]=_['intersection'](_0x2d1033[_0x5a3d('0x2d')],_0x2d1033['query']);_0xada0db['attributes']=_[_0x5a3d('0x31')](_0x2d1033['model'],qs['fields'](_0x1c79fc[_0x5a3d('0x2f')][_0x5a3d('0x32')]));_0xada0db['attributes']=_0xada0db['attributes'][_0x5a3d('0x34')]?_0xada0db[_0x5a3d('0x33')]:_0x2d1033[_0x5a3d('0x2d')];if(_0x1c79fc[_0x5a3d('0x2f')]['includeAll']){_0xada0db[_0x5a3d('0x3f')]=[{'all':!![]}];}_0xada0db=_[_0x5a3d('0x3b')]({},_0xada0db,_0x1c79fc['options']);return db[_0x5a3d('0x2a')][_0x5a3d('0x45')](_0xada0db)['then'](handleEntityNotFound(_0x3b392b,null))[_0x5a3d('0x25')](respondWithResult(_0x3b392b,null))['catch'](handleError(_0x3b392b,null));};exports[_0x5a3d('0x46')]=function(_0x553858,_0x44d456){return db['SquareMessage'][_0x5a3d('0x46')](_0x553858[_0x5a3d('0x47')],{})[_0x5a3d('0x25')](respondWithResult(_0x44d456,0xc9))[_0x5a3d('0x48')](handleError(_0x44d456,null));};exports[_0x5a3d('0x24')]=function(_0x2243ed,_0x21b995){if(_0x2243ed[_0x5a3d('0x47')]['id']){delete _0x2243ed[_0x5a3d('0x47')]['id'];}return db[_0x5a3d('0x2a')][_0x5a3d('0x45')]({'where':{'id':_0x2243ed[_0x5a3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x21b995,null))[_0x5a3d('0x25')](saveUpdates(_0x2243ed[_0x5a3d('0x47')],null))[_0x5a3d('0x25')](respondWithResult(_0x21b995,null))[_0x5a3d('0x48')](handleError(_0x21b995,null));};exports[_0x5a3d('0x26')]=function(_0x440c57,_0x33d1d7){return db[_0x5a3d('0x2a')]['find']({'where':{'id':_0x440c57[_0x5a3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x33d1d7,null))[_0x5a3d('0x25')](removeEntity(_0x33d1d7,null))['catch'](handleError(_0x33d1d7,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 586ddfe..3925b37 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 _0xf1da=['bluebird','request-promise','./squareMessage.attributes','define','SquareMessage','square_messages','util','../../config/logger','moment'];(function(_0x137187,_0x55af6e){var _0x3ab5e1=function(_0x42745b){while(--_0x42745b){_0x137187['push'](_0x137187['shift']());}};_0x3ab5e1(++_0x55af6e);}(_0xf1da,0x165));var _0xaf1d=function(_0x2224d2,_0x295428){_0x2224d2=_0x2224d2-0x0;var _0x5cb690=_0xf1da[_0x2224d2];return _0x5cb690;};'use strict';var _=require('lodash');var util=require(_0xaf1d('0x0'));var logger=require(_0xaf1d('0x1'))('api');var moment=require(_0xaf1d('0x2'));var BPromise=require(_0xaf1d('0x3'));var rp=require(_0xaf1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaf1d('0x5'));module['exports']=function(_0x1f52cc,_0xfdddb5){return _0x1f52cc[_0xaf1d('0x6')](_0xaf1d('0x7'),attributes,{'tableName':_0xaf1d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3068=['square_messages','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./squareMessage.attributes','define'];(function(_0x3a056b,_0x5529be){var _0xb0d5cd=function(_0x49c464){while(--_0x49c464){_0x3a056b['push'](_0x3a056b['shift']());}};_0xb0d5cd(++_0x5529be);}(_0x3068,0x118));var _0x8306=function(_0x1186f8,_0x1e710e){_0x1186f8=_0x1186f8-0x0;var _0x1382f9=_0x3068[_0x1186f8];return _0x1382f9;};'use strict';var _=require('lodash');var util=require(_0x8306('0x0'));var logger=require(_0x8306('0x1'))(_0x8306('0x2'));var moment=require('moment');var BPromise=require(_0x8306('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8306('0x4'));var config=require(_0x8306('0x5'));var attributes=require(_0x8306('0x6'));module['exports']=function(_0x3da0ac,_0x2978e0){return _0x3da0ac[_0x8306('0x7')]('SquareMessage',attributes,{'tableName':_0x8306('0x8'),'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 bdadc7e..54144c7 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 _0x1072=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareMessage','create','body','options','raw','CreateSquareMessage','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1072,0xd3));var _0x2107=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1072[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x2107('0x0'));var util=require(_0x2107('0x1'));var moment=require(_0x2107('0x2'));var BPromise=require(_0x2107('0x3'));var rs=require(_0x2107('0x4'));var fs=require('fs');var Redis=require(_0x2107('0x5'));var db=require(_0x2107('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2107('0x7'))(_0x2107('0x8'));var config=require('../../config/environment');var jayson=require(_0x2107('0x9'));var client=jayson['client'][_0x2107('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22af86,_0x565d79,_0x44f3eb){return new BPromise(function(_0x36a154,_0x11f3a1){return client[_0x2107('0xb')](_0x22af86,_0x44f3eb)[_0x2107('0xc')](function(_0x38eddc){logger[_0x2107('0xd')](_0x2107('0xe'),_0x565d79,_0x2107('0xf'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x565d79,_0x2107('0xf'),JSON[_0x2107('0x10')](_0x38eddc));if(_0x38eddc[_0x2107('0x11')]){if(_0x38eddc[_0x2107('0x11')][_0x2107('0x12')]===0x1f4){logger[_0x2107('0x11')](_0x2107('0xe'),_0x565d79,_0x38eddc[_0x2107('0x11')][_0x2107('0x13')]);return _0x11f3a1(_0x38eddc[_0x2107('0x11')][_0x2107('0x13')]);}logger[_0x2107('0x11')](_0x2107('0xe'),_0x565d79,_0x38eddc['error'][_0x2107('0x13')]);return _0x36a154(_0x38eddc[_0x2107('0x11')]['message']);}else{logger['info'](_0x2107('0xe'),_0x565d79,_0x2107('0xf'));_0x36a154(_0x38eddc['result']['message']);}})['catch'](function(_0x4d54a8){logger[_0x2107('0x11')](_0x2107('0xe'),_0x565d79,_0x4d54a8);_0x11f3a1(_0x4d54a8);});});}exports['CreateSquareMessage']=function(_0x47eda3){var _0x1a2ae2=this;return new Promise(function(_0x39b069,_0x444f7f){return db[_0x2107('0x14')][_0x2107('0x15')](_0x47eda3[_0x2107('0x16')],{'raw':_0x47eda3[_0x2107('0x17')]?_0x47eda3['options'][_0x2107('0x18')]===undefined?!![]:![]:!![]})[_0x2107('0xc')](function(_0x1314a9){logger[_0x2107('0xd')](_0x2107('0x19'),_0x47eda3);logger[_0x2107('0x1a')](_0x2107('0x19'),_0x47eda3,JSON[_0x2107('0x10')](_0x1314a9));_0x39b069(_0x1314a9);})['catch'](function(_0x1a0d02){logger[_0x2107('0x11')](_0x2107('0x19'),_0x1a0d02[_0x2107('0x13')],_0x47eda3);_0x444f7f(_0x1a2ae2[_0x2107('0x11')](0x1f4,_0x1a0d02[_0x2107('0x13')]));});});}; \ No newline at end of file +var _0x329f=['message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x329f,0x122));var _0xf329=function(_0x23dcfb,_0x3b6129){_0x23dcfb=_0x23dcfb-0x0;var _0x541939=_0x329f[_0x23dcfb];return _0x541939;};'use strict';var _=require(_0xf329('0x0'));var util=require('util');var moment=require(_0xf329('0x1'));var BPromise=require(_0xf329('0x2'));var rs=require(_0xf329('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf329('0x4'));var config=require(_0xf329('0x5'));var jayson=require(_0xf329('0x6'));var client=jayson[_0xf329('0x7')][_0xf329('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ab15c,_0x378ca8,_0x48e399){return new BPromise(function(_0x55c67a,_0x2a0e6c){return client[_0xf329('0x9')](_0x5ab15c,_0x48e399)[_0xf329('0xa')](function(_0x471f47){logger[_0xf329('0xb')]('SquareMessage,\x20%s,\x20%s',_0x378ca8,_0xf329('0xc'));logger['debug'](_0xf329('0xd'),_0x378ca8,_0xf329('0xc'),JSON[_0xf329('0xe')](_0x471f47));if(_0x471f47['error']){if(_0x471f47[_0xf329('0xf')][_0xf329('0x10')]===0x1f4){logger['error'](_0xf329('0x11'),_0x378ca8,_0x471f47['error'][_0xf329('0x12')]);return _0x2a0e6c(_0x471f47[_0xf329('0xf')]['message']);}logger[_0xf329('0xf')](_0xf329('0x11'),_0x378ca8,_0x471f47['error'][_0xf329('0x12')]);return _0x55c67a(_0x471f47[_0xf329('0xf')]['message']);}else{logger[_0xf329('0xb')]('SquareMessage,\x20%s,\x20%s',_0x378ca8,'request\x20sent');_0x55c67a(_0x471f47[_0xf329('0x13')][_0xf329('0x12')]);}})[_0xf329('0x14')](function(_0x32c682){logger[_0xf329('0xf')](_0xf329('0x11'),_0x378ca8,_0x32c682);_0x2a0e6c(_0x32c682);});});}exports[_0xf329('0x15')]=function(_0x2c0df3){var _0x900787=this;return new Promise(function(_0x4f7d35,_0x301351){return db[_0xf329('0x16')][_0xf329('0x17')](_0x2c0df3[_0xf329('0x18')],{'raw':_0x2c0df3[_0xf329('0x19')]?_0x2c0df3['options'][_0xf329('0x1a')]===undefined?!![]:![]:!![]})[_0xf329('0xa')](function(_0x51629d){logger[_0xf329('0xb')](_0xf329('0x15'),_0x2c0df3);logger[_0xf329('0x1b')](_0xf329('0x15'),_0x2c0df3,JSON[_0xf329('0xe')](_0x51629d));_0x4f7d35(_0x51629d);})[_0xf329('0x14')](function(_0x6f7dc3){logger['error'](_0xf329('0x15'),_0x6f7dc3['message'],_0x2c0df3);_0x301351(_0x900787[_0xf329('0xf')](0x1f4,_0x6f7dc3[_0xf329('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1ea451b..80c2c12 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 _0x974c=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id/test','test','put','/:id','update','destroy','exports','util','path','express','Router'];(function(_0x1ad8e6,_0x389cff){var _0x1283fd=function(_0x165104){while(--_0x165104){_0x1ad8e6['push'](_0x1ad8e6['shift']());}};_0x1283fd(++_0x389cff);}(_0x974c,0x65));var _0xc974=function(_0x2962c5,_0x497c9b){_0x2962c5=_0x2962c5-0x0;var _0x4a8761=_0x974c[_0x2962c5];return _0x4a8761;};'use strict';var multer=require('multer');var util=require(_0xc974('0x0'));var path=require(_0xc974('0x1'));var timeout=require('connect-timeout');var express=require(_0xc974('0x2'));var router=express[_0xc974('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc974('0x4'));var interaction=require(_0xc974('0x5'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xc974('0x6')](),controller['index']);router[_0xc974('0x7')]('/:id',auth[_0xc974('0x6')](),controller['show']);router['get'](_0xc974('0x8'),auth[_0xc974('0x6')](),timeout('15s'),controller[_0xc974('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc974('0xa')](_0xc974('0xb'),auth[_0xc974('0x6')](),controller[_0xc974('0xc')]);router['delete']('/:id',auth[_0xc974('0x6')](),controller[_0xc974('0xd')]);module[_0xc974('0xe')]=router; \ No newline at end of file +var _0x1a70=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/test','15s','test','create','put','/:id','destroy','util','path','connect-timeout','express'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x1a70,0x18b));var _0x01a7=function(_0x57d5d7,_0x2a4ae0){_0x57d5d7=_0x57d5d7-0x0;var _0x2f598b=_0x1a70[_0x57d5d7];return _0x2f598b;};'use strict';var multer=require('multer');var util=require(_0x01a7('0x0'));var path=require(_0x01a7('0x1'));var timeout=require(_0x01a7('0x2'));var express=require(_0x01a7('0x3'));var router=express['Router']();var fs_extra=require(_0x01a7('0x4'));var auth=require(_0x01a7('0x5'));var interaction=require(_0x01a7('0x6'));var config=require(_0x01a7('0x7'));var controller=require('./squareOdbc.controller');router[_0x01a7('0x8')]('/',auth['isAuthenticated'](),controller[_0x01a7('0x9')]);router['get']('/:id',auth[_0x01a7('0xa')](),controller[_0x01a7('0xb')]);router[_0x01a7('0x8')](_0x01a7('0xc'),auth[_0x01a7('0xa')](),timeout(_0x01a7('0xd')),controller[_0x01a7('0xe')]);router['post']('/',auth[_0x01a7('0xa')](),controller[_0x01a7('0xf')]);router[_0x01a7('0x10')](_0x01a7('0x11'),auth[_0x01a7('0xa')](),controller['update']);router['delete'](_0x01a7('0x11'),auth[_0x01a7('0xa')](),controller[_0x01a7('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 1a04db9..7c76dfd 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 _0x0842=['name','exports','STRING'];(function(_0x10c05b,_0x260792){var _0x605e68=function(_0x30b837){while(--_0x30b837){_0x10c05b['push'](_0x10c05b['shift']());}};_0x605e68(++_0x260792);}(_0x0842,0xa3));var _0x2084=function(_0x2c2cac,_0xd72cfe){_0x2c2cac=_0x2c2cac-0x0;var _0x2ee6e3=_0x0842[_0x2c2cac];return _0x2ee6e3;};'use strict';var Sequelize=require('sequelize');module[_0x2084('0x0')]={'name':{'type':Sequelize[_0x2084('0x1')],'unique':_0x2084('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2084('0x1')]},'description':{'type':Sequelize[_0x2084('0x1')]}}; \ No newline at end of file +var _0x86d8=['name','exports','STRING'];(function(_0x55af86,_0x5c8ff6){var _0x58df3b=function(_0x2ddd94){while(--_0x2ddd94){_0x55af86['push'](_0x55af86['shift']());}};_0x58df3b(++_0x5c8ff6);}(_0x86d8,0x1d2));var _0x886d=function(_0x15fd33,_0x8a0623){_0x15fd33=_0x15fd33-0x0;var _0x113aca=_0x86d8[_0x15fd33];return _0x113aca;};'use strict';var Sequelize=require('sequelize');module[_0x886d('0x0')]={'name':{'type':Sequelize[_0x886d('0x1')],'unique':_0x886d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x886d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 34843ee..d5a4ee9 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 _0xcddd=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','params','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x57b861,_0xf2d2e8){var _0x2eaa9c=function(_0x52bae8){while(--_0x52bae8){_0x57b861['push'](_0x57b861['shift']());}};_0x2eaa9c(++_0xf2d2e8);}(_0xcddd,0xf0));var _0xdcdd=function(_0x4cb851,_0x2419bf){_0x4cb851=_0x4cb851-0x0;var _0x321887=_0xcddd[_0x4cb851];return _0x321887;};'use strict';var emlformat=require(_0xdcdd('0x0'));var rimraf=require(_0xdcdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcdd('0x2'));var rp=require(_0xdcdd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdcdd('0x4'));var path=require(_0xdcdd('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdcdd('0x6'));var fs=require('fs');var fs_extra=require(_0xdcdd('0x7'));var _=require(_0xdcdd('0x8'));var squel=require(_0xdcdd('0x9'));var crypto=require(_0xdcdd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdcdd('0xb'));var toCsv=require(_0xdcdd('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdcdd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdcdd('0xe'));var as=require(_0xdcdd('0xf'));var hardwareService=require(_0xdcdd('0x10'));var logger=require(_0xdcdd('0x11'))(_0xdcdd('0x12'));var utils=require(_0xdcdd('0x13'));var config=require(_0xdcdd('0x14'));var licenseUtil=require(_0xdcdd('0x15'));var db=require(_0xdcdd('0x16'))['db'];function respondWithStatusCode(_0x9e654c,_0x980a33){_0x980a33=_0x980a33||0xcc;return function(_0x51c031){if(_0x51c031){return _0x9e654c['sendStatus'](_0x980a33);}return _0x9e654c[_0xdcdd('0x17')](_0x980a33)['end']();};}function respondWithResult(_0x5eb38e,_0x1243d2){_0x1243d2=_0x1243d2||0xc8;return function(_0x2af802){if(_0x2af802){return _0x5eb38e[_0xdcdd('0x17')](_0x1243d2)[_0xdcdd('0x18')](_0x2af802);}};}function respondWithFilteredResult(_0x4690d5,_0x387110){return function(_0x35d4a4){if(_0x35d4a4){var _0x89cf6b=typeof _0x387110['offset']===_0xdcdd('0x19')&&typeof _0x387110[_0xdcdd('0x1a')]===_0xdcdd('0x19');var _0x27781b=_0x35d4a4[_0xdcdd('0x1b')];var _0x482969=_0x89cf6b?0x0:_0x387110[_0xdcdd('0x1c')];var _0x37b39d=_0x89cf6b?_0x35d4a4[_0xdcdd('0x1b')]:_0x387110[_0xdcdd('0x1c')]+_0x387110[_0xdcdd('0x1a')];var _0x442008;if(_0x37b39d>=_0x27781b){_0x37b39d=_0x27781b;_0x442008=0xc8;}else{_0x442008=0xce;}_0x4690d5[_0xdcdd('0x17')](_0x442008);return _0x4690d5['set']('Content-Range',_0x482969+'-'+_0x37b39d+'/'+_0x27781b)[_0xdcdd('0x18')](_0x35d4a4);}return null;};}function patchUpdates(_0x3aa8a6){return function(_0x40f38a){try{jsonpatch[_0xdcdd('0x1d')](_0x40f38a,_0x3aa8a6,!![]);}catch(_0x4b27fc){return BPromise[_0xdcdd('0x1e')](_0x4b27fc);}return _0x40f38a[_0xdcdd('0x1f')]();};}function saveUpdates(_0x1b6550,_0x125c10){return function(_0x6e933){if(_0x6e933){return _0x6e933[_0xdcdd('0x20')](_0x1b6550)[_0xdcdd('0x21')](function(_0x964f2f){return _0x964f2f;});}return null;};}function removeEntity(_0x71008a,_0x404dc9){return function(_0x41e9f6){if(_0x41e9f6){return _0x41e9f6[_0xdcdd('0x22')]()[_0xdcdd('0x21')](function(){var _0x47ec8e=_0x41e9f6[_0xdcdd('0x23')]({'plain':!![]});var _0x3100f6=_0xdcdd('0x24');return db[_0xdcdd('0x25')][_0xdcdd('0x22')]({'where':{'type':_0x3100f6,'resourceId':_0x47ec8e['id']}})[_0xdcdd('0x21')](function(){return _0x41e9f6;});})[_0xdcdd('0x21')](function(){_0x71008a[_0xdcdd('0x17')](0xcc)[_0xdcdd('0x26')]();});}};}function handleEntityNotFound(_0x1230ad,_0x1faf4f){return function(_0x2f3a61){if(!_0x2f3a61){_0x1230ad[_0xdcdd('0x27')](0x194);}return _0x2f3a61;};}function handleError(_0x32fc94,_0x5155e9){_0x5155e9=_0x5155e9||0x1f4;return function(_0x1391eb){logger[_0xdcdd('0x28')](_0x1391eb[_0xdcdd('0x29')]);if(_0x1391eb['name']){delete _0x1391eb[_0xdcdd('0x2a')];}_0x32fc94[_0xdcdd('0x17')](_0x5155e9)[_0xdcdd('0x2b')](_0x1391eb);};}exports[_0xdcdd('0x2c')]=function(_0x45dd9e,_0xc29859){var _0x4775b0={},_0x313ba4={},_0x283bbe={'count':0x0,'rows':[]};var _0x58b9aa=_[_0xdcdd('0x2d')](db[_0xdcdd('0x2e')][_0xdcdd('0x2f')],function(_0x570e77){return{'name':_0x570e77['fieldName'],'type':_0x570e77[_0xdcdd('0x30')][_0xdcdd('0x31')]};});_0x313ba4[_0xdcdd('0x32')]=_[_0xdcdd('0x2d')](_0x58b9aa,'name');_0x313ba4[_0xdcdd('0x33')]=_[_0xdcdd('0x34')](_0x45dd9e[_0xdcdd('0x33')]);_0x313ba4[_0xdcdd('0x35')]=_[_0xdcdd('0x36')](_0x313ba4[_0xdcdd('0x32')],_0x313ba4[_0xdcdd('0x33')]);_0x4775b0['attributes']=_['intersection'](_0x313ba4[_0xdcdd('0x32')],qs['fields'](_0x45dd9e[_0xdcdd('0x33')][_0xdcdd('0x37')]));_0x4775b0['attributes']=_0x4775b0[_0xdcdd('0x38')][_0xdcdd('0x39')]?_0x4775b0[_0xdcdd('0x38')]:_0x313ba4[_0xdcdd('0x32')];if(!_0x45dd9e[_0xdcdd('0x33')]['hasOwnProperty'](_0xdcdd('0x3a'))){_0x4775b0[_0xdcdd('0x1a')]=qs[_0xdcdd('0x1a')](_0x45dd9e['query'][_0xdcdd('0x1a')]);_0x4775b0['offset']=qs['offset'](_0x45dd9e[_0xdcdd('0x33')]['offset']);}_0x4775b0[_0xdcdd('0x3b')]=qs[_0xdcdd('0x3c')](_0x45dd9e[_0xdcdd('0x33')][_0xdcdd('0x3c')]);_0x4775b0[_0xdcdd('0x3d')]=qs[_0xdcdd('0x35')](_[_0xdcdd('0x3e')](_0x45dd9e[_0xdcdd('0x33')],_0x313ba4[_0xdcdd('0x35')]),_0x58b9aa);if(_0x45dd9e[_0xdcdd('0x33')][_0xdcdd('0x3f')]){_0x4775b0[_0xdcdd('0x3d')]=_[_0xdcdd('0x40')](_0x4775b0[_0xdcdd('0x3d')],{'$or':_[_0xdcdd('0x2d')](_0x58b9aa,function(_0x66f65){if(_0x66f65[_0xdcdd('0x30')]!=='VIRTUAL'){var _0x60b92f={};_0x60b92f[_0x66f65[_0xdcdd('0x2a')]]={'$like':'%'+_0x45dd9e[_0xdcdd('0x33')]['filter']+'%'};return _0x60b92f;}})});}_0x4775b0=_[_0xdcdd('0x40')]({},_0x4775b0,_0x45dd9e[_0xdcdd('0x41')]);var _0xcc583={'where':_0x4775b0[_0xdcdd('0x3d')]};return db[_0xdcdd('0x2e')][_0xdcdd('0x1b')](_0xcc583)[_0xdcdd('0x21')](function(_0x554f48){_0x283bbe[_0xdcdd('0x1b')]=_0x554f48;if(_0x45dd9e[_0xdcdd('0x33')][_0xdcdd('0x42')]){_0x4775b0['include']=[{'all':!![]}];}return db[_0xdcdd('0x2e')]['findAll'](_0x4775b0);})['then'](function(_0x33edf8){_0x283bbe[_0xdcdd('0x43')]=_0x33edf8;return _0x283bbe;})[_0xdcdd('0x21')](respondWithFilteredResult(_0xc29859,_0x4775b0))['catch'](handleError(_0xc29859,null));};exports[_0xdcdd('0x44')]=function(_0xb6f1e2,_0x4bc6b1){var _0x38230d={'raw':!![],'where':{'id':_0xb6f1e2['params']['id']}},_0x498134={};_0x498134[_0xdcdd('0x32')]=_[_0xdcdd('0x34')](db[_0xdcdd('0x2e')][_0xdcdd('0x2f')]);_0x498134[_0xdcdd('0x33')]=_['keys'](_0xb6f1e2[_0xdcdd('0x33')]);_0x498134[_0xdcdd('0x35')]=_[_0xdcdd('0x36')](_0x498134[_0xdcdd('0x32')],_0x498134[_0xdcdd('0x33')]);_0x38230d[_0xdcdd('0x38')]=_[_0xdcdd('0x36')](_0x498134[_0xdcdd('0x32')],qs[_0xdcdd('0x37')](_0xb6f1e2[_0xdcdd('0x33')][_0xdcdd('0x37')]));_0x38230d['attributes']=_0x38230d[_0xdcdd('0x38')][_0xdcdd('0x39')]?_0x38230d[_0xdcdd('0x38')]:_0x498134['model'];if(_0xb6f1e2[_0xdcdd('0x33')][_0xdcdd('0x42')]){_0x38230d[_0xdcdd('0x45')]=[{'all':!![]}];}_0x38230d=_[_0xdcdd('0x40')]({},_0x38230d,_0xb6f1e2[_0xdcdd('0x41')]);return db[_0xdcdd('0x2e')]['find'](_0x38230d)[_0xdcdd('0x21')](handleEntityNotFound(_0x4bc6b1,null))[_0xdcdd('0x21')](respondWithResult(_0x4bc6b1,null))[_0xdcdd('0x46')](handleError(_0x4bc6b1,null));};exports[_0xdcdd('0x47')]=function(_0x36956b,_0x554b21){return db[_0xdcdd('0x2e')][_0xdcdd('0x47')](_0x36956b[_0xdcdd('0x48')],{})['then'](function(_0x20a0be){var _0x1d39c9=_0x36956b[_0xdcdd('0x49')][_0xdcdd('0x23')]({'plain':!![]});if(!_0x1d39c9)throw new Error(_0xdcdd('0x4a'));if(_0x1d39c9[_0xdcdd('0x4b')]===_0xdcdd('0x49')){var _0x4dce86=_0x20a0be[_0xdcdd('0x23')]({'plain':!![]});var _0x286b73=_0xdcdd('0x24');return db[_0xdcdd('0x4c')][_0xdcdd('0x4d')]({'where':{'name':_0x286b73,'userProfileId':_0x1d39c9[_0xdcdd('0x4e')]},'raw':!![]})['then'](function(_0x55d1cb){if(_0x55d1cb&&_0x55d1cb['autoAssociation']===0x0){return db[_0xdcdd('0x25')][_0xdcdd('0x47')]({'name':_0x4dce86[_0xdcdd('0x2a')],'resourceId':_0x4dce86['id'],'type':_0x55d1cb[_0xdcdd('0x2a')],'sectionId':_0x55d1cb['id']},{})[_0xdcdd('0x21')](function(){return _0x20a0be;});}else{return _0x20a0be;}})[_0xdcdd('0x46')](function(_0x518080){logger[_0xdcdd('0x28')](_0xdcdd('0x4f'),_0x518080);throw _0x518080;});}return _0x20a0be;})['then'](respondWithResult(_0x554b21,0xc9))['catch'](handleError(_0x554b21,null));};exports[_0xdcdd('0x20')]=function(_0x1ddc9d,_0x1ad3e6){if(_0x1ddc9d[_0xdcdd('0x48')]['id']){delete _0x1ddc9d[_0xdcdd('0x48')]['id'];}return db[_0xdcdd('0x2e')][_0xdcdd('0x4d')]({'where':{'id':_0x1ddc9d['params']['id']}})[_0xdcdd('0x21')](handleEntityNotFound(_0x1ad3e6,null))[_0xdcdd('0x21')](saveUpdates(_0x1ddc9d['body'],null))[_0xdcdd('0x21')](respondWithResult(_0x1ad3e6,null))['catch'](handleError(_0x1ad3e6,null));};exports['destroy']=function(_0x30f851,_0x56ba7f){return db[_0xdcdd('0x2e')][_0xdcdd('0x4d')]({'where':{'id':_0x30f851['params']['id']}})[_0xdcdd('0x21')](handleEntityNotFound(_0x56ba7f,null))['then'](removeEntity(_0x56ba7f,null))['catch'](handleError(_0x56ba7f,null));};exports[_0xdcdd('0x50')]=function(_0x15f64e,_0x144eb5,_0x8133b7){var _0x1c9815;return db['SquareOdbc'][_0xdcdd('0x4d')]({'where':{'id':_0x15f64e[_0xdcdd('0x51')]['id']},'attributes':['id',_0xdcdd('0x52')]})[_0xdcdd('0x21')](handleEntityNotFound(_0x144eb5,null))[_0xdcdd('0x21')](function(_0x1c6014){if(_0x1c6014){var _0x1f957a=require(_0xdcdd('0x53'))();_0x1f957a[_0xdcdd('0x54')](_0x1c6014[_0xdcdd('0x52')]);_0x1f957a[_0xdcdd('0x55')]();return _0x1c6014;}})[_0xdcdd('0x21')](respondWithResult(_0x144eb5,null))['catch'](handleError(_0x144eb5,null));}; \ No newline at end of file +var _0xea9e=['then','destroy','get','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x180fcb,_0x208b94){var _0x515f0d=function(_0x1be895){while(--_0x1be895){_0x180fcb['push'](_0x180fcb['shift']());}};_0x515f0d(++_0x208b94);}(_0xea9e,0x148));var _0xeea9=function(_0x194e17,_0x547543){_0x194e17=_0x194e17-0x0;var _0x2874f2=_0xea9e[_0x194e17];return _0x2874f2;};'use strict';var emlformat=require(_0xeea9('0x0'));var rimraf=require(_0xeea9('0x1'));var zipdir=require(_0xeea9('0x2'));var jsonpatch=require(_0xeea9('0x3'));var rp=require(_0xeea9('0x4'));var moment=require(_0xeea9('0x5'));var BPromise=require(_0xeea9('0x6'));var Mustache=require(_0xeea9('0x7'));var util=require('util');var path=require(_0xeea9('0x8'));var sox=require(_0xeea9('0x9'));var csv=require(_0xeea9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeea9('0xb'));var _=require(_0xeea9('0xc'));var squel=require(_0xeea9('0xd'));var crypto=require(_0xeea9('0xe'));var jsforce=require(_0xeea9('0xf'));var deskjs=require(_0xeea9('0x10'));var toCsv=require(_0xeea9('0xa'));var querystring=require(_0xeea9('0x11'));var Papa=require(_0xeea9('0x12'));var Redis=require(_0xeea9('0x13'));var authService=require(_0xeea9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xeea9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeea9('0x16'))(_0xeea9('0x17'));var utils=require('../../config/utils');var config=require(_0xeea9('0x18'));var licenseUtil=require(_0xeea9('0x19'));var db=require(_0xeea9('0x1a'))['db'];function respondWithStatusCode(_0x20f566,_0xce3587){_0xce3587=_0xce3587||0xcc;return function(_0x37e9a5){if(_0x37e9a5){return _0x20f566[_0xeea9('0x1b')](_0xce3587);}return _0x20f566[_0xeea9('0x1c')](_0xce3587)[_0xeea9('0x1d')]();};}function respondWithResult(_0x20a939,_0x42257a){_0x42257a=_0x42257a||0xc8;return function(_0x408044){if(_0x408044){return _0x20a939['status'](_0x42257a)[_0xeea9('0x1e')](_0x408044);}};}function respondWithFilteredResult(_0x3b780e,_0x4db20a){return function(_0x24d2ab){if(_0x24d2ab){var _0x11f62e=typeof _0x4db20a[_0xeea9('0x1f')]===_0xeea9('0x20')&&typeof _0x4db20a[_0xeea9('0x21')]===_0xeea9('0x20');var _0x1c938e=_0x24d2ab[_0xeea9('0x22')];var _0x5b88df=_0x11f62e?0x0:_0x4db20a[_0xeea9('0x1f')];var _0x289df2=_0x11f62e?_0x24d2ab[_0xeea9('0x22')]:_0x4db20a['offset']+_0x4db20a[_0xeea9('0x21')];var _0x39c64a;if(_0x289df2>=_0x1c938e){_0x289df2=_0x1c938e;_0x39c64a=0xc8;}else{_0x39c64a=0xce;}_0x3b780e[_0xeea9('0x1c')](_0x39c64a);return _0x3b780e[_0xeea9('0x23')](_0xeea9('0x24'),_0x5b88df+'-'+_0x289df2+'/'+_0x1c938e)[_0xeea9('0x1e')](_0x24d2ab);}return null;};}function patchUpdates(_0xfc8560){return function(_0x1d2ff0){try{jsonpatch[_0xeea9('0x25')](_0x1d2ff0,_0xfc8560,!![]);}catch(_0x3db975){return BPromise['reject'](_0x3db975);}return _0x1d2ff0[_0xeea9('0x26')]();};}function saveUpdates(_0x3ec681,_0x35e548){return function(_0x1bb0dc){if(_0x1bb0dc){return _0x1bb0dc[_0xeea9('0x27')](_0x3ec681)[_0xeea9('0x28')](function(_0x202cb0){return _0x202cb0;});}return null;};}function removeEntity(_0x275181,_0x267509){return function(_0xb3365){if(_0xb3365){return _0xb3365[_0xeea9('0x29')]()['then'](function(){var _0x27fa5e=_0xb3365[_0xeea9('0x2a')]({'plain':!![]});var _0x5041e7='ODBC';return db[_0xeea9('0x2b')][_0xeea9('0x29')]({'where':{'type':_0x5041e7,'resourceId':_0x27fa5e['id']}})[_0xeea9('0x28')](function(){return _0xb3365;});})[_0xeea9('0x28')](function(){_0x275181['status'](0xcc)[_0xeea9('0x1d')]();});}};}function handleEntityNotFound(_0x172023,_0x4248ca){return function(_0x2bcc19){if(!_0x2bcc19){_0x172023[_0xeea9('0x1b')](0x194);}return _0x2bcc19;};}function handleError(_0xa2f021,_0xdb8cfa){_0xdb8cfa=_0xdb8cfa||0x1f4;return function(_0x51eea1){logger[_0xeea9('0x2c')](_0x51eea1[_0xeea9('0x2d')]);if(_0x51eea1[_0xeea9('0x2e')]){delete _0x51eea1['name'];}_0xa2f021[_0xeea9('0x1c')](_0xdb8cfa)[_0xeea9('0x2f')](_0x51eea1);};}exports[_0xeea9('0x30')]=function(_0x4b6777,_0x1e8d3b){var _0x9ff4f3={},_0x3485aa={},_0x6d7dab={'count':0x0,'rows':[]};var _0x235c48=_['map'](db[_0xeea9('0x31')]['rawAttributes'],function(_0x2d68a8){return{'name':_0x2d68a8[_0xeea9('0x32')],'type':_0x2d68a8[_0xeea9('0x33')][_0xeea9('0x34')]};});_0x3485aa[_0xeea9('0x35')]=_[_0xeea9('0x36')](_0x235c48,_0xeea9('0x2e'));_0x3485aa[_0xeea9('0x37')]=_['keys'](_0x4b6777['query']);_0x3485aa['filters']=_['intersection'](_0x3485aa['model'],_0x3485aa[_0xeea9('0x37')]);_0x9ff4f3[_0xeea9('0x38')]=_[_0xeea9('0x39')](_0x3485aa['model'],qs[_0xeea9('0x3a')](_0x4b6777[_0xeea9('0x37')][_0xeea9('0x3a')]));_0x9ff4f3[_0xeea9('0x38')]=_0x9ff4f3[_0xeea9('0x38')][_0xeea9('0x3b')]?_0x9ff4f3[_0xeea9('0x38')]:_0x3485aa[_0xeea9('0x35')];if(!_0x4b6777[_0xeea9('0x37')][_0xeea9('0x3c')](_0xeea9('0x3d'))){_0x9ff4f3[_0xeea9('0x21')]=qs[_0xeea9('0x21')](_0x4b6777[_0xeea9('0x37')][_0xeea9('0x21')]);_0x9ff4f3[_0xeea9('0x1f')]=qs['offset'](_0x4b6777[_0xeea9('0x37')]['offset']);}_0x9ff4f3[_0xeea9('0x3e')]=qs[_0xeea9('0x3f')](_0x4b6777[_0xeea9('0x37')]['sort']);_0x9ff4f3[_0xeea9('0x40')]=qs['filters'](_[_0xeea9('0x41')](_0x4b6777[_0xeea9('0x37')],_0x3485aa[_0xeea9('0x42')]),_0x235c48);if(_0x4b6777['query'][_0xeea9('0x43')]){_0x9ff4f3['where']=_[_0xeea9('0x44')](_0x9ff4f3[_0xeea9('0x40')],{'$or':_['map'](_0x235c48,function(_0x28f2cc){if(_0x28f2cc[_0xeea9('0x33')]!=='VIRTUAL'){var _0x241a0a={};_0x241a0a[_0x28f2cc[_0xeea9('0x2e')]]={'$like':'%'+_0x4b6777[_0xeea9('0x37')][_0xeea9('0x43')]+'%'};return _0x241a0a;}})});}_0x9ff4f3=_['merge']({},_0x9ff4f3,_0x4b6777[_0xeea9('0x45')]);var _0x3098b4={'where':_0x9ff4f3[_0xeea9('0x40')]};return db['SquareOdbc'][_0xeea9('0x22')](_0x3098b4)[_0xeea9('0x28')](function(_0x5ebde6){_0x6d7dab[_0xeea9('0x22')]=_0x5ebde6;if(_0x4b6777[_0xeea9('0x37')][_0xeea9('0x46')]){_0x9ff4f3[_0xeea9('0x47')]=[{'all':!![]}];}return db['SquareOdbc'][_0xeea9('0x48')](_0x9ff4f3);})[_0xeea9('0x28')](function(_0x5ba5c1){_0x6d7dab[_0xeea9('0x49')]=_0x5ba5c1;return _0x6d7dab;})[_0xeea9('0x28')](respondWithFilteredResult(_0x1e8d3b,_0x9ff4f3))['catch'](handleError(_0x1e8d3b,null));};exports['show']=function(_0x4aecc4,_0x25ea26){var _0x25c761={'raw':!![],'where':{'id':_0x4aecc4[_0xeea9('0x4a')]['id']}},_0x5ab508={};_0x5ab508[_0xeea9('0x35')]=_[_0xeea9('0x4b')](db['SquareOdbc'][_0xeea9('0x4c')]);_0x5ab508[_0xeea9('0x37')]=_[_0xeea9('0x4b')](_0x4aecc4[_0xeea9('0x37')]);_0x5ab508[_0xeea9('0x42')]=_[_0xeea9('0x39')](_0x5ab508['model'],_0x5ab508['query']);_0x25c761[_0xeea9('0x38')]=_[_0xeea9('0x39')](_0x5ab508[_0xeea9('0x35')],qs[_0xeea9('0x3a')](_0x4aecc4[_0xeea9('0x37')][_0xeea9('0x3a')]));_0x25c761['attributes']=_0x25c761['attributes'][_0xeea9('0x3b')]?_0x25c761[_0xeea9('0x38')]:_0x5ab508[_0xeea9('0x35')];if(_0x4aecc4[_0xeea9('0x37')][_0xeea9('0x46')]){_0x25c761['include']=[{'all':!![]}];}_0x25c761=_[_0xeea9('0x44')]({},_0x25c761,_0x4aecc4[_0xeea9('0x45')]);return db[_0xeea9('0x31')][_0xeea9('0x4d')](_0x25c761)[_0xeea9('0x28')](handleEntityNotFound(_0x25ea26,null))[_0xeea9('0x28')](respondWithResult(_0x25ea26,null))[_0xeea9('0x4e')](handleError(_0x25ea26,null));};exports['create']=function(_0x81cc6f,_0x3b6281){return db[_0xeea9('0x31')][_0xeea9('0x4f')](_0x81cc6f[_0xeea9('0x50')],{})[_0xeea9('0x28')](function(_0x5d50f1){var _0x5ac6f5=_0x81cc6f['user'][_0xeea9('0x2a')]({'plain':!![]});if(!_0x5ac6f5)throw new Error(_0xeea9('0x51'));if(_0x5ac6f5[_0xeea9('0x52')]===_0xeea9('0x53')){var _0x2cbe10=_0x5d50f1[_0xeea9('0x2a')]({'plain':!![]});var _0x413ec8=_0xeea9('0x54');return db[_0xeea9('0x55')]['find']({'where':{'name':_0x413ec8,'userProfileId':_0x5ac6f5[_0xeea9('0x56')]},'raw':!![]})['then'](function(_0x397805){if(_0x397805&&_0x397805['autoAssociation']===0x0){return db[_0xeea9('0x2b')][_0xeea9('0x4f')]({'name':_0x2cbe10[_0xeea9('0x2e')],'resourceId':_0x2cbe10['id'],'type':_0x397805['name'],'sectionId':_0x397805['id']},{})[_0xeea9('0x28')](function(){return _0x5d50f1;});}else{return _0x5d50f1;}})['catch'](function(_0x3f29d8){logger[_0xeea9('0x2c')](_0xeea9('0x57'),_0x3f29d8);throw _0x3f29d8;});}return _0x5d50f1;})[_0xeea9('0x28')](respondWithResult(_0x3b6281,0xc9))['catch'](handleError(_0x3b6281,null));};exports[_0xeea9('0x27')]=function(_0x506898,_0x4bb64f){if(_0x506898['body']['id']){delete _0x506898[_0xeea9('0x50')]['id'];}return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0x506898['params']['id']}})[_0xeea9('0x28')](handleEntityNotFound(_0x4bb64f,null))[_0xeea9('0x28')](saveUpdates(_0x506898[_0xeea9('0x50')],null))[_0xeea9('0x28')](respondWithResult(_0x4bb64f,null))['catch'](handleError(_0x4bb64f,null));};exports['destroy']=function(_0xb1a7dc,_0x543374){return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0xb1a7dc['params']['id']}})[_0xeea9('0x28')](handleEntityNotFound(_0x543374,null))[_0xeea9('0x28')](removeEntity(_0x543374,null))[_0xeea9('0x4e')](handleError(_0x543374,null));};exports[_0xeea9('0x58')]=function(_0x119368,_0x32fcd4,_0x2ef644){var _0x22030a;return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0x119368[_0xeea9('0x4a')]['id']},'attributes':['id',_0xeea9('0x59')]})['then'](handleEntityNotFound(_0x32fcd4,null))[_0xeea9('0x28')](function(_0x185b4c){if(_0x185b4c){var _0x71cbfe=require('odbc')();_0x71cbfe[_0xeea9('0x5a')](_0x185b4c['dsn']);_0x71cbfe[_0xeea9('0x5b')]();return _0x185b4c;}})[_0xeea9('0x28')](respondWithResult(_0x32fcd4,null))[_0xeea9('0x4e')](handleError(_0x32fcd4,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 1fb6c93..e42752c 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 _0xfb2d=['moment','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','lodash','util','api'];(function(_0x13329a,_0x2866b9){var _0x3560de=function(_0x538938){while(--_0x538938){_0x13329a['push'](_0x13329a['shift']());}};_0x3560de(++_0x2866b9);}(_0xfb2d,0x147));var _0xdfb2=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xfb2d[_0x164af1];return _0x5d81a2;};'use strict';var _=require(_0xdfb2('0x0'));var util=require(_0xdfb2('0x1'));var logger=require('../../config/logger')(_0xdfb2('0x2'));var moment=require(_0xdfb2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfb2('0x4'));var rimraf=require(_0xdfb2('0x5'));var config=require(_0xdfb2('0x6'));var attributes=require(_0xdfb2('0x7'));module['exports']=function(_0x32df94,_0x3eeca9){return _0x32df94[_0xdfb2('0x8')](_0xdfb2('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8c1=['api','moment','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb8c1,0x76));var _0x1b8c=function(_0x46fbf2,_0x5fcdc9){_0x46fbf2=_0x46fbf2-0x0;var _0x29b223=_0xb8c1[_0x46fbf2];return _0x29b223;};'use strict';var _=require(_0x1b8c('0x0'));var util=require(_0x1b8c('0x1'));var logger=require('../../config/logger')(_0x1b8c('0x2'));var moment=require(_0x1b8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b8c('0x5'));var config=require(_0x1b8c('0x6'));var attributes=require(_0x1b8c('0x7'));module[_0x1b8c('0x8')]=function(_0xdfba78,_0x39cb36){return _0xdfba78[_0x1b8c('0x9')](_0x1b8c('0xa'),attributes,{'tableName':_0x1b8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index eab8302..94158a8 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 _0x414f=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','map','include','model','info','lodash','util','bluebird'];(function(_0x24989c,_0x3b9a9a){var _0x288947=function(_0x51102c){while(--_0x51102c){_0x24989c['push'](_0x24989c['shift']());}};_0x288947(++_0x3b9a9a);}(_0x414f,0xd5));var _0xf414=function(_0x1f2dda,_0x539c5f){_0x1f2dda=_0x1f2dda-0x0;var _0x29b49e=_0x414f[_0x1f2dda];return _0x29b49e;};'use strict';var _=require(_0xf414('0x0'));var util=require(_0xf414('0x1'));var moment=require('moment');var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf414('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf414('0x4'))(_0xf414('0x5'));var config=require(_0xf414('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf414('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd534,_0x112eb2,_0x28b30f){return new BPromise(function(_0x212202,_0x44d29d){return client[_0xf414('0x8')](_0x1bd534,_0x28b30f)[_0xf414('0x9')](function(_0x42a74d){logger['info'](_0xf414('0xa'),_0x112eb2,_0xf414('0xb'));logger['debug'](_0xf414('0xc'),_0x112eb2,_0xf414('0xb'),JSON[_0xf414('0xd')](_0x42a74d));if(_0x42a74d[_0xf414('0xe')]){if(_0x42a74d[_0xf414('0xe')]['code']===0x1f4){logger[_0xf414('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x112eb2,_0x42a74d[_0xf414('0xe')][_0xf414('0xf')]);return _0x44d29d(_0x42a74d[_0xf414('0xe')][_0xf414('0xf')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x112eb2,_0x42a74d[_0xf414('0xe')][_0xf414('0xf')]);return _0x212202(_0x42a74d['error'][_0xf414('0xf')]);}else{logger['info'](_0xf414('0xa'),_0x112eb2,_0xf414('0xb'));_0x212202(_0x42a74d['result'][_0xf414('0xf')]);}})[_0xf414('0x10')](function(_0x2c97d3){logger[_0xf414('0xe')](_0xf414('0xa'),_0x112eb2,_0x2c97d3);_0x44d29d(_0x2c97d3);});});}exports[_0xf414('0x11')]=function(_0x5e60ad){var _0x75725b=this;return new Promise(function(_0x9734a3,_0x140979){return db[_0xf414('0x12')][_0xf414('0x13')]({'raw':_0x5e60ad[_0xf414('0x14')]?_0x5e60ad[_0xf414('0x14')][_0xf414('0x15')]===undefined?!![]:![]:!![],'where':_0x5e60ad['options']?_0x5e60ad[_0xf414('0x14')]['where']||null:null,'attributes':_0x5e60ad[_0xf414('0x14')]?_0x5e60ad[_0xf414('0x14')][_0xf414('0x16')]||null:null,'include':_0x5e60ad[_0xf414('0x14')]?_0x5e60ad[_0xf414('0x14')]['include']?_[_0xf414('0x17')](_0x5e60ad[_0xf414('0x14')][_0xf414('0x18')],function(_0x488994){return{'model':db[_0x488994['model']],'as':_0x488994['as'],'attributes':_0x488994[_0xf414('0x16')],'include':_0x488994[_0xf414('0x18')]?_[_0xf414('0x17')](_0x488994['include'],function(_0x2498ac){return{'model':db[_0x2498ac[_0xf414('0x19')]],'as':_0x2498ac['as'],'attributes':_0x2498ac[_0xf414('0x16')],'include':_0x2498ac[_0xf414('0x18')]?_[_0xf414('0x17')](_0x2498ac[_0xf414('0x18')],function(_0x1f0355){return{'model':db[_0x1f0355[_0xf414('0x19')]],'as':_0x1f0355['as'],'attributes':_0x1f0355[_0xf414('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf414('0x9')](function(_0xde8791){logger[_0xf414('0x1a')](_0xf414('0x11'),_0x5e60ad);logger['debug']('ShowSquareOdbc',_0x5e60ad,JSON[_0xf414('0xd')](_0xde8791));_0x9734a3(_0xde8791);})[_0xf414('0x10')](function(_0x446e67){logger[_0xf414('0xe')]('ShowSquareOdbc',_0x446e67[_0xf414('0xf')],_0x5e60ad);_0x140979(_0x75725b['error'](0x1f4,_0x446e67[_0xf414('0xf')]));});});}; \ No newline at end of file +var _0xf4ff=['ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch'];(function(_0x3245f7,_0x26bfad){var _0x472f77=function(_0x391589){while(--_0x391589){_0x3245f7['push'](_0x3245f7['shift']());}};_0x472f77(++_0x26bfad);}(_0xf4ff,0x69));var _0xff4f=function(_0x2ddd8b,_0x344f2c){_0x2ddd8b=_0x2ddd8b-0x0;var _0x5bc3a4=_0xf4ff[_0x2ddd8b];return _0x5bc3a4;};'use strict';var _=require('lodash');var util=require(_0xff4f('0x0'));var moment=require(_0xff4f('0x1'));var BPromise=require(_0xff4f('0x2'));var rs=require(_0xff4f('0x3'));var fs=require('fs');var Redis=require(_0xff4f('0x4'));var db=require(_0xff4f('0x5'))['db'];var utils=require(_0xff4f('0x6'));var logger=require(_0xff4f('0x7'))(_0xff4f('0x8'));var config=require(_0xff4f('0x9'));var jayson=require(_0xff4f('0xa'));var client=jayson[_0xff4f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48c48e,_0x412d3a,_0x231e41){return new BPromise(function(_0xe67e05,_0x1d6bac){return client[_0xff4f('0xc')](_0x48c48e,_0x231e41)[_0xff4f('0xd')](function(_0x49a98c){logger[_0xff4f('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x412d3a,_0xff4f('0xf'));logger[_0xff4f('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x412d3a,_0xff4f('0xf'),JSON[_0xff4f('0x11')](_0x49a98c));if(_0x49a98c[_0xff4f('0x12')]){if(_0x49a98c[_0xff4f('0x12')]['code']===0x1f4){logger[_0xff4f('0x12')](_0xff4f('0x13'),_0x412d3a,_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);return _0x1d6bac(_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);}logger[_0xff4f('0x12')](_0xff4f('0x13'),_0x412d3a,_0x49a98c[_0xff4f('0x12')]['message']);return _0xe67e05(_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);}else{logger['info'](_0xff4f('0x13'),_0x412d3a,_0xff4f('0xf'));_0xe67e05(_0x49a98c[_0xff4f('0x15')]['message']);}})[_0xff4f('0x16')](function(_0x56ce7a){logger['error'](_0xff4f('0x13'),_0x412d3a,_0x56ce7a);_0x1d6bac(_0x56ce7a);});});}exports[_0xff4f('0x17')]=function(_0x48a649){var _0x3a0ee4=this;return new Promise(function(_0x278096,_0x252e62){return db[_0xff4f('0x18')][_0xff4f('0x19')]({'raw':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1b')]===undefined?!![]:![]:!![],'where':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1c')]||null:null,'attributes':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1d')]||null:null,'include':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1e')]?_['map'](_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1e')],function(_0x593ff1){return{'model':db[_0x593ff1[_0xff4f('0x1f')]],'as':_0x593ff1['as'],'attributes':_0x593ff1[_0xff4f('0x1d')],'include':_0x593ff1[_0xff4f('0x1e')]?_['map'](_0x593ff1[_0xff4f('0x1e')],function(_0x40e675){return{'model':db[_0x40e675[_0xff4f('0x1f')]],'as':_0x40e675['as'],'attributes':_0x40e675[_0xff4f('0x1d')],'include':_0x40e675[_0xff4f('0x1e')]?_['map'](_0x40e675[_0xff4f('0x1e')],function(_0x5e38e1){return{'model':db[_0x5e38e1[_0xff4f('0x1f')]],'as':_0x5e38e1['as'],'attributes':_0x5e38e1['attributes']};}):[]};}):[]};}):[]:[]})[_0xff4f('0xd')](function(_0x54343d){logger['info'](_0xff4f('0x17'),_0x48a649);logger[_0xff4f('0x10')]('ShowSquareOdbc',_0x48a649,JSON['stringify'](_0x54343d));_0x278096(_0x54343d);})[_0xff4f('0x16')](function(_0x423494){logger['error'](_0xff4f('0x17'),_0x423494['message'],_0x48a649);_0x252e62(_0x3a0ee4[_0xff4f('0x12')](0x1f4,_0x423494[_0xff4f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9a19202..19e127c 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 _0xa839=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x5c587b,_0x3accf1){var _0x5207e8=function(_0xe78e02){while(--_0xe78e02){_0x5c587b['push'](_0x5c587b['shift']());}};_0x5207e8(++_0x3accf1);}(_0xa839,0x77));var _0x9a83=function(_0xd03507,_0x3a9258){_0xd03507=_0xd03507-0x0;var _0x8a76fa=_0xa839[_0xd03507];return _0x8a76fa;};'use strict';var multer=require(_0x9a83('0x0'));var util=require(_0x9a83('0x1'));var path=require('path');var timeout=require(_0x9a83('0x2'));var express=require(_0x9a83('0x3'));var router=express[_0x9a83('0x4')]();var fs_extra=require(_0x9a83('0x5'));var auth=require(_0x9a83('0x6'));var interaction=require(_0x9a83('0x7'));var config=require(_0x9a83('0x8'));var controller=require(_0x9a83('0x9'));router[_0x9a83('0xa')]('/',auth[_0x9a83('0xb')](),controller[_0x9a83('0xc')]);router[_0x9a83('0xa')](_0x9a83('0xd'),auth[_0x9a83('0xb')](),controller[_0x9a83('0xe')]);router[_0x9a83('0xf')]('/',auth[_0x9a83('0xb')](),controller[_0x9a83('0x10')]);router[_0x9a83('0x11')](_0x9a83('0xd'),auth['isAuthenticated'](),controller[_0x9a83('0x12')]);router[_0x9a83('0x13')](_0x9a83('0xd'),auth[_0x9a83('0xb')](),controller[_0x9a83('0x14')]);module[_0x9a83('0x15')]=router; \ No newline at end of file +var _0x3564=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x3564,0x87));var _0x4356=function(_0x15bb88,_0x566455){_0x15bb88=_0x15bb88-0x0;var _0x460e34=_0x3564[_0x15bb88];return _0x460e34;};'use strict';var multer=require(_0x4356('0x0'));var util=require(_0x4356('0x1'));var path=require(_0x4356('0x2'));var timeout=require(_0x4356('0x3'));var express=require(_0x4356('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4356('0x5'));var interaction=require(_0x4356('0x6'));var config=require(_0x4356('0x7'));var controller=require('./squareProject.controller');router[_0x4356('0x8')]('/',auth[_0x4356('0x9')](),controller[_0x4356('0xa')]);router['get']('/:id',auth[_0x4356('0x9')](),controller[_0x4356('0xb')]);router[_0x4356('0xc')]('/',auth[_0x4356('0x9')](),controller[_0x4356('0xd')]);router[_0x4356('0xe')](_0x4356('0xf'),auth[_0x4356('0x9')](),controller[_0x4356('0x10')]);router[_0x4356('0x11')](_0x4356('0xf'),auth[_0x4356('0x9')](),controller[_0x4356('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3aae4bc..f70e2f0 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 _0x7e0a=['preproduction','utf8','long','production','DATE','sequelize','STRING','name','TEXT','BLOB','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e0a,0x15a));var _0xa7e0=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x7e0a[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0xa7e0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7e0('0x1')],'unique':_0xa7e0('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa7e0('0x1')]},'notes':{'type':Sequelize[_0xa7e0('0x3')]},'preproduction':{'type':Sequelize[_0xa7e0('0x4')]('long'),'get':function(){if(this[_0xa7e0('0x5')](_0xa7e0('0x6'))){return this['getDataValue']('preproduction')['toString'](_0xa7e0('0x7'));}}},'production':{'type':Sequelize[_0xa7e0('0x4')](_0xa7e0('0x8')),'get':function(){if(this['getDataValue'](_0xa7e0('0x9'))){return this[_0xa7e0('0x5')](_0xa7e0('0x9'))['toString'](_0xa7e0('0x7'));}}},'savedAt':{'type':Sequelize[_0xa7e0('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x973f=['getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x379109,_0x53e490){var _0xa78d6d=function(_0x554a53){while(--_0x554a53){_0x379109['push'](_0x379109['shift']());}};_0xa78d6d(++_0x53e490);}(_0x973f,0x18d));var _0xf973=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x973f[_0xc0a3d3];return _0x3386e8;};'use strict';var Sequelize=require(_0xf973('0x0'));module[_0xf973('0x1')]={'name':{'type':Sequelize[_0xf973('0x2')],'unique':_0xf973('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf973('0x2')]},'notes':{'type':Sequelize[_0xf973('0x4')]},'preproduction':{'type':Sequelize[_0xf973('0x5')]('long'),'get':function(){if(this[_0xf973('0x6')]('preproduction')){return this[_0xf973('0x6')](_0xf973('0x7'))[_0xf973('0x8')](_0xf973('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0xf973('0xa')),'get':function(){if(this[_0xf973('0x6')](_0xf973('0xb'))){return this[_0xf973('0x6')](_0xf973('0xb'))['toString'](_0xf973('0x9'));}}},'savedAt':{'type':Sequelize[_0xf973('0xc')]},'publishedAt':{'type':Sequelize[_0xf973('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1402470..f626f49 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 _0x3318=['rows','catch','params','rawAttributes','fields','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','pick','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','limit','count','set','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','sendStatus','error','stack','name','send','SquareProject','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll'];(function(_0x290ba2,_0x42b61f){var _0x5f172c=function(_0x549791){while(--_0x549791){_0x290ba2['push'](_0x290ba2['shift']());}};_0x5f172c(++_0x42b61f);}(_0x3318,0x124));var _0x8331=function(_0x1a3848,_0x28dc57){_0x1a3848=_0x1a3848-0x0;var _0x287b0f=_0x3318[_0x1a3848];return _0x287b0f;};'use strict';var _=require(_0x8331('0x0'));var Redis=require(_0x8331('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x8331('0x2'))(_0x8331('0x3'));var config=require(_0x8331('0x4'));var db=require(_0x8331('0x5'))['db'];config[_0x8331('0x6')]=_[_0x8331('0x7')](config[_0x8331('0x6')],{'host':_0x8331('0x8'),'port':0x18eb});var socket=require(_0x8331('0x9'))(new Redis(config[_0x8331('0x6')]));require(_0x8331('0xa'))['register'](socket);function respondWithResult(_0x333204,_0x401494){_0x401494=_0x401494||0xc8;return function(_0x5eb9eb){if(_0x5eb9eb){return _0x333204[_0x8331('0xb')](_0x401494)[_0x8331('0xc')](_0x5eb9eb);}};}function respondWithFilteredResult(_0x5ba390,_0xc60b75){return function(_0x154366){if(_0x154366){var _0x5b08ee=typeof _0xc60b75[_0x8331('0xd')]===_0x8331('0xe')&&typeof _0xc60b75[_0x8331('0xf')]===_0x8331('0xe');var _0x29e850=_0x154366[_0x8331('0x10')];var _0x4dc8c6=_0x5b08ee?0x0:_0xc60b75[_0x8331('0xd')];var _0x558795=_0x5b08ee?_0x154366[_0x8331('0x10')]:_0xc60b75[_0x8331('0xd')]+_0xc60b75[_0x8331('0xf')];var _0x2d3db3;if(_0x558795>=_0x29e850){_0x558795=_0x29e850;_0x2d3db3=0xc8;}else{_0x2d3db3=0xce;}_0x5ba390[_0x8331('0xb')](_0x2d3db3);return _0x5ba390[_0x8331('0x11')]('Content-Range',_0x4dc8c6+'-'+_0x558795+'/'+_0x29e850)[_0x8331('0xc')](_0x154366);}return null;};}function saveUpdates(_0x924a3d){return function(_0x1ba468){if(_0x1ba468){return _0x1ba468['update'](_0x924a3d)[_0x8331('0x12')](function(_0x2a3f64){return _0x2a3f64;});}return null;};}function removeEntity(_0x5d3c25){return function(_0x3650ff){if(_0x3650ff){return _0x3650ff[_0x8331('0x13')]()[_0x8331('0x12')](function(){var _0x580390=_0x3650ff[_0x8331('0x14')]({'plain':!![]});var _0x330323=_0x8331('0x15');return db[_0x8331('0x16')]['destroy']({'where':{'type':_0x330323,'resourceId':_0x580390['id']}})[_0x8331('0x12')](function(){return _0x3650ff;});})[_0x8331('0x12')](function(){var _0x191821=new Redis(config[_0x8331('0x6')]);_0x191821[_0x8331('0x17')](_0x8331('0x18'),JSON[_0x8331('0x19')]({'id':_0x3650ff['id'],'deleted':!![]}));})[_0x8331('0x12')](function(){_0x5d3c25['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0f27){return function(_0x429143){if(!_0x429143){_0x5c0f27[_0x8331('0x1a')](0x194);}return _0x429143;};}function handleError(_0xadeb97,_0x54f19a){_0x54f19a=_0x54f19a||0x1f4;return function(_0xe85c4){logger[_0x8331('0x1b')](_0xe85c4[_0x8331('0x1c')]);if(_0xe85c4[_0x8331('0x1d')]){delete _0xe85c4['name'];}_0xadeb97['status'](_0x54f19a)[_0x8331('0x1e')](_0xe85c4);};}exports['index']=function(_0x3ac259,_0x48c4d1){var _0xeda099={},_0xf01466={},_0xb6cbe8={'count':0x0,'rows':[]};var _0x306d7b=_['map'](db[_0x8331('0x1f')]['rawAttributes'],function(_0x2cf7a3){return{'name':_0x2cf7a3[_0x8331('0x20')],'type':_0x2cf7a3[_0x8331('0x21')]['key']};});_0xf01466[_0x8331('0x22')]=_[_0x8331('0x23')](_0x306d7b,_0x8331('0x1d'));_0xf01466[_0x8331('0x24')]=_[_0x8331('0x25')](_0x3ac259[_0x8331('0x24')]);_0xf01466[_0x8331('0x26')]=_[_0x8331('0x27')](_0xf01466[_0x8331('0x22')],_0xf01466['query']);_0xeda099[_0x8331('0x28')]=_[_0x8331('0x27')](_0xf01466['model'],qs['fields'](_0x3ac259[_0x8331('0x24')]['fields']));_0xeda099[_0x8331('0x28')]=_0xeda099[_0x8331('0x28')][_0x8331('0x29')]?_0xeda099[_0x8331('0x28')]:_0xf01466[_0x8331('0x22')];if(!_0x3ac259[_0x8331('0x24')][_0x8331('0x2a')](_0x8331('0x2b'))){_0xeda099['limit']=qs['limit'](_0x3ac259[_0x8331('0x24')]['limit']);_0xeda099[_0x8331('0xd')]=qs[_0x8331('0xd')](_0x3ac259[_0x8331('0x24')][_0x8331('0xd')]);}_0xeda099[_0x8331('0x2c')]=qs[_0x8331('0x2d')](_0x3ac259[_0x8331('0x24')][_0x8331('0x2d')]);_0xeda099[_0x8331('0x2e')]=qs['filters'](_['pick'](_0x3ac259['query'],_0xf01466[_0x8331('0x26')]),_0x306d7b);if(_0x3ac259[_0x8331('0x24')][_0x8331('0x2f')]){_0xeda099['where']=_['merge'](_0xeda099[_0x8331('0x2e')],{'$or':_[_0x8331('0x23')](_0x306d7b,function(_0x390749){if(_0x390749[_0x8331('0x21')]!==_0x8331('0x30')){var _0x1dab80={};_0x1dab80[_0x390749[_0x8331('0x1d')]]={'$like':'%'+_0x3ac259[_0x8331('0x24')][_0x8331('0x2f')]+'%'};return _0x1dab80;}})});}_0xeda099=_['merge']({},_0xeda099,_0x3ac259[_0x8331('0x31')]);var _0x40213c={'where':_0xeda099[_0x8331('0x2e')]};return db[_0x8331('0x1f')][_0x8331('0x10')](_0x40213c)[_0x8331('0x12')](function(_0x2cf8a3){_0xb6cbe8[_0x8331('0x10')]=_0x2cf8a3;if(_0x3ac259[_0x8331('0x24')][_0x8331('0x32')]){_0xeda099[_0x8331('0x33')]=[{'all':!![]}];}return db[_0x8331('0x1f')][_0x8331('0x34')](_0xeda099);})[_0x8331('0x12')](function(_0x393880){_0xb6cbe8[_0x8331('0x35')]=_0x393880;return _0xb6cbe8;})[_0x8331('0x12')](respondWithFilteredResult(_0x48c4d1,_0xeda099))[_0x8331('0x36')](handleError(_0x48c4d1,null));};exports['show']=function(_0x25385e,_0xf4c74f){var _0x2c8f98={'raw':![],'where':{'id':_0x25385e[_0x8331('0x37')]['id']}},_0x349cbc={};_0x349cbc[_0x8331('0x22')]=_[_0x8331('0x25')](db[_0x8331('0x1f')][_0x8331('0x38')]);_0x349cbc[_0x8331('0x24')]=_[_0x8331('0x25')](_0x25385e[_0x8331('0x24')]);_0x349cbc[_0x8331('0x26')]=_[_0x8331('0x27')](_0x349cbc[_0x8331('0x22')],_0x349cbc[_0x8331('0x24')]);_0x2c8f98['attributes']=_[_0x8331('0x27')](_0x349cbc[_0x8331('0x22')],qs[_0x8331('0x39')](_0x25385e[_0x8331('0x24')][_0x8331('0x39')]));_0x2c8f98[_0x8331('0x28')]=_0x2c8f98[_0x8331('0x28')][_0x8331('0x29')]?_0x2c8f98[_0x8331('0x28')]:_0x349cbc[_0x8331('0x22')];if(_0x25385e[_0x8331('0x24')][_0x8331('0x32')]){_0x2c8f98[_0x8331('0x33')]=[{'all':!![]}];}_0x2c8f98=_[_0x8331('0x3a')]({},_0x2c8f98,_0x25385e[_0x8331('0x31')]);return db[_0x8331('0x1f')][_0x8331('0x3b')](_0x2c8f98)[_0x8331('0x12')](handleEntityNotFound(_0xf4c74f,null))[_0x8331('0x12')](respondWithResult(_0xf4c74f,null))[_0x8331('0x36')](handleError(_0xf4c74f,null));};exports[_0x8331('0x3c')]=function(_0x523ef9,_0x513ee3){return db[_0x8331('0x1f')][_0x8331('0x3c')](_0x523ef9[_0x8331('0x3d')],{})[_0x8331('0x12')](function(_0xf9ba3b){var _0x16ab37=_0x523ef9[_0x8331('0x3e')][_0x8331('0x14')]({'plain':!![]});if(!_0x16ab37)throw new Error(_0x8331('0x3f'));if(_0x16ab37[_0x8331('0x40')]==='user'){var _0x5ab970=_0xf9ba3b[_0x8331('0x14')]({'plain':!![]});var _0x4cef5d=_0x8331('0x15');return db[_0x8331('0x41')][_0x8331('0x3b')]({'where':{'name':_0x4cef5d,'userProfileId':_0x16ab37[_0x8331('0x42')]},'raw':!![]})[_0x8331('0x12')](function(_0xddb215){if(_0xddb215&&_0xddb215['autoAssociation']===0x0){return db['UserProfileResource'][_0x8331('0x3c')]({'name':_0x5ab970[_0x8331('0x1d')],'resourceId':_0x5ab970['id'],'type':_0xddb215['name'],'sectionId':_0xddb215['id']},{})['then'](function(){return _0xf9ba3b;});}else{return _0xf9ba3b;}})['catch'](function(_0x705eb7){logger[_0x8331('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x705eb7);throw _0x705eb7;});}return _0xf9ba3b;})[_0x8331('0x12')](respondWithResult(_0x513ee3,0xc9))[_0x8331('0x36')](handleError(_0x513ee3,null));};exports[_0x8331('0x43')]=function(_0x4920a4,_0x15fc83){if(_0x4920a4['body']['id']){delete _0x4920a4['body']['id'];}return db[_0x8331('0x1f')][_0x8331('0x3b')]({'where':{'id':_0x4920a4[_0x8331('0x37')]['id']}})[_0x8331('0x12')](handleEntityNotFound(_0x15fc83,null))['then'](saveUpdates(_0x4920a4[_0x8331('0x3d')],null))[_0x8331('0x12')](function(_0x21d7b4){if(!_0x21d7b4)return;var _0xcb8d2c=_0x21d7b4['get']({'plain':!![]});return _0xcb8d2c;})[_0x8331('0x12')](function(_0x25f2f8){var _0x270048=new Redis(config[_0x8331('0x6')]);_0x270048['publish']('agi',JSON['stringify'](_[_0x8331('0x44')](_0x25f2f8,['id',_0x8331('0x1d'),'production'])));return _0x25f2f8;})[_0x8331('0x12')](respondWithResult(_0x15fc83,null))['catch'](handleError(_0x15fc83,null));};exports[_0x8331('0x13')]=function(_0x5096e8,_0x4c8c3a){return db[_0x8331('0x1f')][_0x8331('0x3b')]({'where':{'id':_0x5096e8[_0x8331('0x37')]['id']}})[_0x8331('0x12')](handleEntityNotFound(_0x4c8c3a,null))[_0x8331('0x12')](removeEntity(_0x4c8c3a,null))[_0x8331('0x36')](handleError(_0x4c8c3a,null));}; \ No newline at end of file +var _0x39cf=['agi','pick','production','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','register','status','offset','limit','undefined','count','set','Content-Range','then','destroy','get','SquareProjects','UserProfileResource','stringify','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','SquareProject','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','publish'];(function(_0x317ecb,_0x3650ec){var _0x4f0baf=function(_0x10b0ce){while(--_0x10b0ce){_0x317ecb['push'](_0x317ecb['shift']());}};_0x4f0baf(++_0x3650ec);}(_0x39cf,0x8b));var _0xf39c=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x39cf[_0x5805d7];return _0x170fe4;};'use strict';var _=require(_0xf39c('0x0'));var Redis=require(_0xf39c('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xf39c('0x2'))('api');var config=require(_0xf39c('0x3'));var db=require(_0xf39c('0x4'))['db'];config['redis']=_[_0xf39c('0x5')](config[_0xf39c('0x6')],{'host':_0xf39c('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf39c('0x6')]));require('./squareProject.socket')[_0xf39c('0x8')](socket);function respondWithResult(_0x1fb96b,_0x4f04aa){_0x4f04aa=_0x4f04aa||0xc8;return function(_0x4c0647){if(_0x4c0647){return _0x1fb96b[_0xf39c('0x9')](_0x4f04aa)['json'](_0x4c0647);}};}function respondWithFilteredResult(_0x5f58f7,_0x64273c){return function(_0xdf6c49){if(_0xdf6c49){var _0x12c22a=typeof _0x64273c[_0xf39c('0xa')]==='undefined'&&typeof _0x64273c[_0xf39c('0xb')]===_0xf39c('0xc');var _0xfb9335=_0xdf6c49[_0xf39c('0xd')];var _0x487c0c=_0x12c22a?0x0:_0x64273c[_0xf39c('0xa')];var _0x13372b=_0x12c22a?_0xdf6c49[_0xf39c('0xd')]:_0x64273c[_0xf39c('0xa')]+_0x64273c[_0xf39c('0xb')];var _0x1dc900;if(_0x13372b>=_0xfb9335){_0x13372b=_0xfb9335;_0x1dc900=0xc8;}else{_0x1dc900=0xce;}_0x5f58f7[_0xf39c('0x9')](_0x1dc900);return _0x5f58f7[_0xf39c('0xe')](_0xf39c('0xf'),_0x487c0c+'-'+_0x13372b+'/'+_0xfb9335)['json'](_0xdf6c49);}return null;};}function saveUpdates(_0x4ef1e4){return function(_0x1f96f5){if(_0x1f96f5){return _0x1f96f5['update'](_0x4ef1e4)[_0xf39c('0x10')](function(_0x54f616){return _0x54f616;});}return null;};}function removeEntity(_0x1ed3c6){return function(_0x3b2c91){if(_0x3b2c91){return _0x3b2c91[_0xf39c('0x11')]()[_0xf39c('0x10')](function(){var _0xd7011f=_0x3b2c91[_0xf39c('0x12')]({'plain':!![]});var _0x890466=_0xf39c('0x13');return db[_0xf39c('0x14')]['destroy']({'where':{'type':_0x890466,'resourceId':_0xd7011f['id']}})[_0xf39c('0x10')](function(){return _0x3b2c91;});})[_0xf39c('0x10')](function(){var _0x152a14=new Redis(config['redis']);_0x152a14['publish']('agi',JSON[_0xf39c('0x15')]({'id':_0x3b2c91['id'],'deleted':!![]}));})['then'](function(){_0x1ed3c6[_0xf39c('0x9')](0xcc)[_0xf39c('0x16')]();});}};}function handleEntityNotFound(_0x4172f7){return function(_0x3e68d1){if(!_0x3e68d1){_0x4172f7['sendStatus'](0x194);}return _0x3e68d1;};}function handleError(_0x916b35,_0x13dd82){_0x13dd82=_0x13dd82||0x1f4;return function(_0x120c03){logger[_0xf39c('0x17')](_0x120c03[_0xf39c('0x18')]);if(_0x120c03[_0xf39c('0x19')]){delete _0x120c03[_0xf39c('0x19')];}_0x916b35['status'](_0x13dd82)[_0xf39c('0x1a')](_0x120c03);};}exports['index']=function(_0x2f15c1,_0x212013){var _0x10b098={},_0x11565d={},_0x3b0641={'count':0x0,'rows':[]};var _0xd624f9=_[_0xf39c('0x1b')](db['SquareProject'][_0xf39c('0x1c')],function(_0x16b707){return{'name':_0x16b707[_0xf39c('0x1d')],'type':_0x16b707['type'][_0xf39c('0x1e')]};});_0x11565d['model']=_[_0xf39c('0x1b')](_0xd624f9,'name');_0x11565d[_0xf39c('0x1f')]=_[_0xf39c('0x20')](_0x2f15c1['query']);_0x11565d[_0xf39c('0x21')]=_[_0xf39c('0x22')](_0x11565d[_0xf39c('0x23')],_0x11565d[_0xf39c('0x1f')]);_0x10b098[_0xf39c('0x24')]=_[_0xf39c('0x22')](_0x11565d[_0xf39c('0x23')],qs[_0xf39c('0x25')](_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x25')]));_0x10b098[_0xf39c('0x24')]=_0x10b098[_0xf39c('0x24')][_0xf39c('0x26')]?_0x10b098[_0xf39c('0x24')]:_0x11565d[_0xf39c('0x23')];if(!_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x27')](_0xf39c('0x28'))){_0x10b098['limit']=qs[_0xf39c('0xb')](_0x2f15c1[_0xf39c('0x1f')]['limit']);_0x10b098['offset']=qs[_0xf39c('0xa')](_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0xa')]);}_0x10b098[_0xf39c('0x29')]=qs[_0xf39c('0x2a')](_0x2f15c1['query'][_0xf39c('0x2a')]);_0x10b098[_0xf39c('0x2b')]=qs[_0xf39c('0x21')](_['pick'](_0x2f15c1['query'],_0x11565d[_0xf39c('0x21')]),_0xd624f9);if(_0x2f15c1['query']['filter']){_0x10b098[_0xf39c('0x2b')]=_[_0xf39c('0x2c')](_0x10b098[_0xf39c('0x2b')],{'$or':_[_0xf39c('0x1b')](_0xd624f9,function(_0x56314e){if(_0x56314e[_0xf39c('0x2d')]!=='VIRTUAL'){var _0x174233={};_0x174233[_0x56314e[_0xf39c('0x19')]]={'$like':'%'+_0x2f15c1[_0xf39c('0x1f')]['filter']+'%'};return _0x174233;}})});}_0x10b098=_[_0xf39c('0x2c')]({},_0x10b098,_0x2f15c1[_0xf39c('0x2e')]);var _0x4a4bb9={'where':_0x10b098[_0xf39c('0x2b')]};return db[_0xf39c('0x2f')][_0xf39c('0xd')](_0x4a4bb9)[_0xf39c('0x10')](function(_0x483487){_0x3b0641[_0xf39c('0xd')]=_0x483487;if(_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x30')]){_0x10b098['include']=[{'all':!![]}];}return db[_0xf39c('0x2f')][_0xf39c('0x31')](_0x10b098);})[_0xf39c('0x10')](function(_0x3f9ffa){_0x3b0641[_0xf39c('0x32')]=_0x3f9ffa;return _0x3b0641;})[_0xf39c('0x10')](respondWithFilteredResult(_0x212013,_0x10b098))[_0xf39c('0x33')](handleError(_0x212013,null));};exports[_0xf39c('0x34')]=function(_0x4ac72e,_0x5548a7){var _0x17351a={'raw':![],'where':{'id':_0x4ac72e[_0xf39c('0x35')]['id']}},_0x260cfd={};_0x260cfd[_0xf39c('0x23')]=_[_0xf39c('0x20')](db[_0xf39c('0x2f')][_0xf39c('0x1c')]);_0x260cfd[_0xf39c('0x1f')]=_['keys'](_0x4ac72e[_0xf39c('0x1f')]);_0x260cfd['filters']=_[_0xf39c('0x22')](_0x260cfd['model'],_0x260cfd[_0xf39c('0x1f')]);_0x17351a[_0xf39c('0x24')]=_[_0xf39c('0x22')](_0x260cfd[_0xf39c('0x23')],qs[_0xf39c('0x25')](_0x4ac72e[_0xf39c('0x1f')][_0xf39c('0x25')]));_0x17351a[_0xf39c('0x24')]=_0x17351a[_0xf39c('0x24')][_0xf39c('0x26')]?_0x17351a[_0xf39c('0x24')]:_0x260cfd['model'];if(_0x4ac72e[_0xf39c('0x1f')][_0xf39c('0x30')]){_0x17351a[_0xf39c('0x36')]=[{'all':!![]}];}_0x17351a=_[_0xf39c('0x2c')]({},_0x17351a,_0x4ac72e[_0xf39c('0x2e')]);return db[_0xf39c('0x2f')][_0xf39c('0x37')](_0x17351a)[_0xf39c('0x10')](handleEntityNotFound(_0x5548a7,null))[_0xf39c('0x10')](respondWithResult(_0x5548a7,null))[_0xf39c('0x33')](handleError(_0x5548a7,null));};exports[_0xf39c('0x38')]=function(_0x242f87,_0x3cd490){return db[_0xf39c('0x2f')]['create'](_0x242f87[_0xf39c('0x39')],{})['then'](function(_0x11657d){var _0x1f053e=_0x242f87['user'][_0xf39c('0x12')]({'plain':!![]});if(!_0x1f053e)throw new Error(_0xf39c('0x3a'));if(_0x1f053e[_0xf39c('0x3b')]===_0xf39c('0x3c')){var _0x1c4cf9=_0x11657d[_0xf39c('0x12')]({'plain':!![]});var _0x23fe76=_0xf39c('0x13');return db['UserProfileSection'][_0xf39c('0x37')]({'where':{'name':_0x23fe76,'userProfileId':_0x1f053e[_0xf39c('0x3d')]},'raw':!![]})[_0xf39c('0x10')](function(_0x2e3567){if(_0x2e3567&&_0x2e3567['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1c4cf9['name'],'resourceId':_0x1c4cf9['id'],'type':_0x2e3567[_0xf39c('0x19')],'sectionId':_0x2e3567['id']},{})['then'](function(){return _0x11657d;});}else{return _0x11657d;}})[_0xf39c('0x33')](function(_0x57fcb4){logger[_0xf39c('0x17')](_0xf39c('0x3e'),_0x57fcb4);throw _0x57fcb4;});}return _0x11657d;})[_0xf39c('0x10')](respondWithResult(_0x3cd490,0xc9))['catch'](handleError(_0x3cd490,null));};exports[_0xf39c('0x3f')]=function(_0x5029dd,_0x54d721){if(_0x5029dd['body']['id']){delete _0x5029dd[_0xf39c('0x39')]['id'];}return db[_0xf39c('0x2f')][_0xf39c('0x37')]({'where':{'id':_0x5029dd[_0xf39c('0x35')]['id']}})['then'](handleEntityNotFound(_0x54d721,null))[_0xf39c('0x10')](saveUpdates(_0x5029dd[_0xf39c('0x39')],null))[_0xf39c('0x10')](function(_0x4994ab){if(!_0x4994ab)return;var _0x1a6c6e=_0x4994ab[_0xf39c('0x12')]({'plain':!![]});return _0x1a6c6e;})[_0xf39c('0x10')](function(_0x5e4159){var _0x3e90c7=new Redis(config[_0xf39c('0x6')]);_0x3e90c7[_0xf39c('0x40')](_0xf39c('0x41'),JSON[_0xf39c('0x15')](_[_0xf39c('0x42')](_0x5e4159,['id',_0xf39c('0x19'),_0xf39c('0x43')])));return _0x5e4159;})[_0xf39c('0x10')](respondWithResult(_0x54d721,null))[_0xf39c('0x33')](handleError(_0x54d721,null));};exports[_0xf39c('0x11')]=function(_0x788573,_0x1a6303){return db['SquareProject'][_0xf39c('0x37')]({'where':{'id':_0x788573[_0xf39c('0x35')]['id']}})[_0xf39c('0x10')](handleEntityNotFound(_0x1a6303,null))['then'](removeEntity(_0x1a6303,null))[_0xf39c('0x33')](handleError(_0x1a6303,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 513a242..8cb41cf 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 _0x01d7=['emit','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0xd02554,_0x20e086){var _0x3ed600=function(_0x5890f5){while(--_0x5890f5){_0xd02554['push'](_0xd02554['shift']());}};_0x3ed600(++_0x20e086);}(_0x01d7,0x9a));var _0x701d=function(_0x1b5435,_0x1f812c){_0x1b5435=_0x1b5435-0x0;var _0x49e14f=_0x01d7[_0x1b5435];return _0x49e14f;};'use strict';var EventEmitter=require(_0x701d('0x0'));var SquareProject=require(_0x701d('0x1'))['db'][_0x701d('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x701d('0x3')](0x0);var events={'afterCreate':_0x701d('0x4'),'afterUpdate':_0x701d('0x5'),'afterDestroy':'remove'};function emitEvent(_0xceba5c){return function(_0x3bbd1e,_0x4474fc,_0x10cced){SquareProjectEvents[_0x701d('0x6')](_0xceba5c+':'+_0x3bbd1e['id'],_0x3bbd1e);SquareProjectEvents[_0x701d('0x6')](_0xceba5c,_0x3bbd1e);_0x10cced(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x701d('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xbd00=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xbd00,0x1d1));var _0x0bd0=function(_0x48c9b3,_0x1fb678){_0x48c9b3=_0x48c9b3-0x0;var _0x4c782f=_0xbd00[_0x48c9b3];return _0x4c782f;};'use strict';var EventEmitter=require(_0x0bd0('0x0'));var SquareProject=require(_0x0bd0('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0bd0('0x2')](0x0);var events={'afterCreate':_0x0bd0('0x3'),'afterUpdate':_0x0bd0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1441e2){return function(_0x24477c,_0xb82fe8,_0xe88c48){SquareProjectEvents[_0x0bd0('0x5')](_0x1441e2+':'+_0x24477c['id'],_0x24477c);SquareProjectEvents[_0x0bd0('0x5')](_0x1441e2,_0x24477c);_0xe88c48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0bd0('0x6')](e,emitEvent(event));}}module[_0x0bd0('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 a56ed34..5c79d64 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 _0x0812=['define','SquareProject','square_projects','changed','preproduction','savedAt','publishedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0x0812,0xaa));var _0x2081=function(_0xca2d0c,_0x27bcce){_0xca2d0c=_0xca2d0c-0x0;var _0x221fa8=_0x0812[_0xca2d0c];return _0x221fa8;};'use strict';var _=require(_0x2081('0x0'));var util=require(_0x2081('0x1'));var logger=require(_0x2081('0x2'))(_0x2081('0x3'));var moment=require(_0x2081('0x4'));var BPromise=require('bluebird');var rp=require(_0x2081('0x5'));var fs=require('fs');var path=require(_0x2081('0x6'));var rimraf=require('rimraf');var config=require(_0x2081('0x7'));var attributes=require(_0x2081('0x8'));module[_0x2081('0x9')]=function(_0x379b55,_0x49b218){return _0x379b55[_0x2081('0xa')](_0x2081('0xb'),attributes,{'tableName':_0x2081('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13c8d2,_0xa4ad1,_0x54a7c7){if(_0x13c8d2[_0x2081('0xd')](_0x2081('0xe'))){_0x13c8d2[_0x2081('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x13c8d2['changed']('production')){_0x13c8d2[_0x2081('0x10')]=moment()[_0x2081('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54a7c7(null,_0x13c8d2);}}});}; \ No newline at end of file +var _0xc55b=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc55b,0x132));var _0xbc55=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc55b[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xbc55('0x0'));var util=require(_0xbc55('0x1'));var logger=require(_0xbc55('0x2'))(_0xbc55('0x3'));var moment=require(_0xbc55('0x4'));var BPromise=require(_0xbc55('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc55('0x6'));var rimraf=require('rimraf');var config=require(_0xbc55('0x7'));var attributes=require(_0xbc55('0x8'));module[_0xbc55('0x9')]=function(_0x593efb,_0x168766){return _0x593efb[_0xbc55('0xa')](_0xbc55('0xb'),attributes,{'tableName':_0xbc55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x404c1b,_0x2eb376,_0x298597){if(_0x404c1b['changed'](_0xbc55('0xd'))){_0x404c1b['savedAt']=moment()[_0xbc55('0xe')](_0xbc55('0xf'));}if(_0x404c1b['changed'](_0xbc55('0x10'))){_0x404c1b['publishedAt']=moment()[_0xbc55('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x298597(null,_0x404c1b);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f36f785..0fcef37 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 _0x2d3a=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','include','map','model','attributes','then','info','debug','stringify','catch','error','message','find','ShowSquareProject','lodash','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2d3a,0x168));var _0xa2d3=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x2d3a[_0xbc4659];return _0x5831f9;};'use strict';var _=require(_0xa2d3('0x0'));var Redis=require('ioredis');var db=require(_0xa2d3('0x1'))['db'];var logger=require(_0xa2d3('0x2'))('rpc');var config=require(_0xa2d3('0x3'));config[_0xa2d3('0x4')]=_[_0xa2d3('0x5')](config[_0xa2d3('0x4')],{'host':_0xa2d3('0x6'),'port':0x18eb});var socket=require(_0xa2d3('0x7'))(new Redis(config[_0xa2d3('0x4')]));require(_0xa2d3('0x8'))[_0xa2d3('0x9')](socket);exports[_0xa2d3('0xa')]=function(_0x3d931f){var _0x46f51b=this;return new Promise(function(_0x3c1359,_0xa19344){return db[_0xa2d3('0xb')]['findAll']({'raw':_0x3d931f[_0xa2d3('0xc')]?_0x3d931f[_0xa2d3('0xc')][_0xa2d3('0xd')]===undefined?!![]:![]:!![],'where':_0x3d931f[_0xa2d3('0xc')]?_0x3d931f[_0xa2d3('0xc')][_0xa2d3('0xe')]||null:null,'attributes':_0x3d931f[_0xa2d3('0xc')]?_0x3d931f[_0xa2d3('0xc')]['attributes']||null:null,'limit':_0x3d931f[_0xa2d3('0xc')]?_0x3d931f[_0xa2d3('0xc')]['limit']||null:null,'include':_0x3d931f[_0xa2d3('0xc')]?_0x3d931f[_0xa2d3('0xc')][_0xa2d3('0xf')]?_[_0xa2d3('0x10')](_0x3d931f[_0xa2d3('0xc')][_0xa2d3('0xf')],function(_0x228e01){return{'model':db[_0x228e01[_0xa2d3('0x11')]],'as':_0x228e01['as'],'attributes':_0x228e01[_0xa2d3('0x12')],'include':_0x228e01[_0xa2d3('0xf')]?_[_0xa2d3('0x10')](_0x228e01[_0xa2d3('0xf')],function(_0x49c768){return{'model':db[_0x49c768[_0xa2d3('0x11')]],'as':_0x49c768['as'],'attributes':_0x49c768[_0xa2d3('0x12')],'include':_0x49c768[_0xa2d3('0xf')]?_[_0xa2d3('0x10')](_0x49c768['include'],function(_0x4e045a){return{'model':db[_0x4e045a[_0xa2d3('0x11')]],'as':_0x4e045a['as'],'attributes':_0x4e045a[_0xa2d3('0x12')]};}):[]};}):[]};}):[]:[]})[_0xa2d3('0x13')](function(_0x39005f){logger[_0xa2d3('0x14')]('GetSquareProjects',_0x3d931f);logger[_0xa2d3('0x15')](_0xa2d3('0xa'),_0x3d931f,JSON[_0xa2d3('0x16')](_0x39005f));_0x3c1359(_0x39005f);})[_0xa2d3('0x17')](function(_0x298d2d){logger[_0xa2d3('0x18')](_0xa2d3('0xa'),_0x298d2d[_0xa2d3('0x19')],_0x3d931f);_0xa19344(_0x46f51b[_0xa2d3('0x18')](0x1f4,_0x298d2d['message']));});});};exports['ShowSquareProject']=function(_0x4f355a){var _0x239bda=this;return new Promise(function(_0x507037,_0x474630){return db[_0xa2d3('0xb')][_0xa2d3('0x1a')]({'raw':_0x4f355a[_0xa2d3('0xc')]?_0x4f355a['options'][_0xa2d3('0xd')]===undefined?!![]:![]:!![],'where':_0x4f355a[_0xa2d3('0xc')]?_0x4f355a['options'][_0xa2d3('0xe')]||null:null,'attributes':_0x4f355a[_0xa2d3('0xc')]?_0x4f355a[_0xa2d3('0xc')][_0xa2d3('0x12')]||null:null,'include':_0x4f355a['options']?_0x4f355a[_0xa2d3('0xc')][_0xa2d3('0xf')]?_['map'](_0x4f355a['options'][_0xa2d3('0xf')],function(_0x5c1bb8){return{'model':db[_0x5c1bb8[_0xa2d3('0x11')]],'as':_0x5c1bb8['as'],'attributes':_0x5c1bb8[_0xa2d3('0x12')],'include':_0x5c1bb8[_0xa2d3('0xf')]?_[_0xa2d3('0x10')](_0x5c1bb8[_0xa2d3('0xf')],function(_0x2457b5){return{'model':db[_0x2457b5[_0xa2d3('0x11')]],'as':_0x2457b5['as'],'attributes':_0x2457b5[_0xa2d3('0x12')],'include':_0x2457b5[_0xa2d3('0xf')]?_[_0xa2d3('0x10')](_0x2457b5[_0xa2d3('0xf')],function(_0x5d22da){return{'model':db[_0x5d22da[_0xa2d3('0x11')]],'as':_0x5d22da['as'],'attributes':_0x5d22da[_0xa2d3('0x12')]};}):[]};}):[]};}):[]:[]})[_0xa2d3('0x13')](function(_0x2cbce2){logger[_0xa2d3('0x14')](_0xa2d3('0x1b'),_0x4f355a);logger[_0xa2d3('0x15')]('ShowSquareProject',_0x4f355a,JSON[_0xa2d3('0x16')](_0x2cbce2));_0x507037(_0x2cbce2);})[_0xa2d3('0x17')](function(_0x3e0827){logger[_0xa2d3('0x18')](_0xa2d3('0x1b'),_0x3e0827[_0xa2d3('0x19')],_0x4f355a);_0x474630(_0x239bda[_0xa2d3('0x18')](0x1f4,_0x3e0827[_0xa2d3('0x19')]));});});}; \ No newline at end of file +var _0x66c7=['findAll','options','raw','where','attributes','limit','include','model','map','then','debug','catch','message','error','ShowSquareProject','find','info','stringify','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','GetSquareProjects','SquareProject'];(function(_0x15402c,_0x5a11e6){var _0xe26a2c=function(_0x43e96c){while(--_0x43e96c){_0x15402c['push'](_0x15402c['shift']());}};_0xe26a2c(++_0x5a11e6);}(_0x66c7,0x1e2));var _0x766c=function(_0x14af66,_0x5b5fb3){_0x14af66=_0x14af66-0x0;var _0x4f219f=_0x66c7[_0x14af66];return _0x4f219f;};'use strict';var _=require(_0x766c('0x0'));var Redis=require(_0x766c('0x1'));var db=require(_0x766c('0x2'))['db'];var logger=require(_0x766c('0x3'))('rpc');var config=require(_0x766c('0x4'));config[_0x766c('0x5')]=_[_0x766c('0x6')](config[_0x766c('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x766c('0x7'))(new Redis(config['redis']));require('./squareProject.socket')[_0x766c('0x8')](socket);exports[_0x766c('0x9')]=function(_0x2af0ab){var _0x1d98bf=this;return new Promise(function(_0x80d037,_0x2f7345){return db[_0x766c('0xa')][_0x766c('0xb')]({'raw':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xd')]===undefined?!![]:![]:!![],'where':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xe')]||null:null,'attributes':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xf')]||null:null,'limit':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab['options'][_0x766c('0x10')]||null:null,'include':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0x11')]?_['map'](_0x2af0ab[_0x766c('0xc')][_0x766c('0x11')],function(_0x499bc2){return{'model':db[_0x499bc2[_0x766c('0x12')]],'as':_0x499bc2['as'],'attributes':_0x499bc2[_0x766c('0xf')],'include':_0x499bc2[_0x766c('0x11')]?_[_0x766c('0x13')](_0x499bc2[_0x766c('0x11')],function(_0x3ff7b6){return{'model':db[_0x3ff7b6[_0x766c('0x12')]],'as':_0x3ff7b6['as'],'attributes':_0x3ff7b6[_0x766c('0xf')],'include':_0x3ff7b6['include']?_[_0x766c('0x13')](_0x3ff7b6['include'],function(_0x1ebd1d){return{'model':db[_0x1ebd1d[_0x766c('0x12')]],'as':_0x1ebd1d['as'],'attributes':_0x1ebd1d[_0x766c('0xf')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x14')](function(_0xc34043){logger['info']('GetSquareProjects',_0x2af0ab);logger[_0x766c('0x15')](_0x766c('0x9'),_0x2af0ab,JSON['stringify'](_0xc34043));_0x80d037(_0xc34043);})[_0x766c('0x16')](function(_0x42ef77){logger['error'](_0x766c('0x9'),_0x42ef77[_0x766c('0x17')],_0x2af0ab);_0x2f7345(_0x1d98bf[_0x766c('0x18')](0x1f4,_0x42ef77[_0x766c('0x17')]));});});};exports[_0x766c('0x19')]=function(_0x1ac5de){var _0x39edea=this;return new Promise(function(_0x20d0bd,_0x1ed075){return db[_0x766c('0xa')][_0x766c('0x1a')]({'raw':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de['options'][_0x766c('0xd')]===undefined?!![]:![]:!![],'where':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de[_0x766c('0xc')][_0x766c('0xe')]||null:null,'attributes':_0x1ac5de['options']?_0x1ac5de[_0x766c('0xc')][_0x766c('0xf')]||null:null,'include':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de[_0x766c('0xc')][_0x766c('0x11')]?_['map'](_0x1ac5de['options'][_0x766c('0x11')],function(_0x37e688){return{'model':db[_0x37e688[_0x766c('0x12')]],'as':_0x37e688['as'],'attributes':_0x37e688[_0x766c('0xf')],'include':_0x37e688[_0x766c('0x11')]?_[_0x766c('0x13')](_0x37e688[_0x766c('0x11')],function(_0x3e8d09){return{'model':db[_0x3e8d09[_0x766c('0x12')]],'as':_0x3e8d09['as'],'attributes':_0x3e8d09['attributes'],'include':_0x3e8d09[_0x766c('0x11')]?_['map'](_0x3e8d09['include'],function(_0x5df3a0){return{'model':db[_0x5df3a0[_0x766c('0x12')]],'as':_0x5df3a0['as'],'attributes':_0x5df3a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x766c('0x14')](function(_0x2f7741){logger[_0x766c('0x1b')](_0x766c('0x19'),_0x1ac5de);logger[_0x766c('0x15')](_0x766c('0x19'),_0x1ac5de,JSON[_0x766c('0x1c')](_0x2f7741));_0x20d0bd(_0x2f7741);})[_0x766c('0x16')](function(_0x4ec0b1){logger[_0x766c('0x18')](_0x766c('0x19'),_0x4ec0b1[_0x766c('0x17')],_0x1ac5de);_0x1ed075(_0x39edea['error'](0x1f4,_0x4ec0b1[_0x766c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 1f4964c..8733e95 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 _0xd636=['register','length','squareProject:','remove','update','emit'];(function(_0x5c98cc,_0x58190a){var _0x164644=function(_0x540bae){while(--_0x540bae){_0x5c98cc['push'](_0x5c98cc['shift']());}};_0x164644(++_0x58190a);}(_0xd636,0x117));var _0x6d63=function(_0x1e53c1,_0x21e2af){_0x1e53c1=_0x1e53c1-0x0;var _0x18e6cd=_0xd636[_0x1e53c1];return _0x18e6cd;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x6d63('0x0'),_0x6d63('0x1')];function createListener(_0x37e517,_0x1a2033){return function(_0x579ac7){_0x1a2033[_0x6d63('0x2')](_0x37e517,_0x579ac7);};}function removeListener(_0x452bae,_0x554c85){return function(){SquareProjectEvents['removeListener'](_0x452bae,_0x554c85);};}exports[_0x6d63('0x3')]=function(_0x5f336a){for(var _0x404cb6=0x0,_0x2c74d1=events[_0x6d63('0x4')];_0x404cb6<_0x2c74d1;_0x404cb6++){var _0x544184=events[_0x404cb6];var _0x4170e8=createListener(_0x6d63('0x5')+_0x544184,_0x5f336a);SquareProjectEvents['on'](_0x544184,_0x4170e8);}}; \ No newline at end of file +var _0x6ebd=['squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x340c8e,_0x18f717){var _0x33d19c=function(_0x1a8299){while(--_0x1a8299){_0x340c8e['push'](_0x340c8e['shift']());}};_0x33d19c(++_0x18f717);}(_0x6ebd,0x169));var _0xd6eb=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6ebd[_0x2763f2];return _0x3ef471;};'use strict';var SquareProjectEvents=require(_0xd6eb('0x0'));var events=[_0xd6eb('0x1'),_0xd6eb('0x2'),_0xd6eb('0x3')];function createListener(_0x19f1fe,_0x3abca0){return function(_0x6997d3){_0x3abca0[_0xd6eb('0x4')](_0x19f1fe,_0x6997d3);};}function removeListener(_0x2e8cf2,_0x4d0ded){return function(){SquareProjectEvents['removeListener'](_0x2e8cf2,_0x4d0ded);};}exports['register']=function(_0x246cb0){for(var _0x5b2e55=0x0,_0x37a632=events['length'];_0x5b2e55<_0x37a632;_0x5b2e55++){var _0x1c25cd=events[_0x5b2e55];var _0x36f383=createListener(_0xd6eb('0x5')+_0x1c25cd,_0x246cb0);SquareProjectEvents['on'](_0x1c25cd,_0x36f383);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 7f325d6..cf88804 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x10919b,_0x25ec3e){var _0x335258=function(_0x27f75d){while(--_0x27f75d){_0x10919b['push'](_0x10919b['shift']());}};_0x335258(++_0x25ec3e);}(_0xabce,0x103));var _0xeabc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xabce[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x38a5c2,_0x432a75){var _0x15ce3b=function(_0x48b7a5){while(--_0x48b7a5){_0x38a5c2['push'](_0x38a5c2['shift']());}};_0x15ce3b(++_0x432a75);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x7fbe[_0x5bfa44];return _0x43815f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 96c8126..5ed98d9 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 _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xdc16fc,_0x1e4f3b){_0xdc16fc=_0xdc16fc-0x0;var _0x4dd8c0=_0x3eea[_0xdc16fc];return _0x4dd8c0;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file +var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x2185af,_0x23874f){_0x2185af=_0x2185af-0x0;var _0x4fde62=_0x2d17[_0x2185af];return _0x4fde62;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index aaed655..f62c7d7 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 _0x0c4b=['create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','rawAttributes','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','SquareRecording','include','findAll','rows','show','params','keys','length','includeAll','find','catch'];(function(_0x597a21,_0x13bd9f){var _0x1e0d18=function(_0xabfdb8){while(--_0xabfdb8){_0x597a21['push'](_0x597a21['shift']());}};_0x1e0d18(++_0x13bd9f);}(_0x0c4b,0x13e));var _0xb0c4=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x0c4b[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0xb0c4('0x0'));var rimraf=require(_0xb0c4('0x1'));var zipdir=require(_0xb0c4('0x2'));var jsonpatch=require(_0xb0c4('0x3'));var rp=require(_0xb0c4('0x4'));var moment=require(_0xb0c4('0x5'));var BPromise=require(_0xb0c4('0x6'));var Mustache=require(_0xb0c4('0x7'));var util=require(_0xb0c4('0x8'));var path=require(_0xb0c4('0x9'));var sox=require(_0xb0c4('0xa'));var csv=require(_0xb0c4('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0c4('0xc'));var squel=require(_0xb0c4('0xd'));var crypto=require(_0xb0c4('0xe'));var jsforce=require(_0xb0c4('0xf'));var deskjs=require(_0xb0c4('0x10'));var toCsv=require(_0xb0c4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb0c4('0x11'));var qs=require(_0xb0c4('0x12'));var as=require(_0xb0c4('0x13'));var hardwareService=require(_0xb0c4('0x14'));var logger=require(_0xb0c4('0x15'))(_0xb0c4('0x16'));var utils=require(_0xb0c4('0x17'));var config=require(_0xb0c4('0x18'));var licenseUtil=require(_0xb0c4('0x19'));var db=require(_0xb0c4('0x1a'))['db'];function respondWithStatusCode(_0x3297a5,_0x15c9f8){_0x15c9f8=_0x15c9f8||0xcc;return function(_0x40d331){if(_0x40d331){return _0x3297a5[_0xb0c4('0x1b')](_0x15c9f8);}return _0x3297a5[_0xb0c4('0x1c')](_0x15c9f8)[_0xb0c4('0x1d')]();};}function respondWithResult(_0x2ddd83,_0x2839d2){_0x2839d2=_0x2839d2||0xc8;return function(_0x2e8b18){if(_0x2e8b18){return _0x2ddd83['status'](_0x2839d2)[_0xb0c4('0x1e')](_0x2e8b18);}};}function respondWithFilteredResult(_0x2aef36,_0x115b3b){return function(_0x5180dc){if(_0x5180dc){var _0xfb3bf=typeof _0x115b3b[_0xb0c4('0x1f')]===_0xb0c4('0x20')&&typeof _0x115b3b['limit']===_0xb0c4('0x20');var _0xa7ac04=_0x5180dc[_0xb0c4('0x21')];var _0x50bbf5=_0xfb3bf?0x0:_0x115b3b[_0xb0c4('0x1f')];var _0x471fda=_0xfb3bf?_0x5180dc[_0xb0c4('0x21')]:_0x115b3b[_0xb0c4('0x1f')]+_0x115b3b[_0xb0c4('0x22')];var _0x33f576;if(_0x471fda>=_0xa7ac04){_0x471fda=_0xa7ac04;_0x33f576=0xc8;}else{_0x33f576=0xce;}_0x2aef36[_0xb0c4('0x1c')](_0x33f576);return _0x2aef36[_0xb0c4('0x23')](_0xb0c4('0x24'),_0x50bbf5+'-'+_0x471fda+'/'+_0xa7ac04)[_0xb0c4('0x1e')](_0x5180dc);}return null;};}function patchUpdates(_0x2832d0){return function(_0x4d82a9){try{jsonpatch[_0xb0c4('0x25')](_0x4d82a9,_0x2832d0,!![]);}catch(_0x57ae28){return BPromise[_0xb0c4('0x26')](_0x57ae28);}return _0x4d82a9[_0xb0c4('0x27')]();};}function saveUpdates(_0x236029,_0xb83de3){return function(_0x17c817){if(_0x17c817){return _0x17c817[_0xb0c4('0x28')](_0x236029)[_0xb0c4('0x29')](function(_0x46ff8f){return _0x46ff8f;});}return null;};}function removeEntity(_0x4f1dc5,_0x5318c6){return function(_0x108a06){if(_0x108a06){return _0x108a06['destroy']()[_0xb0c4('0x29')](function(){_0x4f1dc5['status'](0xcc)[_0xb0c4('0x1d')]();});}};}function handleEntityNotFound(_0x4b1f5c,_0x50eb3b){return function(_0x23f2e1){if(!_0x23f2e1){_0x4b1f5c[_0xb0c4('0x1b')](0x194);}return _0x23f2e1;};}function handleError(_0x5db940,_0x1606de){_0x1606de=_0x1606de||0x1f4;return function(_0x49d115){logger[_0xb0c4('0x2a')](_0x49d115[_0xb0c4('0x2b')]);if(_0x49d115[_0xb0c4('0x2c')]){delete _0x49d115[_0xb0c4('0x2c')];}_0x5db940[_0xb0c4('0x1c')](_0x1606de)['send'](_0x49d115);};}exports[_0xb0c4('0x2d')]=function(_0x524f10,_0x49c033){var _0x6c62f9={},_0x58c317={},_0x1080a8={'count':0x0,'rows':[]};var _0x2160bc=_['map'](db['SquareRecording'][_0xb0c4('0x2e')],function(_0x557bac){return{'name':_0x557bac['fieldName'],'type':_0x557bac['type']['key']};});_0x58c317[_0xb0c4('0x2f')]=_[_0xb0c4('0x30')](_0x2160bc,'name');_0x58c317[_0xb0c4('0x31')]=_['keys'](_0x524f10[_0xb0c4('0x31')]);_0x58c317['filters']=_[_0xb0c4('0x32')](_0x58c317['model'],_0x58c317[_0xb0c4('0x31')]);_0x6c62f9[_0xb0c4('0x33')]=_[_0xb0c4('0x32')](_0x58c317['model'],qs[_0xb0c4('0x34')](_0x524f10[_0xb0c4('0x31')]['fields']));_0x6c62f9[_0xb0c4('0x33')]=_0x6c62f9[_0xb0c4('0x33')]['length']?_0x6c62f9['attributes']:_0x58c317[_0xb0c4('0x2f')];if(!_0x524f10[_0xb0c4('0x31')][_0xb0c4('0x35')](_0xb0c4('0x36'))){_0x6c62f9[_0xb0c4('0x22')]=qs[_0xb0c4('0x22')](_0x524f10[_0xb0c4('0x31')]['limit']);_0x6c62f9[_0xb0c4('0x1f')]=qs['offset'](_0x524f10[_0xb0c4('0x31')][_0xb0c4('0x1f')]);}_0x6c62f9[_0xb0c4('0x37')]=qs[_0xb0c4('0x38')](_0x524f10[_0xb0c4('0x31')][_0xb0c4('0x38')]);_0x6c62f9[_0xb0c4('0x39')]=qs[_0xb0c4('0x3a')](_['pick'](_0x524f10[_0xb0c4('0x31')],_0x58c317[_0xb0c4('0x3a')]),_0x2160bc);if(_0x524f10[_0xb0c4('0x31')][_0xb0c4('0x3b')]){_0x6c62f9[_0xb0c4('0x39')]=_[_0xb0c4('0x3c')](_0x6c62f9[_0xb0c4('0x39')],{'$or':_[_0xb0c4('0x30')](_0x2160bc,function(_0x2ea136){if(_0x2ea136[_0xb0c4('0x3d')]!=='VIRTUAL'){var _0x582643={};_0x582643[_0x2ea136['name']]={'$like':'%'+_0x524f10[_0xb0c4('0x31')][_0xb0c4('0x3b')]+'%'};return _0x582643;}})});}_0x6c62f9=_[_0xb0c4('0x3c')]({},_0x6c62f9,_0x524f10[_0xb0c4('0x3e')]);var _0x42e96d={'where':_0x6c62f9[_0xb0c4('0x39')]};return db[_0xb0c4('0x3f')]['count'](_0x42e96d)['then'](function(_0x1b7893){_0x1080a8[_0xb0c4('0x21')]=_0x1b7893;if(_0x524f10[_0xb0c4('0x31')]['includeAll']){_0x6c62f9[_0xb0c4('0x40')]=[{'all':!![]}];}return db[_0xb0c4('0x3f')][_0xb0c4('0x41')](_0x6c62f9);})[_0xb0c4('0x29')](function(_0x46a62f){_0x1080a8[_0xb0c4('0x42')]=_0x46a62f;return _0x1080a8;})[_0xb0c4('0x29')](respondWithFilteredResult(_0x49c033,_0x6c62f9))['catch'](handleError(_0x49c033,null));};exports[_0xb0c4('0x43')]=function(_0x24a946,_0x15af76){var _0x2bef59={'raw':!![],'where':{'id':_0x24a946[_0xb0c4('0x44')]['id']}},_0x252de3={};_0x252de3[_0xb0c4('0x2f')]=_[_0xb0c4('0x45')](db[_0xb0c4('0x3f')]['rawAttributes']);_0x252de3[_0xb0c4('0x31')]=_['keys'](_0x24a946[_0xb0c4('0x31')]);_0x252de3[_0xb0c4('0x3a')]=_['intersection'](_0x252de3[_0xb0c4('0x2f')],_0x252de3['query']);_0x2bef59[_0xb0c4('0x33')]=_['intersection'](_0x252de3[_0xb0c4('0x2f')],qs[_0xb0c4('0x34')](_0x24a946[_0xb0c4('0x31')][_0xb0c4('0x34')]));_0x2bef59['attributes']=_0x2bef59['attributes'][_0xb0c4('0x46')]?_0x2bef59[_0xb0c4('0x33')]:_0x252de3[_0xb0c4('0x2f')];if(_0x24a946[_0xb0c4('0x31')][_0xb0c4('0x47')]){_0x2bef59[_0xb0c4('0x40')]=[{'all':!![]}];}_0x2bef59=_[_0xb0c4('0x3c')]({},_0x2bef59,_0x24a946[_0xb0c4('0x3e')]);return db[_0xb0c4('0x3f')][_0xb0c4('0x48')](_0x2bef59)[_0xb0c4('0x29')](handleEntityNotFound(_0x15af76,null))['then'](respondWithResult(_0x15af76,null))[_0xb0c4('0x49')](handleError(_0x15af76,null));};exports[_0xb0c4('0x4a')]=function(_0x4d1458,_0x46a8e8){return db[_0xb0c4('0x3f')]['create'](_0x4d1458[_0xb0c4('0x4b')],{})[_0xb0c4('0x29')](respondWithResult(_0x46a8e8,0xc9))[_0xb0c4('0x49')](handleError(_0x46a8e8,null));};exports[_0xb0c4('0x28')]=function(_0x1b9314,_0x3ade34){if(_0x1b9314[_0xb0c4('0x4b')]['id']){delete _0x1b9314[_0xb0c4('0x4b')]['id'];}return db['SquareRecording'][_0xb0c4('0x48')]({'where':{'id':_0x1b9314[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x29')](handleEntityNotFound(_0x3ade34,null))['then'](saveUpdates(_0x1b9314[_0xb0c4('0x4b')],null))['then'](respondWithResult(_0x3ade34,null))['catch'](handleError(_0x3ade34,null));};exports[_0xb0c4('0x4c')]=function(_0x233dd6,_0x56878a,_0x544802){var _0x11c14e=require(_0xb0c4('0x4d'));var _0x3c6355=![];var _0x24810f={};if(_0x233dd6[_0xb0c4('0x31')][_0xb0c4('0x3d')]&&_0x233dd6[_0xb0c4('0x31')][_0xb0c4('0x3d')]===_0xb0c4('0x4e')){_0x24810f['uniqueid']=_0x233dd6[_0xb0c4('0x44')]['id'];}else{_0x24810f['id']=_0x233dd6[_0xb0c4('0x44')]['id'];}return db[_0xb0c4('0x3f')]['find']({'where':_0x24810f,'attributes':['id',_0xb0c4('0x4f'),_0xb0c4('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x56878a,null))[_0xb0c4('0x29')](function(_0x3d8466){if(_0x3d8466){var _0x2cb54d=_0x3d8466[_0xb0c4('0x4f')];var _0x42957d=util['format'](_0xb0c4('0x51'),_0x2cb54d);if(fs['existsSync'](_0x42957d)){_0x3c6355=!![];return _0x11c14e['decryptFile'](_0x42957d,_0x2cb54d,config['secrets'][_0xb0c4('0x52')])['then'](function(){return _0x3d8466;});}return _0x3d8466;}})['then'](function(_0x5af9b7){if(_0x5af9b7){var _0x9d0826=_0x5af9b7[_0xb0c4('0x4f')];if(!fs[_0xb0c4('0x53')](_0x9d0826)){throw new db[(_0xb0c4('0x54'))][(_0xb0c4('0x55'))](_0xb0c4('0x56'));}if(_0x5af9b7[_0xb0c4('0x50')]){return _0x56878a[_0xb0c4('0x4c')](_0x9d0826,_0x5af9b7[_0xb0c4('0x50')]+path['extname'](_0x9d0826),function(){if(_0x3c6355){fs[_0xb0c4('0x57')](_0x9d0826);}});}else{return _0x56878a['download'](_0x9d0826,function(_0x3d16ad){if(_0x3c6355){fs[_0xb0c4('0x57')](_0x9d0826);}});}}})[_0xb0c4('0x49')](function(_0x12cced){if(_0x12cced[_0xb0c4('0x58')]==='SquareRecording\x20not\x20found'){_0x56878a['status'](0x194)[_0xb0c4('0x59')](_0xb0c4('0x5a'));}else{return handleError(_0x56878a,null);}});};exports[_0xb0c4('0x5b')]=function(_0x105d60,_0x4fab0f){return db[_0xb0c4('0x3f')][_0xb0c4('0x48')]({'where':{'id':_0x105d60[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x29')](function(_0x2ea930){if(_[_0xb0c4('0x5c')](_0x2ea930)){throw new ReferenceError(_0xb0c4('0x5d'));}return _0x2ea930;})[_0xb0c4('0x29')](function(_0x4eef17){var _0x109a1e=_0x4eef17[_0xb0c4('0x4f')];logger[_0xb0c4('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x109a1e);if(!_[_0xb0c4('0x5c')](_0x4eef17['savePath'])&&fs[_0xb0c4('0x53')](_0x109a1e)){logger[_0xb0c4('0x5e')]('File:\x20\x22'+_0x109a1e+_0xb0c4('0x5f'));fs[_0xb0c4('0x60')](_0x109a1e);}_0x109a1e=_0x109a1e+'.cypher';if(!_[_0xb0c4('0x5c')](_0x4eef17[_0xb0c4('0x4f')])&&fs[_0xb0c4('0x53')](_0x109a1e)){logger[_0xb0c4('0x5e')](_0xb0c4('0x61')+_0x109a1e+_0xb0c4('0x5f'));fs[_0xb0c4('0x60')](_0x109a1e);}return _0x4eef17;})[_0xb0c4('0x29')](function(_0xcb2e77){if(!_0xcb2e77)throw new InternalError();return _0xcb2e77[_0xb0c4('0x5b')]();})[_0xb0c4('0x29')](function(){_0x4fab0f[_0xb0c4('0x1c')](0xcc)[_0xb0c4('0x1d')]();})['catch'](handleError(_0x4fab0f,null));}; \ No newline at end of file +var _0x5183=['SquareRecording','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','catch','create','body','uniqueid','filename','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','SquareRecording\x20not\x20found','extname','unlink','download','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map'];(function(_0x43f9ce,_0x50786f){var _0x54e881=function(_0x16c6c4){while(--_0x16c6c4){_0x43f9ce['push'](_0x43f9ce['shift']());}};_0x54e881(++_0x50786f);}(_0x5183,0x1c0));var _0x3518=function(_0x5e47b9,_0x11878a){_0x5e47b9=_0x5e47b9-0x0;var _0x2a5834=_0x5183[_0x5e47b9];return _0x2a5834;};'use strict';var emlformat=require(_0x3518('0x0'));var rimraf=require(_0x3518('0x1'));var zipdir=require(_0x3518('0x2'));var jsonpatch=require(_0x3518('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3518('0x4'));var Mustache=require(_0x3518('0x5'));var util=require(_0x3518('0x6'));var path=require(_0x3518('0x7'));var sox=require(_0x3518('0x8'));var csv=require(_0x3518('0x9'));var ejs=require(_0x3518('0xa'));var fs=require('fs');var fs_extra=require(_0x3518('0xb'));var _=require(_0x3518('0xc'));var squel=require(_0x3518('0xd'));var crypto=require(_0x3518('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3518('0xf'));var toCsv=require(_0x3518('0x9'));var querystring=require(_0x3518('0x10'));var Papa=require(_0x3518('0x11'));var Redis=require(_0x3518('0x12'));var authService=require(_0x3518('0x13'));var qs=require(_0x3518('0x14'));var as=require(_0x3518('0x15'));var hardwareService=require(_0x3518('0x16'));var logger=require('../../config/logger')(_0x3518('0x17'));var utils=require('../../config/utils');var config=require(_0x3518('0x18'));var licenseUtil=require(_0x3518('0x19'));var db=require(_0x3518('0x1a'))['db'];function respondWithStatusCode(_0x8d98f,_0x34e752){_0x34e752=_0x34e752||0xcc;return function(_0x1f373b){if(_0x1f373b){return _0x8d98f[_0x3518('0x1b')](_0x34e752);}return _0x8d98f[_0x3518('0x1c')](_0x34e752)[_0x3518('0x1d')]();};}function respondWithResult(_0x2b10b1,_0x68d359){_0x68d359=_0x68d359||0xc8;return function(_0x438fb7){if(_0x438fb7){return _0x2b10b1[_0x3518('0x1c')](_0x68d359)[_0x3518('0x1e')](_0x438fb7);}};}function respondWithFilteredResult(_0x4c4b0d,_0x3a1752){return function(_0xfe2920){if(_0xfe2920){var _0x54974f=typeof _0x3a1752[_0x3518('0x1f')]==='undefined'&&typeof _0x3a1752[_0x3518('0x20')]===_0x3518('0x21');var _0x657190=_0xfe2920[_0x3518('0x22')];var _0x33933b=_0x54974f?0x0:_0x3a1752[_0x3518('0x1f')];var _0x36a05d=_0x54974f?_0xfe2920[_0x3518('0x22')]:_0x3a1752[_0x3518('0x1f')]+_0x3a1752[_0x3518('0x20')];var _0x34895f;if(_0x36a05d>=_0x657190){_0x36a05d=_0x657190;_0x34895f=0xc8;}else{_0x34895f=0xce;}_0x4c4b0d['status'](_0x34895f);return _0x4c4b0d['set'](_0x3518('0x23'),_0x33933b+'-'+_0x36a05d+'/'+_0x657190)['json'](_0xfe2920);}return null;};}function patchUpdates(_0x1c611d){return function(_0x334840){try{jsonpatch[_0x3518('0x24')](_0x334840,_0x1c611d,!![]);}catch(_0x4dfb65){return BPromise[_0x3518('0x25')](_0x4dfb65);}return _0x334840[_0x3518('0x26')]();};}function saveUpdates(_0x28c644,_0x2a1232){return function(_0x199068){if(_0x199068){return _0x199068[_0x3518('0x27')](_0x28c644)['then'](function(_0x40b060){return _0x40b060;});}return null;};}function removeEntity(_0x27a6eb,_0x472e92){return function(_0x23beb2){if(_0x23beb2){return _0x23beb2[_0x3518('0x28')]()[_0x3518('0x29')](function(){_0x27a6eb[_0x3518('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7afca0,_0x410f0e){return function(_0x3953ad){if(!_0x3953ad){_0x7afca0['sendStatus'](0x194);}return _0x3953ad;};}function handleError(_0x5ead1f,_0x3739c0){_0x3739c0=_0x3739c0||0x1f4;return function(_0x3753e5){logger[_0x3518('0x2a')](_0x3753e5[_0x3518('0x2b')]);if(_0x3753e5[_0x3518('0x2c')]){delete _0x3753e5[_0x3518('0x2c')];}_0x5ead1f[_0x3518('0x1c')](_0x3739c0)[_0x3518('0x2d')](_0x3753e5);};}exports['index']=function(_0x1e1924,_0x5f085d){var _0x3747ad={},_0x76e58={},_0x3017ef={'count':0x0,'rows':[]};var _0x2ce10b=_[_0x3518('0x2e')](db[_0x3518('0x2f')][_0x3518('0x30')],function(_0x3c1499){return{'name':_0x3c1499[_0x3518('0x31')],'type':_0x3c1499[_0x3518('0x32')]['key']};});_0x76e58['model']=_[_0x3518('0x2e')](_0x2ce10b,_0x3518('0x2c'));_0x76e58[_0x3518('0x33')]=_['keys'](_0x1e1924[_0x3518('0x33')]);_0x76e58[_0x3518('0x34')]=_[_0x3518('0x35')](_0x76e58[_0x3518('0x36')],_0x76e58[_0x3518('0x33')]);_0x3747ad[_0x3518('0x37')]=_['intersection'](_0x76e58[_0x3518('0x36')],qs['fields'](_0x1e1924[_0x3518('0x33')][_0x3518('0x38')]));_0x3747ad[_0x3518('0x37')]=_0x3747ad[_0x3518('0x37')][_0x3518('0x39')]?_0x3747ad[_0x3518('0x37')]:_0x76e58[_0x3518('0x36')];if(!_0x1e1924[_0x3518('0x33')]['hasOwnProperty'](_0x3518('0x3a'))){_0x3747ad['limit']=qs[_0x3518('0x20')](_0x1e1924[_0x3518('0x33')][_0x3518('0x20')]);_0x3747ad[_0x3518('0x1f')]=qs[_0x3518('0x1f')](_0x1e1924[_0x3518('0x33')]['offset']);}_0x3747ad[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_0x1e1924[_0x3518('0x33')]['sort']);_0x3747ad[_0x3518('0x3d')]=qs['filters'](_[_0x3518('0x3e')](_0x1e1924['query'],_0x76e58[_0x3518('0x34')]),_0x2ce10b);if(_0x1e1924['query'][_0x3518('0x3f')]){_0x3747ad[_0x3518('0x3d')]=_[_0x3518('0x40')](_0x3747ad['where'],{'$or':_[_0x3518('0x2e')](_0x2ce10b,function(_0x49ec4a){if(_0x49ec4a['type']!==_0x3518('0x41')){var _0x33f578={};_0x33f578[_0x49ec4a[_0x3518('0x2c')]]={'$like':'%'+_0x1e1924[_0x3518('0x33')]['filter']+'%'};return _0x33f578;}})});}_0x3747ad=_['merge']({},_0x3747ad,_0x1e1924[_0x3518('0x42')]);var _0x247bf0={'where':_0x3747ad['where']};return db[_0x3518('0x2f')][_0x3518('0x22')](_0x247bf0)['then'](function(_0x1847df){_0x3017ef['count']=_0x1847df;if(_0x1e1924['query'][_0x3518('0x43')]){_0x3747ad['include']=[{'all':!![]}];}return db[_0x3518('0x2f')]['findAll'](_0x3747ad);})['then'](function(_0x56005e){_0x3017ef[_0x3518('0x44')]=_0x56005e;return _0x3017ef;})[_0x3518('0x29')](respondWithFilteredResult(_0x5f085d,_0x3747ad))['catch'](handleError(_0x5f085d,null));};exports[_0x3518('0x45')]=function(_0x2cd809,_0x41db01){var _0x116fd8={'raw':!![],'where':{'id':_0x2cd809[_0x3518('0x46')]['id']}},_0x167be6={};_0x167be6[_0x3518('0x36')]=_[_0x3518('0x47')](db[_0x3518('0x2f')][_0x3518('0x30')]);_0x167be6[_0x3518('0x33')]=_[_0x3518('0x47')](_0x2cd809['query']);_0x167be6[_0x3518('0x34')]=_[_0x3518('0x35')](_0x167be6['model'],_0x167be6[_0x3518('0x33')]);_0x116fd8['attributes']=_[_0x3518('0x35')](_0x167be6[_0x3518('0x36')],qs[_0x3518('0x38')](_0x2cd809[_0x3518('0x33')][_0x3518('0x38')]));_0x116fd8[_0x3518('0x37')]=_0x116fd8[_0x3518('0x37')][_0x3518('0x39')]?_0x116fd8[_0x3518('0x37')]:_0x167be6[_0x3518('0x36')];if(_0x2cd809[_0x3518('0x33')][_0x3518('0x43')]){_0x116fd8[_0x3518('0x48')]=[{'all':!![]}];}_0x116fd8=_['merge']({},_0x116fd8,_0x2cd809[_0x3518('0x42')]);return db[_0x3518('0x2f')][_0x3518('0x49')](_0x116fd8)[_0x3518('0x29')](handleEntityNotFound(_0x41db01,null))[_0x3518('0x29')](respondWithResult(_0x41db01,null))[_0x3518('0x4a')](handleError(_0x41db01,null));};exports[_0x3518('0x4b')]=function(_0x3475fe,_0x37596f){return db[_0x3518('0x2f')][_0x3518('0x4b')](_0x3475fe[_0x3518('0x4c')],{})[_0x3518('0x29')](respondWithResult(_0x37596f,0xc9))[_0x3518('0x4a')](handleError(_0x37596f,null));};exports[_0x3518('0x27')]=function(_0x2e66d0,_0x56f1f7){if(_0x2e66d0[_0x3518('0x4c')]['id']){delete _0x2e66d0[_0x3518('0x4c')]['id'];}return db[_0x3518('0x2f')]['find']({'where':{'id':_0x2e66d0['params']['id']}})[_0x3518('0x29')](handleEntityNotFound(_0x56f1f7,null))[_0x3518('0x29')](saveUpdates(_0x2e66d0[_0x3518('0x4c')],null))[_0x3518('0x29')](respondWithResult(_0x56f1f7,null))[_0x3518('0x4a')](handleError(_0x56f1f7,null));};exports['download']=function(_0x2cec23,_0x34bc41,_0x37a8b3){var _0x48358f=require('../../components/encryptor');var _0xc728af=![];var _0x889cc={};if(_0x2cec23[_0x3518('0x33')][_0x3518('0x32')]&&_0x2cec23[_0x3518('0x33')]['type']===_0x3518('0x4d')){_0x889cc[_0x3518('0x4d')]=_0x2cec23[_0x3518('0x46')]['id'];}else{_0x889cc['id']=_0x2cec23[_0x3518('0x46')]['id'];}return db[_0x3518('0x2f')][_0x3518('0x49')]({'where':_0x889cc,'attributes':['id','savePath',_0x3518('0x4e')],'raw':!![]})[_0x3518('0x29')](handleEntityNotFound(_0x34bc41,null))[_0x3518('0x29')](function(_0x5cf11f){if(_0x5cf11f){var _0x2fe041=_0x5cf11f['savePath'];var _0x23a4ee=util['format'](_0x3518('0x4f'),_0x2fe041);if(fs[_0x3518('0x50')](_0x23a4ee)){_0xc728af=!![];return _0x48358f[_0x3518('0x51')](_0x23a4ee,_0x2fe041,config[_0x3518('0x52')][_0x3518('0x53')])[_0x3518('0x29')](function(){return _0x5cf11f;});}return _0x5cf11f;}})[_0x3518('0x29')](function(_0x195d26){if(_0x195d26){var _0x2c87c3=_0x195d26[_0x3518('0x54')];if(!fs[_0x3518('0x50')](_0x2c87c3)){throw new db[(_0x3518('0x55'))]['ValidationError'](_0x3518('0x56'));}if(_0x195d26[_0x3518('0x4e')]){return _0x34bc41['download'](_0x2c87c3,_0x195d26[_0x3518('0x4e')]+path[_0x3518('0x57')](_0x2c87c3),function(){if(_0xc728af){fs[_0x3518('0x58')](_0x2c87c3);}});}else{return _0x34bc41[_0x3518('0x59')](_0x2c87c3,function(_0x3bcb8e){if(_0xc728af){fs[_0x3518('0x58')](_0x2c87c3);}});}}})['catch'](function(_0x3df0d1){if(_0x3df0d1[_0x3518('0x5a')]==='SquareRecording\x20not\x20found'){_0x34bc41['status'](0x194)[_0x3518('0x2d')](_0x3518('0x5b'));}else{return handleError(_0x34bc41,null);}});};exports['destroy']=function(_0x61f77,_0x3ce43c){return db[_0x3518('0x2f')][_0x3518('0x49')]({'where':{'id':_0x61f77[_0x3518('0x46')]['id']}})['then'](function(_0x4ea062){if(_[_0x3518('0x5c')](_0x4ea062)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ea062;})[_0x3518('0x29')](function(_0x36f0ff){var _0x16b39b=_0x36f0ff[_0x3518('0x54')];logger[_0x3518('0x5d')](_0x3518('0x5e'),_0x16b39b);if(!_[_0x3518('0x5c')](_0x36f0ff[_0x3518('0x54')])&&fs[_0x3518('0x50')](_0x16b39b)){logger[_0x3518('0x5d')](_0x3518('0x5f')+_0x16b39b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x16b39b);}_0x16b39b=_0x16b39b+_0x3518('0x60');if(!_[_0x3518('0x5c')](_0x36f0ff[_0x3518('0x54')])&&fs[_0x3518('0x50')](_0x16b39b)){logger[_0x3518('0x5d')]('File:\x20\x22'+_0x16b39b+_0x3518('0x61'));fs[_0x3518('0x62')](_0x16b39b);}return _0x36f0ff;})['then'](function(_0x389d92){if(!_0x389d92)throw new InternalError();return _0x389d92[_0x3518('0x28')]();})['then'](function(){_0x3ce43c[_0x3518('0x1c')](0xcc)[_0x3518('0x1d')]();})['catch'](handleError(_0x3ce43c,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7db37b3..4ff8d33 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 _0x0309=['square_recordings','lodash','util','../../config/logger','api','moment','request-promise','path','./squareRecording.attributes','define'];(function(_0x51ceb5,_0x415d2b){var _0x43fb10=function(_0x5339bb){while(--_0x5339bb){_0x51ceb5['push'](_0x51ceb5['shift']());}};_0x43fb10(++_0x415d2b);}(_0x0309,0x8d));var _0x9030=function(_0x36a0e4,_0x4f47e9){_0x36a0e4=_0x36a0e4-0x0;var _0x265b3f=_0x0309[_0x36a0e4];return _0x265b3f;};'use strict';var _=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var logger=require(_0x9030('0x2'))(_0x9030('0x3'));var moment=require(_0x9030('0x4'));var BPromise=require('bluebird');var rp=require(_0x9030('0x5'));var fs=require('fs');var path=require(_0x9030('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9030('0x7'));module['exports']=function(_0x56913f,_0x58c3db){return _0x56913f[_0x9030('0x8')]('SquareRecording',attributes,{'tableName':_0x9030('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd663=['api','moment','bluebird','request-promise','path','../../config/environment','define','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd663,0x1ed));var _0x3d66=function(_0x3f6ea5,_0x32095a){_0x3f6ea5=_0x3f6ea5-0x0;var _0x13b604=_0xd663[_0x3f6ea5];return _0x13b604;};'use strict';var _=require(_0x3d66('0x0'));var util=require(_0x3d66('0x1'));var logger=require('../../config/logger')(_0x3d66('0x2'));var moment=require(_0x3d66('0x3'));var BPromise=require(_0x3d66('0x4'));var rp=require(_0x3d66('0x5'));var fs=require('fs');var path=require(_0x3d66('0x6'));var rimraf=require('rimraf');var config=require(_0x3d66('0x7'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x5b7bf3,_0x4f2b7a){return _0x5b7bf3[_0x3d66('0x8')]('SquareRecording',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 b4c9694..f573aa0 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 _0x5ff5=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x280a2e,_0x244c6f){var _0x286f67=function(_0xe4620b){while(--_0xe4620b){_0x280a2e['push'](_0x280a2e['shift']());}};_0x286f67(++_0x244c6f);}(_0x5ff5,0x16b));var _0x55ff=function(_0x54ebc3,_0x69c128){_0x54ebc3=_0x54ebc3-0x0;var _0x145d78=_0x5ff5[_0x54ebc3];return _0x145d78;};'use strict';var _=require(_0x55ff('0x0'));var util=require(_0x55ff('0x1'));var moment=require(_0x55ff('0x2'));var BPromise=require(_0x55ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55ff('0x4'));var db=require(_0x55ff('0x5'))['db'];var utils=require(_0x55ff('0x6'));var logger=require(_0x55ff('0x7'))('rpc');var config=require(_0x55ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa3bdd7,_0x5f5b2c,_0xb4888b){return new BPromise(function(_0x283027,_0x5090b9){return client[_0x55ff('0xa')](_0xa3bdd7,_0xb4888b)[_0x55ff('0xb')](function(_0x20f870){logger[_0x55ff('0xc')](_0x55ff('0xd'),_0x5f5b2c,_0x55ff('0xe'));logger[_0x55ff('0xf')](_0x55ff('0x10'),_0x5f5b2c,_0x55ff('0xe'),JSON[_0x55ff('0x11')](_0x20f870));if(_0x20f870[_0x55ff('0x12')]){if(_0x20f870[_0x55ff('0x12')][_0x55ff('0x13')]===0x1f4){logger[_0x55ff('0x12')](_0x55ff('0xd'),_0x5f5b2c,_0x20f870['error'][_0x55ff('0x14')]);return _0x5090b9(_0x20f870[_0x55ff('0x12')][_0x55ff('0x14')]);}logger[_0x55ff('0x12')]('SquareRecording,\x20%s,\x20%s',_0x5f5b2c,_0x20f870[_0x55ff('0x12')][_0x55ff('0x14')]);return _0x283027(_0x20f870[_0x55ff('0x12')][_0x55ff('0x14')]);}else{logger[_0x55ff('0xc')](_0x55ff('0xd'),_0x5f5b2c,_0x55ff('0xe'));_0x283027(_0x20f870[_0x55ff('0x15')][_0x55ff('0x14')]);}})['catch'](function(_0x4406e0){logger[_0x55ff('0x12')](_0x55ff('0xd'),_0x5f5b2c,_0x4406e0);_0x5090b9(_0x4406e0);});});}exports[_0x55ff('0x16')]=function(_0x35570a){var _0x1011d3=this;return new Promise(function(_0x4717db,_0xa86da4){return db[_0x55ff('0x17')]['create'](_0x35570a[_0x55ff('0x18')],{'raw':_0x35570a[_0x55ff('0x19')]?_0x35570a[_0x55ff('0x19')][_0x55ff('0x1a')]===undefined?!![]:![]:!![]})[_0x55ff('0xb')](function(_0x58f973){logger[_0x55ff('0xc')](_0x55ff('0x16'),_0x35570a);logger[_0x55ff('0xf')]('CreateSquareRecording',_0x35570a,JSON[_0x55ff('0x11')](_0x58f973));_0x4717db(_0x58f973);})['catch'](function(_0x6414c5){logger[_0x55ff('0x12')](_0x55ff('0x16'),_0x6414c5[_0x55ff('0x14')],_0x35570a);_0xa86da4(_0x1011d3[_0x55ff('0x12')](0x1f4,_0x6414c5['message']));});});}; \ No newline at end of file +var _0x73cb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','error','code','message','SquareRecording,\x20%s,\x20%s','info','result','CreateSquareRecording','body','options','raw','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x73cb,0x1d6));var _0xb73c=function(_0x55d679,_0x236d94){_0x55d679=_0x55d679-0x0;var _0x4c82e7=_0x73cb[_0x55d679];return _0x4c82e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb73c('0x0'));var BPromise=require(_0xb73c('0x1'));var rs=require(_0xb73c('0x2'));var fs=require('fs');var Redis=require(_0xb73c('0x3'));var db=require(_0xb73c('0x4'))['db'];var utils=require(_0xb73c('0x5'));var logger=require(_0xb73c('0x6'))(_0xb73c('0x7'));var config=require(_0xb73c('0x8'));var jayson=require(_0xb73c('0x9'));var client=jayson['client'][_0xb73c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d228,_0x47fe2f,_0x1e291a){return new BPromise(function(_0x3cdc66,_0x2cf304){return client[_0xb73c('0xb')](_0x25d228,_0x1e291a)['then'](function(_0x365a7a){logger['info']('SquareRecording,\x20%s,\x20%s',_0x47fe2f,_0xb73c('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x47fe2f,_0xb73c('0xc'),JSON['stringify'](_0x365a7a));if(_0x365a7a[_0xb73c('0xd')]){if(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xe')]===0x1f4){logger[_0xb73c('0xd')]('SquareRecording,\x20%s,\x20%s',_0x47fe2f,_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);return _0x2cf304(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);}logger[_0xb73c('0xd')](_0xb73c('0x10'),_0x47fe2f,_0x365a7a[_0xb73c('0xd')]['message']);return _0x3cdc66(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);}else{logger[_0xb73c('0x11')](_0xb73c('0x10'),_0x47fe2f,'request\x20sent');_0x3cdc66(_0x365a7a[_0xb73c('0x12')][_0xb73c('0xf')]);}})['catch'](function(_0x30c872){logger[_0xb73c('0xd')](_0xb73c('0x10'),_0x47fe2f,_0x30c872);_0x2cf304(_0x30c872);});});}exports[_0xb73c('0x13')]=function(_0x3a376d){var _0xb9733d=this;return new Promise(function(_0x120bb3,_0x52f683){return db['SquareRecording']['create'](_0x3a376d[_0xb73c('0x14')],{'raw':_0x3a376d[_0xb73c('0x15')]?_0x3a376d[_0xb73c('0x15')][_0xb73c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1889f4){logger['info'](_0xb73c('0x13'),_0x3a376d);logger[_0xb73c('0x17')](_0xb73c('0x13'),_0x3a376d,JSON[_0xb73c('0x18')](_0x1889f4));_0x120bb3(_0x1889f4);})['catch'](function(_0x5c09ee){logger['error'](_0xb73c('0x13'),_0x5c09ee[_0xb73c('0xf')],_0x3a376d);_0x52f683(_0xb9733d[_0xb73c('0xd')](0x1f4,_0x5c09ee[_0xb73c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 50000bb..4907d8d 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4b88a0,_0x999916){var _0x1d00b1=function(_0x5bc667){while(--_0x5bc667){_0x4b88a0['push'](_0x4b88a0['shift']());}};_0x1d00b1(++_0x999916);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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 fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x21f0c4,_0xa82bf1){var _0x3ad0e0=function(_0x4cafe2){while(--_0x4cafe2){_0x21f0c4['push'](_0x21f0c4['shift']());}};_0x3ad0e0(++_0xa82bf1);}(_0xe706,0xa3));var _0x6e70=function(_0x4d525c,_0x277dac){_0x4d525c=_0x4d525c-0x0;var _0x3f0655=_0xe706[_0x4d525c];return _0x3f0655;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9641fc0..6aecc93 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 _0xf03e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3068c8,_0x1f5504){var _0x40c6e4=function(_0x4e1f11){while(--_0x4e1f11){_0x3068c8['push'](_0x3068c8['shift']());}};_0x40c6e4(++_0x1f5504);}(_0xf03e,0x129));var _0xef03=function(_0x9f2f79,_0x5d8d53){_0x9f2f79=_0x9f2f79-0x0;var _0x4f066b=_0xf03e[_0x9f2f79];return _0x4f066b;};'use strict';var Sequelize=require(_0xef03('0x0'));module[_0xef03('0x1')]={'network':{'type':Sequelize[_0xef03('0x2')]},'network_script':{'type':Sequelize[_0xef03('0x2')]},'request':{'type':Sequelize[_0xef03('0x2')]},'channel':{'type':Sequelize[_0xef03('0x2')]},'language':{'type':Sequelize[_0xef03('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xef03('0x2')]},'version':{'type':Sequelize[_0xef03('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xef03('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xef03('0x2')]},'callington':{'type':Sequelize[_0xef03('0x2')]},'callingtns':{'type':Sequelize[_0xef03('0x2')]},'dnid':{'type':Sequelize[_0xef03('0x2')]},'rdnis':{'type':Sequelize[_0xef03('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xef03('0x2')]},'priority':{'type':Sequelize[_0xef03('0x2')]},'enhanced':{'type':Sequelize[_0xef03('0x2')]},'accountcode':{'type':Sequelize[_0xef03('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xef03('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b3a=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x0b3a,0x114));var _0xa0b3=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x0b3a[_0x2e6c19];return _0x52885d;};'use strict';var Sequelize=require(_0xa0b3('0x0'));module['exports']={'network':{'type':Sequelize[_0xa0b3('0x1')]},'network_script':{'type':Sequelize[_0xa0b3('0x1')]},'request':{'type':Sequelize[_0xa0b3('0x1')]},'channel':{'type':Sequelize[_0xa0b3('0x1')]},'language':{'type':Sequelize[_0xa0b3('0x1')]},'type':{'type':Sequelize[_0xa0b3('0x1')]},'uniqueid':{'type':Sequelize[_0xa0b3('0x1')]},'version':{'type':Sequelize[_0xa0b3('0x1')]},'callerid':{'type':Sequelize[_0xa0b3('0x1')]},'calleridname':{'type':Sequelize[_0xa0b3('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa0b3('0x1')]},'callington':{'type':Sequelize[_0xa0b3('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xa0b3('0x1')]},'rdnis':{'type':Sequelize[_0xa0b3('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa0b3('0x1')]},'priority':{'type':Sequelize[_0xa0b3('0x1')]},'enhanced':{'type':Sequelize[_0xa0b3('0x1')]},'accountcode':{'type':Sequelize[_0xa0b3('0x1')]},'threadid':{'type':Sequelize[_0xa0b3('0x1')]},'project_name':{'type':Sequelize[_0xa0b3('0x1')]},'joinAt':{'type':Sequelize[_0xa0b3('0x2')]},'leaveAt':{'type':Sequelize[_0xa0b3('0x2')]},'bot':{'type':Sequelize[_0xa0b3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 9403cfe..287898c 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 _0x6fe6=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','findAll','rows','catch','show','params','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x4e029f,_0x177074){var _0x135b7e=function(_0x37caff){while(--_0x37caff){_0x4e029f['push'](_0x4e029f['shift']());}};_0x135b7e(++_0x177074);}(_0x6fe6,0x15c));var _0x66fe=function(_0x414d13,_0x408f14){_0x414d13=_0x414d13-0x0;var _0xeef0b=_0x6fe6[_0x414d13];return _0xeef0b;};'use strict';var emlformat=require(_0x66fe('0x0'));var rimraf=require(_0x66fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66fe('0x2'));var rp=require(_0x66fe('0x3'));var moment=require(_0x66fe('0x4'));var BPromise=require(_0x66fe('0x5'));var Mustache=require(_0x66fe('0x6'));var util=require(_0x66fe('0x7'));var path=require(_0x66fe('0x8'));var sox=require(_0x66fe('0x9'));var csv=require(_0x66fe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66fe('0xb'));var _=require(_0x66fe('0xc'));var squel=require(_0x66fe('0xd'));var crypto=require(_0x66fe('0xe'));var jsforce=require(_0x66fe('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x66fe('0x10'));var Papa=require('papaparse');var Redis=require(_0x66fe('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66fe('0x12'));var hardwareService=require(_0x66fe('0x13'));var logger=require(_0x66fe('0x14'))('api');var utils=require(_0x66fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x66fe('0x16'));var db=require(_0x66fe('0x17'))['db'];function respondWithStatusCode(_0x4ab326,_0x1693e5){_0x1693e5=_0x1693e5||0xcc;return function(_0x50d848){if(_0x50d848){return _0x4ab326[_0x66fe('0x18')](_0x1693e5);}return _0x4ab326[_0x66fe('0x19')](_0x1693e5)[_0x66fe('0x1a')]();};}function respondWithResult(_0x410b64,_0x45a795){_0x45a795=_0x45a795||0xc8;return function(_0x476e1e){if(_0x476e1e){return _0x410b64['status'](_0x45a795)[_0x66fe('0x1b')](_0x476e1e);}};}function respondWithFilteredResult(_0x4e56e0,_0x136064){return function(_0x1a0b88){if(_0x1a0b88){var _0x3204e5=typeof _0x136064[_0x66fe('0x1c')]===_0x66fe('0x1d')&&typeof _0x136064['limit']==='undefined';var _0x1b846e=_0x1a0b88['count'];var _0x7383e8=_0x3204e5?0x0:_0x136064[_0x66fe('0x1c')];var _0xa21d97=_0x3204e5?_0x1a0b88[_0x66fe('0x1e')]:_0x136064[_0x66fe('0x1c')]+_0x136064['limit'];var _0x22c3a3;if(_0xa21d97>=_0x1b846e){_0xa21d97=_0x1b846e;_0x22c3a3=0xc8;}else{_0x22c3a3=0xce;}_0x4e56e0['status'](_0x22c3a3);return _0x4e56e0[_0x66fe('0x1f')](_0x66fe('0x20'),_0x7383e8+'-'+_0xa21d97+'/'+_0x1b846e)['json'](_0x1a0b88);}return null;};}function patchUpdates(_0x9b806f){return function(_0x42f8eb){try{jsonpatch[_0x66fe('0x21')](_0x42f8eb,_0x9b806f,!![]);}catch(_0x36ec7d){return BPromise[_0x66fe('0x22')](_0x36ec7d);}return _0x42f8eb[_0x66fe('0x23')]();};}function saveUpdates(_0x63c0e1,_0x56180c){return function(_0x2c2df5){if(_0x2c2df5){return _0x2c2df5[_0x66fe('0x24')](_0x63c0e1)[_0x66fe('0x25')](function(_0x5e5011){return _0x5e5011;});}return null;};}function removeEntity(_0x1d339b,_0x38e761){return function(_0x5f4e56){if(_0x5f4e56){return _0x5f4e56[_0x66fe('0x26')]()[_0x66fe('0x25')](function(){_0x1d339b['status'](0xcc)[_0x66fe('0x1a')]();});}};}function handleEntityNotFound(_0x4cec36,_0x569507){return function(_0xf70b2b){if(!_0xf70b2b){_0x4cec36['sendStatus'](0x194);}return _0xf70b2b;};}function handleError(_0x4cbccd,_0x5cac40){_0x5cac40=_0x5cac40||0x1f4;return function(_0x26d75d){logger[_0x66fe('0x27')](_0x26d75d['stack']);if(_0x26d75d[_0x66fe('0x28')]){delete _0x26d75d[_0x66fe('0x28')];}_0x4cbccd['status'](_0x5cac40)['send'](_0x26d75d);};}exports['index']=function(_0x13ba4d,_0x281609){var _0x3b6013={},_0x410d3c={},_0x321543={'count':0x0,'rows':[]};var _0x57a2bd=_['map'](db['SquareReport']['rawAttributes'],function(_0x2fcd8d){return{'name':_0x2fcd8d['fieldName'],'type':_0x2fcd8d[_0x66fe('0x29')][_0x66fe('0x2a')]};});_0x410d3c[_0x66fe('0x2b')]=_[_0x66fe('0x2c')](_0x57a2bd,_0x66fe('0x28'));_0x410d3c[_0x66fe('0x2d')]=_[_0x66fe('0x2e')](_0x13ba4d['query']);_0x410d3c[_0x66fe('0x2f')]=_[_0x66fe('0x30')](_0x410d3c[_0x66fe('0x2b')],_0x410d3c[_0x66fe('0x2d')]);_0x3b6013[_0x66fe('0x31')]=_[_0x66fe('0x30')](_0x410d3c['model'],qs[_0x66fe('0x32')](_0x13ba4d[_0x66fe('0x2d')][_0x66fe('0x32')]));_0x3b6013['attributes']=_0x3b6013[_0x66fe('0x31')][_0x66fe('0x33')]?_0x3b6013['attributes']:_0x410d3c['model'];if(!_0x13ba4d[_0x66fe('0x2d')][_0x66fe('0x34')](_0x66fe('0x35'))){_0x3b6013[_0x66fe('0x36')]=qs[_0x66fe('0x36')](_0x13ba4d[_0x66fe('0x2d')][_0x66fe('0x36')]);_0x3b6013[_0x66fe('0x1c')]=qs[_0x66fe('0x1c')](_0x13ba4d['query']['offset']);}_0x3b6013[_0x66fe('0x37')]=qs[_0x66fe('0x38')](_0x13ba4d[_0x66fe('0x2d')][_0x66fe('0x38')]);_0x3b6013[_0x66fe('0x39')]=qs[_0x66fe('0x2f')](_[_0x66fe('0x3a')](_0x13ba4d['query'],_0x410d3c['filters']),_0x57a2bd);if(_0x13ba4d['query'][_0x66fe('0x3b')]){_0x3b6013[_0x66fe('0x39')]=_[_0x66fe('0x3c')](_0x3b6013[_0x66fe('0x39')],{'$or':_[_0x66fe('0x2c')](_0x57a2bd,function(_0x3b6048){if(_0x3b6048['type']!==_0x66fe('0x3d')){var _0x4d7b60={};_0x4d7b60[_0x3b6048['name']]={'$like':'%'+_0x13ba4d[_0x66fe('0x2d')]['filter']+'%'};return _0x4d7b60;}})});}_0x3b6013=_[_0x66fe('0x3c')]({},_0x3b6013,_0x13ba4d[_0x66fe('0x3e')]);var _0x573040={'where':_0x3b6013[_0x66fe('0x39')]};return db[_0x66fe('0x3f')]['count'](_0x573040)[_0x66fe('0x25')](function(_0x540343){_0x321543[_0x66fe('0x1e')]=_0x540343;if(_0x13ba4d['query'][_0x66fe('0x40')]){_0x3b6013['include']=[{'all':!![]}];}return db[_0x66fe('0x3f')][_0x66fe('0x41')](_0x3b6013);})['then'](function(_0x2e53ab){_0x321543[_0x66fe('0x42')]=_0x2e53ab;return _0x321543;})[_0x66fe('0x25')](respondWithFilteredResult(_0x281609,_0x3b6013))[_0x66fe('0x43')](handleError(_0x281609,null));};exports[_0x66fe('0x44')]=function(_0x100814,_0x5dcf41){var _0x5011bf={'raw':!![],'where':{'id':_0x100814[_0x66fe('0x45')]['id']}},_0x124716={};_0x124716[_0x66fe('0x2b')]=_['keys'](db[_0x66fe('0x3f')]['rawAttributes']);_0x124716[_0x66fe('0x2d')]=_[_0x66fe('0x2e')](_0x100814[_0x66fe('0x2d')]);_0x124716[_0x66fe('0x2f')]=_[_0x66fe('0x30')](_0x124716[_0x66fe('0x2b')],_0x124716[_0x66fe('0x2d')]);_0x5011bf['attributes']=_[_0x66fe('0x30')](_0x124716[_0x66fe('0x2b')],qs[_0x66fe('0x32')](_0x100814[_0x66fe('0x2d')][_0x66fe('0x32')]));_0x5011bf[_0x66fe('0x31')]=_0x5011bf[_0x66fe('0x31')][_0x66fe('0x33')]?_0x5011bf[_0x66fe('0x31')]:_0x124716[_0x66fe('0x2b')];if(_0x100814['query'][_0x66fe('0x40')]){_0x5011bf['include']=[{'all':!![]}];}_0x5011bf=_[_0x66fe('0x3c')]({},_0x5011bf,_0x100814[_0x66fe('0x3e')]);return db['SquareReport']['find'](_0x5011bf)[_0x66fe('0x25')](handleEntityNotFound(_0x5dcf41,null))[_0x66fe('0x25')](respondWithResult(_0x5dcf41,null))[_0x66fe('0x43')](handleError(_0x5dcf41,null));};exports['create']=function(_0x2463ee,_0x1d1542){return db[_0x66fe('0x3f')]['create'](_0x2463ee[_0x66fe('0x46')],{})['then'](respondWithResult(_0x1d1542,0xc9))['catch'](handleError(_0x1d1542,null));};exports[_0x66fe('0x24')]=function(_0x26e648,_0x284c2b){if(_0x26e648['body']['id']){delete _0x26e648[_0x66fe('0x46')]['id'];}return db[_0x66fe('0x3f')][_0x66fe('0x47')]({'where':{'id':_0x26e648[_0x66fe('0x45')]['id']}})[_0x66fe('0x25')](handleEntityNotFound(_0x284c2b,null))[_0x66fe('0x25')](saveUpdates(_0x26e648[_0x66fe('0x46')],null))['then'](respondWithResult(_0x284c2b,null))[_0x66fe('0x43')](handleError(_0x284c2b,null));};exports['destroy']=function(_0x31b6a7,_0x426322){return db[_0x66fe('0x3f')][_0x66fe('0x47')]({'where':{'id':_0x31b6a7[_0x66fe('0x45')]['id']}})['then'](handleEntityNotFound(_0x426322,null))[_0x66fe('0x25')](removeEntity(_0x426322,null))['catch'](handleError(_0x426322,null));};exports[_0x66fe('0x48')]=function(_0x57e8aa,_0x2aab5d){return db['SquareReport'][_0x66fe('0x48')]()[_0x66fe('0x25')](respondWithResult(_0x2aab5d,null))[_0x66fe('0x43')](handleError(_0x2aab5d,null));}; \ No newline at end of file +var _0xae8f=['keys','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0xae8f,0xa6));var _0xfae8=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xae8f[_0x137f1a];return _0x439923;};'use strict';var emlformat=require(_0xfae8('0x0'));var rimraf=require(_0xfae8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfae8('0x2'));var rp=require(_0xfae8('0x3'));var moment=require(_0xfae8('0x4'));var BPromise=require(_0xfae8('0x5'));var Mustache=require(_0xfae8('0x6'));var util=require('util');var path=require(_0xfae8('0x7'));var sox=require(_0xfae8('0x8'));var csv=require(_0xfae8('0x9'));var ejs=require(_0xfae8('0xa'));var fs=require('fs');var fs_extra=require(_0xfae8('0xb'));var _=require(_0xfae8('0xc'));var squel=require(_0xfae8('0xd'));var crypto=require(_0xfae8('0xe'));var jsforce=require(_0xfae8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfae8('0x10'));var Papa=require(_0xfae8('0x11'));var Redis=require(_0xfae8('0x12'));var authService=require(_0xfae8('0x13'));var qs=require(_0xfae8('0x14'));var as=require(_0xfae8('0x15'));var hardwareService=require(_0xfae8('0x16'));var logger=require(_0xfae8('0x17'))(_0xfae8('0x18'));var utils=require(_0xfae8('0x19'));var config=require(_0xfae8('0x1a'));var licenseUtil=require(_0xfae8('0x1b'));var db=require(_0xfae8('0x1c'))['db'];function respondWithStatusCode(_0x2e6541,_0x20a542){_0x20a542=_0x20a542||0xcc;return function(_0x205af1){if(_0x205af1){return _0x2e6541['sendStatus'](_0x20a542);}return _0x2e6541[_0xfae8('0x1d')](_0x20a542)['end']();};}function respondWithResult(_0x118f71,_0x20835e){_0x20835e=_0x20835e||0xc8;return function(_0x5c744d){if(_0x5c744d){return _0x118f71[_0xfae8('0x1d')](_0x20835e)['json'](_0x5c744d);}};}function respondWithFilteredResult(_0x53e47a,_0x4abbc2){return function(_0xa43a2b){if(_0xa43a2b){var _0x47adf3=typeof _0x4abbc2[_0xfae8('0x1e')]==='undefined'&&typeof _0x4abbc2[_0xfae8('0x1f')]==='undefined';var _0x146910=_0xa43a2b[_0xfae8('0x20')];var _0xfefeff=_0x47adf3?0x0:_0x4abbc2['offset'];var _0xd6ea28=_0x47adf3?_0xa43a2b['count']:_0x4abbc2[_0xfae8('0x1e')]+_0x4abbc2['limit'];var _0x1268e2;if(_0xd6ea28>=_0x146910){_0xd6ea28=_0x146910;_0x1268e2=0xc8;}else{_0x1268e2=0xce;}_0x53e47a[_0xfae8('0x1d')](_0x1268e2);return _0x53e47a[_0xfae8('0x21')](_0xfae8('0x22'),_0xfefeff+'-'+_0xd6ea28+'/'+_0x146910)[_0xfae8('0x23')](_0xa43a2b);}return null;};}function patchUpdates(_0x5abead){return function(_0x364e2c){try{jsonpatch['apply'](_0x364e2c,_0x5abead,!![]);}catch(_0x4f0ee6){return BPromise[_0xfae8('0x24')](_0x4f0ee6);}return _0x364e2c[_0xfae8('0x25')]();};}function saveUpdates(_0x405941,_0x38b7d4){return function(_0x281691){if(_0x281691){return _0x281691[_0xfae8('0x26')](_0x405941)[_0xfae8('0x27')](function(_0x1233bd){return _0x1233bd;});}return null;};}function removeEntity(_0x106d4a,_0x348ab3){return function(_0x16d237){if(_0x16d237){return _0x16d237['destroy']()['then'](function(){_0x106d4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x560c0a,_0x59e461){return function(_0x8fc30a){if(!_0x8fc30a){_0x560c0a['sendStatus'](0x194);}return _0x8fc30a;};}function handleError(_0xc4701e,_0x26ae7d){_0x26ae7d=_0x26ae7d||0x1f4;return function(_0x4ccfa0){logger[_0xfae8('0x28')](_0x4ccfa0[_0xfae8('0x29')]);if(_0x4ccfa0['name']){delete _0x4ccfa0[_0xfae8('0x2a')];}_0xc4701e[_0xfae8('0x1d')](_0x26ae7d)[_0xfae8('0x2b')](_0x4ccfa0);};}exports[_0xfae8('0x2c')]=function(_0x25418b,_0x483089){var _0x3cec43={},_0x2b2d18={},_0x4ecbcb={'count':0x0,'rows':[]};var _0x356393=_[_0xfae8('0x2d')](db[_0xfae8('0x2e')][_0xfae8('0x2f')],function(_0x3550af){return{'name':_0x3550af[_0xfae8('0x30')],'type':_0x3550af[_0xfae8('0x31')][_0xfae8('0x32')]};});_0x2b2d18[_0xfae8('0x33')]=_[_0xfae8('0x2d')](_0x356393,_0xfae8('0x2a'));_0x2b2d18['query']=_['keys'](_0x25418b[_0xfae8('0x34')]);_0x2b2d18[_0xfae8('0x35')]=_['intersection'](_0x2b2d18[_0xfae8('0x33')],_0x2b2d18['query']);_0x3cec43[_0xfae8('0x36')]=_[_0xfae8('0x37')](_0x2b2d18['model'],qs['fields'](_0x25418b[_0xfae8('0x34')][_0xfae8('0x38')]));_0x3cec43[_0xfae8('0x36')]=_0x3cec43[_0xfae8('0x36')]['length']?_0x3cec43[_0xfae8('0x36')]:_0x2b2d18[_0xfae8('0x33')];if(!_0x25418b['query'][_0xfae8('0x39')](_0xfae8('0x3a'))){_0x3cec43[_0xfae8('0x1f')]=qs['limit'](_0x25418b['query'][_0xfae8('0x1f')]);_0x3cec43['offset']=qs[_0xfae8('0x1e')](_0x25418b[_0xfae8('0x34')][_0xfae8('0x1e')]);}_0x3cec43[_0xfae8('0x3b')]=qs[_0xfae8('0x3c')](_0x25418b[_0xfae8('0x34')]['sort']);_0x3cec43['where']=qs[_0xfae8('0x35')](_['pick'](_0x25418b[_0xfae8('0x34')],_0x2b2d18[_0xfae8('0x35')]),_0x356393);if(_0x25418b[_0xfae8('0x34')][_0xfae8('0x3d')]){_0x3cec43[_0xfae8('0x3e')]=_[_0xfae8('0x3f')](_0x3cec43[_0xfae8('0x3e')],{'$or':_[_0xfae8('0x2d')](_0x356393,function(_0x79fe54){if(_0x79fe54[_0xfae8('0x31')]!==_0xfae8('0x40')){var _0x4d8aca={};_0x4d8aca[_0x79fe54[_0xfae8('0x2a')]]={'$like':'%'+_0x25418b[_0xfae8('0x34')]['filter']+'%'};return _0x4d8aca;}})});}_0x3cec43=_['merge']({},_0x3cec43,_0x25418b[_0xfae8('0x41')]);var _0xeb0283={'where':_0x3cec43[_0xfae8('0x3e')]};return db[_0xfae8('0x2e')][_0xfae8('0x20')](_0xeb0283)[_0xfae8('0x27')](function(_0x3b7550){_0x4ecbcb[_0xfae8('0x20')]=_0x3b7550;if(_0x25418b[_0xfae8('0x34')]['includeAll']){_0x3cec43[_0xfae8('0x42')]=[{'all':!![]}];}return db[_0xfae8('0x2e')][_0xfae8('0x43')](_0x3cec43);})[_0xfae8('0x27')](function(_0x3e161c){_0x4ecbcb['rows']=_0x3e161c;return _0x4ecbcb;})[_0xfae8('0x27')](respondWithFilteredResult(_0x483089,_0x3cec43))[_0xfae8('0x44')](handleError(_0x483089,null));};exports[_0xfae8('0x45')]=function(_0x27f727,_0x5d885e){var _0x21ac3b={'raw':!![],'where':{'id':_0x27f727[_0xfae8('0x46')]['id']}},_0x4e2356={};_0x4e2356['model']=_[_0xfae8('0x47')](db['SquareReport'][_0xfae8('0x2f')]);_0x4e2356['query']=_[_0xfae8('0x47')](_0x27f727[_0xfae8('0x34')]);_0x4e2356['filters']=_[_0xfae8('0x37')](_0x4e2356[_0xfae8('0x33')],_0x4e2356[_0xfae8('0x34')]);_0x21ac3b[_0xfae8('0x36')]=_[_0xfae8('0x37')](_0x4e2356[_0xfae8('0x33')],qs[_0xfae8('0x38')](_0x27f727[_0xfae8('0x34')][_0xfae8('0x38')]));_0x21ac3b[_0xfae8('0x36')]=_0x21ac3b['attributes'][_0xfae8('0x48')]?_0x21ac3b[_0xfae8('0x36')]:_0x4e2356[_0xfae8('0x33')];if(_0x27f727[_0xfae8('0x34')][_0xfae8('0x49')]){_0x21ac3b['include']=[{'all':!![]}];}_0x21ac3b=_['merge']({},_0x21ac3b,_0x27f727[_0xfae8('0x41')]);return db[_0xfae8('0x2e')][_0xfae8('0x4a')](_0x21ac3b)['then'](handleEntityNotFound(_0x5d885e,null))['then'](respondWithResult(_0x5d885e,null))['catch'](handleError(_0x5d885e,null));};exports[_0xfae8('0x4b')]=function(_0x3fc8a6,_0x59c8cd){return db[_0xfae8('0x2e')][_0xfae8('0x4b')](_0x3fc8a6[_0xfae8('0x4c')],{})[_0xfae8('0x27')](respondWithResult(_0x59c8cd,0xc9))[_0xfae8('0x44')](handleError(_0x59c8cd,null));};exports[_0xfae8('0x26')]=function(_0x506ee6,_0x4a4421){if(_0x506ee6[_0xfae8('0x4c')]['id']){delete _0x506ee6['body']['id'];}return db['SquareReport'][_0xfae8('0x4a')]({'where':{'id':_0x506ee6[_0xfae8('0x46')]['id']}})[_0xfae8('0x27')](handleEntityNotFound(_0x4a4421,null))[_0xfae8('0x27')](saveUpdates(_0x506ee6[_0xfae8('0x4c')],null))['then'](respondWithResult(_0x4a4421,null))[_0xfae8('0x44')](handleError(_0x4a4421,null));};exports[_0xfae8('0x4d')]=function(_0x443947,_0x3e2eb1){return db['SquareReport'][_0xfae8('0x4a')]({'where':{'id':_0x443947['params']['id']}})[_0xfae8('0x27')](handleEntityNotFound(_0x3e2eb1,null))[_0xfae8('0x27')](removeEntity(_0x3e2eb1,null))[_0xfae8('0x44')](handleError(_0x3e2eb1,null));};exports['describe']=function(_0x8fd38f,_0x21e459){return db[_0xfae8('0x2e')][_0xfae8('0x4e')]()[_0xfae8('0x27')](respondWithResult(_0x21e459,null))[_0xfae8('0x44')](handleError(_0x21e459,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index caf2d9b..a2cbab5 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 _0x0e64=['rimraf','../../config/environment','define','SquareReport','report_square','uniqueid','project_name','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xbb701e,_0x3b704f){var _0xc53f35=function(_0x3094a9){while(--_0x3094a9){_0xbb701e['push'](_0xbb701e['shift']());}};_0xc53f35(++_0x3b704f);}(_0x0e64,0x157));var _0x40e6=function(_0x3cdbdc,_0x1c1439){_0x3cdbdc=_0x3cdbdc-0x0;var _0x3e001d=_0x0e64[_0x3cdbdc];return _0x3e001d;};'use strict';var _=require(_0x40e6('0x0'));var util=require(_0x40e6('0x1'));var logger=require(_0x40e6('0x2'))(_0x40e6('0x3'));var moment=require('moment');var BPromise=require(_0x40e6('0x4'));var rp=require(_0x40e6('0x5'));var fs=require('fs');var path=require(_0x40e6('0x6'));var rimraf=require(_0x40e6('0x7'));var config=require(_0x40e6('0x8'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x57b67f,_0x2c44f7){return _0x57b67f[_0x40e6('0x9')](_0x40e6('0xa'),attributes,{'tableName':_0x40e6('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x40e6('0xc'),_0x40e6('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x42d5=['report_square','project_name','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define'];(function(_0x4b66f2,_0x5508c1){var _0x7095e3=function(_0x5e232b){while(--_0x5e232b){_0x4b66f2['push'](_0x4b66f2['shift']());}};_0x7095e3(++_0x5508c1);}(_0x42d5,0xb8));var _0x542d=function(_0x4b1064,_0x1424cf){_0x4b1064=_0x4b1064-0x0;var _0x25ce36=_0x42d5[_0x4b1064];return _0x25ce36;};'use strict';var _=require(_0x542d('0x0'));var util=require(_0x542d('0x1'));var logger=require(_0x542d('0x2'))(_0x542d('0x3'));var moment=require(_0x542d('0x4'));var BPromise=require(_0x542d('0x5'));var rp=require(_0x542d('0x6'));var fs=require('fs');var path=require(_0x542d('0x7'));var rimraf=require(_0x542d('0x8'));var config=require(_0x542d('0x9'));var attributes=require(_0x542d('0xa'));module['exports']=function(_0x1959f8,_0x5a261c){return _0x1959f8[_0x542d('0xb')]('SquareReport',attributes,{'tableName':_0x542d('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x542d('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 972c28f..2ed593b 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 _0xb598=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','UpdateSquareReport','update','raw','where','attributes','limit'];(function(_0x5c1b0c,_0x12cfba){var _0x268a79=function(_0x30af08){while(--_0x30af08){_0x5c1b0c['push'](_0x5c1b0c['shift']());}};_0x268a79(++_0x12cfba);}(_0xb598,0x168));var _0x8b59=function(_0x513152,_0x5eb35d){_0x513152=_0x513152-0x0;var _0x1cd08b=_0xb598[_0x513152];return _0x1cd08b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b59('0x0'));var BPromise=require(_0x8b59('0x1'));var rs=require(_0x8b59('0x2'));var fs=require('fs');var Redis=require(_0x8b59('0x3'));var db=require(_0x8b59('0x4'))['db'];var utils=require(_0x8b59('0x5'));var logger=require(_0x8b59('0x6'))(_0x8b59('0x7'));var config=require(_0x8b59('0x8'));var jayson=require(_0x8b59('0x9'));var client=jayson[_0x8b59('0xa')][_0x8b59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9165,_0x55f5dd,_0x2a768a){return new BPromise(function(_0x19be3f,_0x318893){return client[_0x8b59('0xc')](_0x1f9165,_0x2a768a)[_0x8b59('0xd')](function(_0x481c8d){logger[_0x8b59('0xe')](_0x8b59('0xf'),_0x55f5dd,'request\x20sent');logger[_0x8b59('0x10')](_0x8b59('0x11'),_0x55f5dd,_0x8b59('0x12'),JSON[_0x8b59('0x13')](_0x481c8d));if(_0x481c8d[_0x8b59('0x14')]){if(_0x481c8d[_0x8b59('0x14')][_0x8b59('0x15')]===0x1f4){logger[_0x8b59('0x14')](_0x8b59('0xf'),_0x55f5dd,_0x481c8d['error']['message']);return _0x318893(_0x481c8d[_0x8b59('0x14')][_0x8b59('0x16')]);}logger[_0x8b59('0x14')](_0x8b59('0xf'),_0x55f5dd,_0x481c8d[_0x8b59('0x14')][_0x8b59('0x16')]);return _0x19be3f(_0x481c8d[_0x8b59('0x14')][_0x8b59('0x16')]);}else{logger[_0x8b59('0xe')](_0x8b59('0xf'),_0x55f5dd,'request\x20sent');_0x19be3f(_0x481c8d[_0x8b59('0x17')]['message']);}})[_0x8b59('0x18')](function(_0x473a8f){logger['error']('SquareReport,\x20%s,\x20%s',_0x55f5dd,_0x473a8f);_0x318893(_0x473a8f);});});}exports[_0x8b59('0x19')]=function(_0x5c5d39){var _0x2a1bb8=this;return new Promise(function(_0x3fbd33,_0x4aec1a){return db[_0x8b59('0x1a')][_0x8b59('0x1b')](_0x5c5d39[_0x8b59('0x1c')],{'raw':_0x5c5d39[_0x8b59('0x1d')]?_0x5c5d39[_0x8b59('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x8b59('0xd')](function(_0x2c7841){logger[_0x8b59('0xe')](_0x8b59('0x19'),_0x5c5d39);logger['debug'](_0x8b59('0x19'),_0x5c5d39,JSON[_0x8b59('0x13')](_0x2c7841));_0x3fbd33(_0x2c7841);})[_0x8b59('0x18')](function(_0x378737){logger['error'](_0x8b59('0x19'),_0x378737[_0x8b59('0x16')],_0x5c5d39);_0x4aec1a(_0x2a1bb8['error'](0x1f4,_0x378737[_0x8b59('0x16')]));});});};exports[_0x8b59('0x1e')]=function(_0xb1d9a5){var _0xe1b75b=this;return new Promise(function(_0xd092b1,_0x18ce16){return db[_0x8b59('0x1a')][_0x8b59('0x1f')](_0xb1d9a5['body'],{'raw':_0xb1d9a5[_0x8b59('0x1d')]?_0xb1d9a5[_0x8b59('0x1d')][_0x8b59('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb1d9a5['options']?_0xb1d9a5[_0x8b59('0x1d')][_0x8b59('0x21')]||null:null,'attributes':_0xb1d9a5[_0x8b59('0x1d')]?_0xb1d9a5[_0x8b59('0x1d')][_0x8b59('0x22')]||null:null,'limit':_0xb1d9a5['options']?_0xb1d9a5[_0x8b59('0x1d')][_0x8b59('0x23')]||null:null})[_0x8b59('0xd')](function(_0x16f7bf){logger['info'](_0x8b59('0x1e'),_0xb1d9a5);logger['debug'](_0x8b59('0x1e'),_0xb1d9a5,JSON[_0x8b59('0x13')](_0x16f7bf));_0xd092b1(_0x16f7bf);})[_0x8b59('0x18')](function(_0x5cd87c){logger[_0x8b59('0x14')](_0x8b59('0x1e'),_0x5cd87c[_0x8b59('0x16')],_0xb1d9a5);_0x18ce16(_0xe1b75b[_0x8b59('0x14')](0x1f4,_0x5cd87c['message']));});});}; \ No newline at end of file +var _0xba07=['debug','stringify','error','message','catch','CreateSquareReport','SquareReport','options','info','UpdateSquareReport','update','body','raw','where','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0xba07,0xff));var _0x7ba0=function(_0x3f9f40,_0x164231){_0x3f9f40=_0x3f9f40-0x0;var _0xc9f7cf=_0xba07[_0x3f9f40];return _0xc9f7cf;};'use strict';var _=require(_0x7ba0('0x0'));var util=require(_0x7ba0('0x1'));var moment=require(_0x7ba0('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ba0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ba0('0x4'));var logger=require(_0x7ba0('0x5'))(_0x7ba0('0x6'));var config=require(_0x7ba0('0x7'));var jayson=require(_0x7ba0('0x8'));var client=jayson[_0x7ba0('0x9')][_0x7ba0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3db22,_0x533759,_0x58d0d3){return new BPromise(function(_0x4d6eb7,_0x37c29b){return client[_0x7ba0('0xb')](_0xc3db22,_0x58d0d3)[_0x7ba0('0xc')](function(_0x5c3566){logger['info'](_0x7ba0('0xd'),_0x533759,_0x7ba0('0xe'));logger[_0x7ba0('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x533759,_0x7ba0('0xe'),JSON[_0x7ba0('0x10')](_0x5c3566));if(_0x5c3566[_0x7ba0('0x11')]){if(_0x5c3566[_0x7ba0('0x11')]['code']===0x1f4){logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x5c3566[_0x7ba0('0x11')][_0x7ba0('0x12')]);return _0x37c29b(_0x5c3566[_0x7ba0('0x11')][_0x7ba0('0x12')]);}logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x5c3566[_0x7ba0('0x11')]['message']);return _0x4d6eb7(_0x5c3566[_0x7ba0('0x11')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x533759,_0x7ba0('0xe'));_0x4d6eb7(_0x5c3566['result'][_0x7ba0('0x12')]);}})[_0x7ba0('0x13')](function(_0x41e3bd){logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x41e3bd);_0x37c29b(_0x41e3bd);});});}exports[_0x7ba0('0x14')]=function(_0x7e13fa){var _0x474ffd=this;return new Promise(function(_0x53a412,_0x5ed9a9){return db[_0x7ba0('0x15')]['create'](_0x7e13fa['body'],{'raw':_0x7e13fa[_0x7ba0('0x16')]?_0x7e13fa[_0x7ba0('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34d5ab){logger[_0x7ba0('0x17')]('CreateSquareReport',_0x7e13fa);logger['debug']('CreateSquareReport',_0x7e13fa,JSON[_0x7ba0('0x10')](_0x34d5ab));_0x53a412(_0x34d5ab);})[_0x7ba0('0x13')](function(_0xf0d6f0){logger[_0x7ba0('0x11')](_0x7ba0('0x14'),_0xf0d6f0[_0x7ba0('0x12')],_0x7e13fa);_0x5ed9a9(_0x474ffd[_0x7ba0('0x11')](0x1f4,_0xf0d6f0['message']));});});};exports[_0x7ba0('0x18')]=function(_0x2d39ea){var _0xac6588=this;return new Promise(function(_0x130d83,_0x29d44f){return db[_0x7ba0('0x15')][_0x7ba0('0x19')](_0x2d39ea[_0x7ba0('0x1a')],{'raw':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea[_0x7ba0('0x16')][_0x7ba0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea['options'][_0x7ba0('0x1c')]||null:null,'attributes':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea['options']['attributes']||null:null,'limit':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea[_0x7ba0('0x16')][_0x7ba0('0x1d')]||null:null})['then'](function(_0x4d9665){logger[_0x7ba0('0x17')]('UpdateSquareReport',_0x2d39ea);logger[_0x7ba0('0xf')](_0x7ba0('0x18'),_0x2d39ea,JSON['stringify'](_0x4d9665));_0x130d83(_0x4d9665);})[_0x7ba0('0x13')](function(_0x16491f){logger[_0x7ba0('0x11')](_0x7ba0('0x18'),_0x16491f[_0x7ba0('0x12')],_0x2d39ea);_0x29d44f(_0xac6588['error'](0x1f4,_0x16491f[_0x7ba0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f207d4c..6d799d9 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 _0xf5af=['connect-timeout','express','Router','../../components/auth/service','./squareReportDetail.controller','isAuthenticated','index','describe','get','/:id','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x210b75,_0x6b167e){var _0x57afa2=function(_0x51950f){while(--_0x51950f){_0x210b75['push'](_0x210b75['shift']());}};_0x57afa2(++_0x6b167e);}(_0xf5af,0x1b3));var _0xff5a=function(_0x569d6c,_0x38e90e){_0x569d6c=_0x569d6c-0x0;var _0x5462bd=_0xf5af[_0x569d6c];return _0x5462bd;};'use strict';var multer=require('multer');var util=require(_0xff5a('0x0'));var path=require(_0xff5a('0x1'));var timeout=require(_0xff5a('0x2'));var express=require(_0xff5a('0x3'));var router=express[_0xff5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff5a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xff5a('0x6'));router['get']('/',auth[_0xff5a('0x7')](),controller[_0xff5a('0x8')]);router['get']('/describe',auth[_0xff5a('0x7')](),controller[_0xff5a('0x9')]);router[_0xff5a('0xa')](_0xff5a('0xb'),auth[_0xff5a('0x7')](),controller[_0xff5a('0xc')]);router[_0xff5a('0xd')]('/',auth[_0xff5a('0x7')](),controller['create']);router[_0xff5a('0xe')]('/:id',auth[_0xff5a('0x7')](),controller[_0xff5a('0xf')]);router[_0xff5a('0x10')]('/:id',auth[_0xff5a('0x7')](),controller[_0xff5a('0x11')]);module[_0xff5a('0x12')]=router; \ No newline at end of file +var _0x4a87=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get'];(function(_0x5b9a3f,_0x391c8a){var _0x46d78b=function(_0x244c64){while(--_0x244c64){_0x5b9a3f['push'](_0x5b9a3f['shift']());}};_0x46d78b(++_0x391c8a);}(_0x4a87,0xbb));var _0x74a8=function(_0xc1f457,_0x26114e){_0xc1f457=_0xc1f457-0x0;var _0x5165a5=_0x4a87[_0xc1f457];return _0x5165a5;};'use strict';var multer=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var path=require(_0x74a8('0x2'));var timeout=require(_0x74a8('0x3'));var express=require(_0x74a8('0x4'));var router=express[_0x74a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x74a8('0x6'));var interaction=require(_0x74a8('0x7'));var config=require(_0x74a8('0x8'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x74a8('0x9')]);router['get'](_0x74a8('0xa'),auth['isAuthenticated'](),controller[_0x74a8('0xb')]);router[_0x74a8('0xc')](_0x74a8('0xd'),auth[_0x74a8('0xe')](),controller[_0x74a8('0xf')]);router['post']('/',auth[_0x74a8('0xe')](),controller['create']);router['put'](_0x74a8('0xd'),auth[_0x74a8('0xe')](),controller[_0x74a8('0x10')]);router[_0x74a8('0x11')]('/:id',auth[_0x74a8('0xe')](),controller[_0x74a8('0x12')]);module[_0x74a8('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d58b6df..e25eba4 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 _0x23a8=['exports','STRING','TEXT','sequelize'];(function(_0x4d6174,_0x137377){var _0xb5e21=function(_0x4419f3){while(--_0x4419f3){_0x4d6174['push'](_0x4d6174['shift']());}};_0xb5e21(++_0x137377);}(_0x23a8,0xeb));var _0x823a=function(_0x3ced98,_0x3eea97){_0x3ced98=_0x3ced98-0x0;var _0x1c7c06=_0x23a8[_0x3ced98];return _0x1c7c06;};'use strict';var Sequelize=require(_0x823a('0x0'));module[_0x823a('0x1')]={'uniqueid':{'type':Sequelize[_0x823a('0x2')]},'node':{'type':Sequelize[_0x823a('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x823a('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3e0e=['STRING','TEXT','sequelize'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x3e0e,0xb3));var _0xe3e0=function(_0x4ab8e2,_0x3754f9){_0x4ab8e2=_0x4ab8e2-0x0;var _0x2c4eed=_0x3e0e[_0x4ab8e2];return _0x2c4eed;};'use strict';var Sequelize=require(_0xe3e0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe3e0('0x1')]},'node':{'type':Sequelize[_0xe3e0('0x1')]},'application':{'type':Sequelize[_0xe3e0('0x1')]},'data':{'type':Sequelize[_0xe3e0('0x2')]},'project_name':{'type':Sequelize[_0xe3e0('0x1')]},'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 18a3d3a..4f66caa 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 _0xbc76=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','fieldName','type','map','keys','filters','intersection','model','attributes','fields','length','query','nolimit','order','sort','pick','where','VIRTUAL','filter','options','SquareDetailsReport','includeAll','include','findAll','catch','show','params','rawAttributes','merge','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x4ac090,_0x421ff1){var _0x592f58=function(_0x5b8f3e){while(--_0x5b8f3e){_0x4ac090['push'](_0x4ac090['shift']());}};_0x592f58(++_0x421ff1);}(_0xbc76,0x152));var _0x6bc7=function(_0x41b299,_0x3fb1b5){_0x41b299=_0x41b299-0x0;var _0x5ae711=_0xbc76[_0x41b299];return _0x5ae711;};'use strict';var emlformat=require(_0x6bc7('0x0'));var rimraf=require(_0x6bc7('0x1'));var zipdir=require(_0x6bc7('0x2'));var jsonpatch=require(_0x6bc7('0x3'));var rp=require(_0x6bc7('0x4'));var moment=require('moment');var BPromise=require(_0x6bc7('0x5'));var Mustache=require('mustache');var util=require(_0x6bc7('0x6'));var path=require(_0x6bc7('0x7'));var sox=require(_0x6bc7('0x8'));var csv=require(_0x6bc7('0x9'));var ejs=require(_0x6bc7('0xa'));var fs=require('fs');var fs_extra=require(_0x6bc7('0xb'));var _=require(_0x6bc7('0xc'));var squel=require(_0x6bc7('0xd'));var crypto=require(_0x6bc7('0xe'));var jsforce=require(_0x6bc7('0xf'));var deskjs=require(_0x6bc7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6bc7('0x11'));var Redis=require(_0x6bc7('0x12'));var authService=require(_0x6bc7('0x13'));var qs=require(_0x6bc7('0x14'));var as=require(_0x6bc7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6bc7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6bc7('0x17'));var db=require(_0x6bc7('0x18'))['db'];function respondWithStatusCode(_0x33d5ed,_0x354d46){_0x354d46=_0x354d46||0xcc;return function(_0x285a84){if(_0x285a84){return _0x33d5ed[_0x6bc7('0x19')](_0x354d46);}return _0x33d5ed[_0x6bc7('0x1a')](_0x354d46)['end']();};}function respondWithResult(_0xd505f7,_0xccf739){_0xccf739=_0xccf739||0xc8;return function(_0x5c1209){if(_0x5c1209){return _0xd505f7[_0x6bc7('0x1a')](_0xccf739)[_0x6bc7('0x1b')](_0x5c1209);}};}function respondWithFilteredResult(_0x4cf199,_0x54dc22){return function(_0xd3fff3){if(_0xd3fff3){var _0x2fa803=typeof _0x54dc22[_0x6bc7('0x1c')]==='undefined'&&typeof _0x54dc22[_0x6bc7('0x1d')]===_0x6bc7('0x1e');var _0x15a073=_0xd3fff3['count'];var _0x146676=_0x2fa803?0x0:_0x54dc22[_0x6bc7('0x1c')];var _0x56709d=_0x2fa803?_0xd3fff3[_0x6bc7('0x1f')]:_0x54dc22['offset']+_0x54dc22[_0x6bc7('0x1d')];var _0x2d165b;if(_0x56709d>=_0x15a073){_0x56709d=_0x15a073;_0x2d165b=0xc8;}else{_0x2d165b=0xce;}_0x4cf199[_0x6bc7('0x1a')](_0x2d165b);return _0x4cf199[_0x6bc7('0x20')](_0x6bc7('0x21'),_0x146676+'-'+_0x56709d+'/'+_0x15a073)[_0x6bc7('0x1b')](_0xd3fff3);}return null;};}function patchUpdates(_0xdb90cf){return function(_0xb47e72){try{jsonpatch['apply'](_0xb47e72,_0xdb90cf,!![]);}catch(_0x28f973){return BPromise[_0x6bc7('0x22')](_0x28f973);}return _0xb47e72[_0x6bc7('0x23')]();};}function saveUpdates(_0x506c01,_0x25b1de){return function(_0x2a9087){if(_0x2a9087){return _0x2a9087[_0x6bc7('0x24')](_0x506c01)[_0x6bc7('0x25')](function(_0x1b9eb7){return _0x1b9eb7;});}return null;};}function removeEntity(_0x459f50,_0x2dd270){return function(_0x249ee4){if(_0x249ee4){return _0x249ee4[_0x6bc7('0x26')]()[_0x6bc7('0x25')](function(){_0x459f50[_0x6bc7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x808c7f,_0x571d48){return function(_0x262a46){if(!_0x262a46){_0x808c7f['sendStatus'](0x194);}return _0x262a46;};}function handleError(_0x412765,_0xb905d1){_0xb905d1=_0xb905d1||0x1f4;return function(_0x2bec6c){logger[_0x6bc7('0x27')](_0x2bec6c[_0x6bc7('0x28')]);if(_0x2bec6c[_0x6bc7('0x29')]){delete _0x2bec6c[_0x6bc7('0x29')];}_0x412765[_0x6bc7('0x1a')](_0xb905d1)['send'](_0x2bec6c);};}exports[_0x6bc7('0x2a')]=function(_0x3ba449,_0x318e08){var _0x51bbfb={},_0x4000ce={},_0x210014={'count':0x0,'rows':[]};var _0x32c071=_['map'](db['SquareDetailsReport']['rawAttributes'],function(_0x455c94){return{'name':_0x455c94[_0x6bc7('0x2b')],'type':_0x455c94[_0x6bc7('0x2c')]['key']};});_0x4000ce['model']=_[_0x6bc7('0x2d')](_0x32c071,_0x6bc7('0x29'));_0x4000ce['query']=_[_0x6bc7('0x2e')](_0x3ba449['query']);_0x4000ce[_0x6bc7('0x2f')]=_[_0x6bc7('0x30')](_0x4000ce[_0x6bc7('0x31')],_0x4000ce['query']);_0x51bbfb[_0x6bc7('0x32')]=_['intersection'](_0x4000ce['model'],qs[_0x6bc7('0x33')](_0x3ba449['query']['fields']));_0x51bbfb[_0x6bc7('0x32')]=_0x51bbfb[_0x6bc7('0x32')][_0x6bc7('0x34')]?_0x51bbfb[_0x6bc7('0x32')]:_0x4000ce['model'];if(!_0x3ba449[_0x6bc7('0x35')]['hasOwnProperty'](_0x6bc7('0x36'))){_0x51bbfb[_0x6bc7('0x1d')]=qs[_0x6bc7('0x1d')](_0x3ba449[_0x6bc7('0x35')][_0x6bc7('0x1d')]);_0x51bbfb[_0x6bc7('0x1c')]=qs[_0x6bc7('0x1c')](_0x3ba449['query'][_0x6bc7('0x1c')]);}_0x51bbfb[_0x6bc7('0x37')]=qs[_0x6bc7('0x38')](_0x3ba449['query'][_0x6bc7('0x38')]);_0x51bbfb['where']=qs[_0x6bc7('0x2f')](_[_0x6bc7('0x39')](_0x3ba449[_0x6bc7('0x35')],_0x4000ce[_0x6bc7('0x2f')]),_0x32c071);if(_0x3ba449[_0x6bc7('0x35')]['filter']){_0x51bbfb[_0x6bc7('0x3a')]=_['merge'](_0x51bbfb['where'],{'$or':_[_0x6bc7('0x2d')](_0x32c071,function(_0x2a2f55){if(_0x2a2f55[_0x6bc7('0x2c')]!==_0x6bc7('0x3b')){var _0x440a18={};_0x440a18[_0x2a2f55[_0x6bc7('0x29')]]={'$like':'%'+_0x3ba449[_0x6bc7('0x35')][_0x6bc7('0x3c')]+'%'};return _0x440a18;}})});}_0x51bbfb=_['merge']({},_0x51bbfb,_0x3ba449[_0x6bc7('0x3d')]);var _0x53a0b9={'where':_0x51bbfb['where']};return db[_0x6bc7('0x3e')][_0x6bc7('0x1f')](_0x53a0b9)['then'](function(_0x9c7580){_0x210014[_0x6bc7('0x1f')]=_0x9c7580;if(_0x3ba449['query'][_0x6bc7('0x3f')]){_0x51bbfb[_0x6bc7('0x40')]=[{'all':!![]}];}return db[_0x6bc7('0x3e')][_0x6bc7('0x41')](_0x51bbfb);})['then'](function(_0x20007a){_0x210014['rows']=_0x20007a;return _0x210014;})[_0x6bc7('0x25')](respondWithFilteredResult(_0x318e08,_0x51bbfb))[_0x6bc7('0x42')](handleError(_0x318e08,null));};exports[_0x6bc7('0x43')]=function(_0x4bc117,_0x335d9d){var _0x497668={'raw':!![],'where':{'id':_0x4bc117[_0x6bc7('0x44')]['id']}},_0x23d3e0={};_0x23d3e0[_0x6bc7('0x31')]=_[_0x6bc7('0x2e')](db[_0x6bc7('0x3e')][_0x6bc7('0x45')]);_0x23d3e0['query']=_[_0x6bc7('0x2e')](_0x4bc117['query']);_0x23d3e0[_0x6bc7('0x2f')]=_[_0x6bc7('0x30')](_0x23d3e0['model'],_0x23d3e0[_0x6bc7('0x35')]);_0x497668[_0x6bc7('0x32')]=_[_0x6bc7('0x30')](_0x23d3e0[_0x6bc7('0x31')],qs[_0x6bc7('0x33')](_0x4bc117[_0x6bc7('0x35')][_0x6bc7('0x33')]));_0x497668['attributes']=_0x497668[_0x6bc7('0x32')]['length']?_0x497668[_0x6bc7('0x32')]:_0x23d3e0[_0x6bc7('0x31')];if(_0x4bc117[_0x6bc7('0x35')][_0x6bc7('0x3f')]){_0x497668[_0x6bc7('0x40')]=[{'all':!![]}];}_0x497668=_[_0x6bc7('0x46')]({},_0x497668,_0x4bc117[_0x6bc7('0x3d')]);return db[_0x6bc7('0x3e')]['find'](_0x497668)[_0x6bc7('0x25')](handleEntityNotFound(_0x335d9d,null))['then'](respondWithResult(_0x335d9d,null))[_0x6bc7('0x42')](handleError(_0x335d9d,null));};exports['create']=function(_0x4b2be2,_0x145039){return db[_0x6bc7('0x3e')][_0x6bc7('0x47')](_0x4b2be2[_0x6bc7('0x48')],{})[_0x6bc7('0x25')](respondWithResult(_0x145039,0xc9))['catch'](handleError(_0x145039,null));};exports[_0x6bc7('0x24')]=function(_0xc4ba6f,_0x313a8e){if(_0xc4ba6f[_0x6bc7('0x48')]['id']){delete _0xc4ba6f['body']['id'];}return db[_0x6bc7('0x3e')]['find']({'where':{'id':_0xc4ba6f[_0x6bc7('0x44')]['id']}})[_0x6bc7('0x25')](handleEntityNotFound(_0x313a8e,null))[_0x6bc7('0x25')](saveUpdates(_0xc4ba6f[_0x6bc7('0x48')],null))[_0x6bc7('0x25')](respondWithResult(_0x313a8e,null))[_0x6bc7('0x42')](handleError(_0x313a8e,null));};exports['destroy']=function(_0xc09b,_0x5ec5e2){return db['SquareDetailsReport']['find']({'where':{'id':_0xc09b[_0x6bc7('0x44')]['id']}})[_0x6bc7('0x25')](handleEntityNotFound(_0x5ec5e2,null))['then'](removeEntity(_0x5ec5e2,null))[_0x6bc7('0x42')](handleError(_0x5ec5e2,null));};exports[_0x6bc7('0x49')]=function(_0x5e2dcd,_0x35222a){return db['SquareDetailsReport'][_0x6bc7('0x49')]()[_0x6bc7('0x25')](respondWithResult(_0x35222a,null))['catch'](handleError(_0x35222a,null));}; \ No newline at end of file +var _0x4e70=['sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','findAll','rows','params','include','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order'];(function(_0x1a8dc7,_0x2835f1){var _0x306cf0=function(_0x18ac35){while(--_0x18ac35){_0x1a8dc7['push'](_0x1a8dc7['shift']());}};_0x306cf0(++_0x2835f1);}(_0x4e70,0x17a));var _0x04e7=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4e70[_0x1da527];return _0x40fc7c;};'use strict';var emlformat=require(_0x04e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04e7('0x1'));var jsonpatch=require(_0x04e7('0x2'));var rp=require(_0x04e7('0x3'));var moment=require(_0x04e7('0x4'));var BPromise=require(_0x04e7('0x5'));var Mustache=require(_0x04e7('0x6'));var util=require(_0x04e7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x04e7('0x8'));var ejs=require(_0x04e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04e7('0xa'));var squel=require(_0x04e7('0xb'));var crypto=require(_0x04e7('0xc'));var jsforce=require(_0x04e7('0xd'));var deskjs=require(_0x04e7('0xe'));var toCsv=require(_0x04e7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04e7('0xf'));var qs=require(_0x04e7('0x10'));var as=require(_0x04e7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x04e7('0x12'));var utils=require(_0x04e7('0x13'));var config=require(_0x04e7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x04e7('0x15'))['db'];function respondWithStatusCode(_0x17bb20,_0xe90c8){_0xe90c8=_0xe90c8||0xcc;return function(_0xcf2194){if(_0xcf2194){return _0x17bb20[_0x04e7('0x16')](_0xe90c8);}return _0x17bb20['status'](_0xe90c8)['end']();};}function respondWithResult(_0x56da86,_0x2284a8){_0x2284a8=_0x2284a8||0xc8;return function(_0xe5d793){if(_0xe5d793){return _0x56da86[_0x04e7('0x17')](_0x2284a8)[_0x04e7('0x18')](_0xe5d793);}};}function respondWithFilteredResult(_0x310a51,_0x2155a7){return function(_0x373a24){if(_0x373a24){var _0x465575=typeof _0x2155a7[_0x04e7('0x19')]==='undefined'&&typeof _0x2155a7['limit']===_0x04e7('0x1a');var _0x192831=_0x373a24['count'];var _0x2c0ec9=_0x465575?0x0:_0x2155a7[_0x04e7('0x19')];var _0xb119d2=_0x465575?_0x373a24[_0x04e7('0x1b')]:_0x2155a7['offset']+_0x2155a7[_0x04e7('0x1c')];var _0xd66f6a;if(_0xb119d2>=_0x192831){_0xb119d2=_0x192831;_0xd66f6a=0xc8;}else{_0xd66f6a=0xce;}_0x310a51[_0x04e7('0x17')](_0xd66f6a);return _0x310a51[_0x04e7('0x1d')](_0x04e7('0x1e'),_0x2c0ec9+'-'+_0xb119d2+'/'+_0x192831)[_0x04e7('0x18')](_0x373a24);}return null;};}function patchUpdates(_0x5bc920){return function(_0x2d1528){try{jsonpatch['apply'](_0x2d1528,_0x5bc920,!![]);}catch(_0x3b0f4b){return BPromise['reject'](_0x3b0f4b);}return _0x2d1528[_0x04e7('0x1f')]();};}function saveUpdates(_0x247d4d,_0x59ad2b){return function(_0x4dd605){if(_0x4dd605){return _0x4dd605[_0x04e7('0x20')](_0x247d4d)[_0x04e7('0x21')](function(_0x24e5fc){return _0x24e5fc;});}return null;};}function removeEntity(_0x5b66d4,_0x5a9652){return function(_0x588b85){if(_0x588b85){return _0x588b85[_0x04e7('0x22')]()[_0x04e7('0x21')](function(){_0x5b66d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24589c,_0x562974){return function(_0x49b027){if(!_0x49b027){_0x24589c['sendStatus'](0x194);}return _0x49b027;};}function handleError(_0xed894e,_0x4c4c77){_0x4c4c77=_0x4c4c77||0x1f4;return function(_0x7c032a){logger[_0x04e7('0x23')](_0x7c032a[_0x04e7('0x24')]);if(_0x7c032a[_0x04e7('0x25')]){delete _0x7c032a[_0x04e7('0x25')];}_0xed894e['status'](_0x4c4c77)['send'](_0x7c032a);};}exports[_0x04e7('0x26')]=function(_0x131420,_0xd20d1c){var _0x4e3049={},_0x3b0088={},_0x4fe02b={'count':0x0,'rows':[]};var _0x2c441e=_[_0x04e7('0x27')](db[_0x04e7('0x28')][_0x04e7('0x29')],function(_0x29b780){return{'name':_0x29b780[_0x04e7('0x2a')],'type':_0x29b780[_0x04e7('0x2b')][_0x04e7('0x2c')]};});_0x3b0088[_0x04e7('0x2d')]=_[_0x04e7('0x27')](_0x2c441e,_0x04e7('0x25'));_0x3b0088[_0x04e7('0x2e')]=_[_0x04e7('0x2f')](_0x131420['query']);_0x3b0088['filters']=_[_0x04e7('0x30')](_0x3b0088[_0x04e7('0x2d')],_0x3b0088[_0x04e7('0x2e')]);_0x4e3049['attributes']=_['intersection'](_0x3b0088[_0x04e7('0x2d')],qs[_0x04e7('0x31')](_0x131420['query'][_0x04e7('0x31')]));_0x4e3049[_0x04e7('0x32')]=_0x4e3049[_0x04e7('0x32')][_0x04e7('0x33')]?_0x4e3049[_0x04e7('0x32')]:_0x3b0088[_0x04e7('0x2d')];if(!_0x131420['query']['hasOwnProperty'](_0x04e7('0x34'))){_0x4e3049[_0x04e7('0x1c')]=qs[_0x04e7('0x1c')](_0x131420[_0x04e7('0x2e')][_0x04e7('0x1c')]);_0x4e3049[_0x04e7('0x19')]=qs[_0x04e7('0x19')](_0x131420[_0x04e7('0x2e')][_0x04e7('0x19')]);}_0x4e3049[_0x04e7('0x35')]=qs[_0x04e7('0x36')](_0x131420['query']['sort']);_0x4e3049['where']=qs[_0x04e7('0x37')](_[_0x04e7('0x38')](_0x131420[_0x04e7('0x2e')],_0x3b0088[_0x04e7('0x37')]),_0x2c441e);if(_0x131420[_0x04e7('0x2e')][_0x04e7('0x39')]){_0x4e3049['where']=_[_0x04e7('0x3a')](_0x4e3049['where'],{'$or':_[_0x04e7('0x27')](_0x2c441e,function(_0x45a44a){if(_0x45a44a[_0x04e7('0x2b')]!==_0x04e7('0x3b')){var _0x37d685={};_0x37d685[_0x45a44a[_0x04e7('0x25')]]={'$like':'%'+_0x131420[_0x04e7('0x2e')][_0x04e7('0x39')]+'%'};return _0x37d685;}})});}_0x4e3049=_['merge']({},_0x4e3049,_0x131420['options']);var _0x10b532={'where':_0x4e3049[_0x04e7('0x3c')]};return db[_0x04e7('0x28')][_0x04e7('0x1b')](_0x10b532)[_0x04e7('0x21')](function(_0x1d29e5){_0x4fe02b['count']=_0x1d29e5;if(_0x131420[_0x04e7('0x2e')][_0x04e7('0x3d')]){_0x4e3049['include']=[{'all':!![]}];}return db[_0x04e7('0x28')][_0x04e7('0x3e')](_0x4e3049);})[_0x04e7('0x21')](function(_0x33c451){_0x4fe02b[_0x04e7('0x3f')]=_0x33c451;return _0x4fe02b;})[_0x04e7('0x21')](respondWithFilteredResult(_0xd20d1c,_0x4e3049))['catch'](handleError(_0xd20d1c,null));};exports['show']=function(_0x2f03f0,_0x18fdfc){var _0x5bbc36={'raw':!![],'where':{'id':_0x2f03f0[_0x04e7('0x40')]['id']}},_0x15358d={};_0x15358d[_0x04e7('0x2d')]=_['keys'](db[_0x04e7('0x28')]['rawAttributes']);_0x15358d[_0x04e7('0x2e')]=_[_0x04e7('0x2f')](_0x2f03f0[_0x04e7('0x2e')]);_0x15358d['filters']=_[_0x04e7('0x30')](_0x15358d[_0x04e7('0x2d')],_0x15358d[_0x04e7('0x2e')]);_0x5bbc36[_0x04e7('0x32')]=_[_0x04e7('0x30')](_0x15358d['model'],qs['fields'](_0x2f03f0[_0x04e7('0x2e')]['fields']));_0x5bbc36[_0x04e7('0x32')]=_0x5bbc36[_0x04e7('0x32')][_0x04e7('0x33')]?_0x5bbc36['attributes']:_0x15358d[_0x04e7('0x2d')];if(_0x2f03f0['query'][_0x04e7('0x3d')]){_0x5bbc36[_0x04e7('0x41')]=[{'all':!![]}];}_0x5bbc36=_[_0x04e7('0x3a')]({},_0x5bbc36,_0x2f03f0[_0x04e7('0x42')]);return db[_0x04e7('0x28')]['find'](_0x5bbc36)[_0x04e7('0x21')](handleEntityNotFound(_0x18fdfc,null))[_0x04e7('0x21')](respondWithResult(_0x18fdfc,null))[_0x04e7('0x43')](handleError(_0x18fdfc,null));};exports[_0x04e7('0x44')]=function(_0x3c6979,_0x2d4128){return db[_0x04e7('0x28')][_0x04e7('0x44')](_0x3c6979[_0x04e7('0x45')],{})['then'](respondWithResult(_0x2d4128,0xc9))['catch'](handleError(_0x2d4128,null));};exports[_0x04e7('0x20')]=function(_0x1e59bb,_0x57100f){if(_0x1e59bb['body']['id']){delete _0x1e59bb[_0x04e7('0x45')]['id'];}return db[_0x04e7('0x28')][_0x04e7('0x46')]({'where':{'id':_0x1e59bb['params']['id']}})['then'](handleEntityNotFound(_0x57100f,null))['then'](saveUpdates(_0x1e59bb[_0x04e7('0x45')],null))['then'](respondWithResult(_0x57100f,null))[_0x04e7('0x43')](handleError(_0x57100f,null));};exports[_0x04e7('0x22')]=function(_0x109b08,_0x2c80f8){return db[_0x04e7('0x28')][_0x04e7('0x46')]({'where':{'id':_0x109b08['params']['id']}})[_0x04e7('0x21')](handleEntityNotFound(_0x2c80f8,null))['then'](removeEntity(_0x2c80f8,null))[_0x04e7('0x43')](handleError(_0x2c80f8,null));};exports[_0x04e7('0x47')]=function(_0x19483b,_0x25d395){return db[_0x04e7('0x28')]['describe']()['then'](respondWithResult(_0x25d395,null))[_0x04e7('0x43')](handleError(_0x25d395,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f6c86b2..00b582a 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 _0xe3cf=['rimraf','./squareReportDetail.attributes','exports','lodash','api','bluebird','path'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe3cf,0xc0));var _0xfe3c=function(_0x128d9c,_0x508eb5){_0x128d9c=_0x128d9c-0x0;var _0xbcc91b=_0xe3cf[_0x128d9c];return _0xbcc91b;};'use strict';var _=require(_0xfe3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfe3c('0x1'));var moment=require('moment');var BPromise=require(_0xfe3c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe3c('0x3'));var rimraf=require(_0xfe3c('0x4'));var config=require('../../config/environment');var attributes=require(_0xfe3c('0x5'));module[_0xfe3c('0x6')]=function(_0x532031,_0x2dcfe3){return _0x532031['define']('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util','api','moment'];(function(_0x8ea31d,_0x3605e2){var _0x41bb8f=function(_0x54a53c){while(--_0x54a53c){_0x8ea31d['push'](_0x8ea31d['shift']());}};_0x41bb8f(++_0x3605e2);}(_0x4975,0x147));var _0x5497=function(_0xaf919c,_0x2ebfc7){_0xaf919c=_0xaf919c-0x0;var _0x393204=_0x4975[_0xaf919c];return _0x393204;};'use strict';var _=require('lodash');var util=require(_0x5497('0x0'));var logger=require('../../config/logger')(_0x5497('0x1'));var moment=require(_0x5497('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5497('0x3'));var rimraf=require(_0x5497('0x4'));var config=require(_0x5497('0x5'));var attributes=require(_0x5497('0x6'));module[_0x5497('0x7')]=function(_0x57b019,_0x2bbe4b){return _0x57b019[_0x5497('0x8')](_0x5497('0x9'),attributes,{'tableName':_0x5497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7aff83b..dbba9b3 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 _0x1c9a=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c9a,0x98));var _0xa1c9=function(_0x10d1a7,_0xae7944){_0x10d1a7=_0x10d1a7-0x0;var _0x962931=_0x1c9a[_0x10d1a7];return _0x962931;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}exports[_0xa1c9('0x17')]=function(_0x224ae4){var _0x50db9b=this;return new Promise(function(_0x2fb81e,_0x5ab911){return db[_0xa1c9('0x18')][_0xa1c9('0x19')](_0x224ae4[_0xa1c9('0x1a')],{'raw':_0x224ae4['options']?_0x224ae4[_0xa1c9('0x1b')][_0xa1c9('0x1c')]===undefined?!![]:![]:!![]})[_0xa1c9('0xb')](function(_0x4edf37){logger[_0xa1c9('0xc')](_0xa1c9('0x17'),_0x224ae4);logger['debug'](_0xa1c9('0x17'),_0x224ae4,JSON[_0xa1c9('0x10')](_0x4edf37));_0x2fb81e(_0x4edf37);})[_0xa1c9('0x16')](function(_0x4d05d0){logger[_0xa1c9('0x11')](_0xa1c9('0x17'),_0x4d05d0[_0xa1c9('0x14')],_0x224ae4);_0x5ab911(_0x50db9b[_0xa1c9('0x11')](0x1f4,_0x4d05d0[_0xa1c9('0x14')]));});});}; \ No newline at end of file +var _0xf4f4=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30e94e,_0x494fb1){var _0x23cded=function(_0x290f75){while(--_0x290f75){_0x30e94e['push'](_0x30e94e['shift']());}};_0x23cded(++_0x494fb1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x18b7f0,_0x403e49){_0x18b7f0=_0x18b7f0-0x0;var _0x38a953=_0xf4f4[_0x18b7f0];return _0x38a953;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}exports[_0x4f4f('0x15')]=function(_0x1245c4){var _0x60ce2=this;return new Promise(function(_0x929a0b,_0x2f9397){return db[_0x4f4f('0x16')][_0x4f4f('0x17')](_0x1245c4['body'],{'raw':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x19')]===undefined?!![]:![]:!![]})[_0x4f4f('0xb')](function(_0x302a79){logger[_0x4f4f('0xc')](_0x4f4f('0x15'),_0x1245c4);logger[_0x4f4f('0xf')](_0x4f4f('0x15'),_0x1245c4,JSON[_0x4f4f('0x1a')](_0x302a79));_0x929a0b(_0x302a79);})[_0x4f4f('0x14')](function(_0x17832f){logger[_0x4f4f('0x11')](_0x4f4f('0x15'),_0x17832f['message'],_0x1245c4);_0x2f9397(_0x60ce2['error'](0x1f4,_0x17832f['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 55a24bb..4535f56 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 _0x25ea=['./system.controller','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x25ea,0x85));var _0xa25e=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0x25ea[_0x45518f];return _0x198175;};'use strict';var express=require(_0xa25e('0x0'));var router=express[_0xa25e('0x1')]();var auth=require(_0xa25e('0x2'));var controller=require(_0xa25e('0x3'));router['get']('/',auth[_0xa25e('0x4')](),controller['index']);router['get'](_0xa25e('0x5'),auth['isAuthenticated'](),controller[_0xa25e('0x6')]);module[_0xa25e('0x7')]=router; \ No newline at end of file +var _0x3aca=['killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x5a7a11,_0x2fa00f){var _0x535ceb=function(_0x4b3ba9){while(--_0x4b3ba9){_0x5a7a11['push'](_0x5a7a11['shift']());}};_0x535ceb(++_0x2fa00f);}(_0x3aca,0x1ea));var _0xa3ac=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3aca[_0x2aec52];return _0x3b8835;};'use strict';var express=require('express');var router=express[_0xa3ac('0x0')]();var auth=require(_0xa3ac('0x1'));var controller=require(_0xa3ac('0x2'));router[_0xa3ac('0x3')]('/',auth[_0xa3ac('0x4')](),controller[_0xa3ac('0x5')]);router[_0xa3ac('0x3')]('/process/:pid/kill',auth[_0xa3ac('0x4')](),controller[_0xa3ac('0x6')]);module[_0xa3ac('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5ece451..16ff726 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 _0xe084=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','getAllData','then','json','catch','status','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','../../config/logger','api','util'];(function(_0x3c4d46,_0x46ed6f){var _0x1572d9=function(_0x1d2db1){while(--_0x1d2db1){_0x3c4d46['push'](_0x3c4d46['shift']());}};_0x1572d9(++_0x46ed6f);}(_0xe084,0x134));var _0x4e08=function(_0x50f715,_0x1bc03b){_0x50f715=_0x50f715-0x0;var _0x55bf5d=_0xe084[_0x50f715];return _0x55bf5d;};'use strict';var info=require(_0x4e08('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x4e08('0x1'))(_0x4e08('0x2'));var util=require(_0x4e08('0x3'));var BPromise=require(_0x4e08('0x4'));var _=require(_0x4e08('0x5'));function handleError(_0x1ba953,_0x312781,_0x31464d){_0x312781=_0x312781||0x1f4;return function(_0x492a35){logger[_0x4e08('0x6')](_0x4e08('0x7'),_0x31464d,_0x312781,util['inspect'](_0x492a35,{'showHidden':![],'depth':null}));delete _0x492a35[_0x4e08('0x8')];_0x1ba953['status'](_0x312781)['send'](_0x492a35);};}exports['index']=function(_0x2d913c,_0x3f703a){return info[_0x4e08('0x9')]()[_0x4e08('0xa')](function(_0x148ea3){return _0x3f703a['status'](0xc8)[_0x4e08('0xb')](_0x148ea3);})[_0x4e08('0xc')](function(_0x4d5d08){return _0x3f703a[_0x4e08('0xd')](0x1f4)['json'](_0x4d5d08);});};exports['killProcess']=function(_0x8dfb10,_0x38cda6){var _0x3565e2=[_0x4e08('0xe')];return new BPromise(function(_0x24087d,_0x47bd01){return exec(util['format'](_0x4e08('0xf'),_0x8dfb10[_0x4e08('0x10')][_0x4e08('0x11')]),function(_0x3e905a,_0x1db966,_0x1340a8){if(_0x3e905a){return _0x47bd01(_0x3e905a);}return _0x24087d(_0x1db966);});})[_0x4e08('0xa')](function(_0x41a30e){var _0x15748d=![];var _0x2d6223=_0x41a30e[_0x4e08('0x12')](/\n/);for(var _0x25e9cb=0x0,_0x4d1c00=_0x3565e2[_0x4e08('0x13')];_0x25e9cb<_0x4d1c00,_0x15748d===![];_0x25e9cb+=0x1){if(_0x41a30e['indexOf'](_0x3565e2[_0x25e9cb])>=0x0){_0x15748d=!![];}}if(!_0x15748d){throw new Error(util[_0x4e08('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x8dfb10[_0x4e08('0x10')][_0x4e08('0x11')]));}process[_0x4e08('0x15')](_0x8dfb10[_0x4e08('0x10')][_0x4e08('0x11')],'SIGINT');return _0x38cda6['status'](0xc8)[_0x4e08('0xb')]({'message':util[_0x4e08('0x14')](_0x4e08('0x16'),_0x8dfb10[_0x4e08('0x10')]['pid'])});})[_0x4e08('0xc')](handleError(_0x38cda6,null,_0x4e08('0x17')));}; \ No newline at end of file +var _0xc1f3=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','pid','kill','SIGINT'];(function(_0x210cfd,_0xc1ed24){var _0x10f46e=function(_0x15112e){while(--_0x15112e){_0x210cfd['push'](_0x210cfd['shift']());}};_0x10f46e(++_0xc1ed24);}(_0xc1f3,0x76));var _0x3c1f=function(_0x3be2fe,_0xefbf7){_0x3be2fe=_0x3be2fe-0x0;var _0x2d23c3=_0xc1f3[_0x3be2fe];return _0x2d23c3;};'use strict';var info=require(_0x3c1f('0x0'));var exec=require(_0x3c1f('0x1'))['exec'];var logger=require(_0x3c1f('0x2'))(_0x3c1f('0x3'));var util=require(_0x3c1f('0x4'));var BPromise=require(_0x3c1f('0x5'));var _=require(_0x3c1f('0x6'));function handleError(_0x45da79,_0xb68b01,_0x46a21b){_0xb68b01=_0xb68b01||0x1f4;return function(_0x1b7b32){logger[_0x3c1f('0x7')](_0x3c1f('0x8'),_0x46a21b,_0xb68b01,util['inspect'](_0x1b7b32,{'showHidden':![],'depth':null}));delete _0x1b7b32[_0x3c1f('0x9')];_0x45da79[_0x3c1f('0xa')](_0xb68b01)[_0x3c1f('0xb')](_0x1b7b32);};}exports[_0x3c1f('0xc')]=function(_0x344930,_0xf5177b){return info[_0x3c1f('0xd')]()[_0x3c1f('0xe')](function(_0x4918f1){return _0xf5177b[_0x3c1f('0xa')](0xc8)[_0x3c1f('0xf')](_0x4918f1);})[_0x3c1f('0x10')](function(_0x4e21e7){return _0xf5177b[_0x3c1f('0xa')](0x1f4)[_0x3c1f('0xf')](_0x4e21e7);});};exports['killProcess']=function(_0xfe7c11,_0x87fdeb){var _0x28294a=[_0x3c1f('0x11')];return new BPromise(function(_0x4faf17,_0x2c6745){return exec(util[_0x3c1f('0x12')](_0x3c1f('0x13'),_0xfe7c11[_0x3c1f('0x14')]['pid']),function(_0x1c300,_0x58a500,_0xff16b2){if(_0x1c300){return _0x2c6745(_0x1c300);}return _0x4faf17(_0x58a500);});})['then'](function(_0x9f8d31){var _0x8ef869=![];var _0x2d1414=_0x9f8d31[_0x3c1f('0x15')](/\n/);for(var _0x24f86a=0x0,_0x1d5078=_0x28294a[_0x3c1f('0x16')];_0x24f86a<_0x1d5078,_0x8ef869===![];_0x24f86a+=0x1){if(_0x9f8d31[_0x3c1f('0x17')](_0x28294a[_0x24f86a])>=0x0){_0x8ef869=!![];}}if(!_0x8ef869){throw new Error(util[_0x3c1f('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xfe7c11['params'][_0x3c1f('0x18')]));}process[_0x3c1f('0x19')](_0xfe7c11['params'][_0x3c1f('0x18')],_0x3c1f('0x1a'));return _0x87fdeb[_0x3c1f('0xa')](0xc8)[_0x3c1f('0xf')]({'message':util[_0x3c1f('0x12')](_0x3c1f('0x1b'),_0xfe7c11[_0x3c1f('0x14')][_0x3c1f('0x18')])});})[_0x3c1f('0x10')](handleError(_0x87fdeb,null,_0x3c1f('0x1c')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d6da3e1..535fd83 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 _0x65ba=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x24a186,_0x1ab34e){var _0x1ec221=function(_0x53f8e1){while(--_0x53f8e1){_0x24a186['push'](_0x24a186['shift']());}};_0x1ec221(++_0x1ab34e);}(_0x65ba,0x110));var _0xa65b=function(_0x4fa3cf,_0x5ee88d){_0x4fa3cf=_0x4fa3cf-0x0;var _0x1d1e2c=_0x65ba[_0x4fa3cf];return _0x1d1e2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa65b('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa65b('0x1')]();var fs_extra=require(_0xa65b('0x2'));var auth=require(_0xa65b('0x3'));var interaction=require(_0xa65b('0x4'));var config=require(_0xa65b('0x5'));var controller=require('./tag.controller');router[_0xa65b('0x6')]('/',auth[_0xa65b('0x7')](),controller[_0xa65b('0x8')]);router[_0xa65b('0x6')]('/:id',auth[_0xa65b('0x7')](),controller[_0xa65b('0x9')]);router['post']('/',auth[_0xa65b('0x7')](),controller[_0xa65b('0xa')]);router[_0xa65b('0xb')](_0xa65b('0xc'),auth['isAuthenticated'](),controller[_0xa65b('0xd')]);router[_0xa65b('0xe')](_0xa65b('0xc'),auth['isAuthenticated'](),controller[_0xa65b('0xf')]);module[_0xa65b('0x10')]=router; \ No newline at end of file +var _0x1103=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','put','delete','exports','util','path','connect-timeout'];(function(_0x4e0b8c,_0x443f31){var _0x633ecc=function(_0x1f1f36){while(--_0x1f1f36){_0x4e0b8c['push'](_0x4e0b8c['shift']());}};_0x633ecc(++_0x443f31);}(_0x1103,0x97));var _0x3110=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1103[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3110('0x0'));var path=require(_0x3110('0x1'));var timeout=require(_0x3110('0x2'));var express=require(_0x3110('0x3'));var router=express[_0x3110('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3110('0x5'));var interaction=require(_0x3110('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x3110('0x7')]('/',auth[_0x3110('0x8')](),controller[_0x3110('0x9')]);router[_0x3110('0x7')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['show']);router['post']('/',auth[_0x3110('0x8')](),controller['create']);router[_0x3110('0xb')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['update']);router[_0x3110('0xc')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['destroy']);module[_0x3110('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2785dd1..7a5f244 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 _0xaf60=['STRING','#0091EA','sequelize','exports'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0xaf60,0x82));var _0x0af6=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xaf60[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x0af6('0x0'));module[_0x0af6('0x1')]={'name':{'type':Sequelize[_0x0af6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0af6('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb74=['name','#0091EA','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb74,0xe3));var _0x4eb7=function(_0x27f55c,_0x3d6554){_0x27f55c=_0x27f55c-0x0;var _0x3733d1=_0xeb74[_0x27f55c];return _0x3733d1;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'unique':_0x4eb7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':_0x4eb7('0x4')},'description':{'type':Sequelize[_0x4eb7('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8d10c70..1c4b6aa 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 _0x6737=['error','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','options','Tag','include','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6737,0xe2));var _0x7673=function(_0x41240d,_0xf34ab1){_0x41240d=_0x41240d-0x0;var _0x516793=_0x6737[_0x41240d];return _0x516793;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7673('0x0'));var zipdir=require(_0x7673('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require('util');var path=require(_0x7673('0x6'));var sox=require(_0x7673('0x7'));var csv=require('to-csv');var ejs=require(_0x7673('0x8'));var fs=require('fs');var fs_extra=require(_0x7673('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7673('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7673('0xb'));var Papa=require(_0x7673('0xc'));var Redis=require('ioredis');var authService=require(_0x7673('0xd'));var qs=require(_0x7673('0xe'));var as=require(_0x7673('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7673('0x10'));var utils=require('../../config/utils');var config=require(_0x7673('0x11'));var licenseUtil=require(_0x7673('0x12'));var db=require(_0x7673('0x13'))['db'];function respondWithStatusCode(_0x451c87,_0x41d6bd){_0x41d6bd=_0x41d6bd||0xcc;return function(_0x119e42){if(_0x119e42){return _0x451c87[_0x7673('0x14')](_0x41d6bd);}return _0x451c87[_0x7673('0x15')](_0x41d6bd)[_0x7673('0x16')]();};}function respondWithResult(_0x20a649,_0x5c8626){_0x5c8626=_0x5c8626||0xc8;return function(_0x26f0c4){if(_0x26f0c4){return _0x20a649[_0x7673('0x15')](_0x5c8626)[_0x7673('0x17')](_0x26f0c4);}};}function respondWithFilteredResult(_0x2c83d,_0x224cea){return function(_0x2e83c4){if(_0x2e83c4){var _0x2a2840=typeof _0x224cea['offset']==='undefined'&&typeof _0x224cea[_0x7673('0x18')]===_0x7673('0x19');var _0x50f8d9=_0x2e83c4[_0x7673('0x1a')];var _0x17699a=_0x2a2840?0x0:_0x224cea['offset'];var _0x33ff7d=_0x2a2840?_0x2e83c4[_0x7673('0x1a')]:_0x224cea[_0x7673('0x1b')]+_0x224cea['limit'];var _0x50f22d;if(_0x33ff7d>=_0x50f8d9){_0x33ff7d=_0x50f8d9;_0x50f22d=0xc8;}else{_0x50f22d=0xce;}_0x2c83d[_0x7673('0x15')](_0x50f22d);return _0x2c83d[_0x7673('0x1c')]('Content-Range',_0x17699a+'-'+_0x33ff7d+'/'+_0x50f8d9)[_0x7673('0x17')](_0x2e83c4);}return null;};}function patchUpdates(_0x29bbd9){return function(_0x2e1260){try{jsonpatch[_0x7673('0x1d')](_0x2e1260,_0x29bbd9,!![]);}catch(_0x4245bf){return BPromise[_0x7673('0x1e')](_0x4245bf);}return _0x2e1260['save']();};}function saveUpdates(_0x557161,_0xea9b37){return function(_0x21774f){if(_0x21774f){return _0x21774f[_0x7673('0x1f')](_0x557161)[_0x7673('0x20')](function(_0x16bb16){return _0x16bb16;});}return null;};}function removeEntity(_0x54f38d,_0x2009e1){return function(_0x3b2a75){if(_0x3b2a75){return _0x3b2a75[_0x7673('0x21')]()[_0x7673('0x20')](function(){var _0x132dc6=_0x3b2a75[_0x7673('0x22')]({'plain':!![]});var _0x538280=_0x7673('0x23');return db[_0x7673('0x24')][_0x7673('0x21')]({'where':{'type':_0x538280,'resourceId':_0x132dc6['id']}})[_0x7673('0x20')](function(){return _0x3b2a75;});})['then'](function(){_0x54f38d['status'](0xcc)[_0x7673('0x16')]();});}};}function handleEntityNotFound(_0x11b42b,_0x291d10){return function(_0x9d9eab){if(!_0x9d9eab){_0x11b42b[_0x7673('0x14')](0x194);}return _0x9d9eab;};}function handleError(_0x45a045,_0x442f42){_0x442f42=_0x442f42||0x1f4;return function(_0x5a59f9){logger['error'](_0x5a59f9[_0x7673('0x25')]);if(_0x5a59f9[_0x7673('0x26')]){delete _0x5a59f9[_0x7673('0x26')];}_0x45a045[_0x7673('0x15')](_0x442f42)[_0x7673('0x27')](_0x5a59f9);};}exports[_0x7673('0x28')]=function(_0x224122,_0x4f12b9){var _0x4fcacc={},_0xe7e528={},_0x36c841={'count':0x0,'rows':[]};var _0x268863=_[_0x7673('0x29')](db['Tag'][_0x7673('0x2a')],function(_0x497760){return{'name':_0x497760[_0x7673('0x2b')],'type':_0x497760[_0x7673('0x2c')][_0x7673('0x2d')]};});_0xe7e528[_0x7673('0x2e')]=_[_0x7673('0x29')](_0x268863,_0x7673('0x26'));_0xe7e528[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x224122[_0x7673('0x2f')]);_0xe7e528[_0x7673('0x31')]=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],_0xe7e528[_0x7673('0x2f')]);_0x4fcacc['attributes']=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x224122[_0x7673('0x2f')][_0x7673('0x33')]));_0x4fcacc[_0x7673('0x34')]=_0x4fcacc[_0x7673('0x34')]['length']?_0x4fcacc['attributes']:_0xe7e528[_0x7673('0x2e')];if(!_0x224122[_0x7673('0x2f')][_0x7673('0x35')](_0x7673('0x36'))){_0x4fcacc[_0x7673('0x18')]=qs[_0x7673('0x18')](_0x224122[_0x7673('0x2f')]['limit']);_0x4fcacc[_0x7673('0x1b')]=qs[_0x7673('0x1b')](_0x224122['query'][_0x7673('0x1b')]);}_0x4fcacc[_0x7673('0x37')]=qs[_0x7673('0x38')](_0x224122[_0x7673('0x2f')]['sort']);_0x4fcacc[_0x7673('0x39')]=qs[_0x7673('0x31')](_['pick'](_0x224122[_0x7673('0x2f')],_0xe7e528[_0x7673('0x31')]),_0x268863);if(_0x224122[_0x7673('0x2f')]['filter']){_0x4fcacc[_0x7673('0x39')]=_[_0x7673('0x3a')](_0x4fcacc[_0x7673('0x39')],{'$or':_['map'](_0x268863,function(_0x4c6106){if(_0x4c6106[_0x7673('0x2c')]!=='VIRTUAL'){var _0x4ba2b4={};_0x4ba2b4[_0x4c6106[_0x7673('0x26')]]={'$like':'%'+_0x224122[_0x7673('0x2f')]['filter']+'%'};return _0x4ba2b4;}})});}_0x4fcacc=_[_0x7673('0x3a')]({},_0x4fcacc,_0x224122[_0x7673('0x3b')]);var _0x2645a2={'where':_0x4fcacc[_0x7673('0x39')]};return db[_0x7673('0x3c')][_0x7673('0x1a')](_0x2645a2)['then'](function(_0x1edb82){_0x36c841['count']=_0x1edb82;if(_0x224122[_0x7673('0x2f')]['includeAll']){_0x4fcacc[_0x7673('0x3d')]=[{'all':!![]}];}return db[_0x7673('0x3c')]['findAll'](_0x4fcacc);})['then'](function(_0x1cac93){_0x36c841['rows']=_0x1cac93;return _0x36c841;})[_0x7673('0x20')](respondWithFilteredResult(_0x4f12b9,_0x4fcacc))[_0x7673('0x3e')](handleError(_0x4f12b9,null));};exports[_0x7673('0x3f')]=function(_0x3b6223,_0x1895df){var _0x545357={'raw':!![],'where':{'id':_0x3b6223[_0x7673('0x40')]['id']}},_0x4ea8b3={};_0x4ea8b3[_0x7673('0x2e')]=_['keys'](db[_0x7673('0x3c')][_0x7673('0x2a')]);_0x4ea8b3[_0x7673('0x2f')]=_['keys'](_0x3b6223[_0x7673('0x2f')]);_0x4ea8b3[_0x7673('0x31')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],_0x4ea8b3[_0x7673('0x2f')]);_0x545357[_0x7673('0x34')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x3b6223['query'][_0x7673('0x33')]));_0x545357[_0x7673('0x34')]=_0x545357[_0x7673('0x34')][_0x7673('0x41')]?_0x545357[_0x7673('0x34')]:_0x4ea8b3[_0x7673('0x2e')];if(_0x3b6223[_0x7673('0x2f')]['includeAll']){_0x545357[_0x7673('0x3d')]=[{'all':!![]}];}_0x545357=_[_0x7673('0x3a')]({},_0x545357,_0x3b6223[_0x7673('0x3b')]);return db[_0x7673('0x3c')][_0x7673('0x42')](_0x545357)['then'](handleEntityNotFound(_0x1895df,null))[_0x7673('0x20')](respondWithResult(_0x1895df,null))[_0x7673('0x3e')](handleError(_0x1895df,null));};exports[_0x7673('0x43')]=function(_0x2397fb,_0x3f76a3){return db['Tag']['create'](_0x2397fb[_0x7673('0x44')],{})[_0x7673('0x20')](function(_0x510960){var _0x2314e7=_0x2397fb[_0x7673('0x45')][_0x7673('0x22')]({'plain':!![]});if(!_0x2314e7)throw new Error(_0x7673('0x46'));if(_0x2314e7[_0x7673('0x47')]==='user'){var _0x23789d=_0x510960[_0x7673('0x22')]({'plain':!![]});var _0x2a275b=_0x7673('0x23');return db['UserProfileSection'][_0x7673('0x42')]({'where':{'name':_0x2a275b,'userProfileId':_0x2314e7[_0x7673('0x48')]},'raw':!![]})[_0x7673('0x20')](function(_0xa93124){if(_0xa93124&&_0xa93124[_0x7673('0x49')]===0x0){return db[_0x7673('0x24')][_0x7673('0x43')]({'name':_0x23789d[_0x7673('0x26')],'resourceId':_0x23789d['id'],'type':_0xa93124[_0x7673('0x26')],'sectionId':_0xa93124['id']},{})[_0x7673('0x20')](function(){return _0x510960;});}else{return _0x510960;}})[_0x7673('0x3e')](function(_0x572119){logger[_0x7673('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572119);throw _0x572119;});}return _0x510960;})[_0x7673('0x20')](respondWithResult(_0x3f76a3,0xc9))[_0x7673('0x3e')](handleError(_0x3f76a3,null));};exports[_0x7673('0x1f')]=function(_0x523698,_0x185ec5){if(_0x523698[_0x7673('0x44')]['id']){delete _0x523698[_0x7673('0x44')]['id'];}return db[_0x7673('0x3c')][_0x7673('0x42')]({'where':{'id':_0x523698[_0x7673('0x40')]['id']}})[_0x7673('0x20')](handleEntityNotFound(_0x185ec5,null))[_0x7673('0x20')](saveUpdates(_0x523698[_0x7673('0x44')],null))[_0x7673('0x20')](respondWithResult(_0x185ec5,null))[_0x7673('0x3e')](handleError(_0x185ec5,null));};exports[_0x7673('0x21')]=function(_0x9be9a4,_0xb3c9e9){return db['Tag'][_0x7673('0x42')]({'where':{'id':_0x9be9a4['params']['id']}})[_0x7673('0x20')](handleEntityNotFound(_0xb3c9e9,null))[_0x7673('0x20')](removeEntity(_0xb3c9e9,null))[_0x7673('0x3e')](handleError(_0xb3c9e9,null));}; \ No newline at end of file +var _0xfc03=['Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','create','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map'];(function(_0x802f28,_0x132262){var _0x35b5db=function(_0x59eb67){while(--_0x59eb67){_0x802f28['push'](_0x802f28['shift']());}};_0x35b5db(++_0x132262);}(_0xfc03,0x16f));var _0x3fc0=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xfc03[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x3fc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fc0('0x1'));var jsonpatch=require(_0x3fc0('0x2'));var rp=require('request-promise');var moment=require(_0x3fc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fc0('0x4'));var util=require(_0x3fc0('0x5'));var path=require(_0x3fc0('0x6'));var sox=require(_0x3fc0('0x7'));var csv=require(_0x3fc0('0x8'));var ejs=require(_0x3fc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3fc0('0xa'));var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x8'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var as=require(_0x3fc0('0x12'));var hardwareService=require(_0x3fc0('0x13'));var logger=require(_0x3fc0('0x14'))('api');var utils=require(_0x3fc0('0x15'));var config=require(_0x3fc0('0x16'));var licenseUtil=require(_0x3fc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1011b7,_0x582e22){_0x582e22=_0x582e22||0xcc;return function(_0x3a4cc0){if(_0x3a4cc0){return _0x1011b7[_0x3fc0('0x18')](_0x582e22);}return _0x1011b7['status'](_0x582e22)[_0x3fc0('0x19')]();};}function respondWithResult(_0x422926,_0x392c46){_0x392c46=_0x392c46||0xc8;return function(_0x4eb69a){if(_0x4eb69a){return _0x422926[_0x3fc0('0x1a')](_0x392c46)[_0x3fc0('0x1b')](_0x4eb69a);}};}function respondWithFilteredResult(_0x367ce1,_0x27619a){return function(_0x562ecc){if(_0x562ecc){var _0x277dbf=typeof _0x27619a[_0x3fc0('0x1c')]===_0x3fc0('0x1d')&&typeof _0x27619a['limit']===_0x3fc0('0x1d');var _0x491446=_0x562ecc[_0x3fc0('0x1e')];var _0x3c5026=_0x277dbf?0x0:_0x27619a['offset'];var _0x3bb388=_0x277dbf?_0x562ecc[_0x3fc0('0x1e')]:_0x27619a[_0x3fc0('0x1c')]+_0x27619a[_0x3fc0('0x1f')];var _0x1bd575;if(_0x3bb388>=_0x491446){_0x3bb388=_0x491446;_0x1bd575=0xc8;}else{_0x1bd575=0xce;}_0x367ce1[_0x3fc0('0x1a')](_0x1bd575);return _0x367ce1[_0x3fc0('0x20')](_0x3fc0('0x21'),_0x3c5026+'-'+_0x3bb388+'/'+_0x491446)[_0x3fc0('0x1b')](_0x562ecc);}return null;};}function patchUpdates(_0x5c859e){return function(_0xf13744){try{jsonpatch[_0x3fc0('0x22')](_0xf13744,_0x5c859e,!![]);}catch(_0x34ffa7){return BPromise[_0x3fc0('0x23')](_0x34ffa7);}return _0xf13744[_0x3fc0('0x24')]();};}function saveUpdates(_0x448293,_0x47c770){return function(_0x477674){if(_0x477674){return _0x477674[_0x3fc0('0x25')](_0x448293)[_0x3fc0('0x26')](function(_0x28fc65){return _0x28fc65;});}return null;};}function removeEntity(_0x46c213,_0x303dd2){return function(_0x2f423e){if(_0x2f423e){return _0x2f423e[_0x3fc0('0x27')]()[_0x3fc0('0x26')](function(){var _0x35a3e2=_0x2f423e[_0x3fc0('0x28')]({'plain':!![]});var _0x1abe10=_0x3fc0('0x29');return db[_0x3fc0('0x2a')][_0x3fc0('0x27')]({'where':{'type':_0x1abe10,'resourceId':_0x35a3e2['id']}})[_0x3fc0('0x26')](function(){return _0x2f423e;});})['then'](function(){_0x46c213[_0x3fc0('0x1a')](0xcc)[_0x3fc0('0x19')]();});}};}function handleEntityNotFound(_0x1d9932,_0x35c34c){return function(_0x5a9179){if(!_0x5a9179){_0x1d9932[_0x3fc0('0x18')](0x194);}return _0x5a9179;};}function handleError(_0x197dfa,_0x126515){_0x126515=_0x126515||0x1f4;return function(_0x2645b4){logger['error'](_0x2645b4[_0x3fc0('0x2b')]);if(_0x2645b4[_0x3fc0('0x2c')]){delete _0x2645b4[_0x3fc0('0x2c')];}_0x197dfa[_0x3fc0('0x1a')](_0x126515)[_0x3fc0('0x2d')](_0x2645b4);};}exports[_0x3fc0('0x2e')]=function(_0x485f0c,_0xd9ecae){var _0x2351c8={},_0x181948={},_0x21a074={'count':0x0,'rows':[]};var _0x3f1a75=_[_0x3fc0('0x2f')](db[_0x3fc0('0x30')][_0x3fc0('0x31')],function(_0x4d6551){return{'name':_0x4d6551['fieldName'],'type':_0x4d6551[_0x3fc0('0x32')]['key']};});_0x181948[_0x3fc0('0x33')]=_[_0x3fc0('0x2f')](_0x3f1a75,_0x3fc0('0x2c'));_0x181948[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x485f0c['query']);_0x181948['filters']=_[_0x3fc0('0x36')](_0x181948[_0x3fc0('0x33')],_0x181948[_0x3fc0('0x34')]);_0x2351c8[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x181948['model'],qs[_0x3fc0('0x38')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x38')]));_0x2351c8['attributes']=_0x2351c8[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x2351c8[_0x3fc0('0x37')]:_0x181948[_0x3fc0('0x33')];if(!_0x485f0c['query'][_0x3fc0('0x3a')](_0x3fc0('0x3b'))){_0x2351c8['limit']=qs[_0x3fc0('0x1f')](_0x485f0c['query'][_0x3fc0('0x1f')]);_0x2351c8[_0x3fc0('0x1c')]=qs[_0x3fc0('0x1c')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x1c')]);}_0x2351c8[_0x3fc0('0x3c')]=qs[_0x3fc0('0x3d')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x3d')]);_0x2351c8[_0x3fc0('0x3e')]=qs[_0x3fc0('0x3f')](_['pick'](_0x485f0c[_0x3fc0('0x34')],_0x181948[_0x3fc0('0x3f')]),_0x3f1a75);if(_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x40')]){_0x2351c8[_0x3fc0('0x3e')]=_[_0x3fc0('0x41')](_0x2351c8['where'],{'$or':_['map'](_0x3f1a75,function(_0x3af7ed){if(_0x3af7ed[_0x3fc0('0x32')]!==_0x3fc0('0x42')){var _0x3e285f={};_0x3e285f[_0x3af7ed[_0x3fc0('0x2c')]]={'$like':'%'+_0x485f0c['query']['filter']+'%'};return _0x3e285f;}})});}_0x2351c8=_['merge']({},_0x2351c8,_0x485f0c[_0x3fc0('0x43')]);var _0x39d65c={'where':_0x2351c8[_0x3fc0('0x3e')]};return db['Tag']['count'](_0x39d65c)[_0x3fc0('0x26')](function(_0x239dc5){_0x21a074[_0x3fc0('0x1e')]=_0x239dc5;if(_0x485f0c[_0x3fc0('0x34')]['includeAll']){_0x2351c8['include']=[{'all':!![]}];}return db[_0x3fc0('0x30')][_0x3fc0('0x44')](_0x2351c8);})['then'](function(_0x32768f){_0x21a074['rows']=_0x32768f;return _0x21a074;})[_0x3fc0('0x26')](respondWithFilteredResult(_0xd9ecae,_0x2351c8))[_0x3fc0('0x45')](handleError(_0xd9ecae,null));};exports[_0x3fc0('0x46')]=function(_0x90120f,_0x2d01e9){var _0x38e449={'raw':!![],'where':{'id':_0x90120f[_0x3fc0('0x47')]['id']}},_0x80dfee={};_0x80dfee['model']=_[_0x3fc0('0x35')](db['Tag'][_0x3fc0('0x31')]);_0x80dfee[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x90120f[_0x3fc0('0x34')]);_0x80dfee[_0x3fc0('0x3f')]=_['intersection'](_0x80dfee[_0x3fc0('0x33')],_0x80dfee[_0x3fc0('0x34')]);_0x38e449[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x80dfee['model'],qs[_0x3fc0('0x38')](_0x90120f['query'][_0x3fc0('0x38')]));_0x38e449[_0x3fc0('0x37')]=_0x38e449[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x38e449[_0x3fc0('0x37')]:_0x80dfee['model'];if(_0x90120f[_0x3fc0('0x34')][_0x3fc0('0x48')]){_0x38e449[_0x3fc0('0x49')]=[{'all':!![]}];}_0x38e449=_['merge']({},_0x38e449,_0x90120f[_0x3fc0('0x43')]);return db[_0x3fc0('0x30')]['find'](_0x38e449)[_0x3fc0('0x26')](handleEntityNotFound(_0x2d01e9,null))[_0x3fc0('0x26')](respondWithResult(_0x2d01e9,null))[_0x3fc0('0x45')](handleError(_0x2d01e9,null));};exports['create']=function(_0x5e5c73,_0x3a35ac){return db[_0x3fc0('0x30')][_0x3fc0('0x4a')](_0x5e5c73['body'],{})[_0x3fc0('0x26')](function(_0x527569){var _0x40dbf3=_0x5e5c73['user']['get']({'plain':!![]});if(!_0x40dbf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dbf3[_0x3fc0('0x4b')]===_0x3fc0('0x4c')){var _0x141b4c=_0x527569[_0x3fc0('0x28')]({'plain':!![]});var _0x1e0c43=_0x3fc0('0x29');return db['UserProfileSection'][_0x3fc0('0x4d')]({'where':{'name':_0x1e0c43,'userProfileId':_0x40dbf3[_0x3fc0('0x4e')]},'raw':!![]})['then'](function(_0x550463){if(_0x550463&&_0x550463[_0x3fc0('0x4f')]===0x0){return db[_0x3fc0('0x2a')][_0x3fc0('0x4a')]({'name':_0x141b4c[_0x3fc0('0x2c')],'resourceId':_0x141b4c['id'],'type':_0x550463[_0x3fc0('0x2c')],'sectionId':_0x550463['id']},{})[_0x3fc0('0x26')](function(){return _0x527569;});}else{return _0x527569;}})[_0x3fc0('0x45')](function(_0x2da185){logger[_0x3fc0('0x50')](_0x3fc0('0x51'),_0x2da185);throw _0x2da185;});}return _0x527569;})[_0x3fc0('0x26')](respondWithResult(_0x3a35ac,0xc9))[_0x3fc0('0x45')](handleError(_0x3a35ac,null));};exports['update']=function(_0x24be72,_0xda5d3e){if(_0x24be72[_0x3fc0('0x52')]['id']){delete _0x24be72[_0x3fc0('0x52')]['id'];}return db[_0x3fc0('0x30')]['find']({'where':{'id':_0x24be72[_0x3fc0('0x47')]['id']}})['then'](handleEntityNotFound(_0xda5d3e,null))[_0x3fc0('0x26')](saveUpdates(_0x24be72[_0x3fc0('0x52')],null))[_0x3fc0('0x26')](respondWithResult(_0xda5d3e,null))[_0x3fc0('0x45')](handleError(_0xda5d3e,null));};exports['destroy']=function(_0x1656c7,_0xd903e3){return db[_0x3fc0('0x30')][_0x3fc0('0x4d')]({'where':{'id':_0x1656c7[_0x3fc0('0x47')]['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0xd903e3,null))['then'](removeEntity(_0xd903e3,null))[_0x3fc0('0x45')](handleError(_0xd903e3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ad08f2e..8abda5d 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 _0xa7d3=['rimraf','../../config/environment','exports','define','Tag','tools_tags','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2b45be,_0x18edcf){var _0x296fa5=function(_0x5223e9){while(--_0x5223e9){_0x2b45be['push'](_0x2b45be['shift']());}};_0x296fa5(++_0x18edcf);}(_0xa7d3,0x171));var _0x3a7d=function(_0x2c5e7e,_0x11e647){_0x2c5e7e=_0x2c5e7e-0x0;var _0x2cb143=_0xa7d3[_0x2c5e7e];return _0x2cb143;};'use strict';var _=require('lodash');var util=require(_0x3a7d('0x0'));var logger=require(_0x3a7d('0x1'))(_0x3a7d('0x2'));var moment=require('moment');var BPromise=require(_0x3a7d('0x3'));var rp=require(_0x3a7d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a7d('0x5'));var config=require(_0x3a7d('0x6'));var attributes=require('./tag.attributes');module[_0x3a7d('0x7')]=function(_0x92e400,_0x10205c){return _0x92e400[_0x3a7d('0x8')](_0x3a7d('0x9'),attributes,{'tableName':_0x3a7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd071=['path','rimraf','../../config/environment','./tag.attributes','define','util','../../config/logger','bluebird','request-promise'];(function(_0x486f67,_0x31a5ba){var _0x51e075=function(_0x5aec97){while(--_0x5aec97){_0x486f67['push'](_0x486f67['shift']());}};_0x51e075(++_0x31a5ba);}(_0xd071,0x10a));var _0x1d07=function(_0x1643ce,_0x35fba8){_0x1643ce=_0x1643ce-0x0;var _0x188e65=_0xd071[_0x1643ce];return _0x188e65;};'use strict';var _=require('lodash');var util=require(_0x1d07('0x0'));var logger=require(_0x1d07('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1d07('0x2'));var rp=require(_0x1d07('0x3'));var fs=require('fs');var path=require(_0x1d07('0x4'));var rimraf=require(_0x1d07('0x5'));var config=require(_0x1d07('0x6'));var attributes=require(_0x1d07('0x7'));module['exports']=function(_0x5efd22,_0x76bda0){return _0x5efd22[_0x1d07('0x8')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index be9c601..ac19641 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 _0xbd50=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd50,0x196));var _0x0bd5=function(_0x235f95,_0x2bf647){_0x235f95=_0x235f95-0x0;var _0x2348cb=_0xbd50[_0x235f95];return _0x2348cb;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file +var _0x6308=['stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6308,0x1f2));var _0x8630=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x6308[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var moment=require(_0x8630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8630('0x2'));var db=require(_0x8630('0x3'))['db'];var utils=require(_0x8630('0x4'));var logger=require(_0x8630('0x5'))(_0x8630('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8630('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337086,_0x3d5a10,_0x1bcfea){return new BPromise(function(_0x2b87ea,_0x10cc17){return client[_0x8630('0x8')](_0x337086,_0x1bcfea)['then'](function(_0x8b3652){logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));logger[_0x8630('0xb')]('Tag,\x20%s,\x20%s,\x20%s',_0x3d5a10,_0x8630('0xa'),JSON[_0x8630('0xc')](_0x8b3652));if(_0x8b3652[_0x8630('0xd')]){if(_0x8b3652['error'][_0x8630('0xe')]===0x1f4){logger[_0x8630('0xd')]('Tag,\x20%s,\x20%s',_0x3d5a10,_0x8b3652['error'][_0x8630('0xf')]);return _0x10cc17(_0x8b3652[_0x8630('0xd')]['message']);}logger[_0x8630('0xd')]('Tag,\x20%s,\x20%s',_0x3d5a10,_0x8b3652[_0x8630('0xd')]['message']);return _0x2b87ea(_0x8b3652[_0x8630('0xd')]['message']);}else{logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));_0x2b87ea(_0x8b3652['result']['message']);}})[_0x8630('0x10')](function(_0x547667){logger[_0x8630('0xd')](_0x8630('0x9'),_0x3d5a10,_0x547667);_0x10cc17(_0x547667);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 9d68d2c..54317bd 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index ab7a2e0..a9fe6d5 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 _0xb7e7=['STRING','sequelize'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x4a66de,_0x2afc51){var _0x11029a=function(_0x1fe7c9){while(--_0x1fe7c9){_0x4a66de['push'](_0x4a66de['shift']());}};_0x11029a(++_0x2afc51);}(_0xb10b,0x12a));var _0xbb10=function(_0x29cd52,_0x88b52b){_0x29cd52=_0x29cd52-0x0;var _0x5218bc=_0xb10b[_0x29cd52];return _0x5218bc;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 71fcc74..89ab84e 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 _0xd745=['nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','role','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','findOne','add','Queues','ids','removeQueues','remove','addAgents','isArray','Chat','Sms','Openchannel','Whatsapp','through','QueueId','Voice','defaults','TeamVoiceQueue','penalty','findOrCreate','Queue:save','User','findAll','online','voicePause','interface','format','all','upsert','VoicePrefixId','spread','removeAgents','Mail','Queue:remove','UserVoiceQueueRt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x109a85,_0x1423db){var _0x3b29ac=function(_0x282b07){while(--_0x282b07){_0x109a85['push'](_0x109a85['shift']());}};_0x3b29ac(++_0x1423db);}(_0xd745,0x1a3));var _0x5d74=function(_0x40feef,_0x40036a){_0x40feef=_0x40feef-0x0;var _0xb67a05=_0xd745[_0x40feef];return _0xb67a05;};'use strict';var emlformat=require(_0x5d74('0x0'));var rimraf=require(_0x5d74('0x1'));var zipdir=require(_0x5d74('0x2'));var jsonpatch=require(_0x5d74('0x3'));var rp=require(_0x5d74('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d74('0x5'));var util=require(_0x5d74('0x6'));var path=require('path');var sox=require(_0x5d74('0x7'));var csv=require('to-csv');var ejs=require(_0x5d74('0x8'));var fs=require('fs');var fs_extra=require(_0x5d74('0x9'));var _=require('lodash');var squel=require(_0x5d74('0xa'));var crypto=require(_0x5d74('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d74('0xc'));var toCsv=require(_0x5d74('0xd'));var querystring=require(_0x5d74('0xe'));var Papa=require(_0x5d74('0xf'));var Redis=require(_0x5d74('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5d74('0x11'));var as=require(_0x5d74('0x12'));var hardwareService=require(_0x5d74('0x13'));var logger=require(_0x5d74('0x14'))(_0x5d74('0x15'));var utils=require(_0x5d74('0x16'));var config=require(_0x5d74('0x17'));var licenseUtil=require(_0x5d74('0x18'));var db=require(_0x5d74('0x19'))['db'];config['redis']=_['defaults'](config[_0x5d74('0x1a')],{'host':_0x5d74('0x1b'),'port':0x18eb});var socket=require(_0x5d74('0x1c'))(new Redis(config[_0x5d74('0x1a')]));require(_0x5d74('0x1d'))[_0x5d74('0x1e')](socket);function respondWithStatusCode(_0x19b6e8,_0x44eb88){_0x44eb88=_0x44eb88||0xcc;return function(_0xb3e0f6){if(_0xb3e0f6){return _0x19b6e8[_0x5d74('0x1f')](_0x44eb88);}return _0x19b6e8[_0x5d74('0x20')](_0x44eb88)[_0x5d74('0x21')]();};}function respondWithResult(_0x2c2fd2,_0x230ff6){_0x230ff6=_0x230ff6||0xc8;return function(_0x170445){if(_0x170445){return _0x2c2fd2['status'](_0x230ff6)[_0x5d74('0x22')](_0x170445);}};}function respondWithFilteredResult(_0x565f95,_0x1e5333){return function(_0x2c7368){if(_0x2c7368){var _0x3f357e=typeof _0x1e5333['offset']===_0x5d74('0x23')&&typeof _0x1e5333[_0x5d74('0x24')]===_0x5d74('0x23');var _0xa0155f=_0x2c7368[_0x5d74('0x25')];var _0x79a54d=_0x3f357e?0x0:_0x1e5333[_0x5d74('0x26')];var _0xe8b469=_0x3f357e?_0x2c7368[_0x5d74('0x25')]:_0x1e5333[_0x5d74('0x26')]+_0x1e5333['limit'];var _0x2e191e;if(_0xe8b469>=_0xa0155f){_0xe8b469=_0xa0155f;_0x2e191e=0xc8;}else{_0x2e191e=0xce;}_0x565f95['status'](_0x2e191e);return _0x565f95[_0x5d74('0x27')](_0x5d74('0x28'),_0x79a54d+'-'+_0xe8b469+'/'+_0xa0155f)[_0x5d74('0x22')](_0x2c7368);}return null;};}function patchUpdates(_0x303952){return function(_0x578e99){try{jsonpatch[_0x5d74('0x29')](_0x578e99,_0x303952,!![]);}catch(_0x41cc5c){return BPromise[_0x5d74('0x2a')](_0x41cc5c);}return _0x578e99[_0x5d74('0x2b')]();};}function saveUpdates(_0x2e5870,_0x5f36de){return function(_0x7ef8ff){if(_0x7ef8ff){return _0x7ef8ff[_0x5d74('0x2c')](_0x2e5870)[_0x5d74('0x2d')](function(_0x20d2da){return _0x20d2da;});}return null;};}function handleEntityNotFound(_0x558bbb,_0x3321dd){return function(_0x3a9cea){if(!_0x3a9cea){_0x558bbb[_0x5d74('0x1f')](0x194);}return _0x3a9cea;};}function handleError(_0xa58a0d,_0x36a2c3){_0x36a2c3=_0x36a2c3||0x1f4;return function(_0x71ce14){logger[_0x5d74('0x2e')](_0x71ce14[_0x5d74('0x2f')]);if(_0x71ce14[_0x5d74('0x30')]){delete _0x71ce14[_0x5d74('0x30')];}_0xa58a0d[_0x5d74('0x20')](_0x36a2c3)[_0x5d74('0x31')](_0x71ce14);};}exports[_0x5d74('0x32')]=function(_0x3caa77,_0x3423c8){var _0xf54a0b={},_0x595d29={},_0x1ce22b={'count':0x0,'rows':[]};var _0x4139e3=_[_0x5d74('0x33')](db[_0x5d74('0x34')]['rawAttributes'],function(_0x94f4ac){return{'name':_0x94f4ac[_0x5d74('0x35')],'type':_0x94f4ac[_0x5d74('0x36')][_0x5d74('0x37')]};});_0x595d29[_0x5d74('0x38')]=_[_0x5d74('0x33')](_0x4139e3,_0x5d74('0x30'));_0x595d29[_0x5d74('0x39')]=_[_0x5d74('0x3a')](_0x3caa77[_0x5d74('0x39')]);_0x595d29['filters']=_[_0x5d74('0x3b')](_0x595d29[_0x5d74('0x38')],_0x595d29[_0x5d74('0x39')]);_0xf54a0b[_0x5d74('0x3c')]=_['intersection'](_0x595d29[_0x5d74('0x38')],qs[_0x5d74('0x3d')](_0x3caa77['query'][_0x5d74('0x3d')]));_0xf54a0b[_0x5d74('0x3c')]=_0xf54a0b[_0x5d74('0x3c')][_0x5d74('0x3e')]?_0xf54a0b[_0x5d74('0x3c')]:_0x595d29[_0x5d74('0x38')];if(!_0x3caa77[_0x5d74('0x39')][_0x5d74('0x3f')](_0x5d74('0x40'))){_0xf54a0b[_0x5d74('0x24')]=qs[_0x5d74('0x24')](_0x3caa77['query'][_0x5d74('0x24')]);_0xf54a0b['offset']=qs[_0x5d74('0x26')](_0x3caa77[_0x5d74('0x39')][_0x5d74('0x26')]);}_0xf54a0b[_0x5d74('0x41')]=qs[_0x5d74('0x42')](_0x3caa77[_0x5d74('0x39')][_0x5d74('0x42')]);_0xf54a0b[_0x5d74('0x43')]=qs[_0x5d74('0x44')](_['pick'](_0x3caa77[_0x5d74('0x39')],_0x595d29[_0x5d74('0x44')]),_0x4139e3);if(_0x3caa77[_0x5d74('0x39')][_0x5d74('0x45')]){_0xf54a0b[_0x5d74('0x43')]=_[_0x5d74('0x46')](_0xf54a0b[_0x5d74('0x43')],{'$or':_[_0x5d74('0x33')](_0x4139e3,function(_0x5606f6){if(_0x5606f6['type']!==_0x5d74('0x47')){var _0xe8625f={};_0xe8625f[_0x5606f6[_0x5d74('0x30')]]={'$like':'%'+_0x3caa77[_0x5d74('0x39')]['filter']+'%'};return _0xe8625f;}})});}_0xf54a0b=_[_0x5d74('0x46')]({},_0xf54a0b,_0x3caa77[_0x5d74('0x48')]);var _0x110cc4={'where':_0xf54a0b[_0x5d74('0x43')]};return db[_0x5d74('0x34')][_0x5d74('0x25')](_0x110cc4)[_0x5d74('0x2d')](function(_0x482098){_0x1ce22b[_0x5d74('0x25')]=_0x482098;if(_0x3caa77[_0x5d74('0x39')][_0x5d74('0x49')]){_0xf54a0b['include']=[{'all':!![]}];}return db[_0x5d74('0x34')]['findAll'](_0xf54a0b);})[_0x5d74('0x2d')](function(_0x48a59e){_0x1ce22b[_0x5d74('0x4a')]=_0x48a59e;return _0x1ce22b;})['then'](respondWithFilteredResult(_0x3423c8,_0xf54a0b))[_0x5d74('0x4b')](handleError(_0x3423c8,null));};exports[_0x5d74('0x4c')]=function(_0xca80e0,_0x5e6933){var _0x40adde={'raw':![],'where':{'id':_0xca80e0[_0x5d74('0x4d')]['id']}},_0x286f98={};_0x286f98[_0x5d74('0x38')]=_[_0x5d74('0x3a')](db[_0x5d74('0x34')][_0x5d74('0x4e')]);_0x286f98[_0x5d74('0x39')]=_[_0x5d74('0x3a')](_0xca80e0['query']);_0x286f98[_0x5d74('0x44')]=_[_0x5d74('0x3b')](_0x286f98[_0x5d74('0x38')],_0x286f98[_0x5d74('0x39')]);_0x40adde[_0x5d74('0x3c')]=_['intersection'](_0x286f98[_0x5d74('0x38')],qs[_0x5d74('0x3d')](_0xca80e0[_0x5d74('0x39')][_0x5d74('0x3d')]));_0x40adde[_0x5d74('0x3c')]=_0x40adde[_0x5d74('0x3c')][_0x5d74('0x3e')]?_0x40adde[_0x5d74('0x3c')]:_0x286f98['model'];if(_0xca80e0[_0x5d74('0x39')][_0x5d74('0x49')]){_0x40adde['include']=[{'all':!![]}];}_0x40adde=_[_0x5d74('0x46')]({},_0x40adde,_0xca80e0[_0x5d74('0x48')]);return db[_0x5d74('0x34')][_0x5d74('0x4f')](_0x40adde)[_0x5d74('0x2d')](handleEntityNotFound(_0x5e6933,null))[_0x5d74('0x2d')](respondWithResult(_0x5e6933,null))[_0x5d74('0x4b')](handleError(_0x5e6933,null));};exports[_0x5d74('0x50')]=function(_0x324434,_0xe3bb43){return db[_0x5d74('0x34')]['create'](_0x324434[_0x5d74('0x51')],{})[_0x5d74('0x2d')](function(_0x3737cc){var _0x4d1e5e=_0x324434[_0x5d74('0x52')][_0x5d74('0x53')]({'plain':!![]});if(!_0x4d1e5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d1e5e[_0x5d74('0x54')]===_0x5d74('0x52')){var _0x2daa39=_0x3737cc[_0x5d74('0x53')]({'plain':!![]});var _0x2d205a=_0x5d74('0x55');return db[_0x5d74('0x56')]['find']({'where':{'name':_0x2d205a,'userProfileId':_0x4d1e5e['userProfileId']},'raw':!![]})[_0x5d74('0x2d')](function(_0x1d42b2){if(_0x1d42b2&&_0x1d42b2[_0x5d74('0x57')]===0x0){return db[_0x5d74('0x58')][_0x5d74('0x50')]({'name':_0x2daa39[_0x5d74('0x30')],'resourceId':_0x2daa39['id'],'type':_0x1d42b2[_0x5d74('0x30')],'sectionId':_0x1d42b2['id']},{})['then'](function(){return _0x3737cc;});}else{return _0x3737cc;}})[_0x5d74('0x4b')](function(_0x4429c9){logger[_0x5d74('0x2e')](_0x5d74('0x59'),_0x4429c9);throw _0x4429c9;});}return _0x3737cc;})[_0x5d74('0x2d')](respondWithResult(_0xe3bb43,0xc9))[_0x5d74('0x4b')](handleError(_0xe3bb43,null));};exports[_0x5d74('0x2c')]=function(_0x1546cf,_0x280b9e){if(_0x1546cf[_0x5d74('0x51')]['id']){delete _0x1546cf['body']['id'];}return db[_0x5d74('0x34')][_0x5d74('0x4f')]({'where':{'id':_0x1546cf[_0x5d74('0x4d')]['id']}})[_0x5d74('0x2d')](handleEntityNotFound(_0x280b9e,null))[_0x5d74('0x2d')](saveUpdates(_0x1546cf[_0x5d74('0x51')],null))[_0x5d74('0x2d')](respondWithResult(_0x280b9e,null))[_0x5d74('0x4b')](handleError(_0x280b9e,null));};exports['destroy']=function(_0x1d9b88,_0x310151){var _0x8a7f72=_0x1d9b88[_0x5d74('0x4d')]['id'];var _0x131d1a=[];return db['sequelize'][_0x5d74('0x5a')](function(_0x4f6087){var _0x399a3c=_0x5d74('0x5b')+_0x8a7f72;return db[_0x5d74('0x5c')][_0x5d74('0x39')](_0x399a3c,{'type':db[_0x5d74('0x5d')]['QueryTypes'][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087})['then'](function(_0x598de1){_0x131d1a=_['map'](_0x598de1,function(_0x12662b){return Number(_0x12662b[_0x5d74('0x5f')]);});})[_0x5d74('0x2d')](function(){var _0x5602d3=_0x5d74('0x60')+_0x8a7f72;return db[_0x5d74('0x5c')][_0x5d74('0x39')](_0x5602d3,{'type':db['Sequelize'][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x174b58){var _0x7a227e=_[_0x5d74('0x33')](_0x174b58,function(_0x5cef2e){return Number(_0x5cef2e[_0x5d74('0x62')]);});return db[_0x5d74('0x63')][_0x5d74('0x64')]({'where':{'UserId':{'$in':_0x131d1a},'VoiceQueueId':{'$in':_0x7a227e}},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){var _0x443a85=_0x5d74('0x65')+_0x8a7f72;return db['sequelize']['query'](_0x443a85,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')]['SELECT'],'raw':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x55377f){var _0x7ec1d1=_[_0x5d74('0x33')](_0x55377f,function(_0x47c27f){return Number(_0x47c27f[_0x5d74('0x66')]);});return db['UserMailQueue'][_0x5d74('0x64')]({'where':{'UserId':{'$in':_0x131d1a},'MailQueueId':{'$in':_0x7ec1d1}},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){var _0x2966ff=_0x5d74('0x67')+_0x8a7f72;return db[_0x5d74('0x5c')][_0x5d74('0x39')](_0x2966ff,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x1633f7){var _0x511886=_[_0x5d74('0x33')](_0x1633f7,function(_0x21b2b8){return Number(_0x21b2b8[_0x5d74('0x68')]);});return db[_0x5d74('0x69')]['destroy']({'where':{'UserId':{'$in':_0x131d1a},'SmsQueueId':{'$in':_0x511886}},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){var _0x2ca294=_0x5d74('0x6a')+_0x8a7f72;return db[_0x5d74('0x5c')]['query'](_0x2ca294,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x37b8e5){var _0x2ed33b=_[_0x5d74('0x33')](_0x37b8e5,function(_0x29b8b5){return Number(_0x29b8b5[_0x5d74('0x6b')]);});return db[_0x5d74('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x131d1a},'ChatQueueId':{'$in':_0x2ed33b}},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){var _0x17bee0=_0x5d74('0x6d')+_0x8a7f72;return db[_0x5d74('0x5c')][_0x5d74('0x39')](_0x17bee0,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})['then'](function(_0x5abaaf){var _0x1ac700=_[_0x5d74('0x33')](_0x5abaaf,function(_0x13a56e){return Number(_0x13a56e[_0x5d74('0x6e')]);});return db[_0x5d74('0x6f')][_0x5d74('0x64')]({'where':{'UserId':{'$in':_0x131d1a},'FaxQueueId':{'$in':_0x1ac700}},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){var _0x3cf97d='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x8a7f72;return db[_0x5d74('0x5c')][_0x5d74('0x39')](_0x3cf97d,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})['then'](function(_0x4e3258){var _0x42eaee=_[_0x5d74('0x33')](_0x4e3258,function(_0x4a01dc){return Number(_0x4a01dc[_0x5d74('0x70')]);});return db[_0x5d74('0x71')]['destroy']({'where':{'UserId':{'$in':_0x131d1a},'OpenchannelQueueId':{'$in':_0x42eaee}},'transaction':_0x4f6087});})['then'](function(){var _0x2b50f9=_0x5d74('0x72')+_0x8a7f72;return db[_0x5d74('0x5c')]['query'](_0x2b50f9,{'type':db[_0x5d74('0x5d')][_0x5d74('0x61')][_0x5d74('0x5e')],'raw':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x12f2bc){var _0x871557=_[_0x5d74('0x33')](_0x12f2bc,function(_0x19b5da){return Number(_0x19b5da[_0x5d74('0x73')]);});return db[_0x5d74('0x74')]['destroy']({'where':{'UserId':{'$in':_0x131d1a},'WhatsappQueueId':{'$in':_0x871557}},'transaction':_0x4f6087});})['then'](function(){return db['TeamVoicePrefix'][_0x5d74('0x4f')]({'where':{'TeamId':_0x8a7f72}});})[_0x5d74('0x2d')](function(_0x2ac18d){if(_0x2ac18d===null){return;}return db[_0x5d74('0x75')][_0x5d74('0x64')]({'where':{'UserId':{'$in':_0x131d1a},'VoicePrefixId':_0x2ac18d['VoicePrefixId']},'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(){return db[_0x5d74('0x34')][_0x5d74('0x64')]({'where':{'id':_0x8a7f72},'cascade':!![],'transaction':_0x4f6087});})[_0x5d74('0x2d')](function(_0x1b9380){if(_0x1b9380===0x0){_0x310151[_0x5d74('0x1f')](0x194);}else{return db[_0x5d74('0x58')][_0x5d74('0x64')]({'where':{'type':_0x5d74('0x55'),'resourceId':_0x8a7f72},'cascade':!![],'transaction':_0x4f6087})['then'](function(){_0x310151['status'](0xcc)[_0x5d74('0x21')]();});}})['catch'](function(_0x29780f){_0x310151[_0x5d74('0x20')](0x1f4)['send'](_0x29780f);});});};exports[_0x5d74('0x76')]=function(_0x479d36,_0x196095,_0x5355cf){return db[_0x5d74('0x34')]['findOne']({'where':{'id':_0x479d36[_0x5d74('0x4d')]['id']}})['then'](handleEntityNotFound(_0x196095,null))['then'](function(_0x25a901){if(!_0x479d36[_0x5d74('0x39')][_0x5d74('0x77')]||!utils[_0x5d74('0x78')](_0x479d36['query']['channel'])){throw new db['Sequelize'][(_0x5d74('0x79'))](_0x5d74('0x7a'));}var _0xf5d05d={};var _0x5dffd3={};_0x5dffd3[_0x5d74('0x38')]=_[_0x5d74('0x3a')](db[_[_0x5d74('0x7b')](_0x479d36['query'][_0x5d74('0x77')][_0x5d74('0x7c')]())+_0x5d74('0x7d')][_0x5d74('0x4e')]);_0x5dffd3[_0x5d74('0x39')]=_[_0x5d74('0x3a')](_0x479d36[_0x5d74('0x39')]);_0x5dffd3[_0x5d74('0x44')]=_[_0x5d74('0x3b')](_0x5dffd3[_0x5d74('0x38')],_0x5dffd3[_0x5d74('0x39')]);_0xf5d05d[_0x5d74('0x3c')]=_[_0x5d74('0x3b')](_0x5dffd3[_0x5d74('0x38')],qs[_0x5d74('0x3d')](_0x479d36['query'][_0x5d74('0x3d')]));_0xf5d05d['attributes']=_0xf5d05d[_0x5d74('0x3c')][_0x5d74('0x3e')]?_0xf5d05d[_0x5d74('0x3c')]:_0x5dffd3[_0x5d74('0x38')];_0xf5d05d[_0x5d74('0x24')]=qs[_0x5d74('0x24')](_0x479d36[_0x5d74('0x39')]['limit']);_0xf5d05d['offset']=qs['offset'](_0x479d36[_0x5d74('0x39')][_0x5d74('0x26')]);_0xf5d05d[_0x5d74('0x41')]=qs[_0x5d74('0x42')](_0x479d36[_0x5d74('0x39')][_0x5d74('0x42')]);_0xf5d05d['where']=qs[_0x5d74('0x44')](_[_0x5d74('0x7e')](_0x479d36[_0x5d74('0x39')],_0x5dffd3[_0x5d74('0x44')]));_0xf5d05d=_[_0x5d74('0x46')]({},_0xf5d05d,_0x479d36[_0x5d74('0x48')]);return _0x25a901[_0x5d74('0x53')+_[_0x5d74('0x7b')](_0x479d36[_0x5d74('0x39')]['channel'][_0x5d74('0x7c')]())+'Queues'](_0xf5d05d);})[_0x5d74('0x2d')](respondWithResult(_0x196095,null))[_0x5d74('0x4b')](handleError(_0x196095,null));};exports['addQueues']=function(_0x3b0519,_0x3f2735,_0x5f4a67){return db[_0x5d74('0x34')][_0x5d74('0x7f')]({'where':{'id':_0x3b0519[_0x5d74('0x4d')]['id']}})[_0x5d74('0x2d')](function(_0x5c0110){if(_0x5c0110){if(!_0x3b0519['body']['channel']||!utils[_0x5d74('0x78')](_0x3b0519['body'][_0x5d74('0x77')])){throw new db[(_0x5d74('0x5d'))][(_0x5d74('0x79'))](_0x5d74('0x7a'));}return _0x5c0110[_0x5d74('0x80')+_[_0x5d74('0x7b')](_0x3b0519[_0x5d74('0x51')]['channel'][_0x5d74('0x7c')]())+_0x5d74('0x81')](_0x3b0519[_0x5d74('0x51')][_0x5d74('0x82')]);}return null;})[_0x5d74('0x2d')](handleEntityNotFound(_0x3f2735,null))[_0x5d74('0x2d')](respondWithStatusCode(_0x3f2735,null))[_0x5d74('0x4b')](handleError(_0x3f2735,null));};exports[_0x5d74('0x83')]=function(_0x1fe461,_0x2441fd,_0x3c403a){return db['Team'][_0x5d74('0x7f')]({'where':{'id':_0x1fe461[_0x5d74('0x4d')]['id']}})[_0x5d74('0x2d')](function(_0x1e1946){if(_0x1e1946){if(!_0x1fe461[_0x5d74('0x39')][_0x5d74('0x77')]||!utils[_0x5d74('0x78')](_0x1fe461['query'][_0x5d74('0x77')])){throw new db[(_0x5d74('0x5d'))]['ValidationError'](_0x5d74('0x7a'));}return _0x1e1946[_0x5d74('0x84')+_[_0x5d74('0x7b')](_0x1fe461[_0x5d74('0x39')][_0x5d74('0x77')][_0x5d74('0x7c')]())+_0x5d74('0x81')](_0x1fe461[_0x5d74('0x39')]['ids']);}return null;})[_0x5d74('0x2d')](handleEntityNotFound(_0x2441fd,null))['then'](respondWithStatusCode(_0x2441fd,null))['catch'](handleError(_0x2441fd,null));};exports[_0x5d74('0x85')]=function(_0x14a4c1,_0x25325d){var _0x325b59=_[_0x5d74('0x86')](_0x14a4c1[_0x5d74('0x51')][_0x5d74('0x82')])?_0x14a4c1['body'][_0x5d74('0x82')]:[_0x14a4c1[_0x5d74('0x51')]['ids']];var _0x5ec90f=_0x14a4c1[_0x5d74('0x4d')]['id'];return db[_0x5d74('0x34')][_0x5d74('0x4f')]({'where':{'id':_0x5ec90f}})[_0x5d74('0x2d')](handleEntityNotFound(_0x25325d,null))[_0x5d74('0x2d')](function(_0x78882b){if(_0x78882b){var _0x251189=['Voice',_0x5d74('0x87'),'Mail',_0x5d74('0x88'),'Fax',_0x5d74('0x89'),_0x5d74('0x8a')];return db[_0x5d74('0x5c')][_0x5d74('0x5a')](function(_0x436607){var _0x1c854d=_[_0x5d74('0x33')](_0x251189,function(_0x5e3ea0){var _0x3d0ad5={'attributes':['id',_0x5d74('0x30')]};if(_0x5e3ea0==='Voice'){_0x3d0ad5[_0x5d74('0x8b')]={'attributes':['penalty']};}return _0x78882b[_0x5d74('0x53')+_0x5e3ea0+_0x5d74('0x81')](_0x3d0ad5)['then'](function(_0x30a22d){var _0x21d31f=_[_0x5d74('0x33')](_0x30a22d,function(_0x35bda0){var _0x418362=_[_0x5d74('0x33')](_0x325b59,function(_0x10f4cf){var _0x31cb96={'where':{'UserId':_0x10f4cf,[_0x5e3ea0+_0x5d74('0x8c')]:_0x35bda0['id']},'transaction':_0x436607};if(_0x5e3ea0===_0x5d74('0x8d')){_0x31cb96[_0x5d74('0x8e')]={'penalty':_0x35bda0[_0x5d74('0x8f')][_0x5d74('0x90')]};}return db['User'+_0x5e3ea0+_0x5d74('0x7d')][_0x5d74('0x91')](_0x31cb96)[_0x5d74('0x2d')](function(){socket['emit'](_0x5d74('0x52')+_0x5e3ea0+_0x5d74('0x92'),{'UserId':_0x10f4cf,[_0x5e3ea0+_0x5d74('0x8c')]:_0x35bda0['id']});if(_0x5e3ea0!=='Voice'){return;}return db[_0x5d74('0x93')][_0x5d74('0x94')]({'where':{'id':_0x325b59,'online':0x1},'attributes':['id','name',_0x5d74('0x95'),_0x5d74('0x96'),_0x5d74('0x97')],'raw':!![]})[_0x5d74('0x2d')](function(_0x3cc0b5){var _0xdcd1b2=_[_0x5d74('0x33')](_0x3cc0b5,function(_0x369393){return db['UserVoiceQueueRt']['upsert']({'membername':_0x369393['name'],'UserId':_0x369393['id'],'queue_name':_0x35bda0[_0x5d74('0x30')],'VoiceQueueId':_0x35bda0['id'],'interface':_['isNil'](_0x369393[_0x5d74('0x97')])?util[_0x5d74('0x98')]('SIP/%s',_0x369393[_0x5d74('0x30')]):_0x369393[_0x5d74('0x97')],'paused':_0x369393[_0x5d74('0x96')]||![],'penalty':_0x35bda0[_0x5d74('0x8f')][_0x5d74('0x90')]},{'transaction':_0x436607});});return Promise['all'](_0xdcd1b2);});});});return Promise[_0x5d74('0x99')](_0x418362);});return Promise[_0x5d74('0x99')](_0x21d31f);})[_0x5d74('0x2d')](function(){return db['TeamVoicePrefix'][_0x5d74('0x7f')]({'where':{'teamId':_0x5ec90f}})[_0x5d74('0x2d')](function(_0x1e0909){if(_0x1e0909){var _0x27e144=_[_0x5d74('0x33')](_0x325b59,function(_0x5a973f){db[_0x5d74('0x75')][_0x5d74('0x9a')]({'UserId':_0x5a973f,'VoicePrefixId':_0x1e0909[_0x5d74('0x9b')]});});return Promise[_0x5d74('0x99')](_0x27e144);}});});});return Promise[_0x5d74('0x99')](_0x1c854d)[_0x5d74('0x2d')](function(){return _0x78882b[_0x5d74('0x85')](_0x325b59,{'transaction':_0x436607})[_0x5d74('0x9c')](function(_0x2303a3){return _0x2303a3;});});});}})[_0x5d74('0x2d')](respondWithResult(_0x25325d,null))[_0x5d74('0x4b')](handleError(_0x25325d,null));};exports[_0x5d74('0x9d')]=function(_0x3d3c08,_0x323604){var _0x1c9374=_[_0x5d74('0x86')](_0x3d3c08[_0x5d74('0x39')][_0x5d74('0x82')])?_0x3d3c08[_0x5d74('0x39')][_0x5d74('0x82')]:[_0x3d3c08['query'][_0x5d74('0x82')]];var _0x887ad0=_0x3d3c08[_0x5d74('0x4d')]['id'];return db[_0x5d74('0x34')][_0x5d74('0x4f')]({'where':{'id':_0x887ad0}})[_0x5d74('0x2d')](handleEntityNotFound(_0x323604,null))[_0x5d74('0x2d')](function(_0xe6582c){if(_0xe6582c){var _0x573c43=[_0x5d74('0x8d'),'Chat',_0x5d74('0x9e'),'Sms','Fax',_0x5d74('0x89'),_0x5d74('0x8a')];return db[_0x5d74('0x5c')][_0x5d74('0x5a')](function(_0x225d02){var _0x250d94=_[_0x5d74('0x33')](_0x573c43,function(_0x389623){var _0x21fda3={'attributes':['id','name']};return _0xe6582c[_0x5d74('0x53')+_0x389623+_0x5d74('0x81')](_0x21fda3)[_0x5d74('0x2d')](function(_0x35306d){var _0x27fa9c=_[_0x5d74('0x33')](_0x35306d,function(_0x2e7208){return _0x2e7208[_0x5d74('0x9d')](_0x1c9374,{'transaction':_0x225d02})[_0x5d74('0x2d')](function(){var _0x39853f=_[_0x5d74('0x33')](_0x1c9374,function(_0x3b2a7a){socket['emit'](_0x5d74('0x52')+_0x389623+_0x5d74('0x9f'),{'UserId':Number(_0x3b2a7a),[_0x389623+_0x5d74('0x8c')]:_0x2e7208['id']});if(_0x389623!==_0x5d74('0x8d')){return;}return db[_0x5d74('0xa0')]['destroy']({'where':{'VoiceQueueId':_0x2e7208['id'],'UserId':_0x3b2a7a},'transaction':_0x225d02});});return Promise['all'](_0x39853f);});});return Promise[_0x5d74('0x99')](_0x27fa9c);});});return Promise[_0x5d74('0x99')](_0x250d94)['then'](function(){return _0xe6582c[_0x5d74('0x9d')](_0x1c9374,{'transaction':_0x225d02});})[_0x5d74('0x2d')](function(){return db['TeamVoicePrefix'][_0x5d74('0x7f')]({'where':{'teamId':_0x887ad0}})[_0x5d74('0x2d')](function(_0x3245e0){if(_0x3245e0){var _0xe2a89a=_[_0x5d74('0x33')](_0x1c9374,function(_0x3eb007){db['UserVoicePrefix'][_0x5d74('0x64')]({'where':{'UserId':_0x3eb007,'VoicePrefixId':_0x3245e0[_0x5d74('0x9b')]}});});return Promise[_0x5d74('0x99')](_0xe2a89a);}});});});}})[_0x5d74('0x2d')](respondWithStatusCode(_0x323604,null))[_0x5d74('0x4b')](handleError(_0x323604,null));};exports['getAgents']=function(_0x5ac67d,_0x9b1a4d,_0x3ce30e){var _0xb3a0e6={};var _0xe051a={};var _0x1a58f7;var _0x2c847b;return db['Team'][_0x5d74('0x7f')]({'where':{'id':_0x5ac67d['params']['id']}})['then'](handleEntityNotFound(_0x9b1a4d,null))['then'](function(_0x5c8023){if(_0x5c8023){_0x1a58f7=_0x5c8023;_0xe051a[_0x5d74('0x38')]=_[_0x5d74('0x3a')](db[_0x5d74('0x93')][_0x5d74('0x4e')]);_0xe051a[_0x5d74('0x39')]=_[_0x5d74('0x3a')](_0x5ac67d[_0x5d74('0x39')]);_0xe051a[_0x5d74('0x44')]=_['intersection'](_0xe051a['model'],_0xe051a[_0x5d74('0x39')]);_0xb3a0e6[_0x5d74('0x3c')]=_[_0x5d74('0x3b')](_0xe051a['model'],qs[_0x5d74('0x3d')](_0x5ac67d[_0x5d74('0x39')]['fields']));_0xb3a0e6['attributes']=_0xb3a0e6[_0x5d74('0x3c')]['length']?_0xb3a0e6['attributes']:_0xe051a['model'];_0xb3a0e6['order']=qs['sort'](_0x5ac67d['query'][_0x5d74('0x42')]);_0xb3a0e6['where']=qs[_0x5d74('0x44')](_[_0x5d74('0x7e')](_0x5ac67d[_0x5d74('0x39')],_0xe051a[_0x5d74('0x44')]));if(_0x5ac67d[_0x5d74('0x39')]['filter']){_0xb3a0e6[_0x5d74('0x43')]=_[_0x5d74('0x46')](_0xb3a0e6[_0x5d74('0x43')],{'$or':_[_0x5d74('0x33')](_0xb3a0e6[_0x5d74('0x3c')],function(_0x2486ef){var _0x268d80={};_0x268d80[_0x2486ef]={'$like':'%'+_0x5ac67d['query'][_0x5d74('0x45')]+'%'};return _0x268d80;})});}_0xb3a0e6=_[_0x5d74('0x46')]({},_0xb3a0e6,_0x5ac67d[_0x5d74('0x48')]);return _0x1a58f7['getAgents'](_0xb3a0e6);}})['then'](function(_0x1bb033){if(_0x1bb033){_0x2c847b=_0x1bb033[_0x5d74('0x3e')];if(!_0x5ac67d[_0x5d74('0x39')][_0x5d74('0x3f')]('nolimit')){_0xb3a0e6[_0x5d74('0x24')]=qs['limit'](_0x5ac67d['query'][_0x5d74('0x24')]);_0xb3a0e6[_0x5d74('0x26')]=qs[_0x5d74('0x26')](_0x5ac67d[_0x5d74('0x39')][_0x5d74('0x26')]);}return _0x1a58f7['getAgents'](_0xb3a0e6);}})[_0x5d74('0x2d')](function(_0x2cee12){if(_0x2cee12){return _0x2cee12?{'count':_0x2c847b,'rows':_0x2cee12}:null;}})[_0x5d74('0x2d')](respondWithResult(_0x9b1a4d,null))[_0x5d74('0x4b')](handleError(_0x9b1a4d,null));}; \ No newline at end of file +var _0x955a=['Queue:remove','getAgents','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','rawAttributes','pick','capitalize','Queues','addQueues','add','ids','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','Queue:save','User','findAll','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','UserVoicePrefix','addAgents','spread','removeAgents','emit'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x955a,0x1dc));var _0xa955=function(_0x53f9c2,_0x1ebee6){_0x53f9c2=_0x53f9c2-0x0;var _0x3c3177=_0x955a[_0x53f9c2];return _0x3c3177;};'use strict';var emlformat=require(_0xa955('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa955('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa955('0x2'));var Mustache=require(_0xa955('0x3'));var util=require(_0xa955('0x4'));var path=require(_0xa955('0x5'));var sox=require(_0xa955('0x6'));var csv=require(_0xa955('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa955('0x8'));var squel=require(_0xa955('0x9'));var crypto=require(_0xa955('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa955('0xb'));var toCsv=require(_0xa955('0x7'));var querystring=require(_0xa955('0xc'));var Papa=require(_0xa955('0xd'));var Redis=require(_0xa955('0xe'));var authService=require(_0xa955('0xf'));var qs=require(_0xa955('0x10'));var as=require(_0xa955('0x11'));var hardwareService=require(_0xa955('0x12'));var logger=require('../../config/logger')(_0xa955('0x13'));var utils=require(_0xa955('0x14'));var config=require(_0xa955('0x15'));var licenseUtil=require(_0xa955('0x16'));var db=require('../../mysqldb')['db'];config[_0xa955('0x17')]=_[_0xa955('0x18')](config[_0xa955('0x17')],{'host':_0xa955('0x19'),'port':0x18eb});var socket=require(_0xa955('0x1a'))(new Redis(config[_0xa955('0x17')]));require(_0xa955('0x1b'))[_0xa955('0x1c')](socket);function respondWithStatusCode(_0x36ef9f,_0x5b745f){_0x5b745f=_0x5b745f||0xcc;return function(_0x42753d){if(_0x42753d){return _0x36ef9f['sendStatus'](_0x5b745f);}return _0x36ef9f[_0xa955('0x1d')](_0x5b745f)[_0xa955('0x1e')]();};}function respondWithResult(_0xb07db2,_0x12197e){_0x12197e=_0x12197e||0xc8;return function(_0x5717b5){if(_0x5717b5){return _0xb07db2[_0xa955('0x1d')](_0x12197e)[_0xa955('0x1f')](_0x5717b5);}};}function respondWithFilteredResult(_0xdecc8f,_0x3b3d84){return function(_0x1fc4bd){if(_0x1fc4bd){var _0x19d664=typeof _0x3b3d84[_0xa955('0x20')]===_0xa955('0x21')&&typeof _0x3b3d84[_0xa955('0x22')]==='undefined';var _0x560fb9=_0x1fc4bd[_0xa955('0x23')];var _0x2013be=_0x19d664?0x0:_0x3b3d84['offset'];var _0x10670a=_0x19d664?_0x1fc4bd[_0xa955('0x23')]:_0x3b3d84[_0xa955('0x20')]+_0x3b3d84[_0xa955('0x22')];var _0x15816f;if(_0x10670a>=_0x560fb9){_0x10670a=_0x560fb9;_0x15816f=0xc8;}else{_0x15816f=0xce;}_0xdecc8f[_0xa955('0x1d')](_0x15816f);return _0xdecc8f['set'](_0xa955('0x24'),_0x2013be+'-'+_0x10670a+'/'+_0x560fb9)[_0xa955('0x1f')](_0x1fc4bd);}return null;};}function patchUpdates(_0x503147){return function(_0x24f038){try{jsonpatch[_0xa955('0x25')](_0x24f038,_0x503147,!![]);}catch(_0x70aa61){return BPromise[_0xa955('0x26')](_0x70aa61);}return _0x24f038[_0xa955('0x27')]();};}function saveUpdates(_0x555c44,_0xc821ee){return function(_0x139306){if(_0x139306){return _0x139306[_0xa955('0x28')](_0x555c44)[_0xa955('0x29')](function(_0x48b767){return _0x48b767;});}return null;};}function handleEntityNotFound(_0x188b26,_0x30543a){return function(_0x35b65f){if(!_0x35b65f){_0x188b26['sendStatus'](0x194);}return _0x35b65f;};}function handleError(_0x4262c5,_0x170505){_0x170505=_0x170505||0x1f4;return function(_0xe6b6b3){logger[_0xa955('0x2a')](_0xe6b6b3[_0xa955('0x2b')]);if(_0xe6b6b3['name']){delete _0xe6b6b3[_0xa955('0x2c')];}_0x4262c5[_0xa955('0x1d')](_0x170505)[_0xa955('0x2d')](_0xe6b6b3);};}exports[_0xa955('0x2e')]=function(_0x296bba,_0x54d297){var _0x20fc88={},_0x311949={},_0x38b345={'count':0x0,'rows':[]};var _0x53e1de=_[_0xa955('0x2f')](db[_0xa955('0x30')]['rawAttributes'],function(_0x359d8b){return{'name':_0x359d8b[_0xa955('0x31')],'type':_0x359d8b[_0xa955('0x32')][_0xa955('0x33')]};});_0x311949[_0xa955('0x34')]=_[_0xa955('0x2f')](_0x53e1de,'name');_0x311949[_0xa955('0x35')]=_[_0xa955('0x36')](_0x296bba[_0xa955('0x35')]);_0x311949[_0xa955('0x37')]=_['intersection'](_0x311949[_0xa955('0x34')],_0x311949[_0xa955('0x35')]);_0x20fc88[_0xa955('0x38')]=_['intersection'](_0x311949[_0xa955('0x34')],qs['fields'](_0x296bba[_0xa955('0x35')][_0xa955('0x39')]));_0x20fc88[_0xa955('0x38')]=_0x20fc88[_0xa955('0x38')][_0xa955('0x3a')]?_0x20fc88[_0xa955('0x38')]:_0x311949[_0xa955('0x34')];if(!_0x296bba['query']['hasOwnProperty'](_0xa955('0x3b'))){_0x20fc88[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x296bba['query'][_0xa955('0x22')]);_0x20fc88['offset']=qs[_0xa955('0x20')](_0x296bba['query'][_0xa955('0x20')]);}_0x20fc88[_0xa955('0x3c')]=qs['sort'](_0x296bba[_0xa955('0x35')][_0xa955('0x3d')]);_0x20fc88[_0xa955('0x3e')]=qs['filters'](_['pick'](_0x296bba[_0xa955('0x35')],_0x311949[_0xa955('0x37')]),_0x53e1de);if(_0x296bba['query'][_0xa955('0x3f')]){_0x20fc88[_0xa955('0x3e')]=_['merge'](_0x20fc88[_0xa955('0x3e')],{'$or':_['map'](_0x53e1de,function(_0x9b4686){if(_0x9b4686[_0xa955('0x32')]!==_0xa955('0x40')){var _0x46cefe={};_0x46cefe[_0x9b4686[_0xa955('0x2c')]]={'$like':'%'+_0x296bba[_0xa955('0x35')][_0xa955('0x3f')]+'%'};return _0x46cefe;}})});}_0x20fc88=_['merge']({},_0x20fc88,_0x296bba[_0xa955('0x41')]);var _0x4fe2ff={'where':_0x20fc88[_0xa955('0x3e')]};return db['Team'][_0xa955('0x23')](_0x4fe2ff)[_0xa955('0x29')](function(_0x10f98c){_0x38b345[_0xa955('0x23')]=_0x10f98c;if(_0x296bba[_0xa955('0x35')][_0xa955('0x42')]){_0x20fc88[_0xa955('0x43')]=[{'all':!![]}];}return db['Team']['findAll'](_0x20fc88);})[_0xa955('0x29')](function(_0x557d3b){_0x38b345[_0xa955('0x44')]=_0x557d3b;return _0x38b345;})[_0xa955('0x29')](respondWithFilteredResult(_0x54d297,_0x20fc88))[_0xa955('0x45')](handleError(_0x54d297,null));};exports[_0xa955('0x46')]=function(_0x2902c8,_0xd031c0){var _0x51ce5f={'raw':![],'where':{'id':_0x2902c8[_0xa955('0x47')]['id']}},_0x30dd91={};_0x30dd91[_0xa955('0x34')]=_[_0xa955('0x36')](db['Team']['rawAttributes']);_0x30dd91[_0xa955('0x35')]=_[_0xa955('0x36')](_0x2902c8[_0xa955('0x35')]);_0x30dd91[_0xa955('0x37')]=_[_0xa955('0x48')](_0x30dd91[_0xa955('0x34')],_0x30dd91[_0xa955('0x35')]);_0x51ce5f[_0xa955('0x38')]=_[_0xa955('0x48')](_0x30dd91[_0xa955('0x34')],qs[_0xa955('0x39')](_0x2902c8[_0xa955('0x35')]['fields']));_0x51ce5f['attributes']=_0x51ce5f['attributes'][_0xa955('0x3a')]?_0x51ce5f['attributes']:_0x30dd91[_0xa955('0x34')];if(_0x2902c8[_0xa955('0x35')][_0xa955('0x42')]){_0x51ce5f['include']=[{'all':!![]}];}_0x51ce5f=_[_0xa955('0x49')]({},_0x51ce5f,_0x2902c8[_0xa955('0x41')]);return db['Team'][_0xa955('0x4a')](_0x51ce5f)[_0xa955('0x29')](handleEntityNotFound(_0xd031c0,null))[_0xa955('0x29')](respondWithResult(_0xd031c0,null))[_0xa955('0x45')](handleError(_0xd031c0,null));};exports[_0xa955('0x4b')]=function(_0x245b0c,_0x333669){return db[_0xa955('0x30')]['create'](_0x245b0c[_0xa955('0x4c')],{})[_0xa955('0x29')](function(_0x365e53){var _0x4983b6=_0x245b0c[_0xa955('0x4d')][_0xa955('0x4e')]({'plain':!![]});if(!_0x4983b6)throw new Error(_0xa955('0x4f'));if(_0x4983b6[_0xa955('0x50')]===_0xa955('0x4d')){var _0x468d4d=_0x365e53['get']({'plain':!![]});var _0x1c06a6=_0xa955('0x51');return db['UserProfileSection'][_0xa955('0x4a')]({'where':{'name':_0x1c06a6,'userProfileId':_0x4983b6['userProfileId']},'raw':!![]})[_0xa955('0x29')](function(_0x178828){if(_0x178828&&_0x178828[_0xa955('0x52')]===0x0){return db[_0xa955('0x53')]['create']({'name':_0x468d4d[_0xa955('0x2c')],'resourceId':_0x468d4d['id'],'type':_0x178828['name'],'sectionId':_0x178828['id']},{})[_0xa955('0x29')](function(){return _0x365e53;});}else{return _0x365e53;}})[_0xa955('0x45')](function(_0x2f1c22){logger[_0xa955('0x2a')](_0xa955('0x54'),_0x2f1c22);throw _0x2f1c22;});}return _0x365e53;})[_0xa955('0x29')](respondWithResult(_0x333669,0xc9))['catch'](handleError(_0x333669,null));};exports[_0xa955('0x28')]=function(_0x2d7025,_0x2a1b5a){if(_0x2d7025[_0xa955('0x4c')]['id']){delete _0x2d7025[_0xa955('0x4c')]['id'];}return db[_0xa955('0x30')]['find']({'where':{'id':_0x2d7025[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0x2a1b5a,null))[_0xa955('0x29')](saveUpdates(_0x2d7025[_0xa955('0x4c')],null))[_0xa955('0x29')](respondWithResult(_0x2a1b5a,null))[_0xa955('0x45')](handleError(_0x2a1b5a,null));};exports[_0xa955('0x55')]=function(_0x40411b,_0x5d90d3){var _0x4e301a=_0x40411b[_0xa955('0x47')]['id'];var _0x535067=[];return db[_0xa955('0x56')][_0xa955('0x57')](function(_0x404c80){var _0x386f0c=_0xa955('0x58')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x386f0c,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80})[_0xa955('0x29')](function(_0x5df83f){_0x535067=_[_0xa955('0x2f')](_0x5df83f,function(_0x1dc8c7){return Number(_0x1dc8c7['UserId']);});})['then'](function(){var _0x3e68b0='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4e301a;return db[_0xa955('0x56')]['query'](_0x3e68b0,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x286502){var _0x3b8dea=_[_0xa955('0x2f')](_0x286502,function(_0x1592dd){return Number(_0x1592dd[_0xa955('0x5c')]);});return db['UserVoiceQueue'][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'VoiceQueueId':{'$in':_0x3b8dea}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x1dddaa=_0xa955('0x5d')+_0x4e301a;return db['sequelize'][_0xa955('0x35')](_0x1dddaa,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x360b90){var _0x5d4587=_[_0xa955('0x2f')](_0x360b90,function(_0x44447d){return Number(_0x44447d[_0xa955('0x5e')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x535067},'MailQueueId':{'$in':_0x5d4587}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x1afef2=_0xa955('0x5f')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x1afef2,{'type':db[_0xa955('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x13e73f){var _0x126357=_[_0xa955('0x2f')](_0x13e73f,function(_0x2b7a9c){return Number(_0x2b7a9c[_0xa955('0x60')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x535067},'SmsQueueId':{'$in':_0x126357}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x2c57c6=_0xa955('0x61')+_0x4e301a;return db['sequelize'][_0xa955('0x35')](_0x2c57c6,{'type':db[_0xa955('0x59')]['QueryTypes'][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x32c01b){var _0x30e574=_[_0xa955('0x2f')](_0x32c01b,function(_0x41f5fd){return Number(_0x41f5fd[_0xa955('0x62')]);});return db[_0xa955('0x63')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'ChatQueueId':{'$in':_0x30e574}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x39cb6e=_0xa955('0x64')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x39cb6e,{'type':db['Sequelize']['QueryTypes'][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x429663){var _0x1e1aa4=_['map'](_0x429663,function(_0x53c8ac){return Number(_0x53c8ac[_0xa955('0x65')]);});return db[_0xa955('0x66')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'FaxQueueId':{'$in':_0x1e1aa4}},'transaction':_0x404c80});})['then'](function(){var _0x51d9ad=_0xa955('0x67')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x51d9ad,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x123ac6){var _0x566e0b=_['map'](_0x123ac6,function(_0x1d3ad0){return Number(_0x1d3ad0[_0xa955('0x68')]);});return db[_0xa955('0x69')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'OpenchannelQueueId':{'$in':_0x566e0b}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x17efee=_0xa955('0x6a')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x17efee,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x4d28a1){var _0x42be4f=_[_0xa955('0x2f')](_0x4d28a1,function(_0x29ba1c){return Number(_0x29ba1c[_0xa955('0x6b')]);});return db[_0xa955('0x6c')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'WhatsappQueueId':{'$in':_0x42be4f}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){return db[_0xa955('0x6d')][_0xa955('0x4a')]({'where':{'TeamId':_0x4e301a}});})[_0xa955('0x29')](function(_0xf8baab){if(_0xf8baab===null){return;}return db['UserVoicePrefix'][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'VoicePrefixId':_0xf8baab[_0xa955('0x6e')]},'transaction':_0x404c80});})[_0xa955('0x29')](function(){return db[_0xa955('0x30')][_0xa955('0x55')]({'where':{'id':_0x4e301a},'cascade':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x6b075b){if(_0x6b075b===0x0){_0x5d90d3[_0xa955('0x6f')](0x194);}else{return db[_0xa955('0x53')][_0xa955('0x55')]({'where':{'type':_0xa955('0x51'),'resourceId':_0x4e301a},'cascade':!![],'transaction':_0x404c80})['then'](function(){_0x5d90d3[_0xa955('0x1d')](0xcc)['end']();});}})[_0xa955('0x45')](function(_0x28eb47){_0x5d90d3[_0xa955('0x1d')](0x1f4)[_0xa955('0x2d')](_0x28eb47);});});};exports[_0xa955('0x70')]=function(_0x3e35f2,_0x1eb0a2,_0x43d637){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x3e35f2[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0x1eb0a2,null))['then'](function(_0x594ae4){if(!_0x3e35f2[_0xa955('0x35')]['channel']||!utils[_0xa955('0x72')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x73')])){throw new db[(_0xa955('0x59'))][(_0xa955('0x74'))](_0xa955('0x75'));}var _0x2b67db={};var _0x25ac00={};_0x25ac00[_0xa955('0x34')]=_[_0xa955('0x36')](db[_['capitalize'](_0x3e35f2[_0xa955('0x35')]['channel'][_0xa955('0x76')]())+_0xa955('0x77')][_0xa955('0x78')]);_0x25ac00['query']=_[_0xa955('0x36')](_0x3e35f2[_0xa955('0x35')]);_0x25ac00[_0xa955('0x37')]=_['intersection'](_0x25ac00[_0xa955('0x34')],_0x25ac00[_0xa955('0x35')]);_0x2b67db[_0xa955('0x38')]=_[_0xa955('0x48')](_0x25ac00[_0xa955('0x34')],qs[_0xa955('0x39')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x39')]));_0x2b67db[_0xa955('0x38')]=_0x2b67db[_0xa955('0x38')]['length']?_0x2b67db[_0xa955('0x38')]:_0x25ac00[_0xa955('0x34')];_0x2b67db[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x3e35f2['query'][_0xa955('0x22')]);_0x2b67db[_0xa955('0x20')]=qs[_0xa955('0x20')](_0x3e35f2[_0xa955('0x35')]['offset']);_0x2b67db[_0xa955('0x3c')]=qs[_0xa955('0x3d')](_0x3e35f2[_0xa955('0x35')]['sort']);_0x2b67db['where']=qs[_0xa955('0x37')](_[_0xa955('0x79')](_0x3e35f2[_0xa955('0x35')],_0x25ac00[_0xa955('0x37')]));_0x2b67db=_[_0xa955('0x49')]({},_0x2b67db,_0x3e35f2[_0xa955('0x41')]);return _0x594ae4[_0xa955('0x4e')+_[_0xa955('0x7a')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x73')][_0xa955('0x76')]())+_0xa955('0x7b')](_0x2b67db);})[_0xa955('0x29')](respondWithResult(_0x1eb0a2,null))[_0xa955('0x45')](handleError(_0x1eb0a2,null));};exports[_0xa955('0x7c')]=function(_0x343cc3,_0x5e0b53,_0x53b103){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x343cc3[_0xa955('0x47')]['id']}})[_0xa955('0x29')](function(_0x35990d){if(_0x35990d){if(!_0x343cc3[_0xa955('0x4c')][_0xa955('0x73')]||!utils[_0xa955('0x72')](_0x343cc3['body']['channel'])){throw new db[(_0xa955('0x59'))][(_0xa955('0x74'))]('Unknown\x20channel');}return _0x35990d[_0xa955('0x7d')+_['capitalize'](_0x343cc3['body']['channel'][_0xa955('0x76')]())+_0xa955('0x7b')](_0x343cc3[_0xa955('0x4c')][_0xa955('0x7e')]);}return null;})[_0xa955('0x29')](handleEntityNotFound(_0x5e0b53,null))[_0xa955('0x29')](respondWithStatusCode(_0x5e0b53,null))[_0xa955('0x45')](handleError(_0x5e0b53,null));};exports['removeQueues']=function(_0x2b5914,_0x57b571,_0x5d3f3d){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x2b5914[_0xa955('0x47')]['id']}})['then'](function(_0x106208){if(_0x106208){if(!_0x2b5914[_0xa955('0x35')]['channel']||!utils[_0xa955('0x72')](_0x2b5914[_0xa955('0x35')][_0xa955('0x73')])){throw new db[(_0xa955('0x59'))]['ValidationError'](_0xa955('0x75'));}return _0x106208['remove'+_[_0xa955('0x7a')](_0x2b5914[_0xa955('0x35')][_0xa955('0x73')][_0xa955('0x76')]())+_0xa955('0x7b')](_0x2b5914['query'][_0xa955('0x7e')]);}return null;})[_0xa955('0x29')](handleEntityNotFound(_0x57b571,null))[_0xa955('0x29')](respondWithStatusCode(_0x57b571,null))[_0xa955('0x45')](handleError(_0x57b571,null));};exports['addAgents']=function(_0x431dde,_0x42daa6){var _0x4a758b=_[_0xa955('0x7f')](_0x431dde[_0xa955('0x4c')]['ids'])?_0x431dde[_0xa955('0x4c')][_0xa955('0x7e')]:[_0x431dde[_0xa955('0x4c')][_0xa955('0x7e')]];var _0x448f06=_0x431dde['params']['id'];return db[_0xa955('0x30')][_0xa955('0x4a')]({'where':{'id':_0x448f06}})[_0xa955('0x29')](handleEntityNotFound(_0x42daa6,null))[_0xa955('0x29')](function(_0x1accf0){if(_0x1accf0){var _0x4e662c=[_0xa955('0x80'),_0xa955('0x81'),_0xa955('0x82'),_0xa955('0x83'),_0xa955('0x84'),_0xa955('0x85'),_0xa955('0x86')];return db['sequelize']['transaction'](function(_0x54cfd2){var _0x1dc453=_[_0xa955('0x2f')](_0x4e662c,function(_0x372ff1){var _0x51257d={'attributes':['id',_0xa955('0x2c')]};if(_0x372ff1===_0xa955('0x80')){_0x51257d[_0xa955('0x87')]={'attributes':[_0xa955('0x88')]};}return _0x1accf0[_0xa955('0x4e')+_0x372ff1+_0xa955('0x7b')](_0x51257d)[_0xa955('0x29')](function(_0x4a4fde){var _0x307973=_['map'](_0x4a4fde,function(_0xbdc661){var _0x9e4113=_[_0xa955('0x2f')](_0x4a758b,function(_0x4b1702){var _0x878fe7={'where':{'UserId':_0x4b1702,[_0x372ff1+_0xa955('0x89')]:_0xbdc661['id']},'transaction':_0x54cfd2};if(_0x372ff1===_0xa955('0x80')){_0x878fe7['defaults']={'penalty':_0xbdc661[_0xa955('0x8a')][_0xa955('0x88')]};}return db['User'+_0x372ff1+_0xa955('0x77')][_0xa955('0x8b')](_0x878fe7)[_0xa955('0x29')](function(){socket['emit']('user'+_0x372ff1+_0xa955('0x8c'),{'UserId':_0x4b1702,[_0x372ff1+_0xa955('0x89')]:_0xbdc661['id']});if(_0x372ff1!==_0xa955('0x80')){return;}return db[_0xa955('0x8d')][_0xa955('0x8e')]({'where':{'id':_0x4a758b,'online':0x1},'attributes':['id',_0xa955('0x2c'),_0xa955('0x8f'),'voicePause',_0xa955('0x90')],'raw':!![]})[_0xa955('0x29')](function(_0x5d8453){var _0x3027bf=_['map'](_0x5d8453,function(_0x49cb79){return db[_0xa955('0x91')][_0xa955('0x92')]({'membername':_0x49cb79['name'],'UserId':_0x49cb79['id'],'queue_name':_0xbdc661[_0xa955('0x2c')],'VoiceQueueId':_0xbdc661['id'],'interface':_['isNil'](_0x49cb79[_0xa955('0x90')])?util[_0xa955('0x93')](_0xa955('0x94'),_0x49cb79[_0xa955('0x2c')]):_0x49cb79[_0xa955('0x90')],'paused':_0x49cb79[_0xa955('0x95')]||![],'penalty':_0xbdc661[_0xa955('0x8a')][_0xa955('0x88')]},{'transaction':_0x54cfd2});});return Promise[_0xa955('0x96')](_0x3027bf);});});});return Promise[_0xa955('0x96')](_0x9e4113);});return Promise[_0xa955('0x96')](_0x307973);})['then'](function(){return db[_0xa955('0x6d')][_0xa955('0x71')]({'where':{'teamId':_0x448f06}})['then'](function(_0x3c04bf){if(_0x3c04bf){var _0x12eb57=_[_0xa955('0x2f')](_0x4a758b,function(_0x18112f){db[_0xa955('0x97')][_0xa955('0x92')]({'UserId':_0x18112f,'VoicePrefixId':_0x3c04bf[_0xa955('0x6e')]});});return Promise[_0xa955('0x96')](_0x12eb57);}});});});return Promise[_0xa955('0x96')](_0x1dc453)['then'](function(){return _0x1accf0[_0xa955('0x98')](_0x4a758b,{'transaction':_0x54cfd2})[_0xa955('0x99')](function(_0x4a9ad2){return _0x4a9ad2;});});});}})[_0xa955('0x29')](respondWithResult(_0x42daa6,null))['catch'](handleError(_0x42daa6,null));};exports['removeAgents']=function(_0x213d02,_0x5862bf){var _0x31cb8a=_['isArray'](_0x213d02[_0xa955('0x35')][_0xa955('0x7e')])?_0x213d02[_0xa955('0x35')][_0xa955('0x7e')]:[_0x213d02[_0xa955('0x35')][_0xa955('0x7e')]];var _0x1d8438=_0x213d02[_0xa955('0x47')]['id'];return db[_0xa955('0x30')][_0xa955('0x4a')]({'where':{'id':_0x1d8438}})[_0xa955('0x29')](handleEntityNotFound(_0x5862bf,null))['then'](function(_0x4571cd){if(_0x4571cd){var _0x46b94c=[_0xa955('0x80'),'Chat','Mail',_0xa955('0x83'),_0xa955('0x84'),_0xa955('0x85'),_0xa955('0x86')];return db[_0xa955('0x56')][_0xa955('0x57')](function(_0x4d1864){var _0x1e5fb3=_[_0xa955('0x2f')](_0x46b94c,function(_0x2bdf83){var _0x3207a8={'attributes':['id',_0xa955('0x2c')]};return _0x4571cd['get'+_0x2bdf83+'Queues'](_0x3207a8)[_0xa955('0x29')](function(_0x2efc1f){var _0x1aadbd=_['map'](_0x2efc1f,function(_0x18ff61){return _0x18ff61[_0xa955('0x9a')](_0x31cb8a,{'transaction':_0x4d1864})[_0xa955('0x29')](function(){var _0x12e51f=_[_0xa955('0x2f')](_0x31cb8a,function(_0x15a77e){socket[_0xa955('0x9b')](_0xa955('0x4d')+_0x2bdf83+_0xa955('0x9c'),{'UserId':Number(_0x15a77e),[_0x2bdf83+_0xa955('0x89')]:_0x18ff61['id']});if(_0x2bdf83!==_0xa955('0x80')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x18ff61['id'],'UserId':_0x15a77e},'transaction':_0x4d1864});});return Promise[_0xa955('0x96')](_0x12e51f);});});return Promise[_0xa955('0x96')](_0x1aadbd);});});return Promise['all'](_0x1e5fb3)['then'](function(){return _0x4571cd[_0xa955('0x9a')](_0x31cb8a,{'transaction':_0x4d1864});})[_0xa955('0x29')](function(){return db[_0xa955('0x6d')][_0xa955('0x71')]({'where':{'teamId':_0x1d8438}})['then'](function(_0x57c508){if(_0x57c508){var _0x2341b5=_['map'](_0x31cb8a,function(_0x270c61){db[_0xa955('0x97')][_0xa955('0x55')]({'where':{'UserId':_0x270c61,'VoicePrefixId':_0x57c508[_0xa955('0x6e')]}});});return Promise[_0xa955('0x96')](_0x2341b5);}});});});}})[_0xa955('0x29')](respondWithStatusCode(_0x5862bf,null))[_0xa955('0x45')](handleError(_0x5862bf,null));};exports[_0xa955('0x9d')]=function(_0x954872,_0xfb25f8,_0xd6f1be){var _0x222427={};var _0x5d4d7a={};var _0x8e1f23;var _0x1d14ca;return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x954872[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0xfb25f8,null))[_0xa955('0x29')](function(_0x101f56){if(_0x101f56){_0x8e1f23=_0x101f56;_0x5d4d7a['model']=_['keys'](db[_0xa955('0x8d')]['rawAttributes']);_0x5d4d7a[_0xa955('0x35')]=_[_0xa955('0x36')](_0x954872[_0xa955('0x35')]);_0x5d4d7a[_0xa955('0x37')]=_[_0xa955('0x48')](_0x5d4d7a[_0xa955('0x34')],_0x5d4d7a[_0xa955('0x35')]);_0x222427[_0xa955('0x38')]=_[_0xa955('0x48')](_0x5d4d7a[_0xa955('0x34')],qs[_0xa955('0x39')](_0x954872[_0xa955('0x35')][_0xa955('0x39')]));_0x222427['attributes']=_0x222427['attributes'][_0xa955('0x3a')]?_0x222427[_0xa955('0x38')]:_0x5d4d7a[_0xa955('0x34')];_0x222427['order']=qs['sort'](_0x954872[_0xa955('0x35')][_0xa955('0x3d')]);_0x222427['where']=qs[_0xa955('0x37')](_[_0xa955('0x79')](_0x954872['query'],_0x5d4d7a['filters']));if(_0x954872[_0xa955('0x35')][_0xa955('0x3f')]){_0x222427[_0xa955('0x3e')]=_[_0xa955('0x49')](_0x222427[_0xa955('0x3e')],{'$or':_[_0xa955('0x2f')](_0x222427[_0xa955('0x38')],function(_0x1c990d){var _0x1e3c4f={};_0x1e3c4f[_0x1c990d]={'$like':'%'+_0x954872['query']['filter']+'%'};return _0x1e3c4f;})});}_0x222427=_['merge']({},_0x222427,_0x954872[_0xa955('0x41')]);return _0x8e1f23[_0xa955('0x9d')](_0x222427);}})[_0xa955('0x29')](function(_0x570ebc){if(_0x570ebc){_0x1d14ca=_0x570ebc['length'];if(!_0x954872['query']['hasOwnProperty']('nolimit')){_0x222427[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x954872[_0xa955('0x35')][_0xa955('0x22')]);_0x222427[_0xa955('0x20')]=qs[_0xa955('0x20')](_0x954872[_0xa955('0x35')][_0xa955('0x20')]);}return _0x8e1f23['getAgents'](_0x222427);}})[_0xa955('0x29')](function(_0x38259e){if(_0x38259e){return _0x38259e?{'count':_0x1d14ca,'rows':_0x38259e}:null;}})['then'](respondWithResult(_0xfb25f8,null))[_0xa955('0x45')](handleError(_0xfb25f8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 7b1243f..d860b82 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 _0xca2b=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xe315f6,_0x54dcf8){var _0xa23159=function(_0x7fe772){while(--_0x7fe772){_0xe315f6['push'](_0xe315f6['shift']());}};_0xa23159(++_0x54dcf8);}(_0xca2b,0xa6));var _0xbca2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xca2b[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0xbca2('0x0'));var Team=require(_0xbca2('0x1'))['db'][_0xbca2('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xbca2('0x3')](0x0);var events={'afterCreate':_0xbca2('0x4'),'afterUpdate':_0xbca2('0x5'),'afterDestroy':_0xbca2('0x6')};function emitEvent(_0x65a247){return function(_0x4161f5,_0x10d8cc,_0x232ee4){TeamEvents['emit'](_0x65a247+':'+_0x4161f5['id'],_0x4161f5);TeamEvents[_0xbca2('0x7')](_0x65a247,_0x4161f5);_0x232ee4(null);};}for(var e in events){if(events[_0xbca2('0x8')](e)){var event=events[e];Team[_0xbca2('0x9')](e,emitEvent(event));}}module[_0xbca2('0xa')]=TeamEvents; \ No newline at end of file +var _0xf51a=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team','save'];(function(_0x278f93,_0x5d74c6){var _0x47d224=function(_0x3acef8){while(--_0x3acef8){_0x278f93['push'](_0x278f93['shift']());}};_0x47d224(++_0x5d74c6);}(_0xf51a,0x144));var _0xaf51=function(_0x8efc11,_0x596729){_0x8efc11=_0x8efc11-0x0;var _0x28224b=_0xf51a[_0x8efc11];return _0x28224b;};'use strict';var EventEmitter=require(_0xaf51('0x0'));var Team=require(_0xaf51('0x1'))['db'][_0xaf51('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf51('0x3'),'afterUpdate':'update','afterDestroy':_0xaf51('0x4')};function emitEvent(_0x35238b){return function(_0x3e8e57,_0x29267b,_0x4d1a1c){TeamEvents[_0xaf51('0x5')](_0x35238b+':'+_0x3e8e57['id'],_0x3e8e57);TeamEvents['emit'](_0x35238b,_0x3e8e57);_0x4d1a1c(null);};}for(var e in events){if(events[_0xaf51('0x6')](e)){var event=events[e];Team[_0xaf51('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 37f6a45..9ee96de 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 _0xc9e5=['then','all','lodash','./team.attributes','Queues','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Openchannel','Sms','Voice','resolve'];(function(_0x2db660,_0x491baf){var _0x57f6b6=function(_0x2964fa){while(--_0x2964fa){_0x2db660['push'](_0x2db660['shift']());}};_0x57f6b6(++_0x491baf);}(_0xc9e5,0x74));var _0x5c9e=function(_0x3ce948,_0x5bd01e){_0x3ce948=_0x3ce948-0x0;var _0x696346=_0xc9e5[_0x3ce948];return _0x696346;};'use strict';var _=require(_0x5c9e('0x0'));var attributes=require(_0x5c9e('0x1'));function getQueuesByChannel(_0x4c567b,_0x2e7312){var _0x560b17='get'+_0x2e7312+_0x5c9e('0x2');return _0x4c567b[_0x560b17]()['then'](function(_0x3782ff){return _[_0x5c9e('0x3')](_0x3782ff,function(_0x370105){_0x370105[_0x5c9e('0x4')](_0x5c9e('0x5'),_0x2e7312);return _0x370105;});})[_0x5c9e('0x6')](function(_0x5823f9){throw _0x5823f9;});}module[_0x5c9e('0x7')]=function(_0x2c70ab){return _0x2c70ab[_0x5c9e('0x8')](_0x5c9e('0x9'),attributes,{'tableName':_0x5c9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x40bc79=this;var _0x545691=[_0x5c9e('0xb'),_0x5c9e('0xc'),'Mail',_0x5c9e('0xd'),_0x5c9e('0xe'),_0x5c9e('0xf'),'Whatsapp'];return Promise[_0x5c9e('0x10')]()[_0x5c9e('0x11')](function(){var _0x173bc7=_[_0x5c9e('0x3')](_0x545691,function(_0x3507a4){return getQueuesByChannel(_0x40bc79,_0x3507a4);});return Promise[_0x5c9e('0x12')](_0x173bc7);})[_0x5c9e('0x6')](function(_0x4de411){throw _0x4de411;});}}});}; \ No newline at end of file +var _0x721d=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','exports','define','Team','teams','Chat','Fax'];(function(_0x24b897,_0x38df26){var _0x522698=function(_0x1757a3){while(--_0x1757a3){_0x24b897['push'](_0x24b897['shift']());}};_0x522698(++_0x38df26);}(_0x721d,0xa9));var _0xd721=function(_0xeb67d8,_0x14a337){_0xeb67d8=_0xeb67d8-0x0;var _0x4138f9=_0x721d[_0xeb67d8];return _0x4138f9;};'use strict';var _=require(_0xd721('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1833a4,_0x450840){var _0x133244='get'+_0x450840+'Queues';return _0x1833a4[_0x133244]()[_0xd721('0x1')](function(_0x2bbaa9){return _[_0xd721('0x2')](_0x2bbaa9,function(_0x37d538){_0x37d538[_0xd721('0x3')](_0xd721('0x4'),_0x450840);return _0x37d538;});})['catch'](function(_0x49c991){throw _0x49c991;});}module[_0xd721('0x5')]=function(_0x38a578){return _0x38a578[_0xd721('0x6')](_0xd721('0x7'),attributes,{'tableName':_0xd721('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x520f54=this;var _0x325532=[_0xd721('0x9'),_0xd721('0xa'),_0xd721('0xb'),_0xd721('0xc'),_0xd721('0xd'),_0xd721('0xe'),_0xd721('0xf')];return Promise[_0xd721('0x10')]()['then'](function(){var _0x32dfbb=_[_0xd721('0x2')](_0x325532,function(_0x3a6c85){return getQueuesByChannel(_0x520f54,_0x3a6c85);});return Promise[_0xd721('0x11')](_0x32dfbb);})['catch'](function(_0x4465b3){throw _0x4465b3;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 041dd93..60c9787 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 _0x7827=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x256af2,_0x88f7be){var _0xe23860=function(_0x9634c){while(--_0x9634c){_0x256af2['push'](_0x256af2['shift']());}};_0xe23860(++_0x88f7be);}(_0x7827,0x164));var _0x7782=function(_0x22cb10,_0x20db4f){_0x22cb10=_0x22cb10-0x0;var _0x38a6f8=_0x7827[_0x22cb10];return _0x38a6f8;};'use strict';var _=require('lodash');var util=require(_0x7782('0x0'));var moment=require(_0x7782('0x1'));var BPromise=require(_0x7782('0x2'));var rs=require(_0x7782('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7782('0x4'))['db'];var utils=require(_0x7782('0x5'));var logger=require(_0x7782('0x6'))(_0x7782('0x7'));var config=require(_0x7782('0x8'));var jayson=require(_0x7782('0x9'));var client=jayson[_0x7782('0xa')]['http']({'port':0x232a});config[_0x7782('0xb')]=_[_0x7782('0xc')](config[_0x7782('0xb')],{'host':_0x7782('0xd'),'port':0x18eb});var socket=require(_0x7782('0xe'))(new Redis(config['redis']));require(_0x7782('0xf'))[_0x7782('0x10')](socket);function respondWithRpcPromise(_0x4e3626,_0x4b01eb,_0x566e34){return new BPromise(function(_0x52f18c,_0x43110){return client[_0x7782('0x11')](_0x4e3626,_0x566e34)[_0x7782('0x12')](function(_0x4ecdbc){logger[_0x7782('0x13')]('Team,\x20%s,\x20%s',_0x4b01eb,'request\x20sent');logger['debug'](_0x7782('0x14'),_0x4b01eb,'request\x20sent',JSON[_0x7782('0x15')](_0x4ecdbc));if(_0x4ecdbc['error']){if(_0x4ecdbc[_0x7782('0x16')][_0x7782('0x17')]===0x1f4){logger['error'](_0x7782('0x18'),_0x4b01eb,_0x4ecdbc[_0x7782('0x16')]['message']);return _0x43110(_0x4ecdbc[_0x7782('0x16')]['message']);}logger[_0x7782('0x16')](_0x7782('0x18'),_0x4b01eb,_0x4ecdbc[_0x7782('0x16')][_0x7782('0x19')]);return _0x52f18c(_0x4ecdbc[_0x7782('0x16')][_0x7782('0x19')]);}else{logger[_0x7782('0x13')](_0x7782('0x18'),_0x4b01eb,_0x7782('0x1a'));_0x52f18c(_0x4ecdbc['result'][_0x7782('0x19')]);}})[_0x7782('0x1b')](function(_0x59713f){logger[_0x7782('0x16')](_0x7782('0x18'),_0x4b01eb,_0x59713f);_0x43110(_0x59713f);});});} \ No newline at end of file +var _0x89d1=['stringify','error','code','Team,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./team.socket','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x89d1,0x17c));var _0x189d=function(_0x24db76,_0x1ae615){_0x24db76=_0x24db76-0x0;var _0x3e24fb=_0x89d1[_0x24db76];return _0x3e24fb;};'use strict';var _=require(_0x189d('0x0'));var util=require('util');var moment=require(_0x189d('0x1'));var BPromise=require(_0x189d('0x2'));var rs=require(_0x189d('0x3'));var fs=require('fs');var Redis=require(_0x189d('0x4'));var db=require(_0x189d('0x5'))['db'];var utils=require(_0x189d('0x6'));var logger=require('../../config/logger')(_0x189d('0x7'));var config=require(_0x189d('0x8'));var jayson=require(_0x189d('0x9'));var client=jayson['client'][_0x189d('0xa')]({'port':0x232a});config[_0x189d('0xb')]=_['defaults'](config[_0x189d('0xb')],{'host':_0x189d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x189d('0xd'))['register'](socket);function respondWithRpcPromise(_0x171fc1,_0x3fdc0f,_0x34da15){return new BPromise(function(_0x173092,_0x2bf3a0){return client[_0x189d('0xe')](_0x171fc1,_0x34da15)[_0x189d('0xf')](function(_0x48c5c3){logger[_0x189d('0x10')]('Team,\x20%s,\x20%s',_0x3fdc0f,'request\x20sent');logger[_0x189d('0x11')](_0x189d('0x12'),_0x3fdc0f,_0x189d('0x13'),JSON[_0x189d('0x14')](_0x48c5c3));if(_0x48c5c3['error']){if(_0x48c5c3[_0x189d('0x15')][_0x189d('0x16')]===0x1f4){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3[_0x189d('0x15')]['message']);return _0x2bf3a0(_0x48c5c3[_0x189d('0x15')][_0x189d('0x18')]);}logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3['error'][_0x189d('0x18')]);return _0x173092(_0x48c5c3['error'][_0x189d('0x18')]);}else{logger[_0x189d('0x10')](_0x189d('0x17'),_0x3fdc0f,_0x189d('0x13'));_0x173092(_0x48c5c3['result']['message']);}})['catch'](function(_0x37684c){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x37684c);_0x2bf3a0(_0x37684c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index d8047a6..ba5e4e0 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 _0x87ef=['remove','update','emit','removeListener','register','length','team:','./team.events'];(function(_0x11b9b2,_0x29feed){var _0x30674e=function(_0x710ff3){while(--_0x710ff3){_0x11b9b2['push'](_0x11b9b2['shift']());}};_0x30674e(++_0x29feed);}(_0x87ef,0x13f));var _0xf87e=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0x87ef[_0x19f8ee];return _0x3b68f2;};'use strict';var TeamEvents=require(_0xf87e('0x0'));var events=['save',_0xf87e('0x1'),_0xf87e('0x2')];function createListener(_0x26ab17,_0x447549){return function(_0x59878a){_0x447549[_0xf87e('0x3')](_0x26ab17,_0x59878a);};}function removeListener(_0xef0a07,_0x3dd3b8){return function(){TeamEvents[_0xf87e('0x4')](_0xef0a07,_0x3dd3b8);};}exports[_0xf87e('0x5')]=function(_0x5883d2){for(var _0x36b9ca=0x0,_0x1f5c60=events[_0xf87e('0x6')];_0x36b9ca<_0x1f5c60;_0x36b9ca++){var _0x3187ba=events[_0x36b9ca];var _0x10f39b=createListener(_0xf87e('0x7')+_0x3187ba,_0x5883d2);TeamEvents['on'](_0x3187ba,_0x10f39b);}}; \ No newline at end of file +var _0x11b7=['length','team:','./team.events','save','remove','update','emit','register'];(function(_0x4baa4e,_0x25f8eb){var _0x18de81=function(_0x5803fa){while(--_0x5803fa){_0x4baa4e['push'](_0x4baa4e['shift']());}};_0x18de81(++_0x25f8eb);}(_0x11b7,0x132));var _0x711b=function(_0x35b205,_0x24e696){_0x35b205=_0x35b205-0x0;var _0x20ecb2=_0x11b7[_0x35b205];return _0x20ecb2;};'use strict';var TeamEvents=require(_0x711b('0x0'));var events=[_0x711b('0x1'),_0x711b('0x2'),_0x711b('0x3')];function createListener(_0x3010c0,_0x15c524){return function(_0x4a9361){_0x15c524[_0x711b('0x4')](_0x3010c0,_0x4a9361);};}function removeListener(_0x10dc82,_0x443671){return function(){TeamEvents['removeListener'](_0x10dc82,_0x443671);};}exports[_0x711b('0x5')]=function(_0x644cb1){for(var _0x2d5a6a=0x0,_0x9ac64b=events[_0x711b('0x6')];_0x2d5a6a<_0x9ac64b;_0x2d5a6a++){var _0x33143d=events[_0x2d5a6a];var _0x193a4a=createListener(_0x711b('0x7')+_0x33143d,_0x644cb1);TeamEvents['on'](_0x33143d,_0x193a4a);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1e7bd18..28d8251 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['exports','INTEGER','sequelize'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xe14d,0x1ee));var _0xde14=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xe14d[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'TeamId':{'type':Sequelize[_0xde14('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file +var _0xc1fa=['INTEGER'];(function(_0x46f757,_0xd70bcb){var _0x2bd0af=function(_0x4a59cd){while(--_0x4a59cd){_0x46f757['push'](_0x46f757['shift']());}};_0x2bd0af(++_0xd70bcb);}(_0xc1fa,0xe5));var _0xac1f=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xc1fa[_0x5be7aa];return _0x215408;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0xac1f('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xac1f('0x0')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index c6db938..ae227f1 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6584=['util','../../config/logger','api','bluebird','request-promise','path','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6584,0x175));var _0x4658=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x6584[_0x56740a];return _0x257144;};'use strict';var _=require(_0x4658('0x0'));var util=require(_0x4658('0x1'));var logger=require(_0x4658('0x2'))(_0x4658('0x3'));var moment=require('moment');var BPromise=require(_0x4658('0x4'));var rp=require(_0x4658('0x5'));var fs=require('fs');var path=require(_0x4658('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4658('0x7'));module[_0x4658('0x8')]=function(_0x253182,_0x63273f){return _0x253182[_0x4658('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x4658('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b1a=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x20f5d8,_0x5cdf61){var _0x4105b0=function(_0x3c17e6){while(--_0x3c17e6){_0x20f5d8['push'](_0x20f5d8['shift']());}};_0x4105b0(++_0x5cdf61);}(_0x8b1a,0x152));var _0xa8b1=function(_0x27e7e5,_0x5c3a2b){_0x27e7e5=_0x27e7e5-0x0;var _0x1e1f2a=_0x8b1a[_0x27e7e5];return _0x1e1f2a;};'use strict';var _=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var logger=require(_0xa8b1('0x2'))('api');var moment=require(_0xa8b1('0x3'));var BPromise=require(_0xa8b1('0x4'));var rp=require(_0xa8b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8b1('0x6'));var config=require(_0xa8b1('0x7'));var attributes=require(_0xa8b1('0x8'));module[_0xa8b1('0x9')]=function(_0x493b8e,_0x90c588){return _0x493b8e['define'](_0xa8b1('0xa'),attributes,{'tableName':_0xa8b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5caa63c..dbc9d4f 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x57f95a,_0xb3598b){var _0x1eab3c=function(_0x33d204){while(--_0x33d204){_0x57f95a['push'](_0x57f95a['shift']());}};_0x1eab3c(++_0xb3598b);}(_0xe706,0xa3));var _0x6e70=function(_0x52dbcb,_0x344f7e){_0x52dbcb=_0x52dbcb-0x0;var _0x10bfe4=_0xe706[_0x52dbcb];return _0x10bfe4;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x220882,_0x42619b){var _0xbcf788=function(_0x28197c){while(--_0x28197c){_0x220882['push'](_0x220882['shift']());}};_0xbcf788(++_0x42619b);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 467dc2f..1b848f2 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffaa=['exports'];(function(_0x445c59,_0x1e78c0){var _0x10a609=function(_0x424834){while(--_0x424834){_0x445c59['push'](_0x445c59['shift']());}};_0x10a609(++_0x1e78c0);}(_0xffaa,0x129));var _0xaffa=function(_0x145c57,_0x5bce3a){_0x145c57=_0x145c57-0x0;var _0x4933a1=_0xffaa[_0x145c57];return _0x4933a1;};'use strict';var Sequelize=require('sequelize');module[_0xaffa('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf15d=['exports','sequelize'];(function(_0x4a4def,_0x5eef27){var _0x5d8ae0=function(_0x4abc76){while(--_0x4abc76){_0x4a4def['push'](_0x4a4def['shift']());}};_0x5d8ae0(++_0x5eef27);}(_0xf15d,0x1a9));var _0xdf15=function(_0x221351,_0x322f34){_0x221351=_0x221351-0x0;var _0x399d50=_0xf15d[_0x221351];return _0x399d50;};'use strict';var Sequelize=require(_0xdf15('0x0'));module[_0xdf15('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 03e2553..83cd8c3 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe107=['define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0xe107,0xb3));var _0x7e10=function(_0xb61896,_0x55036b){_0xb61896=_0xb61896-0x0;var _0x171b63=_0xe107[_0xb61896];return _0x171b63;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var logger=require(_0x7e10('0x1'))(_0x7e10('0x2'));var moment=require(_0x7e10('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e10('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e10('0x5'));var attributes=require(_0x7e10('0x6'));module[_0x7e10('0x7')]=function(_0x5be19f,_0x5f1edf){return _0x5be19f[_0x7e10('0x8')](_0x7e10('0x9'),attributes,{'tableName':_0x7e10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe22=['../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x161f85,_0x1b1968){var _0x3f98ad=function(_0x44b3d5){while(--_0x44b3d5){_0x161f85['push'](_0x161f85['shift']());}};_0x3f98ad(++_0x1b1968);}(_0xbe22,0x1c1));var _0x2be2=function(_0x5181ae,_0x2e2953){_0x5181ae=_0x5181ae-0x0;var _0x605bf4=_0xbe22[_0x5181ae];return _0x605bf4;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index ff8fe19..0a68a20 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb53=['http','then','info','request\x20sent','stringify','error','message','TeamVoiceQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xbb53,0x121));var _0x3bb5=function(_0x329ae3,_0x4af2b7){_0x329ae3=_0x329ae3-0x0;var _0x596eee=_0xbb53[_0x329ae3];return _0x596eee;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});} \ No newline at end of file +var _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x4eb060,_0x479749){var _0x5548d4=function(_0x2d2d6b){while(--_0x2d2d6b){_0x4eb060['push'](_0x4eb060['shift']());}};_0x5548d4(++_0x479749);}(_0x8ce3,0xc3));var _0x38ce=function(_0x548003,_0x19cd0e){_0x548003=_0x548003-0x0;var _0x459a44=_0x8ce3[_0x548003];return _0x459a44;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a03b3fe..c733256 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 _0x5458=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x40d83,_0x1d2c94){var _0x38c64c=function(_0x2ce9c1){while(--_0x2ce9c1){_0x40d83['push'](_0x40d83['shift']());}};_0x38c64c(++_0x1d2c94);}(_0x5458,0x1c7));var _0x8545=function(_0x58528c,_0x132caf){_0x58528c=_0x58528c-0x0;var _0x350d0e=_0x5458[_0x58528c];return _0x350d0e;};'use strict';var multer=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var path=require(_0x8545('0x2'));var timeout=require('connect-timeout');var express=require(_0x8545('0x3'));var router=express[_0x8545('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8545('0x5'));var interaction=require(_0x8545('0x6'));var config=require(_0x8545('0x7'));var controller=require('./template.controller');router[_0x8545('0x8')]('/',auth[_0x8545('0x9')](),controller[_0x8545('0xa')]);router[_0x8545('0x8')]('/:id',auth[_0x8545('0x9')](),controller['show']);router[_0x8545('0xb')]('/',auth[_0x8545('0x9')](),controller[_0x8545('0xc')]);router[_0x8545('0xd')](_0x8545('0xe'),auth[_0x8545('0x9')](),controller[_0x8545('0xf')]);router[_0x8545('0x10')]('/:id',auth[_0x8545('0x9')](),controller[_0x8545('0x11')]);module[_0x8545('0x12')]=router; \ No newline at end of file +var _0x5324=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer','util'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5324,0x154));var _0x4532=function(_0x3279b2,_0x233887){_0x3279b2=_0x3279b2-0x0;var _0x3b8a6a=_0x5324[_0x3279b2];return _0x3b8a6a;};'use strict';var multer=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var path=require(_0x4532('0x2'));var timeout=require(_0x4532('0x3'));var express=require('express');var router=express[_0x4532('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4532('0x5'));var interaction=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var controller=require(_0x4532('0x8'));router[_0x4532('0x9')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xb')]);router[_0x4532('0x9')]('/:id',auth[_0x4532('0xa')](),controller[_0x4532('0xc')]);router[_0x4532('0xd')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xe')]);router[_0x4532('0xf')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller[_0x4532('0x11')]);router[_0x4532('0x12')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 2f740c3..f3ce8ee 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 _0xe117=['STRING','TEXT','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe117,0x12e));var _0x7e11=function(_0x2a9adc,_0x325136){_0x2a9adc=_0x2a9adc-0x0;var _0x3b51a7=_0xe117[_0x2a9adc];return _0x3b51a7;};'use strict';var Sequelize=require(_0x7e11('0x0'));module[_0x7e11('0x1')]={'name':{'type':Sequelize[_0x7e11('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x7e11('0x3')]}}; \ No newline at end of file +var _0xe135=['TEXT','sequelize','exports'];(function(_0x34a554,_0x20a5b4){var _0x3fbf8a=function(_0x1371e9){while(--_0x1371e9){_0x34a554['push'](_0x34a554['shift']());}};_0x3fbf8a(++_0x20a5b4);}(_0xe135,0xf7));var _0x5e13=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0xe135[_0x256684];return _0x37a0c9;};'use strict';var Sequelize=require(_0x5e13('0x0'));module[_0x5e13('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5e13('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 80bf28b..8718e40 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 _0x27e2=['error','name','index','Template','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','keys','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','Templates','UserProfileResource'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27e2,0xce));var _0x227e=function(_0x58fe46,_0x4dc69a){_0x58fe46=_0x58fe46-0x0;var _0x5b36c2=_0x27e2[_0x58fe46];return _0x5b36c2;};'use strict';var emlformat=require(_0x227e('0x0'));var rimraf=require(_0x227e('0x1'));var zipdir=require(_0x227e('0x2'));var jsonpatch=require(_0x227e('0x3'));var rp=require(_0x227e('0x4'));var moment=require(_0x227e('0x5'));var BPromise=require(_0x227e('0x6'));var Mustache=require(_0x227e('0x7'));var util=require(_0x227e('0x8'));var path=require('path');var sox=require(_0x227e('0x9'));var csv=require('to-csv');var ejs=require(_0x227e('0xa'));var fs=require('fs');var fs_extra=require(_0x227e('0xb'));var _=require('lodash');var squel=require(_0x227e('0xc'));var crypto=require(_0x227e('0xd'));var jsforce=require(_0x227e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x227e('0xf'));var Redis=require(_0x227e('0x10'));var authService=require(_0x227e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x227e('0x12'));var hardwareService=require(_0x227e('0x13'));var logger=require(_0x227e('0x14'))(_0x227e('0x15'));var utils=require(_0x227e('0x16'));var config=require(_0x227e('0x17'));var licenseUtil=require(_0x227e('0x18'));var db=require(_0x227e('0x19'))['db'];function respondWithStatusCode(_0x481508,_0x1278c7){_0x1278c7=_0x1278c7||0xcc;return function(_0x27b0aa){if(_0x27b0aa){return _0x481508[_0x227e('0x1a')](_0x1278c7);}return _0x481508[_0x227e('0x1b')](_0x1278c7)[_0x227e('0x1c')]();};}function respondWithResult(_0x3cbbc1,_0x332b83){_0x332b83=_0x332b83||0xc8;return function(_0x27f00e){if(_0x27f00e){return _0x3cbbc1[_0x227e('0x1b')](_0x332b83)[_0x227e('0x1d')](_0x27f00e);}};}function respondWithFilteredResult(_0x324ca0,_0x3ee43c){return function(_0x7ecd54){if(_0x7ecd54){var _0x3077f3=typeof _0x3ee43c[_0x227e('0x1e')]==='undefined'&&typeof _0x3ee43c[_0x227e('0x1f')]===_0x227e('0x20');var _0x11634b=_0x7ecd54[_0x227e('0x21')];var _0x312bd8=_0x3077f3?0x0:_0x3ee43c['offset'];var _0x259f17=_0x3077f3?_0x7ecd54['count']:_0x3ee43c[_0x227e('0x1e')]+_0x3ee43c[_0x227e('0x1f')];var _0x2c72b1;if(_0x259f17>=_0x11634b){_0x259f17=_0x11634b;_0x2c72b1=0xc8;}else{_0x2c72b1=0xce;}_0x324ca0['status'](_0x2c72b1);return _0x324ca0[_0x227e('0x22')](_0x227e('0x23'),_0x312bd8+'-'+_0x259f17+'/'+_0x11634b)[_0x227e('0x1d')](_0x7ecd54);}return null;};}function patchUpdates(_0x2383f8){return function(_0x4b0b37){try{jsonpatch['apply'](_0x4b0b37,_0x2383f8,!![]);}catch(_0x5a19f5){return BPromise[_0x227e('0x24')](_0x5a19f5);}return _0x4b0b37[_0x227e('0x25')]();};}function saveUpdates(_0x8dafe,_0x2af75a){return function(_0x71e2ab){if(_0x71e2ab){return _0x71e2ab[_0x227e('0x26')](_0x8dafe)[_0x227e('0x27')](function(_0x29c2b1){return _0x29c2b1;});}return null;};}function removeEntity(_0x4d5481,_0x5f1419){return function(_0x205aee){if(_0x205aee){return _0x205aee[_0x227e('0x28')]()['then'](function(){var _0x2b1931=_0x205aee['get']({'plain':!![]});var _0x476e54=_0x227e('0x29');return db[_0x227e('0x2a')][_0x227e('0x28')]({'where':{'type':_0x476e54,'resourceId':_0x2b1931['id']}})[_0x227e('0x27')](function(){return _0x205aee;});})[_0x227e('0x27')](function(){_0x4d5481[_0x227e('0x1b')](0xcc)[_0x227e('0x1c')]();});}};}function handleEntityNotFound(_0x17733d,_0x2fcc3e){return function(_0x2ea6e5){if(!_0x2ea6e5){_0x17733d['sendStatus'](0x194);}return _0x2ea6e5;};}function handleError(_0x9c7cbc,_0x27272f){_0x27272f=_0x27272f||0x1f4;return function(_0x4a91be){logger[_0x227e('0x2b')](_0x4a91be['stack']);if(_0x4a91be[_0x227e('0x2c')]){delete _0x4a91be[_0x227e('0x2c')];}_0x9c7cbc[_0x227e('0x1b')](_0x27272f)['send'](_0x4a91be);};}exports[_0x227e('0x2d')]=function(_0x28a511,_0x4a945b){var _0x403e05={},_0x47e9ab={},_0x5f0a67={'count':0x0,'rows':[]};var _0x562cd1=_['map'](db[_0x227e('0x2e')][_0x227e('0x2f')],function(_0x5b9a9f){return{'name':_0x5b9a9f[_0x227e('0x30')],'type':_0x5b9a9f[_0x227e('0x31')][_0x227e('0x32')]};});_0x47e9ab[_0x227e('0x33')]=_[_0x227e('0x34')](_0x562cd1,_0x227e('0x2c'));_0x47e9ab['query']=_['keys'](_0x28a511['query']);_0x47e9ab[_0x227e('0x35')]=_[_0x227e('0x36')](_0x47e9ab['model'],_0x47e9ab[_0x227e('0x37')]);_0x403e05['attributes']=_[_0x227e('0x36')](_0x47e9ab['model'],qs[_0x227e('0x38')](_0x28a511['query'][_0x227e('0x38')]));_0x403e05[_0x227e('0x39')]=_0x403e05[_0x227e('0x39')][_0x227e('0x3a')]?_0x403e05['attributes']:_0x47e9ab[_0x227e('0x33')];if(!_0x28a511[_0x227e('0x37')]['hasOwnProperty'](_0x227e('0x3b'))){_0x403e05[_0x227e('0x1f')]=qs[_0x227e('0x1f')](_0x28a511['query']['limit']);_0x403e05[_0x227e('0x1e')]=qs[_0x227e('0x1e')](_0x28a511[_0x227e('0x37')][_0x227e('0x1e')]);}_0x403e05['order']=qs[_0x227e('0x3c')](_0x28a511['query'][_0x227e('0x3c')]);_0x403e05['where']=qs['filters'](_[_0x227e('0x3d')](_0x28a511[_0x227e('0x37')],_0x47e9ab['filters']),_0x562cd1);if(_0x28a511[_0x227e('0x37')][_0x227e('0x3e')]){_0x403e05['where']=_[_0x227e('0x3f')](_0x403e05[_0x227e('0x40')],{'$or':_['map'](_0x562cd1,function(_0xb88bba){if(_0xb88bba[_0x227e('0x31')]!==_0x227e('0x41')){var _0x1d5a59={};_0x1d5a59[_0xb88bba[_0x227e('0x2c')]]={'$like':'%'+_0x28a511[_0x227e('0x37')][_0x227e('0x3e')]+'%'};return _0x1d5a59;}})});}_0x403e05=_[_0x227e('0x3f')]({},_0x403e05,_0x28a511['options']);var _0x4ccab5={'where':_0x403e05[_0x227e('0x40')]};return db[_0x227e('0x2e')][_0x227e('0x21')](_0x4ccab5)[_0x227e('0x27')](function(_0x4c5f87){_0x5f0a67[_0x227e('0x21')]=_0x4c5f87;if(_0x28a511[_0x227e('0x37')]['includeAll']){_0x403e05[_0x227e('0x42')]=[{'all':!![]}];}return db['Template'][_0x227e('0x43')](_0x403e05);})['then'](function(_0x2d018b){_0x5f0a67[_0x227e('0x44')]=_0x2d018b;return _0x5f0a67;})['then'](respondWithFilteredResult(_0x4a945b,_0x403e05))[_0x227e('0x45')](handleError(_0x4a945b,null));};exports['show']=function(_0x5c6614,_0x4f392d){var _0x6e9537={'raw':!![],'where':{'id':_0x5c6614['params']['id']}},_0x4bed10={};_0x4bed10[_0x227e('0x33')]=_[_0x227e('0x46')](db[_0x227e('0x2e')][_0x227e('0x2f')]);_0x4bed10[_0x227e('0x37')]=_['keys'](_0x5c6614['query']);_0x4bed10[_0x227e('0x35')]=_['intersection'](_0x4bed10[_0x227e('0x33')],_0x4bed10[_0x227e('0x37')]);_0x6e9537[_0x227e('0x39')]=_[_0x227e('0x36')](_0x4bed10[_0x227e('0x33')],qs[_0x227e('0x38')](_0x5c6614['query'][_0x227e('0x38')]));_0x6e9537['attributes']=_0x6e9537['attributes'][_0x227e('0x3a')]?_0x6e9537['attributes']:_0x4bed10[_0x227e('0x33')];if(_0x5c6614['query'][_0x227e('0x47')]){_0x6e9537[_0x227e('0x42')]=[{'all':!![]}];}_0x6e9537=_[_0x227e('0x3f')]({},_0x6e9537,_0x5c6614[_0x227e('0x48')]);return db[_0x227e('0x2e')][_0x227e('0x49')](_0x6e9537)[_0x227e('0x27')](handleEntityNotFound(_0x4f392d,null))[_0x227e('0x27')](respondWithResult(_0x4f392d,null))['catch'](handleError(_0x4f392d,null));};exports[_0x227e('0x4a')]=function(_0x25fcb0,_0x42a898){return db[_0x227e('0x2e')][_0x227e('0x4a')](_0x25fcb0[_0x227e('0x4b')],{})[_0x227e('0x27')](function(_0x464f8d){var _0x1b1000=_0x25fcb0[_0x227e('0x4c')][_0x227e('0x4d')]({'plain':!![]});if(!_0x1b1000)throw new Error(_0x227e('0x4e'));if(_0x1b1000[_0x227e('0x4f')]===_0x227e('0x4c')){var _0x6b9dbd=_0x464f8d[_0x227e('0x4d')]({'plain':!![]});var _0x2e26b7='Templates';return db[_0x227e('0x50')][_0x227e('0x49')]({'where':{'name':_0x2e26b7,'userProfileId':_0x1b1000[_0x227e('0x51')]},'raw':!![]})[_0x227e('0x27')](function(_0x2c17f2){if(_0x2c17f2&&_0x2c17f2['autoAssociation']===0x0){return db[_0x227e('0x2a')][_0x227e('0x4a')]({'name':_0x6b9dbd[_0x227e('0x2c')],'resourceId':_0x6b9dbd['id'],'type':_0x2c17f2[_0x227e('0x2c')],'sectionId':_0x2c17f2['id']},{})[_0x227e('0x27')](function(){return _0x464f8d;});}else{return _0x464f8d;}})[_0x227e('0x45')](function(_0x565581){logger[_0x227e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x565581);throw _0x565581;});}return _0x464f8d;})[_0x227e('0x27')](respondWithResult(_0x42a898,0xc9))[_0x227e('0x45')](handleError(_0x42a898,null));};exports[_0x227e('0x26')]=function(_0x5066ef,_0x1dd65){if(_0x5066ef['body']['id']){delete _0x5066ef['body']['id'];}return db[_0x227e('0x2e')]['find']({'where':{'id':_0x5066ef['params']['id']}})['then'](handleEntityNotFound(_0x1dd65,null))[_0x227e('0x27')](saveUpdates(_0x5066ef['body'],null))[_0x227e('0x27')](respondWithResult(_0x1dd65,null))[_0x227e('0x45')](handleError(_0x1dd65,null));};exports[_0x227e('0x28')]=function(_0x303d51,_0x8a971){return db[_0x227e('0x2e')]['find']({'where':{'id':_0x303d51[_0x227e('0x52')]['id']}})['then'](handleEntityNotFound(_0x8a971,null))[_0x227e('0x27')](removeEntity(_0x8a971,null))['catch'](handleError(_0x8a971,null));}; \ No newline at end of file +var _0xe255=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','Template','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xe255,0xf2));var _0x5e25=function(_0x52c543,_0x301716){_0x52c543=_0x52c543-0x0;var _0xc93a8e=_0xe255[_0x52c543];return _0xc93a8e;};'use strict';var emlformat=require(_0x5e25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e25('0x1'));var jsonpatch=require(_0x5e25('0x2'));var rp=require(_0x5e25('0x3'));var moment=require(_0x5e25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5e25('0x5'));var util=require(_0x5e25('0x6'));var path=require(_0x5e25('0x7'));var sox=require('sox');var csv=require(_0x5e25('0x8'));var ejs=require(_0x5e25('0x9'));var fs=require('fs');var fs_extra=require(_0x5e25('0xa'));var _=require(_0x5e25('0xb'));var squel=require(_0x5e25('0xc'));var crypto=require(_0x5e25('0xd'));var jsforce=require(_0x5e25('0xe'));var deskjs=require(_0x5e25('0xf'));var toCsv=require(_0x5e25('0x8'));var querystring=require(_0x5e25('0x10'));var Papa=require(_0x5e25('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e25('0x12'));var as=require(_0x5e25('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e25('0x14'))(_0x5e25('0x15'));var utils=require(_0x5e25('0x16'));var config=require(_0x5e25('0x17'));var licenseUtil=require(_0x5e25('0x18'));var db=require(_0x5e25('0x19'))['db'];function respondWithStatusCode(_0x5b7618,_0x5c490d){_0x5c490d=_0x5c490d||0xcc;return function(_0x275ea4){if(_0x275ea4){return _0x5b7618[_0x5e25('0x1a')](_0x5c490d);}return _0x5b7618[_0x5e25('0x1b')](_0x5c490d)[_0x5e25('0x1c')]();};}function respondWithResult(_0x3badca,_0xbcbcf4){_0xbcbcf4=_0xbcbcf4||0xc8;return function(_0x49c0af){if(_0x49c0af){return _0x3badca[_0x5e25('0x1b')](_0xbcbcf4)[_0x5e25('0x1d')](_0x49c0af);}};}function respondWithFilteredResult(_0x192a44,_0xac8d48){return function(_0x97f8c4){if(_0x97f8c4){var _0x40f44f=typeof _0xac8d48[_0x5e25('0x1e')]===_0x5e25('0x1f')&&typeof _0xac8d48[_0x5e25('0x20')]===_0x5e25('0x1f');var _0x2e263a=_0x97f8c4[_0x5e25('0x21')];var _0x4a84d9=_0x40f44f?0x0:_0xac8d48[_0x5e25('0x1e')];var _0x39f4f7=_0x40f44f?_0x97f8c4['count']:_0xac8d48['offset']+_0xac8d48['limit'];var _0x2065b5;if(_0x39f4f7>=_0x2e263a){_0x39f4f7=_0x2e263a;_0x2065b5=0xc8;}else{_0x2065b5=0xce;}_0x192a44[_0x5e25('0x1b')](_0x2065b5);return _0x192a44[_0x5e25('0x22')]('Content-Range',_0x4a84d9+'-'+_0x39f4f7+'/'+_0x2e263a)[_0x5e25('0x1d')](_0x97f8c4);}return null;};}function patchUpdates(_0x1be4b8){return function(_0x3a57c8){try{jsonpatch[_0x5e25('0x23')](_0x3a57c8,_0x1be4b8,!![]);}catch(_0x5ac7e1){return BPromise['reject'](_0x5ac7e1);}return _0x3a57c8[_0x5e25('0x24')]();};}function saveUpdates(_0x5d163c,_0x366030){return function(_0x29d6a0){if(_0x29d6a0){return _0x29d6a0[_0x5e25('0x25')](_0x5d163c)[_0x5e25('0x26')](function(_0x457898){return _0x457898;});}return null;};}function removeEntity(_0x38a41c,_0x2dbfe9){return function(_0x4304cd){if(_0x4304cd){return _0x4304cd[_0x5e25('0x27')]()[_0x5e25('0x26')](function(){var _0x16d0db=_0x4304cd[_0x5e25('0x28')]({'plain':!![]});var _0x282e73=_0x5e25('0x29');return db[_0x5e25('0x2a')][_0x5e25('0x27')]({'where':{'type':_0x282e73,'resourceId':_0x16d0db['id']}})[_0x5e25('0x26')](function(){return _0x4304cd;});})[_0x5e25('0x26')](function(){_0x38a41c[_0x5e25('0x1b')](0xcc)[_0x5e25('0x1c')]();});}};}function handleEntityNotFound(_0x468754,_0x7eeaa2){return function(_0x454bba){if(!_0x454bba){_0x468754[_0x5e25('0x1a')](0x194);}return _0x454bba;};}function handleError(_0xb1199c,_0x4ed584){_0x4ed584=_0x4ed584||0x1f4;return function(_0x368dcd){logger[_0x5e25('0x2b')](_0x368dcd[_0x5e25('0x2c')]);if(_0x368dcd[_0x5e25('0x2d')]){delete _0x368dcd[_0x5e25('0x2d')];}_0xb1199c[_0x5e25('0x1b')](_0x4ed584)[_0x5e25('0x2e')](_0x368dcd);};}exports[_0x5e25('0x2f')]=function(_0x890a7a,_0x103d4a){var _0x40fd57={},_0x12e367={},_0x43b63a={'count':0x0,'rows':[]};var _0x21dd57=_['map'](db['Template'][_0x5e25('0x30')],function(_0x15ed6c){return{'name':_0x15ed6c[_0x5e25('0x31')],'type':_0x15ed6c['type']['key']};});_0x12e367[_0x5e25('0x32')]=_[_0x5e25('0x33')](_0x21dd57,_0x5e25('0x2d'));_0x12e367[_0x5e25('0x34')]=_['keys'](_0x890a7a['query']);_0x12e367[_0x5e25('0x35')]=_[_0x5e25('0x36')](_0x12e367[_0x5e25('0x32')],_0x12e367[_0x5e25('0x34')]);_0x40fd57[_0x5e25('0x37')]=_[_0x5e25('0x36')](_0x12e367[_0x5e25('0x32')],qs['fields'](_0x890a7a[_0x5e25('0x34')][_0x5e25('0x38')]));_0x40fd57['attributes']=_0x40fd57[_0x5e25('0x37')][_0x5e25('0x39')]?_0x40fd57['attributes']:_0x12e367[_0x5e25('0x32')];if(!_0x890a7a[_0x5e25('0x34')][_0x5e25('0x3a')](_0x5e25('0x3b'))){_0x40fd57[_0x5e25('0x20')]=qs[_0x5e25('0x20')](_0x890a7a[_0x5e25('0x34')][_0x5e25('0x20')]);_0x40fd57['offset']=qs[_0x5e25('0x1e')](_0x890a7a['query'][_0x5e25('0x1e')]);}_0x40fd57[_0x5e25('0x3c')]=qs[_0x5e25('0x3d')](_0x890a7a[_0x5e25('0x34')]['sort']);_0x40fd57[_0x5e25('0x3e')]=qs[_0x5e25('0x35')](_['pick'](_0x890a7a[_0x5e25('0x34')],_0x12e367[_0x5e25('0x35')]),_0x21dd57);if(_0x890a7a['query'][_0x5e25('0x3f')]){_0x40fd57[_0x5e25('0x3e')]=_['merge'](_0x40fd57['where'],{'$or':_['map'](_0x21dd57,function(_0x10dd76){if(_0x10dd76[_0x5e25('0x40')]!==_0x5e25('0x41')){var _0x2678b1={};_0x2678b1[_0x10dd76[_0x5e25('0x2d')]]={'$like':'%'+_0x890a7a['query']['filter']+'%'};return _0x2678b1;}})});}_0x40fd57=_[_0x5e25('0x42')]({},_0x40fd57,_0x890a7a[_0x5e25('0x43')]);var _0x3ea0ef={'where':_0x40fd57[_0x5e25('0x3e')]};return db[_0x5e25('0x44')][_0x5e25('0x21')](_0x3ea0ef)[_0x5e25('0x26')](function(_0x4fa1f3){_0x43b63a[_0x5e25('0x21')]=_0x4fa1f3;if(_0x890a7a[_0x5e25('0x34')][_0x5e25('0x45')]){_0x40fd57['include']=[{'all':!![]}];}return db[_0x5e25('0x44')][_0x5e25('0x46')](_0x40fd57);})[_0x5e25('0x26')](function(_0x4013a5){_0x43b63a[_0x5e25('0x47')]=_0x4013a5;return _0x43b63a;})[_0x5e25('0x26')](respondWithFilteredResult(_0x103d4a,_0x40fd57))[_0x5e25('0x48')](handleError(_0x103d4a,null));};exports[_0x5e25('0x49')]=function(_0x545ab9,_0x574cfc){var _0xf7e90c={'raw':!![],'where':{'id':_0x545ab9[_0x5e25('0x4a')]['id']}},_0x1cbe8f={};_0x1cbe8f['model']=_[_0x5e25('0x4b')](db[_0x5e25('0x44')]['rawAttributes']);_0x1cbe8f[_0x5e25('0x34')]=_[_0x5e25('0x4b')](_0x545ab9[_0x5e25('0x34')]);_0x1cbe8f[_0x5e25('0x35')]=_[_0x5e25('0x36')](_0x1cbe8f['model'],_0x1cbe8f[_0x5e25('0x34')]);_0xf7e90c['attributes']=_[_0x5e25('0x36')](_0x1cbe8f[_0x5e25('0x32')],qs['fields'](_0x545ab9[_0x5e25('0x34')]['fields']));_0xf7e90c[_0x5e25('0x37')]=_0xf7e90c[_0x5e25('0x37')]['length']?_0xf7e90c[_0x5e25('0x37')]:_0x1cbe8f[_0x5e25('0x32')];if(_0x545ab9['query'][_0x5e25('0x45')]){_0xf7e90c[_0x5e25('0x4c')]=[{'all':!![]}];}_0xf7e90c=_[_0x5e25('0x42')]({},_0xf7e90c,_0x545ab9['options']);return db['Template']['find'](_0xf7e90c)[_0x5e25('0x26')](handleEntityNotFound(_0x574cfc,null))[_0x5e25('0x26')](respondWithResult(_0x574cfc,null))[_0x5e25('0x48')](handleError(_0x574cfc,null));};exports[_0x5e25('0x4d')]=function(_0x4d259b,_0x543414){return db[_0x5e25('0x44')][_0x5e25('0x4d')](_0x4d259b[_0x5e25('0x4e')],{})[_0x5e25('0x26')](function(_0x94d884){var _0x57577d=_0x4d259b[_0x5e25('0x4f')][_0x5e25('0x28')]({'plain':!![]});if(!_0x57577d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57577d[_0x5e25('0x50')]===_0x5e25('0x4f')){var _0x2babc9=_0x94d884[_0x5e25('0x28')]({'plain':!![]});var _0x2a9246=_0x5e25('0x29');return db[_0x5e25('0x51')]['find']({'where':{'name':_0x2a9246,'userProfileId':_0x57577d[_0x5e25('0x52')]},'raw':!![]})[_0x5e25('0x26')](function(_0x20119d){if(_0x20119d&&_0x20119d[_0x5e25('0x53')]===0x0){return db[_0x5e25('0x2a')][_0x5e25('0x4d')]({'name':_0x2babc9[_0x5e25('0x2d')],'resourceId':_0x2babc9['id'],'type':_0x20119d[_0x5e25('0x2d')],'sectionId':_0x20119d['id']},{})[_0x5e25('0x26')](function(){return _0x94d884;});}else{return _0x94d884;}})[_0x5e25('0x48')](function(_0x2e2a13){logger['error'](_0x5e25('0x54'),_0x2e2a13);throw _0x2e2a13;});}return _0x94d884;})['then'](respondWithResult(_0x543414,0xc9))[_0x5e25('0x48')](handleError(_0x543414,null));};exports[_0x5e25('0x25')]=function(_0x3d9329,_0x50ec8a){if(_0x3d9329['body']['id']){delete _0x3d9329['body']['id'];}return db[_0x5e25('0x44')][_0x5e25('0x55')]({'where':{'id':_0x3d9329[_0x5e25('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50ec8a,null))[_0x5e25('0x26')](saveUpdates(_0x3d9329[_0x5e25('0x4e')],null))['then'](respondWithResult(_0x50ec8a,null))[_0x5e25('0x48')](handleError(_0x50ec8a,null));};exports[_0x5e25('0x27')]=function(_0x2d219f,_0x3f99fc){return db[_0x5e25('0x44')][_0x5e25('0x55')]({'where':{'id':_0x2d219f['params']['id']}})[_0x5e25('0x26')](handleEntityNotFound(_0x3f99fc,null))[_0x5e25('0x26')](removeEntity(_0x3f99fc,null))[_0x5e25('0x48')](handleError(_0x3f99fc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 98dbcf0..1553198 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 _0x5f51=['../../config/logger','moment','bluebird','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util'];(function(_0x5acf25,_0x5db3cb){var _0x380561=function(_0x5e383b){while(--_0x5e383b){_0x5acf25['push'](_0x5acf25['shift']());}};_0x380561(++_0x5db3cb);}(_0x5f51,0x1a2));var _0x15f5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5f51[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x15f5('0x0'));var util=require(_0x15f5('0x1'));var logger=require(_0x15f5('0x2'))('api');var moment=require(_0x15f5('0x3'));var BPromise=require(_0x15f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15f5('0x5'));var attributes=require(_0x15f5('0x6'));module[_0x15f5('0x7')]=function(_0xfe3271,_0x328576){return _0xfe3271[_0x15f5('0x8')]('Template',attributes,{'tableName':_0x15f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x493f=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x4beb42,_0x3066df){var _0x198c48=function(_0x4837fb){while(--_0x4837fb){_0x4beb42['push'](_0x4beb42['shift']());}};_0x198c48(++_0x3066df);}(_0x493f,0x1e2));var _0xf493=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x493f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf493('0x0'));var util=require(_0xf493('0x1'));var logger=require(_0xf493('0x2'))(_0xf493('0x3'));var moment=require(_0xf493('0x4'));var BPromise=require(_0xf493('0x5'));var rp=require(_0xf493('0x6'));var fs=require('fs');var path=require(_0xf493('0x7'));var rimraf=require('rimraf');var config=require(_0xf493('0x8'));var attributes=require(_0xf493('0x9'));module[_0xf493('0xa')]=function(_0x476527,_0x14f542){return _0x476527[_0xf493('0xb')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 39977b1..be0a365 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 _0xa0ea=['client','http','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','code','error','message','Template,\x20%s,\x20%s','result','catch','GetTemplate','Template','findAll','options','attributes','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x27d6af,_0x178946){var _0x13bb86=function(_0x5c7a62){while(--_0x5c7a62){_0x27d6af['push'](_0x27d6af['shift']());}};_0x13bb86(++_0x178946);}(_0xa0ea,0x1b9));var _0xaa0e=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xa0ea[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0xaa0e('0x0'));var util=require(_0xaa0e('0x1'));var moment=require(_0xaa0e('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa0e('0x3'));var fs=require('fs');var Redis=require(_0xaa0e('0x4'));var db=require(_0xaa0e('0x5'))['db'];var utils=require(_0xaa0e('0x6'));var logger=require('../../config/logger')(_0xaa0e('0x7'));var config=require(_0xaa0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaa0e('0x9')][_0xaa0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b1c4c,_0x2722f1,_0x55141a){return new BPromise(function(_0x1cd13a,_0x3258b8){return client['request'](_0x3b1c4c,_0x55141a)[_0xaa0e('0xb')](function(_0x358d6b){logger['info']('Template,\x20%s,\x20%s',_0x2722f1,_0xaa0e('0xc'));logger[_0xaa0e('0xd')](_0xaa0e('0xe'),_0x2722f1,_0xaa0e('0xc'),JSON['stringify'](_0x358d6b));if(_0x358d6b['error']){if(_0x358d6b['error'][_0xaa0e('0xf')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x2722f1,_0x358d6b[_0xaa0e('0x10')]['message']);return _0x3258b8(_0x358d6b[_0xaa0e('0x10')][_0xaa0e('0x11')]);}logger[_0xaa0e('0x10')](_0xaa0e('0x12'),_0x2722f1,_0x358d6b[_0xaa0e('0x10')][_0xaa0e('0x11')]);return _0x1cd13a(_0x358d6b[_0xaa0e('0x10')][_0xaa0e('0x11')]);}else{logger['info'](_0xaa0e('0x12'),_0x2722f1,_0xaa0e('0xc'));_0x1cd13a(_0x358d6b[_0xaa0e('0x13')]['message']);}})[_0xaa0e('0x14')](function(_0xfc152d){logger[_0xaa0e('0x10')]('Template,\x20%s,\x20%s',_0x2722f1,_0xfc152d);_0x3258b8(_0xfc152d);});});}exports[_0xaa0e('0x15')]=function(_0x336164){var _0x23841f=this;return new Promise(function(_0x5df304,_0x1e2eed){return db[_0xaa0e('0x16')][_0xaa0e('0x17')]({'raw':_0x336164['options']?_0x336164[_0xaa0e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x336164[_0xaa0e('0x18')]?_0x336164[_0xaa0e('0x18')]['where']||null:null,'attributes':_0x336164[_0xaa0e('0x18')]?_0x336164['options'][_0xaa0e('0x19')]||null:null,'limit':_0x336164[_0xaa0e('0x18')]?_0x336164[_0xaa0e('0x18')]['limit']||null:null,'include':_0x336164['options']?_0x336164[_0xaa0e('0x18')][_0xaa0e('0x1a')]?_['map'](_0x336164['options'][_0xaa0e('0x1a')],function(_0x123cf0){return{'model':db[_0x123cf0['model']],'as':_0x123cf0['as'],'attributes':_0x123cf0[_0xaa0e('0x19')],'include':_0x123cf0[_0xaa0e('0x1a')]?_[_0xaa0e('0x1b')](_0x123cf0[_0xaa0e('0x1a')],function(_0x682992){return{'model':db[_0x682992[_0xaa0e('0x1c')]],'as':_0x682992['as'],'attributes':_0x682992['attributes'],'include':_0x682992[_0xaa0e('0x1a')]?_[_0xaa0e('0x1b')](_0x682992[_0xaa0e('0x1a')],function(_0x3d798e){return{'model':db[_0x3d798e[_0xaa0e('0x1c')]],'as':_0x3d798e['as'],'attributes':_0x3d798e[_0xaa0e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaa0e('0xb')](function(_0x59a8f5){logger['info']('GetTemplate',_0x336164);logger[_0xaa0e('0xd')]('GetTemplate',_0x336164,JSON[_0xaa0e('0x1d')](_0x59a8f5));_0x5df304(_0x59a8f5);})[_0xaa0e('0x14')](function(_0x1eefae){logger[_0xaa0e('0x10')](_0xaa0e('0x15'),_0x1eefae[_0xaa0e('0x11')],_0x336164);_0x1e2eed(_0x23841f[_0xaa0e('0x10')](0x1f4,_0x1eefae[_0xaa0e('0x11')]));});});}; \ No newline at end of file +var _0x90c4=['client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a6970,_0xecaee2){var _0x21d9cd=function(_0x5c5794){while(--_0x5c5794){_0x1a6970['push'](_0x1a6970['shift']());}};_0x21d9cd(++_0xecaee2);}(_0x90c4,0x137));var _0x490c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x90c4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x490c('0x0'));var util=require('util');var moment=require(_0x490c('0x1'));var BPromise=require(_0x490c('0x2'));var rs=require(_0x490c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x490c('0x4'))['db'];var utils=require(_0x490c('0x5'));var logger=require(_0x490c('0x6'))(_0x490c('0x7'));var config=require('../../config/environment');var jayson=require(_0x490c('0x8'));var client=jayson[_0x490c('0x9')][_0x490c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c52ba,_0x15deea,_0x8adca5){return new BPromise(function(_0x2768d0,_0x49bcac){return client[_0x490c('0xb')](_0x4c52ba,_0x8adca5)['then'](function(_0x5a1678){logger[_0x490c('0xc')](_0x490c('0xd'),_0x15deea,_0x490c('0xe'));logger['debug'](_0x490c('0xf'),_0x15deea,_0x490c('0xe'),JSON['stringify'](_0x5a1678));if(_0x5a1678[_0x490c('0x10')]){if(_0x5a1678['error'][_0x490c('0x11')]===0x1f4){logger[_0x490c('0x10')]('Template,\x20%s,\x20%s',_0x15deea,_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);return _0x49bcac(_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);}logger[_0x490c('0x10')](_0x490c('0xd'),_0x15deea,_0x5a1678['error'][_0x490c('0x12')]);return _0x2768d0(_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);}else{logger['info'](_0x490c('0xd'),_0x15deea,'request\x20sent');_0x2768d0(_0x5a1678['result'][_0x490c('0x12')]);}})[_0x490c('0x13')](function(_0x26cc83){logger[_0x490c('0x10')](_0x490c('0xd'),_0x15deea,_0x26cc83);_0x49bcac(_0x26cc83);});});}exports[_0x490c('0x14')]=function(_0x40738d){var _0x3f0401=this;return new Promise(function(_0x4193ef,_0x3940b7){return db[_0x490c('0x15')][_0x490c('0x16')]({'raw':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x18')]===undefined?!![]:![]:!![],'where':_0x40738d['options']?_0x40738d[_0x490c('0x17')][_0x490c('0x19')]||null:null,'attributes':_0x40738d['options']?_0x40738d[_0x490c('0x17')][_0x490c('0x1a')]||null:null,'limit':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x1b')]||null:null,'include':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x1c')]?_['map'](_0x40738d['options'][_0x490c('0x1c')],function(_0x337223){return{'model':db[_0x337223[_0x490c('0x1d')]],'as':_0x337223['as'],'attributes':_0x337223[_0x490c('0x1a')],'include':_0x337223['include']?_[_0x490c('0x1e')](_0x337223['include'],function(_0x51e1a7){return{'model':db[_0x51e1a7[_0x490c('0x1d')]],'as':_0x51e1a7['as'],'attributes':_0x51e1a7[_0x490c('0x1a')],'include':_0x51e1a7[_0x490c('0x1c')]?_[_0x490c('0x1e')](_0x51e1a7[_0x490c('0x1c')],function(_0x28c030){return{'model':db[_0x28c030[_0x490c('0x1d')]],'as':_0x28c030['as'],'attributes':_0x28c030[_0x490c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x490c('0x1f')](function(_0x64798d){logger[_0x490c('0xc')](_0x490c('0x14'),_0x40738d);logger['debug'](_0x490c('0x14'),_0x40738d,JSON['stringify'](_0x64798d));_0x4193ef(_0x64798d);})[_0x490c('0x13')](function(_0x1571b2){logger['error']('GetTemplate',_0x1571b2[_0x490c('0x12')],_0x40738d);_0x3940b7(_0x3f0401['error'](0x1f4,_0x1571b2['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7cc7ecd..a897e8e 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 _0xe19a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAction','put','update','delete','destroy','exports','multer','path'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xe19a,0xd6));var _0xae19=function(_0x2ada12,_0x582fdb){_0x2ada12=_0x2ada12-0x0;var _0x14763c=_0xe19a[_0x2ada12];return _0x14763c;};'use strict';var multer=require(_0xae19('0x0'));var util=require('util');var path=require(_0xae19('0x1'));var timeout=require(_0xae19('0x2'));var express=require(_0xae19('0x3'));var router=express[_0xae19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae19('0x5'));var interaction=require(_0xae19('0x6'));var config=require('../../config/environment');var controller=require(_0xae19('0x7'));router[_0xae19('0x8')]('/',auth[_0xae19('0x9')](),controller[_0xae19('0xa')]);router['get'](_0xae19('0xb'),auth[_0xae19('0x9')](),controller['show']);router['get'](_0xae19('0xc'),auth[_0xae19('0x9')](),controller[_0xae19('0xd')]);router['get'](_0xae19('0xe'),auth['isAuthenticated'](),controller[_0xae19('0xf')]);router[_0xae19('0x8')](_0xae19('0x10'),auth[_0xae19('0x9')](),controller[_0xae19('0x11')]);router['post']('/',auth[_0xae19('0x9')](),controller[_0xae19('0x12')]);router[_0xae19('0x13')](_0xae19('0xc'),auth[_0xae19('0x9')](),controller[_0xae19('0x14')]);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xae19('0x13')](_0xae19('0x10'),auth['isAuthenticated'](),controller[_0xae19('0x15')]);router[_0xae19('0x16')](_0xae19('0xb'),auth[_0xae19('0x9')](),controller[_0xae19('0x17')]);router[_0xae19('0x18')]('/:id',auth[_0xae19('0x9')](),controller[_0xae19('0x19')]);module[_0xae19('0x1a')]=router; \ No newline at end of file +var _0x8721=['post','create','addAllCondition','addAction','put','delete','exports','multer','util','path','Router','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x12b7e4,_0x5cc8b3){var _0xce2ecc=function(_0x1df36f){while(--_0x1df36f){_0x12b7e4['push'](_0x12b7e4['shift']());}};_0xce2ecc(++_0x5cc8b3);}(_0x8721,0xd9));var _0x1872=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x8721[_0x3b96cf];return _0x2e315a;};'use strict';var multer=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var path=require(_0x1872('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1872('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1872('0x4'));var controller=require(_0x1872('0x5'));router[_0x1872('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1872('0x6')](_0x1872('0x7'),auth[_0x1872('0x8')](),controller['show']);router[_0x1872('0x6')](_0x1872('0x9'),auth[_0x1872('0x8')](),controller[_0x1872('0xa')]);router[_0x1872('0x6')](_0x1872('0xb'),auth[_0x1872('0x8')](),controller[_0x1872('0xc')]);router[_0x1872('0x6')](_0x1872('0xd'),auth[_0x1872('0x8')](),controller['getActions']);router[_0x1872('0xe')]('/',auth[_0x1872('0x8')](),controller[_0x1872('0xf')]);router[_0x1872('0xe')]('/:id/all_conditions',auth[_0x1872('0x8')](),controller[_0x1872('0x10')]);router[_0x1872('0xe')](_0x1872('0xb'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x1872('0xe')](_0x1872('0xd'),auth[_0x1872('0x8')](),controller[_0x1872('0x11')]);router[_0x1872('0x12')](_0x1872('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x1872('0x13')](_0x1872('0x7'),auth[_0x1872('0x8')](),controller['destroy']);module[_0x1872('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 5521f25..fc8f280 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 _0x1c8d=['BOOLEAN','exports','STRING'];(function(_0x18d574,_0x201a43){var _0x300a1c=function(_0x2cb6b8){while(--_0x2cb6b8){_0x18d574['push'](_0x18d574['shift']());}};_0x300a1c(++_0x201a43);}(_0x1c8d,0x196));var _0xd1c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1c8d[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xd1c8('0x0')]={'name':{'type':Sequelize[_0xd1c8('0x1')]},'channel':{'type':Sequelize[_0xd1c8('0x1')]},'description':{'type':Sequelize[_0xd1c8('0x1')]},'status':{'type':Sequelize[_0xd1c8('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6733=['BOOLEAN','sequelize','STRING'];(function(_0x165995,_0xfcd4a6){var _0x43194d=function(_0x199527){while(--_0x199527){_0x165995['push'](_0x165995['shift']());}};_0x43194d(++_0xfcd4a6);}(_0x6733,0x1cc));var _0x3673=function(_0x368872,_0x149ebd){_0x368872=_0x368872-0x0;var _0x41e45f=_0x6733[_0x368872];return _0x41e45f;};'use strict';var Sequelize=require(_0x3673('0x0'));module['exports']={'name':{'type':Sequelize[_0x3673('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3673('0x1')]},'status':{'type':Sequelize[_0x3673('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index c6230a8..dc6b020 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 _0xd309=['findOne','order','options','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','get','Triggers','UserProfileResource','stack','name','send','index','Trigger','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions'];(function(_0x2af3a6,_0x4ebac4){var _0x3cbc74=function(_0x15db04){while(--_0x15db04){_0x2af3a6['push'](_0x2af3a6['shift']());}};_0x3cbc74(++_0x4ebac4);}(_0xd309,0x1da));var _0x9d30=function(_0x38ae5e,_0x10456f){_0x38ae5e=_0x38ae5e-0x0;var _0x442da2=_0xd309[_0x38ae5e];return _0x442da2;};'use strict';var emlformat=require(_0x9d30('0x0'));var rimraf=require(_0x9d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d30('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9d30('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9d30('0x4'));var csv=require('to-csv');var ejs=require(_0x9d30('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d30('0x6'));var squel=require(_0x9d30('0x7'));var crypto=require(_0x9d30('0x8'));var jsforce=require(_0x9d30('0x9'));var deskjs=require(_0x9d30('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9d30('0xb'));var Papa=require(_0x9d30('0xc'));var Redis=require(_0x9d30('0xd'));var authService=require(_0x9d30('0xe'));var qs=require(_0x9d30('0xf'));var as=require(_0x9d30('0x10'));var hardwareService=require(_0x9d30('0x11'));var logger=require(_0x9d30('0x12'))(_0x9d30('0x13'));var utils=require(_0x9d30('0x14'));var config=require(_0x9d30('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d30('0x16'))['db'];function respondWithStatusCode(_0x332c58,_0x22e7e8){_0x22e7e8=_0x22e7e8||0xcc;return function(_0x2b54c8){if(_0x2b54c8){return _0x332c58[_0x9d30('0x17')](_0x22e7e8);}return _0x332c58[_0x9d30('0x18')](_0x22e7e8)[_0x9d30('0x19')]();};}function respondWithResult(_0x17cbe2,_0x2715d8){_0x2715d8=_0x2715d8||0xc8;return function(_0x2c7eb8){if(_0x2c7eb8){return _0x17cbe2[_0x9d30('0x18')](_0x2715d8)[_0x9d30('0x1a')](_0x2c7eb8);}};}function respondWithFilteredResult(_0x344036,_0x1fbed3){return function(_0x4853ec){if(_0x4853ec){var _0x2a0514=typeof _0x1fbed3[_0x9d30('0x1b')]===_0x9d30('0x1c')&&typeof _0x1fbed3['limit']==='undefined';var _0x393bfa=_0x4853ec['count'];var _0x4de1a0=_0x2a0514?0x0:_0x1fbed3['offset'];var _0x1037d7=_0x2a0514?_0x4853ec[_0x9d30('0x1d')]:_0x1fbed3[_0x9d30('0x1b')]+_0x1fbed3[_0x9d30('0x1e')];var _0x2ee378;if(_0x1037d7>=_0x393bfa){_0x1037d7=_0x393bfa;_0x2ee378=0xc8;}else{_0x2ee378=0xce;}_0x344036[_0x9d30('0x18')](_0x2ee378);return _0x344036['set'](_0x9d30('0x1f'),_0x4de1a0+'-'+_0x1037d7+'/'+_0x393bfa)['json'](_0x4853ec);}return null;};}function patchUpdates(_0xcc11){return function(_0x59f0fe){try{jsonpatch['apply'](_0x59f0fe,_0xcc11,!![]);}catch(_0x33d22d){return BPromise[_0x9d30('0x20')](_0x33d22d);}return _0x59f0fe['save']();};}function saveUpdates(_0x239f36,_0x19f2cd){return function(_0x695d33){if(_0x695d33){return _0x695d33[_0x9d30('0x21')](_0x239f36)[_0x9d30('0x22')](function(_0x2f503c){return _0x2f503c;});}return null;};}function removeEntity(_0x155dad,_0x5e110a){return function(_0x2f8f15){if(_0x2f8f15){return _0x2f8f15[_0x9d30('0x23')]()[_0x9d30('0x22')](function(){var _0x5191b7=_0x2f8f15[_0x9d30('0x24')]({'plain':!![]});var _0xe5ff14=_0x9d30('0x25');return db[_0x9d30('0x26')][_0x9d30('0x23')]({'where':{'type':_0xe5ff14,'resourceId':_0x5191b7['id']}})[_0x9d30('0x22')](function(){return _0x2f8f15;});})['then'](function(){_0x155dad[_0x9d30('0x18')](0xcc)[_0x9d30('0x19')]();});}};}function handleEntityNotFound(_0xbf3592,_0x258bd6){return function(_0x3b670a){if(!_0x3b670a){_0xbf3592['sendStatus'](0x194);}return _0x3b670a;};}function handleError(_0x2f2349,_0x1b1dcc){_0x1b1dcc=_0x1b1dcc||0x1f4;return function(_0x176ce7){logger['error'](_0x176ce7[_0x9d30('0x27')]);if(_0x176ce7['name']){delete _0x176ce7[_0x9d30('0x28')];}_0x2f2349['status'](_0x1b1dcc)[_0x9d30('0x29')](_0x176ce7);};}exports[_0x9d30('0x2a')]=function(_0x19ffe1,_0x384bf1){var _0x3a9468={},_0x83eae0={},_0x4880af={'count':0x0,'rows':[]};var _0x4e059b=_['map'](db[_0x9d30('0x2b')]['rawAttributes'],function(_0x29071a){return{'name':_0x29071a['fieldName'],'type':_0x29071a[_0x9d30('0x2c')][_0x9d30('0x2d')]};});_0x83eae0['model']=_[_0x9d30('0x2e')](_0x4e059b,_0x9d30('0x28'));_0x83eae0[_0x9d30('0x2f')]=_[_0x9d30('0x30')](_0x19ffe1['query']);_0x83eae0[_0x9d30('0x31')]=_[_0x9d30('0x32')](_0x83eae0[_0x9d30('0x33')],_0x83eae0[_0x9d30('0x2f')]);_0x3a9468[_0x9d30('0x34')]=_[_0x9d30('0x32')](_0x83eae0['model'],qs[_0x9d30('0x35')](_0x19ffe1['query'][_0x9d30('0x35')]));_0x3a9468[_0x9d30('0x34')]=_0x3a9468['attributes'][_0x9d30('0x36')]?_0x3a9468['attributes']:_0x83eae0['model'];if(!_0x19ffe1[_0x9d30('0x2f')][_0x9d30('0x37')]('nolimit')){_0x3a9468[_0x9d30('0x1e')]=qs[_0x9d30('0x1e')](_0x19ffe1[_0x9d30('0x2f')][_0x9d30('0x1e')]);_0x3a9468[_0x9d30('0x1b')]=qs[_0x9d30('0x1b')](_0x19ffe1['query'][_0x9d30('0x1b')]);}_0x3a9468['order']=qs[_0x9d30('0x38')](_0x19ffe1['query'][_0x9d30('0x38')]);_0x3a9468['where']=qs[_0x9d30('0x31')](_[_0x9d30('0x39')](_0x19ffe1[_0x9d30('0x2f')],_0x83eae0[_0x9d30('0x31')]),_0x4e059b);if(_0x19ffe1[_0x9d30('0x2f')][_0x9d30('0x3a')]){_0x3a9468[_0x9d30('0x3b')]=_[_0x9d30('0x3c')](_0x3a9468[_0x9d30('0x3b')],{'$or':_[_0x9d30('0x2e')](_0x4e059b,function(_0x3ef64f){if(_0x3ef64f[_0x9d30('0x2c')]!==_0x9d30('0x3d')){var _0xf4d9be={};_0xf4d9be[_0x3ef64f[_0x9d30('0x28')]]={'$like':'%'+_0x19ffe1[_0x9d30('0x2f')]['filter']+'%'};return _0xf4d9be;}})});}_0x3a9468=_[_0x9d30('0x3c')]({},_0x3a9468,_0x19ffe1['options']);var _0x5d7822={'where':_0x3a9468[_0x9d30('0x3b')]};return db[_0x9d30('0x2b')][_0x9d30('0x1d')](_0x5d7822)[_0x9d30('0x22')](function(_0x99634f){_0x4880af['count']=_0x99634f;if(_0x19ffe1[_0x9d30('0x2f')][_0x9d30('0x3e')]){_0x3a9468[_0x9d30('0x3f')]=[{'all':!![]}];}return db[_0x9d30('0x2b')][_0x9d30('0x40')](_0x3a9468);})[_0x9d30('0x22')](function(_0x2c71f3){_0x4880af[_0x9d30('0x41')]=_0x2c71f3;return _0x4880af;})[_0x9d30('0x22')](respondWithFilteredResult(_0x384bf1,_0x3a9468))[_0x9d30('0x42')](handleError(_0x384bf1,null));};exports[_0x9d30('0x43')]=function(_0x37b698,_0x76def9){var _0x1002db={'raw':![],'where':{'id':_0x37b698[_0x9d30('0x44')]['id']}},_0x4dbfb1={};_0x4dbfb1[_0x9d30('0x33')]=_['keys'](db[_0x9d30('0x2b')][_0x9d30('0x45')]);_0x4dbfb1['query']=_[_0x9d30('0x30')](_0x37b698[_0x9d30('0x2f')]);_0x4dbfb1[_0x9d30('0x31')]=_[_0x9d30('0x32')](_0x4dbfb1[_0x9d30('0x33')],_0x4dbfb1[_0x9d30('0x2f')]);_0x1002db[_0x9d30('0x34')]=_[_0x9d30('0x32')](_0x4dbfb1[_0x9d30('0x33')],qs[_0x9d30('0x35')](_0x37b698[_0x9d30('0x2f')][_0x9d30('0x35')]));_0x1002db['attributes']=_0x1002db[_0x9d30('0x34')][_0x9d30('0x36')]?_0x1002db[_0x9d30('0x34')]:_0x4dbfb1[_0x9d30('0x33')];if(_0x37b698[_0x9d30('0x2f')][_0x9d30('0x3e')]){_0x1002db['include']=[{'all':!![]}];}_0x1002db=_[_0x9d30('0x3c')]({},_0x1002db,_0x37b698['options']);return db[_0x9d30('0x2b')][_0x9d30('0x46')](_0x1002db)[_0x9d30('0x22')](handleEntityNotFound(_0x76def9,null))[_0x9d30('0x22')](respondWithResult(_0x76def9,null))[_0x9d30('0x42')](handleError(_0x76def9,null));};exports[_0x9d30('0x47')]=function(_0x2e266c,_0x43f4b5){return db['Trigger'][_0x9d30('0x47')](_0x2e266c[_0x9d30('0x48')],{})[_0x9d30('0x22')](function(_0x275cea){var _0x3f76df=_0x2e266c[_0x9d30('0x49')][_0x9d30('0x24')]({'plain':!![]});if(!_0x3f76df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f76df[_0x9d30('0x4a')]===_0x9d30('0x49')){var _0xe24c6b=_0x275cea[_0x9d30('0x24')]({'plain':!![]});var _0x2e0500=_0x9d30('0x25');return db[_0x9d30('0x4b')][_0x9d30('0x46')]({'where':{'name':_0x2e0500,'userProfileId':_0x3f76df[_0x9d30('0x4c')]},'raw':!![]})[_0x9d30('0x22')](function(_0x2833d3){if(_0x2833d3&&_0x2833d3['autoAssociation']===0x0){return db[_0x9d30('0x26')][_0x9d30('0x47')]({'name':_0xe24c6b['name'],'resourceId':_0xe24c6b['id'],'type':_0x2833d3[_0x9d30('0x28')],'sectionId':_0x2833d3['id']},{})[_0x9d30('0x22')](function(){return _0x275cea;});}else{return _0x275cea;}})[_0x9d30('0x42')](function(_0x4be5a0){logger[_0x9d30('0x4d')](_0x9d30('0x4e'),_0x4be5a0);throw _0x4be5a0;});}return _0x275cea;})[_0x9d30('0x22')](respondWithResult(_0x43f4b5,0xc9))[_0x9d30('0x42')](handleError(_0x43f4b5,null));};exports[_0x9d30('0x21')]=function(_0x49bb5a,_0x187187){if(_0x49bb5a['body']['id']){delete _0x49bb5a[_0x9d30('0x48')]['id'];}return db['Trigger'][_0x9d30('0x46')]({'where':{'id':_0x49bb5a[_0x9d30('0x44')]['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x187187,null))[_0x9d30('0x22')](saveUpdates(_0x49bb5a[_0x9d30('0x48')],null))[_0x9d30('0x22')](respondWithResult(_0x187187,null))[_0x9d30('0x42')](handleError(_0x187187,null));};exports[_0x9d30('0x23')]=function(_0x43cc74,_0x56ebf1){return db[_0x9d30('0x2b')][_0x9d30('0x46')]({'where':{'id':_0x43cc74['params']['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x56ebf1,null))[_0x9d30('0x22')](removeEntity(_0x56ebf1,null))[_0x9d30('0x42')](handleError(_0x56ebf1,null));};exports['addAllCondition']=function(_0x3a083f,_0x2bf72f,_0x4b9a94){if(_0x3a083f['body']['id']){delete _0x3a083f[_0x9d30('0x48')]['id'];}return db[_0x9d30('0x2b')][_0x9d30('0x46')]({'where':{'id':_0x3a083f[_0x9d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bf72f,null))['then'](function(_0x19cd84){if(_0x19cd84){_0x3a083f['body'][_0x9d30('0x4f')]=_0x19cd84['id'];return db['Condition'][_0x9d30('0x47')](_0x3a083f[_0x9d30('0x48')]);}})[_0x9d30('0x22')](respondWithResult(_0x2bf72f,null))[_0x9d30('0x42')](handleError(_0x2bf72f,null));};exports[_0x9d30('0x50')]=function(_0x48c4b3,_0x1f3b77,_0x215350){if(_0x48c4b3[_0x9d30('0x48')]['id']){delete _0x48c4b3[_0x9d30('0x48')]['id'];}return db[_0x9d30('0x2b')][_0x9d30('0x46')]({'where':{'id':_0x48c4b3['params']['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x1f3b77,null))[_0x9d30('0x22')](function(_0x12f361){if(_0x12f361){_0x48c4b3['body'][_0x9d30('0x51')]=_0x12f361['id'];return db[_0x9d30('0x52')]['create'](_0x48c4b3['body']);}})['then'](respondWithResult(_0x1f3b77,null))['catch'](handleError(_0x1f3b77,null));};exports[_0x9d30('0x53')]=function(_0x1d6510,_0xe1678,_0x5d478c){var _0x3cd9ec={};var _0x28c711={};var _0x83513e;var _0x1b2a51;return db['Trigger'][_0x9d30('0x54')]({'where':{'id':_0x1d6510['params']['id']}})['then'](handleEntityNotFound(_0xe1678,null))[_0x9d30('0x22')](function(_0x16dbf7){if(_0x16dbf7){_0x83513e=_0x16dbf7;_0x28c711[_0x9d30('0x33')]=_['keys'](db[_0x9d30('0x52')][_0x9d30('0x45')]);_0x28c711[_0x9d30('0x2f')]=_[_0x9d30('0x30')](_0x1d6510[_0x9d30('0x2f')]);_0x28c711['filters']=_[_0x9d30('0x32')](_0x28c711['model'],_0x28c711['query']);_0x3cd9ec['attributes']=_['intersection'](_0x28c711[_0x9d30('0x33')],qs['fields'](_0x1d6510[_0x9d30('0x2f')]['fields']));_0x3cd9ec[_0x9d30('0x34')]=_0x3cd9ec[_0x9d30('0x34')][_0x9d30('0x36')]?_0x3cd9ec[_0x9d30('0x34')]:_0x28c711['model'];_0x3cd9ec[_0x9d30('0x55')]=qs[_0x9d30('0x38')](_0x1d6510[_0x9d30('0x2f')][_0x9d30('0x38')]);_0x3cd9ec[_0x9d30('0x3b')]=qs[_0x9d30('0x31')](_[_0x9d30('0x39')](_0x1d6510['query'],_0x28c711[_0x9d30('0x31')]));if(_0x1d6510[_0x9d30('0x2f')][_0x9d30('0x3a')]){_0x3cd9ec['where']=_[_0x9d30('0x3c')](_0x3cd9ec[_0x9d30('0x3b')],{'$or':_[_0x9d30('0x2e')](_0x3cd9ec[_0x9d30('0x34')],function(_0x49ca58){var _0x1c8eac={};_0x1c8eac[_0x49ca58]={'$like':'%'+_0x1d6510['query'][_0x9d30('0x3a')]+'%'};return _0x1c8eac;})});}_0x3cd9ec=_[_0x9d30('0x3c')]({},_0x3cd9ec,_0x1d6510[_0x9d30('0x56')]);return _0x83513e['getAllConditions'](_0x3cd9ec);}})[_0x9d30('0x22')](function(_0x51a0d9){if(_0x51a0d9){_0x1b2a51=_0x51a0d9['length'];if(!_0x1d6510[_0x9d30('0x2f')]['hasOwnProperty'](_0x9d30('0x57'))){_0x3cd9ec['limit']=qs[_0x9d30('0x1e')](_0x1d6510['query'][_0x9d30('0x1e')]);_0x3cd9ec[_0x9d30('0x1b')]=qs[_0x9d30('0x1b')](_0x1d6510['query'][_0x9d30('0x1b')]);}return _0x83513e[_0x9d30('0x53')](_0x3cd9ec);}})[_0x9d30('0x22')](function(_0x39d3e2){if(_0x39d3e2){return _0x39d3e2?{'count':_0x1b2a51,'rows':_0x39d3e2}:null;}})[_0x9d30('0x22')](respondWithResult(_0xe1678,null))[_0x9d30('0x42')](handleError(_0xe1678,null));};exports['getAnyConditions']=function(_0x561758,_0x4a0004,_0x6ed3c5){var _0x39157c={};var _0x5c76e8={};var _0x2aa721;var _0x2ebc3f;return db[_0x9d30('0x2b')][_0x9d30('0x54')]({'where':{'id':_0x561758[_0x9d30('0x44')]['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x4a0004,null))[_0x9d30('0x22')](function(_0x218ec9){if(_0x218ec9){_0x2aa721=_0x218ec9;_0x5c76e8[_0x9d30('0x33')]=_[_0x9d30('0x30')](db['Condition'][_0x9d30('0x45')]);_0x5c76e8['query']=_[_0x9d30('0x30')](_0x561758[_0x9d30('0x2f')]);_0x5c76e8['filters']=_['intersection'](_0x5c76e8[_0x9d30('0x33')],_0x5c76e8[_0x9d30('0x2f')]);_0x39157c[_0x9d30('0x34')]=_[_0x9d30('0x32')](_0x5c76e8[_0x9d30('0x33')],qs[_0x9d30('0x35')](_0x561758[_0x9d30('0x2f')][_0x9d30('0x35')]));_0x39157c[_0x9d30('0x34')]=_0x39157c[_0x9d30('0x34')]['length']?_0x39157c[_0x9d30('0x34')]:_0x5c76e8['model'];_0x39157c[_0x9d30('0x55')]=qs[_0x9d30('0x38')](_0x561758[_0x9d30('0x2f')][_0x9d30('0x38')]);_0x39157c[_0x9d30('0x3b')]=qs[_0x9d30('0x31')](_['pick'](_0x561758[_0x9d30('0x2f')],_0x5c76e8[_0x9d30('0x31')]));if(_0x561758[_0x9d30('0x2f')][_0x9d30('0x3a')]){_0x39157c[_0x9d30('0x3b')]=_['merge'](_0x39157c[_0x9d30('0x3b')],{'$or':_[_0x9d30('0x2e')](_0x39157c[_0x9d30('0x34')],function(_0x511ce6){var _0xe2d495={};_0xe2d495[_0x511ce6]={'$like':'%'+_0x561758[_0x9d30('0x2f')][_0x9d30('0x3a')]+'%'};return _0xe2d495;})});}_0x39157c=_[_0x9d30('0x3c')]({},_0x39157c,_0x561758[_0x9d30('0x56')]);return _0x2aa721['getAnyConditions'](_0x39157c);}})['then'](function(_0x2dc96f){if(_0x2dc96f){_0x2ebc3f=_0x2dc96f[_0x9d30('0x36')];if(!_0x561758[_0x9d30('0x2f')]['hasOwnProperty']('nolimit')){_0x39157c['limit']=qs[_0x9d30('0x1e')](_0x561758[_0x9d30('0x2f')][_0x9d30('0x1e')]);_0x39157c['offset']=qs[_0x9d30('0x1b')](_0x561758[_0x9d30('0x2f')][_0x9d30('0x1b')]);}return _0x2aa721[_0x9d30('0x58')](_0x39157c);}})['then'](function(_0x4d2630){if(_0x4d2630){return _0x4d2630?{'count':_0x2ebc3f,'rows':_0x4d2630}:null;}})[_0x9d30('0x22')](respondWithResult(_0x4a0004,null))['catch'](handleError(_0x4a0004,null));};exports[_0x9d30('0x59')]=function(_0x4385e7,_0x401d56,_0x445b73){if(_0x4385e7['body']['id']){delete _0x4385e7[_0x9d30('0x48')]['id'];}return db[_0x9d30('0x2b')]['find']({'where':{'id':_0x4385e7[_0x9d30('0x44')]['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x401d56,null))[_0x9d30('0x22')](function(_0x1c1409){if(_0x1c1409){_0x4385e7['body'][_0x9d30('0x5a')]=_0x1c1409['id'];return db[_0x9d30('0x5b')][_0x9d30('0x47')](_0x4385e7[_0x9d30('0x48')]);}})['then'](respondWithResult(_0x401d56,null))[_0x9d30('0x42')](handleError(_0x401d56,null));};exports[_0x9d30('0x5c')]=function(_0x11d7b8,_0x1e4ea1,_0x352fdb){var _0x5e5bc1={};var _0xb358ca={};var _0x359252;var _0x2497cc;return db['Trigger'][_0x9d30('0x54')]({'where':{'id':_0x11d7b8[_0x9d30('0x44')]['id']}})[_0x9d30('0x22')](handleEntityNotFound(_0x1e4ea1,null))[_0x9d30('0x22')](function(_0x5e0835){if(_0x5e0835){_0x359252=_0x5e0835;_0xb358ca[_0x9d30('0x33')]=_[_0x9d30('0x30')](db['Action'][_0x9d30('0x45')]);_0xb358ca[_0x9d30('0x2f')]=_[_0x9d30('0x30')](_0x11d7b8['query']);_0xb358ca[_0x9d30('0x31')]=_['intersection'](_0xb358ca[_0x9d30('0x33')],_0xb358ca[_0x9d30('0x2f')]);_0x5e5bc1[_0x9d30('0x34')]=_['intersection'](_0xb358ca[_0x9d30('0x33')],qs[_0x9d30('0x35')](_0x11d7b8[_0x9d30('0x2f')]['fields']));_0x5e5bc1[_0x9d30('0x34')]=_0x5e5bc1[_0x9d30('0x34')][_0x9d30('0x36')]?_0x5e5bc1[_0x9d30('0x34')]:_0xb358ca[_0x9d30('0x33')];_0x5e5bc1[_0x9d30('0x55')]=qs['sort'](_0x11d7b8[_0x9d30('0x2f')][_0x9d30('0x38')]);_0x5e5bc1[_0x9d30('0x3b')]=qs['filters'](_['pick'](_0x11d7b8[_0x9d30('0x2f')],_0xb358ca[_0x9d30('0x31')]));if(_0x11d7b8[_0x9d30('0x2f')][_0x9d30('0x3a')]){_0x5e5bc1[_0x9d30('0x3b')]=_[_0x9d30('0x3c')](_0x5e5bc1['where'],{'$or':_[_0x9d30('0x2e')](_0x5e5bc1['attributes'],function(_0x51c5a2){var _0x4cffff={};_0x4cffff[_0x51c5a2]={'$like':'%'+_0x11d7b8[_0x9d30('0x2f')]['filter']+'%'};return _0x4cffff;})});}_0x5e5bc1=_[_0x9d30('0x3c')]({},_0x5e5bc1,_0x11d7b8[_0x9d30('0x56')]);return _0x359252['getActions'](_0x5e5bc1);}})['then'](function(_0x2d5beb){if(_0x2d5beb){_0x2497cc=_0x2d5beb[_0x9d30('0x36')];if(!_0x11d7b8[_0x9d30('0x2f')]['hasOwnProperty']('nolimit')){_0x5e5bc1[_0x9d30('0x1e')]=qs['limit'](_0x11d7b8[_0x9d30('0x2f')][_0x9d30('0x1e')]);_0x5e5bc1['offset']=qs[_0x9d30('0x1b')](_0x11d7b8[_0x9d30('0x2f')][_0x9d30('0x1b')]);}return _0x359252[_0x9d30('0x5c')](_0x5e5bc1);}})['then'](function(_0x3695e6){if(_0x3695e6){return _0x3695e6?{'count':_0x2497cc,'rows':_0x3695e6}:null;}})[_0x9d30('0x22')](respondWithResult(_0x1e4ea1,null))[_0x9d30('0x42')](handleError(_0x1e4ea1,null));}; \ No newline at end of file +var _0x0017=['hasOwnProperty','getAnyConditions','addAction','Action','getActions','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','Triggers','UserProfileResource','end','error','stack','name','index','map','Trigger','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','update','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','pick','options'];(function(_0x1f0639,_0x1a8d55){var _0x342d8a=function(_0xdf211d){while(--_0xdf211d){_0x1f0639['push'](_0x1f0639['shift']());}};_0x342d8a(++_0x1a8d55);}(_0x0017,0x161));var _0x7001=function(_0x17371c,_0x1a1e9c){_0x17371c=_0x17371c-0x0;var _0x422265=_0x0017[_0x17371c];return _0x422265;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7001('0x0'));var rp=require('request-promise');var moment=require(_0x7001('0x1'));var BPromise=require(_0x7001('0x2'));var Mustache=require(_0x7001('0x3'));var util=require(_0x7001('0x4'));var path=require('path');var sox=require(_0x7001('0x5'));var csv=require(_0x7001('0x6'));var ejs=require(_0x7001('0x7'));var fs=require('fs');var fs_extra=require(_0x7001('0x8'));var _=require(_0x7001('0x9'));var squel=require(_0x7001('0xa'));var crypto=require('crypto');var jsforce=require(_0x7001('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7001('0x6'));var querystring=require('querystring');var Papa=require(_0x7001('0xc'));var Redis=require(_0x7001('0xd'));var authService=require(_0x7001('0xe'));var qs=require(_0x7001('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7001('0x10'));var utils=require('../../config/utils');var config=require(_0x7001('0x11'));var licenseUtil=require(_0x7001('0x12'));var db=require(_0x7001('0x13'))['db'];function respondWithStatusCode(_0x440f9d,_0x5a226d){_0x5a226d=_0x5a226d||0xcc;return function(_0x2b83e6){if(_0x2b83e6){return _0x440f9d[_0x7001('0x14')](_0x5a226d);}return _0x440f9d[_0x7001('0x15')](_0x5a226d)['end']();};}function respondWithResult(_0x182ac5,_0x28967d){_0x28967d=_0x28967d||0xc8;return function(_0x5f29a1){if(_0x5f29a1){return _0x182ac5[_0x7001('0x15')](_0x28967d)[_0x7001('0x16')](_0x5f29a1);}};}function respondWithFilteredResult(_0x2f6205,_0x5cb8f2){return function(_0x8d40e0){if(_0x8d40e0){var _0x180954=typeof _0x5cb8f2[_0x7001('0x17')]==='undefined'&&typeof _0x5cb8f2[_0x7001('0x18')]===_0x7001('0x19');var _0x1f268f=_0x8d40e0[_0x7001('0x1a')];var _0x8f7794=_0x180954?0x0:_0x5cb8f2[_0x7001('0x17')];var _0x5e154a=_0x180954?_0x8d40e0[_0x7001('0x1a')]:_0x5cb8f2['offset']+_0x5cb8f2['limit'];var _0x3db5ad;if(_0x5e154a>=_0x1f268f){_0x5e154a=_0x1f268f;_0x3db5ad=0xc8;}else{_0x3db5ad=0xce;}_0x2f6205[_0x7001('0x15')](_0x3db5ad);return _0x2f6205[_0x7001('0x1b')](_0x7001('0x1c'),_0x8f7794+'-'+_0x5e154a+'/'+_0x1f268f)['json'](_0x8d40e0);}return null;};}function patchUpdates(_0xa530a){return function(_0x115c16){try{jsonpatch['apply'](_0x115c16,_0xa530a,!![]);}catch(_0x32b4fa){return BPromise[_0x7001('0x1d')](_0x32b4fa);}return _0x115c16[_0x7001('0x1e')]();};}function saveUpdates(_0x1dc375,_0xdb039d){return function(_0xc4874f){if(_0xc4874f){return _0xc4874f['update'](_0x1dc375)[_0x7001('0x1f')](function(_0x2637b9){return _0x2637b9;});}return null;};}function removeEntity(_0xba7a85,_0x1e8bcc){return function(_0x3e3d58){if(_0x3e3d58){return _0x3e3d58[_0x7001('0x20')]()[_0x7001('0x1f')](function(){var _0x129519=_0x3e3d58['get']({'plain':!![]});var _0x356d7a=_0x7001('0x21');return db[_0x7001('0x22')][_0x7001('0x20')]({'where':{'type':_0x356d7a,'resourceId':_0x129519['id']}})[_0x7001('0x1f')](function(){return _0x3e3d58;});})[_0x7001('0x1f')](function(){_0xba7a85['status'](0xcc)[_0x7001('0x23')]();});}};}function handleEntityNotFound(_0x8d1872,_0x449d24){return function(_0x356919){if(!_0x356919){_0x8d1872[_0x7001('0x14')](0x194);}return _0x356919;};}function handleError(_0x4c6129,_0x2246fa){_0x2246fa=_0x2246fa||0x1f4;return function(_0x8d2503){logger[_0x7001('0x24')](_0x8d2503[_0x7001('0x25')]);if(_0x8d2503['name']){delete _0x8d2503[_0x7001('0x26')];}_0x4c6129['status'](_0x2246fa)['send'](_0x8d2503);};}exports[_0x7001('0x27')]=function(_0x59ae42,_0xbff795){var _0x531109={},_0x32e530={},_0x177a95={'count':0x0,'rows':[]};var _0x12a604=_[_0x7001('0x28')](db[_0x7001('0x29')][_0x7001('0x2a')],function(_0x3176ce){return{'name':_0x3176ce['fieldName'],'type':_0x3176ce['type'][_0x7001('0x2b')]};});_0x32e530['model']=_[_0x7001('0x28')](_0x12a604,_0x7001('0x26'));_0x32e530[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0x59ae42[_0x7001('0x2c')]);_0x32e530[_0x7001('0x2e')]=_['intersection'](_0x32e530[_0x7001('0x2f')],_0x32e530[_0x7001('0x2c')]);_0x531109[_0x7001('0x30')]=_[_0x7001('0x31')](_0x32e530[_0x7001('0x2f')],qs[_0x7001('0x32')](_0x59ae42[_0x7001('0x2c')]['fields']));_0x531109['attributes']=_0x531109['attributes'][_0x7001('0x33')]?_0x531109['attributes']:_0x32e530[_0x7001('0x2f')];if(!_0x59ae42[_0x7001('0x2c')]['hasOwnProperty'](_0x7001('0x34'))){_0x531109[_0x7001('0x18')]=qs['limit'](_0x59ae42['query'][_0x7001('0x18')]);_0x531109[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x59ae42['query'][_0x7001('0x17')]);}_0x531109[_0x7001('0x35')]=qs['sort'](_0x59ae42[_0x7001('0x2c')][_0x7001('0x36')]);_0x531109[_0x7001('0x37')]=qs['filters'](_['pick'](_0x59ae42[_0x7001('0x2c')],_0x32e530['filters']),_0x12a604);if(_0x59ae42[_0x7001('0x2c')][_0x7001('0x38')]){_0x531109[_0x7001('0x37')]=_[_0x7001('0x39')](_0x531109[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x12a604,function(_0x191b32){if(_0x191b32[_0x7001('0x3a')]!==_0x7001('0x3b')){var _0x4a719b={};_0x4a719b[_0x191b32[_0x7001('0x26')]]={'$like':'%'+_0x59ae42['query'][_0x7001('0x38')]+'%'};return _0x4a719b;}})});}_0x531109=_['merge']({},_0x531109,_0x59ae42['options']);var _0x5b940b={'where':_0x531109['where']};return db[_0x7001('0x29')][_0x7001('0x1a')](_0x5b940b)[_0x7001('0x1f')](function(_0x5c81d6){_0x177a95[_0x7001('0x1a')]=_0x5c81d6;if(_0x59ae42[_0x7001('0x2c')][_0x7001('0x3c')]){_0x531109[_0x7001('0x3d')]=[{'all':!![]}];}return db[_0x7001('0x29')][_0x7001('0x3e')](_0x531109);})[_0x7001('0x1f')](function(_0x2be04e){_0x177a95['rows']=_0x2be04e;return _0x177a95;})['then'](respondWithFilteredResult(_0xbff795,_0x531109))[_0x7001('0x3f')](handleError(_0xbff795,null));};exports[_0x7001('0x40')]=function(_0x4c124c,_0x1075c8){var _0x392dcc={'raw':![],'where':{'id':_0x4c124c[_0x7001('0x41')]['id']}},_0x163e00={};_0x163e00[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x29')][_0x7001('0x2a')]);_0x163e00[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0x4c124c[_0x7001('0x2c')]);_0x163e00[_0x7001('0x2e')]=_[_0x7001('0x31')](_0x163e00[_0x7001('0x2f')],_0x163e00[_0x7001('0x2c')]);_0x392dcc[_0x7001('0x30')]=_[_0x7001('0x31')](_0x163e00[_0x7001('0x2f')],qs['fields'](_0x4c124c[_0x7001('0x2c')][_0x7001('0x32')]));_0x392dcc[_0x7001('0x30')]=_0x392dcc[_0x7001('0x30')]['length']?_0x392dcc[_0x7001('0x30')]:_0x163e00[_0x7001('0x2f')];if(_0x4c124c[_0x7001('0x2c')][_0x7001('0x3c')]){_0x392dcc[_0x7001('0x3d')]=[{'all':!![]}];}_0x392dcc=_[_0x7001('0x39')]({},_0x392dcc,_0x4c124c['options']);return db['Trigger']['find'](_0x392dcc)[_0x7001('0x1f')](handleEntityNotFound(_0x1075c8,null))['then'](respondWithResult(_0x1075c8,null))['catch'](handleError(_0x1075c8,null));};exports[_0x7001('0x42')]=function(_0x1cd14a,_0x40d4c9){return db[_0x7001('0x29')][_0x7001('0x42')](_0x1cd14a[_0x7001('0x43')],{})[_0x7001('0x1f')](function(_0x5c0928){var _0x2de468=_0x1cd14a['user']['get']({'plain':!![]});if(!_0x2de468)throw new Error(_0x7001('0x44'));if(_0x2de468['role']==='user'){var _0xcfffb7=_0x5c0928[_0x7001('0x45')]({'plain':!![]});var _0x2f05cf=_0x7001('0x21');return db[_0x7001('0x46')][_0x7001('0x47')]({'where':{'name':_0x2f05cf,'userProfileId':_0x2de468[_0x7001('0x48')]},'raw':!![]})[_0x7001('0x1f')](function(_0x3a466e){if(_0x3a466e&&_0x3a466e[_0x7001('0x49')]===0x0){return db[_0x7001('0x22')][_0x7001('0x42')]({'name':_0xcfffb7[_0x7001('0x26')],'resourceId':_0xcfffb7['id'],'type':_0x3a466e[_0x7001('0x26')],'sectionId':_0x3a466e['id']},{})['then'](function(){return _0x5c0928;});}else{return _0x5c0928;}})['catch'](function(_0x556a5a){logger[_0x7001('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x556a5a);throw _0x556a5a;});}return _0x5c0928;})[_0x7001('0x1f')](respondWithResult(_0x40d4c9,0xc9))[_0x7001('0x3f')](handleError(_0x40d4c9,null));};exports[_0x7001('0x4a')]=function(_0x447005,_0x2b08b9){if(_0x447005[_0x7001('0x43')]['id']){delete _0x447005[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x447005[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x2b08b9,null))['then'](saveUpdates(_0x447005['body'],null))[_0x7001('0x1f')](respondWithResult(_0x2b08b9,null))[_0x7001('0x3f')](handleError(_0x2b08b9,null));};exports[_0x7001('0x20')]=function(_0x141337,_0x5227af){return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x141337[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x5227af,null))[_0x7001('0x1f')](removeEntity(_0x5227af,null))[_0x7001('0x3f')](handleError(_0x5227af,null));};exports[_0x7001('0x4b')]=function(_0x299346,_0x43ed0e,_0x1ca2cf){if(_0x299346[_0x7001('0x43')]['id']){delete _0x299346[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')]['find']({'where':{'id':_0x299346['params']['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x43ed0e,null))['then'](function(_0x280c03){if(_0x280c03){_0x299346['body']['TriggerAllId']=_0x280c03['id'];return db[_0x7001('0x4c')]['create'](_0x299346['body']);}})[_0x7001('0x1f')](respondWithResult(_0x43ed0e,null))[_0x7001('0x3f')](handleError(_0x43ed0e,null));};exports[_0x7001('0x4d')]=function(_0x33492f,_0x5a3999,_0x28e2ca){if(_0x33492f[_0x7001('0x43')]['id']){delete _0x33492f[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x33492f['params']['id']}})['then'](handleEntityNotFound(_0x5a3999,null))['then'](function(_0x19bf96){if(_0x19bf96){_0x33492f[_0x7001('0x43')][_0x7001('0x4e')]=_0x19bf96['id'];return db[_0x7001('0x4c')][_0x7001('0x42')](_0x33492f['body']);}})['then'](respondWithResult(_0x5a3999,null))['catch'](handleError(_0x5a3999,null));};exports['getAllConditions']=function(_0xe97ce5,_0x2d572e,_0x558ca8){var _0x193475={};var _0x4bb75a={};var _0x77fe72;var _0x2f103b;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0xe97ce5[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x2d572e,null))[_0x7001('0x1f')](function(_0x3e3357){if(_0x3e3357){_0x77fe72=_0x3e3357;_0x4bb75a[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x4c')]['rawAttributes']);_0x4bb75a[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0xe97ce5[_0x7001('0x2c')]);_0x4bb75a['filters']=_['intersection'](_0x4bb75a[_0x7001('0x2f')],_0x4bb75a[_0x7001('0x2c')]);_0x193475[_0x7001('0x30')]=_[_0x7001('0x31')](_0x4bb75a[_0x7001('0x2f')],qs['fields'](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x32')]));_0x193475['attributes']=_0x193475[_0x7001('0x30')]['length']?_0x193475[_0x7001('0x30')]:_0x4bb75a[_0x7001('0x2f')];_0x193475['order']=qs[_0x7001('0x36')](_0xe97ce5['query'][_0x7001('0x36')]);_0x193475[_0x7001('0x37')]=qs['filters'](_[_0x7001('0x50')](_0xe97ce5[_0x7001('0x2c')],_0x4bb75a[_0x7001('0x2e')]));if(_0xe97ce5[_0x7001('0x2c')]['filter']){_0x193475[_0x7001('0x37')]=_[_0x7001('0x39')](_0x193475[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x193475[_0x7001('0x30')],function(_0x5703d7){var _0x3563f1={};_0x3563f1[_0x5703d7]={'$like':'%'+_0xe97ce5[_0x7001('0x2c')][_0x7001('0x38')]+'%'};return _0x3563f1;})});}_0x193475=_[_0x7001('0x39')]({},_0x193475,_0xe97ce5[_0x7001('0x51')]);return _0x77fe72['getAllConditions'](_0x193475);}})['then'](function(_0x894af4){if(_0x894af4){_0x2f103b=_0x894af4[_0x7001('0x33')];if(!_0xe97ce5[_0x7001('0x2c')][_0x7001('0x52')]('nolimit')){_0x193475[_0x7001('0x18')]=qs[_0x7001('0x18')](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x18')]);_0x193475[_0x7001('0x17')]=qs[_0x7001('0x17')](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x17')]);}return _0x77fe72['getAllConditions'](_0x193475);}})[_0x7001('0x1f')](function(_0x2368da){if(_0x2368da){return _0x2368da?{'count':_0x2f103b,'rows':_0x2368da}:null;}})['then'](respondWithResult(_0x2d572e,null))[_0x7001('0x3f')](handleError(_0x2d572e,null));};exports[_0x7001('0x53')]=function(_0x3bf402,_0x162fc1,_0x12e669){var _0x2fa356={};var _0x439c87={};var _0x57e28e;var _0x20ca8e;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0x3bf402[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x162fc1,null))[_0x7001('0x1f')](function(_0x3bb0ce){if(_0x3bb0ce){_0x57e28e=_0x3bb0ce;_0x439c87[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x4c')][_0x7001('0x2a')]);_0x439c87[_0x7001('0x2c')]=_['keys'](_0x3bf402['query']);_0x439c87['filters']=_['intersection'](_0x439c87[_0x7001('0x2f')],_0x439c87[_0x7001('0x2c')]);_0x2fa356[_0x7001('0x30')]=_[_0x7001('0x31')](_0x439c87['model'],qs[_0x7001('0x32')](_0x3bf402[_0x7001('0x2c')][_0x7001('0x32')]));_0x2fa356[_0x7001('0x30')]=_0x2fa356['attributes'][_0x7001('0x33')]?_0x2fa356[_0x7001('0x30')]:_0x439c87[_0x7001('0x2f')];_0x2fa356[_0x7001('0x35')]=qs[_0x7001('0x36')](_0x3bf402[_0x7001('0x2c')]['sort']);_0x2fa356[_0x7001('0x37')]=qs[_0x7001('0x2e')](_['pick'](_0x3bf402[_0x7001('0x2c')],_0x439c87[_0x7001('0x2e')]));if(_0x3bf402[_0x7001('0x2c')][_0x7001('0x38')]){_0x2fa356[_0x7001('0x37')]=_['merge'](_0x2fa356[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x2fa356[_0x7001('0x30')],function(_0xee39f1){var _0x5e06c4={};_0x5e06c4[_0xee39f1]={'$like':'%'+_0x3bf402[_0x7001('0x2c')][_0x7001('0x38')]+'%'};return _0x5e06c4;})});}_0x2fa356=_[_0x7001('0x39')]({},_0x2fa356,_0x3bf402['options']);return _0x57e28e[_0x7001('0x53')](_0x2fa356);}})['then'](function(_0xcc377e){if(_0xcc377e){_0x20ca8e=_0xcc377e['length'];if(!_0x3bf402[_0x7001('0x2c')][_0x7001('0x52')](_0x7001('0x34'))){_0x2fa356[_0x7001('0x18')]=qs[_0x7001('0x18')](_0x3bf402[_0x7001('0x2c')][_0x7001('0x18')]);_0x2fa356[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x3bf402['query'][_0x7001('0x17')]);}return _0x57e28e[_0x7001('0x53')](_0x2fa356);}})['then'](function(_0x258c35){if(_0x258c35){return _0x258c35?{'count':_0x20ca8e,'rows':_0x258c35}:null;}})['then'](respondWithResult(_0x162fc1,null))[_0x7001('0x3f')](handleError(_0x162fc1,null));};exports[_0x7001('0x54')]=function(_0x35abe6,_0x29ddf2,_0x4344c5){if(_0x35abe6['body']['id']){delete _0x35abe6[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')]['find']({'where':{'id':_0x35abe6['params']['id']}})['then'](handleEntityNotFound(_0x29ddf2,null))[_0x7001('0x1f')](function(_0x5ce50a){if(_0x5ce50a){_0x35abe6['body']['TriggerId']=_0x5ce50a['id'];return db[_0x7001('0x55')][_0x7001('0x42')](_0x35abe6['body']);}})[_0x7001('0x1f')](respondWithResult(_0x29ddf2,null))[_0x7001('0x3f')](handleError(_0x29ddf2,null));};exports[_0x7001('0x56')]=function(_0x41a297,_0x4d2410,_0x388a97){var _0xb692a8={};var _0x14ba56={};var _0x4ede06;var _0x4f1cfd;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0x41a297[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x4d2410,null))[_0x7001('0x1f')](function(_0x43c596){if(_0x43c596){_0x4ede06=_0x43c596;_0x14ba56[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x55')]['rawAttributes']);_0x14ba56[_0x7001('0x2c')]=_['keys'](_0x41a297[_0x7001('0x2c')]);_0x14ba56['filters']=_['intersection'](_0x14ba56['model'],_0x14ba56['query']);_0xb692a8[_0x7001('0x30')]=_['intersection'](_0x14ba56[_0x7001('0x2f')],qs['fields'](_0x41a297[_0x7001('0x2c')]['fields']));_0xb692a8[_0x7001('0x30')]=_0xb692a8[_0x7001('0x30')][_0x7001('0x33')]?_0xb692a8[_0x7001('0x30')]:_0x14ba56[_0x7001('0x2f')];_0xb692a8['order']=qs[_0x7001('0x36')](_0x41a297[_0x7001('0x2c')][_0x7001('0x36')]);_0xb692a8[_0x7001('0x37')]=qs[_0x7001('0x2e')](_['pick'](_0x41a297[_0x7001('0x2c')],_0x14ba56['filters']));if(_0x41a297[_0x7001('0x2c')][_0x7001('0x38')]){_0xb692a8[_0x7001('0x37')]=_[_0x7001('0x39')](_0xb692a8[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0xb692a8[_0x7001('0x30')],function(_0x59bff2){var _0x64e63e={};_0x64e63e[_0x59bff2]={'$like':'%'+_0x41a297['query']['filter']+'%'};return _0x64e63e;})});}_0xb692a8=_[_0x7001('0x39')]({},_0xb692a8,_0x41a297[_0x7001('0x51')]);return _0x4ede06[_0x7001('0x56')](_0xb692a8);}})[_0x7001('0x1f')](function(_0x27424b){if(_0x27424b){_0x4f1cfd=_0x27424b['length'];if(!_0x41a297[_0x7001('0x2c')][_0x7001('0x52')](_0x7001('0x34'))){_0xb692a8[_0x7001('0x18')]=qs[_0x7001('0x18')](_0x41a297[_0x7001('0x2c')][_0x7001('0x18')]);_0xb692a8[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x41a297[_0x7001('0x2c')][_0x7001('0x17')]);}return _0x4ede06['getActions'](_0xb692a8);}})[_0x7001('0x1f')](function(_0x43a9b9){if(_0x43a9b9){return _0x43a9b9?{'count':_0x4f1cfd,'rows':_0x43a9b9}:null;}})[_0x7001('0x1f')](respondWithResult(_0x4d2410,null))[_0x7001('0x3f')](handleError(_0x4d2410,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d2f7daa..2f10dc3 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 _0x4350=['../../config/environment','./trigger.attributes','exports','tools_triggers','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4350,0x1d0));var _0x0435=function(_0x127f1e,_0x102361){_0x127f1e=_0x127f1e-0x0;var _0x24a001=_0x4350[_0x127f1e];return _0x24a001;};'use strict';var _=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var logger=require('../../config/logger')(_0x0435('0x2'));var moment=require('moment');var BPromise=require(_0x0435('0x3'));var rp=require(_0x0435('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0435('0x5'));var config=require(_0x0435('0x6'));var attributes=require(_0x0435('0x7'));module[_0x0435('0x8')]=function(_0x58a62d,_0x580eeb){return _0x58a62d['define']('Trigger',attributes,{'tableName':_0x0435('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8388=['path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x564b80,_0x1e201b){var _0x31b5d0=function(_0x35c09c){while(--_0x35c09c){_0x564b80['push'](_0x564b80['shift']());}};_0x31b5d0(++_0x1e201b);}(_0x8388,0x18d));var _0x8838=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x8388[_0xb0fe92];return _0x41787f;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var logger=require(_0x8838('0x2'))(_0x8838('0x3'));var moment=require('moment');var BPromise=require(_0x8838('0x4'));var rp=require(_0x8838('0x5'));var fs=require('fs');var path=require(_0x8838('0x6'));var rimraf=require(_0x8838('0x7'));var config=require(_0x8838('0x8'));var attributes=require('./trigger.attributes');module[_0x8838('0x9')]=function(_0x471568,_0x49cac2){return _0x471568[_0x8838('0xa')](_0x8838('0xb'),attributes,{'tableName':_0x8838('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index adf1674..2393238 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 _0x5583=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','map','include','model','stringify','find','ShowTrigger','moment','bluebird','randomstring','ioredis'];(function(_0x1fc36f,_0x464552){var _0x2856b4=function(_0x2487f3){while(--_0x2487f3){_0x1fc36f['push'](_0x1fc36f['shift']());}};_0x2856b4(++_0x464552);}(_0x5583,0x164));var _0x3558=function(_0x3a7e01,_0x51204c){_0x3a7e01=_0x3a7e01-0x0;var _0x5b8398=_0x5583[_0x3a7e01];return _0x5b8398;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3558('0x0'));var BPromise=require(_0x3558('0x1'));var rs=require(_0x3558('0x2'));var fs=require('fs');var Redis=require(_0x3558('0x3'));var db=require(_0x3558('0x4'))['db'];var utils=require(_0x3558('0x5'));var logger=require(_0x3558('0x6'))(_0x3558('0x7'));var config=require(_0x3558('0x8'));var jayson=require(_0x3558('0x9'));var client=jayson['client'][_0x3558('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x425898,_0x19fc7a,_0x46070e){return new BPromise(function(_0x5ac1c7,_0x3c7b8f){return client[_0x3558('0xb')](_0x425898,_0x46070e)[_0x3558('0xc')](function(_0x5889f7){logger[_0x3558('0xd')]('Trigger,\x20%s,\x20%s',_0x19fc7a,_0x3558('0xe'));logger[_0x3558('0xf')](_0x3558('0x10'),_0x19fc7a,_0x3558('0xe'),JSON['stringify'](_0x5889f7));if(_0x5889f7['error']){if(_0x5889f7[_0x3558('0x11')][_0x3558('0x12')]===0x1f4){logger[_0x3558('0x11')](_0x3558('0x13'),_0x19fc7a,_0x5889f7[_0x3558('0x11')]['message']);return _0x3c7b8f(_0x5889f7['error'][_0x3558('0x14')]);}logger[_0x3558('0x11')](_0x3558('0x13'),_0x19fc7a,_0x5889f7[_0x3558('0x11')][_0x3558('0x14')]);return _0x5ac1c7(_0x5889f7[_0x3558('0x11')]['message']);}else{logger['info'](_0x3558('0x13'),_0x19fc7a,_0x3558('0xe'));_0x5ac1c7(_0x5889f7[_0x3558('0x15')][_0x3558('0x14')]);}})[_0x3558('0x16')](function(_0x5b0192){logger['error'](_0x3558('0x13'),_0x19fc7a,_0x5b0192);_0x3c7b8f(_0x5b0192);});});}exports[_0x3558('0x17')]=function(_0x2153da){var _0x59819f=this;return new Promise(function(_0x5209d5,_0x29f35a){return db[_0x3558('0x18')]['findAll']({'raw':_0x2153da[_0x3558('0x19')]?_0x2153da[_0x3558('0x19')][_0x3558('0x1a')]===undefined?!![]:![]:!![],'where':_0x2153da[_0x3558('0x19')]?_0x2153da[_0x3558('0x19')][_0x3558('0x1b')]||null:null,'attributes':_0x2153da[_0x3558('0x19')]?_0x2153da['options'][_0x3558('0x1c')]||null:null,'limit':_0x2153da[_0x3558('0x19')]?_0x2153da[_0x3558('0x19')][_0x3558('0x1d')]||null:null,'include':_0x2153da['options']?_0x2153da['options']['include']?_[_0x3558('0x1e')](_0x2153da[_0x3558('0x19')][_0x3558('0x1f')],function(_0x3a11f5){return{'model':db[_0x3a11f5[_0x3558('0x20')]],'as':_0x3a11f5['as'],'attributes':_0x3a11f5[_0x3558('0x1c')],'include':_0x3a11f5['include']?_[_0x3558('0x1e')](_0x3a11f5[_0x3558('0x1f')],function(_0x3ac1e0){return{'model':db[_0x3ac1e0[_0x3558('0x20')]],'as':_0x3ac1e0['as'],'attributes':_0x3ac1e0['attributes'],'include':_0x3ac1e0[_0x3558('0x1f')]?_[_0x3558('0x1e')](_0x3ac1e0[_0x3558('0x1f')],function(_0x3fa70e){return{'model':db[_0x3fa70e[_0x3558('0x20')]],'as':_0x3fa70e['as'],'attributes':_0x3fa70e[_0x3558('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3558('0xc')](function(_0x367d06){logger['info']('GetTrigger',_0x2153da);logger[_0x3558('0xf')]('GetTrigger',_0x2153da,JSON[_0x3558('0x21')](_0x367d06));_0x5209d5(_0x367d06);})[_0x3558('0x16')](function(_0x275bae){logger['error'](_0x3558('0x17'),_0x275bae[_0x3558('0x14')],_0x2153da);_0x29f35a(_0x59819f['error'](0x1f4,_0x275bae['message']));});});};exports['ShowTrigger']=function(_0x375698){var _0x391fb8=this;return new Promise(function(_0x46b0bd,_0x427384){return db[_0x3558('0x18')][_0x3558('0x22')]({'raw':_0x375698['options']?_0x375698[_0x3558('0x19')][_0x3558('0x1a')]===undefined?!![]:![]:!![],'where':_0x375698[_0x3558('0x19')]?_0x375698[_0x3558('0x19')]['where']||null:null,'attributes':_0x375698['options']?_0x375698['options']['attributes']||null:null,'include':_0x375698[_0x3558('0x19')]?_0x375698[_0x3558('0x19')]['include']?_[_0x3558('0x1e')](_0x375698[_0x3558('0x19')][_0x3558('0x1f')],function(_0x4dab76){return{'model':db[_0x4dab76[_0x3558('0x20')]],'as':_0x4dab76['as'],'attributes':_0x4dab76['attributes'],'include':_0x4dab76[_0x3558('0x1f')]?_[_0x3558('0x1e')](_0x4dab76[_0x3558('0x1f')],function(_0x3da0c1){return{'model':db[_0x3da0c1['model']],'as':_0x3da0c1['as'],'attributes':_0x3da0c1[_0x3558('0x1c')],'include':_0x3da0c1[_0x3558('0x1f')]?_[_0x3558('0x1e')](_0x3da0c1[_0x3558('0x1f')],function(_0x3d64f6){return{'model':db[_0x3d64f6['model']],'as':_0x3d64f6['as'],'attributes':_0x3d64f6[_0x3558('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3558('0xc')](function(_0x35edb1){logger[_0x3558('0xd')](_0x3558('0x23'),_0x375698);logger['debug'](_0x3558('0x23'),_0x375698,JSON[_0x3558('0x21')](_0x35edb1));_0x46b0bd(_0x35edb1);})[_0x3558('0x16')](function(_0x26f024){logger[_0x3558('0x11')](_0x3558('0x23'),_0x26f024[_0x3558('0x14')],_0x375698);_0x427384(_0x391fb8[_0x3558('0x11')](0x1f4,_0x26f024[_0x3558('0x14')]));});});}; \ No newline at end of file +var _0x9319=['options','where','attributes','limit','include','map','model','stringify','ShowTrigger','find','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','GetTrigger','Trigger'];(function(_0x39834d,_0x4fa4c8){var _0x336d1c=function(_0x5be459){while(--_0x5be459){_0x39834d['push'](_0x39834d['shift']());}};_0x336d1c(++_0x4fa4c8);}(_0x9319,0x87));var _0x9931=function(_0x52f729,_0x276346){_0x52f729=_0x52f729-0x0;var _0x10030b=_0x9319[_0x52f729];return _0x10030b;};'use strict';var _=require('lodash');var util=require(_0x9931('0x0'));var moment=require(_0x9931('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9931('0x2'));var db=require(_0x9931('0x3'))['db'];var utils=require(_0x9931('0x4'));var logger=require('../../config/logger')(_0x9931('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9931('0x6')][_0x9931('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23200b,_0x3a2881,_0x100b7a){return new BPromise(function(_0xe467f0,_0x147cb5){return client[_0x9931('0x8')](_0x23200b,_0x100b7a)[_0x9931('0x9')](function(_0x2a49db){logger[_0x9931('0xa')](_0x9931('0xb'),_0x3a2881,_0x9931('0xc'));logger[_0x9931('0xd')](_0x9931('0xe'),_0x3a2881,_0x9931('0xc'),JSON['stringify'](_0x2a49db));if(_0x2a49db[_0x9931('0xf')]){if(_0x2a49db[_0x9931('0xf')][_0x9931('0x10')]===0x1f4){logger['error'](_0x9931('0xb'),_0x3a2881,_0x2a49db[_0x9931('0xf')]['message']);return _0x147cb5(_0x2a49db['error'][_0x9931('0x11')]);}logger[_0x9931('0xf')](_0x9931('0xb'),_0x3a2881,_0x2a49db[_0x9931('0xf')]['message']);return _0xe467f0(_0x2a49db[_0x9931('0xf')]['message']);}else{logger[_0x9931('0xa')]('Trigger,\x20%s,\x20%s',_0x3a2881,_0x9931('0xc'));_0xe467f0(_0x2a49db['result']['message']);}})['catch'](function(_0x5ef5bb){logger[_0x9931('0xf')](_0x9931('0xb'),_0x3a2881,_0x5ef5bb);_0x147cb5(_0x5ef5bb);});});}exports[_0x9931('0x12')]=function(_0x5ca5c5){var _0x5061c8=this;return new Promise(function(_0x35db31,_0x21a936){return db[_0x9931('0x13')]['findAll']({'raw':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ca5c5['options']?_0x5ca5c5['options'][_0x9931('0x15')]||null:null,'attributes':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5['options'][_0x9931('0x16')]||null:null,'limit':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5[_0x9931('0x14')][_0x9931('0x17')]||null:null,'include':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5[_0x9931('0x14')][_0x9931('0x18')]?_[_0x9931('0x19')](_0x5ca5c5[_0x9931('0x14')]['include'],function(_0x2e4f2b){return{'model':db[_0x2e4f2b[_0x9931('0x1a')]],'as':_0x2e4f2b['as'],'attributes':_0x2e4f2b['attributes'],'include':_0x2e4f2b['include']?_['map'](_0x2e4f2b[_0x9931('0x18')],function(_0x768db4){return{'model':db[_0x768db4[_0x9931('0x1a')]],'as':_0x768db4['as'],'attributes':_0x768db4[_0x9931('0x16')],'include':_0x768db4['include']?_[_0x9931('0x19')](_0x768db4['include'],function(_0x507b73){return{'model':db[_0x507b73[_0x9931('0x1a')]],'as':_0x507b73['as'],'attributes':_0x507b73[_0x9931('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9931('0x9')](function(_0x4cd9a0){logger[_0x9931('0xa')](_0x9931('0x12'),_0x5ca5c5);logger[_0x9931('0xd')](_0x9931('0x12'),_0x5ca5c5,JSON[_0x9931('0x1b')](_0x4cd9a0));_0x35db31(_0x4cd9a0);})['catch'](function(_0x39d13a){logger[_0x9931('0xf')](_0x9931('0x12'),_0x39d13a[_0x9931('0x11')],_0x5ca5c5);_0x21a936(_0x5061c8['error'](0x1f4,_0x39d13a[_0x9931('0x11')]));});});};exports[_0x9931('0x1c')]=function(_0xfa3c30){var _0x34f8aa=this;return new Promise(function(_0x479228,_0x337557){return db['Trigger'][_0x9931('0x1d')]({'raw':_0xfa3c30[_0x9931('0x14')]?_0xfa3c30[_0x9931('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xfa3c30['options']?_0xfa3c30['options'][_0x9931('0x15')]||null:null,'attributes':_0xfa3c30[_0x9931('0x14')]?_0xfa3c30[_0x9931('0x14')][_0x9931('0x16')]||null:null,'include':_0xfa3c30['options']?_0xfa3c30['options'][_0x9931('0x18')]?_[_0x9931('0x19')](_0xfa3c30[_0x9931('0x14')][_0x9931('0x18')],function(_0x11be44){return{'model':db[_0x11be44[_0x9931('0x1a')]],'as':_0x11be44['as'],'attributes':_0x11be44[_0x9931('0x16')],'include':_0x11be44['include']?_['map'](_0x11be44[_0x9931('0x18')],function(_0x108eea){return{'model':db[_0x108eea['model']],'as':_0x108eea['as'],'attributes':_0x108eea[_0x9931('0x16')],'include':_0x108eea[_0x9931('0x18')]?_[_0x9931('0x19')](_0x108eea[_0x9931('0x18')],function(_0x3536a0){return{'model':db[_0x3536a0[_0x9931('0x1a')]],'as':_0x3536a0['as'],'attributes':_0x3536a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9931('0x9')](function(_0x2104e7){logger['info'](_0x9931('0x1c'),_0xfa3c30);logger[_0x9931('0xd')]('ShowTrigger',_0xfa3c30,JSON[_0x9931('0x1b')](_0x2104e7));_0x479228(_0x2104e7);})[_0x9931('0x1e')](function(_0xf4798e){logger[_0x9931('0xf')](_0x9931('0x1c'),_0xf4798e[_0x9931('0x11')],_0xfa3c30);_0x337557(_0x34f8aa[_0x9931('0xf')](0x1f4,_0xf4798e[_0x9931('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 650a6d0..bd05a62 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 _0xeb10=['index','post','clone','create','put','/:id','update','delete','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x499108,_0x30b78e){var _0x288713=function(_0x5e0cbb){while(--_0x5e0cbb){_0x499108['push'](_0x499108['shift']());}};_0x288713(++_0x30b78e);}(_0xeb10,0x1dd));var _0x0eb1=function(_0x3bfe99,_0x3b9b4c){_0x3bfe99=_0x3bfe99-0x0;var _0xeb466f=_0xeb10[_0x3bfe99];return _0xeb466f;};'use strict';var multer=require(_0x0eb1('0x0'));var util=require('util');var path=require(_0x0eb1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0eb1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0eb1('0x3'));var interaction=require(_0x0eb1('0x4'));var config=require(_0x0eb1('0x5'));var controller=require(_0x0eb1('0x6'));router[_0x0eb1('0x7')]('/',auth[_0x0eb1('0x8')](),controller[_0x0eb1('0x9')]);router[_0x0eb1('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0eb1('0xa')]('/:id/clone',auth[_0x0eb1('0x8')](),controller[_0x0eb1('0xb')]);router[_0x0eb1('0xa')]('/',auth['isAuthenticated'](),controller[_0x0eb1('0xc')]);router[_0x0eb1('0xd')](_0x0eb1('0xe'),auth[_0x0eb1('0x8')](),controller[_0x0eb1('0xf')]);router[_0x0eb1('0x10')](_0x0eb1('0xe'),auth[_0x0eb1('0x8')](),controller[_0x0eb1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0da4=['../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6bc02f,_0x53a4ed){var _0xa3f53e=function(_0x199a79){while(--_0x199a79){_0x6bc02f['push'](_0x6bc02f['shift']());}};_0xa3f53e(++_0x53a4ed);}(_0x0da4,0x1d8));var _0x40da=function(_0x192aa7,_0x160e97){_0x192aa7=_0x192aa7-0x0;var _0x2bfe6e=_0x0da4[_0x192aa7];return _0x2bfe6e;};'use strict';var multer=require(_0x40da('0x0'));var util=require(_0x40da('0x1'));var path=require(_0x40da('0x2'));var timeout=require(_0x40da('0x3'));var express=require(_0x40da('0x4'));var router=express[_0x40da('0x5')]();var fs_extra=require(_0x40da('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x40da('0x7'));var config=require(_0x40da('0x8'));var controller=require(_0x40da('0x9'));router[_0x40da('0xa')]('/',auth[_0x40da('0xb')](),controller[_0x40da('0xc')]);router[_0x40da('0xa')](_0x40da('0xd'),auth[_0x40da('0xb')](),controller[_0x40da('0xe')]);router['post'](_0x40da('0xf'),auth[_0x40da('0xb')](),controller[_0x40da('0x10')]);router[_0x40da('0x11')]('/',auth[_0x40da('0xb')](),controller[_0x40da('0x12')]);router[_0x40da('0x13')](_0x40da('0xd'),auth['isAuthenticated'](),controller[_0x40da('0x14')]);router[_0x40da('0x15')](_0x40da('0xd'),auth['isAuthenticated'](),controller[_0x40da('0x16')]);module[_0x40da('0x17')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 497ac35..263c84b 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 _0xd79c=['accept','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','always'];(function(_0x3120f4,_0x513570){var _0x4a1d63=function(_0x75825f){while(--_0x75825f){_0x3120f4['push'](_0x3120f4['shift']());}};_0x4a1d63(++_0x513570);}(_0xd79c,0x14a));var _0xcd79=function(_0x10f1ab,_0x453815){_0x10f1ab=_0x10f1ab-0x0;var _0x421001=_0xd79c[_0x10f1ab];return _0x421001;};'use strict';var Sequelize=require('sequelize');module[_0xcd79('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcd79('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x3'),_0xcd79('0x4'),_0xcd79('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcd79('0x6')},'callingpres':{'type':Sequelize[_0xcd79('0x2')]('ALLOWED_NOT_SCREENED',_0xcd79('0x7'),_0xcd79('0x8'),_0xcd79('0x9'),_0xcd79('0xa'),'PROHIB_PASSED_SCREEN',_0xcd79('0xb'),_0xcd79('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xcd79('0xd')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xcd79('0xd')]},'remotesecret':{'type':Sequelize[_0xcd79('0xd')]},'transport':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':_0xcd79('0xe'),'set':function(_0x197794){this[_0xcd79('0xf')](_0xcd79('0x10'),_0x197794?_0x197794[_0xcd79('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xcd79('0x10'))?this[_0xcd79('0x12')](_0xcd79('0x10'))[_0xcd79('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x14'),_0xcd79('0x15'),_0xcd79('0x16'),_0xcd79('0x17'),_0xcd79('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xcd79('0x19'),'no',_0xcd79('0x1a'),_0xcd79('0x1b'),_0xcd79('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xcd79('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xcd79('0xd')]},'nat':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':_0xcd79('0x1d'),'set':function(_0x1d9f32){this[_0xcd79('0xf')](_0xcd79('0x1e'),_0x1d9f32?_0x1d9f32[_0xcd79('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xcd79('0x1e'))?this[_0xcd79('0x12')](_0xcd79('0x1e'))[_0xcd79('0x13')](','):null;},'comment':_0xcd79('0x1f')},'callgroup':{'type':Sequelize[_0xcd79('0xd')]},'namedcallgroup':{'type':Sequelize[_0xcd79('0xd')]},'pickupgroup':{'type':Sequelize[_0xcd79('0xd')]},'namedpickupgroup':{'type':Sequelize[_0xcd79('0xd')]},'language':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcd79('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':_0xcd79('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcd79('0x21'),'set':function(_0x313dfa){this[_0xcd79('0xf')](_0xcd79('0x22'),_0x313dfa?_0x313dfa['join'](';'):_0xcd79('0x21'));},'get':function(){return this['getDataValue'](_0xcd79('0x22'))?this['getDataValue'](_0xcd79('0x22'))['split'](';'):null;},'comment':_0xcd79('0x23')},'autoframing':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'insecure':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':_0xcd79('0x24'),'set':function(_0xaa8b56){this[_0xcd79('0xf')](_0xcd79('0x25'),_0xaa8b56?_0xaa8b56[_0xcd79('0x11')](','):null);},'get':function(){return this[_0xcd79('0x12')](_0xcd79('0x25'))?this['getDataValue'](_0xcd79('0x25'))[_0xcd79('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcd79('0x2')]('yes','no',_0xcd79('0x26'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'accountcode':{'type':Sequelize[_0xcd79('0x27')](0xb)},'setvar':{'type':Sequelize[_0xcd79('0xd')]},'callerid':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xcd79('0xd')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xcd79('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xcd79('0xd')]},'template':{'type':Sequelize[_0xcd79('0xd')]},'videosupport':{'type':Sequelize[_0xcd79('0x2')]('yes','no',_0xcd79('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcd79('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xcd79('0x19'),'no')},'mailbox':{'type':Sequelize[_0xcd79('0xd')]},'session_timers':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x29'),'refuse','originate')},'session_expires':{'type':Sequelize[_0xcd79('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xcd79('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xcd79('0x2a'),'uas'),'defaultValue':_0xcd79('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xcd79('0xd')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xcd79('0xd')]},'fromuser':{'type':Sequelize[_0xcd79('0xd')]},'port':{'type':Sequelize[_0xcd79('0x27')](0x5)},'qualify':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no'),'defaultValue':_0xcd79('0x19')},'keepalive':{'type':Sequelize[_0xcd79('0x27')](0xb)},'defaultip':{'type':Sequelize[_0xcd79('0xd')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xcd79('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xcd79('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xcd79('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xcd79('0x2')]('yes','no',_0xcd79('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcd79('0xd')]},'callbackextension':{'type':Sequelize[_0xcd79('0xd')]},'timert1':{'type':Sequelize[_0xcd79('0x27')](0xb)},'timerb':{'type':Sequelize[_0xcd79('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xcd79('0xd')]},'contactacl':{'type':Sequelize[_0xcd79('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0xcd79('0xd')]},'use_q850_reason':{'type':Sequelize[_0xcd79('0xd')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'force_avp':{'type':Sequelize[_0xcd79('0x2')]('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0xcd79('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xcd79('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no',_0xcd79('0x2d'),_0xcd79('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xcd79('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xcd79('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0xcd79('0xd')]},'dtlscipher':{'type':Sequelize[_0xcd79('0xd')]},'dtlscafile':{'type':Sequelize[_0xcd79('0xd')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x2f'),_0xcd79('0x30'),_0xcd79('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcd79('0xd')]},'usereqphone':{'type':Sequelize['ENUM'](_0xcd79('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xcd79('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no')},'vmexten':{'type':Sequelize[_0xcd79('0xd')]},'mohinterpret':{'type':Sequelize[_0xcd79('0xd')]},'mohsuggest':{'type':Sequelize[_0xcd79('0xd')]},'parkinglot':{'type':Sequelize[_0xcd79('0xd')]},'description':{'type':Sequelize[_0xcd79('0xd')]},'host':{'type':Sequelize[_0xcd79('0xd')],'defaultValue':_0xcd79('0x32')},'canreinvite':{'type':Sequelize[_0xcd79('0x2')](_0xcd79('0x19'),'no',_0xcd79('0x1a'),_0xcd79('0x1b'),_0xcd79('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xcd79('0xd')]},'active':{'type':Sequelize[_0xcd79('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xe7f0=['passive','actpass','update,nonat','exports','name','ENUM','user','peer','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xe7f0,0x147));var _0x0e7f=function(_0x928b87,_0x53480a){_0x928b87=_0x928b87-0x0;var _0x1e7638=_0xe7f0[_0x928b87];return _0x1e7638;};'use strict';var Sequelize=require('sequelize');module[_0x0e7f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0e7f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0e7f('0x2')]('friend',_0x0e7f('0x3'),_0x0e7f('0x4')),'allowNull':![],'defaultValue':_0x0e7f('0x5')},'context':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':![],'defaultValue':_0x0e7f('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x0e7f('0x8'),_0x0e7f('0x9'),'ALLOWED_FAILED_SCREEN',_0x0e7f('0xa'),_0x0e7f('0xb'),_0x0e7f('0xc'),_0x0e7f('0xd'),_0x0e7f('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0e7f('0x6')]},'secret':{'type':Sequelize[_0x0e7f('0x6')]},'md5secret':{'type':Sequelize[_0x0e7f('0x6')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':'udp','set':function(_0x1b248b){this[_0x0e7f('0xf')](_0x0e7f('0x10'),_0x1b248b?_0x1b248b[_0x0e7f('0x11')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x0e7f('0x12')]('transport')[_0x0e7f('0x13')](','):null;},'comment':_0x0e7f('0x14')},'dtmfmode':{'type':Sequelize[_0x0e7f('0x2')]('rfc2833',_0x0e7f('0x15'),_0x0e7f('0x16'),_0x0e7f('0x17'),_0x0e7f('0x18')),'defaultValue':_0x0e7f('0x19')},'directmedia':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no',_0x0e7f('0x1b'),_0x0e7f('0x1c'),_0x0e7f('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0e7f('0x6')]},'directmediadeny':{'type':Sequelize[_0x0e7f('0x6')]},'nat':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':_0x0e7f('0x1e'),'set':function(_0x3a527a){this[_0x0e7f('0xf')](_0x0e7f('0x1f'),_0x3a527a?_0x3a527a[_0x0e7f('0x11')](','):null);},'get':function(){return this[_0x0e7f('0x12')](_0x0e7f('0x1f'))?this[_0x0e7f('0x12')](_0x0e7f('0x1f'))['split'](','):null;},'comment':_0x0e7f('0x20')},'callgroup':{'type':Sequelize[_0x0e7f('0x6')]},'namedcallgroup':{'type':Sequelize[_0x0e7f('0x6')]},'pickupgroup':{'type':Sequelize[_0x0e7f('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x0e7f('0x6')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':_0x0e7f('0x21')},'allow':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':![],'defaultValue':_0x0e7f('0x22'),'set':function(_0x229709){this[_0x0e7f('0xf')]('allow',_0x229709?_0x229709['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x0e7f('0x12')](_0x0e7f('0x23'))?this[_0x0e7f('0x12')](_0x0e7f('0x23'))[_0x0e7f('0x13')](';'):null;},'comment':_0x0e7f('0x24')},'autoframing':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0e7f('0x25'),'set':function(_0x1892e0){this[_0x0e7f('0xf')](_0x0e7f('0x26'),_0x1892e0?_0x1892e0[_0x0e7f('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x0e7f('0x26'))?this[_0x0e7f('0x12')](_0x0e7f('0x26'))[_0x0e7f('0x13')](','):null;},'comment':_0x0e7f('0x27')},'trustrpid':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'setvar':{'type':Sequelize[_0x0e7f('0x6')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x0e7f('0x29')},'amaflags':{'type':Sequelize[_0x0e7f('0x6')]},'callcounter':{'type':Sequelize[_0x0e7f('0x2')]('yes','no'),'defaultValue':_0x0e7f('0x1a')},'busylevel':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x0e7f('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no',_0x0e7f('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x0e7f('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0x0e7f('0x2b'),_0x0e7f('0x2c'),_0x0e7f('0x2d'))},'session_expires':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x2e'),_0x0e7f('0x2f')),'defaultValue':_0x0e7f('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0x0e7f('0x6')]},'regexten':{'type':Sequelize[_0x0e7f('0x6')]},'fromdomain':{'type':Sequelize[_0x0e7f('0x6')]},'fromuser':{'type':Sequelize[_0x0e7f('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0e7f('0x6')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x0e7f('0x2')]('yes','no',_0x0e7f('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e7f('0x6')]},'callbackextension':{'type':Sequelize[_0x0e7f('0x6')]},'timert1':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'timerb':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x0e7f('0x6')]},'contactdeny':{'type':Sequelize[_0x0e7f('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0e7f('0x6')]},'use_q850_reason':{'type':Sequelize[_0x0e7f('0x6')]},'maxforwards':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'encryption':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x0e7f('0x31'))},'dtlsrekey':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0e7f('0x6')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x0e7f('0x6')]},'dtlscafile':{'type':Sequelize[_0x0e7f('0x6')]},'dtlscapath':{'type':Sequelize[_0x0e7f('0x6')]},'dtlssetup':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x32'),_0x0e7f('0x33'),_0x0e7f('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0e7f('0x6')]},'usereqphone':{'type':Sequelize[_0x0e7f('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e7f('0x6')]},'recordofffeature':{'type':Sequelize[_0x0e7f('0x6')]},'call_limit':{'type':Sequelize[_0x0e7f('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x0e7f('0x6')]},'mohinterpret':{'type':Sequelize[_0x0e7f('0x6')]},'mohsuggest':{'type':Sequelize[_0x0e7f('0x6')]},'parkinglot':{'type':Sequelize[_0x0e7f('0x6')]},'description':{'type':Sequelize[_0x0e7f('0x6')]},'host':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no','nonat',_0x0e7f('0x1c'),_0x0e7f('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0e7f('0x6')]},'otherFields':{'type':Sequelize[_0x0e7f('0x6')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 26af446..44f21d3 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 _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x127446,_0x748577){var _0x1efa67=function(_0x2aff5a){while(--_0x2aff5a){_0x127446['push'](_0x127446['shift']());}};_0x1efa67(++_0x748577);}(_0xb821,0xa7));var _0x1b82=function(_0xc1b19e,_0xcc9e08){_0xc1b19e=_0xc1b19e-0x0;var _0x142117=_0xb821[_0xc1b19e];return _0x142117;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x52246c,_0x32403f){var _0x3a690c=function(_0x182b60){while(--_0x182b60){_0x52246c['push'](_0x52246c['shift']());}};_0x3a690c(++_0x32403f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x24ca[_0x439d59];return _0x3670c7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 5af997d..28fb468 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 _0x5925=['./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4711d0,_0x50cfa3){var _0x3b5283=function(_0x2d811a){while(--_0x2d811a){_0x4711d0['push'](_0x4711d0['shift']());}};_0x3b5283(++_0x50cfa3);}(_0x5925,0x1f3));var _0x5592=function(_0x3db0ba,_0x2be65c){_0x3db0ba=_0x3db0ba-0x0;var _0x2d8e9a=_0x5925[_0x3db0ba];return _0x2d8e9a;};'use strict';var _=require(_0x5592('0x0'));var util=require(_0x5592('0x1'));var logger=require(_0x5592('0x2'))('api');var moment=require(_0x5592('0x3'));var BPromise=require(_0x5592('0x4'));var rp=require(_0x5592('0x5'));var fs=require('fs');var path=require(_0x5592('0x6'));var rimraf=require(_0x5592('0x7'));var config=require('../../config/environment');var attributes=require(_0x5592('0x8'));module[_0x5592('0x9')]=function(_0x52611b,_0x266303){return _0x52611b[_0x5592('0xa')](_0x5592('0xb'),attributes,{'tableName':_0x5592('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76bd=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x4764c6,_0x34f9ec){var _0x345475=function(_0x15f7fc){while(--_0x15f7fc){_0x4764c6['push'](_0x4764c6['shift']());}};_0x345475(++_0x34f9ec);}(_0x76bd,0x141));var _0xd76b=function(_0x2977a6,_0x551716){_0x2977a6=_0x2977a6-0x0;var _0x3322ee=_0x76bd[_0x2977a6];return _0x3322ee;};'use strict';var _=require(_0xd76b('0x0'));var util=require(_0xd76b('0x1'));var logger=require(_0xd76b('0x2'))(_0xd76b('0x3'));var moment=require(_0xd76b('0x4'));var BPromise=require(_0xd76b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd76b('0x6'));var rimraf=require(_0xd76b('0x7'));var config=require(_0xd76b('0x8'));var attributes=require(_0xd76b('0x9'));module[_0xd76b('0xa')]=function(_0x23a7c6,_0x328df6){return _0x23a7c6[_0xd76b('0xb')](_0xd76b('0xc'),attributes,{'tableName':_0xd76b('0xd'),'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 957a6c8..6d29afe 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 _0xf159=['attributes','limit','include','map','model','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0xf159,0x151));var _0x9f15=function(_0x485b4c,_0x73b954){_0x485b4c=_0x485b4c-0x0;var _0x404524=_0xf159[_0x485b4c];return _0x404524;};'use strict';var _=require('lodash');var util=require(_0x9f15('0x0'));var moment=require(_0x9f15('0x1'));var BPromise=require(_0x9f15('0x2'));var rs=require(_0x9f15('0x3'));var fs=require('fs');var Redis=require(_0x9f15('0x4'));var db=require(_0x9f15('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9f15('0x6'));var jayson=require(_0x9f15('0x7'));var client=jayson[_0x9f15('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23b838,_0x1bbbfa,_0x3f6051){return new BPromise(function(_0xe40550,_0x515e59){return client['request'](_0x23b838,_0x3f6051)[_0x9f15('0x9')](function(_0x1e3489){logger[_0x9f15('0xa')](_0x9f15('0xb'),_0x1bbbfa,_0x9f15('0xc'));logger[_0x9f15('0xd')](_0x9f15('0xe'),_0x1bbbfa,_0x9f15('0xc'),JSON[_0x9f15('0xf')](_0x1e3489));if(_0x1e3489[_0x9f15('0x10')]){if(_0x1e3489['error'][_0x9f15('0x11')]===0x1f4){logger[_0x9f15('0x10')](_0x9f15('0xb'),_0x1bbbfa,_0x1e3489[_0x9f15('0x10')][_0x9f15('0x12')]);return _0x515e59(_0x1e3489[_0x9f15('0x10')][_0x9f15('0x12')]);}logger['error'](_0x9f15('0xb'),_0x1bbbfa,_0x1e3489[_0x9f15('0x10')][_0x9f15('0x12')]);return _0xe40550(_0x1e3489[_0x9f15('0x10')][_0x9f15('0x12')]);}else{logger['info'](_0x9f15('0xb'),_0x1bbbfa,_0x9f15('0xc'));_0xe40550(_0x1e3489[_0x9f15('0x13')][_0x9f15('0x12')]);}})[_0x9f15('0x14')](function(_0x2ecf6a){logger[_0x9f15('0x10')]('Trunk,\x20%s,\x20%s',_0x1bbbfa,_0x2ecf6a);_0x515e59(_0x2ecf6a);});});}exports[_0x9f15('0x15')]=function(_0x57fa6d){var _0x4ccd10=this;return new Promise(function(_0x498435,_0x7d18fc){return db[_0x9f15('0x16')][_0x9f15('0x17')]({'raw':_0x57fa6d[_0x9f15('0x18')]?_0x57fa6d[_0x9f15('0x18')][_0x9f15('0x19')]===undefined?!![]:![]:!![],'where':_0x57fa6d[_0x9f15('0x18')]?_0x57fa6d[_0x9f15('0x18')]['where']||null:null,'attributes':_0x57fa6d[_0x9f15('0x18')]?_0x57fa6d[_0x9f15('0x18')][_0x9f15('0x1a')]||null:null,'limit':_0x57fa6d['options']?_0x57fa6d['options'][_0x9f15('0x1b')]||null:null,'include':_0x57fa6d[_0x9f15('0x18')]?_0x57fa6d[_0x9f15('0x18')][_0x9f15('0x1c')]?_[_0x9f15('0x1d')](_0x57fa6d[_0x9f15('0x18')]['include'],function(_0x3564db){return{'model':db[_0x3564db[_0x9f15('0x1e')]],'as':_0x3564db['as'],'attributes':_0x3564db[_0x9f15('0x1a')],'include':_0x3564db[_0x9f15('0x1c')]?_[_0x9f15('0x1d')](_0x3564db[_0x9f15('0x1c')],function(_0x4e9064){return{'model':db[_0x4e9064[_0x9f15('0x1e')]],'as':_0x4e9064['as'],'attributes':_0x4e9064[_0x9f15('0x1a')],'include':_0x4e9064['include']?_[_0x9f15('0x1d')](_0x4e9064['include'],function(_0x286506){return{'model':db[_0x286506[_0x9f15('0x1e')]],'as':_0x286506['as'],'attributes':_0x286506['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f15('0x9')](function(_0x4931a0){logger['info'](_0x9f15('0x15'),_0x57fa6d);logger[_0x9f15('0xd')](_0x9f15('0x15'),_0x57fa6d,JSON[_0x9f15('0xf')](_0x4931a0));_0x498435(_0x4931a0);})[_0x9f15('0x14')](function(_0x78db76){logger[_0x9f15('0x10')](_0x9f15('0x15'),_0x78db76[_0x9f15('0x12')],_0x57fa6d);_0x7d18fc(_0x4ccd10[_0x9f15('0x10')](0x1f4,_0x78db76['message']));});});};exports['ShowTrunk']=function(_0xfe9f1b){var _0x2d4a72=this;return new Promise(function(_0xa36b12,_0x2d5950){return db['Trunk'][_0x9f15('0x1f')]({'raw':_0xfe9f1b[_0x9f15('0x18')]?_0xfe9f1b[_0x9f15('0x18')][_0x9f15('0x19')]===undefined?!![]:![]:!![],'where':_0xfe9f1b[_0x9f15('0x18')]?_0xfe9f1b[_0x9f15('0x18')]['where']||null:null,'attributes':_0xfe9f1b[_0x9f15('0x18')]?_0xfe9f1b[_0x9f15('0x18')][_0x9f15('0x1a')]||null:null,'include':_0xfe9f1b['options']?_0xfe9f1b['options'][_0x9f15('0x1c')]?_['map'](_0xfe9f1b[_0x9f15('0x18')][_0x9f15('0x1c')],function(_0x2c9662){return{'model':db[_0x2c9662[_0x9f15('0x1e')]],'as':_0x2c9662['as'],'attributes':_0x2c9662['attributes'],'include':_0x2c9662[_0x9f15('0x1c')]?_[_0x9f15('0x1d')](_0x2c9662[_0x9f15('0x1c')],function(_0x49800c){return{'model':db[_0x49800c['model']],'as':_0x49800c['as'],'attributes':_0x49800c[_0x9f15('0x1a')],'include':_0x49800c['include']?_[_0x9f15('0x1d')](_0x49800c[_0x9f15('0x1c')],function(_0xbe3b4f){return{'model':db[_0xbe3b4f['model']],'as':_0xbe3b4f['as'],'attributes':_0xbe3b4f[_0x9f15('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f15('0x9')](function(_0x2cf784){logger[_0x9f15('0xa')](_0x9f15('0x20'),_0xfe9f1b);logger[_0x9f15('0xd')](_0x9f15('0x20'),_0xfe9f1b,JSON[_0x9f15('0xf')](_0x2cf784));_0xa36b12(_0x2cf784);})[_0x9f15('0x14')](function(_0x40a04d){logger[_0x9f15('0x10')]('ShowTrunk',_0x40a04d[_0x9f15('0x12')],_0xfe9f1b);_0x2d5950(_0x2d4a72['error'](0x1f4,_0x40a04d[_0x9f15('0x12')]));});});}; \ No newline at end of file +var _0xd75e=['catch','GetTrunk','Trunk','findAll','options','where','limit','include','map','model','attributes','info','ShowTrunk','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x525574,_0x36b788){var _0x5b7de0=function(_0x5161b5){while(--_0x5161b5){_0x525574['push'](_0x525574['shift']());}};_0x5b7de0(++_0x36b788);}(_0xd75e,0x1c8));var _0xed75=function(_0x45d85b,_0x231899){_0x45d85b=_0x45d85b-0x0;var _0x48d02a=_0xd75e[_0x45d85b];return _0x48d02a;};'use strict';var _=require(_0xed75('0x0'));var util=require(_0xed75('0x1'));var moment=require(_0xed75('0x2'));var BPromise=require(_0xed75('0x3'));var rs=require(_0xed75('0x4'));var fs=require('fs');var Redis=require(_0xed75('0x5'));var db=require(_0xed75('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xed75('0x7'))(_0xed75('0x8'));var config=require('../../config/environment');var jayson=require(_0xed75('0x9'));var client=jayson[_0xed75('0xa')][_0xed75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244d1b,_0xda6327,_0x3b480d){return new BPromise(function(_0x2765e3,_0x4c6a99){return client[_0xed75('0xc')](_0x244d1b,_0x3b480d)[_0xed75('0xd')](function(_0x1432e4){logger['info'](_0xed75('0xe'),_0xda6327,_0xed75('0xf'));logger[_0xed75('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0xda6327,_0xed75('0xf'),JSON[_0xed75('0x11')](_0x1432e4));if(_0x1432e4[_0xed75('0x12')]){if(_0x1432e4[_0xed75('0x12')]['code']===0x1f4){logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x1432e4[_0xed75('0x12')]['message']);return _0x4c6a99(_0x1432e4['error'][_0xed75('0x13')]);}logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x1432e4[_0xed75('0x12')][_0xed75('0x13')]);return _0x2765e3(_0x1432e4[_0xed75('0x12')][_0xed75('0x13')]);}else{logger['info'](_0xed75('0xe'),_0xda6327,_0xed75('0xf'));_0x2765e3(_0x1432e4['result'][_0xed75('0x13')]);}})[_0xed75('0x14')](function(_0x499b70){logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x499b70);_0x4c6a99(_0x499b70);});});}exports[_0xed75('0x15')]=function(_0x4bd1ec){var _0x167eb9=this;return new Promise(function(_0x3da1c1,_0x5e5b9d){return db[_0xed75('0x16')][_0xed75('0x17')]({'raw':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x19')]||null:null,'attributes':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')]['attributes']||null:null,'limit':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1a')]||null:null,'include':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1b')]?_[_0xed75('0x1c')](_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1b')],function(_0x13b5c7){return{'model':db[_0x13b5c7[_0xed75('0x1d')]],'as':_0x13b5c7['as'],'attributes':_0x13b5c7[_0xed75('0x1e')],'include':_0x13b5c7['include']?_['map'](_0x13b5c7['include'],function(_0x1285b5){return{'model':db[_0x1285b5[_0xed75('0x1d')]],'as':_0x1285b5['as'],'attributes':_0x1285b5[_0xed75('0x1e')],'include':_0x1285b5[_0xed75('0x1b')]?_['map'](_0x1285b5['include'],function(_0x2df883){return{'model':db[_0x2df883[_0xed75('0x1d')]],'as':_0x2df883['as'],'attributes':_0x2df883[_0xed75('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19eb8e){logger[_0xed75('0x1f')]('GetTrunk',_0x4bd1ec);logger[_0xed75('0x10')](_0xed75('0x15'),_0x4bd1ec,JSON['stringify'](_0x19eb8e));_0x3da1c1(_0x19eb8e);})[_0xed75('0x14')](function(_0x3d13ef){logger['error'](_0xed75('0x15'),_0x3d13ef['message'],_0x4bd1ec);_0x5e5b9d(_0x167eb9[_0xed75('0x12')](0x1f4,_0x3d13ef['message']));});});};exports[_0xed75('0x20')]=function(_0x15f522){var _0x4c9fed=this;return new Promise(function(_0x1e2076,_0x24f247){return db[_0xed75('0x16')]['find']({'raw':_0x15f522['options']?_0x15f522[_0xed75('0x18')][_0xed75('0x21')]===undefined?!![]:![]:!![],'where':_0x15f522[_0xed75('0x18')]?_0x15f522['options'][_0xed75('0x19')]||null:null,'attributes':_0x15f522[_0xed75('0x18')]?_0x15f522[_0xed75('0x18')][_0xed75('0x1e')]||null:null,'include':_0x15f522['options']?_0x15f522['options'][_0xed75('0x1b')]?_['map'](_0x15f522[_0xed75('0x18')][_0xed75('0x1b')],function(_0x46aa95){return{'model':db[_0x46aa95[_0xed75('0x1d')]],'as':_0x46aa95['as'],'attributes':_0x46aa95['attributes'],'include':_0x46aa95['include']?_[_0xed75('0x1c')](_0x46aa95[_0xed75('0x1b')],function(_0x22a3bd){return{'model':db[_0x22a3bd[_0xed75('0x1d')]],'as':_0x22a3bd['as'],'attributes':_0x22a3bd[_0xed75('0x1e')],'include':_0x22a3bd[_0xed75('0x1b')]?_[_0xed75('0x1c')](_0x22a3bd[_0xed75('0x1b')],function(_0x3634ec){return{'model':db[_0x3634ec['model']],'as':_0x3634ec['as'],'attributes':_0x3634ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xed75('0xd')](function(_0x45b297){logger[_0xed75('0x1f')]('ShowTrunk',_0x15f522);logger[_0xed75('0x10')](_0xed75('0x20'),_0x15f522,JSON[_0xed75('0x11')](_0x45b297));_0x1e2076(_0x45b297);})[_0xed75('0x14')](function(_0x1b0d37){logger[_0xed75('0x12')](_0xed75('0x20'),_0x1b0d37['message'],_0x15f522);_0x24f247(_0x4c9fed['error'](0x1f4,_0x1b0d37[_0xed75('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 2b56337..40a4e0e 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7656=['../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','update','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7656,0xef));var _0x6765=function(_0x1a11aa,_0x2aa566){_0x1a11aa=_0x1a11aa-0x0;var _0x3a0120=_0x7656[_0x1a11aa];return _0x3a0120;};'use strict';var express=require('express');var router=express[_0x6765('0x0')]();var auth=require(_0x6765('0x1'));var controller=require(_0x6765('0x2'));router['put'](_0x6765('0x3'),auth[_0x6765('0x4')](),controller[_0x6765('0x5')]);module['exports']=router; \ No newline at end of file +var _0xc12f=['express','Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports'];(function(_0x5dfb86,_0x224c29){var _0x2968f8=function(_0x1252cd){while(--_0x1252cd){_0x5dfb86['push'](_0x5dfb86['shift']());}};_0x2968f8(++_0x224c29);}(_0xc12f,0x168));var _0xfc12=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xc12f[_0x5a6644];return _0x3a2a5d;};'use strict';var express=require(_0xfc12('0x0'));var router=express[_0xfc12('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xfc12('0x2'));router[_0xfc12('0x3')](_0xfc12('0x4'),auth[_0xfc12('0x5')](),controller[_0xfc12('0x6')]);module[_0xfc12('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 75163a6..2234d5c 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x540b=['debug','exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','error','warning','info'];(function(_0x1d174c,_0xd71a94){var _0x193cbf=function(_0x140302){while(--_0x140302){_0x1d174c['push'](_0x1d174c['shift']());}};_0x193cbf(++_0xd71a94);}(_0x540b,0xbb));var _0xb540=function(_0xc46d5d,_0x8b40d8){_0xc46d5d=_0xc46d5d-0x0;var _0x5cd21c=_0x540b[_0xc46d5d];return _0x5cd21c;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xb540('0x0'),_0xb540('0x1'),_0xb540('0x2'),_0xb540('0x3')];module[_0xb540('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xb540('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xb540('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb540('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb540('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb540('0x8')],'unique':_0xb540('0x9')}}; \ No newline at end of file +var _0x776d=['error','warning','info','debug','exports','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0x322e30,_0x4f89b1){var _0x3d9dc4=function(_0x1912fe){while(--_0x1912fe){_0x322e30['push'](_0x322e30['shift']());}};_0x3d9dc4(++_0x4f89b1);}(_0x776d,0x112));var _0xd776=function(_0x3b6e37,_0x497c0b){_0x3b6e37=_0x3b6e37-0x0;var _0x42875b=_0x776d[_0x3b6e37];return _0x42875b;};'use strict';var Sequelize=require(_0xd776('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd776('0x1'),_0xd776('0x2'),_0xd776('0x3'),_0xd776('0x4')];module[_0xd776('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd776('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd776('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd776('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd776('0x9')],'unique':_0xd776('0xa')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 40ec3fa..565b113 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce3=['then','body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','update','sendStatus','error','stack','name','send','admin','Unauthorized','params','UserSetting'];(function(_0x14850c,_0x4ebcdf){var _0x5610a3=function(_0x25b86a){while(--_0x25b86a){_0x14850c['push'](_0x14850c['shift']());}};_0x5610a3(++_0x4ebcdf);}(_0x8ce3,0xc3));var _0x38ce=function(_0x55f6d7,_0x5bd984){_0x55f6d7=_0x55f6d7-0x0;var _0x2153cc=_0x8ce3[_0x55f6d7];return _0x2153cc;};'use strict';var _=require(_0x38ce('0x0'));var Redis=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var config=require(_0x38ce('0x3'));var db=require(_0x38ce('0x4'))['db'];var socket=require(_0x38ce('0x5'))(new Redis(config[_0x38ce('0x6')]));require(_0x38ce('0x7'))[_0x38ce('0x8')](socket);config[_0x38ce('0x6')]=_['defaults'](config[_0x38ce('0x6')],{'host':_0x38ce('0x9'),'port':0x18eb});function respondWithResult(_0x58074c,_0x262b13){_0x262b13=_0x262b13||0xc8;return function(_0xbe7332){if(_0xbe7332){return _0x58074c[_0x38ce('0xa')](_0x262b13)['json'](_0xbe7332);}};}function saveUpdates(_0x3c66e5){return function(_0x4f0d59){if(_0x4f0d59){return _0x4f0d59[_0x38ce('0xb')](_0x3c66e5)['then'](function(_0x133bd5){return _0x133bd5;});}return null;};}function handleEntityNotFound(_0x31c2e1){return function(_0xa9931b){if(!_0xa9931b){_0x31c2e1[_0x38ce('0xc')](0x194);}return _0xa9931b;};}function handleError(_0x564332,_0x3603fa){_0x3603fa=_0x3603fa||0x1f4;return function(_0x2a9045){logger[_0x38ce('0xd')](_0x2a9045[_0x38ce('0xe')]);if(_0x2a9045[_0x38ce('0xf')]){delete _0x2a9045[_0x38ce('0xf')];}_0x564332[_0x38ce('0xa')](_0x3603fa)[_0x38ce('0x10')](_0x2a9045);};}exports[_0x38ce('0xb')]=function(_0x2e661b,_0x2cf066){if(_0x2e661b['user']['role']!==_0x38ce('0x11'))throw new Error(_0x38ce('0x12'));if(isNaN(Number(_0x2e661b[_0x38ce('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x38ce('0x14')]['find']({'where':{'id':_0x2e661b[_0x38ce('0x13')]['id']}})[_0x38ce('0x15')](handleEntityNotFound(_0x2cf066,null))['then'](saveUpdates(_0x2e661b[_0x38ce('0x16')],null))[_0x38ce('0x15')](respondWithResult(_0x2cf066,null))[_0x38ce('0x17')](handleError(_0x2cf066,null));}; \ No newline at end of file +var _0xf0cc=['redis','defaults','update','sendStatus','stack','name','status','send','user','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','then','catch','lodash','api','socket.io-emitter'];(function(_0x364b1c,_0x47a858){var _0x377538=function(_0x53e5fb){while(--_0x53e5fb){_0x364b1c['push'](_0x364b1c['shift']());}};_0x377538(++_0x47a858);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x167381,_0x195040){_0x167381=_0x167381-0x0;var _0x175443=_0xf0cc[_0x167381];return _0x175443;};'use strict';var _=require(_0xcf0c('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xcf0c('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0xcf0c('0x2'))(new Redis(config[_0xcf0c('0x3')]));require('./user-setting.socket')['register'](socket);config[_0xcf0c('0x3')]=_[_0xcf0c('0x4')](config[_0xcf0c('0x3')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x346cb0,_0x1503f6){_0x1503f6=_0x1503f6||0xc8;return function(_0x2cb15a){if(_0x2cb15a){return _0x346cb0['status'](_0x1503f6)['json'](_0x2cb15a);}};}function saveUpdates(_0x3cf3cb){return function(_0x53a853){if(_0x53a853){return _0x53a853[_0xcf0c('0x5')](_0x3cf3cb)['then'](function(_0x291141){return _0x291141;});}return null;};}function handleEntityNotFound(_0x1a8e08){return function(_0x16190b){if(!_0x16190b){_0x1a8e08[_0xcf0c('0x6')](0x194);}return _0x16190b;};}function handleError(_0x3ba6ab,_0x817634){_0x817634=_0x817634||0x1f4;return function(_0x39375d){logger['error'](_0x39375d[_0xcf0c('0x7')]);if(_0x39375d[_0xcf0c('0x8')]){delete _0x39375d[_0xcf0c('0x8')];}_0x3ba6ab[_0xcf0c('0x9')](_0x817634)[_0xcf0c('0xa')](_0x39375d);};}exports['update']=function(_0x540eae,_0x395d90){if(_0x540eae[_0xcf0c('0xb')]['role']!=='admin')throw new Error(_0xcf0c('0xc'));if(isNaN(Number(_0x540eae['params']['id'])))throw new Error(_0xcf0c('0xd'));return db[_0xcf0c('0xe')]['find']({'where':{'id':_0x540eae['params']['id']}})['then'](handleEntityNotFound(_0x395d90,null))[_0xcf0c('0xf')](saveUpdates(_0x540eae['body'],null))[_0xcf0c('0xf')](respondWithResult(_0x395d90,null))[_0xcf0c('0x10')](handleError(_0x395d90,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 36c4123..95b2380 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x203a=['events','../../mysqldb','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x203a,0xe0));var _0xa203=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x203a[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xa203('0x0'));var UserSetting=require(_0xa203('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa203('0x2')](0x0);var events={'afterCreate':_0xa203('0x3'),'afterUpdate':'update','afterDestroy':_0xa203('0x4')};function emitEvent(_0x157a5c){return function(_0x1f37ad,_0xddf5c7,_0x100385){UserSettingEvents[_0xa203('0x5')](_0x157a5c+':'+_0x1f37ad['id'],_0x1f37ad);UserSettingEvents[_0xa203('0x5')](_0x157a5c,_0x1f37ad);_0x100385(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xa203('0x6')](e,emitEvent(event));}}module[_0xa203('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xbdf0=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserSetting'];(function(_0x65ff01,_0x5653e9){var _0xc346d3=function(_0x296ba6){while(--_0x296ba6){_0x65ff01['push'](_0x65ff01['shift']());}};_0xc346d3(++_0x5653e9);}(_0xbdf0,0xb6));var _0x0bdf=function(_0x4f8b2b,_0x1dc8dd){_0x4f8b2b=_0x4f8b2b-0x0;var _0x2f230a=_0xbdf0[_0x4f8b2b];return _0x2f230a;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x0bdf('0x0'))['db'][_0x0bdf('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bdf('0x2'),'afterUpdate':_0x0bdf('0x3'),'afterDestroy':_0x0bdf('0x4')};function emitEvent(_0x278ba1){return function(_0x20e824,_0x46088f,_0x147f24){UserSettingEvents[_0x0bdf('0x5')](_0x278ba1+':'+_0x20e824['id'],_0x20e824);UserSettingEvents['emit'](_0x278ba1,_0x20e824);_0x147f24(null);};}for(var e in events){if(events[_0x0bdf('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x0bdf('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 5e482d7..d4bbf36 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf14=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings','clientSideLoggingEnabled'];(function(_0x23ffe8,_0x3ed23e){var _0xceb462=function(_0x5a72e4){while(--_0x5a72e4){_0x23ffe8['push'](_0x23ffe8['shift']());}};_0xceb462(++_0x3ed23e);}(_0xcf14,0xa1));var _0x4cf1=function(_0x12fcb5,_0x1d9b56){_0x12fcb5=_0x12fcb5-0x0;var _0x23300b=_0xcf14[_0x12fcb5];return _0x23300b;};'use strict';var attributes=require(_0x4cf1('0x0'));module['exports']=function(_0x2a09ab){return _0x2a09ab[_0x4cf1('0x1')]('UserSetting',attributes,{'tableName':_0x4cf1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15f9b9){if(!_0x15f9b9[_0x4cf1('0x3')])_0x15f9b9[_0x4cf1('0x4')]=null;else if(_0x15f9b9['clientSideLoggingEnabledSince']===null)_0x15f9b9[_0x4cf1('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x152f=['./user-setting.attributes','exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x11bc18,_0x212489){var _0x25cd9d=function(_0x299581){while(--_0x299581){_0x11bc18['push'](_0x11bc18['shift']());}};_0x25cd9d(++_0x212489);}(_0x152f,0x144));var _0xf152=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x152f[_0x37c22c];return _0x119d79;};'use strict';var attributes=require(_0xf152('0x0'));module[_0xf152('0x1')]=function(_0x3649e1){return _0x3649e1[_0xf152('0x2')](_0xf152('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d77c1){if(!_0x2d77c1[_0xf152('0x4')])_0x2d77c1[_0xf152('0x5')]=null;else if(_0x2d77c1[_0xf152('0x5')]===null)_0x2d77c1['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 9482ea6..f2a8e40 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x281d=['emit','user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','save','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x281d,0x195));var _0xd281=function(_0x210772,_0x4660ad){_0x210772=_0x210772-0x0;var _0x332e71=_0x281d[_0x210772];return _0x332e71;};'use strict';var UserSettingEvents=require(_0xd281('0x0'));var events=[_0xd281('0x1'),'remove',_0xd281('0x2')];function createListener(_0x2cf0e0,_0x32ac29){return function(_0x426a21){_0x32ac29[_0xd281('0x3')](_0x2cf0e0,_0x426a21);if(_0x2cf0e0==='user-setting:update'){_0x32ac29['emit'](_0xd281('0x4')+_0x426a21[_0xd281('0x5')],_0x426a21);}};}exports[_0xd281('0x6')]=function(_0x37984b){for(var _0x519785=0x0,_0x3134f0=events['length'];_0x519785<_0x3134f0;_0x519785++){var _0xe901ac=events[_0x519785];var _0x27662a=createListener(_0xd281('0x7')+_0xe901ac,_0x37984b);UserSettingEvents['on'](_0xe901ac,_0x27662a);}}; \ No newline at end of file +var _0x3226=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','update','emit','user-setting:update'];(function(_0x22eef7,_0x1a60c5){var _0x43a93f=function(_0x177d16){while(--_0x177d16){_0x22eef7['push'](_0x22eef7['shift']());}};_0x43a93f(++_0x1a60c5);}(_0x3226,0x87));var _0x6322=function(_0x51d0ca,_0x5af942){_0x51d0ca=_0x51d0ca-0x0;var _0x4f690a=_0x3226[_0x51d0ca];return _0x4f690a;};'use strict';var UserSettingEvents=require(_0x6322('0x0'));var events=[_0x6322('0x1'),'remove',_0x6322('0x2')];function createListener(_0x2c29f1,_0x536aa3){return function(_0x259cb0){_0x536aa3[_0x6322('0x3')](_0x2c29f1,_0x259cb0);if(_0x2c29f1===_0x6322('0x4')){_0x536aa3[_0x6322('0x3')](_0x6322('0x5')+_0x259cb0[_0x6322('0x6')],_0x259cb0);}};}exports[_0x6322('0x7')]=function(_0x463ac5){for(var _0x5da284=0x0,_0x11769d=events[_0x6322('0x8')];_0x5da284<_0x11769d;_0x5da284++){var _0x545e28=events[_0x5da284];var _0x17350a=createListener(_0x6322('0x9')+_0x545e28,_0x463ac5);UserSettingEvents['on'](_0x545e28,_0x17350a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 648528c..3fa16a4 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 _0x3495=['root','originalname','single','file','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','createApiKey','put','/:id/password','changePassword','/:id/queues','removeQueues','delete','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','/describe','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','addQueues'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x3495,0x1de));var _0x5349=function(_0x414b23,_0x316ca3){_0x414b23=_0x414b23-0x0;var _0xa0a59d=_0x3495[_0x414b23];return _0xa0a59d;};'use strict';var multer=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var path=require(_0x5349('0x2'));var timeout=require(_0x5349('0x3'));var express=require(_0x5349('0x4'));var router=express[_0x5349('0x5')]();var fs_extra=require(_0x5349('0x6'));var auth=require(_0x5349('0x7'));var interaction=require(_0x5349('0x8'));var config=require('../../config/environment');var controller=require(_0x5349('0x9'));router[_0x5349('0xa')]('/',auth['isAuthenticated'](),controller[_0x5349('0xb')]);router['get'](_0x5349('0xc'),auth['isAuthenticated'](),controller[_0x5349('0xd')]);router['get'](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x10')]);router[_0x5349('0xa')](_0x5349('0x11'),auth[_0x5349('0xf')](),controller[_0x5349('0x12')]);router['get'](_0x5349('0x13'),auth['isAuthenticated'](),controller[_0x5349('0x14')]);router[_0x5349('0xa')](_0x5349('0x15'),controller[_0x5349('0x16')]);router[_0x5349('0xa')](_0x5349('0x17'),auth[_0x5349('0xf')](),controller[_0x5349('0x18')]);router[_0x5349('0xa')](_0x5349('0x19'),auth['isAuthenticated'](),controller[_0x5349('0x1a')]);router[_0x5349('0xa')]('/:id/queues',auth[_0x5349('0xf')](),controller[_0x5349('0x1b')]);router[_0x5349('0xa')]('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x5349('0xa')]('/:id/groups',auth[_0x5349('0xf')](),controller['getGroups']);router[_0x5349('0xa')](_0x5349('0x1c'),auth[_0x5349('0xf')](),controller[_0x5349('0x1d')]);router['get'](_0x5349('0x1e'),auth[_0x5349('0xf')](),controller[_0x5349('0x1f')]);router[_0x5349('0xa')]('/:id/chat/interactions',auth[_0x5349('0xf')](),controller[_0x5349('0x20')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x5349('0x21')]);router['get'](_0x5349('0x22'),auth[_0x5349('0xf')](),controller[_0x5349('0x23')]);router[_0x5349('0xa')](_0x5349('0x24'),auth[_0x5349('0xf')](),controller[_0x5349('0x25')]);router[_0x5349('0xa')](_0x5349('0x26'),auth[_0x5349('0xf')](),controller[_0x5349('0x27')]);router[_0x5349('0xa')]('/:id/whatsapp/interactions',auth[_0x5349('0xf')](),controller[_0x5349('0x28')]);router[_0x5349('0xa')]('/:id/teams',auth[_0x5349('0xf')](),controller['getTeams']);router[_0x5349('0xa')](_0x5349('0x29'),auth[_0x5349('0xf')](),controller['getLists']);router[_0x5349('0xa')](_0x5349('0x2a'),auth[_0x5349('0xf')](),controller[_0x5349('0x2b')]);router[_0x5349('0xa')](_0x5349('0x2c'),auth[_0x5349('0xf')](),controller[_0x5349('0x2d')]);router[_0x5349('0xa')]('/:id/fax_accounts',auth[_0x5349('0xf')](),controller[_0x5349('0x2e')]);router['get'](_0x5349('0x2f'),auth['isAuthenticated'](),controller[_0x5349('0x30')]);router[_0x5349('0xa')](_0x5349('0x31'),auth[_0x5349('0xf')](),controller[_0x5349('0x32')]);router[_0x5349('0xa')]('/:id/sms_accounts',auth[_0x5349('0xf')](),controller[_0x5349('0x33')]);router[_0x5349('0xa')](_0x5349('0x34'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x5349('0xa')](_0x5349('0x35'),auth[_0x5349('0xf')](),controller['getWhatsappAccounts']);router[_0x5349('0xa')]('/:id/scheduled_calls',auth[_0x5349('0xf')](),controller[_0x5349('0x36')]);router[_0x5349('0xa')](_0x5349('0x37'),auth[_0x5349('0xf')](),controller[_0x5349('0x38')]);router['post']('/:id/contacts',auth[_0x5349('0xf')](),controller[_0x5349('0x39')]);router[_0x5349('0x3a')]('/',auth[_0x5349('0xf')](),controller[_0x5349('0x3b')]);router[_0x5349('0x3a')](_0x5349('0x3c'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x5349('0x3a')]('/:id/queues',auth['isAuthenticated'](),controller[_0x5349('0x3d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18f881,_0xa58d2a,_0xa42dc5){_0xa42dc5(null,path['join'](config[_0x5349('0x3e')],'server/files/images/'));},'filename':function(_0x3c9a9d,_0x46a6da,_0x2ca7af){_0x2ca7af(null,util['format']('%s-%s',Date['now'](),_0x46a6da[_0x5349('0x3f')]));}})});router[_0x5349('0x3a')](_0x5349('0x15'),upload[_0x5349('0x40')](_0x5349('0x41')),controller[_0x5349('0x42')]);router['post']('/:id/login',auth[_0x5349('0xf')](),controller[_0x5349('0x43')]);router[_0x5349('0x3a')]('/:id/logout',auth[_0x5349('0xf')](),controller[_0x5349('0x44')]);router[_0x5349('0x3a')](_0x5349('0x45'),auth['isAuthenticated'](),controller[_0x5349('0x46')]);router['post'](_0x5349('0x47'),auth[_0x5349('0xf')](),controller['unpause']);router[_0x5349('0x3a')](_0x5349('0x48'),auth[_0x5349('0xf')](),controller[_0x5349('0x49')]);router[_0x5349('0x3a')](_0x5349('0x4a'),auth[_0x5349('0xf')](),controller['addChatInteractions']);router['post'](_0x5349('0x4b'),auth[_0x5349('0xf')](),controller[_0x5349('0x4c')]);router[_0x5349('0x3a')]('/:id/fax_interactions',auth[_0x5349('0xf')](),controller['addFaxInteractions']);router['post'](_0x5349('0x4d'),auth[_0x5349('0xf')](),controller[_0x5349('0x4e')]);router[_0x5349('0x3a')]('/:id/openchannel_interactions',auth[_0x5349('0xf')](),controller[_0x5349('0x4f')]);router[_0x5349('0x3a')](_0x5349('0x50'),auth[_0x5349('0xf')](),controller[_0x5349('0x51')]);router[_0x5349('0x3a')](_0x5349('0x52'),auth[_0x5349('0xf')](),controller[_0x5349('0x53')]);router[_0x5349('0x3a')](_0x5349('0x2f'),auth[_0x5349('0xf')](),controller[_0x5349('0x54')]);router['post']('/:id/openchannel_accounts',auth[_0x5349('0xf')](),controller[_0x5349('0x55')]);router[_0x5349('0x3a')](_0x5349('0x56'),auth[_0x5349('0xf')](),controller[_0x5349('0x57')]);router['post'](_0x5349('0x34'),auth[_0x5349('0xf')](),controller[_0x5349('0x58')]);router[_0x5349('0x3a')](_0x5349('0x35'),auth[_0x5349('0xf')](),controller['addWhatsappAccounts']);router[_0x5349('0x3a')]('/:id/api_key',auth[_0x5349('0xf')](),controller[_0x5349('0x59')]);router[_0x5349('0x5a')](_0x5349('0x13'),auth[_0x5349('0xf')](),controller['update']);router[_0x5349('0x5a')](_0x5349('0x5b'),auth[_0x5349('0xf')](),controller[_0x5349('0x5c')]);router['delete'](_0x5349('0x5d'),auth[_0x5349('0xf')](),controller[_0x5349('0x5e')]);router[_0x5349('0x5f')](_0x5349('0x48'),auth[_0x5349('0xf')](),controller[_0x5349('0x60')]);router[_0x5349('0x5f')](_0x5349('0x13'),auth[_0x5349('0xf')](),controller[_0x5349('0x61')]);router[_0x5349('0x5f')](_0x5349('0x4a'),auth[_0x5349('0xf')](),controller[_0x5349('0x62')]);router[_0x5349('0x5f')](_0x5349('0x4b'),auth[_0x5349('0xf')](),controller['removeMailInteractions']);router[_0x5349('0x5f')](_0x5349('0x63'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x5349('0x5f')](_0x5349('0x4d'),auth[_0x5349('0xf')](),controller[_0x5349('0x64')]);router[_0x5349('0x5f')](_0x5349('0x65'),auth[_0x5349('0xf')](),controller['removeOpenchannelInteractions']);router[_0x5349('0x5f')](_0x5349('0x50'),auth[_0x5349('0xf')](),controller['removeWhatsappInteractions']);router['delete'](_0x5349('0x52'),auth[_0x5349('0xf')](),controller[_0x5349('0x66')]);router[_0x5349('0x5f')](_0x5349('0x2f'),auth[_0x5349('0xf')](),controller[_0x5349('0x67')]);router[_0x5349('0x5f')]('/:id/openchannel_accounts',auth[_0x5349('0xf')](),controller['removeOpenchannelAccounts']);router[_0x5349('0x5f')](_0x5349('0x56'),auth[_0x5349('0xf')](),controller[_0x5349('0x68')]);router['delete']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x5349('0x69')]);router['delete'](_0x5349('0x35'),auth[_0x5349('0xf')](),controller[_0x5349('0x6a')]);router[_0x5349('0x5f')](_0x5349('0x37'),auth[_0x5349('0xf')](),controller['removeApiKey']);module[_0x5349('0x6b')]=router; \ No newline at end of file +var _0x84ae=['pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/openchannel_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues','join','format','%s-%s','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause'];(function(_0x4541af,_0x64aa00){var _0x1408c3=function(_0x58a28b){while(--_0x58a28b){_0x4541af['push'](_0x4541af['shift']());}};_0x1408c3(++_0x64aa00);}(_0x84ae,0x101));var _0xe84a=function(_0x6afa2d,_0x8c0e0f){_0x6afa2d=_0x6afa2d-0x0;var _0x1698ee=_0x84ae[_0x6afa2d];return _0x1698ee;};'use strict';var multer=require(_0xe84a('0x0'));var util=require(_0xe84a('0x1'));var path=require(_0xe84a('0x2'));var timeout=require(_0xe84a('0x3'));var express=require(_0xe84a('0x4'));var router=express[_0xe84a('0x5')]();var fs_extra=require(_0xe84a('0x6'));var auth=require(_0xe84a('0x7'));var interaction=require(_0xe84a('0x8'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0xe84a('0x9')](),controller['index']);router[_0xe84a('0xa')](_0xe84a('0xb'),auth[_0xe84a('0x9')](),controller[_0xe84a('0xc')]);router['get'](_0xe84a('0xd'),auth[_0xe84a('0x9')](),controller[_0xe84a('0xe')]);router['get'](_0xe84a('0xf'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x10')]);router[_0xe84a('0xa')](_0xe84a('0x11'),auth[_0xe84a('0x9')](),controller['show']);router[_0xe84a('0xa')](_0xe84a('0x12'),controller[_0xe84a('0x13')]);router[_0xe84a('0xa')](_0xe84a('0x14'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get'](_0xe84a('0x15'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x17')]);router[_0xe84a('0xa')](_0xe84a('0x18'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x19')]);router[_0xe84a('0xa')]('/:id/groups',auth[_0xe84a('0x9')](),controller[_0xe84a('0x1a')]);router[_0xe84a('0xa')](_0xe84a('0x1b'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x1c')]);router[_0xe84a('0xa')](_0xe84a('0x1d'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x1e')]);router['get']('/:id/chat/interactions',auth[_0xe84a('0x9')](),controller['getChatInteractions']);router['get'](_0xe84a('0x1f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x20')]);router[_0xe84a('0xa')](_0xe84a('0x21'),auth['isAuthenticated'](),controller[_0xe84a('0x22')]);router[_0xe84a('0xa')](_0xe84a('0x23'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x24')]);router[_0xe84a('0xa')](_0xe84a('0x25'),auth[_0xe84a('0x9')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0xe84a('0x9')](),controller[_0xe84a('0x26')]);router[_0xe84a('0xa')]('/:id/teams',auth[_0xe84a('0x9')](),controller[_0xe84a('0x27')]);router[_0xe84a('0xa')](_0xe84a('0x28'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x29')]);router[_0xe84a('0xa')]('/:id/agents',auth[_0xe84a('0x9')](),controller['getAgents']);router[_0xe84a('0xa')](_0xe84a('0x2a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x2b')]);router['get']('/:id/fax_accounts',auth[_0xe84a('0x9')](),controller[_0xe84a('0x2c')]);router[_0xe84a('0xa')](_0xe84a('0x2d'),auth['isAuthenticated'](),controller[_0xe84a('0x2e')]);router['get']('/:id/openchannel_accounts',auth[_0xe84a('0x9')](),controller['getOpenchannelAccounts']);router[_0xe84a('0xa')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x30')]);router[_0xe84a('0xa')]('/:id/chat_websites',auth[_0xe84a('0x9')](),controller['getChatWebsites']);router[_0xe84a('0xa')](_0xe84a('0x31'),auth[_0xe84a('0x9')](),controller['getWhatsappAccounts']);router[_0xe84a('0xa')](_0xe84a('0x32'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x33')]);router[_0xe84a('0xa')]('/:id/api_key',auth[_0xe84a('0x9')](),controller['getApiKey']);router[_0xe84a('0x34')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xe84a('0x35')]);router['post']('/',auth[_0xe84a('0x9')](),controller[_0xe84a('0x36')]);router[_0xe84a('0x34')](_0xe84a('0x37'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x38')]);router[_0xe84a('0x34')](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4bea08,_0x190117,_0x1dd8dc){_0x1dd8dc(null,path[_0xe84a('0x3a')](config['root'],'server/files/images/'));},'filename':function(_0x1574d2,_0x4d89b6,_0x5b43b8){_0x5b43b8(null,util[_0xe84a('0x3b')](_0xe84a('0x3c'),Date[_0xe84a('0x3d')](),_0x4d89b6[_0xe84a('0x3e')]));}})});router[_0xe84a('0x34')]('/:id/avatar',upload[_0xe84a('0x3f')]('file'),controller[_0xe84a('0x40')]);router['post'](_0xe84a('0x41'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x42')]);router[_0xe84a('0x34')](_0xe84a('0x43'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x44')]);router['post'](_0xe84a('0x45'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x46')]);router[_0xe84a('0x34')](_0xe84a('0x47'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x48')]);router[_0xe84a('0x34')](_0xe84a('0x49'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x4a')]);router[_0xe84a('0x34')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xe84a('0x4b')]);router[_0xe84a('0x34')](_0xe84a('0x4c'),auth['isAuthenticated'](),controller[_0xe84a('0x4d')]);router[_0xe84a('0x34')](_0xe84a('0x4e'),auth[_0xe84a('0x9')](),controller['addFaxInteractions']);router[_0xe84a('0x34')](_0xe84a('0x4f'),auth['isAuthenticated'](),controller[_0xe84a('0x50')]);router[_0xe84a('0x34')](_0xe84a('0x51'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x52')]);router[_0xe84a('0x34')](_0xe84a('0x53'),auth['isAuthenticated'](),controller[_0xe84a('0x54')]);router[_0xe84a('0x34')]('/:id/fax_accounts',auth[_0xe84a('0x9')](),controller['addFaxAccounts']);router[_0xe84a('0x34')](_0xe84a('0x2d'),auth[_0xe84a('0x9')](),controller['addMailAccounts']);router[_0xe84a('0x34')](_0xe84a('0x55'),auth[_0xe84a('0x9')](),controller['addOpenchannelAccounts']);router[_0xe84a('0x34')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x56')]);router[_0xe84a('0x34')](_0xe84a('0x57'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x58')]);router[_0xe84a('0x34')](_0xe84a('0x31'),auth['isAuthenticated'](),controller[_0xe84a('0x59')]);router[_0xe84a('0x34')](_0xe84a('0x5a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x5b')]);router[_0xe84a('0x5c')]('/:id',auth[_0xe84a('0x9')](),controller[_0xe84a('0x5d')]);router[_0xe84a('0x5c')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0xe84a('0x5e')](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller['removeQueues']);router[_0xe84a('0x5e')](_0xe84a('0x49'),auth[_0xe84a('0x9')](),controller['removeTeams']);router[_0xe84a('0x5e')](_0xe84a('0x11'),auth[_0xe84a('0x9')](),controller['destroy']);router[_0xe84a('0x5e')](_0xe84a('0x5f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x60')]);router['delete'](_0xe84a('0x4c'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x61')]);router[_0xe84a('0x5e')](_0xe84a('0x4e'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x62')]);router['delete'](_0xe84a('0x4f'),auth['isAuthenticated'](),controller[_0xe84a('0x63')]);router[_0xe84a('0x5e')](_0xe84a('0x51'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x64')]);router[_0xe84a('0x5e')](_0xe84a('0x53'),auth['isAuthenticated'](),controller[_0xe84a('0x65')]);router[_0xe84a('0x5e')](_0xe84a('0x66'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x67')]);router[_0xe84a('0x5e')](_0xe84a('0x2d'),auth[_0xe84a('0x9')](),controller['removeMailAccounts']);router[_0xe84a('0x5e')](_0xe84a('0x55'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x68')]);router[_0xe84a('0x5e')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x69')]);router[_0xe84a('0x5e')](_0xe84a('0x57'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xe84a('0x5e')]('/:id/whatsapp_accounts',auth[_0xe84a('0x9')](),controller[_0xe84a('0x6a')]);router['delete'](_0xe84a('0x5a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x6b')]);module[_0xe84a('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4b21c81..eca6039 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 _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x484041,_0x2e3a0f){var _0x579bdc=function(_0x138b6d){while(--_0x138b6d){_0x484041['push'](_0x484041['shift']());}};_0x579bdc(++_0x2e3a0f);}(_0x70e0,0x17b));var _0x070e=function(_0x3ecb08,_0x56c860){_0x3ecb08=_0x3ecb08-0x0;var _0x535172=_0x70e0[_0x3ecb08];return _0x535172;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index cf6dcac..543e9a5 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 _0x205b=['bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','map','some','telephone','Agents','autoAssociation','compact','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','penalty','spread','Queue:save','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','Unknown\x20channel','Queues','isArray','QueueId','Queue:remove','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','server/files/images/','join','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','merge','options','hasOwnProperty','CmList','Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','intrf','user:%s','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','Team','getTeams','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','flattenDeep','addAgent','Voice','TeamVoicePrefix','VoicePrefixId','getDataValue','removeTeams','getAssociatedQueues','removeAgent','UserVoicePrefix','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$lte','$ne','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','retrieveApiKey','token','createApiKey','iat','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','getUserSetting','getPresence','teams','queues','isEmpty','inbound','flatten','lower','desc','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','toString','OpenTabs','moment','util','path','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','client','request','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','role','emit','userNotification:recalc:','get','admin','agent','filter','ignore','value','includes','find','name','UserProfileResource','destroy','stack','send','index','User','rawAttributes','fieldName','key','password','getOptions','where','query','includeAll','include','userSetting','UserSetting','push','findAll','rows','true','dataValues','sms','fax','openchannel','whatsapp','all','show','params','model','salt','keys','filters','intersection','attributes','fields','length','openTabs','chat','mail','body','describe','addContacts','ids','internal','Setting','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','104','105','107','109','100','111','114','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','Telephones','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x28329,_0x1176df){var _0x5bea8f=function(_0x5d2e53){while(--_0x5d2e53){_0x28329['push'](_0x28329['shift']());}};_0x5bea8f(++_0x1176df);}(_0x205b,0x104));var _0xb205=function(_0x54d197,_0x5c5884){_0x54d197=_0x54d197-0x0;var _0x5aa343=_0x205b[_0x54d197];return _0x5aa343;};'use strict';var moment=require(_0xb205('0x0'));var util=require(_0xb205('0x1'));var path=require(_0xb205('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0xb205('0x3'));var authService=require(_0xb205('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xb205('0x5'))(_0xb205('0x6'));var utils=require(_0xb205('0x7'));var config=require('../../config/environment');var licenseUtil=require(_0xb205('0x8'));var APIBadRequestError=require(_0xb205('0x9'))[_0xb205('0xa')];var APINotFoundError=require(_0xb205('0x9'))[_0xb205('0xb')];var APIHandleError=require(_0xb205('0x9'))[_0xb205('0xc')];var db=require(_0xb205('0xd'))['db'];var socket=require(_0xb205('0xe'))(new Redis(config[_0xb205('0xf')]));require(_0xb205('0x10'))[_0xb205('0x11')](socket);config[_0xb205('0xf')]=_[_0xb205('0x12')](config[_0xb205('0xf')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0xb205('0x13')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x176020,_0x3f53bb,_0x495e83,_0x4667f6){return new Promise(function(_0x1e1a3e,_0x31fccf){var _0x10e5c3=_0x4667f6||amiClient;return _0x10e5c3[_0xb205('0x14')](_0x176020,_0x495e83)['then'](function(_0x317a72){logger['info']('User,\x20%s,\x20%s',_0x3f53bb,_0xb205('0x15'));logger[_0xb205('0x16')](_0xb205('0x17'),_0x3f53bb,_0xb205('0x15'),JSON['stringify'](_0x317a72));if(_0x317a72[_0xb205('0x18')]){if(_0x317a72[_0xb205('0x18')][_0xb205('0x19')]===0x1f4){logger[_0xb205('0x18')](_0xb205('0x1a'),_0x3f53bb,_0x317a72[_0xb205('0x18')][_0xb205('0x1b')]);return _0x31fccf(_0x317a72[_0xb205('0x18')][_0xb205('0x1b')]);}logger[_0xb205('0x18')]('User,\x20%s,\x20%s',_0x3f53bb,_0x317a72[_0xb205('0x18')][_0xb205('0x1b')]);return _0x1e1a3e(_0x317a72['error'][_0xb205('0x1b')]);}else{logger['info'](_0xb205('0x1a'),_0x3f53bb,_0xb205('0x15'));_0x1e1a3e(_0x317a72['result'][_0xb205('0x1b')]);}})[_0xb205('0x1c')](function(_0x552358){logger['error'](_0xb205('0x1a'),_0x3f53bb,_0x552358);_0x31fccf(_0x552358);});});}function respondWithStatusCode(_0x22125f,_0x14d8a6){_0x14d8a6=_0x14d8a6||0xcc;return function(_0x3a3689){if(_0x3a3689){return _0x22125f[_0xb205('0x1d')](_0x14d8a6);}return _0x22125f[_0xb205('0x1e')](_0x14d8a6)[_0xb205('0x1f')]();};}function respondWithResult(_0x4fe94f,_0x41b9d7){_0x41b9d7=_0x41b9d7||0xc8;return function(_0x2fa7c5){if(_0x2fa7c5){return _0x4fe94f[_0xb205('0x1e')](_0x41b9d7)[_0xb205('0x20')](_0x2fa7c5);}};}function respondWithFilteredResult(_0x40a394,_0x34de7e){return function(_0xc0226e){if(_0xc0226e){var _0xb84065=typeof _0x34de7e[_0xb205('0x21')]===_0xb205('0x22')&&typeof _0x34de7e[_0xb205('0x23')]===_0xb205('0x22');var _0x3dd44d=_0xc0226e[_0xb205('0x24')];var _0x27a4aa=_0xb84065?0x0:_0x34de7e[_0xb205('0x21')];var _0x53f394=_0xb84065?_0xc0226e['count']:_0x34de7e[_0xb205('0x21')]+_0x34de7e[_0xb205('0x23')];var _0xd14164;if(_0x53f394>=_0x3dd44d){_0x53f394=_0x3dd44d;_0xd14164=0xc8;}else{_0xd14164=0xce;}_0x40a394[_0xb205('0x1e')](_0xd14164);return _0x40a394[_0xb205('0x25')](_0xb205('0x26'),_0x27a4aa+'-'+_0x53f394+'/'+_0x3dd44d)[_0xb205('0x20')](_0xc0226e);}return null;};}function saveUpdates(_0x5bac6a){return function(_0x46986c){if(_0x46986c){return _0x46986c[_0xb205('0x27')](_0x5bac6a)[_0xb205('0x28')](function(_0x1b2d65){if(_0x1b2d65[_0xb205('0x29')]==='agent'){socket[_0xb205('0x2a')](_0xb205('0x2b')+_0x1b2d65['id'],_0x1b2d65);}return _0x1b2d65;});}return null;};}function removeEntity(_0x23f5a7){return function(_0xafcb8b){if(_0xafcb8b){return _0xafcb8b['destroy']()[_0xb205('0x28')](function(){var _0x5881d3=_0xafcb8b[_0xb205('0x2c')]({'plain':!![]});if(_0x5881d3[_0xb205('0x29')]===_0xb205('0x2d'))return;var _0x4dd7c0=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':_0xb205('0x2e'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x38f41e=_(_0x4dd7c0)[_0xb205('0x2f')](_0xb205('0x30'))['map'](_0xb205('0x31'))[_0xb205('0x31')]();if(_[_0xb205('0x32')](_0x38f41e,_0x5881d3[_0xb205('0x29')])){return;}var _0x5afa0b=_[_0xb205('0x33')](_0x4dd7c0,[_0xb205('0x31'),_0x5881d3[_0xb205('0x29')]])[_0xb205('0x34')];return db[_0xb205('0x35')][_0xb205('0x36')]({'where':{'type':_0x5afa0b,'resourceId':_0x5881d3['id']}})['then'](function(){return _0xafcb8b;});})[_0xb205('0x28')](function(){_0x23f5a7[_0xb205('0x1e')](0xcc)[_0xb205('0x1f')]();});}};}function handleEntityNotFound(_0xe93298){return function(_0x36a5d8){if(!_0x36a5d8){_0xe93298[_0xb205('0x1d')](0x194);}return _0x36a5d8;};}function handleError(_0x469b74,_0x4d1172){_0x4d1172=_0x4d1172||0x1f4;return function(_0x5e2e9f){logger[_0xb205('0x18')](_0x5e2e9f[_0xb205('0x37')]);if(_0x5e2e9f[_0xb205('0x34')]){delete _0x5e2e9f[_0xb205('0x34')];}_0x469b74[_0xb205('0x1e')](_0x4d1172)[_0xb205('0x38')](_0x5e2e9f);};}exports[_0xb205('0x39')]=function(_0x324c39,_0x1d041b){var _0x27d4e8={},_0xe64f3f={'count':0x0,'rows':[]};var _0x2b9b6e=_(db[_0xb205('0x3a')][_0xb205('0x3b')])['map'](function(_0x15771e){return{'name':_0x15771e[_0xb205('0x3c')],'type':_0x15771e['type'][_0xb205('0x3d')]};})[_0xb205('0x2f')](function(_0x39edfb){return!_[_0xb205('0x32')]([_0xb205('0x3e'),'salt'],_0x39edfb[_0xb205('0x34')]);})['value']();_0x27d4e8=qs[_0xb205('0x3f')](_0x2b9b6e,_0x324c39);var _0xc04b5f={'where':_0x27d4e8[_0xb205('0x40')]};return db[_0xb205('0x3a')][_0xb205('0x24')](_0xc04b5f)[_0xb205('0x28')](function(_0x2c4f9c){_0xe64f3f['count']=_0x2c4f9c;if(_0x324c39[_0xb205('0x41')][_0xb205('0x42')]){_0x27d4e8[_0xb205('0x43')]=[{'all':!![]}];}if(_0x324c39[_0xb205('0x41')][_0xb205('0x44')]==='true'){_0x27d4e8['include']=[{'model':db[_0xb205('0x45')],'as':_0xb205('0x44')}];}if(!_[_0xb205('0x32')](_0x27d4e8['attributes'],'id')){_0x27d4e8['attributes'][_0xb205('0x46')]('id');}return db[_0xb205('0x3a')][_0xb205('0x47')](_0x27d4e8);})[_0xb205('0x28')](function(_0x18f7ec){_0xe64f3f[_0xb205('0x48')]=_0x18f7ec;if(_0x324c39[_0xb205('0x41')]['openTabs']===_0xb205('0x49')){var _0x67bd66=[];for(var _0x14ace8=0x0;_0x14ace8<_0xe64f3f[_0xb205('0x48')]['length'];_0x14ace8++){_0x67bd66[_0xb205('0x46')](get_open_tabs('chat',_0xe64f3f[_0xb205('0x48')][_0x14ace8][_0xb205('0x4a')]));_0x67bd66['push'](get_open_tabs(_0xb205('0x4b'),_0xe64f3f[_0xb205('0x48')][_0x14ace8]['dataValues']));_0x67bd66[_0xb205('0x46')](get_open_tabs(_0xb205('0x4c'),_0xe64f3f['rows'][_0x14ace8][_0xb205('0x4a')]));_0x67bd66[_0xb205('0x46')](get_open_tabs('mail',_0xe64f3f[_0xb205('0x48')][_0x14ace8][_0xb205('0x4a')]));_0x67bd66['push'](get_open_tabs(_0xb205('0x4d'),_0xe64f3f['rows'][_0x14ace8][_0xb205('0x4a')]));_0x67bd66[_0xb205('0x46')](get_open_tabs(_0xb205('0x4e'),_0xe64f3f[_0xb205('0x48')][_0x14ace8][_0xb205('0x4a')]));}return Promise[_0xb205('0x4f')](_0x67bd66)[_0xb205('0x28')](function(){return _0xe64f3f;});}else{return _0xe64f3f;}})[_0xb205('0x28')](respondWithFilteredResult(_0x1d041b,_0x27d4e8))['catch'](handleError(_0x1d041b,null));};exports[_0xb205('0x50')]=function(_0x1530fd,_0x11a1df){var _0x3e8c74={'raw':![],'where':{'id':_0x1530fd[_0xb205('0x51')]['id']}},_0x55f3bb={};_0x55f3bb[_0xb205('0x52')]=_['differenceBy'](_['keys'](db[_0xb205('0x3a')][_0xb205('0x3b')]),['password',_0xb205('0x53')]);_0x55f3bb[_0xb205('0x41')]=_[_0xb205('0x54')](_0x1530fd[_0xb205('0x41')]);_0x55f3bb[_0xb205('0x55')]=_[_0xb205('0x56')](_0x55f3bb[_0xb205('0x52')],_0x55f3bb['query']);_0x3e8c74[_0xb205('0x57')]=_[_0xb205('0x56')](_0x55f3bb[_0xb205('0x52')],qs[_0xb205('0x58')](_0x1530fd['query']['fields']));_0x3e8c74[_0xb205('0x57')]=_0x3e8c74[_0xb205('0x57')][_0xb205('0x59')]?_0x3e8c74[_0xb205('0x57')]:_0x55f3bb[_0xb205('0x52')];if(_0x1530fd[_0xb205('0x41')][_0xb205('0x42')]){_0x3e8c74['include']=[{'all':!![]}];}if(_0x1530fd[_0xb205('0x41')][_0xb205('0x44')]===_0xb205('0x49')){_0x3e8c74['include']=[{'model':db['UserSetting'],'as':_0xb205('0x44')}];}_0x3e8c74=_['merge']({},_0x3e8c74,_0x1530fd['options']);if(!_[_0xb205('0x32')](_0x3e8c74[_0xb205('0x57')],'id')){_0x3e8c74[_0xb205('0x57')][_0xb205('0x46')]('id');}return db[_0xb205('0x3a')][_0xb205('0x33')](_0x3e8c74)[_0xb205('0x28')](handleEntityNotFound(_0x11a1df,null))[_0xb205('0x28')](function(_0xf5adf1){var _0x185e36=[];values=_0xf5adf1;if(_0x1530fd[_0xb205('0x41')][_0xb205('0x5a')]==='true'){_0x185e36[_0xb205('0x46')](get_open_tabs(_0xb205('0x5b'),_0xf5adf1[_0xb205('0x4a')]));_0x185e36[_0xb205('0x46')](get_open_tabs(_0xb205('0x4b'),_0xf5adf1['dataValues']));_0x185e36[_0xb205('0x46')](get_open_tabs('openchannel',_0xf5adf1['dataValues']));_0x185e36['push'](get_open_tabs('whatsapp',_0xf5adf1[_0xb205('0x4a')]));_0x185e36[_0xb205('0x46')](get_open_tabs(_0xb205('0x4c'),_0xf5adf1[_0xb205('0x4a')]));_0x185e36[_0xb205('0x46')](get_open_tabs(_0xb205('0x5c'),_0xf5adf1[_0xb205('0x4a')]));return Promise[_0xb205('0x4f')](_0x185e36);}else{return values;}})[_0xb205('0x28')](function(){return values;})['then'](respondWithResult(_0x11a1df,null))[_0xb205('0x1c')](handleError(_0x11a1df,null));};exports[_0xb205('0x27')]=function(_0x614452,_0x4d5db6){if(_0x614452[_0xb205('0x5d')]['id']){delete _0x614452[_0xb205('0x5d')]['id'];}delete _0x614452['body'][_0xb205('0x29')];return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x614452[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x4d5db6,null))[_0xb205('0x28')](saveUpdates(_0x614452[_0xb205('0x5d')],null))[_0xb205('0x28')](respondWithResult(_0x4d5db6,null))[_0xb205('0x1c')](handleError(_0x4d5db6,null));};exports['describe']=function(_0x4c288b,_0x4052a6){return db[_0xb205('0x3a')][_0xb205('0x5e')]()[_0xb205('0x28')](respondWithResult(_0x4052a6,null))['catch'](handleError(_0x4052a6,null));};exports[_0xb205('0x5f')]=function(_0x33d9ef,_0x948b58){return db['User'][_0xb205('0x33')]({'where':{'id':_0x33d9ef[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x948b58,null))[_0xb205('0x28')](function(_0x4a1a21){if(_0x4a1a21){return _0x4a1a21[_0xb205('0x5f')](_0x33d9ef['body'][_0xb205('0x60')],_['omit'](_0x33d9ef['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x948b58,null))[_0xb205('0x1c')](handleError(_0x948b58,null));};function validateUser(_0x1a0a93){return new Promise(function(_0xe9c57b,_0x1cc63d){if(_0x1a0a93[_0xb205('0x61')])return _0xe9c57b(_0x1a0a93);return db[_0xb205('0x62')]['findById'](0x1)[_0xb205('0x28')](function(_0x380ffa){if(_0x380ffa[_0xb205('0x63')])authService[_0xb205('0x64')](_0x1a0a93[_0xb205('0x3e')]);db[_0xb205('0x3a')][_0xb205('0x65')](_0xb205('0x61'))[_0xb205('0x28')](function(_0x1c9bf3){if(_[_0xb205('0x66')](_0x1c9bf3)){_0x1a0a93[_0xb205('0x61')]=_0x380ffa['min_internal']||0x1;return;}if(_['isNil'](_0x380ffa['min_internal'])||_0x380ffa['min_internal']===_0x1c9bf3){_0x1a0a93[_0xb205('0x61')]=_0x1c9bf3+0x1;return;}if(_0x380ffa[_0xb205('0x67')]>_0x1c9bf3){_0x1a0a93['internal']=_0x380ffa['min_internal'];return;}return db['sequelize'][_0xb205('0x41')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xb205('0x68')]['QueryTypes'][_0xb205('0x69')]})[_0xb205('0x28')](function(_0x5be301){if(_0x5be301&&_0x5be301['length']){for(var _0x383fc0=0x0,_0x58e8b7=_0x5be301[_0xb205('0x59')];_0x383fc0<_0x58e8b7&&_[_0xb205('0x66')](_0x1a0a93['internal']);_0x383fc0++){if(_0x380ffa[_0xb205('0x67')]<=_0x5be301[_0x383fc0]['from']){_0x1a0a93['internal']=_0x5be301[_0x383fc0]['from'];}else if(_0x380ffa['min_internal']>_0x5be301[_0x383fc0][_0xb205('0x6a')]&&_0x380ffa[_0xb205('0x67')]<=_0x5be301[_0x383fc0]['to']){_0x1a0a93['internal']=_0x380ffa['min_internal'];}}}if(_[_0xb205('0x66')](_0x1a0a93['internal'])){_0x1a0a93[_0xb205('0x61')]=_0x1c9bf3+0x1;}return _0xe9c57b(_0x1a0a93);});});})['catch'](function(_0x3fca63){_0x1cc63d(_0x3fca63);});});}function updateUser(_0x1c3b5d){return new Promise(function(_0x3fe003,_0x37cb8a){try{if(_0x1c3b5d[_0xb205('0x6b')]){_0x1c3b5d[_0xb205('0x6c')]=_0x1c3b5d[_0xb205('0x61')];_0x1c3b5d[_0xb205('0x6d')]={'mailbox':_0x1c3b5d[_0xb205('0x61')],'password':_0x1c3b5d['password'],'fullname':_0x1c3b5d[_0xb205('0x6e')],'email':_0x1c3b5d[_0xb205('0x6f')]};}if(_0x1c3b5d[_0xb205('0x29')]===_0xb205('0x2e')){if(!_0x1c3b5d[_0xb205('0x70')])_0x1c3b5d['permissions']=[_0xb205('0x71'),_0xb205('0x72'),_0xb205('0x73'),'113','110',_0xb205('0x74'),_0xb205('0x75'),'106',_0xb205('0x76'),'108',_0xb205('0x77'),_0xb205('0x78'),_0xb205('0x79'),_0xb205('0x7a'),'115'];}_0x3fe003(_0x1c3b5d);}catch(_0x5e8be4){_0x37cb8a(_0x5e8be4);}});}exports[_0xb205('0x7b')]=function(_0x734cf4,_0x4ec886){if(_0x734cf4[_0xb205('0x7c')]['role']===_0xb205('0x2e'))throw new Error('Unauthorized');if(_0x734cf4[_0xb205('0x5d')]['role']===_0xb205('0x7c')&&_0x734cf4[_0xb205('0x7c')][_0xb205('0x29')]!==_0xb205('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x734cf4[_0xb205('0x5d')]['role']===_0xb205('0x2d')&&_0x734cf4[_0xb205('0x7c')][_0xb205('0x29')]!==_0xb205('0x2d')){throw new Error(_0xb205('0x7d'));}return licenseUtil[_0xb205('0x7e')]([_0x734cf4[_0xb205('0x5d')]])[_0xb205('0x28')](function(){return validateUser(_0x734cf4['body']);})[_0xb205('0x28')](function(_0x5ad5be){return updateUser(_0x5ad5be)['then'](function(_0x39f43){if(_0x39f43[_0xb205('0x29')]===_0xb205('0x2d')){_0x39f43[_0xb205('0x7f')]=_0x734cf4['user'][_0xb205('0x7f')];delete _0x39f43[_0xb205('0x80')];}return _0x39f43;});})[_0xb205('0x28')](function(_0x2fe320){return db['User'][_0xb205('0x7b')](_0x2fe320,{'include':[{'model':db[_0xb205('0x6d')],'as':_0xb205('0x6d')}]});})[_0xb205('0x28')](function(_0x142456){if(_0x734cf4[_0xb205('0x5d')][_0xb205('0x29')]===_0xb205('0x7c'))return _0x142456;if(_0x734cf4[_0xb205('0x7c')][_0xb205('0x29')]!==_0xb205('0x7c'))return _0x142456;return db['UserProfileSection'][_0xb205('0x33')]({'where':{'name':_0x142456[_0xb205('0x29')]===_0xb205('0x2e')?'Agents':_0xb205('0x81'),'userProfileId':_0x734cf4['user'][_0xb205('0x80')]},'raw':!![]})[_0xb205('0x28')](function(_0x531615){if(!_0x531615||_0x531615['autoAssociation']!=0x0)return _0x142456;return db[_0xb205('0x35')][_0xb205('0x7b')]({'name':_0x142456[_0xb205('0x34')],'resourceId':_0x142456['id'],'type':_0x531615['name'],'sectionId':_0x531615['id']},{})[_0xb205('0x28')](function(){return _0x142456;});})[_0xb205('0x1c')](function(_0x3dec69){logger[_0xb205('0x18')](_0xb205('0x82'),_0x3dec69);throw _0x3dec69;});})[_0xb205('0x28')](respondWithResult(_0x4ec886,0xc9))['catch'](handleError(_0x4ec886,null));};exports[_0xb205('0x83')]=function(_0x439cb2,_0x2e40f6){var _0x1c59e7=_0x439cb2[_0xb205('0x5d')];var _0x48d771=[];if(_0x439cb2['user'][_0xb205('0x29')]===_0xb205('0x2e'))throw new Error(_0xb205('0x84'));if(_['some'](_0x1c59e7,['role',_0xb205('0x7c')])&&_0x439cb2[_0xb205('0x7c')][_0xb205('0x29')]!==_0xb205('0x2d')){throw new Error(_0xb205('0x85'));}if(_['some'](_0x1c59e7,[_0xb205('0x29'),_0xb205('0x2d')])&&_0x439cb2[_0xb205('0x7c')][_0xb205('0x29')]!=='admin'){throw new Error(_0xb205('0x86'));}return licenseUtil[_0xb205('0x7e')](_0x1c59e7)[_0xb205('0x28')](function(){return validateUser(_0x1c59e7[0x0]);})[_0xb205('0x28')](function(){for(var _0x4a1e3d=0x1;_0x4a1e3d<_0x1c59e7[_0xb205('0x59')];_0x4a1e3d++){var _0x4d5de2=_0x1c59e7[_0x4a1e3d-0x1][_0xb205('0x61')];if(!_0x1c59e7[_0x4a1e3d][_0xb205('0x61')])_0x1c59e7[_0x4a1e3d][_0xb205('0x61')]=_0x4d5de2+0x1;_0x48d771[_0xb205('0x46')](validateUser(_0x1c59e7[_0x4a1e3d]));}return Promise['all'](_0x48d771);})['then'](function(){_0x48d771=[];for(var _0x24bda0=0x0;_0x24bda0<_0x1c59e7[_0xb205('0x59')];_0x24bda0++){_0x48d771[_0xb205('0x46')](updateUser(_0x1c59e7[_0x24bda0]));}return Promise[_0xb205('0x4f')](_0x48d771);})['then'](function(){_0x48d771=_0x1c59e7[_0xb205('0x87')](function(_0x443e43){return db[_0xb205('0x3a')][_0xb205('0x7b')](_0x443e43,{'include':[{'model':db[_0xb205('0x6d')],'as':_0xb205('0x6d')}]})[_0xb205('0x28')](function(_0x40af1c){_0x443e43['id']=_0x40af1c['id'];return _0x443e43;});});return Promise['all'](_0x48d771);})[_0xb205('0x28')](function(_0x3b2534){if(_0x439cb2[_0xb205('0x5d')][_0xb205('0x29')]===_0xb205('0x7c'))return _0x3b2534;if(_0x439cb2[_0xb205('0x7c')][_0xb205('0x29')]!==_0xb205('0x7c'))return _0x3b2534;var _0x3a854d=_[_0xb205('0x88')](_0x3b2534,function(_0x58c608){return _0x58c608[_0xb205('0x29')]===_0xb205('0x2e')||_0x58c608[_0xb205('0x29')]===_0xb205('0x89');});if(!_0x3a854d)return _0x3b2534;return db['UserProfileSection'][_0xb205('0x47')]({'where':{'name':{'$or':[_0xb205('0x8a'),'Telephones']},'userProfileId':_0x439cb2['user']['userProfileId']},'raw':!![]})[_0xb205('0x28')](function(_0x564b6e){if(_['isEmpty'](_0x564b6e)||!_[_0xb205('0x88')](_0x564b6e,[_0xb205('0x8b'),0x0]))return _0x3b2534;_0x48d771=[];var _0x440cd7=_(_0x564b6e)[_0xb205('0x87')](function(_0x5edaf2){if(_0x5edaf2[_0xb205('0x8b')]===0x1)return;return _0x5edaf2[_0xb205('0x34')]==='Agents'?_0xb205('0x2e'):'telephone';})[_0xb205('0x8c')]()[_0xb205('0x31')]();for(var _0x342550=0x0;_0x342550<_0x3b2534['length'];_0x342550++){if(!_['includes'](_0x440cd7,_0x3b2534[_0x342550][_0xb205('0x29')]))return;var _0xda4c78=_0x3b2534[_0x342550]['role']==='agent'?_0xb205('0x8a'):_0xb205('0x81');_0x48d771[_0xb205('0x46')](db[_0xb205('0x35')][_0xb205('0x7b')]({'name':_0x3b2534[_0x342550]['name'],'resourceId':_0x3b2534[_0x342550]['id'],'type':_0xda4c78,'sectionId':_[_0xb205('0x33')](_0x564b6e,['name',_0xda4c78])['id']},{}));}return Promise['all'](_0x48d771);});})[_0xb205('0x28')](respondWithResult(_0x2e40f6,0xc9))[_0xb205('0x1c')](handleError(_0x2e40f6,null));};exports[_0xb205('0x8d')]=function(_0x2881ff,_0x429807){if(_0x2881ff[_0xb205('0x5d')]['id']){delete _0x2881ff[_0xb205('0x5d')]['id'];}return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x2881ff[_0xb205('0x51')]['id']}})['then'](function(_0x4fb0f6){if(!_0x4fb0f6)return null;if(_0x4fb0f6['id']===_0x2881ff['user']['id']){if(!_0x2881ff[_0xb205('0x5d')][_0xb205('0x8e')]||!_0x2881ff[_0xb205('0x5d')]['newPassword']){throw new db['Sequelize'][(_0xb205('0x8f'))](_0xb205('0x90'));}if(!_0x4fb0f6[_0xb205('0x91')](_0x2881ff[_0xb205('0x5d')][_0xb205('0x8e')])){throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))](_0xb205('0x93'));}if(_0x2881ff['body'][_0xb205('0x8e')]===_0x2881ff['body'][_0xb205('0x94')]){throw new db['Sequelize'][(_0xb205('0x8f'))](_0xb205('0x95'));}}else if(_0x2881ff[_0xb205('0x7c')][_0xb205('0x29')]===_0xb205('0x2d')){if(!_0x2881ff[_0xb205('0x5d')][_0xb205('0x94')]){throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))](_0xb205('0x96'));}}else if(_0x2881ff['user'][_0xb205('0x29')]==='user'){if(!_0x2881ff['body'][_0xb205('0x94')]){throw new db[(_0xb205('0x92'))]['ValidationError'](_0xb205('0x96'));}if(_0x4fb0f6['role']!=='agent'){throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))](_0xb205('0x84'));}}else{throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))]('Unauthorized');}return _0x4fb0f6;})['then'](handleEntityNotFound(_0x429807,null))['then'](function(_0x4d00a3){return db[_0xb205('0x62')][_0xb205('0x97')]({'attributes':['id','securePassword',_0xb205('0x98'),_0xb205('0x99')]})['then'](function(_0x15c44e){if(_0x15c44e[_0xb205('0x63')])authService[_0xb205('0x64')](_0x2881ff[_0xb205('0x5d')]['newPassword']);if(!_0x15c44e[_0xb205('0x98')]||!_0x4d00a3[_0xb205('0x9a')])return _0x4d00a3;authService[_0xb205('0x9b')](_0x2881ff[_0xb205('0x5d')][_0xb205('0x94')],_0x4d00a3[_0xb205('0x9a')],_0x15c44e[_0xb205('0x99')]);return _0x4d00a3;})['then'](saveUpdates({'password':_0x2881ff[_0xb205('0x5d')]['newPassword'],'passwordResetAt':_0x2881ff[_0xb205('0x7c')]['id']==_0x2881ff['params']['id']?moment():null,'previousPasswords':authService[_0xb205('0x9c')](_0x2881ff[_0xb205('0x5d')]['newPassword'],_0x4d00a3[_0xb205('0x9a')])},null));})[_0xb205('0x28')](respondWithResult(_0x429807,null))[_0xb205('0x1c')](handleError(_0x429807,null));};exports[_0xb205('0x9d')]=function(_0x101333,_0x1f931b){var _0x36bce9=_0x101333[_0xb205('0x5d')][_0xb205('0x9e')];return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x101333[_0xb205('0x51')]['id']},'attributes':['id',_0xb205('0x34'),_0xb205('0x29'),_0xb205('0x9f'),_0xb205('0xa0'),_0xb205('0xa1'),_0xb205('0xa2')]})['then'](handleEntityNotFound(_0x1f931b,null))[_0xb205('0x28')](function(_0x7562ae){if(_0x7562ae){if(!utils[_0xb205('0xa3')](_0x36bce9)){throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))]('Unknown\x20channel');}return _0x7562ae[_0xb205('0xa4')+_[_0xb205('0xa5')](_0x36bce9[_0xb205('0xa6')]())+'Queues'](_0x101333[_0xb205('0x5d')][_0xb205('0x60')],{'penalty':_0x101333[_0xb205('0x5d')][_0xb205('0xa7')]||0x0})[_0xb205('0xa8')](function(_0x4440f6){for(var _0x19e714=0x0;_0x19e714<_0x101333[_0xb205('0x5d')][_0xb205('0x60')][_0xb205('0x59')];_0x19e714+=0x1){var _0x174087={'UserId':Number(_0x101333[_0xb205('0x51')]['id'])};_0x174087[_[_0xb205('0xa5')](_0x36bce9['toLowerCase']())+'QueueId']=Number(_0x101333['body'][_0xb205('0x60')][_0x19e714]);socket['emit'](_0xb205('0x7c')+_[_0xb205('0xa5')](_0x36bce9[_0xb205('0xa6')]())+_0xb205('0xa9'),_0x174087);}return _0x4440f6;})[_0xb205('0x28')](function(){if(_0x36bce9===_0xb205('0xaa')){return db[_0xb205('0xab')][_0xb205('0x47')]({'where':{'id':_0x101333[_0xb205('0x5d')][_0xb205('0x60')]||[]},'raw':!![],'attributes':['id',_0xb205('0x34')]});}})[_0xb205('0x28')](function(_0x4ebfe8){var _0x702ab8=_0x7562ae[_0xb205('0x2c')]({'plain':!![]});var _0x36142f=[];if(_0x36bce9==='voice'&&_0x702ab8[_0xb205('0x29')]==='agent'&&_0x702ab8[_0xb205('0x9f')]){for(let _0x4948cf=0x0;_0x4948cf<_0x4ebfe8['length'];_0x4948cf+=0x1){_0x36142f['push']({'membername':_0x702ab8[_0xb205('0x34')],'UserId':_0x702ab8['id'],'queue_name':_0x4ebfe8[_0x4948cf]['name'],'VoiceQueueId':_0x4ebfe8[_0x4948cf]['id'],'interface':_[_0xb205('0x66')](_0x702ab8[_0xb205('0xa2')])?util[_0xb205('0xac')](_0xb205('0xad'),_0x702ab8[_0xb205('0x34')]):_0x702ab8['interface'],'paused':_0x702ab8['voicePause']||![],'penalty':_0x101333['body']['penalty']||0x0});}return Promise[_0xb205('0x4f')](_0x36142f[_0xb205('0x87')](function(_0x31b34e){return db[_0xb205('0xae')][_0xb205('0xaf')](_0x31b34e);}));}return _0x7562ae;});}})[_0xb205('0x28')](respondWithStatusCode(_0x1f931b,null))[_0xb205('0x1c')](handleError(_0x1f931b,null));};exports['removeQueues']=function(_0x23931e,_0x54ebc2){var _0x23ae69,_0x6d6b14;return db['User'][_0xb205('0x33')]({'where':{'id':_0x23931e[_0xb205('0x51')]['id']},'attributes':['id',_0xb205('0x34'),_0xb205('0x29')]})[_0xb205('0x28')](handleEntityNotFound(_0x54ebc2,null))[_0xb205('0x28')](function(_0x4490ce){if(_0x4490ce){_0x23ae69=_0x4490ce;if(!_0x23931e['query'][_0xb205('0x9e')]||!utils[_0xb205('0xa3')](_0x23931e['query']['channel'])){throw new db[(_0xb205('0x92'))]['ValidationError'](_0xb205('0xb0'));}return _0x4490ce['remove'+_[_0xb205('0xa5')](_0x23931e['query'][_0xb205('0x9e')][_0xb205('0xa6')]())+_0xb205('0xb1')](_0x23931e[_0xb205('0x41')][_0xb205('0x60')]);}})[_0xb205('0x28')](function(_0x308c4b){if(_[_0xb205('0xb2')](_0x23931e[_0xb205('0x41')]['ids'])){for(var _0x59004b=0x0;_0x59004b<_0x23931e['query'][_0xb205('0x60')][_0xb205('0x59')];_0x59004b+=0x1){_0x6d6b14={'UserId':Number(_0x23931e[_0xb205('0x51')]['id'])};_0x6d6b14[_['capitalize'](_0x23931e['query'][_0xb205('0x9e')][_0xb205('0xa6')]())+_0xb205('0xb3')]=Number(_0x23931e['query'][_0xb205('0x60')][_0x59004b]);socket[_0xb205('0x2a')](_0xb205('0x7c')+_[_0xb205('0xa5')](_0x23931e[_0xb205('0x41')]['channel'][_0xb205('0xa6')]())+_0xb205('0xb4'),_0x6d6b14);}}else{_0x6d6b14={'UserId':Number(_0x23931e[_0xb205('0x51')]['id'])};_0x6d6b14[_[_0xb205('0xa5')](_0x23931e[_0xb205('0x41')][_0xb205('0x9e')][_0xb205('0xa6')]())+_0xb205('0xb3')]=Number(_0x23931e[_0xb205('0x41')][_0xb205('0x60')]);socket[_0xb205('0x2a')](_0xb205('0x7c')+_['capitalize'](_0x23931e[_0xb205('0x41')][_0xb205('0x9e')][_0xb205('0xa6')]())+'Queue:remove',_0x6d6b14);}return _0x308c4b;})[_0xb205('0x28')](function(){if(_0x23931e['query']['channel']==='voice'){return db[_0xb205('0xae')]['destroy']({'where':{'UserId':_0x23931e[_0xb205('0x51')]['id'],'VoiceQueueId':_0x23931e['query'][_0xb205('0x60')]},'individualHooks':!![]})[_0xb205('0x28')](function(){return _0x23ae69;});}return _0x23ae69;})[_0xb205('0x28')](respondWithStatusCode(_0x54ebc2,null))[_0xb205('0x1c')](handleError(_0x54ebc2,null));};exports[_0xb205('0xb5')]=function(_0x57f0b5,_0x13d720){_0x57f0b5[_0xb205('0x5d')][_0xb205('0xb6')]=_0x57f0b5[_0xb205('0xb7')][_0xb205('0xb8')];return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x57f0b5[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x13d720,null))[_0xb205('0x28')](saveUpdates(_0x57f0b5[_0xb205('0x5d')],null))[_0xb205('0x28')](respondWithResult(_0x13d720,null))[_0xb205('0x1c')](handleError(_0x13d720,null));};exports[_0xb205('0xb9')]=function(_0x24b05f,_0x21c485){var _0x3b06b3=path['join'](config[_0xb205('0xba')],_0xb205('0xbb'));return db['User'][_0xb205('0x33')]({'where':{'id':_0x24b05f['params']['id']},'attributes':['id',_0xb205('0xb6')],'raw':!![]})[_0xb205('0x28')](handleEntityNotFound(_0x21c485,null))[_0xb205('0x28')](function(_0x4229a9){if(_0x4229a9){if(_[_0xb205('0x66')](_0x4229a9['userpic'])){return _0x21c485[_0xb205('0xbc')](_0x3b06b3);}else{if(!fs['existsSync'](path['join'](config[_0xb205('0xba')],_0xb205('0xbd'),_0x4229a9['userpic']))){return _0x21c485[_0xb205('0xbc')](_0x3b06b3);}return _0x21c485[_0xb205('0xbc')](path[_0xb205('0xbe')](config[_0xb205('0xba')],_0xb205('0xbd'),_0x4229a9[_0xb205('0xb6')]));}}})[_0xb205('0x1c')](handleError(_0x21c485,null));};exports[_0xb205('0xbf')]=function(_0x4e678a,_0xd58f4d){return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x4e678a[_0xb205('0x51')]['id']},'attributes':['id']})[_0xb205('0x28')](handleEntityNotFound(_0xd58f4d,null))['then'](function(_0x13cb6e){var _0x21f04d=[];values=_0x13cb6e[_0xb205('0x4a')];_0x21f04d[_0xb205('0x46')](get_open_tabs(_0xb205('0x5b'),_0x13cb6e[_0xb205('0x4a')]));_0x21f04d[_0xb205('0x46')](get_open_tabs(_0xb205('0x4b'),_0x13cb6e[_0xb205('0x4a')]));_0x21f04d['push'](get_open_tabs(_0xb205('0x4d'),_0x13cb6e['dataValues']));_0x21f04d[_0xb205('0x46')](get_open_tabs(_0xb205('0x4e'),_0x13cb6e['dataValues']));_0x21f04d[_0xb205('0x46')](get_open_tabs(_0xb205('0x4c'),_0x13cb6e[_0xb205('0x4a')]));_0x21f04d[_0xb205('0x46')](get_open_tabs(_0xb205('0x5c'),_0x13cb6e[_0xb205('0x4a')]));return Promise['all'](_0x21f04d);})[_0xb205('0x28')](function(_0x43dd24){if(_0x43dd24){var _0x4f82b4=_['map'](values[_0xb205('0xc0')],function(_0x176cfe){return{'channel':_0xb205('0xc1'),'id':_0x176cfe['id'],'createdAt':_0x176cfe[_0xb205('0xc2')]};});var _0x1c6ca9=_[_0xb205('0x87')](values[_0xb205('0xc3')],function(_0xcec013){return{'channel':_0xb205('0xc4'),'id':_0xcec013['id'],'createdAt':_0xcec013['createdAt']};});var _0x436deb=_[_0xb205('0x87')](values[_0xb205('0xc5')],function(_0x164f52){return{'channel':'OPENCHANNEL','id':_0x164f52['id'],'createdAt':_0x164f52[_0xb205('0xc2')]};});var _0x259d09=_['map'](values[_0xb205('0xc6')],function(_0x28f356){return{'channel':'MAIL','id':_0x28f356['id'],'createdAt':_0x28f356[_0xb205('0xc2')]};});var _0x472369=_[_0xb205('0x87')](values[_0xb205('0xc7')],function(_0x198e40){return{'channel':_0xb205('0xc8'),'id':_0x198e40['id'],'createdAt':_0x198e40[_0xb205('0xc2')]};});var _0x17830c=_[_0xb205('0x87')](values[_0xb205('0xc9')],function(_0x4afae2){return{'channel':_0xb205('0xca'),'id':_0x4afae2['id'],'createdAt':_0x4afae2['createdAt']};});var _0x1c2700=_[_0xb205('0xcb')](_0x4f82b4,_0x1c6ca9,_0x436deb,_0x259d09,_0x472369,_0x17830c);var _0xef4cc2={'count':_0x1c2700[_0xb205('0x59')],'rows':_0x1c2700};return _0xef4cc2;}else return null;})['then'](respondWithResult(_0xd58f4d,null))[_0xb205('0x1c')](handleError(_0xd58f4d,null));};exports[_0xb205('0xcc')]=function(_0x3cf52f,_0xbd522e){var _0x46df9d={};var _0x5bb61d={};var _0x2efece;var _0x444fcb;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x3cf52f[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0xbd522e,null))[_0xb205('0x28')](function(_0x2678e0){if(_0x2678e0){_0x2efece=_0x2678e0;_0x5bb61d[_0xb205('0x52')]=_['keys'](db[_0xb205('0xcd')][_0xb205('0x3b')]);_0x5bb61d[_0xb205('0x41')]=_['keys'](_0x3cf52f[_0xb205('0x41')]);_0x5bb61d[_0xb205('0x55')]=_[_0xb205('0x56')](_0x5bb61d[_0xb205('0x52')],_0x5bb61d[_0xb205('0x41')]);_0x46df9d[_0xb205('0x57')]=_[_0xb205('0x56')](_0x5bb61d[_0xb205('0x52')],qs[_0xb205('0x58')](_0x3cf52f['query'][_0xb205('0x58')]));_0x46df9d[_0xb205('0x57')]=_0x46df9d[_0xb205('0x57')][_0xb205('0x59')]?_0x46df9d[_0xb205('0x57')]:_0x5bb61d['model'];_0x46df9d[_0xb205('0xce')]=qs['sort'](_0x3cf52f['query'][_0xb205('0xcf')]);_0x46df9d[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x3cf52f[_0xb205('0x41')],_0x5bb61d['filters']));if(_0x3cf52f[_0xb205('0x41')]['filter']){_0x46df9d[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x46df9d['where'],{'$or':_['map'](_0x46df9d[_0xb205('0x57')],function(_0x710872){var _0x2a2742={};_0x2a2742[_0x710872]={'$like':'%'+_0x3cf52f[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x2a2742;})});}_0x46df9d=_[_0xb205('0xd1')]({},_0x46df9d,_0x3cf52f[_0xb205('0xd2')]);return _0x2efece[_0xb205('0xcc')](_0x46df9d);}})['then'](function(_0x319590){if(_0x319590){_0x444fcb=_0x319590[_0xb205('0x59')];if(_0x3cf52f[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0x42'))){_0x46df9d[_0xb205('0x43')]=[{'model':db[_0xb205('0xd4')],'as':'List','required':![]},{'model':db['Tag'],'as':_0xb205('0xd5'),'attributes':['id','name',_0xb205('0xd6')],'where':_0x3cf52f[_0xb205('0x41')][_0xb205('0xd7')]?{'id':_0x3cf52f[_0xb205('0x41')][_0xb205('0xd7')]}:undefined,'required':_0x3cf52f[_0xb205('0x41')]['tag']?!![]:![]}];}if(!_0x3cf52f[_0xb205('0x41')]['hasOwnProperty']('nolimit')){_0x46df9d[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x3cf52f['query'][_0xb205('0x23')]);_0x46df9d['offset']=qs['offset'](_0x3cf52f[_0xb205('0x41')][_0xb205('0x21')]);}return _0x2efece[_0xb205('0xcc')](_0x46df9d);}})[_0xb205('0x28')](function(_0x308466){if(_0x308466){return _0x308466?{'count':_0x444fcb,'rows':_0x308466}:null;}})['then'](respondWithResult(_0xbd522e,null))['catch'](handleError(_0xbd522e,null));};exports[_0xb205('0xd8')]=function(_0x524bd7,_0x160986){var _0x14fc9a;var _0x339b1a={};var _0x283af7;return db['User'][_0xb205('0x97')]({'where':{'id':_0x524bd7['params']['id']},'attributes':['id',_0xb205('0x34'),_0xb205('0x29')]})[_0xb205('0x28')](handleEntityNotFound(_0x160986,null))['then'](function(_0x54ca00){if(!utils[_0xb205('0xa3')](_0x524bd7[_0xb205('0x41')][_0xb205('0x9e')])){throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))](_0xb205('0xb0'));}_0x14fc9a=_0x54ca00;var _0x4be3a7={};_0x4be3a7[_0xb205('0x52')]=_[_0xb205('0x54')](db[_['capitalize'](_0x524bd7[_0xb205('0x41')][_0xb205('0x9e')])+_0xb205('0xd9')][_0xb205('0x3b')]);_0x4be3a7[_0xb205('0x41')]=_[_0xb205('0x54')](_0x524bd7['query']);_0x4be3a7[_0xb205('0x55')]=_[_0xb205('0x56')](_0x4be3a7[_0xb205('0x52')],_0x4be3a7['query']);_0x339b1a[_0xb205('0x57')]=_[_0xb205('0x56')](_0x4be3a7[_0xb205('0x52')],qs[_0xb205('0x58')](_0x524bd7['query'][_0xb205('0x58')]));_0x339b1a['attributes']=_0x339b1a[_0xb205('0x57')][_0xb205('0x59')]?_0x339b1a[_0xb205('0x57')]:_0x4be3a7['model'];_0x339b1a[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x524bd7[_0xb205('0x41')][_0xb205('0xcf')]);_0x339b1a[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x524bd7[_0xb205('0x41')],_0x4be3a7[_0xb205('0x55')]));if(_0x524bd7['query'][_0xb205('0x2f')]){_0x339b1a[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x339b1a[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x339b1a[_0xb205('0x57')],function(_0x5117c7){var _0x580a2d={};_0x580a2d[_0x5117c7]={'$like':'%'+_0x524bd7[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x580a2d;})});}_0x339b1a=_[_0xb205('0xd1')]({},_0x339b1a,_0x524bd7['options']);switch(_0x14fc9a[_0xb205('0x29')]){case _0xb205('0x2d'):return db[_[_0xb205('0xa5')](_0x524bd7['query'][_0xb205('0x9e')])+_0xb205('0xd9')]['findAll'](_0x339b1a);case _0xb205('0x7c'):case _0xb205('0x2e'):return _0x14fc9a[_0xb205('0x2c')+_[_0xb205('0xa5')](_0x524bd7['query'][_0xb205('0x9e')])+_0xb205('0xb1')](_0x339b1a);default:throw new db[(_0xb205('0x92'))]['ValidationError'](_0xb205('0xda'));}})['then'](function(_0x4e0b1b){_0x283af7=_0x4e0b1b['length'];if(!_0x524bd7[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x339b1a[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x524bd7[_0xb205('0x41')]['limit']);_0x339b1a[_0xb205('0x21')]=qs[_0xb205('0x21')](_0x524bd7['query'][_0xb205('0x21')]);}switch(_0x14fc9a[_0xb205('0x29')]){case _0xb205('0x2d'):return db[_['capitalize'](_0x524bd7[_0xb205('0x41')][_0xb205('0x9e')])+'Queue']['findAll'](_0x339b1a);case _0xb205('0x7c'):case _0xb205('0x2e'):return _0x14fc9a['get'+_[_0xb205('0xa5')](_0x524bd7[_0xb205('0x41')][_0xb205('0x9e')])+_0xb205('0xb1')](_0x339b1a);}})['then'](function(_0x1566c9){return{'count':_0x283af7,'rows':_0x1566c9};})[_0xb205('0x28')](respondWithResult(_0x160986,null))[_0xb205('0x1c')](handleError(_0x160986,null));};exports[_0xb205('0xdc')]=function(_0x4719fe,_0x5b3ee2){var _0x473c7c={};var _0x1bb5d8={};var _0x1116ba;var _0x317388;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x4719fe[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x5b3ee2,null))[_0xb205('0x28')](function(_0xe1c849){if(_0xe1c849){_0x1116ba=_0xe1c849;_0x1bb5d8[_0xb205('0x52')]=_['keys'](db[_0xb205('0xae')][_0xb205('0x3b')]);_0x1bb5d8[_0xb205('0x41')]=_[_0xb205('0x54')](_0x4719fe['query']);_0x1bb5d8[_0xb205('0x55')]=_[_0xb205('0x56')](_0x1bb5d8[_0xb205('0x52')],_0x1bb5d8[_0xb205('0x41')]);_0x473c7c[_0xb205('0x57')]=_['intersection'](_0x1bb5d8[_0xb205('0x52')],qs[_0xb205('0x58')](_0x4719fe[_0xb205('0x41')][_0xb205('0x58')]));_0x473c7c[_0xb205('0x57')]=_0x473c7c['attributes'][_0xb205('0x59')]?_0x473c7c[_0xb205('0x57')]:_0x1bb5d8['model'];_0x473c7c['order']=qs['sort'](_0x4719fe[_0xb205('0x41')][_0xb205('0xcf')]);_0x473c7c[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x4719fe[_0xb205('0x41')],_0x1bb5d8[_0xb205('0x55')]));if(_0x4719fe['query']['filter']){_0x473c7c['where']=_['merge'](_0x473c7c['where'],{'$or':_[_0xb205('0x87')](_0x473c7c['attributes'],function(_0x3e874c){var _0x3e9e14={};_0x3e9e14[_0x3e874c]={'$like':'%'+_0x4719fe[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x3e9e14;})});}_0x473c7c=_[_0xb205('0xd1')]({},_0x473c7c,_0x4719fe[_0xb205('0xd2')]);return _0x1116ba[_0xb205('0xdc')](_0x473c7c);}})[_0xb205('0x28')](function(_0x51ffb0){if(_0x51ffb0){_0x317388=_0x51ffb0[_0xb205('0x59')];if(!_0x4719fe[_0xb205('0x41')]['hasOwnProperty'](_0xb205('0xdb'))){_0x473c7c[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x4719fe[_0xb205('0x41')][_0xb205('0x23')]);_0x473c7c['offset']=qs[_0xb205('0x21')](_0x4719fe[_0xb205('0x41')][_0xb205('0x21')]);}return _0x1116ba['getVoiceQueuesRt'](_0x473c7c);}})['then'](function(_0x2dbfd5){if(_0x2dbfd5){return _0x2dbfd5?{'count':_0x317388,'rows':_0x2dbfd5}:null;}})[_0xb205('0x28')](respondWithResult(_0x5b3ee2,null))['catch'](handleError(_0x5b3ee2,null));};exports['getGroups']=function(_0x36ca15,_0x3bcf01){var _0x5dd9d0={};var _0x5b3a59={};var _0x4a3bf1;var _0x26e1e8;return db[_0xb205('0x3a')]['findOne']({'where':{'id':_0x36ca15['params']['id']}})['then'](handleEntityNotFound(_0x3bcf01,null))['then'](function(_0x105933){if(_0x105933){_0x4a3bf1=_0x105933;_0x5b3a59[_0xb205('0x52')]=_['keys'](db[_0xb205('0xdd')][_0xb205('0x3b')]);_0x5b3a59[_0xb205('0x41')]=_[_0xb205('0x54')](_0x36ca15[_0xb205('0x41')]);_0x5b3a59[_0xb205('0x55')]=_[_0xb205('0x56')](_0x5b3a59[_0xb205('0x52')],_0x5b3a59[_0xb205('0x41')]);_0x5dd9d0[_0xb205('0x57')]=_[_0xb205('0x56')](_0x5b3a59['model'],qs[_0xb205('0x58')](_0x36ca15['query'][_0xb205('0x58')]));_0x5dd9d0[_0xb205('0x57')]=_0x5dd9d0[_0xb205('0x57')][_0xb205('0x59')]?_0x5dd9d0['attributes']:_0x5b3a59[_0xb205('0x52')];_0x5dd9d0[_0xb205('0xce')]=qs['sort'](_0x36ca15[_0xb205('0x41')][_0xb205('0xcf')]);_0x5dd9d0[_0xb205('0x40')]=qs['filters'](_['pick'](_0x36ca15[_0xb205('0x41')],_0x5b3a59[_0xb205('0x55')]));if(_0x36ca15['query'][_0xb205('0x2f')]){_0x5dd9d0[_0xb205('0x40')]=_['merge'](_0x5dd9d0['where'],{'$or':_[_0xb205('0x87')](_0x5dd9d0[_0xb205('0x57')],function(_0x4c7850){var _0x50c5b1={};_0x50c5b1[_0x4c7850]={'$like':'%'+_0x36ca15[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x50c5b1;})});}_0x5dd9d0=_[_0xb205('0xd1')]({},_0x5dd9d0,_0x36ca15[_0xb205('0xd2')]);return _0x4a3bf1[_0xb205('0xde')](_0x5dd9d0);}})[_0xb205('0x28')](function(_0x4c8c68){if(_0x4c8c68){_0x26e1e8=_0x4c8c68['length'];if(!_0x36ca15[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x5dd9d0[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x36ca15[_0xb205('0x41')][_0xb205('0x23')]);_0x5dd9d0[_0xb205('0x21')]=qs['offset'](_0x36ca15[_0xb205('0x41')]['offset']);}return _0x4a3bf1['getGroups'](_0x5dd9d0);}})[_0xb205('0x28')](function(_0x122058){if(_0x122058){return _0x122058?{'count':_0x26e1e8,'rows':_0x122058}:null;}})[_0xb205('0x28')](respondWithResult(_0x3bcf01,null))[_0xb205('0x1c')](handleError(_0x3bcf01,null));};exports[_0xb205('0xdf')]=function(_0x5e490b,_0x1894d9){var _0x35de30={'raw':!![],'where':{}};var _0x326a2c={};var _0x9156f4={'count':0x0,'rows':[]};return db['User'][_0xb205('0x97')]({'where':{'id':_0x5e490b[_0xb205('0x51')]['id']}})['then'](handleEntityNotFound(_0x1894d9,null))['then'](function(_0x50ddb5){if(_0x50ddb5){_0x326a2c[_0xb205('0x52')]=_[_0xb205('0x54')](db['VoiceRecording'][_0xb205('0x3b')]);_0x326a2c[_0xb205('0x41')]=_[_0xb205('0x54')](_0x5e490b['query']);_0x326a2c[_0xb205('0x55')]=_[_0xb205('0x56')](_0x326a2c[_0xb205('0x52')],_0x326a2c[_0xb205('0x41')]);_0x35de30['attributes']=_[_0xb205('0x56')](_0x326a2c[_0xb205('0x52')],qs['fields'](_0x5e490b['query']['fields']));_0x35de30['attributes']=_0x35de30[_0xb205('0x57')][_0xb205('0x59')]?_0x35de30[_0xb205('0x57')]:_0x326a2c[_0xb205('0x52')];if(!_0x5e490b[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x35de30[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x5e490b[_0xb205('0x41')][_0xb205('0x23')]);_0x35de30[_0xb205('0x21')]=qs[_0xb205('0x21')](_0x5e490b['query'][_0xb205('0x21')]);}_0x35de30[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x5e490b[_0xb205('0x41')][_0xb205('0xcf')]);_0x35de30[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x5e490b[_0xb205('0x41')],_0x326a2c[_0xb205('0x55')]));_0x35de30[_0xb205('0x40')][_0xb205('0xe0')]=_0x50ddb5['id'];if(_0x5e490b[_0xb205('0x41')]['filter']){_0x35de30[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x35de30[_0xb205('0x40')],{'$or':_['map'](_0x35de30['attributes'],function(_0x567d5a){var _0x4d6808={};_0x4d6808[_0x567d5a]={'$like':'%'+_0x5e490b['query']['filter']+'%'};return _0x4d6808;})});}_0x35de30=_[_0xb205('0xd1')]({},_0x35de30,_0x5e490b[_0xb205('0xd2')]);return db[_0xb205('0xe1')]['count']({'where':_0x35de30['where']})[_0xb205('0x28')](function(_0x413ed5){_0x9156f4[_0xb205('0x24')]=_0x413ed5;if(_0x5e490b['query'][_0xb205('0x42')]){_0x35de30['include']=[{'all':!![]}];}return db[_0xb205('0xe1')][_0xb205('0x47')](_0x35de30);})[_0xb205('0x28')](function(_0x372947){_0x9156f4[_0xb205('0x48')]=_0x372947;return _0x9156f4;});}})['then'](respondWithFilteredResult(_0x1894d9,_0x35de30))[_0xb205('0x1c')](handleError(_0x1894d9,null));};exports[_0xb205('0xe2')]=function(_0x7b5ed,_0x4743af){var _0x46a8bd={'raw':!![],'where':{}};var _0x290ed4={};var _0x5c7bce={'count':0x0,'rows':[]};return db['User'][_0xb205('0x97')]({'where':{'id':_0x7b5ed['params']['id']}})['then'](handleEntityNotFound(_0x4743af,null))[_0xb205('0x28')](function(_0x212349){if(_0x212349){_0x290ed4['model']=_[_0xb205('0x54')](db[_0xb205('0xe3')][_0xb205('0x3b')]);_0x290ed4[_0xb205('0x41')]=_[_0xb205('0x54')](_0x7b5ed['query']);_0x290ed4[_0xb205('0x55')]=_[_0xb205('0x56')](_0x290ed4[_0xb205('0x52')],_0x290ed4[_0xb205('0x41')]);_0x46a8bd[_0xb205('0x57')]=_[_0xb205('0x56')](_0x290ed4['model'],qs[_0xb205('0x58')](_0x7b5ed[_0xb205('0x41')][_0xb205('0x58')]));_0x46a8bd[_0xb205('0x57')]=_0x46a8bd[_0xb205('0x57')][_0xb205('0x59')]?_0x46a8bd['attributes']:_0x290ed4[_0xb205('0x52')];if(!_0x7b5ed[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x46a8bd[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x7b5ed['query'][_0xb205('0x23')]);_0x46a8bd[_0xb205('0x21')]=qs['offset'](_0x7b5ed[_0xb205('0x41')][_0xb205('0x21')]);}_0x46a8bd[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x7b5ed[_0xb205('0x41')]['sort']);_0x46a8bd[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x7b5ed['query'],_0x290ed4['filters']));_0x46a8bd[_0xb205('0x40')]['UserId']=_0x212349['id'];if(_0x7b5ed[_0xb205('0x41')]['filter']){_0x46a8bd[_0xb205('0x40')]=_['merge'](_0x46a8bd[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x46a8bd[_0xb205('0x57')],function(_0x16dff7){var _0x2cea94={};_0x2cea94[_0x16dff7]={'$like':'%'+_0x7b5ed['query'][_0xb205('0x2f')]+'%'};return _0x2cea94;})});}_0x46a8bd=_[_0xb205('0xd1')]({},_0x46a8bd,_0x7b5ed[_0xb205('0xd2')]);return db[_0xb205('0xe3')][_0xb205('0x24')]({'where':_0x46a8bd['where']})[_0xb205('0x28')](function(_0x34febd){_0x5c7bce[_0xb205('0x24')]=_0x34febd;if(_0x7b5ed[_0xb205('0x41')]['includeAll']){_0x46a8bd[_0xb205('0x43')]=[{'all':!![]}];}return db[_0xb205('0xe3')][_0xb205('0x47')](_0x46a8bd);})[_0xb205('0x28')](function(_0x5bb28f){_0x5c7bce['rows']=_0x5bb28f;return _0x5c7bce;});}})['then'](respondWithFilteredResult(_0x4743af,_0x46a8bd))[_0xb205('0x1c')](handleError(_0x4743af,null));};exports[_0xb205('0xe4')]=function(_0x21f681,_0x472526){var _0xdb2b96={};var _0x227e72={};var _0xe730f2;var _0x589728;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x21f681[_0xb205('0x51')]['id']}})['then'](handleEntityNotFound(_0x472526,null))[_0xb205('0x28')](function(_0x207f70){if(_0x207f70){_0xe730f2=_0x207f70;_0x227e72['model']=_[_0xb205('0x54')](db[_0xb205('0xe5')][_0xb205('0x3b')]);_0x227e72[_0xb205('0x41')]=_[_0xb205('0x54')](_0x21f681[_0xb205('0x41')]);_0x227e72[_0xb205('0x55')]=_[_0xb205('0x56')](_0x227e72['model'],_0x227e72[_0xb205('0x41')]);_0xdb2b96['attributes']=_[_0xb205('0x56')](_0x227e72[_0xb205('0x52')],qs[_0xb205('0x58')](_0x21f681['query']['fields']));_0xdb2b96[_0xb205('0x57')]=_0xdb2b96[_0xb205('0x57')][_0xb205('0x59')]?_0xdb2b96[_0xb205('0x57')]:_0x227e72['model'];_0xdb2b96[_0xb205('0xce')]=qs['sort'](_0x21f681[_0xb205('0x41')][_0xb205('0xcf')]);_0xdb2b96[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x21f681[_0xb205('0x41')],_0x227e72['filters']));if(_0x21f681[_0xb205('0x41')][_0xb205('0x2f')]){_0xdb2b96[_0xb205('0x40')]=_[_0xb205('0xd1')](_0xdb2b96[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0xdb2b96[_0xb205('0x57')],function(_0x58305d){var _0x58f92b={};_0x58f92b[_0x58305d]={'$like':'%'+_0x21f681['query']['filter']+'%'};return _0x58f92b;})});}_0xdb2b96=_[_0xb205('0xd1')]({},_0xdb2b96,_0x21f681[_0xb205('0xd2')]);return _0xe730f2[_0xb205('0xe4')](_0xdb2b96);}})[_0xb205('0x28')](function(_0xc7fb79){if(_0xc7fb79){_0x589728=_0xc7fb79[_0xb205('0x59')];if(!_0x21f681[_0xb205('0x41')]['hasOwnProperty']('nolimit')){_0xdb2b96['limit']=qs[_0xb205('0x23')](_0x21f681[_0xb205('0x41')][_0xb205('0x23')]);_0xdb2b96[_0xb205('0x21')]=qs['offset'](_0x21f681[_0xb205('0x41')][_0xb205('0x21')]);}return _0xe730f2[_0xb205('0xe4')](_0xdb2b96);}})[_0xb205('0x28')](function(_0xaf56a9){if(_0xaf56a9){return _0xaf56a9?{'count':_0x589728,'rows':_0xaf56a9}:null;}})[_0xb205('0x28')](respondWithResult(_0x472526,null))[_0xb205('0x1c')](handleError(_0x472526,null));};exports[_0xb205('0xe6')]=function(_0x1ceaf1,_0x190f4b){var _0x33061b={};var _0x1b2111={};var _0x531e23;var _0x2236a8;return db['User'][_0xb205('0x97')]({'where':{'id':_0x1ceaf1['params']['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x190f4b,null))[_0xb205('0x28')](function(_0x48097c){if(_0x48097c){_0x531e23=_0x48097c;_0x1b2111['model']=_['keys'](db[_0xb205('0xe7')][_0xb205('0x3b')]);_0x1b2111[_0xb205('0x41')]=_['keys'](_0x1ceaf1[_0xb205('0x41')]);_0x1b2111[_0xb205('0x55')]=_[_0xb205('0x56')](_0x1b2111[_0xb205('0x52')],_0x1b2111[_0xb205('0x41')]);_0x33061b[_0xb205('0x57')]=_[_0xb205('0x56')](_0x1b2111['model'],qs[_0xb205('0x58')](_0x1ceaf1[_0xb205('0x41')][_0xb205('0x58')]));_0x33061b[_0xb205('0x57')]=_0x33061b['attributes'][_0xb205('0x59')]?_0x33061b['attributes']:_0x1b2111[_0xb205('0x52')];_0x33061b[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x1ceaf1[_0xb205('0x41')]['sort']);_0x33061b['where']=qs['filters'](_[_0xb205('0xd0')](_0x1ceaf1[_0xb205('0x41')],_0x1b2111[_0xb205('0x55')]));if(_0x1ceaf1[_0xb205('0x41')][_0xb205('0x2f')]){_0x33061b[_0xb205('0x40')]=_['merge'](_0x33061b[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x33061b[_0xb205('0x57')],function(_0x32f63){var _0x1db221={};_0x1db221[_0x32f63]={'$like':'%'+_0x1ceaf1[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x1db221;})});}_0x33061b=_['merge']({},_0x33061b,_0x1ceaf1[_0xb205('0xd2')]);return _0x531e23[_0xb205('0xe6')](_0x33061b);}})[_0xb205('0x28')](function(_0x27e260){if(_0x27e260){_0x2236a8=_0x27e260['length'];if(!_0x1ceaf1[_0xb205('0x41')]['hasOwnProperty'](_0xb205('0xdb'))){_0x33061b[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x1ceaf1[_0xb205('0x41')][_0xb205('0x23')]);_0x33061b['offset']=qs[_0xb205('0x21')](_0x1ceaf1[_0xb205('0x41')][_0xb205('0x21')]);}return _0x531e23[_0xb205('0xe6')](_0x33061b);}})['then'](function(_0x19dbe7){if(_0x19dbe7){return _0x19dbe7?{'count':_0x2236a8,'rows':_0x19dbe7}:null;}})[_0xb205('0x28')](respondWithResult(_0x190f4b,null))['catch'](handleError(_0x190f4b,null));};exports['getMailInteractions']=function(_0x2b264e,_0x2320ad){var _0x270b83={'raw':!![],'where':{}};var _0x473b0c={};var _0x286985={'count':0x0,'rows':[]};return db['User'][_0xb205('0x97')]({'where':{'id':_0x2b264e[_0xb205('0x51')]['id']}})['then'](handleEntityNotFound(_0x2320ad,null))['then'](function(_0x1805ac){if(_0x1805ac){_0x473b0c[_0xb205('0x52')]=_[_0xb205('0x54')](db['MailInteraction'][_0xb205('0x3b')]);_0x473b0c[_0xb205('0x41')]=_[_0xb205('0x54')](_0x2b264e['query']);_0x473b0c[_0xb205('0x55')]=_[_0xb205('0x56')](_0x473b0c[_0xb205('0x52')],_0x473b0c[_0xb205('0x41')]);_0x270b83['attributes']=_[_0xb205('0x56')](_0x473b0c['model'],qs[_0xb205('0x58')](_0x2b264e[_0xb205('0x41')][_0xb205('0x58')]));_0x270b83[_0xb205('0x57')]=_0x270b83[_0xb205('0x57')][_0xb205('0x59')]?_0x270b83['attributes']:_0x473b0c[_0xb205('0x52')];if(!_0x2b264e['query'][_0xb205('0xd3')]('nolimit')){_0x270b83[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x2b264e[_0xb205('0x41')][_0xb205('0x23')]);_0x270b83[_0xb205('0x21')]=qs['offset'](_0x2b264e[_0xb205('0x41')]['offset']);}_0x270b83[_0xb205('0xce')]=qs['sort'](_0x2b264e[_0xb205('0x41')][_0xb205('0xcf')]);_0x270b83['where']=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x2b264e['query'],_0x473b0c[_0xb205('0x55')]));_0x270b83[_0xb205('0x40')]['UserId']=_0x1805ac['id'];if(_0x2b264e[_0xb205('0x41')][_0xb205('0x2f')]){_0x270b83['where']=_[_0xb205('0xd1')](_0x270b83['where'],{'$or':_['map'](_0x270b83[_0xb205('0x57')],function(_0xfd30fa){var _0x7a50b7={};_0x7a50b7[_0xfd30fa]={'$like':'%'+_0x2b264e[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x7a50b7;})});}_0x270b83=_[_0xb205('0xd1')]({},_0x270b83,_0x2b264e[_0xb205('0xd2')]);return db[_0xb205('0xe8')]['count']({'where':_0x270b83[_0xb205('0x40')]})[_0xb205('0x28')](function(_0x12bad5){_0x286985[_0xb205('0x24')]=_0x12bad5;if(_0x2b264e[_0xb205('0x41')][_0xb205('0x42')]){_0x270b83['include']=[{'all':!![]}];}return db[_0xb205('0xe8')][_0xb205('0x47')](_0x270b83);})[_0xb205('0x28')](function(_0x5cffa4){_0x286985[_0xb205('0x48')]=_0x5cffa4;return _0x286985;});}})[_0xb205('0x28')](respondWithFilteredResult(_0x2320ad,_0x270b83))[_0xb205('0x1c')](handleError(_0x2320ad,null));};exports[_0xb205('0xe9')]=function(_0x5a4feb,_0x4c792b){var _0x39dc47={};var _0xc57f49={};var _0x10b42e;var _0x1876b6;return db['User'][_0xb205('0x97')]({'where':{'id':_0x5a4feb['params']['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x4c792b,null))[_0xb205('0x28')](function(_0x1e67cf){if(_0x1e67cf){_0x10b42e=_0x1e67cf;_0xc57f49[_0xb205('0x52')]=_[_0xb205('0x54')](db['SmsInteraction']['rawAttributes']);_0xc57f49[_0xb205('0x41')]=_[_0xb205('0x54')](_0x5a4feb[_0xb205('0x41')]);_0xc57f49[_0xb205('0x55')]=_[_0xb205('0x56')](_0xc57f49[_0xb205('0x52')],_0xc57f49[_0xb205('0x41')]);_0x39dc47['attributes']=_['intersection'](_0xc57f49['model'],qs['fields'](_0x5a4feb['query']['fields']));_0x39dc47['attributes']=_0x39dc47[_0xb205('0x57')][_0xb205('0x59')]?_0x39dc47['attributes']:_0xc57f49[_0xb205('0x52')];_0x39dc47[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x5a4feb[_0xb205('0x41')][_0xb205('0xcf')]);_0x39dc47[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x5a4feb[_0xb205('0x41')],_0xc57f49[_0xb205('0x55')]));if(_0x5a4feb[_0xb205('0x41')][_0xb205('0x2f')]){_0x39dc47[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x39dc47[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x39dc47[_0xb205('0x57')],function(_0x2c92d7){var _0x27d6df={};_0x27d6df[_0x2c92d7]={'$like':'%'+_0x5a4feb[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x27d6df;})});}_0x39dc47=_[_0xb205('0xd1')]({},_0x39dc47,_0x5a4feb[_0xb205('0xd2')]);return _0x10b42e['getSmsInteractions'](_0x39dc47);}})[_0xb205('0x28')](function(_0x1dfdcf){if(_0x1dfdcf){_0x1876b6=_0x1dfdcf[_0xb205('0x59')];if(!_0x5a4feb[_0xb205('0x41')]['hasOwnProperty'](_0xb205('0xdb'))){_0x39dc47['limit']=qs[_0xb205('0x23')](_0x5a4feb[_0xb205('0x41')][_0xb205('0x23')]);_0x39dc47[_0xb205('0x21')]=qs['offset'](_0x5a4feb[_0xb205('0x41')][_0xb205('0x21')]);}return _0x10b42e['getSmsInteractions'](_0x39dc47);}})[_0xb205('0x28')](function(_0x57d11d){if(_0x57d11d){return _0x57d11d?{'count':_0x1876b6,'rows':_0x57d11d}:null;}})[_0xb205('0x28')](respondWithResult(_0x4c792b,null))[_0xb205('0x1c')](handleError(_0x4c792b,null));};exports[_0xb205('0xea')]=function(_0x5897c3,_0x3cd2bb){var _0x12c487={};var _0xd3eb9b={};var _0x392b95;var _0x1e64b0;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x5897c3['params']['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x3cd2bb,null))[_0xb205('0x28')](function(_0x2bb4c4){if(_0x2bb4c4){_0x392b95=_0x2bb4c4;_0xd3eb9b[_0xb205('0x52')]=_[_0xb205('0x54')](db['FaxInteraction']['rawAttributes']);_0xd3eb9b['query']=_[_0xb205('0x54')](_0x5897c3['query']);_0xd3eb9b[_0xb205('0x55')]=_['intersection'](_0xd3eb9b[_0xb205('0x52')],_0xd3eb9b[_0xb205('0x41')]);_0x12c487[_0xb205('0x57')]=_['intersection'](_0xd3eb9b[_0xb205('0x52')],qs[_0xb205('0x58')](_0x5897c3[_0xb205('0x41')][_0xb205('0x58')]));_0x12c487[_0xb205('0x57')]=_0x12c487[_0xb205('0x57')][_0xb205('0x59')]?_0x12c487['attributes']:_0xd3eb9b['model'];_0x12c487[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x5897c3['query'][_0xb205('0xcf')]);_0x12c487[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x5897c3[_0xb205('0x41')],_0xd3eb9b[_0xb205('0x55')]));if(_0x5897c3[_0xb205('0x41')][_0xb205('0x2f')]){_0x12c487[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x12c487[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x12c487['attributes'],function(_0xd09998){var _0x60a94f={};_0x60a94f[_0xd09998]={'$like':'%'+_0x5897c3[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x60a94f;})});}_0x12c487=_['merge']({},_0x12c487,_0x5897c3[_0xb205('0xd2')]);return _0x392b95[_0xb205('0xea')](_0x12c487);}})['then'](function(_0x5d8e23){if(_0x5d8e23){_0x1e64b0=_0x5d8e23[_0xb205('0x59')];if(!_0x5897c3[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x12c487['limit']=qs[_0xb205('0x23')](_0x5897c3['query'][_0xb205('0x23')]);_0x12c487[_0xb205('0x21')]=qs[_0xb205('0x21')](_0x5897c3[_0xb205('0x41')][_0xb205('0x21')]);}return _0x392b95[_0xb205('0xea')](_0x12c487);}})[_0xb205('0x28')](function(_0x13714f){if(_0x13714f){return _0x13714f?{'count':_0x1e64b0,'rows':_0x13714f}:null;}})['then'](respondWithResult(_0x3cd2bb,null))[_0xb205('0x1c')](handleError(_0x3cd2bb,null));};exports[_0xb205('0xeb')]=function(_0x55beb1,_0x526db1){var _0x5a06fe={};var _0x4404d1={};var _0xae5e5d;var _0x41a23d;return db['User'][_0xb205('0x97')]({'where':{'id':_0x55beb1[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x526db1,null))[_0xb205('0x28')](function(_0xcbd9c1){if(_0xcbd9c1){_0xae5e5d=_0xcbd9c1;_0x4404d1['model']=_[_0xb205('0x54')](db[_0xb205('0xec')][_0xb205('0x3b')]);_0x4404d1['query']=_[_0xb205('0x54')](_0x55beb1[_0xb205('0x41')]);_0x4404d1[_0xb205('0x55')]=_[_0xb205('0x56')](_0x4404d1[_0xb205('0x52')],_0x4404d1[_0xb205('0x41')]);_0x5a06fe[_0xb205('0x57')]=_[_0xb205('0x56')](_0x4404d1[_0xb205('0x52')],qs[_0xb205('0x58')](_0x55beb1[_0xb205('0x41')][_0xb205('0x58')]));_0x5a06fe['attributes']=_0x5a06fe[_0xb205('0x57')][_0xb205('0x59')]?_0x5a06fe[_0xb205('0x57')]:_0x4404d1[_0xb205('0x52')];_0x5a06fe[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x55beb1[_0xb205('0x41')][_0xb205('0xcf')]);_0x5a06fe[_0xb205('0x40')]=qs['filters'](_[_0xb205('0xd0')](_0x55beb1[_0xb205('0x41')],_0x4404d1[_0xb205('0x55')]));if(_0x55beb1['query']['filter']){_0x5a06fe['where']=_['merge'](_0x5a06fe[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x5a06fe[_0xb205('0x57')],function(_0x25fd2f){var _0x45524c={};_0x45524c[_0x25fd2f]={'$like':'%'+_0x55beb1[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x45524c;})});}_0x5a06fe=_[_0xb205('0xd1')]({},_0x5a06fe,_0x55beb1[_0xb205('0xd2')]);return _0xae5e5d[_0xb205('0xeb')](_0x5a06fe);}})['then'](function(_0x219c9a){if(_0x219c9a){_0x41a23d=_0x219c9a['length'];if(!_0x55beb1[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x5a06fe['limit']=qs[_0xb205('0x23')](_0x55beb1['query']['limit']);_0x5a06fe[_0xb205('0x21')]=qs[_0xb205('0x21')](_0x55beb1[_0xb205('0x41')]['offset']);}return _0xae5e5d[_0xb205('0xeb')](_0x5a06fe);}})['then'](function(_0x1e5c61){if(_0x1e5c61){return _0x1e5c61?{'count':_0x41a23d,'rows':_0x1e5c61}:null;}})['then'](respondWithResult(_0x526db1,null))[_0xb205('0x1c')](handleError(_0x526db1,null));};exports[_0xb205('0xed')]=function(_0x5cc3a6,_0x1f3988,_0x33f7e9){var _0x1bb6b7;var _0x1afb0a;var _0x5cdb32;var _0x258a41=!_['isNil'](_0x5cc3a6['params']['id'])?_0x5cc3a6[_0xb205('0x51')]['id']:!_[_0xb205('0x66')](_0x5cc3a6[_0xb205('0x7c')]['id'])?_0x5cc3a6[_0xb205('0x7c')]['id']:null;return db[_0xb205('0x3a')]['find']({'where':{'id':_0x258a41,'role':{'$or':[_0xb205('0x2d'),_0xb205('0x7c'),_0xb205('0x2e')]}},'attributes':['id','name',_0xb205('0xee'),'mobile',_0xb205('0x29'),_0xb205('0x61'),_0xb205('0xa0')]})[_0xb205('0x28')](function(_0x78c854){if(_0x78c854){if(_0x78c854[_0xb205('0x29')]===_0xb205('0x2e')){_0x1bb6b7=_0x78c854;if(_0x5cc3a6[_0xb205('0x5d')]['interface']){_0x5cdb32=util[_0xb205('0xac')]('LOCAL/%s@from-sip/n',_0x1bb6b7[_0x5cc3a6['body']['interface']]);}else if(_0x5cc3a6[_0xb205('0x5d')]['intrf']){_0x5cdb32=util[_0xb205('0xac')]('SIP/%s',_0x5cc3a6[_0xb205('0x5d')][_0xb205('0xef')]);}else{_0x5cdb32=util[_0xb205('0xac')](_0xb205('0xad'),_0x1bb6b7[_0xb205('0x34')]);}socket['to'](util['format'](_0xb205('0xf0'),_0x1bb6b7['name']))[_0xb205('0x2a')]('user:forcelogout',{'user':{'id':_0x1bb6b7['id'],'name':_0x1bb6b7[_0xb205('0x34')]},'ip':_0x5cc3a6[_0xb205('0xf1')][_0xb205('0xf2')]||_0x5cc3a6['connection'][_0xb205('0xf3')]||_0x5cc3a6[_0xb205('0xf4')]['remoteAddress']||_0x5cc3a6[_0xb205('0xf5')][_0xb205('0xf4')][_0xb205('0xf3')]});return db[_0xb205('0xae')][_0xb205('0x36')]({'where':{'membername':_0x1bb6b7[_0xb205('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xb205('0x92'))][(_0xb205('0x8f'))](_0xb205('0xf6'));}})[_0xb205('0x28')](function(){if(_0x1bb6b7){return _0x1bb6b7[_0xb205('0xf7')]({'raw':!![]});}})[_0xb205('0x28')](function(_0x2c5518){if(_0x1bb6b7){if(_0x2c5518){_0x1afb0a=_0x2c5518;if(_0x1afb0a[_0xb205('0x59')]){var _0x13835b=_0x1afb0a['map'](function(_0x1a8420){var _0x3cfe54={'membername':_0x1bb6b7['name'],'UserId':_0x1bb6b7['id'],'queue_name':_0x1a8420[_0xb205('0x34')],'VoiceQueueId':_0x1a8420['id'],'interface':_0x5cdb32,'paused':_0x1bb6b7[_0xb205('0xa0')]||![],'penalty':_0x1a8420['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0xb205('0xaf')](_0x3cfe54);});return Promise[_0xb205('0x4f')](_0x13835b);}}}})[_0xb205('0x28')](function(){if(_0x1bb6b7){return db[_0xb205('0xf8')]['findAll']({'where':{'membername':_0x1bb6b7[_0xb205('0x34')],'exitAt':null}});}})['then'](function(_0x1bcf24){if(_0x1bb6b7){var _0x163ed3=[];_0x1bcf24[_0xb205('0xf9')](function(_0x4c8205){_0x163ed3[_0xb205('0x46')](_0x4c8205[_0xb205('0x27')]({'exitAt':moment()['format'](_0xb205('0xfa'))}));});return Promise[_0xb205('0x4f')](_0x163ed3);}})['then'](function(){if(_0x1bb6b7){var _0x4b375e=[];var _0x1838be=[];var _0x26be14=utils[_0xb205('0xfb')]();var _0x4e33f8={'membername':_0x1bb6b7[_0xb205('0x34')],'interface':_0x5cdb32,'enterAt':moment()[_0xb205('0xac')](_0xb205('0xfa')),'role':_0x1bb6b7[_0xb205('0x29')],'internal':_0x1bb6b7[_0xb205('0x61')]};_0x26be14[_0xb205('0xf9')](function(_0xa84365){_0x4b375e[_0xb205('0x46')](_['merge']({'channel':_0xa84365,'type':_0xb205('0xfc'),'data1':_0x5cc3a6[_0xb205('0x5d')]['device'],'data2':_0x5cdb32},_0x4e33f8));if(_0x1bb6b7['loginInPause']){_0x1838be[_0xb205('0x46')](_[_0xb205('0xd1')]({'channel':_0xa84365,'type':_0xb205('0xfd'),'data1':'LOGININPAUSE'},_0x4e33f8));}});return db[_0xb205('0xf8')][_0xb205('0x83')](_0x4b375e[_0xb205('0xcb')](_0x1838be),{'individualHooks':!![]});}})[_0xb205('0x28')](function(){if(_0x1bb6b7){return _0x1bb6b7[_0xb205('0x27')]({'online':!![],'lastLoginAt':moment()[_0xb205('0xac')](_0xb205('0xfa')),'voicePause':_0x1bb6b7[_0xb205('0xa0')]||![],'mailPause':_0x1bb6b7[_0xb205('0xa0')]||![],'chatPause':_0x1bb6b7[_0xb205('0xa0')]||![],'faxPause':_0x1bb6b7[_0xb205('0xa0')]||![],'smsPause':_0x1bb6b7['loginInPause']||![],'openchannelPause':_0x1bb6b7[_0xb205('0xa0')]||![],'whatsappPause':_0x1bb6b7['loginInPause']||![],'pauseType':_0x1bb6b7['loginInPause']?_0xb205('0xfe'):null,'interface':_0x5cdb32,'lastPauseAt':moment()[_0xb205('0xac')](_0xb205('0xfa'))});}})[_0xb205('0x28')](function(_0x45231f){if(_0x5cc3a6[_0xb205('0xff')]){return _0x33f7e9();}else{return Promise['resolve'](_0x45231f)[_0xb205('0x28')](respondWithResult(_0x1f3988,null));}})['catch'](handleError(_0x1f3988,null));};exports[_0xb205('0x100')]=function(_0x2f3d65,_0x3761e4){var _0x58353c;return db['User'][_0xb205('0x33')]({'where':{'id':_0x2f3d65[_0xb205('0x51')]['id'],'role':_0xb205('0x2e')},'attributes':['id',_0xb205('0x34'),_0xb205('0x29')]})[_0xb205('0x28')](handleEntityNotFound(_0x3761e4,null))[_0xb205('0x28')](function(_0x138ab5){if(_0x138ab5){_0x58353c=_0x138ab5;return db[_0xb205('0xae')][_0xb205('0x36')]({'where':{'membername':_0x58353c[_0xb205('0x34')]},'individualHooks':!![]});}})['then'](function(){return db[_0xb205('0xf8')][_0xb205('0x47')]({'where':{'membername':_0x58353c['name'],'exitAt':null}});})[_0xb205('0x28')](function(_0x511807){var _0x36430d=[];_0x511807[_0xb205('0xf9')](function(_0xfb504){_0x36430d[_0xb205('0x46')](_0xfb504['update']({'exitAt':moment()[_0xb205('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb205('0x4f')](_0x36430d);})[_0xb205('0x28')](function(){return _0x58353c[_0xb205('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3761e4,null))[_0xb205('0x1c')](handleError(_0x3761e4,null));};exports[_0xb205('0x101')]=function(_0x31448d,_0x3b2122){var _0x3d558d;return db[_0xb205('0xae')][_0xb205('0x27')]({'paused':0x1},{'where':{'UserId':_0x31448d[_0xb205('0x51')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0xb205('0x33')]({'where':{'id':_0x31448d['params']['id'],'role':_0xb205('0x2e')},'attributes':['id','name',_0xb205('0x29'),_0xb205('0x61'),_0xb205('0xa2'),_0xb205('0x9f')]});})[_0xb205('0x28')](handleEntityNotFound(_0x3b2122,null))[_0xb205('0x28')](function(_0x452b4e){if(_0x452b4e){_0x3d558d=_0x452b4e;return respondWithRpcPromise('QueuePause',_0xb205('0x101'),{'id':_0x3d558d['id'],'name':_0x3d558d[_0xb205('0x34')],'pause':!![]});}})[_0xb205('0x28')](function(){if(_0x3d558d){return db[_0xb205('0xf8')][_0xb205('0x47')]({'where':{'membername':_0x3d558d[_0xb205('0x34')],'type':_0xb205('0xfd'),'exitAt':null}});}})[_0xb205('0x28')](function(_0x4cf1bd){if(_0x4cf1bd[_0xb205('0x59')]){var _0x18dae4=moment()[_0xb205('0xac')](_0xb205('0xfa'));for(var _0x4690b7=0x0,_0x3b5051=_0x4cf1bd[_0xb205('0x59')];_0x4690b7<_0x3b5051;_0x4690b7++){_0x4cf1bd[_0x4690b7][_0xb205('0x102')]({'exitAt':_0x18dae4});}}})['then'](function(){var _0x344609=[];var _0x26cb76=utils[_0xb205('0xfb')]();_0x26cb76[_0xb205('0xf9')](function(_0x5e0340){_0x344609[_0xb205('0x46')]({'channel':_0x5e0340,'membername':_0x3d558d[_0xb205('0x34')],'interface':_[_0xb205('0x66')](_0x3d558d[_0xb205('0xa2')])?util[_0xb205('0xac')](_0xb205('0xad'),_0x3d558d[_0xb205('0x34')]):_0x3d558d['interface'],'type':_0xb205('0xfd'),'enterAt':moment()[_0xb205('0xac')](_0xb205('0xfa')),'data1':_0x31448d[_0xb205('0x5d')]['type']||_0xb205('0x103'),'role':_0x3d558d[_0xb205('0x29')],'internal':_0x3d558d[_0xb205('0x61')]});});return db[_0xb205('0xf8')][_0xb205('0x83')](_0x344609,{'individualHooks':!![]});})[_0xb205('0x28')](function(){return _0x3d558d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x31448d['body']['type']||_0xb205('0x103'),'lastPauseAt':moment()[_0xb205('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x3b2122,null))['catch'](handleError(_0x3b2122,null));};exports[_0xb205('0x104')]=function(_0x35cc34,_0x44a89b){if(_0x35cc34[_0xb205('0x5d')][_0xb205('0x9e')]&&!utils['isValidChannel'](_0x35cc34['body'][_0xb205('0x9e')])){throw new APIBadRequestError(util[_0xb205('0xac')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x35cc34[_0xb205('0x5d')][_0xb205('0x9e')]));}return db[_0xb205('0x3a')][_0xb205('0x33')]({'where':{'id':_0x35cc34[_0xb205('0x51')]['id']},'attributes':['id','name',_0xb205('0x29'),'internal',_0xb205('0xa2'),'online',_0xb205('0xa1'),'mailPause',_0xb205('0x105'),_0xb205('0x106'),_0xb205('0x107'),_0xb205('0x108'),_0xb205('0x109'),'pauseType',_0xb205('0x10a')]})[_0xb205('0x28')](function(_0x27dbc5){if(!_0x27dbc5){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x35cc34[_0xb205('0x51')]['id']));}return _0x27dbc5[_0xb205('0x104')](_0x35cc34[_0xb205('0x5d')]['channel']);})[_0xb205('0x28')](respondWithResult(_0x44a89b,null))['catch'](APIHandleError(_0x44a89b));};exports['getTeams']=function(_0x26cf42,_0x1884e4){var _0x5e5ff2={};var _0x3799f4={};var _0x138349;var _0x5ce843;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x26cf42[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x1884e4,null))[_0xb205('0x28')](function(_0x4feb0b){if(_0x4feb0b){_0x138349=_0x4feb0b;_0x3799f4[_0xb205('0x52')]=_[_0xb205('0x54')](db[_0xb205('0x10b')][_0xb205('0x3b')]);_0x3799f4['query']=_['keys'](_0x26cf42[_0xb205('0x41')]);_0x3799f4[_0xb205('0x55')]=_[_0xb205('0x56')](_0x3799f4[_0xb205('0x52')],_0x3799f4[_0xb205('0x41')]);_0x5e5ff2[_0xb205('0x57')]=_['intersection'](_0x3799f4[_0xb205('0x52')],qs[_0xb205('0x58')](_0x26cf42['query'][_0xb205('0x58')]));_0x5e5ff2['attributes']=_0x5e5ff2['attributes']['length']?_0x5e5ff2[_0xb205('0x57')]:_0x3799f4[_0xb205('0x52')];_0x5e5ff2[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x26cf42[_0xb205('0x41')][_0xb205('0xcf')]);_0x5e5ff2['where']=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x26cf42['query'],_0x3799f4[_0xb205('0x55')]));if(_0x26cf42['query'][_0xb205('0x2f')]){_0x5e5ff2['where']=_[_0xb205('0xd1')](_0x5e5ff2[_0xb205('0x40')],{'$or':_['map'](_0x5e5ff2[_0xb205('0x57')],function(_0x2bef6c){var _0x1ffba4={};_0x1ffba4[_0x2bef6c]={'$like':'%'+_0x26cf42[_0xb205('0x41')]['filter']+'%'};return _0x1ffba4;})});}_0x5e5ff2=_[_0xb205('0xd1')]({},_0x5e5ff2,_0x26cf42[_0xb205('0xd2')]);return _0x138349[_0xb205('0x10c')](_0x5e5ff2);}})['then'](function(_0x3ce8cf){if(_0x3ce8cf){_0x5ce843=_0x3ce8cf[_0xb205('0x59')];if(!_0x26cf42[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0x5e5ff2[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x26cf42['query']['limit']);_0x5e5ff2[_0xb205('0x21')]=qs['offset'](_0x26cf42[_0xb205('0x41')]['offset']);}return _0x138349[_0xb205('0x10c')](_0x5e5ff2);}})[_0xb205('0x28')](function(_0x34fa5c){if(_0x34fa5c){return _0x34fa5c?{'count':_0x5ce843,'rows':_0x34fa5c}:null;}})['then'](respondWithResult(_0x1884e4,null))[_0xb205('0x1c')](handleError(_0x1884e4,null));};exports[_0xb205('0x10d')]=function(_0xded393,_0x51dbe6){var _0x19923d=_0xded393['params']['id'];var _0x82a564=_0xded393['body']?_0xded393['body'][_0xb205('0x60')]:null;var _0xe2dc58=[];return Promise[_0xb205('0x10e')]()[_0xb205('0x28')](function(){if(!_0x82a564)throw new APIBadRequestError(_0xb205('0x10f'));})[_0xb205('0x28')](function(){return db['User'][_0xb205('0x97')]({'where':{'id':_0x19923d}});})['then'](function(_0x40477b){if(!_0x40477b)throw new APINotFoundError(util['format'](_0xb205('0x110'),_0xded393['params']['id']));return db[_0xb205('0x68')][_0xb205('0x111')](function(_0x4e5dd6){return _0x40477b[_0xb205('0x10d')](_0x82a564,{'transaction':_0x4e5dd6})[_0xb205('0x28')](function(){return db[_0xb205('0x10b')][_0xb205('0x47')]({'where':{'id':{'$in':_0x82a564}}});})[_0xb205('0x28')](function(_0xbffc7c){var _0x3294ba=_[_0xb205('0x87')](_0xbffc7c,function(_0x2b3776){return _0x2b3776['getAssociatedQueues']();});return Promise['all'](_0x3294ba);})[_0xb205('0x28')](function(_0x397d47){_0xe2dc58=_[_0xb205('0x112')](_0x397d47);var _0x35f1cc=_['map'](_0xe2dc58,function(_0x51f0f7){return _0x51f0f7[_0xb205('0x113')](_0x40477b['id'],{'transaction':_0x4e5dd6});});return Promise[_0xb205('0x4f')](_0x35f1cc);})[_0xb205('0x28')](function(){if(!_0x40477b[_0xb205('0x9f')])return;var _0x3a50f1=_[_0xb205('0x2f')](_0xe2dc58,function(_0x4909f0){return _0x4909f0['getDataValue'](_0xb205('0x9e'))===_0xb205('0x114');});var _0x179878=_[_0xb205('0x87')](_0x3a50f1,function(_0x5631c1){return db[_0xb205('0xae')][_0xb205('0xaf')]({'membername':_0x40477b[_0xb205('0x34')],'UserId':_0x40477b['id'],'queue_name':_0x5631c1[_0xb205('0x34')],'VoiceQueueId':_0x5631c1['id'],'interface':_['isNil'](_0x40477b[_0xb205('0xa2')])?util[_0xb205('0xac')](_0xb205('0xad'),_0x40477b['name']):_0x40477b['interface'],'paused':_0x40477b[_0xb205('0xa1')]||![],'penalty':_0x40477b[_0xb205('0xa7')]},{'transaction':_0x4e5dd6});});return Promise['all'](_0x179878);})[_0xb205('0x28')](function(){return db[_0xb205('0x115')][_0xb205('0x47')]({'where':{'teamId':{'$in':_0x82a564}}});})[_0xb205('0x28')](function(_0x38b8e9){var _0x475c58=_['map'](_0x38b8e9,function(_0x20d87c){return db['UserVoicePrefix'][_0xb205('0x7b')]({'UserId':_0x40477b['id'],'VoicePrefixId':_0x20d87c[_0xb205('0x116')]},{'transaction':_0x4e5dd6});});return Promise[_0xb205('0x4f')](_0x475c58);});});})[_0xb205('0x28')](function(){for(var _0x4cc2a9=0x0;_0x4cc2a9<_0xe2dc58[_0xb205('0x59')];_0x4cc2a9++){var _0x1bbea5=_0xe2dc58[_0x4cc2a9][_0xb205('0x117')](_0xb205('0x9e'));var _0x2b2df0=_0x1bbea5+'QueueId';socket[_0xb205('0x2a')](_0xb205('0x7c')+_0x1bbea5+_0xb205('0xa9'),{'UserId':_0x19923d,['queueField']:_0xe2dc58[_0x4cc2a9]['id']});}})[_0xb205('0x28')](respondWithStatusCode(_0x51dbe6,null))['catch'](APIHandleError(_0x51dbe6));};exports[_0xb205('0x118')]=function(_0x470d2b,_0x2fa7f3){var _0x183fa6=_0x470d2b['params']['id'];var _0x28942f=null;if(_0x470d2b[_0xb205('0x41')][_0xb205('0x60')]){_0x28942f=_[_0xb205('0xb2')](_0x470d2b[_0xb205('0x41')][_0xb205('0x60')])?_0x470d2b[_0xb205('0x41')][_0xb205('0x60')]:[_0x470d2b[_0xb205('0x41')][_0xb205('0x60')]];}var _0x2c579d=[];return Promise[_0xb205('0x10e')]()[_0xb205('0x28')](function(){if(!_0x28942f)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xb205('0x28')](function(){return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x183fa6}});})[_0xb205('0x28')](function(_0x54311d){if(!_0x54311d)throw new APINotFoundError(util['format'](_0xb205('0x110'),_0x470d2b[_0xb205('0x51')]['id']));return db['sequelize'][_0xb205('0x111')](function(_0x33f053){return _0x54311d[_0xb205('0x118')](_0x28942f,{'transaction':_0x33f053})[_0xb205('0x28')](function(){return db[_0xb205('0x10b')][_0xb205('0x47')]({'where':{'id':{'$in':_0x28942f}}});})[_0xb205('0x28')](function(_0x38ddc0){var _0x357a90=_[_0xb205('0x87')](_0x38ddc0,function(_0x2fc4dc){return _0x2fc4dc[_0xb205('0x119')]();});return Promise[_0xb205('0x4f')](_0x357a90);})['then'](function(_0x336322){_0x2c579d=_[_0xb205('0x112')](_0x336322);var _0x156ac8=_[_0xb205('0x87')](_0x2c579d,function(_0x110e5c){return _0x110e5c[_0xb205('0x11a')](_0x54311d['id'],{'transaction':_0x33f053});});return Promise[_0xb205('0x4f')](_0x156ac8);})[_0xb205('0x28')](function(){if(!_0x54311d[_0xb205('0x9f')])return;var _0x4292b0=_['filter'](_0x2c579d,function(_0x2a24b5){return _0x2a24b5[_0xb205('0x117')](_0xb205('0x9e'))===_0xb205('0x114');});var _0x4166ab=_[_0xb205('0x87')](_0x4292b0,function(_0x26eac4){return db[_0xb205('0xae')][_0xb205('0x36')]({'where':{'VoiceQueueId':_0x26eac4['id'],'UserId':_0x54311d['id']},'transaction':_0x33f053});});return Promise[_0xb205('0x4f')](_0x4166ab);})[_0xb205('0x28')](function(){return db[_0xb205('0x115')][_0xb205('0x47')]({'where':{'teamId':{'$in':_0x28942f}}});})[_0xb205('0x28')](function(_0x378cc8){var _0x14481c=_[_0xb205('0x87')](_0x378cc8,function(_0x3083f9){return db[_0xb205('0x11b')][_0xb205('0x36')]({'where':{'UserId':_0x54311d['id'],'VoicePrefixId':_0x3083f9[_0xb205('0x116')]}},{'transaction':_0x33f053});});return Promise[_0xb205('0x4f')](_0x14481c);});});})['then'](function(){for(var _0x245d1e=0x0;_0x245d1e<_0x2c579d['length'];_0x245d1e++){var _0x20f7f1=_0x2c579d[_0x245d1e][_0xb205('0x117')](_0xb205('0x9e'));var _0x397a04=_0x20f7f1+_0xb205('0xb3');socket[_0xb205('0x2a')]('user'+_0x20f7f1+'Queue:remove',{'UserId':_0x183fa6,['queueField']:_0x2c579d[_0x245d1e]['id']});}})[_0xb205('0x28')](respondWithStatusCode(_0x2fa7f3,null))[_0xb205('0x1c')](APIHandleError(_0x2fa7f3));};exports[_0xb205('0x11c')]=function(_0x3fd044,_0x103983){var _0xfb03e0={};var _0x3c7cd8={};var _0x1ed03a;var _0x40c6c1;return db[_0xb205('0x3a')]['findOne']({'where':{'id':_0x3fd044[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x103983,null))['then'](function(_0x4c25c3){if(_0x4c25c3){_0x1ed03a=_0x4c25c3;_0x3c7cd8[_0xb205('0x52')]=_[_0xb205('0x54')](db[_0xb205('0xd4')][_0xb205('0x3b')]);_0x3c7cd8['query']=_['keys'](_0x3fd044[_0xb205('0x41')]);_0x3c7cd8['filters']=_[_0xb205('0x56')](_0x3c7cd8['model'],_0x3c7cd8[_0xb205('0x41')]);_0xfb03e0[_0xb205('0x57')]=_['intersection'](_0x3c7cd8[_0xb205('0x52')],qs[_0xb205('0x58')](_0x3fd044[_0xb205('0x41')]['fields']));_0xfb03e0['attributes']=_0xfb03e0[_0xb205('0x57')][_0xb205('0x59')]?_0xfb03e0[_0xb205('0x57')]:_0x3c7cd8[_0xb205('0x52')];_0xfb03e0[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x3fd044[_0xb205('0x41')][_0xb205('0xcf')]);_0xfb03e0[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x3fd044['query'],_0x3c7cd8[_0xb205('0x55')]));if(_0x3fd044[_0xb205('0x41')][_0xb205('0x2f')]){_0xfb03e0[_0xb205('0x40')]=_[_0xb205('0xd1')](_0xfb03e0['where'],{'$or':_[_0xb205('0x87')](_0xfb03e0[_0xb205('0x57')],function(_0x3f9e0d){var _0x1d1e93={};_0x1d1e93[_0x3f9e0d]={'$like':'%'+_0x3fd044[_0xb205('0x41')][_0xb205('0x2f')]+'%'};return _0x1d1e93;})});}_0xfb03e0=_[_0xb205('0xd1')]({},_0xfb03e0,_0x3fd044[_0xb205('0xd2')]);return _0x1ed03a[_0xb205('0x11c')](_0xfb03e0);}})[_0xb205('0x28')](function(_0xf1aa49){if(_0xf1aa49){_0x40c6c1=_0xf1aa49[_0xb205('0x59')];if(!_0x3fd044[_0xb205('0x41')][_0xb205('0xd3')](_0xb205('0xdb'))){_0xfb03e0[_0xb205('0x23')]=qs[_0xb205('0x23')](_0x3fd044['query'][_0xb205('0x23')]);_0xfb03e0[_0xb205('0x21')]=qs[_0xb205('0x21')](_0x3fd044[_0xb205('0x41')][_0xb205('0x21')]);}return _0x1ed03a[_0xb205('0x11c')](_0xfb03e0);}})[_0xb205('0x28')](function(_0x5b3823){if(_0x5b3823){return _0x5b3823?{'count':_0x40c6c1,'rows':_0x5b3823}:null;}})[_0xb205('0x28')](respondWithResult(_0x103983,null))['catch'](handleError(_0x103983,null));};exports['getAgents']=function(_0x582639,_0x4ca311){var _0x431370={};var _0x119eb5={};var _0x3516dd;return db[_0xb205('0x3a')][_0xb205('0x97')]({'where':{'id':_0x582639[_0xb205('0x51')]['id']}})[_0xb205('0x28')](handleEntityNotFound(_0x4ca311,null))['then'](function(_0x4e60a1){if(_0x4e60a1){_0x3516dd=_0x4e60a1;_0x119eb5['model']=_[_0xb205('0x54')](db[_0xb205('0x3a')]['rawAttributes']);_0x119eb5[_0xb205('0x41')]=_[_0xb205('0x54')](_0x582639['query']);_0x119eb5['filters']=_[_0xb205('0x56')](_0x119eb5['model'],_0x119eb5[_0xb205('0x41')]);_0x431370['attributes']=_[_0xb205('0x56')](_0x119eb5[_0xb205('0x52')],qs[_0xb205('0x58')](_0x582639[_0xb205('0x41')][_0xb205('0x58')]));_0x431370[_0xb205('0x57')]=_0x431370['attributes'][_0xb205('0x59')]?_0x431370[_0xb205('0x57')]:_0x119eb5['model'];_0x431370[_0xb205('0xce')]=qs[_0xb205('0xcf')](_0x582639['query'][_0xb205('0xcf')]);_0x431370[_0xb205('0x40')]=qs[_0xb205('0x55')](_[_0xb205('0xd0')](_0x582639['query'],_0x119eb5[_0xb205('0x55')]));if(_0x582639[_0xb205('0x41')][_0xb205('0x2f')]){_0x431370[_0xb205('0x40')]=_[_0xb205('0xd1')](_0x431370[_0xb205('0x40')],{'$or':_[_0xb205('0x87')](_0x431370[_0xb205('0x57')],function(_0x4d8025){var _0x5629c1={};_0x5629c1[_0x4d8025]={'$like':'%'+_0x582639['query'][_0xb205('0x2f')]+'%'};return _0x5629c1;})});}_0x431370['model']=db[_0xb205('0x3a')];_0x431370['as']=_0xb205('0x8a');_0x431370=_[_0xb205('0xd1')]({},_0x431370,_0x582639[_0xb205('0xd2')]);return _0x3516dd[_0xb205('0xf7')]({'include':[_0x431370]});}})[_0xb205('0x28')](function(_0x40fa86){if(_0x40fa86){var _0xe10563={},_0x419366=[];for(var _0x36ce0f=0x0;_0x36ce0f<_0x40fa86[_0xb205('0x59')];_0x36ce0f+=0x1){for(var _0x3cdc5e=0x0,_0x23b8fc;_0x3cdc5e<_0x40fa86[_0x36ce0f][_0xb205('0x8a')][_0xb205('0x59')];_0x3cdc5e+=0x1){_0x23b8fc=_0x40fa86[_0x36ce0f]['Agents'][_0x3cdc5e]['get']({'plain':!![]});_0xe10563[_0x23b8fc['id']]=_0x23b8fc;}}_0xe10563=_['values'](_0xe10563);for(var _0x4391a3=qs[_0xb205('0x21')](_0x582639[_0xb205('0x41')][_0xb205('0x21')]);_0x4391a3<_0xe10563[_0xb205('0x59')]&&_0x419366[_0xb205('0x59')]=_0x5bbfe0){_0x4d80f3=_0x5bbfe0;_0x11e563=0xc8;}else{_0x11e563=0xce;}_0x1fc7a1['status'](_0x11e563);return _0x1fc7a1[_0x9a99('0x2b')](_0x9a99('0x2c'),_0x56c9b4+'-'+_0x4d80f3+'/'+_0x5bbfe0)['json'](_0x40f01c);}return null;};}function saveUpdates(_0x51ac0e){return function(_0x5eae5e){if(_0x5eae5e){return _0x5eae5e[_0x9a99('0x2d')](_0x51ac0e)[_0x9a99('0x1a')](function(_0x2962af){if(_0x2962af[_0x9a99('0x2e')]===_0x9a99('0x2f')){socket[_0x9a99('0x30')](_0x9a99('0x31')+_0x2962af['id'],_0x2962af);}return _0x2962af;});}return null;};}function removeEntity(_0x597698){return function(_0x1e0c46){if(_0x1e0c46){return _0x1e0c46[_0x9a99('0x32')]()[_0x9a99('0x1a')](function(){var _0x5b73b9=_0x1e0c46[_0x9a99('0x33')]({'plain':!![]});if(_0x5b73b9[_0x9a99('0x2e')]===_0x9a99('0x34'))return;var _0x2f30d8=[{'name':_0x9a99('0x35'),'value':_0x9a99('0x36'),'ignore':!![]},{'name':_0x9a99('0x37'),'value':_0x9a99('0x2f'),'ignore':![]},{'name':_0x9a99('0x38'),'value':_0x9a99('0x39'),'ignore':![]}];var _0x484603=_(_0x2f30d8)['filter'](_0x9a99('0x3a'))[_0x9a99('0x3b')](_0x9a99('0x3c'))[_0x9a99('0x3c')]();if(_['includes'](_0x484603,_0x5b73b9[_0x9a99('0x2e')])){return;}var _0x2b1196=_[_0x9a99('0x3d')](_0x2f30d8,[_0x9a99('0x3c'),_0x5b73b9['role']])[_0x9a99('0x3e')];return db['UserProfileResource'][_0x9a99('0x32')]({'where':{'type':_0x2b1196,'resourceId':_0x5b73b9['id']}})[_0x9a99('0x1a')](function(){return _0x1e0c46;});})[_0x9a99('0x1a')](function(){_0x597698[_0x9a99('0x25')](0xcc)[_0x9a99('0x26')]();});}};}function handleEntityNotFound(_0x15b277){return function(_0x52b452){if(!_0x52b452){_0x15b277[_0x9a99('0x24')](0x194);}return _0x52b452;};}function handleError(_0x2d1ada,_0x5b651c){_0x5b651c=_0x5b651c||0x1f4;return function(_0x35564e){logger[_0x9a99('0x1f')](_0x35564e[_0x9a99('0x3f')]);if(_0x35564e[_0x9a99('0x3e')]){delete _0x35564e['name'];}_0x2d1ada[_0x9a99('0x25')](_0x5b651c)[_0x9a99('0x40')](_0x35564e);};}exports[_0x9a99('0x41')]=function(_0x28561c,_0x1a3674){var _0x195a85={},_0x5f05={'count':0x0,'rows':[]};var _0x2085e0=_(db['User']['rawAttributes'])[_0x9a99('0x3b')](function(_0xa9bb27){return{'name':_0xa9bb27[_0x9a99('0x42')],'type':_0xa9bb27[_0x9a99('0x43')][_0x9a99('0x44')]};})[_0x9a99('0x45')](function(_0x38ccf4){return!_[_0x9a99('0x46')]([_0x9a99('0x47'),_0x9a99('0x48')],_0x38ccf4[_0x9a99('0x3e')]);})['value']();_0x195a85=qs[_0x9a99('0x49')](_0x2085e0,_0x28561c);var _0x3d97bd={'where':_0x195a85['where']};return db['User']['count'](_0x3d97bd)[_0x9a99('0x1a')](function(_0x2db199){_0x5f05['count']=_0x2db199;if(_0x28561c['query']['includeAll']){_0x195a85[_0x9a99('0x4a')]=[{'all':!![]}];}if(_0x28561c['query']['userSetting']==='true'){_0x195a85['include']=[{'model':db[_0x9a99('0x4b')],'as':_0x9a99('0x4c')}];}if(!_[_0x9a99('0x46')](_0x195a85[_0x9a99('0x4d')],'id')){_0x195a85[_0x9a99('0x4d')][_0x9a99('0x4e')]('id');}return db[_0x9a99('0x4f')][_0x9a99('0x50')](_0x195a85);})['then'](function(_0x70c63b){_0x5f05[_0x9a99('0x51')]=_0x70c63b;if(_0x28561c[_0x9a99('0x52')]['openTabs']===_0x9a99('0x53')){var _0x1e8c12=[];for(var _0xb1558d=0x0;_0xb1558d<_0x5f05[_0x9a99('0x51')][_0x9a99('0x54')];_0xb1558d++){_0x1e8c12[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x55'),_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x57'),_0x5f05['rows'][_0xb1558d]['dataValues']));_0x1e8c12['push'](get_open_tabs('fax',_0x5f05[_0x9a99('0x51')][_0xb1558d]['dataValues']));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('mail',_0x5f05[_0x9a99('0x51')][_0xb1558d]['dataValues']));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('openchannel',_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('whatsapp',_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));}return Promise[_0x9a99('0x58')](_0x1e8c12)[_0x9a99('0x1a')](function(){return _0x5f05;});}else{return _0x5f05;}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x1a3674,_0x195a85))[_0x9a99('0x23')](handleError(_0x1a3674,null));};exports[_0x9a99('0x59')]=function(_0x4f114f,_0x27b081){var _0xcd573f={'raw':![],'where':{'id':_0x4f114f['params']['id']}},_0x4d2790={};_0x4d2790['model']=_['differenceBy'](_[_0x9a99('0x5a')](db[_0x9a99('0x4f')][_0x9a99('0x5b')]),[_0x9a99('0x47'),'salt']);_0x4d2790[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x4f114f[_0x9a99('0x52')]);_0x4d2790[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4d2790[_0x9a99('0x5e')],_0x4d2790[_0x9a99('0x52')]);_0xcd573f[_0x9a99('0x4d')]=_['intersection'](_0x4d2790['model'],qs[_0x9a99('0x5f')](_0x4f114f[_0x9a99('0x52')]['fields']));_0xcd573f[_0x9a99('0x4d')]=_0xcd573f[_0x9a99('0x4d')]['length']?_0xcd573f[_0x9a99('0x4d')]:_0x4d2790[_0x9a99('0x5e')];if(_0x4f114f['query']['includeAll']){_0xcd573f[_0x9a99('0x4a')]=[{'all':!![]}];}if(_0x4f114f[_0x9a99('0x52')]['userSetting']==='true'){_0xcd573f[_0x9a99('0x4a')]=[{'model':db[_0x9a99('0x4b')],'as':_0x9a99('0x4c')}];}_0xcd573f=_[_0x9a99('0x60')]({},_0xcd573f,_0x4f114f['options']);if(!_[_0x9a99('0x46')](_0xcd573f[_0x9a99('0x4d')],'id')){_0xcd573f[_0x9a99('0x4d')][_0x9a99('0x4e')]('id');}return db['User'][_0x9a99('0x3d')](_0xcd573f)[_0x9a99('0x1a')](handleEntityNotFound(_0x27b081,null))['then'](function(_0x4dce96){var _0x312b2c=[];values=_0x4dce96;if(_0x4f114f['query'][_0x9a99('0x61')]===_0x9a99('0x53')){_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x55'),_0x4dce96['dataValues']));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x57'),_0x4dce96['dataValues']));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x62'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x63'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c['push'](get_open_tabs(_0x9a99('0x64'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x65'),_0x4dce96['dataValues']));return Promise['all'](_0x312b2c);}else{return values;}})[_0x9a99('0x1a')](function(){return values;})[_0x9a99('0x1a')](respondWithResult(_0x27b081,null))[_0x9a99('0x23')](handleError(_0x27b081,null));};exports[_0x9a99('0x2d')]=function(_0x29a51e,_0x4a9e4d){if(_0x29a51e[_0x9a99('0x66')]['id']){delete _0x29a51e[_0x9a99('0x66')]['id'];}delete _0x29a51e[_0x9a99('0x66')][_0x9a99('0x2e')];return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x29a51e[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x4a9e4d,null))[_0x9a99('0x1a')](saveUpdates(_0x29a51e['body'],null))[_0x9a99('0x1a')](respondWithResult(_0x4a9e4d,null))[_0x9a99('0x23')](handleError(_0x4a9e4d,null));};exports[_0x9a99('0x68')]=function(_0x46d42a,_0x1d2e8a){return db[_0x9a99('0x4f')][_0x9a99('0x68')]()[_0x9a99('0x1a')](respondWithResult(_0x1d2e8a,null))[_0x9a99('0x23')](handleError(_0x1d2e8a,null));};exports[_0x9a99('0x69')]=function(_0x36934f,_0x3687f8){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x36934f[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3687f8,null))[_0x9a99('0x1a')](function(_0x4c67c9){if(_0x4c67c9){return _0x4c67c9[_0x9a99('0x69')](_0x36934f[_0x9a99('0x66')][_0x9a99('0x6a')],_['omit'](_0x36934f[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x3687f8,null))[_0x9a99('0x23')](handleError(_0x3687f8,null));};function validateUser(_0x4c0e99){return new Promise(function(_0x5510e4,_0x56d2a9){if(_0x4c0e99[_0x9a99('0x6b')])return _0x5510e4(_0x4c0e99);return db[_0x9a99('0x6c')]['findById'](0x1)[_0x9a99('0x1a')](function(_0x54c29f){if(_0x54c29f[_0x9a99('0x6d')])authService['validatePasswordPattern'](_0x4c0e99[_0x9a99('0x47')]);db[_0x9a99('0x4f')]['max']('internal')[_0x9a99('0x1a')](function(_0x1d7778){if(_[_0x9a99('0x6e')](_0x1d7778)){_0x4c0e99[_0x9a99('0x6b')]=_0x54c29f[_0x9a99('0x6f')]||0x1;return;}if(_[_0x9a99('0x6e')](_0x54c29f[_0x9a99('0x6f')])||_0x54c29f[_0x9a99('0x6f')]===_0x1d7778){_0x4c0e99[_0x9a99('0x6b')]=_0x1d7778+0x1;return;}if(_0x54c29f[_0x9a99('0x6f')]>_0x1d7778){_0x4c0e99[_0x9a99('0x6b')]=_0x54c29f[_0x9a99('0x6f')];return;}return db[_0x9a99('0x70')][_0x9a99('0x52')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x9a99('0x70')]['QueryTypes']['SELECT']})[_0x9a99('0x1a')](function(_0x428bab){if(_0x428bab&&_0x428bab['length']){for(var _0x3de28f=0x0,_0x4506a3=_0x428bab[_0x9a99('0x54')];_0x3de28f<_0x4506a3&&_[_0x9a99('0x6e')](_0x4c0e99[_0x9a99('0x6b')]);_0x3de28f++){if(_0x54c29f[_0x9a99('0x6f')]<=_0x428bab[_0x3de28f][_0x9a99('0x71')]){_0x4c0e99[_0x9a99('0x6b')]=_0x428bab[_0x3de28f]['from'];}else if(_0x54c29f[_0x9a99('0x6f')]>_0x428bab[_0x3de28f][_0x9a99('0x71')]&&_0x54c29f[_0x9a99('0x6f')]<=_0x428bab[_0x3de28f]['to']){_0x4c0e99['internal']=_0x54c29f[_0x9a99('0x6f')];}}}if(_[_0x9a99('0x6e')](_0x4c0e99['internal'])){_0x4c0e99[_0x9a99('0x6b')]=_0x1d7778+0x1;}return _0x5510e4(_0x4c0e99);});});})[_0x9a99('0x23')](function(_0x14016d){_0x56d2a9(_0x14016d);});});}function updateUser(_0x8aaf4f){return new Promise(function(_0x3cda5b,_0x55c6c7){try{if(_0x8aaf4f[_0x9a99('0x72')]){_0x8aaf4f[_0x9a99('0x73')]=_0x8aaf4f[_0x9a99('0x6b')];_0x8aaf4f[_0x9a99('0x74')]={'mailbox':_0x8aaf4f[_0x9a99('0x6b')],'password':_0x8aaf4f[_0x9a99('0x47')],'fullname':_0x8aaf4f[_0x9a99('0x75')],'email':_0x8aaf4f[_0x9a99('0x76')]};}if(_0x8aaf4f[_0x9a99('0x2e')]===_0x9a99('0x2f')){if(!_0x8aaf4f[_0x9a99('0x77')])_0x8aaf4f['permissions']=[_0x9a99('0x78'),_0x9a99('0x79'),_0x9a99('0x7a'),_0x9a99('0x7b'),_0x9a99('0x7c'),_0x9a99('0x7d'),_0x9a99('0x7e'),_0x9a99('0x7f'),_0x9a99('0x80'),_0x9a99('0x81'),_0x9a99('0x82'),'100',_0x9a99('0x83'),_0x9a99('0x84'),_0x9a99('0x85')];}_0x3cda5b(_0x8aaf4f);}catch(_0x2c750f){_0x55c6c7(_0x2c750f);}});}exports[_0x9a99('0x86')]=function(_0x23bb61,_0x5f2c83){if(_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]==='agent')throw new Error(_0x9a99('0x87'));if(_0x23bb61['body'][_0x9a99('0x2e')]===_0x9a99('0x36')&&_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]!=='admin'){throw new Error(_0x9a99('0x88'));}if(_0x23bb61[_0x9a99('0x66')][_0x9a99('0x2e')]==='admin'&&_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]!==_0x9a99('0x34')){throw new Error(_0x9a99('0x89'));}return licenseUtil[_0x9a99('0x8a')]([_0x23bb61[_0x9a99('0x66')]])['then'](function(){return validateUser(_0x23bb61[_0x9a99('0x66')]);})['then'](function(_0x16d67d){return updateUser(_0x16d67d)['then'](function(_0x2aa0a0){if(_0x2aa0a0[_0x9a99('0x2e')]==='admin'){_0x2aa0a0[_0x9a99('0x8b')]=_0x23bb61[_0x9a99('0x36')][_0x9a99('0x8b')];delete _0x2aa0a0[_0x9a99('0x8c')];}return _0x2aa0a0;});})[_0x9a99('0x1a')](function(_0x51c2c3){return db['User'][_0x9a99('0x86')](_0x51c2c3,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x9a99('0x1a')](function(_0x373e6f){if(_0x23bb61[_0x9a99('0x66')][_0x9a99('0x2e')]===_0x9a99('0x36'))return _0x373e6f;if(_0x23bb61['user'][_0x9a99('0x2e')]!==_0x9a99('0x36'))return _0x373e6f;return db['UserProfileSection'][_0x9a99('0x3d')]({'where':{'name':_0x373e6f[_0x9a99('0x2e')]==='agent'?_0x9a99('0x37'):_0x9a99('0x38'),'userProfileId':_0x23bb61[_0x9a99('0x36')][_0x9a99('0x8c')]},'raw':!![]})['then'](function(_0xa727ba){if(!_0xa727ba||_0xa727ba['autoAssociation']!=0x0)return _0x373e6f;return db[_0x9a99('0x8d')]['create']({'name':_0x373e6f[_0x9a99('0x3e')],'resourceId':_0x373e6f['id'],'type':_0xa727ba[_0x9a99('0x3e')],'sectionId':_0xa727ba['id']},{})['then'](function(){return _0x373e6f;});})[_0x9a99('0x23')](function(_0x29e230){logger[_0x9a99('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e230);throw _0x29e230;});})['then'](respondWithResult(_0x5f2c83,0xc9))[_0x9a99('0x23')](handleError(_0x5f2c83,null));};exports[_0x9a99('0x8e')]=function(_0x51c75a,_0x373ccc){var _0x2ddf37=_0x51c75a[_0x9a99('0x66')];var _0x21eebc=[];if(_0x51c75a['user']['role']===_0x9a99('0x2f'))throw new Error('Unauthorized');if(_[_0x9a99('0x8f')](_0x2ddf37,[_0x9a99('0x2e'),_0x9a99('0x36')])&&_0x51c75a[_0x9a99('0x36')]['role']!==_0x9a99('0x34')){throw new Error(_0x9a99('0x88'));}if(_['some'](_0x2ddf37,[_0x9a99('0x2e'),_0x9a99('0x34')])&&_0x51c75a[_0x9a99('0x36')]['role']!==_0x9a99('0x34')){throw new Error(_0x9a99('0x90'));}return licenseUtil[_0x9a99('0x8a')](_0x2ddf37)[_0x9a99('0x1a')](function(){return validateUser(_0x2ddf37[0x0]);})[_0x9a99('0x1a')](function(){for(var _0x34eb0d=0x1;_0x34eb0d<_0x2ddf37[_0x9a99('0x54')];_0x34eb0d++){var _0x330411=_0x2ddf37[_0x34eb0d-0x1][_0x9a99('0x6b')];if(!_0x2ddf37[_0x34eb0d][_0x9a99('0x6b')])_0x2ddf37[_0x34eb0d][_0x9a99('0x6b')]=_0x330411+0x1;_0x21eebc[_0x9a99('0x4e')](validateUser(_0x2ddf37[_0x34eb0d]));}return Promise[_0x9a99('0x58')](_0x21eebc);})[_0x9a99('0x1a')](function(){_0x21eebc=[];for(var _0x1ba562=0x0;_0x1ba562<_0x2ddf37[_0x9a99('0x54')];_0x1ba562++){_0x21eebc['push'](updateUser(_0x2ddf37[_0x1ba562]));}return Promise['all'](_0x21eebc);})[_0x9a99('0x1a')](function(){_0x21eebc=_0x2ddf37[_0x9a99('0x3b')](function(_0x14501b){return db[_0x9a99('0x4f')][_0x9a99('0x86')](_0x14501b,{'include':[{'model':db['VoiceMail'],'as':_0x9a99('0x74')}]})[_0x9a99('0x1a')](function(_0xe44a44){_0x14501b['id']=_0xe44a44['id'];return _0x14501b;});});return Promise[_0x9a99('0x58')](_0x21eebc);})[_0x9a99('0x1a')](function(_0x4f49b6){if(_0x51c75a['body'][_0x9a99('0x2e')]===_0x9a99('0x36'))return _0x4f49b6;if(_0x51c75a[_0x9a99('0x36')][_0x9a99('0x2e')]!==_0x9a99('0x36'))return _0x4f49b6;var _0x205052=_['some'](_0x4f49b6,function(_0x16a562){return _0x16a562['role']===_0x9a99('0x2f')||_0x16a562[_0x9a99('0x2e')]===_0x9a99('0x39');});if(!_0x205052)return _0x4f49b6;return db[_0x9a99('0x91')][_0x9a99('0x50')]({'where':{'name':{'$or':[_0x9a99('0x37'),'Telephones']},'userProfileId':_0x51c75a[_0x9a99('0x36')][_0x9a99('0x8c')]},'raw':!![]})['then'](function(_0x481db2){if(_[_0x9a99('0x92')](_0x481db2)||!_[_0x9a99('0x8f')](_0x481db2,[_0x9a99('0x93'),0x0]))return _0x4f49b6;_0x21eebc=[];var _0x40db3f=_(_0x481db2)[_0x9a99('0x3b')](function(_0x3e941b){if(_0x3e941b[_0x9a99('0x93')]===0x1)return;return _0x3e941b['name']===_0x9a99('0x37')?_0x9a99('0x2f'):_0x9a99('0x39');})[_0x9a99('0x94')]()[_0x9a99('0x3c')]();for(var _0x4d770f=0x0;_0x4d770f<_0x4f49b6[_0x9a99('0x54')];_0x4d770f++){if(!_['includes'](_0x40db3f,_0x4f49b6[_0x4d770f]['role']))return;var _0x36761e=_0x4f49b6[_0x4d770f]['role']==='agent'?_0x9a99('0x37'):_0x9a99('0x38');_0x21eebc['push'](db[_0x9a99('0x8d')]['create']({'name':_0x4f49b6[_0x4d770f]['name'],'resourceId':_0x4f49b6[_0x4d770f]['id'],'type':_0x36761e,'sectionId':_[_0x9a99('0x3d')](_0x481db2,[_0x9a99('0x3e'),_0x36761e])['id']},{}));}return Promise[_0x9a99('0x58')](_0x21eebc);});})['then'](respondWithResult(_0x373ccc,0xc9))[_0x9a99('0x23')](handleError(_0x373ccc,null));};exports[_0x9a99('0x95')]=function(_0x200e78,_0x2ea6e4){if(_0x200e78[_0x9a99('0x66')]['id']){delete _0x200e78['body']['id'];}return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x200e78[_0x9a99('0x67')]['id']}})['then'](function(_0x4c9211){if(!_0x4c9211)return null;if(_0x4c9211['id']===_0x200e78[_0x9a99('0x36')]['id']){if(!_0x200e78['body'][_0x9a99('0x96')]||!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db['Sequelize'][(_0x9a99('0x98'))](_0x9a99('0x99'));}if(!_0x4c9211['authenticate'](_0x200e78['body'][_0x9a99('0x96')])){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x9b'));}if(_0x200e78[_0x9a99('0x66')]['oldPassword']===_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x9c'));}}else if(_0x200e78[_0x9a99('0x36')][_0x9a99('0x2e')]===_0x9a99('0x34')){if(!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0x9d'));}}else if(_0x200e78['user'][_0x9a99('0x2e')]==='user'){if(!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0x9d'));}if(_0x4c9211[_0x9a99('0x2e')]!==_0x9a99('0x2f')){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))]('Unauthorized');}}else{throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x87'));}return _0x4c9211;})[_0x9a99('0x1a')](handleEntityNotFound(_0x2ea6e4,null))[_0x9a99('0x1a')](function(_0x243fee){return db['Setting'][_0x9a99('0x9e')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x9a99('0x9f')]})[_0x9a99('0x1a')](function(_0x5cd869){if(_0x5cd869[_0x9a99('0x6d')])authService[_0x9a99('0xa0')](_0x200e78[_0x9a99('0x66')]['newPassword']);if(!_0x5cd869['enforcePasswordHistory']||!_0x243fee['previousPasswords'])return _0x243fee;authService[_0x9a99('0xa1')](_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],_0x243fee[_0x9a99('0xa2')],_0x5cd869[_0x9a99('0x9f')]);return _0x243fee;})[_0x9a99('0x1a')](saveUpdates({'password':_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],'passwordResetAt':_0x200e78['user']['id']==_0x200e78[_0x9a99('0x67')]['id']?moment():null,'previousPasswords':authService[_0x9a99('0xa3')](_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],_0x243fee[_0x9a99('0xa2')])},null));})[_0x9a99('0x1a')](respondWithResult(_0x2ea6e4,null))[_0x9a99('0x23')](handleError(_0x2ea6e4,null));};exports[_0x9a99('0xa4')]=function(_0x1169ee,_0x4a1b9b){var _0x451007=_0x1169ee['body']['channel'];return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x1169ee[_0x9a99('0x67')]['id']},'attributes':['id','name',_0x9a99('0x2e'),'online',_0x9a99('0xa5'),'voicePause',_0x9a99('0xa6')]})['then'](handleEntityNotFound(_0x4a1b9b,null))[_0x9a99('0x1a')](function(_0xa73ef6){if(_0xa73ef6){if(!utils['isValidChannel'](_0x451007)){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0xa7'));}return _0xa73ef6[_0x9a99('0xa8')+_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xab')](_0x1169ee[_0x9a99('0x66')]['ids'],{'penalty':_0x1169ee[_0x9a99('0x66')][_0x9a99('0xac')]||0x0})[_0x9a99('0xad')](function(_0x3f364d){for(var _0x5ec64e=0x0;_0x5ec64e<_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x5ec64e+=0x1){var _0x2c6708={'UserId':Number(_0x1169ee[_0x9a99('0x67')]['id'])};_0x2c6708[_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xae')]=Number(_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')][_0x5ec64e]);socket[_0x9a99('0x30')](_0x9a99('0x36')+_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xaf'),_0x2c6708);}return _0x3f364d;})[_0x9a99('0x1a')](function(){if(_0x451007===_0x9a99('0xb0')){return db[_0x9a99('0xb1')][_0x9a99('0x50')]({'where':{'id':_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')]||[]},'raw':!![],'attributes':['id',_0x9a99('0x3e')]});}})[_0x9a99('0x1a')](function(_0x3a9531){var _0x34af3c=_0xa73ef6['get']({'plain':!![]});var _0x293e32=[];if(_0x451007===_0x9a99('0xb0')&&_0x34af3c[_0x9a99('0x2e')]==='agent'&&_0x34af3c[_0x9a99('0xb2')]){for(let _0x404a50=0x0;_0x404a50<_0x3a9531[_0x9a99('0x54')];_0x404a50+=0x1){_0x293e32[_0x9a99('0x4e')]({'membername':_0x34af3c['name'],'UserId':_0x34af3c['id'],'queue_name':_0x3a9531[_0x404a50][_0x9a99('0x3e')],'VoiceQueueId':_0x3a9531[_0x404a50]['id'],'interface':_[_0x9a99('0x6e')](_0x34af3c[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x34af3c[_0x9a99('0x3e')]):_0x34af3c[_0x9a99('0xa6')],'paused':_0x34af3c[_0x9a99('0xb5')]||![],'penalty':_0x1169ee[_0x9a99('0x66')][_0x9a99('0xac')]||0x0});}return Promise[_0x9a99('0x58')](_0x293e32[_0x9a99('0x3b')](function(_0x1d5ea5){return db[_0x9a99('0xb6')][_0x9a99('0xb7')](_0x1d5ea5);}));}return _0xa73ef6;});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x4a1b9b,null))[_0x9a99('0x23')](handleError(_0x4a1b9b,null));};exports[_0x9a99('0xb8')]=function(_0x2209c3,_0x40785e){var _0x4514e2,_0x972391;return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x2209c3[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x2e')]})[_0x9a99('0x1a')](handleEntityNotFound(_0x40785e,null))[_0x9a99('0x1a')](function(_0x476c7a){if(_0x476c7a){_0x4514e2=_0x476c7a;if(!_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')]||!utils[_0x9a99('0xba')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')])){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xa7'));}return _0x476c7a['remove'+_[_0x9a99('0xa9')](_0x2209c3['query'][_0x9a99('0xb9')][_0x9a99('0xaa')]())+_0x9a99('0xab')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](function(_0x51bf56){if(_[_0x9a99('0xbb')](_0x2209c3['query']['ids'])){for(var _0x69cd9d=0x0;_0x69cd9d<_0x2209c3['query']['ids'][_0x9a99('0x54')];_0x69cd9d+=0x1){_0x972391={'UserId':Number(_0x2209c3[_0x9a99('0x67')]['id'])};_0x972391[_[_0x9a99('0xa9')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')][_0x9a99('0xaa')]())+_0x9a99('0xae')]=Number(_0x2209c3[_0x9a99('0x52')][_0x9a99('0x6a')][_0x69cd9d]);socket['emit'](_0x9a99('0x36')+_['capitalize'](_0x2209c3[_0x9a99('0x52')]['channel'][_0x9a99('0xaa')]())+_0x9a99('0xbc'),_0x972391);}}else{_0x972391={'UserId':Number(_0x2209c3[_0x9a99('0x67')]['id'])};_0x972391[_[_0x9a99('0xa9')](_0x2209c3[_0x9a99('0x52')]['channel']['toLowerCase']())+_0x9a99('0xae')]=Number(_0x2209c3['query']['ids']);socket[_0x9a99('0x30')]('user'+_[_0x9a99('0xa9')](_0x2209c3['query']['channel'][_0x9a99('0xaa')]())+'Queue:remove',_0x972391);}return _0x51bf56;})[_0x9a99('0x1a')](function(){if(_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')]===_0x9a99('0xb0')){return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'UserId':_0x2209c3['params']['id'],'VoiceQueueId':_0x2209c3[_0x9a99('0x52')]['ids']},'individualHooks':!![]})[_0x9a99('0x1a')](function(){return _0x4514e2;});}return _0x4514e2;})[_0x9a99('0x1a')](respondWithStatusCode(_0x40785e,null))['catch'](handleError(_0x40785e,null));};exports[_0x9a99('0xbd')]=function(_0xb7f3ca,_0x30c278){_0xb7f3ca['body'][_0x9a99('0xbe')]=_0xb7f3ca[_0x9a99('0xbf')][_0x9a99('0xc0')];return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xb7f3ca['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x30c278,null))[_0x9a99('0x1a')](saveUpdates(_0xb7f3ca[_0x9a99('0x66')],null))[_0x9a99('0x1a')](respondWithResult(_0x30c278,null))['catch'](handleError(_0x30c278,null));};exports[_0x9a99('0xc1')]=function(_0x4c81e0,_0x52641e){var _0x21490d=path[_0x9a99('0xc2')](config[_0x9a99('0xc3')],_0x9a99('0xc4'));return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x4c81e0[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0xbe')],'raw':!![]})[_0x9a99('0x1a')](handleEntityNotFound(_0x52641e,null))[_0x9a99('0x1a')](function(_0x32098d){if(_0x32098d){if(_[_0x9a99('0x6e')](_0x32098d['userpic'])){return _0x52641e[_0x9a99('0xc5')](_0x21490d);}else{if(!fs[_0x9a99('0xc6')](path[_0x9a99('0xc2')](config[_0x9a99('0xc3')],'server/files/images/',_0x32098d[_0x9a99('0xbe')]))){return _0x52641e[_0x9a99('0xc5')](_0x21490d);}return _0x52641e[_0x9a99('0xc5')](path[_0x9a99('0xc2')](config['root'],_0x9a99('0xc7'),_0x32098d[_0x9a99('0xbe')]));}}})['catch'](handleError(_0x52641e,null));};exports[_0x9a99('0xc8')]=function(_0x10f3d1,_0x33937e){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x10f3d1[_0x9a99('0x67')]['id']},'attributes':['id']})[_0x9a99('0x1a')](handleEntityNotFound(_0x33937e,null))['then'](function(_0x30fe33){var _0x534b24=[];values=_0x30fe33[_0x9a99('0x56')];_0x534b24[_0x9a99('0x4e')](get_open_tabs('chat',_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs('sms',_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x62'),_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x63'),_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x64'),_0x30fe33[_0x9a99('0x56')]));_0x534b24['push'](get_open_tabs(_0x9a99('0x65'),_0x30fe33['dataValues']));return Promise[_0x9a99('0x58')](_0x534b24);})[_0x9a99('0x1a')](function(_0x596223){if(_0x596223){var _0x3da294=_[_0x9a99('0x3b')](values[_0x9a99('0xc9')],function(_0x5772a5){return{'channel':'CHAT','id':_0x5772a5['id'],'createdAt':_0x5772a5[_0x9a99('0xca')]};});var _0x5a47ba=_[_0x9a99('0x3b')](values[_0x9a99('0xcb')],function(_0x5ef35f){return{'channel':_0x9a99('0xcc'),'id':_0x5ef35f['id'],'createdAt':_0x5ef35f[_0x9a99('0xca')]};});var _0x4997ba=_['map'](values['OpenchannelOpenTabs'],function(_0x80eff){return{'channel':_0x9a99('0xcd'),'id':_0x80eff['id'],'createdAt':_0x80eff[_0x9a99('0xca')]};});var _0x4be8a9=_[_0x9a99('0x3b')](values[_0x9a99('0xce')],function(_0x2345d1){return{'channel':_0x9a99('0xcf'),'id':_0x2345d1['id'],'createdAt':_0x2345d1['createdAt']};});var _0xd9d5b3=_[_0x9a99('0x3b')](values[_0x9a99('0xd0')],function(_0xc54e9){return{'channel':_0x9a99('0xd1'),'id':_0xc54e9['id'],'createdAt':_0xc54e9[_0x9a99('0xca')]};});var _0x484f2b=_[_0x9a99('0x3b')](values['WhatsappOpenTabs'],function(_0x53f3ac){return{'channel':'WHATSAPP','id':_0x53f3ac['id'],'createdAt':_0x53f3ac[_0x9a99('0xca')]};});var _0x21088b=_[_0x9a99('0xd2')](_0x3da294,_0x5a47ba,_0x4997ba,_0x4be8a9,_0xd9d5b3,_0x484f2b);var _0x22a6fd={'count':_0x21088b[_0x9a99('0x54')],'rows':_0x21088b};return _0x22a6fd;}else return null;})[_0x9a99('0x1a')](respondWithResult(_0x33937e,null))['catch'](handleError(_0x33937e,null));};exports[_0x9a99('0xd3')]=function(_0x2fdcf2,_0x540905){var _0x302676={};var _0xba8f03={};var _0x5ca857;var _0x5147d8;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x2fdcf2[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x540905,null))['then'](function(_0x2b3a2f){if(_0x2b3a2f){_0x5ca857=_0x2b3a2f;_0xba8f03[_0x9a99('0x5e')]=_['keys'](db['CmContact'][_0x9a99('0x5b')]);_0xba8f03[_0x9a99('0x52')]=_['keys'](_0x2fdcf2[_0x9a99('0x52')]);_0xba8f03[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0xba8f03[_0x9a99('0x5e')],_0xba8f03[_0x9a99('0x52')]);_0x302676['attributes']=_[_0x9a99('0x5d')](_0xba8f03[_0x9a99('0x5e')],qs['fields'](_0x2fdcf2[_0x9a99('0x52')]['fields']));_0x302676[_0x9a99('0x4d')]=_0x302676[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x302676['attributes']:_0xba8f03[_0x9a99('0x5e')];_0x302676[_0x9a99('0xd4')]=qs['sort'](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x302676[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x2fdcf2[_0x9a99('0x52')],_0xba8f03[_0x9a99('0x5c')]));if(_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x45')]){_0x302676['where']=_[_0x9a99('0x60')](_0x302676[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x302676[_0x9a99('0x4d')],function(_0x11cac9){var _0x2b69c9={};_0x2b69c9[_0x11cac9]={'$like':'%'+_0x2fdcf2[_0x9a99('0x52')]['filter']+'%'};return _0x2b69c9;})});}_0x302676=_['merge']({},_0x302676,_0x2fdcf2[_0x9a99('0xd8')]);return _0x5ca857[_0x9a99('0xd3')](_0x302676);}})[_0x9a99('0x1a')](function(_0x198eee){if(_0x198eee){_0x5147d8=_0x198eee[_0x9a99('0x54')];if(_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xda'))){_0x302676[_0x9a99('0x4a')]=[{'model':db['CmList'],'as':_0x9a99('0xdb'),'required':![]},{'model':db[_0x9a99('0xdc')],'as':'Tags','attributes':['id',_0x9a99('0x3e'),'color'],'where':_0x2fdcf2[_0x9a99('0x52')]['tag']?{'id':_0x2fdcf2['query']['tag']}:undefined,'required':_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xdd')]?!![]:![]}];}if(!_0x2fdcf2['query']['hasOwnProperty'](_0x9a99('0xde'))){_0x302676[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x29')]);_0x302676[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x5ca857[_0x9a99('0xd3')](_0x302676);}})[_0x9a99('0x1a')](function(_0x1b8e0e){if(_0x1b8e0e){return _0x1b8e0e?{'count':_0x5147d8,'rows':_0x1b8e0e}:null;}})['then'](respondWithResult(_0x540905,null))[_0x9a99('0x23')](handleError(_0x540905,null));};exports[_0x9a99('0xdf')]=function(_0x406bff,_0x4ade61){var _0x12be65;var _0x2f0f2d={};var _0xf3b18d;return db['User']['findOne']({'where':{'id':_0x406bff[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0x3e'),'role']})[_0x9a99('0x1a')](handleEntityNotFound(_0x4ade61,null))['then'](function(_0x33e97d){if(!utils[_0x9a99('0xba')](_0x406bff['query']['channel'])){throw new db['Sequelize'][(_0x9a99('0x98'))]('Unknown\x20channel');}_0x12be65=_0x33e97d;var _0x458579={};_0x458579['model']=_[_0x9a99('0x5a')](db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xb9')])+'Queue'][_0x9a99('0x5b')]);_0x458579['query']=_['keys'](_0x406bff[_0x9a99('0x52')]);_0x458579[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x458579[_0x9a99('0x5e')],_0x458579[_0x9a99('0x52')]);_0x2f0f2d[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x458579[_0x9a99('0x5e')],qs['fields'](_0x406bff[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x2f0f2d[_0x9a99('0x4d')]=_0x2f0f2d[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x2f0f2d['attributes']:_0x458579[_0x9a99('0x5e')];_0x2f0f2d[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x2f0f2d[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x406bff[_0x9a99('0x52')],_0x458579[_0x9a99('0x5c')]));if(_0x406bff[_0x9a99('0x52')][_0x9a99('0x45')]){_0x2f0f2d['where']=_[_0x9a99('0x60')](_0x2f0f2d[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x2f0f2d[_0x9a99('0x4d')],function(_0x4c9649){var _0x5efb54={};_0x5efb54[_0x4c9649]={'$like':'%'+_0x406bff[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x5efb54;})});}_0x2f0f2d=_[_0x9a99('0x60')]({},_0x2f0f2d,_0x406bff[_0x9a99('0xd8')]);switch(_0x12be65['role']){case _0x9a99('0x34'):return db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xb9')])+_0x9a99('0xe0')][_0x9a99('0x50')](_0x2f0f2d);case _0x9a99('0x36'):case _0x9a99('0x2f'):return _0x12be65[_0x9a99('0x33')+_[_0x9a99('0xa9')](_0x406bff['query']['channel'])+_0x9a99('0xab')](_0x2f0f2d);default:throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xe1'));}})[_0x9a99('0x1a')](function(_0x467670){_0xf3b18d=_0x467670['length'];if(!_0x406bff[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x2f0f2d[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x406bff[_0x9a99('0x52')][_0x9a99('0x29')]);_0x2f0f2d['offset']=qs[_0x9a99('0x28')](_0x406bff[_0x9a99('0x52')][_0x9a99('0x28')]);}switch(_0x12be65[_0x9a99('0x2e')]){case'admin':return db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')]['channel'])+'Queue'][_0x9a99('0x50')](_0x2f0f2d);case _0x9a99('0x36'):case _0x9a99('0x2f'):return _0x12be65[_0x9a99('0x33')+_[_0x9a99('0xa9')](_0x406bff['query'][_0x9a99('0xb9')])+_0x9a99('0xab')](_0x2f0f2d);}})['then'](function(_0x2ba483){return{'count':_0xf3b18d,'rows':_0x2ba483};})[_0x9a99('0x1a')](respondWithResult(_0x4ade61,null))[_0x9a99('0x23')](handleError(_0x4ade61,null));};exports[_0x9a99('0xe2')]=function(_0x49629e,_0x4e2cf3){var _0xab5fca={};var _0x4e3d42={};var _0x2452bf;var _0x51cce9;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x49629e['params']['id']}})['then'](handleEntityNotFound(_0x4e2cf3,null))[_0x9a99('0x1a')](function(_0x2bd9aa){if(_0x2bd9aa){_0x2452bf=_0x2bd9aa;_0x4e3d42[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['UserVoiceQueueRt'][_0x9a99('0x5b')]);_0x4e3d42['query']=_[_0x9a99('0x5a')](_0x49629e[_0x9a99('0x52')]);_0x4e3d42[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4e3d42[_0x9a99('0x5e')],_0x4e3d42['query']);_0xab5fca[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4e3d42[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x49629e['query'][_0x9a99('0x5f')]));_0xab5fca[_0x9a99('0x4d')]=_0xab5fca[_0x9a99('0x4d')][_0x9a99('0x54')]?_0xab5fca[_0x9a99('0x4d')]:_0x4e3d42[_0x9a99('0x5e')];_0xab5fca[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x49629e['query'][_0x9a99('0xd5')]);_0xab5fca[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x49629e[_0x9a99('0x52')],_0x4e3d42[_0x9a99('0x5c')]));if(_0x49629e[_0x9a99('0x52')]['filter']){_0xab5fca[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0xab5fca[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0xab5fca[_0x9a99('0x4d')],function(_0x16bf5d){var _0x4b0a77={};_0x4b0a77[_0x16bf5d]={'$like':'%'+_0x49629e[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x4b0a77;})});}_0xab5fca=_['merge']({},_0xab5fca,_0x49629e['options']);return _0x2452bf['getVoiceQueuesRt'](_0xab5fca);}})['then'](function(_0x493a85){if(_0x493a85){_0x51cce9=_0x493a85[_0x9a99('0x54')];if(!_0x49629e['query'][_0x9a99('0xd9')](_0x9a99('0xde'))){_0xab5fca['limit']=qs[_0x9a99('0x29')](_0x49629e[_0x9a99('0x52')][_0x9a99('0x29')]);_0xab5fca[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x49629e[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x2452bf['getVoiceQueuesRt'](_0xab5fca);}})[_0x9a99('0x1a')](function(_0x27302a){if(_0x27302a){return _0x27302a?{'count':_0x51cce9,'rows':_0x27302a}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x4e2cf3,null))[_0x9a99('0x23')](handleError(_0x4e2cf3,null));};exports[_0x9a99('0xe3')]=function(_0x31ae30,_0x3de746){var _0x104e8a={};var _0x21105a={};var _0x2cf793;var _0x17f211;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x31ae30['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3de746,null))[_0x9a99('0x1a')](function(_0x407ba9){if(_0x407ba9){_0x2cf793=_0x407ba9;_0x21105a['model']=_['keys'](db[_0x9a99('0xe4')][_0x9a99('0x5b')]);_0x21105a['query']=_[_0x9a99('0x5a')](_0x31ae30['query']);_0x21105a[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x21105a[_0x9a99('0x5e')],_0x21105a[_0x9a99('0x52')]);_0x104e8a['attributes']=_['intersection'](_0x21105a[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x31ae30[_0x9a99('0x52')]['fields']));_0x104e8a[_0x9a99('0x4d')]=_0x104e8a['attributes']['length']?_0x104e8a[_0x9a99('0x4d')]:_0x21105a[_0x9a99('0x5e')];_0x104e8a[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x31ae30[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x104e8a[_0x9a99('0xd6')]=qs['filters'](_['pick'](_0x31ae30[_0x9a99('0x52')],_0x21105a[_0x9a99('0x5c')]));if(_0x31ae30[_0x9a99('0x52')]['filter']){_0x104e8a['where']=_[_0x9a99('0x60')](_0x104e8a['where'],{'$or':_['map'](_0x104e8a[_0x9a99('0x4d')],function(_0x3fc505){var _0x496302={};_0x496302[_0x3fc505]={'$like':'%'+_0x31ae30[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x496302;})});}_0x104e8a=_[_0x9a99('0x60')]({},_0x104e8a,_0x31ae30[_0x9a99('0xd8')]);return _0x2cf793[_0x9a99('0xe3')](_0x104e8a);}})[_0x9a99('0x1a')](function(_0x5a2e93){if(_0x5a2e93){_0x17f211=_0x5a2e93[_0x9a99('0x54')];if(!_0x31ae30[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x104e8a[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x31ae30[_0x9a99('0x52')][_0x9a99('0x29')]);_0x104e8a['offset']=qs[_0x9a99('0x28')](_0x31ae30['query'][_0x9a99('0x28')]);}return _0x2cf793[_0x9a99('0xe3')](_0x104e8a);}})[_0x9a99('0x1a')](function(_0x3968cb){if(_0x3968cb){return _0x3968cb?{'count':_0x17f211,'rows':_0x3968cb}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x3de746,null))[_0x9a99('0x23')](handleError(_0x3de746,null));};exports[_0x9a99('0xe5')]=function(_0x10e089,_0x44cd67){var _0x67640e={'raw':!![],'where':{}};var _0x17d823={};var _0xd04ad={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x10e089[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x44cd67,null))[_0x9a99('0x1a')](function(_0x547ed6){if(_0x547ed6){_0x17d823[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['VoiceRecording'][_0x9a99('0x5b')]);_0x17d823[_0x9a99('0x52')]=_['keys'](_0x10e089[_0x9a99('0x52')]);_0x17d823[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x17d823[_0x9a99('0x5e')],_0x17d823[_0x9a99('0x52')]);_0x67640e[_0x9a99('0x4d')]=_['intersection'](_0x17d823[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x10e089['query'][_0x9a99('0x5f')]));_0x67640e[_0x9a99('0x4d')]=_0x67640e['attributes']['length']?_0x67640e[_0x9a99('0x4d')]:_0x17d823[_0x9a99('0x5e')];if(!_0x10e089[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x67640e[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x10e089[_0x9a99('0x52')][_0x9a99('0x29')]);_0x67640e['offset']=qs[_0x9a99('0x28')](_0x10e089['query'][_0x9a99('0x28')]);}_0x67640e[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x10e089[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x67640e[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x10e089['query'],_0x17d823[_0x9a99('0x5c')]));_0x67640e['where'][_0x9a99('0xe6')]=_0x547ed6['id'];if(_0x10e089[_0x9a99('0x52')]['filter']){_0x67640e['where']=_[_0x9a99('0x60')](_0x67640e[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x67640e[_0x9a99('0x4d')],function(_0x35c6cb){var _0x5dea36={};_0x5dea36[_0x35c6cb]={'$like':'%'+_0x10e089[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x5dea36;})});}_0x67640e=_[_0x9a99('0x60')]({},_0x67640e,_0x10e089[_0x9a99('0xd8')]);return db[_0x9a99('0xe7')][_0x9a99('0x2a')]({'where':_0x67640e[_0x9a99('0xd6')]})[_0x9a99('0x1a')](function(_0x371714){_0xd04ad['count']=_0x371714;if(_0x10e089[_0x9a99('0x52')][_0x9a99('0xda')]){_0x67640e['include']=[{'all':!![]}];}return db[_0x9a99('0xe7')][_0x9a99('0x50')](_0x67640e);})[_0x9a99('0x1a')](function(_0x1ada5){_0xd04ad[_0x9a99('0x51')]=_0x1ada5;return _0xd04ad;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x44cd67,_0x67640e))[_0x9a99('0x23')](handleError(_0x44cd67,null));};exports[_0x9a99('0xe8')]=function(_0x12284e,_0x53dc63){var _0x5cdf76={'raw':!![],'where':{}};var _0x1dd668={};var _0x13657a={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x12284e[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x53dc63,null))['then'](function(_0x279cee){if(_0x279cee){_0x1dd668['model']=_[_0x9a99('0x5a')](db[_0x9a99('0xe9')][_0x9a99('0x5b')]);_0x1dd668[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x12284e['query']);_0x1dd668[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x1dd668[_0x9a99('0x5e')],_0x1dd668[_0x9a99('0x52')]);_0x5cdf76['attributes']=_[_0x9a99('0x5d')](_0x1dd668[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x12284e[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5cdf76[_0x9a99('0x4d')]=_0x5cdf76['attributes']['length']?_0x5cdf76['attributes']:_0x1dd668['model'];if(!_0x12284e[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x5cdf76[_0x9a99('0x29')]=qs['limit'](_0x12284e[_0x9a99('0x52')]['limit']);_0x5cdf76[_0x9a99('0x28')]=qs['offset'](_0x12284e['query'][_0x9a99('0x28')]);}_0x5cdf76['order']=qs['sort'](_0x12284e[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x5cdf76[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x12284e[_0x9a99('0x52')],_0x1dd668[_0x9a99('0x5c')]));_0x5cdf76['where']['UserId']=_0x279cee['id'];if(_0x12284e[_0x9a99('0x52')][_0x9a99('0x45')]){_0x5cdf76[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5cdf76[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5cdf76[_0x9a99('0x4d')],function(_0x486187){var _0x2c7877={};_0x2c7877[_0x486187]={'$like':'%'+_0x12284e['query'][_0x9a99('0x45')]+'%'};return _0x2c7877;})});}_0x5cdf76=_[_0x9a99('0x60')]({},_0x5cdf76,_0x12284e['options']);return db[_0x9a99('0xe9')]['count']({'where':_0x5cdf76['where']})['then'](function(_0x295b52){_0x13657a[_0x9a99('0x2a')]=_0x295b52;if(_0x12284e[_0x9a99('0x52')][_0x9a99('0xda')]){_0x5cdf76[_0x9a99('0x4a')]=[{'all':!![]}];}return db[_0x9a99('0xe9')][_0x9a99('0x50')](_0x5cdf76);})[_0x9a99('0x1a')](function(_0x4dc25c){_0x13657a['rows']=_0x4dc25c;return _0x13657a;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x53dc63,_0x5cdf76))[_0x9a99('0x23')](handleError(_0x53dc63,null));};exports[_0x9a99('0xea')]=function(_0x5d91da,_0xf7adc8){var _0x56e1e5={};var _0x2afaa8={};var _0x2eeb94;var _0x458095;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x5d91da[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0xf7adc8,null))[_0x9a99('0x1a')](function(_0x51990d){if(_0x51990d){_0x2eeb94=_0x51990d;_0x2afaa8['model']=_['keys'](db['ChatInteraction'][_0x9a99('0x5b')]);_0x2afaa8[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x5d91da[_0x9a99('0x52')]);_0x2afaa8[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x2afaa8[_0x9a99('0x5e')],_0x2afaa8[_0x9a99('0x52')]);_0x56e1e5[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x2afaa8['model'],qs[_0x9a99('0x5f')](_0x5d91da[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x56e1e5[_0x9a99('0x4d')]=_0x56e1e5[_0x9a99('0x4d')]['length']?_0x56e1e5[_0x9a99('0x4d')]:_0x2afaa8[_0x9a99('0x5e')];_0x56e1e5[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x5d91da['query'][_0x9a99('0xd5')]);_0x56e1e5[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x5d91da[_0x9a99('0x52')],_0x2afaa8[_0x9a99('0x5c')]));if(_0x5d91da['query'][_0x9a99('0x45')]){_0x56e1e5[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x56e1e5[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x56e1e5[_0x9a99('0x4d')],function(_0x3f23c1){var _0x573e64={};_0x573e64[_0x3f23c1]={'$like':'%'+_0x5d91da['query'][_0x9a99('0x45')]+'%'};return _0x573e64;})});}_0x56e1e5=_[_0x9a99('0x60')]({},_0x56e1e5,_0x5d91da[_0x9a99('0xd8')]);return _0x2eeb94[_0x9a99('0xea')](_0x56e1e5);}})[_0x9a99('0x1a')](function(_0x5309b1){if(_0x5309b1){_0x458095=_0x5309b1[_0x9a99('0x54')];if(!_0x5d91da[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x56e1e5[_0x9a99('0x29')]=qs['limit'](_0x5d91da[_0x9a99('0x52')][_0x9a99('0x29')]);_0x56e1e5[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x5d91da['query']['offset']);}return _0x2eeb94[_0x9a99('0xea')](_0x56e1e5);}})[_0x9a99('0x1a')](function(_0x4f7dd5){if(_0x4f7dd5){return _0x4f7dd5?{'count':_0x458095,'rows':_0x4f7dd5}:null;}})[_0x9a99('0x1a')](respondWithResult(_0xf7adc8,null))['catch'](handleError(_0xf7adc8,null));};exports[_0x9a99('0xeb')]=function(_0x3c9e25,_0x1c976d){var _0x5e5852={};var _0x4fc12f={};var _0x41dd1a;var _0x3c4c58;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x3c9e25[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x1c976d,null))[_0x9a99('0x1a')](function(_0x399c02){if(_0x399c02){_0x41dd1a=_0x399c02;_0x4fc12f[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['OpenchannelInteraction'][_0x9a99('0x5b')]);_0x4fc12f[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x3c9e25['query']);_0x4fc12f['filters']=_['intersection'](_0x4fc12f[_0x9a99('0x5e')],_0x4fc12f[_0x9a99('0x52')]);_0x5e5852[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4fc12f['model'],qs[_0x9a99('0x5f')](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5e5852['attributes']=_0x5e5852[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x5e5852[_0x9a99('0x4d')]:_0x4fc12f['model'];_0x5e5852['order']=qs['sort'](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x5e5852[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x3c9e25[_0x9a99('0x52')],_0x4fc12f[_0x9a99('0x5c')]));if(_0x3c9e25['query'][_0x9a99('0x45')]){_0x5e5852[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5e5852[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5e5852[_0x9a99('0x4d')],function(_0x7e82c3){var _0x4b89d7={};_0x4b89d7[_0x7e82c3]={'$like':'%'+_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x4b89d7;})});}_0x5e5852=_[_0x9a99('0x60')]({},_0x5e5852,_0x3c9e25[_0x9a99('0xd8')]);return _0x41dd1a[_0x9a99('0xeb')](_0x5e5852);}})[_0x9a99('0x1a')](function(_0x46d228){if(_0x46d228){_0x3c4c58=_0x46d228['length'];if(!_0x3c9e25[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x5e5852[_0x9a99('0x29')]=qs['limit'](_0x3c9e25['query'][_0x9a99('0x29')]);_0x5e5852[_0x9a99('0x28')]=qs['offset'](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x41dd1a['getOpenchannelInteractions'](_0x5e5852);}})[_0x9a99('0x1a')](function(_0x30e8dc){if(_0x30e8dc){return _0x30e8dc?{'count':_0x3c4c58,'rows':_0x30e8dc}:null;}})['then'](respondWithResult(_0x1c976d,null))[_0x9a99('0x23')](handleError(_0x1c976d,null));};exports[_0x9a99('0xec')]=function(_0x7a8d1c,_0xb80dd1){var _0x30a29c={'raw':!![],'where':{}};var _0x33092a={};var _0x25d155={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x7a8d1c[_0x9a99('0x67')]['id']}})['then'](handleEntityNotFound(_0xb80dd1,null))[_0x9a99('0x1a')](function(_0x3719a9){if(_0x3719a9){_0x33092a[_0x9a99('0x5e')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x33092a['query']=_[_0x9a99('0x5a')](_0x7a8d1c[_0x9a99('0x52')]);_0x33092a['filters']=_[_0x9a99('0x5d')](_0x33092a[_0x9a99('0x5e')],_0x33092a['query']);_0x30a29c['attributes']=_['intersection'](_0x33092a[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x30a29c[_0x9a99('0x4d')]=_0x30a29c['attributes'][_0x9a99('0x54')]?_0x30a29c[_0x9a99('0x4d')]:_0x33092a[_0x9a99('0x5e')];if(!_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x30a29c[_0x9a99('0x29')]=qs['limit'](_0x7a8d1c[_0x9a99('0x52')]['limit']);_0x30a29c[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0x28')]);}_0x30a29c[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x7a8d1c[_0x9a99('0x52')]['sort']);_0x30a29c[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x7a8d1c[_0x9a99('0x52')],_0x33092a[_0x9a99('0x5c')]));_0x30a29c[_0x9a99('0xd6')]['UserId']=_0x3719a9['id'];if(_0x7a8d1c['query']['filter']){_0x30a29c[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x30a29c[_0x9a99('0xd6')],{'$or':_['map'](_0x30a29c[_0x9a99('0x4d')],function(_0x5094f9){var _0x2172a5={};_0x2172a5[_0x5094f9]={'$like':'%'+_0x7a8d1c[_0x9a99('0x52')]['filter']+'%'};return _0x2172a5;})});}_0x30a29c=_[_0x9a99('0x60')]({},_0x30a29c,_0x7a8d1c[_0x9a99('0xd8')]);return db[_0x9a99('0xed')][_0x9a99('0x2a')]({'where':_0x30a29c[_0x9a99('0xd6')]})[_0x9a99('0x1a')](function(_0x109018){_0x25d155[_0x9a99('0x2a')]=_0x109018;if(_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0xda')]){_0x30a29c[_0x9a99('0x4a')]=[{'all':!![]}];}return db[_0x9a99('0xed')]['findAll'](_0x30a29c);})['then'](function(_0x3b15c2){_0x25d155['rows']=_0x3b15c2;return _0x25d155;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0xb80dd1,_0x30a29c))[_0x9a99('0x23')](handleError(_0xb80dd1,null));};exports[_0x9a99('0xee')]=function(_0x54be22,_0x568857){var _0x1a9a36={};var _0x45a23e={};var _0x25f9dd;var _0x5e2fe9;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x54be22[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x568857,null))[_0x9a99('0x1a')](function(_0x4d520f){if(_0x4d520f){_0x25f9dd=_0x4d520f;_0x45a23e[_0x9a99('0x5e')]=_['keys'](db[_0x9a99('0xef')]['rawAttributes']);_0x45a23e[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x54be22[_0x9a99('0x52')]);_0x45a23e[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x45a23e[_0x9a99('0x5e')],_0x45a23e['query']);_0x1a9a36[_0x9a99('0x4d')]=_['intersection'](_0x45a23e[_0x9a99('0x5e')],qs['fields'](_0x54be22['query']['fields']));_0x1a9a36[_0x9a99('0x4d')]=_0x1a9a36[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x1a9a36[_0x9a99('0x4d')]:_0x45a23e[_0x9a99('0x5e')];_0x1a9a36[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x54be22[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x1a9a36['where']=qs[_0x9a99('0x5c')](_['pick'](_0x54be22['query'],_0x45a23e['filters']));if(_0x54be22[_0x9a99('0x52')]['filter']){_0x1a9a36[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x1a9a36[_0x9a99('0xd6')],{'$or':_['map'](_0x1a9a36[_0x9a99('0x4d')],function(_0x503cc4){var _0x1b92ad={};_0x1b92ad[_0x503cc4]={'$like':'%'+_0x54be22[_0x9a99('0x52')]['filter']+'%'};return _0x1b92ad;})});}_0x1a9a36=_[_0x9a99('0x60')]({},_0x1a9a36,_0x54be22[_0x9a99('0xd8')]);return _0x25f9dd[_0x9a99('0xee')](_0x1a9a36);}})[_0x9a99('0x1a')](function(_0x470f4c){if(_0x470f4c){_0x5e2fe9=_0x470f4c[_0x9a99('0x54')];if(!_0x54be22[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x1a9a36[_0x9a99('0x29')]=qs['limit'](_0x54be22['query'][_0x9a99('0x29')]);_0x1a9a36[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x54be22[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x25f9dd[_0x9a99('0xee')](_0x1a9a36);}})['then'](function(_0x18855a){if(_0x18855a){return _0x18855a?{'count':_0x5e2fe9,'rows':_0x18855a}:null;}})['then'](respondWithResult(_0x568857,null))[_0x9a99('0x23')](handleError(_0x568857,null));};exports[_0x9a99('0xf0')]=function(_0x29ce58,_0x494ebb){var _0x526e38={};var _0x453289={};var _0xf3c5a8;var _0x3f28df;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x29ce58[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x494ebb,null))['then'](function(_0x534d0c){if(_0x534d0c){_0xf3c5a8=_0x534d0c;_0x453289[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0xf1')][_0x9a99('0x5b')]);_0x453289['query']=_['keys'](_0x29ce58[_0x9a99('0x52')]);_0x453289[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x453289[_0x9a99('0x5e')],_0x453289[_0x9a99('0x52')]);_0x526e38[_0x9a99('0x4d')]=_['intersection'](_0x453289[_0x9a99('0x5e')],qs['fields'](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x526e38[_0x9a99('0x4d')]=_0x526e38[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x526e38['attributes']:_0x453289[_0x9a99('0x5e')];_0x526e38['order']=qs['sort'](_0x29ce58[_0x9a99('0x52')]['sort']);_0x526e38[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x29ce58[_0x9a99('0x52')],_0x453289[_0x9a99('0x5c')]));if(_0x29ce58[_0x9a99('0x52')][_0x9a99('0x45')]){_0x526e38['where']=_[_0x9a99('0x60')](_0x526e38[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x526e38[_0x9a99('0x4d')],function(_0x1b0d26){var _0x326c70={};_0x326c70[_0x1b0d26]={'$like':'%'+_0x29ce58['query'][_0x9a99('0x45')]+'%'};return _0x326c70;})});}_0x526e38=_[_0x9a99('0x60')]({},_0x526e38,_0x29ce58[_0x9a99('0xd8')]);return _0xf3c5a8['getFaxInteractions'](_0x526e38);}})[_0x9a99('0x1a')](function(_0x5b0f8f){if(_0x5b0f8f){_0x3f28df=_0x5b0f8f[_0x9a99('0x54')];if(!_0x29ce58[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x526e38[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x29')]);_0x526e38[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0xf3c5a8[_0x9a99('0xf0')](_0x526e38);}})['then'](function(_0x457e91){if(_0x457e91){return _0x457e91?{'count':_0x3f28df,'rows':_0x457e91}:null;}})['then'](respondWithResult(_0x494ebb,null))['catch'](handleError(_0x494ebb,null));};exports[_0x9a99('0xf2')]=function(_0x35f0f5,_0x39ae6c){var _0x1ec31c={};var _0x4a1152={};var _0x185947;var _0x2b00df;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x35f0f5[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x39ae6c,null))[_0x9a99('0x1a')](function(_0x153084){if(_0x153084){_0x185947=_0x153084;_0x4a1152[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0xf3')][_0x9a99('0x5b')]);_0x4a1152[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x35f0f5[_0x9a99('0x52')]);_0x4a1152[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4a1152[_0x9a99('0x5e')],_0x4a1152[_0x9a99('0x52')]);_0x1ec31c[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4a1152[_0x9a99('0x5e')],qs['fields'](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x1ec31c[_0x9a99('0x4d')]=_0x1ec31c[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x1ec31c[_0x9a99('0x4d')]:_0x4a1152[_0x9a99('0x5e')];_0x1ec31c[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x35f0f5[_0x9a99('0x52')]['sort']);_0x1ec31c[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x35f0f5['query'],_0x4a1152[_0x9a99('0x5c')]));if(_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x45')]){_0x1ec31c[_0x9a99('0xd6')]=_['merge'](_0x1ec31c[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x1ec31c[_0x9a99('0x4d')],function(_0x16fa3e){var _0x13a428={};_0x13a428[_0x16fa3e]={'$like':'%'+_0x35f0f5[_0x9a99('0x52')]['filter']+'%'};return _0x13a428;})});}_0x1ec31c=_[_0x9a99('0x60')]({},_0x1ec31c,_0x35f0f5[_0x9a99('0xd8')]);return _0x185947['getWhatsappInteractions'](_0x1ec31c);}})[_0x9a99('0x1a')](function(_0x4578d9){if(_0x4578d9){_0x2b00df=_0x4578d9[_0x9a99('0x54')];if(!_0x35f0f5[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x1ec31c['limit']=qs['limit'](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x29')]);_0x1ec31c[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x185947[_0x9a99('0xf2')](_0x1ec31c);}})[_0x9a99('0x1a')](function(_0xaa3ac6){if(_0xaa3ac6){return _0xaa3ac6?{'count':_0x2b00df,'rows':_0xaa3ac6}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x39ae6c,null))['catch'](handleError(_0x39ae6c,null));};exports[_0x9a99('0xf4')]=function(_0x38b194,_0x36b7e8,_0x2ded5a){var _0xadf8e3;var _0x21de34;var _0x5777a7;var _0x164801=!_['isNil'](_0x38b194[_0x9a99('0x67')]['id'])?_0x38b194[_0x9a99('0x67')]['id']:!_[_0x9a99('0x6e')](_0x38b194[_0x9a99('0x36')]['id'])?_0x38b194[_0x9a99('0x36')]['id']:null;return db['User']['find']({'where':{'id':_0x164801,'role':{'$or':[_0x9a99('0x34'),'user','agent']}},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0xf5'),_0x9a99('0xf6'),_0x9a99('0x2e'),'internal',_0x9a99('0xa5')]})[_0x9a99('0x1a')](function(_0x36574f){if(_0x36574f){if(_0x36574f[_0x9a99('0x2e')]===_0x9a99('0x2f')){_0xadf8e3=_0x36574f;if(_0x38b194[_0x9a99('0x66')]['interface']){_0x5777a7=util['format']('LOCAL/%s@from-sip/n',_0xadf8e3[_0x38b194[_0x9a99('0x66')][_0x9a99('0xa6')]]);}else if(_0x38b194[_0x9a99('0x66')][_0x9a99('0xf7')]){_0x5777a7=util[_0x9a99('0xb3')]('SIP/%s',_0x38b194[_0x9a99('0x66')]['intrf']);}else{_0x5777a7=util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0xadf8e3[_0x9a99('0x3e')]);}socket['to'](util[_0x9a99('0xb3')]('user:%s',_0xadf8e3[_0x9a99('0x3e')]))[_0x9a99('0x30')]('user:forcelogout',{'user':{'id':_0xadf8e3['id'],'name':_0xadf8e3[_0x9a99('0x3e')]},'ip':_0x38b194[_0x9a99('0xf8')][_0x9a99('0xf9')]||_0x38b194[_0x9a99('0xfa')][_0x9a99('0xfb')]||_0x38b194[_0x9a99('0xfc')][_0x9a99('0xfb')]||_0x38b194['connection'][_0x9a99('0xfc')][_0x9a99('0xfb')]});return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'membername':_0xadf8e3[_0x9a99('0x3e')]},'individualHooks':!![]});}}else{throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xfd'));}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return _0xadf8e3['getVoiceQueues']({'raw':!![]});}})[_0x9a99('0x1a')](function(_0x196acd){if(_0xadf8e3){if(_0x196acd){_0x21de34=_0x196acd;if(_0x21de34[_0x9a99('0x54')]){var _0x190048=_0x21de34[_0x9a99('0x3b')](function(_0x47ef6d){var _0x26bd4b={'membername':_0xadf8e3['name'],'UserId':_0xadf8e3['id'],'queue_name':_0x47ef6d['name'],'VoiceQueueId':_0x47ef6d['id'],'interface':_0x5777a7,'paused':_0xadf8e3[_0x9a99('0xa5')]||![],'penalty':_0x47ef6d[_0x9a99('0xfe')]||0x0};return db[_0x9a99('0xb6')][_0x9a99('0xb7')](_0x26bd4b);});return Promise['all'](_0x190048);}}}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return db['MemberReport'][_0x9a99('0x50')]({'where':{'membername':_0xadf8e3[_0x9a99('0x3e')],'exitAt':null}});}})['then'](function(_0x1cc66b){if(_0xadf8e3){var _0x99d9a6=[];_0x1cc66b[_0x9a99('0xff')](function(_0x115de9){_0x99d9a6[_0x9a99('0x4e')](_0x115de9[_0x9a99('0x2d')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x9a99('0x58')](_0x99d9a6);}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){var _0xec7149=[];var _0xbb9c15=[];var _0x151640=utils[_0x9a99('0x100')]();var _0x5c974b={'membername':_0xadf8e3['name'],'interface':_0x5777a7,'enterAt':moment()['format'](_0x9a99('0x101')),'role':_0xadf8e3[_0x9a99('0x2e')],'internal':_0xadf8e3[_0x9a99('0x6b')]};_0x151640[_0x9a99('0xff')](function(_0x4f2223){_0xec7149[_0x9a99('0x4e')](_[_0x9a99('0x60')]({'channel':_0x4f2223,'type':_0x9a99('0x102'),'data1':_0x38b194[_0x9a99('0x66')]['device'],'data2':_0x5777a7},_0x5c974b));if(_0xadf8e3[_0x9a99('0xa5')]){_0xbb9c15['push'](_[_0x9a99('0x60')]({'channel':_0x4f2223,'type':_0x9a99('0x103'),'data1':_0x9a99('0x104')},_0x5c974b));}});return db[_0x9a99('0x105')][_0x9a99('0x8e')](_0xec7149[_0x9a99('0xd2')](_0xbb9c15),{'individualHooks':!![]});}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return _0xadf8e3[_0x9a99('0x2d')]({'online':!![],'lastLoginAt':moment()['format'](_0x9a99('0x101')),'voicePause':_0xadf8e3[_0x9a99('0xa5')]||![],'mailPause':_0xadf8e3[_0x9a99('0xa5')]||![],'chatPause':_0xadf8e3[_0x9a99('0xa5')]||![],'faxPause':_0xadf8e3[_0x9a99('0xa5')]||![],'smsPause':_0xadf8e3[_0x9a99('0xa5')]||![],'openchannelPause':_0xadf8e3[_0x9a99('0xa5')]||![],'whatsappPause':_0xadf8e3[_0x9a99('0xa5')]||![],'pauseType':_0xadf8e3[_0x9a99('0xa5')]?_0x9a99('0x104'):null,'interface':_0x5777a7,'lastPauseAt':moment()['format'](_0x9a99('0x101'))});}})[_0x9a99('0x1a')](function(_0x3a6a6f){if(_0x38b194['isMiddleware']){return _0x2ded5a();}else{return Promise['resolve'](_0x3a6a6f)[_0x9a99('0x1a')](respondWithResult(_0x36b7e8,null));}})[_0x9a99('0x23')](handleError(_0x36b7e8,null));};exports[_0x9a99('0x106')]=function(_0xf32499,_0x451da0){var _0x128487;return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xf32499[_0x9a99('0x67')]['id'],'role':_0x9a99('0x2f')},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x2e')]})['then'](handleEntityNotFound(_0x451da0,null))[_0x9a99('0x1a')](function(_0x502db8){if(_0x502db8){_0x128487=_0x502db8;return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'membername':_0x128487[_0x9a99('0x3e')]},'individualHooks':!![]});}})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x105')][_0x9a99('0x50')]({'where':{'membername':_0x128487['name'],'exitAt':null}});})[_0x9a99('0x1a')](function(_0x1f4391){var _0x251a29=[];_0x1f4391[_0x9a99('0xff')](function(_0x42f98c){_0x251a29['push'](_0x42f98c['update']({'exitAt':moment()[_0x9a99('0xb3')](_0x9a99('0x101'))}));});return Promise[_0x9a99('0x58')](_0x251a29);})['then'](function(){return _0x128487[_0x9a99('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9a99('0x1a')](respondWithResult(_0x451da0,null))[_0x9a99('0x23')](handleError(_0x451da0,null));};exports['pause']=function(_0x19c968,_0x1cb263){var _0x426094;return db[_0x9a99('0xb6')][_0x9a99('0x2d')]({'paused':0x1},{'where':{'UserId':_0x19c968[_0x9a99('0x67')]['id']},'individualHooks':!![]})[_0x9a99('0x1a')](function(){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x19c968[_0x9a99('0x67')]['id'],'role':_0x9a99('0x2f')},'attributes':['id','name','role',_0x9a99('0x6b'),_0x9a99('0xa6'),_0x9a99('0xb2')]});})[_0x9a99('0x1a')](handleEntityNotFound(_0x1cb263,null))[_0x9a99('0x1a')](function(_0x1e183c){if(_0x1e183c){_0x426094=_0x1e183c;return respondWithRpcPromise(_0x9a99('0x107'),_0x9a99('0x108'),{'id':_0x426094['id'],'name':_0x426094[_0x9a99('0x3e')],'pause':!![]});}})[_0x9a99('0x1a')](function(){if(_0x426094){return db[_0x9a99('0x105')][_0x9a99('0x50')]({'where':{'membername':_0x426094[_0x9a99('0x3e')],'type':_0x9a99('0x103'),'exitAt':null}});}})[_0x9a99('0x1a')](function(_0x10cf24){if(_0x10cf24[_0x9a99('0x54')]){var _0x1dc5c9=moment()[_0x9a99('0xb3')](_0x9a99('0x101'));for(var _0x466754=0x0,_0x20b673=_0x10cf24[_0x9a99('0x54')];_0x466754<_0x20b673;_0x466754++){_0x10cf24[_0x466754][_0x9a99('0x109')]({'exitAt':_0x1dc5c9});}}})[_0x9a99('0x1a')](function(){var _0x166a9f=[];var _0x178373=utils[_0x9a99('0x100')]();_0x178373[_0x9a99('0xff')](function(_0x571871){_0x166a9f['push']({'channel':_0x571871,'membername':_0x426094[_0x9a99('0x3e')],'interface':_['isNil'](_0x426094[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x426094[_0x9a99('0x3e')]):_0x426094[_0x9a99('0xa6')],'type':_0x9a99('0x103'),'enterAt':moment()[_0x9a99('0xb3')](_0x9a99('0x101')),'data1':_0x19c968[_0x9a99('0x66')]['type']||_0x9a99('0x10a'),'role':_0x426094[_0x9a99('0x2e')],'internal':_0x426094[_0x9a99('0x6b')]});});return db[_0x9a99('0x105')][_0x9a99('0x8e')](_0x166a9f,{'individualHooks':!![]});})[_0x9a99('0x1a')](function(){return _0x426094[_0x9a99('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x19c968[_0x9a99('0x66')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x9a99('0x101'))});})[_0x9a99('0x1a')](respondWithResult(_0x1cb263,null))['catch'](handleError(_0x1cb263,null));};exports['unpause']=function(_0x2e5f49,_0x550a29){if(_0x2e5f49[_0x9a99('0x66')]['channel']&&!utils['isValidChannel'](_0x2e5f49[_0x9a99('0x66')][_0x9a99('0xb9')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2e5f49[_0x9a99('0x66')][_0x9a99('0xb9')]));}return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x2e5f49['params']['id']},'attributes':['id','name',_0x9a99('0x2e'),_0x9a99('0x6b'),_0x9a99('0xa6'),_0x9a99('0xb2'),'voicePause','mailPause',_0x9a99('0x10b'),_0x9a99('0x10c'),_0x9a99('0x10d'),_0x9a99('0x10e'),_0x9a99('0x10f'),'pauseType',_0x9a99('0x110')]})['then'](function(_0x5653dd){if(!_0x5653dd){throw new APINotFoundError(util['format'](_0x9a99('0x111'),_0x2e5f49[_0x9a99('0x67')]['id']));}return _0x5653dd[_0x9a99('0x112')](_0x2e5f49[_0x9a99('0x66')]['channel']);})[_0x9a99('0x1a')](respondWithResult(_0x550a29,null))['catch'](APIHandleError(_0x550a29));};exports[_0x9a99('0x113')]=function(_0x4e961c,_0x25804a){var _0x35d757={};var _0x15d787={};var _0x23f0fc;var _0x2c5e55;return db['User']['findOne']({'where':{'id':_0x4e961c[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x25804a,null))[_0x9a99('0x1a')](function(_0x52dd10){if(_0x52dd10){_0x23f0fc=_0x52dd10;_0x15d787['model']=_[_0x9a99('0x5a')](db[_0x9a99('0x114')][_0x9a99('0x5b')]);_0x15d787['query']=_[_0x9a99('0x5a')](_0x4e961c[_0x9a99('0x52')]);_0x15d787['filters']=_[_0x9a99('0x5d')](_0x15d787[_0x9a99('0x5e')],_0x15d787['query']);_0x35d757[_0x9a99('0x4d')]=_['intersection'](_0x15d787[_0x9a99('0x5e')],qs['fields'](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x35d757[_0x9a99('0x4d')]=_0x35d757['attributes']['length']?_0x35d757[_0x9a99('0x4d')]:_0x15d787[_0x9a99('0x5e')];_0x35d757['order']=qs[_0x9a99('0xd5')](_0x4e961c[_0x9a99('0x52')]['sort']);_0x35d757[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x4e961c[_0x9a99('0x52')],_0x15d787[_0x9a99('0x5c')]));if(_0x4e961c[_0x9a99('0x52')][_0x9a99('0x45')]){_0x35d757[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x35d757['where'],{'$or':_[_0x9a99('0x3b')](_0x35d757[_0x9a99('0x4d')],function(_0xfbb0ee){var _0x3193da={};_0x3193da[_0xfbb0ee]={'$like':'%'+_0x4e961c[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x3193da;})});}_0x35d757=_['merge']({},_0x35d757,_0x4e961c[_0x9a99('0xd8')]);return _0x23f0fc[_0x9a99('0x113')](_0x35d757);}})[_0x9a99('0x1a')](function(_0x54ea61){if(_0x54ea61){_0x2c5e55=_0x54ea61[_0x9a99('0x54')];if(!_0x4e961c[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x35d757[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x29')]);_0x35d757[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x23f0fc[_0x9a99('0x113')](_0x35d757);}})[_0x9a99('0x1a')](function(_0x475ec5){if(_0x475ec5){return _0x475ec5?{'count':_0x2c5e55,'rows':_0x475ec5}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x25804a,null))[_0x9a99('0x23')](handleError(_0x25804a,null));};exports[_0x9a99('0x115')]=function(_0x3c4561,_0x238907){var _0x56b0ee=_0x3c4561[_0x9a99('0x67')]['id'];var _0xaa8e20=_0x3c4561[_0x9a99('0x66')]?_0x3c4561[_0x9a99('0x66')]['ids']:null;var _0x5e3a22=[];return Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){if(!_0xaa8e20)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x56b0ee}});})[_0x9a99('0x1a')](function(_0x437961){if(!_0x437961)throw new APINotFoundError(util['format'](_0x9a99('0x111'),_0x3c4561[_0x9a99('0x67')]['id']));return db[_0x9a99('0x70')][_0x9a99('0x117')](function(_0x3bd929){return _0x437961[_0x9a99('0x115')](_0xaa8e20,{'transaction':_0x3bd929})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x114')]['findAll']({'where':{'id':{'$in':_0xaa8e20}}});})[_0x9a99('0x1a')](function(_0x5c2e52){var _0x1a87f9=_[_0x9a99('0x3b')](_0x5c2e52,function(_0x23f690){return _0x23f690[_0x9a99('0x118')]();});return Promise['all'](_0x1a87f9);})[_0x9a99('0x1a')](function(_0x23bc51){_0x5e3a22=_['flattenDeep'](_0x23bc51);var _0x38ed2d=_[_0x9a99('0x3b')](_0x5e3a22,function(_0x3211eb){return _0x3211eb['addAgent'](_0x437961['id'],{'transaction':_0x3bd929});});return Promise['all'](_0x38ed2d);})[_0x9a99('0x1a')](function(){if(!_0x437961[_0x9a99('0xb2')])return;var _0x39641c=_['filter'](_0x5e3a22,function(_0x27ff58){return _0x27ff58[_0x9a99('0x119')](_0x9a99('0xb9'))===_0x9a99('0x11a');});var _0x25712b=_[_0x9a99('0x3b')](_0x39641c,function(_0x43b0e2){return db['UserVoiceQueueRt']['upsert']({'membername':_0x437961[_0x9a99('0x3e')],'UserId':_0x437961['id'],'queue_name':_0x43b0e2[_0x9a99('0x3e')],'VoiceQueueId':_0x43b0e2['id'],'interface':_[_0x9a99('0x6e')](_0x437961[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x437961['name']):_0x437961[_0x9a99('0xa6')],'paused':_0x437961[_0x9a99('0xb5')]||![],'penalty':_0x437961[_0x9a99('0xac')]},{'transaction':_0x3bd929});});return Promise[_0x9a99('0x58')](_0x25712b);})[_0x9a99('0x1a')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0xaa8e20}}});})['then'](function(_0x19d953){var _0x449f2b=_[_0x9a99('0x3b')](_0x19d953,function(_0x2483c0){return db[_0x9a99('0x11b')]['create']({'UserId':_0x437961['id'],'VoicePrefixId':_0x2483c0['VoicePrefixId']},{'transaction':_0x3bd929});});return Promise[_0x9a99('0x58')](_0x449f2b);});});})[_0x9a99('0x1a')](function(){for(var _0x59a679=0x0;_0x59a679<_0x5e3a22[_0x9a99('0x54')];_0x59a679++){var _0x297385=_0x5e3a22[_0x59a679][_0x9a99('0x119')]('channel');var _0x5dd838=_0x297385+_0x9a99('0xae');socket['emit']('user'+_0x297385+_0x9a99('0xaf'),{'UserId':_0x56b0ee,['queueField']:_0x5e3a22[_0x59a679]['id']});}})['then'](respondWithStatusCode(_0x238907,null))[_0x9a99('0x23')](APIHandleError(_0x238907));};exports[_0x9a99('0x11c')]=function(_0x548d67,_0x46110f){var _0x5d8f9e=_0x548d67[_0x9a99('0x67')]['id'];var _0x7b19c2=null;if(_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]){_0x7b19c2=_[_0x9a99('0xbb')](_0x548d67['query'][_0x9a99('0x6a')])?_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]:[_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]];}var _0x9ac584=[];return Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){if(!_0x7b19c2)throw new APIBadRequestError(_0x9a99('0x11d'));})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x5d8f9e}});})[_0x9a99('0x1a')](function(_0x321bb5){if(!_0x321bb5)throw new APINotFoundError(util[_0x9a99('0xb3')](_0x9a99('0x111'),_0x548d67[_0x9a99('0x67')]['id']));return db['sequelize'][_0x9a99('0x117')](function(_0x28e2c7){return _0x321bb5[_0x9a99('0x11c')](_0x7b19c2,{'transaction':_0x28e2c7})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x114')][_0x9a99('0x50')]({'where':{'id':{'$in':_0x7b19c2}}});})[_0x9a99('0x1a')](function(_0x1083aa){var _0x8d5512=_[_0x9a99('0x3b')](_0x1083aa,function(_0x5e741f){return _0x5e741f[_0x9a99('0x118')]();});return Promise['all'](_0x8d5512);})[_0x9a99('0x1a')](function(_0x5ecca3){_0x9ac584=_['flattenDeep'](_0x5ecca3);var _0x4c2118=_[_0x9a99('0x3b')](_0x9ac584,function(_0x157a5b){return _0x157a5b[_0x9a99('0x11e')](_0x321bb5['id'],{'transaction':_0x28e2c7});});return Promise['all'](_0x4c2118);})[_0x9a99('0x1a')](function(){if(!_0x321bb5[_0x9a99('0xb2')])return;var _0x21a680=_['filter'](_0x9ac584,function(_0x1b29ac){return _0x1b29ac[_0x9a99('0x119')](_0x9a99('0xb9'))===_0x9a99('0x11a');});var _0x242bf8=_['map'](_0x21a680,function(_0x4a270c){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4a270c['id'],'UserId':_0x321bb5['id']},'transaction':_0x28e2c7});});return Promise[_0x9a99('0x58')](_0x242bf8);})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x11f')]['findAll']({'where':{'teamId':{'$in':_0x7b19c2}}});})[_0x9a99('0x1a')](function(_0x4b26fb){var _0x438c80=_[_0x9a99('0x3b')](_0x4b26fb,function(_0x3880f3){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x321bb5['id'],'VoicePrefixId':_0x3880f3[_0x9a99('0x120')]}},{'transaction':_0x28e2c7});});return Promise[_0x9a99('0x58')](_0x438c80);});});})[_0x9a99('0x1a')](function(){for(var _0x1fe9ba=0x0;_0x1fe9ba<_0x9ac584[_0x9a99('0x54')];_0x1fe9ba++){var _0x464d3a=_0x9ac584[_0x1fe9ba]['getDataValue']('channel');var _0x48adf0=_0x464d3a+_0x9a99('0xae');socket[_0x9a99('0x30')](_0x9a99('0x36')+_0x464d3a+_0x9a99('0xbc'),{'UserId':_0x5d8f9e,['queueField']:_0x9ac584[_0x1fe9ba]['id']});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x46110f,null))[_0x9a99('0x23')](APIHandleError(_0x46110f));};exports[_0x9a99('0x121')]=function(_0x4edc2b,_0x13e570){var _0x5f5157={};var _0x14db75={};var _0x54b1da;var _0xe37957;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x4edc2b[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x13e570,null))[_0x9a99('0x1a')](function(_0x21a92f){if(_0x21a92f){_0x54b1da=_0x21a92f;_0x14db75[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['CmList'][_0x9a99('0x5b')]);_0x14db75[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x4edc2b[_0x9a99('0x52')]);_0x14db75[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x14db75[_0x9a99('0x5e')],_0x14db75[_0x9a99('0x52')]);_0x5f5157[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x14db75[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5f5157[_0x9a99('0x4d')]=_0x5f5157['attributes']['length']?_0x5f5157[_0x9a99('0x4d')]:_0x14db75[_0x9a99('0x5e')];_0x5f5157[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x4edc2b['query'][_0x9a99('0xd5')]);_0x5f5157[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x4edc2b[_0x9a99('0x52')],_0x14db75[_0x9a99('0x5c')]));if(_0x4edc2b['query']['filter']){_0x5f5157['where']=_[_0x9a99('0x60')](_0x5f5157[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5f5157[_0x9a99('0x4d')],function(_0x3fadba){var _0x1bd986={};_0x1bd986[_0x3fadba]={'$like':'%'+_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x1bd986;})});}_0x5f5157=_['merge']({},_0x5f5157,_0x4edc2b[_0x9a99('0xd8')]);return _0x54b1da[_0x9a99('0x121')](_0x5f5157);}})['then'](function(_0x32f187){if(_0x32f187){_0xe37957=_0x32f187[_0x9a99('0x54')];if(!_0x4edc2b[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x5f5157[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x29')]);_0x5f5157['offset']=qs[_0x9a99('0x28')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x54b1da['getLists'](_0x5f5157);}})['then'](function(_0x105302){if(_0x105302){return _0x105302?{'count':_0xe37957,'rows':_0x105302}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x13e570,null))[_0x9a99('0x23')](handleError(_0x13e570,null));};exports['getAgents']=function(_0x3d9223,_0x2b1e74){var _0x5554b8={};var _0x2b0254={};var _0xe4e17a;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x3d9223['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2b1e74,null))[_0x9a99('0x1a')](function(_0xaa3a3b){if(_0xaa3a3b){_0xe4e17a=_0xaa3a3b;_0x2b0254[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x4f')][_0x9a99('0x5b')]);_0x2b0254[_0x9a99('0x52')]=_['keys'](_0x3d9223[_0x9a99('0x52')]);_0x2b0254['filters']=_[_0x9a99('0x5d')](_0x2b0254[_0x9a99('0x5e')],_0x2b0254[_0x9a99('0x52')]);_0x5554b8[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x2b0254[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x3d9223[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5554b8['attributes']=_0x5554b8['attributes'][_0x9a99('0x54')]?_0x5554b8['attributes']:_0x2b0254['model'];_0x5554b8[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x3d9223[_0x9a99('0x52')]['sort']);_0x5554b8[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x3d9223[_0x9a99('0x52')],_0x2b0254[_0x9a99('0x5c')]));if(_0x3d9223['query'][_0x9a99('0x45')]){_0x5554b8[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5554b8[_0x9a99('0xd6')],{'$or':_['map'](_0x5554b8[_0x9a99('0x4d')],function(_0x1047ad){var _0xc87f31={};_0xc87f31[_0x1047ad]={'$like':'%'+_0x3d9223[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0xc87f31;})});}_0x5554b8['model']=db[_0x9a99('0x4f')];_0x5554b8['as']=_0x9a99('0x37');_0x5554b8=_[_0x9a99('0x60')]({},_0x5554b8,_0x3d9223['options']);return _0xe4e17a['getVoiceQueues']({'include':[_0x5554b8]});}})[_0x9a99('0x1a')](function(_0x19c490){if(_0x19c490){var _0x3b49c9={},_0x207ee0=[];for(var _0x23eff3=0x0;_0x23eff3<_0x19c490['length'];_0x23eff3+=0x1){for(var _0x37c400=0x0,_0x1487ac;_0x37c400<_0x19c490[_0x23eff3][_0x9a99('0x37')][_0x9a99('0x54')];_0x37c400+=0x1){_0x1487ac=_0x19c490[_0x23eff3]['Agents'][_0x37c400][_0x9a99('0x33')]({'plain':!![]});_0x3b49c9[_0x1487ac['id']]=_0x1487ac;}}_0x3b49c9=_[_0x9a99('0x122')](_0x3b49c9);for(var _0x586e4b=qs[_0x9a99('0x28')](_0x3d9223[_0x9a99('0x52')][_0x9a99('0x28')]);_0x586e4b<_0x3b49c9[_0x9a99('0x54')]&&_0x207ee0[_0x9a99('0x54')]=_0x459254[_0xf248('0x49')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xf248('0x1c')](function(){if(_0x1df594){return db[_0xf248('0x23')][_0xf248('0x40')]({'where':{'membername':_0x1df594['name']},'individualHooks':!![]});}})[_0xf248('0x1c')](function(){if(_0x1df594){return _0x1df594[_0xf248('0x4a')]({'raw':!![]});}})[_0xf248('0x1c')](function(_0x4d1a67){if(_0x1df594){if(_0x4d1a67){var _0x4d11a9=[];_0x22ac5c=_0x4d1a67;if(_0x22ac5c[_0xf248('0x26')]){for(var _0x4f9956=0x0;_0x4f9956<_0x22ac5c[_0xf248('0x26')];_0x4f9956++){_0x4d11a9[_0xf248('0x2a')](db[_0xf248('0x23')][_0xf248('0x4b')]({'membername':_0x1df594['name'],'UserId':_0x1df594['id'],'queue_name':_0x22ac5c[_0x4f9956][_0xf248('0x1f')],'VoiceQueueId':_0x22ac5c[_0x4f9956]['id'],'interface':_0x37fbfd,'paused':_0x1df594[_0xf248('0x45')]||![],'penalty':_0x22ac5c[_0x4f9956][_0xf248('0x4c')]||0x0}));}return BPromise['all'](_0x4d11a9);}}}})[_0xf248('0x1c')](function(){if(_0x1df594){return db[_0xf248('0x24')][_0xf248('0xc')]({'where':{'membername':_0x1df594['name'],'exitAt':null}});}})[_0xf248('0x1c')](function(_0x415481){if(_0x1df594){if(_0x415481&&_0x415481[_0xf248('0x26')]){var _0x1353f8=[];_0x415481[_0xf248('0x41')](function(_0x27a10b){_0x1353f8[_0xf248('0x2a')](_0x27a10b[_0xf248('0x31')]({'exitAt':moment()[_0xf248('0x2b')](_0xf248('0x27'))}));});return BPromise[_0xf248('0x42')](_0x1353f8);}}})[_0xf248('0x1c')](function(){if(_0x1df594){var _0x3ff31f=[];var _0x14106e=[];var _0x5941cd=utils['getChannels']();var _0x247dfb={'membername':_0x1df594[_0xf248('0x1f')],'interface':_0x37fbfd,'enterAt':moment()[_0xf248('0x2b')](_0xf248('0x27')),'role':_0x1df594['role'],'internal':_0x1df594[_0xf248('0x21')]};_0x5941cd[_0xf248('0x41')](function(_0x27e26){_0x3ff31f[_0xf248('0x2a')](_['merge']({'channel':_0x27e26,'type':_0xf248('0x4d'),'data1':_0xf248('0x4e'),'data2':_0x37fbfd},_0x247dfb));if(_0x1df594[_0xf248('0x45')]){_0x14106e[_0xf248('0x2a')](_['merge']({'channel':_0x27e26,'type':'PAUSE','data1':'LOGININPAUSE'},_0x247dfb));}});return db[_0xf248('0x24')][_0xf248('0x4f')](_0x3ff31f[_0xf248('0x50')](_0x14106e),{'individualHooks':!![]});}})[_0xf248('0x1c')](function(){if(_0x1df594){return _0x1df594[_0xf248('0x31')]({'online':!![],'lastLoginAt':moment()['format'](_0xf248('0x27')),'voicePause':_0x1df594[_0xf248('0x45')]||![],'mailPause':_0x1df594[_0xf248('0x45')]||![],'chatPause':_0x1df594[_0xf248('0x45')]||![],'faxPause':_0x1df594[_0xf248('0x45')]||![],'smsPause':_0x1df594[_0xf248('0x45')]||![],'openchannelPause':_0x1df594[_0xf248('0x45')]||![],'pauseType':_0x1df594[_0xf248('0x45')]?_0xf248('0x51'):null,'lastPauseAt':moment()['format'](_0xf248('0x27')),'interface':_0x37fbfd});}})[_0xf248('0x1c')](function(_0xd82ff7){_0x5e51fd(_0xd82ff7);})[_0xf248('0x16')](function(_0x4eedd2){_0x2fe928(_0x3483a9[_0xf248('0x18')](0x1f4,_0x4eedd2['message']));});});}; \ No newline at end of file +var _0xfdaf=['User\x20with\x20id\x20%s\x20not\x20found','unpause','destroy','all','LoginUser','mobile','phone','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','callysquare','concat','LOGININPAUSE','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowUser','find','name','format','params','UserVoiceQueueRt','update','MemberReport','length','updateAttributes','forEach','push','isNil','interface','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','type','internal','body','uniqueid','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','role','online','voicePause','mailPause','openchannelPause','smsPause','pauseType'];(function(_0x32cc94,_0x3f60e4){var _0x541a62=function(_0x252377){while(--_0x252377){_0x32cc94['push'](_0x32cc94['shift']());}};_0x541a62(++_0x3f60e4);}(_0xfdaf,0x112));var _0xffda=function(_0x2a6b54,_0x5a167f){_0x2a6b54=_0x2a6b54-0x0;var _0x642aed=_0xfdaf[_0x2a6b54];return _0x642aed;};'use strict';var _=require('lodash');var util=require(_0xffda('0x0'));var moment=require(_0xffda('0x1'));var BPromise=require('bluebird');var Redis=require('ioredis');var db=require(_0xffda('0x2'))['db'];var utils=require(_0xffda('0x3'));var logger=require(_0xffda('0x4'))(_0xffda('0x5'));var config=require(_0xffda('0x6'));config[_0xffda('0x7')]=_[_0xffda('0x8')](config[_0xffda('0x7')],{'host':_0xffda('0x9'),'port':0x18eb});var socket=require(_0xffda('0xa'))(new Redis(config['redis']));require(_0xffda('0xb'))[_0xffda('0xc')](socket);exports[_0xffda('0xd')]=function(_0x5c64a7){var _0x5a97ec=this;return new Promise(function(_0x1653c2,_0x595f6b){return db[_0xffda('0xe')][_0xffda('0xf')]({'raw':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7['options'][_0xffda('0x11')]===undefined?!![]:![]:!![],'where':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7[_0xffda('0x10')][_0xffda('0x12')]||null:null,'attributes':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7[_0xffda('0x10')]['attributes']||null:null,'limit':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7['options'][_0xffda('0x13')]||null:null,'include':_0x5c64a7['options']?_0x5c64a7['options'][_0xffda('0x14')]?_[_0xffda('0x15')](_0x5c64a7[_0xffda('0x10')][_0xffda('0x14')],function(_0x282aa6){return{'model':db[_0x282aa6['model']],'as':_0x282aa6['as'],'attributes':_0x282aa6['attributes'],'include':_0x282aa6['include']?_[_0xffda('0x15')](_0x282aa6[_0xffda('0x14')],function(_0x4a40c8){return{'model':db[_0x4a40c8[_0xffda('0x16')]],'as':_0x4a40c8['as'],'attributes':_0x4a40c8[_0xffda('0x17')],'include':_0x4a40c8[_0xffda('0x14')]?_[_0xffda('0x15')](_0x4a40c8[_0xffda('0x14')],function(_0x4cb6da){return{'model':db[_0x4cb6da[_0xffda('0x16')]],'as':_0x4cb6da['as'],'attributes':_0x4cb6da[_0xffda('0x17')]};}):[]};}):[]};}):[]:[]})[_0xffda('0x18')](function(_0x434a08){logger[_0xffda('0x19')]('GetUser',_0x5c64a7);logger[_0xffda('0x1a')](_0xffda('0xd'),_0x5c64a7,JSON[_0xffda('0x1b')](_0x434a08));_0x1653c2(_0x434a08);})[_0xffda('0x1c')](function(_0x13d95d){logger[_0xffda('0x1d')](_0xffda('0xd'),_0x13d95d[_0xffda('0x1e')],_0x5c64a7);_0x595f6b(_0x5a97ec[_0xffda('0x1d')](0x1f4,_0x13d95d['message']));});});};exports[_0xffda('0x1f')]=function(_0x59dc36){var _0x313563=this;return new Promise(function(_0x4eb183,_0x3abda2){return db[_0xffda('0xe')]['find']({'raw':_0x59dc36[_0xffda('0x10')]?_0x59dc36['options']['raw']===undefined?!![]:![]:!![],'where':_0x59dc36[_0xffda('0x10')]?_0x59dc36[_0xffda('0x10')]['where']||null:null,'attributes':_0x59dc36[_0xffda('0x10')]?_0x59dc36[_0xffda('0x10')][_0xffda('0x17')]||null:null,'include':_0x59dc36['options']?_0x59dc36[_0xffda('0x10')][_0xffda('0x14')]?_[_0xffda('0x15')](_0x59dc36['options']['include'],function(_0x475930){return{'model':db[_0x475930['model']],'as':_0x475930['as'],'attributes':_0x475930['attributes'],'include':_0x475930[_0xffda('0x14')]?_['map'](_0x475930[_0xffda('0x14')],function(_0x2d7956){return{'model':db[_0x2d7956[_0xffda('0x16')]],'as':_0x2d7956['as'],'attributes':_0x2d7956[_0xffda('0x17')],'include':_0x2d7956[_0xffda('0x14')]?_['map'](_0x2d7956[_0xffda('0x14')],function(_0x3b0a50){return{'model':db[_0x3b0a50[_0xffda('0x16')]],'as':_0x3b0a50['as'],'attributes':_0x3b0a50['attributes']};}):[]};}):[]};}):[]:[]})[_0xffda('0x18')](function(_0xdea9f){logger[_0xffda('0x19')](_0xffda('0x1f'),_0x59dc36);logger[_0xffda('0x1a')](_0xffda('0x1f'),_0x59dc36,JSON['stringify'](_0xdea9f));_0x4eb183(_0xdea9f);})[_0xffda('0x1c')](function(_0x1a0499){logger[_0xffda('0x1d')](_0xffda('0x1f'),_0x1a0499[_0xffda('0x1e')],_0x59dc36);_0x3abda2(_0x313563['error'](0x1f4,_0x1a0499[_0xffda('0x1e')]));});});};exports['PauseUser']=function(_0x155e6b){var _0x43e990;return db[_0xffda('0xe')][_0xffda('0x20')]({'where':_0x155e6b[_0xffda('0x10')]['where']||{},'attributes':['id',_0xffda('0x21'),'role','internal','interface']})[_0xffda('0x18')](function(_0x49ee09){if(!_0x49ee09){throw new Error(util[_0xffda('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x155e6b[_0xffda('0x23')]['id']));}_0x43e990=_0x49ee09;return db[_0xffda('0x24')][_0xffda('0x25')]({'paused':0x1},{'where':{'UserId':_0x43e990['id']},'individualHooks':!![]});})[_0xffda('0x18')](function(){return db[_0xffda('0x26')][_0xffda('0xf')]({'where':{'membername':_0x43e990[_0xffda('0x21')],'type':'PAUSE','exitAt':null}});})[_0xffda('0x18')](function(_0x594942){if(_0x594942&&_0x594942[_0xffda('0x27')]){var _0x131584=moment()[_0xffda('0x22')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5e334e=0x0,_0x5bc5af=_0x594942[_0xffda('0x27')];_0x5e334e<_0x5bc5af;_0x5e334e++){_0x594942[_0x5e334e][_0xffda('0x28')]({'exitAt':_0x131584});}}})['then'](function(){var _0x7c19d1=[];var _0x4744e7=utils['getChannels']();_0x4744e7[_0xffda('0x29')](function(_0x4ef4bd){_0x7c19d1[_0xffda('0x2a')]({'channel':_0x4ef4bd,'membername':_0x43e990['name'],'interface':_[_0xffda('0x2b')](_0x43e990[_0xffda('0x2c')])?util['format'](_0xffda('0x2d'),_0x43e990['name']):_0x43e990[_0xffda('0x2c')],'type':_0xffda('0x2e'),'enterAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'data1':_0x155e6b['body'][_0xffda('0x30')]||'DEFAULT\x20PAUSE','role':_0x43e990['role'],'internal':_0x43e990[_0xffda('0x31')],'uniqueid':_0x155e6b[_0xffda('0x32')][_0xffda('0x33')]||null});});return db[_0xffda('0x26')][_0xffda('0x34')](_0x7c19d1,{'individualHooks':!![]});})[_0xffda('0x18')](function(){return _0x43e990[_0xffda('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x155e6b[_0xffda('0x32')][_0xffda('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xffda('0x2f'))});})[_0xffda('0x1c')](function(_0x5a7776){throw _0x5a7776;});};exports[_0xffda('0x35')]=function(_0x15defb){return Promise[_0xffda('0x36')]()[_0xffda('0x18')](function(){if(_0x15defb[_0xffda('0x32')][_0xffda('0x37')]&&!utils[_0xffda('0x38')](_0x15defb[_0xffda('0x32')][_0xffda('0x37')])){throw new Error(util[_0xffda('0x22')](_0xffda('0x39'),_0x15defb[_0xffda('0x32')]['channel']));}return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x15defb[_0xffda('0x10')][_0xffda('0x12')]||{},'attributes':['id','name',_0xffda('0x3b'),_0xffda('0x31'),_0xffda('0x2c'),_0xffda('0x3c'),_0xffda('0x3d'),_0xffda('0x3e'),'chatPause','faxPause',_0xffda('0x3f'),_0xffda('0x40'),'whatsappPause',_0xffda('0x41'),'lastPauseAt']});})[_0xffda('0x18')](function(_0x33b2d5){if(!_0x33b2d5){throw new Error(util[_0xffda('0x22')](_0xffda('0x42'),_0x15defb[_0xffda('0x23')]['id']));}return _0x33b2d5[_0xffda('0x43')](_0x15defb['body'][_0xffda('0x37')],'system');})[_0xffda('0x1c')](function(_0x3fbf71){throw _0x3fbf71;});};exports['LogoutUser']=function(_0x52ea38){var _0x2578db=this;return new Promise(function(_0x4a971a,_0x2f1d23){var _0xdbeba5;return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x52ea38['options']['where']||{},'attributes':['id',_0xffda('0x21')]})[_0xffda('0x18')](function(_0x508b37){if(_0x508b37){_0xdbeba5=_0x508b37;return db['UserVoiceQueueRt'][_0xffda('0x44')]({'where':{'membername':_0xdbeba5[_0xffda('0x21')]},'individualHooks':!![]});}})[_0xffda('0x18')](function(){if(_0xdbeba5){return db[_0xffda('0x26')][_0xffda('0xf')]({'where':{'membername':_0xdbeba5[_0xffda('0x21')],'exitAt':null}});}})[_0xffda('0x18')](function(_0x53bedf){if(_0xdbeba5){if(_0x53bedf&&_0x53bedf[_0xffda('0x27')]){var _0x6ab9a9=[];_0x53bedf[_0xffda('0x29')](function(_0x5ab025){_0x6ab9a9[_0xffda('0x2a')](_0x5ab025[_0xffda('0x25')]({'exitAt':moment()[_0xffda('0x22')](_0xffda('0x2f'))}));});return BPromise[_0xffda('0x45')](_0x6ab9a9);}}})[_0xffda('0x18')](function(){if(_0xdbeba5){return _0xdbeba5[_0xffda('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xffda('0x18')](function(_0x38a697){_0x4a971a(_0x38a697);})[_0xffda('0x1c')](function(_0x3b6911){_0x2f1d23(_0x2578db['error'](0x1f4,_0x3b6911[_0xffda('0x1e')]));});});};exports[_0xffda('0x46')]=function(_0x3d99ac){var _0x4b3716=this;return new Promise(function(_0x880c75,_0x1f6548){var _0x279204;var _0x3491a1;var _0x5b18c9;var _0x3358f9;return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x3d99ac[_0xffda('0x10')][_0xffda('0x12')]||{},'attributes':['id',_0xffda('0x21'),'role',_0xffda('0x47'),_0xffda('0x48'),_0xffda('0x31'),'loginInPause',_0xffda('0x2c')]})[_0xffda('0x18')](function(_0x2eaf71){if(_0x2eaf71){_0x279204=_0x2eaf71;_0x3358f9=_0x3d99ac[_0xffda('0x32')][_0xffda('0x2c')]?_0x3d99ac[_0xffda('0x32')][_0xffda('0x2c')]:util[_0xffda('0x22')](_0xffda('0x2d'),_0x279204[_0xffda('0x21')]);return db[_0xffda('0xe')]['count']({'where':{'role':_0xffda('0x49'),'online':!![],'id':{'$ne':_0x279204['id']}}});}})[_0xffda('0x18')](function(_0x36e174){if(_0x36e174){_0x5b18c9=_0x36e174;return require(_0xffda('0x4a'))['getLicense']();}})['then'](function(_0x57aca0){if(_0x57aca0&&_0x57aca0['agents']&&_0x5b18c9>=_0x57aca0[_0xffda('0x4b')]){throw new Error(_0xffda('0x4c'));}})[_0xffda('0x18')](function(){if(_0x279204){return db[_0xffda('0x24')]['destroy']({'where':{'membername':_0x279204[_0xffda('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x279204){return _0x279204[_0xffda('0x4d')]({'raw':!![]});}})[_0xffda('0x18')](function(_0x3ae588){if(_0x279204){if(_0x3ae588){var _0x5ef9a6=[];_0x3491a1=_0x3ae588;if(_0x3491a1[_0xffda('0x27')]){for(var _0x19ccb3=0x0;_0x19ccb3<_0x3491a1[_0xffda('0x27')];_0x19ccb3++){_0x5ef9a6[_0xffda('0x2a')](db[_0xffda('0x24')][_0xffda('0x4e')]({'membername':_0x279204[_0xffda('0x21')],'UserId':_0x279204['id'],'queue_name':_0x3491a1[_0x19ccb3][_0xffda('0x21')],'VoiceQueueId':_0x3491a1[_0x19ccb3]['id'],'interface':_0x3358f9,'paused':_0x279204[_0xffda('0x4f')]||![],'penalty':_0x3491a1[_0x19ccb3][_0xffda('0x50')]||0x0}));}return BPromise['all'](_0x5ef9a6);}}}})[_0xffda('0x18')](function(){if(_0x279204){return db[_0xffda('0x26')]['findAll']({'where':{'membername':_0x279204[_0xffda('0x21')],'exitAt':null}});}})[_0xffda('0x18')](function(_0x1b1914){if(_0x279204){if(_0x1b1914&&_0x1b1914['length']){var _0x5b740e=[];_0x1b1914['forEach'](function(_0x106385){_0x5b740e[_0xffda('0x2a')](_0x106385[_0xffda('0x25')]({'exitAt':moment()[_0xffda('0x22')](_0xffda('0x2f'))}));});return BPromise[_0xffda('0x45')](_0x5b740e);}}})[_0xffda('0x18')](function(){if(_0x279204){var _0x556d2f=[];var _0xd8fe6=[];var _0x20320c=utils['getChannels']();var _0x139ba2={'membername':_0x279204[_0xffda('0x21')],'interface':_0x3358f9,'enterAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'role':_0x279204[_0xffda('0x3b')],'internal':_0x279204[_0xffda('0x31')]};_0x20320c[_0xffda('0x29')](function(_0x54d2f1){_0x556d2f['push'](_[_0xffda('0x51')]({'channel':_0x54d2f1,'type':'LOGIN','data1':_0xffda('0x52'),'data2':_0x3358f9},_0x139ba2));if(_0x279204[_0xffda('0x4f')]){_0xd8fe6['push'](_[_0xffda('0x51')]({'channel':_0x54d2f1,'type':_0xffda('0x2e'),'data1':'LOGININPAUSE'},_0x139ba2));}});return db[_0xffda('0x26')][_0xffda('0x34')](_0x556d2f[_0xffda('0x53')](_0xd8fe6),{'individualHooks':!![]});}})[_0xffda('0x18')](function(){if(_0x279204){return _0x279204[_0xffda('0x25')]({'online':!![],'lastLoginAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'voicePause':_0x279204[_0xffda('0x4f')]||![],'mailPause':_0x279204['loginInPause']||![],'chatPause':_0x279204[_0xffda('0x4f')]||![],'faxPause':_0x279204['loginInPause']||![],'smsPause':_0x279204[_0xffda('0x4f')]||![],'openchannelPause':_0x279204['loginInPause']||![],'pauseType':_0x279204['loginInPause']?_0xffda('0x54'):null,'lastPauseAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'interface':_0x3358f9});}})[_0xffda('0x18')](function(_0x5908e9){_0x880c75(_0x5908e9);})[_0xffda('0x1c')](function(_0x2df15a){_0x1f6548(_0x4b3716['error'](0x1f4,_0x2df15a['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7d747c2..f026460 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 _0xebac=['save','remove','update','removeListener','register','length','user:','./user.events'];(function(_0x1f7830,_0x10e047){var _0x36cb9b=function(_0x3b4378){while(--_0x3b4378){_0x1f7830['push'](_0x1f7830['shift']());}};_0x36cb9b(++_0x10e047);}(_0xebac,0x177));var _0xceba=function(_0x25c454,_0x190f0d){_0x25c454=_0x25c454-0x0;var _0x955617=_0xebac[_0x25c454];return _0x955617;};'use strict';var UserEvents=require(_0xceba('0x0'));var events=[_0xceba('0x1'),_0xceba('0x2'),_0xceba('0x3')];function createListener(_0x2ff898,_0x305377){return function(_0x2fe86c){_0x305377['emit'](_0x2ff898,_0x2fe86c);};}function removeListener(_0x2a1904,_0x2f6b16){return function(){UserEvents[_0xceba('0x4')](_0x2a1904,_0x2f6b16);};}exports[_0xceba('0x5')]=function(_0x29a860){for(var _0x1ed17b=0x0,_0x420bd0=events[_0xceba('0x6')];_0x1ed17b<_0x420bd0;_0x1ed17b++){var _0x18023b=events[_0x1ed17b];var _0x56003c=createListener(_0xceba('0x7')+_0x18023b,_0x29a860);UserEvents['on'](_0x18023b,_0x56003c);}}; \ No newline at end of file +var _0x9f52=['emit','register','length','user:','./user.events','save','remove','update'];(function(_0x40ec09,_0x50ebbb){var _0x519192=function(_0x1b4ef7){while(--_0x1b4ef7){_0x40ec09['push'](_0x40ec09['shift']());}};_0x519192(++_0x50ebbb);}(_0x9f52,0x134));var _0x29f5=function(_0x26941c,_0x34162a){_0x26941c=_0x26941c-0x0;var _0x2fcfc3=_0x9f52[_0x26941c];return _0x2fcfc3;};'use strict';var UserEvents=require(_0x29f5('0x0'));var events=[_0x29f5('0x1'),_0x29f5('0x2'),_0x29f5('0x3')];function createListener(_0x559d52,_0x59fc63){return function(_0x9cac3f){_0x59fc63[_0x29f5('0x4')](_0x559d52,_0x9cac3f);};}function removeListener(_0x1b5fe3,_0x2562cf){return function(){UserEvents['removeListener'](_0x1b5fe3,_0x2562cf);};}exports[_0x29f5('0x5')]=function(_0x170dd9){for(var _0x54abbc=0x0,_0x46adf3=events[_0x29f5('0x6')];_0x54abbc<_0x46adf3;_0x54abbc++){var _0x55a66a=events[_0x54abbc];var _0x6f3379=createListener(_0x29f5('0x7')+_0x55a66a,_0x170dd9);UserEvents['on'](_0x55a66a,_0x6f3379);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 2767946..78d96e9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x416f4e,_0x46a4b1){var _0x230028=function(_0x5a17ea){while(--_0x5a17ea){_0x416f4e['push'](_0x416f4e['shift']());}};_0x230028(++_0x46a4b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5da6ae,_0x530614){var _0x2ca91b=function(_0x5ec14c){while(--_0x5ec14c){_0x5da6ae['push'](_0x5da6ae['shift']());}};_0x2ca91b(++_0x530614);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index dbe3b1b..0fe0fd1 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 _0x6bc1=['exports','INTEGER','sequelize'];(function(_0x282ee0,_0x427511){var _0x41a513=function(_0x470f6c){while(--_0x470f6c){_0x282ee0['push'](_0x282ee0['shift']());}};_0x41a513(++_0x427511);}(_0x6bc1,0x12b));var _0x16bc=function(_0x4464be,_0x1ded1c){_0x4464be=_0x4464be-0x0;var _0x51c2d6=_0x6bc1[_0x4464be];return _0x51c2d6;};'use strict';var Sequelize=require(_0x16bc('0x0'));module[_0x16bc('0x1')]={'penalty':{'type':Sequelize[_0x16bc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2e6=['INTEGER','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2e6,0x195));var _0x6d2e=function(_0x5da949,_0x1b37ac){_0x5da949=_0x5da949-0x0;var _0x16d6de=_0xd2e6[_0x5da949];return _0x16d6de;};'use strict';var Sequelize=require(_0x6d2e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6d2e('0x1')],'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 cbb4e81..4867c2d 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 _0x961b=['bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','user_has_chat_queues'];(function(_0x280604,_0x528d29){var _0x1f659b=function(_0x3f6ae2){while(--_0x3f6ae2){_0x280604['push'](_0x280604['shift']());}};_0x1f659b(++_0x528d29);}(_0x961b,0x9a));var _0xb961=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x961b[_0x2f3848];return _0x102668;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb961('0x0'));var rp=require(_0xb961('0x1'));var fs=require('fs');var path=require(_0xb961('0x2'));var rimraf=require(_0xb961('0x3'));var config=require(_0xb961('0x4'));var attributes=require(_0xb961('0x5'));module['exports']=function(_0x8481c7,_0x5235c7){return _0x8481c7['define']('UserChatQueue',attributes,{'tableName':_0xb961('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2360=['../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2c24df,_0x2e46a3){var _0x309b15=function(_0x5d525b){while(--_0x5d525b){_0x2c24df['push'](_0x2c24df['shift']());}};_0x309b15(++_0x2e46a3);}(_0x2360,0xad));var _0x0236=function(_0x4ce2b0,_0xcd1337){_0x4ce2b0=_0x4ce2b0-0x0;var _0x2a059f=_0x2360[_0x4ce2b0];return _0x2a059f;};'use strict';var _=require(_0x0236('0x0'));var util=require(_0x0236('0x1'));var logger=require(_0x0236('0x2'))(_0x0236('0x3'));var moment=require(_0x0236('0x4'));var BPromise=require(_0x0236('0x5'));var rp=require(_0x0236('0x6'));var fs=require('fs');var path=require(_0x0236('0x7'));var rimraf=require(_0x0236('0x8'));var config=require(_0x0236('0x9'));var attributes=require('./userChatQueue.attributes');module[_0x0236('0xa')]=function(_0x42f1e9,_0x189587){return _0x42f1e9[_0x0236('0xb')](_0x0236('0xc'),attributes,{'tableName':_0x0236('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 5d7d2ea..6dcba2d 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 _0xf7df=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x46fb48,_0x3b6c59){var _0x1e3f78=function(_0x61c01c){while(--_0x61c01c){_0x46fb48['push'](_0x46fb48['shift']());}};_0x1e3f78(++_0x3b6c59);}(_0xf7df,0x157));var _0xff7d=function(_0x1cb1d0,_0x176142){_0x1cb1d0=_0x1cb1d0-0x0;var _0x58b217=_0xf7df[_0x1cb1d0];return _0x58b217;};'use strict';var _=require('lodash');var util=require(_0xff7d('0x0'));var moment=require(_0xff7d('0x1'));var BPromise=require(_0xff7d('0x2'));var rs=require(_0xff7d('0x3'));var fs=require('fs');var Redis=require(_0xff7d('0x4'));var db=require(_0xff7d('0x5'))['db'];var utils=require(_0xff7d('0x6'));var logger=require(_0xff7d('0x7'))(_0xff7d('0x8'));var config=require(_0xff7d('0x9'));var jayson=require(_0xff7d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5afc,_0x21f4ef,_0x1e4bba){return new BPromise(function(_0x138090,_0x1c8404){return client[_0xff7d('0xb')](_0x1e5afc,_0x1e4bba)['then'](function(_0xb836c9){logger[_0xff7d('0xc')](_0xff7d('0xd'),_0x21f4ef,_0xff7d('0xe'));logger[_0xff7d('0xf')](_0xff7d('0x10'),_0x21f4ef,'request\x20sent',JSON[_0xff7d('0x11')](_0xb836c9));if(_0xb836c9[_0xff7d('0x12')]){if(_0xb836c9[_0xff7d('0x12')]['code']===0x1f4){logger[_0xff7d('0x12')](_0xff7d('0xd'),_0x21f4ef,_0xb836c9['error'][_0xff7d('0x13')]);return _0x1c8404(_0xb836c9[_0xff7d('0x12')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x21f4ef,_0xb836c9[_0xff7d('0x12')][_0xff7d('0x13')]);return _0x138090(_0xb836c9[_0xff7d('0x12')][_0xff7d('0x13')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x21f4ef,_0xff7d('0xe'));_0x138090(_0xb836c9['result'][_0xff7d('0x13')]);}})[_0xff7d('0x14')](function(_0x41fa3f){logger['error'](_0xff7d('0xd'),_0x21f4ef,_0x41fa3f);_0x1c8404(_0x41fa3f);});});} \ No newline at end of file +var _0xfbeb=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xfbeb,0x118));var _0xbfbe=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0xfbeb[_0x36f641];return _0x39b299;};'use strict';var _=require('lodash');var util=require(_0xbfbe('0x0'));var moment=require(_0xbfbe('0x1'));var BPromise=require(_0xbfbe('0x2'));var rs=require(_0xbfbe('0x3'));var fs=require('fs');var Redis=require(_0xbfbe('0x4'));var db=require(_0xbfbe('0x5'))['db'];var utils=require(_0xbfbe('0x6'));var logger=require(_0xbfbe('0x7'))(_0xbfbe('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfbe('0x9'));var client=jayson[_0xbfbe('0xa')][_0xbfbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59fd34,_0x40ec4e,_0x1d6bea){return new BPromise(function(_0x4cb386,_0x2e3ce5){return client[_0xbfbe('0xc')](_0x59fd34,_0x1d6bea)['then'](function(_0x3f49a6){logger[_0xbfbe('0xd')](_0xbfbe('0xe'),_0x40ec4e,_0xbfbe('0xf'));logger[_0xbfbe('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x40ec4e,'request\x20sent',JSON[_0xbfbe('0x11')](_0x3f49a6));if(_0x3f49a6[_0xbfbe('0x12')]){if(_0x3f49a6[_0xbfbe('0x12')]['code']===0x1f4){logger['error'](_0xbfbe('0xe'),_0x40ec4e,_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);return _0x2e3ce5(_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);}logger[_0xbfbe('0x12')](_0xbfbe('0xe'),_0x40ec4e,_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);return _0x4cb386(_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);}else{logger[_0xbfbe('0xd')](_0xbfbe('0xe'),_0x40ec4e,_0xbfbe('0xf'));_0x4cb386(_0x3f49a6[_0xbfbe('0x14')][_0xbfbe('0x13')]);}})['catch'](function(_0x5e19ba){logger[_0xbfbe('0x12')](_0xbfbe('0xe'),_0x40ec4e,_0x5e19ba);_0x2e3ce5(_0x5e19ba);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2091080..3f49711 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x246aa2,_0x25ff04){var _0x33d695=function(_0x3ca1fd){while(--_0x3ca1fd){_0x246aa2['push'](_0x246aa2['shift']());}};_0x33d695(++_0x25ff04);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x109f15,_0x1cc0dc){var _0x34f08e=function(_0x42c683){while(--_0x42c683){_0x109f15['push'](_0x109f15['shift']());}};_0x34f08e(++_0x1cc0dc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xcb91[_0x4b91c4];return _0x25cb80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 8b596ce..2c8e07b 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 _0x2d58=['exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d58,0x1ce));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x82d5('0x0')]={'penalty':{'type':Sequelize[_0x82d5('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x82d5('0x2')]}}; \ No newline at end of file +var _0x8428=['sequelize','exports','INTEGER','STRING'];(function(_0x58d98a,_0x3040c3){var _0x4274ba=function(_0x3573db){while(--_0x3573db){_0x58d98a['push'](_0x58d98a['shift']());}};_0x4274ba(++_0x3040c3);}(_0x8428,0xcc));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8842('0x0'));module[_0x8842('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8842('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8842('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index ae0b87d..e73d184 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 _0x9221=['../../config/environment','UserFaxQueue','user_has_fax_queues','lodash','api','request-promise','path'];(function(_0x17fc3d,_0x2d35d5){var _0x4e83e8=function(_0x532cd2){while(--_0x532cd2){_0x17fc3d['push'](_0x17fc3d['shift']());}};_0x4e83e8(++_0x2d35d5);}(_0x9221,0x88));var _0x1922=function(_0x307cec,_0x1cf922){_0x307cec=_0x307cec-0x0;var _0x285c73=_0x9221[_0x307cec];return _0x285c73;};'use strict';var _=require(_0x1922('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1922('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1922('0x2'));var fs=require('fs');var path=require(_0x1922('0x3'));var rimraf=require('rimraf');var config=require(_0x1922('0x4'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x2e24f0,_0x25b672){return _0x2e24f0['define'](_0x1922('0x5'),attributes,{'tableName':_0x1922('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b85=['../../config/logger','moment','bluebird','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','util'];(function(_0x21b57f,_0x9ba5fb){var _0x3dac6f=function(_0x449042){while(--_0x449042){_0x21b57f['push'](_0x21b57f['shift']());}};_0x3dac6f(++_0x9ba5fb);}(_0x1b85,0x143));var _0x51b8=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x1b85[_0x2a0824];return _0x1a78f7;};'use strict';var _=require('lodash');var util=require(_0x51b8('0x0'));var logger=require(_0x51b8('0x1'))('api');var moment=require(_0x51b8('0x2'));var BPromise=require(_0x51b8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51b8('0x4'));var rimraf=require('rimraf');var config=require(_0x51b8('0x5'));var attributes=require(_0x51b8('0x6'));module['exports']=function(_0x2efbc6,_0x16ce26){return _0x2efbc6[_0x51b8('0x7')](_0x51b8('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index ba36a86..d768098 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 _0xba57=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x33c2af,_0x163198){var _0x13c04a=function(_0x4de68e){while(--_0x4de68e){_0x33c2af['push'](_0x33c2af['shift']());}};_0x13c04a(++_0x163198);}(_0xba57,0xf6));var _0x7ba5=function(_0xcee4e9,_0x17956b){_0xcee4e9=_0xcee4e9-0x0;var _0x4a04b3=_0xba57[_0xcee4e9];return _0x4a04b3;};'use strict';var _=require(_0x7ba5('0x0'));var util=require(_0x7ba5('0x1'));var moment=require('moment');var BPromise=require(_0x7ba5('0x2'));var rs=require(_0x7ba5('0x3'));var fs=require('fs');var Redis=require(_0x7ba5('0x4'));var db=require(_0x7ba5('0x5'))['db'];var utils=require(_0x7ba5('0x6'));var logger=require(_0x7ba5('0x7'))(_0x7ba5('0x8'));var config=require(_0x7ba5('0x9'));var jayson=require(_0x7ba5('0xa'));var client=jayson[_0x7ba5('0xb')][_0x7ba5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39a1cd,_0x2ad152,_0x44b33e){return new BPromise(function(_0x5acdbc,_0x33ffa8){return client[_0x7ba5('0xd')](_0x39a1cd,_0x44b33e)['then'](function(_0x159e10){logger[_0x7ba5('0xe')](_0x7ba5('0xf'),_0x2ad152,_0x7ba5('0x10'));logger[_0x7ba5('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2ad152,_0x7ba5('0x10'),JSON['stringify'](_0x159e10));if(_0x159e10['error']){if(_0x159e10['error']['code']===0x1f4){logger['error'](_0x7ba5('0xf'),_0x2ad152,_0x159e10[_0x7ba5('0x12')][_0x7ba5('0x13')]);return _0x33ffa8(_0x159e10['error'][_0x7ba5('0x13')]);}logger[_0x7ba5('0x12')](_0x7ba5('0xf'),_0x2ad152,_0x159e10[_0x7ba5('0x12')][_0x7ba5('0x13')]);return _0x5acdbc(_0x159e10[_0x7ba5('0x12')][_0x7ba5('0x13')]);}else{logger[_0x7ba5('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x2ad152,_0x7ba5('0x10'));_0x5acdbc(_0x159e10['result']['message']);}})[_0x7ba5('0x14')](function(_0x11426a){logger[_0x7ba5('0x12')](_0x7ba5('0xf'),_0x2ad152,_0x11426a);_0x33ffa8(_0x11426a);});});} \ No newline at end of file +var _0x9a02=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x9a02,0x7b));var _0x29a0=function(_0x2c7659,_0x24fa6a){_0x2c7659=_0x2c7659-0x0;var _0x2c7fb=_0x9a02[_0x2c7659];return _0x2c7fb;};'use strict';var _=require(_0x29a0('0x0'));var util=require(_0x29a0('0x1'));var moment=require(_0x29a0('0x2'));var BPromise=require(_0x29a0('0x3'));var rs=require(_0x29a0('0x4'));var fs=require('fs');var Redis=require(_0x29a0('0x5'));var db=require(_0x29a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x29a0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29a0('0x8'));var client=jayson[_0x29a0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x384402,_0x428da1,_0x43431d){return new BPromise(function(_0x265a1c,_0x1c1ed2){return client[_0x29a0('0xa')](_0x384402,_0x43431d)[_0x29a0('0xb')](function(_0xfb317c){logger[_0x29a0('0xc')](_0x29a0('0xd'),_0x428da1,'request\x20sent');logger[_0x29a0('0xe')](_0x29a0('0xf'),_0x428da1,'request\x20sent',JSON[_0x29a0('0x10')](_0xfb317c));if(_0xfb317c[_0x29a0('0x11')]){if(_0xfb317c[_0x29a0('0x11')][_0x29a0('0x12')]===0x1f4){logger[_0x29a0('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x428da1,_0xfb317c[_0x29a0('0x11')][_0x29a0('0x13')]);return _0x1c1ed2(_0xfb317c['error'][_0x29a0('0x13')]);}logger[_0x29a0('0x11')](_0x29a0('0xd'),_0x428da1,_0xfb317c[_0x29a0('0x11')]['message']);return _0x265a1c(_0xfb317c['error']['message']);}else{logger[_0x29a0('0xc')](_0x29a0('0xd'),_0x428da1,'request\x20sent');_0x265a1c(_0xfb317c[_0x29a0('0x14')]['message']);}})['catch'](function(_0x124f1c){logger['error'](_0x29a0('0xd'),_0x428da1,_0x124f1c);_0x1c1ed2(_0x124f1c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 0c9a2a7..dc257b4 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x38f92c,_0x51019c){var _0x28c9d5=function(_0x514d76){while(--_0x514d76){_0x38f92c['push'](_0x38f92c['shift']());}};_0x28c9d5(++_0x51019c);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x573dbd,_0x17cc62){var _0xb58003=function(_0x214e5c){while(--_0x214e5c){_0x573dbd['push'](_0x573dbd['shift']());}};_0xb58003(++_0x17cc62);}(_0xe706,0xa3));var _0x6e70=function(_0x236e77,_0x388743){_0x236e77=_0x236e77-0x0;var _0x59e31f=_0xe706[_0x236e77];return _0x59e31f;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ee0d0fe..4b47b89 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 _0xc2ad=['sequelize','exports','INTEGER'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0xc2ad,0x1a7));var _0xdc2a=function(_0x359737,_0xe7f6c4){_0x359737=_0x359737-0x0;var _0x5aad9f=_0xc2ad[_0x359737];return _0x5aad9f;};'use strict';var Sequelize=require(_0xdc2a('0x0'));module[_0xdc2a('0x1')]={'penalty':{'type':Sequelize[_0xdc2a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdffe=['exports'];(function(_0x55aae7,_0x3862e4){var _0x3172e0=function(_0x1c8cc6){while(--_0x1c8cc6){_0x55aae7['push'](_0x55aae7['shift']());}};_0x3172e0(++_0x3862e4);}(_0xdffe,0x1d2));var _0xedff=function(_0x506f64,_0x395f5a){_0x506f64=_0x506f64-0x0;var _0x389fdb=_0xdffe[_0x506f64];return _0x389fdb;};'use strict';var Sequelize=require('sequelize');module[_0xedff('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 0054b7a..98f36e4 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 _0xf240=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x452f5b,_0x5389d1){var _0x33e5e2=function(_0x34b282){while(--_0x34b282){_0x452f5b['push'](_0x452f5b['shift']());}};_0x33e5e2(++_0x5389d1);}(_0xf240,0x14c));var _0x0f24=function(_0x38a6f3,_0x54f77a){_0x38a6f3=_0x38a6f3-0x0;var _0x508b77=_0xf240[_0x38a6f3];return _0x508b77;};'use strict';var _=require(_0x0f24('0x0'));var util=require(_0x0f24('0x1'));var logger=require(_0x0f24('0x2'))(_0x0f24('0x3'));var moment=require(_0x0f24('0x4'));var BPromise=require(_0x0f24('0x5'));var rp=require(_0x0f24('0x6'));var fs=require('fs');var path=require(_0x0f24('0x7'));var rimraf=require(_0x0f24('0x8'));var config=require(_0x0f24('0x9'));var attributes=require(_0x0f24('0xa'));module[_0x0f24('0xb')]=function(_0x25c609,_0x57a664){return _0x25c609[_0x0f24('0xc')]('UserMailQueue',attributes,{'tableName':_0x0f24('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe0a=['moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','api'];(function(_0x484ad6,_0x4efaee){var _0x4950d0=function(_0x11afec){while(--_0x11afec){_0x484ad6['push'](_0x484ad6['shift']());}};_0x4950d0(++_0x4efaee);}(_0xbe0a,0x105));var _0xabe0=function(_0x22530e,_0x2c4b1e){_0x22530e=_0x22530e-0x0;var _0x5b94dc=_0xbe0a[_0x22530e];return _0x5b94dc;};'use strict';var _=require(_0xabe0('0x0'));var util=require(_0xabe0('0x1'));var logger=require('../../config/logger')(_0xabe0('0x2'));var moment=require(_0xabe0('0x3'));var BPromise=require('bluebird');var rp=require(_0xabe0('0x4'));var fs=require('fs');var path=require(_0xabe0('0x5'));var rimraf=require(_0xabe0('0x6'));var config=require(_0xabe0('0x7'));var attributes=require(_0xabe0('0x8'));module[_0xabe0('0x9')]=function(_0x46b889,_0x4bb74e){return _0x46b889['define'](_0xabe0('0xa'),attributes,{'tableName':_0xabe0('0xb'),'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 9a68b32..dd8a6f0 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x479382,_0x1aa193){var _0x3e0a14=function(_0x11a0af){while(--_0x11a0af){_0x479382['push'](_0x479382['shift']());}};_0x3e0a14(++_0x1aa193);}(_0x3e74,0x175));var _0x43e7=function(_0x206177,_0x28390e){_0x206177=_0x206177-0x0;var _0x18e494=_0x3e74[_0x206177];return _0x18e494;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b1cab,_0x5e5ce7){var _0x140f08=function(_0x137915){while(--_0x137915){_0x3b1cab['push'](_0x3b1cab['shift']());}};_0x140f08(++_0x5e5ce7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index 58df671..cd93acb 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63ad=['../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1931e5,_0x652323){var _0x1f88fc=function(_0x391e86){while(--_0x391e86){_0x1931e5['push'](_0x1931e5['shift']());}};_0x1f88fc(++_0x652323);}(_0x63ad,0xf5));var _0xd63a=function(_0x19f597,_0x53111a){_0x19f597=_0x19f597-0x0;var _0x580869=_0x63ad[_0x19f597];return _0x580869;};'use strict';var multer=require('multer');var util=require(_0xd63a('0x0'));var path=require(_0xd63a('0x1'));var timeout=require('connect-timeout');var express=require(_0xd63a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd63a('0x3'));var interaction=require(_0xd63a('0x4'));var config=require(_0xd63a('0x5'));var controller=require(_0xd63a('0x6'));router['post']('/',auth[_0xd63a('0x7')](),controller[_0xd63a('0x8')]);module[_0xd63a('0x9')]=router; \ No newline at end of file +var _0xf395=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x1bafe3,_0x2a22aa){var _0x15c0d3=function(_0x548bda){while(--_0x548bda){_0x1bafe3['push'](_0x1bafe3['shift']());}};_0x15c0d3(++_0x2a22aa);}(_0xf395,0xa7));var _0x5f39=function(_0x2b69d3,_0x4d7ace){_0x2b69d3=_0x2b69d3-0x0;var _0x10e7ad=_0xf395[_0x2b69d3];return _0x10e7ad;};'use strict';var multer=require(_0x5f39('0x0'));var util=require(_0x5f39('0x1'));var path=require('path');var timeout=require(_0x5f39('0x2'));var express=require('express');var router=express[_0x5f39('0x3')]();var fs_extra=require(_0x5f39('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f39('0x5'));var config=require(_0x5f39('0x6'));var controller=require(_0x5f39('0x7'));router[_0x5f39('0x8')]('/',auth[_0x5f39('0x9')](),controller[_0x5f39('0xa')]);module[_0x5f39('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 36f25ab..87edfe3 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8eaf=['TEXT','STRING','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8eaf,0x1b2));var _0xf8ea=function(_0x29ccfc,_0x311422){_0x29ccfc=_0x29ccfc-0x0;var _0x4f919b=_0x8eaf[_0x29ccfc];return _0x4f919b;};'use strict';var Sequelize=require(_0xf8ea('0x0'));module[_0xf8ea('0x1')]={'body':{'type':Sequelize[_0xf8ea('0x2')]},'senderName':{'type':Sequelize[_0xf8ea('0x3')]},'recipientsId':{'type':Sequelize[_0xf8ea('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf8ea('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x4ad9=['STRING','exports','TEXT'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x4ad9,0x1c9));var _0x94ad=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4ad9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x94ad('0x0')]={'body':{'type':Sequelize[_0x94ad('0x1')]},'senderName':{'type':Sequelize[_0x94ad('0x2')]},'recipientsId':{'type':Sequelize[_0x94ad('0x1')]},'recipientsDescription':{'type':Sequelize[_0x94ad('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 9fd07c4..c9c6ca2 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d4b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sequelize','create','recipient','emit','userNotification:send','catch','Template','findOne','html','render','forEach','User','union','ids','includes','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x59c683,_0x209444){var _0x47251b=function(_0x4db046){while(--_0x4db046){_0x59c683['push'](_0x59c683['shift']());}};_0x47251b(++_0x209444);}(_0x7d4b,0x120));var _0xb7d4=function(_0x25b8cc,_0xe667ec){_0x25b8cc=_0x25b8cc-0x0;var _0x94a85e=_0x7d4b[_0x25b8cc];return _0x94a85e;};'use strict';var emlformat=require(_0xb7d4('0x0'));var rimraf=require(_0xb7d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7d4('0x2'));var rp=require(_0xb7d4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb7d4('0x4'));var util=require(_0xb7d4('0x5'));var path=require(_0xb7d4('0x6'));var sox=require(_0xb7d4('0x7'));var csv=require('to-csv');var ejs=require(_0xb7d4('0x8'));var fs=require('fs');var fs_extra=require(_0xb7d4('0x9'));var _=require(_0xb7d4('0xa'));var squel=require(_0xb7d4('0xb'));var crypto=require(_0xb7d4('0xc'));var jsforce=require(_0xb7d4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb7d4('0xf'));var authService=require(_0xb7d4('0x10'));var qs=require(_0xb7d4('0x11'));var as=require(_0xb7d4('0x12'));var hardwareService=require(_0xb7d4('0x13'));var logger=require(_0xb7d4('0x14'))(_0xb7d4('0x15'));var utils=require(_0xb7d4('0x16'));var config=require(_0xb7d4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7d4('0x18'))['db'];config[_0xb7d4('0x19')]=_['defaults'](config['redis'],{'host':_0xb7d4('0x1a'),'port':0x18eb});var socket=require(_0xb7d4('0x1b'))(new Redis(config[_0xb7d4('0x19')]));require(_0xb7d4('0x1c'))[_0xb7d4('0x1d')](socket);function respondWithStatusCode(_0xe10546,_0x5efb51){_0x5efb51=_0x5efb51||0xcc;return function(_0x3e6d90){if(_0x3e6d90){return _0xe10546[_0xb7d4('0x1e')](_0x5efb51);}return _0xe10546[_0xb7d4('0x1f')](_0x5efb51)[_0xb7d4('0x20')]();};}function respondWithResult(_0x4b14e8,_0x28267c){_0x28267c=_0x28267c||0xc8;return function(_0x30557a){if(_0x30557a){return _0x4b14e8[_0xb7d4('0x1f')](_0x28267c)[_0xb7d4('0x21')](_0x30557a);}};}function respondWithFilteredResult(_0x26dc3c,_0x805fe3){return function(_0x29f4e6){if(_0x29f4e6){var _0x189d84=typeof _0x805fe3[_0xb7d4('0x22')]===_0xb7d4('0x23')&&typeof _0x805fe3[_0xb7d4('0x24')]===_0xb7d4('0x23');var _0x30d092=_0x29f4e6['count'];var _0x5d4dd0=_0x189d84?0x0:_0x805fe3[_0xb7d4('0x22')];var _0x5b5cc5=_0x189d84?_0x29f4e6[_0xb7d4('0x25')]:_0x805fe3[_0xb7d4('0x22')]+_0x805fe3[_0xb7d4('0x24')];var _0x413d48;if(_0x5b5cc5>=_0x30d092){_0x5b5cc5=_0x30d092;_0x413d48=0xc8;}else{_0x413d48=0xce;}_0x26dc3c['status'](_0x413d48);return _0x26dc3c[_0xb7d4('0x26')]('Content-Range',_0x5d4dd0+'-'+_0x5b5cc5+'/'+_0x30d092)[_0xb7d4('0x21')](_0x29f4e6);}return null;};}function patchUpdates(_0x46ce1a){return function(_0x3ed018){try{jsonpatch['apply'](_0x3ed018,_0x46ce1a,!![]);}catch(_0xe97a11){return BPromise[_0xb7d4('0x27')](_0xe97a11);}return _0x3ed018[_0xb7d4('0x28')]();};}function saveUpdates(_0x4d163c,_0x1a21fb){return function(_0x40737e){if(_0x40737e){return _0x40737e[_0xb7d4('0x29')](_0x4d163c)['then'](function(_0x5dd864){return _0x5dd864;});}return null;};}function removeEntity(_0x4d2d8a,_0x25b5af){return function(_0x51578a){if(_0x51578a){return _0x51578a[_0xb7d4('0x2a')]()[_0xb7d4('0x2b')](function(){_0x4d2d8a['status'](0xcc)[_0xb7d4('0x20')]();});}};}function handleEntityNotFound(_0x1a5505,_0x1a8082){return function(_0x1ca33e){if(!_0x1ca33e){_0x1a5505[_0xb7d4('0x1e')](0x194);}return _0x1ca33e;};}function handleError(_0x402b69,_0x5c6862){_0x5c6862=_0x5c6862||0x1f4;return function(_0x2d6360){logger[_0xb7d4('0x2c')](_0x2d6360[_0xb7d4('0x2d')]);if(_0x2d6360[_0xb7d4('0x2e')]){delete _0x2d6360['name'];}_0x402b69[_0xb7d4('0x1f')](_0x5c6862)[_0xb7d4('0x2f')](_0x2d6360);};}exports[_0xb7d4('0x30')]=function(_0x3f0bd0,_0x16a4b8,_0xdf8c5c){if(!_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x32')](_0xb7d4('0x33'))&&!_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x32')]('TemplateId')){throw new db['Sequelize'][(_0xb7d4('0x34'))](_0xb7d4('0x35'));}else{if(_0x3f0bd0[_0xb7d4('0x31')]['hasOwnProperty'](_0xb7d4('0x36'))&&!_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x32')](_0xb7d4('0x37'))){throw new db[(_0xb7d4('0x38'))][(_0xb7d4('0x34'))](_0xb7d4('0x39'));}if(!_0x3f0bd0[_0xb7d4('0x31')]['hasOwnProperty'](_0xb7d4('0x3a'))){throw new db[(_0xb7d4('0x38'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5805b7=JSON[_0xb7d4('0x3b')](_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x3a')]);}catch(_0x419676){logger[_0xb7d4('0x2c')](_0x419676);throw new db[(_0xb7d4('0x38'))][(_0xb7d4('0x34'))](_0xb7d4('0x3c'));}var _0x245202=['chatqueue',_0xb7d4('0x3d'),_0xb7d4('0x3e'),_0xb7d4('0x3f'),_0xb7d4('0x40'),_0xb7d4('0x41'),_0xb7d4('0x42'),_0xb7d4('0x43'),_0xb7d4('0x44')];if(_[_0xb7d4('0x45')](_0x5805b7,function(_0x13db91){return!_['includes'](_0x245202,_0x13db91[_0xb7d4('0x46')][_0xb7d4('0x47')]());})){throw new db['Sequelize'][(_0xb7d4('0x34'))](_0xb7d4('0x48'));}}}var _0x4f2781={};_0x4f2781[_0xb7d4('0x49')]=_0x3f0bd0['body'][_0xb7d4('0x32')](_0xb7d4('0x49'))?_0x3f0bd0[_0xb7d4('0x31')]['senderName']:_0x3f0bd0['user'][_0xb7d4('0x4a')];_0x4f2781[_0xb7d4('0x4b')]=_[_0xb7d4('0x4c')](_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x4b')])?null:_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x4b')];_0x4f2781[_0xb7d4('0x4d')]=_0x3f0bd0[_0xb7d4('0x31')][_0xb7d4('0x4d')]||![];_0x4f2781[_0xb7d4('0x4e')]=_0x3f0bd0[_0xb7d4('0x44')]['id'];return getContent(_0x3f0bd0['body'])[_0xb7d4('0x2b')](function(_0x550df8){_0x4f2781[_0xb7d4('0x31')]=_0x550df8;return getRecipients(_0x5805b7);})['then'](function(_0x1c5a86){_0x4f2781[_0xb7d4('0x4f')]=_['sortBy'](_0x1c5a86)['join'](',');return db[_0xb7d4('0x50')]['transaction'](function(_0x445238){return db['UserNotification'][_0xb7d4('0x51')](_0x4f2781,{'raw':!![],'transaction':_0x445238})[_0xb7d4('0x2b')](function(_0x2af160){var _0x1503df={'sender':_0x4f2781[_0xb7d4('0x49')],'description':_0x4f2781[_0xb7d4('0x4b')],'content':_0x4f2781[_0xb7d4('0x31')],'beep':_0x4f2781[_0xb7d4('0x4d')]};_0x1c5a86['forEach'](function(_0x233d33){_0x1503df[_0xb7d4('0x52')]=_0x233d33;socket[_0xb7d4('0x53')](_0xb7d4('0x54'),_0x1503df);});return _0x2af160;});});})[_0xb7d4('0x2b')](respondWithResult(_0x16a4b8,0xc9))[_0xb7d4('0x55')](handleError(_0x16a4b8,null));};function getContent(_0x28642b){return new BPromise(function(_0x1628c6,_0x56e0fa){if(_0x28642b['text']){_0x1628c6(_0x28642b[_0xb7d4('0x33')]);return;}return db[_0xb7d4('0x56')][_0xb7d4('0x57')]({'attributes':[_0xb7d4('0x58')],'where':{'id':_0x28642b[_0xb7d4('0x36')]},'raw':!![]})['then'](function(_0x46c119){if(!_0x46c119)throw new db[(_0xb7d4('0x38'))][(_0xb7d4('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x35ad97=Mustache[_0xb7d4('0x59')](_0x46c119[_0xb7d4('0x58')],_0x28642b[_0xb7d4('0x37')]);_0x1628c6(_0x35ad97);})[_0xb7d4('0x55')](function(_0x222baf){_0x56e0fa(_0x222baf);});});}function getRecipients(_0x394487){return new BPromise(function(_0x559e30,_0x72d99a){var _0x93a5f1=[];var _0x1fe67a=[];_0x394487[_0xb7d4('0x5a')](function(_0x524913){var _0x18cc31=_['startCase'](_0x524913[_0xb7d4('0x46')][_0xb7d4('0x47')]());if(_0x18cc31===_0xb7d4('0x5b')){_0x93a5f1=_[_0xb7d4('0x5c')](_0x93a5f1,_0x524913[_0xb7d4('0x5d')]);}else{if(_[_0xb7d4('0x5e')](_0x18cc31,_0xb7d4('0x5f')))_0x18cc31=_0x18cc31[_0xb7d4('0x60')]('queue',_0xb7d4('0x61'));_0x524913[_0xb7d4('0x5d')][_0xb7d4('0x5a')](function(_0x59dbca){_0x1fe67a[_0xb7d4('0x62')](getAgents(_0x18cc31,_0x59dbca));});}});return BPromise[_0xb7d4('0x63')](_0x1fe67a)[_0xb7d4('0x2b')](function(_0x34c490){_0x93a5f1=_[_0xb7d4('0x5c')](_0x93a5f1,_['flatten'](_0x34c490));_0x559e30(_0x93a5f1);})[_0xb7d4('0x55')](function(_0x4dd1fc){_0x72d99a(_0x4dd1fc);});});}function getAgents(_0x51969f,_0x575bfc){return new BPromise(function(_0x50f126,_0x346963){return db[_0x51969f][_0xb7d4('0x57')]({'where':{'id':_0x575bfc}})[_0xb7d4('0x2b')](function(_0x44f051){return _0x44f051[_0xb7d4('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x34e608){var _0xd71c8b=_[_0xb7d4('0x65')](_0x34e608,'id');_0x50f126(_0xd71c8b);});})[_0xb7d4('0x55')](function(_0x219598){_0x346963(_0x219598);});});} \ No newline at end of file +var _0x2acc=['recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','model','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sequelize','transaction','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','includes','replace','Queue','push','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','body','Sequelize','ValidationError','hasOwnProperty','Missing\x20\x27view\x27\x20parameter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2acc,0xed));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2ac('0x0'));var zipdir=require(_0xc2ac('0x1'));var jsonpatch=require(_0xc2ac('0x2'));var rp=require(_0xc2ac('0x3'));var moment=require(_0xc2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2ac('0x5'));var util=require(_0xc2ac('0x6'));var path=require(_0xc2ac('0x7'));var sox=require(_0xc2ac('0x8'));var csv=require(_0xc2ac('0x9'));var ejs=require(_0xc2ac('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2ac('0xb'));var squel=require(_0xc2ac('0xc'));var crypto=require(_0xc2ac('0xd'));var jsforce=require(_0xc2ac('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2ac('0x9'));var querystring=require(_0xc2ac('0xf'));var Papa=require(_0xc2ac('0x10'));var Redis=require(_0xc2ac('0x11'));var authService=require(_0xc2ac('0x12'));var qs=require(_0xc2ac('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc2ac('0x14'));var licenseUtil=require(_0xc2ac('0x15'));var db=require(_0xc2ac('0x16'))['db'];config[_0xc2ac('0x17')]=_[_0xc2ac('0x18')](config[_0xc2ac('0x17')],{'host':_0xc2ac('0x19'),'port':0x18eb});var socket=require(_0xc2ac('0x1a'))(new Redis(config[_0xc2ac('0x17')]));require(_0xc2ac('0x1b'))[_0xc2ac('0x1c')](socket);function respondWithStatusCode(_0xa851b1,_0xa1f399){_0xa1f399=_0xa1f399||0xcc;return function(_0x236aad){if(_0x236aad){return _0xa851b1[_0xc2ac('0x1d')](_0xa1f399);}return _0xa851b1['status'](_0xa1f399)[_0xc2ac('0x1e')]();};}function respondWithResult(_0x581bfb,_0x1ce06a){_0x1ce06a=_0x1ce06a||0xc8;return function(_0x53482c){if(_0x53482c){return _0x581bfb[_0xc2ac('0x1f')](_0x1ce06a)[_0xc2ac('0x20')](_0x53482c);}};}function respondWithFilteredResult(_0x3efe4c,_0x27ad05){return function(_0x23f6f9){if(_0x23f6f9){var _0x4e2704=typeof _0x27ad05[_0xc2ac('0x21')]===_0xc2ac('0x22')&&typeof _0x27ad05[_0xc2ac('0x23')]===_0xc2ac('0x22');var _0x4b3700=_0x23f6f9['count'];var _0x30ad8c=_0x4e2704?0x0:_0x27ad05[_0xc2ac('0x21')];var _0x53a39d=_0x4e2704?_0x23f6f9[_0xc2ac('0x24')]:_0x27ad05[_0xc2ac('0x21')]+_0x27ad05[_0xc2ac('0x23')];var _0x2995cb;if(_0x53a39d>=_0x4b3700){_0x53a39d=_0x4b3700;_0x2995cb=0xc8;}else{_0x2995cb=0xce;}_0x3efe4c[_0xc2ac('0x1f')](_0x2995cb);return _0x3efe4c[_0xc2ac('0x25')](_0xc2ac('0x26'),_0x30ad8c+'-'+_0x53a39d+'/'+_0x4b3700)[_0xc2ac('0x20')](_0x23f6f9);}return null;};}function patchUpdates(_0x43c714){return function(_0x28fd1f){try{jsonpatch[_0xc2ac('0x27')](_0x28fd1f,_0x43c714,!![]);}catch(_0x28edc3){return BPromise['reject'](_0x28edc3);}return _0x28fd1f[_0xc2ac('0x28')]();};}function saveUpdates(_0x2a66c9,_0x2f3db3){return function(_0x4fabcb){if(_0x4fabcb){return _0x4fabcb[_0xc2ac('0x29')](_0x2a66c9)[_0xc2ac('0x2a')](function(_0x306740){return _0x306740;});}return null;};}function removeEntity(_0x3bcb42,_0xe3210){return function(_0x1a943d){if(_0x1a943d){return _0x1a943d['destroy']()[_0xc2ac('0x2a')](function(){_0x3bcb42['status'](0xcc)[_0xc2ac('0x1e')]();});}};}function handleEntityNotFound(_0x1d9ffb,_0x4901a7){return function(_0x3bec7c){if(!_0x3bec7c){_0x1d9ffb[_0xc2ac('0x1d')](0x194);}return _0x3bec7c;};}function handleError(_0x531875,_0x33597e){_0x33597e=_0x33597e||0x1f4;return function(_0x5410a2){logger['error'](_0x5410a2[_0xc2ac('0x2b')]);if(_0x5410a2[_0xc2ac('0x2c')]){delete _0x5410a2['name'];}_0x531875[_0xc2ac('0x1f')](_0x33597e)[_0xc2ac('0x2d')](_0x5410a2);};}exports['sendUserNotification']=function(_0x59033d,_0x3555dc,_0x4b1c8c){if(!_0x59033d[_0xc2ac('0x2e')]['hasOwnProperty']('text')&&!_0x59033d[_0xc2ac('0x2e')]['hasOwnProperty']('TemplateId')){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')]('TemplateId')&&!_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')]('view')){throw new db['Sequelize'][(_0xc2ac('0x30'))](_0xc2ac('0x32'));}if(!_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')](_0xc2ac('0x33'))){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))](_0xc2ac('0x34'));}else{try{var _0x1419ef=JSON[_0xc2ac('0x35')](_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x33')]);}catch(_0x4bc98f){logger[_0xc2ac('0x36')](_0x4bc98f);throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))](_0xc2ac('0x37'));}var _0xc9e351=[_0xc2ac('0x38'),_0xc2ac('0x39'),_0xc2ac('0x3a'),_0xc2ac('0x3b'),_0xc2ac('0x3c'),_0xc2ac('0x3d'),_0xc2ac('0x3e'),'team','user'];if(_[_0xc2ac('0x3f')](_0x1419ef,function(_0x29fbe6){return!_['includes'](_0xc9e351,_0x29fbe6[_0xc2ac('0x40')]['toLowerCase']());})){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x15c424={};_0x15c424[_0xc2ac('0x41')]=_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')](_0xc2ac('0x41'))?_0x59033d['body'][_0xc2ac('0x41')]:_0x59033d[_0xc2ac('0x42')][_0xc2ac('0x43')];_0x15c424[_0xc2ac('0x44')]=_['isEmpty'](_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x44')])?null:_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x44')];_0x15c424[_0xc2ac('0x45')]=_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x45')]||![];_0x15c424[_0xc2ac('0x46')]=_0x59033d[_0xc2ac('0x42')]['id'];return getContent(_0x59033d['body'])[_0xc2ac('0x2a')](function(_0x153d15){_0x15c424[_0xc2ac('0x2e')]=_0x153d15;return getRecipients(_0x1419ef);})[_0xc2ac('0x2a')](function(_0x1b8cb3){_0x15c424[_0xc2ac('0x47')]=_['sortBy'](_0x1b8cb3)['join'](',');return db[_0xc2ac('0x48')][_0xc2ac('0x49')](function(_0x399870){return db['UserNotification']['create'](_0x15c424,{'raw':!![],'transaction':_0x399870})['then'](function(_0x558e7f){var _0x4c7dcf={'sender':_0x15c424[_0xc2ac('0x41')],'description':_0x15c424['recipientsDescription'],'content':_0x15c424[_0xc2ac('0x2e')],'beep':_0x15c424[_0xc2ac('0x45')]};_0x1b8cb3[_0xc2ac('0x4a')](function(_0x2ad589){_0x4c7dcf[_0xc2ac('0x4b')]=_0x2ad589;socket[_0xc2ac('0x4c')](_0xc2ac('0x4d'),_0x4c7dcf);});return _0x558e7f;});});})[_0xc2ac('0x2a')](respondWithResult(_0x3555dc,0xc9))[_0xc2ac('0x4e')](handleError(_0x3555dc,null));};function getContent(_0x87aadd){return new BPromise(function(_0x392c3e,_0x4c8819){if(_0x87aadd['text']){_0x392c3e(_0x87aadd[_0xc2ac('0x4f')]);return;}return db[_0xc2ac('0x50')][_0xc2ac('0x51')]({'attributes':[_0xc2ac('0x52')],'where':{'id':_0x87aadd['TemplateId']},'raw':!![]})[_0xc2ac('0x2a')](function(_0x1e3e2d){if(!_0x1e3e2d)throw new db[(_0xc2ac('0x2f'))]['ValidationError'](_0xc2ac('0x53'));var _0x5ea8a3=Mustache[_0xc2ac('0x54')](_0x1e3e2d[_0xc2ac('0x52')],_0x87aadd['view']);_0x392c3e(_0x5ea8a3);})[_0xc2ac('0x4e')](function(_0x5c37ac){_0x4c8819(_0x5c37ac);});});}function getRecipients(_0x2c8ead){return new BPromise(function(_0x5baddd,_0xf43fef){var _0x253d32=[];var _0x2e6d66=[];_0x2c8ead[_0xc2ac('0x4a')](function(_0x213adc){var _0x10beaa=_[_0xc2ac('0x55')](_0x213adc[_0xc2ac('0x40')]['toLowerCase']());if(_0x10beaa===_0xc2ac('0x56')){_0x253d32=_[_0xc2ac('0x57')](_0x253d32,_0x213adc[_0xc2ac('0x58')]);}else{if(_[_0xc2ac('0x59')](_0x10beaa,'queue'))_0x10beaa=_0x10beaa[_0xc2ac('0x5a')]('queue',_0xc2ac('0x5b'));_0x213adc['ids'][_0xc2ac('0x4a')](function(_0x2d4af4){_0x2e6d66[_0xc2ac('0x5c')](getAgents(_0x10beaa,_0x2d4af4));});}});return BPromise['all'](_0x2e6d66)[_0xc2ac('0x2a')](function(_0x5040c5){_0x253d32=_[_0xc2ac('0x57')](_0x253d32,_[_0xc2ac('0x5d')](_0x5040c5));_0x5baddd(_0x253d32);})[_0xc2ac('0x4e')](function(_0x3afcff){_0xf43fef(_0x3afcff);});});}function getAgents(_0x12fd0c,_0x435b89){return new BPromise(function(_0x2b2cf8,_0x1b115f){return db[_0x12fd0c]['findOne']({'where':{'id':_0x435b89}})[_0xc2ac('0x2a')](function(_0x228ba0){return _0x228ba0[_0xc2ac('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54cbb1){var _0x200856=_[_0xc2ac('0x5f')](_0x54cbb1,'id');_0x2b2cf8(_0x200856);});})[_0xc2ac('0x4e')](function(_0x440832){_0x1b115f(_0x440832);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 6cdbae8..1e42b12 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf38=['save','update','remove','emit','hasOwnProperty','events','UserNotification','setMaxListeners'];(function(_0x1ca37a,_0x4bcaf3){var _0x32407b=function(_0x3cb2f4){while(--_0x3cb2f4){_0x1ca37a['push'](_0x1ca37a['shift']());}};_0x32407b(++_0x4bcaf3);}(_0xcf38,0x145));var _0x8cf3=function(_0x258c0c,_0x36b1b0){_0x258c0c=_0x258c0c-0x0;var _0x37162b=_0xcf38[_0x258c0c];return _0x37162b;};'use strict';var EventEmitter=require(_0x8cf3('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x8cf3('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8cf3('0x2')](0x0);var events={'afterCreate':_0x8cf3('0x3'),'afterUpdate':_0x8cf3('0x4'),'afterDestroy':_0x8cf3('0x5')};function emitEvent(_0x482915){return function(_0x5458d5,_0x130fa1,_0x3df6f1){UserNotificationEvents[_0x8cf3('0x6')](_0x482915+':'+_0x5458d5['id'],_0x5458d5);UserNotificationEvents[_0x8cf3('0x6')](_0x482915,_0x5458d5);_0x3df6f1(null);};}for(var e in events){if(events[_0x8cf3('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x464f=['hook','events','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2a773b,_0x21b8db){var _0x486133=function(_0x1051d9){while(--_0x1051d9){_0x2a773b['push'](_0x2a773b['shift']());}};_0x486133(++_0x21b8db);}(_0x464f,0xf9));var _0xf464=function(_0x5ecf0d,_0x17175b){_0x5ecf0d=_0x5ecf0d-0x0;var _0x322300=_0x464f[_0x5ecf0d];return _0x322300;};'use strict';var EventEmitter=require(_0xf464('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xf464('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf464('0x2')](0x0);var events={'afterCreate':_0xf464('0x3'),'afterUpdate':_0xf464('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f5ce0){return function(_0x1140f5,_0x575490,_0x2dfe0d){UserNotificationEvents[_0xf464('0x5')](_0x5f5ce0+':'+_0x1140f5['id'],_0x1140f5);UserNotificationEvents[_0xf464('0x5')](_0x5f5ce0,_0x1140f5);_0x2dfe0d(null);};}for(var e in events){if(events[_0xf464('0x6')](e)){var event=events[e];UserNotification[_0xf464('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 1a629c7..b3fd9c3 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8645=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x8645,0xca));var _0x5864=function(_0x3ace35,_0x11dfa8){_0x3ace35=_0x3ace35-0x0;var _0x1af13d=_0x8645[_0x3ace35];return _0x1af13d;};'use strict';var _=require(_0x5864('0x0'));var util=require('util');var logger=require(_0x5864('0x1'))('api');var moment=require(_0x5864('0x2'));var BPromise=require(_0x5864('0x3'));var rp=require(_0x5864('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5864('0x5'));var config=require(_0x5864('0x6'));var attributes=require(_0x5864('0x7'));module[_0x5864('0x8')]=function(_0x620e96,_0x16a1cb){return _0x620e96[_0x5864('0x9')](_0x5864('0xa'),attributes,{'tableName':_0x5864('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5864('0xc'),'collate':_0x5864('0xd')});}; \ No newline at end of file +var _0xc1d7=['../../config/logger','request-promise','rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4','lodash','util'];(function(_0x54a4f6,_0x551ef9){var _0x554ed0=function(_0x30e77e){while(--_0x30e77e){_0x54a4f6['push'](_0x54a4f6['shift']());}};_0x554ed0(++_0x551ef9);}(_0xc1d7,0x10c));var _0x7c1d=function(_0x456a84,_0x46bc0b){_0x456a84=_0x456a84-0x0;var _0x1117d6=_0xc1d7[_0x456a84];return _0x1117d6;};'use strict';var _=require(_0x7c1d('0x0'));var util=require(_0x7c1d('0x1'));var logger=require(_0x7c1d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c1d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1d('0x4'));var config=require(_0x7c1d('0x5'));var attributes=require(_0x7c1d('0x6'));module['exports']=function(_0x3c9901,_0xdc451d){return _0x3c9901['define'](_0x7c1d('0x7'),attributes,{'tableName':_0x7c1d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c1d('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 25a6f65..b0e4744 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dcc=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','UserNotification,\x20%s,\x20%s','message','info','result'];(function(_0x48da37,_0x2e3acd){var _0x382954=function(_0x191e2c){while(--_0x191e2c){_0x48da37['push'](_0x48da37['shift']());}};_0x382954(++_0x2e3acd);}(_0x0dcc,0x1a9));var _0xc0dc=function(_0x396cc2,_0x24c934){_0x396cc2=_0x396cc2-0x0;var _0x273cb6=_0x0dcc[_0x396cc2];return _0x273cb6;};'use strict';var _=require(_0xc0dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc0dc('0x1'));var rs=require(_0xc0dc('0x2'));var fs=require('fs');var Redis=require(_0xc0dc('0x3'));var db=require(_0xc0dc('0x4'))['db'];var utils=require(_0xc0dc('0x5'));var logger=require(_0xc0dc('0x6'))('rpc');var config=require(_0xc0dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0dc('0x8')][_0xc0dc('0x9')]({'port':0x232a});config[_0xc0dc('0xa')]=_[_0xc0dc('0xb')](config[_0xc0dc('0xa')],{'host':_0xc0dc('0xc'),'port':0x18eb});var socket=require(_0xc0dc('0xd'))(new Redis(config[_0xc0dc('0xa')]));require(_0xc0dc('0xe'))['register'](socket);function respondWithRpcPromise(_0x36d432,_0x39561b,_0x2d3a38){return new BPromise(function(_0x59aabb,_0x5cf8f3){return client[_0xc0dc('0xf')](_0x36d432,_0x2d3a38)[_0xc0dc('0x10')](function(_0x3420c2){logger['info']('UserNotification,\x20%s,\x20%s',_0x39561b,_0xc0dc('0x11'));logger[_0xc0dc('0x12')](_0xc0dc('0x13'),_0x39561b,_0xc0dc('0x11'),JSON['stringify'](_0x3420c2));if(_0x3420c2[_0xc0dc('0x14')]){if(_0x3420c2[_0xc0dc('0x14')]['code']===0x1f4){logger[_0xc0dc('0x14')](_0xc0dc('0x15'),_0x39561b,_0x3420c2['error'][_0xc0dc('0x16')]);return _0x5cf8f3(_0x3420c2[_0xc0dc('0x14')][_0xc0dc('0x16')]);}logger[_0xc0dc('0x14')](_0xc0dc('0x15'),_0x39561b,_0x3420c2['error'][_0xc0dc('0x16')]);return _0x59aabb(_0x3420c2[_0xc0dc('0x14')][_0xc0dc('0x16')]);}else{logger[_0xc0dc('0x17')]('UserNotification,\x20%s,\x20%s',_0x39561b,_0xc0dc('0x11'));_0x59aabb(_0x3420c2[_0xc0dc('0x18')][_0xc0dc('0x16')]);}})['catch'](function(_0x155bd5){logger[_0xc0dc('0x14')](_0xc0dc('0x15'),_0x39561b,_0x155bd5);_0x5cf8f3(_0x155bd5);});});} \ No newline at end of file +var _0x45df=['redis','defaults','socket.io-emitter','request','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2eb7af,_0x5ee68c){var _0x131719=function(_0x23c0dd){while(--_0x23c0dd){_0x2eb7af['push'](_0x2eb7af['shift']());}};_0x131719(++_0x5ee68c);}(_0x45df,0x81));var _0xf45d=function(_0x5014de,_0x2e5b19){_0x5014de=_0x5014de-0x0;var _0x19a5c4=_0x45df[_0x5014de];return _0x19a5c4;};'use strict';var _=require(_0xf45d('0x0'));var util=require(_0xf45d('0x1'));var moment=require('moment');var BPromise=require(_0xf45d('0x2'));var rs=require(_0xf45d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf45d('0x4'));var logger=require(_0xf45d('0x5'))('rpc');var config=require(_0xf45d('0x6'));var jayson=require(_0xf45d('0x7'));var client=jayson[_0xf45d('0x8')]['http']({'port':0x232a});config[_0xf45d('0x9')]=_[_0xf45d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf45d('0xb'))(new Redis(config[_0xf45d('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x164fab,_0x1fc6f1,_0x5bcea6){return new BPromise(function(_0x4129ec,_0x535846){return client[_0xf45d('0xc')](_0x164fab,_0x5bcea6)['then'](function(_0x23bb9a){logger[_0xf45d('0xd')]('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0xf45d('0xe'));logger['debug'](_0xf45d('0xf'),_0x1fc6f1,_0xf45d('0xe'),JSON[_0xf45d('0x10')](_0x23bb9a));if(_0x23bb9a[_0xf45d('0x11')]){if(_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x12')]===0x1f4){logger[_0xf45d('0x11')](_0xf45d('0x13'),_0x1fc6f1,_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);return _0x535846(_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);}logger[_0xf45d('0x11')]('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);return _0x4129ec(_0x23bb9a['error'][_0xf45d('0x14')]);}else{logger[_0xf45d('0xd')](_0xf45d('0x13'),_0x1fc6f1,'request\x20sent');_0x4129ec(_0x23bb9a[_0xf45d('0x15')][_0xf45d('0x14')]);}})[_0xf45d('0x16')](function(_0x1b57df){logger['error']('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0x1b57df);_0x535846(_0x1b57df);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index de8ee77..2670625 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b74=['emit','length','./userNotification.events','remove','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b74,0x70));var _0x46b7=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x6b74[_0x4d8dc3];return _0x9b03d9;};'use strict';var UserNotificationEvents=require(_0x46b7('0x0'));var events=['save',_0x46b7('0x1'),_0x46b7('0x2')];function createListener(_0x555f3a,_0x475d1c){return function(_0x73b8fa){_0x475d1c[_0x46b7('0x3')](_0x555f3a,_0x73b8fa);};}function removeListener(_0x4f4a79,_0x466829){return function(){UserNotificationEvents['removeListener'](_0x4f4a79,_0x466829);};}exports['register']=function(_0x3a9741){for(var _0x495f3a=0x0,_0x4377ab=events[_0x46b7('0x4')];_0x495f3a<_0x4377ab;_0x495f3a++){var _0x4e416c=events[_0x495f3a];var _0x720009=createListener('userNotification:'+_0x4e416c,_0x3a9741);UserNotificationEvents['on'](_0x4e416c,_0x720009);}}; \ No newline at end of file +var _0xf835=['update','emit','length','./userNotification.events','remove'];(function(_0x1a49fc,_0x527071){var _0x5589fc=function(_0x1bf972){while(--_0x1bf972){_0x1a49fc['push'](_0x1a49fc['shift']());}};_0x5589fc(++_0x527071);}(_0xf835,0x1bb));var _0x5f83=function(_0xcfaf79,_0x374941){_0xcfaf79=_0xcfaf79-0x0;var _0x5b8c1b=_0xf835[_0xcfaf79];return _0x5b8c1b;};'use strict';var UserNotificationEvents=require(_0x5f83('0x0'));var events=['save',_0x5f83('0x1'),_0x5f83('0x2')];function createListener(_0x35abbe,_0x1ee907){return function(_0x1c7233){_0x1ee907[_0x5f83('0x3')](_0x35abbe,_0x1c7233);};}function removeListener(_0x51d36a,_0xbd6db5){return function(){UserNotificationEvents['removeListener'](_0x51d36a,_0xbd6db5);};}exports['register']=function(_0x2f977e){for(var _0x31fd0e=0x0,_0x336a8a=events[_0x5f83('0x4')];_0x31fd0e<_0x336a8a;_0x31fd0e++){var _0x718255=events[_0x31fd0e];var _0x15c894=createListener('userNotification:'+_0x718255,_0x2f977e);UserNotificationEvents['on'](_0x718255,_0x15c894);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index c48b767..bb5ae22 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x29400a,_0x24ffaf){var _0x50cb49=function(_0x576cea){while(--_0x576cea){_0x29400a['push'](_0x29400a['shift']());}};_0x50cb49(++_0x24ffaf);}(_0xe706,0xa3));var _0x6e70=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xe706[_0x49c68e];return _0x33032b;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x385b71,_0x2ae587){var _0x72ac1d=function(_0x5308f0){while(--_0x5308f0){_0x385b71['push'](_0x385b71['shift']());}};_0x72ac1d(++_0x2ae587);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9cbd053..810e0cb 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 _0xd2e5=['exports','INTEGER'];(function(_0x54b141,_0x270c14){var _0x2122c1=function(_0x4d492d){while(--_0x4d492d){_0x54b141['push'](_0x54b141['shift']());}};_0x2122c1(++_0x270c14);}(_0xd2e5,0x1cc));var _0x5d2e=function(_0x1d0b80,_0x41fc24){_0x1d0b80=_0x1d0b80-0x0;var _0x35d642=_0xd2e5[_0x1d0b80];return _0x35d642;};'use strict';var Sequelize=require('sequelize');module[_0x5d2e('0x0')]={'penalty':{'type':Sequelize[_0x5d2e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1159=['sequelize'];(function(_0x21058f,_0x342d79){var _0x31255f=function(_0x28b998){while(--_0x28b998){_0x21058f['push'](_0x21058f['shift']());}};_0x31255f(++_0x342d79);}(_0x1159,0xf3));var _0x9115=function(_0x2d1dc4,_0x46a6ba){_0x2d1dc4=_0x2d1dc4-0x0;var _0x352581=_0x1159[_0x2d1dc4];return _0x352581;};'use strict';var Sequelize=require(_0x9115('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 cec4de4..36dd880 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 _0x0a8e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x0a8e,0xc3));var _0xe0a8=function(_0x3459dd,_0x424712){_0x3459dd=_0x3459dd-0x0;var _0x20797e=_0x0a8e[_0x3459dd];return _0x20797e;};'use strict';var _=require(_0xe0a8('0x0'));var util=require(_0xe0a8('0x1'));var logger=require('../../config/logger')(_0xe0a8('0x2'));var moment=require(_0xe0a8('0x3'));var BPromise=require(_0xe0a8('0x4'));var rp=require(_0xe0a8('0x5'));var fs=require('fs');var path=require(_0xe0a8('0x6'));var rimraf=require(_0xe0a8('0x7'));var config=require(_0xe0a8('0x8'));var attributes=require(_0xe0a8('0x9'));module['exports']=function(_0x3cc188,_0x3b5352){return _0x3cc188[_0xe0a8('0xa')](_0xe0a8('0xb'),attributes,{'tableName':_0xe0a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76d2=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x33f16a,_0x594322){var _0x22a6e0=function(_0x59efc3){while(--_0x59efc3){_0x33f16a['push'](_0x33f16a['shift']());}};_0x22a6e0(++_0x594322);}(_0x76d2,0x7c));var _0x276d=function(_0x1c08f3,_0x12beb3){_0x1c08f3=_0x1c08f3-0x0;var _0x5edb1c=_0x76d2[_0x1c08f3];return _0x5edb1c;};'use strict';var _=require(_0x276d('0x0'));var util=require(_0x276d('0x1'));var logger=require(_0x276d('0x2'))(_0x276d('0x3'));var moment=require(_0x276d('0x4'));var BPromise=require(_0x276d('0x5'));var rp=require(_0x276d('0x6'));var fs=require('fs');var path=require(_0x276d('0x7'));var rimraf=require(_0x276d('0x8'));var config=require(_0x276d('0x9'));var attributes=require(_0x276d('0xa'));module[_0x276d('0xb')]=function(_0x44b05f,_0x23f1f3){return _0x44b05f[_0x276d('0xc')](_0x276d('0xd'),attributes,{'tableName':_0x276d('0xe'),'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 1d757cb..52daf57 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 _0x2cab=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2cab,0xf9));var _0xb2ca=function(_0x5e6053,_0x207b6f){_0x5e6053=_0x5e6053-0x0;var _0x3f423d=_0x2cab[_0x5e6053];return _0x3f423d;};'use strict';var _=require(_0xb2ca('0x0'));var util=require(_0xb2ca('0x1'));var moment=require(_0xb2ca('0x2'));var BPromise=require(_0xb2ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2ca('0x5'));var logger=require(_0xb2ca('0x6'))(_0xb2ca('0x7'));var config=require(_0xb2ca('0x8'));var jayson=require(_0xb2ca('0x9'));var client=jayson[_0xb2ca('0xa')][_0xb2ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x588ca3,_0x812040,_0x4e66bd){return new BPromise(function(_0x39e692,_0x2d85ed){return client['request'](_0x588ca3,_0x4e66bd)[_0xb2ca('0xc')](function(_0xf07c55){logger[_0xb2ca('0xd')](_0xb2ca('0xe'),_0x812040,_0xb2ca('0xf'));logger['debug'](_0xb2ca('0x10'),_0x812040,'request\x20sent',JSON[_0xb2ca('0x11')](_0xf07c55));if(_0xf07c55[_0xb2ca('0x12')]){if(_0xf07c55[_0xb2ca('0x12')][_0xb2ca('0x13')]===0x1f4){logger[_0xb2ca('0x12')](_0xb2ca('0xe'),_0x812040,_0xf07c55[_0xb2ca('0x12')][_0xb2ca('0x14')]);return _0x2d85ed(_0xf07c55[_0xb2ca('0x12')][_0xb2ca('0x14')]);}logger['error'](_0xb2ca('0xe'),_0x812040,_0xf07c55[_0xb2ca('0x12')]['message']);return _0x39e692(_0xf07c55['error'][_0xb2ca('0x14')]);}else{logger[_0xb2ca('0xd')](_0xb2ca('0xe'),_0x812040,'request\x20sent');_0x39e692(_0xf07c55[_0xb2ca('0x15')][_0xb2ca('0x14')]);}})[_0xb2ca('0x16')](function(_0x5aa4be){logger[_0xb2ca('0x12')](_0xb2ca('0xe'),_0x812040,_0x5aa4be);_0x2d85ed(_0x5aa4be);});});} \ No newline at end of file +var _0xe269=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x4ac67b,_0x474dc1){var _0x1a8490=function(_0x383a16){while(--_0x383a16){_0x4ac67b['push'](_0x4ac67b['shift']());}};_0x1a8490(++_0x474dc1);}(_0xe269,0xb9));var _0x9e26=function(_0x1a4071,_0x1b49b8){_0x1a4071=_0x1a4071-0x0;var _0x17e620=_0xe269[_0x1a4071];return _0x17e620;};'use strict';var _=require('lodash');var util=require(_0x9e26('0x0'));var moment=require('moment');var BPromise=require(_0x9e26('0x1'));var rs=require(_0x9e26('0x2'));var fs=require('fs');var Redis=require(_0x9e26('0x3'));var db=require(_0x9e26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e26('0x5'))(_0x9e26('0x6'));var config=require(_0x9e26('0x7'));var jayson=require(_0x9e26('0x8'));var client=jayson[_0x9e26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57abd5,_0x2cb314,_0x125b5d){return new BPromise(function(_0x5b2b3b,_0x53ba28){return client[_0x9e26('0xa')](_0x57abd5,_0x125b5d)['then'](function(_0x4601d7){logger[_0x9e26('0xb')](_0x9e26('0xc'),_0x2cb314,_0x9e26('0xd'));logger[_0x9e26('0xe')](_0x9e26('0xf'),_0x2cb314,_0x9e26('0xd'),JSON[_0x9e26('0x10')](_0x4601d7));if(_0x4601d7['error']){if(_0x4601d7[_0x9e26('0x11')][_0x9e26('0x12')]===0x1f4){logger['error'](_0x9e26('0xc'),_0x2cb314,_0x4601d7[_0x9e26('0x11')]['message']);return _0x53ba28(_0x4601d7[_0x9e26('0x11')][_0x9e26('0x13')]);}logger[_0x9e26('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2cb314,_0x4601d7['error']['message']);return _0x5b2b3b(_0x4601d7[_0x9e26('0x11')]['message']);}else{logger[_0x9e26('0xb')](_0x9e26('0xc'),_0x2cb314,_0x9e26('0xd'));_0x5b2b3b(_0x4601d7[_0x9e26('0x14')][_0x9e26('0x13')]);}})['catch'](function(_0xf9ac60){logger[_0x9e26('0x11')](_0x9e26('0xc'),_0x2cb314,_0xf9ac60);_0x53ba28(_0xf9ac60);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 058902f..6fca111 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 _0x4261=['addSections','addResources','update','removeSections','delete','removeResources','exports','multer','util','path','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x4261,0x1c1));var _0x1426=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x4261[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x1426('0x0'));var util=require(_0x1426('0x1'));var path=require(_0x1426('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1426('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1426('0x4'));router[_0x1426('0x5')]('/',auth[_0x1426('0x6')](),controller[_0x1426('0x7')]);router[_0x1426('0x5')](_0x1426('0x8'),auth[_0x1426('0x6')](),controller[_0x1426('0x9')]);router[_0x1426('0x5')](_0x1426('0xa'),auth[_0x1426('0x6')](),controller[_0x1426('0xb')]);router[_0x1426('0x5')]('/:id/sections',auth[_0x1426('0x6')](),controller[_0x1426('0xc')]);router[_0x1426('0x5')](_0x1426('0xd'),auth[_0x1426('0x6')](),controller[_0x1426('0xe')]);router[_0x1426('0xf')]('/',auth[_0x1426('0x6')](),controller[_0x1426('0x10')]);router[_0x1426('0xf')]('/:id/clone',auth[_0x1426('0x6')](),controller[_0x1426('0x11')]);router['post'](_0x1426('0x12'),auth[_0x1426('0x6')](),controller[_0x1426('0x13')]);router['post'](_0x1426('0xd'),auth[_0x1426('0x6')](),controller[_0x1426('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1426('0x15')]);router['delete'](_0x1426('0xa'),auth[_0x1426('0x6')](),controller['destroy']);router['delete'](_0x1426('0x12'),auth['isAuthenticated'](),controller[_0x1426('0x16')]);router[_0x1426('0x17')](_0x1426('0xd'),auth[_0x1426('0x6')](),controller[_0x1426('0x18')]);module[_0x1426('0x19')]=router; \ No newline at end of file +var _0x5057=['/:id','show','/:id/sections','/:id/resources','getResources','post','create','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe'];(function(_0xc0bde9,_0x355373){var _0x3483f9=function(_0x5820a2){while(--_0x5820a2){_0xc0bde9['push'](_0xc0bde9['shift']());}};_0x3483f9(++_0x355373);}(_0x5057,0x151));var _0x7505=function(_0x38dcb0,_0x8d5af7){_0x38dcb0=_0x38dcb0-0x0;var _0xe5fa1b=_0x5057[_0x38dcb0];return _0xe5fa1b;};'use strict';var multer=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var path=require(_0x7505('0x2'));var timeout=require('connect-timeout');var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require(_0x7505('0x5'));var auth=require(_0x7505('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7505('0x7'));var controller=require(_0x7505('0x8'));router['get']('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0xb')](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router['get'](_0x7505('0xe'),auth['isAuthenticated'](),controller[_0x7505('0xf')]);router[_0x7505('0xb')](_0x7505('0x10'),auth['isAuthenticated'](),controller['getSections']);router[_0x7505('0xb')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/',auth['isAuthenticated'](),controller[_0x7505('0x14')]);router[_0x7505('0x13')]('/:id/clone',auth[_0x7505('0x9')](),controller['clone']);router[_0x7505('0x13')](_0x7505('0x10'),auth[_0x7505('0x9')](),controller['addSections']);router[_0x7505('0x13')]('/:id/resources',auth[_0x7505('0x9')](),controller['addResources']);router[_0x7505('0x15')]('/:id',auth[_0x7505('0x9')](),controller['update']);router[_0x7505('0x16')](_0x7505('0xe'),auth[_0x7505('0x9')](),controller[_0x7505('0x17')]);router[_0x7505('0x16')]('/:id/sections',auth[_0x7505('0x9')](),controller[_0x7505('0x18')]);router[_0x7505('0x16')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x19')]);module[_0x7505('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 7eb3395..f680f0c 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 _0xdffc=['join','getDataValue','BOOLEAN','STRING','name'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0xdffc,0x175));var _0xcdff=function(_0x56c3b0,_0x176571){_0x56c3b0=_0x56c3b0-0x0;var _0x36b299=_0xdffc[_0x56c3b0];return _0x36b299;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcdff('0x0')],'allowNull':![],'unique':_0xcdff('0x1')},'crudPermissions':{'type':Sequelize[_0xcdff('0x0')],'set':function(_0x3584db){this['setDataValue']('crudPermissions',_0x3584db?_0x3584db[_0xcdff('0x2')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xcdff('0x3')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xcdff('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcdff('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe450=['join','getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions'];(function(_0x1877e8,_0x7439ce){var _0x15ef19=function(_0x5cca65){while(--_0x5cca65){_0x1877e8['push'](_0x1877e8['shift']());}};_0x15ef19(++_0x7439ce);}(_0xe450,0xbc));var _0x0e45=function(_0x47c156,_0x5b35e1){_0x47c156=_0x47c156-0x0;var _0x29d767=_0xe450[_0x47c156];return _0x29d767;};'use strict';var Sequelize=require(_0x0e45('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e45('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3dd767){this[_0x0e45('0x2')](_0x0e45('0x3'),_0x3dd767?_0x3dd767[_0x0e45('0x4')](''):[]);},'get':function(){return this[_0x0e45('0x5')](_0x0e45('0x3'))?this['getDataValue'](_0x0e45('0x3'))[_0x0e45('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0e45('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 5bd24eb..c10ff27 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 _0xbe4b=['removeSections','ids','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','UserProfile','includeAll','include','rows','catch','show','params','rawAttributes','find','clone','length','get','createdAt','body','omit','sequelize','transaction','findAll','autoAssociation','UserProfileResource','updatedAt','userProfileId','create','update','describe','UserProfileSection','sectionId','each','Resources'];(function(_0x557404,_0x54150f){var _0x3752ac=function(_0x3d126f){while(--_0x3d126f){_0x557404['push'](_0x557404['shift']());}};_0x3752ac(++_0x54150f);}(_0xbe4b,0xe2));var _0xbbe4=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xbe4b[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xbbe4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbe4('0x1'));var jsonpatch=require(_0xbbe4('0x2'));var rp=require(_0xbbe4('0x3'));var moment=require('moment');var BPromise=require(_0xbbe4('0x4'));var Mustache=require('mustache');var util=require(_0xbbe4('0x5'));var path=require('path');var sox=require(_0xbbe4('0x6'));var csv=require(_0xbbe4('0x7'));var ejs=require(_0xbbe4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbe4('0x9'));var squel=require('squel');var crypto=require(_0xbbe4('0xa'));var jsforce=require(_0xbbe4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbbe4('0x7'));var querystring=require(_0xbbe4('0xc'));var Papa=require('papaparse');var Redis=require(_0xbbe4('0xd'));var authService=require(_0xbbe4('0xe'));var qs=require(_0xbbe4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbe4('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbbe4('0x11'));var config=require(_0xbbe4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbe4('0x13'))['db'];config[_0xbbe4('0x14')]=_['defaults'](config[_0xbbe4('0x14')],{'host':_0xbbe4('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbe4('0x14')]));require(_0xbbe4('0x16'))[_0xbbe4('0x17')](socket);function respondWithStatusCode(_0x64b580,_0x321681){_0x321681=_0x321681||0xcc;return function(_0x2cc49a){if(_0x2cc49a){return _0x64b580[_0xbbe4('0x18')](_0x321681);}return _0x64b580[_0xbbe4('0x19')](_0x321681)[_0xbbe4('0x1a')]();};}function respondWithResult(_0x50f8a8,_0x232f0b){_0x232f0b=_0x232f0b||0xc8;return function(_0x257eb9){if(_0x257eb9){return _0x50f8a8['status'](_0x232f0b)[_0xbbe4('0x1b')](_0x257eb9);}};}function respondWithFilteredResult(_0x373aeb,_0xbdd6de){return function(_0x317f59){if(_0x317f59){var _0x1a30cb=typeof _0xbdd6de[_0xbbe4('0x1c')]===_0xbbe4('0x1d')&&typeof _0xbdd6de[_0xbbe4('0x1e')]==='undefined';var _0x17dcd6=_0x317f59[_0xbbe4('0x1f')];var _0x3d679e=_0x1a30cb?0x0:_0xbdd6de[_0xbbe4('0x1c')];var _0x14b803=_0x1a30cb?_0x317f59[_0xbbe4('0x1f')]:_0xbdd6de['offset']+_0xbdd6de[_0xbbe4('0x1e')];var _0x15730a;if(_0x14b803>=_0x17dcd6){_0x14b803=_0x17dcd6;_0x15730a=0xc8;}else{_0x15730a=0xce;}_0x373aeb[_0xbbe4('0x19')](_0x15730a);return _0x373aeb[_0xbbe4('0x20')](_0xbbe4('0x21'),_0x3d679e+'-'+_0x14b803+'/'+_0x17dcd6)[_0xbbe4('0x1b')](_0x317f59);}return null;};}function patchUpdates(_0x48913c){return function(_0x15c7c6){try{jsonpatch['apply'](_0x15c7c6,_0x48913c,!![]);}catch(_0x5a8010){return BPromise['reject'](_0x5a8010);}return _0x15c7c6['save']();};}function saveUpdates(_0x187380,_0x257236){return function(_0x1a0743){if(_0x1a0743){return _0x1a0743['update'](_0x187380)[_0xbbe4('0x22')](function(_0x1e8ad1){return _0x1e8ad1;});}return null;};}function removeEntity(_0x324765,_0x48b7e9){return function(_0x498f07){if(_0x498f07){return _0x498f07[_0xbbe4('0x23')]()[_0xbbe4('0x22')](function(){_0x324765[_0xbbe4('0x19')](0xcc)[_0xbbe4('0x1a')]();});}};}function handleEntityNotFound(_0x554da5,_0xed0af0){return function(_0x4bbd94){if(!_0x4bbd94){_0x554da5[_0xbbe4('0x18')](0x194);}return _0x4bbd94;};}function handleError(_0x1b089c,_0x441ac5){_0x441ac5=_0x441ac5||0x1f4;return function(_0x16f595){logger[_0xbbe4('0x24')](_0x16f595[_0xbbe4('0x25')]);if(_0x16f595['name']){delete _0x16f595[_0xbbe4('0x26')];}_0x1b089c[_0xbbe4('0x19')](_0x441ac5)['send'](_0x16f595);};}exports[_0xbbe4('0x27')]=function(_0x167d05,_0x25aec7){var _0x296569={},_0xed7425={},_0x195029={'count':0x0,'rows':[]};var _0x168348=_[_0xbbe4('0x28')](db['UserProfile']['rawAttributes'],function(_0x20df55){return{'name':_0x20df55[_0xbbe4('0x29')],'type':_0x20df55[_0xbbe4('0x2a')]['key']};});_0xed7425[_0xbbe4('0x2b')]=_[_0xbbe4('0x28')](_0x168348,_0xbbe4('0x26'));_0xed7425[_0xbbe4('0x2c')]=_[_0xbbe4('0x2d')](_0x167d05[_0xbbe4('0x2c')]);_0xed7425[_0xbbe4('0x2e')]=_[_0xbbe4('0x2f')](_0xed7425['model'],_0xed7425[_0xbbe4('0x2c')]);_0x296569[_0xbbe4('0x30')]=_['intersection'](_0xed7425[_0xbbe4('0x2b')],qs[_0xbbe4('0x31')](_0x167d05[_0xbbe4('0x2c')][_0xbbe4('0x31')]));_0x296569[_0xbbe4('0x30')]=_0x296569[_0xbbe4('0x30')]['length']?_0x296569[_0xbbe4('0x30')]:_0xed7425['model'];if(!_0x167d05[_0xbbe4('0x2c')][_0xbbe4('0x32')]('nolimit')){_0x296569[_0xbbe4('0x1e')]=qs[_0xbbe4('0x1e')](_0x167d05[_0xbbe4('0x2c')]['limit']);_0x296569[_0xbbe4('0x1c')]=qs['offset'](_0x167d05['query'][_0xbbe4('0x1c')]);}_0x296569[_0xbbe4('0x33')]=qs[_0xbbe4('0x34')](_0x167d05[_0xbbe4('0x2c')]['sort']);_0x296569[_0xbbe4('0x35')]=qs[_0xbbe4('0x2e')](_['pick'](_0x167d05['query'],_0xed7425['filters']),_0x168348);if(_0x167d05[_0xbbe4('0x2c')]['filter']){_0x296569[_0xbbe4('0x35')]=_[_0xbbe4('0x36')](_0x296569[_0xbbe4('0x35')],{'$or':_[_0xbbe4('0x28')](_0x168348,function(_0x13aa77){if(_0x13aa77[_0xbbe4('0x2a')]!=='VIRTUAL'){var _0x552711={};_0x552711[_0x13aa77[_0xbbe4('0x26')]]={'$like':'%'+_0x167d05[_0xbbe4('0x2c')][_0xbbe4('0x37')]+'%'};return _0x552711;}})});}_0x296569=_[_0xbbe4('0x36')]({},_0x296569,_0x167d05[_0xbbe4('0x38')]);var _0x35f16f={'where':_0x296569[_0xbbe4('0x35')]};return db[_0xbbe4('0x39')][_0xbbe4('0x1f')](_0x35f16f)[_0xbbe4('0x22')](function(_0x244343){_0x195029[_0xbbe4('0x1f')]=_0x244343;if(_0x167d05[_0xbbe4('0x2c')][_0xbbe4('0x3a')]){_0x296569[_0xbbe4('0x3b')]=[{'all':!![]}];}return db[_0xbbe4('0x39')]['findAll'](_0x296569);})[_0xbbe4('0x22')](function(_0x8250b2){_0x195029[_0xbbe4('0x3c')]=_0x8250b2;return _0x195029;})[_0xbbe4('0x22')](respondWithFilteredResult(_0x25aec7,_0x296569))[_0xbbe4('0x3d')](handleError(_0x25aec7,null));};exports[_0xbbe4('0x3e')]=function(_0x24aae5,_0x36b7c1){var _0x4b0eb4={'raw':![],'where':{'id':_0x24aae5[_0xbbe4('0x3f')]['id']}},_0x1dfcbd={};_0x1dfcbd[_0xbbe4('0x2b')]=_[_0xbbe4('0x2d')](db[_0xbbe4('0x39')][_0xbbe4('0x40')]);_0x1dfcbd[_0xbbe4('0x2c')]=_[_0xbbe4('0x2d')](_0x24aae5[_0xbbe4('0x2c')]);_0x1dfcbd['filters']=_[_0xbbe4('0x2f')](_0x1dfcbd['model'],_0x1dfcbd[_0xbbe4('0x2c')]);_0x4b0eb4['attributes']=_[_0xbbe4('0x2f')](_0x1dfcbd['model'],qs[_0xbbe4('0x31')](_0x24aae5[_0xbbe4('0x2c')]['fields']));_0x4b0eb4[_0xbbe4('0x30')]=_0x4b0eb4[_0xbbe4('0x30')]['length']?_0x4b0eb4[_0xbbe4('0x30')]:_0x1dfcbd[_0xbbe4('0x2b')];if(_0x24aae5[_0xbbe4('0x2c')][_0xbbe4('0x3a')]){_0x4b0eb4['include']=[{'all':!![]}];}_0x4b0eb4=_['merge']({},_0x4b0eb4,_0x24aae5['options']);return db[_0xbbe4('0x39')][_0xbbe4('0x41')](_0x4b0eb4)[_0xbbe4('0x22')](handleEntityNotFound(_0x36b7c1,null))[_0xbbe4('0x22')](respondWithResult(_0x36b7c1,null))['catch'](handleError(_0x36b7c1,null));};exports['create']=function(_0x59ab6d,_0x5d77e3){return db[_0xbbe4('0x39')]['create'](_0x59ab6d['body'],{})[_0xbbe4('0x22')](respondWithResult(_0x5d77e3,0xc9))[_0xbbe4('0x3d')](handleError(_0x5d77e3,null));};exports[_0xbbe4('0x42')]=function(_0x6eaadd,_0x34cf56){var _0x185a7e={'where':{'id':_0x6eaadd['params']['id']}},_0x3ed902={};_0x3ed902['model']=_[_0xbbe4('0x2d')](db['UserProfile'][_0xbbe4('0x40')]);_0x185a7e[_0xbbe4('0x30')]=_[_0xbbe4('0x2f')](_0x3ed902[_0xbbe4('0x2b')],qs[_0xbbe4('0x31')](_0x6eaadd[_0xbbe4('0x2c')]['fields']));_0x185a7e[_0xbbe4('0x30')]=_0x185a7e[_0xbbe4('0x30')][_0xbbe4('0x43')]?_0x185a7e['attributes']:_0x3ed902[_0xbbe4('0x2b')];if(_0x6eaadd[_0xbbe4('0x2c')][_0xbbe4('0x3a')]){_0x185a7e['include']=[{'all':!![]}];}_0x185a7e=_['merge']({},_0x185a7e,_0x6eaadd[_0xbbe4('0x38')]);return db[_0xbbe4('0x39')][_0xbbe4('0x41')](_0x185a7e)[_0xbbe4('0x22')](handleEntityNotFound(_0x34cf56,null))['then'](function(_0x14c7d4){if(_0x14c7d4){var _0x1d3b28=_0x14c7d4[_0xbbe4('0x44')]({'plain':!![]});_0x1d3b28=qs['omit'](_0x1d3b28,['id',_0xbbe4('0x45'),'updatedAt','crudPermissions']);_0x6eaadd[_0xbbe4('0x46')]=_[_0xbbe4('0x47')](_0x6eaadd[_0xbbe4('0x46')],['id',_0xbbe4('0x45'),'updatedAt']);return db[_0xbbe4('0x48')][_0xbbe4('0x49')](function(_0x2ca69f){return db['UserProfile']['create'](_[_0xbbe4('0x36')](_0x1d3b28,_0x6eaadd[_0xbbe4('0x46')]),{'include':_0x6eaadd[_0xbbe4('0x2c')][_0xbbe4('0x3a')]?[{'all':!![]}]:undefined,'transaction':_0x2ca69f})[_0xbbe4('0x22')](function(_0x138987){var _0x1eac75=_0x138987[_0xbbe4('0x44')]({'plain':!![]});return db['UserProfileSection'][_0xbbe4('0x4a')]({'where':{'userProfileId':_0x6eaadd[_0xbbe4('0x3f')]['id']},'raw':!![]})[_0xbbe4('0x22')](function(_0x35d470){if(_0x35d470){return BPromise['each'](_0x35d470,function(_0x2d54a1){return new BPromise(function(_0x37685d,_0x209370){if(_0x2d54a1['autoAssociation']===null||_0x2d54a1[_0xbbe4('0x4b')]===0x1)_0x37685d(null);return db[_0xbbe4('0x4c')]['findAll']({'where':{'sectionId':_0x2d54a1['id']},'raw':!![]})[_0xbbe4('0x22')](function(_0x2b10ec){var _0x154af8=_['map'](_0x2b10ec,function(_0x16921a){return qs['omit'](_0x16921a,['id',_0xbbe4('0x45'),'updatedAt','sectionId']);});_0x37685d(_0x154af8);})['catch'](function(_0xc3aad4){_0x209370(_0xc3aad4);});})[_0xbbe4('0x22')](function(_0x4627c4){var _0x2bdfc2=qs['omit'](_0x2d54a1,['id',_0xbbe4('0x45'),_0xbbe4('0x4d')]);_0x2bdfc2[_0xbbe4('0x4e')]=_0x1eac75['id'];if(_0x4627c4)_0x2bdfc2['Resources']=_0x4627c4;return _0x2bdfc2;})[_0xbbe4('0x22')](function(_0x46e54f){return db['UserProfileSection'][_0xbbe4('0x4f')](_0x46e54f,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x2ca69f});});})[_0xbbe4('0x22')](function(){return _0x1eac75;});}});});});}})[_0xbbe4('0x22')](respondWithResult(_0x34cf56,0xc9))[_0xbbe4('0x3d')](handleError(_0x34cf56,null));};exports[_0xbbe4('0x50')]=function(_0x537df1,_0x208b46){if(_0x537df1['body']['id']){delete _0x537df1['body']['id'];}return db[_0xbbe4('0x39')][_0xbbe4('0x41')]({'where':{'id':_0x537df1[_0xbbe4('0x3f')]['id']}})[_0xbbe4('0x22')](handleEntityNotFound(_0x208b46,null))[_0xbbe4('0x22')](saveUpdates(_0x537df1[_0xbbe4('0x46')],null))[_0xbbe4('0x22')](respondWithResult(_0x208b46,null))[_0xbbe4('0x3d')](handleError(_0x208b46,null));};exports[_0xbbe4('0x23')]=function(_0x2d48bd,_0x12d520){return db[_0xbbe4('0x39')]['find']({'where':{'id':_0x2d48bd[_0xbbe4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x12d520,null))[_0xbbe4('0x22')](removeEntity(_0x12d520,null))[_0xbbe4('0x3d')](handleError(_0x12d520,null));};exports[_0xbbe4('0x51')]=function(_0xd8df30,_0x4f1f1b){return db[_0xbbe4('0x39')][_0xbbe4('0x51')]()[_0xbbe4('0x22')](respondWithResult(_0x4f1f1b,null))['catch'](handleError(_0x4f1f1b,null));};exports['addSections']=function(_0x5d74a7,_0x44dc11){var _0x14e668=_0x5d74a7['body'];return db[_0xbbe4('0x39')][_0xbbe4('0x41')]({'where':{'id':_0x5d74a7['params']['id']}})[_0xbbe4('0x22')](handleEntityNotFound(_0x44dc11,null))[_0xbbe4('0x22')](function(_0x548594){if(_0x548594){return db[_0xbbe4('0x48')][_0xbbe4('0x49')](function(_0x3c9f31){return db[_0xbbe4('0x52')]['destroy']({'where':{'userProfileId':_0x5d74a7['params']['id'],'sectionId':_[_0xbbe4('0x28')](_0x14e668,function(_0x3d37fe){return _0x3d37fe[_0xbbe4('0x53')];})},'transaction':_0x3c9f31})[_0xbbe4('0x22')](function(){var _0x9820a=_[_0xbbe4('0x28')](_0x14e668,function(_0x39b472){_0x39b472['userProfileId']=_0x5d74a7[_0xbbe4('0x3f')]['id'];return _0x39b472;});var _0x140816=[];return BPromise[_0xbbe4('0x54')](_0x9820a,function(_0x3b9bf7){return db[_0xbbe4('0x52')][_0xbbe4('0x4f')](_0x3b9bf7,{'include':[{'model':db[_0xbbe4('0x4c')],'as':_0xbbe4('0x55')}],'raw':!![],'transaction':_0x3c9f31})['then'](function(_0xe07f82){_0x140816['push'](_0xe07f82[_0xbbe4('0x44')]({'plain':!![]}));});})[_0xbbe4('0x22')](function(){return _0x140816;});});});}})[_0xbbe4('0x22')](function(_0x5eeb4c){return _0x5eeb4c;})[_0xbbe4('0x22')](respondWithResult(_0x44dc11,null))[_0xbbe4('0x3d')](handleError(_0x44dc11,null));};exports[_0xbbe4('0x56')]=function(_0x231636,_0x1ce626){var _0x5aa497;return db['UserProfile'][_0xbbe4('0x41')]({'where':{'id':_0x231636[_0xbbe4('0x3f')]['id']},'attributes':['id',_0xbbe4('0x26')]})[_0xbbe4('0x22')](handleEntityNotFound(_0x1ce626,null))[_0xbbe4('0x22')](function(_0x3c4523){if(_0x3c4523){_0x5aa497=_0x3c4523;return db[_0xbbe4('0x52')][_0xbbe4('0x23')]({'where':{'userProfileId':_0x231636[_0xbbe4('0x3f')]['id'],'sectionId':_0x231636[_0xbbe4('0x2c')][_0xbbe4('0x57')]}});}})['then'](function(){return _0x5aa497;})[_0xbbe4('0x22')](respondWithStatusCode(_0x1ce626,null))[_0xbbe4('0x3d')](handleError(_0x1ce626,null));};exports['getSections']=function(_0x48baa4,_0x3f036c){var _0xdb2f42=[];var _0x3cc0f1=[];return db[_0xbbe4('0x52')][_0xbbe4('0x4a')]({'where':{'userProfileId':_0x48baa4['params']['id']},'raw':!![]})[_0xbbe4('0x22')](function(_0x4d8898){_0xdb2f42=_['filter'](_0x4d8898,function(_0x28398f){return _0x28398f[_0xbbe4('0x58')]===0x1||_[_0xbbe4('0x59')]([0x3eb,0x709],_0x28398f[_0xbbe4('0x53')]);});if(!_[_0xbbe4('0x5a')](_0xdb2f42)){return _[_0xbbe4('0x28')](_0xdb2f42,function(_0x331dd0){return _0x331dd0[_0xbbe4('0x53')];});}else{return;}})['then'](function(_0x1602fd){if(_0x1602fd)_0x3cc0f1=_0x1602fd;if(_[_0xbbe4('0x59')](_0x3cc0f1,0x64)){var _0x2f4435=_['find'](_0xdb2f42,{'sectionId':0x64});return hasDefaultDashboard(_0x2f4435)[_0xbbe4('0x22')](function(_0x5a1440){return _[_0xbbe4('0x28')](_0xdb2f42,function(_0x4d6572){if(_0x4d6572['sectionId']===0x64){_0x4d6572[_0xbbe4('0x5b')]=_0x5a1440;}return _0x4d6572;});});}else{return;}})[_0xbbe4('0x22')](function(_0x5360d1){if(_0x5360d1)_0xdb2f42=_0x5360d1;if(_[_0xbbe4('0x59')](_0x3cc0f1,0x3eb)){var _0x15f2d9=_[_0xbbe4('0x41')](_0xdb2f42,{'sectionId':0x3eb});return getCustomDashboards(_0x15f2d9)[_0xbbe4('0x22')](function(_0x3f7108){return _[_0xbbe4('0x28')](_0xdb2f42,function(_0x4aba3b){if(_0x15f2d9[_0xbbe4('0x58')]){if(_0x4aba3b['sectionId']===0x3eb){_0x4aba3b['subsections']=_0x3f7108;}}else{if(_0x4aba3b[_0xbbe4('0x53')]===0x64){if(!_0x4aba3b[_0xbbe4('0x5b')]){_0x4aba3b[_0xbbe4('0x5b')]=[];}_0x4aba3b[_0xbbe4('0x5b')]=_0x4aba3b[_0xbbe4('0x5b')]['concat'](_0x3f7108);}}return _0x4aba3b;});});}else{return;}})[_0xbbe4('0x22')](function(_0x3501c8){if(_0x3501c8)_0xdb2f42=_0x3501c8;if(_['includes'](_0x3cc0f1,0x709)){var _0x4758b4=_[_0xbbe4('0x41')](_0xdb2f42,{'sectionId':0x709});return getPlugins(_0x4758b4)[_0xbbe4('0x22')](function(_0x1755b5){if(_0x4758b4[_0xbbe4('0x58')]){return _[_0xbbe4('0x28')](_0xdb2f42,function(_0x53f8c6){if(_0x53f8c6[_0xbbe4('0x53')]===0x709){_0x53f8c6[_0xbbe4('0x5b')]=_0x1755b5;}return _0x53f8c6;});}else{var _0x30893e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1755b5};var _0x3b53ed=_['map'](_0xdb2f42);_0x3b53ed[_0xbbe4('0x5c')](_0x30893e);return _0x3b53ed;}});}else{return;}})[_0xbbe4('0x22')](function(_0xea656c){if(_0xea656c)_0xdb2f42=_0xea656c;return _[_0xbbe4('0x37')](_0xdb2f42,['enabled',0x1]);})['then'](respondWithResult(_0x3f036c,null))[_0xbbe4('0x3d')](handleError(_0x3f036c,null));};function hasDefaultDashboard(_0x78832f){var _0x9993d2=[0x65];return new BPromise(function(_0x4fba84,_0x24eb32){try{if(_0x78832f[_0xbbe4('0x4b')]){_0x4fba84(_0x9993d2);}else{return db[_0xbbe4('0x4c')]['findOne']({'where':{'sectionId':_0x78832f['id']},'raw':!![]})[_0xbbe4('0x22')](function(_0x42e6bc){_0x42e6bc?_0x4fba84(_0x9993d2):_0x4fba84();});}}catch(_0xd5ddb2){_0x24eb32(_0xd5ddb2);}});}function getCustomDashboards(_0x5bd266){var _0x325417=[];return new BPromise(function(_0x9a8e22,_0x18a3f9){try{if(_0x5bd266[_0xbbe4('0x4b')]){return db[_0xbbe4('0x5d')][_0xbbe4('0x4a')]({'raw':!![]})[_0xbbe4('0x22')](function(_0x12cb88){_0x12cb88[_0xbbe4('0x5e')](function(_0xc87a1d){_0x325417[_0xbbe4('0x5c')](_0xc87a1d['id']+0x1869f);});_0x9a8e22(_0x325417);});}else{return db[_0xbbe4('0x4c')][_0xbbe4('0x4a')]({'where':{'sectionId':_0x5bd266['id']},'raw':!![]})[_0xbbe4('0x22')](function(_0x3f24b1){_0x3f24b1[_0xbbe4('0x5e')](function(_0x284cb8){_0x325417[_0xbbe4('0x5c')](_0x284cb8['resourceId']+0x1869f);});_0x9a8e22(_0x325417);});}}catch(_0x233a82){_0x18a3f9(_0x233a82);}});}function getPlugins(_0x339784){var _0x2d0ddc=[];return new BPromise(function(_0xe2c1fc,_0x11610b){try{if(_0x339784[_0xbbe4('0x4b')]){return db[_0xbbe4('0x5f')][_0xbbe4('0x4a')]({'raw':!![]})['then'](function(_0x1eb48d){_0x1eb48d[_0xbbe4('0x5e')](function(_0x31f406){_0x2d0ddc[_0xbbe4('0x5c')](_0x31f406['id']+0x15b38);});_0xe2c1fc(_0x2d0ddc);});}else{return db['UserProfileResource'][_0xbbe4('0x4a')]({'where':{'sectionId':_0x339784['id']},'raw':!![]})['then'](function(_0x43b7df){_0x43b7df[_0xbbe4('0x5e')](function(_0x43be71){_0x2d0ddc['push'](_0x43be71[_0xbbe4('0x60')]+0x15b38);});_0xe2c1fc(_0x2d0ddc);});}}catch(_0x38d748){_0x11610b(_0x38d748);}});}exports[_0xbbe4('0x61')]=function(_0x1dee12,_0x5e84d3){return db[_0xbbe4('0x39')]['find']({'where':{'id':_0x1dee12[_0xbbe4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e84d3,null))[_0xbbe4('0x22')](function(_0x173205){if(_0x173205){return db[_0xbbe4('0x48')]['transaction'](function(_0x4e8afb){return db[_0xbbe4('0x52')][_0xbbe4('0x4a')]({'where':{'userProfileId':_0x1dee12[_0xbbe4('0x3f')]['id']},'attributes':['id'],'raw':!![]})[_0xbbe4('0x22')](function(_0x352d80){if(_0x352d80){return db[_0xbbe4('0x52')]['destroy']({'where':{'userProfileId':_0x1dee12['params']['id'],'id':_[_0xbbe4('0x28')](_0x352d80,function(_0x16567d){return _0x16567d['id'];})},'transaction':_0x4e8afb});}})[_0xbbe4('0x22')](function(_0x34ae08){var _0x552bc6=_[_0xbbe4('0x28')](_0x1dee12[_0xbbe4('0x46')],function(_0x392948){_0x392948[_0xbbe4('0x4e')]=_0x1dee12['params']['id'];return _0x392948;});return db[_0xbbe4('0x52')]['bulkCreate'](_0x552bc6,{'raw':!![],'transaction':_0x4e8afb});})[_0xbbe4('0x22')](function(_0x395800){var _0x427f77=_['filter'](_[_0xbbe4('0x28')](_0x395800,function(_0x3dd8b6){return _0x3dd8b6[_0xbbe4('0x44')]({'plain':!![]});}),{'includeAll':![]});if(_0x427f77){return db[_0xbbe4('0x52')][_0xbbe4('0x4a')]({'where':{'userProfileId':_0x1dee12[_0xbbe4('0x3f')]['id'],'sectionId':_[_0xbbe4('0x28')](_0x427f77,function(_0x7e279c){return _0x7e279c[_0xbbe4('0x53')];})},'attributes':['id',_0xbbe4('0x53')],'raw':!![]})[_0xbbe4('0x22')](function(_0x28e135){var _0x5c2686=_[_0xbbe4('0x28')](_0x1dee12['body'],function(_0x18232d){_0x18232d[_0xbbe4('0x4e')]=_0x1dee12[_0xbbe4('0x3f')]['id'];return _0x18232d;});return db['UserProfileResource'][_0xbbe4('0x62')](_0x5c2686,{'raw':!![],'transaction':_0x4e8afb});});}})[_0xbbe4('0x3d')](handleError(_0x5e84d3,null));});}})[_0xbbe4('0x22')](function(_0xac6a43){var _0x1b4651=_[_0xbbe4('0x28')](_0xac6a43,function(_0x4c33ee){return _0x4c33ee[_0xbbe4('0x44')]({'plain':!![]});});})[_0xbbe4('0x22')](respondWithResult(_0x5e84d3,null))[_0xbbe4('0x3d')](handleError(_0x5e84d3,null));};exports[_0xbbe4('0x63')]=function(_0x481a3d,_0x138bfd,_0x196226){return db[_0xbbe4('0x39')][_0xbbe4('0x41')]({'where':{'id':_0x481a3d['params']['id']}})[_0xbbe4('0x22')](handleEntityNotFound(_0x138bfd,null))[_0xbbe4('0x22')](function(_0x42adf8){if(_0x42adf8){return _0x42adf8['removeResources'](_0x481a3d[_0xbbe4('0x2c')][_0xbbe4('0x57')]);}})[_0xbbe4('0x22')](respondWithStatusCode(_0x138bfd,null))[_0xbbe4('0x3d')](handleError(_0x138bfd,null));};exports[_0xbbe4('0x64')]=function(_0x6d609f,_0xcd41e8){var _0x13661d={};if(!_0x6d609f[_0xbbe4('0x2c')][_0xbbe4('0x65')])throw new Error(_0xbbe4('0x66'));if(!_0x6d609f[_0xbbe4('0x2c')][_0xbbe4('0x32')]('nolimit')){_0x13661d[_0xbbe4('0x1e')]=qs[_0xbbe4('0x1e')](_0x6d609f[_0xbbe4('0x2c')][_0xbbe4('0x1e')]);_0x13661d['offset']=qs[_0xbbe4('0x1c')](_0x6d609f[_0xbbe4('0x2c')][_0xbbe4('0x1c')]);}return db['UserProfile'][_0xbbe4('0x41')]({'where':{'id':_0x6d609f['params']['id']}})[_0xbbe4('0x22')](function(_0x2ee788){if(!_0x2ee788)throw new Error(_0xbbe4('0x67')+_0x6d609f[_0xbbe4('0x3f')]['id']);return db[_0xbbe4('0x39')][_0xbbe4('0x64')](_0x6d609f);})['then'](respondWithFilteredResult(_0xcd41e8,_0x13661d))[_0xbbe4('0x3d')](handleError(_0xcd41e8,null));}; \ No newline at end of file +var _0xc86c=['register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','map','VIRTUAL','merge','UserProfile','include','rows','show','params','includeAll','find','catch','create','body','clone','get','omit','createdAt','crudPermissions','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','describe','addSections','sequelize','transaction','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x39035a,_0x584f29){var _0x3bbba0=function(_0x2cfa3d){while(--_0x2cfa3d){_0x39035a['push'](_0x39035a['shift']());}};_0x3bbba0(++_0x584f29);}(_0xc86c,0x138));var _0xcc86=function(_0xa032a7,_0x151608){_0xa032a7=_0xa032a7-0x0;var _0xde3d9d=_0xc86c[_0xa032a7];return _0xde3d9d;};'use strict';var emlformat=require(_0xcc86('0x0'));var rimraf=require(_0xcc86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc86('0x2'));var moment=require(_0xcc86('0x3'));var BPromise=require(_0xcc86('0x4'));var Mustache=require(_0xcc86('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcc86('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc86('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc86('0x8'));var jsforce=require(_0xcc86('0x9'));var deskjs=require(_0xcc86('0xa'));var toCsv=require(_0xcc86('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc86('0xc'));var authService=require(_0xcc86('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcc86('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc86('0xf'))(_0xcc86('0x10'));var utils=require('../../config/utils');var config=require(_0xcc86('0x11'));var licenseUtil=require(_0xcc86('0x12'));var db=require('../../mysqldb')['db'];config[_0xcc86('0x13')]=_[_0xcc86('0x14')](config['redis'],{'host':_0xcc86('0x15'),'port':0x18eb});var socket=require(_0xcc86('0x16'))(new Redis(config['redis']));require(_0xcc86('0x17'))[_0xcc86('0x18')](socket);function respondWithStatusCode(_0x5cd93e,_0x53e760){_0x53e760=_0x53e760||0xcc;return function(_0x443d23){if(_0x443d23){return _0x5cd93e[_0xcc86('0x19')](_0x53e760);}return _0x5cd93e[_0xcc86('0x1a')](_0x53e760)[_0xcc86('0x1b')]();};}function respondWithResult(_0x5ad280,_0x3b5cd2){_0x3b5cd2=_0x3b5cd2||0xc8;return function(_0x313cf4){if(_0x313cf4){return _0x5ad280[_0xcc86('0x1a')](_0x3b5cd2)[_0xcc86('0x1c')](_0x313cf4);}};}function respondWithFilteredResult(_0x4fae1a,_0x579768){return function(_0x4d17b5){if(_0x4d17b5){var _0xa2d9e8=typeof _0x579768['offset']===_0xcc86('0x1d')&&typeof _0x579768[_0xcc86('0x1e')]==='undefined';var _0x8f4fb3=_0x4d17b5[_0xcc86('0x1f')];var _0x4be30c=_0xa2d9e8?0x0:_0x579768[_0xcc86('0x20')];var _0xd6d881=_0xa2d9e8?_0x4d17b5[_0xcc86('0x1f')]:_0x579768[_0xcc86('0x20')]+_0x579768[_0xcc86('0x1e')];var _0x4ac4a7;if(_0xd6d881>=_0x8f4fb3){_0xd6d881=_0x8f4fb3;_0x4ac4a7=0xc8;}else{_0x4ac4a7=0xce;}_0x4fae1a[_0xcc86('0x1a')](_0x4ac4a7);return _0x4fae1a[_0xcc86('0x21')](_0xcc86('0x22'),_0x4be30c+'-'+_0xd6d881+'/'+_0x8f4fb3)[_0xcc86('0x1c')](_0x4d17b5);}return null;};}function patchUpdates(_0x3b3354){return function(_0x1faf8f){try{jsonpatch[_0xcc86('0x23')](_0x1faf8f,_0x3b3354,!![]);}catch(_0x37dfdf){return BPromise[_0xcc86('0x24')](_0x37dfdf);}return _0x1faf8f['save']();};}function saveUpdates(_0x15c695,_0x396ce8){return function(_0x1577f6){if(_0x1577f6){return _0x1577f6[_0xcc86('0x25')](_0x15c695)[_0xcc86('0x26')](function(_0x5c54bd){return _0x5c54bd;});}return null;};}function removeEntity(_0x1dbe96,_0x5cec28){return function(_0x36ad40){if(_0x36ad40){return _0x36ad40[_0xcc86('0x27')]()[_0xcc86('0x26')](function(){_0x1dbe96['status'](0xcc)[_0xcc86('0x1b')]();});}};}function handleEntityNotFound(_0x510c71,_0x1d1dfd){return function(_0x2c8bd7){if(!_0x2c8bd7){_0x510c71['sendStatus'](0x194);}return _0x2c8bd7;};}function handleError(_0x9238f0,_0x3bd6d8){_0x3bd6d8=_0x3bd6d8||0x1f4;return function(_0x44cabc){logger[_0xcc86('0x28')](_0x44cabc[_0xcc86('0x29')]);if(_0x44cabc[_0xcc86('0x2a')]){delete _0x44cabc['name'];}_0x9238f0[_0xcc86('0x1a')](_0x3bd6d8)[_0xcc86('0x2b')](_0x44cabc);};}exports[_0xcc86('0x2c')]=function(_0x2cfca0,_0x19bfc9){var _0x365f1f={},_0x1d4ce9={},_0xfd75ac={'count':0x0,'rows':[]};var _0x54ac84=_['map'](db['UserProfile'][_0xcc86('0x2d')],function(_0x28f102){return{'name':_0x28f102[_0xcc86('0x2e')],'type':_0x28f102[_0xcc86('0x2f')][_0xcc86('0x30')]};});_0x1d4ce9[_0xcc86('0x31')]=_['map'](_0x54ac84,_0xcc86('0x2a'));_0x1d4ce9['query']=_[_0xcc86('0x32')](_0x2cfca0[_0xcc86('0x33')]);_0x1d4ce9['filters']=_['intersection'](_0x1d4ce9[_0xcc86('0x31')],_0x1d4ce9[_0xcc86('0x33')]);_0x365f1f[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x1d4ce9[_0xcc86('0x31')],qs['fields'](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x36')]));_0x365f1f[_0xcc86('0x34')]=_0x365f1f[_0xcc86('0x34')][_0xcc86('0x37')]?_0x365f1f[_0xcc86('0x34')]:_0x1d4ce9['model'];if(!_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x38')]('nolimit')){_0x365f1f[_0xcc86('0x1e')]=qs[_0xcc86('0x1e')](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x1e')]);_0x365f1f[_0xcc86('0x20')]=qs[_0xcc86('0x20')](_0x2cfca0[_0xcc86('0x33')]['offset']);}_0x365f1f['order']=qs[_0xcc86('0x39')](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x39')]);_0x365f1f[_0xcc86('0x3a')]=qs[_0xcc86('0x3b')](_[_0xcc86('0x3c')](_0x2cfca0[_0xcc86('0x33')],_0x1d4ce9[_0xcc86('0x3b')]),_0x54ac84);if(_0x2cfca0['query'][_0xcc86('0x3d')]){_0x365f1f[_0xcc86('0x3a')]=_['merge'](_0x365f1f[_0xcc86('0x3a')],{'$or':_[_0xcc86('0x3e')](_0x54ac84,function(_0x1ee9e2){if(_0x1ee9e2[_0xcc86('0x2f')]!==_0xcc86('0x3f')){var _0x3c7aac={};_0x3c7aac[_0x1ee9e2['name']]={'$like':'%'+_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x3d')]+'%'};return _0x3c7aac;}})});}_0x365f1f=_[_0xcc86('0x40')]({},_0x365f1f,_0x2cfca0['options']);var _0x4197f6={'where':_0x365f1f['where']};return db[_0xcc86('0x41')][_0xcc86('0x1f')](_0x4197f6)['then'](function(_0x26c4d8){_0xfd75ac[_0xcc86('0x1f')]=_0x26c4d8;if(_0x2cfca0[_0xcc86('0x33')]['includeAll']){_0x365f1f[_0xcc86('0x42')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x365f1f);})['then'](function(_0x4737c6){_0xfd75ac[_0xcc86('0x43')]=_0x4737c6;return _0xfd75ac;})['then'](respondWithFilteredResult(_0x19bfc9,_0x365f1f))['catch'](handleError(_0x19bfc9,null));};exports[_0xcc86('0x44')]=function(_0x154a79,_0x419f75){var _0x4a693e={'raw':![],'where':{'id':_0x154a79[_0xcc86('0x45')]['id']}},_0x125cae={};_0x125cae['model']=_[_0xcc86('0x32')](db[_0xcc86('0x41')][_0xcc86('0x2d')]);_0x125cae[_0xcc86('0x33')]=_[_0xcc86('0x32')](_0x154a79[_0xcc86('0x33')]);_0x125cae[_0xcc86('0x3b')]=_[_0xcc86('0x35')](_0x125cae[_0xcc86('0x31')],_0x125cae[_0xcc86('0x33')]);_0x4a693e[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x125cae['model'],qs['fields'](_0x154a79[_0xcc86('0x33')][_0xcc86('0x36')]));_0x4a693e[_0xcc86('0x34')]=_0x4a693e['attributes'][_0xcc86('0x37')]?_0x4a693e[_0xcc86('0x34')]:_0x125cae[_0xcc86('0x31')];if(_0x154a79[_0xcc86('0x33')][_0xcc86('0x46')]){_0x4a693e[_0xcc86('0x42')]=[{'all':!![]}];}_0x4a693e=_[_0xcc86('0x40')]({},_0x4a693e,_0x154a79['options']);return db[_0xcc86('0x41')][_0xcc86('0x47')](_0x4a693e)[_0xcc86('0x26')](handleEntityNotFound(_0x419f75,null))[_0xcc86('0x26')](respondWithResult(_0x419f75,null))[_0xcc86('0x48')](handleError(_0x419f75,null));};exports[_0xcc86('0x49')]=function(_0xaea323,_0x23558c){return db[_0xcc86('0x41')]['create'](_0xaea323[_0xcc86('0x4a')],{})['then'](respondWithResult(_0x23558c,0xc9))['catch'](handleError(_0x23558c,null));};exports[_0xcc86('0x4b')]=function(_0x13440f,_0x1466ce){var _0x1e7f86={'where':{'id':_0x13440f[_0xcc86('0x45')]['id']}},_0x1a0e0c={};_0x1a0e0c[_0xcc86('0x31')]=_[_0xcc86('0x32')](db[_0xcc86('0x41')]['rawAttributes']);_0x1e7f86[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x1a0e0c['model'],qs[_0xcc86('0x36')](_0x13440f[_0xcc86('0x33')][_0xcc86('0x36')]));_0x1e7f86[_0xcc86('0x34')]=_0x1e7f86[_0xcc86('0x34')][_0xcc86('0x37')]?_0x1e7f86[_0xcc86('0x34')]:_0x1a0e0c[_0xcc86('0x31')];if(_0x13440f[_0xcc86('0x33')]['includeAll']){_0x1e7f86[_0xcc86('0x42')]=[{'all':!![]}];}_0x1e7f86=_['merge']({},_0x1e7f86,_0x13440f['options']);return db['UserProfile'][_0xcc86('0x47')](_0x1e7f86)[_0xcc86('0x26')](handleEntityNotFound(_0x1466ce,null))[_0xcc86('0x26')](function(_0x2f5547){if(_0x2f5547){var _0x7d6acc=_0x2f5547[_0xcc86('0x4c')]({'plain':!![]});_0x7d6acc=qs[_0xcc86('0x4d')](_0x7d6acc,['id',_0xcc86('0x4e'),'updatedAt',_0xcc86('0x4f')]);_0x13440f[_0xcc86('0x4a')]=_['omit'](_0x13440f[_0xcc86('0x4a')],['id','createdAt','updatedAt']);return db['sequelize']['transaction'](function(_0xc403d2){return db[_0xcc86('0x41')][_0xcc86('0x49')](_[_0xcc86('0x40')](_0x7d6acc,_0x13440f[_0xcc86('0x4a')]),{'include':_0x13440f[_0xcc86('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xc403d2})[_0xcc86('0x26')](function(_0x82ea4a){var _0x240cb9=_0x82ea4a['get']({'plain':!![]});return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x13440f[_0xcc86('0x45')]['id']},'raw':!![]})['then'](function(_0x478843){if(_0x478843){return BPromise[_0xcc86('0x52')](_0x478843,function(_0x55417e){return new BPromise(function(_0x3a6a83,_0x21b9f3){if(_0x55417e[_0xcc86('0x53')]===null||_0x55417e['autoAssociation']===0x1)_0x3a6a83(null);return db[_0xcc86('0x54')][_0xcc86('0x51')]({'where':{'sectionId':_0x55417e['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x16d4e5){var _0x4c54a5=_[_0xcc86('0x3e')](_0x16d4e5,function(_0x2d00df){return qs[_0xcc86('0x4d')](_0x2d00df,['id',_0xcc86('0x4e'),_0xcc86('0x55'),_0xcc86('0x56')]);});_0x3a6a83(_0x4c54a5);})['catch'](function(_0x12b1dd){_0x21b9f3(_0x12b1dd);});})['then'](function(_0x5cd4a2){var _0x36a7bf=qs[_0xcc86('0x4d')](_0x55417e,['id',_0xcc86('0x4e'),_0xcc86('0x55')]);_0x36a7bf[_0xcc86('0x57')]=_0x240cb9['id'];if(_0x5cd4a2)_0x36a7bf[_0xcc86('0x58')]=_0x5cd4a2;return _0x36a7bf;})[_0xcc86('0x26')](function(_0x280132){return db[_0xcc86('0x50')][_0xcc86('0x49')](_0x280132,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0xc403d2});});})[_0xcc86('0x26')](function(){return _0x240cb9;});}});});});}})[_0xcc86('0x26')](respondWithResult(_0x1466ce,0xc9))['catch'](handleError(_0x1466ce,null));};exports[_0xcc86('0x25')]=function(_0x54136f,_0x4af1cb){if(_0x54136f[_0xcc86('0x4a')]['id']){delete _0x54136f['body']['id'];}return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x54136f[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x4af1cb,null))[_0xcc86('0x26')](saveUpdates(_0x54136f[_0xcc86('0x4a')],null))['then'](respondWithResult(_0x4af1cb,null))['catch'](handleError(_0x4af1cb,null));};exports[_0xcc86('0x27')]=function(_0x45764e,_0x54404d){return db['UserProfile'][_0xcc86('0x47')]({'where':{'id':_0x45764e['params']['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x54404d,null))['then'](removeEntity(_0x54404d,null))[_0xcc86('0x48')](handleError(_0x54404d,null));};exports[_0xcc86('0x59')]=function(_0x452c8d,_0x42f0de){return db[_0xcc86('0x41')]['describe']()[_0xcc86('0x26')](respondWithResult(_0x42f0de,null))[_0xcc86('0x48')](handleError(_0x42f0de,null));};exports[_0xcc86('0x5a')]=function(_0x5c1dea,_0x27a327){var _0x31b921=_0x5c1dea[_0xcc86('0x4a')];return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x5c1dea[_0xcc86('0x45')]['id']}})['then'](handleEntityNotFound(_0x27a327,null))[_0xcc86('0x26')](function(_0x375482){if(_0x375482){return db[_0xcc86('0x5b')][_0xcc86('0x5c')](function(_0x436689){return db[_0xcc86('0x50')][_0xcc86('0x27')]({'where':{'userProfileId':_0x5c1dea[_0xcc86('0x45')]['id'],'sectionId':_[_0xcc86('0x3e')](_0x31b921,function(_0x19abc5){return _0x19abc5[_0xcc86('0x56')];})},'transaction':_0x436689})['then'](function(){var _0x34bcdc=_[_0xcc86('0x3e')](_0x31b921,function(_0x38aaf5){_0x38aaf5[_0xcc86('0x57')]=_0x5c1dea[_0xcc86('0x45')]['id'];return _0x38aaf5;});var _0x3375a9=[];return BPromise[_0xcc86('0x52')](_0x34bcdc,function(_0x7a60eb){return db['UserProfileSection']['create'](_0x7a60eb,{'include':[{'model':db[_0xcc86('0x54')],'as':_0xcc86('0x58')}],'raw':!![],'transaction':_0x436689})['then'](function(_0x497fac){_0x3375a9[_0xcc86('0x5d')](_0x497fac[_0xcc86('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x3375a9;});});});}})[_0xcc86('0x26')](function(_0x1552c0){return _0x1552c0;})[_0xcc86('0x26')](respondWithResult(_0x27a327,null))[_0xcc86('0x48')](handleError(_0x27a327,null));};exports[_0xcc86('0x5e')]=function(_0x29a783,_0x20001a){var _0x25a1cd;return db['UserProfile']['find']({'where':{'id':_0x29a783[_0xcc86('0x45')]['id']},'attributes':['id',_0xcc86('0x2a')]})[_0xcc86('0x26')](handleEntityNotFound(_0x20001a,null))[_0xcc86('0x26')](function(_0x2033bf){if(_0x2033bf){_0x25a1cd=_0x2033bf;return db['UserProfileSection'][_0xcc86('0x27')]({'where':{'userProfileId':_0x29a783[_0xcc86('0x45')]['id'],'sectionId':_0x29a783[_0xcc86('0x33')][_0xcc86('0x5f')]}});}})[_0xcc86('0x26')](function(){return _0x25a1cd;})[_0xcc86('0x26')](respondWithStatusCode(_0x20001a,null))[_0xcc86('0x48')](handleError(_0x20001a,null));};exports[_0xcc86('0x60')]=function(_0x528a67,_0x10572c){var _0x350404=[];var _0x11ace0=[];return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x528a67[_0xcc86('0x45')]['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x20590e){_0x350404=_[_0xcc86('0x3d')](_0x20590e,function(_0x57eb7f){return _0x57eb7f[_0xcc86('0x61')]===0x1||_[_0xcc86('0x62')]([0x3eb,0x709],_0x57eb7f[_0xcc86('0x56')]);});if(!_[_0xcc86('0x63')](_0x350404)){return _[_0xcc86('0x3e')](_0x350404,function(_0x4165d4){return _0x4165d4[_0xcc86('0x56')];});}else{return;}})[_0xcc86('0x26')](function(_0x4fba7c){if(_0x4fba7c)_0x11ace0=_0x4fba7c;if(_[_0xcc86('0x62')](_0x11ace0,0x64)){var _0xd20de=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x64});return hasDefaultDashboard(_0xd20de)['then'](function(_0x2cda84){return _[_0xcc86('0x3e')](_0x350404,function(_0x390e05){if(_0x390e05['sectionId']===0x64){_0x390e05['subsections']=_0x2cda84;}return _0x390e05;});});}else{return;}})[_0xcc86('0x26')](function(_0x3e291e){if(_0x3e291e)_0x350404=_0x3e291e;if(_['includes'](_0x11ace0,0x3eb)){var _0x1c4e89=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x3eb});return getCustomDashboards(_0x1c4e89)[_0xcc86('0x26')](function(_0x380476){return _['map'](_0x350404,function(_0x2676c5){if(_0x1c4e89[_0xcc86('0x61')]){if(_0x2676c5[_0xcc86('0x56')]===0x3eb){_0x2676c5['subsections']=_0x380476;}}else{if(_0x2676c5[_0xcc86('0x56')]===0x64){if(!_0x2676c5[_0xcc86('0x64')]){_0x2676c5[_0xcc86('0x64')]=[];}_0x2676c5['subsections']=_0x2676c5[_0xcc86('0x64')][_0xcc86('0x65')](_0x380476);}}return _0x2676c5;});});}else{return;}})[_0xcc86('0x26')](function(_0x41475c){if(_0x41475c)_0x350404=_0x41475c;if(_[_0xcc86('0x62')](_0x11ace0,0x709)){var _0x3fe5e6=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x709});return getPlugins(_0x3fe5e6)[_0xcc86('0x26')](function(_0x27b069){if(_0x3fe5e6[_0xcc86('0x61')]){return _[_0xcc86('0x3e')](_0x350404,function(_0x16d55f){if(_0x16d55f[_0xcc86('0x56')]===0x709){_0x16d55f[_0xcc86('0x64')]=_0x27b069;}return _0x16d55f;});}else{var _0x42cf48={'sectionId':0x76c,'enabled':0x1,'subsections':_0x27b069};var _0x4716b5=_[_0xcc86('0x3e')](_0x350404);_0x4716b5[_0xcc86('0x5d')](_0x42cf48);return _0x4716b5;}});}else{return;}})[_0xcc86('0x26')](function(_0x1d4e49){if(_0x1d4e49)_0x350404=_0x1d4e49;return _[_0xcc86('0x3d')](_0x350404,['enabled',0x1]);})[_0xcc86('0x26')](respondWithResult(_0x10572c,null))[_0xcc86('0x48')](handleError(_0x10572c,null));};function hasDefaultDashboard(_0x5561e0){var _0x11c68c=[0x65];return new BPromise(function(_0x10b414,_0x117fa6){try{if(_0x5561e0[_0xcc86('0x53')]){_0x10b414(_0x11c68c);}else{return db[_0xcc86('0x54')][_0xcc86('0x66')]({'where':{'sectionId':_0x5561e0['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x3fb903){_0x3fb903?_0x10b414(_0x11c68c):_0x10b414();});}}catch(_0x28288b){_0x117fa6(_0x28288b);}});}function getCustomDashboards(_0x2ddc1b){var _0x4cbf42=[];return new BPromise(function(_0x86b386,_0x249187){try{if(_0x2ddc1b['autoAssociation']){return db['Dashboard'][_0xcc86('0x51')]({'raw':!![]})['then'](function(_0x2f987c){_0x2f987c[_0xcc86('0x67')](function(_0x24e87c){_0x4cbf42[_0xcc86('0x5d')](_0x24e87c['id']+0x1869f);});_0x86b386(_0x4cbf42);});}else{return db[_0xcc86('0x54')][_0xcc86('0x51')]({'where':{'sectionId':_0x2ddc1b['id']},'raw':!![]})['then'](function(_0x2e6e3a){_0x2e6e3a[_0xcc86('0x67')](function(_0x6ee707){_0x4cbf42[_0xcc86('0x5d')](_0x6ee707[_0xcc86('0x68')]+0x1869f);});_0x86b386(_0x4cbf42);});}}catch(_0x3d7c8c){_0x249187(_0x3d7c8c);}});}function getPlugins(_0x233cd8){var _0x54c3af=[];return new BPromise(function(_0xfe85c4,_0x52b02a){try{if(_0x233cd8['autoAssociation']){return db['Plugin'][_0xcc86('0x51')]({'raw':!![]})['then'](function(_0x4930dd){_0x4930dd[_0xcc86('0x67')](function(_0x557326){_0x54c3af[_0xcc86('0x5d')](_0x557326['id']+0x15b38);});_0xfe85c4(_0x54c3af);});}else{return db['UserProfileResource'][_0xcc86('0x51')]({'where':{'sectionId':_0x233cd8['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x196302){_0x196302[_0xcc86('0x67')](function(_0x2da7bf){_0x54c3af[_0xcc86('0x5d')](_0x2da7bf[_0xcc86('0x68')]+0x15b38);});_0xfe85c4(_0x54c3af);});}}catch(_0x471a73){_0x52b02a(_0x471a73);}});}exports[_0xcc86('0x69')]=function(_0x374adf,_0x17c618){return db['UserProfile'][_0xcc86('0x47')]({'where':{'id':_0x374adf[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x17c618,null))[_0xcc86('0x26')](function(_0x5798bc){if(_0x5798bc){return db[_0xcc86('0x5b')][_0xcc86('0x5c')](function(_0x2932e5){return db[_0xcc86('0x50')]['findAll']({'where':{'userProfileId':_0x374adf['params']['id']},'attributes':['id'],'raw':!![]})[_0xcc86('0x26')](function(_0x51b911){if(_0x51b911){return db['UserProfileSection'][_0xcc86('0x27')]({'where':{'userProfileId':_0x374adf[_0xcc86('0x45')]['id'],'id':_['map'](_0x51b911,function(_0x3f2285){return _0x3f2285['id'];})},'transaction':_0x2932e5});}})[_0xcc86('0x26')](function(_0x4d8826){var _0x55c70e=_[_0xcc86('0x3e')](_0x374adf['body'],function(_0x1bbe7b){_0x1bbe7b[_0xcc86('0x57')]=_0x374adf[_0xcc86('0x45')]['id'];return _0x1bbe7b;});return db[_0xcc86('0x50')][_0xcc86('0x6a')](_0x55c70e,{'raw':!![],'transaction':_0x2932e5});})[_0xcc86('0x26')](function(_0x41f057){var _0x4d748e=_[_0xcc86('0x3d')](_['map'](_0x41f057,function(_0x801724){return _0x801724[_0xcc86('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x4d748e){return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x374adf[_0xcc86('0x45')]['id'],'sectionId':_[_0xcc86('0x3e')](_0x4d748e,function(_0x202e9b){return _0x202e9b[_0xcc86('0x56')];})},'attributes':['id',_0xcc86('0x56')],'raw':!![]})[_0xcc86('0x26')](function(_0xfbefa5){var _0x47c0b9=_[_0xcc86('0x3e')](_0x374adf[_0xcc86('0x4a')],function(_0x56627e){_0x56627e[_0xcc86('0x57')]=_0x374adf['params']['id'];return _0x56627e;});return db[_0xcc86('0x54')][_0xcc86('0x6a')](_0x47c0b9,{'raw':!![],'transaction':_0x2932e5});});}})['catch'](handleError(_0x17c618,null));});}})[_0xcc86('0x26')](function(_0x2bb960){var _0x54346e=_['map'](_0x2bb960,function(_0x5b2ab4){return _0x5b2ab4[_0xcc86('0x4c')]({'plain':!![]});});})[_0xcc86('0x26')](respondWithResult(_0x17c618,null))[_0xcc86('0x48')](handleError(_0x17c618,null));};exports[_0xcc86('0x6b')]=function(_0x4645f9,_0x54be67,_0x361d16){return db['UserProfile']['find']({'where':{'id':_0x4645f9[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x54be67,null))[_0xcc86('0x26')](function(_0x508299){if(_0x508299){return _0x508299[_0xcc86('0x6b')](_0x4645f9[_0xcc86('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x54be67,null))[_0xcc86('0x48')](handleError(_0x54be67,null));};exports[_0xcc86('0x6c')]=function(_0x29ee2a,_0x1e8589){var _0x2a080c={};if(!_0x29ee2a['query']['section'])throw new Error(_0xcc86('0x6d'));if(!_0x29ee2a['query'][_0xcc86('0x38')](_0xcc86('0x6e'))){_0x2a080c[_0xcc86('0x1e')]=qs[_0xcc86('0x1e')](_0x29ee2a[_0xcc86('0x33')]['limit']);_0x2a080c['offset']=qs[_0xcc86('0x20')](_0x29ee2a[_0xcc86('0x33')][_0xcc86('0x20')]);}return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x29ee2a['params']['id']}})[_0xcc86('0x26')](function(_0x39d9c6){if(!_0x39d9c6)throw new Error(_0xcc86('0x6f')+_0x29ee2a[_0xcc86('0x45')]['id']);return db['UserProfile'][_0xcc86('0x6c')](_0x29ee2a);})['then'](respondWithFilteredResult(_0x1e8589,_0x2a080c))['catch'](handleError(_0x1e8589,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b759da0..fd22131 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 _0xeda7=['../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xeda7,0x196));var _0x7eda=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0xeda7[_0x12ca5f];return _0xfc3ae9;};'use strict';var EventEmitter=require(_0x7eda('0x0'));var UserProfile=require(_0x7eda('0x1'))['db'][_0x7eda('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7eda('0x3')](0x0);var events={'afterCreate':_0x7eda('0x4'),'afterUpdate':_0x7eda('0x5'),'afterDestroy':_0x7eda('0x6')};function emitEvent(_0x2b1d21){return function(_0x324a25,_0x36a9f1,_0x15856b){UserProfileEvents[_0x7eda('0x7')](_0x2b1d21+':'+_0x324a25['id'],_0x324a25);UserProfileEvents[_0x7eda('0x7')](_0x2b1d21,_0x324a25);_0x15856b(null);};}for(var e in events){if(events[_0x7eda('0x8')](e)){var event=events[e];UserProfile[_0x7eda('0x9')](e,emitEvent(event));}}module[_0x7eda('0xa')]=UserProfileEvents; \ No newline at end of file +var _0x1298=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x1298,0x19e));var _0x8129=function(_0x1e76a1,_0x300c05){_0x1e76a1=_0x1e76a1-0x0;var _0x4a3307=_0x1298[_0x1e76a1];return _0x4a3307;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8129('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8129('0x1')](0x0);var events={'afterCreate':_0x8129('0x2'),'afterUpdate':_0x8129('0x3'),'afterDestroy':_0x8129('0x4')};function emitEvent(_0x6031b2){return function(_0x31d02a,_0x39e214,_0x4fbaf9){UserProfileEvents[_0x8129('0x5')](_0x6031b2+':'+_0x31d02a['id'],_0x31d02a);UserProfileEvents[_0x8129('0x5')](_0x6031b2,_0x31d02a);_0x4fbaf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x8129('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8416b09..2eac0dd 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 _0xc9cc=['sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','Dashboard','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Template','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','ignore','isEmpty','autoAssociation','push','all','rawAttributes','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','squel','filter','value','findAll','then','associatedResources','map','field','model','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','agent','Telephones','User','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xc9cc,0x130));var _0xcc9c=function(_0x1ab1bf,_0x144262){_0x1ab1bf=_0x1ab1bf-0x0;var _0x2a00a5=_0xc9cc[_0x1ab1bf];return _0x2a00a5;};'use strict';var _=require(_0xcc9c('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require(_0xcc9c('0x1'));module['exports']=function(_0x16904f){var _0x175f9f=_0x16904f['models'];function _0x159963(_0x456e2f,_0x1d6e41){return new Promise(function(_0x50a8b0,_0x2e09be){if(!_0x1d6e41)return _0x50a8b0(null);var _0x2a0e31=_0x1d6e41[_0xcc9c('0x2')]?{[_0x1d6e41[_0xcc9c('0x2')]['field']]:_0x1d6e41[_0xcc9c('0x2')][_0xcc9c('0x3')]}:undefined;return _0x175f9f[_0x456e2f][_0xcc9c('0x4')]({'where':_0x2a0e31,'raw':!![]})[_0xcc9c('0x5')](function(_0x3abc8a){_0x1d6e41[_0xcc9c('0x6')]=_[_0xcc9c('0x7')](_0x3abc8a,'id');_0x50a8b0(_0x1d6e41);})['catch'](function(_0x2e04e6){_0x2e09be(_0x2e04e6);});});}function _0x5bc10f(_0xf980ce,_0x3478e2){return new Promise(function(_0x48ee60,_0xd9e786){var _0x1ecf68=_0xf980ce['filter']?{[_0xf980ce[_0xcc9c('0x2')][_0xcc9c('0x8')]]:_0xf980ce[_0xcc9c('0x2')][_0xcc9c('0x3')]}:undefined;return _0x175f9f[_0xf980ce[_0xcc9c('0x9')]][_0xcc9c('0x4')]({'where':_0x1ecf68,'raw':!![]})[_0xcc9c('0x5')](function(_0x46dde2){_0x3478e2[_0xcc9c('0x6')]=_[_0xcc9c('0x7')](_0x46dde2,function(_0x1b95e6){return _0x1b95e6[_0xcc9c('0xa')];});_0x48ee60(_0x3478e2);})[_0xcc9c('0xb')](function(_0xf2df02){_0xd9e786(_0xf2df02);});});}function _0x55b2d1(_0x38f3e1,_0x2b4024,_0x2a78e4){if(!_0x2b4024)return Promise[_0xcc9c('0xc')](null);return new Promise(function(_0x45ae0e,_0x3792f2){return _0x175f9f[_0xcc9c('0xd')][_0xcc9c('0x4')]({'where':{'sectionId':_0x2b4024['id']},'raw':!![]})[_0xcc9c('0x5')](function(_0xbcdab){if(_0x38f3e1[_0xcc9c('0x8')]&&_0x38f3e1[_0xcc9c('0x8')]!=='id'){_0x2b4024['associatedResources']=_[_0xcc9c('0x7')](_0xbcdab,function(_0xc5ffde){return _0xc5ffde[_0x38f3e1[_0xcc9c('0x8')]];});}else{if(_0x2a78e4===_0xcc9c('0xe')){_0x2b4024[_0xcc9c('0x6')]=_[_0xcc9c('0x7')](_0xbcdab,function(_0x354b82){return{'id':_0x354b82[_0xcc9c('0xf')],'type':_0x354b82[_0xcc9c('0x10')]};});}else{_0x2b4024[_0xcc9c('0x6')]=_['map'](_0xbcdab,function(_0x448a8c){return _0x448a8c[_0xcc9c('0xf')];});}}_0x45ae0e(_0x2b4024);})['catch'](function(_0x3e4c11){_0x3792f2(_0x3e4c11);});});}function _0x23a78a(_0x128ed8,_0x33ed11){var _0x281837={'parentSections':[]};switch(_0x128ed8[_0xcc9c('0x11')]()){case'squareprojects':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x13');break;case _0xcc9c('0x14'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x15');break;case _0xcc9c('0x16'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x17');_0x281837[_0xcc9c('0x18')]=[{'name':_0xcc9c('0x19'),'field':_0xcc9c('0xa'),'foreignKey':'projectName'}];break;case _0xcc9c('0x1a'):_0x281837[_0xcc9c('0x12')]='JscriptyProject';break;case'contacts':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x1b');_0x281837[_0xcc9c('0x18')]=[{'name':_0xcc9c('0x1c'),'field':'id','foreignKey':_0xcc9c('0x1d')}];break;case _0xcc9c('0x1e'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x1f');break;case _0xcc9c('0x20'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x21');break;case _0xcc9c('0x22'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x23');break;case _0xcc9c('0x24'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x25');break;case'chatwebsites':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x26');break;case _0xcc9c('0x27'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x28');break;case'faxaccounts':_0x281837['childModel']=_0xcc9c('0x29');break;case _0xcc9c('0x2a'):case _0xcc9c('0x2b'):case _0xcc9c('0x2c'):_0x281837['childModel']='VoiceExtension';break;case _0xcc9c('0x2d'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x2e');break;case _0xcc9c('0x2f'):_0x281837['childModel']=_0xcc9c('0x30');break;case _0xcc9c('0x31'):_0x281837['childModel']='VoiceRecording';_0x281837[_0xcc9c('0x18')]=[{'name':_0xcc9c('0x32'),'field':_0xcc9c('0xa'),'foreignKey':_0xcc9c('0x33'),'model':'User','filter':{'field':'role','value':[_0xcc9c('0x34')]}},{'name':_0xcc9c('0x35'),'field':_0xcc9c('0xa'),'foreignKey':_0xcc9c('0x33'),'model':_0xcc9c('0x36'),'filter':{'field':_0xcc9c('0x37'),'value':[_0xcc9c('0x38')]}},{'name':_0xcc9c('0x39'),'field':_0xcc9c('0xa'),'foreignKey':'queue','model':_0xcc9c('0x3a'),'filter':{'field':_0xcc9c('0x10'),'value':[_0xcc9c('0x3b')]}},{'name':_0xcc9c('0x3c'),'field':_0xcc9c('0xa'),'foreignKey':_0xcc9c('0x3d'),'model':_0xcc9c('0x3a'),'filter':{'field':_0xcc9c('0x10'),'value':[_0xcc9c('0x3e')]}}];break;case _0xcc9c('0x3f'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x40');break;case'chanspies':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x41');break;case _0xcc9c('0x42'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x43');break;case _0xcc9c('0x44'):_0x281837['childModel']=_0xcc9c('0x45');break;case'mailqueues':_0x281837[_0xcc9c('0x12')]='MailQueue';break;case _0xcc9c('0x46'):_0x281837[_0xcc9c('0x12')]='MailAccount';break;case _0xcc9c('0x47'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x48');break;case _0xcc9c('0x49'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x4a');break;case _0xcc9c('0x4b'):_0x281837['childModel']='OpenchannelAccount';break;case _0xcc9c('0x4c'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x4d');break;case'smsaccounts':_0x281837[_0xcc9c('0x12')]='SmsAccount';break;case _0xcc9c('0x4e'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x4f');break;case'whatsappaccounts':_0x281837[_0xcc9c('0x12')]='WhatsappAccount';break;case _0xcc9c('0x50'):_0x281837['childModel']=_0xcc9c('0x51');break;case _0xcc9c('0x52'):case _0xcc9c('0x53'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x3a');if(_0x33ed11){_0x281837[_0xcc9c('0x18')]=[{'name':'VoiceQueues'},{'name':_0xcc9c('0x3c')}];}break;case _0xcc9c('0x54'):case _0xcc9c('0x55'):case _0xcc9c('0x56'):_0x281837['childModel']='User';if(_0x33ed11){_0x281837['parentSections']=[{'name':_0xcc9c('0x57'),'filter':{'field':_0xcc9c('0x37'),'value':[_0xcc9c('0x58'),_0xcc9c('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':_0xcc9c('0x35')}];}break;case _0xcc9c('0x5a'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x5b');break;case _0xcc9c('0x5c'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x5d');break;case _0xcc9c('0x5e'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x5f');break;case _0xcc9c('0x60'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x61');break;case _0xcc9c('0x62'):_0x281837['childModel']=_0xcc9c('0x63');break;case _0xcc9c('0x64'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x65');break;case _0xcc9c('0x66'):_0x281837['childModel']=_0xcc9c('0x36');break;case'cannedanswers':_0x281837[_0xcc9c('0x12')]='CannedAnswer';break;case _0xcc9c('0x67'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x68');break;case'customdashboards':_0x281837['childModel']=_0xcc9c('0x69');break;case'intervals':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x6a');break;case'pauses':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x6b');break;case _0xcc9c('0x6c'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x6d');break;case _0xcc9c('0x6e'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x6f');break;case _0xcc9c('0x70'):_0x281837[_0xcc9c('0x12')]='Tag';break;case'templates':_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x71');break;case'triggers':_0x281837[_0xcc9c('0x12')]='Trigger';break;case _0xcc9c('0x72'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x73');break;case _0xcc9c('0x74'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0x75');break;case _0xcc9c('0x76'):_0x281837['childModel']=_0xcc9c('0x77');break;case _0xcc9c('0x78'):_0x281837[_0xcc9c('0x12')]=_0xcc9c('0xe');_0x281837[_0xcc9c('0x18')]=[{'name':_0xcc9c('0x79'),'field':'id','foreignKey':_0xcc9c('0x7a')}];break;case _0xcc9c('0x7b'):_0x281837[_0xcc9c('0x12')]='AnalyticMetric';break;}return _0x281837;}function _0x415fc6(_0x358857,_0x2bc8ff){var _0x10579e=_0x358857[_0xcc9c('0x7c')](0x0)[_0xcc9c('0x7d')]()+_0x358857[_0xcc9c('0x7e')](0x1);var _0x5dfde9={'type':_0x175f9f[_0xcc9c('0x7f')][_0xcc9c('0x80')][_0xcc9c('0x81')],'raw':!![]};return new Promise(function(_0x5ce505,_0x287ac4){var _0x53cab3=squel['select']()[_0xcc9c('0x8')](_0xcc9c('0x82')+_0x10579e+_0xcc9c('0x83'),'id')[_0xcc9c('0x8')](_0xcc9c('0x84'))[_0xcc9c('0x85')]('user_has_'+_0x358857+_0xcc9c('0x86'),'ui')[_0xcc9c('0x87')](_0xcc9c('0x88'),_0x2bc8ff['id']);return _0x175f9f[_0xcc9c('0x89')][_0xcc9c('0x8a')](_0x53cab3[_0xcc9c('0x8b')](),_0x5dfde9)[_0xcc9c('0x5')](function(_0x14d590){_0x2bc8ff[_0x10579e+_0xcc9c('0x8c')]=_0x14d590;_0x5ce505(_0x14d590);})[_0xcc9c('0xb')](function(_0x25c4a0){_0x287ac4(_0x25c4a0);});});}return _0x16904f[_0xcc9c('0x8d')](_0xcc9c('0x8e'),attributes,{'tableName':_0xcc9c('0x8f'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x56aff1){var _0x19614c={'raw':_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0x90')],'where':{}};var _0x139079={};var _0x48b63b={'count':0x0,'rows':[]};var _0x2adbfb=_0x56aff1[_0xcc9c('0x8a')]['section'];var _0x186d6e=_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0x91')]||![];var _0x2762d6=_0x23a78a(_0x2adbfb,_0x186d6e);if(!_0x2762d6['childModel'])throw new Error(_0xcc9c('0x92')+_0x2adbfb+'\x27');var _0x4ea591=[{'name':_0x2adbfb}];if(!_['isEmpty'](_0x2762d6['parentSections']))_0x4ea591=_0x2762d6[_0xcc9c('0x18')];var _0xda50c1=[];for(var _0x11ceff=0x0;_0x11ceff<_0x4ea591[_0xcc9c('0x93')];_0x11ceff++){_0xda50c1['push'](_0x175f9f[_0xcc9c('0x94')][_0xcc9c('0x95')]({'where':{'userProfileId':_0x56aff1[_0xcc9c('0x96')]['id'],'name':_0x4ea591[_0x11ceff][_0xcc9c('0xa')]},'raw':!![]}));}return Promise['all'](_0xda50c1)[_0xcc9c('0x5')](function(_0xbc9bd8){var _0x570cb1=_['filter'](_0xbc9bd8,function(_0x4db0ef){return _0x4db0ef?_0x4db0ef:undefined;});var _0x41942c=_[_0xcc9c('0x2')](_0x4ea591,[_0xcc9c('0x97'),!![]]);var _0xcf5137=_['isEmpty'](_0x570cb1)&&_[_0xcc9c('0x98')](_0x41942c)?null:_['union'](_0x41942c,_0x570cb1);if(!_0xcf5137)return null;var _0x417164=[];for(var _0x211f4e=0x0;_0x211f4e<_0xcf5137[_0xcc9c('0x93')];_0x211f4e++){var _0x23083b=_[_0xcc9c('0x95')](_0x4ea591,function(_0x56ce9d){return _0xcf5137[_0x211f4e]?_0x56ce9d['name']===_0xcf5137[_0x211f4e][_0xcc9c('0xa')]:null;});if(_0x23083b){if(_0xcf5137[_0x211f4e]['ignore']){_0x417164['push'](_0x159963(_0x2762d6[_0xcc9c('0x12')],_0xcf5137[_0x211f4e]));}else{if(!_0xcf5137[_0x211f4e][_0xcc9c('0x99')]){_0x417164[_0xcc9c('0x9a')](_0x55b2d1(_0x23083b,_0xcf5137[_0x211f4e],_0x2762d6[_0xcc9c('0x12')]));}else{if(_0x23083b[_0xcc9c('0x9')]){_0x417164[_0xcc9c('0x9a')](_0x5bc10f(_0x23083b,_0xcf5137[_0x211f4e]));}}}}}return Promise[_0xcc9c('0x9b')](_0x417164);})[_0xcc9c('0x5')](function(_0x12b8cb){var _0x2f4070=_0x12b8cb;var _0x335984=null;if(_0x2f4070){_0x335984=_0x2f4070[_0xcc9c('0x93')]===0x1?_0x2f4070[0x0]:null;}if(!_0x335984&&!_0x2f4070)return _0x48b63b;var _0x31138f=_0x175f9f[_0x2762d6[_0xcc9c('0x12')]][_0xcc9c('0x9c')];_0x139079[_0xcc9c('0x9')]=_[_0xcc9c('0x9d')](_0x31138f);_0x139079[_0xcc9c('0x8a')]=_[_0xcc9c('0x9d')](_0x56aff1[_0xcc9c('0x8a')]);_0x139079[_0xcc9c('0x9e')]=_['intersection'](_0x139079[_0xcc9c('0x9')],_0x139079[_0xcc9c('0x8a')]);_0x19614c[_0xcc9c('0x9f')]=_['intersection'](_0x139079[_0xcc9c('0x9')],qs[_0xcc9c('0xa0')](_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xa0')]));_0x19614c[_0xcc9c('0x9f')]=_0x19614c['attributes'][_0xcc9c('0x93')]?_0x19614c[_0xcc9c('0x9f')]:_0x139079[_0xcc9c('0x9')];if(!_0x56aff1['query'][_0xcc9c('0xa1')](_0xcc9c('0xa2'))){_0x19614c[_0xcc9c('0xa3')]=qs[_0xcc9c('0xa3')](_0x56aff1['query'][_0xcc9c('0xa3')]);_0x19614c['offset']=qs[_0xcc9c('0xa4')](_0x56aff1[_0xcc9c('0x8a')]['offset']);}_0x19614c[_0xcc9c('0xa5')]=qs['sort'](_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xa6')]);_0x19614c['where']=qs[_0xcc9c('0x9e')](_[_0xcc9c('0xa7')](_0x56aff1[_0xcc9c('0x8a')],_0x139079[_0xcc9c('0x9e')]));if(_0x56aff1[_0xcc9c('0x8a')]['filter']){_0x19614c[_0xcc9c('0x87')]=_['merge'](_0x19614c[_0xcc9c('0x87')],{'$or':_[_0xcc9c('0x7')](_0x31138f,function(_0x5c4e07){if(_0x5c4e07[_0xcc9c('0x10')][_0xcc9c('0xa8')]!==_0xcc9c('0xa9')){var _0x1bcd09={};_0x1bcd09[_0x5c4e07['field']]={'$like':'%'+_0x56aff1['query'][_0xcc9c('0x2')]+'%'};return _0x1bcd09;}})});}var _0x4861ab=[];var _0x2d7588=null;var _0x29f04b={};if(_0x335984){_0x2d7588=_[_0xcc9c('0x95')](_0x4ea591,[_0xcc9c('0xa'),_0x335984['name']]);if(_0x2d7588[_0xcc9c('0x8')]){_0x29f04b={};if(_0x2762d6['childModel']==='AnalyticExtractedReport'){_0x29f04b[_0x2d7588['foreignKey']]=_[_0xcc9c('0x7')](_0x335984[_0xcc9c('0x6')],'id');}else{_0x29f04b[_0x2d7588[_0xcc9c('0xaa')]]=_0x335984[_0xcc9c('0x6')];}_0x4861ab[_0xcc9c('0x9a')](_0x29f04b);}else{_0x19614c[_0xcc9c('0x87')]['id']=_0x335984['associatedResources'];}}else{for(var _0x199d98=0x0;_0x199d98<_0x2f4070[_0xcc9c('0x93')];_0x199d98++){_0x2d7588=_[_0xcc9c('0x95')](_0x4ea591,[_0xcc9c('0xa'),_0x2f4070[_0x199d98]['name']]);if(_0x2d7588[_0xcc9c('0x8')]){_0x29f04b={};_0x29f04b[_0x2d7588[_0xcc9c('0xaa')]]=_0x2f4070[_0x199d98][_0xcc9c('0x6')];_0x4861ab[_0xcc9c('0x9a')](_0x29f04b);}else{if(!_0x19614c[_0xcc9c('0x87')]['id'])_0x19614c[_0xcc9c('0x87')]['id']=[];_0x2f4070[_0x199d98][_0xcc9c('0x6')][_0xcc9c('0xab')](function(_0x40f722){_0x19614c[_0xcc9c('0x87')]['id']['push'](_0x40f722);});}}}if(!_['isEmpty'](_0x4861ab)){_0x19614c[_0xcc9c('0x87')]=_[_0xcc9c('0xac')](_0x19614c['where'],{'$and':{'$or':_0x4861ab}});}_0x19614c=_[_0xcc9c('0xac')]({},_0x19614c,_0x56aff1[_0xcc9c('0xad')]);if(_0x335984&&!_0x335984['autoAssociation']&&_0x2762d6['childModel']==='AnalyticExtractedReport'){if(_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xae')]){_0x19614c[_0xcc9c('0xaf')]=[{'all':!![]}];}return _0x175f9f[_0x2762d6['childModel']][_0xcc9c('0x4')](_0x19614c)[_0xcc9c('0x5')](function(_0x11c028){var _0x4905a0=[];_0x11c028[_0xcc9c('0xab')](function(_0x34698e){var _0x41860a;switch(_0x34698e[_0xcc9c('0xb0')]){case _0xcc9c('0xb1'):_0x41860a=_[_0xcc9c('0x95')](_0x335984['associatedResources'],function(_0x192f8f){return _0x192f8f['id']===_0x34698e['reportId']&&_0x192f8f[_0xcc9c('0x10')]===_0xcc9c('0xb2');});break;case _0xcc9c('0xb3'):_0x41860a=_[_0xcc9c('0x95')](_0x335984[_0xcc9c('0x6')],function(_0x29020b){return _0x29020b['id']===_0x34698e[_0xcc9c('0x7a')]&&_0x29020b['type']===_0xcc9c('0xb4');});break;}if(_0x41860a)_0x4905a0[_0xcc9c('0x9a')](_0x34698e);});_0x48b63b[_0xcc9c('0xb5')]=_0x4905a0[_0xcc9c('0x93')];_0x48b63b[_0xcc9c('0xb6')]=_0x4905a0;return _0x48b63b;});}else{if(!_[_0xcc9c('0x98')](_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb7')])){_0x19614c['where']['id']=_0x19614c[_0xcc9c('0x87')]['id']?_['intersection'](_0x19614c[_0xcc9c('0x87')]['id'],_0x56aff1[_0xcc9c('0x8a')]['ids']):_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb7')];if(_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb8')]){_0x19614c['order']=_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb8')];}}if(_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb9')]){_0x19614c[_0xcc9c('0x87')]=_[_0xcc9c('0xac')](_0x19614c[_0xcc9c('0x87')],{'$and':_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xb9')]});}return _0x175f9f[_0x2762d6['childModel']][_0xcc9c('0xb5')]({'where':_0x19614c[_0xcc9c('0x87')]})[_0xcc9c('0x5')](function(_0x3af2a5){_0x48b63b[_0xcc9c('0xb5')]=_0x3af2a5;if(_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xae')]){if(_0x2762d6[_0xcc9c('0x12')]==='CmContact'){_0x19614c[_0xcc9c('0xaf')]=[{'model':_0x175f9f[_0xcc9c('0xba')],'as':_0xcc9c('0xbb'),'attributes':['id','name',_0xcc9c('0xbc')],'required':_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xbd')]?!![]:![]},{'model':_0x175f9f[_0xcc9c('0xba')],'as':_0xcc9c('0xbe'),'attributes':['id',_0xcc9c('0xa'),_0xcc9c('0xbc')],'through':_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xbd')]?{'attributes':[],'where':{'TagId':_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xbd')]||undefined}}:{},'required':_0x56aff1['query'][_0xcc9c('0xbd')]?!![]:![]}];}else{_0x19614c[_0xcc9c('0xaf')]=[{'all':!![]}];}}return _0x175f9f[_0x2762d6['childModel']][_0xcc9c('0x4')](_0x19614c);})['then'](function(_0xfd2a25){_0x48b63b['rows']=_0xfd2a25;if(_0x2adbfb===_0xcc9c('0x32')&&_0x56aff1[_0xcc9c('0x8a')][_0xcc9c('0xbf')]===_0xcc9c('0xc0')){var _0x170d32=[];for(var _0x46b9e9=0x0;_0x46b9e9<_0x48b63b[_0xcc9c('0xb6')]['length'];_0x46b9e9++){_0x170d32['push'](_0x415fc6(_0xcc9c('0xc1'),_0x48b63b[_0xcc9c('0xb6')][_0x46b9e9][_0xcc9c('0xc2')]));_0x170d32['push'](_0x415fc6(_0xcc9c('0xc3'),_0x48b63b['rows'][_0x46b9e9]['dataValues']));_0x170d32[_0xcc9c('0x9a')](_0x415fc6(_0xcc9c('0xc4'),_0x48b63b[_0xcc9c('0xb6')][_0x46b9e9]['dataValues']));_0x170d32[_0xcc9c('0x9a')](_0x415fc6(_0xcc9c('0xc5'),_0x48b63b[_0xcc9c('0xb6')][_0x46b9e9][_0xcc9c('0xc2')]));_0x170d32[_0xcc9c('0x9a')](_0x415fc6(_0xcc9c('0xc6'),_0x48b63b[_0xcc9c('0xb6')][_0x46b9e9][_0xcc9c('0xc2')]));_0x170d32[_0xcc9c('0x9a')](_0x415fc6(_0xcc9c('0xc7'),_0x48b63b[_0xcc9c('0xb6')][_0x46b9e9][_0xcc9c('0xc2')]));}return Promise['all'](_0x170d32)[_0xcc9c('0x5')](function(){return _0x48b63b;});}return _0x48b63b;});}});}}});}; \ No newline at end of file +var _0x3f6c=['SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','sounds','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','ignore','union','autoAssociation','rawAttributes','model','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','pick','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','CustomReports','count','rows','ids','customSorting','merge','extraQueryConditions','CmContact','include','Tags','color','tag','ThroughTags','sms','dataValues','fax','mail','openchannel','whatsapp','all','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','catch','map','resolve','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts'];(function(_0x2be96e,_0x2da449){var _0xea13a=function(_0x289326){while(--_0x289326){_0x2be96e['push'](_0x2be96e['shift']());}};_0xea13a(++_0x2da449);}(_0x3f6c,0x70));var _0xc3f6=function(_0x56d8df,_0x3b748e){_0x56d8df=_0x56d8df-0x0;var _0x2876a7=_0x3f6c[_0x56d8df];return _0x2876a7;};'use strict';var _=require(_0xc3f6('0x0'));var attributes=require(_0xc3f6('0x1'));var qs=require(_0xc3f6('0x2'));var squel=require(_0xc3f6('0x3'));module[_0xc3f6('0x4')]=function(_0x292d91){var _0x5545a6=_0x292d91[_0xc3f6('0x5')];function _0x2dbb70(_0x8a73fd,_0x176f21){return new Promise(function(_0x46be22,_0x340978){if(!_0x176f21)return _0x46be22(null);var _0x1884e2=_0x176f21[_0xc3f6('0x6')]?{[_0x176f21['filter'][_0xc3f6('0x7')]]:_0x176f21[_0xc3f6('0x6')][_0xc3f6('0x8')]}:undefined;return _0x5545a6[_0x8a73fd][_0xc3f6('0x9')]({'where':_0x1884e2,'raw':!![]})[_0xc3f6('0xa')](function(_0x480f83){_0x176f21['associatedResources']=_['map'](_0x480f83,'id');_0x46be22(_0x176f21);})[_0xc3f6('0xb')](function(_0x4110c6){_0x340978(_0x4110c6);});});}function _0x5f54af(_0x5c17ef,_0x3a82d3){return new Promise(function(_0x3626c1,_0x7d3964){var _0x2b9486=_0x5c17ef[_0xc3f6('0x6')]?{[_0x5c17ef[_0xc3f6('0x6')]['field']]:_0x5c17ef[_0xc3f6('0x6')][_0xc3f6('0x8')]}:undefined;return _0x5545a6[_0x5c17ef['model']][_0xc3f6('0x9')]({'where':_0x2b9486,'raw':!![]})['then'](function(_0x56c052){_0x3a82d3['associatedResources']=_[_0xc3f6('0xc')](_0x56c052,function(_0x593d4a){return _0x593d4a['name'];});_0x3626c1(_0x3a82d3);})[_0xc3f6('0xb')](function(_0x4364c8){_0x7d3964(_0x4364c8);});});}function _0x424348(_0xeda05c,_0x26162a,_0x190298){if(!_0x26162a)return Promise[_0xc3f6('0xd')](null);return new Promise(function(_0x30ecca,_0x22a304){return _0x5545a6[_0xc3f6('0xe')][_0xc3f6('0x9')]({'where':{'sectionId':_0x26162a['id']},'raw':!![]})[_0xc3f6('0xa')](function(_0x43cbfe){if(_0xeda05c[_0xc3f6('0x7')]&&_0xeda05c[_0xc3f6('0x7')]!=='id'){_0x26162a[_0xc3f6('0xf')]=_[_0xc3f6('0xc')](_0x43cbfe,function(_0x1d477e){return _0x1d477e[_0xeda05c[_0xc3f6('0x7')]];});}else{if(_0x190298===_0xc3f6('0x10')){_0x26162a['associatedResources']=_['map'](_0x43cbfe,function(_0x21ffbe){return{'id':_0x21ffbe[_0xc3f6('0x11')],'type':_0x21ffbe[_0xc3f6('0x12')]};});}else{_0x26162a['associatedResources']=_[_0xc3f6('0xc')](_0x43cbfe,function(_0x9590e7){return _0x9590e7[_0xc3f6('0x11')];});}}_0x30ecca(_0x26162a);})[_0xc3f6('0xb')](function(_0x52b90a){_0x22a304(_0x52b90a);});});}function _0x4cad00(_0x46c2d9,_0x1cc6de){var _0x4084e3={'parentSections':[]};switch(_0x46c2d9['toLowerCase']()){case _0xc3f6('0x13'):_0x4084e3[_0xc3f6('0x14')]='SquareProject';break;case'odbc':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x15');break;case _0xc3f6('0x16'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x17');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x19'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x1b')}];break;case _0xc3f6('0x1c'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x1d');break;case'contacts':_0x4084e3[_0xc3f6('0x14')]='CmContact';_0x4084e3[_0xc3f6('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0xc3f6('0x1e')}];break;case _0xc3f6('0x1f'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x20');break;case _0xc3f6('0x21'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x22');break;case'globalcustomfields':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x23');break;case _0xc3f6('0x24'):_0x4084e3['childModel']=_0xc3f6('0x25');break;case _0xc3f6('0x26'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x27');break;case _0xc3f6('0x28'):_0x4084e3[_0xc3f6('0x14')]='FaxQueue';break;case _0xc3f6('0x29'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x2a');break;case _0xc3f6('0x2b'):case _0xc3f6('0x2c'):case _0xc3f6('0x2d'):_0x4084e3[_0xc3f6('0x14')]='VoiceExtension';break;case _0xc3f6('0x2e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x2f');break;case'voicemails':_0x4084e3[_0xc3f6('0x14')]='VoiceMail';break;case _0xc3f6('0x30'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x31');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x32'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x33'),'model':'User','filter':{'field':_0xc3f6('0x34'),'value':[_0xc3f6('0x35')]}},{'name':_0xc3f6('0x36'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x33'),'model':_0xc3f6('0x37'),'filter':{'field':_0xc3f6('0x34'),'value':['telephone']}},{'name':_0xc3f6('0x38'),'field':_0xc3f6('0x1a'),'foreignKey':'queue','model':_0xc3f6('0x39'),'filter':{'field':'type','value':[_0xc3f6('0x3a')]}},{'name':_0xc3f6('0x3b'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x3c'),'model':_0xc3f6('0x39'),'filter':{'field':_0xc3f6('0x12'),'value':[_0xc3f6('0x3d')]}}];break;case'musiconholds':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x3e');break;case _0xc3f6('0x3f'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x40');break;case'voiceprefixes':_0x4084e3[_0xc3f6('0x14')]='VoicePrefix';break;case _0xc3f6('0x41'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x42');break;case _0xc3f6('0x43'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x44');break;case _0xc3f6('0x45'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x46');break;case _0xc3f6('0x47'):_0x4084e3[_0xc3f6('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x48');break;case _0xc3f6('0x49'):_0x4084e3[_0xc3f6('0x14')]='OpenchannelAccount';break;case'smsqueues':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x4a');break;case _0xc3f6('0x4b'):_0x4084e3['childModel']=_0xc3f6('0x4c');break;case _0xc3f6('0x4d'):_0x4084e3[_0xc3f6('0x14')]='WhatsappQueue';break;case _0xc3f6('0x4e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x4f');break;case _0xc3f6('0x50'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x51');break;case _0xc3f6('0x52'):case _0xc3f6('0x53'):_0x4084e3[_0xc3f6('0x14')]='VoiceQueue';if(_0x1cc6de){_0x4084e3[_0xc3f6('0x18')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xc3f6('0x54'):case _0xc3f6('0x55'):case'telephones':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x37');if(_0x1cc6de){_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x56'),'filter':{'field':_0xc3f6('0x34'),'value':[_0xc3f6('0x57'),'user']},'ignore':!![]},{'name':_0xc3f6('0x32')},{'name':_0xc3f6('0x36')}];}break;case _0xc3f6('0x58'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x59');break;case _0xc3f6('0x5a'):_0x4084e3['childModel']=_0xc3f6('0x5b');break;case'freshdeskaccounts':_0x4084e3[_0xc3f6('0x14')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4084e3['childModel']=_0xc3f6('0x5c');break;case'deskaccounts':_0x4084e3['childModel']=_0xc3f6('0x5d');break;case _0xc3f6('0x5e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x5f');break;case _0xc3f6('0x60'):_0x4084e3['childModel']=_0xc3f6('0x37');break;case'cannedanswers':_0x4084e3[_0xc3f6('0x14')]='CannedAnswer';break;case _0xc3f6('0x61'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x62');break;case _0xc3f6('0x63'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x64');break;case'intervals':_0x4084e3[_0xc3f6('0x14')]='Interval';break;case _0xc3f6('0x65'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x66');break;case'scheduler':_0x4084e3[_0xc3f6('0x14')]='Schedule';break;case _0xc3f6('0x67'):_0x4084e3[_0xc3f6('0x14')]='Sound';break;case'tags':_0x4084e3['childModel']=_0xc3f6('0x68');break;case _0xc3f6('0x69'):_0x4084e3['childModel']=_0xc3f6('0x6a');break;case _0xc3f6('0x6b'):_0x4084e3['childModel']='Trigger';break;case _0xc3f6('0x6c'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x6d');break;case _0xc3f6('0x6e'):_0x4084e3['childModel']=_0xc3f6('0x6f');break;case _0xc3f6('0x70'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x71');break;case _0xc3f6('0x72'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x10');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x73'),'field':'id','foreignKey':_0xc3f6('0x74')}];break;case _0xc3f6('0x75'):_0x4084e3['childModel']=_0xc3f6('0x76');break;}return _0x4084e3;}function _0x609e7c(_0x2d07b5,_0x2d9fb5){var _0x52b14f=_0x2d07b5[_0xc3f6('0x77')](0x0)['toUpperCase']()+_0x2d07b5[_0xc3f6('0x78')](0x1);var _0x240468={'type':_0x5545a6['Sequelize'][_0xc3f6('0x79')][_0xc3f6('0x7a')],'raw':!![]};return new Promise(function(_0x38c7af,_0x4cc98c){var _0x10dba4=squel[_0xc3f6('0x7b')]()[_0xc3f6('0x7')]('ui.'+_0x52b14f+_0xc3f6('0x7c'),'id')[_0xc3f6('0x7')]('ui.createdAt')[_0xc3f6('0x7d')](_0xc3f6('0x7e')+_0x2d07b5+_0xc3f6('0x7f'),'ui')[_0xc3f6('0x80')](_0xc3f6('0x81'),_0x2d9fb5['id']);return _0x5545a6['sequelize'][_0xc3f6('0x82')](_0x10dba4[_0xc3f6('0x83')](),_0x240468)['then'](function(_0x185902){_0x2d9fb5[_0x52b14f+_0xc3f6('0x84')]=_0x185902;_0x38c7af(_0x185902);})['catch'](function(_0x341ad0){_0x4cc98c(_0x341ad0);});});}return _0x292d91[_0xc3f6('0x85')](_0xc3f6('0x86'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x49d2e0){var _0x4e8ac4={'raw':_0x49d2e0[_0xc3f6('0x82')]['raw'],'where':{}};var _0x566d53={};var _0xebea22={'count':0x0,'rows':[]};var _0x22b319=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x87')];var _0x30cc33=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x88')]||![];var _0x31b9df=_0x4cad00(_0x22b319,_0x30cc33);if(!_0x31b9df[_0xc3f6('0x14')])throw new Error(_0xc3f6('0x89')+_0x22b319+'\x27');var _0x3dd07b=[{'name':_0x22b319}];if(!_[_0xc3f6('0x8a')](_0x31b9df[_0xc3f6('0x18')]))_0x3dd07b=_0x31b9df['parentSections'];var _0x343069=[];for(var _0x2f6238=0x0;_0x2f6238<_0x3dd07b[_0xc3f6('0x8b')];_0x2f6238++){_0x343069[_0xc3f6('0x8c')](_0x5545a6[_0xc3f6('0x8d')][_0xc3f6('0x8e')]({'where':{'userProfileId':_0x49d2e0['params']['id'],'name':_0x3dd07b[_0x2f6238][_0xc3f6('0x1a')]},'raw':!![]}));}return Promise['all'](_0x343069)[_0xc3f6('0xa')](function(_0x35e59b){var _0x59800d=_[_0xc3f6('0x6')](_0x35e59b,function(_0x138df5){return _0x138df5?_0x138df5:undefined;});var _0x3151f6=_[_0xc3f6('0x6')](_0x3dd07b,[_0xc3f6('0x8f'),!![]]);var _0x5155b8=_[_0xc3f6('0x8a')](_0x59800d)&&_[_0xc3f6('0x8a')](_0x3151f6)?null:_[_0xc3f6('0x90')](_0x3151f6,_0x59800d);if(!_0x5155b8)return null;var _0x1d650f=[];for(var _0x234cdb=0x0;_0x234cdb<_0x5155b8[_0xc3f6('0x8b')];_0x234cdb++){var _0x3ac2e0=_[_0xc3f6('0x8e')](_0x3dd07b,function(_0x1b480c){return _0x5155b8[_0x234cdb]?_0x1b480c[_0xc3f6('0x1a')]===_0x5155b8[_0x234cdb]['name']:null;});if(_0x3ac2e0){if(_0x5155b8[_0x234cdb][_0xc3f6('0x8f')]){_0x1d650f[_0xc3f6('0x8c')](_0x2dbb70(_0x31b9df[_0xc3f6('0x14')],_0x5155b8[_0x234cdb]));}else{if(!_0x5155b8[_0x234cdb][_0xc3f6('0x91')]){_0x1d650f[_0xc3f6('0x8c')](_0x424348(_0x3ac2e0,_0x5155b8[_0x234cdb],_0x31b9df[_0xc3f6('0x14')]));}else{if(_0x3ac2e0['model']){_0x1d650f[_0xc3f6('0x8c')](_0x5f54af(_0x3ac2e0,_0x5155b8[_0x234cdb]));}}}}}return Promise['all'](_0x1d650f);})[_0xc3f6('0xa')](function(_0x3a10f1){var _0x3b4f3e=_0x3a10f1;var _0x33be51=null;if(_0x3b4f3e){_0x33be51=_0x3b4f3e[_0xc3f6('0x8b')]===0x1?_0x3b4f3e[0x0]:null;}if(!_0x33be51&&!_0x3b4f3e)return _0xebea22;var _0xba24a=_0x5545a6[_0x31b9df['childModel']][_0xc3f6('0x92')];_0x566d53[_0xc3f6('0x93')]=_[_0xc3f6('0x94')](_0xba24a);_0x566d53[_0xc3f6('0x82')]=_[_0xc3f6('0x94')](_0x49d2e0[_0xc3f6('0x82')]);_0x566d53[_0xc3f6('0x95')]=_[_0xc3f6('0x96')](_0x566d53[_0xc3f6('0x93')],_0x566d53[_0xc3f6('0x82')]);_0x4e8ac4[_0xc3f6('0x97')]=_[_0xc3f6('0x96')](_0x566d53[_0xc3f6('0x93')],qs['fields'](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x98')]));_0x4e8ac4[_0xc3f6('0x97')]=_0x4e8ac4[_0xc3f6('0x97')]['length']?_0x4e8ac4[_0xc3f6('0x97')]:_0x566d53[_0xc3f6('0x93')];if(!_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x99')](_0xc3f6('0x9a'))){_0x4e8ac4['limit']=qs[_0xc3f6('0x9b')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x9b')]);_0x4e8ac4['offset']=qs[_0xc3f6('0x9c')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x9c')]);}_0x4e8ac4[_0xc3f6('0x9d')]=qs['sort'](_0x49d2e0[_0xc3f6('0x82')]['sort']);_0x4e8ac4['where']=qs[_0xc3f6('0x95')](_[_0xc3f6('0x9e')](_0x49d2e0[_0xc3f6('0x82')],_0x566d53['filters']));if(_0x49d2e0[_0xc3f6('0x82')]['filter']){_0x4e8ac4[_0xc3f6('0x80')]=_['merge'](_0x4e8ac4[_0xc3f6('0x80')],{'$or':_[_0xc3f6('0xc')](_0xba24a,function(_0x428831){if(_0x428831[_0xc3f6('0x12')][_0xc3f6('0x9f')]!==_0xc3f6('0xa0')){var _0x23ef2b={};_0x23ef2b[_0x428831[_0xc3f6('0x7')]]={'$like':'%'+_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x6')]+'%'};return _0x23ef2b;}})});}var _0x30b28e=[];var _0x41914e=null;var _0x47c336={};if(_0x33be51){_0x41914e=_['find'](_0x3dd07b,['name',_0x33be51[_0xc3f6('0x1a')]]);if(_0x41914e[_0xc3f6('0x7')]){_0x47c336={};if(_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0x10')){_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_[_0xc3f6('0xc')](_0x33be51[_0xc3f6('0xf')],'id');}else{_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_0x33be51[_0xc3f6('0xf')];}_0x30b28e[_0xc3f6('0x8c')](_0x47c336);}else{_0x4e8ac4[_0xc3f6('0x80')]['id']=_0x33be51[_0xc3f6('0xf')];}}else{for(var _0x158deb=0x0;_0x158deb<_0x3b4f3e[_0xc3f6('0x8b')];_0x158deb++){_0x41914e=_['find'](_0x3dd07b,[_0xc3f6('0x1a'),_0x3b4f3e[_0x158deb][_0xc3f6('0x1a')]]);if(_0x41914e[_0xc3f6('0x7')]){_0x47c336={};_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_0x3b4f3e[_0x158deb][_0xc3f6('0xf')];_0x30b28e[_0xc3f6('0x8c')](_0x47c336);}else{if(!_0x4e8ac4[_0xc3f6('0x80')]['id'])_0x4e8ac4[_0xc3f6('0x80')]['id']=[];_0x3b4f3e[_0x158deb][_0xc3f6('0xf')][_0xc3f6('0xa2')](function(_0x26c00b){_0x4e8ac4['where']['id'][_0xc3f6('0x8c')](_0x26c00b);});}}}if(!_[_0xc3f6('0x8a')](_0x30b28e)){_0x4e8ac4[_0xc3f6('0x80')]=_['merge'](_0x4e8ac4['where'],{'$and':{'$or':_0x30b28e}});}_0x4e8ac4=_['merge']({},_0x4e8ac4,_0x49d2e0[_0xc3f6('0xa3')]);if(_0x33be51&&!_0x33be51[_0xc3f6('0x91')]&&_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0x10')){if(_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xa4')]){_0x4e8ac4['include']=[{'all':!![]}];}return _0x5545a6[_0x31b9df['childModel']]['findAll'](_0x4e8ac4)['then'](function(_0x2b0a97){var _0x511410=[];_0x2b0a97[_0xc3f6('0xa2')](function(_0x481db7){var _0x1b5690;switch(_0x481db7[_0xc3f6('0xa5')]){case _0xc3f6('0xa6'):_0x1b5690=_['find'](_0x33be51[_0xc3f6('0xf')],function(_0x36e3a5){return _0x36e3a5['id']===_0x481db7[_0xc3f6('0x74')]&&_0x36e3a5[_0xc3f6('0x12')]===_0xc3f6('0xa7');});break;case'custom':_0x1b5690=_[_0xc3f6('0x8e')](_0x33be51['associatedResources'],function(_0x198b95){return _0x198b95['id']===_0x481db7[_0xc3f6('0x74')]&&_0x198b95['type']===_0xc3f6('0xa8');});break;}if(_0x1b5690)_0x511410[_0xc3f6('0x8c')](_0x481db7);});_0xebea22[_0xc3f6('0xa9')]=_0x511410[_0xc3f6('0x8b')];_0xebea22[_0xc3f6('0xaa')]=_0x511410;return _0xebea22;});}else{if(!_[_0xc3f6('0x8a')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xab')])){_0x4e8ac4['where']['id']=_0x4e8ac4['where']['id']?_['intersection'](_0x4e8ac4[_0xc3f6('0x80')]['id'],_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xab')]):_0x49d2e0[_0xc3f6('0x82')]['ids'];if(_0x49d2e0[_0xc3f6('0x82')]['customSorting']){_0x4e8ac4[_0xc3f6('0x9d')]=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xac')];}}if(_0x49d2e0[_0xc3f6('0x82')]['extraQueryConditions']){_0x4e8ac4['where']=_[_0xc3f6('0xad')](_0x4e8ac4[_0xc3f6('0x80')],{'$and':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xae')]});}return _0x5545a6[_0x31b9df['childModel']][_0xc3f6('0xa9')]({'where':_0x4e8ac4[_0xc3f6('0x80')]})[_0xc3f6('0xa')](function(_0x4d4769){_0xebea22[_0xc3f6('0xa9')]=_0x4d4769;if(_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xa4')]){if(_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0xaf')){_0x4e8ac4[_0xc3f6('0xb0')]=[{'model':_0x5545a6[_0xc3f6('0x68')],'as':_0xc3f6('0xb1'),'attributes':['id',_0xc3f6('0x1a'),_0xc3f6('0xb2')],'required':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]?!![]:![]},{'model':_0x5545a6[_0xc3f6('0x68')],'as':_0xc3f6('0xb4'),'attributes':['id',_0xc3f6('0x1a'),_0xc3f6('0xb2')],'through':_0x49d2e0['query']['tag']?{'attributes':[],'where':{'TagId':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]||undefined}}:{},'required':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]?!![]:![]}];}else{_0x4e8ac4[_0xc3f6('0xb0')]=[{'all':!![]}];}}return _0x5545a6[_0x31b9df[_0xc3f6('0x14')]][_0xc3f6('0x9')](_0x4e8ac4);})[_0xc3f6('0xa')](function(_0x1ad6f3){_0xebea22[_0xc3f6('0xaa')]=_0x1ad6f3;if(_0x22b319===_0xc3f6('0x32')&&_0x49d2e0[_0xc3f6('0x82')]['openTabs']==='true'){var _0x534d71=[];for(var _0x5041a1=0x0;_0x5041a1<_0xebea22[_0xc3f6('0xaa')][_0xc3f6('0x8b')];_0x5041a1++){_0x534d71[_0xc3f6('0x8c')](_0x609e7c('chat',_0xebea22[_0xc3f6('0xaa')][_0x5041a1]['dataValues']));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb5'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb7'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb8'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1]['dataValues']));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb9'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71['push'](_0x609e7c(_0xc3f6('0xba'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));}return Promise[_0xc3f6('0xbb')](_0x534d71)[_0xc3f6('0xa')](function(){return _0xebea22;});}return _0xebea22;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index eee2f54..42eda3d 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 _0x9b09=['./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9b09,0x1ad));var _0x99b0=function(_0x466410,_0x4069d9){_0x466410=_0x466410-0x0;var _0x3d758e=_0x9b09[_0x466410];return _0x3d758e;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var moment=require('moment');var BPromise=require(_0x99b0('0x2'));var rs=require(_0x99b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99b0('0x5'))('rpc');var config=require(_0x99b0('0x6'));var jayson=require(_0x99b0('0x7'));var client=jayson['client'][_0x99b0('0x8')]({'port':0x232a});config[_0x99b0('0x9')]=_['defaults'](config[_0x99b0('0x9')],{'host':_0x99b0('0xa'),'port':0x18eb});var socket=require(_0x99b0('0xb'))(new Redis(config[_0x99b0('0x9')]));require(_0x99b0('0xc'))['register'](socket);function respondWithRpcPromise(_0x16bb51,_0x3ff7df,_0x23f567){return new BPromise(function(_0x443f52,_0xff8662){return client['request'](_0x16bb51,_0x23f567)[_0x99b0('0xd')](function(_0x263d8e){logger[_0x99b0('0xe')](_0x99b0('0xf'),_0x3ff7df,_0x99b0('0x10'));logger[_0x99b0('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3ff7df,_0x99b0('0x10'),JSON['stringify'](_0x263d8e));if(_0x263d8e[_0x99b0('0x12')]){if(_0x263d8e[_0x99b0('0x12')]['code']===0x1f4){logger['error'](_0x99b0('0xf'),_0x3ff7df,_0x263d8e[_0x99b0('0x12')][_0x99b0('0x13')]);return _0xff8662(_0x263d8e['error']['message']);}logger['error'](_0x99b0('0xf'),_0x3ff7df,_0x263d8e[_0x99b0('0x12')]['message']);return _0x443f52(_0x263d8e[_0x99b0('0x12')][_0x99b0('0x13')]);}else{logger[_0x99b0('0xe')](_0x99b0('0xf'),_0x3ff7df,_0x99b0('0x10'));_0x443f52(_0x263d8e[_0x99b0('0x14')][_0x99b0('0x13')]);}})['catch'](function(_0x1a2521){logger[_0x99b0('0x12')](_0x99b0('0xf'),_0x3ff7df,_0x1a2521);_0xff8662(_0x1a2521);});});} \ No newline at end of file +var _0xef4d=['then','info','request\x20sent','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x5c0349,_0xab2591){var _0x41ebcf=function(_0x2ba8d6){while(--_0x2ba8d6){_0x5c0349['push'](_0x5c0349['shift']());}};_0x41ebcf(++_0xab2591);}(_0xef4d,0x165));var _0xdef4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef4d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var moment=require(_0xdef4('0x2'));var BPromise=require(_0xdef4('0x3'));var rs=require(_0xdef4('0x4'));var fs=require('fs');var Redis=require(_0xdef4('0x5'));var db=require(_0xdef4('0x6'))['db'];var utils=require(_0xdef4('0x7'));var logger=require(_0xdef4('0x8'))(_0xdef4('0x9'));var config=require(_0xdef4('0xa'));var jayson=require(_0xdef4('0xb'));var client=jayson[_0xdef4('0xc')]['http']({'port':0x232a});config[_0xdef4('0xd')]=_[_0xdef4('0xe')](config[_0xdef4('0xd')],{'host':_0xdef4('0xf'),'port':0x18eb});var socket=require(_0xdef4('0x10'))(new Redis(config[_0xdef4('0xd')]));require(_0xdef4('0x11'))[_0xdef4('0x12')](socket);function respondWithRpcPromise(_0x3bec91,_0x537ca7,_0xde54d0){return new BPromise(function(_0x1a209a,_0x35c826){return client[_0xdef4('0x13')](_0x3bec91,_0xde54d0)[_0xdef4('0x14')](function(_0x26a9ac){logger[_0xdef4('0x15')]('UserProfile,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'),JSON['stringify'](_0x26a9ac));if(_0x26a9ac[_0xdef4('0x17')]){if(_0x26a9ac['error'][_0xdef4('0x18')]===0x1f4){logger[_0xdef4('0x17')](_0xdef4('0x19'),_0x537ca7,_0x26a9ac[_0xdef4('0x17')]['message']);return _0x35c826(_0x26a9ac[_0xdef4('0x17')]['message']);}logger[_0xdef4('0x17')](_0xdef4('0x19'),_0x537ca7,_0x26a9ac['error'][_0xdef4('0x1a')]);return _0x1a209a(_0x26a9ac[_0xdef4('0x17')][_0xdef4('0x1a')]);}else{logger[_0xdef4('0x15')]('UserProfile,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'));_0x1a209a(_0x26a9ac[_0xdef4('0x1b')][_0xdef4('0x1a')]);}})[_0xdef4('0x1c')](function(_0x246fc5){logger['error'](_0xdef4('0x19'),_0x537ca7,_0x246fc5);_0x35c826(_0x246fc5);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 6a638d7..2b89393 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 _0x1401=['./userProfile.events','save','update','emit','removeListener','register','userProfile:'];(function(_0x4d8b77,_0x1fa118){var _0x3c5723=function(_0x48bdc0){while(--_0x48bdc0){_0x4d8b77['push'](_0x4d8b77['shift']());}};_0x3c5723(++_0x1fa118);}(_0x1401,0xc4));var _0x1140=function(_0x4970ba,_0x401fdf){_0x4970ba=_0x4970ba-0x0;var _0x50a32b=_0x1401[_0x4970ba];return _0x50a32b;};'use strict';var UserProfileEvents=require(_0x1140('0x0'));var events=[_0x1140('0x1'),'remove',_0x1140('0x2')];function createListener(_0x2d037f,_0x242ff6){return function(_0x1f1d67){_0x242ff6[_0x1140('0x3')](_0x2d037f,_0x1f1d67);};}function removeListener(_0x54cc6f,_0x542c29){return function(){UserProfileEvents[_0x1140('0x4')](_0x54cc6f,_0x542c29);};}exports[_0x1140('0x5')]=function(_0x26071e){for(var _0xdf0708=0x0,_0x299b4f=events['length'];_0xdf0708<_0x299b4f;_0xdf0708++){var _0x5b0ba5=events[_0xdf0708];var _0x2bc8f4=createListener(_0x1140('0x6')+_0x5b0ba5,_0x26071e);UserProfileEvents['on'](_0x5b0ba5,_0x2bc8f4);}}; \ No newline at end of file +var _0x5f13=['update','emit','removeListener','length','userProfile:','./userProfile.events','remove'];(function(_0x58ef68,_0x3e1c69){var _0x3f275c=function(_0x4218c5){while(--_0x4218c5){_0x58ef68['push'](_0x58ef68['shift']());}};_0x3f275c(++_0x3e1c69);}(_0x5f13,0x67));var _0x35f1=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5f13[_0x29b609];return _0x54c952;};'use strict';var UserProfileEvents=require(_0x35f1('0x0'));var events=['save',_0x35f1('0x1'),_0x35f1('0x2')];function createListener(_0x51b08d,_0x58b8f7){return function(_0x27b743){_0x58b8f7[_0x35f1('0x3')](_0x51b08d,_0x27b743);};}function removeListener(_0x90b38b,_0x379e39){return function(){UserProfileEvents[_0x35f1('0x4')](_0x90b38b,_0x379e39);};}exports['register']=function(_0x5bfb27){for(var _0x327d59=0x0,_0x12dc4f=events[_0x35f1('0x5')];_0x327d59<_0x12dc4f;_0x327d59++){var _0x2a0390=events[_0x327d59];var _0x748208=createListener(_0x35f1('0x6')+_0x2a0390,_0x5bfb27);UserProfileEvents['on'](_0x2a0390,_0x748208);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 9884e47..779b153 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 _0xb29b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','/describe','describe','/:id','show','post','isAuthenticated','create','put','delete','exports','util'];(function(_0xe31165,_0x23cebf){var _0x3cd681=function(_0x5cfe54){while(--_0x5cfe54){_0xe31165['push'](_0xe31165['shift']());}};_0x3cd681(++_0x23cebf);}(_0xb29b,0x9f));var _0xbb29=function(_0x20e7e2,_0x1cf1ab){_0x20e7e2=_0x20e7e2-0x0;var _0x32fa33=_0xb29b[_0x20e7e2];return _0x32fa33;};'use strict';var multer=require('multer');var util=require(_0xbb29('0x0'));var path=require(_0xbb29('0x1'));var timeout=require(_0xbb29('0x2'));var express=require(_0xbb29('0x3'));var router=express[_0xbb29('0x4')]();var fs_extra=require(_0xbb29('0x5'));var auth=require(_0xbb29('0x6'));var interaction=require(_0xbb29('0x7'));var config=require('../../config/environment');var controller=require(_0xbb29('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbb29('0x9')](_0xbb29('0xa'),auth['isAuthenticated'](),controller[_0xbb29('0xb')]);router['get'](_0xbb29('0xc'),auth['isAuthenticated'](),controller[_0xbb29('0xd')]);router[_0xbb29('0xe')]('/',auth[_0xbb29('0xf')](),controller[_0xbb29('0x10')]);router[_0xbb29('0x11')](_0xbb29('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbb29('0x12')](_0xbb29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xbb29('0x13')]=router; \ No newline at end of file +var _0xee65=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id','post','create','put','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x123cd1,_0x48cb5a){var _0x4c13ee=function(_0x1204cb){while(--_0x1204cb){_0x123cd1['push'](_0x123cd1['shift']());}};_0x4c13ee(++_0x48cb5a);}(_0xee65,0x189));var _0x5ee6=function(_0x8843e2,_0x285e51){_0x8843e2=_0x8843e2-0x0;var _0x282649=_0xee65[_0x8843e2];return _0x282649;};'use strict';var multer=require(_0x5ee6('0x0'));var util=require(_0x5ee6('0x1'));var path=require(_0x5ee6('0x2'));var timeout=require(_0x5ee6('0x3'));var express=require(_0x5ee6('0x4'));var router=express[_0x5ee6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5ee6('0x6'));var interaction=require(_0x5ee6('0x7'));var config=require(_0x5ee6('0x8'));var controller=require(_0x5ee6('0x9'));router['get']('/',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0xb')]);router[_0x5ee6('0xc')]('/describe',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0xd')]);router['get'](_0x5ee6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5ee6('0xf')]('/',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0x10')]);router[_0x5ee6('0x11')](_0x5ee6('0xe'),auth[_0x5ee6('0xa')](),controller['update']);router['delete'](_0x5ee6('0xe'),auth[_0x5ee6('0xa')](),controller[_0x5ee6('0x12')]);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 e86b92c..11884a7 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 _0x655b=['STRING','sequelize'];(function(_0x478904,_0x5b3c5c){var _0x415cf2=function(_0x520a48){while(--_0x520a48){_0x478904['push'](_0x478904['shift']());}};_0x415cf2(++_0x5b3c5c);}(_0x655b,0xa1));var _0xb655=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x655b[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xb655('0x0'));module['exports']={'name':{'type':Sequelize[_0xb655('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xb655('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf372=['INTEGER','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf372,0x142));var _0x2f37=function(_0x363559,_0x37b6a3){_0x363559=_0x363559-0x0;var _0x2a8fad=_0xf372[_0x363559];return _0x2a8fad;};'use strict';var Sequelize=require('sequelize');module[_0x2f37('0x0')]={'name':{'type':Sequelize[_0x2f37('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2f37('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 5f1fae0..13e6ac2 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 _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1b964a,_0x40fdc2){var _0x2559fa=function(_0x1afe3e){while(--_0x1afe3e){_0x1b964a['push'](_0x1b964a['shift']());}};_0x2559fa(++_0x40fdc2);}(_0x430c,0x1a1));var _0xc430=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x430c[_0x2b55b5];return _0x103d28;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file +var _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x2ef4ba,_0x3871eb){var _0x1f61ee=function(_0x228bed){while(--_0x228bed){_0x2ef4ba['push'](_0x2ef4ba['shift']());}};_0x1f61ee(++_0x3871eb);}(_0xb016,0x159));var _0x6b01=function(_0x495a1b,_0x1e1304){_0x495a1b=_0x495a1b-0x0;var _0x282322=_0xb016[_0x495a1b];return _0x282322;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 41169b9..d348043 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 _0x22ef=['exports','define','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x456430,_0x536ce6){var _0x5ecde4=function(_0x485081){while(--_0x485081){_0x456430['push'](_0x456430['shift']());}};_0x5ecde4(++_0x536ce6);}(_0x22ef,0x1f4));var _0xf22e=function(_0x50fcd7,_0x217fac){_0x50fcd7=_0x50fcd7-0x0;var _0x243c98=_0x22ef[_0x50fcd7];return _0x243c98;};'use strict';var _=require(_0xf22e('0x0'));var util=require('util');var logger=require(_0xf22e('0x1'))('api');var moment=require(_0xf22e('0x2'));var BPromise=require(_0xf22e('0x3'));var rp=require(_0xf22e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf22e('0x5'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xf22e('0x6')]=function(_0x332c18,_0x4152dd){return _0x332c18[_0xf22e('0x7')]('UserProfileResource',attributes,{'tableName':_0xf22e('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf22e('0x9'),_0xf22e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e7b=['rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4320a7,_0x239a92){var _0x3700bf=function(_0x2c3db0){while(--_0x2c3db0){_0x4320a7['push'](_0x4320a7['shift']());}};_0x3700bf(++_0x239a92);}(_0x7e7b,0x159));var _0xb7e7=function(_0x43547f,_0x3bcdf5){_0x43547f=_0x43547f-0x0;var _0x926d88=_0x7e7b[_0x43547f];return _0x926d88;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var logger=require(_0xb7e7('0x2'))(_0xb7e7('0x3'));var moment=require(_0xb7e7('0x4'));var BPromise=require(_0xb7e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7e7('0x6'));var rimraf=require(_0xb7e7('0x7'));var config=require(_0xb7e7('0x8'));var attributes=require(_0xb7e7('0x9'));module[_0xb7e7('0xa')]=function(_0x5334ef,_0x2b2ed8){return _0x5334ef['define'](_0xb7e7('0xb'),attributes,{'tableName':_0xb7e7('0xc'),'paranoid':![],'indexes':[{'name':_0xb7e7('0xd'),'fields':[_0xb7e7('0xe'),_0xb7e7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6dafb21..b41bfce 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 _0xecca=['ioredis','../../config/logger','rpc','jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x1582f7,_0x44c34c){var _0x167111=function(_0x5e255f){while(--_0x5e255f){_0x1582f7['push'](_0x1582f7['shift']());}};_0x167111(++_0x44c34c);}(_0xecca,0x19f));var _0xaecc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xecca[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xaecc('0x0'));var util=require(_0xaecc('0x1'));var moment=require(_0xaecc('0x2'));var BPromise=require(_0xaecc('0x3'));var rs=require(_0xaecc('0x4'));var fs=require('fs');var Redis=require(_0xaecc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaecc('0x6'))(_0xaecc('0x7'));var config=require('../../config/environment');var jayson=require(_0xaecc('0x8'));var client=jayson[_0xaecc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d1b9,_0x1e1b31,_0x4f6da6){return new BPromise(function(_0x5ccd5d,_0x57e160){return client[_0xaecc('0xa')](_0x35d1b9,_0x4f6da6)[_0xaecc('0xb')](function(_0x598a7d){logger['info'](_0xaecc('0xc'),_0x1e1b31,'request\x20sent');logger[_0xaecc('0xd')](_0xaecc('0xe'),_0x1e1b31,_0xaecc('0xf'),JSON[_0xaecc('0x10')](_0x598a7d));if(_0x598a7d[_0xaecc('0x11')]){if(_0x598a7d[_0xaecc('0x11')][_0xaecc('0x12')]===0x1f4){logger['error'](_0xaecc('0xc'),_0x1e1b31,_0x598a7d['error'][_0xaecc('0x13')]);return _0x57e160(_0x598a7d['error'][_0xaecc('0x13')]);}logger[_0xaecc('0x11')](_0xaecc('0xc'),_0x1e1b31,_0x598a7d['error'][_0xaecc('0x13')]);return _0x5ccd5d(_0x598a7d[_0xaecc('0x11')][_0xaecc('0x13')]);}else{logger[_0xaecc('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x1e1b31,_0xaecc('0xf'));_0x5ccd5d(_0x598a7d['result']['message']);}})['catch'](function(_0x2495a3){logger[_0xaecc('0x11')](_0xaecc('0xc'),_0x1e1b31,_0x2495a3);_0x57e160(_0x2495a3);});});} \ No newline at end of file +var _0x76b8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x171262,_0x16bfae){var _0x1649f9=function(_0x1077e9){while(--_0x1077e9){_0x171262['push'](_0x171262['shift']());}};_0x1649f9(++_0x16bfae);}(_0x76b8,0x1b5));var _0x876b=function(_0x350396,_0x391ad2){_0x350396=_0x350396-0x0;var _0xf306b1=_0x76b8[_0x350396];return _0xf306b1;};'use strict';var _=require(_0x876b('0x0'));var util=require(_0x876b('0x1'));var moment=require(_0x876b('0x2'));var BPromise=require(_0x876b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x876b('0x4'));var db=require(_0x876b('0x5'))['db'];var utils=require(_0x876b('0x6'));var logger=require(_0x876b('0x7'))(_0x876b('0x8'));var config=require(_0x876b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x876b('0xa')][_0x876b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16d6f6,_0x193c96,_0x2eaa26){return new BPromise(function(_0x5e24c1,_0x4fe341){return client[_0x876b('0xc')](_0x16d6f6,_0x2eaa26)[_0x876b('0xd')](function(_0x370591){logger[_0x876b('0xe')](_0x876b('0xf'),_0x193c96,'request\x20sent');logger[_0x876b('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x193c96,_0x876b('0x11'),JSON[_0x876b('0x12')](_0x370591));if(_0x370591[_0x876b('0x13')]){if(_0x370591[_0x876b('0x13')][_0x876b('0x14')]===0x1f4){logger[_0x876b('0x13')](_0x876b('0xf'),_0x193c96,_0x370591[_0x876b('0x13')]['message']);return _0x4fe341(_0x370591['error']['message']);}logger['error'](_0x876b('0xf'),_0x193c96,_0x370591[_0x876b('0x13')][_0x876b('0x15')]);return _0x5e24c1(_0x370591[_0x876b('0x13')][_0x876b('0x15')]);}else{logger['info'](_0x876b('0xf'),_0x193c96,_0x876b('0x11'));_0x5e24c1(_0x370591[_0x876b('0x16')][_0x876b('0x15')]);}})['catch'](function(_0x5a2ed4){logger[_0x876b('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x193c96,_0x5a2ed4);_0x4fe341(_0x5a2ed4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 94bce41..a08b9e6 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 _0x2292=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x8feac2,_0x279327){var _0x541f98=function(_0x837a45){while(--_0x837a45){_0x8feac2['push'](_0x8feac2['shift']());}};_0x541f98(++_0x279327);}(_0x2292,0xdb));var _0x2229=function(_0x1e920c,_0x2e73de){_0x1e920c=_0x1e920c-0x0;var _0x347799=_0x2292[_0x1e920c];return _0x347799;};'use strict';var multer=require(_0x2229('0x0'));var util=require(_0x2229('0x1'));var path=require('path');var timeout=require(_0x2229('0x2'));var express=require(_0x2229('0x3'));var router=express['Router']();var fs_extra=require(_0x2229('0x4'));var auth=require(_0x2229('0x5'));var interaction=require(_0x2229('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x2229('0x7')]('/',auth[_0x2229('0x8')](),controller[_0x2229('0x9')]);router[_0x2229('0x7')]('/describe',auth[_0x2229('0x8')](),controller[_0x2229('0xa')]);router[_0x2229('0x7')]('/:id',auth[_0x2229('0x8')](),controller[_0x2229('0xb')]);router[_0x2229('0xc')]('/',auth[_0x2229('0x8')](),controller[_0x2229('0xd')]);router[_0x2229('0xe')](_0x2229('0xf'),auth[_0x2229('0x8')](),controller[_0x2229('0x10')]);router[_0x2229('0x11')](_0x2229('0xf'),auth[_0x2229('0x8')](),controller[_0x2229('0x12')]);module[_0x2229('0x13')]=router; \ No newline at end of file +var _0x984e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','create','delete','destroy','exports','multer','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x984e,0xd6));var _0xe984=function(_0x59f0af,_0x52ad87){_0x59f0af=_0x59f0af-0x0;var _0x47614f=_0x984e[_0x59f0af];return _0x47614f;};'use strict';var multer=require(_0xe984('0x0'));var util=require(_0xe984('0x1'));var path=require(_0xe984('0x2'));var timeout=require(_0xe984('0x3'));var express=require(_0xe984('0x4'));var router=express[_0xe984('0x5')]();var fs_extra=require(_0xe984('0x6'));var auth=require(_0xe984('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe984('0x8'));var controller=require('./userProfileSection.controller');router[_0xe984('0x9')]('/',auth[_0xe984('0xa')](),controller[_0xe984('0xb')]);router[_0xe984('0x9')]('/describe',auth[_0xe984('0xa')](),controller[_0xe984('0xc')]);router[_0xe984('0x9')](_0xe984('0xd'),auth[_0xe984('0xa')](),controller['show']);router['post']('/',auth[_0xe984('0xa')](),controller[_0xe984('0xe')]);router['put'](_0xe984('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe984('0xf')](_0xe984('0xd'),auth[_0xe984('0xa')](),controller[_0xe984('0x10')]);module[_0xe984('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 d142baa..e9c707b 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 _0xd4f4=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x207f8e,_0x416b9a){_0x207f8e=_0x207f8e-0x0;var _0x499e23=_0xd4f4[_0x207f8e];return _0x499e23;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'name':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d4f('0x2')],'set':function(_0x25087a){this[_0x4d4f('0x5')](_0x4d4f('0x6'),_0x25087a?_0x25087a['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x4d4f('0x7')](_0x4d4f('0x6'))[_0x4d4f('0x8')](''):[];}}}; \ No newline at end of file +var _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0972,0x64));var _0x2097=function(_0xd9a9a9,_0xc57d7f){_0xd9a9a9=_0xd9a9a9-0x0;var _0x40bbb0=_0x0972[_0xd9a9a9];return _0x40bbb0;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index af849ab..d8b7438 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 _0x63a7=['path','to-csv','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','UserProfileSection','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','keys','fields','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5c693b,_0x19502d){var _0x4fd6f4=function(_0x433f9b){while(--_0x433f9b){_0x5c693b['push'](_0x5c693b['shift']());}};_0x4fd6f4(++_0x19502d);}(_0x63a7,0x19c));var _0x763a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x63a7[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x763a('0x0'));var rimraf=require(_0x763a('0x1'));var zipdir=require(_0x763a('0x2'));var jsonpatch=require(_0x763a('0x3'));var rp=require(_0x763a('0x4'));var moment=require(_0x763a('0x5'));var BPromise=require(_0x763a('0x6'));var Mustache=require('mustache');var util=require(_0x763a('0x7'));var path=require(_0x763a('0x8'));var sox=require('sox');var csv=require(_0x763a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x763a('0xa'));var crypto=require('crypto');var jsforce=require(_0x763a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x763a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x763a('0xc'));var authService=require(_0x763a('0xd'));var qs=require(_0x763a('0xe'));var as=require(_0x763a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x763a('0x10'))(_0x763a('0x11'));var utils=require(_0x763a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x763a('0x13'));var db=require(_0x763a('0x14'))['db'];function respondWithStatusCode(_0x154747,_0x34b393){_0x34b393=_0x34b393||0xcc;return function(_0x519e6b){if(_0x519e6b){return _0x154747[_0x763a('0x15')](_0x34b393);}return _0x154747[_0x763a('0x16')](_0x34b393)[_0x763a('0x17')]();};}function respondWithResult(_0x193256,_0x31660d){_0x31660d=_0x31660d||0xc8;return function(_0x304a15){if(_0x304a15){return _0x193256[_0x763a('0x16')](_0x31660d)[_0x763a('0x18')](_0x304a15);}};}function respondWithFilteredResult(_0x271828,_0x30691c){return function(_0x154c40){if(_0x154c40){var _0x433248=typeof _0x30691c[_0x763a('0x19')]===_0x763a('0x1a')&&typeof _0x30691c[_0x763a('0x1b')]==='undefined';var _0x191e5c=_0x154c40[_0x763a('0x1c')];var _0x32bc87=_0x433248?0x0:_0x30691c[_0x763a('0x19')];var _0x38c3bb=_0x433248?_0x154c40[_0x763a('0x1c')]:_0x30691c[_0x763a('0x19')]+_0x30691c[_0x763a('0x1b')];var _0x2ff9be;if(_0x38c3bb>=_0x191e5c){_0x38c3bb=_0x191e5c;_0x2ff9be=0xc8;}else{_0x2ff9be=0xce;}_0x271828['status'](_0x2ff9be);return _0x271828[_0x763a('0x1d')]('Content-Range',_0x32bc87+'-'+_0x38c3bb+'/'+_0x191e5c)[_0x763a('0x18')](_0x154c40);}return null;};}function patchUpdates(_0x501a57){return function(_0x52dcda){try{jsonpatch['apply'](_0x52dcda,_0x501a57,!![]);}catch(_0x40f8a4){return BPromise[_0x763a('0x1e')](_0x40f8a4);}return _0x52dcda[_0x763a('0x1f')]();};}function saveUpdates(_0x2b5e06,_0x5a9fc2){return function(_0x4bc67c){if(_0x4bc67c){return _0x4bc67c[_0x763a('0x20')](_0x2b5e06)[_0x763a('0x21')](function(_0x1f192e){return _0x1f192e;});}return null;};}function removeEntity(_0x55b06d,_0x33e143){return function(_0x5a2837){if(_0x5a2837){return _0x5a2837['destroy']()[_0x763a('0x21')](function(){_0x55b06d[_0x763a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158be8,_0x36e3c9){return function(_0x4cfec1){if(!_0x4cfec1){_0x158be8[_0x763a('0x15')](0x194);}return _0x4cfec1;};}function handleError(_0x177027,_0x33d059){_0x33d059=_0x33d059||0x1f4;return function(_0x69d038){logger[_0x763a('0x22')](_0x69d038['stack']);if(_0x69d038['name']){delete _0x69d038[_0x763a('0x23')];}_0x177027[_0x763a('0x16')](_0x33d059)[_0x763a('0x24')](_0x69d038);};}exports['index']=function(_0x32e49f,_0x286b5c){var _0x1bb221={},_0x15f43c={},_0x2d225c={'count':0x0,'rows':[]};var _0x39a6a4=_['map'](db[_0x763a('0x25')][_0x763a('0x26')],function(_0x59b4ca){return{'name':_0x59b4ca[_0x763a('0x27')],'type':_0x59b4ca[_0x763a('0x28')][_0x763a('0x29')]};});_0x15f43c['model']=_[_0x763a('0x2a')](_0x39a6a4,_0x763a('0x23'));_0x15f43c['query']=_['keys'](_0x32e49f[_0x763a('0x2b')]);_0x15f43c[_0x763a('0x2c')]=_[_0x763a('0x2d')](_0x15f43c['model'],_0x15f43c[_0x763a('0x2b')]);_0x1bb221[_0x763a('0x2e')]=_[_0x763a('0x2d')](_0x15f43c[_0x763a('0x2f')],qs['fields'](_0x32e49f['query']['fields']));_0x1bb221[_0x763a('0x2e')]=_0x1bb221['attributes'][_0x763a('0x30')]?_0x1bb221[_0x763a('0x2e')]:_0x15f43c[_0x763a('0x2f')];if(!_0x32e49f['query']['hasOwnProperty'](_0x763a('0x31'))){_0x1bb221[_0x763a('0x1b')]=qs[_0x763a('0x1b')](_0x32e49f[_0x763a('0x2b')]['limit']);_0x1bb221[_0x763a('0x19')]=qs[_0x763a('0x19')](_0x32e49f['query']['offset']);}_0x1bb221[_0x763a('0x32')]=qs[_0x763a('0x33')](_0x32e49f['query']['sort']);_0x1bb221['where']=qs[_0x763a('0x2c')](_['pick'](_0x32e49f[_0x763a('0x2b')],_0x15f43c[_0x763a('0x2c')]),_0x39a6a4);if(_0x32e49f[_0x763a('0x2b')][_0x763a('0x34')]){_0x1bb221[_0x763a('0x35')]=_[_0x763a('0x36')](_0x1bb221['where'],{'$or':_[_0x763a('0x2a')](_0x39a6a4,function(_0xebdd89){if(_0xebdd89[_0x763a('0x28')]!==_0x763a('0x37')){var _0x4e683a={};_0x4e683a[_0xebdd89[_0x763a('0x23')]]={'$like':'%'+_0x32e49f[_0x763a('0x2b')][_0x763a('0x34')]+'%'};return _0x4e683a;}})});}_0x1bb221=_[_0x763a('0x36')]({},_0x1bb221,_0x32e49f[_0x763a('0x38')]);var _0x370b13={'where':_0x1bb221['where']};return db[_0x763a('0x25')]['count'](_0x370b13)[_0x763a('0x21')](function(_0x32e821){_0x2d225c[_0x763a('0x1c')]=_0x32e821;if(_0x32e49f['query']['includeAll']){_0x1bb221['include']=[{'all':!![]}];}return db[_0x763a('0x25')][_0x763a('0x39')](_0x1bb221);})[_0x763a('0x21')](function(_0x21c846){_0x2d225c[_0x763a('0x3a')]=_0x21c846;return _0x2d225c;})[_0x763a('0x21')](respondWithFilteredResult(_0x286b5c,_0x1bb221))[_0x763a('0x3b')](handleError(_0x286b5c,null));};exports[_0x763a('0x3c')]=function(_0x4f1159,_0x215f61){var _0x318ae6={'raw':![],'where':{'id':_0x4f1159['params']['id']}},_0x3f396b={};_0x3f396b[_0x763a('0x2f')]=_[_0x763a('0x3d')](db[_0x763a('0x25')]['rawAttributes']);_0x3f396b[_0x763a('0x2b')]=_[_0x763a('0x3d')](_0x4f1159[_0x763a('0x2b')]);_0x3f396b['filters']=_[_0x763a('0x2d')](_0x3f396b[_0x763a('0x2f')],_0x3f396b[_0x763a('0x2b')]);_0x318ae6[_0x763a('0x2e')]=_['intersection'](_0x3f396b[_0x763a('0x2f')],qs[_0x763a('0x3e')](_0x4f1159[_0x763a('0x2b')]['fields']));_0x318ae6[_0x763a('0x2e')]=_0x318ae6['attributes'][_0x763a('0x30')]?_0x318ae6[_0x763a('0x2e')]:_0x3f396b['model'];if(_0x4f1159[_0x763a('0x2b')]['includeAll']){_0x318ae6[_0x763a('0x3f')]=[{'all':!![]}];}_0x318ae6=_[_0x763a('0x36')]({},_0x318ae6,_0x4f1159[_0x763a('0x38')]);return db[_0x763a('0x25')][_0x763a('0x40')](_0x318ae6)[_0x763a('0x21')](handleEntityNotFound(_0x215f61,null))[_0x763a('0x21')](respondWithResult(_0x215f61,null))['catch'](handleError(_0x215f61,null));};exports[_0x763a('0x41')]=function(_0x13a5c9,_0x312c8c){return db['UserProfileSection'][_0x763a('0x41')](_0x13a5c9['body'],{})[_0x763a('0x21')](respondWithResult(_0x312c8c,0xc9))[_0x763a('0x3b')](handleError(_0x312c8c,null));};exports[_0x763a('0x20')]=function(_0x554873,_0x463233){if(_0x554873[_0x763a('0x42')]['id']){delete _0x554873['body']['id'];}return db[_0x763a('0x25')][_0x763a('0x40')]({'where':{'id':_0x554873[_0x763a('0x43')]['id']}})['then'](handleEntityNotFound(_0x463233,null))[_0x763a('0x21')](saveUpdates(_0x554873[_0x763a('0x42')],null))[_0x763a('0x21')](respondWithResult(_0x463233,null))['catch'](handleError(_0x463233,null));};exports[_0x763a('0x44')]=function(_0x4d39af,_0x3b303){return db[_0x763a('0x25')][_0x763a('0x40')]({'where':{'id':_0x4d39af[_0x763a('0x43')]['id']}})[_0x763a('0x21')](handleEntityNotFound(_0x3b303,null))[_0x763a('0x21')](removeEntity(_0x3b303,null))[_0x763a('0x3b')](handleError(_0x3b303,null));};exports[_0x763a('0x45')]=function(_0x1c5ca2,_0x306943){return db['UserProfileSection'][_0x763a('0x45')]()[_0x763a('0x21')](respondWithResult(_0x306943,null))[_0x763a('0x3b')](handleError(_0x306943,null));}; \ No newline at end of file +var _0xeb31=['where','filter','type','VIRTUAL','merge','options','includeAll','findAll','show','include','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xeb31,0xa8));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1eb3('0x0'));var rimraf=require(_0x1eb3('0x1'));var zipdir=require(_0x1eb3('0x2'));var jsonpatch=require(_0x1eb3('0x3'));var rp=require(_0x1eb3('0x4'));var moment=require('moment');var BPromise=require(_0x1eb3('0x5'));var Mustache=require(_0x1eb3('0x6'));var util=require(_0x1eb3('0x7'));var path=require(_0x1eb3('0x8'));var sox=require(_0x1eb3('0x9'));var csv=require(_0x1eb3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1eb3('0xb'));var _=require(_0x1eb3('0xc'));var squel=require(_0x1eb3('0xd'));var crypto=require(_0x1eb3('0xe'));var jsforce=require(_0x1eb3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1eb3('0xa'));var querystring=require(_0x1eb3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1eb3('0x11'));var qs=require(_0x1eb3('0x12'));var as=require(_0x1eb3('0x13'));var hardwareService=require(_0x1eb3('0x14'));var logger=require(_0x1eb3('0x15'))('api');var utils=require(_0x1eb3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1eb3('0x17'));var db=require(_0x1eb3('0x18'))['db'];function respondWithStatusCode(_0x3a0081,_0x5c848f){_0x5c848f=_0x5c848f||0xcc;return function(_0x2ff0cb){if(_0x2ff0cb){return _0x3a0081['sendStatus'](_0x5c848f);}return _0x3a0081['status'](_0x5c848f)[_0x1eb3('0x19')]();};}function respondWithResult(_0x7c996,_0x279e14){_0x279e14=_0x279e14||0xc8;return function(_0x327d54){if(_0x327d54){return _0x7c996['status'](_0x279e14)['json'](_0x327d54);}};}function respondWithFilteredResult(_0x333b4e,_0x114ee8){return function(_0x447fe3){if(_0x447fe3){var _0x51a7cb=typeof _0x114ee8[_0x1eb3('0x1a')]===_0x1eb3('0x1b')&&typeof _0x114ee8[_0x1eb3('0x1c')]===_0x1eb3('0x1b');var _0x1b62da=_0x447fe3[_0x1eb3('0x1d')];var _0x14e4b0=_0x51a7cb?0x0:_0x114ee8[_0x1eb3('0x1a')];var _0x50af9a=_0x51a7cb?_0x447fe3[_0x1eb3('0x1d')]:_0x114ee8[_0x1eb3('0x1a')]+_0x114ee8['limit'];var _0x359d50;if(_0x50af9a>=_0x1b62da){_0x50af9a=_0x1b62da;_0x359d50=0xc8;}else{_0x359d50=0xce;}_0x333b4e[_0x1eb3('0x1e')](_0x359d50);return _0x333b4e[_0x1eb3('0x1f')]('Content-Range',_0x14e4b0+'-'+_0x50af9a+'/'+_0x1b62da)[_0x1eb3('0x20')](_0x447fe3);}return null;};}function patchUpdates(_0x3c3d05){return function(_0xf32874){try{jsonpatch[_0x1eb3('0x21')](_0xf32874,_0x3c3d05,!![]);}catch(_0x6b8284){return BPromise[_0x1eb3('0x22')](_0x6b8284);}return _0xf32874[_0x1eb3('0x23')]();};}function saveUpdates(_0x84115d,_0x2f1ab5){return function(_0x4882a6){if(_0x4882a6){return _0x4882a6['update'](_0x84115d)[_0x1eb3('0x24')](function(_0x56bdc6){return _0x56bdc6;});}return null;};}function removeEntity(_0x47d7cd,_0x249911){return function(_0x4fe9ad){if(_0x4fe9ad){return _0x4fe9ad[_0x1eb3('0x25')]()['then'](function(){_0x47d7cd[_0x1eb3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352f6e,_0x5610a9){return function(_0x170404){if(!_0x170404){_0x352f6e['sendStatus'](0x194);}return _0x170404;};}function handleError(_0x37519a,_0x273511){_0x273511=_0x273511||0x1f4;return function(_0x19e387){logger[_0x1eb3('0x26')](_0x19e387[_0x1eb3('0x27')]);if(_0x19e387[_0x1eb3('0x28')]){delete _0x19e387[_0x1eb3('0x28')];}_0x37519a[_0x1eb3('0x1e')](_0x273511)[_0x1eb3('0x29')](_0x19e387);};}exports[_0x1eb3('0x2a')]=function(_0x173467,_0x444aa0){var _0x15c15b={},_0x2cff09={},_0x1437a8={'count':0x0,'rows':[]};var _0xa69da6=_[_0x1eb3('0x2b')](db[_0x1eb3('0x2c')][_0x1eb3('0x2d')],function(_0x2fc69c){return{'name':_0x2fc69c[_0x1eb3('0x2e')],'type':_0x2fc69c['type'][_0x1eb3('0x2f')]};});_0x2cff09[_0x1eb3('0x30')]=_['map'](_0xa69da6,_0x1eb3('0x28'));_0x2cff09[_0x1eb3('0x31')]=_[_0x1eb3('0x32')](_0x173467['query']);_0x2cff09[_0x1eb3('0x33')]=_[_0x1eb3('0x34')](_0x2cff09[_0x1eb3('0x30')],_0x2cff09[_0x1eb3('0x31')]);_0x15c15b[_0x1eb3('0x35')]=_[_0x1eb3('0x34')](_0x2cff09['model'],qs[_0x1eb3('0x36')](_0x173467[_0x1eb3('0x31')]['fields']));_0x15c15b[_0x1eb3('0x35')]=_0x15c15b['attributes'][_0x1eb3('0x37')]?_0x15c15b['attributes']:_0x2cff09[_0x1eb3('0x30')];if(!_0x173467[_0x1eb3('0x31')][_0x1eb3('0x38')](_0x1eb3('0x39'))){_0x15c15b[_0x1eb3('0x1c')]=qs[_0x1eb3('0x1c')](_0x173467[_0x1eb3('0x31')][_0x1eb3('0x1c')]);_0x15c15b['offset']=qs[_0x1eb3('0x1a')](_0x173467[_0x1eb3('0x31')][_0x1eb3('0x1a')]);}_0x15c15b[_0x1eb3('0x3a')]=qs[_0x1eb3('0x3b')](_0x173467[_0x1eb3('0x31')]['sort']);_0x15c15b[_0x1eb3('0x3c')]=qs[_0x1eb3('0x33')](_['pick'](_0x173467['query'],_0x2cff09[_0x1eb3('0x33')]),_0xa69da6);if(_0x173467[_0x1eb3('0x31')][_0x1eb3('0x3d')]){_0x15c15b[_0x1eb3('0x3c')]=_['merge'](_0x15c15b[_0x1eb3('0x3c')],{'$or':_['map'](_0xa69da6,function(_0x59266e){if(_0x59266e[_0x1eb3('0x3e')]!==_0x1eb3('0x3f')){var _0x32601f={};_0x32601f[_0x59266e['name']]={'$like':'%'+_0x173467[_0x1eb3('0x31')][_0x1eb3('0x3d')]+'%'};return _0x32601f;}})});}_0x15c15b=_[_0x1eb3('0x40')]({},_0x15c15b,_0x173467[_0x1eb3('0x41')]);var _0x54b4bf={'where':_0x15c15b[_0x1eb3('0x3c')]};return db[_0x1eb3('0x2c')][_0x1eb3('0x1d')](_0x54b4bf)[_0x1eb3('0x24')](function(_0x29d0ae){_0x1437a8[_0x1eb3('0x1d')]=_0x29d0ae;if(_0x173467[_0x1eb3('0x31')][_0x1eb3('0x42')]){_0x15c15b['include']=[{'all':!![]}];}return db[_0x1eb3('0x2c')][_0x1eb3('0x43')](_0x15c15b);})[_0x1eb3('0x24')](function(_0x23e73d){_0x1437a8['rows']=_0x23e73d;return _0x1437a8;})[_0x1eb3('0x24')](respondWithFilteredResult(_0x444aa0,_0x15c15b))['catch'](handleError(_0x444aa0,null));};exports[_0x1eb3('0x44')]=function(_0x50bc5e,_0x805a1e){var _0x5e7f91={'raw':![],'where':{'id':_0x50bc5e['params']['id']}},_0x55f8f4={};_0x55f8f4[_0x1eb3('0x30')]=_[_0x1eb3('0x32')](db[_0x1eb3('0x2c')][_0x1eb3('0x2d')]);_0x55f8f4['query']=_[_0x1eb3('0x32')](_0x50bc5e[_0x1eb3('0x31')]);_0x55f8f4[_0x1eb3('0x33')]=_[_0x1eb3('0x34')](_0x55f8f4[_0x1eb3('0x30')],_0x55f8f4[_0x1eb3('0x31')]);_0x5e7f91['attributes']=_['intersection'](_0x55f8f4[_0x1eb3('0x30')],qs[_0x1eb3('0x36')](_0x50bc5e['query']['fields']));_0x5e7f91[_0x1eb3('0x35')]=_0x5e7f91[_0x1eb3('0x35')]['length']?_0x5e7f91['attributes']:_0x55f8f4[_0x1eb3('0x30')];if(_0x50bc5e[_0x1eb3('0x31')][_0x1eb3('0x42')]){_0x5e7f91[_0x1eb3('0x45')]=[{'all':!![]}];}_0x5e7f91=_[_0x1eb3('0x40')]({},_0x5e7f91,_0x50bc5e['options']);return db[_0x1eb3('0x2c')][_0x1eb3('0x46')](_0x5e7f91)[_0x1eb3('0x24')](handleEntityNotFound(_0x805a1e,null))[_0x1eb3('0x24')](respondWithResult(_0x805a1e,null))['catch'](handleError(_0x805a1e,null));};exports[_0x1eb3('0x47')]=function(_0x5e05af,_0x3b5d02){return db[_0x1eb3('0x2c')][_0x1eb3('0x47')](_0x5e05af[_0x1eb3('0x48')],{})['then'](respondWithResult(_0x3b5d02,0xc9))[_0x1eb3('0x49')](handleError(_0x3b5d02,null));};exports['update']=function(_0x52595f,_0x3acafc){if(_0x52595f[_0x1eb3('0x48')]['id']){delete _0x52595f[_0x1eb3('0x48')]['id'];}return db[_0x1eb3('0x2c')][_0x1eb3('0x46')]({'where':{'id':_0x52595f['params']['id']}})[_0x1eb3('0x24')](handleEntityNotFound(_0x3acafc,null))[_0x1eb3('0x24')](saveUpdates(_0x52595f[_0x1eb3('0x48')],null))['then'](respondWithResult(_0x3acafc,null))['catch'](handleError(_0x3acafc,null));};exports[_0x1eb3('0x25')]=function(_0x4ad717,_0x1b7ca7){return db[_0x1eb3('0x2c')][_0x1eb3('0x46')]({'where':{'id':_0x4ad717[_0x1eb3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b7ca7,null))[_0x1eb3('0x24')](removeEntity(_0x1b7ca7,null))[_0x1eb3('0x49')](handleError(_0x1b7ca7,null));};exports[_0x1eb3('0x4b')]=function(_0x3b6cf9,_0x1e667c){return db[_0x1eb3('0x2c')]['describe']()[_0x1eb3('0x24')](respondWithResult(_0x1e667c,null))['catch'](handleError(_0x1e667c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 4fc313d..bd4d801 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 _0xff1f=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userProfileSection.attributes'];(function(_0x506b51,_0x2d2b6d){var _0xca5779=function(_0x5f0fcb){while(--_0x5f0fcb){_0x506b51['push'](_0x506b51['shift']());}};_0xca5779(++_0x2d2b6d);}(_0xff1f,0x133));var _0xfff1=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0xff1f[_0x12d951];return _0x44de17;};'use strict';var _=require('lodash');var util=require(_0xfff1('0x0'));var logger=require(_0xfff1('0x1'))(_0xfff1('0x2'));var moment=require(_0xfff1('0x3'));var BPromise=require('bluebird');var rp=require(_0xfff1('0x4'));var fs=require('fs');var path=require(_0xfff1('0x5'));var rimraf=require('rimraf');var config=require(_0xfff1('0x6'));var attributes=require(_0xfff1('0x7'));module[_0xfff1('0x8')]=function(_0x55a343,_0x1fe054){return _0x55a343[_0xfff1('0x9')](_0xfff1('0xa'),attributes,{'tableName':_0xfff1('0xb'),'paranoid':![],'indexes':[{'name':_0xfff1('0xc'),'fields':[_0xfff1('0xd'),_0xfff1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b3=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ad721,_0x4b7de5){var _0x52b183=function(_0x5f1e8c){while(--_0x5f1e8c){_0x3ad721['push'](_0x3ad721['shift']());}};_0x52b183(++_0x4b7de5);}(_0xa6b3,0x169));var _0x3a6b=function(_0x566bf8,_0x838332){_0x566bf8=_0x566bf8-0x0;var _0x3b008b=_0xa6b3[_0x566bf8];return _0x3b008b;};'use strict';var _=require(_0x3a6b('0x0'));var util=require(_0x3a6b('0x1'));var logger=require(_0x3a6b('0x2'))(_0x3a6b('0x3'));var moment=require(_0x3a6b('0x4'));var BPromise=require(_0x3a6b('0x5'));var rp=require(_0x3a6b('0x6'));var fs=require('fs');var path=require(_0x3a6b('0x7'));var rimraf=require(_0x3a6b('0x8'));var config=require(_0x3a6b('0x9'));var attributes=require(_0x3a6b('0xa'));module[_0x3a6b('0xb')]=function(_0x53cc8f,_0xc926a8){return _0x53cc8f[_0x3a6b('0xc')](_0x3a6b('0xd'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3a6b('0xe'),_0x3a6b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 3c412db..a4862cc 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 _0x444a=['message','catch','lodash','moment','../../config/utils','rpc','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xae5e3c,_0x1a07bf){var _0x5c87b8=function(_0x3e8143){while(--_0x3e8143){_0xae5e3c['push'](_0xae5e3c['shift']());}};_0x5c87b8(++_0x1a07bf);}(_0x444a,0xa2));var _0xa444=function(_0xdb357c,_0x3786b6){_0xdb357c=_0xdb357c-0x0;var _0x5c8735=_0x444a[_0xdb357c];return _0x5c8735;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require(_0xa444('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa444('0x2'));var logger=require('../../config/logger')(_0xa444('0x3'));var config=require('../../config/environment');var jayson=require(_0xa444('0x4'));var client=jayson['client'][_0xa444('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4dca8e,_0x4a5d68,_0x1b58b1){return new BPromise(function(_0x9dbb7f,_0x159357){return client[_0xa444('0x6')](_0x4dca8e,_0x1b58b1)[_0xa444('0x7')](function(_0x2c4c06){logger[_0xa444('0x8')](_0xa444('0x9'),_0x4a5d68,_0xa444('0xa'));logger['debug'](_0xa444('0xb'),_0x4a5d68,_0xa444('0xa'),JSON[_0xa444('0xc')](_0x2c4c06));if(_0x2c4c06['error']){if(_0x2c4c06['error']['code']===0x1f4){logger[_0xa444('0xd')](_0xa444('0x9'),_0x4a5d68,_0x2c4c06[_0xa444('0xd')]['message']);return _0x159357(_0x2c4c06['error'][_0xa444('0xe')]);}logger[_0xa444('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x4a5d68,_0x2c4c06[_0xa444('0xd')][_0xa444('0xe')]);return _0x9dbb7f(_0x2c4c06['error'][_0xa444('0xe')]);}else{logger['info'](_0xa444('0x9'),_0x4a5d68,_0xa444('0xa'));_0x9dbb7f(_0x2c4c06['result'][_0xa444('0xe')]);}})[_0xa444('0xf')](function(_0x5e34ea){logger[_0xa444('0xd')](_0xa444('0x9'),_0x4a5d68,_0x5e34ea);_0x159357(_0x5e34ea);});});} \ No newline at end of file +var _0x6da6=['request','then','info','UserProfileSection,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6da6,0xa5));var _0x66da=function(_0x442f4b,_0x42df36){_0x442f4b=_0x442f4b-0x0;var _0x29ff44=_0x6da6[_0x442f4b];return _0x29ff44;};'use strict';var _=require('lodash');var util=require(_0x66da('0x0'));var moment=require('moment');var BPromise=require(_0x66da('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66da('0x2'));var db=require(_0x66da('0x3'))['db'];var utils=require(_0x66da('0x4'));var logger=require(_0x66da('0x5'))(_0x66da('0x6'));var config=require(_0x66da('0x7'));var jayson=require(_0x66da('0x8'));var client=jayson[_0x66da('0x9')][_0x66da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4261be,_0x1143ef,_0x185850){return new BPromise(function(_0x4f2b81,_0x57b850){return client[_0x66da('0xb')](_0x4261be,_0x185850)[_0x66da('0xc')](function(_0x247afe){logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,'request\x20sent');logger[_0x66da('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1143ef,'request\x20sent',JSON['stringify'](_0x247afe));if(_0x247afe[_0x66da('0x10')]){if(_0x247afe['error'][_0x66da('0x11')]===0x1f4){logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe[_0x66da('0x10')]['message']);return _0x57b850(_0x247afe[_0x66da('0x10')][_0x66da('0x12')]);}logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe['error'][_0x66da('0x12')]);return _0x4f2b81(_0x247afe['error'][_0x66da('0x12')]);}else{logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,_0x66da('0x13'));_0x4f2b81(_0x247afe[_0x66da('0x14')][_0x66da('0x12')]);}})[_0x66da('0x15')](function(_0x2d9cc6){logger['error'](_0x66da('0xe'),_0x1143ef,_0x2d9cc6);_0x57b850(_0x2d9cc6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index b3676ed..cb2fd5c 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e758e,_0x157fa3){var _0x23840b=function(_0x54b1a8){while(--_0x54b1a8){_0x1e758e['push'](_0x1e758e['shift']());}};_0x23840b(++_0x157fa3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));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 9006424..a4d5a7b 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x41eb=['INTEGER','sequelize'];(function(_0x5ee58f,_0x2e864){var _0x20cb29=function(_0x1e3e43){while(--_0x1e3e43){_0x5ee58f['push'](_0x5ee58f['shift']());}};_0x20cb29(++_0x2e864);}(_0x41eb,0x7d));var _0xb41e=function(_0x1bd3ab,_0x352c42){_0x1bd3ab=_0x1bd3ab-0x0;var _0x37e394=_0x41eb[_0x1bd3ab];return _0x37e394;};'use strict';var Sequelize=require(_0xb41e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb41e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 193e21c..3f50b35 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 _0xe785=['util','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x38e5cd,_0x2ebc35){var _0x141ddc=function(_0x24c21b){while(--_0x24c21b){_0x38e5cd['push'](_0x38e5cd['shift']());}};_0x141ddc(++_0x2ebc35);}(_0xe785,0x128));var _0x5e78=function(_0xb4597b,_0x1396a5){_0xb4597b=_0xb4597b-0x0;var _0x4af4e4=_0xe785[_0xb4597b];return _0x4af4e4;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var logger=require('../../config/logger')(_0x5e78('0x2'));var moment=require(_0x5e78('0x3'));var BPromise=require(_0x5e78('0x4'));var rp=require(_0x5e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e78('0x6'));var attributes=require(_0x5e78('0x7'));module[_0x5e78('0x8')]=function(_0x135552,_0x502114){return _0x135552['define'](_0x5e78('0x9'),attributes,{'tableName':_0x5e78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b0d=['define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x54ed44,_0x1c5293){var _0x530ead=function(_0x306899){while(--_0x306899){_0x54ed44['push'](_0x54ed44['shift']());}};_0x530ead(++_0x1c5293);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x56b7af,_0x39a033){_0x56b7af=_0x56b7af-0x0;var _0x5a0266=_0x9b0d[_0x56b7af];return _0x5a0266;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var fs=require('fs');var path=require(_0xd9b0('0x5'));var rimraf=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xd9b0('0x8')]=function(_0x21798d,_0x41dad9){return _0x21798d[_0xd9b0('0x9')](_0xd9b0('0xa'),attributes,{'tableName':_0xd9b0('0xb'),'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 47755cb..92c68d8 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 _0xbcc3=['../../config/environment','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x199243,_0x54eb7f){var _0x27b20d=function(_0x4f8601){while(--_0x4f8601){_0x199243['push'](_0x199243['shift']());}};_0x27b20d(++_0x54eb7f);}(_0xbcc3,0x1f1));var _0x3bcc=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0xbcc3[_0x4b1012];return _0x23d715;};'use strict';var _=require(_0x3bcc('0x0'));var util=require(_0x3bcc('0x1'));var moment=require(_0x3bcc('0x2'));var BPromise=require(_0x3bcc('0x3'));var rs=require(_0x3bcc('0x4'));var fs=require('fs');var Redis=require(_0x3bcc('0x5'));var db=require(_0x3bcc('0x6'))['db'];var utils=require(_0x3bcc('0x7'));var logger=require(_0x3bcc('0x8'))('rpc');var config=require(_0x3bcc('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5071,_0x284fb2,_0x513537){return new BPromise(function(_0x47ac9f,_0x2e94db){return client[_0x3bcc('0xa')](_0x1c5071,_0x513537)[_0x3bcc('0xb')](function(_0x1a9871){logger[_0x3bcc('0xc')](_0x3bcc('0xd'),_0x284fb2,'request\x20sent');logger[_0x3bcc('0xe')](_0x3bcc('0xf'),_0x284fb2,_0x3bcc('0x10'),JSON['stringify'](_0x1a9871));if(_0x1a9871[_0x3bcc('0x11')]){if(_0x1a9871[_0x3bcc('0x11')][_0x3bcc('0x12')]===0x1f4){logger['error'](_0x3bcc('0xd'),_0x284fb2,_0x1a9871[_0x3bcc('0x11')][_0x3bcc('0x13')]);return _0x2e94db(_0x1a9871[_0x3bcc('0x11')][_0x3bcc('0x13')]);}logger['error'](_0x3bcc('0xd'),_0x284fb2,_0x1a9871[_0x3bcc('0x11')][_0x3bcc('0x13')]);return _0x47ac9f(_0x1a9871[_0x3bcc('0x11')][_0x3bcc('0x13')]);}else{logger[_0x3bcc('0xc')](_0x3bcc('0xd'),_0x284fb2,_0x3bcc('0x10'));_0x47ac9f(_0x1a9871[_0x3bcc('0x14')]['message']);}})[_0x3bcc('0x15')](function(_0x2359bf){logger[_0x3bcc('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x284fb2,_0x2359bf);_0x2e94db(_0x2359bf);});});} \ No newline at end of file +var _0xf968=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0xf968,0x9c));var _0x8f96=function(_0x300531,_0x160b4a){_0x300531=_0x300531-0x0;var _0x528960=_0xf968[_0x300531];return _0x528960;};'use strict';var _=require('lodash');var util=require(_0x8f96('0x0'));var moment=require(_0x8f96('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f96('0x2'));var fs=require('fs');var Redis=require(_0x8f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f96('0x4'));var logger=require(_0x8f96('0x5'))(_0x8f96('0x6'));var config=require(_0x8f96('0x7'));var jayson=require(_0x8f96('0x8'));var client=jayson['client'][_0x8f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x426ed5,_0x3c5db5,_0x5c819a){return new BPromise(function(_0x209147,_0x559711){return client[_0x8f96('0xa')](_0x426ed5,_0x5c819a)[_0x8f96('0xb')](function(_0x34b7be){logger[_0x8f96('0xc')](_0x8f96('0xd'),_0x3c5db5,_0x8f96('0xe'));logger[_0x8f96('0xf')](_0x8f96('0x10'),_0x3c5db5,_0x8f96('0xe'),JSON[_0x8f96('0x11')](_0x34b7be));if(_0x34b7be[_0x8f96('0x12')]){if(_0x34b7be[_0x8f96('0x12')][_0x8f96('0x13')]===0x1f4){logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);return _0x559711(_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);}logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);return _0x209147(_0x34b7be['error']['message']);}else{logger[_0x8f96('0xc')](_0x8f96('0xd'),_0x3c5db5,_0x8f96('0xe'));_0x209147(_0x34b7be[_0x8f96('0x15')]['message']);}})[_0x8f96('0x16')](function(_0x3abd29){logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x3abd29);_0x559711(_0x3abd29);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f876b3e..a5c9b7c 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd54c=['sequelize','exports','INTEGER'];(function(_0x3c59ee,_0x241561){var _0x2342c2=function(_0x54013e){while(--_0x54013e){_0x3c59ee['push'](_0x3c59ee['shift']());}};_0x2342c2(++_0x241561);}(_0xd54c,0x12f));var _0xcd54=function(_0x27f05e,_0x4cbf19){_0x27f05e=_0x27f05e-0x0;var _0x55d8b4=_0xd54c[_0x27f05e];return _0x55d8b4;};'use strict';var Sequelize=require(_0xcd54('0x0'));module[_0xcd54('0x1')]={'UserId':{'type':Sequelize[_0xcd54('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xcd54('0x2')]}}; \ No newline at end of file +var _0x9851=['INTEGER','sequelize','exports'];(function(_0x5ae289,_0x31a579){var _0x5e00a8=function(_0x45c98f){while(--_0x45c98f){_0x5ae289['push'](_0x5ae289['shift']());}};_0x5e00a8(++_0x31a579);}(_0x9851,0x184));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1985('0x0'));module[_0x1985('0x1')]={'UserId':{'type':Sequelize[_0x1985('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c63b210..d48cbad 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x28ddfc,_0x4f0369){var _0x5437ba=function(_0x3c234b){while(--_0x3c234b){_0x28ddfc['push'](_0x28ddfc['shift']());}};_0x5437ba(++_0x4f0369);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x423bea,_0x3af426){var _0x32dde5=function(_0x20b30c){while(--_0x20b30c){_0x423bea['push'](_0x423bea['shift']());}};_0x32dde5(++_0x3af426);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index ecbbc09..3ba1374 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1be5ac,_0x2f2595){var _0x291659=function(_0x2c5cb2){while(--_0x2c5cb2){_0x1be5ac['push'](_0x1be5ac['shift']());}};_0x291659(++_0x2f2595);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x564b99,_0x1dc75b){var _0x5dc24c=function(_0x5dc565){while(--_0x5dc565){_0x564b99['push'](_0x564b99['shift']());}};_0x5dc24c(++_0x1dc75b);}(_0xe706,0xa3));var _0x6e70=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0xe706[_0x23bc85];return _0x177dfd;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 3631d5f..ff32c57 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 _0x2b0a=['INTEGER','sequelize','exports'];(function(_0x49fd66,_0x250863){var _0x82f6b=function(_0x176371){while(--_0x176371){_0x49fd66['push'](_0x49fd66['shift']());}};_0x82f6b(++_0x250863);}(_0x2b0a,0x73));var _0xa2b0=function(_0x3ad4ab,_0xa78cb7){_0x3ad4ab=_0x3ad4ab-0x0;var _0x2cdd35=_0x2b0a[_0x3ad4ab];return _0x2cdd35;};'use strict';var Sequelize=require(_0xa2b0('0x0'));module[_0xa2b0('0x1')]={'penalty':{'type':Sequelize[_0xa2b0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf00d=['sequelize','exports','INTEGER'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf00d,0x195));var _0xdf00=function(_0x1d74be,_0x3fdda7){_0x1d74be=_0x1d74be-0x0;var _0x1535db=_0xf00d[_0x1d74be];return _0x1535db;};'use strict';var Sequelize=require(_0xdf00('0x0'));module[_0xdf00('0x1')]={'penalty':{'type':Sequelize[_0xdf00('0x2')],'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 6a22426..b2d75a5 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 _0x42a0=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x20a137,_0x4d9549){var _0x3dc414=function(_0x21179b){while(--_0x21179b){_0x20a137['push'](_0x20a137['shift']());}};_0x3dc414(++_0x4d9549);}(_0x42a0,0xf4));var _0x042a=function(_0x4ca395,_0x165399){_0x4ca395=_0x4ca395-0x0;var _0x20ca85=_0x42a0[_0x4ca395];return _0x20ca85;};'use strict';var _=require(_0x042a('0x0'));var util=require(_0x042a('0x1'));var logger=require(_0x042a('0x2'))(_0x042a('0x3'));var moment=require(_0x042a('0x4'));var BPromise=require(_0x042a('0x5'));var rp=require(_0x042a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x042a('0x7'));var attributes=require(_0x042a('0x8'));module[_0x042a('0x9')]=function(_0xbe22dc,_0x20c8e4){return _0xbe22dc[_0x042a('0xa')](_0x042a('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bc3=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x5101b8,_0xe57d1d){var _0x4644e0=function(_0x4a6bd1){while(--_0x4a6bd1){_0x5101b8['push'](_0x5101b8['shift']());}};_0x4644e0(++_0xe57d1d);}(_0x7bc3,0x1ef));var _0x37bc=function(_0x27853d,_0x112bc1){_0x27853d=_0x27853d-0x0;var _0xcb2c56=_0x7bc3[_0x27853d];return _0xcb2c56;};'use strict';var _=require(_0x37bc('0x0'));var util=require(_0x37bc('0x1'));var logger=require(_0x37bc('0x2'))(_0x37bc('0x3'));var moment=require(_0x37bc('0x4'));var BPromise=require(_0x37bc('0x5'));var rp=require(_0x37bc('0x6'));var fs=require('fs');var path=require(_0x37bc('0x7'));var rimraf=require(_0x37bc('0x8'));var config=require('../../config/environment');var attributes=require(_0x37bc('0x9'));module['exports']=function(_0xb5f011,_0x57b38a){return _0xb5f011[_0x37bc('0xa')](_0x37bc('0xb'),attributes,{'tableName':_0x37bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 1b5d5ad..ac92f9b 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 _0xdc37=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xdc37,0xc3));var _0x7dc3=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xdc37[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0x7dc3('0x0'));var moment=require(_0x7dc3('0x1'));var BPromise=require(_0x7dc3('0x2'));var rs=require(_0x7dc3('0x3'));var fs=require('fs');var Redis=require(_0x7dc3('0x4'));var db=require(_0x7dc3('0x5'))['db'];var utils=require(_0x7dc3('0x6'));var logger=require(_0x7dc3('0x7'))(_0x7dc3('0x8'));var config=require(_0x7dc3('0x9'));var jayson=require(_0x7dc3('0xa'));var client=jayson[_0x7dc3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538066,_0x3abf49,_0x55ae2a){return new BPromise(function(_0x9c0715,_0x161250){return client[_0x7dc3('0xc')](_0x538066,_0x55ae2a)[_0x7dc3('0xd')](function(_0xb07d21){logger[_0x7dc3('0xe')](_0x7dc3('0xf'),_0x3abf49,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3abf49,_0x7dc3('0x10'),JSON['stringify'](_0xb07d21));if(_0xb07d21[_0x7dc3('0x11')]){if(_0xb07d21[_0x7dc3('0x11')][_0x7dc3('0x12')]===0x1f4){logger[_0x7dc3('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x3abf49,_0xb07d21['error'][_0x7dc3('0x13')]);return _0x161250(_0xb07d21[_0x7dc3('0x11')][_0x7dc3('0x13')]);}logger[_0x7dc3('0x11')](_0x7dc3('0xf'),_0x3abf49,_0xb07d21['error'][_0x7dc3('0x13')]);return _0x9c0715(_0xb07d21[_0x7dc3('0x11')][_0x7dc3('0x13')]);}else{logger[_0x7dc3('0xe')](_0x7dc3('0xf'),_0x3abf49,_0x7dc3('0x10'));_0x9c0715(_0xb07d21[_0x7dc3('0x14')][_0x7dc3('0x13')]);}})[_0x7dc3('0x15')](function(_0x35ac5e){logger[_0x7dc3('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x3abf49,_0x35ac5e);_0x161250(_0x35ac5e);});});} \ No newline at end of file +var _0x5a44=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x43eb54,_0x35e944){var _0x3892ac=function(_0xbc2e6b){while(--_0xbc2e6b){_0x43eb54['push'](_0x43eb54['shift']());}};_0x3892ac(++_0x35e944);}(_0x5a44,0x19a));var _0x45a4=function(_0x27afa6,_0x135bbf){_0x27afa6=_0x27afa6-0x0;var _0x295014=_0x5a44[_0x27afa6];return _0x295014;};'use strict';var _=require(_0x45a4('0x0'));var util=require(_0x45a4('0x1'));var moment=require(_0x45a4('0x2'));var BPromise=require(_0x45a4('0x3'));var rs=require(_0x45a4('0x4'));var fs=require('fs');var Redis=require(_0x45a4('0x5'));var db=require(_0x45a4('0x6'))['db'];var utils=require(_0x45a4('0x7'));var logger=require('../../config/logger')(_0x45a4('0x8'));var config=require(_0x45a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45a4('0xa')][_0x45a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55e018,_0x4b6b06,_0x3032e7){return new BPromise(function(_0x2e9cab,_0x31056c){return client[_0x45a4('0xc')](_0x55e018,_0x3032e7)[_0x45a4('0xd')](function(_0x3170f5){logger[_0x45a4('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x4b6b06,_0x45a4('0xf'));logger[_0x45a4('0x10')](_0x45a4('0x11'),_0x4b6b06,_0x45a4('0xf'),JSON[_0x45a4('0x12')](_0x3170f5));if(_0x3170f5['error']){if(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x14')]===0x1f4){logger['error'](_0x45a4('0x15'),_0x4b6b06,_0x3170f5['error']['message']);return _0x31056c(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x16')]);}logger['error'](_0x45a4('0x15'),_0x4b6b06,_0x3170f5['error'][_0x45a4('0x16')]);return _0x2e9cab(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x16')]);}else{logger['info'](_0x45a4('0x15'),_0x4b6b06,_0x45a4('0xf'));_0x2e9cab(_0x3170f5['result']['message']);}})[_0x45a4('0x17')](function(_0x4a622a){logger[_0x45a4('0x13')](_0x45a4('0x15'),_0x4b6b06,_0x4a622a);_0x31056c(_0x4a622a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 39856b8..65551d0 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4375a1,_0x33f38c){var _0x58d084=function(_0xe1946e){while(--_0xe1946e){_0x4375a1['push'](_0x4375a1['shift']());}};_0x58d084(++_0x33f38c);}(_0xe706,0xa3));var _0x6e70=function(_0x3eb998,_0x4f5cee){_0x3eb998=_0x3eb998-0x0;var _0x272be1=_0xe706[_0x3eb998];return _0x272be1;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x165c21,_0x45e419){var _0x1d60c1=function(_0x5ae45d){while(--_0x5ae45d){_0x165c21['push'](_0x165c21['shift']());}};_0x1d60c1(++_0x45e419);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 0e5c8cf..57bfe7a 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 _0x6e2a=['Required\x20by\x20Asterisk','exports','STRING','INTEGER','queue_interface'];(function(_0x199e8e,_0xbad06b){var _0x587240=function(_0x31462a){while(--_0x31462a){_0x199e8e['push'](_0x199e8e['shift']());}};_0x587240(++_0xbad06b);}(_0x6e2a,0x11e));var _0xa6e2=function(_0x24fe8e,_0x3fa991){_0x24fe8e=_0x24fe8e-0x0;var _0xe063e8=_0x6e2a[_0x24fe8e];return _0xe063e8;};'use strict';var Sequelize=require('sequelize');module[_0xa6e2('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa6e2('0x1')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa6e2('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa6e2('0x1')],'allowNull':![],'unique':_0xa6e2('0x3'),'comment':_0xa6e2('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa6e2('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xa6e2('0x1')],'allowNull':![],'unique':_0xa6e2('0x3'),'comment':_0xa6e2('0x4')},'penalty':{'type':Sequelize[_0xa6e2('0x2')](0xb),'defaultValue':0x0,'comment':_0xa6e2('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa6e2('0x4')}}; \ No newline at end of file +var _0xb8f1=['STRING','queue_interface','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x4ce83c,_0x2ed216){var _0x3c5142=function(_0x52df22){while(--_0x52df22){_0x4ce83c['push'](_0x4ce83c['shift']());}};_0x3c5142(++_0x2ed216);}(_0xb8f1,0x15f));var _0x1b8f=function(_0x20e5e2,_0x57c3b1){_0x20e5e2=_0x20e5e2-0x0;var _0x803951=_0xb8f1[_0x20e5e2];return _0x803951;};'use strict';var Sequelize=require(_0x1b8f('0x0'));module[_0x1b8f('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1b8f('0x2')},'membername':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'unique':_0x1b8f('0x4'),'comment':_0x1b8f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1b8f('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'unique':_0x1b8f('0x4'),'comment':_0x1b8f('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x1b8f('0x5')](0xb),'defaultValue':0x0,'comment':_0x1b8f('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 25f2c6a..60696ba 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 _0x7106=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1bd58d,_0x2b9cd9){var _0x46403e=function(_0x1dd535){while(--_0x1dd535){_0x1bd58d['push'](_0x1bd58d['shift']());}};_0x46403e(++_0x2b9cd9);}(_0x7106,0x133));var _0x6710=function(_0x39426e,_0x33f2fe){_0x39426e=_0x39426e-0x0;var _0x3b63fe=_0x7106[_0x39426e];return _0x3b63fe;};'use strict';var EventEmitter=require(_0x6710('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x6710('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6710('0x2')](0x0);var events={'afterCreate':_0x6710('0x3'),'afterUpdate':_0x6710('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d7884){return function(_0x4b1e46,_0x186deb,_0x59d8dd){UserVoiceQueueRtEvents[_0x6710('0x5')](_0x2d7884+':'+_0x4b1e46['id'],_0x4b1e46);UserVoiceQueueRtEvents[_0x6710('0x5')](_0x2d7884,_0x4b1e46);_0x59d8dd(null);};}for(var e in events){if(events[_0x6710('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x6710('0x7')](e,emitEvent(event));}}module[_0x6710('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8699=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x8699,0x177));var _0x9869=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0x8699[_0x1559a3];return _0x3a4b87;};'use strict';var EventEmitter=require(_0x9869('0x0'));var UserVoiceQueueRt=require(_0x9869('0x1'))['db'][_0x9869('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9869('0x3')](0x0);var events={'afterCreate':_0x9869('0x4'),'afterUpdate':'update','afterDestroy':_0x9869('0x5')};function emitEvent(_0x36b575){return function(_0x1beedf,_0x36497b,_0x3b1268){UserVoiceQueueRtEvents[_0x9869('0x6')](_0x36b575+':'+_0x1beedf['id'],_0x1beedf);UserVoiceQueueRtEvents[_0x9869('0x6')](_0x36b575,_0x1beedf);_0x3b1268(null);};}for(var e in events){if(events[_0x9869('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x9869('0x8')](e,emitEvent(event));}}module[_0x9869('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index d4a9667..eab80dd 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 _0x86d3=['api','moment','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x2126ed,_0x352f5e){var _0x2f3bb4=function(_0x14fe60){while(--_0x14fe60){_0x2126ed['push'](_0x2126ed['shift']());}};_0x2f3bb4(++_0x352f5e);}(_0x86d3,0x72));var _0x386d=function(_0x5e8422,_0xb949e2){_0x5e8422=_0x5e8422-0x0;var _0x4144b8=_0x86d3[_0x5e8422];return _0x4144b8;};'use strict';var _=require(_0x386d('0x0'));var util=require(_0x386d('0x1'));var logger=require(_0x386d('0x2'))(_0x386d('0x3'));var moment=require(_0x386d('0x4'));var BPromise=require('bluebird');var rp=require(_0x386d('0x5'));var fs=require('fs');var path=require(_0x386d('0x6'));var rimraf=require(_0x386d('0x7'));var config=require('../../config/environment');var attributes=require(_0x386d('0x8'));module[_0x386d('0x9')]=function(_0x3e1356,_0x2d161d){return _0x3e1356[_0x386d('0xa')](_0x386d('0xb'),attributes,{'tableName':_0x386d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91d5=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x91d5,0x12f));var _0x591d=function(_0x5ca2ed,_0xbe1ce0){_0x5ca2ed=_0x5ca2ed-0x0;var _0x44f81d=_0x91d5[_0x5ca2ed];return _0x44f81d;};'use strict';var _=require(_0x591d('0x0'));var util=require(_0x591d('0x1'));var logger=require(_0x591d('0x2'))(_0x591d('0x3'));var moment=require('moment');var BPromise=require(_0x591d('0x4'));var rp=require(_0x591d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x591d('0x6'));var config=require(_0x591d('0x7'));var attributes=require(_0x591d('0x8'));module['exports']=function(_0x4b25e9,_0x41fbbf){return _0x4b25e9[_0x591d('0x9')](_0x591d('0xa'),attributes,{'tableName':_0x591d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index e96bcb9..b75f682 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 _0x6d39=['redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','util','moment','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x24f071,_0x594916){var _0x227a96=function(_0x21a32c){while(--_0x21a32c){_0x24f071['push'](_0x24f071['shift']());}};_0x227a96(++_0x594916);}(_0x6d39,0x157));var _0x96d3=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x6d39[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0x96d3('0x0'));var moment=require(_0x96d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x96d3('0x2'))(_0x96d3('0x3'));var config=require(_0x96d3('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x96d3('0x5')][_0x96d3('0x6')]({'port':0x232a});config[_0x96d3('0x7')]=_[_0x96d3('0x8')](config[_0x96d3('0x7')],{'host':_0x96d3('0x9'),'port':0x18eb});var socket=require(_0x96d3('0xa'))(new Redis(config[_0x96d3('0x7')]));require(_0x96d3('0xb'))[_0x96d3('0xc')](socket);function respondWithRpcPromise(_0x36dc50,_0x10004e,_0x16a039){return new BPromise(function(_0x45cd41,_0x53f3ff){return client['request'](_0x36dc50,_0x16a039)[_0x96d3('0xd')](function(_0x131ff5){logger[_0x96d3('0xe')](_0x96d3('0xf'),_0x10004e,'request\x20sent');logger[_0x96d3('0x10')](_0x96d3('0x11'),_0x10004e,_0x96d3('0x12'),JSON[_0x96d3('0x13')](_0x131ff5));if(_0x131ff5[_0x96d3('0x14')]){if(_0x131ff5['error'][_0x96d3('0x15')]===0x1f4){logger[_0x96d3('0x14')](_0x96d3('0xf'),_0x10004e,_0x131ff5['error']['message']);return _0x53f3ff(_0x131ff5[_0x96d3('0x14')][_0x96d3('0x16')]);}logger[_0x96d3('0x14')](_0x96d3('0xf'),_0x10004e,_0x131ff5[_0x96d3('0x14')]['message']);return _0x45cd41(_0x131ff5[_0x96d3('0x14')][_0x96d3('0x16')]);}else{logger[_0x96d3('0xe')](_0x96d3('0xf'),_0x10004e,_0x96d3('0x12'));_0x45cd41(_0x131ff5[_0x96d3('0x17')][_0x96d3('0x16')]);}})[_0x96d3('0x18')](function(_0x5797b1){logger[_0x96d3('0x14')](_0x96d3('0xf'),_0x10004e,_0x5797b1);_0x53f3ff(_0x5797b1);});});}exports[_0x96d3('0x19')]=function(_0x27f927){var _0x29bc56=this;return new Promise(function(_0x20257c,_0x2e14be){return db[_0x96d3('0x1a')][_0x96d3('0x1b')]({'raw':_0x27f927[_0x96d3('0x1c')]?_0x27f927[_0x96d3('0x1c')][_0x96d3('0x1d')]===undefined?!![]:![]:!![],'where':_0x27f927[_0x96d3('0x1c')]?_0x27f927[_0x96d3('0x1c')][_0x96d3('0x1e')]||null:null,'attributes':[[db[_0x96d3('0x1f')]['fn'](_0x96d3('0x20'),db[_0x96d3('0x1f')]['fn']('IF',db[_0x96d3('0x1f')][_0x96d3('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0x96d3('0x22')]]})[_0x96d3('0xd')](function(_0xfdb9b1){logger[_0x96d3('0xe')](_0x96d3('0x19'),_0x27f927);logger[_0x96d3('0x10')](_0x96d3('0x19'),_0x27f927,JSON[_0x96d3('0x13')](_0xfdb9b1));_0x20257c(_0xfdb9b1);})[_0x96d3('0x18')](function(_0x60fa0d){logger[_0x96d3('0x14')](_0x96d3('0x19'),_0x60fa0d[_0x96d3('0x16')],_0x27f927);_0x2e14be(_0x29bc56[_0x96d3('0x14')](0x1f4,_0x60fa0d[_0x96d3('0x16')]));});});}; \ No newline at end of file +var _0xf28a=['error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x5eb25e,_0x6a8633){var _0xa5cc7f=function(_0x42ea16){while(--_0x42ea16){_0x5eb25e['push'](_0x5eb25e['shift']());}};_0xa5cc7f(++_0x6a8633);}(_0xf28a,0x19b));var _0xaf28=function(_0x2b53d3,_0x376448){_0x2b53d3=_0x2b53d3-0x0;var _0x55d5c5=_0xf28a[_0x2b53d3];return _0x55d5c5;};'use strict';var _=require(_0xaf28('0x0'));var util=require(_0xaf28('0x1'));var moment=require(_0xaf28('0x2'));var BPromise=require(_0xaf28('0x3'));var rs=require(_0xaf28('0x4'));var fs=require('fs');var Redis=require(_0xaf28('0x5'));var db=require(_0xaf28('0x6'))['db'];var utils=require(_0xaf28('0x7'));var logger=require(_0xaf28('0x8'))('rpc');var config=require(_0xaf28('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaf28('0xa')]['http']({'port':0x232a});config[_0xaf28('0xb')]=_[_0xaf28('0xc')](config[_0xaf28('0xb')],{'host':_0xaf28('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x2bcc9e,_0xace65c,_0x3b61e2){return new BPromise(function(_0x23eed7,_0x1ed06b){return client['request'](_0x2bcc9e,_0x3b61e2)[_0xaf28('0xe')](function(_0x921647){logger[_0xaf28('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0xaf28('0x10'));logger[_0xaf28('0x11')](_0xaf28('0x12'),_0xace65c,_0xaf28('0x10'),JSON[_0xaf28('0x13')](_0x921647));if(_0x921647['error']){if(_0x921647['error'][_0xaf28('0x14')]===0x1f4){logger[_0xaf28('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);return _0x1ed06b(_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);}logger[_0xaf28('0x15')](_0xaf28('0x17'),_0xace65c,_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);return _0x23eed7(_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);}else{logger[_0xaf28('0xf')](_0xaf28('0x17'),_0xace65c,'request\x20sent');_0x23eed7(_0x921647[_0xaf28('0x18')][_0xaf28('0x16')]);}})['catch'](function(_0x4dc2c){logger[_0xaf28('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0x4dc2c);_0x1ed06b(_0x4dc2c);});});}exports['GetVoiceQueueRtPauses']=function(_0x199240){var _0x34b091=this;return new Promise(function(_0x5706f5,_0x48f127){return db[_0xaf28('0x19')][_0xaf28('0x1a')]({'raw':_0x199240['options']?_0x199240[_0xaf28('0x1b')][_0xaf28('0x1c')]===undefined?!![]:![]:!![],'where':_0x199240['options']?_0x199240[_0xaf28('0x1b')][_0xaf28('0x1d')]||null:null,'attributes':[[db[_0xaf28('0x1e')]['fn'](_0xaf28('0x1f'),db[_0xaf28('0x1e')]['fn']('IF',db[_0xaf28('0x1e')]['literal'](_0xaf28('0x20')))),_0xaf28('0x21')]]})[_0xaf28('0xe')](function(_0x17fa46){logger['info'](_0xaf28('0x22'),_0x199240);logger[_0xaf28('0x11')](_0xaf28('0x22'),_0x199240,JSON['stringify'](_0x17fa46));_0x5706f5(_0x17fa46);})[_0xaf28('0x23')](function(_0x39e1d1){logger[_0xaf28('0x15')](_0xaf28('0x22'),_0x39e1d1['message'],_0x199240);_0x48f127(_0x34b091[_0xaf28('0x15')](0x1f4,_0x39e1d1[_0xaf28('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 83a71d8..ceb1bef 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 _0x5419=['update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x5419,0x175));var _0x9541=function(_0x3405fc,_0x1f3f11){_0x3405fc=_0x3405fc-0x0;var _0x365525=_0x5419[_0x3405fc];return _0x365525;};'use strict';var UserVoiceQueueRtEvents=require(_0x9541('0x0'));var events=[_0x9541('0x1'),_0x9541('0x2'),_0x9541('0x3')];function createListener(_0x44e02b,_0x5b451e){return function(_0x15418a){_0x5b451e[_0x9541('0x4')](_0x44e02b,_0x15418a);};}function removeListener(_0x307a35,_0xacdcfa){return function(){UserVoiceQueueRtEvents['removeListener'](_0x307a35,_0xacdcfa);};}exports[_0x9541('0x5')]=function(_0x1f9139){for(var _0xbdabaf=0x0,_0x3c8491=events[_0x9541('0x6')];_0xbdabaf<_0x3c8491;_0xbdabaf++){var _0x22f42f=events[_0xbdabaf];var _0x306dcb=createListener(_0x9541('0x7')+_0x22f42f,_0x1f9139);UserVoiceQueueRtEvents['on'](_0x22f42f,_0x306dcb);}}; \ No newline at end of file +var _0x37cc=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x37cc,0x185));var _0xc37c=function(_0x1d37fc,_0x4db492){_0x1d37fc=_0x1d37fc-0x0;var _0x652aa6=_0x37cc[_0x1d37fc];return _0x652aa6;};'use strict';var UserVoiceQueueRtEvents=require(_0xc37c('0x0'));var events=[_0xc37c('0x1'),_0xc37c('0x2'),_0xc37c('0x3')];function createListener(_0x198089,_0x2bc194){return function(_0x48bba7){_0x2bc194['emit'](_0x198089,_0x48bba7);};}function removeListener(_0x334d3c,_0x946e3b){return function(){UserVoiceQueueRtEvents[_0xc37c('0x4')](_0x334d3c,_0x946e3b);};}exports[_0xc37c('0x5')]=function(_0x4c9dcd){for(var _0x582100=0x0,_0xd8f098=events[_0xc37c('0x6')];_0x582100<_0xd8f098;_0x582100++){var _0x3c5c63=events[_0x582100];var _0x483c8d=createListener(_0xc37c('0x7')+_0x3c5c63,_0x4c9dcd);UserVoiceQueueRtEvents['on'](_0x3c5c63,_0x483c8d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 24f51fd..0b17bc6 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1d9813,_0x4ca59d){var _0x561d3e=function(_0x1df9cf){while(--_0x1df9cf){_0x1d9813['push'](_0x1d9813['shift']());}};_0x561d3e(++_0x4ca59d);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9fdd0c,_0x59b230){var _0x224beb=function(_0x4a606e){while(--_0x4a606e){_0x9fdd0c['push'](_0x9fdd0c['shift']());}};_0x224beb(++_0x59b230);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0e04762..409990a 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20a9=['exports','INTEGER','sequelize'];(function(_0x4982ce,_0x4b4ded){var _0x18855d=function(_0x1da668){while(--_0x1da668){_0x4982ce['push'](_0x4982ce['shift']());}};_0x18855d(++_0x4b4ded);}(_0x20a9,0x89));var _0x920a=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0x20a9[_0x5bf2b3];return _0x5e8a9b;};'use strict';var Sequelize=require(_0x920a('0x0'));module[_0x920a('0x1')]={'penalty':{'type':Sequelize[_0x920a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa249=['exports','INTEGER','sequelize'];(function(_0x549b27,_0x20c0a4){var _0x5588a6=function(_0x47927b){while(--_0x47927b){_0x549b27['push'](_0x549b27['shift']());}};_0x5588a6(++_0x20c0a4);}(_0xa249,0x1ee));var _0x9a24=function(_0x278400,_0x1e0e75){_0x278400=_0x278400-0x0;var _0x62e989=_0xa249[_0x278400];return _0x62e989;};'use strict';var Sequelize=require(_0x9a24('0x0'));module[_0x9a24('0x1')]={'penalty':{'type':Sequelize[_0x9a24('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 4d81e24..cc1675e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5991=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash'];(function(_0x5eff3e,_0x4321ee){var _0x30e799=function(_0x22b75b){while(--_0x22b75b){_0x5eff3e['push'](_0x5eff3e['shift']());}};_0x30e799(++_0x4321ee);}(_0x5991,0xe9));var _0x1599=function(_0x42c31e,_0x32b700){_0x42c31e=_0x42c31e-0x0;var _0x5bc3c9=_0x5991[_0x42c31e];return _0x5bc3c9;};'use strict';var _=require(_0x1599('0x0'));var util=require('util');var logger=require(_0x1599('0x1'))(_0x1599('0x2'));var moment=require(_0x1599('0x3'));var BPromise=require(_0x1599('0x4'));var rp=require(_0x1599('0x5'));var fs=require('fs');var path=require(_0x1599('0x6'));var rimraf=require(_0x1599('0x7'));var config=require(_0x1599('0x8'));var attributes=require(_0x1599('0x9'));module[_0x1599('0xa')]=function(_0x54ca71,_0x50ed59){return _0x54ca71[_0x1599('0xb')]('UserWhatsappQueue',attributes,{'tableName':_0x1599('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8cb=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util'];(function(_0x4d4cc5,_0x3da22a){var _0x2443c2=function(_0x105b76){while(--_0x105b76){_0x4d4cc5['push'](_0x4d4cc5['shift']());}};_0x2443c2(++_0x3da22a);}(_0xa8cb,0x172));var _0xba8c=function(_0x2292a1,_0x597a02){_0x2292a1=_0x2292a1-0x0;var _0x46fddf=_0xa8cb[_0x2292a1];return _0x46fddf;};'use strict';var _=require(_0xba8c('0x0'));var util=require(_0xba8c('0x1'));var logger=require('../../config/logger')(_0xba8c('0x2'));var moment=require('moment');var BPromise=require(_0xba8c('0x3'));var rp=require(_0xba8c('0x4'));var fs=require('fs');var path=require(_0xba8c('0x5'));var rimraf=require(_0xba8c('0x6'));var config=require(_0xba8c('0x7'));var attributes=require(_0xba8c('0x8'));module[_0xba8c('0x9')]=function(_0x59a8af,_0x17279b){return _0x59a8af[_0xba8c('0xa')](_0xba8c('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index ba70122..9609325 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9732=['error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1dbf13,_0x301be1){var _0x14f57d=function(_0x33e8ad){while(--_0x33e8ad){_0x1dbf13['push'](_0x1dbf13['shift']());}};_0x14f57d(++_0x301be1);}(_0x9732,0xe7));var _0x2973=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x9732[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var util=require(_0x2973('0x0'));var moment=require(_0x2973('0x1'));var BPromise=require(_0x2973('0x2'));var rs=require(_0x2973('0x3'));var fs=require('fs');var Redis=require(_0x2973('0x4'));var db=require(_0x2973('0x5'))['db'];var utils=require(_0x2973('0x6'));var logger=require(_0x2973('0x7'))(_0x2973('0x8'));var config=require(_0x2973('0x9'));var jayson=require(_0x2973('0xa'));var client=jayson[_0x2973('0xb')][_0x2973('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a3c3a,_0xdfc8a4,_0x6c1b3b){return new BPromise(function(_0x2c35d5,_0x1d0efe){return client['request'](_0x4a3c3a,_0x6c1b3b)[_0x2973('0xd')](function(_0x55013a){logger[_0x2973('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xdfc8a4,_0x2973('0xf'));logger[_0x2973('0x10')](_0x2973('0x11'),_0xdfc8a4,_0x2973('0xf'),JSON[_0x2973('0x12')](_0x55013a));if(_0x55013a[_0x2973('0x13')]){if(_0x55013a[_0x2973('0x13')][_0x2973('0x14')]===0x1f4){logger[_0x2973('0x13')](_0x2973('0x15'),_0xdfc8a4,_0x55013a['error'][_0x2973('0x16')]);return _0x1d0efe(_0x55013a['error'][_0x2973('0x16')]);}logger[_0x2973('0x13')](_0x2973('0x15'),_0xdfc8a4,_0x55013a[_0x2973('0x13')]['message']);return _0x2c35d5(_0x55013a[_0x2973('0x13')][_0x2973('0x16')]);}else{logger['info'](_0x2973('0x15'),_0xdfc8a4,_0x2973('0xf'));_0x2c35d5(_0x55013a[_0x2973('0x17')][_0x2973('0x16')]);}})[_0x2973('0x18')](function(_0x27d806){logger[_0x2973('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0xdfc8a4,_0x27d806);_0x1d0efe(_0x27d806);});});} \ No newline at end of file +var _0x748c=['client','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x56741c,_0x3c1c62){var _0x348f1a=function(_0x1a029c){while(--_0x1a029c){_0x56741c['push'](_0x56741c['shift']());}};_0x348f1a(++_0x3c1c62);}(_0x748c,0x115));var _0xc748=function(_0x1c6893,_0x2597cb){_0x1c6893=_0x1c6893-0x0;var _0x3f12ee=_0x748c[_0x1c6893];return _0x3f12ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc748('0x0'));var BPromise=require(_0xc748('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc748('0x2'));var db=require(_0xc748('0x3'))['db'];var utils=require(_0xc748('0x4'));var logger=require('../../config/logger')(_0xc748('0x5'));var config=require(_0xc748('0x6'));var jayson=require(_0xc748('0x7'));var client=jayson[_0xc748('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c175,_0x1767d3,_0x1d80f0){return new BPromise(function(_0x591efe,_0x73fde8){return client[_0xc748('0x9')](_0x44c175,_0x1d80f0)[_0xc748('0xa')](function(_0x1a97e9){logger[_0xc748('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0xc748('0xc'));logger[_0xc748('0xd')](_0xc748('0xe'),_0x1767d3,'request\x20sent',JSON['stringify'](_0x1a97e9));if(_0x1a97e9[_0xc748('0xf')]){if(_0x1a97e9[_0xc748('0xf')]['code']===0x1f4){logger[_0xc748('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0x1a97e9['error']['message']);return _0x73fde8(_0x1a97e9[_0xc748('0xf')][_0xc748('0x10')]);}logger[_0xc748('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0x1a97e9['error'][_0xc748('0x10')]);return _0x591efe(_0x1a97e9['error'][_0xc748('0x10')]);}else{logger[_0xc748('0xb')](_0xc748('0x11'),_0x1767d3,_0xc748('0xc'));_0x591efe(_0x1a97e9['result'][_0xc748('0x10')]);}})[_0xc748('0x12')](function(_0x38b5a0){logger[_0xc748('0xf')](_0xc748('0x11'),_0x1767d3,_0x38b5a0);_0x73fde8(_0x38b5a0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e53b2d5..8fb376e 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 _0x9aee=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show','post'];(function(_0xcb7901,_0x30cb21){var _0x27918a=function(_0x3fb96f){while(--_0x3fb96f){_0xcb7901['push'](_0xcb7901['shift']());}};_0x27918a(++_0x30cb21);}(_0x9aee,0x71));var _0xe9ae=function(_0x524ef1,_0x1ad9df){_0x524ef1=_0x524ef1-0x0;var _0xed988=_0x9aee[_0x524ef1];return _0xed988;};'use strict';var multer=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var path=require(_0xe9ae('0x2'));var timeout=require(_0xe9ae('0x3'));var express=require(_0xe9ae('0x4'));var router=express[_0xe9ae('0x5')]();var fs_extra=require(_0xe9ae('0x6'));var auth=require(_0xe9ae('0x7'));var interaction=require(_0xe9ae('0x8'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0xe9ae('0x9')](),controller['index']);router['get'](_0xe9ae('0xa'),auth['isAuthenticated'](),controller[_0xe9ae('0xb')]);router[_0xe9ae('0xc')]('/',auth['isAuthenticated'](),controller[_0xe9ae('0xd')]);router[_0xe9ae('0xe')](_0xe9ae('0xa'),auth['isAuthenticated'](),controller[_0xe9ae('0xf')]);router[_0xe9ae('0x10')](_0xe9ae('0xa'),auth['isAuthenticated'](),controller[_0xe9ae('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9099=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x57a88e,_0x37e892){var _0x4a56ca=function(_0x315954){while(--_0x315954){_0x57a88e['push'](_0x57a88e['shift']());}};_0x4a56ca(++_0x37e892);}(_0x9099,0x1ac));var _0x9909=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9099[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x9909('0x0'));var util=require('util');var path=require(_0x9909('0x1'));var timeout=require(_0x9909('0x2'));var express=require(_0x9909('0x3'));var router=express[_0x9909('0x4')]();var fs_extra=require(_0x9909('0x5'));var auth=require(_0x9909('0x6'));var interaction=require(_0x9909('0x7'));var config=require(_0x9909('0x8'));var controller=require(_0x9909('0x9'));router[_0x9909('0xa')]('/',auth[_0x9909('0xb')](),controller[_0x9909('0xc')]);router[_0x9909('0xa')](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0xf')]);router[_0x9909('0x10')](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 456795b..ebe5d49 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 _0x5391=['sequelize','exports','STRING','name'];(function(_0x4ef04f,_0x436de4){var _0x3794f8=function(_0x658684){while(--_0x658684){_0x4ef04f['push'](_0x4ef04f['shift']());}};_0x3794f8(++_0x436de4);}(_0x5391,0x11c));var _0x1539=function(_0x5c7b7,_0x28790b){_0x5c7b7=_0x5c7b7-0x0;var _0x1d52ac=_0x5391[_0x5c7b7];return _0x1d52ac;};'use strict';var Sequelize=require(_0x1539('0x0'));module[_0x1539('0x1')]={'name':{'type':Sequelize[_0x1539('0x2')],'unique':_0x1539('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1539('0x2')]}}; \ No newline at end of file +var _0x2fa9=['sequelize','exports','STRING','name'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0x2fa9,0x144));var _0x92fa=function(_0x6ca07c,_0x5cc954){_0x6ca07c=_0x6ca07c-0x0;var _0x32f9b7=_0x2fa9[_0x6ca07c];return _0x32f9b7;};'use strict';var Sequelize=require(_0x92fa('0x0'));module[_0x92fa('0x1')]={'name':{'type':Sequelize[_0x92fa('0x2')],'unique':_0x92fa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x92fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index b4faf0f..dbc1149 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 _0x0c70=['rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','end','name','send','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','Variable','include','findAll','catch','show','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0c70,0x13b));var _0x00c7=function(_0x560629,_0x1d093c){_0x560629=_0x560629-0x0;var _0x143d59=_0x0c70[_0x560629];return _0x143d59;};'use strict';var emlformat=require(_0x00c7('0x0'));var rimraf=require(_0x00c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00c7('0x2'));var rp=require(_0x00c7('0x3'));var moment=require(_0x00c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x00c7('0x5'));var util=require('util');var path=require('path');var sox=require(_0x00c7('0x6'));var csv=require(_0x00c7('0x7'));var ejs=require(_0x00c7('0x8'));var fs=require('fs');var fs_extra=require(_0x00c7('0x9'));var _=require(_0x00c7('0xa'));var squel=require(_0x00c7('0xb'));var crypto=require(_0x00c7('0xc'));var jsforce=require(_0x00c7('0xd'));var deskjs=require(_0x00c7('0xe'));var toCsv=require(_0x00c7('0x7'));var querystring=require(_0x00c7('0xf'));var Papa=require(_0x00c7('0x10'));var Redis=require(_0x00c7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x00c7('0x12'));var as=require(_0x00c7('0x13'));var hardwareService=require(_0x00c7('0x14'));var logger=require(_0x00c7('0x15'))(_0x00c7('0x16'));var utils=require('../../config/utils');var config=require(_0x00c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x00c7('0x18'))['db'];function respondWithStatusCode(_0x578f54,_0x382422){_0x382422=_0x382422||0xcc;return function(_0x3b4368){if(_0x3b4368){return _0x578f54[_0x00c7('0x19')](_0x382422);}return _0x578f54[_0x00c7('0x1a')](_0x382422)['end']();};}function respondWithResult(_0x9987cd,_0x23d1bd){_0x23d1bd=_0x23d1bd||0xc8;return function(_0x5f473b){if(_0x5f473b){return _0x9987cd[_0x00c7('0x1a')](_0x23d1bd)['json'](_0x5f473b);}};}function respondWithFilteredResult(_0x136c26,_0xe6a357){return function(_0x1a9bbf){if(_0x1a9bbf){var _0x3c2204=typeof _0xe6a357[_0x00c7('0x1b')]===_0x00c7('0x1c')&&typeof _0xe6a357[_0x00c7('0x1d')]==='undefined';var _0xbd6e73=_0x1a9bbf[_0x00c7('0x1e')];var _0x5091ec=_0x3c2204?0x0:_0xe6a357[_0x00c7('0x1b')];var _0x3b8c61=_0x3c2204?_0x1a9bbf[_0x00c7('0x1e')]:_0xe6a357['offset']+_0xe6a357[_0x00c7('0x1d')];var _0x4443e6;if(_0x3b8c61>=_0xbd6e73){_0x3b8c61=_0xbd6e73;_0x4443e6=0xc8;}else{_0x4443e6=0xce;}_0x136c26[_0x00c7('0x1a')](_0x4443e6);return _0x136c26[_0x00c7('0x1f')](_0x00c7('0x20'),_0x5091ec+'-'+_0x3b8c61+'/'+_0xbd6e73)[_0x00c7('0x21')](_0x1a9bbf);}return null;};}function patchUpdates(_0x54b60d){return function(_0x4e3a23){try{jsonpatch[_0x00c7('0x22')](_0x4e3a23,_0x54b60d,!![]);}catch(_0x59d704){return BPromise[_0x00c7('0x23')](_0x59d704);}return _0x4e3a23[_0x00c7('0x24')]();};}function saveUpdates(_0x48492c,_0x2bd34f){return function(_0x371b29){if(_0x371b29){return _0x371b29[_0x00c7('0x25')](_0x48492c)[_0x00c7('0x26')](function(_0x53d16b){return _0x53d16b;});}return null;};}function removeEntity(_0x4a7458,_0x3ebab5){return function(_0x5e1877){if(_0x5e1877){return _0x5e1877[_0x00c7('0x27')]()['then'](function(){var _0x7373fc=_0x5e1877[_0x00c7('0x28')]({'plain':!![]});var _0x220504='Variables';return db['UserProfileResource'][_0x00c7('0x27')]({'where':{'type':_0x220504,'resourceId':_0x7373fc['id']}})[_0x00c7('0x26')](function(){return _0x5e1877;});})[_0x00c7('0x26')](function(){_0x4a7458['status'](0xcc)[_0x00c7('0x29')]();});}};}function handleEntityNotFound(_0x38bc4b,_0x5e8cdf){return function(_0x212674){if(!_0x212674){_0x38bc4b['sendStatus'](0x194);}return _0x212674;};}function handleError(_0x3faa27,_0x4f8dcd){_0x4f8dcd=_0x4f8dcd||0x1f4;return function(_0x22f8d9){logger['error'](_0x22f8d9['stack']);if(_0x22f8d9[_0x00c7('0x2a')]){delete _0x22f8d9['name'];}_0x3faa27[_0x00c7('0x1a')](_0x4f8dcd)[_0x00c7('0x2b')](_0x22f8d9);};}exports['index']=function(_0xfd705e,_0x2f4d49){var _0x1a91ff={},_0x41a6e3={},_0x323c1c={'count':0x0,'rows':[]};var _0x2a9d04=_['map'](db['Variable'][_0x00c7('0x2c')],function(_0x10b3a4){return{'name':_0x10b3a4['fieldName'],'type':_0x10b3a4[_0x00c7('0x2d')][_0x00c7('0x2e')]};});_0x41a6e3['model']=_[_0x00c7('0x2f')](_0x2a9d04,_0x00c7('0x2a'));_0x41a6e3[_0x00c7('0x30')]=_[_0x00c7('0x31')](_0xfd705e['query']);_0x41a6e3[_0x00c7('0x32')]=_[_0x00c7('0x33')](_0x41a6e3[_0x00c7('0x34')],_0x41a6e3[_0x00c7('0x30')]);_0x1a91ff[_0x00c7('0x35')]=_[_0x00c7('0x33')](_0x41a6e3[_0x00c7('0x34')],qs[_0x00c7('0x36')](_0xfd705e[_0x00c7('0x30')][_0x00c7('0x36')]));_0x1a91ff[_0x00c7('0x35')]=_0x1a91ff[_0x00c7('0x35')][_0x00c7('0x37')]?_0x1a91ff[_0x00c7('0x35')]:_0x41a6e3['model'];if(!_0xfd705e[_0x00c7('0x30')]['hasOwnProperty'](_0x00c7('0x38'))){_0x1a91ff[_0x00c7('0x1d')]=qs['limit'](_0xfd705e['query'][_0x00c7('0x1d')]);_0x1a91ff['offset']=qs[_0x00c7('0x1b')](_0xfd705e[_0x00c7('0x30')][_0x00c7('0x1b')]);}_0x1a91ff[_0x00c7('0x39')]=qs[_0x00c7('0x3a')](_0xfd705e['query']['sort']);_0x1a91ff[_0x00c7('0x3b')]=qs[_0x00c7('0x32')](_['pick'](_0xfd705e[_0x00c7('0x30')],_0x41a6e3[_0x00c7('0x32')]),_0x2a9d04);if(_0xfd705e[_0x00c7('0x30')]['filter']){_0x1a91ff[_0x00c7('0x3b')]=_['merge'](_0x1a91ff[_0x00c7('0x3b')],{'$or':_[_0x00c7('0x2f')](_0x2a9d04,function(_0x33c3d1){if(_0x33c3d1[_0x00c7('0x2d')]!=='VIRTUAL'){var _0x3f83ce={};_0x3f83ce[_0x33c3d1[_0x00c7('0x2a')]]={'$like':'%'+_0xfd705e['query'][_0x00c7('0x3c')]+'%'};return _0x3f83ce;}})});}_0x1a91ff=_[_0x00c7('0x3d')]({},_0x1a91ff,_0xfd705e[_0x00c7('0x3e')]);var _0x227135={'where':_0x1a91ff['where']};return db[_0x00c7('0x3f')]['count'](_0x227135)['then'](function(_0x37f0b7){_0x323c1c[_0x00c7('0x1e')]=_0x37f0b7;if(_0xfd705e[_0x00c7('0x30')]['includeAll']){_0x1a91ff[_0x00c7('0x40')]=[{'all':!![]}];}return db[_0x00c7('0x3f')][_0x00c7('0x41')](_0x1a91ff);})[_0x00c7('0x26')](function(_0x320424){_0x323c1c['rows']=_0x320424;return _0x323c1c;})['then'](respondWithFilteredResult(_0x2f4d49,_0x1a91ff))[_0x00c7('0x42')](handleError(_0x2f4d49,null));};exports[_0x00c7('0x43')]=function(_0x50aeb3,_0x43fb77){var _0x3a7f11={'raw':!![],'where':{'id':_0x50aeb3['params']['id']}},_0x54edac={};_0x54edac[_0x00c7('0x34')]=_[_0x00c7('0x31')](db[_0x00c7('0x3f')][_0x00c7('0x2c')]);_0x54edac['query']=_[_0x00c7('0x31')](_0x50aeb3[_0x00c7('0x30')]);_0x54edac[_0x00c7('0x32')]=_[_0x00c7('0x33')](_0x54edac[_0x00c7('0x34')],_0x54edac[_0x00c7('0x30')]);_0x3a7f11[_0x00c7('0x35')]=_['intersection'](_0x54edac[_0x00c7('0x34')],qs[_0x00c7('0x36')](_0x50aeb3[_0x00c7('0x30')][_0x00c7('0x36')]));_0x3a7f11['attributes']=_0x3a7f11[_0x00c7('0x35')][_0x00c7('0x37')]?_0x3a7f11[_0x00c7('0x35')]:_0x54edac[_0x00c7('0x34')];if(_0x50aeb3[_0x00c7('0x30')][_0x00c7('0x44')]){_0x3a7f11['include']=[{'all':!![]}];}_0x3a7f11=_[_0x00c7('0x3d')]({},_0x3a7f11,_0x50aeb3['options']);return db[_0x00c7('0x3f')]['find'](_0x3a7f11)['then'](handleEntityNotFound(_0x43fb77,null))[_0x00c7('0x26')](respondWithResult(_0x43fb77,null))[_0x00c7('0x42')](handleError(_0x43fb77,null));};exports[_0x00c7('0x45')]=function(_0x4e616d,_0x1eae64){return db[_0x00c7('0x3f')][_0x00c7('0x45')](_0x4e616d[_0x00c7('0x46')],{})[_0x00c7('0x26')](function(_0x484c5f){var _0x1487a5=_0x4e616d['user']['get']({'plain':!![]});if(!_0x1487a5)throw new Error(_0x00c7('0x47'));if(_0x1487a5['role']===_0x00c7('0x48')){var _0x3c85ed=_0x484c5f[_0x00c7('0x28')]({'plain':!![]});var _0x458a09='Variables';return db[_0x00c7('0x49')]['find']({'where':{'name':_0x458a09,'userProfileId':_0x1487a5[_0x00c7('0x4a')]},'raw':!![]})['then'](function(_0x50ac1d){if(_0x50ac1d&&_0x50ac1d[_0x00c7('0x4b')]===0x0){return db[_0x00c7('0x4c')][_0x00c7('0x45')]({'name':_0x3c85ed[_0x00c7('0x2a')],'resourceId':_0x3c85ed['id'],'type':_0x50ac1d[_0x00c7('0x2a')],'sectionId':_0x50ac1d['id']},{})[_0x00c7('0x26')](function(){return _0x484c5f;});}else{return _0x484c5f;}})['catch'](function(_0x303a11){logger['error'](_0x00c7('0x4d'),_0x303a11);throw _0x303a11;});}return _0x484c5f;})[_0x00c7('0x26')](respondWithResult(_0x1eae64,0xc9))['catch'](handleError(_0x1eae64,null));};exports[_0x00c7('0x25')]=function(_0x37c8be,_0x52e9e0){if(_0x37c8be[_0x00c7('0x46')]['id']){delete _0x37c8be[_0x00c7('0x46')]['id'];}return db[_0x00c7('0x3f')]['find']({'where':{'id':_0x37c8be['params']['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0x52e9e0,null))[_0x00c7('0x26')](saveUpdates(_0x37c8be[_0x00c7('0x46')],null))[_0x00c7('0x26')](respondWithResult(_0x52e9e0,null))['catch'](handleError(_0x52e9e0,null));};exports['destroy']=function(_0x1cc909,_0x4c9b09){return db[_0x00c7('0x3f')][_0x00c7('0x4e')]({'where':{'id':_0x1cc909['params']['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0x4c9b09,null))[_0x00c7('0x26')](removeEntity(_0x4c9b09,null))[_0x00c7('0x42')](handleError(_0x4c9b09,null));}; \ No newline at end of file +var _0xf2cc=['userProfileId','autoAssociation','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','update','then','Variables','UserProfileResource','destroy','error','stack','name','send','Variable','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','length','includeAll','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4d0ba7,_0x5342c9){var _0x1a9b6e=function(_0x365dc4){while(--_0x365dc4){_0x4d0ba7['push'](_0x4d0ba7['shift']());}};_0x1a9b6e(++_0x5342c9);}(_0xf2cc,0xe8));var _0xcf2c=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf2cc[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xcf2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf2c('0x2'));var moment=require(_0xcf2c('0x3'));var BPromise=require(_0xcf2c('0x4'));var Mustache=require(_0xcf2c('0x5'));var util=require(_0xcf2c('0x6'));var path=require(_0xcf2c('0x7'));var sox=require('sox');var csv=require(_0xcf2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf2c('0x9'));var _=require('lodash');var squel=require(_0xcf2c('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf2c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcf2c('0x8'));var querystring=require(_0xcf2c('0xc'));var Papa=require('papaparse');var Redis=require(_0xcf2c('0xd'));var authService=require(_0xcf2c('0xe'));var qs=require(_0xcf2c('0xf'));var as=require(_0xcf2c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcf2c('0x11'));var db=require(_0xcf2c('0x12'))['db'];function respondWithStatusCode(_0x4d117f,_0x11403c){_0x11403c=_0x11403c||0xcc;return function(_0x48c923){if(_0x48c923){return _0x4d117f['sendStatus'](_0x11403c);}return _0x4d117f['status'](_0x11403c)['end']();};}function respondWithResult(_0x1db334,_0x36739e){_0x36739e=_0x36739e||0xc8;return function(_0x21843e){if(_0x21843e){return _0x1db334[_0xcf2c('0x13')](_0x36739e)[_0xcf2c('0x14')](_0x21843e);}};}function respondWithFilteredResult(_0x2c2df5,_0x43b1d9){return function(_0xc1b714){if(_0xc1b714){var _0x3d4e65=typeof _0x43b1d9[_0xcf2c('0x15')]===_0xcf2c('0x16')&&typeof _0x43b1d9['limit']===_0xcf2c('0x16');var _0x3312c0=_0xc1b714['count'];var _0x40de98=_0x3d4e65?0x0:_0x43b1d9[_0xcf2c('0x15')];var _0x3b6973=_0x3d4e65?_0xc1b714['count']:_0x43b1d9[_0xcf2c('0x15')]+_0x43b1d9[_0xcf2c('0x17')];var _0x21c95c;if(_0x3b6973>=_0x3312c0){_0x3b6973=_0x3312c0;_0x21c95c=0xc8;}else{_0x21c95c=0xce;}_0x2c2df5[_0xcf2c('0x13')](_0x21c95c);return _0x2c2df5[_0xcf2c('0x18')]('Content-Range',_0x40de98+'-'+_0x3b6973+'/'+_0x3312c0)[_0xcf2c('0x14')](_0xc1b714);}return null;};}function patchUpdates(_0x5399e4){return function(_0x271a0c){try{jsonpatch[_0xcf2c('0x19')](_0x271a0c,_0x5399e4,!![]);}catch(_0x4d4c0e){return BPromise[_0xcf2c('0x1a')](_0x4d4c0e);}return _0x271a0c['save']();};}function saveUpdates(_0x416b0c,_0x3c317b){return function(_0xcb48a){if(_0xcb48a){return _0xcb48a[_0xcf2c('0x1b')](_0x416b0c)['then'](function(_0x38da81){return _0x38da81;});}return null;};}function removeEntity(_0x5bb679,_0x49043f){return function(_0x3253e7){if(_0x3253e7){return _0x3253e7['destroy']()[_0xcf2c('0x1c')](function(){var _0x57bdf1=_0x3253e7['get']({'plain':!![]});var _0x3dfea0=_0xcf2c('0x1d');return db[_0xcf2c('0x1e')][_0xcf2c('0x1f')]({'where':{'type':_0x3dfea0,'resourceId':_0x57bdf1['id']}})[_0xcf2c('0x1c')](function(){return _0x3253e7;});})[_0xcf2c('0x1c')](function(){_0x5bb679[_0xcf2c('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df230,_0x5307f5){return function(_0x45cc34){if(!_0x45cc34){_0x1df230['sendStatus'](0x194);}return _0x45cc34;};}function handleError(_0x30fef0,_0x418032){_0x418032=_0x418032||0x1f4;return function(_0x27ed95){logger[_0xcf2c('0x20')](_0x27ed95[_0xcf2c('0x21')]);if(_0x27ed95[_0xcf2c('0x22')]){delete _0x27ed95[_0xcf2c('0x22')];}_0x30fef0['status'](_0x418032)[_0xcf2c('0x23')](_0x27ed95);};}exports['index']=function(_0x7a3d35,_0x345498){var _0x280cfb={},_0x35c9af={},_0x245cdb={'count':0x0,'rows':[]};var _0x1f1d3f=_['map'](db[_0xcf2c('0x24')][_0xcf2c('0x25')],function(_0x2e6ed4){return{'name':_0x2e6ed4[_0xcf2c('0x26')],'type':_0x2e6ed4[_0xcf2c('0x27')][_0xcf2c('0x28')]};});_0x35c9af[_0xcf2c('0x29')]=_[_0xcf2c('0x2a')](_0x1f1d3f,_0xcf2c('0x22'));_0x35c9af[_0xcf2c('0x2b')]=_[_0xcf2c('0x2c')](_0x7a3d35[_0xcf2c('0x2b')]);_0x35c9af[_0xcf2c('0x2d')]=_[_0xcf2c('0x2e')](_0x35c9af['model'],_0x35c9af[_0xcf2c('0x2b')]);_0x280cfb[_0xcf2c('0x2f')]=_[_0xcf2c('0x2e')](_0x35c9af['model'],qs[_0xcf2c('0x30')](_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x30')]));_0x280cfb['attributes']=_0x280cfb[_0xcf2c('0x2f')]['length']?_0x280cfb[_0xcf2c('0x2f')]:_0x35c9af[_0xcf2c('0x29')];if(!_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x31')]('nolimit')){_0x280cfb['limit']=qs[_0xcf2c('0x17')](_0x7a3d35[_0xcf2c('0x2b')]['limit']);_0x280cfb[_0xcf2c('0x15')]=qs[_0xcf2c('0x15')](_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x15')]);}_0x280cfb[_0xcf2c('0x32')]=qs[_0xcf2c('0x33')](_0x7a3d35['query'][_0xcf2c('0x33')]);_0x280cfb[_0xcf2c('0x34')]=qs[_0xcf2c('0x2d')](_['pick'](_0x7a3d35['query'],_0x35c9af[_0xcf2c('0x2d')]),_0x1f1d3f);if(_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x35')]){_0x280cfb[_0xcf2c('0x34')]=_[_0xcf2c('0x36')](_0x280cfb['where'],{'$or':_['map'](_0x1f1d3f,function(_0x463752){if(_0x463752[_0xcf2c('0x27')]!==_0xcf2c('0x37')){var _0x513021={};_0x513021[_0x463752[_0xcf2c('0x22')]]={'$like':'%'+_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x35')]+'%'};return _0x513021;}})});}_0x280cfb=_[_0xcf2c('0x36')]({},_0x280cfb,_0x7a3d35[_0xcf2c('0x38')]);var _0x4d4a60={'where':_0x280cfb[_0xcf2c('0x34')]};return db[_0xcf2c('0x24')][_0xcf2c('0x39')](_0x4d4a60)[_0xcf2c('0x1c')](function(_0x37bdb9){_0x245cdb['count']=_0x37bdb9;if(_0x7a3d35[_0xcf2c('0x2b')]['includeAll']){_0x280cfb['include']=[{'all':!![]}];}return db[_0xcf2c('0x24')][_0xcf2c('0x3a')](_0x280cfb);})['then'](function(_0x5be8be){_0x245cdb[_0xcf2c('0x3b')]=_0x5be8be;return _0x245cdb;})['then'](respondWithFilteredResult(_0x345498,_0x280cfb))[_0xcf2c('0x3c')](handleError(_0x345498,null));};exports[_0xcf2c('0x3d')]=function(_0x2ab50d,_0x23234d){var _0x18e51c={'raw':!![],'where':{'id':_0x2ab50d['params']['id']}},_0x438d6f={};_0x438d6f['model']=_[_0xcf2c('0x2c')](db['Variable']['rawAttributes']);_0x438d6f[_0xcf2c('0x2b')]=_['keys'](_0x2ab50d[_0xcf2c('0x2b')]);_0x438d6f[_0xcf2c('0x2d')]=_[_0xcf2c('0x2e')](_0x438d6f[_0xcf2c('0x29')],_0x438d6f[_0xcf2c('0x2b')]);_0x18e51c[_0xcf2c('0x2f')]=_[_0xcf2c('0x2e')](_0x438d6f[_0xcf2c('0x29')],qs['fields'](_0x2ab50d['query'][_0xcf2c('0x30')]));_0x18e51c[_0xcf2c('0x2f')]=_0x18e51c[_0xcf2c('0x2f')][_0xcf2c('0x3e')]?_0x18e51c['attributes']:_0x438d6f[_0xcf2c('0x29')];if(_0x2ab50d[_0xcf2c('0x2b')][_0xcf2c('0x3f')]){_0x18e51c[_0xcf2c('0x40')]=[{'all':!![]}];}_0x18e51c=_['merge']({},_0x18e51c,_0x2ab50d[_0xcf2c('0x38')]);return db[_0xcf2c('0x24')][_0xcf2c('0x41')](_0x18e51c)['then'](handleEntityNotFound(_0x23234d,null))['then'](respondWithResult(_0x23234d,null))['catch'](handleError(_0x23234d,null));};exports[_0xcf2c('0x42')]=function(_0x4f5b89,_0x311089){return db[_0xcf2c('0x24')][_0xcf2c('0x42')](_0x4f5b89['body'],{})[_0xcf2c('0x1c')](function(_0x7084db){var _0x301fe9=_0x4f5b89[_0xcf2c('0x43')][_0xcf2c('0x44')]({'plain':!![]});if(!_0x301fe9)throw new Error(_0xcf2c('0x45'));if(_0x301fe9[_0xcf2c('0x46')]==='user'){var _0x316139=_0x7084db[_0xcf2c('0x44')]({'plain':!![]});var _0x5d253e=_0xcf2c('0x1d');return db[_0xcf2c('0x47')][_0xcf2c('0x41')]({'where':{'name':_0x5d253e,'userProfileId':_0x301fe9[_0xcf2c('0x48')]},'raw':!![]})[_0xcf2c('0x1c')](function(_0x34084d){if(_0x34084d&&_0x34084d[_0xcf2c('0x49')]===0x0){return db[_0xcf2c('0x1e')][_0xcf2c('0x42')]({'name':_0x316139['name'],'resourceId':_0x316139['id'],'type':_0x34084d[_0xcf2c('0x22')],'sectionId':_0x34084d['id']},{})['then'](function(){return _0x7084db;});}else{return _0x7084db;}})[_0xcf2c('0x3c')](function(_0x5c1b70){logger[_0xcf2c('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c1b70);throw _0x5c1b70;});}return _0x7084db;})[_0xcf2c('0x1c')](respondWithResult(_0x311089,0xc9))[_0xcf2c('0x3c')](handleError(_0x311089,null));};exports['update']=function(_0x39989f,_0x956a05){if(_0x39989f[_0xcf2c('0x4a')]['id']){delete _0x39989f['body']['id'];}return db[_0xcf2c('0x24')][_0xcf2c('0x41')]({'where':{'id':_0x39989f['params']['id']}})[_0xcf2c('0x1c')](handleEntityNotFound(_0x956a05,null))[_0xcf2c('0x1c')](saveUpdates(_0x39989f['body'],null))[_0xcf2c('0x1c')](respondWithResult(_0x956a05,null))[_0xcf2c('0x3c')](handleError(_0x956a05,null));};exports[_0xcf2c('0x1f')]=function(_0xe46830,_0x46bb37){return db[_0xcf2c('0x24')]['find']({'where':{'id':_0xe46830[_0xcf2c('0x4b')]['id']}})[_0xcf2c('0x1c')](handleEntityNotFound(_0x46bb37,null))[_0xcf2c('0x1c')](removeEntity(_0x46bb37,null))[_0xcf2c('0x3c')](handleError(_0x46bb37,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c43e8c0..93867b1 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 _0xb856=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','Variable','tools_variables'];(function(_0x20658b,_0x1ecf9d){var _0x419da6=function(_0x17c373){while(--_0x17c373){_0x20658b['push'](_0x20658b['shift']());}};_0x419da6(++_0x1ecf9d);}(_0xb856,0xfc));var _0x6b85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb856[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6b85('0x0'));var util=require(_0x6b85('0x1'));var logger=require(_0x6b85('0x2'))(_0x6b85('0x3'));var moment=require('moment');var BPromise=require(_0x6b85('0x4'));var rp=require(_0x6b85('0x5'));var fs=require('fs');var path=require(_0x6b85('0x6'));var rimraf=require(_0x6b85('0x7'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x6b85('0x8')]=function(_0x3e132d,_0x2ec00a){return _0x3e132d[_0x6b85('0x9')](_0x6b85('0xa'),attributes,{'tableName':_0x6b85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8486=['moment','request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x22593a,_0x58ddca){var _0x3a0488=function(_0x392a7e){while(--_0x392a7e){_0x22593a['push'](_0x22593a['shift']());}};_0x3a0488(++_0x58ddca);}(_0x8486,0x1b4));var _0x6848=function(_0x3f2ee0,_0x5959c7){_0x3f2ee0=_0x3f2ee0-0x0;var _0x5bf957=_0x8486[_0x3f2ee0];return _0x5bf957;};'use strict';var _=require(_0x6848('0x0'));var util=require(_0x6848('0x1'));var logger=require(_0x6848('0x2'))(_0x6848('0x3'));var moment=require(_0x6848('0x4'));var BPromise=require('bluebird');var rp=require(_0x6848('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6848('0x6'));var config=require(_0x6848('0x7'));var attributes=require('./variable.attributes');module[_0x6848('0x8')]=function(_0x30421a,_0x360f78){return _0x30421a['define'](_0x6848('0x9'),attributes,{'tableName':_0x6848('0xa'),'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 2451896..b035a53 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 _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0xfb3c50,_0x58e878){var _0x17eea7=function(_0x2133bc){while(--_0x2133bc){_0xfb3c50['push'](_0xfb3c50['shift']());}};_0x17eea7(++_0x58e878);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0x4b84[_0x5bf420];return _0x1c5255;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x1f0aa9,_0x3852ff){var _0x23cda4=function(_0x4a3ed8){while(--_0x4a3ed8){_0x1f0aa9['push'](_0x1f0aa9['shift']());}};_0x23cda4(++_0x3852ff);}(_0x6aa7,0x178));var _0x76aa=function(_0x33bf5a,_0x416617){_0x33bf5a=_0x33bf5a-0x0;var _0x1d486e=_0x6aa7[_0x33bf5a];return _0x1d486e;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8bc6ff9..8517f36 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 _0x9e66=['canUpdate','reset','pull','/restart','/migrations','migrations','exports','express','./version.controller','index','get','isAuthenticated','fetch','/reset'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x9e66,0x11f));var _0x69e6=function(_0x57d475,_0x48f44c){_0x57d475=_0x57d475-0x0;var _0x5b74e1=_0x9e66[_0x57d475];return _0x5b74e1;};'use strict';var express=require(_0x69e6('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x69e6('0x1'));router['get']('/',controller[_0x69e6('0x2')]);router[_0x69e6('0x3')]('/fetch',auth[_0x69e6('0x4')](),auth['canUpdate'](),controller[_0x69e6('0x5')]);router[_0x69e6('0x3')](_0x69e6('0x6'),auth[_0x69e6('0x4')](),auth[_0x69e6('0x7')](),controller[_0x69e6('0x8')]);router[_0x69e6('0x3')]('/pull',auth[_0x69e6('0x4')](),auth[_0x69e6('0x7')](),controller[_0x69e6('0x9')]);router[_0x69e6('0x3')](_0x69e6('0xa'),auth[_0x69e6('0x4')](),controller['restart']);router[_0x69e6('0x3')](_0x69e6('0xb'),controller[_0x69e6('0xc')]);module[_0x69e6('0xd')]=router; \ No newline at end of file +var _0x8658=['get','/reset','reset','pull','restart','/migrations','Router','../../components/auth/service','./version.controller','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x157fea,_0x1a86fd){var _0x5c508b=function(_0x3a5663){while(--_0x3a5663){_0x157fea['push'](_0x157fea['shift']());}};_0x5c508b(++_0x1a86fd);}(_0x8658,0x124));var _0x8865=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8658[_0x21a9d9];return _0x46adce;};'use strict';var express=require('express');var router=express[_0x8865('0x0')]();var auth=require(_0x8865('0x1'));var controller=require(_0x8865('0x2'));router['get']('/',controller['index']);router['get'](_0x8865('0x3'),auth[_0x8865('0x4')](),auth[_0x8865('0x5')](),controller[_0x8865('0x6')]);router[_0x8865('0x7')](_0x8865('0x8'),auth['isAuthenticated'](),auth[_0x8865('0x5')](),controller[_0x8865('0x9')]);router[_0x8865('0x7')]('/pull',auth[_0x8865('0x4')](),auth['canUpdate'](),controller[_0x8865('0xa')]);router[_0x8865('0x7')]('/restart',auth[_0x8865('0x4')](),controller[_0x8865('0xb')]);router[_0x8865('0x7')](_0x8865('0xc'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cac28cb..4adf832 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 _0x17c5=['latest','tags','2.0.0','status','json','fetch','origin','master','error','reset','--hard','info','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','root','map','Database\x20migrated\x20successfully\x20from\x20version\x20','exports','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','index','version','query'];(function(_0x4c1965,_0x32f22b){var _0x548bff=function(_0x3804a2){while(--_0x3804a2){_0x4c1965['push'](_0x4c1965['shift']());}};_0x548bff(++_0x32f22b);}(_0x17c5,0xef));var _0x517c=function(_0x46aa6f,_0xf7b072){_0x46aa6f=_0x46aa6f-0x0;var _0x44759c=_0x17c5[_0x46aa6f];return _0x44759c;};'use strict';var Umzug=require(_0x517c('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x517c('0x1'));var exec=require(_0x517c('0x2'))[_0x517c('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x517c('0x4'));var pm2=require('../../config/pm2');var logger=require(_0x517c('0x5'))(_0x517c('0x6'));var git=require(_0x517c('0x7'))(config['root']);exports[_0x517c('0x8')]=function(_0x5977ba,_0x5354fa){var _0x5ee4b0={'current':module['exports'][_0x517c('0x9')],'phonebar':0x2};if(_0x5977ba[_0x517c('0xa')]&&_0x5977ba['query'][_0x517c('0xb')]){return git['fetch']()[_0x517c('0xc')](function(_0x4ed73b,_0x401479){_0x5ee4b0[_0x517c('0xb')]=(_0x4ed73b?module['exports'][_0x517c('0x9')]:_0x401479[_0x517c('0xb')])||_0x517c('0xd');return _0x5354fa[_0x517c('0xe')](0xc8)[_0x517c('0xf')](_0x5ee4b0);});}else{return _0x5354fa[_0x517c('0xe')](0xc8)[_0x517c('0xf')](_0x5ee4b0);}};exports['fetch']=function(_0x23c090,_0x28ba62){return git[_0x517c('0x10')]([_0x517c('0x11'),_0x517c('0x12')],function(_0x401c41){if(_0x401c41){logger[_0x517c('0x13')](_0x401c41);return _0x28ba62[_0x517c('0xe')](0x1f4)[_0x517c('0xf')](_0x401c41);}logger['info']('git\x20fetch');return _0x28ba62[_0x517c('0xe')](0xc8)[_0x517c('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x6d1a94,_0x21432c){return git[_0x517c('0x14')]([_0x517c('0x15'),'FETCH_HEAD'],function(_0xdee920){if(_0xdee920){logger['error'](_0xdee920);return _0x21432c['status'](0x1f4)[_0x517c('0xf')](_0xdee920);}logger[_0x517c('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x21432c['status'](0xc8)[_0x517c('0xf')]({'output':_0x517c('0x17')});});};exports['pull']=function(_0x3b244d,_0x3de5d6){exec(_0x517c('0x18'),function(_0x497f2c,_0x19ef2d,_0x2447c1){logger[_0x517c('0x16')](_0x19ef2d);logger[_0x517c('0x16')](_0x2447c1);if(_0x497f2c){logger[_0x517c('0x13')](_0x497f2c);return _0x3de5d6[_0x517c('0xe')](0x1f4)['json'](_0x497f2c);}return _0x3de5d6[_0x517c('0xe')](0xc8)[_0x517c('0xf')]({'output':_0x19ef2d});});};exports['restart']=function(_0x35246e,_0x5a3e1c){return pm2[_0x517c('0x19')]('motion2')[_0x517c('0x1a')](function(_0x58a82d){logger[_0x517c('0x16')](_0x517c('0x1b'),_0x58a82d);return _0x5a3e1c['status'](0xc8)[_0x517c('0xf')]({'output':_0x517c('0x1c')});})[_0x517c('0x1d')](function(_0x259bca){logger[_0x517c('0x13')](_0x259bca);return _0x5a3e1c[_0x517c('0xe')](0x1f4)['json'](_0x259bca);});};exports[_0x517c('0x1e')]=function(_0x4d9530,_0x416818){var _0x391949=fs[_0x517c('0x1f')](path[_0x517c('0x20')](config['root'],_0x517c('0x21'),_0x517c('0x1e')));var _0x2676b5=[];for(var _0x12ee88=0x0;_0x12ee88<_0x391949[_0x517c('0x22')];_0x12ee88++){var _0x217af4=_0x391949[_0x12ee88]['replace'](_0x517c('0x23'),'');if(compareVersions(module['exports'][_0x517c('0x9')],_0x217af4)===-0x1){_0x2676b5[_0x517c('0x24')](_0x217af4);}}if(_0x2676b5['length']){var _0x5bca78=_0x2676b5[_0x517c('0x25')](compareVersions);var _0x1f15b7=new Umzug({'storage':_0x517c('0x26'),'storageOptions':{'model':db[_0x517c('0x27')],'modelName':_0x517c('0x27'),'columnName':_0x517c('0x9')},'migrations':{'params':[db[_0x517c('0x26')][_0x517c('0x28')](),db['sequelize']['constructor'],function(){throw new Error(_0x517c('0x29'));}],'path':path[_0x517c('0x20')](config[_0x517c('0x2a')],_0x517c('0x21'),_0x517c('0x1e')),'pattern':/\.js$/}});_0x1f15b7['up']({'migrations':_[_0x517c('0x2b')](_0x5bca78,function(_0x35ef58){return _0x35ef58+'.js';})})['then'](function(){return _0x416818[_0x517c('0xe')](0xc8)[_0x517c('0xf')]({'output':_0x517c('0x2c')+module[_0x517c('0x2d')]['version']+_0x517c('0x2e')+_[_0x517c('0x2f')](_0x5bca78),'migrations':_[_0x517c('0x20')](_0x5bca78)});})[_0x517c('0x1d')](function(_0x201aca){if(_0x201aca instanceof db[_0x517c('0x26')][_0x517c('0x30')]){return _0x416818[_0x517c('0xe')](0xc8)[_0x517c('0xf')]({'output':_0x517c('0x31')});}else{return _0x416818[_0x517c('0xe')](0x1f4)['json'](_0x201aca);}});}else{return _0x416818[_0x517c('0xe')](0xc8)['json']({'output':_0x517c('0x31')});}}; \ No newline at end of file +var _0xff21=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','child_process','exec','../../config/environment','../../config/logger','simple-git','root','index','exports','version','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','migrations','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface'];(function(_0x496436,_0xd549cc){var _0x24ff50=function(_0xd76a68){while(--_0xd76a68){_0x496436['push'](_0x496436['shift']());}};_0x24ff50(++_0xd549cc);}(_0xff21,0xda));var _0x1ff2=function(_0x5e0664,_0x4307dc){_0x5e0664=_0x5e0664-0x0;var _0x51ed02=_0xff21[_0x5e0664];return _0x51ed02;};'use strict';var Umzug=require(_0x1ff2('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1ff2('0x1'));var pkginfo=require(_0x1ff2('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x1ff2('0x3'))[_0x1ff2('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x1ff2('0x5'));var pm2=require('../../config/pm2');var logger=require(_0x1ff2('0x6'))('update');var git=require(_0x1ff2('0x7'))(config[_0x1ff2('0x8')]);exports[_0x1ff2('0x9')]=function(_0x517fcb,_0x5cde43){var _0x18d0c3={'current':module[_0x1ff2('0xa')][_0x1ff2('0xb')],'phonebar':0x2};if(_0x517fcb[_0x1ff2('0xc')]&&_0x517fcb[_0x1ff2('0xc')][_0x1ff2('0xd')]){return git[_0x1ff2('0xe')]()[_0x1ff2('0xf')](function(_0x220b84,_0x1355c5){_0x18d0c3['latest']=(_0x220b84?module[_0x1ff2('0xa')][_0x1ff2('0xb')]:_0x1355c5['latest'])||_0x1ff2('0x10');return _0x5cde43['status'](0xc8)[_0x1ff2('0x11')](_0x18d0c3);});}else{return _0x5cde43[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')](_0x18d0c3);}};exports[_0x1ff2('0xe')]=function(_0x1b3c83,_0x23ef1c){return git[_0x1ff2('0xe')]([_0x1ff2('0x13'),_0x1ff2('0x14')],function(_0x32efb2){if(_0x32efb2){logger[_0x1ff2('0x15')](_0x32efb2);return _0x23ef1c['status'](0x1f4)['json'](_0x32efb2);}logger[_0x1ff2('0x16')]('git\x20fetch');return _0x23ef1c[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x17')});});};exports['reset']=function(_0x3ad2d8,_0x2f70f8){return git[_0x1ff2('0x18')]([_0x1ff2('0x19'),_0x1ff2('0x1a')],function(_0x543b5c){if(_0x543b5c){logger[_0x1ff2('0x15')](_0x543b5c);return _0x2f70f8['status'](0x1f4)[_0x1ff2('0x11')](_0x543b5c);}logger[_0x1ff2('0x16')](_0x1ff2('0x1b'));return _0x2f70f8[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x1c')});});};exports[_0x1ff2('0x1d')]=function(_0x26edb9,_0x287a65){exec(_0x1ff2('0x1e'),function(_0x313ea9,_0xfd0cad,_0x5152b6){logger[_0x1ff2('0x16')](_0xfd0cad);logger[_0x1ff2('0x16')](_0x5152b6);if(_0x313ea9){logger['error'](_0x313ea9);return _0x287a65['status'](0x1f4)['json'](_0x313ea9);}return _0x287a65[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0xfd0cad});});};exports[_0x1ff2('0x1f')]=function(_0x2ea1bd,_0x501d74){return pm2[_0x1ff2('0x1f')](_0x1ff2('0x20'))[_0x1ff2('0x21')](function(_0x14c398){logger[_0x1ff2('0x16')]('pm2\x20restart\x20motion\x20%s',_0x14c398);return _0x501d74[_0x1ff2('0x12')](0xc8)['json']({'output':_0x1ff2('0x22')});})[_0x1ff2('0x23')](function(_0x26ea92){logger['error'](_0x26ea92);return _0x501d74['status'](0x1f4)[_0x1ff2('0x11')](_0x26ea92);});};exports['migrations']=function(_0x34fbf3,_0x1c1249){var _0x1b9afd=fs[_0x1ff2('0x24')](path[_0x1ff2('0x25')](config[_0x1ff2('0x8')],'server',_0x1ff2('0x26')));var _0x26b6ef=[];for(var _0x1c854e=0x0;_0x1c854e<_0x1b9afd['length'];_0x1c854e++){var _0x38ac52=_0x1b9afd[_0x1c854e][_0x1ff2('0x27')](_0x1ff2('0x28'),'');if(compareVersions(module[_0x1ff2('0xa')][_0x1ff2('0xb')],_0x38ac52)===-0x1){_0x26b6ef[_0x1ff2('0x29')](_0x38ac52);}}if(_0x26b6ef[_0x1ff2('0x2a')]){var _0x297b9a=_0x26b6ef[_0x1ff2('0x2b')](compareVersions);var _0x1631c4=new Umzug({'storage':_0x1ff2('0x2c'),'storageOptions':{'model':db[_0x1ff2('0x2d')],'modelName':_0x1ff2('0x2d'),'columnName':'version'},'migrations':{'params':[db[_0x1ff2('0x2c')][_0x1ff2('0x2e')](),db[_0x1ff2('0x2c')][_0x1ff2('0x2f')],function(){throw new Error(_0x1ff2('0x30'));}],'path':path[_0x1ff2('0x25')](config['root'],'server',_0x1ff2('0x26')),'pattern':/\.js$/}});_0x1631c4['up']({'migrations':_[_0x1ff2('0x31')](_0x297b9a,function(_0x3ec84b){return _0x3ec84b+_0x1ff2('0x28');})})[_0x1ff2('0x21')](function(){return _0x1c1249['status'](0xc8)[_0x1ff2('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x1ff2('0xa')][_0x1ff2('0xb')]+_0x1ff2('0x32')+_['last'](_0x297b9a),'migrations':_['join'](_0x297b9a)});})[_0x1ff2('0x23')](function(_0x21f509){if(_0x21f509 instanceof db[_0x1ff2('0x2c')][_0x1ff2('0x33')]){return _0x1c1249[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x34')});}else{return _0x1c1249[_0x1ff2('0x12')](0x1f4)[_0x1ff2('0x11')](_0x21f509);}});}else{return _0x1c1249[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 8de0131..b424bb7 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 _0xa1ea=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete'];(function(_0x5a0927,_0x1de958){var _0x19a3b9=function(_0x51c15f){while(--_0x51c15f){_0x5a0927['push'](_0x5a0927['shift']());}};_0x19a3b9(++_0x1de958);}(_0xa1ea,0x110));var _0xaa1e=function(_0x130dd0,_0x1f18c3){_0x130dd0=_0x130dd0-0x0;var _0x5161f4=_0xa1ea[_0x130dd0];return _0x5161f4;};'use strict';var multer=require(_0xaa1e('0x0'));var util=require(_0xaa1e('0x1'));var path=require('path');var timeout=require(_0xaa1e('0x2'));var express=require('express');var router=express[_0xaa1e('0x3')]();var fs_extra=require(_0xaa1e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa1e('0x5'));var controller=require(_0xaa1e('0x6'));router[_0xaa1e('0x7')]('/',auth[_0xaa1e('0x8')](),controller['index']);router['get'](_0xaa1e('0x9'),auth[_0xaa1e('0x8')](),controller[_0xaa1e('0xa')]);router['get'](_0xaa1e('0xb'),auth['isAuthenticated'](),controller[_0xaa1e('0xc')]);router[_0xaa1e('0xd')]('/',auth[_0xaa1e('0x8')](),controller[_0xaa1e('0xe')]);router['put'](_0xaa1e('0xb'),auth[_0xaa1e('0x8')](),controller['update']);router[_0xaa1e('0xf')]('/:id',auth[_0xaa1e('0x8')](),controller[_0xaa1e('0x10')]);module[_0xaa1e('0x11')]=router; \ No newline at end of file +var _0xf420=['../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf420,0x118));var _0x0f42=function(_0x3c340e,_0x33c8bc){_0x3c340e=_0x3c340e-0x0;var _0x2c82b6=_0xf420[_0x3c340e];return _0x2c82b6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0f42('0x0'));var express=require(_0x0f42('0x1'));var router=express[_0x0f42('0x2')]();var fs_extra=require(_0x0f42('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0f42('0x4'));var config=require(_0x0f42('0x5'));var controller=require(_0x0f42('0x6'));router['get']('/',auth[_0x0f42('0x7')](),controller['index']);router[_0x0f42('0x8')](_0x0f42('0x9'),auth[_0x0f42('0x7')](),controller[_0x0f42('0xa')]);router[_0x0f42('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0f42('0xb')]);router[_0x0f42('0xc')]('/',auth[_0x0f42('0x7')](),controller[_0x0f42('0xd')]);router[_0x0f42('0xe')](_0x0f42('0xf'),auth[_0x0f42('0x7')](),controller['update']);router[_0x0f42('0x10')](_0x0f42('0xf'),auth[_0x0f42('0x7')](),controller[_0x0f42('0x11')]);module[_0x0f42('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 918d1c7..1533c80 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 _0xefda=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x38fc54,_0xf044cb){var _0x2102f0=function(_0x44dd34){while(--_0x44dd34){_0x38fc54['push'](_0x38fc54['shift']());}};_0x2102f0(++_0xf044cb);}(_0xefda,0x96));var _0xaefd=function(_0xbecf37,_0x36ddb7){_0xbecf37=_0xbecf37-0x0;var _0x3dcc05=_0xefda[_0xbecf37];return _0x3dcc05;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaefd('0x1')]},'calleridnum':{'type':Sequelize[_0xaefd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xaefd('0x1')]},'interface':{'type':Sequelize[_0xaefd('0x1')]},'membername':{'type':Sequelize[_0xaefd('0x1')]},'agentcalledAt':{'type':Sequelize[_0xaefd('0x2')]},'agentconnectAt':{'type':Sequelize[_0xaefd('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xaefd('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xaefd('0x2')]},'holdtime':{'type':Sequelize[_0xaefd('0x3')]},'agentcomplete':{'type':Sequelize[_0xaefd('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaefd('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaefd('0x3')]},'agentacw':{'type':Sequelize[_0xaefd('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaefd('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaefd('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaefd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xaefd('0x1')]},'connectedlinename':{'type':Sequelize[_0xaefd('0x1')]},'language':{'type':Sequelize[_0xaefd('0x1')]},'accountcode':{'type':Sequelize[_0xaefd('0x1')]},'context':{'type':Sequelize[_0xaefd('0x1')]},'exten':{'type':Sequelize[_0xaefd('0x1')]},'priority':{'type':Sequelize[_0xaefd('0x1')]},'destchannel':{'type':Sequelize[_0xaefd('0x1')]},'destchannelstate':{'type':Sequelize[_0xaefd('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xaefd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xaefd('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xaefd('0x1')]},'destlanguage':{'type':Sequelize[_0xaefd('0x1')]},'destaccountcode':{'type':Sequelize[_0xaefd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xaefd('0x1')]},'destpriority':{'type':Sequelize[_0xaefd('0x1')]},'destuniqueid':{'type':Sequelize[_0xaefd('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaefd('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xaefd('0x1')]},'transfer':{'type':Sequelize[_0xaefd('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaefd('0x1')],'comment':_0xaefd('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xaefd('0x1')]},'agententerreason':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd5c8=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x2b012b,_0x463e28){var _0x32c4cf=function(_0x5871f2){while(--_0x5871f2){_0x2b012b['push'](_0x2b012b['shift']());}};_0x32c4cf(++_0x463e28);}(_0xd5c8,0x166));var _0x8d5c=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xd5c8[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d5c('0x0')]},'uniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'calleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'calleridname':{'type':Sequelize[_0x8d5c('0x0')]},'queue':{'type':Sequelize[_0x8d5c('0x0')]},'interface':{'type':Sequelize[_0x8d5c('0x0')]},'membername':{'type':Sequelize[_0x8d5c('0x0')]},'agentcalledAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentconnectAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8d5c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8d5c('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8d5c('0x0')]},'channelstate':{'type':Sequelize[_0x8d5c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'language':{'type':Sequelize[_0x8d5c('0x0')]},'accountcode':{'type':Sequelize[_0x8d5c('0x0')]},'context':{'type':Sequelize[_0x8d5c('0x0')]},'exten':{'type':Sequelize[_0x8d5c('0x0')]},'priority':{'type':Sequelize[_0x8d5c('0x0')]},'destchannel':{'type':Sequelize[_0x8d5c('0x0')]},'destchannelstate':{'type':Sequelize[_0x8d5c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'destcalleridname':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'destlanguage':{'type':Sequelize[_0x8d5c('0x0')]},'destaccountcode':{'type':Sequelize[_0x8d5c('0x0')]},'destcontext':{'type':Sequelize[_0x8d5c('0x0')]},'destexten':{'type':Sequelize[_0x8d5c('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d5c('0x0')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8d5c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 0b61320..c512724 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 _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 0bf397b..c12a0b8 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 _0x0763=['path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5ddedf,_0x14c256){var _0x2af0d3=function(_0x50b79d){while(--_0x50b79d){_0x5ddedf['push'](_0x5ddedf['shift']());}};_0x2af0d3(++_0x14c256);}(_0x0763,0x87));var _0x3076=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x0763[_0x496738];return _0xee1381;};'use strict';var _=require(_0x3076('0x0'));var util=require('util');var logger=require(_0x3076('0x1'))(_0x3076('0x2'));var moment=require('moment');var BPromise=require(_0x3076('0x3'));var rp=require(_0x3076('0x4'));var fs=require('fs');var path=require(_0x3076('0x5'));var rimraf=require(_0x3076('0x6'));var config=require('../../config/environment');var attributes=require(_0x3076('0x7'));module[_0x3076('0x8')]=function(_0x1ce2ff,_0x1b5f4e){return _0x1ce2ff[_0x3076('0x9')](_0x3076('0xa'),attributes,{'tableName':_0x3076('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3076('0xc'),_0x3076('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0618=['util','api','moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x292688,_0x4ed5d4){var _0x12f117=function(_0x528959){while(--_0x528959){_0x292688['push'](_0x292688['shift']());}};_0x12f117(++_0x4ed5d4);}(_0x0618,0x1c6));var _0x8061=function(_0x269cdd,_0xed07f7){_0x269cdd=_0x269cdd-0x0;var _0x40c5c9=_0x0618[_0x269cdd];return _0x40c5c9;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var logger=require('../../config/logger')(_0x8061('0x2'));var moment=require(_0x8061('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8061('0x4'));var rimraf=require(_0x8061('0x5'));var config=require(_0x8061('0x6'));var attributes=require(_0x8061('0x7'));module[_0x8061('0x8')]=function(_0x2c47b6,_0x1cca7f){return _0x2c47b6[_0x8061('0x9')](_0x8061('0xa'),attributes,{'tableName':_0x8061('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8061('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 75c693e..fe4130c 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 _0xd859=['stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','body','where','UpdateVoiceAgentReport','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2833d2,_0x17c3d8){var _0x43fb18=function(_0x501264){while(--_0x501264){_0x2833d2['push'](_0x2833d2['shift']());}};_0x43fb18(++_0x17c3d8);}(_0xd859,0x1ce));var _0x9d85=function(_0x1b0452,_0x3c69a5){_0x1b0452=_0x1b0452-0x0;var _0x140bb1=_0xd859[_0x1b0452];return _0x140bb1;};'use strict';var _=require(_0x9d85('0x0'));var util=require(_0x9d85('0x1'));var moment=require(_0x9d85('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d85('0x3'));var fs=require('fs');var Redis=require(_0x9d85('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d85('0x5'));var logger=require(_0x9d85('0x6'))(_0x9d85('0x7'));var config=require(_0x9d85('0x8'));var jayson=require(_0x9d85('0x9'));var client=jayson[_0x9d85('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ded14,_0x1b0b08,_0xb1d2d5){return new BPromise(function(_0x316b30,_0x2c860a){return client[_0x9d85('0xb')](_0x4ded14,_0xb1d2d5)[_0x9d85('0xc')](function(_0x4cb23c){logger[_0x9d85('0xd')](_0x9d85('0xe'),_0x1b0b08,'request\x20sent');logger[_0x9d85('0xf')](_0x9d85('0x10'),_0x1b0b08,_0x9d85('0x11'),JSON[_0x9d85('0x12')](_0x4cb23c));if(_0x4cb23c[_0x9d85('0x13')]){if(_0x4cb23c[_0x9d85('0x13')][_0x9d85('0x14')]===0x1f4){logger[_0x9d85('0x13')](_0x9d85('0xe'),_0x1b0b08,_0x4cb23c[_0x9d85('0x13')][_0x9d85('0x15')]);return _0x2c860a(_0x4cb23c[_0x9d85('0x13')][_0x9d85('0x15')]);}logger[_0x9d85('0x13')](_0x9d85('0xe'),_0x1b0b08,_0x4cb23c[_0x9d85('0x13')][_0x9d85('0x15')]);return _0x316b30(_0x4cb23c[_0x9d85('0x13')][_0x9d85('0x15')]);}else{logger['info'](_0x9d85('0xe'),_0x1b0b08,_0x9d85('0x11'));_0x316b30(_0x4cb23c[_0x9d85('0x16')][_0x9d85('0x15')]);}})[_0x9d85('0x17')](function(_0x33cdca){logger[_0x9d85('0x13')](_0x9d85('0xe'),_0x1b0b08,_0x33cdca);_0x2c860a(_0x33cdca);});});}exports[_0x9d85('0x18')]=function(_0x42a988){var _0x222c3b=this;return new Promise(function(_0x47701c,_0x4315d6){return db[_0x9d85('0x19')][_0x9d85('0x1a')](_0x42a988['body'],{'raw':_0x42a988[_0x9d85('0x1b')]?_0x42a988['options'][_0x9d85('0x1c')]===undefined?!![]:![]:!![]})[_0x9d85('0xc')](function(_0x35efba){logger[_0x9d85('0xd')](_0x9d85('0x18'),_0x42a988);logger[_0x9d85('0xf')](_0x9d85('0x18'),_0x42a988,JSON[_0x9d85('0x12')](_0x35efba));_0x47701c(_0x35efba);})[_0x9d85('0x17')](function(_0x124009){logger[_0x9d85('0x13')]('CreateVoiceAgentReport',_0x124009['message'],_0x42a988);_0x4315d6(_0x222c3b['error'](0x1f4,_0x124009['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x2cbc9f){var _0x55437d=this;return new Promise(function(_0x1b6dc3,_0x56ac6f){return db[_0x9d85('0x19')]['update'](_0x2cbc9f[_0x9d85('0x1d')],{'raw':_0x2cbc9f[_0x9d85('0x1b')]?_0x2cbc9f[_0x9d85('0x1b')][_0x9d85('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cbc9f[_0x9d85('0x1b')]?_0x2cbc9f['options'][_0x9d85('0x1e')]||null:null,'attributes':_0x2cbc9f[_0x9d85('0x1b')]?_0x2cbc9f[_0x9d85('0x1b')]['attributes']||null:null,'limit':_0x2cbc9f[_0x9d85('0x1b')]?_0x2cbc9f['options']['limit']||null:null})['then'](function(_0x5aceb6){logger[_0x9d85('0xd')](_0x9d85('0x1f'),_0x2cbc9f);logger['debug'](_0x9d85('0x1f'),_0x2cbc9f,JSON[_0x9d85('0x12')](_0x5aceb6));_0x1b6dc3(_0x5aceb6);})[_0x9d85('0x17')](function(_0x330fec){logger[_0x9d85('0x13')](_0x9d85('0x1f'),_0x330fec[_0x9d85('0x15')],_0x2cbc9f);_0x56ac6f(_0x55437d[_0x9d85('0x13')](0x1f4,_0x330fec[_0x9d85('0x15')]));});});}; \ No newline at end of file +var _0xd2d2=['VoiceAgentReport','create','body','options','raw','info','debug','UpdateVoiceAgentReport','update','where','limit','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2d2,0xdf));var _0x2d2d=function(_0x479e55,_0x39cbf9){_0x479e55=_0x479e55-0x0;var _0x41d779=_0xd2d2[_0x479e55];return _0x41d779;};'use strict';var _=require(_0x2d2d('0x0'));var util=require('util');var moment=require(_0x2d2d('0x1'));var BPromise=require(_0x2d2d('0x2'));var rs=require(_0x2d2d('0x3'));var fs=require('fs');var Redis=require(_0x2d2d('0x4'));var db=require(_0x2d2d('0x5'))['db'];var utils=require(_0x2d2d('0x6'));var logger=require(_0x2d2d('0x7'))(_0x2d2d('0x8'));var config=require(_0x2d2d('0x9'));var jayson=require(_0x2d2d('0xa'));var client=jayson[_0x2d2d('0xb')][_0x2d2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b6351,_0xfa21ae,_0x421d01){return new BPromise(function(_0x2e2ef5,_0x3c1869){return client['request'](_0x5b6351,_0x421d01)['then'](function(_0x3d02bb){logger['info'](_0x2d2d('0xd'),_0xfa21ae,_0x2d2d('0xe'));logger['debug'](_0x2d2d('0xf'),_0xfa21ae,_0x2d2d('0xe'),JSON[_0x2d2d('0x10')](_0x3d02bb));if(_0x3d02bb[_0x2d2d('0x11')]){if(_0x3d02bb[_0x2d2d('0x11')][_0x2d2d('0x12')]===0x1f4){logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3d02bb['error'][_0x2d2d('0x13')]);return _0x3c1869(_0x3d02bb[_0x2d2d('0x11')][_0x2d2d('0x13')]);}logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3d02bb[_0x2d2d('0x11')]['message']);return _0x2e2ef5(_0x3d02bb['error'][_0x2d2d('0x13')]);}else{logger['info'](_0x2d2d('0xd'),_0xfa21ae,_0x2d2d('0xe'));_0x2e2ef5(_0x3d02bb[_0x2d2d('0x14')][_0x2d2d('0x13')]);}})['catch'](function(_0x3f5163){logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3f5163);_0x3c1869(_0x3f5163);});});}exports[_0x2d2d('0x15')]=function(_0x220383){var _0x5e0cb7=this;return new Promise(function(_0x25190e,_0x3d27de){return db[_0x2d2d('0x16')][_0x2d2d('0x17')](_0x220383[_0x2d2d('0x18')],{'raw':_0x220383[_0x2d2d('0x19')]?_0x220383[_0x2d2d('0x19')][_0x2d2d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xd63281){logger[_0x2d2d('0x1b')]('CreateVoiceAgentReport',_0x220383);logger[_0x2d2d('0x1c')](_0x2d2d('0x15'),_0x220383,JSON[_0x2d2d('0x10')](_0xd63281));_0x25190e(_0xd63281);})['catch'](function(_0x1f0e7c){logger[_0x2d2d('0x11')](_0x2d2d('0x15'),_0x1f0e7c[_0x2d2d('0x13')],_0x220383);_0x3d27de(_0x5e0cb7[_0x2d2d('0x11')](0x1f4,_0x1f0e7c[_0x2d2d('0x13')]));});});};exports[_0x2d2d('0x1d')]=function(_0x2ed79f){var _0x2d04d5=this;return new Promise(function(_0x36a580,_0x1cd08c){return db[_0x2d2d('0x16')][_0x2d2d('0x1e')](_0x2ed79f[_0x2d2d('0x18')],{'raw':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')][_0x2d2d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')][_0x2d2d('0x1f')]||null:null,'attributes':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')]['attributes']||null:null,'limit':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f['options'][_0x2d2d('0x20')]||null:null})[_0x2d2d('0x21')](function(_0x3dbbb8){logger[_0x2d2d('0x1b')](_0x2d2d('0x1d'),_0x2ed79f);logger['debug'](_0x2d2d('0x1d'),_0x2ed79f,JSON[_0x2d2d('0x10')](_0x3dbbb8));_0x36a580(_0x3dbbb8);})[_0x2d2d('0x22')](function(_0x554490){logger[_0x2d2d('0x11')](_0x2d2d('0x1d'),_0x554490[_0x2d2d('0x13')],_0x2ed79f);_0x1cd08c(_0x2d04d5['error'](0x1f4,_0x554490[_0x2d2d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index daba1d7..d88d90b 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 _0x5fd1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x3489ae,_0x1c3961){var _0x39f9ef=function(_0x22a0e0){while(--_0x22a0e0){_0x3489ae['push'](_0x3489ae['shift']());}};_0x39f9ef(++_0x1c3961);}(_0x5fd1,0x155));var _0x15fd=function(_0x3c1246,_0x38da2a){_0x3c1246=_0x3c1246-0x0;var _0x16c27b=_0x5fd1[_0x3c1246];return _0x16c27b;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./voiceCallReport.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0x7')](_0x15fd('0xc'),auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router['post']('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xc'),auth[_0x15fd('0x8')](),controller[_0x15fd('0x11')]);module[_0x15fd('0x12')]=router; \ No newline at end of file +var _0xd6d6=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x92958f,_0x44430b){var _0x1e406d=function(_0x42699d){while(--_0x42699d){_0x92958f['push'](_0x92958f['shift']());}};_0x1e406d(++_0x44430b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2361fe,_0x227bc6){_0x2361fe=_0x2361fe-0x0;var _0x36e4d4=_0xd6d6[_0x2361fe];return _0x36e4d4;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),auth[_0x6d6d('0xd')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xa')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xd')](),controller[_0x6d6d('0x11')]);router[_0x6d6d('0x12')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x15')]);module[_0x6d6d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 51afcf3..25e847f 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 _0x46c2=['ENUM','inbound','internal','outbound','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x54e69a,_0x461b02){var _0x379c24=function(_0x259c82){while(--_0x259c82){_0x54e69a['push'](_0x54e69a['shift']());}};_0x379c24(++_0x461b02);}(_0x46c2,0x180));var _0x246c=function(_0x46f7a7,_0x3a2566){_0x46f7a7=_0x46f7a7-0x0;var _0x55f8e6=_0x46c2[_0x46f7a7];return _0x55f8e6;};'use strict';var Sequelize=require(_0x246c('0x0'));module[_0x246c('0x1')]={'uniqueid':{'type':Sequelize[_0x246c('0x2')]},'type':{'type':Sequelize[_0x246c('0x3')](_0x246c('0x4'),_0x246c('0x5'),_0x246c('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x246c('0x2')]},'destination':{'type':Sequelize[_0x246c('0x2')]},'destinationcontext':{'type':Sequelize[_0x246c('0x2')]},'callerid':{'type':Sequelize[_0x246c('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x246c('0x2')]},'lastapplication':{'type':Sequelize[_0x246c('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x246c('0x7')]},'systemanswertime':{'type':Sequelize[_0x246c('0x7')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x246c('0x2')]},'userfield':{'type':Sequelize[_0x246c('0x2')]},'userDisposition':{'type':Sequelize[_0x246c('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x246c('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x246c('0x2')]},'routeid':{'type':Sequelize[_0x246c('0x8')]},'sipcallid':{'type':Sequelize[_0x246c('0x2')]}}; \ No newline at end of file +var _0x0a97=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer'];(function(_0x3c7797,_0x46f8e9){var _0x1464e8=function(_0x11592a){while(--_0x11592a){_0x3c7797['push'](_0x3c7797['shift']());}};_0x1464e8(++_0x46f8e9);}(_0x0a97,0x1a7));var _0x70a9=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x0a97[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0x70a9('0x0'));module[_0x70a9('0x1')]={'uniqueid':{'type':Sequelize[_0x70a9('0x2')]},'type':{'type':Sequelize[_0x70a9('0x3')](_0x70a9('0x4'),_0x70a9('0x5'),_0x70a9('0x6'),_0x70a9('0x7'),'outbound-fax',_0x70a9('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x70a9('0x2')]},'destinationcontext':{'type':Sequelize[_0x70a9('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x70a9('0x2')]},'destinationchannel':{'type':Sequelize[_0x70a9('0x2')]},'lastapplication':{'type':Sequelize[_0x70a9('0x2')]},'lastdata':{'type':Sequelize[_0x70a9('0x9')]},'starttime':{'type':Sequelize[_0x70a9('0xa')]},'systemanswertime':{'type':Sequelize[_0x70a9('0xa')]},'answertime':{'type':Sequelize[_0x70a9('0xa')]},'endtime':{'type':Sequelize[_0x70a9('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x70a9('0xb')]},'mohtime':{'type':Sequelize[_0x70a9('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x70a9('0x2')]},'amaflags':{'type':Sequelize[_0x70a9('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x70a9('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x70a9('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x70a9('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6e3c3b3..9205e3e 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x1c3d9f,_0x106d3b){var _0x5ca9f5=function(_0x31073c){while(--_0x31073c){_0x1c3d9f['push'](_0x1c3d9f['shift']());}};_0x5ca9f5(++_0x106d3b);}(_0xdb28,0x106));var _0x8db2=function(_0x1918e4,_0x2c0aa7){_0x1918e4=_0x1918e4-0x0;var _0x288caf=_0xdb28[_0x1918e4];return _0x288caf;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 44e0605..5f264b6 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 _0x95b2=['api','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','lodash','util','../../config/logger'];(function(_0x43f88d,_0x54d8ce){var _0x1aae21=function(_0xa2d024){while(--_0xa2d024){_0x43f88d['push'](_0x43f88d['shift']());}};_0x1aae21(++_0x54d8ce);}(_0x95b2,0x8d));var _0x295b=function(_0x113f02,_0x17546c){_0x113f02=_0x113f02-0x0;var _0x22007c=_0x95b2[_0x113f02];return _0x22007c;};'use strict';var _=require(_0x295b('0x0'));var util=require(_0x295b('0x1'));var logger=require(_0x295b('0x2'))(_0x295b('0x3'));var moment=require(_0x295b('0x4'));var BPromise=require(_0x295b('0x5'));var rp=require(_0x295b('0x6'));var fs=require('fs');var path=require(_0x295b('0x7'));var rimraf=require(_0x295b('0x8'));var config=require('../../config/environment');var attributes=require(_0x295b('0x9'));module['exports']=function(_0x4ad15f,_0x1e2214){return _0x4ad15f[_0x295b('0xa')](_0x295b('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x107a=['api','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger'];(function(_0x3e2ac1,_0x3f1e45){var _0x54d5b4=function(_0xacb848){while(--_0xacb848){_0x3e2ac1['push'](_0x3e2ac1['shift']());}};_0x54d5b4(++_0x3f1e45);}(_0x107a,0x1dd));var _0xa107=function(_0xc77373,_0x216c24){_0xc77373=_0xc77373-0x0;var _0x32ed6b=_0x107a[_0xc77373];return _0x32ed6b;};'use strict';var _=require(_0xa107('0x0'));var util=require(_0xa107('0x1'));var logger=require(_0xa107('0x2'))(_0xa107('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa107('0x4'));var rimraf=require(_0xa107('0x5'));var config=require(_0xa107('0x6'));var attributes=require(_0xa107('0x7'));module[_0xa107('0x8')]=function(_0x1693cb,_0x4bff82){return _0x1693cb[_0xa107('0x9')](_0xa107('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xa107('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index b1d7563..095af80 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 _0xb9c1=['moment','bluebird','ioredis','rpc','client','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','attributes','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','body','UpdateVoiceCallReport','update'];(function(_0x8eac8f,_0x4354ea){var _0x386a07=function(_0x3cfe13){while(--_0x3cfe13){_0x8eac8f['push'](_0x8eac8f['shift']());}};_0x386a07(++_0x4354ea);}(_0xb9c1,0x96));var _0x1b9c=function(_0x36c8f6,_0x467d39){_0x36c8f6=_0x36c8f6-0x0;var _0x1ba8ed=_0xb9c1[_0x36c8f6];return _0x1ba8ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b9c('0x0'));var BPromise=require(_0x1b9c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b9c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b9c('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1b9c('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fd398,_0x5c5a91,_0x196b81){return new BPromise(function(_0x3043ec,_0xb18df1){return client['request'](_0x3fd398,_0x196b81)[_0x1b9c('0x5')](function(_0x4a6e98){logger[_0x1b9c('0x6')](_0x1b9c('0x7'),_0x5c5a91,'request\x20sent');logger[_0x1b9c('0x8')](_0x1b9c('0x9'),_0x5c5a91,_0x1b9c('0xa'),JSON[_0x1b9c('0xb')](_0x4a6e98));if(_0x4a6e98[_0x1b9c('0xc')]){if(_0x4a6e98[_0x1b9c('0xc')][_0x1b9c('0xd')]===0x1f4){logger[_0x1b9c('0xc')](_0x1b9c('0x7'),_0x5c5a91,_0x4a6e98[_0x1b9c('0xc')][_0x1b9c('0xe')]);return _0xb18df1(_0x4a6e98['error'][_0x1b9c('0xe')]);}logger[_0x1b9c('0xc')](_0x1b9c('0x7'),_0x5c5a91,_0x4a6e98[_0x1b9c('0xc')][_0x1b9c('0xe')]);return _0x3043ec(_0x4a6e98[_0x1b9c('0xc')][_0x1b9c('0xe')]);}else{logger[_0x1b9c('0x6')](_0x1b9c('0x7'),_0x5c5a91,'request\x20sent');_0x3043ec(_0x4a6e98['result'][_0x1b9c('0xe')]);}})[_0x1b9c('0xf')](function(_0x2f8ca7){logger[_0x1b9c('0xc')](_0x1b9c('0x7'),_0x5c5a91,_0x2f8ca7);_0xb18df1(_0x2f8ca7);});});}exports['GetVoiceCallReport']=function(_0x23b6d9){var _0x30d915=this;return new Promise(function(_0x3a84df,_0xf63af4){return db['VoiceCallReport'][_0x1b9c('0x10')]({'raw':_0x23b6d9[_0x1b9c('0x11')]?_0x23b6d9[_0x1b9c('0x11')][_0x1b9c('0x12')]===undefined?!![]:![]:!![],'where':_0x23b6d9['options']?_0x23b6d9[_0x1b9c('0x11')][_0x1b9c('0x13')]||null:null,'attributes':_0x23b6d9[_0x1b9c('0x11')]?_0x23b6d9[_0x1b9c('0x11')][_0x1b9c('0x14')]||null:null,'limit':_0x23b6d9[_0x1b9c('0x11')]?_0x23b6d9[_0x1b9c('0x11')]['limit']||null:null,'include':_0x23b6d9['options']?_0x23b6d9[_0x1b9c('0x11')][_0x1b9c('0x15')]?_[_0x1b9c('0x16')](_0x23b6d9[_0x1b9c('0x11')][_0x1b9c('0x15')],function(_0x5049f5){return{'model':db[_0x5049f5[_0x1b9c('0x17')]],'as':_0x5049f5['as'],'attributes':_0x5049f5['attributes'],'include':_0x5049f5[_0x1b9c('0x15')]?_[_0x1b9c('0x16')](_0x5049f5['include'],function(_0x3a02ec){return{'model':db[_0x3a02ec[_0x1b9c('0x17')]],'as':_0x3a02ec['as'],'attributes':_0x3a02ec[_0x1b9c('0x14')],'include':_0x3a02ec[_0x1b9c('0x15')]?_[_0x1b9c('0x16')](_0x3a02ec[_0x1b9c('0x15')],function(_0x11553e){return{'model':db[_0x11553e[_0x1b9c('0x17')]],'as':_0x11553e['as'],'attributes':_0x11553e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d5b5){logger[_0x1b9c('0x6')](_0x1b9c('0x18'),_0x23b6d9);logger[_0x1b9c('0x8')](_0x1b9c('0x18'),_0x23b6d9,JSON[_0x1b9c('0xb')](_0x58d5b5));_0x3a84df(_0x58d5b5);})[_0x1b9c('0xf')](function(_0x303c5b){logger[_0x1b9c('0xc')]('GetVoiceCallReport',_0x303c5b['message'],_0x23b6d9);_0xf63af4(_0x30d915[_0x1b9c('0xc')](0x1f4,_0x303c5b['message']));});});};exports[_0x1b9c('0x19')]=function(_0x28b7e4){var _0x27d996=this;return new Promise(function(_0x6ebb44,_0x223713){return db[_0x1b9c('0x1a')]['create'](_0x28b7e4[_0x1b9c('0x1b')],{'raw':_0x28b7e4[_0x1b9c('0x11')]?_0x28b7e4['options'][_0x1b9c('0x12')]===undefined?!![]:![]:!![]})[_0x1b9c('0x5')](function(_0x53cbb8){logger['info'](_0x1b9c('0x19'),_0x28b7e4);logger[_0x1b9c('0x8')]('CreateVoiceCallReport',_0x28b7e4,JSON[_0x1b9c('0xb')](_0x53cbb8));_0x6ebb44(_0x53cbb8);})[_0x1b9c('0xf')](function(_0x55416b){logger[_0x1b9c('0xc')]('CreateVoiceCallReport',_0x55416b[_0x1b9c('0xe')],_0x28b7e4);_0x223713(_0x27d996[_0x1b9c('0xc')](0x1f4,_0x55416b[_0x1b9c('0xe')]));});});};exports[_0x1b9c('0x1c')]=function(_0x32e3b7){var _0x560a81=this;return new Promise(function(_0xf430a2,_0x42d331){return db[_0x1b9c('0x1a')][_0x1b9c('0x1d')](_0x32e3b7[_0x1b9c('0x1b')],{'raw':_0x32e3b7[_0x1b9c('0x11')]?_0x32e3b7[_0x1b9c('0x11')][_0x1b9c('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e3b7[_0x1b9c('0x11')]?_0x32e3b7['options'][_0x1b9c('0x13')]||null:null,'attributes':_0x32e3b7[_0x1b9c('0x11')]?_0x32e3b7[_0x1b9c('0x11')][_0x1b9c('0x14')]||null:null,'limit':_0x32e3b7[_0x1b9c('0x11')]?_0x32e3b7[_0x1b9c('0x11')]['limit']||null:null})[_0x1b9c('0x5')](function(_0x483fea){logger['info'](_0x1b9c('0x1c'),_0x32e3b7);logger[_0x1b9c('0x8')](_0x1b9c('0x1c'),_0x32e3b7,JSON[_0x1b9c('0xb')](_0x483fea));_0xf430a2(_0x483fea);})['catch'](function(_0x1ca0a0){logger[_0x1b9c('0xc')](_0x1b9c('0x1c'),_0x1ca0a0[_0x1b9c('0xe')],_0x32e3b7);_0x42d331(_0x560a81[_0x1b9c('0xc')](0x1f4,_0x1ca0a0[_0x1b9c('0xe')]));});});}; \ No newline at end of file +var _0x62f0=['then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','moment','../../mysqldb','../../config/logger','rpc','client','request'];(function(_0x40e114,_0x278b52){var _0x2e9542=function(_0x36b70){while(--_0x36b70){_0x40e114['push'](_0x40e114['shift']());}};_0x2e9542(++_0x278b52);}(_0x62f0,0x156));var _0x062f=function(_0x3b20c2,_0x888661){_0x3b20c2=_0x3b20c2-0x0;var _0x5b4482=_0x62f0[_0x3b20c2];return _0x5b4482;};'use strict';var _=require(_0x062f('0x0'));var util=require(_0x062f('0x1'));var moment=require(_0x062f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x062f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x062f('0x4'))(_0x062f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x062f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44f4f2,_0x32b2b0,_0x2b9e64){return new BPromise(function(_0x31df56,_0x4b8f89){return client[_0x062f('0x7')](_0x44f4f2,_0x2b9e64)[_0x062f('0x8')](function(_0x406db7){logger[_0x062f('0x9')](_0x062f('0xa'),_0x32b2b0,_0x062f('0xb'));logger[_0x062f('0xc')](_0x062f('0xd'),_0x32b2b0,_0x062f('0xb'),JSON[_0x062f('0xe')](_0x406db7));if(_0x406db7[_0x062f('0xf')]){if(_0x406db7[_0x062f('0xf')]['code']===0x1f4){logger[_0x062f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x32b2b0,_0x406db7['error'][_0x062f('0x10')]);return _0x4b8f89(_0x406db7[_0x062f('0xf')][_0x062f('0x10')]);}logger['error'](_0x062f('0xa'),_0x32b2b0,_0x406db7[_0x062f('0xf')]['message']);return _0x31df56(_0x406db7[_0x062f('0xf')]['message']);}else{logger[_0x062f('0x9')](_0x062f('0xa'),_0x32b2b0,_0x062f('0xb'));_0x31df56(_0x406db7[_0x062f('0x11')][_0x062f('0x10')]);}})['catch'](function(_0x328f13){logger[_0x062f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x32b2b0,_0x328f13);_0x4b8f89(_0x328f13);});});}exports[_0x062f('0x12')]=function(_0x2d6f4f){var _0x4af764=this;return new Promise(function(_0xec7da4,_0x58d998){return db[_0x062f('0x13')][_0x062f('0x14')]({'raw':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')][_0x062f('0x16')]===undefined?!![]:![]:!![],'where':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f['options'][_0x062f('0x17')]||null:null,'attributes':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')][_0x062f('0x18')]||null:null,'limit':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')]['limit']||null:null,'include':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f['options'][_0x062f('0x19')]?_[_0x062f('0x1a')](_0x2d6f4f[_0x062f('0x15')][_0x062f('0x19')],function(_0x199802){return{'model':db[_0x199802[_0x062f('0x1b')]],'as':_0x199802['as'],'attributes':_0x199802['attributes'],'include':_0x199802[_0x062f('0x19')]?_[_0x062f('0x1a')](_0x199802[_0x062f('0x19')],function(_0x37dbfe){return{'model':db[_0x37dbfe[_0x062f('0x1b')]],'as':_0x37dbfe['as'],'attributes':_0x37dbfe[_0x062f('0x18')],'include':_0x37dbfe['include']?_[_0x062f('0x1a')](_0x37dbfe[_0x062f('0x19')],function(_0x8224b8){return{'model':db[_0x8224b8[_0x062f('0x1b')]],'as':_0x8224b8['as'],'attributes':_0x8224b8[_0x062f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x062f('0x8')](function(_0x1a5523){logger[_0x062f('0x9')]('GetVoiceCallReport',_0x2d6f4f);logger[_0x062f('0xc')](_0x062f('0x12'),_0x2d6f4f,JSON['stringify'](_0x1a5523));_0xec7da4(_0x1a5523);})[_0x062f('0x1c')](function(_0x2197a6){logger[_0x062f('0xf')](_0x062f('0x12'),_0x2197a6[_0x062f('0x10')],_0x2d6f4f);_0x58d998(_0x4af764['error'](0x1f4,_0x2197a6['message']));});});};exports['CreateVoiceCallReport']=function(_0x2e7854){var _0x3905da=this;return new Promise(function(_0x443944,_0x5d824b){return db['VoiceCallReport'][_0x062f('0x1d')](_0x2e7854[_0x062f('0x1e')],{'raw':_0x2e7854[_0x062f('0x15')]?_0x2e7854[_0x062f('0x15')][_0x062f('0x16')]===undefined?!![]:![]:!![]})[_0x062f('0x8')](function(_0x36248d){logger[_0x062f('0x9')](_0x062f('0x1f'),_0x2e7854);logger[_0x062f('0xc')](_0x062f('0x1f'),_0x2e7854,JSON[_0x062f('0xe')](_0x36248d));_0x443944(_0x36248d);})[_0x062f('0x1c')](function(_0xeb4255){logger['error'](_0x062f('0x1f'),_0xeb4255[_0x062f('0x10')],_0x2e7854);_0x5d824b(_0x3905da[_0x062f('0xf')](0x1f4,_0xeb4255['message']));});});};exports[_0x062f('0x20')]=function(_0xc9c4b){var _0x262f2e=this;return new Promise(function(_0xb12d93,_0x327bb9){return db['VoiceCallReport'][_0x062f('0x21')](_0xc9c4b[_0x062f('0x1e')],{'raw':_0xc9c4b[_0x062f('0x15')]?_0xc9c4b[_0x062f('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9c4b[_0x062f('0x15')]?_0xc9c4b[_0x062f('0x15')][_0x062f('0x17')]||null:null,'attributes':_0xc9c4b['options']?_0xc9c4b[_0x062f('0x15')][_0x062f('0x18')]||null:null,'limit':_0xc9c4b['options']?_0xc9c4b[_0x062f('0x15')][_0x062f('0x22')]||null:null})[_0x062f('0x8')](function(_0x96bccc){logger[_0x062f('0x9')]('UpdateVoiceCallReport',_0xc9c4b);logger[_0x062f('0xc')]('UpdateVoiceCallReport',_0xc9c4b,JSON[_0x062f('0xe')](_0x96bccc));_0xb12d93(_0x96bccc);})['catch'](function(_0x12c1d6){logger[_0x062f('0xf')](_0x062f('0x20'),_0x12c1d6[_0x062f('0x10')],_0xc9c4b);_0x327bb9(_0x262f2e[_0x062f('0xf')](0x1f4,_0x12c1d6[_0x062f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 119d8b5..c13d075 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 _0x5b08=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0xb34bd4,_0x1aafd2){var _0x1b99c2=function(_0x3e70ac){while(--_0x3e70ac){_0xb34bd4['push'](_0xb34bd4['shift']());}};_0x1b99c2(++_0x1aafd2);}(_0x5b08,0x13d));var _0x85b0=function(_0x2ff51e,_0x327cdf){_0x2ff51e=_0x2ff51e-0x0;var _0x603124=_0x5b08[_0x2ff51e];return _0x603124;};'use strict';var multer=require(_0x85b0('0x0'));var util=require(_0x85b0('0x1'));var path=require(_0x85b0('0x2'));var timeout=require(_0x85b0('0x3'));var express=require(_0x85b0('0x4'));var router=express[_0x85b0('0x5')]();var fs_extra=require(_0x85b0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x85b0('0x7'));var config=require(_0x85b0('0x8'));var controller=require(_0x85b0('0x9'));router[_0x85b0('0xa')]('/',auth[_0x85b0('0xb')](),controller['index']);router[_0x85b0('0xa')]('/:id',auth[_0x85b0('0xb')](),controller[_0x85b0('0xc')]);router[_0x85b0('0xd')]('/',auth[_0x85b0('0xb')](),controller[_0x85b0('0xe')]);router['put'](_0x85b0('0xf'),auth[_0x85b0('0xb')](),controller[_0x85b0('0x10')]);router[_0x85b0('0x11')](_0x85b0('0xf'),auth[_0x85b0('0xb')](),controller[_0x85b0('0x12')]);module[_0x85b0('0x13')]=router; \ No newline at end of file +var _0x7c8f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x5a20d5,_0x33a069){var _0x104307=function(_0x35606a){while(--_0x35606a){_0x5a20d5['push'](_0x5a20d5['shift']());}};_0x104307(++_0x33a069);}(_0x7c8f,0x160));var _0xf7c8=function(_0x7d7c9b,_0x52c32f){_0x7d7c9b=_0x7d7c9b-0x0;var _0x211a81=_0x7c8f[_0x7d7c9b];return _0x211a81;};'use strict';var multer=require(_0xf7c8('0x0'));var util=require(_0xf7c8('0x1'));var path=require(_0xf7c8('0x2'));var timeout=require(_0xf7c8('0x3'));var express=require(_0xf7c8('0x4'));var router=express[_0xf7c8('0x5')]();var fs_extra=require(_0xf7c8('0x6'));var auth=require(_0xf7c8('0x7'));var interaction=require(_0xf7c8('0x8'));var config=require(_0xf7c8('0x9'));var controller=require(_0xf7c8('0xa'));router[_0xf7c8('0xb')]('/',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0xd')]);router[_0xf7c8('0xb')](_0xf7c8('0xe'),auth[_0xf7c8('0xc')](),controller[_0xf7c8('0xf')]);router['post']('/',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0x10')]);router[_0xf7c8('0x11')]('/:id',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0x12')]);router[_0xf7c8('0x13')](_0xf7c8('0xe'),auth[_0xf7c8('0xc')](),controller['destroy']);module[_0xf7c8('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8e2d1f9..6aa2c84 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 _0xfe22=['getDataValue','split','sequelize','exports','STRING','setDataValue','join','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe22,0x82));var _0x2fe2=function(_0x12b174,_0x56b7ba){_0x12b174=_0x12b174-0x0;var _0x2ec7a3=_0xfe22[_0x12b174];return _0x2ec7a3;};'use strict';var Sequelize=require(_0x2fe2('0x0'));module[_0x2fe2('0x1')]={'name':{'type':Sequelize[_0x2fe2('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x2fe2('0x2')],'set':function(_0x2aa58b){this[_0x2fe2('0x3')]('options',_0x2aa58b?_0x2aa58b[_0x2fe2('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x2fe2('0x5'))?this[_0x2fe2('0x6')](_0x2fe2('0x5'))[_0x2fe2('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x2fe2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c1c=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x273265,_0x1d51f8){var _0x538939=function(_0x4efbdf){while(--_0x4efbdf){_0x273265['push'](_0x273265['shift']());}};_0x538939(++_0x1d51f8);}(_0x5c1c,0x10f));var _0xc5c1=function(_0x2c0c8,_0x8b3e09){_0x2c0c8=_0x2c0c8-0x0;var _0x49328c=_0x5c1c[_0x2c0c8];return _0x49328c;};'use strict';var Sequelize=require(_0xc5c1('0x0'));module[_0xc5c1('0x1')]={'name':{'type':Sequelize[_0xc5c1('0x2')]},'prefix':{'type':Sequelize[_0xc5c1('0x2')],'unique':_0xc5c1('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc5c1('0x2')],'set':function(_0x32d75c){this[_0xc5c1('0x4')](_0xc5c1('0x5'),_0x32d75c?_0x32d75c[_0xc5c1('0x6')](''):[]);},'get':function(){return this[_0xc5c1('0x7')](_0xc5c1('0x5'))?this['getDataValue'](_0xc5c1('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc5c1('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xc5c1('0x2')]},'record':{'type':Sequelize[_0xc5c1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc5c1('0x2')]},'description':{'type':Sequelize[_0xc5c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 789154d..9a6ba62 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 _0x4198=['order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','ChanSpies','UserProfileResource','end','stack','name','send','map','VoiceChanSpy','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x20b2ee,_0x2f5f73){var _0xa9ec2e=function(_0x440897){while(--_0x440897){_0x20b2ee['push'](_0x20b2ee['shift']());}};_0xa9ec2e(++_0x2f5f73);}(_0x4198,0x69));var _0x8419=function(_0x364a2c,_0x5a8f50){_0x364a2c=_0x364a2c-0x0;var _0x3aa8f5=_0x4198[_0x364a2c];return _0x3aa8f5;};'use strict';var emlformat=require(_0x8419('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8419('0x1'));var jsonpatch=require(_0x8419('0x2'));var rp=require(_0x8419('0x3'));var moment=require(_0x8419('0x4'));var BPromise=require(_0x8419('0x5'));var Mustache=require(_0x8419('0x6'));var util=require(_0x8419('0x7'));var path=require(_0x8419('0x8'));var sox=require(_0x8419('0x9'));var csv=require(_0x8419('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8419('0xb'));var _=require(_0x8419('0xc'));var squel=require(_0x8419('0xd'));var crypto=require(_0x8419('0xe'));var jsforce=require(_0x8419('0xf'));var deskjs=require(_0x8419('0x10'));var toCsv=require(_0x8419('0xa'));var querystring=require(_0x8419('0x11'));var Papa=require(_0x8419('0x12'));var Redis=require(_0x8419('0x13'));var authService=require(_0x8419('0x14'));var qs=require(_0x8419('0x15'));var as=require(_0x8419('0x16'));var hardwareService=require(_0x8419('0x17'));var logger=require(_0x8419('0x18'))('api');var utils=require(_0x8419('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8419('0x1a'));var db=require(_0x8419('0x1b'))['db'];function respondWithStatusCode(_0x14c1bd,_0x493f53){_0x493f53=_0x493f53||0xcc;return function(_0x54f5b3){if(_0x54f5b3){return _0x14c1bd[_0x8419('0x1c')](_0x493f53);}return _0x14c1bd[_0x8419('0x1d')](_0x493f53)['end']();};}function respondWithResult(_0x166586,_0x298d33){_0x298d33=_0x298d33||0xc8;return function(_0x2e4d33){if(_0x2e4d33){return _0x166586[_0x8419('0x1d')](_0x298d33)[_0x8419('0x1e')](_0x2e4d33);}};}function respondWithFilteredResult(_0x5983c1,_0x434bd4){return function(_0xab746e){if(_0xab746e){var _0x4f0ceb=typeof _0x434bd4[_0x8419('0x1f')]===_0x8419('0x20')&&typeof _0x434bd4[_0x8419('0x21')]===_0x8419('0x20');var _0x1c1fe4=_0xab746e[_0x8419('0x22')];var _0x3b8d51=_0x4f0ceb?0x0:_0x434bd4[_0x8419('0x1f')];var _0x44569a=_0x4f0ceb?_0xab746e['count']:_0x434bd4['offset']+_0x434bd4[_0x8419('0x21')];var _0x275a4c;if(_0x44569a>=_0x1c1fe4){_0x44569a=_0x1c1fe4;_0x275a4c=0xc8;}else{_0x275a4c=0xce;}_0x5983c1[_0x8419('0x1d')](_0x275a4c);return _0x5983c1[_0x8419('0x23')](_0x8419('0x24'),_0x3b8d51+'-'+_0x44569a+'/'+_0x1c1fe4)[_0x8419('0x1e')](_0xab746e);}return null;};}function patchUpdates(_0x43efb7){return function(_0x3e3beb){try{jsonpatch[_0x8419('0x25')](_0x3e3beb,_0x43efb7,!![]);}catch(_0x149537){return BPromise[_0x8419('0x26')](_0x149537);}return _0x3e3beb['save']();};}function saveUpdates(_0x24decb,_0x110f0e){return function(_0xb4fa12){if(_0xb4fa12){return _0xb4fa12[_0x8419('0x27')](_0x24decb)['then'](function(_0x38dfef){return _0x38dfef;});}return null;};}function removeEntity(_0x4cf022,_0x5d66d4){return function(_0x1cab7d){if(_0x1cab7d){return _0x1cab7d[_0x8419('0x28')]()[_0x8419('0x29')](function(){var _0x26457f=_0x1cab7d[_0x8419('0x2a')]({'plain':!![]});var _0x496b2f=_0x8419('0x2b');return db[_0x8419('0x2c')][_0x8419('0x28')]({'where':{'type':_0x496b2f,'resourceId':_0x26457f['id']}})[_0x8419('0x29')](function(){return _0x1cab7d;});})[_0x8419('0x29')](function(){_0x4cf022[_0x8419('0x1d')](0xcc)[_0x8419('0x2d')]();});}};}function handleEntityNotFound(_0x4701d4,_0x73cac6){return function(_0x30550e){if(!_0x30550e){_0x4701d4[_0x8419('0x1c')](0x194);}return _0x30550e;};}function handleError(_0x1fcbef,_0xcd7208){_0xcd7208=_0xcd7208||0x1f4;return function(_0x4a5487){logger['error'](_0x4a5487[_0x8419('0x2e')]);if(_0x4a5487[_0x8419('0x2f')]){delete _0x4a5487[_0x8419('0x2f')];}_0x1fcbef[_0x8419('0x1d')](_0xcd7208)[_0x8419('0x30')](_0x4a5487);};}exports['index']=function(_0x4b8fb5,_0x3e18c5){var _0x489835={},_0x23ec83={},_0x572a37={'count':0x0,'rows':[]};var _0x528156=_[_0x8419('0x31')](db[_0x8419('0x32')]['rawAttributes'],function(_0x445805){return{'name':_0x445805['fieldName'],'type':_0x445805['type'][_0x8419('0x33')]};});_0x23ec83[_0x8419('0x34')]=_[_0x8419('0x31')](_0x528156,'name');_0x23ec83[_0x8419('0x35')]=_[_0x8419('0x36')](_0x4b8fb5[_0x8419('0x35')]);_0x23ec83[_0x8419('0x37')]=_['intersection'](_0x23ec83[_0x8419('0x34')],_0x23ec83[_0x8419('0x35')]);_0x489835[_0x8419('0x38')]=_[_0x8419('0x39')](_0x23ec83[_0x8419('0x34')],qs[_0x8419('0x3a')](_0x4b8fb5[_0x8419('0x35')][_0x8419('0x3a')]));_0x489835[_0x8419('0x38')]=_0x489835[_0x8419('0x38')][_0x8419('0x3b')]?_0x489835[_0x8419('0x38')]:_0x23ec83['model'];if(!_0x4b8fb5['query'][_0x8419('0x3c')]('nolimit')){_0x489835['limit']=qs[_0x8419('0x21')](_0x4b8fb5[_0x8419('0x35')][_0x8419('0x21')]);_0x489835[_0x8419('0x1f')]=qs[_0x8419('0x1f')](_0x4b8fb5[_0x8419('0x35')][_0x8419('0x1f')]);}_0x489835[_0x8419('0x3d')]=qs[_0x8419('0x3e')](_0x4b8fb5[_0x8419('0x35')][_0x8419('0x3e')]);_0x489835[_0x8419('0x3f')]=qs[_0x8419('0x37')](_[_0x8419('0x40')](_0x4b8fb5['query'],_0x23ec83[_0x8419('0x37')]),_0x528156);if(_0x4b8fb5[_0x8419('0x35')]['filter']){_0x489835[_0x8419('0x3f')]=_[_0x8419('0x41')](_0x489835['where'],{'$or':_[_0x8419('0x31')](_0x528156,function(_0x47bdf8){if(_0x47bdf8[_0x8419('0x42')]!==_0x8419('0x43')){var _0x43545b={};_0x43545b[_0x47bdf8[_0x8419('0x2f')]]={'$like':'%'+_0x4b8fb5[_0x8419('0x35')]['filter']+'%'};return _0x43545b;}})});}_0x489835=_[_0x8419('0x41')]({},_0x489835,_0x4b8fb5['options']);var _0x4f5645={'where':_0x489835['where']};return db['VoiceChanSpy'][_0x8419('0x22')](_0x4f5645)[_0x8419('0x29')](function(_0x18f7ad){_0x572a37[_0x8419('0x22')]=_0x18f7ad;if(_0x4b8fb5[_0x8419('0x35')][_0x8419('0x44')]){_0x489835[_0x8419('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x8419('0x46')](_0x489835);})[_0x8419('0x29')](function(_0x1ca1b4){_0x572a37[_0x8419('0x47')]=_0x1ca1b4;return _0x572a37;})['then'](respondWithFilteredResult(_0x3e18c5,_0x489835))[_0x8419('0x48')](handleError(_0x3e18c5,null));};exports['show']=function(_0xb0e4f1,_0x1046e0){var _0x12586d={'raw':![],'where':{'id':_0xb0e4f1[_0x8419('0x49')]['id']}},_0xf35e2d={};_0xf35e2d[_0x8419('0x34')]=_[_0x8419('0x36')](db[_0x8419('0x32')][_0x8419('0x4a')]);_0xf35e2d['query']=_['keys'](_0xb0e4f1['query']);_0xf35e2d[_0x8419('0x37')]=_[_0x8419('0x39')](_0xf35e2d[_0x8419('0x34')],_0xf35e2d[_0x8419('0x35')]);_0x12586d[_0x8419('0x38')]=_[_0x8419('0x39')](_0xf35e2d[_0x8419('0x34')],qs[_0x8419('0x3a')](_0xb0e4f1[_0x8419('0x35')][_0x8419('0x3a')]));_0x12586d[_0x8419('0x38')]=_0x12586d[_0x8419('0x38')][_0x8419('0x3b')]?_0x12586d[_0x8419('0x38')]:_0xf35e2d[_0x8419('0x34')];if(_0xb0e4f1['query'][_0x8419('0x44')]){_0x12586d[_0x8419('0x45')]=[{'all':!![]}];}_0x12586d=_[_0x8419('0x41')]({},_0x12586d,_0xb0e4f1[_0x8419('0x4b')]);return db[_0x8419('0x32')][_0x8419('0x4c')](_0x12586d)['then'](handleEntityNotFound(_0x1046e0,null))[_0x8419('0x29')](respondWithResult(_0x1046e0,null))[_0x8419('0x48')](handleError(_0x1046e0,null));};exports['create']=function(_0x181581,_0x17978c){return db['VoiceChanSpy']['create'](_0x181581['body'],{})[_0x8419('0x29')](function(_0x3a2ae7){var _0x5aca62=_0x181581[_0x8419('0x4d')][_0x8419('0x2a')]({'plain':!![]});if(!_0x5aca62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aca62[_0x8419('0x4e')]===_0x8419('0x4d')){var _0x22db14=_0x3a2ae7[_0x8419('0x2a')]({'plain':!![]});var _0x5da0ba='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x5da0ba,'userProfileId':_0x5aca62[_0x8419('0x4f')]},'raw':!![]})[_0x8419('0x29')](function(_0x3624c9){if(_0x3624c9&&_0x3624c9[_0x8419('0x50')]===0x0){return db[_0x8419('0x2c')]['create']({'name':_0x22db14[_0x8419('0x2f')],'resourceId':_0x22db14['id'],'type':_0x3624c9[_0x8419('0x2f')],'sectionId':_0x3624c9['id']},{})[_0x8419('0x29')](function(){return _0x3a2ae7;});}else{return _0x3a2ae7;}})['catch'](function(_0x1e88d3){logger['error'](_0x8419('0x51'),_0x1e88d3);throw _0x1e88d3;});}return _0x3a2ae7;})[_0x8419('0x29')](respondWithResult(_0x17978c,0xc9))[_0x8419('0x48')](handleError(_0x17978c,null));};exports[_0x8419('0x27')]=function(_0x45abc5,_0x3b6765){if(_0x45abc5[_0x8419('0x52')]['id']){delete _0x45abc5[_0x8419('0x52')]['id'];}return db[_0x8419('0x32')][_0x8419('0x4c')]({'where':{'id':_0x45abc5[_0x8419('0x49')]['id']}})[_0x8419('0x29')](handleEntityNotFound(_0x3b6765,null))[_0x8419('0x29')](saveUpdates(_0x45abc5[_0x8419('0x52')],null))['then'](respondWithResult(_0x3b6765,null))[_0x8419('0x48')](handleError(_0x3b6765,null));};exports['destroy']=function(_0xc41754,_0x1f6b34){return db[_0x8419('0x32')]['find']({'where':{'id':_0xc41754['params']['id']}})[_0x8419('0x29')](handleEntityNotFound(_0x1f6b34,null))[_0x8419('0x29')](removeEntity(_0x1f6b34,null))['catch'](handleError(_0x1f6b34,null));}; \ No newline at end of file +var _0x6599=['rows','catch','show','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','name','index','map','VoiceChanSpy','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x1e2671,_0x4cf90a){var _0x492489=function(_0x1440b6){while(--_0x1440b6){_0x1e2671['push'](_0x1e2671['shift']());}};_0x492489(++_0x4cf90a);}(_0x6599,0xb0));var _0x9659=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x6599[_0x5538d5];return _0x323b1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9659('0x0'));var zipdir=require(_0x9659('0x1'));var jsonpatch=require(_0x9659('0x2'));var rp=require(_0x9659('0x3'));var moment=require(_0x9659('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9659('0x5'));var util=require('util');var path=require(_0x9659('0x6'));var sox=require('sox');var csv=require(_0x9659('0x7'));var ejs=require(_0x9659('0x8'));var fs=require('fs');var fs_extra=require(_0x9659('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9659('0xa'));var jsforce=require(_0x9659('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9659('0x7'));var querystring=require('querystring');var Papa=require(_0x9659('0xc'));var Redis=require(_0x9659('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9659('0xe'));var as=require(_0x9659('0xf'));var hardwareService=require(_0x9659('0x10'));var logger=require('../../config/logger')(_0x9659('0x11'));var utils=require('../../config/utils');var config=require(_0x9659('0x12'));var licenseUtil=require(_0x9659('0x13'));var db=require(_0x9659('0x14'))['db'];function respondWithStatusCode(_0x567463,_0x1f4884){_0x1f4884=_0x1f4884||0xcc;return function(_0x414542){if(_0x414542){return _0x567463[_0x9659('0x15')](_0x1f4884);}return _0x567463[_0x9659('0x16')](_0x1f4884)[_0x9659('0x17')]();};}function respondWithResult(_0x38a89e,_0x805d8c){_0x805d8c=_0x805d8c||0xc8;return function(_0x3a3b18){if(_0x3a3b18){return _0x38a89e[_0x9659('0x16')](_0x805d8c)[_0x9659('0x18')](_0x3a3b18);}};}function respondWithFilteredResult(_0x323c10,_0x122fe4){return function(_0x23e514){if(_0x23e514){var _0x23098d=typeof _0x122fe4['offset']===_0x9659('0x19')&&typeof _0x122fe4[_0x9659('0x1a')]===_0x9659('0x19');var _0x3948c5=_0x23e514[_0x9659('0x1b')];var _0x434249=_0x23098d?0x0:_0x122fe4[_0x9659('0x1c')];var _0x266721=_0x23098d?_0x23e514[_0x9659('0x1b')]:_0x122fe4['offset']+_0x122fe4[_0x9659('0x1a')];var _0xaa8560;if(_0x266721>=_0x3948c5){_0x266721=_0x3948c5;_0xaa8560=0xc8;}else{_0xaa8560=0xce;}_0x323c10[_0x9659('0x16')](_0xaa8560);return _0x323c10['set'](_0x9659('0x1d'),_0x434249+'-'+_0x266721+'/'+_0x3948c5)['json'](_0x23e514);}return null;};}function patchUpdates(_0x301c36){return function(_0x3c4a1e){try{jsonpatch[_0x9659('0x1e')](_0x3c4a1e,_0x301c36,!![]);}catch(_0x245cf4){return BPromise[_0x9659('0x1f')](_0x245cf4);}return _0x3c4a1e[_0x9659('0x20')]();};}function saveUpdates(_0x5d4eb5,_0x31a3c9){return function(_0x34e36f){if(_0x34e36f){return _0x34e36f['update'](_0x5d4eb5)[_0x9659('0x21')](function(_0x44055f){return _0x44055f;});}return null;};}function removeEntity(_0x170837,_0x54a727){return function(_0x34cff7){if(_0x34cff7){return _0x34cff7[_0x9659('0x22')]()[_0x9659('0x21')](function(){var _0x46f3c6=_0x34cff7[_0x9659('0x23')]({'plain':!![]});var _0x581c68=_0x9659('0x24');return db[_0x9659('0x25')][_0x9659('0x22')]({'where':{'type':_0x581c68,'resourceId':_0x46f3c6['id']}})[_0x9659('0x21')](function(){return _0x34cff7;});})['then'](function(){_0x170837[_0x9659('0x16')](0xcc)[_0x9659('0x17')]();});}};}function handleEntityNotFound(_0x46ca50,_0x12093a){return function(_0x49389b){if(!_0x49389b){_0x46ca50[_0x9659('0x15')](0x194);}return _0x49389b;};}function handleError(_0x4795d1,_0x326e47){_0x326e47=_0x326e47||0x1f4;return function(_0x5bf928){logger[_0x9659('0x26')](_0x5bf928['stack']);if(_0x5bf928['name']){delete _0x5bf928[_0x9659('0x27')];}_0x4795d1[_0x9659('0x16')](_0x326e47)['send'](_0x5bf928);};}exports[_0x9659('0x28')]=function(_0x4d1b05,_0x87a153){var _0x8a399d={},_0x8e0005={},_0x2a24d0={'count':0x0,'rows':[]};var _0x3aae90=_[_0x9659('0x29')](db[_0x9659('0x2a')]['rawAttributes'],function(_0x28e92f){return{'name':_0x28e92f[_0x9659('0x2b')],'type':_0x28e92f[_0x9659('0x2c')]['key']};});_0x8e0005[_0x9659('0x2d')]=_[_0x9659('0x29')](_0x3aae90,'name');_0x8e0005[_0x9659('0x2e')]=_[_0x9659('0x2f')](_0x4d1b05['query']);_0x8e0005[_0x9659('0x30')]=_[_0x9659('0x31')](_0x8e0005['model'],_0x8e0005[_0x9659('0x2e')]);_0x8a399d[_0x9659('0x32')]=_[_0x9659('0x31')](_0x8e0005[_0x9659('0x2d')],qs[_0x9659('0x33')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x33')]));_0x8a399d[_0x9659('0x32')]=_0x8a399d[_0x9659('0x32')][_0x9659('0x34')]?_0x8a399d[_0x9659('0x32')]:_0x8e0005[_0x9659('0x2d')];if(!_0x4d1b05[_0x9659('0x2e')][_0x9659('0x35')](_0x9659('0x36'))){_0x8a399d['limit']=qs[_0x9659('0x1a')](_0x4d1b05[_0x9659('0x2e')]['limit']);_0x8a399d[_0x9659('0x1c')]=qs[_0x9659('0x1c')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x1c')]);}_0x8a399d[_0x9659('0x37')]=qs[_0x9659('0x38')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x38')]);_0x8a399d[_0x9659('0x39')]=qs[_0x9659('0x30')](_['pick'](_0x4d1b05[_0x9659('0x2e')],_0x8e0005[_0x9659('0x30')]),_0x3aae90);if(_0x4d1b05[_0x9659('0x2e')][_0x9659('0x3a')]){_0x8a399d[_0x9659('0x39')]=_[_0x9659('0x3b')](_0x8a399d[_0x9659('0x39')],{'$or':_[_0x9659('0x29')](_0x3aae90,function(_0x422aa6){if(_0x422aa6[_0x9659('0x2c')]!==_0x9659('0x3c')){var _0x8b0139={};_0x8b0139[_0x422aa6[_0x9659('0x27')]]={'$like':'%'+_0x4d1b05['query'][_0x9659('0x3a')]+'%'};return _0x8b0139;}})});}_0x8a399d=_[_0x9659('0x3b')]({},_0x8a399d,_0x4d1b05[_0x9659('0x3d')]);var _0x579515={'where':_0x8a399d[_0x9659('0x39')]};return db[_0x9659('0x2a')][_0x9659('0x1b')](_0x579515)[_0x9659('0x21')](function(_0x260ecc){_0x2a24d0[_0x9659('0x1b')]=_0x260ecc;if(_0x4d1b05[_0x9659('0x2e')][_0x9659('0x3e')]){_0x8a399d['include']=[{'all':!![]}];}return db[_0x9659('0x2a')][_0x9659('0x3f')](_0x8a399d);})[_0x9659('0x21')](function(_0x4cf009){_0x2a24d0[_0x9659('0x40')]=_0x4cf009;return _0x2a24d0;})[_0x9659('0x21')](respondWithFilteredResult(_0x87a153,_0x8a399d))[_0x9659('0x41')](handleError(_0x87a153,null));};exports[_0x9659('0x42')]=function(_0x1597f8,_0x72d45e){var _0x3b0d77={'raw':![],'where':{'id':_0x1597f8[_0x9659('0x43')]['id']}},_0x316de6={};_0x316de6['model']=_[_0x9659('0x2f')](db[_0x9659('0x2a')][_0x9659('0x44')]);_0x316de6[_0x9659('0x2e')]=_[_0x9659('0x2f')](_0x1597f8[_0x9659('0x2e')]);_0x316de6[_0x9659('0x30')]=_[_0x9659('0x31')](_0x316de6['model'],_0x316de6[_0x9659('0x2e')]);_0x3b0d77[_0x9659('0x32')]=_['intersection'](_0x316de6['model'],qs[_0x9659('0x33')](_0x1597f8[_0x9659('0x2e')]['fields']));_0x3b0d77['attributes']=_0x3b0d77['attributes'][_0x9659('0x34')]?_0x3b0d77[_0x9659('0x32')]:_0x316de6[_0x9659('0x2d')];if(_0x1597f8['query']['includeAll']){_0x3b0d77[_0x9659('0x45')]=[{'all':!![]}];}_0x3b0d77=_[_0x9659('0x3b')]({},_0x3b0d77,_0x1597f8[_0x9659('0x3d')]);return db[_0x9659('0x2a')]['find'](_0x3b0d77)[_0x9659('0x21')](handleEntityNotFound(_0x72d45e,null))[_0x9659('0x21')](respondWithResult(_0x72d45e,null))[_0x9659('0x41')](handleError(_0x72d45e,null));};exports['create']=function(_0x3b590e,_0x2dc821){return db[_0x9659('0x2a')][_0x9659('0x46')](_0x3b590e[_0x9659('0x47')],{})[_0x9659('0x21')](function(_0x16f6f2){var _0x49940e=_0x3b590e[_0x9659('0x48')][_0x9659('0x23')]({'plain':!![]});if(!_0x49940e)throw new Error(_0x9659('0x49'));if(_0x49940e[_0x9659('0x4a')]===_0x9659('0x48')){var _0x19c1e4=_0x16f6f2[_0x9659('0x23')]({'plain':!![]});var _0x3e93b9=_0x9659('0x24');return db['UserProfileSection'][_0x9659('0x4b')]({'where':{'name':_0x3e93b9,'userProfileId':_0x49940e[_0x9659('0x4c')]},'raw':!![]})['then'](function(_0x19582c){if(_0x19582c&&_0x19582c[_0x9659('0x4d')]===0x0){return db[_0x9659('0x25')][_0x9659('0x46')]({'name':_0x19c1e4[_0x9659('0x27')],'resourceId':_0x19c1e4['id'],'type':_0x19582c[_0x9659('0x27')],'sectionId':_0x19582c['id']},{})[_0x9659('0x21')](function(){return _0x16f6f2;});}else{return _0x16f6f2;}})[_0x9659('0x41')](function(_0x2d8803){logger['error'](_0x9659('0x4e'),_0x2d8803);throw _0x2d8803;});}return _0x16f6f2;})[_0x9659('0x21')](respondWithResult(_0x2dc821,0xc9))[_0x9659('0x41')](handleError(_0x2dc821,null));};exports[_0x9659('0x4f')]=function(_0x39b842,_0x210edb){if(_0x39b842['body']['id']){delete _0x39b842[_0x9659('0x47')]['id'];}return db[_0x9659('0x2a')][_0x9659('0x4b')]({'where':{'id':_0x39b842[_0x9659('0x43')]['id']}})[_0x9659('0x21')](handleEntityNotFound(_0x210edb,null))[_0x9659('0x21')](saveUpdates(_0x39b842[_0x9659('0x47')],null))[_0x9659('0x21')](respondWithResult(_0x210edb,null))[_0x9659('0x41')](handleError(_0x210edb,null));};exports[_0x9659('0x22')]=function(_0x2465f9,_0xdca12e){return db['VoiceChanSpy'][_0x9659('0x4b')]({'where':{'id':_0x2465f9[_0x9659('0x43')]['id']}})[_0x9659('0x21')](handleEntityNotFound(_0xdca12e,null))[_0x9659('0x21')](removeEntity(_0xdca12e,null))[_0x9659('0x41')](handleError(_0xdca12e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7457706..ff34c88 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 _0x016e=['auth','Authenticate','password','ChanSpy','name','options','join','record','length','internal','concat','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a'];(function(_0x234577,_0x3b9004){var _0x28fea6=function(_0x59692d){while(--_0x59692d){_0x234577['push'](_0x234577['shift']());}};_0x28fea6(++_0x3b9004);}(_0x016e,0x167));var _0xe016=function(_0xb714a0,_0x2b97dd){_0xb714a0=_0xb714a0-0x0;var _0x15c56c=_0x016e[_0xb714a0];return _0x15c56c;};'use strict';var _=require(_0xe016('0x0'));var util=require('util');var BPromise=require(_0xe016('0x1'));var attributes=require(_0xe016('0x2'));var getUserApplications=function(_0x46cae3,_0x288696,_0xa7e6c3){var _0x28274d=0x1;var _0xd3df61=[];var _0x4dfc38={'context':_0x288696[_0xe016('0x3')]||_0xe016('0x4'),'exten':util[_0xe016('0x5')]('%s%s',_0x46cae3[_0xe016('0x6')],_0xa7e6c3),'type':_0xe016('0x7'),'isApp':![],'ChanSpyId':_0x46cae3['id'],'UserId':_0x288696['id']};_0xd3df61['push'](_[_0xe016('0x8')]({'app':_0xe016('0x9'),'appdata':util['format'](_0xe016('0xa'),_0xe016('0xb')),'priority':_0x28274d++},_0x4dfc38));if(_0x46cae3['record']){_0xd3df61[_0xe016('0xc')](_[_0xe016('0x8')]({'app':_0xe016('0xd'),'appdata':util[_0xe016('0x5')](_0xe016('0xe'),_0x46cae3['recordingFormat']),'priority':_0x28274d++},_0x4dfc38));}if(_0x46cae3[_0xe016('0xf')]){_0xd3df61['push'](_[_0xe016('0x8')]({'app':_0xe016('0x10'),'appdata':_0x46cae3[_0xe016('0x11')],'priority':_0x28274d++},_0x4dfc38));}_0xd3df61[_0xe016('0xc')](_['merge']({'app':_0xe016('0x12'),'appdata':util['format']('SIP/%s,%s',_0x288696[_0xe016('0x13')],_0x46cae3[_0xe016('0x14')]?_0x46cae3[_0xe016('0x14')][_0xe016('0x15')](''):''),'priority':_0x28274d++},_0x4dfc38));if(_0x46cae3[_0xe016('0x16')]){_0xd3df61['push'](_[_0xe016('0x8')]({'app':'StopMixMonitor','priority':_0x28274d++},_0x4dfc38));}return _0xd3df61;};var getChanSpyApplications=function(_0x1529ee,_0x1bcbb0){var _0x407f7a=[];for(var _0x566ec7=0x0,_0x2a5de0=0x1;_0x566ec7<_0x1bcbb0[_0xe016('0x17')];_0x566ec7++,_0x2a5de0=0x1){_0x407f7a=_0x407f7a['concat'](getUserApplications(_0x1529ee,_0x1bcbb0[_0x566ec7],_0x1bcbb0[_0x566ec7][_0xe016('0x18')]));if(_0x1bcbb0[_0x566ec7][_0xe016('0x18')]!=_0x1bcbb0[_0x566ec7][_0xe016('0x13')]){_0x407f7a=_0x407f7a[_0xe016('0x19')](getUserApplications(_0x1529ee,_0x1bcbb0[_0x566ec7],_0x1bcbb0[_0x566ec7][_0xe016('0x13')]));}}return _0x407f7a;};var getChanSpyPromise=function(_0xc1ac33,_0x31c0e7){return new BPromise(function(_0x3b4aab,_0x2eef32){return _0xc1ac33['User']['findAll']({'attributes':['id','name',_0xe016('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xe016('0x1a')](function(_0x3ef1bd){if(_0x3ef1bd){return _0x3b4aab(getChanSpyApplications(_0x31c0e7,_0x3ef1bd));}return _0x3b4aab([]);})[_0xe016('0x1b')](function(_0x20b47e){_0x2eef32(_0x20b47e);});});};module[_0xe016('0x1c')]=function(_0x3a9241,_0x1a175c){var _0x2b39ed=_0x3a9241['models'];return _0x3a9241[_0xe016('0x1d')](_0xe016('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x377b9f,_0x30cb47,_0x33c7dc){return getChanSpyPromise(_0x2b39ed,_0x377b9f)[_0xe016('0x1a')](function(_0x3bacab){if(_0x3bacab&&_0x3bacab[_0xe016('0x17')]){return _0x2b39ed[_0xe016('0x1f')][_0xe016('0x20')](_0x3bacab);}})['then'](function(){_0x33c7dc();})['catch'](function(_0x3e227c){_0x33c7dc(_0x3e227c);});},'afterUpdate':function(_0xcfb870,_0x38d6b8,_0x499f32){return _0x2b39ed[_0xe016('0x1f')][_0xe016('0x21')]({'where':{'ChanSpyId':_0xcfb870['id']}})[_0xe016('0x1a')](function(){return getChanSpyPromise(_0x2b39ed,_0xcfb870);})[_0xe016('0x1a')](function(_0x4553f7){if(_0x4553f7&&_0x4553f7[_0xe016('0x17')]){return _0x2b39ed[_0xe016('0x1f')][_0xe016('0x20')](_0x4553f7);}})['then'](function(){_0x499f32();})[_0xe016('0x1b')](function(_0x4a76f7){_0x499f32(_0x4a76f7);});},'afterDestroy':function(_0x474c62,_0x3091e8,_0x3f5209){return _0x2b39ed[_0xe016('0x1f')][_0xe016('0x21')]({'where':{'ChanSpyId':_0x474c62['id']}})[_0xe016('0x1a')](function(){_0x3f5209();})[_0xe016('0x1b')](function(_0x360da6){_0x3f5209(_0x360da6);});}}});}; \ No newline at end of file +var _0xf422=['voice_chanspy','length','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','push','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','concat','internal','name','then','catch','models','define','VoiceChanSpy'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xf422,0x10d));var _0x2f42=function(_0x5d87c8,_0x1a943f){_0x5d87c8=_0x5d87c8-0x0;var _0xba3816=_0xf422[_0x5d87c8];return _0xba3816;};'use strict';var _=require('lodash');var util=require(_0x2f42('0x0'));var BPromise=require(_0x2f42('0x1'));var attributes=require(_0x2f42('0x2'));var getUserApplications=function(_0x460b08,_0x597bdf,_0xd45144){var _0x4f72e7=0x1;var _0x58685d=[];var _0x22d907={'context':_0x597bdf[_0x2f42('0x3')]||_0x2f42('0x4'),'exten':util['format']('%s%s',_0x460b08[_0x2f42('0x5')],_0xd45144),'type':'system','isApp':![],'ChanSpyId':_0x460b08['id'],'UserId':_0x597bdf['id']};_0x58685d[_0x2f42('0x6')](_['merge']({'app':'Set','appdata':util[_0x2f42('0x7')](_0x2f42('0x8'),_0x2f42('0x9')),'priority':_0x4f72e7++},_0x22d907));if(_0x460b08[_0x2f42('0xa')]){_0x58685d['push'](_[_0x2f42('0xb')]({'app':_0x2f42('0xc'),'appdata':util[_0x2f42('0x7')](_0x2f42('0xd'),_0x460b08['recordingFormat']),'priority':_0x4f72e7++},_0x22d907));}if(_0x460b08['auth']){_0x58685d['push'](_[_0x2f42('0xb')]({'app':_0x2f42('0xe'),'appdata':_0x460b08[_0x2f42('0xf')],'priority':_0x4f72e7++},_0x22d907));}_0x58685d[_0x2f42('0x6')](_[_0x2f42('0xb')]({'app':_0x2f42('0x10'),'appdata':util[_0x2f42('0x7')](_0x2f42('0x11'),_0x597bdf['name'],_0x460b08['options']?_0x460b08[_0x2f42('0x12')][_0x2f42('0x13')](''):''),'priority':_0x4f72e7++},_0x22d907));if(_0x460b08['record']){_0x58685d[_0x2f42('0x6')](_[_0x2f42('0xb')]({'app':'StopMixMonitor','priority':_0x4f72e7++},_0x22d907));}return _0x58685d;};var getChanSpyApplications=function(_0x271c0f,_0x4d0b15){var _0x259363=[];for(var _0x5dd056=0x0,_0x4163bf=0x1;_0x5dd056<_0x4d0b15['length'];_0x5dd056++,_0x4163bf=0x1){_0x259363=_0x259363[_0x2f42('0x14')](getUserApplications(_0x271c0f,_0x4d0b15[_0x5dd056],_0x4d0b15[_0x5dd056][_0x2f42('0x15')]));if(_0x4d0b15[_0x5dd056]['internal']!=_0x4d0b15[_0x5dd056][_0x2f42('0x16')]){_0x259363=_0x259363[_0x2f42('0x14')](getUserApplications(_0x271c0f,_0x4d0b15[_0x5dd056],_0x4d0b15[_0x5dd056]['name']));}}return _0x259363;};var getChanSpyPromise=function(_0x39a276,_0xee2bfb){return new BPromise(function(_0x39b91f,_0x705034){return _0x39a276['User']['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x2f42('0x17')](function(_0x3d0fe6){if(_0x3d0fe6){return _0x39b91f(getChanSpyApplications(_0xee2bfb,_0x3d0fe6));}return _0x39b91f([]);})[_0x2f42('0x18')](function(_0x30b6a1){_0x705034(_0x30b6a1);});});};module['exports']=function(_0x16554c,_0x980a3){var _0x3408e4=_0x16554c[_0x2f42('0x19')];return _0x16554c[_0x2f42('0x1a')](_0x2f42('0x1b'),attributes,{'tableName':_0x2f42('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48efe4,_0x44117e,_0x33b0dd){return getChanSpyPromise(_0x3408e4,_0x48efe4)[_0x2f42('0x17')](function(_0x1985bf){if(_0x1985bf&&_0x1985bf[_0x2f42('0x1d')]){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x1f')](_0x1985bf);}})['then'](function(){_0x33b0dd();})[_0x2f42('0x18')](function(_0xd412fd){_0x33b0dd(_0xd412fd);});},'afterUpdate':function(_0x4f902b,_0x3a8a1c,_0x3ee3d1){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x20')]({'where':{'ChanSpyId':_0x4f902b['id']}})[_0x2f42('0x17')](function(){return getChanSpyPromise(_0x3408e4,_0x4f902b);})['then'](function(_0x1c8614){if(_0x1c8614&&_0x1c8614[_0x2f42('0x1d')]){return _0x3408e4[_0x2f42('0x1e')]['bulkCreate'](_0x1c8614);}})[_0x2f42('0x17')](function(){_0x3ee3d1();})[_0x2f42('0x18')](function(_0x36af0c){_0x3ee3d1(_0x36af0c);});},'afterDestroy':function(_0x450b1c,_0x18b9c2,_0x42e963){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x20')]({'where':{'ChanSpyId':_0x450b1c['id']}})[_0x2f42('0x17')](function(){_0x42e963();})[_0x2f42('0x18')](function(_0x2f6441){_0x42e963(_0x2f6441);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4bf8dd4..da42649 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 _0xf9f7=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error'];(function(_0x47405a,_0x3d42e6){var _0x5e32bd=function(_0x3164d3){while(--_0x3164d3){_0x47405a['push'](_0x47405a['shift']());}};_0x5e32bd(++_0x3d42e6);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x1c9b8e,_0x444821){_0x1c9b8e=_0x1c9b8e-0x0;var _0x35a635=_0xf9f7[_0x1c9b8e];return _0x35a635;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var BPromise=require(_0x7f9f('0x3'));var rs=require(_0x7f9f('0x4'));var fs=require('fs');var Redis=require(_0x7f9f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f9f('0x6'))(_0x7f9f('0x7'));var config=require(_0x7f9f('0x8'));var jayson=require(_0x7f9f('0x9'));var client=jayson[_0x7f9f('0xa')][_0x7f9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5819,_0x37e39f,_0x3da87e){return new BPromise(function(_0x181328,_0x3e9e75){return client[_0x7f9f('0xc')](_0x5b5819,_0x3da87e)['then'](function(_0x3fda85){logger[_0x7f9f('0xd')](_0x7f9f('0xe'),_0x37e39f,_0x7f9f('0xf'));logger[_0x7f9f('0x10')](_0x7f9f('0x11'),_0x37e39f,_0x7f9f('0xf'),JSON['stringify'](_0x3fda85));if(_0x3fda85[_0x7f9f('0x12')]){if(_0x3fda85[_0x7f9f('0x12')]['code']===0x1f4){logger['error'](_0x7f9f('0xe'),_0x37e39f,_0x3fda85['error'][_0x7f9f('0x13')]);return _0x3e9e75(_0x3fda85[_0x7f9f('0x12')]['message']);}logger[_0x7f9f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x37e39f,_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);return _0x181328(_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);}else{logger[_0x7f9f('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x37e39f,_0x7f9f('0xf'));_0x181328(_0x3fda85[_0x7f9f('0x14')]['message']);}})[_0x7f9f('0x15')](function(_0x4a36c8){logger[_0x7f9f('0x12')](_0x7f9f('0xe'),_0x37e39f,_0x4a36c8);_0x3e9e75(_0x4a36c8);});});} \ No newline at end of file +var _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x209bb2,_0x3950e6){var _0xdbedfe=function(_0x1617a9){while(--_0x1617a9){_0x209bb2['push'](_0x209bb2['shift']());}};_0xdbedfe(++_0x3950e6);}(_0xc901,0x142));var _0x1c90=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc901[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index fd26e80..cb8c61a 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 _0x2a56=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put'];(function(_0x40ec5f,_0x547f5f){var _0x28d353=function(_0x492c51){while(--_0x492c51){_0x40ec5f['push'](_0x40ec5f['shift']());}};_0x28d353(++_0x547f5f);}(_0x2a56,0x94));var _0x62a5=function(_0x8a0c41,_0x266b49){_0x8a0c41=_0x8a0c41-0x0;var _0x32ede8=_0x2a56[_0x8a0c41];return _0x32ede8;};'use strict';var multer=require(_0x62a5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x62a5('0x1'));var express=require(_0x62a5('0x2'));var router=express[_0x62a5('0x3')]();var fs_extra=require(_0x62a5('0x4'));var auth=require(_0x62a5('0x5'));var interaction=require(_0x62a5('0x6'));var config=require(_0x62a5('0x7'));var controller=require('./voiceContext.controller');router[_0x62a5('0x8')]('/',auth[_0x62a5('0x9')](),controller[_0x62a5('0xa')]);router[_0x62a5('0x8')](_0x62a5('0xb'),auth[_0x62a5('0x9')](),controller['show']);router[_0x62a5('0xc')]('/',auth[_0x62a5('0x9')](),controller['create']);router[_0x62a5('0xd')](_0x62a5('0xb'),auth[_0x62a5('0x9')](),controller[_0x62a5('0xe')]);router[_0x62a5('0xf')](_0x62a5('0xb'),auth[_0x62a5('0x9')](),controller[_0x62a5('0x10')]);module[_0x62a5('0x11')]=router; \ No newline at end of file +var _0x7a38=['../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','path','connect-timeout','fs-extra'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x7a38,0x1ad));var _0x87a3=function(_0x5ad795,_0x2b6cd3){_0x5ad795=_0x5ad795-0x0;var _0x7d7f42=_0x7a38[_0x5ad795];return _0x7d7f42;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x87a3('0x0'));var timeout=require(_0x87a3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x87a3('0x2'));var auth=require(_0x87a3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x87a3('0x4'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x87a3('0x5')]);router[_0x87a3('0x6')](_0x87a3('0x7'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x9')]);router[_0x87a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x87a3('0xb')]);router[_0x87a3('0xc')](_0x87a3('0x7'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xd')]);router[_0x87a3('0xe')](_0x87a3('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x87a3('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 63e712d..5abde99 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 _0xabb9=['exports','name','STRING','BOOLEAN'];(function(_0x58b220,_0x2be704){var _0xfd4fc3=function(_0x230bd8){while(--_0x230bd8){_0x58b220['push'](_0x58b220['shift']());}};_0xfd4fc3(++_0x2be704);}(_0xabb9,0x118));var _0x9abb=function(_0x25cc0c,_0x16e54d){_0x25cc0c=_0x25cc0c-0x0;var _0x35dc46=_0xabb9[_0x25cc0c];return _0x35dc46;};'use strict';var Sequelize=require('sequelize');module[_0x9abb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9abb('0x1')},'description':{'type':Sequelize[_0x9abb('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9abb('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8354=['STRING','BOOLEAN','sequelize'];(function(_0x17bbbe,_0x5d7ac2){var _0x129365=function(_0x542797){while(--_0x542797){_0x17bbbe['push'](_0x17bbbe['shift']());}};_0x129365(++_0x5d7ac2);}(_0x8354,0xa4));var _0x4835=function(_0x51da59,_0x5d9bda){_0x51da59=_0x51da59-0x0;var _0xc4c8f0=_0x8354[_0x51da59];return _0xc4c8f0;};'use strict';var Sequelize=require(_0x4835('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x4835('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4835('0x2')],'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 8c53ca2..e988370 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 _0xa189=['options','includeAll','include','findAll','rows','catch','show','fields','length','body','readFileSync','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','utf8','render','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x560e64,_0x219b88){var _0x4002bc=function(_0x4ea91f){while(--_0x4ea91f){_0x560e64['push'](_0x560e64['shift']());}};_0x4002bc(++_0x219b88);}(_0xa189,0xf0));var _0x9a18=function(_0x281820,_0x322992){_0x281820=_0x281820-0x0;var _0x4a0100=_0xa189[_0x281820];return _0x4a0100;};'use strict';var emlformat=require(_0x9a18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a18('0x1'));var jsonpatch=require(_0x9a18('0x2'));var rp=require(_0x9a18('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a18('0x4'));var util=require(_0x9a18('0x5'));var path=require(_0x9a18('0x6'));var sox=require(_0x9a18('0x7'));var csv=require(_0x9a18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a18('0x9'));var _=require(_0x9a18('0xa'));var squel=require('squel');var crypto=require(_0x9a18('0xb'));var jsforce=require(_0x9a18('0xc'));var deskjs=require(_0x9a18('0xd'));var toCsv=require(_0x9a18('0x8'));var querystring=require(_0x9a18('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a18('0xf'));var authService=require(_0x9a18('0x10'));var qs=require(_0x9a18('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a18('0x12'))(_0x9a18('0x13'));var utils=require('../../config/utils');var config=require(_0x9a18('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a18('0x15'))['db'];var jayson=require(_0x9a18('0x16'));var client=jayson[_0x9a18('0x17')][_0x9a18('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x28e266,_0x2aeb28,_0x4035ea,_0x5da125){return new BPromise(function(_0xff5e,_0x55b7e8){var _0x1a3208=_0x5da125||client;return _0x1a3208['request'](_0x28e266,_0x4035ea)['then'](function(_0x29399e){logger[_0x9a18('0x19')]('VoiceContext,\x20%s,\x20%s',_0x2aeb28,_0x9a18('0x1a'));logger[_0x9a18('0x1b')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2aeb28,'request\x20sent',JSON[_0x9a18('0x1c')](_0x29399e));if(_0x29399e[_0x9a18('0x1d')]){if(_0x29399e[_0x9a18('0x1d')][_0x9a18('0x1e')]===0x1f4){logger[_0x9a18('0x1d')](_0x9a18('0x1f'),_0x2aeb28,_0x29399e[_0x9a18('0x1d')][_0x9a18('0x20')]);return _0x55b7e8(_0x29399e[_0x9a18('0x1d')][_0x9a18('0x20')]);}logger['error'](_0x9a18('0x1f'),_0x2aeb28,_0x29399e[_0x9a18('0x1d')][_0x9a18('0x20')]);return _0xff5e(_0x29399e[_0x9a18('0x1d')]['message']);}else{logger[_0x9a18('0x19')]('VoiceContext,\x20%s,\x20%s',_0x2aeb28,_0x9a18('0x1a'));_0xff5e(_0x29399e[_0x9a18('0x21')][_0x9a18('0x20')]);}})['catch'](function(_0x507e4a){logger[_0x9a18('0x1d')](_0x9a18('0x1f'),_0x2aeb28,_0x507e4a);_0x55b7e8(_0x507e4a);});});}function respondWithStatusCode(_0x1957a2,_0x11eb95){_0x11eb95=_0x11eb95||0xcc;return function(_0x15d59e){if(_0x15d59e){return _0x1957a2[_0x9a18('0x22')](_0x11eb95);}return _0x1957a2[_0x9a18('0x23')](_0x11eb95)['end']();};}function respondWithResult(_0x22f17a,_0x589201){_0x589201=_0x589201||0xc8;return function(_0x529c78){if(_0x529c78){return _0x22f17a['status'](_0x589201)['json'](_0x529c78);}};}function respondWithFilteredResult(_0x33980b,_0x3cefc7){return function(_0x5e73ba){if(_0x5e73ba){var _0x44a014=typeof _0x3cefc7[_0x9a18('0x24')]===_0x9a18('0x25')&&typeof _0x3cefc7[_0x9a18('0x26')]===_0x9a18('0x25');var _0xd18c8a=_0x5e73ba['count'];var _0x533fcb=_0x44a014?0x0:_0x3cefc7['offset'];var _0x1794e1=_0x44a014?_0x5e73ba[_0x9a18('0x27')]:_0x3cefc7[_0x9a18('0x24')]+_0x3cefc7[_0x9a18('0x26')];var _0x101cb5;if(_0x1794e1>=_0xd18c8a){_0x1794e1=_0xd18c8a;_0x101cb5=0xc8;}else{_0x101cb5=0xce;}_0x33980b[_0x9a18('0x23')](_0x101cb5);return _0x33980b[_0x9a18('0x28')](_0x9a18('0x29'),_0x533fcb+'-'+_0x1794e1+'/'+_0xd18c8a)['json'](_0x5e73ba);}return null;};}function patchUpdates(_0x49a2e9){return function(_0x2be310){try{jsonpatch[_0x9a18('0x2a')](_0x2be310,_0x49a2e9,!![]);}catch(_0xd96379){return BPromise['reject'](_0xd96379);}return _0x2be310[_0x9a18('0x2b')]();};}function saveUpdates(_0x2f12ce,_0x5e01a3){return function(_0x2d18c1){if(_0x2d18c1){return _0x2d18c1['update'](_0x2f12ce)[_0x9a18('0x2c')](function(_0x224920){return _0x224920;});}return null;};}function removeEntity(_0x3c3db6,_0x1db393){return function(_0xfc5aeb){if(_0xfc5aeb){return _0xfc5aeb[_0x9a18('0x2d')]()[_0x9a18('0x2c')](function(){var _0x30b162=_0xfc5aeb['get']({'plain':!![]});var _0x4e0c8e=_0x9a18('0x2e');return db[_0x9a18('0x2f')]['destroy']({'where':{'type':_0x4e0c8e,'resourceId':_0x30b162['id']}})[_0x9a18('0x2c')](function(){return _0xfc5aeb;});})[_0x9a18('0x2c')](function(){_0x3c3db6[_0x9a18('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31dbfc,_0x166892){return function(_0x4ba4a5){if(!_0x4ba4a5){_0x31dbfc[_0x9a18('0x22')](0x194);}return _0x4ba4a5;};}function handleError(_0x18ac1f,_0x3399d0){_0x3399d0=_0x3399d0||0x1f4;return function(_0x3c9c99){logger[_0x9a18('0x1d')](_0x3c9c99[_0x9a18('0x30')]);if(_0x3c9c99['name']){delete _0x3c9c99[_0x9a18('0x31')];}_0x18ac1f[_0x9a18('0x23')](_0x3399d0)[_0x9a18('0x32')](_0x3c9c99);};}exports[_0x9a18('0x33')]=function(_0x2d052b,_0x22c4c1){var _0xdc04be={},_0x39e9b1={},_0x49c80d={'count':0x0,'rows':[]};var _0x14a8d7=_[_0x9a18('0x34')](db[_0x9a18('0x35')][_0x9a18('0x36')],function(_0x3637b5){return{'name':_0x3637b5[_0x9a18('0x37')],'type':_0x3637b5['type'][_0x9a18('0x38')]};});_0x39e9b1[_0x9a18('0x39')]=_[_0x9a18('0x34')](_0x14a8d7,_0x9a18('0x31'));_0x39e9b1[_0x9a18('0x3a')]=_[_0x9a18('0x3b')](_0x2d052b['query']);_0x39e9b1[_0x9a18('0x3c')]=_[_0x9a18('0x3d')](_0x39e9b1[_0x9a18('0x39')],_0x39e9b1[_0x9a18('0x3a')]);_0xdc04be[_0x9a18('0x3e')]=_[_0x9a18('0x3d')](_0x39e9b1['model'],qs['fields'](_0x2d052b['query']['fields']));_0xdc04be[_0x9a18('0x3e')]=_0xdc04be['attributes']['length']?_0xdc04be[_0x9a18('0x3e')]:_0x39e9b1['model'];if(!_0x2d052b['query'][_0x9a18('0x3f')](_0x9a18('0x40'))){_0xdc04be[_0x9a18('0x26')]=qs[_0x9a18('0x26')](_0x2d052b['query'][_0x9a18('0x26')]);_0xdc04be[_0x9a18('0x24')]=qs[_0x9a18('0x24')](_0x2d052b[_0x9a18('0x3a')][_0x9a18('0x24')]);}_0xdc04be['order']=qs[_0x9a18('0x41')](_0x2d052b[_0x9a18('0x3a')][_0x9a18('0x41')]);_0xdc04be[_0x9a18('0x42')]=qs['filters'](_[_0x9a18('0x43')](_0x2d052b[_0x9a18('0x3a')],_0x39e9b1[_0x9a18('0x3c')]),_0x14a8d7);if(_0x2d052b[_0x9a18('0x3a')][_0x9a18('0x44')]){_0xdc04be[_0x9a18('0x42')]=_[_0x9a18('0x45')](_0xdc04be[_0x9a18('0x42')],{'$or':_[_0x9a18('0x34')](_0x14a8d7,function(_0x29a22b){if(_0x29a22b[_0x9a18('0x46')]!==_0x9a18('0x47')){var _0x5b2910={};_0x5b2910[_0x29a22b[_0x9a18('0x31')]]={'$like':'%'+_0x2d052b[_0x9a18('0x3a')]['filter']+'%'};return _0x5b2910;}})});}_0xdc04be=_[_0x9a18('0x45')]({},_0xdc04be,_0x2d052b[_0x9a18('0x48')]);var _0x5b9254={'where':_0xdc04be[_0x9a18('0x42')]};return db[_0x9a18('0x35')][_0x9a18('0x27')](_0x5b9254)[_0x9a18('0x2c')](function(_0x878ec8){_0x49c80d[_0x9a18('0x27')]=_0x878ec8;if(_0x2d052b['query'][_0x9a18('0x49')]){_0xdc04be[_0x9a18('0x4a')]=[{'all':!![]}];}return db[_0x9a18('0x35')][_0x9a18('0x4b')](_0xdc04be);})['then'](function(_0x23ef1b){_0x49c80d[_0x9a18('0x4c')]=_0x23ef1b;return _0x49c80d;})[_0x9a18('0x2c')](respondWithFilteredResult(_0x22c4c1,_0xdc04be))[_0x9a18('0x4d')](handleError(_0x22c4c1,null));};exports[_0x9a18('0x4e')]=function(_0x5d8230,_0x3e953e){var _0x4dd8ee={'raw':![],'where':{'id':_0x5d8230['params']['id']}},_0x44d648={};_0x44d648[_0x9a18('0x39')]=_['keys'](db[_0x9a18('0x35')]['rawAttributes']);_0x44d648[_0x9a18('0x3a')]=_[_0x9a18('0x3b')](_0x5d8230[_0x9a18('0x3a')]);_0x44d648[_0x9a18('0x3c')]=_[_0x9a18('0x3d')](_0x44d648['model'],_0x44d648[_0x9a18('0x3a')]);_0x4dd8ee['attributes']=_['intersection'](_0x44d648[_0x9a18('0x39')],qs[_0x9a18('0x4f')](_0x5d8230[_0x9a18('0x3a')][_0x9a18('0x4f')]));_0x4dd8ee['attributes']=_0x4dd8ee[_0x9a18('0x3e')][_0x9a18('0x50')]?_0x4dd8ee[_0x9a18('0x3e')]:_0x44d648[_0x9a18('0x39')];if(_0x5d8230['query'][_0x9a18('0x49')]){_0x4dd8ee[_0x9a18('0x4a')]=[{'all':!![]}];}_0x4dd8ee=_[_0x9a18('0x45')]({},_0x4dd8ee,_0x5d8230[_0x9a18('0x48')]);return db[_0x9a18('0x35')]['find'](_0x4dd8ee)[_0x9a18('0x2c')](handleEntityNotFound(_0x3e953e,null))[_0x9a18('0x2c')](respondWithResult(_0x3e953e,null))[_0x9a18('0x4d')](handleError(_0x3e953e,null));};exports['create']=function(_0x3c0702,_0x1f4909,_0x448772){var _0x360586;return db[_0x9a18('0x35')]['create'](_0x3c0702[_0x9a18('0x51')],{'raw':!![]})[_0x9a18('0x2c')](function(_0x5f1a33){_0x360586=_0x5f1a33;return db[_0x9a18('0x35')][_0x9a18('0x4b')]({'raw':!![]});})[_0x9a18('0x2c')](function(_0x4a08d4){var _0x29c74d=fs[_0x9a18('0x52')](path[_0x9a18('0x53')](config[_0x9a18('0x54')],_0x9a18('0x55')),'utf8');var _0x4b12bc=ejs['render'](_0x29c74d,{'contexts':_0x4a08d4||[]});fs[_0x9a18('0x56')](_0x9a18('0x57'),_0x4b12bc);})[_0x9a18('0x2c')](function(){return respondWithRpcPromise(_0x9a18('0x58'),_0x9a18('0x59'),{'module':_0x9a18('0x5a')});})[_0x9a18('0x2c')](function(){var _0xb4a27c=_0x3c0702[_0x9a18('0x5b')][_0x9a18('0x5c')]({'plain':!![]});if(!_0xb4a27c)throw new Error(_0x9a18('0x5d'));if(_0xb4a27c[_0x9a18('0x5e')]==='user'){var _0x12755b=_0x360586[_0x9a18('0x5c')]({'plain':!![]});return db[_0x9a18('0x5f')][_0x9a18('0x60')]({'where':{'name':_0x9a18('0x2e'),'userProfileId':_0xb4a27c[_0x9a18('0x61')]},'raw':!![]})[_0x9a18('0x2c')](function(_0x32998f){if(_0x32998f&&_0x32998f[_0x9a18('0x62')]===0x0){return db[_0x9a18('0x2f')]['create']({'name':_0x12755b[_0x9a18('0x31')],'resourceId':_0x12755b['id'],'type':_0x32998f[_0x9a18('0x31')],'sectionId':_0x32998f['id']},{})['then'](function(){return _0x360586;});}else{return _0x360586;}})[_0x9a18('0x4d')](function(_0x2f20e7){logger['error'](_0x9a18('0x63'),_0x2f20e7);throw _0x2f20e7;});}return _0x360586;})[_0x9a18('0x2c')](respondWithResult(_0x1f4909,0xc9))[_0x9a18('0x4d')](handleError(_0x1f4909,null));};exports[_0x9a18('0x64')]=function(_0x480703,_0x5a7826,_0x21db9a){var _0x54856c;return db[_0x9a18('0x35')]['find']({'where':{'id':_0x480703[_0x9a18('0x65')]['id']}})[_0x9a18('0x2c')](handleEntityNotFound(_0x5a7826,null))[_0x9a18('0x2c')](saveUpdates(_0x480703[_0x9a18('0x51')],null))['then'](function(_0x66a61){if(_0x66a61){_0x54856c=_0x66a61;return db[_0x9a18('0x35')]['findAll']({'raw':!![]});}})[_0x9a18('0x2c')](function(_0x857ce9){var _0x57d5a2=fs[_0x9a18('0x52')](path['join'](config[_0x9a18('0x54')],_0x9a18('0x55')),_0x9a18('0x66'));var _0x2ac5a2=ejs[_0x9a18('0x67')](_0x57d5a2,{'contexts':_0x857ce9||[]});fs[_0x9a18('0x56')](_0x9a18('0x57'),_0x2ac5a2);})[_0x9a18('0x2c')](function(){return respondWithRpcPromise(_0x9a18('0x58'),_0x9a18('0x64'),{'module':'chan_sip.so'});})[_0x9a18('0x2c')](function(){return _0x54856c;})['then'](respondWithResult(_0x5a7826,null))[_0x9a18('0x4d')](handleError(_0x5a7826,null));};exports['destroy']=function(_0x474000,_0x8af39f,_0x2d5e68){var _0x200420;return db['VoiceContext'][_0x9a18('0x60')]({'where':{'id':_0x474000[_0x9a18('0x65')]['id']}})['then'](handleEntityNotFound(_0x8af39f,null))[_0x9a18('0x2c')](removeEntity(_0x8af39f,null))['then'](function(){return db['VoiceContext'][_0x9a18('0x4b')]({'raw':!![]});})[_0x9a18('0x2c')](function(_0x5239f6){var _0x5c3c7d=fs[_0x9a18('0x52')](path[_0x9a18('0x53')](config[_0x9a18('0x54')],_0x9a18('0x55')),_0x9a18('0x66'));var _0x4040f8=ejs[_0x9a18('0x67')](_0x5c3c7d,{'contexts':_0x5239f6});fs[_0x9a18('0x56')](_0x9a18('0x57'),_0x4040f8);return respondWithRpcPromise(_0x9a18('0x58'),_0x9a18('0x2d'),{'module':_0x9a18('0x5a')});})['catch'](handleError(_0x8af39f,null));}; \ No newline at end of file +var _0xaebd=['undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','Contexts','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end'];(function(_0x4608f1,_0xfc9a4c){var _0x2c4bf9=function(_0x46a2cd){while(--_0x46a2cd){_0x4608f1['push'](_0x4608f1['shift']());}};_0x2c4bf9(++_0xfc9a4c);}(_0xaebd,0x167));var _0xdaeb=function(_0x1f2c25,_0x11135f){_0x1f2c25=_0x1f2c25-0x0;var _0x167330=_0xaebd[_0x1f2c25];return _0x167330;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaeb('0x1'));var jsonpatch=require(_0xdaeb('0x2'));var rp=require('request-promise');var moment=require(_0xdaeb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x4'));var util=require(_0xdaeb('0x5'));var path=require(_0xdaeb('0x6'));var sox=require(_0xdaeb('0x7'));var csv=require(_0xdaeb('0x8'));var ejs=require(_0xdaeb('0x9'));var fs=require('fs');var fs_extra=require(_0xdaeb('0xa'));var _=require(_0xdaeb('0xb'));var squel=require('squel');var crypto=require(_0xdaeb('0xc'));var jsforce=require(_0xdaeb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdaeb('0x8'));var querystring=require(_0xdaeb('0xe'));var Papa=require(_0xdaeb('0xf'));var Redis=require(_0xdaeb('0x10'));var authService=require(_0xdaeb('0x11'));var qs=require(_0xdaeb('0x12'));var as=require(_0xdaeb('0x13'));var hardwareService=require(_0xdaeb('0x14'));var logger=require(_0xdaeb('0x15'))(_0xdaeb('0x16'));var utils=require(_0xdaeb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdaeb('0x18'));var db=require(_0xdaeb('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xdaeb('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x10d372,_0x379615,_0x31961c,_0x8710e8){return new BPromise(function(_0x59e396,_0xe8e566){var _0x1264c7=_0x8710e8||client;return _0x1264c7[_0xdaeb('0x1b')](_0x10d372,_0x31961c)[_0xdaeb('0x1c')](function(_0x431ced){logger[_0xdaeb('0x1d')](_0xdaeb('0x1e'),_0x379615,_0xdaeb('0x1f'));logger['debug'](_0xdaeb('0x20'),_0x379615,_0xdaeb('0x1f'),JSON[_0xdaeb('0x21')](_0x431ced));if(_0x431ced[_0xdaeb('0x22')]){if(_0x431ced['error']['code']===0x1f4){logger[_0xdaeb('0x22')](_0xdaeb('0x1e'),_0x379615,_0x431ced['error'][_0xdaeb('0x23')]);return _0xe8e566(_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);}logger[_0xdaeb('0x22')](_0xdaeb('0x1e'),_0x379615,_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);return _0x59e396(_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x379615,_0xdaeb('0x1f'));_0x59e396(_0x431ced[_0xdaeb('0x24')][_0xdaeb('0x23')]);}})[_0xdaeb('0x25')](function(_0x4a0bc9){logger['error'](_0xdaeb('0x1e'),_0x379615,_0x4a0bc9);_0xe8e566(_0x4a0bc9);});});}function respondWithStatusCode(_0x4e006c,_0x37fa47){_0x37fa47=_0x37fa47||0xcc;return function(_0x808160){if(_0x808160){return _0x4e006c[_0xdaeb('0x26')](_0x37fa47);}return _0x4e006c[_0xdaeb('0x27')](_0x37fa47)[_0xdaeb('0x28')]();};}function respondWithResult(_0x3154d1,_0x2d1b4f){_0x2d1b4f=_0x2d1b4f||0xc8;return function(_0x383ab4){if(_0x383ab4){return _0x3154d1[_0xdaeb('0x27')](_0x2d1b4f)['json'](_0x383ab4);}};}function respondWithFilteredResult(_0x44119c,_0x569260){return function(_0x54dc47){if(_0x54dc47){var _0x45afd6=typeof _0x569260['offset']===_0xdaeb('0x29')&&typeof _0x569260[_0xdaeb('0x2a')]===_0xdaeb('0x29');var _0x1b0af4=_0x54dc47[_0xdaeb('0x2b')];var _0x3f2212=_0x45afd6?0x0:_0x569260['offset'];var _0x295c57=_0x45afd6?_0x54dc47[_0xdaeb('0x2b')]:_0x569260[_0xdaeb('0x2c')]+_0x569260[_0xdaeb('0x2a')];var _0xab59a1;if(_0x295c57>=_0x1b0af4){_0x295c57=_0x1b0af4;_0xab59a1=0xc8;}else{_0xab59a1=0xce;}_0x44119c[_0xdaeb('0x27')](_0xab59a1);return _0x44119c[_0xdaeb('0x2d')](_0xdaeb('0x2e'),_0x3f2212+'-'+_0x295c57+'/'+_0x1b0af4)['json'](_0x54dc47);}return null;};}function patchUpdates(_0x226ff1){return function(_0x27f2ba){try{jsonpatch['apply'](_0x27f2ba,_0x226ff1,!![]);}catch(_0x27c288){return BPromise[_0xdaeb('0x2f')](_0x27c288);}return _0x27f2ba[_0xdaeb('0x30')]();};}function saveUpdates(_0xeff249,_0xd0e978){return function(_0x2ebe1e){if(_0x2ebe1e){return _0x2ebe1e[_0xdaeb('0x31')](_0xeff249)[_0xdaeb('0x1c')](function(_0x203ac3){return _0x203ac3;});}return null;};}function removeEntity(_0x149d68,_0xdd572c){return function(_0x5de819){if(_0x5de819){return _0x5de819[_0xdaeb('0x32')]()[_0xdaeb('0x1c')](function(){var _0x3fb615=_0x5de819['get']({'plain':!![]});var _0x46b8dd=_0xdaeb('0x33');return db['UserProfileResource'][_0xdaeb('0x32')]({'where':{'type':_0x46b8dd,'resourceId':_0x3fb615['id']}})['then'](function(){return _0x5de819;});})['then'](function(){_0x149d68[_0xdaeb('0x27')](0xcc)[_0xdaeb('0x28')]();});}};}function handleEntityNotFound(_0x1b97b9,_0xbf36b6){return function(_0x5e4d2d){if(!_0x5e4d2d){_0x1b97b9[_0xdaeb('0x26')](0x194);}return _0x5e4d2d;};}function handleError(_0xbc1569,_0x5d0360){_0x5d0360=_0x5d0360||0x1f4;return function(_0x258793){logger[_0xdaeb('0x22')](_0x258793[_0xdaeb('0x34')]);if(_0x258793[_0xdaeb('0x35')]){delete _0x258793['name'];}_0xbc1569[_0xdaeb('0x27')](_0x5d0360)[_0xdaeb('0x36')](_0x258793);};}exports[_0xdaeb('0x37')]=function(_0x2d61a5,_0x249630){var _0x25f63d={},_0x48562c={},_0x1029e5={'count':0x0,'rows':[]};var _0x3c2021=_[_0xdaeb('0x38')](db[_0xdaeb('0x39')]['rawAttributes'],function(_0xadae55){return{'name':_0xadae55[_0xdaeb('0x3a')],'type':_0xadae55[_0xdaeb('0x3b')][_0xdaeb('0x3c')]};});_0x48562c[_0xdaeb('0x3d')]=_[_0xdaeb('0x38')](_0x3c2021,_0xdaeb('0x35'));_0x48562c[_0xdaeb('0x3e')]=_[_0xdaeb('0x3f')](_0x2d61a5[_0xdaeb('0x3e')]);_0x48562c['filters']=_[_0xdaeb('0x40')](_0x48562c[_0xdaeb('0x3d')],_0x48562c[_0xdaeb('0x3e')]);_0x25f63d[_0xdaeb('0x41')]=_[_0xdaeb('0x40')](_0x48562c['model'],qs[_0xdaeb('0x42')](_0x2d61a5['query'][_0xdaeb('0x42')]));_0x25f63d[_0xdaeb('0x41')]=_0x25f63d[_0xdaeb('0x41')]['length']?_0x25f63d[_0xdaeb('0x41')]:_0x48562c[_0xdaeb('0x3d')];if(!_0x2d61a5[_0xdaeb('0x3e')]['hasOwnProperty'](_0xdaeb('0x43'))){_0x25f63d[_0xdaeb('0x2a')]=qs[_0xdaeb('0x2a')](_0x2d61a5[_0xdaeb('0x3e')]['limit']);_0x25f63d[_0xdaeb('0x2c')]=qs[_0xdaeb('0x2c')](_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x2c')]);}_0x25f63d[_0xdaeb('0x44')]=qs['sort'](_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x45')]);_0x25f63d[_0xdaeb('0x46')]=qs[_0xdaeb('0x47')](_['pick'](_0x2d61a5[_0xdaeb('0x3e')],_0x48562c[_0xdaeb('0x47')]),_0x3c2021);if(_0x2d61a5[_0xdaeb('0x3e')]['filter']){_0x25f63d[_0xdaeb('0x46')]=_[_0xdaeb('0x48')](_0x25f63d[_0xdaeb('0x46')],{'$or':_[_0xdaeb('0x38')](_0x3c2021,function(_0x2f35a6){if(_0x2f35a6[_0xdaeb('0x3b')]!==_0xdaeb('0x49')){var _0x2134ad={};_0x2134ad[_0x2f35a6[_0xdaeb('0x35')]]={'$like':'%'+_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x4a')]+'%'};return _0x2134ad;}})});}_0x25f63d=_[_0xdaeb('0x48')]({},_0x25f63d,_0x2d61a5[_0xdaeb('0x4b')]);var _0x44470c={'where':_0x25f63d[_0xdaeb('0x46')]};return db[_0xdaeb('0x39')][_0xdaeb('0x2b')](_0x44470c)[_0xdaeb('0x1c')](function(_0x45533a){_0x1029e5[_0xdaeb('0x2b')]=_0x45533a;if(_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x4c')]){_0x25f63d[_0xdaeb('0x4d')]=[{'all':!![]}];}return db[_0xdaeb('0x39')][_0xdaeb('0x4e')](_0x25f63d);})['then'](function(_0x5016bc){_0x1029e5[_0xdaeb('0x4f')]=_0x5016bc;return _0x1029e5;})[_0xdaeb('0x1c')](respondWithFilteredResult(_0x249630,_0x25f63d))['catch'](handleError(_0x249630,null));};exports[_0xdaeb('0x50')]=function(_0x48ed0a,_0x499967){var _0x3a534f={'raw':![],'where':{'id':_0x48ed0a[_0xdaeb('0x51')]['id']}},_0x857727={};_0x857727['model']=_[_0xdaeb('0x3f')](db[_0xdaeb('0x39')]['rawAttributes']);_0x857727['query']=_[_0xdaeb('0x3f')](_0x48ed0a[_0xdaeb('0x3e')]);_0x857727[_0xdaeb('0x47')]=_[_0xdaeb('0x40')](_0x857727['model'],_0x857727['query']);_0x3a534f['attributes']=_[_0xdaeb('0x40')](_0x857727[_0xdaeb('0x3d')],qs[_0xdaeb('0x42')](_0x48ed0a[_0xdaeb('0x3e')][_0xdaeb('0x42')]));_0x3a534f[_0xdaeb('0x41')]=_0x3a534f[_0xdaeb('0x41')]['length']?_0x3a534f['attributes']:_0x857727[_0xdaeb('0x3d')];if(_0x48ed0a[_0xdaeb('0x3e')][_0xdaeb('0x4c')]){_0x3a534f[_0xdaeb('0x4d')]=[{'all':!![]}];}_0x3a534f=_[_0xdaeb('0x48')]({},_0x3a534f,_0x48ed0a[_0xdaeb('0x4b')]);return db['VoiceContext']['find'](_0x3a534f)[_0xdaeb('0x1c')](handleEntityNotFound(_0x499967,null))[_0xdaeb('0x1c')](respondWithResult(_0x499967,null))['catch'](handleError(_0x499967,null));};exports['create']=function(_0x865a69,_0x16ba82,_0x5b501e){var _0x3124e5;return db[_0xdaeb('0x39')]['create'](_0x865a69[_0xdaeb('0x52')],{'raw':!![]})[_0xdaeb('0x1c')](function(_0x38f095){_0x3124e5=_0x38f095;return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});})[_0xdaeb('0x1c')](function(_0x52801d){var _0x37c44b=fs[_0xdaeb('0x53')](path[_0xdaeb('0x54')](config[_0xdaeb('0x55')],_0xdaeb('0x56')),_0xdaeb('0x57'));var _0x558812=ejs[_0xdaeb('0x58')](_0x37c44b,{'contexts':_0x52801d||[]});fs[_0xdaeb('0x59')](_0xdaeb('0x5a'),_0x558812);})[_0xdaeb('0x1c')](function(){return respondWithRpcPromise(_0xdaeb('0x5b'),_0xdaeb('0x5c'),{'module':_0xdaeb('0x5d')});})[_0xdaeb('0x1c')](function(){var _0x40d1aa=_0x865a69[_0xdaeb('0x5e')]['get']({'plain':!![]});if(!_0x40d1aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40d1aa[_0xdaeb('0x5f')]===_0xdaeb('0x5e')){var _0xc455ed=_0x3124e5['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x40d1aa[_0xdaeb('0x60')]},'raw':!![]})[_0xdaeb('0x1c')](function(_0x240353){if(_0x240353&&_0x240353['autoAssociation']===0x0){return db[_0xdaeb('0x61')][_0xdaeb('0x5c')]({'name':_0xc455ed[_0xdaeb('0x35')],'resourceId':_0xc455ed['id'],'type':_0x240353['name'],'sectionId':_0x240353['id']},{})['then'](function(){return _0x3124e5;});}else{return _0x3124e5;}})[_0xdaeb('0x25')](function(_0x4c49d6){logger[_0xdaeb('0x22')](_0xdaeb('0x62'),_0x4c49d6);throw _0x4c49d6;});}return _0x3124e5;})[_0xdaeb('0x1c')](respondWithResult(_0x16ba82,0xc9))[_0xdaeb('0x25')](handleError(_0x16ba82,null));};exports[_0xdaeb('0x31')]=function(_0xfacc8a,_0x228686,_0xff3364){var _0x32b925;return db[_0xdaeb('0x39')][_0xdaeb('0x63')]({'where':{'id':_0xfacc8a[_0xdaeb('0x51')]['id']}})[_0xdaeb('0x1c')](handleEntityNotFound(_0x228686,null))[_0xdaeb('0x1c')](saveUpdates(_0xfacc8a['body'],null))[_0xdaeb('0x1c')](function(_0x203f1f){if(_0x203f1f){_0x32b925=_0x203f1f;return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});}})[_0xdaeb('0x1c')](function(_0x29a3da){var _0x5aa70d=fs[_0xdaeb('0x53')](path['join'](config['root'],_0xdaeb('0x56')),'utf8');var _0x2114ae=ejs['render'](_0x5aa70d,{'contexts':_0x29a3da||[]});fs[_0xdaeb('0x59')](_0xdaeb('0x5a'),_0x2114ae);})[_0xdaeb('0x1c')](function(){return respondWithRpcPromise('Reload',_0xdaeb('0x31'),{'module':_0xdaeb('0x5d')});})[_0xdaeb('0x1c')](function(){return _0x32b925;})[_0xdaeb('0x1c')](respondWithResult(_0x228686,null))['catch'](handleError(_0x228686,null));};exports[_0xdaeb('0x32')]=function(_0x826b80,_0x41cc44,_0x2a4b5d){var _0x1efb4b;return db['VoiceContext']['find']({'where':{'id':_0x826b80[_0xdaeb('0x51')]['id']}})[_0xdaeb('0x1c')](handleEntityNotFound(_0x41cc44,null))[_0xdaeb('0x1c')](removeEntity(_0x41cc44,null))[_0xdaeb('0x1c')](function(){return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});})[_0xdaeb('0x1c')](function(_0x465356){var _0x842769=fs[_0xdaeb('0x53')](path[_0xdaeb('0x54')](config[_0xdaeb('0x55')],'server/files/templates/context.ejs'),'utf8');var _0x595eb8=ejs[_0xdaeb('0x58')](_0x842769,{'contexts':_0x465356});fs['writeFileSync'](_0xdaeb('0x5a'),_0x595eb8);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0xdaeb('0x25')](handleError(_0x41cc44,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 0088f1e..0381cb0 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 _0xb9ed=['../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3af68e,_0x384315){var _0x3e6d5b=function(_0x21e40c){while(--_0x21e40c){_0x3af68e['push'](_0x3af68e['shift']());}};_0x3e6d5b(++_0x384315);}(_0xb9ed,0x1bc));var _0xdb9e=function(_0x183737,_0x4132a1){_0x183737=_0x183737-0x0;var _0x4fba8a=_0xb9ed[_0x183737];return _0x4fba8a;};'use strict';var _=require(_0xdb9e('0x0'));var util=require('util');var logger=require(_0xdb9e('0x1'))('api');var moment=require(_0xdb9e('0x2'));var BPromise=require(_0xdb9e('0x3'));var rp=require(_0xdb9e('0x4'));var fs=require('fs');var path=require(_0xdb9e('0x5'));var rimraf=require(_0xdb9e('0x6'));var config=require(_0xdb9e('0x7'));var attributes=require(_0xdb9e('0x8'));module[_0xdb9e('0x9')]=function(_0x4a4bad,_0x1ccecd){return _0x4a4bad['define'](_0xdb9e('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc20=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','define','lodash','util','moment'];(function(_0x4be125,_0x5c8307){var _0x227c82=function(_0x3b778a){while(--_0x3b778a){_0x4be125['push'](_0x4be125['shift']());}};_0x227c82(++_0x5c8307);}(_0xfc20,0xd5));var _0x0fc2=function(_0x38026f,_0x50f8bb){_0x38026f=_0x38026f-0x0;var _0xfcaa5e=_0xfc20[_0x38026f];return _0xfcaa5e;};'use strict';var _=require(_0x0fc2('0x0'));var util=require(_0x0fc2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0fc2('0x2'));var BPromise=require(_0x0fc2('0x3'));var rp=require(_0x0fc2('0x4'));var fs=require('fs');var path=require(_0x0fc2('0x5'));var rimraf=require(_0x0fc2('0x6'));var config=require('../../config/environment');var attributes=require(_0x0fc2('0x7'));module['exports']=function(_0x53a40d,_0x2202da){return _0x53a40d[_0x0fc2('0x8')]('VoiceContext',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 e4a2d9f..d1ab3f6 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 _0x7348=['info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x18313b,_0x5c914f){var _0x2ba97d=function(_0x41143d){while(--_0x41143d){_0x18313b['push'](_0x18313b['shift']());}};_0x2ba97d(++_0x5c914f);}(_0x7348,0x16b));var _0x8734=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7348[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x8734('0x0'));var moment=require(_0x8734('0x1'));var BPromise=require('bluebird');var rs=require(_0x8734('0x2'));var fs=require('fs');var Redis=require(_0x8734('0x3'));var db=require(_0x8734('0x4'))['db'];var utils=require(_0x8734('0x5'));var logger=require(_0x8734('0x6'))('rpc');var config=require(_0x8734('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8734('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11505f,_0x3dbaf1,_0x409987){return new BPromise(function(_0x4b55fc,_0x282efb){return client['request'](_0x11505f,_0x409987)['then'](function(_0xb06875){logger['info'](_0x8734('0x9'),_0x3dbaf1,'request\x20sent');logger[_0x8734('0xa')](_0x8734('0xb'),_0x3dbaf1,_0x8734('0xc'),JSON[_0x8734('0xd')](_0xb06875));if(_0xb06875['error']){if(_0xb06875[_0x8734('0xe')][_0x8734('0xf')]===0x1f4){logger[_0x8734('0xe')](_0x8734('0x9'),_0x3dbaf1,_0xb06875[_0x8734('0xe')][_0x8734('0x10')]);return _0x282efb(_0xb06875[_0x8734('0xe')]['message']);}logger[_0x8734('0xe')]('VoiceContext,\x20%s,\x20%s',_0x3dbaf1,_0xb06875['error']['message']);return _0x4b55fc(_0xb06875[_0x8734('0xe')][_0x8734('0x10')]);}else{logger[_0x8734('0x11')](_0x8734('0x9'),_0x3dbaf1,_0x8734('0xc'));_0x4b55fc(_0xb06875['result'][_0x8734('0x10')]);}})[_0x8734('0x12')](function(_0x5b1663){logger[_0x8734('0xe')](_0x8734('0x9'),_0x3dbaf1,_0x5b1663);_0x282efb(_0x5b1663);});});} \ No newline at end of file +var _0x9189=['request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','result','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x137a46,_0x164a93){var _0x4f0320=function(_0x15dbf9){while(--_0x15dbf9){_0x137a46['push'](_0x137a46['shift']());}};_0x4f0320(++_0x164a93);}(_0x9189,0x1b0));var _0x9918=function(_0xc3204d,_0x52bef5){_0xc3204d=_0xc3204d-0x0;var _0x2896a2=_0x9189[_0xc3204d];return _0x2896a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9918('0x0'));var BPromise=require(_0x9918('0x1'));var rs=require(_0x9918('0x2'));var fs=require('fs');var Redis=require(_0x9918('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9918('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9918('0x5'));var jayson=require(_0x9918('0x6'));var client=jayson['client'][_0x9918('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3cb556,_0x7b8770,_0x5c926e){return new BPromise(function(_0x5a0552,_0x50a534){return client[_0x9918('0x8')](_0x3cb556,_0x5c926e)[_0x9918('0x9')](function(_0x553c75){logger[_0x9918('0xa')]('VoiceContext,\x20%s,\x20%s',_0x7b8770,_0x9918('0xb'));logger[_0x9918('0xc')](_0x9918('0xd'),_0x7b8770,_0x9918('0xb'),JSON[_0x9918('0xe')](_0x553c75));if(_0x553c75[_0x9918('0xf')]){if(_0x553c75[_0x9918('0xf')]['code']===0x1f4){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x553c75['error']['message']);return _0x50a534(_0x553c75[_0x9918('0xf')]['message']);}logger['error'](_0x9918('0x10'),_0x7b8770,_0x553c75[_0x9918('0xf')]['message']);return _0x5a0552(_0x553c75[_0x9918('0xf')]['message']);}else{logger[_0x9918('0xa')](_0x9918('0x10'),_0x7b8770,_0x9918('0xb'));_0x5a0552(_0x553c75[_0x9918('0x11')][_0x9918('0x12')]);}})[_0x9918('0x13')](function(_0x1a676f){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x1a676f);_0x50a534(_0x1a676f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 7fca789..3add302 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 _0x2c51=['update','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','describe','show','post','create'];(function(_0x2f9738,_0xa4020e){var _0x556105=function(_0x3afcca){while(--_0x3afcca){_0x2f9738['push'](_0x2f9738['shift']());}};_0x556105(++_0xa4020e);}(_0x2c51,0x1a5));var _0x12c5=function(_0x2c2db3,_0x9997f6){_0x2c2db3=_0x2c2db3-0x0;var _0x3284e8=_0x2c51[_0x2c2db3];return _0x3284e8;};'use strict';var multer=require(_0x12c5('0x0'));var util=require(_0x12c5('0x1'));var path=require(_0x12c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x12c5('0x3'));var router=express[_0x12c5('0x4')]();var fs_extra=require(_0x12c5('0x5'));var auth=require(_0x12c5('0x6'));var interaction=require(_0x12c5('0x7'));var config=require('../../config/environment');var controller=require(_0x12c5('0x8'));router['get']('/',auth[_0x12c5('0x9')](),controller[_0x12c5('0xa')]);router[_0x12c5('0xb')]('/describe',auth[_0x12c5('0x9')](),controller[_0x12c5('0xc')]);router[_0x12c5('0xb')]('/:id',auth[_0x12c5('0x9')](),controller[_0x12c5('0xd')]);router[_0x12c5('0xe')]('/',auth[_0x12c5('0x9')](),controller[_0x12c5('0xf')]);router['put']('/:id',auth[_0x12c5('0x9')](),controller[_0x12c5('0x10')]);router['delete'](_0x12c5('0x11'),auth[_0x12c5('0x9')](),controller[_0x12c5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x04c7=['Router','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x393687,_0x2e5f70){var _0x32af9a=function(_0x5aa533){while(--_0x5aa533){_0x393687['push'](_0x393687['shift']());}};_0x32af9a(++_0x2e5f70);}(_0x04c7,0x8b));var _0x704c=function(_0x49ed67,_0x290989){_0x49ed67=_0x49ed67-0x0;var _0x1523d5=_0x04c7[_0x49ed67];return _0x1523d5;};'use strict';var multer=require(_0x704c('0x0'));var util=require(_0x704c('0x1'));var path=require(_0x704c('0x2'));var timeout=require(_0x704c('0x3'));var express=require(_0x704c('0x4'));var router=express[_0x704c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x704c('0x6'));var controller=require(_0x704c('0x7'));router[_0x704c('0x8')]('/',auth[_0x704c('0x9')](),controller[_0x704c('0xa')]);router[_0x704c('0x8')](_0x704c('0xb'),auth[_0x704c('0x9')](),controller[_0x704c('0xc')]);router[_0x704c('0x8')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller['show']);router[_0x704c('0xe')]('/',auth[_0x704c('0x9')](),controller['create']);router[_0x704c('0xf')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller['update']);router[_0x704c('0x10')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller[_0x704c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index db3dd1c..6defc91 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x16bd94,_0x3792be){var _0x47fac4=function(_0x9ee632){while(--_0x9ee632){_0x16bd94['push'](_0x16bd94['shift']());}};_0x47fac4(++_0x3792be);}(_0x008c,0x188));var _0xc008=function(_0x5257b7,_0x4f42d6){_0x5257b7=_0x5257b7-0x0;var _0x5a8139=_0x008c[_0x5257b7];return _0x5a8139;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0x81bd,0x7c));var _0xd81b=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x81bd[_0x53174f];return _0x1cbd1c;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9f1e35b..d53d75c 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 _0x1ca0=['params','keys','intersection','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1ca0,0xef));var _0x01ca=function(_0x160cd5,_0x19c58e){_0x160cd5=_0x160cd5-0x0;var _0x366763=_0x1ca0[_0x160cd5];return _0x366763;};'use strict';var emlformat=require(_0x01ca('0x0'));var rimraf=require(_0x01ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ca('0x2'));var rp=require('request-promise');var moment=require(_0x01ca('0x3'));var BPromise=require(_0x01ca('0x4'));var Mustache=require(_0x01ca('0x5'));var util=require(_0x01ca('0x6'));var path=require(_0x01ca('0x7'));var sox=require(_0x01ca('0x8'));var csv=require(_0x01ca('0x9'));var ejs=require(_0x01ca('0xa'));var fs=require('fs');var fs_extra=require(_0x01ca('0xb'));var _=require(_0x01ca('0xc'));var squel=require(_0x01ca('0xd'));var crypto=require(_0x01ca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x01ca('0xf'));var toCsv=require(_0x01ca('0x9'));var querystring=require(_0x01ca('0x10'));var Papa=require(_0x01ca('0x11'));var Redis=require(_0x01ca('0x12'));var authService=require(_0x01ca('0x13'));var qs=require(_0x01ca('0x14'));var as=require(_0x01ca('0x15'));var hardwareService=require(_0x01ca('0x16'));var logger=require(_0x01ca('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x01ca('0x18'));var licenseUtil=require(_0x01ca('0x19'));var db=require(_0x01ca('0x1a'))['db'];function respondWithStatusCode(_0x229fde,_0x5654fd){_0x5654fd=_0x5654fd||0xcc;return function(_0x3f238e){if(_0x3f238e){return _0x229fde['sendStatus'](_0x5654fd);}return _0x229fde[_0x01ca('0x1b')](_0x5654fd)[_0x01ca('0x1c')]();};}function respondWithResult(_0x20eecd,_0x3aae93){_0x3aae93=_0x3aae93||0xc8;return function(_0x13a3aa){if(_0x13a3aa){return _0x20eecd[_0x01ca('0x1b')](_0x3aae93)['json'](_0x13a3aa);}};}function respondWithFilteredResult(_0x3eee26,_0x141759){return function(_0x4ebc1f){if(_0x4ebc1f){var _0x145c11=typeof _0x141759['offset']===_0x01ca('0x1d')&&typeof _0x141759[_0x01ca('0x1e')]===_0x01ca('0x1d');var _0x1ae251=_0x4ebc1f[_0x01ca('0x1f')];var _0x29b1e1=_0x145c11?0x0:_0x141759[_0x01ca('0x20')];var _0x22f393=_0x145c11?_0x4ebc1f[_0x01ca('0x1f')]:_0x141759[_0x01ca('0x20')]+_0x141759[_0x01ca('0x1e')];var _0x3ccac0;if(_0x22f393>=_0x1ae251){_0x22f393=_0x1ae251;_0x3ccac0=0xc8;}else{_0x3ccac0=0xce;}_0x3eee26[_0x01ca('0x1b')](_0x3ccac0);return _0x3eee26[_0x01ca('0x21')](_0x01ca('0x22'),_0x29b1e1+'-'+_0x22f393+'/'+_0x1ae251)['json'](_0x4ebc1f);}return null;};}function patchUpdates(_0x2dacba){return function(_0x3d686f){try{jsonpatch[_0x01ca('0x23')](_0x3d686f,_0x2dacba,!![]);}catch(_0x3b5be2){return BPromise[_0x01ca('0x24')](_0x3b5be2);}return _0x3d686f['save']();};}function saveUpdates(_0x226416,_0x5cee4e){return function(_0x459219){if(_0x459219){return _0x459219[_0x01ca('0x25')](_0x226416)[_0x01ca('0x26')](function(_0x1f24d4){return _0x1f24d4;});}return null;};}function removeEntity(_0x4a8818,_0x33fad2){return function(_0x2033b2){if(_0x2033b2){return _0x2033b2[_0x01ca('0x27')]()[_0x01ca('0x26')](function(){_0x4a8818['status'](0xcc)[_0x01ca('0x1c')]();});}};}function handleEntityNotFound(_0xdb3a20,_0x274324){return function(_0x36e751){if(!_0x36e751){_0xdb3a20[_0x01ca('0x28')](0x194);}return _0x36e751;};}function handleError(_0x1a1b0d,_0x40db68){_0x40db68=_0x40db68||0x1f4;return function(_0x55de98){logger[_0x01ca('0x29')](_0x55de98[_0x01ca('0x2a')]);if(_0x55de98[_0x01ca('0x2b')]){delete _0x55de98[_0x01ca('0x2b')];}_0x1a1b0d[_0x01ca('0x1b')](_0x40db68)[_0x01ca('0x2c')](_0x55de98);};}exports['index']=function(_0xec70a6,_0xa85363){var _0x534921={},_0x1c3631={},_0x19fd5a={'count':0x0,'rows':[]};var _0x3b1822=_[_0x01ca('0x2d')](db[_0x01ca('0x2e')][_0x01ca('0x2f')],function(_0x5e4eb7){return{'name':_0x5e4eb7[_0x01ca('0x30')],'type':_0x5e4eb7['type']['key']};});_0x1c3631[_0x01ca('0x31')]=_['map'](_0x3b1822,_0x01ca('0x2b'));_0x1c3631['query']=_['keys'](_0xec70a6[_0x01ca('0x32')]);_0x1c3631[_0x01ca('0x33')]=_['intersection'](_0x1c3631[_0x01ca('0x31')],_0x1c3631[_0x01ca('0x32')]);_0x534921[_0x01ca('0x34')]=_['intersection'](_0x1c3631[_0x01ca('0x31')],qs[_0x01ca('0x35')](_0xec70a6[_0x01ca('0x32')]['fields']));_0x534921[_0x01ca('0x34')]=_0x534921[_0x01ca('0x34')][_0x01ca('0x36')]?_0x534921['attributes']:_0x1c3631[_0x01ca('0x31')];if(!_0xec70a6[_0x01ca('0x32')][_0x01ca('0x37')](_0x01ca('0x38'))){_0x534921[_0x01ca('0x1e')]=qs[_0x01ca('0x1e')](_0xec70a6[_0x01ca('0x32')]['limit']);_0x534921[_0x01ca('0x20')]=qs[_0x01ca('0x20')](_0xec70a6['query']['offset']);}_0x534921['order']=qs[_0x01ca('0x39')](_0xec70a6['query'][_0x01ca('0x39')]);_0x534921[_0x01ca('0x3a')]=qs[_0x01ca('0x33')](_[_0x01ca('0x3b')](_0xec70a6[_0x01ca('0x32')],_0x1c3631[_0x01ca('0x33')]),_0x3b1822);if(_0xec70a6[_0x01ca('0x32')]['filter']){_0x534921['where']=_[_0x01ca('0x3c')](_0x534921[_0x01ca('0x3a')],{'$or':_[_0x01ca('0x2d')](_0x3b1822,function(_0x4d8845){if(_0x4d8845['type']!==_0x01ca('0x3d')){var _0x42ab15={};_0x42ab15[_0x4d8845['name']]={'$like':'%'+_0xec70a6['query'][_0x01ca('0x3e')]+'%'};return _0x42ab15;}})});}_0x534921=_[_0x01ca('0x3c')]({},_0x534921,_0xec70a6['options']);var _0x3aaa31={'where':_0x534921[_0x01ca('0x3a')]};return db[_0x01ca('0x2e')]['count'](_0x3aaa31)[_0x01ca('0x26')](function(_0x5115c3){_0x19fd5a[_0x01ca('0x1f')]=_0x5115c3;if(_0xec70a6['query'][_0x01ca('0x3f')]){_0x534921[_0x01ca('0x40')]=[{'all':!![]}];}return db[_0x01ca('0x2e')][_0x01ca('0x41')](_0x534921);})[_0x01ca('0x26')](function(_0x39b1bb){_0x19fd5a[_0x01ca('0x42')]=_0x39b1bb;return _0x19fd5a;})['then'](respondWithFilteredResult(_0xa85363,_0x534921))[_0x01ca('0x43')](handleError(_0xa85363,null));};exports[_0x01ca('0x44')]=function(_0x3cd3e6,_0x164f58){var _0x5939e3={'raw':!![],'where':{'id':_0x3cd3e6[_0x01ca('0x45')]['id']}},_0x955a3e={};_0x955a3e[_0x01ca('0x31')]=_[_0x01ca('0x46')](db['VoiceDialReport'][_0x01ca('0x2f')]);_0x955a3e['query']=_[_0x01ca('0x46')](_0x3cd3e6[_0x01ca('0x32')]);_0x955a3e[_0x01ca('0x33')]=_[_0x01ca('0x47')](_0x955a3e[_0x01ca('0x31')],_0x955a3e[_0x01ca('0x32')]);_0x5939e3[_0x01ca('0x34')]=_['intersection'](_0x955a3e['model'],qs['fields'](_0x3cd3e6['query'][_0x01ca('0x35')]));_0x5939e3[_0x01ca('0x34')]=_0x5939e3[_0x01ca('0x34')][_0x01ca('0x36')]?_0x5939e3[_0x01ca('0x34')]:_0x955a3e[_0x01ca('0x31')];if(_0x3cd3e6[_0x01ca('0x32')][_0x01ca('0x3f')]){_0x5939e3[_0x01ca('0x40')]=[{'all':!![]}];}_0x5939e3=_['merge']({},_0x5939e3,_0x3cd3e6[_0x01ca('0x48')]);return db[_0x01ca('0x2e')]['find'](_0x5939e3)[_0x01ca('0x26')](handleEntityNotFound(_0x164f58,null))[_0x01ca('0x26')](respondWithResult(_0x164f58,null))[_0x01ca('0x43')](handleError(_0x164f58,null));};exports[_0x01ca('0x49')]=function(_0x33a0cc,_0x9a84a6){return db['VoiceDialReport'][_0x01ca('0x49')](_0x33a0cc[_0x01ca('0x4a')],{})[_0x01ca('0x26')](respondWithResult(_0x9a84a6,0xc9))['catch'](handleError(_0x9a84a6,null));};exports[_0x01ca('0x25')]=function(_0x1a1fc5,_0x3cf9be){if(_0x1a1fc5[_0x01ca('0x4a')]['id']){delete _0x1a1fc5[_0x01ca('0x4a')]['id'];}return db[_0x01ca('0x2e')][_0x01ca('0x4b')]({'where':{'id':_0x1a1fc5[_0x01ca('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cf9be,null))[_0x01ca('0x26')](saveUpdates(_0x1a1fc5[_0x01ca('0x4a')],null))[_0x01ca('0x26')](respondWithResult(_0x3cf9be,null))[_0x01ca('0x43')](handleError(_0x3cf9be,null));};exports['destroy']=function(_0x3a4da2,_0x47b9ae){return db[_0x01ca('0x2e')][_0x01ca('0x4b')]({'where':{'id':_0x3a4da2[_0x01ca('0x45')]['id']}})[_0x01ca('0x26')](handleEntityNotFound(_0x47b9ae,null))[_0x01ca('0x26')](removeEntity(_0x47b9ae,null))['catch'](handleError(_0x47b9ae,null));};exports[_0x01ca('0x4c')]=function(_0x5383d3,_0x91be5d){return db[_0x01ca('0x2e')][_0x01ca('0x4c')]()[_0x01ca('0x26')](respondWithResult(_0x91be5d,null))['catch'](handleError(_0x91be5d,null));}; \ No newline at end of file +var _0xae1d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2eb249,_0x21f1e1){var _0x4204a9=function(_0x3602b9){while(--_0x3602b9){_0x2eb249['push'](_0x2eb249['shift']());}};_0x4204a9(++_0x21f1e1);}(_0xae1d,0x1b3));var _0xdae1=function(_0x1a61c1,_0x2f064d){_0x1a61c1=_0x1a61c1-0x0;var _0x2240bf=_0xae1d[_0x1a61c1];return _0x2240bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdae1('0x0'));var zipdir=require(_0xdae1('0x1'));var jsonpatch=require(_0xdae1('0x2'));var rp=require(_0xdae1('0x3'));var moment=require(_0xdae1('0x4'));var BPromise=require(_0xdae1('0x5'));var Mustache=require(_0xdae1('0x6'));var util=require(_0xdae1('0x7'));var path=require(_0xdae1('0x8'));var sox=require(_0xdae1('0x9'));var csv=require(_0xdae1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdae1('0xb'));var squel=require(_0xdae1('0xc'));var crypto=require(_0xdae1('0xd'));var jsforce=require(_0xdae1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdae1('0xf'));var Papa=require(_0xdae1('0x10'));var Redis=require(_0xdae1('0x11'));var authService=require(_0xdae1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdae1('0x13'));var hardwareService=require(_0xdae1('0x14'));var logger=require(_0xdae1('0x15'))(_0xdae1('0x16'));var utils=require(_0xdae1('0x17'));var config=require(_0xdae1('0x18'));var licenseUtil=require(_0xdae1('0x19'));var db=require(_0xdae1('0x1a'))['db'];function respondWithStatusCode(_0x4941db,_0x31ee54){_0x31ee54=_0x31ee54||0xcc;return function(_0x43cd94){if(_0x43cd94){return _0x4941db['sendStatus'](_0x31ee54);}return _0x4941db[_0xdae1('0x1b')](_0x31ee54)['end']();};}function respondWithResult(_0x123891,_0x280f89){_0x280f89=_0x280f89||0xc8;return function(_0x1117f9){if(_0x1117f9){return _0x123891[_0xdae1('0x1b')](_0x280f89)[_0xdae1('0x1c')](_0x1117f9);}};}function respondWithFilteredResult(_0x21320b,_0x39a6d7){return function(_0x354ed2){if(_0x354ed2){var _0x20b95a=typeof _0x39a6d7[_0xdae1('0x1d')]===_0xdae1('0x1e')&&typeof _0x39a6d7[_0xdae1('0x1f')]===_0xdae1('0x1e');var _0x4cd068=_0x354ed2[_0xdae1('0x20')];var _0x1e387d=_0x20b95a?0x0:_0x39a6d7[_0xdae1('0x1d')];var _0x5bded5=_0x20b95a?_0x354ed2['count']:_0x39a6d7['offset']+_0x39a6d7[_0xdae1('0x1f')];var _0x34b456;if(_0x5bded5>=_0x4cd068){_0x5bded5=_0x4cd068;_0x34b456=0xc8;}else{_0x34b456=0xce;}_0x21320b[_0xdae1('0x1b')](_0x34b456);return _0x21320b[_0xdae1('0x21')](_0xdae1('0x22'),_0x1e387d+'-'+_0x5bded5+'/'+_0x4cd068)[_0xdae1('0x1c')](_0x354ed2);}return null;};}function patchUpdates(_0x118885){return function(_0x2ad236){try{jsonpatch['apply'](_0x2ad236,_0x118885,!![]);}catch(_0x2e90ec){return BPromise[_0xdae1('0x23')](_0x2e90ec);}return _0x2ad236[_0xdae1('0x24')]();};}function saveUpdates(_0x1b5fb6,_0x21692b){return function(_0x2aab95){if(_0x2aab95){return _0x2aab95[_0xdae1('0x25')](_0x1b5fb6)[_0xdae1('0x26')](function(_0x47f9b3){return _0x47f9b3;});}return null;};}function removeEntity(_0x403c1a,_0x4a02ee){return function(_0x39b406){if(_0x39b406){return _0x39b406[_0xdae1('0x27')]()[_0xdae1('0x26')](function(){_0x403c1a[_0xdae1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb59ea,_0x310627){return function(_0xbc3682){if(!_0xbc3682){_0xcb59ea['sendStatus'](0x194);}return _0xbc3682;};}function handleError(_0x4c2ae1,_0x2febc8){_0x2febc8=_0x2febc8||0x1f4;return function(_0x4c0363){logger[_0xdae1('0x28')](_0x4c0363['stack']);if(_0x4c0363[_0xdae1('0x29')]){delete _0x4c0363[_0xdae1('0x29')];}_0x4c2ae1[_0xdae1('0x1b')](_0x2febc8)[_0xdae1('0x2a')](_0x4c0363);};}exports[_0xdae1('0x2b')]=function(_0x44b461,_0x18b8eb){var _0x1c76cd={},_0x481b23={},_0x215e66={'count':0x0,'rows':[]};var _0x1b101b=_[_0xdae1('0x2c')](db[_0xdae1('0x2d')][_0xdae1('0x2e')],function(_0x139333){return{'name':_0x139333['fieldName'],'type':_0x139333['type'][_0xdae1('0x2f')]};});_0x481b23[_0xdae1('0x30')]=_[_0xdae1('0x2c')](_0x1b101b,'name');_0x481b23[_0xdae1('0x31')]=_[_0xdae1('0x32')](_0x44b461[_0xdae1('0x31')]);_0x481b23[_0xdae1('0x33')]=_[_0xdae1('0x34')](_0x481b23['model'],_0x481b23[_0xdae1('0x31')]);_0x1c76cd[_0xdae1('0x35')]=_[_0xdae1('0x34')](_0x481b23[_0xdae1('0x30')],qs[_0xdae1('0x36')](_0x44b461[_0xdae1('0x31')][_0xdae1('0x36')]));_0x1c76cd['attributes']=_0x1c76cd[_0xdae1('0x35')]['length']?_0x1c76cd[_0xdae1('0x35')]:_0x481b23[_0xdae1('0x30')];if(!_0x44b461[_0xdae1('0x31')][_0xdae1('0x37')](_0xdae1('0x38'))){_0x1c76cd[_0xdae1('0x1f')]=qs[_0xdae1('0x1f')](_0x44b461[_0xdae1('0x31')]['limit']);_0x1c76cd[_0xdae1('0x1d')]=qs[_0xdae1('0x1d')](_0x44b461[_0xdae1('0x31')][_0xdae1('0x1d')]);}_0x1c76cd[_0xdae1('0x39')]=qs['sort'](_0x44b461[_0xdae1('0x31')][_0xdae1('0x3a')]);_0x1c76cd[_0xdae1('0x3b')]=qs['filters'](_[_0xdae1('0x3c')](_0x44b461['query'],_0x481b23['filters']),_0x1b101b);if(_0x44b461[_0xdae1('0x31')][_0xdae1('0x3d')]){_0x1c76cd['where']=_[_0xdae1('0x3e')](_0x1c76cd['where'],{'$or':_[_0xdae1('0x2c')](_0x1b101b,function(_0x1318ab){if(_0x1318ab[_0xdae1('0x3f')]!==_0xdae1('0x40')){var _0x543611={};_0x543611[_0x1318ab[_0xdae1('0x29')]]={'$like':'%'+_0x44b461[_0xdae1('0x31')][_0xdae1('0x3d')]+'%'};return _0x543611;}})});}_0x1c76cd=_[_0xdae1('0x3e')]({},_0x1c76cd,_0x44b461[_0xdae1('0x41')]);var _0x13677d={'where':_0x1c76cd[_0xdae1('0x3b')]};return db[_0xdae1('0x2d')][_0xdae1('0x20')](_0x13677d)['then'](function(_0x4ffc74){_0x215e66['count']=_0x4ffc74;if(_0x44b461['query'][_0xdae1('0x42')]){_0x1c76cd[_0xdae1('0x43')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x1c76cd);})['then'](function(_0x1ac14e){_0x215e66[_0xdae1('0x44')]=_0x1ac14e;return _0x215e66;})[_0xdae1('0x26')](respondWithFilteredResult(_0x18b8eb,_0x1c76cd))[_0xdae1('0x45')](handleError(_0x18b8eb,null));};exports[_0xdae1('0x46')]=function(_0x2eec25,_0x4ec435){var _0x25ac78={'raw':!![],'where':{'id':_0x2eec25[_0xdae1('0x47')]['id']}},_0x1af059={};_0x1af059[_0xdae1('0x30')]=_['keys'](db[_0xdae1('0x2d')][_0xdae1('0x2e')]);_0x1af059[_0xdae1('0x31')]=_[_0xdae1('0x32')](_0x2eec25['query']);_0x1af059[_0xdae1('0x33')]=_[_0xdae1('0x34')](_0x1af059[_0xdae1('0x30')],_0x1af059[_0xdae1('0x31')]);_0x25ac78['attributes']=_['intersection'](_0x1af059['model'],qs[_0xdae1('0x36')](_0x2eec25[_0xdae1('0x31')][_0xdae1('0x36')]));_0x25ac78[_0xdae1('0x35')]=_0x25ac78[_0xdae1('0x35')]['length']?_0x25ac78['attributes']:_0x1af059[_0xdae1('0x30')];if(_0x2eec25[_0xdae1('0x31')][_0xdae1('0x42')]){_0x25ac78[_0xdae1('0x43')]=[{'all':!![]}];}_0x25ac78=_[_0xdae1('0x3e')]({},_0x25ac78,_0x2eec25[_0xdae1('0x41')]);return db[_0xdae1('0x2d')]['find'](_0x25ac78)[_0xdae1('0x26')](handleEntityNotFound(_0x4ec435,null))[_0xdae1('0x26')](respondWithResult(_0x4ec435,null))[_0xdae1('0x45')](handleError(_0x4ec435,null));};exports[_0xdae1('0x48')]=function(_0x4024d1,_0x1201ca){return db[_0xdae1('0x2d')][_0xdae1('0x48')](_0x4024d1[_0xdae1('0x49')],{})['then'](respondWithResult(_0x1201ca,0xc9))[_0xdae1('0x45')](handleError(_0x1201ca,null));};exports[_0xdae1('0x25')]=function(_0x520bb7,_0x5e0840){if(_0x520bb7['body']['id']){delete _0x520bb7[_0xdae1('0x49')]['id'];}return db[_0xdae1('0x2d')]['find']({'where':{'id':_0x520bb7['params']['id']}})[_0xdae1('0x26')](handleEntityNotFound(_0x5e0840,null))['then'](saveUpdates(_0x520bb7[_0xdae1('0x49')],null))[_0xdae1('0x26')](respondWithResult(_0x5e0840,null))[_0xdae1('0x45')](handleError(_0x5e0840,null));};exports[_0xdae1('0x27')]=function(_0x130971,_0x4bb2bf){return db[_0xdae1('0x2d')][_0xdae1('0x4a')]({'where':{'id':_0x130971[_0xdae1('0x47')]['id']}})[_0xdae1('0x26')](handleEntityNotFound(_0x4bb2bf,null))['then'](removeEntity(_0x4bb2bf,null))[_0xdae1('0x45')](handleError(_0x4bb2bf,null));};exports[_0xdae1('0x4b')]=function(_0x40f4a7,_0x20f6f3){return db[_0xdae1('0x2d')][_0xdae1('0x4b')]()['then'](respondWithResult(_0x20f6f3,null))[_0xdae1('0x45')](handleError(_0x20f6f3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b1141b0..f3bc53f 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 _0xb40b=['request-promise','path','exports','define','report_dial','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb40b,0x119));var _0xbb40=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xb40b[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xbb40('0x0'));var util=require(_0xbb40('0x1'));var logger=require('../../config/logger')(_0xbb40('0x2'));var moment=require(_0xbb40('0x3'));var BPromise=require(_0xbb40('0x4'));var rp=require(_0xbb40('0x5'));var fs=require('fs');var path=require(_0xbb40('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xbb40('0x7')]=function(_0x40444d,_0x37acda){return _0x40444d[_0xbb40('0x8')]('VoiceDialReport',attributes,{'tableName':_0xbb40('0x9'),'paranoid':![],'indexes':[{'fields':[_0xbb40('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1b3=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x5d2e72,_0x17c283){var _0x51ea73=function(_0x153853){while(--_0x153853){_0x5d2e72['push'](_0x5d2e72['shift']());}};_0x51ea73(++_0x17c283);}(_0xd1b3,0xec));var _0x3d1b=function(_0x11d197,_0x2dd9f1){_0x11d197=_0x11d197-0x0;var _0x20f02b=_0xd1b3[_0x11d197];return _0x20f02b;};'use strict';var _=require(_0x3d1b('0x0'));var util=require(_0x3d1b('0x1'));var logger=require(_0x3d1b('0x2'))(_0x3d1b('0x3'));var moment=require(_0x3d1b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d1b('0x5'));var config=require(_0x3d1b('0x6'));var attributes=require(_0x3d1b('0x7'));module[_0x3d1b('0x8')]=function(_0x1c409e,_0x45bd2b){return _0x1c409e[_0x3d1b('0x9')](_0x3d1b('0xa'),attributes,{'tableName':_0x3d1b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3d1b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 82a86d3..b306c48 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 _0x664b=['then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','create','body','options','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x664b,0x1cb));var _0xb664=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x664b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb664('0x0'));var util=require(_0xb664('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb664('0x2'));var fs=require('fs');var Redis=require(_0xb664('0x3'));var db=require(_0xb664('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb664('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb664('0x6')][_0xb664('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ce82b,_0x17025b,_0x57a332){return new BPromise(function(_0x5cfbfa,_0x4463f1){return client[_0xb664('0x8')](_0x4ce82b,_0x57a332)[_0xb664('0x9')](function(_0x3ec285){logger[_0xb664('0xa')](_0xb664('0xb'),_0x17025b,_0xb664('0xc'));logger[_0xb664('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x17025b,_0xb664('0xc'),JSON[_0xb664('0xe')](_0x3ec285));if(_0x3ec285['error']){if(_0x3ec285[_0xb664('0xf')]['code']===0x1f4){logger[_0xb664('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x17025b,_0x3ec285[_0xb664('0xf')]['message']);return _0x4463f1(_0x3ec285[_0xb664('0xf')][_0xb664('0x10')]);}logger[_0xb664('0xf')](_0xb664('0xb'),_0x17025b,_0x3ec285[_0xb664('0xf')]['message']);return _0x5cfbfa(_0x3ec285[_0xb664('0xf')]['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x17025b,_0xb664('0xc'));_0x5cfbfa(_0x3ec285[_0xb664('0x11')][_0xb664('0x10')]);}})[_0xb664('0x12')](function(_0x561bf3){logger[_0xb664('0xf')](_0xb664('0xb'),_0x17025b,_0x561bf3);_0x4463f1(_0x561bf3);});});}exports['CreateVoiceDialReport']=function(_0x115942){var _0x52532a=this;return new Promise(function(_0x3f7761,_0x407af4){return db['VoiceDialReport'][_0xb664('0x13')](_0x115942[_0xb664('0x14')],{'raw':_0x115942[_0xb664('0x15')]?_0x115942[_0xb664('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xb664('0x9')](function(_0x4609a8){logger[_0xb664('0xa')]('CreateVoiceDialReport',_0x115942);logger[_0xb664('0xd')](_0xb664('0x16'),_0x115942,JSON['stringify'](_0x4609a8));_0x3f7761(_0x4609a8);})[_0xb664('0x12')](function(_0x4822a3){logger[_0xb664('0xf')](_0xb664('0x16'),_0x4822a3['message'],_0x115942);_0x407af4(_0x52532a['error'](0x1f4,_0x4822a3[_0xb664('0x10')]));});});};exports[_0xb664('0x17')]=function(_0x4fb8ec){var _0x46f3b5=this;return new Promise(function(_0x2639d8,_0x81f3e8){return db[_0xb664('0x18')]['update'](_0x4fb8ec[_0xb664('0x14')],{'raw':_0x4fb8ec[_0xb664('0x15')]?_0x4fb8ec['options'][_0xb664('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fb8ec[_0xb664('0x15')]?_0x4fb8ec[_0xb664('0x15')]['where']||null:null,'attributes':_0x4fb8ec[_0xb664('0x15')]?_0x4fb8ec['options']['attributes']||null:null,'limit':_0x4fb8ec[_0xb664('0x15')]?_0x4fb8ec[_0xb664('0x15')]['limit']||null:null})[_0xb664('0x9')](function(_0x45c5e2){logger['info']('UpdateVoiceDialReport',_0x4fb8ec);logger[_0xb664('0xd')](_0xb664('0x17'),_0x4fb8ec,JSON[_0xb664('0xe')](_0x45c5e2));_0x2639d8(_0x45c5e2);})[_0xb664('0x12')](function(_0xbaac19){logger['error'](_0xb664('0x17'),_0xbaac19[_0xb664('0x10')],_0x4fb8ec);_0x81f3e8(_0x46f3b5['error'](0x1f4,_0xbaac19['message']));});});}; \ No newline at end of file +var _0xebc3=['attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','stringify','catch','UpdateVoiceDialReport','update','raw','where'];(function(_0x20cfff,_0x5865f1){var _0x4d64b1=function(_0x3770d4){while(--_0x3770d4){_0x20cfff['push'](_0x20cfff['shift']());}};_0x4d64b1(++_0x5865f1);}(_0xebc3,0x12a));var _0x3ebc=function(_0x526f40,_0x1593a1){_0x526f40=_0x526f40-0x0;var _0x2475bc=_0xebc3[_0x526f40];return _0x2475bc;};'use strict';var _=require('lodash');var util=require(_0x3ebc('0x0'));var moment=require(_0x3ebc('0x1'));var BPromise=require(_0x3ebc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ebc('0x3'));var db=require(_0x3ebc('0x4'))['db'];var utils=require(_0x3ebc('0x5'));var logger=require(_0x3ebc('0x6'))(_0x3ebc('0x7'));var config=require(_0x3ebc('0x8'));var jayson=require(_0x3ebc('0x9'));var client=jayson['client'][_0x3ebc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9b06,_0x33eb25,_0x4a78a4){return new BPromise(function(_0x1cadb5,_0x115018){return client[_0x3ebc('0xb')](_0x4e9b06,_0x4a78a4)[_0x3ebc('0xc')](function(_0x5a582b){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x33eb25,_0x3ebc('0xd'));logger[_0x3ebc('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x33eb25,_0x3ebc('0xd'),JSON['stringify'](_0x5a582b));if(_0x5a582b[_0x3ebc('0xf')]){if(_0x5a582b['error'][_0x3ebc('0x10')]===0x1f4){logger['error'](_0x3ebc('0x11'),_0x33eb25,_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);return _0x115018(_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);}logger[_0x3ebc('0xf')](_0x3ebc('0x11'),_0x33eb25,_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);return _0x1cadb5(_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);}else{logger[_0x3ebc('0x13')](_0x3ebc('0x11'),_0x33eb25,_0x3ebc('0xd'));_0x1cadb5(_0x5a582b[_0x3ebc('0x14')][_0x3ebc('0x12')]);}})['catch'](function(_0x1a61a1){logger[_0x3ebc('0xf')](_0x3ebc('0x11'),_0x33eb25,_0x1a61a1);_0x115018(_0x1a61a1);});});}exports[_0x3ebc('0x15')]=function(_0x4e3833){var _0x252fbb=this;return new Promise(function(_0x11815d,_0xc1686e){return db[_0x3ebc('0x16')][_0x3ebc('0x17')](_0x4e3833[_0x3ebc('0x18')],{'raw':_0x4e3833[_0x3ebc('0x19')]?_0x4e3833[_0x3ebc('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3ebc('0xc')](function(_0x55ee85){logger[_0x3ebc('0x13')]('CreateVoiceDialReport',_0x4e3833);logger[_0x3ebc('0xe')](_0x3ebc('0x15'),_0x4e3833,JSON[_0x3ebc('0x1a')](_0x55ee85));_0x11815d(_0x55ee85);})[_0x3ebc('0x1b')](function(_0x61c606){logger[_0x3ebc('0xf')](_0x3ebc('0x15'),_0x61c606[_0x3ebc('0x12')],_0x4e3833);_0xc1686e(_0x252fbb[_0x3ebc('0xf')](0x1f4,_0x61c606[_0x3ebc('0x12')]));});});};exports[_0x3ebc('0x1c')]=function(_0x309c82){var _0x1e9198=this;return new Promise(function(_0x2e58c6,_0x1f6ee7){return db[_0x3ebc('0x16')][_0x3ebc('0x1d')](_0x309c82[_0x3ebc('0x18')],{'raw':_0x309c82[_0x3ebc('0x19')]?_0x309c82['options'][_0x3ebc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309c82[_0x3ebc('0x19')]?_0x309c82['options'][_0x3ebc('0x1f')]||null:null,'attributes':_0x309c82[_0x3ebc('0x19')]?_0x309c82[_0x3ebc('0x19')][_0x3ebc('0x20')]||null:null,'limit':_0x309c82[_0x3ebc('0x19')]?_0x309c82[_0x3ebc('0x19')]['limit']||null:null})[_0x3ebc('0xc')](function(_0x59108a){logger[_0x3ebc('0x13')](_0x3ebc('0x1c'),_0x309c82);logger['debug'](_0x3ebc('0x1c'),_0x309c82,JSON[_0x3ebc('0x1a')](_0x59108a));_0x2e58c6(_0x59108a);})[_0x3ebc('0x1b')](function(_0x47d0e2){logger[_0x3ebc('0xf')](_0x3ebc('0x1c'),_0x47d0e2[_0x3ebc('0x12')],_0x309c82);_0x1f6ee7(_0x1e9198[_0x3ebc('0xf')](0x1f4,_0x47d0e2[_0x3ebc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 50fe797..9127ad4 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 _0x65ff=['../../config/environment','get','index','/:id','post','/:id/applications','isAuthenticated','addApplications','update','exports','multer','path','express','fs-extra'];(function(_0x422344,_0x276567){var _0x20efc8=function(_0x275ce9){while(--_0x275ce9){_0x422344['push'](_0x422344['shift']());}};_0x20efc8(++_0x276567);}(_0x65ff,0xa4));var _0xf65f=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x65ff[_0x13e300];return _0x5a3eea;};'use strict';var multer=require(_0xf65f('0x0'));var util=require('util');var path=require(_0xf65f('0x1'));var timeout=require('connect-timeout');var express=require(_0xf65f('0x2'));var router=express['Router']();var fs_extra=require(_0xf65f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf65f('0x4'));var controller=require('./voiceExtension.controller');router[_0xf65f('0x5')]('/',auth['isAuthenticated'](),controller[_0xf65f('0x6')]);router[_0xf65f('0x5')](_0xf65f('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xf65f('0x8')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf65f('0x9'),auth[_0xf65f('0xa')](),controller[_0xf65f('0xb')]);router['put'](_0xf65f('0x7'),auth['isAuthenticated'](),controller[_0xf65f('0xc')]);router['delete'](_0xf65f('0x7'),auth[_0xf65f('0xa')](),controller['destroy']);module[_0xf65f('0xd')]=router; \ No newline at end of file +var _0x3892=['addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','create','post','/:id/applications'];(function(_0xe6702b,_0x2c8440){var _0x742bf3=function(_0x2b5017){while(--_0x2b5017){_0xe6702b['push'](_0xe6702b['shift']());}};_0x742bf3(++_0x2c8440);}(_0x3892,0x16b));var _0x2389=function(_0x262241,_0x2357d){_0x262241=_0x262241-0x0;var _0x410fe2=_0x3892[_0x262241];return _0x410fe2;};'use strict';var multer=require(_0x2389('0x0'));var util=require(_0x2389('0x1'));var path=require(_0x2389('0x2'));var timeout=require('connect-timeout');var express=require(_0x2389('0x3'));var router=express[_0x2389('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2389('0x5'));var config=require('../../config/environment');var controller=require(_0x2389('0x6'));router['get']('/',auth[_0x2389('0x7')](),controller[_0x2389('0x8')]);router[_0x2389('0x9')](_0x2389('0xa'),auth[_0x2389('0x7')](),controller[_0x2389('0xb')]);router['post']('/',auth[_0x2389('0x7')](),controller[_0x2389('0xc')]);router[_0x2389('0xd')](_0x2389('0xe'),auth[_0x2389('0x7')](),controller[_0x2389('0xf')]);router[_0x2389('0x10')]('/:id',auth[_0x2389('0x7')](),controller[_0x2389('0x11')]);router[_0x2389('0x12')]('/:id',auth[_0x2389('0x7')](),controller[_0x2389('0x13')]);module[_0x2389('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ae345c0..93b7e96 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 _0xaf7a=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','wav','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x2fa91e,_0xc3e2a4){var _0x3adf48=function(_0x2ad336){while(--_0x2ad336){_0x2fa91e['push'](_0x2fa91e['shift']());}};_0x3adf48(++_0xc3e2a4);}(_0xaf7a,0x90));var _0xaaf7=function(_0x3f9371,_0x29f90c){_0x3f9371=_0x3f9371-0x0;var _0x46c616=_0xaf7a[_0x3f9371];return _0x46c616;};'use strict';var Sequelize=require(_0xaaf7('0x0'));module[_0xaaf7('0x1')]={'context':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':![],'unique':_0xaaf7('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':![],'unique':_0xaaf7('0x3')},'priority':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xaaf7('0x3')},'tag':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':![],'defaultValue':_0xaaf7('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xaaf7('0x5')]('inbound','outbound',_0xaaf7('0x6'),_0xaaf7('0x7'),_0xaaf7('0x8'),_0xaaf7('0x9'),_0xaaf7('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xaaf7('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaaf7('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xaaf7('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xaaf7('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xaaf7('0x2')],'defaultValue':_0xaaf7('0xd')},'answer':{'type':Sequelize[_0xaaf7('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc02f67){return this['getDataValue'](_0xaaf7('0xe'));}},'alias':{'type':Sequelize[_0xaaf7('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x95bf=['getDataValue','exports','STRING','compositeIndex','NoOp','outbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x499292,_0x10aa11){var _0x3fae20=function(_0x3f15bb){while(--_0x3f15bb){_0x499292['push'](_0x499292['shift']());}};_0x3fae20(++_0x10aa11);}(_0x95bf,0x17a));var _0xf95b=function(_0x8b9bbf,_0x1e0a20){_0x8b9bbf=_0x8b9bbf-0x0;var _0x129170=_0x95bf[_0x8b9bbf];return _0x129170;};'use strict';var Sequelize=require('sequelize');module[_0xf95b('0x0')]={'context':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'unique':_0xf95b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf95b('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'defaultValue':_0xf95b('0x3')},'appdata':{'type':Sequelize[_0xf95b('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xf95b('0x4'),'internal',_0xf95b('0x5'),'outbound-fax',_0xf95b('0x6'),_0xf95b('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xf95b('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf95b('0x8')},'IntervalId':{'type':Sequelize[_0xf95b('0x9')]},'isApp':{'type':Sequelize[_0xf95b('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf95b('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf95b('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xf95b('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf95b('0x9')]},'recordingFormat':{'type':Sequelize[_0xf95b('0x1')],'defaultValue':_0xf95b('0xb')},'answer':{'type':Sequelize[_0xf95b('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d58f5){return this[_0xf95b('0xc')]('exten');}},'alias':{'type':Sequelize[_0xf95b('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index b9af6db..3b24231 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 _0x3764=['update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','sendStatus','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','limit','count','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','type','name','UserProfileResource','destroy','stack','send','index','VoiceExtension','rawAttributes','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','intersection','catch','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','find','error'];(function(_0x1b3143,_0x4698c9){var _0x19f078=function(_0x2c7ad0){while(--_0x2c7ad0){_0x1b3143['push'](_0x1b3143['shift']());}};_0x19f078(++_0x4698c9);}(_0x3764,0x11c));var _0x4376=function(_0x2b3607,_0x2e43b9){_0x2b3607=_0x2b3607-0x0;var _0x1be9c5=_0x3764[_0x2b3607];return _0x1be9c5;};'use strict';var _=require(_0x4376('0x0'));var Redis=require(_0x4376('0x1'));var qs=require(_0x4376('0x2'));var logger=require(_0x4376('0x3'))('api');var config=require(_0x4376('0x4'));var db=require(_0x4376('0x5'))['db'];config[_0x4376('0x6')]=_[_0x4376('0x7')](config[_0x4376('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x4376('0x8'))(new Redis(config[_0x4376('0x6')]));require(_0x4376('0x9'))[_0x4376('0xa')](socket);function respondWithStatusCode(_0x3996e6,_0x4a1d0b){_0x4a1d0b=_0x4a1d0b||0xcc;return function(_0x5a0c90){if(_0x5a0c90){return _0x3996e6['sendStatus'](_0x4a1d0b);}return _0x3996e6[_0x4376('0xb')](_0x4a1d0b)[_0x4376('0xc')]();};}function respondWithResult(_0x5eac82,_0x1004b0){_0x1004b0=_0x1004b0||0xc8;return function(_0x16f1ff){if(_0x16f1ff){return _0x5eac82[_0x4376('0xb')](_0x1004b0)[_0x4376('0xd')](_0x16f1ff);}};}function respondWithFilteredResult(_0x32f6ec,_0x32f361){return function(_0x2362a1){if(_0x2362a1){var _0x2db8fc=typeof _0x32f361[_0x4376('0xe')]==='undefined'&&typeof _0x32f361[_0x4376('0xf')]==='undefined';var _0x1ab223=_0x2362a1[_0x4376('0x10')];var _0x2fbe76=_0x2db8fc?0x0:_0x32f361[_0x4376('0xe')];var _0x13667a=_0x2db8fc?_0x2362a1[_0x4376('0x10')]:_0x32f361[_0x4376('0xe')]+_0x32f361[_0x4376('0xf')];var _0x1d5de3;if(_0x13667a>=_0x1ab223){_0x13667a=_0x1ab223;_0x1d5de3=0xc8;}else{_0x1d5de3=0xce;}_0x32f6ec[_0x4376('0xb')](_0x1d5de3);return _0x32f6ec['set'](_0x4376('0x11'),_0x2fbe76+'-'+_0x13667a+'/'+_0x1ab223)[_0x4376('0xd')](_0x2362a1);}return null;};}function removeEntity(_0x57612d){return function(_0x1a203c){if(_0x1a203c){return _0x1a203c['destroy']()[_0x4376('0x12')](function(){var _0x3d2896=_0x1a203c[_0x4376('0x13')]({'plain':!![]});var _0xb0bcda=[{'name':_0x4376('0x14'),'value':_0x4376('0x15'),'ignore':![]},{'name':_0x4376('0x16'),'value':_0x4376('0x17'),'ignore':![]},{'name':_0x4376('0x18'),'value':'internal','ignore':![]}];var _0xb13523=_(_0xb0bcda)[_0x4376('0x19')](_0x4376('0x1a'))[_0x4376('0x1b')](_0x4376('0x1c'))[_0x4376('0x1c')]();if(_['includes'](_0xb13523,_0x3d2896[_0x4376('0x1d')])){return;}var _0x15a00d=_['find'](_0xb0bcda,[_0x4376('0x1c'),_0x3d2896[_0x4376('0x1d')]])[_0x4376('0x1e')];return db[_0x4376('0x1f')][_0x4376('0x20')]({'where':{'type':_0x15a00d,'resourceId':_0x3d2896['id']}})[_0x4376('0x12')](function(){return _0x1a203c;});})[_0x4376('0x12')](function(){_0x57612d[_0x4376('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281bd6){return function(_0x145a5a){if(!_0x145a5a){_0x281bd6['sendStatus'](0x194);}return _0x145a5a;};}function handleError(_0x2f3133,_0x1edb65){_0x1edb65=_0x1edb65||0x1f4;return function(_0x349390){logger['error'](_0x349390[_0x4376('0x21')]);if(_0x349390[_0x4376('0x1e')]){delete _0x349390[_0x4376('0x1e')];}_0x2f3133[_0x4376('0xb')](_0x1edb65)[_0x4376('0x22')](_0x349390);};}exports[_0x4376('0x23')]=function(_0x187205,_0x36e806){var _0x1a9d25={},_0x174b08={},_0x4ed22b={'count':0x0,'rows':[]};var _0x15d7cb=_[_0x4376('0x1b')](db[_0x4376('0x24')][_0x4376('0x25')],function(_0x674832){return{'name':_0x674832['fieldName'],'type':_0x674832['type']['key']};});_0x174b08[_0x4376('0x26')]=_[_0x4376('0x1b')](_0x15d7cb,'name');_0x174b08[_0x4376('0x27')]=_['keys'](_0x187205['query']);_0x174b08[_0x4376('0x28')]=_['intersection'](_0x174b08[_0x4376('0x26')],_0x174b08['query']);_0x1a9d25[_0x4376('0x29')]=_['intersection'](_0x174b08[_0x4376('0x26')],qs[_0x4376('0x2a')](_0x187205[_0x4376('0x27')][_0x4376('0x2a')]));_0x1a9d25[_0x4376('0x29')]=_0x1a9d25[_0x4376('0x29')][_0x4376('0x2b')]?_0x1a9d25[_0x4376('0x29')]:_0x174b08[_0x4376('0x26')];if(!_0x187205['query'][_0x4376('0x2c')](_0x4376('0x2d'))){_0x1a9d25[_0x4376('0xf')]=qs[_0x4376('0xf')](_0x187205[_0x4376('0x27')][_0x4376('0xf')]);_0x1a9d25[_0x4376('0xe')]=qs['offset'](_0x187205[_0x4376('0x27')][_0x4376('0xe')]);}_0x1a9d25[_0x4376('0x2e')]=qs['sort'](_0x187205[_0x4376('0x27')][_0x4376('0x2f')]);_0x1a9d25[_0x4376('0x30')]=qs[_0x4376('0x28')](_[_0x4376('0x31')](_0x187205['query'],_0x174b08[_0x4376('0x28')]),_0x15d7cb);if(_0x187205['query'][_0x4376('0x19')]){_0x1a9d25['where']=_[_0x4376('0x32')](_0x1a9d25['where'],{'$or':_['map'](_0x15d7cb,function(_0x5a0ad8){if(_0x5a0ad8[_0x4376('0x1d')]!==_0x4376('0x33')){var _0x547208={};_0x547208[_0x5a0ad8[_0x4376('0x1e')]]={'$like':'%'+_0x187205[_0x4376('0x27')][_0x4376('0x19')]+'%'};return _0x547208;}})});}_0x1a9d25=_[_0x4376('0x32')]({},_0x1a9d25,_0x187205[_0x4376('0x34')]);var _0x57dc32={'where':_0x1a9d25[_0x4376('0x30')]};return db['VoiceExtension'][_0x4376('0x10')](_0x57dc32)[_0x4376('0x12')](function(_0xcf63a9){_0x4ed22b[_0x4376('0x10')]=_0xcf63a9;if(_0x187205[_0x4376('0x27')][_0x4376('0x35')]){_0x1a9d25[_0x4376('0x36')]=[{'all':!![]}];}return db[_0x4376('0x24')][_0x4376('0x37')](_0x1a9d25);})[_0x4376('0x12')](function(_0x11cc67){_0x4ed22b[_0x4376('0x38')]=_0x11cc67;return _0x4ed22b;})['then'](respondWithFilteredResult(_0x36e806,_0x1a9d25))['catch'](handleError(_0x36e806,null));};exports['show']=function(_0x376f06,_0xab8db){var _0x8ba0d9={'raw':![],'where':{'id':_0x376f06[_0x4376('0x39')]['id']}},_0x4c1180={};_0x4c1180[_0x4376('0x26')]=_[_0x4376('0x3a')](db['VoiceExtension'][_0x4376('0x25')]);_0x4c1180[_0x4376('0x27')]=_[_0x4376('0x3a')](_0x376f06[_0x4376('0x27')]);_0x4c1180[_0x4376('0x28')]=_[_0x4376('0x3b')](_0x4c1180[_0x4376('0x26')],_0x4c1180['query']);_0x8ba0d9['attributes']=_[_0x4376('0x3b')](_0x4c1180[_0x4376('0x26')],qs[_0x4376('0x2a')](_0x376f06[_0x4376('0x27')]['fields']));_0x8ba0d9[_0x4376('0x29')]=_0x8ba0d9[_0x4376('0x29')][_0x4376('0x2b')]?_0x8ba0d9[_0x4376('0x29')]:_0x4c1180[_0x4376('0x26')];if(_0x376f06[_0x4376('0x27')][_0x4376('0x35')]){_0x8ba0d9[_0x4376('0x36')]=[{'all':!![]}];}_0x8ba0d9=_[_0x4376('0x32')]({},_0x8ba0d9,_0x376f06[_0x4376('0x34')]);return db[_0x4376('0x24')]['find'](_0x8ba0d9)['then'](handleEntityNotFound(_0xab8db,null))[_0x4376('0x12')](respondWithResult(_0xab8db,null))[_0x4376('0x3c')](handleError(_0xab8db,null));};exports[_0x4376('0x20')]=function(_0x197624,_0x453771){return db['VoiceExtension']['find']({'where':{'id':_0x197624[_0x4376('0x39')]['id']}})[_0x4376('0x12')](handleEntityNotFound(_0x453771,null))[_0x4376('0x12')](removeEntity(_0x453771,null))['catch'](handleError(_0x453771,null));};exports[_0x4376('0x3d')]=function(_0x47a8f0,_0x4e96e7){if(_0x47a8f0[_0x4376('0x3e')][_0x4376('0x1d')]===_0x4376('0x17')&&!_[_0x4376('0x3f')](_0x47a8f0[_0x4376('0x3e')][_0x4376('0x40')],'_')){_0x47a8f0['body'][_0x4376('0x40')]='_'[_0x4376('0x41')](_0x47a8f0[_0x4376('0x3e')][_0x4376('0x40')]);}return db[_0x4376('0x24')][_0x4376('0x3d')](_0x47a8f0[_0x4376('0x3e')],{'raw':![]})[_0x4376('0x12')](function(_0x54db51){var _0x144570=_0x47a8f0['user']['get']({'plain':!![]});if(!_0x144570)throw new Error(_0x4376('0x42'));if(_0x144570[_0x4376('0x43')]===_0x4376('0x44')){var _0x1875c8=_0x54db51[_0x4376('0x13')]({'plain':!![]});var _0x53f88c=[{'name':_0x4376('0x14'),'value':_0x4376('0x15')},{'name':_0x4376('0x16'),'value':_0x4376('0x17')},{'name':_0x4376('0x18'),'value':_0x4376('0x45')}];var _0x34157b=_[_0x4376('0x46')](_0x53f88c,[_0x4376('0x1c'),_0x1875c8[_0x4376('0x1d')]])[_0x4376('0x1e')];return db['UserProfileSection'][_0x4376('0x46')]({'where':{'name':_0x34157b,'userProfileId':_0x144570['userProfileId']},'raw':!![]})['then'](function(_0xbb76e5){if(_0xbb76e5&&_0xbb76e5['autoAssociation']===0x0){return db['UserProfileResource'][_0x4376('0x3d')]({'name':_0x1875c8[_0x4376('0x1e')],'resourceId':_0x1875c8['id'],'type':_0xbb76e5[_0x4376('0x1e')],'sectionId':_0xbb76e5['id']},{})[_0x4376('0x12')](function(){return _0x54db51;});}else{return _0x54db51;}})[_0x4376('0x3c')](function(_0x50bf90){logger[_0x4376('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50bf90);throw _0x50bf90;});}return _0x54db51;})[_0x4376('0x12')](respondWithResult(_0x4e96e7,0xc9))[_0x4376('0x3c')](handleError(_0x4e96e7,null));};exports[_0x4376('0x48')]=function(_0x43a6ad,_0x875edb){if(_0x43a6ad[_0x4376('0x3e')]['id']){delete _0x43a6ad[_0x4376('0x3e')]['id'];}return db[_0x4376('0x24')][_0x4376('0x46')]({'where':{'id':_0x43a6ad['params']['id']}})[_0x4376('0x12')](handleEntityNotFound(_0x875edb,null))[_0x4376('0x12')](function(_0x21f2bc){if(_0x21f2bc){return db[_0x4376('0x24')][_0x4376('0x48')](_[_0x4376('0x31')](_0x43a6ad[_0x4376('0x3e')],['exten',_0x4376('0x49'),_0x4376('0x4a'),_0x4376('0x4b'),_0x4376('0x4c'),_0x4376('0x4d'),_0x4376('0x4e')]),{'where':{'context':_0x21f2bc[_0x4376('0x49')],'exten':_0x21f2bc[_0x4376('0x40')]},'individualHooks':!![]})[_0x4376('0x12')](function(_0x293aa6){return _0x293aa6;});}return null;})[_0x4376('0x12')](respondWithStatusCode(_0x875edb,null))[_0x4376('0x3c')](handleError(_0x875edb,null));};exports['addApplications']=function(_0x45c736,_0x379fba){var _0x12f4bc=_0x45c736[_0x4376('0x39')]['id'];var _0x532350=_0x45c736[_0x4376('0x3e')];var _0x29d6d2=0xc8;var _0x20d244=null;return db[_0x4376('0x4f')][_0x4376('0x50')]({'isolationLevel':db[_0x4376('0x4f')]['Transaction'][_0x4376('0x51')]['READ_COMMITTED']},function(_0x3245bf){return db['VoiceExtension'][_0x4376('0x52')]({'where':{'id':_0x12f4bc},'transaction':_0x3245bf})[_0x4376('0x12')](function(_0xa456c5){if(_0xa456c5){return db[_0x4376('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x12f4bc},'transaction':_0x3245bf})['then'](function(){var _0x5890d2=_[_0x4376('0x1b')](_0x532350,function(_0x2fe7dc){_0x2fe7dc[_0x4376('0x53')]=_0x12f4bc;_0x2fe7dc['isApp']=!![];return _0x2fe7dc;});return _0xa456c5['createRouting'](_0x5890d2);})[_0x4376('0x12')](function(_0x422600){return db[_0x4376('0x24')][_0x4376('0x54')](_0x422600,{'transaction':_0x3245bf});});}else{_0x29d6d2=0x194;_0x20d244=[];}});})[_0x4376('0x12')](function(){if(_0x29d6d2!==0x194){return db[_0x4376('0x24')][_0x4376('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x12f4bc},'order':_0x4376('0x56')})[_0x4376('0x12')](function(_0x5ba6e6){_0x20d244=_0x5ba6e6;});}})[_0x4376('0x3c')](function(_0x385096){_0x29d6d2=0x1f4;logger['error'](_0x385096['stack']);if(_0x385096[_0x4376('0x1e')]){delete _0x385096[_0x4376('0x1e')];}_0x20d244=_0x385096;})[_0x4376('0x57')](function(){if(_0x20d244===null){_0x379fba[_0x4376('0x58')](_0x29d6d2);}else{if(_0x29d6d2===0x1f4){_0x379fba[_0x4376('0xb')](_0x29d6d2)[_0x4376('0x22')](_0x20d244);}else{_0x379fba['status'](_0x29d6d2)[_0x4376('0xd')](_0x20d244);}}});}; \ No newline at end of file +var _0x862e=['value','includes','type','find','name','UserProfileResource','stack','send','index','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','VoiceExtension','includeAll','findAll','then','show','params','include','options','catch','body','outbound','exten','concat','create','user','role','inbound','internal','UserProfileSection','error','update','context','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','InboundRoutes','OutboundRoutes','InternalRoutes','filter','map'];(function(_0x387050,_0x4b754c){var _0x13765b=function(_0x3e119d){while(--_0x3e119d){_0x387050['push'](_0x387050['shift']());}};_0x13765b(++_0x4b754c);}(_0x862e,0x19e));var _0xe862=function(_0x16e30c,_0x5f5d17){_0x16e30c=_0x16e30c-0x0;var _0x244709=_0x862e[_0x16e30c];return _0x244709;};'use strict';var _=require('lodash');var Redis=require(_0xe862('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe862('0x1'))(_0xe862('0x2'));var config=require(_0xe862('0x3'));var db=require(_0xe862('0x4'))['db'];config[_0xe862('0x5')]=_['defaults'](config[_0xe862('0x5')],{'host':_0xe862('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe862('0x5')]));require(_0xe862('0x7'))[_0xe862('0x8')](socket);function respondWithStatusCode(_0x3027a4,_0x57a86d){_0x57a86d=_0x57a86d||0xcc;return function(_0x328f6a){if(_0x328f6a){return _0x3027a4[_0xe862('0x9')](_0x57a86d);}return _0x3027a4[_0xe862('0xa')](_0x57a86d)[_0xe862('0xb')]();};}function respondWithResult(_0xfebb6e,_0x4d6fdd){_0x4d6fdd=_0x4d6fdd||0xc8;return function(_0x5e0156){if(_0x5e0156){return _0xfebb6e['status'](_0x4d6fdd)[_0xe862('0xc')](_0x5e0156);}};}function respondWithFilteredResult(_0x51d2da,_0x3cd522){return function(_0x385399){if(_0x385399){var _0x5a1423=typeof _0x3cd522[_0xe862('0xd')]===_0xe862('0xe')&&typeof _0x3cd522[_0xe862('0xf')]===_0xe862('0xe');var _0x1924a5=_0x385399[_0xe862('0x10')];var _0xe3c143=_0x5a1423?0x0:_0x3cd522[_0xe862('0xd')];var _0x1e61b0=_0x5a1423?_0x385399[_0xe862('0x10')]:_0x3cd522[_0xe862('0xd')]+_0x3cd522[_0xe862('0xf')];var _0x86968f;if(_0x1e61b0>=_0x1924a5){_0x1e61b0=_0x1924a5;_0x86968f=0xc8;}else{_0x86968f=0xce;}_0x51d2da['status'](_0x86968f);return _0x51d2da[_0xe862('0x11')](_0xe862('0x12'),_0xe3c143+'-'+_0x1e61b0+'/'+_0x1924a5)[_0xe862('0xc')](_0x385399);}return null;};}function removeEntity(_0x90bbee){return function(_0x385b40){if(_0x385b40){return _0x385b40[_0xe862('0x13')]()['then'](function(){var _0x278303=_0x385b40[_0xe862('0x14')]({'plain':!![]});var _0x48d113=[{'name':_0xe862('0x15'),'value':'inbound','ignore':![]},{'name':_0xe862('0x16'),'value':'outbound','ignore':![]},{'name':_0xe862('0x17'),'value':'internal','ignore':![]}];var _0x49c5b4=_(_0x48d113)[_0xe862('0x18')]('ignore')[_0xe862('0x19')](_0xe862('0x1a'))[_0xe862('0x1a')]();if(_[_0xe862('0x1b')](_0x49c5b4,_0x278303[_0xe862('0x1c')])){return;}var _0x21c24c=_[_0xe862('0x1d')](_0x48d113,[_0xe862('0x1a'),_0x278303[_0xe862('0x1c')]])[_0xe862('0x1e')];return db[_0xe862('0x1f')][_0xe862('0x13')]({'where':{'type':_0x21c24c,'resourceId':_0x278303['id']}})['then'](function(){return _0x385b40;});})['then'](function(){_0x90bbee[_0xe862('0xa')](0xcc)[_0xe862('0xb')]();});}};}function handleEntityNotFound(_0x90cb9e){return function(_0x39ba4d){if(!_0x39ba4d){_0x90cb9e[_0xe862('0x9')](0x194);}return _0x39ba4d;};}function handleError(_0x24c794,_0x5a077a){_0x5a077a=_0x5a077a||0x1f4;return function(_0xcecb43){logger['error'](_0xcecb43[_0xe862('0x20')]);if(_0xcecb43['name']){delete _0xcecb43[_0xe862('0x1e')];}_0x24c794['status'](_0x5a077a)[_0xe862('0x21')](_0xcecb43);};}exports[_0xe862('0x22')]=function(_0x1ff6ed,_0x34d9fb){var _0x3a3b70={},_0xffceea={},_0x3f7a72={'count':0x0,'rows':[]};var _0x3246f0=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x568ad6){return{'name':_0x568ad6[_0xe862('0x23')],'type':_0x568ad6[_0xe862('0x1c')]['key']};});_0xffceea[_0xe862('0x24')]=_[_0xe862('0x19')](_0x3246f0,_0xe862('0x1e'));_0xffceea[_0xe862('0x25')]=_[_0xe862('0x26')](_0x1ff6ed[_0xe862('0x25')]);_0xffceea[_0xe862('0x27')]=_[_0xe862('0x28')](_0xffceea[_0xe862('0x24')],_0xffceea[_0xe862('0x25')]);_0x3a3b70[_0xe862('0x29')]=_['intersection'](_0xffceea[_0xe862('0x24')],qs[_0xe862('0x2a')](_0x1ff6ed['query']['fields']));_0x3a3b70[_0xe862('0x29')]=_0x3a3b70[_0xe862('0x29')][_0xe862('0x2b')]?_0x3a3b70[_0xe862('0x29')]:_0xffceea['model'];if(!_0x1ff6ed[_0xe862('0x25')][_0xe862('0x2c')](_0xe862('0x2d'))){_0x3a3b70[_0xe862('0xf')]=qs[_0xe862('0xf')](_0x1ff6ed['query'][_0xe862('0xf')]);_0x3a3b70[_0xe862('0xd')]=qs[_0xe862('0xd')](_0x1ff6ed['query'][_0xe862('0xd')]);}_0x3a3b70[_0xe862('0x2e')]=qs[_0xe862('0x2f')](_0x1ff6ed[_0xe862('0x25')][_0xe862('0x2f')]);_0x3a3b70[_0xe862('0x30')]=qs[_0xe862('0x27')](_['pick'](_0x1ff6ed['query'],_0xffceea[_0xe862('0x27')]),_0x3246f0);if(_0x1ff6ed[_0xe862('0x25')][_0xe862('0x18')]){_0x3a3b70[_0xe862('0x30')]=_[_0xe862('0x31')](_0x3a3b70[_0xe862('0x30')],{'$or':_['map'](_0x3246f0,function(_0x59b2e4){if(_0x59b2e4[_0xe862('0x1c')]!==_0xe862('0x32')){var _0x485805={};_0x485805[_0x59b2e4['name']]={'$like':'%'+_0x1ff6ed['query']['filter']+'%'};return _0x485805;}})});}_0x3a3b70=_[_0xe862('0x31')]({},_0x3a3b70,_0x1ff6ed['options']);var _0x5cf0f2={'where':_0x3a3b70['where']};return db[_0xe862('0x33')][_0xe862('0x10')](_0x5cf0f2)['then'](function(_0x12c4f7){_0x3f7a72['count']=_0x12c4f7;if(_0x1ff6ed[_0xe862('0x25')][_0xe862('0x34')]){_0x3a3b70['include']=[{'all':!![]}];}return db[_0xe862('0x33')][_0xe862('0x35')](_0x3a3b70);})['then'](function(_0x3a544d){_0x3f7a72['rows']=_0x3a544d;return _0x3f7a72;})[_0xe862('0x36')](respondWithFilteredResult(_0x34d9fb,_0x3a3b70))['catch'](handleError(_0x34d9fb,null));};exports[_0xe862('0x37')]=function(_0x1f7faf,_0x520352){var _0x278fef={'raw':![],'where':{'id':_0x1f7faf[_0xe862('0x38')]['id']}},_0x28075a={};_0x28075a[_0xe862('0x24')]=_[_0xe862('0x26')](db[_0xe862('0x33')]['rawAttributes']);_0x28075a['query']=_[_0xe862('0x26')](_0x1f7faf[_0xe862('0x25')]);_0x28075a['filters']=_['intersection'](_0x28075a[_0xe862('0x24')],_0x28075a['query']);_0x278fef[_0xe862('0x29')]=_[_0xe862('0x28')](_0x28075a[_0xe862('0x24')],qs['fields'](_0x1f7faf[_0xe862('0x25')]['fields']));_0x278fef[_0xe862('0x29')]=_0x278fef[_0xe862('0x29')][_0xe862('0x2b')]?_0x278fef[_0xe862('0x29')]:_0x28075a['model'];if(_0x1f7faf[_0xe862('0x25')]['includeAll']){_0x278fef[_0xe862('0x39')]=[{'all':!![]}];}_0x278fef=_['merge']({},_0x278fef,_0x1f7faf[_0xe862('0x3a')]);return db[_0xe862('0x33')][_0xe862('0x1d')](_0x278fef)[_0xe862('0x36')](handleEntityNotFound(_0x520352,null))[_0xe862('0x36')](respondWithResult(_0x520352,null))[_0xe862('0x3b')](handleError(_0x520352,null));};exports[_0xe862('0x13')]=function(_0x410a1d,_0x5aef4d){return db['VoiceExtension'][_0xe862('0x1d')]({'where':{'id':_0x410a1d[_0xe862('0x38')]['id']}})[_0xe862('0x36')](handleEntityNotFound(_0x5aef4d,null))[_0xe862('0x36')](removeEntity(_0x5aef4d,null))[_0xe862('0x3b')](handleError(_0x5aef4d,null));};exports['create']=function(_0x45ac5b,_0x4f1334){if(_0x45ac5b[_0xe862('0x3c')][_0xe862('0x1c')]===_0xe862('0x3d')&&!_['startsWith'](_0x45ac5b['body'][_0xe862('0x3e')],'_')){_0x45ac5b[_0xe862('0x3c')]['exten']='_'[_0xe862('0x3f')](_0x45ac5b[_0xe862('0x3c')]['exten']);}return db[_0xe862('0x33')][_0xe862('0x40')](_0x45ac5b[_0xe862('0x3c')],{'raw':![]})[_0xe862('0x36')](function(_0x42e08b){var _0x293aad=_0x45ac5b[_0xe862('0x41')][_0xe862('0x14')]({'plain':!![]});if(!_0x293aad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293aad[_0xe862('0x42')]===_0xe862('0x41')){var _0x21303c=_0x42e08b[_0xe862('0x14')]({'plain':!![]});var _0x52cd0d=[{'name':_0xe862('0x15'),'value':_0xe862('0x43')},{'name':_0xe862('0x16'),'value':_0xe862('0x3d')},{'name':_0xe862('0x17'),'value':_0xe862('0x44')}];var _0xb9d0cf=_['find'](_0x52cd0d,[_0xe862('0x1a'),_0x21303c['type']])[_0xe862('0x1e')];return db[_0xe862('0x45')][_0xe862('0x1d')]({'where':{'name':_0xb9d0cf,'userProfileId':_0x293aad['userProfileId']},'raw':!![]})[_0xe862('0x36')](function(_0x3307fc){if(_0x3307fc&&_0x3307fc['autoAssociation']===0x0){return db['UserProfileResource'][_0xe862('0x40')]({'name':_0x21303c['name'],'resourceId':_0x21303c['id'],'type':_0x3307fc[_0xe862('0x1e')],'sectionId':_0x3307fc['id']},{})['then'](function(){return _0x42e08b;});}else{return _0x42e08b;}})[_0xe862('0x3b')](function(_0x34b620){logger[_0xe862('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34b620);throw _0x34b620;});}return _0x42e08b;})['then'](respondWithResult(_0x4f1334,0xc9))[_0xe862('0x3b')](handleError(_0x4f1334,null));};exports[_0xe862('0x47')]=function(_0xf5f115,_0x51fc0b){if(_0xf5f115[_0xe862('0x3c')]['id']){delete _0xf5f115[_0xe862('0x3c')]['id'];}return db[_0xe862('0x33')][_0xe862('0x1d')]({'where':{'id':_0xf5f115[_0xe862('0x38')]['id']}})[_0xe862('0x36')](handleEntityNotFound(_0x51fc0b,null))[_0xe862('0x36')](function(_0x28c273){if(_0x28c273){return db[_0xe862('0x33')][_0xe862('0x47')](_['pick'](_0xf5f115[_0xe862('0x3c')],['exten',_0xe862('0x48'),'description','recordingFormat',_0xe862('0x49'),_0xe862('0x4a'),_0xe862('0x4b')]),{'where':{'context':_0x28c273[_0xe862('0x48')],'exten':_0x28c273[_0xe862('0x3e')]},'individualHooks':!![]})['then'](function(_0x1512b5){return _0x1512b5;});}return null;})['then'](respondWithStatusCode(_0x51fc0b,null))[_0xe862('0x3b')](handleError(_0x51fc0b,null));};exports[_0xe862('0x4c')]=function(_0x9d50bf,_0x353e6d){var _0x1b077c=_0x9d50bf['params']['id'];var _0x1fd863=_0x9d50bf[_0xe862('0x3c')];var _0x3d570a=0xc8;var _0x502f48=null;return db['sequelize'][_0xe862('0x4d')]({'isolationLevel':db[_0xe862('0x4e')][_0xe862('0x4f')][_0xe862('0x50')][_0xe862('0x51')]},function(_0x6c4dee){return db[_0xe862('0x33')][_0xe862('0x52')]({'where':{'id':_0x1b077c},'transaction':_0x6c4dee})[_0xe862('0x36')](function(_0x2ab2b5){if(_0x2ab2b5){return db[_0xe862('0x33')]['destroy']({'where':{'VoiceExtensionId':_0x1b077c},'transaction':_0x6c4dee})[_0xe862('0x36')](function(){var _0x5ea2cd=_['map'](_0x1fd863,function(_0x1e6293){_0x1e6293['VoiceExtensionId']=_0x1b077c;_0x1e6293[_0xe862('0x53')]=!![];return _0x1e6293;});return _0x2ab2b5[_0xe862('0x54')](_0x5ea2cd);})[_0xe862('0x36')](function(_0x32e91d){return db[_0xe862('0x33')][_0xe862('0x55')](_0x32e91d,{'transaction':_0x6c4dee});});}else{_0x3d570a=0x194;_0x502f48=[];}});})['then'](function(){if(_0x3d570a!==0x194){return db[_0xe862('0x33')][_0xe862('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b077c},'order':_0xe862('0x57')})[_0xe862('0x36')](function(_0x26a1b5){_0x502f48=_0x26a1b5;});}})[_0xe862('0x3b')](function(_0x37ba50){_0x3d570a=0x1f4;logger[_0xe862('0x46')](_0x37ba50[_0xe862('0x20')]);if(_0x37ba50[_0xe862('0x1e')]){delete _0x37ba50[_0xe862('0x1e')];}_0x502f48=_0x37ba50;})['finally'](function(){if(_0x502f48===null){_0x353e6d[_0xe862('0x9')](_0x3d570a);}else{if(_0x3d570a===0x1f4){_0x353e6d[_0xe862('0xa')](_0x3d570a)[_0xe862('0x21')](_0x502f48);}else{_0x353e6d[_0xe862('0xa')](_0x3d570a)[_0xe862('0xc')](_0x502f48);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index c04d5f8..762e278 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 _0x5fce=['../../mysqldb','VoiceExtension','save','remove','emit','exports'];(function(_0x2d9a62,_0x1ef85f){var _0x28c733=function(_0x418253){while(--_0x418253){_0x2d9a62['push'](_0x2d9a62['shift']());}};_0x28c733(++_0x1ef85f);}(_0x5fce,0xae));var _0xe5fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5fce[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xe5fc('0x0'))['db'][_0xe5fc('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe5fc('0x2'),'afterUpdate':'update','afterDestroy':_0xe5fc('0x3')};function emitEvent(_0x283c66){return function(_0x17e8df,_0x49158d,_0x25fb31){VoiceExtensionEvents[_0xe5fc('0x4')](_0x283c66+':'+_0x17e8df['id'],_0x17e8df);VoiceExtensionEvents[_0xe5fc('0x4')](_0x283c66,_0x17e8df);_0x25fb31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xe5fc('0x5')]=VoiceExtensionEvents; \ No newline at end of file +var _0x39ab=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x39ab,0x10d));var _0xb39a=function(_0x4bb1c3,_0x1dd695){_0x4bb1c3=_0x4bb1c3-0x0;var _0x3b516a=_0x39ab[_0x4bb1c3];return _0x3b516a;};'use strict';var EventEmitter=require(_0xb39a('0x0'));var VoiceExtension=require(_0xb39a('0x1'))['db'][_0xb39a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb39a('0x3')](0x0);var events={'afterCreate':_0xb39a('0x4'),'afterUpdate':'update','afterDestroy':_0xb39a('0x5')};function emitEvent(_0xb67f8f){return function(_0xd45f84,_0x19a091,_0x175a83){VoiceExtensionEvents[_0xb39a('0x6')](_0xb67f8f+':'+_0xd45f84['id'],_0xd45f84);VoiceExtensionEvents[_0xb39a('0x6')](_0xb67f8f,_0xd45f84);_0x175a83(null);};}for(var e in events){if(events[_0xb39a('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xb39a('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 8d49e40..6b2e359 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 _0xb2ac=['timeout','options','url','split','name','trunk','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','map','filter','toLowerCase','tag','intervals','length','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav'];(function(_0x2dcacf,_0x1ef0f8){var _0x533652=function(_0x9fbba2){while(--_0x9fbba2){_0x2dcacf['push'](_0x2dcacf['shift']());}};_0x533652(++_0x1ef0f8);}(_0xb2ac,0x16a));var _0xcb2a=function(_0xd3ed61,_0x1baa71){_0xd3ed61=_0xd3ed61-0x0;var _0x26e634=_0xb2ac[_0xd3ed61];return _0x26e634;};'use strict';var _=require(_0xcb2a('0x0'));var attributes=require(_0xcb2a('0x1'));module[_0xcb2a('0x2')]=function(_0x18a01a){var _0xe79674=_0x18a01a[_0xcb2a('0x3')];function _0x5db7e9(_0x1dd59b){var _0x19c4aa=0x2;var _0x3fa7c3=[{'type':_0x1dd59b[_0xcb2a('0x4')],'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x6')+_0x1dd59b['type'],'context':_0x1dd59b[_0xcb2a('0x7')],'exten':_0x1dd59b[_0xcb2a('0x8')],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']},{'type':_0x1dd59b['type'],'app':_0x1dd59b['alias']?'Set':_0xcb2a('0x9'),'appdata':_0x1dd59b['alias']?_0xcb2a('0xa')+_0x1dd59b[_0xcb2a('0xb')]:_0xcb2a('0xc'),'context':_0x1dd59b[_0xcb2a('0x7')],'exten':_0x1dd59b[_0xcb2a('0x8')],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']}];if(_0x1dd59b['type']===_0xcb2a('0xd')){_0x3fa7c3[_0xcb2a('0xe')]({'type':'inbound','app':_0xcb2a('0x5'),'appdata':'CDR(routeid)='+_0x1dd59b['id'],'context':_0x1dd59b['context'],'exten':_0x1dd59b[_0xcb2a('0x8')],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']});}_0x3fa7c3[_0xcb2a('0xe')]({'type':_0x1dd59b[_0xcb2a('0x4')],'app':_0xcb2a('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1dd59b[_0xcb2a('0x7')],'exten':_0x1dd59b[_0xcb2a('0x8')],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']},{'type':_0x1dd59b['type'],'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0xf'),'context':_0x1dd59b[_0xcb2a('0x7')],'exten':_0x1dd59b[_0xcb2a('0x8')],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']},{'type':_0x1dd59b[_0xcb2a('0x4')],'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x10'),'context':_0x1dd59b[_0xcb2a('0x7')],'exten':_0x1dd59b['exten'],'priority':_0x19c4aa++,'VoiceExtensionId':_0x1dd59b['id']});return _0x3fa7c3;}function _0x487eec(_0x2b02b3){var _0x31fe86=0x2;var _0x5279be=[{'type':'outbound','app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x11'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0x2b02b3[_0xcb2a('0xb')]?_0xcb2a('0x5'):'NoOp','appdata':_0x2b02b3[_0xcb2a('0xb')]?_0xcb2a('0xa')+_0x2b02b3[_0xcb2a('0xb')]:_0xcb2a('0xc'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0xcb2a('0x5'),'appdata':'CDR(destination)='+(_0x2b02b3[_0xcb2a('0x13')]?_0xcb2a('0x14')+_0x2b02b3[_0xcb2a('0x13')]+'}':_0xcb2a('0x15')),'context':_0x2b02b3['context'],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x16')+_0x2b02b3['id'],'context':_0x2b02b3['context'],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0xcb2a('0x17'),'appdata':_0xcb2a('0x18')+(_0x31fe86+0x2)+'):Goto('+(_0x31fe86+0x1)+')','context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':'Set','appdata':_0x2b02b3[_0xcb2a('0x13')]?_0xcb2a('0x19')+_0x2b02b3[_0xcb2a('0x13')]+'}':_0xcb2a('0x1a'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3['exten'],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':'Set','appdata':_0xcb2a('0x1b'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0xf'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3['exten'],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':_0xcb2a('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':'outbound','app':'Set','appdata':'outboundrouteid='+_0x2b02b3['id'],'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']}];if(_0x2b02b3[_0xcb2a('0x1c')](_0xcb2a('0x1d'))&&_0x2b02b3[_0xcb2a('0x1d')]!==_0xcb2a('0x1e')){_0x5279be[_0xcb2a('0xe')]({'type':_0xcb2a('0x12'),'app':'Set','appdata':_0xcb2a('0x1f'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3['exten'],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']},{'type':_0xcb2a('0x12'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x2b02b3['recordingFormat']||_0xcb2a('0x20'),'context':_0x2b02b3[_0xcb2a('0x7')],'exten':_0x2b02b3[_0xcb2a('0x8')],'priority':_0x31fe86++,'VoiceExtensionId':_0x2b02b3['id']});}return _0x5279be;}function _0x6329c6(_0x5b744f,_0x382552){var _0x1becec=[{'name':'trunk','param':0x0},{'name':_0xcb2a('0x21'),'param':0x1},{'name':_0xcb2a('0x22'),'param':0x2},{'name':_0xcb2a('0x23'),'param':0x3}];var _0x3720a2={};var _0x162dbc=_0x382552[_0xcb2a('0x24')](',');var _0x16cdce=[];for(var _0x4ecca8=0x0;_0x4ecca8<_0x1becec['length'];_0x4ecca8++){switch(_0x1becec[_0x4ecca8][_0xcb2a('0x25')]){case _0xcb2a('0x26'):_0x3720a2[_0xcb2a('0x26')]=_0x162dbc[_0x1becec[_0x4ecca8][_0xcb2a('0x27')]][_0xcb2a('0x24')]('/')[0x1];_0x3720a2[_0xcb2a('0x28')]=_0x162dbc[_0x1becec[_0x4ecca8]['param']]['split']('/')[0x2];_0x3720a2[_0xcb2a('0x29')]=_0x3720a2['phone']?_0x3720a2[_0xcb2a('0x28')][_0xcb2a('0x24')]('$')[0x0]:undefined;_0x3720a2['phone']=_0x5b744f[_0xcb2a('0x13')]?(_0x3720a2[_0xcb2a('0x29')]||'')+'${EXTEN:'+_0x5b744f[_0xcb2a('0x13')]+'}':(_0x3720a2[_0xcb2a('0x29')]||'')+'${EXTEN}';_0x16cdce[_0x1becec[_0x4ecca8][_0xcb2a('0x27')]]=[_0xcb2a('0x2a'),_0x3720a2['trunk'],_0x3720a2[_0xcb2a('0x28')]][_0xcb2a('0x2b')]('/');break;case _0xcb2a('0x22'):_0x3720a2[_0xcb2a('0x22')]=_0x162dbc[_0x1becec[_0x4ecca8][_0xcb2a('0x27')]];if(_0x5b744f[_0xcb2a('0x1d')]!==_0xcb2a('0x1e')){if(_0x3720a2['options'][_0xcb2a('0x2c')](_0xcb2a('0x2d'))<0x0){_0x3720a2[_0xcb2a('0x22')]+=_0xcb2a('0x2d');}}else{_0x3720a2['options']=_0x3720a2[_0xcb2a('0x22')]['replace'](_0xcb2a('0x2d'),'');}_0x16cdce[_0x1becec[_0x4ecca8]['param']]=_0x3720a2[_0xcb2a('0x22')];break;default:_0x16cdce[_0x1becec[_0x4ecca8][_0xcb2a('0x27')]]=_0x162dbc[_0x1becec[_0x4ecca8][_0xcb2a('0x27')]];}}return _0x16cdce[_0xcb2a('0x2b')](',');}function _0x453c04(_0x57eabb,_0x2e593c,_0x1496af){return new Promise(function(_0x3cbbda,_0x733f1){var _0x138be9=[];if(_[_0xcb2a('0x2e')](_0x2e593c))return _0x3cbbda(_0x138be9);_0xe79674[_0xcb2a('0x2f')][_0xcb2a('0x30')]({'attributes':['id',_0xcb2a('0x31'),_0xcb2a('0x32')],'raw':!![]})['then'](function(_0x3a90b1){for(var _0x459274=0x0,_0x2cce96=0x0;_0x459274<_0x2e593c['length'];_0x459274++,_0x2cce96=0x0){var _0x2c981b=_0x2e593c[_0x459274];var _0x56b80f=[];var _0xf95b5a=[];delete _0x2c981b['id'];if(_0x2c981b['interval']!==_0xcb2a('0x33')){_0x2c981b['intervals']=[_0x2c981b[_0xcb2a('0x31')]];}else{_0x2c981b['intervals']=_0x2c981b[_0xcb2a('0x32')]?_[_0xcb2a('0x34')](_[_0xcb2a('0x35')](_0x3a90b1,{'IntervalId':_0x2c981b[_0xcb2a('0x32')]}),_0xcb2a('0x31')):[];}_0x2c981b[_0xcb2a('0x7')]=_0x57eabb['context'];_0x2c981b['exten']=_0x57eabb['exten'];if(_0x2c981b[_0xcb2a('0x4')])_0x2c981b[_0xcb2a('0x4')]=_0x2c981b[_0xcb2a('0x4')][_0xcb2a('0x36')]();if(_0x57eabb[_0xcb2a('0x4')]==='outbound'){if(_0x2c981b[_0xcb2a('0x1c')](_0xcb2a('0x37'))&&_0x2c981b[_0xcb2a('0x37')]&&_0x2c981b[_0xcb2a('0x37')]!=='--'){_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b[_0xcb2a('0x4')][_0xcb2a('0x36')](),'app':_0xcb2a('0x5'),'appdata':'CDR(tag)='+_0x2c981b['tag'],'context':_0x57eabb['context'],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')]+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});}_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b[_0xcb2a('0x4')][_0xcb2a('0x36')](),'app':_0xcb2a('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x2c981b['callerID']?_0xcb2a('0x3a')+_0x2c981b['callerID']+')':_0xcb2a('0x3b')),'context':_0x57eabb[_0xcb2a('0x7')],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')]+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});}else{if(_0x2c981b[_0xcb2a('0x1c')](_0xcb2a('0x3c'))){if(['queue',_0xcb2a('0x3d')]['includes'](_0x2c981b[_0xcb2a('0x3e')]['toLowerCase']())&&_0x2c981b['appType']!=='custom'){if(_0x2c981b[_0xcb2a('0x3c')]){_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b[_0xcb2a('0x4')][_0xcb2a('0x36')](),'app':_0xcb2a('0x17'),'appdata':_0xcb2a('0x3f'),'context':_0x57eabb['context'],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b[_0xcb2a('0x38')]['length']+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b[_0xcb2a('0x4')]['toLowerCase'](),'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x40'),'context':_0x57eabb[_0xcb2a('0x7')],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')]+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});}else{_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b[_0xcb2a('0x4')][_0xcb2a('0x36')](),'app':_0xcb2a('0x17'),'appdata':_0xcb2a('0x41'),'context':_0x57eabb['context'],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')]+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});_0x56b80f[_0xcb2a('0xe')]({'type':_0x2c981b['type'][_0xcb2a('0x36')](),'app':_0xcb2a('0x5'),'appdata':_0xcb2a('0x42'),'context':_0x57eabb['context'],'exten':_0x57eabb[_0xcb2a('0x8')],'priority':_0x2c981b['intervals'][_0xcb2a('0x39')]+_0x1496af+_0x2cce96++,'VoiceExtensionId':_0x57eabb['id']});}}}}for(var _0x173fef=0x0;_0x173fef<_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')];_0x173fef++){var _0x37a473=_0x1496af+_0x2c981b['intervals']['length'];var _0x539f53=_0x173fef===_0x2c981b[_0xcb2a('0x38')][_0xcb2a('0x39')]-0x1?_0x1496af+_0x56b80f[_0xcb2a('0x39')]+_0xf95b5a[_0xcb2a('0x39')]+0x2:_0x1496af+_0x173fef+0x1;_0x56b80f['splice'](_0x173fef,0x0,{'type':_0x57eabb[_0xcb2a('0x4')],'app':_0xcb2a('0x43'),'appdata':_0x2c981b[_0xcb2a('0x38')][_0x173fef]+'?'+_0x57eabb[_0xcb2a('0x7')]+_0xcb2a('0x44')+_0x37a473+':'+_0x57eabb[_0xcb2a('0x7')]+_0xcb2a('0x44')+_0x539f53,'exten':_0x57eabb[_0xcb2a('0x8')],'context':_0x57eabb[_0xcb2a('0x7')],'priority':_0x1496af+_0x173fef,'VoiceExtensionId':_0x57eabb['id']});}if(_0x2c981b[_0xcb2a('0x45')]===_0xcb2a('0x46'))_0x2c981b['appdata']=_0x6329c6(_0x57eabb,_0x2c981b[_0xcb2a('0x47')]);_0x2c981b[_0xcb2a('0x48')]=_0x56b80f['length']?_[_0xcb2a('0x49')](_0x56b80f)['priority']+0x1:_0x1496af;_0x138be9=_[_0xcb2a('0x4a')](_0x138be9,_0x56b80f,[_0x2c981b],_0xf95b5a);_0x1496af=_['last'](_0x138be9)[_0xcb2a('0x48')]+0x1;}return _0x3cbbda(_0x138be9);})['catch'](function(_0x1f99ef){_0x733f1(_0x1f99ef);});});}return _0x18a01a['define'](_0xcb2a('0x4b'),attributes,{'tableName':_0xcb2a('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1b9bcd){var _0x3c3fd6=this[_0xcb2a('0x4d')]({'plain':!![]});var _0x4e1916=_0x3c3fd6[_0xcb2a('0x4')]===_0xcb2a('0x12')?_0x487eec(_0x3c3fd6):_0x5db7e9(_0x3c3fd6);return _0x453c04(_0x3c3fd6,_0x1b9bcd,_[_0xcb2a('0x49')](_0x4e1916)['priority']+0x1)['then'](function(_0xcf4f99){var _0x55ed4a=_[_0xcb2a('0x4a')](_0x4e1916,_0xcf4f99);_0x55ed4a['push']({'type':_0x3c3fd6[_0xcb2a('0x4')],'app':_0xcb2a('0x4e'),'exten':_0x3c3fd6[_0xcb2a('0x8')],'context':_0x3c3fd6['context'],'priority':_['last'](_0x55ed4a)['priority']+0x1,'VoiceExtensionId':_0x3c3fd6['id']});return _0x55ed4a;});}}});}; \ No newline at end of file +var _0x9f7a=['VoiceExtension','voice_extensions','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','exten','outbound','CDR(type)=outbound','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','url','name','param','phone','split','prefix','${EXTEN}','SIP','options','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','answer','queue','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','last','priority','catch','define'];(function(_0xfe33d1,_0x4490ab){var _0x5606a6=function(_0x409d81){while(--_0x409d81){_0xfe33d1['push'](_0xfe33d1['shift']());}};_0x5606a6(++_0x4490ab);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x9f7a[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0xa9f7('0x0'));var attributes=require(_0xa9f7('0x1'));module[_0xa9f7('0x2')]=function(_0x23e78b){var _0x4af524=_0x23e78b[_0xa9f7('0x3')];function _0x4c0346(_0x4d188f){var _0x59823f=0x2;var _0x22dbdd=[{'type':_0x4d188f[_0xa9f7('0x4')],'app':'Set','appdata':'CDR(type)='+_0x4d188f[_0xa9f7('0x4')],'context':_0x4d188f['context'],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f['type'],'app':_0x4d188f[_0xa9f7('0x5')]?'Set':_0xa9f7('0x6'),'appdata':_0x4d188f[_0xa9f7('0x5')]?_0xa9f7('0x7')+_0x4d188f['alias']:_0xa9f7('0x8'),'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']}];if(_0x4d188f[_0xa9f7('0x4')]===_0xa9f7('0xa')){_0x22dbdd[_0xa9f7('0xb')]({'type':_0xa9f7('0xa'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xd')+_0x4d188f['id'],'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']});}_0x22dbdd[_0xa9f7('0xb')]({'type':_0x4d188f['type'],'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xe'),'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f['type'],'app':_0xa9f7('0xc'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4d188f['context'],'exten':_0x4d188f[_0xa9f7('0xf')],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f[_0xa9f7('0x4')],'app':_0xa9f7('0xc'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f[_0xa9f7('0xf')],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']});return _0x22dbdd;}function _0x2aeadd(_0x48315a){var _0x310009=0x2;var _0x1a1a13=[{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x11'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0x48315a[_0xa9f7('0x5')]?'Set':_0xa9f7('0x6'),'appdata':_0x48315a[_0xa9f7('0x5')]?_0xa9f7('0x7')+_0x48315a[_0xa9f7('0x5')]:_0xa9f7('0x8'),'context':_0x48315a['context'],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x48315a[_0xa9f7('0x12')]?'${EXTEN:'+_0x48315a[_0xa9f7('0x12')]+'}':'${EXTEN}'),'context':_0x48315a['context'],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':'CDR(routeid)='+_0x48315a['id'],'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'ExecIf','appdata':_0xa9f7('0x13')+(_0x310009+0x2)+_0xa9f7('0x14')+(_0x310009+0x1)+')','context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'Set','appdata':_0x48315a[_0xa9f7('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x48315a[_0xa9f7('0x12')]+'}':_0xa9f7('0x15'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xe'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x16'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':_0xa9f7('0x17'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x48315a['id'],'context':_0x48315a['context'],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']}];if(_0x48315a['hasOwnProperty'](_0xa9f7('0x18'))&&_0x48315a[_0xa9f7('0x18')]!==_0xa9f7('0x19')){_0x1a1a13[_0xa9f7('0xb')]({'type':_0xa9f7('0x10'),'app':'Set','appdata':_0xa9f7('0x1a'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x48315a[_0xa9f7('0x18')]||_0xa9f7('0x1b'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']});}return _0x1a1a13;}function _0x58f401(_0x28283c,_0x3c79b2){var _0x2f384d=[{'name':_0xa9f7('0x1c'),'param':0x0},{'name':_0xa9f7('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':_0xa9f7('0x1e'),'param':0x3}];var _0x324341={};var _0x3be76e=_0x3c79b2['split'](',');var _0x563619=[];for(var _0xeffbb4=0x0;_0xeffbb4<_0x2f384d['length'];_0xeffbb4++){switch(_0x2f384d[_0xeffbb4][_0xa9f7('0x1f')]){case _0xa9f7('0x1c'):_0x324341[_0xa9f7('0x1c')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]['split']('/')[0x1];_0x324341[_0xa9f7('0x21')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]][_0xa9f7('0x22')]('/')[0x2];_0x324341[_0xa9f7('0x23')]=_0x324341[_0xa9f7('0x21')]?_0x324341[_0xa9f7('0x21')][_0xa9f7('0x22')]('$')[0x0]:undefined;_0x324341['phone']=_0x28283c[_0xa9f7('0x12')]?(_0x324341[_0xa9f7('0x23')]||'')+'${EXTEN:'+_0x28283c[_0xa9f7('0x12')]+'}':(_0x324341[_0xa9f7('0x23')]||'')+_0xa9f7('0x24');_0x563619[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]=[_0xa9f7('0x25'),_0x324341[_0xa9f7('0x1c')],_0x324341[_0xa9f7('0x21')]]['join']('/');break;case _0xa9f7('0x26'):_0x324341[_0xa9f7('0x26')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]];if(_0x28283c['recordingFormat']!==_0xa9f7('0x19')){if(_0x324341['options'][_0xa9f7('0x27')](_0xa9f7('0x28'))<0x0){_0x324341['options']+=_0xa9f7('0x28');}}else{_0x324341[_0xa9f7('0x26')]=_0x324341[_0xa9f7('0x26')][_0xa9f7('0x29')](_0xa9f7('0x28'),'');}_0x563619[_0x2f384d[_0xeffbb4]['param']]=_0x324341[_0xa9f7('0x26')];break;default:_0x563619[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]];}}return _0x563619[_0xa9f7('0x2a')](',');}function _0x1706ea(_0x2d86f3,_0x6fb9cf,_0x2c7912){return new Promise(function(_0x2bfaa2,_0x440880){var _0x108c60=[];if(_[_0xa9f7('0x2b')](_0x6fb9cf))return _0x2bfaa2(_0x108c60);_0x4af524['Interval']['findAll']({'attributes':['id',_0xa9f7('0x2c'),_0xa9f7('0x2d')],'raw':!![]})[_0xa9f7('0x2e')](function(_0x3563a1){for(var _0x226279=0x0,_0x26a61d=0x0;_0x226279<_0x6fb9cf[_0xa9f7('0x2f')];_0x226279++,_0x26a61d=0x0){var _0x284f9d=_0x6fb9cf[_0x226279];var _0x4ea565=[];var _0x28eb60=[];delete _0x284f9d['id'];if(_0x284f9d[_0xa9f7('0x2c')]!==_0xa9f7('0x30')){_0x284f9d['intervals']=[_0x284f9d['interval']];}else{_0x284f9d[_0xa9f7('0x31')]=_0x284f9d['IntervalId']?_[_0xa9f7('0x32')](_[_0xa9f7('0x33')](_0x3563a1,{'IntervalId':_0x284f9d[_0xa9f7('0x2d')]}),_0xa9f7('0x2c')):[];}_0x284f9d['context']=_0x2d86f3[_0xa9f7('0x9')];_0x284f9d['exten']=_0x2d86f3[_0xa9f7('0xf')];if(_0x284f9d[_0xa9f7('0x4')])_0x284f9d[_0xa9f7('0x4')]=_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')]();if(_0x2d86f3[_0xa9f7('0x4')]===_0xa9f7('0x10')){if(_0x284f9d[_0xa9f7('0x35')](_0xa9f7('0x36'))&&_0x284f9d['tag']&&_0x284f9d[_0xa9f7('0x36')]!=='--'){_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')]['toLowerCase'](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x37')+_0x284f9d[_0xa9f7('0x36')],'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0x38'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x284f9d[_0xa9f7('0x39')]?_0xa9f7('0x3a')+_0x284f9d[_0xa9f7('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}else{if(_0x284f9d[_0xa9f7('0x35')](_0xa9f7('0x3b'))){if([_0xa9f7('0x3c'),'playback'][_0xa9f7('0x3d')](_0x284f9d[_0xa9f7('0x3e')][_0xa9f7('0x34')]())&&_0x284f9d[_0xa9f7('0x3f')]!=='custom'){if(_0x284f9d['answer']){_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')]['toLowerCase'](),'app':_0xa9f7('0x38'),'appdata':_0xa9f7('0x40'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});_0x4ea565['push']({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x41'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d['intervals']['length']+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}else{_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0x38'),'appdata':_0xa9f7('0x42'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d['intervals'][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x43'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')]['length']+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}}}}for(var _0x123201=0x0;_0x123201<_0x284f9d['intervals'][_0xa9f7('0x2f')];_0x123201++){var _0x504af9=_0x2c7912+_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')];var _0x66c433=_0x123201===_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]-0x1?_0x2c7912+_0x4ea565['length']+_0x28eb60[_0xa9f7('0x2f')]+0x2:_0x2c7912+_0x123201+0x1;_0x4ea565[_0xa9f7('0x44')](_0x123201,0x0,{'type':_0x2d86f3[_0xa9f7('0x4')],'app':'GotoIfTime','appdata':_0x284f9d[_0xa9f7('0x31')][_0x123201]+'?'+_0x2d86f3['context']+_0xa9f7('0x45')+_0x504af9+':'+_0x2d86f3[_0xa9f7('0x9')]+_0xa9f7('0x45')+_0x66c433,'exten':_0x2d86f3['exten'],'context':_0x2d86f3[_0xa9f7('0x9')],'priority':_0x2c7912+_0x123201,'VoiceExtensionId':_0x2d86f3['id']});}if(_0x284f9d[_0xa9f7('0x3f')]===_0xa9f7('0x46'))_0x284f9d['appdata']=_0x58f401(_0x2d86f3,_0x284f9d['appdata']);_0x284f9d['priority']=_0x4ea565[_0xa9f7('0x2f')]?_[_0xa9f7('0x47')](_0x4ea565)[_0xa9f7('0x48')]+0x1:_0x2c7912;_0x108c60=_['concat'](_0x108c60,_0x4ea565,[_0x284f9d],_0x28eb60);_0x2c7912=_[_0xa9f7('0x47')](_0x108c60)[_0xa9f7('0x48')]+0x1;}return _0x2bfaa2(_0x108c60);})[_0xa9f7('0x49')](function(_0x2fb930){_0x440880(_0x2fb930);});});}return _0x23e78b[_0xa9f7('0x4a')](_0xa9f7('0x4b'),attributes,{'tableName':_0xa9f7('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x228212){var _0x416954=this['get']({'plain':!![]});var _0x176640=_0x416954[_0xa9f7('0x4')]===_0xa9f7('0x10')?_0x2aeadd(_0x416954):_0x4c0346(_0x416954);return _0x1706ea(_0x416954,_0x228212,_[_0xa9f7('0x47')](_0x176640)[_0xa9f7('0x48')]+0x1)['then'](function(_0x4d1097){var _0x11cb60=_[_0xa9f7('0x4d')](_0x176640,_0x4d1097);_0x11cb60[_0xa9f7('0xb')]({'type':_0x416954[_0xa9f7('0x4')],'app':_0xa9f7('0x4e'),'exten':_0x416954[_0xa9f7('0xf')],'context':_0x416954[_0xa9f7('0x9')],'priority':_[_0xa9f7('0x47')](_0x11cb60)[_0xa9f7('0x48')]+0x1,'VoiceExtensionId':_0x416954['id']});return _0x11cb60;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index cc6cf26..c137f41 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 _0x1354=['stringify','error','message','catch','GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','register','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x183458,_0x6d0b17){var _0x482076=function(_0x21cf10){while(--_0x21cf10){_0x183458['push'](_0x183458['shift']());}};_0x482076(++_0x6d0b17);}(_0x1354,0x95));var _0x4135=function(_0x1757c8,_0x4aa781){_0x1757c8=_0x1757c8-0x0;var _0x3059f1=_0x1354[_0x1757c8];return _0x3059f1;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rs=require(_0x4135('0x4'));var fs=require('fs');var Redis=require(_0x4135('0x5'));var db=require(_0x4135('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4135('0x7'))(_0x4135('0x8'));var config=require(_0x4135('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4135('0xa')][_0x4135('0xb')]({'port':0x232a});config['redis']=_[_0x4135('0xc')](config[_0x4135('0xd')],{'host':_0x4135('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4135('0xd')]));require('./voiceExtension.socket')[_0x4135('0xf')](socket);function respondWithRpcPromise(_0x1d0cc6,_0x4447c8,_0x39822e){return new BPromise(function(_0x5dd78a,_0x35d576){return client['request'](_0x1d0cc6,_0x39822e)['then'](function(_0x73c55f){logger[_0x4135('0x10')](_0x4135('0x11'),_0x4447c8,'request\x20sent');logger[_0x4135('0x12')](_0x4135('0x13'),_0x4447c8,_0x4135('0x14'),JSON[_0x4135('0x15')](_0x73c55f));if(_0x73c55f[_0x4135('0x16')]){if(_0x73c55f[_0x4135('0x16')]['code']===0x1f4){logger['error'](_0x4135('0x11'),_0x4447c8,_0x73c55f[_0x4135('0x16')][_0x4135('0x17')]);return _0x35d576(_0x73c55f[_0x4135('0x16')]['message']);}logger[_0x4135('0x16')](_0x4135('0x11'),_0x4447c8,_0x73c55f['error']['message']);return _0x5dd78a(_0x73c55f[_0x4135('0x16')]['message']);}else{logger[_0x4135('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x4447c8,'request\x20sent');_0x5dd78a(_0x73c55f['result']['message']);}})[_0x4135('0x18')](function(_0x55adba){logger[_0x4135('0x16')](_0x4135('0x11'),_0x4447c8,_0x55adba);_0x35d576(_0x55adba);});});}exports[_0x4135('0x19')]=function(_0x5eddcc){var _0x3f7e85=this;return new Promise(function(_0x3dae32,_0x398294){return db['VoiceExtension'][_0x4135('0x1a')]({'raw':_0x5eddcc['options']?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1c')]===undefined?!![]:![]:!![],'where':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')]['where']||null:null,'attributes':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1d')]||null:null,'limit':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1e')]||null:null,'include':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1f')]?_[_0x4135('0x20')](_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1f')],function(_0x212228){return{'model':db[_0x212228[_0x4135('0x21')]],'as':_0x212228['as'],'attributes':_0x212228['attributes'],'include':_0x212228[_0x4135('0x1f')]?_[_0x4135('0x20')](_0x212228[_0x4135('0x1f')],function(_0x36b9e3){return{'model':db[_0x36b9e3[_0x4135('0x21')]],'as':_0x36b9e3['as'],'attributes':_0x36b9e3[_0x4135('0x1d')],'include':_0x36b9e3['include']?_[_0x4135('0x20')](_0x36b9e3[_0x4135('0x1f')],function(_0x31b508){return{'model':db[_0x31b508[_0x4135('0x21')]],'as':_0x31b508['as'],'attributes':_0x31b508[_0x4135('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x411ee0){logger[_0x4135('0x10')]('GetVoiceExtension',_0x5eddcc);logger[_0x4135('0x12')]('GetVoiceExtension',_0x5eddcc,JSON[_0x4135('0x15')](_0x411ee0));_0x3dae32(_0x411ee0);})[_0x4135('0x18')](function(_0x25a672){logger[_0x4135('0x16')]('GetVoiceExtension',_0x25a672[_0x4135('0x17')],_0x5eddcc);_0x398294(_0x3f7e85[_0x4135('0x16')](0x1f4,_0x25a672[_0x4135('0x17')]));});});}; \ No newline at end of file +var _0x99fb=['map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis','./voiceExtension.socket','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','result','message','catch','GetVoiceExtension','options','raw','where','attributes','include'];(function(_0x45096c,_0x3d97b0){var _0x42e2ad=function(_0x2373e8){while(--_0x2373e8){_0x45096c['push'](_0x45096c['shift']());}};_0x42e2ad(++_0x3d97b0);}(_0x99fb,0x92));var _0xb99f=function(_0x65d0d3,_0x126ca3){_0x65d0d3=_0x65d0d3-0x0;var _0x107487=_0x99fb[_0x65d0d3];return _0x107487;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var moment=require(_0xb99f('0x1'));var BPromise=require(_0xb99f('0x2'));var rs=require(_0xb99f('0x3'));var fs=require('fs');var Redis=require(_0xb99f('0x4'));var db=require(_0xb99f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb99f('0x6'))(_0xb99f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb99f('0x8'));var client=jayson[_0xb99f('0x9')][_0xb99f('0xa')]({'port':0x232a});config['redis']=_[_0xb99f('0xb')](config['redis'],{'host':_0xb99f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb99f('0xd')]));require(_0xb99f('0xe'))['register'](socket);function respondWithRpcPromise(_0x29d5de,_0x18e0b1,_0x21848d){return new BPromise(function(_0x2dd1b4,_0x2cc8c4){return client[_0xb99f('0xf')](_0x29d5de,_0x21848d)[_0xb99f('0x10')](function(_0x562214){logger[_0xb99f('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x18e0b1,'request\x20sent');logger[_0xb99f('0x12')](_0xb99f('0x13'),_0x18e0b1,_0xb99f('0x14'),JSON[_0xb99f('0x15')](_0x562214));if(_0x562214[_0xb99f('0x16')]){if(_0x562214['error'][_0xb99f('0x17')]===0x1f4){logger['error'](_0xb99f('0x18'),_0x18e0b1,_0x562214[_0xb99f('0x16')]['message']);return _0x2cc8c4(_0x562214[_0xb99f('0x16')]['message']);}logger[_0xb99f('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x18e0b1,_0x562214[_0xb99f('0x16')]['message']);return _0x2dd1b4(_0x562214[_0xb99f('0x16')]['message']);}else{logger[_0xb99f('0x11')](_0xb99f('0x18'),_0x18e0b1,_0xb99f('0x14'));_0x2dd1b4(_0x562214[_0xb99f('0x19')][_0xb99f('0x1a')]);}})[_0xb99f('0x1b')](function(_0x118b54){logger[_0xb99f('0x16')](_0xb99f('0x18'),_0x18e0b1,_0x118b54);_0x2cc8c4(_0x118b54);});});}exports[_0xb99f('0x1c')]=function(_0x46a283){var _0x33627f=this;return new Promise(function(_0xe04602,_0x3273f6){return db['VoiceExtension']['findAll']({'raw':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x1e')]===undefined?!![]:![]:!![],'where':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x1f')]||null:null,'attributes':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x20')]||null:null,'limit':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')]['limit']||null:null,'include':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x46a283['options']['include'],function(_0x5c2b1a){return{'model':db[_0x5c2b1a[_0xb99f('0x23')]],'as':_0x5c2b1a['as'],'attributes':_0x5c2b1a['attributes'],'include':_0x5c2b1a[_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x5c2b1a[_0xb99f('0x21')],function(_0x3c4f27){return{'model':db[_0x3c4f27[_0xb99f('0x23')]],'as':_0x3c4f27['as'],'attributes':_0x3c4f27[_0xb99f('0x20')],'include':_0x3c4f27[_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x3c4f27['include'],function(_0x342cb0){return{'model':db[_0x342cb0['model']],'as':_0x342cb0['as'],'attributes':_0x342cb0[_0xb99f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb99f('0x10')](function(_0x29c96c){logger[_0xb99f('0x11')](_0xb99f('0x1c'),_0x46a283);logger[_0xb99f('0x12')](_0xb99f('0x1c'),_0x46a283,JSON[_0xb99f('0x15')](_0x29c96c));_0xe04602(_0x29c96c);})['catch'](function(_0x4d447b){logger[_0xb99f('0x16')](_0xb99f('0x1c'),_0x4d447b[_0xb99f('0x1a')],_0x46a283);_0x3273f6(_0x33627f[_0xb99f('0x16')](0x1f4,_0x4d447b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 900a902..66419c0 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 _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x4be27a,_0x531a65){var _0x975566=function(_0xb81179){while(--_0xb81179){_0x4be27a['push'](_0x4be27a['shift']());}};_0x975566(++_0x531a65);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x7fbe[_0x581249];return _0x284bae;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x376c8c,_0x5ee8a2){var _0x1d30b1=function(_0x37d968){while(--_0x37d968){_0x376c8c['push'](_0x376c8c['shift']());}};_0x1d30b1(++_0x5ee8a2);}(_0xf494,0x1c6));var _0x4f49=function(_0x3d0e4f,_0xf1beac){_0x3d0e4f=_0x3d0e4f-0x0;var _0x8d2638=_0xf494[_0x3d0e4f];return _0x8d2638;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index c2de13e..fde53fe 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 _0xfdbd=['get','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','show'];(function(_0x45a183,_0x31546e){var _0x3ead1e=function(_0x58bb12){while(--_0x58bb12){_0x45a183['push'](_0x45a183['shift']());}};_0x3ead1e(++_0x31546e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0xfdbd[_0x33975c];return _0x1c15ab;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id/messages',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')]('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x10')]);router[_0xdfdb('0x11')](_0xdfdb('0x12'),auth['isAuthenticated'](),controller[_0xdfdb('0x13')]);router[_0xdfdb('0x14')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x15')]);module[_0xdfdb('0x16')]=router; \ No newline at end of file +var _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x533d5c,_0x3f6b7d){var _0x30d8ec=function(_0x361af2){while(--_0x361af2){_0x533d5c['push'](_0x533d5c['shift']());}};_0x30d8ec(++_0x3f6b7d);}(_0xeda8,0x104));var _0x8eda=function(_0x3fae2c,_0x5f05ba){_0x3fae2c=_0x3fae2c-0x0;var _0x293ca4=_0xeda8[_0x3fae2c];return _0x293ca4;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 02e3e65..2dbd53c 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 _0x8c8e=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim'];(function(_0x587808,_0x4806d3){var _0x51eccd=function(_0x520ffd){while(--_0x520ffd){_0x587808['push'](_0x587808['shift']());}};_0x51eccd(++_0x4806d3);}(_0x8c8e,0x70));var _0xe8c8=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x8c8e[_0x1b92a6];return _0x24be5b;};'use strict';var Sequelize=require('sequelize');module[_0xe8c8('0x0')]={'customer_id':{'type':Sequelize[_0xe8c8('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe8c8('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xe8c8('0x1')],'defaultValue':'','allowNull':![],'unique':_0xe8c8('0x3')},'password':{'type':Sequelize[_0xe8c8('0x1')]},'fullname':{'type':Sequelize[_0xe8c8('0x1')]},'email':{'type':Sequelize[_0xe8c8('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1ad1ab){this[_0xe8c8('0x4')]('email',typeof _0x1ad1ab===_0xe8c8('0x5')&&_0x1ad1ab[_0xe8c8('0x6')]()?_0x1ad1ab[_0xe8c8('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':_0xe8c8('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe8c8('0x1')]},'callback':{'type':Sequelize[_0xe8c8('0x1')]},'review':{'type':Sequelize[_0xe8c8('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe8c8('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe8c8('0x7')](_0xe8c8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe8c8('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xe8c8('0xa')},'emailsubject':{'type':Sequelize[_0xe8c8('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xe8c8('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe8c8('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe8c8('0xc')],'get':function(){return this[_0xe8c8('0xd')](_0xe8c8('0xe'))+_0xe8c8('0xf')+this[_0xe8c8('0xd')](_0xe8c8('0x10'));}}}; \ No newline at end of file +var _0x1281=['email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x1281,0x11b));var _0x1128=function(_0x1a691a,_0x349066){_0x1a691a=_0x1a691a-0x0;var _0x539f77=_0x1281[_0x1a691a];return _0x539f77;};'use strict';var Sequelize=require('sequelize');module[_0x1128('0x0')]={'customer_id':{'type':Sequelize[_0x1128('0x1')]},'context':{'type':Sequelize[_0x1128('0x1')],'defaultValue':_0x1128('0x2'),'unique':_0x1128('0x3')},'mailbox':{'type':Sequelize[_0x1128('0x1')],'defaultValue':'','allowNull':![],'unique':_0x1128('0x3')},'password':{'type':Sequelize[_0x1128('0x1')]},'fullname':{'type':Sequelize[_0x1128('0x1')]},'email':{'type':Sequelize[_0x1128('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4af57b){this[_0x1128('0x4')](_0x1128('0x5'),typeof _0x4af57b==='string'&&_0x4af57b['trim']()?_0x4af57b[_0x1128('0x6')]():null);}},'pager':{'type':Sequelize[_0x1128('0x1')]},'tz':{'type':Sequelize[_0x1128('0x1')],'defaultValue':_0x1128('0x7')},'attach':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':_0x1128('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1128('0x1')]},'callback':{'type':Sequelize[_0x1128('0x1')]},'review':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1128('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1128('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x1128('0xb')},'emailsubject':{'type':Sequelize[_0x1128('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1128('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1128('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1128('0xd')],'get':function(){return this[_0x1128('0xe')](_0x1128('0xf'))+_0x1128('0x10')+this[_0x1128('0xe')](_0x1128('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7baf389..484a434 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 _0xa478=['UserProfileResource','destroy','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','catch','error','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Voicemails'];(function(_0x4481b6,_0x434b8e){var _0xdeb660=function(_0x22e6ec){while(--_0x22e6ec){_0x4481b6['push'](_0x4481b6['shift']());}};_0xdeb660(++_0x434b8e);}(_0xa478,0x136));var _0x8a47=function(_0x6b6340,_0x6302c4){_0x6b6340=_0x6b6340-0x0;var _0x3609bf=_0xa478[_0x6b6340];return _0x3609bf;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){var _0xf46d2c=_0x50f6ba[_0x8a47('0x28')]({'plain':!![]});var _0x5bed3e=_0x8a47('0x29');return db[_0x8a47('0x2a')][_0x8a47('0x2b')]({'where':{'type':_0x5bed3e,'resourceId':_0xf46d2c['id']}})[_0x8a47('0x27')](function(){return _0x50f6ba;});})[_0x8a47('0x27')](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x576fb3,_0x22a52f){return function(_0x4a10c3){if(!_0x4a10c3){_0x576fb3[_0x8a47('0x1a')](0x194);}return _0x4a10c3;};}function handleError(_0x3a8685,_0x54d4b2){_0x54d4b2=_0x54d4b2||0x1f4;return function(_0x1e89b1){logger['error'](_0x1e89b1['stack']);if(_0x1e89b1[_0x8a47('0x2c')]){delete _0x1e89b1[_0x8a47('0x2c')];}_0x3a8685[_0x8a47('0x1c')](_0x54d4b2)[_0x8a47('0x2d')](_0x1e89b1);};}exports[_0x8a47('0x2e')]=function(_0x18bfd3,_0x58aa06){var _0x353576={},_0x4d78b5={},_0x549913={'count':0x0,'rows':[]};var _0x448459=_[_0x8a47('0x2f')](db[_0x8a47('0x30')][_0x8a47('0x31')],function(_0x16e024){return{'name':_0x16e024[_0x8a47('0x32')],'type':_0x16e024[_0x8a47('0x33')][_0x8a47('0x34')]};});_0x4d78b5[_0x8a47('0x35')]=_[_0x8a47('0x2f')](_0x448459,'name');_0x4d78b5[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x18bfd3[_0x8a47('0x36')]);_0x4d78b5['filters']=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],_0x4d78b5['query']);_0x353576[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x18bfd3['query']['fields']));_0x353576[_0x8a47('0x39')]=_0x353576[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x353576[_0x8a47('0x39')]:_0x4d78b5[_0x8a47('0x35')];if(!_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x353576['limit']=qs[_0x8a47('0x20')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x20')]);_0x353576[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x353576[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x353576['where']=qs[_0x8a47('0x3f')](_['pick'](_0x18bfd3['query'],_0x4d78b5['filters']),_0x448459);if(_0x18bfd3['query']['filter']){_0x353576[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x353576[_0x8a47('0x40')],{'$or':_[_0x8a47('0x2f')](_0x448459,function(_0x10c483){if(_0x10c483[_0x8a47('0x33')]!==_0x8a47('0x42')){var _0x29beee={};_0x29beee[_0x10c483['name']]={'$like':'%'+_0x18bfd3['query'][_0x8a47('0x43')]+'%'};return _0x29beee;}})});}_0x353576=_[_0x8a47('0x41')]({},_0x353576,_0x18bfd3[_0x8a47('0x44')]);var _0x19298d={'where':_0x353576['where']};return db[_0x8a47('0x30')][_0x8a47('0x21')](_0x19298d)[_0x8a47('0x27')](function(_0x369dd5){_0x549913[_0x8a47('0x21')]=_0x369dd5;if(_0x18bfd3['query'][_0x8a47('0x45')]){_0x353576[_0x8a47('0x46')]=[{'all':!![]}];}return db[_0x8a47('0x30')]['findAll'](_0x353576);})[_0x8a47('0x27')](function(_0x2c70ea){_0x549913[_0x8a47('0x47')]=_0x2c70ea;return _0x549913;})[_0x8a47('0x27')](respondWithFilteredResult(_0x58aa06,_0x353576))['catch'](handleError(_0x58aa06,null));};exports[_0x8a47('0x48')]=function(_0x2f523f,_0x2fa701){var _0x2e2520={'raw':!![],'where':{'id':_0x2f523f[_0x8a47('0x49')]['id']}},_0x22b0d6={};_0x22b0d6['model']=_['keys'](db[_0x8a47('0x30')][_0x8a47('0x31')]);_0x22b0d6[_0x8a47('0x36')]=_['keys'](_0x2f523f[_0x8a47('0x36')]);_0x22b0d6[_0x8a47('0x3f')]=_['intersection'](_0x22b0d6['model'],_0x22b0d6[_0x8a47('0x36')]);_0x2e2520['attributes']=_[_0x8a47('0x38')](_0x22b0d6[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2f523f[_0x8a47('0x36')][_0x8a47('0x3a')]));_0x2e2520[_0x8a47('0x39')]=_0x2e2520['attributes']['length']?_0x2e2520[_0x8a47('0x39')]:_0x22b0d6[_0x8a47('0x35')];if(_0x2f523f[_0x8a47('0x36')][_0x8a47('0x45')]){_0x2e2520[_0x8a47('0x46')]=[{'all':!![]}];}_0x2e2520=_['merge']({},_0x2e2520,_0x2f523f['options']);return db[_0x8a47('0x30')]['find'](_0x2e2520)[_0x8a47('0x27')](handleEntityNotFound(_0x2fa701,null))[_0x8a47('0x27')](respondWithResult(_0x2fa701,null))['catch'](handleError(_0x2fa701,null));};exports[_0x8a47('0x4a')]=function(_0x237ed1,_0x14e22c){return db[_0x8a47('0x30')][_0x8a47('0x4a')](_0x237ed1[_0x8a47('0x4b')],{})[_0x8a47('0x27')](function(_0x2d2455){var _0x512938=_0x237ed1[_0x8a47('0x4c')][_0x8a47('0x28')]({'plain':!![]});if(!_0x512938)throw new Error(_0x8a47('0x4d'));if(_0x512938[_0x8a47('0x4e')]==='user'){var _0x11db4e=_0x2d2455[_0x8a47('0x28')]({'plain':!![]});var _0x24e123=_0x8a47('0x29');return db[_0x8a47('0x4f')][_0x8a47('0x50')]({'where':{'name':_0x24e123,'userProfileId':_0x512938['userProfileId']},'raw':!![]})['then'](function(_0x456cfb){if(_0x456cfb&&_0x456cfb['autoAssociation']===0x0){return db[_0x8a47('0x2a')][_0x8a47('0x4a')]({'name':_0x11db4e['name'],'resourceId':_0x11db4e['id'],'type':_0x456cfb[_0x8a47('0x2c')],'sectionId':_0x456cfb['id']},{})['then'](function(){return _0x2d2455;});}else{return _0x2d2455;}})[_0x8a47('0x51')](function(_0x5c5577){logger[_0x8a47('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5577);throw _0x5c5577;});}return _0x2d2455;})[_0x8a47('0x27')](respondWithResult(_0x14e22c,0xc9))[_0x8a47('0x51')](handleError(_0x14e22c,null));};exports[_0x8a47('0x26')]=function(_0x144ce6,_0x4590ae){if(_0x144ce6[_0x8a47('0x4b')]['id']){delete _0x144ce6[_0x8a47('0x4b')]['id'];}return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x144ce6[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x4590ae,null))['then'](saveUpdates(_0x144ce6[_0x8a47('0x4b')],null))[_0x8a47('0x27')](respondWithResult(_0x4590ae,null))['catch'](handleError(_0x4590ae,null));};exports[_0x8a47('0x2b')]=function(_0x408ce2,_0x436c27){return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x408ce2[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x436c27,null))[_0x8a47('0x27')](removeEntity(_0x436c27,null))[_0x8a47('0x51')](handleError(_0x436c27,null));};exports[_0x8a47('0x53')]=function(_0x2100cb,_0x385087,_0x5f448e){return db[_0x8a47('0x30')][_0x8a47('0x54')]({'where':{'id':_0x2100cb[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x385087,null))[_0x8a47('0x27')](function(_0x6c2f83){var _0x134fc5;var _0x3242b7={},_0x41cc36={};_0x41cc36[_0x8a47('0x35')]=_[_0x8a47('0x37')](db[_0x8a47('0x55')][_0x8a47('0x31')]);_0x41cc36[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x2100cb[_0x8a47('0x36')]);_0x41cc36['filters']=_[_0x8a47('0x38')](_0x41cc36['model'],_0x41cc36[_0x8a47('0x36')]);_0x3242b7[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x41cc36[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2100cb[_0x8a47('0x36')]['fields']));_0x3242b7[_0x8a47('0x39')]=_0x3242b7[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x3242b7['attributes']:_0x41cc36['model'];if(!_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x3242b7[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x20')]);_0x3242b7[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x3242b7[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x3242b7[_0x8a47('0x40')]=qs['filters'](_[_0x8a47('0x56')](_0x2100cb[_0x8a47('0x36')],_0x41cc36[_0x8a47('0x3f')]));if(_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]){_0x3242b7[_0x8a47('0x40')]=_['merge'](_0x3242b7[_0x8a47('0x40')],{'$or':_['map'](_0x3242b7['attributes'],function(_0x400c4e){var _0x439172={};_0x439172[_0x400c4e]={'$like':'%'+_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]+'%'};return _0x439172;})});}_0x3242b7[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x3242b7['where'],{'mailboxuser':_0x6c2f83['mailbox']});_0x3242b7=_[_0x8a47('0x41')]({},_0x3242b7,_0x2100cb['options']);return db[_0x8a47('0x55')][_0x8a47('0x57')](_0x3242b7)[_0x8a47('0x27')](respondWithFilteredResult(_0x385087,_0x3242b7));})[_0x8a47('0x51')](handleError(_0x385087,null));}; \ No newline at end of file +var _0x76dc=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','VoiceMail','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','rawAttributes','sort','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x76dc,0x1f2));var _0xc76d=function(_0x427a39,_0x52d1fa){_0x427a39=_0x427a39-0x0;var _0x228119=_0x76dc[_0x427a39];return _0x228119;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['VoiceMail']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['VoiceMail']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['VoiceMail']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));};exports[_0xc76d('0x4f')]=function(_0x49105d,_0x5f3973,_0x1e9461){return db['VoiceMail'][_0xc76d('0x50')]({'where':{'id':_0x49105d[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x5f3973,null))[_0xc76d('0x24')](function(_0x254128){var _0x4746a5;var _0x106c85={},_0x1db7bc={};_0x1db7bc[_0xc76d('0x31')]=_[_0xc76d('0x2f')](db[_0xc76d('0x51')][_0xc76d('0x52')]);_0x1db7bc[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x49105d['query']);_0x1db7bc[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1db7bc[_0xc76d('0x31')],_0x1db7bc[_0xc76d('0x2e')]);_0x106c85[_0xc76d('0x32')]=_['intersection'](_0x1db7bc[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x49105d['query']['fields']));_0x106c85['attributes']=_0x106c85[_0xc76d('0x32')][_0xc76d('0x34')]?_0x106c85[_0xc76d('0x32')]:_0x1db7bc[_0xc76d('0x31')];if(!_0x49105d[_0xc76d('0x2e')][_0xc76d('0x35')](_0xc76d('0x36'))){_0x106c85[_0xc76d('0x1d')]=qs['limit'](_0x49105d[_0xc76d('0x2e')]['limit']);_0x106c85['offset']=qs[_0xc76d('0x1c')](_0x49105d[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x106c85['order']=qs[_0xc76d('0x53')](_0x49105d['query']['sort']);_0x106c85['where']=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x49105d['query'],_0x1db7bc[_0xc76d('0x30')]));if(_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]){_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x106c85['attributes'],function(_0x5035fd){var _0x4c523f={};_0x4c523f[_0x5035fd]={'$like':'%'+_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x4c523f;})});}_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'mailboxuser':_0x254128['mailbox']});_0x106c85=_[_0xc76d('0x3a')]({},_0x106c85,_0x49105d[_0xc76d('0x3e')]);return db[_0xc76d('0x51')][_0xc76d('0x54')](_0x106c85)[_0xc76d('0x24')](respondWithFilteredResult(_0x5f3973,_0x106c85));})[_0xc76d('0x41')](handleError(_0x5f3973,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8c5c7e5..a9de36b 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 _0x6277=['../../config/environment','exports','define','VoiceMail','voice_voicemail','context','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3aee2d,_0x26d125){var _0x47700f=function(_0x46cb26){while(--_0x46cb26){_0x3aee2d['push'](_0x3aee2d['shift']());}};_0x47700f(++_0x26d125);}(_0x6277,0x92));var _0x7627=function(_0x5e524e,_0x3804ad){_0x5e524e=_0x5e524e-0x0;var _0x59b93e=_0x6277[_0x5e524e];return _0x59b93e;};'use strict';var _=require(_0x7627('0x0'));var util=require(_0x7627('0x1'));var logger=require('../../config/logger')(_0x7627('0x2'));var moment=require(_0x7627('0x3'));var BPromise=require(_0x7627('0x4'));var rp=require(_0x7627('0x5'));var fs=require('fs');var path=require(_0x7627('0x6'));var rimraf=require(_0x7627('0x7'));var config=require(_0x7627('0x8'));var attributes=require('./voiceMail.attributes');module[_0x7627('0x9')]=function(_0x227dd7,_0xa3e9d2){return _0x227dd7[_0x7627('0xa')](_0x7627('0xb'),attributes,{'tableName':_0x7627('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x7627('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89a9=['./voiceMail.attributes','define','voice_voicemail','mailbox_context','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x9f0dea,_0x5df611){var _0x102e5a=function(_0x4688c4){while(--_0x4688c4){_0x9f0dea['push'](_0x9f0dea['shift']());}};_0x102e5a(++_0x5df611);}(_0x89a9,0x130));var _0x989a=function(_0x3b5a1e,_0x310331){_0x3b5a1e=_0x3b5a1e-0x0;var _0x57c551=_0x89a9[_0x3b5a1e];return _0x57c551;};'use strict';var _=require(_0x989a('0x0'));var util=require(_0x989a('0x1'));var logger=require(_0x989a('0x2'))('api');var moment=require(_0x989a('0x3'));var BPromise=require(_0x989a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x989a('0x5'));var rimraf=require(_0x989a('0x6'));var config=require(_0x989a('0x7'));var attributes=require(_0x989a('0x8'));module['exports']=function(_0x3cefd4,_0x14d846){return _0x3cefd4[_0x989a('0x9')]('VoiceMail',attributes,{'tableName':_0x989a('0xa'),'paranoid':![],'indexes':[{'name':_0x989a('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3380b44..5b65741 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 _0x6cfd=['VoiceMail,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x6cfd,0xc1));var _0xd6cf=function(_0x32f12f,_0x80cb37){_0x32f12f=_0x32f12f-0x0;var _0x2e9164=_0x6cfd[_0x32f12f];return _0x2e9164;};'use strict';var _=require(_0xd6cf('0x0'));var util=require(_0xd6cf('0x1'));var moment=require(_0xd6cf('0x2'));var BPromise=require(_0xd6cf('0x3'));var rs=require(_0xd6cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd6cf('0x6'));var jayson=require(_0xd6cf('0x7'));var client=jayson[_0xd6cf('0x8')][_0xd6cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f656e,_0x15c7a4,_0x29cdbb){return new BPromise(function(_0x3828f4,_0x3f9a6d){return client[_0xd6cf('0xa')](_0x3f656e,_0x29cdbb)[_0xd6cf('0xb')](function(_0x4d526c){logger['info']('VoiceMail,\x20%s,\x20%s',_0x15c7a4,_0xd6cf('0xc'));logger[_0xd6cf('0xd')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x15c7a4,_0xd6cf('0xc'),JSON['stringify'](_0x4d526c));if(_0x4d526c[_0xd6cf('0xe')]){if(_0x4d526c[_0xd6cf('0xe')][_0xd6cf('0xf')]===0x1f4){logger[_0xd6cf('0xe')](_0xd6cf('0x10'),_0x15c7a4,_0x4d526c[_0xd6cf('0xe')]['message']);return _0x3f9a6d(_0x4d526c[_0xd6cf('0xe')][_0xd6cf('0x11')]);}logger[_0xd6cf('0xe')]('VoiceMail,\x20%s,\x20%s',_0x15c7a4,_0x4d526c[_0xd6cf('0xe')][_0xd6cf('0x11')]);return _0x3828f4(_0x4d526c['error'][_0xd6cf('0x11')]);}else{logger[_0xd6cf('0x12')](_0xd6cf('0x10'),_0x15c7a4,_0xd6cf('0xc'));_0x3828f4(_0x4d526c['result'][_0xd6cf('0x11')]);}})['catch'](function(_0x153dd7){logger[_0xd6cf('0xe')](_0xd6cf('0x10'),_0x15c7a4,_0x153dd7);_0x3f9a6d(_0x153dd7);});});} \ No newline at end of file +var _0x61d2=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x469cc6,_0x1df7ea){var _0x3f37c2=function(_0x4ada32){while(--_0x4ada32){_0x469cc6['push'](_0x469cc6['shift']());}};_0x3f37c2(++_0x1df7ea);}(_0x61d2,0x89));var _0x261d=function(_0x3b291a,_0x4e4263){_0x3b291a=_0x3b291a-0x0;var _0x25d794=_0x61d2[_0x3b291a];return _0x25d794;};'use strict';var _=require(_0x261d('0x0'));var util=require(_0x261d('0x1'));var moment=require(_0x261d('0x2'));var BPromise=require(_0x261d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x261d('0x4'));var db=require(_0x261d('0x5'))['db'];var utils=require(_0x261d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x261d('0x7')][_0x261d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f81a,_0x55984f,_0x315876){return new BPromise(function(_0x386b02,_0x4afea5){return client[_0x261d('0x9')](_0x39f81a,_0x315876)[_0x261d('0xa')](function(_0x2d778a){logger['info'](_0x261d('0xb'),_0x55984f,_0x261d('0xc'));logger[_0x261d('0xd')](_0x261d('0xe'),_0x55984f,_0x261d('0xc'),JSON['stringify'](_0x2d778a));if(_0x2d778a[_0x261d('0xf')]){if(_0x2d778a[_0x261d('0xf')]['code']===0x1f4){logger[_0x261d('0xf')]('VoiceMail,\x20%s,\x20%s',_0x55984f,_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);return _0x4afea5(_0x2d778a['error'][_0x261d('0x10')]);}logger['error'](_0x261d('0xb'),_0x55984f,_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);return _0x386b02(_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);}else{logger['info'](_0x261d('0xb'),_0x55984f,_0x261d('0xc'));_0x386b02(_0x2d778a[_0x261d('0x11')][_0x261d('0x10')]);}})[_0x261d('0x12')](function(_0x545cc7){logger[_0x261d('0xf')]('VoiceMail,\x20%s,\x20%s',_0x55984f,_0x545cc7);_0x4afea5(_0x545cc7);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index dc0df4b..4b8cf36 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 _0x90f9=['isAuthenticated','/:id/download','download','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id'];(function(_0x454614,_0x35eb8c){var _0x207cd9=function(_0x28fbb4){while(--_0x28fbb4){_0x454614['push'](_0x454614['shift']());}};_0x207cd9(++_0x35eb8c);}(_0x90f9,0x170));var _0x990f=function(_0x1ae73a,_0x4bb646){_0x1ae73a=_0x1ae73a-0x0;var _0x346f27=_0x90f9[_0x1ae73a];return _0x346f27;};'use strict';var multer=require(_0x990f('0x0'));var util=require(_0x990f('0x1'));var path=require('path');var timeout=require(_0x990f('0x2'));var express=require(_0x990f('0x3'));var router=express[_0x990f('0x4')]();var fs_extra=require(_0x990f('0x5'));var auth=require(_0x990f('0x6'));var interaction=require(_0x990f('0x7'));var config=require('../../config/environment');var controller=require(_0x990f('0x8'));router[_0x990f('0x9')]('/',auth['isAuthenticated'](),controller[_0x990f('0xa')]);router[_0x990f('0x9')](_0x990f('0xb'),auth[_0x990f('0xc')](),controller['show']);router[_0x990f('0x9')](_0x990f('0xd'),auth[_0x990f('0xc')](),controller[_0x990f('0xe')]);router[_0x990f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x990f('0x10')](_0x990f('0xb'),auth[_0x990f('0xc')](),controller[_0x990f('0x11')]);router[_0x990f('0x12')](_0x990f('0xb'),auth[_0x990f('0xc')](),controller[_0x990f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe0de=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','create','put'];(function(_0x190c15,_0x38da10){var _0x40d695=function(_0x460f7a){while(--_0x460f7a){_0x190c15['push'](_0x190c15['shift']());}};_0x40d695(++_0x38da10);}(_0xe0de,0x148));var _0xee0d=function(_0x2a568d,_0x46a24f){_0x2a568d=_0x2a568d-0x0;var _0xcb43ab=_0xe0de[_0x2a568d];return _0xcb43ab;};'use strict';var multer=require(_0xee0d('0x0'));var util=require('util');var path=require(_0xee0d('0x1'));var timeout=require(_0xee0d('0x2'));var express=require(_0xee0d('0x3'));var router=express[_0xee0d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee0d('0x5'));var controller=require('./voiceMailMessage.controller');router[_0xee0d('0x6')]('/',auth[_0xee0d('0x7')](),controller[_0xee0d('0x8')]);router['get'](_0xee0d('0x9'),auth['isAuthenticated'](),controller[_0xee0d('0xa')]);router[_0xee0d('0x6')](_0xee0d('0xb'),auth[_0xee0d('0x7')](),controller['download']);router['post']('/',auth[_0xee0d('0x7')](),controller[_0xee0d('0xc')]);router[_0xee0d('0xd')](_0xee0d('0x9'),auth[_0xee0d('0x7')](),controller[_0xee0d('0xe')]);router[_0xee0d('0xf')](_0xee0d('0x9'),auth[_0xee0d('0x7')](),controller[_0xee0d('0x10')]);module[_0xee0d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6e4fc2a..8e56134 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 _0x44f2=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x44f2,0x86));var _0x244f=function(_0x140357,_0x6670bd){_0x140357=_0x140357-0x0;var _0x4fdf00=_0x44f2[_0x140357];return _0x4fdf00;};'use strict';var Sequelize=require(_0x244f('0x0'));module[_0x244f('0x1')]={'name':{'type':Sequelize[_0x244f('0x2')],'get':function(_0x37cd35){return this[_0x244f('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x244f('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x244f('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x244f('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x244f('0x7')](_0x244f('0x8'))}}; \ No newline at end of file +var _0xe9ae=['VIRTUAL','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x3762d0,_0x3aecd0){var _0x50b20a=function(_0x47c5fc){while(--_0x47c5fc){_0x3762d0['push'](_0x3762d0['shift']());}};_0x50b20a(++_0x3aecd0);}(_0xe9ae,0x136));var _0xee9a=function(_0x27a883,_0x43680f){_0x27a883=_0x27a883-0x0;var _0x432e29=_0xe9ae[_0x27a883];return _0x432e29;};'use strict';var Sequelize=require(_0xee9a('0x0'));module[_0xee9a('0x1')]={'name':{'type':Sequelize[_0xee9a('0x2')],'get':function(_0x494b7e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xee9a('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xee9a('0x5'),'defaultValue':Sequelize[_0xee9a('0x6')](_0xee9a('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fd0f925..6bf5c4e 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 _0x060c=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','rimraf','fast-json-patch','moment','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xab8668,_0x5204ac){var _0x571c10=function(_0x4ed488){while(--_0x4ed488){_0xab8668['push'](_0xab8668['shift']());}};_0x571c10(++_0x5204ac);}(_0x060c,0xf4));var _0xc060=function(_0x52015c,_0x1edced){_0x52015c=_0x52015c-0x0;var _0x354acc=_0x060c[_0x52015c];return _0x354acc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc060('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc060('0x1'));var rp=require('request-promise');var moment=require(_0xc060('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc060('0x3'));var util=require('util');var path=require('path');var sox=require(_0xc060('0x4'));var csv=require('to-csv');var ejs=require(_0xc060('0x5'));var fs=require('fs');var fs_extra=require(_0xc060('0x6'));var _=require('lodash');var squel=require(_0xc060('0x7'));var crypto=require(_0xc060('0x8'));var jsforce=require(_0xc060('0x9'));var deskjs=require(_0xc060('0xa'));var toCsv=require(_0xc060('0xb'));var querystring=require('querystring');var Papa=require(_0xc060('0xc'));var Redis=require(_0xc060('0xd'));var authService=require(_0xc060('0xe'));var qs=require(_0xc060('0xf'));var as=require(_0xc060('0x10'));var hardwareService=require(_0xc060('0x11'));var logger=require(_0xc060('0x12'))(_0xc060('0x13'));var utils=require('../../config/utils');var config=require(_0xc060('0x14'));var licenseUtil=require(_0xc060('0x15'));var db=require(_0xc060('0x16'))['db'];function respondWithStatusCode(_0x3bcacc,_0x4a8dd7){_0x4a8dd7=_0x4a8dd7||0xcc;return function(_0x3c01e8){if(_0x3c01e8){return _0x3bcacc[_0xc060('0x17')](_0x4a8dd7);}return _0x3bcacc[_0xc060('0x18')](_0x4a8dd7)['end']();};}function respondWithResult(_0x231725,_0xf7bb9a){_0xf7bb9a=_0xf7bb9a||0xc8;return function(_0x326c20){if(_0x326c20){return _0x231725[_0xc060('0x18')](_0xf7bb9a)[_0xc060('0x19')](_0x326c20);}};}function respondWithFilteredResult(_0x54c8b8,_0xa9dfed){return function(_0x27bfa6){if(_0x27bfa6){var _0x474e6a=typeof _0xa9dfed[_0xc060('0x1a')]===_0xc060('0x1b')&&typeof _0xa9dfed['limit']===_0xc060('0x1b');var _0x445dc6=_0x27bfa6[_0xc060('0x1c')];var _0x45da9c=_0x474e6a?0x0:_0xa9dfed[_0xc060('0x1a')];var _0x3f96c0=_0x474e6a?_0x27bfa6[_0xc060('0x1c')]:_0xa9dfed[_0xc060('0x1a')]+_0xa9dfed[_0xc060('0x1d')];var _0x852e21;if(_0x3f96c0>=_0x445dc6){_0x3f96c0=_0x445dc6;_0x852e21=0xc8;}else{_0x852e21=0xce;}_0x54c8b8[_0xc060('0x18')](_0x852e21);return _0x54c8b8[_0xc060('0x1e')](_0xc060('0x1f'),_0x45da9c+'-'+_0x3f96c0+'/'+_0x445dc6)['json'](_0x27bfa6);}return null;};}function patchUpdates(_0x40a90a){return function(_0x395e11){try{jsonpatch[_0xc060('0x20')](_0x395e11,_0x40a90a,!![]);}catch(_0x29926b){return BPromise[_0xc060('0x21')](_0x29926b);}return _0x395e11[_0xc060('0x22')]();};}function saveUpdates(_0x3b2281,_0x559e7d){return function(_0x4fadc1){if(_0x4fadc1){return _0x4fadc1[_0xc060('0x23')](_0x3b2281)[_0xc060('0x24')](function(_0x1ce8c0){return _0x1ce8c0;});}return null;};}function removeEntity(_0x145c30,_0x1360b0){return function(_0x3e7a5c){if(_0x3e7a5c){return _0x3e7a5c[_0xc060('0x25')]()[_0xc060('0x24')](function(){_0x145c30['status'](0xcc)[_0xc060('0x26')]();});}};}function handleEntityNotFound(_0x5d44a7,_0x58789a){return function(_0xcfdaf8){if(!_0xcfdaf8){_0x5d44a7[_0xc060('0x17')](0x194);}return _0xcfdaf8;};}function handleError(_0x239228,_0x2b1363){_0x2b1363=_0x2b1363||0x1f4;return function(_0x5b7e24){logger['error'](_0x5b7e24[_0xc060('0x27')]);if(_0x5b7e24['name']){delete _0x5b7e24[_0xc060('0x28')];}_0x239228[_0xc060('0x18')](_0x2b1363)[_0xc060('0x29')](_0x5b7e24);};}exports[_0xc060('0x2a')]=function(_0x5b522c,_0x384b79){var _0x34689b={},_0x29e442={},_0x140f54={'count':0x0,'rows':[]};var _0x3cc04a=_[_0xc060('0x2b')](db[_0xc060('0x2c')][_0xc060('0x2d')],function(_0x34791f){return{'name':_0x34791f[_0xc060('0x2e')],'type':_0x34791f['type'][_0xc060('0x2f')]};});_0x29e442[_0xc060('0x30')]=_[_0xc060('0x31')](_[_0xc060('0x2b')](_0x3cc04a,_0xc060('0x28')),[_0xc060('0x28')]);_0x29e442[_0xc060('0x32')]=_[_0xc060('0x33')](_0x5b522c[_0xc060('0x32')]);_0x29e442[_0xc060('0x34')]=_[_0xc060('0x35')](_0x29e442['model'],_0x29e442[_0xc060('0x32')]);_0x34689b[_0xc060('0x36')]=_[_0xc060('0x35')](_0x29e442[_0xc060('0x30')],qs['fields'](_0x5b522c['query'][_0xc060('0x37')]));_0x34689b['attributes']=_0x34689b[_0xc060('0x36')][_0xc060('0x38')]?_0x34689b[_0xc060('0x36')]:_0x29e442[_0xc060('0x30')];if(!_0x5b522c[_0xc060('0x32')][_0xc060('0x39')](_0xc060('0x3a'))){_0x34689b['limit']=qs[_0xc060('0x1d')](_0x5b522c['query'][_0xc060('0x1d')]);_0x34689b[_0xc060('0x1a')]=qs[_0xc060('0x1a')](_0x5b522c[_0xc060('0x32')][_0xc060('0x1a')]);}_0x34689b[_0xc060('0x3b')]=qs[_0xc060('0x3c')](_0x5b522c['query'][_0xc060('0x3c')]);_0x34689b['where']=qs['filters'](_[_0xc060('0x3d')](_0x5b522c['query'],_0x29e442[_0xc060('0x34')]),_0x3cc04a);if(_0x5b522c['query'][_0xc060('0x3e')]){_0x34689b[_0xc060('0x3f')]=_[_0xc060('0x40')](_0x34689b[_0xc060('0x3f')],{'$or':_[_0xc060('0x2b')](_0x3cc04a,function(_0x5022da){if(_0x5022da[_0xc060('0x41')]!==_0xc060('0x42')){var _0x4e1c4b={};_0x4e1c4b[_0x5022da[_0xc060('0x28')]]={'$like':'%'+_0x5b522c['query'][_0xc060('0x3e')]+'%'};return _0x4e1c4b;}})});}_0x34689b=_[_0xc060('0x40')]({},_0x34689b,_0x5b522c[_0xc060('0x43')]);var _0x3abe17={'where':_0x34689b[_0xc060('0x3f')]};return db[_0xc060('0x2c')][_0xc060('0x1c')](_0x3abe17)[_0xc060('0x24')](function(_0x253213){_0x140f54[_0xc060('0x1c')]=_0x253213;if(_0x5b522c['query'][_0xc060('0x44')]){_0x34689b[_0xc060('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xc060('0x46')](_0x34689b);})['then'](function(_0x1c100c){_0x140f54['rows']=_0x1c100c;return _0x140f54;})[_0xc060('0x24')](respondWithFilteredResult(_0x384b79,_0x34689b))[_0xc060('0x47')](handleError(_0x384b79,null));};exports[_0xc060('0x48')]=function(_0x140a9e,_0x2c0a85){var _0x4bda30={'raw':!![],'where':{'id':_0x140a9e[_0xc060('0x49')]['id']}},_0x3a83f0={};_0x3a83f0[_0xc060('0x30')]=_[_0xc060('0x33')](db[_0xc060('0x2c')]['rawAttributes']);_0x3a83f0[_0xc060('0x32')]=_['keys'](_0x140a9e[_0xc060('0x32')]);_0x3a83f0[_0xc060('0x34')]=_[_0xc060('0x35')](_0x3a83f0['model'],_0x3a83f0[_0xc060('0x32')]);_0x4bda30[_0xc060('0x36')]=_[_0xc060('0x35')](_0x3a83f0[_0xc060('0x30')],qs['fields'](_0x140a9e['query']['fields']));_0x4bda30[_0xc060('0x36')]=_0x4bda30[_0xc060('0x36')][_0xc060('0x38')]?_0x4bda30[_0xc060('0x36')]:_0x3a83f0['model'];if(_0x140a9e['query'][_0xc060('0x44')]){_0x4bda30[_0xc060('0x45')]=[{'all':!![]}];}_0x4bda30=_['merge']({},_0x4bda30,_0x140a9e['options']);return db[_0xc060('0x2c')]['find'](_0x4bda30)['then'](handleEntityNotFound(_0x2c0a85,null))['then'](respondWithResult(_0x2c0a85,null))[_0xc060('0x47')](handleError(_0x2c0a85,null));};exports[_0xc060('0x4a')]=function(_0x2a8317,_0x506b1a){return db[_0xc060('0x2c')]['create'](_0x2a8317[_0xc060('0x4b')],{})[_0xc060('0x24')](respondWithResult(_0x506b1a,0xc9))[_0xc060('0x47')](handleError(_0x506b1a,null));};exports[_0xc060('0x23')]=function(_0x170d0a,_0x224aa4){if(_0x170d0a[_0xc060('0x4b')]['id']){delete _0x170d0a[_0xc060('0x4b')]['id'];}return db[_0xc060('0x2c')][_0xc060('0x4c')]({'where':{'id':_0x170d0a[_0xc060('0x49')]['id']}})[_0xc060('0x24')](handleEntityNotFound(_0x224aa4,null))['then'](saveUpdates(_0x170d0a[_0xc060('0x4b')],null))[_0xc060('0x24')](respondWithResult(_0x224aa4,null))[_0xc060('0x47')](handleError(_0x224aa4,null));};exports[_0xc060('0x25')]=function(_0x2b4ad5,_0x441b23){return db[_0xc060('0x2c')][_0xc060('0x4c')]({'where':{'id':_0x2b4ad5['params']['id']}})[_0xc060('0x24')](handleEntityNotFound(_0x441b23,null))[_0xc060('0x24')](removeEntity(_0x441b23,null))[_0xc060('0x47')](handleError(_0x441b23,null));};exports[_0xc060('0x4d')]=function(_0xdd12c1,_0x503429,_0x369c0e){return db[_0xc060('0x2c')][_0xc060('0x4c')]({'where':{'id':_0xdd12c1['params']['id']},'attributes':['id',_0xc060('0x4e'),_0xc060('0x4f')]})['then'](handleEntityNotFound(_0x503429,null))['then'](function(_0x4cc9a8){if(_0x4cc9a8){if(!_0x4cc9a8[_0xc060('0x4e')]){throw new db[(_0xc060('0x50'))][(_0xc060('0x51'))](_0xc060('0x52'));}var _0x4adef9={'Content-Type':_0xc060('0x53'),'Content-Disposition':_0xc060('0x54')};if(_0x4cc9a8['msg_id']){_0x4adef9[_0xc060('0x55')]='attachment;\x20filename=\x22'+_0x4cc9a8[_0xc060('0x4f')]+_0xc060('0x56');}_0x503429[_0xc060('0x1e')](_0x4adef9);return _0x503429[_0xc060('0x29')](new Buffer(_0x4cc9a8[_0xc060('0x4e')]));}})[_0xc060('0x47')](handleError(_0x503429,null));}; \ No newline at end of file +var _0x73c4=['ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','keys','length','find','create','body','params','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x13ae89,_0x832c38){var _0x1744a0=function(_0x4c406a){while(--_0x4c406a){_0x13ae89['push'](_0x13ae89['shift']());}};_0x1744a0(++_0x832c38);}(_0x73c4,0x97));var _0x473c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x73c4[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require(_0x473c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x473c('0x1'));var jsonpatch=require(_0x473c('0x2'));var rp=require(_0x473c('0x3'));var moment=require(_0x473c('0x4'));var BPromise=require(_0x473c('0x5'));var Mustache=require(_0x473c('0x6'));var util=require(_0x473c('0x7'));var path=require(_0x473c('0x8'));var sox=require(_0x473c('0x9'));var csv=require(_0x473c('0xa'));var ejs=require(_0x473c('0xb'));var fs=require('fs');var fs_extra=require(_0x473c('0xc'));var _=require(_0x473c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x473c('0xe'));var toCsv=require(_0x473c('0xa'));var querystring=require('querystring');var Papa=require(_0x473c('0xf'));var Redis=require(_0x473c('0x10'));var authService=require(_0x473c('0x11'));var qs=require(_0x473c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x473c('0x13'));var logger=require(_0x473c('0x14'))(_0x473c('0x15'));var utils=require(_0x473c('0x16'));var config=require(_0x473c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x473c('0x18'))['db'];function respondWithStatusCode(_0x41eebc,_0x66acba){_0x66acba=_0x66acba||0xcc;return function(_0x17c8f7){if(_0x17c8f7){return _0x41eebc[_0x473c('0x19')](_0x66acba);}return _0x41eebc[_0x473c('0x1a')](_0x66acba)[_0x473c('0x1b')]();};}function respondWithResult(_0x56aaa0,_0x53dd32){_0x53dd32=_0x53dd32||0xc8;return function(_0x5ccf43){if(_0x5ccf43){return _0x56aaa0[_0x473c('0x1a')](_0x53dd32)[_0x473c('0x1c')](_0x5ccf43);}};}function respondWithFilteredResult(_0x3d0362,_0x1be25c){return function(_0x5df075){if(_0x5df075){var _0x387337=typeof _0x1be25c[_0x473c('0x1d')]===_0x473c('0x1e')&&typeof _0x1be25c[_0x473c('0x1f')]===_0x473c('0x1e');var _0x467962=_0x5df075['count'];var _0x1fb4ca=_0x387337?0x0:_0x1be25c[_0x473c('0x1d')];var _0x24c97e=_0x387337?_0x5df075[_0x473c('0x20')]:_0x1be25c[_0x473c('0x1d')]+_0x1be25c['limit'];var _0x52af1b;if(_0x24c97e>=_0x467962){_0x24c97e=_0x467962;_0x52af1b=0xc8;}else{_0x52af1b=0xce;}_0x3d0362[_0x473c('0x1a')](_0x52af1b);return _0x3d0362['set'](_0x473c('0x21'),_0x1fb4ca+'-'+_0x24c97e+'/'+_0x467962)['json'](_0x5df075);}return null;};}function patchUpdates(_0x464e4f){return function(_0x1e0367){try{jsonpatch[_0x473c('0x22')](_0x1e0367,_0x464e4f,!![]);}catch(_0x4b6371){return BPromise[_0x473c('0x23')](_0x4b6371);}return _0x1e0367[_0x473c('0x24')]();};}function saveUpdates(_0x4e1a55,_0xdc3b10){return function(_0x545c2f){if(_0x545c2f){return _0x545c2f[_0x473c('0x25')](_0x4e1a55)[_0x473c('0x26')](function(_0x44528d){return _0x44528d;});}return null;};}function removeEntity(_0x46eaff,_0x16b0dc){return function(_0x2d24b7){if(_0x2d24b7){return _0x2d24b7['destroy']()[_0x473c('0x26')](function(){_0x46eaff[_0x473c('0x1a')](0xcc)[_0x473c('0x1b')]();});}};}function handleEntityNotFound(_0x386b40,_0x410e35){return function(_0x2405ad){if(!_0x2405ad){_0x386b40['sendStatus'](0x194);}return _0x2405ad;};}function handleError(_0x397a48,_0x5c47ed){_0x5c47ed=_0x5c47ed||0x1f4;return function(_0x27d8f9){logger[_0x473c('0x27')](_0x27d8f9['stack']);if(_0x27d8f9[_0x473c('0x28')]){delete _0x27d8f9[_0x473c('0x28')];}_0x397a48[_0x473c('0x1a')](_0x5c47ed)[_0x473c('0x29')](_0x27d8f9);};}exports[_0x473c('0x2a')]=function(_0x32ded9,_0x3e9951){var _0x3cf064={},_0x56dbad={},_0x14edcf={'count':0x0,'rows':[]};var _0x5206e3=_['map'](db[_0x473c('0x2b')][_0x473c('0x2c')],function(_0x2e981c){return{'name':_0x2e981c[_0x473c('0x2d')],'type':_0x2e981c[_0x473c('0x2e')][_0x473c('0x2f')]};});_0x56dbad[_0x473c('0x30')]=_['differenceBy'](_['map'](_0x5206e3,_0x473c('0x28')),['name']);_0x56dbad[_0x473c('0x31')]=_['keys'](_0x32ded9[_0x473c('0x31')]);_0x56dbad[_0x473c('0x32')]=_['intersection'](_0x56dbad[_0x473c('0x30')],_0x56dbad[_0x473c('0x31')]);_0x3cf064[_0x473c('0x33')]=_[_0x473c('0x34')](_0x56dbad[_0x473c('0x30')],qs[_0x473c('0x35')](_0x32ded9[_0x473c('0x31')][_0x473c('0x35')]));_0x3cf064['attributes']=_0x3cf064[_0x473c('0x33')]['length']?_0x3cf064[_0x473c('0x33')]:_0x56dbad[_0x473c('0x30')];if(!_0x32ded9[_0x473c('0x31')]['hasOwnProperty']('nolimit')){_0x3cf064['limit']=qs['limit'](_0x32ded9[_0x473c('0x31')][_0x473c('0x1f')]);_0x3cf064[_0x473c('0x1d')]=qs[_0x473c('0x1d')](_0x32ded9[_0x473c('0x31')][_0x473c('0x1d')]);}_0x3cf064[_0x473c('0x36')]=qs['sort'](_0x32ded9['query'][_0x473c('0x37')]);_0x3cf064['where']=qs[_0x473c('0x32')](_['pick'](_0x32ded9[_0x473c('0x31')],_0x56dbad[_0x473c('0x32')]),_0x5206e3);if(_0x32ded9[_0x473c('0x31')][_0x473c('0x38')]){_0x3cf064[_0x473c('0x39')]=_[_0x473c('0x3a')](_0x3cf064[_0x473c('0x39')],{'$or':_['map'](_0x5206e3,function(_0x452fca){if(_0x452fca[_0x473c('0x2e')]!==_0x473c('0x3b')){var _0x157ede={};_0x157ede[_0x452fca['name']]={'$like':'%'+_0x32ded9['query'][_0x473c('0x38')]+'%'};return _0x157ede;}})});}_0x3cf064=_['merge']({},_0x3cf064,_0x32ded9[_0x473c('0x3c')]);var _0x524807={'where':_0x3cf064['where']};return db[_0x473c('0x2b')][_0x473c('0x20')](_0x524807)[_0x473c('0x26')](function(_0x522bcd){_0x14edcf[_0x473c('0x20')]=_0x522bcd;if(_0x32ded9[_0x473c('0x31')][_0x473c('0x3d')]){_0x3cf064[_0x473c('0x3e')]=[{'all':!![]}];}return db[_0x473c('0x2b')][_0x473c('0x3f')](_0x3cf064);})['then'](function(_0x278ee1){_0x14edcf['rows']=_0x278ee1;return _0x14edcf;})[_0x473c('0x26')](respondWithFilteredResult(_0x3e9951,_0x3cf064))[_0x473c('0x40')](handleError(_0x3e9951,null));};exports['show']=function(_0x592afa,_0x3582a5){var _0x5d977a={'raw':!![],'where':{'id':_0x592afa['params']['id']}},_0x28d667={};_0x28d667[_0x473c('0x30')]=_[_0x473c('0x41')](db['VoiceMailMessage']['rawAttributes']);_0x28d667[_0x473c('0x31')]=_[_0x473c('0x41')](_0x592afa[_0x473c('0x31')]);_0x28d667[_0x473c('0x32')]=_['intersection'](_0x28d667[_0x473c('0x30')],_0x28d667[_0x473c('0x31')]);_0x5d977a[_0x473c('0x33')]=_[_0x473c('0x34')](_0x28d667[_0x473c('0x30')],qs['fields'](_0x592afa[_0x473c('0x31')][_0x473c('0x35')]));_0x5d977a['attributes']=_0x5d977a['attributes'][_0x473c('0x42')]?_0x5d977a['attributes']:_0x28d667[_0x473c('0x30')];if(_0x592afa[_0x473c('0x31')][_0x473c('0x3d')]){_0x5d977a['include']=[{'all':!![]}];}_0x5d977a=_[_0x473c('0x3a')]({},_0x5d977a,_0x592afa[_0x473c('0x3c')]);return db['VoiceMailMessage'][_0x473c('0x43')](_0x5d977a)[_0x473c('0x26')](handleEntityNotFound(_0x3582a5,null))[_0x473c('0x26')](respondWithResult(_0x3582a5,null))[_0x473c('0x40')](handleError(_0x3582a5,null));};exports[_0x473c('0x44')]=function(_0x560c8e,_0x31863b){return db['VoiceMailMessage'][_0x473c('0x44')](_0x560c8e['body'],{})[_0x473c('0x26')](respondWithResult(_0x31863b,0xc9))[_0x473c('0x40')](handleError(_0x31863b,null));};exports[_0x473c('0x25')]=function(_0x1e2ecf,_0x937b6b){if(_0x1e2ecf[_0x473c('0x45')]['id']){delete _0x1e2ecf['body']['id'];}return db[_0x473c('0x2b')][_0x473c('0x43')]({'where':{'id':_0x1e2ecf[_0x473c('0x46')]['id']}})[_0x473c('0x26')](handleEntityNotFound(_0x937b6b,null))[_0x473c('0x26')](saveUpdates(_0x1e2ecf[_0x473c('0x45')],null))[_0x473c('0x26')](respondWithResult(_0x937b6b,null))['catch'](handleError(_0x937b6b,null));};exports[_0x473c('0x47')]=function(_0x201a12,_0x15a591){return db[_0x473c('0x2b')]['find']({'where':{'id':_0x201a12[_0x473c('0x46')]['id']}})[_0x473c('0x26')](handleEntityNotFound(_0x15a591,null))['then'](removeEntity(_0x15a591,null))[_0x473c('0x40')](handleError(_0x15a591,null));};exports[_0x473c('0x48')]=function(_0x12c9ae,_0xb2b274,_0x5ebdb2){return db[_0x473c('0x2b')]['find']({'where':{'id':_0x12c9ae[_0x473c('0x46')]['id']},'attributes':['id',_0x473c('0x49'),_0x473c('0x4a')]})['then'](handleEntityNotFound(_0xb2b274,null))[_0x473c('0x26')](function(_0x4b82d5){if(_0x4b82d5){if(!_0x4b82d5[_0x473c('0x49')]){throw new db[(_0x473c('0x4b'))][(_0x473c('0x4c'))](_0x473c('0x4d'));}var _0x537c54={'Content-Type':_0x473c('0x4e'),'Content-Disposition':'attachment'};if(_0x4b82d5[_0x473c('0x4a')]){_0x537c54['Content-Disposition']=_0x473c('0x4f')+_0x4b82d5[_0x473c('0x4a')]+_0x473c('0x50');}_0xb2b274['set'](_0x537c54);return _0xb2b274[_0x473c('0x29')](new Buffer(_0x4b82d5['recording']));}})['catch'](handleError(_0xb2b274,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6044dd6..ba06fdc 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 _0x8c30=['voice_voicemail_messages','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8c30,0x187));var _0x08c3=function(_0x51d6fb,_0x215faa){_0x51d6fb=_0x51d6fb-0x0;var _0x4233c5=_0x8c30[_0x51d6fb];return _0x4233c5;};'use strict';var _=require('lodash');var util=require(_0x08c3('0x0'));var logger=require(_0x08c3('0x1'))(_0x08c3('0x2'));var moment=require(_0x08c3('0x3'));var BPromise=require(_0x08c3('0x4'));var rp=require(_0x08c3('0x5'));var fs=require('fs');var path=require(_0x08c3('0x6'));var rimraf=require(_0x08c3('0x7'));var config=require(_0x08c3('0x8'));var attributes=require(_0x08c3('0x9'));module[_0x08c3('0xa')]=function(_0x18b56b,_0x482c5a){return _0x18b56b['define'](_0x08c3('0xb'),attributes,{'tableName':_0x08c3('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x36d8=['request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','dir','lodash','util','api','moment','bluebird'];(function(_0xf41df4,_0x2bf29a){var _0x32dea7=function(_0x3493db){while(--_0x3493db){_0xf41df4['push'](_0xf41df4['shift']());}};_0x32dea7(++_0x2bf29a);}(_0x36d8,0x16d));var _0x836d=function(_0x8dc4e7,_0x2b6ffa){_0x8dc4e7=_0x8dc4e7-0x0;var _0x222920=_0x36d8[_0x8dc4e7];return _0x222920;};'use strict';var _=require(_0x836d('0x0'));var util=require(_0x836d('0x1'));var logger=require('../../config/logger')(_0x836d('0x2'));var moment=require(_0x836d('0x3'));var BPromise=require(_0x836d('0x4'));var rp=require(_0x836d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x836d('0x6'));var config=require(_0x836d('0x7'));var attributes=require(_0x836d('0x8'));module['exports']=function(_0x358ea2,_0x5296aa){return _0x358ea2['define']('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x836d('0x9'),'fields':[_0x836d('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 7c872e1..b96433c 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 _0x6a9f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0x6a9f,0x135));var _0xf6a9=function(_0x5e9691,_0x391955){_0x5e9691=_0x5e9691-0x0;var _0x48a12d=_0x6a9f[_0x5e9691];return _0x48a12d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf6a9('0x0'));var BPromise=require(_0xf6a9('0x1'));var rs=require(_0xf6a9('0x2'));var fs=require('fs');var Redis=require(_0xf6a9('0x3'));var db=require(_0xf6a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6a9('0x5'))('rpc');var config=require(_0xf6a9('0x6'));var jayson=require(_0xf6a9('0x7'));var client=jayson[_0xf6a9('0x8')][_0xf6a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a8959,_0x2ecb10,_0x10b9e6){return new BPromise(function(_0x53f9ed,_0x5d6436){return client[_0xf6a9('0xa')](_0x5a8959,_0x10b9e6)[_0xf6a9('0xb')](function(_0x1a390f){logger['info'](_0xf6a9('0xc'),_0x2ecb10,'request\x20sent');logger[_0xf6a9('0xd')](_0xf6a9('0xe'),_0x2ecb10,'request\x20sent',JSON[_0xf6a9('0xf')](_0x1a390f));if(_0x1a390f['error']){if(_0x1a390f[_0xf6a9('0x10')][_0xf6a9('0x11')]===0x1f4){logger[_0xf6a9('0x10')](_0xf6a9('0xc'),_0x2ecb10,_0x1a390f['error'][_0xf6a9('0x12')]);return _0x5d6436(_0x1a390f['error'][_0xf6a9('0x12')]);}logger[_0xf6a9('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x2ecb10,_0x1a390f['error'][_0xf6a9('0x12')]);return _0x53f9ed(_0x1a390f[_0xf6a9('0x10')]['message']);}else{logger[_0xf6a9('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x2ecb10,_0xf6a9('0x14'));_0x53f9ed(_0x1a390f['result'][_0xf6a9('0x12')]);}})[_0xf6a9('0x15')](function(_0x5ea522){logger[_0xf6a9('0x10')](_0xf6a9('0xc'),_0x2ecb10,_0x5ea522);_0x5d6436(_0x5ea522);});});} \ No newline at end of file +var _0x7147=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3c8aa3,_0x394522){var _0x495d1e=function(_0x2d7d8f){while(--_0x2d7d8f){_0x3c8aa3['push'](_0x3c8aa3['shift']());}};_0x495d1e(++_0x394522);}(_0x7147,0x128));var _0x7714=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0x7147[_0x5f584a];return _0x3788d9;};'use strict';var _=require('lodash');var util=require(_0x7714('0x0'));var moment=require(_0x7714('0x1'));var BPromise=require(_0x7714('0x2'));var rs=require(_0x7714('0x3'));var fs=require('fs');var Redis=require(_0x7714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7714('0x5'));var logger=require(_0x7714('0x6'))(_0x7714('0x7'));var config=require(_0x7714('0x8'));var jayson=require(_0x7714('0x9'));var client=jayson[_0x7714('0xa')][_0x7714('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3876d1,_0x23d4da,_0x264889){return new BPromise(function(_0x442b2d,_0x257c44){return client[_0x7714('0xc')](_0x3876d1,_0x264889)['then'](function(_0x5515c2){logger[_0x7714('0xd')](_0x7714('0xe'),_0x23d4da,_0x7714('0xf'));logger[_0x7714('0x10')](_0x7714('0x11'),_0x23d4da,_0x7714('0xf'),JSON[_0x7714('0x12')](_0x5515c2));if(_0x5515c2['error']){if(_0x5515c2['error'][_0x7714('0x13')]===0x1f4){logger[_0x7714('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x23d4da,_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);return _0x257c44(_0x5515c2[_0x7714('0x14')]['message']);}logger[_0x7714('0x14')](_0x7714('0xe'),_0x23d4da,_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);return _0x442b2d(_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);}else{logger[_0x7714('0xd')](_0x7714('0xe'),_0x23d4da,_0x7714('0xf'));_0x442b2d(_0x5515c2[_0x7714('0x16')]['message']);}})[_0x7714('0x17')](function(_0x25adf7){logger[_0x7714('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x23d4da,_0x25adf7);_0x257c44(_0x25adf7);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 091417f..8756159 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 _0xb75d=['/:id','isAuthenticated','show','create','post','/:id/sounds','addSound','put','destroy','delete','removeSound','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index'];(function(_0x2ef5e4,_0x3b9561){var _0x1e6df9=function(_0x5659e0){while(--_0x5659e0){_0x2ef5e4['push'](_0x2ef5e4['shift']());}};_0x1e6df9(++_0x3b9561);}(_0xb75d,0x96));var _0xdb75=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0xb75d[_0x225f50];return _0x19d003;};'use strict';var multer=require(_0xdb75('0x0'));var util=require('util');var path=require(_0xdb75('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb75('0x2'));var router=express[_0xdb75('0x3')]();var fs_extra=require(_0xdb75('0x4'));var auth=require(_0xdb75('0x5'));var interaction=require(_0xdb75('0x6'));var config=require(_0xdb75('0x7'));var controller=require(_0xdb75('0x8'));router[_0xdb75('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb75('0xa')]);router['get'](_0xdb75('0xb'),auth[_0xdb75('0xc')](),controller[_0xdb75('0xd')]);router[_0xdb75('0x9')]('/:id/sounds',auth[_0xdb75('0xc')](),controller['getSounds']);router['post']('/',auth[_0xdb75('0xc')](),controller[_0xdb75('0xe')]);router[_0xdb75('0xf')](_0xdb75('0x10'),auth['isAuthenticated'](),controller[_0xdb75('0x11')]);router[_0xdb75('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xdb75('0xc')](),controller[_0xdb75('0x13')]);router[_0xdb75('0x14')]('/:id/sounds/:id2',auth[_0xdb75('0xc')](),controller[_0xdb75('0x15')]);module[_0xdb75('0x16')]=router; \ No newline at end of file +var _0xda07=['../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id/sounds','getSounds','post','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','express','Router','fs-extra'];(function(_0x33d301,_0xd98e84){var _0x2406aa=function(_0x474013){while(--_0x474013){_0x33d301['push'](_0x33d301['shift']());}};_0x2406aa(++_0xd98e84);}(_0xda07,0x10c));var _0x7da0=function(_0x47626f,_0x2e89fa){_0x47626f=_0x47626f-0x0;var _0x50a705=_0xda07[_0x47626f];return _0x50a705;};'use strict';var multer=require(_0x7da0('0x0'));var util=require(_0x7da0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7da0('0x2'));var router=express[_0x7da0('0x3')]();var fs_extra=require(_0x7da0('0x4'));var auth=require(_0x7da0('0x5'));var interaction=require(_0x7da0('0x6'));var config=require('../../config/environment');var controller=require(_0x7da0('0x7'));router[_0x7da0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x7da0('0x9')](),controller['show']);router['get'](_0x7da0('0xa'),auth[_0x7da0('0x9')](),controller[_0x7da0('0xb')]);router[_0x7da0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7da0('0xa'),auth[_0x7da0('0x9')](),controller['addSound']);router[_0x7da0('0xd')](_0x7da0('0xe'),auth[_0x7da0('0x9')](),controller[_0x7da0('0xf')]);router[_0x7da0('0x10')](_0x7da0('0xe'),auth[_0x7da0('0x9')](),controller[_0x7da0('0x11')]);router[_0x7da0('0x10')](_0x7da0('0x12'),auth[_0x7da0('0x9')](),controller[_0x7da0('0x13')]);module[_0x7da0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index d01c85e..f51d450 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 _0x163b=['files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom'];(function(_0x52ff5f,_0x4c0933){var _0x2659f6=function(_0x297a41){while(--_0x297a41){_0x52ff5f['push'](_0x52ff5f['shift']());}};_0x2659f6(++_0x4c0933);}(_0x163b,0x7e));var _0xb163=function(_0x3cbc4c,_0x4d8c1e){_0x3cbc4c=_0x3cbc4c-0x0;var _0x4f849c=_0x163b[_0x3cbc4c];return _0x4f849c;};'use strict';var Sequelize=require(_0xb163('0x0'));module[_0xb163('0x1')]={'name':{'type':Sequelize[_0xb163('0x2')],'allowNull':![],'unique':_0xb163('0x3')},'mode':{'type':Sequelize[_0xb163('0x4')](_0xb163('0x5'),_0xb163('0x6'),_0xb163('0x7'),_0xb163('0x8'),'quietmp3',_0xb163('0x9')),'allowNull':!![],'defaultValue':_0xb163('0x6')},'directory':{'type':Sequelize[_0xb163('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xb163('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb163('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb163('0x2')],'allowNull':!![],'defaultValue':_0xb163('0xa')},'format':{'type':Sequelize[_0xb163('0x2')],'allowNull':!![]},'stamp':{'type':_0xb163('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xffbe=['files','mp3nb','quietmp3nb','quietmp3','mp3','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x39b8f6,_0x79bb06){var _0x355b23=function(_0x40e9c4){while(--_0x40e9c4){_0x39b8f6['push'](_0x39b8f6['shift']());}};_0x355b23(++_0x79bb06);}(_0xffbe,0x1c9));var _0xeffb=function(_0x56fa63,_0x4e5bae){_0x56fa63=_0x56fa63-0x0;var _0x4c7bd8=_0xffbe[_0x56fa63];return _0x4c7bd8;};'use strict';var Sequelize=require(_0xeffb('0x0'));module[_0xeffb('0x1')]={'name':{'type':Sequelize[_0xeffb('0x2')],'allowNull':![],'unique':_0xeffb('0x3')},'mode':{'type':Sequelize[_0xeffb('0x4')]('custom',_0xeffb('0x5'),_0xeffb('0x6'),_0xeffb('0x7'),_0xeffb('0x8'),_0xeffb('0x9')),'allowNull':!![],'defaultValue':_0xeffb('0x5')},'directory':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xeffb('0xa')],'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 6d446f4..5dbc759 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 _0x6fcd=['rows','catch','params','length','include','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMusicOnHold','includeAll','findAll'];(function(_0xcf21a8,_0x48ff89){var _0x1a2172=function(_0xed7c20){while(--_0xed7c20){_0xcf21a8['push'](_0xcf21a8['shift']());}};_0x1a2172(++_0x48ff89);}(_0x6fcd,0xa5));var _0xd6fc=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x6fcd[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0xd6fc('0x0'));var rimraf=require(_0xd6fc('0x1'));var zipdir=require(_0xd6fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6fc('0x3'));var moment=require(_0xd6fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6fc('0x5'));var util=require(_0xd6fc('0x6'));var path=require(_0xd6fc('0x7'));var sox=require(_0xd6fc('0x8'));var csv=require(_0xd6fc('0x9'));var ejs=require(_0xd6fc('0xa'));var fs=require('fs');var fs_extra=require(_0xd6fc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd6fc('0xc'));var jsforce=require(_0xd6fc('0xd'));var deskjs=require(_0xd6fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd6fc('0xf'));var Papa=require(_0xd6fc('0x10'));var Redis=require(_0xd6fc('0x11'));var authService=require(_0xd6fc('0x12'));var qs=require(_0xd6fc('0x13'));var as=require(_0xd6fc('0x14'));var hardwareService=require(_0xd6fc('0x15'));var logger=require(_0xd6fc('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd6fc('0x17'));var licenseUtil=require(_0xd6fc('0x18'));var db=require(_0xd6fc('0x19'))['db'];function respondWithStatusCode(_0x2fe3f5,_0x2ba609){_0x2ba609=_0x2ba609||0xcc;return function(_0x4642c9){if(_0x4642c9){return _0x2fe3f5[_0xd6fc('0x1a')](_0x2ba609);}return _0x2fe3f5[_0xd6fc('0x1b')](_0x2ba609)[_0xd6fc('0x1c')]();};}function respondWithResult(_0x5f4518,_0xa870d1){_0xa870d1=_0xa870d1||0xc8;return function(_0x2a0108){if(_0x2a0108){return _0x5f4518[_0xd6fc('0x1b')](_0xa870d1)[_0xd6fc('0x1d')](_0x2a0108);}};}function respondWithFilteredResult(_0x1d0e26,_0x15758b){return function(_0x3dc74f){if(_0x3dc74f){var _0x27175c=typeof _0x15758b['offset']===_0xd6fc('0x1e')&&typeof _0x15758b[_0xd6fc('0x1f')]==='undefined';var _0xcd1a35=_0x3dc74f['count'];var _0x559aa0=_0x27175c?0x0:_0x15758b[_0xd6fc('0x20')];var _0xef9339=_0x27175c?_0x3dc74f[_0xd6fc('0x21')]:_0x15758b['offset']+_0x15758b[_0xd6fc('0x1f')];var _0x221ff7;if(_0xef9339>=_0xcd1a35){_0xef9339=_0xcd1a35;_0x221ff7=0xc8;}else{_0x221ff7=0xce;}_0x1d0e26[_0xd6fc('0x1b')](_0x221ff7);return _0x1d0e26[_0xd6fc('0x22')](_0xd6fc('0x23'),_0x559aa0+'-'+_0xef9339+'/'+_0xcd1a35)['json'](_0x3dc74f);}return null;};}function patchUpdates(_0x1a5a07){return function(_0x42bc25){try{jsonpatch[_0xd6fc('0x24')](_0x42bc25,_0x1a5a07,!![]);}catch(_0x5e5753){return BPromise[_0xd6fc('0x25')](_0x5e5753);}return _0x42bc25[_0xd6fc('0x26')]();};}function saveUpdates(_0x4871bf,_0x3c3adf){return function(_0x33f5e5){if(_0x33f5e5){return _0x33f5e5[_0xd6fc('0x27')](_0x4871bf)[_0xd6fc('0x28')](function(_0x69ed6a){return _0x69ed6a;});}return null;};}function removeEntity(_0x2572bd,_0x54abed){return function(_0x88845b){if(_0x88845b){return _0x88845b[_0xd6fc('0x29')]()[_0xd6fc('0x28')](function(){var _0x497a57=_0x88845b[_0xd6fc('0x2a')]({'plain':!![]});var _0x1c172b=_0xd6fc('0x2b');return db[_0xd6fc('0x2c')][_0xd6fc('0x29')]({'where':{'type':_0x1c172b,'resourceId':_0x497a57['id']}})[_0xd6fc('0x28')](function(){return _0x88845b;});})[_0xd6fc('0x28')](function(){_0x2572bd[_0xd6fc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d717,_0x577534){return function(_0x1cddc1){if(!_0x1cddc1){_0x37d717['sendStatus'](0x194);}return _0x1cddc1;};}function handleError(_0x3beb5e,_0x39ff7d){_0x39ff7d=_0x39ff7d||0x1f4;return function(_0x4ea35b){logger[_0xd6fc('0x2d')](_0x4ea35b[_0xd6fc('0x2e')]);if(_0x4ea35b[_0xd6fc('0x2f')]){delete _0x4ea35b[_0xd6fc('0x2f')];}_0x3beb5e['status'](_0x39ff7d)[_0xd6fc('0x30')](_0x4ea35b);};}exports[_0xd6fc('0x31')]=function(_0x267f42,_0x3e3e71){var _0x174ba8={},_0x15218c={},_0x16eb9e={'count':0x0,'rows':[]};var _0x3299c3=_[_0xd6fc('0x32')](db['VoiceMusicOnHold'][_0xd6fc('0x33')],function(_0x5c38b5){return{'name':_0x5c38b5[_0xd6fc('0x34')],'type':_0x5c38b5[_0xd6fc('0x35')]['key']};});_0x15218c[_0xd6fc('0x36')]=_[_0xd6fc('0x32')](_0x3299c3,'name');_0x15218c['query']=_[_0xd6fc('0x37')](_0x267f42[_0xd6fc('0x38')]);_0x15218c[_0xd6fc('0x39')]=_[_0xd6fc('0x3a')](_0x15218c[_0xd6fc('0x36')],_0x15218c[_0xd6fc('0x38')]);_0x174ba8[_0xd6fc('0x3b')]=_[_0xd6fc('0x3a')](_0x15218c[_0xd6fc('0x36')],qs[_0xd6fc('0x3c')](_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x3c')]));_0x174ba8[_0xd6fc('0x3b')]=_0x174ba8['attributes']['length']?_0x174ba8[_0xd6fc('0x3b')]:_0x15218c['model'];if(!_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x3d')]('nolimit')){_0x174ba8[_0xd6fc('0x1f')]=qs['limit'](_0x267f42['query'][_0xd6fc('0x1f')]);_0x174ba8[_0xd6fc('0x20')]=qs[_0xd6fc('0x20')](_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x20')]);}_0x174ba8[_0xd6fc('0x3e')]=qs[_0xd6fc('0x3f')](_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x3f')]);delete _0x267f42[_0xd6fc('0x38')][_0xd6fc('0x3f')];_0x174ba8['where']=qs[_0xd6fc('0x39')](_[_0xd6fc('0x40')](_0x267f42['query'],_0x15218c[_0xd6fc('0x39')]),_0x3299c3);if(_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x41')]){_0x174ba8['where']=_[_0xd6fc('0x42')](_0x174ba8[_0xd6fc('0x43')],{'$or':_['map'](_0x3299c3,function(_0x2d44d6){if(_0x2d44d6[_0xd6fc('0x35')]!==_0xd6fc('0x44')){var _0x478a2a={};_0x478a2a[_0x2d44d6[_0xd6fc('0x2f')]]={'$like':'%'+_0x267f42[_0xd6fc('0x38')][_0xd6fc('0x41')]+'%'};return _0x478a2a;}})});}_0x174ba8=_[_0xd6fc('0x42')]({},_0x174ba8,_0x267f42[_0xd6fc('0x45')]);var _0x38979c={'where':_0x174ba8['where']};return db[_0xd6fc('0x46')][_0xd6fc('0x21')](_0x38979c)[_0xd6fc('0x28')](function(_0x159699){_0x16eb9e['count']=_0x159699;if(_0x267f42['query'][_0xd6fc('0x47')]){_0x174ba8['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xd6fc('0x48')](_0x174ba8);})[_0xd6fc('0x28')](function(_0x3e1ee9){_0x16eb9e[_0xd6fc('0x49')]=_0x3e1ee9;return _0x16eb9e;})[_0xd6fc('0x28')](respondWithFilteredResult(_0x3e3e71,_0x174ba8))[_0xd6fc('0x4a')](handleError(_0x3e3e71,null));};exports['show']=function(_0x553f29,_0x45607d){var _0x2570ba={'raw':![],'where':{'id':_0x553f29[_0xd6fc('0x4b')]['id']}},_0x45d737={};_0x45d737[_0xd6fc('0x36')]=_[_0xd6fc('0x37')](db[_0xd6fc('0x46')][_0xd6fc('0x33')]);_0x45d737[_0xd6fc('0x38')]=_[_0xd6fc('0x37')](_0x553f29[_0xd6fc('0x38')]);_0x45d737[_0xd6fc('0x39')]=_[_0xd6fc('0x3a')](_0x45d737[_0xd6fc('0x36')],_0x45d737['query']);_0x2570ba[_0xd6fc('0x3b')]=_[_0xd6fc('0x3a')](_0x45d737[_0xd6fc('0x36')],qs['fields'](_0x553f29['query'][_0xd6fc('0x3c')]));_0x2570ba[_0xd6fc('0x3b')]=_0x2570ba['attributes'][_0xd6fc('0x4c')]?_0x2570ba[_0xd6fc('0x3b')]:_0x45d737[_0xd6fc('0x36')];if(_0x553f29[_0xd6fc('0x38')][_0xd6fc('0x47')]){_0x2570ba[_0xd6fc('0x4d')]=[{'all':!![]}];}_0x2570ba=_[_0xd6fc('0x42')]({},_0x2570ba,_0x553f29[_0xd6fc('0x45')]);return db[_0xd6fc('0x46')][_0xd6fc('0x4e')](_0x2570ba)[_0xd6fc('0x28')](handleEntityNotFound(_0x45607d,null))['then'](respondWithResult(_0x45607d,null))['catch'](handleError(_0x45607d,null));};exports[_0xd6fc('0x27')]=function(_0x24f096,_0x462014){if(_0x24f096[_0xd6fc('0x4f')]['id']){delete _0x24f096[_0xd6fc('0x4f')]['id'];}return db[_0xd6fc('0x46')][_0xd6fc('0x4e')]({'where':{'id':_0x24f096[_0xd6fc('0x4b')]['id']}})[_0xd6fc('0x28')](handleEntityNotFound(_0x462014,null))['then'](saveUpdates(_0x24f096[_0xd6fc('0x4f')],null))[_0xd6fc('0x28')](respondWithResult(_0x462014,null))[_0xd6fc('0x4a')](handleError(_0x462014,null));};exports[_0xd6fc('0x50')]=function(_0x48b73f,_0x30f3a4,_0x202517){return db[_0xd6fc('0x51')][_0xd6fc('0x52')](function(_0x2f5796){if(_0x48b73f[_0xd6fc('0x4f')][_0xd6fc('0x53')]===_0xd6fc('0x54')){_0x48b73f[_0xd6fc('0x4f')][_0xd6fc('0x55')]=path[_0xd6fc('0x56')](config[_0xd6fc('0x57')],_0xd6fc('0x58'),_0x48b73f[_0xd6fc('0x4f')][_0xd6fc('0x2f')]);}return db[_0xd6fc('0x46')][_0xd6fc('0x50')](_0x48b73f[_0xd6fc('0x4f')],{'transaction':_0x2f5796})[_0xd6fc('0x28')](function(_0x464ee7){if(_0x48b73f[_0xd6fc('0x4f')][_0xd6fc('0x53')]===_0xd6fc('0x54')){fs[_0xd6fc('0x59')](_0x464ee7[_0xd6fc('0x55')],parseInt(_0xd6fc('0x5a'),0x8));}var _0x29d202=_0x48b73f[_0xd6fc('0x5b')][_0xd6fc('0x2a')]({'plain':!![]});if(!_0x29d202)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29d202[_0xd6fc('0x5c')]===_0xd6fc('0x5b')){var _0x6f2ec4=_0x464ee7[_0xd6fc('0x2a')]({'plain':!![]});return db[_0xd6fc('0x5d')][_0xd6fc('0x4e')]({'where':{'name':_0xd6fc('0x2b'),'userProfileId':_0x29d202[_0xd6fc('0x5e')]},'raw':!![]})[_0xd6fc('0x28')](function(_0x50a779){if(_0x50a779&&_0x50a779[_0xd6fc('0x5f')]===0x0){return db['UserProfileResource'][_0xd6fc('0x50')]({'name':_0x6f2ec4[_0xd6fc('0x2f')],'resourceId':_0x6f2ec4['id'],'type':_0x50a779['name'],'sectionId':_0x50a779['id']},{})[_0xd6fc('0x28')](function(){return _0x464ee7;});}else{return _0x464ee7;}})['catch'](function(_0xb81b93){logger['error'](_0xd6fc('0x60'),_0xb81b93);});}return _0x464ee7;});})['then'](respondWithResult(_0x30f3a4,0xc9))[_0xd6fc('0x4a')](handleError(_0x30f3a4,null));};exports['destroy']=function(_0x5614cf,_0x23d87d,_0x24ef74){var _0x510e70;return db[_0xd6fc('0x46')][_0xd6fc('0x4e')]({'where':{'id':_0x5614cf[_0xd6fc('0x4b')]['id']}})[_0xd6fc('0x28')](function(_0x337c59){if(_0x337c59){return db[_0xd6fc('0x51')][_0xd6fc('0x52')](function(_0x37a90a){return _0x337c59[_0xd6fc('0x29')]({'transaction':_0x37a90a,'raw':!![]})[_0xd6fc('0x28')](function(_0x318e0d){if(_0x318e0d[_0xd6fc('0x55')]){fs[_0xd6fc('0x61')](_0x318e0d['directory'])['forEach'](function(_0x3e1e9a){fs[_0xd6fc('0x62')](path[_0xd6fc('0x56')](_0x318e0d['directory'],_0x3e1e9a));});fs[_0xd6fc('0x63')](_0x318e0d['directory']);}return _0x318e0d;});})[_0xd6fc('0x4a')](function(_0x108d05){throw new db[(_0xd6fc('0x64'))][(_0xd6fc('0x65'))](_0x108d05[_0xd6fc('0x66')]);});}})[_0xd6fc('0x28')](handleEntityNotFound(_0x23d87d,null))['then'](removeEntity(_0x23d87d,null))[_0xd6fc('0x4a')](handleError(_0x23d87d,null));};exports[_0xd6fc('0x67')]=function(_0x4949df,_0x45752d,_0x5da0f3){return db[_0xd6fc('0x51')][_0xd6fc('0x52')](function(_0x2806f6){var _0x435cf2;return db[_0xd6fc('0x46')]['find']({'where':{'id':_0x4949df[_0xd6fc('0x4b')]['id']}})[_0xd6fc('0x28')](function(_0x5debd8){if(_0x5debd8){_0x435cf2=_0x5debd8;return _0x5debd8[_0xd6fc('0x67')](_0x4949df[_0xd6fc('0x4f')]['id'],{'transaction':_0x2806f6});}})[_0xd6fc('0x28')](function(_0x288723){if(_0x288723){return db[_0xd6fc('0x68')][_0xd6fc('0x69')]({'where':{'id':_0x4949df[_0xd6fc('0x4f')]['id']},'attributes':['id',_0xd6fc('0x2f'),_0xd6fc('0x6a'),_0xd6fc('0x6b'),_0xd6fc('0x6c')],'raw':!![]});}})[_0xd6fc('0x28')](function(_0x25a0df){if(_0x25a0df){var _0xed5b5a=path[_0xd6fc('0x56')](config[_0xd6fc('0x57')],_0xd6fc('0x6d'),util[_0xd6fc('0x6e')](_0xd6fc('0x6f'),path[_0xd6fc('0x70')](_0x25a0df[_0xd6fc('0x6a')],path[_0xd6fc('0x71')](_0x25a0df[_0xd6fc('0x6a')])),_0x25a0df[_0xd6fc('0x6b')]));var _0x2d52d6=path[_0xd6fc('0x56')](config[_0xd6fc('0x57')],_0xd6fc('0x58'),_0x435cf2['name'],util[_0xd6fc('0x6e')]('%s.%s',_0x25a0df[_0xd6fc('0x2f')],_0x25a0df[_0xd6fc('0x6b')]));fs[_0xd6fc('0x72')](_0xed5b5a,_0x2d52d6);return _0x25a0df;}})[_0xd6fc('0x4a')](function(_0x42bee4){throw new db[(_0xd6fc('0x64'))][(_0xd6fc('0x65'))](_0x42bee4[_0xd6fc('0x66')]);});})[_0xd6fc('0x28')](handleEntityNotFound(_0x45752d,null))[_0xd6fc('0x28')](respondWithResult(_0x45752d,0xc9))['catch'](handleError(_0x45752d,null));};exports[_0xd6fc('0x73')]=function(_0x3818b5,_0x50dc3e,_0x2f81ab){return db['sequelize'][_0xd6fc('0x52')](function(_0x4823b3){var _0x46e837;return db[_0xd6fc('0x46')][_0xd6fc('0x69')]({'where':{'id':_0x3818b5[_0xd6fc('0x4b')]['id']}})[_0xd6fc('0x28')](handleEntityNotFound(_0x50dc3e,null))['then'](function(_0x218ce8){if(_0x218ce8){_0x46e837=_0x218ce8;return _0x218ce8['removeSound'](_0x3818b5[_0xd6fc('0x4b')][_0xd6fc('0x74')]);}})[_0xd6fc('0x28')](function(_0x194e69){if(_0x194e69){return db['Sound'][_0xd6fc('0x69')]({'where':{'id':_0x3818b5['params'][_0xd6fc('0x74')]},'attributes':['id',_0xd6fc('0x2f'),_0xd6fc('0x6a'),_0xd6fc('0x6b'),_0xd6fc('0x6c')],'raw':!![]});}})[_0xd6fc('0x28')](function(_0x1588bc){if(_0x1588bc){fs[_0xd6fc('0x62')](path['join'](_0x46e837[_0xd6fc('0x55')],util[_0xd6fc('0x6e')]('%s.%s',_0x1588bc[_0xd6fc('0x2f')],_0x1588bc[_0xd6fc('0x6b')])));return _0x1588bc;}})[_0xd6fc('0x4a')](function(_0x3961cb){throw new db[(_0xd6fc('0x64'))][(_0xd6fc('0x65'))](_0x3961cb[_0xd6fc('0x66')]);});})[_0xd6fc('0x28')](handleEntityNotFound(_0x50dc3e,null))['then'](respondWithStatusCode(_0x50dc3e,0xcc))[_0xd6fc('0x4a')](handleError(_0x50dc3e,null));};exports[_0xd6fc('0x75')]=function(_0x36e3cf,_0x363924,_0x4171bd){var _0x2a9ab1={};var _0x478a01={};var _0x3aabeb;var _0x20de64;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x36e3cf[_0xd6fc('0x4b')]['id']}})[_0xd6fc('0x28')](handleEntityNotFound(_0x363924,null))[_0xd6fc('0x28')](function(_0x1309a1){if(_0x1309a1){_0x3aabeb=_0x1309a1;_0x478a01['model']=_[_0xd6fc('0x37')](db[_0xd6fc('0x68')][_0xd6fc('0x33')]);_0x478a01[_0xd6fc('0x38')]=_[_0xd6fc('0x37')](_0x36e3cf[_0xd6fc('0x38')]);_0x478a01['filters']=_['intersection'](_0x478a01[_0xd6fc('0x36')],_0x478a01['query']);_0x2a9ab1[_0xd6fc('0x3b')]=_[_0xd6fc('0x3a')](_0x478a01[_0xd6fc('0x36')],qs[_0xd6fc('0x3c')](_0x36e3cf[_0xd6fc('0x38')]['fields']));_0x2a9ab1[_0xd6fc('0x3b')]=_0x2a9ab1['attributes'][_0xd6fc('0x4c')]?_0x2a9ab1[_0xd6fc('0x3b')]:_0x478a01[_0xd6fc('0x36')];_0x2a9ab1['order']=qs[_0xd6fc('0x3f')](_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x3f')]);_0x2a9ab1['where']=qs['filters'](_['pick'](_0x36e3cf[_0xd6fc('0x38')],_0x478a01[_0xd6fc('0x39')]));if(_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x41')]){_0x2a9ab1[_0xd6fc('0x43')]=_[_0xd6fc('0x42')](_0x2a9ab1[_0xd6fc('0x43')],{'$or':_['map'](_0x2a9ab1['attributes'],function(_0x300aa8){var _0x5904fc={};_0x5904fc[_0x300aa8]={'$like':'%'+_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x41')]+'%'};return _0x5904fc;})});}_0x2a9ab1=_['merge']({},_0x2a9ab1,_0x36e3cf[_0xd6fc('0x45')]);return _0x3aabeb[_0xd6fc('0x75')](_0x2a9ab1);}})[_0xd6fc('0x28')](function(_0xbd667a){if(_0xbd667a){_0x20de64=_0xbd667a['length'];if(!_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x3d')](_0xd6fc('0x76'))){_0x2a9ab1['limit']=qs[_0xd6fc('0x1f')](_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x1f')]);_0x2a9ab1['offset']=qs[_0xd6fc('0x20')](_0x36e3cf[_0xd6fc('0x38')][_0xd6fc('0x20')]);}return _0x3aabeb[_0xd6fc('0x75')](_0x2a9ab1);}})[_0xd6fc('0x28')](function(_0x3d143b){if(_0x3d143b){return _0x3d143b?{'count':_0x20de64,'rows':_0x3d143b}:null;}})['then'](respondWithResult(_0x363924,null))[_0xd6fc('0x4a')](handleError(_0x363924,null));}; \ No newline at end of file +var _0x53a6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','VoiceMusicOnHold','findAll','params','options','find','body','catch','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','removeSound','id2','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x53a6,0x1c0));var _0x653a=function(_0x40fbf6,_0x456761){_0x40fbf6=_0x40fbf6-0x0;var _0x2e175b=_0x53a6[_0x40fbf6];return _0x2e175b;};'use strict';var emlformat=require(_0x653a('0x0'));var rimraf=require(_0x653a('0x1'));var zipdir=require(_0x653a('0x2'));var jsonpatch=require(_0x653a('0x3'));var rp=require(_0x653a('0x4'));var moment=require(_0x653a('0x5'));var BPromise=require(_0x653a('0x6'));var Mustache=require(_0x653a('0x7'));var util=require(_0x653a('0x8'));var path=require(_0x653a('0x9'));var sox=require(_0x653a('0xa'));var csv=require('to-csv');var ejs=require(_0x653a('0xb'));var fs=require('fs');var fs_extra=require(_0x653a('0xc'));var _=require(_0x653a('0xd'));var squel=require(_0x653a('0xe'));var crypto=require('crypto');var jsforce=require(_0x653a('0xf'));var deskjs=require(_0x653a('0x10'));var toCsv=require(_0x653a('0x11'));var querystring=require('querystring');var Papa=require(_0x653a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x653a('0x13'));var as=require(_0x653a('0x14'));var hardwareService=require(_0x653a('0x15'));var logger=require(_0x653a('0x16'))(_0x653a('0x17'));var utils=require('../../config/utils');var config=require(_0x653a('0x18'));var licenseUtil=require(_0x653a('0x19'));var db=require(_0x653a('0x1a'))['db'];function respondWithStatusCode(_0x80b64b,_0x20afd8){_0x20afd8=_0x20afd8||0xcc;return function(_0x44ea49){if(_0x44ea49){return _0x80b64b[_0x653a('0x1b')](_0x20afd8);}return _0x80b64b[_0x653a('0x1c')](_0x20afd8)['end']();};}function respondWithResult(_0x2e7a98,_0x7785e1){_0x7785e1=_0x7785e1||0xc8;return function(_0x4135d5){if(_0x4135d5){return _0x2e7a98[_0x653a('0x1c')](_0x7785e1)[_0x653a('0x1d')](_0x4135d5);}};}function respondWithFilteredResult(_0x38b0b6,_0x1eea59){return function(_0x549c){if(_0x549c){var _0x101694=typeof _0x1eea59[_0x653a('0x1e')]==='undefined'&&typeof _0x1eea59[_0x653a('0x1f')]===_0x653a('0x20');var _0x53c778=_0x549c[_0x653a('0x21')];var _0x2199c5=_0x101694?0x0:_0x1eea59['offset'];var _0x55d8c3=_0x101694?_0x549c[_0x653a('0x21')]:_0x1eea59[_0x653a('0x1e')]+_0x1eea59['limit'];var _0x314d4b;if(_0x55d8c3>=_0x53c778){_0x55d8c3=_0x53c778;_0x314d4b=0xc8;}else{_0x314d4b=0xce;}_0x38b0b6[_0x653a('0x1c')](_0x314d4b);return _0x38b0b6[_0x653a('0x22')]('Content-Range',_0x2199c5+'-'+_0x55d8c3+'/'+_0x53c778)[_0x653a('0x1d')](_0x549c);}return null;};}function patchUpdates(_0xb21f81){return function(_0x37006c){try{jsonpatch[_0x653a('0x23')](_0x37006c,_0xb21f81,!![]);}catch(_0x1340c6){return BPromise['reject'](_0x1340c6);}return _0x37006c[_0x653a('0x24')]();};}function saveUpdates(_0x32f610,_0x42b737){return function(_0x1e8890){if(_0x1e8890){return _0x1e8890[_0x653a('0x25')](_0x32f610)[_0x653a('0x26')](function(_0x23ba91){return _0x23ba91;});}return null;};}function removeEntity(_0x241598,_0x3be726){return function(_0xef5fbb){if(_0xef5fbb){return _0xef5fbb[_0x653a('0x27')]()[_0x653a('0x26')](function(){var _0x713705=_0xef5fbb[_0x653a('0x28')]({'plain':!![]});var _0x128a77=_0x653a('0x29');return db[_0x653a('0x2a')]['destroy']({'where':{'type':_0x128a77,'resourceId':_0x713705['id']}})[_0x653a('0x26')](function(){return _0xef5fbb;});})[_0x653a('0x26')](function(){_0x241598['status'](0xcc)[_0x653a('0x2b')]();});}};}function handleEntityNotFound(_0x1c1195,_0x99c7a5){return function(_0x21ddab){if(!_0x21ddab){_0x1c1195[_0x653a('0x1b')](0x194);}return _0x21ddab;};}function handleError(_0x1f9ace,_0x12b9e1){_0x12b9e1=_0x12b9e1||0x1f4;return function(_0x38f50b){logger[_0x653a('0x2c')](_0x38f50b[_0x653a('0x2d')]);if(_0x38f50b[_0x653a('0x2e')]){delete _0x38f50b[_0x653a('0x2e')];}_0x1f9ace[_0x653a('0x1c')](_0x12b9e1)['send'](_0x38f50b);};}exports[_0x653a('0x2f')]=function(_0x265a25,_0x343db0){var _0x52217a={},_0x2e4a9d={},_0x49a582={'count':0x0,'rows':[]};var _0x3f54c5=_[_0x653a('0x30')](db['VoiceMusicOnHold'][_0x653a('0x31')],function(_0x256747){return{'name':_0x256747[_0x653a('0x32')],'type':_0x256747[_0x653a('0x33')][_0x653a('0x34')]};});_0x2e4a9d['model']=_[_0x653a('0x30')](_0x3f54c5,'name');_0x2e4a9d[_0x653a('0x35')]=_[_0x653a('0x36')](_0x265a25['query']);_0x2e4a9d[_0x653a('0x37')]=_[_0x653a('0x38')](_0x2e4a9d[_0x653a('0x39')],_0x2e4a9d[_0x653a('0x35')]);_0x52217a[_0x653a('0x3a')]=_[_0x653a('0x38')](_0x2e4a9d[_0x653a('0x39')],qs['fields'](_0x265a25[_0x653a('0x35')][_0x653a('0x3b')]));_0x52217a[_0x653a('0x3a')]=_0x52217a['attributes'][_0x653a('0x3c')]?_0x52217a['attributes']:_0x2e4a9d['model'];if(!_0x265a25[_0x653a('0x35')][_0x653a('0x3d')](_0x653a('0x3e'))){_0x52217a[_0x653a('0x1f')]=qs[_0x653a('0x1f')](_0x265a25['query'][_0x653a('0x1f')]);_0x52217a['offset']=qs[_0x653a('0x1e')](_0x265a25[_0x653a('0x35')][_0x653a('0x1e')]);}_0x52217a[_0x653a('0x3f')]=qs[_0x653a('0x40')](_0x265a25[_0x653a('0x35')][_0x653a('0x40')]);delete _0x265a25[_0x653a('0x35')][_0x653a('0x40')];_0x52217a[_0x653a('0x41')]=qs['filters'](_['pick'](_0x265a25[_0x653a('0x35')],_0x2e4a9d[_0x653a('0x37')]),_0x3f54c5);if(_0x265a25[_0x653a('0x35')][_0x653a('0x42')]){_0x52217a[_0x653a('0x41')]=_[_0x653a('0x43')](_0x52217a[_0x653a('0x41')],{'$or':_[_0x653a('0x30')](_0x3f54c5,function(_0x511782){if(_0x511782[_0x653a('0x33')]!==_0x653a('0x44')){var _0x1a6397={};_0x1a6397[_0x511782[_0x653a('0x2e')]]={'$like':'%'+_0x265a25[_0x653a('0x35')][_0x653a('0x42')]+'%'};return _0x1a6397;}})});}_0x52217a=_[_0x653a('0x43')]({},_0x52217a,_0x265a25['options']);var _0x564a8f={'where':_0x52217a['where']};return db['VoiceMusicOnHold'][_0x653a('0x21')](_0x564a8f)['then'](function(_0x1cd235){_0x49a582[_0x653a('0x21')]=_0x1cd235;if(_0x265a25[_0x653a('0x35')][_0x653a('0x45')]){_0x52217a[_0x653a('0x46')]=[{'all':!![]}];}return db[_0x653a('0x47')][_0x653a('0x48')](_0x52217a);})[_0x653a('0x26')](function(_0x203e3f){_0x49a582['rows']=_0x203e3f;return _0x49a582;})['then'](respondWithFilteredResult(_0x343db0,_0x52217a))['catch'](handleError(_0x343db0,null));};exports['show']=function(_0x5d2e5a,_0x447d36){var _0x4d2003={'raw':![],'where':{'id':_0x5d2e5a[_0x653a('0x49')]['id']}},_0x2a9967={};_0x2a9967[_0x653a('0x39')]=_[_0x653a('0x36')](db[_0x653a('0x47')][_0x653a('0x31')]);_0x2a9967[_0x653a('0x35')]=_['keys'](_0x5d2e5a[_0x653a('0x35')]);_0x2a9967['filters']=_['intersection'](_0x2a9967[_0x653a('0x39')],_0x2a9967['query']);_0x4d2003[_0x653a('0x3a')]=_[_0x653a('0x38')](_0x2a9967[_0x653a('0x39')],qs[_0x653a('0x3b')](_0x5d2e5a[_0x653a('0x35')][_0x653a('0x3b')]));_0x4d2003['attributes']=_0x4d2003[_0x653a('0x3a')][_0x653a('0x3c')]?_0x4d2003['attributes']:_0x2a9967['model'];if(_0x5d2e5a['query'][_0x653a('0x45')]){_0x4d2003[_0x653a('0x46')]=[{'all':!![]}];}_0x4d2003=_['merge']({},_0x4d2003,_0x5d2e5a[_0x653a('0x4a')]);return db[_0x653a('0x47')][_0x653a('0x4b')](_0x4d2003)[_0x653a('0x26')](handleEntityNotFound(_0x447d36,null))[_0x653a('0x26')](respondWithResult(_0x447d36,null))['catch'](handleError(_0x447d36,null));};exports['update']=function(_0x32a74b,_0x852a2c){if(_0x32a74b[_0x653a('0x4c')]['id']){delete _0x32a74b[_0x653a('0x4c')]['id'];}return db[_0x653a('0x47')][_0x653a('0x4b')]({'where':{'id':_0x32a74b[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x852a2c,null))[_0x653a('0x26')](saveUpdates(_0x32a74b[_0x653a('0x4c')],null))[_0x653a('0x26')](respondWithResult(_0x852a2c,null))[_0x653a('0x4d')](handleError(_0x852a2c,null));};exports[_0x653a('0x4e')]=function(_0x16801b,_0x266bc0,_0x545619){return db['sequelize'][_0x653a('0x4f')](function(_0x4ca6ae){if(_0x16801b[_0x653a('0x4c')][_0x653a('0x50')]===_0x653a('0x51')){_0x16801b[_0x653a('0x4c')][_0x653a('0x52')]=path[_0x653a('0x53')](config[_0x653a('0x54')],_0x653a('0x55'),_0x16801b[_0x653a('0x4c')][_0x653a('0x2e')]);}return db[_0x653a('0x47')][_0x653a('0x4e')](_0x16801b['body'],{'transaction':_0x4ca6ae})[_0x653a('0x26')](function(_0x49517e){if(_0x16801b[_0x653a('0x4c')]['mode']===_0x653a('0x51')){fs[_0x653a('0x56')](_0x49517e['directory'],parseInt(_0x653a('0x57'),0x8));}var _0x271037=_0x16801b['user'][_0x653a('0x28')]({'plain':!![]});if(!_0x271037)throw new Error(_0x653a('0x58'));if(_0x271037[_0x653a('0x59')]==='user'){var _0x2bf8f9=_0x49517e[_0x653a('0x28')]({'plain':!![]});return db[_0x653a('0x5a')][_0x653a('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x271037[_0x653a('0x5b')]},'raw':!![]})[_0x653a('0x26')](function(_0x324ae0){if(_0x324ae0&&_0x324ae0[_0x653a('0x5c')]===0x0){return db[_0x653a('0x2a')][_0x653a('0x4e')]({'name':_0x2bf8f9[_0x653a('0x2e')],'resourceId':_0x2bf8f9['id'],'type':_0x324ae0['name'],'sectionId':_0x324ae0['id']},{})[_0x653a('0x26')](function(){return _0x49517e;});}else{return _0x49517e;}})[_0x653a('0x4d')](function(_0x2f33fb){logger[_0x653a('0x2c')](_0x653a('0x5d'),_0x2f33fb);});}return _0x49517e;});})[_0x653a('0x26')](respondWithResult(_0x266bc0,0xc9))['catch'](handleError(_0x266bc0,null));};exports['destroy']=function(_0x3ca740,_0x3092e2,_0x575020){var _0x41d76e;return db['VoiceMusicOnHold'][_0x653a('0x4b')]({'where':{'id':_0x3ca740[_0x653a('0x49')]['id']}})[_0x653a('0x26')](function(_0x3a2f35){if(_0x3a2f35){return db['sequelize']['transaction'](function(_0x2179a1){return _0x3a2f35[_0x653a('0x27')]({'transaction':_0x2179a1,'raw':!![]})[_0x653a('0x26')](function(_0x5f47f0){if(_0x5f47f0[_0x653a('0x52')]){fs[_0x653a('0x5e')](_0x5f47f0[_0x653a('0x52')])['forEach'](function(_0x4d723b){fs[_0x653a('0x5f')](path[_0x653a('0x53')](_0x5f47f0['directory'],_0x4d723b));});fs[_0x653a('0x60')](_0x5f47f0[_0x653a('0x52')]);}return _0x5f47f0;});})[_0x653a('0x4d')](function(_0x5a2f90){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x5a2f90[_0x653a('0x63')]);});}})[_0x653a('0x26')](handleEntityNotFound(_0x3092e2,null))['then'](removeEntity(_0x3092e2,null))[_0x653a('0x4d')](handleError(_0x3092e2,null));};exports[_0x653a('0x64')]=function(_0x151a58,_0x2c250e,_0xe6a601){return db[_0x653a('0x65')][_0x653a('0x4f')](function(_0x2984bb){var _0x14c1f3;return db[_0x653a('0x47')][_0x653a('0x4b')]({'where':{'id':_0x151a58[_0x653a('0x49')]['id']}})['then'](function(_0x86583a){if(_0x86583a){_0x14c1f3=_0x86583a;return _0x86583a[_0x653a('0x64')](_0x151a58['body']['id'],{'transaction':_0x2984bb});}})[_0x653a('0x26')](function(_0x36099e){if(_0x36099e){return db[_0x653a('0x66')][_0x653a('0x67')]({'where':{'id':_0x151a58[_0x653a('0x4c')]['id']},'attributes':['id',_0x653a('0x2e'),_0x653a('0x68'),_0x653a('0x69'),_0x653a('0x6a')],'raw':!![]});}})['then'](function(_0x3d6406){if(_0x3d6406){var _0x255ac6=path[_0x653a('0x53')](config[_0x653a('0x54')],_0x653a('0x6b'),util['format'](_0x653a('0x6c'),path[_0x653a('0x6d')](_0x3d6406[_0x653a('0x68')],path[_0x653a('0x6e')](_0x3d6406[_0x653a('0x68')])),_0x3d6406['converted_format']));var _0x2cf0ca=path[_0x653a('0x53')](config[_0x653a('0x54')],'server/files/moh',_0x14c1f3[_0x653a('0x2e')],util[_0x653a('0x6f')](_0x653a('0x6c'),_0x3d6406[_0x653a('0x2e')],_0x3d6406['converted_format']));fs[_0x653a('0x70')](_0x255ac6,_0x2cf0ca);return _0x3d6406;}})[_0x653a('0x4d')](function(_0x22dabb){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x22dabb['message']);});})[_0x653a('0x26')](handleEntityNotFound(_0x2c250e,null))[_0x653a('0x26')](respondWithResult(_0x2c250e,0xc9))['catch'](handleError(_0x2c250e,null));};exports[_0x653a('0x71')]=function(_0x120d64,_0x448036,_0x5b39ba){return db['sequelize'][_0x653a('0x4f')](function(_0x3934b1){var _0x102b89;return db['VoiceMusicOnHold'][_0x653a('0x67')]({'where':{'id':_0x120d64[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x448036,null))[_0x653a('0x26')](function(_0x4fbe80){if(_0x4fbe80){_0x102b89=_0x4fbe80;return _0x4fbe80[_0x653a('0x71')](_0x120d64[_0x653a('0x49')][_0x653a('0x72')]);}})['then'](function(_0x1c855b){if(_0x1c855b){return db[_0x653a('0x66')][_0x653a('0x67')]({'where':{'id':_0x120d64[_0x653a('0x49')][_0x653a('0x72')]},'attributes':['id',_0x653a('0x2e'),'save_name',_0x653a('0x69'),_0x653a('0x6a')],'raw':!![]});}})['then'](function(_0x2f1f33){if(_0x2f1f33){fs['unlinkSync'](path[_0x653a('0x53')](_0x102b89[_0x653a('0x52')],util['format'](_0x653a('0x6c'),_0x2f1f33[_0x653a('0x2e')],_0x2f1f33[_0x653a('0x69')])));return _0x2f1f33;}})[_0x653a('0x4d')](function(_0x1a3e0d){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x1a3e0d[_0x653a('0x63')]);});})['then'](handleEntityNotFound(_0x448036,null))[_0x653a('0x26')](respondWithStatusCode(_0x448036,0xcc))[_0x653a('0x4d')](handleError(_0x448036,null));};exports[_0x653a('0x73')]=function(_0x1c9e21,_0x3fbcea,_0x1a0497){var _0x1f7e04={};var _0x4b1e4e={};var _0x49f728;var _0x4e8400;return db[_0x653a('0x47')][_0x653a('0x67')]({'where':{'id':_0x1c9e21[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x3fbcea,null))['then'](function(_0x19a93e){if(_0x19a93e){_0x49f728=_0x19a93e;_0x4b1e4e[_0x653a('0x39')]=_[_0x653a('0x36')](db[_0x653a('0x66')][_0x653a('0x31')]);_0x4b1e4e['query']=_[_0x653a('0x36')](_0x1c9e21[_0x653a('0x35')]);_0x4b1e4e[_0x653a('0x37')]=_['intersection'](_0x4b1e4e[_0x653a('0x39')],_0x4b1e4e['query']);_0x1f7e04[_0x653a('0x3a')]=_['intersection'](_0x4b1e4e['model'],qs[_0x653a('0x3b')](_0x1c9e21[_0x653a('0x35')]['fields']));_0x1f7e04[_0x653a('0x3a')]=_0x1f7e04['attributes'][_0x653a('0x3c')]?_0x1f7e04[_0x653a('0x3a')]:_0x4b1e4e[_0x653a('0x39')];_0x1f7e04[_0x653a('0x3f')]=qs['sort'](_0x1c9e21['query']['sort']);_0x1f7e04[_0x653a('0x41')]=qs[_0x653a('0x37')](_[_0x653a('0x74')](_0x1c9e21['query'],_0x4b1e4e['filters']));if(_0x1c9e21[_0x653a('0x35')][_0x653a('0x42')]){_0x1f7e04[_0x653a('0x41')]=_[_0x653a('0x43')](_0x1f7e04[_0x653a('0x41')],{'$or':_[_0x653a('0x30')](_0x1f7e04[_0x653a('0x3a')],function(_0x3aa470){var _0x1e025d={};_0x1e025d[_0x3aa470]={'$like':'%'+_0x1c9e21[_0x653a('0x35')]['filter']+'%'};return _0x1e025d;})});}_0x1f7e04=_[_0x653a('0x43')]({},_0x1f7e04,_0x1c9e21[_0x653a('0x4a')]);return _0x49f728[_0x653a('0x73')](_0x1f7e04);}})['then'](function(_0x1c01af){if(_0x1c01af){_0x4e8400=_0x1c01af[_0x653a('0x3c')];if(!_0x1c9e21[_0x653a('0x35')][_0x653a('0x3d')]('nolimit')){_0x1f7e04[_0x653a('0x1f')]=qs[_0x653a('0x1f')](_0x1c9e21['query'][_0x653a('0x1f')]);_0x1f7e04['offset']=qs['offset'](_0x1c9e21[_0x653a('0x35')][_0x653a('0x1e')]);}return _0x49f728['getSounds'](_0x1f7e04);}})[_0x653a('0x26')](function(_0x10e0f3){if(_0x10e0f3){return _0x10e0f3?{'count':_0x4e8400,'rows':_0x10e0f3}:null;}})['then'](respondWithResult(_0x3fbcea,null))[_0x653a('0x4d')](handleError(_0x3fbcea,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 04d38f2..bbd2526 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 _0xed2c=['voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','VoiceMusicOnHold'];(function(_0x880b72,_0x318124){var _0x171fe2=function(_0x294a6b){while(--_0x294a6b){_0x880b72['push'](_0x880b72['shift']());}};_0x171fe2(++_0x318124);}(_0xed2c,0x14b));var _0xced2=function(_0x2bc09e,_0x1ae747){_0x2bc09e=_0x2bc09e-0x0;var _0x3f7c75=_0xed2c[_0x2bc09e];return _0x3f7c75;};'use strict';var _=require(_0xced2('0x0'));var util=require('util');var logger=require(_0xced2('0x1'))(_0xced2('0x2'));var moment=require(_0xced2('0x3'));var BPromise=require(_0xced2('0x4'));var rp=require(_0xced2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xced2('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x7e171b,_0x54870c){return _0x7e171b[_0xced2('0x7')](_0xced2('0x8'),attributes,{'tableName':_0xced2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7503=['define','VoiceMusicOnHold','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7503,0x157));var _0x3750=function(_0x317725,_0x1bd734){_0x317725=_0x317725-0x0;var _0x1e08cb=_0x7503[_0x317725];return _0x1e08cb;};'use strict';var _=require('lodash');var util=require(_0x3750('0x0'));var logger=require(_0x3750('0x1'))(_0x3750('0x2'));var moment=require(_0x3750('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3750('0x4'));var rimraf=require(_0x3750('0x5'));var config=require(_0x3750('0x6'));var attributes=require(_0x3750('0x7'));module[_0x3750('0x8')]=function(_0x45df91,_0x417559){return _0x45df91[_0x3750('0x9')](_0x3750('0xa'),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 97c4ae1..3e29c9b 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1232d5,_0x3b1bcf){var _0x48c11e=function(_0x433097){while(--_0x433097){_0x1232d5['push'](_0x1232d5['shift']());}};_0x48c11e(++_0x3b1bcf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xcb91[_0x4d337e];return _0x247963;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x4a1111,_0x23cb82){var _0x15c9ee=function(_0x2b3953){while(--_0x2b3953){_0x4a1111['push'](_0x4a1111['shift']());}};_0x15c9ee(++_0x23cb82);}(_0xedd9,0xfc));var _0x9edd=function(_0x220c91,_0x1f00d3){_0x220c91=_0x220c91-0x0;var _0x2dcef=_0xedd9[_0x220c91];return _0x2dcef;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6ae881d..2a4d6fb 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 _0x0689=['destroy','delete','removeAgents','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update'];(function(_0x19be81,_0x15be20){var _0x32b8a5=function(_0x3c3b26){while(--_0x3c3b26){_0x19be81['push'](_0x19be81['shift']());}};_0x32b8a5(++_0x15be20);}(_0x0689,0x161));var _0x9068=function(_0xe429f8,_0xb5ddb4){_0xe429f8=_0xe429f8-0x0;var _0x439723=_0x0689[_0xe429f8];return _0x439723;};'use strict';var multer=require('multer');var util=require(_0x9068('0x0'));var path=require('path');var timeout=require(_0x9068('0x1'));var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require(_0x9068('0x5'));var interaction=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var controller=require(_0x9068('0x8'));router[_0x9068('0x9')]('/',auth[_0x9068('0xa')](),controller['index']);router[_0x9068('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9068('0xb')]);router[_0x9068('0x9')](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0xd')]);router[_0x9068('0x9')](_0x9068('0xe'),auth[_0x9068('0xa')](),controller[_0x9068('0xf')]);router['get'](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x11')]);router[_0x9068('0x12')]('/',auth['isAuthenticated'](),controller[_0x9068('0x13')]);router[_0x9068('0x12')](_0x9068('0xe'),auth['isAuthenticated'](),controller[_0x9068('0x14')]);router[_0x9068('0x12')](_0x9068('0x10'),auth['isAuthenticated'](),controller[_0x9068('0x15')]);router[_0x9068('0x16')]('/:id',auth[_0x9068('0xa')](),controller[_0x9068('0x17')]);router['delete'](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0x18')]);router[_0x9068('0x19')]('/:id/users',auth[_0x9068('0xa')](),controller[_0x9068('0x1a')]);router[_0x9068('0x19')](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x1b')]);module[_0x9068('0x1c')]=router; \ No newline at end of file +var _0x1e9d=['express','Router','fs-extra','../../components/interaction/service','get','/describe','isAuthenticated','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout'];(function(_0x2928c8,_0x1d11d5){var _0x1562bd=function(_0x2b3c9a){while(--_0x2b3c9a){_0x2928c8['push'](_0x2928c8['shift']());}};_0x1562bd(++_0x1d11d5);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x5389f6,_0x286ff3){_0x5389f6=_0x5389f6-0x0;var _0xcc48de=_0x1e9d[_0x5389f6];return _0xcc48de;};'use strict';var multer=require(_0xd1e9('0x0'));var util=require('util');var path=require(_0xd1e9('0x1'));var timeout=require(_0xd1e9('0x2'));var express=require(_0xd1e9('0x3'));var router=express[_0xd1e9('0x4')]();var fs_extra=require(_0xd1e9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e9('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd1e9('0x7')](_0xd1e9('0x8'),auth[_0xd1e9('0x9')](),controller['describe']);router[_0xd1e9('0x7')]('/:id',auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xa')]);router[_0xd1e9('0x7')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xc')]);router[_0xd1e9('0x7')](_0xd1e9('0xd'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xe')]);router[_0xd1e9('0xf')]('/',auth['isAuthenticated'](),controller[_0xd1e9('0x10')]);router[_0xd1e9('0xf')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x11')]);router['post'](_0xd1e9('0xd'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x12')]);router[_0xd1e9('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd1e9('0x14')]('/:id',auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x15')]);router[_0xd1e9('0x14')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x16')]);router[_0xd1e9('0x14')](_0xd1e9('0xd'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xd1e9('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 8eabfe4..58e6b99 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 _0xff20=['sequelize','exports','getDataValue','STRING','INTEGER'];(function(_0x9e60c8,_0x19fa26){var _0x4dbeaf=function(_0x536cd9){while(--_0x536cd9){_0x9e60c8['push'](_0x9e60c8['shift']());}};_0x4dbeaf(++_0x19fa26);}(_0xff20,0x1b8));var _0x0ff2=function(_0x58ec33,_0x4cbab5){_0x58ec33=_0x58ec33-0x0;var _0x392112=_0xff20[_0x58ec33];return _0x392112;};'use strict';var Sequelize=require(_0x0ff2('0x0'));module[_0x0ff2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x1cac45){return'system-'+this[_0x0ff2('0x2')]('name')+'-';}},'description':{'type':Sequelize[_0x0ff2('0x3')]},'callerIdAll':{'type':Sequelize[_0x0ff2('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0x0ff2('0x4')]}}; \ No newline at end of file +var _0x82ab=['INTEGER','name','VIRTUAL','getDataValue','STRING'];(function(_0x5690a4,_0x572d64){var _0x170f91=function(_0x5458c1){while(--_0x5458c1){_0x5690a4['push'](_0x5690a4['shift']());}};_0x170f91(++_0x572d64);}(_0x82ab,0x128));var _0xb82a=function(_0x3ba748,_0x4b8fb9){_0x3ba748=_0x3ba748-0x0;var _0x5b04e2=_0x82ab[_0x3ba748];return _0x5b04e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb82a('0x0')},'prefix':{'type':Sequelize[_0xb82a('0x1')],'get':function(_0xc872ae){return'system-'+this[_0xb82a('0x2')](_0xb82a('0x0'))+'-';}},'description':{'type':Sequelize[_0xb82a('0x3')]},'callerIdAll':{'type':Sequelize[_0xb82a('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xb82a('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 40097f6..4c21da1 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 _0xf4f4=['role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','context','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','User','order','findOne','Team','getTeams','addTeams','findAll','Agents','online','voicePause','interface','each','upsert','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','VoicePrefixes','destroy','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','keys','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x456392,_0x2446d1){var _0x42983f=function(_0x13cae6){while(--_0x13cae6){_0x456392['push'](_0x456392['shift']());}};_0x42983f(++_0x2446d1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0xf4f4[_0x5aa1e2];return _0x399098;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];config[_0x4f4f('0x1b')]=_[_0x4f4f('0x1c')](config[_0x4f4f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f4f('0x1d'))(new Redis(config['redis']));require(_0x4f4f('0x1e'))[_0x4f4f('0x1f')](socket);function respondWithStatusCode(_0x3e16e9,_0x38535d){_0x38535d=_0x38535d||0xcc;return function(_0x4c849f){if(_0x4c849f){return _0x3e16e9[_0x4f4f('0x20')](_0x38535d);}return _0x3e16e9['status'](_0x38535d)['end']();};}function respondWithResult(_0x58de77,_0x422894){_0x422894=_0x422894||0xc8;return function(_0x8d65a2){if(_0x8d65a2){return _0x58de77[_0x4f4f('0x21')](_0x422894)[_0x4f4f('0x22')](_0x8d65a2);}};}function respondWithFilteredResult(_0x2d5e5d,_0x1777eb){return function(_0x1245c4){if(_0x1245c4){var _0x60ce2=typeof _0x1777eb[_0x4f4f('0x23')]===_0x4f4f('0x24')&&typeof _0x1777eb[_0x4f4f('0x25')]===_0x4f4f('0x24');var _0x499277=_0x1245c4[_0x4f4f('0x26')];var _0x4622c2=_0x60ce2?0x0:_0x1777eb[_0x4f4f('0x23')];var _0x201c60=_0x60ce2?_0x1245c4[_0x4f4f('0x26')]:_0x1777eb[_0x4f4f('0x23')]+_0x1777eb[_0x4f4f('0x25')];var _0x3e33d5;if(_0x201c60>=_0x499277){_0x201c60=_0x499277;_0x3e33d5=0xc8;}else{_0x3e33d5=0xce;}_0x2d5e5d[_0x4f4f('0x21')](_0x3e33d5);return _0x2d5e5d[_0x4f4f('0x27')](_0x4f4f('0x28'),_0x4622c2+'-'+_0x201c60+'/'+_0x499277)[_0x4f4f('0x22')](_0x1245c4);}return null;};}function patchUpdates(_0x17984d){return function(_0xc78135){try{jsonpatch['apply'](_0xc78135,_0x17984d,!![]);}catch(_0x4f7261){return BPromise['reject'](_0x4f7261);}return _0xc78135[_0x4f4f('0x29')]();};}function saveUpdates(_0x43e661,_0x5186ac){return function(_0x3960ae){if(_0x3960ae){return _0x3960ae[_0x4f4f('0x2a')](_0x43e661)[_0x4f4f('0x2b')](function(_0x2ec92a){return _0x2ec92a;});}return null;};}function removeEntity(_0x113ff7,_0x31b30e){return function(_0xa6371b){if(_0xa6371b){return _0xa6371b['destroy']()[_0x4f4f('0x2b')](function(){var _0x237cf9=_0xa6371b[_0x4f4f('0x2c')]({'plain':!![]});var _0x15c79c=_0x4f4f('0x2d');return db['UserProfileResource'][_0x4f4f('0x2e')]({'where':{'type':_0x15c79c,'resourceId':_0x237cf9['id']}})[_0x4f4f('0x2b')](function(){return _0xa6371b;});})[_0x4f4f('0x2b')](function(){_0x113ff7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2490,_0x73b8bb){return function(_0x5b4f6a){if(!_0x5b4f6a){_0x4c2490[_0x4f4f('0x20')](0x194);}return _0x5b4f6a;};}function handleError(_0x39c1a8,_0x2e688a){_0x2e688a=_0x2e688a||0x1f4;return function(_0x5eb7c9){logger[_0x4f4f('0x2f')](_0x5eb7c9[_0x4f4f('0x30')]);if(_0x5eb7c9['name']){delete _0x5eb7c9[_0x4f4f('0x31')];}_0x39c1a8[_0x4f4f('0x21')](_0x2e688a)[_0x4f4f('0x32')](_0x5eb7c9);};}exports['index']=function(_0x6bdf15,_0x343c75){var _0x59bdb0={},_0x5517d7={},_0x465a36={'count':0x0,'rows':[]};var _0x305bf7=_[_0x4f4f('0x33')](db[_0x4f4f('0x34')][_0x4f4f('0x35')],function(_0x8d0f53){return{'name':_0x8d0f53[_0x4f4f('0x36')],'type':_0x8d0f53[_0x4f4f('0x37')][_0x4f4f('0x38')]};});_0x5517d7[_0x4f4f('0x39')]=_['map'](_0x305bf7,'name');_0x5517d7[_0x4f4f('0x3a')]=_['keys'](_0x6bdf15[_0x4f4f('0x3a')]);_0x5517d7[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],_0x5517d7[_0x4f4f('0x3a')]);_0x59bdb0[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x59bdb0[_0x4f4f('0x3d')]=_0x59bdb0['attributes'][_0x4f4f('0x3f')]?_0x59bdb0[_0x4f4f('0x3d')]:_0x5517d7[_0x4f4f('0x39')];if(!_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x59bdb0[_0x4f4f('0x25')]=qs[_0x4f4f('0x25')](_0x6bdf15[_0x4f4f('0x3a')]['limit']);_0x59bdb0[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x6bdf15[_0x4f4f('0x3a')]['offset']);}_0x59bdb0['order']=qs[_0x4f4f('0x42')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x59bdb0[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x6bdf15[_0x4f4f('0x3a')],_0x5517d7[_0x4f4f('0x3b')]),_0x305bf7);if(_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x45')]){_0x59bdb0[_0x4f4f('0x43')]=_[_0x4f4f('0x46')](_0x59bdb0['where'],{'$or':_[_0x4f4f('0x33')](_0x305bf7,function(_0x1b031e){if(_0x1b031e[_0x4f4f('0x37')]!==_0x4f4f('0x47')){var _0x18e805={};_0x18e805[_0x1b031e['name']]={'$like':'%'+_0x6bdf15['query'][_0x4f4f('0x45')]+'%'};return _0x18e805;}})});}_0x59bdb0=_[_0x4f4f('0x46')]({},_0x59bdb0,_0x6bdf15[_0x4f4f('0x48')]);var _0xa8f1a5={'where':_0x59bdb0['where']};return db[_0x4f4f('0x34')]['count'](_0xa8f1a5)[_0x4f4f('0x2b')](function(_0x5a7c94){_0x465a36['count']=_0x5a7c94;if(_0x6bdf15[_0x4f4f('0x3a')]['includeAll']){_0x59bdb0[_0x4f4f('0x49')]=[{'all':!![]}];}return db[_0x4f4f('0x34')]['findAll'](_0x59bdb0);})[_0x4f4f('0x2b')](function(_0x2d8ff6){_0x465a36['rows']=_0x2d8ff6;return _0x465a36;})[_0x4f4f('0x2b')](respondWithFilteredResult(_0x343c75,_0x59bdb0))[_0x4f4f('0x4a')](handleError(_0x343c75,null));};exports[_0x4f4f('0x4b')]=function(_0x3defd0,_0x162674){var _0x62b468={'raw':![],'where':{'id':_0x3defd0[_0x4f4f('0x4c')]['id']}},_0xb0d1b2={};_0xb0d1b2[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x34')][_0x4f4f('0x35')]);_0xb0d1b2[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x3defd0[_0x4f4f('0x3a')]);_0xb0d1b2['filters']=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],_0xb0d1b2['query']);_0x62b468[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],qs[_0x4f4f('0x3e')](_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x62b468[_0x4f4f('0x3d')]=_0x62b468[_0x4f4f('0x3d')]['length']?_0x62b468[_0x4f4f('0x3d')]:_0xb0d1b2[_0x4f4f('0x39')];if(_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x4e')]){_0x62b468[_0x4f4f('0x49')]=[{'all':!![]}];}_0x62b468=_[_0x4f4f('0x46')]({},_0x62b468,_0x3defd0[_0x4f4f('0x48')]);return db[_0x4f4f('0x34')][_0x4f4f('0x4f')](_0x62b468)['then'](handleEntityNotFound(_0x162674,null))[_0x4f4f('0x2b')](respondWithResult(_0x162674,null))[_0x4f4f('0x4a')](handleError(_0x162674,null));};exports['destroy']=function(_0x5ac4df,_0x5941ac){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x5ac4df[_0x4f4f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5941ac,null))[_0x4f4f('0x2b')](removeEntity(_0x5941ac,null))['catch'](handleError(_0x5941ac,null));};exports[_0x4f4f('0x50')]=function(_0x1c181e,_0x3c0d7b){return db[_0x4f4f('0x34')][_0x4f4f('0x50')]()[_0x4f4f('0x2b')](respondWithResult(_0x3c0d7b,null))[_0x4f4f('0x4a')](handleError(_0x3c0d7b,null));};exports[_0x4f4f('0x51')]=function(_0x17f6fb,_0x4dbce2){var _0x59e207;return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x4c04eb){return db['VoicePrefix'][_0x4f4f('0x51')](_0x17f6fb[_0x4f4f('0x54')],{'transaction':_0x4c04eb})[_0x4f4f('0x2b')](function(_0x55a5e4){_0x59e207=_0x55a5e4['get']({'plain':!![]});return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x59e207[_0x4f4f('0x56')]},'raw':!![]})[_0x4f4f('0x2b')](function(_0x37cf8e){return createVoicePrefixExtensions(_0x59e207,_0x37cf8e,_0x4c04eb);});});})[_0x4f4f('0x2b')](function(){var _0xe66fc=_0x17f6fb[_0x4f4f('0x57')][_0x4f4f('0x2c')]({'plain':!![]});if(!_0xe66fc)throw new Error(_0x4f4f('0x58'));if(_0xe66fc[_0x4f4f('0x59')]==='user'){var _0x585c06=_0x59e207;return db[_0x4f4f('0x5a')][_0x4f4f('0x4f')]({'where':{'name':_0x4f4f('0x2d'),'userProfileId':_0xe66fc[_0x4f4f('0x5b')]},'raw':!![]})['then'](function(_0x1bef77){if(_0x1bef77&&_0x1bef77['autoAssociation']===0x0){return db[_0x4f4f('0x5c')][_0x4f4f('0x51')]({'name':_0x585c06[_0x4f4f('0x31')],'resourceId':_0x585c06['id'],'type':_0x1bef77['name'],'sectionId':_0x1bef77['id']},{})[_0x4f4f('0x2b')](function(){return _0x59e207;});}else{return _0x59e207;}})[_0x4f4f('0x4a')](function(_0x23e9a9){logger['error'](_0x4f4f('0x5d'),_0x23e9a9);throw _0x23e9a9;});}return _0x59e207;})[_0x4f4f('0x2b')](respondWithResult(_0x4dbce2,null))[_0x4f4f('0x4a')](handleError(_0x4dbce2,null));};function Extension(_0x58a5dd,_0x2b01da,_0x16f162,_0x3fedae){this['context']=_0x4f4f('0x5e');this['exten']=_0x58a5dd;this[_0x4f4f('0x5f')]=_0x16f162;this[_0x4f4f('0x37')]=_0x4f4f('0x60');this[_0x4f4f('0x61')]=_0x4f4f('0x62');this[_0x4f4f('0x63')]=_0x2b01da;this[_0x4f4f('0x64')]=_0x3fedae;}function createVoicePrefixExtensions(_0xb2dfda,_0x40dffa,_0x36f369){return new BPromise(function(_0x269e0d,_0x5ba1e2){var _0x4794fe=new Extension(formatPrefixName(_0xb2dfda[_0x4f4f('0x65')]),0x1,_0x4f4f('0x66'),'Voice\x20Prefix');_0x4794fe[_0x4f4f('0x67')]=_0xb2dfda['id'];return db[_0x4f4f('0x55')][_0x4f4f('0x51')](_0x4794fe,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x561411){var _0x28f9e1=_0x561411[_0x4f4f('0x2c')]({'plain':!![]});var _0xc9a47a=_[_0x4f4f('0x33')](addVoicePrefixExtensions(_0xb2dfda,_0x40dffa),function(_0x157af6){_0x157af6['VoiceExtensionId']=_0x28f9e1['id'];_0x157af6[_0x4f4f('0x67')]=_0xb2dfda['id'];return _0x157af6;});return db['VoiceExtension'][_0x4f4f('0x68')](_0xc9a47a,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x2da4ea){if(!_0x2da4ea){return _0x5ba1e2(_0x4f4f('0x69'));}else{return _0x269e0d(_0x2da4ea);}})[_0x4f4f('0x4a')](function(_0x23366b){return _0x5ba1e2(_0x23366b);});});;});};function addVoicePrefixExtensions(_0x4bbbf6,_0x50590c){var _0x15c86f=[];var _0x4c42fd=formatPrefixName(_0x4bbbf6[_0x4f4f('0x65')]);_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x2,_0x4f4f('0x6b'),_0x4f4f('0x6c')+_0x4bbbf6[_0x4f4f('0x31')]));if(_0x4bbbf6[_0x4f4f('0x6d')]){_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,_0x4f4f('0x6b'),_0x4f4f('0x6e')+_0x4bbbf6[_0x4f4f('0x6d')]));}else{_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,'NoOp','No\x20callerid\x20available'));}_0x15c86f['push'](new Extension(_0x4c42fd,0x4,_0x4f4f('0x6f'),_0x50590c[_0x4f4f('0x70')]+','+'${EXTEN:'+(0x8+_0x4bbbf6[_0x4f4f('0x31')][_0x4f4f('0x3f')])+'}'+','+0x1));return _0x15c86f;}function formatPrefixName(_0x43d6c0){var _0x3007ff='_';for(var _0x12523f=0x0;_0x12523f<_0x43d6c0[_0x4f4f('0x3f')];_0x12523f++){if(_0x43d6c0['charAt'](_0x12523f)=='-'){_0x3007ff+=_0x43d6c0[_0x4f4f('0x71')](_0x12523f);}else{_0x3007ff+='['+_0x43d6c0[_0x4f4f('0x71')](_0x12523f)+']';}}_0x3007ff+='.';return _0x3007ff;}exports[_0x4f4f('0x2a')]=function(_0x24ed71,_0x33f4fd,_0x36299e){var _0x1d756b=_0x24ed71[_0x4f4f('0x54')];_0x1d756b['prefix']=_0x4f4f('0x72')+_0x1d756b[_0x4f4f('0x31')]+'-';return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x5f0efc){return db[_0x4f4f('0x34')]['update'](_0x1d756b,{'where':{'id':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x1d756b[_0x4f4f('0x56')]},'raw':!![]})['then'](function(_0x90813f){return createVoicePrefixExtensions(_0x1d756b,_0x90813f,_0x5f0efc);});});});})['then'](function(){return db[_0x4f4f('0x34')]['findById'](_0x1d756b['id']);})[_0x4f4f('0x2b')](respondWithResult(_0x33f4fd,null))[_0x4f4f('0x4a')](handleError(_0x33f4fd,null));};exports[_0x4f4f('0x73')]=function(_0x577fd9,_0x41c31c,_0x4b0ab5){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x577fd9[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x41c31c,null))[_0x4f4f('0x2b')](function(_0x4511c6){if(_0x4511c6){return _0x4511c6[_0x4f4f('0x73')](_0x577fd9[_0x4f4f('0x54')][_0x4f4f('0x74')],_['omit'](_0x577fd9[_0x4f4f('0x54')],[_0x4f4f('0x74'),'id'])||{})[_0x4f4f('0x75')](function(_0x14e4f3){for(var _0x42c638=0x0;_0x42c638<_0x577fd9[_0x4f4f('0x54')]['ids'][_0x4f4f('0x3f')];_0x42c638+=0x1){socket[_0x4f4f('0x76')](_0x4f4f('0x77'),{'UserId':Number(_0x577fd9[_0x4f4f('0x54')]['ids'][_0x42c638]),'VoicePrefixId':Number(_0x577fd9[_0x4f4f('0x4c')]['id'])});}return _0x14e4f3;});}})[_0x4f4f('0x2b')](respondWithResult(_0x41c31c,null))[_0x4f4f('0x4a')](handleError(_0x41c31c,null));};exports['removeAgents']=function(_0x838d05,_0x40bab8,_0x5ae1b6){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x838d05[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x40bab8,null))[_0x4f4f('0x2b')](function(_0x25cd1c){if(_0x25cd1c){return _0x25cd1c['removeAgents'](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])[_0x4f4f('0x2b')](function(){if(_[_0x4f4f('0x78')](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])){for(var _0x5b6633=0x0;_0x5b6633<_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x4f4f('0x3f')];_0x5b6633+=0x1){socket['emit'](_0x4f4f('0x79'),{'UserId':Number(_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x5b6633]),'VoicePrefixId':Number(_0x838d05[_0x4f4f('0x4c')]['id'])});}}else{socket[_0x4f4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x838d05[_0x4f4f('0x3a')]['ids']),'VoicePrefixId':Number(_0x838d05['params']['id'])});}});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x40bab8,null))[_0x4f4f('0x4a')](handleError(_0x40bab8,null));};exports[_0x4f4f('0x7a')]=function(_0x33c295,_0x762acd,_0x362c6d){var _0x1d1f5f={};var _0x19e743={};var _0x167c43;var _0x50058d;return db[_0x4f4f('0x34')]['findOne']({'where':{'id':_0x33c295[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x762acd,null))['then'](function(_0x3286b1){if(_0x3286b1){_0x167c43=_0x3286b1;_0x19e743[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7b')][_0x4f4f('0x35')]);_0x19e743[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x33c295[_0x4f4f('0x3a')]);_0x19e743['filters']=_[_0x4f4f('0x3c')](_0x19e743[_0x4f4f('0x39')],_0x19e743[_0x4f4f('0x3a')]);_0x1d1f5f['attributes']=_[_0x4f4f('0x3c')](_0x19e743['model'],qs['fields'](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x1d1f5f[_0x4f4f('0x3d')]=_0x1d1f5f[_0x4f4f('0x3d')]['length']?_0x1d1f5f[_0x4f4f('0x3d')]:_0x19e743['model'];_0x1d1f5f[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x1d1f5f[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x33c295[_0x4f4f('0x3a')],_0x19e743[_0x4f4f('0x3b')]));if(_0x33c295[_0x4f4f('0x3a')]['filter']){_0x1d1f5f['where']=_[_0x4f4f('0x46')](_0x1d1f5f[_0x4f4f('0x43')],{'$or':_[_0x4f4f('0x33')](_0x1d1f5f[_0x4f4f('0x3d')],function(_0x515d05){var _0x485129={};_0x485129[_0x515d05]={'$like':'%'+_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x45')]+'%'};return _0x485129;})});}_0x1d1f5f=_[_0x4f4f('0x46')]({},_0x1d1f5f,_0x33c295[_0x4f4f('0x48')]);return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})['then'](function(_0x10fa9e){if(_0x10fa9e){_0x50058d=_0x10fa9e[_0x4f4f('0x3f')];if(!_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x1d1f5f['limit']=qs[_0x4f4f('0x25')](_0x33c295['query']['limit']);_0x1d1f5f[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x33c295[_0x4f4f('0x3a')]['offset']);}return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})[_0x4f4f('0x2b')](function(_0x56015c){if(_0x56015c){return _0x56015c?{'count':_0x50058d,'rows':_0x56015c}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x762acd,null))[_0x4f4f('0x4a')](handleError(_0x762acd,null));};exports['getTeams']=function(_0xaa0e50,_0x23e8bd,_0x3b5214){var _0x38ea5d={};var _0x4632c0={};var _0x6ec076;var _0x56f2c5;return db[_0x4f4f('0x34')][_0x4f4f('0x7d')]({'where':{'id':_0xaa0e50[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x23e8bd,null))[_0x4f4f('0x2b')](function(_0x3d0e57){if(_0x3d0e57){_0x6ec076=_0x3d0e57;_0x4632c0[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7e')][_0x4f4f('0x35')]);_0x4632c0[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0xaa0e50[_0x4f4f('0x3a')]);_0x4632c0[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x4632c0['model'],_0x4632c0[_0x4f4f('0x3a')]);_0x38ea5d['attributes']=_[_0x4f4f('0x3c')](_0x4632c0[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0xaa0e50['query'][_0x4f4f('0x3e')]));_0x38ea5d[_0x4f4f('0x3d')]=_0x38ea5d[_0x4f4f('0x3d')][_0x4f4f('0x3f')]?_0x38ea5d[_0x4f4f('0x3d')]:_0x4632c0['model'];_0x38ea5d[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0xaa0e50[_0x4f4f('0x3a')]['sort']);_0x38ea5d[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0xaa0e50['query'],_0x4632c0[_0x4f4f('0x3b')]));if(_0xaa0e50['query'][_0x4f4f('0x45')]){_0x38ea5d['where']=_['merge'](_0x38ea5d['where'],{'$or':_['map'](_0x38ea5d['attributes'],function(_0x446cbd){var _0x2f2cb9={};_0x2f2cb9[_0x446cbd]={'$like':'%'+_0xaa0e50['query']['filter']+'%'};return _0x2f2cb9;})});}_0x38ea5d=_[_0x4f4f('0x46')]({},_0x38ea5d,_0xaa0e50[_0x4f4f('0x48')]);return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})['then'](function(_0x5ad9f6){if(_0x5ad9f6){_0x56f2c5=_0x5ad9f6['length'];if(!_0xaa0e50[_0x4f4f('0x3a')]['hasOwnProperty']('nolimit')){_0x38ea5d[_0x4f4f('0x25')]=qs['limit'](_0xaa0e50[_0x4f4f('0x3a')][_0x4f4f('0x25')]);_0x38ea5d['offset']=qs[_0x4f4f('0x23')](_0xaa0e50[_0x4f4f('0x3a')]['offset']);}return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})[_0x4f4f('0x2b')](function(_0x3be76f){if(_0x3be76f){return _0x3be76f?{'count':_0x56f2c5,'rows':_0x3be76f}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x23e8bd,null))['catch'](handleError(_0x23e8bd,null));};exports[_0x4f4f('0x80')]=function(_0x349e9c,_0x2fc478,_0x3a745a){var _0x53c962=_0x349e9c[_0x4f4f('0x54')][_0x4f4f('0x74')];var _0x27b573;return db[_0x4f4f('0x7e')][_0x4f4f('0x81')]({'where':{'id':_0x53c962},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id',_0x4f4f('0x31'),_0x4f4f('0x83'),_0x4f4f('0x84'),_0x4f4f('0x85')],'raw':!![]}]})[_0x4f4f('0x2b')](function(_0x3f87c8){if(_0x3f87c8){_0x27b573=_0x3f87c8;var _0x22e619=_['flatMap'](_0x3f87c8,function(_0x3bfc19){var _0x150474=_0x3bfc19[_0x4f4f('0x2c')]({'plain':!![]});return _0x150474[_0x4f4f('0x82')];});return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x349e9c['params']['id']}})[_0x4f4f('0x2b')](function(_0x5a4d26){return db[_0x4f4f('0x52')]['transaction'](function(_0x2d1cc1){return _0x5a4d26['addTeams'](_0x53c962,{'transaction':_0x2d1cc1})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x27b573,function(_0x2b6319){return db['TeamVoicePrefix'][_0x4f4f('0x87')]({'TeamId':_0x2b6319['id'],'VoicePrefixId':_0x349e9c[_0x4f4f('0x4c')]['id']},{'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x22e619,function(_0xbe8586){return db['UserVoicePrefix'][_0x4f4f('0x88')]({'where':{'UserId':_0xbe8586['id'],'VoicePrefixId':_0x349e9c['params']['id']},'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){_0x22e619[_0x4f4f('0x89')](function(_0x4bb547){socket['emit']('userVoicePrefix:save',{'UserId':_0x4bb547['id'],'VoicePrefixId':_0x5a4d26['id']});});});});});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2fc478,null))[_0x4f4f('0x4a')](handleError(_0x2fc478,null));};exports[_0x4f4f('0x8a')]=function(_0x4c178d,_0x2cf10a,_0x53a849){return db[_0x4f4f('0x7e')]['findAll']({'where':{'id':_0x4c178d[_0x4f4f('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id'],'raw':!![]}]})[_0x4f4f('0x2b')](handleEntityNotFound(_0x2cf10a,null))[_0x4f4f('0x2b')](function(_0x5063a6){var _0x1ce179=_[_0x4f4f('0x33')](_0x5063a6,'id');var _0x3f2b27=[];var _0x28049b=[];var _0x13418d=squel[_0x4f4f('0x8b')]();_0x13418d[_0x4f4f('0x8c')](_0x4f4f('0x8d'))[_0x4f4f('0x8e')](_0x4f4f('0x8f'),'tq')[_0x4f4f('0x90')]('user_has_teams','ut',_0x4f4f('0x91'))[_0x4f4f('0x43')](_0x4f4f('0x92'),_0x4c178d[_0x4f4f('0x4c')]['id']);for(var _0x223179=0x0;_0x223179<_0x5063a6['length'];_0x223179+=0x1){let _0x373ead=_0x5063a6[_0x223179];for(var _0x53dfb2=0x0;_0x53dfb2<_0x373ead[_0x4f4f('0x82')][_0x4f4f('0x3f')];_0x53dfb2+=0x1){let _0x3fcb64=_0x373ead[_0x4f4f('0x82')][_0x53dfb2];var _0x57405d=_0x13418d[_0x4f4f('0x93')]();_0x57405d['where'](_0x4f4f('0x94'),_0x3fcb64['id']);_0x28049b[_0x4f4f('0x6a')](db[_0x4f4f('0x52')][_0x4f4f('0x3a')](_0x57405d[_0x4f4f('0x95')](),{'type':db[_0x4f4f('0x52')][_0x4f4f('0x96')][_0x4f4f('0x97')]})[_0x4f4f('0x2b')](function(_0x3ce86c){if(_0x3ce86c['length']===0x1){return _0x3fcb64['id'];}else{var _0xe830ee=_['every'](_[_0x4f4f('0x33')](_0x3ce86c,'TeamId'),function(_0x277c96){return _[_0x4f4f('0x98')](_0x1ce179,_0x277c96);});if(_0xe830ee){return _0x3fcb64['id'];}}}));}}return BPromise[_0x4f4f('0x99')](_0x28049b)[_0x4f4f('0x2b')](function(_0x3a0382){_0x3f2b27=_(_0x3f2b27)[_0x4f4f('0x9a')](_0x3a0382)[_0x4f4f('0x9b')]()[_0x4f4f('0x9c')]();return db['VoicePrefix'][_0x4f4f('0x4f')]({'where':{'id':_0x4c178d[_0x4f4f('0x4c')]['id']}})['then'](function(_0x379a2e){return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x35e9e7){return _0x379a2e['removeTeams'](_0x4c178d[_0x4f4f('0x3a')]['ids'],{'transaction':_0x35e9e7})[_0x4f4f('0x2b')](function(){if(!_['isEmpty'](_0x3f2b27)){return _0x379a2e[_0x4f4f('0x9d')](_0x3f2b27,{'transaction':_0x35e9e7});}})['then'](function(){_0x3f2b27['forEach'](function(_0x3f2df9){socket[_0x4f4f('0x76')](_0x4f4f('0x79'),{'UserId':_0x3f2df9,'VoicePrefixId':_0x379a2e['id']});});});});});});})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2cf10a,null))['catch'](handleError(_0x2cf10a,null));}; \ No newline at end of file +var _0x0972=['filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','sequelize','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','get','Extensions\x20creation\x20failed','prefix','push','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','length','charAt','system-','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','addTeams','Team','findAll','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','query'];(function(_0x16e73e,_0x4f70c5){var _0x37068d=function(_0x4d8815){while(--_0x4d8815){_0x16e73e['push'](_0x16e73e['shift']());}};_0x37068d(++_0x4f70c5);}(_0x0972,0x64));var _0x2097=function(_0x39e62e,_0x4aed50){_0x39e62e=_0x39e62e-0x0;var _0x3d09e7=_0x0972[_0x39e62e];return _0x3d09e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];config[_0x2097('0x1a')]=_[_0x2097('0x1b')](config[_0x2097('0x1a')],{'host':_0x2097('0x1c'),'port':0x18eb});var socket=require(_0x2097('0x1d'))(new Redis(config[_0x2097('0x1a')]));require(_0x2097('0x1e'))[_0x2097('0x1f')](socket);function respondWithStatusCode(_0x354387,_0x5d0a43){_0x5d0a43=_0x5d0a43||0xcc;return function(_0x639c14){if(_0x639c14){return _0x354387[_0x2097('0x20')](_0x5d0a43);}return _0x354387['status'](_0x5d0a43)['end']();};}function respondWithResult(_0x4fc8c5,_0x409deb){_0x409deb=_0x409deb||0xc8;return function(_0x588396){if(_0x588396){return _0x4fc8c5[_0x2097('0x21')](_0x409deb)[_0x2097('0x22')](_0x588396);}};}function respondWithFilteredResult(_0x43fec9,_0x1347e4){return function(_0x44c584){if(_0x44c584){var _0x53e2b4=typeof _0x1347e4[_0x2097('0x23')]===_0x2097('0x24')&&typeof _0x1347e4[_0x2097('0x25')]===_0x2097('0x24');var _0x1d3804=_0x44c584[_0x2097('0x26')];var _0x253f5d=_0x53e2b4?0x0:_0x1347e4[_0x2097('0x23')];var _0x5d8b9e=_0x53e2b4?_0x44c584['count']:_0x1347e4[_0x2097('0x23')]+_0x1347e4['limit'];var _0x227c00;if(_0x5d8b9e>=_0x1d3804){_0x5d8b9e=_0x1d3804;_0x227c00=0xc8;}else{_0x227c00=0xce;}_0x43fec9[_0x2097('0x21')](_0x227c00);return _0x43fec9['set'](_0x2097('0x27'),_0x253f5d+'-'+_0x5d8b9e+'/'+_0x1d3804)['json'](_0x44c584);}return null;};}function patchUpdates(_0x2e17c8){return function(_0xf32d3f){try{jsonpatch[_0x2097('0x28')](_0xf32d3f,_0x2e17c8,!![]);}catch(_0x20b93a){return BPromise[_0x2097('0x29')](_0x20b93a);}return _0xf32d3f[_0x2097('0x2a')]();};}function saveUpdates(_0x56390a,_0xae5f9){return function(_0x500234){if(_0x500234){return _0x500234[_0x2097('0x2b')](_0x56390a)[_0x2097('0x2c')](function(_0x345875){return _0x345875;});}return null;};}function removeEntity(_0x9f59bc,_0x499988){return function(_0x2d683a){if(_0x2d683a){return _0x2d683a[_0x2097('0x2d')]()['then'](function(){var _0x1229fc=_0x2d683a['get']({'plain':!![]});var _0x29b879='VoicePrefixes';return db[_0x2097('0x2e')][_0x2097('0x2d')]({'where':{'type':_0x29b879,'resourceId':_0x1229fc['id']}})[_0x2097('0x2c')](function(){return _0x2d683a;});})[_0x2097('0x2c')](function(){_0x9f59bc[_0x2097('0x21')](0xcc)[_0x2097('0x2f')]();});}};}function handleEntityNotFound(_0x450e0b,_0x4b443d){return function(_0x11242f){if(!_0x11242f){_0x450e0b[_0x2097('0x20')](0x194);}return _0x11242f;};}function handleError(_0x5cce55,_0x1398d0){_0x1398d0=_0x1398d0||0x1f4;return function(_0x41487d){logger['error'](_0x41487d['stack']);if(_0x41487d[_0x2097('0x30')]){delete _0x41487d[_0x2097('0x30')];}_0x5cce55[_0x2097('0x21')](_0x1398d0)[_0x2097('0x31')](_0x41487d);};}exports[_0x2097('0x32')]=function(_0x180654,_0x56c538){var _0xe1a381={},_0x56bb42={},_0x193160={'count':0x0,'rows':[]};var _0x3c36d3=_[_0x2097('0x33')](db[_0x2097('0x34')][_0x2097('0x35')],function(_0x395d9f){return{'name':_0x395d9f[_0x2097('0x36')],'type':_0x395d9f[_0x2097('0x37')][_0x2097('0x38')]};});_0x56bb42['model']=_[_0x2097('0x33')](_0x3c36d3,_0x2097('0x30'));_0x56bb42[_0x2097('0x39')]=_['keys'](_0x180654[_0x2097('0x39')]);_0x56bb42[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x56bb42[_0x2097('0x3c')],_0x56bb42['query']);_0xe1a381['attributes']=_['intersection'](_0x56bb42[_0x2097('0x3c')],qs[_0x2097('0x3d')](_0x180654[_0x2097('0x39')][_0x2097('0x3d')]));_0xe1a381[_0x2097('0x3e')]=_0xe1a381[_0x2097('0x3e')]['length']?_0xe1a381[_0x2097('0x3e')]:_0x56bb42[_0x2097('0x3c')];if(!_0x180654[_0x2097('0x39')][_0x2097('0x3f')](_0x2097('0x40'))){_0xe1a381[_0x2097('0x25')]=qs['limit'](_0x180654[_0x2097('0x39')][_0x2097('0x25')]);_0xe1a381[_0x2097('0x23')]=qs['offset'](_0x180654['query'][_0x2097('0x23')]);}_0xe1a381[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x180654[_0x2097('0x39')][_0x2097('0x42')]);_0xe1a381[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x180654[_0x2097('0x39')],_0x56bb42[_0x2097('0x3a')]),_0x3c36d3);if(_0x180654[_0x2097('0x39')][_0x2097('0x45')]){_0xe1a381['where']=_[_0x2097('0x46')](_0xe1a381[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0x3c36d3,function(_0x483900){if(_0x483900[_0x2097('0x37')]!==_0x2097('0x47')){var _0x26d448={};_0x26d448[_0x483900[_0x2097('0x30')]]={'$like':'%'+_0x180654[_0x2097('0x39')][_0x2097('0x45')]+'%'};return _0x26d448;}})});}_0xe1a381=_[_0x2097('0x46')]({},_0xe1a381,_0x180654[_0x2097('0x48')]);var _0x5ab893={'where':_0xe1a381[_0x2097('0x43')]};return db[_0x2097('0x34')][_0x2097('0x26')](_0x5ab893)[_0x2097('0x2c')](function(_0x12e0e2){_0x193160[_0x2097('0x26')]=_0x12e0e2;if(_0x180654[_0x2097('0x39')][_0x2097('0x49')]){_0xe1a381['include']=[{'all':!![]}];}return db[_0x2097('0x34')]['findAll'](_0xe1a381);})[_0x2097('0x2c')](function(_0x298e49){_0x193160[_0x2097('0x4a')]=_0x298e49;return _0x193160;})[_0x2097('0x2c')](respondWithFilteredResult(_0x56c538,_0xe1a381))[_0x2097('0x4b')](handleError(_0x56c538,null));};exports['show']=function(_0x2cf34e,_0x46ccbb){var _0x113c3b={'raw':![],'where':{'id':_0x2cf34e[_0x2097('0x4c')]['id']}},_0x39e0a4={};_0x39e0a4['model']=_[_0x2097('0x4d')](db[_0x2097('0x34')][_0x2097('0x35')]);_0x39e0a4[_0x2097('0x39')]=_[_0x2097('0x4d')](_0x2cf34e[_0x2097('0x39')]);_0x39e0a4[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x39e0a4['model'],_0x39e0a4[_0x2097('0x39')]);_0x113c3b[_0x2097('0x3e')]=_[_0x2097('0x3b')](_0x39e0a4[_0x2097('0x3c')],qs['fields'](_0x2cf34e['query']['fields']));_0x113c3b[_0x2097('0x3e')]=_0x113c3b[_0x2097('0x3e')]['length']?_0x113c3b[_0x2097('0x3e')]:_0x39e0a4[_0x2097('0x3c')];if(_0x2cf34e['query']['includeAll']){_0x113c3b[_0x2097('0x4e')]=[{'all':!![]}];}_0x113c3b=_[_0x2097('0x46')]({},_0x113c3b,_0x2cf34e[_0x2097('0x48')]);return db['VoicePrefix'][_0x2097('0x4f')](_0x113c3b)[_0x2097('0x2c')](handleEntityNotFound(_0x46ccbb,null))['then'](respondWithResult(_0x46ccbb,null))[_0x2097('0x4b')](handleError(_0x46ccbb,null));};exports[_0x2097('0x2d')]=function(_0xdfea21,_0xba6ef0){return db[_0x2097('0x34')]['find']({'where':{'id':_0xdfea21['params']['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0xba6ef0,null))[_0x2097('0x2c')](removeEntity(_0xba6ef0,null))[_0x2097('0x4b')](handleError(_0xba6ef0,null));};exports['describe']=function(_0x5c1739,_0x144719){return db[_0x2097('0x34')]['describe']()[_0x2097('0x2c')](respondWithResult(_0x144719,null))[_0x2097('0x4b')](handleError(_0x144719,null));};exports[_0x2097('0x50')]=function(_0x33490e,_0x390a52){var _0x4a709a;return db[_0x2097('0x51')][_0x2097('0x52')](function(_0x190859){return db['VoicePrefix'][_0x2097('0x50')](_0x33490e[_0x2097('0x53')],{'transaction':_0x190859})['then'](function(_0x12ba76){_0x4a709a=_0x12ba76['get']({'plain':!![]});return db[_0x2097('0x54')]['find']({'where':{'id':_0x4a709a['VoiceExtensionId']},'raw':!![]})['then'](function(_0x40cbe1){return createVoicePrefixExtensions(_0x4a709a,_0x40cbe1,_0x190859);});});})['then'](function(){var _0x54bea1=_0x33490e[_0x2097('0x55')]['get']({'plain':!![]});if(!_0x54bea1)throw new Error(_0x2097('0x56'));if(_0x54bea1[_0x2097('0x57')]==='user'){var _0x3e799f=_0x4a709a;return db[_0x2097('0x58')][_0x2097('0x4f')]({'where':{'name':_0x2097('0x59'),'userProfileId':_0x54bea1[_0x2097('0x5a')]},'raw':!![]})['then'](function(_0x2117e3){if(_0x2117e3&&_0x2117e3['autoAssociation']===0x0){return db[_0x2097('0x2e')][_0x2097('0x50')]({'name':_0x3e799f[_0x2097('0x30')],'resourceId':_0x3e799f['id'],'type':_0x2117e3['name'],'sectionId':_0x2117e3['id']},{})[_0x2097('0x2c')](function(){return _0x4a709a;});}else{return _0x4a709a;}})[_0x2097('0x4b')](function(_0x2f5016){logger[_0x2097('0x5b')](_0x2097('0x5c'),_0x2f5016);throw _0x2f5016;});}return _0x4a709a;})['then'](respondWithResult(_0x390a52,null))['catch'](handleError(_0x390a52,null));};function Extension(_0x265eac,_0x275578,_0x4cc782,_0x4ddb4b){this['context']='from-sip';this[_0x2097('0x5d')]=_0x265eac;this['app']=_0x4cc782;this[_0x2097('0x37')]=_0x2097('0x5e');this['description']=_0x2097('0x5f');this[_0x2097('0x60')]=_0x275578;this[_0x2097('0x61')]=_0x4ddb4b;}function createVoicePrefixExtensions(_0x103756,_0x2a2673,_0x60332a){return new BPromise(function(_0x15aa91,_0x8f7aaa){var _0x2ec365=new Extension(formatPrefixName(_0x103756['prefix']),0x1,_0x2097('0x62'),_0x2097('0x63'));_0x2ec365[_0x2097('0x64')]=_0x103756['id'];return db[_0x2097('0x54')][_0x2097('0x50')](_0x2ec365,{'transaction':_0x60332a})[_0x2097('0x2c')](function(_0x4befa9){var _0x43071d=_0x4befa9[_0x2097('0x65')]({'plain':!![]});var _0xcabda7=_[_0x2097('0x33')](addVoicePrefixExtensions(_0x103756,_0x2a2673),function(_0x1c4156){_0x1c4156['VoiceExtensionId']=_0x43071d['id'];_0x1c4156[_0x2097('0x64')]=_0x103756['id'];return _0x1c4156;});return db[_0x2097('0x54')]['bulkCreate'](_0xcabda7,{'transaction':_0x60332a})['then'](function(_0x580c1e){if(!_0x580c1e){return _0x8f7aaa(_0x2097('0x66'));}else{return _0x15aa91(_0x580c1e);}})[_0x2097('0x4b')](function(_0x319d3b){return _0x8f7aaa(_0x319d3b);});});;});};function addVoicePrefixExtensions(_0x3edb3e,_0x168703){var _0x18d90a=[];var _0x2e287b=formatPrefixName(_0x3edb3e[_0x2097('0x67')]);_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x2,'Set','CDR(prefix)='+_0x3edb3e[_0x2097('0x30')]));if(_0x3edb3e[_0x2097('0x69')]){_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x3,_0x2097('0x6a'),_0x2097('0x6b')+_0x3edb3e[_0x2097('0x69')]));}else{_0x18d90a['push'](new Extension(_0x2e287b,0x3,_0x2097('0x62'),_0x2097('0x6c')));}_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x4,_0x2097('0x6d'),_0x168703['context']+','+'${EXTEN:'+(0x8+_0x3edb3e[_0x2097('0x30')][_0x2097('0x6e')])+'}'+','+0x1));return _0x18d90a;}function formatPrefixName(_0x487f1f){var _0x3707da='_';for(var _0x426290=0x0;_0x426290<_0x487f1f[_0x2097('0x6e')];_0x426290++){if(_0x487f1f[_0x2097('0x6f')](_0x426290)=='-'){_0x3707da+=_0x487f1f[_0x2097('0x6f')](_0x426290);}else{_0x3707da+='['+_0x487f1f[_0x2097('0x6f')](_0x426290)+']';}}_0x3707da+='.';return _0x3707da;}exports[_0x2097('0x2b')]=function(_0x2c6f24,_0x54159e,_0x4533fd){var _0x283e2b=_0x2c6f24['body'];_0x283e2b[_0x2097('0x67')]=_0x2097('0x70')+_0x283e2b[_0x2097('0x30')]+'-';return db[_0x2097('0x51')][_0x2097('0x52')](function(_0x46d6b5){return db[_0x2097('0x34')][_0x2097('0x2b')](_0x283e2b,{'where':{'id':_0x283e2b['id']},'transaction':_0x46d6b5})[_0x2097('0x2c')](function(){return db[_0x2097('0x54')][_0x2097('0x2d')]({'where':{'VoicePrefixId':_0x283e2b['id']},'transaction':_0x46d6b5})['then'](function(){return db[_0x2097('0x54')][_0x2097('0x4f')]({'where':{'id':_0x283e2b[_0x2097('0x71')]},'raw':!![]})[_0x2097('0x2c')](function(_0x3c9e03){return createVoicePrefixExtensions(_0x283e2b,_0x3c9e03,_0x46d6b5);});});});})['then'](function(){return db[_0x2097('0x34')][_0x2097('0x72')](_0x283e2b['id']);})[_0x2097('0x2c')](respondWithResult(_0x54159e,null))['catch'](handleError(_0x54159e,null));};exports[_0x2097('0x73')]=function(_0x545cd9,_0x364d3a,_0x4dcd9c){return db[_0x2097('0x34')]['find']({'where':{'id':_0x545cd9[_0x2097('0x4c')]['id']}})['then'](handleEntityNotFound(_0x364d3a,null))[_0x2097('0x2c')](function(_0x3dba80){if(_0x3dba80){return _0x3dba80[_0x2097('0x73')](_0x545cd9[_0x2097('0x53')][_0x2097('0x74')],_['omit'](_0x545cd9[_0x2097('0x53')],[_0x2097('0x74'),'id'])||{})[_0x2097('0x75')](function(_0x1f733c){for(var _0xa8416a=0x0;_0xa8416a<_0x545cd9[_0x2097('0x53')][_0x2097('0x74')][_0x2097('0x6e')];_0xa8416a+=0x1){socket[_0x2097('0x76')](_0x2097('0x77'),{'UserId':Number(_0x545cd9[_0x2097('0x53')][_0x2097('0x74')][_0xa8416a]),'VoicePrefixId':Number(_0x545cd9[_0x2097('0x4c')]['id'])});}return _0x1f733c;});}})[_0x2097('0x2c')](respondWithResult(_0x364d3a,null))[_0x2097('0x4b')](handleError(_0x364d3a,null));};exports[_0x2097('0x78')]=function(_0x57a31e,_0x1a81de,_0x4bd44d){return db['VoicePrefix'][_0x2097('0x4f')]({'where':{'id':_0x57a31e[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x1a81de,null))['then'](function(_0x34b687){if(_0x34b687){return _0x34b687[_0x2097('0x78')](_0x57a31e[_0x2097('0x39')][_0x2097('0x74')])['then'](function(){if(_[_0x2097('0x79')](_0x57a31e['query'][_0x2097('0x74')])){for(var _0x385551=0x0;_0x385551<_0x57a31e[_0x2097('0x39')][_0x2097('0x74')]['length'];_0x385551+=0x1){socket[_0x2097('0x76')](_0x2097('0x7a'),{'UserId':Number(_0x57a31e[_0x2097('0x39')]['ids'][_0x385551]),'VoicePrefixId':Number(_0x57a31e[_0x2097('0x4c')]['id'])});}}else{socket[_0x2097('0x76')](_0x2097('0x7a'),{'UserId':Number(_0x57a31e['query'][_0x2097('0x74')]),'VoicePrefixId':Number(_0x57a31e[_0x2097('0x4c')]['id'])});}});}})[_0x2097('0x2c')](respondWithStatusCode(_0x1a81de,null))[_0x2097('0x4b')](handleError(_0x1a81de,null));};exports[_0x2097('0x7b')]=function(_0x5efe1e,_0x5d181f,_0x56d4c0){var _0xc7481d={};var _0x3f510d={};var _0x4213d0;var _0x16451c;return db[_0x2097('0x34')][_0x2097('0x7c')]({'where':{'id':_0x5efe1e['params']['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x5d181f,null))[_0x2097('0x2c')](function(_0x164ad3){if(_0x164ad3){_0x4213d0=_0x164ad3;_0x3f510d[_0x2097('0x3c')]=_[_0x2097('0x4d')](db[_0x2097('0x7d')][_0x2097('0x35')]);_0x3f510d['query']=_[_0x2097('0x4d')](_0x5efe1e[_0x2097('0x39')]);_0x3f510d[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x3f510d[_0x2097('0x3c')],_0x3f510d[_0x2097('0x39')]);_0xc7481d['attributes']=_['intersection'](_0x3f510d[_0x2097('0x3c')],qs['fields'](_0x5efe1e['query'][_0x2097('0x3d')]));_0xc7481d[_0x2097('0x3e')]=_0xc7481d[_0x2097('0x3e')][_0x2097('0x6e')]?_0xc7481d[_0x2097('0x3e')]:_0x3f510d[_0x2097('0x3c')];_0xc7481d[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x5efe1e['query'][_0x2097('0x42')]);_0xc7481d[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x5efe1e[_0x2097('0x39')],_0x3f510d['filters']));if(_0x5efe1e[_0x2097('0x39')][_0x2097('0x45')]){_0xc7481d[_0x2097('0x43')]=_[_0x2097('0x46')](_0xc7481d[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0xc7481d['attributes'],function(_0x33b0c0){var _0x79f858={};_0x79f858[_0x33b0c0]={'$like':'%'+_0x5efe1e['query']['filter']+'%'};return _0x79f858;})});}_0xc7481d=_['merge']({},_0xc7481d,_0x5efe1e['options']);return _0x4213d0[_0x2097('0x7b')](_0xc7481d);}})[_0x2097('0x2c')](function(_0x3fe29e){if(_0x3fe29e){_0x16451c=_0x3fe29e[_0x2097('0x6e')];if(!_0x5efe1e[_0x2097('0x39')]['hasOwnProperty'](_0x2097('0x40'))){_0xc7481d[_0x2097('0x25')]=qs[_0x2097('0x25')](_0x5efe1e[_0x2097('0x39')][_0x2097('0x25')]);_0xc7481d[_0x2097('0x23')]=qs['offset'](_0x5efe1e[_0x2097('0x39')][_0x2097('0x23')]);}return _0x4213d0['getAgents'](_0xc7481d);}})[_0x2097('0x2c')](function(_0x358bc3){if(_0x358bc3){return _0x358bc3?{'count':_0x16451c,'rows':_0x358bc3}:null;}})[_0x2097('0x2c')](respondWithResult(_0x5d181f,null))[_0x2097('0x4b')](handleError(_0x5d181f,null));};exports[_0x2097('0x7e')]=function(_0x498a91,_0x3a7959,_0x35570d){var _0x86f89={};var _0x26a3e5={};var _0x25bb03;var _0x429c9e;return db[_0x2097('0x34')][_0x2097('0x7c')]({'where':{'id':_0x498a91[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x3a7959,null))[_0x2097('0x2c')](function(_0x299a3e){if(_0x299a3e){_0x25bb03=_0x299a3e;_0x26a3e5[_0x2097('0x3c')]=_['keys'](db['Team'][_0x2097('0x35')]);_0x26a3e5['query']=_['keys'](_0x498a91[_0x2097('0x39')]);_0x26a3e5[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x26a3e5[_0x2097('0x3c')],_0x26a3e5[_0x2097('0x39')]);_0x86f89['attributes']=_['intersection'](_0x26a3e5[_0x2097('0x3c')],qs['fields'](_0x498a91[_0x2097('0x39')]['fields']));_0x86f89['attributes']=_0x86f89['attributes']['length']?_0x86f89['attributes']:_0x26a3e5[_0x2097('0x3c')];_0x86f89[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x498a91[_0x2097('0x39')][_0x2097('0x42')]);_0x86f89[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x498a91[_0x2097('0x39')],_0x26a3e5[_0x2097('0x3a')]));if(_0x498a91[_0x2097('0x39')][_0x2097('0x45')]){_0x86f89[_0x2097('0x43')]=_[_0x2097('0x46')](_0x86f89[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0x86f89[_0x2097('0x3e')],function(_0x5e49bc){var _0x1e30c5={};_0x1e30c5[_0x5e49bc]={'$like':'%'+_0x498a91[_0x2097('0x39')][_0x2097('0x45')]+'%'};return _0x1e30c5;})});}_0x86f89=_[_0x2097('0x46')]({},_0x86f89,_0x498a91[_0x2097('0x48')]);return _0x25bb03[_0x2097('0x7e')](_0x86f89);}})[_0x2097('0x2c')](function(_0x1c5ec7){if(_0x1c5ec7){_0x429c9e=_0x1c5ec7[_0x2097('0x6e')];if(!_0x498a91[_0x2097('0x39')][_0x2097('0x3f')]('nolimit')){_0x86f89[_0x2097('0x25')]=qs[_0x2097('0x25')](_0x498a91[_0x2097('0x39')][_0x2097('0x25')]);_0x86f89[_0x2097('0x23')]=qs[_0x2097('0x23')](_0x498a91['query']['offset']);}return _0x25bb03[_0x2097('0x7e')](_0x86f89);}})[_0x2097('0x2c')](function(_0x2beb7a){if(_0x2beb7a){return _0x2beb7a?{'count':_0x429c9e,'rows':_0x2beb7a}:null;}})['then'](respondWithResult(_0x3a7959,null))[_0x2097('0x4b')](handleError(_0x3a7959,null));};exports[_0x2097('0x7f')]=function(_0x4eeac1,_0x459585,_0x436533){var _0x16405f=_0x4eeac1[_0x2097('0x53')][_0x2097('0x74')];var _0x41f718;return db[_0x2097('0x80')][_0x2097('0x81')]({'where':{'id':_0x16405f},'attributes':['id'],'include':[{'model':db[_0x2097('0x7d')],'as':_0x2097('0x82'),'attributes':['id',_0x2097('0x30'),_0x2097('0x83'),_0x2097('0x84'),_0x2097('0x85')],'raw':!![]}]})[_0x2097('0x2c')](function(_0x44661a){if(_0x44661a){_0x41f718=_0x44661a;var _0x39e21f=_['flatMap'](_0x44661a,function(_0x2d211b){var _0x1ab39a=_0x2d211b[_0x2097('0x65')]({'plain':!![]});return _0x1ab39a[_0x2097('0x82')];});return db[_0x2097('0x34')][_0x2097('0x4f')]({'where':{'id':_0x4eeac1[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](function(_0xecd4fc){return db[_0x2097('0x51')]['transaction'](function(_0x2fb539){return _0xecd4fc[_0x2097('0x7f')](_0x16405f,{'transaction':_0x2fb539})[_0x2097('0x2c')](function(){return BPromise[_0x2097('0x86')](_0x41f718,function(_0x17c494){return db[_0x2097('0x87')][_0x2097('0x88')]({'TeamId':_0x17c494['id'],'VoicePrefixId':_0x4eeac1[_0x2097('0x4c')]['id']},{'transaction':_0x2fb539});});})['then'](function(){return BPromise[_0x2097('0x86')](_0x39e21f,function(_0x239570){return db[_0x2097('0x89')][_0x2097('0x8a')]({'where':{'UserId':_0x239570['id'],'VoicePrefixId':_0x4eeac1[_0x2097('0x4c')]['id']},'transaction':_0x2fb539});});})[_0x2097('0x2c')](function(){_0x39e21f[_0x2097('0x8b')](function(_0x51bb2f){socket[_0x2097('0x76')](_0x2097('0x77'),{'UserId':_0x51bb2f['id'],'VoicePrefixId':_0xecd4fc['id']});});});});});}})['then'](respondWithStatusCode(_0x459585,null))[_0x2097('0x4b')](handleError(_0x459585,null));};exports[_0x2097('0x8c')]=function(_0x568de5,_0x473a54,_0x53a5ed){return db[_0x2097('0x80')][_0x2097('0x81')]({'where':{'id':_0x568de5['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2097('0x7d')],'as':_0x2097('0x82'),'attributes':['id'],'raw':!![]}]})[_0x2097('0x2c')](handleEntityNotFound(_0x473a54,null))[_0x2097('0x2c')](function(_0x1909d8){var _0x2de4=_[_0x2097('0x33')](_0x1909d8,'id');var _0x43a1f8=[];var _0xb53629=[];var _0x516ed6=squel[_0x2097('0x8d')]();_0x516ed6[_0x2097('0x8e')]('tq.TeamId')['from'](_0x2097('0x8f'),'tq')[_0x2097('0x90')](_0x2097('0x91'),'ut',_0x2097('0x92'))[_0x2097('0x43')](_0x2097('0x93'),_0x568de5[_0x2097('0x4c')]['id']);for(var _0x5626f0=0x0;_0x5626f0<_0x1909d8[_0x2097('0x6e')];_0x5626f0+=0x1){let _0x45bbca=_0x1909d8[_0x5626f0];for(var _0x46fc92=0x0;_0x46fc92<_0x45bbca[_0x2097('0x82')][_0x2097('0x6e')];_0x46fc92+=0x1){let _0x357a5b=_0x45bbca[_0x2097('0x82')][_0x46fc92];var _0x3fcedc=_0x516ed6[_0x2097('0x94')]();_0x3fcedc[_0x2097('0x43')](_0x2097('0x95'),_0x357a5b['id']);_0xb53629['push'](db[_0x2097('0x51')][_0x2097('0x39')](_0x3fcedc['toString'](),{'type':db[_0x2097('0x51')][_0x2097('0x96')]['SELECT']})[_0x2097('0x2c')](function(_0xbe052f){if(_0xbe052f['length']===0x1){return _0x357a5b['id'];}else{var _0x32c5f1=_[_0x2097('0x97')](_[_0x2097('0x33')](_0xbe052f,_0x2097('0x98')),function(_0x456633){return _[_0x2097('0x99')](_0x2de4,_0x456633);});if(_0x32c5f1){return _0x357a5b['id'];}}}));}}return BPromise[_0x2097('0x9a')](_0xb53629)[_0x2097('0x2c')](function(_0x124d8f){_0x43a1f8=_(_0x43a1f8)[_0x2097('0x9b')](_0x124d8f)['compact']()[_0x2097('0x9c')]();return db[_0x2097('0x34')][_0x2097('0x4f')]({'where':{'id':_0x568de5[_0x2097('0x4c')]['id']}})['then'](function(_0x1b555e){return db['sequelize'][_0x2097('0x52')](function(_0x1ab515){return _0x1b555e[_0x2097('0x8c')](_0x568de5[_0x2097('0x39')][_0x2097('0x74')],{'transaction':_0x1ab515})[_0x2097('0x2c')](function(){if(!_[_0x2097('0x9d')](_0x43a1f8)){return _0x1b555e[_0x2097('0x78')](_0x43a1f8,{'transaction':_0x1ab515});}})[_0x2097('0x2c')](function(){_0x43a1f8['forEach'](function(_0x22fa5d){socket['emit']('userVoicePrefix:remove',{'UserId':_0x22fa5d,'VoicePrefixId':_0x1b555e['id']});});});});});});})['then'](respondWithStatusCode(_0x473a54,null))['catch'](handleError(_0x473a54,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5f98c10..b1d13f0 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 _0xf4ef=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3b58b5,_0x5799ad){var _0x5d48e6=function(_0x486370){while(--_0x486370){_0x3b58b5['push'](_0x3b58b5['shift']());}};_0x5d48e6(++_0x5799ad);}(_0xf4ef,0x6d));var _0xff4e=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0xf4ef[_0x2bda14];return _0xb5dd49;};'use strict';var EventEmitter=require(_0xff4e('0x0'));var VoicePrefix=require(_0xff4e('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xff4e('0x2')](0x0);var events={'afterCreate':_0xff4e('0x3'),'afterUpdate':_0xff4e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x401722){return function(_0x375191,_0x2f1eb2,_0x298008){VoicePrefixEvents[_0xff4e('0x5')](_0x401722+':'+_0x375191['id'],_0x375191);VoicePrefixEvents[_0xff4e('0x5')](_0x401722,_0x375191);_0x298008(null);};}for(var e in events){if(events[_0xff4e('0x6')](e)){var event=events[e];VoicePrefix[_0xff4e('0x7')](e,emitEvent(event));}}module[_0xff4e('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xf979=['emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x55017a,_0x1f3275){var _0x42d4d8=function(_0x3aea54){while(--_0x3aea54){_0x55017a['push'](_0x55017a['shift']());}};_0x42d4d8(++_0x1f3275);}(_0xf979,0xad));var _0x9f97=function(_0x28d4a0,_0x2f5bf){_0x28d4a0=_0x28d4a0-0x0;var _0x980753=_0xf979[_0x28d4a0];return _0x980753;};'use strict';var EventEmitter=require(_0x9f97('0x0'));var VoicePrefix=require(_0x9f97('0x1'))['db'][_0x9f97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9f97('0x3')](0x0);var events={'afterCreate':_0x9f97('0x4'),'afterUpdate':_0x9f97('0x5'),'afterDestroy':_0x9f97('0x6')};function emitEvent(_0x2a9c59){return function(_0x34845d,_0xe36a45,_0x131ff7){VoicePrefixEvents[_0x9f97('0x7')](_0x2a9c59+':'+_0x34845d['id'],_0x34845d);VoicePrefixEvents['emit'](_0x2a9c59,_0x34845d);_0x131ff7(null);};}for(var e in events){if(events[_0x9f97('0x8')](e)){var event=events[e];VoicePrefix[_0x9f97('0x9')](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 7a63324..910b688 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 _0x8b0a=['voice_prefixes','lodash','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x1f4ac9,_0x3b8ed3){var _0x1e29c0=function(_0x2045aa){while(--_0x2045aa){_0x1f4ac9['push'](_0x1f4ac9['shift']());}};_0x1e29c0(++_0x3b8ed3);}(_0x8b0a,0x111));var _0xa8b0=function(_0x217751,_0x5a0349){_0x217751=_0x217751-0x0;var _0x66446b=_0x8b0a[_0x217751];return _0x66446b;};'use strict';var _=require(_0xa8b0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa8b0('0x1'));var BPromise=require(_0xa8b0('0x2'));var rp=require(_0xa8b0('0x3'));var fs=require('fs');var path=require(_0xa8b0('0x4'));var rimraf=require('rimraf');var config=require(_0xa8b0('0x5'));var attributes=require('./voicePrefix.attributes');module[_0xa8b0('0x6')]=function(_0x564ca9,_0xf266f2){return _0x564ca9['define']('VoicePrefix',attributes,{'tableName':_0xa8b0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3516=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x498f93,_0x255d50){var _0x4a2395=function(_0x4c3ece){while(--_0x4c3ece){_0x498f93['push'](_0x498f93['shift']());}};_0x4a2395(++_0x255d50);}(_0x3516,0x16e));var _0x6351=function(_0x103911,_0x2ace3c){_0x103911=_0x103911-0x0;var _0x192996=_0x3516[_0x103911];return _0x192996;};'use strict';var _=require(_0x6351('0x0'));var util=require(_0x6351('0x1'));var logger=require(_0x6351('0x2'))(_0x6351('0x3'));var moment=require(_0x6351('0x4'));var BPromise=require(_0x6351('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6351('0x6'));var rimraf=require(_0x6351('0x7'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1cfaf9,_0x363304){return _0x1cfaf9[_0x6351('0x8')](_0x6351('0x9'),attributes,{'tableName':_0x6351('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 964c041..60b1b08 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 _0x33ac=['code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x33ac,0x1f2));var _0xc33a=function(_0x4bf0b4,_0x87d6a8){_0x4bf0b4=_0x4bf0b4-0x0;var _0x4159a1=_0x33ac[_0x4bf0b4];return _0x4159a1;};'use strict';var _=require('lodash');var util=require(_0xc33a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc33a('0x1'));var fs=require('fs');var Redis=require(_0xc33a('0x2'));var db=require(_0xc33a('0x3'))['db'];var utils=require(_0xc33a('0x4'));var logger=require(_0xc33a('0x5'))(_0xc33a('0x6'));var config=require(_0xc33a('0x7'));var jayson=require(_0xc33a('0x8'));var client=jayson[_0xc33a('0x9')]['http']({'port':0x232a});config['redis']=_[_0xc33a('0xa')](config[_0xc33a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc33a('0xc'))(new Redis(config['redis']));require(_0xc33a('0xd'))[_0xc33a('0xe')](socket);function respondWithRpcPromise(_0x288e87,_0x6ec731,_0x1abc99){return new BPromise(function(_0x36ad93,_0x2a6228){return client[_0xc33a('0xf')](_0x288e87,_0x1abc99)[_0xc33a('0x10')](function(_0x4eef76){logger['info'](_0xc33a('0x11'),_0x6ec731,'request\x20sent');logger['debug'](_0xc33a('0x12'),_0x6ec731,_0xc33a('0x13'),JSON[_0xc33a('0x14')](_0x4eef76));if(_0x4eef76[_0xc33a('0x15')]){if(_0x4eef76[_0xc33a('0x15')][_0xc33a('0x16')]===0x1f4){logger['error'](_0xc33a('0x11'),_0x6ec731,_0x4eef76[_0xc33a('0x15')][_0xc33a('0x17')]);return _0x2a6228(_0x4eef76['error'][_0xc33a('0x17')]);}logger['error'](_0xc33a('0x11'),_0x6ec731,_0x4eef76[_0xc33a('0x15')][_0xc33a('0x17')]);return _0x36ad93(_0x4eef76[_0xc33a('0x15')][_0xc33a('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x6ec731,_0xc33a('0x13'));_0x36ad93(_0x4eef76[_0xc33a('0x18')][_0xc33a('0x17')]);}})[_0xc33a('0x19')](function(_0x2f6095){logger[_0xc33a('0x15')](_0xc33a('0x11'),_0x6ec731,_0x2f6095);_0x2a6228(_0x2f6095);});});} \ No newline at end of file +var _0x870d=['defaults','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x242271,_0x50896e){var _0x40ff9c=function(_0x42e123){while(--_0x42e123){_0x242271['push'](_0x242271['shift']());}};_0x40ff9c(++_0x50896e);}(_0x870d,0xde));var _0xd870=function(_0x4a01e4,_0xfb2e97){_0x4a01e4=_0x4a01e4-0x0;var _0x594325=_0x870d[_0x4a01e4];return _0x594325;};'use strict';var _=require('lodash');var util=require(_0xd870('0x0'));var moment=require(_0xd870('0x1'));var BPromise=require(_0xd870('0x2'));var rs=require(_0xd870('0x3'));var fs=require('fs');var Redis=require(_0xd870('0x4'));var db=require(_0xd870('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd870('0x6'))(_0xd870('0x7'));var config=require(_0xd870('0x8'));var jayson=require(_0xd870('0x9'));var client=jayson[_0xd870('0xa')]['http']({'port':0x232a});config[_0xd870('0xb')]=_[_0xd870('0xc')](config[_0xd870('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd870('0xb')]));require(_0xd870('0xd'))[_0xd870('0xe')](socket);function respondWithRpcPromise(_0x5aaee8,_0x2269e8,_0x123bbf){return new BPromise(function(_0x4e9745,_0x4f1952){return client[_0xd870('0xf')](_0x5aaee8,_0x123bbf)[_0xd870('0x10')](function(_0x434450){logger['info'](_0xd870('0x11'),_0x2269e8,_0xd870('0x12'));logger['debug'](_0xd870('0x13'),_0x2269e8,_0xd870('0x12'),JSON['stringify'](_0x434450));if(_0x434450[_0xd870('0x14')]){if(_0x434450['error'][_0xd870('0x15')]===0x1f4){logger[_0xd870('0x14')](_0xd870('0x11'),_0x2269e8,_0x434450[_0xd870('0x14')]['message']);return _0x4f1952(_0x434450[_0xd870('0x14')][_0xd870('0x16')]);}logger['error'](_0xd870('0x11'),_0x2269e8,_0x434450[_0xd870('0x14')][_0xd870('0x16')]);return _0x4e9745(_0x434450['error'][_0xd870('0x16')]);}else{logger[_0xd870('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2269e8,_0xd870('0x12'));_0x4e9745(_0x434450[_0xd870('0x18')]['message']);}})[_0xd870('0x19')](function(_0x28fd22){logger['error'](_0xd870('0x11'),_0x2269e8,_0x28fd22);_0x4f1952(_0x28fd22);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index faa3c17..24c68c0 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 _0x76bc=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x22c92e,_0xe908fe){var _0x2919c8=function(_0x3f87a2){while(--_0x3f87a2){_0x22c92e['push'](_0x22c92e['shift']());}};_0x2919c8(++_0xe908fe);}(_0x76bc,0x17f));var _0xc76b=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x76bc[_0x44c935];return _0x465bee;};'use strict';var VoicePrefixEvents=require(_0xc76b('0x0'));var events=[_0xc76b('0x1'),_0xc76b('0x2'),_0xc76b('0x3')];function createListener(_0x178974,_0x5a265d){return function(_0x5ce5d4){_0x5a265d[_0xc76b('0x4')](_0x178974,_0x5ce5d4);};}function removeListener(_0x161ef3,_0x3f7b22){return function(){VoicePrefixEvents[_0xc76b('0x5')](_0x161ef3,_0x3f7b22);};}exports[_0xc76b('0x6')]=function(_0x239be6){for(var _0x25b111=0x0,_0x2cbe53=events[_0xc76b('0x7')];_0x25b111<_0x2cbe53;_0x25b111++){var _0x1cb174=events[_0x25b111];var _0x235ff3=createListener(_0xc76b('0x8')+_0x1cb174,_0x239be6);VoicePrefixEvents['on'](_0x1cb174,_0x235ff3);}}; \ No newline at end of file +var _0x402f=['register','length','voicePrefix:','./voicePrefix.events','remove','emit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x402f,0x6f));var _0xf402=function(_0xd396ee,_0x4688c4){_0xd396ee=_0xd396ee-0x0;var _0x4304a6=_0x402f[_0xd396ee];return _0x4304a6;};'use strict';var VoicePrefixEvents=require(_0xf402('0x0'));var events=['save',_0xf402('0x1'),'update'];function createListener(_0x588b83,_0x3ccbce){return function(_0xe1847c){_0x3ccbce[_0xf402('0x2')](_0x588b83,_0xe1847c);};}function removeListener(_0x4a52b8,_0x246c5f){return function(){VoicePrefixEvents['removeListener'](_0x4a52b8,_0x246c5f);};}exports[_0xf402('0x3')]=function(_0x270766){for(var _0x3a1d11=0x0,_0x2a8774=events[_0xf402('0x4')];_0x3a1d11<_0x2a8774;_0x3a1d11++){var _0x55c515=events[_0x3a1d11];var _0x4d1771=createListener(_0xf402('0x5')+_0x55c515,_0x270766);VoicePrefixEvents['on'](_0x55c515,_0x4d1771);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 807d90d..0a78c3b 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x55d576,_0x219496){var _0x25f4ef=function(_0x465439){while(--_0x465439){_0x55d576['push'](_0x55d576['shift']());}};_0x25f4ef(++_0x219496);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xb10b,0x12a));var _0xbb10=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xb10b[_0x409682];return _0x1ee901;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a08a458..db2615f 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 _0xa16f=['split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','ringall','setDataValue','strategy','getDataValue','type','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','join'];(function(_0x115f32,_0x5c23a5){var _0x5bc031=function(_0xa04ef2){while(--_0xa04ef2){_0x115f32['push'](_0x115f32['shift']());}};_0x5bc031(++_0x5c23a5);}(_0xa16f,0x16a));var _0xfa16=function(_0x52d044,_0xd9946e){_0x52d044=_0x52d044-0x0;var _0x1dff8d=_0xa16f[_0x52d044];return _0x1dff8d;};'use strict';var Sequelize=require(_0xfa16('0x0'));module[_0xfa16('0x1')]={'name':{'type':Sequelize[_0xfa16('0x2')],'allowNull':![],'unique':_0xfa16('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x5'),_0xfa16('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xfa16('0x4')]('rr','ringall',_0xfa16('0x7'),_0xfa16('0x8'),_0xfa16('0x9'),_0xfa16('0xa'),_0xfa16('0xb'),_0xfa16('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0xfa16('0xd'),'set':function(_0x179455){this[_0xfa16('0xe')](_0xfa16('0xf'),_0x179455?_0x179455:'rrmemory');},'get':function(){var _0x51d628=this[_0xfa16('0x10')](_0xfa16('0x11'));var _0x481f7a=this[_0xfa16('0x10')]('dialMethod');var _0x55f0ea=this[_0xfa16('0x10')](_0xfa16('0xf'));if(_0x51d628===_0xfa16('0x6')){if(_0x481f7a===_0xfa16('0x12')){return null;}if(_0x481f7a===_0xfa16('0x13')&&![_0xfa16('0xa'),_0xfa16('0x14')][_0xfa16('0x15')](_0x55f0ea)){this[_0xfa16('0xe')](_0xfa16('0xf'),_0xfa16('0xa'));}}return _0x55f0ea;}},'servicelevel':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xfa16('0x16')](0xb)},'timeout':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xfa16('0x2')]},'weight':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xfa16('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xfa16('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xfa16('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xfa16('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xfa16('0x17'),'no'),'defaultValue':_0xfa16('0x17')},'announce_holdtime':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no',_0xfa16('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xfa16('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xfa16('0x2')]},'queue_quantity1':{'type':Sequelize[_0xfa16('0x2')]},'queue_quantity2':{'type':Sequelize[_0xfa16('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xfa16('0x2')]},'queue_less_than':{'type':Sequelize[_0xfa16('0x2')]},'periodic_announce':{'type':Sequelize[_0xfa16('0x19')],'set':function(_0x2e8715){this[_0xfa16('0xe')](_0xfa16('0x1a'),_0x2e8715?_0x2e8715[_0xfa16('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0xfa16('0x1a'))?this[_0xfa16('0x10')](_0xfa16('0x1a'))[_0xfa16('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':_0xfa16('0x17'),'set':function(_0x5e8e80){this[_0xfa16('0xe')](_0xfa16('0x1d'),_0x5e8e80?_0x5e8e80[_0xfa16('0x1b')](','):undefined);},'get':function(){return this[_0xfa16('0x10')]('joinempty')?this[_0xfa16('0x10')]('joinempty')[_0xfa16('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':'no','set':function(_0x402772){this[_0xfa16('0xe')](_0xfa16('0x1e'),_0x402772?_0x402772[_0xfa16('0x1b')](','):undefined);},'get':function(){return this[_0xfa16('0x10')](_0xfa16('0x1e'))?this[_0xfa16('0x10')]('leavewhenempty')[_0xfa16('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xfa16('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xfa16('0x2')]},'description':{'type':Sequelize[_0xfa16('0x2')]},'acw':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':0x0,'set':function(_0x703d6f){this['setDataValue'](_0xfa16('0x20'),_0x703d6f);if(_0x703d6f){if(this['getDataValue'](_0xfa16('0x21'))<0x2){this[_0xfa16('0xe')](_0xfa16('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xfa16('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xfa16('0x12'),'progressive',_0xfa16('0x22'),'predictive',_0xfa16('0x13')),'defaultValue':_0xfa16('0x23'),'comment':_0xfa16('0x24')},'dialLimitChannel':{'type':Sequelize[_0xfa16('0x16')](0x4)[_0xfa16('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfa16('0x26')},'dialLimitQueue':{'type':Sequelize[_0xfa16('0x16')](0x4)[_0xfa16('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfa16('0x27')},'dialPowerLevel':{'type':Sequelize[_0xfa16('0x28')](0x2)[_0xfa16('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xfa16('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x2a'),_0xfa16('0x2b')),'defaultValue':_0xfa16('0x2b'),'comment':_0xfa16('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xfa16('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xfa16('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xfa16('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa16('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':_0xfa16('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xfa16('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xfa16('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa16('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa16('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa16('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfa16('0x33')},'dialTimezone':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfa16('0x2')],'defaultValue':_0xfa16('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x35'),_0xfa16('0x36'),_0xfa16('0x37')),'defaultValue':_0xfa16('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfa16('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfa16('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xfa16('0x16')](0x9)[_0xfa16('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfa16('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfa16('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfa16('0x16')](0x9)[_0xfa16('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa16('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xfa16('0x16')](0x9)[_0xfa16('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfa16('0x16')](0x9)[_0xfa16('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfa16('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfa16('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfa16('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfa16('0x16')](0x9)[_0xfa16('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa16('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xfa16('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':0x0,'comment':_0xfa16('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfa16('0x4')](_0xfa16('0x41'),_0xfa16('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xfa16('0x2')],'comment':_0xfa16('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa16('0x44')},'dialCutDigit':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa16('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa16('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa16('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa16('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa16('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa16('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa16('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':![],'comment':_0xfa16('0x4b'),'set':function(_0x1bcf16){if(!_0x1bcf16)this[_0xfa16('0xe')](_0xfa16('0x4c'),null);this[_0xfa16('0xe')](_0xfa16('0x4d'),_0x1bcf16);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xfa16('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xfa16('0x16')](0x3)[_0xfa16('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xfa16('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x9113=['exports','name','inbound','outbound','STRING','default','ENUM','ringall','leastrecent','fewestcalls','linear','rrordered','setDataValue','rrmemory','getDataValue','type','strategy','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','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.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\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)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize'];(function(_0x2284c4,_0xf1f627){var _0x5ea6fe=function(_0x209e1e){while(--_0x209e1e){_0x2284c4['push'](_0x2284c4['shift']());}};_0x5ea6fe(++_0xf1f627);}(_0x9113,0x13f));var _0x3911=function(_0xebe190,_0x271328){_0xebe190=_0xebe190-0x0;var _0x362b94=_0x9113[_0xebe190];return _0x362b94;};'use strict';var Sequelize=require(_0x3911('0x0'));module[_0x3911('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3911('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3911('0x3'),_0x3911('0x4')),'allowNull':![],'defaultValue':_0x3911('0x3')},'musiconhold':{'type':Sequelize[_0x3911('0x5')],'defaultValue':_0x3911('0x6')},'announce':{'type':Sequelize[_0x3911('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3911('0x7')]('rr',_0x3911('0x8'),_0x3911('0x9'),_0x3911('0xa'),'random','rrmemory',_0x3911('0xb'),'wrandom',_0x3911('0xc')),'allowNull':![],'defaultValue':_0x3911('0x8'),'set':function(_0x4050a6){this[_0x3911('0xd')]('strategy',_0x4050a6?_0x4050a6:_0x3911('0xe'));},'get':function(){var _0x28d2b8=this[_0x3911('0xf')](_0x3911('0x10'));var _0x1075b8=this[_0x3911('0xf')]('dialMethod');var _0x2f6e39=this['getDataValue'](_0x3911('0x11'));if(_0x28d2b8==='outbound'){if(_0x1075b8===_0x3911('0x12')){return null;}if(_0x1075b8===_0x3911('0x13')&&!['rrmemory',_0x3911('0x14')][_0x3911('0x15')](_0x2f6e39)){this[_0x3911('0xd')](_0x3911('0x11'),_0x3911('0xe'));}}return _0x2f6e39;}},'servicelevel':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3911('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3911('0x5')]},'weight':{'type':Sequelize[_0x3911('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no',_0x3911('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3911('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3911('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no',_0x3911('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3911('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3911('0x5')]},'queue_youarenext':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3911('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x3911('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x3911('0x5')]},'queue_less_than':{'type':Sequelize[_0x3911('0x5')]},'periodic_announce':{'type':Sequelize[_0x3911('0x1a')],'set':function(_0x20ed2b){this[_0x3911('0xd')]('periodic_announce',_0x20ed2b?_0x20ed2b[_0x3911('0x1b')](','):[]);},'get':function(){return this[_0x3911('0xf')](_0x3911('0x1c'))?this[_0x3911('0xf')](_0x3911('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'yes','set':function(_0x4602fa){this['setDataValue']('joinempty',_0x4602fa?_0x4602fa[_0x3911('0x1b')](','):undefined);},'get':function(){return this[_0x3911('0xf')]('joinempty')?this[_0x3911('0xf')](_0x3911('0x1d'))[_0x3911('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'no','set':function(_0x3c9b61){this['setDataValue'](_0x3911('0x1f'),_0x3c9b61?_0x3c9b61[_0x3911('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x3911('0x1f'))?this[_0x3911('0xf')](_0x3911('0x1f'))[_0x3911('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3911('0x5')]},'description':{'type':Sequelize[_0x3911('0x5')]},'acw':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'set':function(_0x3c9f2c){this[_0x3911('0xd')](_0x3911('0x21'),_0x3c9f2c);if(_0x3c9f2c){if(this[_0x3911('0xf')](_0x3911('0x22'))<0x2){this[_0x3911('0xd')](_0x3911('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x3911('0x7')]('preview',_0x3911('0x23'),_0x3911('0x24'),_0x3911('0x25'),'booked'),'defaultValue':_0x3911('0x23'),'comment':_0x3911('0x26')},'dialLimitChannel':{'type':Sequelize[_0x3911('0x16')](0x4)[_0x3911('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x3911('0x16')](0x4)[_0x3911('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3911('0x28')},'dialPowerLevel':{'type':Sequelize[_0x3911('0x29')](0x2)[_0x3911('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3911('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x2b'),'dropRate'),'defaultValue':_0x3911('0x2c'),'comment':_0x3911('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3911('0x29')](0x2)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x3911('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3911('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3911('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3911('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x3911('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x30')},'dialQueueProject':{'type':Sequelize[_0x3911('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3911('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3911('0x5')],'defaultValue':_0x3911('0x36')},'dialPrefix':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3911('0x37'),'never',_0x3911('0x38')),'defaultValue':_0x3911('0x37')},'dialAMDActive':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':_0x3911('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3911('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3911('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3911('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3911('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3911('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3911('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3911('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3911('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3911('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3911('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3911('0x7')]('DESC',_0x3911('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3911('0x44')},'dialCutDigit':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3911('0x16')],'allowNull':!![],'comment':_0x3911('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x3911('0x20')],'defaultValue':![],'comment':_0x3911('0x4f'),'set':function(_0xacfe84){if(!_0xacfe84)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xacfe84);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 36d18e0..86c440e 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 _0x22ed=['phone','scheduledAt','ContactId','ListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','CmListId','phone\x20IS\x20NOT\x20NULL','all','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','find','type','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','userProfileId','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','User','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format','SIP/%s','voicePause','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','union','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1587d1,_0x4ac855){_0x1587d1=_0x1587d1-0x0;var _0x376394=_0x22ed[_0x1587d1];return _0x376394;};'use strict';var emlformat=require(_0xd22e('0x0'));var rimraf=require(_0xd22e('0x1'));var zipdir=require(_0xd22e('0x2'));var jsonpatch=require(_0xd22e('0x3'));var rp=require(_0xd22e('0x4'));var moment=require(_0xd22e('0x5'));var BPromise=require(_0xd22e('0x6'));var Mustache=require(_0xd22e('0x7'));var util=require(_0xd22e('0x8'));var path=require(_0xd22e('0x9'));var sox=require(_0xd22e('0xa'));var csv=require(_0xd22e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd22e('0xc'));var _=require(_0xd22e('0xd'));var squel=require('squel');var crypto=require(_0xd22e('0xe'));var jsforce=require(_0xd22e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd22e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd22e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd22e('0x11'));var logger=require(_0xd22e('0x12'))(_0xd22e('0x13'));var utils=require(_0xd22e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd22e('0x15'));var db=require(_0xd22e('0x16'))['db'];config[_0xd22e('0x17')]=_[_0xd22e('0x18')](config[_0xd22e('0x17')],{'host':_0xd22e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd22e('0x17')]));require(_0xd22e('0x1a'))[_0xd22e('0x1b')](socket);function respondWithStatusCode(_0x5b6d95,_0x3b06e2){_0x3b06e2=_0x3b06e2||0xcc;return function(_0x5c454e){if(_0x5c454e){return _0x5b6d95[_0xd22e('0x1c')](_0x3b06e2);}return _0x5b6d95[_0xd22e('0x1d')](_0x3b06e2)[_0xd22e('0x1e')]();};}function respondWithResult(_0xe4ad1b,_0x724e3){_0x724e3=_0x724e3||0xc8;return function(_0x441ed7){if(_0x441ed7){return _0xe4ad1b[_0xd22e('0x1d')](_0x724e3)[_0xd22e('0x1f')](_0x441ed7);}};}function respondWithFilteredResult(_0x57f44f,_0x106570){return function(_0x288345){if(_0x288345){var _0x2ee456=typeof _0x106570[_0xd22e('0x20')]===_0xd22e('0x21')&&typeof _0x106570[_0xd22e('0x22')]==='undefined';var _0x21019b=_0x288345['count'];var _0x3a840c=_0x2ee456?0x0:_0x106570['offset'];var _0x5898d1=_0x2ee456?_0x288345[_0xd22e('0x23')]:_0x106570['offset']+_0x106570['limit'];var _0x340084;if(_0x5898d1>=_0x21019b){_0x5898d1=_0x21019b;_0x340084=0xc8;}else{_0x340084=0xce;}_0x57f44f[_0xd22e('0x1d')](_0x340084);return _0x57f44f[_0xd22e('0x24')](_0xd22e('0x25'),_0x3a840c+'-'+_0x5898d1+'/'+_0x21019b)['json'](_0x288345);}return null;};}function patchUpdates(_0x5762ca){return function(_0x3e5897){try{jsonpatch[_0xd22e('0x26')](_0x3e5897,_0x5762ca,!![]);}catch(_0x584c1e){return BPromise[_0xd22e('0x27')](_0x584c1e);}return _0x3e5897[_0xd22e('0x28')]();};}function saveUpdates(_0x3a5c74,_0xfbb4d1){return function(_0x552418){if(_0x552418){return _0x552418[_0xd22e('0x29')](_0x3a5c74)[_0xd22e('0x2a')](function(_0x11ec41){return _0x11ec41;});}return null;};}function removeEntity(_0x5ba269,_0xddb0d1){return function(_0x3e5e38){if(_0x3e5e38){return _0x3e5e38[_0xd22e('0x2b')]()['then'](function(){var _0xc57b5b=_0x3e5e38[_0xd22e('0x2c')]({'plain':!![]});var _0x6f382=[{'name':_0xd22e('0x2d'),'value':_0xd22e('0x2e'),'ignore':![]},{'name':_0xd22e('0x2f'),'value':_0xd22e('0x30'),'ignore':![]}];var _0x4b9424=_(_0x6f382)['filter'](_0xd22e('0x31'))[_0xd22e('0x32')](_0xd22e('0x33'))[_0xd22e('0x33')]();if(_['includes'](_0x4b9424,_0xc57b5b['type'])){return;}var _0x14c636=_[_0xd22e('0x34')](_0x6f382,[_0xd22e('0x33'),_0xc57b5b[_0xd22e('0x35')]])[_0xd22e('0x36')];return db[_0xd22e('0x37')]['destroy']({'where':{'type':_0x14c636,'resourceId':_0xc57b5b['id']}})[_0xd22e('0x2a')](function(){return _0x3e5e38;});})['then'](function(){_0x5ba269['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xffff71,_0xa1058e){return function(_0x3c87fd){if(!_0x3c87fd){_0xffff71[_0xd22e('0x1c')](0x194);}return _0x3c87fd;};}function handleError(_0x471a0d,_0xb3c897){_0xb3c897=_0xb3c897||0x1f4;return function(_0x5ec02f){logger['error'](_0x5ec02f[_0xd22e('0x38')]);if(_0x5ec02f[_0xd22e('0x36')]){delete _0x5ec02f[_0xd22e('0x36')];}_0x471a0d[_0xd22e('0x1d')](_0xb3c897)[_0xd22e('0x39')](_0x5ec02f);};}exports[_0xd22e('0x3a')]=function(_0xba0d6f,_0x258ede){var _0x588927={},_0x1b95e={},_0x5de5d7={'count':0x0,'rows':[]};var _0x24c07a=_[_0xd22e('0x32')](db[_0xd22e('0x3b')][_0xd22e('0x3c')],function(_0x13b49b){return{'name':_0x13b49b[_0xd22e('0x3d')],'type':_0x13b49b[_0xd22e('0x35')]['key']};});_0x1b95e['model']=_[_0xd22e('0x32')](_0x24c07a,_0xd22e('0x36'));_0x1b95e[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0xba0d6f[_0xd22e('0x3e')]);_0x1b95e[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x1b95e[_0xd22e('0x42')],_0x1b95e[_0xd22e('0x3e')]);_0x588927[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x1b95e[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x588927[_0xd22e('0x43')]=_0x588927[_0xd22e('0x43')][_0xd22e('0x45')]?_0x588927[_0xd22e('0x43')]:_0x1b95e['model'];if(!_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x46')]('nolimit')){_0x588927[_0xd22e('0x22')]=qs[_0xd22e('0x22')](_0xba0d6f[_0xd22e('0x3e')]['limit']);_0x588927[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x20')]);}_0x588927[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x48')]);_0x588927['where']=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0xba0d6f[_0xd22e('0x3e')],_0x1b95e[_0xd22e('0x40')]),_0x24c07a);if(_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x588927[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x588927[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0x24c07a,function(_0x2f83c7){if(_0x2f83c7[_0xd22e('0x35')]!==_0xd22e('0x4d')){var _0x1f9ee8={};_0x1f9ee8[_0x2f83c7[_0xd22e('0x36')]]={'$like':'%'+_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x4a')]+'%'};return _0x1f9ee8;}})});}_0x588927=_[_0xd22e('0x4c')]({},_0x588927,_0xba0d6f[_0xd22e('0x4e')]);var _0x40f279={'where':_0x588927[_0xd22e('0x4b')]};return db[_0xd22e('0x3b')][_0xd22e('0x23')](_0x40f279)['then'](function(_0x4efd42){_0x5de5d7[_0xd22e('0x23')]=_0x4efd42;if(_0xba0d6f[_0xd22e('0x3e')][_0xd22e('0x4f')]){_0x588927[_0xd22e('0x50')]=[{'all':!![]}];}return db['VoiceQueue'][_0xd22e('0x51')](_0x588927);})[_0xd22e('0x2a')](function(_0x30afbd){_0x5de5d7[_0xd22e('0x52')]=_0x30afbd;return _0x5de5d7;})[_0xd22e('0x2a')](respondWithFilteredResult(_0x258ede,_0x588927))[_0xd22e('0x53')](handleError(_0x258ede,null));};exports['show']=function(_0x44ac94,_0x1ad2c2){var _0x191f67={'raw':![],'where':{'id':_0x44ac94[_0xd22e('0x54')]['id']}},_0x400af2={};_0x400af2[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db['VoiceQueue'][_0xd22e('0x3c')]);_0x400af2['query']=_[_0xd22e('0x3f')](_0x44ac94[_0xd22e('0x3e')]);_0x400af2[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x400af2['model'],_0x400af2[_0xd22e('0x3e')]);_0x191f67['attributes']=_[_0xd22e('0x41')](_0x400af2['model'],qs['fields'](_0x44ac94[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x191f67[_0xd22e('0x43')]=_0x191f67[_0xd22e('0x43')]['length']?_0x191f67[_0xd22e('0x43')]:_0x400af2[_0xd22e('0x42')];if(_0x44ac94[_0xd22e('0x3e')][_0xd22e('0x4f')]){_0x191f67['include']=[{'all':!![]}];}_0x191f67=_[_0xd22e('0x4c')]({},_0x191f67,_0x44ac94[_0xd22e('0x4e')]);return db[_0xd22e('0x3b')][_0xd22e('0x34')](_0x191f67)[_0xd22e('0x2a')](handleEntityNotFound(_0x1ad2c2,null))[_0xd22e('0x2a')](respondWithResult(_0x1ad2c2,null))[_0xd22e('0x53')](handleError(_0x1ad2c2,null));};exports[_0xd22e('0x55')]=function(_0x104da1,_0x3f9928){return db[_0xd22e('0x3b')][_0xd22e('0x55')](_0x104da1[_0xd22e('0x56')],{})[_0xd22e('0x2a')](function(_0x8cd6fc){var _0x4f2a20=_0x104da1[_0xd22e('0x57')][_0xd22e('0x2c')]({'plain':!![]});if(!_0x4f2a20)throw new Error(_0xd22e('0x58'));if(_0x4f2a20['role']===_0xd22e('0x57')){var _0x542c6e=_0x8cd6fc[_0xd22e('0x2c')]({'plain':!![]});var _0x5785ae=[{'name':_0xd22e('0x2d'),'value':'inbound'},{'name':_0xd22e('0x2f'),'value':_0xd22e('0x30')}];var _0x5d8538=_['find'](_0x5785ae,[_0xd22e('0x33'),_0x542c6e[_0xd22e('0x35')]])['name'];return db[_0xd22e('0x59')][_0xd22e('0x34')]({'where':{'name':_0x5d8538,'userProfileId':_0x4f2a20['userProfileId']},'raw':!![]})[_0xd22e('0x2a')](function(_0x5ea57a){if(_0x5ea57a&&_0x5ea57a[_0xd22e('0x5a')]===0x0){return db[_0xd22e('0x37')][_0xd22e('0x55')]({'name':_0x542c6e[_0xd22e('0x36')],'resourceId':_0x542c6e['id'],'type':_0x5ea57a[_0xd22e('0x36')],'sectionId':_0x5ea57a['id']},{})[_0xd22e('0x2a')](function(){return _0x8cd6fc;});}else{return _0x8cd6fc;}})['catch'](function(_0x805c83){logger[_0xd22e('0x5b')](_0xd22e('0x5c'),_0x805c83);throw _0x805c83;});}return _0x8cd6fc;})[_0xd22e('0x2a')](respondWithResult(_0x3f9928,0xc9))[_0xd22e('0x53')](handleError(_0x3f9928,null));};exports[_0xd22e('0x5d')]=function(_0x3af4e7,_0x347aa3){var _0x4b4e0b={'where':{'id':_0x3af4e7[_0xd22e('0x54')]['id']}},_0x5e6a84={};_0x5e6a84[_0xd22e('0x42')]=_['keys'](db[_0xd22e('0x3b')][_0xd22e('0x3c')]);_0x4b4e0b[_0xd22e('0x43')]=_['intersection'](_0x5e6a84[_0xd22e('0x42')],qs['fields'](_0x3af4e7[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x4b4e0b[_0xd22e('0x43')]=_0x4b4e0b['attributes'][_0xd22e('0x45')]?_0x4b4e0b[_0xd22e('0x43')]:_0x5e6a84['model'];if(_0x3af4e7['query'][_0xd22e('0x4f')]){_0x4b4e0b[_0xd22e('0x50')]=[{'all':!![]}];}_0x4b4e0b=_[_0xd22e('0x4c')]({},_0x4b4e0b,_0x3af4e7[_0xd22e('0x4e')]);return db['VoiceQueue'][_0xd22e('0x34')](_0x4b4e0b)[_0xd22e('0x2a')](handleEntityNotFound(_0x347aa3,null))[_0xd22e('0x2a')](function(_0x25e744){if(_0x25e744){var _0x3dea35=_0x25e744['get']({'plain':!![]});_0x3dea35=qs[_0xd22e('0x5e')](_0x3dea35,['id',_0xd22e('0x5f'),_0xd22e('0x60')]);_0x3af4e7[_0xd22e('0x56')]=_[_0xd22e('0x5e')](_0x3af4e7['body'],['id',_0xd22e('0x5f'),_0xd22e('0x60')]);return db[_0xd22e('0x3b')]['create'](_[_0xd22e('0x4c')](_0x3dea35,_0x3af4e7[_0xd22e('0x56')]),{'include':_0x3af4e7[_0xd22e('0x3e')][_0xd22e('0x4f')]?[{'all':!![]}]:undefined})[_0xd22e('0x2a')](function(_0x4bc7d9){var _0x234f60=_0x3af4e7[_0xd22e('0x57')][_0xd22e('0x2c')]({'plain':!![]});if(!_0x234f60)throw new Error(_0xd22e('0x58'));if(_0x234f60[_0xd22e('0x61')]===_0xd22e('0x57')){var _0x6635c5=_0x4bc7d9['get']({'plain':!![]});var _0x451d8f=[{'name':_0xd22e('0x2d'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x15739b=_[_0xd22e('0x34')](_0x451d8f,[_0xd22e('0x33'),_0x6635c5['type']])[_0xd22e('0x36')];return db[_0xd22e('0x59')][_0xd22e('0x34')]({'where':{'name':_0x15739b,'userProfileId':_0x234f60[_0xd22e('0x62')]},'raw':!![]})['then'](function(_0x1752df){if(_0x1752df&&_0x1752df['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x6635c5[_0xd22e('0x36')],'resourceId':_0x6635c5['id'],'type':_0x1752df[_0xd22e('0x36')],'sectionId':_0x1752df['id']},{})[_0xd22e('0x2a')](function(){return _0x4bc7d9;});}else{return _0x4bc7d9;}})[_0xd22e('0x53')](function(_0x35a0ca){logger[_0xd22e('0x5b')](_0xd22e('0x5c'),_0x35a0ca);throw _0x35a0ca;});}return _0x4bc7d9;});}})[_0xd22e('0x2a')](respondWithResult(_0x347aa3,0xc9))[_0xd22e('0x53')](handleError(_0x347aa3,null));};exports[_0xd22e('0x29')]=function(_0x2e4a6b,_0x24d70d){if(_0x2e4a6b['body']['id']){delete _0x2e4a6b[_0xd22e('0x56')]['id'];}return db['VoiceQueue'][_0xd22e('0x34')]({'where':{'id':_0x2e4a6b[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x24d70d,null))[_0xd22e('0x2a')](saveUpdates(_0x2e4a6b[_0xd22e('0x56')],null))[_0xd22e('0x2a')](respondWithResult(_0x24d70d,null))[_0xd22e('0x53')](handleError(_0x24d70d,null));};exports['destroy']=function(_0x44392e,_0x5a8462){return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x44392e[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x5a8462,null))[_0xd22e('0x2a')](removeEntity(_0x5a8462,null))['catch'](handleError(_0x5a8462,null));};exports[_0xd22e('0x63')]=function(_0x2f10c2,_0x48bf6e,_0x3d9850){var _0x2a3ca6={'raw':![],'where':{}};var _0x416af2={};var _0x3d0a26={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd22e('0x64')]({'where':{'id':_0x2f10c2[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x48bf6e,null))[_0xd22e('0x2a')](function(_0xdf0e18){if(_0xdf0e18){_0x416af2[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db['CmHopper'][_0xd22e('0x3c')]);_0x416af2['query']=_[_0xd22e('0x3f')](_0x2f10c2['query']);_0x416af2['filters']=_[_0xd22e('0x41')](_0x416af2[_0xd22e('0x42')],_0x416af2[_0xd22e('0x3e')]);_0x2a3ca6['attributes']=_[_0xd22e('0x41')](_0x416af2['model'],qs['fields'](_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x2a3ca6[_0xd22e('0x43')]=_0x2a3ca6['attributes'][_0xd22e('0x45')]?_0x2a3ca6[_0xd22e('0x43')]:_0x416af2[_0xd22e('0x42')];if(!_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x46')](_0xd22e('0x65'))){_0x2a3ca6['limit']=qs['limit'](_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x2a3ca6['offset']=qs['offset'](_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x20')]);}_0x2a3ca6[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x48')]);_0x2a3ca6[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x2f10c2['query'],_0x416af2['filters']));_0x2a3ca6['where'][_0xd22e('0x66')]=_0xdf0e18['id'];if(_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x2a3ca6[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x2a3ca6['where'],{'$or':_[_0xd22e('0x32')](_0x2a3ca6[_0xd22e('0x43')],function(_0xa14088){var _0x16c606={};_0x16c606[_0xa14088]={'$like':'%'+_0x2f10c2['query']['filter']+'%'};return _0x16c606;})});}_0x2a3ca6=_[_0xd22e('0x4c')]({},_0x2a3ca6,_0x2f10c2['options']);return db[_0xd22e('0x67')]['count']({'where':_0x2a3ca6[_0xd22e('0x4b')]})[_0xd22e('0x2a')](function(_0x126746){_0x3d0a26[_0xd22e('0x23')]=_0x126746;if(_0x2f10c2[_0xd22e('0x3e')][_0xd22e('0x4f')]){_0x2a3ca6[_0xd22e('0x50')]=[{'all':!![]}];}return db[_0xd22e('0x67')][_0xd22e('0x51')](_0x2a3ca6);})['then'](function(_0xdc72e0){_0x3d0a26[_0xd22e('0x52')]=_0xdc72e0;return _0x3d0a26;});}})[_0xd22e('0x2a')](respondWithFilteredResult(_0x48bf6e,_0x2a3ca6))[_0xd22e('0x53')](handleError(_0x48bf6e,null));};exports[_0xd22e('0x68')]=function(_0x27cea1,_0xc819d7,_0x76c688){var _0xfbaa0c={'raw':!![],'where':{}};var _0x1cf1ae={};var _0x6510f1={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x27cea1['params']['id']}})['then'](handleEntityNotFound(_0xc819d7,null))[_0xd22e('0x2a')](function(_0xfa331){if(_0xfa331){_0x1cf1ae[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db['CmHopperHistory'][_0xd22e('0x3c')]);_0x1cf1ae[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0x27cea1[_0xd22e('0x3e')]);_0x1cf1ae[_0xd22e('0x40')]=_['intersection'](_0x1cf1ae[_0xd22e('0x42')],_0x1cf1ae[_0xd22e('0x3e')]);_0xfbaa0c[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x1cf1ae[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0x27cea1['query'][_0xd22e('0x44')]));_0xfbaa0c[_0xd22e('0x43')]=_0xfbaa0c[_0xd22e('0x43')]['length']?_0xfbaa0c[_0xd22e('0x43')]:_0x1cf1ae[_0xd22e('0x42')];if(!_0x27cea1[_0xd22e('0x3e')]['hasOwnProperty']('nolimit')){_0xfbaa0c[_0xd22e('0x22')]=qs[_0xd22e('0x22')](_0x27cea1[_0xd22e('0x3e')][_0xd22e('0x22')]);_0xfbaa0c[_0xd22e('0x20')]=qs['offset'](_0x27cea1[_0xd22e('0x3e')]['offset']);}_0xfbaa0c['order']=qs[_0xd22e('0x48')](_0x27cea1[_0xd22e('0x3e')][_0xd22e('0x48')]);_0xfbaa0c[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x27cea1[_0xd22e('0x3e')],_0x1cf1ae[_0xd22e('0x40')]));_0xfbaa0c['where'][_0xd22e('0x66')]=_0xfa331['id'];if(_0x27cea1[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0xfbaa0c[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0xfbaa0c[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0xfbaa0c[_0xd22e('0x43')],function(_0xd2690b){var _0x1c498a={};_0x1c498a[_0xd2690b]={'$like':'%'+_0x27cea1[_0xd22e('0x3e')]['filter']+'%'};return _0x1c498a;})});}_0xfbaa0c=_[_0xd22e('0x4c')]({},_0xfbaa0c,_0x27cea1[_0xd22e('0x4e')]);return db[_0xd22e('0x69')]['count']({'where':_0xfbaa0c['where']})[_0xd22e('0x2a')](function(_0x19d10d){_0x6510f1[_0xd22e('0x23')]=_0x19d10d;if(_0x27cea1['query'][_0xd22e('0x4f')]){_0xfbaa0c[_0xd22e('0x50')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xfbaa0c);})[_0xd22e('0x2a')](function(_0x36976d){_0x6510f1[_0xd22e('0x52')]=_0x36976d;return _0x6510f1;});}})['then'](respondWithFilteredResult(_0xc819d7,_0xfbaa0c))[_0xd22e('0x53')](handleError(_0xc819d7,null));};exports[_0xd22e('0x6a')]=function(_0x2214de,_0x40d512,_0x235edd){var _0x4ee234={'raw':!![],'where':{}};var _0x45d79a={};var _0x48c728={'count':0x0,'rows':[]};return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x2214de['params']['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x40d512,null))[_0xd22e('0x2a')](function(_0xb9a6c1){if(_0xb9a6c1){_0x45d79a[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db[_0xd22e('0x6b')][_0xd22e('0x3c')]);_0x45d79a[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0x2214de['query']);_0x45d79a[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x45d79a[_0xd22e('0x42')],_0x45d79a[_0xd22e('0x3e')]);_0x4ee234[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x45d79a[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0x2214de[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x4ee234[_0xd22e('0x43')]=_0x4ee234[_0xd22e('0x43')][_0xd22e('0x45')]?_0x4ee234[_0xd22e('0x43')]:_0x45d79a['model'];if(!_0x2214de[_0xd22e('0x3e')][_0xd22e('0x46')]('nolimit')){_0x4ee234[_0xd22e('0x22')]=qs[_0xd22e('0x22')](_0x2214de['query']['limit']);_0x4ee234[_0xd22e('0x20')]=qs['offset'](_0x2214de[_0xd22e('0x3e')]['offset']);}_0x4ee234[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0x2214de[_0xd22e('0x3e')][_0xd22e('0x48')]);_0x4ee234[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x2214de[_0xd22e('0x3e')],_0x45d79a[_0xd22e('0x40')]));_0x4ee234[_0xd22e('0x4b')]['VoiceQueueId']=_0xb9a6c1['id'];if(_0x2214de[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x4ee234['where']=_[_0xd22e('0x4c')](_0x4ee234[_0xd22e('0x4b')],{'$or':_['map'](_0x4ee234[_0xd22e('0x43')],function(_0x43c2a5){var _0x28a95b={};_0x28a95b[_0x43c2a5]={'$like':'%'+_0x2214de[_0xd22e('0x3e')]['filter']+'%'};return _0x28a95b;})});}_0x4ee234=_[_0xd22e('0x4c')]({},_0x4ee234,_0x2214de[_0xd22e('0x4e')]);return db[_0xd22e('0x6b')][_0xd22e('0x23')]({'where':_0x4ee234['where']})[_0xd22e('0x2a')](function(_0x266d14){_0x48c728['count']=_0x266d14;if(_0x2214de[_0xd22e('0x3e')][_0xd22e('0x4f')]){_0x4ee234[_0xd22e('0x50')]=[{'all':!![]}];}return db[_0xd22e('0x6b')][_0xd22e('0x51')](_0x4ee234);})[_0xd22e('0x2a')](function(_0x249b1c){_0x48c728[_0xd22e('0x52')]=_0x249b1c;return _0x48c728;});}})[_0xd22e('0x2a')](respondWithFilteredResult(_0x40d512,_0x4ee234))[_0xd22e('0x53')](handleError(_0x40d512,null));};exports[_0xd22e('0x6c')]=function(_0x3d113e,_0x34bb0f,_0x3e891c){var _0x24ac9e={'raw':!![],'where':{}};var _0x2ee78e={};var _0x16bb98={'count':0x0,'rows':[]};return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x3d113e[_0xd22e('0x54')]['id']}})['then'](handleEntityNotFound(_0x34bb0f,null))[_0xd22e('0x2a')](function(_0x52108c){if(_0x52108c){_0x2ee78e['model']=_['keys'](db[_0xd22e('0x6d')]['rawAttributes']);_0x2ee78e[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0x3d113e[_0xd22e('0x3e')]);_0x2ee78e[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x2ee78e[_0xd22e('0x42')],_0x2ee78e[_0xd22e('0x3e')]);_0x24ac9e[_0xd22e('0x43')]=_['intersection'](_0x2ee78e[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0x3d113e['query'][_0xd22e('0x44')]));_0x24ac9e['attributes']=_0x24ac9e[_0xd22e('0x43')][_0xd22e('0x45')]?_0x24ac9e[_0xd22e('0x43')]:_0x2ee78e['model'];if(!_0x3d113e['query']['hasOwnProperty']('nolimit')){_0x24ac9e[_0xd22e('0x22')]=qs[_0xd22e('0x22')](_0x3d113e[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x24ac9e[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x3d113e[_0xd22e('0x3e')][_0xd22e('0x20')]);}_0x24ac9e[_0xd22e('0x47')]=qs['sort'](_0x3d113e[_0xd22e('0x3e')]['sort']);_0x24ac9e[_0xd22e('0x4b')]=qs['filters'](_['pick'](_0x3d113e[_0xd22e('0x3e')],_0x2ee78e[_0xd22e('0x40')]));_0x24ac9e[_0xd22e('0x4b')]['VoiceQueueId']=_0x52108c['id'];if(_0x3d113e[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x24ac9e[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x24ac9e[_0xd22e('0x4b')],{'$or':_['map'](_0x24ac9e[_0xd22e('0x43')],function(_0x4bfda1){var _0x2ff689={};_0x2ff689[_0x4bfda1]={'$like':'%'+_0x3d113e[_0xd22e('0x3e')]['filter']+'%'};return _0x2ff689;})});}_0x24ac9e=_[_0xd22e('0x4c')]({},_0x24ac9e,_0x3d113e[_0xd22e('0x4e')]);return db['CmHopperBlack'][_0xd22e('0x23')]({'where':_0x24ac9e[_0xd22e('0x4b')]})['then'](function(_0x3e235c){_0x16bb98[_0xd22e('0x23')]=_0x3e235c;if(_0x3d113e[_0xd22e('0x3e')][_0xd22e('0x4f')]){_0x24ac9e['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xd22e('0x51')](_0x24ac9e);})[_0xd22e('0x2a')](function(_0x12c3e1){_0x16bb98['rows']=_0x12c3e1;return _0x16bb98;});}})[_0xd22e('0x2a')](respondWithFilteredResult(_0x34bb0f,_0x24ac9e))[_0xd22e('0x53')](handleError(_0x34bb0f,null));};exports[_0xd22e('0x6e')]=function(_0x11e0b6,_0x49f6b1,_0x428a95){var _0x29260a={};var _0x3b9000={};var _0x350179;var _0x2a4bb8;return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x11e0b6['params']['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x49f6b1,null))[_0xd22e('0x2a')](function(_0x16d31e){if(_0x16d31e){_0x350179=_0x16d31e;_0x3b9000[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db['Team'][_0xd22e('0x3c')]);_0x3b9000[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0x11e0b6[_0xd22e('0x3e')]);_0x3b9000[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x3b9000['model'],_0x3b9000['query']);_0x29260a[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x3b9000[_0xd22e('0x42')],qs['fields'](_0x11e0b6['query']['fields']));_0x29260a[_0xd22e('0x43')]=_0x29260a[_0xd22e('0x43')][_0xd22e('0x45')]?_0x29260a['attributes']:_0x3b9000[_0xd22e('0x42')];_0x29260a[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0x11e0b6['query'][_0xd22e('0x48')]);_0x29260a[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_['pick'](_0x11e0b6['query'],_0x3b9000[_0xd22e('0x40')]));if(_0x11e0b6[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x29260a[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x29260a[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0x29260a[_0xd22e('0x43')],function(_0x2df449){var _0x46a2a8={};_0x46a2a8[_0x2df449]={'$like':'%'+_0x11e0b6[_0xd22e('0x3e')][_0xd22e('0x4a')]+'%'};return _0x46a2a8;})});}_0x29260a=_[_0xd22e('0x4c')]({},_0x29260a,_0x11e0b6[_0xd22e('0x4e')]);return _0x350179[_0xd22e('0x6e')](_0x29260a);}})[_0xd22e('0x2a')](function(_0x36b599){if(_0x36b599){_0x2a4bb8=_0x36b599[_0xd22e('0x45')];if(!_0x11e0b6[_0xd22e('0x3e')][_0xd22e('0x46')](_0xd22e('0x65'))){_0x29260a[_0xd22e('0x22')]=qs[_0xd22e('0x22')](_0x11e0b6[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x29260a[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x11e0b6['query'][_0xd22e('0x20')]);}return _0x350179[_0xd22e('0x6e')](_0x29260a);}})['then'](function(_0x5814c3){if(_0x5814c3){return _0x5814c3?{'count':_0x2a4bb8,'rows':_0x5814c3}:null;}})[_0xd22e('0x2a')](respondWithResult(_0x49f6b1,null))[_0xd22e('0x53')](handleError(_0x49f6b1,null));};exports[_0xd22e('0x6f')]=function(_0x47e0a0,_0x532128,_0x4876a6){var _0x297b5e=_0x47e0a0[_0xd22e('0x56')]['teams'];var _0x18fd5e=_['map'](_0x297b5e,'id');return db['Team'][_0xd22e('0x51')]({'where':{'id':_0x18fd5e},'attributes':['id'],'include':[{'model':db[_0xd22e('0x70')],'as':'Agents','attributes':['id',_0xd22e('0x36'),_0xd22e('0x71'),'voicePause',_0xd22e('0x72')],'raw':!![]}]})[_0xd22e('0x2a')](function(_0x453ca6){if(_0x453ca6){var _0x40bdcf=_[_0xd22e('0x73')](_0x453ca6,function(_0xeeafe5){var _0x57a528=_0xeeafe5['get']({'plain':!![]});_0x57a528[_0xd22e('0x74')][_0xd22e('0x75')](function(_0xfb6913){_0xfb6913[_0xd22e('0x76')]=_[_0xd22e('0x34')](_0x297b5e,{'id':_0x57a528['id']})[_0xd22e('0x76')];});return _0x57a528[_0xd22e('0x74')];});return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x47e0a0[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](function(_0x25ae47){return db[_0xd22e('0x77')][_0xd22e('0x78')](function(_0x3be8ec){return _0x25ae47[_0xd22e('0x6f')](_0x18fd5e,{'transaction':_0x3be8ec})[_0xd22e('0x2a')](function(){return BPromise[_0xd22e('0x79')](_0x297b5e,function(_0x17d6fb){return db[_0xd22e('0x7a')][_0xd22e('0x7b')]({'TeamId':_0x17d6fb['id'],'VoiceQueueId':_0x47e0a0[_0xd22e('0x54')]['id'],'penalty':_0x17d6fb['penalty']},{'transaction':_0x3be8ec});});})[_0xd22e('0x2a')](function(){return BPromise['each'](_0x40bdcf,function(_0x2feed6){return db[_0xd22e('0x7c')][_0xd22e('0x7d')]({'where':{'UserId':_0x2feed6['id'],'VoiceQueueId':_0x47e0a0['params']['id']},'defaults':{'penalty':_0x2feed6[_0xd22e('0x76')]},'transaction':_0x3be8ec});});})[_0xd22e('0x2a')](function(){return BPromise[_0xd22e('0x79')](_[_0xd22e('0x4a')](_0x40bdcf,{'online':!![]}),function(_0x482c9b){return db[_0xd22e('0x7e')]['upsert']({'membername':_0x482c9b['name'],'UserId':_0x482c9b['id'],'queue_name':_0x25ae47['name'],'VoiceQueueId':_0x25ae47['id'],'interface':_['isNil'](_0x482c9b['interface'])?util[_0xd22e('0x7f')](_0xd22e('0x80'),_0x482c9b[_0xd22e('0x36')]):_0x482c9b[_0xd22e('0x72')],'paused':_0x482c9b[_0xd22e('0x81')]||![],'penalty':_0x482c9b['penalty']},{'transaction':_0x3be8ec});});})[_0xd22e('0x2a')](function(){_0x40bdcf[_0xd22e('0x75')](function(_0x49f2d7){socket[_0xd22e('0x82')]('userVoiceQueue:save',{'UserId':_0x49f2d7['id'],'VoiceQueueId':_0x25ae47['id']});});});});});}})[_0xd22e('0x2a')](respondWithStatusCode(_0x532128,null))[_0xd22e('0x53')](handleError(_0x532128,null));};exports['removeTeams']=function(_0xf89c2b,_0x1b236b,_0x4aaa31){return db['Team']['findAll']({'where':{'id':_0xf89c2b[_0xd22e('0x3e')][_0xd22e('0x83')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd22e('0x74'),'attributes':['id'],'raw':!![]}]})[_0xd22e('0x2a')](handleEntityNotFound(_0x1b236b,null))[_0xd22e('0x2a')](function(_0x54b984){var _0xad0ff7=_['map'](_0x54b984,'id');var _0x3dd2ab=[];var _0x30dd04=[];var _0x128f42=squel[_0xd22e('0x84')]();_0x128f42[_0xd22e('0x85')](_0xd22e('0x86'))[_0xd22e('0x87')](_0xd22e('0x88'),'tq')[_0xd22e('0x89')](_0xd22e('0x8a'),'ut',_0xd22e('0x8b'))[_0xd22e('0x4b')](_0xd22e('0x8c'),_0xf89c2b[_0xd22e('0x54')]['id']);for(var _0xbfc64f=0x0;_0xbfc64f<_0x54b984['length'];_0xbfc64f+=0x1){let _0x4f58a7=_0x54b984[_0xbfc64f];for(var _0x511ced=0x0;_0x511ced<_0x4f58a7[_0xd22e('0x74')][_0xd22e('0x45')];_0x511ced+=0x1){let _0x42fa29=_0x4f58a7[_0xd22e('0x74')][_0x511ced];var _0x5f4054=_0x128f42[_0xd22e('0x5d')]();_0x5f4054[_0xd22e('0x4b')](_0xd22e('0x8d'),_0x42fa29['id']);_0x30dd04[_0xd22e('0x8e')](db[_0xd22e('0x77')][_0xd22e('0x3e')](_0x5f4054['toString'](),{'type':db[_0xd22e('0x77')][_0xd22e('0x8f')]['SELECT']})[_0xd22e('0x2a')](function(_0x330cf3){if(_0x330cf3['length']===0x1){return _0x42fa29['id'];}else{var _0x5d227c=_[_0xd22e('0x90')](_[_0xd22e('0x32')](_0x330cf3,'TeamId'),function(_0xdfb982){return _['includes'](_0xad0ff7,_0xdfb982);});if(_0x5d227c){return _0x42fa29['id'];}}}));}}return BPromise['all'](_0x30dd04)[_0xd22e('0x2a')](function(_0x25bd75){_0x3dd2ab=_(_0x3dd2ab)[_0xd22e('0x91')](_0x25bd75)['compact']()[_0xd22e('0x33')]();return db['VoiceQueue']['find']({'where':{'id':_0xf89c2b[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](function(_0x894ed8){return db[_0xd22e('0x77')][_0xd22e('0x78')](function(_0xdfe7e4){return _0x894ed8[_0xd22e('0x92')](_0xf89c2b[_0xd22e('0x3e')][_0xd22e('0x83')],{'transaction':_0xdfe7e4})['then'](function(){if(!_[_0xd22e('0x93')](_0x3dd2ab)){return _0x894ed8[_0xd22e('0x94')](_0x3dd2ab,{'transaction':_0xdfe7e4})['then'](function(){return db[_0xd22e('0x7e')]['destroy']({'where':{'VoiceQueueId':_0xf89c2b[_0xd22e('0x54')]['id'],'UserId':_0x3dd2ab},'transaction':_0xdfe7e4});});}})['then'](function(){_0x3dd2ab[_0xd22e('0x75')](function(_0x966161){socket['emit'](_0xd22e('0x95'),{'UserId':_0x966161,'VoiceQueueId':_0x894ed8['id']});});});});});});})[_0xd22e('0x2a')](respondWithStatusCode(_0x1b236b,null))[_0xd22e('0x53')](handleError(_0x1b236b,null));};exports[_0xd22e('0x96')]=function(_0x55f24e,_0x5c2966,_0x10999c){var _0x25ab9f,_0x4fcc96;return db['VoiceQueue'][_0xd22e('0x34')]({'where':{'id':_0x55f24e[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x5c2966,null))[_0xd22e('0x2a')](function(_0x5d80dd){if(_0x5d80dd){_0x4fcc96=_0x5d80dd;return _0x5d80dd[_0xd22e('0x96')](_0x55f24e[_0xd22e('0x56')]['ids'],_[_0xd22e('0x5e')](_0x55f24e[_0xd22e('0x56')],[_0xd22e('0x83'),'id'])||{})[_0xd22e('0x97')](function(_0x5cb95e){for(var _0x10bb10=0x0;_0x10bb10<_0x55f24e['body'][_0xd22e('0x83')][_0xd22e('0x45')];_0x10bb10+=0x1){socket[_0xd22e('0x82')]('userVoiceQueue:save',{'UserId':Number(_0x55f24e[_0xd22e('0x56')][_0xd22e('0x83')][_0x10bb10]),'VoiceQueueId':Number(_0x55f24e[_0xd22e('0x54')]['id'])});}return _0x5cb95e;});}})[_0xd22e('0x2a')](function(_0x15ecdf){_0x25ab9f=_0x15ecdf||[];if(_0x4fcc96){return db[_0xd22e('0x70')][_0xd22e('0x51')]({'where':{'id':_0x55f24e[_0xd22e('0x56')]['ids']},'attributes':['id',_0xd22e('0x36'),_0xd22e('0x71'),_0xd22e('0x81'),'interface'],'raw':!![]});}})[_0xd22e('0x2a')](function(_0x37021c){if(!_[_0xd22e('0x93')](_0x37021c)){var _0x80f112=[];for(var _0x1104cd=0x0;_0x1104cd<_0x37021c[_0xd22e('0x45')];_0x1104cd++){if(_0x37021c[_0x1104cd][_0xd22e('0x71')]){_0x80f112[_0xd22e('0x8e')](db['UserVoiceQueueRt'][_0xd22e('0x7b')]({'membername':_0x37021c[_0x1104cd][_0xd22e('0x36')],'UserId':_0x37021c[_0x1104cd]['id'],'queue_name':_0x4fcc96['name'],'VoiceQueueId':_0x4fcc96['id'],'interface':_[_0xd22e('0x98')](_0x37021c[_0x1104cd][_0xd22e('0x72')])?util['format'](_0xd22e('0x80'),_0x37021c[_0x1104cd][_0xd22e('0x36')]):_0x37021c[_0x1104cd][_0xd22e('0x72')],'paused':_0x37021c[_0x1104cd][_0xd22e('0x81')]||![],'penalty':_0x55f24e[_0xd22e('0x56')][_0xd22e('0x76')]||0x0}));}}return BPromise['all'](_0x80f112);}})[_0xd22e('0x2a')](function(){return _0x25ab9f;})[_0xd22e('0x2a')](respondWithResult(_0x5c2966,null))[_0xd22e('0x53')](handleError(_0x5c2966,null));};exports[_0xd22e('0x94')]=function(_0x246434,_0x57ef01,_0xda258d){return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x246434[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x57ef01,null))['then'](function(_0x264bcd){if(_0x264bcd){return _0x264bcd[_0xd22e('0x94')](_0x246434[_0xd22e('0x3e')][_0xd22e('0x83')])[_0xd22e('0x2a')](function(){if(_[_0xd22e('0x99')](_0x246434[_0xd22e('0x3e')][_0xd22e('0x83')])){for(var _0x2c3d99=0x0;_0x2c3d99<_0x246434[_0xd22e('0x3e')][_0xd22e('0x83')][_0xd22e('0x45')];_0x2c3d99+=0x1){socket['emit'](_0xd22e('0x95'),{'UserId':Number(_0x246434['query'][_0xd22e('0x83')][_0x2c3d99]),'VoiceQueueId':Number(_0x246434['params']['id'])});}}else{socket[_0xd22e('0x82')](_0xd22e('0x95'),{'UserId':Number(_0x246434[_0xd22e('0x3e')][_0xd22e('0x83')]),'VoiceQueueId':Number(_0x246434[_0xd22e('0x54')]['id'])});}});}})[_0xd22e('0x2a')](function(_0x1adbe6){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x246434[_0xd22e('0x54')]['id'],'UserId':_0x246434['query']['ids']}})[_0xd22e('0x2a')](function(){return _0x1adbe6;});})[_0xd22e('0x2a')](respondWithStatusCode(_0x57ef01,null))[_0xd22e('0x53')](handleError(_0x57ef01,null));};exports[_0xd22e('0x9a')]=function(_0x2b1bd2,_0x32fad8,_0x100d74){var _0x330b02={};var _0x4c032d={};var _0x21eec7;var _0x29adf4;return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x2b1bd2[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x32fad8,null))[_0xd22e('0x2a')](function(_0x29ce33){if(_0x29ce33){_0x21eec7=_0x29ce33;_0x4c032d[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db['User'][_0xd22e('0x3c')]);_0x4c032d[_0xd22e('0x3e')]=_['keys'](_0x2b1bd2[_0xd22e('0x3e')]);_0x4c032d['filters']=_[_0xd22e('0x41')](_0x4c032d['model'],_0x4c032d[_0xd22e('0x3e')]);_0x330b02[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x4c032d[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0x2b1bd2[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x330b02['attributes']=_0x330b02[_0xd22e('0x43')][_0xd22e('0x45')]?_0x330b02[_0xd22e('0x43')]:_0x4c032d[_0xd22e('0x42')];_0x330b02[_0xd22e('0x47')]=qs['sort'](_0x2b1bd2[_0xd22e('0x3e')][_0xd22e('0x48')]);_0x330b02['where']=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x2b1bd2[_0xd22e('0x3e')],_0x4c032d[_0xd22e('0x40')]));if(_0x2b1bd2[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x330b02[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x330b02[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0x330b02[_0xd22e('0x43')],function(_0x19f492){var _0x4ca537={};_0x4ca537[_0x19f492]={'$like':'%'+_0x2b1bd2[_0xd22e('0x3e')][_0xd22e('0x4a')]+'%'};return _0x4ca537;})});}_0x330b02=_[_0xd22e('0x4c')]({},_0x330b02,_0x2b1bd2[_0xd22e('0x4e')]);return _0x21eec7[_0xd22e('0x9a')](_0x330b02);}})[_0xd22e('0x2a')](function(_0x2e7e2d){if(_0x2e7e2d){_0x29adf4=_0x2e7e2d['length'];if(!_0x2b1bd2['query']['hasOwnProperty'](_0xd22e('0x65'))){_0x330b02['limit']=qs[_0xd22e('0x22')](_0x2b1bd2[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x330b02[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x2b1bd2['query']['offset']);}return _0x21eec7[_0xd22e('0x9a')](_0x330b02);}})[_0xd22e('0x2a')](function(_0xd32cf8){if(_0xd32cf8){return _0xd32cf8?{'count':_0x29adf4,'rows':_0xd32cf8}:null;}})[_0xd22e('0x2a')](respondWithResult(_0x32fad8,null))['catch'](handleError(_0x32fad8,null));};exports[_0xd22e('0x9b')]=function(_0x36e848,_0x5700de,_0x149514){var _0x3b7b8b={};var _0x577748={};var _0x1d8a12;var _0x5c6ab4;return db['VoiceQueue'][_0xd22e('0x64')]({'where':{'id':_0x36e848[_0xd22e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5700de,null))[_0xd22e('0x2a')](function(_0x20c502){if(_0x20c502){_0x1d8a12=_0x20c502;_0x577748[_0xd22e('0x42')]=_['keys'](db[_0xd22e('0x7e')][_0xd22e('0x3c')]);_0x577748['query']=_[_0xd22e('0x3f')](_0x36e848['query']);_0x577748[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x577748['model'],_0x577748[_0xd22e('0x3e')]);_0x3b7b8b['attributes']=_[_0xd22e('0x41')](_0x577748['model'],qs['fields'](_0x36e848[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x3b7b8b['attributes']=_0x3b7b8b[_0xd22e('0x43')][_0xd22e('0x45')]?_0x3b7b8b[_0xd22e('0x43')]:_0x577748[_0xd22e('0x42')];_0x3b7b8b[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0x36e848['query'][_0xd22e('0x48')]);_0x3b7b8b[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x36e848[_0xd22e('0x3e')],_0x577748[_0xd22e('0x40')]));if(_0x36e848[_0xd22e('0x3e')]['filter']){_0x3b7b8b[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x3b7b8b[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0x3b7b8b['attributes'],function(_0x2475af){var _0x2faf46={};_0x2faf46[_0x2475af]={'$like':'%'+_0x36e848[_0xd22e('0x3e')]['filter']+'%'};return _0x2faf46;})});}_0x3b7b8b=_['merge']({},_0x3b7b8b,_0x36e848['options']);return _0x1d8a12[_0xd22e('0x9b')](_0x3b7b8b);}})['then'](function(_0x2ea285){if(_0x2ea285){_0x5c6ab4=_0x2ea285[_0xd22e('0x45')];if(!_0x36e848[_0xd22e('0x3e')][_0xd22e('0x46')](_0xd22e('0x65'))){_0x3b7b8b['limit']=qs[_0xd22e('0x22')](_0x36e848['query'][_0xd22e('0x22')]);_0x3b7b8b[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x36e848['query'][_0xd22e('0x20')]);}return _0x1d8a12[_0xd22e('0x9b')](_0x3b7b8b);}})['then'](function(_0x5f5220){return _0x5f5220?{'count':_0x5c6ab4,'rows':_0x5f5220}:null;})['then'](respondWithResult(_0x5700de,null))[_0xd22e('0x53')](handleError(_0x5700de,null));};exports[_0xd22e('0x9c')]=function(_0x5197ff,_0x1cca8c,_0x185f33){var _0x453c4a={};var _0x3b7854={};var _0x58d9f5;var _0x49745f;return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x5197ff[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x1cca8c,null))[_0xd22e('0x2a')](function(_0x269e6f){if(_0x269e6f){_0x58d9f5=_0x269e6f;_0x3b7854[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db[_0xd22e('0x9d')][_0xd22e('0x3c')]);_0x3b7854['query']=_['keys'](_0x5197ff[_0xd22e('0x3e')]);_0x3b7854['filters']=_[_0xd22e('0x41')](_0x3b7854[_0xd22e('0x42')],_0x3b7854[_0xd22e('0x3e')]);_0x453c4a[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x3b7854[_0xd22e('0x42')],qs[_0xd22e('0x44')](_0x5197ff[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x453c4a[_0xd22e('0x43')]=_0x453c4a[_0xd22e('0x43')]['length']?_0x453c4a[_0xd22e('0x43')]:_0x3b7854[_0xd22e('0x42')];_0x453c4a[_0xd22e('0x47')]=qs['sort'](_0x5197ff[_0xd22e('0x3e')]['sort']);_0x453c4a[_0xd22e('0x4b')]=qs[_0xd22e('0x40')](_[_0xd22e('0x49')](_0x5197ff[_0xd22e('0x3e')],_0x3b7854[_0xd22e('0x40')]));if(_0x5197ff[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x453c4a[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x453c4a[_0xd22e('0x4b')],{'$or':_[_0xd22e('0x32')](_0x453c4a[_0xd22e('0x43')],function(_0x55e82d){var _0x99b626={};_0x99b626[_0x55e82d]={'$like':'%'+_0x5197ff[_0xd22e('0x3e')][_0xd22e('0x4a')]+'%'};return _0x99b626;})});}_0x453c4a=_[_0xd22e('0x4c')]({},_0x453c4a,_0x5197ff[_0xd22e('0x4e')]);return _0x58d9f5['getLists'](_0x453c4a);}})[_0xd22e('0x2a')](function(_0x47daf5){if(_0x47daf5){_0x49745f=_0x47daf5[_0xd22e('0x45')];if(!_0x5197ff[_0xd22e('0x3e')][_0xd22e('0x46')](_0xd22e('0x65'))){_0x453c4a['limit']=qs[_0xd22e('0x22')](_0x5197ff[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x453c4a[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x5197ff['query'][_0xd22e('0x20')]);}return _0x58d9f5['getLists'](_0x453c4a);}})[_0xd22e('0x2a')](function(_0x4bc939){if(_0x4bc939){return _0x4bc939?{'count':_0x49745f,'rows':_0x4bc939}:null;}})[_0xd22e('0x2a')](respondWithResult(_0x1cca8c,null))['catch'](handleError(_0x1cca8c,null));};exports[_0xd22e('0x9e')]=function(_0x16b9fa,_0x1d621c,_0x1cac5b){var _0x3539cc=moment()[_0xd22e('0x7f')](_0xd22e('0x9f'));var _0x531b52,_0x452ab9;return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x16b9fa[_0xd22e('0x54')]['id']}})['then'](handleEntityNotFound(_0x1d621c,null))['then'](function(_0x397587){if(_0x397587){_0x452ab9=_0x397587;return _0x397587['addLists'](_0x16b9fa[_0xd22e('0x56')][_0xd22e('0x83')],_[_0xd22e('0x5e')](_0x16b9fa['body'],[_0xd22e('0x83'),'id'])||{});}return null;})[_0xd22e('0x97')](function(_0x3398bc){var _0x542d18;_0x531b52=_0x3398bc||[];var _0x50c1f9=[];if(_0x3398bc){for(var _0x3b30cd=0x0;_0x3b30cd<_0x3398bc[_0xd22e('0x45')];_0x3b30cd+=0x1){var _0x2ac5c4=_0x3398bc[_0x3b30cd][_0xd22e('0x2c')]({'plain':!![]});_0x452ab9[_0xd22e('0xa0')]=_0x16b9fa[_0xd22e('0x56')]['dialCheckDuplicateType']?_0x16b9fa[_0xd22e('0x56')]['dialCheckDuplicateType']:_0x452ab9[_0xd22e('0xa0')];switch(_0x452ab9[_0xd22e('0xa0')]){case _0xd22e('0xa1'):_0x542d18=squel[_0xd22e('0xa2')]()[_0xd22e('0xa3')](_0xd22e('0xa4'))[_0xd22e('0xa5')]([_0xd22e('0xa6'),_0xd22e('0xa7'),_0xd22e('0xa8'),_0xd22e('0xa9'),_0xd22e('0x66'),'createdAt',_0xd22e('0x60')],squel[_0xd22e('0x84')]()[_0xd22e('0x85')]('phone',_0xd22e('0xa6'))[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27','scheduledAt')[_0xd22e('0x85')]('id',_0xd22e('0xa8'))[_0xd22e('0x85')](_0x2ac5c4['CmListId'][_0xd22e('0xaa')](),'ListId')[_0xd22e('0x85')](_0x16b9fa[_0xd22e('0x54')]['id'][_0xd22e('0xaa')](),'VoiceQueueId')[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27',_0xd22e('0x5f'))['field']('\x27'+_0x3539cc+'\x27',_0xd22e('0x60'))['from'](_0xd22e('0xab'))[_0xd22e('0x4b')]('deletedAt\x20IS\x20NULL')['where'](_0xd22e('0xac'),_0x2ac5c4['CmListId']['toString']())[_0xd22e('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xd22e('0x4b')](_0xd22e('0xad'),squel['select']()[_0xd22e('0x85')](_0xd22e('0xae'))[_0xd22e('0x87')](_0xd22e('0xaf'))[_0xd22e('0x4b')]('VoiceQueueId\x20=\x20?',_0x16b9fa['params']['id'][_0xd22e('0xaa')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xd22e('0x84')]()[_0xd22e('0x85')]('COALESCE(phone,\x27\x27)')[_0xd22e('0x87')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x16b9fa[_0xd22e('0x54')]['id'][_0xd22e('0xaa')]())))[_0xd22e('0xaa')]();break;case _0xd22e('0xb0'):_0x542d18=squel[_0xd22e('0xa2')]()['into'](_0xd22e('0xa4'))[_0xd22e('0xa5')](['phone','scheduledAt',_0xd22e('0xa8'),_0xd22e('0xa9'),_0xd22e('0x66'),_0xd22e('0x5f'),'updatedAt'],squel['select']()[_0xd22e('0x85')](_0xd22e('0xa6'),'phone')['field']('\x27'+_0x3539cc+'\x27',_0xd22e('0xa7'))[_0xd22e('0x85')]('id',_0xd22e('0xa8'))[_0xd22e('0x85')](_0x2ac5c4['CmListId'][_0xd22e('0xaa')](),_0xd22e('0xa9'))[_0xd22e('0x85')](_0x16b9fa[_0xd22e('0x54')]['id'][_0xd22e('0xaa')](),'VoiceQueueId')[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27',_0xd22e('0x5f'))[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27',_0xd22e('0x60'))[_0xd22e('0x87')](_0xd22e('0xab'))[_0xd22e('0x4b')](_0xd22e('0xb1'))[_0xd22e('0x4b')]('ListId\x20=\x20?',_0x2ac5c4['CmListId'][_0xd22e('0xaa')]())[_0xd22e('0x4b')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd22e('0xad'),squel[_0xd22e('0x84')]()[_0xd22e('0x85')](_0xd22e('0xb2'))[_0xd22e('0x87')](_0xd22e('0xa4'))[_0xd22e('0x4b')]('VoiceQueueId\x20=\x20?',_0x16b9fa[_0xd22e('0x54')]['id'][_0xd22e('0xaa')]())))[_0xd22e('0xaa')]();break;default:_0x542d18=squel['insert']()[_0xd22e('0xa3')](_0xd22e('0xa4'))[_0xd22e('0xa5')](['phone',_0xd22e('0xa7'),'ContactId',_0xd22e('0xa9'),_0xd22e('0x66'),_0xd22e('0x5f'),_0xd22e('0x60')],squel[_0xd22e('0x84')]()[_0xd22e('0x85')]('phone',_0xd22e('0xa6'))[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27',_0xd22e('0xa7'))[_0xd22e('0x85')]('id',_0xd22e('0xa8'))[_0xd22e('0x85')](_0x2ac5c4['CmListId'][_0xd22e('0xaa')](),'ListId')['field'](_0x16b9fa[_0xd22e('0x54')]['id'][_0xd22e('0xaa')](),_0xd22e('0x66'))[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27','createdAt')[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27','updatedAt')[_0xd22e('0x87')](_0xd22e('0xab'))[_0xd22e('0x4b')](_0xd22e('0xb1'))[_0xd22e('0x4b')](_0xd22e('0xac'),_0x2ac5c4[_0xd22e('0xb3')][_0xd22e('0xaa')]())[_0xd22e('0x4b')](_0xd22e('0xb4')))['toString']();}_0x50c1f9[_0xd22e('0x8e')](db[_0xd22e('0x77')][_0xd22e('0x3e')](_0x542d18));}return BPromise[_0xd22e('0xb5')](_0x50c1f9);}})[_0xd22e('0x2a')](function(){var _0x2d361e=[];var _0x2bedd5=squel['insert']()['into']('cm_hopper_additional_phones')[_0xd22e('0xa5')](['CmHopperId','phone',_0xd22e('0xb6'),_0xd22e('0x5f'),'updatedAt'],squel[_0xd22e('0x84')]()[_0xd22e('0x85')](_0xd22e('0xb7'))[_0xd22e('0x85')](_0xd22e('0xb8'))[_0xd22e('0x85')](_0xd22e('0xb9'))[_0xd22e('0x85')]('\x27'+_0x3539cc+'\x27','createdAt')['field']('\x27'+_0x3539cc+'\x27',_0xd22e('0x60'))[_0xd22e('0x87')](_0xd22e('0xba'),'ci')['join'](_0xd22e('0xa4'),'h',_0xd22e('0xbb'))[_0xd22e('0x4b')](_0xd22e('0xbc'),_0x3539cc)['where'](_0xd22e('0xbd'),_0xd22e('0xbe')))[_0xd22e('0xaa')]();_0x2d361e['push'](db[_0xd22e('0x77')][_0xd22e('0x3e')](_0x2bedd5));return BPromise[_0xd22e('0xb5')](_0x2d361e);})[_0xd22e('0x2a')](function(){return _0x531b52;})[_0xd22e('0x2a')](respondWithResult(_0x1d621c,null))[_0xd22e('0x53')](handleError(_0x1d621c,null));};exports[_0xd22e('0xbf')]=function(_0x2f687e,_0x100ed4,_0x1daab8){return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x2f687e[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x100ed4,null))[_0xd22e('0x2a')](function(_0x920446){if(_0x920446){return _0x920446['removeLists'](_0x2f687e[_0xd22e('0x3e')][_0xd22e('0x83')]);}})[_0xd22e('0x2a')](function(_0x586588){if(_0x586588){return db[_0xd22e('0x67')][_0xd22e('0x2b')]({'where':{'ListId':_0x2f687e[_0xd22e('0x3e')][_0xd22e('0x83')],'VoiceQueueId':_0x2f687e[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](function(){return _0x586588;});}})[_0xd22e('0x2a')](respondWithStatusCode(_0x100ed4,null))[_0xd22e('0x53')](handleError(_0x100ed4,null));};exports[_0xd22e('0xc0')]=function(_0x4a7ee8,_0x1671bb,_0x4a7994){var _0x491775={};var _0x4d48d1={};var _0x509b66;var _0x13dd4d;return db[_0xd22e('0x3b')][_0xd22e('0x64')]({'where':{'id':_0x4a7ee8[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x1671bb,null))[_0xd22e('0x2a')](function(_0x46956){if(_0x46956){_0x509b66=_0x46956;_0x4d48d1[_0xd22e('0x42')]=_[_0xd22e('0x3f')](db[_0xd22e('0x9d')][_0xd22e('0x3c')]);_0x4d48d1[_0xd22e('0x3e')]=_[_0xd22e('0x3f')](_0x4a7ee8[_0xd22e('0x3e')]);_0x4d48d1[_0xd22e('0x40')]=_[_0xd22e('0x41')](_0x4d48d1[_0xd22e('0x42')],_0x4d48d1['query']);_0x491775[_0xd22e('0x43')]=_[_0xd22e('0x41')](_0x4d48d1['model'],qs[_0xd22e('0x44')](_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x44')]));_0x491775[_0xd22e('0x43')]=_0x491775[_0xd22e('0x43')][_0xd22e('0x45')]?_0x491775[_0xd22e('0x43')]:_0x4d48d1['model'];_0x491775[_0xd22e('0x47')]=qs[_0xd22e('0x48')](_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x48')]);_0x491775['where']=qs['filters'](_[_0xd22e('0x49')](_0x4a7ee8[_0xd22e('0x3e')],_0x4d48d1[_0xd22e('0x40')]));if(_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x4a')]){_0x491775[_0xd22e('0x4b')]=_[_0xd22e('0x4c')](_0x491775['where'],{'$or':_[_0xd22e('0x32')](_0x491775['attributes'],function(_0x39e2b0){var _0x101083={};_0x101083[_0x39e2b0]={'$like':'%'+_0x4a7ee8['query'][_0xd22e('0x4a')]+'%'};return _0x101083;})});}_0x491775=_[_0xd22e('0x4c')]({},_0x491775,_0x4a7ee8[_0xd22e('0x4e')]);return _0x509b66[_0xd22e('0xc0')](_0x491775);}})['then'](function(_0x4705a8){if(_0x4705a8){_0x13dd4d=_0x4705a8[_0xd22e('0x45')];if(!_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x46')](_0xd22e('0x65'))){_0x491775['limit']=qs['limit'](_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x22')]);_0x491775[_0xd22e('0x20')]=qs[_0xd22e('0x20')](_0x4a7ee8[_0xd22e('0x3e')][_0xd22e('0x20')]);}return _0x509b66[_0xd22e('0xc0')](_0x491775);}})[_0xd22e('0x2a')](function(_0x46ad8d){if(_0x46ad8d){return _0x46ad8d?{'count':_0x13dd4d,'rows':_0x46ad8d}:null;}})['then'](respondWithResult(_0x1671bb,null))['catch'](handleError(_0x1671bb,null));};exports[_0xd22e('0xc1')]=function(_0x28a475,_0x1ad86d,_0x3e25df){var _0x42fd85,_0x40af2d;return db[_0xd22e('0x3b')][_0xd22e('0x34')]({'where':{'id':_0x28a475[_0xd22e('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ad86d,null))[_0xd22e('0x2a')](function(_0x5ba842){if(_0x5ba842){_0x40af2d=_0x5ba842;return _0x5ba842[_0xd22e('0xc1')](_0x28a475[_0xd22e('0x56')][_0xd22e('0x83')],_[_0xd22e('0x5e')](_0x28a475['body'],[_0xd22e('0x83'),'id'])||{});}return null;})[_0xd22e('0x97')](function(_0x3f7581){var _0x4e1ece;_0x42fd85=_0x3f7581||[];var _0x3b6f48=[];if(_0x3f7581){for(var _0x5a0fd0=0x0;_0x5a0fd0<_0x3f7581[_0xd22e('0x45')];_0x5a0fd0+=0x1){var _0x25fcd7=_0x3f7581[_0x5a0fd0][_0xd22e('0x2c')]({'plain':!![]});_0x4e1ece=squel[_0xd22e('0xa2')]()[_0xd22e('0xa3')](_0xd22e('0xc2'))[_0xd22e('0xa5')]([_0xd22e('0xa6'),_0xd22e('0xa8'),'ListId',_0xd22e('0x66'),_0xd22e('0x5f'),_0xd22e('0x60')],squel[_0xd22e('0x84')]()['field'](_0xd22e('0xa6'),'phone')[_0xd22e('0x85')]('id',_0xd22e('0xa8'))[_0xd22e('0x85')](_0x25fcd7['CmListId'][_0xd22e('0xaa')](),_0xd22e('0xa9'))[_0xd22e('0x85')](_0x28a475[_0xd22e('0x54')]['id'][_0xd22e('0xaa')](),_0xd22e('0x66'))['field'](_0xd22e('0xc3'),_0xd22e('0x5f'))['field']('NOW()',_0xd22e('0x60'))[_0xd22e('0x87')]('cm_contacts')[_0xd22e('0x4b')](_0xd22e('0xb1'))[_0xd22e('0x4b')](_0xd22e('0xac'),_0x25fcd7['CmListId'][_0xd22e('0xaa')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xd22e('0xaa')]();_0x3b6f48[_0xd22e('0x8e')](db[_0xd22e('0x77')]['query'](_0x4e1ece));}return BPromise[_0xd22e('0xb5')](_0x3b6f48);}})[_0xd22e('0x2a')](function(){return _0x42fd85;})[_0xd22e('0x2a')](respondWithResult(_0x1ad86d,null))['catch'](handleError(_0x1ad86d,null));};exports[_0xd22e('0xc4')]=function(_0x33ec20,_0x275721,_0x3f5bb1){return db['VoiceQueue'][_0xd22e('0x34')]({'where':{'id':_0x33ec20[_0xd22e('0x54')]['id']}})[_0xd22e('0x2a')](handleEntityNotFound(_0x275721,null))[_0xd22e('0x2a')](function(_0x502542){if(_0x502542){return _0x502542[_0xd22e('0xc4')](_0x33ec20[_0xd22e('0x3e')][_0xd22e('0x83')]);}})[_0xd22e('0x2a')](function(_0x57cb37){if(_0x57cb37){return db[_0xd22e('0x6d')][_0xd22e('0x2b')]({'where':{'ListId':_0x33ec20[_0xd22e('0x3e')]['ids'],'VoiceQueueId':_0x33ec20['params']['id']}})[_0xd22e('0x2a')](function(){return _0x57cb37;});}})[_0xd22e('0x2a')](respondWithStatusCode(_0x275721,null))[_0xd22e('0x53')](handleError(_0x275721,null));}; \ No newline at end of file +var _0xe829=['CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','map','value','find','type','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','VoiceQueueId','count','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','fromQuery','scheduledAt','ContactId','ListId','phone'];(function(_0x92cf25,_0x314e80){var _0x9ac78c=function(_0x118881){while(--_0x118881){_0x92cf25['push'](_0x92cf25['shift']());}};_0x9ac78c(++_0x314e80);}(_0xe829,0xde));var _0x9e82=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xe829[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e82('0x0'));var zipdir=require(_0x9e82('0x1'));var jsonpatch=require(_0x9e82('0x2'));var rp=require(_0x9e82('0x3'));var moment=require(_0x9e82('0x4'));var BPromise=require(_0x9e82('0x5'));var Mustache=require('mustache');var util=require(_0x9e82('0x6'));var path=require(_0x9e82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e82('0x8'));var _=require(_0x9e82('0x9'));var squel=require(_0x9e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e82('0xb'));var deskjs=require(_0x9e82('0xc'));var toCsv=require(_0x9e82('0xd'));var querystring=require(_0x9e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e82('0xf'));var authService=require(_0x9e82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e82('0x11'));var hardwareService=require(_0x9e82('0x12'));var logger=require('../../config/logger')(_0x9e82('0x13'));var utils=require(_0x9e82('0x14'));var config=require(_0x9e82('0x15'));var licenseUtil=require(_0x9e82('0x16'));var db=require(_0x9e82('0x17'))['db'];config['redis']=_[_0x9e82('0x18')](config[_0x9e82('0x19')],{'host':_0x9e82('0x1a'),'port':0x18eb});var socket=require(_0x9e82('0x1b'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x4aaa5f,_0x5909a6){_0x5909a6=_0x5909a6||0xcc;return function(_0xa4bd12){if(_0xa4bd12){return _0x4aaa5f['sendStatus'](_0x5909a6);}return _0x4aaa5f[_0x9e82('0x1c')](_0x5909a6)[_0x9e82('0x1d')]();};}function respondWithResult(_0x1bdf3f,_0x37cea0){_0x37cea0=_0x37cea0||0xc8;return function(_0x4fa628){if(_0x4fa628){return _0x1bdf3f[_0x9e82('0x1c')](_0x37cea0)[_0x9e82('0x1e')](_0x4fa628);}};}function respondWithFilteredResult(_0x4e5203,_0x495af4){return function(_0x2a0afd){if(_0x2a0afd){var _0x1554b5=typeof _0x495af4[_0x9e82('0x1f')]===_0x9e82('0x20')&&typeof _0x495af4[_0x9e82('0x21')]===_0x9e82('0x20');var _0xaeaa71=_0x2a0afd['count'];var _0x243a46=_0x1554b5?0x0:_0x495af4[_0x9e82('0x1f')];var _0x3463e6=_0x1554b5?_0x2a0afd['count']:_0x495af4[_0x9e82('0x1f')]+_0x495af4['limit'];var _0x2e8cec;if(_0x3463e6>=_0xaeaa71){_0x3463e6=_0xaeaa71;_0x2e8cec=0xc8;}else{_0x2e8cec=0xce;}_0x4e5203[_0x9e82('0x1c')](_0x2e8cec);return _0x4e5203[_0x9e82('0x22')](_0x9e82('0x23'),_0x243a46+'-'+_0x3463e6+'/'+_0xaeaa71)[_0x9e82('0x1e')](_0x2a0afd);}return null;};}function patchUpdates(_0x4d23ed){return function(_0x8eabaa){try{jsonpatch[_0x9e82('0x24')](_0x8eabaa,_0x4d23ed,!![]);}catch(_0x221969){return BPromise[_0x9e82('0x25')](_0x221969);}return _0x8eabaa['save']();};}function saveUpdates(_0x551f4d,_0x2f7d3f){return function(_0x16e006){if(_0x16e006){return _0x16e006[_0x9e82('0x26')](_0x551f4d)[_0x9e82('0x27')](function(_0x1840ae){return _0x1840ae;});}return null;};}function removeEntity(_0x10628d,_0x54ffa4){return function(_0x18c645){if(_0x18c645){return _0x18c645['destroy']()['then'](function(){var _0x2cb910=_0x18c645['get']({'plain':!![]});var _0x5a5a4e=[{'name':_0x9e82('0x28'),'value':_0x9e82('0x29'),'ignore':![]},{'name':_0x9e82('0x2a'),'value':_0x9e82('0x2b'),'ignore':![]}];var _0x19491d=_(_0x5a5a4e)['filter']('ignore')[_0x9e82('0x2c')](_0x9e82('0x2d'))[_0x9e82('0x2d')]();if(_['includes'](_0x19491d,_0x2cb910['type'])){return;}var _0x3a2acf=_[_0x9e82('0x2e')](_0x5a5a4e,[_0x9e82('0x2d'),_0x2cb910[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x31')]['destroy']({'where':{'type':_0x3a2acf,'resourceId':_0x2cb910['id']}})['then'](function(){return _0x18c645;});})['then'](function(){_0x10628d['status'](0xcc)[_0x9e82('0x1d')]();});}};}function handleEntityNotFound(_0x2a9fbf,_0x369ffc){return function(_0x4bcedd){if(!_0x4bcedd){_0x2a9fbf[_0x9e82('0x32')](0x194);}return _0x4bcedd;};}function handleError(_0x4398c7,_0x5f08fc){_0x5f08fc=_0x5f08fc||0x1f4;return function(_0x38be79){logger[_0x9e82('0x33')](_0x38be79[_0x9e82('0x34')]);if(_0x38be79[_0x9e82('0x30')]){delete _0x38be79[_0x9e82('0x30')];}_0x4398c7[_0x9e82('0x1c')](_0x5f08fc)[_0x9e82('0x35')](_0x38be79);};}exports[_0x9e82('0x36')]=function(_0x440b32,_0x454130){var _0xb3f1d1={},_0xfe2faa={},_0x17bf99={'count':0x0,'rows':[]};var _0x1f5028=_[_0x9e82('0x2c')](db[_0x9e82('0x37')][_0x9e82('0x38')],function(_0x386c4a){return{'name':_0x386c4a[_0x9e82('0x39')],'type':_0x386c4a[_0x9e82('0x2f')][_0x9e82('0x3a')]};});_0xfe2faa[_0x9e82('0x3b')]=_[_0x9e82('0x2c')](_0x1f5028,_0x9e82('0x30'));_0xfe2faa[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x440b32[_0x9e82('0x3c')]);_0xfe2faa['filters']=_['intersection'](_0xfe2faa['model'],_0xfe2faa['query']);_0xb3f1d1[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0xfe2faa[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x440b32[_0x9e82('0x3c')][_0x9e82('0x40')]));_0xb3f1d1[_0x9e82('0x3e')]=_0xb3f1d1[_0x9e82('0x3e')][_0x9e82('0x41')]?_0xb3f1d1[_0x9e82('0x3e')]:_0xfe2faa[_0x9e82('0x3b')];if(!_0x440b32[_0x9e82('0x3c')]['hasOwnProperty'](_0x9e82('0x42'))){_0xb3f1d1[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x440b32['query'][_0x9e82('0x21')]);_0xb3f1d1[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x440b32['query'][_0x9e82('0x1f')]);}_0xb3f1d1[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x440b32[_0x9e82('0x3c')][_0x9e82('0x44')]);_0xb3f1d1[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x440b32[_0x9e82('0x3c')],_0xfe2faa[_0x9e82('0x46')]),_0x1f5028);if(_0x440b32[_0x9e82('0x3c')]['filter']){_0xb3f1d1[_0x9e82('0x45')]=_[_0x9e82('0x48')](_0xb3f1d1[_0x9e82('0x45')],{'$or':_['map'](_0x1f5028,function(_0x5c1542){if(_0x5c1542['type']!==_0x9e82('0x49')){var _0x17df58={};_0x17df58[_0x5c1542[_0x9e82('0x30')]]={'$like':'%'+_0x440b32['query'][_0x9e82('0x4a')]+'%'};return _0x17df58;}})});}_0xb3f1d1=_[_0x9e82('0x48')]({},_0xb3f1d1,_0x440b32[_0x9e82('0x4b')]);var _0x6b23bf={'where':_0xb3f1d1[_0x9e82('0x45')]};return db[_0x9e82('0x37')]['count'](_0x6b23bf)[_0x9e82('0x27')](function(_0x5a54be){_0x17bf99['count']=_0x5a54be;if(_0x440b32[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0xb3f1d1[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x37')][_0x9e82('0x4e')](_0xb3f1d1);})[_0x9e82('0x27')](function(_0x3780b0){_0x17bf99[_0x9e82('0x4f')]=_0x3780b0;return _0x17bf99;})['then'](respondWithFilteredResult(_0x454130,_0xb3f1d1))[_0x9e82('0x50')](handleError(_0x454130,null));};exports['show']=function(_0x26137e,_0x2ccaa3){var _0x800eff={'raw':![],'where':{'id':_0x26137e[_0x9e82('0x51')]['id']}},_0x3b5641={};_0x3b5641[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x37')][_0x9e82('0x38')]);_0x3b5641['query']=_[_0x9e82('0x3d')](_0x26137e[_0x9e82('0x3c')]);_0x3b5641[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x3b5641[_0x9e82('0x3b')],_0x3b5641[_0x9e82('0x3c')]);_0x800eff[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x3b5641[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x26137e[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x800eff[_0x9e82('0x3e')]=_0x800eff[_0x9e82('0x3e')]['length']?_0x800eff[_0x9e82('0x3e')]:_0x3b5641[_0x9e82('0x3b')];if(_0x26137e[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x800eff[_0x9e82('0x4d')]=[{'all':!![]}];}_0x800eff=_[_0x9e82('0x48')]({},_0x800eff,_0x26137e[_0x9e82('0x4b')]);return db[_0x9e82('0x37')][_0x9e82('0x2e')](_0x800eff)[_0x9e82('0x27')](handleEntityNotFound(_0x2ccaa3,null))[_0x9e82('0x27')](respondWithResult(_0x2ccaa3,null))[_0x9e82('0x50')](handleError(_0x2ccaa3,null));};exports[_0x9e82('0x52')]=function(_0x30414c,_0x862b8f){return db['VoiceQueue'][_0x9e82('0x52')](_0x30414c[_0x9e82('0x53')],{})[_0x9e82('0x27')](function(_0x55f4e4){var _0x3cdc48=_0x30414c[_0x9e82('0x54')][_0x9e82('0x55')]({'plain':!![]});if(!_0x3cdc48)throw new Error(_0x9e82('0x56'));if(_0x3cdc48['role']===_0x9e82('0x54')){var _0x2c943c=_0x55f4e4[_0x9e82('0x55')]({'plain':!![]});var _0x4081b1=[{'name':'VoiceQueues','value':_0x9e82('0x29')},{'name':_0x9e82('0x2a'),'value':'outbound'}];var _0x4ce858=_[_0x9e82('0x2e')](_0x4081b1,[_0x9e82('0x2d'),_0x2c943c[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x57')]['find']({'where':{'name':_0x4ce858,'userProfileId':_0x3cdc48[_0x9e82('0x58')]},'raw':!![]})['then'](function(_0x10fb8a){if(_0x10fb8a&&_0x10fb8a[_0x9e82('0x59')]===0x0){return db[_0x9e82('0x31')][_0x9e82('0x52')]({'name':_0x2c943c[_0x9e82('0x30')],'resourceId':_0x2c943c['id'],'type':_0x10fb8a[_0x9e82('0x30')],'sectionId':_0x10fb8a['id']},{})[_0x9e82('0x27')](function(){return _0x55f4e4;});}else{return _0x55f4e4;}})['catch'](function(_0x2c782d){logger[_0x9e82('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c782d);throw _0x2c782d;});}return _0x55f4e4;})['then'](respondWithResult(_0x862b8f,0xc9))['catch'](handleError(_0x862b8f,null));};exports['clone']=function(_0x432351,_0x4051d5){var _0x8e32c8={'where':{'id':_0x432351[_0x9e82('0x51')]['id']}},_0xa83d85={};_0xa83d85['model']=_[_0x9e82('0x3d')](db[_0x9e82('0x37')][_0x9e82('0x38')]);_0x8e32c8[_0x9e82('0x3e')]=_['intersection'](_0xa83d85['model'],qs['fields'](_0x432351[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x8e32c8[_0x9e82('0x3e')]=_0x8e32c8[_0x9e82('0x3e')]['length']?_0x8e32c8[_0x9e82('0x3e')]:_0xa83d85[_0x9e82('0x3b')];if(_0x432351[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x8e32c8[_0x9e82('0x4d')]=[{'all':!![]}];}_0x8e32c8=_[_0x9e82('0x48')]({},_0x8e32c8,_0x432351[_0x9e82('0x4b')]);return db[_0x9e82('0x37')][_0x9e82('0x2e')](_0x8e32c8)[_0x9e82('0x27')](handleEntityNotFound(_0x4051d5,null))[_0x9e82('0x27')](function(_0x1fa68e){if(_0x1fa68e){var _0x2f3dbb=_0x1fa68e[_0x9e82('0x55')]({'plain':!![]});_0x2f3dbb=qs[_0x9e82('0x5a')](_0x2f3dbb,['id',_0x9e82('0x5b'),_0x9e82('0x5c')]);_0x432351['body']=_['omit'](_0x432351['body'],['id',_0x9e82('0x5b'),_0x9e82('0x5c')]);return db[_0x9e82('0x37')]['create'](_[_0x9e82('0x48')](_0x2f3dbb,_0x432351[_0x9e82('0x53')]),{'include':_0x432351['query'][_0x9e82('0x4c')]?[{'all':!![]}]:undefined})[_0x9e82('0x27')](function(_0x3dc13a){var _0x1acc06=_0x432351[_0x9e82('0x54')][_0x9e82('0x55')]({'plain':!![]});if(!_0x1acc06)throw new Error(_0x9e82('0x56'));if(_0x1acc06[_0x9e82('0x5d')]==='user'){var _0x429651=_0x3dc13a[_0x9e82('0x55')]({'plain':!![]});var _0x1ba149=[{'name':_0x9e82('0x28'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x9e82('0x2b')}];var _0x388e4f=_[_0x9e82('0x2e')](_0x1ba149,[_0x9e82('0x2d'),_0x429651[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x57')][_0x9e82('0x2e')]({'where':{'name':_0x388e4f,'userProfileId':_0x1acc06[_0x9e82('0x58')]},'raw':!![]})['then'](function(_0x3c86b9){if(_0x3c86b9&&_0x3c86b9[_0x9e82('0x59')]===0x0){return db[_0x9e82('0x31')]['create']({'name':_0x429651[_0x9e82('0x30')],'resourceId':_0x429651['id'],'type':_0x3c86b9['name'],'sectionId':_0x3c86b9['id']},{})[_0x9e82('0x27')](function(){return _0x3dc13a;});}else{return _0x3dc13a;}})[_0x9e82('0x50')](function(_0x2941ea){logger[_0x9e82('0x33')](_0x9e82('0x5e'),_0x2941ea);throw _0x2941ea;});}return _0x3dc13a;});}})[_0x9e82('0x27')](respondWithResult(_0x4051d5,0xc9))['catch'](handleError(_0x4051d5,null));};exports[_0x9e82('0x26')]=function(_0x482d28,_0x37d21d){if(_0x482d28['body']['id']){delete _0x482d28['body']['id'];}return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x482d28['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x37d21d,null))[_0x9e82('0x27')](saveUpdates(_0x482d28[_0x9e82('0x53')],null))['then'](respondWithResult(_0x37d21d,null))[_0x9e82('0x50')](handleError(_0x37d21d,null));};exports[_0x9e82('0x5f')]=function(_0x150277,_0x3de159){return db['VoiceQueue'][_0x9e82('0x2e')]({'where':{'id':_0x150277[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x3de159,null))[_0x9e82('0x27')](removeEntity(_0x3de159,null))[_0x9e82('0x50')](handleError(_0x3de159,null));};exports[_0x9e82('0x60')]=function(_0x276e91,_0x1dbed9,_0x264d51){var _0x2b113c={'raw':![],'where':{}};var _0x38b1a1={};var _0x15eb8e={'count':0x0,'rows':[]};return db[_0x9e82('0x37')]['findOne']({'where':{'id':_0x276e91[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x1dbed9,null))['then'](function(_0x164d25){if(_0x164d25){_0x38b1a1[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x61')]['rawAttributes']);_0x38b1a1[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x276e91[_0x9e82('0x3c')]);_0x38b1a1[_0x9e82('0x46')]=_['intersection'](_0x38b1a1[_0x9e82('0x3b')],_0x38b1a1['query']);_0x2b113c[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x38b1a1[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x276e91[_0x9e82('0x3c')]['fields']));_0x2b113c[_0x9e82('0x3e')]=_0x2b113c['attributes'][_0x9e82('0x41')]?_0x2b113c[_0x9e82('0x3e')]:_0x38b1a1[_0x9e82('0x3b')];if(!_0x276e91['query']['hasOwnProperty']('nolimit')){_0x2b113c['limit']=qs[_0x9e82('0x21')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x2b113c[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x2b113c[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x2b113c[_0x9e82('0x45')]=qs['filters'](_[_0x9e82('0x47')](_0x276e91[_0x9e82('0x3c')],_0x38b1a1[_0x9e82('0x46')]));_0x2b113c[_0x9e82('0x45')][_0x9e82('0x62')]=_0x164d25['id'];if(_0x276e91[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x2b113c['where']=_[_0x9e82('0x48')](_0x2b113c[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x2b113c[_0x9e82('0x3e')],function(_0x4ec174){var _0x360de8={};_0x360de8[_0x4ec174]={'$like':'%'+_0x276e91['query'][_0x9e82('0x4a')]+'%'};return _0x360de8;})});}_0x2b113c=_[_0x9e82('0x48')]({},_0x2b113c,_0x276e91[_0x9e82('0x4b')]);return db[_0x9e82('0x61')][_0x9e82('0x63')]({'where':_0x2b113c[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x1544e8){_0x15eb8e['count']=_0x1544e8;if(_0x276e91[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x2b113c['include']=[{'all':!![]}];}return db[_0x9e82('0x61')][_0x9e82('0x4e')](_0x2b113c);})[_0x9e82('0x27')](function(_0x46dfbb){_0x15eb8e['rows']=_0x46dfbb;return _0x15eb8e;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x1dbed9,_0x2b113c))[_0x9e82('0x50')](handleError(_0x1dbed9,null));};exports['getHopperHistories']=function(_0x2b72d7,_0x23dade,_0x2fc049){var _0x5332e5={'raw':!![],'where':{}};var _0x180893={};var _0x32be55={'count':0x0,'rows':[]};return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x2b72d7[_0x9e82('0x51')]['id']}})['then'](handleEntityNotFound(_0x23dade,null))[_0x9e82('0x27')](function(_0x440ad1){if(_0x440ad1){_0x180893[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x65')][_0x9e82('0x38')]);_0x180893[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x2b72d7[_0x9e82('0x3c')]);_0x180893[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x180893['model'],_0x180893['query']);_0x5332e5['attributes']=_['intersection'](_0x180893['model'],qs[_0x9e82('0x40')](_0x2b72d7['query'][_0x9e82('0x40')]));_0x5332e5[_0x9e82('0x3e')]=_0x5332e5['attributes'][_0x9e82('0x41')]?_0x5332e5[_0x9e82('0x3e')]:_0x180893[_0x9e82('0x3b')];if(!_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x5332e5[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x5332e5['offset']=qs[_0x9e82('0x1f')](_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x5332e5[_0x9e82('0x43')]=qs['sort'](_0x2b72d7['query'][_0x9e82('0x44')]);_0x5332e5[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x2b72d7[_0x9e82('0x3c')],_0x180893['filters']));_0x5332e5[_0x9e82('0x45')]['VoiceQueueId']=_0x440ad1['id'];if(_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x5332e5[_0x9e82('0x45')]=_['merge'](_0x5332e5[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x5332e5[_0x9e82('0x3e')],function(_0x428db3){var _0x17f74b={};_0x17f74b[_0x428db3]={'$like':'%'+_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x17f74b;})});}_0x5332e5=_[_0x9e82('0x48')]({},_0x5332e5,_0x2b72d7[_0x9e82('0x4b')]);return db['CmHopperHistory'][_0x9e82('0x63')]({'where':_0x5332e5[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x3005d7){_0x32be55[_0x9e82('0x63')]=_0x3005d7;if(_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x5332e5[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x65')]['findAll'](_0x5332e5);})[_0x9e82('0x27')](function(_0x189c1b){_0x32be55[_0x9e82('0x4f')]=_0x189c1b;return _0x32be55;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x23dade,_0x5332e5))[_0x9e82('0x50')](handleError(_0x23dade,null));};exports[_0x9e82('0x67')]=function(_0x455c96,_0x369984,_0x14f557){var _0x1c8688={'raw':!![],'where':{}};var _0x1b6cfe={};var _0x643263={'count':0x0,'rows':[]};return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x455c96[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x369984,null))[_0x9e82('0x27')](function(_0x4d2ce2){if(_0x4d2ce2){_0x1b6cfe[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x68')]['rawAttributes']);_0x1b6cfe[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x455c96[_0x9e82('0x3c')]);_0x1b6cfe[_0x9e82('0x46')]=_['intersection'](_0x1b6cfe['model'],_0x1b6cfe[_0x9e82('0x3c')]);_0x1c8688[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x1b6cfe[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x1c8688[_0x9e82('0x3e')]=_0x1c8688['attributes']['length']?_0x1c8688[_0x9e82('0x3e')]:_0x1b6cfe[_0x9e82('0x3b')];if(!_0x455c96['query']['hasOwnProperty'](_0x9e82('0x42'))){_0x1c8688['limit']=qs[_0x9e82('0x21')](_0x455c96['query'][_0x9e82('0x21')]);_0x1c8688[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x1c8688[_0x9e82('0x43')]=qs['sort'](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x1c8688[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x455c96[_0x9e82('0x3c')],_0x1b6cfe[_0x9e82('0x46')]));_0x1c8688[_0x9e82('0x45')][_0x9e82('0x62')]=_0x4d2ce2['id'];if(_0x455c96[_0x9e82('0x3c')]['filter']){_0x1c8688[_0x9e82('0x45')]=_['merge'](_0x1c8688['where'],{'$or':_[_0x9e82('0x2c')](_0x1c8688[_0x9e82('0x3e')],function(_0x4f3f2e){var _0x48d66b={};_0x48d66b[_0x4f3f2e]={'$like':'%'+_0x455c96[_0x9e82('0x3c')]['filter']+'%'};return _0x48d66b;})});}_0x1c8688=_[_0x9e82('0x48')]({},_0x1c8688,_0x455c96['options']);return db[_0x9e82('0x68')][_0x9e82('0x63')]({'where':_0x1c8688[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x3df288){_0x643263[_0x9e82('0x63')]=_0x3df288;if(_0x455c96['query'][_0x9e82('0x4c')]){_0x1c8688[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x68')][_0x9e82('0x4e')](_0x1c8688);})[_0x9e82('0x27')](function(_0x1805f3){_0x643263[_0x9e82('0x4f')]=_0x1805f3;return _0x643263;});}})['then'](respondWithFilteredResult(_0x369984,_0x1c8688))['catch'](handleError(_0x369984,null));};exports[_0x9e82('0x69')]=function(_0x41b4e0,_0x199766,_0x53bec3){var _0x2bbc35={'raw':!![],'where':{}};var _0x52e24d={};var _0x123c58={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x41b4e0['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x199766,null))[_0x9e82('0x27')](function(_0x21cf0a){if(_0x21cf0a){_0x52e24d[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x6a')][_0x9e82('0x38')]);_0x52e24d[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x41b4e0['query']);_0x52e24d[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x52e24d[_0x9e82('0x3b')],_0x52e24d['query']);_0x2bbc35[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x52e24d[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x2bbc35[_0x9e82('0x3e')]=_0x2bbc35[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x2bbc35[_0x9e82('0x3e')]:_0x52e24d[_0x9e82('0x3b')];if(!_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x2bbc35[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x2bbc35[_0x9e82('0x1f')]=qs['offset'](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x2bbc35['order']=qs['sort'](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x2bbc35[_0x9e82('0x45')]=qs['filters'](_[_0x9e82('0x47')](_0x41b4e0[_0x9e82('0x3c')],_0x52e24d[_0x9e82('0x46')]));_0x2bbc35[_0x9e82('0x45')][_0x9e82('0x62')]=_0x21cf0a['id'];if(_0x41b4e0['query'][_0x9e82('0x4a')]){_0x2bbc35['where']=_[_0x9e82('0x48')](_0x2bbc35[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x2bbc35[_0x9e82('0x3e')],function(_0x411f9d){var _0x28cdb4={};_0x28cdb4[_0x411f9d]={'$like':'%'+_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x28cdb4;})});}_0x2bbc35=_[_0x9e82('0x48')]({},_0x2bbc35,_0x41b4e0[_0x9e82('0x4b')]);return db['CmHopperBlack'][_0x9e82('0x63')]({'where':_0x2bbc35[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0xd9a81c){_0x123c58[_0x9e82('0x63')]=_0xd9a81c;if(_0x41b4e0['query']['includeAll']){_0x2bbc35[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x6a')][_0x9e82('0x4e')](_0x2bbc35);})[_0x9e82('0x27')](function(_0x412797){_0x123c58[_0x9e82('0x4f')]=_0x412797;return _0x123c58;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x199766,_0x2bbc35))[_0x9e82('0x50')](handleError(_0x199766,null));};exports[_0x9e82('0x6b')]=function(_0x5b0b69,_0x279d35,_0x19c8f4){var _0x3a36ff={};var _0x5ac1ae={};var _0xec0b3a;var _0x1fe1f4;return db[_0x9e82('0x37')]['findOne']({'where':{'id':_0x5b0b69[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x279d35,null))['then'](function(_0x23879e){if(_0x23879e){_0xec0b3a=_0x23879e;_0x5ac1ae[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x6c')][_0x9e82('0x38')]);_0x5ac1ae[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x5b0b69['query']);_0x5ac1ae[_0x9e82('0x46')]=_['intersection'](_0x5ac1ae['model'],_0x5ac1ae[_0x9e82('0x3c')]);_0x3a36ff[_0x9e82('0x3e')]=_['intersection'](_0x5ac1ae[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3a36ff[_0x9e82('0x3e')]=_0x3a36ff[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3a36ff[_0x9e82('0x3e')]:_0x5ac1ae[_0x9e82('0x3b')];_0x3a36ff[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x3a36ff[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x5b0b69[_0x9e82('0x3c')],_0x5ac1ae[_0x9e82('0x46')]));if(_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x3a36ff['where']=_[_0x9e82('0x48')](_0x3a36ff[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x3a36ff[_0x9e82('0x3e')],function(_0x1f38d4){var _0x7a1897={};_0x7a1897[_0x1f38d4]={'$like':'%'+_0x5b0b69[_0x9e82('0x3c')]['filter']+'%'};return _0x7a1897;})});}_0x3a36ff=_[_0x9e82('0x48')]({},_0x3a36ff,_0x5b0b69[_0x9e82('0x4b')]);return _0xec0b3a[_0x9e82('0x6b')](_0x3a36ff);}})[_0x9e82('0x27')](function(_0x567f60){if(_0x567f60){_0x1fe1f4=_0x567f60[_0x9e82('0x41')];if(!_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3a36ff[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x3a36ff[_0x9e82('0x1f')]=qs['offset'](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0xec0b3a['getTeams'](_0x3a36ff);}})['then'](function(_0x437844){if(_0x437844){return _0x437844?{'count':_0x1fe1f4,'rows':_0x437844}:null;}})[_0x9e82('0x27')](respondWithResult(_0x279d35,null))[_0x9e82('0x50')](handleError(_0x279d35,null));};exports[_0x9e82('0x6d')]=function(_0x5584ac,_0x149549,_0x34926e){var _0x4f53d4=_0x5584ac[_0x9e82('0x53')][_0x9e82('0x6e')];var _0x70183f=_[_0x9e82('0x2c')](_0x4f53d4,'id');return db[_0x9e82('0x6c')][_0x9e82('0x4e')]({'where':{'id':_0x70183f},'attributes':['id'],'include':[{'model':db[_0x9e82('0x6f')],'as':_0x9e82('0x70'),'attributes':['id',_0x9e82('0x30'),_0x9e82('0x71'),'voicePause',_0x9e82('0x72')],'raw':!![]}]})['then'](function(_0x299c44){if(_0x299c44){var _0x22c241=_[_0x9e82('0x73')](_0x299c44,function(_0x322cd3){var _0x2bca75=_0x322cd3[_0x9e82('0x55')]({'plain':!![]});_0x2bca75[_0x9e82('0x70')][_0x9e82('0x74')](function(_0x433db1){_0x433db1[_0x9e82('0x75')]=_['find'](_0x4f53d4,{'id':_0x2bca75['id']})[_0x9e82('0x75')];});return _0x2bca75['Agents'];});return db[_0x9e82('0x37')]['find']({'where':{'id':_0x5584ac[_0x9e82('0x51')]['id']}})['then'](function(_0x37d1bd){return db[_0x9e82('0x76')][_0x9e82('0x77')](function(_0x6f4370){return _0x37d1bd[_0x9e82('0x6d')](_0x70183f,{'transaction':_0x6f4370})[_0x9e82('0x27')](function(){return BPromise[_0x9e82('0x78')](_0x4f53d4,function(_0x2000d5){return db[_0x9e82('0x79')][_0x9e82('0x7a')]({'TeamId':_0x2000d5['id'],'VoiceQueueId':_0x5584ac['params']['id'],'penalty':_0x2000d5[_0x9e82('0x75')]},{'transaction':_0x6f4370});});})[_0x9e82('0x27')](function(){return BPromise['each'](_0x22c241,function(_0x39530f){return db[_0x9e82('0x7b')]['findOrCreate']({'where':{'UserId':_0x39530f['id'],'VoiceQueueId':_0x5584ac[_0x9e82('0x51')]['id']},'defaults':{'penalty':_0x39530f['penalty']},'transaction':_0x6f4370});});})[_0x9e82('0x27')](function(){return BPromise['each'](_[_0x9e82('0x4a')](_0x22c241,{'online':!![]}),function(_0x3efb51){return db[_0x9e82('0x7c')][_0x9e82('0x7a')]({'membername':_0x3efb51[_0x9e82('0x30')],'UserId':_0x3efb51['id'],'queue_name':_0x37d1bd['name'],'VoiceQueueId':_0x37d1bd['id'],'interface':_[_0x9e82('0x7d')](_0x3efb51['interface'])?util[_0x9e82('0x7e')](_0x9e82('0x7f'),_0x3efb51[_0x9e82('0x30')]):_0x3efb51[_0x9e82('0x72')],'paused':_0x3efb51[_0x9e82('0x80')]||![],'penalty':_0x3efb51[_0x9e82('0x75')]},{'transaction':_0x6f4370});});})['then'](function(){_0x22c241[_0x9e82('0x74')](function(_0x46a977){socket[_0x9e82('0x81')](_0x9e82('0x82'),{'UserId':_0x46a977['id'],'VoiceQueueId':_0x37d1bd['id']});});});});});}})[_0x9e82('0x27')](respondWithStatusCode(_0x149549,null))[_0x9e82('0x50')](handleError(_0x149549,null));};exports[_0x9e82('0x83')]=function(_0x3b75b4,_0x263715,_0x4e6e16){return db[_0x9e82('0x6c')][_0x9e82('0x4e')]({'where':{'id':_0x3b75b4[_0x9e82('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9e82('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x263715,null))['then'](function(_0xae75d6){var _0xfe6bd6=_[_0x9e82('0x2c')](_0xae75d6,'id');var _0x1321fc=[];var _0x2d1b6a=[];var _0x43cfcb=squel[_0x9e82('0x84')]();_0x43cfcb[_0x9e82('0x85')](_0x9e82('0x86'))['from'](_0x9e82('0x87'),'tq')[_0x9e82('0x88')](_0x9e82('0x89'),'ut',_0x9e82('0x8a'))['where']('VoiceQueueId\x20=\x20?',_0x3b75b4[_0x9e82('0x51')]['id']);for(var _0x3d04a0=0x0;_0x3d04a0<_0xae75d6[_0x9e82('0x41')];_0x3d04a0+=0x1){let _0x21ae02=_0xae75d6[_0x3d04a0];for(var _0x15ab98=0x0;_0x15ab98<_0x21ae02['Agents']['length'];_0x15ab98+=0x1){let _0x5f5a5b=_0x21ae02[_0x9e82('0x70')][_0x15ab98];var _0x1b5a41=_0x43cfcb[_0x9e82('0x8b')]();_0x1b5a41['where']('ut.UserId\x20=\x20?',_0x5f5a5b['id']);_0x2d1b6a[_0x9e82('0x8c')](db[_0x9e82('0x76')]['query'](_0x1b5a41[_0x9e82('0x8d')](),{'type':db[_0x9e82('0x76')][_0x9e82('0x8e')]['SELECT']})[_0x9e82('0x27')](function(_0x35bd76){if(_0x35bd76[_0x9e82('0x41')]===0x1){return _0x5f5a5b['id'];}else{var _0x307640=_['every'](_[_0x9e82('0x2c')](_0x35bd76,_0x9e82('0x8f')),function(_0x50c68e){return _[_0x9e82('0x90')](_0xfe6bd6,_0x50c68e);});if(_0x307640){return _0x5f5a5b['id'];}}}));}}return BPromise[_0x9e82('0x91')](_0x2d1b6a)[_0x9e82('0x27')](function(_0x344b44){_0x1321fc=_(_0x1321fc)[_0x9e82('0x92')](_0x344b44)[_0x9e82('0x93')]()[_0x9e82('0x2d')]();return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x3b75b4[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](function(_0x11effa){return db[_0x9e82('0x76')][_0x9e82('0x77')](function(_0x3541e7){return _0x11effa['removeTeams'](_0x3b75b4[_0x9e82('0x3c')][_0x9e82('0x94')],{'transaction':_0x3541e7})[_0x9e82('0x27')](function(){if(!_[_0x9e82('0x95')](_0x1321fc)){return _0x11effa[_0x9e82('0x96')](_0x1321fc,{'transaction':_0x3541e7})[_0x9e82('0x27')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3b75b4[_0x9e82('0x51')]['id'],'UserId':_0x1321fc},'transaction':_0x3541e7});});}})[_0x9e82('0x27')](function(){_0x1321fc['forEach'](function(_0x513add){socket[_0x9e82('0x81')](_0x9e82('0x97'),{'UserId':_0x513add,'VoiceQueueId':_0x11effa['id']});});});});});});})[_0x9e82('0x27')](respondWithStatusCode(_0x263715,null))[_0x9e82('0x50')](handleError(_0x263715,null));};exports[_0x9e82('0x98')]=function(_0x4f1bb5,_0x5ce293,_0x53bc7a){var _0x123ead,_0x543eed;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x4f1bb5['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x5ce293,null))[_0x9e82('0x27')](function(_0x1bad06){if(_0x1bad06){_0x543eed=_0x1bad06;return _0x1bad06[_0x9e82('0x98')](_0x4f1bb5['body']['ids'],_[_0x9e82('0x5a')](_0x4f1bb5[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{})[_0x9e82('0x99')](function(_0x952192){for(var _0x417d36=0x0;_0x417d36<_0x4f1bb5['body'][_0x9e82('0x94')][_0x9e82('0x41')];_0x417d36+=0x1){socket[_0x9e82('0x81')](_0x9e82('0x82'),{'UserId':Number(_0x4f1bb5[_0x9e82('0x53')][_0x9e82('0x94')][_0x417d36]),'VoiceQueueId':Number(_0x4f1bb5[_0x9e82('0x51')]['id'])});}return _0x952192;});}})[_0x9e82('0x27')](function(_0x1101d0){_0x123ead=_0x1101d0||[];if(_0x543eed){return db['User'][_0x9e82('0x4e')]({'where':{'id':_0x4f1bb5[_0x9e82('0x53')]['ids']},'attributes':['id','name',_0x9e82('0x71'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x561192){if(!_['isEmpty'](_0x561192)){var _0x3895fe=[];for(var _0x4b4091=0x0;_0x4b4091<_0x561192[_0x9e82('0x41')];_0x4b4091++){if(_0x561192[_0x4b4091]['online']){_0x3895fe[_0x9e82('0x8c')](db[_0x9e82('0x7c')]['upsert']({'membername':_0x561192[_0x4b4091][_0x9e82('0x30')],'UserId':_0x561192[_0x4b4091]['id'],'queue_name':_0x543eed[_0x9e82('0x30')],'VoiceQueueId':_0x543eed['id'],'interface':_['isNil'](_0x561192[_0x4b4091][_0x9e82('0x72')])?util[_0x9e82('0x7e')](_0x9e82('0x7f'),_0x561192[_0x4b4091]['name']):_0x561192[_0x4b4091]['interface'],'paused':_0x561192[_0x4b4091]['voicePause']||![],'penalty':_0x4f1bb5[_0x9e82('0x53')][_0x9e82('0x75')]||0x0}));}}return BPromise[_0x9e82('0x91')](_0x3895fe);}})['then'](function(){return _0x123ead;})[_0x9e82('0x27')](respondWithResult(_0x5ce293,null))['catch'](handleError(_0x5ce293,null));};exports[_0x9e82('0x96')]=function(_0x44e9d1,_0x198720,_0x3426e1){return db[_0x9e82('0x37')]['find']({'where':{'id':_0x44e9d1[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x198720,null))[_0x9e82('0x27')](function(_0x25a340){if(_0x25a340){return _0x25a340[_0x9e82('0x96')](_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')])['then'](function(){if(_[_0x9e82('0x9a')](_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')])){for(var _0x303206=0x0;_0x303206<_0x44e9d1[_0x9e82('0x3c')]['ids']['length'];_0x303206+=0x1){socket['emit'](_0x9e82('0x97'),{'UserId':Number(_0x44e9d1['query'][_0x9e82('0x94')][_0x303206]),'VoiceQueueId':Number(_0x44e9d1[_0x9e82('0x51')]['id'])});}}else{socket[_0x9e82('0x81')](_0x9e82('0x97'),{'UserId':Number(_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')]),'VoiceQueueId':Number(_0x44e9d1[_0x9e82('0x51')]['id'])});}});}})['then'](function(_0x1d0e06){return db[_0x9e82('0x7c')][_0x9e82('0x5f')]({'where':{'VoiceQueueId':_0x44e9d1[_0x9e82('0x51')]['id'],'UserId':_0x44e9d1['query'][_0x9e82('0x94')]}})[_0x9e82('0x27')](function(){return _0x1d0e06;});})['then'](respondWithStatusCode(_0x198720,null))[_0x9e82('0x50')](handleError(_0x198720,null));};exports[_0x9e82('0x9b')]=function(_0x98cc80,_0x2a9af7,_0x219675){var _0x4f9148={};var _0x43ca72={};var _0x2afc87;var _0x51024a;return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x98cc80[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x2a9af7,null))[_0x9e82('0x27')](function(_0x318b0e){if(_0x318b0e){_0x2afc87=_0x318b0e;_0x43ca72[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db['User']['rawAttributes']);_0x43ca72[_0x9e82('0x3c')]=_['keys'](_0x98cc80[_0x9e82('0x3c')]);_0x43ca72['filters']=_[_0x9e82('0x3f')](_0x43ca72[_0x9e82('0x3b')],_0x43ca72[_0x9e82('0x3c')]);_0x4f9148[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x43ca72[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x98cc80['query'][_0x9e82('0x40')]));_0x4f9148[_0x9e82('0x3e')]=_0x4f9148[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x4f9148['attributes']:_0x43ca72['model'];_0x4f9148['order']=qs['sort'](_0x98cc80['query'][_0x9e82('0x44')]);_0x4f9148[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x98cc80['query'],_0x43ca72[_0x9e82('0x46')]));if(_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x4f9148[_0x9e82('0x45')]=_['merge'](_0x4f9148[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x4f9148['attributes'],function(_0x44606d){var _0x4b4b0a={};_0x4b4b0a[_0x44606d]={'$like':'%'+_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x4b4b0a;})});}_0x4f9148=_[_0x9e82('0x48')]({},_0x4f9148,_0x98cc80[_0x9e82('0x4b')]);return _0x2afc87[_0x9e82('0x9b')](_0x4f9148);}})[_0x9e82('0x27')](function(_0x59927f){if(_0x59927f){_0x51024a=_0x59927f['length'];if(!_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x4f9148[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x98cc80[_0x9e82('0x3c')]['limit']);_0x4f9148[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x98cc80['query'][_0x9e82('0x1f')]);}return _0x2afc87['getAgents'](_0x4f9148);}})['then'](function(_0x417e85){if(_0x417e85){return _0x417e85?{'count':_0x51024a,'rows':_0x417e85}:null;}})[_0x9e82('0x27')](respondWithResult(_0x2a9af7,null))[_0x9e82('0x50')](handleError(_0x2a9af7,null));};exports[_0x9e82('0x9c')]=function(_0x4894d5,_0x46f73,_0x437ece){var _0x3569dd={};var _0x1227ac={};var _0x45677d;var _0x5f53e6;return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x4894d5[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x46f73,null))[_0x9e82('0x27')](function(_0x3c95df){if(_0x3c95df){_0x45677d=_0x3c95df;_0x1227ac[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x7c')]['rawAttributes']);_0x1227ac[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x4894d5[_0x9e82('0x3c')]);_0x1227ac[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x1227ac[_0x9e82('0x3b')],_0x1227ac[_0x9e82('0x3c')]);_0x3569dd['attributes']=_['intersection'](_0x1227ac[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3569dd['attributes']=_0x3569dd[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3569dd[_0x9e82('0x3e')]:_0x1227ac[_0x9e82('0x3b')];_0x3569dd['order']=qs['sort'](_0x4894d5['query'][_0x9e82('0x44')]);_0x3569dd[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_['pick'](_0x4894d5[_0x9e82('0x3c')],_0x1227ac[_0x9e82('0x46')]));if(_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x3569dd['where']=_['merge'](_0x3569dd[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x3569dd[_0x9e82('0x3e')],function(_0x1fa727){var _0x281f41={};_0x281f41[_0x1fa727]={'$like':'%'+_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x281f41;})});}_0x3569dd=_[_0x9e82('0x48')]({},_0x3569dd,_0x4894d5[_0x9e82('0x4b')]);return _0x45677d[_0x9e82('0x9c')](_0x3569dd);}})[_0x9e82('0x27')](function(_0x6a0ae3){if(_0x6a0ae3){_0x5f53e6=_0x6a0ae3[_0x9e82('0x41')];if(!_0x4894d5['query'][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3569dd[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x4894d5['query'][_0x9e82('0x21')]);_0x3569dd['offset']=qs[_0x9e82('0x1f')](_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x45677d['getMembers'](_0x3569dd);}})[_0x9e82('0x27')](function(_0x5cdf5c){return _0x5cdf5c?{'count':_0x5f53e6,'rows':_0x5cdf5c}:null;})[_0x9e82('0x27')](respondWithResult(_0x46f73,null))[_0x9e82('0x50')](handleError(_0x46f73,null));};exports['getLists']=function(_0x2456ea,_0x181b08,_0x15be46){var _0x1a548b={};var _0x4ebf04={};var _0x5dde8b;var _0xd08a16;return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x2456ea[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x181b08,null))[_0x9e82('0x27')](function(_0x329d31){if(_0x329d31){_0x5dde8b=_0x329d31;_0x4ebf04[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x9d')]['rawAttributes']);_0x4ebf04[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x2456ea[_0x9e82('0x3c')]);_0x4ebf04[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x4ebf04[_0x9e82('0x3b')],_0x4ebf04['query']);_0x1a548b[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x4ebf04[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x2456ea['query']['fields']));_0x1a548b[_0x9e82('0x3e')]=_0x1a548b[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x1a548b['attributes']:_0x4ebf04[_0x9e82('0x3b')];_0x1a548b[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x1a548b[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x2456ea[_0x9e82('0x3c')],_0x4ebf04[_0x9e82('0x46')]));if(_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x1a548b[_0x9e82('0x45')]=_[_0x9e82('0x48')](_0x1a548b[_0x9e82('0x45')],{'$or':_['map'](_0x1a548b[_0x9e82('0x3e')],function(_0x6d0e4c){var _0x2ea9bb={};_0x2ea9bb[_0x6d0e4c]={'$like':'%'+_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x2ea9bb;})});}_0x1a548b=_[_0x9e82('0x48')]({},_0x1a548b,_0x2456ea[_0x9e82('0x4b')]);return _0x5dde8b[_0x9e82('0x9e')](_0x1a548b);}})[_0x9e82('0x27')](function(_0x26fc27){if(_0x26fc27){_0xd08a16=_0x26fc27['length'];if(!_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x66')]('nolimit')){_0x1a548b[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x2456ea[_0x9e82('0x3c')]['limit']);_0x1a548b[_0x9e82('0x1f')]=qs['offset'](_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x5dde8b['getLists'](_0x1a548b);}})[_0x9e82('0x27')](function(_0xe4c5f){if(_0xe4c5f){return _0xe4c5f?{'count':_0xd08a16,'rows':_0xe4c5f}:null;}})[_0x9e82('0x27')](respondWithResult(_0x181b08,null))[_0x9e82('0x50')](handleError(_0x181b08,null));};exports[_0x9e82('0x9f')]=function(_0x29072d,_0xcddd8e,_0x148b50){var _0x5b9644=moment()[_0x9e82('0x7e')](_0x9e82('0xa0'));var _0x36de69,_0x9be4be;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x29072d['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0xcddd8e,null))[_0x9e82('0x27')](function(_0x3f6e47){if(_0x3f6e47){_0x9be4be=_0x3f6e47;return _0x3f6e47['addLists'](_0x29072d['body'][_0x9e82('0x94')],_[_0x9e82('0x5a')](_0x29072d[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{});}return null;})[_0x9e82('0x99')](function(_0x3910c1){var _0x33a523;_0x36de69=_0x3910c1||[];var _0x18a1b1=[];if(_0x3910c1){for(var _0x2df87e=0x0;_0x2df87e<_0x3910c1['length'];_0x2df87e+=0x1){var _0x3d89f6=_0x3910c1[_0x2df87e][_0x9e82('0x55')]({'plain':!![]});_0x9be4be['dialCheckDuplicateType']=_0x29072d[_0x9e82('0x53')][_0x9e82('0xa1')]?_0x29072d[_0x9e82('0x53')][_0x9e82('0xa1')]:_0x9be4be[_0x9e82('0xa1')];switch(_0x9be4be[_0x9e82('0xa1')]){case _0x9e82('0xa2'):_0x33a523=squel['insert']()['into']('cm_hopper')[_0x9e82('0xa3')](['phone',_0x9e82('0xa4'),_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xa7'),_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))[_0x9e82('0x85')]('id',_0x9e82('0xa5'))['field'](_0x3d89f6[_0x9e82('0xa8')]['toString'](),'ListId')['field'](_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),_0x9e82('0x62'))['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x9e82('0xab'),_0x3d89f6[_0x9e82('0xa8')][_0x9e82('0x8d')]())[_0x9e82('0x45')](_0x9e82('0xac'))[_0x9e82('0x45')](_0x9e82('0xad'),squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xae'))['from'](_0x9e82('0xaf'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d['params']['id']['toString']()))[_0x9e82('0x45')](_0x9e82('0xad'),squel['select']()[_0x9e82('0x85')](_0x9e82('0xb1'))['from'](_0x9e82('0xb2'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')]())))[_0x9e82('0x8d')]();break;case'onlyIfOpen':_0x33a523=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')]('cm_hopper')[_0x9e82('0xa3')]([_0x9e82('0xa7'),_0x9e82('0xa4'),_0x9e82('0xa5'),'ListId',_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')]('phone',_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))['field']('id',_0x9e82('0xa5'))['field'](_0x3d89f6['CmListId'][_0x9e82('0x8d')](),'ListId')[_0x9e82('0x85')](_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),'VoiceQueueId')['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27','updatedAt')[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))['where'](_0x9e82('0xab'),_0x3d89f6[_0x9e82('0xa8')]['toString']())[_0x9e82('0x45')](_0x9e82('0xac'))[_0x9e82('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9e82('0x84')]()['field']('COALESCE(phone,\x27\x27)')[_0x9e82('0xa9')](_0x9e82('0xb2'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')]())))[_0x9e82('0x8d')]();break;default:_0x33a523=squel[_0x9e82('0xb3')]()['into'](_0x9e82('0xb2'))[_0x9e82('0xa3')]([_0x9e82('0xa7'),_0x9e82('0xa4'),_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xa7'),_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))[_0x9e82('0x85')]('id','ContactId')[_0x9e82('0x85')](_0x3d89f6[_0x9e82('0xa8')][_0x9e82('0x8d')](),_0x9e82('0xa6'))['field'](_0x29072d['params']['id'][_0x9e82('0x8d')](),_0x9e82('0x62'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))[_0x9e82('0x45')](_0x9e82('0xab'),_0x3d89f6['CmListId']['toString']())[_0x9e82('0x45')](_0x9e82('0xac')))[_0x9e82('0x8d')]();}_0x18a1b1['push'](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x33a523));}return BPromise[_0x9e82('0x91')](_0x18a1b1);}})['then'](function(){var _0x3bac7a=[];var _0x33927e=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')](_0x9e82('0xb6'))['fromQuery'](['CmHopperId',_0x9e82('0xa7'),_0x9e82('0xb7'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()['field'](_0x9e82('0xb8'))[_0x9e82('0x85')](_0x9e82('0xb9'))['field'](_0x9e82('0xba'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')]('cm_contact_has_items','ci')[_0x9e82('0x88')](_0x9e82('0xb2'),'h','h.ContactId=ci.CmContactId')['where'](_0x9e82('0xbb'),_0x5b9644)[_0x9e82('0x45')](_0x9e82('0xbc'),_0x9e82('0xbd')))[_0x9e82('0x8d')]();_0x3bac7a[_0x9e82('0x8c')](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x33927e));return BPromise['all'](_0x3bac7a);})[_0x9e82('0x27')](function(){return _0x36de69;})['then'](respondWithResult(_0xcddd8e,null))[_0x9e82('0x50')](handleError(_0xcddd8e,null));};exports[_0x9e82('0xbe')]=function(_0x44c877,_0x4f10d0,_0x1cf157){return db['VoiceQueue'][_0x9e82('0x2e')]({'where':{'id':_0x44c877[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x4f10d0,null))['then'](function(_0x5a374f){if(_0x5a374f){return _0x5a374f[_0x9e82('0xbe')](_0x44c877[_0x9e82('0x3c')][_0x9e82('0x94')]);}})['then'](function(_0x4339de){if(_0x4339de){return db['CmHopper'][_0x9e82('0x5f')]({'where':{'ListId':_0x44c877[_0x9e82('0x3c')][_0x9e82('0x94')],'VoiceQueueId':_0x44c877['params']['id']}})[_0x9e82('0x27')](function(){return _0x4339de;});}})[_0x9e82('0x27')](respondWithStatusCode(_0x4f10d0,null))['catch'](handleError(_0x4f10d0,null));};exports['getBlackLists']=function(_0x141c6a,_0x279efa,_0x1d9d3d){var _0x3a37f1={};var _0x22c64d={};var _0x35f6b9;var _0x2eb3d5;return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x141c6a[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x279efa,null))[_0x9e82('0x27')](function(_0x5b8419){if(_0x5b8419){_0x35f6b9=_0x5b8419;_0x22c64d[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x9d')][_0x9e82('0x38')]);_0x22c64d[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x141c6a[_0x9e82('0x3c')]);_0x22c64d[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x22c64d[_0x9e82('0x3b')],_0x22c64d[_0x9e82('0x3c')]);_0x3a37f1[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x22c64d[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3a37f1[_0x9e82('0x3e')]=_0x3a37f1[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3a37f1[_0x9e82('0x3e')]:_0x22c64d['model'];_0x3a37f1[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x141c6a['query'][_0x9e82('0x44')]);_0x3a37f1[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x141c6a[_0x9e82('0x3c')],_0x22c64d[_0x9e82('0x46')]));if(_0x141c6a[_0x9e82('0x3c')]['filter']){_0x3a37f1['where']=_[_0x9e82('0x48')](_0x3a37f1['where'],{'$or':_[_0x9e82('0x2c')](_0x3a37f1[_0x9e82('0x3e')],function(_0x19db1b){var _0x552234={};_0x552234[_0x19db1b]={'$like':'%'+_0x141c6a[_0x9e82('0x3c')]['filter']+'%'};return _0x552234;})});}_0x3a37f1=_[_0x9e82('0x48')]({},_0x3a37f1,_0x141c6a['options']);return _0x35f6b9[_0x9e82('0xbf')](_0x3a37f1);}})[_0x9e82('0x27')](function(_0x9d0f7){if(_0x9d0f7){_0x2eb3d5=_0x9d0f7['length'];if(!_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3a37f1[_0x9e82('0x21')]=qs['limit'](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x3a37f1['offset']=qs[_0x9e82('0x1f')](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x35f6b9[_0x9e82('0xbf')](_0x3a37f1);}})[_0x9e82('0x27')](function(_0x2a3214){if(_0x2a3214){return _0x2a3214?{'count':_0x2eb3d5,'rows':_0x2a3214}:null;}})['then'](respondWithResult(_0x279efa,null))[_0x9e82('0x50')](handleError(_0x279efa,null));};exports[_0x9e82('0xc0')]=function(_0x207ae5,_0x52ba10,_0x163827){var _0x4b9505,_0x4454a0;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x207ae5[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x52ba10,null))['then'](function(_0x96780a){if(_0x96780a){_0x4454a0=_0x96780a;return _0x96780a[_0x9e82('0xc0')](_0x207ae5['body'][_0x9e82('0x94')],_[_0x9e82('0x5a')](_0x207ae5[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{});}return null;})[_0x9e82('0x99')](function(_0x321339){var _0x3fbd69;_0x4b9505=_0x321339||[];var _0x9de57=[];if(_0x321339){for(var _0x389583=0x0;_0x389583<_0x321339[_0x9e82('0x41')];_0x389583+=0x1){var _0x51e288=_0x321339[_0x389583]['get']({'plain':!![]});_0x3fbd69=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')](_0x9e82('0xc1'))[_0x9e82('0xa3')](['phone',_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')]('phone',_0x9e82('0xa7'))[_0x9e82('0x85')]('id',_0x9e82('0xa5'))[_0x9e82('0x85')](_0x51e288[_0x9e82('0xa8')][_0x9e82('0x8d')](),_0x9e82('0xa6'))[_0x9e82('0x85')](_0x207ae5[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),'VoiceQueueId')[_0x9e82('0x85')]('NOW()','createdAt')[_0x9e82('0x85')]('NOW()',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))['where']('ListId\x20=\x20?',_0x51e288[_0x9e82('0xa8')][_0x9e82('0x8d')]())['where'](_0x9e82('0xac')))['toString']();_0x9de57[_0x9e82('0x8c')](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x3fbd69));}return BPromise[_0x9e82('0x91')](_0x9de57);}})['then'](function(){return _0x4b9505;})[_0x9e82('0x27')](respondWithResult(_0x52ba10,null))['catch'](handleError(_0x52ba10,null));};exports[_0x9e82('0xc2')]=function(_0x5eb8d9,_0x441ba2,_0x5896bf){return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x5eb8d9[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x441ba2,null))[_0x9e82('0x27')](function(_0x532f18){if(_0x532f18){return _0x532f18[_0x9e82('0xc2')](_0x5eb8d9[_0x9e82('0x3c')][_0x9e82('0x94')]);}})['then'](function(_0x3d1407){if(_0x3d1407){return db[_0x9e82('0x6a')][_0x9e82('0x5f')]({'where':{'ListId':_0x5eb8d9[_0x9e82('0x3c')]['ids'],'VoiceQueueId':_0x5eb8d9['params']['id']}})[_0x9e82('0x27')](function(){return _0x3d1407;});}})[_0x9e82('0x27')](respondWithStatusCode(_0x441ba2,null))[_0x9e82('0x50')](handleError(_0x441ba2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 07ecabf..d1f6b38 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 _0x9bcf=['VoiceQueue','emit','exports','events','../../mysqldb'];(function(_0x4c0b67,_0x5f38b0){var _0x130d72=function(_0x13e601){while(--_0x13e601){_0x4c0b67['push'](_0x4c0b67['shift']());}};_0x130d72(++_0x5f38b0);}(_0x9bcf,0xfd));var _0xf9bc=function(_0x4858ed,_0x5b293f){_0x4858ed=_0x4858ed-0x0;var _0x30b87e=_0x9bcf[_0x4858ed];return _0x30b87e;};'use strict';var EventEmitter=require(_0xf9bc('0x0'));var VoiceQueue=require(_0xf9bc('0x1'))['db'][_0xf9bc('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x282e05){return function(_0x290647,_0x52a7b1,_0x3e8534){VoiceQueueEvents[_0xf9bc('0x3')](_0x282e05+':'+_0x290647['id'],_0x290647);VoiceQueueEvents['emit'](_0x282e05,_0x290647);_0x3e8534(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf9bc('0x4')]=VoiceQueueEvents; \ No newline at end of file +var _0xdeb2=['VoiceQueue','setMaxListeners','save','emit','hasOwnProperty','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdeb2,0x14f));var _0x2deb=function(_0x2db45e,_0x3c3b37){_0x2db45e=_0x2db45e-0x0;var _0x200a5=_0xdeb2[_0x2db45e];return _0x200a5;};'use strict';var EventEmitter=require(_0x2deb('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x2deb('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2deb('0x2')](0x0);var events={'afterCreate':_0x2deb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e0372){return function(_0x3b225a,_0x5b555b,_0x92027){VoiceQueueEvents['emit'](_0x4e0372+':'+_0x3b225a['id'],_0x3b225a);VoiceQueueEvents[_0x2deb('0x4')](_0x4e0372,_0x3b225a);_0x92027(null);};}for(var e in events){if(events[_0x2deb('0x5')](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 a792cbf..e538e43 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x42fc51,_0x1033a2){var _0x1513b4=function(_0x52b4d3){while(--_0x52b4d3){_0x42fc51['push'](_0x42fc51['shift']());}};_0x1513b4(++_0x1033a2);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0x3e74,0x175));var _0x43e7=function(_0x43a251,_0x30e9db){_0x43a251=_0x43a251-0x0;var _0x2f8ddf=_0x3e74[_0x43a251];return _0x2f8ddf;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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 63893a6..faa4c55 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 _0xb136=['map','model','attributes','stringify','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0xb136,0x78));var _0x6b13=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xb136[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x6b13('0x0'));var util=require('util');var moment=require(_0x6b13('0x1'));var BPromise=require(_0x6b13('0x2'));var rs=require(_0x6b13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b13('0x4'))['db'];var utils=require(_0x6b13('0x5'));var logger=require(_0x6b13('0x6'))('rpc');var config=require(_0x6b13('0x7'));var jayson=require(_0x6b13('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6b13('0x9')]=_[_0x6b13('0xa')](config[_0x6b13('0x9')],{'host':_0x6b13('0xb'),'port':0x18eb});var socket=require(_0x6b13('0xc'))(new Redis(config[_0x6b13('0x9')]));require(_0x6b13('0xd'))[_0x6b13('0xe')](socket);function respondWithRpcPromise(_0x29a75c,_0x834484,_0x4d3f03){return new BPromise(function(_0x2ba717,_0x2943e4){return client[_0x6b13('0xf')](_0x29a75c,_0x4d3f03)[_0x6b13('0x10')](function(_0x4a4bc3){logger[_0x6b13('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x834484,_0x6b13('0x12'));logger[_0x6b13('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x834484,_0x6b13('0x12'),JSON['stringify'](_0x4a4bc3));if(_0x4a4bc3[_0x6b13('0x14')]){if(_0x4a4bc3[_0x6b13('0x14')][_0x6b13('0x15')]===0x1f4){logger[_0x6b13('0x14')](_0x6b13('0x16'),_0x834484,_0x4a4bc3[_0x6b13('0x14')][_0x6b13('0x17')]);return _0x2943e4(_0x4a4bc3[_0x6b13('0x14')][_0x6b13('0x17')]);}logger[_0x6b13('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x834484,_0x4a4bc3['error'][_0x6b13('0x17')]);return _0x2ba717(_0x4a4bc3[_0x6b13('0x14')][_0x6b13('0x17')]);}else{logger[_0x6b13('0x11')](_0x6b13('0x16'),_0x834484,'request\x20sent');_0x2ba717(_0x4a4bc3['result'][_0x6b13('0x17')]);}})[_0x6b13('0x18')](function(_0x562012){logger[_0x6b13('0x14')](_0x6b13('0x16'),_0x834484,_0x562012);_0x2943e4(_0x562012);});});}exports[_0x6b13('0x19')]=function(_0x191dd3){var _0x5c6cff=this;return new Promise(function(_0x62d7bb,_0x50cbe5){return db[_0x6b13('0x1a')][_0x6b13('0x1b')]({'raw':_0x191dd3[_0x6b13('0x1c')]?_0x191dd3['options'][_0x6b13('0x1d')]===undefined?!![]:![]:!![],'where':_0x191dd3['options']?_0x191dd3[_0x6b13('0x1c')][_0x6b13('0x1e')]||null:null,'attributes':_0x191dd3[_0x6b13('0x1c')]?_0x191dd3[_0x6b13('0x1c')]['attributes']||null:null,'limit':_0x191dd3[_0x6b13('0x1c')]?_0x191dd3[_0x6b13('0x1c')]['limit']||null:null,'include':_0x191dd3[_0x6b13('0x1c')]?_0x191dd3[_0x6b13('0x1c')][_0x6b13('0x1f')]?_[_0x6b13('0x20')](_0x191dd3['options'][_0x6b13('0x1f')],function(_0x155b76){return{'model':db[_0x155b76[_0x6b13('0x21')]],'as':_0x155b76['as'],'attributes':_0x155b76[_0x6b13('0x22')],'include':_0x155b76[_0x6b13('0x1f')]?_['map'](_0x155b76[_0x6b13('0x1f')],function(_0x638968){return{'model':db[_0x638968['model']],'as':_0x638968['as'],'attributes':_0x638968['attributes'],'include':_0x638968[_0x6b13('0x1f')]?_[_0x6b13('0x20')](_0x638968[_0x6b13('0x1f')],function(_0x5d8f63){return{'model':db[_0x5d8f63[_0x6b13('0x21')]],'as':_0x5d8f63['as'],'attributes':_0x5d8f63[_0x6b13('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b13('0x10')](function(_0x1d53d7){logger['info'](_0x6b13('0x19'),_0x191dd3);logger[_0x6b13('0x13')](_0x6b13('0x19'),_0x191dd3,JSON[_0x6b13('0x23')](_0x1d53d7));_0x62d7bb(_0x1d53d7);})[_0x6b13('0x18')](function(_0x285ee){logger[_0x6b13('0x14')](_0x6b13('0x19'),_0x285ee[_0x6b13('0x17')],_0x191dd3);_0x50cbe5(_0x5c6cff[_0x6b13('0x14')](0x1f4,_0x285ee[_0x6b13('0x17')]));});});};exports[_0x6b13('0x24')]=function(_0x5c039d){var _0xaf686=this;return new Promise(function(_0x178dfc,_0x48b54f){return db[_0x6b13('0x1a')][_0x6b13('0x25')]({'raw':_0x5c039d[_0x6b13('0x1c')]?_0x5c039d[_0x6b13('0x1c')][_0x6b13('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c039d[_0x6b13('0x1c')]?_0x5c039d['options']['where']||null:null,'attributes':_0x5c039d['options']?_0x5c039d[_0x6b13('0x1c')][_0x6b13('0x22')]||null:null,'include':_0x5c039d[_0x6b13('0x1c')]?_0x5c039d['options'][_0x6b13('0x1f')]?_[_0x6b13('0x20')](_0x5c039d[_0x6b13('0x1c')][_0x6b13('0x1f')],function(_0x47bed2){return{'model':db[_0x47bed2['model']],'as':_0x47bed2['as'],'attributes':_0x47bed2['attributes'],'include':_0x47bed2[_0x6b13('0x1f')]?_[_0x6b13('0x20')](_0x47bed2[_0x6b13('0x1f')],function(_0xdba042){return{'model':db[_0xdba042[_0x6b13('0x21')]],'as':_0xdba042['as'],'attributes':_0xdba042[_0x6b13('0x22')],'include':_0xdba042[_0x6b13('0x1f')]?_[_0x6b13('0x20')](_0xdba042[_0x6b13('0x1f')],function(_0xdbeebf){return{'model':db[_0xdbeebf[_0x6b13('0x21')]],'as':_0xdbeebf['as'],'attributes':_0xdbeebf[_0x6b13('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b13('0x10')](function(_0x24b87a){logger[_0x6b13('0x11')](_0x6b13('0x24'),_0x5c039d);logger[_0x6b13('0x13')](_0x6b13('0x24'),_0x5c039d,JSON[_0x6b13('0x23')](_0x24b87a));_0x178dfc(_0x24b87a);})[_0x6b13('0x18')](function(_0xaa5a35){logger[_0x6b13('0x14')](_0x6b13('0x24'),_0xaa5a35[_0x6b13('0x17')],_0x5c039d);_0x48b54f(_0xaf686[_0x6b13('0x14')](0x1f4,_0xaa5a35[_0x6b13('0x17')]));});});}; \ No newline at end of file +var _0xfb6b=['stringify','error','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','map','include','model','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x195547,_0x375530){var _0x181f56=function(_0x536ea5){while(--_0x536ea5){_0x195547['push'](_0x195547['shift']());}};_0x181f56(++_0x375530);}(_0xfb6b,0x1da));var _0xbfb6=function(_0x25399d,_0x436f0e){_0x25399d=_0x25399d-0x0;var _0x232046=_0xfb6b[_0x25399d];return _0x232046;};'use strict';var _=require(_0xbfb6('0x0'));var util=require('util');var moment=require(_0xbfb6('0x1'));var BPromise=require(_0xbfb6('0x2'));var rs=require(_0xbfb6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbfb6('0x4'));var logger=require(_0xbfb6('0x5'))(_0xbfb6('0x6'));var config=require(_0xbfb6('0x7'));var jayson=require(_0xbfb6('0x8'));var client=jayson[_0xbfb6('0x9')][_0xbfb6('0xa')]({'port':0x232a});config[_0xbfb6('0xb')]=_['defaults'](config[_0xbfb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfb6('0xc'))(new Redis(config[_0xbfb6('0xb')]));require('./voiceQueue.socket')[_0xbfb6('0xd')](socket);function respondWithRpcPromise(_0x262cbe,_0x45d5ce,_0x4ab0c6){return new BPromise(function(_0x3a6e17,_0x365a73){return client[_0xbfb6('0xe')](_0x262cbe,_0x4ab0c6)[_0xbfb6('0xf')](function(_0x4cab5d){logger['info'](_0xbfb6('0x10'),_0x45d5ce,_0xbfb6('0x11'));logger[_0xbfb6('0x12')](_0xbfb6('0x13'),_0x45d5ce,_0xbfb6('0x11'),JSON[_0xbfb6('0x14')](_0x4cab5d));if(_0x4cab5d['error']){if(_0x4cab5d[_0xbfb6('0x15')]['code']===0x1f4){logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);return _0x365a73(_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);}logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);return _0x3a6e17(_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);}else{logger[_0xbfb6('0x17')](_0xbfb6('0x10'),_0x45d5ce,'request\x20sent');_0x3a6e17(_0x4cab5d['result'][_0xbfb6('0x16')]);}})[_0xbfb6('0x18')](function(_0x176988){logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x176988);_0x365a73(_0x176988);});});}exports[_0xbfb6('0x19')]=function(_0x5a261d){var _0x25223c=this;return new Promise(function(_0x2a0b80,_0x3c7055){return db[_0xbfb6('0x1a')][_0xbfb6('0x1b')]({'raw':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a261d[_0xbfb6('0x1c')]?_0x5a261d['options']['where']||null:null,'attributes':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1e')]||null:null,'limit':_0x5a261d[_0xbfb6('0x1c')]?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1f')]||null:null,'include':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')]['include']?_[_0xbfb6('0x20')](_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x21')],function(_0x7057fb){return{'model':db[_0x7057fb[_0xbfb6('0x22')]],'as':_0x7057fb['as'],'attributes':_0x7057fb['attributes'],'include':_0x7057fb[_0xbfb6('0x21')]?_['map'](_0x7057fb[_0xbfb6('0x21')],function(_0x457521){return{'model':db[_0x457521['model']],'as':_0x457521['as'],'attributes':_0x457521[_0xbfb6('0x1e')],'include':_0x457521[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x457521[_0xbfb6('0x21')],function(_0xf8e29){return{'model':db[_0xf8e29[_0xbfb6('0x22')]],'as':_0xf8e29['as'],'attributes':_0xf8e29[_0xbfb6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6df5){logger[_0xbfb6('0x17')]('GetVoiceQueue',_0x5a261d);logger['debug'](_0xbfb6('0x19'),_0x5a261d,JSON[_0xbfb6('0x14')](_0x4f6df5));_0x2a0b80(_0x4f6df5);})[_0xbfb6('0x18')](function(_0xac1a3e){logger[_0xbfb6('0x15')](_0xbfb6('0x19'),_0xac1a3e[_0xbfb6('0x16')],_0x5a261d);_0x3c7055(_0x25223c[_0xbfb6('0x15')](0x1f4,_0xac1a3e['message']));});});};exports[_0xbfb6('0x23')]=function(_0x5d0571){var _0x22df31=this;return new Promise(function(_0x403834,_0x1b57c1){return db[_0xbfb6('0x1a')][_0xbfb6('0x24')]({'raw':_0x5d0571['options']?_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d0571['options']?_0x5d0571['options'][_0xbfb6('0x25')]||null:null,'attributes':_0x5d0571[_0xbfb6('0x1c')]?_0x5d0571['options'][_0xbfb6('0x1e')]||null:null,'include':_0x5d0571[_0xbfb6('0x1c')]?_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x21')]?_['map'](_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x21')],function(_0x3dd9e6){return{'model':db[_0x3dd9e6[_0xbfb6('0x22')]],'as':_0x3dd9e6['as'],'attributes':_0x3dd9e6['attributes'],'include':_0x3dd9e6[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x3dd9e6[_0xbfb6('0x21')],function(_0x1682a){return{'model':db[_0x1682a['model']],'as':_0x1682a['as'],'attributes':_0x1682a[_0xbfb6('0x1e')],'include':_0x1682a[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x1682a['include'],function(_0x204328){return{'model':db[_0x204328[_0xbfb6('0x22')]],'as':_0x204328['as'],'attributes':_0x204328[_0xbfb6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbfb6('0xf')](function(_0x3d11a3){logger[_0xbfb6('0x17')]('ShowVoiceQueue',_0x5d0571);logger[_0xbfb6('0x12')](_0xbfb6('0x23'),_0x5d0571,JSON[_0xbfb6('0x14')](_0x3d11a3));_0x403834(_0x3d11a3);})[_0xbfb6('0x18')](function(_0x294812){logger[_0xbfb6('0x15')]('ShowVoiceQueue',_0x294812['message'],_0x5d0571);_0x1b57c1(_0x22df31[_0xbfb6('0x15')](0x1f4,_0x294812['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2472c74..ed93b1a 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 _0x7415=['length','voiceQueue:','remove','update','emit','register'];(function(_0xbcc968,_0x538620){var _0x5a0926=function(_0x152fc3){while(--_0x152fc3){_0xbcc968['push'](_0xbcc968['shift']());}};_0x5a0926(++_0x538620);}(_0x7415,0xe0));var _0x5741=function(_0x1b28d2,_0x4e57ef){_0x1b28d2=_0x1b28d2-0x0;var _0x52e669=_0x7415[_0x1b28d2];return _0x52e669;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x5741('0x0'),_0x5741('0x1')];function createListener(_0x1811dc,_0x405217){return function(_0x330fc6){_0x405217[_0x5741('0x2')](_0x1811dc,_0x330fc6);};}function removeListener(_0x1f9ee6,_0x438cc1){return function(){VoiceQueueEvents['removeListener'](_0x1f9ee6,_0x438cc1);};}exports[_0x5741('0x3')]=function(_0x28ffb5){for(var _0x21cab6=0x0,_0x3f8da8=events[_0x5741('0x4')];_0x21cab6<_0x3f8da8;_0x21cab6++){var _0x24cbbf=events[_0x21cab6];var _0x1f6f0d=createListener(_0x5741('0x5')+_0x24cbbf,_0x28ffb5);VoiceQueueEvents['on'](_0x24cbbf,_0x1f6f0d);}}; \ No newline at end of file +var _0x1aab=['remove','update','emit','removeListener','length','voiceQueue:','save'];(function(_0x101933,_0x2ac242){var _0x25103b=function(_0x3a2cd5){while(--_0x3a2cd5){_0x101933['push'](_0x101933['shift']());}};_0x25103b(++_0x2ac242);}(_0x1aab,0x109));var _0xb1aa=function(_0x472ca8,_0x2c8c37){_0x472ca8=_0x472ca8-0x0;var _0x14c783=_0x1aab[_0x472ca8];return _0x14c783;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb1aa('0x0'),_0xb1aa('0x1'),_0xb1aa('0x2')];function createListener(_0x2ad353,_0x1c0708){return function(_0x433939){_0x1c0708[_0xb1aa('0x3')](_0x2ad353,_0x433939);};}function removeListener(_0x1a4d00,_0x1e1516){return function(){VoiceQueueEvents[_0xb1aa('0x4')](_0x1a4d00,_0x1e1516);};}exports['register']=function(_0xeeb088){for(var _0x435f19=0x0,_0x223172=events[_0xb1aa('0x5')];_0x435f19<_0x223172;_0x435f19++){var _0x33e318=events[_0x435f19];var _0x3b66e8=createListener(_0xb1aa('0x6')+_0x33e318,_0xeeb088);VoiceQueueEvents['on'](_0x33e318,_0x3b66e8);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9add017..ed1c3b9 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 _0xe978=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xdbfe3,_0x4ebddd){var _0x3454b0=function(_0x5a2487){while(--_0x5a2487){_0xdbfe3['push'](_0xdbfe3['shift']());}};_0x3454b0(++_0x4ebddd);}(_0xe978,0x15e));var _0x8e97=function(_0x4bf214,_0x55d9aa){_0x4bf214=_0x4bf214-0x0;var _0x18c314=_0xe978[_0x4bf214];return _0x18c314;};'use strict';var multer=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var path=require('path');var timeout=require(_0x8e97('0x2'));var express=require(_0x8e97('0x3'));var router=express['Router']();var fs_extra=require(_0x8e97('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e97('0x5'));var config=require(_0x8e97('0x6'));var controller=require(_0x8e97('0x7'));router[_0x8e97('0x8')]('/',auth[_0x8e97('0x9')](),controller[_0x8e97('0xa')]);router[_0x8e97('0x8')]('/describe',auth[_0x8e97('0x9')](),controller[_0x8e97('0xb')]);router[_0x8e97('0x8')](_0x8e97('0xc'),auth[_0x8e97('0x9')](),controller[_0x8e97('0xd')]);router['get'](_0x8e97('0xe'),auth[_0x8e97('0x9')](),controller[_0x8e97('0xf')]);router[_0x8e97('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e97('0x11')]);router[_0x8e97('0x12')](_0x8e97('0xe'),auth[_0x8e97('0x9')](),controller[_0x8e97('0x13')]);router['delete']('/:id',auth[_0x8e97('0x9')](),controller['destroy']);module[_0x8e97('0x14')]=router; \ No newline at end of file +var _0xe3b6=['create','put','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','/:id','show','post'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xe3b6,0x1e4));var _0x6e3b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe3b6[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0x6e3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e3b('0x1'));var express=require('express');var router=express[_0x6e3b('0x2')]();var fs_extra=require(_0x6e3b('0x3'));var auth=require(_0x6e3b('0x4'));var interaction=require(_0x6e3b('0x5'));var config=require(_0x6e3b('0x6'));var controller=require(_0x6e3b('0x7'));router[_0x6e3b('0x8')]('/',auth[_0x6e3b('0x9')](),controller['index']);router[_0x6e3b('0x8')](_0x6e3b('0xa'),auth['isAuthenticated'](),controller[_0x6e3b('0xb')]);router[_0x6e3b('0x8')]('/index',auth[_0x6e3b('0x9')](),controller[_0x6e3b('0xc')]);router['get'](_0x6e3b('0xd'),auth['isAuthenticated'](),controller[_0x6e3b('0xe')]);router[_0x6e3b('0xf')]('/',auth[_0x6e3b('0x9')](),controller[_0x6e3b('0x10')]);router[_0x6e3b('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6e3b('0x12')](_0x6e3b('0xd'),auth[_0x6e3b('0x9')](),controller[_0x6e3b('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 1ef97fb..4f2ac60 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 _0xcd6e=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xcd6e,0xfd));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xecd6('0x0'));var moment=require(_0xecd6('0x1'));module[_0xecd6('0x2')]={'type':{'type':Sequelize[_0xecd6('0x3')]},'uniqueid':{'type':Sequelize[_0xecd6('0x3')]},'calleridnum':{'type':Sequelize[_0xecd6('0x3')]},'calleridname':{'type':Sequelize[_0xecd6('0x3')]},'queue':{'type':Sequelize[_0xecd6('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xecd6('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xecd6('0x4')],'set':function(_0xef82d0){var _0x5b1e93=moment(_0xef82d0);var _0x25ba8d=moment(this[_0xecd6('0x5')](_0xecd6('0x6')))[_0xecd6('0x7')](_0xecd6('0x8'));var _0x48ca7a=_0x5b1e93[_0xecd6('0x9')](_0x25ba8d,_0xecd6('0xa'));this['setDataValue'](_0xecd6('0xb'),_0xef82d0);this[_0xecd6('0xc')](_0xecd6('0xd'),_0x48ca7a||null);}},'position':{'type':Sequelize[_0xecd6('0xe')]},'count':{'type':Sequelize[_0xecd6('0xe')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xecd6('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xecd6('0x4')]},'queuecallerexit':{'type':Sequelize[_0xecd6('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xecd6('0x10')},'originalposition':{'type':Sequelize[_0xecd6('0xe')]},'channel':{'type':Sequelize[_0xecd6('0x3')]},'connectedlinenum':{'type':Sequelize[_0xecd6('0x3')]},'connectedlinename':{'type':Sequelize[_0xecd6('0x3')]},'accountcode':{'type':Sequelize[_0xecd6('0x3')]},'context':{'type':Sequelize[_0xecd6('0x3')]},'exten':{'type':Sequelize[_0xecd6('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xecd6('0xe')]},'mohtime':{'type':Sequelize[_0xecd6('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xecd6('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xecd6('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xecd6('0x11')},'transferexten':{'type':Sequelize[_0xecd6('0x3')]},'transferuniqueid':{'type':Sequelize[_0xecd6('0x3')]},'disposition':{'type':Sequelize[_0xecd6('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xecd6('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xecd6('0xe')],'defaultValue':0x0},'note':{'type':Sequelize[_0xecd6('0x3')]}}; \ No newline at end of file +var _0xbd01=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x3d78cb,_0x829397){var _0x33cc9c=function(_0x193231){while(--_0x193231){_0x3d78cb['push'](_0x3d78cb['shift']());}};_0x33cc9c(++_0x829397);}(_0xbd01,0xf9));var _0x1bd0=function(_0x16d753,_0x197285){_0x16d753=_0x16d753-0x0;var _0x17a385=_0xbd01[_0x16d753];return _0x17a385;};'use strict';var Sequelize=require(_0x1bd0('0x0'));var moment=require(_0x1bd0('0x1'));module[_0x1bd0('0x2')]={'type':{'type':Sequelize[_0x1bd0('0x3')]},'uniqueid':{'type':Sequelize[_0x1bd0('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1bd0('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x1bd0('0x4')],'set':function(_0x4ff426){var _0xbdd9d6=moment(_0x4ff426);var _0x1207fe=moment(this[_0x1bd0('0x5')](_0x1bd0('0x6')))[_0x1bd0('0x7')](_0x1bd0('0x8'));var _0x130ed0=_0xbdd9d6['diff'](_0x1207fe,_0x1bd0('0x9'));this[_0x1bd0('0xa')](_0x1bd0('0xb'),_0x4ff426);this['setDataValue'](_0x1bd0('0xc'),_0x130ed0||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x1bd0('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x1bd0('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x1bd0('0xd')]},'channel':{'type':Sequelize[_0x1bd0('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x1bd0('0x3')]},'accountcode':{'type':Sequelize[_0x1bd0('0x3')]},'context':{'type':Sequelize[_0x1bd0('0x3')]},'exten':{'type':Sequelize[_0x1bd0('0x3')]},'priority':{'type':Sequelize[_0x1bd0('0x3')]},'holdtime':{'type':Sequelize[_0x1bd0('0xd')]},'mohtime':{'type':Sequelize[_0x1bd0('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1bd0('0x3')]},'transfer':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1bd0('0x3')],'comment':_0x1bd0('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1bd0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1bd0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1bd0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x1bd0('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x1bd0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e8b5866..b2c12b4 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 _0x59e9=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','index','map','VoiceQueueReport','fieldName','type','model','name','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','length','include','catch','create','body','describe','getVoiceQueuesReport','rawAttributes','eml-format','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x28118a,_0x2f8aee){var _0x116c91=function(_0x1dbc9d){while(--_0x1dbc9d){_0x28118a['push'](_0x28118a['shift']());}};_0x116c91(++_0x2f8aee);}(_0x59e9,0x130));var _0x959e=function(_0x39d213,_0x194536){_0x39d213=_0x39d213-0x0;var _0x45ec9b=_0x59e9[_0x39d213];return _0x45ec9b;};'use strict';var emlformat=require(_0x959e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x959e('0x1'));var moment=require('moment');var BPromise=require(_0x959e('0x2'));var Mustache=require(_0x959e('0x3'));var util=require(_0x959e('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x959e('0x5'));var ejs=require(_0x959e('0x6'));var fs=require('fs');var fs_extra=require(_0x959e('0x7'));var _=require(_0x959e('0x8'));var squel=require(_0x959e('0x9'));var crypto=require('crypto');var jsforce=require(_0x959e('0xa'));var deskjs=require(_0x959e('0xb'));var toCsv=require(_0x959e('0x5'));var querystring=require('querystring');var Papa=require(_0x959e('0xc'));var Redis=require(_0x959e('0xd'));var authService=require(_0x959e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x959e('0xf'));var hardwareService=require(_0x959e('0x10'));var logger=require('../../config/logger')(_0x959e('0x11'));var utils=require(_0x959e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x959e('0x13'));var db=require(_0x959e('0x14'))['db'];config[_0x959e('0x15')]=_[_0x959e('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x959e('0x17'))(new Redis(config[_0x959e('0x15')]));require(_0x959e('0x18'))[_0x959e('0x19')](socket);function respondWithStatusCode(_0x51f3c8,_0xab836f){_0xab836f=_0xab836f||0xcc;return function(_0x40494b){if(_0x40494b){return _0x51f3c8[_0x959e('0x1a')](_0xab836f);}return _0x51f3c8[_0x959e('0x1b')](_0xab836f)[_0x959e('0x1c')]();};}function respondWithResult(_0x2fc7f3,_0x5b04d0){_0x5b04d0=_0x5b04d0||0xc8;return function(_0x40f525){if(_0x40f525){return _0x2fc7f3['status'](_0x5b04d0)['json'](_0x40f525);}};}function respondWithFilteredResult(_0x5a03f8,_0x2405e8){return function(_0x3f0ab9){if(_0x3f0ab9){var _0x27b164=typeof _0x2405e8[_0x959e('0x1d')]===_0x959e('0x1e')&&typeof _0x2405e8[_0x959e('0x1f')]===_0x959e('0x1e');var _0x1e5d35=_0x3f0ab9[_0x959e('0x20')];var _0x4d9cfb=_0x27b164?0x0:_0x2405e8['offset'];var _0x1c65ca=_0x27b164?_0x3f0ab9['count']:_0x2405e8[_0x959e('0x1d')]+_0x2405e8['limit'];var _0x3fa95a;if(_0x1c65ca>=_0x1e5d35){_0x1c65ca=_0x1e5d35;_0x3fa95a=0xc8;}else{_0x3fa95a=0xce;}_0x5a03f8[_0x959e('0x1b')](_0x3fa95a);return _0x5a03f8[_0x959e('0x21')](_0x959e('0x22'),_0x4d9cfb+'-'+_0x1c65ca+'/'+_0x1e5d35)[_0x959e('0x23')](_0x3f0ab9);}return null;};}function patchUpdates(_0x41b6e5){return function(_0x5a7ecd){try{jsonpatch[_0x959e('0x24')](_0x5a7ecd,_0x41b6e5,!![]);}catch(_0x4e3730){return BPromise[_0x959e('0x25')](_0x4e3730);}return _0x5a7ecd[_0x959e('0x26')]();};}function saveUpdates(_0x53fa6d,_0x2fd7b8){return function(_0x3199a3){if(_0x3199a3){return _0x3199a3[_0x959e('0x27')](_0x53fa6d)['then'](function(_0x36260b){return _0x36260b;});}return null;};}function removeEntity(_0x507103,_0x3f7eaa){return function(_0x56c5e2){if(_0x56c5e2){return _0x56c5e2[_0x959e('0x28')]()[_0x959e('0x29')](function(){_0x507103[_0x959e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7b2e,_0x4ed1d2){return function(_0x5d0360){if(!_0x5d0360){_0x1b7b2e[_0x959e('0x1a')](0x194);}return _0x5d0360;};}function handleError(_0x53ecec,_0x52ff33){_0x52ff33=_0x52ff33||0x1f4;return function(_0x3c97bc){logger['error'](_0x3c97bc[_0x959e('0x2a')]);if(_0x3c97bc['name']){delete _0x3c97bc['name'];}_0x53ecec[_0x959e('0x1b')](_0x52ff33)['send'](_0x3c97bc);};}exports[_0x959e('0x2b')]=function(_0x144777,_0x4a8153){var _0x3bd3d4={},_0x914766={},_0x135dc5={'count':0x0,'rows':[]};var _0x57a5a7=_[_0x959e('0x2c')](db[_0x959e('0x2d')]['rawAttributes'],function(_0x4eeb4c){return{'name':_0x4eeb4c[_0x959e('0x2e')],'type':_0x4eeb4c[_0x959e('0x2f')]['key']};});_0x914766[_0x959e('0x30')]=_[_0x959e('0x2c')](_0x57a5a7,_0x959e('0x31'));_0x914766[_0x959e('0x32')]=_[_0x959e('0x33')](_0x144777[_0x959e('0x32')]);_0x914766['filters']=_[_0x959e('0x34')](_0x914766[_0x959e('0x30')],_0x914766['query']);_0x3bd3d4[_0x959e('0x35')]=_[_0x959e('0x34')](_0x914766[_0x959e('0x30')],qs['fields'](_0x144777[_0x959e('0x32')]['fields']));_0x3bd3d4[_0x959e('0x35')]=_0x3bd3d4['attributes']['length']?_0x3bd3d4[_0x959e('0x35')]:_0x914766['model'];if(!_0x144777[_0x959e('0x32')][_0x959e('0x36')](_0x959e('0x37'))){_0x3bd3d4[_0x959e('0x1f')]=qs[_0x959e('0x1f')](_0x144777[_0x959e('0x32')][_0x959e('0x1f')]);_0x3bd3d4[_0x959e('0x1d')]=qs[_0x959e('0x1d')](_0x144777[_0x959e('0x32')][_0x959e('0x1d')]);}_0x3bd3d4[_0x959e('0x38')]=qs[_0x959e('0x39')](_0x144777[_0x959e('0x32')][_0x959e('0x39')]);_0x3bd3d4[_0x959e('0x3a')]=qs[_0x959e('0x3b')](_['pick'](_0x144777[_0x959e('0x32')],_0x914766[_0x959e('0x3b')]),_0x57a5a7);if(_0x144777[_0x959e('0x32')][_0x959e('0x3c')]){_0x3bd3d4[_0x959e('0x3a')]=_[_0x959e('0x3d')](_0x3bd3d4[_0x959e('0x3a')],{'$or':_['map'](_0x57a5a7,function(_0x50a4d7){if(_0x50a4d7[_0x959e('0x2f')]!==_0x959e('0x3e')){var _0x14f033={};_0x14f033[_0x50a4d7[_0x959e('0x31')]]={'$like':'%'+_0x144777['query'][_0x959e('0x3c')]+'%'};return _0x14f033;}})});}_0x3bd3d4=_[_0x959e('0x3d')]({},_0x3bd3d4,_0x144777[_0x959e('0x3f')]);var _0x42a048={'where':_0x3bd3d4['where']};return db[_0x959e('0x2d')]['count'](_0x42a048)[_0x959e('0x29')](function(_0x12ed63){_0x135dc5[_0x959e('0x20')]=_0x12ed63;if(_0x144777['query'][_0x959e('0x40')]){_0x3bd3d4['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x959e('0x41')](_0x3bd3d4);})[_0x959e('0x29')](function(_0x624d77){_0x135dc5[_0x959e('0x42')]=_0x624d77;return _0x135dc5;})[_0x959e('0x29')](respondWithFilteredResult(_0x4a8153,_0x3bd3d4))['catch'](handleError(_0x4a8153,null));};exports[_0x959e('0x43')]=function(_0x14b609,_0x41ec3f){var _0x403126={'raw':![],'where':{'id':_0x14b609[_0x959e('0x44')]['id']}},_0x12fbec={};_0x12fbec[_0x959e('0x30')]=_[_0x959e('0x33')](db[_0x959e('0x2d')]['rawAttributes']);_0x12fbec[_0x959e('0x32')]=_[_0x959e('0x33')](_0x14b609[_0x959e('0x32')]);_0x12fbec[_0x959e('0x3b')]=_['intersection'](_0x12fbec[_0x959e('0x30')],_0x12fbec[_0x959e('0x32')]);_0x403126[_0x959e('0x35')]=_[_0x959e('0x34')](_0x12fbec[_0x959e('0x30')],qs[_0x959e('0x45')](_0x14b609['query'][_0x959e('0x45')]));_0x403126[_0x959e('0x35')]=_0x403126[_0x959e('0x35')][_0x959e('0x46')]?_0x403126[_0x959e('0x35')]:_0x12fbec[_0x959e('0x30')];if(_0x14b609[_0x959e('0x32')][_0x959e('0x40')]){_0x403126[_0x959e('0x47')]=[{'all':!![]}];}_0x403126=_[_0x959e('0x3d')]({},_0x403126,_0x14b609[_0x959e('0x3f')]);return db['VoiceQueueReport']['find'](_0x403126)[_0x959e('0x29')](handleEntityNotFound(_0x41ec3f,null))[_0x959e('0x29')](respondWithResult(_0x41ec3f,null))[_0x959e('0x48')](handleError(_0x41ec3f,null));};exports[_0x959e('0x49')]=function(_0x478d4d,_0x1d42ea){return db['VoiceQueueReport']['create'](_0x478d4d['body'],{})[_0x959e('0x29')](respondWithResult(_0x1d42ea,0xc9))[_0x959e('0x48')](handleError(_0x1d42ea,null));};exports[_0x959e('0x27')]=function(_0x3b9102,_0x5d5e69){if(_0x3b9102[_0x959e('0x4a')]['id']){delete _0x3b9102[_0x959e('0x4a')]['id'];}return db[_0x959e('0x2d')]['find']({'where':{'id':_0x3b9102[_0x959e('0x44')]['id']}})[_0x959e('0x29')](handleEntityNotFound(_0x5d5e69,null))[_0x959e('0x29')](saveUpdates(_0x3b9102[_0x959e('0x4a')],null))[_0x959e('0x29')](respondWithResult(_0x5d5e69,null))[_0x959e('0x48')](handleError(_0x5d5e69,null));};exports['destroy']=function(_0x3d7699,_0x4960f7){return db[_0x959e('0x2d')]['find']({'where':{'id':_0x3d7699[_0x959e('0x44')]['id']}})[_0x959e('0x29')](handleEntityNotFound(_0x4960f7,null))[_0x959e('0x29')](removeEntity(_0x4960f7,null))[_0x959e('0x48')](handleError(_0x4960f7,null));};exports[_0x959e('0x4b')]=function(_0xbe1edc,_0x58c459){return db[_0x959e('0x2d')]['describe']()['then'](respondWithResult(_0x58c459,null))['catch'](handleError(_0x58c459,null));};exports[_0x959e('0x4c')]=function(_0x3c5c6d,_0x1b0577){var _0x538abf={},_0x2e0479={},_0x3022f4={'count':0x0,'rows':[]};_0x2e0479[_0x959e('0x30')]=_[_0x959e('0x33')](db[_0x959e('0x2d')][_0x959e('0x4d')]);_0x2e0479[_0x959e('0x32')]=_['keys'](_0x3c5c6d[_0x959e('0x32')]);_0x2e0479[_0x959e('0x3b')]=_['intersection'](_0x2e0479[_0x959e('0x30')],_0x2e0479[_0x959e('0x32')]);_0x538abf[_0x959e('0x35')]=_[_0x959e('0x34')](_0x2e0479[_0x959e('0x30')],qs[_0x959e('0x45')](_0x3c5c6d[_0x959e('0x32')]['fields']));_0x538abf[_0x959e('0x35')]=_0x538abf[_0x959e('0x35')][_0x959e('0x46')]?_0x538abf[_0x959e('0x35')]:_0x2e0479['model'];if(!_0x3c5c6d['query'][_0x959e('0x36')](_0x959e('0x37'))){_0x538abf['limit']=qs[_0x959e('0x1f')](_0x3c5c6d['query'][_0x959e('0x1f')]);_0x538abf[_0x959e('0x1d')]=qs[_0x959e('0x1d')](_0x3c5c6d['query'][_0x959e('0x1d')]);}_0x538abf['order']=qs[_0x959e('0x39')](_0x3c5c6d[_0x959e('0x32')][_0x959e('0x39')]);_0x538abf[_0x959e('0x3a')]=qs[_0x959e('0x3b')](_['pick'](_0x3c5c6d['query'],_0x2e0479[_0x959e('0x3b')]));if(_0x3c5c6d[_0x959e('0x32')][_0x959e('0x3c')]){_0x538abf[_0x959e('0x3a')]=_[_0x959e('0x3d')](_0x538abf['where'],{'$or':_[_0x959e('0x2c')](_0x538abf[_0x959e('0x35')],function(_0x33ae7f){var _0x542ebb={};_0x542ebb[_0x33ae7f]={'$like':'%'+_0x3c5c6d[_0x959e('0x32')][_0x959e('0x3c')]+'%'};return _0x542ebb;})});}_0x538abf=_['merge']({},_0x538abf,_0x3c5c6d[_0x959e('0x3f')]);var _0x3b4591={'where':_0x538abf[_0x959e('0x3a')]};return db[_0x959e('0x2d')][_0x959e('0x20')](_0x3b4591)[_0x959e('0x29')](function(_0x243df6){_0x3022f4[_0x959e('0x20')]=_0x243df6;if(_0x3c5c6d[_0x959e('0x32')]['includeAll']){_0x538abf[_0x959e('0x47')]=[{'all':!![]}];}return db[_0x959e('0x2d')][_0x959e('0x41')](_0x538abf);})['then'](function(_0x43ce0b){_0x3022f4['rows']=_0x43ce0b;return _0x3022f4;})[_0x959e('0x29')](respondWithFilteredResult(_0x1b0577,_0x538abf,_0x959e('0x4c')))[_0x959e('0x48')](handleError(_0x1b0577,null,_0x959e('0x4c')));}; \ No newline at end of file +var _0xb96c=['stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','describe','getVoiceQueuesReport','pick','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','update','then','destroy','error'];(function(_0x55ad2a,_0x5ed7d9){var _0x5a90c8=function(_0x520326){while(--_0x520326){_0x55ad2a['push'](_0x55ad2a['shift']());}};_0x5a90c8(++_0x5ed7d9);}(_0xb96c,0x166));var _0xcb96=function(_0x1fa6a0,_0x26671e){_0x1fa6a0=_0x1fa6a0-0x0;var _0x2cafe6=_0xb96c[_0x1fa6a0];return _0x2cafe6;};'use strict';var emlformat=require(_0xcb96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb96('0x2'));var moment=require(_0xcb96('0x3'));var BPromise=require(_0xcb96('0x4'));var Mustache=require(_0xcb96('0x5'));var util=require(_0xcb96('0x6'));var path=require(_0xcb96('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb96('0x8'));var fs=require('fs');var fs_extra=require(_0xcb96('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb96('0xa'));var jsforce=require(_0xcb96('0xb'));var deskjs=require(_0xcb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcb96('0xd'));var Papa=require(_0xcb96('0xe'));var Redis=require(_0xcb96('0xf'));var authService=require(_0xcb96('0x10'));var qs=require(_0xcb96('0x11'));var as=require(_0xcb96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb96('0x13'))(_0xcb96('0x14'));var utils=require(_0xcb96('0x15'));var config=require(_0xcb96('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb96('0x17'))['db'];config[_0xcb96('0x18')]=_[_0xcb96('0x19')](config[_0xcb96('0x18')],{'host':_0xcb96('0x1a'),'port':0x18eb});var socket=require(_0xcb96('0x1b'))(new Redis(config[_0xcb96('0x18')]));require('./voiceQueueReport.socket')[_0xcb96('0x1c')](socket);function respondWithStatusCode(_0x3f4a1a,_0x3590cb){_0x3590cb=_0x3590cb||0xcc;return function(_0x317589){if(_0x317589){return _0x3f4a1a[_0xcb96('0x1d')](_0x3590cb);}return _0x3f4a1a[_0xcb96('0x1e')](_0x3590cb)[_0xcb96('0x1f')]();};}function respondWithResult(_0xc41bcd,_0x24b812){_0x24b812=_0x24b812||0xc8;return function(_0x5e89bb){if(_0x5e89bb){return _0xc41bcd['status'](_0x24b812)[_0xcb96('0x20')](_0x5e89bb);}};}function respondWithFilteredResult(_0x2ffc5e,_0x4ea902){return function(_0xabe03b){if(_0xabe03b){var _0x4dd6d6=typeof _0x4ea902[_0xcb96('0x21')]==='undefined'&&typeof _0x4ea902['limit']===_0xcb96('0x22');var _0x33cc86=_0xabe03b[_0xcb96('0x23')];var _0x586ad8=_0x4dd6d6?0x0:_0x4ea902[_0xcb96('0x21')];var _0x49b8a1=_0x4dd6d6?_0xabe03b[_0xcb96('0x23')]:_0x4ea902[_0xcb96('0x21')]+_0x4ea902[_0xcb96('0x24')];var _0x2b89e4;if(_0x49b8a1>=_0x33cc86){_0x49b8a1=_0x33cc86;_0x2b89e4=0xc8;}else{_0x2b89e4=0xce;}_0x2ffc5e['status'](_0x2b89e4);return _0x2ffc5e['set']('Content-Range',_0x586ad8+'-'+_0x49b8a1+'/'+_0x33cc86)[_0xcb96('0x20')](_0xabe03b);}return null;};}function patchUpdates(_0x2fdca4){return function(_0x336a9a){try{jsonpatch[_0xcb96('0x25')](_0x336a9a,_0x2fdca4,!![]);}catch(_0x1bafea){return BPromise['reject'](_0x1bafea);}return _0x336a9a['save']();};}function saveUpdates(_0x52fb57,_0x3c8850){return function(_0x2ead60){if(_0x2ead60){return _0x2ead60[_0xcb96('0x26')](_0x52fb57)[_0xcb96('0x27')](function(_0x391426){return _0x391426;});}return null;};}function removeEntity(_0x17fb26,_0x1e4d8c){return function(_0x516123){if(_0x516123){return _0x516123[_0xcb96('0x28')]()[_0xcb96('0x27')](function(){_0x17fb26[_0xcb96('0x1e')](0xcc)[_0xcb96('0x1f')]();});}};}function handleEntityNotFound(_0x58f9eb,_0x3ccd5c){return function(_0x278da2){if(!_0x278da2){_0x58f9eb[_0xcb96('0x1d')](0x194);}return _0x278da2;};}function handleError(_0x288dc7,_0x3efdb1){_0x3efdb1=_0x3efdb1||0x1f4;return function(_0x53bf81){logger[_0xcb96('0x29')](_0x53bf81[_0xcb96('0x2a')]);if(_0x53bf81['name']){delete _0x53bf81[_0xcb96('0x2b')];}_0x288dc7[_0xcb96('0x1e')](_0x3efdb1)[_0xcb96('0x2c')](_0x53bf81);};}exports[_0xcb96('0x2d')]=function(_0x1cc435,_0x1cb33a){var _0x98e802={},_0x3e9273={},_0x1c36e6={'count':0x0,'rows':[]};var _0x39ff7f=_[_0xcb96('0x2e')](db[_0xcb96('0x2f')][_0xcb96('0x30')],function(_0x51af1a){return{'name':_0x51af1a[_0xcb96('0x31')],'type':_0x51af1a[_0xcb96('0x32')]['key']};});_0x3e9273[_0xcb96('0x33')]=_[_0xcb96('0x2e')](_0x39ff7f,_0xcb96('0x2b'));_0x3e9273['query']=_['keys'](_0x1cc435[_0xcb96('0x34')]);_0x3e9273['filters']=_['intersection'](_0x3e9273['model'],_0x3e9273[_0xcb96('0x34')]);_0x98e802[_0xcb96('0x35')]=_[_0xcb96('0x36')](_0x3e9273[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0x1cc435['query'][_0xcb96('0x37')]));_0x98e802[_0xcb96('0x35')]=_0x98e802[_0xcb96('0x35')][_0xcb96('0x38')]?_0x98e802[_0xcb96('0x35')]:_0x3e9273[_0xcb96('0x33')];if(!_0x1cc435[_0xcb96('0x34')][_0xcb96('0x39')](_0xcb96('0x3a'))){_0x98e802[_0xcb96('0x24')]=qs[_0xcb96('0x24')](_0x1cc435[_0xcb96('0x34')]['limit']);_0x98e802[_0xcb96('0x21')]=qs[_0xcb96('0x21')](_0x1cc435[_0xcb96('0x34')]['offset']);}_0x98e802[_0xcb96('0x3b')]=qs[_0xcb96('0x3c')](_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3c')]);_0x98e802[_0xcb96('0x3d')]=qs['filters'](_['pick'](_0x1cc435[_0xcb96('0x34')],_0x3e9273[_0xcb96('0x3e')]),_0x39ff7f);if(_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3f')]){_0x98e802[_0xcb96('0x3d')]=_['merge'](_0x98e802['where'],{'$or':_[_0xcb96('0x2e')](_0x39ff7f,function(_0x5e3907){if(_0x5e3907[_0xcb96('0x32')]!=='VIRTUAL'){var _0x3d30ef={};_0x3d30ef[_0x5e3907['name']]={'$like':'%'+_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3f')]+'%'};return _0x3d30ef;}})});}_0x98e802=_[_0xcb96('0x40')]({},_0x98e802,_0x1cc435[_0xcb96('0x41')]);var _0x2b228d={'where':_0x98e802[_0xcb96('0x3d')]};return db[_0xcb96('0x2f')]['count'](_0x2b228d)[_0xcb96('0x27')](function(_0x4c8b9a){_0x1c36e6[_0xcb96('0x23')]=_0x4c8b9a;if(_0x1cc435[_0xcb96('0x34')][_0xcb96('0x42')]){_0x98e802['include']=[{'all':!![]}];}return db[_0xcb96('0x2f')][_0xcb96('0x43')](_0x98e802);})['then'](function(_0x8b5f4b){_0x1c36e6['rows']=_0x8b5f4b;return _0x1c36e6;})[_0xcb96('0x27')](respondWithFilteredResult(_0x1cb33a,_0x98e802))[_0xcb96('0x44')](handleError(_0x1cb33a,null));};exports[_0xcb96('0x45')]=function(_0xc02a8c,_0xd8ec00){var _0x578009={'raw':![],'where':{'id':_0xc02a8c[_0xcb96('0x46')]['id']}},_0x1be0e3={};_0x1be0e3[_0xcb96('0x33')]=_['keys'](db[_0xcb96('0x2f')][_0xcb96('0x30')]);_0x1be0e3['query']=_[_0xcb96('0x47')](_0xc02a8c[_0xcb96('0x34')]);_0x1be0e3[_0xcb96('0x3e')]=_[_0xcb96('0x36')](_0x1be0e3[_0xcb96('0x33')],_0x1be0e3[_0xcb96('0x34')]);_0x578009['attributes']=_['intersection'](_0x1be0e3[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0xc02a8c[_0xcb96('0x34')]['fields']));_0x578009[_0xcb96('0x35')]=_0x578009[_0xcb96('0x35')][_0xcb96('0x38')]?_0x578009['attributes']:_0x1be0e3['model'];if(_0xc02a8c['query'][_0xcb96('0x42')]){_0x578009[_0xcb96('0x48')]=[{'all':!![]}];}_0x578009=_[_0xcb96('0x40')]({},_0x578009,_0xc02a8c[_0xcb96('0x41')]);return db[_0xcb96('0x2f')][_0xcb96('0x49')](_0x578009)['then'](handleEntityNotFound(_0xd8ec00,null))['then'](respondWithResult(_0xd8ec00,null))['catch'](handleError(_0xd8ec00,null));};exports[_0xcb96('0x4a')]=function(_0x2cfa2c,_0x3a55c6){return db[_0xcb96('0x2f')][_0xcb96('0x4a')](_0x2cfa2c[_0xcb96('0x4b')],{})[_0xcb96('0x27')](respondWithResult(_0x3a55c6,0xc9))[_0xcb96('0x44')](handleError(_0x3a55c6,null));};exports['update']=function(_0x1ba3d2,_0x16f4d2){if(_0x1ba3d2[_0xcb96('0x4b')]['id']){delete _0x1ba3d2[_0xcb96('0x4b')]['id'];}return db[_0xcb96('0x2f')][_0xcb96('0x49')]({'where':{'id':_0x1ba3d2['params']['id']}})[_0xcb96('0x27')](handleEntityNotFound(_0x16f4d2,null))[_0xcb96('0x27')](saveUpdates(_0x1ba3d2['body'],null))[_0xcb96('0x27')](respondWithResult(_0x16f4d2,null))[_0xcb96('0x44')](handleError(_0x16f4d2,null));};exports[_0xcb96('0x28')]=function(_0x4a19ac,_0x29d63b){return db['VoiceQueueReport'][_0xcb96('0x49')]({'where':{'id':_0x4a19ac['params']['id']}})['then'](handleEntityNotFound(_0x29d63b,null))['then'](removeEntity(_0x29d63b,null))['catch'](handleError(_0x29d63b,null));};exports[_0xcb96('0x4c')]=function(_0x1c5be8,_0x449fca){return db[_0xcb96('0x2f')][_0xcb96('0x4c')]()['then'](respondWithResult(_0x449fca,null))['catch'](handleError(_0x449fca,null));};exports[_0xcb96('0x4d')]=function(_0x1f9ec3,_0x565536){var _0x2304dd={},_0x590193={},_0x5148a1={'count':0x0,'rows':[]};_0x590193[_0xcb96('0x33')]=_[_0xcb96('0x47')](db[_0xcb96('0x2f')][_0xcb96('0x30')]);_0x590193[_0xcb96('0x34')]=_['keys'](_0x1f9ec3[_0xcb96('0x34')]);_0x590193[_0xcb96('0x3e')]=_[_0xcb96('0x36')](_0x590193['model'],_0x590193['query']);_0x2304dd[_0xcb96('0x35')]=_[_0xcb96('0x36')](_0x590193[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0x1f9ec3[_0xcb96('0x34')]['fields']));_0x2304dd[_0xcb96('0x35')]=_0x2304dd[_0xcb96('0x35')][_0xcb96('0x38')]?_0x2304dd[_0xcb96('0x35')]:_0x590193[_0xcb96('0x33')];if(!_0x1f9ec3['query'][_0xcb96('0x39')](_0xcb96('0x3a'))){_0x2304dd[_0xcb96('0x24')]=qs['limit'](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x24')]);_0x2304dd['offset']=qs['offset'](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x21')]);}_0x2304dd['order']=qs[_0xcb96('0x3c')](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x3c')]);_0x2304dd[_0xcb96('0x3d')]=qs[_0xcb96('0x3e')](_[_0xcb96('0x4e')](_0x1f9ec3[_0xcb96('0x34')],_0x590193[_0xcb96('0x3e')]));if(_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x3f')]){_0x2304dd[_0xcb96('0x3d')]=_[_0xcb96('0x40')](_0x2304dd['where'],{'$or':_['map'](_0x2304dd[_0xcb96('0x35')],function(_0x1e7693){var _0x58a0f0={};_0x58a0f0[_0x1e7693]={'$like':'%'+_0x1f9ec3[_0xcb96('0x34')]['filter']+'%'};return _0x58a0f0;})});}_0x2304dd=_[_0xcb96('0x40')]({},_0x2304dd,_0x1f9ec3[_0xcb96('0x41')]);var _0x33ba94={'where':_0x2304dd[_0xcb96('0x3d')]};return db[_0xcb96('0x2f')][_0xcb96('0x23')](_0x33ba94)[_0xcb96('0x27')](function(_0x2ee124){_0x5148a1['count']=_0x2ee124;if(_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x42')]){_0x2304dd['include']=[{'all':!![]}];}return db[_0xcb96('0x2f')][_0xcb96('0x43')](_0x2304dd);})[_0xcb96('0x27')](function(_0x409046){_0x5148a1[_0xcb96('0x4f')]=_0x409046;return _0x5148a1;})[_0xcb96('0x27')](respondWithFilteredResult(_0x565536,_0x2304dd,_0xcb96('0x4d')))[_0xcb96('0x44')](handleError(_0x565536,null,_0xcb96('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a651b4b..bc1c9f1 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 _0x8e92=['exports','../../mysqldb','VoiceQueueReport','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e92,0x158));var _0x28e9=function(_0x89026a,_0x50068a){_0x89026a=_0x89026a-0x0;var _0x52c4dd=_0x8e92[_0x89026a];return _0x52c4dd;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x28e9('0x0'))['db'][_0x28e9('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x28e9('0x2'),'afterDestroy':_0x28e9('0x3')};function emitEvent(_0x30df14){return function(_0x45c1fd,_0x55a804,_0x386ac5){VoiceQueueReportEvents[_0x28e9('0x4')](_0x30df14+':'+_0x45c1fd['id'],_0x45c1fd);VoiceQueueReportEvents[_0x28e9('0x4')](_0x30df14,_0x45c1fd);_0x386ac5(null);};}for(var e in events){if(events[_0x28e9('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x28e9('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xff6e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport'];(function(_0x14fa0b,_0x254650){var _0x2593b3=function(_0x4866e3){while(--_0x4866e3){_0x14fa0b['push'](_0x14fa0b['shift']());}};_0x2593b3(++_0x254650);}(_0xff6e,0xde));var _0xeff6=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xff6e[_0x58dc25];return _0x21b0a7;};'use strict';var EventEmitter=require(_0xeff6('0x0'));var VoiceQueueReport=require(_0xeff6('0x1'))['db'][_0xeff6('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeff6('0x3')](0x0);var events={'afterCreate':_0xeff6('0x4'),'afterUpdate':_0xeff6('0x5'),'afterDestroy':_0xeff6('0x6')};function emitEvent(_0x332969){return function(_0x4b26d8,_0x3fcd96,_0x5950eb){VoiceQueueReportEvents[_0xeff6('0x7')](_0x332969+':'+_0x4b26d8['id'],_0x4b26d8);VoiceQueueReportEvents[_0xeff6('0x7')](_0x332969,_0x4b26d8);_0x5950eb(null);};}for(var e in events){if(events[_0xeff6('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9317ea8..645a5e0 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 _0x092d=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','calleridnum','lodash','../../config/logger','api','moment'];(function(_0x40b099,_0x3ed7da){var _0x40e1f3=function(_0x1cff63){while(--_0x1cff63){_0x40b099['push'](_0x40b099['shift']());}};_0x40e1f3(++_0x3ed7da);}(_0x092d,0x68));var _0xd092=function(_0x59a294,_0x17dde5){_0x59a294=_0x59a294-0x0;var _0x175f9b=_0x092d[_0x59a294];return _0x175f9b;};'use strict';var _=require(_0xd092('0x0'));var util=require('util');var logger=require(_0xd092('0x1'))(_0xd092('0x2'));var moment=require(_0xd092('0x3'));var BPromise=require('bluebird');var rp=require(_0xd092('0x4'));var fs=require('fs');var path=require(_0xd092('0x5'));var rimraf=require(_0xd092('0x6'));var config=require(_0xd092('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xd092('0x8')]=function(_0x3a34e8,_0x54123a){return _0x3a34e8[_0xd092('0x9')](_0xd092('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd092('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ee4=['api','bluebird','request-promise','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x2096cf,_0x2ce113){var _0x21eb97=function(_0xb69193){while(--_0xb69193){_0x2096cf['push'](_0x2096cf['shift']());}};_0x21eb97(++_0x2ce113);}(_0x9ee4,0x17d));var _0x49ee=function(_0x1f9fee,_0x3f9486){_0x1f9fee=_0x1f9fee-0x0;var _0x237393=_0x9ee4[_0x1f9fee];return _0x237393;};'use strict';var _=require(_0x49ee('0x0'));var util=require(_0x49ee('0x1'));var logger=require(_0x49ee('0x2'))(_0x49ee('0x3'));var moment=require('moment');var BPromise=require(_0x49ee('0x4'));var rp=require(_0x49ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49ee('0x6'));module['exports']=function(_0x304653,_0x5bc347){return _0x304653[_0x49ee('0x7')](_0x49ee('0x8'),attributes,{'tableName':_0x49ee('0x9'),'paranoid':![],'indexes':[{'fields':[_0x49ee('0xa')]},{'fields':[_0x49ee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 4a2391a..723c17f 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 _0x9827=['body','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','VoiceQueueReport','create','CreateVoiceQueueReport','stringify','UpdateVoiceQueueReport'];(function(_0x7d0a8f,_0x4d3786){var _0x330d7a=function(_0x5ee3bb){while(--_0x5ee3bb){_0x7d0a8f['push'](_0x7d0a8f['shift']());}};_0x330d7a(++_0x4d3786);}(_0x9827,0x7c));var _0x7982=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x9827[_0x55bd12];return _0x1941dd;};'use strict';var _=require('lodash');var util=require(_0x7982('0x0'));var moment=require('moment');var BPromise=require(_0x7982('0x1'));var rs=require(_0x7982('0x2'));var fs=require('fs');var Redis=require(_0x7982('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7982('0x4'))(_0x7982('0x5'));var config=require(_0x7982('0x6'));var jayson=require(_0x7982('0x7'));var client=jayson['client'][_0x7982('0x8')]({'port':0x232a});config[_0x7982('0x9')]=_[_0x7982('0xa')](config[_0x7982('0x9')],{'host':_0x7982('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7982('0x9')]));require('./voiceQueueReport.socket')[_0x7982('0xc')](socket);function respondWithRpcPromise(_0x120e27,_0xf68b69,_0x16d4a8){return new BPromise(function(_0x45a935,_0x363e71){return client[_0x7982('0xd')](_0x120e27,_0x16d4a8)[_0x7982('0xe')](function(_0x5a275f){logger[_0x7982('0xf')](_0x7982('0x10'),_0xf68b69,_0x7982('0x11'));logger['debug'](_0x7982('0x12'),_0xf68b69,_0x7982('0x11'),JSON['stringify'](_0x5a275f));if(_0x5a275f['error']){if(_0x5a275f['error'][_0x7982('0x13')]===0x1f4){logger[_0x7982('0x14')](_0x7982('0x10'),_0xf68b69,_0x5a275f[_0x7982('0x14')][_0x7982('0x15')]);return _0x363e71(_0x5a275f[_0x7982('0x14')][_0x7982('0x15')]);}logger[_0x7982('0x14')](_0x7982('0x10'),_0xf68b69,_0x5a275f[_0x7982('0x14')][_0x7982('0x15')]);return _0x45a935(_0x5a275f[_0x7982('0x14')][_0x7982('0x15')]);}else{logger[_0x7982('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0xf68b69,_0x7982('0x11'));_0x45a935(_0x5a275f[_0x7982('0x16')]['message']);}})[_0x7982('0x17')](function(_0x411c7d){logger[_0x7982('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0xf68b69,_0x411c7d);_0x363e71(_0x411c7d);});});}exports[_0x7982('0x18')]=function(_0x2bc93c){var _0x4cb088=this;return new Promise(function(_0x1717b5,_0x365953){return db['VoiceQueueReport'][_0x7982('0x19')]({'raw':_0x2bc93c[_0x7982('0x1a')]?_0x2bc93c[_0x7982('0x1a')][_0x7982('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bc93c[_0x7982('0x1a')]?_0x2bc93c[_0x7982('0x1a')][_0x7982('0x1c')]||null:null,'attributes':_0x2bc93c[_0x7982('0x1a')]?_0x2bc93c[_0x7982('0x1a')][_0x7982('0x1d')]||null:null,'limit':_0x2bc93c[_0x7982('0x1a')]?_0x2bc93c[_0x7982('0x1a')][_0x7982('0x1e')]||null:null,'include':_0x2bc93c['options']?_0x2bc93c['options'][_0x7982('0x1f')]?_[_0x7982('0x20')](_0x2bc93c[_0x7982('0x1a')][_0x7982('0x1f')],function(_0x1b4078){return{'model':db[_0x1b4078[_0x7982('0x21')]],'as':_0x1b4078['as'],'attributes':_0x1b4078[_0x7982('0x1d')],'include':_0x1b4078['include']?_[_0x7982('0x20')](_0x1b4078[_0x7982('0x1f')],function(_0xb056d9){return{'model':db[_0xb056d9['model']],'as':_0xb056d9['as'],'attributes':_0xb056d9[_0x7982('0x1d')],'include':_0xb056d9[_0x7982('0x1f')]?_[_0x7982('0x20')](_0xb056d9[_0x7982('0x1f')],function(_0xd38725){return{'model':db[_0xd38725[_0x7982('0x21')]],'as':_0xd38725['as'],'attributes':_0xd38725[_0x7982('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7982('0xe')](function(_0x5c159a){logger['info'](_0x7982('0x18'),_0x2bc93c);logger[_0x7982('0x22')](_0x7982('0x18'),_0x2bc93c,JSON['stringify'](_0x5c159a));_0x1717b5(_0x5c159a);})[_0x7982('0x17')](function(_0x1664a6){logger['error'](_0x7982('0x18'),_0x1664a6['message'],_0x2bc93c);_0x365953(_0x4cb088['error'](0x1f4,_0x1664a6['message']));});});};exports['CreateVoiceQueueReport']=function(_0x2b0540){var _0x2cf55f=this;return new Promise(function(_0x5524d0,_0x1a5272){return db[_0x7982('0x23')][_0x7982('0x24')](_0x2b0540['body'],{'raw':_0x2b0540[_0x7982('0x1a')]?_0x2b0540[_0x7982('0x1a')][_0x7982('0x1b')]===undefined?!![]:![]:!![]})[_0x7982('0xe')](function(_0x20db14){logger[_0x7982('0xf')]('CreateVoiceQueueReport',_0x2b0540);logger[_0x7982('0x22')](_0x7982('0x25'),_0x2b0540,JSON[_0x7982('0x26')](_0x20db14));_0x5524d0(_0x20db14);})['catch'](function(_0x56e689){logger[_0x7982('0x14')](_0x7982('0x25'),_0x56e689[_0x7982('0x15')],_0x2b0540);_0x1a5272(_0x2cf55f[_0x7982('0x14')](0x1f4,_0x56e689[_0x7982('0x15')]));});});};exports[_0x7982('0x27')]=function(_0x2b854d){var _0x572bd4=this;return new Promise(function(_0x2a8a76,_0xd53136){return db[_0x7982('0x23')]['update'](_0x2b854d[_0x7982('0x28')],{'raw':_0x2b854d['options']?_0x2b854d[_0x7982('0x1a')][_0x7982('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b854d[_0x7982('0x1a')]?_0x2b854d[_0x7982('0x1a')]['where']||null:null,'attributes':_0x2b854d[_0x7982('0x1a')]?_0x2b854d[_0x7982('0x1a')]['attributes']||null:null,'limit':_0x2b854d[_0x7982('0x1a')]?_0x2b854d['options']['limit']||null:null})['then'](function(_0x4e62de){logger[_0x7982('0xf')]('UpdateVoiceQueueReport',_0x2b854d);logger[_0x7982('0x22')](_0x7982('0x27'),_0x2b854d,JSON[_0x7982('0x26')](_0x4e62de));_0x2a8a76(_0x4e62de);})[_0x7982('0x17')](function(_0x521bd0){logger[_0x7982('0x14')](_0x7982('0x27'),_0x521bd0['message'],_0x2b854d);_0xd53136(_0x572bd4['error'](0x1f4,_0x521bd0['message']));});});}; \ No newline at end of file +var _0x896c=['result','message','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','GetVoiceQueueReport','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x10cbda,_0x331fd9){var _0x10e5d8=function(_0x468805){while(--_0x468805){_0x10cbda['push'](_0x10cbda['shift']());}};_0x10e5d8(++_0x331fd9);}(_0x896c,0x10f));var _0xc896=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x896c[_0x335271];return _0xa9fff8;};'use strict';var _=require(_0xc896('0x0'));var util=require(_0xc896('0x1'));var moment=require('moment');var BPromise=require(_0xc896('0x2'));var rs=require(_0xc896('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc896('0x4'))['db'];var utils=require(_0xc896('0x5'));var logger=require('../../config/logger')(_0xc896('0x6'));var config=require(_0xc896('0x7'));var jayson=require(_0xc896('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xc896('0x9')]=_[_0xc896('0xa')](config[_0xc896('0x9')],{'host':_0xc896('0xb'),'port':0x18eb});var socket=require(_0xc896('0xc'))(new Redis(config[_0xc896('0x9')]));require(_0xc896('0xd'))[_0xc896('0xe')](socket);function respondWithRpcPromise(_0x102d77,_0x587689,_0x2c084b){return new BPromise(function(_0x67dff9,_0x5cff07){return client[_0xc896('0xf')](_0x102d77,_0x2c084b)[_0xc896('0x10')](function(_0x593c0e){logger[_0xc896('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x587689,_0xc896('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x587689,_0xc896('0x12'),JSON[_0xc896('0x13')](_0x593c0e));if(_0x593c0e[_0xc896('0x14')]){if(_0x593c0e[_0xc896('0x14')][_0xc896('0x15')]===0x1f4){logger[_0xc896('0x14')](_0xc896('0x16'),_0x587689,_0x593c0e[_0xc896('0x14')]['message']);return _0x5cff07(_0x593c0e[_0xc896('0x14')]['message']);}logger[_0xc896('0x14')](_0xc896('0x16'),_0x587689,_0x593c0e[_0xc896('0x14')]['message']);return _0x67dff9(_0x593c0e[_0xc896('0x14')]['message']);}else{logger[_0xc896('0x11')](_0xc896('0x16'),_0x587689,_0xc896('0x12'));_0x67dff9(_0x593c0e[_0xc896('0x17')][_0xc896('0x18')]);}})[_0xc896('0x19')](function(_0x898c20){logger['error'](_0xc896('0x16'),_0x587689,_0x898c20);_0x5cff07(_0x898c20);});});}exports['GetVoiceQueueReport']=function(_0x21a90d){var _0x23924f=this;return new Promise(function(_0x3e405a,_0x3ec867){return db[_0xc896('0x1a')][_0xc896('0x1b')]({'raw':_0x21a90d[_0xc896('0x1c')]?_0x21a90d[_0xc896('0x1c')][_0xc896('0x1d')]===undefined?!![]:![]:!![],'where':_0x21a90d[_0xc896('0x1c')]?_0x21a90d[_0xc896('0x1c')][_0xc896('0x1e')]||null:null,'attributes':_0x21a90d[_0xc896('0x1c')]?_0x21a90d['options'][_0xc896('0x1f')]||null:null,'limit':_0x21a90d['options']?_0x21a90d[_0xc896('0x1c')][_0xc896('0x20')]||null:null,'include':_0x21a90d[_0xc896('0x1c')]?_0x21a90d['options']['include']?_[_0xc896('0x21')](_0x21a90d[_0xc896('0x1c')][_0xc896('0x22')],function(_0x186f33){return{'model':db[_0x186f33[_0xc896('0x23')]],'as':_0x186f33['as'],'attributes':_0x186f33[_0xc896('0x1f')],'include':_0x186f33[_0xc896('0x22')]?_[_0xc896('0x21')](_0x186f33[_0xc896('0x22')],function(_0x4bdf77){return{'model':db[_0x4bdf77[_0xc896('0x23')]],'as':_0x4bdf77['as'],'attributes':_0x4bdf77[_0xc896('0x1f')],'include':_0x4bdf77[_0xc896('0x22')]?_['map'](_0x4bdf77['include'],function(_0x39f902){return{'model':db[_0x39f902[_0xc896('0x23')]],'as':_0x39f902['as'],'attributes':_0x39f902[_0xc896('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc896('0x10')](function(_0x4b22e4){logger[_0xc896('0x11')]('GetVoiceQueueReport',_0x21a90d);logger[_0xc896('0x24')]('GetVoiceQueueReport',_0x21a90d,JSON[_0xc896('0x13')](_0x4b22e4));_0x3e405a(_0x4b22e4);})[_0xc896('0x19')](function(_0x4352ed){logger[_0xc896('0x14')](_0xc896('0x25'),_0x4352ed['message'],_0x21a90d);_0x3ec867(_0x23924f['error'](0x1f4,_0x4352ed['message']));});});};exports[_0xc896('0x26')]=function(_0x586ccf){var _0x1b5859=this;return new Promise(function(_0x1e5038,_0x1acc3d){return db[_0xc896('0x1a')][_0xc896('0x27')](_0x586ccf['body'],{'raw':_0x586ccf[_0xc896('0x1c')]?_0x586ccf[_0xc896('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21a653){logger[_0xc896('0x11')](_0xc896('0x26'),_0x586ccf);logger[_0xc896('0x24')]('CreateVoiceQueueReport',_0x586ccf,JSON[_0xc896('0x13')](_0x21a653));_0x1e5038(_0x21a653);})['catch'](function(_0xc3cc){logger[_0xc896('0x14')]('CreateVoiceQueueReport',_0xc3cc[_0xc896('0x18')],_0x586ccf);_0x1acc3d(_0x1b5859['error'](0x1f4,_0xc3cc[_0xc896('0x18')]));});});};exports[_0xc896('0x28')]=function(_0x14d560){var _0x1e8d82=this;return new Promise(function(_0x3c0c01,_0x4b95f3){return db[_0xc896('0x1a')][_0xc896('0x29')](_0x14d560['body'],{'raw':_0x14d560['options']?_0x14d560[_0xc896('0x1c')][_0xc896('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d560[_0xc896('0x1c')]?_0x14d560['options'][_0xc896('0x1e')]||null:null,'attributes':_0x14d560[_0xc896('0x1c')]?_0x14d560['options'][_0xc896('0x1f')]||null:null,'limit':_0x14d560[_0xc896('0x1c')]?_0x14d560[_0xc896('0x1c')][_0xc896('0x20')]||null:null})[_0xc896('0x10')](function(_0x1fe099){logger['info'](_0xc896('0x28'),_0x14d560);logger[_0xc896('0x24')](_0xc896('0x28'),_0x14d560,JSON[_0xc896('0x13')](_0x1fe099));_0x3c0c01(_0x1fe099);})[_0xc896('0x19')](function(_0x36f043){logger['error'](_0xc896('0x28'),_0x36f043[_0xc896('0x18')],_0x14d560);_0x4b95f3(_0x1e8d82[_0xc896('0x14')](0x1f4,_0x36f043['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index dc9c954..c76172b 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 _0x5977=['./voiceQueueReport.events','save','remove','emit','register'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x5977,0xeb));var _0x7597=function(_0x21af16,_0x4c808d){_0x21af16=_0x21af16-0x0;var _0xfc84c1=_0x5977[_0x21af16];return _0xfc84c1;};'use strict';var VoiceQueueReportEvents=require(_0x7597('0x0'));var events=[_0x7597('0x1'),_0x7597('0x2'),'update'];function createListener(_0x6fda49,_0x274023){return function(_0x4be061){_0x274023[_0x7597('0x3')](_0x6fda49,_0x4be061);};}function removeListener(_0x495070,_0x9bf757){return function(){VoiceQueueReportEvents['removeListener'](_0x495070,_0x9bf757);};}exports[_0x7597('0x4')]=function(_0x3875e1){for(var _0x5302c6=0x0,_0x4caa87=events['length'];_0x5302c6<_0x4caa87;_0x5302c6++){var _0x437fcc=events[_0x5302c6];var _0x1ae294=createListener('voiceQueueReport:'+_0x437fcc,_0x3875e1);VoiceQueueReportEvents['on'](_0x437fcc,_0x1ae294);}}; \ No newline at end of file +var _0x0ab2=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register'];(function(_0x42f37d,_0x2d8aeb){var _0x5383a1=function(_0x1e0fe7){while(--_0x1e0fe7){_0x42f37d['push'](_0x42f37d['shift']());}};_0x5383a1(++_0x2d8aeb);}(_0x0ab2,0x9a));var _0x20ab=function(_0x3401ce,_0x5d1579){_0x3401ce=_0x3401ce-0x0;var _0x1bb79d=_0x0ab2[_0x3401ce];return _0x1bb79d;};'use strict';var VoiceQueueReportEvents=require(_0x20ab('0x0'));var events=[_0x20ab('0x1'),_0x20ab('0x2'),_0x20ab('0x3')];function createListener(_0x217637,_0x1520c9){return function(_0x4cc8cc){_0x1520c9['emit'](_0x217637,_0x4cc8cc);};}function removeListener(_0x435fc9,_0x2c4d43){return function(){VoiceQueueReportEvents[_0x20ab('0x4')](_0x435fc9,_0x2c4d43);};}exports[_0x20ab('0x5')]=function(_0x35fdb5){for(var _0x362d27=0x0,_0x16d3fc=events[_0x20ab('0x6')];_0x362d27<_0x16d3fc;_0x362d27++){var _0x458cd9=events[_0x362d27];var _0x547349=createListener(_0x20ab('0x7')+_0x458cd9,_0x35fdb5);VoiceQueueReportEvents['on'](_0x458cd9,_0x547349);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index e2ba557..bce198a 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 _0xdb95=['put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create'];(function(_0x3cdb4b,_0x13bebe){var _0x2b4fde=function(_0x52a772){while(--_0x52a772){_0x3cdb4b['push'](_0x3cdb4b['shift']());}};_0x2b4fde(++_0x13bebe);}(_0xdb95,0x1d1));var _0x5db9=function(_0x56d16b,_0x7922cb){_0x56d16b=_0x56d16b-0x0;var _0x1225c7=_0xdb95[_0x56d16b];return _0x1225c7;};'use strict';var multer=require('multer');var util=require(_0x5db9('0x0'));var path=require(_0x5db9('0x1'));var timeout=require(_0x5db9('0x2'));var express=require(_0x5db9('0x3'));var router=express[_0x5db9('0x4')]();var fs_extra=require(_0x5db9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5db9('0x6'));var config=require(_0x5db9('0x7'));var controller=require(_0x5db9('0x8'));router['get']('/',auth[_0x5db9('0x9')](),controller[_0x5db9('0xa')]);router[_0x5db9('0xb')]('/:id',auth[_0x5db9('0x9')](),controller[_0x5db9('0xc')]);router[_0x5db9('0xd')]('/',auth[_0x5db9('0x9')](),controller[_0x5db9('0xe')]);router[_0x5db9('0xf')]('/:id',auth[_0x5db9('0x9')](),controller[_0x5db9('0x10')]);router[_0x5db9('0x11')](_0x5db9('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x5db9('0x13')]=router; \ No newline at end of file +var _0x6505=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get'];(function(_0x24303d,_0x3ab9f1){var _0x5116d3=function(_0x29876f){while(--_0x29876f){_0x24303d['push'](_0x24303d['shift']());}};_0x5116d3(++_0x3ab9f1);}(_0x6505,0x8c));var _0x5650=function(_0x408b42,_0x2edc27){_0x408b42=_0x408b42-0x0;var _0x1ea8bf=_0x6505[_0x408b42];return _0x1ea8bf;};'use strict';var multer=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var path=require(_0x5650('0x2'));var timeout=require(_0x5650('0x3'));var express=require(_0x5650('0x4'));var router=express[_0x5650('0x5')]();var fs_extra=require(_0x5650('0x6'));var auth=require(_0x5650('0x7'));var interaction=require(_0x5650('0x8'));var config=require(_0x5650('0x9'));var controller=require(_0x5650('0xa'));router['get']('/',auth[_0x5650('0xb')](),controller[_0x5650('0xc')]);router[_0x5650('0xd')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0xf')]);router[_0x5650('0x10')]('/',auth['isAuthenticated'](),controller[_0x5650('0x11')]);router['put'](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x12')]);router[_0x5650('0x13')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x14')]);module[_0x5650('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index a826444..dac0928 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 _0x0b1b=['moment','exports','STRING','DATE','literal'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b1b,0x1e5));var _0xb0b1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x0b1b[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb0b1('0x0'));module[_0xb0b1('0x1')]={'time':{'type':Sequelize[_0xb0b1('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb0b1('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb0b1('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xb0b1('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x837e=['moment','STRING','DATE','sequelize'];(function(_0x29fd83,_0x207db0){var _0x1028de=function(_0x2486a1){while(--_0x2486a1){_0x29fd83['push'](_0x29fd83['shift']());}};_0x1028de(++_0x207db0);}(_0x837e,0x1b7));var _0xe837=function(_0x4ba93c,_0x52963a){_0x4ba93c=_0x4ba93c-0x0;var _0x47ea3e=_0x837e[_0x4ba93c];return _0x47ea3e;};'use strict';var Sequelize=require(_0xe837('0x0'));var moment=require(_0xe837('0x1'));module['exports']={'time':{'type':Sequelize[_0xe837('0x2')]},'callid':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe837('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index ebce8a8..5d868d4 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 _0x8a95=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','destroy','then','error','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','VoiceQueuesLog','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','rimraf','zip-dir','fast-json-patch','util','sox','ejs','lodash','squel','crypto'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x8a95,0x83));var _0x58a9=function(_0x465be6,_0x2668de){_0x465be6=_0x465be6-0x0;var _0x45f7b1=_0x8a95[_0x465be6];return _0x45f7b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58a9('0x0'));var zipdir=require(_0x58a9('0x1'));var jsonpatch=require(_0x58a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x58a9('0x3'));var path=require('path');var sox=require(_0x58a9('0x4'));var csv=require('to-csv');var ejs=require(_0x58a9('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58a9('0x6'));var squel=require(_0x58a9('0x7'));var crypto=require(_0x58a9('0x8'));var jsforce=require(_0x58a9('0x9'));var deskjs=require(_0x58a9('0xa'));var toCsv=require(_0x58a9('0xb'));var querystring=require(_0x58a9('0xc'));var Papa=require(_0x58a9('0xd'));var Redis=require('ioredis');var authService=require(_0x58a9('0xe'));var qs=require(_0x58a9('0xf'));var as=require(_0x58a9('0x10'));var hardwareService=require(_0x58a9('0x11'));var logger=require('../../config/logger')(_0x58a9('0x12'));var utils=require(_0x58a9('0x13'));var config=require(_0x58a9('0x14'));var licenseUtil=require(_0x58a9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c5062,_0x4bdd96){_0x4bdd96=_0x4bdd96||0xcc;return function(_0x468f6f){if(_0x468f6f){return _0x3c5062[_0x58a9('0x16')](_0x4bdd96);}return _0x3c5062[_0x58a9('0x17')](_0x4bdd96)[_0x58a9('0x18')]();};}function respondWithResult(_0x5c4463,_0xefabb7){_0xefabb7=_0xefabb7||0xc8;return function(_0x27cdd0){if(_0x27cdd0){return _0x5c4463[_0x58a9('0x17')](_0xefabb7)[_0x58a9('0x19')](_0x27cdd0);}};}function respondWithFilteredResult(_0x4595dd,_0x5b0c36){return function(_0x3efd50){if(_0x3efd50){var _0x5bbaf1=typeof _0x5b0c36[_0x58a9('0x1a')]===_0x58a9('0x1b')&&typeof _0x5b0c36['limit']===_0x58a9('0x1b');var _0x54d4c6=_0x3efd50[_0x58a9('0x1c')];var _0x2c7c96=_0x5bbaf1?0x0:_0x5b0c36[_0x58a9('0x1a')];var _0x503863=_0x5bbaf1?_0x3efd50[_0x58a9('0x1c')]:_0x5b0c36['offset']+_0x5b0c36[_0x58a9('0x1d')];var _0x50d2e6;if(_0x503863>=_0x54d4c6){_0x503863=_0x54d4c6;_0x50d2e6=0xc8;}else{_0x50d2e6=0xce;}_0x4595dd['status'](_0x50d2e6);return _0x4595dd['set'](_0x58a9('0x1e'),_0x2c7c96+'-'+_0x503863+'/'+_0x54d4c6)['json'](_0x3efd50);}return null;};}function patchUpdates(_0x49be5a){return function(_0x41a387){try{jsonpatch['apply'](_0x41a387,_0x49be5a,!![]);}catch(_0x126f7d){return BPromise[_0x58a9('0x1f')](_0x126f7d);}return _0x41a387[_0x58a9('0x20')]();};}function saveUpdates(_0x500269,_0x592891){return function(_0x425b03){if(_0x425b03){return _0x425b03['update'](_0x500269)['then'](function(_0x2ba359){return _0x2ba359;});}return null;};}function removeEntity(_0x4649ef,_0x570790){return function(_0x51c319){if(_0x51c319){return _0x51c319[_0x58a9('0x21')]()[_0x58a9('0x22')](function(){_0x4649ef[_0x58a9('0x17')](0xcc)[_0x58a9('0x18')]();});}};}function handleEntityNotFound(_0x54c332,_0x1bbeff){return function(_0x58194a){if(!_0x58194a){_0x54c332[_0x58a9('0x16')](0x194);}return _0x58194a;};}function handleError(_0x3bd43e,_0xb993fa){_0xb993fa=_0xb993fa||0x1f4;return function(_0x5c5fae){logger[_0x58a9('0x23')](_0x5c5fae['stack']);if(_0x5c5fae[_0x58a9('0x24')]){delete _0x5c5fae['name'];}_0x3bd43e[_0x58a9('0x17')](_0xb993fa)[_0x58a9('0x25')](_0x5c5fae);};}exports['index']=function(_0x52646a,_0x38e04c){var _0x4b23ce={},_0x70af97={},_0x2cf0da={'count':0x0,'rows':[]};var _0x2e3bf4=_['map'](db['VoiceQueuesLog']['rawAttributes'],function(_0x57d8b0){return{'name':_0x57d8b0[_0x58a9('0x26')],'type':_0x57d8b0[_0x58a9('0x27')][_0x58a9('0x28')]};});_0x70af97[_0x58a9('0x29')]=_[_0x58a9('0x2a')](_0x2e3bf4,_0x58a9('0x24'));_0x70af97['query']=_['keys'](_0x52646a[_0x58a9('0x2b')]);_0x70af97[_0x58a9('0x2c')]=_[_0x58a9('0x2d')](_0x70af97[_0x58a9('0x29')],_0x70af97['query']);_0x4b23ce[_0x58a9('0x2e')]=_['intersection'](_0x70af97['model'],qs[_0x58a9('0x2f')](_0x52646a[_0x58a9('0x2b')][_0x58a9('0x2f')]));_0x4b23ce[_0x58a9('0x2e')]=_0x4b23ce['attributes'][_0x58a9('0x30')]?_0x4b23ce[_0x58a9('0x2e')]:_0x70af97['model'];if(!_0x52646a[_0x58a9('0x2b')][_0x58a9('0x31')](_0x58a9('0x32'))){_0x4b23ce['limit']=qs[_0x58a9('0x1d')](_0x52646a['query'][_0x58a9('0x1d')]);_0x4b23ce[_0x58a9('0x1a')]=qs[_0x58a9('0x1a')](_0x52646a[_0x58a9('0x2b')][_0x58a9('0x1a')]);}_0x4b23ce[_0x58a9('0x33')]=qs[_0x58a9('0x34')](_0x52646a[_0x58a9('0x2b')][_0x58a9('0x34')]);_0x4b23ce[_0x58a9('0x35')]=qs['filters'](_['pick'](_0x52646a['query'],_0x70af97['filters']),_0x2e3bf4);if(_0x52646a[_0x58a9('0x2b')][_0x58a9('0x36')]){_0x4b23ce[_0x58a9('0x35')]=_[_0x58a9('0x37')](_0x4b23ce[_0x58a9('0x35')],{'$or':_[_0x58a9('0x2a')](_0x2e3bf4,function(_0x20581b){if(_0x20581b['type']!=='VIRTUAL'){var _0x22371a={};_0x22371a[_0x20581b[_0x58a9('0x24')]]={'$like':'%'+_0x52646a[_0x58a9('0x2b')][_0x58a9('0x36')]+'%'};return _0x22371a;}})});}_0x4b23ce=_[_0x58a9('0x37')]({},_0x4b23ce,_0x52646a[_0x58a9('0x38')]);var _0x2b0467={'where':_0x4b23ce['where']};return db[_0x58a9('0x39')][_0x58a9('0x1c')](_0x2b0467)[_0x58a9('0x22')](function(_0x100313){_0x2cf0da['count']=_0x100313;if(_0x52646a[_0x58a9('0x2b')][_0x58a9('0x3a')]){_0x4b23ce[_0x58a9('0x3b')]=[{'all':!![]}];}return db[_0x58a9('0x39')][_0x58a9('0x3c')](_0x4b23ce);})[_0x58a9('0x22')](function(_0x39fcac){_0x2cf0da[_0x58a9('0x3d')]=_0x39fcac;return _0x2cf0da;})[_0x58a9('0x22')](respondWithFilteredResult(_0x38e04c,_0x4b23ce))[_0x58a9('0x3e')](handleError(_0x38e04c,null));};exports[_0x58a9('0x3f')]=function(_0x540aef,_0x3d7e87){var _0x2f0b2c={'raw':!![],'where':{'id':_0x540aef[_0x58a9('0x40')]['id']}},_0x159ed1={};_0x159ed1['model']=_[_0x58a9('0x41')](db['VoiceQueuesLog']['rawAttributes']);_0x159ed1['query']=_[_0x58a9('0x41')](_0x540aef[_0x58a9('0x2b')]);_0x159ed1[_0x58a9('0x2c')]=_[_0x58a9('0x2d')](_0x159ed1['model'],_0x159ed1[_0x58a9('0x2b')]);_0x2f0b2c[_0x58a9('0x2e')]=_[_0x58a9('0x2d')](_0x159ed1[_0x58a9('0x29')],qs[_0x58a9('0x2f')](_0x540aef[_0x58a9('0x2b')][_0x58a9('0x2f')]));_0x2f0b2c[_0x58a9('0x2e')]=_0x2f0b2c[_0x58a9('0x2e')][_0x58a9('0x30')]?_0x2f0b2c['attributes']:_0x159ed1['model'];if(_0x540aef[_0x58a9('0x2b')]['includeAll']){_0x2f0b2c[_0x58a9('0x3b')]=[{'all':!![]}];}_0x2f0b2c=_[_0x58a9('0x37')]({},_0x2f0b2c,_0x540aef[_0x58a9('0x38')]);return db[_0x58a9('0x39')][_0x58a9('0x42')](_0x2f0b2c)[_0x58a9('0x22')](handleEntityNotFound(_0x3d7e87,null))['then'](respondWithResult(_0x3d7e87,null))['catch'](handleError(_0x3d7e87,null));};exports[_0x58a9('0x43')]=function(_0x15f072,_0x1cf0f2){return db[_0x58a9('0x39')][_0x58a9('0x43')](_0x15f072[_0x58a9('0x44')],{})[_0x58a9('0x22')](respondWithResult(_0x1cf0f2,0xc9))[_0x58a9('0x3e')](handleError(_0x1cf0f2,null));};exports[_0x58a9('0x45')]=function(_0x551002,_0x5e702f){if(_0x551002[_0x58a9('0x44')]['id']){delete _0x551002[_0x58a9('0x44')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x551002[_0x58a9('0x40')]['id']}})[_0x58a9('0x22')](handleEntityNotFound(_0x5e702f,null))['then'](saveUpdates(_0x551002['body'],null))[_0x58a9('0x22')](respondWithResult(_0x5e702f,null))[_0x58a9('0x3e')](handleError(_0x5e702f,null));};exports[_0x58a9('0x21')]=function(_0x37ffe6,_0x825a1e){return db[_0x58a9('0x39')][_0x58a9('0x42')]({'where':{'id':_0x37ffe6[_0x58a9('0x40')]['id']}})[_0x58a9('0x22')](handleEntityNotFound(_0x825a1e,null))[_0x58a9('0x22')](removeEntity(_0x825a1e,null))[_0x58a9('0x3e')](handleError(_0x825a1e,null));}; \ No newline at end of file +var _0xdea3=['filters','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','rawAttributes','includeAll','include','create','body','find','params','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','error','stack','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x4f9a37,_0x30e084){var _0x148238=function(_0x4e706a){while(--_0x4e706a){_0x4f9a37['push'](_0x4f9a37['shift']());}};_0x148238(++_0x30e084);}(_0xdea3,0xa4));var _0x3dea=function(_0x41492e,_0x5985c2){_0x41492e=_0x41492e-0x0;var _0x276311=_0xdea3[_0x41492e];return _0x276311;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3dea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dea('0x1'));var rp=require('request-promise');var moment=require(_0x3dea('0x2'));var BPromise=require(_0x3dea('0x3'));var Mustache=require('mustache');var util=require(_0x3dea('0x4'));var path=require(_0x3dea('0x5'));var sox=require(_0x3dea('0x6'));var csv=require(_0x3dea('0x7'));var ejs=require(_0x3dea('0x8'));var fs=require('fs');var fs_extra=require(_0x3dea('0x9'));var _=require(_0x3dea('0xa'));var squel=require('squel');var crypto=require(_0x3dea('0xb'));var jsforce=require(_0x3dea('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dea('0x7'));var querystring=require(_0x3dea('0xd'));var Papa=require(_0x3dea('0xe'));var Redis=require(_0x3dea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3dea('0x10'));var as=require(_0x3dea('0x11'));var hardwareService=require(_0x3dea('0x12'));var logger=require(_0x3dea('0x13'))(_0x3dea('0x14'));var utils=require('../../config/utils');var config=require(_0x3dea('0x15'));var licenseUtil=require(_0x3dea('0x16'));var db=require(_0x3dea('0x17'))['db'];function respondWithStatusCode(_0x37d2f4,_0x2840e2){_0x2840e2=_0x2840e2||0xcc;return function(_0x3ad491){if(_0x3ad491){return _0x37d2f4[_0x3dea('0x18')](_0x2840e2);}return _0x37d2f4[_0x3dea('0x19')](_0x2840e2)[_0x3dea('0x1a')]();};}function respondWithResult(_0x5c1ce9,_0x44ec1d){_0x44ec1d=_0x44ec1d||0xc8;return function(_0x36e623){if(_0x36e623){return _0x5c1ce9[_0x3dea('0x19')](_0x44ec1d)['json'](_0x36e623);}};}function respondWithFilteredResult(_0x435843,_0x3e39f1){return function(_0xb543f6){if(_0xb543f6){var _0x584559=typeof _0x3e39f1[_0x3dea('0x1b')]===_0x3dea('0x1c')&&typeof _0x3e39f1[_0x3dea('0x1d')]===_0x3dea('0x1c');var _0x58ad5a=_0xb543f6[_0x3dea('0x1e')];var _0x346ffb=_0x584559?0x0:_0x3e39f1[_0x3dea('0x1b')];var _0x4d8834=_0x584559?_0xb543f6['count']:_0x3e39f1[_0x3dea('0x1b')]+_0x3e39f1[_0x3dea('0x1d')];var _0x4a0f60;if(_0x4d8834>=_0x58ad5a){_0x4d8834=_0x58ad5a;_0x4a0f60=0xc8;}else{_0x4a0f60=0xce;}_0x435843[_0x3dea('0x19')](_0x4a0f60);return _0x435843[_0x3dea('0x1f')]('Content-Range',_0x346ffb+'-'+_0x4d8834+'/'+_0x58ad5a)[_0x3dea('0x20')](_0xb543f6);}return null;};}function patchUpdates(_0x29508c){return function(_0x39df58){try{jsonpatch['apply'](_0x39df58,_0x29508c,!![]);}catch(_0x534cac){return BPromise[_0x3dea('0x21')](_0x534cac);}return _0x39df58[_0x3dea('0x22')]();};}function saveUpdates(_0x3341a1,_0xfc75a2){return function(_0x481aff){if(_0x481aff){return _0x481aff[_0x3dea('0x23')](_0x3341a1)['then'](function(_0x47fca2){return _0x47fca2;});}return null;};}function removeEntity(_0x18ea51,_0x39848a){return function(_0x330294){if(_0x330294){return _0x330294[_0x3dea('0x24')]()[_0x3dea('0x25')](function(){_0x18ea51[_0x3dea('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x86c36a,_0x4386fc){return function(_0x20bd19){if(!_0x20bd19){_0x86c36a[_0x3dea('0x18')](0x194);}return _0x20bd19;};}function handleError(_0x558d73,_0x557e5c){_0x557e5c=_0x557e5c||0x1f4;return function(_0x4c4e5a){logger[_0x3dea('0x26')](_0x4c4e5a[_0x3dea('0x27')]);if(_0x4c4e5a[_0x3dea('0x28')]){delete _0x4c4e5a['name'];}_0x558d73[_0x3dea('0x19')](_0x557e5c)[_0x3dea('0x29')](_0x4c4e5a);};}exports['index']=function(_0x4efd25,_0x1b77c8){var _0x593fc3={},_0x5997bc={},_0xfcf10a={'count':0x0,'rows':[]};var _0x55d636=_[_0x3dea('0x2a')](db[_0x3dea('0x2b')]['rawAttributes'],function(_0x12a6fd){return{'name':_0x12a6fd[_0x3dea('0x2c')],'type':_0x12a6fd[_0x3dea('0x2d')][_0x3dea('0x2e')]};});_0x5997bc[_0x3dea('0x2f')]=_['map'](_0x55d636,'name');_0x5997bc[_0x3dea('0x30')]=_[_0x3dea('0x31')](_0x4efd25[_0x3dea('0x30')]);_0x5997bc['filters']=_[_0x3dea('0x32')](_0x5997bc[_0x3dea('0x2f')],_0x5997bc[_0x3dea('0x30')]);_0x593fc3[_0x3dea('0x33')]=_[_0x3dea('0x32')](_0x5997bc[_0x3dea('0x2f')],qs[_0x3dea('0x34')](_0x4efd25[_0x3dea('0x30')][_0x3dea('0x34')]));_0x593fc3[_0x3dea('0x33')]=_0x593fc3[_0x3dea('0x33')][_0x3dea('0x35')]?_0x593fc3[_0x3dea('0x33')]:_0x5997bc[_0x3dea('0x2f')];if(!_0x4efd25['query']['hasOwnProperty'](_0x3dea('0x36'))){_0x593fc3[_0x3dea('0x1d')]=qs[_0x3dea('0x1d')](_0x4efd25['query'][_0x3dea('0x1d')]);_0x593fc3[_0x3dea('0x1b')]=qs[_0x3dea('0x1b')](_0x4efd25['query'][_0x3dea('0x1b')]);}_0x593fc3[_0x3dea('0x37')]=qs['sort'](_0x4efd25['query'][_0x3dea('0x38')]);_0x593fc3[_0x3dea('0x39')]=qs[_0x3dea('0x3a')](_[_0x3dea('0x3b')](_0x4efd25['query'],_0x5997bc['filters']),_0x55d636);if(_0x4efd25['query']['filter']){_0x593fc3[_0x3dea('0x39')]=_[_0x3dea('0x3c')](_0x593fc3[_0x3dea('0x39')],{'$or':_['map'](_0x55d636,function(_0xd1652e){if(_0xd1652e[_0x3dea('0x2d')]!==_0x3dea('0x3d')){var _0x46067e={};_0x46067e[_0xd1652e[_0x3dea('0x28')]]={'$like':'%'+_0x4efd25[_0x3dea('0x30')][_0x3dea('0x3e')]+'%'};return _0x46067e;}})});}_0x593fc3=_[_0x3dea('0x3c')]({},_0x593fc3,_0x4efd25['options']);var _0x499f8d={'where':_0x593fc3[_0x3dea('0x39')]};return db[_0x3dea('0x2b')][_0x3dea('0x1e')](_0x499f8d)[_0x3dea('0x25')](function(_0x406b5b){_0xfcf10a[_0x3dea('0x1e')]=_0x406b5b;if(_0x4efd25['query']['includeAll']){_0x593fc3['include']=[{'all':!![]}];}return db[_0x3dea('0x2b')][_0x3dea('0x3f')](_0x593fc3);})[_0x3dea('0x25')](function(_0x51784d){_0xfcf10a[_0x3dea('0x40')]=_0x51784d;return _0xfcf10a;})[_0x3dea('0x25')](respondWithFilteredResult(_0x1b77c8,_0x593fc3))[_0x3dea('0x41')](handleError(_0x1b77c8,null));};exports[_0x3dea('0x42')]=function(_0x21c787,_0xb575a4){var _0x1f6c06={'raw':!![],'where':{'id':_0x21c787['params']['id']}},_0x58da38={};_0x58da38['model']=_[_0x3dea('0x31')](db[_0x3dea('0x2b')][_0x3dea('0x43')]);_0x58da38[_0x3dea('0x30')]=_['keys'](_0x21c787[_0x3dea('0x30')]);_0x58da38[_0x3dea('0x3a')]=_[_0x3dea('0x32')](_0x58da38[_0x3dea('0x2f')],_0x58da38[_0x3dea('0x30')]);_0x1f6c06[_0x3dea('0x33')]=_[_0x3dea('0x32')](_0x58da38['model'],qs[_0x3dea('0x34')](_0x21c787[_0x3dea('0x30')]['fields']));_0x1f6c06['attributes']=_0x1f6c06['attributes'][_0x3dea('0x35')]?_0x1f6c06[_0x3dea('0x33')]:_0x58da38[_0x3dea('0x2f')];if(_0x21c787[_0x3dea('0x30')][_0x3dea('0x44')]){_0x1f6c06[_0x3dea('0x45')]=[{'all':!![]}];}_0x1f6c06=_['merge']({},_0x1f6c06,_0x21c787['options']);return db[_0x3dea('0x2b')]['find'](_0x1f6c06)[_0x3dea('0x25')](handleEntityNotFound(_0xb575a4,null))['then'](respondWithResult(_0xb575a4,null))[_0x3dea('0x41')](handleError(_0xb575a4,null));};exports[_0x3dea('0x46')]=function(_0x3f6824,_0x14ff92){return db['VoiceQueuesLog'][_0x3dea('0x46')](_0x3f6824[_0x3dea('0x47')],{})[_0x3dea('0x25')](respondWithResult(_0x14ff92,0xc9))['catch'](handleError(_0x14ff92,null));};exports['update']=function(_0x30e86e,_0x30c536){if(_0x30e86e['body']['id']){delete _0x30e86e[_0x3dea('0x47')]['id'];}return db[_0x3dea('0x2b')][_0x3dea('0x48')]({'where':{'id':_0x30e86e[_0x3dea('0x49')]['id']}})[_0x3dea('0x25')](handleEntityNotFound(_0x30c536,null))[_0x3dea('0x25')](saveUpdates(_0x30e86e[_0x3dea('0x47')],null))[_0x3dea('0x25')](respondWithResult(_0x30c536,null))['catch'](handleError(_0x30c536,null));};exports[_0x3dea('0x24')]=function(_0x2e2786,_0x537b58){return db[_0x3dea('0x2b')][_0x3dea('0x48')]({'where':{'id':_0x2e2786['params']['id']}})['then'](handleEntityNotFound(_0x537b58,null))[_0x3dea('0x25')](removeEntity(_0x537b58,null))[_0x3dea('0x41')](handleError(_0x537b58,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1bfa6b0..0e3651b 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 _0x9ff0=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x9ff0,0x174));var _0x09ff=function(_0x42d806,_0x55b8cc){_0x42d806=_0x42d806-0x0;var _0x3d3a5f=_0x9ff0[_0x42d806];return _0x3d3a5f;};'use strict';var _=require(_0x09ff('0x0'));var util=require(_0x09ff('0x1'));var logger=require(_0x09ff('0x2'))(_0x09ff('0x3'));var moment=require('moment');var BPromise=require(_0x09ff('0x4'));var rp=require(_0x09ff('0x5'));var fs=require('fs');var path=require(_0x09ff('0x6'));var rimraf=require(_0x09ff('0x7'));var config=require(_0x09ff('0x8'));var attributes=require(_0x09ff('0x9'));module['exports']=function(_0x5b4132,_0x2f62d9){return _0x5b4132[_0x09ff('0xa')](_0x09ff('0xb'),attributes,{'tableName':_0x09ff('0xc'),'paranoid':![],'indexes':[{'name':_0x09ff('0xd'),'fields':['event',_0x09ff('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xab4d=['dtm','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x53aba7,_0x209f73){var _0x13e4a6=function(_0x3726c6){while(--_0x3726c6){_0x53aba7['push'](_0x53aba7['shift']());}};_0x13e4a6(++_0x209f73);}(_0xab4d,0x1ae));var _0xdab4=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xab4d[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0xdab4('0x0'));var util=require(_0xdab4('0x1'));var logger=require(_0xdab4('0x2'))(_0xdab4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdab4('0x4'));var fs=require('fs');var path=require(_0xdab4('0x5'));var rimraf=require('rimraf');var config=require(_0xdab4('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0xbf240,_0x3694a9){return _0xbf240[_0xdab4('0x7')](_0xdab4('0x8'),attributes,{'tableName':_0xdab4('0x9'),'paranoid':![],'indexes':[{'name':_0xdab4('0xa'),'fields':[_0xdab4('0xb'),_0xdab4('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 4254e52..5155069 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 _0xf2a4=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xf2a4,0xfe));var _0x4f2a=function(_0x5a3671,_0x5587ee){_0x5a3671=_0x5a3671-0x0;var _0x2c5c87=_0xf2a4[_0x5a3671];return _0x2c5c87;};'use strict';var _=require(_0x4f2a('0x0'));var util=require(_0x4f2a('0x1'));var moment=require('moment');var BPromise=require(_0x4f2a('0x2'));var rs=require(_0x4f2a('0x3'));var fs=require('fs');var Redis=require(_0x4f2a('0x4'));var db=require(_0x4f2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f2a('0x6'))(_0x4f2a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f2a('0x8'));var client=jayson[_0x4f2a('0x9')][_0x4f2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6757,_0x511463,_0x4bd1a7){return new BPromise(function(_0x465bfb,_0x2e3bd2){return client[_0x4f2a('0xb')](_0x3e6757,_0x4bd1a7)['then'](function(_0x3ab9f0){logger[_0x4f2a('0xc')](_0x4f2a('0xd'),_0x511463,_0x4f2a('0xe'));logger[_0x4f2a('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x511463,_0x4f2a('0xe'),JSON[_0x4f2a('0x10')](_0x3ab9f0));if(_0x3ab9f0[_0x4f2a('0x11')]){if(_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x12')]===0x1f4){logger[_0x4f2a('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x511463,_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x13')]);return _0x2e3bd2(_0x3ab9f0[_0x4f2a('0x11')]['message']);}logger[_0x4f2a('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x511463,_0x3ab9f0['error'][_0x4f2a('0x13')]);return _0x465bfb(_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x13')]);}else{logger[_0x4f2a('0xc')](_0x4f2a('0xd'),_0x511463,_0x4f2a('0xe'));_0x465bfb(_0x3ab9f0[_0x4f2a('0x14')][_0x4f2a('0x13')]);}})['catch'](function(_0x18980b){logger[_0x4f2a('0x11')](_0x4f2a('0xd'),_0x511463,_0x18980b);_0x2e3bd2(_0x18980b);});});} \ No newline at end of file +var _0x8be2=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x8be2,0xcd));var _0x28be=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x8be2[_0x3d8ba1];return _0x87804e;};'use strict';var _=require(_0x28be('0x0'));var util=require(_0x28be('0x1'));var moment=require(_0x28be('0x2'));var BPromise=require(_0x28be('0x3'));var rs=require(_0x28be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28be('0x6'))(_0x28be('0x7'));var config=require(_0x28be('0x8'));var jayson=require(_0x28be('0x9'));var client=jayson['client'][_0x28be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f6282,_0x59710c,_0x3b7baa){return new BPromise(function(_0x2b9654,_0x3e457){return client[_0x28be('0xb')](_0x2f6282,_0x3b7baa)[_0x28be('0xc')](function(_0x4d30cd){logger[_0x28be('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59710c,_0x28be('0xe'));logger['debug'](_0x28be('0xf'),_0x59710c,_0x28be('0xe'),JSON[_0x28be('0x10')](_0x4d30cd));if(_0x4d30cd[_0x28be('0x11')]){if(_0x4d30cd[_0x28be('0x11')][_0x28be('0x12')]===0x1f4){logger['error'](_0x28be('0x13'),_0x59710c,_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);return _0x3e457(_0x4d30cd[_0x28be('0x11')]['message']);}logger[_0x28be('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59710c,_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);return _0x2b9654(_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);}else{logger['info'](_0x28be('0x13'),_0x59710c,_0x28be('0xe'));_0x2b9654(_0x4d30cd[_0x28be('0x15')]['message']);}})['catch'](function(_0x1fd477){logger[_0x28be('0x11')](_0x28be('0x13'),_0x59710c,_0x1fd477);_0x3e457(_0x1fd477);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f9c9fe1..65e1ece 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 _0x370e=['show','isAuthenticated','/:id/downloads','/:id/transcribe','downloadTranscribe','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0x2aca66,_0x2cf8d6){var _0x569919=function(_0x26bb24){while(--_0x26bb24){_0x2aca66['push'](_0x2aca66['shift']());}};_0x569919(++_0x2cf8d6);}(_0x370e,0x1cd));var _0xe370=function(_0xa1ceeb,_0x24577){_0xa1ceeb=_0xa1ceeb-0x0;var _0x209288=_0x370e[_0xa1ceeb];return _0x209288;};'use strict';var multer=require('multer');var util=require(_0xe370('0x0'));var path=require(_0xe370('0x1'));var timeout=require(_0xe370('0x2'));var express=require(_0xe370('0x3'));var router=express[_0xe370('0x4')]();var fs_extra=require(_0xe370('0x5'));var auth=require(_0xe370('0x6'));var interaction=require(_0xe370('0x7'));var config=require(_0xe370('0x8'));var controller=require('./voiceRecording.controller');router[_0xe370('0x9')]('/',auth['isAuthenticated'](),controller[_0xe370('0xa')]);router[_0xe370('0x9')](_0xe370('0xb'),auth['isAuthenticated'](),controller[_0xe370('0xc')]);router['get'](_0xe370('0xd'),auth['isAuthenticated'](),controller[_0xe370('0xe')]);router[_0xe370('0x9')]('/:id/download',auth[_0xe370('0xf')](),controller['download']);router[_0xe370('0x9')](_0xe370('0x10'),controller['downloads']);router[_0xe370('0x9')](_0xe370('0x11'),auth[_0xe370('0xf')](),controller[_0xe370('0x12')]);router[_0xe370('0x13')]('/',auth[_0xe370('0xf')](),controller['create']);router[_0xe370('0x13')]('/:id/transcribe',auth[_0xe370('0xf')](),controller['runTranscribe']);router[_0xe370('0x14')](_0xe370('0xd'),auth[_0xe370('0xf')](),controller[_0xe370('0x15')]);router[_0xe370('0x16')]('/:id',auth[_0xe370('0xf')](),controller[_0xe370('0x17')]);module[_0xe370('0x18')]=router; \ No newline at end of file +var _0x471f=['update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put'];(function(_0x588555,_0x7e8762){var _0x34611b=function(_0x42b6c9){while(--_0x42b6c9){_0x588555['push'](_0x588555['shift']());}};_0x34611b(++_0x7e8762);}(_0x471f,0x147));var _0xf471=function(_0x55adec,_0x27468c){_0x55adec=_0x55adec-0x0;var _0x2e379b=_0x471f[_0x55adec];return _0x2e379b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf471('0x0'));var timeout=require(_0xf471('0x1'));var express=require(_0xf471('0x2'));var router=express[_0xf471('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf471('0x4'));var interaction=require(_0xf471('0x5'));var config=require(_0xf471('0x6'));var controller=require(_0xf471('0x7'));router[_0xf471('0x8')]('/',auth[_0xf471('0x9')](),controller[_0xf471('0xa')]);router['get'](_0xf471('0xb'),auth[_0xf471('0x9')](),controller[_0xf471('0xc')]);router[_0xf471('0x8')](_0xf471('0xd'),auth[_0xf471('0x9')](),controller[_0xf471('0xe')]);router[_0xf471('0x8')](_0xf471('0xf'),auth[_0xf471('0x9')](),controller[_0xf471('0x10')]);router[_0xf471('0x8')](_0xf471('0x11'),controller[_0xf471('0x12')]);router['get'](_0xf471('0x13'),auth[_0xf471('0x9')](),controller[_0xf471('0x14')]);router['post']('/',auth[_0xf471('0x9')](),controller[_0xf471('0x15')]);router['post'](_0xf471('0x13'),auth['isAuthenticated'](),controller[_0xf471('0x16')]);router[_0xf471('0x17')](_0xf471('0xd'),auth[_0xf471('0x9')](),controller[_0xf471('0x18')]);router['delete']('/:id',auth[_0xf471('0x9')](),controller[_0xf471('0x19')]);module[_0xf471('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c489822..e986573 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 _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 0bc7aff..5c631cc 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 _0x095e=['Voice\x20Recording\x20not\x20found','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data2','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceRecording','rawAttributes','type','key','model','differenceBy','map','format','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','extname','unlink','message','downloads','sequelize','MD5','col','token','$and','push','filename','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne'];(function(_0x5e4fba,_0x498d8e){var _0x5d26b4=function(_0x2b0743){while(--_0x2b0743){_0x5e4fba['push'](_0x5e4fba['shift']());}};_0x5d26b4(++_0x498d8e);}(_0x095e,0x1e6));var _0xe095=function(_0x41594b,_0x5eb350){_0x41594b=_0x41594b-0x0;var _0x46ac05=_0x095e[_0x41594b];return _0x46ac05;};'use strict';var emlformat=require(_0xe095('0x0'));var rimraf=require(_0xe095('0x1'));var zipdir=require(_0xe095('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe095('0x3'));var moment=require(_0xe095('0x4'));var BPromise=require(_0xe095('0x5'));var Mustache=require(_0xe095('0x6'));var util=require(_0xe095('0x7'));var path=require(_0xe095('0x8'));var sox=require(_0xe095('0x9'));var csv=require(_0xe095('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe095('0xb'));var _=require('lodash');var squel=require(_0xe095('0xc'));var crypto=require(_0xe095('0xd'));var jsforce=require(_0xe095('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe095('0xa'));var querystring=require(_0xe095('0xf'));var Papa=require(_0xe095('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0xe095('0x11'));var Redis=require('ioredis');var authService=require(_0xe095('0x12'));var qs=require(_0xe095('0x13'));var as=require(_0xe095('0x14'));var hardwareService=require(_0xe095('0x15'));var logger=require('../../config/logger')(_0xe095('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe095('0x17'));var db=require(_0xe095('0x18'))['db'];function respondWithStatusCode(_0x32fdbd,_0x591a72){_0x591a72=_0x591a72||0xcc;return function(_0x1e8741){if(_0x1e8741){return _0x32fdbd['sendStatus'](_0x591a72);}return _0x32fdbd[_0xe095('0x19')](_0x591a72)[_0xe095('0x1a')]();};}function respondWithResult(_0x4a3dea,_0x268523){_0x268523=_0x268523||0xc8;return function(_0x3eccbb){if(_0x3eccbb){return _0x4a3dea['status'](_0x268523)[_0xe095('0x1b')](_0x3eccbb);}};}function respondWithFilteredResult(_0x5c63f0,_0x9190a){return function(_0x37f063){if(_0x37f063){var _0x23b4f8=typeof _0x9190a['offset']===_0xe095('0x1c')&&typeof _0x9190a[_0xe095('0x1d')]==='undefined';var _0x58f93f=_0x37f063[_0xe095('0x1e')];var _0x4c604b=_0x23b4f8?0x0:_0x9190a[_0xe095('0x1f')];var _0x266d7c=_0x23b4f8?_0x37f063[_0xe095('0x1e')]:_0x9190a[_0xe095('0x1f')]+_0x9190a[_0xe095('0x1d')];var _0x44a588;if(_0x266d7c>=_0x58f93f){_0x266d7c=_0x58f93f;_0x44a588=0xc8;}else{_0x44a588=0xce;}_0x5c63f0[_0xe095('0x19')](_0x44a588);return _0x5c63f0['set'](_0xe095('0x20'),_0x4c604b+'-'+_0x266d7c+'/'+_0x58f93f)[_0xe095('0x1b')](_0x37f063);}return null;};}function patchUpdates(_0x1c6301){return function(_0x327256){try{jsonpatch[_0xe095('0x21')](_0x327256,_0x1c6301,!![]);}catch(_0x322c94){return BPromise['reject'](_0x322c94);}return _0x327256[_0xe095('0x22')]();};}function saveUpdates(_0x47f4ef,_0x542572){return function(_0x34a2a5){if(_0x34a2a5){return _0x34a2a5[_0xe095('0x23')](_0x47f4ef)[_0xe095('0x24')](function(_0x43d588){return _0x43d588;});}return null;};}function removeEntity(_0x4dcf7d,_0x882919){return function(_0x3e7050){if(_0x3e7050){return _0x3e7050[_0xe095('0x25')]()[_0xe095('0x24')](function(){_0x4dcf7d['status'](0xcc)[_0xe095('0x1a')]();});}};}function handleEntityNotFound(_0x13606c,_0x339a55){return function(_0x13349e){if(!_0x13349e){_0x13606c['sendStatus'](0x194);}return _0x13349e;};}function handleError(_0x19e802,_0x441f58){_0x441f58=_0x441f58||0x1f4;return function(_0x4cd882){logger[_0xe095('0x26')](_0x4cd882[_0xe095('0x27')]);if(_0x4cd882[_0xe095('0x28')]){delete _0x4cd882['name'];}_0x19e802[_0xe095('0x19')](_0x441f58)[_0xe095('0x29')](_0x4cd882);};}exports[_0xe095('0x2a')]=function(_0x545491,_0x3f9c2f){var _0x2c9148={},_0x58c29c={},_0x13e3da={'count':0x0,'rows':[]};var _0x420003=_['map'](db[_0xe095('0x2b')][_0xe095('0x2c')],function(_0x1946a8){return{'name':_0x1946a8['fieldName'],'type':_0x1946a8[_0xe095('0x2d')][_0xe095('0x2e')]};});_0x58c29c[_0xe095('0x2f')]=_[_0xe095('0x30')](_[_0xe095('0x31')](_0x420003,_0xe095('0x28')),[_0xe095('0x32')]);_0x58c29c['query']=_[_0xe095('0x33')](_0x545491['query']);_0x58c29c['filters']=_[_0xe095('0x34')](_0x58c29c[_0xe095('0x2f')],_0x58c29c[_0xe095('0x35')]);_0x2c9148[_0xe095('0x36')]=_[_0xe095('0x34')](_0x58c29c[_0xe095('0x2f')],qs[_0xe095('0x37')](_0x545491[_0xe095('0x35')][_0xe095('0x37')]));_0x2c9148['attributes']=_0x2c9148['attributes']['length']?_0x2c9148[_0xe095('0x36')]:_0x58c29c[_0xe095('0x2f')];if(!_0x545491['query'][_0xe095('0x38')]('nolimit')){_0x2c9148[_0xe095('0x1d')]=qs['limit'](_0x545491['query'][_0xe095('0x1d')]);_0x2c9148[_0xe095('0x1f')]=qs['offset'](_0x545491[_0xe095('0x35')][_0xe095('0x1f')]);}_0x2c9148[_0xe095('0x39')]=qs[_0xe095('0x3a')](_0x545491[_0xe095('0x35')]['sort']);_0x2c9148[_0xe095('0x3b')]=qs[_0xe095('0x3c')](_[_0xe095('0x3d')](_0x545491['query'],_0x58c29c['filters']),_0x420003);if(_0x545491['query']['filter']){_0x2c9148['where']=_[_0xe095('0x3e')](_0x2c9148[_0xe095('0x3b')],{'$or':_[_0xe095('0x31')](_0x420003,function(_0x395cbb){if(_0x395cbb[_0xe095('0x2d')]!==_0xe095('0x3f')){var _0x3f4410={};_0x3f4410[_0x395cbb[_0xe095('0x28')]]={'$like':'%'+_0x545491['query'][_0xe095('0x40')]+'%'};return _0x3f4410;}})});}_0x2c9148=_['merge']({},_0x2c9148,_0x545491['options']);var _0x464e87={'where':_0x2c9148[_0xe095('0x3b')]};return db[_0xe095('0x2b')][_0xe095('0x1e')](_0x464e87)[_0xe095('0x24')](function(_0x32ac02){_0x13e3da[_0xe095('0x1e')]=_0x32ac02;if(_0x545491['query'][_0xe095('0x41')]){_0x2c9148[_0xe095('0x42')]=[{'all':!![]}];}return db[_0xe095('0x2b')][_0xe095('0x43')](_0x2c9148);})['then'](function(_0x424af1){_0x13e3da[_0xe095('0x44')]=_0x424af1;return _0x13e3da;})[_0xe095('0x24')](respondWithFilteredResult(_0x3f9c2f,_0x2c9148))[_0xe095('0x45')](handleError(_0x3f9c2f,null));};exports['show']=function(_0x587ecb,_0x19c181){var _0x270962={'raw':![],'where':{'id':_0x587ecb[_0xe095('0x46')]['id']}},_0x296032={};_0x296032['model']=_[_0xe095('0x33')](db['VoiceRecording'][_0xe095('0x2c')]);_0x296032[_0xe095('0x35')]=_[_0xe095('0x33')](_0x587ecb[_0xe095('0x35')]);_0x296032['filters']=_[_0xe095('0x34')](_0x296032[_0xe095('0x2f')],_0x296032[_0xe095('0x35')]);_0x270962[_0xe095('0x36')]=_[_0xe095('0x34')](_0x296032['model'],qs['fields'](_0x587ecb[_0xe095('0x35')][_0xe095('0x37')]));_0x270962[_0xe095('0x36')]=_0x270962['attributes'][_0xe095('0x47')]?_0x270962['attributes']:_0x296032[_0xe095('0x2f')];if(_0x587ecb[_0xe095('0x35')][_0xe095('0x41')]){_0x270962[_0xe095('0x42')]=[{'all':!![]}];}_0x270962=_[_0xe095('0x3e')]({},_0x270962,_0x587ecb[_0xe095('0x48')]);return db[_0xe095('0x2b')][_0xe095('0x49')](_0x270962)['then'](handleEntityNotFound(_0x19c181,null))['then'](respondWithResult(_0x19c181,null))[_0xe095('0x45')](handleError(_0x19c181,null));};exports[_0xe095('0x4a')]=function(_0x3eba7a,_0x2d6530){return db[_0xe095('0x2b')][_0xe095('0x4a')](_0x3eba7a[_0xe095('0x4b')],{})['then'](respondWithResult(_0x2d6530,0xc9))['catch'](handleError(_0x2d6530,null));};exports[_0xe095('0x23')]=function(_0x42d92f,_0x3becba){if(_0x42d92f[_0xe095('0x4b')]['id']){delete _0x42d92f[_0xe095('0x4b')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x42d92f[_0xe095('0x46')]['id']}})['then'](handleEntityNotFound(_0x3becba,null))['then'](saveUpdates(_0x42d92f['body'],null))[_0xe095('0x24')](respondWithResult(_0x3becba,null))[_0xe095('0x45')](handleError(_0x3becba,null));};exports[_0xe095('0x4c')]=function(_0x2f3ee5,_0x13477c){return db[_0xe095('0x2b')][_0xe095('0x4c')]()[_0xe095('0x24')](respondWithResult(_0x13477c,null))['catch'](handleError(_0x13477c,null));};exports['download']=function(_0x50e58a,_0x59593b,_0x4fc926){var _0x284c93=require(_0xe095('0x4d'));var _0x4f57e1=![];var _0x159a05={};if(_0x50e58a[_0xe095('0x35')][_0xe095('0x2d')]&&_0x50e58a[_0xe095('0x35')][_0xe095('0x2d')]===_0xe095('0x4e')){_0x159a05[_0xe095('0x4e')]=_0x50e58a[_0xe095('0x46')]['id'];}else{_0x159a05['id']=_0x50e58a[_0xe095('0x46')]['id'];}return db[_0xe095('0x2b')][_0xe095('0x49')]({'where':_0x159a05,'attributes':['id',_0xe095('0x4f')],'raw':!![]})[_0xe095('0x24')](handleEntityNotFound(_0x59593b,null))['then'](function(_0x3304ce){if(_0x3304ce){var _0x2bf702=_0x3304ce[_0xe095('0x4f')];var _0x3d0e03=util[_0xe095('0x32')](_0xe095('0x50'),_0x2bf702);if(fs[_0xe095('0x51')](_0x3d0e03)){_0x4f57e1=!![];return _0x284c93[_0xe095('0x52')](_0x3d0e03,_0x2bf702,config[_0xe095('0x53')][_0xe095('0x54')])[_0xe095('0x24')](function(){return _0x3304ce;});}return _0x3304ce;}})['then'](function(_0x347d49){if(_0x347d49){var _0x1b4631=_0x347d49['value'];if(!fs['existsSync'](_0x1b4631)){throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))](_0xe095('0x57'));}if(_0x347d49['filename']){return _0x59593b[_0xe095('0x58')](_0x1b4631,_0x347d49['filename']+path[_0xe095('0x59')](_0x1b4631),function(){if(_0x4f57e1){fs['unlink'](_0x1b4631);}});}else{return _0x59593b[_0xe095('0x58')](_0x1b4631,function(_0x12e9cc){if(_0x4f57e1){fs[_0xe095('0x5a')](_0x1b4631);}});}}})['catch'](function(_0x2d391d){if(_0x2d391d[_0xe095('0x5b')]===_0xe095('0x57')){_0x59593b[_0xe095('0x19')](0x194)[_0xe095('0x29')]('Not\x20found');}else{return handleError(_0x59593b,null);}});};exports[_0xe095('0x5c')]=function(_0x37a0f4,_0x34593d,_0x4afe3a){var _0x5834b4=require(_0xe095('0x4d'));var _0x237857=![];var _0x3b9279={'$and':[db[_0xe095('0x5d')][_0xe095('0x3b')](db[_0xe095('0x5d')]['fn'](_0xe095('0x5e'),db['sequelize'][_0xe095('0x5f')](_0xe095('0x4e'))),_0x37a0f4['query'][_0xe095('0x60')])]};if(_0x37a0f4[_0xe095('0x35')][_0xe095('0x2d')]&&_0x37a0f4['query']['type']===_0xe095('0x4e')){_0x3b9279[_0xe095('0x61')][_0xe095('0x62')]({'uniqueid':_0x37a0f4[_0xe095('0x46')]['id']});}else{_0x3b9279['$and'][_0xe095('0x62')]({'id':_0x37a0f4[_0xe095('0x46')]['id']});}return db[_0xe095('0x2b')][_0xe095('0x49')]({'where':_0x3b9279,'attributes':['id','value'],'raw':!![]})[_0xe095('0x24')](handleEntityNotFound(_0x34593d,null))[_0xe095('0x24')](function(_0x1f3b87){if(_0x1f3b87){var _0x24c616=util[_0xe095('0x32')]('%s.cypher',_0x1f3b87[_0xe095('0x4f')]);if(fs[_0xe095('0x51')](_0x24c616)){_0x237857=!![];return _0x5834b4['decryptFile'](_0x24c616,_0x1f3b87[_0xe095('0x4f')],config[_0xe095('0x53')]['recording'])[_0xe095('0x24')](function(){return _0x1f3b87;});}return _0x1f3b87;}})[_0xe095('0x24')](function(_0x369469){if(_0x369469){if(!fs['existsSync'](_0x369469[_0xe095('0x4f')])){throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))](_0xe095('0x57'));}if(_0x369469[_0xe095('0x63')]){return _0x34593d[_0xe095('0x58')](_0x369469['value'],_0x369469[_0xe095('0x63')]+path[_0xe095('0x59')](_0x369469[_0xe095('0x4f')]),function(){if(_0x237857){fs[_0xe095('0x5a')](_0x369469[_0xe095('0x4f')]);}});}else{return _0x34593d[_0xe095('0x58')](_0x369469[_0xe095('0x4f')],function(_0x23df3c){if(_0x237857){fs['unlink'](_0x369469[_0xe095('0x4f')]);}});}}})[_0xe095('0x45')](handleError(_0x34593d,null));};exports[_0xe095('0x25')]=function(_0x1e1d98,_0x31904b){return db[_0xe095('0x2b')][_0xe095('0x49')]({'where':{'id':_0x1e1d98['params']['id']}})[_0xe095('0x24')](function(_0x200ea6){if(_[_0xe095('0x64')](_0x200ea6)){throw new ReferenceError(_0xe095('0x65'));}return _0x200ea6;})[_0xe095('0x24')](function(_0xef6a61){var _0xaf2612=_0xef6a61[_0xe095('0x4f')];logger[_0xe095('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xaf2612);if(!_[_0xe095('0x64')](_0xef6a61[_0xe095('0x4f')])&&fs['existsSync'](_0xaf2612)){logger['info']('File:\x20\x22'+_0xaf2612+_0xe095('0x67'));fs[_0xe095('0x68')](_0xaf2612);}_0xaf2612=_0xaf2612+_0xe095('0x69');if(!_[_0xe095('0x64')](_0xef6a61[_0xe095('0x4f')])&&fs['existsSync'](_0xaf2612)){logger[_0xe095('0x66')](_0xe095('0x6a')+_0xaf2612+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe095('0x68')](_0xaf2612);}return _0xef6a61;})[_0xe095('0x24')](function(_0x3adb2a){if(!_0x3adb2a)throw new InternalError();return _0x3adb2a[_0xe095('0x25')]();})[_0xe095('0x24')](function(){_0x31904b[_0xe095('0x19')](0xcc)[_0xe095('0x1a')]();})['catch'](handleError(_0x31904b,null));};function getBucketslist(_0x28dcbe,_0x2de452,_0x5f0cd4){return new Promise(function(_0x44f70d,_0x124c6a){var _0x1b4d9b=new AWS['S3']({'accessKeyId':_0x2de452,'secretAccessKey':_0x28dcbe,'region':_0x5f0cd4});_0x1b4d9b[_0xe095('0x6b')]({},function(_0x581173,_0x506c6a){if(_0x581173){return _0x124c6a(_0x581173);}else{return _0x44f70d(_0x506c6a);}});});}function createBucket(_0x3c7ecd,_0x2366a8,_0x12a9c7,_0x4faaa4){return new Promise(function(_0x7e80c,_0x5ecfa0){var _0x342cee=new AWS['S3']({'accessKeyId':_0x2366a8,'secretAccessKey':_0x3c7ecd,'region':_0x12a9c7});_0x342cee[_0xe095('0x6c')]({'Bucket':_0x4faaa4},function(_0x41d6d2,_0x93a25d){if(_0x41d6d2){return _0x5ecfa0(_0x41d6d2);}else{return _0x7e80c(_0x93a25d);}});});}function uploadFile(_0xa13c20,_0x220416,_0x17b4bf,_0x219510,_0x196de5,_0x2a2368){return new Promise(function(_0x2e3af9,_0x52bd18){var _0x203909=new AWS['S3']({'accessKeyId':_0x220416,'secretAccessKey':_0xa13c20,'region':_0x17b4bf});_0x203909[_0xe095('0x6d')]({'Bucket':_0x219510,'Key':_0x196de5,'Body':_0x2a2368},function(_0x34e091,_0x688d5d){if(_0x34e091){return _0x52bd18(_0x34e091);}else{return _0x2e3af9(_0x688d5d);}});});}function startTranscribe(_0x35adb1,_0x295060,_0x5aa5f7,_0x502327,_0x1e9457,_0x3679d5){return new Promise(function(_0x3154aa,_0x28c925){var _0xb576a0=new AWS['TranscribeService']({'accessKeyId':_0x295060,'secretAccessKey':_0x35adb1,'region':_0x5aa5f7});_0xb576a0[_0xe095('0x6e')]({'TranscriptionJobName':_0x502327,'LanguageCode':_0x1e9457,'Media':{'MediaFileUri':_0x3679d5}},function(_0x259109,_0x33aceb){if(_0x259109){return _0x28c925(_0x259109);}else{return _0x3154aa(_0x33aceb);}});});}function transcribe(_0x23378f,_0x538037,_0x192531,_0x17d2b7,_0x5c8a0c,_0x2cfbb5,_0xf16855){return new Promise(function(_0x13f70f,_0x4673c1){var _0x5190c3={};logger[_0xe095('0x66')](util['format'](_0xe095('0x6f'),_0x23378f,_0x5c8a0c));return uploadFile(_0x538037,_0x192531,_0x17d2b7,_0x5c8a0c,path[_0xe095('0x70')](_0x2cfbb5),fs[_0xe095('0x71')](_0x2cfbb5))[_0xe095('0x24')](function(_0x5d7385){logger[_0xe095('0x66')](util[_0xe095('0x32')](_0xe095('0x72'),_0x23378f,_0x5c8a0c,_0x5d7385[_0xe095('0x73')]));_0x5190c3[_0xe095('0x74')]=_0x5d7385[_0xe095('0x75')];_0x5190c3[_0xe095('0x76')]=_0x5d7385[_0xe095('0x73')];logger[_0xe095('0x66')](util[_0xe095('0x32')](_0xe095('0x77'),_0x23378f));return startTranscribe(_0x538037,_0x192531,_0x17d2b7,uuidv4(),_0xf16855,_0x5d7385[_0xe095('0x73')]);})['then'](function(_0x2d67c5){logger[_0xe095('0x66')](util[_0xe095('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x23378f,_0x2d67c5[_0xe095('0x78')][_0xe095('0x79')]));_0x5190c3[_0xe095('0x7a')]=_0x2d67c5['TranscriptionJob']['TranscriptionJobName'];_0x5190c3[_0xe095('0x7b')]=_0x2d67c5['TranscriptionJob'][_0xe095('0x7c')];return _0x13f70f(_0x5190c3);})[_0xe095('0x45')](function(_0x5c7c2a){return _0x4673c1(_0x5c7c2a);});});}exports['runTranscribe']=function(_0x543f04,_0x194909,_0x31b90e){var _0x743189;var _0x53cfca;var _0x5dfe08;var _0x3d87ad=require(_0xe095('0x4d'));return db['VoiceRecording'][_0xe095('0x7d')]({'where':{'id':_0x543f04[_0xe095('0x46')]['id']}})[_0xe095('0x24')](function(_0x31a625){if(_0x31a625){var _0x11390d=util[_0xe095('0x32')](_0xe095('0x50'),_0x31a625['value']);if(fs[_0xe095('0x51')](_0x11390d)){cypher=!![];return _0x3d87ad[_0xe095('0x52')](_0x11390d,_0x31a625['value'],config[_0xe095('0x53')][_0xe095('0x54')])[_0xe095('0x24')](function(){return _0x31a625;});}return _0x31a625;}})['then'](function(_0x12f176){if(!_0x12f176){throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))](_0xe095('0x7e'));}_0x53cfca=_0x12f176;return db['Setting'][_0xe095('0x7d')]({'where':{'id':0x1}});})[_0xe095('0x24')](handleEntityNotFound(_0x194909,null))['then'](function(_0x57e213){if(_0x57e213){_0x743189=_0x57e213;if(!_0x743189['transcribe']||!_0x743189[_0xe095('0x7f')]||!_0x743189['transcribeRegion']||!_0x743189[_0xe095('0x80')]||!_0x743189[_0xe095('0x74')]){throw new db['Sequelize'][(_0xe095('0x56'))](_0xe095('0x81'));}if(_0x543f04[_0xe095('0x4b')][_0xe095('0x82')]&&(!_0x743189[_0xe095('0x83')]||!_0x743189['sentimentAccountId']||!_0x743189[_0xe095('0x84')]||!_0x743189['language']||!_0x743189[_0xe095('0x74')])){throw new db[(_0xe095('0x55'))]['ValidationError'](_0xe095('0x85'));}return db[_0xe095('0x86')]['findOne']({'where':{'id':_0x743189[_0xe095('0x7f')]}});}})[_0xe095('0x24')](function(_0x2be3c9){if(!_0x2be3c9){throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))](_0xe095('0x87'));}if(!_0x2be3c9[_0xe095('0x88')]||!_0x2be3c9['data2']){throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))](_0xe095('0x89'));}_0x5dfe08=_0x2be3c9;return getBucketslist(_0x5dfe08[_0xe095('0x88')],_0x5dfe08['data2'],_0x743189[_0xe095('0x8a')]);})[_0xe095('0x24')](function(_0x238ea3){if(_0x238ea3&&_0x238ea3[_0xe095('0x8b')]){var _0x375d53=_[_0xe095('0x49')](_0x238ea3[_0xe095('0x8b')],function(_0x32024f){return _0x32024f[_0xe095('0x8c')]===_0x743189['bucket'];});if(!_0x375d53){logger[_0xe095('0x66')](util['format'](_0xe095('0x8d'),_0x543f04['params']['id'],_0x743189['bucket']));return createBucket(_0x5dfe08[_0xe095('0x88')],_0x5dfe08['data2'],_0x743189[_0xe095('0x8a')],_0x743189[_0xe095('0x74')]);}logger['info'](util[_0xe095('0x32')](_0xe095('0x8e'),_0x543f04[_0xe095('0x46')]['id'],_0x743189['bucket']));return;}})[_0xe095('0x24')](function(_0x3666fe){if(_0x53cfca[_0xe095('0x7b')]===_0xe095('0x8f')){return transcribe(_0x543f04['params']['id'],_0x5dfe08[_0xe095('0x88')],_0x5dfe08[_0xe095('0x90')],_0x743189['transcribeRegion'],_0x743189['bucket'],_0x53cfca[_0xe095('0x4f')],_0x743189[_0xe095('0x80')]);}else{logger[_0xe095('0x66')](util[_0xe095('0x32')](_0xe095('0x91'),_0x543f04['params']['id']));return{'transcribeStatus':_0xe095('0x92')};}})[_0xe095('0x24')](function(_0x500e91){if(_0x500e91){_0x500e91[_0xe095('0x93')]=_0x543f04[_0xe095('0x4b')][_0xe095('0x82')];return _0x53cfca[_0xe095('0x94')](_0x500e91);}})[_0xe095('0x24')](respondWithResult(_0x194909,null))[_0xe095('0x45')](handleError(_0x194909,null));};function writeFile(_0x228eb2,_0xff29f8){return new Promise(function(_0x2724ed,_0x196e9f){fs[_0xe095('0x95')](_0xff29f8,_0x228eb2,function(_0x3f1ea7,_0x452b85){if(_0x3f1ea7){return _0x196e9f(_0x3f1ea7);}else{return _0x2724ed(_0x452b85);}});});}exports['downloadTranscribe']=function(_0x3e78e9,_0x350ccb,_0x2803ed){return db[_0xe095('0x2b')][_0xe095('0x7d')]({'where':{'id':_0x3e78e9[_0xe095('0x46')]['id']}})[_0xe095('0x24')](handleEntityNotFound(_0x350ccb))[_0xe095('0x24')](function(_0xa24235){if(_0xa24235&&_0xa24235[_0xe095('0x96')]){var _0x317c13=_0xa24235['fileText'];var _0x180f8b=config['root']+_0xe095('0x97')+_0xa24235['id']+_0xe095('0x98');if(fs['existsSync'](_0x180f8b)){return _0x180f8b;}return writeFile(_0x317c13,_0x180f8b)['then'](function(){return _0x180f8b;});}else{throw new db[(_0xe095('0x55'))][(_0xe095('0x56'))]('Transcript\x20not\x20available');}})[_0xe095('0x24')](function(_0x138b7b){return _0x350ccb[_0xe095('0x58')](_0x138b7b);})[_0xe095('0x45')](handleError(_0x350ccb));}; \ No newline at end of file +var _0x95d7=['merge','filter','includeAll','findAll','catch','params','rawAttributes','include','options','create','body','find','describe','download','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','../../components/encryptor','sequelize','MD5','token','$and','push','filename','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','TranscribeService','startTranscriptionJob','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','VoiceRecording','fieldName','type','key','differenceBy','map','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x3bb120,_0x581ad9){var _0x3732e2=function(_0x20d8eb){while(--_0x20d8eb){_0x3bb120['push'](_0x3bb120['shift']());}};_0x3732e2(++_0x581ad9);}(_0x95d7,0xf8));var _0x795d=function(_0x59772d,_0x52ad7e){_0x59772d=_0x59772d-0x0;var _0x34c035=_0x95d7[_0x59772d];return _0x34c035;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x795d('0x0'));var zipdir=require(_0x795d('0x1'));var jsonpatch=require(_0x795d('0x2'));var rp=require(_0x795d('0x3'));var moment=require(_0x795d('0x4'));var BPromise=require(_0x795d('0x5'));var Mustache=require(_0x795d('0x6'));var util=require(_0x795d('0x7'));var path=require(_0x795d('0x8'));var sox=require('sox');var csv=require(_0x795d('0x9'));var ejs=require(_0x795d('0xa'));var fs=require('fs');var fs_extra=require(_0x795d('0xb'));var _=require(_0x795d('0xc'));var squel=require(_0x795d('0xd'));var crypto=require(_0x795d('0xe'));var jsforce=require(_0x795d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x795d('0x9'));var querystring=require(_0x795d('0x10'));var Papa=require(_0x795d('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0x795d('0x12'));var Redis=require(_0x795d('0x13'));var authService=require(_0x795d('0x14'));var qs=require(_0x795d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x795d('0x16'));var logger=require(_0x795d('0x17'))(_0x795d('0x18'));var utils=require(_0x795d('0x19'));var config=require(_0x795d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x795d('0x1b'))['db'];function respondWithStatusCode(_0x340df8,_0x2bf441){_0x2bf441=_0x2bf441||0xcc;return function(_0x1e37bd){if(_0x1e37bd){return _0x340df8[_0x795d('0x1c')](_0x2bf441);}return _0x340df8[_0x795d('0x1d')](_0x2bf441)[_0x795d('0x1e')]();};}function respondWithResult(_0xb99009,_0x4c4c7f){_0x4c4c7f=_0x4c4c7f||0xc8;return function(_0x54ee73){if(_0x54ee73){return _0xb99009[_0x795d('0x1d')](_0x4c4c7f)[_0x795d('0x1f')](_0x54ee73);}};}function respondWithFilteredResult(_0x32b448,_0x2857f1){return function(_0x58e064){if(_0x58e064){var _0x218077=typeof _0x2857f1[_0x795d('0x20')]===_0x795d('0x21')&&typeof _0x2857f1[_0x795d('0x22')]===_0x795d('0x21');var _0x56ec6a=_0x58e064[_0x795d('0x23')];var _0x4c2f3a=_0x218077?0x0:_0x2857f1['offset'];var _0x536446=_0x218077?_0x58e064[_0x795d('0x23')]:_0x2857f1['offset']+_0x2857f1[_0x795d('0x22')];var _0x418272;if(_0x536446>=_0x56ec6a){_0x536446=_0x56ec6a;_0x418272=0xc8;}else{_0x418272=0xce;}_0x32b448[_0x795d('0x1d')](_0x418272);return _0x32b448[_0x795d('0x24')](_0x795d('0x25'),_0x4c2f3a+'-'+_0x536446+'/'+_0x56ec6a)[_0x795d('0x1f')](_0x58e064);}return null;};}function patchUpdates(_0x2612d7){return function(_0xeb4050){try{jsonpatch[_0x795d('0x26')](_0xeb4050,_0x2612d7,!![]);}catch(_0x2c663e){return BPromise[_0x795d('0x27')](_0x2c663e);}return _0xeb4050[_0x795d('0x28')]();};}function saveUpdates(_0x6ab64b,_0x2703c9){return function(_0x1b3d5b){if(_0x1b3d5b){return _0x1b3d5b[_0x795d('0x29')](_0x6ab64b)[_0x795d('0x2a')](function(_0x30cda1){return _0x30cda1;});}return null;};}function removeEntity(_0x2bc218,_0x22f5d1){return function(_0x27bd5a){if(_0x27bd5a){return _0x27bd5a[_0x795d('0x2b')]()[_0x795d('0x2a')](function(){_0x2bc218['status'](0xcc)[_0x795d('0x1e')]();});}};}function handleEntityNotFound(_0x34e524,_0x5ad91b){return function(_0x1dcab3){if(!_0x1dcab3){_0x34e524['sendStatus'](0x194);}return _0x1dcab3;};}function handleError(_0x307108,_0x21694f){_0x21694f=_0x21694f||0x1f4;return function(_0x43a212){logger['error'](_0x43a212[_0x795d('0x2c')]);if(_0x43a212[_0x795d('0x2d')]){delete _0x43a212[_0x795d('0x2d')];}_0x307108[_0x795d('0x1d')](_0x21694f)[_0x795d('0x2e')](_0x43a212);};}exports['index']=function(_0x24b04d,_0x49daa1){var _0x4fc760={},_0x463ead={},_0x34aa1={'count':0x0,'rows':[]};var _0xc5d4bd=_['map'](db[_0x795d('0x2f')]['rawAttributes'],function(_0x302201){return{'name':_0x302201[_0x795d('0x30')],'type':_0x302201[_0x795d('0x31')][_0x795d('0x32')]};});_0x463ead['model']=_[_0x795d('0x33')](_[_0x795d('0x34')](_0xc5d4bd,_0x795d('0x2d')),[_0x795d('0x35')]);_0x463ead[_0x795d('0x36')]=_[_0x795d('0x37')](_0x24b04d['query']);_0x463ead[_0x795d('0x38')]=_[_0x795d('0x39')](_0x463ead[_0x795d('0x3a')],_0x463ead[_0x795d('0x36')]);_0x4fc760['attributes']=_[_0x795d('0x39')](_0x463ead[_0x795d('0x3a')],qs[_0x795d('0x3b')](_0x24b04d[_0x795d('0x36')][_0x795d('0x3b')]));_0x4fc760[_0x795d('0x3c')]=_0x4fc760['attributes'][_0x795d('0x3d')]?_0x4fc760[_0x795d('0x3c')]:_0x463ead[_0x795d('0x3a')];if(!_0x24b04d[_0x795d('0x36')][_0x795d('0x3e')](_0x795d('0x3f'))){_0x4fc760['limit']=qs['limit'](_0x24b04d[_0x795d('0x36')][_0x795d('0x22')]);_0x4fc760[_0x795d('0x20')]=qs[_0x795d('0x20')](_0x24b04d[_0x795d('0x36')][_0x795d('0x20')]);}_0x4fc760[_0x795d('0x40')]=qs[_0x795d('0x41')](_0x24b04d[_0x795d('0x36')][_0x795d('0x41')]);_0x4fc760['where']=qs[_0x795d('0x38')](_[_0x795d('0x42')](_0x24b04d[_0x795d('0x36')],_0x463ead['filters']),_0xc5d4bd);if(_0x24b04d[_0x795d('0x36')]['filter']){_0x4fc760[_0x795d('0x43')]=_[_0x795d('0x44')](_0x4fc760[_0x795d('0x43')],{'$or':_[_0x795d('0x34')](_0xc5d4bd,function(_0x4a7a57){if(_0x4a7a57[_0x795d('0x31')]!=='VIRTUAL'){var _0x1e78b6={};_0x1e78b6[_0x4a7a57[_0x795d('0x2d')]]={'$like':'%'+_0x24b04d[_0x795d('0x36')][_0x795d('0x45')]+'%'};return _0x1e78b6;}})});}_0x4fc760=_[_0x795d('0x44')]({},_0x4fc760,_0x24b04d['options']);var _0x30fd32={'where':_0x4fc760['where']};return db[_0x795d('0x2f')][_0x795d('0x23')](_0x30fd32)[_0x795d('0x2a')](function(_0x26fdc1){_0x34aa1[_0x795d('0x23')]=_0x26fdc1;if(_0x24b04d[_0x795d('0x36')][_0x795d('0x46')]){_0x4fc760['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x795d('0x47')](_0x4fc760);})[_0x795d('0x2a')](function(_0x5ba037){_0x34aa1['rows']=_0x5ba037;return _0x34aa1;})[_0x795d('0x2a')](respondWithFilteredResult(_0x49daa1,_0x4fc760))[_0x795d('0x48')](handleError(_0x49daa1,null));};exports['show']=function(_0x343708,_0x4a6fc2){var _0x5686fb={'raw':![],'where':{'id':_0x343708[_0x795d('0x49')]['id']}},_0x586a36={};_0x586a36[_0x795d('0x3a')]=_[_0x795d('0x37')](db[_0x795d('0x2f')][_0x795d('0x4a')]);_0x586a36[_0x795d('0x36')]=_[_0x795d('0x37')](_0x343708['query']);_0x586a36[_0x795d('0x38')]=_[_0x795d('0x39')](_0x586a36['model'],_0x586a36[_0x795d('0x36')]);_0x5686fb[_0x795d('0x3c')]=_[_0x795d('0x39')](_0x586a36['model'],qs[_0x795d('0x3b')](_0x343708[_0x795d('0x36')]['fields']));_0x5686fb[_0x795d('0x3c')]=_0x5686fb[_0x795d('0x3c')][_0x795d('0x3d')]?_0x5686fb['attributes']:_0x586a36[_0x795d('0x3a')];if(_0x343708[_0x795d('0x36')][_0x795d('0x46')]){_0x5686fb[_0x795d('0x4b')]=[{'all':!![]}];}_0x5686fb=_['merge']({},_0x5686fb,_0x343708[_0x795d('0x4c')]);return db[_0x795d('0x2f')]['find'](_0x5686fb)[_0x795d('0x2a')](handleEntityNotFound(_0x4a6fc2,null))['then'](respondWithResult(_0x4a6fc2,null))['catch'](handleError(_0x4a6fc2,null));};exports['create']=function(_0x262fa0,_0x52f014){return db['VoiceRecording'][_0x795d('0x4d')](_0x262fa0[_0x795d('0x4e')],{})[_0x795d('0x2a')](respondWithResult(_0x52f014,0xc9))['catch'](handleError(_0x52f014,null));};exports['update']=function(_0x2937e1,_0x5159eb){if(_0x2937e1[_0x795d('0x4e')]['id']){delete _0x2937e1[_0x795d('0x4e')]['id'];}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':{'id':_0x2937e1[_0x795d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5159eb,null))[_0x795d('0x2a')](saveUpdates(_0x2937e1[_0x795d('0x4e')],null))[_0x795d('0x2a')](respondWithResult(_0x5159eb,null))['catch'](handleError(_0x5159eb,null));};exports[_0x795d('0x50')]=function(_0x59e352,_0x5a12d5){return db[_0x795d('0x2f')]['describe']()[_0x795d('0x2a')](respondWithResult(_0x5a12d5,null))[_0x795d('0x48')](handleError(_0x5a12d5,null));};exports[_0x795d('0x51')]=function(_0xf01033,_0x1f10b8,_0x48918c){var _0x5383cb=require('../../components/encryptor');var _0x543d2e=![];var _0x19be83={};if(_0xf01033[_0x795d('0x36')]['type']&&_0xf01033['query'][_0x795d('0x31')]===_0x795d('0x52')){_0x19be83['uniqueid']=_0xf01033[_0x795d('0x49')]['id'];}else{_0x19be83['id']=_0xf01033[_0x795d('0x49')]['id'];}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':_0x19be83,'attributes':['id',_0x795d('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x1f10b8,null))[_0x795d('0x2a')](function(_0x1e23f2){if(_0x1e23f2){var _0x344fdf=_0x1e23f2[_0x795d('0x53')];var _0x1756ae=util['format']('%s.cypher',_0x344fdf);if(fs[_0x795d('0x54')](_0x1756ae)){_0x543d2e=!![];return _0x5383cb[_0x795d('0x55')](_0x1756ae,_0x344fdf,config[_0x795d('0x56')][_0x795d('0x57')])[_0x795d('0x2a')](function(){return _0x1e23f2;});}return _0x1e23f2;}})[_0x795d('0x2a')](function(_0x38be74){if(_0x38be74){var _0xaae14c=_0x38be74[_0x795d('0x53')];if(!fs['existsSync'](_0xaae14c)){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x38be74['filename']){return _0x1f10b8[_0x795d('0x51')](_0xaae14c,_0x38be74['filename']+path[_0x795d('0x5a')](_0xaae14c),function(){if(_0x543d2e){fs[_0x795d('0x5b')](_0xaae14c);}});}else{return _0x1f10b8['download'](_0xaae14c,function(_0x569d8d){if(_0x543d2e){fs[_0x795d('0x5b')](_0xaae14c);}});}}})['catch'](function(_0x4cc1bd){if(_0x4cc1bd[_0x795d('0x5c')]===_0x795d('0x5d')){_0x1f10b8[_0x795d('0x1d')](0x194)[_0x795d('0x2e')](_0x795d('0x5e'));}else{return handleError(_0x1f10b8,null);}});};exports['downloads']=function(_0x17019d,_0xaa26b5,_0x18a4c0){var _0x5a8019=require(_0x795d('0x5f'));var _0xf3643a=![];var _0x42fa7b={'$and':[db[_0x795d('0x60')][_0x795d('0x43')](db[_0x795d('0x60')]['fn'](_0x795d('0x61'),db[_0x795d('0x60')]['col'](_0x795d('0x52'))),_0x17019d[_0x795d('0x36')][_0x795d('0x62')])]};if(_0x17019d[_0x795d('0x36')]['type']&&_0x17019d[_0x795d('0x36')][_0x795d('0x31')]==='uniqueid'){_0x42fa7b[_0x795d('0x63')][_0x795d('0x64')]({'uniqueid':_0x17019d[_0x795d('0x49')]['id']});}else{_0x42fa7b['$and'][_0x795d('0x64')]({'id':_0x17019d[_0x795d('0x49')]['id']});}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':_0x42fa7b,'attributes':['id','value'],'raw':!![]})[_0x795d('0x2a')](handleEntityNotFound(_0xaa26b5,null))[_0x795d('0x2a')](function(_0x172552){if(_0x172552){var _0xebcb2f=util['format']('%s.cypher',_0x172552['value']);if(fs[_0x795d('0x54')](_0xebcb2f)){_0xf3643a=!![];return _0x5a8019[_0x795d('0x55')](_0xebcb2f,_0x172552[_0x795d('0x53')],config['secrets'][_0x795d('0x57')])[_0x795d('0x2a')](function(){return _0x172552;});}return _0x172552;}})[_0x795d('0x2a')](function(_0x7f6013){if(_0x7f6013){if(!fs[_0x795d('0x54')](_0x7f6013[_0x795d('0x53')])){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x5d'));}if(_0x7f6013[_0x795d('0x65')]){return _0xaa26b5[_0x795d('0x51')](_0x7f6013[_0x795d('0x53')],_0x7f6013[_0x795d('0x65')]+path['extname'](_0x7f6013[_0x795d('0x53')]),function(){if(_0xf3643a){fs[_0x795d('0x5b')](_0x7f6013['value']);}});}else{return _0xaa26b5[_0x795d('0x51')](_0x7f6013['value'],function(_0x184480){if(_0xf3643a){fs['unlink'](_0x7f6013['value']);}});}}})['catch'](handleError(_0xaa26b5,null));};exports['destroy']=function(_0x42f0b8,_0xd8ec5e){return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':{'id':_0x42f0b8[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](function(_0x5ba5e7){if(_[_0x795d('0x66')](_0x5ba5e7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5ba5e7;})[_0x795d('0x2a')](function(_0x1a2d65){var _0x316164=_0x1a2d65[_0x795d('0x53')];logger[_0x795d('0x67')](_0x795d('0x68'),_0x316164);if(!_['isNil'](_0x1a2d65[_0x795d('0x53')])&&fs[_0x795d('0x54')](_0x316164)){logger[_0x795d('0x67')](_0x795d('0x69')+_0x316164+_0x795d('0x6a'));fs['unlinkSync'](_0x316164);}_0x316164=_0x316164+_0x795d('0x6b');if(!_[_0x795d('0x66')](_0x1a2d65['value'])&&fs[_0x795d('0x54')](_0x316164)){logger[_0x795d('0x67')]('File:\x20\x22'+_0x316164+_0x795d('0x6a'));fs[_0x795d('0x6c')](_0x316164);}return _0x1a2d65;})['then'](function(_0x816338){if(!_0x816338)throw new InternalError();return _0x816338[_0x795d('0x2b')]();})[_0x795d('0x2a')](function(){_0xd8ec5e[_0x795d('0x1d')](0xcc)[_0x795d('0x1e')]();})[_0x795d('0x48')](handleError(_0xd8ec5e,null));};function getBucketslist(_0x3120f4,_0xfb5c27,_0x12ebae){return new Promise(function(_0x438238,_0x542a50){var _0x277e4b=new AWS['S3']({'accessKeyId':_0xfb5c27,'secretAccessKey':_0x3120f4,'region':_0x12ebae});_0x277e4b[_0x795d('0x6d')]({},function(_0x4f94b5,_0x10738a){if(_0x4f94b5){return _0x542a50(_0x4f94b5);}else{return _0x438238(_0x10738a);}});});}function createBucket(_0x1fa5f7,_0x44ae0f,_0x2ccc41,_0x140be3){return new Promise(function(_0x3cdc4d,_0x6a535){var _0x2d4780=new AWS['S3']({'accessKeyId':_0x44ae0f,'secretAccessKey':_0x1fa5f7,'region':_0x2ccc41});_0x2d4780['createBucket']({'Bucket':_0x140be3},function(_0x5bcda3,_0x4775ab){if(_0x5bcda3){return _0x6a535(_0x5bcda3);}else{return _0x3cdc4d(_0x4775ab);}});});}function uploadFile(_0x110d30,_0x22f9b1,_0x2fd373,_0x5eb956,_0x50d64a,_0x5402ed){return new Promise(function(_0x9981e1,_0xfd4459){var _0x10c2af=new AWS['S3']({'accessKeyId':_0x22f9b1,'secretAccessKey':_0x110d30,'region':_0x2fd373});_0x10c2af['upload']({'Bucket':_0x5eb956,'Key':_0x50d64a,'Body':_0x5402ed},function(_0x5d1d35,_0x4a5a4e){if(_0x5d1d35){return _0xfd4459(_0x5d1d35);}else{return _0x9981e1(_0x4a5a4e);}});});}function startTranscribe(_0x447823,_0x6d9b42,_0x43fd3e,_0x40eb71,_0x4e8dc9,_0x27446b){return new Promise(function(_0x46a98c,_0x55635d){var _0x2fdcd1=new AWS[(_0x795d('0x6e'))]({'accessKeyId':_0x6d9b42,'secretAccessKey':_0x447823,'region':_0x43fd3e});_0x2fdcd1[_0x795d('0x6f')]({'TranscriptionJobName':_0x40eb71,'LanguageCode':_0x4e8dc9,'Media':{'MediaFileUri':_0x27446b}},function(_0x3c2a02,_0x45a48e){if(_0x3c2a02){return _0x55635d(_0x3c2a02);}else{return _0x46a98c(_0x45a48e);}});});}function transcribe(_0x380dfd,_0x41559d,_0x57d2f4,_0x509fb3,_0xd39250,_0xdb92ea,_0x3e31d6){return new Promise(function(_0x16939d,_0x3d256f){var _0x43aa28={};logger['info'](util[_0x795d('0x35')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x380dfd,_0xd39250));return uploadFile(_0x41559d,_0x57d2f4,_0x509fb3,_0xd39250,path[_0x795d('0x70')](_0xdb92ea),fs[_0x795d('0x71')](_0xdb92ea))[_0x795d('0x2a')](function(_0x22bd68){logger[_0x795d('0x67')](util[_0x795d('0x35')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x380dfd,_0xd39250,_0x22bd68['Location']));_0x43aa28[_0x795d('0x72')]=_0x22bd68[_0x795d('0x73')];_0x43aa28[_0x795d('0x74')]=_0x22bd68[_0x795d('0x75')];logger[_0x795d('0x67')](util['format'](_0x795d('0x76'),_0x380dfd));return startTranscribe(_0x41559d,_0x57d2f4,_0x509fb3,uuidv4(),_0x3e31d6,_0x22bd68[_0x795d('0x75')]);})[_0x795d('0x2a')](function(_0x559575){logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x77'),_0x380dfd,_0x559575[_0x795d('0x78')][_0x795d('0x79')]));_0x43aa28[_0x795d('0x7a')]=_0x559575[_0x795d('0x78')]['TranscriptionJobName'];_0x43aa28[_0x795d('0x7b')]=_0x559575[_0x795d('0x78')][_0x795d('0x7c')];return _0x16939d(_0x43aa28);})['catch'](function(_0x17068a){return _0x3d256f(_0x17068a);});});}exports[_0x795d('0x7d')]=function(_0x3cb9bc,_0x3c1077,_0xc98bb5){var _0xfb1b85;var _0x2d57c8;var _0x5d13ee;var _0x5c95f2=require(_0x795d('0x5f'));return db[_0x795d('0x2f')][_0x795d('0x7e')]({'where':{'id':_0x3cb9bc[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](function(_0x311fca){if(_0x311fca){var _0x2df3a0=util[_0x795d('0x35')]('%s.cypher',_0x311fca[_0x795d('0x53')]);if(fs[_0x795d('0x54')](_0x2df3a0)){cypher=!![];return _0x5c95f2[_0x795d('0x55')](_0x2df3a0,_0x311fca['value'],config[_0x795d('0x56')]['recording'])[_0x795d('0x2a')](function(){return _0x311fca;});}return _0x311fca;}})[_0x795d('0x2a')](function(_0x27febe){if(!_0x27febe){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x7f'));}_0x2d57c8=_0x27febe;return db[_0x795d('0x80')]['findOne']({'where':{'id':0x1}});})[_0x795d('0x2a')](handleEntityNotFound(_0x3c1077,null))[_0x795d('0x2a')](function(_0x33234e){if(_0x33234e){_0xfb1b85=_0x33234e;if(!_0xfb1b85[_0x795d('0x81')]||!_0xfb1b85[_0x795d('0x82')]||!_0xfb1b85[_0x795d('0x83')]||!_0xfb1b85[_0x795d('0x84')]||!_0xfb1b85[_0x795d('0x72')]){throw new db['Sequelize']['ValidationError'](_0x795d('0x85'));}if(_0x3cb9bc[_0x795d('0x4e')]['runSentiment']&&(!_0xfb1b85[_0x795d('0x86')]||!_0xfb1b85[_0x795d('0x87')]||!_0xfb1b85[_0x795d('0x88')]||!_0xfb1b85[_0x795d('0x84')]||!_0xfb1b85[_0x795d('0x72')])){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x89'));}return db[_0x795d('0x8a')][_0x795d('0x7e')]({'where':{'id':_0xfb1b85[_0x795d('0x82')]}});}})[_0x795d('0x2a')](function(_0x1adca8){if(!_0x1adca8){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x8b'));}if(!_0x1adca8[_0x795d('0x8c')]||!_0x1adca8[_0x795d('0x8d')]){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x8e'));}_0x5d13ee=_0x1adca8;return getBucketslist(_0x5d13ee[_0x795d('0x8c')],_0x5d13ee[_0x795d('0x8d')],_0xfb1b85[_0x795d('0x83')]);})[_0x795d('0x2a')](function(_0x5e8aab){if(_0x5e8aab&&_0x5e8aab[_0x795d('0x8f')]){var _0x2ba3b7=_[_0x795d('0x4f')](_0x5e8aab['Buckets'],function(_0x69a237){return _0x69a237[_0x795d('0x90')]===_0xfb1b85[_0x795d('0x72')];});if(!_0x2ba3b7){logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x91'),_0x3cb9bc[_0x795d('0x49')]['id'],_0xfb1b85[_0x795d('0x72')]));return createBucket(_0x5d13ee[_0x795d('0x8c')],_0x5d13ee[_0x795d('0x8d')],_0xfb1b85['transcribeRegion'],_0xfb1b85['bucket']);}logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x92'),_0x3cb9bc[_0x795d('0x49')]['id'],_0xfb1b85[_0x795d('0x72')]));return;}})['then'](function(_0x3018e3){if(_0x2d57c8[_0x795d('0x7b')]===_0x795d('0x93')){return transcribe(_0x3cb9bc[_0x795d('0x49')]['id'],_0x5d13ee['data1'],_0x5d13ee['data2'],_0xfb1b85[_0x795d('0x83')],_0xfb1b85[_0x795d('0x72')],_0x2d57c8[_0x795d('0x53')],_0xfb1b85[_0x795d('0x84')]);}else{logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x94'),_0x3cb9bc['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x795d('0x2a')](function(_0x4cf610){if(_0x4cf610){_0x4cf610['tempSentiment']=_0x3cb9bc['body'][_0x795d('0x95')];return _0x2d57c8[_0x795d('0x96')](_0x4cf610);}})[_0x795d('0x2a')](respondWithResult(_0x3c1077,null))[_0x795d('0x48')](handleError(_0x3c1077,null));};function writeFile(_0x12cee7,_0x105513){return new Promise(function(_0x2e2874,_0x15568d){fs[_0x795d('0x97')](_0x105513,_0x12cee7,function(_0x468b12,_0x14067c){if(_0x468b12){return _0x15568d(_0x468b12);}else{return _0x2e2874(_0x14067c);}});});}exports[_0x795d('0x98')]=function(_0x4d1bb9,_0x4bb8e8,_0x2a2361){return db[_0x795d('0x2f')][_0x795d('0x7e')]({'where':{'id':_0x4d1bb9[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](handleEntityNotFound(_0x4bb8e8))['then'](function(_0x29075f){if(_0x29075f&&_0x29075f[_0x795d('0x99')]){var _0x2006e0=_0x29075f['fileText'];var _0x393aaa=config[_0x795d('0x9a')]+_0x795d('0x9b')+_0x29075f['id']+_0x795d('0x9c');if(fs[_0x795d('0x54')](_0x393aaa)){return _0x393aaa;}return writeFile(_0x2006e0,_0x393aaa)[_0x795d('0x2a')](function(){return _0x393aaa;});}else{throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x9d'));}})[_0x795d('0x2a')](function(_0x309344){return _0x4bb8e8[_0x795d('0x51')](_0x309344);})[_0x795d('0x48')](handleError(_0x4bb8e8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7424a99..14ec1b6 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 _0xf323=['uniqueid','transcribeStatus','VoiceRecording','voice_recordings'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0xf323,0x1c6));var _0x3f32=function(_0x3918d4,_0x2faa75){_0x3918d4=_0x3918d4-0x0;var _0x59f74e=_0xf323[_0x3918d4];return _0x59f74e;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x248da8,_0x11ce0a){return _0x248da8['define'](_0x3f32('0x0'),attributes,{'tableName':_0x3f32('0x1'),'paranoid':![],'indexes':[{'name':_0x3f32('0x2'),'fields':[_0x3f32('0x2')]},{'name':_0x3f32('0x3'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ef1=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x4fc79a,_0x1fd4e2){var _0x216ba5=function(_0x18848c){while(--_0x18848c){_0x4fc79a['push'](_0x4fc79a['shift']());}};_0x216ba5(++_0x1fd4e2);}(_0x4ef1,0xeb));var _0x14ef=function(_0x17e2ac,_0x51a8c5){_0x17e2ac=_0x17e2ac-0x0;var _0x44d3e9=_0x4ef1[_0x17e2ac];return _0x44d3e9;};'use strict';var attributes=require(_0x14ef('0x0'));module[_0x14ef('0x1')]=function(_0x52e89c,_0x4136b4){return _0x52e89c[_0x14ef('0x2')](_0x14ef('0x3'),attributes,{'tableName':_0x14ef('0x4'),'paranoid':![],'indexes':[{'name':_0x14ef('0x5'),'fields':[_0x14ef('0x5')]},{'name':_0x14ef('0x6'),'fields':[_0x14ef('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d8b69b4..674ddc5 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 _0x5430=['info','request\x20sent','debug','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','VoiceRecording','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','body','existsSync','format','%s.cypher','value','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x5e667a,_0x167797){var _0x1492ad=function(_0x16c782){while(--_0x16c782){_0x5e667a['push'](_0x5e667a['shift']());}};_0x1492ad(++_0x167797);}(_0x5430,0x10c));var _0x0543=function(_0x5c3b92,_0x55745b){_0x5c3b92=_0x5c3b92-0x0;var _0x57233b=_0x5430[_0x5c3b92];return _0x57233b;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}exports[_0x0543('0x15')]=function(_0x20b396){var _0x285080=this;return new Promise(function(_0x577cf0,_0x5eb03e){return db[_0x0543('0x16')]['update'](_0x20b396['body'],{'raw':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b396['options']?_0x20b396[_0x0543('0x17')]['where']||null:null,'attributes':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')]['attributes']||null:null,'limit':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x19')]||null:null})[_0x0543('0xb')](function(_0x37347e){logger[_0x0543('0xc')]('UpdateVoiceRecording',_0x20b396);logger['debug']('UpdateVoiceRecording',_0x20b396,JSON[_0x0543('0xf')](_0x37347e));_0x577cf0(_0x37347e);})[_0x0543('0x1a')](function(_0x15ebeb){logger[_0x0543('0x10')](_0x0543('0x15'),_0x15ebeb[_0x0543('0x13')],_0x20b396);_0x5eb03e(_0x285080[_0x0543('0x10')](0x1f4,_0x15ebeb[_0x0543('0x13')]));});});};exports[_0x0543('0x1b')]=function(_0xf1eccf){var _0x40a261=this;return new Promise(function(_0x21fc63,_0x547a88){var _0x25e6f1=require(_0x0543('0x1c'));var _0x30ad9e;return db['Setting'][_0x0543('0x1d')]({'attributes':['id',_0x0543('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0543('0xb')](function(_0x10b881){_0x30ad9e=_0x10b881;return db['VoiceRecording'][_0x0543('0x1f')](_0xf1eccf[_0x0543('0x20')]);})['then'](function(_0x576084){if(_0x30ad9e[_0x0543('0x1e')]&&fs[_0x0543('0x21')](_0x576084['value'])){var _0x3b879b=util[_0x0543('0x22')](_0x0543('0x23'),_0x576084[_0x0543('0x24')]);return _0x25e6f1[_0x0543('0x25')](_0x576084[_0x0543('0x24')],_0x3b879b,config[_0x0543('0x26')]['recording'])[_0x0543('0xb')](function(){fs['unlink'](_0x576084[_0x0543('0x24')]);logger[_0x0543('0xc')](_0x0543('0x27'));return _0x576084;});}return _0x576084;})[_0x0543('0xb')](function(_0x28307f){logger['info'](_0x0543('0x1b'),_0xf1eccf);logger['debug'](_0x0543('0x1b'),_0xf1eccf,JSON[_0x0543('0xf')](_0x28307f));_0x21fc63(_0x28307f);})[_0x0543('0x1a')](function(_0x327027){logger['error'](_0x0543('0x1b'),_0x327027['message'],_0xf1eccf);_0x547a88(_0x40a261[_0x0543('0x10')](0x1f4,_0x327027[_0x0543('0x13')]));});});}; \ No newline at end of file +var _0xd824=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','then','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x1617ac,_0x23a705){var _0x4a2c62=function(_0x5f584f){while(--_0x5f584f){_0x1617ac['push'](_0x1617ac['shift']());}};_0x4a2c62(++_0x23a705);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x18')]||null:null,'attributes':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['limit']||null:null})[_0x4d82('0x19')](function(_0x41f194){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1a')](_0x4d82('0x12'),_0x258c59,JSON[_0x4d82('0xe')](_0x41f194));_0x2f2127(_0x41f194);})[_0x4d82('0x11')](function(_0x12feab){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x12feab[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x12feab[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1b')]=function(_0x4af6da){var _0x5e0b03=this;return new Promise(function(_0x3dcb0f,_0x2548de){var _0x2a0572=require(_0x4d82('0x1c'));var _0x5cbd7e;return db[_0x4d82('0x1d')][_0x4d82('0x1e')]({'attributes':['id',_0x4d82('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x4d82('0x19')](function(_0x5ce98b){_0x5cbd7e=_0x5ce98b;return db[_0x4d82('0x13')]['create'](_0x4af6da['body']);})['then'](function(_0x52533b){if(_0x5cbd7e[_0x4d82('0x1f')]&&fs[_0x4d82('0x20')](_0x52533b[_0x4d82('0x21')])){var _0x52e320=util[_0x4d82('0x22')](_0x4d82('0x23'),_0x52533b['value']);return _0x2a0572['encryptFile'](_0x52533b[_0x4d82('0x21')],_0x52e320,config[_0x4d82('0x24')][_0x4d82('0x25')])[_0x4d82('0x19')](function(){fs['unlink'](_0x52533b[_0x4d82('0x21')]);logger['info'](_0x4d82('0x26'));return _0x52533b;});}return _0x52533b;})[_0x4d82('0x19')](function(_0x4a2a45){logger['info'](_0x4d82('0x1b'),_0x4af6da);logger[_0x4d82('0x1a')](_0x4d82('0x1b'),_0x4af6da,JSON[_0x4d82('0xe')](_0x4a2a45));_0x3dcb0f(_0x4a2a45);})[_0x4d82('0x11')](function(_0x420b28){logger[_0x4d82('0xf')](_0x4d82('0x1b'),_0x420b28[_0x4d82('0x10')],_0x4af6da);_0x2548de(_0x5e0b03[_0x4d82('0xf')](0x1f4,_0x420b28['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 158df79..f88c3d8 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 _0x3de7=['isAuthenticated','index','/describe','describe','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x15adad,_0x5afad5){var _0x16165c=function(_0x19caeb){while(--_0x19caeb){_0x15adad['push'](_0x15adad['shift']());}};_0x16165c(++_0x5afad5);}(_0x3de7,0xb5));var _0x73de=function(_0x4b3d88,_0x49a095){_0x4b3d88=_0x4b3d88-0x0;var _0x11dbf5=_0x3de7[_0x4b3d88];return _0x11dbf5;};'use strict';var multer=require('multer');var util=require(_0x73de('0x0'));var path=require('path');var timeout=require(_0x73de('0x1'));var express=require(_0x73de('0x2'));var router=express[_0x73de('0x3')]();var fs_extra=require(_0x73de('0x4'));var auth=require(_0x73de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73de('0x6'));var controller=require(_0x73de('0x7'));router[_0x73de('0x8')]('/',auth[_0x73de('0x9')](),controller[_0x73de('0xa')]);router[_0x73de('0x8')](_0x73de('0xb'),auth['isAuthenticated'](),controller[_0x73de('0xc')]);router[_0x73de('0x8')]('/:id',auth[_0x73de('0x9')](),controller['show']);router[_0x73de('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73de('0xe')]('/:id',auth[_0x73de('0x9')](),controller[_0x73de('0xf')]);router[_0x73de('0x10')]('/:id',auth[_0x73de('0x9')](),controller[_0x73de('0x11')]);module[_0x73de('0x12')]=router; \ No newline at end of file +var _0x1ae9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x546480,_0x39ec7c){var _0x2a8525=function(_0x2de2f8){while(--_0x2de2f8){_0x546480['push'](_0x546480['shift']());}};_0x2a8525(++_0x39ec7c);}(_0x1ae9,0x85));var _0x91ae=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x1ae9[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0x91ae('0x0'));var util=require(_0x91ae('0x1'));var path=require(_0x91ae('0x2'));var timeout=require(_0x91ae('0x3'));var express=require(_0x91ae('0x4'));var router=express[_0x91ae('0x5')]();var fs_extra=require(_0x91ae('0x6'));var auth=require(_0x91ae('0x7'));var interaction=require(_0x91ae('0x8'));var config=require(_0x91ae('0x9'));var controller=require(_0x91ae('0xa'));router['get']('/',auth[_0x91ae('0xb')](),controller[_0x91ae('0xc')]);router[_0x91ae('0xd')](_0x91ae('0xe'),auth[_0x91ae('0xb')](),controller[_0x91ae('0xf')]);router['get']('/:id',auth[_0x91ae('0xb')](),controller['show']);router[_0x91ae('0x10')]('/',auth[_0x91ae('0xb')](),controller[_0x91ae('0x11')]);router[_0x91ae('0x12')](_0x91ae('0x13'),auth['isAuthenticated'](),controller[_0x91ae('0x14')]);router[_0x91ae('0x15')]('/:id',auth[_0x91ae('0xb')](),controller[_0x91ae('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 4fcd39f..f734eeb 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 _0xa603=['blind','STRING','ENUM','Yes','sequelize','moment'];(function(_0x26dc85,_0x125f6c){var _0x1b7ff7=function(_0x1f1d05){while(--_0x1f1d05){_0x26dc85['push'](_0x26dc85['shift']());}};_0x1b7ff7(++_0x125f6c);}(_0xa603,0x112));var _0x3a60=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa603[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x3a60('0x0'));var moment=require(_0x3a60('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3a60('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x3a60('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x3a60('0x3')]},'transferercalleridname':{'type':Sequelize[_0x3a60('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x3a60('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x3a60('0x3')]},'transferercontext':{'type':Sequelize[_0x3a60('0x3')]},'transfererexten':{'type':Sequelize[_0x3a60('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x3a60('0x3')]},'transfereechannel':{'type':Sequelize[_0x3a60('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x3a60('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x3a60('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x3a60('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x3a60('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x3a60('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x3a60('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x3a60('0x3')]},'isexternal':{'type':Sequelize[_0x3a60('0x4')](_0x3a60('0x5'),'No')},'context':{'type':Sequelize[_0x3a60('0x3')]},'extension':{'type':Sequelize[_0x3a60('0x3')]}}; \ No newline at end of file +var _0x6df4=['STRING','Yes','sequelize','exports','ENUM','blind'];(function(_0x456e8e,_0x1977b3){var _0x56312f=function(_0x338ff2){while(--_0x338ff2){_0x456e8e['push'](_0x456e8e['shift']());}};_0x56312f(++_0x1977b3);}(_0x6df4,0x17c));var _0x46df=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x6df4[_0x1ebe90];return _0x447c82;};'use strict';var Sequelize=require(_0x46df('0x0'));var moment=require('moment');module[_0x46df('0x1')]={'type':{'type':Sequelize[_0x46df('0x2')](_0x46df('0x3'),'attended')},'result':{'type':Sequelize[_0x46df('0x4')]},'transfererchannel':{'type':Sequelize[_0x46df('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x46df('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x46df('0x4')]},'transfererexten':{'type':Sequelize[_0x46df('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x46df('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x46df('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x46df('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x46df('0x4')]},'isexternal':{'type':Sequelize[_0x46df('0x2')](_0x46df('0x5'),'No')},'context':{'type':Sequelize[_0x46df('0x4')]},'extension':{'type':Sequelize[_0x46df('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 886fffa..e7b9d34 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 _0xf4c8=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','filter','where','merge','options','includeAll','include','VoiceTransferReport','findAll','catch','show','params','length','find','create','body','describe','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js'];(function(_0x4f7d66,_0x57829a){var _0x3569f1=function(_0x24f609){while(--_0x24f609){_0x4f7d66['push'](_0x4f7d66['shift']());}};_0x3569f1(++_0x57829a);}(_0xf4c8,0x149));var _0x8f4c=function(_0x4ec05f,_0x1d7fd3){_0x4ec05f=_0x4ec05f-0x0;var _0x29c86d=_0xf4c8[_0x4ec05f];return _0x29c86d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f4c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f4c('0x1'));var BPromise=require(_0x8f4c('0x2'));var Mustache=require(_0x8f4c('0x3'));var util=require('util');var path=require(_0x8f4c('0x4'));var sox=require(_0x8f4c('0x5'));var csv=require(_0x8f4c('0x6'));var ejs=require(_0x8f4c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8f4c('0x8'));var crypto=require(_0x8f4c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8f4c('0xa'));var toCsv=require(_0x8f4c('0x6'));var querystring=require(_0x8f4c('0xb'));var Papa=require(_0x8f4c('0xc'));var Redis=require(_0x8f4c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8f4c('0xe'));var as=require(_0x8f4c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f4c('0x10'))(_0x8f4c('0x11'));var utils=require(_0x8f4c('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207dc6,_0x2ec3ca){_0x2ec3ca=_0x2ec3ca||0xcc;return function(_0x502a85){if(_0x502a85){return _0x207dc6[_0x8f4c('0x13')](_0x2ec3ca);}return _0x207dc6[_0x8f4c('0x14')](_0x2ec3ca)[_0x8f4c('0x15')]();};}function respondWithResult(_0x3f22ce,_0x22514e){_0x22514e=_0x22514e||0xc8;return function(_0x59397d){if(_0x59397d){return _0x3f22ce['status'](_0x22514e)[_0x8f4c('0x16')](_0x59397d);}};}function respondWithFilteredResult(_0x8050de,_0x5938dd){return function(_0x26b69a){if(_0x26b69a){var _0x5780a0=typeof _0x5938dd[_0x8f4c('0x17')]===_0x8f4c('0x18')&&typeof _0x5938dd[_0x8f4c('0x19')]===_0x8f4c('0x18');var _0x3babcb=_0x26b69a['count'];var _0x4db7d7=_0x5780a0?0x0:_0x5938dd[_0x8f4c('0x17')];var _0x424bb5=_0x5780a0?_0x26b69a[_0x8f4c('0x1a')]:_0x5938dd[_0x8f4c('0x17')]+_0x5938dd['limit'];var _0x1e1bce;if(_0x424bb5>=_0x3babcb){_0x424bb5=_0x3babcb;_0x1e1bce=0xc8;}else{_0x1e1bce=0xce;}_0x8050de[_0x8f4c('0x14')](_0x1e1bce);return _0x8050de[_0x8f4c('0x1b')](_0x8f4c('0x1c'),_0x4db7d7+'-'+_0x424bb5+'/'+_0x3babcb)['json'](_0x26b69a);}return null;};}function patchUpdates(_0x35f6d4){return function(_0x1268a0){try{jsonpatch[_0x8f4c('0x1d')](_0x1268a0,_0x35f6d4,!![]);}catch(_0x5f56cd){return BPromise[_0x8f4c('0x1e')](_0x5f56cd);}return _0x1268a0[_0x8f4c('0x1f')]();};}function saveUpdates(_0x3262fc,_0x5029a5){return function(_0x5f59c1){if(_0x5f59c1){return _0x5f59c1[_0x8f4c('0x20')](_0x3262fc)[_0x8f4c('0x21')](function(_0xc4d51e){return _0xc4d51e;});}return null;};}function removeEntity(_0x2e0dd6,_0x37c840){return function(_0x3fcfe8){if(_0x3fcfe8){return _0x3fcfe8[_0x8f4c('0x22')]()[_0x8f4c('0x21')](function(){_0x2e0dd6[_0x8f4c('0x14')](0xcc)[_0x8f4c('0x15')]();});}};}function handleEntityNotFound(_0x59b8fe,_0x51f7cc){return function(_0x38166f){if(!_0x38166f){_0x59b8fe[_0x8f4c('0x13')](0x194);}return _0x38166f;};}function handleError(_0x311432,_0x1a2b1c){_0x1a2b1c=_0x1a2b1c||0x1f4;return function(_0x119d9a){logger[_0x8f4c('0x23')](_0x119d9a['stack']);if(_0x119d9a['name']){delete _0x119d9a[_0x8f4c('0x24')];}_0x311432['status'](_0x1a2b1c)['send'](_0x119d9a);};}exports[_0x8f4c('0x25')]=function(_0x3fa3fc,_0x16cfbc){var _0x3b41dd={},_0xbaabef={},_0x1b384b={'count':0x0,'rows':[]};var _0x3421be=_[_0x8f4c('0x26')](db['VoiceTransferReport'][_0x8f4c('0x27')],function(_0x20033b){return{'name':_0x20033b[_0x8f4c('0x28')],'type':_0x20033b[_0x8f4c('0x29')][_0x8f4c('0x2a')]};});_0xbaabef[_0x8f4c('0x2b')]=_[_0x8f4c('0x26')](_0x3421be,'name');_0xbaabef[_0x8f4c('0x2c')]=_[_0x8f4c('0x2d')](_0x3fa3fc[_0x8f4c('0x2c')]);_0xbaabef[_0x8f4c('0x2e')]=_['intersection'](_0xbaabef['model'],_0xbaabef[_0x8f4c('0x2c')]);_0x3b41dd[_0x8f4c('0x2f')]=_[_0x8f4c('0x30')](_0xbaabef['model'],qs['fields'](_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x31')]));_0x3b41dd[_0x8f4c('0x2f')]=_0x3b41dd[_0x8f4c('0x2f')]['length']?_0x3b41dd[_0x8f4c('0x2f')]:_0xbaabef[_0x8f4c('0x2b')];if(!_0x3fa3fc[_0x8f4c('0x2c')]['hasOwnProperty']('nolimit')){_0x3b41dd[_0x8f4c('0x19')]=qs['limit'](_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x19')]);_0x3b41dd[_0x8f4c('0x17')]=qs[_0x8f4c('0x17')](_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x17')]);}_0x3b41dd[_0x8f4c('0x32')]=qs[_0x8f4c('0x33')](_0x3fa3fc['query'][_0x8f4c('0x33')]);_0x3b41dd['where']=qs[_0x8f4c('0x2e')](_['pick'](_0x3fa3fc[_0x8f4c('0x2c')],_0xbaabef[_0x8f4c('0x2e')]),_0x3421be);if(_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x34')]){_0x3b41dd['where']=_['merge'](_0x3b41dd[_0x8f4c('0x35')],{'$or':_['map'](_0x3421be,function(_0x4dfa78){if(_0x4dfa78['type']!=='VIRTUAL'){var _0x23b4d1={};_0x23b4d1[_0x4dfa78[_0x8f4c('0x24')]]={'$like':'%'+_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x34')]+'%'};return _0x23b4d1;}})});}_0x3b41dd=_[_0x8f4c('0x36')]({},_0x3b41dd,_0x3fa3fc[_0x8f4c('0x37')]);var _0x9228c1={'where':_0x3b41dd[_0x8f4c('0x35')]};return db['VoiceTransferReport'][_0x8f4c('0x1a')](_0x9228c1)[_0x8f4c('0x21')](function(_0x4733f4){_0x1b384b[_0x8f4c('0x1a')]=_0x4733f4;if(_0x3fa3fc[_0x8f4c('0x2c')][_0x8f4c('0x38')]){_0x3b41dd[_0x8f4c('0x39')]=[{'all':!![]}];}return db[_0x8f4c('0x3a')][_0x8f4c('0x3b')](_0x3b41dd);})[_0x8f4c('0x21')](function(_0x4d0a32){_0x1b384b['rows']=_0x4d0a32;return _0x1b384b;})['then'](respondWithFilteredResult(_0x16cfbc,_0x3b41dd))[_0x8f4c('0x3c')](handleError(_0x16cfbc,null));};exports[_0x8f4c('0x3d')]=function(_0x20656d,_0x278885){var _0x3a50cc={'raw':!![],'where':{'id':_0x20656d[_0x8f4c('0x3e')]['id']}},_0x282911={};_0x282911['model']=_['keys'](db[_0x8f4c('0x3a')][_0x8f4c('0x27')]);_0x282911['query']=_[_0x8f4c('0x2d')](_0x20656d[_0x8f4c('0x2c')]);_0x282911[_0x8f4c('0x2e')]=_['intersection'](_0x282911['model'],_0x282911[_0x8f4c('0x2c')]);_0x3a50cc[_0x8f4c('0x2f')]=_[_0x8f4c('0x30')](_0x282911[_0x8f4c('0x2b')],qs[_0x8f4c('0x31')](_0x20656d['query']['fields']));_0x3a50cc[_0x8f4c('0x2f')]=_0x3a50cc[_0x8f4c('0x2f')][_0x8f4c('0x3f')]?_0x3a50cc[_0x8f4c('0x2f')]:_0x282911[_0x8f4c('0x2b')];if(_0x20656d[_0x8f4c('0x2c')][_0x8f4c('0x38')]){_0x3a50cc[_0x8f4c('0x39')]=[{'all':!![]}];}_0x3a50cc=_['merge']({},_0x3a50cc,_0x20656d[_0x8f4c('0x37')]);return db[_0x8f4c('0x3a')][_0x8f4c('0x40')](_0x3a50cc)[_0x8f4c('0x21')](handleEntityNotFound(_0x278885,null))[_0x8f4c('0x21')](respondWithResult(_0x278885,null))[_0x8f4c('0x3c')](handleError(_0x278885,null));};exports['create']=function(_0x4a58bb,_0x338d22){return db['VoiceTransferReport'][_0x8f4c('0x41')](_0x4a58bb[_0x8f4c('0x42')],{})['then'](respondWithResult(_0x338d22,0xc9))[_0x8f4c('0x3c')](handleError(_0x338d22,null));};exports['update']=function(_0x2f09fd,_0x6565ca){if(_0x2f09fd['body']['id']){delete _0x2f09fd['body']['id'];}return db[_0x8f4c('0x3a')][_0x8f4c('0x40')]({'where':{'id':_0x2f09fd[_0x8f4c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6565ca,null))['then'](saveUpdates(_0x2f09fd[_0x8f4c('0x42')],null))[_0x8f4c('0x21')](respondWithResult(_0x6565ca,null))[_0x8f4c('0x3c')](handleError(_0x6565ca,null));};exports[_0x8f4c('0x22')]=function(_0x3a883a,_0x18c572){return db[_0x8f4c('0x3a')][_0x8f4c('0x40')]({'where':{'id':_0x3a883a[_0x8f4c('0x3e')]['id']}})[_0x8f4c('0x21')](handleEntityNotFound(_0x18c572,null))[_0x8f4c('0x21')](removeEntity(_0x18c572,null))[_0x8f4c('0x3c')](handleError(_0x18c572,null));};exports[_0x8f4c('0x43')]=function(_0x4fd551,_0x2bbff6){return db[_0x8f4c('0x3a')][_0x8f4c('0x43')]()[_0x8f4c('0x21')](respondWithResult(_0x2bbff6,null))[_0x8f4c('0x3c')](handleError(_0x2bbff6,null));}; \ No newline at end of file +var _0xf4e0=['stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy','error'];(function(_0x7432bf,_0x404eed){var _0x13c79e=function(_0x55676c){while(--_0x55676c){_0x7432bf['push'](_0x7432bf['shift']());}};_0x13c79e(++_0x404eed);}(_0xf4e0,0x158));var _0x0f4e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf4e0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0f4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f4e('0x1'));var jsonpatch=require(_0x0f4e('0x2'));var rp=require(_0x0f4e('0x3'));var moment=require(_0x0f4e('0x4'));var BPromise=require(_0x0f4e('0x5'));var Mustache=require(_0x0f4e('0x6'));var util=require(_0x0f4e('0x7'));var path=require(_0x0f4e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f4e('0x9'));var squel=require(_0x0f4e('0xa'));var crypto=require(_0x0f4e('0xb'));var jsforce=require(_0x0f4e('0xc'));var deskjs=require(_0x0f4e('0xd'));var toCsv=require(_0x0f4e('0xe'));var querystring=require(_0x0f4e('0xf'));var Papa=require(_0x0f4e('0x10'));var Redis=require(_0x0f4e('0x11'));var authService=require(_0x0f4e('0x12'));var qs=require(_0x0f4e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f4e('0x14'));var logger=require(_0x0f4e('0x15'))(_0x0f4e('0x16'));var utils=require(_0x0f4e('0x17'));var config=require(_0x0f4e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f4e('0x19'))['db'];function respondWithStatusCode(_0x2e7c5a,_0x6d41e7){_0x6d41e7=_0x6d41e7||0xcc;return function(_0x211d1b){if(_0x211d1b){return _0x2e7c5a[_0x0f4e('0x1a')](_0x6d41e7);}return _0x2e7c5a['status'](_0x6d41e7)[_0x0f4e('0x1b')]();};}function respondWithResult(_0x33e55f,_0x367d03){_0x367d03=_0x367d03||0xc8;return function(_0x1dcf74){if(_0x1dcf74){return _0x33e55f[_0x0f4e('0x1c')](_0x367d03)['json'](_0x1dcf74);}};}function respondWithFilteredResult(_0x483815,_0x489f89){return function(_0x1c4af7){if(_0x1c4af7){var _0x3f6ae8=typeof _0x489f89['offset']==='undefined'&&typeof _0x489f89[_0x0f4e('0x1d')]===_0x0f4e('0x1e');var _0x15c0d1=_0x1c4af7[_0x0f4e('0x1f')];var _0x1b32d0=_0x3f6ae8?0x0:_0x489f89[_0x0f4e('0x20')];var _0x475227=_0x3f6ae8?_0x1c4af7[_0x0f4e('0x1f')]:_0x489f89[_0x0f4e('0x20')]+_0x489f89[_0x0f4e('0x1d')];var _0x4d4305;if(_0x475227>=_0x15c0d1){_0x475227=_0x15c0d1;_0x4d4305=0xc8;}else{_0x4d4305=0xce;}_0x483815['status'](_0x4d4305);return _0x483815['set'](_0x0f4e('0x21'),_0x1b32d0+'-'+_0x475227+'/'+_0x15c0d1)[_0x0f4e('0x22')](_0x1c4af7);}return null;};}function patchUpdates(_0x315a02){return function(_0x4e57f6){try{jsonpatch['apply'](_0x4e57f6,_0x315a02,!![]);}catch(_0x20b84e){return BPromise[_0x0f4e('0x23')](_0x20b84e);}return _0x4e57f6[_0x0f4e('0x24')]();};}function saveUpdates(_0x3654bc,_0x2e4b99){return function(_0x198cf7){if(_0x198cf7){return _0x198cf7[_0x0f4e('0x25')](_0x3654bc)[_0x0f4e('0x26')](function(_0x29f69e){return _0x29f69e;});}return null;};}function removeEntity(_0x263ff4,_0x36fd40){return function(_0x195337){if(_0x195337){return _0x195337[_0x0f4e('0x27')]()[_0x0f4e('0x26')](function(){_0x263ff4['status'](0xcc)[_0x0f4e('0x1b')]();});}};}function handleEntityNotFound(_0x1abf59,_0x4e3531){return function(_0xca3c54){if(!_0xca3c54){_0x1abf59[_0x0f4e('0x1a')](0x194);}return _0xca3c54;};}function handleError(_0x3b9dc8,_0x1a5d97){_0x1a5d97=_0x1a5d97||0x1f4;return function(_0x3c125d){logger[_0x0f4e('0x28')](_0x3c125d[_0x0f4e('0x29')]);if(_0x3c125d[_0x0f4e('0x2a')]){delete _0x3c125d['name'];}_0x3b9dc8[_0x0f4e('0x1c')](_0x1a5d97)[_0x0f4e('0x2b')](_0x3c125d);};}exports[_0x0f4e('0x2c')]=function(_0x5759a3,_0x3f3939){var _0x48e8cf={},_0x27b288={},_0x599f18={'count':0x0,'rows':[]};var _0x1c2686=_[_0x0f4e('0x2d')](db[_0x0f4e('0x2e')][_0x0f4e('0x2f')],function(_0x4ccf21){return{'name':_0x4ccf21[_0x0f4e('0x30')],'type':_0x4ccf21[_0x0f4e('0x31')][_0x0f4e('0x32')]};});_0x27b288[_0x0f4e('0x33')]=_[_0x0f4e('0x2d')](_0x1c2686,_0x0f4e('0x2a'));_0x27b288['query']=_[_0x0f4e('0x34')](_0x5759a3[_0x0f4e('0x35')]);_0x27b288[_0x0f4e('0x36')]=_[_0x0f4e('0x37')](_0x27b288[_0x0f4e('0x33')],_0x27b288[_0x0f4e('0x35')]);_0x48e8cf[_0x0f4e('0x38')]=_[_0x0f4e('0x37')](_0x27b288['model'],qs['fields'](_0x5759a3[_0x0f4e('0x35')]['fields']));_0x48e8cf[_0x0f4e('0x38')]=_0x48e8cf[_0x0f4e('0x38')][_0x0f4e('0x39')]?_0x48e8cf[_0x0f4e('0x38')]:_0x27b288['model'];if(!_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x3a')](_0x0f4e('0x3b'))){_0x48e8cf[_0x0f4e('0x1d')]=qs[_0x0f4e('0x1d')](_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x1d')]);_0x48e8cf[_0x0f4e('0x20')]=qs['offset'](_0x5759a3['query'][_0x0f4e('0x20')]);}_0x48e8cf['order']=qs[_0x0f4e('0x3c')](_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x3c')]);_0x48e8cf[_0x0f4e('0x3d')]=qs[_0x0f4e('0x36')](_[_0x0f4e('0x3e')](_0x5759a3[_0x0f4e('0x35')],_0x27b288[_0x0f4e('0x36')]),_0x1c2686);if(_0x5759a3['query']['filter']){_0x48e8cf[_0x0f4e('0x3d')]=_[_0x0f4e('0x3f')](_0x48e8cf['where'],{'$or':_[_0x0f4e('0x2d')](_0x1c2686,function(_0x55c634){if(_0x55c634['type']!=='VIRTUAL'){var _0x3b28c0={};_0x3b28c0[_0x55c634[_0x0f4e('0x2a')]]={'$like':'%'+_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x40')]+'%'};return _0x3b28c0;}})});}_0x48e8cf=_[_0x0f4e('0x3f')]({},_0x48e8cf,_0x5759a3[_0x0f4e('0x41')]);var _0x59c90e={'where':_0x48e8cf['where']};return db[_0x0f4e('0x2e')][_0x0f4e('0x1f')](_0x59c90e)[_0x0f4e('0x26')](function(_0x1f9b5a){_0x599f18[_0x0f4e('0x1f')]=_0x1f9b5a;if(_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x42')]){_0x48e8cf[_0x0f4e('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0f4e('0x44')](_0x48e8cf);})[_0x0f4e('0x26')](function(_0x3f38d6){_0x599f18['rows']=_0x3f38d6;return _0x599f18;})[_0x0f4e('0x26')](respondWithFilteredResult(_0x3f3939,_0x48e8cf))[_0x0f4e('0x45')](handleError(_0x3f3939,null));};exports[_0x0f4e('0x46')]=function(_0x4ba7b9,_0x27fc65){var _0x332d02={'raw':!![],'where':{'id':_0x4ba7b9[_0x0f4e('0x47')]['id']}},_0x268748={};_0x268748[_0x0f4e('0x33')]=_[_0x0f4e('0x34')](db['VoiceTransferReport'][_0x0f4e('0x2f')]);_0x268748[_0x0f4e('0x35')]=_[_0x0f4e('0x34')](_0x4ba7b9[_0x0f4e('0x35')]);_0x268748['filters']=_[_0x0f4e('0x37')](_0x268748[_0x0f4e('0x33')],_0x268748[_0x0f4e('0x35')]);_0x332d02['attributes']=_[_0x0f4e('0x37')](_0x268748[_0x0f4e('0x33')],qs[_0x0f4e('0x48')](_0x4ba7b9[_0x0f4e('0x35')][_0x0f4e('0x48')]));_0x332d02['attributes']=_0x332d02['attributes'][_0x0f4e('0x39')]?_0x332d02['attributes']:_0x268748['model'];if(_0x4ba7b9[_0x0f4e('0x35')][_0x0f4e('0x42')]){_0x332d02[_0x0f4e('0x43')]=[{'all':!![]}];}_0x332d02=_['merge']({},_0x332d02,_0x4ba7b9['options']);return db[_0x0f4e('0x2e')][_0x0f4e('0x49')](_0x332d02)['then'](handleEntityNotFound(_0x27fc65,null))[_0x0f4e('0x26')](respondWithResult(_0x27fc65,null))[_0x0f4e('0x45')](handleError(_0x27fc65,null));};exports[_0x0f4e('0x4a')]=function(_0x390de0,_0xfef3fb){return db[_0x0f4e('0x2e')]['create'](_0x390de0['body'],{})[_0x0f4e('0x26')](respondWithResult(_0xfef3fb,0xc9))[_0x0f4e('0x45')](handleError(_0xfef3fb,null));};exports[_0x0f4e('0x25')]=function(_0x1d1f2a,_0x58b19e){if(_0x1d1f2a[_0x0f4e('0x4b')]['id']){delete _0x1d1f2a[_0x0f4e('0x4b')]['id'];}return db['VoiceTransferReport'][_0x0f4e('0x49')]({'where':{'id':_0x1d1f2a[_0x0f4e('0x47')]['id']}})[_0x0f4e('0x26')](handleEntityNotFound(_0x58b19e,null))[_0x0f4e('0x26')](saveUpdates(_0x1d1f2a['body'],null))[_0x0f4e('0x26')](respondWithResult(_0x58b19e,null))[_0x0f4e('0x45')](handleError(_0x58b19e,null));};exports['destroy']=function(_0x30bca1,_0x734068){return db[_0x0f4e('0x2e')][_0x0f4e('0x49')]({'where':{'id':_0x30bca1['params']['id']}})[_0x0f4e('0x26')](handleEntityNotFound(_0x734068,null))[_0x0f4e('0x26')](removeEntity(_0x734068,null))[_0x0f4e('0x45')](handleError(_0x734068,null));};exports[_0x0f4e('0x4c')]=function(_0x5afb,_0x433832){return db[_0x0f4e('0x2e')][_0x0f4e('0x4c')]()[_0x0f4e('0x26')](respondWithResult(_0x433832,null))[_0x0f4e('0x45')](handleError(_0x433832,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ab7e204..ca2d1ba 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 _0x6300=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger'];(function(_0x4c5c1e,_0xebb9a0){var _0x1877f7=function(_0x3adb4e){while(--_0x3adb4e){_0x4c5c1e['push'](_0x4c5c1e['shift']());}};_0x1877f7(++_0xebb9a0);}(_0x6300,0x1ec));var _0x0630=function(_0x50cde4,_0x50b225){_0x50cde4=_0x50cde4-0x0;var _0x3eca5f=_0x6300[_0x50cde4];return _0x3eca5f;};'use strict';var _=require(_0x0630('0x0'));var util=require('util');var logger=require(_0x0630('0x1'))(_0x0630('0x2'));var moment=require(_0x0630('0x3'));var BPromise=require(_0x0630('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0630('0x5'));var rimraf=require(_0x0630('0x6'));var config=require(_0x0630('0x7'));var attributes=require(_0x0630('0x8'));module[_0x0630('0x9')]=function(_0x1485aa,_0x170682){return _0x1485aa[_0x0630('0xa')](_0x0630('0xb'),attributes,{'tableName':_0x0630('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74a2=['report_call_transfer','lodash','api','moment','request-promise','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x5279df,_0x18007f){var _0x4a3e8d=function(_0x5697c6){while(--_0x5697c6){_0x5279df['push'](_0x5279df['shift']());}};_0x4a3e8d(++_0x18007f);}(_0x74a2,0x15f));var _0x274a=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x74a2[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0x274a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x274a('0x1'));var moment=require(_0x274a('0x2'));var BPromise=require('bluebird');var rp=require(_0x274a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x274a('0x4'));var attributes=require(_0x274a('0x5'));module[_0x274a('0x6')]=function(_0x1bf94a,_0x526d25){return _0x1bf94a[_0x274a('0x7')](_0x274a('0x8'),attributes,{'tableName':_0x274a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 4e882fe..b9c2f08 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 _0xf6fe=['error','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1115af,_0x5165a3){var _0xd421dd=function(_0x7e1b74){while(--_0x7e1b74){_0x1115af['push'](_0x1115af['shift']());}};_0xd421dd(++_0x5165a3);}(_0xf6fe,0x95));var _0xef6f=function(_0x4e4e98,_0x25bed0){_0x4e4e98=_0x4e4e98-0x0;var _0x4fc67c=_0xf6fe[_0x4e4e98];return _0x4fc67c;};'use strict';var _=require(_0xef6f('0x0'));var util=require(_0xef6f('0x1'));var moment=require('moment');var BPromise=require(_0xef6f('0x2'));var rs=require(_0xef6f('0x3'));var fs=require('fs');var Redis=require(_0xef6f('0x4'));var db=require(_0xef6f('0x5'))['db'];var utils=require(_0xef6f('0x6'));var logger=require(_0xef6f('0x7'))(_0xef6f('0x8'));var config=require(_0xef6f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xef6f('0xa')][_0xef6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df85e,_0x292512,_0x3c7cd8){return new BPromise(function(_0x4978f5,_0x44561f){return client['request'](_0x5df85e,_0x3c7cd8)[_0xef6f('0xc')](function(_0x3eb1ef){logger[_0xef6f('0xd')](_0xef6f('0xe'),_0x292512,_0xef6f('0xf'));logger[_0xef6f('0x10')](_0xef6f('0x11'),_0x292512,_0xef6f('0xf'),JSON[_0xef6f('0x12')](_0x3eb1ef));if(_0x3eb1ef[_0xef6f('0x13')]){if(_0x3eb1ef[_0xef6f('0x13')]['code']===0x1f4){logger[_0xef6f('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x292512,_0x3eb1ef[_0xef6f('0x13')][_0xef6f('0x14')]);return _0x44561f(_0x3eb1ef['error']['message']);}logger[_0xef6f('0x13')](_0xef6f('0xe'),_0x292512,_0x3eb1ef[_0xef6f('0x13')][_0xef6f('0x14')]);return _0x4978f5(_0x3eb1ef[_0xef6f('0x13')][_0xef6f('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x292512,_0xef6f('0xf'));_0x4978f5(_0x3eb1ef[_0xef6f('0x15')]['message']);}})[_0xef6f('0x16')](function(_0x4d9f68){logger[_0xef6f('0x13')](_0xef6f('0xe'),_0x292512,_0x4d9f68);_0x44561f(_0x4d9f68);});});}exports[_0xef6f('0x17')]=function(_0x2b5fe4){var _0x166ba6=this;return new Promise(function(_0x35986c,_0x250e07){return db['VoiceTransferReport'][_0xef6f('0x18')](_0x2b5fe4[_0xef6f('0x19')],{'raw':_0x2b5fe4['options']?_0x2b5fe4[_0xef6f('0x1a')][_0xef6f('0x1b')]===undefined?!![]:![]:!![]})[_0xef6f('0xc')](function(_0x319d28){logger[_0xef6f('0xd')](_0xef6f('0x17'),_0x2b5fe4);logger['debug'](_0xef6f('0x17'),_0x2b5fe4,JSON[_0xef6f('0x12')](_0x319d28));_0x35986c(_0x319d28);})['catch'](function(_0x1b3e14){logger[_0xef6f('0x13')]('CreateVoiceTransferReport',_0x1b3e14[_0xef6f('0x14')],_0x2b5fe4);_0x250e07(_0x166ba6[_0xef6f('0x13')](0x1f4,_0x1b3e14[_0xef6f('0x14')]));});});}; \ No newline at end of file +var _0xb8f0=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xb8f0,0x120));var _0x0b8f=function(_0x230556,_0x18232c){_0x230556=_0x230556-0x0;var _0x2a8768=_0xb8f0[_0x230556];return _0x2a8768;};'use strict';var _=require(_0x0b8f('0x0'));var util=require(_0x0b8f('0x1'));var moment=require(_0x0b8f('0x2'));var BPromise=require(_0x0b8f('0x3'));var rs=require(_0x0b8f('0x4'));var fs=require('fs');var Redis=require(_0x0b8f('0x5'));var db=require(_0x0b8f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b8f('0x7'));var config=require(_0x0b8f('0x8'));var jayson=require(_0x0b8f('0x9'));var client=jayson[_0x0b8f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38cf18,_0x148d71,_0x44d99c){return new BPromise(function(_0x5a04e6,_0x286553){return client[_0x0b8f('0xb')](_0x38cf18,_0x44d99c)[_0x0b8f('0xc')](function(_0x2769fe){logger['info'](_0x0b8f('0xd'),_0x148d71,_0x0b8f('0xe'));logger['debug'](_0x0b8f('0xf'),_0x148d71,_0x0b8f('0xe'),JSON[_0x0b8f('0x10')](_0x2769fe));if(_0x2769fe[_0x0b8f('0x11')]){if(_0x2769fe[_0x0b8f('0x11')]['code']===0x1f4){logger[_0x0b8f('0x11')](_0x0b8f('0xd'),_0x148d71,_0x2769fe['error']['message']);return _0x286553(_0x2769fe[_0x0b8f('0x11')]['message']);}logger[_0x0b8f('0x11')](_0x0b8f('0xd'),_0x148d71,_0x2769fe[_0x0b8f('0x11')][_0x0b8f('0x12')]);return _0x5a04e6(_0x2769fe['error']['message']);}else{logger[_0x0b8f('0x13')](_0x0b8f('0xd'),_0x148d71,_0x0b8f('0xe'));_0x5a04e6(_0x2769fe[_0x0b8f('0x14')][_0x0b8f('0x12')]);}})[_0x0b8f('0x15')](function(_0x1958cf){logger['error'](_0x0b8f('0xd'),_0x148d71,_0x1958cf);_0x286553(_0x1958cf);});});}exports[_0x0b8f('0x16')]=function(_0x44ab5e){var _0x8e2181=this;return new Promise(function(_0x3a278c,_0x36ac36){return db[_0x0b8f('0x17')][_0x0b8f('0x18')](_0x44ab5e[_0x0b8f('0x19')],{'raw':_0x44ab5e[_0x0b8f('0x1a')]?_0x44ab5e['options']['raw']===undefined?!![]:![]:!![]})[_0x0b8f('0xc')](function(_0x45ec4c){logger[_0x0b8f('0x13')](_0x0b8f('0x16'),_0x44ab5e);logger[_0x0b8f('0x1b')](_0x0b8f('0x16'),_0x44ab5e,JSON[_0x0b8f('0x10')](_0x45ec4c));_0x3a278c(_0x45ec4c);})[_0x0b8f('0x15')](function(_0x3a92ba){logger[_0x0b8f('0x11')](_0x0b8f('0x16'),_0x3a92ba['message'],_0x44ab5e);_0x36ac36(_0x8e2181[_0x0b8f('0x11')](0x1f4,_0x3a92ba['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index bf459c4..ccfcb47 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x361656,_0x2e61da){var _0x3f6f73=function(_0x4fc159){while(--_0x4fc159){_0x361656['push'](_0x361656['shift']());}};_0x3f6f73(++_0x2e61da);}(_0xbec5,0xe5));var _0x5bec=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0xbec5[_0x309d93];return _0x2dd61d;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file +var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x3f0872,_0x3bb275){var _0x54142a=function(_0x385441){while(--_0x385441){_0x3f0872['push'](_0x3f0872['shift']());}};_0x54142a(++_0x3bb275);}(_0xdace,0xc5));var _0xedac=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xdace[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2bc9a23..5a9b41c 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc874=['filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','info','format','webbar:originate','originate\x20executed!','hangup','validate','webbar:hangup','hangup\x20executed!','answer','entityFound:','user:%s','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../mysqldb','../../config/environment','jayson/promise','client','http','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','stringify','emit','log','error','stack','name','send','status','NotFound','request','then','code','message','result','catch','User','findOne','VoiceChannels'];(function(_0x4ecbf5,_0x47ed8d){var _0x464607=function(_0x549e95){while(--_0x549e95){_0x4ecbf5['push'](_0x4ecbf5['shift']());}};_0x464607(++_0x47ed8d);}(_0xc874,0x154));var _0x4c87=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xc874[_0x27e811];return _0x1627fa;};'use strict';var path=require(_0x4c87('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x4c87('0x1'))['db'];var config=require(_0x4c87('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x4c87('0x3'));var amiClient=jayson[_0x4c87('0x4')][_0x4c87('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x4c87('0x6'));var Redis=require(_0x4c87('0x7'));config['redis']=_[_0x4c87('0x8')](config[_0x4c87('0x9')],{'host':_0x4c87('0xa'),'port':0x18eb});var io=require(_0x4c87('0xb'))(new Redis(config[_0x4c87('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0xe')]},'callerId':{'type':_0x4c87('0xd')},'callbackUrl':{'type':_0x4c87('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0x10')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x27abb9,_0x3c32cc,_0x585705){logger['info'](_0x27abb9,_0x3c32cc,JSON[_0x4c87('0x11')](_0x585705));io['to'](_0x27abb9)[_0x4c87('0x12')](_0x3c32cc,_0x585705);}function handleError(_0x2b55fa){return function(_0x547d92){console[_0x4c87('0x13')]('handleError:',_0x547d92,_0x547d92 instanceof RangeError);logger[_0x4c87('0x14')](_0x547d92[_0x4c87('0x15')]);if(_0x547d92 instanceof RangeError){if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa['status'](0x194)[_0x4c87('0x17')](_0x547d92);}else{if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa[_0x4c87('0x18')](0x1f4)[_0x4c87('0x17')](_0x547d92);}};}function checkError(){return function(_0x22fac7){if(!_0x22fac7){throw new RangeError(_0x4c87('0x19'));}return _0x22fac7;};}function respondWithRpcPromise(_0x9da0d6,_0x50289b){return new BPromise(function(_0x353ac9,_0x33aafd){var _0x5cc15d=amiClient;return _0x5cc15d[_0x4c87('0x1a')](_0x9da0d6,_0x50289b)[_0x4c87('0x1b')](function(_0x5a9496){if(_0x5a9496[_0x4c87('0x14')]){if(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1c')]===0x1f4){return _0x33aafd(_0x5a9496[_0x4c87('0x14')]['message']);}return _0x353ac9(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1d')]);}else{_0x353ac9(_0x5a9496[_0x4c87('0x1e')]);}})[_0x4c87('0x1f')](function(_0x637dbc){_0x33aafd(_0x637dbc);});});}function getAgent(_0x3eb09e){return db[_0x4c87('0x20')][_0x4c87('0x21')]({'where':{'id':_0x3eb09e,'role':'agent'}})[_0x4c87('0x1b')](checkError());}function getAgentCheckSession(_0x47ef54,_0x27f13d){return new BPromise(function(_0x381af7,_0x3a9520){var _0x1f246e=respondWithRpcPromise(_0x4c87('0x22'));var _0x583371=getAgent(_0x47ef54);Promise['all']([_0x1f246e,_0x583371])[_0x4c87('0x1b')](function(_0x23483e){var _0x2e3549=_0x23483e[0x0];var _0x106121=_0x23483e[0x1];var _0xa7eb3=_[_0x4c87('0x23')](_0x2e3549[_0x4c87('0x24')],function(_0x10aea2){return _0x10aea2[_0x4c87('0x25')]==_0x106121['id']&&_0x10aea2[_0x4c87('0x26')]==_0x27f13d;});if(_0xa7eb3[_0x4c87('0x27')]==0x1){_0x381af7(_0x106121);}else{_0x3a9520(new RangeError(_0x4c87('0x28')+_0x27f13d+_0x4c87('0x29')));}});});}exports[_0x4c87('0x2a')]=function(_0x3a1aaf,_0x185590){logger['info'](_0x4c87('0x2b'),_0x3a1aaf['body']);var _0x110b84=originateValidation['validate'](_0x3a1aaf[_0x4c87('0x2c')]);if(_0x110b84[_0x4c87('0x27')]>0x0){return _0x185590[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x110b84);}var _0x58eb98=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2f307a=_0x3a1aaf[_0x4c87('0x2c')]['callNumber'];var _0x2060f8=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2f')];var _0x30fdba=_0x3a1aaf['body'][_0x4c87('0x30')];return getAgent(_0x58eb98)[_0x4c87('0x1b')](function(_0x5fb196){logger[_0x4c87('0x31')]('entityFound:',_0x5fb196['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5fb196[_0x4c87('0x16')]),_0x4c87('0x33'),{'callNumber':_0x2f307a,'callerId':_0x2060f8,'callbackUrl':_0x30fdba});return _0x185590[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x34')});})['catch'](handleError(_0x185590));};exports[_0x4c87('0x35')]=function(_0x11a632,_0xcc73b5){logger['info']('hangup\x20fired:',_0x11a632[_0x4c87('0x2c')]);var _0x2da03f=hangupValidation[_0x4c87('0x36')](_0x11a632['body']);if(_0x2da03f[_0x4c87('0x27')]>0x0){return _0xcc73b5['status'](0x190)['json'](_0x2da03f);}var _0x5bbd35=_0x11a632[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2de50d=_0x11a632['body'][_0x4c87('0x26')];return getAgent(_0x5bbd35)[_0x4c87('0x1b')](function(_0x5de7b1){logger[_0x4c87('0x31')]('entityFound:',_0x5de7b1['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5de7b1[_0x4c87('0x16')]),_0x4c87('0x37'),{'sessionId':_0x2de50d});return _0xcc73b5['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x38')});})['catch'](handleError(_0xcc73b5));};exports[_0x4c87('0x39')]=function(_0x5a70b7,_0x521944){logger[_0x4c87('0x31')]('answer\x20fired:',_0x5a70b7['body']);var _0x35c74b=answerValidation[_0x4c87('0x36')](_0x5a70b7['body']);if(_0x35c74b[_0x4c87('0x27')]>0x0){return _0x521944[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x35c74b);}var _0x45b950=_0x5a70b7['body'][_0x4c87('0x2e')];var _0x448208=_0x5a70b7[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x45b950)['then'](function(_0x33716e){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x33716e['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x33716e[_0x4c87('0x16')]),_0x4c87('0x3c'),{'sessionId':_0x448208});return _0x521944['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x3d')});})[_0x4c87('0x1f')](handleError(_0x521944));};exports['hold']=function(_0x507686,_0x41cfe9){logger[_0x4c87('0x31')](_0x4c87('0x3e'),_0x507686[_0x4c87('0x2c')]);var _0x52bac1=holdValidation['validate'](_0x507686[_0x4c87('0x2c')]);if(_0x52bac1[_0x4c87('0x27')]>0x0){return _0x41cfe9[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x52bac1);}var _0x2c7eef=_0x507686[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x290761=_0x507686[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x2c7eef)['then'](function(_0x20f4f2){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20f4f2[_0x4c87('0x16')]);emit(util['format'](_0x4c87('0x3b'),_0x20f4f2[_0x4c87('0x16')]),_0x4c87('0x3f'),{'sessionId':_0x290761});return _0x41cfe9['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x40')});})[_0x4c87('0x1f')](handleError(_0x41cfe9));};exports['unhold']=function(_0x31f23a,_0x1b5843){logger[_0x4c87('0x31')]('unhold\x20fired:',_0x31f23a['body']);var _0x578b39=unholdValidation['validate'](_0x31f23a['body']);if(_0x578b39[_0x4c87('0x27')]>0x0){return _0x1b5843[_0x4c87('0x18')](0x190)['json'](_0x578b39);}var _0x59545c=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x205419=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x59545c)[_0x4c87('0x1b')](function(_0x64642a){logger[_0x4c87('0x31')]('entityFound:',_0x64642a['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x64642a[_0x4c87('0x16')]),_0x4c87('0x41'),{'sessionId':_0x205419});return _0x1b5843[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x42')});})[_0x4c87('0x1f')](handleError(_0x1b5843));};exports[_0x4c87('0x43')]=function(_0x2a4bf1,_0x4aa6e3){logger['info'](_0x4c87('0x44'),_0x4aa6e3['body']);var _0x3fae0d=callsValidation[_0x4c87('0x36')](_0x2a4bf1[_0x4c87('0x2c')]);if(_0x3fae0d['length']>0x0){return _0x4aa6e3[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x3fae0d);}var _0x3d407a=_0x2a4bf1[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x67c32d=respondWithRpcPromise(_0x4c87('0x22'));var _0x4e552a=getAgent(_0x3d407a);return Promise['all']([_0x67c32d,_0x4e552a])[_0x4c87('0x1b')](function(_0x2fb4a){var _0x253e8b=_0x2fb4a[0x0];var _0x197c0d=_0x2fb4a[0x1];var _0x16be71=_[_0x4c87('0x23')](_0x253e8b[_0x4c87('0x24')],function(_0x1f7b9b){return _0x1f7b9b[_0x4c87('0x25')]==_0x197c0d['id'];});return _0x4aa6e3[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'count':_0x16be71[_0x4c87('0x27')],'rows':_0x16be71});})[_0x4c87('0x1f')](handleError(_0x4aa6e3));};exports['conference']=function(_0x37b319,_0x24c52a){logger[_0x4c87('0x31')](_0x4c87('0x45'),_0x37b319[_0x4c87('0x2c')]);var _0x1d71e5=conferenceValidation[_0x4c87('0x36')](_0x37b319['body']);if(_0x1d71e5['length']>0x0){return _0x24c52a[_0x4c87('0x18')](0x190)['json'](_0x1d71e5);}var _0x53e6ba=_0x37b319['body'][_0x4c87('0x2e')];return getAgent(_0x53e6ba)[_0x4c87('0x1b')](function(_0x20c0b6){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20c0b6['name']);emit(util['format'](_0x4c87('0x3b'),_0x20c0b6['name']),'webbar:conference');return _0x24c52a['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x46')});})[_0x4c87('0x1f')](handleError(_0x24c52a));};exports[_0x4c87('0x47')]=function(_0x44a2c7,_0x4ed555){logger['info'](_0x4c87('0x48'),_0x44a2c7[_0x4c87('0x2c')]);var _0xdf24be=transferValidation[_0x4c87('0x36')](_0x44a2c7['body']);if(_0xdf24be['length']>0x0){return _0x4ed555[_0x4c87('0x18')](0x190)['json'](_0xdf24be);}var _0x30773f=_0x44a2c7[_0x4c87('0x2c')]['userId'];var _0x10b898=_0x44a2c7['body'][_0x4c87('0x26')];var _0x38dfad=_0x44a2c7[_0x4c87('0x2c')][_0x4c87('0x49')];return getAgent(_0x30773f)['then'](function(_0x44a493){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x44a493[_0x4c87('0x16')]);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x44a493['name']),'webbar:transfer',{'sessionId':_0x10b898,'transferNumber':_0x38dfad});return _0x4ed555[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x4a')});})['catch'](handleError(_0x4ed555));}; \ No newline at end of file +var _0x9f62=['user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','entityFound:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','log','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','originate','originate\x20fired:','body','json','userId','callNumber','callerId','format'];(function(_0x736a72,_0x574f49){var _0x3741ad=function(_0x412a42){while(--_0x412a42){_0x736a72['push'](_0x736a72['shift']());}};_0x3741ad(++_0x574f49);}(_0x9f62,0x154));var _0x29f6=function(_0x43358c,_0x305ae0){_0x43358c=_0x43358c-0x0;var _0x2d3074=_0x9f62[_0x43358c];return _0x2d3074;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x29f6('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x29f6('0x1'));var util=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x29f6('0x4')]({'port':0x232a});var logger=require(_0x29f6('0x5'))(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));config['redis']=_[_0x29f6('0x8')](config[_0x29f6('0x9')],{'host':_0x29f6('0xa'),'port':0x18eb});var io=require(_0x29f6('0xb'))(new Redis(config[_0x29f6('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x29f6('0xc')]},'callerId':{'type':_0x29f6('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x29f6('0xd'),'required':[!![],_0x29f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});function emit(_0x1dde97,_0x3a75d0,_0x25e5a2){logger[_0x29f6('0x11')](_0x1dde97,_0x3a75d0,JSON[_0x29f6('0x12')](_0x25e5a2));io['to'](_0x1dde97)['emit'](_0x3a75d0,_0x25e5a2);}function handleError(_0x51c92f){return function(_0x2e66d3){console[_0x29f6('0x13')](_0x29f6('0x14'),_0x2e66d3,_0x2e66d3 instanceof RangeError);logger['error'](_0x2e66d3[_0x29f6('0x15')]);if(_0x2e66d3 instanceof RangeError){if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3['name'];}_0x51c92f[_0x29f6('0x17')](0x194)[_0x29f6('0x18')](_0x2e66d3);}else{if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3[_0x29f6('0x16')];}_0x51c92f[_0x29f6('0x17')](0x1f4)[_0x29f6('0x18')](_0x2e66d3);}};}function checkError(){return function(_0x5673c8){if(!_0x5673c8){throw new RangeError(_0x29f6('0x19'));}return _0x5673c8;};}function respondWithRpcPromise(_0x59def4,_0x4acb15){return new BPromise(function(_0x470019,_0x1fa159){var _0x39c6b3=amiClient;return _0x39c6b3[_0x29f6('0x1a')](_0x59def4,_0x4acb15)['then'](function(_0x2c672e){if(_0x2c672e['error']){if(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){return _0x1fa159(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1d')]);}return _0x470019(_0x2c672e['error'][_0x29f6('0x1d')]);}else{_0x470019(_0x2c672e[_0x29f6('0x1e')]);}})['catch'](function(_0x1401fb){_0x1fa159(_0x1401fb);});});}function getAgent(_0x45f792){return db[_0x29f6('0x1f')][_0x29f6('0x20')]({'where':{'id':_0x45f792,'role':_0x29f6('0x21')}})[_0x29f6('0x22')](checkError());}function getAgentCheckSession(_0x23c630,_0x50cdd2){return new BPromise(function(_0x2183b7,_0x454a4a){var _0x1ab8d8=respondWithRpcPromise(_0x29f6('0x23'));var _0xda0a63=getAgent(_0x23c630);Promise[_0x29f6('0x24')]([_0x1ab8d8,_0xda0a63])[_0x29f6('0x22')](function(_0x17b2f2){var _0x3d88db=_0x17b2f2[0x0];var _0x13a3a2=_0x17b2f2[0x1];var _0x2915bc=_[_0x29f6('0x25')](_0x3d88db[_0x29f6('0x26')],function(_0x304c28){return _0x304c28[_0x29f6('0x27')]==_0x13a3a2['id']&&_0x304c28[_0x29f6('0x28')]==_0x50cdd2;});if(_0x2915bc[_0x29f6('0x29')]==0x1){_0x2183b7(_0x13a3a2);}else{_0x454a4a(new RangeError('sessionId\x20'+_0x50cdd2+'\x20not\x20found!'));}});});}exports[_0x29f6('0x2a')]=function(_0x489897,_0x341071){logger[_0x29f6('0x11')](_0x29f6('0x2b'),_0x489897[_0x29f6('0x2c')]);var _0x5e5d89=originateValidation['validate'](_0x489897[_0x29f6('0x2c')]);if(_0x5e5d89[_0x29f6('0x29')]>0x0){return _0x341071[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e5d89);}var _0x3a223b=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x1c3f0f=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2f')];var _0x46d0d0=_0x489897[_0x29f6('0x2c')][_0x29f6('0x30')];var _0x23ad1a=_0x489897['body']['callbackUrl'];return getAgent(_0x3a223b)[_0x29f6('0x22')](function(_0x44cf19){logger[_0x29f6('0x11')]('entityFound:',_0x44cf19[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x44cf19[_0x29f6('0x16')]),_0x29f6('0x33'),{'callNumber':_0x1c3f0f,'callerId':_0x46d0d0,'callbackUrl':_0x23ad1a});return _0x341071['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x34')});})[_0x29f6('0x35')](handleError(_0x341071));};exports[_0x29f6('0x36')]=function(_0x4f5fe1,_0x30d747){logger[_0x29f6('0x11')](_0x29f6('0x37'),_0x4f5fe1[_0x29f6('0x2c')]);var _0x5ddc09=hangupValidation['validate'](_0x4f5fe1[_0x29f6('0x2c')]);if(_0x5ddc09['length']>0x0){return _0x30d747[_0x29f6('0x17')](0x190)['json'](_0x5ddc09);}var _0x3a1a75=_0x4f5fe1['body'][_0x29f6('0x2e')];var _0x11fb2d=_0x4f5fe1['body'][_0x29f6('0x28')];return getAgent(_0x3a1a75)['then'](function(_0x3f3475){logger[_0x29f6('0x11')]('entityFound:',_0x3f3475[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x3f3475[_0x29f6('0x16')]),'webbar:hangup',{'sessionId':_0x11fb2d});return _0x30d747[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x38')});})[_0x29f6('0x35')](handleError(_0x30d747));};exports[_0x29f6('0x39')]=function(_0x4d4189,_0xb5f2b1){logger['info'](_0x29f6('0x3a'),_0x4d4189['body']);var _0xbfe671=answerValidation[_0x29f6('0x3b')](_0x4d4189['body']);if(_0xbfe671[_0x29f6('0x29')]>0x0){return _0xb5f2b1[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0xbfe671);}var _0x27d655=_0x4d4189['body'][_0x29f6('0x2e')];var _0x2a83b7=_0x4d4189[_0x29f6('0x2c')]['sessionId'];return getAgent(_0x27d655)[_0x29f6('0x22')](function(_0x4a5f35){logger[_0x29f6('0x11')]('entityFound:',_0x4a5f35['name']);emit(util['format'](_0x29f6('0x32'),_0x4a5f35[_0x29f6('0x16')]),_0x29f6('0x3c'),{'sessionId':_0x2a83b7});return _0xb5f2b1[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x3d')});})[_0x29f6('0x35')](handleError(_0xb5f2b1));};exports[_0x29f6('0x3e')]=function(_0x352119,_0x1bde93){logger['info']('hold\x20fired:',_0x352119[_0x29f6('0x2c')]);var _0x450e76=holdValidation[_0x29f6('0x3b')](_0x352119[_0x29f6('0x2c')]);if(_0x450e76['length']>0x0){return _0x1bde93[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x450e76);}var _0x532df5=_0x352119[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x123e2f=_0x352119[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x532df5)[_0x29f6('0x22')](function(_0x320b5e){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x320b5e[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x320b5e['name']),_0x29f6('0x40'),{'sessionId':_0x123e2f});return _0x1bde93[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x41')});})[_0x29f6('0x35')](handleError(_0x1bde93));};exports['unhold']=function(_0x2e29e3,_0x52be22){logger['info'](_0x29f6('0x42'),_0x2e29e3[_0x29f6('0x2c')]);var _0x3194fa=unholdValidation[_0x29f6('0x3b')](_0x2e29e3[_0x29f6('0x2c')]);if(_0x3194fa['length']>0x0){return _0x52be22[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3194fa);}var _0x5f42f3=_0x2e29e3[_0x29f6('0x2c')]['userId'];var _0x288cf2=_0x2e29e3[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x5f42f3)[_0x29f6('0x22')](function(_0x5c9113){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5c9113[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5c9113[_0x29f6('0x16')]),_0x29f6('0x43'),{'sessionId':_0x288cf2});return _0x52be22['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x44')});})[_0x29f6('0x35')](handleError(_0x52be22));};exports[_0x29f6('0x45')]=function(_0x36e52c,_0x1ac20d){logger[_0x29f6('0x11')](_0x29f6('0x46'),_0x1ac20d[_0x29f6('0x2c')]);var _0x3dbd19=callsValidation['validate'](_0x36e52c['body']);if(_0x3dbd19[_0x29f6('0x29')]>0x0){return _0x1ac20d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3dbd19);}var _0x5ab84e=_0x36e52c[_0x29f6('0x2c')]['userId'];var _0x550190=respondWithRpcPromise(_0x29f6('0x23'));var _0x234d30=getAgent(_0x5ab84e);return Promise['all']([_0x550190,_0x234d30])['then'](function(_0x3e22f8){var _0x46998c=_0x3e22f8[0x0];var _0x439c0b=_0x3e22f8[0x1];var _0x58694e=_[_0x29f6('0x25')](_0x46998c[_0x29f6('0x26')],function(_0x4284fd){return _0x4284fd[_0x29f6('0x27')]==_0x439c0b['id'];});return _0x1ac20d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'count':_0x58694e[_0x29f6('0x29')],'rows':_0x58694e});})[_0x29f6('0x35')](handleError(_0x1ac20d));};exports[_0x29f6('0x47')]=function(_0x192525,_0x2d4c8d){logger[_0x29f6('0x11')](_0x29f6('0x48'),_0x192525['body']);var _0x5e25c0=conferenceValidation[_0x29f6('0x3b')](_0x192525['body']);if(_0x5e25c0[_0x29f6('0x29')]>0x0){return _0x2d4c8d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e25c0);}var _0x40b4d7=_0x192525[_0x29f6('0x2c')]['userId'];return getAgent(_0x40b4d7)[_0x29f6('0x22')](function(_0x38d684){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x38d684[_0x29f6('0x16')]);emit(util['format'](_0x29f6('0x32'),_0x38d684['name']),'webbar:conference');return _0x2d4c8d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0x29f6('0x35')](handleError(_0x2d4c8d));};exports[_0x29f6('0x49')]=function(_0x58bdf4,_0x44b3ee){logger[_0x29f6('0x11')](_0x29f6('0x4a'),_0x58bdf4[_0x29f6('0x2c')]);var _0xf3c5f1=transferValidation[_0x29f6('0x3b')](_0x58bdf4[_0x29f6('0x2c')]);if(_0xf3c5f1['length']>0x0){return _0x44b3ee[_0x29f6('0x17')](0x190)['json'](_0xf3c5f1);}var _0x37162d=_0x58bdf4['body']['userId'];var _0x1a3357=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x28')];var _0x536b0c=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x4b')];return getAgent(_0x37162d)[_0x29f6('0x22')](function(_0x5625b1){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5625b1[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5625b1[_0x29f6('0x16')]),_0x29f6('0x4c'),{'sessionId':_0x1a3357,'transferNumber':_0x536b0c});return _0x44b3ee[_0x29f6('0x17')](0xc8)['json']({'error':![],'message':_0x29f6('0x4d')});})[_0x29f6('0x35')](handleError(_0x44b3ee));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 41732a0..76ed6f1 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','addAnswer','post','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x150951,_0x2bad7b){var _0x30b506=function(_0x51fec4){while(--_0x51fec4){_0x150951['push'](_0x150951['shift']());}};_0x30b506(++_0x2bad7b);}(_0xb016,0x159));var _0x6b01=function(_0x32bcaf,_0xccc961){_0x32bcaf=_0x32bcaf-0x0;var _0x25867f=_0xb016[_0x32bcaf];return _0x25867f;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./whatsappAccount.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getDispositions']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x7')]('/:id/applications',auth[_0x6b01('0x8')](),controller[_0x6b01('0x10')]);router['post']('/',auth[_0x6b01('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x6b01('0x8')](),controller['addDisposition']);router['post'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router['post'](_0x6b01('0x16'),controller[_0x6b01('0x17')]);router[_0x6b01('0x12')](_0x6b01('0x18'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0x1b'),auth['isAuthenticated'](),controller[_0x6b01('0x1c')]);router[_0x6b01('0x1d')](_0x6b01('0x1b'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x1e')]);router[_0x6b01('0x1d')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x1f')]);router[_0x6b01('0x1d')](_0x6b01('0xd'),auth['isAuthenticated'](),controller[_0x6b01('0x20')]);router[_0x6b01('0x1d')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x21')]);module[_0x6b01('0x22')]=router; \ No newline at end of file +var _0x57ca=['addDisposition','addAnswer','addApplications','/:id/notify','notify','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','/:id/dispositions'];(function(_0x216e3f,_0x1ee9e1){var _0x32f8dc=function(_0x291d0e){while(--_0x291d0e){_0x216e3f['push'](_0x216e3f['shift']());}};_0x32f8dc(++_0x1ee9e1);}(_0x57ca,0x108));var _0xa57c=function(_0x29881c,_0x458fa2){_0x29881c=_0x29881c-0x0;var _0x918f30=_0x57ca[_0x29881c];return _0x918f30;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0x8')]('/:id/dispositions',auth[_0xa57c('0x9')](),controller['getDispositions']);router[_0xa57c('0x8')](_0xa57c('0xf'),auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['get'](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);router[_0xa57c('0x8')](_0xa57c('0x13'),auth['isAuthenticated'](),controller[_0xa57c('0x14')]);router['post']('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0x15')]);router[_0xa57c('0x16')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x18')]);router[_0xa57c('0x16')]('/:id/canned_answers',auth[_0xa57c('0x9')](),controller[_0xa57c('0x19')]);router[_0xa57c('0x16')]('/:id/users',auth[_0xa57c('0x9')](),controller['addAgents']);router[_0xa57c('0x16')](_0xa57c('0x13'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1a')]);router[_0xa57c('0x16')](_0xa57c('0x1b'),controller[_0xa57c('0x1c')]);router[_0xa57c('0x16')]('/:id/send',auth[_0xa57c('0x9')](),controller['send']);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1d')]);router[_0xa57c('0x1e')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x1f')]);router[_0xa57c('0x1e')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x20')]);router[_0xa57c('0x1e')](_0xa57c('0xf'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x21')]);router[_0xa57c('0x1e')](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x22')]);module[_0xa57c('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1a71a56..a1cc0d2 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25ed=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x2e8e20,_0x24dd51){var _0xb0dccd=function(_0x50ec62){while(--_0x50ec62){_0x2e8e20['push'](_0x2e8e20['shift']());}};_0xb0dccd(++_0x24dd51);}(_0x25ed,0x10e));var _0xd25e=function(_0x3c3770,_0x17a17b){_0x3c3770=_0x3c3770-0x0;var _0x57121a=_0x25ed[_0x3c3770];return _0x57121a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd25e('0x0'));module[_0xd25e('0x1')]={'name':{'type':Sequelize[_0xd25e('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd25e('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd25e('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd25e('0x3')]();}},'phone':{'type':Sequelize[_0xd25e('0x2')]},'type':{'type':Sequelize[_0xd25e('0x4')](_0xd25e('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xd25e('0x2')]},'baseUrl':{'type':Sequelize[_0xd25e('0x2')]},'authToken':{'type':Sequelize[_0xd25e('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd25e('0x6')],'defaultValue':function(){return _0xd25e('0x7');}},'notificationSound':{'type':Sequelize[_0xd25e('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd25e('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd25e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd25e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd25e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd25e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd25e('0x9')],'comment':_0xd25e('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xd25e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x490080){if(!_0x490080){this[_0xd25e('0xb')](_0xd25e('0xc'),null);}this['setDataValue'](_0xd25e('0xd'),_0x490080);}},'description':{'type':Sequelize[_0xd25e('0x2')]}}; \ No newline at end of file +var _0xeab9=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x36fabd,_0x30a9e1){var _0x45c13f=function(_0x44afa4){while(--_0x44afa4){_0x36fabd['push'](_0x36fabd['shift']());}};_0x45c13f(++_0x30a9e1);}(_0xeab9,0xd1));var _0x9eab=function(_0x3f1403,_0x2cfd1a){_0x3f1403=_0x3f1403-0x0;var _0xb8103d=_0xeab9[_0x3f1403];return _0xb8103d;};'use strict';var Sequelize=require(_0x9eab('0x0'));var rs=require(_0x9eab('0x1'));module[_0x9eab('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9eab('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9eab('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x9eab('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9eab('0x5')]();}},'phone':{'type':Sequelize[_0x9eab('0x4')]},'type':{'type':Sequelize[_0x9eab('0x6')](_0x9eab('0x7'),_0x9eab('0x8'))},'accountSid':{'type':Sequelize[_0x9eab('0x4')]},'baseUrl':{'type':Sequelize[_0x9eab('0x4')]},'authToken':{'type':Sequelize[_0x9eab('0x4')]},'notificationTemplate':{'type':Sequelize[_0x9eab('0x9')],'defaultValue':function(){return _0x9eab('0xa');}},'notificationSound':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9eab('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9eab('0xc')],'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[_0x9eab('0xc')],'comment':_0x9eab('0xd')},'mandatoryDisposition':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![],'comment':_0x9eab('0xe'),'set':function(_0x518b9a){if(!_0x518b9a){this['setDataValue'](_0x9eab('0xf'),null);}this[_0x9eab('0x10')]('mandatoryDisposition',_0x518b9a);}},'description':{'type':Sequelize[_0x9eab('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 5a5150f..a613ddc 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c95=['user','get','role','WhatsappAccounts','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','map','removeDispositions','ids','CannedAnswer','getAnswers','findAll','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','notifications','isNil','ValidationError','from\x20is\x20mandatory','mapKey','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','push','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','WhatsappAccount','includeAll','include','rows','show','params','create','body'];(function(_0x5dca1c,_0x4d4281){var _0x5ce01c=function(_0x100860){while(--_0x100860){_0x5dca1c['push'](_0x5dca1c['shift']());}};_0x5ce01c(++_0x4d4281);}(_0x6c95,0x123));var _0x56c9=function(_0x18338b,_0x357f0c){_0x18338b=_0x18338b-0x0;var _0x4cb958=_0x6c95[_0x18338b];return _0x4cb958;};'use strict';var emlformat=require(_0x56c9('0x0'));var rimraf=require(_0x56c9('0x1'));var zipdir=require(_0x56c9('0x2'));var jsonpatch=require(_0x56c9('0x3'));var rp=require('request-promise');var moment=require(_0x56c9('0x4'));var BPromise=require(_0x56c9('0x5'));var Mustache=require(_0x56c9('0x6'));var util=require('util');var path=require(_0x56c9('0x7'));var sox=require(_0x56c9('0x8'));var csv=require('to-csv');var ejs=require(_0x56c9('0x9'));var fs=require('fs');var fs_extra=require(_0x56c9('0xa'));var _=require(_0x56c9('0xb'));var squel=require(_0x56c9('0xc'));var crypto=require(_0x56c9('0xd'));var jsforce=require(_0x56c9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x56c9('0xf'));var Redis=require(_0x56c9('0x10'));var authService=require(_0x56c9('0x11'));var qs=require(_0x56c9('0x12'));var as=require(_0x56c9('0x13'));var hardwareService=require(_0x56c9('0x14'));var logger=require('../../config/logger')(_0x56c9('0x15'));var utils=require(_0x56c9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x56c9('0x17'));var db=require(_0x56c9('0x18'))['db'];config[_0x56c9('0x19')]=_[_0x56c9('0x1a')](config['redis'],{'host':_0x56c9('0x1b'),'port':0x18eb});var socket=require(_0x56c9('0x1c'))(new Redis(config[_0x56c9('0x19')]));require('./whatsappAccount.socket')[_0x56c9('0x1d')](socket);var jayson=require(_0x56c9('0x1e'));var client=jayson[_0x56c9('0x1f')][_0x56c9('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2b5ff1,_0x1fedb5,_0x34902d,_0x52f778){return new BPromise(function(_0x2426e6,_0x4d298a){var _0x27c2f0=_0x52f778||client;return _0x27c2f0[_0x56c9('0x21')](_0x2b5ff1,_0x34902d)['then'](function(_0x3f83d4){logger[_0x56c9('0x22')](_0x56c9('0x23'),_0x1fedb5,_0x56c9('0x24'));logger[_0x56c9('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1fedb5,_0x56c9('0x24'),JSON['stringify'](_0x3f83d4));if(_0x3f83d4['error']){if(_0x3f83d4[_0x56c9('0x26')][_0x56c9('0x27')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1fedb5,_0x3f83d4[_0x56c9('0x26')][_0x56c9('0x28')]);return _0x4d298a(_0x3f83d4[_0x56c9('0x26')]['message']);}logger[_0x56c9('0x26')](_0x56c9('0x23'),_0x1fedb5,_0x3f83d4['error'][_0x56c9('0x28')]);return _0x2426e6(_0x3f83d4[_0x56c9('0x26')]['message']);}else{logger[_0x56c9('0x22')](_0x56c9('0x23'),_0x1fedb5,'request\x20sent');_0x2426e6(_0x3f83d4[_0x56c9('0x29')]['message']);}})[_0x56c9('0x2a')](function(_0x4a6685){logger[_0x56c9('0x26')](_0x56c9('0x23'),_0x1fedb5,_0x4a6685);_0x4d298a(_0x4a6685);});});}function respondWithStatusCode(_0x2f7cfb,_0x166b8e){_0x166b8e=_0x166b8e||0xcc;return function(_0x2da703){if(_0x2da703){return _0x2f7cfb['sendStatus'](_0x166b8e);}return _0x2f7cfb['status'](_0x166b8e)[_0x56c9('0x2b')]();};}function respondWithResult(_0x3fce87,_0xe62384){_0xe62384=_0xe62384||0xc8;return function(_0x682678){if(_0x682678){return _0x3fce87[_0x56c9('0x2c')](_0xe62384)[_0x56c9('0x2d')](_0x682678);}};}function respondWithFilteredResult(_0x3738bb,_0x367d8d){return function(_0x45618e){if(_0x45618e){var _0x5323ae=typeof _0x367d8d[_0x56c9('0x2e')]===_0x56c9('0x2f')&&typeof _0x367d8d['limit']===_0x56c9('0x2f');var _0x30d79e=_0x45618e[_0x56c9('0x30')];var _0x20eaa6=_0x5323ae?0x0:_0x367d8d[_0x56c9('0x2e')];var _0x26b760=_0x5323ae?_0x45618e[_0x56c9('0x30')]:_0x367d8d[_0x56c9('0x2e')]+_0x367d8d[_0x56c9('0x31')];var _0x3a749a;if(_0x26b760>=_0x30d79e){_0x26b760=_0x30d79e;_0x3a749a=0xc8;}else{_0x3a749a=0xce;}_0x3738bb[_0x56c9('0x2c')](_0x3a749a);return _0x3738bb[_0x56c9('0x32')](_0x56c9('0x33'),_0x20eaa6+'-'+_0x26b760+'/'+_0x30d79e)[_0x56c9('0x2d')](_0x45618e);}return null;};}function patchUpdates(_0x28eee2){return function(_0x48fef7){try{jsonpatch['apply'](_0x48fef7,_0x28eee2,!![]);}catch(_0xacaf32){return BPromise[_0x56c9('0x34')](_0xacaf32);}return _0x48fef7[_0x56c9('0x35')]();};}function saveUpdates(_0x5b4d0c,_0x2384e1){return function(_0x184692){if(_0x184692){return _0x184692[_0x56c9('0x36')](_0x5b4d0c)[_0x56c9('0x37')](function(_0x35ad68){return _0x35ad68;});}return null;};}function removeEntity(_0x4143ec,_0x2b4e6d){return function(_0x258c45){if(_0x258c45){return _0x258c45['destroy']()[_0x56c9('0x37')](function(){var _0x402af1=_0x258c45['get']({'plain':!![]});var _0x5ea5cb='WhatsappAccounts';return db['UserProfileResource'][_0x56c9('0x38')]({'where':{'type':_0x5ea5cb,'resourceId':_0x402af1['id']}})['then'](function(){return _0x258c45;});})[_0x56c9('0x37')](function(){_0x4143ec[_0x56c9('0x2c')](0xcc)[_0x56c9('0x2b')]();});}};}function handleEntityNotFound(_0x39945c,_0x53e981){return function(_0x234050){if(!_0x234050){_0x39945c['sendStatus'](0x194);}return _0x234050;};}function handleError(_0x3fdf1d,_0x5ee59f){_0x5ee59f=_0x5ee59f||0x1f4;return function(_0x402c57){logger['error'](_0x402c57[_0x56c9('0x39')]);if(_0x402c57[_0x56c9('0x3a')]){delete _0x402c57[_0x56c9('0x3a')];}_0x3fdf1d[_0x56c9('0x2c')](_0x5ee59f)['send'](_0x402c57);};}exports[_0x56c9('0x3b')]=function(_0x5ad464,_0x481f23){var _0x4f631d={'include':[{'model':db[_0x56c9('0x3c')],'as':_0x56c9('0x3d')}]},_0x325d55={},_0x46be5d={'count':0x0,'rows':[]};var _0x295d43=_['map'](db['WhatsappAccount'][_0x56c9('0x3e')],function(_0x11fe55){return{'name':_0x11fe55['fieldName'],'type':_0x11fe55[_0x56c9('0x3f')][_0x56c9('0x40')]};});_0x325d55[_0x56c9('0x41')]=_['map'](_0x295d43,_0x56c9('0x3a'));_0x325d55[_0x56c9('0x42')]=_[_0x56c9('0x43')](_0x5ad464[_0x56c9('0x42')]);_0x325d55[_0x56c9('0x44')]=_[_0x56c9('0x45')](_0x325d55['model'],_0x325d55[_0x56c9('0x42')]);_0x4f631d['attributes']=_[_0x56c9('0x45')](_0x325d55[_0x56c9('0x41')],qs[_0x56c9('0x46')](_0x5ad464['query']['fields']));_0x4f631d['attributes']=_0x4f631d['attributes'][_0x56c9('0x47')]?_0x4f631d[_0x56c9('0x48')]:_0x325d55['model'];if(!_0x5ad464[_0x56c9('0x42')][_0x56c9('0x49')](_0x56c9('0x4a'))){_0x4f631d['limit']=qs[_0x56c9('0x31')](_0x5ad464[_0x56c9('0x42')][_0x56c9('0x31')]);_0x4f631d['offset']=qs[_0x56c9('0x2e')](_0x5ad464[_0x56c9('0x42')][_0x56c9('0x2e')]);}_0x4f631d[_0x56c9('0x4b')]=qs[_0x56c9('0x4c')](_0x5ad464['query']['sort']);_0x4f631d[_0x56c9('0x4d')]=qs[_0x56c9('0x44')](_['pick'](_0x5ad464[_0x56c9('0x42')],_0x325d55[_0x56c9('0x44')]),_0x295d43);if(_0x5ad464[_0x56c9('0x42')]['filter']){_0x4f631d[_0x56c9('0x4d')]=_[_0x56c9('0x4e')](_0x4f631d[_0x56c9('0x4d')],{'$or':_['map'](_0x295d43,function(_0x14eed9){if(_0x14eed9[_0x56c9('0x3f')]!=='VIRTUAL'){var _0x5c6b4a={};_0x5c6b4a[_0x14eed9[_0x56c9('0x3a')]]={'$like':'%'+_0x5ad464[_0x56c9('0x42')][_0x56c9('0x4f')]+'%'};return _0x5c6b4a;}})});}_0x4f631d=_[_0x56c9('0x4e')]({},_0x4f631d,_0x5ad464[_0x56c9('0x50')]);var _0x3ef2d2={'where':_0x4f631d[_0x56c9('0x4d')]};return db[_0x56c9('0x51')][_0x56c9('0x30')](_0x3ef2d2)[_0x56c9('0x37')](function(_0x57ac02){_0x46be5d[_0x56c9('0x30')]=_0x57ac02;if(_0x5ad464[_0x56c9('0x42')][_0x56c9('0x52')]){_0x4f631d[_0x56c9('0x53')]=[{'all':!![]}];}return db[_0x56c9('0x51')]['findAll'](_0x4f631d);})['then'](function(_0x2792f4){_0x46be5d[_0x56c9('0x54')]=_0x2792f4;return _0x46be5d;})[_0x56c9('0x37')](respondWithFilteredResult(_0x481f23,_0x4f631d))['catch'](handleError(_0x481f23,null));};exports[_0x56c9('0x55')]=function(_0x28c344,_0x2545bb){var _0x41a1cd={'raw':![],'where':{'id':_0x28c344[_0x56c9('0x56')]['id']},'include':[{'model':db[_0x56c9('0x3c')],'as':_0x56c9('0x3d')}]},_0x133628={};_0x133628[_0x56c9('0x41')]=_['keys'](db[_0x56c9('0x51')][_0x56c9('0x3e')]);_0x133628[_0x56c9('0x42')]=_[_0x56c9('0x43')](_0x28c344[_0x56c9('0x42')]);_0x133628[_0x56c9('0x44')]=_[_0x56c9('0x45')](_0x133628[_0x56c9('0x41')],_0x133628[_0x56c9('0x42')]);_0x41a1cd[_0x56c9('0x48')]=_[_0x56c9('0x45')](_0x133628[_0x56c9('0x41')],qs[_0x56c9('0x46')](_0x28c344['query'][_0x56c9('0x46')]));_0x41a1cd[_0x56c9('0x48')]=_0x41a1cd['attributes'][_0x56c9('0x47')]?_0x41a1cd[_0x56c9('0x48')]:_0x133628[_0x56c9('0x41')];if(_0x28c344[_0x56c9('0x42')][_0x56c9('0x52')]){_0x41a1cd[_0x56c9('0x53')]=[{'all':!![]}];}_0x41a1cd=_[_0x56c9('0x4e')]({},_0x41a1cd,_0x28c344[_0x56c9('0x50')]);return db[_0x56c9('0x51')]['find'](_0x41a1cd)[_0x56c9('0x37')](handleEntityNotFound(_0x2545bb,null))[_0x56c9('0x37')](respondWithResult(_0x2545bb,null))[_0x56c9('0x2a')](handleError(_0x2545bb,null));};exports[_0x56c9('0x57')]=function(_0x1e5b04,_0x108967){return db['WhatsappAccount'][_0x56c9('0x57')](_0x1e5b04[_0x56c9('0x58')],{})[_0x56c9('0x37')](function(_0x249886){var _0x495017=_0x1e5b04[_0x56c9('0x59')][_0x56c9('0x5a')]({'plain':!![]});if(!_0x495017)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x495017[_0x56c9('0x5b')]===_0x56c9('0x59')){var _0x3c3b58=_0x249886[_0x56c9('0x5a')]({'plain':!![]});var _0x50df73=_0x56c9('0x5c');return db[_0x56c9('0x5d')][_0x56c9('0x5e')]({'where':{'name':_0x50df73,'userProfileId':_0x495017['userProfileId']},'raw':!![]})[_0x56c9('0x37')](function(_0x4ab99c){if(_0x4ab99c&&_0x4ab99c[_0x56c9('0x5f')]===0x0){return db[_0x56c9('0x60')][_0x56c9('0x57')]({'name':_0x3c3b58['name'],'resourceId':_0x3c3b58['id'],'type':_0x4ab99c[_0x56c9('0x3a')],'sectionId':_0x4ab99c['id']},{})[_0x56c9('0x37')](function(){return _0x249886;});}else{return _0x249886;}})[_0x56c9('0x2a')](function(_0x3af444){logger[_0x56c9('0x26')](_0x56c9('0x61'),_0x3af444);throw _0x3af444;});}return _0x249886;})[_0x56c9('0x37')](respondWithResult(_0x108967,0xc9))[_0x56c9('0x2a')](handleError(_0x108967,null));};exports[_0x56c9('0x36')]=function(_0x590d20,_0x27208f){if(_0x590d20[_0x56c9('0x58')]['id']){delete _0x590d20[_0x56c9('0x58')]['id'];}return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x590d20[_0x56c9('0x56')]['id']},'include':[{'model':db[_0x56c9('0x3c')],'as':_0x56c9('0x3d')}]})['then'](handleEntityNotFound(_0x27208f,null))['then'](saveUpdates(_0x590d20['body'],null))['then'](respondWithResult(_0x27208f,null))[_0x56c9('0x2a')](handleError(_0x27208f,null));};exports[_0x56c9('0x38')]=function(_0x35de94,_0x1fd5dd){return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x35de94[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x1fd5dd,null))[_0x56c9('0x37')](removeEntity(_0x1fd5dd,null))[_0x56c9('0x2a')](handleError(_0x1fd5dd,null));};exports[_0x56c9('0x62')]=function(_0x3fee68,_0x3ef45e){return db['WhatsappAccount']['describe']()['then'](respondWithResult(_0x3ef45e,null))[_0x56c9('0x2a')](handleError(_0x3ef45e,null));};exports[_0x56c9('0x63')]=function(_0xbee9d9,_0x3a06a9,_0x43e688){if(_0xbee9d9[_0x56c9('0x58')]['id']){delete _0xbee9d9[_0x56c9('0x58')]['id'];}return db['WhatsappAccount'][_0x56c9('0x5e')]({'where':{'id':_0xbee9d9[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x3a06a9,null))['then'](function(_0x2ca792){if(_0x2ca792){_0xbee9d9['body'][_0x56c9('0x64')]=_0x2ca792['id'];return db[_0x56c9('0x65')]['create'](_0xbee9d9[_0x56c9('0x58')]);}})[_0x56c9('0x37')](respondWithResult(_0x3a06a9,null))['catch'](handleError(_0x3a06a9,null));};exports[_0x56c9('0x66')]=function(_0x5befff,_0x370373,_0x5522b1){var _0xd7144c={'raw':![],'where':{}};var _0x273fea={};var _0x4faa33={'count':0x0,'rows':[]};return db[_0x56c9('0x51')][_0x56c9('0x67')]({'where':{'id':_0x5befff[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x370373,null))[_0x56c9('0x37')](function(_0x5dd3c8){if(_0x5dd3c8){_0x273fea['model']=_[_0x56c9('0x43')](db[_0x56c9('0x65')][_0x56c9('0x3e')]);_0x273fea[_0x56c9('0x42')]=_[_0x56c9('0x43')](_0x5befff[_0x56c9('0x42')]);_0x273fea['filters']=_['intersection'](_0x273fea['model'],_0x273fea['query']);_0xd7144c[_0x56c9('0x48')]=_[_0x56c9('0x45')](_0x273fea['model'],qs[_0x56c9('0x46')](_0x5befff[_0x56c9('0x42')][_0x56c9('0x46')]));_0xd7144c[_0x56c9('0x48')]=_0xd7144c[_0x56c9('0x48')][_0x56c9('0x47')]?_0xd7144c[_0x56c9('0x48')]:_0x273fea[_0x56c9('0x41')];if(!_0x5befff[_0x56c9('0x42')][_0x56c9('0x49')](_0x56c9('0x4a'))){_0xd7144c[_0x56c9('0x31')]=qs[_0x56c9('0x31')](_0x5befff[_0x56c9('0x42')]['limit']);_0xd7144c[_0x56c9('0x2e')]=qs[_0x56c9('0x2e')](_0x5befff[_0x56c9('0x42')][_0x56c9('0x2e')]);}_0xd7144c[_0x56c9('0x4b')]=qs[_0x56c9('0x4c')](_0x5befff['query']['sort']);_0xd7144c[_0x56c9('0x4d')]=qs[_0x56c9('0x44')](_[_0x56c9('0x68')](_0x5befff[_0x56c9('0x42')],_0x273fea[_0x56c9('0x44')]));_0xd7144c[_0x56c9('0x4d')]['WhatsappAccountId']=_0x5dd3c8['id'];if(_0x5befff['query']['filter']){_0xd7144c['where']=_[_0x56c9('0x4e')](_0xd7144c[_0x56c9('0x4d')],{'$or':_[_0x56c9('0x69')](_0xd7144c[_0x56c9('0x48')],function(_0x46b990){var _0x2f13af={};_0x2f13af[_0x46b990]={'$like':'%'+_0x5befff['query'][_0x56c9('0x4f')]+'%'};return _0x2f13af;})});}_0xd7144c=_[_0x56c9('0x4e')]({},_0xd7144c,_0x5befff[_0x56c9('0x50')]);return db[_0x56c9('0x65')]['count']({'where':_0xd7144c[_0x56c9('0x4d')]})[_0x56c9('0x37')](function(_0x185988){_0x4faa33['count']=_0x185988;if(_0x5befff['query'][_0x56c9('0x52')]){_0xd7144c[_0x56c9('0x53')]=[{'all':!![]}];}return db[_0x56c9('0x65')]['findAll'](_0xd7144c);})[_0x56c9('0x37')](function(_0x521a11){_0x4faa33[_0x56c9('0x54')]=_0x521a11;return _0x4faa33;});}})['then'](respondWithFilteredResult(_0x370373,_0xd7144c))[_0x56c9('0x2a')](handleError(_0x370373,null));};exports[_0x56c9('0x6a')]=function(_0x186057,_0x123d9b,_0x9a186a){return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x186057[_0x56c9('0x56')]['id']}})['then'](handleEntityNotFound(_0x123d9b,null))[_0x56c9('0x37')](function(_0x4c6626){if(_0x4c6626){return _0x4c6626[_0x56c9('0x6a')](_0x186057[_0x56c9('0x42')][_0x56c9('0x6b')]);}})[_0x56c9('0x37')](respondWithStatusCode(_0x123d9b,null))['catch'](handleError(_0x123d9b,null));};exports['addAnswer']=function(_0x44b438,_0x279db0,_0x51b51a){if(_0x44b438['body']['id']){delete _0x44b438['body']['id'];}return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x44b438[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x279db0,null))['then'](function(_0x213598){if(_0x213598){_0x44b438[_0x56c9('0x58')][_0x56c9('0x64')]=_0x213598['id'];return db[_0x56c9('0x6c')]['create'](_0x44b438['body']);}})[_0x56c9('0x37')](respondWithResult(_0x279db0,null))[_0x56c9('0x2a')](handleError(_0x279db0,null));};exports[_0x56c9('0x6d')]=function(_0xa2cb6e,_0x139514,_0x552be8){var _0xbea7f6={'raw':![],'where':{}};var _0x4bef41={};var _0x13c215={'count':0x0,'rows':[]};return db[_0x56c9('0x51')]['findOne']({'where':{'id':_0xa2cb6e[_0x56c9('0x56')]['id']}})['then'](handleEntityNotFound(_0x139514,null))[_0x56c9('0x37')](function(_0x39375f){if(_0x39375f){_0x4bef41[_0x56c9('0x41')]=_[_0x56c9('0x43')](db[_0x56c9('0x6c')][_0x56c9('0x3e')]);_0x4bef41[_0x56c9('0x42')]=_[_0x56c9('0x43')](_0xa2cb6e['query']);_0x4bef41[_0x56c9('0x44')]=_['intersection'](_0x4bef41[_0x56c9('0x41')],_0x4bef41[_0x56c9('0x42')]);_0xbea7f6[_0x56c9('0x48')]=_[_0x56c9('0x45')](_0x4bef41[_0x56c9('0x41')],qs[_0x56c9('0x46')](_0xa2cb6e[_0x56c9('0x42')]['fields']));_0xbea7f6[_0x56c9('0x48')]=_0xbea7f6[_0x56c9('0x48')][_0x56c9('0x47')]?_0xbea7f6[_0x56c9('0x48')]:_0x4bef41[_0x56c9('0x41')];if(!_0xa2cb6e['query']['hasOwnProperty'](_0x56c9('0x4a'))){_0xbea7f6['limit']=qs[_0x56c9('0x31')](_0xa2cb6e['query']['limit']);_0xbea7f6[_0x56c9('0x2e')]=qs['offset'](_0xa2cb6e[_0x56c9('0x42')]['offset']);}_0xbea7f6[_0x56c9('0x4b')]=qs['sort'](_0xa2cb6e[_0x56c9('0x42')][_0x56c9('0x4c')]);_0xbea7f6[_0x56c9('0x4d')]=qs[_0x56c9('0x44')](_['pick'](_0xa2cb6e[_0x56c9('0x42')],_0x4bef41[_0x56c9('0x44')]));_0xbea7f6[_0x56c9('0x4d')]['WhatsappAccountId']=_0x39375f['id'];if(_0xa2cb6e['query'][_0x56c9('0x4f')]){_0xbea7f6[_0x56c9('0x4d')]=_[_0x56c9('0x4e')](_0xbea7f6['where'],{'$or':_[_0x56c9('0x69')](_0xbea7f6[_0x56c9('0x48')],function(_0x57e89c){var _0x13ab0c={};_0x13ab0c[_0x57e89c]={'$like':'%'+_0xa2cb6e[_0x56c9('0x42')][_0x56c9('0x4f')]+'%'};return _0x13ab0c;})});}_0xbea7f6=_[_0x56c9('0x4e')]({},_0xbea7f6,_0xa2cb6e['options']);return db[_0x56c9('0x6c')][_0x56c9('0x30')]({'where':_0xbea7f6[_0x56c9('0x4d')]})[_0x56c9('0x37')](function(_0x3cbf59){_0x13c215[_0x56c9('0x30')]=_0x3cbf59;if(_0xa2cb6e[_0x56c9('0x42')][_0x56c9('0x52')]){_0xbea7f6[_0x56c9('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x56c9('0x6e')](_0xbea7f6);})[_0x56c9('0x37')](function(_0x3bd0c8){_0x13c215[_0x56c9('0x54')]=_0x3bd0c8;return _0x13c215;});}})[_0x56c9('0x37')](respondWithFilteredResult(_0x139514,_0xbea7f6))[_0x56c9('0x2a')](handleError(_0x139514,null));};exports[_0x56c9('0x6f')]=function(_0x215f31,_0x580078,_0x1a4703){return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x215f31[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x580078,null))[_0x56c9('0x37')](function(_0x552edc){if(_0x552edc){return _0x552edc['removeAnswers'](_0x215f31[_0x56c9('0x42')][_0x56c9('0x6b')]);}})[_0x56c9('0x37')](respondWithStatusCode(_0x580078,null))['catch'](handleError(_0x580078,null));};exports[_0x56c9('0x70')]=function(_0x4f4f3f,_0x31ba1f,_0x22eba1){return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x4f4f3f['params']['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x31ba1f,null))[_0x56c9('0x37')](function(_0x38cdda){if(_0x38cdda){return _0x38cdda[_0x56c9('0x70')](_0x4f4f3f[_0x56c9('0x58')]['ids'],_[_0x56c9('0x71')](_0x4f4f3f[_0x56c9('0x58')],[_0x56c9('0x6b'),'id'])||{})[_0x56c9('0x72')](function(_0x443712){for(var _0x371885=0x0;_0x371885<_0x4f4f3f[_0x56c9('0x58')][_0x56c9('0x6b')]['length'];_0x371885+=0x1){socket[_0x56c9('0x73')](_0x56c9('0x74'),{'UserId':Number(_0x4f4f3f[_0x56c9('0x58')]['ids'][_0x371885]),'WhatsappAccountId':Number(_0x4f4f3f['params']['id'])});}return _0x443712;});}})[_0x56c9('0x37')](respondWithResult(_0x31ba1f,null))[_0x56c9('0x2a')](handleError(_0x31ba1f,null));};exports[_0x56c9('0x75')]=function(_0x2a383a,_0x9f318b,_0x13d813){return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x2a383a[_0x56c9('0x56')]['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x9f318b,null))[_0x56c9('0x37')](function(_0xdab23b){if(_0xdab23b){return _0xdab23b[_0x56c9('0x75')](_0x2a383a[_0x56c9('0x42')][_0x56c9('0x6b')])[_0x56c9('0x37')](function(){if(_[_0x56c9('0x76')](_0x2a383a[_0x56c9('0x42')][_0x56c9('0x6b')])){for(var _0x195a30=0x0;_0x195a30<_0x2a383a[_0x56c9('0x42')][_0x56c9('0x6b')]['length'];_0x195a30+=0x1){socket[_0x56c9('0x73')](_0x56c9('0x77'),{'UserId':Number(_0x2a383a['query'][_0x56c9('0x6b')][_0x195a30]),'WhatsappAccountId':Number(_0x2a383a[_0x56c9('0x56')]['id'])});}}else{socket[_0x56c9('0x73')](_0x56c9('0x77'),{'UserId':Number(_0x2a383a[_0x56c9('0x42')]['ids']),'WhatsappAccountId':Number(_0x2a383a[_0x56c9('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x9f318b,null))['catch'](handleError(_0x9f318b,null));};exports[_0x56c9('0x78')]=function(_0x428951,_0x11733a,_0x5f2b18){var _0x3906fc={};var _0x4b5980={};var _0x3f9516;var _0x2c1262;return db[_0x56c9('0x51')]['findOne']({'where':{'id':_0x428951['params']['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x11733a,null))['then'](function(_0x3c362d){if(_0x3c362d){_0x3f9516=_0x3c362d;_0x4b5980[_0x56c9('0x41')]=_[_0x56c9('0x43')](db[_0x56c9('0x79')][_0x56c9('0x3e')]);_0x4b5980['query']=_['keys'](_0x428951[_0x56c9('0x42')]);_0x4b5980[_0x56c9('0x44')]=_[_0x56c9('0x45')](_0x4b5980[_0x56c9('0x41')],_0x4b5980[_0x56c9('0x42')]);_0x3906fc['attributes']=_['intersection'](_0x4b5980[_0x56c9('0x41')],qs[_0x56c9('0x46')](_0x428951[_0x56c9('0x42')]['fields']));_0x3906fc[_0x56c9('0x48')]=_0x3906fc['attributes'][_0x56c9('0x47')]?_0x3906fc[_0x56c9('0x48')]:_0x4b5980[_0x56c9('0x41')];_0x3906fc[_0x56c9('0x4b')]=qs['sort'](_0x428951[_0x56c9('0x42')][_0x56c9('0x4c')]);_0x3906fc['where']=qs['filters'](_[_0x56c9('0x68')](_0x428951[_0x56c9('0x42')],_0x4b5980[_0x56c9('0x44')]));if(_0x428951['query']['filter']){_0x3906fc[_0x56c9('0x4d')]=_['merge'](_0x3906fc['where'],{'$or':_['map'](_0x3906fc[_0x56c9('0x48')],function(_0xc289d1){var _0xe06725={};_0xe06725[_0xc289d1]={'$like':'%'+_0x428951[_0x56c9('0x42')]['filter']+'%'};return _0xe06725;})});}_0x3906fc=_[_0x56c9('0x4e')]({},_0x3906fc,_0x428951[_0x56c9('0x50')]);return _0x3f9516['getAgents'](_0x3906fc);}})['then'](function(_0x4e203f){if(_0x4e203f){_0x2c1262=_0x4e203f[_0x56c9('0x47')];if(!_0x428951[_0x56c9('0x42')][_0x56c9('0x49')]('nolimit')){_0x3906fc[_0x56c9('0x31')]=qs[_0x56c9('0x31')](_0x428951[_0x56c9('0x42')][_0x56c9('0x31')]);_0x3906fc[_0x56c9('0x2e')]=qs[_0x56c9('0x2e')](_0x428951['query'][_0x56c9('0x2e')]);}return _0x3f9516[_0x56c9('0x78')](_0x3906fc);}})[_0x56c9('0x37')](function(_0xe24c7d){if(_0xe24c7d){return _0xe24c7d?{'count':_0x2c1262,'rows':_0xe24c7d}:null;}})[_0x56c9('0x37')](respondWithResult(_0x11733a,null))[_0x56c9('0x2a')](handleError(_0x11733a,null));};exports[_0x56c9('0x7a')]=function(_0x16bbb3,_0x294013){var _0x35fdf3=_0x16bbb3[_0x56c9('0x56')]['id'];var _0x374ec5=_0x16bbb3['body'];var _0x679bf3=0xc8;var _0x42dc09=null;return db[_0x56c9('0x7b')][_0x56c9('0x7c')]({'isolationLevel':db['sequelize']['Transaction'][_0x56c9('0x7d')][_0x56c9('0x7e')]},function(_0xc73984){return db['WhatsappAccount'][_0x56c9('0x67')]({'where':{'id':_0x35fdf3},'transaction':_0xc73984})['then'](function(_0x533b0a){if(_0x533b0a){return db['WhatsappApplication'][_0x56c9('0x38')]({'where':{'WhatsappAccountId':_0x35fdf3},'transaction':_0xc73984})[_0x56c9('0x37')](function(){var _0x152c9d=_['map'](_0x374ec5,function(_0x20b969){_0x20b969[_0x56c9('0x64')]=_0x35fdf3;return _0x20b969;});return db[_0x56c9('0x7f')]['bulkCreate'](_0x152c9d,{'transaction':_0xc73984});});}else{_0x679bf3=0x194;_0x42dc09=[];}});})['then'](function(){if(_0x679bf3!==0x194){return db[_0x56c9('0x7f')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x35fdf3},'order':_0x56c9('0x80')})[_0x56c9('0x37')](function(_0x2218df){_0x42dc09=_0x2218df;});}})[_0x56c9('0x2a')](function(_0x30b479){_0x679bf3=0x1f4;logger[_0x56c9('0x26')](_0x30b479[_0x56c9('0x39')]);if(_0x30b479['name']){delete _0x30b479['name'];}_0x42dc09=_0x30b479;})[_0x56c9('0x81')](function(){if(_0x42dc09===null){_0x294013['sendStatus'](_0x679bf3);}else{if(_0x679bf3===0x1f4){_0x294013[_0x56c9('0x2c')](_0x679bf3)[_0x56c9('0x82')](_0x42dc09);}else{_0x294013[_0x56c9('0x2c')](_0x679bf3)[_0x56c9('0x2d')](_0x42dc09);}}});};exports[_0x56c9('0x83')]=function(_0x2d77b1,_0x8e28f7,_0xdf4ab9){var _0x5e4c07={};var _0x38bbf4={};var _0x33ff4d;var _0x2246bc;return db[_0x56c9('0x51')][_0x56c9('0x67')]({'where':{'id':_0x2d77b1['params']['id']}})[_0x56c9('0x37')](handleEntityNotFound(_0x8e28f7,null))['then'](function(_0x1698a8){if(_0x1698a8){_0x33ff4d=_0x1698a8;_0x38bbf4[_0x56c9('0x41')]=_[_0x56c9('0x43')](db['WhatsappApplication']['rawAttributes']);_0x38bbf4[_0x56c9('0x42')]=_['keys'](_0x2d77b1[_0x56c9('0x42')]);_0x38bbf4['filters']=_[_0x56c9('0x45')](_0x38bbf4[_0x56c9('0x41')],_0x38bbf4[_0x56c9('0x42')]);_0x5e4c07[_0x56c9('0x48')]=_[_0x56c9('0x45')](_0x38bbf4['model'],qs['fields'](_0x2d77b1[_0x56c9('0x42')][_0x56c9('0x46')]));_0x5e4c07[_0x56c9('0x48')]=_0x5e4c07[_0x56c9('0x48')]['length']?_0x5e4c07[_0x56c9('0x48')]:_0x38bbf4[_0x56c9('0x41')];_0x5e4c07[_0x56c9('0x4b')]=qs[_0x56c9('0x4c')](_0x2d77b1[_0x56c9('0x42')][_0x56c9('0x4c')]);_0x5e4c07[_0x56c9('0x4d')]=qs['filters'](_[_0x56c9('0x68')](_0x2d77b1[_0x56c9('0x42')],_0x38bbf4[_0x56c9('0x44')]));if(_0x2d77b1[_0x56c9('0x42')][_0x56c9('0x4f')]){_0x5e4c07[_0x56c9('0x4d')]=_[_0x56c9('0x4e')](_0x5e4c07[_0x56c9('0x4d')],{'$or':_['map'](_0x5e4c07[_0x56c9('0x48')],function(_0x583cf5){var _0x25d7df={};_0x25d7df[_0x583cf5]={'$like':'%'+_0x2d77b1[_0x56c9('0x42')][_0x56c9('0x4f')]+'%'};return _0x25d7df;})});}_0x5e4c07=_[_0x56c9('0x4e')]({},_0x5e4c07,_0x2d77b1['options']);return _0x33ff4d[_0x56c9('0x83')](_0x5e4c07);}})[_0x56c9('0x37')](function(_0x3e8ed9){if(_0x3e8ed9){_0x2246bc=_0x3e8ed9[_0x56c9('0x47')];if(!_0x2d77b1['query'][_0x56c9('0x49')](_0x56c9('0x4a'))){_0x5e4c07[_0x56c9('0x31')]=qs[_0x56c9('0x31')](_0x2d77b1[_0x56c9('0x42')][_0x56c9('0x31')]);_0x5e4c07[_0x56c9('0x2e')]=qs[_0x56c9('0x2e')](_0x2d77b1[_0x56c9('0x42')]['offset']);}return _0x33ff4d[_0x56c9('0x83')](_0x5e4c07);}})[_0x56c9('0x37')](function(_0x584cc7){if(_0x584cc7){return _0x584cc7?{'count':_0x2246bc,'rows':_0x584cc7}:null;}})[_0x56c9('0x37')](respondWithResult(_0x8e28f7,null))[_0x56c9('0x2a')](handleError(_0x8e28f7,null));};exports[_0x56c9('0x84')]=function(_0x372e08,_0x1a5eba,_0x32fcae){var _0x1e3635={'channel':_0x56c9('0x85')};var _0x43be79=[];var _0x46b76f=[];var _0x21b5d9={};return db[_0x56c9('0x51')][_0x56c9('0x5e')]({'where':{'id':_0x372e08[_0x56c9('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x56c9('0x86')}]})['then'](handleEntityNotFound(_0x1a5eba,null))[_0x56c9('0x37')](function(_0x2a53d6){_0x1e3635[_0x56c9('0x87')]=_0x2a53d6;if(_0x1e3635['account']&&_0x1e3635[_0x56c9('0x87')][_0x56c9('0x3f')]===_0x56c9('0x88')&&_0x372e08[_0x56c9('0x58')][_0x56c9('0x89')]){if(_0x372e08[_0x56c9('0x58')]['statuses'][_0x56c9('0x47')]===0x0)return;if(_0x372e08['body'][_0x56c9('0x89')][0x0][_0x56c9('0x8a')]!=='read')return;return db[_0x56c9('0x8b')][_0x56c9('0x36')]({'read':!![],'readAt':_0x372e08[_0x56c9('0x58')][_0x56c9('0x89')][0x0][_0x56c9('0x8c')]},{'where':{'messageId':_0x372e08[_0x56c9('0x58')][_0x56c9('0x89')][0x0][_0x56c9('0x8d')]},'individualHooks':!![]})[_0x56c9('0x37')](function(_0x5c1c56){return _0x1a5eba['status'](0xc8)[_0x56c9('0x2d')](_0x5c1c56);});}_0x1e3635[_0x56c9('0x8e')]=_[_0x56c9('0x8f')](_0x2a53d6[_0x56c9('0x86')],[_0x56c9('0x80')],['asc']);if(_0x1e3635[_0x56c9('0x87')]['Applications']){delete _0x1e3635[_0x56c9('0x87')][_0x56c9('0x86')];}return db[_0x56c9('0x90')][_0x56c9('0x62')]()[_0x56c9('0x37')](function(_0x4e950e){if(!_0x4e950e){throw new db[(_0x56c9('0x91'))]['ValidationError'](_0x56c9('0x92'));}_0x43be79=_[_0x56c9('0x93')](_[_0x56c9('0x43')](_0x4e950e),['createdAt',_0x56c9('0x94')]);_0x46b76f=_[_0x56c9('0x93')](_[_0x56c9('0x43')](_0x4e950e),[_0x56c9('0x95'),'updatedAt','CompanyId',_0x56c9('0x96')]);_0x1e3635[_0x56c9('0x58')]={'mapKey':_0x56c9('0x97')};if(_0x1e3635['account']&&_0x1e3635[_0x56c9('0x87')][_0x56c9('0x3f')]===_0x56c9('0x98')){_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')]=_0x372e08[_0x56c9('0x58')][_0x56c9('0x9a')][_0x56c9('0x9b')](_0x56c9('0x9c'),'');_0x1e3635[_0x56c9('0x58')][_0x56c9('0x58')]=_0x372e08[_0x56c9('0x58')]['Body'];_0x1e3635['body'][_0x56c9('0x9d')]=_0x372e08['body'][_0x56c9('0x9e')];}if(_0x1e3635['account']&&_0x1e3635['account'][_0x56c9('0x3f')]===_0x56c9('0x88')){_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')]=_0x372e08['body'][_0x56c9('0x9f')][0x0]['from'];_0x1e3635['body'][_0x56c9('0x58')]=_0x372e08['body']['notifications'][0x0][_0x56c9('0x28')][_0x56c9('0x58')];_0x1e3635['body'][_0x56c9('0x9d')]=_0x372e08['body'][_0x56c9('0x9f')][0x0][_0x56c9('0x8d')];}if(_0x1e3635[_0x56c9('0x58')]['id']){delete _0x1e3635['body']['id'];}if(_[_0x56c9('0xa0')](_0x1e3635['body'][_0x56c9('0x99')])){throw new db[(_0x56c9('0x91'))][(_0x56c9('0xa1'))](_0x56c9('0xa2'));}if(_[_0x56c9('0xa0')](_0x1e3635['body'][_0x56c9('0x58')])||_0x1e3635[_0x56c9('0x58')][_0x56c9('0x58')]===''){throw new db[(_0x56c9('0x91'))][(_0x56c9('0xa1'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x56c9('0xa0')](_0x1e3635['body']['mapKey'])){throw new db[(_0x56c9('0x91'))][(_0x56c9('0xa1'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46b76f);}if(!_['includes'](_0x46b76f,_0x1e3635['body'][_0x56c9('0xa3')])){throw new db['Sequelize'][(_0x56c9('0xa1'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46b76f);}_0x21b5d9[_0x1e3635[_0x56c9('0x58')][_0x56c9('0xa3')]]=_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')];return db[_0x56c9('0xa4')]['find']({'where':{'id':_0x1e3635[_0x56c9('0x87')][_0x56c9('0x96')]},'include':[{'model':db[_0x56c9('0x90')],'as':_0x56c9('0xa5'),'where':_0x21b5d9,'limit':0x1,'order':[[_0x56c9('0x94'),_0x56c9('0xa6')]]}]});})[_0x56c9('0x37')](handleEntityNotFound(_0x1a5eba,null))['then'](function(_0x4f9db8){if(_0x4f9db8){_0x1e3635[_0x56c9('0xa7')]=_[_0x56c9('0x71')](_0x4f9db8,[_0x56c9('0xa5')]);if(_0x4f9db8[_0x56c9('0xa5')][_0x56c9('0x47')]){return _0x4f9db8[_0x56c9('0xa5')][0x0];}var _0x2c441e=_[_0x56c9('0x1a')](_0x1e3635[_0x56c9('0x58')],{'firstName':_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')],'ListId':_0x4f9db8['id']});_0x2c441e[_0x1e3635[_0x56c9('0x58')]['mapKey']]=_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')];return db[_0x56c9('0x90')][_0x56c9('0x57')](_0x2c441e,{'fields':_0x43be79,'raw':!![]});}})[_0x56c9('0x37')](handleEntityNotFound(_0x1a5eba,null))[_0x56c9('0x37')](function(_0x13514a){if(_0x13514a){_0x1e3635['contact']=_0x13514a;var _0x53e3a6={'ContactId':_0x13514a['id'],'phone':_0x1e3635[_0x56c9('0x58')][_0x56c9('0x99')],'WhatsappAccountId':_0x372e08[_0x56c9('0x56')]['id']};var _0x31ef05={'ContactId':_0x13514a['id'],'WhatsappAccountId':_0x372e08[_0x56c9('0x56')]['id'],'closed':![]};return db[_0x56c9('0xa8')][_0x56c9('0x5e')]({'where':_0x31ef05})['then'](function(_0x465b62){if(_0x465b62){return[_0x465b62,![]];}return db['WhatsappInteraction'][_0x56c9('0x57')](_0x53e3a6)['then'](function(_0x1df4e7){return[_0x1df4e7,!![]];});});}})[_0x56c9('0x72')](function(_0x180c2d,_0x3371d7){_0x1e3635[_0x56c9('0xa9')]=_0x180c2d['get']({'plain':!![]});_0x1e3635[_0x56c9('0xa9')][_0x56c9('0xaa')]=![];if(_0x3371d7){if(_0x1e3635[_0x56c9('0x87')][_0x56c9('0xab')]){_0x1e3635[_0x56c9('0x8e')][_0x56c9('0xac')]({'id':0x0,'priority':_0x1e3635['applications'][_0x56c9('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x56c9('0xad')});}_0x1e3635[_0x56c9('0xa9')][_0x56c9('0xaa')]=!![];}return db[_0x56c9('0x8b')]['create']({'phone':_0x1e3635['body'][_0x56c9('0x99')],'messageId':_0x1e3635[_0x56c9('0x58')][_0x56c9('0x9d')],'body':_0x1e3635[_0x56c9('0x58')]['body'],'WhatsappAccountId':_0x372e08['params']['id'],'WhatsappInteractionId':_0x180c2d['id'],'direction':'in','ContactId':_0x180c2d[_0x56c9('0xae')],'AttachmentId':_0x1e3635[_0x56c9('0x58')]['AttachmentId']});})[_0x56c9('0x37')](function(_0x3e970f){_0x1e3635[_0x56c9('0x28')]=_0x3e970f;if(_0x1e3635[_0x56c9('0xa9')]['UserId']){return db[_0x56c9('0x79')]['find']({'attributes':['id',_0x56c9('0x3a')],'where':{'id':_0x1e3635[_0x56c9('0xa9')][_0x56c9('0xaf')]}})[_0x56c9('0x37')](function(_0x54a3d4){if(_0x54a3d4){_0x1e3635[_0x56c9('0x8e')][_0x56c9('0xb0')]({'id':0x0,'priority':0x0,'app':_0x56c9('0xb1'),'appdata':_0x54a3d4[_0x56c9('0x3a')]+','+(_0x1e3635[_0x56c9('0x87')][_0x56c9('0xb2')]||0xa),'interval':_0x56c9('0xad')});}return respondWithRpcPromise(_0x56c9('0xb3'),_0x56c9('0xb4'),_0x1e3635);});}return respondWithRpcPromise('Start',_0x56c9('0xb4'),_0x1e3635);})[_0x56c9('0x37')](function(_0x2df111){if(_0x2df111){var _0x256a9f=0xc8;var _0x4040a1=_0x56c9('0xb5');logger[_0x56c9('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4040a1,_0x256a9f,_0x56c9('0xb6'));logger[_0x56c9('0x25')](_0x56c9('0xb7'),_0x4040a1,_0x256a9f,_0x56c9('0xb6'),JSON[_0x56c9('0xb8')](_0x2df111));if(_0x1e3635[_0x56c9('0x87')][_0x56c9('0x3f')]===_0x56c9('0x98')){return _0x1a5eba[_0x56c9('0x2c')](_0x256a9f)[_0x56c9('0x32')]('Content-Type',_0x56c9('0xb9'))[_0x56c9('0x82')](_0x56c9('0xba'));}else{return _0x1a5eba[_0x56c9('0x2c')](_0x256a9f)[_0x56c9('0x2d')](_0x2df111);}}});})[_0x56c9('0x2a')](handleError(_0x1a5eba,null));};exports['send']=function(_0x177fda,_0x1d7a8f,_0x547b89){var _0x3754fb,_0x5bf1d5,_0x5f4b3e;if(_[_0x56c9('0xa0')](_0x177fda[_0x56c9('0x58')]['body'])||_0x177fda['body'][_0x56c9('0x58')]===''){throw new db[(_0x56c9('0x91'))][(_0x56c9('0xa1'))](_0x56c9('0xbb'));}if(_[_0x56c9('0xa0')](_0x177fda[_0x56c9('0x58')]['to'])){throw new db[(_0x56c9('0x91'))]['ValidationError']('to\x20is\x20mandatory');}_0x3754fb=_0x177fda[_0x56c9('0x58')]['to'];return db[_0x56c9('0x51')]['find']({'where':{'id':_0x177fda[_0x56c9('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x3754fb},'limit':0x1,'order':[[_0x56c9('0x94'),_0x56c9('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x1d7a8f,null))['then'](function(_0x6a0542){if(_0x6a0542&&_0x6a0542[_0x56c9('0xbc')]){_0x5bf1d5=_0x6a0542[_0x56c9('0x5a')]({'plain':!![]});if(_0x5bf1d5[_0x56c9('0xbc')]&&_0x5bf1d5['List'][_0x56c9('0xa5')][_0x56c9('0x47')]){return _0x5bf1d5['List'][_0x56c9('0xa5')][0x0];}return db[_0x56c9('0x90')][_0x56c9('0x57')](_['defaults'](_0x177fda[_0x56c9('0x58')],{'firstName':_0x3754fb,'mobile':_0x3754fb,'phone':_0x3754fb,'ListId':_0x5bf1d5[_0x56c9('0x96')]}));}})[_0x56c9('0x37')](handleEntityNotFound(_0x1d7a8f,null))[_0x56c9('0x37')](function(_0x22dff9){if(_0x22dff9){_0x5f4b3e=_0x22dff9;return db['WhatsappInteraction'][_0x56c9('0x5e')]({'where':{'ContactId':_0x5f4b3e['id'],'closed':![],'WhatsappAccountId':_0x5bf1d5['id']}})[_0x56c9('0x37')](function(_0x709360){if(_0x709360){return[_0x709360,![]];}return db['WhatsappInteraction'][_0x56c9('0x57')]({'UserId':_0x177fda['user']['id'],'ContactId':_0x5f4b3e['id'],'WhatsappAccountId':_0x5bf1d5['id'],'phone':_0x3754fb,'firstMsgDirection':'out','Messages':[_[_0x56c9('0x4e')](_0x177fda[_0x56c9('0x58')],{'read':![],'body':_0x177fda[_0x56c9('0x58')][_0x56c9('0x58')],'phone':_0x3754fb,'WhatsappAccountId':_0x5bf1d5['id'],'UserId':_0x177fda[_0x56c9('0x59')]['id'],'ContactId':_0x5f4b3e['id']})]},{'include':[{'model':db[_0x56c9('0x8b')],'as':'Messages'}]})[_0x56c9('0x37')](function(_0xc1bcb4){return[_0xc1bcb4,!![]];});});}})[_0x56c9('0x72')](function(_0x2796fd,_0x4e0ad5){if(_0x4e0ad5){return _0x2796fd;}return db[_0x56c9('0x8b')][_0x56c9('0x57')](_[_0x56c9('0x4e')](_0x177fda[_0x56c9('0x58')],{'read':![],'body':_0x177fda[_0x56c9('0x58')][_0x56c9('0x58')],'phone':_0x3754fb,'WhatsappAccountId':_0x5bf1d5['id'],'WhatsappInteractionId':_0x2796fd['id'],'UserId':_0x177fda[_0x56c9('0x59')]['id'],'ContactId':_0x5f4b3e['id']}))[_0x56c9('0x37')](function(_0x5a63af){_0x2796fd['dataValues']['Messages']=[];_0x2796fd[_0x56c9('0xbd')]['Messages'][_0x56c9('0xac')](_0x5a63af[_0x56c9('0xbd')]);return _0x2796fd;});})[_0x56c9('0x37')](respondWithResult(_0x1d7a8f,null))['catch'](handleError(_0x1d7a8f,null));}; \ No newline at end of file +var _0x0a53=['messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','CmList','List','user','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','type','filter','options','where','include','findAll','rows','params','keys','rawAttributes','intersection','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','Disposition','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','twilio','from','From','whatsapp:'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x0a53,0x1a2));var _0x30a5=function(_0x3f146c,_0x42e0dc){_0x3f146c=_0x3f146c-0x0;var _0x407f72=_0x0a53[_0x3f146c];return _0x407f72;};'use strict';var emlformat=require(_0x30a5('0x0'));var rimraf=require(_0x30a5('0x1'));var zipdir=require(_0x30a5('0x2'));var jsonpatch=require(_0x30a5('0x3'));var rp=require('request-promise');var moment=require(_0x30a5('0x4'));var BPromise=require(_0x30a5('0x5'));var Mustache=require('mustache');var util=require(_0x30a5('0x6'));var path=require('path');var sox=require(_0x30a5('0x7'));var csv=require(_0x30a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a5('0x9'));var _=require('lodash');var squel=require(_0x30a5('0xa'));var crypto=require('crypto');var jsforce=require(_0x30a5('0xb'));var deskjs=require(_0x30a5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x30a5('0xd'));var Papa=require(_0x30a5('0xe'));var Redis=require(_0x30a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x30a5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30a5('0x11'));var logger=require('../../config/logger')(_0x30a5('0x12'));var utils=require(_0x30a5('0x13'));var config=require(_0x30a5('0x14'));var licenseUtil=require(_0x30a5('0x15'));var db=require(_0x30a5('0x16'))['db'];config[_0x30a5('0x17')]=_[_0x30a5('0x18')](config[_0x30a5('0x17')],{'host':_0x30a5('0x19'),'port':0x18eb});var socket=require(_0x30a5('0x1a'))(new Redis(config[_0x30a5('0x17')]));require(_0x30a5('0x1b'))['register'](socket);var jayson=require(_0x30a5('0x1c'));var client=jayson[_0x30a5('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2ddfa9,_0x36db76,_0x179445,_0x21e02c){return new BPromise(function(_0x99879e,_0x4d71ab){var _0x18c539=_0x21e02c||client;return _0x18c539[_0x30a5('0x1e')](_0x2ddfa9,_0x179445)[_0x30a5('0x1f')](function(_0x4a2ac9){logger['info'](_0x30a5('0x20'),_0x36db76,'request\x20sent');logger[_0x30a5('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x36db76,_0x30a5('0x22'),JSON[_0x30a5('0x23')](_0x4a2ac9));if(_0x4a2ac9['error']){if(_0x4a2ac9[_0x30a5('0x24')]['code']===0x1f4){logger['error'](_0x30a5('0x20'),_0x36db76,_0x4a2ac9['error'][_0x30a5('0x25')]);return _0x4d71ab(_0x4a2ac9[_0x30a5('0x24')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x36db76,_0x4a2ac9['error']['message']);return _0x99879e(_0x4a2ac9[_0x30a5('0x24')][_0x30a5('0x25')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x36db76,_0x30a5('0x22'));_0x99879e(_0x4a2ac9[_0x30a5('0x26')]['message']);}})[_0x30a5('0x27')](function(_0x13d804){logger[_0x30a5('0x24')](_0x30a5('0x20'),_0x36db76,_0x13d804);_0x4d71ab(_0x13d804);});});}function respondWithStatusCode(_0x4f06b7,_0x41447b){_0x41447b=_0x41447b||0xcc;return function(_0x3781d8){if(_0x3781d8){return _0x4f06b7[_0x30a5('0x28')](_0x41447b);}return _0x4f06b7[_0x30a5('0x29')](_0x41447b)['end']();};}function respondWithResult(_0x394399,_0x2fdfa5){_0x2fdfa5=_0x2fdfa5||0xc8;return function(_0x48ff02){if(_0x48ff02){return _0x394399[_0x30a5('0x29')](_0x2fdfa5)[_0x30a5('0x2a')](_0x48ff02);}};}function respondWithFilteredResult(_0xa33a7e,_0x1d5dc6){return function(_0x2af9db){if(_0x2af9db){var _0x5e9b73=typeof _0x1d5dc6[_0x30a5('0x2b')]===_0x30a5('0x2c')&&typeof _0x1d5dc6[_0x30a5('0x2d')]===_0x30a5('0x2c');var _0x3e6285=_0x2af9db['count'];var _0x145191=_0x5e9b73?0x0:_0x1d5dc6[_0x30a5('0x2b')];var _0x8319d9=_0x5e9b73?_0x2af9db[_0x30a5('0x2e')]:_0x1d5dc6[_0x30a5('0x2b')]+_0x1d5dc6[_0x30a5('0x2d')];var _0x4f24d5;if(_0x8319d9>=_0x3e6285){_0x8319d9=_0x3e6285;_0x4f24d5=0xc8;}else{_0x4f24d5=0xce;}_0xa33a7e[_0x30a5('0x29')](_0x4f24d5);return _0xa33a7e['set'](_0x30a5('0x2f'),_0x145191+'-'+_0x8319d9+'/'+_0x3e6285)[_0x30a5('0x2a')](_0x2af9db);}return null;};}function patchUpdates(_0x3eb78a){return function(_0x3f92e1){try{jsonpatch[_0x30a5('0x30')](_0x3f92e1,_0x3eb78a,!![]);}catch(_0x4ae30b){return BPromise[_0x30a5('0x31')](_0x4ae30b);}return _0x3f92e1['save']();};}function saveUpdates(_0x50a8d1,_0x30767e){return function(_0x9ac34d){if(_0x9ac34d){return _0x9ac34d[_0x30a5('0x32')](_0x50a8d1)[_0x30a5('0x1f')](function(_0x103609){return _0x103609;});}return null;};}function removeEntity(_0x4ebb1e,_0x328e7e){return function(_0x23f488){if(_0x23f488){return _0x23f488[_0x30a5('0x33')]()['then'](function(){var _0x545edf=_0x23f488[_0x30a5('0x34')]({'plain':!![]});var _0x434854=_0x30a5('0x35');return db[_0x30a5('0x36')][_0x30a5('0x33')]({'where':{'type':_0x434854,'resourceId':_0x545edf['id']}})[_0x30a5('0x1f')](function(){return _0x23f488;});})[_0x30a5('0x1f')](function(){_0x4ebb1e[_0x30a5('0x29')](0xcc)[_0x30a5('0x37')]();});}};}function handleEntityNotFound(_0x3a3093,_0x6942e0){return function(_0x18d2cf){if(!_0x18d2cf){_0x3a3093['sendStatus'](0x194);}return _0x18d2cf;};}function handleError(_0x10038b,_0x13d5e5){_0x13d5e5=_0x13d5e5||0x1f4;return function(_0x54efa6){logger[_0x30a5('0x24')](_0x54efa6[_0x30a5('0x38')]);if(_0x54efa6[_0x30a5('0x39')]){delete _0x54efa6['name'];}_0x10038b[_0x30a5('0x29')](_0x13d5e5)[_0x30a5('0x3a')](_0x54efa6);};}exports['index']=function(_0x1ca975,_0x11ce38){var _0x45661a={'include':[{'model':db[_0x30a5('0x3b')],'as':_0x30a5('0x3c')}]},_0x219cfc={},_0x3cc2ae={'count':0x0,'rows':[]};var _0x482366=_[_0x30a5('0x3d')](db[_0x30a5('0x3e')]['rawAttributes'],function(_0x1067d0){return{'name':_0x1067d0['fieldName'],'type':_0x1067d0['type'][_0x30a5('0x3f')]};});_0x219cfc['model']=_[_0x30a5('0x3d')](_0x482366,'name');_0x219cfc[_0x30a5('0x40')]=_['keys'](_0x1ca975['query']);_0x219cfc[_0x30a5('0x41')]=_['intersection'](_0x219cfc[_0x30a5('0x42')],_0x219cfc['query']);_0x45661a[_0x30a5('0x43')]=_['intersection'](_0x219cfc[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x1ca975['query']['fields']));_0x45661a[_0x30a5('0x43')]=_0x45661a['attributes'][_0x30a5('0x45')]?_0x45661a[_0x30a5('0x43')]:_0x219cfc['model'];if(!_0x1ca975[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x45661a[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x1ca975['query'][_0x30a5('0x2d')]);_0x45661a[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x1ca975[_0x30a5('0x40')][_0x30a5('0x2b')]);}_0x45661a[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x1ca975[_0x30a5('0x40')]['sort']);_0x45661a['where']=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x1ca975['query'],_0x219cfc['filters']),_0x482366);if(_0x1ca975[_0x30a5('0x40')]['filter']){_0x45661a['where']=_[_0x30a5('0x4b')](_0x45661a['where'],{'$or':_[_0x30a5('0x3d')](_0x482366,function(_0x37b030){if(_0x37b030[_0x30a5('0x4c')]!=='VIRTUAL'){var _0x53c46d={};_0x53c46d[_0x37b030[_0x30a5('0x39')]]={'$like':'%'+_0x1ca975[_0x30a5('0x40')][_0x30a5('0x4d')]+'%'};return _0x53c46d;}})});}_0x45661a=_['merge']({},_0x45661a,_0x1ca975[_0x30a5('0x4e')]);var _0xa54377={'where':_0x45661a[_0x30a5('0x4f')]};return db[_0x30a5('0x3e')][_0x30a5('0x2e')](_0xa54377)['then'](function(_0x570bc4){_0x3cc2ae[_0x30a5('0x2e')]=_0x570bc4;if(_0x1ca975[_0x30a5('0x40')]['includeAll']){_0x45661a[_0x30a5('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x30a5('0x51')](_0x45661a);})[_0x30a5('0x1f')](function(_0x249a12){_0x3cc2ae[_0x30a5('0x52')]=_0x249a12;return _0x3cc2ae;})[_0x30a5('0x1f')](respondWithFilteredResult(_0x11ce38,_0x45661a))[_0x30a5('0x27')](handleError(_0x11ce38,null));};exports['show']=function(_0x41919d,_0x1aadc1){var _0x129a74={'raw':![],'where':{'id':_0x41919d[_0x30a5('0x53')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5ad9c8={};_0x5ad9c8['model']=_[_0x30a5('0x54')](db[_0x30a5('0x3e')][_0x30a5('0x55')]);_0x5ad9c8['query']=_[_0x30a5('0x54')](_0x41919d['query']);_0x5ad9c8[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x5ad9c8[_0x30a5('0x42')],_0x5ad9c8[_0x30a5('0x40')]);_0x129a74[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x5ad9c8[_0x30a5('0x42')],qs['fields'](_0x41919d[_0x30a5('0x40')]['fields']));_0x129a74[_0x30a5('0x43')]=_0x129a74['attributes'][_0x30a5('0x45')]?_0x129a74[_0x30a5('0x43')]:_0x5ad9c8[_0x30a5('0x42')];if(_0x41919d[_0x30a5('0x40')][_0x30a5('0x57')]){_0x129a74[_0x30a5('0x50')]=[{'all':!![]}];}_0x129a74=_[_0x30a5('0x4b')]({},_0x129a74,_0x41919d[_0x30a5('0x4e')]);return db[_0x30a5('0x3e')][_0x30a5('0x58')](_0x129a74)['then'](handleEntityNotFound(_0x1aadc1,null))[_0x30a5('0x1f')](respondWithResult(_0x1aadc1,null))['catch'](handleError(_0x1aadc1,null));};exports['create']=function(_0x2ef39d,_0x48468c){return db['WhatsappAccount'][_0x30a5('0x59')](_0x2ef39d['body'],{})[_0x30a5('0x1f')](function(_0x4be4a2){var _0x2f860a=_0x2ef39d['user'][_0x30a5('0x34')]({'plain':!![]});if(!_0x2f860a)throw new Error(_0x30a5('0x5a'));if(_0x2f860a[_0x30a5('0x5b')]==='user'){var _0x1afca3=_0x4be4a2[_0x30a5('0x34')]({'plain':!![]});var _0x3f9627=_0x30a5('0x35');return db[_0x30a5('0x5c')][_0x30a5('0x58')]({'where':{'name':_0x3f9627,'userProfileId':_0x2f860a['userProfileId']},'raw':!![]})[_0x30a5('0x1f')](function(_0x30c6d7){if(_0x30c6d7&&_0x30c6d7[_0x30a5('0x5d')]===0x0){return db['UserProfileResource'][_0x30a5('0x59')]({'name':_0x1afca3['name'],'resourceId':_0x1afca3['id'],'type':_0x30c6d7[_0x30a5('0x39')],'sectionId':_0x30c6d7['id']},{})[_0x30a5('0x1f')](function(){return _0x4be4a2;});}else{return _0x4be4a2;}})[_0x30a5('0x27')](function(_0x2ef3b2){logger['error'](_0x30a5('0x5e'),_0x2ef3b2);throw _0x2ef3b2;});}return _0x4be4a2;})[_0x30a5('0x1f')](respondWithResult(_0x48468c,0xc9))[_0x30a5('0x27')](handleError(_0x48468c,null));};exports['update']=function(_0x477a02,_0x36902d){if(_0x477a02['body']['id']){delete _0x477a02[_0x30a5('0x5f')]['id'];}return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x477a02['params']['id']},'include':[{'model':db[_0x30a5('0x3b')],'as':_0x30a5('0x3c')}]})['then'](handleEntityNotFound(_0x36902d,null))[_0x30a5('0x1f')](saveUpdates(_0x477a02[_0x30a5('0x5f')],null))['then'](respondWithResult(_0x36902d,null))[_0x30a5('0x27')](handleError(_0x36902d,null));};exports['destroy']=function(_0x4b6235,_0x1346bb){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x4b6235[_0x30a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x1346bb,null))['then'](removeEntity(_0x1346bb,null))[_0x30a5('0x27')](handleError(_0x1346bb,null));};exports[_0x30a5('0x60')]=function(_0x6c89e7,_0x6afc1a){return db[_0x30a5('0x3e')][_0x30a5('0x60')]()[_0x30a5('0x1f')](respondWithResult(_0x6afc1a,null))[_0x30a5('0x27')](handleError(_0x6afc1a,null));};exports['addDisposition']=function(_0x4f5a37,_0x18e8e8,_0x43eb00){if(_0x4f5a37['body']['id']){delete _0x4f5a37[_0x30a5('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x4f5a37[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x18e8e8,null))[_0x30a5('0x1f')](function(_0xa0241){if(_0xa0241){_0x4f5a37[_0x30a5('0x5f')][_0x30a5('0x61')]=_0xa0241['id'];return db[_0x30a5('0x62')]['create'](_0x4f5a37[_0x30a5('0x5f')]);}})[_0x30a5('0x1f')](respondWithResult(_0x18e8e8,null))[_0x30a5('0x27')](handleError(_0x18e8e8,null));};exports['getDispositions']=function(_0x123d05,_0x58ea30,_0xec3f84){var _0x3ea338={'raw':![],'where':{}};var _0x35c092={};var _0x5c7e87={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x123d05['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x58ea30,null))['then'](function(_0x310e35){if(_0x310e35){_0x35c092[_0x30a5('0x42')]=_[_0x30a5('0x54')](db['Disposition'][_0x30a5('0x55')]);_0x35c092[_0x30a5('0x40')]=_[_0x30a5('0x54')](_0x123d05[_0x30a5('0x40')]);_0x35c092[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x35c092[_0x30a5('0x42')],_0x35c092[_0x30a5('0x40')]);_0x3ea338['attributes']=_[_0x30a5('0x56')](_0x35c092['model'],qs[_0x30a5('0x44')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x44')]));_0x3ea338[_0x30a5('0x43')]=_0x3ea338[_0x30a5('0x43')]['length']?_0x3ea338[_0x30a5('0x43')]:_0x35c092[_0x30a5('0x42')];if(!_0x123d05[_0x30a5('0x40')]['hasOwnProperty'](_0x30a5('0x47'))){_0x3ea338[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x123d05['query']['limit']);_0x3ea338[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x2b')]);}_0x3ea338[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x49')]);_0x3ea338[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x123d05[_0x30a5('0x40')],_0x35c092[_0x30a5('0x41')]));_0x3ea338[_0x30a5('0x4f')]['WhatsappAccountId']=_0x310e35['id'];if(_0x123d05[_0x30a5('0x40')][_0x30a5('0x4d')]){_0x3ea338[_0x30a5('0x4f')]=_[_0x30a5('0x4b')](_0x3ea338[_0x30a5('0x4f')],{'$or':_[_0x30a5('0x3d')](_0x3ea338[_0x30a5('0x43')],function(_0x22004e){var _0x470436={};_0x470436[_0x22004e]={'$like':'%'+_0x123d05['query'][_0x30a5('0x4d')]+'%'};return _0x470436;})});}_0x3ea338=_[_0x30a5('0x4b')]({},_0x3ea338,_0x123d05['options']);return db[_0x30a5('0x62')][_0x30a5('0x2e')]({'where':_0x3ea338['where']})[_0x30a5('0x1f')](function(_0x5d8df9){_0x5c7e87['count']=_0x5d8df9;if(_0x123d05[_0x30a5('0x40')][_0x30a5('0x57')]){_0x3ea338[_0x30a5('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x30a5('0x51')](_0x3ea338);})[_0x30a5('0x1f')](function(_0xa3e896){_0x5c7e87['rows']=_0xa3e896;return _0x5c7e87;});}})[_0x30a5('0x1f')](respondWithFilteredResult(_0x58ea30,_0x3ea338))[_0x30a5('0x27')](handleError(_0x58ea30,null));};exports[_0x30a5('0x63')]=function(_0x4e6fc1,_0x44fd65,_0xfa265c){return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x4e6fc1[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x44fd65,null))[_0x30a5('0x1f')](function(_0x2be790){if(_0x2be790){return _0x2be790[_0x30a5('0x63')](_0x4e6fc1[_0x30a5('0x40')][_0x30a5('0x64')]);}})[_0x30a5('0x1f')](respondWithStatusCode(_0x44fd65,null))['catch'](handleError(_0x44fd65,null));};exports[_0x30a5('0x65')]=function(_0xab9a23,_0x3c83d4,_0x13239f){if(_0xab9a23[_0x30a5('0x5f')]['id']){delete _0xab9a23[_0x30a5('0x5f')]['id'];}return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0xab9a23[_0x30a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c83d4,null))[_0x30a5('0x1f')](function(_0x59e422){if(_0x59e422){_0xab9a23[_0x30a5('0x5f')][_0x30a5('0x61')]=_0x59e422['id'];return db['CannedAnswer'][_0x30a5('0x59')](_0xab9a23['body']);}})['then'](respondWithResult(_0x3c83d4,null))[_0x30a5('0x27')](handleError(_0x3c83d4,null));};exports[_0x30a5('0x66')]=function(_0x18f69c,_0x2f83b3,_0x29c6d2){var _0x43871c={'raw':![],'where':{}};var _0x4e11dd={};var _0x3ac736={'count':0x0,'rows':[]};return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x18f69c['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x2f83b3,null))[_0x30a5('0x1f')](function(_0x1c4353){if(_0x1c4353){_0x4e11dd[_0x30a5('0x42')]=_[_0x30a5('0x54')](db[_0x30a5('0x68')][_0x30a5('0x55')]);_0x4e11dd[_0x30a5('0x40')]=_[_0x30a5('0x54')](_0x18f69c[_0x30a5('0x40')]);_0x4e11dd[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x4e11dd[_0x30a5('0x42')],_0x4e11dd['query']);_0x43871c[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x4e11dd[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x18f69c[_0x30a5('0x40')]['fields']));_0x43871c[_0x30a5('0x43')]=_0x43871c['attributes'][_0x30a5('0x45')]?_0x43871c[_0x30a5('0x43')]:_0x4e11dd['model'];if(!_0x18f69c[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x43871c[_0x30a5('0x2d')]=qs['limit'](_0x18f69c[_0x30a5('0x40')][_0x30a5('0x2d')]);_0x43871c[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x18f69c[_0x30a5('0x40')]['offset']);}_0x43871c[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x18f69c[_0x30a5('0x40')][_0x30a5('0x49')]);_0x43871c[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x18f69c[_0x30a5('0x40')],_0x4e11dd[_0x30a5('0x41')]));_0x43871c['where'][_0x30a5('0x61')]=_0x1c4353['id'];if(_0x18f69c['query'][_0x30a5('0x4d')]){_0x43871c['where']=_[_0x30a5('0x4b')](_0x43871c['where'],{'$or':_['map'](_0x43871c['attributes'],function(_0x2d9311){var _0x5840d1={};_0x5840d1[_0x2d9311]={'$like':'%'+_0x18f69c['query']['filter']+'%'};return _0x5840d1;})});}_0x43871c=_[_0x30a5('0x4b')]({},_0x43871c,_0x18f69c[_0x30a5('0x4e')]);return db[_0x30a5('0x68')][_0x30a5('0x2e')]({'where':_0x43871c[_0x30a5('0x4f')]})[_0x30a5('0x1f')](function(_0xdeaa80){_0x3ac736[_0x30a5('0x2e')]=_0xdeaa80;if(_0x18f69c['query']['includeAll']){_0x43871c[_0x30a5('0x50')]=[{'all':!![]}];}return db[_0x30a5('0x68')][_0x30a5('0x51')](_0x43871c);})[_0x30a5('0x1f')](function(_0x39c107){_0x3ac736['rows']=_0x39c107;return _0x3ac736;});}})[_0x30a5('0x1f')](respondWithFilteredResult(_0x2f83b3,_0x43871c))['catch'](handleError(_0x2f83b3,null));};exports[_0x30a5('0x69')]=function(_0x20238c,_0x44b42f,_0x76a43a){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x20238c[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x44b42f,null))[_0x30a5('0x1f')](function(_0x3d2288){if(_0x3d2288){return _0x3d2288[_0x30a5('0x69')](_0x20238c[_0x30a5('0x40')][_0x30a5('0x64')]);}})[_0x30a5('0x1f')](respondWithStatusCode(_0x44b42f,null))[_0x30a5('0x27')](handleError(_0x44b42f,null));};exports[_0x30a5('0x6a')]=function(_0x5a3f47,_0x136337,_0x23ce1c){return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x5a3f47[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x136337,null))['then'](function(_0x49e870){if(_0x49e870){return _0x49e870['addAgents'](_0x5a3f47['body'][_0x30a5('0x64')],_[_0x30a5('0x6b')](_0x5a3f47[_0x30a5('0x5f')],[_0x30a5('0x64'),'id'])||{})[_0x30a5('0x6c')](function(_0x3393fc){for(var _0x3315c3=0x0;_0x3315c3<_0x5a3f47[_0x30a5('0x5f')][_0x30a5('0x64')][_0x30a5('0x45')];_0x3315c3+=0x1){socket[_0x30a5('0x6d')]('userWhatsappAccount:save',{'UserId':Number(_0x5a3f47['body'][_0x30a5('0x64')][_0x3315c3]),'WhatsappAccountId':Number(_0x5a3f47[_0x30a5('0x53')]['id'])});}return _0x3393fc;});}})[_0x30a5('0x1f')](respondWithResult(_0x136337,null))[_0x30a5('0x27')](handleError(_0x136337,null));};exports[_0x30a5('0x6e')]=function(_0x16090c,_0x30c6b8,_0x9f876d){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x16090c[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x30c6b8,null))[_0x30a5('0x1f')](function(_0x240d11){if(_0x240d11){return _0x240d11[_0x30a5('0x6e')](_0x16090c[_0x30a5('0x40')]['ids'])[_0x30a5('0x1f')](function(){if(_['isArray'](_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')])){for(var _0x513a54=0x0;_0x513a54<_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')][_0x30a5('0x45')];_0x513a54+=0x1){socket[_0x30a5('0x6d')](_0x30a5('0x6f'),{'UserId':Number(_0x16090c['query'][_0x30a5('0x64')][_0x513a54]),'WhatsappAccountId':Number(_0x16090c[_0x30a5('0x53')]['id'])});}}else{socket[_0x30a5('0x6d')](_0x30a5('0x6f'),{'UserId':Number(_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')]),'WhatsappAccountId':Number(_0x16090c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x30c6b8,null))[_0x30a5('0x27')](handleError(_0x30c6b8,null));};exports[_0x30a5('0x70')]=function(_0x514b74,_0x1eabfb,_0x3c5b37){var _0x39833d={};var _0x590414={};var _0xef8dca;var _0x366b3d;return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x514b74['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x1eabfb,null))[_0x30a5('0x1f')](function(_0x259716){if(_0x259716){_0xef8dca=_0x259716;_0x590414[_0x30a5('0x42')]=_[_0x30a5('0x54')](db[_0x30a5('0x71')][_0x30a5('0x55')]);_0x590414['query']=_[_0x30a5('0x54')](_0x514b74[_0x30a5('0x40')]);_0x590414[_0x30a5('0x41')]=_['intersection'](_0x590414[_0x30a5('0x42')],_0x590414[_0x30a5('0x40')]);_0x39833d[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x590414[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x514b74[_0x30a5('0x40')]['fields']));_0x39833d[_0x30a5('0x43')]=_0x39833d['attributes']['length']?_0x39833d[_0x30a5('0x43')]:_0x590414[_0x30a5('0x42')];_0x39833d[_0x30a5('0x48')]=qs['sort'](_0x514b74[_0x30a5('0x40')]['sort']);_0x39833d['where']=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x514b74['query'],_0x590414[_0x30a5('0x41')]));if(_0x514b74[_0x30a5('0x40')][_0x30a5('0x4d')]){_0x39833d[_0x30a5('0x4f')]=_['merge'](_0x39833d[_0x30a5('0x4f')],{'$or':_['map'](_0x39833d[_0x30a5('0x43')],function(_0x558aef){var _0x4cc683={};_0x4cc683[_0x558aef]={'$like':'%'+_0x514b74['query'][_0x30a5('0x4d')]+'%'};return _0x4cc683;})});}_0x39833d=_['merge']({},_0x39833d,_0x514b74[_0x30a5('0x4e')]);return _0xef8dca['getAgents'](_0x39833d);}})['then'](function(_0x69aaf5){if(_0x69aaf5){_0x366b3d=_0x69aaf5[_0x30a5('0x45')];if(!_0x514b74[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x39833d[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x514b74[_0x30a5('0x40')]['limit']);_0x39833d['offset']=qs['offset'](_0x514b74[_0x30a5('0x40')][_0x30a5('0x2b')]);}return _0xef8dca[_0x30a5('0x70')](_0x39833d);}})['then'](function(_0x54429e){if(_0x54429e){return _0x54429e?{'count':_0x366b3d,'rows':_0x54429e}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x1eabfb,null))[_0x30a5('0x27')](handleError(_0x1eabfb,null));};exports['addApplications']=function(_0x3d1f14,_0xb1d572){var _0x1f7ef7=_0x3d1f14['params']['id'];var _0x32e2f9=_0x3d1f14[_0x30a5('0x5f')];var _0x5e435b=0xc8;var _0x1ea0f2=null;return db[_0x30a5('0x72')][_0x30a5('0x73')]({'isolationLevel':db[_0x30a5('0x72')][_0x30a5('0x74')][_0x30a5('0x75')]['READ_COMMITTED']},function(_0x9c4a97){return db['WhatsappAccount']['findOne']({'where':{'id':_0x1f7ef7},'transaction':_0x9c4a97})['then'](function(_0x4e8583){if(_0x4e8583){return db[_0x30a5('0x76')][_0x30a5('0x33')]({'where':{'WhatsappAccountId':_0x1f7ef7},'transaction':_0x9c4a97})[_0x30a5('0x1f')](function(){var _0x4423c6=_['map'](_0x32e2f9,function(_0x16f029){_0x16f029[_0x30a5('0x61')]=_0x1f7ef7;return _0x16f029;});return db[_0x30a5('0x76')][_0x30a5('0x77')](_0x4423c6,{'transaction':_0x9c4a97});});}else{_0x5e435b=0x194;_0x1ea0f2=[];}});})[_0x30a5('0x1f')](function(){if(_0x5e435b!==0x194){return db['WhatsappApplication'][_0x30a5('0x78')]({'where':{'WhatsappAccountId':_0x1f7ef7},'order':_0x30a5('0x79')})['then'](function(_0x53be9e){_0x1ea0f2=_0x53be9e;});}})['catch'](function(_0x3ba9f8){_0x5e435b=0x1f4;logger['error'](_0x3ba9f8[_0x30a5('0x38')]);if(_0x3ba9f8[_0x30a5('0x39')]){delete _0x3ba9f8[_0x30a5('0x39')];}_0x1ea0f2=_0x3ba9f8;})[_0x30a5('0x7a')](function(){if(_0x1ea0f2===null){_0xb1d572['sendStatus'](_0x5e435b);}else{if(_0x5e435b===0x1f4){_0xb1d572[_0x30a5('0x29')](_0x5e435b)['send'](_0x1ea0f2);}else{_0xb1d572[_0x30a5('0x29')](_0x5e435b)[_0x30a5('0x2a')](_0x1ea0f2);}}});};exports[_0x30a5('0x7b')]=function(_0x3f43be,_0x4f95c7,_0x5cdde2){var _0x3830f2={};var _0x235c24={};var _0x1666ad;var _0x10f873;return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x3f43be['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x4f95c7,null))[_0x30a5('0x1f')](function(_0x43b943){if(_0x43b943){_0x1666ad=_0x43b943;_0x235c24[_0x30a5('0x42')]=_[_0x30a5('0x54')](db['WhatsappApplication']['rawAttributes']);_0x235c24[_0x30a5('0x40')]=_['keys'](_0x3f43be[_0x30a5('0x40')]);_0x235c24[_0x30a5('0x41')]=_['intersection'](_0x235c24[_0x30a5('0x42')],_0x235c24[_0x30a5('0x40')]);_0x3830f2[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x235c24['model'],qs[_0x30a5('0x44')](_0x3f43be['query'][_0x30a5('0x44')]));_0x3830f2[_0x30a5('0x43')]=_0x3830f2[_0x30a5('0x43')][_0x30a5('0x45')]?_0x3830f2['attributes']:_0x235c24['model'];_0x3830f2[_0x30a5('0x48')]=qs['sort'](_0x3f43be[_0x30a5('0x40')][_0x30a5('0x49')]);_0x3830f2[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_['pick'](_0x3f43be['query'],_0x235c24['filters']));if(_0x3f43be[_0x30a5('0x40')]['filter']){_0x3830f2[_0x30a5('0x4f')]=_['merge'](_0x3830f2['where'],{'$or':_[_0x30a5('0x3d')](_0x3830f2['attributes'],function(_0x484f5c){var _0xb09e24={};_0xb09e24[_0x484f5c]={'$like':'%'+_0x3f43be['query'][_0x30a5('0x4d')]+'%'};return _0xb09e24;})});}_0x3830f2=_[_0x30a5('0x4b')]({},_0x3830f2,_0x3f43be['options']);return _0x1666ad[_0x30a5('0x7b')](_0x3830f2);}})['then'](function(_0xdce962){if(_0xdce962){_0x10f873=_0xdce962[_0x30a5('0x45')];if(!_0x3f43be[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x3830f2[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x3f43be['query']['limit']);_0x3830f2[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x3f43be[_0x30a5('0x40')]['offset']);}return _0x1666ad[_0x30a5('0x7b')](_0x3830f2);}})['then'](function(_0xff4641){if(_0xff4641){return _0xff4641?{'count':_0x10f873,'rows':_0xff4641}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x4f95c7,null))[_0x30a5('0x27')](handleError(_0x4f95c7,null));};exports[_0x30a5('0x7c')]=function(_0x388c34,_0x4bead1,_0x133e43){var _0x481ee0={'channel':_0x30a5('0x7d')};var _0x5d1acd=[];var _0x67372c=[];var _0x159b99={};return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x388c34[_0x30a5('0x53')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x30a5('0x7e')}]})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x3021c5){_0x481ee0[_0x30a5('0x7f')]=_0x3021c5;if(_0x481ee0[_0x30a5('0x7f')]&&_0x481ee0['account']['type']==='sinch'&&_0x388c34[_0x30a5('0x5f')][_0x30a5('0x80')]){if(_0x388c34[_0x30a5('0x5f')][_0x30a5('0x80')][_0x30a5('0x45')]===0x0)return;if(_0x388c34['body'][_0x30a5('0x80')][0x0]['state']!=='read')return;return db[_0x30a5('0x81')][_0x30a5('0x32')]({'read':!![],'readAt':_0x388c34['body'][_0x30a5('0x80')][0x0][_0x30a5('0x82')]},{'where':{'messageId':_0x388c34['body'][_0x30a5('0x80')][0x0][_0x30a5('0x83')]},'individualHooks':!![]})[_0x30a5('0x1f')](function(_0x43849b){return _0x4bead1['status'](0xc8)[_0x30a5('0x2a')](_0x43849b);});}_0x481ee0[_0x30a5('0x84')]=_[_0x30a5('0x85')](_0x3021c5[_0x30a5('0x7e')],[_0x30a5('0x79')],[_0x30a5('0x86')]);if(_0x481ee0[_0x30a5('0x7f')][_0x30a5('0x7e')]){delete _0x481ee0[_0x30a5('0x7f')][_0x30a5('0x7e')];}return db['CmContact'][_0x30a5('0x60')]()[_0x30a5('0x1f')](function(_0x4dd1f0){if(!_0x4dd1f0){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))](_0x30a5('0x89'));}_0x5d1acd=_['difference'](_[_0x30a5('0x54')](_0x4dd1f0),['createdAt',_0x30a5('0x8a')]);_0x67372c=_[_0x30a5('0x8b')](_[_0x30a5('0x54')](_0x4dd1f0),[_0x30a5('0x8c'),_0x30a5('0x8a'),_0x30a5('0x8d'),'ListId']);_0x481ee0[_0x30a5('0x5f')]={'mapKey':'mobile'};if(_0x481ee0[_0x30a5('0x7f')]&&_0x481ee0[_0x30a5('0x7f')][_0x30a5('0x4c')]===_0x30a5('0x8e')){_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x90')]['replace'](_0x30a5('0x91'),'');_0x481ee0[_0x30a5('0x5f')]['body']=_0x388c34['body']['Body'];_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x92')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x93')];}if(_0x481ee0['account']&&_0x481ee0[_0x30a5('0x7f')]['type']===_0x30a5('0x94')){_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x95')][0x0]['from'];_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')]=_0x388c34['body']['notifications'][0x0][_0x30a5('0x25')][_0x30a5('0x5f')];_0x481ee0[_0x30a5('0x5f')]['messageId']=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x95')][0x0][_0x30a5('0x83')];}if(_0x481ee0[_0x30a5('0x5f')]['id']){delete _0x481ee0[_0x30a5('0x5f')]['id'];}if(_[_0x30a5('0x96')](_0x481ee0[_0x30a5('0x5f')]['from'])){throw new db[(_0x30a5('0x87'))]['ValidationError'](_0x30a5('0x97'));}if(_['isNil'](_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')])||_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')]===''){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))](_0x30a5('0x98'));}if(_['isNil'](_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')])){throw new db['Sequelize'][(_0x30a5('0x88'))](_0x30a5('0x9a')+_0x67372c);}if(!_[_0x30a5('0x9b')](_0x67372c,_0x481ee0[_0x30a5('0x5f')]['mapKey'])){throw new db[(_0x30a5('0x87'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x67372c);}_0x159b99[_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')]]=_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')];return db['CmList'][_0x30a5('0x58')]({'where':{'id':_0x481ee0['account']['ListId']},'include':[{'model':db[_0x30a5('0x9c')],'as':_0x30a5('0x9d'),'where':_0x159b99,'limit':0x1,'order':[[_0x30a5('0x8a'),_0x30a5('0x9e')]]}]});})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x36b45b){if(_0x36b45b){_0x481ee0[_0x30a5('0x9f')]=_[_0x30a5('0x6b')](_0x36b45b,[_0x30a5('0x9d')]);if(_0x36b45b[_0x30a5('0x9d')]['length']){return _0x36b45b[_0x30a5('0x9d')][0x0];}var _0x10ecc5=_[_0x30a5('0x18')](_0x481ee0[_0x30a5('0x5f')],{'firstName':_0x481ee0[_0x30a5('0x5f')]['from'],'ListId':_0x36b45b['id']});_0x10ecc5[_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')]]=_0x481ee0['body'][_0x30a5('0x8f')];return db[_0x30a5('0x9c')]['create'](_0x10ecc5,{'fields':_0x5d1acd,'raw':!![]});}})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x1b8b9e){if(_0x1b8b9e){_0x481ee0[_0x30a5('0xa0')]=_0x1b8b9e;var _0x31761c={'ContactId':_0x1b8b9e['id'],'phone':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')],'WhatsappAccountId':_0x388c34[_0x30a5('0x53')]['id']};var _0x1ec54f={'ContactId':_0x1b8b9e['id'],'WhatsappAccountId':_0x388c34['params']['id'],'closed':![]};return db[_0x30a5('0xa1')][_0x30a5('0x58')]({'where':_0x1ec54f})[_0x30a5('0x1f')](function(_0x260449){if(_0x260449){return[_0x260449,![]];}return db[_0x30a5('0xa1')][_0x30a5('0x59')](_0x31761c)[_0x30a5('0x1f')](function(_0x3942e0){return[_0x3942e0,!![]];});});}})['spread'](function(_0xe39052,_0x15bd20){_0x481ee0[_0x30a5('0xa2')]=_0xe39052[_0x30a5('0x34')]({'plain':!![]});_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa3')]=![];if(_0x15bd20){if(_0x481ee0['account']['autoclose']){_0x481ee0[_0x30a5('0x84')]['push']({'id':0x0,'priority':_0x481ee0[_0x30a5('0x84')][_0x30a5('0x45')]+0x1,'app':_0x30a5('0xa4'),'appdata':_0x30a5('0xa5'),'interval':_0x30a5('0xa6')});}_0x481ee0['interaction']['created']=!![];}return db[_0x30a5('0x81')][_0x30a5('0x59')]({'phone':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')],'messageId':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x92')],'body':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')],'WhatsappAccountId':_0x388c34[_0x30a5('0x53')]['id'],'WhatsappInteractionId':_0xe39052['id'],'direction':'in','ContactId':_0xe39052[_0x30a5('0xa7')],'AttachmentId':_0x481ee0['body'][_0x30a5('0xa8')]});})['then'](function(_0x311401){_0x481ee0[_0x30a5('0x25')]=_0x311401;if(_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa9')]){return db[_0x30a5('0x71')][_0x30a5('0x58')]({'attributes':['id',_0x30a5('0x39')],'where':{'id':_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa9')]}})[_0x30a5('0x1f')](function(_0x19c6cb){if(_0x19c6cb){_0x481ee0[_0x30a5('0x84')][_0x30a5('0xaa')]({'id':0x0,'priority':0x0,'app':_0x30a5('0xab'),'appdata':_0x19c6cb[_0x30a5('0x39')]+','+(_0x481ee0['account'][_0x30a5('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x30a5('0xad'),_0x30a5('0xae'),_0x481ee0);});}return respondWithRpcPromise(_0x30a5('0xad'),_0x30a5('0xae'),_0x481ee0);})[_0x30a5('0x1f')](function(_0x30b783){if(_0x30b783){var _0x2e2e29=0xc8;var _0x3c93dc=_0x30a5('0xaf');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c93dc,_0x2e2e29,_0x30a5('0xb0'));logger[_0x30a5('0x21')](_0x30a5('0xb1'),_0x3c93dc,_0x2e2e29,_0x30a5('0xb0'),JSON[_0x30a5('0x23')](_0x30b783));if(_0x481ee0[_0x30a5('0x7f')]['type']===_0x30a5('0x8e')){return _0x4bead1['status'](_0x2e2e29)[_0x30a5('0xb2')](_0x30a5('0xb3'),_0x30a5('0xb4'))['send'](_0x30a5('0xb5'));}else{return _0x4bead1[_0x30a5('0x29')](_0x2e2e29)[_0x30a5('0x2a')](_0x30b783);}}});})[_0x30a5('0x27')](handleError(_0x4bead1,null));};exports[_0x30a5('0x3a')]=function(_0x1ab4c3,_0x10ba32,_0x839c31){var _0x42980d,_0x4172d7,_0x8631d2;if(_[_0x30a5('0x96')](_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')])||_0x1ab4c3['body'][_0x30a5('0x5f')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x30a5('0x96')](_0x1ab4c3[_0x30a5('0x5f')]['to'])){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))]('to\x20is\x20mandatory');}_0x42980d=_0x1ab4c3['body']['to'];return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x1ab4c3[_0x30a5('0x53')]['id']},'include':[{'model':db[_0x30a5('0xb6')],'as':'List','include':[{'model':db[_0x30a5('0x9c')],'as':'Contacts','where':{'mobile':_0x42980d},'limit':0x1,'order':[[_0x30a5('0x8a'),_0x30a5('0x9e')]]}]}]})[_0x30a5('0x1f')](handleEntityNotFound(_0x10ba32,null))[_0x30a5('0x1f')](function(_0x9066c7){if(_0x9066c7&&_0x9066c7[_0x30a5('0xb7')]){_0x4172d7=_0x9066c7['get']({'plain':!![]});if(_0x4172d7[_0x30a5('0xb7')]&&_0x4172d7['List']['Contacts'][_0x30a5('0x45')]){return _0x4172d7[_0x30a5('0xb7')]['Contacts'][0x0];}return db[_0x30a5('0x9c')]['create'](_[_0x30a5('0x18')](_0x1ab4c3[_0x30a5('0x5f')],{'firstName':_0x42980d,'mobile':_0x42980d,'phone':_0x42980d,'ListId':_0x4172d7['ListId']}));}})[_0x30a5('0x1f')](handleEntityNotFound(_0x10ba32,null))[_0x30a5('0x1f')](function(_0x5c9ca9){if(_0x5c9ca9){_0x8631d2=_0x5c9ca9;return db[_0x30a5('0xa1')][_0x30a5('0x58')]({'where':{'ContactId':_0x8631d2['id'],'closed':![],'WhatsappAccountId':_0x4172d7['id']}})[_0x30a5('0x1f')](function(_0x57f828){if(_0x57f828){return[_0x57f828,![]];}return db[_0x30a5('0xa1')][_0x30a5('0x59')]({'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id'],'WhatsappAccountId':_0x4172d7['id'],'phone':_0x42980d,'firstMsgDirection':'out','Messages':[_[_0x30a5('0x4b')](_0x1ab4c3[_0x30a5('0x5f')],{'read':![],'body':_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')],'phone':_0x42980d,'WhatsappAccountId':_0x4172d7['id'],'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id']})]},{'include':[{'model':db[_0x30a5('0x81')],'as':'Messages'}]})['then'](function(_0x91a4d4){return[_0x91a4d4,!![]];});});}})['spread'](function(_0x1c8351,_0x484602){if(_0x484602){return _0x1c8351;}return db[_0x30a5('0x81')][_0x30a5('0x59')](_['merge'](_0x1ab4c3[_0x30a5('0x5f')],{'read':![],'body':_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')],'phone':_0x42980d,'WhatsappAccountId':_0x4172d7['id'],'WhatsappInteractionId':_0x1c8351['id'],'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id']}))[_0x30a5('0x1f')](function(_0x3cfaba){_0x1c8351[_0x30a5('0xb9')][_0x30a5('0xba')]=[];_0x1c8351[_0x30a5('0xb9')][_0x30a5('0xba')][_0x30a5('0xbb')](_0x3cfaba[_0x30a5('0xb9')]);return _0x1c8351;});})[_0x30a5('0x1f')](respondWithResult(_0x10ba32,null))['catch'](handleError(_0x10ba32,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 0038de1..2ce5c71 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2809=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','update','remove'];(function(_0x12939d,_0x24971d){var _0x38f9ab=function(_0x23a8d5){while(--_0x23a8d5){_0x12939d['push'](_0x12939d['shift']());}};_0x38f9ab(++_0x24971d);}(_0x2809,0x190));var _0x9280=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x2809[_0x3a8db5];return _0x2c03cd;};'use strict';var EventEmitter=require(_0x9280('0x0'));var WhatsappAccount=require(_0x9280('0x1'))['db'][_0x9280('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9280('0x3'),'afterDestroy':_0x9280('0x4')};function emitEvent(_0x301638){return function(_0xd5674a,_0x26727b,_0x163b81){WhatsappAccountEvents[_0x9280('0x5')](_0x301638+':'+_0xd5674a['id'],_0xd5674a);WhatsappAccountEvents[_0x9280('0x5')](_0x301638,_0xd5674a);_0x163b81(null);};}for(var e in events){if(events[_0x9280('0x6')](e)){var event=events[e];WhatsappAccount[_0x9280('0x7')](e,emitEvent(event));}}module[_0x9280('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x8b0c=['exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8b0c,0x18d));var _0xc8b0=function(_0x34ce1d,_0xe737ef){_0x34ce1d=_0x34ce1d-0x0;var _0x1b589b=_0x8b0c[_0x34ce1d];return _0x1b589b;};'use strict';var EventEmitter=require(_0xc8b0('0x0'));var WhatsappAccount=require(_0xc8b0('0x1'))['db'][_0xc8b0('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc8b0('0x3')](0x0);var events={'afterCreate':_0xc8b0('0x4'),'afterUpdate':'update','afterDestroy':_0xc8b0('0x5')};function emitEvent(_0x4bf2ff){return function(_0x122d06,_0x30bdb1,_0x1f38ee){WhatsappAccountEvents[_0xc8b0('0x6')](_0x4bf2ff+':'+_0x122d06['id'],_0x122d06);WhatsappAccountEvents['emit'](_0x4bf2ff,_0x122d06);_0x1f38ee(null);};}for(var e in events){if(events[_0xc8b0('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xc8b0('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 99f1eda..8a0135e 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa323=['../../config/logger','api','path','rimraf','../../config/environment','./whatsappAccount.attributes','lodash','util'];(function(_0x17abfb,_0x20c3e3){var _0x34c17b=function(_0x372816){while(--_0x372816){_0x17abfb['push'](_0x17abfb['shift']());}};_0x34c17b(++_0x20c3e3);}(_0xa323,0x166));var _0x3a32=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xa323[_0x409682];return _0x1ee901;};'use strict';var _=require(_0x3a32('0x0'));var util=require(_0x3a32('0x1'));var logger=require(_0x3a32('0x2'))(_0x3a32('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a32('0x4'));var rimraf=require(_0x3a32('0x5'));var config=require(_0x3a32('0x6'));var attributes=require(_0x3a32('0x7'));module['exports']=function(_0x535ea5,_0x2161a3){return _0x535ea5['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x922b=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','lodash','util','../../config/logger'];(function(_0x439f24,_0x4ff170){var _0x419767=function(_0x3bb508){while(--_0x3bb508){_0x439f24['push'](_0x439f24['shift']());}};_0x419767(++_0x4ff170);}(_0x922b,0x1ad));var _0xb922=function(_0x1baa98,_0x3a327d){_0x1baa98=_0x1baa98-0x0;var _0x17625b=_0x922b[_0x1baa98];return _0x17625b;};'use strict';var _=require(_0xb922('0x0'));var util=require(_0xb922('0x1'));var logger=require(_0xb922('0x2'))('api');var moment=require(_0xb922('0x3'));var BPromise=require(_0xb922('0x4'));var rp=require(_0xb922('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb922('0x6'));var config=require('../../config/environment');var attributes=require(_0xb922('0x7'));module['exports']=function(_0xf67a44,_0x3a529f){return _0xf67a44['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index a84fc0a..b01f40a 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x207a=['include','model','map','then','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','WhatsappAccount','find','options','raw','where','attributes'];(function(_0xf7500e,_0xd988da){var _0x423895=function(_0xe45280){while(--_0xe45280){_0xf7500e['push'](_0xf7500e['shift']());}};_0x423895(++_0xd988da);}(_0x207a,0x12d));var _0xa207=function(_0xa72f73,_0x8058d1){_0xa72f73=_0xa72f73-0x0;var _0x190264=_0x207a[_0xa72f73];return _0x190264;};'use strict';var _=require(_0xa207('0x0'));var util=require('util');var moment=require(_0xa207('0x1'));var BPromise=require(_0xa207('0x2'));var rs=require(_0xa207('0x3'));var fs=require('fs');var Redis=require(_0xa207('0x4'));var db=require(_0xa207('0x5'))['db'];var utils=require(_0xa207('0x6'));var logger=require(_0xa207('0x7'))(_0xa207('0x8'));var config=require('../../config/environment');var jayson=require(_0xa207('0x9'));var client=jayson[_0xa207('0xa')]['http']({'port':0x232a});config[_0xa207('0xb')]=_[_0xa207('0xc')](config[_0xa207('0xb')],{'host':_0xa207('0xd'),'port':0x18eb});var socket=require(_0xa207('0xe'))(new Redis(config[_0xa207('0xb')]));require('./whatsappAccount.socket')[_0xa207('0xf')](socket);function respondWithRpcPromise(_0x59f194,_0x3dad8b,_0x368284){return new BPromise(function(_0x2b83f0,_0xe5494d){return client['request'](_0x59f194,_0x368284)['then'](function(_0x33db19){logger[_0xa207('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3dad8b,_0xa207('0x11'));logger[_0xa207('0x12')](_0xa207('0x13'),_0x3dad8b,_0xa207('0x11'),JSON[_0xa207('0x14')](_0x33db19));if(_0x33db19[_0xa207('0x15')]){if(_0x33db19[_0xa207('0x15')]['code']===0x1f4){logger[_0xa207('0x15')](_0xa207('0x16'),_0x3dad8b,_0x33db19[_0xa207('0x15')]['message']);return _0xe5494d(_0x33db19[_0xa207('0x15')]['message']);}logger[_0xa207('0x15')](_0xa207('0x16'),_0x3dad8b,_0x33db19[_0xa207('0x15')]['message']);return _0x2b83f0(_0x33db19[_0xa207('0x15')][_0xa207('0x17')]);}else{logger[_0xa207('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3dad8b,_0xa207('0x11'));_0x2b83f0(_0x33db19[_0xa207('0x18')][_0xa207('0x17')]);}})[_0xa207('0x19')](function(_0x4b8a94){logger[_0xa207('0x15')](_0xa207('0x16'),_0x3dad8b,_0x4b8a94);_0xe5494d(_0x4b8a94);});});}exports['ShowWhatsappAccount']=function(_0x51b4a6){var _0xa1fc6c=this;return new Promise(function(_0x489b8d,_0x20efa5){return db[_0xa207('0x1a')][_0xa207('0x1b')]({'raw':_0x51b4a6['options']?_0x51b4a6[_0xa207('0x1c')][_0xa207('0x1d')]===undefined?!![]:![]:!![],'where':_0x51b4a6[_0xa207('0x1c')]?_0x51b4a6[_0xa207('0x1c')][_0xa207('0x1e')]||null:null,'attributes':_0x51b4a6[_0xa207('0x1c')]?_0x51b4a6['options'][_0xa207('0x1f')]||null:null,'include':_0x51b4a6['options']?_0x51b4a6['options'][_0xa207('0x20')]?_['map'](_0x51b4a6['options'][_0xa207('0x20')],function(_0x2351d5){return{'model':db[_0x2351d5[_0xa207('0x21')]],'as':_0x2351d5['as'],'attributes':_0x2351d5[_0xa207('0x1f')],'include':_0x2351d5[_0xa207('0x20')]?_[_0xa207('0x22')](_0x2351d5[_0xa207('0x20')],function(_0x18cdb6){return{'model':db[_0x18cdb6['model']],'as':_0x18cdb6['as'],'attributes':_0x18cdb6[_0xa207('0x1f')],'include':_0x18cdb6[_0xa207('0x20')]?_[_0xa207('0x22')](_0x18cdb6[_0xa207('0x20')],function(_0x5b4107){return{'model':db[_0x5b4107[_0xa207('0x21')]],'as':_0x5b4107['as'],'attributes':_0x5b4107[_0xa207('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa207('0x23')](function(_0x5cb68b){logger[_0xa207('0x10')]('ShowWhatsappAccount',_0x51b4a6);logger[_0xa207('0x12')](_0xa207('0x24'),_0x51b4a6,JSON['stringify'](_0x5cb68b));_0x489b8d(_0x5cb68b);})[_0xa207('0x19')](function(_0x32205e){logger['error'](_0xa207('0x24'),_0x32205e['message'],_0x51b4a6);_0x20efa5(_0xa1fc6c[_0xa207('0x15')](0x1f4,_0x32205e['message']));});});}; \ No newline at end of file +var _0x1516=['WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','model','include','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info'];(function(_0xabe145,_0x2ef96d){var _0x433e19=function(_0x3eca1a){while(--_0x3eca1a){_0xabe145['push'](_0xabe145['shift']());}};_0x433e19(++_0x2ef96d);}(_0x1516,0xb0));var _0x6151=function(_0x4a47ba,_0x3860ab){_0x4a47ba=_0x4a47ba-0x0;var _0x4ffaf=_0x1516[_0x4a47ba];return _0x4ffaf;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});config[_0x6151('0xb')]=_[_0x6151('0xc')](config[_0x6151('0xb')],{'host':_0x6151('0xd'),'port':0x18eb});var socket=require(_0x6151('0xe'))(new Redis(config[_0x6151('0xb')]));require(_0x6151('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d2278,_0x13c0a8,_0x22ff2d){return new BPromise(function(_0xb9019b,_0x469a87){return client[_0x6151('0x10')](_0x5d2278,_0x22ff2d)[_0x6151('0x11')](function(_0x3f82f4){logger[_0x6151('0x12')](_0x6151('0x13'),_0x13c0a8,'request\x20sent');logger['debug'](_0x6151('0x14'),_0x13c0a8,_0x6151('0x15'),JSON[_0x6151('0x16')](_0x3f82f4));if(_0x3f82f4['error']){if(_0x3f82f4[_0x6151('0x17')][_0x6151('0x18')]===0x1f4){logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x3f82f4['error'][_0x6151('0x19')]);return _0x469a87(_0x3f82f4['error'][_0x6151('0x19')]);}logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x3f82f4[_0x6151('0x17')][_0x6151('0x19')]);return _0xb9019b(_0x3f82f4[_0x6151('0x17')][_0x6151('0x19')]);}else{logger[_0x6151('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x13c0a8,_0x6151('0x15'));_0xb9019b(_0x3f82f4[_0x6151('0x1a')]['message']);}})[_0x6151('0x1b')](function(_0x24bfbd){logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x24bfbd);_0x469a87(_0x24bfbd);});});}exports[_0x6151('0x1c')]=function(_0x1c8ff6){var _0x38bcac=this;return new Promise(function(_0x3792b9,_0x18a908){return db[_0x6151('0x1d')][_0x6151('0x1e')]({'raw':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6[_0x6151('0x1f')][_0x6151('0x20')]===undefined?!![]:![]:!![],'where':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6['options'][_0x6151('0x21')]||null:null,'attributes':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6['options'][_0x6151('0x22')]||null:null,'include':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6[_0x6151('0x1f')]['include']?_[_0x6151('0x23')](_0x1c8ff6[_0x6151('0x1f')]['include'],function(_0x30f34b){return{'model':db[_0x30f34b[_0x6151('0x24')]],'as':_0x30f34b['as'],'attributes':_0x30f34b[_0x6151('0x22')],'include':_0x30f34b[_0x6151('0x25')]?_['map'](_0x30f34b[_0x6151('0x25')],function(_0x3e1739){return{'model':db[_0x3e1739[_0x6151('0x24')]],'as':_0x3e1739['as'],'attributes':_0x3e1739[_0x6151('0x22')],'include':_0x3e1739['include']?_[_0x6151('0x23')](_0x3e1739[_0x6151('0x25')],function(_0x99ea9f){return{'model':db[_0x99ea9f['model']],'as':_0x99ea9f['as'],'attributes':_0x99ea9f[_0x6151('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6151('0x11')](function(_0x5de929){logger[_0x6151('0x12')](_0x6151('0x1c'),_0x1c8ff6);logger[_0x6151('0x26')](_0x6151('0x1c'),_0x1c8ff6,JSON[_0x6151('0x16')](_0x5de929));_0x3792b9(_0x5de929);})[_0x6151('0x1b')](function(_0x33fb40){logger[_0x6151('0x17')](_0x6151('0x1c'),_0x33fb40[_0x6151('0x19')],_0x1c8ff6);_0x18a908(_0x38bcac[_0x6151('0x17')](0x1f4,_0x33fb40[_0x6151('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2cde175..102a760 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a37=['save','remove','update','emit','removeListener','register','length','./whatsappAccount.events'];(function(_0x1221fc,_0x129596){var _0x5210a7=function(_0x4e7d68){while(--_0x4e7d68){_0x1221fc['push'](_0x1221fc['shift']());}};_0x5210a7(++_0x129596);}(_0x8a37,0x77));var _0x78a3=function(_0x94ff4f,_0x4e7570){_0x94ff4f=_0x94ff4f-0x0;var _0x412c53=_0x8a37[_0x94ff4f];return _0x412c53;};'use strict';var WhatsappAccountEvents=require(_0x78a3('0x0'));var events=[_0x78a3('0x1'),_0x78a3('0x2'),_0x78a3('0x3')];function createListener(_0x5d9e86,_0x1cdd26){return function(_0x4b3ac4){_0x1cdd26[_0x78a3('0x4')](_0x5d9e86,_0x4b3ac4);};}function removeListener(_0x5578d6,_0x377e13){return function(){WhatsappAccountEvents[_0x78a3('0x5')](_0x5578d6,_0x377e13);};}exports[_0x78a3('0x6')]=function(_0x5f3053){for(var _0x5943f9=0x0,_0x5606b1=events[_0x78a3('0x7')];_0x5943f9<_0x5606b1;_0x5943f9++){var _0x556d25=events[_0x5943f9];var _0x46112b=createListener('whatsappAccount:'+_0x556d25,_0x5f3053);WhatsappAccountEvents['on'](_0x556d25,_0x46112b);}}; \ No newline at end of file +var _0xed4d=['whatsappAccount:','./whatsappAccount.events','remove','update','emit','register','length'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xed4d,0x15f));var _0xded4=function(_0x37a881,_0x467f2b){_0x37a881=_0x37a881-0x0;var _0x287ecf=_0xed4d[_0x37a881];return _0x287ecf;};'use strict';var WhatsappAccountEvents=require(_0xded4('0x0'));var events=['save',_0xded4('0x1'),_0xded4('0x2')];function createListener(_0x1bda95,_0x16a9cd){return function(_0x3d5b51){_0x16a9cd[_0xded4('0x3')](_0x1bda95,_0x3d5b51);};}function removeListener(_0x374328,_0x37e832){return function(){WhatsappAccountEvents['removeListener'](_0x374328,_0x37e832);};}exports[_0xded4('0x4')]=function(_0x3492f9){for(var _0x2f9da7=0x0,_0x1688c8=events[_0xded4('0x5')];_0x2f9da7<_0x1688c8;_0x2f9da7++){var _0x4fd64c=events[_0x2f9da7];var _0x558d81=createListener(_0xded4('0x6')+_0x4fd64c,_0x3492f9);WhatsappAccountEvents['on'](_0x4fd64c,_0x558d81);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 8cb4973..279aaa7 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf88f=['multer','util','path','express','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','show','create','put','update','destroy','exports'];(function(_0x53c4e1,_0x4234b1){var _0x3f8a97=function(_0x5ce6d9){while(--_0x5ce6d9){_0x53c4e1['push'](_0x53c4e1['shift']());}};_0x3f8a97(++_0x4234b1);}(_0xf88f,0x1e0));var _0xff88=function(_0x4496df,_0x20ed1f){_0x4496df=_0x4496df-0x0;var _0x9dc301=_0xf88f[_0x4496df];return _0x9dc301;};'use strict';var multer=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var path=require(_0xff88('0x2'));var timeout=require('connect-timeout');var express=require(_0xff88('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xff88('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xff88('0x5'));var controller=require(_0xff88('0x6'));router['get']('/',auth[_0xff88('0x7')](),controller[_0xff88('0x8')]);router[_0xff88('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xff88('0xa')]);router['post']('/',auth[_0xff88('0x7')](),controller[_0xff88('0xb')]);router[_0xff88('0xc')]('/:id',auth[_0xff88('0x7')](),controller[_0xff88('0xd')]);router['delete']('/:id',auth[_0xff88('0x7')](),controller[_0xff88('0xe')]);module[_0xff88('0xf')]=router; \ No newline at end of file +var _0xf7d1=['create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7d1,0x113));var _0x1f7d=function(_0x3bba6d,_0x7927af){_0x3bba6d=_0x3bba6d-0x0;var _0xab7d67=_0xf7d1[_0x3bba6d];return _0xab7d67;};'use strict';var multer=require('multer');var util=require(_0x1f7d('0x0'));var path=require('path');var timeout=require(_0x1f7d('0x1'));var express=require('express');var router=express[_0x1f7d('0x2')]();var fs_extra=require(_0x1f7d('0x3'));var auth=require(_0x1f7d('0x4'));var interaction=require(_0x1f7d('0x5'));var config=require(_0x1f7d('0x6'));var controller=require(_0x1f7d('0x7'));router['get']('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x9')]);router[_0x1f7d('0xa')](_0x1f7d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1f7d('0xc')]('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xd')]);router['put']('/:id',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xe')]);router[_0x1f7d('0xf')](_0x1f7d('0xb'),auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x10')]);module[_0x1f7d('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 469958a..d579fcd 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25b7=['TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x5bfe28,_0x62610){var _0x23dd48=function(_0x5e195a){while(--_0x5e195a){_0x5bfe28['push'](_0x5bfe28['shift']());}};_0x23dd48(++_0x62610);}(_0x25b7,0x1d4));var _0x725b=function(_0xe6aa70,_0x12ebbe){_0xe6aa70=_0xe6aa70-0x0;var _0x55167c=_0x25b7[_0xe6aa70];return _0x55167c;};'use strict';var Sequelize=require(_0x725b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x725b('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x725b('0x2')]()},'description':{'type':Sequelize[_0x725b('0x3')]},'interval':{'type':Sequelize[_0x725b('0x3')],'defaultValue':_0x725b('0x4')}}; \ No newline at end of file +var _0x9cfd=['*,*,*,*','sequelize','exports','STRING'];(function(_0x49c959,_0x5c3943){var _0x38b0e8=function(_0x10546b){while(--_0x10546b){_0x49c959['push'](_0x49c959['shift']());}};_0x38b0e8(++_0x5c3943);}(_0x9cfd,0x129));var _0xd9cf=function(_0x5c2e16,_0x5bae00){_0x5c2e16=_0x5c2e16-0x0;var _0x57070d=_0x9cfd[_0x5c2e16];return _0x57070d;};'use strict';var Sequelize=require(_0xd9cf('0x0'));module[_0xd9cf('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd9cf('0x2')]},'interval':{'type':Sequelize[_0xd9cf('0x2')],'defaultValue':_0xd9cf('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 0a2904d..cbef254 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9541=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','show','params','length','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2e06a1,_0x4a88b2){var _0x56f56e=function(_0x21e756){while(--_0x21e756){_0x2e06a1['push'](_0x2e06a1['shift']());}};_0x56f56e(++_0x4a88b2);}(_0x9541,0xb3));var _0x1954=function(_0x3a1ee7,_0x56c902){_0x3a1ee7=_0x3a1ee7-0x0;var _0x2e75e2=_0x9541[_0x3a1ee7];return _0x2e75e2;};'use strict';var emlformat=require(_0x1954('0x0'));var rimraf=require(_0x1954('0x1'));var zipdir=require(_0x1954('0x2'));var jsonpatch=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var moment=require(_0x1954('0x5'));var BPromise=require(_0x1954('0x6'));var Mustache=require(_0x1954('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1954('0x8'));var csv=require(_0x1954('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1954('0xa'));var _=require(_0x1954('0xb'));var squel=require(_0x1954('0xc'));var crypto=require(_0x1954('0xd'));var jsforce=require(_0x1954('0xe'));var deskjs=require(_0x1954('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1954('0x10'));var Papa=require(_0x1954('0x11'));var Redis=require(_0x1954('0x12'));var authService=require(_0x1954('0x13'));var qs=require(_0x1954('0x14'));var as=require(_0x1954('0x15'));var hardwareService=require(_0x1954('0x16'));var logger=require(_0x1954('0x17'))('api');var utils=require(_0x1954('0x18'));var config=require(_0x1954('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1954('0x1a'))['db'];function respondWithStatusCode(_0x5e8400,_0x289155){_0x289155=_0x289155||0xcc;return function(_0x4dc96b){if(_0x4dc96b){return _0x5e8400['sendStatus'](_0x289155);}return _0x5e8400['status'](_0x289155)[_0x1954('0x1b')]();};}function respondWithResult(_0x1b33cb,_0x96906a){_0x96906a=_0x96906a||0xc8;return function(_0x520dc7){if(_0x520dc7){return _0x1b33cb[_0x1954('0x1c')](_0x96906a)['json'](_0x520dc7);}};}function respondWithFilteredResult(_0x5daee1,_0xaeb0e3){return function(_0xf43d28){if(_0xf43d28){var _0x36565c=typeof _0xaeb0e3[_0x1954('0x1d')]===_0x1954('0x1e')&&typeof _0xaeb0e3[_0x1954('0x1f')]===_0x1954('0x1e');var _0x46b400=_0xf43d28[_0x1954('0x20')];var _0xb9c2cd=_0x36565c?0x0:_0xaeb0e3[_0x1954('0x1d')];var _0x3da757=_0x36565c?_0xf43d28[_0x1954('0x20')]:_0xaeb0e3[_0x1954('0x1d')]+_0xaeb0e3[_0x1954('0x1f')];var _0x4503d7;if(_0x3da757>=_0x46b400){_0x3da757=_0x46b400;_0x4503d7=0xc8;}else{_0x4503d7=0xce;}_0x5daee1[_0x1954('0x1c')](_0x4503d7);return _0x5daee1[_0x1954('0x21')](_0x1954('0x22'),_0xb9c2cd+'-'+_0x3da757+'/'+_0x46b400)[_0x1954('0x23')](_0xf43d28);}return null;};}function patchUpdates(_0x5e20b8){return function(_0x2105d5){try{jsonpatch[_0x1954('0x24')](_0x2105d5,_0x5e20b8,!![]);}catch(_0x3a84c0){return BPromise[_0x1954('0x25')](_0x3a84c0);}return _0x2105d5[_0x1954('0x26')]();};}function saveUpdates(_0x5e549f,_0x61107d){return function(_0x15dd0b){if(_0x15dd0b){return _0x15dd0b[_0x1954('0x27')](_0x5e549f)[_0x1954('0x28')](function(_0x6d8a2){return _0x6d8a2;});}return null;};}function removeEntity(_0x5a7256,_0x4d1b25){return function(_0x18a883){if(_0x18a883){return _0x18a883[_0x1954('0x29')]()[_0x1954('0x28')](function(){_0x5a7256[_0x1954('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f395,_0x26484f){return function(_0x27dc66){if(!_0x27dc66){_0x21f395[_0x1954('0x2a')](0x194);}return _0x27dc66;};}function handleError(_0x3f06de,_0x1bfa18){_0x1bfa18=_0x1bfa18||0x1f4;return function(_0x46fdc1){logger['error'](_0x46fdc1[_0x1954('0x2b')]);if(_0x46fdc1[_0x1954('0x2c')]){delete _0x46fdc1['name'];}_0x3f06de[_0x1954('0x1c')](_0x1bfa18)[_0x1954('0x2d')](_0x46fdc1);};}exports[_0x1954('0x2e')]=function(_0x3a488b,_0x1d8f32){var _0x251386={},_0x41b143={},_0x41c850={'count':0x0,'rows':[]};var _0xde7055=_[_0x1954('0x2f')](db[_0x1954('0x30')][_0x1954('0x31')],function(_0x40da25){return{'name':_0x40da25[_0x1954('0x32')],'type':_0x40da25[_0x1954('0x33')][_0x1954('0x34')]};});_0x41b143[_0x1954('0x35')]=_[_0x1954('0x2f')](_0xde7055,_0x1954('0x2c'));_0x41b143[_0x1954('0x36')]=_[_0x1954('0x37')](_0x3a488b[_0x1954('0x36')]);_0x41b143[_0x1954('0x38')]=_[_0x1954('0x39')](_0x41b143['model'],_0x41b143['query']);_0x251386[_0x1954('0x3a')]=_['intersection'](_0x41b143[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x3a488b['query'][_0x1954('0x3b')]));_0x251386[_0x1954('0x3a')]=_0x251386['attributes']['length']?_0x251386[_0x1954('0x3a')]:_0x41b143[_0x1954('0x35')];if(!_0x3a488b[_0x1954('0x36')][_0x1954('0x3c')](_0x1954('0x3d'))){_0x251386[_0x1954('0x1f')]=qs[_0x1954('0x1f')](_0x3a488b['query']['limit']);_0x251386[_0x1954('0x1d')]=qs[_0x1954('0x1d')](_0x3a488b[_0x1954('0x36')][_0x1954('0x1d')]);}_0x251386[_0x1954('0x3e')]=qs[_0x1954('0x3f')](_0x3a488b['query'][_0x1954('0x3f')]);_0x251386[_0x1954('0x40')]=qs['filters'](_[_0x1954('0x41')](_0x3a488b[_0x1954('0x36')],_0x41b143['filters']),_0xde7055);if(_0x3a488b['query'][_0x1954('0x42')]){_0x251386[_0x1954('0x40')]=_['merge'](_0x251386[_0x1954('0x40')],{'$or':_[_0x1954('0x2f')](_0xde7055,function(_0x13725c){if(_0x13725c[_0x1954('0x33')]!=='VIRTUAL'){var _0x339b28={};_0x339b28[_0x13725c['name']]={'$like':'%'+_0x3a488b[_0x1954('0x36')][_0x1954('0x42')]+'%'};return _0x339b28;}})});}_0x251386=_[_0x1954('0x43')]({},_0x251386,_0x3a488b['options']);var _0x1c2f3={'where':_0x251386[_0x1954('0x40')]};return db[_0x1954('0x30')][_0x1954('0x20')](_0x1c2f3)[_0x1954('0x28')](function(_0x517492){_0x41c850[_0x1954('0x20')]=_0x517492;if(_0x3a488b['query'][_0x1954('0x44')]){_0x251386['include']=[{'all':!![]}];}return db[_0x1954('0x30')][_0x1954('0x45')](_0x251386);})[_0x1954('0x28')](function(_0x4334f9){_0x41c850['rows']=_0x4334f9;return _0x41c850;})[_0x1954('0x28')](respondWithFilteredResult(_0x1d8f32,_0x251386))['catch'](handleError(_0x1d8f32,null));};exports[_0x1954('0x46')]=function(_0x1435d6,_0x59c4cb){var _0x1dede8={'raw':!![],'where':{'id':_0x1435d6[_0x1954('0x47')]['id']}},_0x45f70e={};_0x45f70e[_0x1954('0x35')]=_[_0x1954('0x37')](db[_0x1954('0x30')][_0x1954('0x31')]);_0x45f70e[_0x1954('0x36')]=_[_0x1954('0x37')](_0x1435d6['query']);_0x45f70e['filters']=_['intersection'](_0x45f70e[_0x1954('0x35')],_0x45f70e['query']);_0x1dede8[_0x1954('0x3a')]=_[_0x1954('0x39')](_0x45f70e[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x1435d6[_0x1954('0x36')][_0x1954('0x3b')]));_0x1dede8[_0x1954('0x3a')]=_0x1dede8[_0x1954('0x3a')][_0x1954('0x48')]?_0x1dede8['attributes']:_0x45f70e['model'];if(_0x1435d6[_0x1954('0x36')]['includeAll']){_0x1dede8[_0x1954('0x49')]=[{'all':!![]}];}_0x1dede8=_['merge']({},_0x1dede8,_0x1435d6[_0x1954('0x4a')]);return db[_0x1954('0x30')][_0x1954('0x4b')](_0x1dede8)[_0x1954('0x28')](handleEntityNotFound(_0x59c4cb,null))[_0x1954('0x28')](respondWithResult(_0x59c4cb,null))[_0x1954('0x4c')](handleError(_0x59c4cb,null));};exports[_0x1954('0x4d')]=function(_0x15ff45,_0x15295e){return db[_0x1954('0x30')]['create'](_0x15ff45[_0x1954('0x4e')],{})[_0x1954('0x28')](respondWithResult(_0x15295e,0xc9))[_0x1954('0x4c')](handleError(_0x15295e,null));};exports[_0x1954('0x27')]=function(_0x510b62,_0x1cd2dd){if(_0x510b62[_0x1954('0x4e')]['id']){delete _0x510b62['body']['id'];}return db[_0x1954('0x30')]['find']({'where':{'id':_0x510b62[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1cd2dd,null))[_0x1954('0x28')](saveUpdates(_0x510b62[_0x1954('0x4e')],null))[_0x1954('0x28')](respondWithResult(_0x1cd2dd,null))[_0x1954('0x4c')](handleError(_0x1cd2dd,null));};exports[_0x1954('0x29')]=function(_0x49003e,_0x1b4557){return db['WhatsappApplication'][_0x1954('0x4b')]({'where':{'id':_0x49003e[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1b4557,null))['then'](removeEntity(_0x1b4557,null))[_0x1954('0x4c')](handleError(_0x1b4557,null));}; \ No newline at end of file +var _0x8768=['includeAll','find','catch','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','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','WhatsappApplication','fieldName','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','length'];(function(_0x39be61,_0x3852b1){var _0x1f91c8=function(_0x3c9a6b){while(--_0x3c9a6b){_0x39be61['push'](_0x39be61['shift']());}};_0x1f91c8(++_0x3852b1);}(_0x8768,0xa1));var _0x8876=function(_0x4b433d,_0x8b4ddb){_0x4b433d=_0x4b433d-0x0;var _0x406ea7=_0x8768[_0x4b433d];return _0x406ea7;};'use strict';var emlformat=require(_0x8876('0x0'));var rimraf=require(_0x8876('0x1'));var zipdir=require(_0x8876('0x2'));var jsonpatch=require(_0x8876('0x3'));var rp=require(_0x8876('0x4'));var moment=require(_0x8876('0x5'));var BPromise=require(_0x8876('0x6'));var Mustache=require(_0x8876('0x7'));var util=require(_0x8876('0x8'));var path=require(_0x8876('0x9'));var sox=require(_0x8876('0xa'));var csv=require(_0x8876('0xb'));var ejs=require(_0x8876('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8876('0xd'));var squel=require(_0x8876('0xe'));var crypto=require(_0x8876('0xf'));var jsforce=require(_0x8876('0x10'));var deskjs=require(_0x8876('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8876('0x12'));var Redis=require(_0x8876('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8876('0x14'));var hardwareService=require(_0x8876('0x15'));var logger=require(_0x8876('0x16'))(_0x8876('0x17'));var utils=require(_0x8876('0x18'));var config=require(_0x8876('0x19'));var licenseUtil=require(_0x8876('0x1a'));var db=require(_0x8876('0x1b'))['db'];function respondWithStatusCode(_0x1415ad,_0x3c3c10){_0x3c3c10=_0x3c3c10||0xcc;return function(_0x5d2f75){if(_0x5d2f75){return _0x1415ad[_0x8876('0x1c')](_0x3c3c10);}return _0x1415ad[_0x8876('0x1d')](_0x3c3c10)[_0x8876('0x1e')]();};}function respondWithResult(_0x44de2a,_0xb502bf){_0xb502bf=_0xb502bf||0xc8;return function(_0x4b71cf){if(_0x4b71cf){return _0x44de2a[_0x8876('0x1d')](_0xb502bf)[_0x8876('0x1f')](_0x4b71cf);}};}function respondWithFilteredResult(_0x16f98b,_0xcdaa43){return function(_0x262058){if(_0x262058){var _0x2d50ad=typeof _0xcdaa43[_0x8876('0x20')]==='undefined'&&typeof _0xcdaa43[_0x8876('0x21')]===_0x8876('0x22');var _0xeea8f9=_0x262058[_0x8876('0x23')];var _0x146fdf=_0x2d50ad?0x0:_0xcdaa43['offset'];var _0x482899=_0x2d50ad?_0x262058[_0x8876('0x23')]:_0xcdaa43[_0x8876('0x20')]+_0xcdaa43[_0x8876('0x21')];var _0x56771b;if(_0x482899>=_0xeea8f9){_0x482899=_0xeea8f9;_0x56771b=0xc8;}else{_0x56771b=0xce;}_0x16f98b[_0x8876('0x1d')](_0x56771b);return _0x16f98b[_0x8876('0x24')]('Content-Range',_0x146fdf+'-'+_0x482899+'/'+_0xeea8f9)[_0x8876('0x1f')](_0x262058);}return null;};}function patchUpdates(_0xe3c6a1){return function(_0x26074f){try{jsonpatch[_0x8876('0x25')](_0x26074f,_0xe3c6a1,!![]);}catch(_0x2522d7){return BPromise[_0x8876('0x26')](_0x2522d7);}return _0x26074f[_0x8876('0x27')]();};}function saveUpdates(_0x4e6b3c,_0x3dd3f1){return function(_0x5cfbd9){if(_0x5cfbd9){return _0x5cfbd9[_0x8876('0x28')](_0x4e6b3c)[_0x8876('0x29')](function(_0x327d58){return _0x327d58;});}return null;};}function removeEntity(_0x474843,_0x168170){return function(_0x460240){if(_0x460240){return _0x460240[_0x8876('0x2a')]()[_0x8876('0x29')](function(){_0x474843[_0x8876('0x1d')](0xcc)[_0x8876('0x1e')]();});}};}function handleEntityNotFound(_0x166c18,_0x1e0f91){return function(_0xbd6621){if(!_0xbd6621){_0x166c18['sendStatus'](0x194);}return _0xbd6621;};}function handleError(_0x302b9f,_0x2a5662){_0x2a5662=_0x2a5662||0x1f4;return function(_0x1d1f9a){logger[_0x8876('0x2b')](_0x1d1f9a[_0x8876('0x2c')]);if(_0x1d1f9a[_0x8876('0x2d')]){delete _0x1d1f9a[_0x8876('0x2d')];}_0x302b9f['status'](_0x2a5662)[_0x8876('0x2e')](_0x1d1f9a);};}exports['index']=function(_0x5dbffd,_0x18203c){var _0x57ea22={},_0x49de2e={},_0x41312a={'count':0x0,'rows':[]};var _0x53e2fc=_['map'](db[_0x8876('0x2f')]['rawAttributes'],function(_0x18e580){return{'name':_0x18e580[_0x8876('0x30')],'type':_0x18e580['type'][_0x8876('0x31')]};});_0x49de2e['model']=_['map'](_0x53e2fc,_0x8876('0x2d'));_0x49de2e['query']=_[_0x8876('0x32')](_0x5dbffd[_0x8876('0x33')]);_0x49de2e[_0x8876('0x34')]=_['intersection'](_0x49de2e[_0x8876('0x35')],_0x49de2e[_0x8876('0x33')]);_0x57ea22[_0x8876('0x36')]=_[_0x8876('0x37')](_0x49de2e[_0x8876('0x35')],qs['fields'](_0x5dbffd['query'][_0x8876('0x38')]));_0x57ea22[_0x8876('0x36')]=_0x57ea22[_0x8876('0x36')]['length']?_0x57ea22[_0x8876('0x36')]:_0x49de2e[_0x8876('0x35')];if(!_0x5dbffd['query'][_0x8876('0x39')](_0x8876('0x3a'))){_0x57ea22[_0x8876('0x21')]=qs[_0x8876('0x21')](_0x5dbffd[_0x8876('0x33')][_0x8876('0x21')]);_0x57ea22[_0x8876('0x20')]=qs[_0x8876('0x20')](_0x5dbffd[_0x8876('0x33')][_0x8876('0x20')]);}_0x57ea22['order']=qs[_0x8876('0x3b')](_0x5dbffd['query'][_0x8876('0x3b')]);_0x57ea22[_0x8876('0x3c')]=qs['filters'](_[_0x8876('0x3d')](_0x5dbffd[_0x8876('0x33')],_0x49de2e['filters']),_0x53e2fc);if(_0x5dbffd[_0x8876('0x33')]['filter']){_0x57ea22[_0x8876('0x3c')]=_[_0x8876('0x3e')](_0x57ea22[_0x8876('0x3c')],{'$or':_[_0x8876('0x3f')](_0x53e2fc,function(_0x373e9c){if(_0x373e9c['type']!==_0x8876('0x40')){var _0xc5698c={};_0xc5698c[_0x373e9c[_0x8876('0x2d')]]={'$like':'%'+_0x5dbffd['query']['filter']+'%'};return _0xc5698c;}})});}_0x57ea22=_[_0x8876('0x3e')]({},_0x57ea22,_0x5dbffd[_0x8876('0x41')]);var _0x90687f={'where':_0x57ea22[_0x8876('0x3c')]};return db[_0x8876('0x2f')][_0x8876('0x23')](_0x90687f)[_0x8876('0x29')](function(_0x54b888){_0x41312a['count']=_0x54b888;if(_0x5dbffd[_0x8876('0x33')]['includeAll']){_0x57ea22[_0x8876('0x42')]=[{'all':!![]}];}return db[_0x8876('0x2f')][_0x8876('0x43')](_0x57ea22);})[_0x8876('0x29')](function(_0x21a023){_0x41312a[_0x8876('0x44')]=_0x21a023;return _0x41312a;})[_0x8876('0x29')](respondWithFilteredResult(_0x18203c,_0x57ea22))['catch'](handleError(_0x18203c,null));};exports[_0x8876('0x45')]=function(_0x22ae1b,_0x39e021){var _0x44078a={'raw':!![],'where':{'id':_0x22ae1b[_0x8876('0x46')]['id']}},_0x3670ea={};_0x3670ea[_0x8876('0x35')]=_['keys'](db['WhatsappApplication'][_0x8876('0x47')]);_0x3670ea[_0x8876('0x33')]=_[_0x8876('0x32')](_0x22ae1b[_0x8876('0x33')]);_0x3670ea[_0x8876('0x34')]=_[_0x8876('0x37')](_0x3670ea['model'],_0x3670ea['query']);_0x44078a[_0x8876('0x36')]=_['intersection'](_0x3670ea['model'],qs[_0x8876('0x38')](_0x22ae1b[_0x8876('0x33')][_0x8876('0x38')]));_0x44078a[_0x8876('0x36')]=_0x44078a['attributes'][_0x8876('0x48')]?_0x44078a['attributes']:_0x3670ea[_0x8876('0x35')];if(_0x22ae1b[_0x8876('0x33')][_0x8876('0x49')]){_0x44078a[_0x8876('0x42')]=[{'all':!![]}];}_0x44078a=_[_0x8876('0x3e')]({},_0x44078a,_0x22ae1b[_0x8876('0x41')]);return db[_0x8876('0x2f')][_0x8876('0x4a')](_0x44078a)[_0x8876('0x29')](handleEntityNotFound(_0x39e021,null))['then'](respondWithResult(_0x39e021,null))[_0x8876('0x4b')](handleError(_0x39e021,null));};exports[_0x8876('0x4c')]=function(_0x1b93e6,_0x1075cb){return db[_0x8876('0x2f')][_0x8876('0x4c')](_0x1b93e6[_0x8876('0x4d')],{})[_0x8876('0x29')](respondWithResult(_0x1075cb,0xc9))['catch'](handleError(_0x1075cb,null));};exports['update']=function(_0x5673bf,_0x113fbb){if(_0x5673bf[_0x8876('0x4d')]['id']){delete _0x5673bf[_0x8876('0x4d')]['id'];}return db['WhatsappApplication'][_0x8876('0x4a')]({'where':{'id':_0x5673bf[_0x8876('0x46')]['id']}})[_0x8876('0x29')](handleEntityNotFound(_0x113fbb,null))[_0x8876('0x29')](saveUpdates(_0x5673bf[_0x8876('0x4d')],null))[_0x8876('0x29')](respondWithResult(_0x113fbb,null))[_0x8876('0x4b')](handleError(_0x113fbb,null));};exports[_0x8876('0x2a')]=function(_0x4e1716,_0x3d121e){return db[_0x8876('0x2f')][_0x8876('0x4a')]({'where':{'id':_0x4e1716['params']['id']}})['then'](handleEntityNotFound(_0x3d121e,null))[_0x8876('0x29')](removeEntity(_0x3d121e,null))[_0x8876('0x4b')](handleError(_0x3d121e,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ab7f04d..32006a8 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','lodash'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xa41a,0x6b));var _0xaa41=function(_0x25a13c,_0x47ec9a){_0x25a13c=_0x25a13c-0x0;var _0x34ceb9=_0xa41a[_0x25a13c];return _0x34ceb9;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('WhatsappApplication',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa41('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdad2=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdad2,0x14c));var _0x2dad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdad2[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var logger=require(_0x2dad('0x1'))('api');var moment=require(_0x2dad('0x2'));var BPromise=require(_0x2dad('0x3'));var rp=require(_0x2dad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dad('0x5'));var config=require(_0x2dad('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0x2dad('0x7')]=function(_0x36a054,_0x27ca04){return _0x36a054[_0x2dad('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dad('0x9'),'collate':_0x2dad('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 32d6366..cefdc4f 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1b278d,_0x334ef2){var _0x594195=function(_0x455e9d){while(--_0x455e9d){_0x1b278d['push'](_0x1b278d['shift']());}};_0x594195(++_0x334ef2);}(_0x70e0,0x17b));var _0x070e=function(_0x27ca8d,_0x2b34ed){_0x27ca8d=_0x27ca8d-0x0;var _0x20b795=_0x70e0[_0x27ca8d];return _0x20b795;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\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 +var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc087bb,_0x3aa26a){var _0x46efd5=function(_0x5afd99){while(--_0x5afd99){_0xc087bb['push'](_0xc087bb['shift']());}};_0x46efd5(++_0x3aa26a);}(_0x70e0,0x17b));var _0x070e=function(_0x4b6e3e,_0x4bf14f){_0x4b6e3e=_0x4b6e3e-0x0;var _0x13a645=_0x70e0[_0x4b6e3e];return _0x13a645;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\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/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f94637c..2544d73 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0618=['update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x0618,0x1c6));var _0x8061=function(_0x2e8e0f,_0x5101c8){_0x2e8e0f=_0x2e8e0f-0x0;var _0x7286c6=_0x0618[_0x2e8e0f];return _0x7286c6;};'use strict';var multer=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var path=require('path');var timeout=require(_0x8061('0x2'));var express=require(_0x8061('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8061('0x4'));var interaction=require(_0x8061('0x5'));var config=require(_0x8061('0x6'));var controller=require(_0x8061('0x7'));router[_0x8061('0x8')]('/',auth[_0x8061('0x9')](),controller[_0x8061('0xa')]);router[_0x8061('0x8')](_0x8061('0xb'),auth[_0x8061('0x9')](),controller[_0x8061('0xc')]);router['get'](_0x8061('0xd'),auth['isAuthenticated'](),controller[_0x8061('0xe')]);router[_0x8061('0x8')](_0x8061('0xf'),auth[_0x8061('0x9')](),controller[_0x8061('0x10')]);router['get']('/:id/download',auth[_0x8061('0x9')](),controller[_0x8061('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8061('0x12')]);router[_0x8061('0x13')](_0x8061('0xf'),auth[_0x8061('0x9')](),controller[_0x8061('0x14')]);router[_0x8061('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x17')),controller[_0x8061('0x18')]);router['put']('/:id',auth[_0x8061('0x9')](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x19')),controller[_0x8061('0x1a')]);router[_0x8061('0x1b')](_0x8061('0xd'),auth[_0x8061('0x9')](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x1c')),controller[_0x8061('0x1d')]);router[_0x8061('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8061('0x1e')]);module[_0x8061('0x1f')]=router; \ No newline at end of file +var _0x6657=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe'];(function(_0xc2d26f,_0x180ccf){var _0x50e707=function(_0x59d7c1){while(--_0x59d7c1){_0xc2d26f['push'](_0xc2d26f['shift']());}};_0x50e707(++_0x180ccf);}(_0x6657,0x17f));var _0x7665=function(_0x5076ae,_0x4d9525){_0x5076ae=_0x5076ae-0x0;var _0x1b936f=_0x6657[_0x5076ae];return _0x1b936f;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7665('0x5'));var interaction=require(_0x7665('0x6'));var config=require(_0x7665('0x7'));var controller=require(_0x7665('0x8'));router[_0x7665('0x9')]('/',auth[_0x7665('0xa')](),controller[_0x7665('0xb')]);router[_0x7665('0x9')]('/describe',auth[_0x7665('0xa')](),controller[_0x7665('0xc')]);router[_0x7665('0x9')](_0x7665('0xd'),auth[_0x7665('0xa')](),controller[_0x7665('0xe')]);router[_0x7665('0x9')](_0x7665('0xf'),auth['isAuthenticated'](),controller[_0x7665('0x10')]);router[_0x7665('0x9')](_0x7665('0x11'),auth['isAuthenticated'](),controller[_0x7665('0x12')]);router['post']('/',auth[_0x7665('0xa')](),controller[_0x7665('0x13')]);router['post'](_0x7665('0xf'),auth[_0x7665('0xa')](),controller['addMessage']);router[_0x7665('0x14')](_0x7665('0x15'),auth['isAuthenticated'](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x18')),controller[_0x7665('0x19')]);router[_0x7665('0x1a')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x1b')),controller[_0x7665('0x1c')]);router[_0x7665('0x1d')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),'whatsappinteraction:destroy'),controller[_0x7665('0x1e')]);router[_0x7665('0x1d')]('/:id/tags',auth[_0x7665('0xa')](),controller[_0x7665('0x1f')]);module[_0x7665('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 4d22a9b..ee5e38d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb073=['out','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3ed8ce,_0x568ba3){var _0x2188f7=function(_0x3981f4){while(--_0x3981f4){_0x3ed8ce['push'](_0x3ed8ce['shift']());}};_0x2188f7(++_0x568ba3);}(_0xb073,0x187));var _0x3b07=function(_0x4aa7d6,_0xb8ae3){_0x4aa7d6=_0x4aa7d6-0x0;var _0xa0c063=_0xb073[_0x4aa7d6];return _0xa0c063;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3b07('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3b07('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3b07('0x2')]},'disposition':{'type':Sequelize[_0x3b07('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3b07('0x3')]},'note':{'type':Sequelize[_0x3b07('0x3')]},'phone':{'type':Sequelize[_0x3b07('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3b07('0x4')]('in',_0x3b07('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3b07('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3b07('0x4')]('in',_0x3b07('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3b07('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x6347=['ENUM','out','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x59d32c,_0x306b7a){var _0x26e818=function(_0x4c3ed4){while(--_0x4c3ed4){_0x59d32c['push'](_0x59d32c['shift']());}};_0x26e818(++_0x306b7a);}(_0x6347,0x1c9));var _0x7634=function(_0x257a98,_0x214a6e){_0x257a98=_0x257a98-0x0;var _0x5dd12c=_0x6347[_0x257a98];return _0x5dd12c;};'use strict';var Sequelize=require(_0x7634('0x0'));var moment=require(_0x7634('0x1'));module['exports']={'closed':{'type':Sequelize[_0x7634('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7634('0x3')]},'disposition':{'type':Sequelize[_0x7634('0x4')]},'secondDisposition':{'type':Sequelize[_0x7634('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7634('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7634('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7634('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7634('0x5')]('in',_0x7634('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7634('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a566469..6b35ea7 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d9a=['api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','catch','params','model','keys','WhatsappInteraction','intersection','attributes','fields','includeAll','include','options','create','body','find','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','filters','length','nolimit','order','sort','where','WhatsappInteractionId','filter','merge','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','files','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','closed','closedAt','disposition','Messages','basename','createReadStream','pipe','createWriteStream','direction','System','out','read','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger'];(function(_0x23f8ed,_0xb646df){var _0x519ff7=function(_0x4e45fa){while(--_0x4e45fa){_0x23f8ed['push'](_0x23f8ed['shift']());}};_0x519ff7(++_0xb646df);}(_0x6d9a,0x179));var _0xa6d9=function(_0x3d0bd6,_0x4b5cc9){_0x3d0bd6=_0x3d0bd6-0x0;var _0x5ce57c=_0x6d9a[_0x3d0bd6];return _0x5ce57c;};'use strict';var rimraf=require(_0xa6d9('0x0'));var zipdir=require(_0xa6d9('0x1'));var moment=require(_0xa6d9('0x2'));var BPromise=require(_0xa6d9('0x3'));var util=require('util');var path=require(_0xa6d9('0x4'));var ejs=require(_0xa6d9('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xa6d9('0x6'));var qs=require(_0xa6d9('0x7'));var pdf=require(_0xa6d9('0x8'));var logger=require(_0xa6d9('0x9'))(_0xa6d9('0xa'));var config=require(_0xa6d9('0xb'));var db=require(_0xa6d9('0xc'))['db'];config[_0xa6d9('0xd')]=_[_0xa6d9('0xe')](config[_0xa6d9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa6d9('0xf'))(new Redis(config['redis']));require(_0xa6d9('0x10'))[_0xa6d9('0x11')](socket);function respondWithStatusCode(_0x5f1037,_0x1a2eed){_0x1a2eed=_0x1a2eed||0xcc;return function(_0x583f40){if(_0x583f40){return _0x5f1037[_0xa6d9('0x12')](_0x1a2eed);}return _0x5f1037[_0xa6d9('0x13')](_0x1a2eed)[_0xa6d9('0x14')]();};}function respondWithResult(_0x501f69,_0x5a59b6){_0x5a59b6=_0x5a59b6||0xc8;return function(_0x3412c1){if(_0x3412c1){return _0x501f69[_0xa6d9('0x13')](_0x5a59b6)[_0xa6d9('0x15')](_0x3412c1);}};}function respondWithFilteredResult(_0x3fee43,_0x52e4bb){return function(_0x30e97b){if(_0x30e97b){var _0x5719a7=typeof _0x52e4bb[_0xa6d9('0x16')]==='undefined'&&typeof _0x52e4bb[_0xa6d9('0x17')]==='undefined';var _0x1740e2=_0x30e97b[_0xa6d9('0x18')];var _0xa24ec8=_0x5719a7?0x0:_0x52e4bb[_0xa6d9('0x16')];var _0x37f7b2=_0x5719a7?_0x30e97b[_0xa6d9('0x18')]:_0x52e4bb[_0xa6d9('0x16')]+_0x52e4bb[_0xa6d9('0x17')];var _0x40e156;if(_0x37f7b2>=_0x1740e2){_0x37f7b2=_0x1740e2;_0x40e156=0xc8;}else{_0x40e156=0xce;}_0x3fee43[_0xa6d9('0x13')](_0x40e156);return _0x3fee43[_0xa6d9('0x19')](_0xa6d9('0x1a'),_0xa24ec8+'-'+_0x37f7b2+'/'+_0x1740e2)[_0xa6d9('0x15')](_0x30e97b);}return null;};}function saveUpdates(_0x566143){return function(_0xa9ec0){if(_0xa9ec0){return _0xa9ec0[_0xa6d9('0x1b')](_0x566143)[_0xa6d9('0x1c')](function(_0x1d7c5e){return _0x1d7c5e;});}return null;};}function removeEntity(_0x562dbe){return function(_0x26f974){if(_0x26f974){return _0x26f974[_0xa6d9('0x1d')]()['then'](function(){_0x562dbe[_0xa6d9('0x13')](0xcc)[_0xa6d9('0x14')]();});}};}function handleEntityNotFound(_0x2b2c50){return function(_0x344515){if(!_0x344515){_0x2b2c50['sendStatus'](0x194);}return _0x344515;};}function handleError(_0x422432,_0x2db67b){_0x2db67b=_0x2db67b||0x1f4;return function(_0x3ec444){logger[_0xa6d9('0x1e')](_0x3ec444[_0xa6d9('0x1f')]);if(_0x3ec444[_0xa6d9('0x20')]){delete _0x3ec444[_0xa6d9('0x20')];}_0x422432[_0xa6d9('0x13')](_0x2db67b)['send'](_0x3ec444);};}exports[_0xa6d9('0x21')]=function(_0x399dc1,_0x40584d){var _0x1709c9={};var _0x4210e2=_['map'](db['WhatsappInteraction'][_0xa6d9('0x22')],function(_0xda7494){return{'name':_0xda7494[_0xa6d9('0x23')],'type':_0xda7494[_0xa6d9('0x24')]['key']};});_0x1709c9=qs[_0xa6d9('0x25')](_0x4210e2,_0x399dc1);return interaction[_0xa6d9('0x26')](_0xa6d9('0x27'),_0x399dc1[_0xa6d9('0x28')],_0x399dc1[_0xa6d9('0x29')],_0x1709c9,_0x4210e2)[_0xa6d9('0x1c')](respondWithFilteredResult(_0x40584d,_0x1709c9))[_0xa6d9('0x2a')](handleError(_0x40584d,null));};exports['show']=function(_0x116ea6,_0x2cb952){var _0x3e6ed0={'raw':![],'where':{'id':_0x116ea6[_0xa6d9('0x2b')]['id']}},_0x41469a={};_0x41469a[_0xa6d9('0x2c')]=_[_0xa6d9('0x2d')](db[_0xa6d9('0x2e')][_0xa6d9('0x22')]);_0x41469a[_0xa6d9('0x28')]=_[_0xa6d9('0x2d')](_0x116ea6['query']);_0x41469a['filters']=_[_0xa6d9('0x2f')](_0x41469a[_0xa6d9('0x2c')],_0x41469a[_0xa6d9('0x28')]);_0x3e6ed0[_0xa6d9('0x30')]=_[_0xa6d9('0x2f')](_0x41469a[_0xa6d9('0x2c')],qs[_0xa6d9('0x31')](_0x116ea6['query'][_0xa6d9('0x31')]));_0x3e6ed0['attributes']=_0x3e6ed0[_0xa6d9('0x30')]['length']?_0x3e6ed0[_0xa6d9('0x30')]:_0x41469a[_0xa6d9('0x2c')];if(_0x116ea6[_0xa6d9('0x28')][_0xa6d9('0x32')]){_0x3e6ed0[_0xa6d9('0x33')]=[{'all':!![]}];}_0x3e6ed0=_['merge']({},_0x3e6ed0,_0x116ea6[_0xa6d9('0x34')]);return db[_0xa6d9('0x2e')]['find'](_0x3e6ed0)[_0xa6d9('0x1c')](handleEntityNotFound(_0x2cb952,null))[_0xa6d9('0x1c')](respondWithResult(_0x2cb952,null))['catch'](handleError(_0x2cb952,null));};exports[_0xa6d9('0x35')]=function(_0x2827d4,_0x2e35de){return db[_0xa6d9('0x2e')][_0xa6d9('0x35')](_0x2827d4[_0xa6d9('0x36')],{})[_0xa6d9('0x1c')](respondWithResult(_0x2e35de,0xc9))[_0xa6d9('0x2a')](handleError(_0x2e35de,null));};exports[_0xa6d9('0x1b')]=function(_0x18109f,_0x2a1b4e){if(_0x18109f[_0xa6d9('0x36')]['id']){delete _0x18109f[_0xa6d9('0x36')]['id'];}return db[_0xa6d9('0x2e')]['find']({'where':{'id':_0x18109f[_0xa6d9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2a1b4e,null))['then'](saveUpdates(_0x18109f[_0xa6d9('0x36')],null))[_0xa6d9('0x1c')](respondWithResult(_0x2a1b4e,null))[_0xa6d9('0x2a')](handleError(_0x2a1b4e,null));};exports['destroy']=function(_0x317ffe,_0x44c4a6){return db[_0xa6d9('0x2e')][_0xa6d9('0x37')]({'where':{'id':_0x317ffe[_0xa6d9('0x2b')]['id']}})[_0xa6d9('0x1c')](handleEntityNotFound(_0x44c4a6,null))['then'](removeEntity(_0x44c4a6,null))['catch'](handleError(_0x44c4a6,null));};exports['describe']=function(_0x4bb62a,_0x443a79){return db['WhatsappInteraction'][_0xa6d9('0x38')]()[_0xa6d9('0x1c')](respondWithResult(_0x443a79,null))[_0xa6d9('0x2a')](handleError(_0x443a79,null));};exports[_0xa6d9('0x39')]=function(_0x3f34d9,_0x5191b1){return db[_0xa6d9('0x3a')][_0xa6d9('0x37')]({'where':{'id':_0x3f34d9[_0xa6d9('0x2b')]['id']}})[_0xa6d9('0x1c')](handleEntityNotFound(_0x5191b1,null))[_0xa6d9('0x1c')](function(_0x566784){if(_0x566784){return _0x566784['addMessage'](_0x3f34d9[_0xa6d9('0x36')][_0xa6d9('0x3b')],_['omit'](_0x3f34d9[_0xa6d9('0x36')],[_0xa6d9('0x3b'),'id'])||{});}})[_0xa6d9('0x1c')](respondWithResult(_0x5191b1,null))[_0xa6d9('0x2a')](handleError(_0x5191b1,null));};exports[_0xa6d9('0x3c')]=function(_0x16cc2b,_0x475e91){var _0x50b8e4={'raw':![],'where':{}};var _0x54ccd3={};var _0xffbf58={'count':0x0,'rows':[]};return db[_0xa6d9('0x2e')][_0xa6d9('0x3d')]({'where':{'id':_0x16cc2b[_0xa6d9('0x2b')]['id']}})[_0xa6d9('0x1c')](handleEntityNotFound(_0x475e91,null))[_0xa6d9('0x1c')](function(_0x57dffe){if(_0x57dffe){_0x54ccd3[_0xa6d9('0x2c')]=_[_0xa6d9('0x2d')](db['WhatsappMessage'][_0xa6d9('0x22')]);_0x54ccd3[_0xa6d9('0x28')]=_['keys'](_0x16cc2b['query']);_0x54ccd3[_0xa6d9('0x3e')]=_['intersection'](_0x54ccd3[_0xa6d9('0x2c')],_0x54ccd3[_0xa6d9('0x28')]);_0x50b8e4[_0xa6d9('0x30')]=_['intersection'](_0x54ccd3[_0xa6d9('0x2c')],qs['fields'](_0x16cc2b[_0xa6d9('0x28')]['fields']));_0x50b8e4['attributes']=_0x50b8e4[_0xa6d9('0x30')][_0xa6d9('0x3f')]?_0x50b8e4['attributes']:_0x54ccd3[_0xa6d9('0x2c')];if(!_0x16cc2b[_0xa6d9('0x28')]['hasOwnProperty'](_0xa6d9('0x40'))){_0x50b8e4[_0xa6d9('0x17')]=qs[_0xa6d9('0x17')](_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x17')]);_0x50b8e4[_0xa6d9('0x16')]=qs[_0xa6d9('0x16')](_0x16cc2b[_0xa6d9('0x28')]['offset']);}_0x50b8e4[_0xa6d9('0x41')]=qs[_0xa6d9('0x42')](_0x16cc2b['query'][_0xa6d9('0x42')]);_0x50b8e4[_0xa6d9('0x43')]=qs[_0xa6d9('0x3e')](_['pick'](_0x16cc2b['query'],_0x54ccd3['filters']));_0x50b8e4['where'][_0xa6d9('0x44')]=_0x57dffe['id'];if(_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x45')]){_0x50b8e4['where']=_[_0xa6d9('0x46')](_0x50b8e4[_0xa6d9('0x43')],{'$or':_[_0xa6d9('0x47')](_0x50b8e4[_0xa6d9('0x30')],function(_0x48b1c1){var _0x500ec1={};_0x500ec1[_0x48b1c1]={'$like':'%'+_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x45')]+'%'};return _0x500ec1;})});}if(_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x48')]){var _0x26a7bb=_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x48')]['split'](',');var _0x2ca8a2={};_0x2ca8a2[_0x26a7bb[0x0]]={'$gte':moment(_0x26a7bb[0x1])[_0xa6d9('0x49')](_0xa6d9('0x4a'))};_0x50b8e4[_0xa6d9('0x43')]=_[_0xa6d9('0x46')](_0x50b8e4['where'],_0x2ca8a2);}_0x50b8e4=_[_0xa6d9('0x46')]({},_0x50b8e4,_0x16cc2b['options']);return db['WhatsappMessage'][_0xa6d9('0x18')]({'where':_0x50b8e4[_0xa6d9('0x43')]})[_0xa6d9('0x1c')](function(_0x4b3e46){_0xffbf58[_0xa6d9('0x18')]=_0x4b3e46;if(_0x16cc2b[_0xa6d9('0x28')][_0xa6d9('0x32')]){_0x50b8e4['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xa6d9('0x26')](_0x50b8e4);})[_0xa6d9('0x1c')](function(_0x2baa2d){_0xffbf58[_0xa6d9('0x4b')]=_0x2baa2d;return _0xffbf58;});}})[_0xa6d9('0x1c')](respondWithFilteredResult(_0x475e91,_0x50b8e4))['catch'](handleError(_0x475e91,null));};exports[_0xa6d9('0x4c')]=function(_0xb8b49f,_0x549211){return db[_0xa6d9('0x2e')]['find']({'where':{'id':_0xb8b49f['params']['id']}})[_0xa6d9('0x1c')](handleEntityNotFound(_0x549211,null))[_0xa6d9('0x1c')](function(_0x108db1){if(_0x108db1){return _0x108db1[_0xa6d9('0x4d')](_0xb8b49f['body']['ids'],_[_0xa6d9('0x4e')](_0xb8b49f[_0xa6d9('0x36')],[_0xa6d9('0x3b'),'id'])||{})['spread'](function(){return db[_0xa6d9('0x4f')]['findAll']({'attributes':['id',_0xa6d9('0x20'),_0xa6d9('0x50')],'where':{'id':_0xb8b49f[_0xa6d9('0x36')][_0xa6d9('0x3b')]}});})[_0xa6d9('0x1c')](function(_0x20e552){socket[_0xa6d9('0x51')](_0xa6d9('0x52'),{'id':Number(_0xb8b49f[_0xa6d9('0x2b')]['id']),'tags':_0x20e552||[]});return{'id':Number(_0xb8b49f[_0xa6d9('0x2b')]['id']),'tags':_0x20e552||[]};});}})[_0xa6d9('0x1c')](respondWithResult(_0x549211,null))[_0xa6d9('0x2a')](handleError(_0x549211,null));};exports[_0xa6d9('0x53')]=function(_0x170bf6,_0x488e31){return db['WhatsappInteraction'][_0xa6d9('0x37')]({'where':{'id':_0x170bf6['params']['id']}})[_0xa6d9('0x1c')](handleEntityNotFound(_0x488e31,null))[_0xa6d9('0x1c')](function(_0x26a126){if(_0x26a126){return _0x26a126[_0xa6d9('0x53')](_0x170bf6['query'][_0xa6d9('0x3b')]);}})[_0xa6d9('0x1c')](respondWithStatusCode(_0x488e31,null))[_0xa6d9('0x2a')](handleError(_0x488e31,null));};exports['download']=function(_0x5d1ff7,_0x50c09f){var _0x373f3f=moment()[_0xa6d9('0x54')]()[_0xa6d9('0x55')]();var _0x319412=path[_0xa6d9('0x56')](config[_0xa6d9('0x57')],'server',_0xa6d9('0x58'),'tmp');var _0x684ae3=path[_0xa6d9('0x56')](config[_0xa6d9('0x57')],_0xa6d9('0x59'),_0xa6d9('0x58'),_0xa6d9('0x5a'));var _0x56a828=path[_0xa6d9('0x56')](_0x319412,_0x373f3f);var _0x25fa8b=util[_0xa6d9('0x49')](_0xa6d9('0x5b'),_0x5d1ff7['params']['id'],_0x373f3f);var _0x4bace9=path[_0xa6d9('0x56')](_0x319412,_0x25fa8b);var _0x5c8770=[];_0x5c8770[_0xa6d9('0x5c')]({'model':db['User'],'as':_0xa6d9('0x5d'),'attributes':['id',_0xa6d9('0x5e')],'raw':!![]});_0x5c8770['push']({'model':db[_0xa6d9('0x5f')],'as':_0xa6d9('0x60'),'attributes':['id',_0xa6d9('0x61'),_0xa6d9('0x62')],'raw':!![]});if(_0x5d1ff7[_0xa6d9('0x28')][_0xa6d9('0x5a')]){_0x5c8770[_0xa6d9('0x5c')]({'model':db[_0xa6d9('0x63')],'as':'Attachment','raw':!![]});}var _0x142d1c=[{'model':db[_0xa6d9('0x3a')],'as':'Messages','attributes':['id','body',_0xa6d9('0x64'),'direction',_0xa6d9('0x65'),'read'],'include':_0x5c8770}];_0x142d1c[_0xa6d9('0x5c')]({'model':db[_0xa6d9('0x66')],'as':_0xa6d9('0x67'),'attributes':['id',_0xa6d9('0x20')]});_0x142d1c[_0xa6d9('0x5c')]({'model':db[_0xa6d9('0x5d')],'as':_0xa6d9('0x68'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0xa6d9('0x37')]({'where':{'id':_0x5d1ff7[_0xa6d9('0x2b')]['id']},'include':_0x142d1c})[_0xa6d9('0x1c')](handleEntityNotFound(_0x50c09f,null))[_0xa6d9('0x1c')](function(_0x4d5e40){if(_0x4d5e40){var _0x14472d=_0x4d5e40[_0xa6d9('0x69')]({'plain':!![]});fs[_0xa6d9('0x6a')](_0x56a828);var _0x1a082f={'channel':_0xa6d9('0x6b'),'account':_0x14472d[_0xa6d9('0x67')][_0xa6d9('0x20')],'agent':_0x14472d[_0xa6d9('0x68')]?_0x14472d[_0xa6d9('0x68')]['fullname']:'N.A.','createdAt':moment(_0x14472d[_0xa6d9('0x64')])[_0xa6d9('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa6d9('0x55')](),'closedAt':_0x14472d[_0xa6d9('0x6c')]?moment(_0x14472d[_0xa6d9('0x6d')])[_0xa6d9('0x49')](_0xa6d9('0x4a'))[_0xa6d9('0x55')]():'','disposition':_0x14472d[_0xa6d9('0x6e')],'messages':_(_0x14472d[_0xa6d9('0x6f')])[_0xa6d9('0x45')]({'secret':![]})[_0xa6d9('0x47')](function(_0x455e3f){if(_0x455e3f[_0xa6d9('0x63')]){var _0x1d6bf3=path[_0xa6d9('0x56')](_0x684ae3,_0x455e3f['Attachment'][_0xa6d9('0x70')]);if(fs['existsSync'](_0x1d6bf3)){fs[_0xa6d9('0x71')](_0x1d6bf3)[_0xa6d9('0x72')](fs[_0xa6d9('0x73')](path[_0xa6d9('0x56')](_0x56a828,_0x455e3f[_0xa6d9('0x63')][_0xa6d9('0x70')])));}}return{'date':moment(_0x455e3f['createdAt'])[_0xa6d9('0x49')](_0xa6d9('0x4a'))[_0xa6d9('0x55')](),'sender':_0x455e3f[_0xa6d9('0x74')]==='out'?_0x455e3f[_0xa6d9('0x5d')]?_0x455e3f['User'][_0xa6d9('0x5e')]:_0xa6d9('0x75'):_0x455e3f[_0xa6d9('0x60')][_0xa6d9('0x61')]+(_0x455e3f[_0xa6d9('0x60')]['lastName']?'\x20'+_0x455e3f[_0xa6d9('0x60')][_0xa6d9('0x62')]:''),'body':_0x455e3f[_0xa6d9('0x63')]?_0x455e3f['Attachment'][_0xa6d9('0x70')]:_0x455e3f[_0xa6d9('0x36')],'direction':_0x455e3f[_0xa6d9('0x74')]===_0xa6d9('0x76')?'A':'C','secret':_0x455e3f[_0xa6d9('0x65')],'read':_0x455e3f[_0xa6d9('0x77')],'attachment':_0x455e3f[_0xa6d9('0x63')]};})[_0xa6d9('0x78')]()};return ejs['renderFile'](path[_0xa6d9('0x56')](config[_0xa6d9('0x57')],'server',_0xa6d9('0x79'),_0xa6d9('0x7a')),{'interaction':_0x1a082f})[_0xa6d9('0x1c')](function(_0x17122b){var _0x2c2bd8=path['join'](_0x56a828,_0xa6d9('0x7b')+_0x14472d['id']+'-'+_0x373f3f+_0xa6d9('0x7c'));var _0x221e0a={'path':_0x2c2bd8,'channel':'Whatsapp','interactionId':_0x14472d['id']};return pdf[_0xa6d9('0x7d')](_0x17122b,_0x221e0a);})[_0xa6d9('0x1c')](function(){return new BPromise(function(_0x9e2cc0,_0x19a859){zipdir(_0x56a828,{'saveTo':_0x4bace9},function(_0x2d5795,_0x44fdcf){if(_0x2d5795)return _0x19a859(_0x2d5795);return _0x9e2cc0(_0x44fdcf);});})[_0xa6d9('0x1c')](function(){return new BPromise(function(_0x52ccff,_0x3fa5f8){rimraf(_0x56a828,function(_0x4c3137){if(_0x4c3137)_0x3fa5f8(_0x4c3137);return _0x52ccff();});});})[_0xa6d9('0x1c')](function(){return _0x50c09f[_0xa6d9('0x7e')](_0x4bace9,_0x25fa8b,function(_0x102841){if(_0x102841){console[_0xa6d9('0x7f')]('err',_0x102841);}else{fs[_0xa6d9('0x80')](_0x4bace9);}});});});}else{return _0x50c09f[_0xa6d9('0x12')](0xc8);}})['catch'](handleError(_0x50c09f,null));}; \ No newline at end of file +var _0xd959=['Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','firstName','lastName','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end','error','stack','name','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','filters','attributes','intersection','fields','includeAll','options','create','body','update','find','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','length','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition'];(function(_0x5dca17,_0x43cdb8){var _0xcc7f0c=function(_0x3c0ca2){while(--_0x3c0ca2){_0x5dca17['push'](_0x5dca17['shift']());}};_0xcc7f0c(++_0x43cdb8);}(_0xd959,0x94));var _0x9d95=function(_0x197a53,_0x3ddfe2){_0x197a53=_0x197a53-0x0;var _0x570384=_0xd959[_0x197a53];return _0x570384;};'use strict';var rimraf=require(_0x9d95('0x0'));var zipdir=require(_0x9d95('0x1'));var moment=require(_0x9d95('0x2'));var BPromise=require('bluebird');var util=require(_0x9d95('0x3'));var path=require(_0x9d95('0x4'));var ejs=require(_0x9d95('0x5'));var fs=require('fs');var _=require(_0x9d95('0x6'));var Redis=require(_0x9d95('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x9d95('0x8'));var pdf=require(_0x9d95('0x9'));var logger=require(_0x9d95('0xa'))(_0x9d95('0xb'));var config=require('../../config/environment');var db=require(_0x9d95('0xc'))['db'];config[_0x9d95('0xd')]=_[_0x9d95('0xe')](config['redis'],{'host':_0x9d95('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d95('0xd')]));require(_0x9d95('0x10'))[_0x9d95('0x11')](socket);function respondWithStatusCode(_0x18e15f,_0x2d2e0a){_0x2d2e0a=_0x2d2e0a||0xcc;return function(_0x554f40){if(_0x554f40){return _0x18e15f[_0x9d95('0x12')](_0x2d2e0a);}return _0x18e15f[_0x9d95('0x13')](_0x2d2e0a)['end']();};}function respondWithResult(_0x3aa60a,_0x182a73){_0x182a73=_0x182a73||0xc8;return function(_0x510b67){if(_0x510b67){return _0x3aa60a[_0x9d95('0x13')](_0x182a73)[_0x9d95('0x14')](_0x510b67);}};}function respondWithFilteredResult(_0x40f5cf,_0x1ab7df){return function(_0x568622){if(_0x568622){var _0x1ff6a9=typeof _0x1ab7df[_0x9d95('0x15')]==='undefined'&&typeof _0x1ab7df[_0x9d95('0x16')]===_0x9d95('0x17');var _0xcd7ba8=_0x568622['count'];var _0x2d5ab2=_0x1ff6a9?0x0:_0x1ab7df['offset'];var _0x4cabfd=_0x1ff6a9?_0x568622[_0x9d95('0x18')]:_0x1ab7df[_0x9d95('0x15')]+_0x1ab7df['limit'];var _0x4f4310;if(_0x4cabfd>=_0xcd7ba8){_0x4cabfd=_0xcd7ba8;_0x4f4310=0xc8;}else{_0x4f4310=0xce;}_0x40f5cf['status'](_0x4f4310);return _0x40f5cf[_0x9d95('0x19')](_0x9d95('0x1a'),_0x2d5ab2+'-'+_0x4cabfd+'/'+_0xcd7ba8)[_0x9d95('0x14')](_0x568622);}return null;};}function saveUpdates(_0x453074){return function(_0x481fd6){if(_0x481fd6){return _0x481fd6['update'](_0x453074)[_0x9d95('0x1b')](function(_0x4ec46d){return _0x4ec46d;});}return null;};}function removeEntity(_0x40d5ff){return function(_0x33a809){if(_0x33a809){return _0x33a809[_0x9d95('0x1c')]()[_0x9d95('0x1b')](function(){_0x40d5ff[_0x9d95('0x13')](0xcc)[_0x9d95('0x1d')]();});}};}function handleEntityNotFound(_0x455415){return function(_0x3ac1a3){if(!_0x3ac1a3){_0x455415['sendStatus'](0x194);}return _0x3ac1a3;};}function handleError(_0x31e950,_0x5c8095){_0x5c8095=_0x5c8095||0x1f4;return function(_0x5d0a9a){logger[_0x9d95('0x1e')](_0x5d0a9a[_0x9d95('0x1f')]);if(_0x5d0a9a['name']){delete _0x5d0a9a[_0x9d95('0x20')];}_0x31e950[_0x9d95('0x13')](_0x5c8095)['send'](_0x5d0a9a);};}exports['index']=function(_0x2b1d01,_0x2f4684){var _0x41abf6={};var _0x43c94e=_['map'](db[_0x9d95('0x21')][_0x9d95('0x22')],function(_0x11a7b2){return{'name':_0x11a7b2[_0x9d95('0x23')],'type':_0x11a7b2[_0x9d95('0x24')][_0x9d95('0x25')]};});_0x41abf6=qs[_0x9d95('0x26')](_0x43c94e,_0x2b1d01);return interaction[_0x9d95('0x27')](_0x9d95('0x28'),_0x2b1d01[_0x9d95('0x29')],_0x2b1d01['user'],_0x41abf6,_0x43c94e)[_0x9d95('0x1b')](respondWithFilteredResult(_0x2f4684,_0x41abf6))[_0x9d95('0x2a')](handleError(_0x2f4684,null));};exports[_0x9d95('0x2b')]=function(_0x880530,_0x3510f9){var _0x1dc801={'raw':![],'where':{'id':_0x880530[_0x9d95('0x2c')]['id']}},_0x42e3b3={};_0x42e3b3[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](db['WhatsappInteraction'][_0x9d95('0x22')]);_0x42e3b3[_0x9d95('0x29')]=_[_0x9d95('0x2e')](_0x880530[_0x9d95('0x29')]);_0x42e3b3[_0x9d95('0x2f')]=_['intersection'](_0x42e3b3[_0x9d95('0x2d')],_0x42e3b3[_0x9d95('0x29')]);_0x1dc801[_0x9d95('0x30')]=_[_0x9d95('0x31')](_0x42e3b3['model'],qs[_0x9d95('0x32')](_0x880530['query'][_0x9d95('0x32')]));_0x1dc801[_0x9d95('0x30')]=_0x1dc801[_0x9d95('0x30')]['length']?_0x1dc801[_0x9d95('0x30')]:_0x42e3b3['model'];if(_0x880530['query'][_0x9d95('0x33')]){_0x1dc801['include']=[{'all':!![]}];}_0x1dc801=_['merge']({},_0x1dc801,_0x880530[_0x9d95('0x34')]);return db['WhatsappInteraction']['find'](_0x1dc801)[_0x9d95('0x1b')](handleEntityNotFound(_0x3510f9,null))[_0x9d95('0x1b')](respondWithResult(_0x3510f9,null))[_0x9d95('0x2a')](handleError(_0x3510f9,null));};exports[_0x9d95('0x35')]=function(_0x5f461b,_0x38583f){return db[_0x9d95('0x21')][_0x9d95('0x35')](_0x5f461b[_0x9d95('0x36')],{})[_0x9d95('0x1b')](respondWithResult(_0x38583f,0xc9))[_0x9d95('0x2a')](handleError(_0x38583f,null));};exports[_0x9d95('0x37')]=function(_0x16406d,_0x955e6f){if(_0x16406d['body']['id']){delete _0x16406d['body']['id'];}return db[_0x9d95('0x21')][_0x9d95('0x38')]({'where':{'id':_0x16406d[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x955e6f,null))[_0x9d95('0x1b')](saveUpdates(_0x16406d[_0x9d95('0x36')],null))[_0x9d95('0x1b')](respondWithResult(_0x955e6f,null))[_0x9d95('0x2a')](handleError(_0x955e6f,null));};exports['destroy']=function(_0x432005,_0x3fa74c){return db[_0x9d95('0x21')]['find']({'where':{'id':_0x432005[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3fa74c,null))[_0x9d95('0x1b')](removeEntity(_0x3fa74c,null))[_0x9d95('0x2a')](handleError(_0x3fa74c,null));};exports['describe']=function(_0x563eb5,_0xc30875){return db['WhatsappInteraction'][_0x9d95('0x39')]()[_0x9d95('0x1b')](respondWithResult(_0xc30875,null))[_0x9d95('0x2a')](handleError(_0xc30875,null));};exports[_0x9d95('0x3a')]=function(_0x47ed55,_0x39dd27){return db['WhatsappMessage'][_0x9d95('0x38')]({'where':{'id':_0x47ed55[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x39dd27,null))[_0x9d95('0x1b')](function(_0x582aa5){if(_0x582aa5){return _0x582aa5[_0x9d95('0x3a')](_0x47ed55[_0x9d95('0x36')][_0x9d95('0x3b')],_['omit'](_0x47ed55[_0x9d95('0x36')],[_0x9d95('0x3b'),'id'])||{});}})[_0x9d95('0x1b')](respondWithResult(_0x39dd27,null))[_0x9d95('0x2a')](handleError(_0x39dd27,null));};exports[_0x9d95('0x3c')]=function(_0x1c7a29,_0x168b61){var _0x1cd781={'raw':![],'where':{}};var _0x25f227={};var _0x477306={'count':0x0,'rows':[]};return db[_0x9d95('0x21')][_0x9d95('0x3d')]({'where':{'id':_0x1c7a29[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x168b61,null))[_0x9d95('0x1b')](function(_0x1b55e4){if(_0x1b55e4){_0x25f227[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](db[_0x9d95('0x3e')]['rawAttributes']);_0x25f227['query']=_[_0x9d95('0x2e')](_0x1c7a29[_0x9d95('0x29')]);_0x25f227[_0x9d95('0x2f')]=_[_0x9d95('0x31')](_0x25f227[_0x9d95('0x2d')],_0x25f227[_0x9d95('0x29')]);_0x1cd781[_0x9d95('0x30')]=_[_0x9d95('0x31')](_0x25f227['model'],qs['fields'](_0x1c7a29[_0x9d95('0x29')]['fields']));_0x1cd781[_0x9d95('0x30')]=_0x1cd781[_0x9d95('0x30')][_0x9d95('0x3f')]?_0x1cd781[_0x9d95('0x30')]:_0x25f227[_0x9d95('0x2d')];if(!_0x1c7a29['query'][_0x9d95('0x40')](_0x9d95('0x41'))){_0x1cd781[_0x9d95('0x16')]=qs['limit'](_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x16')]);_0x1cd781[_0x9d95('0x15')]=qs[_0x9d95('0x15')](_0x1c7a29[_0x9d95('0x29')]['offset']);}_0x1cd781[_0x9d95('0x42')]=qs['sort'](_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x43')]);_0x1cd781[_0x9d95('0x44')]=qs[_0x9d95('0x2f')](_[_0x9d95('0x45')](_0x1c7a29['query'],_0x25f227[_0x9d95('0x2f')]));_0x1cd781['where'][_0x9d95('0x46')]=_0x1b55e4['id'];if(_0x1c7a29['query'][_0x9d95('0x47')]){_0x1cd781[_0x9d95('0x44')]=_[_0x9d95('0x48')](_0x1cd781[_0x9d95('0x44')],{'$or':_[_0x9d95('0x49')](_0x1cd781[_0x9d95('0x30')],function(_0x346675){var _0x1ba6e5={};_0x1ba6e5[_0x346675]={'$like':'%'+_0x1c7a29['query']['filter']+'%'};return _0x1ba6e5;})});}if(_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x4a')]){var _0x5aa8b1=_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x4a')][_0x9d95('0x4b')](',');var _0x25b32a={};_0x25b32a[_0x5aa8b1[0x0]]={'$gte':moment(_0x5aa8b1[0x1])[_0x9d95('0x4c')](_0x9d95('0x4d'))};_0x1cd781[_0x9d95('0x44')]=_[_0x9d95('0x48')](_0x1cd781[_0x9d95('0x44')],_0x25b32a);}_0x1cd781=_['merge']({},_0x1cd781,_0x1c7a29[_0x9d95('0x34')]);return db[_0x9d95('0x3e')]['count']({'where':_0x1cd781[_0x9d95('0x44')]})[_0x9d95('0x1b')](function(_0x23559c){_0x477306[_0x9d95('0x18')]=_0x23559c;if(_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x33')]){_0x1cd781[_0x9d95('0x4e')]=[{'all':!![]}];}return db[_0x9d95('0x3e')][_0x9d95('0x27')](_0x1cd781);})[_0x9d95('0x1b')](function(_0x2e5adf){_0x477306[_0x9d95('0x4f')]=_0x2e5adf;return _0x477306;});}})[_0x9d95('0x1b')](respondWithFilteredResult(_0x168b61,_0x1cd781))['catch'](handleError(_0x168b61,null));};exports[_0x9d95('0x50')]=function(_0x540458,_0x44f0cd){return db['WhatsappInteraction'][_0x9d95('0x38')]({'where':{'id':_0x540458[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x44f0cd,null))[_0x9d95('0x1b')](function(_0x964dc2){if(_0x964dc2){return _0x964dc2['setTags'](_0x540458['body'][_0x9d95('0x3b')],_['omit'](_0x540458[_0x9d95('0x36')],[_0x9d95('0x3b'),'id'])||{})[_0x9d95('0x51')](function(){return db['Tag'][_0x9d95('0x27')]({'attributes':['id','name','color'],'where':{'id':_0x540458[_0x9d95('0x36')][_0x9d95('0x3b')]}});})[_0x9d95('0x1b')](function(_0x314ddb){socket[_0x9d95('0x52')](_0x9d95('0x53'),{'id':Number(_0x540458[_0x9d95('0x2c')]['id']),'tags':_0x314ddb||[]});return{'id':Number(_0x540458[_0x9d95('0x2c')]['id']),'tags':_0x314ddb||[]};});}})[_0x9d95('0x1b')](respondWithResult(_0x44f0cd,null))[_0x9d95('0x2a')](handleError(_0x44f0cd,null));};exports['removeTags']=function(_0x113690,_0x11a4c8){return db['WhatsappInteraction'][_0x9d95('0x38')]({'where':{'id':_0x113690[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x11a4c8,null))[_0x9d95('0x1b')](function(_0x50dd25){if(_0x50dd25){return _0x50dd25[_0x9d95('0x54')](_0x113690[_0x9d95('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x11a4c8,null))['catch'](handleError(_0x11a4c8,null));};exports[_0x9d95('0x55')]=function(_0x4f7263,_0x46fcc5){var _0x713b8d=moment()[_0x9d95('0x56')]()[_0x9d95('0x57')]();var _0x32de01=path[_0x9d95('0x58')](config[_0x9d95('0x59')],'server',_0x9d95('0x5a'),_0x9d95('0x5b'));var _0xde05c6=path['join'](config[_0x9d95('0x59')],_0x9d95('0x5c'),_0x9d95('0x5a'),_0x9d95('0x5d'));var _0x356057=path['join'](_0x32de01,_0x713b8d);var _0x257e73=util[_0x9d95('0x4c')](_0x9d95('0x5e'),_0x4f7263[_0x9d95('0x2c')]['id'],_0x713b8d);var _0x11cdd3=path[_0x9d95('0x58')](_0x32de01,_0x257e73);var _0x50b5a6=[];_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x60')],'as':_0x9d95('0x60'),'attributes':['id',_0x9d95('0x61')],'raw':!![]});_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x62')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4f7263[_0x9d95('0x29')][_0x9d95('0x5d')]){_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x63')],'as':_0x9d95('0x63'),'raw':!![]});}var _0x489eb4=[{'model':db[_0x9d95('0x3e')],'as':'Messages','attributes':['id',_0x9d95('0x36'),_0x9d95('0x64'),_0x9d95('0x65'),_0x9d95('0x66'),_0x9d95('0x67')],'include':_0x50b5a6}];_0x489eb4['push']({'model':db[_0x9d95('0x68')],'as':_0x9d95('0x69'),'attributes':['id',_0x9d95('0x20')]});_0x489eb4[_0x9d95('0x5f')]({'model':db[_0x9d95('0x60')],'as':_0x9d95('0x6a'),'attributes':['id','fullname']});return db[_0x9d95('0x21')]['find']({'where':{'id':_0x4f7263[_0x9d95('0x2c')]['id']},'include':_0x489eb4})[_0x9d95('0x1b')](handleEntityNotFound(_0x46fcc5,null))[_0x9d95('0x1b')](function(_0x2e7ad6){if(_0x2e7ad6){var _0x21f35e=_0x2e7ad6[_0x9d95('0x6b')]({'plain':!![]});fs[_0x9d95('0x6c')](_0x356057);var _0x4b733e={'channel':_0x9d95('0x6d'),'account':_0x21f35e[_0x9d95('0x69')][_0x9d95('0x20')],'agent':_0x21f35e['Owner']?_0x21f35e[_0x9d95('0x6a')]['fullname']:_0x9d95('0x6e'),'createdAt':moment(_0x21f35e[_0x9d95('0x64')])['format'](_0x9d95('0x4d'))[_0x9d95('0x57')](),'closedAt':_0x21f35e[_0x9d95('0x6f')]?moment(_0x21f35e[_0x9d95('0x70')])[_0x9d95('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9d95('0x57')]():'','disposition':_0x21f35e[_0x9d95('0x71')],'messages':_(_0x21f35e[_0x9d95('0x72')])[_0x9d95('0x47')]({'secret':![]})[_0x9d95('0x49')](function(_0x5403a6){if(_0x5403a6['Attachment']){var _0x49d20d=path[_0x9d95('0x58')](_0xde05c6,_0x5403a6['Attachment'][_0x9d95('0x73')]);if(fs[_0x9d95('0x74')](_0x49d20d)){fs[_0x9d95('0x75')](_0x49d20d)[_0x9d95('0x76')](fs[_0x9d95('0x77')](path[_0x9d95('0x58')](_0x356057,_0x5403a6[_0x9d95('0x63')][_0x9d95('0x73')])));}}return{'date':moment(_0x5403a6[_0x9d95('0x64')])[_0x9d95('0x4c')](_0x9d95('0x4d'))[_0x9d95('0x57')](),'sender':_0x5403a6['direction']===_0x9d95('0x78')?_0x5403a6[_0x9d95('0x60')]?_0x5403a6[_0x9d95('0x60')]['fullname']:_0x9d95('0x79'):_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7b')]+(_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7c')]?'\x20'+_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7c')]:''),'body':_0x5403a6[_0x9d95('0x63')]?_0x5403a6[_0x9d95('0x63')][_0x9d95('0x73')]:_0x5403a6['body'],'direction':_0x5403a6['direction']==='out'?'A':'C','secret':_0x5403a6['secret'],'read':_0x5403a6['read'],'attachment':_0x5403a6[_0x9d95('0x63')]};})['value']()};return ejs['renderFile'](path[_0x9d95('0x58')](config[_0x9d95('0x59')],'server','views',_0x9d95('0x7d')),{'interaction':_0x4b733e})['then'](function(_0x4d6f9d){var _0xc678a5=path[_0x9d95('0x58')](_0x356057,_0x9d95('0x7e')+_0x21f35e['id']+'-'+_0x713b8d+_0x9d95('0x7f'));var _0x27455a={'path':_0xc678a5,'channel':_0x9d95('0x6d'),'interactionId':_0x21f35e['id']};return pdf[_0x9d95('0x80')](_0x4d6f9d,_0x27455a);})[_0x9d95('0x1b')](function(){return new BPromise(function(_0x5ad68a,_0x40dc71){zipdir(_0x356057,{'saveTo':_0x11cdd3},function(_0x158613,_0x5156f9){if(_0x158613)return _0x40dc71(_0x158613);return _0x5ad68a(_0x5156f9);});})[_0x9d95('0x1b')](function(){return new BPromise(function(_0x55a5a7,_0x21473e){rimraf(_0x356057,function(_0x8da73e){if(_0x8da73e)_0x21473e(_0x8da73e);return _0x55a5a7();});});})[_0x9d95('0x1b')](function(){return _0x46fcc5[_0x9d95('0x55')](_0x11cdd3,_0x257e73,function(_0x4b72d7){if(_0x4b72d7){console[_0x9d95('0x81')](_0x9d95('0x82'),_0x4b72d7);}else{fs['unlinkSync'](_0x11cdd3);}});});});}else{return _0x46fcc5[_0x9d95('0x12')](0xc8);}})[_0x9d95('0x2a')](handleError(_0x46fcc5,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index dd88475..6a4a2b3 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0434=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x402af3,_0x4261c2){var _0x3de580=function(_0x1c5d92){while(--_0x1c5d92){_0x402af3['push'](_0x402af3['shift']());}};_0x3de580(++_0x4261c2);}(_0x0434,0x1ad));var _0x4043=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x0434[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x4043('0x0'));var WhatsappInteraction=require(_0x4043('0x1'))['db'][_0x4043('0x2')];var WhatsappMessage=require(_0x4043('0x1'))['db'][_0x4043('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4043('0x4'),'afterDestroy':_0x4043('0x5')};function emitEvent(_0x3e475f){return function(_0x2e1aec,_0x424a16,_0x1dba57){_0x2e1aec['getUsers']({'attributes':['id'],'raw':!![]})[_0x4043('0x6')](function(_0x1ed6c4){_0x2e1aec['setDataValue']('Users',_0x1ed6c4[_0x4043('0x7')](function(_0x2b959b){return{'id':_0x2b959b['id']};}));return WhatsappMessage[_0x4043('0x8')]({'where':{'WhatsappInteractionId':_0x2e1aec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4043('0x6')](function(_0x30f083){_0x2e1aec[_0x4043('0x9')](_0x4043('0xa'),_0x30f083[_0x4043('0xb')]);WhatsappInteractionEvents['emit'](_0x3e475f+':'+_0x2e1aec['id'],_0x2e1aec);WhatsappInteractionEvents[_0x4043('0xc')](_0x3e475f,_0x2e1aec);_0x1dba57(null);})[_0x4043('0xd')](_0x1dba57(null));};}for(var e in events){if(events[_0x4043('0xe')](e)){var event=events[e];WhatsappInteraction[_0x4043('0xf')](e,emitEvent(event));}}module[_0x4043('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x90ae=['WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x90ae,0x195));var _0xe90a=function(_0x5d9d60,_0x163505){_0x5d9d60=_0x5d9d60-0x0;var _0x233cbd=_0x90ae[_0x5d9d60];return _0x233cbd;};'use strict';var EventEmitter=require(_0xe90a('0x0'));var WhatsappInteraction=require(_0xe90a('0x1'))['db'][_0xe90a('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xe90a('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe90a('0x4')](0x0);var events={'afterCreate':_0xe90a('0x5'),'afterUpdate':_0xe90a('0x6'),'afterDestroy':_0xe90a('0x7')};function emitEvent(_0x31d57b){return function(_0x32672a,_0x3062c0,_0x30cb7b){_0x32672a['getUsers']({'attributes':['id'],'raw':!![]})[_0xe90a('0x8')](function(_0x280721){_0x32672a[_0xe90a('0x9')](_0xe90a('0xa'),_0x280721[_0xe90a('0xb')](function(_0x2602fa){return{'id':_0x2602fa['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x32672a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe90a('0x8')](function(_0x241cef){_0x32672a[_0xe90a('0x9')](_0xe90a('0xc'),_0x241cef[_0xe90a('0xd')]);WhatsappInteractionEvents[_0xe90a('0xe')](_0x31d57b+':'+_0x32672a['id'],_0x32672a);WhatsappInteractionEvents[_0xe90a('0xe')](_0x31d57b,_0x32672a);_0x30cb7b(null);})['catch'](_0x30cb7b(null));};}for(var e in events){if(events[_0xe90a('0xf')](e)){var event=events[e];WhatsappInteraction[_0xe90a('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 317695e..f66b9a6 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeccf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x4df469,_0x5cb3b0){var _0x443f7a=function(_0x15002d){while(--_0x15002d){_0x4df469['push'](_0x4df469['shift']());}};_0x443f7a(++_0x5cb3b0);}(_0xeccf,0x10c));var _0xfecc=function(_0x45fbe3,_0x415346){_0x45fbe3=_0x45fbe3-0x0;var _0x33f029=_0xeccf[_0x45fbe3];return _0x33f029;};'use strict';var _=require(_0xfecc('0x0'));var util=require(_0xfecc('0x1'));var logger=require(_0xfecc('0x2'))(_0xfecc('0x3'));var moment=require(_0xfecc('0x4'));var BPromise=require(_0xfecc('0x5'));var rp=require(_0xfecc('0x6'));var fs=require('fs');var path=require(_0xfecc('0x7'));var rimraf=require(_0xfecc('0x8'));var config=require(_0xfecc('0x9'));var attributes=require('./whatsappInteraction.attributes');module[_0xfecc('0xa')]=function(_0x26ef5b,_0x28275d){return _0x26ef5b['define'](_0xfecc('0xb'),attributes,{'tableName':_0xfecc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe53bbf,_0x40d411,_0x354b10){if(_0xe53bbf['changed'](_0xfecc('0xd'))){_0xe53bbf[_0xfecc('0xe')]=moment()['format'](_0xfecc('0xf'));}_0x354b10(null,_0xe53bbf);}}});}; \ No newline at end of file +var _0x4120=['moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x5c1243,_0x4b0890){var _0x4103cf=function(_0x6d46b6){while(--_0x6d46b6){_0x5c1243['push'](_0x5c1243['shift']());}};_0x4103cf(++_0x4b0890);}(_0x4120,0xcd));var _0x0412=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4120[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x0412('0x0'));var logger=require(_0x0412('0x1'))(_0x0412('0x2'));var moment=require(_0x0412('0x3'));var BPromise=require(_0x0412('0x4'));var rp=require(_0x0412('0x5'));var fs=require('fs');var path=require(_0x0412('0x6'));var rimraf=require(_0x0412('0x7'));var config=require(_0x0412('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x1a07a7,_0x458511){return _0x1a07a7['define'](_0x0412('0x9'),attributes,{'tableName':_0x0412('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x675df1,_0x2ae0f0,_0x2755a5){if(_0x675df1[_0x0412('0xb')](_0x0412('0xc'))){_0x675df1[_0x0412('0xd')]=moment()[_0x0412('0xe')](_0x0412('0xf'));}_0x2755a5(null,_0x675df1);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 3e095c9..ac4610b 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x649f=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','limit','find','body','omit','ids','spread','AddTags'];(function(_0x2c38af,_0x4035b2){var _0x37ca12=function(_0xcd3831){while(--_0xcd3831){_0x2c38af['push'](_0x2c38af['shift']());}};_0x37ca12(++_0x4035b2);}(_0x649f,0x183));var _0xf649=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x649f[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require(_0xf649('0x3'));var fs=require('fs');var Redis=require(_0xf649('0x4'));var db=require(_0xf649('0x5'))['db'];var utils=require(_0xf649('0x6'));var logger=require(_0xf649('0x7'))(_0xf649('0x8'));var config=require(_0xf649('0x9'));var jayson=require(_0xf649('0xa'));var client=jayson[_0xf649('0xb')][_0xf649('0xc')]({'port':0x232a});config[_0xf649('0xd')]=_[_0xf649('0xe')](config[_0xf649('0xd')],{'host':_0xf649('0xf'),'port':0x18eb});var socket=require(_0xf649('0x10'))(new Redis(config[_0xf649('0xd')]));require(_0xf649('0x11'))['register'](socket);function respondWithRpcPromise(_0x445408,_0x22bf31,_0x4122d6){return new BPromise(function(_0x3d8aa1,_0x2cf991){return client[_0xf649('0x12')](_0x445408,_0x4122d6)[_0xf649('0x13')](function(_0x12deba){logger[_0xf649('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x22bf31,_0xf649('0x15'));logger[_0xf649('0x16')](_0xf649('0x17'),_0x22bf31,_0xf649('0x15'),JSON[_0xf649('0x18')](_0x12deba));if(_0x12deba[_0xf649('0x19')]){if(_0x12deba[_0xf649('0x19')][_0xf649('0x1a')]===0x1f4){logger[_0xf649('0x19')](_0xf649('0x1b'),_0x22bf31,_0x12deba['error'][_0xf649('0x1c')]);return _0x2cf991(_0x12deba['error'][_0xf649('0x1c')]);}logger[_0xf649('0x19')](_0xf649('0x1b'),_0x22bf31,_0x12deba['error'][_0xf649('0x1c')]);return _0x3d8aa1(_0x12deba[_0xf649('0x19')][_0xf649('0x1c')]);}else{logger[_0xf649('0x14')](_0xf649('0x1b'),_0x22bf31,_0xf649('0x15'));_0x3d8aa1(_0x12deba['result'][_0xf649('0x1c')]);}})[_0xf649('0x1d')](function(_0x787068){logger[_0xf649('0x19')](_0xf649('0x1b'),_0x22bf31,_0x787068);_0x2cf991(_0x787068);});});}exports[_0xf649('0x1e')]=function(_0x1dd346){var _0x3565c8=this;return new Promise(function(_0x393b25,_0x49e560){return db[_0xf649('0x1f')][_0xf649('0x20')](_0x1dd346['body'],{'raw':_0x1dd346[_0xf649('0x21')]?_0x1dd346['options'][_0xf649('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dd346[_0xf649('0x21')]?_0x1dd346['options'][_0xf649('0x23')]||null:null,'attributes':_0x1dd346[_0xf649('0x21')]?_0x1dd346[_0xf649('0x21')]['attributes']||null:null,'limit':_0x1dd346[_0xf649('0x21')]?_0x1dd346[_0xf649('0x21')][_0xf649('0x24')]||null:null})[_0xf649('0x13')](function(_0x5f7a29){logger[_0xf649('0x14')](_0xf649('0x1e'),_0x1dd346);logger[_0xf649('0x16')](_0xf649('0x1e'),_0x1dd346,JSON[_0xf649('0x18')](_0x5f7a29));_0x393b25(_0x5f7a29);})[_0xf649('0x1d')](function(_0x513d75){logger[_0xf649('0x19')](_0xf649('0x1e'),_0x513d75[_0xf649('0x1c')],_0x1dd346);_0x49e560(_0x3565c8[_0xf649('0x19')](0x1f4,_0x513d75[_0xf649('0x1c')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3f5812){return new Promise(function(_0x446946,_0x40b197){return db['WhatsappInteraction'][_0xf649('0x25')]({'where':_0x3f5812[_0xf649('0x21')]?_0x3f5812[_0xf649('0x21')]['where']||null:null})[_0xf649('0x13')](function(_0x555c41){if(_0x555c41){return _0x555c41['addTags'](_0x3f5812[_0xf649('0x26')]['ids'],_[_0xf649('0x27')](_0x3f5812['body'],[_0xf649('0x28'),'id'])||{});}})[_0xf649('0x29')](function(_0x2524eb){logger[_0xf649('0x14')]('AddTags',_0x3f5812);logger[_0xf649('0x16')](_0xf649('0x2a'),_0x3f5812,JSON[_0xf649('0x18')](_0x2524eb));_0x446946(_0x2524eb);})['catch'](function(_0x34c144){logger['error'](_0xf649('0x2a'),_0x34c144[_0xf649('0x1c')],_0x3f5812);_0x40b197(_this[_0xf649('0x19')](0x1f4,_0x34c144[_0xf649('0x1c')]));});});}; \ No newline at end of file +var _0x74d1=['find','ids','AddTags','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToWhatsappInteraction'];(function(_0x17c48c,_0x2b3283){var _0x57c45c=function(_0x5a0a65){while(--_0x5a0a65){_0x17c48c['push'](_0x17c48c['shift']());}};_0x57c45c(++_0x2b3283);}(_0x74d1,0x106));var _0x174d=function(_0x2df6a4,_0x2c3d85){_0x2df6a4=_0x2df6a4-0x0;var _0x3ed5d5=_0x74d1[_0x2df6a4];return _0x3ed5d5;};'use strict';var _=require('lodash');var util=require(_0x174d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x174d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x174d('0x2'))['db'];var utils=require(_0x174d('0x3'));var logger=require(_0x174d('0x4'))(_0x174d('0x5'));var config=require('../../config/environment');var jayson=require(_0x174d('0x6'));var client=jayson[_0x174d('0x7')]['http']({'port':0x232a});config[_0x174d('0x8')]=_['defaults'](config[_0x174d('0x8')],{'host':_0x174d('0x9'),'port':0x18eb});var socket=require(_0x174d('0xa'))(new Redis(config[_0x174d('0x8')]));require(_0x174d('0xb'))[_0x174d('0xc')](socket);function respondWithRpcPromise(_0x45a80d,_0x1a0b99,_0x21d073){return new BPromise(function(_0x50fdcd,_0x206ada){return client[_0x174d('0xd')](_0x45a80d,_0x21d073)[_0x174d('0xe')](function(_0xb1c4fc){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x1a0b99,'request\x20sent');logger[_0x174d('0xf')](_0x174d('0x10'),_0x1a0b99,_0x174d('0x11'),JSON['stringify'](_0xb1c4fc));if(_0xb1c4fc[_0x174d('0x12')]){if(_0xb1c4fc[_0x174d('0x12')]['code']===0x1f4){logger[_0x174d('0x12')](_0x174d('0x13'),_0x1a0b99,_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);return _0x206ada(_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);}logger['error'](_0x174d('0x13'),_0x1a0b99,_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);return _0x50fdcd(_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);}else{logger[_0x174d('0x15')](_0x174d('0x13'),_0x1a0b99,'request\x20sent');_0x50fdcd(_0xb1c4fc[_0x174d('0x16')][_0x174d('0x14')]);}})[_0x174d('0x17')](function(_0xbdec4a){logger['error'](_0x174d('0x13'),_0x1a0b99,_0xbdec4a);_0x206ada(_0xbdec4a);});});}exports[_0x174d('0x18')]=function(_0x16a2e9){var _0x35ccbf=this;return new Promise(function(_0x2b80a8,_0x2f5df7){return db[_0x174d('0x19')][_0x174d('0x1a')](_0x16a2e9[_0x174d('0x1b')],{'raw':_0x16a2e9[_0x174d('0x1c')]?_0x16a2e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a2e9['options']?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1d')]||null:null,'attributes':_0x16a2e9[_0x174d('0x1c')]?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1e')]||null:null,'limit':_0x16a2e9['options']?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1f')]||null:null})['then'](function(_0x3a9d2c){logger[_0x174d('0x15')](_0x174d('0x18'),_0x16a2e9);logger[_0x174d('0xf')](_0x174d('0x18'),_0x16a2e9,JSON[_0x174d('0x20')](_0x3a9d2c));_0x2b80a8(_0x3a9d2c);})[_0x174d('0x17')](function(_0x46b2fd){logger[_0x174d('0x12')](_0x174d('0x18'),_0x46b2fd[_0x174d('0x14')],_0x16a2e9);_0x2f5df7(_0x35ccbf[_0x174d('0x12')](0x1f4,_0x46b2fd[_0x174d('0x14')]));});});};exports[_0x174d('0x21')]=function(_0x2ea8ab){return new Promise(function(_0x3d3c89,_0x59b992){return db['WhatsappInteraction'][_0x174d('0x22')]({'where':_0x2ea8ab[_0x174d('0x1c')]?_0x2ea8ab['options'][_0x174d('0x1d')]||null:null})['then'](function(_0x238322){if(_0x238322){return _0x238322['addTags'](_0x2ea8ab[_0x174d('0x1b')][_0x174d('0x23')],_['omit'](_0x2ea8ab[_0x174d('0x1b')],['ids','id'])||{});}})['spread'](function(_0x123d60){logger['info'](_0x174d('0x24'),_0x2ea8ab);logger[_0x174d('0xf')](_0x174d('0x24'),_0x2ea8ab,JSON[_0x174d('0x20')](_0x123d60));_0x3d3c89(_0x123d60);})[_0x174d('0x17')](function(_0x57fecf){logger[_0x174d('0x12')](_0x174d('0x24'),_0x57fecf[_0x174d('0x14')],_0x2ea8ab);_0x59b992(_this['error'](0x1f4,_0x57fecf[_0x174d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7896d31..b61db7d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5eb=['save','remove','update','emit','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0xc5eb,0x68));var _0xbc5e=function(_0x28bcf4,_0x436697){_0x28bcf4=_0x28bcf4-0x0;var _0x315039=_0xc5eb[_0x28bcf4];return _0x315039;};'use strict';var WhatsappInteractionEvents=require(_0xbc5e('0x0'));var events=[_0xbc5e('0x1'),_0xbc5e('0x2'),_0xbc5e('0x3')];function createListener(_0x5de5c9,_0x3690b7){return function(_0x1b77bc){_0x3690b7[_0xbc5e('0x4')](_0x5de5c9,_0x1b77bc);};}function removeListener(_0x4bde2e,_0x1bc53c){return function(){WhatsappInteractionEvents['removeListener'](_0x4bde2e,_0x1bc53c);};}exports['register']=function(_0x4ecc78){for(var _0x5ec38c=0x0,_0x381ee4=events[_0xbc5e('0x5')];_0x5ec38c<_0x381ee4;_0x5ec38c++){var _0x6612e7=events[_0x5ec38c];var _0x1cad19=createListener(_0xbc5e('0x6')+_0x6612e7,_0x4ecc78);WhatsappInteractionEvents['on'](_0x6612e7,_0x1cad19);}}; \ No newline at end of file +var _0x5801=['./whatsappInteraction.events','save','update','emit','removeListener','length','whatsappInteraction:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5801,0xd2));var _0x1580=function(_0x5a1c24,_0x54d7c1){_0x5a1c24=_0x5a1c24-0x0;var _0x1fa24d=_0x5801[_0x5a1c24];return _0x1fa24d;};'use strict';var WhatsappInteractionEvents=require(_0x1580('0x0'));var events=[_0x1580('0x1'),'remove',_0x1580('0x2')];function createListener(_0x3b7124,_0x20cc1b){return function(_0x3b2131){_0x20cc1b[_0x1580('0x3')](_0x3b7124,_0x3b2131);};}function removeListener(_0x524949,_0x4b7ac0){return function(){WhatsappInteractionEvents[_0x1580('0x4')](_0x524949,_0x4b7ac0);};}exports['register']=function(_0x1548cf){for(var _0x20b393=0x0,_0x482c67=events[_0x1580('0x5')];_0x20b393<_0x482c67;_0x20b393++){var _0x50ebfd=events[_0x20b393];var _0x5446ed=createListener(_0x1580('0x6')+_0x50ebfd,_0x1548cf);WhatsappInteractionEvents['on'](_0x50ebfd,_0x5446ed);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index cc11627..f70fd6a 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x845a=['../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','show','post','tracked','whatsapp','create','/:id/status','put','/:id','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1cfe2b,_0x2a2a33){var _0xe2f8d3=function(_0x4fce13){while(--_0x4fce13){_0x1cfe2b['push'](_0x1cfe2b['shift']());}};_0xe2f8d3(++_0x2a2a33);}(_0x845a,0x80));var _0xa845=function(_0x384f36,_0x459e48){_0x384f36=_0x384f36-0x0;var _0xe523=_0x845a[_0x384f36];return _0xe523;};'use strict';var multer=require(_0xa845('0x0'));var util=require(_0xa845('0x1'));var path=require(_0xa845('0x2'));var timeout=require(_0xa845('0x3'));var express=require(_0xa845('0x4'));var router=express[_0xa845('0x5')]();var fs_extra=require(_0xa845('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa845('0x7'));var config=require(_0xa845('0x8'));var controller=require(_0xa845('0x9'));router[_0xa845('0xa')]('/',auth[_0xa845('0xb')](),controller['index']);router[_0xa845('0xa')](_0xa845('0xc'),auth[_0xa845('0xb')](),controller['describe']);router['get']('/:id',auth[_0xa845('0xb')](),controller[_0xa845('0xd')]);router[_0xa845('0xe')]('/',auth['isAuthenticated'](),interaction[_0xa845('0xf')](_0xa845('0x10'),'whatsappmessage:create'),controller[_0xa845('0x11')]);router[_0xa845('0xe')](_0xa845('0x12'),controller['status']);router[_0xa845('0x13')](_0xa845('0x14'),auth[_0xa845('0xb')](),controller[_0xa845('0x15')]);router[_0xa845('0x13')](_0xa845('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0xa845('0x13')](_0xa845('0x17'),auth[_0xa845('0xb')](),controller['reject']);router[_0xa845('0x18')](_0xa845('0x14'),auth['isAuthenticated'](),controller[_0xa845('0x19')]);module[_0xa845('0x1a')]=router; \ No newline at end of file +var _0xd544=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','post','tracked','whatsapp','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x40def8,_0x2770c4){var _0x5af0ff=function(_0x132f7c){while(--_0x132f7c){_0x40def8['push'](_0x40def8['shift']());}};_0x5af0ff(++_0x2770c4);}(_0xd544,0x81));var _0x4d54=function(_0x526ba1,_0x199484){_0x526ba1=_0x526ba1-0x0;var _0x1b56cb=_0xd544[_0x526ba1];return _0x1b56cb;};'use strict';var multer=require(_0x4d54('0x0'));var util=require(_0x4d54('0x1'));var path=require(_0x4d54('0x2'));var timeout=require(_0x4d54('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d54('0x4'));var auth=require(_0x4d54('0x5'));var interaction=require(_0x4d54('0x6'));var config=require(_0x4d54('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4d54('0x8')]);router[_0x4d54('0x9')](_0x4d54('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x4d54('0x9')](_0x4d54('0xb'),auth[_0x4d54('0xc')](),controller['show']);router[_0x4d54('0xd')]('/',auth[_0x4d54('0xc')](),interaction[_0x4d54('0xe')](_0x4d54('0xf'),'whatsappmessage:create'),controller[_0x4d54('0x10')]);router[_0x4d54('0xd')](_0x4d54('0x11'),controller[_0x4d54('0x12')]);router[_0x4d54('0x13')](_0x4d54('0xb'),auth['isAuthenticated'](),controller[_0x4d54('0x14')]);router[_0x4d54('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x4d54('0x15')]);router['put'](_0x4d54('0x16'),auth[_0x4d54('0xc')](),controller[_0x4d54('0x17')]);router[_0x4d54('0x18')](_0x4d54('0xb'),auth[_0x4d54('0xc')](),controller['destroy']);module[_0x4d54('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index cb5a806..896faf9 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21f2=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x4f453b,_0x2321d2){var _0x2178d2=function(_0x5b5fb8){while(--_0x5b5fb8){_0x4f453b['push'](_0x4f453b['shift']());}};_0x2178d2(++_0x2321d2);}(_0x21f2,0x158));var _0x221f=function(_0x3ca957,_0x470a67){_0x3ca957=_0x3ca957-0x0;var _0x2bdbdb=_0x21f2[_0x3ca957];return _0x2bdbdb;};'use strict';var Sequelize=require('sequelize');module[_0x221f('0x0')]={'body':{'type':Sequelize[_0x221f('0x1')](_0x221f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x221f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x221f('0x4')]('in',_0x221f('0x5')),'defaultValue':_0x221f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x221f('0x6')](0xbe)},'phone':{'type':Sequelize[_0x221f('0x6')]},'readAt':{'type':Sequelize[_0x221f('0x7')]},'secret':{'type':Sequelize[_0x221f('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x221f('0x1')]}}; \ No newline at end of file +var _0x1928=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1928,0x138));var _0x8192=function(_0x5c0024,_0x1e6fed){_0x5c0024=_0x5c0024-0x0;var _0x4b74a1=_0x1928[_0x5c0024];return _0x4b74a1;};'use strict';var Sequelize=require(_0x8192('0x0'));module[_0x8192('0x1')]={'body':{'type':Sequelize[_0x8192('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8192('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8192('0x4')]('in',_0x8192('0x5')),'defaultValue':_0x8192('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8192('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8192('0x6')]},'readAt':{'type':Sequelize[_0x8192('0x7')]},'secret':{'type':Sequelize[_0x8192('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8192('0x6')]},'providerResponse':{'type':Sequelize[_0x8192('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 8663dec..5ae8bec 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde8b=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','fullname','internal','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','whatsapp','RejectMessage','rejectMessage','Sequelize','User','email','SIP/%s','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','MessageSid','MessageStatus','read','twilio','inspect','rimraf','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','readAt','UserId','user','agent','get','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0xa5012f,_0x3f8538){var _0x91bf07=function(_0x30a691){while(--_0x30a691){_0xa5012f['push'](_0xa5012f['shift']());}};_0x91bf07(++_0x3f8538);}(_0xde8b,0x11d));var _0xbde8=function(_0x11b79a,_0x1b109c){_0x11b79a=_0x11b79a-0x0;var _0x3fb3fb=_0xde8b[_0x11b79a];return _0x3fb3fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbde8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbde8('0x1'));var rp=require(_0xbde8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbde8('0x3'));var sox=require(_0xbde8('0x4'));var csv=require(_0xbde8('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbde8('0x6'));var _=require(_0xbde8('0x7'));var squel=require(_0xbde8('0x8'));var crypto=require(_0xbde8('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbde8('0xa'));var Papa=require('papaparse');var Redis=require(_0xbde8('0xb'));var authService=require(_0xbde8('0xc'));var qs=require(_0xbde8('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbde8('0xe'))('api');var utils=require('../../config/utils');var config=require(_0xbde8('0xf'));var licenseUtil=require(_0xbde8('0x10'));var db=require(_0xbde8('0x11'))['db'];config['redis']=_['defaults'](config[_0xbde8('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xbde8('0x13'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xbde8('0x14')](socket);var jayson=require(_0xbde8('0x15'));var client=jayson[_0xbde8('0x16')][_0xbde8('0x17')]({'port':0x232c});var client9002=jayson[_0xbde8('0x16')][_0xbde8('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5aecc5,_0x5f0c7e,_0x44b141,_0x1c8114){return new BPromise(function(_0xa79f65,_0x3aa8a9){var _0x5d75a9=_0x1c8114||client;return _0x5d75a9['request'](_0x5aecc5,_0x44b141)[_0xbde8('0x18')](function(_0x42a36c){logger[_0xbde8('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x5f0c7e,_0xbde8('0x1a'));logger[_0xbde8('0x1b')](_0xbde8('0x1c'),_0x5f0c7e,_0xbde8('0x1a'),JSON[_0xbde8('0x1d')](_0x42a36c));if(_0x42a36c[_0xbde8('0x1e')]){if(_0x42a36c[_0xbde8('0x1e')][_0xbde8('0x1f')]===0x1f4){logger[_0xbde8('0x1e')](_0xbde8('0x20'),_0x5f0c7e,_0x42a36c[_0xbde8('0x1e')][_0xbde8('0x21')]);return _0x3aa8a9(_0x42a36c[_0xbde8('0x1e')][_0xbde8('0x21')]);}logger['error'](_0xbde8('0x20'),_0x5f0c7e,_0x42a36c[_0xbde8('0x1e')][_0xbde8('0x21')]);return _0xa79f65(_0x42a36c['error'][_0xbde8('0x21')]);}else{logger[_0xbde8('0x19')](_0xbde8('0x20'),_0x5f0c7e,'request\x20sent');_0xa79f65(_0x42a36c[_0xbde8('0x22')][_0xbde8('0x21')]);}})[_0xbde8('0x23')](function(_0x1a3b3b){logger['error'](_0xbde8('0x20'),_0x5f0c7e,_0x1a3b3b);_0x3aa8a9(_0x1a3b3b);});});}function respondWithStatusCode(_0x2bb361,_0x45a8c8){_0x45a8c8=_0x45a8c8||0xcc;return function(_0x5cef7f){if(_0x5cef7f){return _0x2bb361[_0xbde8('0x24')](_0x45a8c8);}return _0x2bb361['status'](_0x45a8c8)[_0xbde8('0x25')]();};}function respondWithResult(_0x360312,_0x2ef956){_0x2ef956=_0x2ef956||0xc8;return function(_0x3f6f13){if(_0x3f6f13){return _0x360312[_0xbde8('0x26')](_0x2ef956)['json'](_0x3f6f13);}};}function respondWithFilteredResult(_0x38b0b9,_0x28455f){return function(_0x3e5a4e){if(_0x3e5a4e){var _0x2646f2=typeof _0x28455f[_0xbde8('0x27')]==='undefined'&&typeof _0x28455f[_0xbde8('0x28')]==='undefined';var _0x35ac41=_0x3e5a4e[_0xbde8('0x29')];var _0x5a5a8a=_0x2646f2?0x0:_0x28455f[_0xbde8('0x27')];var _0x16bfd4=_0x2646f2?_0x3e5a4e[_0xbde8('0x29')]:_0x28455f['offset']+_0x28455f[_0xbde8('0x28')];var _0x2b0293;if(_0x16bfd4>=_0x35ac41){_0x16bfd4=_0x35ac41;_0x2b0293=0xc8;}else{_0x2b0293=0xce;}_0x38b0b9['status'](_0x2b0293);return _0x38b0b9[_0xbde8('0x2a')](_0xbde8('0x2b'),_0x5a5a8a+'-'+_0x16bfd4+'/'+_0x35ac41)[_0xbde8('0x2c')](_0x3e5a4e);}return null;};}function patchUpdates(_0x23665b){return function(_0x504c7a){try{jsonpatch[_0xbde8('0x2d')](_0x504c7a,_0x23665b,!![]);}catch(_0x5bce5d){return BPromise[_0xbde8('0x2e')](_0x5bce5d);}return _0x504c7a[_0xbde8('0x2f')]();};}function saveUpdates(_0x440c69,_0x9cf34d){return function(_0x8c4d4b){if(_0x8c4d4b){return _0x8c4d4b[_0xbde8('0x30')](_0x440c69)[_0xbde8('0x18')](function(_0x3d92a8){return _0x3d92a8;});}return null;};}function removeEntity(_0x4a7df0,_0x351792){return function(_0x43892d){if(_0x43892d){return _0x43892d[_0xbde8('0x31')]()[_0xbde8('0x18')](function(){_0x4a7df0[_0xbde8('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ef5eb,_0x441fd9){return function(_0x3ce75b){if(!_0x3ce75b){_0x2ef5eb[_0xbde8('0x24')](0x194);}return _0x3ce75b;};}function handleError(_0x4e4d62,_0x5d4778){_0x5d4778=_0x5d4778||0x1f4;return function(_0x47e540){logger[_0xbde8('0x1e')](_0x47e540[_0xbde8('0x32')]);if(_0x47e540[_0xbde8('0x33')]){delete _0x47e540[_0xbde8('0x33')];}_0x4e4d62['status'](_0x5d4778)[_0xbde8('0x34')](_0x47e540);};}exports[_0xbde8('0x35')]=function(_0x2f06af,_0x27d63e){var _0x5e7a0a={},_0x5c49e3={},_0x4ff28f={'count':0x0,'rows':[]};var _0x408ed7=_[_0xbde8('0x36')](db[_0xbde8('0x37')][_0xbde8('0x38')],function(_0xc52b70){return{'name':_0xc52b70[_0xbde8('0x39')],'type':_0xc52b70[_0xbde8('0x3a')][_0xbde8('0x3b')]};});_0x5c49e3[_0xbde8('0x3c')]=_[_0xbde8('0x36')](_0x408ed7,_0xbde8('0x33'));_0x5c49e3['query']=_[_0xbde8('0x3d')](_0x2f06af[_0xbde8('0x3e')]);_0x5c49e3[_0xbde8('0x3f')]=_[_0xbde8('0x40')](_0x5c49e3[_0xbde8('0x3c')],_0x5c49e3['query']);_0x5e7a0a[_0xbde8('0x41')]=_['intersection'](_0x5c49e3[_0xbde8('0x3c')],qs[_0xbde8('0x42')](_0x2f06af['query'][_0xbde8('0x42')]));_0x5e7a0a[_0xbde8('0x41')]=_0x5e7a0a[_0xbde8('0x41')][_0xbde8('0x43')]?_0x5e7a0a['attributes']:_0x5c49e3[_0xbde8('0x3c')];if(!_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x44')](_0xbde8('0x45'))){_0x5e7a0a[_0xbde8('0x28')]=qs['limit'](_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x28')]);_0x5e7a0a['offset']=qs[_0xbde8('0x27')](_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x27')]);}_0x5e7a0a[_0xbde8('0x46')]=qs[_0xbde8('0x47')](_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x47')]);_0x5e7a0a[_0xbde8('0x48')]=qs[_0xbde8('0x3f')](_[_0xbde8('0x49')](_0x2f06af[_0xbde8('0x3e')],_0x5c49e3[_0xbde8('0x3f')]),_0x408ed7);if(_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x4a')]){_0x5e7a0a[_0xbde8('0x48')]=_['merge'](_0x5e7a0a['where'],{'$or':_[_0xbde8('0x36')](_0x408ed7,function(_0x5d3b61){if(_0x5d3b61['type']!==_0xbde8('0x4b')){var _0x52f323={};_0x52f323[_0x5d3b61[_0xbde8('0x33')]]={'$like':'%'+_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x4a')]+'%'};return _0x52f323;}})});}_0x5e7a0a=_[_0xbde8('0x4c')]({},_0x5e7a0a,_0x2f06af[_0xbde8('0x4d')]);var _0x4cc797={'where':_0x5e7a0a[_0xbde8('0x48')]};return db[_0xbde8('0x37')][_0xbde8('0x29')](_0x4cc797)[_0xbde8('0x18')](function(_0x44bc60){_0x4ff28f[_0xbde8('0x29')]=_0x44bc60;if(_0x2f06af[_0xbde8('0x3e')][_0xbde8('0x4e')]){_0x5e7a0a[_0xbde8('0x4f')]=[{'all':!![]}];}return db[_0xbde8('0x37')][_0xbde8('0x50')](_0x5e7a0a);})[_0xbde8('0x18')](function(_0x503de6){_0x4ff28f[_0xbde8('0x51')]=_0x503de6;return _0x4ff28f;})[_0xbde8('0x18')](respondWithFilteredResult(_0x27d63e,_0x5e7a0a))[_0xbde8('0x23')](handleError(_0x27d63e,null));};exports[_0xbde8('0x52')]=function(_0x1e8d2f,_0x10e7b5){var _0x504286={'raw':!![],'where':{'id':_0x1e8d2f[_0xbde8('0x53')]['id']}},_0x259ec9={};_0x259ec9[_0xbde8('0x3c')]=_['keys'](db[_0xbde8('0x37')]['rawAttributes']);_0x259ec9['query']=_[_0xbde8('0x3d')](_0x1e8d2f['query']);_0x259ec9[_0xbde8('0x3f')]=_[_0xbde8('0x40')](_0x259ec9[_0xbde8('0x3c')],_0x259ec9[_0xbde8('0x3e')]);_0x504286['attributes']=_[_0xbde8('0x40')](_0x259ec9['model'],qs[_0xbde8('0x42')](_0x1e8d2f[_0xbde8('0x3e')][_0xbde8('0x42')]));_0x504286['attributes']=_0x504286[_0xbde8('0x41')][_0xbde8('0x43')]?_0x504286[_0xbde8('0x41')]:_0x259ec9[_0xbde8('0x3c')];if(_0x1e8d2f[_0xbde8('0x3e')][_0xbde8('0x4e')]){_0x504286[_0xbde8('0x4f')]=[{'all':!![]}];}_0x504286=_['merge']({},_0x504286,_0x1e8d2f[_0xbde8('0x4d')]);return db[_0xbde8('0x37')][_0xbde8('0x54')](_0x504286)[_0xbde8('0x18')](handleEntityNotFound(_0x10e7b5,null))[_0xbde8('0x18')](respondWithResult(_0x10e7b5,null))[_0xbde8('0x23')](handleError(_0x10e7b5,null));};exports[_0xbde8('0x55')]=function(_0x4b4983,_0x4534cb){return db[_0xbde8('0x37')][_0xbde8('0x55')](_0x4b4983[_0xbde8('0x56')],{})[_0xbde8('0x18')](respondWithResult(_0x4534cb,0xc9))[_0xbde8('0x23')](handleError(_0x4534cb,null));};exports[_0xbde8('0x30')]=function(_0x11cb85,_0x3bc25f){if(_0x11cb85[_0xbde8('0x56')]['id']){delete _0x11cb85[_0xbde8('0x56')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x11cb85['params']['id']}})[_0xbde8('0x18')](handleEntityNotFound(_0x3bc25f,null))[_0xbde8('0x18')](saveUpdates(_0x11cb85['body'],null))[_0xbde8('0x18')](respondWithResult(_0x3bc25f,null))[_0xbde8('0x23')](handleError(_0x3bc25f,null));};exports['destroy']=function(_0x15bea2,_0x3ab51a){return db[_0xbde8('0x37')][_0xbde8('0x54')]({'where':{'id':_0x15bea2[_0xbde8('0x53')]['id']}})[_0xbde8('0x18')](handleEntityNotFound(_0x3ab51a,null))[_0xbde8('0x18')](removeEntity(_0x3ab51a,null))['catch'](handleError(_0x3ab51a,null));};exports[_0xbde8('0x57')]=function(_0x223170,_0x6ba338){return db['WhatsappMessage'][_0xbde8('0x57')]()[_0xbde8('0x18')](respondWithResult(_0x6ba338,null))[_0xbde8('0x23')](handleError(_0x6ba338,null));};var interaction_log=require(_0xbde8('0xe'))('whatsapp-interactions');exports[_0xbde8('0x58')]=function(_0x21a735,_0x401346,_0x5b8f1e){var _0x59b2cc={'agent':{},'channel':'whatsapp'};if(_0x21a735[_0xbde8('0x56')]['id']){delete _0x21a735[_0xbde8('0x56')]['id'];}_0x21a735['body']['read']=!![];_0x21a735[_0xbde8('0x56')][_0xbde8('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x21a735['body'][_0xbde8('0x5a')]=_0x21a735['body']['UserId']||_0x21a735[_0xbde8('0x5b')]['id'];_0x59b2cc[_0xbde8('0x5c')]['id']=_0x21a735['body']['UserId'];return db[_0xbde8('0x37')][_0xbde8('0x54')]({'where':{'id':_0x21a735[_0xbde8('0x53')]['id'],'UserId':null}})[_0xbde8('0x18')](handleEntityNotFound(_0x401346,null))[_0xbde8('0x18')](saveUpdates(_0x21a735['body'],null))[_0xbde8('0x18')](function(_0x18b0ed){if(_0x18b0ed){_0x59b2cc[_0xbde8('0x21')]=_0x18b0ed[_0xbde8('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0xbde8('0x54')]({'where':{'id':_0x18b0ed['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x401346,null))[_0xbde8('0x18')](function(_0x3b15f3){if(_0x3b15f3){return _0x3b15f3[_0xbde8('0x30')]({'UserId':_0x21a735[_0xbde8('0x56')][_0xbde8('0x5a')],'read1stAt':_['isNil'](_0x3b15f3['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbde8('0x18')](function(_0x47a012){if(_0x47a012){_0x59b2cc[_0xbde8('0x5e')]=_0x47a012[_0xbde8('0x5d')]({'plain':!![]});interaction_log['info'](_0xbde8('0x5f'),_0x21a735['user']['id'],_0x21a735[_0xbde8('0x5b')][_0xbde8('0x33')],_0x21a735[_0xbde8('0x5b')][_0xbde8('0x60')],_0x59b2cc[_0xbde8('0x5e')]['id'],_0x21a735[_0xbde8('0x56')]?JSON[_0xbde8('0x1d')](_0x21a735[_0xbde8('0x56')]):_0xbde8('0x61'));return respondWithRpcPromise(_0xbde8('0x62'),'acceptMessage',_0x59b2cc);}return null;})['then'](function(_0x69572){var _0x221c8d=_0xbde8('0x63')+_0x69572[_0xbde8('0x21')][_0xbde8('0x64')];return db['sequelize'][_0xbde8('0x3e')](_0x221c8d,{'type':db['Sequelize'][_0xbde8('0x65')]['SELECT'],'raw':!![]})['then'](function(_0x48c9cf){return _0x48c9cf;});})['then'](function(_0x99d97f){if(_0x99d97f){_0x59b2cc['message'][_0xbde8('0x66')]=_0x99d97f[0x0];if(!_0x21a735[_0xbde8('0x56')]['UserId'])return;return db['User'][_0xbde8('0x54')]({'where':{'id':_0x21a735['body'][_0xbde8('0x5a')],'role':_0xbde8('0x5c')},'attributes':['id',_0xbde8('0x33'),_0xbde8('0x67'),'email',_0xbde8('0x68')],'raw':!![]});}return null;})[_0xbde8('0x18')](function(_0xc45d4c){if(!_0xc45d4c)return null;_0x59b2cc[_0xbde8('0x21')]['agent']=_0xc45d4c;return _0x59b2cc;})['then'](function(_0x3a1994){if(_0x3a1994){if(_0x21a735[_0xbde8('0x56')][_0xbde8('0x69')]){_0x59b2cc[_0xbde8('0x21')][_0xbde8('0x6a')]=util[_0xbde8('0x6b')]('SIP/%s',_0x21a735['user'][_0xbde8('0x33')]);_0x59b2cc[_0xbde8('0x21')][_0xbde8('0x6c')]=_0x59b2cc[_0xbde8('0x6c')];_0x59b2cc[_0xbde8('0x21')][_0xbde8('0x6d')]=_0x59b2cc[_0xbde8('0x6c')];_0x59b2cc[_0xbde8('0x21')][_0xbde8('0x6e')]=_0xbde8('0x58');return respondWithRpcPromise(_0xbde8('0x6f'),_0xbde8('0x6f'),{'event':_0xbde8('0x70'),'message':_0x59b2cc[_0xbde8('0x21')]},client9002)[_0xbde8('0x18')](function(){return _0x59b2cc;});}return _0x59b2cc;}return null;})[_0xbde8('0x18')](respondWithResult(_0x401346,null))[_0xbde8('0x23')](handleError(_0x401346,null));};var interaction_log=require(_0xbde8('0xe'))(_0xbde8('0x71'));exports[_0xbde8('0x2e')]=function(_0x1b08e7,_0x663b94,_0x542350){var _0x1bb2a3={'agent':{},'channel':_0xbde8('0x72')};if(_0x1b08e7[_0xbde8('0x56')]['id']){delete _0x1b08e7[_0xbde8('0x56')]['id'];}_0x1b08e7[_0xbde8('0x56')]['UserId']=_0x1b08e7[_0xbde8('0x56')][_0xbde8('0x5a')]||_0x1b08e7['user']['id'];_0x1bb2a3[_0xbde8('0x5c')]['id']=_0x1b08e7[_0xbde8('0x56')][_0xbde8('0x5a')];return db[_0xbde8('0x37')][_0xbde8('0x54')]({'where':{'id':_0x1b08e7[_0xbde8('0x53')]['id'],'UserId':null}})[_0xbde8('0x18')](handleEntityNotFound(_0x663b94,null))[_0xbde8('0x18')](function(_0x8e69d9){if(_0x8e69d9){_0x1bb2a3[_0xbde8('0x21')]=_0x8e69d9[_0xbde8('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0xbde8('0x54')]({'where':{'id':_0x8e69d9['WhatsappInteractionId']}});}return null;})[_0xbde8('0x18')](handleEntityNotFound(_0x663b94,null))[_0xbde8('0x18')](function(_0x1ab8c6){if(_0x1ab8c6){_0x1bb2a3[_0xbde8('0x5e')]=_0x1ab8c6['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b08e7[_0xbde8('0x5b')]['id'],_0x1b08e7[_0xbde8('0x5b')][_0xbde8('0x33')],_0x1b08e7[_0xbde8('0x5b')]['role'],_0x1bb2a3[_0xbde8('0x5e')]['id'],_0x1b08e7[_0xbde8('0x56')]?JSON[_0xbde8('0x1d')](_0x1b08e7[_0xbde8('0x56')]):_0xbde8('0x61'));return respondWithRpcPromise(_0xbde8('0x73'),_0xbde8('0x74'),_0x1bb2a3);}return null;})[_0xbde8('0x18')](function(_0x5c0655){var _0x2dfb38='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c0655['message']['ContactId'];return db['sequelize'][_0xbde8('0x3e')](_0x2dfb38,{'type':db[_0xbde8('0x75')][_0xbde8('0x65')]['SELECT'],'raw':!![]})['then'](function(_0x27ad28){return _0x27ad28;});})['then'](function(_0x2c5b0b){if(_0x2c5b0b){_0x1bb2a3[_0xbde8('0x21')]['contact']=_0x2c5b0b[0x0];if(!_0x1b08e7[_0xbde8('0x56')][_0xbde8('0x5a')])return;return db[_0xbde8('0x76')][_0xbde8('0x54')]({'where':{'id':_0x1b08e7['body'][_0xbde8('0x5a')],'role':_0xbde8('0x5c')},'attributes':['id',_0xbde8('0x33'),'fullname',_0xbde8('0x77'),_0xbde8('0x68')],'raw':!![]});}return null;})['then'](function(_0x3792bd){if(!_0x3792bd)return null;_0x1bb2a3[_0xbde8('0x21')][_0xbde8('0x5c')]=_0x3792bd;return _0x1bb2a3;})[_0xbde8('0x18')](function(_0x346ccd){if(_0x346ccd){_0x346ccd[_0xbde8('0x21')][_0xbde8('0x6a')]=util['format'](_0xbde8('0x78'),_0x1b08e7[_0xbde8('0x5b')][_0xbde8('0x33')]);_0x346ccd[_0xbde8('0x21')][_0xbde8('0x6c')]=_0x1bb2a3['channel'];_0x346ccd[_0xbde8('0x21')][_0xbde8('0x6d')]=_0x1bb2a3[_0xbde8('0x6c')];_0x346ccd[_0xbde8('0x21')]['event']=_0xbde8('0x2e');respondWithRpcPromise(_0xbde8('0x6f'),_0xbde8('0x6f'),{'event':_0xbde8('0x79'),'message':_0x346ccd[_0xbde8('0x21')]},client9002);return _0x1bb2a3;}return null;})[_0xbde8('0x18')](respondWithResult(_0x663b94,null))[_0xbde8('0x23')](handleError(_0x663b94,null));};exports[_0xbde8('0x26')]=function(_0x57cf7c,_0x956686,_0x4a03b2){if(_0x57cf7c[_0xbde8('0x56')]['id']){delete _0x57cf7c[_0xbde8('0x56')]['id'];}var _0x5a5cb5;return db[_0xbde8('0x37')]['find']({'where':{'id':_0x57cf7c[_0xbde8('0x53')]['id']}})[_0xbde8('0x18')](handleEntityNotFound(_0x956686,null))[_0xbde8('0x18')](function(_0x54c6a0){if(_0x54c6a0){_0x5a5cb5=_0x54c6a0;return db['WhatsappAccount'][_0xbde8('0x54')]({'where':{'id':_0x54c6a0['WhatsappAccountId']}});}})[_0xbde8('0x18')](handleEntityNotFound(_0x956686,null))[_0xbde8('0x18')](function(_0x7c57d){if(_0x7c57d){logger[_0xbde8('0x1b')](_0xbde8('0x7a'),'status','received\x20delivery\x20report\x20from',_0x7c57d[_0xbde8('0x3a')],util['inspect'](_0x57cf7c[_0xbde8('0x56')],{'showHidden':![],'depth':null}));switch(_0x7c57d['type']){case'twilio':if(_0x57cf7c[_0xbde8('0x56')][_0xbde8('0x7b')]&&_0x57cf7c[_0xbde8('0x56')][_0xbde8('0x7b')]===_0x5a5cb5['messageId']&&_0x57cf7c['body'][_0xbde8('0x7c')]&&_0x57cf7c[_0xbde8('0x56')]['MessageStatus']===_0xbde8('0x7d')){return _0x5a5cb5['update']({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xbde8('0x26'),_0xbde8('0x7e'),util[_0xbde8('0x7f')](_0x57cf7c[_0xbde8('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5a5cb5;}})[_0xbde8('0x18')](respondWithResult(_0x956686,null))[_0xbde8('0x23')](handleError(_0x956686,null));}; \ No newline at end of file +var _0x823b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','params','destroy','describe','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','email','internal','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status'];(function(_0x3081a4,_0x566599){var _0x28070f=function(_0x40fd62){while(--_0x40fd62){_0x3081a4['push'](_0x3081a4['shift']());}};_0x28070f(++_0x566599);}(_0x823b,0x17d));var _0xb823=function(_0x58366d,_0x38ad8c){_0x58366d=_0x58366d-0x0;var _0x14bb8e=_0x823b[_0x58366d];return _0x14bb8e;};'use strict';var emlformat=require(_0xb823('0x0'));var rimraf=require(_0xb823('0x1'));var zipdir=require(_0xb823('0x2'));var jsonpatch=require(_0xb823('0x3'));var rp=require(_0xb823('0x4'));var moment=require(_0xb823('0x5'));var BPromise=require(_0xb823('0x6'));var Mustache=require(_0xb823('0x7'));var util=require(_0xb823('0x8'));var path=require(_0xb823('0x9'));var sox=require(_0xb823('0xa'));var csv=require('to-csv');var ejs=require(_0xb823('0xb'));var fs=require('fs');var fs_extra=require(_0xb823('0xc'));var _=require(_0xb823('0xd'));var squel=require('squel');var crypto=require(_0xb823('0xe'));var jsforce=require(_0xb823('0xf'));var deskjs=require(_0xb823('0x10'));var toCsv=require(_0xb823('0x11'));var querystring=require(_0xb823('0x12'));var Papa=require(_0xb823('0x13'));var Redis=require(_0xb823('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb823('0x15'));var as=require(_0xb823('0x16'));var hardwareService=require(_0xb823('0x17'));var logger=require(_0xb823('0x18'))(_0xb823('0x19'));var utils=require(_0xb823('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xb823('0x1b'));var db=require(_0xb823('0x1c'))['db'];config[_0xb823('0x1d')]=_[_0xb823('0x1e')](config['redis'],{'host':_0xb823('0x1f'),'port':0x18eb});var socket=require(_0xb823('0x20'))(new Redis(config[_0xb823('0x1d')]));require('./whatsappMessage.socket')[_0xb823('0x21')](socket);var jayson=require(_0xb823('0x22'));var client=jayson[_0xb823('0x23')][_0xb823('0x24')]({'port':0x232c});var client9002=jayson['client'][_0xb823('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x406349,_0x2a1c8a,_0x295847,_0x56153a){return new BPromise(function(_0x418e2d,_0x2f7a2a){var _0x557b8d=_0x56153a||client;return _0x557b8d[_0xb823('0x25')](_0x406349,_0x295847)['then'](function(_0x485b6c){logger['info'](_0xb823('0x26'),_0x2a1c8a,'request\x20sent');logger['debug'](_0xb823('0x27'),_0x2a1c8a,_0xb823('0x28'),JSON[_0xb823('0x29')](_0x485b6c));if(_0x485b6c[_0xb823('0x2a')]){if(_0x485b6c['error']['code']===0x1f4){logger[_0xb823('0x2a')](_0xb823('0x26'),_0x2a1c8a,_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);return _0x2f7a2a(_0x485b6c[_0xb823('0x2a')]['message']);}logger[_0xb823('0x2a')](_0xb823('0x26'),_0x2a1c8a,_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);return _0x418e2d(_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);}else{logger[_0xb823('0x2c')](_0xb823('0x26'),_0x2a1c8a,_0xb823('0x28'));_0x418e2d(_0x485b6c[_0xb823('0x2d')][_0xb823('0x2b')]);}})[_0xb823('0x2e')](function(_0x375c0f){logger['error'](_0xb823('0x26'),_0x2a1c8a,_0x375c0f);_0x2f7a2a(_0x375c0f);});});}function respondWithStatusCode(_0x103dec,_0x43fcdb){_0x43fcdb=_0x43fcdb||0xcc;return function(_0x257fe8){if(_0x257fe8){return _0x103dec['sendStatus'](_0x43fcdb);}return _0x103dec[_0xb823('0x2f')](_0x43fcdb)['end']();};}function respondWithResult(_0x39ed04,_0x39ac04){_0x39ac04=_0x39ac04||0xc8;return function(_0x30c089){if(_0x30c089){return _0x39ed04[_0xb823('0x2f')](_0x39ac04)[_0xb823('0x30')](_0x30c089);}};}function respondWithFilteredResult(_0x5d52cc,_0x1a7e46){return function(_0x391ce2){if(_0x391ce2){var _0x3bcde2=typeof _0x1a7e46[_0xb823('0x31')]===_0xb823('0x32')&&typeof _0x1a7e46[_0xb823('0x33')]==='undefined';var _0x3ee686=_0x391ce2[_0xb823('0x34')];var _0x17c9d1=_0x3bcde2?0x0:_0x1a7e46[_0xb823('0x31')];var _0x1b1297=_0x3bcde2?_0x391ce2[_0xb823('0x34')]:_0x1a7e46[_0xb823('0x31')]+_0x1a7e46[_0xb823('0x33')];var _0x586f2c;if(_0x1b1297>=_0x3ee686){_0x1b1297=_0x3ee686;_0x586f2c=0xc8;}else{_0x586f2c=0xce;}_0x5d52cc[_0xb823('0x2f')](_0x586f2c);return _0x5d52cc[_0xb823('0x35')](_0xb823('0x36'),_0x17c9d1+'-'+_0x1b1297+'/'+_0x3ee686)[_0xb823('0x30')](_0x391ce2);}return null;};}function patchUpdates(_0x28ddce){return function(_0x2c11f4){try{jsonpatch[_0xb823('0x37')](_0x2c11f4,_0x28ddce,!![]);}catch(_0x587a14){return BPromise[_0xb823('0x38')](_0x587a14);}return _0x2c11f4[_0xb823('0x39')]();};}function saveUpdates(_0x12dd80,_0x5c2e40){return function(_0x1dc79b){if(_0x1dc79b){return _0x1dc79b[_0xb823('0x3a')](_0x12dd80)[_0xb823('0x3b')](function(_0x30f41c){return _0x30f41c;});}return null;};}function removeEntity(_0x545301,_0x5bc38f){return function(_0x31e6c0){if(_0x31e6c0){return _0x31e6c0['destroy']()[_0xb823('0x3b')](function(){_0x545301[_0xb823('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494bf5,_0x58bb7b){return function(_0x1f3ed4){if(!_0x1f3ed4){_0x494bf5[_0xb823('0x3c')](0x194);}return _0x1f3ed4;};}function handleError(_0x54b416,_0xc60e23){_0xc60e23=_0xc60e23||0x1f4;return function(_0x1f2a4e){logger[_0xb823('0x2a')](_0x1f2a4e['stack']);if(_0x1f2a4e[_0xb823('0x3d')]){delete _0x1f2a4e[_0xb823('0x3d')];}_0x54b416[_0xb823('0x2f')](_0xc60e23)['send'](_0x1f2a4e);};}exports['index']=function(_0x3e266e,_0x799f69){var _0x1e5e20={},_0x2432f7={},_0x4cc1ab={'count':0x0,'rows':[]};var _0x4f9707=_['map'](db[_0xb823('0x3e')][_0xb823('0x3f')],function(_0x39a67a){return{'name':_0x39a67a[_0xb823('0x40')],'type':_0x39a67a['type'][_0xb823('0x41')]};});_0x2432f7[_0xb823('0x42')]=_['map'](_0x4f9707,_0xb823('0x3d'));_0x2432f7[_0xb823('0x43')]=_[_0xb823('0x44')](_0x3e266e['query']);_0x2432f7[_0xb823('0x45')]=_[_0xb823('0x46')](_0x2432f7['model'],_0x2432f7[_0xb823('0x43')]);_0x1e5e20['attributes']=_[_0xb823('0x46')](_0x2432f7[_0xb823('0x42')],qs[_0xb823('0x47')](_0x3e266e[_0xb823('0x43')][_0xb823('0x47')]));_0x1e5e20[_0xb823('0x48')]=_0x1e5e20['attributes'][_0xb823('0x49')]?_0x1e5e20['attributes']:_0x2432f7[_0xb823('0x42')];if(!_0x3e266e[_0xb823('0x43')][_0xb823('0x4a')](_0xb823('0x4b'))){_0x1e5e20[_0xb823('0x33')]=qs['limit'](_0x3e266e[_0xb823('0x43')][_0xb823('0x33')]);_0x1e5e20[_0xb823('0x31')]=qs['offset'](_0x3e266e[_0xb823('0x43')][_0xb823('0x31')]);}_0x1e5e20[_0xb823('0x4c')]=qs['sort'](_0x3e266e[_0xb823('0x43')][_0xb823('0x4d')]);_0x1e5e20['where']=qs[_0xb823('0x45')](_[_0xb823('0x4e')](_0x3e266e[_0xb823('0x43')],_0x2432f7['filters']),_0x4f9707);if(_0x3e266e[_0xb823('0x43')][_0xb823('0x4f')]){_0x1e5e20['where']=_[_0xb823('0x50')](_0x1e5e20['where'],{'$or':_[_0xb823('0x51')](_0x4f9707,function(_0x36d5d6){if(_0x36d5d6[_0xb823('0x52')]!==_0xb823('0x53')){var _0x451172={};_0x451172[_0x36d5d6[_0xb823('0x3d')]]={'$like':'%'+_0x3e266e['query'][_0xb823('0x4f')]+'%'};return _0x451172;}})});}_0x1e5e20=_[_0xb823('0x50')]({},_0x1e5e20,_0x3e266e[_0xb823('0x54')]);var _0x39fcba={'where':_0x1e5e20['where']};return db[_0xb823('0x3e')][_0xb823('0x34')](_0x39fcba)['then'](function(_0x5cee3a){_0x4cc1ab[_0xb823('0x34')]=_0x5cee3a;if(_0x3e266e[_0xb823('0x43')][_0xb823('0x55')]){_0x1e5e20[_0xb823('0x56')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb823('0x57')](_0x1e5e20);})['then'](function(_0x26a2dd){_0x4cc1ab[_0xb823('0x58')]=_0x26a2dd;return _0x4cc1ab;})[_0xb823('0x3b')](respondWithFilteredResult(_0x799f69,_0x1e5e20))[_0xb823('0x2e')](handleError(_0x799f69,null));};exports['show']=function(_0x5149de,_0x39dd84){var _0x4bc885={'raw':!![],'where':{'id':_0x5149de['params']['id']}},_0x2a710a={};_0x2a710a[_0xb823('0x42')]=_[_0xb823('0x44')](db[_0xb823('0x3e')][_0xb823('0x3f')]);_0x2a710a[_0xb823('0x43')]=_[_0xb823('0x44')](_0x5149de[_0xb823('0x43')]);_0x2a710a['filters']=_[_0xb823('0x46')](_0x2a710a[_0xb823('0x42')],_0x2a710a[_0xb823('0x43')]);_0x4bc885[_0xb823('0x48')]=_['intersection'](_0x2a710a[_0xb823('0x42')],qs[_0xb823('0x47')](_0x5149de[_0xb823('0x43')][_0xb823('0x47')]));_0x4bc885[_0xb823('0x48')]=_0x4bc885[_0xb823('0x48')][_0xb823('0x49')]?_0x4bc885[_0xb823('0x48')]:_0x2a710a[_0xb823('0x42')];if(_0x5149de[_0xb823('0x43')][_0xb823('0x55')]){_0x4bc885[_0xb823('0x56')]=[{'all':!![]}];}_0x4bc885=_[_0xb823('0x50')]({},_0x4bc885,_0x5149de[_0xb823('0x54')]);return db['WhatsappMessage'][_0xb823('0x59')](_0x4bc885)[_0xb823('0x3b')](handleEntityNotFound(_0x39dd84,null))['then'](respondWithResult(_0x39dd84,null))['catch'](handleError(_0x39dd84,null));};exports['create']=function(_0xae011c,_0x48f874){return db[_0xb823('0x3e')][_0xb823('0x5a')](_0xae011c[_0xb823('0x5b')],{})[_0xb823('0x3b')](respondWithResult(_0x48f874,0xc9))['catch'](handleError(_0x48f874,null));};exports[_0xb823('0x3a')]=function(_0x404a3a,_0x53301e){if(_0x404a3a[_0xb823('0x5b')]['id']){delete _0x404a3a[_0xb823('0x5b')]['id'];}return db[_0xb823('0x3e')]['find']({'where':{'id':_0x404a3a[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x53301e,null))[_0xb823('0x3b')](saveUpdates(_0x404a3a['body'],null))[_0xb823('0x3b')](respondWithResult(_0x53301e,null))[_0xb823('0x2e')](handleError(_0x53301e,null));};exports[_0xb823('0x5d')]=function(_0x570309,_0x162461){return db[_0xb823('0x3e')]['find']({'where':{'id':_0x570309[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x162461,null))[_0xb823('0x3b')](removeEntity(_0x162461,null))['catch'](handleError(_0x162461,null));};exports[_0xb823('0x5e')]=function(_0x2ffc3b,_0x2ac0ff){return db[_0xb823('0x3e')]['describe']()['then'](respondWithResult(_0x2ac0ff,null))[_0xb823('0x2e')](handleError(_0x2ac0ff,null));};var interaction_log=require(_0xb823('0x18'))('whatsapp-interactions');exports[_0xb823('0x5f')]=function(_0x55b376,_0x53c492,_0x349df1){var _0x1e6b11={'agent':{},'channel':'whatsapp'};if(_0x55b376[_0xb823('0x5b')]['id']){delete _0x55b376[_0xb823('0x5b')]['id'];}_0x55b376[_0xb823('0x5b')]['read']=!![];_0x55b376[_0xb823('0x5b')]['readAt']=moment()[_0xb823('0x60')](_0xb823('0x61'));_0x55b376[_0xb823('0x5b')][_0xb823('0x62')]=_0x55b376[_0xb823('0x5b')]['UserId']||_0x55b376[_0xb823('0x63')]['id'];_0x1e6b11[_0xb823('0x64')]['id']=_0x55b376[_0xb823('0x5b')][_0xb823('0x62')];return db[_0xb823('0x3e')][_0xb823('0x59')]({'where':{'id':_0x55b376['params']['id'],'UserId':null}})[_0xb823('0x3b')](handleEntityNotFound(_0x53c492,null))[_0xb823('0x3b')](saveUpdates(_0x55b376['body'],null))[_0xb823('0x3b')](function(_0x457c85){if(_0x457c85){_0x1e6b11['message']=_0x457c85[_0xb823('0x65')]({'plain':!![]});return db[_0xb823('0x66')][_0xb823('0x59')]({'where':{'id':_0x457c85[_0xb823('0x67')]}});}return null;})[_0xb823('0x3b')](handleEntityNotFound(_0x53c492,null))['then'](function(_0x533843){if(_0x533843){return _0x533843[_0xb823('0x3a')]({'UserId':_0x55b376[_0xb823('0x5b')][_0xb823('0x62')],'read1stAt':_[_0xb823('0x68')](_0x533843[_0xb823('0x69')])?moment()[_0xb823('0x60')](_0xb823('0x61')):undefined});}return null;})[_0xb823('0x3b')](function(_0x34356f){if(_0x34356f){_0x1e6b11[_0xb823('0x6a')]=_0x34356f['get']({'plain':!![]});interaction_log[_0xb823('0x2c')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55b376[_0xb823('0x63')]['id'],_0x55b376['user'][_0xb823('0x3d')],_0x55b376[_0xb823('0x63')]['role'],_0x1e6b11[_0xb823('0x6a')]['id'],_0x55b376[_0xb823('0x5b')]?JSON[_0xb823('0x29')](_0x55b376[_0xb823('0x5b')]):_0xb823('0x6b'));return respondWithRpcPromise(_0xb823('0x6c'),_0xb823('0x6d'),_0x1e6b11);}return null;})[_0xb823('0x3b')](function(_0x1b26b7){var _0x3e94ae=_0xb823('0x6e')+_0x1b26b7[_0xb823('0x2b')]['ContactId'];return db[_0xb823('0x6f')][_0xb823('0x43')](_0x3e94ae,{'type':db[_0xb823('0x70')][_0xb823('0x71')][_0xb823('0x72')],'raw':!![]})[_0xb823('0x3b')](function(_0x453cf0){return _0x453cf0;});})[_0xb823('0x3b')](function(_0x564ea5){if(_0x564ea5){_0x1e6b11[_0xb823('0x2b')][_0xb823('0x73')]=_0x564ea5[0x0];if(!_0x55b376[_0xb823('0x5b')]['UserId'])return;return db[_0xb823('0x74')]['find']({'where':{'id':_0x55b376[_0xb823('0x5b')][_0xb823('0x62')],'role':_0xb823('0x64')},'attributes':['id',_0xb823('0x3d'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xb823('0x3b')](function(_0x4a4807){if(!_0x4a4807)return null;_0x1e6b11['message'][_0xb823('0x64')]=_0x4a4807;return _0x1e6b11;})[_0xb823('0x3b')](function(_0x49c5b8){if(_0x49c5b8){if(_0x55b376['body'][_0xb823('0x75')]){_0x1e6b11[_0xb823('0x2b')][_0xb823('0x76')]=util[_0xb823('0x60')](_0xb823('0x77'),_0x55b376[_0xb823('0x63')][_0xb823('0x3d')]);_0x1e6b11['message'][_0xb823('0x78')]=_0x1e6b11[_0xb823('0x78')];_0x1e6b11['message'][_0xb823('0x79')]=_0x1e6b11[_0xb823('0x78')];_0x1e6b11[_0xb823('0x2b')][_0xb823('0x7a')]=_0xb823('0x5f');return respondWithRpcPromise(_0xb823('0x7b'),_0xb823('0x7b'),{'event':_0xb823('0x7c'),'message':_0x1e6b11['message']},client9002)[_0xb823('0x3b')](function(){return _0x1e6b11;});}return _0x1e6b11;}return null;})[_0xb823('0x3b')](respondWithResult(_0x53c492,null))[_0xb823('0x2e')](handleError(_0x53c492,null));};var interaction_log=require(_0xb823('0x18'))(_0xb823('0x7d'));exports[_0xb823('0x38')]=function(_0x279b1,_0xbf59e1,_0xc82a33){var _0x2bbcd7={'agent':{},'channel':_0xb823('0x7e')};if(_0x279b1[_0xb823('0x5b')]['id']){delete _0x279b1[_0xb823('0x5b')]['id'];}_0x279b1[_0xb823('0x5b')][_0xb823('0x62')]=_0x279b1['body']['UserId']||_0x279b1[_0xb823('0x63')]['id'];_0x2bbcd7[_0xb823('0x64')]['id']=_0x279b1['body']['UserId'];return db['WhatsappMessage'][_0xb823('0x59')]({'where':{'id':_0x279b1['params']['id'],'UserId':null}})[_0xb823('0x3b')](handleEntityNotFound(_0xbf59e1,null))['then'](function(_0x1a80fb){if(_0x1a80fb){_0x2bbcd7['message']=_0x1a80fb['get']({'plain':!![]});return db['WhatsappInteraction'][_0xb823('0x59')]({'where':{'id':_0x1a80fb[_0xb823('0x67')]}});}return null;})['then'](handleEntityNotFound(_0xbf59e1,null))[_0xb823('0x3b')](function(_0x23a6e4){if(_0x23a6e4){_0x2bbcd7[_0xb823('0x6a')]=_0x23a6e4[_0xb823('0x65')]({'plain':!![]});interaction_log[_0xb823('0x2c')](_0xb823('0x7f'),_0x279b1[_0xb823('0x63')]['id'],_0x279b1[_0xb823('0x63')][_0xb823('0x3d')],_0x279b1[_0xb823('0x63')][_0xb823('0x80')],_0x2bbcd7[_0xb823('0x6a')]['id'],_0x279b1[_0xb823('0x5b')]?JSON[_0xb823('0x29')](_0x279b1[_0xb823('0x5b')]):_0xb823('0x6b'));return respondWithRpcPromise(_0xb823('0x81'),_0xb823('0x82'),_0x2bbcd7);}return null;})[_0xb823('0x3b')](function(_0x25ebd8){var _0x3499ee=_0xb823('0x6e')+_0x25ebd8[_0xb823('0x2b')][_0xb823('0x83')];return db[_0xb823('0x6f')][_0xb823('0x43')](_0x3499ee,{'type':db[_0xb823('0x70')][_0xb823('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x28e017){return _0x28e017;});})[_0xb823('0x3b')](function(_0x4c78ef){if(_0x4c78ef){_0x2bbcd7[_0xb823('0x2b')][_0xb823('0x73')]=_0x4c78ef[0x0];if(!_0x279b1['body'][_0xb823('0x62')])return;return db[_0xb823('0x74')][_0xb823('0x59')]({'where':{'id':_0x279b1['body'][_0xb823('0x62')],'role':'agent'},'attributes':['id',_0xb823('0x3d'),'fullname',_0xb823('0x84'),_0xb823('0x85')],'raw':!![]});}return null;})[_0xb823('0x3b')](function(_0x5797c4){if(!_0x5797c4)return null;_0x2bbcd7[_0xb823('0x2b')][_0xb823('0x64')]=_0x5797c4;return _0x2bbcd7;})[_0xb823('0x3b')](function(_0x2e2d81){if(_0x2e2d81){_0x2e2d81[_0xb823('0x2b')][_0xb823('0x76')]=util[_0xb823('0x60')]('SIP/%s',_0x279b1[_0xb823('0x63')]['name']);_0x2e2d81[_0xb823('0x2b')][_0xb823('0x78')]=_0x2bbcd7['channel'];_0x2e2d81['message'][_0xb823('0x79')]=_0x2bbcd7['channel'];_0x2e2d81[_0xb823('0x2b')][_0xb823('0x7a')]=_0xb823('0x38');respondWithRpcPromise(_0xb823('0x7b'),_0xb823('0x7b'),{'event':'rejectmessage','message':_0x2e2d81[_0xb823('0x2b')]},client9002);return _0x2bbcd7;}return null;})[_0xb823('0x3b')](respondWithResult(_0xbf59e1,null))[_0xb823('0x2e')](handleError(_0xbf59e1,null));};exports[_0xb823('0x2f')]=function(_0x4b4dd3,_0x74b19f,_0x55c920){if(_0x4b4dd3[_0xb823('0x5b')]['id']){delete _0x4b4dd3['body']['id'];}var _0x26319d;return db[_0xb823('0x3e')][_0xb823('0x59')]({'where':{'id':_0x4b4dd3[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x74b19f,null))[_0xb823('0x3b')](function(_0x228a55){if(_0x228a55){_0x26319d=_0x228a55;return db[_0xb823('0x86')][_0xb823('0x59')]({'where':{'id':_0x228a55[_0xb823('0x87')]}});}})[_0xb823('0x3b')](handleEntityNotFound(_0x74b19f,null))[_0xb823('0x3b')](function(_0x2c895b){if(_0x2c895b){logger['debug'](_0xb823('0x88'),_0xb823('0x2f'),'received\x20delivery\x20report\x20from',_0x2c895b[_0xb823('0x52')],util['inspect'](_0x4b4dd3[_0xb823('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2c895b['type']){case'twilio':if(_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x89')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x89')]===_0x26319d[_0xb823('0x8a')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x8b')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x8b')]==='read'){return _0x26319d[_0xb823('0x3a')]({'read':!![]});}else{logger['error'](_0xb823('0x8c'),_0xb823('0x2f'),_0xb823('0x8d'),util[_0xb823('0x8e')](_0x4b4dd3[_0xb823('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x26319d;}})['then'](respondWithResult(_0x74b19f,null))[_0xb823('0x2e')](handleError(_0x74b19f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d636a4a..e113db8 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b24=['../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','exports'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0x6b24,0x1ce));var _0x46b2=function(_0x3987a1,_0x447793){_0x3987a1=_0x3987a1-0x0;var _0xe2596e=_0x6b24[_0x3987a1];return _0xe2596e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x46b2('0x0'))['db'][_0x46b2('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x46b2('0x2')](0x0);var events={'afterCreate':_0x46b2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4cfef4){return function(_0x304ab5,_0x53ee5c,_0x186cda){WhatsappMessageEvents['emit'](_0x4cfef4+':'+_0x304ab5['id'],_0x304ab5);WhatsappMessageEvents[_0x46b2('0x4')](_0x4cfef4,_0x304ab5);_0x186cda(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x46b2('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0xdb94=['remove','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb94,0xab));var _0x4db9=function(_0x449724,_0x4bd02d){_0x449724=_0x449724-0x0;var _0x10a457=_0xdb94[_0x449724];return _0x10a457;};'use strict';var EventEmitter=require(_0x4db9('0x0'));var WhatsappMessage=require(_0x4db9('0x1'))['db'][_0x4db9('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4db9('0x3')](0x0);var events={'afterCreate':_0x4db9('0x4'),'afterUpdate':'update','afterDestroy':_0x4db9('0x5')};function emitEvent(_0x16c55a){return function(_0x554bd5,_0x4ed80a,_0x209f80){WhatsappMessageEvents['emit'](_0x16c55a+':'+_0x554bd5['id'],_0x554bd5);WhatsappMessageEvents['emit'](_0x16c55a,_0x554bd5);_0x209f80(null);};}for(var e in events){if(events[_0x4db9('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x4db9('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 641418d..8e038b5 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d23=['create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/messages/','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages'];(function(_0x1f9da3,_0x21e6b4){var _0x10a7fb=function(_0x12f178){while(--_0x12f178){_0x1f9da3['push'](_0x1f9da3['shift']());}};_0x10a7fb(++_0x21e6b4);}(_0x7d23,0x136));var _0x37d2=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x7d23[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x37d2('0x0'));var util=require(_0x37d2('0x1'));var logger=require('../../config/logger')(_0x37d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x37d2('0x3'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x37d2('0x4'));var rimraf=require(_0x37d2('0x5'));var config=require(_0x37d2('0x6'));var attributes=require(_0x37d2('0x7'));module[_0x37d2('0x8')]=function(_0x9e6a08,_0xd2f4f9){return _0x9e6a08[_0x37d2('0x9')]('WhatsappMessage',attributes,{'tableName':_0x37d2('0xa'),'paranoid':![],'indexes':[{'name':_0x37d2('0xb'),'fields':[_0x37d2('0xb')]},{'name':_0x37d2('0xc'),'fields':[_0x37d2('0xd')],'type':_0x37d2('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1443ff,_0x1febe9,_0x95c090){var _0x1b8582=_0x9e6a08[_0x37d2('0xf')];var _0x350306=_0x1443ff[_0x37d2('0x10')]({'plain':!![]});if(_0x350306['direction'][_0x37d2('0x11')]()==='in'||_0x350306[_0x37d2('0x12')][_0x37d2('0x11')]()===_0x37d2('0x13')&&!_0x350306[_0x37d2('0x14')]&&!_[_0x37d2('0x15')](_0x350306[_0x37d2('0x16')])){_0x1b8582[_0x37d2('0x17')]['findOne']({'where':{'id':_0x350306[_0x37d2('0x18')]}})['then'](function(_0x33face){if(_0x33face){_0x33face[_0x37d2('0x19')]({'lastMsgAt':_0x350306[_0x37d2('0x1a')],'lastMsgDirection':_0x350306['direction']['toLowerCase']()});}})[_0x37d2('0x1b')](function(_0x327d7d){console[_0x37d2('0x1c')](_0x327d7d);});}if(_0x350306[_0x37d2('0x12')]==='out'&&!_0x350306[_0x37d2('0x14')]){var _0x262734;_0x1b8582['WhatsappAccount'][_0x37d2('0x1d')]({'where':{'id':_0x350306[_0x37d2('0x1e')]},'raw':!![]})[_0x37d2('0x1f')](function(_0x16163b){_0x262734=_0x16163b;if(_0x262734&&_0x262734[_0x37d2('0x20')]){switch(_0x262734[_0x37d2('0x20')]){case'twilio':var _0x2f718b=require(_0x37d2('0x21'));if(_0x262734[_0x37d2('0x22')]&&_0x262734[_0x37d2('0x23')]&&_0x262734[_0x37d2('0x24')]){var _0x20f5fd=new _0x2f718b(_0x262734[_0x37d2('0x22')],_0x262734[_0x37d2('0x23')]);_0x20f5fd[_0x37d2('0x25')][_0x37d2('0x26')]({'body':_0x350306[_0x37d2('0xd')],'to':_0x37d2('0x27')+_0x350306['phone'],'from':_0x37d2('0x27')+_0x262734[_0x37d2('0x24')],'statusCallback':_0x262734[_0x37d2('0x28')]+_0x37d2('0x29')+_0x350306['id']+_0x37d2('0x2a')+_0x262734[_0x37d2('0x2b')]})['then'](function(_0xe13772){if(_0xe13772[_0x37d2('0x2c')]){return _0x1443ff['update']({'messageId':_0xe13772[_0x37d2('0x2c')]});}})[_0x37d2('0x1b')](function(_0x3ebc4a){logger[_0x37d2('0x1c')](_0x37d2('0x2d'),_0x37d2('0x2e'),'twilio',util['inspect'](_0x3ebc4a,{'showHidden':![],'depth':null}));});}else{logger[_0x37d2('0x1c')](_0x37d2('0x2d'),'afterCreate',_0x37d2('0x21'),_0x37d2('0x2f'));}break;case'sinch':var _0x3323bf=_0x262734[_0x37d2('0x22')];var _0x411c6f=_0x262734[_0x37d2('0x23')];var _0x401fca=_0x262734[_0x37d2('0x30')]+'/whatsapp/v1/'+_0x3323bf+_0x37d2('0x31');var _0x384bbe={'to':[_0x350306['phone']],'message':{'type':'text','text':_0x350306[_0x37d2('0xd')]}};var _0x138ad0={'method':'POST','uri':_0x401fca,'headers':{'Authorization':_0x37d2('0x32')+_0x411c6f,'Content-Type':'application/json'},'body':_0x384bbe,'json':!![]};rp(_0x138ad0)['then'](function(_0x5b8570){if(_0x5b8570[_0x37d2('0x33')][0x0][_0x37d2('0x34')]){return _0x1443ff['update']({'messageId':_0x5b8570['statuses'][0x0][_0x37d2('0x34')]});}})[_0x37d2('0x1b')](function(_0x680962){logger[_0x37d2('0x35')](_0x37d2('0x36'),_0x680962);});break;}}})[_0x37d2('0x37')](function(){_0x95c090();});}else{_0x95c090();}}},'charset':_0x37d2('0x38'),'collate':_0x37d2('0x39')});}; \ No newline at end of file +var _0x00d9=['accountSid','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','WhatsappMessage,\x20%s','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','messageId','fti_whatsapp_messages','models','direction','toLowerCase','secret','UserId','WhatsappInteraction','then','update','catch','error','out','WhatsappAccount','find','WhatsappAccountId','twilio','phone','authToken','messages','create','body','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x00d9,0x1a2));var _0x900d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x00d9[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x900d('0x0'));var util=require(_0x900d('0x1'));var logger=require(_0x900d('0x2'))(_0x900d('0x3'));var moment=require('moment');var BPromise=require(_0x900d('0x4'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x900d('0x5'));var rimraf=require(_0x900d('0x6'));var config=require(_0x900d('0x7'));var attributes=require(_0x900d('0x8'));module['exports']=function(_0x1a8de0,_0x454f9b){return _0x1a8de0[_0x900d('0x9')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x900d('0xa')]},{'name':_0x900d('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x477227,_0x1ce9d5,_0xb45304){var _0x2d5e59=_0x1a8de0[_0x900d('0xc')];var _0x37a462=_0x477227['get']({'plain':!![]});if(_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()==='in'||_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()==='out'&&!_0x37a462[_0x900d('0xf')]&&!_['isNil'](_0x37a462[_0x900d('0x10')])){_0x2d5e59[_0x900d('0x11')]['findOne']({'where':{'id':_0x37a462['WhatsappInteractionId']}})[_0x900d('0x12')](function(_0x3ef9ab){if(_0x3ef9ab){_0x3ef9ab[_0x900d('0x13')]({'lastMsgAt':_0x37a462['createdAt'],'lastMsgDirection':_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()});}})[_0x900d('0x14')](function(_0x210bff){console[_0x900d('0x15')](_0x210bff);});}if(_0x37a462[_0x900d('0xd')]===_0x900d('0x16')&&!_0x37a462[_0x900d('0xf')]){var _0x516dd8;_0x2d5e59[_0x900d('0x17')][_0x900d('0x18')]({'where':{'id':_0x37a462[_0x900d('0x19')]},'raw':!![]})[_0x900d('0x12')](function(_0x452614){_0x516dd8=_0x452614;if(_0x516dd8&&_0x516dd8['type']){switch(_0x516dd8['type']){case _0x900d('0x1a'):var _0x3fa06=require(_0x900d('0x1a'));if(_0x516dd8['accountSid']&&_0x516dd8['authToken']&&_0x516dd8[_0x900d('0x1b')]){var _0x189145=new _0x3fa06(_0x516dd8['accountSid'],_0x516dd8[_0x900d('0x1c')]);_0x189145[_0x900d('0x1d')][_0x900d('0x1e')]({'body':_0x37a462[_0x900d('0x1f')],'to':_0x900d('0x20')+_0x37a462[_0x900d('0x1b')],'from':_0x900d('0x20')+_0x516dd8['phone'],'statusCallback':_0x516dd8[_0x900d('0x21')]+'/api/whatsapp/messages/'+_0x37a462['id']+_0x900d('0x22')+_0x516dd8[_0x900d('0x23')]})[_0x900d('0x12')](function(_0x14d469){if(_0x14d469[_0x900d('0x24')]){return _0x477227[_0x900d('0x13')]({'messageId':_0x14d469[_0x900d('0x24')]});}})['catch'](function(_0x382cc6){logger[_0x900d('0x15')](_0x900d('0x25'),_0x900d('0x26'),_0x900d('0x1a'),util['inspect'](_0x382cc6,{'showHidden':![],'depth':null}));});}else{logger[_0x900d('0x15')](_0x900d('0x25'),_0x900d('0x26'),_0x900d('0x1a'),_0x900d('0x27'));}break;case _0x900d('0x28'):var _0x26e4a8=_0x516dd8[_0x900d('0x29')];var _0x4de643=_0x516dd8[_0x900d('0x1c')];var _0x5dd5ae=_0x516dd8[_0x900d('0x2a')]+_0x900d('0x2b')+_0x26e4a8+_0x900d('0x2c');var _0x1cb970={'to':[_0x37a462[_0x900d('0x1b')]],'message':{'type':_0x900d('0x2d'),'text':_0x37a462[_0x900d('0x1f')]}};var _0x192b84={'method':_0x900d('0x2e'),'uri':_0x5dd5ae,'headers':{'Authorization':_0x900d('0x2f')+_0x4de643,'Content-Type':'application/json'},'body':_0x1cb970,'json':!![]};rp(_0x192b84)[_0x900d('0x12')](function(_0xee5162){if(_0xee5162['statuses'][0x0][_0x900d('0x30')]){return _0x477227[_0x900d('0x13')]({'messageId':_0xee5162[_0x900d('0x31')][0x0][_0x900d('0x30')]});}})[_0x900d('0x14')](function(_0x71f55){logger['err'](_0x900d('0x32'),_0x71f55);});break;}}})['finally'](function(){_0xb45304();});}else{_0xb45304();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index da38f56..b9bfc3a 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b0b=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x107459,_0x2a2109){var _0x1c7984=function(_0x48053f){while(--_0x48053f){_0x107459['push'](_0x107459['shift']());}};_0x1c7984(++_0x2a2109);}(_0x2b0b,0x101));var _0xb2b0=function(_0x3d6bb7,_0x456f7c){_0x3d6bb7=_0x3d6bb7-0x0;var _0x509c16=_0x2b0b[_0x3d6bb7];return _0x509c16;};'use strict';var _=require('lodash');var util=require(_0xb2b0('0x0'));var moment=require(_0xb2b0('0x1'));var BPromise=require(_0xb2b0('0x2'));var rs=require(_0xb2b0('0x3'));var fs=require('fs');var Redis=require(_0xb2b0('0x4'));var db=require(_0xb2b0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2b0('0x6'))(_0xb2b0('0x7'));var config=require(_0xb2b0('0x8'));var jayson=require(_0xb2b0('0x9'));var client=jayson[_0xb2b0('0xa')][_0xb2b0('0xb')]({'port':0x232a});config['redis']=_[_0xb2b0('0xc')](config[_0xb2b0('0xd')],{'host':_0xb2b0('0xe'),'port':0x18eb});var socket=require(_0xb2b0('0xf'))(new Redis(config[_0xb2b0('0xd')]));require(_0xb2b0('0x10'))['register'](socket);function respondWithRpcPromise(_0x36adec,_0x146aa8,_0x47b15c){return new BPromise(function(_0xd08fc,_0x5a3eea){return client[_0xb2b0('0x11')](_0x36adec,_0x47b15c)[_0xb2b0('0x12')](function(_0x289e72){logger['info'](_0xb2b0('0x13'),_0x146aa8,_0xb2b0('0x14'));logger[_0xb2b0('0x15')](_0xb2b0('0x16'),_0x146aa8,'request\x20sent',JSON['stringify'](_0x289e72));if(_0x289e72[_0xb2b0('0x17')]){if(_0x289e72['error']['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x146aa8,_0x289e72[_0xb2b0('0x17')][_0xb2b0('0x18')]);return _0x5a3eea(_0x289e72[_0xb2b0('0x17')][_0xb2b0('0x18')]);}logger['error'](_0xb2b0('0x13'),_0x146aa8,_0x289e72[_0xb2b0('0x17')][_0xb2b0('0x18')]);return _0xd08fc(_0x289e72[_0xb2b0('0x17')][_0xb2b0('0x18')]);}else{logger[_0xb2b0('0x19')](_0xb2b0('0x13'),_0x146aa8,'request\x20sent');_0xd08fc(_0x289e72['result']['message']);}})[_0xb2b0('0x1a')](function(_0x4b8be3){logger[_0xb2b0('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x146aa8,_0x4b8be3);_0x5a3eea(_0x4b8be3);});});}exports[_0xb2b0('0x1b')]=function(_0x51e170){var _0x1547cd=this;return new Promise(function(_0x217cbc,_0xcbc072){return db[_0xb2b0('0x1c')][_0xb2b0('0x1d')](_0x51e170['body'],{'raw':_0x51e170['options']?_0x51e170[_0xb2b0('0x1e')][_0xb2b0('0x1f')]===undefined?!![]:![]:!![]})[_0xb2b0('0x12')](function(_0x3f1ede){logger[_0xb2b0('0x19')](_0xb2b0('0x1b'),_0x51e170);logger['debug'](_0xb2b0('0x1b'),_0x51e170,JSON[_0xb2b0('0x20')](_0x3f1ede));_0x217cbc(_0x3f1ede);})[_0xb2b0('0x1a')](function(_0x1553d7){logger[_0xb2b0('0x17')]('CreateWhatsappMessage',_0x1553d7[_0xb2b0('0x18')],_0x51e170);_0xcbc072(_0x1547cd[_0xb2b0('0x17')](0x1f4,_0x1553d7[_0xb2b0('0x18')]));});});}; \ No newline at end of file +var _0x9183=['WhatsappMessage','options','raw','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x9183,0x11b));var _0x3918=function(_0x4b9097,_0x15a9e2){_0x4b9097=_0x4b9097-0x0;var _0x3566f4=_0x9183[_0x4b9097];return _0x3566f4;};'use strict';var _=require(_0x3918('0x0'));var util=require('util');var moment=require(_0x3918('0x1'));var BPromise=require(_0x3918('0x2'));var rs=require(_0x3918('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3918('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3918('0x5'))(_0x3918('0x6'));var config=require('../../config/environment');var jayson=require(_0x3918('0x7'));var client=jayson['client'][_0x3918('0x8')]({'port':0x232a});config[_0x3918('0x9')]=_[_0x3918('0xa')](config[_0x3918('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3918('0xb'))(new Redis(config[_0x3918('0x9')]));require(_0x3918('0xc'))[_0x3918('0xd')](socket);function respondWithRpcPromise(_0x1ed828,_0x511300,_0x3c571e){return new BPromise(function(_0x3244f6,_0x5d286f){return client[_0x3918('0xe')](_0x1ed828,_0x3c571e)[_0x3918('0xf')](function(_0x2c2305){logger[_0x3918('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x511300,'request\x20sent');logger['debug'](_0x3918('0x11'),_0x511300,_0x3918('0x12'),JSON[_0x3918('0x13')](_0x2c2305));if(_0x2c2305[_0x3918('0x14')]){if(_0x2c2305[_0x3918('0x14')][_0x3918('0x15')]===0x1f4){logger[_0x3918('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x511300,_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);return _0x5d286f(_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);}logger[_0x3918('0x14')](_0x3918('0x17'),_0x511300,_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);return _0x3244f6(_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);}else{logger['info'](_0x3918('0x17'),_0x511300,_0x3918('0x12'));_0x3244f6(_0x2c2305[_0x3918('0x18')]['message']);}})[_0x3918('0x19')](function(_0xf2df69){logger[_0x3918('0x14')](_0x3918('0x17'),_0x511300,_0xf2df69);_0x5d286f(_0xf2df69);});});}exports[_0x3918('0x1a')]=function(_0x19435e){var _0x4f20bc=this;return new Promise(function(_0x3ade9d,_0x50a153){return db[_0x3918('0x1b')]['create'](_0x19435e['body'],{'raw':_0x19435e[_0x3918('0x1c')]?_0x19435e[_0x3918('0x1c')][_0x3918('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x482ded){logger[_0x3918('0x10')]('CreateWhatsappMessage',_0x19435e);logger[_0x3918('0x1e')]('CreateWhatsappMessage',_0x19435e,JSON['stringify'](_0x482ded));_0x3ade9d(_0x482ded);})[_0x3918('0x19')](function(_0x1b08a9){logger['error']('CreateWhatsappMessage',_0x1b08a9[_0x3918('0x16')],_0x19435e);_0x50a153(_0x4f20bc[_0x3918('0x14')](0x1f4,_0x1b08a9[_0x3918('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d72bb60..dccde38 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9b7=['./whatsappMessage.events','save','remove','update','removeListener','register','length','whatsappMessage:'];(function(_0x57d3d9,_0x2d605b){var _0x46730c=function(_0x1e7019){while(--_0x1e7019){_0x57d3d9['push'](_0x57d3d9['shift']());}};_0x46730c(++_0x2d605b);}(_0xe9b7,0xd0));var _0x7e9b=function(_0x44a573,_0x1e6efc){_0x44a573=_0x44a573-0x0;var _0x4babc6=_0xe9b7[_0x44a573];return _0x4babc6;};'use strict';var WhatsappMessageEvents=require(_0x7e9b('0x0'));var events=[_0x7e9b('0x1'),_0x7e9b('0x2'),_0x7e9b('0x3')];function createListener(_0x45c0fb,_0x170b0f){return function(_0x12a5cd){_0x170b0f['emit'](_0x45c0fb,_0x12a5cd);};}function removeListener(_0x52a5e6,_0x4cf56d){return function(){WhatsappMessageEvents[_0x7e9b('0x4')](_0x52a5e6,_0x4cf56d);};}exports[_0x7e9b('0x5')]=function(_0x28298b){for(var _0x30c0bc=0x0,_0x490ec8=events[_0x7e9b('0x6')];_0x30c0bc<_0x490ec8;_0x30c0bc++){var _0xa4c3a2=events[_0x30c0bc];var _0x32b707=createListener(_0x7e9b('0x7')+_0xa4c3a2,_0x28298b);WhatsappMessageEvents['on'](_0xa4c3a2,_0x32b707);}}; \ No newline at end of file +var _0x1709=['emit','removeListener','register','length','whatsappMessage:','save','remove'];(function(_0x609f92,_0x59c70f){var _0x33bf0f=function(_0x54317f){while(--_0x54317f){_0x609f92['push'](_0x609f92['shift']());}};_0x33bf0f(++_0x59c70f);}(_0x1709,0x155));var _0x9170=function(_0x160182,_0x4cf21a){_0x160182=_0x160182-0x0;var _0x1c1e78=_0x1709[_0x160182];return _0x1c1e78;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x9170('0x0'),_0x9170('0x1'),'update'];function createListener(_0x3ca9f7,_0x4760fb){return function(_0x44fc27){_0x4760fb[_0x9170('0x2')](_0x3ca9f7,_0x44fc27);};}function removeListener(_0x1e4bb9,_0x502799){return function(){WhatsappMessageEvents[_0x9170('0x3')](_0x1e4bb9,_0x502799);};}exports[_0x9170('0x4')]=function(_0x55e063){for(var _0x2d938c=0x0,_0x533d2d=events[_0x9170('0x5')];_0x2d938c<_0x533d2d;_0x2d938c++){var _0x506940=events[_0x2d938c];var _0x46acb0=createListener(_0x9170('0x6')+_0x506940,_0x55e063);WhatsappMessageEvents['on'](_0x506940,_0x46acb0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index e76ed9c..1af3214 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['get','isAuthenticated','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueue.controller'];(function(_0x24def2,_0x3af585){var _0x450ffb=function(_0x1b37fd){while(--_0x1b37fd){_0x24def2['push'](_0x24def2['shift']());}};_0x450ffb(++_0x3af585);}(_0xeec6,0x13c));var _0x6eec=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xeec6[_0x39fd11];return _0x302799;};'use strict';var multer=require('multer');var util=require(_0x6eec('0x0'));var path=require(_0x6eec('0x1'));var timeout=require(_0x6eec('0x2'));var express=require(_0x6eec('0x3'));var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6eec('0x6'));var config=require('../../config/environment');var controller=require(_0x6eec('0x7'));router[_0x6eec('0x8')]('/',auth[_0x6eec('0x9')](),controller['index']);router[_0x6eec('0x8')](_0x6eec('0xa'),auth['isAuthenticated'](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6eec('0x8')](_0x6eec('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x6eec('0x8')](_0x6eec('0xe'),auth['isAuthenticated'](),controller[_0x6eec('0xf')]);router[_0x6eec('0x8')](_0x6eec('0x10'),auth[_0x6eec('0x9')](),controller[_0x6eec('0x11')]);router[_0x6eec('0x12')]('/',auth[_0x6eec('0x9')](),controller[_0x6eec('0x13')]);router[_0x6eec('0x12')](_0x6eec('0xe'),auth[_0x6eec('0x9')](),controller[_0x6eec('0x14')]);router[_0x6eec('0x12')](_0x6eec('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6eec('0x15')](_0x6eec('0xc'),auth[_0x6eec('0x9')](),controller[_0x6eec('0x16')]);router[_0x6eec('0x17')]('/:id',auth[_0x6eec('0x9')](),controller[_0x6eec('0x18')]);router['delete']('/:id/teams',auth[_0x6eec('0x9')](),controller['removeTeams']);router[_0x6eec('0x17')](_0x6eec('0x10'),auth[_0x6eec('0x9')](),controller[_0x6eec('0x19')]);module[_0x6eec('0x1a')]=router; \ No newline at end of file +var _0x04b6=['removeTeams','delete','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy'];(function(_0x47f733,_0x104342){var _0x480588=function(_0x50e534){while(--_0x50e534){_0x47f733['push'](_0x47f733['shift']());}};_0x480588(++_0x104342);}(_0x04b6,0x17d));var _0x604b=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x04b6[_0x5948dd];return _0xb1f8be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x604b('0x0'));var timeout=require('connect-timeout');var express=require(_0x604b('0x1'));var router=express[_0x604b('0x2')]();var fs_extra=require(_0x604b('0x3'));var auth=require(_0x604b('0x4'));var interaction=require(_0x604b('0x5'));var config=require(_0x604b('0x6'));var controller=require(_0x604b('0x7'));router[_0x604b('0x8')]('/',auth[_0x604b('0x9')](),controller['index']);router[_0x604b('0x8')]('/describe',auth[_0x604b('0x9')](),controller[_0x604b('0xa')]);router[_0x604b('0x8')](_0x604b('0xb'),auth[_0x604b('0x9')](),controller[_0x604b('0xc')]);router['get'](_0x604b('0xd'),auth[_0x604b('0x9')](),controller[_0x604b('0xe')]);router[_0x604b('0x8')](_0x604b('0xf'),auth[_0x604b('0x9')](),controller[_0x604b('0x10')]);router['get'](_0x604b('0x11'),auth[_0x604b('0x9')](),controller[_0x604b('0x12')]);router[_0x604b('0x13')]('/',auth['isAuthenticated'](),controller[_0x604b('0x14')]);router[_0x604b('0x13')](_0x604b('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x604b('0x11'),auth['isAuthenticated'](),controller[_0x604b('0x15')]);router[_0x604b('0x16')](_0x604b('0xb'),auth[_0x604b('0x9')](),controller[_0x604b('0x17')]);router['delete'](_0x604b('0xb'),auth['isAuthenticated'](),controller[_0x604b('0x18')]);router['delete'](_0x604b('0xf'),auth[_0x604b('0x9')](),controller[_0x604b('0x19')]);router[_0x604b('0x1a')]('/:id/users',auth[_0x604b('0x9')](),controller[_0x604b('0x1b')]);module[_0x604b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 8e3dab9..1fefc14 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e14=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x45e1('0x0'));module[_0x45e1('0x1')]={'name':{'type':Sequelize[_0x45e1('0x2')],'unique':_0x45e1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x45e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x45e1('0x5')](_0x45e1('0x6'),_0x45e1('0x7'),_0x45e1('0x8'))},'description':{'type':Sequelize[_0x45e1('0x2')]}}; \ No newline at end of file +var _0x9755=['STRING','name','INTEGER','roundrobin','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9755,0x1c6));var _0x5975=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x9755[_0x2605dc];return _0x4568c9;};'use strict';var Sequelize=require(_0x5975('0x0'));module['exports']={'name':{'type':Sequelize[_0x5975('0x1')],'unique':_0x5975('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5975('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5975('0x4'))},'description':{'type':Sequelize[_0x5975('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index b30f2a9..77ef415 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c47=['WhatsappQueues','destroy','error','name','send','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','map','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','SIP','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','get'];(function(_0x165f9c,_0x29b9d8){var _0x4514c0=function(_0x1e99e3){while(--_0x1e99e3){_0x165f9c['push'](_0x165f9c['shift']());}};_0x4514c0(++_0x29b9d8);}(_0x6c47,0x17c));var _0x76c4=function(_0x1a798c,_0x5e0126){_0x1a798c=_0x1a798c-0x0;var _0x43d4e8=_0x6c47[_0x1a798c];return _0x43d4e8;};'use strict';var emlformat=require(_0x76c4('0x0'));var rimraf=require(_0x76c4('0x1'));var zipdir=require(_0x76c4('0x2'));var jsonpatch=require(_0x76c4('0x3'));var rp=require(_0x76c4('0x4'));var moment=require(_0x76c4('0x5'));var BPromise=require(_0x76c4('0x6'));var Mustache=require('mustache');var util=require(_0x76c4('0x7'));var path=require(_0x76c4('0x8'));var sox=require(_0x76c4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76c4('0xa'));var _=require(_0x76c4('0xb'));var squel=require(_0x76c4('0xc'));var crypto=require(_0x76c4('0xd'));var jsforce=require(_0x76c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x76c4('0xf'));var querystring=require(_0x76c4('0x10'));var Papa=require(_0x76c4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x76c4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76c4('0x13'))('api');var utils=require(_0x76c4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x76c4('0x15'));var db=require(_0x76c4('0x16'))['db'];config[_0x76c4('0x17')]=_['defaults'](config[_0x76c4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x76c4('0x18'))(new Redis(config['redis']));require(_0x76c4('0x19'))[_0x76c4('0x1a')](socket);function respondWithStatusCode(_0x550412,_0x24a046){_0x24a046=_0x24a046||0xcc;return function(_0x2241d1){if(_0x2241d1){return _0x550412[_0x76c4('0x1b')](_0x24a046);}return _0x550412[_0x76c4('0x1c')](_0x24a046)[_0x76c4('0x1d')]();};}function respondWithResult(_0x142e46,_0x2a600e){_0x2a600e=_0x2a600e||0xc8;return function(_0x83192d){if(_0x83192d){return _0x142e46[_0x76c4('0x1c')](_0x2a600e)[_0x76c4('0x1e')](_0x83192d);}};}function respondWithFilteredResult(_0x36a79a,_0x58274a){return function(_0x14b73b){if(_0x14b73b){var _0x4513a9=typeof _0x58274a[_0x76c4('0x1f')]===_0x76c4('0x20')&&typeof _0x58274a[_0x76c4('0x21')]===_0x76c4('0x20');var _0xcdb931=_0x14b73b[_0x76c4('0x22')];var _0x1049bc=_0x4513a9?0x0:_0x58274a['offset'];var _0x233d3a=_0x4513a9?_0x14b73b[_0x76c4('0x22')]:_0x58274a['offset']+_0x58274a['limit'];var _0x197098;if(_0x233d3a>=_0xcdb931){_0x233d3a=_0xcdb931;_0x197098=0xc8;}else{_0x197098=0xce;}_0x36a79a[_0x76c4('0x1c')](_0x197098);return _0x36a79a[_0x76c4('0x23')](_0x76c4('0x24'),_0x1049bc+'-'+_0x233d3a+'/'+_0xcdb931)[_0x76c4('0x1e')](_0x14b73b);}return null;};}function patchUpdates(_0x213a7b){return function(_0x3f9b8d){try{jsonpatch['apply'](_0x3f9b8d,_0x213a7b,!![]);}catch(_0x56f1f0){return BPromise['reject'](_0x56f1f0);}return _0x3f9b8d[_0x76c4('0x25')]();};}function saveUpdates(_0x3bdc41,_0x3cfaba){return function(_0x433f9d){if(_0x433f9d){return _0x433f9d['update'](_0x3bdc41)[_0x76c4('0x26')](function(_0x330dc8){return _0x330dc8;});}return null;};}function removeEntity(_0x5ae3a1,_0x5ee78b){return function(_0x11323c){if(_0x11323c){return _0x11323c['destroy']()[_0x76c4('0x26')](function(){var _0x216a3a=_0x11323c[_0x76c4('0x27')]({'plain':!![]});var _0x32deb5=_0x76c4('0x28');return db['UserProfileResource'][_0x76c4('0x29')]({'where':{'type':_0x32deb5,'resourceId':_0x216a3a['id']}})[_0x76c4('0x26')](function(){return _0x11323c;});})[_0x76c4('0x26')](function(){_0x5ae3a1[_0x76c4('0x1c')](0xcc)[_0x76c4('0x1d')]();});}};}function handleEntityNotFound(_0x511482,_0x2374d1){return function(_0x3288d9){if(!_0x3288d9){_0x511482[_0x76c4('0x1b')](0x194);}return _0x3288d9;};}function handleError(_0x3a7e91,_0x3abe01){_0x3abe01=_0x3abe01||0x1f4;return function(_0xe50316){logger[_0x76c4('0x2a')](_0xe50316['stack']);if(_0xe50316['name']){delete _0xe50316[_0x76c4('0x2b')];}_0x3a7e91[_0x76c4('0x1c')](_0x3abe01)[_0x76c4('0x2c')](_0xe50316);};}exports['index']=function(_0x1a5365,_0x2c73d3){var _0x2c64d6={},_0x215045={},_0x20ae97={'count':0x0,'rows':[]};var _0x4df15f=_['map'](db[_0x76c4('0x2d')][_0x76c4('0x2e')],function(_0x391bd6){return{'name':_0x391bd6[_0x76c4('0x2f')],'type':_0x391bd6[_0x76c4('0x30')][_0x76c4('0x31')]};});_0x215045[_0x76c4('0x32')]=_['map'](_0x4df15f,_0x76c4('0x2b'));_0x215045['query']=_[_0x76c4('0x33')](_0x1a5365[_0x76c4('0x34')]);_0x215045[_0x76c4('0x35')]=_['intersection'](_0x215045[_0x76c4('0x32')],_0x215045['query']);_0x2c64d6[_0x76c4('0x36')]=_[_0x76c4('0x37')](_0x215045[_0x76c4('0x32')],qs['fields'](_0x1a5365['query'][_0x76c4('0x38')]));_0x2c64d6[_0x76c4('0x36')]=_0x2c64d6['attributes'][_0x76c4('0x39')]?_0x2c64d6[_0x76c4('0x36')]:_0x215045['model'];if(!_0x1a5365['query']['hasOwnProperty'](_0x76c4('0x3a'))){_0x2c64d6['limit']=qs[_0x76c4('0x21')](_0x1a5365[_0x76c4('0x34')][_0x76c4('0x21')]);_0x2c64d6[_0x76c4('0x1f')]=qs['offset'](_0x1a5365[_0x76c4('0x34')][_0x76c4('0x1f')]);}_0x2c64d6[_0x76c4('0x3b')]=qs[_0x76c4('0x3c')](_0x1a5365[_0x76c4('0x34')]['sort']);_0x2c64d6[_0x76c4('0x3d')]=qs['filters'](_[_0x76c4('0x3e')](_0x1a5365[_0x76c4('0x34')],_0x215045[_0x76c4('0x35')]),_0x4df15f);if(_0x1a5365[_0x76c4('0x34')]['filter']){_0x2c64d6[_0x76c4('0x3d')]=_[_0x76c4('0x3f')](_0x2c64d6[_0x76c4('0x3d')],{'$or':_['map'](_0x4df15f,function(_0x300ae6){if(_0x300ae6[_0x76c4('0x30')]!==_0x76c4('0x40')){var _0x122fce={};_0x122fce[_0x300ae6[_0x76c4('0x2b')]]={'$like':'%'+_0x1a5365['query'][_0x76c4('0x41')]+'%'};return _0x122fce;}})});}_0x2c64d6=_[_0x76c4('0x3f')]({},_0x2c64d6,_0x1a5365[_0x76c4('0x42')]);var _0xca04ee={'where':_0x2c64d6[_0x76c4('0x3d')]};return db[_0x76c4('0x2d')]['count'](_0xca04ee)[_0x76c4('0x26')](function(_0x4119d2){_0x20ae97[_0x76c4('0x22')]=_0x4119d2;if(_0x1a5365[_0x76c4('0x34')][_0x76c4('0x43')]){_0x2c64d6[_0x76c4('0x44')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x76c4('0x45')](_0x2c64d6);})[_0x76c4('0x26')](function(_0x454f5c){_0x20ae97[_0x76c4('0x46')]=_0x454f5c;return _0x20ae97;})[_0x76c4('0x26')](respondWithFilteredResult(_0x2c73d3,_0x2c64d6))[_0x76c4('0x47')](handleError(_0x2c73d3,null));};exports[_0x76c4('0x48')]=function(_0x4eaafb,_0x59f146){var _0x4c5a3a={'raw':!![],'where':{'id':_0x4eaafb[_0x76c4('0x49')]['id']}},_0x2a962a={};_0x2a962a['model']=_[_0x76c4('0x33')](db[_0x76c4('0x2d')][_0x76c4('0x2e')]);_0x2a962a[_0x76c4('0x34')]=_[_0x76c4('0x33')](_0x4eaafb['query']);_0x2a962a['filters']=_['intersection'](_0x2a962a[_0x76c4('0x32')],_0x2a962a[_0x76c4('0x34')]);_0x4c5a3a['attributes']=_['intersection'](_0x2a962a[_0x76c4('0x32')],qs[_0x76c4('0x38')](_0x4eaafb[_0x76c4('0x34')][_0x76c4('0x38')]));_0x4c5a3a[_0x76c4('0x36')]=_0x4c5a3a['attributes'][_0x76c4('0x39')]?_0x4c5a3a[_0x76c4('0x36')]:_0x2a962a['model'];if(_0x4eaafb['query']['includeAll']){_0x4c5a3a[_0x76c4('0x44')]=[{'all':!![]}];}_0x4c5a3a=_[_0x76c4('0x3f')]({},_0x4c5a3a,_0x4eaafb['options']);return db['WhatsappQueue'][_0x76c4('0x4a')](_0x4c5a3a)[_0x76c4('0x26')](handleEntityNotFound(_0x59f146,null))[_0x76c4('0x26')](respondWithResult(_0x59f146,null))[_0x76c4('0x47')](handleError(_0x59f146,null));};exports[_0x76c4('0x4b')]=function(_0xc7375a,_0x42027a){return db[_0x76c4('0x2d')][_0x76c4('0x4b')](_0xc7375a['body'],{})[_0x76c4('0x26')](function(_0x293fa3){var _0x13166f=_0xc7375a[_0x76c4('0x4c')][_0x76c4('0x27')]({'plain':!![]});if(!_0x13166f)throw new Error(_0x76c4('0x4d'));if(_0x13166f[_0x76c4('0x4e')]===_0x76c4('0x4c')){var _0xf0e310=_0x293fa3[_0x76c4('0x27')]({'plain':!![]});var _0x2774f5=_0x76c4('0x28');return db[_0x76c4('0x4f')][_0x76c4('0x4a')]({'where':{'name':_0x2774f5,'userProfileId':_0x13166f[_0x76c4('0x50')]},'raw':!![]})[_0x76c4('0x26')](function(_0x1d11df){if(_0x1d11df&&_0x1d11df[_0x76c4('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xf0e310[_0x76c4('0x2b')],'resourceId':_0xf0e310['id'],'type':_0x1d11df[_0x76c4('0x2b')],'sectionId':_0x1d11df['id']},{})[_0x76c4('0x26')](function(){return _0x293fa3;});}else{return _0x293fa3;}})[_0x76c4('0x47')](function(_0x260c55){logger[_0x76c4('0x2a')](_0x76c4('0x52'),_0x260c55);throw _0x260c55;});}return _0x293fa3;})[_0x76c4('0x26')](respondWithResult(_0x42027a,0xc9))[_0x76c4('0x47')](handleError(_0x42027a,null));};exports[_0x76c4('0x53')]=function(_0x16983b,_0x1a2b96){if(_0x16983b[_0x76c4('0x54')]['id']){delete _0x16983b[_0x76c4('0x54')]['id'];}return db[_0x76c4('0x2d')]['find']({'where':{'id':_0x16983b['params']['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x1a2b96,null))[_0x76c4('0x26')](saveUpdates(_0x16983b['body'],null))[_0x76c4('0x26')](respondWithResult(_0x1a2b96,null))['catch'](handleError(_0x1a2b96,null));};exports[_0x76c4('0x29')]=function(_0x2ec884,_0x243581){return db[_0x76c4('0x2d')][_0x76c4('0x4a')]({'where':{'id':_0x2ec884[_0x76c4('0x49')]['id']}})['then'](handleEntityNotFound(_0x243581,null))['then'](removeEntity(_0x243581,null))[_0x76c4('0x47')](handleError(_0x243581,null));};exports[_0x76c4('0x55')]=function(_0x524b00,_0xbd526d){return db[_0x76c4('0x2d')][_0x76c4('0x55')]()[_0x76c4('0x26')](respondWithResult(_0xbd526d,null))[_0x76c4('0x47')](handleError(_0xbd526d,null));};exports[_0x76c4('0x56')]=function(_0x383969,_0x412b7f,_0x1d26c1){var _0x2a788b={'raw':!![],'where':{}},_0xb68444={},_0x3e17f7;return db[_0x76c4('0x2d')][_0x76c4('0x57')]({'where':{'id':_0x383969[_0x76c4('0x49')]['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x412b7f,null))[_0x76c4('0x26')](function(_0x187f81){if(_0x187f81){_0x3e17f7=_0x187f81[_0x76c4('0x27')]({'plain':!![]});_0xb68444[_0x76c4('0x32')]=_['keys'](db[_0x76c4('0x58')][_0x76c4('0x2e')]);_0xb68444['query']=_[_0x76c4('0x33')](_0x383969[_0x76c4('0x34')]);_0xb68444['filters']=_[_0x76c4('0x37')](_0xb68444['model'],_0xb68444[_0x76c4('0x34')]);_0x2a788b['attributes']=_[_0x76c4('0x37')](_0xb68444[_0x76c4('0x32')],qs[_0x76c4('0x38')](_0x383969[_0x76c4('0x34')][_0x76c4('0x38')]));_0x2a788b[_0x76c4('0x36')]=_0x2a788b[_0x76c4('0x36')][_0x76c4('0x39')]?_0x2a788b[_0x76c4('0x36')]:_0xb68444['model'];if(!_0x383969[_0x76c4('0x34')][_0x76c4('0x59')]('nolimit')){_0x2a788b[_0x76c4('0x21')]=qs[_0x76c4('0x21')](_0x383969[_0x76c4('0x34')]['limit']);_0x2a788b['offset']=qs[_0x76c4('0x1f')](_0x383969[_0x76c4('0x34')][_0x76c4('0x1f')]);}_0x2a788b['order']=qs['sort'](_0x383969['query'][_0x76c4('0x3c')]);_0x2a788b['where']=qs['filters'](_[_0x76c4('0x3e')](_0x383969[_0x76c4('0x34')],_0xb68444['filters']));_0x2a788b[_0x76c4('0x3d')][_0x76c4('0x5a')]=_0x187f81['id'];if(_0x383969[_0x76c4('0x34')][_0x76c4('0x41')]){_0x2a788b['where']=_[_0x76c4('0x3f')](_0x2a788b[_0x76c4('0x3d')],{'$or':_[_0x76c4('0x5b')](_0x2a788b['attributes'],function(_0x54c8cd){var _0x9d6ebe={};_0x9d6ebe[_0x54c8cd]={'$like':'%'+_0x383969[_0x76c4('0x34')][_0x76c4('0x41')]+'%'};return _0x9d6ebe;})});}_0x2a788b=_[_0x76c4('0x3f')]({},_0x2a788b,_0x383969[_0x76c4('0x42')]);return db['UserWhatsappQueue']['findAll'](_0x2a788b);}})[_0x76c4('0x26')](function(_0x374549){if(_0x374549){return db[_0x76c4('0x5c')][_0x76c4('0x5d')]({'where':{'id':_[_0x76c4('0x5b')](_0x374549,'UserId'),'role':_0x76c4('0x5e')},'attributes':['id',_0x76c4('0x2b'),_0x76c4('0x5f'),_0x76c4('0x60'),_0x76c4('0x61')]});}})[_0x76c4('0x26')](function(_0x1c70a5){if(_0x1c70a5){return{'count':_0x1c70a5['count'],'rows':_['map'](_0x1c70a5[_0x76c4('0x46')],function(_0x27550e){return{'membername':_0x27550e[_0x76c4('0x2b')],'UserId':_0x27550e['id'],'queue_name':_0x3e17f7[_0x76c4('0x2b')],'WhatsappQueueId':_0x3e17f7['id'],'interface':util[_0x76c4('0x62')]('%s/%s',_0x76c4('0x63'),_0x27550e[_0x76c4('0x2b')]),'penalty':0x0,'paused':_0x27550e[_0x76c4('0x5f')],'createdAt':_0x27550e[_0x76c4('0x61')],'updatedAt':_0x27550e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x76c4('0x26')](respondWithFilteredResult(_0x412b7f,_0x2a788b))[_0x76c4('0x47')](handleError(_0x412b7f,null));};exports['getTeams']=function(_0x1946b2,_0x442aa0,_0x232cdc){var _0x20efdd={};var _0x15a6cb={};var _0x5bc6af;var _0x35a804;return db['WhatsappQueue'][_0x76c4('0x57')]({'where':{'id':_0x1946b2[_0x76c4('0x49')]['id']}})['then'](handleEntityNotFound(_0x442aa0,null))['then'](function(_0x2ceb67){if(_0x2ceb67){_0x5bc6af=_0x2ceb67;_0x15a6cb[_0x76c4('0x32')]=_['keys'](db['Team']['rawAttributes']);_0x15a6cb[_0x76c4('0x34')]=_[_0x76c4('0x33')](_0x1946b2['query']);_0x15a6cb[_0x76c4('0x35')]=_[_0x76c4('0x37')](_0x15a6cb[_0x76c4('0x32')],_0x15a6cb[_0x76c4('0x34')]);_0x20efdd['attributes']=_['intersection'](_0x15a6cb[_0x76c4('0x32')],qs[_0x76c4('0x38')](_0x1946b2['query'][_0x76c4('0x38')]));_0x20efdd[_0x76c4('0x36')]=_0x20efdd[_0x76c4('0x36')]['length']?_0x20efdd['attributes']:_0x15a6cb[_0x76c4('0x32')];_0x20efdd[_0x76c4('0x3b')]=qs[_0x76c4('0x3c')](_0x1946b2[_0x76c4('0x34')][_0x76c4('0x3c')]);_0x20efdd[_0x76c4('0x3d')]=qs[_0x76c4('0x35')](_[_0x76c4('0x3e')](_0x1946b2[_0x76c4('0x34')],_0x15a6cb['filters']));if(_0x1946b2[_0x76c4('0x34')][_0x76c4('0x41')]){_0x20efdd[_0x76c4('0x3d')]=_[_0x76c4('0x3f')](_0x20efdd[_0x76c4('0x3d')],{'$or':_['map'](_0x20efdd[_0x76c4('0x36')],function(_0x287c02){var _0xf93b26={};_0xf93b26[_0x287c02]={'$like':'%'+_0x1946b2['query'][_0x76c4('0x41')]+'%'};return _0xf93b26;})});}_0x20efdd=_[_0x76c4('0x3f')]({},_0x20efdd,_0x1946b2[_0x76c4('0x42')]);return _0x5bc6af['getTeams'](_0x20efdd);}})[_0x76c4('0x26')](function(_0x4e65b4){if(_0x4e65b4){_0x35a804=_0x4e65b4['length'];if(!_0x1946b2[_0x76c4('0x34')][_0x76c4('0x59')](_0x76c4('0x3a'))){_0x20efdd[_0x76c4('0x21')]=qs['limit'](_0x1946b2['query'][_0x76c4('0x21')]);_0x20efdd[_0x76c4('0x1f')]=qs[_0x76c4('0x1f')](_0x1946b2[_0x76c4('0x34')][_0x76c4('0x1f')]);}return _0x5bc6af['getTeams'](_0x20efdd);}})['then'](function(_0x5b6a7c){if(_0x5b6a7c){return _0x5b6a7c?{'count':_0x35a804,'rows':_0x5b6a7c}:null;}})[_0x76c4('0x26')](respondWithResult(_0x442aa0,null))[_0x76c4('0x47')](handleError(_0x442aa0,null));};exports[_0x76c4('0x64')]=function(_0x3d7054,_0xce32ca,_0x40fda0){var _0x41edf3=_0x3d7054['body'][_0x76c4('0x65')];return db['Team'][_0x76c4('0x45')]({'where':{'id':_0x41edf3},'attributes':['id'],'include':[{'model':db[_0x76c4('0x5c')],'as':'Agents','attributes':['id',_0x76c4('0x2b'),_0x76c4('0x66'),_0x76c4('0x67'),'interface'],'raw':!![]}]})[_0x76c4('0x26')](function(_0x42eca6){if(_0x42eca6){var _0x133f42=_[_0x76c4('0x68')](_0x42eca6,function(_0x2db555){var _0x4e2323=_0x2db555[_0x76c4('0x27')]({'plain':!![]});return _0x4e2323[_0x76c4('0x69')];});return db[_0x76c4('0x2d')][_0x76c4('0x4a')]({'where':{'id':_0x3d7054[_0x76c4('0x49')]['id']}})['then'](function(_0xda8d4b){return db[_0x76c4('0x6a')][_0x76c4('0x6b')](function(_0x12f5a1){return _0xda8d4b['addTeams'](_0x41edf3,{'transaction':_0x12f5a1})[_0x76c4('0x26')](function(){return BPromise[_0x76c4('0x6c')](_0x133f42,function(_0x48e7de){return db[_0x76c4('0x58')][_0x76c4('0x6d')]({'where':{'UserId':_0x48e7de['id'],'WhatsappQueueId':_0x3d7054[_0x76c4('0x49')]['id']},'transaction':_0x12f5a1});});})[_0x76c4('0x26')](function(){_0x133f42['forEach'](function(_0x181564){socket[_0x76c4('0x6e')](_0x76c4('0x6f'),{'UserId':_0x181564['id'],'WhatsappQueueId':_0xda8d4b['id']});});});});});}})['then'](respondWithStatusCode(_0xce32ca,null))[_0x76c4('0x47')](handleError(_0xce32ca,null));};exports[_0x76c4('0x70')]=function(_0x26a490,_0x556822,_0x9ef70a){return db['Team'][_0x76c4('0x45')]({'where':{'id':_0x26a490['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x76c4('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x556822,null))[_0x76c4('0x26')](function(_0x492ee6){var _0x26f7a4=_[_0x76c4('0x5b')](_0x492ee6,'id');var _0x1c505b=[];var _0x375f09=[];var _0x3de810=squel[_0x76c4('0x71')]();_0x3de810[_0x76c4('0x72')](_0x76c4('0x73'))[_0x76c4('0x74')](_0x76c4('0x75'),'tq')[_0x76c4('0x76')](_0x76c4('0x77'),'ut',_0x76c4('0x78'))[_0x76c4('0x3d')](_0x76c4('0x79'),_0x26a490[_0x76c4('0x49')]['id']);for(var _0x221cf1=0x0;_0x221cf1<_0x492ee6[_0x76c4('0x39')];_0x221cf1+=0x1){let _0x240aaf=_0x492ee6[_0x221cf1];for(var _0x30fad7=0x0;_0x30fad7<_0x240aaf[_0x76c4('0x69')][_0x76c4('0x39')];_0x30fad7+=0x1){let _0x322183=_0x240aaf['Agents'][_0x30fad7];var _0x4beddc=_0x3de810[_0x76c4('0x7a')]();_0x4beddc[_0x76c4('0x3d')](_0x76c4('0x7b'),_0x322183['id']);_0x375f09['push'](db[_0x76c4('0x6a')][_0x76c4('0x34')](_0x4beddc[_0x76c4('0x7c')](),{'type':db[_0x76c4('0x6a')][_0x76c4('0x7d')][_0x76c4('0x7e')]})[_0x76c4('0x26')](function(_0x4fb1a5){if(_0x4fb1a5[_0x76c4('0x39')]===0x1){return _0x322183['id'];}else{var _0x1fe44b=_['every'](_[_0x76c4('0x5b')](_0x4fb1a5,_0x76c4('0x7f')),function(_0x3f600c){return _[_0x76c4('0x80')](_0x26f7a4,_0x3f600c);});if(_0x1fe44b){return _0x322183['id'];}}}));}}return BPromise[_0x76c4('0x81')](_0x375f09)[_0x76c4('0x26')](function(_0x57edd7){_0x1c505b=_(_0x1c505b)[_0x76c4('0x82')](_0x57edd7)['compact']()[_0x76c4('0x83')]();return db['WhatsappQueue'][_0x76c4('0x4a')]({'where':{'id':_0x26a490[_0x76c4('0x49')]['id']}})[_0x76c4('0x26')](function(_0x268693){return db[_0x76c4('0x6a')][_0x76c4('0x6b')](function(_0x317733){return _0x268693[_0x76c4('0x70')](_0x26a490[_0x76c4('0x34')]['ids'],{'transaction':_0x317733})[_0x76c4('0x26')](function(){if(!_[_0x76c4('0x84')](_0x1c505b)){return _0x268693[_0x76c4('0x85')](_0x1c505b,{'transaction':_0x317733});}})[_0x76c4('0x26')](function(){_0x1c505b['forEach'](function(_0x10596a){socket['emit'](_0x76c4('0x86'),{'UserId':_0x10596a,'WhatsappQueueId':_0x268693['id']});});});});});});})[_0x76c4('0x26')](respondWithStatusCode(_0x556822,null))[_0x76c4('0x47')](handleError(_0x556822,null));};exports[_0x76c4('0x87')]=function(_0x2b8925,_0x6290ec,_0x594dfe){return db[_0x76c4('0x2d')][_0x76c4('0x4a')]({'where':{'id':_0x2b8925['params']['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x6290ec,null))[_0x76c4('0x26')](function(_0x494077){if(_0x494077){return _0x494077[_0x76c4('0x87')](_0x2b8925['body']['ids'],_[_0x76c4('0x88')](_0x2b8925[_0x76c4('0x54')],['ids','id'])||{})[_0x76c4('0x89')](function(_0x4c7ee6){for(var _0x1c804d=0x0;_0x1c804d<_0x2b8925[_0x76c4('0x54')][_0x76c4('0x65')][_0x76c4('0x39')];_0x1c804d+=0x1){socket[_0x76c4('0x6e')]('userWhatsappQueue:save',{'UserId':Number(_0x2b8925['body'][_0x76c4('0x65')][_0x1c804d]),'WhatsappQueueId':Number(_0x2b8925['params']['id'])});}return _0x4c7ee6;});}})[_0x76c4('0x26')](respondWithResult(_0x6290ec,null))[_0x76c4('0x47')](handleError(_0x6290ec,null));};exports['removeAgents']=function(_0x1f8862,_0x409645,_0x244ff7){return db[_0x76c4('0x2d')][_0x76c4('0x4a')]({'where':{'id':_0x1f8862['params']['id']}})['then'](handleEntityNotFound(_0x409645,null))[_0x76c4('0x26')](function(_0x3a375a){if(_0x3a375a){return _0x3a375a[_0x76c4('0x85')](_0x1f8862[_0x76c4('0x34')][_0x76c4('0x65')])[_0x76c4('0x26')](function(){if(_[_0x76c4('0x8a')](_0x1f8862[_0x76c4('0x34')][_0x76c4('0x65')])){for(var _0x1d8f25=0x0;_0x1d8f25<_0x1f8862['query'][_0x76c4('0x65')][_0x76c4('0x39')];_0x1d8f25+=0x1){socket[_0x76c4('0x6e')](_0x76c4('0x86'),{'UserId':Number(_0x1f8862[_0x76c4('0x34')][_0x76c4('0x65')][_0x1d8f25]),'WhatsappQueueId':Number(_0x1f8862[_0x76c4('0x49')]['id'])});}}else{socket[_0x76c4('0x6e')](_0x76c4('0x86'),{'UserId':Number(_0x1f8862[_0x76c4('0x34')][_0x76c4('0x65')]),'WhatsappQueueId':Number(_0x1f8862[_0x76c4('0x49')]['id'])});}});}})[_0x76c4('0x26')](respondWithStatusCode(_0x409645,null))[_0x76c4('0x47')](handleError(_0x409645,null));};exports[_0x76c4('0x8b')]=function(_0x3c0a58,_0x36aa6a,_0x288d5f){var _0x418b26={};var _0x78aa12={};var _0xbcfac1;var _0xc3e593;return db[_0x76c4('0x2d')][_0x76c4('0x57')]({'where':{'id':_0x3c0a58[_0x76c4('0x49')]['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x36aa6a,null))[_0x76c4('0x26')](function(_0x407fe2){if(_0x407fe2){_0xbcfac1=_0x407fe2;_0x78aa12[_0x76c4('0x32')]=_[_0x76c4('0x33')](db[_0x76c4('0x5c')]['rawAttributes']);_0x78aa12[_0x76c4('0x34')]=_[_0x76c4('0x33')](_0x3c0a58['query']);_0x78aa12['filters']=_['intersection'](_0x78aa12[_0x76c4('0x32')],_0x78aa12[_0x76c4('0x34')]);_0x418b26['attributes']=_['intersection'](_0x78aa12[_0x76c4('0x32')],qs[_0x76c4('0x38')](_0x3c0a58['query'][_0x76c4('0x38')]));_0x418b26[_0x76c4('0x36')]=_0x418b26[_0x76c4('0x36')][_0x76c4('0x39')]?_0x418b26[_0x76c4('0x36')]:_0x78aa12['model'];_0x418b26['order']=qs[_0x76c4('0x3c')](_0x3c0a58[_0x76c4('0x34')][_0x76c4('0x3c')]);_0x418b26[_0x76c4('0x3d')]=qs['filters'](_['pick'](_0x3c0a58[_0x76c4('0x34')],_0x78aa12['filters']));if(_0x3c0a58['query'][_0x76c4('0x41')]){_0x418b26[_0x76c4('0x3d')]=_['merge'](_0x418b26[_0x76c4('0x3d')],{'$or':_[_0x76c4('0x5b')](_0x418b26[_0x76c4('0x36')],function(_0x5ee0b5){var _0x4cb8c8={};_0x4cb8c8[_0x5ee0b5]={'$like':'%'+_0x3c0a58['query'][_0x76c4('0x41')]+'%'};return _0x4cb8c8;})});}_0x418b26=_[_0x76c4('0x3f')]({},_0x418b26,_0x3c0a58['options']);return _0xbcfac1['getAgents'](_0x418b26);}})[_0x76c4('0x26')](function(_0x4d8b73){if(_0x4d8b73){_0xc3e593=_0x4d8b73[_0x76c4('0x39')];if(!_0x3c0a58[_0x76c4('0x34')][_0x76c4('0x59')](_0x76c4('0x3a'))){_0x418b26['limit']=qs[_0x76c4('0x21')](_0x3c0a58[_0x76c4('0x34')][_0x76c4('0x21')]);_0x418b26[_0x76c4('0x1f')]=qs[_0x76c4('0x1f')](_0x3c0a58[_0x76c4('0x34')][_0x76c4('0x1f')]);}return _0xbcfac1[_0x76c4('0x8b')](_0x418b26);}})[_0x76c4('0x26')](function(_0x5ce977){if(_0x5ce977){return _0x5ce977?{'count':_0xc3e593,'rows':_0x5ce977}:null;}})[_0x76c4('0x26')](respondWithResult(_0x36aa6a,null))[_0x76c4('0x47')](handleError(_0x36aa6a,null));}; \ No newline at end of file +var _0x5e87=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','WhatsappQueues','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','rows','catch','params','filters','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','UserWhatsappQueue','findAll','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','union','value','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','status','end','json','offset'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x5e87,0x179));var _0x75e8=function(_0x4b624b,_0x39bd6b){_0x4b624b=_0x4b624b-0x0;var _0xa55bcc=_0x5e87[_0x4b624b];return _0xa55bcc;};'use strict';var emlformat=require(_0x75e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75e8('0x1'));var rp=require('request-promise');var moment=require(_0x75e8('0x2'));var BPromise=require(_0x75e8('0x3'));var Mustache=require(_0x75e8('0x4'));var util=require(_0x75e8('0x5'));var path=require('path');var sox=require(_0x75e8('0x6'));var csv=require(_0x75e8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75e8('0x8'));var _=require(_0x75e8('0x9'));var squel=require('squel');var crypto=require(_0x75e8('0xa'));var jsforce=require(_0x75e8('0xb'));var deskjs=require(_0x75e8('0xc'));var toCsv=require(_0x75e8('0x7'));var querystring=require(_0x75e8('0xd'));var Papa=require(_0x75e8('0xe'));var Redis=require('ioredis');var authService=require(_0x75e8('0xf'));var qs=require(_0x75e8('0x10'));var as=require(_0x75e8('0x11'));var hardwareService=require(_0x75e8('0x12'));var logger=require('../../config/logger')(_0x75e8('0x13'));var utils=require(_0x75e8('0x14'));var config=require(_0x75e8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x75e8('0x16'))['db'];config[_0x75e8('0x17')]=_[_0x75e8('0x18')](config[_0x75e8('0x17')],{'host':_0x75e8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x75e8('0x1a'))['register'](socket);function respondWithStatusCode(_0x1ea7af,_0x402cd2){_0x402cd2=_0x402cd2||0xcc;return function(_0x1ebfd0){if(_0x1ebfd0){return _0x1ea7af['sendStatus'](_0x402cd2);}return _0x1ea7af[_0x75e8('0x1b')](_0x402cd2)[_0x75e8('0x1c')]();};}function respondWithResult(_0x35ce3e,_0x571cc5){_0x571cc5=_0x571cc5||0xc8;return function(_0x223768){if(_0x223768){return _0x35ce3e[_0x75e8('0x1b')](_0x571cc5)[_0x75e8('0x1d')](_0x223768);}};}function respondWithFilteredResult(_0x3c9e65,_0x11c071){return function(_0x24a75f){if(_0x24a75f){var _0x479438=typeof _0x11c071[_0x75e8('0x1e')]===_0x75e8('0x1f')&&typeof _0x11c071[_0x75e8('0x20')]===_0x75e8('0x1f');var _0x3e255e=_0x24a75f['count'];var _0x3d62e8=_0x479438?0x0:_0x11c071['offset'];var _0x15f216=_0x479438?_0x24a75f[_0x75e8('0x21')]:_0x11c071['offset']+_0x11c071[_0x75e8('0x20')];var _0x67d7c3;if(_0x15f216>=_0x3e255e){_0x15f216=_0x3e255e;_0x67d7c3=0xc8;}else{_0x67d7c3=0xce;}_0x3c9e65['status'](_0x67d7c3);return _0x3c9e65[_0x75e8('0x22')](_0x75e8('0x23'),_0x3d62e8+'-'+_0x15f216+'/'+_0x3e255e)[_0x75e8('0x1d')](_0x24a75f);}return null;};}function patchUpdates(_0x33c9f8){return function(_0x53e407){try{jsonpatch[_0x75e8('0x24')](_0x53e407,_0x33c9f8,!![]);}catch(_0x136d62){return BPromise['reject'](_0x136d62);}return _0x53e407['save']();};}function saveUpdates(_0x1ebdc9,_0x26bb6b){return function(_0x4e1128){if(_0x4e1128){return _0x4e1128[_0x75e8('0x25')](_0x1ebdc9)[_0x75e8('0x26')](function(_0x45c697){return _0x45c697;});}return null;};}function removeEntity(_0x2fac73,_0x322bd3){return function(_0x31cc63){if(_0x31cc63){return _0x31cc63[_0x75e8('0x27')]()['then'](function(){var _0x291008=_0x31cc63[_0x75e8('0x28')]({'plain':!![]});var _0x386456=_0x75e8('0x29');return db['UserProfileResource'][_0x75e8('0x27')]({'where':{'type':_0x386456,'resourceId':_0x291008['id']}})[_0x75e8('0x26')](function(){return _0x31cc63;});})[_0x75e8('0x26')](function(){_0x2fac73['status'](0xcc)[_0x75e8('0x1c')]();});}};}function handleEntityNotFound(_0x32f19f,_0x438b7f){return function(_0x242075){if(!_0x242075){_0x32f19f['sendStatus'](0x194);}return _0x242075;};}function handleError(_0x3fd47b,_0x7b68e6){_0x7b68e6=_0x7b68e6||0x1f4;return function(_0x101eac){logger[_0x75e8('0x2a')](_0x101eac[_0x75e8('0x2b')]);if(_0x101eac['name']){delete _0x101eac[_0x75e8('0x2c')];}_0x3fd47b['status'](_0x7b68e6)['send'](_0x101eac);};}exports[_0x75e8('0x2d')]=function(_0x479a89,_0x1ece63){var _0x2d97ed={},_0x1f171d={},_0x2e9318={'count':0x0,'rows':[]};var _0x246da6=_[_0x75e8('0x2e')](db[_0x75e8('0x2f')][_0x75e8('0x30')],function(_0x515314){return{'name':_0x515314[_0x75e8('0x31')],'type':_0x515314[_0x75e8('0x32')][_0x75e8('0x33')]};});_0x1f171d[_0x75e8('0x34')]=_['map'](_0x246da6,_0x75e8('0x2c'));_0x1f171d['query']=_[_0x75e8('0x35')](_0x479a89[_0x75e8('0x36')]);_0x1f171d['filters']=_[_0x75e8('0x37')](_0x1f171d[_0x75e8('0x34')],_0x1f171d['query']);_0x2d97ed[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0x1f171d['model'],qs[_0x75e8('0x39')](_0x479a89[_0x75e8('0x36')][_0x75e8('0x39')]));_0x2d97ed[_0x75e8('0x38')]=_0x2d97ed[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x2d97ed[_0x75e8('0x38')]:_0x1f171d[_0x75e8('0x34')];if(!_0x479a89[_0x75e8('0x36')][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x2d97ed[_0x75e8('0x20')]=qs[_0x75e8('0x20')](_0x479a89[_0x75e8('0x36')][_0x75e8('0x20')]);_0x2d97ed[_0x75e8('0x1e')]=qs['offset'](_0x479a89[_0x75e8('0x36')][_0x75e8('0x1e')]);}_0x2d97ed[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x479a89[_0x75e8('0x36')]['sort']);_0x2d97ed['where']=qs['filters'](_[_0x75e8('0x3f')](_0x479a89[_0x75e8('0x36')],_0x1f171d['filters']),_0x246da6);if(_0x479a89[_0x75e8('0x36')]['filter']){_0x2d97ed[_0x75e8('0x40')]=_[_0x75e8('0x41')](_0x2d97ed[_0x75e8('0x40')],{'$or':_['map'](_0x246da6,function(_0x568e3a){if(_0x568e3a['type']!=='VIRTUAL'){var _0x21f3bd={};_0x21f3bd[_0x568e3a[_0x75e8('0x2c')]]={'$like':'%'+_0x479a89[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x21f3bd;}})});}_0x2d97ed=_[_0x75e8('0x41')]({},_0x2d97ed,_0x479a89[_0x75e8('0x43')]);var _0x4b4f56={'where':_0x2d97ed[_0x75e8('0x40')]};return db[_0x75e8('0x2f')][_0x75e8('0x21')](_0x4b4f56)[_0x75e8('0x26')](function(_0x23ca0b){_0x2e9318['count']=_0x23ca0b;if(_0x479a89[_0x75e8('0x36')][_0x75e8('0x44')]){_0x2d97ed[_0x75e8('0x45')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x2d97ed);})['then'](function(_0x443278){_0x2e9318[_0x75e8('0x46')]=_0x443278;return _0x2e9318;})['then'](respondWithFilteredResult(_0x1ece63,_0x2d97ed))[_0x75e8('0x47')](handleError(_0x1ece63,null));};exports['show']=function(_0x4f1fc6,_0x295cc7){var _0x55f95f={'raw':!![],'where':{'id':_0x4f1fc6[_0x75e8('0x48')]['id']}},_0x47292b={};_0x47292b[_0x75e8('0x34')]=_[_0x75e8('0x35')](db[_0x75e8('0x2f')][_0x75e8('0x30')]);_0x47292b[_0x75e8('0x36')]=_[_0x75e8('0x35')](_0x4f1fc6[_0x75e8('0x36')]);_0x47292b[_0x75e8('0x49')]=_['intersection'](_0x47292b['model'],_0x47292b['query']);_0x55f95f[_0x75e8('0x38')]=_['intersection'](_0x47292b[_0x75e8('0x34')],qs[_0x75e8('0x39')](_0x4f1fc6[_0x75e8('0x36')][_0x75e8('0x39')]));_0x55f95f[_0x75e8('0x38')]=_0x55f95f[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x55f95f[_0x75e8('0x38')]:_0x47292b[_0x75e8('0x34')];if(_0x4f1fc6['query']['includeAll']){_0x55f95f[_0x75e8('0x45')]=[{'all':!![]}];}_0x55f95f=_[_0x75e8('0x41')]({},_0x55f95f,_0x4f1fc6[_0x75e8('0x43')]);return db[_0x75e8('0x2f')][_0x75e8('0x4a')](_0x55f95f)['then'](handleEntityNotFound(_0x295cc7,null))[_0x75e8('0x26')](respondWithResult(_0x295cc7,null))['catch'](handleError(_0x295cc7,null));};exports[_0x75e8('0x4b')]=function(_0x4a7a1c,_0x42a3e8){return db[_0x75e8('0x2f')][_0x75e8('0x4b')](_0x4a7a1c[_0x75e8('0x4c')],{})['then'](function(_0x4249ba){var _0x4a42bb=_0x4a7a1c[_0x75e8('0x4d')][_0x75e8('0x28')]({'plain':!![]});if(!_0x4a42bb)throw new Error(_0x75e8('0x4e'));if(_0x4a42bb[_0x75e8('0x4f')]===_0x75e8('0x4d')){var _0x1594de=_0x4249ba[_0x75e8('0x28')]({'plain':!![]});var _0x5ed0f7=_0x75e8('0x29');return db[_0x75e8('0x50')]['find']({'where':{'name':_0x5ed0f7,'userProfileId':_0x4a42bb['userProfileId']},'raw':!![]})[_0x75e8('0x26')](function(_0x2f29ee){if(_0x2f29ee&&_0x2f29ee[_0x75e8('0x51')]===0x0){return db['UserProfileResource'][_0x75e8('0x4b')]({'name':_0x1594de[_0x75e8('0x2c')],'resourceId':_0x1594de['id'],'type':_0x2f29ee['name'],'sectionId':_0x2f29ee['id']},{})[_0x75e8('0x26')](function(){return _0x4249ba;});}else{return _0x4249ba;}})[_0x75e8('0x47')](function(_0x32659d){logger[_0x75e8('0x2a')](_0x75e8('0x52'),_0x32659d);throw _0x32659d;});}return _0x4249ba;})[_0x75e8('0x26')](respondWithResult(_0x42a3e8,0xc9))[_0x75e8('0x47')](handleError(_0x42a3e8,null));};exports[_0x75e8('0x25')]=function(_0x394999,_0x5c7a30){if(_0x394999['body']['id']){delete _0x394999[_0x75e8('0x4c')]['id'];}return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x394999['params']['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x5c7a30,null))['then'](saveUpdates(_0x394999['body'],null))[_0x75e8('0x26')](respondWithResult(_0x5c7a30,null))[_0x75e8('0x47')](handleError(_0x5c7a30,null));};exports['destroy']=function(_0x16c611,_0xae0fcc){return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x16c611[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0xae0fcc,null))[_0x75e8('0x26')](removeEntity(_0xae0fcc,null))[_0x75e8('0x47')](handleError(_0xae0fcc,null));};exports[_0x75e8('0x53')]=function(_0x1406e8,_0x399d36){return db[_0x75e8('0x2f')][_0x75e8('0x53')]()[_0x75e8('0x26')](respondWithResult(_0x399d36,null))['catch'](handleError(_0x399d36,null));};exports[_0x75e8('0x54')]=function(_0x11876f,_0x545ae7,_0x57f8f2){var _0x114da9={'raw':!![],'where':{}},_0xa3432f={},_0x4d6bbf;return db[_0x75e8('0x2f')][_0x75e8('0x55')]({'where':{'id':_0x11876f[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x545ae7,null))['then'](function(_0x112515){if(_0x112515){_0x4d6bbf=_0x112515[_0x75e8('0x28')]({'plain':!![]});_0xa3432f[_0x75e8('0x34')]=_[_0x75e8('0x35')](db[_0x75e8('0x56')]['rawAttributes']);_0xa3432f['query']=_['keys'](_0x11876f[_0x75e8('0x36')]);_0xa3432f[_0x75e8('0x49')]=_['intersection'](_0xa3432f['model'],_0xa3432f[_0x75e8('0x36')]);_0x114da9[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0xa3432f['model'],qs['fields'](_0x11876f['query'][_0x75e8('0x39')]));_0x114da9[_0x75e8('0x38')]=_0x114da9['attributes'][_0x75e8('0x3a')]?_0x114da9[_0x75e8('0x38')]:_0xa3432f['model'];if(!_0x11876f['query'][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x114da9['limit']=qs[_0x75e8('0x20')](_0x11876f['query'][_0x75e8('0x20')]);_0x114da9['offset']=qs[_0x75e8('0x1e')](_0x11876f[_0x75e8('0x36')]['offset']);}_0x114da9['order']=qs[_0x75e8('0x3e')](_0x11876f[_0x75e8('0x36')]['sort']);_0x114da9['where']=qs[_0x75e8('0x49')](_[_0x75e8('0x3f')](_0x11876f['query'],_0xa3432f[_0x75e8('0x49')]));_0x114da9[_0x75e8('0x40')]['WhatsappQueueId']=_0x112515['id'];if(_0x11876f[_0x75e8('0x36')]['filter']){_0x114da9[_0x75e8('0x40')]=_[_0x75e8('0x41')](_0x114da9['where'],{'$or':_[_0x75e8('0x2e')](_0x114da9['attributes'],function(_0xab76e7){var _0x2fb5a0={};_0x2fb5a0[_0xab76e7]={'$like':'%'+_0x11876f[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x2fb5a0;})});}_0x114da9=_[_0x75e8('0x41')]({},_0x114da9,_0x11876f[_0x75e8('0x43')]);return db[_0x75e8('0x56')][_0x75e8('0x57')](_0x114da9);}})[_0x75e8('0x26')](function(_0x44f967){if(_0x44f967){return db[_0x75e8('0x58')][_0x75e8('0x59')]({'where':{'id':_['map'](_0x44f967,_0x75e8('0x5a')),'role':'agent'},'attributes':['id',_0x75e8('0x2c'),_0x75e8('0x5b'),_0x75e8('0x5c'),_0x75e8('0x5d')]});}})['then'](function(_0x2137ac){if(_0x2137ac){return{'count':_0x2137ac[_0x75e8('0x21')],'rows':_[_0x75e8('0x2e')](_0x2137ac['rows'],function(_0x3181c6){return{'membername':_0x3181c6[_0x75e8('0x2c')],'UserId':_0x3181c6['id'],'queue_name':_0x4d6bbf[_0x75e8('0x2c')],'WhatsappQueueId':_0x4d6bbf['id'],'interface':util[_0x75e8('0x5e')](_0x75e8('0x5f'),_0x75e8('0x60'),_0x3181c6[_0x75e8('0x2c')]),'penalty':0x0,'paused':_0x3181c6[_0x75e8('0x5b')],'createdAt':_0x3181c6[_0x75e8('0x5d')],'updatedAt':_0x3181c6[_0x75e8('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x75e8('0x26')](respondWithFilteredResult(_0x545ae7,_0x114da9))[_0x75e8('0x47')](handleError(_0x545ae7,null));};exports[_0x75e8('0x61')]=function(_0x34d89b,_0x184caa,_0x367a6c){var _0x312ce8={};var _0x3820fa={};var _0x4d3ca8;var _0x341d60;return db[_0x75e8('0x2f')][_0x75e8('0x55')]({'where':{'id':_0x34d89b[_0x75e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x184caa,null))[_0x75e8('0x26')](function(_0x1fe780){if(_0x1fe780){_0x4d3ca8=_0x1fe780;_0x3820fa['model']=_[_0x75e8('0x35')](db[_0x75e8('0x62')][_0x75e8('0x30')]);_0x3820fa['query']=_[_0x75e8('0x35')](_0x34d89b[_0x75e8('0x36')]);_0x3820fa[_0x75e8('0x49')]=_[_0x75e8('0x37')](_0x3820fa['model'],_0x3820fa[_0x75e8('0x36')]);_0x312ce8['attributes']=_[_0x75e8('0x37')](_0x3820fa['model'],qs[_0x75e8('0x39')](_0x34d89b[_0x75e8('0x36')][_0x75e8('0x39')]));_0x312ce8[_0x75e8('0x38')]=_0x312ce8[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x312ce8['attributes']:_0x3820fa[_0x75e8('0x34')];_0x312ce8[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x34d89b[_0x75e8('0x36')][_0x75e8('0x3e')]);_0x312ce8[_0x75e8('0x40')]=qs[_0x75e8('0x49')](_[_0x75e8('0x3f')](_0x34d89b[_0x75e8('0x36')],_0x3820fa[_0x75e8('0x49')]));if(_0x34d89b['query'][_0x75e8('0x42')]){_0x312ce8['where']=_[_0x75e8('0x41')](_0x312ce8[_0x75e8('0x40')],{'$or':_['map'](_0x312ce8[_0x75e8('0x38')],function(_0x3ac8e7){var _0x8a21ad={};_0x8a21ad[_0x3ac8e7]={'$like':'%'+_0x34d89b['query'][_0x75e8('0x42')]+'%'};return _0x8a21ad;})});}_0x312ce8=_[_0x75e8('0x41')]({},_0x312ce8,_0x34d89b[_0x75e8('0x43')]);return _0x4d3ca8['getTeams'](_0x312ce8);}})['then'](function(_0x2719c8){if(_0x2719c8){_0x341d60=_0x2719c8['length'];if(!_0x34d89b['query'][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x312ce8[_0x75e8('0x20')]=qs[_0x75e8('0x20')](_0x34d89b[_0x75e8('0x36')]['limit']);_0x312ce8[_0x75e8('0x1e')]=qs['offset'](_0x34d89b[_0x75e8('0x36')]['offset']);}return _0x4d3ca8[_0x75e8('0x61')](_0x312ce8);}})[_0x75e8('0x26')](function(_0x4e4619){if(_0x4e4619){return _0x4e4619?{'count':_0x341d60,'rows':_0x4e4619}:null;}})[_0x75e8('0x26')](respondWithResult(_0x184caa,null))[_0x75e8('0x47')](handleError(_0x184caa,null));};exports[_0x75e8('0x63')]=function(_0x247b77,_0x489369,_0x591d33){var _0x38ad61=_0x247b77[_0x75e8('0x4c')][_0x75e8('0x64')];return db['Team'][_0x75e8('0x57')]({'where':{'id':_0x38ad61},'attributes':['id'],'include':[{'model':db[_0x75e8('0x58')],'as':_0x75e8('0x65'),'attributes':['id',_0x75e8('0x2c'),_0x75e8('0x66'),'voicePause',_0x75e8('0x67')],'raw':!![]}]})[_0x75e8('0x26')](function(_0x2e48d6){if(_0x2e48d6){var _0x501c10=_[_0x75e8('0x68')](_0x2e48d6,function(_0x3763b8){var _0x2804a8=_0x3763b8[_0x75e8('0x28')]({'plain':!![]});return _0x2804a8['Agents'];});return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x247b77[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](function(_0x125bb1){return db['sequelize'][_0x75e8('0x69')](function(_0x17166a){return _0x125bb1[_0x75e8('0x63')](_0x38ad61,{'transaction':_0x17166a})[_0x75e8('0x26')](function(){return BPromise[_0x75e8('0x6a')](_0x501c10,function(_0x13c7e7){return db[_0x75e8('0x56')][_0x75e8('0x6b')]({'where':{'UserId':_0x13c7e7['id'],'WhatsappQueueId':_0x247b77[_0x75e8('0x48')]['id']},'transaction':_0x17166a});});})[_0x75e8('0x26')](function(){_0x501c10[_0x75e8('0x6c')](function(_0x571929){socket[_0x75e8('0x6d')]('userWhatsappQueue:save',{'UserId':_0x571929['id'],'WhatsappQueueId':_0x125bb1['id']});});});});});}})[_0x75e8('0x26')](respondWithStatusCode(_0x489369,null))['catch'](handleError(_0x489369,null));};exports[_0x75e8('0x6e')]=function(_0x478edc,_0x6b8bba,_0x4a3868){return db[_0x75e8('0x62')][_0x75e8('0x57')]({'where':{'id':_0x478edc[_0x75e8('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x75e8('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6b8bba,null))[_0x75e8('0x26')](function(_0x127e39){var _0x49836b=_['map'](_0x127e39,'id');var _0x5f1613=[];var _0x5ec4d1=[];var _0x49cb17=squel[_0x75e8('0x6f')]();_0x49cb17['field'](_0x75e8('0x70'))[_0x75e8('0x71')]('team_has_whatsapp_queues','tq')[_0x75e8('0x72')](_0x75e8('0x73'),'ut',_0x75e8('0x74'))[_0x75e8('0x40')](_0x75e8('0x75'),_0x478edc[_0x75e8('0x48')]['id']);for(var _0x3570fb=0x0;_0x3570fb<_0x127e39[_0x75e8('0x3a')];_0x3570fb+=0x1){let _0x122c42=_0x127e39[_0x3570fb];for(var _0x53a046=0x0;_0x53a046<_0x122c42[_0x75e8('0x65')][_0x75e8('0x3a')];_0x53a046+=0x1){let _0x342769=_0x122c42[_0x75e8('0x65')][_0x53a046];var _0x2e26a1=_0x49cb17[_0x75e8('0x76')]();_0x2e26a1[_0x75e8('0x40')](_0x75e8('0x77'),_0x342769['id']);_0x5ec4d1['push'](db[_0x75e8('0x78')][_0x75e8('0x36')](_0x2e26a1[_0x75e8('0x79')](),{'type':db['sequelize'][_0x75e8('0x7a')][_0x75e8('0x7b')]})[_0x75e8('0x26')](function(_0x3e343c){if(_0x3e343c[_0x75e8('0x3a')]===0x1){return _0x342769['id'];}else{var _0x35e8b0=_[_0x75e8('0x7c')](_[_0x75e8('0x2e')](_0x3e343c,'TeamId'),function(_0x1c6ac5){return _['includes'](_0x49836b,_0x1c6ac5);});if(_0x35e8b0){return _0x342769['id'];}}}));}}return BPromise['all'](_0x5ec4d1)[_0x75e8('0x26')](function(_0x498b5c){_0x5f1613=_(_0x5f1613)[_0x75e8('0x7d')](_0x498b5c)['compact']()[_0x75e8('0x7e')]();return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x478edc[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](function(_0x39a224){return db['sequelize'][_0x75e8('0x69')](function(_0x4f8cc1){return _0x39a224[_0x75e8('0x6e')](_0x478edc[_0x75e8('0x36')]['ids'],{'transaction':_0x4f8cc1})[_0x75e8('0x26')](function(){if(!_[_0x75e8('0x7f')](_0x5f1613)){return _0x39a224['removeAgents'](_0x5f1613,{'transaction':_0x4f8cc1});}})[_0x75e8('0x26')](function(){_0x5f1613[_0x75e8('0x6c')](function(_0x13ad59){socket[_0x75e8('0x6d')](_0x75e8('0x80'),{'UserId':_0x13ad59,'WhatsappQueueId':_0x39a224['id']});});});});});});})['then'](respondWithStatusCode(_0x6b8bba,null))['catch'](handleError(_0x6b8bba,null));};exports[_0x75e8('0x81')]=function(_0x5f5afd,_0x5e1c30,_0x496691){return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x5f5afd[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x5e1c30,null))[_0x75e8('0x26')](function(_0x23051c){if(_0x23051c){return _0x23051c['addAgents'](_0x5f5afd[_0x75e8('0x4c')]['ids'],_[_0x75e8('0x82')](_0x5f5afd[_0x75e8('0x4c')],[_0x75e8('0x64'),'id'])||{})[_0x75e8('0x83')](function(_0x516d87){for(var _0x407915=0x0;_0x407915<_0x5f5afd['body'][_0x75e8('0x64')][_0x75e8('0x3a')];_0x407915+=0x1){socket[_0x75e8('0x6d')](_0x75e8('0x84'),{'UserId':Number(_0x5f5afd[_0x75e8('0x4c')][_0x75e8('0x64')][_0x407915]),'WhatsappQueueId':Number(_0x5f5afd[_0x75e8('0x48')]['id'])});}return _0x516d87;});}})[_0x75e8('0x26')](respondWithResult(_0x5e1c30,null))[_0x75e8('0x47')](handleError(_0x5e1c30,null));};exports[_0x75e8('0x85')]=function(_0x4f6407,_0x25a575,_0x4b6aa6){return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x4f6407['params']['id']}})['then'](handleEntityNotFound(_0x25a575,null))['then'](function(_0x1cbced){if(_0x1cbced){return _0x1cbced[_0x75e8('0x85')](_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')])['then'](function(){if(_[_0x75e8('0x86')](_0x4f6407['query'][_0x75e8('0x64')])){for(var _0x2d5b03=0x0;_0x2d5b03<_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')][_0x75e8('0x3a')];_0x2d5b03+=0x1){socket[_0x75e8('0x6d')](_0x75e8('0x80'),{'UserId':Number(_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')][_0x2d5b03]),'WhatsappQueueId':Number(_0x4f6407[_0x75e8('0x48')]['id'])});}}else{socket['emit'](_0x75e8('0x80'),{'UserId':Number(_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')]),'WhatsappQueueId':Number(_0x4f6407['params']['id'])});}});}})['then'](respondWithStatusCode(_0x25a575,null))[_0x75e8('0x47')](handleError(_0x25a575,null));};exports[_0x75e8('0x87')]=function(_0x3d266b,_0x3f5e45,_0x4b1448){var _0x43485a={};var _0x50b5e2={};var _0x3f0e47;var _0x4c8754;return db[_0x75e8('0x2f')]['findOne']({'where':{'id':_0x3d266b[_0x75e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f5e45,null))['then'](function(_0x4868ec){if(_0x4868ec){_0x3f0e47=_0x4868ec;_0x50b5e2[_0x75e8('0x34')]=_['keys'](db[_0x75e8('0x58')][_0x75e8('0x30')]);_0x50b5e2[_0x75e8('0x36')]=_['keys'](_0x3d266b[_0x75e8('0x36')]);_0x50b5e2[_0x75e8('0x49')]=_['intersection'](_0x50b5e2[_0x75e8('0x34')],_0x50b5e2['query']);_0x43485a[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0x50b5e2['model'],qs[_0x75e8('0x39')](_0x3d266b[_0x75e8('0x36')]['fields']));_0x43485a[_0x75e8('0x38')]=_0x43485a[_0x75e8('0x38')]['length']?_0x43485a['attributes']:_0x50b5e2['model'];_0x43485a[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x3e')]);_0x43485a[_0x75e8('0x40')]=qs[_0x75e8('0x49')](_['pick'](_0x3d266b['query'],_0x50b5e2[_0x75e8('0x49')]));if(_0x3d266b['query'][_0x75e8('0x42')]){_0x43485a['where']=_['merge'](_0x43485a[_0x75e8('0x40')],{'$or':_[_0x75e8('0x2e')](_0x43485a[_0x75e8('0x38')],function(_0x14cc25){var _0x43c9c4={};_0x43c9c4[_0x14cc25]={'$like':'%'+_0x3d266b[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x43c9c4;})});}_0x43485a=_[_0x75e8('0x41')]({},_0x43485a,_0x3d266b['options']);return _0x3f0e47[_0x75e8('0x87')](_0x43485a);}})['then'](function(_0x397e29){if(_0x397e29){_0x4c8754=_0x397e29['length'];if(!_0x3d266b[_0x75e8('0x36')][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x43485a[_0x75e8('0x20')]=qs['limit'](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x20')]);_0x43485a['offset']=qs[_0x75e8('0x1e')](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x1e')]);}return _0x3f0e47[_0x75e8('0x87')](_0x43485a);}})[_0x75e8('0x26')](function(_0x4b9205){if(_0x4b9205){return _0x4b9205?{'count':_0x4c8754,'rows':_0x4b9205}:null;}})[_0x75e8('0x26')](respondWithResult(_0x3f5e45,null))[_0x75e8('0x47')](handleError(_0x3f5e45,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index ff26061..030808d 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42a0=['WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x38d19d,_0x43f41b){var _0x5c6ebc=function(_0x1587cc){while(--_0x1587cc){_0x38d19d['push'](_0x38d19d['shift']());}};_0x5c6ebc(++_0x43f41b);}(_0x42a0,0x127));var _0x042a=function(_0x3974a1,_0x28926c){_0x3974a1=_0x3974a1-0x0;var _0x9436cf=_0x42a0[_0x3974a1];return _0x9436cf;};'use strict';var EventEmitter=require(_0x042a('0x0'));var WhatsappQueue=require(_0x042a('0x1'))['db'][_0x042a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x042a('0x3'),'afterUpdate':_0x042a('0x4'),'afterDestroy':_0x042a('0x5')};function emitEvent(_0x50b30b){return function(_0x4423c8,_0x5e4f76,_0x1947d3){WhatsappQueueEvents[_0x042a('0x6')](_0x50b30b+':'+_0x4423c8['id'],_0x4423c8);WhatsappQueueEvents['emit'](_0x50b30b,_0x4423c8);_0x1947d3(null);};}for(var e in events){if(events[_0x042a('0x7')](e)){var event=events[e];WhatsappQueue[_0x042a('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x3e61=['hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x3e61,0x124));var _0x13e6=function(_0x5368e6,_0x26307d){_0x5368e6=_0x5368e6-0x0;var _0x4a3cc4=_0x3e61[_0x5368e6];return _0x4a3cc4;};'use strict';var EventEmitter=require(_0x13e6('0x0'));var WhatsappQueue=require(_0x13e6('0x1'))['db'][_0x13e6('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x13e6('0x3')](0x0);var events={'afterCreate':_0x13e6('0x4'),'afterUpdate':_0x13e6('0x5'),'afterDestroy':_0x13e6('0x6')};function emitEvent(_0x19218c){return function(_0x1e40a1,_0x1576c0,_0x3c5122){WhatsappQueueEvents[_0x13e6('0x7')](_0x19218c+':'+_0x1e40a1['id'],_0x1e40a1);WhatsappQueueEvents['emit'](_0x19218c,_0x1e40a1);_0x3c5122(null);};}for(var e in events){if(events[_0x13e6('0x8')](e)){var event=events[e];WhatsappQueue[_0x13e6('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index bb6f9ef..c0f7eb1 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd89a=['moment','bluebird','request-promise','../../config/environment','./whatsappQueue.attributes','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd89a,0xf9));var _0xad89=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0xd89a[_0x26299e];return _0x6c4f4a;};'use strict';var _=require(_0xad89('0x0'));var util=require(_0xad89('0x1'));var logger=require(_0xad89('0x2'))('api');var moment=require(_0xad89('0x3'));var BPromise=require(_0xad89('0x4'));var rp=require(_0xad89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad89('0x6'));var attributes=require(_0xad89('0x7'));module['exports']=function(_0x2b2e1f,_0x1828cd){return _0x2b2e1f['define']('WhatsappQueue',attributes,{'tableName':_0xad89('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa38c=['moment','bluebird','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x2d945f,_0x3820a0){var _0x12cc68=function(_0x545625){while(--_0x545625){_0x2d945f['push'](_0x2d945f['shift']());}};_0x12cc68(++_0x3820a0);}(_0xa38c,0x189));var _0xca38=function(_0x4c2537,_0x20afdf){_0x4c2537=_0x4c2537-0x0;var _0x94fb5c=_0xa38c[_0x4c2537];return _0x94fb5c;};'use strict';var _=require(_0xca38('0x0'));var util=require('util');var logger=require(_0xca38('0x1'))(_0xca38('0x2'));var moment=require(_0xca38('0x3'));var BPromise=require(_0xca38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca38('0x5'));var config=require('../../config/environment');var attributes=require(_0xca38('0x6'));module[_0xca38('0x7')]=function(_0x13e7ae,_0x5e4a1c){return _0x13e7ae[_0xca38('0x8')](_0xca38('0x9'),attributes,{'tableName':_0xca38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 73a93c3..7a5b6ce 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9713=['GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowWhatsappQueue','find','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappQueue,\x20%s,\x20%s','catch'];(function(_0x19875a,_0x202791){var _0x9ce766=function(_0x299238){while(--_0x299238){_0x19875a['push'](_0x19875a['shift']());}};_0x9ce766(++_0x202791);}(_0x9713,0x1c6));var _0x3971=function(_0x37545e,_0x296fb6){_0x37545e=_0x37545e-0x0;var _0x4fe239=_0x9713[_0x37545e];return _0x4fe239;};'use strict';var _=require(_0x3971('0x0'));var util=require(_0x3971('0x1'));var moment=require(_0x3971('0x2'));var BPromise=require('bluebird');var rs=require(_0x3971('0x3'));var fs=require('fs');var Redis=require(_0x3971('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3971('0x5'))('rpc');var config=require(_0x3971('0x6'));var jayson=require(_0x3971('0x7'));var client=jayson[_0x3971('0x8')][_0x3971('0x9')]({'port':0x232a});config[_0x3971('0xa')]=_['defaults'](config[_0x3971('0xa')],{'host':_0x3971('0xb'),'port':0x18eb});var socket=require(_0x3971('0xc'))(new Redis(config[_0x3971('0xa')]));require(_0x3971('0xd'))[_0x3971('0xe')](socket);function respondWithRpcPromise(_0x3219ab,_0x4f4a47,_0x2f62e2){return new BPromise(function(_0x4c2c99,_0x19a55f){return client[_0x3971('0xf')](_0x3219ab,_0x2f62e2)[_0x3971('0x10')](function(_0x2f7c7d){logger[_0x3971('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x4f4a47,_0x3971('0x12'));logger[_0x3971('0x13')](_0x3971('0x14'),_0x4f4a47,'request\x20sent',JSON['stringify'](_0x2f7c7d));if(_0x2f7c7d[_0x3971('0x15')]){if(_0x2f7c7d[_0x3971('0x15')][_0x3971('0x16')]===0x1f4){logger[_0x3971('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x4f4a47,_0x2f7c7d['error'][_0x3971('0x17')]);return _0x19a55f(_0x2f7c7d[_0x3971('0x15')][_0x3971('0x17')]);}logger[_0x3971('0x15')](_0x3971('0x18'),_0x4f4a47,_0x2f7c7d[_0x3971('0x15')][_0x3971('0x17')]);return _0x4c2c99(_0x2f7c7d[_0x3971('0x15')][_0x3971('0x17')]);}else{logger[_0x3971('0x11')](_0x3971('0x18'),_0x4f4a47,_0x3971('0x12'));_0x4c2c99(_0x2f7c7d['result']['message']);}})[_0x3971('0x19')](function(_0x56beaa){logger[_0x3971('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x4f4a47,_0x56beaa);_0x19a55f(_0x56beaa);});});}exports[_0x3971('0x1a')]=function(_0x3dbae7){var _0x347a71=this;return new Promise(function(_0x295600,_0x28723e){return db[_0x3971('0x1b')][_0x3971('0x1c')]({'raw':_0x3dbae7[_0x3971('0x1d')]?_0x3dbae7[_0x3971('0x1d')][_0x3971('0x1e')]===undefined?!![]:![]:!![],'where':_0x3dbae7[_0x3971('0x1d')]?_0x3dbae7[_0x3971('0x1d')][_0x3971('0x1f')]||null:null,'attributes':_0x3dbae7['options']?_0x3dbae7[_0x3971('0x1d')]['attributes']||null:null,'limit':_0x3dbae7['options']?_0x3dbae7[_0x3971('0x1d')][_0x3971('0x20')]||null:null,'include':_0x3dbae7[_0x3971('0x1d')]?_0x3dbae7[_0x3971('0x1d')][_0x3971('0x21')]?_[_0x3971('0x22')](_0x3dbae7['options'][_0x3971('0x21')],function(_0x49403c){return{'model':db[_0x49403c[_0x3971('0x23')]],'as':_0x49403c['as'],'attributes':_0x49403c['attributes'],'include':_0x49403c[_0x3971('0x21')]?_[_0x3971('0x22')](_0x49403c[_0x3971('0x21')],function(_0xc5a107){return{'model':db[_0xc5a107[_0x3971('0x23')]],'as':_0xc5a107['as'],'attributes':_0xc5a107['attributes'],'include':_0xc5a107[_0x3971('0x21')]?_['map'](_0xc5a107[_0x3971('0x21')],function(_0x41cab2){return{'model':db[_0x41cab2[_0x3971('0x23')]],'as':_0x41cab2['as'],'attributes':_0x41cab2[_0x3971('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3971('0x10')](function(_0x2a4797){logger[_0x3971('0x11')](_0x3971('0x1a'),_0x3dbae7);logger[_0x3971('0x13')](_0x3971('0x1a'),_0x3dbae7,JSON[_0x3971('0x25')](_0x2a4797));_0x295600(_0x2a4797);})[_0x3971('0x19')](function(_0x3e521a){logger[_0x3971('0x15')]('GetWhatsappQueue',_0x3e521a[_0x3971('0x17')],_0x3dbae7);_0x28723e(_0x347a71[_0x3971('0x15')](0x1f4,_0x3e521a[_0x3971('0x17')]));});});};exports[_0x3971('0x26')]=function(_0x599b10){var _0x2e33df=this;return new Promise(function(_0x228249,_0x401d84){return db['WhatsappQueue'][_0x3971('0x27')]({'raw':_0x599b10[_0x3971('0x1d')]?_0x599b10[_0x3971('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x599b10[_0x3971('0x1d')]?_0x599b10['options'][_0x3971('0x1f')]||null:null,'attributes':_0x599b10['options']?_0x599b10['options'][_0x3971('0x24')]||null:null,'include':_0x599b10[_0x3971('0x1d')]?_0x599b10['options'][_0x3971('0x21')]?_[_0x3971('0x22')](_0x599b10['options'][_0x3971('0x21')],function(_0x190d81){return{'model':db[_0x190d81[_0x3971('0x23')]],'as':_0x190d81['as'],'attributes':_0x190d81[_0x3971('0x24')],'include':_0x190d81[_0x3971('0x21')]?_['map'](_0x190d81[_0x3971('0x21')],function(_0x54590e){return{'model':db[_0x54590e['model']],'as':_0x54590e['as'],'attributes':_0x54590e['attributes'],'include':_0x54590e['include']?_[_0x3971('0x22')](_0x54590e['include'],function(_0x252146){return{'model':db[_0x252146[_0x3971('0x23')]],'as':_0x252146['as'],'attributes':_0x252146[_0x3971('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3971('0x10')](function(_0x394a37){logger[_0x3971('0x11')](_0x3971('0x26'),_0x599b10);logger['debug'](_0x3971('0x26'),_0x599b10,JSON[_0x3971('0x25')](_0x394a37));_0x228249(_0x394a37);})[_0x3971('0x19')](function(_0xc2d566){logger[_0x3971('0x15')](_0x3971('0x26'),_0xc2d566[_0x3971('0x17')],_0x599b10);_0x401d84(_0x2e33df[_0x3971('0x15')](0x1f4,_0xc2d566[_0x3971('0x17')]));});});}; \ No newline at end of file +var _0x197a=['result','catch','GetWhatsappQueue','findAll','options','attributes','include','map','model','stringify','ShowWhatsappQueue','find','raw','where','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x31619a,_0x421647){var _0x525439=function(_0x17cd03){while(--_0x17cd03){_0x31619a['push'](_0x31619a['shift']());}};_0x525439(++_0x421647);}(_0x197a,0x126));var _0xa197=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x197a[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0xa197('0x0'));var util=require(_0xa197('0x1'));var moment=require(_0xa197('0x2'));var BPromise=require('bluebird');var rs=require(_0xa197('0x3'));var fs=require('fs');var Redis=require(_0xa197('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa197('0x5'));var logger=require(_0xa197('0x6'))(_0xa197('0x7'));var config=require(_0xa197('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa197('0x9')][_0xa197('0xa')]({'port':0x232a});config[_0xa197('0xb')]=_[_0xa197('0xc')](config[_0xa197('0xb')],{'host':_0xa197('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa197('0xb')]));require(_0xa197('0xe'))[_0xa197('0xf')](socket);function respondWithRpcPromise(_0x88b9f1,_0x4740a7,_0x3dadab){return new BPromise(function(_0x1b278c,_0x20fabd){return client[_0xa197('0x10')](_0x88b9f1,_0x3dadab)[_0xa197('0x11')](function(_0xedbe69){logger[_0xa197('0x12')](_0xa197('0x13'),_0x4740a7,_0xa197('0x14'));logger[_0xa197('0x15')](_0xa197('0x16'),_0x4740a7,_0xa197('0x14'),JSON['stringify'](_0xedbe69));if(_0xedbe69[_0xa197('0x17')]){if(_0xedbe69[_0xa197('0x17')][_0xa197('0x18')]===0x1f4){logger[_0xa197('0x17')](_0xa197('0x13'),_0x4740a7,_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);return _0x20fabd(_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);}logger[_0xa197('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x4740a7,_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);return _0x1b278c(_0xedbe69['error'][_0xa197('0x19')]);}else{logger[_0xa197('0x12')](_0xa197('0x13'),_0x4740a7,_0xa197('0x14'));_0x1b278c(_0xedbe69[_0xa197('0x1a')][_0xa197('0x19')]);}})[_0xa197('0x1b')](function(_0x1c6088){logger[_0xa197('0x17')](_0xa197('0x13'),_0x4740a7,_0x1c6088);_0x20fabd(_0x1c6088);});});}exports[_0xa197('0x1c')]=function(_0x2ee91c){var _0x262fd6=this;return new Promise(function(_0xecec7c,_0x1f15be){return db['WhatsappQueue'][_0xa197('0x1d')]({'raw':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c[_0xa197('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c['options']['where']||null:null,'attributes':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c['options'][_0xa197('0x1f')]||null:null,'limit':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c[_0xa197('0x1e')]['limit']||null:null,'include':_0x2ee91c['options']?_0x2ee91c[_0xa197('0x1e')][_0xa197('0x20')]?_[_0xa197('0x21')](_0x2ee91c[_0xa197('0x1e')][_0xa197('0x20')],function(_0x1cb2a2){return{'model':db[_0x1cb2a2[_0xa197('0x22')]],'as':_0x1cb2a2['as'],'attributes':_0x1cb2a2['attributes'],'include':_0x1cb2a2['include']?_[_0xa197('0x21')](_0x1cb2a2[_0xa197('0x20')],function(_0x8ba3e8){return{'model':db[_0x8ba3e8[_0xa197('0x22')]],'as':_0x8ba3e8['as'],'attributes':_0x8ba3e8[_0xa197('0x1f')],'include':_0x8ba3e8[_0xa197('0x20')]?_[_0xa197('0x21')](_0x8ba3e8[_0xa197('0x20')],function(_0xe6e6ee){return{'model':db[_0xe6e6ee[_0xa197('0x22')]],'as':_0xe6e6ee['as'],'attributes':_0xe6e6ee['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd686b5){logger[_0xa197('0x12')](_0xa197('0x1c'),_0x2ee91c);logger['debug']('GetWhatsappQueue',_0x2ee91c,JSON[_0xa197('0x23')](_0xd686b5));_0xecec7c(_0xd686b5);})['catch'](function(_0x14ac49){logger[_0xa197('0x17')](_0xa197('0x1c'),_0x14ac49[_0xa197('0x19')],_0x2ee91c);_0x1f15be(_0x262fd6[_0xa197('0x17')](0x1f4,_0x14ac49['message']));});});};exports[_0xa197('0x24')]=function(_0x52f4dc){var _0x37337a=this;return new Promise(function(_0x415f7b,_0x248ddd){return db['WhatsappQueue'][_0xa197('0x25')]({'raw':_0x52f4dc[_0xa197('0x1e')]?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x26')]===undefined?!![]:![]:!![],'where':_0x52f4dc[_0xa197('0x1e')]?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x27')]||null:null,'attributes':_0x52f4dc['options']?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x1f')]||null:null,'include':_0x52f4dc['options']?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x20')]?_[_0xa197('0x21')](_0x52f4dc[_0xa197('0x1e')][_0xa197('0x20')],function(_0x1e8d7f){return{'model':db[_0x1e8d7f[_0xa197('0x22')]],'as':_0x1e8d7f['as'],'attributes':_0x1e8d7f[_0xa197('0x1f')],'include':_0x1e8d7f[_0xa197('0x20')]?_[_0xa197('0x21')](_0x1e8d7f[_0xa197('0x20')],function(_0xa33ad){return{'model':db[_0xa33ad[_0xa197('0x22')]],'as':_0xa33ad['as'],'attributes':_0xa33ad[_0xa197('0x1f')],'include':_0xa33ad[_0xa197('0x20')]?_['map'](_0xa33ad['include'],function(_0x1dcc0e){return{'model':db[_0x1dcc0e[_0xa197('0x22')]],'as':_0x1dcc0e['as'],'attributes':_0x1dcc0e[_0xa197('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa197('0x11')](function(_0x486ae5){logger[_0xa197('0x12')](_0xa197('0x24'),_0x52f4dc);logger['debug'](_0xa197('0x24'),_0x52f4dc,JSON['stringify'](_0x486ae5));_0x415f7b(_0x486ae5);})[_0xa197('0x1b')](function(_0x11a349){logger[_0xa197('0x17')](_0xa197('0x24'),_0x11a349['message'],_0x52f4dc);_0x248ddd(_0x37337a[_0xa197('0x17')](0x1f4,_0x11a349['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 95e21db..75b7a26 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x462f=['length','whatsappQueue:','remove','update','emit','removeListener','register'];(function(_0x41a887,_0x86c36f){var _0x4b434b=function(_0x297c8f){while(--_0x297c8f){_0x41a887['push'](_0x41a887['shift']());}};_0x4b434b(++_0x86c36f);}(_0x462f,0x10c));var _0xf462=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x462f[_0x3a7634];return _0x23bbe9;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xf462('0x0'),_0xf462('0x1')];function createListener(_0x3e256f,_0x300217){return function(_0x1f4741){_0x300217[_0xf462('0x2')](_0x3e256f,_0x1f4741);};}function removeListener(_0x4a6069,_0x5e3dd8){return function(){WhatsappQueueEvents[_0xf462('0x3')](_0x4a6069,_0x5e3dd8);};}exports[_0xf462('0x4')]=function(_0x508923){for(var _0xf4b77d=0x0,_0x341af0=events[_0xf462('0x5')];_0xf4b77d<_0x341af0;_0xf4b77d++){var _0xfa2ff=events[_0xf4b77d];var _0x56df40=createListener(_0xf462('0x6')+_0xfa2ff,_0x508923);WhatsappQueueEvents['on'](_0xfa2ff,_0x56df40);}}; \ No newline at end of file +var _0x7a22=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x7a22,0xee));var _0x27a2=function(_0x175ed2,_0x30b227){_0x175ed2=_0x175ed2-0x0;var _0x35853f=_0x7a22[_0x175ed2];return _0x35853f;};'use strict';var WhatsappQueueEvents=require(_0x27a2('0x0'));var events=[_0x27a2('0x1'),_0x27a2('0x2'),_0x27a2('0x3')];function createListener(_0x5c566b,_0x10a448){return function(_0x4f7cc0){_0x10a448[_0x27a2('0x4')](_0x5c566b,_0x4f7cc0);};}function removeListener(_0x25c644,_0x4fac1d){return function(){WhatsappQueueEvents[_0x27a2('0x5')](_0x25c644,_0x4fac1d);};}exports[_0x27a2('0x6')]=function(_0x33d015){for(var _0x554414=0x0,_0x207d7c=events[_0x27a2('0x7')];_0x554414<_0x207d7c;_0x554414++){var _0x37ae31=events[_0x554414];var _0x4d3d8d=createListener(_0x27a2('0x8')+_0x37ae31,_0x33d015);WhatsappQueueEvents['on'](_0x37ae31,_0x4d3d8d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8625bd3..5dce2f6 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8346=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8346,0x1b7));var _0x6834=function(_0x229250,_0x42737b){_0x229250=_0x229250-0x0;var _0x4d31b6=_0x8346[_0x229250];return _0x4d31b6;};'use strict';var multer=require(_0x6834('0x0'));var util=require(_0x6834('0x1'));var path=require('path');var timeout=require(_0x6834('0x2'));var express=require(_0x6834('0x3'));var router=express[_0x6834('0x4')]();var fs_extra=require(_0x6834('0x5'));var auth=require(_0x6834('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6834('0x7'));var controller=require(_0x6834('0x8'));router[_0x6834('0x9')]('/',auth[_0x6834('0xa')](),controller['index']);router[_0x6834('0x9')](_0x6834('0xb'),auth['isAuthenticated'](),controller[_0x6834('0xc')]);router['get'](_0x6834('0xd'),auth[_0x6834('0xa')](),controller[_0x6834('0xe')]);router['post']('/',auth[_0x6834('0xa')](),controller[_0x6834('0xf')]);router[_0x6834('0x10')](_0x6834('0xd'),auth['isAuthenticated'](),controller[_0x6834('0x11')]);router[_0x6834('0x12')](_0x6834('0xd'),auth[_0x6834('0xa')](),controller[_0x6834('0x13')]);module[_0x6834('0x14')]=router; \ No newline at end of file +var _0x547f=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x2a4807,_0x5217f3){var _0x2e0cd9=function(_0x5277d5){while(--_0x5277d5){_0x2a4807['push'](_0x2a4807['shift']());}};_0x2e0cd9(++_0x5217f3);}(_0x547f,0x13b));var _0xf547=function(_0x54e3c0,_0x1077b4){_0x54e3c0=_0x54e3c0-0x0;var _0x278f45=_0x547f[_0x54e3c0];return _0x278f45;};'use strict';var multer=require(_0xf547('0x0'));var util=require(_0xf547('0x1'));var path=require(_0xf547('0x2'));var timeout=require('connect-timeout');var express=require(_0xf547('0x3'));var router=express[_0xf547('0x4')]();var fs_extra=require(_0xf547('0x5'));var auth=require(_0xf547('0x6'));var interaction=require(_0xf547('0x7'));var config=require(_0xf547('0x8'));var controller=require(_0xf547('0x9'));router['get']('/',auth[_0xf547('0xa')](),controller[_0xf547('0xb')]);router[_0xf547('0xc')](_0xf547('0xd'),auth[_0xf547('0xa')](),controller['describe']);router[_0xf547('0xc')](_0xf547('0xe'),auth[_0xf547('0xa')](),controller[_0xf547('0xf')]);router[_0xf547('0x10')]('/',auth[_0xf547('0xa')](),controller[_0xf547('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf547('0x12')]('/:id',auth[_0xf547('0xa')](),controller[_0xf547('0x13')]);module[_0xf547('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 89d2c6d..9d366e2 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x22c84b,_0x2cad20){var _0x36ec7c=function(_0x2caba2){while(--_0x2caba2){_0x22c84b['push'](_0x22c84b['shift']());}};_0x36ec7c(++_0x2cad20);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x122f46,_0x4c22d5){var _0x590b10=function(_0x548428){while(--_0x548428){_0x122f46['push'](_0x122f46['shift']());}};_0x590b10(++_0x4c22d5);}(_0x7a54,0x106));var _0x47a5=function(_0x2d1603,_0x1e41cc){_0x2d1603=_0x2d1603-0x0;var _0x3be5de=_0x7a54[_0x2d1603];return _0x3be5de;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index dccbd5b..5d03676 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1399=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','find','catch','body','destroy','describe','eml-format'];(function(_0x47b7b2,_0x11acff){var _0x2dc3ca=function(_0x1a7dee){while(--_0x1a7dee){_0x47b7b2['push'](_0x47b7b2['shift']());}};_0x2dc3ca(++_0x11acff);}(_0x1399,0x16c));var _0x9139=function(_0x204e8f,_0x551d92){_0x204e8f=_0x204e8f-0x0;var _0x75770=_0x1399[_0x204e8f];return _0x75770;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){_0x1aee3b[_0x9139('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed4da,_0x2ee4bb){return function(_0x10bfa0){if(!_0x10bfa0){_0x3ed4da['sendStatus'](0x194);}return _0x10bfa0;};}function handleError(_0x4118dc,_0xffd487){_0xffd487=_0xffd487||0x1f4;return function(_0x49d01e){logger[_0x9139('0x23')](_0x49d01e[_0x9139('0x24')]);if(_0x49d01e[_0x9139('0x25')]){delete _0x49d01e['name'];}_0x4118dc[_0x9139('0x16')](_0xffd487)[_0x9139('0x26')](_0x49d01e);};}exports[_0x9139('0x27')]=function(_0x22994c,_0x215194){var _0x16dfb4={},_0xfe6854={},_0x573a05={'count':0x0,'rows':[]};var _0x55cc6a=_[_0x9139('0x28')](db[_0x9139('0x29')][_0x9139('0x2a')],function(_0x4c1693){return{'name':_0x4c1693['fieldName'],'type':_0x4c1693[_0x9139('0x2b')][_0x9139('0x2c')]};});_0xfe6854[_0x9139('0x2d')]=_[_0x9139('0x28')](_0x55cc6a,_0x9139('0x25'));_0xfe6854['query']=_['keys'](_0x22994c[_0x9139('0x2e')]);_0xfe6854['filters']=_['intersection'](_0xfe6854[_0x9139('0x2d')],_0xfe6854[_0x9139('0x2e')]);_0x16dfb4['attributes']=_[_0x9139('0x2f')](_0xfe6854[_0x9139('0x2d')],qs['fields'](_0x22994c[_0x9139('0x2e')][_0x9139('0x30')]));_0x16dfb4[_0x9139('0x31')]=_0x16dfb4[_0x9139('0x31')][_0x9139('0x32')]?_0x16dfb4[_0x9139('0x31')]:_0xfe6854[_0x9139('0x2d')];if(!_0x22994c[_0x9139('0x2e')][_0x9139('0x33')](_0x9139('0x34'))){_0x16dfb4[_0x9139('0x1a')]=qs['limit'](_0x22994c[_0x9139('0x2e')][_0x9139('0x1a')]);_0x16dfb4['offset']=qs[_0x9139('0x18')](_0x22994c[_0x9139('0x2e')][_0x9139('0x18')]);}_0x16dfb4['order']=qs[_0x9139('0x35')](_0x22994c[_0x9139('0x2e')][_0x9139('0x35')]);_0x16dfb4[_0x9139('0x36')]=qs[_0x9139('0x37')](_[_0x9139('0x38')](_0x22994c[_0x9139('0x2e')],_0xfe6854[_0x9139('0x37')]),_0x55cc6a);if(_0x22994c[_0x9139('0x2e')][_0x9139('0x39')]){_0x16dfb4['where']=_[_0x9139('0x3a')](_0x16dfb4[_0x9139('0x36')],{'$or':_[_0x9139('0x28')](_0x55cc6a,function(_0x2cebb9){if(_0x2cebb9[_0x9139('0x2b')]!==_0x9139('0x3b')){var _0x1ea313={};_0x1ea313[_0x2cebb9['name']]={'$like':'%'+_0x22994c[_0x9139('0x2e')]['filter']+'%'};return _0x1ea313;}})});}_0x16dfb4=_[_0x9139('0x3a')]({},_0x16dfb4,_0x22994c[_0x9139('0x3c')]);var _0x3fb4db={'where':_0x16dfb4['where']};return db[_0x9139('0x29')][_0x9139('0x3d')](_0x3fb4db)[_0x9139('0x22')](function(_0x236513){_0x573a05[_0x9139('0x3d')]=_0x236513;if(_0x22994c[_0x9139('0x2e')][_0x9139('0x3e')]){_0x16dfb4[_0x9139('0x3f')]=[{'all':!![]}];}return db[_0x9139('0x29')][_0x9139('0x40')](_0x16dfb4);})['then'](function(_0xf14393){_0x573a05[_0x9139('0x41')]=_0xf14393;return _0x573a05;})[_0x9139('0x22')](respondWithFilteredResult(_0x215194,_0x16dfb4))['catch'](handleError(_0x215194,null));};exports['show']=function(_0x4d9670,_0x465f49){var _0x12ba4b={'raw':!![],'where':{'id':_0x4d9670[_0x9139('0x42')]['id']}},_0x3611b4={};_0x3611b4[_0x9139('0x2d')]=_['keys'](db[_0x9139('0x29')][_0x9139('0x2a')]);_0x3611b4[_0x9139('0x2e')]=_[_0x9139('0x43')](_0x4d9670[_0x9139('0x2e')]);_0x3611b4['filters']=_[_0x9139('0x2f')](_0x3611b4[_0x9139('0x2d')],_0x3611b4[_0x9139('0x2e')]);_0x12ba4b[_0x9139('0x31')]=_['intersection'](_0x3611b4['model'],qs[_0x9139('0x30')](_0x4d9670[_0x9139('0x2e')]['fields']));_0x12ba4b['attributes']=_0x12ba4b[_0x9139('0x31')][_0x9139('0x32')]?_0x12ba4b['attributes']:_0x3611b4[_0x9139('0x2d')];if(_0x4d9670[_0x9139('0x2e')]['includeAll']){_0x12ba4b[_0x9139('0x3f')]=[{'all':!![]}];}_0x12ba4b=_['merge']({},_0x12ba4b,_0x4d9670['options']);return db[_0x9139('0x29')][_0x9139('0x44')](_0x12ba4b)[_0x9139('0x22')](handleEntityNotFound(_0x465f49,null))[_0x9139('0x22')](respondWithResult(_0x465f49,null))[_0x9139('0x45')](handleError(_0x465f49,null));};exports['create']=function(_0x3e126c,_0xc55b16){return db[_0x9139('0x29')]['create'](_0x3e126c[_0x9139('0x46')],{})[_0x9139('0x22')](respondWithResult(_0xc55b16,0xc9))[_0x9139('0x45')](handleError(_0xc55b16,null));};exports[_0x9139('0x21')]=function(_0x215793,_0x31395f){if(_0x215793[_0x9139('0x46')]['id']){delete _0x215793[_0x9139('0x46')]['id'];}return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x215793[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x31395f,null))[_0x9139('0x22')](saveUpdates(_0x215793[_0x9139('0x46')],null))[_0x9139('0x22')](respondWithResult(_0x31395f,null))['catch'](handleError(_0x31395f,null));};exports[_0x9139('0x47')]=function(_0x46f77a,_0x557c93){return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x46f77a[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x557c93,null))[_0x9139('0x22')](removeEntity(_0x557c93,null))[_0x9139('0x45')](handleError(_0x557c93,null));};exports[_0x9139('0x48')]=function(_0x23669b,_0x51ecf6){return db[_0x9139('0x29')][_0x9139('0x48')]()[_0x9139('0x22')](respondWithResult(_0x51ecf6,null))['catch'](handleError(_0x51ecf6,null));}; \ No newline at end of file +var _0x1399=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','find','catch','body','destroy','describe','eml-format'];(function(_0x39efe4,_0x28b498){var _0x5b7bb3=function(_0x18d043){while(--_0x18d043){_0x39efe4['push'](_0x39efe4['shift']());}};_0x5b7bb3(++_0x28b498);}(_0x1399,0x16c));var _0x9139=function(_0x1d8295,_0xeb509d){_0x1d8295=_0x1d8295-0x0;var _0x259513=_0x1399[_0x1d8295];return _0x259513;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){_0x1aee3b[_0x9139('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed4da,_0x2ee4bb){return function(_0x10bfa0){if(!_0x10bfa0){_0x3ed4da['sendStatus'](0x194);}return _0x10bfa0;};}function handleError(_0x4118dc,_0xffd487){_0xffd487=_0xffd487||0x1f4;return function(_0x49d01e){logger[_0x9139('0x23')](_0x49d01e[_0x9139('0x24')]);if(_0x49d01e[_0x9139('0x25')]){delete _0x49d01e['name'];}_0x4118dc[_0x9139('0x16')](_0xffd487)[_0x9139('0x26')](_0x49d01e);};}exports[_0x9139('0x27')]=function(_0x22994c,_0x215194){var _0x16dfb4={},_0xfe6854={},_0x573a05={'count':0x0,'rows':[]};var _0x55cc6a=_[_0x9139('0x28')](db[_0x9139('0x29')][_0x9139('0x2a')],function(_0x4c1693){return{'name':_0x4c1693['fieldName'],'type':_0x4c1693[_0x9139('0x2b')][_0x9139('0x2c')]};});_0xfe6854[_0x9139('0x2d')]=_[_0x9139('0x28')](_0x55cc6a,_0x9139('0x25'));_0xfe6854['query']=_['keys'](_0x22994c[_0x9139('0x2e')]);_0xfe6854['filters']=_['intersection'](_0xfe6854[_0x9139('0x2d')],_0xfe6854[_0x9139('0x2e')]);_0x16dfb4['attributes']=_[_0x9139('0x2f')](_0xfe6854[_0x9139('0x2d')],qs['fields'](_0x22994c[_0x9139('0x2e')][_0x9139('0x30')]));_0x16dfb4[_0x9139('0x31')]=_0x16dfb4[_0x9139('0x31')][_0x9139('0x32')]?_0x16dfb4[_0x9139('0x31')]:_0xfe6854[_0x9139('0x2d')];if(!_0x22994c[_0x9139('0x2e')][_0x9139('0x33')](_0x9139('0x34'))){_0x16dfb4[_0x9139('0x1a')]=qs['limit'](_0x22994c[_0x9139('0x2e')][_0x9139('0x1a')]);_0x16dfb4['offset']=qs[_0x9139('0x18')](_0x22994c[_0x9139('0x2e')][_0x9139('0x18')]);}_0x16dfb4['order']=qs[_0x9139('0x35')](_0x22994c[_0x9139('0x2e')][_0x9139('0x35')]);_0x16dfb4[_0x9139('0x36')]=qs[_0x9139('0x37')](_[_0x9139('0x38')](_0x22994c[_0x9139('0x2e')],_0xfe6854[_0x9139('0x37')]),_0x55cc6a);if(_0x22994c[_0x9139('0x2e')][_0x9139('0x39')]){_0x16dfb4['where']=_[_0x9139('0x3a')](_0x16dfb4[_0x9139('0x36')],{'$or':_[_0x9139('0x28')](_0x55cc6a,function(_0x2cebb9){if(_0x2cebb9[_0x9139('0x2b')]!==_0x9139('0x3b')){var _0x1ea313={};_0x1ea313[_0x2cebb9['name']]={'$like':'%'+_0x22994c[_0x9139('0x2e')]['filter']+'%'};return _0x1ea313;}})});}_0x16dfb4=_[_0x9139('0x3a')]({},_0x16dfb4,_0x22994c[_0x9139('0x3c')]);var _0x3fb4db={'where':_0x16dfb4['where']};return db[_0x9139('0x29')][_0x9139('0x3d')](_0x3fb4db)[_0x9139('0x22')](function(_0x236513){_0x573a05[_0x9139('0x3d')]=_0x236513;if(_0x22994c[_0x9139('0x2e')][_0x9139('0x3e')]){_0x16dfb4[_0x9139('0x3f')]=[{'all':!![]}];}return db[_0x9139('0x29')][_0x9139('0x40')](_0x16dfb4);})['then'](function(_0xf14393){_0x573a05[_0x9139('0x41')]=_0xf14393;return _0x573a05;})[_0x9139('0x22')](respondWithFilteredResult(_0x215194,_0x16dfb4))['catch'](handleError(_0x215194,null));};exports['show']=function(_0x4d9670,_0x465f49){var _0x12ba4b={'raw':!![],'where':{'id':_0x4d9670[_0x9139('0x42')]['id']}},_0x3611b4={};_0x3611b4[_0x9139('0x2d')]=_['keys'](db[_0x9139('0x29')][_0x9139('0x2a')]);_0x3611b4[_0x9139('0x2e')]=_[_0x9139('0x43')](_0x4d9670[_0x9139('0x2e')]);_0x3611b4['filters']=_[_0x9139('0x2f')](_0x3611b4[_0x9139('0x2d')],_0x3611b4[_0x9139('0x2e')]);_0x12ba4b[_0x9139('0x31')]=_['intersection'](_0x3611b4['model'],qs[_0x9139('0x30')](_0x4d9670[_0x9139('0x2e')]['fields']));_0x12ba4b['attributes']=_0x12ba4b[_0x9139('0x31')][_0x9139('0x32')]?_0x12ba4b['attributes']:_0x3611b4[_0x9139('0x2d')];if(_0x4d9670[_0x9139('0x2e')]['includeAll']){_0x12ba4b[_0x9139('0x3f')]=[{'all':!![]}];}_0x12ba4b=_['merge']({},_0x12ba4b,_0x4d9670['options']);return db[_0x9139('0x29')][_0x9139('0x44')](_0x12ba4b)[_0x9139('0x22')](handleEntityNotFound(_0x465f49,null))[_0x9139('0x22')](respondWithResult(_0x465f49,null))[_0x9139('0x45')](handleError(_0x465f49,null));};exports['create']=function(_0x3e126c,_0xc55b16){return db[_0x9139('0x29')]['create'](_0x3e126c[_0x9139('0x46')],{})[_0x9139('0x22')](respondWithResult(_0xc55b16,0xc9))[_0x9139('0x45')](handleError(_0xc55b16,null));};exports[_0x9139('0x21')]=function(_0x215793,_0x31395f){if(_0x215793[_0x9139('0x46')]['id']){delete _0x215793[_0x9139('0x46')]['id'];}return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x215793[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x31395f,null))[_0x9139('0x22')](saveUpdates(_0x215793[_0x9139('0x46')],null))[_0x9139('0x22')](respondWithResult(_0x31395f,null))['catch'](handleError(_0x31395f,null));};exports[_0x9139('0x47')]=function(_0x46f77a,_0x557c93){return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x46f77a[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x557c93,null))[_0x9139('0x22')](removeEntity(_0x557c93,null))[_0x9139('0x45')](handleError(_0x557c93,null));};exports[_0x9139('0x48')]=function(_0x23669b,_0x51ecf6){return db[_0x9139('0x29')][_0x9139('0x48')]()[_0x9139('0x22')](respondWithResult(_0x51ecf6,null))['catch'](handleError(_0x51ecf6,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f272312..7780eba 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44c9=['path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x19e3c2,_0x177a95){var _0x2bb88f=function(_0x165f84){while(--_0x165f84){_0x19e3c2['push'](_0x19e3c2['shift']());}};_0x2bb88f(++_0x177a95);}(_0x44c9,0x18e));var _0x944c=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0x44c9[_0x5df3ab];return _0x42cce5;};'use strict';var _=require('lodash');var util=require(_0x944c('0x0'));var logger=require(_0x944c('0x1'))(_0x944c('0x2'));var moment=require(_0x944c('0x3'));var BPromise=require(_0x944c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x944c('0x5'));var rimraf=require('rimraf');var config=require(_0x944c('0x6'));var attributes=require(_0x944c('0x7'));module[_0x944c('0x8')]=function(_0x277c7e,_0x50f656){return _0x277c7e[_0x944c('0x9')](_0x944c('0xa'),attributes,{'tableName':_0x944c('0xb'),'paranoid':![],'indexes':[{'name':_0x944c('0xc'),'fields':[_0x944c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x158f=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x158f,0xd3));var _0xf158=function(_0x5807e8,_0x5d1910){_0x5807e8=_0x5807e8-0x0;var _0x2f7f36=_0x158f[_0x5807e8];return _0x2f7f36;};'use strict';var _=require(_0xf158('0x0'));var util=require(_0xf158('0x1'));var logger=require(_0xf158('0x2'))(_0xf158('0x3'));var moment=require(_0xf158('0x4'));var BPromise=require(_0xf158('0x5'));var rp=require(_0xf158('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf158('0x7'));var config=require(_0xf158('0x8'));var attributes=require(_0xf158('0x9'));module[_0xf158('0xa')]=function(_0x41ce1b,_0xe4a703){return _0x41ce1b['define'](_0xf158('0xb'),attributes,{'tableName':_0xf158('0xc'),'paranoid':![],'indexes':[{'name':_0xf158('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 636ae1e..fded339 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb90=['options','raw','catch','update','where','limit','then','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','body'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdb90,0xf8));var _0x0db9=function(_0x4233a2,_0x478e28){_0x4233a2=_0x4233a2-0x0;var _0x1c420e=_0xdb90[_0x4233a2];return _0x1c420e;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var moment=require('moment');var BPromise=require(_0x0db9('0x2'));var rs=require(_0x0db9('0x3'));var fs=require('fs');var Redis=require(_0x0db9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0db9('0x5'))('rpc');var config=require(_0x0db9('0x6'));var jayson=require(_0x0db9('0x7'));var client=jayson[_0x0db9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301aed,_0x3ed6f3,_0x429d6b){return new BPromise(function(_0x1386ed,_0x4f973d){return client[_0x0db9('0x9')](_0x301aed,_0x429d6b)['then'](function(_0x15ea70){logger['info'](_0x0db9('0xa'),_0x3ed6f3,_0x0db9('0xb'));logger[_0x0db9('0xc')](_0x0db9('0xd'),_0x3ed6f3,_0x0db9('0xb'),JSON[_0x0db9('0xe')](_0x15ea70));if(_0x15ea70[_0x0db9('0xf')]){if(_0x15ea70[_0x0db9('0xf')]['code']===0x1f4){logger['error'](_0x0db9('0xa'),_0x3ed6f3,_0x15ea70[_0x0db9('0xf')]['message']);return _0x4f973d(_0x15ea70[_0x0db9('0xf')][_0x0db9('0x10')]);}logger[_0x0db9('0xf')](_0x0db9('0xa'),_0x3ed6f3,_0x15ea70[_0x0db9('0xf')][_0x0db9('0x10')]);return _0x1386ed(_0x15ea70[_0x0db9('0xf')]['message']);}else{logger[_0x0db9('0x11')](_0x0db9('0xa'),_0x3ed6f3,_0x0db9('0xb'));_0x1386ed(_0x15ea70[_0x0db9('0x12')]['message']);}})['catch'](function(_0x458c0b){logger[_0x0db9('0xf')](_0x0db9('0xa'),_0x3ed6f3,_0x458c0b);_0x4f973d(_0x458c0b);});});}exports[_0x0db9('0x13')]=function(_0x3b2e75){var _0x4ad919=this;return new Promise(function(_0x5e5ef8,_0x525527){return db[_0x0db9('0x14')]['create'](_0x3b2e75[_0x0db9('0x15')],{'raw':_0x3b2e75[_0x0db9('0x16')]?_0x3b2e75[_0x0db9('0x16')][_0x0db9('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x32c3b5){logger[_0x0db9('0x11')](_0x0db9('0x13'),_0x3b2e75);logger[_0x0db9('0xc')](_0x0db9('0x13'),_0x3b2e75,JSON[_0x0db9('0xe')](_0x32c3b5));_0x5e5ef8(_0x32c3b5);})[_0x0db9('0x18')](function(_0x27797e){logger[_0x0db9('0xf')](_0x0db9('0x13'),_0x27797e[_0x0db9('0x10')],_0x3b2e75);_0x525527(_0x4ad919[_0x0db9('0xf')](0x1f4,_0x27797e[_0x0db9('0x10')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2f35a6){var _0x152453=this;return new Promise(function(_0x2287c6,_0x63680e){return db[_0x0db9('0x14')][_0x0db9('0x19')](_0x2f35a6[_0x0db9('0x15')],{'raw':_0x2f35a6[_0x0db9('0x16')]?_0x2f35a6[_0x0db9('0x16')][_0x0db9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f35a6['options']?_0x2f35a6[_0x0db9('0x16')][_0x0db9('0x1a')]||null:null,'attributes':_0x2f35a6['options']?_0x2f35a6[_0x0db9('0x16')]['attributes']||null:null,'limit':_0x2f35a6[_0x0db9('0x16')]?_0x2f35a6[_0x0db9('0x16')][_0x0db9('0x1b')]||null:null})[_0x0db9('0x1c')](function(_0x47b783){logger[_0x0db9('0x11')](_0x0db9('0x1d'),_0x2f35a6);logger[_0x0db9('0xc')](_0x0db9('0x1d'),_0x2f35a6,JSON[_0x0db9('0xe')](_0x47b783));_0x2287c6(_0x47b783);})['catch'](function(_0x4eb1b9){logger[_0x0db9('0xf')](_0x0db9('0x1d'),_0x4eb1b9[_0x0db9('0x10')],_0x2f35a6);_0x63680e(_0x152453[_0x0db9('0xf')](0x1f4,_0x4eb1b9[_0x0db9('0x10')]));});});}; \ No newline at end of file +var _0x9e07=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','catch','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e07,0xb1));var _0x79e0=function(_0x24dbad,_0x3390fb){_0x24dbad=_0x24dbad-0x0;var _0x9451f1=_0x9e07[_0x24dbad];return _0x9451f1;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var moment=require(_0x79e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x79e0('0x3'));var fs=require('fs');var Redis=require(_0x79e0('0x4'));var db=require(_0x79e0('0x5'))['db'];var utils=require(_0x79e0('0x6'));var logger=require('../../config/logger')(_0x79e0('0x7'));var config=require(_0x79e0('0x8'));var jayson=require(_0x79e0('0x9'));var client=jayson['client'][_0x79e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26b75d,_0x26f46b,_0x56341c){return new BPromise(function(_0x425668,_0x3b0e69){return client[_0x79e0('0xb')](_0x26b75d,_0x56341c)[_0x79e0('0xc')](function(_0x3611ec){logger['info'](_0x79e0('0xd'),_0x26f46b,_0x79e0('0xe'));logger[_0x79e0('0xf')](_0x79e0('0x10'),_0x26f46b,_0x79e0('0xe'),JSON[_0x79e0('0x11')](_0x3611ec));if(_0x3611ec[_0x79e0('0x12')]){if(_0x3611ec[_0x79e0('0x12')][_0x79e0('0x13')]===0x1f4){logger[_0x79e0('0x12')](_0x79e0('0xd'),_0x26f46b,_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);return _0x3b0e69(_0x3611ec['error']['message']);}logger[_0x79e0('0x12')](_0x79e0('0xd'),_0x26f46b,_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);return _0x425668(_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);}else{logger[_0x79e0('0x15')](_0x79e0('0xd'),_0x26f46b,_0x79e0('0xe'));_0x425668(_0x3611ec['result']['message']);}})['catch'](function(_0x355530){logger[_0x79e0('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x26f46b,_0x355530);_0x3b0e69(_0x355530);});});}exports[_0x79e0('0x16')]=function(_0x27dd4d){var _0x31c124=this;return new Promise(function(_0x588612,_0xe2c4c4){return db[_0x79e0('0x17')][_0x79e0('0x18')](_0x27dd4d['body'],{'raw':_0x27dd4d[_0x79e0('0x19')]?_0x27dd4d[_0x79e0('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x79e0('0xc')](function(_0x1053af){logger[_0x79e0('0x15')](_0x79e0('0x16'),_0x27dd4d);logger[_0x79e0('0xf')]('CreateWhatsappQueueReport',_0x27dd4d,JSON[_0x79e0('0x11')](_0x1053af));_0x588612(_0x1053af);})[_0x79e0('0x1a')](function(_0x5c855e){logger[_0x79e0('0x12')](_0x79e0('0x16'),_0x5c855e[_0x79e0('0x14')],_0x27dd4d);_0xe2c4c4(_0x31c124[_0x79e0('0x12')](0x1f4,_0x5c855e[_0x79e0('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x724826){var _0x5d74ab=this;return new Promise(function(_0x2e638a,_0x114590){return db[_0x79e0('0x17')][_0x79e0('0x1b')](_0x724826['body'],{'raw':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x724826['options']?_0x724826[_0x79e0('0x19')][_0x79e0('0x1c')]||null:null,'attributes':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')][_0x79e0('0x1d')]||null:null,'limit':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')][_0x79e0('0x1e')]||null:null})[_0x79e0('0xc')](function(_0x7294df){logger[_0x79e0('0x15')](_0x79e0('0x1f'),_0x724826);logger['debug'](_0x79e0('0x1f'),_0x724826,JSON[_0x79e0('0x11')](_0x7294df));_0x2e638a(_0x7294df);})[_0x79e0('0x1a')](function(_0x417843){logger[_0x79e0('0x12')](_0x79e0('0x1f'),_0x417843['message'],_0x724826);_0x114590(_0x5d74ab['error'](0x1f4,_0x417843['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index b26adbc..4a40dae 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe921=['delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update'];(function(_0x3e47e4,_0x5aadf6){var _0x18011d=function(_0x137eab){while(--_0x137eab){_0x3e47e4['push'](_0x3e47e4['shift']());}};_0x18011d(++_0x5aadf6);}(_0xe921,0xdb));var _0x1e92=function(_0x1951bd,_0x41a2fd){_0x1951bd=_0x1951bd-0x0;var _0x58f1b3=_0xe921[_0x1951bd];return _0x58f1b3;};'use strict';var multer=require(_0x1e92('0x0'));var util=require(_0x1e92('0x1'));var path=require(_0x1e92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e92('0x3')]();var fs_extra=require(_0x1e92('0x4'));var auth=require(_0x1e92('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e92('0x6'));router[_0x1e92('0x7')]('/',auth[_0x1e92('0x8')](),controller['index']);router[_0x1e92('0x7')](_0x1e92('0x9'),auth['isAuthenticated'](),controller[_0x1e92('0xa')]);router['get']('/:id',auth[_0x1e92('0x8')](),controller[_0x1e92('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1e92('0xc')](_0x1e92('0xd'),auth[_0x1e92('0x8')](),controller[_0x1e92('0xe')]);router[_0x1e92('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1e92('0x10')]);module[_0x1e92('0x11')]=router; \ No newline at end of file +var _0xed81=['index','/describe','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x4c40d4,_0xf233f7){var _0x381e2b=function(_0x129e82){while(--_0x129e82){_0x4c40d4['push'](_0x4c40d4['shift']());}};_0x381e2b(++_0xf233f7);}(_0xed81,0xb6));var _0x1ed8=function(_0x2a2617,_0x5c87e6){_0x2a2617=_0x2a2617-0x0;var _0x135a2c=_0xed81[_0x2a2617];return _0x135a2c;};'use strict';var multer=require(_0x1ed8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ed8('0x1'));var express=require(_0x1ed8('0x2'));var router=express[_0x1ed8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ed8('0x4'));var config=require(_0x1ed8('0x5'));var controller=require(_0x1ed8('0x6'));router[_0x1ed8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1ed8('0x8')]);router[_0x1ed8('0x7')](_0x1ed8('0x9'),auth[_0x1ed8('0xa')](),controller['describe']);router[_0x1ed8('0x7')]('/:id',auth[_0x1ed8('0xa')](),controller[_0x1ed8('0xb')]);router[_0x1ed8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ed8('0xd')](_0x1ed8('0xe'),auth[_0x1ed8('0xa')](),controller[_0x1ed8('0xf')]);router[_0x1ed8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1ed8('0x11')]);module[_0x1ed8('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 170cac8..feb239a 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0447=['exports','STRING','ENUM','account','queue','DATE','sequelize'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x0447,0x8b));var _0x7044=function(_0xf2f5de,_0x10038b){_0xf2f5de=_0xf2f5de-0x0;var _0x1be255=_0x0447[_0xf2f5de];return _0x1be255;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'uniqueid':{'type':Sequelize[_0x7044('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7044('0x3')](_0x7044('0x4'),'agent',_0x7044('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7044('0x6')]}}; \ No newline at end of file +var _0x1867=['DATE','sequelize','exports','ENUM','agent','queue'];(function(_0x1e7a62,_0x385681){var _0x3f1f8a=function(_0x26a1ef){while(--_0x26a1ef){_0x1e7a62['push'](_0x1e7a62['shift']());}};_0x3f1f8a(++_0x385681);}(_0x1867,0xb5));var _0x7186=function(_0x2172e0,_0x4568cf){_0x2172e0=_0x2172e0-0x0;var _0x1f9bf5=_0x1867[_0x2172e0];return _0x1f9bf5;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7186('0x2')]('account',_0x7186('0x3'),_0x7186('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7186('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ffcee2f..2c68370 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappTransferReport','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x26adf3,_0x35756a){var _0x298df9=function(_0x5d0843){while(--_0x5d0843){_0x26adf3['push'](_0x26adf3['shift']());}};_0x298df9(++_0x35756a);}(_0xef0f,0x168));var _0xfef0=function(_0x46de0c,_0x5b4038){_0x46de0c=_0x46de0c-0x0;var _0x562f1b=_0xef0f[_0x46de0c];return _0x562f1b;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['WhatsappTransferReport']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':!![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file +var _0x2652=['show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x1840b1,_0x2d021e){var _0x54ee73=function(_0x313ab9){while(--_0x313ab9){_0x1840b1['push'](_0x1840b1['shift']());}};_0x54ee73(++_0x2d021e);}(_0x2652,0x1e1));var _0x2265=function(_0x2ddded,_0x542bd7){_0x2ddded=_0x2ddded-0x0;var _0x1515bf=_0x2652[_0x2ddded];return _0x1515bf;};'use strict';var emlformat=require(_0x2265('0x0'));var rimraf=require(_0x2265('0x1'));var zipdir=require(_0x2265('0x2'));var jsonpatch=require(_0x2265('0x3'));var rp=require(_0x2265('0x4'));var moment=require(_0x2265('0x5'));var BPromise=require(_0x2265('0x6'));var Mustache=require(_0x2265('0x7'));var util=require(_0x2265('0x8'));var path=require(_0x2265('0x9'));var sox=require(_0x2265('0xa'));var csv=require('to-csv');var ejs=require(_0x2265('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2265('0xc'));var crypto=require(_0x2265('0xd'));var jsforce=require(_0x2265('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2265('0xf'));var querystring=require(_0x2265('0x10'));var Papa=require(_0x2265('0x11'));var Redis=require(_0x2265('0x12'));var authService=require(_0x2265('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2265('0x14'));var hardwareService=require(_0x2265('0x15'));var logger=require(_0x2265('0x16'))(_0x2265('0x17'));var utils=require(_0x2265('0x18'));var config=require(_0x2265('0x19'));var licenseUtil=require(_0x2265('0x1a'));var db=require(_0x2265('0x1b'))['db'];function respondWithStatusCode(_0x241f12,_0x30eb24){_0x30eb24=_0x30eb24||0xcc;return function(_0xcf994a){if(_0xcf994a){return _0x241f12[_0x2265('0x1c')](_0x30eb24);}return _0x241f12[_0x2265('0x1d')](_0x30eb24)[_0x2265('0x1e')]();};}function respondWithResult(_0x144d50,_0x57daf1){_0x57daf1=_0x57daf1||0xc8;return function(_0x5b16a5){if(_0x5b16a5){return _0x144d50[_0x2265('0x1d')](_0x57daf1)['json'](_0x5b16a5);}};}function respondWithFilteredResult(_0x1a0c73,_0x474480){return function(_0x2cbbd9){if(_0x2cbbd9){var _0x31c0e4=typeof _0x474480['offset']===_0x2265('0x1f')&&typeof _0x474480['limit']===_0x2265('0x1f');var _0x502ff3=_0x2cbbd9[_0x2265('0x20')];var _0x298752=_0x31c0e4?0x0:_0x474480[_0x2265('0x21')];var _0x5150d2=_0x31c0e4?_0x2cbbd9[_0x2265('0x20')]:_0x474480['offset']+_0x474480[_0x2265('0x22')];var _0x3a3916;if(_0x5150d2>=_0x502ff3){_0x5150d2=_0x502ff3;_0x3a3916=0xc8;}else{_0x3a3916=0xce;}_0x1a0c73[_0x2265('0x1d')](_0x3a3916);return _0x1a0c73[_0x2265('0x23')](_0x2265('0x24'),_0x298752+'-'+_0x5150d2+'/'+_0x502ff3)[_0x2265('0x25')](_0x2cbbd9);}return null;};}function patchUpdates(_0x217202){return function(_0x17b56e){try{jsonpatch[_0x2265('0x26')](_0x17b56e,_0x217202,!![]);}catch(_0x5ebc4b){return BPromise[_0x2265('0x27')](_0x5ebc4b);}return _0x17b56e['save']();};}function saveUpdates(_0x363ef2,_0x19315){return function(_0x5e012c){if(_0x5e012c){return _0x5e012c[_0x2265('0x28')](_0x363ef2)[_0x2265('0x29')](function(_0xc73f12){return _0xc73f12;});}return null;};}function removeEntity(_0x5a13bc,_0x2017bb){return function(_0x3cdaee){if(_0x3cdaee){return _0x3cdaee[_0x2265('0x2a')]()['then'](function(){_0x5a13bc[_0x2265('0x1d')](0xcc)[_0x2265('0x1e')]();});}};}function handleEntityNotFound(_0x31500e,_0x2095c2){return function(_0x311f05){if(!_0x311f05){_0x31500e[_0x2265('0x1c')](0x194);}return _0x311f05;};}function handleError(_0x1cceaa,_0x4c7c20){_0x4c7c20=_0x4c7c20||0x1f4;return function(_0x5703a1){logger['error'](_0x5703a1[_0x2265('0x2b')]);if(_0x5703a1[_0x2265('0x2c')]){delete _0x5703a1['name'];}_0x1cceaa[_0x2265('0x1d')](_0x4c7c20)['send'](_0x5703a1);};}exports[_0x2265('0x2d')]=function(_0x3fcd0b,_0x48419e){var _0x1e50fb={},_0x1f9392={},_0x4f5e5c={'count':0x0,'rows':[]};var _0x2cf32f=_['map'](db[_0x2265('0x2e')][_0x2265('0x2f')],function(_0x2e0da3){return{'name':_0x2e0da3[_0x2265('0x30')],'type':_0x2e0da3[_0x2265('0x31')][_0x2265('0x32')]};});_0x1f9392[_0x2265('0x33')]=_[_0x2265('0x34')](_0x2cf32f,_0x2265('0x2c'));_0x1f9392[_0x2265('0x35')]=_['keys'](_0x3fcd0b[_0x2265('0x35')]);_0x1f9392[_0x2265('0x36')]=_[_0x2265('0x37')](_0x1f9392[_0x2265('0x33')],_0x1f9392['query']);_0x1e50fb[_0x2265('0x38')]=_['intersection'](_0x1f9392[_0x2265('0x33')],qs[_0x2265('0x39')](_0x3fcd0b[_0x2265('0x35')][_0x2265('0x39')]));_0x1e50fb[_0x2265('0x38')]=_0x1e50fb[_0x2265('0x38')][_0x2265('0x3a')]?_0x1e50fb[_0x2265('0x38')]:_0x1f9392[_0x2265('0x33')];if(!_0x3fcd0b[_0x2265('0x35')][_0x2265('0x3b')](_0x2265('0x3c'))){_0x1e50fb[_0x2265('0x22')]=qs[_0x2265('0x22')](_0x3fcd0b[_0x2265('0x35')]['limit']);_0x1e50fb[_0x2265('0x21')]=qs['offset'](_0x3fcd0b['query'][_0x2265('0x21')]);}_0x1e50fb['order']=qs[_0x2265('0x3d')](_0x3fcd0b[_0x2265('0x35')][_0x2265('0x3d')]);_0x1e50fb[_0x2265('0x3e')]=qs['filters'](_[_0x2265('0x3f')](_0x3fcd0b[_0x2265('0x35')],_0x1f9392[_0x2265('0x36')]),_0x2cf32f);if(_0x3fcd0b[_0x2265('0x35')][_0x2265('0x40')]){_0x1e50fb['where']=_[_0x2265('0x41')](_0x1e50fb['where'],{'$or':_[_0x2265('0x34')](_0x2cf32f,function(_0x445454){if(_0x445454[_0x2265('0x31')]!==_0x2265('0x42')){var _0x110025={};_0x110025[_0x445454[_0x2265('0x2c')]]={'$like':'%'+_0x3fcd0b['query']['filter']+'%'};return _0x110025;}})});}_0x1e50fb=_[_0x2265('0x41')]({},_0x1e50fb,_0x3fcd0b['options']);var _0x3fc26c={'where':_0x1e50fb[_0x2265('0x3e')]};return db[_0x2265('0x2e')]['count'](_0x3fc26c)[_0x2265('0x29')](function(_0x2ddde9){_0x4f5e5c[_0x2265('0x20')]=_0x2ddde9;if(_0x3fcd0b[_0x2265('0x35')][_0x2265('0x43')]){_0x1e50fb[_0x2265('0x44')]=[{'all':!![]}];}return db[_0x2265('0x2e')][_0x2265('0x45')](_0x1e50fb);})[_0x2265('0x29')](function(_0x57b1b2){_0x4f5e5c[_0x2265('0x46')]=_0x57b1b2;return _0x4f5e5c;})['then'](respondWithFilteredResult(_0x48419e,_0x1e50fb))[_0x2265('0x47')](handleError(_0x48419e,null));};exports[_0x2265('0x48')]=function(_0xa22bfd,_0x3a575b){var _0xc01d1e={'raw':!![],'where':{'id':_0xa22bfd[_0x2265('0x49')]['id']}},_0x2a89a2={};_0x2a89a2[_0x2265('0x33')]=_['keys'](db[_0x2265('0x2e')][_0x2265('0x2f')]);_0x2a89a2[_0x2265('0x35')]=_['keys'](_0xa22bfd['query']);_0x2a89a2[_0x2265('0x36')]=_[_0x2265('0x37')](_0x2a89a2['model'],_0x2a89a2['query']);_0xc01d1e['attributes']=_[_0x2265('0x37')](_0x2a89a2['model'],qs[_0x2265('0x39')](_0xa22bfd[_0x2265('0x35')][_0x2265('0x39')]));_0xc01d1e[_0x2265('0x38')]=_0xc01d1e[_0x2265('0x38')][_0x2265('0x3a')]?_0xc01d1e[_0x2265('0x38')]:_0x2a89a2['model'];if(_0xa22bfd['query'][_0x2265('0x43')]){_0xc01d1e[_0x2265('0x44')]=[{'all':!![]}];}_0xc01d1e=_['merge']({},_0xc01d1e,_0xa22bfd[_0x2265('0x4a')]);return db[_0x2265('0x2e')][_0x2265('0x4b')](_0xc01d1e)[_0x2265('0x29')](handleEntityNotFound(_0x3a575b,null))[_0x2265('0x29')](respondWithResult(_0x3a575b,null))['catch'](handleError(_0x3a575b,null));};exports[_0x2265('0x4c')]=function(_0x28c590,_0x54cc15){return db[_0x2265('0x2e')][_0x2265('0x4c')](_0x28c590[_0x2265('0x4d')],{})['then'](respondWithResult(_0x54cc15,0xc9))['catch'](handleError(_0x54cc15,null));};exports[_0x2265('0x28')]=function(_0x44e5e1,_0x3e12c3){if(_0x44e5e1[_0x2265('0x4d')]['id']){delete _0x44e5e1[_0x2265('0x4d')]['id'];}return db['WhatsappTransferReport'][_0x2265('0x4b')]({'where':{'id':_0x44e5e1[_0x2265('0x49')]['id']}})[_0x2265('0x29')](handleEntityNotFound(_0x3e12c3,null))[_0x2265('0x29')](saveUpdates(_0x44e5e1[_0x2265('0x4d')],null))['then'](respondWithResult(_0x3e12c3,null))[_0x2265('0x47')](handleError(_0x3e12c3,null));};exports['destroy']=function(_0x2da2e0,_0x3eef52){return db[_0x2265('0x2e')]['find']({'where':{'id':_0x2da2e0[_0x2265('0x49')]['id']}})[_0x2265('0x29')](handleEntityNotFound(_0x3eef52,null))[_0x2265('0x29')](removeEntity(_0x3eef52,null))['catch'](handleError(_0x3eef52,null));};exports[_0x2265('0x4e')]=function(_0x2f182b,_0x2bdd23){return db[_0x2265('0x2e')][_0x2265('0x4e')]()[_0x2265('0x29')](respondWithResult(_0x2bdd23,null))[_0x2265('0x47')](handleError(_0x2bdd23,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 6b1ded5..973f721 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x009a=['bluebird','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','lodash','util','../../config/logger','api','moment'];(function(_0x117f87,_0x4a1be5){var _0x3b46ad=function(_0x36e7e0){while(--_0x36e7e0){_0x117f87['push'](_0x117f87['shift']());}};_0x3b46ad(++_0x4a1be5);}(_0x009a,0x109));var _0xa009=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x009a[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xa009('0x0'));var util=require(_0xa009('0x1'));var logger=require(_0xa009('0x2'))(_0xa009('0x3'));var moment=require(_0xa009('0x4'));var BPromise=require(_0xa009('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa009('0x6'));var attributes=require(_0xa009('0x7'));module['exports']=function(_0x241dcd,_0x94ae50){return _0x241dcd[_0xa009('0x8')](_0xa009('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x55e7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','WhatsappTransferReport','uniqueid','lodash'];(function(_0xdaf736,_0xd8c667){var _0x1090b3=function(_0x2eab2e){while(--_0x2eab2e){_0xdaf736['push'](_0xdaf736['shift']());}};_0x1090b3(++_0xd8c667);}(_0x55e7,0xf1));var _0x755e=function(_0x234cd7,_0x5c701f){_0x234cd7=_0x234cd7-0x0;var _0x5cc1d9=_0x55e7[_0x234cd7];return _0x5cc1d9;};'use strict';var _=require(_0x755e('0x0'));var util=require(_0x755e('0x1'));var logger=require(_0x755e('0x2'))(_0x755e('0x3'));var moment=require(_0x755e('0x4'));var BPromise=require(_0x755e('0x5'));var rp=require(_0x755e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x755e('0x7'));var config=require(_0x755e('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x160405,_0x477c30){return _0x160405['define'](_0x755e('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x755e('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index aa7d7d2..d57af35 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa107=['../../config/logger','rpc','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa107,0x7d));var _0x7a10=function(_0x256979,_0x507d07){_0x256979=_0x256979-0x0;var _0x4b59a5=_0xa107[_0x256979];return _0x4b59a5;};'use strict';var _=require(_0x7a10('0x0'));var util=require('util');var moment=require(_0x7a10('0x1'));var BPromise=require(_0x7a10('0x2'));var rs=require(_0x7a10('0x3'));var fs=require('fs');var Redis=require(_0x7a10('0x4'));var db=require(_0x7a10('0x5'))['db'];var utils=require(_0x7a10('0x6'));var logger=require(_0x7a10('0x7'))(_0x7a10('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a10('0x9'));var client=jayson['client'][_0x7a10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x470b85,_0x201e91,_0x186563){return new BPromise(function(_0x39f4e9,_0x21129d){return client[_0x7a10('0xb')](_0x470b85,_0x186563)[_0x7a10('0xc')](function(_0x1c5377){logger[_0x7a10('0xd')](_0x7a10('0xe'),_0x201e91,_0x7a10('0xf'));logger['debug'](_0x7a10('0x10'),_0x201e91,_0x7a10('0xf'),JSON[_0x7a10('0x11')](_0x1c5377));if(_0x1c5377[_0x7a10('0x12')]){if(_0x1c5377[_0x7a10('0x12')][_0x7a10('0x13')]===0x1f4){logger['error'](_0x7a10('0xe'),_0x201e91,_0x1c5377[_0x7a10('0x12')][_0x7a10('0x14')]);return _0x21129d(_0x1c5377['error']['message']);}logger[_0x7a10('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x201e91,_0x1c5377[_0x7a10('0x12')]['message']);return _0x39f4e9(_0x1c5377[_0x7a10('0x12')]['message']);}else{logger[_0x7a10('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x201e91,_0x7a10('0xf'));_0x39f4e9(_0x1c5377['result']['message']);}})[_0x7a10('0x15')](function(_0x3677f8){logger[_0x7a10('0x12')](_0x7a10('0xe'),_0x201e91,_0x3677f8);_0x21129d(_0x3677f8);});});} \ No newline at end of file +var _0x370a=['code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bd1aa,_0x2077aa){var _0x4bf239=function(_0x51f621){while(--_0x51f621){_0x2bd1aa['push'](_0x2bd1aa['shift']());}};_0x4bf239(++_0x2077aa);}(_0x370a,0x130));var _0xa370=function(_0x55714e,_0xcd2d9c){_0x55714e=_0x55714e-0x0;var _0x56d301=_0x370a[_0x55714e];return _0x56d301;};'use strict';var _=require(_0xa370('0x0'));var util=require(_0xa370('0x1'));var moment=require(_0xa370('0x2'));var BPromise=require(_0xa370('0x3'));var rs=require(_0xa370('0x4'));var fs=require('fs');var Redis=require(_0xa370('0x5'));var db=require(_0xa370('0x6'))['db'];var utils=require(_0xa370('0x7'));var logger=require(_0xa370('0x8'))(_0xa370('0x9'));var config=require(_0xa370('0xa'));var jayson=require(_0xa370('0xb'));var client=jayson[_0xa370('0xc')][_0xa370('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ed134,_0x4fa170,_0x1fbea5){return new BPromise(function(_0x29ea57,_0x598376){return client[_0xa370('0xe')](_0x5ed134,_0x1fbea5)['then'](function(_0x3a303a){logger[_0xa370('0xf')](_0xa370('0x10'),_0x4fa170,'request\x20sent');logger[_0xa370('0x11')](_0xa370('0x12'),_0x4fa170,'request\x20sent',JSON[_0xa370('0x13')](_0x3a303a));if(_0x3a303a[_0xa370('0x14')]){if(_0x3a303a['error'][_0xa370('0x15')]===0x1f4){logger[_0xa370('0x14')](_0xa370('0x10'),_0x4fa170,_0x3a303a[_0xa370('0x14')][_0xa370('0x16')]);return _0x598376(_0x3a303a['error'][_0xa370('0x16')]);}logger[_0xa370('0x14')](_0xa370('0x10'),_0x4fa170,_0x3a303a[_0xa370('0x14')]['message']);return _0x29ea57(_0x3a303a[_0xa370('0x14')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x4fa170,_0xa370('0x17'));_0x29ea57(_0x3a303a['result'][_0xa370('0x16')]);}})[_0xa370('0x18')](function(_0x1f1ea9){logger['error'](_0xa370('0x10'),_0x4fa170,_0x1f1ea9);_0x598376(_0x1f1ea9);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index b024bc8..b933be9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04e7=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','filter','map','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0x04e7,0x121));var _0x704e=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0x04e7[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0x704e('0x0'));var db=require(_0x704e('0x1'))['db'];var seedDb=require(_0x704e('0x2'));var checkLicense=require(_0x704e('0x3'));var rpc=require(_0x704e('0x4'));var config=require(_0x704e('0x5'));var logger=require(_0x704e('0x6'))(_0x704e('0x7'));var pm2=require(_0x704e('0x8'));var pm2Config=require(_0x704e('0x9'));var schedule=require(_0x704e('0xa'));var chat=require(_0x704e('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x704e('0xc'));var provider=require(_0x704e('0xd'));function main(){return db[_0x704e('0xe')][_0x704e('0xf')]()[_0x704e('0x10')](function(){if(config[_0x704e('0x11')]){return seedDb[_0x704e('0x12')]();}})[_0x704e('0x10')](function(){return checkLicense[_0x704e('0x12')]();})[_0x704e('0x10')](function(){return rpc[_0x704e('0x13')]();})[_0x704e('0x10')](function(_0x48dc9b){logger[_0x704e('0x14')](_0x48dc9b);return chat[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return whatsapp[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return schedule[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return transcribe['start']();})['then'](function(){return provider[_0x704e('0x15')]();})[_0x704e('0x10')](function(_0x12a46c){logger[_0x704e('0x14')](_0x12a46c);return pm2[_0x704e('0x15')](pm2Config);})[_0x704e('0x10')](function(_0x2abf61){var _0x33a743=_0x2abf61['filter'](function(_0xed4c87){return typeof _0xed4c87[_0x704e('0x16')]===_0x704e('0x17')&&_0xed4c87['exitCode']>=0x0;});if(_0x33a743[_0x704e('0x18')]>0x0){throw new Error(_0x33a743[_0x704e('0x18')]+_0x704e('0x19')+_['map'](_0x33a743,function(_0x1b347a){return'\x22'+_0x1b347a[_0x704e('0x1a')][_0x704e('0x1b')]+'\x22';}));}logger[_0x704e('0x14')](_0x704e('0x1c'),_['map'](_[_0x704e('0x1d')](_0x2abf61,{'status':'online'}),_0x704e('0x1b'))['join']());logger['info']('Offline\x20apps:',_[_0x704e('0x1e')](_[_0x704e('0x1d')](_0x2abf61,function(_0xb6e2c8){return _0xb6e2c8['status']!=='online';}),_0x704e('0x1b'))[_0x704e('0x1f')]()||_0x704e('0x20'));console[_0x704e('0x21')](_0x704e('0x22'));})[_0x704e('0x23')](function(_0x30a391){console[_0x704e('0x21')](_0x704e('0x24'),_0x30a391);logger[_0x704e('0x25')](_0x704e('0x26'),_0x30a391);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x0b3d=['default','listen','then','start','info','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','status','online','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./rpc','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','seedDB'];(function(_0x1a69e5,_0xed12ee){var _0x244ab8=function(_0x556e78){while(--_0x556e78){_0x1a69e5['push'](_0x1a69e5['shift']());}};_0x244ab8(++_0xed12ee);}(_0x0b3d,0x76));var _0xd0b3=function(_0x13eddd,_0x2bb439){_0x13eddd=_0x13eddd-0x0;var _0x3125b5=_0x0b3d[_0x13eddd];return _0x3125b5;};'use strict';var _=require(_0xd0b3('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xd0b3('0x1'));var checkLicense=require('./config/license');var rpc=require(_0xd0b3('0x2'));var config=require('./config/environment');var logger=require(_0xd0b3('0x3'))('app');var pm2=require(_0xd0b3('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xd0b3('0x5'));var chat=require(_0xd0b3('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd0b3('0x7'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xd0b3('0x8')]['sync']()['then'](function(){if(config[_0xd0b3('0x9')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xd0b3('0xa')]();})['then'](function(){return rpc[_0xd0b3('0xb')]();})[_0xd0b3('0xc')](function(_0x5950d7){logger['info'](_0x5950d7);return chat[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return whatsapp[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return provider[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(_0x1f2544){logger[_0xd0b3('0xe')](_0x1f2544);return pm2[_0xd0b3('0xd')](pm2Config);})['then'](function(_0x2d1376){var _0xbd5d4=_0x2d1376[_0xd0b3('0xf')](function(_0x28d379){return typeof _0x28d379['exitCode']===_0xd0b3('0x10')&&_0x28d379[_0xd0b3('0x11')]>=0x0;});if(_0xbd5d4[_0xd0b3('0x12')]>0x0){throw new Error(_0xbd5d4['length']+_0xd0b3('0x13')+_[_0xd0b3('0x14')](_0xbd5d4,function(_0x50ea99){return'\x22'+_0x50ea99[_0xd0b3('0x15')][_0xd0b3('0x16')]+'\x22';}));}logger['info'](_0xd0b3('0x17'),_[_0xd0b3('0x14')](_[_0xd0b3('0xf')](_0x2d1376,{'status':'online'}),_0xd0b3('0x16'))[_0xd0b3('0x18')]());logger[_0xd0b3('0xe')]('Offline\x20apps:',_['map'](_[_0xd0b3('0xf')](_0x2d1376,function(_0x4f755f){return _0x4f755f[_0xd0b3('0x19')]!==_0xd0b3('0x1a');}),_0xd0b3('0x16'))[_0xd0b3('0x18')]()||_0xd0b3('0x1b'));console['log']('App\x20Ready!');})['catch'](function(_0x2925ae){console[_0xd0b3('0x1c')](_0xd0b3('0x1d'),_0x2925ae);logger[_0xd0b3('0x1e')](_0xd0b3('0x1f'),_0x2925ae);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e4610d5..b87f9e2 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 _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x447a24,_0x49ecbc){var _0x320dbf=function(_0xca00b){while(--_0xca00b){_0x447a24['push'](_0x447a24['shift']());}};_0x320dbf(++_0x49ecbc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x432f0b,_0x289dff){var _0x36ebb4=function(_0x2f2999){while(--_0x2f2999){_0x432f0b['push'](_0x432f0b['shift']());}};_0x36ebb4(++_0x289dff);}(_0x55ca,0x126));var _0xa55c=function(_0x114ae4,_0x14bdc9){_0x114ae4=_0x114ae4-0x0;var _0x32f566=_0x55ca[_0x114ae4];return _0x32f566;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 5ca1fb9..f273383 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x134796,_0xd3c92e){var _0x27c216=function(_0x5c0dcb){while(--_0x5c0dcb){_0x134796['push'](_0x134796['shift']());}};_0x27c216(++_0xd3c92e);}(_0x2032,0xd9));var _0x2203=function(_0x5b0c38,_0x286c22){_0x5b0c38=_0x5b0c38-0x0;var _0x24b085=_0x2032[_0x5b0c38];return _0x24b085;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file +var _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 3cb09b4..45bff8b 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9af9=['../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','autocomplete','true','select','from','cm_contacts','subqry','left_join','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','CompanyId','updatedAt','deletedAt','includes','push','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','dateOfBirth','datetime','castTo','buildExpression','type','text','start','value','end','Tag','map','tags','clause','and','ids','user','uc.UserId\x20=\x20?','keys','name','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','group','limit','offset','subqry.id','order','DESC','findAll','color','keyBy','QueryTypes','SELECT','CmContact','sequelize','Tags','c.id','t.id\x20IN\x20?','Sequelize','query','toString','COUNT(*)','exports','lodash','squel'];(function(_0x3c456b,_0x12251b){var _0x4c7e1a=function(_0x3d74bc){while(--_0x3d74bc){_0x3c456b['push'](_0x3c456b['shift']());}};_0x4c7e1a(++_0x12251b);}(_0x9af9,0x19e));var _0x99af=function(_0x1a7231,_0x4f45f0){_0x1a7231=_0x1a7231-0x0;var _0x350f58=_0x9af9[_0x1a7231];return _0x350f58;};'use strict';var _=require(_0x99af('0x0'));var squel=require(_0x99af('0x1'));var as=require(_0x99af('0x2'));var qs=require(_0x99af('0x3'));var utils=require(_0x99af('0x4'));var db=require(_0x99af('0x5'))['db'];function skipContactsQuery(_0x148b51,_0x5e0e73){var _0x1e7aa=![];if(_0x148b51[_0x99af('0x6')]===_0x99af('0x7')&&!_0x5e0e73['search']&&!_0x5e0e73[_0x99af('0x8')]&&_0x5e0e73[_0x99af('0x9')]!==_0x99af('0xa')){_0x1e7aa=!![];}return _0x1e7aa;}function getContactsSubquery(){return squel[_0x99af('0xb')]()[_0x99af('0xc')](_0x99af('0xd'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x29bccf,_0x3f55f4){var _0x27ac8f=_0x3f55f4?'c':_0x99af('0xe');_0x29bccf[_0x99af('0xf')]('cm_user_has_contacts','uc',_0x99af('0x10')+_0x27ac8f+_0x99af('0x11'))[_0x99af('0xf')]('cm_contact_has_tags','ct',_0x99af('0x12')+_0x27ac8f+_0x99af('0x11'))[_0x99af('0xf')](_0x99af('0x13'),'t',_0x99af('0x14'));return _0x29bccf;}function addFieldsToQuery(_0x81d1da,_0x5dd44b,_0x37ef16,_0xa2693c,_0x17dd04){var _0x449965=_0x17dd04?'c':_0x99af('0xe');if(!_0x5dd44b){_0x5dd44b=['id',_0x99af('0x15'),_0x99af('0x16'),_0x99af('0x17'),_0x99af('0x18'),_0x99af('0x19'),'email',_0x99af('0x8'),_0x99af('0x1a'),'createdAt',_0x99af('0x1b'),_0x99af('0x1c'),'TagIds'];}else if(!_0x5dd44b[_0x99af('0x1d')]('id')){_0x5dd44b[_0x99af('0x1e')]('id');}var _0xfff4b5=_0x37ef16&&_0x17dd04||!_0x37ef16&&!_0x17dd04;if(_0xa2693c){_0xfff4b5=_0xa2693c&&_0x17dd04||!_0xa2693c&&!_0x17dd04;}_0x5dd44b['forEach'](function(_0x785d48){if(_0x785d48===_0x99af('0x1f')){if(_0xfff4b5){_0x81d1da[_0x99af('0x20')](_0x99af('0x21'),_0x785d48);}else if(_0x37ef16||_0xa2693c){_0x81d1da[_0x99af('0x20')](_0x449965+'.'+_0x785d48);}}else{_0x81d1da[_0x99af('0x20')](_0x449965+'.'+_0x785d48);}});return _0x81d1da;}function getSqlClauses(){var _0x3d65b2={'default':squel[_0x99af('0x22')](),'fields':squel[_0x99af('0x22')](),'filter':squel[_0x99af('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x99af('0x22')](),'skip':![]}};return _0x3d65b2;}function parseTagParameter(_0x3974d7){var _0x15dd15=squel[_0x99af('0x22')]();if(_0x3974d7){var _0x3b9235=utils['getSelectedTags'](_0x3974d7);_0x3b9235[_0x99af('0x23')](function(_0xd9a25a){_0x15dd15['or'](_0x99af('0x24'),'%,'+_0xd9a25a+',%');});}return _0x15dd15;}function parseSearchFilter(_0x195022){var _0x1b581=squel[_0x99af('0x22')]();if(_0x195022){var _0x3aa05f=_0x195022[_0x99af('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3aa05f[_0x99af('0x26')]('\x20')[_0x99af('0x27')]>0x1){_0x1b581['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x99af('0x28')](_0x3aa05f),null);}else{if(qs['isNumeric'](_0x3aa05f)){_0x1b581['or'](_0x99af('0x29'),_0x3aa05f+'%');_0x1b581['or'](_0x99af('0x2a'),_0x3aa05f+'%');_0x1b581['or'](_0x99af('0x2b'),_0x3aa05f+'%');_0x1b581['or'](_0x99af('0x2c'),_0x3aa05f+'%');}else if(qs['isEmail'](_0x3aa05f)){_0x1b581['or']('c.email\x20LIKE\x20?',_0x3aa05f+'%');}else{_0x1b581['or'](_0x99af('0x2d'),'%'+_0x3aa05f+'%');_0x1b581['or'](_0x99af('0x2e'),'%'+_0x3aa05f+'%');_0x1b581['or']('c.email\x20LIKE\x20?','%'+_0x3aa05f+'%');}}}return _0x1b581;}function parseAdvancedSearchFilter(_0x501928,_0x50ed11){var _0x51b373=getSqlClauses();var _0x5f09c6=as[_0x99af('0x2f')](_0x501928);var _0x32c330=_0x5f09c6[_0x99af('0x30')];for(var _0x2fa00a=0x0;_0x2fa00a<_0x5f09c6[_0x99af('0x31')][_0x99af('0x27')];_0x2fa00a++){var _0x16245d=_0x5f09c6[_0x99af('0x31')][_0x2fa00a];var _0x1a0d9f='c';var _0x2e86de=_['find'](_0x50ed11,['name',_0x16245d[_0x99af('0x20')]]);if(_0x2e86de){if(_0x16245d[_0x99af('0x20')]===_0x99af('0x32')||_0x2e86de['fieldType']===_0x99af('0x33')){_0x16245d[_0x99af('0x34')]='DATE';}var _0x3936cf=as[_0x99af('0x35')](_0x1a0d9f,_0x2e86de[_0x99af('0x36')],_0x16245d);_0x51b373['default'][_0x32c330](_0x3936cf[_0x99af('0x37')],_0x3936cf['value'][_0x99af('0x38')],_0x3936cf[_0x99af('0x39')][_0x99af('0x3a')]);}else{if(_0x16245d[_0x99af('0x20')]===_0x99af('0x3b')){var _0x1188d0=_0x16245d['value'][_0x99af('0x26')](',')[_0x99af('0x3c')](function(_0xea0056){return Number(_0xea0056);});var _0x5d6ec6=parseTagParameter(_0x1188d0);_0x51b373[_0x99af('0x3d')][_0x99af('0x3e')][_0x99af('0x3f')](_0x5d6ec6);_0x51b373[_0x99af('0x3d')][_0x99af('0x40')]=_0x1188d0;}else if(_0x16245d[_0x99af('0x20')]==='User'){_0x51b373[_0x99af('0x41')]['clause']['and'](_0x99af('0x42'),_0x16245d['value']);_0x51b373[_0x99af('0x41')]['skip']=!![];}}}return _0x51b373;}function parseModelFields(_0xa5181e,_0x168010){var _0xba2832=squel['expr']();var _0x492e72=_(_0xa5181e)[_0x99af('0x43')]()[_0x99af('0x3c')](function(_0x3ee6bb){return _['some'](_0x168010,[_0x99af('0x44'),_0x3ee6bb])?_0x3ee6bb:undefined;})[_0x99af('0x45')]()[_0x99af('0x39')]();if(_0xa5181e['Contact']){_0x492e72[_0x99af('0x1e')](_0x99af('0x46'));}if(_0x492e72['length']>0x0){_0x492e72['forEach'](function(_0x283895){if(_0x283895===_0x99af('0x8')){_0xba2832['and'](_0x99af('0x47'),[][_0x99af('0x48')](_0xa5181e[_0x283895]));}else if(_0x283895==='Contact'){var _0x19accf='%'+_0xa5181e[_0x283895]+'%';_0xba2832['and'](_0x99af('0x49'),_0x19accf);}else{_0xba2832['and']('c.'+_0x283895+_0x99af('0x4a'),_0xa5181e[_0x283895]);}});}return _0xba2832;}function parseQueryParameters(_0x14de30,_0x1d2e1e){var _0x2f6166=getSqlClauses();return Promise[_0x99af('0x4b')]()[_0x99af('0x4c')](function(){return parseModelFields(_0x14de30,_0x1d2e1e);})[_0x99af('0x4c')](function(_0x37ace9){_0x2f6166[_0x99af('0x4d')]['and'](_0x37ace9);return parseTagParameter(_0x14de30[_0x99af('0x4e')]);})[_0x99af('0x4c')](function(_0x15497c){_0x2f6166['tags'][_0x99af('0x3e')][_0x99af('0x3f')](_0x15497c);return parseSearchFilter(_0x14de30[_0x99af('0x4f')]);})[_0x99af('0x4c')](function(_0x581c9f){_0x2f6166[_0x99af('0x4f')]=_0x581c9f;return _0x2f6166;});}function checkListsRestrictions(_0x288117,_0x57efd1,_0xe9fc18){var _0x4e2b4a=squel[_0x99af('0x22')]();return Promise[_0x99af('0x4b')]()[_0x99af('0x4c')](function(){if(_0x57efd1[_0x99af('0x50')]&&_0x288117[_0x99af('0x6')]==='agent'&&!_0xe9fc18){return _0x288117[_0x99af('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x99af('0x4c')](function(_0x4acc6e){if(_0x4acc6e){if(_0x4acc6e[_0x99af('0x27')]===0x0){_0x4e2b4a[_0x99af('0x3f')](_0x99af('0x52'));}else{_0x4e2b4a[_0x99af('0x3f')](_0x99af('0x47'),_[_0x99af('0x3c')](_0x4acc6e,'id'));}}})[_0x99af('0x4c')](function(){return _0x4e2b4a;});}function buildContactsQuery(_0x42870f,_0x26ea74,_0x5b2d3f,_0x31a9bb,_0x3c78a9,_0x8b3e73){if(_0x26ea74){_0x26ea74=_0x5b2d3f['attributes'];}_0x42870f=addFieldsToQuery(_0x42870f,_0x26ea74,_0x31a9bb,_0x8b3e73,!![]);var _0x21c36c=squel[_0x99af('0xb')]();_0x21c36c=addFieldsToQuery(_0x21c36c,_0x26ea74,_0x31a9bb,_0x8b3e73,![]);if(_0x31a9bb||_0x8b3e73){_0x42870f=applyJoinClauses(_0x42870f,!![]);_0x42870f[_0x99af('0x53')]('c.id');if(_0x5b2d3f[_0x99af('0x54')]){_0x21c36c[_0x99af('0x54')](_0x5b2d3f[_0x99af('0x54')]);}if(_0x5b2d3f[_0x99af('0x55')]){_0x21c36c[_0x99af('0x55')](_0x5b2d3f['offset']);}}else{_0x21c36c=applyJoinClauses(_0x21c36c,![]);_0x21c36c[_0x99af('0x53')](_0x99af('0x56'));if(_0x5b2d3f['limit']){_0x42870f[_0x99af('0x54')](_0x5b2d3f['limit']);}if(_0x5b2d3f[_0x99af('0x55')]){_0x42870f[_0x99af('0x55')](_0x5b2d3f[_0x99af('0x55')]);}}_0x21c36c['having'](_0x3c78a9);if(_0x5b2d3f[_0x99af('0x57')]){_0x5b2d3f[_0x99af('0x57')][_0x99af('0x23')](function(_0x62e8c3){_0x42870f[_0x99af('0x57')]('c.'+_0x62e8c3[0x0],_0x62e8c3[0x1]===_0x99af('0x58')?![]:!![]);_0x21c36c[_0x99af('0x57')]('subqry.'+_0x62e8c3[0x0],_0x62e8c3[0x1]==='DESC'?![]:!![]);});}_0x21c36c[_0x99af('0xc')](_0x42870f,_0x99af('0xe'));return _0x21c36c;}function getFilteredContacts(_0xed69ba){var _0x1bf41a=[];return db['Tag'][_0x99af('0x59')]({'attributes':['id',_0x99af('0x44'),_0x99af('0x5a')],'raw':!![]})[_0x99af('0x4c')](function(_0x249d14){_0x1bf41a=_[_0x99af('0x5b')](_0x249d14,'id');var _0x175602={'type':db['Sequelize'][_0x99af('0x5c')][_0x99af('0x5d')],'model':db[_0x99af('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x99af('0x5f')]['query'](_0xed69ba['toString'](),_0x175602);})[_0x99af('0x4c')](function(_0x2cb8ad){_0x2cb8ad['forEach'](function(_0x1a3895){if(_0x1a3895[_0x99af('0x1f')]){_0x1a3895[_0x99af('0x60')]=[];_0x1a3895[_0x99af('0x1f')]['split'](',')[_0x99af('0x23')](function(_0x10f958){_0x1a3895[_0x99af('0x60')]['push'](_0x1bf41a[_0x10f958]);});}delete _0x1a3895[_0x99af('0x1f')];});return _0x2cb8ad;});}function countFilteredContacts(_0x2f2c4,_0x2cd3a5){var _0x3de914=_0x2f2c4['clone']();_0x3de914[_0x99af('0x20')]('COUNT(*)');_0x3de914=applyJoinClauses(_0x3de914,!![]);_0x2f2c4[_0x99af('0x53')](_0x99af('0x61'));var _0x341203=utils['getSelectedTags'](_0x2cd3a5);if(!_['isEmpty'](_0x341203)){_0x3de914['where'](_0x99af('0x62'),_0x341203);}var _0x3f2882={'type':db[_0x99af('0x63')]['QueryTypes'][_0x99af('0x5d')],'raw':!![]};return db[_0x99af('0x5f')][_0x99af('0x64')](_0x3de914[_0x99af('0x65')](),_0x3f2882)[_0x99af('0x4c')](function(_0x43b990){return _0x43b990[0x0][_0x99af('0x66')];});}module[_0x99af('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x919c=['parseSearch','sqlOperator','conditions','find','fieldType','castTo','DATE','default','text','value','start','end','Tag','map','tags','clause','and','ids','uc.UserId\x20=\x20?','user','skip','keys','some','name','compact','Contact','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','sequelize','toString','Tags','clone','COUNT(*)','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','phone','mobile','email','CompanyId','updatedAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x919c,0x108));var _0xc919=function(_0x4bb2f0,_0xc7dae3){_0x4bb2f0=_0x4bb2f0-0x0;var _0x2ade54=_0x919c[_0x4bb2f0];return _0x2ade54;};'use strict';var _=require('lodash');var squel=require(_0xc919('0x0'));var as=require(_0xc919('0x1'));var qs=require('../parsers/qs');var utils=require(_0xc919('0x2'));var db=require(_0xc919('0x3'))['db'];function skipContactsQuery(_0x559acf,_0x17727d){var _0x3fc2e7=![];if(_0x559acf[_0xc919('0x4')]===_0xc919('0x5')&&!_0x17727d[_0xc919('0x6')]&&!_0x17727d[_0xc919('0x7')]&&_0x17727d[_0xc919('0x8')]!==_0xc919('0x9')){_0x3fc2e7=!![];}return _0x3fc2e7;}function getContactsSubquery(){return squel['select']()[_0xc919('0xa')](_0xc919('0xb'),'c')[_0xc919('0xc')](_0xc919('0xd'));}function applyJoinClauses(_0x1d6f28,_0x53306e){var _0x16c306=_0x53306e?'c':_0xc919('0xe');_0x1d6f28[_0xc919('0xf')](_0xc919('0x10'),'uc',_0xc919('0x11')+_0x16c306+_0xc919('0x12'))[_0xc919('0xf')](_0xc919('0x13'),'ct',_0xc919('0x14')+_0x16c306+_0xc919('0x12'))['left_join'](_0xc919('0x15'),'t','t.id\x20=\x20ct.TagId');return _0x1d6f28;}function addFieldsToQuery(_0x17a7a8,_0xf8cae7,_0x260ec0,_0xa4adba,_0x574232){var _0x337685=_0x574232?'c':_0xc919('0xe');if(!_0xf8cae7){_0xf8cae7=['id',_0xc919('0x16'),_0xc919('0x17'),_0xc919('0x18'),_0xc919('0x19'),'fax',_0xc919('0x1a'),_0xc919('0x7'),_0xc919('0x1b'),'createdAt',_0xc919('0x1c'),_0xc919('0x1d'),_0xc919('0x1e')];}else if(!_0xf8cae7[_0xc919('0x1f')]('id')){_0xf8cae7[_0xc919('0x20')]('id');}var _0x4c2bcb=_0x260ec0&&_0x574232||!_0x260ec0&&!_0x574232;if(_0xa4adba){_0x4c2bcb=_0xa4adba&&_0x574232||!_0xa4adba&&!_0x574232;}_0xf8cae7[_0xc919('0x21')](function(_0xd2bec9){if(_0xd2bec9==='TagIds'){if(_0x4c2bcb){_0x17a7a8['field'](_0xc919('0x22'),_0xd2bec9);}else if(_0x260ec0||_0xa4adba){_0x17a7a8[_0xc919('0x23')](_0x337685+'.'+_0xd2bec9);}}else{_0x17a7a8[_0xc919('0x23')](_0x337685+'.'+_0xd2bec9);}});return _0x17a7a8;}function getSqlClauses(){var _0x113e75={'default':squel[_0xc919('0x24')](),'fields':squel['expr'](),'filter':squel[_0xc919('0x24')](),'tags':{'clause':squel[_0xc919('0x24')](),'ids':null},'user':{'clause':squel[_0xc919('0x24')](),'skip':![]}};return _0x113e75;}function parseTagParameter(_0x2da8e7){var _0x4b18a9=squel[_0xc919('0x24')]();if(_0x2da8e7){var _0x1a9c6c=utils[_0xc919('0x25')](_0x2da8e7);_0x1a9c6c[_0xc919('0x21')](function(_0x25c203){_0x4b18a9['or'](_0xc919('0x26'),'%,'+_0x25c203+',%');});}return _0x4b18a9;}function parseSearchFilter(_0x17d348){var _0x3fd26e=squel[_0xc919('0x24')]();if(_0x17d348){var _0x4a464e=_0x17d348[_0xc919('0x27')]('\x5c','\x5c\x5c')[_0xc919('0x27')](/'/g,'\x27\x27');if(_0x4a464e[_0xc919('0x28')]('\x20')[_0xc919('0x29')]>0x1){_0x3fd26e['or'](_0xc919('0x2a'),qs[_0xc919('0x2b')](_0x4a464e),null);}else{if(qs[_0xc919('0x2c')](_0x4a464e)){_0x3fd26e['or'](_0xc919('0x2d'),_0x4a464e+'%');_0x3fd26e['or']('c.phone\x20LIKE\x20?',_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x2e'),_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x2f'),_0x4a464e+'%');}else if(qs[_0xc919('0x30')](_0x4a464e)){_0x3fd26e['or'](_0xc919('0x31'),_0x4a464e+'%');}else{_0x3fd26e['or'](_0xc919('0x32'),'%'+_0x4a464e+'%');_0x3fd26e['or']('c.lastName\x20LIKE\x20?','%'+_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x31'),'%'+_0x4a464e+'%');}}}return _0x3fd26e;}function parseAdvancedSearchFilter(_0x4993f8,_0x683064){var _0x2be52c=getSqlClauses();var _0x5d8255=as[_0xc919('0x33')](_0x4993f8);var _0x26a577=_0x5d8255[_0xc919('0x34')];for(var _0x2d1206=0x0;_0x2d1206<_0x5d8255[_0xc919('0x35')]['length'];_0x2d1206++){var _0x40894e=_0x5d8255[_0xc919('0x35')][_0x2d1206];var _0x2193b6='c';var _0x1b2136=_[_0xc919('0x36')](_0x683064,['name',_0x40894e[_0xc919('0x23')]]);if(_0x1b2136){if(_0x40894e[_0xc919('0x23')]==='dateOfBirth'||_0x1b2136[_0xc919('0x37')]==='datetime'){_0x40894e[_0xc919('0x38')]=_0xc919('0x39');}var _0x529e79=as['buildExpression'](_0x2193b6,_0x1b2136['type'],_0x40894e);_0x2be52c[_0xc919('0x3a')][_0x26a577](_0x529e79[_0xc919('0x3b')],_0x529e79[_0xc919('0x3c')][_0xc919('0x3d')],_0x529e79[_0xc919('0x3c')][_0xc919('0x3e')]);}else{if(_0x40894e['field']===_0xc919('0x3f')){var _0xd59867=_0x40894e[_0xc919('0x3c')]['split'](',')[_0xc919('0x40')](function(_0x3d7c0f){return Number(_0x3d7c0f);});var _0x283cc5=parseTagParameter(_0xd59867);_0x2be52c[_0xc919('0x41')][_0xc919('0x42')][_0xc919('0x43')](_0x283cc5);_0x2be52c[_0xc919('0x41')][_0xc919('0x44')]=_0xd59867;}else if(_0x40894e[_0xc919('0x23')]==='User'){_0x2be52c['user'][_0xc919('0x42')][_0xc919('0x43')](_0xc919('0x45'),_0x40894e['value']);_0x2be52c[_0xc919('0x46')][_0xc919('0x47')]=!![];}}}return _0x2be52c;}function parseModelFields(_0x39258a,_0xd449d7){var _0xe1f533=squel[_0xc919('0x24')]();var _0x26ac16=_(_0x39258a)[_0xc919('0x48')]()[_0xc919('0x40')](function(_0x17a042){return _[_0xc919('0x49')](_0xd449d7,[_0xc919('0x4a'),_0x17a042])?_0x17a042:undefined;})[_0xc919('0x4b')]()['value']();if(_0x39258a[_0xc919('0x4c')]){_0x26ac16[_0xc919('0x20')](_0xc919('0x4c'));}if(_0x26ac16[_0xc919('0x29')]>0x0){_0x26ac16['forEach'](function(_0x1ac687){if(_0x1ac687==='ListId'){_0xe1f533[_0xc919('0x43')](_0xc919('0x4d'),[]['concat'](_0x39258a[_0x1ac687]));}else if(_0x1ac687===_0xc919('0x4c')){var _0x41f2af='%'+_0x39258a[_0x1ac687]+'%';_0xe1f533[_0xc919('0x43')](_0xc919('0x4e'),_0x41f2af);}else{_0xe1f533[_0xc919('0x43')]('c.'+_0x1ac687+_0xc919('0x4f'),_0x39258a[_0x1ac687]);}});}return _0xe1f533;}function parseQueryParameters(_0x8a7847,_0x17d021){var _0x1fbd7d=getSqlClauses();return Promise[_0xc919('0x50')]()[_0xc919('0x51')](function(){return parseModelFields(_0x8a7847,_0x17d021);})[_0xc919('0x51')](function(_0x473f0e){_0x1fbd7d[_0xc919('0x52')]['and'](_0x473f0e);return parseTagParameter(_0x8a7847[_0xc919('0x53')]);})['then'](function(_0x28a7a4){_0x1fbd7d[_0xc919('0x41')][_0xc919('0x42')][_0xc919('0x43')](_0x28a7a4);return parseSearchFilter(_0x8a7847[_0xc919('0x54')]);})[_0xc919('0x51')](function(_0x5b81d2){_0x1fbd7d[_0xc919('0x54')]=_0x5b81d2;return _0x1fbd7d;});}function checkListsRestrictions(_0x347bdb,_0x473085,_0x396759){var _0x59344e=squel[_0xc919('0x24')]();return Promise[_0xc919('0x50')]()[_0xc919('0x51')](function(){if(_0x473085['search']&&_0x347bdb[_0xc919('0x4')]===_0xc919('0x5')&&!_0x396759){return _0x347bdb['getLists']({'attributes':['id'],'raw':!![]});}})[_0xc919('0x51')](function(_0x1e370f){if(_0x1e370f){if(_0x1e370f[_0xc919('0x29')]===0x0){_0x59344e[_0xc919('0x43')](_0xc919('0x55'));}else{_0x59344e[_0xc919('0x43')](_0xc919('0x4d'),_[_0xc919('0x40')](_0x1e370f,'id'));}}})['then'](function(){return _0x59344e;});}function buildContactsQuery(_0x471840,_0x1986c5,_0x5758ca,_0x4095f8,_0xcced9f,_0x2f0ec5){if(_0x1986c5){_0x1986c5=_0x5758ca[_0xc919('0x56')];}_0x471840=addFieldsToQuery(_0x471840,_0x1986c5,_0x4095f8,_0x2f0ec5,!![]);var _0x3c8acd=squel['select']();_0x3c8acd=addFieldsToQuery(_0x3c8acd,_0x1986c5,_0x4095f8,_0x2f0ec5,![]);if(_0x4095f8||_0x2f0ec5){_0x471840=applyJoinClauses(_0x471840,!![]);_0x471840[_0xc919('0x57')]('c.id');if(_0x5758ca[_0xc919('0x58')]){_0x3c8acd[_0xc919('0x58')](_0x5758ca[_0xc919('0x58')]);}if(_0x5758ca[_0xc919('0x59')]){_0x3c8acd[_0xc919('0x59')](_0x5758ca[_0xc919('0x59')]);}}else{_0x3c8acd=applyJoinClauses(_0x3c8acd,![]);_0x3c8acd['group'](_0xc919('0x5a'));if(_0x5758ca[_0xc919('0x58')]){_0x471840[_0xc919('0x58')](_0x5758ca['limit']);}if(_0x5758ca[_0xc919('0x59')]){_0x471840[_0xc919('0x59')](_0x5758ca[_0xc919('0x59')]);}}_0x3c8acd[_0xc919('0x5b')](_0xcced9f);if(_0x5758ca[_0xc919('0x5c')]){_0x5758ca[_0xc919('0x5c')][_0xc919('0x21')](function(_0x3ea925){_0x471840[_0xc919('0x5c')]('c.'+_0x3ea925[0x0],_0x3ea925[0x1]===_0xc919('0x5d')?![]:!![]);_0x3c8acd[_0xc919('0x5c')]('subqry.'+_0x3ea925[0x0],_0x3ea925[0x1]==='DESC'?![]:!![]);});}_0x3c8acd[_0xc919('0xa')](_0x471840,'subqry');return _0x3c8acd;}function getFilteredContacts(_0x499e9a){var _0x2fd483=[];return db[_0xc919('0x3f')][_0xc919('0x5e')]({'attributes':['id',_0xc919('0x4a'),'color'],'raw':!![]})['then'](function(_0xa367e2){_0x2fd483=_[_0xc919('0x5f')](_0xa367e2,'id');var _0x404f44={'type':db[_0xc919('0x60')][_0xc919('0x61')][_0xc919('0x62')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xc919('0x63')]['query'](_0x499e9a[_0xc919('0x64')](),_0x404f44);})[_0xc919('0x51')](function(_0x3e7a3b){_0x3e7a3b['forEach'](function(_0x58bb90){if(_0x58bb90['TagIds']){_0x58bb90[_0xc919('0x65')]=[];_0x58bb90[_0xc919('0x1e')][_0xc919('0x28')](',')[_0xc919('0x21')](function(_0x757478){_0x58bb90[_0xc919('0x65')][_0xc919('0x20')](_0x2fd483[_0x757478]);});}delete _0x58bb90[_0xc919('0x1e')];});return _0x3e7a3b;});}function countFilteredContacts(_0x38a4bc,_0x18a30f){var _0x2a0697=_0x38a4bc[_0xc919('0x66')]();_0x2a0697['field']('COUNT(*)');_0x2a0697=applyJoinClauses(_0x2a0697,!![]);_0x38a4bc[_0xc919('0x57')]('c.id');var _0x2b9498=utils[_0xc919('0x25')](_0x18a30f);if(!_['isEmpty'](_0x2b9498)){_0x2a0697[_0xc919('0xc')]('t.id\x20IN\x20?',_0x2b9498);}var _0x4d4d6e={'type':db[_0xc919('0x60')]['QueryTypes'][_0xc919('0x62')],'raw':!![]};return db[_0xc919('0x63')]['query'](_0x2a0697[_0xc919('0x64')](),_0x4d4d6e)[_0xc919('0x51')](function(_0x5ab23d){return _0x5ab23d[0x0][_0xc919('0x67')];});}module[_0xc919('0x68')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5d2bac5..a73afad 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 _0x8d6f=['utf8','decryptString','base64','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','write','end','binary','close','unlink','createDecipher','data','final','encryptString','secret'];(function(_0x72052f,_0x503f17){var _0x3c1e6b=function(_0x3401){while(--_0x3401){_0x72052f['push'](_0x72052f['shift']());}};_0x3c1e6b(++_0x503f17);}(_0x8d6f,0xdc));var _0xf8d6=function(_0x24c4a5,_0x141351){_0x24c4a5=_0x24c4a5-0x0;var _0x2a28d1=_0x8d6f[_0x24c4a5];return _0x2a28d1;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xf8d6('0x0'));var logger=require(_0xf8d6('0x1'))(_0xf8d6('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf8d6('0x3')][_0xf8d6('0x4')],'algorithm':_0xf8d6('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xf8d6('0x6')]&&config[_0xf8d6('0x6')][_0xf8d6('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xf8d6('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0xf8d6('0x6')][_0xf8d6('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf8d6('0x8')](',\x20');logger[_0xf8d6('0x9')](config[_0xf8d6('0x6')]['algorithm'],_0xf8d6('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x392a15){return AES_SUPPORTED_RX['test'](_0x392a15);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xf8d6('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x3eee74){return getSupportedCiphers()[_0xf8d6('0xc')](_0x3eee74)>-0x1;}function combineOptions(_0x2e5523){var _0x33c043={};for(var _0x56ea5a in fileOptions){if(fileOptions['hasOwnProperty'](_0x56ea5a)){_0x33c043[_0x56ea5a]=fileOptions[_0x56ea5a];}}if(_0x2e5523){for(var _0x300636 in _0x2e5523){if(_0x2e5523[_0xf8d6('0xd')](_0x300636)){_0x33c043[_0x300636]=_0x2e5523[_0x300636];}}}return _0x33c043;}exports['encryptFile']=function(_0x2d09a6,_0x1f0c16,_0x4b110e,_0x5c9aac){return new BPromise(function(_0x2394d8,_0x3419c3){_0x5c9aac=combineOptions(_0x5c9aac);var _0x438dfd=new Buffer(_0x4b110e);var _0x2a17e3=fs[_0xf8d6('0xe')](_0x2d09a6);var _0x4461cf=fs[_0xf8d6('0xf')](_0x1f0c16);var _0x4e0203=crypto[_0xf8d6('0x10')](_0x5c9aac['algorithm'],_0x438dfd);_0x2a17e3['on']('data',function(_0x1a7160){var _0x437a8c=new Buffer(_0x4e0203[_0xf8d6('0x11')](_0x1a7160),'binary');_0x4461cf[_0xf8d6('0x12')](_0x437a8c);});_0x2a17e3['on'](_0xf8d6('0x13'),function(){try{var _0x554b17=new Buffer(_0x4e0203['final'](_0xf8d6('0x14')),_0xf8d6('0x14'));_0x4461cf[_0xf8d6('0x12')](_0x554b17);_0x4461cf[_0xf8d6('0x13')]();_0x4461cf['on'](_0xf8d6('0x15'),function(){return _0x2394d8(_0x1f0c16);});}catch(_0x629e41){fs[_0xf8d6('0x16')](_0x1f0c16);return _0x3419c3(_0x629e41);}});});};exports['decryptFile']=function(_0x506359,_0x59ccc9,_0x5387d5,_0x2c69d4){return new BPromise(function(_0x5deaad,_0x124edf){_0x2c69d4=combineOptions(_0x2c69d4);var _0x3020d9=new Buffer(_0x5387d5);var _0x332b12=fs[_0xf8d6('0xe')](_0x506359);var _0x552ae1=fs[_0xf8d6('0xf')](_0x59ccc9);var _0x3f15b8=crypto[_0xf8d6('0x17')](_0x2c69d4[_0xf8d6('0x7')],_0x3020d9);_0x332b12['on'](_0xf8d6('0x18'),function(_0x1ce10b){var _0x169af6=new Buffer(_0x3f15b8[_0xf8d6('0x11')](_0x1ce10b),'binary');_0x552ae1[_0xf8d6('0x12')](_0x169af6);});_0x332b12['on'](_0xf8d6('0x13'),function(){try{var _0x4c4d40=new Buffer(_0x3f15b8[_0xf8d6('0x19')]('binary'),_0xf8d6('0x14'));_0x552ae1[_0xf8d6('0x12')](_0x4c4d40);_0x552ae1[_0xf8d6('0x13')]();_0x552ae1['on'](_0xf8d6('0x15'),function(){return _0x5deaad(_0x59ccc9);});}catch(_0x5aabc0){fs[_0xf8d6('0x16')](_0x59ccc9);return _0x124edf(_0x5aabc0);}});});};exports[_0xf8d6('0x1a')]=function(_0x473f29,_0x1e9dfd,_0x46fb0d){var _0xd1e171=_0x46fb0d||stringOptions[_0xf8d6('0x7')];var _0x59f4cb=_0x1e9dfd||stringOptions[_0xf8d6('0x1b')];var _0x5c0df8=crypto[_0xf8d6('0x10')](_0xd1e171,_0x59f4cb);var _0x2b823a=_0x5c0df8[_0xf8d6('0x11')](_0x473f29,_0xf8d6('0x1c'),'base64');_0x2b823a+=_0x5c0df8[_0xf8d6('0x19')]('base64');return _0x2b823a;};exports[_0xf8d6('0x1d')]=function(_0x5a0dbe,_0x557c1e,_0x4deb9c){var _0x1ace64=_0x4deb9c||stringOptions[_0xf8d6('0x7')];var _0x9271e2=_0x557c1e||stringOptions[_0xf8d6('0x1b')];var _0x9a89ce=crypto[_0xf8d6('0x17')](_0x1ace64,_0x9271e2);var _0x210212=_0x9a89ce[_0xf8d6('0x11')](_0x5a0dbe,_0xf8d6('0x1e'),_0xf8d6('0x1c'));_0x210212+=_0x9a89ce[_0xf8d6('0x19')](_0xf8d6('0x1c'));return _0x210212;}; \ No newline at end of file +var _0xd100=['base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','write','close','unlink','decryptFile','createDecipher','final','secret','utf8'];(function(_0x19434f,_0x5d9c4c){var _0x2a44c7=function(_0x493836){while(--_0x493836){_0x19434f['push'](_0x19434f['shift']());}};_0x2a44c7(++_0x5d9c4c);}(_0xd100,0x134));var _0x0d10=function(_0x596c23,_0x59367f){_0x596c23=_0x596c23-0x0;var _0x54eba4=_0xd100[_0x596c23];return _0x54eba4;};'use strict';var crypto=require(_0x0d10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x0d10('0x1'));var config=require(_0x0d10('0x2'));var logger=require(_0x0d10('0x3'))(_0x0d10('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0d10('0x5')][_0x0d10('0x6')],'algorithm':_0x0d10('0x7')};const fileOptions={'algorithm':_0x0d10('0x8')};if(config['encrypt']&&config[_0x0d10('0x9')][_0x0d10('0xa')]){var isSupported=isAlgorithmSupported(config[_0x0d10('0x9')][_0x0d10('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x0d10('0x9')][_0x0d10('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0d10('0xb')](',\x20');logger['error'](config[_0x0d10('0x9')]['algorithm'],_0x0d10('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x55a5d2){return AES_SUPPORTED_RX['test'](_0x55a5d2);}function getSupportedCiphers(){return crypto[_0x0d10('0xd')]()[_0x0d10('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2867b2){return getSupportedCiphers()['indexOf'](_0x2867b2)>-0x1;}function combineOptions(_0x287e9f){var _0x1c4a23={};for(var _0x39f93c in fileOptions){if(fileOptions[_0x0d10('0xf')](_0x39f93c)){_0x1c4a23[_0x39f93c]=fileOptions[_0x39f93c];}}if(_0x287e9f){for(var _0x588655 in _0x287e9f){if(_0x287e9f[_0x0d10('0xf')](_0x588655)){_0x1c4a23[_0x588655]=_0x287e9f[_0x588655];}}}return _0x1c4a23;}exports[_0x0d10('0x10')]=function(_0x21a20b,_0x35d57d,_0xe98a4a,_0x4a5ea8){return new BPromise(function(_0x38fbd6,_0x466a24){_0x4a5ea8=combineOptions(_0x4a5ea8);var _0x48054c=new Buffer(_0xe98a4a);var _0x3d9f92=fs[_0x0d10('0x11')](_0x21a20b);var _0x30e5b6=fs[_0x0d10('0x12')](_0x35d57d);var _0x25a10a=crypto[_0x0d10('0x13')](_0x4a5ea8[_0x0d10('0xa')],_0x48054c);_0x3d9f92['on'](_0x0d10('0x14'),function(_0x28b2a9){var _0x3a3681=new Buffer(_0x25a10a[_0x0d10('0x15')](_0x28b2a9),_0x0d10('0x16'));_0x30e5b6['write'](_0x3a3681);});_0x3d9f92['on'](_0x0d10('0x17'),function(){try{var _0x1224a9=new Buffer(_0x25a10a['final'](_0x0d10('0x16')),'binary');_0x30e5b6[_0x0d10('0x18')](_0x1224a9);_0x30e5b6[_0x0d10('0x17')]();_0x30e5b6['on'](_0x0d10('0x19'),function(){return _0x38fbd6(_0x35d57d);});}catch(_0x5ae1dc){fs[_0x0d10('0x1a')](_0x35d57d);return _0x466a24(_0x5ae1dc);}});});};exports[_0x0d10('0x1b')]=function(_0x9f6904,_0x26ddd9,_0x29e3f2,_0x432dac){return new BPromise(function(_0x18e2e5,_0x26c8e1){_0x432dac=combineOptions(_0x432dac);var _0x6ed968=new Buffer(_0x29e3f2);var _0x407057=fs[_0x0d10('0x11')](_0x9f6904);var _0x2f8eb0=fs[_0x0d10('0x12')](_0x26ddd9);var _0x4a02d6=crypto[_0x0d10('0x1c')](_0x432dac[_0x0d10('0xa')],_0x6ed968);_0x407057['on']('data',function(_0x4f9309){var _0x4764e4=new Buffer(_0x4a02d6[_0x0d10('0x15')](_0x4f9309),_0x0d10('0x16'));_0x2f8eb0['write'](_0x4764e4);});_0x407057['on']('end',function(){try{var _0x308818=new Buffer(_0x4a02d6[_0x0d10('0x1d')](_0x0d10('0x16')),_0x0d10('0x16'));_0x2f8eb0[_0x0d10('0x18')](_0x308818);_0x2f8eb0[_0x0d10('0x17')]();_0x2f8eb0['on'](_0x0d10('0x19'),function(){return _0x18e2e5(_0x26ddd9);});}catch(_0x3ddddb){fs[_0x0d10('0x1a')](_0x26ddd9);return _0x26c8e1(_0x3ddddb);}});});};exports['encryptString']=function(_0x598886,_0x375bca,_0xd52a02){var _0x389069=_0xd52a02||stringOptions[_0x0d10('0xa')];var _0xbba6ad=_0x375bca||stringOptions[_0x0d10('0x1e')];var _0x16f981=crypto['createCipher'](_0x389069,_0xbba6ad);var _0x3a89d8=_0x16f981['update'](_0x598886,_0x0d10('0x1f'),_0x0d10('0x20'));_0x3a89d8+=_0x16f981['final']('base64');return _0x3a89d8;};exports[_0x0d10('0x21')]=function(_0x20e270,_0x457af6,_0x17a5c8){var _0xc7610a=_0x17a5c8||stringOptions[_0x0d10('0xa')];var _0x2766ff=_0x457af6||stringOptions['secret'];var _0x57587c=crypto[_0x0d10('0x1c')](_0xc7610a,_0x2766ff);var _0x56eaf7=_0x57587c[_0x0d10('0x15')](_0x20e270,_0x0d10('0x20'),'utf8');_0x56eaf7+=_0x57587c[_0x0d10('0x1d')](_0x0d10('0x1f'));return _0x56eaf7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e216789..d1b7e7c 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 _0x3146=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','update'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x3146,0x82));var _0x6314=function(_0x1495fb,_0x17452d){_0x1495fb=_0x1495fb-0x0;var _0x4b4432=_0x3146[_0x1495fb];return _0x4b4432;};'use strict';var util=require('util');var path=require(_0x6314('0x0'));var _=require(_0x6314('0x1'));var csv=require(_0x6314('0x2'));var fs=require('fs');var BPromise=require(_0x6314('0x3'));var zipdir=require(_0x6314('0x4'));var rimraf=require('rimraf');var db=require(_0x6314('0x5'))['db'];var dbH=require('../../mysqldb')[_0x6314('0x6')];var logger=require(_0x6314('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6314('0x8')][0x2]);var QUERY=process[_0x6314('0x8')][0x3];var PATH=process[_0x6314('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x598b5d,_0x266be8){var _0x1d4860={'status':_0x598b5d};var _0x168bf8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x266be8){_0x1d4860[_0x6314('0x9')]=_0x266be8;}return db['AnalyticExtractedReport'][_0x6314('0xa')](_0x1d4860,_0x168bf8);}function main(){var _0x4f6647=0x1388;var _0x5de303;logger[_0x6314('0xb')](util[_0x6314('0xc')](_0x6314('0xd'),EXTRACTED_REPORT_ID,_0x6314('0xe')));return db['Setting'][_0x6314('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6314('0x10'),'splitSizeCsv']})[_0x6314('0x11')](function(_0xa94399){if(_0xa94399){_0x5de303=_0xa94399;_0x4f6647=_0x5de303[_0x6314('0x12')]||0x1388;}})[_0x6314('0x11')](function(){return dbH[_0x6314('0x13')][_0x6314('0x14')](util[_0x6314('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x6314('0x15')][_0x6314('0x16')]});})[_0x6314('0x11')](function(_0x133d09){if(!_0x133d09[0x0][_0x6314('0x17')]){return analyticExtractedReport(_0x6314('0x18'));}var _0x1eefb5=[];var _0xa700d1=0x0;if(_0x5de303[_0x6314('0x10')]){if(_0x133d09&&_0x133d09[_0x6314('0x19')]){var _0x47c19b=_[_0x6314('0x1a')](_0x133d09[0x0][_0x6314('0x17')]/_0x4f6647);var _0x25bb8a=Number[_0x6314('0x1b')](_0x133d09[0x0][_0x6314('0x17')]/_0x4f6647)?_0x133d09[0x0][_0x6314('0x17')]%_0x4f6647:0x0;_0x47c19b['forEach'](function(_0x431510){if(_0x431510>0x0){_0xa700d1+=_0x4f6647;}_0x1eefb5['push'](dbH[_0x6314('0x13')][_0x6314('0x14')](util[_0x6314('0xc')](_0x6314('0x1c'),QUERY,_0x4f6647,_0xa700d1),{'type':dbH[_0x6314('0x13')][_0x6314('0x15')][_0x6314('0x16')]}));});if(_0x25bb8a>0x0){_0xa700d1+=_0x4f6647;_0x1eefb5[_0x6314('0x1d')](dbH[_0x6314('0x13')][_0x6314('0x14')](util[_0x6314('0xc')](_0x6314('0x1c'),QUERY,_0x25bb8a,_0xa700d1),{'type':dbH[_0x6314('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x1eefb5['push'](dbH[_0x6314('0x13')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x6314('0x16')]}));}var _0xa3a1c4=path[_0x6314('0x1e')](PATH);var _0x2138c7=path['basename'](PATH,_0x6314('0x1f'));var _0x40888e=_0x5de303['split']&&_0x1eefb5[_0x6314('0x19')]>0x1;var _0x431d32=[];if(!fs[_0x6314('0x20')](path[_0x6314('0x21')](_0xa3a1c4,_0x2138c7))&&_0x40888e){fs[_0x6314('0x22')](path['join'](_0xa3a1c4,_0x2138c7));}return BPromise[_0x6314('0x23')](_0x1eefb5,function(_0x3d15f7){_0x431d32[_0x6314('0x1d')](_0x3d15f7);})['then'](function(){for(var _0x333d01=0x0;_0x333d01<_0x431d32['length'];_0x333d01+=0x1){var _0x50c2e7;var _0x1b6d2f=_0x431d32[_0x333d01];if(_0x40888e){_0x50c2e7=path[_0x6314('0x21')](_0xa3a1c4,_0x2138c7,util['format'](_0x6314('0x24'),_0x2138c7,_0x333d01,_0x6314('0x25')));}else{_0x50c2e7=path[_0x6314('0x21')](_0xa3a1c4,util[_0x6314('0xc')](_0x6314('0x26'),_0x2138c7,_0x6314('0x25')));}fs[_0x6314('0x27')](_0x50c2e7,csv(_0x1b6d2f));}})['then'](function(){if(_0x40888e){return new Promise(function(_0x36652f){zipdir(path[_0x6314('0x21')](_0xa3a1c4,_0x2138c7),{'saveTo':path[_0x6314('0x21')](_0xa3a1c4,util['format'](_0x6314('0x26'),_0x2138c7,'zip'))},function(_0x188801,_0x1a2675){rimraf(path[_0x6314('0x21')](_0xa3a1c4,_0x2138c7),function(){});_0x36652f(_0x6314('0x28'));});});}})[_0x6314('0x11')](function(){logger[_0x6314('0xb')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6314('0xe')));return analyticExtractedReport(_0x6314('0x29'),_0x40888e?util['format'](_0x6314('0x26'),_0x2138c7,_0x40888e?'zip':_0x6314('0x25')):null);});})['catch'](function(_0x1814d6){logger[_0x6314('0xb')](util[_0x6314('0xc')](_0x6314('0x2a'),EXTRACTED_REPORT_ID,_0x6314('0xe')),util[_0x6314('0x2b')](_0x1814d6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6314('0x2c'));})[_0x6314('0x2d')](function(){process[_0x6314('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc7d2=['num','Empty','split','length','isInteger','forEach','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s.%s','csv','writeFileSync','zip','zip\x20finished','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','then','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc7d2,0x79));var _0x2c7d=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0xc7d2[_0x451959];return _0x490269;};'use strict';var util=require(_0x2c7d('0x0'));var path=require(_0x2c7d('0x1'));var _=require(_0x2c7d('0x2'));var csv=require(_0x2c7d('0x3'));var fs=require('fs');var BPromise=require(_0x2c7d('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x2c7d('0x5'));var db=require(_0x2c7d('0x6'))['db'];var dbH=require(_0x2c7d('0x6'))[_0x2c7d('0x7')];var logger=require(_0x2c7d('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2c7d('0x9')][0x2]);var QUERY=process[_0x2c7d('0x9')][0x3];var PATH=process[_0x2c7d('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x529023,_0x54c534){var _0x25b56a={'status':_0x529023};var _0x4de074={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54c534){_0x25b56a[_0x2c7d('0xa')]=_0x54c534;}return db[_0x2c7d('0xb')]['update'](_0x25b56a,_0x4de074);}function main(){var _0x5eb0fb=0x1388;var _0x28b83e;logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')](_0x2c7d('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x2c7d('0xf')][_0x2c7d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x2c7d('0x11')](function(_0xfb8f79){if(_0xfb8f79){_0x28b83e=_0xfb8f79;_0x5eb0fb=_0x28b83e[_0x2c7d('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x2c7d('0x13')](util[_0x2c7d('0xd')](_0x2c7d('0x14'),QUERY),{'type':dbH['sequelize'][_0x2c7d('0x15')][_0x2c7d('0x16')]});})[_0x2c7d('0x11')](function(_0x360cb2){if(!_0x360cb2[0x0][_0x2c7d('0x17')]){return analyticExtractedReport(_0x2c7d('0x18'));}var _0x20b64b=[];var _0x5c6216=0x0;if(_0x28b83e[_0x2c7d('0x19')]){if(_0x360cb2&&_0x360cb2[_0x2c7d('0x1a')]){var _0x358f04=_['range'](_0x360cb2[0x0][_0x2c7d('0x17')]/_0x5eb0fb);var _0x1623ce=Number[_0x2c7d('0x1b')](_0x360cb2[0x0][_0x2c7d('0x17')]/_0x5eb0fb)?_0x360cb2[0x0][_0x2c7d('0x17')]%_0x5eb0fb:0x0;_0x358f04[_0x2c7d('0x1c')](function(_0x462439){if(_0x462439>0x0){_0x5c6216+=_0x5eb0fb;}_0x20b64b[_0x2c7d('0x1d')](dbH[_0x2c7d('0x1e')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5eb0fb,_0x5c6216),{'type':dbH[_0x2c7d('0x1e')][_0x2c7d('0x15')][_0x2c7d('0x16')]}));});if(_0x1623ce>0x0){_0x5c6216+=_0x5eb0fb;_0x20b64b[_0x2c7d('0x1d')](dbH[_0x2c7d('0x1e')][_0x2c7d('0x13')](util[_0x2c7d('0xd')](_0x2c7d('0x1f'),QUERY,_0x1623ce,_0x5c6216),{'type':dbH[_0x2c7d('0x1e')]['QueryTypes'][_0x2c7d('0x16')]}));}}}else{_0x20b64b[_0x2c7d('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x2c7d('0x16')]}));}var _0x53e8f8=path[_0x2c7d('0x20')](PATH);var _0x24ffe9=path[_0x2c7d('0x21')](PATH,_0x2c7d('0x22'));var _0x16bb14=_0x28b83e['split']&&_0x20b64b['length']>0x1;var _0x311db9=[];if(!fs[_0x2c7d('0x23')](path['join'](_0x53e8f8,_0x24ffe9))&&_0x16bb14){fs[_0x2c7d('0x24')](path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9));}return BPromise[_0x2c7d('0x26')](_0x20b64b,function(_0x36773f){_0x311db9['push'](_0x36773f);})[_0x2c7d('0x11')](function(){for(var _0x359ff0=0x0;_0x359ff0<_0x311db9[_0x2c7d('0x1a')];_0x359ff0+=0x1){var _0x304c89;var _0xf9f4ec=_0x311db9[_0x359ff0];if(_0x16bb14){_0x304c89=path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9,util['format']('%s%d.%s',_0x24ffe9,_0x359ff0,'csv'));}else{_0x304c89=path[_0x2c7d('0x25')](_0x53e8f8,util['format'](_0x2c7d('0x27'),_0x24ffe9,_0x2c7d('0x28')));}fs[_0x2c7d('0x29')](_0x304c89,csv(_0xf9f4ec));}})[_0x2c7d('0x11')](function(){if(_0x16bb14){return new Promise(function(_0x1713e9){zipdir(path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9),{'saveTo':path[_0x2c7d('0x25')](_0x53e8f8,util[_0x2c7d('0xd')](_0x2c7d('0x27'),_0x24ffe9,_0x2c7d('0x2a')))},function(_0x4f4435,_0x3c0039){rimraf(path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9),function(){});_0x1713e9(_0x2c7d('0x2b'));});});}})['then'](function(){logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x16bb14?util[_0x2c7d('0xd')](_0x2c7d('0x27'),_0x24ffe9,_0x16bb14?_0x2c7d('0x2a'):_0x2c7d('0x28')):null);});})['catch'](function(_0x19f0f3){logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')](_0x2c7d('0x2c'),EXTRACTED_REPORT_ID,_0x2c7d('0x2d')),util[_0x2c7d('0x2e')](_0x19f0f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2c7d('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2d854a6..00f7587 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 _0xdabc=['pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','finish','error','createPdfFromHTML','lodash','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','length','push','body','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','format','header','pageBreak','before','margin','landscape','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','basename','join','mkdirSync','each','createPdfKitDocument','%s%d.%s'];(function(_0x3a43a0,_0x3e09a9){var _0x46fa96=function(_0x4479ce){while(--_0x4479ce){_0x3a43a0['push'](_0x3a43a0['shift']());}};_0x46fa96(++_0x3e09a9);}(_0xdabc,0x1e5));var _0xcdab=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0xdabc[_0x246227];return _0x37bd4a;};'use strict';var _=require(_0xcdab('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xcdab('0x1'));var PdfPrinter=require(_0xcdab('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0xcdab('0x3'));var JSDOM=require(_0xcdab('0x4'))[_0xcdab('0x5')];var window=new JSDOM('')[_0xcdab('0x6')];var BPromise=require(_0xcdab('0x7'));var db=require(_0xcdab('0x8'))['db'];var dbH=require(_0xcdab('0x8'))[_0xcdab('0x9')];var logger=require(_0xcdab('0xa'))(_0xcdab('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcdab('0xc')][0x4];var NAME=process[_0xcdab('0xc')][0x5];var FORMAT=_0xcdab('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x490e7d,_0x3aeecc){var _0x2b2020={'status':_0x490e7d};var _0x524d4e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3aeecc){_0x2b2020[_0xcdab('0xe')]=_0x3aeecc;}return db[_0xcdab('0xf')][_0xcdab('0x10')](_0x2b2020,_0x524d4e);}function getHeaders(_0x11ec16){return _[_0xcdab('0x11')](_0x11ec16,function(_0x1600c4){return{'text':_0x1600c4,'style':_0xcdab('0x12')};});}function getRows(_0x1487c9,_0x1038ce){return _[_0xcdab('0x11')](_0x1038ce,function(_0x57be14){return _(_0x57be14)['pick'](_0x1487c9)[_0xcdab('0x11')](function(_0x58c791){return _0x58c791?_[_0xcdab('0x13')](_0x58c791):'';})['value']();});}function createTable(_0x1d013e,_0xd59a1d){var _0x4ba944={'widths':_[_0xcdab('0x14')](Array(_0x1d013e[_0xcdab('0x15')]),0x91),'heights':function(_0x25d404){return _0x25d404===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x20f34e=getHeaders(_0x1d013e);_0x4ba944['body'][_0xcdab('0x16')](_0x20f34e);var _0x4586ba=getRows(_0x1d013e,_0xd59a1d);_0x4ba944['body']=_0x4ba944[_0xcdab('0x17')][_0xcdab('0x18')](_0x4586ba);return _0x4ba944;}function createTables(_0x55da0d){var _0x55ea07=[];var _0x18dc7e=_[_0xcdab('0x19')](Object[_0xcdab('0x1a')](_0x55da0d[0x0]),0x5);_0x18dc7e[_0xcdab('0x1b')](function(_0xd33233){_0x55ea07[_0xcdab('0x16')](createTable(_0xd33233,_0x55da0d));});return _0x55ea07;}function getPDFDocDefinition(_0x1403c5){var _0x19844b=util['format'](_0xcdab('0x1c'),NAME,EXTRACTED_REPORT[_0xcdab('0x1d')],moment(EXTRACTED_REPORT[_0xcdab('0x1e')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xcdab('0x1f')])[_0xcdab('0x20')](FORMAT));var _0x2f64de=[];for(var _0x398935=0x0;_0x398935<_0x1403c5[_0xcdab('0x15')];_0x398935++){var _0x2288e5=[];if(_0x398935===0x0){_0x2288e5['push']({'text':_0x19844b,'style':_0xcdab('0x21')});}var _0x632a37={'table':_0x1403c5[_0x398935]};if(_0x398935>0x0){_0x632a37[_0xcdab('0x22')]=_0xcdab('0x23');_0x632a37[_0xcdab('0x24')]=[0x0,0x46,0x0,0x0];}_0x2288e5[_0xcdab('0x16')](_0x632a37);_0x2f64de['push'](_0x2288e5);}return{'pageSize':'A4','pageOrientation':_0xcdab('0x25'),'content':_0x2f64de,'footer':function(_0x203c54,_0x1b2314){return{'text':_0x203c54[_0xcdab('0x13')]()+'\x20/\x20'+_0x1b2314,'style':'footer'};},'defaultStyle':{'font':_0xcdab('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcdab('0x27')},'footer':{'alignment':_0xcdab('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x46e247){var _0x80b3c3=0x1388;var _0x1c6813;if(!_0x46e247[0x0][_0xcdab('0x29')]){return analyticExtractedReport(_0xcdab('0x2a'));}return db[_0xcdab('0x2b')][_0xcdab('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcdab('0x2d'),_0xcdab('0x2e')]})[_0xcdab('0x2f')](function(_0x14a7df){if(_0x14a7df){_0x1c6813=_0x14a7df;_0x80b3c3=_0x1c6813[_0xcdab('0x2e')]||0x3e8;}})[_0xcdab('0x2f')](function(){var _0x225a07=[];var _0x2afccd=0x0;if(_0x1c6813['split']){if(_0x46e247&&_0x46e247[_0xcdab('0x15')]){var _0x18143b=_[_0xcdab('0x30')](_0x46e247[0x0]['num']/_0x80b3c3);var _0x2ad119=Number[_0xcdab('0x31')](_0x46e247[0x0][_0xcdab('0x29')]/_0x80b3c3)?_0x46e247[0x0]['num']%_0x80b3c3:0x0;_0x18143b[_0xcdab('0x1b')](function(_0x26319a){if(_0x26319a>0x0){_0x2afccd+=_0x80b3c3;}_0x225a07[_0xcdab('0x16')](dbH['sequelize'][_0xcdab('0x32')](util[_0xcdab('0x20')](_0xcdab('0x33'),QUERY,_0x80b3c3,_0x2afccd),{'type':dbH['sequelize'][_0xcdab('0x34')][_0xcdab('0x35')]}));});if(_0x2ad119>0x0){_0x2afccd+=_0x80b3c3;_0x225a07[_0xcdab('0x16')](dbH['sequelize'][_0xcdab('0x32')](util[_0xcdab('0x20')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2ad119,_0x2afccd),{'type':dbH[_0xcdab('0x36')][_0xcdab('0x34')][_0xcdab('0x35')]}));}}}else{_0x225a07[_0xcdab('0x16')](dbH[_0xcdab('0x36')]['query'](QUERY,{'type':dbH[_0xcdab('0x36')][_0xcdab('0x34')][_0xcdab('0x35')]}));}var _0x14e7c6=path['dirname'](PATH);var _0x372a99=path[_0xcdab('0x37')](PATH,'.pdf');var _0x32d7db=_0x1c6813['split']&&_0x225a07[_0xcdab('0x15')]>0x1;var _0x5a7ad3=[];if(!fs['existsSync'](path[_0xcdab('0x38')](_0x14e7c6,_0x372a99))&&_0x32d7db){fs[_0xcdab('0x39')](path['join'](_0x14e7c6,_0x372a99));}return BPromise[_0xcdab('0x3a')](_0x225a07,function(_0x458c6c){_0x5a7ad3[_0xcdab('0x16')](_0x458c6c);})['then'](function(){var _0x57c239=[];for(var _0x3af153=0x0;_0x3af153<_0x5a7ad3[_0xcdab('0x15')];_0x3af153+=0x1){var _0x52ce61=_0x5a7ad3[_0x3af153];var _0x25092b=createTables(_['flatten'](_0x52ce61));var _0xf3bfc2;var _0x58cdbd=getPDFDocDefinition(_0x25092b);var _0xcc7d53=getPDFPrinter();var _0x38bf3=_0xcc7d53[_0xcdab('0x3b')](_0x58cdbd);if(_0x32d7db){_0xf3bfc2=path[_0xcdab('0x38')](_0x14e7c6,_0x372a99,util[_0xcdab('0x20')](_0xcdab('0x3c'),_0x372a99,_0x3af153,_0xcdab('0x3d')));}else{_0xf3bfc2=path[_0xcdab('0x38')](_0x14e7c6,util['format'](_0xcdab('0x3e'),_0x372a99,_0xcdab('0x3d')));}_0x57c239[_0xcdab('0x16')](writePDFDocument(_0x38bf3,_0xf3bfc2));}return Promise[_0xcdab('0x3f')](_0x57c239);})[_0xcdab('0x2f')](function(){if(_0x32d7db){return new Promise(function(_0x14a5ed){zipdir(path['join'](_0x14e7c6,_0x372a99),{'saveTo':path['join'](_0x14e7c6,util[_0xcdab('0x20')](_0xcdab('0x3e'),_0x372a99,'zip'))},function(){rimraf(path['join'](_0x14e7c6,_0x372a99),function(){});_0x14a5ed(_0xcdab('0x40'));});});}})[_0xcdab('0x2f')](function(){if(!_0x32d7db)return;rimraf(path['join'](_0x14e7c6,_0x372a99),function(){});})[_0xcdab('0x2f')](function(){logger[_0xcdab('0x41')](util['format'](_0xcdab('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xcdab('0x43'),_0x32d7db?util[_0xcdab('0x20')](_0xcdab('0x3e'),_0x372a99,_0x32d7db?_0xcdab('0x44'):_0xcdab('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcdab('0x41')](util[_0xcdab('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcdab('0x45')));return db[_0xcdab('0xf')][_0xcdab('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcdab('0x2f')](function(_0x1ae99e){EXTRACTED_REPORT=_0x1ae99e;return dbH[_0xcdab('0x36')][_0xcdab('0x32')](util[_0xcdab('0x20')](_0xcdab('0x47'),QUERY),{'type':dbH[_0xcdab('0x36')][_0xcdab('0x34')][_0xcdab('0x35')]});})[_0xcdab('0x2f')](extractReport)[_0xcdab('0x48')](function(_0x9c38cb){logger[_0xcdab('0x41')](util[_0xcdab('0x20')](_0xcdab('0x49'),EXTRACTED_REPORT_ID,_0xcdab('0x45')),util[_0xcdab('0x4a')](_0x9c38cb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcdab('0x4b'));})[_0xcdab('0x4c')](function(){process[_0xcdab('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4b0f4b=new PdfPrinter({'Arial':{'normal':__dirname+_0xcdab('0x4e'),'bold':__dirname+_0xcdab('0x4f'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x4b0f4b;}function getPDFDocDefinitionFromHTML(_0x78fe07,_0x4600b5){var _0x1762d7=util['format'](_0xcdab('0x50'),_0x4600b5[_0xcdab('0x51')],_0x4600b5[_0xcdab('0x52')]);var _0x2bcdd4=moment()[_0xcdab('0x20')](_0xcdab('0x53'))[_0xcdab('0x13')]();var _0x257a9f=htmlToPdfmake(_0x78fe07,{'window':window,'tableAutoSize':!![]});return{'content':[_0x257a9f],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcdab('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcdab('0x54')}},'header':function(){return[{'text':_0xcdab('0x55'),'style':'header'}];},'footer':function(_0x3ee110,_0x15e28e){return[{'text':util['format'](_0xcdab('0x56'),_0x1762d7,_0x3ee110,_0x15e28e,_0x2bcdd4),'style':_0xcdab('0x57')}];}};}function writePDFDocument(_0x1bf64d,_0x116e18){return new Promise(function(_0x493c20,_0x2be501){var _0x300b7c=_0x1bf64d['pipe'](fs['createWriteStream'](_0x116e18));_0x300b7c['on']('finish',function(){_0x493c20(_0xcdab('0x58'));});_0x300b7c['on'](_0xcdab('0x59'),function(_0x20c39c){_0x2be501(_0x20c39c);});_0x1bf64d['end']();});}exports[_0xcdab('0x5a')]=function(_0x417de0,_0x1610f3){var _0x498845=getPDFPrinter();var _0x1ceb0e=getPDFDocDefinitionFromHTML(_0x417de0,_0x1610f3);var _0x444a84=_0x498845[_0xcdab('0x3b')](_0x1ceb0e);return writePDFDocument(_0x444a84,_0x1610f3['path'])[_0xcdab('0x48')](function(_0x46e2c6){throw _0x46e2c6;});}; \ No newline at end of file +var _0x3f83=['/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','push','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x3f83,0x176));var _0x33f8=function(_0x319542,_0x5063b8){_0x319542=_0x319542-0x0;var _0x2aaee9=_0x3f83[_0x319542];return _0x2aaee9;};'use strict';var _=require(_0x33f8('0x0'));var fs=require('fs');var util=require(_0x33f8('0x1'));var path=require(_0x33f8('0x2'));var moment=require(_0x33f8('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x33f8('0x4'));var zipdir=require(_0x33f8('0x5'));var rimraf=require(_0x33f8('0x6'));var JSDOM=require(_0x33f8('0x7'))[_0x33f8('0x8')];var window=new JSDOM('')[_0x33f8('0x9')];var BPromise=require(_0x33f8('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0x33f8('0xb'))[_0x33f8('0xc')];var logger=require(_0x33f8('0xd'))(_0x33f8('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x33f8('0xf')][0x2]);var QUERY=process[_0x33f8('0xf')][0x3];var PATH=process[_0x33f8('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x33f8('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x31c731,_0x3f7c8a){var _0x48a364={'status':_0x31c731};var _0x4a30e6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f7c8a){_0x48a364['savename']=_0x3f7c8a;}return db[_0x33f8('0x11')][_0x33f8('0x12')](_0x48a364,_0x4a30e6);}function getHeaders(_0x1cd7ff){return _[_0x33f8('0x13')](_0x1cd7ff,function(_0x3f3558){return{'text':_0x3f3558,'style':_0x33f8('0x14')};});}function getRows(_0x25b2e7,_0x57c10e){return _[_0x33f8('0x13')](_0x57c10e,function(_0x4ee46d){return _(_0x4ee46d)[_0x33f8('0x15')](_0x25b2e7)[_0x33f8('0x13')](function(_0x20ad39){return _0x20ad39?_[_0x33f8('0x16')](_0x20ad39):'';})[_0x33f8('0x17')]();});}function createTable(_0x16f08f,_0x2ff38b){var _0x3e7eb4={'widths':_[_0x33f8('0x18')](Array(_0x16f08f[_0x33f8('0x19')]),0x91),'heights':function(_0x21506e){return _0x21506e===0x0?_0x33f8('0x1a'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31b088=getHeaders(_0x16f08f);_0x3e7eb4['body'][_0x33f8('0x1b')](_0x31b088);var _0x1c5756=getRows(_0x16f08f,_0x2ff38b);_0x3e7eb4[_0x33f8('0x1c')]=_0x3e7eb4[_0x33f8('0x1c')]['concat'](_0x1c5756);return _0x3e7eb4;}function createTables(_0x4e7f15){var _0xaf6fd2=[];var _0x1dc299=_['chunk'](Object[_0x33f8('0x1d')](_0x4e7f15[0x0]),0x5);_0x1dc299[_0x33f8('0x1e')](function(_0x40b56c){_0xaf6fd2[_0x33f8('0x1b')](createTable(_0x40b56c,_0x4e7f15));});return _0xaf6fd2;}function getPDFDocDefinition(_0x28cd26){var _0x26f557=util[_0x33f8('0x1f')](_0x33f8('0x20'),NAME,EXTRACTED_REPORT[_0x33f8('0x21')],moment(EXTRACTED_REPORT[_0x33f8('0x22')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x33f8('0x23')])[_0x33f8('0x1f')](FORMAT));var _0x19e2ed=[];for(var _0x4ddeff=0x0;_0x4ddeff<_0x28cd26[_0x33f8('0x19')];_0x4ddeff++){var _0x5567dc=[];if(_0x4ddeff===0x0){_0x5567dc[_0x33f8('0x1b')]({'text':_0x26f557,'style':_0x33f8('0x24')});}var _0xf86605={'table':_0x28cd26[_0x4ddeff]};if(_0x4ddeff>0x0){_0xf86605['pageBreak']=_0x33f8('0x25');_0xf86605[_0x33f8('0x26')]=[0x0,0x46,0x0,0x0];}_0x5567dc[_0x33f8('0x1b')](_0xf86605);_0x19e2ed[_0x33f8('0x1b')](_0x5567dc);}return{'pageSize':'A4','pageOrientation':_0x33f8('0x27'),'content':_0x19e2ed,'footer':function(_0x58555e,_0x33928d){return{'text':_0x58555e[_0x33f8('0x16')]()+'\x20/\x20'+_0x33928d,'style':'footer'};},'defaultStyle':{'font':_0x33f8('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x33f8('0x29')},'footer':{'alignment':_0x33f8('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a0b83){var _0x19aebd=0x1388;var _0x474cde;if(!_0x3a0b83[0x0]['num']){return analyticExtractedReport(_0x33f8('0x2b'));}return db[_0x33f8('0x2c')][_0x33f8('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x33f8('0x2e'),_0x33f8('0x2f')]})['then'](function(_0x56fcf5){if(_0x56fcf5){_0x474cde=_0x56fcf5;_0x19aebd=_0x474cde[_0x33f8('0x2f')]||0x3e8;}})[_0x33f8('0x30')](function(){var _0x2780c3=[];var _0x2e1a14=0x0;if(_0x474cde[_0x33f8('0x2e')]){if(_0x3a0b83&&_0x3a0b83[_0x33f8('0x19')]){var _0x442c7f=_[_0x33f8('0x31')](_0x3a0b83[0x0][_0x33f8('0x32')]/_0x19aebd);var _0x12c378=Number[_0x33f8('0x33')](_0x3a0b83[0x0][_0x33f8('0x32')]/_0x19aebd)?_0x3a0b83[0x0][_0x33f8('0x32')]%_0x19aebd:0x0;_0x442c7f['forEach'](function(_0x3052d4){if(_0x3052d4>0x0){_0x2e1a14+=_0x19aebd;}_0x2780c3[_0x33f8('0x1b')](dbH[_0x33f8('0x34')][_0x33f8('0x35')](util['format'](_0x33f8('0x36'),QUERY,_0x19aebd,_0x2e1a14),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));});if(_0x12c378>0x0){_0x2e1a14+=_0x19aebd;_0x2780c3[_0x33f8('0x1b')](dbH['sequelize'][_0x33f8('0x35')](util[_0x33f8('0x1f')](_0x33f8('0x36'),QUERY,_0x12c378,_0x2e1a14),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));}}}else{_0x2780c3[_0x33f8('0x1b')](dbH[_0x33f8('0x34')][_0x33f8('0x35')](QUERY,{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));}var _0x2c3114=path['dirname'](PATH);var _0xc180db=path[_0x33f8('0x39')](PATH,_0x33f8('0x3a'));var _0x2cd73d=_0x474cde['split']&&_0x2780c3[_0x33f8('0x19')]>0x1;var _0x30792e=[];if(!fs['existsSync'](path[_0x33f8('0x3b')](_0x2c3114,_0xc180db))&&_0x2cd73d){fs['mkdirSync'](path[_0x33f8('0x3b')](_0x2c3114,_0xc180db));}return BPromise[_0x33f8('0x3c')](_0x2780c3,function(_0x21556c){_0x30792e[_0x33f8('0x1b')](_0x21556c);})['then'](function(){var _0x47a935=[];for(var _0x5c04e0=0x0;_0x5c04e0<_0x30792e[_0x33f8('0x19')];_0x5c04e0+=0x1){var _0x36a780=_0x30792e[_0x5c04e0];var _0x442564=createTables(_[_0x33f8('0x3d')](_0x36a780));var _0x41da8e;var _0x37922b=getPDFDocDefinition(_0x442564);var _0x32bb9b=getPDFPrinter();var _0x3650ee=_0x32bb9b['createPdfKitDocument'](_0x37922b);if(_0x2cd73d){_0x41da8e=path[_0x33f8('0x3b')](_0x2c3114,_0xc180db,util['format'](_0x33f8('0x3e'),_0xc180db,_0x5c04e0,_0x33f8('0x3f')));}else{_0x41da8e=path['join'](_0x2c3114,util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x33f8('0x3f')));}_0x47a935[_0x33f8('0x1b')](writePDFDocument(_0x3650ee,_0x41da8e));}return Promise['all'](_0x47a935);})[_0x33f8('0x30')](function(){if(_0x2cd73d){return new Promise(function(_0x442769){zipdir(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),{'saveTo':path[_0x33f8('0x3b')](_0x2c3114,util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x33f8('0x41')))},function(){rimraf(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),function(){});_0x442769(_0x33f8('0x42'));});});}})[_0x33f8('0x30')](function(){if(!_0x2cd73d)return;rimraf(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),function(){});})[_0x33f8('0x30')](function(){logger[_0x33f8('0x43')](util['format'](_0x33f8('0x44'),EXTRACTED_REPORT_ID,_0x33f8('0x45')));return analyticExtractedReport('Completed',_0x2cd73d?util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x2cd73d?'zip':_0x33f8('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x33f8('0x43')](util[_0x33f8('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x33f8('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x33f8('0x30')](function(_0x5f2712){EXTRACTED_REPORT=_0x5f2712;return dbH[_0x33f8('0x34')]['query'](util[_0x33f8('0x1f')](_0x33f8('0x46'),QUERY),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]});})[_0x33f8('0x30')](extractReport)[_0x33f8('0x47')](function(_0x48c3b7){logger['info'](util[_0x33f8('0x1f')](_0x33f8('0x48'),EXTRACTED_REPORT_ID,_0x33f8('0x45')),util[_0x33f8('0x49')](_0x48c3b7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x33f8('0x4a'));})['finally'](function(){process[_0x33f8('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3c63a8=new PdfPrinter({'Arial':{'normal':__dirname+_0x33f8('0x4c'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x33f8('0x4d')}});return _0x3c63a8;}function getPDFDocDefinitionFromHTML(_0x453651,_0x3fe2f4){var _0x32adba=util[_0x33f8('0x1f')]('%s\x20#%d',_0x3fe2f4[_0x33f8('0x4e')],_0x3fe2f4[_0x33f8('0x4f')]);var _0x224097=moment()['format'](_0x33f8('0x50'))['toString']();var _0x34d51b=htmlToPdfmake(_0x453651,{'window':window,'tableAutoSize':!![]});return{'content':[_0x34d51b],'defaultStyle':{'font':_0x33f8('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x33f8('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x33f8('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x33f8('0x24')}];},'footer':function(_0x2135b5,_0x3658db){return[{'text':util[_0x33f8('0x1f')](_0x33f8('0x52'),_0x32adba,_0x2135b5,_0x3658db,_0x224097),'style':_0x33f8('0x53')}];}};}function writePDFDocument(_0x13c7d0,_0x83da57){return new Promise(function(_0x4848e8,_0x52709b){var _0x3b59e1=_0x13c7d0['pipe'](fs[_0x33f8('0x54')](_0x83da57));_0x3b59e1['on'](_0x33f8('0x55'),function(){_0x4848e8(_0x33f8('0x55'));});_0x3b59e1['on'](_0x33f8('0x56'),function(_0x5ed3f7){_0x52709b(_0x5ed3f7);});_0x13c7d0[_0x33f8('0x57')]();});}exports[_0x33f8('0x58')]=function(_0x156a54,_0x2a0dfa){var _0x336bf9=getPDFPrinter();var _0x36965d=getPDFDocDefinitionFromHTML(_0x156a54,_0x2a0dfa);var _0xc1a295=_0x336bf9[_0x33f8('0x59')](_0x36965d);return writePDFDocument(_0xc1a295,_0x2a0dfa[_0x33f8('0x2')])[_0x33f8('0x47')](function(_0x2c0c42){throw _0x2c0c42;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 206a7f9..3ef4dd6 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 _0x10df=['forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','existsSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','XLSX','inspect','Failed','finally','exit','util','path','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x10df,0x1ae));var _0xf10d=function(_0x15beeb,_0x32bd4f){_0x15beeb=_0x15beeb-0x0;var _0x5b681a=_0x10df[_0x15beeb];return _0x5b681a;};'use strict';var util=require(_0xf10d('0x0'));var path=require(_0xf10d('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xf10d('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xf10d('0x3'));var rimraf=require(_0xf10d('0x4'));var db=require(_0xf10d('0x5'))['db'];var dbH=require(_0xf10d('0x5'))['dbH'];var logger=require(_0xf10d('0x6'))(_0xf10d('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf10d('0x8')][0x2]);var QUERY=process[_0xf10d('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb289f0,_0x288077){var _0x5d5de5={'status':_0xb289f0};var _0x34040a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x288077){_0x5d5de5['savename']=_0x288077;}return db[_0xf10d('0x9')][_0xf10d('0xa')](_0x5d5de5,_0x34040a);}function main(){var _0x4f3184=0x1388;var _0x367714;logger[_0xf10d('0xb')](util['format'](_0xf10d('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf10d('0xd')][_0xf10d('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf10d('0xf'),_0xf10d('0x10')]})[_0xf10d('0x11')](function(_0x316670){if(_0x316670){_0x367714=_0x316670;_0x4f3184=_0x367714['splitSizeXlsx']||0x1388;}})[_0xf10d('0x11')](function(){return dbH[_0xf10d('0x12')][_0xf10d('0x13')](util[_0xf10d('0x14')](_0xf10d('0x15'),QUERY),{'type':dbH[_0xf10d('0x12')][_0xf10d('0x16')][_0xf10d('0x17')]});})[_0xf10d('0x11')](function(_0x3d985a){if(!_0x3d985a[0x0][_0xf10d('0x18')]){return analyticExtractedReport(_0xf10d('0x19'));}var _0x5c60fc=[];var _0x5c2190=0x0;if(_0x367714['split']){if(_0x3d985a&&_0x3d985a[_0xf10d('0x1a')]){var _0x37084a=_[_0xf10d('0x1b')](_0x3d985a[0x0][_0xf10d('0x18')]/_0x4f3184);var _0x5ed1f3=Number[_0xf10d('0x1c')](_0x3d985a[0x0][_0xf10d('0x18')]/_0x4f3184)?_0x3d985a[0x0][_0xf10d('0x18')]%_0x4f3184:0x0;_0x37084a[_0xf10d('0x1d')](function(_0x275dfe){if(_0x275dfe>0x0){_0x5c2190+=_0x4f3184;}_0x5c60fc['push'](dbH[_0xf10d('0x12')][_0xf10d('0x13')](util[_0xf10d('0x14')](_0xf10d('0x1e'),QUERY,_0x4f3184,_0x5c2190),{'type':dbH[_0xf10d('0x12')][_0xf10d('0x16')]['SELECT']}));});if(_0x5ed1f3>0x0){_0x5c2190+=_0x4f3184;_0x5c60fc[_0xf10d('0x1f')](dbH['sequelize'][_0xf10d('0x13')](util[_0xf10d('0x14')](_0xf10d('0x1e'),QUERY,_0x5ed1f3,_0x5c2190),{'type':dbH[_0xf10d('0x12')][_0xf10d('0x16')]['SELECT']}));}}}else{_0x5c60fc['push'](dbH[_0xf10d('0x12')][_0xf10d('0x13')](QUERY,{'type':dbH[_0xf10d('0x12')][_0xf10d('0x16')]['SELECT']}));}var _0x45959c=path[_0xf10d('0x20')](PATH);var _0x406a72=path[_0xf10d('0x21')](PATH,'.xlsx');var _0x3106f4=_0x367714[_0xf10d('0xf')]&&_0x5c60fc['length']>0x1;var _0x1c37f3=[];if(!fs[_0xf10d('0x22')](path[_0xf10d('0x23')](_0x45959c,_0x406a72))&&_0x3106f4){fs['mkdirSync'](path[_0xf10d('0x23')](_0x45959c,_0x406a72));}return BPromise[_0xf10d('0x24')](_0x5c60fc,function(_0x2edf5e){_0x1c37f3['push'](_0x2edf5e);})[_0xf10d('0x11')](function(){for(var _0x5a7030=0x0;_0x5a7030<_0x1c37f3[_0xf10d('0x1a')];_0x5a7030+=0x1){var _0xbac7ac;var _0x2c5a1f=_0x1c37f3[_0x5a7030];if(_0x3106f4){_0xbac7ac=path[_0xf10d('0x23')](_0x45959c,_0x406a72,util[_0xf10d('0x14')](_0xf10d('0x25'),_0x406a72,_0x5a7030,'xlsx'));}else{_0xbac7ac=path[_0xf10d('0x23')](_0x45959c,util[_0xf10d('0x14')]('%s.%s',_0x406a72,_0xf10d('0x26')));}fs[_0xf10d('0x27')](_0xbac7ac,json2xls(_0x2c5a1f),_0xf10d('0x28'));}})[_0xf10d('0x11')](function(){if(_0x3106f4){return new Promise(function(_0x1409a2){zipdir(path['join'](_0x45959c,_0x406a72),{'saveTo':path[_0xf10d('0x23')](_0x45959c,util[_0xf10d('0x14')](_0xf10d('0x29'),_0x406a72,_0xf10d('0x2a')))},function(_0xc8c3c0,_0x12352a){rimraf(path['join'](_0x45959c,_0x406a72),function(){});_0x1409a2(_0xf10d('0x2b'));});});}})[_0xf10d('0x11')](function(){logger[_0xf10d('0xb')](util[_0xf10d('0x14')](_0xf10d('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xf10d('0x2d'),_0x3106f4?util[_0xf10d('0x14')](_0xf10d('0x29'),_0x406a72,_0x3106f4?_0xf10d('0x2a'):_0xf10d('0x26')):null);});})['catch'](function(_0x2cce1f){logger[_0xf10d('0xb')](util[_0xf10d('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf10d('0x2e')),util[_0xf10d('0x2f')](_0x2cce1f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf10d('0x30'));})[_0xf10d('0x31')](function(){process[_0xf10d('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbe5d=['isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length','%s%d.%s','xlsx','writeFileSync','%s.%s','zip\x20finished','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','finally','exit','util','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','split'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbe5d,0x1b0));var _0xdbe5=function(_0x2ec76c,_0x11003a){_0x2ec76c=_0x2ec76c-0x0;var _0x5c892=_0xbe5d[_0x2ec76c];return _0x5c892;};'use strict';var util=require(_0xdbe5('0x0'));var path=require(_0xdbe5('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xdbe5('0x2'));var BPromise=require(_0xdbe5('0x3'));var zipdir=require(_0xdbe5('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xdbe5('0x5'))[_0xdbe5('0x6')];var logger=require('../../config/logger')(_0xdbe5('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xdbe5('0x8')][0x2]);var QUERY=process[_0xdbe5('0x8')][0x3];var PATH=process[_0xdbe5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x50b5cc,_0xb2d505){var _0x1b7a19={'status':_0x50b5cc};var _0x3b139d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb2d505){_0x1b7a19[_0xdbe5('0x9')]=_0xb2d505;}return db[_0xdbe5('0xa')][_0xdbe5('0xb')](_0x1b7a19,_0x3b139d);}function main(){var _0x1a298c=0x1388;var _0x33a335;logger[_0xdbe5('0xc')](util[_0xdbe5('0xd')](_0xdbe5('0xe'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')));return db[_0xdbe5('0x10')][_0xdbe5('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdbe5('0x12')]})[_0xdbe5('0x13')](function(_0x14ae5f){if(_0x14ae5f){_0x33a335=_0x14ae5f;_0x1a298c=_0x33a335['splitSizeXlsx']||0x1388;}})[_0xdbe5('0x13')](function(){return dbH[_0xdbe5('0x14')][_0xdbe5('0x15')](util[_0xdbe5('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]});})['then'](function(_0x4b98ad){if(!_0x4b98ad[0x0][_0xdbe5('0x18')]){return analyticExtractedReport(_0xdbe5('0x19'));}var _0x1c6aff=[];var _0x242e18=0x0;if(_0x33a335[_0xdbe5('0x1a')]){if(_0x4b98ad&&_0x4b98ad['length']){var _0x330e9e=_['range'](_0x4b98ad[0x0][_0xdbe5('0x18')]/_0x1a298c);var _0x5443a2=Number[_0xdbe5('0x1b')](_0x4b98ad[0x0][_0xdbe5('0x18')]/_0x1a298c)?_0x4b98ad[0x0]['num']%_0x1a298c:0x0;_0x330e9e[_0xdbe5('0x1c')](function(_0x751f68){if(_0x751f68>0x0){_0x242e18+=_0x1a298c;}_0x1c6aff[_0xdbe5('0x1d')](dbH[_0xdbe5('0x14')][_0xdbe5('0x15')](util[_0xdbe5('0xd')](_0xdbe5('0x1e'),QUERY,_0x1a298c,_0x242e18),{'type':dbH[_0xdbe5('0x14')]['QueryTypes'][_0xdbe5('0x17')]}));});if(_0x5443a2>0x0){_0x242e18+=_0x1a298c;_0x1c6aff[_0xdbe5('0x1d')](dbH['sequelize'][_0xdbe5('0x15')](util[_0xdbe5('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5443a2,_0x242e18),{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]}));}}}else{_0x1c6aff[_0xdbe5('0x1d')](dbH['sequelize'][_0xdbe5('0x15')](QUERY,{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]}));}var _0x57685a=path[_0xdbe5('0x1f')](PATH);var _0x4f9c2c=path[_0xdbe5('0x20')](PATH,_0xdbe5('0x21'));var _0x5ee97e=_0x33a335[_0xdbe5('0x1a')]&&_0x1c6aff['length']>0x1;var _0x5a6d3a=[];if(!fs[_0xdbe5('0x22')](path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c))&&_0x5ee97e){fs[_0xdbe5('0x24')](path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c));}return BPromise[_0xdbe5('0x25')](_0x1c6aff,function(_0x4515e6){_0x5a6d3a[_0xdbe5('0x1d')](_0x4515e6);})[_0xdbe5('0x13')](function(){for(var _0x3819ed=0x0;_0x3819ed<_0x5a6d3a[_0xdbe5('0x26')];_0x3819ed+=0x1){var _0x59ad9b;var _0x5b455e=_0x5a6d3a[_0x3819ed];if(_0x5ee97e){_0x59ad9b=path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c,util['format'](_0xdbe5('0x27'),_0x4f9c2c,_0x3819ed,_0xdbe5('0x28')));}else{_0x59ad9b=path[_0xdbe5('0x23')](_0x57685a,util['format']('%s.%s',_0x4f9c2c,'xlsx'));}fs[_0xdbe5('0x29')](_0x59ad9b,json2xls(_0x5b455e),'binary');}})['then'](function(){if(_0x5ee97e){return new Promise(function(_0x38d02d){zipdir(path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c),{'saveTo':path[_0xdbe5('0x23')](_0x57685a,util['format'](_0xdbe5('0x2a'),_0x4f9c2c,'zip'))},function(_0x13ff64,_0x35f2a){rimraf(path['join'](_0x57685a,_0x4f9c2c),function(){});_0x38d02d(_0xdbe5('0x2b'));});});}})[_0xdbe5('0x13')](function(){logger[_0xdbe5('0xc')](util['format'](_0xdbe5('0x2c'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')));return analyticExtractedReport(_0xdbe5('0x2d'),_0x5ee97e?util[_0xdbe5('0xd')](_0xdbe5('0x2a'),_0x4f9c2c,_0x5ee97e?_0xdbe5('0x2e'):_0xdbe5('0x28')):null);});})[_0xdbe5('0x2f')](function(_0x32642d){logger[_0xdbe5('0xc')](util[_0xdbe5('0xd')](_0xdbe5('0x30'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')),util['inspect'](_0x32642d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xdbe5('0x31')](function(){process[_0xdbe5('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8d14aca..375dcfe 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 _0x3640=['indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','transaction','models','destroy','bulkCreate','error','lodash','util','then','intervals','VoiceExtension','findAll','IntervalId','CAST(priority\x20AS\x20UNSIGNED)','exten','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','VoiceExtensionId','Set','CDR(routeid)=','context','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','updatedAt','interval','*,*,*,*','map','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','answer'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x3640,0x1d7));var _0x0364=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3640[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0364('0x0'));var util=require(_0x0364('0x1'));function rewrite(_0x23480f,_0x568013){var _0x53f40e=this;return _0x23480f['models']['Interval']['findAll']({'raw':!![]})[_0x0364('0x2')](function(_0x16dbd5){_0x53f40e[_0x0364('0x3')]=_0x16dbd5;return _0x23480f['models'][_0x0364('0x4')][_0x0364('0x5')]({'where':{'IntervalId':_0x568013[_0x0364('0x6')]},'raw':!![]});})[_0x0364('0x2')](function(_0x15d2a5){return _0x23480f['models'][_0x0364('0x4')]['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x15d2a5,'exten'))}},'order':[{'raw':_0x0364('0x7')}],'raw':!![]});})[_0x0364('0x2')](function(_0x112445){var _0x4aed44=_['filter'](_0x112445,{'priority':'1'});var _0x4ed3f3=_['filter'](_0x112445,{'isApp':0x1});var _0x1909a5=_['groupBy'](_0x4ed3f3,_0x0364('0x8'));var _0x2fafb2=['queue',_0x0364('0x9')];var _0x198e19=[];var _0x48bd1e=[];for(var _0x1cde8f in _0x1909a5){if(_0x1909a5[_0x0364('0xa')](_0x1cde8f)){_0x53f40e[_0x0364('0xb')]=0x2;_0x53f40e[_0x0364('0xc')]=[];_0x53f40e[_0x0364('0xd')]=_[_0x0364('0xe')](_0x4aed44,{'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')]});_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':'Set','appdata':util[_0x0364('0x11')](_0x0364('0x12'),_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')]),'context':_0x1909a5[_0x1cde8f][0x0]['context'],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});if(_0x1909a5[_0x1cde8f][0x0]['type']==='inbound'){_0x53f40e[_0x0364('0xc')]['push']({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x0364('0x15')+_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')],'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});}else if(_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')]===_0x0364('0x17')){if(_0x53f40e[_0x0364('0xd')]){_0x53f40e['extensions'][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':'CDR(destination)='+(_0x53f40e['extension'][_0x0364('0x18')]?_0x0364('0x19')+_0x53f40e['extension'][_0x0364('0x18')]+'}':_0x0364('0x1a')),'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});}_0x53f40e['extensions']['push']({'type':_0x1909a5[_0x1cde8f][0x0]['type'],'app':_0x0364('0x14'),'appdata':'CDR(routeid)='+_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')],'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});var _0x3ab25e=_0x53f40e[_0x0364('0xb')]++;_0x53f40e['extensions'][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x1b'),'appdata':_0x0364('0x1c')+(_0x3ab25e+0x2)+_0x0364('0x1d')+(_0x3ab25e+0x1)+')','context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x3ab25e,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});if(_0x53f40e['extension']){_0x53f40e['extensions'][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x53f40e['extension'][_0x0364('0x18')]?'CDR(prefix)=${EXTEN:0:'+_0x53f40e[_0x0364('0xd')][_0x0364('0x18')]+'}':_0x0364('0x1e'),'context':_0x1909a5[_0x1cde8f][0x0]['context'],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e['priority']++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});}_0x53f40e[_0x0364('0xc')]['push']({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':'Set','appdata':_0x0364('0x1f')+_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')],'context':_0x1909a5[_0x1cde8f][0x0]['context'],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});if(_0x53f40e[_0x0364('0xd')]&&_0x53f40e[_0x0364('0xd')][_0x0364('0xa')](_0x0364('0x20'))&&_0x53f40e[_0x0364('0xd')]['recordingFormat']!==_0x0364('0x21')){_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x0364('0x22')+_0x53f40e[_0x0364('0xd')][_0x0364('0x20')]||_0x0364('0x23'),'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0]['exten'],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});}}_0x53f40e[_0x0364('0xc')]['push']({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0]['exten'],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x0364('0x24'),'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'priority':_0x53f40e['priority']++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x0364('0x25'),'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'exten':_0x1909a5[_0x1cde8f][0x0]['exten'],'priority':_0x53f40e[_0x0364('0xb')]++,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]});for(var _0x2bad73=0x0,_0x4caf1c=0x0;_0x2bad73<_0x1909a5[_0x1cde8f]['length'];_0x2bad73+=0x1,_0x4caf1c=0x0){var _0x2bc6c2=_0x1909a5[_0x1cde8f][_0x2bad73];if(_0x2bc6c2[_0x0364('0x10')]){_0x2bc6c2[_0x0364('0x10')]=_0x2bc6c2[_0x0364('0x10')]['toLowerCase']();}var _0x550549=[];var _0xdc3e60=[];delete _0x2bc6c2['id'];delete _0x2bc6c2['createdAt'];delete _0x2bc6c2[_0x0364('0x26')];var _0x23d3ad=_0x2bc6c2[_0x0364('0x27')]!==_0x0364('0x28')?[_0x2bc6c2[_0x0364('0x27')]]:_0x2bc6c2[_0x0364('0x6')]?_[_0x0364('0x29')](_[_0x0364('0x2a')](_0x53f40e[_0x0364('0x3')],{'IntervalId':_0x2bc6c2['IntervalId']}),_0x0364('0x27')):[];if(_0x2bc6c2[_0x0364('0xa')](_0x0364('0x2b'))){if(_0x2bc6c2[_0x0364('0x2b')]&&_0x2bc6c2['tag']!=='--'){_0x550549[_0x0364('0xf')]({'type':_0x2bc6c2[_0x0364('0x10')],'app':'Set','appdata':_0x0364('0x2c')+_0x2bc6c2[_0x0364('0x2b')],'context':_0x2bc6c2[_0x0364('0x16')],'exten':_0x2bc6c2[_0x0364('0x8')],'priority':_0x23d3ad['length']+_0x53f40e['priority']+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});}}if(_0x2bc6c2[_0x0364('0x10')]===_0x0364('0x17')&&_0x2bc6c2[_0x0364('0xa')]('callerID')){if(_0x2bc6c2[_0x0364('0x2d')]){_0x550549['push']({'type':_0x2bc6c2[_0x0364('0x10')],'app':_0x0364('0x1b'),'appdata':_0x0364('0x2e')+_0x2bc6c2[_0x0364('0x2d')]+')','context':_0x2bc6c2[_0x0364('0x16')],'exten':_0x2bc6c2[_0x0364('0x8')],'priority':_0x23d3ad['length']+_0x53f40e[_0x0364('0xb')]+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});}else{_0x550549[_0x0364('0xf')]({'type':_0x2bc6c2['type'],'app':_0x0364('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2bc6c2['context'],'exten':_0x2bc6c2[_0x0364('0x8')],'priority':_0x23d3ad[_0x0364('0x2f')]+_0x53f40e['priority']+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});}}if(_0x2bc6c2[_0x0364('0xa')](_0x0364('0x30'))){if(_0x2fafb2[_0x0364('0x31')](_0x2bc6c2[_0x0364('0x32')][_0x0364('0x33')]())>=0x0&&_0x2bc6c2[_0x0364('0x34')]!=='custom'){if(_0x2bc6c2[_0x0364('0x30')]){_0x550549[_0x0364('0xf')]({'type':_0x2bc6c2[_0x0364('0x10')],'app':'ExecIf','appdata':_0x0364('0x35'),'context':_0x2bc6c2[_0x0364('0x16')],'exten':_0x2bc6c2['exten'],'priority':_0x23d3ad[_0x0364('0x2f')]+_0x53f40e[_0x0364('0xb')]+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2['VoiceExtensionId']});_0x550549[_0x0364('0xf')]({'type':_0x2bc6c2[_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':_0x0364('0x36'),'context':_0x2bc6c2['context'],'exten':_0x2bc6c2['exten'],'priority':_0x23d3ad[_0x0364('0x2f')]+_0x53f40e[_0x0364('0xb')]+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});}else{_0x550549['push']({'type':_0x2bc6c2[_0x0364('0x10')],'app':'ExecIf','appdata':_0x0364('0x37'),'context':_0x2bc6c2[_0x0364('0x16')],'exten':_0x2bc6c2[_0x0364('0x8')],'priority':_0x23d3ad[_0x0364('0x2f')]+_0x53f40e[_0x0364('0xb')]+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});_0x550549[_0x0364('0xf')]({'type':_0x2bc6c2[_0x0364('0x10')],'app':_0x0364('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2bc6c2[_0x0364('0x16')],'exten':_0x2bc6c2[_0x0364('0x8')],'priority':_0x23d3ad[_0x0364('0x2f')]+_0x53f40e[_0x0364('0xb')]+_0x4caf1c++,'VoiceExtensionId':_0x2bc6c2[_0x0364('0x13')]});}}}for(var _0x17c58e=0x0;_0x17c58e<_0x23d3ad['length'];_0x17c58e+=0x1){var _0x6449c9=_0x53f40e['priority']+_0x23d3ad[_0x0364('0x2f')];var _0x2cd631=_0x17c58e===_0x23d3ad[_0x0364('0x2f')]-0x1?_0x53f40e[_0x0364('0xb')]+_0x550549[_0x0364('0x2f')]+_0xdc3e60[_0x0364('0x2f')]+0x2:_0x53f40e[_0x0364('0xb')]+_0x17c58e+0x1;_0x550549[_0x0364('0x38')](_0x17c58e,0x0,{'type':_0x2bc6c2[_0x0364('0x10')],'app':'GotoIfTime','appdata':_0x23d3ad[_0x17c58e]+'?'+_0x2bc6c2[_0x0364('0x16')]+_0x0364('0x39')+_0x6449c9+':'+_0x2bc6c2[_0x0364('0x16')]+_0x0364('0x39')+_0x2cd631,'exten':_0x2bc6c2['exten'],'context':_0x2bc6c2['context'],'priority':_0x53f40e[_0x0364('0xb')]+_0x17c58e,'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});}_0x2bc6c2[_0x0364('0xb')]=_0x550549['length']?_[_0x0364('0x3a')](_0x550549)[_0x0364('0xb')]+0x1:_0x53f40e[_0x0364('0xb')];_0x53f40e[_0x0364('0xb')]=(_0xdc3e60[_0x0364('0x2f')]?_['last'](_0xdc3e60)[_0x0364('0xb')]:_0x2bc6c2[_0x0364('0xb')])+0x1;_0x53f40e['extensions']=_[_0x0364('0x3b')](_0x53f40e[_0x0364('0xc')],_0x550549,[_0x2bc6c2],_0xdc3e60);}_0x53f40e[_0x0364('0xc')][_0x0364('0xf')]({'type':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x10')],'app':'Hangup','exten':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x8')],'context':_0x1909a5[_0x1cde8f][0x0][_0x0364('0x16')],'priority':_0x53f40e[_0x0364('0xb')],'VoiceExtensionId':_0x1909a5[_0x1cde8f][0x0]['VoiceExtensionId']});_0x198e19[_0x0364('0xf')](_0x1909a5[_0x1cde8f][0x0][_0x0364('0x13')]);_0x48bd1e=_[_0x0364('0x3b')](_0x48bd1e,_0x53f40e[_0x0364('0xc')]);}}return _0x23480f[_0x0364('0x3c')](function(_0x419a29){return _0x23480f[_0x0364('0x3d')][_0x0364('0x4')][_0x0364('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x198e19}},'transaction':_0x419a29})[_0x0364('0x2')](function(_0x49bae5){return _0x23480f[_0x0364('0x3d')][_0x0364('0x4')][_0x0364('0x3f')](_['sortBy'](_0x48bd1e,_0x0364('0xb')),{'transaction':_0x419a29});});});})['catch'](function(_0x5cb519){console[_0x0364('0x40')](_0x5cb519);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xd8f3=['findAll','intervals','VoiceExtension','uniq','exten','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','then','sortBy','catch','lodash','models','Interval'];(function(_0x2036d3,_0x123ff3){var _0x1b1952=function(_0x1240d9){while(--_0x1240d9){_0x2036d3['push'](_0x2036d3['shift']());}};_0x1b1952(++_0x123ff3);}(_0xd8f3,0x195));var _0x3d8f=function(_0xfd655c,_0x382323){_0xfd655c=_0xfd655c-0x0;var _0xee02d8=_0xd8f3[_0xfd655c];return _0xee02d8;};'use strict';var _=require(_0x3d8f('0x0'));var util=require('util');function rewrite(_0x29e149,_0x1fa9f3){var _0x2ebbc0=this;return _0x29e149[_0x3d8f('0x1')][_0x3d8f('0x2')][_0x3d8f('0x3')]({'raw':!![]})['then'](function(_0xfdfef2){_0x2ebbc0[_0x3d8f('0x4')]=_0xfdfef2;return _0x29e149[_0x3d8f('0x1')][_0x3d8f('0x5')][_0x3d8f('0x3')]({'where':{'IntervalId':_0x1fa9f3['IntervalId']},'raw':!![]});})['then'](function(_0x53fcf3){return _0x29e149['models']['VoiceExtension'][_0x3d8f('0x3')]({'where':{'exten':{'$in':_[_0x3d8f('0x6')](_['map'](_0x53fcf3,_0x3d8f('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x375fcd){var _0x58bb7e=_[_0x3d8f('0x8')](_0x375fcd,{'priority':'1'});var _0x32d810=_[_0x3d8f('0x8')](_0x375fcd,{'isApp':0x1});var _0x580e19=_[_0x3d8f('0x9')](_0x32d810,_0x3d8f('0x7'));var _0x5992b7=['queue',_0x3d8f('0xa')];var _0x46fd7e=[];var _0x1f280a=[];for(var _0x32b7c4 in _0x580e19){if(_0x580e19[_0x3d8f('0xb')](_0x32b7c4)){_0x2ebbc0[_0x3d8f('0xc')]=0x2;_0x2ebbc0[_0x3d8f('0xd')]=[];_0x2ebbc0[_0x3d8f('0xe')]=_[_0x3d8f('0xf')](_0x58bb7e,{'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')]});_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':util[_0x3d8f('0x13')](_0x3d8f('0x14'),_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')]),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')]===_0x3d8f('0x17')){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x18')+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}else if(_0x580e19[_0x32b7c4][0x0]['type']===_0x3d8f('0x19')){if(_0x2ebbc0[_0x3d8f('0xe')]){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x1a')+(_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]?_0x3d8f('0x1c')+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]+'}':_0x3d8f('0x1d')),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0['priority']++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x12'),'appdata':'CDR(routeid)='+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});var _0x4b95c7=_0x2ebbc0[_0x3d8f('0xc')]++;_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x1f')+(_0x4b95c7+0x2)+_0x3d8f('0x20')+(_0x4b95c7+0x1)+')','context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x4b95c7,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x2ebbc0[_0x3d8f('0xe')]){_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x2ebbc0[_0x3d8f('0xe')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]+'}':_0x3d8f('0x21'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x22')+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x2ebbc0[_0x3d8f('0xe')]&&_0x2ebbc0['extension'][_0x3d8f('0xb')]('recordingFormat')&&_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x23')]!==_0x3d8f('0x24')){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x25'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x26')+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x23')]||'wav','context':_0x580e19[_0x32b7c4][0x0]['context'],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}}_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x27'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x28'),'context':_0x580e19[_0x32b7c4][0x0]['context'],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});for(var _0x3c6ad2=0x0,_0x2bde85=0x0;_0x3c6ad2<_0x580e19[_0x32b7c4][_0x3d8f('0x29')];_0x3c6ad2+=0x1,_0x2bde85=0x0){var _0x5990e2=_0x580e19[_0x32b7c4][_0x3c6ad2];if(_0x5990e2[_0x3d8f('0x11')]){_0x5990e2[_0x3d8f('0x11')]=_0x5990e2[_0x3d8f('0x11')][_0x3d8f('0x2a')]();}var _0x1b965b=[];var _0x2f799f=[];delete _0x5990e2['id'];delete _0x5990e2[_0x3d8f('0x2b')];delete _0x5990e2[_0x3d8f('0x2c')];var _0x49e1a3=_0x5990e2[_0x3d8f('0x2d')]!==_0x3d8f('0x2e')?[_0x5990e2[_0x3d8f('0x2d')]]:_0x5990e2[_0x3d8f('0x2f')]?_[_0x3d8f('0x30')](_[_0x3d8f('0x8')](_0x2ebbc0['intervals'],{'IntervalId':_0x5990e2['IntervalId']}),_0x3d8f('0x2d')):[];if(_0x5990e2[_0x3d8f('0xb')]('tag')){if(_0x5990e2[_0x3d8f('0x31')]&&_0x5990e2[_0x3d8f('0x31')]!=='--'){_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2['type'],'app':_0x3d8f('0x12'),'appdata':'CDR(tag)='+_0x5990e2[_0x3d8f('0x31')],'context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2['VoiceExtensionId']});}}if(_0x5990e2[_0x3d8f('0x11')]===_0x3d8f('0x19')&&_0x5990e2[_0x3d8f('0xb')](_0x3d8f('0x32'))){if(_0x5990e2[_0x3d8f('0x32')]){_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x33')+_0x5990e2['callerID']+')','context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}else{_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2['type'],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x34'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}}if(_0x5990e2['hasOwnProperty']('answer')){if(_0x5992b7['indexOf'](_0x5990e2[_0x3d8f('0x35')][_0x3d8f('0x2a')]())>=0x0&&_0x5990e2[_0x3d8f('0x36')]!=='custom'){if(_0x5990e2[_0x3d8f('0x37')]){_0x1b965b['push']({'type':_0x5990e2[_0x3d8f('0x11')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x38'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3['length']+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}else{_0x1b965b['push']({'type':_0x5990e2[_0x3d8f('0x11')],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x39'),'context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x3a'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}}}for(var _0x34d437=0x0;_0x34d437<_0x49e1a3[_0x3d8f('0x29')];_0x34d437+=0x1){var _0x40adc8=_0x2ebbc0['priority']+_0x49e1a3[_0x3d8f('0x29')];var _0x2c14cc=_0x34d437===_0x49e1a3['length']-0x1?_0x2ebbc0[_0x3d8f('0xc')]+_0x1b965b[_0x3d8f('0x29')]+_0x2f799f[_0x3d8f('0x29')]+0x2:_0x2ebbc0[_0x3d8f('0xc')]+_0x34d437+0x1;_0x1b965b[_0x3d8f('0x3b')](_0x34d437,0x0,{'type':_0x5990e2[_0x3d8f('0x11')],'app':'GotoIfTime','appdata':_0x49e1a3[_0x34d437]+'?'+_0x5990e2[_0x3d8f('0x15')]+_0x3d8f('0x3c')+_0x40adc8+':'+_0x5990e2['context']+_0x3d8f('0x3c')+_0x2c14cc,'exten':_0x5990e2[_0x3d8f('0x7')],'context':_0x5990e2[_0x3d8f('0x15')],'priority':_0x2ebbc0[_0x3d8f('0xc')]+_0x34d437,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x5990e2[_0x3d8f('0xc')]=_0x1b965b[_0x3d8f('0x29')]?_[_0x3d8f('0x3d')](_0x1b965b)['priority']+0x1:_0x2ebbc0[_0x3d8f('0xc')];_0x2ebbc0[_0x3d8f('0xc')]=(_0x2f799f[_0x3d8f('0x29')]?_['last'](_0x2f799f)[_0x3d8f('0xc')]:_0x5990e2[_0x3d8f('0xc')])+0x1;_0x2ebbc0[_0x3d8f('0xd')]=_[_0x3d8f('0x3e')](_0x2ebbc0['extensions'],_0x1b965b,[_0x5990e2],_0x2f799f);}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Hangup','exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'priority':_0x2ebbc0[_0x3d8f('0xc')],'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});_0x46fd7e[_0x3d8f('0x10')](_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]);_0x1f280a=_['concat'](_0x1f280a,_0x2ebbc0[_0x3d8f('0xd')]);}}return _0x29e149[_0x3d8f('0x3f')](function(_0x259055){return _0x29e149[_0x3d8f('0x1')]['VoiceExtension'][_0x3d8f('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x46fd7e}},'transaction':_0x259055})[_0x3d8f('0x41')](function(_0x3bc7dd){return _0x29e149['models'][_0x3d8f('0x5')]['bulkCreate'](_[_0x3d8f('0x42')](_0x1f280a,_0x3d8f('0xc')),{'transaction':_0x259055});});});})[_0x3d8f('0x43')](function(_0x1bea4a){console['error'](_0x1bea4a);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 13d1a03..537b884 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 _0xdd8b=['updatedAt','field','phone','toString','NOW()','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper','into','fromQuery','str','calleridnum','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','catch','VoiceQueueId','all','findAll','CmList','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','socket.io-emitter','../../../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','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','data','firstName','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','then','push','pick','message','stringify','cmContact','checkHopper','inspect','insert','scheduledAt','ContactId','createdAt'];(function(_0x514f00,_0x130b31){var _0x1d2624=function(_0x2c3376){while(--_0x2c3376){_0x514f00['push'](_0x514f00['shift']());}};_0x1d2624(++_0x130b31);}(_0xdd8b,0x1e0));var _0xbdd8=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0xdd8b[_0xea35d1];return _0x1d7a7c;};'use strict';var BPromise=require(_0xbdd8('0x0'));var util=require(_0xbdd8('0x1'));var _=require(_0xbdd8('0x2'));var fs=require('fs');var squel=require(_0xbdd8('0x3'));var Papa=require(_0xbdd8('0x4'));var Redis=require('ioredis');var db=require(_0xbdd8('0x5'))['db'];var config=require(_0xbdd8('0x6'));var logger=require(_0xbdd8('0x7'))(_0xbdd8('0x8'));config[_0xbdd8('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbdd8('0xa'))(new Redis(config[_0xbdd8('0x9')]));require(_0xbdd8('0xb'))[_0xbdd8('0xc')](socket);try{if(!process[_0xbdd8('0xd')][0x2]||process[_0xbdd8('0xd')][0x2]===_0xbdd8('0xe')||process[_0xbdd8('0xd')][0x2]===_0xbdd8('0xf')){throw new Error(_0xbdd8('0x10'));}var FILEPATH=process[_0xbdd8('0xd')][0x2];if(!process[_0xbdd8('0xd')][0x3]||process[_0xbdd8('0xd')][0x3]===_0xbdd8('0xe')||process[_0xbdd8('0xd')][0x3]===_0xbdd8('0xf')||!process['argv'][0x4]||process[_0xbdd8('0xd')][0x4]===_0xbdd8('0xe')||process[_0xbdd8('0xd')][0x4]===_0xbdd8('0xf')){throw new Error(_0xbdd8('0x11'));}var FIELDS=_[_0xbdd8('0x12')](process[_0xbdd8('0xd')][0x3][_0xbdd8('0x13')](','),process[_0xbdd8('0xd')][0x4][_0xbdd8('0x13')](','));if(!process[_0xbdd8('0xd')][0x5]||process['argv'][0x5]===_0xbdd8('0xe')||process[_0xbdd8('0xd')][0x5]===_0xbdd8('0xf')){throw new Error(_0xbdd8('0x14'));}var LISTID=process[_0xbdd8('0xd')][0x5];var COMPANYID=process[_0xbdd8('0xd')][0x6]&&process['argv'][0x6]!==_0xbdd8('0xe')&&process[_0xbdd8('0xd')][0x6]!==_0xbdd8('0xf')?process[_0xbdd8('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0xbdd8('0xe')&&process[_0xbdd8('0xd')][0x7]!==_0xbdd8('0xf')?process['argv'][0x7]:null;if(!process[_0xbdd8('0xd')][0x8]||process['argv'][0x8]===_0xbdd8('0xe')||process[_0xbdd8('0xd')][0x8]===_0xbdd8('0xf')){throw new Error(_0xbdd8('0x15'));}var SOCKET_TIMESTAMP=process[_0xbdd8('0xd')][0x8];}catch(_0x18a7ca){logger[_0xbdd8('0x16')](_0x18a7ca);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(_0x4ddc2d,_0x38f77e,_0x29bd50,_0x42ffae){var _0x106ec0={'message':_0x38f77e};_0x106ec0[_0x4ddc2d]=!![];if(_0x29bd50){_0x106ec0[_0xbdd8('0x17')]=_0x29bd50;}if(_0x42ffae){_0x106ec0['index']=_0x42ffae;}return _0x106ec0;}function isEmail(_0x124b92){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))*$/[_0xbdd8('0x18')](_0x124b92);}function checkRow(_0x948828,_0x57d717,_0x507e83){return new BPromise(function(_0x43a5fa,_0x46f4f6){if(_[_0xbdd8('0x19')](_0x948828)){return _0x46f4f6(handleCheckRowError('error',_0xbdd8('0x1a'),null,_0x507e83));}if(_0x948828[_0xbdd8('0x1b')]&&_0x948828[_0xbdd8('0x1b')][_0xbdd8('0x1c')]){var _0x102c24=_[_0xbdd8('0x1d')](_0x948828[_0xbdd8('0x1b')],'message')[_0xbdd8('0x1e')](';');return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),_0x102c24,null,_0x507e83));}var _0xdf50fb={};for(var _0x1803bb in FIELDS){if(FIELDS['hasOwnProperty'](_0x1803bb)&&FIELDS[_0x1803bb]){_0xdf50fb[_0x1803bb]=_0x948828[_0xbdd8('0x1f')][0x0][FIELDS[_0x1803bb]]||_0x948828[_0xbdd8('0x1f')][0x0]['\ufeff'+FIELDS[_0x1803bb]];}}if(!_0xdf50fb[_0xbdd8('0x20')]){return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),'firstName\x20not\x20specified!',null,_0x507e83));}if(!_0xdf50fb['phone']){return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),'phone\x20not\x20specified!',null,_0x507e83));}if(_0xdf50fb['birthDate']){var _0x4c3b80=moment(_0xdf50fb[_0xbdd8('0x21')],_0xbdd8('0x22'));if(!_0x4c3b80['isValid']()){return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),_0xbdd8('0x23'),null,_0x507e83));}}if(_0xdf50fb['email']){if(!isEmail(_0xdf50fb[_0xbdd8('0x24')])){return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),_0xbdd8('0x25'),null,_0x507e83));}}_0xdf50fb[_0xbdd8('0x26')]=LISTID;_0xdf50fb[_0xbdd8('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x57d717){var _0x349a01={};for(var _0x9bd03=0x0,_0x117e1d=DUPLICATES['length'];_0x9bd03<_0x117e1d;_0x9bd03+=0x1){_0x349a01[DUPLICATES[_0x9bd03]]=_0xdf50fb[DUPLICATES[_0x9bd03]];}var _0x40ac43=_[_0xbdd8('0x28')](_0x57d717,_0x349a01);if(_0x40ac43){return _0x46f4f6(handleCheckRowError('duplicate',_0xbdd8('0x29'),_0x40ac43,_0x507e83));}}return db[_0xbdd8('0x2a')]['create'](_0xdf50fb,{'raw':!![],'hooks':![],'fields':_['keys'](_0xdf50fb)})[_0xbdd8('0x2b')](function(_0x3e513b){if(DUPLICATES&&DUPLICATES[_0xbdd8('0x1c')]&&_0x57d717){_0x57d717[_0xbdd8('0x2c')](_[_0xbdd8('0x2d')](_0xdf50fb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3e513b['id'];return _0x43a5fa();})['catch'](function(_0x23003e){return _0x46f4f6(handleCheckRowError(_0xbdd8('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x23003e[_0xbdd8('0x2e')]||JSON[_0xbdd8('0x2f')](_0x23003e)),null,_0x507e83));});});}function checkHopper(){function _0x568a23(){return function(_0x3d4e50){logger[_0xbdd8('0x16')](_0xbdd8('0x30'),_0xbdd8('0x31'),util[_0xbdd8('0x32')](_0x3d4e50,{'showHidden':![],'depth':null}));};}var _0x47fd7e=function(_0x7b2361,_0x5e657a){var _0x4e0c29=squel[_0xbdd8('0x33')]()['into']('cm_hopper')['fromQuery'](['phone',_0xbdd8('0x34'),_0xbdd8('0x35'),_0xbdd8('0x26'),_0x5e657a,_0xbdd8('0x36'),_0xbdd8('0x37')],squel['select']()[_0xbdd8('0x38')](_0xbdd8('0x39'),_0xbdd8('0x39'))[_0xbdd8('0x38')]('NOW()','scheduledAt')[_0xbdd8('0x38')]('id',_0xbdd8('0x35'))['field'](LISTID[_0xbdd8('0x3a')](),_0xbdd8('0x26'))['field'](_0x7b2361['id'][_0xbdd8('0x3a')](),_0x5e657a)[_0xbdd8('0x38')](_0xbdd8('0x3b'),_0xbdd8('0x36'))[_0xbdd8('0x38')]('NOW()',_0xbdd8('0x37'))['from'](_0xbdd8('0x3c'))[_0xbdd8('0x3d')]('deletedAt\x20IS\x20NULL')[_0xbdd8('0x3d')](_0xbdd8('0x3e'),LISTID[_0xbdd8('0x3a')]())[_0xbdd8('0x3d')](_0xbdd8('0x3f'))[_0xbdd8('0x3d')](_0xbdd8('0x40'),squel[_0xbdd8('0x41')]()['field'](_0xbdd8('0x39'))[_0xbdd8('0x42')](_0xbdd8('0x43'))[_0xbdd8('0x3d')](_0x5e657a+'\x20=\x20?',_0x7b2361['id']['toString']())))[_0xbdd8('0x3a')]();return _0x4e0c29;};var _0x3671ce=function(_0x155782,_0x5b6520){var _0x240123=squel[_0xbdd8('0x33')]()[_0xbdd8('0x44')](_0xbdd8('0x43'))[_0xbdd8('0x45')]([_0xbdd8('0x39'),'scheduledAt',_0xbdd8('0x35'),'ListId',_0x5b6520,_0xbdd8('0x36'),_0xbdd8('0x37')],squel[_0xbdd8('0x41')]()[_0xbdd8('0x38')](_0xbdd8('0x39'),'phone')[_0xbdd8('0x38')](_0xbdd8('0x3b'),'scheduledAt')['field']('id',_0xbdd8('0x35'))[_0xbdd8('0x38')](LISTID[_0xbdd8('0x3a')](),_0xbdd8('0x26'))[_0xbdd8('0x38')](_0x155782['id'][_0xbdd8('0x3a')](),_0x5b6520)[_0xbdd8('0x38')](_0xbdd8('0x3b'),_0xbdd8('0x36'))[_0xbdd8('0x38')](_0xbdd8('0x3b'),_0xbdd8('0x37'))[_0xbdd8('0x42')](_0xbdd8('0x3c'))[_0xbdd8('0x3d')]('deletedAt\x20IS\x20NULL')[_0xbdd8('0x3d')]('ListId\x20=\x20?',LISTID[_0xbdd8('0x3a')]())[_0xbdd8('0x3d')]('id\x20IN\x20?',squel[_0xbdd8('0x46')](hopperContacts))[_0xbdd8('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xbdd8('0x3d')](_0xbdd8('0x40'),squel['select']()['field'](_0xbdd8('0x47'))['from']('cm_hopper_final')[_0xbdd8('0x3d')](_0x5b6520+_0xbdd8('0x48'),_0x155782['id'][_0xbdd8('0x3a')]()))[_0xbdd8('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xbdd8('0x39'))['from'](_0xbdd8('0x43'))['where'](_0x5b6520+_0xbdd8('0x48'),_0x155782['id']['toString']())))[_0xbdd8('0x3a')]();return _0x240123;};function _0x30d37d(_0x2453ce,_0x2b5bf3){var _0x27eaec=squel[_0xbdd8('0x33')]()[_0xbdd8('0x44')](_0xbdd8('0x43'))[_0xbdd8('0x45')](['phone','scheduledAt','ContactId',_0xbdd8('0x26'),_0x2b5bf3,_0xbdd8('0x36'),'updatedAt'],squel['select']()['field']('phone',_0xbdd8('0x39'))[_0xbdd8('0x38')](_0xbdd8('0x3b'),'scheduledAt')[_0xbdd8('0x38')]('id',_0xbdd8('0x35'))[_0xbdd8('0x38')](LISTID[_0xbdd8('0x3a')](),_0xbdd8('0x26'))[_0xbdd8('0x38')](_0x2453ce['id'][_0xbdd8('0x3a')](),_0x2b5bf3)[_0xbdd8('0x38')](_0xbdd8('0x3b'),_0xbdd8('0x36'))[_0xbdd8('0x38')](_0xbdd8('0x3b'),'updatedAt')['from'](_0xbdd8('0x3c'))['where'](_0xbdd8('0x49'))[_0xbdd8('0x3d')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0xbdd8('0x4a'),squel[_0xbdd8('0x46')](hopperContacts))[_0xbdd8('0x3d')](_0xbdd8('0x3f')))[_0xbdd8('0x3a')]();return _0x27eaec;}function _0x5a2c7f(_0x58c92b,_0x30cb80){var _0x2db39c=squel[_0xbdd8('0x33')]()[_0xbdd8('0x44')](_0xbdd8('0x4b'))[_0xbdd8('0x45')](['phone',_0xbdd8('0x35'),'ListId',_0x30cb80,'createdAt',_0xbdd8('0x37')],squel[_0xbdd8('0x41')]()[_0xbdd8('0x38')]('phone',_0xbdd8('0x39'))[_0xbdd8('0x38')]('id',_0xbdd8('0x35'))[_0xbdd8('0x38')](LISTID[_0xbdd8('0x3a')](),_0xbdd8('0x26'))[_0xbdd8('0x38')](_0x58c92b['id']['toString'](),_0x30cb80)[_0xbdd8('0x38')](_0xbdd8('0x3b'),_0xbdd8('0x36'))[_0xbdd8('0x38')]('NOW()','updatedAt')[_0xbdd8('0x42')](_0xbdd8('0x3c'))[_0xbdd8('0x3d')](_0xbdd8('0x49'))[_0xbdd8('0x3d')](_0xbdd8('0x3e'),LISTID[_0xbdd8('0x3a')]())[_0xbdd8('0x3d')](_0xbdd8('0x4a'),squel[_0xbdd8('0x46')](hopperContacts))[_0xbdd8('0x3d')](_0xbdd8('0x3f')))[_0xbdd8('0x3a')]();return _0x2db39c;}return db[_0xbdd8('0x4c')]['findAll']({'where':{'type':_0xbdd8('0x4d')},'attributes':['id',_0xbdd8('0x4e')],'include':[{'model':db['CmList'],'as':_0xbdd8('0x4f'),'where':{'id':LISTID}}]})[_0xbdd8('0x2b')](function(_0x5375c0){var _0x94a23d=[];if(_0x5375c0){var _0x55c9a4;for(var _0x4ee987=0x0,_0x353558;_0x4ee987<_0x5375c0[_0xbdd8('0x1c')];_0x4ee987+=0x1){_0x353558=_0x5375c0[_0x4ee987][_0xbdd8('0x50')]({'plain':!![]});switch(_0x353558[_0xbdd8('0x4e')]){case'always':_0x94a23d[_0xbdd8('0x2c')](db[_0xbdd8('0x51')][_0xbdd8('0x52')](_0x3671ce(_0x353558,'VoiceQueueId'))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));break;case'onlyIfOpen':_0x94a23d[_0xbdd8('0x2c')](db[_0xbdd8('0x51')]['query'](_0x47fd7e(_0x353558,_0xbdd8('0x54')))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));break;default:_0x94a23d[_0xbdd8('0x2c')](db['sequelize']['query'](_0x30d37d(_0x353558,_0xbdd8('0x54')))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));}}}return _0x94a23d;})[_0xbdd8('0x55')]()[_0xbdd8('0x2b')](function(){return db['VoiceQueue'][_0xbdd8('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xbdd8('0x57')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xbdd8('0x2b')](function(_0x3888be){var _0x1b1651=[];if(_0x3888be){var _0x2276fe;for(var _0x1cd369=0x0,_0x43ed6e;_0x1cd369<_0x3888be[_0xbdd8('0x1c')];_0x1cd369+=0x1){_0x43ed6e=_0x3888be[_0x1cd369][_0xbdd8('0x50')]({'plain':!![]});_0x1b1651[_0xbdd8('0x2c')](db[_0xbdd8('0x51')][_0xbdd8('0x52')](_0x5a2c7f(_0x43ed6e,'VoiceQueueId'))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));}}return _0x1b1651;})[_0xbdd8('0x55')]();})['then'](function(){return db[_0xbdd8('0x58')]['findAll']({'attributes':['id',_0xbdd8('0x4e')],'include':[{'model':db[_0xbdd8('0x57')],'as':_0xbdd8('0x4f'),'where':{'id':LISTID}}]})[_0xbdd8('0x2b')](function(_0x540e79){var _0xe6ea6b=[];if(_0x540e79){for(var _0x312066=0x0,_0x1071fc;_0x312066<_0x540e79[_0xbdd8('0x1c')];_0x312066+=0x1){_0x1071fc=_0x540e79[_0x312066][_0xbdd8('0x50')]({'plain':!![]});switch(_0x1071fc['dialCheckDuplicateType']){case _0xbdd8('0x59'):_0xe6ea6b[_0xbdd8('0x2c')](db['sequelize'][_0xbdd8('0x52')](_0x3671ce(_0x1071fc,_0xbdd8('0x5a')))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));break;case _0xbdd8('0x5b'):_0xe6ea6b['push'](db[_0xbdd8('0x51')]['query'](_0x47fd7e(_0x1071fc,_0xbdd8('0x5a')))['then'](function(){})[_0xbdd8('0x53')](_0x568a23()));break;default:_0xe6ea6b[_0xbdd8('0x2c')](db['sequelize']['query'](_0x30d37d(_0x1071fc,'CampaignId'))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));}}}return _0xe6ea6b;})['all']();})[_0xbdd8('0x2b')](function(){return db['Campaign'][_0xbdd8('0x56')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x381881){var _0x2e8fbf=[];if(_0x381881){for(var _0x3f17ac=0x0,_0x4365d7;_0x3f17ac<_0x381881[_0xbdd8('0x1c')];_0x3f17ac+=0x1){_0x4365d7=_0x381881[_0x3f17ac][_0xbdd8('0x50')]({'plain':!![]});_0x2e8fbf[_0xbdd8('0x2c')](db['sequelize'][_0xbdd8('0x52')](_0x5a2c7f(_0x4365d7,_0xbdd8('0x5a')))[_0xbdd8('0x2b')](function(){})[_0xbdd8('0x53')](_0x568a23()));}}return _0x2e8fbf;})[_0xbdd8('0x55')]();})[_0xbdd8('0x53')](function(_0x2dbbe4){logger[_0xbdd8('0x16')](_0xbdd8('0x5c'),'generalCheckHopper',_0x2dbbe4[_0xbdd8('0x2e')]);});}var processPromises=function(_0x3415c6){return BPromise[_0xbdd8('0x55')](promises)[_0xbdd8('0x2b')](function(_0x190cb5){})[_0xbdd8('0x53')](function(_0x57f72c){logger[_0xbdd8('0x16')](_0xbdd8('0x5d'),JSON[_0xbdd8('0x2f')](_0x57f72c));})['finally'](function(){socket[_0xbdd8('0x5e')](_0xbdd8('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3415c6){return _0x3415c6['resume']();}});};var endCsv=function(){return BPromise[_0xbdd8('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xbdd8('0x2b')](function(){socket[_0xbdd8('0x5e')](_0xbdd8('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0xb98ef6){logger[_0xbdd8('0x16')](_0xbdd8('0x61'),JSON[_0xbdd8('0x2f')](_0xb98ef6));}finally{process[_0xbdd8('0x62')](0x0);}});};process['on'](_0xbdd8('0x63'),function(){logger[_0xbdd8('0x64')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xbdd8('0x60')]()[_0xbdd8('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xbdd8('0x13')](',');return db[_0xbdd8('0x2a')][_0xbdd8('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xbdd8('0x2b')](function(_0x385b5e){var _0x30f29f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xbdd8('0x65')](_0x30f29f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x53cce6,_0x16d910){total+=0x1;var _0x557eda=total;promises[_0xbdd8('0x2c')](checkRow(_0x53cce6,_0x385b5e,_0x557eda)['then'](function(){success+=0x1;})[_0xbdd8('0x53')](function(_0x1845d8){if(_0x1845d8[_0xbdd8('0x16')]){errors+=0x1;delete _0x1845d8['error'];}else if(_0x1845d8[_0xbdd8('0x66')]){duplicates+=0x1;delete _0x1845d8[_0xbdd8('0x66')];}rows[_0xbdd8('0x2c')](_0x1845d8);}));if(total%0xc8===0x0){_0x16d910[_0xbdd8('0x67')]();return processPromises(_0x16d910);}},'complete':function(){return processPromises()[_0xbdd8('0x2b')](function(){logger['info'](_0xbdd8('0x68'));endCsv();});},'error':function(_0x1dec8d,_0x486555){logger['info'](_0xbdd8('0x69'),JSON['stringify'](_0x1dec8d));endCsv();}});})[_0xbdd8('0x53')](function(_0x50bed6){logger[_0xbdd8('0x16')](_0xbdd8('0x6a'),JSON[_0xbdd8('0x2f')](_0x50bed6));});}main(); \ No newline at end of file +var _0x59e3=['info','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','pause','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','message','join','hasOwnProperty','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!','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','insert','cm_hopper_black','str','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x59e3,0x77));var _0x359e=function(_0x18d2e6,_0x5894c1){_0x18d2e6=_0x18d2e6-0x0;var _0x3eb13c=_0x59e3[_0x18d2e6];return _0x3eb13c;};'use strict';var BPromise=require('bluebird');var util=require(_0x359e('0x0'));var _=require(_0x359e('0x1'));var fs=require('fs');var squel=require(_0x359e('0x2'));var Papa=require(_0x359e('0x3'));var Redis=require('ioredis');var db=require(_0x359e('0x4'))['db'];var config=require(_0x359e('0x5'));var logger=require(_0x359e('0x6'))(_0x359e('0x7'));config[_0x359e('0x8')]=_[_0x359e('0x9')](config[_0x359e('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x359e('0x8')]));require(_0x359e('0xa'))[_0x359e('0xb')](socket);try{if(!process[_0x359e('0xc')][0x2]||process[_0x359e('0xc')][0x2]===_0x359e('0xd')||process[_0x359e('0xc')][0x2]===_0x359e('0xe')){throw new Error(_0x359e('0xf'));}var FILEPATH=process[_0x359e('0xc')][0x2];if(!process[_0x359e('0xc')][0x3]||process[_0x359e('0xc')][0x3]===_0x359e('0xd')||process[_0x359e('0xc')][0x3]===_0x359e('0xe')||!process[_0x359e('0xc')][0x4]||process[_0x359e('0xc')][0x4]===_0x359e('0xd')||process['argv'][0x4]==='null'){throw new Error(_0x359e('0x10'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x359e('0xc')][0x5]||process[_0x359e('0xc')][0x5]===_0x359e('0xd')||process[_0x359e('0xc')][0x5]==='null'){throw new Error(_0x359e('0x11'));}var LISTID=process[_0x359e('0xc')][0x5];var COMPANYID=process[_0x359e('0xc')][0x6]&&process[_0x359e('0xc')][0x6]!==_0x359e('0xd')&&process[_0x359e('0xc')][0x6]!==_0x359e('0xe')?process[_0x359e('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x359e('0xc')][0x7]!==_0x359e('0xd')&&process[_0x359e('0xc')][0x7]!==_0x359e('0xe')?process[_0x359e('0xc')][0x7]:null;if(!process[_0x359e('0xc')][0x8]||process[_0x359e('0xc')][0x8]===_0x359e('0xd')||process['argv'][0x8]===_0x359e('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x359e('0xc')][0x8];}catch(_0x2e6fee){logger[_0x359e('0x12')](_0x2e6fee);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(_0x305ac7,_0x4abd01,_0x2c1c48,_0x6ea79f){var _0x28c4d3={'message':_0x4abd01};_0x28c4d3[_0x305ac7]=!![];if(_0x2c1c48){_0x28c4d3[_0x359e('0x13')]=_0x2c1c48;}if(_0x6ea79f){_0x28c4d3['index']=_0x6ea79f;}return _0x28c4d3;}function isEmail(_0x1cf114){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))*$/[_0x359e('0x14')](_0x1cf114);}function checkRow(_0x4800ed,_0xddd025,_0xdecc70){return new BPromise(function(_0x531485,_0x163dfe){if(_[_0x359e('0x15')](_0x4800ed)){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x16'),null,_0xdecc70));}if(_0x4800ed['errors']&&_0x4800ed['errors']['length']){var _0x4a98ee=_[_0x359e('0x17')](_0x4800ed[_0x359e('0x18')],_0x359e('0x19'))[_0x359e('0x1a')](';');return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x4a98ee,null,_0xdecc70));}var _0x471657={};for(var _0xeda530 in FIELDS){if(FIELDS[_0x359e('0x1b')](_0xeda530)&&FIELDS[_0xeda530]){_0x471657[_0xeda530]=_0x4800ed[_0x359e('0x1c')][0x0][FIELDS[_0xeda530]]||_0x4800ed[_0x359e('0x1c')][0x0]['\ufeff'+FIELDS[_0xeda530]];}}if(!_0x471657[_0x359e('0x1d')]){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x1e'),null,_0xdecc70));}if(!_0x471657[_0x359e('0x1f')]){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x20'),null,_0xdecc70));}if(_0x471657[_0x359e('0x21')]){var _0x5999c2=moment(_0x471657[_0x359e('0x21')],_0x359e('0x22'));if(!_0x5999c2[_0x359e('0x23')]()){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x24'),null,_0xdecc70));}}if(_0x471657[_0x359e('0x25')]){if(!isEmail(_0x471657['email'])){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x26'),null,_0xdecc70));}}_0x471657[_0x359e('0x27')]=LISTID;_0x471657[_0x359e('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x359e('0x29')]&&_0xddd025){var _0xc2cfb8={};for(var _0x4687ff=0x0,_0x585168=DUPLICATES[_0x359e('0x29')];_0x4687ff<_0x585168;_0x4687ff+=0x1){_0xc2cfb8[DUPLICATES[_0x4687ff]]=_0x471657[DUPLICATES[_0x4687ff]];}var _0x10cf2=_['find'](_0xddd025,_0xc2cfb8);if(_0x10cf2){return _0x163dfe(handleCheckRowError('duplicate',_0x359e('0x2a'),_0x10cf2,_0xdecc70));}}return db[_0x359e('0x2b')][_0x359e('0x2c')](_0x471657,{'raw':!![],'hooks':![],'fields':_['keys'](_0x471657)})[_0x359e('0x2d')](function(_0x3a4f5a){if(DUPLICATES&&DUPLICATES['length']&&_0xddd025){_0xddd025[_0x359e('0x2e')](_[_0x359e('0x2f')](_0x471657,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3a4f5a['id'];return _0x531485();})[_0x359e('0x30')](function(_0x211e30){return _0x163dfe(handleCheckRowError('error',_0x359e('0x31')+(_0x211e30[_0x359e('0x19')]||JSON[_0x359e('0x32')](_0x211e30)),null,_0xdecc70));});});}function checkHopper(){function _0x17684c(){return function(_0x14f80f){logger[_0x359e('0x12')](_0x359e('0x33'),_0x359e('0x34'),util[_0x359e('0x35')](_0x14f80f,{'showHidden':![],'depth':null}));};}var _0x28df5d=function(_0x316e2b,_0x11a8bc){var _0xf804bf=squel['insert']()[_0x359e('0x36')](_0x359e('0x37'))[_0x359e('0x38')]([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),'ListId',_0x11a8bc,'createdAt',_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone',_0x359e('0x1f'))['field'](_0x359e('0x3e'),_0x359e('0x39'))[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),'ListId')['field'](_0x316e2b['id'][_0x359e('0x3f')](),_0x11a8bc)[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x40'))['field']('NOW()',_0x359e('0x3b'))[_0x359e('0x41')]('cm_contacts')[_0x359e('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x359e('0x43'),LISTID['toString']())[_0x359e('0x42')](_0x359e('0x44'))[_0x359e('0x42')](_0x359e('0x45'),squel['select']()[_0x359e('0x3d')]('phone')[_0x359e('0x41')]('cm_hopper')[_0x359e('0x42')](_0x11a8bc+_0x359e('0x46'),_0x316e2b['id'][_0x359e('0x3f')]())))[_0x359e('0x3f')]();return _0xf804bf;};var _0x39f86f=function(_0x2b270d,_0x335058){var _0x3fe55c=squel['insert']()[_0x359e('0x36')](_0x359e('0x37'))['fromQuery']([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),_0x359e('0x27'),_0x335058,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone',_0x359e('0x1f'))[_0x359e('0x3d')]('NOW()','scheduledAt')[_0x359e('0x3d')]('id',_0x359e('0x3a'))['field'](LISTID['toString'](),_0x359e('0x27'))[_0x359e('0x3d')](_0x2b270d['id'][_0x359e('0x3f')](),_0x335058)['field'](_0x359e('0x3e'),_0x359e('0x40'))['field'](_0x359e('0x3e'),'updatedAt')[_0x359e('0x41')](_0x359e('0x47'))[_0x359e('0x42')](_0x359e('0x48'))[_0x359e('0x42')](_0x359e('0x43'),LISTID[_0x359e('0x3f')]())['where'](_0x359e('0x49'),squel['str'](hopperContacts))[_0x359e('0x42')](_0x359e('0x44'))['where'](_0x359e('0x45'),squel[_0x359e('0x3c')]()[_0x359e('0x3d')](_0x359e('0x4a'))['from'](_0x359e('0x4b'))[_0x359e('0x42')](_0x335058+_0x359e('0x46'),_0x2b270d['id'][_0x359e('0x3f')]()))[_0x359e('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone')[_0x359e('0x41')](_0x359e('0x37'))[_0x359e('0x42')](_0x335058+'\x20=\x20?',_0x2b270d['id'][_0x359e('0x3f')]())))[_0x359e('0x3f')]();return _0x3fe55c;};function _0x19f7db(_0xddba70,_0x415d58){var _0x15a425=squel[_0x359e('0x4c')]()[_0x359e('0x36')](_0x359e('0x37'))[_0x359e('0x38')]([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),_0x359e('0x27'),_0x415d58,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()['field']('phone',_0x359e('0x1f'))['field'](_0x359e('0x3e'),'scheduledAt')[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),'ListId')[_0x359e('0x3d')](_0xddba70['id'][_0x359e('0x3f')](),_0x415d58)[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x40'))['field'](_0x359e('0x3e'),'updatedAt')['from'](_0x359e('0x47'))['where'](_0x359e('0x48'))[_0x359e('0x42')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x359e('0x49'),squel['str'](hopperContacts))[_0x359e('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x359e('0x3f')]();return _0x15a425;}function _0x58861e(_0x21261a,_0x1ed51a){var _0x5032b5=squel['insert']()[_0x359e('0x36')](_0x359e('0x4d'))['fromQuery']([_0x359e('0x1f'),_0x359e('0x3a'),_0x359e('0x27'),_0x1ed51a,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')](_0x359e('0x1f'),_0x359e('0x1f'))[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),_0x359e('0x27'))[_0x359e('0x3d')](_0x21261a['id'][_0x359e('0x3f')](),_0x1ed51a)['field'](_0x359e('0x3e'),'createdAt')[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x3b'))['from']('cm_contacts')[_0x359e('0x42')](_0x359e('0x48'))[_0x359e('0x42')]('ListId\x20=\x20?',LISTID[_0x359e('0x3f')]())[_0x359e('0x42')](_0x359e('0x49'),squel[_0x359e('0x4e')](hopperContacts))[_0x359e('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x359e('0x3f')]();return _0x5032b5;}return db['VoiceQueue'][_0x359e('0x4f')]({'where':{'type':_0x359e('0x50')},'attributes':['id',_0x359e('0x51')],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x53'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x5df0ff){var _0x5c4fc5=[];if(_0x5df0ff){var _0x389af9;for(var _0x348a5=0x0,_0x4761ba;_0x348a5<_0x5df0ff[_0x359e('0x29')];_0x348a5+=0x1){_0x4761ba=_0x5df0ff[_0x348a5][_0x359e('0x54')]({'plain':!![]});switch(_0x4761ba[_0x359e('0x51')]){case _0x359e('0x55'):_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x39f86f(_0x4761ba,_0x359e('0x58')))['then'](function(){})['catch'](_0x17684c()));break;case _0x359e('0x59'):_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')]['query'](_0x28df5d(_0x4761ba,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;default:_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x19f7db(_0x4761ba,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}}return _0x5c4fc5;})[_0x359e('0x5a')]()[_0x359e('0x2d')](function(){return db[_0x359e('0x5b')][_0x359e('0x4f')]({'where':{'type':_0x359e('0x50')},'attributes':['id'],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x5c'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x3073b0){var _0x2646e1=[];if(_0x3073b0){var _0x475ea2;for(var _0xcbd520=0x0,_0x57a7ff;_0xcbd520<_0x3073b0[_0x359e('0x29')];_0xcbd520+=0x1){_0x57a7ff=_0x3073b0[_0xcbd520][_0x359e('0x54')]({'plain':!![]});_0x2646e1['push'](db[_0x359e('0x56')][_0x359e('0x57')](_0x58861e(_0x57a7ff,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}return _0x2646e1;})[_0x359e('0x5a')]();})[_0x359e('0x2d')](function(){return db[_0x359e('0x5d')]['findAll']({'attributes':['id',_0x359e('0x51')],'include':[{'model':db[_0x359e('0x52')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x38b033){var _0x4a3368=[];if(_0x38b033){for(var _0x5f3a02=0x0,_0x5a9228;_0x5f3a02<_0x38b033[_0x359e('0x29')];_0x5f3a02+=0x1){_0x5a9228=_0x38b033[_0x5f3a02]['get']({'plain':!![]});switch(_0x5a9228[_0x359e('0x51')]){case _0x359e('0x55'):_0x4a3368[_0x359e('0x2e')](db['sequelize'][_0x359e('0x57')](_0x39f86f(_0x5a9228,_0x359e('0x5e')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;case'onlyIfOpen':_0x4a3368[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x28df5d(_0x5a9228,'CampaignId'))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;default:_0x4a3368[_0x359e('0x2e')](db[_0x359e('0x56')]['query'](_0x19f7db(_0x5a9228,'CampaignId'))['then'](function(){})['catch'](_0x17684c()));}}}return _0x4a3368;})[_0x359e('0x5a')]();})[_0x359e('0x2d')](function(){return db['Campaign'][_0x359e('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x5c'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x1699aa){var _0x50e830=[];if(_0x1699aa){for(var _0x442423=0x0,_0x4c462b;_0x442423<_0x1699aa[_0x359e('0x29')];_0x442423+=0x1){_0x4c462b=_0x1699aa[_0x442423][_0x359e('0x54')]({'plain':!![]});_0x50e830['push'](db[_0x359e('0x56')][_0x359e('0x57')](_0x58861e(_0x4c462b,_0x359e('0x5e')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}return _0x50e830;})['all']();})[_0x359e('0x30')](function(_0x412ac0){logger[_0x359e('0x12')](_0x359e('0x5f'),'generalCheckHopper',_0x412ac0['message']);});}var processPromises=function(_0x208872){return BPromise[_0x359e('0x5a')](promises)[_0x359e('0x2d')](function(_0x5db447){})[_0x359e('0x30')](function(_0x5a2aa9){logger[_0x359e('0x12')](_0x359e('0x60'),JSON[_0x359e('0x32')](_0x5a2aa9));})[_0x359e('0x61')](function(){socket[_0x359e('0x62')](_0x359e('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x208872){return _0x208872[_0x359e('0x64')]();}});};var endCsv=function(){return BPromise[_0x359e('0x65')]()[_0x359e('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x359e('0x2d')](function(){socket['emit'](_0x359e('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x359e('0x66')](FILEPATH);}catch(_0x3aa09d){logger[_0x359e('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x3aa09d));}finally{process[_0x359e('0x67')](0x0);}});};process['on'](_0x359e('0x68'),function(){logger[_0x359e('0x69')](_0x359e('0x6a'));endCsv();});function main(){return BPromise[_0x359e('0x65')]()[_0x359e('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x359e('0x6b')](',');return db[_0x359e('0x2b')][_0x359e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x359e('0x2d')](function(_0x5332af){var _0x177461=fs[_0x359e('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x359e('0x6d')](_0x177461,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d1139,_0x384ced){total+=0x1;var _0x34ec76=total;promises[_0x359e('0x2e')](checkRow(_0x5d1139,_0x5332af,_0x34ec76)[_0x359e('0x2d')](function(){success+=0x1;})[_0x359e('0x30')](function(_0x44bf53){if(_0x44bf53[_0x359e('0x12')]){errors+=0x1;delete _0x44bf53[_0x359e('0x12')];}else if(_0x44bf53['duplicate']){duplicates+=0x1;delete _0x44bf53['duplicate'];}rows[_0x359e('0x2e')](_0x44bf53);}));if(total%0xc8===0x0){_0x384ced[_0x359e('0x6e')]();return processPromises(_0x384ced);}},'complete':function(){return processPromises()['then'](function(){logger[_0x359e('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3c116d,_0x21de36){logger[_0x359e('0x69')]('CSV\x20parse\x20error',JSON[_0x359e('0x32')](_0x3c116d));endCsv();}});})[_0x359e('0x30')](function(_0x3813c8){logger[_0x359e('0x12')](_0x359e('0x6f'),JSON[_0x359e('0x32')](_0x3813c8));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d3f249c..e8d2f67 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 _0x9256=['ContactId','UserId','\x22onlyIfOpen\x22','cm_hopper_black','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','code','message','sequelize','query','spread','catch','error','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','timezones','dialTimezone','set','offset','main','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','parse','data','rows','find','isNil','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','contact:import:','step','duplicates','cm_contacts_','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','update','updated','create','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ListId','createdAt','updatedAt','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','toString','.offset-cm_contacts.utcOffset\x20minute)'];(function(_0x369f24,_0x5d08ee){var _0x5c0683=function(_0x23b802){while(--_0x23b802){_0x369f24['push'](_0x369f24['shift']());}};_0x5c0683(++_0x5d08ee);}(_0x9256,0x128));var _0x6925=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9256[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x6925('0x0'));var _=require(_0x6925('0x1'));var Papa=require(_0x6925('0x2'));var util=require(_0x6925('0x3'));var BPromise=require(_0x6925('0x4'));var moment=require(_0x6925('0x5'));var squel=require(_0x6925('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x6925('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x6925('0x8'))(_0x6925('0x9'));config[_0x6925('0xa')]=_[_0x6925('0xb')](config[_0x6925('0xa')],{'host':_0x6925('0xc'),'port':0x18eb});var socket=require(_0x6925('0xd'))(new Redis(config[_0x6925('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6925('0xe')](_0x6925('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x6925('0xe')](_0x6925('0xf'));function isEmail(_0x21ec73){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))*$/[_0x6925('0x10')](_0x21ec73);}function selectNotIn(_0x2097a8,_0x24d17e,_0x48a0f7,_0x1ef249,_0x107f4d){return squel[_0x6925('0x11')]()[_0x6925('0x12')]('phone')[_0x6925('0x13')](_0x1ef249)[_0x6925('0x14')](_0x24d17e,null,_0x24d17e+_0x6925('0x15')+_0x1ef249+'.'+_0x48a0f7)[_0x6925('0x16')](_0x1ef249+'.'+_0x48a0f7+_0x6925('0x17')+_0x2097a8+'.'+_0x48a0f7)[_0x6925('0x16')](_0x24d17e+_0x6925('0x18')+_0x107f4d[_0x6925('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1917b4,_0x158256){promisesAdditionalPhones=[];return db['CmContact'][_0x6925('0x19')]({'raw':!![],'attributes':['id',_0x6925('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6925('0x1b')](function(_0x2053fb){if(_0x2053fb!==null){var _0x3a1246=[];for(var _0x47fb3b=0x0;_0x47fb3b<_0x2053fb[_0x6925('0x1c')];_0x47fb3b++){var _0x46d3cd=_0x2053fb[_0x47fb3b];_0x3a1246[_0x6925('0x1d')](insertAdditionalPhones(_0x46d3cd));}}Promise['all'](_0x3a1246)[_0x6925('0x1b')](function(){_0x1917b4({'val':0x1});});});});}function insertAdditionalPhones(_0x2dea97){return new Promise(function(_0x243663,_0x2f0620){var _0x2845c5=_0x2dea97[_0x6925('0x1a')];var _0x19109b=_0x2845c5['split'](';');var _0x2d58ec=[];orderBy=0x0;for(var _0x3a0c49=0x0;_0x3a0c49<_0x19109b[_0x6925('0x1c')];_0x3a0c49++){_0x2d58ec['push'](splitAdditionalPhone(_0x2dea97['id'],_0x19109b[_0x3a0c49]));}Promise[_0x6925('0x1e')](_0x2d58ec)[_0x6925('0x1b')](function(){_0x243663({'val':_0x19109b[_0x6925('0x1c')]});});});}function splitAdditionalPhone(_0x25c49b,_0xdc7d8){return new Promise(function(_0x3d26d3,_0x2c3c5e){var _0x284b2b=_0xdc7d8[_0x6925('0x1f')](':');var _0xe90668=_0x284b2b[0x0];var _0x51f379=_0x284b2b[0x1];if(!_['isNil'](_0x51f379)){var _0x25a4c7=_0x51f379[_0x6925('0x1f')]('|');var _0x28399c=[];for(var _0x548d62=0x0;_0x548d62<_0x25a4c7[_0x6925('0x1c')];_0x548d62++){if(_0x25a4c7[_0x548d62]!==''){var _0x1178e1=_[_0x6925('0x20')](promisesAdditionalPhones,{'contactId':_0x25c49b,'phone':_0x25a4c7[_0x548d62]});if(_0x1178e1['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x25c49b,'contactTypeId':_0xe90668,'phone':_0x25a4c7[_0x548d62],'orderBy':orderBy});}}}_0x3d26d3({'ok':0x1});}else _0x3d26d3({'res':0x0});});}function createAdditionalPhone(_0x5cccdc,_0x336512,_0x348ee6,_0xa169ac){var _0x19376a='';var _0x575575='';var _0x4ed3b0=_0x348ee6['split']('§');_0x19376a=_0x4ed3b0[0x0];if(_0x4ed3b0[_0x6925('0x1c')]==0x2)_0x575575=_0x4ed3b0[0x1];return new Promise(function(_0x3388f3,_0x1187f8){return db[_0x6925('0x21')]['findOne']({'where':{'CmContactId':_0x5cccdc,'item':_0x19376a}})[_0x6925('0x1b')](function(_0x326900){if(_0x326900){return db[_0x6925('0x21')][_0x6925('0x22')]({'ItemTypeId':_0x336512,'description':_0x575575,'OrderBy':_0xa169ac},{'where':{'CmContactId':_0x5cccdc,'item':_0x19376a}})[_0x6925('0x1b')](function(_0x4933be){_0x3388f3({'res':_0x6925('0x23')});});}else{return db[_0x6925('0x21')][_0x6925('0x24')]({'CmContactId':_0x5cccdc,'item':_0x19376a,'description':_0x575575,'ItemTypeId':_0x336512,'OrderBy':_0xa169ac,'ItemClass':'PHONE'})[_0x6925('0x1b')](function(_0x145e33){_0x3388f3({'res':'inserted'});});}});});}function insertCmHopper(_0xc36d7c,_0x22a067,_0x5c6bd1,_0x24831b,_0x751313){var _0x45b7f1=[_0x6925('0x25'),_0x6925('0x26'),_0x6925('0x27'),_0x6925('0x28'),_0x22a067+'.'+_0x24831b,_0x6925('0x29'),_0x6925('0x2a'),_0x6925('0x2b'),_0x6925('0x2c'),'\x22'+_0x751313+'\x22'];return squel[_0x6925('0x2d')]()[_0x6925('0x2e')](_0x6925('0x2f'))[_0x6925('0x30')]([_0x6925('0x31'),_0x6925('0x32'),'ContactId',_0x6925('0x33'),_0x24831b,_0x6925('0x34'),_0x6925('0x35'),'priority','UserId',_0x6925('0x36')],squel[_0x6925('0x11')]()[_0x6925('0x37')](_0x45b7f1)[_0x6925('0x13')](_0x22a067)['join'](_0x6925('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x22a067+_0x6925('0x39'))[_0x6925('0x14')](_0x5c6bd1,null,_0x5c6bd1+_0x6925('0x15')+_0x22a067+'.'+_0x24831b)[_0x6925('0x16')](_0x22a067+_0x6925('0x3a'),_0xc36d7c)[_0x6925('0x16')](_0x6925('0x3b'),NOW)[_0x6925('0x16')](_0x6925('0x3c'),selectNotIn(_0x22a067,_0x5c6bd1,_0x24831b,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x6925('0x16')](_0x6925('0x3c'),selectNotIn(_0x22a067,_0x5c6bd1,_0x24831b,_0x6925('0x2f'),[_0x6925('0x3d')])))['toString']();}function insertCmHopperBlack(_0x287d6f,_0x3aa4fd,_0x1040f6,_0x258c32){var _0x5c743c=[_0x6925('0x25'),_0x6925('0x27'),'cm_contacts.ListId',_0x3aa4fd+'.'+_0x258c32,_0x6925('0x29'),_0x6925('0x2a')];return squel[_0x6925('0x2d')]()[_0x6925('0x2e')]('cm_hopper_black')[_0x6925('0x30')](['phone','ContactId',_0x6925('0x33'),_0x258c32,_0x6925('0x34'),_0x6925('0x35')],squel[_0x6925('0x11')]()['fields'](_0x5c743c)[_0x6925('0x13')](_0x3aa4fd)[_0x6925('0x14')](_0x6925('0x38'),null,_0x6925('0x3e')+_0x3aa4fd+_0x6925('0x39'))[_0x6925('0x14')](_0x1040f6,null,_0x1040f6+_0x6925('0x15')+_0x3aa4fd+'.'+_0x258c32)[_0x6925('0x16')](_0x3aa4fd+_0x6925('0x3a'),_0x287d6f)['where'](_0x6925('0x3b'),NOW)[_0x6925('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6925('0x11')]()[_0x6925('0x12')](_0x6925('0x31'))[_0x6925('0x13')]('cm_hopper_black')['where'](_0x6925('0x3f'),_0x287d6f)[_0x6925('0x16')](_0x258c32+'\x20=\x20'+_0x3aa4fd+'.'+_0x258c32)))[_0x6925('0x40')]();}function insertTzCmHopper(_0x47a656,_0x238362,_0x448556,_0x47b49f,_0x4ccf26,_0x4ff6db){var _0x4155b1=[_0x6925('0x25'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x4ff6db+_0x6925('0x41'),_0x6925('0x27'),_0x6925('0x28'),_0x238362+'.'+_0x47b49f,_0x6925('0x29'),_0x6925('0x2a'),_0x6925('0x2b'),'cm_contacts.UserId','\x22'+_0x4ccf26+'\x22'];var _0x1b90c8=squel[_0x6925('0x2d')]()[_0x6925('0x2e')](_0x6925('0x2f'))['fromQuery'](['phone',_0x6925('0x32'),_0x6925('0x42'),_0x6925('0x33'),_0x47b49f,_0x6925('0x34'),_0x6925('0x35'),'priority',_0x6925('0x43'),_0x6925('0x36')],squel['select']()[_0x6925('0x37')](_0x4155b1)[_0x6925('0x13')](_0x238362)['join']('cm_contacts',null,_0x6925('0x3e')+_0x238362+_0x6925('0x39'))[_0x6925('0x14')](_0x448556,null,_0x448556+'.id\x20=\x20'+_0x238362+'.'+_0x47b49f)[_0x6925('0x14')](_0x4ff6db,null,_0x4ff6db+'.id\x20=\x20'+_0x238362+'.'+_0x47b49f)[_0x6925('0x16')](_0x238362+_0x6925('0x3a'),_0x47a656)[_0x6925('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x238362,_0x448556,_0x47b49f,_0x6925('0x2f'),['\x22always\x22',_0x6925('0x44')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x238362,_0x448556,_0x47b49f,_0x6925('0x2f'),[_0x6925('0x3d')])))['toString']();return _0x1b90c8;}function insertTzCmHopperBlack(_0x345fdd,_0x453e30,_0x313f44,_0x284803){var _0x1dc57c=['cm_contacts.phone','cm_contacts.id',_0x6925('0x28'),_0x453e30+'.'+_0x284803,_0x6925('0x29'),_0x6925('0x2a')];return squel[_0x6925('0x2d')]()['into'](_0x6925('0x45'))[_0x6925('0x30')]([_0x6925('0x31'),'ContactId',_0x6925('0x33'),_0x284803,_0x6925('0x34'),'updatedAt'],squel[_0x6925('0x11')]()[_0x6925('0x37')](_0x1dc57c)[_0x6925('0x13')](_0x453e30)[_0x6925('0x14')]('cm_contacts',null,_0x6925('0x3e')+_0x453e30+_0x6925('0x39'))[_0x6925('0x14')](_0x313f44,null,_0x313f44+'.id\x20=\x20'+_0x453e30+'.'+_0x284803)[_0x6925('0x16')](_0x453e30+_0x6925('0x3a'),_0x345fdd)[_0x6925('0x16')](_0x6925('0x3b'),NOW)[_0x6925('0x16')](_0x6925('0x3c'),squel[_0x6925('0x11')]()[_0x6925('0x12')](_0x6925('0x31'))[_0x6925('0x13')](_0x6925('0x45'))[_0x6925('0x16')](_0x6925('0x3f'),_0x345fdd)['where'](_0x284803+_0x6925('0x17')+_0x453e30+'.'+_0x284803)))['toString']();}function insertCmHopperAdditionalPhones(_0x265ac2){var _0x43f40f=['cm_hopper.id',_0x6925('0x46'),_0x6925('0x47'),_0x6925('0x48'),_0x6925('0x49')];return squel[_0x6925('0x2d')]()[_0x6925('0x2e')](_0x6925('0x4a'))[_0x6925('0x30')]([_0x6925('0x4b'),'phone','OrderBy',_0x6925('0x34'),_0x6925('0x35')],squel['select']()[_0x6925('0x37')](_0x43f40f)[_0x6925('0x13')](_0x6925('0x2f'))['join'](_0x6925('0x38'),null,_0x6925('0x4c'))[_0x6925('0x14')](_0x6925('0x4d'),null,_0x6925('0x4e'))['where'](_0x6925('0x4f'),_0x265ac2)[_0x6925('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x6925('0x40')]();}function insertCmContact(_0x2f44af,_0x399b18,_0x1e1ab9,_0x57950d){var _0x2cd309=_['concat'](_[_0x6925('0x50')](_0x57950d),['ListId',_0x6925('0x51'),_0x6925('0x34'),_0x6925('0x35')]);return squel[_0x6925('0x2d')]()[_0x6925('0x2e')](_0x6925('0x38'))['fromQuery'](_0x2cd309,squel[_0x6925('0x11')]()[_0x6925('0x37')](_0x2cd309)[_0x6925('0x13')](_0x399b18)[_0x6925('0x16')]('('+_0x1e1ab9[_0x6925('0x14')](',')+_0x6925('0x52'),squel[_0x6925('0x11')]()[_0x6925('0x37')](_0x1e1ab9)[_0x6925('0x13')]('cm_contacts')[_0x6925('0x16')](_0x6925('0x3f'),_0x2f44af)[_0x6925('0x16')](_0x6925('0x53')))[_0x6925('0x16')](_0x6925('0x54'),squel['select']()[_0x6925('0x12')](_0x6925('0x55'),_0x6925('0x56'))['from'](_0x399b18)[_0x6925('0x57')](_0x1e1ab9['join'](','))))[_0x6925('0x40')]();}function handleStop(){logger[_0x6925('0x58')](_0x6925('0x59'));stopped=!![];}function handleUncaughtException(_0x454ded){logger['error'](_0x454ded['message']);process[_0x6925('0x5a')](0x1);}function handleError(_0xbf5d3a,_0x51848d){stats[_0x6925('0x5b')][_0x6925('0x1d')]({'name':_0x51848d[_0x6925('0x5c')],'message':_0x51848d[_0x6925('0x5d')],'row':_0xbf5d3a});}function handleQuery(_0x183363){logger[_0x6925('0x58')](_0x183363);return db[_0x6925('0x5e')][_0x6925('0x5f')](_0x183363)[_0x6925('0x60')](function(_0x4ce92a){results[_0x6925('0x1d')](_0x4ce92a);})[_0x6925('0x61')](function(_0x346b50){logger[_0x6925('0x62')](_0x346b50[_0x6925('0x5d')]);});}function updateTzCampaigns(_0x3bc309){return new Promise(function(_0x37aaef,_0x507ffc){var _0x5e4a56=squel['select']()[_0x6925('0x37')](['campaigns.id',_0x6925('0x63')])[_0x6925('0x13')]('campaigns')['join'](_0x6925('0x64'),null,_0x6925('0x65'))[_0x6925('0x16')](_0x6925('0x66')+_0x3bc309);db[_0x6925('0x5e')]['query'](_0x5e4a56[_0x6925('0x40')]())[_0x6925('0x60')](function(_0x56c80d){var _0x30a518=[];for(var _0x45795b=0x0;_0x45795b<_0x56c80d[_0x6925('0x1c')];_0x45795b++){_0x30a518[_0x6925('0x1d')](getTimezoneData(_0x56c80d[_0x45795b],tmp_campaigns));}BPromise['all'](_0x30a518)[_0x6925('0x1b')](function(){_0x37aaef({'val':0x1});});})[_0x6925('0x61')](function(_0xa1d6d7){logger[_0x6925('0x62')](_0xa1d6d7[_0x6925('0x5d')]);_0x37aaef({'val':0x0});});});}function updateTzVoiceQueues(_0x5b6a0d){return new Promise(function(_0xf8778e,_0x510332){var _0x39f44a=squel[_0x6925('0x11')]()['fields'](['voice_queues.id',_0x6925('0x67')])[_0x6925('0x13')](_0x6925('0x68'))['join'](_0x6925('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x6925('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x5b6a0d);db[_0x6925('0x5e')]['query'](_0x39f44a[_0x6925('0x40')]())['spread'](function(_0x28bbb1){var _0x27aaaf=[];for(var _0x5e6612=0x0;_0x5e6612<_0x28bbb1[_0x6925('0x1c')];_0x5e6612++){_0x27aaaf[_0x6925('0x1d')](getTimezoneData(_0x28bbb1[_0x5e6612],tmp_voice_queues));}BPromise[_0x6925('0x1e')](_0x27aaaf)['then'](function(){_0xf8778e({'val':0x1});});})[_0x6925('0x61')](function(_0x588ccc){logger[_0x6925('0x62')](_0x588ccc[_0x6925('0x5d')]);_0xf8778e({'val':0x0});});});}function getTimezoneData(_0x1e33da,_0x47dee0){return new Promise(function(_0x13b2a3,_0x564a42){var _0x126f23=shared[_0x6925('0x6a')];var _0x52cf88=_0x126f23[_0x1e33da[_0x6925('0x6b')]];if(_['isNil'](_0x52cf88)){_0x13b2a3({'ret':0x1});}else{var _0x1905e1=_0x52cf88['utcOffset'];var _0x20e0e5=squel['insert']()[_0x6925('0x2e')](_0x47dee0)['set']('id',_0x1e33da['id'])[_0x6925('0x6c')](_0x6925('0x6d'),_0x1905e1)['set']('dialTimezone',_0x1e33da['dialTimezone'])[_0x6925('0x40')]();return db[_0x6925('0x5e')][_0x6925('0x5f')](_0x20e0e5)[_0x6925('0x60')](function(_0x43523c){_0x13b2a3({'ret':0x1});})['catch'](function(_0x236a22){logger[_0x6925('0x62')](_0x236a22[_0x6925('0x5d')]);_0x564a42({'ret':0x1});});}});}function handleTZQuery(_0x23b1a6){logger[_0x6925('0x58')](_0x23b1a6);return db[_0x6925('0x5e')][_0x6925('0x5f')](_0x23b1a6)[_0x6925('0x60')](function(_0x1b703f){})['catch'](function(_0x4251cb){logger[_0x6925('0x62')](_0x4251cb[_0x6925('0x5d')]);});}function main(_0x135dd8,_0x5d9f0d,_0x454dfc,_0x15787e){logger['info'](_0x6925('0x6e'),_0x135dd8,JSON['stringify'](_0x5d9f0d));process[_0x6925('0x6f')](_0x6925('0x70'));var _0x535a16=_0x5d9f0d['binding'];var _0x5ce5ac=_[_0x6925('0x71')](_0x535a16);var _0x110f77=_0x5d9f0d[_0x6925('0x72')];var _0x42adfb=path[_0x6925('0x14')](config[_0x6925('0x73')],_0x6925('0x74'),_0x110f77+_0x6925('0x75'));hasTZ=_[_0x6925('0x50')](_0x535a16)[_0x6925('0x76')]('dialTimezone');var _0x40ac3f=_['keys'](_0x535a16)['join']();logger[_0x6925('0x58')](_0x6925('0x77'),_0x40ac3f);db[_0x6925('0x78')][_0x6925('0x19')]({'raw':!![],'attributes':['id','name']})[_0x6925('0x1b')](function(_0x2d5a75){for(var _0x2ad284=0x0;_0x2ad284<_0x2d5a75['length'];_0x2ad284++){if(_0x2d5a75[_0x2ad284][_0x6925('0x79')]in _0x535a16){contactItemTypes[_0x6925('0x1d')](_0x2d5a75[_0x2ad284]);delete _0x5ce5ac[_0x2d5a75[_0x2ad284][_0x6925('0x79')]];hasAdditionalPhones=!![];}for(var _0x184fba in _0x535a16){if(_0x2d5a75[_0x2ad284][_0x6925('0x79')]+_0x6925('0x7a')===_0x184fba){phoneDescriptions['push']({'itemTypeId':_0x2d5a75[_0x2ad284]['id'],'description':_0x184fba});delete _0x5ce5ac[_0x184fba];}}}if(hasAdditionalPhones)_0x5ce5ac[_0x6925('0x1a')]='';var _0x16111d=_['keys'](_0x5ce5ac)['join']();logger[_0x6925('0x58')](_0x6925('0x77'),_0x16111d);fs['writeFileSync'](_0x42adfb,_0x16111d+'\x0a');Papa[_0x6925('0x7b')](fs['createReadStream'](_0x135dd8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5495eb,_0x31d526){try{for(var _0x554001=0x0,_0x5a37c8=[];_0x554001<_0x5495eb[_0x6925('0x7c')]['length'];_0x554001++){stats[_0x6925('0x7d')]+=0x1;if(_0x5495eb['errors'][_0x554001]){handleError(_0x5495eb[_0x6925('0x7c')][_0x554001],_0x5495eb[_0x6925('0x5b')][_0x554001]);}else{var _0xdd2938=[];var _0x1464f6=[];var _0x31c48e={};for(var _0x3273de in _0x535a16){let _0x16ec15=contactItemTypes[_0x6925('0x7e')](_0x13a6f5=>_0x13a6f5[_0x6925('0x79')]===_0x3273de);let _0x34e368=contactItemTypes['find'](_0x481d4d=>_0x481d4d['name']+'_description'===_0x3273de);if(_[_0x6925('0x7f')](_0x16ec15)&&_[_0x6925('0x7f')](_0x34e368)){if(_0x535a16[_0x6925('0x80')](_0x3273de)){if(_0x5495eb[_0x6925('0x7c')][_0x554001][_0x535a16[_0x3273de]]){var _0x292ba8=_[_0x6925('0x81')](_0x5495eb[_0x6925('0x7c')][_0x554001][_0x535a16[_0x3273de]][_0x6925('0x82')](/"/g,'\x27'));switch(_0x3273de){case'scheduledat':var _0x1b2e25=moment(_0x292ba8,_0x6925('0xf'),!![]);if(_0x1b2e25[_0x6925('0x83')]()){_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x292ba8+'\x22');}else{_0xdd2938[_0x6925('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x4d886f=parseInt(_0x292ba8);_0x292ba8=_[_0x6925('0x84')](_0x4d886f)||_0x4d886f<0x0||_0x4d886f>0x4?_0x15787e?0x3:0x2:_0x4d886f;_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x292ba8+'\x22');break;case _0x6925('0x43'):var _0x30c639=parseInt(_0x292ba8);if(_[_0x6925('0x85')](_0x30c639)&&_[_0x6925('0x76')](_0x454dfc,_0x30c639)){_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x30c639+'\x22');}else{_0xdd2938[_0x6925('0x1d')](_0x6925('0x86'));}break;case _0x6925('0x87'):if(isEmail(_0x292ba8)){_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x292ba8+'\x22');}else{_0xdd2938[_0x6925('0x1d')](_0x6925('0x88'));}break;case _0x6925('0x89'):var _0x4ae477=moment(_0x292ba8,_0x6925('0x8a'),!![]);if(_0x4ae477[_0x6925('0x83')]()){_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x292ba8+'\x22');}else{_0xdd2938[_0x6925('0x1d')](_0x6925('0x8b'));}break;case _0x6925('0x6b'):var _0x58f0d5=shared[_0x6925('0x6a')];var _0x5bfa2=_0x58f0d5[_0x292ba8];if(!_[_0x6925('0x7f')](_0x5bfa2)){var _0x5091a6=_0x5bfa2[_0x6925('0x8c')];_0x5a37c8['push']('\x22'+_0x292ba8+'\x22');_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x5091a6+'\x22');}break;default:_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x292ba8+'\x22');}}else{switch(_0x3273de){case _0x6925('0x8d'):case _0x6925('0x31'):_0xdd2938[_0x6925('0x1d')](_0x3273de+_0x6925('0x8e'));break;default:_0x5a37c8[_0x6925('0x1d')]('\x22\x22');}}}}else{var _0x2f0e28='';if(!_[_0x6925('0x7f')](_0x16ec15)){if(!_0x31c48e[_0x6925('0x80')](_0x16ec15['id'])){if(!_['isNil'](_0x5495eb[_0x6925('0x7c')][_0x554001][_0x535a16[_0x3273de]])){var _0x292ba8=_['trim'](_0x5495eb[_0x6925('0x7c')][_0x554001][_0x535a16[_0x3273de]]['replace'](/"/g,'\x27'));var _0x298501=phoneDescriptions[_0x6925('0x7e')](_0x18ecf2=>_0x18ecf2['itemTypeId']===_0x16ec15['id']);if(!_['isNil'](_0x298501)){var _0x338261=_[_0x6925('0x81')](_0x5495eb[_0x6925('0x7c')][_0x554001][_0x535a16[_0x298501[_0x6925('0x8f')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x338261))_0x292ba8=_0x292ba8+'§'+_0x338261;}if(_0x2f0e28=='')_0x2f0e28=_0x292ba8;else _0x2f0e28+='|'+_0x292ba8;}_0x1464f6[_0x6925('0x1d')](_0x16ec15['id']+':'+_0x2f0e28);_0x31c48e[_0x16ec15['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5a37c8[_0x6925('0x1d')]('\x22'+_0x1464f6[_0x6925('0x14')](';')+'\x22');}if(_0xdd2938[_0x6925('0x1c')]){handleError(_0x5495eb['data'][_0x554001],{'code':_0x6925('0x90'),'message':_0xdd2938[_0x6925('0x14')]()});}else{fs[_0x6925('0x91')](_0x42adfb,_0x5a37c8[_0x6925('0x14')]()+'\x0a');}_0x5a37c8=[];}if(!(stats[_0x6925('0x7d')]%0xc8)){socket[_0x6925('0x92')](_0x6925('0x93')+_0x110f77,stats);stats[_0x6925('0x5b')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x31d526['abort']();}}catch(_0x1a71ff){handleError(_0x5495eb[_0x6925('0x7c')][_0x554001],{'code':'SystemError','message':_0x1a71ff[_0x6925('0x5d')]});logger[_0x6925('0x62')](_0x6925('0x94'),_0x1a71ff['message']);}},'complete':function(){try{var _0x2a4f6e=[];var _0x14ac1f=[];var _0x3abcdd=_0x6925('0x38');if(_0x5d9f0d[_0x6925('0x95')]&&_0x5d9f0d[_0x6925('0x95')][_0x6925('0x1c')]){_0x3abcdd=_0x6925('0x96')+_0x110f77;_0x2a4f6e[_0x6925('0x1d')]('CREATE\x20TABLE\x20'+_0x3abcdd+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x6925('0x97')+_0x110f77;tmp_voice_queues=_0x6925('0x98')+_0x110f77;_0x14ac1f[_0x6925('0x1d')](_0x6925('0x99')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x14ac1f[_0x6925('0x1d')](_0x6925('0x99')+tmp_voice_queues+_0x6925('0x9a'));BPromise[_0x6925('0x9b')](_0x14ac1f,handleTZQuery)[_0x6925('0x1b')](function(_0x2216e5){updateTzCampaigns(_0x5d9f0d[_0x6925('0x33')])[_0x6925('0x1b')](function(_0x47a753){updateTzVoiceQueues(_0x5d9f0d[_0x6925('0x33')])[_0x6925('0x1b')](function(_0x49cafd){if(hasTZ)_0x16111d=_0x16111d['replace']('dialTimezone','dialTimezone,utcOffset');var _0x3eda38=util[_0x6925('0xe')]('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',_0x42adfb,_0x3abcdd,_0x16111d,_0x5d9f0d[_0x6925('0x33')],_0x5d9f0d[_0x6925('0x51')]||null,NOW,NOW);if(_['isNil'](_0x535a16['scheduledat'])){_0x3eda38+=_0x6925('0x9c');}_0x2a4f6e[_0x6925('0x1d')](_0x3eda38);if(_0x5d9f0d['duplicates']&&_0x5d9f0d[_0x6925('0x95')]['length']){_0x2a4f6e[_0x6925('0x1d')](insertCmContact(_0x5d9f0d['ListId'],_0x3abcdd,_0x5d9f0d[_0x6925('0x95')],_0x535a16));_0x2a4f6e[_0x6925('0x1d')](_0x6925('0x9d')+_0x3abcdd+';');}BPromise['each'](_0x2a4f6e,handleQuery)['then'](function(_0x3bea8f){BPromise[_0x6925('0x1e')]([handleAdditionalPhones()])[_0x6925('0x1b')](function(){_0x2a4f6e=[];for(var _0x1f8fb4=0x0;_0x1f8fb4\x20\x20'];(function(_0x284e08,_0x1af14e){var _0x1203c5=function(_0x10abe1){while(--_0x10abe1){_0x284e08['push'](_0x284e08['shift']());}};_0x1203c5(++_0x1af14e);}(_0x2b24,0x176));var _0x42b2=function(_0x168761,_0x3371a8){_0x168761=_0x168761-0x0;var _0x1463e8=_0x2b24[_0x168761];return _0x1463e8;};'use strict';var fs=require('fs');var path=require(_0x42b2('0x0'));var _=require(_0x42b2('0x1'));var Papa=require(_0x42b2('0x2'));var util=require(_0x42b2('0x3'));var BPromise=require(_0x42b2('0x4'));var moment=require(_0x42b2('0x5'));var squel=require(_0x42b2('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x42b2('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x42b2('0x8'))(_0x42b2('0x9'));config[_0x42b2('0xa')]=_[_0x42b2('0xb')](config[_0x42b2('0xa')],{'host':_0x42b2('0xc'),'port':0x18eb});var socket=require(_0x42b2('0xd'))(new Redis(config[_0x42b2('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x42b2('0xe')](_0x42b2('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x42b2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x4228d7){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))*$/[_0x42b2('0x10')](_0x4228d7);}function selectNotIn(_0x2dab9c,_0x24e7e,_0x29c7c7,_0x18ef81,_0xd16e74){return squel[_0x42b2('0x11')]()[_0x42b2('0x12')]('phone')[_0x42b2('0x13')](_0x18ef81)[_0x42b2('0x14')](_0x24e7e,null,_0x24e7e+_0x42b2('0x15')+_0x18ef81+'.'+_0x29c7c7)['where'](_0x18ef81+'.'+_0x29c7c7+_0x42b2('0x16')+_0x2dab9c+'.'+_0x29c7c7)['where'](_0x24e7e+'.dialCheckDuplicateType\x20IN\x20('+_0xd16e74[_0x42b2('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34c958,_0x154dc0){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x42b2('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x42b2('0x18')](function(_0x3a4e84){if(_0x3a4e84!==null){var _0x12b0f5=[];for(var _0x3e85e9=0x0;_0x3e85e9<_0x3a4e84[_0x42b2('0x19')];_0x3e85e9++){var _0xebf683=_0x3a4e84[_0x3e85e9];_0x12b0f5[_0x42b2('0x1a')](insertAdditionalPhones(_0xebf683));}}Promise[_0x42b2('0x1b')](_0x12b0f5)['then'](function(){_0x34c958({'val':0x1});});});});}function insertAdditionalPhones(_0x8cb53b){return new Promise(function(_0x3e2f14,_0x4f9b4b){var _0x30db0a=_0x8cb53b[_0x42b2('0x17')];var _0x17b1d3=_0x30db0a[_0x42b2('0x1c')](';');var _0x5e7bd5=[];orderBy=0x0;for(var _0x3aa57f=0x0;_0x3aa57f<_0x17b1d3[_0x42b2('0x19')];_0x3aa57f++){_0x5e7bd5[_0x42b2('0x1a')](splitAdditionalPhone(_0x8cb53b['id'],_0x17b1d3[_0x3aa57f]));}Promise['all'](_0x5e7bd5)[_0x42b2('0x18')](function(){_0x3e2f14({'val':_0x17b1d3[_0x42b2('0x19')]});});});}function splitAdditionalPhone(_0x496907,_0x26a1a3){return new Promise(function(_0xd4fc60,_0x2008b9){var _0x5a1484=_0x26a1a3[_0x42b2('0x1c')](':');var _0x57a6dc=_0x5a1484[0x0];var _0x168a3c=_0x5a1484[0x1];if(!_['isNil'](_0x168a3c)){var _0x177783=_0x168a3c[_0x42b2('0x1c')]('|');var _0x486b92=[];for(var _0x45a362=0x0;_0x45a362<_0x177783[_0x42b2('0x19')];_0x45a362++){if(_0x177783[_0x45a362]!==''){var _0x5dfba1=_[_0x42b2('0x1d')](promisesAdditionalPhones,{'contactId':_0x496907,'phone':_0x177783[_0x45a362]});if(_0x5dfba1[_0x42b2('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x42b2('0x1a')]({'contactId':_0x496907,'contactTypeId':_0x57a6dc,'phone':_0x177783[_0x45a362],'orderBy':orderBy});}}}_0xd4fc60({'ok':0x1});}else _0xd4fc60({'res':0x0});});}function createAdditionalPhone(_0x4e2b51,_0x452e73,_0x1a9061,_0x91faca){var _0x244465='';var _0x5e324b='';var _0x1e182b=_0x1a9061[_0x42b2('0x1c')]('§');_0x244465=_0x1e182b[0x0];if(_0x1e182b[_0x42b2('0x19')]==0x2)_0x5e324b=_0x1e182b[0x1];return new Promise(function(_0x3e4dd9,_0x28d146){return db[_0x42b2('0x1e')]['findOne']({'where':{'CmContactId':_0x4e2b51,'item':_0x244465}})[_0x42b2('0x18')](function(_0x4ecd51){if(_0x4ecd51){return db[_0x42b2('0x1e')][_0x42b2('0x1f')]({'ItemTypeId':_0x452e73,'description':_0x5e324b,'OrderBy':_0x91faca},{'where':{'CmContactId':_0x4e2b51,'item':_0x244465}})[_0x42b2('0x18')](function(_0x51f6ec){_0x3e4dd9({'res':_0x42b2('0x20')});});}else{return db[_0x42b2('0x1e')]['create']({'CmContactId':_0x4e2b51,'item':_0x244465,'description':_0x5e324b,'ItemTypeId':_0x452e73,'OrderBy':_0x91faca,'ItemClass':'PHONE'})[_0x42b2('0x18')](function(_0x104adc){_0x3e4dd9({'res':_0x42b2('0x21')});});}});});}function insertCmHopper(_0x2f208a,_0xec1fd9,_0x671cd4,_0x5e15d2,_0x446d1a){var _0x29152a=[_0x42b2('0x22'),_0x42b2('0x23'),_0x42b2('0x24'),_0x42b2('0x25'),_0xec1fd9+'.'+_0x5e15d2,_0x42b2('0x26'),_0x42b2('0x27'),_0x42b2('0x28'),_0x42b2('0x29'),'\x22'+_0x446d1a+'\x22'];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x2c'))['fromQuery']([_0x42b2('0x2d'),_0x42b2('0x2e'),'ContactId',_0x42b2('0x2f'),_0x5e15d2,_0x42b2('0x30'),_0x42b2('0x31'),_0x42b2('0x32'),_0x42b2('0x33'),'recallme'],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x29152a)['from'](_0xec1fd9)[_0x42b2('0x14')](_0x42b2('0x35'),null,_0x42b2('0x36')+_0xec1fd9+'.CmListId')[_0x42b2('0x14')](_0x671cd4,null,_0x671cd4+_0x42b2('0x15')+_0xec1fd9+'.'+_0x5e15d2)['where'](_0xec1fd9+_0x42b2('0x37'),_0x2f208a)[_0x42b2('0x38')](_0x42b2('0x39'),NOW)['where'](_0x42b2('0x3a'),selectNotIn(_0xec1fd9,_0x671cd4,_0x5e15d2,_0x42b2('0x2c'),[_0x42b2('0x3b'),_0x42b2('0x3c')]))['where'](_0x42b2('0x3a'),selectNotIn(_0xec1fd9,_0x671cd4,_0x5e15d2,_0x42b2('0x2c'),['\x22always\x22'])))[_0x42b2('0x3d')]();}function insertCmHopperBlack(_0x523cf1,_0x5e53d2,_0x52f856,_0x1b7476){var _0xa8bd80=[_0x42b2('0x22'),_0x42b2('0x24'),'cm_contacts.ListId',_0x5e53d2+'.'+_0x1b7476,_0x42b2('0x26'),_0x42b2('0x27')];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x3e'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),_0x42b2('0x40'),_0x42b2('0x2f'),_0x1b7476,_0x42b2('0x30'),_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0xa8bd80)['from'](_0x5e53d2)[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x36')+_0x5e53d2+_0x42b2('0x41'))['join'](_0x52f856,null,_0x52f856+_0x42b2('0x15')+_0x5e53d2+'.'+_0x1b7476)[_0x42b2('0x38')](_0x5e53d2+_0x42b2('0x37'),_0x523cf1)[_0x42b2('0x38')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x42b2('0x3a'),squel[_0x42b2('0x11')]()[_0x42b2('0x12')]('phone')[_0x42b2('0x13')](_0x42b2('0x3e'))[_0x42b2('0x38')](_0x42b2('0x42'),_0x523cf1)[_0x42b2('0x38')](_0x1b7476+_0x42b2('0x16')+_0x5e53d2+'.'+_0x1b7476)))[_0x42b2('0x3d')]();}function insertTzCmHopper(_0x275ba1,_0x1bdc1c,_0x324f59,_0x1a5123,_0x1920be,_0x243b67){var _0x3678b9=[_0x42b2('0x22'),_0x42b2('0x43')+_0x243b67+'.offset-cm_contacts.utcOffset\x20minute)',_0x42b2('0x24'),_0x42b2('0x25'),_0x1bdc1c+'.'+_0x1a5123,'cm_contacts.createdAt',_0x42b2('0x27'),_0x42b2('0x28'),'cm_contacts.UserId','\x22'+_0x1920be+'\x22'];var _0x49b353=squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x2c'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),_0x42b2('0x2e'),_0x42b2('0x40'),_0x42b2('0x2f'),_0x1a5123,_0x42b2('0x30'),_0x42b2('0x31'),_0x42b2('0x32'),_0x42b2('0x33'),_0x42b2('0x44')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x3678b9)['from'](_0x1bdc1c)[_0x42b2('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x1bdc1c+_0x42b2('0x41'))[_0x42b2('0x14')](_0x324f59,null,_0x324f59+'.id\x20=\x20'+_0x1bdc1c+'.'+_0x1a5123)[_0x42b2('0x14')](_0x243b67,null,_0x243b67+'.id\x20=\x20'+_0x1bdc1c+'.'+_0x1a5123)[_0x42b2('0x38')](_0x1bdc1c+'.CmListId\x20=\x20?',_0x275ba1)[_0x42b2('0x38')](_0x42b2('0x39'),NOW)[_0x42b2('0x38')](_0x42b2('0x3a'),selectNotIn(_0x1bdc1c,_0x324f59,_0x1a5123,_0x42b2('0x2c'),['\x22always\x22',_0x42b2('0x3c')]))[_0x42b2('0x38')](_0x42b2('0x3a'),selectNotIn(_0x1bdc1c,_0x324f59,_0x1a5123,'cm_hopper',[_0x42b2('0x3b')])))['toString']();return _0x49b353;}function insertTzCmHopperBlack(_0x16b832,_0x3b298f,_0x4c69b5,_0x191a80){var _0x3436d8=['cm_contacts.phone',_0x42b2('0x24'),_0x42b2('0x25'),_0x3b298f+'.'+_0x191a80,_0x42b2('0x26'),_0x42b2('0x27')];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x3e'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),'ContactId','ListId',_0x191a80,_0x42b2('0x30'),_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x3436d8)[_0x42b2('0x13')](_0x3b298f)[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x36')+_0x3b298f+_0x42b2('0x41'))[_0x42b2('0x14')](_0x4c69b5,null,_0x4c69b5+_0x42b2('0x15')+_0x3b298f+'.'+_0x191a80)[_0x42b2('0x38')](_0x3b298f+_0x42b2('0x37'),_0x16b832)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x42b2('0x38')](_0x42b2('0x3a'),squel[_0x42b2('0x11')]()[_0x42b2('0x12')](_0x42b2('0x2d'))[_0x42b2('0x13')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x16b832)[_0x42b2('0x38')](_0x191a80+'\x20=\x20'+_0x3b298f+'.'+_0x191a80)))[_0x42b2('0x3d')]();}function insertCmHopperAdditionalPhones(_0x32c5f3){var _0x29b398=['cm_hopper.id',_0x42b2('0x45'),_0x42b2('0x46'),_0x42b2('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x48'))[_0x42b2('0x3f')](['CmHopperId','phone',_0x42b2('0x49'),'createdAt',_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x29b398)[_0x42b2('0x13')](_0x42b2('0x2c'))[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x4a'))[_0x42b2('0x14')](_0x42b2('0x4b'),null,_0x42b2('0x4c'))[_0x42b2('0x38')](_0x42b2('0x4d'),_0x32c5f3)['where'](_0x42b2('0x39'),NOW))[_0x42b2('0x3d')]();}function insertCmContact(_0x22894a,_0x46e4dc,_0x58e90f,_0x48884b){var _0x4002f7=_[_0x42b2('0x4e')](_[_0x42b2('0x4f')](_0x48884b),[_0x42b2('0x2f'),_0x42b2('0x50'),_0x42b2('0x30'),_0x42b2('0x31')]);return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x35'))[_0x42b2('0x3f')](_0x4002f7,squel[_0x42b2('0x11')]()['fields'](_0x4002f7)['from'](_0x46e4dc)['where']('('+_0x58e90f[_0x42b2('0x14')](',')+_0x42b2('0x51'),squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x58e90f)[_0x42b2('0x13')]('cm_contacts')[_0x42b2('0x38')](_0x42b2('0x42'),_0x22894a)[_0x42b2('0x38')](_0x42b2('0x52')))['where'](_0x42b2('0x53'),squel['select']()['field'](_0x42b2('0x54'),_0x42b2('0x55'))[_0x42b2('0x13')](_0x46e4dc)[_0x42b2('0x56')](_0x58e90f[_0x42b2('0x14')](','))))[_0x42b2('0x3d')]();}function handleStop(){logger[_0x42b2('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x38a74a){logger['error'](_0x38a74a[_0x42b2('0x58')]);process[_0x42b2('0x59')](0x1);}function handleError(_0x5817ff,_0x4a4489){stats[_0x42b2('0x5a')][_0x42b2('0x1a')]({'name':_0x4a4489['code'],'message':_0x4a4489['message'],'row':_0x5817ff});}function handleQuery(_0x2b2c3f){logger[_0x42b2('0x57')](_0x2b2c3f);return db['sequelize'][_0x42b2('0x5b')](_0x2b2c3f)[_0x42b2('0x5c')](function(_0x45c6ca){results[_0x42b2('0x1a')](_0x45c6ca);})['catch'](function(_0x3d63a5){logger[_0x42b2('0x5d')](_0x3d63a5['message']);});}function updateTzCampaigns(_0x543a31){return new Promise(function(_0xfbbc2,_0x37d4a7){var _0x1a4629=squel[_0x42b2('0x11')]()[_0x42b2('0x34')]([_0x42b2('0x5e'),'campaigns.dialTimezone'])[_0x42b2('0x13')](_0x42b2('0x5f'))['join'](_0x42b2('0x60'),null,_0x42b2('0x61'))['where'](_0x42b2('0x62')+_0x543a31);db['sequelize'][_0x42b2('0x5b')](_0x1a4629[_0x42b2('0x3d')]())[_0x42b2('0x5c')](function(_0x198483){var _0x26f6da=[];for(var _0xd88942=0x0;_0xd88942<_0x198483['length'];_0xd88942++){_0x26f6da[_0x42b2('0x1a')](getTimezoneData(_0x198483[_0xd88942],tmp_campaigns));}BPromise[_0x42b2('0x1b')](_0x26f6da)['then'](function(){_0xfbbc2({'val':0x1});});})[_0x42b2('0x63')](function(_0x1bb1cd){logger[_0x42b2('0x5d')](_0x1bb1cd[_0x42b2('0x58')]);_0xfbbc2({'val':0x0});});});}function updateTzVoiceQueues(_0x46ad20){return new Promise(function(_0x2bac2a,_0x11e799){var _0x4b59f9=squel[_0x42b2('0x11')]()[_0x42b2('0x34')](['voice_queues.id',_0x42b2('0x64')])[_0x42b2('0x13')](_0x42b2('0x65'))[_0x42b2('0x14')](_0x42b2('0x66'),null,_0x42b2('0x67'))['where'](_0x42b2('0x68')+_0x46ad20);db[_0x42b2('0x69')][_0x42b2('0x5b')](_0x4b59f9[_0x42b2('0x3d')]())[_0x42b2('0x5c')](function(_0x2f25dc){var _0x168a3a=[];for(var _0x591256=0x0;_0x591256<_0x2f25dc[_0x42b2('0x19')];_0x591256++){_0x168a3a[_0x42b2('0x1a')](getTimezoneData(_0x2f25dc[_0x591256],tmp_voice_queues));}BPromise[_0x42b2('0x1b')](_0x168a3a)[_0x42b2('0x18')](function(){_0x2bac2a({'val':0x1});});})[_0x42b2('0x63')](function(_0x322dcd){logger[_0x42b2('0x5d')](_0x322dcd[_0x42b2('0x58')]);_0x2bac2a({'val':0x0});});});}function getTimezoneData(_0x4b225c,_0x402abb){return new Promise(function(_0x5122d2,_0x428076){var _0x259c39=shared[_0x42b2('0x6a')];var _0x59d5d7=_0x259c39[_0x4b225c[_0x42b2('0x6b')]];if(_[_0x42b2('0x6c')](_0x59d5d7)){_0x5122d2({'ret':0x1});}else{var _0x129e75=_0x59d5d7['utcOffset'];var _0x12d9be=squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x402abb)[_0x42b2('0x6d')]('id',_0x4b225c['id'])[_0x42b2('0x6d')](_0x42b2('0x6e'),_0x129e75)[_0x42b2('0x6d')](_0x42b2('0x6b'),_0x4b225c[_0x42b2('0x6b')])[_0x42b2('0x3d')]();return db[_0x42b2('0x69')]['query'](_0x12d9be)[_0x42b2('0x5c')](function(_0x3df6be){_0x5122d2({'ret':0x1});})[_0x42b2('0x63')](function(_0x77aded){logger[_0x42b2('0x5d')](_0x77aded[_0x42b2('0x58')]);_0x428076({'ret':0x1});});}});}function handleTZQuery(_0x17dc68){logger['info'](_0x17dc68);return db['sequelize'][_0x42b2('0x5b')](_0x17dc68)[_0x42b2('0x5c')](function(_0x249e43){})[_0x42b2('0x63')](function(_0x3c8517){logger[_0x42b2('0x5d')](_0x3c8517[_0x42b2('0x58')]);});}function main(_0x1c0ff5,_0x539de3,_0x57fb32,_0x27219a){logger['info']('main',_0x1c0ff5,JSON[_0x42b2('0x6f')](_0x539de3));process[_0x42b2('0x70')](_0x42b2('0x71'));var _0x23e7a9=_0x539de3['binding'];var _0x1bf15c=_[_0x42b2('0x72')](_0x23e7a9);var _0x3484d1=_0x539de3[_0x42b2('0x73')];var _0x25501e=path[_0x42b2('0x14')](config[_0x42b2('0x74')],'server/files/tmp',_0x3484d1+_0x42b2('0x75'));hasTZ=_[_0x42b2('0x4f')](_0x23e7a9)[_0x42b2('0x76')](_0x42b2('0x6b'));var _0x3bd876=_['keys'](_0x23e7a9)[_0x42b2('0x14')]();logger[_0x42b2('0x57')]('header',_0x3bd876);db[_0x42b2('0x77')][_0x42b2('0x78')]({'raw':!![],'attributes':['id',_0x42b2('0x79')]})[_0x42b2('0x18')](function(_0x483d79){for(var _0x888c03=0x0;_0x888c03<_0x483d79[_0x42b2('0x19')];_0x888c03++){if(_0x483d79[_0x888c03]['name']in _0x23e7a9){contactItemTypes[_0x42b2('0x1a')](_0x483d79[_0x888c03]);delete _0x1bf15c[_0x483d79[_0x888c03][_0x42b2('0x79')]];hasAdditionalPhones=!![];}for(var _0x3e0cbe in _0x23e7a9){if(_0x483d79[_0x888c03]['name']+_0x42b2('0x7a')===_0x3e0cbe){phoneDescriptions[_0x42b2('0x1a')]({'itemTypeId':_0x483d79[_0x888c03]['id'],'description':_0x3e0cbe});delete _0x1bf15c[_0x3e0cbe];}}}if(hasAdditionalPhones)_0x1bf15c[_0x42b2('0x17')]='';var _0x25b751=_[_0x42b2('0x4f')](_0x1bf15c)[_0x42b2('0x14')]();logger[_0x42b2('0x57')]('header',_0x25b751);fs[_0x42b2('0x7b')](_0x25501e,_0x25b751+'\x0a');Papa['parse'](fs[_0x42b2('0x7c')](_0x1c0ff5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x590664,_0x51ee5c){try{for(var _0x55b2fe=0x0,_0x551e2b=[];_0x55b2fe<_0x590664[_0x42b2('0x7d')]['length'];_0x55b2fe++){stats[_0x42b2('0x7e')]+=0x1;if(_0x590664[_0x42b2('0x5a')][_0x55b2fe]){handleError(_0x590664['data'][_0x55b2fe],_0x590664[_0x42b2('0x5a')][_0x55b2fe]);}else{var _0x4f12f5=[];var _0x486dd4=[];var _0x3411ac={};for(var _0x12eaed in _0x23e7a9){let _0xd70d91=contactItemTypes[_0x42b2('0x7f')](_0x2af1f8=>_0x2af1f8[_0x42b2('0x79')]===_0x12eaed);let _0x35019f=contactItemTypes[_0x42b2('0x7f')](_0x35b9e6=>_0x35b9e6[_0x42b2('0x79')]+_0x42b2('0x7a')===_0x12eaed);if(_['isNil'](_0xd70d91)&&_[_0x42b2('0x6c')](_0x35019f)){if(_0x23e7a9[_0x42b2('0x80')](_0x12eaed)){if(_0x590664[_0x42b2('0x7d')][_0x55b2fe][_0x23e7a9[_0x12eaed]]){var _0x5308ad=_[_0x42b2('0x81')](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]][_0x42b2('0x82')](/"/g,'\x27'));switch(_0x12eaed){case _0x42b2('0x2e'):var _0x4510c7=moment(_0x5308ad,_0x42b2('0xf'),!![]);if(_0x4510c7[_0x42b2('0x83')]()){_0x551e2b['push']('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x84'));}break;case _0x42b2('0x32'):var _0x379851=parseInt(_0x5308ad);_0x5308ad=_[_0x42b2('0x85')](_0x379851)||_0x379851<0x0||_0x379851>0x4?_0x27219a?0x3:0x2:_0x379851;_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');break;case _0x42b2('0x33'):var _0x35b8a9=parseInt(_0x5308ad);if(_[_0x42b2('0x86')](_0x35b8a9)&&_[_0x42b2('0x76')](_0x57fb32,_0x35b8a9)){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x35b8a9+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x87'));}break;case _0x42b2('0x88'):if(isEmail(_0x5308ad)){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x89'));}break;case _0x42b2('0x8a'):var _0x1f351d=moment(_0x5308ad,_0x42b2('0x8b'),!![]);if(_0x1f351d[_0x42b2('0x83')]()){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x42b2('0x6b'):var _0x514887=shared[_0x42b2('0x6a')];var _0x373466=_0x514887[_0x5308ad];if(!_[_0x42b2('0x6c')](_0x373466)){var _0x37317c=_0x373466['utcOffset'];_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');_0x551e2b['push']('\x22'+_0x37317c+'\x22');}break;default:_0x551e2b['push']('\x22'+_0x5308ad+'\x22');}}else{switch(_0x12eaed){case'firstName':case _0x42b2('0x2d'):_0x4f12f5[_0x42b2('0x1a')](_0x12eaed+_0x42b2('0x8c'));break;default:_0x551e2b['push']('\x22\x22');}}}}else{var _0x343bb0='';if(!_[_0x42b2('0x6c')](_0xd70d91)){if(!_0x3411ac[_0x42b2('0x80')](_0xd70d91['id'])){if(!_[_0x42b2('0x6c')](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]])){var _0x5308ad=_['trim'](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]][_0x42b2('0x82')](/"/g,'\x27'));var _0x2b28ee=phoneDescriptions[_0x42b2('0x7f')](_0x8e3d28=>_0x8e3d28[_0x42b2('0x8d')]===_0xd70d91['id']);if(!_[_0x42b2('0x6c')](_0x2b28ee)){var _0x2c0a68=_[_0x42b2('0x81')](_0x590664[_0x42b2('0x7d')][_0x55b2fe][_0x23e7a9[_0x2b28ee[_0x42b2('0x8e')]]]['replace'](/"/g,'\x27'));if(!_[_0x42b2('0x6c')](_0x2c0a68))_0x5308ad=_0x5308ad+'§'+_0x2c0a68;}if(_0x343bb0=='')_0x343bb0=_0x5308ad;else _0x343bb0+='|'+_0x5308ad;}_0x486dd4[_0x42b2('0x1a')](_0xd70d91['id']+':'+_0x343bb0);_0x3411ac[_0xd70d91['id']]=0x1;}}}}if(hasAdditionalPhones){_0x551e2b['push']('\x22'+_0x486dd4[_0x42b2('0x14')](';')+'\x22');}if(_0x4f12f5['length']){handleError(_0x590664[_0x42b2('0x7d')][_0x55b2fe],{'code':_0x42b2('0x8f'),'message':_0x4f12f5['join']()});}else{fs[_0x42b2('0x90')](_0x25501e,_0x551e2b['join']()+'\x0a');}_0x551e2b=[];}if(!(stats[_0x42b2('0x7e')]%0xc8)){socket['emit'](_0x42b2('0x91')+_0x3484d1,stats);stats[_0x42b2('0x5a')]=[];}}if(stopped){logger[_0x42b2('0x57')](_0x42b2('0x92'));_0x51ee5c['abort']();}}catch(_0x4df890){handleError(_0x590664[_0x42b2('0x7d')][_0x55b2fe],{'code':'SystemError','message':_0x4df890[_0x42b2('0x58')]});logger['error']('step',_0x4df890[_0x42b2('0x58')]);}},'complete':function(){try{var _0x452cbe=[];var _0x2aed37=[];var _0x4b4acd=_0x42b2('0x35');if(_0x539de3[_0x42b2('0x93')]&&_0x539de3[_0x42b2('0x93')][_0x42b2('0x19')]){_0x4b4acd='cm_contacts_'+_0x3484d1;_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x94')+_0x4b4acd+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x3484d1;tmp_voice_queues='voice_queues_'+_0x3484d1;_0x2aed37[_0x42b2('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x42b2('0x95'));_0x2aed37['push'](_0x42b2('0x94')+tmp_voice_queues+_0x42b2('0x95'));BPromise[_0x42b2('0x96')](_0x2aed37,handleTZQuery)[_0x42b2('0x18')](function(_0x55ea1c){updateTzCampaigns(_0x539de3['ListId'])[_0x42b2('0x18')](function(_0x432eb5){updateTzVoiceQueues(_0x539de3['ListId'])['then'](function(_0x3e5324){if(hasTZ)_0x25b751=_0x25b751[_0x42b2('0x82')](_0x42b2('0x6b'),'dialTimezone,utcOffset');var _0x3f2df9=util[_0x42b2('0xe')]('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',_0x25501e,_0x4b4acd,_0x25b751,_0x539de3['ListId'],_0x539de3['CompanyId']||null,NOW,NOW);if(_[_0x42b2('0x6c')](_0x23e7a9[_0x42b2('0x2e')])){_0x3f2df9+=_0x42b2('0x97');}_0x452cbe[_0x42b2('0x1a')](_0x3f2df9);if(_0x539de3['duplicates']&&_0x539de3['duplicates']['length']){_0x452cbe['push'](insertCmContact(_0x539de3['ListId'],_0x4b4acd,_0x539de3[_0x42b2('0x93')],_0x23e7a9));_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x98')+_0x4b4acd+';');}BPromise[_0x42b2('0x96')](_0x452cbe,handleQuery)['then'](function(_0x399b5d){BPromise[_0x42b2('0x1b')]([handleAdditionalPhones()])[_0x42b2('0x18')](function(){_0x452cbe=[];for(var _0x1b4d85=0x0;_0x1b4d85\x20\x20','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','spread','length','AdditionalPhones','push','all','then','catch','error','isNil','split','filter','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','UserId','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','toString','cm_hopper_black','createdAt','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?'];(function(_0xa42ad0,_0x8308d3){var _0x53a21b=function(_0x114197){while(--_0x114197){_0xa42ad0['push'](_0xa42ad0['shift']());}};_0x53a21b(++_0x8308d3);}(_0xc022,0x173));var _0x2c02=function(_0x19e89d,_0x4793ce){_0x19e89d=_0x19e89d-0x0;var _0x48aeed=_0xc022[_0x19e89d];return _0x48aeed;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2c02('0x0'));var Papa=require(_0x2c02('0x1'));var util=require(_0x2c02('0x2'));var BPromise=require(_0x2c02('0x3'));var moment=require(_0x2c02('0x4'));var squel=require(_0x2c02('0x5'));var Redis=require('ioredis');var db=require(_0x2c02('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x2c02('0x7'))('import');config['redis']=_[_0x2c02('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2c02('0x9'))(new Redis(config[_0x2c02('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x2c02('0xb')](_0x2c02('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0x2c02('0xb')](_0x2c02('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xd522c7){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))*$/[_0x2c02('0xe')](_0xd522c7);}function selectNotIn(_0x514f6a,_0x8394a9,_0x47b4f8,_0x4b72ea,_0x27e727){return squel[_0x2c02('0xf')]()['field'](_0x2c02('0x10'))[_0x2c02('0x11')](_0x4b72ea)[_0x2c02('0x12')](_0x8394a9,null,_0x8394a9+_0x2c02('0x13')+_0x4b72ea+'.'+_0x47b4f8)[_0x2c02('0x14')](_0x4b72ea+'.'+_0x47b4f8+_0x2c02('0x15')+_0x514f6a+'.'+_0x47b4f8)[_0x2c02('0x14')](_0x8394a9+'.dialCheckDuplicateType\x20IN\x20('+_0x27e727[_0x2c02('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x29f647,_0x26c1fa){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2c02('0x16')][_0x2c02('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0x2c02('0x18')](function(_0x15d347){if(_0x15d347!==null){var _0x770f2e=[];for(var _0x2cd047=0x0;_0x2cd047<_0x15d347[_0x2c02('0x19')];_0x2cd047++){var _0x3ea64d=_0x15d347[_0x2cd047];if(!_['isNil'](_0x3ea64d[_0x2c02('0x10')])){if(!_['isNil'](_0x3ea64d[_0x2c02('0x1a')]))_0x770f2e[_0x2c02('0x1b')](insertAdditionalPhones(_0x3ea64d));promisesContact['push']({'contact':_0x3ea64d});}}}Promise[_0x2c02('0x1c')](_0x770f2e)[_0x2c02('0x1d')](function(){_0x29f647({'val':0x1});});})[_0x2c02('0x1e')](function(_0x168aae){logger[_0x2c02('0x1f')](_0x168aae['message']);});});}function insertAdditionalPhones(_0x1466de){return new Promise(function(_0x4bbb40,_0x220138){var _0x6a7159=_0x1466de[_0x2c02('0x1a')];if(_[_0x2c02('0x20')](_0x6a7159))_0x220138({'val':0x0});else{var _0x19ceaf=_0x6a7159['split'](';');var _0x29ea3b=[];orderBy=0x0;for(var _0x3adf3e=0x0;_0x3adf3e<_0x19ceaf[_0x2c02('0x19')];_0x3adf3e++){_0x29ea3b[_0x2c02('0x1b')](splitAdditionalPhone(_0x1466de['id'],_0x19ceaf[_0x3adf3e]));}Promise['all'](_0x29ea3b)['then'](function(){_0x4bbb40({'val':_0x19ceaf['length']});});}});}function splitAdditionalPhone(_0x506131,_0x5c75e8){return new Promise(function(_0x3c0a11,_0x552719){var _0x38e5ab=_0x5c75e8[_0x2c02('0x21')](':');var _0x432f42=_0x38e5ab[0x0];var _0x2b14b2=_0x38e5ab[0x1];if(_0x2b14b2!==''){var _0x223176=_0x2b14b2['split']('|');var _0x2c15a2=[];for(var _0x5ada48=0x0;_0x5ada48<_0x223176[_0x2c02('0x19')];_0x5ada48++){if(_0x223176[_0x5ada48]!==''){var _0x32d20b=_[_0x2c02('0x22')](promisesAdditionalPhones,{'contactId':_0x506131,'phone':_0x223176[_0x5ada48]});if(_0x32d20b['length']==0x0){orderBy++;promisesAdditionalPhones[_0x2c02('0x1b')]({'contactId':_0x506131,'contactTypeId':_0x432f42,'phone':_0x223176[_0x5ada48],'orderBy':orderBy});}}}_0x3c0a11({'ok':0x1});}else _0x3c0a11({'res':0x0});});}function createAdditionalPhone(_0x55158f,_0x1077fc,_0x4876df,_0x2d72fc){var _0x273884='';var _0x54b8c9='';var _0x26cc30=_0x4876df[_0x2c02('0x21')]('§');_0x273884=_0x26cc30[0x0];if(_0x26cc30[_0x2c02('0x19')]==0x2)_0x54b8c9=_0x26cc30[0x1];return new Promise(function(_0x45d2da,_0x19a237){return db[_0x2c02('0x23')][_0x2c02('0x24')]({'where':{'CmContactId':_0x55158f,'item':_0x273884}})[_0x2c02('0x1d')](function(_0x297754){if(_0x297754){return db[_0x2c02('0x23')]['update']({'ItemTypeId':_0x1077fc,'description':_0x54b8c9,'OrderBy':_0x2d72fc},{'where':{'CmContactId':_0x55158f,'item':_0x273884}})[_0x2c02('0x1d')](function(_0x514acb){_0x45d2da({'res':_0x2c02('0x25')});});}else{return db[_0x2c02('0x23')][_0x2c02('0x26')]({'CmContactId':_0x55158f,'item':_0x273884,'ItemTypeId':_0x1077fc,'description':_0x54b8c9,'OrderBy':_0x2d72fc,'ItemClass':_0x2c02('0x27')})[_0x2c02('0x1d')](function(_0x357d5f){_0x45d2da({'res':_0x2c02('0x28')});});}});});}function updateContact(_0x5624ea){return new Promise(function(_0x492334,_0x447408){var _0x1d699e=_0x5624ea['id'];delete _0x5624ea['id'];return db[_0x2c02('0x29')][_0x2c02('0x2a')](_0x5624ea,{'where':{'id':_0x1d699e}})[_0x2c02('0x1d')](function(_0x2d2335){updatedRows+=0x1;return db['CmHopper'][_0x2c02('0x2a')]({'phone':_0x5624ea['phone']},{'where':{'ContactId':_0x1d699e}})[_0x2c02('0x1d')](function(_0x1cb3f2){_0x492334({'ret':'OK'});});});});}function insertCmHopper(_0x4defa0,_0x80665d,_0x17153e,_0x52345f,_0x3f4779){var _0x5d1a07=[_0x2c02('0x2b'),_0x2c02('0x2c'),_0x2c02('0x2d'),_0x2c02('0x2e'),_0x80665d+'.'+_0x52345f,_0x2c02('0x2f'),_0x2c02('0x30'),_0x2c02('0x31'),'cm_contacts.UserId','\x22'+_0x3f4779+'\x22'];return squel[_0x2c02('0x32')]()[_0x2c02('0x33')]('cm_hopper')[_0x2c02('0x34')](['phone',_0x2c02('0x35'),_0x2c02('0x36'),_0x2c02('0x37'),_0x52345f,'createdAt',_0x2c02('0x38'),'priority',_0x2c02('0x39'),_0x2c02('0x3a')],squel['select']()[_0x2c02('0x3b')](_0x5d1a07)[_0x2c02('0x11')](_0x80665d)[_0x2c02('0x12')](_0x2c02('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x80665d+_0x2c02('0x3d'))[_0x2c02('0x12')](_0x17153e,null,_0x17153e+_0x2c02('0x13')+_0x80665d+'.'+_0x52345f)[_0x2c02('0x14')](_0x80665d+_0x2c02('0x3e'),_0x4defa0)['where'](_0x2c02('0x3f'),NOW)[_0x2c02('0x14')](_0x2c02('0x40'),selectNotIn(_0x80665d,_0x17153e,_0x52345f,'cm_hopper',[_0x2c02('0x41'),_0x2c02('0x42')]))[_0x2c02('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x80665d,_0x17153e,_0x52345f,_0x2c02('0x43'),[_0x2c02('0x41')])))[_0x2c02('0x44')]();}function insertCmHopperBlack(_0x2ff69d,_0x10ed59,_0xff095c,_0x4289df){var _0x212e87=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x10ed59+'.'+_0x4289df,'cm_contacts.createdAt',_0x2c02('0x30')];return squel[_0x2c02('0x32')]()[_0x2c02('0x33')](_0x2c02('0x45'))['fromQuery']([_0x2c02('0x10'),_0x2c02('0x36'),'ListId',_0x4289df,_0x2c02('0x46'),_0x2c02('0x38')],squel[_0x2c02('0xf')]()[_0x2c02('0x3b')](_0x212e87)['from'](_0x10ed59)[_0x2c02('0x12')](_0x2c02('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x10ed59+_0x2c02('0x3d'))[_0x2c02('0x12')](_0xff095c,null,_0xff095c+'.id\x20=\x20'+_0x10ed59+'.'+_0x4289df)[_0x2c02('0x14')](_0x10ed59+'.CmListId\x20=\x20?',_0x2ff69d)[_0x2c02('0x14')](_0x2c02('0x3f'),NOW)[_0x2c02('0x14')](_0x2c02('0x40'),squel[_0x2c02('0xf')]()[_0x2c02('0x47')](_0x2c02('0x10'))['from']('cm_hopper_black')[_0x2c02('0x14')](_0x2c02('0x48'),_0x2ff69d)[_0x2c02('0x14')](_0x4289df+_0x2c02('0x49'),_0x10ed59+'.'+_0x4289df)))['toString']();}function insertCmHopperAdditionalPhones(_0x161a10){var _0x4b2c0a=[_0x2c02('0x4a'),'cm_contact_has_items.item',_0x2c02('0x4b'),_0x2c02('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x2c02('0x32')]()['into'](_0x2c02('0x4d'))[_0x2c02('0x34')]([_0x2c02('0x4e'),_0x2c02('0x10'),_0x2c02('0x4f'),_0x2c02('0x46'),_0x2c02('0x38')],squel[_0x2c02('0xf')]()[_0x2c02('0x3b')](_0x4b2c0a)['from'](_0x2c02('0x43'))['join'](_0x2c02('0x3c'),null,_0x2c02('0x50'))[_0x2c02('0x12')]('cm_contact_has_items',null,_0x2c02('0x51'))[_0x2c02('0x14')](_0x2c02('0x52'),_0x161a10)[_0x2c02('0x14')](_0x2c02('0x3f'),NOW))['toString']();}function insertCmContact(_0x201abc,_0x825df,_0x395d00,_0x2ffccc){var _0x5d862d=_[_0x2c02('0x53')](_[_0x2c02('0x54')](_0x2ffccc),[_0x2c02('0x37'),_0x2c02('0x55'),_0x2c02('0x46'),_0x2c02('0x38')]);return squel['insert']()[_0x2c02('0x33')](_0x2c02('0x3c'))['fromQuery'](_0x5d862d,squel[_0x2c02('0xf')]()[_0x2c02('0x3b')](_0x5d862d)['from'](_0x825df)[_0x2c02('0x14')]('('+_0x395d00[_0x2c02('0x12')](',')+_0x2c02('0x56'),squel['select']()[_0x2c02('0x3b')](_0x395d00)[_0x2c02('0x11')]('cm_contacts')[_0x2c02('0x14')](_0x2c02('0x48'),_0x201abc))[_0x2c02('0x14')](_0x2c02('0x57'),squel[_0x2c02('0xf')]()[_0x2c02('0x47')]('MIN(id)',_0x2c02('0x58'))[_0x2c02('0x11')](_0x825df)['group'](_0x395d00[_0x2c02('0x12')](','))))[_0x2c02('0x44')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x35a6bf){logger[_0x2c02('0x1f')](_0x35a6bf['message']);process[_0x2c02('0x59')](0x1);}function handleError(_0x5c60e8,_0x3c68d8){stats[_0x2c02('0x5a')][_0x2c02('0x1b')]({'name':_0x3c68d8['code'],'message':_0x3c68d8[_0x2c02('0x5b')],'row':_0x5c60e8});}function handleQuery(_0x44fcae){logger[_0x2c02('0x5c')](_0x44fcae);return db[_0x2c02('0x16')][_0x2c02('0x17')](_0x44fcae)[_0x2c02('0x18')](function(_0x3f613b){results['push'](_0x3f613b);})[_0x2c02('0x1e')](function(_0xfb87c5){logger[_0x2c02('0x1f')](_0xfb87c5['message']);});}function main(_0x13ab80,_0x2b58d5,_0x2bcd66,_0x16f17f){logger[_0x2c02('0x5c')](_0x2c02('0x5d'),_0x13ab80,JSON['stringify'](_0x2b58d5));process[_0x2c02('0x5e')](_0x2c02('0x5f'));var _0x38af9f=_0x2b58d5[_0x2c02('0x60')];var _0x311e35=_[_0x2c02('0x61')](_0x38af9f);var _0x5e97ab=_0x2b58d5[_0x2c02('0x62')];var _0xa1d914=path[_0x2c02('0x12')](config[_0x2c02('0x63')],'server/files/tmp',_0x5e97ab+_0x2c02('0x64'));logger[_0x2c02('0x5c')](_0x2c02('0x65'),_0x2b58d5);db[_0x2c02('0x66')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x2c02('0x1d')](function(_0x2ecd13){for(var _0x51a410=0x0;_0x51a410<_0x2ecd13[_0x2c02('0x19')];_0x51a410++){if(_0x2ecd13[_0x51a410][_0x2c02('0x67')]in _0x38af9f){contactItemTypes[_0x2c02('0x1b')](_0x2ecd13[_0x51a410]);delete _0x311e35[_0x2ecd13[_0x51a410][_0x2c02('0x67')]];hasAdditionalPhones=!![];}for(var _0x2daf06 in _0x38af9f){if(_0x2ecd13[_0x51a410][_0x2c02('0x67')]+_0x2c02('0x68')===_0x2daf06){phoneDescriptions['push']({'itemTypeId':_0x2ecd13[_0x51a410]['id'],'description':_0x2daf06});delete _0x311e35[_0x2daf06];}}}if(hasAdditionalPhones)_0x311e35[_0x2c02('0x1a')]='';var _0x43ca49=_[_0x2c02('0x54')](_0x311e35)[_0x2c02('0x12')]();logger[_0x2c02('0x5c')]('header',_0x43ca49);fs[_0x2c02('0x69')](_0xa1d914,_0x43ca49+'\x0a');Papa[_0x2c02('0x6a')](fs[_0x2c02('0x6b')](_0x13ab80),{'header':!![],'skipEmptyLines':!![],'step':function(_0x378e07,_0x25fe37){try{for(var _0x12d4cb=0x0,_0x4b660a=[];_0x12d4cb<_0x378e07['data'][_0x2c02('0x19')];_0x12d4cb++){stats[_0x2c02('0x6c')]+=0x1;if(_0x378e07['errors'][_0x12d4cb]){handleError(_0x378e07[_0x2c02('0x6d')][_0x12d4cb],_0x378e07[_0x2c02('0x5a')][_0x12d4cb]);}else{var _0x118e1e=[];var _0x85e915=[];var _0x58f44f={};for(var _0x3e0153 in _0x38af9f){let _0x1b730a=contactItemTypes['find'](_0x2a2e6c=>_0x2a2e6c[_0x2c02('0x67')]===_0x3e0153);let _0x2fa8c0=contactItemTypes[_0x2c02('0x6e')](_0x4471aa=>_0x4471aa[_0x2c02('0x67')]+_0x2c02('0x68')===_0x3e0153);if(_[_0x2c02('0x20')](_0x1b730a)&&_['isNil'](_0x2fa8c0)){if(_0x38af9f[_0x2c02('0x6f')](_0x3e0153)){if(_0x378e07[_0x2c02('0x6d')][_0x12d4cb][_0x38af9f[_0x3e0153]]){var _0x183836=_['trim'](_0x378e07['data'][_0x12d4cb][_0x38af9f[_0x3e0153]][_0x2c02('0x70')](/"/g,'\x27'));switch(_0x3e0153){case _0x2c02('0x35'):var _0x4888c5=moment(_0x183836,_0x2c02('0xc'),!![]);if(_0x4888c5[_0x2c02('0x71')]()){_0x4b660a[_0x2c02('0x1b')]('\x22'+_0x183836+'\x22');}else{_0x118e1e[_0x2c02('0x1b')](_0x2c02('0x72'));}break;case _0x2c02('0x73'):var _0x2897ea=parseInt(_0x183836);_0x183836=_[_0x2c02('0x74')](_0x2897ea)||_0x2897ea<0x0||_0x2897ea>0x4?_0x16f17f?0x3:0x2:_0x2897ea;_0x4b660a[_0x2c02('0x1b')]('\x22'+_0x183836+'\x22');break;case'UserId':var _0x44d10a=parseInt(_0x183836);if(_['isNumber'](_0x44d10a)&&_[_0x2c02('0x75')](_0x2bcd66,_0x44d10a)){_0x4b660a[_0x2c02('0x1b')]('\x22'+_0x44d10a+'\x22');}else{_0x118e1e[_0x2c02('0x1b')](_0x2c02('0x76'));}break;case _0x2c02('0x77'):if(isEmail(_0x183836)){_0x4b660a[_0x2c02('0x1b')]('\x22'+_0x183836+'\x22');}else{_0x118e1e['push'](_0x2c02('0x78'));}break;case'dateOfBirth':var _0x392fa8=moment(_0x183836,_0x2c02('0x79'),!![]);if(_0x392fa8[_0x2c02('0x71')]()){_0x4b660a['push']('\x22'+_0x183836+'\x22');}else{_0x118e1e[_0x2c02('0x1b')](_0x2c02('0x7a'));}break;default:_0x4b660a[_0x2c02('0x1b')]('\x22'+_0x183836+'\x22');}}else{switch(_0x3e0153){case'firstName':case _0x2c02('0x10'):_0x118e1e['push'](_0x3e0153+_0x2c02('0x7b'));break;default:_0x4b660a['push']('\x22\x22');}}}}else{var _0x4d05a3='';if(!_[_0x2c02('0x20')](_0x1b730a)){if(!_0x58f44f[_0x2c02('0x6f')](_0x1b730a['id'])){for(var _0x395740=0x0;_0x395740<_0x38af9f[_0x3e0153][_0x2c02('0x19')];_0x395740++){var _0x183836=_[_0x2c02('0x7c')](_0x378e07[_0x2c02('0x6d')][_0x12d4cb][_0x38af9f[_0x3e0153][_0x395740]]['replace'](/"/g,'\x27'));var _0xecdeb1=phoneDescriptions[_0x2c02('0x6e')](_0x18ee20=>_0x18ee20[_0x2c02('0x7d')]===_0x1b730a['id']);if(!_['isNil'](_0xecdeb1)){var _0x43c7a9=_['trim'](_0x378e07['data'][_0x12d4cb][_0x38af9f[_0xecdeb1[_0x2c02('0x7e')]][0x0]][_0x2c02('0x70')](/"/g,'\x27'));if(!_['isNil'](_0x43c7a9))_0x183836=_0x183836+'§'+_0x43c7a9;}if(_0x4d05a3=='')_0x4d05a3=_0x183836;else _0x4d05a3+='|'+_0x183836;}_0x85e915['push'](_0x1b730a['id']+':'+_0x4d05a3);_0x58f44f[_0x1b730a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4b660a['push']('\x22'+_0x85e915[_0x2c02('0x12')](';')+'\x22');}if(_0x118e1e[_0x2c02('0x19')]){handleError(_0x378e07[_0x2c02('0x6d')][_0x12d4cb],{'code':'SystemRow','message':_0x118e1e[_0x2c02('0x12')]()});}else{fs[_0x2c02('0x7f')](_0xa1d914,_0x4b660a[_0x2c02('0x12')]()+'\x0a');}_0x4b660a=[];}if(!(stats[_0x2c02('0x6c')]%0xc8)){socket[_0x2c02('0x80')]('contact:import:'+_0x5e97ab,stats);stats[_0x2c02('0x5a')]=[];}}if(stopped){logger[_0x2c02('0x5c')]('Abort\x20parser');_0x25fe37[_0x2c02('0x81')]();}}catch(_0x2e860b){handleError(_0x378e07[_0x2c02('0x6d')][_0x12d4cb],{'code':_0x2c02('0x82'),'message':_0x2e860b[_0x2c02('0x5b')]});logger[_0x2c02('0x1f')](_0x2c02('0x83'),_0x2e860b[_0x2c02('0x5b')]);}},'complete':function(){try{var _0x4846e6=[];var _0x1d6d74=tempTableName;_0x4846e6['push'](_0x2c02('0x84')+_0x1d6d74+_0x2c02('0x85'));logger[_0x2c02('0x5c')](_0x2c02('0x86'),contactItemTypes['length']);var _0x20485a=util[_0x2c02('0xb')](_0x2c02('0x87'),_0xa1d914,_0x1d6d74,_0x43ca49,_0x2b58d5[_0x2c02('0x37')],_0x2b58d5[_0x2c02('0x55')]||null,NOW,NOW);if(_['isNil'](_0x38af9f['scheduledat'])){_0x20485a+=_0x2c02('0x88');}_0x4846e6[_0x2c02('0x1b')](_0x20485a);BPromise[_0x2c02('0x89')](_0x4846e6,handleQuery)['then'](function(_0x1a1ed1){BPromise['all']([handleAdditionalPhones()])[_0x2c02('0x1d')](function(){_0x4846e6=[];for(var _0x264501=0x0;_0x264501\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','lodash','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','length','isNil','AdditionalPhones','push','all','then','error','message','split','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId'];(function(_0x1e9ace,_0xbcc2eb){var _0x8b6958=function(_0x1898d0){while(--_0x1898d0){_0x1e9ace['push'](_0x1e9ace['shift']());}};_0x8b6958(++_0xbcc2eb);}(_0xd5e5,0x187));var _0x5d5e=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0xd5e5[_0xec74fe];return _0x50bda2;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x5d5e('0x0'));var Papa=require('papaparse');var util=require(_0x5d5e('0x1'));var BPromise=require('bluebird');var moment=require(_0x5d5e('0x2'));var squel=require(_0x5d5e('0x3'));var Redis=require(_0x5d5e('0x4'));var db=require(_0x5d5e('0x5'))['db'];var config=require(_0x5d5e('0x6'));var logger=require(_0x5d5e('0x7'))(_0x5d5e('0x8'));config['redis']=_[_0x5d5e('0x9')](config[_0x5d5e('0xa')],{'host':_0x5d5e('0xb'),'port':0x18eb});var socket=require(_0x5d5e('0xc'))(new Redis(config[_0x5d5e('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x5d5e('0xd')](_0x5d5e('0xe'));var tempTableName=_0x5d5e('0xf')+moment()[_0x5d5e('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x9f5850){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))*$/[_0x5d5e('0x10')](_0x9f5850);}function selectNotIn(_0x1af62a,_0x45663d,_0x32dd18,_0x1901b1,_0x408d57){return squel[_0x5d5e('0x11')]()[_0x5d5e('0x12')](_0x5d5e('0x13'))[_0x5d5e('0x14')](_0x1901b1)[_0x5d5e('0x15')](_0x45663d,null,_0x45663d+_0x5d5e('0x16')+_0x1901b1+'.'+_0x32dd18)[_0x5d5e('0x17')](_0x1901b1+'.'+_0x32dd18+_0x5d5e('0x18')+_0x1af62a+'.'+_0x32dd18)[_0x5d5e('0x17')](_0x45663d+_0x5d5e('0x19')+_0x408d57[_0x5d5e('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3ddf9e,_0x58db07){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x5d5e('0x1a')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x248cad){if(_0x248cad!==null){var _0x4dfac7=[];for(var _0x52289f=0x0;_0x52289f<_0x248cad[_0x5d5e('0x1b')];_0x52289f++){var _0x3a0b99=_0x248cad[_0x52289f];if(!_[_0x5d5e('0x1c')](_0x3a0b99[_0x5d5e('0x13')])){if(!_[_0x5d5e('0x1c')](_0x3a0b99[_0x5d5e('0x1d')]))_0x4dfac7['push'](insertAdditionalPhones(_0x3a0b99));promisesContact[_0x5d5e('0x1e')]({'contact':_0x3a0b99});}}}Promise[_0x5d5e('0x1f')](_0x4dfac7)[_0x5d5e('0x20')](function(){_0x3ddf9e({'val':0x1});});})['catch'](function(_0x54d44e){logger[_0x5d5e('0x21')](_0x54d44e[_0x5d5e('0x22')]);});});}function insertAdditionalPhones(_0x27a79c){return new Promise(function(_0x439c11,_0x362779){var _0x28499c=_0x27a79c['AdditionalPhones'];if(_[_0x5d5e('0x1c')](_0x28499c))_0x362779({'val':0x0});else{var _0x4145d0=_0x28499c[_0x5d5e('0x23')](';');var _0x2261ae=[];orderBy=0x0;for(var _0x2023f3=0x0;_0x2023f3<_0x4145d0[_0x5d5e('0x1b')];_0x2023f3++){_0x2261ae[_0x5d5e('0x1e')](splitAdditionalPhone(_0x27a79c['id'],_0x4145d0[_0x2023f3]));}Promise[_0x5d5e('0x1f')](_0x2261ae)['then'](function(){_0x439c11({'val':_0x4145d0['length']});});}});}function splitAdditionalPhone(_0x494258,_0x2e9f3e){return new Promise(function(_0x936072,_0x51fa72){var _0x59e2d9=_0x2e9f3e[_0x5d5e('0x23')](':');var _0x4ff6e5=_0x59e2d9[0x0];var _0x1bbd1d=_0x59e2d9[0x1];if(_0x1bbd1d!==''){var _0xdeebc6=_0x1bbd1d[_0x5d5e('0x23')]('|');var _0x37feb9=[];for(var _0x5132a4=0x0;_0x5132a4<_0xdeebc6[_0x5d5e('0x1b')];_0x5132a4++){if(_0xdeebc6[_0x5132a4]!==''){var _0x33d730=_[_0x5d5e('0x24')](promisesAdditionalPhones,{'contactId':_0x494258,'phone':_0xdeebc6[_0x5132a4]});if(_0x33d730[_0x5d5e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x5d5e('0x1e')]({'contactId':_0x494258,'contactTypeId':_0x4ff6e5,'phone':_0xdeebc6[_0x5132a4],'orderBy':orderBy});}}}_0x936072({'ok':0x1});}else _0x936072({'res':0x0});});}function createAdditionalPhone(_0x11e96,_0x2b84ae,_0x352487,_0x137c15){var _0x228491='';var _0x31c1b4='';var _0x41cdfc=_0x352487[_0x5d5e('0x23')]('§');_0x228491=_0x41cdfc[0x0];if(_0x41cdfc[_0x5d5e('0x1b')]==0x2)_0x31c1b4=_0x41cdfc[0x1];return new Promise(function(_0x31369b,_0x1d4066){return db['CmContactHasItem'][_0x5d5e('0x25')]({'where':{'CmContactId':_0x11e96,'item':_0x228491}})[_0x5d5e('0x20')](function(_0x557ee4){if(_0x557ee4){return db[_0x5d5e('0x26')][_0x5d5e('0x27')]({'ItemTypeId':_0x2b84ae,'description':_0x31c1b4,'OrderBy':_0x137c15},{'where':{'CmContactId':_0x11e96,'item':_0x228491}})[_0x5d5e('0x20')](function(_0x5328d7){_0x31369b({'res':_0x5d5e('0x28')});});}else{return db[_0x5d5e('0x26')][_0x5d5e('0x29')]({'CmContactId':_0x11e96,'item':_0x228491,'ItemTypeId':_0x2b84ae,'description':_0x31c1b4,'OrderBy':_0x137c15,'ItemClass':_0x5d5e('0x2a')})['then'](function(_0x40a9a9){_0x31369b({'res':_0x5d5e('0x2b')});});}});});}function updateContact(_0x120f89){return new Promise(function(_0x23a0bd,_0x34f3e2){var _0x4b28d1=_0x120f89['id'];delete _0x120f89['id'];return db['CmContact'][_0x5d5e('0x27')](_0x120f89,{'where':{'id':_0x4b28d1}})[_0x5d5e('0x20')](function(_0x44ba93){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x120f89[_0x5d5e('0x13')]},{'where':{'ContactId':_0x4b28d1}})['then'](function(_0x4ea18a){_0x23a0bd({'ret':'OK'});});});});}function insertCmHopper(_0x11978e,_0x3f431a,_0x23da5d,_0x457947,_0x28d891){var _0x2169ed=[_0x5d5e('0x2c'),_0x5d5e('0x2d'),_0x5d5e('0x2e'),_0x5d5e('0x2f'),_0x3f431a+'.'+_0x457947,_0x5d5e('0x30'),_0x5d5e('0x31'),_0x5d5e('0x32'),_0x5d5e('0x33'),'\x22'+_0x28d891+'\x22'];return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')](_0x5d5e('0x36'))[_0x5d5e('0x37')]([_0x5d5e('0x13'),_0x5d5e('0x38'),'ContactId',_0x5d5e('0x39'),_0x457947,_0x5d5e('0x3a'),_0x5d5e('0x3b'),_0x5d5e('0x3c'),_0x5d5e('0x3d'),_0x5d5e('0x3e')],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x2169ed)['from'](_0x3f431a)[_0x5d5e('0x15')]('cm_contacts',null,_0x5d5e('0x40')+_0x3f431a+_0x5d5e('0x41'))[_0x5d5e('0x15')](_0x23da5d,null,_0x23da5d+_0x5d5e('0x16')+_0x3f431a+'.'+_0x457947)[_0x5d5e('0x17')](_0x3f431a+'.CmListId\x20=\x20?',_0x11978e)[_0x5d5e('0x17')](_0x5d5e('0x42'),NOW)[_0x5d5e('0x17')](_0x5d5e('0x43'),selectNotIn(_0x3f431a,_0x23da5d,_0x457947,_0x5d5e('0x36'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x5d5e('0x17')](_0x5d5e('0x43'),selectNotIn(_0x3f431a,_0x23da5d,_0x457947,'cm_hopper',[_0x5d5e('0x44')])))[_0x5d5e('0x45')]();}function insertCmHopperBlack(_0x5306a6,_0x18dfb4,_0x4be3bb,_0x5d3f1a){var _0x277d20=[_0x5d5e('0x2c'),_0x5d5e('0x2e'),_0x5d5e('0x2f'),_0x18dfb4+'.'+_0x5d3f1a,_0x5d5e('0x30'),_0x5d5e('0x31')];return squel['insert']()[_0x5d5e('0x35')](_0x5d5e('0x46'))[_0x5d5e('0x37')](['phone',_0x5d5e('0x47'),_0x5d5e('0x39'),_0x5d3f1a,_0x5d5e('0x3a'),_0x5d5e('0x3b')],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x277d20)[_0x5d5e('0x14')](_0x18dfb4)[_0x5d5e('0x15')](_0x5d5e('0x48'),null,_0x5d5e('0x40')+_0x18dfb4+_0x5d5e('0x41'))[_0x5d5e('0x15')](_0x4be3bb,null,_0x4be3bb+_0x5d5e('0x16')+_0x18dfb4+'.'+_0x5d3f1a)[_0x5d5e('0x17')](_0x18dfb4+_0x5d5e('0x49'),_0x5306a6)['where'](_0x5d5e('0x42'),NOW)[_0x5d5e('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5d5e('0x12')](_0x5d5e('0x13'))['from'](_0x5d5e('0x46'))[_0x5d5e('0x17')](_0x5d5e('0x4a'),_0x5306a6)['where'](_0x5d3f1a+_0x5d5e('0x4b'),_0x18dfb4+'.'+_0x5d3f1a)))[_0x5d5e('0x45')]();}function insertCmHopperAdditionalPhones(_0x41692e){var _0x5374b4=['cm_hopper.id',_0x5d5e('0x4c'),_0x5d5e('0x4d'),_0x5d5e('0x4e'),'cm_contact_has_items.updatedAt'];return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')]('cm_hopper_additional_phones')[_0x5d5e('0x37')](['CmHopperId',_0x5d5e('0x13'),_0x5d5e('0x4f'),_0x5d5e('0x3a'),'updatedAt'],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x5374b4)[_0x5d5e('0x14')](_0x5d5e('0x36'))[_0x5d5e('0x15')]('cm_contacts',null,_0x5d5e('0x50'))[_0x5d5e('0x15')](_0x5d5e('0x51'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x5d5e('0x52'),_0x41692e)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x5d5e('0x45')]();}function insertCmContact(_0x29e56a,_0xcf10a7,_0x1a51ef,_0x447384){var _0x2bc691=_['concat'](_[_0x5d5e('0x53')](_0x447384),[_0x5d5e('0x39'),_0x5d5e('0x54'),_0x5d5e('0x3a'),_0x5d5e('0x3b')]);return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')]('cm_contacts')[_0x5d5e('0x37')](_0x2bc691,squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x2bc691)[_0x5d5e('0x14')](_0xcf10a7)[_0x5d5e('0x17')]('('+_0x1a51ef[_0x5d5e('0x15')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x1a51ef)[_0x5d5e('0x14')](_0x5d5e('0x48'))[_0x5d5e('0x17')](_0x5d5e('0x4a'),_0x29e56a))[_0x5d5e('0x17')](_0x5d5e('0x55'),squel['select']()[_0x5d5e('0x12')]('MIN(id)',_0x5d5e('0x56'))[_0x5d5e('0x14')](_0xcf10a7)[_0x5d5e('0x57')](_0x1a51ef['join'](','))))[_0x5d5e('0x45')]();}function handleStop(){logger[_0x5d5e('0x58')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2fd456){logger['error'](_0x2fd456[_0x5d5e('0x22')]);process['exit'](0x1);}function handleError(_0xe1c70e,_0x37efaf){stats['errors'][_0x5d5e('0x1e')]({'name':_0x37efaf['code'],'message':_0x37efaf[_0x5d5e('0x22')],'row':_0xe1c70e});}function handleQuery(_0x34d0ee){logger[_0x5d5e('0x58')](_0x34d0ee);return db[_0x5d5e('0x59')][_0x5d5e('0x1a')](_0x34d0ee)['spread'](function(_0x574942){results[_0x5d5e('0x1e')](_0x574942);})[_0x5d5e('0x5a')](function(_0x33eba4){logger['error'](_0x33eba4[_0x5d5e('0x22')]);});}function main(_0x5d1e53,_0xb7c2cc,_0x181aea,_0x16f0c3){logger[_0x5d5e('0x58')](_0x5d5e('0x5b'),_0x5d1e53,JSON['stringify'](_0xb7c2cc));process[_0x5d5e('0x5c')](_0x5d5e('0x5d'));var _0x669efa=_0xb7c2cc[_0x5d5e('0x5e')];var _0x3a5656=_['clone'](_0x669efa);var _0x3f0e16=_0xb7c2cc[_0x5d5e('0x5f')];var _0x459a0c=path[_0x5d5e('0x15')](config[_0x5d5e('0x60')],_0x5d5e('0x61'),_0x3f0e16+_0x5d5e('0x62'));logger['info'](_0x5d5e('0x63'),_0xb7c2cc);db['ContactItemType'][_0x5d5e('0x64')]({'raw':!![],'attributes':['id','name']})[_0x5d5e('0x20')](function(_0x3e7ecc){for(var _0x3c038d=0x0;_0x3c038d<_0x3e7ecc[_0x5d5e('0x1b')];_0x3c038d++){if(_0x3e7ecc[_0x3c038d][_0x5d5e('0x65')]in _0x669efa){contactItemTypes[_0x5d5e('0x1e')](_0x3e7ecc[_0x3c038d]);delete _0x3a5656[_0x3e7ecc[_0x3c038d]['name']];hasAdditionalPhones=!![];}for(var _0x31e847 in _0x669efa){if(_0x3e7ecc[_0x3c038d][_0x5d5e('0x65')]+_0x5d5e('0x66')===_0x31e847){phoneDescriptions[_0x5d5e('0x1e')]({'itemTypeId':_0x3e7ecc[_0x3c038d]['id'],'description':_0x31e847});delete _0x3a5656[_0x31e847];}}}if(hasAdditionalPhones)_0x3a5656[_0x5d5e('0x1d')]='';var _0x13f5e8=_[_0x5d5e('0x53')](_0x3a5656)[_0x5d5e('0x15')]();logger[_0x5d5e('0x58')](_0x5d5e('0x67'),_0x13f5e8);fs[_0x5d5e('0x68')](_0x459a0c,_0x13f5e8+'\x0a');Papa[_0x5d5e('0x69')](fs[_0x5d5e('0x6a')](_0x5d1e53),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e0994,_0x4ff0a4){try{for(var _0x29130b=0x0,_0x5155c0=[];_0x29130b<_0x5e0994[_0x5d5e('0x6b')][_0x5d5e('0x1b')];_0x29130b++){stats[_0x5d5e('0x6c')]+=0x1;if(_0x5e0994[_0x5d5e('0x6d')][_0x29130b]){handleError(_0x5e0994['data'][_0x29130b],_0x5e0994[_0x5d5e('0x6d')][_0x29130b]);}else{var _0x1e47d5=[];var _0xe2e969=[];var _0x229c63={};for(var _0x5def9a in _0x669efa){let _0x375ffb=contactItemTypes[_0x5d5e('0x6e')](_0x5d85c7=>_0x5d85c7[_0x5d5e('0x65')]===_0x5def9a);let _0x2e00d4=contactItemTypes[_0x5d5e('0x6e')](_0x56f08=>_0x56f08[_0x5d5e('0x65')]+_0x5d5e('0x66')===_0x5def9a);if(_[_0x5d5e('0x1c')](_0x375ffb)&&_[_0x5d5e('0x1c')](_0x2e00d4)){if(_0x669efa['hasOwnProperty'](_0x5def9a)){if(_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x5def9a]]){var _0x3e2ffc=_[_0x5d5e('0x6f')](_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x5def9a]][_0x5d5e('0x70')](/"/g,'\x27'));switch(_0x5def9a){case _0x5d5e('0x38'):var _0x4b1486=moment(_0x3e2ffc,_0x5d5e('0xe'),!![]);if(_0x4b1486[_0x5d5e('0x71')]()){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x2fbf80=parseInt(_0x3e2ffc);_0x3e2ffc=_['isNaN'](_0x2fbf80)||_0x2fbf80<0x0||_0x2fbf80>0x4?_0x16f0c3?0x3:0x2:_0x2fbf80;_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');break;case _0x5d5e('0x3d'):var _0xce6be6=parseInt(_0x3e2ffc);if(_['isNumber'](_0xce6be6)&&_[_0x5d5e('0x72')](_0x181aea,_0xce6be6)){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0xce6be6+'\x22');}else{_0x1e47d5['push'](_0x5d5e('0x73'));}break;case _0x5d5e('0x74'):if(isEmail(_0x3e2ffc)){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')](_0x5d5e('0x75'));}break;case'dateOfBirth':var _0x3fa6dc=moment(_0x3e2ffc,_0x5d5e('0x76'),!![]);if(_0x3fa6dc[_0x5d5e('0x71')]()){_0x5155c0['push']('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')](_0x5d5e('0x77'));}break;default:_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}}else{switch(_0x5def9a){case'firstName':case _0x5d5e('0x13'):_0x1e47d5[_0x5d5e('0x1e')](_0x5def9a+_0x5d5e('0x78'));break;default:_0x5155c0['push']('\x22\x22');}}}}else{var _0x4b5c33='';if(!_['isNil'](_0x375ffb)){if(!_0x229c63[_0x5d5e('0x79')](_0x375ffb['id'])){for(var _0x193b4a=0x0;_0x193b4a<_0x669efa[_0x5def9a]['length'];_0x193b4a++){var _0x3e2ffc=_[_0x5d5e('0x6f')](_0x5e0994['data'][_0x29130b][_0x669efa[_0x5def9a][_0x193b4a]][_0x5d5e('0x70')](/"/g,'\x27'));var _0x10ef0d=phoneDescriptions[_0x5d5e('0x6e')](_0x216f8b=>_0x216f8b['itemTypeId']===_0x375ffb['id']);if(!_[_0x5d5e('0x1c')](_0x10ef0d)){var _0x362629=_['trim'](_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x10ef0d[_0x5d5e('0x7a')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x5d5e('0x1c')](_0x362629))_0x3e2ffc=_0x3e2ffc+'§'+_0x362629;}if(_0x4b5c33=='')_0x4b5c33=_0x3e2ffc;else _0x4b5c33+='|'+_0x3e2ffc;}_0xe2e969[_0x5d5e('0x1e')](_0x375ffb['id']+':'+_0x4b5c33);_0x229c63[_0x375ffb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0xe2e969[_0x5d5e('0x15')](';')+'\x22');}if(_0x1e47d5[_0x5d5e('0x1b')]){handleError(_0x5e0994[_0x5d5e('0x6b')][_0x29130b],{'code':_0x5d5e('0x7b'),'message':_0x1e47d5[_0x5d5e('0x15')]()});}else{fs[_0x5d5e('0x7c')](_0x459a0c,_0x5155c0[_0x5d5e('0x15')]()+'\x0a');}_0x5155c0=[];}if(!(stats['rows']%0xc8)){socket[_0x5d5e('0x7d')](_0x5d5e('0x7e')+_0x3f0e16,stats);stats['errors']=[];}}if(stopped){logger[_0x5d5e('0x58')](_0x5d5e('0x7f'));_0x4ff0a4[_0x5d5e('0x80')]();}}catch(_0x164cb8){handleError(_0x5e0994[_0x5d5e('0x6b')][_0x29130b],{'code':_0x5d5e('0x81'),'message':_0x164cb8[_0x5d5e('0x22')]});logger[_0x5d5e('0x21')](_0x5d5e('0x82'),_0x164cb8[_0x5d5e('0x22')]);}},'complete':function(){try{var _0xe025cc=[];var _0xce4d59=tempTableName;_0xe025cc[_0x5d5e('0x1e')]('CREATE\x20TABLE\x20'+_0xce4d59+_0x5d5e('0x83'));logger[_0x5d5e('0x58')](_0x5d5e('0x84'),contactItemTypes[_0x5d5e('0x1b')]);var _0x2f749f=util['format'](_0x5d5e('0x85'),_0x459a0c,_0xce4d59,_0x13f5e8,_0xb7c2cc[_0x5d5e('0x39')],_0xb7c2cc['CompanyId']||null,NOW,NOW);if(_[_0x5d5e('0x1c')](_0x669efa['scheduledat'])){_0x2f749f+=_0x5d5e('0x86');}_0xe025cc[_0x5d5e('0x1e')](_0x2f749f);BPromise['each'](_0xe025cc,handleQuery)[_0x5d5e('0x20')](function(_0x136fb6){BPromise['all']([handleAdditionalPhones()])[_0x5d5e('0x20')](function(){_0xe025cc=[];for(var _0x75732d=0x0;_0x75732d\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','isEmpty','t.id\x20IN\x20?','query','exports','lodash','squel','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','ui.','left_join','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','me.','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','isEmail','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','start','end','unreadMessages','value','read','and','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','split'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x180f,0xf3));var _0xf180=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x180f[_0x458363];return _0x4d0290;};'use strict';var _=require(_0xf180('0x0'));var squel=require(_0xf180('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xf180('0x2'));var updateInteraction=require(_0xf180('0x3'))['updateInteraction'];var utils=require(_0xf180('0x4'));var db=require(_0xf180('0x5'))['db'];function skipInteractionsQuery(_0x472213,_0x39895a,_0x10b776){var _0x5f269f=![];var _0x2ef675=utils[_0xf180('0x6')](_0x472213);if(_0x39895a['role']==='agent'&&!_0x10b776[_0xf180('0x7')]&&!_0x10b776[_0x2ef675]){_0x5f269f=!![];}return _0x5f269f;}function getTagsQuery(){return squel[_0xf180('0x8')]()[_0xf180('0x9')]('id')[_0xf180('0x9')](_0xf180('0xa'))[_0xf180('0x9')](_0xf180('0xb'))[_0xf180('0xc')](_0xf180('0xd'));}function getUsersQuery(_0x5a242b,_0x43d390){var _0x460472=utils[_0xf180('0xe')](_0x5a242b);var _0x18bde3=_0xf180('0xf')+_0x5a242b+_0xf180('0x10');var _0x422e7e=squel[_0xf180('0x8')]()[_0xf180('0x9')](_0xf180('0x11'))[_0xf180('0x9')]('u.fullname')[_0xf180('0x9')](_0xf180('0x12')+_0x460472)[_0xf180('0xc')](_0x18bde3,'ui')[_0xf180('0x13')]('users','u',_0xf180('0x14'));if(_0x43d390[_0xf180('0x15')]>0x0){_0x422e7e[_0xf180('0x16')]('ui.'+_0x460472+_0xf180('0x17'),_[_0xf180('0x18')](_0x43d390,'id'));}return _0x422e7e;}function getInteractionsQuery(_0x496e65){var _0x115b86=utils[_0xf180('0x19')](_0x496e65);var _0x492c22=utils[_0xf180('0x6')](_0x496e65);var _0x14ddc6=utils[_0xf180('0xe')](_0x496e65);return squel[_0xf180('0x8')]()[_0xf180('0xc')](_0x115b86[_0xf180('0x1a')],'i')[_0xf180('0x13')](_0xf180('0x1b'),'c',_0xf180('0x1c'))[_0xf180('0x13')](_0xf180('0x1d'),'o',_0xf180('0x1e'))[_0xf180('0x13')](_0x115b86['accounts'],'a',_0xf180('0x1f')+_0x492c22)[_0xf180('0x13')](_0x115b86['messages'],'me',_0xf180('0x20')+_0x14ddc6+'\x20=\x20i.id')[_0xf180('0x13')](_0x115b86['interactionsTags'],'it',_0xf180('0x21')+_0x14ddc6+_0xf180('0x22'))['left_join']('tools_tags','t',_0xf180('0x23'));}function getSqlClauses(){var _0x932e29={'body':squel['expr'](),'contact':squel[_0xf180('0x24')](),'default':squel[_0xf180('0x24')](),'fields':squel[_0xf180('0x24')](),'filter':squel[_0xf180('0x24')](),'read':squel[_0xf180('0x24')](),'tags':{'clause':squel[_0xf180('0x24')](),'ids':null},'user':squel[_0xf180('0x24')]()};return _0x932e29;}function parseTagParameter(_0x806b84){var _0x3d20bc=squel[_0xf180('0x24')]();if(_0x806b84){var _0x4ff4f9=utils[_0xf180('0x25')](_0x806b84);_0x4ff4f9[_0xf180('0x26')](function(_0x151b90){_0x3d20bc['or'](_0xf180('0x27'),'%,'+_0x151b90+',%');});}return _0x3d20bc;}function parseReadParameter(_0x37379c){var _0x2aeee4='';if(_0x37379c){_0x2aeee4=_0xf180('0x28');if(_0x37379c==='1'){_0x2aeee4=_0x2aeee4[_0xf180('0x29')](_0xf180('0x2a'),'=');}else{_0x2aeee4=_0x2aeee4[_0xf180('0x29')]('{OPERATOR}','>');}}return _0x2aeee4;}function parseSearchFilter(_0x323482,_0xe9a66b){var _0x3dc187=squel[_0xf180('0x24')]();if(_0xe9a66b){var _0x466895=_0xe9a66b[_0xf180('0x29')]('\x5c','\x5c\x5c')[_0xf180('0x29')](/'/g,'\x27\x27');if(qs[_0xf180('0x2b')](_0x466895)){_0x3dc187['or'](_0xf180('0x2c'),_0x466895+'%');if([_0xf180('0x2d'),_0xf180('0x2e')][_0xf180('0x2f')](_0x323482)){_0x3dc187['or'](_0xf180('0x30'),_0x466895+'%');}else if(_0x323482===_0xf180('0x31')){_0x3dc187['or']('i.fax\x20LIKE\x20?',_0x466895+'%');}else if(_0x323482===_0xf180('0x32')){_0x3dc187['or'](_0xf180('0x33'),_0x466895+'%');}}else if(_0x323482==='mail'&&qs[_0xf180('0x34')](_0x466895)){_0x3dc187['or']('c.email\x20LIKE\x20?',_0x466895+'%');}else{if(_0x323482===_0xf180('0x35')){_0x3dc187['or'](_0xf180('0x36'),qs[_0xf180('0x37')](_0x466895))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf180('0x37')](_0x466895));}else{if(_0x323482!==_0xf180('0x31')){_0x3dc187['or'](_0xf180('0x38'),qs[_0xf180('0x37')](_0x466895));}_0x3dc187['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x466895+'%');}}}return _0x3dc187;}function parseAdvancedSearchFilter(_0xc5ec8a,_0x217813){var _0x438d2c=getSqlClauses();var _0x2e8830=as[_0xf180('0x39')](_0xc5ec8a);var _0xc73271=_0x2e8830[_0xf180('0x3a')];for(var _0x1eb817=0x0;_0x1eb817<_0x2e8830[_0xf180('0x3b')][_0xf180('0x15')];_0x1eb817++){var _0x50d5c5=_0x2e8830[_0xf180('0x3b')][_0x1eb817];var _0x4ac1b1='i';var _0x553587=_[_0xf180('0x3c')](_0x217813,['name',_0x50d5c5['field']]);if(_0x553587){var _0x3f8313=as[_0xf180('0x3d')](_0x4ac1b1,_0x553587[_0xf180('0x3e')],_0x50d5c5);_0x438d2c[_0xf180('0x3f')][_0xc73271](_0x3f8313['text'],_0x3f8313['value'][_0xf180('0x40')],_0x3f8313['value'][_0xf180('0x41')]);}else{switch(_0x50d5c5['field']){case _0xf180('0x42'):var _0x2c2a1f=parseReadParameter(_0x50d5c5[_0xf180('0x43')]);_0x438d2c[_0xf180('0x44')][_0xf180('0x45')](_0x2c2a1f);break;case _0xf180('0x46'):if(_0x50d5c5[_0xf180('0x47')]===_0xf180('0x48')){if(_0x50d5c5[_0xf180('0x43')]['split']('\x20')[_0xf180('0x15')]>0x1){_0x438d2c[_0xf180('0x49')][_0xc73271]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf180('0x37')](_0x50d5c5[_0xf180('0x43')]),null);}else{var _0x38ba6d='%'+_0x50d5c5[_0xf180('0x43')]+'%';_0x438d2c['contact'][_0xc73271](_0xf180('0x4a'),_0x38ba6d,_0x38ba6d,_0x38ba6d);}}else{_0x553587=_['find'](_0x217813,[_0xf180('0xa'),_0xf180('0x4b')]);_0x50d5c5[_0xf180('0x9')]=_0xf180('0x4b');_0x3f8313=as['buildExpression'](_0x4ac1b1,_0x553587['type'],_0x50d5c5);_0x438d2c[_0xf180('0x49')][_0xc73271](_0x3f8313[_0xf180('0x4c')],_0x3f8313[_0xf180('0x43')][_0xf180('0x40')],_0x3f8313[_0xf180('0x43')][_0xf180('0x41')]);}break;case _0xf180('0x4d'):var _0x2cf9c1=_0x50d5c5[_0xf180('0x43')][_0xf180('0x4e')](',')['map'](function(_0x1c4821){return Number(_0x1c4821);});var _0x5311c6=parseTagParameter(_0x2cf9c1);_0x438d2c[_0xf180('0x4f')][_0xf180('0x50')][_0xf180('0x45')](_0x5311c6);_0x438d2c['tags'][_0xf180('0x51')]=_0x2cf9c1;break;case _0xf180('0x52'):if(_0x50d5c5['operator']===_0xf180('0x48')){_0x438d2c[_0xf180('0x53')][_0xc73271](_0xf180('0x54'),'%'+_0x50d5c5[_0xf180('0x43')]+'%',null);}else{_0x553587=_[_0xf180('0x3c')](_0x217813,[_0xf180('0xa'),_0xf180('0x55')]);_0x50d5c5[_0xf180('0x9')]=_0xf180('0x55');_0x3f8313=as[_0xf180('0x3d')](_0x4ac1b1,_0x553587[_0xf180('0x3e')],_0x50d5c5);_0x438d2c[_0xf180('0x53')][_0xc73271](_0x3f8313[_0xf180('0x4c')],_0x3f8313[_0xf180('0x43')][_0xf180('0x40')],_0x3f8313[_0xf180('0x43')][_0xf180('0x41')]);}break;case _0xf180('0x56'):case _0xf180('0x57'):_0x3f8313=as[_0xf180('0x3d')]('me',null,_0x50d5c5);_0x438d2c['body'][_0xc73271](_0x3f8313['text'],_0x3f8313[_0xf180('0x43')][_0xf180('0x40')],_0x3f8313[_0xf180('0x43')][_0xf180('0x41')]);break;}}}return _0x438d2c;}function parseModelFields(_0x1915b4,_0x30e469,_0x1acc63){var _0x177c6d=utils[_0xf180('0x6')](_0x1915b4);var _0x441e90=squel[_0xf180('0x24')]();var _0x16bc09=_(_0x30e469)[_0xf180('0x58')]()[_0xf180('0x18')](function(_0x42c9dd){return _['some'](_0x1acc63,[_0xf180('0xa'),_0x42c9dd])?_0x42c9dd:undefined;})[_0xf180('0x59')]()['value']();if(_0x16bc09[_0xf180('0x15')]>0x0){_0x16bc09[_0xf180('0x26')](function(_0x4379af){if(_0x4379af===_0x177c6d){_0x441e90[_0xf180('0x45')]('i.'+_0x177c6d+_0xf180('0x17'),[][_0xf180('0x5a')](_0x30e469[_0x4379af]));}else if(_0x4379af===_0xf180('0x5b')){var _0x639114=JSON[_0xf180('0x5c')](_0x30e469[_0x4379af])[_0xf180('0x5d')];var _0x1e2be5=JSON[_0xf180('0x5c')](_0x30e469[_0x4379af])['$lte'];_0x441e90[_0xf180('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x639114,_0x1e2be5);}else{if(_0x30e469[_0x4379af]===_0xf180('0x5e')){_0x441e90['and']('i.'+_0x4379af+'\x20IS\x20NULL');}else{_0x441e90['and']('i.'+_0x4379af+'\x20=\x20?',_0x30e469[_0x4379af]);}}});}return _0x441e90;}function parseQueryParameters(_0x225c82,_0x3e0e1a,_0x579d14){var _0x242c69=getSqlClauses();return Promise[_0xf180('0x5f')]()['then'](function(){return parseModelFields(_0x225c82,_0x3e0e1a,_0x579d14);})[_0xf180('0x60')](function(_0x5b4f70){_0x242c69['fields']['and'](_0x5b4f70);return parseReadParameter(_0x3e0e1a[_0xf180('0x44')]);})[_0xf180('0x60')](function(_0x26a748){_0x242c69['read'][_0xf180('0x45')](_0x26a748);return parseTagParameter(_0x3e0e1a[_0xf180('0x61')]);})[_0xf180('0x60')](function(_0x44f63){_0x242c69[_0xf180('0x4f')]['clause'][_0xf180('0x45')](_0x44f63);return parseSearchFilter(_0x225c82,_0x3e0e1a[_0xf180('0x62')]);})['then'](function(_0x2f4899){_0x242c69[_0xf180('0x62')]=_0x2f4899;return _0x242c69;});}function checkAccountsRestrictions(_0x2d3ce7,_0xfaaa96,_0x20077a){var _0x516365=utils[_0xf180('0x6')](_0x2d3ce7);var _0x3edc18=_0xf180('0x63')+_[_0xf180('0x64')](_0x2d3ce7)+(_0x2d3ce7==='chat'?_0xf180('0x65'):_0xf180('0x66'));var _0x35897=squel[_0xf180('0x24')]();return Promise[_0xf180('0x5f')]()['then'](function(){if(_0x20077a[_0xf180('0x7')]&&_0xfaaa96['role']===_0xf180('0x67')){return _0xfaaa96[_0x3edc18]({'attributes':['id'],'raw':!![]});}})[_0xf180('0x60')](function(_0x496b94){if(_0x496b94){if(_0x496b94['length']===0x0){_0x35897['and']('i.'+_0x516365+_0xf180('0x68'));}else{_0x35897[_0xf180('0x45')]('i.'+_0x516365+_0xf180('0x17'),_[_0xf180('0x18')](_0x496b94,'id'));}}else if(!_0x20077a[_0x516365]){_0x35897[_0xf180('0x45')]('i.'+_0x516365+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x35897;});}function getClosedOrderClause(_0x343e3f,_0x4e8f46){var _0x348984='';var _0xdb28d=[_0xf180('0x69'),_0xf180('0x6a'),_0xf180('0x6b')];if(_0x343e3f===_0xf180('0x35')){_0xdb28d[_0xf180('0x6c')]('i.substatus');}if(_0x4e8f46[_0xf180('0x6d')]==='0'&&_0x343e3f===_0xf180('0x35')){_0x348984=_0xf180('0x6e');}else{if(_0x4e8f46['closed']==='1'){_0xdb28d[_0xf180('0x6f')]();}_0x348984=_0xf180('0x70')+_0xdb28d[_0xf180('0x71')](',\x20')+')';}return _0x348984;}function getFilteredInteractions(_0x5874aa,_0x31fc7e,_0x4269e2,_0x41fde4){var _0x321136=utils[_0xf180('0xe')](_0x5874aa);var _0x523d14=_[_0xf180('0x64')](_0x5874aa)+_0xf180('0x72');var _0x2ff5d1=[];var _0x5841b0=getTagsQuery();var _0x1ff9a1={'type':db[_0xf180('0x73')]['QueryTypes'][_0xf180('0x74')],'raw':!![]};var _0x4bd8b6=[];var _0x4157be=[];return db[_0xf180('0x75')]['query'](_0x5841b0[_0xf180('0x76')](),_0x1ff9a1)[_0xf180('0x60')](function(_0x2ac72b){_0x2ff5d1=_[_0xf180('0x77')](_0x2ac72b,'id');_0x1ff9a1=_[_0xf180('0x78')](_0x1ff9a1,{'model':db[_0x523d14],'mapToModel':!![],'nest':!![]});if(_0x4269e2[_0xf180('0x79')]){_0x41fde4['attributes']['forEach'](function(_0xfa796a){_0x31fc7e[_0xf180('0x9')]('i.'+_0xfa796a);});}else{_0x31fc7e[_0xf180('0x9')](_0xf180('0x7a'),_0xf180('0x42'));_0x31fc7e[_0xf180('0x9')]('a.key',_0xf180('0x7b'));_0x31fc7e[_0xf180('0x9')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x5874aa===_0xf180('0x35')){_0x31fc7e['field']('a.email','Account.email');_0x31fc7e[_0xf180('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x31fc7e[_0xf180('0x9')](_0xf180('0x7c'));_0x31fc7e['field'](_0xf180('0x7d'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x7e'));_0x31fc7e['field'](_0xf180('0x7f'));_0x31fc7e[_0xf180('0x9')]('i.closedAt');_0x31fc7e[_0xf180('0x9')]('i.attach');_0x31fc7e[_0xf180('0x9')](_0xf180('0x80'));_0x31fc7e['field']('i.lastMsgDirection');_0x31fc7e[_0xf180('0x9')](_0xf180('0x81'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x6b'));_0x31fc7e[_0xf180('0x9')]('i.secondDisposition');_0x31fc7e['field'](_0xf180('0x69'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x6e'));_0x31fc7e['field']('i.to');_0x31fc7e[_0xf180('0x9')]('i.ContactId');_0x31fc7e[_0xf180('0x9')](_0xf180('0x82'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x83'));}else if(_0x5874aa==='openchannel'){_0x31fc7e[_0xf180('0x9')](_0xf180('0x84'),_0xf180('0x85'));}else{_0x31fc7e[_0xf180('0x9')](_0xf180('0x86'),_0xf180('0x85'));}if(_0x5874aa!=='mail'){_0x31fc7e[_0xf180('0x9')](_0xf180('0x87'));}_0x31fc7e[_0xf180('0x9')](_0xf180('0x88'),_0xf180('0x89'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x8a'),_0xf180('0x8b'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x8c'),'Contact.email');_0x31fc7e[_0xf180('0x9')](_0xf180('0x8d'),_0xf180('0x8e'));_0x31fc7e[_0xf180('0x9')]('c.mobile','Contact.mobile');_0x31fc7e[_0xf180('0x9')](_0xf180('0x8f'),_0xf180('0x90'));_0x31fc7e['field'](_0xf180('0x91'),_0xf180('0x92'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x93'),_0xf180('0x94'));_0x31fc7e[_0xf180('0x9')](_0xf180('0x95'),_0xf180('0x96'));}if(_0x41fde4[_0xf180('0x97')]){_0x31fc7e[_0xf180('0x97')](_0x41fde4[_0xf180('0x97')]);}if(_0x41fde4[_0xf180('0x98')]){_0x31fc7e[_0xf180('0x98')](_0x41fde4[_0xf180('0x98')]);}return db[_0xf180('0x75')]['query'](_0x31fc7e[_0xf180('0x76')](),_0x1ff9a1);})[_0xf180('0x60')](function(_0x5f811){_0x4bd8b6=_0x5f811;var _0x504850=getUsersQuery(_0x5874aa,_0x4bd8b6);return db[_0xf180('0x75')]['query'](_0x504850[_0xf180('0x76')](),_0x1ff9a1);})['then'](function(_0x3116c0){_0x4157be=_['groupBy'](_0x3116c0,_0x321136);if(_0x5874aa===_0xf180('0x35')){return db[_0xf180('0x99')][_0xf180('0x9a')]({'attributes':[_0xf180('0x9b')],'raw':!![]});}})[_0xf180('0x60')](function(_0x19db8a){var _0x43c975=_0x19db8a?_0x19db8a[_0xf180('0x9b')]:undefined;var _0xb7f21=_0x4bd8b6[_0xf180('0x18')](function(_0x27f527){return updateInteraction(_0x27f527,_0x2ff5d1,_0x4157be,_0x43c975);});return Promise[_0xf180('0x9c')](_0xb7f21);});}function countFilteredInteractions(_0xd67b4d,_0x2e64ff){var _0x2ee13e=_0xd67b4d['clone']();_0x2ee13e[_0xf180('0x9')]('COUNT(*)');_0x2ee13e[_0xf180('0x9')](_0xf180('0x7a'),_0xf180('0x42'));var _0x34230b=utils[_0xf180('0x25')](_0x2e64ff);if(!_[_0xf180('0x9d')](_0x34230b)){_0x2ee13e[_0xf180('0x16')](_0xf180('0x9e'),_0x34230b);}var _0x280201={'type':db[_0xf180('0x73')]['QueryTypes'][_0xf180('0x74')],'raw':!![]};return db[_0xf180('0x75')][_0xf180('0x9f')](_0x2ee13e[_0xf180('0x76')](),_0x280201);}module[_0xf180('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x1d2d=['\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','join','Interaction','Sequelize','SELECT','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','Setting','enableEmailPreview','all','COUNT(*)','unreadMessages','isEmpty','t.id\x20IN\x20?','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','interactions','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','default','value','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','tags','clause','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','end','body','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x55fb86,_0x14fed1){_0x55fb86=_0x55fb86-0x0;var _0x283771=_0x1d2d[_0x55fb86];return _0x283771;};'use strict';var _=require(_0xd1d2('0x0'));var squel=require(_0xd1d2('0x1'));var as=require(_0xd1d2('0x2'));var qs=require(_0xd1d2('0x3'));var updateInteraction=require(_0xd1d2('0x4'))['updateInteraction'];var utils=require(_0xd1d2('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5d3fac,_0x3caa72,_0x2bfabc){var _0x9852c0=![];var _0x269613=utils[_0xd1d2('0x6')](_0x5d3fac);if(_0x3caa72[_0xd1d2('0x7')]==='agent'&&!_0x2bfabc[_0xd1d2('0x8')]&&!_0x2bfabc[_0x269613]){_0x9852c0=!![];}return _0x9852c0;}function getTagsQuery(){return squel[_0xd1d2('0x9')]()[_0xd1d2('0xa')]('id')[_0xd1d2('0xa')](_0xd1d2('0xb'))[_0xd1d2('0xa')](_0xd1d2('0xc'))[_0xd1d2('0xd')](_0xd1d2('0xe'));}function getUsersQuery(_0x353f9b,_0x900ec){var _0x227d7f=utils[_0xd1d2('0xf')](_0x353f9b);var _0x5b21f4=_0xd1d2('0x10')+_0x353f9b+_0xd1d2('0x11');var _0x3ae4ae=squel[_0xd1d2('0x9')]()[_0xd1d2('0xa')](_0xd1d2('0x12'))[_0xd1d2('0xa')](_0xd1d2('0x13'))[_0xd1d2('0xa')](_0xd1d2('0x14')+_0x227d7f)['from'](_0x5b21f4,'ui')[_0xd1d2('0x15')](_0xd1d2('0x16'),'u',_0xd1d2('0x17'));if(_0x900ec['length']>0x0){_0x3ae4ae[_0xd1d2('0x18')](_0xd1d2('0x14')+_0x227d7f+_0xd1d2('0x19'),_[_0xd1d2('0x1a')](_0x900ec,'id'));}return _0x3ae4ae;}function getInteractionsQuery(_0xecac1f){var _0x2723b3=utils[_0xd1d2('0x1b')](_0xecac1f);var _0x57f2f9=utils['getAccountFK'](_0xecac1f);var _0x3be186=utils['getInteractionFK'](_0xecac1f);return squel[_0xd1d2('0x9')]()[_0xd1d2('0xd')](_0x2723b3[_0xd1d2('0x1c')],'i')[_0xd1d2('0x15')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd1d2('0x15')]('users','o','o.id\x20=\x20i.UserId')[_0xd1d2('0x15')](_0x2723b3[_0xd1d2('0x1d')],'a',_0xd1d2('0x1e')+_0x57f2f9)[_0xd1d2('0x15')](_0x2723b3['messages'],'me',_0xd1d2('0x1f')+_0x3be186+_0xd1d2('0x20'))[_0xd1d2('0x15')](_0x2723b3['interactionsTags'],'it','it.'+_0x3be186+_0xd1d2('0x20'))[_0xd1d2('0x15')](_0xd1d2('0xe'),'t',_0xd1d2('0x21'));}function getSqlClauses(){var _0x3f229c={'body':squel[_0xd1d2('0x22')](),'contact':squel[_0xd1d2('0x22')](),'default':squel['expr'](),'fields':squel[_0xd1d2('0x22')](),'filter':squel[_0xd1d2('0x22')](),'read':squel[_0xd1d2('0x22')](),'tags':{'clause':squel[_0xd1d2('0x22')](),'ids':null},'user':squel[_0xd1d2('0x22')]()};return _0x3f229c;}function parseTagParameter(_0x39e991){var _0x28b8be=squel[_0xd1d2('0x22')]();if(_0x39e991){var _0xe6ef3c=utils[_0xd1d2('0x23')](_0x39e991);_0xe6ef3c[_0xd1d2('0x24')](function(_0x4e1bc2){_0x28b8be['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e1bc2+',%');});}return _0x28b8be;}function parseReadParameter(_0x133c6c){var _0x442375='';if(_0x133c6c){_0x442375=_0xd1d2('0x25');if(_0x133c6c==='1'){_0x442375=_0x442375[_0xd1d2('0x26')](_0xd1d2('0x27'),'=');}else{_0x442375=_0x442375['replace'](_0xd1d2('0x27'),'>');}}return _0x442375;}function parseSearchFilter(_0x41171c,_0x383947){var _0x4b4134=squel[_0xd1d2('0x22')]();if(_0x383947){var _0x1db17f=_0x383947[_0xd1d2('0x26')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd1d2('0x28')](_0x1db17f)){_0x4b4134['or'](_0xd1d2('0x29'),_0x1db17f+'%');if([_0xd1d2('0x2a'),_0xd1d2('0x2b')][_0xd1d2('0x2c')](_0x41171c)){_0x4b4134['or'](_0xd1d2('0x2d'),_0x1db17f+'%');}else if(_0x41171c===_0xd1d2('0x2e')){_0x4b4134['or'](_0xd1d2('0x2f'),_0x1db17f+'%');}else if(_0x41171c===_0xd1d2('0x30')){_0x4b4134['or'](_0xd1d2('0x31'),_0x1db17f+'%');}}else if(_0x41171c===_0xd1d2('0x32')&&qs[_0xd1d2('0x33')](_0x1db17f)){_0x4b4134['or'](_0xd1d2('0x34'),_0x1db17f+'%');}else{if(_0x41171c===_0xd1d2('0x32')){_0x4b4134['or'](_0xd1d2('0x35'),qs[_0xd1d2('0x36')](_0x1db17f))['or'](_0xd1d2('0x37'),qs[_0xd1d2('0x36')](_0x1db17f));}else{if(_0x41171c!=='fax'){_0x4b4134['or'](_0xd1d2('0x38'),qs[_0xd1d2('0x36')](_0x1db17f));}_0x4b4134['or'](_0xd1d2('0x39'),_0x1db17f+'%');}}}return _0x4b4134;}function parseAdvancedSearchFilter(_0x573d27,_0x2ded64){var _0x516049=getSqlClauses();var _0x57a7fb=as[_0xd1d2('0x3a')](_0x573d27);var _0x103c5f=_0x57a7fb[_0xd1d2('0x3b')];for(var _0x1d00e0=0x0;_0x1d00e0<_0x57a7fb[_0xd1d2('0x3c')][_0xd1d2('0x3d')];_0x1d00e0++){var _0x56f48e=_0x57a7fb[_0xd1d2('0x3c')][_0x1d00e0];var _0x168eb8='i';var _0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),_0x56f48e[_0xd1d2('0xa')]]);if(_0x5bdf40){var _0x2f55a1=as['buildExpression'](_0x168eb8,_0x5bdf40['type'],_0x56f48e);_0x516049[_0xd1d2('0x3f')][_0x103c5f](_0x2f55a1['text'],_0x2f55a1['value']['start'],_0x2f55a1[_0xd1d2('0x40')]['end']);}else{switch(_0x56f48e[_0xd1d2('0xa')]){case'unreadMessages':var _0x47996a=parseReadParameter(_0x56f48e['value']);_0x516049[_0xd1d2('0x41')][_0xd1d2('0x42')](_0x47996a);break;case _0xd1d2('0x43'):if(_0x56f48e[_0xd1d2('0x44')]===_0xd1d2('0x45')){if(_0x56f48e[_0xd1d2('0x40')][_0xd1d2('0x46')]('\x20')[_0xd1d2('0x3d')]>0x1){_0x516049[_0xd1d2('0x47')][_0x103c5f](_0xd1d2('0x48'),qs[_0xd1d2('0x36')](_0x56f48e[_0xd1d2('0x40')]),null);}else{var _0x1c2835='%'+_0x56f48e[_0xd1d2('0x40')]+'%';_0x516049['contact'][_0x103c5f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1c2835,_0x1c2835,_0x1c2835);}}else{_0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),_0xd1d2('0x49')]);_0x56f48e['field']='ContactId';_0x2f55a1=as[_0xd1d2('0x4a')](_0x168eb8,_0x5bdf40[_0xd1d2('0x4b')],_0x56f48e);_0x516049['contact'][_0x103c5f](_0x2f55a1[_0xd1d2('0x4c')],_0x2f55a1['value']['start'],_0x2f55a1[_0xd1d2('0x40')]['end']);}break;case'Tag':var _0x1825f2=_0x56f48e[_0xd1d2('0x40')][_0xd1d2('0x46')](',')['map'](function(_0x2ba87b){return Number(_0x2ba87b);});var _0x192fa4=parseTagParameter(_0x1825f2);_0x516049[_0xd1d2('0x4d')][_0xd1d2('0x4e')]['and'](_0x192fa4);_0x516049[_0xd1d2('0x4d')][_0xd1d2('0x4f')]=_0x1825f2;break;case'User':if(_0x56f48e[_0xd1d2('0x44')]==='$substring'){_0x516049[_0xd1d2('0x50')][_0x103c5f](_0xd1d2('0x51'),'%'+_0x56f48e[_0xd1d2('0x40')]+'%',null);}else{_0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),'UserId']);_0x56f48e['field']=_0xd1d2('0x52');_0x2f55a1=as[_0xd1d2('0x4a')](_0x168eb8,_0x5bdf40['type'],_0x56f48e);_0x516049[_0xd1d2('0x50')][_0x103c5f](_0x2f55a1[_0xd1d2('0x4c')],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x53')],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x54')]);}break;case _0xd1d2('0x55'):case'plainBody':_0x2f55a1=as[_0xd1d2('0x4a')]('me',null,_0x56f48e);_0x516049[_0xd1d2('0x55')][_0x103c5f](_0x2f55a1['text'],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x53')],_0x2f55a1['value']['end']);break;}}}return _0x516049;}function parseModelFields(_0x3d4fe3,_0x182ea8,_0x4cb376){var _0x21fdfb=utils[_0xd1d2('0x6')](_0x3d4fe3);var _0x2553df=squel[_0xd1d2('0x22')]();var _0x404ad2=_(_0x182ea8)['keys']()['map'](function(_0x314af3){return _['some'](_0x4cb376,[_0xd1d2('0xb'),_0x314af3])?_0x314af3:undefined;})[_0xd1d2('0x56')]()['value']();if(_0x404ad2[_0xd1d2('0x3d')]>0x0){_0x404ad2[_0xd1d2('0x24')](function(_0x4e780c){if(_0x4e780c===_0x21fdfb){_0x2553df['and']('i.'+_0x21fdfb+_0xd1d2('0x19'),[][_0xd1d2('0x57')](_0x182ea8[_0x4e780c]));}else if(_0x4e780c===_0xd1d2('0x58')){var _0xfd8024=JSON[_0xd1d2('0x59')](_0x182ea8[_0x4e780c])[_0xd1d2('0x5a')];var _0x1f6150=JSON[_0xd1d2('0x59')](_0x182ea8[_0x4e780c])[_0xd1d2('0x5b')];_0x2553df['and'](_0xd1d2('0x5c'),_0xfd8024,_0x1f6150);}else{if(_0x182ea8[_0x4e780c]==='null'){_0x2553df['and']('i.'+_0x4e780c+_0xd1d2('0x5d'));}else{_0x2553df[_0xd1d2('0x42')]('i.'+_0x4e780c+_0xd1d2('0x5e'),_0x182ea8[_0x4e780c]);}}});}return _0x2553df;}function parseQueryParameters(_0x47417f,_0x215dea,_0x459209){var _0x35a51b=getSqlClauses();return Promise[_0xd1d2('0x5f')]()[_0xd1d2('0x60')](function(){return parseModelFields(_0x47417f,_0x215dea,_0x459209);})[_0xd1d2('0x60')](function(_0x28173a){_0x35a51b[_0xd1d2('0x61')][_0xd1d2('0x42')](_0x28173a);return parseReadParameter(_0x215dea['read']);})['then'](function(_0x367f3c){_0x35a51b[_0xd1d2('0x41')][_0xd1d2('0x42')](_0x367f3c);return parseTagParameter(_0x215dea[_0xd1d2('0x62')]);})[_0xd1d2('0x60')](function(_0x1d1d31){_0x35a51b[_0xd1d2('0x4d')][_0xd1d2('0x4e')][_0xd1d2('0x42')](_0x1d1d31);return parseSearchFilter(_0x47417f,_0x215dea[_0xd1d2('0x63')]);})[_0xd1d2('0x60')](function(_0x54406e){_0x35a51b['filter']=_0x54406e;return _0x35a51b;});}function checkAccountsRestrictions(_0x306242,_0x321bc8,_0x3d1da1){var _0x1c6a46=utils['getAccountFK'](_0x306242);var _0x17e149=_0xd1d2('0x64')+_[_0xd1d2('0x65')](_0x306242)+(_0x306242===_0xd1d2('0x66')?_0xd1d2('0x67'):_0xd1d2('0x68'));var _0x1c04e4=squel['expr']();return Promise[_0xd1d2('0x5f')]()[_0xd1d2('0x60')](function(){if(_0x3d1da1[_0xd1d2('0x8')]&&_0x321bc8['role']==='agent'){return _0x321bc8[_0x17e149]({'attributes':['id'],'raw':!![]});}})[_0xd1d2('0x60')](function(_0x3cd7c7){if(_0x3cd7c7){if(_0x3cd7c7[_0xd1d2('0x3d')]===0x0){_0x1c04e4[_0xd1d2('0x42')]('i.'+_0x1c6a46+'\x20IS\x20NULL');}else{_0x1c04e4[_0xd1d2('0x42')]('i.'+_0x1c6a46+_0xd1d2('0x19'),_[_0xd1d2('0x1a')](_0x3cd7c7,'id'));}}else if(!_0x3d1da1[_0x1c6a46]){_0x1c04e4['and']('i.'+_0x1c6a46+_0xd1d2('0x69'));}})[_0xd1d2('0x60')](function(){return _0x1c04e4;});}function getClosedOrderClause(_0x4842f1,_0x69a9e2){var _0x3799b7='';var _0x12201f=[_0xd1d2('0x6a'),'i.secondDisposition',_0xd1d2('0x6b')];if(_0x4842f1===_0xd1d2('0x32')){_0x12201f[_0xd1d2('0x6c')](_0xd1d2('0x6d'));}if(_0x69a9e2[_0xd1d2('0x6e')]==='0'&&_0x4842f1==='mail'){_0x3799b7='i.substatus';}else{if(_0x69a9e2['closed']==='1'){_0x12201f['shift']();}_0x3799b7='CONCAT_WS(\x27\x27,\x20'+_0x12201f[_0xd1d2('0x6f')](',\x20')+')';}return _0x3799b7;}function getFilteredInteractions(_0x271e4a,_0x386b51,_0x5f5043,_0x42d6b8){var _0x17c4eb=utils[_0xd1d2('0xf')](_0x271e4a);var _0x580d83=_[_0xd1d2('0x65')](_0x271e4a)+_0xd1d2('0x70');var _0x47422d=[];var _0x4a42d9=getTagsQuery();var _0x43b43c={'type':db[_0xd1d2('0x71')]['QueryTypes'][_0xd1d2('0x72')],'raw':!![]};var _0x1c3c36=[];var _0x516a57=[];return db['sequelize'][_0xd1d2('0x73')](_0x4a42d9[_0xd1d2('0x74')](),_0x43b43c)[_0xd1d2('0x60')](function(_0x14cd07){_0x47422d=_['keyBy'](_0x14cd07,'id');_0x43b43c=_[_0xd1d2('0x75')](_0x43b43c,{'model':db[_0x580d83],'mapToModel':!![],'nest':!![]});if(_0x5f5043[_0xd1d2('0x61')]){_0x42d6b8[_0xd1d2('0x76')][_0xd1d2('0x24')](function(_0x5d537e){_0x386b51[_0xd1d2('0xa')]('i.'+_0x5d537e);});}else{_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x77'),'unreadMessages');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x78'),'Account.key');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x79'),_0xd1d2('0x7a'));if(_0x271e4a===_0xd1d2('0x32')){_0x386b51[_0xd1d2('0xa')]('a.email',_0xd1d2('0x7b'));_0x386b51['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x386b51['field'](_0xd1d2('0x7c'));_0x386b51['field'](_0xd1d2('0x7d'));_0x386b51['field'](_0xd1d2('0x7e'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x7f'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x80'));_0x386b51[_0xd1d2('0xa')]('i.attach');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x81'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x82'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x83'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x6b'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x84'));_0x386b51['field'](_0xd1d2('0x6a'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x6d'));_0x386b51[_0xd1d2('0xa')]('i.to');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x85'));_0x386b51[_0xd1d2('0xa')]('i.MailAccountId');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x86'));}else if(_0x271e4a==='openchannel'){_0x386b51['field'](_0xd1d2('0x87'),_0xd1d2('0x88'));}else{_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x89'),_0xd1d2('0x88'));}if(_0x271e4a!==_0xd1d2('0x32')){_0x386b51[_0xd1d2('0xa')]('i.*');}_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8a'),_0xd1d2('0x8b'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8c'),_0xd1d2('0x8d'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8e'),_0xd1d2('0x8f'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x90'),_0xd1d2('0x91'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x92'),'Contact.mobile');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x93'),_0xd1d2('0x94'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x95'),_0xd1d2('0x96'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x97'),_0xd1d2('0x98'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x99'),_0xd1d2('0x9a'));}if(_0x42d6b8[_0xd1d2('0x9b')]){_0x386b51['limit'](_0x42d6b8[_0xd1d2('0x9b')]);}if(_0x42d6b8[_0xd1d2('0x9c')]){_0x386b51[_0xd1d2('0x9c')](_0x42d6b8[_0xd1d2('0x9c')]);}return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x386b51[_0xd1d2('0x74')](),_0x43b43c);})[_0xd1d2('0x60')](function(_0x28a351){_0x1c3c36=_0x28a351;var _0x59c11a=getUsersQuery(_0x271e4a,_0x1c3c36);return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x59c11a['toString'](),_0x43b43c);})[_0xd1d2('0x60')](function(_0x234262){_0x516a57=_[_0xd1d2('0x9e')](_0x234262,_0x17c4eb);if(_0x271e4a===_0xd1d2('0x32')){return db[_0xd1d2('0x9f')]['findOne']({'attributes':[_0xd1d2('0xa0')],'raw':!![]});}})[_0xd1d2('0x60')](function(_0x2b4bb8){var _0x720693=_0x2b4bb8?_0x2b4bb8['enableEmailPreview']:undefined;var _0x68f8ba=_0x1c3c36[_0xd1d2('0x1a')](function(_0x3b7fc5){return updateInteraction(_0x3b7fc5,_0x47422d,_0x516a57,_0x720693);});return Promise[_0xd1d2('0xa1')](_0x68f8ba);});}function countFilteredInteractions(_0x39c9f1,_0x18bd6d){var _0x1aa0a5=_0x39c9f1['clone']();_0x1aa0a5[_0xd1d2('0xa')](_0xd1d2('0xa2'));_0x1aa0a5[_0xd1d2('0xa')](_0xd1d2('0x77'),_0xd1d2('0xa3'));var _0x30b8e7=utils[_0xd1d2('0x23')](_0x18bd6d);if(!_[_0xd1d2('0xa4')](_0x30b8e7)){_0x1aa0a5[_0xd1d2('0x18')](_0xd1d2('0xa5'),_0x30b8e7);}var _0x1cad85={'type':db[_0xd1d2('0x71')][_0xd1d2('0xa6')][_0xd1d2('0x72')],'raw':!![]};return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x1aa0a5[_0xd1d2('0x74')](),_0x1cad85);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index b8ad85e..7e98ff0 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2919=['then','lastMsgText','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','forEach','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','MailMessage','findOne','plainBody','-id'];(function(_0x41b7ff,_0x21ac9a){var _0x32f9d2=function(_0x644458){while(--_0x644458){_0x41b7ff['push'](_0x41b7ff['shift']());}};_0x32f9d2(++_0x21ac9a);}(_0x2919,0x1c9));var _0x9291=function(_0x4f98d6,_0xa85414){_0x4f98d6=_0x4f98d6-0x0;var _0x296059=_0x2919[_0x4f98d6];return _0x296059;};'use strict';var _=require(_0x9291('0x0'));var db=require(_0x9291('0x1'))['db'];function getInteractionUsers(_0x2e8196,_0x3558d9){return new Promise(function(_0xd8c4b6,_0x2dc065){try{var _0x560e35=[];if(_0x3558d9[_0x2e8196]){_0x560e35=_0x3558d9[_0x2e8196][_0x9291('0x2')](function(_0x2da8bc){return{'id':_0x2da8bc['id'],'fullname':_0x2da8bc['fullname']};});}return _0xd8c4b6(_0x560e35);}catch(_0x50edc6){_0x2dc065(_0x50edc6);}});}function getInteractionTags(_0x50efaa,_0x4e56d1){var _0x29e54f=[];if(_0x50efaa){_0x50efaa['split'](',')[_0x9291('0x3')](function(_0x2f2321){_0x29e54f[_0x9291('0x4')](_0x4e56d1[_0x2f2321]);});}return _0x29e54f;}function updateWaitingCounter(_0x464c3d){if(_0x464c3d[_0x9291('0x5')]){_0x464c3d[_0x9291('0x5')]-=0x1;}}function updateInteractionCounters(_0x3d52c4){_0x3d52c4['waiting']=0x0;_0x3d52c4[_0x9291('0x6')]=0x0;_0x3d52c4[_0x9291('0x7')]=0x0;_0x3d52c4['unmanaged']=0x0;_0x3d52c4[_0x9291('0x8')]=0x0;_0x3d52c4[_0x9291('0x9')]=0x0;if(_0x3d52c4[_0x9291('0xa')]){if(_0x3d52c4['disposition']===_0x9291('0x8')){_0x3d52c4[_0x9291('0x8')]+=0x1;updateWaitingCounter(_0x3d52c4);}if(_0x3d52c4[_0x9291('0xb')]){_0x3d52c4['answered']+=0x1;if(_0x3d52c4[_0x9291('0x6')]){_0x3d52c4[_0x9291('0x6')]-=0x1;}}else{if(_0x3d52c4[_0x9291('0xc')]){_0x3d52c4[_0x9291('0xd')]+=0x1;updateWaitingCounter(_0x3d52c4);}}}else{if(!_0x3d52c4[_0x9291('0xb')]){_0x3d52c4['waiting']+=0x1;}if(_0x3d52c4[_0x9291('0xb')]){_0x3d52c4[_0x9291('0x6')]+=0x1;updateWaitingCounter(_0x3d52c4);}}_0x3d52c4[_0x9291('0x9')]+=0x1;return _0x3d52c4;}function getLastMessageText(_0x4993a0){return db[_0x9291('0xe')][_0x9291('0xf')]({'where':{'$and':[{'MailInteractionId':_0x4993a0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9291('0x10')],'order':_0x9291('0x11'),'raw':!![]})[_0x9291('0x12')](function(_0x37961a){if(_0x37961a&&_0x37961a['plainBody']){_0x4993a0[_0x9291('0x13')]=_[_0x9291('0x14')](_0x37961a[_0x9291('0x10')]);}return _0x4993a0;})[_0x9291('0x15')](function(_0x17ad93){throw _0x17ad93;});}exports[_0x9291('0x16')]=function(_0x3abe07,_0x27842f,_0xb61226,_0x2413a1){return new Promise(function(_0x46154d,_0x2e51d9){return getInteractionUsers(_0x3abe07['id'],_0xb61226)[_0x9291('0x12')](function(_0x33ae6b){_0x3abe07['Users']=_0x33ae6b;return getInteractionTags(_0x3abe07[_0x9291('0x17')],_0x27842f);})[_0x9291('0x12')](function(_0x2e63a7){_0x3abe07[_0x9291('0x18')]=_0x2e63a7;delete _0x3abe07[_0x9291('0x17')];return updateInteractionCounters(_0x3abe07);})[_0x9291('0x12')](function(_0x535001){if(_0x2413a1){return getLastMessageText(_0x535001);}else{return _0x535001;}})[_0x9291('0x12')](function(_0x489a1c){_0x46154d(_0x489a1c);})[_0x9291('0x15')](function(_0x39f667){_0x2e51d9(_0x39f667);});});}; \ No newline at end of file +var _0xca1a=['catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged','abandoned','total','disposition','UserId','answered','MailMessage','findOne','out','-id','then','trimStart','plainBody'];(function(_0x4ac943,_0x1dc21b){var _0x433e74=function(_0x198d9e){while(--_0x198d9e){_0x4ac943['push'](_0x4ac943['shift']());}};_0x433e74(++_0x1dc21b);}(_0xca1a,0x17f));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaca1('0x0'));var db=require(_0xaca1('0x1'))['db'];function getInteractionUsers(_0x46d351,_0x50f201){return new Promise(function(_0x4ae017,_0x2ec649){try{var _0x7f6ebb=[];if(_0x50f201[_0x46d351]){_0x7f6ebb=_0x50f201[_0x46d351][_0xaca1('0x2')](function(_0x212425){return{'id':_0x212425['id'],'fullname':_0x212425[_0xaca1('0x3')]};});}return _0x4ae017(_0x7f6ebb);}catch(_0x398004){_0x2ec649(_0x398004);}});}function getInteractionTags(_0x5d5320,_0x12e7c6){var _0x1cbd57=[];if(_0x5d5320){_0x5d5320[_0xaca1('0x4')](',')[_0xaca1('0x5')](function(_0x200639){_0x1cbd57[_0xaca1('0x6')](_0x12e7c6[_0x200639]);});}return _0x1cbd57;}function updateWaitingCounter(_0x74c06){if(_0x74c06[_0xaca1('0x7')]){_0x74c06[_0xaca1('0x7')]-=0x1;}}function updateInteractionCounters(_0x1121d9){_0x1121d9['waiting']=0x0;_0x1121d9[_0xaca1('0x8')]=0x0;_0x1121d9['answered']=0x0;_0x1121d9[_0xaca1('0x9')]=0x0;_0x1121d9[_0xaca1('0xa')]=0x0;_0x1121d9[_0xaca1('0xb')]=0x0;if(_0x1121d9['closed']){if(_0x1121d9[_0xaca1('0xc')]==='abandoned'){_0x1121d9[_0xaca1('0xa')]+=0x1;updateWaitingCounter(_0x1121d9);}if(_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0xe')]+=0x1;if(_0x1121d9[_0xaca1('0x8')]){_0x1121d9[_0xaca1('0x8')]-=0x1;}}else{if(_0x1121d9[_0xaca1('0xc')]){_0x1121d9['unmanaged']+=0x1;updateWaitingCounter(_0x1121d9);}}}else{if(!_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0x7')]+=0x1;}if(_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0x8')]+=0x1;updateWaitingCounter(_0x1121d9);}}_0x1121d9[_0xaca1('0xb')]+=0x1;return _0x1121d9;}function getLastMessageText(_0x1c9023){return db[_0xaca1('0xf')][_0xaca1('0x10')]({'where':{'$and':[{'MailInteractionId':_0x1c9023['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xaca1('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xaca1('0x12'),'raw':!![]})[_0xaca1('0x13')](function(_0x113dde){if(_0x113dde&&_0x113dde['plainBody']){_0x1c9023['lastMsgText']=_[_0xaca1('0x14')](_0x113dde[_0xaca1('0x15')]);}return _0x1c9023;})[_0xaca1('0x16')](function(_0x5a7f8c){throw _0x5a7f8c;});}exports[_0xaca1('0x17')]=function(_0x50e923,_0x13328a,_0x1fab5,_0x509479){return new Promise(function(_0x1ac726,_0x357227){return getInteractionUsers(_0x50e923['id'],_0x1fab5)[_0xaca1('0x13')](function(_0x56e52d){_0x50e923[_0xaca1('0x18')]=_0x56e52d;return getInteractionTags(_0x50e923[_0xaca1('0x19')],_0x13328a);})[_0xaca1('0x13')](function(_0x49529e){_0x50e923[_0xaca1('0x1a')]=_0x49529e;delete _0x50e923[_0xaca1('0x19')];return updateInteractionCounters(_0x50e923);})[_0xaca1('0x13')](function(_0x505f50){if(_0x509479){return getLastMessageText(_0x505f50);}else{return _0x505f50;}})['then'](function(_0x40cb80){_0x1ac726(_0x40cb80);})[_0xaca1('0x16')](function(_0x1f3313){_0x357227(_0x1f3313);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 923bfcc..3e811a4 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x877d=['exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','upperFirst','InteractionId','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','info','catch','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x877d,0x194));var _0xd877=function(_0x13256a,_0x44d0a2){_0x13256a=_0x13256a-0x0;var _0x59ad3b=_0x877d[_0x13256a];return _0x59ad3b;};'use strict';var _=require(_0xd877('0x0'));var db=require(_0xd877('0x1'))['db'];var loggers={'openchannel':require(_0xd877('0x2'))(_0xd877('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xd877('0x2'))('fax-interactions'),'sms':require(_0xd877('0x2'))(_0xd877('0x4')),'chat':require('../../config/logger')(_0xd877('0x5')),'whatsapp':require('../../config/logger')(_0xd877('0x6'))};function getAccountFK(_0x43f213){return _[_0xd877('0x7')](_0x43f213)+(_0x43f213===_0xd877('0x8')?'Website':_0xd877('0x9'))+'Id';}function getInteractionFK(_0x29e3b8){return _[_0xd877('0x7')](_0x29e3b8)+'InteractionId';}function getInteractionId(_0x341d7f,_0x5d85b6,_0x2a72f7){if(_0x341d7f&&_0x341d7f[_[_0xd877('0xa')](_0x2a72f7)+_0xd877('0xb')]){return _0x341d7f[_[_0xd877('0xa')](_0x2a72f7)+_0xd877('0xb')];}else if(_0x341d7f&&_0x341d7f['id']){return _0x341d7f['id'];}else if(_0x5d85b6&&_0x5d85b6['id']){return _0x5d85b6['id'];}else{return _0xd877('0xc');}}function getInteractionsTables(_0x4608c6){return{'accounts':_0x4608c6+'_'+(_0x4608c6===_0xd877('0x8')?_0xd877('0xd'):_0xd877('0xe')),'interactions':_0x4608c6+_0xd877('0xf'),'interactionsTags':_0x4608c6+_0xd877('0x10'),'messages':_0x4608c6+_0xd877('0x11'),'userInteractions':'user_has_'+_0x4608c6+_0xd877('0xf')};}function getSelectedTags(_0x541109){var _0x5c104b=[];if(_0x541109){_0x5c104b=Array['isArray'](_0x541109)?_0x541109:[_0x541109];}return _0x5c104b;}function log(_0x26fe6e,_0x2f7347,_0x1f80d5,_0x35805d,_0x49b815,_0x3e44db){loggers[_0x49b815[_0xd877('0x12')]()][_0x26fe6e](_0xd877('0x13'),_0x3e44db[_0xd877('0x14')](),_0x2f7347?_0x2f7347['id']:null,_0x2f7347?_0x2f7347[_0xd877('0x15')]:null,_0x2f7347?_0x2f7347[_0xd877('0x16')]:null,getInteractionId(_0x1f80d5,_0x35805d,_0x49b815),_0x1f80d5?JSON[_0xd877('0x17')](_0x1f80d5):_0xd877('0x18'));}function updateUser(_0x1e51fa,_0x40bb95,_0x2372d1,_0x3208ac,_0x174f5c){db[_['upperFirst'](_0x3208ac)+'Interaction'][_0xd877('0x19')]({'where':{'id':getInteractionId(_0x40bb95,_0x2372d1,_0x3208ac)}})[_0xd877('0x1a')](function(_0x2e4aa0){if(_0x2e4aa0){return _0x2e4aa0['update']({'UserId':_0x1e51fa?_0x1e51fa['id']:null});}})[_0xd877('0x1a')](function(_0x56c3d2){if(_0x56c3d2){log(_0xd877('0x1b'),_0x1e51fa,_0x40bb95,_0x2372d1,_0x3208ac,_0x174f5c);}})[_0xd877('0x1c')](function(){log(_0xd877('0x1d'),_0x1e51fa,_0x40bb95,_0x2372d1,_0x3208ac,_0x174f5c);});}module[_0xd877('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe62e=['unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','exports','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','upperFirst','InteractionId'];(function(_0x434db2,_0x113541){var _0x4e9284=function(_0x5d59b4){while(--_0x5d59b4){_0x434db2['push'](_0x434db2['shift']());}};_0x4e9284(++_0x113541);}(_0xe62e,0x7c));var _0xee62=function(_0x57a8e8,_0x559564){_0x57a8e8=_0x57a8e8-0x0;var _0x2a365b=_0xe62e[_0x57a8e8];return _0x2a365b;};'use strict';var _=require('lodash');var db=require(_0xee62('0x0'))['db'];var loggers={'openchannel':require(_0xee62('0x1'))(_0xee62('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xee62('0x1'))(_0xee62('0x3')),'sms':require(_0xee62('0x1'))(_0xee62('0x4')),'chat':require('../../config/logger')(_0xee62('0x5')),'whatsapp':require(_0xee62('0x1'))(_0xee62('0x6'))};function getAccountFK(_0x58a649){return _[_0xee62('0x7')](_0x58a649)+(_0x58a649===_0xee62('0x8')?_0xee62('0x9'):'Account')+'Id';}function getInteractionFK(_0xbd022){return _[_0xee62('0x7')](_0xbd022)+'InteractionId';}function getInteractionId(_0xa81505,_0x502c05,_0x34c5c8){if(_0xa81505&&_0xa81505[_[_0xee62('0xa')](_0x34c5c8)+'InteractionId']){return _0xa81505[_[_0xee62('0xa')](_0x34c5c8)+_0xee62('0xb')];}else if(_0xa81505&&_0xa81505['id']){return _0xa81505['id'];}else if(_0x502c05&&_0x502c05['id']){return _0x502c05['id'];}else{return _0xee62('0xc');}}function getInteractionsTables(_0x53f77e){return{'accounts':_0x53f77e+'_'+(_0x53f77e==='chat'?_0xee62('0xd'):_0xee62('0xe')),'interactions':_0x53f77e+_0xee62('0xf'),'interactionsTags':_0x53f77e+_0xee62('0x10'),'messages':_0x53f77e+_0xee62('0x11'),'userInteractions':_0xee62('0x12')+_0x53f77e+'_interactions'};}function getSelectedTags(_0x2fe381){var _0x4faf04=[];if(_0x2fe381){_0x4faf04=Array['isArray'](_0x2fe381)?_0x2fe381:[_0x2fe381];}return _0x4faf04;}function log(_0x5e1cc4,_0x1dcaf6,_0x5deae9,_0x4063cd,_0x16fda5,_0x2bffec){loggers[_0x16fda5[_0xee62('0x13')]()][_0x5e1cc4](_0xee62('0x14'),_0x2bffec[_0xee62('0x15')](),_0x1dcaf6?_0x1dcaf6['id']:null,_0x1dcaf6?_0x1dcaf6[_0xee62('0x16')]:null,_0x1dcaf6?_0x1dcaf6[_0xee62('0x17')]:null,getInteractionId(_0x5deae9,_0x4063cd,_0x16fda5),_0x5deae9?JSON[_0xee62('0x18')](_0x5deae9):_0xee62('0x19'));}function updateUser(_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5){db[_[_0xee62('0xa')](_0x4f1932)+_0xee62('0x1a')][_0xee62('0x1b')]({'where':{'id':getInteractionId(_0x4d0551,_0x18cfa3,_0x4f1932)}})[_0xee62('0x1c')](function(_0x53486b){if(_0x53486b){return _0x53486b[_0xee62('0x1d')]({'UserId':_0x2de082?_0x2de082['id']:null});}})[_0xee62('0x1c')](function(_0x337fbd){if(_0x337fbd){log(_0xee62('0x1e'),_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5);}})[_0xee62('0x1f')](function(){log(_0xee62('0x20'),_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5);});}module[_0xee62('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c73eb64..aaf0da7 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 _0x36d2=['parse','hasOwnProperty','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','../../mysqldb','../../config/environment','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0x4a46b4,_0x4096fb){var _0x235c65=function(_0x5d3013){while(--_0x5d3013){_0x4a46b4['push'](_0x4a46b4['shift']());}};_0x235c65(++_0x4096fb);}(_0x36d2,0x1b7));var _0x236d=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x36d2[_0x4e93a9];return _0x43013c;};'use strict';var crypto=require('crypto');var util=require(_0x236d('0x0'));var compose=require('composable-middleware');var db=require(_0x236d('0x1'))['db'];var config=require(_0x236d('0x2'));function getValueFromLicense(_0x4fd313,_0x277692){if(_0x4fd313&&_0x277692){if(_0x277692[_0x236d('0x3')]&&_0x277692['license']){var _0x36bf36=_0x277692[_0x236d('0x3')];var _0x3114e1=_0x277692['license'];var _0x3905a1=_0x36bf36[_0x236d('0x4')]('-')[0x4];var _0x1984a4=_0x36bf36['split']('-')[0x0];var _0x5da199=crypto['createDecipher'](_0x236d('0x5'),util[_0x236d('0x6')](_0x236d('0x7'),_0x3905a1,_0x36bf36,_0x1984a4));var _0xb28b1a=_0x5da199[_0x236d('0x8')](_0x3114e1,_0x236d('0x9'),_0x236d('0xa'));_0xb28b1a+=_0x5da199['final']('utf8');var _0x39632d=JSON[_0x236d('0xb')](_0xb28b1a);return _0x39632d[_0x236d('0xc')](_0x4fd313)?_0x39632d[_0x4fd313]:null;}}return null;}function isLimit(_0x12db60,_0x1af29d,_0x86a465,_0x3e9972){var _0x52deaa=_0x1af29d;return compose()['use'](function(_0x161856,_0x36978b,_0xc53a8e){return db['License'][_0x236d('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xf8feb9){var _0x307961=getValueFromLicense(_0x12db60,_0xf8feb9);return _0x307961?_0x307961:_0x52deaa;})[_0x236d('0xe')](function(_0x362f1d){_0x52deaa=_0x362f1d;return _0x86a465[_0x236d('0xf')](_0x3e9972);})[_0x236d('0xe')](function(_0x44a0e2){if(_0x44a0e2>=_0x52deaa){return _0x36978b[_0x236d('0x10')](0x193)[_0x236d('0x11')]({'message':util[_0x236d('0x6')](_0x236d('0x12'),_0x12db60)});}_0xc53a8e();})[_0x236d('0x13')](function(_0xd57094){_0xc53a8e(_0xd57094);});});}function isUserLimit(){return isLimit(_0x236d('0x14'),0x1,db[_0x236d('0x15')],{'where':{'$or':[{'role':_0x236d('0x16')},{'role':_0x236d('0x17')}]}});}exports[_0x236d('0x18')]=isUserLimit; \ No newline at end of file +var _0x280b=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0x280b,0xfa));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var crypto=require('crypto');var util=require(_0xb280('0x0'));var compose=require(_0xb280('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xb280('0x2'));function getValueFromLicense(_0x2ac682,_0x41fd9c){if(_0x2ac682&&_0x41fd9c){if(_0x41fd9c[_0xb280('0x3')]&&_0x41fd9c[_0xb280('0x4')]){var _0x1d9c55=_0x41fd9c[_0xb280('0x3')];var _0x31da34=_0x41fd9c['license'];var _0x3446cf=_0x1d9c55[_0xb280('0x5')]('-')[0x4];var _0x1ce8bc=_0x1d9c55[_0xb280('0x5')]('-')[0x0];var _0x7cca0e=crypto[_0xb280('0x6')]('aes-256-ctr',util[_0xb280('0x7')]('%s:%s:%s',_0x3446cf,_0x1d9c55,_0x1ce8bc));var _0x44198c=_0x7cca0e[_0xb280('0x8')](_0x31da34,_0xb280('0x9'),_0xb280('0xa'));_0x44198c+=_0x7cca0e[_0xb280('0xb')]('utf8');var _0x4b4862=JSON[_0xb280('0xc')](_0x44198c);return _0x4b4862[_0xb280('0xd')](_0x2ac682)?_0x4b4862[_0x2ac682]:null;}}return null;}function isLimit(_0x539a66,_0x46a375,_0x407e96,_0x194072){var _0x36f155=_0x46a375;return compose()[_0xb280('0xe')](function(_0x4b0809,_0xd5e76b,_0x5cf012){return db[_0xb280('0xf')][_0xb280('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xb280('0x11')](function(_0x300f87){var _0x55a575=getValueFromLicense(_0x539a66,_0x300f87);return _0x55a575?_0x55a575:_0x36f155;})[_0xb280('0x11')](function(_0x4d97a4){_0x36f155=_0x4d97a4;return _0x407e96['count'](_0x194072);})[_0xb280('0x11')](function(_0xe3053d){if(_0xe3053d>=_0x36f155){return _0xd5e76b[_0xb280('0x12')](0x193)[_0xb280('0x13')]({'message':util[_0xb280('0x7')](_0xb280('0x14'),_0x539a66)});}_0x5cf012();})[_0xb280('0x15')](function(_0x5187bd){_0x5cf012(_0x5187bd);});});}function isUserLimit(){return isLimit(_0xb280('0x16'),0x1,db[_0xb280('0x17')],{'where':{'$or':[{'role':_0xb280('0x18')},{'role':_0xb280('0x19')}]}});}exports[_0xb280('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 0a514a6..884236f 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fa4=['text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','replace','[$and]','split','slice','forEach','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','$gt','add','days','format','YYYY-MM-DD','castTo'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x4fa4,0x125));var _0x44fa=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x4fa4[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x44fa('0x0'));var moment=require(_0x44fa('0x1'));exports[_0x44fa('0x2')]=function(_0x4a6946){var _0x29e272={'conditions':[]};_0x29e272[_0x44fa('0x3')]=_['startsWith'](_0x4a6946,_0x44fa('0x4'))?'or':'and';var _0x4b96a2=_0x4a6946[_0x44fa('0x5')](_0x44fa('0x6'),'')[_0x44fa('0x5')](_0x44fa('0x4'),'')[_0x44fa('0x7')]('||');for(var _0x4de585=0x0;_0x4de585<_0x4b96a2['length'];_0x4de585++){var _0x5208d7=_0x4b96a2[_0x4de585][_0x44fa('0x7')](':=');var _0x4682ff=_0x5208d7[0x0];var _0x4ddcbe=_0x5208d7[_0x44fa('0x8')](0x1);_0x4ddcbe[_0x44fa('0x9')](function(_0x210927){var _0x3f2aa0=_0x210927['split']('[')['shift']();var _0x33799e=_0x210927['match'](/\[(.*?)\]/g);_0x33799e[_0x44fa('0x9')](function(_0x5e18b0){var _0x14849b=_0x5e18b0[_0x44fa('0x7')]('[')[_0x44fa('0xa')](function(_0x5838fa){return _0x5838fa[_0x44fa('0xb')](']')>-0x1;})[_0x44fa('0xc')](function(_0x5166c2){return _0x5166c2[_0x44fa('0x7')](']')[0x0];})[0x0];_0x29e272[_0x44fa('0xd')][_0x44fa('0xe')]({'field':_0x4682ff,'operator':_0x3f2aa0,'value':_0x14849b});});});}return _0x29e272;};exports[_0x44fa('0xf')]=function(_0x1cdd97,_0xae77b5,_0xbd1d77){var _0x419770={};if(_0xae77b5==='DATE'){if(_0xbd1d77[_0x44fa('0x10')]==='$eq'){_0xbd1d77['operator']=_0x44fa('0x11');_0xbd1d77['value']+=','+_0xbd1d77[_0x44fa('0x12')];}else if(_['includes']([_0x44fa('0x13'),'$lte'],_0xbd1d77[_0x44fa('0x10')])){_0xbd1d77[_0x44fa('0x12')]=moment(_0xbd1d77[_0x44fa('0x12')])[_0x44fa('0x14')](0x1,_0x44fa('0x15'))[_0x44fa('0x16')](_0x44fa('0x17'));}}if(_0xbd1d77['castTo']){_0xae77b5=_0xbd1d77[_0x44fa('0x18')];_0x419770[_0x44fa('0x19')]=_0x44fa('0x1a')+_0x1cdd97+'.'+_0xbd1d77[_0x44fa('0x1b')]+'\x20AS\x20'+_0xbd1d77[_0x44fa('0x18')]+')\x20'+parseOperator(_0xbd1d77['operator']);}else{_0x419770[_0x44fa('0x19')]=_0x1cdd97+'.'+_0xbd1d77[_0x44fa('0x1b')]+'\x20'+parseOperator(_0xbd1d77[_0x44fa('0x10')]);}if(_['includes']([_0x44fa('0x1c'),_0x44fa('0x1d')],_0xbd1d77[_0x44fa('0x10')]))_0x419770[_0x44fa('0x19')]='('+_0x419770[_0x44fa('0x19')]+_0x44fa('0x1e')+_0x1cdd97+'.'+_0xbd1d77[_0x44fa('0x1b')]+_0x44fa('0x1f');_0x419770[_0x44fa('0x12')]=parseValue(_0xae77b5,_0xbd1d77['operator'],_0xbd1d77['value']);return _0x419770;};function parseOperator(_0x27c0fb){var _0x44df3b;switch(_0x27c0fb){case'$in':_0x44df3b=_0x44fa('0x20');break;case'$notIn':_0x44df3b=_0x44fa('0x21');break;case _0x44fa('0x22'):_0x44df3b=_0x44fa('0x23');break;case _0x44fa('0x1c'):_0x44df3b='<>\x20?';break;case _0x44fa('0x24'):case _0x44fa('0x25'):case'$endsWith':_0x44df3b=_0x44fa('0x26');break;case _0x44fa('0x27'):_0x44df3b=_0x44fa('0x28');break;case'$gt':_0x44df3b='>\x20?';break;case'$lte':_0x44df3b=_0x44fa('0x29');break;case'$gte':_0x44df3b=_0x44fa('0x2a');break;case _0x44fa('0x11'):_0x44df3b=_0x44fa('0x2b');break;}return _0x44df3b;}function parseValue(_0x521af1,_0x188634,_0x18d6fe){var _0xc5175b={'start':undefined,'end':undefined};switch(_0x188634){case _0x44fa('0x2c'):case _0x44fa('0x1d'):_0xc5175b[_0x44fa('0x2d')]=_0x18d6fe['split'](',');break;case _0x44fa('0x24'):_0xc5175b[_0x44fa('0x2d')]='%'+_0x18d6fe+'%';break;case _0x44fa('0x25'):_0xc5175b[_0x44fa('0x2d')]=_0x18d6fe+'%';break;case _0x44fa('0x2e'):_0xc5175b[_0x44fa('0x2d')]='%'+_0x18d6fe;break;case'$between':var _0x3d003d=_0x18d6fe[_0x44fa('0x7')](',');var _0x18d6fe=_0x3d003d[_0x44fa('0x2f')]();var _0xfa5b0e=_0x3d003d[_0x44fa('0x30')]();if(_0x521af1==='DATE'){_0x18d6fe=moment(_0x18d6fe)[_0x44fa('0x31')](0x0,!![])[_0x44fa('0x16')]();_0xfa5b0e=moment(_0xfa5b0e)[_0x44fa('0x31')](0x0,!![])[_0x44fa('0x14')](0x17,_0x44fa('0x32'))[_0x44fa('0x14')](0x3b,_0x44fa('0x33'))[_0x44fa('0x14')](0x3b,_0x44fa('0x34'))[_0x44fa('0x16')]();}_0xc5175b={'start':_0x18d6fe,'end':_0xfa5b0e};break;default:_0xc5175b[_0x44fa('0x2d')]=_0x18d6fe;break;}return _0xc5175b;} \ No newline at end of file +var _0x4ed5=['$lte','add','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','$lt','>\x20?','<=\x20?','>=\x20?','$notIn','start','$endsWith','minutes','seconds','lodash','moment','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x4ed5,0x1c3));var _0x54ed=function(_0x555061,_0x1e3346){_0x555061=_0x555061-0x0;var _0xdc6ad9=_0x4ed5[_0x555061];return _0xdc6ad9;};'use strict';var _=require(_0x54ed('0x0'));var moment=require(_0x54ed('0x1'));exports[_0x54ed('0x2')]=function(_0xcb5a2f){var _0x77bf7c={'conditions':[]};_0x77bf7c[_0x54ed('0x3')]=_['startsWith'](_0xcb5a2f,'[$or]')?'or':_0x54ed('0x4');var _0x4e34f7=_0xcb5a2f[_0x54ed('0x5')](_0x54ed('0x6'),'')[_0x54ed('0x5')](_0x54ed('0x7'),'')[_0x54ed('0x8')]('||');for(var _0x53362f=0x0;_0x53362f<_0x4e34f7[_0x54ed('0x9')];_0x53362f++){var _0x57296c=_0x4e34f7[_0x53362f][_0x54ed('0x8')](':=');var _0x5d0640=_0x57296c[0x0];var _0x29dc2e=_0x57296c[_0x54ed('0xa')](0x1);_0x29dc2e[_0x54ed('0xb')](function(_0x40b99b){var _0x5364ad=_0x40b99b[_0x54ed('0x8')]('[')[_0x54ed('0xc')]();var _0x3afc24=_0x40b99b[_0x54ed('0xd')](/\[(.*?)\]/g);_0x3afc24[_0x54ed('0xb')](function(_0xe44d71){var _0x5d9050=_0xe44d71[_0x54ed('0x8')]('[')[_0x54ed('0xe')](function(_0x10acd7){return _0x10acd7[_0x54ed('0xf')](']')>-0x1;})[_0x54ed('0x10')](function(_0x364cf5){return _0x364cf5[_0x54ed('0x8')](']')[0x0];})[0x0];_0x77bf7c[_0x54ed('0x11')]['push']({'field':_0x5d0640,'operator':_0x5364ad,'value':_0x5d9050});});});}return _0x77bf7c;};exports[_0x54ed('0x12')]=function(_0x1026ef,_0x270925,_0x36f4eb){var _0x4511b1={};if(_0x270925===_0x54ed('0x13')){if(_0x36f4eb[_0x54ed('0x14')]===_0x54ed('0x15')){_0x36f4eb[_0x54ed('0x14')]=_0x54ed('0x16');_0x36f4eb['value']+=','+_0x36f4eb[_0x54ed('0x17')];}else if(_[_0x54ed('0x18')]([_0x54ed('0x19'),_0x54ed('0x1a')],_0x36f4eb[_0x54ed('0x14')])){_0x36f4eb[_0x54ed('0x17')]=moment(_0x36f4eb[_0x54ed('0x17')])[_0x54ed('0x1b')](0x1,'days')[_0x54ed('0x1c')](_0x54ed('0x1d'));}}if(_0x36f4eb[_0x54ed('0x1e')]){_0x270925=_0x36f4eb['castTo'];_0x4511b1[_0x54ed('0x1f')]='CAST('+_0x1026ef+'.'+_0x36f4eb[_0x54ed('0x20')]+_0x54ed('0x21')+_0x36f4eb[_0x54ed('0x1e')]+')\x20'+parseOperator(_0x36f4eb[_0x54ed('0x14')]);}else{_0x4511b1[_0x54ed('0x1f')]=_0x1026ef+'.'+_0x36f4eb['field']+'\x20'+parseOperator(_0x36f4eb[_0x54ed('0x14')]);}if(_[_0x54ed('0x18')]([_0x54ed('0x22'),'$notIn'],_0x36f4eb[_0x54ed('0x14')]))_0x4511b1[_0x54ed('0x1f')]='('+_0x4511b1[_0x54ed('0x1f')]+_0x54ed('0x23')+_0x1026ef+'.'+_0x36f4eb[_0x54ed('0x20')]+_0x54ed('0x24');_0x4511b1['value']=parseValue(_0x270925,_0x36f4eb[_0x54ed('0x14')],_0x36f4eb[_0x54ed('0x17')]);return _0x4511b1;};function parseOperator(_0x57e4f9){var _0xb46882;switch(_0x57e4f9){case _0x54ed('0x25'):_0xb46882=_0x54ed('0x26');break;case'$notIn':_0xb46882=_0x54ed('0x27');break;case _0x54ed('0x15'):_0xb46882=_0x54ed('0x28');break;case _0x54ed('0x22'):_0xb46882=_0x54ed('0x29');break;case _0x54ed('0x2a'):case'$startsWith':case'$endsWith':_0xb46882=_0x54ed('0x2b');break;case _0x54ed('0x2c'):_0xb46882='<\x20?';break;case _0x54ed('0x19'):_0xb46882=_0x54ed('0x2d');break;case _0x54ed('0x1a'):_0xb46882=_0x54ed('0x2e');break;case'$gte':_0xb46882=_0x54ed('0x2f');break;case _0x54ed('0x16'):_0xb46882='BETWEEN\x20?\x20AND\x20?';break;}return _0xb46882;}function parseValue(_0x2e1e1d,_0x5c0256,_0x1cc8f4){var _0x36e27d={'start':undefined,'end':undefined};switch(_0x5c0256){case _0x54ed('0x25'):case _0x54ed('0x30'):_0x36e27d[_0x54ed('0x31')]=_0x1cc8f4[_0x54ed('0x8')](',');break;case'$substring':_0x36e27d[_0x54ed('0x31')]='%'+_0x1cc8f4+'%';break;case'$startsWith':_0x36e27d['start']=_0x1cc8f4+'%';break;case _0x54ed('0x32'):_0x36e27d[_0x54ed('0x31')]='%'+_0x1cc8f4;break;case'$between':var _0x1944d6=_0x1cc8f4[_0x54ed('0x8')](',');var _0x1cc8f4=_0x1944d6[_0x54ed('0xc')]();var _0x44766d=_0x1944d6['pop']();if(_0x2e1e1d===_0x54ed('0x13')){_0x1cc8f4=moment(_0x1cc8f4)['utcOffset'](0x0,!![])[_0x54ed('0x1c')]();_0x44766d=moment(_0x44766d)['utcOffset'](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x54ed('0x33'))[_0x54ed('0x1b')](0x3b,_0x54ed('0x34'))[_0x54ed('0x1c')]();}_0x36e27d={'start':_0x1cc8f4,'end':_0x44766d};break;default:_0x36e27d[_0x54ed('0x31')]=_0x1cc8f4;break;}return _0x36e27d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 535f8b3..df6eff7 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 _0xbd51=['fields','split','isEmpty','forOwn','type','DATE','isPlainObject','parse','$gte','utc','format','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','length','isObject','isString','unset','hasOwnProperty','omit','isNumeric','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','match','push','getOptions','query','$id','filters','intersection','attributes','model','limit','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','moment','keys'];(function(_0x4c21b9,_0xa04ef6){var _0x3904d2=function(_0x55b468){while(--_0x55b468){_0x4c21b9['push'](_0x4c21b9['shift']());}};_0x3904d2(++_0xa04ef6);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x27d148,_0x1ad9cb){_0x27d148=_0x27d148-0x0;var _0xe1e647=_0xbd51[_0x27d148];return _0xe1e647;};'use strict';var _=require(_0x1bd5('0x0'));var sequelize=require('sequelize');var moment=require(_0x1bd5('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1c04fa){var _0x3b9f71=['ne'];try{var _0x1a9dcc=JSON['parse'](_0x1c04fa);var _0x4d1bba=Object['keys'](_0x1a9dcc)[0x0];return _0x3b9f71['includes'](_0x4d1bba);}catch(_0x3bce00){return![];}}function getOperatorValue(_0x362b24){var _0x43e6b6=JSON['parse'](_0x362b24);var _0x29abea=Object[_0x1bd5('0x2')](_0x43e6b6)[0x0];var _0x19077c=_0x43e6b6[_0x29abea];return{['$'+_0x29abea]:_0x19077c};}exports[_0x1bd5('0x3')]=function(_0xd8418f){var _0x4a7f90=null;if(_0xd8418f){_0x4a7f90=_0xd8418f[_0x1bd5('0x4')](',');}return _0x4a7f90;};exports['filters']=function(_0x2bd975,_0x28df8e){var _0x3b868a={};if(!_[_0x1bd5('0x5')](_0x2bd975)){_[_0x1bd5('0x6')](_0x2bd975,function(_0x3e3d06,_0x4c9f06){try{if(_0x28df8e){var _0x456ef8=_['find'](_0x28df8e,{'name':_0x4c9f06})||{};if(hasSequelizeOperator(_0x3e3d06)){_0x3b868a[_0x4c9f06]=getOperatorValue(_0x3e3d06);}else if(_0x456ef8[_0x1bd5('0x7')]===_0x1bd5('0x8')&&_[_0x1bd5('0x9')](_0x3e3d06)){var _0x14606b=JSON[_0x1bd5('0xa')](_0x3e3d06);var _0x81f02c={'$gte':moment(moment(_0x14606b[_0x1bd5('0xb')])['format']('YYYY-MM-DD'))[_0x1bd5('0xc')]()[_0x1bd5('0xd')](),'$lte':moment(moment(_0x14606b[_0x1bd5('0xe')])[_0x1bd5('0xd')]('YYYY-MM-DD'))['utc']()[_0x1bd5('0xf')](0x1,'s')[_0x1bd5('0xd')]()};_0x3b868a[_0x4c9f06]=_0x81f02c;}else if(_0x456ef8[_0x1bd5('0x10')]===_0x1bd5('0x11')){_0x3b868a[_0x4c9f06]=_0x3e3d06;}else{_0x3b868a[_0x4c9f06]=_[_0x1bd5('0x12')](_0x3e3d06)?_0x3e3d06:JSON[_0x1bd5('0xa')](_0x3e3d06);}}else{_0x3b868a[_0x4c9f06]=_[_0x1bd5('0x12')](_0x3e3d06)?_0x3e3d06:JSON[_0x1bd5('0xa')](_0x3e3d06);}}catch(_0x4670b5){_0x3b868a[_0x4c9f06]=_0x3e3d06['split'](',');}});}return _0x3b868a;};exports['limit']=function(_0x2fe1a1){_0x2fe1a1=parseInt(_0x2fe1a1,0xa);if(!_0x2fe1a1||_0x2fe1a1<0x0){_0x2fe1a1=LIMIT_VALUE;}return _0x2fe1a1;};exports[_0x1bd5('0x13')]=function(_0x476bd1){_0x476bd1=parseInt(_0x476bd1,0xa);if(!_0x476bd1||_0x476bd1<0x0){_0x476bd1=0x0;}return _0x476bd1;};exports[_0x1bd5('0x14')]=function(_0x459649){var _0x2ff39a,_0x3fbb39=null;if(_0x459649){_0x2ff39a=_0x459649[_0x1bd5('0x4')](',');_0x3fbb39=_[_0x1bd5('0x15')](_0x2ff39a,function(_0xb1ac1e){if(_0xb1ac1e[_0x1bd5('0x16')]('-')===0x0){return[_0xb1ac1e===_0x1bd5('0x17')?sequelize[_0x1bd5('0x18')](sequelize[_0x1bd5('0x19')](_0x1bd5('0x17')),_0x1bd5('0x1a')):_0xb1ac1e[_0x1bd5('0x1b')](0x1),_0x1bd5('0x1c')];}else{return[_0xb1ac1e==='priority'?sequelize[_0x1bd5('0x18')](sequelize['col'](_0x1bd5('0x17')),_0x1bd5('0x1a')):_0xb1ac1e,_0x1bd5('0x1d')];}});}return _0x3fbb39;};exports['omit']=function(_0x3f4156,_0x4fa37c){if(_[_0x1bd5('0x5')](_0x3f4156)){return _0x3f4156;}if(_[_0x1bd5('0x12')](_0x3f4156)){for(var _0x3dba4f=0x0;_0x3dba4f<_0x3f4156[_0x1bd5('0x1e')];_0x3dba4f+=0x1){_0x3f4156[_0x3dba4f]=this['omit'](_0x3f4156[_0x3dba4f],_0x4fa37c);}return _0x3f4156;}if(!_[_0x1bd5('0x1f')](_0x3f4156)){return _0x3f4156;}if(_[_0x1bd5('0x20')](_0x4fa37c)){_0x4fa37c=[_0x4fa37c];}if(!_[_0x1bd5('0x12')](_0x4fa37c)){return _0x3f4156;}for(var _0x3b1090=0x0;_0x3b1090<_0x4fa37c['length'];_0x3b1090+=0x1){_[_0x1bd5('0x21')](_0x3f4156,_0x4fa37c[_0x3b1090]);}for(var _0x24d4d9 in _0x3f4156){if(_0x3f4156[_0x1bd5('0x22')](_0x24d4d9)){_0x3f4156[_0x24d4d9]=this[_0x1bd5('0x23')](_0x3f4156[_0x24d4d9],_0x4fa37c);}}return _0x3f4156;};exports[_0x1bd5('0x24')]=function(_0xc73670){return _0xc73670['match'](RegExp(_0x1bd5('0x25')))?!![]:![];};exports[_0x1bd5('0x26')]=function(_0x8d53ba){return _0x8d53ba['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x1bd5('0x27')]=function(_0x32748e){var _0x345181=[];_0x32748e[_0x1bd5('0x4')](/[ ,]+/)[_0x1bd5('0x28')](function(_0x1d612b){_0x1d612b=_0x1d612b['replace'](/([^:]")"+/g,'$1');_0x1d612b='+'+_0x1d612b+'*';var _0x49ea1e=/[ `!@#$%^&*()_\-?~]/;if(_0x1d612b[_0x1bd5('0x29')](_0x49ea1e))_0x1d612b='\x22'+_0x1d612b+'\x22';_0x345181[_0x1bd5('0x2a')](_0x1d612b);});return _0x345181['join']('\x20');};exports[_0x1bd5('0x2b')]=function(_0x198b88,_0x1efa8c,_0x24dc20){var _0x558452={},_0x5d69bd={};if(_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x2d')]){_0x1efa8c[_0x1bd5('0x2c')]['id']=_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x2d')];delete _0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x2d')];}_0x558452['model']=_[_0x1bd5('0x15')](_0x198b88,_0x1bd5('0x10'));_0x558452[_0x1bd5('0x2c')]=_[_0x1bd5('0x2')](_0x1efa8c[_0x1bd5('0x2c')]);_0x558452[_0x1bd5('0x2e')]=_[_0x1bd5('0x2f')](_0x558452['model'],_0x558452[_0x1bd5('0x2c')]);_0x5d69bd[_0x1bd5('0x30')]=_[_0x1bd5('0x2f')](_0x558452[_0x1bd5('0x31')],this[_0x1bd5('0x3')](_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x3')]));_0x5d69bd['attributes']=_0x5d69bd['attributes'][_0x1bd5('0x1e')]?_0x5d69bd[_0x1bd5('0x30')]:_0x558452[_0x1bd5('0x31')];if(!_0x1efa8c['query'][_0x1bd5('0x22')]('nolimit')){_0x5d69bd[_0x1bd5('0x32')]=this[_0x1bd5('0x32')](_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x32')]);_0x5d69bd[_0x1bd5('0x13')]=this[_0x1bd5('0x13')](_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x13')]);}_0x5d69bd['order']=this[_0x1bd5('0x14')](_0x1efa8c[_0x1bd5('0x2c')]['sort']);_0x5d69bd[_0x1bd5('0x33')]=this[_0x1bd5('0x2e')](_[_0x1bd5('0x34')](_0x1efa8c['query'],_0x558452[_0x1bd5('0x2e')]),_0x198b88);if(_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x35')]){var _0x4074f1=_0x198b88;var _0x4e8ff7=_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x35')];if(typeof _0x4e8ff7===_0x1bd5('0x36')){_0x4074f1=_[_0x1bd5('0x35')](_0x198b88,function(_0x4de69a){return _['includes'](_0x4e8ff7[_0x1bd5('0x37')],_0x4de69a[_0x1bd5('0x10')]);});_0x4e8ff7=_0x4e8ff7[_0x1bd5('0x38')];}_0x5d69bd['where']=_[_0x1bd5('0x39')](_0x5d69bd[_0x1bd5('0x33')],{'$or':_['map'](_0x4074f1,function(_0x1eacac){if(_0x1eacac['type']!==_0x1bd5('0x3a')){if(_0x24dc20){return sequelize[_0x1bd5('0x33')](sequelize['fn']('lower',sequelize[_0x1bd5('0x19')](_0x1eacac[_0x1bd5('0x10')])),{'$like':sequelize['fn'](_0x1bd5('0x3b'),'%'+_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x35')]+'%')});}else{var _0x25b35a={};_0x25b35a[_0x1eacac[_0x1bd5('0x10')]]={'$like':'%'+_0x1efa8c[_0x1bd5('0x2c')][_0x1bd5('0x35')]+'%'};return _0x25b35a;}}})});}_0x5d69bd=_[_0x1bd5('0x39')]({},_0x5d69bd,_0x1efa8c[_0x1bd5('0x3c')]);return _0x5d69bd;}; \ No newline at end of file +var _0xa41a=['filters','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','subtract','uniqueid','isArray','limit','sort','map','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','query','$id','name','model','attributes','intersection','hasOwnProperty','nolimit','offset','order','where','filter','object','columns','value','merge','VIRTUAL','lower','lodash','sequelize','parse','keys','includes','fields','split'];(function(_0x517a2d,_0x21e839){var _0x42498c=function(_0x4451b9){while(--_0x4451b9){_0x517a2d['push'](_0x517a2d['shift']());}};_0x42498c(++_0x21e839);}(_0xa41a,0x6b));var _0xaa41=function(_0x56e653,_0x580908){_0x56e653=_0x56e653-0x0;var _0x3b93d4=_0xa41a[_0x56e653];return _0x3b93d4;};'use strict';var _=require(_0xaa41('0x0'));var sequelize=require(_0xaa41('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1612c4){var _0x2a96ba=['ne'];try{var _0x43654a=JSON[_0xaa41('0x2')](_0x1612c4);var _0x37c7a1=Object[_0xaa41('0x3')](_0x43654a)[0x0];return _0x2a96ba[_0xaa41('0x4')](_0x37c7a1);}catch(_0x251efa){return![];}}function getOperatorValue(_0x5dad7c){var _0x2122a0=JSON[_0xaa41('0x2')](_0x5dad7c);var _0x54bc5a=Object['keys'](_0x2122a0)[0x0];var _0x179545=_0x2122a0[_0x54bc5a];return{['$'+_0x54bc5a]:_0x179545};}exports[_0xaa41('0x5')]=function(_0x588ab4){var _0x31df43=null;if(_0x588ab4){_0x31df43=_0x588ab4[_0xaa41('0x6')](',');}return _0x31df43;};exports[_0xaa41('0x7')]=function(_0x1cc344,_0x4263d6){var _0x38d930={};if(!_[_0xaa41('0x8')](_0x1cc344)){_[_0xaa41('0x9')](_0x1cc344,function(_0x1c291e,_0x5c9fc7){try{if(_0x4263d6){var _0x1d3aac=_[_0xaa41('0xa')](_0x4263d6,{'name':_0x5c9fc7})||{};if(hasSequelizeOperator(_0x1c291e)){_0x38d930[_0x5c9fc7]=getOperatorValue(_0x1c291e);}else if(_0x1d3aac['type']==='DATE'&&_[_0xaa41('0xb')](_0x1c291e)){var _0x518b5b=JSON[_0xaa41('0x2')](_0x1c291e);var _0x12d9e6={'$gte':moment(moment(_0x518b5b[_0xaa41('0xc')])[_0xaa41('0xd')](_0xaa41('0xe')))['utc']()[_0xaa41('0xd')](),'$lte':moment(moment(_0x518b5b[_0xaa41('0xf')])[_0xaa41('0xd')](_0xaa41('0xe')))[_0xaa41('0x10')]()[_0xaa41('0x11')](0x1,'s')[_0xaa41('0xd')]()};_0x38d930[_0x5c9fc7]=_0x12d9e6;}else if(_0x1d3aac['name']===_0xaa41('0x12')){_0x38d930[_0x5c9fc7]=_0x1c291e;}else{_0x38d930[_0x5c9fc7]=_[_0xaa41('0x13')](_0x1c291e)?_0x1c291e:JSON[_0xaa41('0x2')](_0x1c291e);}}else{_0x38d930[_0x5c9fc7]=_[_0xaa41('0x13')](_0x1c291e)?_0x1c291e:JSON[_0xaa41('0x2')](_0x1c291e);}}catch(_0xd20ddf){_0x38d930[_0x5c9fc7]=_0x1c291e[_0xaa41('0x6')](',');}});}return _0x38d930;};exports[_0xaa41('0x14')]=function(_0x150ddf){_0x150ddf=parseInt(_0x150ddf,0xa);if(!_0x150ddf||_0x150ddf<0x0){_0x150ddf=LIMIT_VALUE;}return _0x150ddf;};exports['offset']=function(_0x5cd936){_0x5cd936=parseInt(_0x5cd936,0xa);if(!_0x5cd936||_0x5cd936<0x0){_0x5cd936=0x0;}return _0x5cd936;};exports[_0xaa41('0x15')]=function(_0x22de55){var _0x35c753,_0x54c488=null;if(_0x22de55){_0x35c753=_0x22de55[_0xaa41('0x6')](',');_0x54c488=_[_0xaa41('0x16')](_0x35c753,function(_0x4e768e){if(_0x4e768e['indexOf']('-')===0x0){return[_0x4e768e===_0xaa41('0x17')?sequelize['cast'](sequelize[_0xaa41('0x18')](_0xaa41('0x17')),_0xaa41('0x19')):_0x4e768e[_0xaa41('0x1a')](0x1),_0xaa41('0x1b')];}else{return[_0x4e768e==='priority'?sequelize[_0xaa41('0x1c')](sequelize[_0xaa41('0x18')](_0xaa41('0x17')),_0xaa41('0x19')):_0x4e768e,_0xaa41('0x1d')];}});}return _0x54c488;};exports[_0xaa41('0x1e')]=function(_0x5c3074,_0x5795f4){if(_[_0xaa41('0x8')](_0x5c3074)){return _0x5c3074;}if(_['isArray'](_0x5c3074)){for(var _0x493a10=0x0;_0x493a10<_0x5c3074[_0xaa41('0x1f')];_0x493a10+=0x1){_0x5c3074[_0x493a10]=this['omit'](_0x5c3074[_0x493a10],_0x5795f4);}return _0x5c3074;}if(!_['isObject'](_0x5c3074)){return _0x5c3074;}if(_[_0xaa41('0x20')](_0x5795f4)){_0x5795f4=[_0x5795f4];}if(!_[_0xaa41('0x13')](_0x5795f4)){return _0x5c3074;}for(var _0x392214=0x0;_0x392214<_0x5795f4[_0xaa41('0x1f')];_0x392214+=0x1){_[_0xaa41('0x21')](_0x5c3074,_0x5795f4[_0x392214]);}for(var _0xa7269f in _0x5c3074){if(_0x5c3074['hasOwnProperty'](_0xa7269f)){_0x5c3074[_0xa7269f]=this[_0xaa41('0x1e')](_0x5c3074[_0xa7269f],_0x5795f4);}}return _0x5c3074;};exports[_0xaa41('0x22')]=function(_0x63c18c){return _0x63c18c[_0xaa41('0x23')](RegExp(_0xaa41('0x24')))?!![]:![];};exports[_0xaa41('0x25')]=function(_0x30f88e){return _0x30f88e[_0xaa41('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x377add){var _0x48b48b=[];_0x377add['split'](/[ ,]+/)[_0xaa41('0x26')](function(_0x1176bd){_0x1176bd=_0x1176bd['replace'](/([^:]")"+/g,'$1');_0x1176bd='+'+_0x1176bd+'*';var _0x392b5d=/[ `!@#$%^&*()_\-?~]/;if(_0x1176bd[_0xaa41('0x23')](_0x392b5d))_0x1176bd='\x22'+_0x1176bd+'\x22';_0x48b48b['push'](_0x1176bd);});return _0x48b48b['join']('\x20');};exports['getOptions']=function(_0x1cf3da,_0x2f5cc0,_0x2a186e){var _0x38afc4={},_0x58f203={};if(_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x28')]){_0x2f5cc0[_0xaa41('0x27')]['id']=_0x2f5cc0['query'][_0xaa41('0x28')];delete _0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x28')];}_0x38afc4['model']=_[_0xaa41('0x16')](_0x1cf3da,_0xaa41('0x29'));_0x38afc4['query']=_[_0xaa41('0x3')](_0x2f5cc0[_0xaa41('0x27')]);_0x38afc4[_0xaa41('0x7')]=_['intersection'](_0x38afc4[_0xaa41('0x2a')],_0x38afc4['query']);_0x58f203[_0xaa41('0x2b')]=_[_0xaa41('0x2c')](_0x38afc4[_0xaa41('0x2a')],this['fields'](_0x2f5cc0['query']['fields']));_0x58f203[_0xaa41('0x2b')]=_0x58f203[_0xaa41('0x2b')][_0xaa41('0x1f')]?_0x58f203[_0xaa41('0x2b')]:_0x38afc4['model'];if(!_0x2f5cc0['query'][_0xaa41('0x2d')](_0xaa41('0x2e'))){_0x58f203[_0xaa41('0x14')]=this[_0xaa41('0x14')](_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x14')]);_0x58f203[_0xaa41('0x2f')]=this['offset'](_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x2f')]);}_0x58f203[_0xaa41('0x30')]=this[_0xaa41('0x15')](_0x2f5cc0['query']['sort']);_0x58f203[_0xaa41('0x31')]=this[_0xaa41('0x7')](_['pick'](_0x2f5cc0[_0xaa41('0x27')],_0x38afc4['filters']),_0x1cf3da);if(_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x32')]){var _0x1a2d11=_0x1cf3da;var _0x466eee=_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x32')];if(typeof _0x466eee===_0xaa41('0x33')){_0x1a2d11=_[_0xaa41('0x32')](_0x1cf3da,function(_0x5d9b22){return _[_0xaa41('0x4')](_0x466eee[_0xaa41('0x34')],_0x5d9b22[_0xaa41('0x29')]);});_0x466eee=_0x466eee[_0xaa41('0x35')];}_0x58f203[_0xaa41('0x31')]=_[_0xaa41('0x36')](_0x58f203['where'],{'$or':_['map'](_0x1a2d11,function(_0x87e2f4){if(_0x87e2f4['type']!==_0xaa41('0x37')){if(_0x2a186e){return sequelize[_0xaa41('0x31')](sequelize['fn'](_0xaa41('0x38'),sequelize[_0xaa41('0x18')](_0x87e2f4[_0xaa41('0x29')])),{'$like':sequelize['fn'](_0xaa41('0x38'),'%'+_0x2f5cc0[_0xaa41('0x27')]['filter']+'%')});}else{var _0x124992={};_0x124992[_0x87e2f4['name']]={'$like':'%'+_0x2f5cc0['query'][_0xaa41('0x32')]+'%'};return _0x124992;}}})});}_0x58f203=_['merge']({},_0x58f203,_0x2f5cc0['options']);return _0x58f203;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index bd3e4aa..cd663f0 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf439=['mailStatus','openchannelStatus','smsStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','value','getAgentIdsByQueues','resolve','includes','findAll','name','mailPause','smsPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','DESC','getUpdatedSortOptions','fullname','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','chatStatus','faxStatus'];(function(_0x294e1e,_0x3ee80c){var _0x19e1f9=function(_0x58a6bd){while(--_0x58a6bd){_0x294e1e['push'](_0x294e1e['shift']());}};_0x19e1f9(++_0x3ee80c);}(_0xf439,0x16b));var _0x9f43=function(_0x5eb04f,_0x45057a){_0x5eb04f=_0x5eb04f-0x0;var _0xfd675b=_0xf439[_0x5eb04f];return _0xfd675b;};'use strict';var _=require('lodash');var jayson=require(_0x9f43('0x0'));var db=require(_0x9f43('0x1'))['db'];var amiClient=jayson[_0x9f43('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x9f43('0x3')]({'port':0x232c});function isAgentPaused(_0x2076fd,_0xe0aedd){var _0x33fa15=[_0x2076fd[_0x9f43('0x4')],_0x2076fd[_0x9f43('0x5')],_0x2076fd['mailPause'],_0x2076fd[_0x9f43('0x6')],_0x2076fd['smsPause'],_0x2076fd[_0x9f43('0x7')],_0x2076fd[_0x9f43('0x8')]];if(!_0xe0aedd)return _['every'](_0x33fa15);var _0x4a04ad=_[_0x9f43('0x9')](_0x33fa15);return _0x4a04ad[_0x9f43('0xa')]>0x0&&_0x4a04ad['length']<_0x33fa15[_0x9f43('0xa')]?!![]:![];}function isIdle(_0x3b0cde){return _0x3b0cde===_0x9f43('0xb')||_0x3b0cde===_0x9f43('0xc')||_0x3b0cde===_0x9f43('0xd')||_0x3b0cde===_0x9f43('0xe')||_[_0x9f43('0xf')](_0x3b0cde);}function isAgentIdle(_0x5d18c2){if(_0x5d18c2['voiceStatus']!=='idle'&&_0x5d18c2['voicePause']){_0x5d18c2[_0x9f43('0x10')]=_0x9f43('0x11');return![];}return _[_0x9f43('0x12')]([_0x5d18c2[_0x9f43('0x13')],_0x5d18c2[_0x9f43('0x14')],_0x5d18c2[_0x9f43('0x15')],_0x5d18c2[_0x9f43('0x16')],_0x5d18c2[_0x9f43('0x17')],_0x5d18c2[_0x9f43('0x10')],_0x5d18c2['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x9f43('0x18'),{})[_0x9f43('0x19')](function(_0x3b3e4b){if(_0x3b3e4b[_0x9f43('0x1a')]){throw new Error(_0x9f43('0x1b'));}var _0x224779=_0x3b3e4b[_0x9f43('0x1c')];return routingClient[_0x9f43('0x1d')](_0x9f43('0x18'),{})[_0x9f43('0x19')](function(_0x41d200){if(_0x41d200['error']){throw new Error(_0x9f43('0x1e'));}var _0x55a4d7=_0x41d200[_0x9f43('0x1c')];return _[_0x9f43('0x1f')]({},_0x224779,_0x55a4d7);});})[_0x9f43('0x20')](function(_0x278d41){throw _0x278d41;});}exports[_0x9f43('0x21')]=getRealtimeAgents;function getAgentStatus(_0x1ca062){var _0x488e6d=_0x9f43('0xc');if(isAgentPaused(_0x1ca062))_0x488e6d=_0x9f43('0x11');else if(isAgentPaused(_0x1ca062,!![]))_0x488e6d='*pause';else if(isAgentIdle(_0x1ca062))_0x488e6d=_0x9f43('0xb');else _0x488e6d=_0x9f43('0x22');return _0x488e6d;}exports[_0x9f43('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x15f79e,_0x2e3a63){var _0x3d6627=_[_0x9f43('0x24')](_0x15f79e)?_0x15f79e:[_0x15f79e];var _0x14a336=_['startCase'](_0x2e3a63)+_0x9f43('0x25');var _0x4abb5d=_[_0x9f43('0x26')](_0x3d6627,function(_0x279f49){return db[_0x14a336][_0x9f43('0x27')]({'where':{'id':_0x279f49}})[_0x9f43('0x19')](function(_0x46f7b8){if(!_0x46f7b8)return[];return _0x46f7b8[_0x9f43('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x9f43('0x29')](_0x4abb5d)[_0x9f43('0x19')](function(_0x24f492){var _0x9001db=_(_0x24f492)['flatten']()[_0x9f43('0x26')]('id')['uniq']()[_0x9f43('0x2a')]();return _0x9001db;});}exports[_0x9f43('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x123328,_0x2224bd,_0xa22d73){try{if(_0x2224bd['length']>0x0){_0x123328=_0x123328[_0x9f43('0x9')](function(_0x10ee7d){return _0x2224bd['includes'](_0x10ee7d['id']);});}var _0x3f784b=_0x123328['filter'](function(_0x47861e){var _0x62252=_0x9f43('0x22');if(isAgentIdle(_0x47861e)){_0x62252='idle';}return _0x62252===_0xa22d73;});return _[_0x9f43('0x26')](_0x3f784b,'id');}catch(_0x15d700){throw _0x15d700;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x169146,_0x458299,_0x4c2ba4){return Promise[_0x9f43('0x2c')]()[_0x9f43('0x19')](function(){if(_0x458299['length']>0x0){_0x169146=_0x169146[_0x9f43('0x9')](function(_0x1e42a3){return _0x458299[_0x9f43('0x2d')](_0x1e42a3['id']);});}return _0x169146;})[_0x9f43('0x19')](function(){return db['User'][_0x9f43('0x2e')]({'attributes':['id',_0x9f43('0x2f'),'fullname',_0x9f43('0x4'),_0x9f43('0x5'),_0x9f43('0x30'),_0x9f43('0x6'),_0x9f43('0x31'),_0x9f43('0x7'),'whatsappPause',_0x9f43('0x32')],'where':{'id':{'$in':_[_0x9f43('0x26')](_0x169146,'id')}},'raw':!![]});})[_0x9f43('0x19')](function(_0x1813eb){return _0x1813eb[_0x9f43('0x26')](function(_0x303019){var _0x311443=_[_0x9f43('0x33')](_0x169146,['id',_0x303019['id']]);var _0x166ec0=filterAgentAttributes(_0x311443);_[_0x9f43('0x1f')](_0x303019,_0x166ec0);_0x303019[_0x9f43('0x34')]=getAgentStatus(_0x303019);return _0x303019;});})[_0x9f43('0x19')](function(_0x30a5c8){var _0x58312f=sortAgentsByStatus(_0x30a5c8,_0x4c2ba4);return _[_0x9f43('0x26')](_0x58312f,'id');})[_0x9f43('0x20')](function(_0x8dd379){throw _0x8dd379;});}exports[_0x9f43('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x1a909e){var _0x266f84={'fields':[],'order':null};var _0x360d11=_0x1a909e[_0x9f43('0x36')](',');_0x266f84[_0x9f43('0x37')]=_['filter'](_0x360d11,function(_0x389e17){if(!_0x389e17[_0x9f43('0x2d')](_0x9f43('0x34'))){return!![];}_0x266f84[_0x9f43('0x38')]=_['startsWith'](_0x389e17,'-')?_0x9f43('0x39'):'ASC';return![];});return _0x266f84;}exports[_0x9f43('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0xba31c2){if(_0xba31c2['includes'](_0x9f43('0x3b'))&&!_0xba31c2[_0x9f43('0x2d')]('internal')){var _0x35c58a=_0xba31c2['substring'](0x0,_0xba31c2['indexOf'](_0x9f43('0x3b')));_0xba31c2+=','+_0x35c58a+_0x9f43('0x3c');}return _0xba31c2;}exports[_0x9f43('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x1d697f,_0x4f775f){var _0x580abd=_0x1d697f[_0x9f43('0x3e')](function(_0x197574,_0x4634a1){if(_0x197574[_0x9f43('0x34')]===_0x4634a1[_0x9f43('0x34')]){if(_0x197574[_0x9f43('0x34')]==='pause'){if(_0x4f775f===_0x9f43('0x39')){return(_0x197574['pauseType']||'')<(_0x4634a1[_0x9f43('0x32')]||'')||_0x197574[_0x9f43('0x3b')][_0x9f43('0x3f')]()>_0x4634a1[_0x9f43('0x3b')]['toLowerCase']()?0x1:-0x1;}else{return(_0x197574[_0x9f43('0x32')]||'')<(_0x4634a1['pauseType']||'')||_0x197574[_0x9f43('0x3b')][_0x9f43('0x3f')]()>_0x4634a1['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x4f775f===_0x9f43('0x39')){return _0x197574[_0x9f43('0x3b')][_0x9f43('0x3f')]()<_0x4634a1[_0x9f43('0x3b')][_0x9f43('0x3f')]()?0x1:-0x1;}else{return _0x197574['fullname']['toLowerCase']()<_0x4634a1[_0x9f43('0x3b')][_0x9f43('0x3f')]()?-0x1:0x1;}}}else{if(_0x4f775f==='DESC'){return _0x197574['globalStatus']<_0x4634a1[_0x9f43('0x34')]?0x1:-0x1;}else{return _0x197574[_0x9f43('0x34')]<_0x4634a1[_0x9f43('0x34')]?-0x1:0x1;}}});return _0x580abd;}exports[_0x9f43('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x389daa){var _0x44bd00=['userpic',_0x9f43('0x41'),_0x9f43('0x42'),_0x9f43('0x43'),_0x9f43('0x32'),_0x9f43('0x43'),_0x9f43('0x3c'),_0x9f43('0x44'),_0x9f43('0x4'),_0x9f43('0x6'),_0x9f43('0x30'),'smsPause',_0x9f43('0x8'),_0x9f43('0x5'),_0x9f43('0x7'),_0x9f43('0x45'),_0x9f43('0x46'),_0x9f43('0x47'),_0x9f43('0x48'),_0x9f43('0x49'),_0x9f43('0x4a'),_0x9f43('0x4b'),_0x9f43('0x4c'),_0x9f43('0x4d'),_0x9f43('0x4e'),'whatsappCurrentCapacity',_0x9f43('0x4f'),_0x9f43('0x13'),'openchannelStatus','mailStatus',_0x9f43('0x17'),_0x9f43('0x50'),_0x9f43('0x14'),_0x9f43('0x10'),_0x9f43('0x51'),_0x9f43('0x52'),_0x9f43('0x53'),_0x9f43('0x54'),_0x9f43('0x55'),_0x9f43('0x56'),_0x9f43('0x57'),_0x9f43('0x58'),_0x9f43('0x59'),_0x9f43('0x5a'),_0x9f43('0x5b'),_0x9f43('0x5c'),'routealias'];var _0x140333=[_0x9f43('0x4'),'openchannelPause',_0x9f43('0x30'),_0x9f43('0x31'),_0x9f43('0x8'),_0x9f43('0x5'),_0x9f43('0x7'),_0x9f43('0x41')];var _0x138e04=_(_0x389daa)[_0x9f43('0x5d')](_0x140333)[_0x9f43('0x5e')](_0x44bd00)[_0x9f43('0x2a')]();return _0x138e04;}exports[_0x9f43('0x5f')]=filterAgentAttributes; \ No newline at end of file +var _0x5578=['pick','filterAgentAttributes','../../mysqldb','client','http','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','unknown','*pause','getAgentStatus','Queue','map','findOne','all','value','busy','getAgentIdsByStatus','resolve','includes','User','fullname','chatPause','faxPause','smsPause','pauseType','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','substring','internal','validateSortParameter','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','mailStatus','openchannelStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','routealias'];(function(_0xcf76f5,_0x49de1e){var _0x597348=function(_0x187f96){while(--_0x187f96){_0xcf76f5['push'](_0xcf76f5['shift']());}};_0x597348(++_0x49de1e);}(_0x5578,0xa8));var _0x8557=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5578[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0x8557('0x0'))['db'];var amiClient=jayson[_0x8557('0x1')][_0x8557('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x432ba7,_0x33ddcf){var _0x366f9c=[_0x432ba7['chatPause'],_0x432ba7['faxPause'],_0x432ba7[_0x8557('0x3')],_0x432ba7[_0x8557('0x4')],_0x432ba7['smsPause'],_0x432ba7[_0x8557('0x5')],_0x432ba7[_0x8557('0x6')]];if(!_0x33ddcf)return _[_0x8557('0x7')](_0x366f9c);var _0x5257b6=_[_0x8557('0x8')](_0x366f9c);return _0x5257b6[_0x8557('0x9')]>0x0&&_0x5257b6[_0x8557('0x9')]<_0x366f9c[_0x8557('0x9')]?!![]:![];}function isIdle(_0x4d0d0b){return _0x4d0d0b===_0x8557('0xa')||_0x4d0d0b==='unknown'||_0x4d0d0b===_0x8557('0xb')||_0x4d0d0b===_0x8557('0xc')||_[_0x8557('0xd')](_0x4d0d0b);}function isAgentIdle(_0x2735ac){if(_0x2735ac[_0x8557('0xe')]!==_0x8557('0xa')&&_0x2735ac[_0x8557('0x5')]){_0x2735ac[_0x8557('0xe')]=_0x8557('0xf');return![];}return _[_0x8557('0x7')]([_0x2735ac['chatStatus'],_0x2735ac[_0x8557('0x10')],_0x2735ac['mailStatus'],_0x2735ac[_0x8557('0x11')],_0x2735ac[_0x8557('0x12')],_0x2735ac[_0x8557('0xe')],_0x2735ac[_0x8557('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x8557('0x14')](_0x8557('0x15'),{})[_0x8557('0x16')](function(_0x3aa335){if(_0x3aa335['error']){throw new Error(_0x8557('0x17'));}var _0x1a8345=_0x3aa335[_0x8557('0x18')];return routingClient[_0x8557('0x14')](_0x8557('0x15'),{})['then'](function(_0x5bbeb5){if(_0x5bbeb5[_0x8557('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x11b965=_0x5bbeb5['result'];return _[_0x8557('0x1a')]({},_0x1a8345,_0x11b965);});})[_0x8557('0x1b')](function(_0x5f07d1){throw _0x5f07d1;});}exports[_0x8557('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x31160){var _0x1ace1c=_0x8557('0x1d');if(isAgentPaused(_0x31160))_0x1ace1c=_0x8557('0xf');else if(isAgentPaused(_0x31160,!![]))_0x1ace1c=_0x8557('0x1e');else if(isAgentIdle(_0x31160))_0x1ace1c=_0x8557('0xa');else _0x1ace1c='busy';return _0x1ace1c;}exports[_0x8557('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5696a3,_0x5c2fdf){var _0x7bd28d=_['isArray'](_0x5696a3)?_0x5696a3:[_0x5696a3];var _0x584130=_['startCase'](_0x5c2fdf)+_0x8557('0x20');var _0x4873d4=_[_0x8557('0x21')](_0x7bd28d,function(_0x10d1a9){return db[_0x584130][_0x8557('0x22')]({'where':{'id':_0x10d1a9}})[_0x8557('0x16')](function(_0x4d8f57){if(!_0x4d8f57)return[];return _0x4d8f57['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x8557('0x23')](_0x4873d4)['then'](function(_0x5943c0){var _0x27bbeb=_(_0x5943c0)['flatten']()[_0x8557('0x21')]('id')['uniq']()[_0x8557('0x24')]();return _0x27bbeb;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52ad0a,_0x4bb048,_0xe45141){try{if(_0x4bb048[_0x8557('0x9')]>0x0){_0x52ad0a=_0x52ad0a[_0x8557('0x8')](function(_0x34c616){return _0x4bb048['includes'](_0x34c616['id']);});}var _0x423ba5=_0x52ad0a[_0x8557('0x8')](function(_0x42eaab){var _0x8e6aa2=_0x8557('0x25');if(isAgentIdle(_0x42eaab)){_0x8e6aa2=_0x8557('0xa');}return _0x8e6aa2===_0xe45141;});return _[_0x8557('0x21')](_0x423ba5,'id');}catch(_0x61acc1){throw _0x61acc1;}}exports[_0x8557('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x9270df,_0x1bfda1,_0x432003){return Promise[_0x8557('0x27')]()[_0x8557('0x16')](function(){if(_0x1bfda1['length']>0x0){_0x9270df=_0x9270df[_0x8557('0x8')](function(_0x2358c6){return _0x1bfda1[_0x8557('0x28')](_0x2358c6['id']);});}return _0x9270df;})['then'](function(){return db[_0x8557('0x29')]['findAll']({'attributes':['id','name',_0x8557('0x2a'),_0x8557('0x2b'),_0x8557('0x2c'),'mailPause',_0x8557('0x4'),_0x8557('0x2d'),'voicePause',_0x8557('0x6'),_0x8557('0x2e')],'where':{'id':{'$in':_[_0x8557('0x21')](_0x9270df,'id')}},'raw':!![]});})[_0x8557('0x16')](function(_0x34934e){return _0x34934e[_0x8557('0x21')](function(_0x531a3e){var _0x3f81e1=_['find'](_0x9270df,['id',_0x531a3e['id']]);var _0x50eefc=filterAgentAttributes(_0x3f81e1);_[_0x8557('0x1a')](_0x531a3e,_0x50eefc);_0x531a3e[_0x8557('0x2f')]=getAgentStatus(_0x531a3e);return _0x531a3e;});})[_0x8557('0x16')](function(_0x2d089c){var _0x310cd4=sortAgentsByStatus(_0x2d089c,_0x432003);return _[_0x8557('0x21')](_0x310cd4,'id');})[_0x8557('0x1b')](function(_0xe91e82){throw _0xe91e82;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x526b35){var _0x1ab771={'fields':[],'order':null};var _0x928ff6=_0x526b35[_0x8557('0x30')](',');_0x1ab771[_0x8557('0x31')]=_['filter'](_0x928ff6,function(_0x4377d0){if(!_0x4377d0[_0x8557('0x28')](_0x8557('0x2f'))){return!![];}_0x1ab771[_0x8557('0x32')]=_[_0x8557('0x33')](_0x4377d0,'-')?_0x8557('0x34'):_0x8557('0x35');return![];});return _0x1ab771;}exports[_0x8557('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x5b7672){if(_0x5b7672[_0x8557('0x28')](_0x8557('0x2a'))&&!_0x5b7672[_0x8557('0x28')]('internal')){var _0x5c2efd=_0x5b7672[_0x8557('0x37')](0x0,_0x5b7672['indexOf'](_0x8557('0x2a')));_0x5b7672+=','+_0x5c2efd+_0x8557('0x38');}return _0x5b7672;}exports[_0x8557('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x1abd7e,_0x23131e){var _0x578943=_0x1abd7e['sort'](function(_0x27818a,_0x18d337){if(_0x27818a[_0x8557('0x2f')]===_0x18d337[_0x8557('0x2f')]){if(_0x27818a[_0x8557('0x2f')]===_0x8557('0xf')){if(_0x23131e===_0x8557('0x34')){return(_0x27818a[_0x8557('0x2e')]||'')<(_0x18d337[_0x8557('0x2e')]||'')||_0x27818a[_0x8557('0x2a')]['toLowerCase']()>_0x18d337['fullname'][_0x8557('0x3a')]()?0x1:-0x1;}else{return(_0x27818a[_0x8557('0x2e')]||'')<(_0x18d337[_0x8557('0x2e')]||'')||_0x27818a['fullname'][_0x8557('0x3a')]()>_0x18d337['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x23131e===_0x8557('0x34')){return _0x27818a[_0x8557('0x2a')][_0x8557('0x3a')]()<_0x18d337[_0x8557('0x2a')][_0x8557('0x3a')]()?0x1:-0x1;}else{return _0x27818a[_0x8557('0x2a')]['toLowerCase']()<_0x18d337[_0x8557('0x2a')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x23131e===_0x8557('0x34')){return _0x27818a[_0x8557('0x2f')]<_0x18d337['globalStatus']?0x1:-0x1;}else{return _0x27818a[_0x8557('0x2f')]<_0x18d337[_0x8557('0x2f')]?-0x1:0x1;}}});return _0x578943;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x16c141){var _0x6bd47e=[_0x8557('0x3b'),_0x8557('0x3c'),_0x8557('0x3d'),_0x8557('0x3e'),'pauseType',_0x8557('0x3e'),_0x8557('0x38'),_0x8557('0x3f'),_0x8557('0x2b'),_0x8557('0x4'),_0x8557('0x3'),_0x8557('0x2d'),_0x8557('0x6'),_0x8557('0x2c'),_0x8557('0x5'),_0x8557('0x40'),_0x8557('0x41'),_0x8557('0x42'),_0x8557('0x43'),_0x8557('0x44'),_0x8557('0x45'),'chatCurrentCapacity',_0x8557('0x46'),_0x8557('0x47'),_0x8557('0x48'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus',_0x8557('0x49'),_0x8557('0x12'),'whatsappStatus','faxStatus',_0x8557('0xe'),'chatStatusTime',_0x8557('0x4a'),'mailStatusTime','smsStatusTime',_0x8557('0x4b'),_0x8557('0x4c'),'voiceStatusTime',_0x8557('0x4d'),_0x8557('0x4e'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x8557('0x4f'),_0x8557('0x50')];var _0x4f8933=[_0x8557('0x2b'),_0x8557('0x4'),_0x8557('0x3'),_0x8557('0x2d'),_0x8557('0x6'),_0x8557('0x2c'),_0x8557('0x5'),_0x8557('0x3c')];var _0x350b08=_(_0x16c141)['omit'](_0x4f8933)[_0x8557('0x51')](_0x6bd47e)[_0x8557('0x24')]();return _0x350b08;}exports[_0x8557('0x52')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 45416a7..8991b84 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6407=['voice','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','inbound','concat','get','outbound','find','merge','initializeQueues','util','client','http','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime'];(function(_0x33cc7d,_0x5a1414){var _0x511eab=function(_0x4acdaa){while(--_0x4acdaa){_0x33cc7d['push'](_0x33cc7d['shift']());}};_0x511eab(++_0x5a1414);}(_0x6407,0x76));var _0x7640=function(_0xe7ba9,_0x2ff262){_0xe7ba9=_0xe7ba9-0x0;var _0x34e6bd=_0x6407[_0xe7ba9];return _0x34e6bd;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var util=require(_0x7640('0x0'));var amiClient=jayson[_0x7640('0x1')][_0x7640('0x2')]({'port':0x232a});var routingClient=jayson[_0x7640('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x7640('0x3'),_0x7640('0x4'),_0x7640('0x5'),_0x7640('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x7640('0x7'),_0x7640('0x8'),_0x7640('0x9'),_0x7640('0xa'),'notInUse',_0x7640('0xb'),_0x7640('0xc'),_0x7640('0xd'),_0x7640('0xe'),_0x7640('0xf'),_0x7640('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7640('0x11'),_0x7640('0x12'),'message',_0x7640('0x13'),_0x7640('0x14'),_0x7640('0x15'),_0x7640('0x16'),_0x7640('0x17'),_0x7640('0x18'),_0x7640('0x19'),_0x7640('0x1a'),_0x7640('0x1b'),_0x7640('0x1c'),'dialPredictiveInterval',_0x7640('0x1d'),_0x7640('0x1e'),_0x7640('0x1f'),'predictiveIntervalTotalCalls',_0x7640('0x20'),_0x7640('0x21'),'predictiveIntervalDroppedCallsCallersExit',_0x7640('0x22'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x3ce082,_0x2d8140){var _0x279c40=_0x2d8140===_0x7640('0x23')?amiClient:routingClient;return _0x279c40[_0x7640('0x24')](_['startCase'](_0x2d8140)+_0x7640('0x25'),_0x3ce082)[_0x7640('0x26')](function(_0x430df7){if(_0x430df7[_0x7640('0x27')])throw new Error(util[_0x7640('0x28')](_0x7640('0x29'),_0x2d8140));return _0x430df7[_0x7640('0x2a')];})[_0x7640('0x2b')](function(_0xac4afb){throw _0xac4afb;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0xe70b46,_0x29a528,_0x527ecc,_0x4680d3){var _0x1a8257=DEFAULT_QUEUE_ATTRIBUTES;if(_0x527ecc===_0x7640('0x23')){if(_0x4680d3===_0x7640('0x2c')){_0x1a8257=_0x1a8257[_0x7640('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4680d3==='outbound'){_0x1a8257=_0x1a8257[_0x7640('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xe70b46['map'](function(_0x1af7aa){var _0x3ba058=_0x1af7aa[_0x7640('0x2e')]({'plain':!![]});_0x3ba058[_0x7640('0x5')]=0x0;_0x3ba058[_0x7640('0xa')]=0x0;_0x3ba058[_0x7640('0x4')]=0x0;_0x3ba058[_0x7640('0x3')]=0x0;_0x3ba058[_0x7640('0x6')]=0x0;if(_0x527ecc===_0x7640('0x23')){_0x3ba058['talking']=0x0;_0x3ba058[_0x7640('0x7')]=0x0;if(_0x4680d3===_0x7640('0x2f')){_0x3ba058[_0x7640('0x11')]=0x0;_0x3ba058[_0x7640('0x12')]=0x0;}}var _0x44087a=_[_0x7640('0x30')](_0x29a528,['id',_0x3ba058['id']]);if(_0x44087a){_[_0x7640('0x31')](_0x3ba058,_['pick'](_0x44087a,_0x1a8257));}return _0x3ba058;});}exports[_0x7640('0x32')]=initializeQueues; \ No newline at end of file +var _0xe261=['format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','map','paused','find','merge','pick','lodash','jayson/promise','util','client','http','available','waiting','busy','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','voice','request','startCase','Queues','then','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe261,0xa5));var _0x1e26=function(_0x115401,_0x261e66){_0x115401=_0x115401-0x0;var _0x4ed7b8=_0xe261[_0x115401];return _0x4ed7b8;};'use strict';var _=require(_0x1e26('0x0'));var jayson=require(_0x1e26('0x1'));var util=require(_0x1e26('0x2'));var amiClient=jayson[_0x1e26('0x3')][_0x1e26('0x4')]({'port':0x232a});var routingClient=jayson[_0x1e26('0x3')][_0x1e26('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1e26('0x5'),'loggedIn','paused',_0x1e26('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x1e26('0x7'),'inUse',_0x1e26('0x8'),'loggedInDb','notInUse',_0x1e26('0x9'),_0x1e26('0xa'),_0x1e26('0xb'),_0x1e26('0xc'),_0x1e26('0xd'),_0x1e26('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1e26('0xf'),_0x1e26('0x10'),'message',_0x1e26('0x11'),_0x1e26('0x12'),_0x1e26('0x13'),_0x1e26('0x14'),_0x1e26('0x15'),_0x1e26('0x16'),_0x1e26('0x17'),_0x1e26('0x18'),_0x1e26('0x19'),'erlangBusyFactor',_0x1e26('0x1a'),_0x1e26('0x1b'),_0x1e26('0x1c'),'predictiveIntervalAvailable',_0x1e26('0x1d'),_0x1e26('0x1e'),_0x1e26('0x1f'),_0x1e26('0x20'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x2a82a4,_0x4fa3ee){var _0x5ab71d=_0x4fa3ee===_0x1e26('0x21')?amiClient:routingClient;return _0x5ab71d[_0x1e26('0x22')](_[_0x1e26('0x23')](_0x4fa3ee)+_0x1e26('0x24'),_0x2a82a4)[_0x1e26('0x25')](function(_0x70b166){if(_0x70b166[_0x1e26('0x26')])throw new Error(util[_0x1e26('0x27')](_0x1e26('0x28'),_0x4fa3ee));return _0x70b166['result'];})[_0x1e26('0x29')](function(_0x3f6e35){throw _0x3f6e35;});}exports[_0x1e26('0x2a')]=getRealtimeQueues;function initializeQueues(_0x4360f7,_0x31e43e,_0x53f214,_0x3cd685){var _0x57639e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x53f214===_0x1e26('0x21')){if(_0x3cd685===_0x1e26('0x2b')){_0x57639e=_0x57639e[_0x1e26('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3cd685===_0x1e26('0x2d')){_0x57639e=_0x57639e[_0x1e26('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4360f7[_0x1e26('0x2e')](function(_0x1821a4){var _0x50f03e=_0x1821a4['get']({'plain':!![]});_0x50f03e[_0x1e26('0x2f')]=0x0;_0x50f03e['loggedInDb']=0x0;_0x50f03e['loggedIn']=0x0;_0x50f03e[_0x1e26('0x5')]=0x0;_0x50f03e['waiting']=0x0;if(_0x53f214===_0x1e26('0x21')){_0x50f03e[_0x1e26('0xc')]=0x0;_0x50f03e[_0x1e26('0x7')]=0x0;if(_0x3cd685==='outbound'){_0x50f03e['pTalking']=0x0;_0x50f03e[_0x1e26('0x10')]=0x0;}}var _0x4d4dbe=_[_0x1e26('0x30')](_0x31e43e,['id',_0x50f03e['id']]);if(_0x4d4dbe){_[_0x1e26('0x31')](_0x50f03e,_[_0x1e26('0x32')](_0x4d4dbe,_0x57639e));}return _0x50f03e;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 2c31df2..caef8b4 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index c7065dc..7c1c352 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 _0x0b2f=['IPv4','internal','concat','head','mac','127.0.0.1','getFirstInterface','cpus','map','join','md5','update','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','orderBy','keys','filter','family'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x0b2f,0x197));var _0xf0b2=function(_0x5c4d4d,_0x180b6a){_0x5c4d4d=_0x5c4d4d-0x0;var _0x457a38=_0x0b2f[_0x5c4d4d];return _0x457a38;};'use strict';var _=require(_0xf0b2('0x0'));var os=require('os');var crypto=require(_0xf0b2('0x1'));var machine=require(_0xf0b2('0x2'));var exec=require(_0xf0b2('0x3'))['execSync'];var config=require(_0xf0b2('0x4'));function getInterfaces(){var _0x151799=[];var _0x419e1f=os['networkInterfaces']();var _0x371596=_[_0xf0b2('0x5')](_[_0xf0b2('0x6')](_0x419e1f));for(var _0x15e233=0x0;_0x15e233<_0x371596['length'];_0x15e233++){var _0xd2aa35=_0x419e1f[_0x371596[_0x15e233]][_0xf0b2('0x7')](function(_0x3488a7){return _0x3488a7[_0xf0b2('0x8')]===_0xf0b2('0x9')&&_0x3488a7[_0xf0b2('0xa')]===![];});_0x151799=_0x151799[_0xf0b2('0xb')](_0xd2aa35);}return _0x151799;}function getFirstInterface(){var _0x3e81aa=_[_0xf0b2('0xc')](getInterfaces());return{'macAddress':_0x3e81aa&&_0x3e81aa[_0xf0b2('0xd')]?_0x3e81aa[_0xf0b2('0xd')]:'00:00:00:00:00:00','ipAddress':_0x3e81aa&&_0x3e81aa['address']?_0x3e81aa['address']:_0xf0b2('0xe')};}exports[_0xf0b2('0xf')]=getFirstInterface;function getCPUhash(){var _0x45f05b=_['orderBy'](os[_0xf0b2('0x10')]()[_0xf0b2('0x11')](function(_0x2f585a){return _0x2f585a['model'];}))[_0xf0b2('0x12')](':');return crypto['createHash'](_0xf0b2('0x13'))[_0xf0b2('0x14')](_0x45f05b)['digest']('hex');}exports[_0xf0b2('0x15')]=function(){var _0xe1ef39=os[_0xf0b2('0x16')]();var _0x6bc1e1=/[0-9a-f-]{36}/;if(config[_0xf0b2('0x17')]&&_0x6bc1e1['test'](config[_0xf0b2('0x17')])){return config[_0xf0b2('0x17')];}else if(_0xe1ef39===_0xf0b2('0x18')){return exec(_0xf0b2('0x19'),{'encoding':_0xf0b2('0x1a')})[_0xf0b2('0x1b')]('\x0d\x0a','');}else{var _0x2bdea4=getFirstInterface();var _0x3dd0f3=getCPUhash();var _0x14ac40=_0x3dd0f3+'|'+os['hostname']()+'|'+_0x2bdea4['macAddress']+'|'+_0x2bdea4[_0xf0b2('0x1c')];var _0x578c64=crypto['createHash'](_0xf0b2('0x13'))['update'](_0x14ac40)[_0xf0b2('0x1d')](_0xf0b2('0x1e'));return _0x578c64['substring'](0x0,0x8)+'-'+_0x578c64[_0xf0b2('0x1f')](0x8,0xc)+'-'+_0x578c64[_0xf0b2('0x1f')](0xc,0x10)+'-'+_0x578c64[_0xf0b2('0x1f')](0x10,0x14)+'-'+_0x578c64['substring'](0x14);}}; \ No newline at end of file +var _0x2daf=['127.0.0.1','getFirstInterface','cpus','model','createHash','md5','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x2a169c,_0x3aec5d){var _0x2d25da=function(_0x275fc3){while(--_0x275fc3){_0x2a169c['push'](_0x2a169c['shift']());}};_0x2d25da(++_0x3aec5d);}(_0x2daf,0x1f0));var _0xf2da=function(_0x777456,_0x57998f){_0x777456=_0x777456-0x0;var _0x5895b0=_0x2daf[_0x777456];return _0x5895b0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf2da('0x0'));var machine=require(_0xf2da('0x1'));var exec=require(_0xf2da('0x2'))['execSync'];var config=require(_0xf2da('0x3'));function getInterfaces(){var _0x10622d=[];var _0x3b5058=os[_0xf2da('0x4')]();var _0x19b22c=_[_0xf2da('0x5')](_[_0xf2da('0x6')](_0x3b5058));for(var _0x224e80=0x0;_0x224e80<_0x19b22c[_0xf2da('0x7')];_0x224e80++){var _0x52f408=_0x3b5058[_0x19b22c[_0x224e80]][_0xf2da('0x8')](function(_0x5f41a3){return _0x5f41a3['family']===_0xf2da('0x9')&&_0x5f41a3[_0xf2da('0xa')]===![];});_0x10622d=_0x10622d[_0xf2da('0xb')](_0x52f408);}return _0x10622d;}function getFirstInterface(){var _0xd95799=_[_0xf2da('0xc')](getInterfaces());return{'macAddress':_0xd95799&&_0xd95799[_0xf2da('0xd')]?_0xd95799[_0xf2da('0xd')]:_0xf2da('0xe'),'ipAddress':_0xd95799&&_0xd95799[_0xf2da('0xf')]?_0xd95799[_0xf2da('0xf')]:_0xf2da('0x10')};}exports[_0xf2da('0x11')]=getFirstInterface;function getCPUhash(){var _0x422665=_[_0xf2da('0x5')](os[_0xf2da('0x12')]()['map'](function(_0x693754){return _0x693754[_0xf2da('0x13')];}))['join'](':');return crypto[_0xf2da('0x14')](_0xf2da('0x15'))['update'](_0x422665)[_0xf2da('0x16')](_0xf2da('0x17'));}exports[_0xf2da('0x18')]=function(){var _0x461a80=os[_0xf2da('0x19')]();var _0x17fbb2=/[0-9a-f-]{36}/;if(config[_0xf2da('0x1a')]&&_0x17fbb2['test'](config[_0xf2da('0x1a')])){return config[_0xf2da('0x1a')];}else if(_0x461a80==='win32'){return exec(_0xf2da('0x1b'),{'encoding':'utf8'})[_0xf2da('0x1c')]('\x0d\x0a','');}else{var _0x221f5f=getFirstInterface();var _0x290019=getCPUhash();var _0x4655a5=_0x290019+'|'+os['hostname']()+'|'+_0x221f5f[_0xf2da('0x1d')]+'|'+_0x221f5f[_0xf2da('0x1e')];var _0x5537a3=crypto[_0xf2da('0x14')](_0xf2da('0x15'))['update'](_0x4655a5)[_0xf2da('0x16')]('hex');return _0x5537a3[_0xf2da('0x1f')](0x0,0x8)+'-'+_0x5537a3[_0xf2da('0x1f')](0x8,0xc)+'-'+_0x5537a3['substring'](0xc,0x10)+'-'+_0x5537a3[_0xf2da('0x1f')](0x10,0x14)+'-'+_0x5537a3[_0xf2da('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index ccfcdfb..24d1f89 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 _0x298f=['update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','exports','GET','catch','get','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x298f,0x65));var _0xf298=function(_0x2575c9,_0x59410d){_0x2575c9=_0x2575c9-0x0;var _0x42c20c=_0x298f[_0x2575c9];return _0x42c20c;};'use strict';var util=require(_0xf298('0x0'));var moment=require('moment');var rp=require(_0xf298('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xf298('0x2'))(module,'version');var db=require(_0xf298('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xf298('0x4'));var logger=require(_0xf298('0x5'))(_0xf298('0x6'));var HOST=_0xf298('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x352c2e){return new BPromise(function(_0x3c0f80,_0xe6d2aa){var _0x454a28=util[_0xf298('0x8')](_0xf298('0x9'),HOST,_0x352c2e,module['exports'][_0xf298('0xa')]);if(oldToken){_0x454a28=util[_0xf298('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x352c2e,module[_0xf298('0xb')][_0xf298('0xa')],oldToken);}var _0x1177a9={'uri':_0x454a28,'method':_0xf298('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x1177a9)['then'](function(_0x2afc2a){_0x3c0f80(_0x2afc2a);})[_0xf298('0xd')](function(_0xf04d1b){_0xe6d2aa(_0xf04d1b);});});}function manageLicense(_0xfb75a0,_0x555f00){var _0x26d2a3=_0x555f00[_0xf298('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x26d2a3[_0xf298('0xf')]!==_0xfb75a0&&!_0x26d2a3[_0xf298('0x10')]){oldToken=_0x26d2a3[_0xf298('0xf')];}httpRequest(_0xfb75a0)[_0xf298('0x11')](function(_0x5faa32){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5faa32[_0xf298('0x12')]){isOldTokenSent=![];if(!_0x26d2a3[_0xf298('0x6')]&&_0x26d2a3[_0xf298('0x6')]!=_0x5faa32[_0xf298('0x6')]||_0x26d2a3[_0xf298('0x6')]&&_0x26d2a3['data2']){logger[_0xf298('0x13')](_0xf298('0x14'));}if(_0x26d2a3[_0xf298('0x6')]&&!_0x26d2a3[_0xf298('0x10')]&&_0x26d2a3['license']!=_0x5faa32[_0xf298('0x6')]){logger[_0xf298('0x13')](_0xf298('0x15'));}if(_0x26d2a3[_0xf298('0x6')]&&!_0x26d2a3[_0xf298('0x10')]&&_0x26d2a3[_0xf298('0x6')]==_0x5faa32[_0xf298('0x6')]){return _0x555f00;}return _0x555f00[_0xf298('0x16')]({'data1':_0xfb75a0,'data2':null,'license':_0x5faa32['license']});}else{if(_0x5faa32['license']||_0x26d2a3[_0xf298('0x6')]){if(!_0x26d2a3[_0xf298('0x10')]){if(_0x26d2a3['data1']==_0xfb75a0){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xf298('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xf298('0x13')](_0xf298('0x18'),_0x26d2a3[_0xf298('0xf')],_0xfb75a0);}logger[_0xf298('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xf298('0x19')](),moment()[_0xf298('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x555f00[_0xf298('0x16')]({'data2':encryptor[_0xf298('0x1a')](moment()[_0xf298('0x8')](_0xf298('0x1b')))});}else{if(moment()[_0xf298('0x1c')](encryptor[_0xf298('0x1d')](_0x26d2a3[_0xf298('0x10')]),_0xf298('0x1e'))>DAYS){logger[_0xf298('0x13')](_0xf298('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x555f00['update']({'data1':_0xfb75a0,'data2':null,'license':null});}}}else{if(_0x26d2a3[_0xf298('0xf')]!=_0xfb75a0){logger[_0xf298('0x13')](_0xf298('0x18'),_0x26d2a3[_0xf298('0xf')],_0xfb75a0);return _0x555f00[_0xf298('0x16')]({'data1':_0xfb75a0,'data2':null,'license':null});}}}return _0x555f00;})[_0xf298('0x11')](function(_0x105dad){_0x555f00=_0x105dad;})[_0xf298('0xd')](function(_0x36c85a){logger[_0xf298('0x20')](_0x36c85a[_0xf298('0x21')]);})[_0xf298('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xf298('0x23')](),_0x555f00);},TIME);});}function defaultLicense(){var _0xbe86cd=hardware[_0xf298('0x23')]();if(_0xbe86cd){return db[_0xf298('0x24')][_0xf298('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0xbe86cd}})[_0xf298('0x26')](function(_0x102a61,_0xce1718){logger[_0xf298('0x13')](_0xf298('0x27'),_0xbe86cd);manageLicense(_0xbe86cd,_0x102a61);})[_0xf298('0xd')](function(_0x180c92){logger['error'](_0x180c92[_0xf298('0x21')]);});}}exports[_0xf298('0x28')]=defaultLicense; \ No newline at end of file +var _0xa32e=['catch','message','finally','findOrCreate','spread','default','util','request-promise','../../mysqldb','../../components/encryptor','./hardware','license','format','exports','version','GET','then','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x54ed79,_0xb0d910){var _0x36fe0f=function(_0x1f2235){while(--_0x1f2235){_0x54ed79['push'](_0x54ed79['shift']());}};_0x36fe0f(++_0xb0d910);}(_0xa32e,0x1f3));var _0xea32=function(_0x47e554,_0x4d1dda){_0x47e554=_0x47e554-0x0;var _0x4190db=_0xa32e[_0x47e554];return _0x4190db;};'use strict';var util=require(_0xea32('0x0'));var moment=require('moment');var rp=require(_0xea32('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0xea32('0x2'))['db'];var encryptor=require(_0xea32('0x3'));var hardware=require(_0xea32('0x4'));var logger=require('../logger')(_0xea32('0x5'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x13f8d5){return new BPromise(function(_0x1f8a50,_0x2fb2cf){var _0x25edce=util[_0xea32('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x13f8d5,module[_0xea32('0x7')]['version']);if(oldToken){_0x25edce=util[_0xea32('0x6')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x13f8d5,module['exports'][_0xea32('0x8')],oldToken);}var _0x2f1b6a={'uri':_0x25edce,'method':_0xea32('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x2f1b6a)[_0xea32('0xa')](function(_0x161bf0){_0x1f8a50(_0x161bf0);})['catch'](function(_0x528fba){_0x2fb2cf(_0x528fba);});});}function manageLicense(_0x51d0e1,_0xf5f65d){var _0x2a64d6=_0xf5f65d['get']({'plain':!![]});if(!isOldTokenSent&&_0x2a64d6['data1']!==_0x51d0e1&&!_0x2a64d6[_0xea32('0xb')]){oldToken=_0x2a64d6['data1'];}httpRequest(_0x51d0e1)[_0xea32('0xa')](function(_0x10610c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x10610c[_0xea32('0xc')]){isOldTokenSent=![];if(!_0x2a64d6[_0xea32('0x5')]&&_0x2a64d6[_0xea32('0x5')]!=_0x10610c[_0xea32('0x5')]||_0x2a64d6['license']&&_0x2a64d6[_0xea32('0xb')]){logger[_0xea32('0xd')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2a64d6[_0xea32('0x5')]&&!_0x2a64d6[_0xea32('0xb')]&&_0x2a64d6[_0xea32('0x5')]!=_0x10610c[_0xea32('0x5')]){logger[_0xea32('0xd')](_0xea32('0xe'));}if(_0x2a64d6[_0xea32('0x5')]&&!_0x2a64d6['data2']&&_0x2a64d6['license']==_0x10610c[_0xea32('0x5')]){return _0xf5f65d;}return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':_0x10610c[_0xea32('0x5')]});}else{if(_0x10610c[_0xea32('0x5')]||_0x2a64d6[_0xea32('0x5')]){if(!_0x2a64d6['data2']){if(_0x2a64d6[_0xea32('0x10')]==_0x51d0e1){GRAY_PERIOD_REASON='Disabled';logger[_0xea32('0xd')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xea32('0xd')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2a64d6[_0xea32('0x10')],_0x51d0e1);}logger[_0xea32('0xd')](_0xea32('0x11'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xea32('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0xf5f65d[_0xea32('0xf')]({'data2':encryptor[_0xea32('0x12')](moment()[_0xea32('0x6')](_0xea32('0x13')))});}else{if(moment()['diff'](encryptor[_0xea32('0x14')](_0x2a64d6['data2']),_0xea32('0x15'))>DAYS){logger['info'](_0xea32('0x16'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':null});}}}else{if(_0x2a64d6[_0xea32('0x10')]!=_0x51d0e1){logger[_0xea32('0xd')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2a64d6[_0xea32('0x10')],_0x51d0e1);return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':null});}}}return _0xf5f65d;})['then'](function(_0x128bdd){_0xf5f65d=_0x128bdd;})[_0xea32('0x17')](function(_0x5d81b7){logger['error'](_0x5d81b7[_0xea32('0x18')]);})[_0xea32('0x19')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xf5f65d);},TIME);});}function defaultLicense(){var _0x2cd1fe=hardware['getUuid']();if(_0x2cd1fe){return db['License'][_0xea32('0x1a')]({'where':{'id':0x1},'defaults':{'data1':_0x2cd1fe}})[_0xea32('0x1b')](function(_0x5d83d1,_0x4ae011){logger[_0xea32('0xd')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2cd1fe);manageLicense(_0x2cd1fe,_0x5d83d1);})[_0xea32('0x17')](function(_0x3a8576){logger['error'](_0x3a8576[_0xea32('0x18')]);});}}exports[_0xea32('0x1c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0a75b27..827e7f8 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 _0x755b=['License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','deadline','add','days','grayReason','changed','disabled','data1','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','defaults','then','uuid','license','isEmpty'];(function(_0x2bc678,_0x39864e){var _0x4db407=function(_0x208a8f){while(--_0x208a8f){_0x2bc678['push'](_0x2bc678['shift']());}};_0x4db407(++_0x39864e);}(_0x755b,0x89));var _0xb755=function(_0x1adc9f,_0x4f767f){_0x1adc9f=_0x1adc9f-0x0;var _0x4a790f=_0x755b[_0x1adc9f];return _0x4a790f;};'use strict';var util=require(_0xb755('0x0'));var _=require(_0xb755('0x1'));var moment=require(_0xb755('0x2'));var BPromise=require(_0xb755('0x3'));var hardware=require(_0xb755('0x4'));var encryptor=require(_0xb755('0x5'));var db=require(_0xb755('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb755('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xb755('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb755('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb755('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x232bc0){return new BPromise(function(_0xbc04b6,_0x525587){return db[_0xb755('0xa')]['find'](_[_0xb755('0xb')](_0x232bc0,{'raw':!![],'where':{'id':0x1}}))[_0xb755('0xc')](function(_0x249b00){return checkLicense(_0x249b00,null);})['then'](function(_0x245968){_0xbc04b6(_0x245968);return;})['catch'](function(_0x5ff10f){_0x525587(_0x5ff10f);});});}function checkLicense(_0x4dfd45,_0x40596d){if(!_0x4dfd45){demoLicense[_0xb755('0xd')]=_0x4dfd45['data1'];return demoLicense;}try{var _0x39d7fb=_0x40596d||_0x4dfd45[_0xb755('0xe')];if(_[_0xb755('0xf')](_0x39d7fb)){throw new Error(_0xb755('0x10'));}var _0x396521=_0x4dfd45['data1'];var _0x4f8c1e=_0x4dfd45[_0xb755('0x11')];var _0x1fbc8d=_0x396521[_0xb755('0x12')]('-')[0x4];var _0xa6f43a=_0x396521[_0xb755('0x12')]('-')[0x0];var _0x28e7fd=encryptor[_0xb755('0x13')](_0x39d7fb,util[_0xb755('0x14')](_0xb755('0x15'),_0x1fbc8d,_0x396521,_0xa6f43a));var _0x3a23e6=JSON[_0xb755('0x16')](_0x28e7fd);_0x3a23e6['demo']=![];_0x3a23e6[_0xb755('0xd')]=_0x396521;_0x3a23e6[_0xb755('0x17')]=hardware[_0xb755('0x8')]();if(_0x4f8c1e){var _0x3751d8=encryptor[_0xb755('0x13')](_0x4f8c1e);_0x3a23e6['gray']=_0x3751d8;_0x3a23e6[_0xb755('0x18')]=moment(_0x3751d8)[_0xb755('0x19')](0x7,_0xb755('0x1a'))[_0xb755('0x14')]();_0x3a23e6[_0xb755('0x1b')]=_0x3a23e6[_0xb755('0xd')]!=_0x3a23e6['machineUuid']?_0xb755('0x1c'):_0xb755('0x1d');}return _0x3a23e6;}catch(_0x23ed19){breakingLicense['uuid']=_0x4dfd45[_0xb755('0x1e')];breakingLicense[_0xb755('0x1f')]=_0x23ed19[_0xb755('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x573b8b,_0x17d4a6){getLicense()[_0xb755('0xc')](function(_0x188d47){return db[_0xb755('0x20')][_0xb755('0x21')]({'attributes':[_0xb755('0x22'),[db[_0xb755('0x23')]['fn'](_0xb755('0x24'),db[_0xb755('0x23')][_0xb755('0x25')](_0xb755('0x22'))),_0xb755('0x26')]],'group':_0xb755('0x22'),'where':{'role':{'$or':[_0xb755('0x27'),_0xb755('0x28'),_0xb755('0x29')]}},'raw':!![]})[_0xb755('0xc')](function(_0x48f7dd){var _0x339c94={'user':_0x188d47[_0xb755('0x2a')]||0x0,'telephone':_0x188d47[_0xb755('0x2b')]||0x0};_0x48f7dd[_0xb755('0x2c')](function(_0x1f678f){var _0x29b267=_0x1f678f[_0xb755('0x22')]===_0xb755('0x27')?_0xb755('0x28'):_0x1f678f[_0xb755('0x22')];_0x339c94[_0x29b267]-=_0x1f678f[_0xb755('0x26')];if(_0x339c94[_0x29b267]<0x0)_0x339c94[_0x29b267]=0x0;});_0x573b8b(_0x339c94);return;});})[_0xb755('0x2d')](function(_0x1d2d40){_0x17d4a6(_0x1d2d40);});});}function checkUserLimits(_0x1da194){return new BPromise(function(_0x17058c,_0x255c76){getLimits()[_0xb755('0xc')](function(_0x586eb8){var _0x55140c=_[_0xb755('0x2e')](_[_0xb755('0x2f')](_0x1da194,_0xb755('0x22')),[_0xb755('0x27'),'user',_0xb755('0x29')]);var _0x157ebc=(_0x55140c[_0xb755('0x27')]||0x0)+(_0x55140c[_0xb755('0x28')]||0x0);var _0x122c03=_0x55140c[_0xb755('0x29')]||0x0;if(_0x157ebc>_0x586eb8[_0xb755('0x28')])return _0x255c76(_0xb755('0x30'));if(_0x122c03>_0x586eb8['telephone'])return _0x255c76(_0xb755('0x31'));return _0x17058c();})[_0xb755('0x2d')](function(_0x14edf3){_0x255c76(_0x14edf3);});});}module[_0xb755('0x32')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xfdf9=['machineUuid','gray','deadline','add','days','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col','count','telephone','telephones','forEach','admin','user','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo'];(function(_0x2cdeb3,_0x2e5aa0){var _0x4f81d6=function(_0x447d5c){while(--_0x447d5c){_0x2cdeb3['push'](_0x2cdeb3['shift']());}};_0x4f81d6(++_0x2e5aa0);}(_0xfdf9,0x1dc));var _0x9fdf=function(_0x4568a0,_0x3670bb){_0x4568a0=_0x4568a0-0x0;var _0x1bb2de=_0xfdf9[_0x4568a0];return _0x1bb2de;};'use strict';var util=require(_0x9fdf('0x0'));var _=require(_0x9fdf('0x1'));var moment=require('moment');var BPromise=require(_0x9fdf('0x2'));var hardware=require(_0x9fdf('0x3'));var encryptor=require(_0x9fdf('0x4'));var db=require(_0x9fdf('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fdf('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9fdf('0x7'),'machineUuid':hardware[_0x9fdf('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fdf('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9fdf('0x9'),'machineUuid':hardware[_0x9fdf('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4d4bb9){return new BPromise(function(_0x494af8,_0x19a2aa){return db[_0x9fdf('0xa')][_0x9fdf('0xb')](_[_0x9fdf('0xc')](_0x4d4bb9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xe70fe1){return checkLicense(_0xe70fe1,null);})[_0x9fdf('0xd')](function(_0x542ce0){_0x494af8(_0x542ce0);return;})['catch'](function(_0x26af3f){_0x19a2aa(_0x26af3f);});});}function checkLicense(_0x2c7d56,_0x264bb2){if(!_0x2c7d56){demoLicense[_0x9fdf('0xe')]=_0x2c7d56[_0x9fdf('0xf')];return demoLicense;}try{var _0x16221f=_0x264bb2||_0x2c7d56['license'];if(_['isEmpty'](_0x16221f)){throw new Error(_0x9fdf('0x10'));}var _0x2202c4=_0x2c7d56[_0x9fdf('0xf')];var _0x409bee=_0x2c7d56[_0x9fdf('0x11')];var _0x31111e=_0x2202c4[_0x9fdf('0x12')]('-')[0x4];var _0xa91a9f=_0x2202c4['split']('-')[0x0];var _0x3cc4d2=encryptor[_0x9fdf('0x13')](_0x16221f,util[_0x9fdf('0x14')](_0x9fdf('0x15'),_0x31111e,_0x2202c4,_0xa91a9f));var _0x513afb=JSON[_0x9fdf('0x16')](_0x3cc4d2);_0x513afb[_0x9fdf('0x17')]=![];_0x513afb[_0x9fdf('0xe')]=_0x2202c4;_0x513afb[_0x9fdf('0x18')]=hardware[_0x9fdf('0x8')]();if(_0x409bee){var _0x205daf=encryptor['decryptString'](_0x409bee);_0x513afb[_0x9fdf('0x19')]=_0x205daf;_0x513afb[_0x9fdf('0x1a')]=moment(_0x205daf)[_0x9fdf('0x1b')](0x7,_0x9fdf('0x1c'))[_0x9fdf('0x14')]();_0x513afb[_0x9fdf('0x1d')]=_0x513afb[_0x9fdf('0xe')]!=_0x513afb[_0x9fdf('0x18')]?_0x9fdf('0x1e'):'disabled';}return _0x513afb;}catch(_0x454f9e){breakingLicense['uuid']=_0x2c7d56[_0x9fdf('0xf')];breakingLicense[_0x9fdf('0x1f')]=_0x454f9e[_0x9fdf('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x28ad6d,_0x5ddd5f){getLicense()[_0x9fdf('0xd')](function(_0x43fbfe){return db[_0x9fdf('0x20')][_0x9fdf('0x21')]({'attributes':[_0x9fdf('0x22'),[db[_0x9fdf('0x23')]['fn'](_0x9fdf('0x24'),db[_0x9fdf('0x23')][_0x9fdf('0x25')]('role')),_0x9fdf('0x26')]],'group':_0x9fdf('0x22'),'where':{'role':{'$or':['admin','user',_0x9fdf('0x27')]}},'raw':!![]})[_0x9fdf('0xd')](function(_0x2aa61d){var _0x371455={'user':_0x43fbfe['users']||0x0,'telephone':_0x43fbfe[_0x9fdf('0x28')]||0x0};_0x2aa61d[_0x9fdf('0x29')](function(_0x1e189e){var _0x45dc5f=_0x1e189e[_0x9fdf('0x22')]===_0x9fdf('0x2a')?_0x9fdf('0x2b'):_0x1e189e[_0x9fdf('0x22')];_0x371455[_0x45dc5f]-=_0x1e189e['count'];if(_0x371455[_0x45dc5f]<0x0)_0x371455[_0x45dc5f]=0x0;});_0x28ad6d(_0x371455);return;});})[_0x9fdf('0x2c')](function(_0x1d09c8){_0x5ddd5f(_0x1d09c8);});});}function checkUserLimits(_0x20e413){return new BPromise(function(_0x2de549,_0x32fcf6){getLimits()[_0x9fdf('0xd')](function(_0x46a16b){var _0x4603ce=_[_0x9fdf('0x2d')](_[_0x9fdf('0x2e')](_0x20e413,'role'),[_0x9fdf('0x2a'),_0x9fdf('0x2b'),_0x9fdf('0x27')]);var _0x1b16db=(_0x4603ce['admin']||0x0)+(_0x4603ce['user']||0x0);var _0x507f6a=_0x4603ce[_0x9fdf('0x27')]||0x0;if(_0x1b16db>_0x46a16b[_0x9fdf('0x2b')])return _0x32fcf6(_0x9fdf('0x2f'));if(_0x507f6a>_0x46a16b[_0x9fdf('0x27')])return _0x32fcf6(_0x9fdf('0x30'));return _0x2de549();})['catch'](function(_0x4d7fa1){_0x32fcf6(_0x4d7fa1);});});}module[_0x9fdf('0x31')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 7a61902..de6b577 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 _0x7916=['myappanuglar-secret','app-id','exports'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0x7916,0x128));var _0x6791=function(_0x5b41f1,_0x1a72d0){_0x5b41f1=_0x5b41f1-0x0;var _0x14cb16=_0x7916[_0x5b41f1];return _0x14cb16;};'use strict';module[_0x6791('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x6791('0x1'),'GOOGLE_ID':_0x6791('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x9f0e=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x136deb,_0x1be08c){var _0x5c009d=function(_0xc0eb7a){while(--_0xc0eb7a){_0x136deb['push'](_0x136deb['shift']());}};_0x5c009d(++_0x1be08c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x40e976,_0xfaa87d){_0x40e976=_0x40e976-0x0;var _0x267707=_0x9f0e[_0x40e976];return _0x267707;};'use strict';module[_0xe9f0('0x0')]={'DOMAIN':_0xe9f0('0x1'),'SESSION_SECRET':_0xe9f0('0x2'),'GOOGLE_ID':_0xe9f0('0x3'),'GOOGLE_SECRET':_0xe9f0('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ccc069a..4c840ad 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6699=['../utils/loggers','exports'];(function(_0x5a7993,_0x192450){var _0x5d89b6=function(_0x2b4125){while(--_0x2b4125){_0x5a7993['push'](_0x5a7993['shift']());}};_0x5d89b6(++_0x192450);}(_0x6699,0x126));var _0x9669=function(_0x25f056,_0x5e5739){_0x25f056=_0x25f056-0x0;var _0x2fb713=_0x6699[_0x25f056];return _0x2fb713;};'use strict';var fileLogger=require(_0x9669('0x0'))['fileLogger'];module[_0x9669('0x1')]=fileLogger; \ No newline at end of file +var _0x7567=['../utils/loggers','fileLogger','exports'];(function(_0x248228,_0x471d26){var _0xfae98c=function(_0x3dc4b1){while(--_0x3dc4b1){_0x248228['push'](_0x248228['shift']());}};_0xfae98c(++_0x471d26);}(_0x7567,0x120));var _0x7756=function(_0xc8a52d,_0x63015b){_0xc8a52d=_0xc8a52d-0x0;var _0x358d2d=_0x7567[_0xc8a52d];return _0x358d2d;};'use strict';var fileLogger=require(_0x7756('0x0'))[_0x7756('0x1')];module[_0x7756('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index ea10e43..7af7522 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 _0x334b=['../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x41cdde,_0x4bd78c){var _0x2dec1e=function(_0xc4e978){while(--_0xc4e978){_0x41cdde['push'](_0x41cdde['shift']());}};_0x2dec1e(++_0x4bd78c);}(_0x334b,0xd2));var _0xb334=function(_0x30129d,_0x230171){_0x30129d=_0x30129d-0x0;var _0x496742=_0x334b[_0x30129d];return _0x496742;};'use strict';var path=require(_0xb334('0x0'));var os=require('os');var config={'apps':[{'name':_0xb334('0x1'),'script':path[_0xb334('0x2')](__dirname,_0xb334('0x3'))},{'name':_0xb334('0x4'),'script':path['join'](__dirname,_0xb334('0x5'))},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0xb334('0x6'))},{'name':_0xb334('0x7'),'script':path[_0xb334('0x2')](__dirname,_0xb334('0x8'))},{'name':_0xb334('0x9'),'script':path[_0xb334('0x2')](__dirname,_0xb334('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x6ff1=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x1624f5,_0xa2f147){var _0x23b431=function(_0x5393d4){while(--_0x5393d4){_0x1624f5['push'](_0x1624f5['shift']());}};_0x23b431(++_0xa2f147);}(_0x6ff1,0x185));var _0x16ff=function(_0x1452ca,_0x425d39){_0x1452ca=_0x1452ca-0x0;var _0x583f0b=_0x6ff1[_0x1452ca];return _0x583f0b;};'use strict';var path=require(_0x16ff('0x0'));var os=require('os');var config={'apps':[{'name':_0x16ff('0x1'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x3'))},{'name':_0x16ff('0x4'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x5'))},{'name':_0x16ff('0x6'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x7'))},{'name':'email','script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x8'))},{'name':'routing','script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x9'))},{'name':_0x16ff('0xa'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0xb'))}]};module[_0x16ff('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8ecf47e..15e007d 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 _0x524b=['saved','pm2','./config','connect','connected','then','start','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x2eb049,_0x271a0f){var _0xcccee3=function(_0x526539){while(--_0x526539){_0x2eb049['push'](_0x2eb049['shift']());}};_0xcccee3(++_0x271a0f);}(_0x524b,0x15f));var _0xb524=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x524b[_0x565ed7];return _0x183ad7;};'use strict';var pm2=require(_0xb524('0x0'));var BPromise=require('bluebird');var config=require(_0xb524('0x1'));function connect(){return new BPromise(function(_0x4aad5f,_0x14f220){return pm2[_0xb524('0x2')](function(_0x1c2e84){if(_0x1c2e84){return _0x14f220(_0x1c2e84);}return _0x4aad5f(_0xb524('0x3'));});});};exports['start']=function(_0x16c281){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x3db566,_0x1e8400){return pm2[_0xb524('0x5')](_0x16c281,function(_0x54d989,_0x39e421){if(_0x54d989){return _0x1e8400(_0x54d989);}pm2['disconnect']();return _0x3db566(_0x39e421);});});});};exports[_0xb524('0x6')]=function(_0x9d7274){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x3e18e6,_0x46fb26){return pm2[_0xb524('0x6')](_0x9d7274,function(_0x421f83,_0x1fbee1){if(_0x421f83){return _0x46fb26(_0x421f83);}pm2[_0xb524('0x7')]();return _0x3e18e6(_0x1fbee1);});});});};exports[_0xb524('0x8')]=function(_0x300974){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x1ade19,_0x263a83){return pm2[_0xb524('0x8')](_0x300974,function(_0x4cc820,_0x2ed359){if(_0x4cc820){return _0x263a83(_0x4cc820);}pm2[_0xb524('0x7')]();return _0x1ade19(_0x2ed359);});});});};exports[_0xb524('0x9')]=function(){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x253ec6,_0xb98a22){return pm2[_0xb524('0x9')](function(_0x568f79,_0x4dc996){if(_0x568f79){return _0xb98a22(_0x568f79);}pm2['disconnect']();return _0x253ec6(_0x4dc996);});});});};exports['describe']=function(_0x3a1564){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x7859a7,_0x39cf3a){return pm2[_0xb524('0xa')](_0x3a1564,function(_0x32014b,_0x2075bc){if(_0x32014b){return _0x39cf3a(_0x32014b);}pm2['disconnect']();return _0x7859a7(_0x2075bc);});});});};exports['delete']=function(_0x2a3706){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x702244,_0x26f87f){return pm2[_0xb524('0xb')](_0x2a3706,function(_0x3eea09,_0x182089){if(_0x3eea09){return _0x26f87f(_0x3eea09);}pm2['disconnect']();return _0x702244(_0x182089);});});});};exports[_0xb524('0xc')]=function(){return connect()[_0xb524('0x4')](function(){return new BPromise(function(_0x118d9f,_0x5221e5){return pm2[_0xb524('0xc')](function(_0x2eefdd){if(_0x2eefdd){return _0x5221e5(_0x2eefdd);}return _0x118d9f(_0xb524('0xd'));});});});}; \ No newline at end of file +var _0x62f9=['connect','start','then','stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config'];(function(_0x3be478,_0x5ab600){var _0x3f7689=function(_0x53c5db){while(--_0x53c5db){_0x3be478['push'](_0x3be478['shift']());}};_0x3f7689(++_0x5ab600);}(_0x62f9,0x1c5));var _0x962f=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x62f9[_0x162780];return _0x1ea2dc;};'use strict';var pm2=require('pm2');var BPromise=require(_0x962f('0x0'));var config=require(_0x962f('0x1'));function connect(){return new BPromise(function(_0x254d82,_0x45b436){return pm2[_0x962f('0x2')](function(_0x4b3d4c){if(_0x4b3d4c){return _0x45b436(_0x4b3d4c);}return _0x254d82('connected');});});};exports[_0x962f('0x3')]=function(_0x3bb5de){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x242db6,_0x54206d){return pm2[_0x962f('0x3')](_0x3bb5de,function(_0x229769,_0x45c444){if(_0x229769){return _0x54206d(_0x229769);}pm2['disconnect']();return _0x242db6(_0x45c444);});});});};exports[_0x962f('0x5')]=function(_0x39e5a9){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x151d07,_0x3932c7){return pm2['stop'](_0x39e5a9,function(_0x1079db,_0x4afe5a){if(_0x1079db){return _0x3932c7(_0x1079db);}pm2[_0x962f('0x6')]();return _0x151d07(_0x4afe5a);});});});};exports[_0x962f('0x7')]=function(_0x26a5a4){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x3c15df,_0x3270c6){return pm2[_0x962f('0x7')](_0x26a5a4,function(_0x2a459d,_0x2e381a){if(_0x2a459d){return _0x3270c6(_0x2a459d);}pm2[_0x962f('0x6')]();return _0x3c15df(_0x2e381a);});});});};exports[_0x962f('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x399887,_0x1ca6cd){return pm2[_0x962f('0x8')](function(_0x2ec545,_0x26a506){if(_0x2ec545){return _0x1ca6cd(_0x2ec545);}pm2[_0x962f('0x6')]();return _0x399887(_0x26a506);});});});};exports['describe']=function(_0x5bb200){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x10dcfc,_0x1e4bfd){return pm2[_0x962f('0x9')](_0x5bb200,function(_0x5ecede,_0x25c6e7){if(_0x5ecede){return _0x1e4bfd(_0x5ecede);}pm2[_0x962f('0x6')]();return _0x10dcfc(_0x25c6e7);});});});};exports['delete']=function(_0x204f9d){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x2c61c0,_0x192287){return pm2[_0x962f('0xa')](_0x204f9d,function(_0x31ec29,_0x335380){if(_0x31ec29){return _0x192287(_0x31ec29);}pm2[_0x962f('0x6')]();return _0x2c61c0(_0x335380);});});});};exports[_0x962f('0xb')]=function(){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x1502e0,_0x302726){return pm2[_0x962f('0xb')](function(_0x52056a){if(_0x52056a){return _0x302726(_0x52056a);}return _0x1502e0(_0x962f('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b68baec..478b802 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 _0x9107=['localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','then','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis'];(function(_0x2e13ff,_0x531c44){var _0x50a531=function(_0x1cf936){while(--_0x1cf936){_0x2e13ff['push'](_0x2e13ff['shift']());}};_0x50a531(++_0x531c44);}(_0x9107,0x14d));var _0x7910=function(_0x378d4e,_0x53d3e7){_0x378d4e=_0x378d4e-0x0;var _0x48748b=_0x9107[_0x378d4e];return _0x48748b;};'use strict';var _=require(_0x7910('0x0'));var moment=require('moment');var Redis=require(_0x7910('0x1'));var util=require(_0x7910('0x2'));var config=require(_0x7910('0x3'));var db=require(_0x7910('0x4'))['db'];var logger=require(_0x7910('0x5'))(_0x7910('0x6'));config[_0x7910('0x7')]=_['defaults'](config[_0x7910('0x7')],{'host':_0x7910('0x8'),'port':0x18eb});var io=require(_0x7910('0x9'))(new Redis(config[_0x7910('0x7')]));function closeInteractions(){var _0x170b0e=0x0;var _0x3cdf26=[];return db[_0x7910('0xa')][_0x7910('0xb')]({'raw':!![],'attributes':['id',_0x7910('0xc')],'where':{'id':0x1}})['then'](function(_0x194e9c){_0x170b0e=_0x194e9c['chatTimeout'];if(_0x170b0e){return db[_0x7910('0xd')][_0x7910('0xe')]({'raw':!![],'attributes':['id',_0x7910('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x194e9c['chatTimeout'],_0x7910('0x10'))}}});}else{return[];}})[_0x7910('0x11')](function(_0x5beff1){if(_0x5beff1&&_0x5beff1[_0x7910('0x12')]){_0x3cdf26=_[_0x7910('0x13')](_0x5beff1||[],'id');logger['info'](_0x7910('0x14'),_0x3cdf26[_0x7910('0x15')]());return db[_0x7910('0xd')][_0x7910('0x16')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x7910('0x17'))},{'where':{'id':_0x3cdf26}});}})['then'](function(){if(_0x3cdf26&&_0x3cdf26['length']){logger['info'](_0x7910('0x18'),_0x3cdf26[_0x7910('0x15')]());for(var _0x531de2=0x0;_0x531de2<_0x3cdf26[_0x7910('0x12')];_0x531de2++){io[_0x7910('0x19')](_0x7910('0x1a'),{'id':_0x3cdf26[_0x531de2],'closed':!![]});}}})[_0x7910('0x1b')](function(_0x35e18d){logger[_0x7910('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x35e18d?util[_0x7910('0x1d')](_0x35e18d,{'showHidden':![],'depth':null}):'');});}exports[_0x7910('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x752f=['format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','join','system','timeout'];(function(_0x5d701f,_0x118997){var _0x4ae155=function(_0x5290b0){while(--_0x5290b0){_0x5d701f['push'](_0x5d701f['shift']());}};_0x4ae155(++_0x118997);}(_0x752f,0xcb));var _0xf752=function(_0x200b13,_0x4b6bf7){_0x200b13=_0x200b13-0x0;var _0x2c4c56=_0x752f[_0x200b13];return _0x2c4c56;};'use strict';var _=require(_0xf752('0x0'));var moment=require(_0xf752('0x1'));var Redis=require('ioredis');var util=require(_0xf752('0x2'));var config=require(_0xf752('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xf752('0x4'))(_0xf752('0x5'));config[_0xf752('0x6')]=_[_0xf752('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf752('0x8'))(new Redis(config[_0xf752('0x6')]));function closeInteractions(){var _0x53b9de=0x0;var _0x1e42f4=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xf752('0x9')],'where':{'id':0x1}})[_0xf752('0xa')](function(_0x106066){_0x53b9de=_0x106066['chatTimeout'];if(_0x53b9de){return db[_0xf752('0xb')][_0xf752('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf752('0xd')](_0x106066['chatTimeout'],_0xf752('0xe'))}}});}else{return[];}})[_0xf752('0xa')](function(_0x4b5ad2){if(_0x4b5ad2&&_0x4b5ad2[_0xf752('0xf')]){_0x1e42f4=_[_0xf752('0x10')](_0x4b5ad2||[],'id');logger[_0xf752('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1e42f4[_0xf752('0x12')]());return db[_0xf752('0xb')]['update']({'closeReason':_0xf752('0x13'),'disposition':_0xf752('0x14'),'closed':!![],'closedAt':moment()[_0xf752('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1e42f4}});}})['then'](function(){if(_0x1e42f4&&_0x1e42f4[_0xf752('0xf')]){logger[_0xf752('0x11')](_0xf752('0x16'),_0x1e42f4[_0xf752('0x12')]());for(var _0x46cedd=0x0;_0x46cedd<_0x1e42f4[_0xf752('0xf')];_0x46cedd++){io['emit'](_0xf752('0x17'),{'id':_0x1e42f4[_0x46cedd],'closed':!![]});}}})[_0xf752('0x18')](function(_0x2c9661){logger[_0xf752('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2c9661?util[_0xf752('0x1a')](_0x2c9661,{'showHidden':![],'depth':null}):'');});}exports[_0xf752('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 2b7f51d..3f701a2 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec32=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2fc66f,_0x3fa2f6){var _0x4c6ff6=function(_0xc26679){while(--_0xc26679){_0x2fc66f['push'](_0x2fc66f['shift']());}};_0x4c6ff6(++_0x3fa2f6);}(_0xec32,0x17c));var _0x2ec3=function(_0x360106,_0x464019){_0x360106=_0x360106-0x0;var _0x18a624=_0xec32[_0x360106];return _0x18a624;};'use strict';function start(){var _0x4561cd=require(_0x2ec3('0x0'));return _0x4561cd[_0x2ec3('0x1')]();}module[_0x2ec3('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x3811=['exports','startAllRefreshIntervals'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3811,0x97));var _0x1381=function(_0x5b2bc9,_0x4a2415){_0x5b2bc9=_0x5b2bc9-0x0;var _0x348893=_0x3811[_0x5b2bc9];return _0x348893;};'use strict';function start(){var _0x1bf5b5=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1bf5b5[_0x1381('0x0')]();}module[_0x1381('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 30b8bce..191826f 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 _0x1600=['runReport','CustomReportId','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','map','keyBy','toString','difference','length','exists','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','startAt','add','start','stop','stop\x20cron','active','isBetween','endAt','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','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','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s'];(function(_0x4df3da,_0x5154e4){var _0x375b11=function(_0x32be02){while(--_0x32be02){_0x4df3da['push'](_0x4df3da['shift']());}};_0x375b11(++_0x5154e4);}(_0x1600,0x16d));var _0x0160=function(_0x5f20ca,_0x3f60a8){_0x5f20ca=_0x5f20ca-0x0;var _0x5a39de=_0x1600[_0x5f20ca];return _0x5a39de;};'use strict';var fs=require('fs');var util=require(_0x0160('0x0'));var path=require(_0x0160('0x1'));var _=require(_0x0160('0x2'));var moment=require(_0x0160('0x3'));var CronJobManager=require(_0x0160('0x4'));var jayson=require(_0x0160('0x5'));var BPromise=require(_0x0160('0x6'));var logger=require(_0x0160('0x7'))(_0x0160('0x8'));var db=require(_0x0160('0x9'))['db'];var analyticCustomReportController=require(_0x0160('0xa'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x0160('0xb')][_0x0160('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x167ac2,_0x339f77){return function(){logger[_0x0160('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x167ac2[_0x0160('0xe')]);var _0x23ad61=!![];var _0x446b48=_0x167ac2['MailAccount'][_0x0160('0xf')]();var _0x2d9ca4={'account':_0x446b48,'message':{'from':util[_0x0160('0x10')](_0x0160('0x11'),_0x167ac2[_0x0160('0x12')][_0x0160('0x13')],_0x167ac2[_0x0160('0x12')][_0x0160('0xe')]||_0x167ac2['MailAccount'][_0x0160('0x14')][_0x0160('0x15')]),'to':_0x167ac2[_0x0160('0xe')],'cc':_0x167ac2['cc'],'bcc':_0x167ac2[_0x0160('0x16')],'subject':util[_0x0160('0x10')](_0x0160('0x17'),_0x339f77['name'],_0x167ac2[_0x0160('0x18')],_0x167ac2['subtractUnit'])}};var _0x263d0a=path[_0x0160('0x19')](__dirname,_0x0160('0x1a'));var _0x25a409=_0x339f77[_0x0160('0x1b')];var _0x3ca79d=util[_0x0160('0x10')]('%s.%s',path['basename'](_0x339f77[_0x0160('0x1b')],path['extname'](_0x339f77[_0x0160('0x1b')])),'zip');var _0x5e01a5=path['join'](_0x263d0a,_0x25a409);var _0x484b6e=path['join'](_0x263d0a,_0x3ca79d);if(fs[_0x0160('0x1c')](_0x5e01a5)){_0x339f77[_0x0160('0x1d')]=_0x0160('0x1e');_0x2d9ca4[_0x0160('0x1f')][_0x0160('0x20')]=[{'filename':_0x25a409,'path':_0x5e01a5}];_0x2d9ca4[_0x0160('0x1f')][_0x0160('0x21')]=util[_0x0160('0x10')](_0x0160('0x22'),JSON[_0x0160('0x23')](_0x339f77,null,0x2));}else if(fs[_0x0160('0x1c')](_0x484b6e)){_0x339f77['status']=_0x0160('0x1e');_0x2d9ca4[_0x0160('0x1f')]['attachments']=[{'filename':_0x3ca79d,'path':_0x484b6e}];}else{_0x2d9ca4[_0x0160('0x1f')][_0x0160('0x21')]=_0x0160('0x24');if(!_0x167ac2[_0x0160('0x25')]){_0x23ad61=![];logger[_0x0160('0xd')](_0x0160('0x26'));}}if(_0x23ad61){return client[_0x0160('0x27')]('SendMail',_0x2d9ca4)[_0x0160('0x28')](function(_0x3a2a54){if(_0x3a2a54[_0x0160('0x29')]){return logger[_0x0160('0x29')](_0x0160('0x2a'),JSON[_0x0160('0x23')](_0x3a2a54));}return logger[_0x0160('0xd')](_0x0160('0x2b'));})[_0x0160('0x2c')](function(_0x333735){return logger[_0x0160('0x29')]('error\x20mail',JSON[_0x0160('0x23')](_0x333735));});}};}function handleError(){return function(_0x1173de){return logger[_0x0160('0x29')](JSON[_0x0160('0x23')](_0x1173de));};}function handleResult(_0x29be3d){return function(_0x884f14){logger['info'](_0x0160('0x2d'),JSON[_0x0160('0x23')](_0x884f14));if(_0x29be3d[_0x0160('0x12')]&&_0x29be3d['MailAccount'][_0x0160('0x14')]&&!_['isNil'](_0x29be3d[_0x0160('0xe')])){setTimeout(handleSendEmail(_0x29be3d,_0x884f14),0x3c*0x3e8);}};}function handleJob(_0x5ddc84){return function(){try{if(_[_0x0160('0x2e')](_0x5ddc84[_0x0160('0x18')])){return logger['info'](_0x0160('0x2f'));}if(_[_0x0160('0x2e')](_0x5ddc84[_0x0160('0x30')])){return logger[_0x0160('0xd')](_0x0160('0x31'));}var _0x128065={'startDate':moment()[_0x0160('0x32')](_0x5ddc84['subtractNumber'],_0x5ddc84[_0x0160('0x30')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x0160('0x10')](_0x0160('0x33')),'type':'scheduled','output':_0x5ddc84[_0x0160('0x34')],'name':_0x5ddc84['name']};if(!_[_0x0160('0x2e')](_0x5ddc84[_0x0160('0x35')])){logger[_0x0160('0xd')](_0x0160('0x36'),_0x5ddc84[_0x0160('0x35')]);return analyticDefaultReportController[_0x0160('0x37')]({'id':_0x5ddc84[_0x0160('0x35')]},_0x128065)[_0x0160('0x28')](handleResult(_0x5ddc84))[_0x0160('0x2c')](handleError());}if(!_[_0x0160('0x2e')](_0x5ddc84[_0x0160('0x38')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x5ddc84[_0x0160('0x38')]);return analyticCustomReportController['runReport']({'id':_0x5ddc84[_0x0160('0x38')]},_0x128065)[_0x0160('0x28')](handleResult(_0x5ddc84))['catch'](handleError());}}catch(_0x355c50){logger[_0x0160('0x29')](JSON[_0x0160('0x23')](_0x355c50));}return logger[_0x0160('0xd')](_0x0160('0x39'));};}function getJobs(_0x5db6e3){var _0x3dfeb7={};if(_0x5db6e3){_0x3dfeb7['id']=_0x5db6e3;}return db[_0x0160('0x3a')]['findAll']({'where':_0x3dfeb7,'include':[{'model':db[_0x0160('0x12')],'attributes':['id',_0x0160('0x13'),_0x0160('0xe')],'include':[{'model':db['MailServerOut'],'as':_0x0160('0x14'),'include':[{'model':db[_0x0160('0x3b')],'as':_0x0160('0x3b')}]}]}]})[_0x0160('0x28')](function(_0x51c58a){var _0x3359bd=_[_0x0160('0x3c')](manager[_0x0160('0x3d')]);var _0x1753fc=_[_0x0160('0x3e')](_0x51c58a,function(_0x50445){return _0x50445['id']['toString']();});var _0x4325de=_[_0x0160('0x3f')](_0x51c58a,function(_0x2c9ad2){return _0x2c9ad2['id'][_0x0160('0x40')]();});var _0x160385=_0x5db6e3?_0x1753fc:_[_0x0160('0x41')](_0x1753fc,_0x3359bd);var _0xd7c39=_['intersection'](_0x1753fc,_0x3359bd);var _0x10d373=_[_0x0160('0x41')](_0x3359bd,_0x1753fc);var _0x4df0b1;var _0x439595;for(_0x4df0b1=0x0;_0x4df0b1<_0x10d373[_0x0160('0x42')]&&!_0x5db6e3;_0x4df0b1+=0x1){_0x439595=_0x10d373[_0x4df0b1][_0x0160('0x40')]();if(manager[_0x0160('0x43')](_0x439595)){manager['stop'](_0x439595);manager[_0x0160('0x44')](_0x439595);logger['info'](_0x0160('0x45'),_0x439595);}}logger['info']('toRun',JSON[_0x0160('0x23')](_0x160385));for(_0x4df0b1=0x0;_0x4df0b1<_0x160385[_0x0160('0x42')];_0x4df0b1+=0x1){_0x439595=_0x160385[_0x4df0b1][_0x0160('0x40')]();logger[_0x0160('0xd')]('index',_0x439595);if(_0x5db6e3){logger[_0x0160('0xd')](_0x0160('0x46'),_0x5db6e3);logger[_0x0160('0xd')](JSON[_0x0160('0x23')](_0x4325de[_0x439595]));BPromise[_0x0160('0x47')]()[_0x0160('0x28')](handleJob(_0x4325de[_0x439595]));logger[_0x0160('0xd')](_0x0160('0x48'),_0x4325de[_0x439595]['name'],_0x4325de[_0x439595][_0x0160('0x49')]);}else if(_0x4325de[_0x439595][_0x0160('0x49')]&&_0x4325de[_0x439595]['active']&&moment()['isBetween'](_0x4325de[_0x439595][_0x0160('0x4a')],_0x4325de[_0x439595]['endAt'])){manager[_0x0160('0x4b')](_0x439595,_0x4325de[_0x439595][_0x0160('0x49')],handleJob(_0x4325de[_0x439595]));manager[_0x0160('0x4c')](_0x439595);logger[_0x0160('0xd')]('add\x20cron',_0x4325de[_0x439595][_0x0160('0x13')],_0x4325de[_0x439595]['cron']);}else if(manager[_0x0160('0x43')](_0x439595)){manager[_0x0160('0x4d')](_0x439595);manager['deleteJob'](_0x439595);logger[_0x0160('0xd')](_0x0160('0x4e'),_0x4325de[_0x439595]['name'],_0x4325de[_0x439595]['cron']);}}for(_0x4df0b1=0x0,_0x439595;_0x4df0b1<_0xd7c39[_0x0160('0x42')]&&!_0x5db6e3;_0x4df0b1+=0x1){_0x439595=_0xd7c39[_0x4df0b1][_0x0160('0x40')]();if(manager[_0x0160('0x43')](_0x439595)){if(_0x4325de[_0x439595][_0x0160('0x49')]&&_0x4325de[_0x439595][_0x0160('0x4f')]&&moment()[_0x0160('0x50')](_0x4325de[_0x439595]['startAt'],_0x4325de[_0x439595][_0x0160('0x51')])){manager['update'](_0x439595,_0x4325de[_0x439595]['cron'],handleJob(_0x4325de[_0x439595]));logger[_0x0160('0xd')](_0x0160('0x52'),_0x4325de[_0x439595]['name'],_0x4325de[_0x439595]['cron']);}else{manager[_0x0160('0x4d')](_0x439595);manager['deleteJob'](_0x439595);logger[_0x0160('0xd')](_0x0160('0x4e'),_0x4325de[_0x439595][_0x0160('0x13')],_0x4325de[_0x439595]['cron']);}}}})[_0x0160('0x2c')](function(_0x54fa80){logger['error'](JSON[_0x0160('0x23')](_0x54fa80));});}exports[_0x0160('0x53')]=function(_0x146617){return getJobs(_0x146617);};exports[_0x0160('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf201=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','add','cron','add\x20cron','stop\x20cron','length','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','format','%s.%s','basename','zip','existsSync','status','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf201,0x199));var _0x1f20=function(_0x29f631,_0x381b4d){_0x29f631=_0x29f631-0x0;var _0x53376c=_0xf201[_0x29f631];return _0x53376c;};'use strict';var fs=require('fs');var util=require(_0x1f20('0x0'));var path=require(_0x1f20('0x1'));var _=require(_0x1f20('0x2'));var moment=require(_0x1f20('0x3'));var CronJobManager=require(_0x1f20('0x4'));var jayson=require(_0x1f20('0x5'));var BPromise=require(_0x1f20('0x6'));var logger=require(_0x1f20('0x7'))(_0x1f20('0x8'));var db=require(_0x1f20('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x1f20('0xa'));var client=jayson['client'][_0x1f20('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x154c82,_0x3cbb1a){return function(){logger[_0x1f20('0xc')](_0x1f20('0xd'),_0x154c82[_0x1f20('0xe')]);var _0x1d97d1=!![];var _0x14d4df=_0x154c82[_0x1f20('0xf')]['getSmtpOptions']();var _0x4a4020={'account':_0x14d4df,'message':{'from':util['format'](_0x1f20('0x10'),_0x154c82[_0x1f20('0xf')][_0x1f20('0x11')],_0x154c82[_0x1f20('0xf')]['email']||_0x154c82[_0x1f20('0xf')]['Smtp'][_0x1f20('0x12')]),'to':_0x154c82[_0x1f20('0xe')],'cc':_0x154c82['cc'],'bcc':_0x154c82['bcc'],'subject':util['format'](_0x1f20('0x13'),_0x3cbb1a[_0x1f20('0x11')],_0x154c82[_0x1f20('0x14')],_0x154c82['subtractUnit'])}};var _0x31e35b=path[_0x1f20('0x15')](__dirname,_0x1f20('0x16'));var _0x222e99=_0x3cbb1a[_0x1f20('0x17')];var _0x2e76b8=util[_0x1f20('0x18')](_0x1f20('0x19'),path[_0x1f20('0x1a')](_0x3cbb1a[_0x1f20('0x17')],path['extname'](_0x3cbb1a[_0x1f20('0x17')])),_0x1f20('0x1b'));var _0x541ea3=path[_0x1f20('0x15')](_0x31e35b,_0x222e99);var _0x14319e=path[_0x1f20('0x15')](_0x31e35b,_0x2e76b8);if(fs[_0x1f20('0x1c')](_0x541ea3)){_0x3cbb1a[_0x1f20('0x1d')]='Sent';_0x4a4020['message'][_0x1f20('0x1e')]=[{'filename':_0x222e99,'path':_0x541ea3}];_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x20')]=util[_0x1f20('0x18')](_0x1f20('0x21'),JSON['stringify'](_0x3cbb1a,null,0x2));}else if(fs[_0x1f20('0x1c')](_0x14319e)){_0x3cbb1a[_0x1f20('0x1d')]=_0x1f20('0x22');_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x1e')]=[{'filename':_0x2e76b8,'path':_0x14319e}];}else{_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x20')]=_0x1f20('0x23');if(!_0x154c82[_0x1f20('0x24')]){_0x1d97d1=![];logger[_0x1f20('0xc')](_0x1f20('0x25'));}}if(_0x1d97d1){return client[_0x1f20('0x26')](_0x1f20('0x27'),_0x4a4020)[_0x1f20('0x28')](function(_0x27feaf){if(_0x27feaf['error']){return logger[_0x1f20('0x29')](_0x1f20('0x2a'),JSON[_0x1f20('0x2b')](_0x27feaf));}return logger[_0x1f20('0xc')](_0x1f20('0x2c'));})[_0x1f20('0x2d')](function(_0x1d7110){return logger[_0x1f20('0x29')](_0x1f20('0x2a'),JSON[_0x1f20('0x2b')](_0x1d7110));});}};}function handleError(){return function(_0x278d57){return logger['error'](JSON[_0x1f20('0x2b')](_0x278d57));};}function handleResult(_0xf5f8b1){return function(_0x44791d){logger[_0x1f20('0xc')](_0x1f20('0x2e'),JSON[_0x1f20('0x2b')](_0x44791d));if(_0xf5f8b1[_0x1f20('0xf')]&&_0xf5f8b1[_0x1f20('0xf')][_0x1f20('0x2f')]&&!_[_0x1f20('0x30')](_0xf5f8b1['email'])){setTimeout(handleSendEmail(_0xf5f8b1,_0x44791d),0x3c*0x3e8);}};}function handleJob(_0x2398d8){return function(){try{if(_['isNil'](_0x2398d8['subtractNumber'])){return logger['info'](_0x1f20('0x31'));}if(_['isNil'](_0x2398d8[_0x1f20('0x32')])){return logger[_0x1f20('0xc')](_0x1f20('0x33'));}var _0x441f60={'startDate':moment()[_0x1f20('0x34')](_0x2398d8['subtractNumber'],_0x2398d8['subtractUnit'])[_0x1f20('0x18')](_0x1f20('0x35')),'endDate':moment()[_0x1f20('0x18')](_0x1f20('0x35')),'type':_0x1f20('0x36'),'output':_0x2398d8[_0x1f20('0x37')],'name':_0x2398d8[_0x1f20('0x11')]};if(!_[_0x1f20('0x30')](_0x2398d8[_0x1f20('0x38')])){logger[_0x1f20('0xc')](_0x1f20('0x39'),_0x2398d8[_0x1f20('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x2398d8[_0x1f20('0x38')]},_0x441f60)[_0x1f20('0x28')](handleResult(_0x2398d8))[_0x1f20('0x2d')](handleError());}if(!_['isNil'](_0x2398d8[_0x1f20('0x3a')])){logger[_0x1f20('0xc')](_0x1f20('0x3b'),_0x2398d8[_0x1f20('0x3a')]);return analyticCustomReportController[_0x1f20('0x3c')]({'id':_0x2398d8[_0x1f20('0x3a')]},_0x441f60)[_0x1f20('0x28')](handleResult(_0x2398d8))[_0x1f20('0x2d')](handleError());}}catch(_0x36fee2){logger[_0x1f20('0x29')](JSON[_0x1f20('0x2b')](_0x36fee2));}return logger[_0x1f20('0xc')](_0x1f20('0x3d'));};}function getJobs(_0x45f3fa){var _0x3d5b1e={};if(_0x45f3fa){_0x3d5b1e['id']=_0x45f3fa;}return db[_0x1f20('0x3e')]['findAll']({'where':_0x3d5b1e,'include':[{'model':db[_0x1f20('0xf')],'attributes':['id',_0x1f20('0x11'),_0x1f20('0xe')],'include':[{'model':db[_0x1f20('0x3f')],'as':_0x1f20('0x2f'),'include':[{'model':db[_0x1f20('0x40')],'as':'CloudProvider'}]}]}]})['then'](function(_0x573c99){var _0x5157e6=_[_0x1f20('0x41')](manager[_0x1f20('0x42')]);var _0x4cc5f2=_[_0x1f20('0x43')](_0x573c99,function(_0x47c9d9){return _0x47c9d9['id']['toString']();});var _0x3f6d24=_['keyBy'](_0x573c99,function(_0x3841e3){return _0x3841e3['id'][_0x1f20('0x44')]();});var _0x418973=_0x45f3fa?_0x4cc5f2:_['difference'](_0x4cc5f2,_0x5157e6);var _0x5c5e3a=_[_0x1f20('0x45')](_0x4cc5f2,_0x5157e6);var _0x52eafb=_[_0x1f20('0x46')](_0x5157e6,_0x4cc5f2);var _0x1e8cc9;var _0x14d25c;for(_0x1e8cc9=0x0;_0x1e8cc9<_0x52eafb['length']&&!_0x45f3fa;_0x1e8cc9+=0x1){_0x14d25c=_0x52eafb[_0x1e8cc9]['toString']();if(manager[_0x1f20('0x47')](_0x14d25c)){manager[_0x1f20('0x48')](_0x14d25c);manager[_0x1f20('0x49')](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x4a'),_0x14d25c);}}logger[_0x1f20('0xc')](_0x1f20('0x4b'),JSON[_0x1f20('0x2b')](_0x418973));for(_0x1e8cc9=0x0;_0x1e8cc9<_0x418973['length'];_0x1e8cc9+=0x1){_0x14d25c=_0x418973[_0x1e8cc9][_0x1f20('0x44')]();logger['info']('index',_0x14d25c);if(_0x45f3fa){logger[_0x1f20('0xc')](_0x1f20('0x4c'),_0x45f3fa);logger[_0x1f20('0xc')](JSON[_0x1f20('0x2b')](_0x3f6d24[_0x14d25c]));BPromise[_0x1f20('0x4d')]()[_0x1f20('0x28')](handleJob(_0x3f6d24[_0x14d25c]));logger[_0x1f20('0xc')](_0x1f20('0x4e'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c]['cron']);}else if(_0x3f6d24[_0x14d25c]['cron']&&_0x3f6d24[_0x14d25c][_0x1f20('0x4f')]&&moment()[_0x1f20('0x50')](_0x3f6d24[_0x14d25c][_0x1f20('0x51')],_0x3f6d24[_0x14d25c][_0x1f20('0x52')])){manager[_0x1f20('0x53')](_0x14d25c,_0x3f6d24[_0x14d25c][_0x1f20('0x54')],handleJob(_0x3f6d24[_0x14d25c]));manager['start'](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x55'),_0x3f6d24[_0x14d25c]['name'],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}else if(manager['exists'](_0x14d25c)){manager[_0x1f20('0x48')](_0x14d25c);manager['deleteJob'](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x56'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}}for(_0x1e8cc9=0x0,_0x14d25c;_0x1e8cc9<_0x5c5e3a[_0x1f20('0x57')]&&!_0x45f3fa;_0x1e8cc9+=0x1){_0x14d25c=_0x5c5e3a[_0x1e8cc9][_0x1f20('0x44')]();if(manager[_0x1f20('0x47')](_0x14d25c)){if(_0x3f6d24[_0x14d25c]['cron']&&_0x3f6d24[_0x14d25c][_0x1f20('0x4f')]&&moment()[_0x1f20('0x50')](_0x3f6d24[_0x14d25c]['startAt'],_0x3f6d24[_0x14d25c][_0x1f20('0x52')])){manager['update'](_0x14d25c,_0x3f6d24[_0x14d25c][_0x1f20('0x54')],handleJob(_0x3f6d24[_0x14d25c]));logger[_0x1f20('0xc')](_0x1f20('0x58'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}else{manager[_0x1f20('0x48')](_0x14d25c);manager[_0x1f20('0x49')](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x56'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}}}})['catch'](function(_0x27d882){logger[_0x1f20('0x29')](JSON[_0x1f20('0x2b')](_0x27d882));});}exports['run']=function(_0x5cd201){return getJobs(_0x5cd201);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 1578d5c..b72a942 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21f8=['TranscriptFileUri','Transcript','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','then','Cloud\x20Provider\x20not\x20available','Sequelize','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','bucket','push','all','catch','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED'];(function(_0x5963ad,_0x3d3e77){var _0x452a72=function(_0x1f256e){while(--_0x1f256e){_0x5963ad['push'](_0x5963ad['shift']());}};_0x452a72(++_0x3d3e77);}(_0x21f8,0x71));var _0x821f=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x21f8[_0x516927];return _0x30749b;};var _=require(_0x821f('0x0'));var AWS=require(_0x821f('0x1'));var rp=require(_0x821f('0x2'));var util=require(_0x821f('0x3'));var BPromise=require(_0x821f('0x4'));var db=require(_0x821f('0x5'))['db'];var logger=require(_0x821f('0x6'))('transcribe');function getTranscriptionJob(_0x4d5a2d,_0x5ca60a,_0x9d3273,_0xf5dd93){return new Promise(function(_0x3052d6,_0x2a1421){var _0x3cd13a=new AWS[(_0x821f('0x7'))]({'accessKeyId':_0x5ca60a,'secretAccessKey':_0x4d5a2d,'region':_0x9d3273});_0x3cd13a[_0x821f('0x8')]({'TranscriptionJobName':_0xf5dd93},function(_0xfcb0a,_0x4e260d){if(_0xfcb0a){return _0x2a1421(_0xfcb0a);}else{return _0x3052d6(_0x4e260d);}});});}function sentiment(_0x4dcd67,_0x284c6a,_0x15b547,_0x81e2f4,_0x53ce42){return new Promise(function(_0x387056,_0x44e3f3){var _0x101ae7=new AWS[(_0x821f('0x9'))]({'accessKeyId':_0x284c6a,'secretAccessKey':_0x4dcd67,'region':_0x15b547});_0x101ae7[_0x821f('0xa')]({'Text':_0x81e2f4,'LanguageCode':_0x53ce42[_0x821f('0xb')](0x0,0x2)},function(_0x6bea4c,_0xec9f7e){if(_0x6bea4c){return _0x44e3f3(_0x6bea4c);}else{return _0x387056(_0xec9f7e);}});});}function checkTranscribeJob(_0x3eedc4,_0x2aeb4e,_0x4ba2e2){var _0x4f9752;return new BPromise(function(_0x22e1d5,_0x225854){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0xe'),_0x3eedc4['id'],_0x3eedc4[_0x821f('0xf')]));return getTranscriptionJob(_0x4ba2e2[_0x821f('0x10')],_0x4ba2e2[_0x821f('0x11')],_0x2aeb4e[_0x821f('0x12')],_0x3eedc4[_0x821f('0xf')])['then'](function(_0x3419ab){logger['info'](util[_0x821f('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3eedc4['id'],_0x3eedc4[_0x821f('0xf')],_0x3419ab[_0x821f('0x13')][_0x821f('0x14')]));if(!_0x3eedc4[_0x821f('0x15')]){switch(_0x3419ab['TranscriptionJob'][_0x821f('0x14')]){case _0x821f('0x16'):var _0x499483={'transcribeStatus':_0x3419ab[_0x821f('0x13')]['TranscriptionJobStatus'],'fileUri':_0x3419ab[_0x821f('0x13')]['Transcript'][_0x821f('0x17')]};logger[_0x821f('0xc')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x3eedc4['id']));return rp({'uri':_0x3419ab[_0x821f('0x13')][_0x821f('0x18')][_0x821f('0x17')],'json':!![]})['then'](function(_0x3092d8){logger[_0x821f('0xc')](util[_0x821f('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3eedc4['id']));if(_0x3092d8&&_0x3092d8[_0x821f('0x19')]&&_0x3092d8[_0x821f('0x19')]['transcripts']&&_0x3092d8['results']['transcripts']['length']){_0x499483[_0x821f('0x15')]='';for(var _0x4af347=0x0;_0x4af347<_0x3092d8['results'][_0x821f('0x1a')]['length'];_0x4af347++){_0x499483['fileText']+=_0x3092d8[_0x821f('0x19')][_0x821f('0x1a')][_0x4af347][_0x821f('0x1b')]+'';}}return _0x3eedc4[_0x821f('0x1c')](_0x499483);})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));if(!_0x3eedc4[_0x821f('0x1e')]){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x20'));}if(!_0x2aeb4e[_0x821f('0x21')]||!_0x2aeb4e[_0x821f('0x22')]||!_0x2aeb4e['sentimentRegion']||!_0x2aeb4e[_0x821f('0x23')]||!_0x2aeb4e['bucket']){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x24'));}if(!_0x499483[_0x821f('0x15')]){throw new Error(_0x821f('0x25'));}if(_0x2aeb4e[_0x821f('0x22')]===_0x4ba2e2['id']){return _0x4ba2e2;}else{return db['CloudProvider'][_0x821f('0x26')]({'where':{'id':_settings[_0x821f('0x22')]}});}})[_0x821f('0x27')](function(_0x12a47a){if(!_0x12a47a){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x12a47a[_0x821f('0x10')]||!_0x12a47a[_0x821f('0x11')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x4f9752=_0x12a47a;logger[_0x821f('0xc')](util['format'](_0x821f('0x2a'),_0x3eedc4['id']));return sentiment(_0x4f9752[_0x821f('0x10')],_0x4f9752['data2'],_0x2aeb4e['sentimentRegion'],_0x499483[_0x821f('0x15')],_0x2aeb4e[_0x821f('0x23')]);})[_0x821f('0x27')](function(_0x302611){logger[_0x821f('0xc')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3eedc4['id']));return _0x3eedc4[_0x821f('0x1c')]({'sentiment':_0x302611[_0x821f('0x2b')],'sPositive':_0x302611[_0x821f('0x2c')]['Positive'],'sNegative':_0x302611[_0x821f('0x2c')][_0x821f('0x2d')],'sMixed':_0x302611[_0x821f('0x2c')][_0x821f('0x2e')],'sNeutral':_0x302611[_0x821f('0x2c')][_0x821f('0x2f')]});})[_0x821f('0x27')](function(){logger['info'](util['format'](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});case _0x821f('0x30'):return _0x3eedc4[_0x821f('0x1c')]({'transcribeStatus':_0x821f('0x30'),'failureReason':_0x3419ab[_0x821f('0x13')]['FailureReason']})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});default:logger['info'](util[_0x821f('0xd')](_0x821f('0x31'),_0x3eedc4['id']));break;}}else{return BPromise[_0x821f('0x32')]()['then'](function(){if(!_0x3eedc4[_0x821f('0x1e')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x20'));}if(!_0x2aeb4e[_0x821f('0x21')]||!_0x2aeb4e[_0x821f('0x22')]||!_0x2aeb4e['sentimentRegion']||!_0x2aeb4e[_0x821f('0x23')]||!_0x2aeb4e['bucket']){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x24'));}if(!_0x3eedc4[_0x821f('0x15')]){throw new Error(_0x821f('0x25'));}if(_0x2aeb4e[_0x821f('0x22')]===_0x4ba2e2['id']){return _0x4ba2e2;}else{return db[_0x821f('0x33')][_0x821f('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x821f('0x27')](function(_0x603245){if(!_0x603245){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x603245['data1']||!_0x603245[_0x821f('0x11')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x34'));}_0x4f9752=_0x603245;logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x2a'),_0x3eedc4['id']));return sentiment(_0x4f9752[_0x821f('0x10')],_0x4f9752[_0x821f('0x11')],_0x2aeb4e['sentimentRegion'],_0x3eedc4[_0x821f('0x15')],_0x2aeb4e['language']);})[_0x821f('0x27')](function(_0x495fe6){logger[_0x821f('0xc')](util['format'](_0x821f('0x35'),_0x3eedc4['id']));return _0x3eedc4[_0x821f('0x1c')]({'sentiment':_0x495fe6['Sentiment'],'sPositive':_0x495fe6[_0x821f('0x2c')]['Positive'],'sNegative':_0x495fe6[_0x821f('0x2c')][_0x821f('0x2d')],'sMixed':_0x495fe6['SentimentScore'][_0x821f('0x2e')],'sNeutral':_0x495fe6[_0x821f('0x2c')]['Neutral'],'transcribeStatus':_0x821f('0x16')});})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});}})['catch'](function(_0x21f55c){if(_0x21f55c){if(!_0x21f55c[_0x821f('0x36')]||_0x21f55c['name']!==_0x821f('0x37')){logger['error'](util[_0x821f('0xd')](_0x821f('0x38'),_0x3eedc4['id']),util[_0x821f('0x39')](_0x21f55c,{'showHidden':![],'depth':null}));}}_0x22e1d5();});});}function checkTranscribe(){var _0x1fbec4;var _0x1b7eaf;var _0x541a2e;return db[_0x821f('0x3a')][_0x821f('0x3b')]({'where':{'transcribeStatus':_0x821f('0x3c')}})[_0x821f('0x27')](function(_0x58cb21){if(!_0x58cb21||!_0x58cb21['length']){throw new db[(_0x821f('0x29'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x1fbec4=_0x58cb21;return db[_0x821f('0x3d')][_0x821f('0x26')]({'where':{'id':0x1}});})[_0x821f('0x27')](function(_0x37715d){if(!_0x37715d){throw new db[(_0x821f('0x29'))]['ValidationError'](_0x821f('0x3e'));}_0x1b7eaf=_0x37715d;if(!_0x1b7eaf['transcribe']||!_0x1b7eaf[_0x821f('0x3f')]||!_0x1b7eaf['transcribeRegion']||!_0x1b7eaf[_0x821f('0x23')]||!_0x1b7eaf[_0x821f('0x40')]){throw new db[(_0x821f('0x29'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x821f('0x33')][_0x821f('0x26')]({'where':{'id':_0x1b7eaf[_0x821f('0x3f')]}});})['then'](function(_0x386093){if(!_0x386093){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x386093[_0x821f('0x10')]||!_0x386093['data2']){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x34'));}_0x541a2e=_0x386093;var _0x35dbb5=[];_0x1fbec4['forEach'](function(_0x149919){_0x35dbb5[_0x821f('0x41')](checkTranscribeJob(_0x149919,_0x1b7eaf,_0x541a2e));});return BPromise[_0x821f('0x42')](_0x35dbb5);})[_0x821f('0x43')](function(_0x10e9ef){if(_0x10e9ef){if(!_0x10e9ef['name']||_0x10e9ef[_0x821f('0x36')]!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x10e9ef,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x49f8=['sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','data1','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Negative','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeRegion','Cloud\x20Provider\x20not\x20available','forEach','push','all','catch','start','lodash','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x49f8,0xff));var _0x849f=function(_0x166953,_0x214d3a){_0x166953=_0x166953-0x0;var _0x4a8baf=_0x49f8[_0x166953];return _0x4a8baf;};var _=require(_0x849f('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0x849f('0x1'));var BPromise=require(_0x849f('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x849f('0x3'))('transcribe');function getTranscriptionJob(_0xdf19d3,_0x59d2a8,_0x4786cc,_0x590f53){return new Promise(function(_0x1e8405,_0x30ebab){var _0x21f577=new AWS[(_0x849f('0x4'))]({'accessKeyId':_0x59d2a8,'secretAccessKey':_0xdf19d3,'region':_0x4786cc});_0x21f577[_0x849f('0x5')]({'TranscriptionJobName':_0x590f53},function(_0xc6443e,_0x565438){if(_0xc6443e){return _0x30ebab(_0xc6443e);}else{return _0x1e8405(_0x565438);}});});}function sentiment(_0x47f0a5,_0x5c013d,_0x306c11,_0x1a902c,_0x3b094c){return new Promise(function(_0x51cf64,_0x1de72f){var _0x28de6e=new AWS[(_0x849f('0x6'))]({'accessKeyId':_0x5c013d,'secretAccessKey':_0x47f0a5,'region':_0x306c11});_0x28de6e['detectSentiment']({'Text':_0x1a902c,'LanguageCode':_0x3b094c[_0x849f('0x7')](0x0,0x2)},function(_0x5b4593,_0xd5525f){if(_0x5b4593){return _0x1de72f(_0x5b4593);}else{return _0x51cf64(_0xd5525f);}});});}function checkTranscribeJob(_0x25b276,_0x401480,_0x23c0ef){var _0x58dede;return new BPromise(function(_0x4f13f9,_0x41f999){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0xa'),_0x25b276['id'],_0x25b276['transcribeName']));return getTranscriptionJob(_0x23c0ef['data1'],_0x23c0ef[_0x849f('0xb')],_0x401480['transcribeRegion'],_0x25b276[_0x849f('0xc')])[_0x849f('0xd')](function(_0x45b940){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0xe'),_0x25b276['id'],_0x25b276[_0x849f('0xc')],_0x45b940['TranscriptionJob'][_0x849f('0xf')]));if(!_0x25b276[_0x849f('0x10')]){switch(_0x45b940[_0x849f('0x11')]['TranscriptionJobStatus']){case _0x849f('0x12'):var _0x364c9b={'transcribeStatus':_0x45b940['TranscriptionJob'][_0x849f('0xf')],'fileUri':_0x45b940[_0x849f('0x11')]['Transcript']['TranscriptFileUri']};logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x13'),_0x25b276['id']));return rp({'uri':_0x45b940[_0x849f('0x11')][_0x849f('0x14')][_0x849f('0x15')],'json':!![]})[_0x849f('0xd')](function(_0x2af70d){logger['info'](util[_0x849f('0x9')](_0x849f('0x16'),_0x25b276['id']));if(_0x2af70d&&_0x2af70d[_0x849f('0x17')]&&_0x2af70d[_0x849f('0x17')][_0x849f('0x18')]&&_0x2af70d['results'][_0x849f('0x18')][_0x849f('0x19')]){_0x364c9b[_0x849f('0x10')]='';for(var _0xe404c6=0x0;_0xe404c6<_0x2af70d[_0x849f('0x17')][_0x849f('0x18')][_0x849f('0x19')];_0xe404c6++){_0x364c9b[_0x849f('0x10')]+=_0x2af70d[_0x849f('0x17')][_0x849f('0x18')][_0xe404c6][_0x849f('0x1a')]+'';}}return _0x25b276[_0x849f('0x1b')](_0x364c9b);})[_0x849f('0xd')](function(){logger['info'](util[_0x849f('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25b276['id']));if(!_0x25b276[_0x849f('0x1c')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x1f'));}if(!_0x401480[_0x849f('0x20')]||!_0x401480[_0x849f('0x21')]||!_0x401480['sentimentRegion']||!_0x401480[_0x849f('0x22')]||!_0x401480[_0x849f('0x23')]){throw new db[(_0x849f('0x1d'))]['ValidationError'](_0x849f('0x24'));}if(!_0x364c9b['fileText']){throw new Error(_0x849f('0x25'));}if(_0x401480[_0x849f('0x21')]===_0x23c0ef['id']){return _0x23c0ef;}else{return db[_0x849f('0x26')][_0x849f('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x849f('0xd')](function(_0x47eb70){if(!_0x47eb70){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x47eb70['data1']||!_0x47eb70['data2']){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x58dede=_0x47eb70;logger[_0x849f('0x8')](util[_0x849f('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x25b276['id']));return sentiment(_0x58dede[_0x849f('0x29')],_0x58dede[_0x849f('0xb')],_0x401480[_0x849f('0x2a')],_0x364c9b[_0x849f('0x10')],_0x401480[_0x849f('0x22')]);})[_0x849f('0xd')](function(_0x357f90){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x2b'),_0x25b276['id']));return _0x25b276['update']({'sentiment':_0x357f90['Sentiment'],'sPositive':_0x357f90[_0x849f('0x2c')][_0x849f('0x2d')],'sNegative':_0x357f90[_0x849f('0x2c')]['Negative'],'sMixed':_0x357f90[_0x849f('0x2c')][_0x849f('0x2e')],'sNeutral':_0x357f90[_0x849f('0x2c')][_0x849f('0x2f')]});})['then'](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x30'),_0x25b276['id']));_0x4f13f9();});case _0x849f('0x31'):return _0x25b276[_0x849f('0x1b')]({'transcribeStatus':_0x849f('0x31'),'failureReason':_0x45b940[_0x849f('0x11')]['FailureReason']})[_0x849f('0xd')](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25b276['id']));_0x4f13f9();});default:logger['info'](util[_0x849f('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x25b276['id']));break;}}else{return BPromise[_0x849f('0x32')]()['then'](function(){if(!_0x25b276[_0x849f('0x1c')]){throw new db[(_0x849f('0x1d'))]['ValidationError'](_0x849f('0x1f'));}if(!_0x401480[_0x849f('0x20')]||!_0x401480[_0x849f('0x21')]||!_0x401480[_0x849f('0x2a')]||!_0x401480['language']||!_0x401480['bucket']){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x25b276[_0x849f('0x10')]){throw new Error(_0x849f('0x25'));}if(_0x401480[_0x849f('0x21')]===_0x23c0ef['id']){return _0x23c0ef;}else{return db['CloudProvider'][_0x849f('0x27')]({'where':{'id':_settings[_0x849f('0x21')]}});}})[_0x849f('0xd')](function(_0x258696){if(!_0x258696){throw new db[(_0x849f('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x258696[_0x849f('0x29')]||!_0x258696[_0x849f('0xb')]){throw new db['Sequelize'][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x58dede=_0x258696;logger['info'](util[_0x849f('0x9')](_0x849f('0x33'),_0x25b276['id']));return sentiment(_0x58dede[_0x849f('0x29')],_0x58dede[_0x849f('0xb')],_0x401480[_0x849f('0x2a')],_0x25b276[_0x849f('0x10')],_0x401480[_0x849f('0x22')]);})[_0x849f('0xd')](function(_0x2431ac){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x2b'),_0x25b276['id']));return _0x25b276[_0x849f('0x1b')]({'sentiment':_0x2431ac[_0x849f('0x34')],'sPositive':_0x2431ac['SentimentScore'][_0x849f('0x2d')],'sNegative':_0x2431ac[_0x849f('0x2c')][_0x849f('0x35')],'sMixed':_0x2431ac[_0x849f('0x2c')][_0x849f('0x2e')],'sNeutral':_0x2431ac[_0x849f('0x2c')]['Neutral'],'transcribeStatus':_0x849f('0x12')});})[_0x849f('0xd')](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x30'),_0x25b276['id']));_0x4f13f9();});}})['catch'](function(_0x3913b7){if(_0x3913b7){if(!_0x3913b7['name']||_0x3913b7[_0x849f('0x36')]!==_0x849f('0x37')){logger[_0x849f('0x38')](util[_0x849f('0x9')](_0x849f('0x39'),_0x25b276['id']),util[_0x849f('0x3a')](_0x3913b7,{'showHidden':![],'depth':null}));}}_0x4f13f9();});});}function checkTranscribe(){var _0x4f9f17;var _0x103185;var _0x1d7be3;return db[_0x849f('0x3b')][_0x849f('0x3c')]({'where':{'transcribeStatus':_0x849f('0x3d')}})[_0x849f('0xd')](function(_0x11adfd){if(!_0x11adfd||!_0x11adfd[_0x849f('0x19')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x3e'));}_0x4f9f17=_0x11adfd;return db[_0x849f('0x3f')][_0x849f('0x27')]({'where':{'id':0x1}});})[_0x849f('0xd')](function(_0x36e27c){if(!_0x36e27c){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Settings\x20not\x20available');}_0x103185=_0x36e27c;if(!_0x103185[_0x849f('0x40')]||!_0x103185['transcribeAccountId']||!_0x103185[_0x849f('0x41')]||!_0x103185[_0x849f('0x22')]||!_0x103185[_0x849f('0x23')]){throw new db[(_0x849f('0x1d'))]['ValidationError']('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x103185['transcribeAccountId']}});})['then'](function(_0x1f6117){if(!_0x1f6117){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x42'));}if(!_0x1f6117[_0x849f('0x29')]||!_0x1f6117[_0x849f('0xb')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x1d7be3=_0x1f6117;var _0xa7d9e2=[];_0x4f9f17[_0x849f('0x43')](function(_0x27719a){_0xa7d9e2[_0x849f('0x44')](checkTranscribeJob(_0x27719a,_0x103185,_0x1d7be3));});return BPromise[_0x849f('0x45')](_0xa7d9e2);})[_0x849f('0x46')](function(_0x45f26b){if(_0x45f26b){if(!_0x45f26b['name']||_0x45f26b['name']!==_0x849f('0x37')){logger[_0x849f('0x38')](util[_0x849f('0x3a')](_0x45f26b,{'showHidden':![],'depth':null}));}}});}exports[_0x849f('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index e1ad871..5ae2e4b 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1af9=['moment','ioredis','util','../logger','schedule','redis','defaults','localhost','lastMsgAt','subtract','hours','then','info','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','error','inspect','start','lodash'];(function(_0x6bf16d,_0x7c0cd1){var _0x32a608=function(_0x2222da){while(--_0x2222da){_0x6bf16d['push'](_0x6bf16d['shift']());}};_0x32a608(++_0x7c0cd1);}(_0x1af9,0x15b));var _0x91af=function(_0x1f5baa,_0x27a70b){_0x1f5baa=_0x1f5baa-0x0;var _0x6cc174=_0x1af9[_0x1f5baa];return _0x6cc174;};'use strict';var _=require(_0x91af('0x0'));var moment=require(_0x91af('0x1'));var Redis=require(_0x91af('0x2'));var util=require(_0x91af('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x91af('0x4'))(_0x91af('0x5'));config[_0x91af('0x6')]=_[_0x91af('0x7')](config[_0x91af('0x6')],{'host':_0x91af('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91af('0x6')]));function closeInteractions(){var _0x4710ff=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x91af('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x91af('0xa')](0x18,_0x91af('0xb'))}}})[_0x91af('0xc')](function(_0x37ad49){if(_0x37ad49&&_0x37ad49['length']){_0x4710ff=_['map'](_0x37ad49||[],'id');logger[_0x91af('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4710ff['join']());return db[_0x91af('0xe')][_0x91af('0xf')]({'closeReason':_0x91af('0x10'),'disposition':_0x91af('0x11'),'closed':!![],'closedAt':moment()[_0x91af('0x12')](_0x91af('0x13'))},{'where':{'id':_0x4710ff}});}})[_0x91af('0xc')](function(){if(_0x4710ff&&_0x4710ff[_0x91af('0x14')]){logger[_0x91af('0xd')](_0x91af('0x15'),_0x4710ff[_0x91af('0x16')]());for(var _0x1050ca=0x0;_0x1050ca<_0x4710ff['length'];_0x1050ca++){io[_0x91af('0x17')](_0x91af('0x18'),{'id':_0x4710ff[_0x1050ca],'closed':!![]});}}})[_0x91af('0x19')](function(_0x25e2ac){logger[_0x91af('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x25e2ac?util[_0x91af('0x1b')](_0x25e2ac,{'showHidden':![],'depth':null}):'');});}exports[_0x91af('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdced=['emit','error','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x711bc2,_0x43a478){var _0x34fa5d=function(_0x5b3f2c){while(--_0x5b3f2c){_0x711bc2['push'](_0x711bc2['shift']());}};_0x34fa5d(++_0x43a478);}(_0xdced,0xcb));var _0xddce=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0xdced[_0x4e566c];return _0x31947e;};'use strict';var _=require('lodash');var moment=require(_0xddce('0x0'));var Redis=require(_0xddce('0x1'));var util=require(_0xddce('0x2'));var config=require(_0xddce('0x3'));var db=require(_0xddce('0x4'))['db'];var logger=require(_0xddce('0x5'))('schedule');config[_0xddce('0x6')]=_['defaults'](config[_0xddce('0x6')],{'host':_0xddce('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xddce('0x6')]));function closeInteractions(){var _0x57e11c=[];return db[_0xddce('0x8')][_0xddce('0x9')]({'raw':!![],'attributes':['id',_0xddce('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xddce('0xb')](0x18,'hours')}}})[_0xddce('0xc')](function(_0x392605){if(_0x392605&&_0x392605[_0xddce('0xd')]){_0x57e11c=_['map'](_0x392605||[],'id');logger['info'](_0xddce('0xe'),_0x57e11c[_0xddce('0xf')]());return db['WhatsappInteraction'][_0xddce('0x10')]({'closeReason':_0xddce('0x11'),'disposition':_0xddce('0x12'),'closed':!![],'closedAt':moment()['format'](_0xddce('0x13'))},{'where':{'id':_0x57e11c}});}})['then'](function(){if(_0x57e11c&&_0x57e11c[_0xddce('0xd')]){logger[_0xddce('0x14')](_0xddce('0x15'),_0x57e11c[_0xddce('0xf')]());for(var _0x1e5ca2=0x0;_0x1e5ca2<_0x57e11c[_0xddce('0xd')];_0x1e5ca2++){io[_0xddce('0x16')]('whatsappInteraction:update',{'id':_0x57e11c[_0x1e5ca2],'closed':!![]});}}})['catch'](function(_0x3bbec9){logger[_0xddce('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3bbec9?util[_0xddce('0x18')](_0x3bbec9,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index fb8616b..999c1a5 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63a1=['catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x63a1,0x169));var _0x163a=function(_0x17dffc,_0x5e8ee1){_0x17dffc=_0x17dffc-0x0;var _0x4612b6=_0x63a1[_0x17dffc];return _0x4612b6;};'use strict';var util=require(_0x163a('0x0'));var db=require(_0x163a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x163a('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x163a('0x3')+i,'phone':0xf879fb460+i,'email':_0x163a('0x4')+i+_0x163a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x163a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x163a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x163a('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x163a('0x2')]({'id':i,'firstName':_0x163a('0x7')+i,'lastName':_0x163a('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x163a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x163a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x163a('0x6')](),'updatedAt':Date[_0x163a('0x6')]()});}db[_0x163a('0x8')][_0x163a('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0x163a('0xa')](contacts);})[_0x163a('0xb')](function(){console[_0x163a('0xc')](_0x163a('0xd'),_0x163a('0xe'));return db[_0x163a('0xf')]['destroy']({'where':{}});})[_0x163a('0xb')](function(){return db[_0x163a('0xf')][_0x163a('0xa')](hopper);})['then'](function(){console['log'](_0x163a('0xd'),_0x163a('0x10'));return db[_0x163a('0x8')][_0x163a('0xa')](contacts2);})[_0x163a('0xb')](function(){console[_0x163a('0xc')](_0x163a('0xd'),'contacts2');return db['CmHopper'][_0x163a('0xa')](hopper2);})[_0x163a('0xb')](function(){console['log'](_0x163a('0xd'),'hopper2');})[_0x163a('0x11')](function(_0x4f3a25){console['log'](_0x4f3a25);}); \ No newline at end of file +var _0x4df6=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then'];(function(_0x2e43b5,_0x4db3cf){var _0x3666bf=function(_0x4324af){while(--_0x4324af){_0x2e43b5['push'](_0x2e43b5['shift']());}};_0x3666bf(++_0x4db3cf);}(_0x4df6,0x1d1));var _0x64df=function(_0x5d3bd4,_0x3f4535){_0x5d3bd4=_0x5d3bd4-0x0;var _0x51b857=_0x4df6[_0x5d3bd4];return _0x51b857;};'use strict';var util=require(_0x64df('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x64df('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x64df('0x2')+i,'phone':0xf879fb460+i,'email':_0x64df('0x3')+i+_0x64df('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x64df('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x64df('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x64df('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x64df('0x1')]({'id':i,'firstName':_0x64df('0x6')+i,'lastName':_0x64df('0x2')+i,'phone':0xf879fb460+i,'email':_0x64df('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x64df('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x64df('0x5')]()});}db[_0x64df('0x7')][_0x64df('0x8')]({'where':{}})[_0x64df('0x9')](function(){return db[_0x64df('0x7')][_0x64df('0xa')](contacts);})[_0x64df('0x9')](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0xd'));return db[_0x64df('0xe')]['destroy']({'where':{}});})[_0x64df('0x9')](function(){return db[_0x64df('0xe')][_0x64df('0xa')](hopper);})['then'](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0xf'));return db['CmContact'][_0x64df('0xa')](contacts2);})['then'](function(){console['log'](_0x64df('0xc'),_0x64df('0x10'));return db[_0x64df('0xe')][_0x64df('0xa')](hopper2);})[_0x64df('0x9')](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0x11'));})[_0x64df('0x12')](function(_0x4b7246){console['log'](_0x4b7246);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5334b28..c95a2d5 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac18=['bulkCreate','log','catch','util','../mysqldb','format','%s%s','agent','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','User'];(function(_0x5a7513,_0xa2742f){var _0x41af54=function(_0x447ee0){while(--_0x447ee0){_0x5a7513['push'](_0x5a7513['shift']());}};_0x41af54(++_0xa2742f);}(_0xac18,0x173));var _0x8ac1=function(_0x19951d,_0x3a542c){_0x19951d=_0x19951d-0x0;var _0x1843ce=_0xac18[_0x19951d];return _0x1843ce;};'use strict';var util=require(_0x8ac1('0x0'));var db=require(_0x8ac1('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x8ac1('0x2')](_0x8ac1('0x3'),_0x8ac1('0x4'),i),'fullname':util[_0x8ac1('0x2')](_0x8ac1('0x3'),_0x8ac1('0x4'),i),'email':util[_0x8ac1('0x2')]('%s%s@xcally.com',_0x8ac1('0x4'),i),'role':_0x8ac1('0x4'),'password':_0x8ac1('0x5'),'internal':0xfa0+i,'type':_0x8ac1('0x6'),'transport':[_0x8ac1('0x7'),'ws',_0x8ac1('0x8')],'disallow':[_0x8ac1('0x9')],'allow':['ulaw'],'defaultuser':util[_0x8ac1('0x2')]('%s%s',_0x8ac1('0x4'),i),'encryption':_0x8ac1('0xa'),'avpf':_0x8ac1('0xa'),'force_avp':_0x8ac1('0xa'),'icesupport':'yes','dtlsenable':_0x8ac1('0xa'),'dtlsverify':'no','dtlscertfile':_0x8ac1('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x8ac1('0x2')]('\x22%s\x22\x20<%s>',util[_0x8ac1('0x2')](_0x8ac1('0x3'),'agent',i),0xfa0+i)});}db[_0x8ac1('0xc')][_0x8ac1('0xd')](users)['then'](function(){console[_0x8ac1('0xe')]('add\x20user');})[_0x8ac1('0xf')](function(_0x1e71e1){console['log'](_0x1e71e1);}); \ No newline at end of file +var _0xc049=['\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','push','format','agent','%s%s','%s%s@xcally.com','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xc049,0xde));var _0x9c04=function(_0x79098a,_0x143930){_0x79098a=_0x79098a-0x0;var _0x3a959b=_0xc049[_0x79098a];return _0x3a959b;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9c04('0x0')]({'name':util[_0x9c04('0x1')]('%s%s',_0x9c04('0x2'),i),'fullname':util['format'](_0x9c04('0x3'),_0x9c04('0x2'),i),'email':util[_0x9c04('0x1')](_0x9c04('0x4'),'agent',i),'role':_0x9c04('0x2'),'password':'password','internal':0xfa0+i,'type':_0x9c04('0x5'),'transport':[_0x9c04('0x6'),'ws','wss'],'disallow':[_0x9c04('0x7')],'allow':['ulaw'],'defaultuser':util['format'](_0x9c04('0x3'),_0x9c04('0x2'),i),'encryption':_0x9c04('0x8'),'avpf':_0x9c04('0x8'),'force_avp':_0x9c04('0x8'),'icesupport':'yes','dtlsenable':_0x9c04('0x8'),'dtlsverify':'no','dtlscertfile':_0x9c04('0x9'),'dtlsprivatekey':_0x9c04('0xa'),'dtlssetup':_0x9c04('0xb'),'callerid':util['format'](_0x9c04('0xc'),util[_0x9c04('0x1')](_0x9c04('0x3'),_0x9c04('0x2'),i),0xfa0+i)});}db[_0x9c04('0xd')]['bulkCreate'](users)[_0x9c04('0xe')](function(){console[_0x9c04('0xf')](_0x9c04('0x10'));})[_0x9c04('0x11')](function(_0x503ba7){console[_0x9c04('0xf')](_0x503ba7);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 18e7fbf..7e1cbac 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed83=['find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','MailQueue','OpenchannelQueue','VoiceQueue','FaxQueue','SmsQueue','WhatsappQueue','Telephones','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','ChatInteractions','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','leave','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','default','connection','setMaxListeners','request','remotePort','connectedAt','log','SocketIO\x20','address','disconnect','DISCONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','findOne','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','UserProfileResource','resourceId','then','map','Campaign','where','%s:queue:%s','length','format','user:%s','handshake','query'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xed83,0x160));var _0x3ed8=function(_0x4c14e1,_0x164882){_0x4c14e1=_0x4c14e1-0x0;var _0x4accda=_0xed83[_0x4c14e1];return _0x4accda;};'use strict';var _=require('lodash');var util=require(_0x3ed8('0x0'));var BPromise=require(_0x3ed8('0x1'));var db=require(_0x3ed8('0x2'))['db'];var config=require(_0x3ed8('0x3'));var queryQueues={'attributes':['id',_0x3ed8('0x4')],'include':[{'as':_0x3ed8('0x5'),'model':db[_0x3ed8('0x6')],'attributes':['id',_0x3ed8('0x4'),_0x3ed8('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x3ed8('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x3ed8('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x3ed8('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x3ed8('0x4'),_0x3ed8('0xa')],'where':{'type':_0x3ed8('0xb')}};function getAssociatedResources(_0x4a7f85,_0x5093ca,_0x3939a9){return db['UserProfileSection'][_0x3ed8('0xc')]({'where':{'name':_0x4a7f85,'userProfileId':_0x5093ca},'raw':!![]})['then'](function(_0x23605a){if(_0x23605a){if(_0x23605a['autoAssociation']){switch(_0x4a7f85){case _0x3ed8('0xd'):case _0x3ed8('0xe'):case _0x3ed8('0xf'):case'SmsQueues':case _0x3ed8('0x10'):case _0x3ed8('0x11'):case _0x3ed8('0x12'):return db[_0x3939a9][_0x3ed8('0x13')](queryQueues);case'Telephones':return db[_0x3939a9][_0x3ed8('0x13')](queryTelephones);case'Trunks':return db[_0x3939a9][_0x3ed8('0x13')](queryTrunks);case'IvrCampaigns':return db[_0x3939a9]['findAll'](queryCampaigns);}}else{return db[_0x3ed8('0x14')][_0x3ed8('0x13')]({'attributes':[_0x3ed8('0x15')],'where':{'sectionId':_0x23605a['id']},'raw':!![]})[_0x3ed8('0x16')](function(_0x405344){if(_0x405344){var _0x211045={'where':{'id':_[_0x3ed8('0x17')](_0x405344,_0x3ed8('0x15'))},'raw':!![]};switch(_0x3939a9){case _0x3ed8('0x6'):_0x211045['where'][_0x3ed8('0x7')]=_0x3ed8('0x8');break;case _0x3ed8('0x18'):_0x211045[_0x3ed8('0x19')][_0x3ed8('0xa')]=_0x3ed8('0xb');break;}return db[_0x3939a9][_0x3ed8('0x13')](_0x211045);}else{return[];}});}}else{return[];}})[_0x3ed8('0x16')](function(_0xe546c8){return _0xe546c8;});}function joinOrLeaveQueues(_0x4f9ef5,_0x3208db,_0x2fe3e3,_0x2a106c){_0x4f9ef5[_0x3208db](util['format'](_0x3ed8('0x1a'),_0x2fe3e3,_0x2a106c[_0x3ed8('0x4')]));if(_0x2a106c['Agents']){for(var _0x172807=0x0;_0x172807<_0x2a106c[_0x3ed8('0x5')][_0x3ed8('0x1b')];_0x172807+=0x1){_0x4f9ef5[_0x3208db](util[_0x3ed8('0x1c')](_0x3ed8('0x1d'),_0x2a106c['Agents'][_0x172807][_0x3ed8('0x4')]));}}}function joinOrLeave(_0x191fb5,_0x3c0bf2,_0x5e3262){var _0x4f7bbd;if(_0x191fb5[_0x3ed8('0x1e')][_0x3ed8('0x1f')]['id']){db['User'][_0x3ed8('0x20')]({'attributes':['id','name',_0x3ed8('0x7'),_0x3ed8('0x21')],'where':{'id':_0x191fb5['handshake']['query']['id']},'include':[{'model':db[_0x3ed8('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x3ed8('0x23')],'as':_0x3ed8('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x3ed8('0x25')],'as':_0x3ed8('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x3ed8('0x27')],'as':_0x3ed8('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x3ed8('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x3ed8('0x2a')],'as':_0x3ed8('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x3ed8('0x16')](function(_0x56bb68){if(_0x56bb68){_0x4f7bbd=_0x56bb68;_0x191fb5[_0x3c0bf2](util[_0x3ed8('0x1c')]('user:%s',_0x56bb68['name']));var _0x1a47b1=[];switch(_0x56bb68[_0x3ed8('0x7')]){case _0x3ed8('0x2c'):_0x191fb5[_0x3c0bf2](_0x3ed8('0x2d'));_0x191fb5[_0x3c0bf2](_0x3ed8('0x2e'));if(queryQueues[_0x3ed8('0x2f')](_0x3ed8('0x30'))){delete queryQueues[_0x3ed8('0x30')];}_0x1a47b1['push'](db['VoiceQueue'][_0x3ed8('0x13')](queryQueues));_0x1a47b1[_0x3ed8('0x31')](db[_0x3ed8('0x32')]['findAll'](queryQueues));_0x1a47b1[_0x3ed8('0x31')](db['FaxQueue'][_0x3ed8('0x13')](queryQueues));_0x1a47b1[_0x3ed8('0x31')](db['SmsQueue'][_0x3ed8('0x13')](queryQueues));_0x1a47b1['push'](db[_0x3ed8('0x33')][_0x3ed8('0x13')](queryQueues));_0x1a47b1[_0x3ed8('0x31')](db[_0x3ed8('0x34')][_0x3ed8('0x13')](queryQueues));_0x1a47b1['push'](db['WhatsappQueue'][_0x3ed8('0x13')](queryQueues));_0x1a47b1['push'](db['User']['findAll'](queryTelephones));_0x1a47b1[_0x3ed8('0x31')](db['Trunk']['findAll'](queryTrunks));_0x1a47b1['push'](db[_0x3ed8('0x18')][_0x3ed8('0x13')](queryCampaigns));_0x1a47b1[_0x3ed8('0x31')](db[_0x3ed8('0x6')]['findAll'](queryAgents));break;case'user':_0x191fb5[_0x3c0bf2](_0x3ed8('0x2d'));_0x191fb5[_0x3c0bf2](_0x3ed8('0x2e'));_0x1a47b1['push'](getAssociatedResources('VoiceQueues',_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x35')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources(_0x3ed8('0xe'),_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x32')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources(_0x3ed8('0xf'),_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x36')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources('SmsQueues',_0x56bb68['userProfileId'],_0x3ed8('0x37')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources('MailQueues',_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x33')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources('OpenchannelQueues',_0x56bb68['userProfileId'],_0x3ed8('0x34')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources('WhatsappQueues',_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x38')));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources(_0x3ed8('0x39'),_0x56bb68['userProfileId'],'User'));_0x1a47b1['push'](getAssociatedResources(_0x3ed8('0x3a'),_0x56bb68[_0x3ed8('0x21')],'Trunk'));_0x1a47b1[_0x3ed8('0x31')](getAssociatedResources('IvrCampaigns',_0x56bb68[_0x3ed8('0x21')],_0x3ed8('0x18')));_0x1a47b1['push'](db[_0x3ed8('0x6')]['findAll'](queryAgents));break;case'agent':_0x191fb5[_0x3c0bf2](_0x3ed8('0x2d'));_0x191fb5[_0x3c0bf2]('voice:outbound');_0x1a47b1['push'](_0x56bb68[_0x3ed8('0x3b')]({'attributes':['id',_0x3ed8('0x4')]}));_0x1a47b1[_0x3ed8('0x31')](_0x56bb68[_0x3ed8('0x3c')]({'attributes':['id','name']}));_0x1a47b1['push'](_0x56bb68[_0x3ed8('0x3d')]({'attributes':['id',_0x3ed8('0x4')]}));_0x1a47b1[_0x3ed8('0x31')](_0x56bb68[_0x3ed8('0x3e')]({'attributes':['id',_0x3ed8('0x4')]}));_0x1a47b1['push'](_0x56bb68['getMailQueues']({'attributes':['id',_0x3ed8('0x4')]}));_0x1a47b1[_0x3ed8('0x31')](_0x56bb68[_0x3ed8('0x3f')]({'attributes':['id','name']}));_0x1a47b1['push'](_0x56bb68['getWhatsappQueues']({'attributes':['id',_0x3ed8('0x4')]}));break;}return BPromise[_0x3ed8('0x40')](_0x1a47b1);}})['then'](function(_0x4c9654){if(_0x4c9654&&_0x4c9654[_0x3ed8('0x1b')]){for(var _0x329429=0x0;_0x329429<_0x4c9654['length'];_0x329429+=0x1){for(var _0x53af6f=0x0;_0x53af6f<_0x4c9654[_0x329429][_0x3ed8('0x1b')];_0x53af6f+=0x1){switch(_0x329429){case 0x0:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,'voice',_0x4c9654[_0x329429][_0x53af6f]);break;case 0x1:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,_0x3ed8('0x41'),_0x4c9654[_0x329429][_0x53af6f]);break;case 0x2:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,_0x3ed8('0x42'),_0x4c9654[_0x329429][_0x53af6f]);break;case 0x3:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,_0x3ed8('0x43'),_0x4c9654[_0x329429][_0x53af6f]);break;case 0x4:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,_0x3ed8('0x44'),_0x4c9654[_0x329429][_0x53af6f]);break;case 0x5:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,_0x3ed8('0x45'),_0x4c9654[_0x329429][_0x53af6f]);break;case 0x6:joinOrLeaveQueues(_0x191fb5,_0x3c0bf2,'whatsapp',_0x4c9654[_0x329429][_0x53af6f]);break;case 0x7:if(_0x4f7bbd[_0x3ed8('0x7')]!==_0x3ed8('0x9'))_0x191fb5[_0x3c0bf2](util['format'](_0x3ed8('0x46'),_0x4c9654[_0x329429][_0x53af6f][_0x3ed8('0x4')]));break;case 0x8:if(_0x4f7bbd[_0x3ed8('0x7')]!==_0x3ed8('0x9'))_0x191fb5[_0x3c0bf2](util['format'](_0x3ed8('0x47'),_0x4c9654[_0x329429][_0x53af6f][_0x3ed8('0x4')]));break;case 0x9:if(_0x4f7bbd[_0x3ed8('0x7')]!==_0x3ed8('0x9'))_0x191fb5[_0x3c0bf2](util[_0x3ed8('0x1c')](_0x3ed8('0x48'),_0x4c9654[_0x329429][_0x53af6f][_0x3ed8('0xa')],_0x4c9654[_0x329429][_0x53af6f][_0x3ed8('0x4')]));break;case 0xa:_0x191fb5[_0x3c0bf2](util['format'](_0x3ed8('0x1d'),_0x4c9654[_0x329429][_0x53af6f]['name']));break;}}}}})[_0x3ed8('0x16')](function(){if(_0x3c0bf2==='leave'){var _0x459d5e=_[_0x3ed8('0x17')](_0x4f7bbd[_0x3ed8('0x49')],'id');return _0x4f7bbd[_0x3ed8('0x4a')](_0x459d5e)[_0x3ed8('0x16')](function(){for(var _0x281989=0x0;_0x281989<_0x459d5e[_0x3ed8('0x1b')];_0x281989+=0x1){_0x5e3262[_0x3ed8('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x459d5e[_0x281989]),'UserId':Number(_0x4f7bbd['id'])});}});}})['then'](function(){if(_0x3c0bf2==='leave'){var _0x188bac=_[_0x3ed8('0x17')](_0x4f7bbd[_0x3ed8('0x24')],'id');return _0x4f7bbd[_0x3ed8('0x4c')](_0x188bac)['then'](function(){for(var _0x22ed86=0x0;_0x22ed86<_0x188bac[_0x3ed8('0x1b')];_0x22ed86+=0x1){_0x5e3262[_0x3ed8('0x4b')](_0x3ed8('0x4d'),{'MailInteractionId':Number(_0x188bac[_0x22ed86]),'UserId':Number(_0x4f7bbd['id'])});}});}})[_0x3ed8('0x16')](function(){if(_0x3c0bf2===_0x3ed8('0x4e')){var _0x2e162b=_['map'](_0x4f7bbd[_0x3ed8('0x26')],'id');return _0x4f7bbd['removeFaxInteractions'](_0x2e162b)[_0x3ed8('0x16')](function(){for(var _0x5d7ed8=0x0;_0x5d7ed8<_0x2e162b[_0x3ed8('0x1b')];_0x5d7ed8+=0x1){_0x5e3262[_0x3ed8('0x4b')](_0x3ed8('0x4f'),{'FaxInteractionId':Number(_0x2e162b[_0x5d7ed8]),'UserId':Number(_0x4f7bbd['id'])});}});}})[_0x3ed8('0x16')](function(){if(_0x3c0bf2==='leave'){var _0x144642=_[_0x3ed8('0x17')](_0x4f7bbd[_0x3ed8('0x28')],'id');return _0x4f7bbd['removeSmsInteractions'](_0x144642)[_0x3ed8('0x16')](function(){for(var _0x43ccf0=0x0;_0x43ccf0<_0x144642[_0x3ed8('0x1b')];_0x43ccf0+=0x1){_0x5e3262[_0x3ed8('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x144642[_0x43ccf0]),'UserId':Number(_0x4f7bbd['id'])});}});}})[_0x3ed8('0x16')](function(){if(_0x3c0bf2===_0x3ed8('0x4e')){var _0xce24ec=_['map'](_0x4f7bbd[_0x3ed8('0x29')],'id');return _0x4f7bbd[_0x3ed8('0x50')](_0xce24ec)[_0x3ed8('0x16')](function(){for(var _0x5721c4=0x0;_0x5721c4<_0xce24ec[_0x3ed8('0x1b')];_0x5721c4+=0x1){_0x5e3262['emit'](_0x3ed8('0x51'),{'OpenchannelInteractionId':Number(_0xce24ec[_0x5721c4]),'UserId':Number(_0x4f7bbd['id'])});}});}})[_0x3ed8('0x16')](function(){if(_0x3c0bf2===_0x3ed8('0x4e')){var _0x58ac4f=_['map'](_0x4f7bbd['WhatsappInteractions'],'id');return _0x4f7bbd[_0x3ed8('0x52')](_0x58ac4f)['then'](function(){for(var _0x5eecc2=0x0;_0x5eecc2<_0x58ac4f['length'];_0x5eecc2+=0x1){_0x5e3262['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x58ac4f[_0x5eecc2]),'UserId':Number(_0x4f7bbd['id'])});}});}})[_0x3ed8('0x53')](function(_0x44f87){_0x191fb5['log'](_0x44f87);});}}function onDisconnect(_0x4305d4,_0x295ba5){joinOrLeave(_0x4305d4,_0x3ed8('0x4e'),_0x295ba5);}function onConnect(_0x161259){joinOrLeave(_0x161259,_0x3ed8('0x54'));}exports[_0x3ed8('0x55')]=function(_0x3debd3){_0x3debd3['on'](_0x3ed8('0x56'),function(_0x50ce57){_0x50ce57[_0x3ed8('0x57')](0x0);_0x50ce57['address']=_0x50ce57[_0x3ed8('0x58')][_0x3ed8('0x56')]['remoteAddress']+':'+_0x50ce57[_0x3ed8('0x58')]['connection'][_0x3ed8('0x59')];_0x50ce57[_0x3ed8('0x5a')]=new Date();_0x50ce57[_0x3ed8('0x5b')]=function(_0x5534da){console['log'](_0x3ed8('0x5c')+_0x50ce57['nsp'][_0x3ed8('0x4')]+'['+_0x50ce57[_0x3ed8('0x5d')]+']',_0x5534da);};_0x50ce57['on'](_0x3ed8('0x5e'),function(){onDisconnect(_0x50ce57,_0x3debd3);_0x50ce57[_0x3ed8('0x5b')](_0x3ed8('0x5f'));});onConnect(_0x50ce57);_0x50ce57[_0x3ed8('0x5b')]('CONNECTED');});}; \ No newline at end of file +var _0x1c45=['openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','address','request','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','role','Campaign','format','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','userProfileId','SmsQueue','WhatsappQueue','getVoiceQueues','getFaxQueues','getMailQueues','all','voice','fax','sms','mail'];(function(_0x5052df,_0x5f232e){var _0x51fd2f=function(_0x488f1a){while(--_0x488f1a){_0x5052df['push'](_0x5052df['shift']());}};_0x51fd2f(++_0x5f232e);}(_0x1c45,0x1b0));var _0x51c4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1c45[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var BPromise=require(_0x51c4('0x2'));var db=require(_0x51c4('0x3'))['db'];var config=require(_0x51c4('0x4'));var queryQueues={'attributes':['id',_0x51c4('0x5')],'include':[{'as':_0x51c4('0x6'),'model':db[_0x51c4('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x51c4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x51c4('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x51c4('0x5'),_0x51c4('0xa')],'where':{'type':_0x51c4('0xb')}};function getAssociatedResources(_0x524a08,_0x52fc47,_0x39ceec){return db[_0x51c4('0xc')][_0x51c4('0xd')]({'where':{'name':_0x524a08,'userProfileId':_0x52fc47},'raw':!![]})[_0x51c4('0xe')](function(_0x109781){if(_0x109781){if(_0x109781[_0x51c4('0xf')]){switch(_0x524a08){case'VoiceQueues':case _0x51c4('0x10'):case _0x51c4('0x11'):case _0x51c4('0x12'):case _0x51c4('0x13'):case _0x51c4('0x14'):case _0x51c4('0x15'):return db[_0x39ceec][_0x51c4('0x16')](queryQueues);case _0x51c4('0x17'):return db[_0x39ceec][_0x51c4('0x16')](queryTelephones);case _0x51c4('0x18'):return db[_0x39ceec][_0x51c4('0x16')](queryTrunks);case _0x51c4('0x19'):return db[_0x39ceec][_0x51c4('0x16')](queryCampaigns);}}else{return db['UserProfileResource'][_0x51c4('0x16')]({'attributes':[_0x51c4('0x1a')],'where':{'sectionId':_0x109781['id']},'raw':!![]})['then'](function(_0x312169){if(_0x312169){var _0x42d96f={'where':{'id':_[_0x51c4('0x1b')](_0x312169,_0x51c4('0x1a'))},'raw':!![]};switch(_0x39ceec){case _0x51c4('0x7'):_0x42d96f[_0x51c4('0x1c')][_0x51c4('0x1d')]='telephone';break;case _0x51c4('0x1e'):_0x42d96f[_0x51c4('0x1c')]['type']=_0x51c4('0xb');break;}return db[_0x39ceec]['findAll'](_0x42d96f);}else{return[];}});}}else{return[];}})[_0x51c4('0xe')](function(_0x1f227d){return _0x1f227d;});}function joinOrLeaveQueues(_0x2e7341,_0x44c384,_0x535690,_0x3a67ed){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')]('%s:queue:%s',_0x535690,_0x3a67ed['name']));if(_0x3a67ed[_0x51c4('0x6')]){for(var _0x1fb226=0x0;_0x1fb226<_0x3a67ed[_0x51c4('0x6')][_0x51c4('0x20')];_0x1fb226+=0x1){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x3a67ed['Agents'][_0x1fb226][_0x51c4('0x5')]));}}}function joinOrLeave(_0x45cc46,_0x3cc1c0,_0x3b56d1){var _0x2281a0;if(_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']){db[_0x51c4('0x7')][_0x51c4('0x24')]({'attributes':['id',_0x51c4('0x5'),_0x51c4('0x1d'),'userProfileId'],'where':{'id':_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']},'include':[{'model':db[_0x51c4('0x25')],'as':_0x51c4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x27')],'as':_0x51c4('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x29')],'as':_0x51c4('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2b')],'as':_0x51c4('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2d')],'as':_0x51c4('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2f')],'as':_0x51c4('0x30'),'attributes':['id'],'raw':!![]}]})[_0x51c4('0xe')](function(_0x573f86){if(_0x573f86){_0x2281a0=_0x573f86;_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x573f86['name']));var _0x2275ba=[];switch(_0x573f86[_0x51c4('0x1d')]){case _0x51c4('0x31'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));if(queryQueues['hasOwnProperty'](_0x51c4('0x34'))){delete queryQueues[_0x51c4('0x34')];}_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x36')]['findAll'](queryQueues));_0x2275ba['push'](db[_0x51c4('0x37')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db[_0x51c4('0x38')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db['SmsQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x39')]['findAll'](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x3a')][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['WhatsappQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['User'][_0x51c4('0x16')](queryTelephones));_0x2275ba['push'](db[_0x51c4('0x3b')][_0x51c4('0x16')](queryTrunks));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x1e')][_0x51c4('0x16')](queryCampaigns));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x3c'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x3d'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x36')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x10'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x37')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x11'),_0x573f86[_0x51c4('0x3e')],'FaxQueue'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x12'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3f')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x13'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x39')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x14'),_0x573f86['userProfileId'],_0x51c4('0x3a')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x15'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x40')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources('Telephones',_0x573f86[_0x51c4('0x3e')],_0x51c4('0x7')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x18'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3b')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x19'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x1e')));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x8'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba['push'](_0x573f86[_0x51c4('0x41')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getChatQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x42')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getSmsQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x43')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getOpenchannelQueues']({'attributes':['id','name']}));_0x2275ba['push'](_0x573f86['getWhatsappQueues']({'attributes':['id',_0x51c4('0x5')]}));break;}return BPromise[_0x51c4('0x44')](_0x2275ba);}})[_0x51c4('0xe')](function(_0x3046c9){if(_0x3046c9&&_0x3046c9[_0x51c4('0x20')]){for(var _0x21616a=0x0;_0x21616a<_0x3046c9[_0x51c4('0x20')];_0x21616a+=0x1){for(var _0xa642c=0x0;_0xa642c<_0x3046c9[_0x21616a][_0x51c4('0x20')];_0xa642c+=0x1){switch(_0x21616a){case 0x0:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x45'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x1:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,'chat',_0x3046c9[_0x21616a][_0xa642c]);break;case 0x2:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x46'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x3:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x47'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x4:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x48'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x5:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x49'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x6:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x4a'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x7:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')]('telephone:%s',_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x8:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4b'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x9:if(_0x2281a0[_0x51c4('0x1d')]!=='agent')_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4c'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0xa')],_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0xa:_0x45cc46[_0x3cc1c0](util['format'](_0x51c4('0x21'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;}}}}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x1f7b02=_[_0x51c4('0x1b')](_0x2281a0['ChatInteractions'],'id');return _0x2281a0[_0x51c4('0x4e')](_0x1f7b02)[_0x51c4('0xe')](function(){for(var _0x53b226=0x0;_0x53b226<_0x1f7b02[_0x51c4('0x20')];_0x53b226+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x50'),{'ChatInteractionId':Number(_0x1f7b02[_0x53b226]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x201020=_[_0x51c4('0x1b')](_0x2281a0['MailInteractions'],'id');return _0x2281a0[_0x51c4('0x51')](_0x201020)[_0x51c4('0xe')](function(){for(var _0x4a1a8c=0x0;_0x4a1a8c<_0x201020[_0x51c4('0x20')];_0x4a1a8c+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x52'),{'MailInteractionId':Number(_0x201020[_0x4a1a8c]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x17c2c7=_['map'](_0x2281a0[_0x51c4('0x2a')],'id');return _0x2281a0[_0x51c4('0x53')](_0x17c2c7)[_0x51c4('0xe')](function(){for(var _0x515ea5=0x0;_0x515ea5<_0x17c2c7[_0x51c4('0x20')];_0x515ea5+=0x1){_0x3b56d1['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x17c2c7[_0x515ea5]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0==='leave'){var _0x3add72=_['map'](_0x2281a0[_0x51c4('0x2c')],'id');return _0x2281a0['removeSmsInteractions'](_0x3add72)['then'](function(){for(var _0x1619c3=0x0;_0x1619c3<_0x3add72[_0x51c4('0x20')];_0x1619c3+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x54'),{'SmsInteractionId':Number(_0x3add72[_0x1619c3]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x5a47be=_['map'](_0x2281a0[_0x51c4('0x2e')],'id');return _0x2281a0['removeOpenchannelInteractions'](_0x5a47be)[_0x51c4('0xe')](function(){for(var _0xc24a04=0x0;_0xc24a04<_0x5a47be[_0x51c4('0x20')];_0xc24a04+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x55'),{'OpenchannelInteractionId':Number(_0x5a47be[_0xc24a04]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x4aa45a=_[_0x51c4('0x1b')](_0x2281a0[_0x51c4('0x30')],'id');return _0x2281a0[_0x51c4('0x56')](_0x4aa45a)[_0x51c4('0xe')](function(){for(var _0x4d1d7d=0x0;_0x4d1d7d<_0x4aa45a[_0x51c4('0x20')];_0x4d1d7d+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x57'),{'WhatsappInteractionId':Number(_0x4aa45a[_0x4d1d7d]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0x58')](function(_0x508613){_0x45cc46['log'](_0x508613);});}}function onDisconnect(_0x4cc05b,_0x17868d){joinOrLeave(_0x4cc05b,_0x51c4('0x4d'),_0x17868d);}function onConnect(_0xcc4cd8){joinOrLeave(_0xcc4cd8,_0x51c4('0x59'));}exports[_0x51c4('0x5a')]=function(_0x75a708){_0x75a708['on'](_0x51c4('0x5b'),function(_0x572553){_0x572553['setMaxListeners'](0x0);_0x572553[_0x51c4('0x5c')]=_0x572553[_0x51c4('0x5d')]['connection']['remoteAddress']+':'+_0x572553[_0x51c4('0x5d')][_0x51c4('0x5b')][_0x51c4('0x5e')];_0x572553['connectedAt']=new Date();_0x572553['log']=function(_0x53e111){console[_0x51c4('0x5f')](_0x51c4('0x60')+_0x572553[_0x51c4('0x61')]['name']+'['+_0x572553[_0x51c4('0x5c')]+']',_0x53e111);};_0x572553['on'](_0x51c4('0x62'),function(){onDisconnect(_0x572553,_0x75a708);_0x572553[_0x51c4('0x5f')](_0x51c4('0x63'));});onConnect(_0x572553);_0x572553[_0x51c4('0x5f')](_0x51c4('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ce96d38..5091db0 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 _0x3935=['Chat','afterCreate','ChatInteraction','afterUpdate','closedinteraction','ChatOfflineMessage','newmessage','Sms','SmsInteraction','newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','motionChannel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','incomingmessage','AfterCreateMessage','get','offlineMessage','opened','resolve','sequelize','name','agent','AfterCreate','changed','closed','substatus','query','AfterUpdate','find','fullname','email','internal','length','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http'];(function(_0x576710,_0x2766d0){var _0x792aaa=function(_0x533a38){while(--_0x533a38){_0x576710['push'](_0x576710['shift']());}};_0x792aaa(++_0x2766d0);}(_0x3935,0xd8));var _0x5393=function(_0x80ab9e,_0x32c636){_0x80ab9e=_0x80ab9e-0x0;var _0x7605e6=_0x3935[_0x80ab9e];return _0x7605e6;};'use strict';var util=require(_0x5393('0x0'));var db=require(_0x5393('0x1'))['db'];var jayson=require(_0x5393('0x2'));var logger=require(_0x5393('0x3'))(_0x5393('0x4'));var client=jayson['client'][_0x5393('0x5')]({'port':0x232a});var triggers=[{'channel':_0x5393('0x6'),'model':'ChatInteraction','event':_0x5393('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x5393('0x6'),'model':_0x5393('0x8'),'event':_0x5393('0x9'),'condition':_0x5393('0xa'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0x5393('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5393('0x6'),'model':_0x5393('0xb'),'event':'afterCreate','condition':_0x5393('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x5393('0xd'),'model':_0x5393('0xe'),'event':_0x5393('0x7'),'condition':_0x5393('0xf'),'callback':afterCreate},{'channel':'Sms','model':_0x5393('0xe'),'event':_0x5393('0x9'),'condition':_0x5393('0xa'),'callback':afterUpdate},{'channel':_0x5393('0xd'),'model':_0x5393('0x10'),'event':_0x5393('0x7'),'condition':_0x5393('0xc'),'callback':afterCreateMessage},{'channel':_0x5393('0x11'),'model':_0x5393('0x12'),'event':_0x5393('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x5393('0x12'),'event':_0x5393('0x9'),'condition':_0x5393('0xa'),'callback':afterUpdate},{'channel':_0x5393('0x11'),'model':_0x5393('0x13'),'event':_0x5393('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5393('0x14'),'model':_0x5393('0x15'),'event':_0x5393('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x5393('0x14'),'model':_0x5393('0x15'),'event':_0x5393('0x9'),'condition':_0x5393('0xa'),'callback':afterUpdate},{'channel':_0x5393('0x14'),'model':_0x5393('0x16'),'event':'afterCreate','condition':_0x5393('0xc'),'callback':afterCreateMessage},{'channel':_0x5393('0x17'),'model':_0x5393('0x18'),'event':_0x5393('0x7'),'condition':_0x5393('0xf'),'callback':afterCreate},{'channel':_0x5393('0x17'),'model':_0x5393('0x18'),'event':_0x5393('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x5393('0x17'),'model':_0x5393('0x19'),'event':_0x5393('0x7'),'condition':_0x5393('0xc'),'callback':afterCreateMessage},{'channel':_0x5393('0x1a'),'model':_0x5393('0x1b'),'event':_0x5393('0x7'),'condition':_0x5393('0xf'),'callback':afterCreate},{'channel':_0x5393('0x1a'),'model':_0x5393('0x1b'),'event':'afterUpdate','condition':_0x5393('0xa'),'callback':afterUpdate},{'channel':_0x5393('0x1a'),'model':'OpenchannelMessage','event':_0x5393('0x7'),'condition':_0x5393('0xc'),'callback':afterCreateMessage}];function request(_0x249767){return client['request'](_0x5393('0x1c'),_0x249767)[_0x5393('0x1d')](function(_0x27ebce){logger[_0x5393('0x1e')](_0x5393('0x1f'),'EventManager',_0x27ebce);if(_0x27ebce[_0x5393('0x20')]){if(_0x27ebce['error'][_0x5393('0x21')]===0x1f4){logger[_0x5393('0x20')](_0x5393('0x1f'),_0x5393('0x1c'),_0x27ebce[_0x5393('0x20')]);}}})[_0x5393('0x22')](function(_0x5111d3){logger['error'](_0x5393('0x1f'),_0x5393('0x1c'),_0x5111d3);});}function afterCreateMessage(_0x353780){return function(_0x5ed391){_0x5ed391=_0x5ed391['get']({'plain':!![]});_0x5ed391[_0x5393('0x23')]=_0x353780;_0x5ed391[_0x5393('0x24')]=_0x353780;_0x5ed391[_0x5393('0x25')]=_0x5ed391[_0x5393('0x26')];Promise['resolve']()['then'](function(){if(typeof _0x5ed391[_0x5393('0x27')]===_0x5393('0x28'))return null;var _0x33e70c=_0x5393('0x29')+_0x5ed391['ContactId'];return db['sequelize']['query'](_0x33e70c,{'type':db[_0x5393('0x2a')][_0x5393('0x2b')][_0x5393('0x2c')],'raw':!![]});})[_0x5393('0x1d')](function(_0x2aa682){if(_0x2aa682){_0x5ed391[_0x5393('0x2d')]=_0x2aa682[0x0];}if(typeof _0x5ed391[_0x5393('0x2e')]===_0x5393('0x28'))return;return getAgent(_0x5ed391['UserId']);})[_0x5393('0x1d')](function(_0x5ed2d2){if(_0x5ed2d2){_0x5ed391[_0x5393('0x2f')]=util[_0x5393('0x30')](_0x5393('0x31'),_0x5ed2d2['name']);_0x5ed391['agent']=_0x5ed2d2;_0x5ed391[_0x5393('0x23')]=_0x353780;return request({'event':_0x5393('0x32'),'message':_0x5ed391});}else{return request({'event':'outgoingmessage','message':_0x5ed391});}})[_0x5393('0x22')](function(_0x5f5a17){logger[_0x5393('0x20')](_0x5393('0x1f'),_0x5393('0x33'),_0x5f5a17);});};}function afterCreateOfflineMessage(_0x5a26c2){return function(_0x33d4c0){_0x33d4c0=_0x33d4c0[_0x5393('0x34')]({'plain':!![]});_0x33d4c0['channel']=_0x5a26c2;_0x33d4c0[_0x5393('0x24')]=_0x5a26c2;_0x33d4c0[_0x5393('0x25')]=_0x5393('0x35');return request({'event':_0x33d4c0[_0x5393('0x25')],'message':_0x33d4c0});};}function afterCreate(_0x322294,_0x5b8318){return function(_0x43a02e){_0x43a02e=_0x43a02e[_0x5393('0x34')]({'plain':!![]});_0x43a02e['channel']=_0x322294;_0x43a02e[_0x5393('0x24')]=_0x322294;_0x43a02e['event']=_0x5393('0x36');Promise[_0x5393('0x37')]()[_0x5393('0x1d')](function(){var _0x3b6797=_0x5393('0x29')+_0x43a02e[_0x5393('0x27')];return db[_0x5393('0x38')]['query'](_0x3b6797,{'type':db['Sequelize'][_0x5393('0x2b')]['SELECT'],'raw':!![]});})['then'](function(_0x691bb3){if(_0x691bb3){_0x43a02e[_0x5393('0x2d')]=_0x691bb3[0x0];}if(typeof _0x43a02e[_0x5393('0x2e')]===_0x5393('0x28'))return;return getAgent(_0x43a02e['UserId']);})[_0x5393('0x1d')](function(_0x2661c7){if(_0x2661c7){_0x43a02e[_0x5393('0x2f')]=util[_0x5393('0x30')](_0x5393('0x31'),_0x2661c7[_0x5393('0x39')]);_0x43a02e[_0x5393('0x3a')]=_0x2661c7;}return request({'event':_0x5b8318,'message':_0x43a02e});})[_0x5393('0x22')](function(_0xc8611d){logger['error'](_0x5393('0x1f'),_0x5393('0x3b'),_0xc8611d);});};}function afterUpdate(_0x153e5c){return function(_0x26340a){var _0x3eb159=_0x26340a[_0x5393('0x3c')](_0x5393('0x3d'))&&_0x26340a['closed'];var _0x5645f9=_0x26340a['changed'](_0x5393('0x3e'));if(_0x3eb159||_0x5645f9){var _0x1ce6cd=_0x3eb159?'closedinteraction':_0x5393('0x3e');var _0x30b00d=_0x26340a[_0x5393('0x34')]({'plain':!![]});_0x30b00d[_0x5393('0x23')]=_0x153e5c;_0x30b00d[_0x5393('0x24')]=_0x153e5c;_0x30b00d[_0x5393('0x25')]=_0x3eb159?_0x5393('0x3d'):_0x5393('0x3e');var _0x4bd9bb=_0x5393('0x29')+_0x30b00d[_0x5393('0x27')];return db[_0x5393('0x38')][_0x5393('0x3f')](_0x4bd9bb,{'type':db[_0x5393('0x2a')][_0x5393('0x2b')][_0x5393('0x2c')],'raw':!![]})['then'](function(_0x38f68b){if(_0x38f68b){_0x30b00d[_0x5393('0x2d')]=_0x38f68b[0x0];}if(typeof _0x30b00d[_0x5393('0x2e')]===_0x5393('0x28'))return;return getAgent(_0x30b00d[_0x5393('0x2e')]);})[_0x5393('0x1d')](function(_0x49d80f){if(_0x49d80f){_0x30b00d[_0x5393('0x2f')]=util[_0x5393('0x30')](_0x5393('0x31'),_0x49d80f[_0x5393('0x39')]);_0x30b00d[_0x5393('0x3a')]=_0x49d80f;}return request({'event':_0x1ce6cd,'message':_0x30b00d});})[_0x5393('0x22')](function(_0x211d33){logger[_0x5393('0x20')](_0x5393('0x1f'),_0x5393('0x40'),_0x211d33);});}};}function getAgent(_0x55a8eb){return db['User'][_0x5393('0x41')]({'where':{'id':_0x55a8eb},'attributes':['id',_0x5393('0x39'),_0x5393('0x42'),_0x5393('0x43'),_0x5393('0x44')],'raw':!![]})[_0x5393('0x1d')](function(_0x56132f){return _0x56132f;});}exports['default']=function(){for(var _0x4b47f0=0x0;_0x4b47f0=_0x453df0[_0x19dc('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x58fc2e(_0x333438);})[_0x19dc('0x16')](function(_0x297ace){_0x1ab90f(_0x297ace);});});}; \ No newline at end of file +var _0x99f6=['User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent'];(function(_0x25e3e2,_0x13bb2a){var _0x21b158=function(_0x2b5ac0){while(--_0x2b5ac0){_0x25e3e2['push'](_0x25e3e2['shift']());}};_0x21b158(++_0x13bb2a);}(_0x99f6,0x73));var _0x699f=function(_0x655ab,_0x3bf2e9){_0x655ab=_0x655ab-0x0;var _0x1c456a=_0x99f6[_0x655ab];return _0x1c456a;};'use strict';var _=require(_0x699f('0x0'));var BPromise=require(_0x699f('0x1'));var db=require(_0x699f('0x2'))['db'];var util=require(_0x699f('0x3'));var channels=[_0x699f('0x4'),'mail',_0x699f('0x5'),_0x699f('0x6'),_0x699f('0x7'),_0x699f('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x7246b1){_0x7246b1=_0x7246b1[_0x699f('0x9')]();return _['includes'](channels,_0x7246b1);};exports[_0x699f('0xa')]=function(_0x40d9b0,_0x154776,_0xf76cc0,_0x1ceab0){var _0x53f8e0={'loginAttempts':_0x154776,'blocked':_0xf76cc0};if(!_[_0x699f('0xb')](_0x1ceab0)){_0x53f8e0[_0x699f('0xc')]=_0x1ceab0;}return _0x40d9b0[_0x699f('0xd')](_0x53f8e0);};exports[_0x699f('0xe')]=function(_0x5e9a5d){return new BPromise(function(_0x2fd384,_0x184935){var _0x3cb955=0x0;if(_0x5e9a5d[_0x699f('0xf')]!==_0x699f('0x10')){_0x2fd384(_0x5e9a5d);}db[_0x699f('0x11')][_0x699f('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5e9a5d['id']}}})[_0x699f('0x13')](function(_0x503f33){_0x3cb955=_0x503f33;return util[_0x699f('0xe')]();})['then'](function(_0x2f208e){if(_0x2f208e&&_0x2f208e['agents']&&_0x3cb955>=_0x2f208e[_0x699f('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2fd384(_0x5e9a5d);})[_0x699f('0x15')](function(_0x5af2a6){_0x184935(_0x5af2a6);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index afa17da..5dcc428 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x502d4c,_0x27bcd2){_0x502d4c=_0x502d4c-0x0;var _0x2460ab=_0x9bde[_0x502d4c];return _0x2460ab;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x3e5845,_0xc189ea){var _0x299772=function(_0xcc2aa1){while(--_0xcc2aa1){_0x3e5845['push'](_0x3e5845['shift']());}};_0x299772(++_0xc189ea);}(_0x153f,0x15b));var _0xf153=function(_0x5959d8,_0x2c907d){_0x5959d8=_0x5959d8-0x0;var _0x227e66=_0x153f[_0x5959d8];return _0x227e66;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fb7aebc..a8fbdc0 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcc3=['json','send','exports','404','status','render'];(function(_0x31673a,_0x2f2e67){var _0x1b1387=function(_0x439143){while(--_0x439143){_0x31673a['push'](_0x31673a['shift']());}};_0x1b1387(++_0x2f2e67);}(_0xbcc3,0x86));var _0x3bcc=function(_0x426267,_0x422e6e){_0x426267=_0x426267-0x0;var _0x59e163=_0xbcc3[_0x426267];return _0x59e163;};'use strict';module[_0x3bcc('0x0')][0x194]=function pageNotFound(_0x2373a7,_0x1add42){var _0x546ab7=_0x3bcc('0x1');var _0x3bea7a=0x194;var _0x5f4c6b={'status':_0x3bea7a};_0x1add42[_0x3bcc('0x2')](_0x5f4c6b[_0x3bcc('0x2')]);_0x1add42[_0x3bcc('0x3')](_0x546ab7,{},function(_0x15dc7a,_0x120e57){if(_0x15dc7a){return _0x1add42[_0x3bcc('0x2')](_0x5f4c6b[_0x3bcc('0x2')])[_0x3bcc('0x4')](_0x5f4c6b);}_0x1add42[_0x3bcc('0x5')](_0x120e57);});}; \ No newline at end of file +var _0xca5a=['404','status','render','json','send'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xca5a,0x82));var _0xaca5=function(_0x431ff0,_0x5e192a){_0x431ff0=_0x431ff0-0x0;var _0x3aaadd=_0xca5a[_0x431ff0];return _0x3aaadd;};'use strict';module['exports'][0x194]=function pageNotFound(_0x219ca8,_0x4a75c0){var _0x403030=_0xaca5('0x0');var _0x3bd5ec=0x194;var _0x194278={'status':_0x3bd5ec};_0x4a75c0['status'](_0x194278[_0xaca5('0x1')]);_0x4a75c0[_0xaca5('0x2')](_0x403030,{},function(_0x108f2c,_0x5bce2b){if(_0x108f2c){return _0x4a75c0[_0xaca5('0x1')](_0x194278[_0xaca5('0x1')])[_0xaca5('0x3')](_0x194278);}_0x4a75c0[_0xaca5('0x4')](_0x5bce2b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 029e517..d5a617b 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe899=['VoiceQueues','UserVoiceQueue','MailQueues','ChatQueue','UserFaxQueue','SmsQueue','SmsQueues','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsite','ChatWebsites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','moh_has_sounds','VoiceQueueId','HopperBlacks','TrunkId','TrunkBackupId','IntervalId','Pause','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','ChatOfflineMessageId','TagId','ListId','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Interaction','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','UserOpenchannelQueue','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','Members','chat_group_has_users','Website','CompanyId','Phones','Hoppers','HopperHistories','FaxInteractions','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OwnerId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmHopperAdditionalPhone','Hopper','CmContactId','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','SalesforceAccount','SalesforceConfiguration','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','Field','DeskConfiguration','ZendeskField','ServicenowAccount','ServicenowField','FreshsalesConfiguration','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','FaxQueues','team_has_sms_queues','OpenchannelQueues','VoicePrefixes','TrunkBackup','SquareProject','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToUserId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','Extensions','userProfileId','UserProfileSections','UserProfileSection','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','User','UserId','hasOne','UserSetting','cascade','hasMany','Recordings','VoiceQueuesRt','CmHopperFinal','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','belongsTo','belongsToMany','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions'];(function(_0x59ea2c,_0x106c69){var _0xf25149=function(_0xc13aee){while(--_0xc13aee){_0x59ea2c['push'](_0x59ea2c['shift']());}};_0xf25149(++_0x106c69);}(_0xe899,0xda));var _0x9e89=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe899[_0x3e5086];return _0xfeb102;};'use strict';var config=require(_0x9e89('0x0'));var Sequelize=require(_0x9e89('0x1'));var _=require(_0x9e89('0x2'));var jstz=require('jstz');var timezone=jstz[_0x9e89('0x3')]();config['sequelize']=_[_0x9e89('0x4')](config[_0x9e89('0x1')],{'database':_0x9e89('0x5'),'username':_0x9e89('0x6'),'password':_0x9e89('0x7'),'options':{'host':_0x9e89('0x8'),'port':0xcea,'dialect':_0x9e89('0x9'),'dialectOptions':{'charset':_0x9e89('0xa')},'logging':![],'timezone':timezone[_0x9e89('0xb')](),'define':{'charset':_0x9e89('0xc'),'collate':_0x9e89('0xd')}}});config[_0x9e89('0xe')]=_['defaultsDeep'](config[_0x9e89('0xe')],{'database':'motion2','username':_0x9e89('0x6'),'password':_0x9e89('0x7'),'options':{'host':_0x9e89('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9e89('0xa')},'logging':![],'timezone':timezone[_0x9e89('0xb')](),'define':{'charset':'utf8','collate':_0x9e89('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x9e89('0xf')],config[_0x9e89('0x1')][_0x9e89('0x10')],config['sequelize'][_0x9e89('0x11')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9e89('0xe')]['database'],config[_0x9e89('0xe')]['username'],config[_0x9e89('0xe')][_0x9e89('0x11')],config[_0x9e89('0xe')][_0x9e89('0x12')])};db['User']=db[_0x9e89('0x1')]['import'](_0x9e89('0x13'));db[_0x9e89('0x14')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x16'));db['VoiceContext']=db['sequelize'][_0x9e89('0x15')]('../api/voiceContext/voiceContext.model');db[_0x9e89('0x17')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x18'));db[_0x9e89('0x19')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x1a'));db[_0x9e89('0x1b')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x1c'));db[_0x9e89('0x1d')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x1e'));db[_0x9e89('0x1f')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/screenRecording/screenRecording.model');db[_0x9e89('0x20')]=db['sequelize']['import'](_0x9e89('0x21'));db[_0x9e89('0x22')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x23'));db[_0x9e89('0x24')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x25'));db[_0x9e89('0x26')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x27'));db['VoiceAgentReport']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x28'));db['VoiceQueueReport']=db[_0x9e89('0x1')]['import'](_0x9e89('0x29'));db[_0x9e89('0x2a')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x2b'));db[_0x9e89('0x2c')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x2d'));db['VoiceTransferReport']=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x2e'));db[_0x9e89('0x2f')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x30'));db['UserVoiceQueue']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x9e89('0x31')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x32'));db[_0x9e89('0x33')]=db['sequelize']['import'](_0x9e89('0x34'));db['UserFaxQueue']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x35'));db[_0x9e89('0x36')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x37'));db['UserWhatsappQueue']=db[_0x9e89('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x9e89('0x38')]=db['sequelize'][_0x9e89('0x15')]('../api/mailServerIn/mailServerIn.model');db[_0x9e89('0x39')]=db['sequelize']['import'](_0x9e89('0x3a'));db[_0x9e89('0x3b')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x3c'));db[_0x9e89('0x3d')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x3e'));db[_0x9e89('0x3f')]=db['sequelize'][_0x9e89('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0x9e89('0x40')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x41'));db[_0x9e89('0x42')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x43'));db['MailApplication']=db[_0x9e89('0x1')]['import'](_0x9e89('0x44'));db[_0x9e89('0x45')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x46'));db[_0x9e89('0x47')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x48'));db[_0x9e89('0x49')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0x9e89('0x4a')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x4b'));db[_0x9e89('0x4c')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x4d'));db['FaxInteraction']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/faxInteraction/faxInteraction.model');db[_0x9e89('0x4e')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x4f'));db[_0x9e89('0x50')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x51'));db[_0x9e89('0x52')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x53'));db[_0x9e89('0x54')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/smsAccount/smsAccount.model');db[_0x9e89('0x55')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x56'));db[_0x9e89('0x57')]=db['sequelize'][_0x9e89('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0x9e89('0x58')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x9e89('0x1')]['import'](_0x9e89('0x59'));db[_0x9e89('0x5a')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x5b'));db[_0x9e89('0x5c')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0x9e89('0x5d')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x5e'));db[_0x9e89('0x5f')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0x9e89('0x60')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x61'));db['ChatWebsite']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0x9e89('0x62')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x63'));db[_0x9e89('0x64')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x9e89('0x1')]['import'](_0x9e89('0x65'));db[_0x9e89('0x66')]=db['sequelize']['import'](_0x9e89('0x67'));db[_0x9e89('0x68')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x69'));db['ChatQueue']=db['sequelize']['import'](_0x9e89('0x6a'));db[_0x9e89('0x6b')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/chatGroup/chatGroup.model');db[_0x9e89('0x6c')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x6d'));db[_0x9e89('0x6e')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/cmCompany/cmCompany.model');db[_0x9e89('0x6f')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x70'));db[_0x9e89('0x71')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x72'));db[_0x9e89('0x73')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x74'));db['CmHopperFinal']=db[_0x9e89('0x1')]['import'](_0x9e89('0x75'));db['CmHopperHistory']=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x76'));db[_0x9e89('0x77')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x78'));db[_0x9e89('0x79')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x7a'));db[_0x9e89('0x7b')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x7c'));db[_0x9e89('0x7d')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x7e'));db[_0x9e89('0x7f')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x80'));db['Disposition']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x81'));db[_0x9e89('0x82')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/condition/condition.model');db[_0x9e89('0x83')]=db['sequelize']['import'](_0x9e89('0x84'));db['Pause']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x85'));db['Cdr']=db[_0x9e89('0x1')]['import'](_0x9e89('0x86'));db[_0x9e89('0x87')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x88'));db[_0x9e89('0x89')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x8a'));db[_0x9e89('0x8b')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/sound/sound.model');db[_0x9e89('0x8c')]=db[_0x9e89('0x1')]['import']('../api/tag/tag.model');db[_0x9e89('0x8d')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x8e'));db[_0x9e89('0x8f')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x90'));db['CmHopperAdditionalPhone']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x91'));db[_0x9e89('0x92')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/template/template.model');db['Trigger']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x93'));db['Variable']=db[_0x9e89('0x1')]['import']('../api/variable/variable.model');db[_0x9e89('0x94')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x95'));db[_0x9e89('0x96')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x97'));db[_0x9e89('0x98')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x99'));db[_0x9e89('0x9a')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x9b'));db['AnalyticExtractedReport']=db[_0x9e89('0x1')]['import'](_0x9e89('0x9c'));db['AnalyticMetric']=db['sequelize']['import'](_0x9e89('0x9d'));db['AnalyticFieldReport']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x9e'));db['AnalyticTreeReport']=db[_0x9e89('0x1')]['import'](_0x9e89('0x9f'));db['SalesforceAccount']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xa0'));db['SalesforceConfiguration']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xa1'));db[_0x9e89('0xa2')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xa3'));db[_0x9e89('0xa4')]=db[_0x9e89('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x9e89('0x1')]['import'](_0x9e89('0xa5'));db[_0x9e89('0xa6')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xa7'));db['DeskConfiguration']=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xa8'));db[_0x9e89('0xa9')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/intDeskField/intDeskField.model');db[_0x9e89('0xaa')]=db[_0x9e89('0x1')]['import'](_0x9e89('0xab'));db[_0x9e89('0xac')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xad'));db[_0x9e89('0xae')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/intZohoField/intZohoField.model');db[_0x9e89('0xaf')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xb0'));db[_0x9e89('0xb1')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xb2'));db['ZendeskField']=db[_0x9e89('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x9e89('0xb3')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xb4'));db[_0x9e89('0xb5')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xb6'));db[_0x9e89('0xb7')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xb8'));db[_0x9e89('0xb9')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xba'));db[_0x9e89('0xbb')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xbc'));db[_0x9e89('0xbd')]=db['sequelize'][_0x9e89('0x15')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xbe'));db[_0x9e89('0xbf')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xc0'));db['ServicenowField']=db[_0x9e89('0x1')]['import'](_0x9e89('0xc1'));db[_0x9e89('0xc2')]=db['sequelize']['import'](_0x9e89('0xc3'));db[_0x9e89('0xc4')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xc5'));db[_0x9e89('0xc6')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xc7'));db['FreshsalesAccount']=db[_0x9e89('0x1')]['import'](_0x9e89('0xc8'));db['FreshsalesConfiguration']=db[_0x9e89('0x1')]['import'](_0x9e89('0xc9'));db[_0x9e89('0xca')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xcb'));db[_0x9e89('0x94')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0x95'));db[_0x9e89('0xcc')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xcd'));db[_0x9e89('0xce')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xcf'));db[_0x9e89('0xd0')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9e89('0xd1')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xd2'));db[_0x9e89('0xd3')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xd4'));db[_0x9e89('0xd5')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xd6'));db[_0x9e89('0xd7')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xd8'));db['SquareReport']=db[_0x9e89('0x1')]['import'](_0x9e89('0xd9'));db[_0x9e89('0xda')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xdb'));db[_0x9e89('0xdc')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/setting/setting.model');db[_0x9e89('0xdd')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xde'));db['SquareProject']=db['sequelize'][_0x9e89('0x15')]('../api/squareProject/squareProject.model');db[_0x9e89('0xdf')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xe0'));db[_0x9e89('0xe1')]=db[_0x9e89('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0x9e89('0xe2')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xe3'));db[_0x9e89('0xe4')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xe5'));db['Campaign']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xe6'));db[_0x9e89('0xe7')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xe8'));db['Attachment']=db[_0x9e89('0x1')]['import'](_0x9e89('0xe9'));db[_0x9e89('0xea')]=db[_0x9e89('0x1')]['import'](_0x9e89('0xeb'));db[_0x9e89('0xec')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xed'));db['ChatTransferReport']=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0x9e89('0xee')]=db[_0x9e89('0x1')]['import'](_0x9e89('0xef'));db[_0x9e89('0xf0')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x9e89('0xf1')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xf2'));db[_0x9e89('0xf3')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xf4'));db[_0x9e89('0xf5')]=db['sequelize'][_0x9e89('0x15')](_0x9e89('0xf6'));db[_0x9e89('0xf7')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xf8'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0xf9'));db[_0x9e89('0xfa')]=db[_0x9e89('0x1')]['import'](_0x9e89('0xfb'));db[_0x9e89('0xfc')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/whatsappAccount/whatsappAccount.model');db[_0x9e89('0xfd')]=db[_0x9e89('0x1')]['import'](_0x9e89('0xfe'));db[_0x9e89('0xff')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x100'));db[_0x9e89('0x101')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x102'));db[_0x9e89('0x103')]=db['sequelize']['import'](_0x9e89('0x104'));db[_0x9e89('0x105')]=db['sequelize'][_0x9e89('0x15')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0x9e89('0x1')]['import'](_0x9e89('0x106'));db[_0x9e89('0x107')]=db[_0x9e89('0x1')][_0x9e89('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x9e89('0x108')]=db[_0x9e89('0x1')]['import'](_0x9e89('0x109'));db[_0x9e89('0x10a')]=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x10b'));db['UserSetting']=db[_0x9e89('0x1')][_0x9e89('0x15')](_0x9e89('0x10c'));db[_0x9e89('0x10d')]['hasOne'](db[_0x9e89('0x20')],{'as':_0x9e89('0x20'),'onDelete':'cascade','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x10f')](db[_0x9e89('0x110')],{'as':'userSetting','onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x10e')});db['User'][_0x9e89('0x112')](db[_0x9e89('0x1d')],{'as':_0x9e89('0x113'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x2f')],{'as':_0x9e89('0x114'),'foreignKey':'UserId'});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x17')],{'as':'Extensions','onDelete':_0x9e89('0x111'),'hooks':!![]});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x115')],{'as':_0x9e89('0x116'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x117')],{'as':'HopperHistory','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x5d')],{'as':_0x9e89('0x118'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x119')],{'as':'ChatInteractions','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db['SmsInteraction'],{'as':_0x9e89('0x11a'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')]['hasMany'](db[_0x9e89('0x11b')],{'as':'FaxInteractions','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0x40')],{'as':_0x9e89('0x11c'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x10d')][_0x9e89('0x112')](db[_0x9e89('0xff')],{'as':_0x9e89('0x11d'),'foreignKey':_0x9e89('0x10e')});db['User'][_0x9e89('0x112')](db[_0x9e89('0xfa')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x9e89('0x10d')][_0x9e89('0x11e')](db[_0x9e89('0xf7')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x9e89('0x10d')]['belongsToMany'](db[_0x9e89('0x6b')],{'as':'Groups','through':'chat_group_has_users'});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x6f')],{'as':'Contacts','through':_0x9e89('0x120')});db[_0x9e89('0x10d')]['belongsToMany'](db[_0x9e89('0xf3')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x9e89('0x10d')]['belongsToMany'](db[_0x9e89('0xe2')],{'through':_0x9e89('0x121')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x40')],{'as':_0x9e89('0x11c'),'through':_0x9e89('0x122')});db['User']['belongsToMany'](db['ChatInteraction'],{'as':_0x9e89('0x123'),'through':_0x9e89('0x124')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x11b')],{'as':'FaxInteractions','through':_0x9e89('0x125')});db[_0x9e89('0x10d')]['belongsToMany'](db['SmsInteraction'],{'as':_0x9e89('0x11a'),'through':_0x9e89('0x126')});db['User']['belongsToMany'](db[_0x9e89('0x5d')],{'as':'OpenchannelInteractions','through':_0x9e89('0x127')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0xff')],{'as':'WhatsappInteractions','through':_0x9e89('0x128')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x1b')],{'as':_0x9e89('0x129'),'through':_0x9e89('0x12a'),'required':![]});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0xf5')],{'as':'VoicePrefixes','through':_0x9e89('0x10a'),'required':![]});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x3d')],{'as':_0x9e89('0x12b'),'through':_0x9e89('0x33'),'required':![]});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x12c')],{'as':'ChatQueues','through':_0x9e89('0x31'),'required':![],'hooks':!![]});db['User'][_0x9e89('0x11f')](db['FaxQueue'],{'as':'FaxQueues','through':_0x9e89('0x12d'),'required':![]});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x12e')],{'as':_0x9e89('0x12f'),'through':_0x9e89('0x36'),'required':![]});db['User'][_0x9e89('0x11f')](db[_0x9e89('0x60')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db['User'][_0x9e89('0x11f')](db[_0x9e89('0x105')],{'as':_0x9e89('0x130'),'through':_0x9e89('0x131'),'required':![]});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0xf3')],{'through':_0x9e89('0x132')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x133')],{'as':_0x9e89('0x134'),'through':'user_has_chat_websites'});db['User'][_0x9e89('0x11f')](db[_0x9e89('0x4a')],{'as':_0x9e89('0x135'),'through':'user_has_fax_accounts'});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0x3b')],{'as':'MailAccounts','through':_0x9e89('0x136')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db['OpenchannelAccount'],{'as':_0x9e89('0x137'),'through':_0x9e89('0x138')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db['SmsAccount'],{'as':_0x9e89('0x139'),'through':_0x9e89('0x13a')});db[_0x9e89('0x10d')][_0x9e89('0x11f')](db[_0x9e89('0xfc')],{'as':_0x9e89('0x13b'),'through':'user_has_whatsapp_accounts'});db[_0x9e89('0x14')][_0x9e89('0x112')](db[_0x9e89('0x17')],{'as':_0x9e89('0x13c'),'onDelete':'cascade','foreignKey':_0x9e89('0x13d')});db[_0x9e89('0x13e')]['hasMany'](db[_0x9e89('0x17')],{'onDelete':_0x9e89('0x111')});db[_0x9e89('0x17')]['hasMany'](db['VoiceExtension'],{'as':_0x9e89('0x13f'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x19')]['belongsToMany'](db[_0x9e89('0x8b')],{'as':'Sounds','through':_0x9e89('0x140')});db[_0x9e89('0x1b')]['hasMany'](db[_0x9e89('0x2f')],{'as':'Members','foreignKey':_0x9e89('0x141')});db[_0x9e89('0x1b')][_0x9e89('0x112')](db[_0x9e89('0x71')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x9e89('0x1b')]['hasMany'](db[_0x9e89('0x115')],{'as':_0x9e89('0x116'),'foreignKey':_0x9e89('0x141')});db[_0x9e89('0x1b')]['hasMany'](db[_0x9e89('0x117')],{'as':'HopperHistories','foreignKey':_0x9e89('0x141')});db[_0x9e89('0x1b')][_0x9e89('0x112')](db[_0x9e89('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x9e89('0x141')});db[_0x9e89('0x1b')][_0x9e89('0x112')](db['CmHopperBlack'],{'as':_0x9e89('0x142'),'foreignKey':_0x9e89('0x141')});db[_0x9e89('0x1b')][_0x9e89('0x112')](db[_0x9e89('0xd5')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0x9e89('0x1b')][_0x9e89('0x11e')](db[_0x9e89('0x2c')],{'as':_0x9e89('0x2c'),'foreignKey':_0x9e89('0x143')});db[_0x9e89('0x1b')][_0x9e89('0x11e')](db[_0x9e89('0x2c')],{'as':'TrunkBackup','foreignKey':_0x9e89('0x144')});db[_0x9e89('0x1b')][_0x9e89('0x11e')](db[_0x9e89('0x83')],{'as':_0x9e89('0x83'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x1b')][_0x9e89('0x11e')](db[_0x9e89('0x146')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x9e89('0x1b')][_0x9e89('0x11f')](db[_0x9e89('0xf3')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0x9e89('0x11f')](db['Team'],{'as':_0x9e89('0x147'),'through':_0x9e89('0x107')});db[_0x9e89('0x1b')][_0x9e89('0x11f')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x148'),'through':_0x9e89('0x149')});db['VoiceRecording'][_0x9e89('0x11e')](db['User'],{'as':_0x9e89('0x10d'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x1f')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':'User','foreignKey':_0x9e89('0x10e')});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':_0x9e89('0x14a'),'onDelete':'cascade','foreignKey':_0x9e89('0x14b'),'sourceKey':_0x9e89('0x14c')});db[_0x9e89('0x22')]['belongsTo'](db[_0x9e89('0x20')],{'foreignKey':_0x9e89('0x14b'),'targetKey':_0x9e89('0x14c')});db[_0x9e89('0x24')]['hasMany'](db[_0x9e89('0x14d')],{'as':_0x9e89('0x14e'),'foreignKey':_0x9e89('0x14f'),'constraints':![]});db[_0x9e89('0x24')]['hasMany'](db[_0x9e89('0x150')],{'as':_0x9e89('0x151'),'foreignKey':'uniqueid','constraints':![]});db[_0x9e89('0x24')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x10d'),'foreignKey':'UserId'});db[_0x9e89('0x24')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152')});db[_0x9e89('0x38')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{'as':_0x9e89('0x3b'),'foreignKey':_0x9e89('0x153')});db[_0x9e89('0x38')][_0x9e89('0x11e')](db[_0x9e89('0x154')],{'as':_0x9e89('0x154'),'foreignKey':_0x9e89('0x155'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x39')]['belongsTo'](db[_0x9e89('0x3b')],{'as':_0x9e89('0x3b'),'foreignKey':_0x9e89('0x153')});db[_0x9e89('0x39')][_0x9e89('0x11e')](db[_0x9e89('0x154')],{'as':_0x9e89('0x154'),'foreignKey':_0x9e89('0x155'),'onDelete':_0x9e89('0x156')});db['MailAccount']['hasOne'](db[_0x9e89('0x38')],{'as':_0x9e89('0x157'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x3b')]['hasOne'](db[_0x9e89('0x39')],{'as':_0x9e89('0x158'),'onDelete':_0x9e89('0x111')});db['MailAccount'][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x153'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x3b')][_0x9e89('0x112')](db[_0x9e89('0x7f')],{'as':_0x9e89('0x15b'),'foreignKey':_0x9e89('0x153')});db['MailAccount']['hasMany'](db['MailMessage'],{'as':'Messages','foreignKey':_0x9e89('0x153')});db[_0x9e89('0x3b')][_0x9e89('0x112')](db['MailInteraction'],{'as':_0x9e89('0x15c')});db[_0x9e89('0x3b')]['hasMany'](db[_0x9e89('0x15d')],{'as':_0x9e89('0x13f')});db[_0x9e89('0x3b')][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':'ListId'});db['MailAccount']['belongsTo'](db['Template'],{'as':_0x9e89('0x92'),'foreignKey':_0x9e89('0x15f')});db['MailAccount'][_0x9e89('0x11e')](db['Pause'],{'as':_0x9e89('0x160'),'foreignKey':_0x9e89('0x161')});db[_0x9e89('0x3b')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':'Agents','through':_0x9e89('0x136')});db[_0x9e89('0x3d')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':'UserMailQueue'});db[_0x9e89('0x3d')][_0x9e89('0x11f')](db['Team'],{'through':_0x9e89('0x163'),'as':_0x9e89('0x147')});db[_0x9e89('0x40')]['hasMany'](db[_0x9e89('0x42')],{'as':_0x9e89('0x14a'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x164')});db[_0x9e89('0x40')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x153')});db['MailInteraction'][_0x9e89('0x11e')](db['CmContact'],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x40')]['belongsTo'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x167'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x40')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':_0x9e89('0x168'),'as':_0x9e89('0x169')});db[_0x9e89('0x40')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db['MailInteraction'][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x16a'),'through':'user_has_mail_interactions','foreignKey':_0x9e89('0x164')});db[_0x9e89('0x42')]['hasMany'](db[_0x9e89('0x16b')],{'as':_0x9e89('0x16c'),'onDelete':_0x9e89('0x111')});db['MailMessage'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x10d')});db[_0x9e89('0x42')]['belongsTo'](db[_0x9e89('0x6f')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x166')});db[_0x9e89('0x42')][_0x9e89('0x11e')](db[_0x9e89('0x40')],{'as':'Interaction','foreignKey':_0x9e89('0x164')});db[_0x9e89('0x42')]['belongsTo'](db['MailAccount'],{'as':_0x9e89('0x165'),'foreignKey':'MailAccountId'});db[_0x9e89('0x42')]['belongsTo'](db[_0x9e89('0x133')],{'as':_0x9e89('0x133'),'foreignKey':'ChatWebsiteId'});db[_0x9e89('0x42')][_0x9e89('0x11e')](db['ChatOfflineMessage'],{'as':_0x9e89('0x68'),'foreignKey':_0x9e89('0x16d')});db[_0x9e89('0x15d')][_0x9e89('0x11e')](db['User'],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db['MailQueue'],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x15d')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x15d')][_0x9e89('0x11e')](db['Interval'],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x145')});db['MailApplication']['belongsTo'](db[_0x9e89('0x8c')],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x16e')});db['MailQueueReport'][_0x9e89('0x11e')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x45')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152')});db['MailQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0x40')],{});db[_0x9e89('0x45')][_0x9e89('0x11e')](db['MailMessage'],{});db['MailQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{});db[_0x9e89('0x45')]['belongsTo'](db[_0x9e89('0x3d')],{});db[_0x9e89('0x47')][_0x9e89('0x112')](db[_0x9e89('0x49')],{'as':_0x9e89('0x170'),'onDelete':'cascade'});db[_0x9e89('0x4a')][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x171'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x9e89('0x15b'),'foreignKey':_0x9e89('0x171')});db[_0x9e89('0x4a')][_0x9e89('0x112')](db[_0x9e89('0x11b')],{'as':_0x9e89('0x15c')});db['FaxAccount'][_0x9e89('0x112')](db[_0x9e89('0x4c')],{'as':_0x9e89('0x13f')});db[_0x9e89('0x4a')][_0x9e89('0x112')](db['VoiceExtension'],{'as':_0x9e89('0x172'),'onDelete':'cascade'});db[_0x9e89('0x4a')]['hasMany'](db[_0x9e89('0x4e')],{'as':'Messages'});db[_0x9e89('0x4a')][_0x9e89('0x11e')](db[_0x9e89('0x2c')],{'as':'Trunk'});db[_0x9e89('0x4a')][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x4a')][_0x9e89('0x11e')](db[_0x9e89('0x146')],{'as':_0x9e89('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9e89('0x4a')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x173')});db[_0x9e89('0x4c')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x4c')]['belongsTo'](db[_0x9e89('0x50')],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x4c')]['belongsTo'](db[_0x9e89('0x4a')],{'onDelete':_0x9e89('0x156')});db['FaxApplication'][_0x9e89('0x11e')](db[_0x9e89('0x8c')],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x16e')});db[_0x9e89('0x11b')][_0x9e89('0x112')](db['FaxMessage'],{'as':_0x9e89('0x14a'),'onDelete':'cascade','foreignKey':_0x9e89('0x174')});db[_0x9e89('0x11b')]['belongsTo'](db['FaxAccount'],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x171')});db[_0x9e89('0x11b')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db['FaxInteraction'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':'Owner','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x11b')][_0x9e89('0x11f')](db['Tag'],{'through':_0x9e89('0x175'),'as':_0x9e89('0x169')});db[_0x9e89('0x11b')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':_0x9e89('0x175'),'as':_0x9e89('0x176')});db[_0x9e89('0x11b')]['belongsToMany'](db['User'],{'as':_0x9e89('0x16a'),'through':_0x9e89('0x125'),'foreignKey':_0x9e89('0x174')});db['FaxMessage'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'onDelete':'cascade','as':_0x9e89('0x10d')});db[_0x9e89('0x4e')]['belongsTo'](db[_0x9e89('0x11b')],{'as':_0x9e89('0x177'),'foreignKey':_0x9e89('0x174')});db[_0x9e89('0x4e')][_0x9e89('0x11e')](db['CmContact'],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x166')});db[_0x9e89('0x4e')][_0x9e89('0x11e')](db['Attachment'],{'as':_0x9e89('0x16b'),'foreignKey':_0x9e89('0x178')});db['FaxMessage'][_0x9e89('0x11e')](db[_0x9e89('0x4a')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x171')});db[_0x9e89('0x50')]['belongsToMany'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x12d')});db[_0x9e89('0x50')][_0x9e89('0x11f')](db[_0x9e89('0xe2')],{'through':'team_has_fax_queues','as':_0x9e89('0x147')});db[_0x9e89('0x52')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x52')]['belongsTo'](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db['FaxQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0x11b')],{});db[_0x9e89('0x52')]['belongsTo'](db[_0x9e89('0x4e')],{});db[_0x9e89('0x52')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{});db['FaxQueueReport']['belongsTo'](db[_0x9e89('0x50')],{});db[_0x9e89('0x54')][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x179'),'onDelete':'cascade'});db[_0x9e89('0x54')][_0x9e89('0x112')](db[_0x9e89('0x7f')],{'as':_0x9e89('0x15b'),'foreignKey':_0x9e89('0x179')});db[_0x9e89('0x54')][_0x9e89('0x112')](db[_0x9e89('0x58')],{'as':_0x9e89('0x14a'),'foreignKey':_0x9e89('0x179')});db[_0x9e89('0x54')][_0x9e89('0x112')](db[_0x9e89('0x57')],{'as':'Interactions'});db[_0x9e89('0x54')]['hasMany'](db[_0x9e89('0x55')],{'as':'Applications'});db['SmsAccount'][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x54')][_0x9e89('0x11e')](db[_0x9e89('0x146')],{'as':_0x9e89('0x160'),'foreignKey':_0x9e89('0x161')});db[_0x9e89('0x54')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x13a')});db[_0x9e89('0x55')][_0x9e89('0x11e')](db['User'],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x55')]['belongsTo'](db['SmsQueue'],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0x55')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db[_0x9e89('0x55')][_0x9e89('0x11e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x9e89('0x145')});db[_0x9e89('0x55')][_0x9e89('0x11e')](db['Tag'],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x16e')});db[_0x9e89('0x57')][_0x9e89('0x112')](db['SmsMessage'],{'as':_0x9e89('0x14a'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x17a')});db[_0x9e89('0x57')]['belongsTo'](db[_0x9e89('0x54')],{'as':'Account','foreignKey':_0x9e89('0x179')});db[_0x9e89('0x57')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x57')]['belongsTo'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x167'),'foreignKey':_0x9e89('0x10e')});db['SmsInteraction']['belongsToMany'](db[_0x9e89('0x8c')],{'through':_0x9e89('0x17b'),'as':_0x9e89('0x169')});db['SmsInteraction'][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':_0x9e89('0x17b'),'as':'ThroughTags'});db[_0x9e89('0x57')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x16a'),'through':'user_has_sms_interactions','foreignKey':_0x9e89('0x17a')});db[_0x9e89('0x58')][_0x9e89('0x11e')](db['User'],{'as':_0x9e89('0x10d')});db[_0x9e89('0x58')][_0x9e89('0x11e')](db['CmContact'],{'onDelete':_0x9e89('0x111'),'as':'Contact'});db['SmsMessage'][_0x9e89('0x11e')](db[_0x9e89('0x57')],{'onDelete':_0x9e89('0x111'),'as':'Interaction','foreignKey':_0x9e89('0x17a')});db[_0x9e89('0x58')]['belongsTo'](db['SmsAccount'],{'as':_0x9e89('0x165'),'foreignKey':'SmsAccountId'});db[_0x9e89('0x12e')][_0x9e89('0x11f')](db['User'],{'as':'Agents','through':_0x9e89('0x36'),'foreignKey':'SmsQueueId'});db[_0x9e89('0x12e')][_0x9e89('0x11f')](db[_0x9e89('0xe2')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x9e89('0x5a')]['hasMany'](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x17c'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x5a')][_0x9e89('0x112')](db['CannedAnswer'],{'as':_0x9e89('0x15b'),'foreignKey':_0x9e89('0x17c')});db['OpenchannelAccount'][_0x9e89('0x112')](db[_0x9e89('0x5d')],{'as':'Interactions','foreignKey':_0x9e89('0x17c')});db[_0x9e89('0x5a')][_0x9e89('0x112')](db[_0x9e89('0x5f')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x9e89('0x5a')][_0x9e89('0x112')](db[_0x9e89('0x5c')],{'as':_0x9e89('0x13f'),'foreignKey':_0x9e89('0x17c')});db['OpenchannelAccount'][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':'ListId'});db[_0x9e89('0x5a')][_0x9e89('0x11e')](db['Pause'],{'as':_0x9e89('0x160'),'foreignKey':_0x9e89('0x161')});db[_0x9e89('0x5a')][_0x9e89('0x11f')](db['User'],{'as':'Agents','through':_0x9e89('0x138')});db[_0x9e89('0x5c')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x156')});db['OpenchannelApplication'][_0x9e89('0x11e')](db[_0x9e89('0x60')],{'onDelete':'restrict','foreignKey':_0x9e89('0x17d')});db['OpenchannelApplication']['belongsTo'](db[_0x9e89('0x5a')],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x17c')});db[_0x9e89('0x5c')][_0x9e89('0x11e')](db[_0x9e89('0x83')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x9e89('0x5c')][_0x9e89('0x11e')](db['Tag'],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x16e')});db[_0x9e89('0x5d')][_0x9e89('0x112')](db[_0x9e89('0x5f')],{'as':_0x9e89('0x14a'),'onDelete':'cascade','foreignKey':_0x9e89('0x17e')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x17c')});db[_0x9e89('0x5d')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152')});db[_0x9e89('0x5d')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x167'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x9e89('0x169')});db[_0x9e89('0x5d')]['belongsToMany'](db[_0x9e89('0x8c')],{'through':_0x9e89('0x17f'),'as':_0x9e89('0x176')});db[_0x9e89('0x5d')][_0x9e89('0x11f')](db['User'],{'as':_0x9e89('0x16a'),'through':_0x9e89('0x127'),'foreignKey':_0x9e89('0x17e')});db[_0x9e89('0x5f')]['belongsTo'](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x10d')});db[_0x9e89('0x5f')]['belongsTo'](db[_0x9e89('0x6f')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x166')});db[_0x9e89('0x5f')][_0x9e89('0x11e')](db[_0x9e89('0x5d')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x9e89('0x17e')});db[_0x9e89('0x5f')][_0x9e89('0x11e')](db[_0x9e89('0x16b')],{'as':_0x9e89('0x16b'),'foreignKey':_0x9e89('0x178')});db['OpenchannelMessage'][_0x9e89('0x11e')](db[_0x9e89('0x5a')],{'as':_0x9e89('0x165'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x180'),'foreignKey':_0x9e89('0x17d')});db[_0x9e89('0x60')][_0x9e89('0x11f')](db[_0x9e89('0xe2')],{'through':_0x9e89('0x181'),'as':'Teams'});db['ChatWebsite'][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x182'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x133')][_0x9e89('0x112')](db[_0x9e89('0x7f')],{'as':'Answers','foreignKey':_0x9e89('0x182')});db['ChatWebsite'][_0x9e89('0x112')](db['ChatProactiveAction'],{'as':_0x9e89('0x183')});db[_0x9e89('0x133')][_0x9e89('0x112')](db[_0x9e89('0x119')],{'as':_0x9e89('0x15c')});db[_0x9e89('0x133')]['hasMany'](db[_0x9e89('0x64')],{'as':_0x9e89('0x13f')});db[_0x9e89('0x133')][_0x9e89('0x112')](db[_0x9e89('0x66')],{'as':_0x9e89('0x14a')});db[_0x9e89('0x133')][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':'List','foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x133')][_0x9e89('0x11e')](db[_0x9e89('0x83')],{'as':_0x9e89('0x83'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x133')][_0x9e89('0x11e')](db['MailAccount'],{'as':_0x9e89('0x3b'),'foreignKey':_0x9e89('0x153')});db[_0x9e89('0x133')][_0x9e89('0x11e')](db['Pause'],{'as':_0x9e89('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9e89('0x133')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':'Agents','through':_0x9e89('0x184')});db[_0x9e89('0x62')][_0x9e89('0x11e')](db[_0x9e89('0x5a')],{});db[_0x9e89('0x62')][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':'List','foreignKey':'ListId'});db[_0x9e89('0x62')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x62')][_0x9e89('0x11e')](db[_0x9e89('0x5d')],{});db[_0x9e89('0x62')]['belongsTo'](db[_0x9e89('0x5f')],{});db[_0x9e89('0x62')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{});db[_0x9e89('0x62')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x9e89('0x64')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x185'),'foreignKey':'UserId','onDelete':_0x9e89('0x156')});db[_0x9e89('0x64')]['belongsTo'](db['ChatQueue'],{'as':_0x9e89('0x186'),'foreignKey':_0x9e89('0x187'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x64')]['belongsTo'](db[_0x9e89('0x133')],{'as':'Website','foreignKey':_0x9e89('0x182'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x64')][_0x9e89('0x11e')](db[_0x9e89('0x8c')],{'onDelete':_0x9e89('0x156'),'foreignKey':'TagId'});db[_0x9e89('0x119')][_0x9e89('0x112')](db[_0x9e89('0x66')],{'as':_0x9e89('0x14a'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x188')});db[_0x9e89('0x119')][_0x9e89('0x11e')](db[_0x9e89('0x133')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x182')});db[_0x9e89('0x119')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':'ContactId'});db[_0x9e89('0x119')]['belongsTo'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x167'),'foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x119')]['belongsToMany'](db[_0x9e89('0x8c')],{'through':_0x9e89('0x189'),'as':'Tags'});db[_0x9e89('0x119')]['belongsToMany'](db[_0x9e89('0x8c')],{'through':'chat_interaction_has_tags','as':_0x9e89('0x176')});db[_0x9e89('0x119')]['belongsToMany'](db['User'],{'as':'Users','through':_0x9e89('0x124'),'foreignKey':_0x9e89('0x188')});db['ChatMessage']['belongsTo'](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x10d')});db['ChatMessage'][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'onDelete':_0x9e89('0x111'),'as':'Contact','foreignKey':_0x9e89('0x152')});db['ChatMessage'][_0x9e89('0x11e')](db[_0x9e89('0x119')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x177'),'foreignKey':_0x9e89('0x188')});db[_0x9e89('0x66')][_0x9e89('0x11e')](db[_0x9e89('0x16b')],{'as':_0x9e89('0x16b'),'foreignKey':_0x9e89('0x178')});db[_0x9e89('0x66')][_0x9e89('0x11e')](db[_0x9e89('0x133')],{'as':'Account','foreignKey':_0x9e89('0x182')});db['ChatOfflineMessage']['hasMany'](db[_0x9e89('0x16b')],{'as':'Attachments','foreignKey':_0x9e89('0x16d'),'onDelete':_0x9e89('0x111'),'hooks':!![]});db['ChatOfflineMessage'][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'onDelete':_0x9e89('0x111'),'as':'Contact','foreignKey':_0x9e89('0x152')});db['ChatOfflineMessage']['belongsTo'](db[_0x9e89('0x133')],{'as':_0x9e89('0x165'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x9e89('0x11f')](db['User'],{'as':_0x9e89('0x162'),'through':_0x9e89('0x31'),'hooks':!![]});db[_0x9e89('0x12c')]['belongsToMany'](db[_0x9e89('0xe2')],{'through':_0x9e89('0x18a'),'as':'Teams'});db[_0x9e89('0x6b')][_0x9e89('0x112')](db['ChatInternalMessage'],{'as':_0x9e89('0x14a'),'foreignKey':'ChatGroupId','onDelete':_0x9e89('0x111')});db[_0x9e89('0x6b')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x18b'),'through':_0x9e89('0x18c')});db[_0x9e89('0x6c')][_0x9e89('0x11e')](db[_0x9e89('0x133')],{'as':_0x9e89('0x18d'),'foreignKey':_0x9e89('0x182')});db[_0x9e89('0x6e')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':_0x9e89('0x18e')});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x8f')],{'as':_0x9e89('0x18f'),'foreignKey':'CmContactId'});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x71')],{'as':_0x9e89('0x190'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x115')],{'as':_0x9e89('0x116'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x6f')]['hasMany'](db['CmHopperHistory'],{'as':_0x9e89('0x191'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x77')],{'as':_0x9e89('0x77'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0xd5')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x5d')],{'as':_0x9e89('0x118'),'foreignKey':_0x9e89('0x152'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x119')],{'as':_0x9e89('0x123'),'foreignKey':_0x9e89('0x152'),'onDelete':'restrict'});db['CmContact'][_0x9e89('0x112')](db[_0x9e89('0x57')],{'as':_0x9e89('0x11a'),'foreignKey':_0x9e89('0x152'),'onDelete':_0x9e89('0x156')});db['CmContact']['hasMany'](db[_0x9e89('0x11b')],{'as':_0x9e89('0x192'),'foreignKey':_0x9e89('0x152'),'onDelete':'restrict'});db[_0x9e89('0x6f')][_0x9e89('0x112')](db[_0x9e89('0x40')],{'as':'MailInteractions','foreignKey':_0x9e89('0x152'),'onDelete':_0x9e89('0x156')});db['CmContact'][_0x9e89('0x11e')](db[_0x9e89('0x6e')],{'as':_0x9e89('0x193'),'foreignKey':_0x9e89('0x18e')});db[_0x9e89('0x6f')][_0x9e89('0x11e')](db['CmList'],{'as':_0x9e89('0x15e'),'foreignKey':'ListId','onDelete':_0x9e89('0x111')});db[_0x9e89('0x6f')]['belongsToMany'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x16a'),'through':_0x9e89('0x120')});db['CmContact'][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'as':_0x9e89('0x169'),'through':_0x9e89('0x194')});db['CmContact'][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'cm_contact_has_tags','as':_0x9e89('0x176')});db[_0x9e89('0x71')][_0x9e89('0x112')](db['CmHopperAdditionalPhone'],{'as':_0x9e89('0x195'),'foreignKey':_0x9e89('0x196')});db[_0x9e89('0x71')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152'),'onDelete':_0x9e89('0x111')});db['CmHopper'][_0x9e89('0x11e')](db['CmList'],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f'),'onDelete':'cascade'});db[_0x9e89('0x71')][_0x9e89('0x11e')](db['User'],{'as':'Agent','foreignKey':_0x9e89('0x10e')});db[_0x9e89('0x71')]['belongsTo'](db[_0x9e89('0x1b')],{'as':_0x9e89('0x186'),'foreignKey':_0x9e89('0x141'),'onDelete':'cascade'});db[_0x9e89('0x71')]['belongsTo'](db[_0x9e89('0x197')],{'as':'Campaign','foreignKey':_0x9e89('0x198'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x71')][_0x9e89('0x11e')](db['User'],{'as':_0x9e89('0x167'),'foreignKey':_0x9e89('0x199')});db[_0x9e89('0x73')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x73')]['belongsTo'](db['CmList'],{'as':_0x9e89('0x15e'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x9e89('0x73')][_0x9e89('0x11e')](db['VoiceQueue'],{'as':_0x9e89('0x186'),'foreignKey':'VoiceQueueId','onDelete':_0x9e89('0x111')});db[_0x9e89('0x73')][_0x9e89('0x11e')](db['Campaign'],{'as':'Campaign','foreignKey':_0x9e89('0x198'),'onDelete':'cascade'});db[_0x9e89('0x7d')][_0x9e89('0x112')](db[_0x9e89('0x82')],{'as':{'plural':_0x9e89('0x19a'),'singular':'OneAll'},'foreignKey':_0x9e89('0x19b'),'onDelete':_0x9e89('0x111'),'hooks':!![]});db[_0x9e89('0x7d')][_0x9e89('0x112')](db[_0x9e89('0x82')],{'as':{'plural':_0x9e89('0x19c'),'singular':_0x9e89('0x19d')},'foreignKey':_0x9e89('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x9e89('0x7d')][_0x9e89('0x112')](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x9e89('0x111'),'hooks':!![]});db[_0x9e89('0x159')][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':'ParentId','onDelete':_0x9e89('0x111')});db[_0x9e89('0x83')][_0x9e89('0x112')](db[_0x9e89('0x83')],{'as':_0x9e89('0x19f'),'foreignKey':_0x9e89('0x145'),'onDelete':_0x9e89('0x111'),'hooks':!![],'required':![]});db[_0x9e89('0x83')][_0x9e89('0x112')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x9e89('0x145'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x83')]['hasMany'](db[_0x9e89('0x15d')],{'as':_0x9e89('0x1a0'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x83')]['hasMany'](db[_0x9e89('0x64')],{'as':'ChatApplications','foreignKey':_0x9e89('0x145')});db['Interval'][_0x9e89('0x112')](db[_0x9e89('0x4c')],{'as':_0x9e89('0x1a1'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x83')][_0x9e89('0x112')](db[_0x9e89('0x55')],{'as':_0x9e89('0x1a2'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x89')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{});db[_0x9e89('0x89')]['belongsTo'](db[_0x9e89('0x9a')],{'foreignKey':_0x9e89('0x1a3')});db[_0x9e89('0x89')][_0x9e89('0x11e')](db[_0x9e89('0x98')],{'foreignKey':_0x9e89('0x1a4')});db[_0x9e89('0x8b')]['belongsToMany'](db[_0x9e89('0x19')],{'as':'Mohs','through':_0x9e89('0x140'),'onDelete':'restrict'});db['Tag'][_0x9e89('0x11f')](db[_0x9e89('0x6f')],{'through':'cm_contact_has_tags'});db['Tag'][_0x9e89('0x11f')](db[_0x9e89('0x119')],{'through':_0x9e89('0x189')});db[_0x9e89('0x8c')][_0x9e89('0x11f')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x9e89('0x8c')][_0x9e89('0x11f')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x9e89('0x8c')][_0x9e89('0x11f')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x9e89('0x8c')][_0x9e89('0x11f')](db[_0x9e89('0x5d')],{'through':_0x9e89('0x17f')});db[_0x9e89('0x8c')][_0x9e89('0x11f')](db[_0x9e89('0xff')],{'through':_0x9e89('0x1a5')});db[_0x9e89('0x8f')]['belongsTo'](db[_0x9e89('0x8d')],{'as':_0x9e89('0x1a6'),'foreignKey':_0x9e89('0x1a7')});db[_0x9e89('0x1a8')][_0x9e89('0x11e')](db[_0x9e89('0x71')],{'as':_0x9e89('0x1a9'),'foreignKey':_0x9e89('0x196')});db[_0x9e89('0x8f')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x1aa')});db[_0x9e89('0x1ab')][_0x9e89('0x112')](db[_0x9e89('0x82')],{'as':{'plural':'AllConditions','singular':_0x9e89('0x1ac')},'foreignKey':_0x9e89('0x1ad'),'onDelete':_0x9e89('0x111'),'hooks':!![]});db[_0x9e89('0x1ab')]['hasMany'](db[_0x9e89('0x82')],{'as':{'plural':_0x9e89('0x1ae'),'singular':_0x9e89('0x1af')},'foreignKey':_0x9e89('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0x9e89('0x1ab')][_0x9e89('0x112')](db[_0x9e89('0x7b')],{'as':_0x9e89('0x1b1'),'foreignKey':_0x9e89('0x1b2'),'onDelete':_0x9e89('0x111'),'hooks':!![]});db[_0x9e89('0x98')]['hasMany'](db[_0x9e89('0x1b3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9e89('0x1a4'),'hooks':!![]});db[_0x9e89('0x9a')][_0x9e89('0x112')](db['AnalyticFieldReport'],{'as':_0x9e89('0x1b4'),'onDelete':_0x9e89('0x111'),'foreignKey':'DefaultReportId'});db[_0x9e89('0x1b5')][_0x9e89('0x112')](db[_0x9e89('0x1b3')],{'as':_0x9e89('0x1b4'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1b6')});db[_0x9e89('0x1b3')][_0x9e89('0x11e')](db['AnalyticMetric'],{'foreignKey':_0x9e89('0x1b6')});db[_0x9e89('0x1b7')][_0x9e89('0x112')](db[_0x9e89('0x1b8')],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x9e89('0x112')](db[_0x9e89('0xa2')],{'as':_0x9e89('0x1ba'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0x1b8')][_0x9e89('0x112')](db[_0x9e89('0xa2')],{'as':_0x9e89('0x1bc'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1b8')]['hasMany'](db[_0x9e89('0xa2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9e89('0x1be')});db['SalesforceConfiguration'][_0x9e89('0x11e')](db[_0x9e89('0x1b7')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x1bf')});db['SalesforceField'][_0x9e89('0x112')](db['SalesforceField'],{'as':_0x9e89('0x1c0'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xa2')][_0x9e89('0x112')](db[_0x9e89('0xa2')],{'as':_0x9e89('0x1c1'),'foreignKey':'DescriptionId'});db[_0x9e89('0xa2')][_0x9e89('0x112')](db[_0x9e89('0xa2')],{'as':'Field','foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xa2')][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xa4')][_0x9e89('0x112')](db[_0x9e89('0x1c4')],{'as':_0x9e89('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e89('0x1bf')});db['SugarcrmConfiguration'][_0x9e89('0x112')](db[_0x9e89('0x1c5')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0x1c4')][_0x9e89('0x112')](db['SugarcrmField'],{'as':_0x9e89('0x1bc'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1c4')]['hasMany'](db[_0x9e89('0x1c5')],{'as':_0x9e89('0x1b4'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0x1c4')][_0x9e89('0x11e')](db[_0x9e89('0xa4')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x1bf')});db['SugarcrmField'][_0x9e89('0x112')](db[_0x9e89('0x1c5')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9e89('0x1c5')]['hasMany'](db[_0x9e89('0x1c5')],{'as':_0x9e89('0x1c1'),'foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1c5')][_0x9e89('0x112')](db[_0x9e89('0x1c5')],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0x1c5')]['belongsTo'](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xa6')][_0x9e89('0x112')](db[_0x9e89('0x1c7')],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0x1c7')][_0x9e89('0x112')](db[_0x9e89('0xa9')],{'as':_0x9e89('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9e89('0x1c7')][_0x9e89('0x112')](db[_0x9e89('0xa9')],{'as':_0x9e89('0x1bc'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1c7')][_0x9e89('0x112')](db[_0x9e89('0xa9')],{'as':_0x9e89('0x1b4'),'onDelete':'cascade','foreignKey':_0x9e89('0x1be')});db[_0x9e89('0x1c7')][_0x9e89('0x11e')](db[_0x9e89('0xa6')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0x1c7')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'int_desk_configuration_has_tags'});db[_0x9e89('0xa9')]['hasMany'](db[_0x9e89('0xa9')],{'as':'Subject','foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xa9')][_0x9e89('0x112')](db['DeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9e89('0xa9')][_0x9e89('0x112')](db['DeskField'],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xa9')][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x9e89('0x112')](db['ZohoConfiguration'],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0xac')][_0x9e89('0x112')](db[_0x9e89('0xae')],{'as':_0x9e89('0x1ba'),'onDelete':_0x9e89('0x111'),'foreignKey':'SubjectId'});db[_0x9e89('0xac')][_0x9e89('0x112')](db[_0x9e89('0xae')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0xac')][_0x9e89('0x112')](db[_0x9e89('0xae')],{'as':_0x9e89('0x1b4'),'onDelete':_0x9e89('0x111'),'foreignKey':'FieldId'});db[_0x9e89('0xac')][_0x9e89('0x11e')](db['ZohoAccount'],{'as':_0x9e89('0x165'),'foreignKey':'AccountId'});db[_0x9e89('0xae')][_0x9e89('0x112')](db['ZohoField'],{'as':_0x9e89('0x1c0'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xae')][_0x9e89('0x112')](db[_0x9e89('0xae')],{'as':_0x9e89('0x1c1'),'foreignKey':'DescriptionId'});db[_0x9e89('0xae')]['hasMany'](db['ZohoField'],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xae')][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xaf')]['hasMany'](db[_0x9e89('0xb1')],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db['ZendeskConfiguration']['hasMany'](db[_0x9e89('0x1c8')],{'as':'Subjects','foreignKey':_0x9e89('0x1bb')});db['ZendeskConfiguration'][_0x9e89('0x112')](db['ZendeskField'],{'as':_0x9e89('0x1bc'),'foreignKey':'DescriptionId'});db[_0x9e89('0xb1')][_0x9e89('0x112')](db['ZendeskField'],{'as':_0x9e89('0x1b4'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xb1')][_0x9e89('0x11e')](db[_0x9e89('0xaf')],{'as':_0x9e89('0x165'),'foreignKey':'AccountId'});db[_0x9e89('0xb1')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x9e89('0x1c8')][_0x9e89('0x112')](db[_0x9e89('0x1c8')],{'as':_0x9e89('0x1c0'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0x1c8')][_0x9e89('0x112')](db[_0x9e89('0x1c8')],{'as':'Description','foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1c8')]['hasMany'](db[_0x9e89('0x1c8')],{'as':'Field','foreignKey':'FieldId'});db[_0x9e89('0x1c8')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xb3')][_0x9e89('0x112')](db[_0x9e89('0xb5')],{'as':'Configurations','onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0xb5')][_0x9e89('0x112')](db[_0x9e89('0xb7')],{'as':_0x9e89('0x1ba'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xb5')][_0x9e89('0x112')](db['FreshdeskField'],{'as':_0x9e89('0x1bc'),'onDelete':_0x9e89('0x111'),'foreignKey':'DescriptionId'});db[_0x9e89('0xb5')][_0x9e89('0x112')](db[_0x9e89('0xb7')],{'as':'Fields','onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xb5')][_0x9e89('0x11e')](db[_0x9e89('0xb3')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x1bf')});db['FreshdeskConfiguration'][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x9e89('0xb7')][_0x9e89('0x112')](db[_0x9e89('0xb7')],{'as':'Subject','foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xb7')]['hasMany'](db[_0x9e89('0xb7')],{'as':_0x9e89('0x1c1'),'foreignKey':_0x9e89('0x1bd')});db['FreshdeskField'][_0x9e89('0x112')](db[_0x9e89('0xb7')],{'as':_0x9e89('0x1c6'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':'Variable','foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xb9')][_0x9e89('0x112')](db[_0x9e89('0xbb')],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0xbb')][_0x9e89('0x112')](db[_0x9e89('0xbd')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9e89('0xbb')][_0x9e89('0x112')](db[_0x9e89('0xbd')],{'as':_0x9e89('0x1bc'),'foreignKey':_0x9e89('0x1bd')});db['VtigerConfiguration'][_0x9e89('0x112')](db[_0x9e89('0xbd')],{'as':'Fields','foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xbb')][_0x9e89('0x11e')](db[_0x9e89('0xb9')],{'as':_0x9e89('0x165'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0xbd')]['hasMany'](db[_0x9e89('0xbd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9e89('0xbd')][_0x9e89('0x112')](db[_0x9e89('0xbd')],{'as':_0x9e89('0x1c1'),'foreignKey':_0x9e89('0x1bd')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db['VtigerField'][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0x1c9')]['hasMany'](db[_0x9e89('0xbf')],{'as':_0x9e89('0x1b9'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1bf')});db[_0x9e89('0xbf')]['hasMany'](db[_0x9e89('0x1ca')],{'as':_0x9e89('0x1ba'),'foreignKey':'SubjectId'});db[_0x9e89('0xbf')]['hasMany'](db[_0x9e89('0x1ca')],{'as':_0x9e89('0x1bc'),'foreignKey':_0x9e89('0x1bd')});db['ServicenowConfiguration'][_0x9e89('0x112')](db[_0x9e89('0x1ca')],{'as':_0x9e89('0x1b4'),'foreignKey':_0x9e89('0x1be')});db['ServicenowConfiguration'][_0x9e89('0x11e')](db[_0x9e89('0x1c9')],{'as':'Account','foreignKey':'AccountId'});db[_0x9e89('0x1ca')]['hasMany'](db[_0x9e89('0x1ca')],{'as':'Subject','foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0x1ca')][_0x9e89('0x112')](db[_0x9e89('0x1ca')],{'as':_0x9e89('0x1c1'),'foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1ca')]['hasMany'](db[_0x9e89('0x1ca')],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db['ServicenowField'][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db['Dynamics365Account'][_0x9e89('0x112')](db[_0x9e89('0xc4')],{'as':_0x9e89('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e89('0x1bf')});db['Dynamics365Account'][_0x9e89('0x11e')](db[_0x9e89('0x154')],{'as':_0x9e89('0x154'),'foreignKey':_0x9e89('0x155')});db[_0x9e89('0xc4')][_0x9e89('0x112')](db[_0x9e89('0xc6')],{'as':_0x9e89('0x1ba'),'onDelete':_0x9e89('0x111'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0x9e89('0x112')](db['Dynamics365Field'],{'as':_0x9e89('0x1bc'),'onDelete':_0x9e89('0x111'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db[_0x9e89('0xc6')],{'as':_0x9e89('0x1b4'),'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xc4')][_0x9e89('0x11e')](db[_0x9e89('0xc2')],{'as':_0x9e89('0x165'),'foreignKey':'AccountId'});db[_0x9e89('0xc6')][_0x9e89('0x112')](db[_0x9e89('0xc6')],{'as':_0x9e89('0x1c0'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xc6')][_0x9e89('0x112')](db[_0x9e89('0xc6')],{'as':_0x9e89('0x1c1'),'foreignKey':'DescriptionId'});db[_0x9e89('0xc6')][_0x9e89('0x112')](db[_0x9e89('0xc6')],{'as':'Field','foreignKey':_0x9e89('0x1be')});db['Dynamics365Field'][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db['FreshsalesAccount'][_0x9e89('0x112')](db[_0x9e89('0x1cb')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x9e89('0x1cb')]['hasMany'](db[_0x9e89('0xca')],{'as':'Subjects','foreignKey':_0x9e89('0x1bb')});db['FreshsalesConfiguration'][_0x9e89('0x112')](db[_0x9e89('0xca')],{'as':'Descriptions','foreignKey':_0x9e89('0x1bd')});db[_0x9e89('0x1cb')][_0x9e89('0x112')](db[_0x9e89('0xca')],{'as':_0x9e89('0x1b4'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0x1cb')][_0x9e89('0x11e')](db[_0x9e89('0x1cc')],{'as':_0x9e89('0x165'),'foreignKey':'AccountId'});db[_0x9e89('0xca')][_0x9e89('0x112')](db[_0x9e89('0xca')],{'as':_0x9e89('0x1c0'),'foreignKey':_0x9e89('0x1bb')});db[_0x9e89('0xca')]['hasMany'](db[_0x9e89('0xca')],{'as':_0x9e89('0x1c1'),'foreignKey':_0x9e89('0x1bd')});db['FreshsalesField']['hasMany'](db[_0x9e89('0xca')],{'as':_0x9e89('0x1c6'),'foreignKey':_0x9e89('0x1be')});db[_0x9e89('0xca')][_0x9e89('0x11e')](db[_0x9e89('0x1c2')],{'as':_0x9e89('0x1c2'),'foreignKey':_0x9e89('0x1c3')});db[_0x9e89('0xce')][_0x9e89('0x11e')](db[_0x9e89('0x133')],{});db[_0x9e89('0xce')]['belongsTo'](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':'ListId'});db['ChatQueueReport']['belongsTo'](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152')});db['ChatQueueReport']['belongsTo'](db[_0x9e89('0x119')],{});db['ChatQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0x66')],{});db[_0x9e89('0xce')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{});db['ChatQueueReport'][_0x9e89('0x11e')](db['ChatQueue'],{});db[_0x9e89('0xd0')]['belongsTo'](db['User'],{'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1cd')});db[_0x9e89('0xd0')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1ce')});db[_0x9e89('0xd5')]['hasMany'](db[_0x9e89('0xd3')],{'foreignKey':_0x9e89('0x1cf'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0xd5')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x9e89('0x1cf'),'onDelete':'cascade'});db[_0x9e89('0xd7')][_0x9e89('0x11e')](db[_0x9e89('0x54')],{});db[_0x9e89('0xd7')]['belongsTo'](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':'ListId'});db[_0x9e89('0xd7')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':'Contact','foreignKey':_0x9e89('0x152')});db[_0x9e89('0xd7')]['belongsTo'](db['SmsInteraction'],{});db[_0x9e89('0xd7')][_0x9e89('0x11e')](db[_0x9e89('0x58')],{});db[_0x9e89('0xd7')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{});db[_0x9e89('0xd7')][_0x9e89('0x11e')](db[_0x9e89('0x12e')],{});db[_0x9e89('0xdc')][_0x9e89('0x112')](db[_0x9e89('0xd5')],{'foreignKey':_0x9e89('0x1d0')});db[_0x9e89('0xdc')][_0x9e89('0x112')](db[_0x9e89('0xd3')],{'foreignKey':_0x9e89('0x1d0')});db[_0x9e89('0xdc')]['hasMany'](db[_0x9e89('0xd1')],{'foreignKey':_0x9e89('0x1d0')});db[_0x9e89('0xe2')]['belongsToMany'](db[_0x9e89('0x10d')],{'as':'Agents','through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x9e89('0x1b')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0x9e89('0xe2')]['belongsToMany'](db[_0x9e89('0x3d')],{'through':_0x9e89('0x163'),'as':_0x9e89('0x12b')});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db[_0x9e89('0x12c')],{'through':_0x9e89('0x18a'),'as':'ChatQueues'});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db[_0x9e89('0x50')],{'through':'team_has_fax_queues','as':_0x9e89('0x1d1')});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db[_0x9e89('0x12e')],{'through':_0x9e89('0x1d2'),'as':'SmsQueues'});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db[_0x9e89('0x60')],{'through':_0x9e89('0x181'),'as':_0x9e89('0x1d3')});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':_0x9e89('0x130')});db[_0x9e89('0xe2')][_0x9e89('0x11f')](db['VoicePrefix'],{'through':_0x9e89('0x108'),'as':_0x9e89('0x1d4')});db[_0x9e89('0x197')]['hasMany'](db[_0x9e89('0x71')],{'as':_0x9e89('0x190'),'foreignKey':_0x9e89('0x198')});db[_0x9e89('0x197')][_0x9e89('0x112')](db[_0x9e89('0x115')],{'as':_0x9e89('0x116'),'foreignKey':'CampaignId'});db[_0x9e89('0x197')][_0x9e89('0x112')](db[_0x9e89('0x117')],{'as':'HopperHistories','foreignKey':_0x9e89('0x198')});db[_0x9e89('0x197')][_0x9e89('0x112')](db['CmHopperBlack'],{'as':_0x9e89('0x142'),'foreignKey':_0x9e89('0x198')});db[_0x9e89('0x197')]['belongsTo'](db[_0x9e89('0x2c')],{'as':_0x9e89('0x2c'),'foreignKey':_0x9e89('0x143')});db['Campaign'][_0x9e89('0x11e')](db[_0x9e89('0x2c')],{'as':_0x9e89('0x1d5'),'foreignKey':_0x9e89('0x144')});db[_0x9e89('0x197')]['belongsTo'](db[_0x9e89('0x83')],{'as':_0x9e89('0x83'),'foreignKey':_0x9e89('0x145')});db[_0x9e89('0x197')][_0x9e89('0x11e')](db[_0x9e89('0x1d6')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db['Campaign'][_0x9e89('0x11f')](db['CmList'],{'as':_0x9e89('0x1d7'),'through':_0x9e89('0x1d8')});db['Campaign'][_0x9e89('0x11f')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x148'),'through':_0x9e89('0x1d9')});db[_0x9e89('0x16b')][_0x9e89('0x11e')](db[_0x9e89('0x68')],{'as':_0x9e89('0x68'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x9e89('0x11e')](db['MailMessage'],{});db[_0x9e89('0xec')]['belongsTo'](db[_0x9e89('0x40')],{});db[_0x9e89('0xec')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{'foreignKey':_0x9e89('0x1da'),'as':_0x9e89('0x1db')});db[_0x9e89('0xec')]['belongsTo'](db['User'],{'foreignKey':_0x9e89('0x1dc'),'as':_0x9e89('0x1dd')});db[_0x9e89('0xec')][_0x9e89('0x11e')](db['User'],{'foreignKey':'ToUserId','as':_0x9e89('0x1de')});db[_0x9e89('0xec')][_0x9e89('0x11e')](db['MailQueue'],{'foreignKey':_0x9e89('0x1df'),'as':'ToQueue'});db[_0x9e89('0xec')][_0x9e89('0x11e')](db[_0x9e89('0x3b')],{'foreignKey':_0x9e89('0x1e0'),'as':_0x9e89('0x1e1')});db[_0x9e89('0x1e2')][_0x9e89('0x11e')](db['ChatMessage'],{});db[_0x9e89('0x1e2')][_0x9e89('0x11e')](db[_0x9e89('0x119')],{});db[_0x9e89('0x1e2')][_0x9e89('0x11e')](db[_0x9e89('0x133')],{'foreignKey':_0x9e89('0x1e3'),'as':_0x9e89('0x1db')});db[_0x9e89('0x1e2')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':_0x9e89('0x1dc'),'as':_0x9e89('0x1dd')});db[_0x9e89('0x1e2')]['belongsTo'](db[_0x9e89('0x10d')],{'foreignKey':'ToUserId','as':_0x9e89('0x1de')});db[_0x9e89('0x1e2')]['belongsTo'](db[_0x9e89('0x12c')],{'foreignKey':_0x9e89('0x1e4'),'as':_0x9e89('0x1e5')});db['ChatTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x133')],{'foreignKey':_0x9e89('0x1e6'),'as':'ToAccount'});db['FaxTransferReport'][_0x9e89('0x11e')](db['FaxMessage'],{});db[_0x9e89('0xee')][_0x9e89('0x11e')](db[_0x9e89('0x11b')],{});db[_0x9e89('0xee')][_0x9e89('0x11e')](db['FaxAccount'],{'foreignKey':_0x9e89('0x1e7'),'as':_0x9e89('0x1db')});db[_0x9e89('0xee')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':'FromUserId','as':_0x9e89('0x1dd')});db[_0x9e89('0xee')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':'ToUserId','as':_0x9e89('0x1de')});db['FaxTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x50')],{'foreignKey':_0x9e89('0x1e8'),'as':_0x9e89('0x1e5')});db['FaxTransferReport'][_0x9e89('0x11e')](db['FaxAccount'],{'foreignKey':_0x9e89('0x1e9'),'as':'ToAccount'});db[_0x9e89('0xf0')][_0x9e89('0x11e')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x5d')],{});db[_0x9e89('0xf0')]['belongsTo'](db[_0x9e89('0x5a')],{'foreignKey':_0x9e89('0x1ea'),'as':_0x9e89('0x1db')});db[_0x9e89('0xf0')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':_0x9e89('0x1dc'),'as':_0x9e89('0x1dd')});db[_0x9e89('0xf0')]['belongsTo'](db[_0x9e89('0x10d')],{'foreignKey':_0x9e89('0x1eb'),'as':_0x9e89('0x1de')});db[_0x9e89('0xf0')][_0x9e89('0x11e')](db[_0x9e89('0x60')],{'foreignKey':_0x9e89('0x1ec'),'as':_0x9e89('0x1e5')});db[_0x9e89('0xf0')][_0x9e89('0x11e')](db[_0x9e89('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x9e89('0x1e1')});db[_0x9e89('0xf1')][_0x9e89('0x11e')](db['SmsMessage'],{});db[_0x9e89('0xf1')]['belongsTo'](db[_0x9e89('0x57')],{});db[_0x9e89('0xf1')]['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x9e89('0x1db')});db['SmsTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':'ToUserId','as':_0x9e89('0x1de')});db[_0x9e89('0xf1')][_0x9e89('0x11e')](db[_0x9e89('0x12e')],{'foreignKey':_0x9e89('0x1ed'),'as':_0x9e89('0x1e5')});db[_0x9e89('0xf1')][_0x9e89('0x11e')](db[_0x9e89('0x54')],{'foreignKey':_0x9e89('0x1ee'),'as':_0x9e89('0x1e1')});db['CmList'][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x9e89('0xf3')][_0x9e89('0x112')](db['CmCustomField'],{'as':_0x9e89('0x1ef'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0xf3')][_0x9e89('0x112')](db['CmContact'],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x9e89('0x16f')});db[_0x9e89('0xf3')][_0x9e89('0x112')](db[_0x9e89('0x115')],{'as':_0x9e89('0x116'),'foreignKey':'ListId'});db[_0x9e89('0xf3')]['hasMany'](db[_0x9e89('0x117')],{'as':_0x9e89('0x1f0'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0xf3')][_0x9e89('0x112')](db['ReportAgentPreview'],{'as':_0x9e89('0x77'),'foreignKey':'ListId'});db[_0x9e89('0xf3')][_0x9e89('0x11f')](db[_0x9e89('0x1b')],{'as':_0x9e89('0x1f1'),'through':_0x9e89('0x1f2')});db['CmList']['belongsToMany'](db['User'],{'as':_0x9e89('0x162'),'through':_0x9e89('0x132')});db[_0x9e89('0xf5')][_0x9e89('0x112')](db['VoiceExtension'],{'as':_0x9e89('0x1f3'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0xf5')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':'Agents','through':_0x9e89('0x10a')});db[_0x9e89('0xf5')][_0x9e89('0x11f')](db[_0x9e89('0xe2')],{'through':_0x9e89('0x108'),'as':_0x9e89('0x147')});db[_0x9e89('0xf7')][_0x9e89('0x112')](db[_0x9e89('0x10d')],{'as':'Users','foreignKey':_0x9e89('0x1f4')});db[_0x9e89('0xf7')]['hasMany'](db['UserProfileSection'],{'as':_0x9e89('0x1f5'),'foreignKey':_0x9e89('0x1f4'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0x1f6')][_0x9e89('0x112')](db['UserProfileResource'],{'as':_0x9e89('0x1f7'),'foreignKey':_0x9e89('0x1f8'),'onDelete':'cascade'});db['WhatsappAccount'][_0x9e89('0x112')](db[_0x9e89('0x159')],{'as':_0x9e89('0x15a'),'foreignKey':_0x9e89('0x1f9'),'onDelete':_0x9e89('0x111')});db[_0x9e89('0xfc')][_0x9e89('0x112')](db['CannedAnswer'],{'as':_0x9e89('0x15b'),'foreignKey':_0x9e89('0x1f9')});db[_0x9e89('0xfc')][_0x9e89('0x112')](db['WhatsappMessage'],{'as':_0x9e89('0x14a'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x9e89('0x112')](db[_0x9e89('0xff')],{'as':_0x9e89('0x15c')});db[_0x9e89('0xfc')][_0x9e89('0x112')](db[_0x9e89('0xfd')],{'as':'Applications'});db[_0x9e89('0xfc')]['belongsTo'](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0xfc')][_0x9e89('0x11e')](db['Pause'],{'as':_0x9e89('0x160'),'foreignKey':_0x9e89('0x161')});db[_0x9e89('0xfc')]['belongsToMany'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x1fa')});db[_0x9e89('0xfd')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0xfd')][_0x9e89('0x11e')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0x9e89('0xfd')]['belongsTo'](db[_0x9e89('0xfc')],{'onDelete':_0x9e89('0x156')});db[_0x9e89('0xfd')][_0x9e89('0x11e')](db[_0x9e89('0x83')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x9e89('0xfd')][_0x9e89('0x11e')](db[_0x9e89('0x8c')],{'onDelete':_0x9e89('0x156'),'foreignKey':_0x9e89('0x16e')});db['WhatsappInteraction']['hasMany'](db[_0x9e89('0x1fb')],{'as':'Messages','onDelete':_0x9e89('0x111'),'foreignKey':_0x9e89('0x1fc')});db[_0x9e89('0xff')][_0x9e89('0x11e')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x9e89('0x1f9')});db[_0x9e89('0xff')][_0x9e89('0x11e')](db[_0x9e89('0x6f')],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db[_0x9e89('0xff')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':'Owner','foreignKey':'UserId'});db[_0x9e89('0xff')]['belongsToMany'](db[_0x9e89('0x8c')],{'through':_0x9e89('0x1a5'),'as':'Tags'});db[_0x9e89('0xff')][_0x9e89('0x11f')](db[_0x9e89('0x8c')],{'through':'whatsapp_interaction_has_tags','as':_0x9e89('0x176')});db['WhatsappInteraction']['belongsToMany'](db[_0x9e89('0x10d')],{'as':_0x9e89('0x16a'),'through':_0x9e89('0x128'),'foreignKey':_0x9e89('0x1fc')});db['WhatsappMessage'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x10d')});db[_0x9e89('0x1fb')]['belongsTo'](db[_0x9e89('0x6f')],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x166')});db[_0x9e89('0x1fb')][_0x9e89('0x11e')](db['WhatsappInteraction'],{'onDelete':_0x9e89('0x111'),'as':_0x9e89('0x177'),'foreignKey':'WhatsappInteractionId'});db[_0x9e89('0x1fb')]['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x9e89('0x1f9')});db[_0x9e89('0x101')][_0x9e89('0x11e')](db['WhatsappAccount'],{});db[_0x9e89('0x101')][_0x9e89('0x11e')](db[_0x9e89('0xf3')],{'as':_0x9e89('0x15e'),'foreignKey':_0x9e89('0x16f')});db[_0x9e89('0x101')]['belongsTo'](db['CmContact'],{'as':_0x9e89('0x166'),'foreignKey':_0x9e89('0x152')});db['WhatsappQueueReport'][_0x9e89('0x11e')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x9e89('0x11e')](db[_0x9e89('0x105')],{});db[_0x9e89('0x101')][_0x9e89('0x11e')](db['WhatsappMessage'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x9e89('0x10d')],{});db[_0x9e89('0x103')][_0x9e89('0x11e')](db[_0x9e89('0x1fb')],{});db[_0x9e89('0x103')][_0x9e89('0x11e')](db['WhatsappInteraction'],{});db[_0x9e89('0x103')][_0x9e89('0x11e')](db[_0x9e89('0xfc')],{'foreignKey':_0x9e89('0x1fd'),'as':'FromAccount'});db[_0x9e89('0x103')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x9e89('0x103')][_0x9e89('0x11e')](db[_0x9e89('0x105')],{'foreignKey':_0x9e89('0x1fe'),'as':_0x9e89('0x1e5')});db[_0x9e89('0x103')][_0x9e89('0x11e')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['WhatsappTransferReport'][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'foreignKey':_0x9e89('0x1eb'),'as':_0x9e89('0x1de')});db[_0x9e89('0x105')][_0x9e89('0x11f')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x162'),'through':_0x9e89('0x131'),'foreignKey':_0x9e89('0x1ff')});db['WhatsappQueue'][_0x9e89('0x11f')](db[_0x9e89('0xe2')],{'through':_0x9e89('0x200'),'as':_0x9e89('0x147')});db[_0x9e89('0x110')][_0x9e89('0x11e')](db[_0x9e89('0x10d')],{'as':_0x9e89('0x201'),'foreignKey':'UserId','onDelete':_0x9e89('0x111'),'hooks':!![]});db['CloudProvider'][_0x9e89('0x10f')](db['Dynamics365Account'],{'as':_0x9e89('0xc2'),'onDelete':'restrict'});db[_0x9e89('0x154')][_0x9e89('0x10f')](db[_0x9e89('0x38')],{'as':_0x9e89('0x157'),'onDelete':_0x9e89('0x156')});db[_0x9e89('0x154')][_0x9e89('0x10f')](db[_0x9e89('0x39')],{'as':'Smtp','onDelete':_0x9e89('0x156')});module[_0x9e89('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc624=['team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','MailApplication','TagId','Items','FaxAccount','FaxAccountId','Interactions','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','SmsAccountId','SmsMessage','Pause','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','Website','CmCompany','CompanyId','Phones','CmContactId','JscriptySessions','OpenchannelInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Queue','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','Hopper','CmHopperId','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskConfiguration','DeskField','Subjects','int_desk_configuration_has_tags','ZohoConfiguration','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowField','CloudProviderId','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_teams','Hoppers','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','HopperHistory','voice_queues_has_cm_lists','UserProfile','UserProfileSection','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../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','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','../api/pause/pause.model','../api/cdr/cdr.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','../api/user-setting/user-setting.model','hasOne','cascade','UserSetting','userSetting','UserId','hasMany','VoiceQueuesRt','Extensions','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','ChatGroup','Contacts','cm_user_has_contacts','cm_user_has_lists','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','UserSmsQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperFinals','CmHopperHistory','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Agents','Teams','voice_queues_has_cm_blacklists','VoiceMail','mailboxuser','mailbox','VoiceMailMessage','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','restrict','Imap','Smtp','Dispositions','Answers','Messages','List','ListId'];(function(_0x45a557,_0x4a01d7){var _0x10bbd4=function(_0x4da264){while(--_0x4da264){_0x45a557['push'](_0x45a557['shift']());}};_0x10bbd4(++_0x4a01d7);}(_0xc624,0x99));var _0x4c62=function(_0x195fb9,_0x3f727c){_0x195fb9=_0x195fb9-0x0;var _0x1778c4=_0xc624[_0x195fb9];return _0x1778c4;};'use strict';var config=require(_0x4c62('0x0'));var Sequelize=require(_0x4c62('0x1'));var _=require(_0x4c62('0x2'));var jstz=require('jstz');var timezone=jstz[_0x4c62('0x3')]();config[_0x4c62('0x1')]=_[_0x4c62('0x4')](config[_0x4c62('0x1')],{'database':'motion2','username':_0x4c62('0x5'),'password':_0x4c62('0x6'),'options':{'host':_0x4c62('0x7'),'port':0xcea,'dialect':_0x4c62('0x8'),'dialectOptions':{'charset':_0x4c62('0x9')},'logging':![],'timezone':timezone[_0x4c62('0xa')](),'define':{'charset':_0x4c62('0xb'),'collate':_0x4c62('0xc')}}});config[_0x4c62('0xd')]=_[_0x4c62('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0x4c62('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4c62('0x8'),'dialectOptions':{'charset':_0x4c62('0x9')},'logging':![],'timezone':timezone[_0x4c62('0xa')](),'define':{'charset':_0x4c62('0xb'),'collate':_0x4c62('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4c62('0xe')],config[_0x4c62('0x1')][_0x4c62('0xf')],config[_0x4c62('0x1')][_0x4c62('0x10')],config[_0x4c62('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4c62('0xd')][_0x4c62('0xe')],config[_0x4c62('0xd')][_0x4c62('0xf')],config['sequelizeHistory'][_0x4c62('0x10')],config[_0x4c62('0xd')][_0x4c62('0x11')])};db[_0x4c62('0x12')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x14'));db[_0x4c62('0x15')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x16'));db[_0x4c62('0x17')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x18'));db[_0x4c62('0x19')]=db['sequelize']['import'](_0x4c62('0x1a'));db[_0x4c62('0x1b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x1c'));db[_0x4c62('0x1d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x1e'));db[_0x4c62('0x1f')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x4c62('0x20')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x4c62('0x1')]['import'](_0x4c62('0x21'));db['VoiceMailMessage']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x22'));db[_0x4c62('0x23')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x4c62('0x24')]=db['sequelize'][_0x4c62('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4c62('0x25')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x26'));db[_0x4c62('0x27')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x28'));db['MemberReport']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x29'));db[_0x4c62('0x2a')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/trunk/trunk.model');db[_0x4c62('0x2b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x2c'));db[_0x4c62('0x2d')]=db[_0x4c62('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4c62('0x2e')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x2f'));db[_0x4c62('0x30')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x31'));db[_0x4c62('0x32')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x33'));db['UserFaxQueue']=db[_0x4c62('0x1')]['import'](_0x4c62('0x34'));db['UserSmsQueue']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x35'));db[_0x4c62('0x36')]=db['sequelize'][_0x4c62('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4c62('0x37')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x38'));db[_0x4c62('0x39')]=db['sequelize']['import'](_0x4c62('0x3a'));db[_0x4c62('0x3b')]=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db[_0x4c62('0x3c')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x3d'));db[_0x4c62('0x3e')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x3f'));db[_0x4c62('0x40')]=db[_0x4c62('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x4c62('0x41')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x42'));db[_0x4c62('0x43')]=db[_0x4c62('0x1')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x4c62('0x1')]['import'](_0x4c62('0x44'));db[_0x4c62('0x45')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x46'));db[_0x4c62('0x47')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/dashboard/dashboard.model');db[_0x4c62('0x48')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x49'));db[_0x4c62('0x4a')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x4b'));db[_0x4c62('0x4c')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x4c62('0x4d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x4e'));db[_0x4c62('0x4f')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x50'));db[_0x4c62('0x51')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x52'));db[_0x4c62('0x53')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x54'));db[_0x4c62('0x55')]=db['sequelize'][_0x4c62('0x13')]('../api/smsApplication/smsApplication.model');db[_0x4c62('0x56')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x57'));db['SmsMessage']=db['sequelize']['import'](_0x4c62('0x58'));db[_0x4c62('0x59')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x5a'));db[_0x4c62('0x5b')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x5c'));db[_0x4c62('0x5d')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x5e'));db[_0x4c62('0x5f')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x60'));db['OpenchannelMessage']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x61'));db[_0x4c62('0x62')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x63'));db[_0x4c62('0x64')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x65'));db['OpenchannelQueueReport']=db[_0x4c62('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x4c62('0x66')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatApplication/chatApplication.model');db[_0x4c62('0x67')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x68'));db[_0x4c62('0x69')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x6a'));db['ChatOfflineMessage']=db[_0x4c62('0x1')]['import'](_0x4c62('0x6b'));db[_0x4c62('0x6c')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x6d'));db['ChatGroup']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x6e'));db[_0x4c62('0x6f')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x70'));db['CmCompany']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x71'));db[_0x4c62('0x72')]=db['sequelize']['import']('../api/cmContact/cmContact.model');db[_0x4c62('0x73')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x74'));db[_0x4c62('0x75')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4c62('0x76')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x77'));db['CmHopperHistory']=db['sequelize']['import'](_0x4c62('0x78'));db['ReportAgentPreview']=db['sequelize']['import'](_0x4c62('0x79'));db['CmCustomField']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x7a'));db[_0x4c62('0x7b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x7c'));db[_0x4c62('0x7d')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x7e'));db[_0x4c62('0x7f')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x80'));db[_0x4c62('0x81')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x82'));db['Condition']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x83'));db['Interval']=db['sequelize'][_0x4c62('0x13')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x84'));db['Cdr']=db[_0x4c62('0x1')]['import'](_0x4c62('0x85'));db['VoiceQueuesLog']=db[_0x4c62('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x4c62('0x86')]=db[_0x4c62('0x1')]['import']('../api/schedule/schedule.model');db[_0x4c62('0x87')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x88'));db[_0x4c62('0x89')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8a'));db[_0x4c62('0x8b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8c'));db[_0x4c62('0x8d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8e'));db['CmHopperAdditionalPhone']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x8f'));db[_0x4c62('0x90')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x91'));db[_0x4c62('0x92')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/trigger/trigger.model');db[_0x4c62('0x93')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x94'));db[_0x4c62('0x95')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x96'));db[_0x4c62('0x97')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x98'));db['AnalyticCustomReport']=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4c62('0x99')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x9a'));db[_0x4c62('0x9b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x9c'));db[_0x4c62('0x9d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x9e'));db[_0x4c62('0x9f')]=db['sequelize']['import'](_0x4c62('0xa0'));db['AnalyticTreeReport']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4c62('0xa1')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xa2'));db[_0x4c62('0xa3')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x4c62('0xa4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa5'));db[_0x4c62('0xa6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa7'));db[_0x4c62('0xa8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa9'));db[_0x4c62('0xaa')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xab'));db[_0x4c62('0xac')]=db['sequelize'][_0x4c62('0x13')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xad'));db['DeskField']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xae'));db['ZohoAccount']=db['sequelize'][_0x4c62('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xaf'));db[_0x4c62('0xb0')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xb1'));db[_0x4c62('0xb2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb3'));db[_0x4c62('0xb4')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xb5'));db[_0x4c62('0xb6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb7'));db['FreshdeskAccount']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb8'));db[_0x4c62('0xb9')]=db['sequelize'][_0x4c62('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize']['import'](_0x4c62('0xba'));db[_0x4c62('0xbb')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xbc'));db[_0x4c62('0xbd')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xbe'));db[_0x4c62('0xbf')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x4c62('0xc0')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xc1'));db[_0x4c62('0xc2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc3'));db['ServicenowField']=db[_0x4c62('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x4c62('0xc4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc5'));db[_0x4c62('0xc6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc7'));db['Dynamics365Field']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4c62('0xc8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc9'));db['FreshsalesConfiguration']=db['sequelize']['import'](_0x4c62('0xca'));db['FreshsalesField']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xcb'));db[_0x4c62('0x95')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x96'));db['Network']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xcc'));db[_0x4c62('0xcd')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4c62('0xce')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4c62('0xcf')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd0'));db[_0x4c62('0xd1')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x4c62('0xd2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd3'));db[_0x4c62('0xd4')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareReport/squareReport.model');db[_0x4c62('0xd5')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd6'));db[_0x4c62('0xd7')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd8'));db[_0x4c62('0xd9')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xda'));db[_0x4c62('0xdb')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x4c62('0xdc')]=db[_0x4c62('0x1')]['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xdd'));db['Team']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xde'));db[_0x4c62('0xdf')]=db[_0x4c62('0x1')]['import']('../api/license/license.model');db[_0x4c62('0xe0')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe1'));db[_0x4c62('0xe2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe3'));db[_0x4c62('0xe4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe5'));db[_0x4c62('0xe6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe7'));db['MailTransferReport']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4c62('0xe8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe9'));db[_0x4c62('0xea')]=db['sequelize'][_0x4c62('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db['sequelize'][_0x4c62('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4c62('0xeb')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xec'));db[_0x4c62('0xed')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xee'));db[_0x4c62('0xef')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf0'));db['UserProfile']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf1'));db['UserProfileSection']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x4c62('0xf2')]=db['sequelize']['import']('../api/userProfileResource/userProfileResource.model');db[_0x4c62('0xf3')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xf4'));db[_0x4c62('0xf5')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf6'));db[_0x4c62('0xf7')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf8'));db[_0x4c62('0xf9')]=db['sequelize']['import'](_0x4c62('0xfa'));db[_0x4c62('0xfb')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xfc'));db[_0x4c62('0xfd')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xfe'));db['WhatsappTransferReport']=db[_0x4c62('0x1')]['import'](_0x4c62('0xff'));db['WhatsappQueue']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x100'));db[_0x4c62('0x101')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x4c62('0x102')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x4c62('0x103')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4c62('0x104')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x105'));db[_0x4c62('0x12')][_0x4c62('0x106')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x4c62('0x107'),'foreignKey':'UserId'});db[_0x4c62('0x12')]['hasOne'](db[_0x4c62('0x108')],{'as':_0x4c62('0x109'),'onDelete':'cascade','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x1f')],{'as':'Recordings','foreignKey':'UserId'});db[_0x4c62('0x12')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x4c62('0x10c'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x10d'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x12')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4c62('0x12')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x10e')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x4c62('0x12')][_0x4c62('0x10b')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'foreignKey':_0x4c62('0x10a')});db['User']['hasMany'](db['FaxInteraction'],{'as':_0x4c62('0x111'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x41')],{'as':_0x4c62('0x112'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0xf9')],{'as':_0x4c62('0x113'),'foreignKey':'UserId'});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0xf3')],{'as':_0x4c62('0x114'),'foreignKey':'SenderId'});db[_0x4c62('0x12')][_0x4c62('0x115')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x4c62('0x116')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x118')],{'as':'Groups','through':'chat_group_has_users'});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x72')],{'as':_0x4c62('0x119'),'through':_0x4c62('0x11a')});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0xed')],{'as':'Lists','through':_0x4c62('0x11b')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0x4c62('0x41')],{'as':_0x4c62('0x112'),'through':_0x4c62('0x11d')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'through':_0x4c62('0x11e')});db[_0x4c62('0x12')]['belongsToMany'](db['FaxInteraction'],{'as':_0x4c62('0x111'),'through':'user_has_fax_interactions'});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'through':_0x4c62('0x11f')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x5f')],{'as':'OpenchannelInteractions','through':_0x4c62('0x120')});db['User'][_0x4c62('0x117')](db['WhatsappInteraction'],{'as':_0x4c62('0x113'),'through':_0x4c62('0x121')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x1d')],{'as':_0x4c62('0x122'),'through':'UserVoiceQueue','required':![]});db['User'][_0x4c62('0x117')](db[_0x4c62('0xef')],{'as':'VoicePrefixes','through':_0x4c62('0x104'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x3e')],{'as':_0x4c62('0x123'),'through':_0x4c62('0x32'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db['ChatQueue'],{'as':_0x4c62('0x124'),'through':_0x4c62('0x30'),'required':![],'hooks':!![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db['FaxQueue'],{'as':_0x4c62('0x125'),'through':_0x4c62('0x126'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x59')],{'as':_0x4c62('0x127'),'through':_0x4c62('0x128'),'required':![]});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0x62')],{'as':'OpenchannelQueues','through':_0x4c62('0x36'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x129')],{'as':_0x4c62('0x12a'),'through':'UserWhatsappQueue','required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'through':_0x4c62('0x11b')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x64')],{'as':_0x4c62('0x12b'),'through':'user_has_chat_websites'});db[_0x4c62('0x12')][_0x4c62('0x117')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x4c62('0x12c')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x3c')],{'as':'MailAccounts','through':_0x4c62('0x12d')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x5b')],{'as':'OpenchannelAccounts','through':_0x4c62('0x12e')});db[_0x4c62('0x12')]['belongsToMany'](db['SmsAccount'],{'as':_0x4c62('0x12f'),'through':_0x4c62('0x130')});db['User']['belongsToMany'](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x4c62('0x131')});db['VoiceChanSpy'][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x132'),'onDelete':_0x4c62('0x107'),'foreignKey':'ChanSpyId'});db[_0x4c62('0x17')][_0x4c62('0x10b')](db['VoiceExtension'],{'onDelete':_0x4c62('0x107')});db['VoiceExtension'][_0x4c62('0x10b')](db['VoiceExtension'],{'as':_0x4c62('0x133'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x1b')]['belongsToMany'](db[_0x4c62('0x87')],{'as':'Sounds','through':_0x4c62('0x134')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x2d')],{'as':_0x4c62('0x135'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')]['hasMany'](db[_0x4c62('0x73')],{'as':'Hoppers','foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':_0x4c62('0x137'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x10e')],{'as':_0x4c62('0x10e'),'foreignKey':'VoiceQueueId'});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x75')],{'as':_0x4c62('0x13a'),'foreignKey':'VoiceQueueId'});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Trunk'],{'as':_0x4c62('0x2a'),'foreignKey':_0x4c62('0x13b')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Trunk'],{'as':_0x4c62('0x13c'),'foreignKey':_0x4c62('0x13d')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Interval'],{'as':_0x4c62('0x13e'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Pause'],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['VoiceQueue']['belongsToMany'](db[_0x4c62('0xed')],{'as':_0x4c62('0x142'),'through':'voice_queues_has_cm_lists'});db[_0x4c62('0x1d')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x2e')});db[_0x4c62('0x1d')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'as':_0x4c62('0x144'),'through':_0x4c62('0x102')});db[_0x4c62('0x1d')]['belongsToMany'](db[_0x4c62('0xed')],{'as':'BlackLists','through':_0x4c62('0x145')});db['VoiceRecording'][_0x4c62('0x115')](db['User'],{'as':'User','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x20')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x12'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x146')][_0x4c62('0x10b')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x147'),'sourceKey':_0x4c62('0x148')});db[_0x4c62('0x149')][_0x4c62('0x115')](db[_0x4c62('0x146')],{'foreignKey':'mailboxuser','targetKey':_0x4c62('0x148')});db[_0x4c62('0x23')][_0x4c62('0x10b')](db['VoiceQueueReport'],{'as':_0x4c62('0x14a'),'foreignKey':_0x4c62('0x14b'),'constraints':![]});db[_0x4c62('0x23')][_0x4c62('0x10b')](db[_0x4c62('0x25')],{'as':_0x4c62('0x14c'),'foreignKey':_0x4c62('0x14b'),'constraints':![]});db[_0x4c62('0x23')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':'User','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x23')][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x39')][_0x4c62('0x115')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x4c62('0x14f')});db[_0x4c62('0x39')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x4c62('0x3b')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x4c62('0x3b')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':'CloudProviderId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x3c')][_0x4c62('0x106')](db[_0x4c62('0x39')],{'as':_0x4c62('0x151'),'onDelete':'cascade'});db[_0x4c62('0x3c')][_0x4c62('0x106')](db[_0x4c62('0x3b')],{'as':_0x4c62('0x152'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x3c')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x14f'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x3c')]['hasMany'](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x14f')});db['MailAccount'][_0x4c62('0x10b')](db[_0x4c62('0x43')],{'as':_0x4c62('0x155'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0x4c62('0x41')],{'as':'Interactions'});db[_0x4c62('0x3c')]['hasMany'](db['MailApplication'],{'as':'Applications'});db[_0x4c62('0x3c')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x3c')][_0x4c62('0x115')](db[_0x4c62('0x90')],{'as':_0x4c62('0x90'),'foreignKey':'TemplateId'});db[_0x4c62('0x3c')][_0x4c62('0x115')](db['Pause'],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['MailAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':'user_has_mail_accounts'});db[_0x4c62('0x3e')][_0x4c62('0x117')](db['User'],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x158'),'as':'Teams'});db['MailInteraction'][_0x4c62('0x10b')](db[_0x4c62('0x43')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x159')});db[_0x4c62('0x41')]['belongsTo'](db[_0x4c62('0x3c')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x14f')});db['MailInteraction'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId'});db[_0x4c62('0x41')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':'UserId'});db[_0x4c62('0x41')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x15c'),'as':_0x4c62('0x15d')});db[_0x4c62('0x41')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x15c'),'as':_0x4c62('0x15e')});db['MailInteraction'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x11d'),'foreignKey':_0x4c62('0x159')});db[_0x4c62('0x43')][_0x4c62('0x10b')](db['Attachment'],{'as':_0x4c62('0x160'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x43')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0x43')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db['MailMessage'][_0x4c62('0x115')](db[_0x4c62('0x41')],{'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x159')});db['MailMessage']['belongsTo'](db[_0x4c62('0x3c')],{'as':'Account','foreignKey':_0x4c62('0x14f')});db['MailMessage'][_0x4c62('0x115')](db['ChatWebsite'],{'as':_0x4c62('0x64'),'foreignKey':_0x4c62('0x162')});db['MailMessage'][_0x4c62('0x115')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x4c62('0x163')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')]['belongsTo'](db['MailQueue'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')][_0x4c62('0x115')](db['MailAccount'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x164')]['belongsTo'](db[_0x4c62('0x89')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{});db['MailQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':'List','foreignKey':_0x4c62('0x157')});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x45')]['belongsTo'](db[_0x4c62('0x41')],{});db['MailQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x43')],{});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db[_0x4c62('0x45')]['belongsTo'](db[_0x4c62('0x3e')],{});db['Dashboard'][_0x4c62('0x10b')](db[_0x4c62('0x48')],{'as':_0x4c62('0x166'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':'Dispositions','foreignKey':_0x4c62('0x168'),'onDelete':'cascade'});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x168')});db[_0x4c62('0x167')]['hasMany'](db['FaxInteraction'],{'as':_0x4c62('0x169')});db['FaxAccount'][_0x4c62('0x10b')](db[_0x4c62('0x4a')],{'as':_0x4c62('0x133')});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x4d')],{'as':_0x4c62('0x155')});db[_0x4c62('0x167')][_0x4c62('0x115')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x167')][_0x4c62('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x4c62('0x167')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x12c')});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x12')],{'onDelete':'restrict'});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x4f')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x167')],{'onDelete':_0x4c62('0x150')});db['FaxApplication'][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x4c')][_0x4c62('0x10b')](db[_0x4c62('0x4d')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0x4c62('0x167')],{'as':_0x4c62('0x15a'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x4c')][_0x4c62('0x115')](db['User'],{'as':'Owner','foreignKey':_0x4c62('0x10a')});db['FaxInteraction'][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x16a'),'as':_0x4c62('0x15d')});db[_0x4c62('0x4c')]['belongsToMany'](db['Tag'],{'through':_0x4c62('0x16a'),'as':_0x4c62('0x15e')});db[_0x4c62('0x4c')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x16b'),'foreignKey':_0x4c62('0x16c')});db[_0x4c62('0x4d')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x12')});db[_0x4c62('0x4d')]['belongsTo'](db[_0x4c62('0x4c')],{'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x16c')});db['FaxMessage'][_0x4c62('0x115')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x4c62('0x4d')]['belongsTo'](db[_0x4c62('0xe4')],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x4d')][_0x4c62('0x115')](db['FaxAccount'],{'as':_0x4c62('0x15a'),'foreignKey':'FaxAccountId'});db[_0x4c62('0x4f')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x126')});db[_0x4c62('0x4f')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':'team_has_fax_queues','as':_0x4c62('0x144')});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x167')],{});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x51')]['belongsTo'](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x4c')],{});db['FaxQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x4d')],{});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db['FaxQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x4f')],{});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x16e'),'onDelete':'cascade'});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':'SmsAccountId'});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x16f')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x16e')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x4c62('0x169')});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x55')],{'as':'Applications'});db[_0x4c62('0x53')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db['SmsAccount'][_0x4c62('0x115')](db[_0x4c62('0x170')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c62('0x141')});db['SmsAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x130')});db[_0x4c62('0x55')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db[_0x4c62('0x59')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db['SmsAccount'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x55')]['belongsTo'](db['Tag'],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x56')][_0x4c62('0x10b')](db[_0x4c62('0x16f')],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':'SmsInteractionId'});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'as':'Account','foreignKey':_0x4c62('0x16e')});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x4c62('0x56')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x171'),'as':_0x4c62('0x15d')});db[_0x4c62('0x56')][_0x4c62('0x117')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x4c62('0x56')]['belongsToMany'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x11f'),'foreignKey':_0x4c62('0x172')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':'Contact'});db[_0x4c62('0x16f')]['belongsTo'](db[_0x4c62('0x56')],{'onDelete':'cascade','as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x172')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'as':'Account','foreignKey':_0x4c62('0x16e')});db['SmsQueue'][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x128'),'foreignKey':_0x4c62('0x173')});db['SmsQueue'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x174'),'as':_0x4c62('0x144')});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x175'),'onDelete':_0x4c62('0x107')});db['OpenchannelAccount']['hasMany'](db[_0x4c62('0x7f')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x5f')],{'as':_0x4c62('0x169'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x176')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x5d')],{'as':_0x4c62('0x133'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5b')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x4c62('0x115')](db[_0x4c62('0x170')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c62('0x141')});db[_0x4c62('0x5b')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x150')});db['OpenchannelApplication'][_0x4c62('0x115')](db[_0x4c62('0x62')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x177')});db[_0x4c62('0x5d')]['belongsTo'](db[_0x4c62('0x5b')],{'onDelete':_0x4c62('0x150'),'foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':'restrict','foreignKey':_0x4c62('0x165')});db[_0x4c62('0x5f')]['hasMany'](db[_0x4c62('0x176')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x4c62('0x5f')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5f')][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId'});db[_0x4c62('0x5f')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':'UserId'});db[_0x4c62('0x5f')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x178'),'as':_0x4c62('0x15d')});db['OpenchannelInteraction']['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x178'),'as':_0x4c62('0x15e')});db[_0x4c62('0x5f')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x15f'),'through':'user_has_openchannel_interactions','foreignKey':_0x4c62('0x179')});db[_0x4c62('0x176')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x107'),'as':'User'});db[_0x4c62('0x176')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db['OpenchannelMessage']['belongsTo'](db[_0x4c62('0x5f')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x179')});db[_0x4c62('0x176')]['belongsTo'](db[_0x4c62('0xe4')],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x176')]['belongsTo'](db[_0x4c62('0x5b')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x62')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x36'),'foreignKey':_0x4c62('0x177')});db[_0x4c62('0x62')]['belongsToMany'](db[_0x4c62('0x11c')],{'through':_0x4c62('0x17a'),'as':_0x4c62('0x144')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x162'),'onDelete':'cascade'});db['ChatWebsite'][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x162')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x6f')],{'as':_0x4c62('0x17b')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x169')});db[_0x4c62('0x64')]['hasMany'](db[_0x4c62('0x66')],{'as':_0x4c62('0x133')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x69')],{'as':_0x4c62('0x155')});db[_0x4c62('0x64')][_0x4c62('0x115')](db['CmList'],{'as':'List','foreignKey':_0x4c62('0x157')});db[_0x4c62('0x64')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'as':_0x4c62('0x13e'),'foreignKey':'IntervalId'});db[_0x4c62('0x64')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{'as':_0x4c62('0x3c'),'foreignKey':'MailAccountId'});db['ChatWebsite']['belongsTo'](db[_0x4c62('0x170')],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['ChatWebsite'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x17c')});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x5b')],{});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0x5f')],{});db['OpenchannelQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x176')],{});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x12')],{});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x62')],{});db[_0x4c62('0x66')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x17e'),'foreignKey':_0x4c62('0x10a'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')][_0x4c62('0x115')](db[_0x4c62('0x6c')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')]['belongsTo'](db[_0x4c62('0x64')],{'as':'Website','foreignKey':_0x4c62('0x162'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':'restrict','foreignKey':_0x4c62('0x165')});db[_0x4c62('0x67')][_0x4c62('0x10b')](db[_0x4c62('0x69')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x17f')});db['ChatInteraction'][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x15a'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x67')]['belongsTo'](db['User'],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x67')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x180'),'as':_0x4c62('0x15d')});db[_0x4c62('0x67')]['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x180'),'as':_0x4c62('0x15e')});db[_0x4c62('0x67')][_0x4c62('0x117')](db['User'],{'as':'Users','through':_0x4c62('0x11e'),'foreignKey':'ChatInteractionId'});db[_0x4c62('0x69')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x12')});db['ChatMessage'][_0x4c62('0x115')](db['CmContact'],{'onDelete':'cascade','as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x69')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x17f')});db[_0x4c62('0x69')][_0x4c62('0x115')](db['Attachment'],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x69')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':'Account','foreignKey':_0x4c62('0x162')});db[_0x4c62('0x181')][_0x4c62('0x10b')](db[_0x4c62('0xe4')],{'as':'Attachments','foreignKey':_0x4c62('0x163'),'onDelete':'cascade','hooks':!![]});db[_0x4c62('0x181')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':'Contact','foreignKey':_0x4c62('0x14e')});db['ChatOfflineMessage'][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x15a'),'foreignKey':'ChatWebsiteId'});db[_0x4c62('0x6c')][_0x4c62('0x117')](db['User'],{'as':'Agents','through':_0x4c62('0x30'),'hooks':!![]});db[_0x4c62('0x6c')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x182'),'as':_0x4c62('0x144')});db[_0x4c62('0x118')]['hasMany'](db[_0x4c62('0x183')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x184'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x118')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Members','through':_0x4c62('0x185')});db[_0x4c62('0x6f')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x186'),'foreignKey':_0x4c62('0x162')});db[_0x4c62('0x187')][_0x4c62('0x10b')](db[_0x4c62('0x72')],{'as':_0x4c62('0x119'),'foreignKey':_0x4c62('0x188')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x8d')],{'as':_0x4c62('0x189'),'foreignKey':_0x4c62('0x18a')});db['CmContact']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')]['hasMany'](db['ReportAgentPreview'],{'as':_0x4c62('0x10e'),'foreignKey':_0x4c62('0x14e')});db['CmContact'][_0x4c62('0x10b')](db[_0x4c62('0xd1')],{'as':_0x4c62('0x18b'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x5f')],{'as':_0x4c62('0x18c'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db['CmContact']['hasMany'](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'foreignKey':_0x4c62('0x14e'),'onDelete':'restrict'});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x4c')],{'as':_0x4c62('0x111'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db['MailInteraction'],{'as':_0x4c62('0x112'),'foreignKey':'ContactId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x115')](db[_0x4c62('0x187')],{'as':_0x4c62('0x18d'),'foreignKey':_0x4c62('0x188')});db[_0x4c62('0x72')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x72')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':'cm_user_has_contacts'});db[_0x4c62('0x72')]['belongsToMany'](db['Tag'],{'as':'Tags','through':_0x4c62('0x18e')});db[_0x4c62('0x72')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x18e'),'as':_0x4c62('0x15e')});db[_0x4c62('0x73')][_0x4c62('0x10b')](db[_0x4c62('0x18f')],{'as':_0x4c62('0x190'),'foreignKey':'CmHopperId'});db['CmHopper'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157'),'onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db['User'],{'as':_0x4c62('0x17e'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0x1d')],{'as':_0x4c62('0x191'),'foreignKey':'VoiceQueueId','onDelete':_0x4c62('0x107')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':_0x4c62('0xe0'),'foreignKey':_0x4c62('0x192'),'onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x193')});db['CmHopperBlack'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x107')});db['CmHopperBlack'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':'List','foreignKey':'ListId','onDelete':_0x4c62('0x107')});db[_0x4c62('0x75')][_0x4c62('0x115')](db['VoiceQueue'],{'as':_0x4c62('0x191'),'foreignKey':_0x4c62('0x136'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x75')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x4c62('0x192'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db[_0x4c62('0x194')],{'as':{'plural':_0x4c62('0x195'),'singular':_0x4c62('0x196')},'foreignKey':_0x4c62('0x197'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db['Condition'],{'as':{'plural':'Any','singular':_0x4c62('0x198')},'foreignKey':_0x4c62('0x199'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db['Action'],{'as':'Actions','foreignKey':_0x4c62('0x19a'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x81')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':'Dispositions','foreignKey':_0x4c62('0x19b'),'onDelete':'cascade'});db['Interval']['hasMany'](db[_0x4c62('0x13e')],{'as':_0x4c62('0x19c'),'foreignKey':_0x4c62('0x13f'),'onDelete':_0x4c62('0x107'),'hooks':!![],'required':![]});db[_0x4c62('0x13e')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x10d'),'foreignKey':_0x4c62('0x13f'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x13e')][_0x4c62('0x10b')](db[_0x4c62('0x164')],{'as':'MailApplications','foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x13e')]['hasMany'](db[_0x4c62('0x66')],{'as':'ChatApplications','foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x13e')]['hasMany'](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x4c62('0x13f')});db['Interval'][_0x4c62('0x10b')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x4c62('0x13f')});db['Schedule']['belongsTo'](db[_0x4c62('0x3c')],{});db[_0x4c62('0x86')][_0x4c62('0x115')](db['AnalyticDefaultReport'],{'foreignKey':_0x4c62('0x19d')});db[_0x4c62('0x86')][_0x4c62('0x115')](db[_0x4c62('0x19e')],{'foreignKey':_0x4c62('0x19f')});db[_0x4c62('0x87')][_0x4c62('0x117')](db[_0x4c62('0x1b')],{'as':_0x4c62('0x1a0'),'through':'moh_has_sounds','onDelete':_0x4c62('0x150')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x72')],{'through':'cm_contact_has_tags'});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x67')],{'through':_0x4c62('0x180')});db['Tag']['belongsToMany'](db[_0x4c62('0x41')],{'through':_0x4c62('0x15c')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x56')],{'through':_0x4c62('0x171')});db[_0x4c62('0x89')]['belongsToMany'](db['FaxInteraction'],{'through':_0x4c62('0x16a')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x5f')],{'through':_0x4c62('0x178')});db['Tag'][_0x4c62('0x117')](db[_0x4c62('0xf9')],{'through':_0x4c62('0x1a1')});db[_0x4c62('0x8d')]['belongsTo'](db[_0x4c62('0x8b')],{'as':_0x4c62('0x1a2'),'foreignKey':'ItemTypeId'});db[_0x4c62('0x18f')][_0x4c62('0x115')](db['CmHopper'],{'as':_0x4c62('0x1a3'),'foreignKey':_0x4c62('0x1a4')});db['CmContactHasItem'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x18a')});db[_0x4c62('0x92')][_0x4c62('0x10b')](db[_0x4c62('0x194')],{'as':{'plural':_0x4c62('0x1a5'),'singular':_0x4c62('0x1a6')},'foreignKey':'TriggerAllId','onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x92')][_0x4c62('0x10b')](db['Condition'],{'as':{'plural':_0x4c62('0x1a7'),'singular':'AnyCondition'},'foreignKey':_0x4c62('0x1a8'),'onDelete':'cascade','hooks':!![]});db[_0x4c62('0x92')][_0x4c62('0x10b')](db['Action'],{'as':_0x4c62('0x1a9'),'foreignKey':_0x4c62('0x1aa'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x4c62('0x10b')](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x19f'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x4c62('0x9d')]['hasMany'](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':'MetricId'});db[_0x4c62('0x9f')][_0x4c62('0x115')](db[_0x4c62('0x9d')],{'foreignKey':_0x4c62('0x1ac')});db[_0x4c62('0xa1')][_0x4c62('0x10b')](db[_0x4c62('0xa3')],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db['SalesforceField'],{'as':'Subjects','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b0'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xa3')]['belongsTo'](db[_0x4c62('0xa1')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db['SalesforceField'][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['SalesforceField'][_0x4c62('0x10b')](db['SalesforceField'],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xa4')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xa4')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':'Variable','foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xa6')]['hasMany'](db[_0x4c62('0xa8')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x4c62('0xa8')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':'Subjects','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xa8')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db['SugarcrmConfiguration']['hasMany'](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x4c62('0x115')](db[_0x4c62('0xa6')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xaa')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['SugarcrmField'][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xaa')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db['SugarcrmField'][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['DeskAccount'][_0x4c62('0x10b')](db[_0x4c62('0x1b7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1b7')][_0x4c62('0x10b')](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db['DeskConfiguration'][_0x4c62('0x10b')](db['DeskField'],{'as':_0x4c62('0x1b0'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db['DeskConfiguration']['hasMany'](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':'FieldId'});db[_0x4c62('0x1b7')]['belongsTo'](db[_0x4c62('0xac')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1b7')]['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x1ba')});db['DeskField']['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4c62('0x1b8')][_0x4c62('0x10b')](db['DeskField'],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db['DeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1b8')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['ZohoAccount'][_0x4c62('0x10b')](db[_0x4c62('0x1bb')],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1bb')]['hasMany'](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1bb')][_0x4c62('0x10b')](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4c62('0x1bb')]['hasMany'](db[_0x4c62('0xb0')],{'as':'Fields','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1bb')][_0x4c62('0x115')](db[_0x4c62('0x1bc')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0xb0')][_0x4c62('0x10b')](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb0')]['hasMany'](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb0')]['hasMany'](db[_0x4c62('0xb0')],{'as':'Field','foreignKey':_0x4c62('0x1b2')});db['ZohoField'][_0x4c62('0x115')](db['Variable'],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xb2')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db['ZendeskConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':'Subjects','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb4')]['hasMany'](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1b0'),'foreignKey':'DescriptionId'});db[_0x4c62('0xb4')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1ab'),'foreignKey':'FieldId'});db[_0x4c62('0xb4')]['belongsTo'](db[_0x4c62('0xb2')],{'as':'Account','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xb4')]['belongsToMany'](db['Tag'],{'through':_0x4c62('0x1bd')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':'Subject','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db['ZendeskField'],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xb6')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0x1be')][_0x4c62('0x10b')](db['FreshdeskConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db['FreshdeskConfiguration'][_0x4c62('0x10b')](db['FreshdeskField'],{'as':_0x4c62('0x1b9'),'onDelete':'cascade','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb9')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':'Descriptions','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb9')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':'Fields','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xb9')][_0x4c62('0x115')](db[_0x4c62('0x1be')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0xb9')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1c0')});db['FreshdeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['FreshdeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0x1bf')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b5'),'foreignKey':'FieldId'});db[_0x4c62('0x1bf')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['VtigerAccount'][_0x4c62('0x10b')](db[_0x4c62('0xbd')],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db['VtigerConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b9'),'foreignKey':_0x4c62('0x1af')});db['VtigerConfiguration'][_0x4c62('0x10b')](db['VtigerField'],{'as':_0x4c62('0x1b0'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xbd')][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':'Fields','foreignKey':_0x4c62('0x1b2')});db['VtigerConfiguration']['belongsTo'](db[_0x4c62('0xbb')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xbf')]['hasMany'](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['VtigerField'][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xbf')]['hasMany'](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xbf')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc0')]['hasMany'](db[_0x4c62('0xc2')],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db['ServicenowConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1b9'),'foreignKey':'SubjectId'});db[_0x4c62('0xc2')]['hasMany'](db[_0x4c62('0x1c1')],{'as':'Descriptions','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xc2')][_0x4c62('0x10b')](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1ab'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x4c62('0x115')](db[_0x4c62('0xc0')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0x1c1')][_0x4c62('0x10b')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c1')]['hasMany'](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c1')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc4')]['hasMany'](db[_0x4c62('0xc6')],{'as':'Configurations','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xc4')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':_0x4c62('0x1c2')});db['Dynamics365Configuration'][_0x4c62('0x10b')](db['Dynamics365Field'],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db['Dynamics365Configuration'][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b0'),'onDelete':'cascade','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xc6')][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xc6')][_0x4c62('0x115')](db[_0x4c62('0xc4')],{'as':'Account','foreignKey':_0x4c62('0x1ae')});db['Dynamics365Field'][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c3')]['hasMany'](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b4'),'foreignKey':'DescriptionId'});db[_0x4c62('0x1c3')][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c3')]['belongsTo'](db[_0x4c62('0x93')],{'as':'Variable','foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc8')][_0x4c62('0x10b')](db['FreshsalesConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1c4')][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1b9'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c4')][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1b0'),'foreignKey':_0x4c62('0x1b1')});db['FreshsalesConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1ab'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c4')][_0x4c62('0x115')](db[_0x4c62('0xc8')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1c5')][_0x4c62('0x10b')](db['FreshsalesField'],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['FreshsalesField'][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':'Description','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0x1c5')][_0x4c62('0x10b')](db['FreshsalesField'],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c5')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x64')],{});db['ChatQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x67')],{});db[_0x4c62('0xcd')][_0x4c62('0x115')](db[_0x4c62('0x69')],{});db[_0x4c62('0xcd')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db['ChatQueueReport']['belongsTo'](db[_0x4c62('0x6c')],{});db['ChatInternalMessage'][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1c6')});db[_0x4c62('0x183')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1c7')});db[_0x4c62('0xd1')][_0x4c62('0x10b')](db[_0x4c62('0xcf')],{'foreignKey':_0x4c62('0x1c8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xd1')][_0x4c62('0x10b')](db[_0x4c62('0xce')],{'foreignKey':_0x4c62('0x1c8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xd2')]['belongsTo'](db[_0x4c62('0x53')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xd2')]['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db['SmsQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x56')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x4c62('0x12')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db[_0x4c62('0x59')],{});db[_0x4c62('0xd7')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x4c62('0xd7')][_0x4c62('0x10b')](db[_0x4c62('0xcf')],{'foreignKey':_0x4c62('0x1c9')});db['JscriptyProject'][_0x4c62('0x10b')](db[_0x4c62('0xce')],{'foreignKey':'ProjectId'});db['Team'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x1ca')});db['Team'][_0x4c62('0x117')](db['VoiceQueue'],{'through':_0x4c62('0x102'),'as':'VoiceQueues'});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x3e')],{'through':_0x4c62('0x158'),'as':_0x4c62('0x123')});db[_0x4c62('0x11c')]['belongsToMany'](db[_0x4c62('0x6c')],{'through':_0x4c62('0x182'),'as':_0x4c62('0x124')});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x4f')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0x4c62('0x117')](db['SmsQueue'],{'through':_0x4c62('0x174'),'as':_0x4c62('0x127')});db[_0x4c62('0x11c')]['belongsToMany'](db[_0x4c62('0x62')],{'through':_0x4c62('0x17a'),'as':'OpenchannelQueues'});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x129')],{'through':'team_has_whatsapp_queues','as':_0x4c62('0x12a')});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0xef')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db[_0x4c62('0x73')],{'as':_0x4c62('0x1cb'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db[_0x4c62('0x76')],{'as':_0x4c62('0x137'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db['CmHopperBlack'],{'as':_0x4c62('0x13a'),'foreignKey':_0x4c62('0x192')});db['Campaign']['belongsTo'](db[_0x4c62('0x2a')],{'as':_0x4c62('0x2a'),'foreignKey':'TrunkId'});db[_0x4c62('0xe0')][_0x4c62('0x115')](db[_0x4c62('0x2a')],{'as':_0x4c62('0x13c'),'foreignKey':'TrunkBackupId'});db[_0x4c62('0xe0')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'as':_0x4c62('0x13e'),'foreignKey':_0x4c62('0x13f')});db['Campaign'][_0x4c62('0x115')](db[_0x4c62('0xdc')],{'as':_0x4c62('0xdc'),'foreignKey':_0x4c62('0x1cc')});db[_0x4c62('0xe0')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'as':'Lists','through':_0x4c62('0x1cd')});db[_0x4c62('0xe0')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'as':_0x4c62('0x1ce'),'through':_0x4c62('0x1cf')});db[_0x4c62('0xe4')][_0x4c62('0x115')](db[_0x4c62('0x181')],{'as':_0x4c62('0x181'),'foreignKey':_0x4c62('0x163')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x43')],{});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x41')],{});db[_0x4c62('0x1d0')]['belongsTo'](db[_0x4c62('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x4c62('0x1d1')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x3e')],{'foreignKey':_0x4c62('0x1d6'),'as':_0x4c62('0x1d7')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x4c62('0x1d8')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x69')],{});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x67')],{});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'foreignKey':'FromChatWebsiteId','as':_0x4c62('0x1d1')});db['ChatTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x6c')],{'foreignKey':_0x4c62('0x1d9'),'as':_0x4c62('0x1d7')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'foreignKey':_0x4c62('0x1da'),'as':_0x4c62('0x1d8')});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x4d')],{});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x4c')],{});db['FaxTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x167')],{'foreignKey':_0x4c62('0x1db'),'as':_0x4c62('0x1d1')});db[_0x4c62('0xea')][_0x4c62('0x115')](db['User'],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db['FaxTransferReport'][_0x4c62('0x115')](db['FaxQueue'],{'foreignKey':_0x4c62('0x1dc'),'as':'ToQueue'});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x167')],{'foreignKey':_0x4c62('0x1dd'),'as':_0x4c62('0x1d8')});db['OpenchannelTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x176')],{});db[_0x4c62('0x1de')]['belongsTo'](db[_0x4c62('0x5f')],{});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'foreignKey':_0x4c62('0x1df'),'as':_0x4c62('0x1d1')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db['OpenchannelTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':_0x4c62('0x1d7')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'foreignKey':_0x4c62('0x1e0'),'as':_0x4c62('0x1d8')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['SmsMessage'],{});db['SmsTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x56')],{});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x4c62('0x1d1')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['User'],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x59')],{'foreignKey':_0x4c62('0x1e1'),'as':_0x4c62('0x1d7')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x4c62('0xed')]['hasMany'](db['Disposition'],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x157'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xed')][_0x4c62('0x10b')](db[_0x4c62('0x1e2')],{'as':_0x4c62('0x1e3'),'foreignKey':'ListId'});db[_0x4c62('0xed')][_0x4c62('0x10b')](db['CmContact'],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x4c62('0xed')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x1e4'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')]['hasMany'](db[_0x4c62('0x10e')],{'as':_0x4c62('0x10e'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')][_0x4c62('0x117')](db[_0x4c62('0x1d')],{'as':'Queues','through':_0x4c62('0x1e5')});db[_0x4c62('0xed')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x11b')});db[_0x4c62('0xef')][_0x4c62('0x10b')](db['VoiceExtension'],{'as':_0x4c62('0x10d'),'onDelete':_0x4c62('0x107')});db['VoicePrefix'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x104')});db[_0x4c62('0xef')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x103'),'as':_0x4c62('0x144')});db[_0x4c62('0x1e6')]['hasMany'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'foreignKey':_0x4c62('0x116')});db[_0x4c62('0x1e6')][_0x4c62('0x10b')](db[_0x4c62('0x1e7')],{'as':'UserProfileSections','foreignKey':_0x4c62('0x116'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x1e7')][_0x4c62('0x10b')](db[_0x4c62('0xf2')],{'as':'Resources','foreignKey':_0x4c62('0x1e8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x4c62('0xf5')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x1e9')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0xfb')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x1e9')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0xf9')],{'as':'Interactions'});db[_0x4c62('0xf5')][_0x4c62('0x10b')](db[_0x4c62('0xf7')],{'as':'Applications'});db[_0x4c62('0xf5')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x4c62('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x4c62('0xf7')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x150')});db['WhatsappApplication'][_0x4c62('0x115')](db[_0x4c62('0x129')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0xf7')]['belongsTo'](db[_0x4c62('0xf5')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0xf7')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db['WhatsappApplication'][_0x4c62('0x115')](db['Tag'],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0xf9')][_0x4c62('0x10b')](db[_0x4c62('0xfb')],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ea')});db[_0x4c62('0xf9')][_0x4c62('0x115')](db[_0x4c62('0xf5')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1e9')});db['WhatsappInteraction']['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xf9')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x10a')});db['WhatsappInteraction'][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1a1'),'as':_0x4c62('0x15d')});db[_0x4c62('0xf9')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1a1'),'as':_0x4c62('0x15e')});db[_0x4c62('0xf9')]['belongsToMany'](db[_0x4c62('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x4c62('0xfb')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0xfb')][_0x4c62('0x115')](db['CmContact'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db[_0x4c62('0xfb')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x1ea')});db[_0x4c62('0xfb')][_0x4c62('0x115')](db['WhatsappAccount'],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1e9')});db['WhatsappQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xf5')],{});db[_0x4c62('0xfd')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0xfd')]['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xfd')][_0x4c62('0x115')](db[_0x4c62('0xf9')],{});db['WhatsappQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x129')],{});db[_0x4c62('0xfd')]['belongsTo'](db[_0x4c62('0xfb')],{});db[_0x4c62('0xfd')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db[_0x4c62('0xfb')],{});db['WhatsappTransferReport'][_0x4c62('0x115')](db[_0x4c62('0xf9')],{});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0x4c62('0x115')](db[_0x4c62('0xf5')],{'foreignKey':_0x4c62('0x1ec'),'as':'ToAccount'});db[_0x4c62('0x1eb')]['belongsTo'](db[_0x4c62('0x129')],{'foreignKey':_0x4c62('0x1ed'),'as':_0x4c62('0x1d7')});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':'FromAgent'});db[_0x4c62('0x1eb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x4c62('0x1d5')});db[_0x4c62('0x129')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Agents','through':_0x4c62('0x37'),'foreignKey':_0x4c62('0x1ee')});db[_0x4c62('0x129')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x1ef'),'as':'Teams'});db[_0x4c62('0x108')][_0x4c62('0x115')](db['User'],{'as':'user','foreignKey':_0x4c62('0x10a'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0x4c62('0xc4')],{'as':_0x4c62('0xc4'),'onDelete':_0x4c62('0x150')});db['CloudProvider'][_0x4c62('0x106')](db[_0x4c62('0x39')],{'as':_0x4c62('0x151'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x101')][_0x4c62('0x106')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x4c62('0x150')});module[_0x4c62('0x1f0')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a4c5408..d054bcb 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7800=['/api/variables','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/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/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.1.0','/server/files/plugins','route','get','sendFile','resolve','appPath','express','./config/environment','./utils/client-side-logger','setupLoggers','then','/api/users','./api/user','use','./api/voiceChanSpy','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/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/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','./api/tag','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/triggers','./api/trigger'];(function(_0x3888bc,_0x3539a2){var _0x59d7c1=function(_0x2bb104){while(--_0x2bb104){_0x3888bc['push'](_0x3888bc['shift']());}};_0x59d7c1(++_0x3539a2);}(_0x7800,0x98));var _0x0780=function(_0x263c0d,_0x42fd26){_0x263c0d=_0x263c0d-0x0;var _0xeb8e1c=_0x7800[_0x263c0d];return _0xeb8e1c;};'use strict';var path=require('path');var express=require(_0x0780('0x0'));var errors=require('./errors');var config=require(_0x0780('0x1'));var setupLoggers=require(_0x0780('0x2'))[_0x0780('0x3')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x5748e7){return setupLoggers(_0x5748e7)[_0x0780('0x4')](function(){_0x5748e7['use'](_0x0780('0x5'),require(_0x0780('0x6')));_0x5748e7[_0x0780('0x7')]('/api/voice/chanspy',require(_0x0780('0x8')));_0x5748e7[_0x0780('0x7')]('/api/voice/contexts',require('./api/voiceContext'));_0x5748e7[_0x0780('0x7')](_0x0780('0x9'),require('./api/voiceExtension'));_0x5748e7[_0x0780('0x7')](_0x0780('0xa'),require(_0x0780('0xb')));_0x5748e7[_0x0780('0x7')](_0x0780('0xc'),require(_0x0780('0xd')));_0x5748e7[_0x0780('0x7')]('/api/voice/recordings',require('./api/voiceRecording'));_0x5748e7[_0x0780('0x7')](_0x0780('0xe'),require(_0x0780('0xf')));_0x5748e7[_0x0780('0x7')](_0x0780('0x10'),require(_0x0780('0x11')));_0x5748e7['use'](_0x0780('0x12'),require(_0x0780('0x13')));_0x5748e7['use'](_0x0780('0x14'),require(_0x0780('0x15')));_0x5748e7['use']('/api/voice/dials/reports',require(_0x0780('0x16')));_0x5748e7[_0x0780('0x7')](_0x0780('0x17'),require('./api/voiceAgentReport'));_0x5748e7[_0x0780('0x7')](_0x0780('0x18'),require(_0x0780('0x19')));_0x5748e7['use'](_0x0780('0x1a'),require(_0x0780('0x1b')));_0x5748e7['use'](_0x0780('0x1c'),require(_0x0780('0x1d')));_0x5748e7['use'](_0x0780('0x1e'),require('./api/voiceTransferReport'));_0x5748e7[_0x0780('0x7')]('/api/mail/out_servers',require(_0x0780('0x1f')));_0x5748e7[_0x0780('0x7')](_0x0780('0x20'),require(_0x0780('0x21')));_0x5748e7[_0x0780('0x7')](_0x0780('0x22'),require(_0x0780('0x23')));_0x5748e7[_0x0780('0x7')](_0x0780('0x24'),require(_0x0780('0x25')));_0x5748e7['use'](_0x0780('0x26'),require(_0x0780('0x27')));_0x5748e7[_0x0780('0x7')]('/api/mail/messages',require(_0x0780('0x28')));_0x5748e7[_0x0780('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x5748e7['use'](_0x0780('0x29'),require(_0x0780('0x2a')));_0x5748e7[_0x0780('0x7')](_0x0780('0x2b'),require(_0x0780('0x2c')));_0x5748e7[_0x0780('0x7')](_0x0780('0x2d'),require(_0x0780('0x2e')));_0x5748e7[_0x0780('0x7')](_0x0780('0x2f'),require(_0x0780('0x30')));_0x5748e7[_0x0780('0x7')](_0x0780('0x31'),require(_0x0780('0x32')));_0x5748e7[_0x0780('0x7')](_0x0780('0x33'),require(_0x0780('0x34')));_0x5748e7[_0x0780('0x7')]('/api/fax/messages',require('./api/faxMessage'));_0x5748e7[_0x0780('0x7')]('/api/fax/queues',require(_0x0780('0x35')));_0x5748e7[_0x0780('0x7')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x5748e7['use'](_0x0780('0x36'),require(_0x0780('0x37')));_0x5748e7[_0x0780('0x7')](_0x0780('0x38'),require('./api/smsApplication'));_0x5748e7[_0x0780('0x7')](_0x0780('0x39'),require(_0x0780('0x3a')));_0x5748e7[_0x0780('0x7')](_0x0780('0x3b'),require(_0x0780('0x3c')));_0x5748e7['use'](_0x0780('0x3d'),require('./api/smsQueue'));_0x5748e7[_0x0780('0x7')]('/api/openchannel/accounts',require(_0x0780('0x3e')));_0x5748e7[_0x0780('0x7')](_0x0780('0x3f'),require('./api/openchannelApplication'));_0x5748e7[_0x0780('0x7')](_0x0780('0x40'),require('./api/openchannelInteraction'));_0x5748e7[_0x0780('0x7')](_0x0780('0x41'),require(_0x0780('0x42')));_0x5748e7[_0x0780('0x7')](_0x0780('0x43'),require(_0x0780('0x44')));_0x5748e7[_0x0780('0x7')](_0x0780('0x45'),require(_0x0780('0x46')));_0x5748e7[_0x0780('0x7')](_0x0780('0x47'),require(_0x0780('0x48')));_0x5748e7[_0x0780('0x7')](_0x0780('0x49'),require(_0x0780('0x4a')));_0x5748e7['use'](_0x0780('0x4b'),require(_0x0780('0x4c')));_0x5748e7[_0x0780('0x7')]('/api/chat/messages',require(_0x0780('0x4d')));_0x5748e7[_0x0780('0x7')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x5748e7[_0x0780('0x7')](_0x0780('0x4e'),require(_0x0780('0x4f')));_0x5748e7[_0x0780('0x7')](_0x0780('0x50'),require(_0x0780('0x51')));_0x5748e7[_0x0780('0x7')]('/api/chat/proactive_actions',require(_0x0780('0x52')));_0x5748e7[_0x0780('0x7')]('/api/cm/companies',require(_0x0780('0x53')));_0x5748e7[_0x0780('0x7')](_0x0780('0x54'),require(_0x0780('0x55')));_0x5748e7[_0x0780('0x7')](_0x0780('0x56'),require(_0x0780('0x57')));_0x5748e7['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x5748e7['use'](_0x0780('0x58'),require(_0x0780('0x59')));_0x5748e7[_0x0780('0x7')]('/api/cm/hopper_history',require(_0x0780('0x5a')));_0x5748e7['use'](_0x0780('0x5b'),require('./api/cmCustomField'));_0x5748e7['use'](_0x0780('0x5c'),require(_0x0780('0x5d')));_0x5748e7[_0x0780('0x7')](_0x0780('0x5e'),require(_0x0780('0x5f')));_0x5748e7['use']('/api/canned_answers',require(_0x0780('0x60')));_0x5748e7['use'](_0x0780('0x61'),require(_0x0780('0x62')));_0x5748e7['use'](_0x0780('0x63'),require(_0x0780('0x64')));_0x5748e7[_0x0780('0x7')](_0x0780('0x65'),require('./api/interval'));_0x5748e7[_0x0780('0x7')](_0x0780('0x66'),require(_0x0780('0x67')));_0x5748e7[_0x0780('0x7')](_0x0780('0x68'),require('./api/cdr'));_0x5748e7[_0x0780('0x7')](_0x0780('0x69'),require('./api/voiceQueuesLog'));_0x5748e7[_0x0780('0x7')](_0x0780('0x6a'),require(_0x0780('0x6b')));_0x5748e7[_0x0780('0x7')]('/api/sounds',require('./api/sound'));_0x5748e7['use'](_0x0780('0x6c'),require(_0x0780('0x6d')));_0x5748e7['use']('/api/contact_item_types',require(_0x0780('0x6e')));_0x5748e7[_0x0780('0x7')]('/api/cm_contact_has_items',require(_0x0780('0x6f')));_0x5748e7['use'](_0x0780('0x70'),require(_0x0780('0x71')));_0x5748e7[_0x0780('0x7')]('/api/templates',require('./api/template'));_0x5748e7[_0x0780('0x7')](_0x0780('0x72'),require(_0x0780('0x73')));_0x5748e7['use'](_0x0780('0x74'),require('./api/variable'));_0x5748e7[_0x0780('0x7')]('/api/integrations',require(_0x0780('0x75')));_0x5748e7[_0x0780('0x7')](_0x0780('0x76'),require('./api/integrationReport'));_0x5748e7[_0x0780('0x7')](_0x0780('0x77'),require(_0x0780('0x78')));_0x5748e7[_0x0780('0x7')]('/api/analytics/default_reports',require(_0x0780('0x79')));_0x5748e7[_0x0780('0x7')]('/api/analytics/extracted_reports',require(_0x0780('0x7a')));_0x5748e7[_0x0780('0x7')]('/api/analytics/metrics',require(_0x0780('0x7b')));_0x5748e7[_0x0780('0x7')](_0x0780('0x7c'),require(_0x0780('0x7d')));_0x5748e7[_0x0780('0x7')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x5748e7[_0x0780('0x7')]('/api/integrations/salesforce/accounts',require(_0x0780('0x7e')));_0x5748e7[_0x0780('0x7')](_0x0780('0x7f'),require(_0x0780('0x80')));_0x5748e7['use'](_0x0780('0x81'),require(_0x0780('0x82')));_0x5748e7['use'](_0x0780('0x83'),require(_0x0780('0x84')));_0x5748e7['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x5748e7[_0x0780('0x7')]('/api/integrations/sugarcrm/fields',require(_0x0780('0x85')));_0x5748e7['use'](_0x0780('0x86'),require(_0x0780('0x87')));_0x5748e7[_0x0780('0x7')](_0x0780('0x88'),require('./api/intDeskConfiguration'));_0x5748e7[_0x0780('0x7')](_0x0780('0x89'),require(_0x0780('0x8a')));_0x5748e7[_0x0780('0x7')](_0x0780('0x8b'),require(_0x0780('0x8c')));_0x5748e7[_0x0780('0x7')](_0x0780('0x8d'),require(_0x0780('0x8e')));_0x5748e7[_0x0780('0x7')](_0x0780('0x8f'),require(_0x0780('0x90')));_0x5748e7[_0x0780('0x7')](_0x0780('0x91'),require('./api/intZendeskAccount'));_0x5748e7['use'](_0x0780('0x92'),require(_0x0780('0x93')));_0x5748e7['use'](_0x0780('0x94'),require('./api/intZendeskField'));_0x5748e7[_0x0780('0x7')](_0x0780('0x95'),require('./api/intFreshdeskAccount'));_0x5748e7['use'](_0x0780('0x96'),require(_0x0780('0x97')));_0x5748e7[_0x0780('0x7')](_0x0780('0x98'),require('./api/intFreshdeskField'));_0x5748e7['use'](_0x0780('0x99'),require(_0x0780('0x9a')));_0x5748e7[_0x0780('0x7')]('/api/integrations/vtiger/configurations',require(_0x0780('0x9b')));_0x5748e7[_0x0780('0x7')]('/api/integrations/vtiger/fields',require(_0x0780('0x9c')));_0x5748e7['use'](_0x0780('0x9d'),require(_0x0780('0x9e')));_0x5748e7[_0x0780('0x7')](_0x0780('0x9f'),require('./api/intServicenowConfiguration'));_0x5748e7[_0x0780('0x7')](_0x0780('0xa0'),require(_0x0780('0xa1')));_0x5748e7[_0x0780('0x7')](_0x0780('0xa2'),require(_0x0780('0xa3')));_0x5748e7[_0x0780('0x7')](_0x0780('0xa4'),require(_0x0780('0xa5')));_0x5748e7[_0x0780('0x7')](_0x0780('0xa6'),require('./api/intDynamics365Field'));_0x5748e7['use']('/api/integrations/freshsales/accounts',require(_0x0780('0xa7')));_0x5748e7[_0x0780('0x7')](_0x0780('0xa8'),require(_0x0780('0xa9')));_0x5748e7[_0x0780('0x7')](_0x0780('0xaa'),require(_0x0780('0xab')));_0x5748e7['use'](_0x0780('0xac'),require(_0x0780('0xad')));_0x5748e7[_0x0780('0x7')](_0x0780('0xae'),require('./api/chatQueueReport'));_0x5748e7[_0x0780('0x7')](_0x0780('0xaf'),require(_0x0780('0xb0')));_0x5748e7[_0x0780('0x7')](_0x0780('0xb1'),require(_0x0780('0xb2')));_0x5748e7[_0x0780('0x7')](_0x0780('0xb3'),require(_0x0780('0xb4')));_0x5748e7['use'](_0x0780('0xb5'),require(_0x0780('0xb6')));_0x5748e7[_0x0780('0x7')](_0x0780('0xb7'),require(_0x0780('0xb8')));_0x5748e7[_0x0780('0x7')]('/api/square/reports',require(_0x0780('0xb9')));_0x5748e7[_0x0780('0x7')](_0x0780('0xba'),require('./api/squareReportDetail'));_0x5748e7[_0x0780('0x7')](_0x0780('0xbb'),require('./api/jscriptyProject'));_0x5748e7[_0x0780('0x7')](_0x0780('0xbc'),require(_0x0780('0xbd')));_0x5748e7[_0x0780('0x7')](_0x0780('0xbe'),require(_0x0780('0xbf')));_0x5748e7[_0x0780('0x7')](_0x0780('0xc0'),require(_0x0780('0xc1')));_0x5748e7['use'](_0x0780('0xc2'),require('./api/squareRecording'));_0x5748e7[_0x0780('0x7')]('/api/square/messages',require(_0x0780('0xc3')));_0x5748e7[_0x0780('0x7')](_0x0780('0xc4'),require('./api/team'));_0x5748e7[_0x0780('0x7')]('/api/license',require(_0x0780('0xc5')));_0x5748e7[_0x0780('0x7')](_0x0780('0xc6'),require(_0x0780('0xc7')));_0x5748e7[_0x0780('0x7')](_0x0780('0xc8'),require(_0x0780('0xc9')));_0x5748e7[_0x0780('0x7')](_0x0780('0xca'),require(_0x0780('0xcb')));_0x5748e7[_0x0780('0x7')]('/api/plugins',require(_0x0780('0xcc')));_0x5748e7['use'](_0x0780('0xcd'),require(_0x0780('0xce')));_0x5748e7[_0x0780('0x7')](_0x0780('0xcf'),require(_0x0780('0xd0')));_0x5748e7[_0x0780('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x5748e7[_0x0780('0x7')](_0x0780('0xd1'),require(_0x0780('0xd2')));_0x5748e7['use'](_0x0780('0xd3'),require('./api/smsTransferReport'));_0x5748e7[_0x0780('0x7')](_0x0780('0xd4'),require(_0x0780('0xd5')));_0x5748e7[_0x0780('0x7')](_0x0780('0xd6'),require(_0x0780('0xd7')));_0x5748e7[_0x0780('0x7')]('/api/userProfiles',require('./api/userProfile'));_0x5748e7[_0x0780('0x7')](_0x0780('0xd8'),require(_0x0780('0xd9')));_0x5748e7['use'](_0x0780('0xda'),require(_0x0780('0xdb')));_0x5748e7[_0x0780('0x7')](_0x0780('0xdc'),require(_0x0780('0xdd')));_0x5748e7[_0x0780('0x7')](_0x0780('0xde'),require(_0x0780('0xdf')));_0x5748e7[_0x0780('0x7')]('/api/whatsapp/applications',require(_0x0780('0xe0')));_0x5748e7[_0x0780('0x7')]('/api/whatsapp/interactions',require(_0x0780('0xe1')));_0x5748e7['use'](_0x0780('0xe2'),require(_0x0780('0xe3')));_0x5748e7[_0x0780('0x7')](_0x0780('0xe4'),require(_0x0780('0xe5')));_0x5748e7[_0x0780('0x7')](_0x0780('0xe6'),require(_0x0780('0xe7')));_0x5748e7['use'](_0x0780('0xe8'),require(_0x0780('0xe9')));_0x5748e7[_0x0780('0x7')](_0x0780('0xea'),require(_0x0780('0xeb')));_0x5748e7[_0x0780('0x7')](_0x0780('0xec'),require(_0x0780('0xed')));_0x5748e7['use'](_0x0780('0xee'),require(_0x0780('0xef')));_0x5748e7['use'](_0x0780('0xf0'),require(_0x0780('0xf1')));_0x5748e7[_0x0780('0x7')](_0x0780('0xf2'),require(_0x0780('0xf3')));_0x5748e7[_0x0780('0x7')]('/api/auth/activedirectory',require(_0x0780('0xf4')));_0x5748e7[_0x0780('0x7')](_0x0780('0xf5'),require('./api/jira'));_0x5748e7[_0x0780('0x7')]('/api/rpc',require('./api/rpc'));_0x5748e7[_0x0780('0x7')](_0x0780('0xf6'),require(_0x0780('0xf7')));_0x5748e7[_0x0780('0x7')](_0x0780('0xf8'),require(_0x0780('0xf9')));_0x5748e7['use']('/api/pm2',require(_0x0780('0xfa')));_0x5748e7['use']('/api/webbar',require(_0x0780('0xfb')));_0x5748e7['use'](_0x0780('0xfc'),clientSideLogs);_0x5748e7[_0x0780('0x7')](_0x0780('0xfd'),express[_0x0780('0xfe')](path[_0x0780('0xff')](config[_0x0780('0x100')],_0x0780('0xfd'))));_0x5748e7[_0x0780('0x7')](_0x0780('0x101'),express[_0x0780('0xfe')](path['join'](config[_0x0780('0x100')],_0x0780('0x101'))));_0x5748e7[_0x0780('0x7')](_0x0780('0x102'),express[_0x0780('0xfe')](path[_0x0780('0xff')](config[_0x0780('0x100')],_0x0780('0x102'))));_0x5748e7['use'](_0x0780('0x103'),express['static'](path[_0x0780('0xff')](config['root'],_0x0780('0x104'),_0x0780('0x105'))));_0x5748e7[_0x0780('0x7')]('/plugins',express[_0x0780('0xfe')](path[_0x0780('0xff')](config[_0x0780('0x100')],_0x0780('0x106'))));_0x5748e7[_0x0780('0x107')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0780('0x108')](errors[0x194]);_0x5748e7['route']('/*')[_0x0780('0x108')](function(_0x424e7e,_0x1dba27){_0x1dba27[_0x0780('0x109')](path[_0x0780('0x10a')](_0x5748e7[_0x0780('0x108')](_0x0780('0x10b'))+'/index.html'));});return _0x5748e7;});}; \ No newline at end of file +var _0xd89c=['/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./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/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/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','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd89c,0x118));var _0xcd89=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd89c[_0x164eca];return _0x2ce562;};'use strict';var path=require(_0xcd89('0x0'));var express=require(_0xcd89('0x1'));var errors=require(_0xcd89('0x2'));var config=require(_0xcd89('0x3'));var setupLoggers=require(_0xcd89('0x4'))[_0xcd89('0x5')];var clientSideLogs=require(_0xcd89('0x6'));exports[_0xcd89('0x7')]=function(_0x6f63ed){return setupLoggers(_0x6f63ed)[_0xcd89('0x8')](function(){_0x6f63ed[_0xcd89('0x9')]('/api/users',require('./api/user'));_0x6f63ed['use'](_0xcd89('0xa'),require(_0xcd89('0xb')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc'),require(_0xcd89('0xd')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe'),require(_0xcd89('0xf')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10'),require(_0xcd89('0x11')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x12'),require(_0xcd89('0x13')));_0x6f63ed['use']('/api/voice/recordings',require(_0xcd89('0x14')));_0x6f63ed[_0xcd89('0x9')]('/api/screen/recordings',require(_0xcd89('0x15')));_0x6f63ed['use'](_0xcd89('0x16'),require(_0xcd89('0x17')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x18'),require(_0xcd89('0x19')));_0x6f63ed['use']('/api/voice/calls/reports',require(_0xcd89('0x1a')));_0x6f63ed['use'](_0xcd89('0x1b'),require(_0xcd89('0x1c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x1d'),require(_0xcd89('0x1e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x1f'),require(_0xcd89('0x20')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x21'),require(_0xcd89('0x22')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x23'),require('./api/trunk'));_0x6f63ed[_0xcd89('0x9')]('/api/voice/transfers/reports',require(_0xcd89('0x24')));_0x6f63ed[_0xcd89('0x9')]('/api/mail/out_servers',require(_0xcd89('0x25')));_0x6f63ed['use']('/api/mail/accounts',require(_0xcd89('0x26')));_0x6f63ed['use'](_0xcd89('0x27'),require(_0xcd89('0x28')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x29'),require(_0xcd89('0x2a')));_0x6f63ed['use'](_0xcd89('0x2b'),require('./api/mailInteraction'));_0x6f63ed[_0xcd89('0x9')]('/api/mail/messages',require(_0xcd89('0x2c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x2d'),require(_0xcd89('0x2e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x2f'),require(_0xcd89('0x30')));_0x6f63ed[_0xcd89('0x9')]('/api/dashboards',require(_0xcd89('0x31')));_0x6f63ed[_0xcd89('0x9')]('/api/dashboards/items',require(_0xcd89('0x32')));_0x6f63ed['use'](_0xcd89('0x33'),require(_0xcd89('0x34')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x35'),require(_0xcd89('0x36')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x37'),require(_0xcd89('0x38')));_0x6f63ed[_0xcd89('0x9')]('/api/fax/messages',require(_0xcd89('0x39')));_0x6f63ed[_0xcd89('0x9')]('/api/fax/queues',require(_0xcd89('0x3a')));_0x6f63ed['use'](_0xcd89('0x3b'),require(_0xcd89('0x3c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x3d'),require(_0xcd89('0x3e')));_0x6f63ed['use'](_0xcd89('0x3f'),require('./api/smsApplication'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x40'),require(_0xcd89('0x41')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x42'),require(_0xcd89('0x43')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x44'),require('./api/smsQueue'));_0x6f63ed[_0xcd89('0x9')]('/api/openchannel/accounts',require(_0xcd89('0x45')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x46'),require(_0xcd89('0x47')));_0x6f63ed[_0xcd89('0x9')]('/api/openchannel/interactions',require(_0xcd89('0x48')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x49'),require(_0xcd89('0x4a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4b'),require(_0xcd89('0x4c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4d'),require(_0xcd89('0x4e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4f'),require(_0xcd89('0x50')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x51'),require(_0xcd89('0x52')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x53'),require(_0xcd89('0x54')));_0x6f63ed['use'](_0xcd89('0x55'),require(_0xcd89('0x56')));_0x6f63ed['use'](_0xcd89('0x57'),require(_0xcd89('0x58')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x59'),require(_0xcd89('0x5a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x5b'),require(_0xcd89('0x5c')));_0x6f63ed['use'](_0xcd89('0x5d'),require(_0xcd89('0x5e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x5f'),require(_0xcd89('0x60')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x61'),require(_0xcd89('0x62')));_0x6f63ed['use'](_0xcd89('0x63'),require(_0xcd89('0x64')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x65'),require('./api/cmHopperBlack'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x66'),require('./api/cmHopperFinal'));_0x6f63ed['use'](_0xcd89('0x67'),require('./api/cmHopperHistory'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x68'),require(_0xcd89('0x69')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x6a'),require(_0xcd89('0x6b')));_0x6f63ed[_0xcd89('0x9')]('/api/automations',require(_0xcd89('0x6c')));_0x6f63ed['use'](_0xcd89('0x6d'),require(_0xcd89('0x6e')));_0x6f63ed['use'](_0xcd89('0x6f'),require(_0xcd89('0x70')));_0x6f63ed[_0xcd89('0x9')]('/api/conditions',require(_0xcd89('0x71')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x72'),require('./api/interval'));_0x6f63ed[_0xcd89('0x9')]('/api/pauses',require(_0xcd89('0x73')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x74'),require(_0xcd89('0x75')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x76'),require(_0xcd89('0x77')));_0x6f63ed['use']('/api/schedules',require('./api/schedule'));_0x6f63ed[_0xcd89('0x9')]('/api/sounds',require('./api/sound'));_0x6f63ed['use']('/api/tags',require(_0xcd89('0x78')));_0x6f63ed[_0xcd89('0x9')]('/api/contact_item_types',require(_0xcd89('0x79')));_0x6f63ed['use'](_0xcd89('0x7a'),require(_0xcd89('0x7b')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x7c'),require(_0xcd89('0x7d')));_0x6f63ed['use'](_0xcd89('0x7e'),require(_0xcd89('0x7f')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x80'),require(_0xcd89('0x81')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x82'),require(_0xcd89('0x83')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x84'),require(_0xcd89('0x85')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x86'),require(_0xcd89('0x87')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x88'),require(_0xcd89('0x89')));_0x6f63ed['use']('/api/analytics/default_reports',require(_0xcd89('0x8a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8b'),require(_0xcd89('0x8c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8d'),require(_0xcd89('0x8e')));_0x6f63ed[_0xcd89('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8f'),require('./api/analyticTreeReport'));_0x6f63ed['use'](_0xcd89('0x90'),require(_0xcd89('0x91')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x92'),require('./api/intSalesforceConfiguration'));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/salesforce/fields',require(_0xcd89('0x93')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x94'),require(_0xcd89('0x95')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x96'),require(_0xcd89('0x97')));_0x6f63ed['use']('/api/integrations/sugarcrm/fields',require(_0xcd89('0x98')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x99'),require('./api/intDeskAccount'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9a'),require('./api/intDeskConfiguration'));_0x6f63ed['use'](_0xcd89('0x9b'),require(_0xcd89('0x9c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9d'),require(_0xcd89('0x9e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9f'),require(_0xcd89('0xa0')));_0x6f63ed['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa1'),require('./api/intZendeskAccount'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa2'),require('./api/intZendeskConfiguration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa3'),require(_0xcd89('0xa4')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa5'),require(_0xcd89('0xa6')));_0x6f63ed['use'](_0xcd89('0xa7'),require(_0xcd89('0xa8')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa9'),require(_0xcd89('0xaa')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xab'),require(_0xcd89('0xac')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xad'),require(_0xcd89('0xae')));_0x6f63ed['use'](_0xcd89('0xaf'),require(_0xcd89('0xb0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb1'),require(_0xcd89('0xb2')));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/servicenow/configurations',require(_0xcd89('0xb3')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb4'),require('./api/intServicenowField'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb5'),require(_0xcd89('0xb6')));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb7'),require(_0xcd89('0xb8')));_0x6f63ed['use'](_0xcd89('0xb9'),require(_0xcd89('0xba')));_0x6f63ed['use']('/api/integrations/freshsales/configurations',require(_0xcd89('0xbb')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xbc'),require(_0xcd89('0xbd')));_0x6f63ed[_0xcd89('0x9')]('/api/networks',require(_0xcd89('0xbe')));_0x6f63ed['use'](_0xcd89('0xbf'),require(_0xcd89('0xc0')));_0x6f63ed[_0xcd89('0x9')]('/api/chat/internal/messages',require(_0xcd89('0xc1')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc2'),require('./api/jscriptyAnswerReport'));_0x6f63ed[_0xcd89('0x9')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc3'),require(_0xcd89('0xc4')));_0x6f63ed['use'](_0xcd89('0xc5'),require(_0xcd89('0xc6')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc7'),require(_0xcd89('0xc8')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc9'),require(_0xcd89('0xca')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xcb'),require(_0xcd89('0xcc')));_0x6f63ed['use'](_0xcd89('0xcd'),require(_0xcd89('0xce')));_0x6f63ed[_0xcd89('0x9')]('/api/square/odbc',require('./api/squareOdbc'));_0x6f63ed['use'](_0xcd89('0xcf'),require(_0xcd89('0xd0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd1'),require(_0xcd89('0xd2')));_0x6f63ed[_0xcd89('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd3'),require(_0xcd89('0xd4')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd5'),require('./api/license'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd6'),require('./api/campaign'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd7'),require('./api/migration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd8'),require(_0xcd89('0xd9')));_0x6f63ed['use'](_0xcd89('0xda'),require('./api/plugin'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xdb'),require('./api/mailTransferReport'));_0x6f63ed['use'](_0xcd89('0xdc'),require(_0xcd89('0xdd')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xde'),require(_0xcd89('0xdf')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe0'),require(_0xcd89('0xe1')));_0x6f63ed['use']('/api/sms/reports/transfer',require(_0xcd89('0xe2')));_0x6f63ed[_0xcd89('0x9')]('/api/cm/lists',require(_0xcd89('0xe3')));_0x6f63ed['use'](_0xcd89('0xe4'),require(_0xcd89('0xe5')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe6'),require(_0xcd89('0xe7')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe8'),require('./api/userProfileSection'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe9'),require(_0xcd89('0xea')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xeb'),require(_0xcd89('0xec')));_0x6f63ed[_0xcd89('0x9')]('/api/whatsapp/accounts',require(_0xcd89('0xed')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xee'),require(_0xcd89('0xef')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf0'),require('./api/whatsappInteraction'));_0x6f63ed['use'](_0xcd89('0xf1'),require(_0xcd89('0xf2')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf3'),require('./api/whatsappQueueReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf4'),require(_0xcd89('0xf5')));_0x6f63ed[_0xcd89('0x9')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x6f63ed['use'](_0xcd89('0xf6'),require('./api/cloudProvider'));_0x6f63ed['use'](_0xcd89('0xf7'),require(_0xcd89('0xf8')));_0x6f63ed[_0xcd89('0x9')]('/api/user-settings',require(_0xcd89('0xf9')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xfa'),require(_0xcd89('0xfb')));_0x6f63ed[_0xcd89('0x9')]('/api/auth/google',require(_0xcd89('0xfc')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xfd'),require(_0xcd89('0xfe')));_0x6f63ed['use']('/api/jira',require(_0xcd89('0xff')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x100'),require(_0xcd89('0x101')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x102'),require('./api/version'));_0x6f63ed[_0xcd89('0x9')]('/api/system',require(_0xcd89('0x103')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x104'),require(_0xcd89('0x105')));_0x6f63ed['use'](_0xcd89('0x106'),require('./api/webbar'));_0x6f63ed[_0xcd89('0x9')]('/api/logs',clientSideLogs);_0x6f63ed['use'](_0xcd89('0x107'),express[_0xcd89('0x108')](path[_0xcd89('0x109')](config['root'],_0xcd89('0x107'))));_0x6f63ed[_0xcd89('0x9')]('/www',express['static'](path[_0xcd89('0x109')](config[_0xcd89('0x10a')],'/www')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10b'),express['static'](path[_0xcd89('0x109')](config[_0xcd89('0x10a')],_0xcd89('0x10b'))));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10c'),express[_0xcd89('0x108')](path[_0xcd89('0x109')](config['root'],_0xcd89('0x10d'),'3.1.0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10e'),express['static'](path['join'](config[_0xcd89('0x10a')],_0xcd89('0x10f'))));_0x6f63ed[_0xcd89('0x110')](_0xcd89('0x111'))[_0xcd89('0x112')](errors[0x194]);_0x6f63ed['route']('/*')[_0xcd89('0x112')](function(_0x40dbeb,_0x5ee60b){_0x5ee60b[_0xcd89('0x113')](path[_0xcd89('0x114')](_0x6f63ed[_0xcd89('0x112')](_0xcd89('0x115'))+_0xcd89('0x116')));});return _0x6f63ed;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 8673712..33048ba 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7455=['../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc'];(function(_0x74358,_0x288a67){var _0x3fdb7f=function(_0x19b5ec){while(--_0x19b5ec){_0x74358['push'](_0x74358['shift']());}};_0x3fdb7f(++_0x288a67);}(_0x7455,0x197));var _0x5745=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7455[_0x14add3];return _0x4a174f;};'use strict';var jayson=require('jayson/promise');var _=require(_0x5745('0x0'));var config=require(_0x5745('0x1'));exports[_0x5745('0x2')]=function(){return new Promise(function(_0xf80ddb,_0x3b96dd){var _0x439b69={};_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x4')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x5')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x6')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x7')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x8')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x9')));_0x439b69=_['merge'](_0x439b69,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xa')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/memberReport/memberReport.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xb')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xc')));_0x439b69=_['merge'](_0x439b69,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xd')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/mailAccount/mailAccount.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xe')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0xf')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x10')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/mailApplication/mailApplication.rpc'));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x11')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/faxAccount/faxAccount.rpc'));_0x439b69=_['merge'](_0x439b69,require('../api/faxApplication/faxApplication.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x12')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/faxMessage/faxMessage.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x13')));_0x439b69=_['merge'](_0x439b69,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/smsAccount/smsAccount.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x14')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x15')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/smsQueue/smsQueue.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x16')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x17')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x18')));_0x439b69=_['merge'](_0x439b69,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x19')));_0x439b69=_['merge'](_0x439b69,require('../api/chatInteraction/chatInteraction.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x1a')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/chatQueue/chatQueue.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x1b')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x1c')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x1d')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x1e')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x1f')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x439b69=_['merge'](_0x439b69,require('../api/interval/interval.rpc'));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x20')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x21')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x22')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x23')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/trigger/trigger.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x24')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x25')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x26')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x27')));_0x439b69=_['merge'](_0x439b69,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x28')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x29')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x2a')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x2b')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x2c')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x2d')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x2e')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x2f')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x30')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x31')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x32')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x33')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/squareMessage/squareMessage.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require('../api/campaign/campaign.rpc'));_0x439b69=_['merge'](_0x439b69,require('../api/attachment/attachment.rpc'));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x34')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x35')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x36')));_0x439b69=_['merge'](_0x439b69,require(_0x5745('0x37')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x38')));_0x439b69=_[_0x5745('0x3')](_0x439b69,require(_0x5745('0x39')));var _0x377cfd=jayson[_0x5745('0x3a')](_0x439b69)['http']();var _0x321ce4=config[_0x5745('0x3b')]['port']||config[_0x5745('0x3c')]+0x1;var _0x4f702d=config[_0x5745('0x3b')]['ip']||_0x5745('0x3d');_0x377cfd['on'](_0x5745('0x3e'),function(_0x7c19a4){return _0x3b96dd(_0x7c19a4);});_0x377cfd[_0x5745('0x2')](_0x321ce4,_0x4f702d,function(){console['log'](_0x5745('0x3f'),_0x4f702d,_0x321ce4);require(_0x5745('0x40'))['default']();return _0xf80ddb(_0x5745('0x41')+_0x4f702d+':'+_0x321ce4);});});}; \ No newline at end of file +var _0xf333=['../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc'];(function(_0x2baedf,_0x12183b){var _0x53bca4=function(_0x2adc66){while(--_0x2adc66){_0x2baedf['push'](_0x2baedf['shift']());}};_0x53bca4(++_0x12183b);}(_0xf333,0x1cd));var _0x3f33=function(_0x2d8e83,_0x39f41a){_0x2d8e83=_0x2d8e83-0x0;var _0x3d81f5=_0xf333[_0x2d8e83];return _0x3d81f5;};'use strict';var jayson=require(_0x3f33('0x0'));var _=require('lodash');var config=require(_0x3f33('0x1'));exports['listen']=function(){return new Promise(function(_0x2c963f,_0x39f614){var _0x56335c={};_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/user/user.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x3')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x4')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x5')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x6')));_0x56335c=_['merge'](_0x56335c,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x7')));_0x56335c=_['merge'](_0x56335c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/memberReport/memberReport.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x8')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x9')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xa')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0xb')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xc')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0xd')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xe')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xf')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x10')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x11')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/faxAccount/faxAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/faxApplication/faxApplication.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x12')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x13')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x14')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x15')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/smsAccount/smsAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/smsInteraction/smsInteraction.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x16')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x17')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x18')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x19')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x1b')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1c')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x1d')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1e')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1f')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x20')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x21')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x22')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x23')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x24')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x25')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x26')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x27')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x28')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x29')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2b')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2c')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2d')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2e')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2f')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x30')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x31')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x32')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x33')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x34')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x35')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x36')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x37')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x38')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x39')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/campaign/campaign.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/attachment/attachment.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3b')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x3c')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3d')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x28b256=jayson[_0x3f33('0x3e')](_0x56335c)[_0x3f33('0x3f')]();var _0x46bc07=config[_0x3f33('0x40')][_0x3f33('0x41')]||config[_0x3f33('0x41')]+0x1;var _0x21e1b4=config[_0x3f33('0x40')]['ip']||_0x3f33('0x42');_0x28b256['on'](_0x3f33('0x43'),function(_0x22af67){return _0x39f614(_0x22af67);});_0x28b256[_0x3f33('0x44')](_0x46bc07,_0x21e1b4,function(){console[_0x3f33('0x45')](_0x3f33('0x46'),_0x21e1b4,_0x46bc07);require(_0x3f33('0x47'))[_0x3f33('0x48')]();return _0x2c963f(_0x3f33('0x49')+_0x21e1b4+':'+_0x46bc07);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 2fb6d12..cf436fc 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 _0xf39c=['setEncoding','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','520\x20End\x20of\x20proper','function','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','setContext','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','extension','setPriority','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','utf8'];(function(_0x1c8412,_0x15456e){var _0xf0f5f1=function(_0x3c4fb7){while(--_0x3c4fb7){_0x1c8412['push'](_0x1c8412['shift']());}};_0xf0f5f1(++_0x15456e);}(_0xf39c,0x16c));var _0xcf39=function(_0x282d96,_0x4f7820){_0x282d96=_0x282d96-0x0;var _0x34a2b1=_0xf39c[_0x282d96];return _0x34a2b1;};'use strict';var util=require(_0xcf39('0x0'));var _=require(_0xcf39('0x1'));var EventEmitter=require(_0xcf39('0x2'))[_0xcf39('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xcf39('0x4'));function AGIChannel(_0x5365f8){var _0x334eb5=this,_0x5dbeeb=new AGIReply(),_0x28b8cb=![],_0x18ddcf={};EventEmitter['call'](_0x334eb5);_0x5365f8['setEncoding'](_0xcf39('0x5'));_0x5365f8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5dbeeb[_0xcf39('0x6')](_0xcf39('0x5'));_0x5dbeeb['on'](_0xcf39('0x7'),function(_0x1ff66d){for(var _0x406af6 in _0x1ff66d){_0x334eb5[_0x406af6]=_0x1ff66d[_0x406af6];}_0x334eb5['emit'](_0xcf39('0x8'));});_0x5dbeeb['on'](_0xcf39('0x9'),function(_0x4f5d63){if(_0x4f5d63[_0xcf39('0xa')]()==_0xcf39('0xb')){_0x334eb5[_0xcf39('0xc')](_0xcf39('0xb'));return;}if(_0x4f5d63[_0xcf39('0xd')](0x0,0xb)==_0xcf39('0xe')){_0x28b8cb=!![];}if(_0x28b8cb){_0x18ddcf['rx']+=_0x4f5d63+'\x0a';if(_0x4f5d63['search'](_0xcf39('0xf'))!=-0x1){_0x28b8cb=![];}}else{_0x18ddcf['rx']=_0x4f5d63;}if(_0x28b8cb){return;}if(typeof _0x18ddcf['cb']==_0xcf39('0x10')){var _0x5ec127=_0x18ddcf['rx']['substring'](0x0,0x3),_0x3efbdc=null,_0x4714cc=null;_0x5ec127=parseInt(_0x5ec127);if(isNaN(_0x5ec127)){_0x18ddcf['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5ec127!=0xc8){_0x18ddcf['cb'](null,{'code':_0x5ec127,'result':-0x1,'extra':'KO'});return;}_0x3efbdc=_0x18ddcf['rx'][_0xcf39('0xd')](0x4)['replace'](_0xcf39('0x11'),'');if(_0x3efbdc[_0xcf39('0x12')]('\x20')!=-0x1){_0x3efbdc=_0x3efbdc[_0xcf39('0x13')](0x0,_0x3efbdc[_0xcf39('0x12')]('\x20'));}if(_[_0xcf39('0x14')](_0x3efbdc,'-1')){_0x3efbdc=parseInt(_0x3efbdc);}_0x4714cc=_0x18ddcf['rx'][_0xcf39('0x15')]('\x20');if(_0x4714cc[_0xcf39('0x16')]==0x3){_0x4714cc=_0x4714cc[0x2]['substring'](0x1,_0x4714cc[0x2]['length']-0x1);}else if(_0x4714cc[_0xcf39('0x16')]>0x3){var _0x42fa71=/\((.+)\)/;var _0x48f9c8=_0x18ddcf['rx']['match'](_0x42fa71);if(_0x48f9c8){_0x4714cc=_0x48f9c8[0x1];}else{_0x4714cc=null;}}else{_0x4714cc=null;}_0x18ddcf['cb'](null,{'code':_0x5ec127,'result':_0x3efbdc,'extra':_0x4714cc});}});_0x5365f8['on'](_0xcf39('0x17'),function(_0x4b0dbc){_0x334eb5[_0xcf39('0xc')](_0xcf39('0x17'),new AGIError(_0xcf39('0x18'),_0x4b0dbc[_0xcf39('0x19')]));});_0x5365f8['on'](_0xcf39('0x1a'),function(){_0x334eb5[_0xcf39('0xc')]('close',new AGIError(_0xcf39('0x1b')));});_0x5365f8['on'](_0xcf39('0x1c'),function(){_0x334eb5['emit'](_0xcf39('0x1c'),new AGIError(_0xcf39('0x1d')));_0x5365f8[_0xcf39('0x1e')]();});_0x5365f8[_0xcf39('0x1f')](_0x5dbeeb);this[_0xcf39('0x20')]=function(_0x220c0d,_0x1760b3){var _0x220c0d=_0x220c0d||'',_0x1760b3=typeof _0x1760b3==_0xcf39('0x10')?_0x1760b3:new Function();_0x18ddcf={'tx':_0x220c0d,'rx':'','cb':_0x1760b3};_0x5365f8['write'](_0x220c0d+'\x0a');},this[_0xcf39('0x1a')]=function(){_0x5365f8['destroy']();};}util[_0xcf39('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xcf39('0x22')][_0xcf39('0x23')]=function(_0x233b72){return this[_0xcf39('0x20')][_0xcf39('0x24')](this,_0x233b72);};AGIChannel['prototype'][_0xcf39('0x25')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0xcf39('0x22')][_0xcf39('0x26')]=function(_0x3e721b,_0x1b7382,_0x2bb111){_0x3e721b=_0x3e721b===undefined?_0xcf39('0x27'):_0x3e721b;_0x1b7382=_0x1b7382===undefined?'5':_0x1b7382;_0x2bb111=_0x2bb111===undefined?'1':_0x2bb111;return this['sendRequest'](util[_0xcf39('0x28')](_0xcf39('0x29'),_0x3e721b,_0x1b7382*0x3e8,_0x2bb111));};AGIChannel[_0xcf39('0x22')]['noop']=function(_0x2fdfa0){_0x2fdfa0=_0x2fdfa0||_0xcf39('0x2a');return this[_0xcf39('0x23')](util[_0xcf39('0x28')](_0xcf39('0x2b'),_0x2fdfa0));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x2c')]=function(_0x20d5c9,_0x4a4d82){if(_[_0xcf39('0x2d')](_0x4a4d82)){return this[_0xcf39('0x23')](util['format']('EXEC\x20%s\x20%s',_0x20d5c9,_0x4a4d82['join'](',')));}return this['sendRequest'](util[_0xcf39('0x28')]('EXEC\x20%s\x20%s',_0x20d5c9,_0x4a4d82));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x2e')]=function(_0x16811c){return this[_0xcf39('0x23')](util[_0xcf39('0x28')]('SET\x20CONTEXT\x20%s',_0x16811c));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x2f')]=function(_0x572958){return this[_0xcf39('0x23')](util[_0xcf39('0x28')](_0xcf39('0x30'),_0x572958));};AGIChannel['prototype']['setPriority']=function(_0x39e9cb){return this[_0xcf39('0x23')](util['format']('SET\x20PRIORITY\x20%s',_0x39e9cb));};AGIChannel[_0xcf39('0x22')][_0xcf39('0xb')]=function(){return this[_0xcf39('0x23')](_0xcf39('0x31'));};AGIChannel['prototype'][_0xcf39('0x32')]=function(_0x673939,_0x5686ac){var _0x1808a4=_[_0xcf39('0x33')](_0x5686ac)||_['isNumber'](_0x5686ac)?_0x5686ac['toString']():_0x5686ac;return this['sendRequest'](util[_0xcf39('0x28')](_0xcf39('0x34'),_0x673939,_0x1808a4?_0x1808a4[_0xcf39('0x35')]()[_0xcf39('0x36')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x37')]=function(_0x4ec14a,_0x39cdcd){return this[_0xcf39('0x23')](util[_0xcf39('0x28')](_0xcf39('0x38'),_0x4ec14a,_0x39cdcd));};AGIChannel['prototype'][_0xcf39('0x39')]=function(_0x46fd2f,_0x19a6ff){return this['sendRequest'](util[_0xcf39('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x46fd2f,_0x19a6ff));};AGIChannel[_0xcf39('0x22')]['sayPhonetic']=function(_0x2528e4,_0x49ac16){return this['sendRequest'](util[_0xcf39('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2528e4,_0x49ac16));};AGIChannel['prototype']['continueAt']=function(_0x190d43,_0x333b4d,_0x2f240c){_0x333b4d=_0x333b4d||this[_0xcf39('0x3a')];_0x2f240c=_0x2f240c||0x1;this[_0xcf39('0x2e')](_0x190d43);this[_0xcf39('0x2f')](_0x333b4d);this[_0xcf39('0x3b')](_0x2f240c);return this[_0xcf39('0x3c')](util[_0xcf39('0x28')](_0xcf39('0x3d'),_0x190d43,_0x333b4d,_0x2f240c));};AGIChannel['prototype'][_0xcf39('0x3e')]=function(_0x33ca21){return this['sendRequest'](util[_0xcf39('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x33ca21));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x3f')]=function(_0x17544f,_0x102c28,_0x6a0a28,_0x3b6a9,_0xa5f679,_0x8ab9bb){_0x102c28=_0x102c28||_0xcf39('0x40');_0x6a0a28=_0x6a0a28||'';_0x3b6a9=_0x3b6a9===undefined?-0x1:_0x3b6a9==='-1'?-0x1:_0x3b6a9*0x3e8;_0xa5f679=_0xa5f679===undefined?'':'s='+_0xa5f679;_0x8ab9bb=_0x8ab9bb?'BEEP':'';return this['sendRequest'](util[_0xcf39('0x28')](_0xcf39('0x41'),_0x17544f,_0x102c28,_0x6a0a28,_0x3b6a9,_0x8ab9bb,_0xa5f679));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x42')]=function(_0x13ebba,_0x3d555d){_0x3d555d=_0x3d555d||'';return this[_0xcf39('0x23')](util[_0xcf39('0x28')](_0xcf39('0x43'),_0x13ebba,_0x3d555d));};AGIChannel[_0xcf39('0x22')][_0xcf39('0x44')]=function(_0x590bdf){return this[_0xcf39('0x2c')](_0xcf39('0x45'),_0x590bdf);};AGIChannel[_0xcf39('0x22')][_0xcf39('0x46')]=function(_0x451f54){return this['exec']('WAIT',_0x451f54);};AGIChannel[_0xcf39('0x22')][_0xcf39('0x17')]=function(_0x2e8e52,_0xb0871c){this[_0xcf39('0x3c')](util[_0xcf39('0x28')](_0xcf39('0x47'),_0x2e8e52['id'],_0x2e8e52[_0xcf39('0x48')],_0xb0871c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xcf39('0x49')]=AGIChannel; \ No newline at end of file +var _0x5565=['sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','lodash','EventEmitter','./error','call','setEncoding','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype'];(function(_0x160e77,_0x4e4702){var _0x10ad58=function(_0x542626){while(--_0x542626){_0x160e77['push'](_0x160e77['shift']());}};_0x10ad58(++_0x4e4702);}(_0x5565,0x104));var _0x5556=function(_0x30dcbb,_0x2270d7){_0x30dcbb=_0x30dcbb-0x0;var _0x7ef54d=_0x5565[_0x30dcbb];return _0x7ef54d;};'use strict';var util=require('util');var _=require(_0x5556('0x0'));var EventEmitter=require('events')[_0x5556('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x5556('0x2'));function AGIChannel(_0x133756){var _0x42a6b5=this,_0x31cc51=new AGIReply(),_0x5e4b48=![],_0x3d63e9={};EventEmitter[_0x5556('0x3')](_0x42a6b5);_0x133756[_0x5556('0x4')]('utf8');_0x133756[_0x5556('0x5')](0x8*0x3c*0x3c*0x3e8);_0x31cc51['setEncoding']('utf8');_0x31cc51['on'](_0x5556('0x6'),function(_0x4365d6){for(var _0x445978 in _0x4365d6){_0x42a6b5[_0x445978]=_0x4365d6[_0x445978];}_0x42a6b5[_0x5556('0x7')](_0x5556('0x8'));});_0x31cc51['on'](_0x5556('0x9'),function(_0x20c44d){if(_0x20c44d[_0x5556('0xa')]()==_0x5556('0xb')){_0x42a6b5[_0x5556('0x7')](_0x5556('0xb'));return;}if(_0x20c44d[_0x5556('0xc')](0x0,0xb)==_0x5556('0xd')){_0x5e4b48=!![];}if(_0x5e4b48){_0x3d63e9['rx']+=_0x20c44d+'\x0a';if(_0x20c44d[_0x5556('0xe')](_0x5556('0xf'))!=-0x1){_0x5e4b48=![];}}else{_0x3d63e9['rx']=_0x20c44d;}if(_0x5e4b48){return;}if(typeof _0x3d63e9['cb']==_0x5556('0x10')){var _0x53d3cd=_0x3d63e9['rx'][_0x5556('0xc')](0x0,0x3),_0x30bde4=null,_0x6cf747=null;_0x53d3cd=parseInt(_0x53d3cd);if(isNaN(_0x53d3cd)){_0x3d63e9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5556('0x11')});return;}if(_0x53d3cd!=0xc8){_0x3d63e9['cb'](null,{'code':_0x53d3cd,'result':-0x1,'extra':'KO'});return;}_0x30bde4=_0x3d63e9['rx'][_0x5556('0xc')](0x4)[_0x5556('0x12')]('result=','');if(_0x30bde4['indexOf']('\x20')!=-0x1){_0x30bde4=_0x30bde4['substr'](0x0,_0x30bde4[_0x5556('0x13')]('\x20'));}if(_['startsWith'](_0x30bde4,'-1')){_0x30bde4=parseInt(_0x30bde4);}_0x6cf747=_0x3d63e9['rx'][_0x5556('0x14')]('\x20');if(_0x6cf747[_0x5556('0x15')]==0x3){_0x6cf747=_0x6cf747[0x2][_0x5556('0xc')](0x1,_0x6cf747[0x2][_0x5556('0x15')]-0x1);}else if(_0x6cf747[_0x5556('0x15')]>0x3){var _0x420be9=/\((.+)\)/;var _0x24709f=_0x3d63e9['rx'][_0x5556('0x16')](_0x420be9);if(_0x24709f){_0x6cf747=_0x24709f[0x1];}else{_0x6cf747=null;}}else{_0x6cf747=null;}_0x3d63e9['cb'](null,{'code':_0x53d3cd,'result':_0x30bde4,'extra':_0x6cf747});}});_0x133756['on']('error',function(_0x3b8fca){_0x42a6b5[_0x5556('0x7')](_0x5556('0x17'),new AGIError(_0x5556('0x18'),_0x3b8fca[_0x5556('0x19')]));});_0x133756['on'](_0x5556('0x1a'),function(){_0x42a6b5[_0x5556('0x7')](_0x5556('0x1a'),new AGIError(_0x5556('0x1b')));});_0x133756['on'](_0x5556('0x1c'),function(){_0x42a6b5[_0x5556('0x7')](_0x5556('0x1c'),new AGIError(_0x5556('0x1d')));_0x133756[_0x5556('0x1e')]();});_0x133756[_0x5556('0x1f')](_0x31cc51);this[_0x5556('0x20')]=function(_0x150cb1,_0x3d060c){var _0x150cb1=_0x150cb1||'',_0x3d060c=typeof _0x3d060c==_0x5556('0x10')?_0x3d060c:new Function();_0x3d63e9={'tx':_0x150cb1,'rx':'','cb':_0x3d060c};_0x133756[_0x5556('0x21')](_0x150cb1+'\x0a');},this[_0x5556('0x1a')]=function(){_0x133756[_0x5556('0x1e')]();};}util[_0x5556('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x5556('0x23')][_0x5556('0x24')]=function(_0x597626){return this[_0x5556('0x20')][_0x5556('0x25')](this,_0x597626);};AGIChannel[_0x5556('0x23')][_0x5556('0x26')]=function(){return this['sendRequest'](_0x5556('0x27'));};AGIChannel[_0x5556('0x23')][_0x5556('0x28')]=function(_0xbebaf8,_0x4a361f,_0x2054ac){_0xbebaf8=_0xbebaf8===undefined?_0x5556('0x29'):_0xbebaf8;_0x4a361f=_0x4a361f===undefined?'5':_0x4a361f;_0x2054ac=_0x2054ac===undefined?'1':_0x2054ac;return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x2b'),_0xbebaf8,_0x4a361f*0x3e8,_0x2054ac));};AGIChannel[_0x5556('0x23')][_0x5556('0x2c')]=function(_0x1caef3){_0x1caef3=_0x1caef3||_0x5556('0x2d');return this[_0x5556('0x24')](util['format'](_0x5556('0x2e'),_0x1caef3));};AGIChannel[_0x5556('0x23')][_0x5556('0x2f')]=function(_0x1d299e,_0xd635b9){if(_[_0x5556('0x30')](_0xd635b9)){return this['sendRequest'](util[_0x5556('0x2a')](_0x5556('0x31'),_0x1d299e,_0xd635b9[_0x5556('0x32')](',')));}return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x31'),_0x1d299e,_0xd635b9));};AGIChannel[_0x5556('0x23')][_0x5556('0x33')]=function(_0x4fd0ed){return this[_0x5556('0x24')](util['format'](_0x5556('0x34'),_0x4fd0ed));};AGIChannel[_0x5556('0x23')][_0x5556('0x35')]=function(_0x252fec){return this[_0x5556('0x24')](util['format'](_0x5556('0x36'),_0x252fec));};AGIChannel[_0x5556('0x23')]['setPriority']=function(_0x43d0b4){return this[_0x5556('0x24')](util[_0x5556('0x2a')]('SET\x20PRIORITY\x20%s',_0x43d0b4));};AGIChannel[_0x5556('0x23')][_0x5556('0xb')]=function(){return this[_0x5556('0x24')](_0x5556('0x37'));};AGIChannel[_0x5556('0x23')]['setVariable']=function(_0x4c98e4,_0x15ef57){var _0x27e434=_[_0x5556('0x38')](_0x15ef57)||_[_0x5556('0x39')](_0x15ef57)?_0x15ef57[_0x5556('0x3a')]():_0x15ef57;return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x3b'),_0x4c98e4,_0x27e434?_0x27e434[_0x5556('0x3a')]()[_0x5556('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x5556('0x3c')]=function(_0x2ea81b,_0xeef9c2){return this[_0x5556('0x24')](util['format'](_0x5556('0x3d'),_0x2ea81b,_0xeef9c2));};AGIChannel[_0x5556('0x23')][_0x5556('0x3e')]=function(_0x6e4312,_0x44b57f){return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x3f'),_0x6e4312,_0x44b57f));};AGIChannel[_0x5556('0x23')][_0x5556('0x40')]=function(_0x16ab7a,_0x14ea0e){return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x41'),_0x16ab7a,_0x14ea0e));};AGIChannel[_0x5556('0x23')]['continueAt']=function(_0x494d60,_0x521803,_0x161b45){_0x521803=_0x521803||this['extension'];_0x161b45=_0x161b45||0x1;this[_0x5556('0x33')](_0x494d60);this['setExtension'](_0x521803);this['setPriority'](_0x161b45);return this[_0x5556('0x2c')](util[_0x5556('0x2a')](_0x5556('0x42'),_0x494d60,_0x521803,_0x161b45));};AGIChannel[_0x5556('0x23')][_0x5556('0x43')]=function(_0x4af5dc){return this[_0x5556('0x24')](util['format'](_0x5556('0x44'),_0x4af5dc));};AGIChannel[_0x5556('0x23')]['recordFile']=function(_0x2bb45f,_0x5a252b,_0x1d00d5,_0x6425ab,_0x41d274,_0x106c79){_0x5a252b=_0x5a252b||_0x5556('0x45');_0x1d00d5=_0x1d00d5||'';_0x6425ab=_0x6425ab===undefined?-0x1:_0x6425ab==='-1'?-0x1:_0x6425ab*0x3e8;_0x41d274=_0x41d274===undefined?'':'s='+_0x41d274;_0x106c79=_0x106c79?'BEEP':'';return this['sendRequest'](util[_0x5556('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2bb45f,_0x5a252b,_0x1d00d5,_0x6425ab,_0x106c79,_0x41d274));};AGIChannel[_0x5556('0x23')]['streamFile']=function(_0x1c8938,_0x2f8e35){_0x2f8e35=_0x2f8e35||'';return this['sendRequest'](util[_0x5556('0x2a')](_0x5556('0x46'),_0x1c8938,_0x2f8e35));};AGIChannel[_0x5556('0x23')]['agi']=function(_0x23c199){return this[_0x5556('0x2f')](_0x5556('0x47'),_0x23c199);};AGIChannel[_0x5556('0x23')][_0x5556('0x48')]=function(_0x62107b){return this[_0x5556('0x2f')]('WAIT',_0x62107b);};AGIChannel['prototype']['error']=function(_0x46ed63,_0x36bf4e){this[_0x5556('0x2c')](util[_0x5556('0x2a')](_0x5556('0x49'),_0x46ed63['id'],_0x46ed63['label'],_0x36bf4e));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 04d4fa4..56df19e 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 _0xd5c3=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xd5c3,0x1d2));var _0x3d5c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd5c3[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x3d5c('0x0'));var error={'E_AGI_UNDEFINED':_0x3d5c('0x1'),'E_AGI_ARGUMENT_PORT':_0x3d5c('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x3d5c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x3d5c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x3d5c('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x3d5c('0x6'),'E_AGI_COMMAND_EMPTY':_0x3d5c('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3d5c('0x8'),'E_AGI_IVR_ENTRY':_0x3d5c('0x9')};function AGIError(_0x344888){var _0x344888=_0x344888||null,_0x1f756c=_0x1f756c||[],_0x29c826=0x1,_0x324857='';if(!error[_0x344888]){_0x344888=_0x3d5c('0xa');}_0x1f756c[_0x3d5c('0xb')](error[_0x344888]);while(arguments[_0x29c826]){_0x1f756c[_0x3d5c('0xb')](arguments[_0x29c826]);_0x29c826++;}_0x324857=util[_0x3d5c('0xc')]['apply'](util,_0x1f756c);this['message']=_0x324857;this[_0x3d5c('0xd')]=_0x344888;}module[_0x3d5c('0xe')]=AGIError; \ No newline at end of file +var _0x0dd2=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0dd2,0x74));var _0x20dd=function(_0x288536,_0x369b51){_0x288536=_0x288536-0x0;var _0x525e94=_0x0dd2[_0x288536];return _0x525e94;};'use strict';var util=require(_0x20dd('0x0'));var error={'E_AGI_UNDEFINED':_0x20dd('0x1'),'E_AGI_ARGUMENT_PORT':_0x20dd('0x2'),'E_AGI_SERVER_ERROR':_0x20dd('0x3'),'E_AGI_SERVER_CLOSE':_0x20dd('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x20dd('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x20dd('0x6'),'E_AGI_SOCKET_ERROR':_0x20dd('0x7'),'E_AGI_SOCKET_CLOSE':_0x20dd('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x20dd('0x9'),'E_AGI_COMMAND_EMPTY':_0x20dd('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x20dd('0xb'),'E_AGI_IVR_ENTRY':_0x20dd('0xc')};function AGIError(_0x4119b0){var _0x4119b0=_0x4119b0||null,_0x49afd8=_0x49afd8||[],_0x4d0632=0x1,_0x4b0001='';if(!error[_0x4119b0]){_0x4119b0=_0x20dd('0xd');}_0x49afd8[_0x20dd('0xe')](error[_0x4119b0]);while(arguments[_0x4d0632]){_0x49afd8['push'](arguments[_0x4d0632]);_0x4d0632++;}_0x4b0001=util[_0x20dd('0xf')][_0x20dd('0x10')](util,_0x49afd8);this[_0x20dd('0x11')]=_0x4b0001;this[_0x20dd('0x12')]=_0x4119b0;}module[_0x20dd('0x13')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 6909dc2..82553e7 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2f6=['events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','emit','error','message','agi','parse','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash'];(function(_0x16cb1e,_0x1cd4f7){var _0xdae673=function(_0x495167){while(--_0x495167){_0x16cb1e['push'](_0x16cb1e['shift']());}};_0xdae673(++_0x1cd4f7);}(_0xc2f6,0x7d));var _0x6c2f=function(_0x48e532,_0x49672b){_0x48e532=_0x48e532-0x0;var _0x17403f=_0xc2f6[_0x48e532];return _0x17403f;};'use strict';var _=require(_0x6c2f('0x0'));var EventEmitter=require(_0x6c2f('0x1'))[_0x6c2f('0x2')];var Redis=require(_0x6c2f('0x3'));var AGIError=require(_0x6c2f('0x4'));var config=require(_0x6c2f('0x5'));config[_0x6c2f('0x6')]=_[_0x6c2f('0x7')](config['redis'],{'host':_0x6c2f('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6c2f('0x6')]);sub[_0x6c2f('0x9')]('agi',function(_0x254c55){if(_0x254c55)return eventEmitter[_0x6c2f('0xa')](_0x6c2f('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x254c55));});sub['on'](_0x6c2f('0xc'),function(_0x54de35,_0x57b7a3){if(_0x54de35!==_0x6c2f('0xd'))return;try{var _0x1cf652=JSON[_0x6c2f('0xe')](_0x57b7a3);eventEmitter[_0x6c2f('0xa')](_0x6c2f('0xf'),_0x1cf652);}catch(_0x1f9561){eventEmitter[_0x6c2f('0xa')](_0x6c2f('0xb'),new AGIError(_0x6c2f('0x10'),_0x1f9561));}});module[_0x6c2f('0x11')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xcfae=['defaults','subscribe','E_AGI_SERVER_ERROR','message','agi','parse','emit','error','lodash','ioredis','./error','../../config/environment','redis'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xcfae,0xe5));var _0xecfa=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xcfae[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0xecfa('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0xecfa('0x1'));var AGIError=require(_0xecfa('0x2'));var config=require(_0xecfa('0x3'));config[_0xecfa('0x4')]=_[_0xecfa('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xecfa('0x4')]);sub[_0xecfa('0x6')]('agi',function(_0x11741a){if(_0x11741a)return eventEmitter['emit']('error',new AGIError(_0xecfa('0x7'),_0x11741a));});sub['on'](_0xecfa('0x8'),function(_0x483ca5,_0x283c60){if(_0x483ca5!==_0xecfa('0x9'))return;try{var _0x5169fb=JSON[_0xecfa('0xa')](_0x283c60);eventEmitter[_0xecfa('0xb')]('projectUpdate',_0x5169fb);}catch(_0x1e2337){eventEmitter[_0xecfa('0xb')](_0xecfa('0xc'),new AGIError(_0xecfa('0x7'),_0x1e2337));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 52d3e7a..8ce9610 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 _0xde03=['max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','addVertex','prototype','edges','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x1ecf80,_0x5c3f80){var _0x569a6c=function(_0x9fe2db){while(--_0x9fe2db){_0x1ecf80['push'](_0x1ecf80['shift']());}};_0x569a6c(++_0x5c3f80);}(_0xde03,0xc3));var _0x3de0=function(_0x421be0,_0x43bea6){_0x421be0=_0x421be0-0x0;var _0x351760=_0xde03[_0x421be0];return _0x351760;};'use strict';var _=require(_0x3de0('0x0'));var logger=require(_0x3de0('0x1'))(_0x3de0('0x2'));var verticesWithRetry=[_0x3de0('0x3'),'getdigits',_0x3de0('0x4')];var Graph=function(){this[_0x3de0('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x3de0('0x6')]=function(_0x1fcc8a){this['vertices'][_0x1fcc8a['id']]=_0x1fcc8a;this['edges'][_0x1fcc8a['id']]=[];};Graph[_0x3de0('0x7')]['addEdge']=function(_0x6c5ad9,_0x3f0206,_0x179cee){this[_0x3de0('0x8')][_0x6c5ad9][_0x3de0('0x9')]({'target':_0x3f0206,'condition':_0x179cee});this[_0x3de0('0xa')]+=0x1;};Graph['prototype']['size']=function(){return _[_0x3de0('0xb')](this[_0x3de0('0x5')]);};Graph[_0x3de0('0x7')][_0x3de0('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x3de0('0x7')][_0x3de0('0xd')]=function(_0x1d333e){return this[_0x3de0('0x5')][_0x1d333e];};Graph[_0x3de0('0x7')][_0x3de0('0xe')]=function(_0x19a631,_0x1e11bd){if(!this[_0x3de0('0x5')][_0x19a631]){return logger[_0x3de0('0xf')](_0x3de0('0x10'));}var _0x5ed690=_0x1e11bd(this[_0x3de0('0x5')][_0x19a631]);if(!_0x5ed690){return logger[_0x3de0('0xf')](_0x3de0('0x11'));}if(this[_0x3de0('0x8')][_0x19a631][_0x3de0('0x12')]===0x0){return logger[_0x3de0('0xf')](_0x3de0('0x13'));}for(var _0x5f02af=0x0,_0x1d38cb=[],_0x4a9536=![];_0x5f02af\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','evtHangup','createSquareReport','then','catch','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','production','handleUnpublished','initialize','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','lodash','util','../../config/license/util','./rpc','./events','EventEmitter','agi','projectUpdate','nextTick','error','stack','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info'];(function(_0x2f3fce,_0x2bd7a3){var _0x6619d3=function(_0x36309d){while(--_0x36309d){_0x2f3fce['push'](_0x2f3fce['shift']());}};_0x6619d3(++_0x2bd7a3);}(_0x5537,0x1cb));var _0x7553=function(_0xf65da5,_0x8e3312){_0xf65da5=_0xf65da5-0x0;var _0x446149=_0x5537[_0xf65da5];return _0x446149;};'use strict';var _=require(_0x7553('0x0'));var syncho=require('syncho');var util=require(_0x7553('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('agi');var utilLicense=require(_0x7553('0x2'));var rpc=require(_0x7553('0x3'));var Project=require('./project');var AGIEmitter=require(_0x7553('0x4'))[_0x7553('0x5')];var projects=[];config[_0x7553('0x6')]=_['defaults'](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x7553('0x7'),projectUpdateHandler);function connectionHandler(_0x16e25a){process[_0x7553('0x8')](function(){syncho(function(){try{setChannelVariables(_0x16e25a);agiHandler(_0x16e25a);}catch(_0x48642f){logger[_0x7553('0x9')](_0x48642f[_0x7553('0xa')]);}});});}function projectUpdateHandler(_0xf22608){try{var _0x14eb8f=_['findIndex'](projects,['id',_0xf22608['id']]);if(_0x14eb8f>-0x1){if(_0xf22608[_0x7553('0xb')]===!![]){projects[_0x7553('0xc')](_0x14eb8f,0x1);}else{projects[_0x14eb8f]=_0xf22608;}}else{projects[_0x7553('0xd')](_0xf22608);}}catch(_0x14e8df){logger[_0x7553('0x9')](_0x14e8df[_0x7553('0xa')]);}}function listeningHandler(){console[_0x7553('0xe')](_0x7553('0xf'),config[_0x7553('0x6')][_0x7553('0x10')]);logger[_0x7553('0x11')](util[_0x7553('0x12')](_0x7553('0x13'),config[_0x7553('0x6')]['ip'],config[_0x7553('0x6')][_0x7553('0x10')]));}function errorHandler(_0x591b78){if(_0x591b78&&_0x591b78[_0x7553('0x14')]&&_0x591b78[_0x7553('0x15')]){logger[_0x7553('0x9')](util[_0x7553('0x12')]('[%s]\x20%s',_0x591b78['name'],_0x591b78[_0x7553('0x15')]));}else{logger[_0x7553('0x9')](util[_0x7553('0x12')]('[ERROR]\x20%s',_0x591b78[_0x7553('0xa')]));}}function closeHandler(){logger[_0x7553('0x11')](util[_0x7553('0x12')](_0x7553('0x16'),this[_0x7553('0x17')],this['calleridname'],this[_0x7553('0x18')],this[_0x7553('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x926e2e){logger[_0x7553('0x9')](_0x926e2e[_0x7553('0xa')]);}}function timeoutHandler(){logger['info'](util[_0x7553('0x12')](_0x7553('0x1a'),this[_0x7553('0x17')],this[_0x7553('0x1b')],this['callerid'],this[_0x7553('0x19')],this[_0x7553('0x1c')]));}function hangupHandler(){logger[_0x7553('0x11')](util[_0x7553('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7553('0x17')],this['calleridname'],this[_0x7553('0x18')],this['dnid'],this['uniqueid']));this[_0x7553('0x1d')]=!![];}function createSquareReport(_0x3d6d1a,_0x275e86){rpc[_0x7553('0x1e')](_0x3d6d1a)[_0x7553('0x1f')](function(_0xe80494){if(_0x275e86){_0x275e86(null,_0xe80494);}})[_0x7553('0x20')](function(_0x1087fa){if(_0x275e86){_0x275e86(null,_0x1087fa);}});}function setChannelVariables(_0x15c7ae){for(var _0x523a51 in _0x15c7ae){if(_0x15c7ae['hasOwnProperty'](_0x523a51)){if(_0x523a51[_0x7553('0x21')](_0x7553('0x22'))===0x0){_0x15c7ae[_0x523a51[_0x7553('0x23')](0x4)]=_0x15c7ae[_0x523a51];delete _0x15c7ae[_0x523a51];}}}}function agiHandler(_0x5f633c){logger['debug'](_0x7553('0x24'),JSON[_0x7553('0x25')](_0x5f633c,null,0x2));logger[_0x7553('0x11')](util['format'](_0x7553('0x26'),_0x5f633c[_0x7553('0x17')],_0x5f633c[_0x7553('0x1b')],_0x5f633c[_0x7553('0x18')],_0x5f633c[_0x7553('0x19')],_0x5f633c[_0x7553('0x1c')]));_0x5f633c['on']('error',errorHandler);_0x5f633c['on'](_0x7553('0x27'),closeHandler);_0x5f633c['on'](_0x7553('0x28'),timeoutHandler);_0x5f633c['evtHangup']=![];_0x5f633c['on'](_0x7553('0x29'),hangupHandler);var _0x3ce234=_[_0x7553('0x2a')](projects,[_0x7553('0x14'),_0x5f633c['arg_1']]);if(!_0x3ce234)return Project['handleNotFound'](_0x5f633c);if(!_0x3ce234[_0x7553('0x2b')])return Project[_0x7553('0x2c')](_0x5f633c);return Project[_0x7553('0x2d')](_0x3ce234,_0x5f633c);}function main(){var _0x296b56;return utilLicense['getLicense']()[_0x7553('0x1f')](function(_0x194623){if(!_0x194623)return;if(_0x194623['voice']){if(_0x194623['callysquare']&&_0x194623['callysquare']>0x0){logger[_0x7553('0x11')](util[_0x7553('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x194623[_0x7553('0x2e')]));_0x296b56=_0x194623[_0x7553('0x2e')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x7553('0x11')](_0x7553('0x2f'));_0x296b56=-0x1;}})[_0x7553('0x1f')](function(){return Project['getAll']();})[_0x7553('0x1f')](function(_0x4a8029){projects=_0x4a8029;return;})[_0x7553('0x20')](function(_0xbe8371){logger[_0x7553('0x9')](_0x7553('0x30'),_0xbe8371[_0x7553('0xa')]);})[_0x7553('0x31')](function(){var _0x5c10a2=require(_0x7553('0x32'))(config[_0x7553('0x6')][_0x7553('0x10')],config[_0x7553('0x6')]['ip'],_0x296b56);_0x5c10a2['on'](_0x7553('0x9'),errorHandler);_0x5c10a2['on'](_0x7553('0x33'),listeningHandler);_0x5c10a2['on'](_0x7553('0x34'),connectionHandler);_0x5c10a2['on'](_0x7553('0x27'),closeHandler);});}main(); \ No newline at end of file +var _0x67c7=['format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','name','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info'];(function(_0x2492dd,_0x190912){var _0x4b7c4f=function(_0x2c10d9){while(--_0x2c10d9){_0x2492dd['push'](_0x2492dd['shift']());}};_0x4b7c4f(++_0x190912);}(_0x67c7,0x8f));var _0x767c=function(_0x2dbed7,_0x2962d5){_0x2dbed7=_0x2dbed7-0x0;var _0x326efc=_0x67c7[_0x2dbed7];return _0x326efc;};'use strict';var _=require('lodash');var syncho=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var config=require(_0x767c('0x2'));var logger=require(_0x767c('0x3'))(_0x767c('0x4'));var utilLicense=require(_0x767c('0x5'));var rpc=require(_0x767c('0x6'));var Project=require(_0x767c('0x7'));var AGIEmitter=require(_0x767c('0x8'))[_0x767c('0x9')];var projects=[];config[_0x767c('0x4')]=_[_0x767c('0xa')](config[_0x767c('0x4')],{'ip':_0x767c('0xb'),'port':0x11dd});AGIEmitter['on'](_0x767c('0xc'),projectUpdateHandler);function connectionHandler(_0x314245){process[_0x767c('0xd')](function(){syncho(function(){try{setChannelVariables(_0x314245);agiHandler(_0x314245);}catch(_0x21e7cb){logger[_0x767c('0xe')](_0x21e7cb[_0x767c('0xf')]);}});});}function projectUpdateHandler(_0x2af0de){try{var _0x437376=_[_0x767c('0x10')](projects,['id',_0x2af0de['id']]);if(_0x437376>-0x1){if(_0x2af0de['deleted']===!![]){projects[_0x767c('0x11')](_0x437376,0x1);}else{projects[_0x437376]=_0x2af0de;}}else{projects['push'](_0x2af0de);}}catch(_0x2c65dd){logger[_0x767c('0xe')](_0x2c65dd[_0x767c('0xf')]);}}function listeningHandler(){console[_0x767c('0x12')](_0x767c('0x13'),config[_0x767c('0x4')][_0x767c('0x14')]);logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x17'),config[_0x767c('0x4')]['ip'],config[_0x767c('0x4')][_0x767c('0x14')]));}function errorHandler(_0x17b57c){if(_0x17b57c&&_0x17b57c['name']&&_0x17b57c[_0x767c('0x18')]){logger[_0x767c('0xe')](util[_0x767c('0x16')]('[%s]\x20%s',_0x17b57c['name'],_0x17b57c[_0x767c('0x18')]));}else{logger['error'](util['format']('[ERROR]\x20%s',_0x17b57c['stack']));}}function closeHandler(){logger[_0x767c('0x15')](util[_0x767c('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x767c('0x19')],this['calleridname'],this['callerid'],this[_0x767c('0x1a')],this[_0x767c('0x1b')]));try{createSquareReport(this);}catch(_0x481e19){logger[_0x767c('0xe')](_0x481e19[_0x767c('0xf')]);}}function timeoutHandler(){logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x1c'),this[_0x767c('0x19')],this[_0x767c('0x1d')],this[_0x767c('0x1e')],this[_0x767c('0x1a')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x767c('0x16')](_0x767c('0x1f'),this['arg_1'],this[_0x767c('0x1d')],this['callerid'],this[_0x767c('0x1a')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x312ffe,_0x42d482){rpc[_0x767c('0x20')](_0x312ffe)[_0x767c('0x21')](function(_0x2a72a){if(_0x42d482){_0x42d482(null,_0x2a72a);}})[_0x767c('0x22')](function(_0xceddda){if(_0x42d482){_0x42d482(null,_0xceddda);}});}function setChannelVariables(_0x29a5d9){for(var _0x35667e in _0x29a5d9){if(_0x29a5d9[_0x767c('0x23')](_0x35667e)){if(_0x35667e[_0x767c('0x24')](_0x767c('0x25'))===0x0){_0x29a5d9[_0x35667e[_0x767c('0x26')](0x4)]=_0x29a5d9[_0x35667e];delete _0x29a5d9[_0x35667e];}}}}function agiHandler(_0x14c154){logger['debug']('variables',JSON[_0x767c('0x27')](_0x14c154,null,0x2));logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x28'),_0x14c154['arg_1'],_0x14c154['calleridname'],_0x14c154['callerid'],_0x14c154[_0x767c('0x1a')],_0x14c154[_0x767c('0x1b')]));_0x14c154['on'](_0x767c('0xe'),errorHandler);_0x14c154['on'](_0x767c('0x29'),closeHandler);_0x14c154['on'](_0x767c('0x2a'),timeoutHandler);_0x14c154[_0x767c('0x2b')]=![];_0x14c154['on'](_0x767c('0x2c'),hangupHandler);var _0x37a8bc=_[_0x767c('0x2d')](projects,[_0x767c('0x2e'),_0x14c154[_0x767c('0x19')]]);if(!_0x37a8bc)return Project['handleNotFound'](_0x14c154);if(!_0x37a8bc[_0x767c('0x2f')])return Project[_0x767c('0x30')](_0x14c154);return Project[_0x767c('0x31')](_0x37a8bc,_0x14c154);}function main(){var _0x4ae680;return utilLicense[_0x767c('0x32')]()['then'](function(_0x4fbc51){if(!_0x4fbc51)return;if(_0x4fbc51['voice']){if(_0x4fbc51[_0x767c('0x33')]&&_0x4fbc51['callysquare']>0x0){logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x34'),_0x4fbc51[_0x767c('0x33')]));_0x4ae680=_0x4fbc51[_0x767c('0x33')];}else{logger[_0x767c('0x15')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x767c('0x15')](_0x767c('0x35'));_0x4ae680=-0x1;}})[_0x767c('0x21')](function(){return Project['getAll']();})[_0x767c('0x21')](function(_0x23c42b){projects=_0x23c42b;return;})[_0x767c('0x22')](function(_0x3464ec){logger['error']('[LICENSE]',_0x3464ec[_0x767c('0xf')]);})['finally'](function(){var _0x37768c=require('./server')(config['agi']['port'],config['agi']['ip'],_0x4ae680);_0x37768c['on'](_0x767c('0xe'),errorHandler);_0x37768c['on']('listening',listeningHandler);_0x37768c['on'](_0x767c('0x36'),connectionHandler);_0x37768c['on'](_0x767c('0x29'),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 b07d141..28593a5 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 _0x2751=['error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request'];(function(_0x33d4b9,_0x1f205c){var _0x498d83=function(_0x21e55f){while(--_0x21e55f){_0x33d4b9['push'](_0x33d4b9['shift']());}};_0x498d83(++_0x1f205c);}(_0x2751,0xe1));var _0x1275=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2751[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x1275('0x0'));var jayson=require(_0x1275('0x1'));var client=jayson[_0x1275('0x2')][_0x1275('0x3')]({'port':0x232b});function request(_0x5387da,_0x2704c3){return new BPromise(function(_0xaf2a50,_0x26b1ee){return client[_0x1275('0x4')](_0x5387da,_0x2704c3)['then'](function(_0x30cce3){if(_0x30cce3[_0x1275('0x5')]){return _0x26b1ee(_0x30cce3['error']['message']);}else{return _0xaf2a50(_0x30cce3[_0x1275('0x6')]);}})[_0x1275('0x7')](function(_0xa3d042){return _0x26b1ee(_0xa3d042);});});}exports[_0x1275('0x8')]=function(_0x224920,_0x238a43){return request(_0x1275('0x9'),{'account':_0x224920,'message':_0x238a43});}; \ No newline at end of file +var _0xfa9a=['client','request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1b9da3,_0x4e6c3d){var _0x4e23ff=function(_0x486381){while(--_0x486381){_0x1b9da3['push'](_0x1b9da3['shift']());}};_0x4e23ff(++_0x4e6c3d);}(_0xfa9a,0x9e));var _0xafa9=function(_0x1dbf56,_0x3d9934){_0x1dbf56=_0x1dbf56-0x0;var _0x3c82c9=_0xfa9a[_0x1dbf56];return _0x3c82c9;};'use strict';var BPromise=require(_0xafa9('0x0'));var jayson=require(_0xafa9('0x1'));var client=jayson[_0xafa9('0x2')]['http']({'port':0x232b});function request(_0x3984ef,_0x548166){return new BPromise(function(_0x29a258,_0x267f75){return client[_0xafa9('0x3')](_0x3984ef,_0x548166)[_0xafa9('0x4')](function(_0x17cc28){if(_0x17cc28['error']){return _0x267f75(_0x17cc28[_0xafa9('0x5')][_0xafa9('0x6')]);}else{return _0x29a258(_0x17cc28['result']);}})[_0xafa9('0x7')](function(_0x238f11){return _0x267f75(_0x238f11);});});}exports[_0xafa9('0x8')]=function(_0x3692c2,_0x3ffa4e){return request(_0xafa9('0x9'),{'account':_0x3692c2,'message':_0x3ffa4e});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 9d179bd..a19f62d 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1036=['addEdge','value','toJson','root','inspect','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','traverseBFS','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','error','agicommand\x20not\x20found','stack','calleridname','finally','vertex','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','length','source'];(function(_0x319906,_0x5164de){var _0x412602=function(_0x6e3b85){while(--_0x6e3b85){_0x319906['push'](_0x319906['shift']());}};_0x412602(++_0x5164de);}(_0x1036,0x9c));var _0x6103=function(_0x289824,_0x3b00ec){_0x289824=_0x289824-0x0;var _0x1cd9f8=_0x1036[_0x289824];return _0x1cd9f8;};'use strict';var _=require(_0x6103('0x0'));var moment=require(_0x6103('0x1'));var parser=require(_0x6103('0x2'));var util=require(_0x6103('0x3'));var logger=require(_0x6103('0x4'))(_0x6103('0x5'));var rpc=require(_0x6103('0x6'));var mailRpc=require(_0x6103('0x7'));var Graph=require(_0x6103('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3325b9){logger['error'](_0x6103('0x9'),_0x3325b9['stack']);return[];});}function addVertex(_0x526aa7,_0x155188,_0x4bdc25){_0x155188[_0x6103('0xa')]=_0x4bdc25;if(_0x155188[_0x6103('0xb')](_0x6103('0xc'))){_0x155188['maxRetry']=parseInt(_0x155188['retry'],0xa);}_0x526aa7[_0x6103('0xd')](_[_0x6103('0xe')](_0x155188,_0x6103('0xf')));}function initGraph(_0x2bb487,_0x5a49d5){var _0x50a998=new Graph();for(var _0x46c348 in _0x2bb487){if(_0x2bb487[_0x6103('0xb')](_0x46c348)){if(_['isArray'](_0x2bb487[_0x46c348])){for(var _0x475a88=0x0;_0x475a88<_0x2bb487[_0x46c348][_0x6103('0x10')];_0x475a88+=0x1){addVertex(_0x50a998,_0x2bb487[_0x46c348][_0x475a88],_0x46c348);}}else{addVertex(_0x50a998,_0x2bb487[_0x46c348],_0x46c348);}}}for(var _0x364334=0x0;_0x364334<_0x5a49d5[_0x6103('0x10')];_0x364334+=0x1){if(_0x5a49d5[_0x364334][_0x6103('0x11')]&&_0x5a49d5[_0x364334]['target']){_0x50a998[_0x6103('0x12')](_0x5a49d5[_0x364334]['source'],_0x5a49d5[_0x364334]['target'],_0x5a49d5[_0x364334][_0x6103('0x13')]);}}return _0x50a998;}function getRoot(_0x48736c){return parser[_0x6103('0x14')](_0x48736c,{'object':!![]})['mxGraphModel'][_0x6103('0x15')];}function inspect(_0x21c8a4){return util[_0x6103('0x16')](_0x21c8a4,{'showHidden':![],'depth':null});}function initialize(_0x54de5a,_0x78d983){var _0x1f9d40=getRoot(_0x54de5a['production']);if(!_0x1f9d40||!_0x1f9d40[_0x6103('0x17')])return;var _0x1b8f02,_0x197a1d,_0x261836;logger[_0x6103('0x18')]('root',JSON[_0x6103('0x19')](_0x1f9d40,null,0x2));_0x78d983[_0x6103('0x1a')]=moment()['format'](_0x6103('0x1b'));_0x1b8f02=initGraph(_[_0x6103('0xe')](_0x1f9d40,_0x6103('0xf')),_0x1f9d40[_0x6103('0xf')]);_0x197a1d=new Vertices(_0x78d983,rpc,mailRpc);logger[_0x6103('0x1c')](util[_0x6103('0x1d')](_0x6103('0x1e'),_0x78d983[_0x6103('0x1f')],_0x78d983['calleridname'],_0x78d983[_0x6103('0x20')],_0x78d983[_0x6103('0x21')],_0x78d983[_0x6103('0x22')]));_0x1b8f02[_0x6103('0x23')](_0x1f9d40[_0x6103('0x17')]['id'],function(_0x31c78f){try{_0x31c78f=_0x197a1d[_0x6103('0x24')](_0x31c78f);logger['debug']('vertex',JSON[_0x6103('0x19')](_0x31c78f,null,0x2));if(_0x31c78f[_0x6103('0xa')]==='gotoc'){logger[_0x6103('0x1c')](_0x6103('0x25'));_0x78d983[_0x6103('0x26')]=_0x31c78f[_0x6103('0x26')]||_0x78d983[_0x6103('0x26')];_0x78d983[_0x6103('0x27')]=_0x31c78f[_0x6103('0x27')];_0x78d983['priority']=_0x31c78f[_0x6103('0x28')]?_0x31c78f[_0x6103('0x28')]-0x1:0x1;return null;}else if(_0x31c78f&&_0x197a1d[_0x31c78f[_0x6103('0xa')]]){_0x261836=_0x197a1d[_0x31c78f[_0x6103('0xa')]](_0x31c78f);logger[_0x6103('0x1c')](_0x6103('0x29'),JSON[_0x6103('0x19')](_0x261836,null,0x2));if(_0x261836&&_0x261836['code']===AGI_CODE_SUCCESS&&_0x261836[_0x6103('0x2a')]!==AGI_RESULT_ERROR&&!_0x78d983[_0x6103('0x2b')]){logger['debug'](_0x6103('0x29'),inspect(_0x261836));return _[_0x6103('0x2c')](_0x261836[_0x6103('0x2a')])?null:_0x261836[_0x6103('0x2a')]['toString']();}else{logger[_0x6103('0x2d')]('response',inspect(_0x261836));return null;}}else{logger['error'](_0x6103('0x2e'));return null;}}catch(_0x2fe897){logger['error'](_0x2fe897[_0x6103('0x2f')]);return null;}});if(_0x1f9d40['finally']){logger[_0x6103('0x1c')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x78d983[_0x6103('0x1f')],_0x78d983[_0x6103('0x30')],_0x78d983['callerid'],_0x78d983[_0x6103('0x21')],_0x78d983[_0x6103('0x22')]));_0x1b8f02[_0x6103('0x23')](_0x1f9d40[_0x6103('0x31')]['id'],function(_0xda45f9){try{_0xda45f9=_0x197a1d[_0x6103('0x24')](_0xda45f9);logger[_0x6103('0x18')](_0x6103('0x32'),JSON['stringify'](_0xda45f9,null,0x2));if(_0xda45f9&&_0x197a1d[_0xda45f9[_0x6103('0xa')]]){_0x261836=_0x197a1d[_0xda45f9[_0x6103('0xa')]](_0xda45f9);if(_0x261836){logger[_0x6103('0x18')](_0x6103('0x29'),inspect(_0x261836));return _[_0x6103('0x2c')](_0x261836[_0x6103('0x2a')])?null:_0x261836[_0x6103('0x2a')][_0x6103('0x33')]();}else{logger[_0x6103('0x2d')]('response',inspect(_0x261836));return null;}}else{logger[_0x6103('0x2d')](_0x6103('0x2e'));return null;}}catch(_0x38d8ce){logger[_0x6103('0x2d')](_0x38d8ce[_0x6103('0x2f')]);return null;}});}logger[_0x6103('0x1c')](util['format'](_0x6103('0x34'),_0x78d983[_0x6103('0x1f')],_0x78d983[_0x6103('0x30')],_0x78d983['callerid'],_0x78d983['dnid'],_0x78d983[_0x6103('0x22')]));logger['info'](util[_0x6103('0x1d')](_0x6103('0x35'),_0x78d983[_0x6103('0x26')],_0x78d983[_0x6103('0x27')],parseInt(_0x78d983[_0x6103('0x28')],0xa)+0x1));_0x78d983['continueAt'](_0x78d983[_0x6103('0x26')],_0x78d983[_0x6103('0x27')],parseInt(_0x78d983['priority'],0xa)+0x1);_0x78d983[_0x6103('0x36')]();}function handleNotFound(_0x6aee1e){logger[_0x6103('0x2d')](util[_0x6103('0x1d')](_0x6103('0x37'),_0x6aee1e[_0x6103('0x1f')]));_0x6aee1e[_0x6103('0x38')](_0x6aee1e['context'],_0x6aee1e['extension'],parseInt(_0x6aee1e['priority'],0xa)+0x1);_0x6aee1e[_0x6103('0x36')]();}function handleUnpublished(_0x436db8){logger[_0x6103('0x2d')](util['format'](_0x6103('0x39'),_0x436db8[_0x6103('0x1f')]));_0x436db8['continueAt'](_0x436db8['context'],_0x436db8[_0x6103('0x27')],parseInt(_0x436db8[_0x6103('0x28')],0xa)+0x1);_0x436db8[_0x6103('0x36')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xc5fc=['calleridname','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','util','../../config/logger','./rpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','inspect','production','debug','root','stringify','joinAt','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','clear','vertex','gotoc','info','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x5ce41e,_0x934b39){var _0x237661=function(_0x6addd6){while(--_0x6addd6){_0x5ce41e['push'](_0x5ce41e['shift']());}};_0x237661(++_0x934b39);}(_0xc5fc,0x79));var _0xcc5f=function(_0x239c32,_0x98e899){_0x239c32=_0x239c32-0x0;var _0x4d2613=_0xc5fc[_0x239c32];return _0x4d2613;};'use strict';var _=require(_0xcc5f('0x0'));var moment=require(_0xcc5f('0x1'));var parser=require('xml2json');var util=require(_0xcc5f('0x2'));var logger=require(_0xcc5f('0x3'))('agi');var rpc=require(_0xcc5f('0x4'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xcc5f('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xcc5f('0x6')]()[_0xcc5f('0x7')](function(_0x3876f6){logger[_0xcc5f('0x8')](_0xcc5f('0x9'),_0x3876f6[_0xcc5f('0xa')]);return[];});}function addVertex(_0x5f5c32,_0x3ff808,_0x11fea9){_0x3ff808[_0xcc5f('0xb')]=_0x11fea9;if(_0x3ff808[_0xcc5f('0xc')](_0xcc5f('0xd'))){_0x3ff808[_0xcc5f('0xe')]=parseInt(_0x3ff808[_0xcc5f('0xd')],0xa);}_0x5f5c32[_0xcc5f('0xf')](_[_0xcc5f('0x10')](_0x3ff808,_0xcc5f('0x11')));}function initGraph(_0xb5dcb7,_0x2ba7b1){var _0x2a44d0=new Graph();for(var _0x393754 in _0xb5dcb7){if(_0xb5dcb7['hasOwnProperty'](_0x393754)){if(_['isArray'](_0xb5dcb7[_0x393754])){for(var _0x400df5=0x0;_0x400df5<_0xb5dcb7[_0x393754][_0xcc5f('0x12')];_0x400df5+=0x1){addVertex(_0x2a44d0,_0xb5dcb7[_0x393754][_0x400df5],_0x393754);}}else{addVertex(_0x2a44d0,_0xb5dcb7[_0x393754],_0x393754);}}}for(var _0x538d7e=0x0;_0x538d7e<_0x2ba7b1[_0xcc5f('0x12')];_0x538d7e+=0x1){if(_0x2ba7b1[_0x538d7e][_0xcc5f('0x13')]&&_0x2ba7b1[_0x538d7e][_0xcc5f('0x14')]){_0x2a44d0[_0xcc5f('0x15')](_0x2ba7b1[_0x538d7e][_0xcc5f('0x13')],_0x2ba7b1[_0x538d7e][_0xcc5f('0x14')],_0x2ba7b1[_0x538d7e][_0xcc5f('0x16')]);}}return _0x2a44d0;}function getRoot(_0x17891e){return parser['toJson'](_0x17891e,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x37d03a){return util[_0xcc5f('0x17')](_0x37d03a,{'showHidden':![],'depth':null});}function initialize(_0x4a8db8,_0xbeb1d5){var _0x179dcb=getRoot(_0x4a8db8[_0xcc5f('0x18')]);if(!_0x179dcb||!_0x179dcb['start'])return;var _0x29a817,_0x4a31d6,_0x5b60b1;logger[_0xcc5f('0x19')](_0xcc5f('0x1a'),JSON[_0xcc5f('0x1b')](_0x179dcb,null,0x2));_0xbeb1d5[_0xcc5f('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x29a817=initGraph(_[_0xcc5f('0x10')](_0x179dcb,_0xcc5f('0x11')),_0x179dcb[_0xcc5f('0x11')]);_0x4a31d6=new Vertices(_0xbeb1d5,rpc,mailRpc);logger['info'](util[_0xcc5f('0x1d')](_0xcc5f('0x1e'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5['calleridname'],_0xbeb1d5['callerid'],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));_0x29a817['traverseBFS'](_0x179dcb['start']['id'],function(_0x3feb96){try{_0x3feb96=_0x4a31d6[_0xcc5f('0x22')](_0x3feb96);logger[_0xcc5f('0x19')](_0xcc5f('0x23'),JSON[_0xcc5f('0x1b')](_0x3feb96,null,0x2));if(_0x3feb96[_0xcc5f('0xb')]===_0xcc5f('0x24')){logger[_0xcc5f('0x25')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0xbeb1d5[_0xcc5f('0x26')]=_0x3feb96[_0xcc5f('0x26')]||_0xbeb1d5[_0xcc5f('0x26')];_0xbeb1d5['extension']=_0x3feb96[_0xcc5f('0x27')];_0xbeb1d5[_0xcc5f('0x28')]=_0x3feb96['priority']?_0x3feb96[_0xcc5f('0x28')]-0x1:0x1;return null;}else if(_0x3feb96&&_0x4a31d6[_0x3feb96[_0xcc5f('0xb')]]){_0x5b60b1=_0x4a31d6[_0x3feb96[_0xcc5f('0xb')]](_0x3feb96);logger[_0xcc5f('0x25')](_0xcc5f('0x29'),JSON[_0xcc5f('0x1b')](_0x5b60b1,null,0x2));if(_0x5b60b1&&_0x5b60b1['code']===AGI_CODE_SUCCESS&&_0x5b60b1[_0xcc5f('0x2a')]!==AGI_RESULT_ERROR&&!_0xbeb1d5[_0xcc5f('0x2b')]){logger[_0xcc5f('0x19')]('response',inspect(_0x5b60b1));return _[_0xcc5f('0x2c')](_0x5b60b1[_0xcc5f('0x2a')])?null:_0x5b60b1[_0xcc5f('0x2a')][_0xcc5f('0x2d')]();}else{logger[_0xcc5f('0x8')]('response',inspect(_0x5b60b1));return null;}}else{logger[_0xcc5f('0x8')](_0xcc5f('0x2e'));return null;}}catch(_0xb3cab1){logger[_0xcc5f('0x8')](_0xb3cab1[_0xcc5f('0xa')]);return null;}});if(_0x179dcb[_0xcc5f('0x2f')]){logger[_0xcc5f('0x25')](util[_0xcc5f('0x1d')](_0xcc5f('0x30'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5['calleridname'],_0xbeb1d5['callerid'],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));_0x29a817['traverseBFS'](_0x179dcb[_0xcc5f('0x2f')]['id'],function(_0x4ad5c7){try{_0x4ad5c7=_0x4a31d6['clear'](_0x4ad5c7);logger['debug'](_0xcc5f('0x23'),JSON['stringify'](_0x4ad5c7,null,0x2));if(_0x4ad5c7&&_0x4a31d6[_0x4ad5c7['agicommand']]){_0x5b60b1=_0x4a31d6[_0x4ad5c7[_0xcc5f('0xb')]](_0x4ad5c7);if(_0x5b60b1){logger[_0xcc5f('0x19')](_0xcc5f('0x29'),inspect(_0x5b60b1));return _[_0xcc5f('0x2c')](_0x5b60b1[_0xcc5f('0x2a')])?null:_0x5b60b1['result'][_0xcc5f('0x2d')]();}else{logger[_0xcc5f('0x8')](_0xcc5f('0x29'),inspect(_0x5b60b1));return null;}}else{logger[_0xcc5f('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x45b81e){logger[_0xcc5f('0x8')](_0x45b81e[_0xcc5f('0xa')]);return null;}});}logger['info'](util[_0xcc5f('0x1d')](_0xcc5f('0x31'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5[_0xcc5f('0x32')],_0xbeb1d5[_0xcc5f('0x33')],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));logger[_0xcc5f('0x25')](util[_0xcc5f('0x1d')](_0xcc5f('0x34'),_0xbeb1d5[_0xcc5f('0x26')],_0xbeb1d5[_0xcc5f('0x27')],parseInt(_0xbeb1d5[_0xcc5f('0x28')],0xa)+0x1));_0xbeb1d5[_0xcc5f('0x35')](_0xbeb1d5[_0xcc5f('0x26')],_0xbeb1d5[_0xcc5f('0x27')],parseInt(_0xbeb1d5[_0xcc5f('0x28')],0xa)+0x1);_0xbeb1d5[_0xcc5f('0x36')]();}function handleNotFound(_0x20b190){logger[_0xcc5f('0x8')](util['format'](_0xcc5f('0x37'),_0x20b190['arg_1']));_0x20b190[_0xcc5f('0x35')](_0x20b190[_0xcc5f('0x26')],_0x20b190[_0xcc5f('0x27')],parseInt(_0x20b190[_0xcc5f('0x28')],0xa)+0x1);_0x20b190[_0xcc5f('0x36')]();}function handleUnpublished(_0x3df5dd){logger[_0xcc5f('0x8')](util[_0xcc5f('0x1d')](_0xcc5f('0x38'),_0x3df5dd[_0xcc5f('0x1f')]));_0x3df5dd[_0xcc5f('0x35')](_0x3df5dd['context'],_0x3df5dd['extension'],parseInt(_0x3df5dd[_0xcc5f('0x28')],0xa)+0x1);_0x3df5dd[_0xcc5f('0x36')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b047b26..c5cdd90 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 _0xee5b=['trim','headers','line','exports','util','Transform','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice'];(function(_0x4a6ee2,_0x4bd476){var _0x82604d=function(_0x2e970c){while(--_0x2e970c){_0x4a6ee2['push'](_0x4a6ee2['shift']());}};_0x82604d(++_0x4bd476);}(_0xee5b,0x1f4));var _0xbee5=function(_0x496262,_0x67a9cb){_0x496262=_0x496262-0x0;var _0x44deff=_0xee5b[_0x496262];return _0x44deff;};'use strict';var util=require(_0xbee5('0x0'));var Transform=require('stream')[_0xbee5('0x1')];function AGIReply(_0x203bba){Transform['call'](this,_0x203bba);this[_0xbee5('0x2')]='';this[_0xbee5('0x3')]=![];}util[_0xbee5('0x4')](AGIReply,Transform);AGIReply[_0xbee5('0x5')]['_transform']=function(_0x5200b1,_0x2e8127,_0x2c0bde){var _0xab6e4d='\x0a',_0x804ab8=['\x0a\x0a',_0xbee5('0x6')],_0x4f5065=-0x1,_0x5505e3=-0x1,_0x53d5b9='',_0x5baf5c=0x0,_0x5536bd='',_0x20c66c='';this[_0xbee5('0x2')]+=_0x5200b1[_0xbee5('0x7')]();_0x5536bd=this['_localBuffer'];if(!this[_0xbee5('0x3')]){_0x5baf5c=0x0;while(_0x804ab8[_0x5baf5c]){while((_0x5505e3=_0x5536bd[_0xbee5('0x8')](_0x804ab8[_0x5baf5c]))!=-0x1){_0x53d5b9=_0x804ab8[_0x5baf5c];_0x20c66c=_0x5536bd[_0xbee5('0x9')](0x0,_0x5505e3);_0x5536bd=_0x5536bd[_0xbee5('0x9')](_0x5505e3+_0x53d5b9[_0xbee5('0xa')]);var _0x1509c7=_0x20c66c['split'](_0xab6e4d),_0x105e16=0x0,_0x17ee3c={},_0xcef158='',_0x48f771='',_0x14e032=-0x1;while(_0x1509c7[_0x105e16]){_0x14e032=_0x1509c7[_0x105e16][_0xbee5('0x8')](':');if(_0x14e032!=-0x1){_0xcef158=_0x1509c7[_0x105e16][_0xbee5('0xb')](0x0,_0x14e032)[_0xbee5('0xc')]();_0x48f771=_0x1509c7[_0x105e16]['slice'](_0x14e032+0x1)['trim']();if(_0xcef158[_0xbee5('0xa')]>0x0){_0x17ee3c[_0xcef158]=_0x48f771;}}else{}_0x105e16++;}this['emit'](_0xbee5('0xd'),_0x17ee3c);this['_inBody']=!![];}_0x5baf5c++;}this[_0xbee5('0x2')]=_0x5536bd;}else{while((_0x4f5065=_0x5536bd[_0xbee5('0x8')](_0xab6e4d))!=-0x1){_0x20c66c=_0x5536bd[_0xbee5('0x9')](0x0,_0x4f5065);this['emit'](_0xbee5('0xe'),_0x20c66c);_0x5536bd=_0x5536bd[_0xbee5('0x9')](_0x4f5065+_0xab6e4d['length']);}this[_0xbee5('0x2')]=_0x5536bd;}_0x2c0bde();};module[_0xbee5('0xf')]=AGIReply; \ No newline at end of file +var _0xd5fe=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','_inBody','line','exports','util','stream','_localBuffer','prototype','_transform'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0xd5fe[_0x27c25f];return _0x2da4c4;};'use strict';var util=require(_0xed5f('0x0'));var Transform=require(_0xed5f('0x1'))['Transform'];function AGIReply(_0x4081be){Transform['call'](this,_0x4081be);this[_0xed5f('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xed5f('0x3')][_0xed5f('0x4')]=function(_0x480b23,_0x5dee27,_0x467a03){var _0x20a6b9='\x0a',_0x3a98a7=['\x0a\x0a',_0xed5f('0x5')],_0x281196=-0x1,_0x21f73a=-0x1,_0x2c1ae3='',_0x58cb03=0x0,_0xf9ac71='',_0x4f941d='';this['_localBuffer']+=_0x480b23[_0xed5f('0x6')]();_0xf9ac71=this[_0xed5f('0x2')];if(!this['_inBody']){_0x58cb03=0x0;while(_0x3a98a7[_0x58cb03]){while((_0x21f73a=_0xf9ac71[_0xed5f('0x7')](_0x3a98a7[_0x58cb03]))!=-0x1){_0x2c1ae3=_0x3a98a7[_0x58cb03];_0x4f941d=_0xf9ac71[_0xed5f('0x8')](0x0,_0x21f73a);_0xf9ac71=_0xf9ac71[_0xed5f('0x8')](_0x21f73a+_0x2c1ae3[_0xed5f('0x9')]);var _0x538a56=_0x4f941d[_0xed5f('0xa')](_0x20a6b9),_0x89a468=0x0,_0x185830={},_0xc738d7='',_0x51b774='',_0x5c138b=-0x1;while(_0x538a56[_0x89a468]){_0x5c138b=_0x538a56[_0x89a468][_0xed5f('0x7')](':');if(_0x5c138b!=-0x1){_0xc738d7=_0x538a56[_0x89a468][_0xed5f('0xb')](0x0,_0x5c138b)[_0xed5f('0xc')]();_0x51b774=_0x538a56[_0x89a468][_0xed5f('0xb')](_0x5c138b+0x1)[_0xed5f('0xc')]();if(_0xc738d7[_0xed5f('0x9')]>0x0){_0x185830[_0xc738d7]=_0x51b774;}}else{}_0x89a468++;}this[_0xed5f('0xd')](_0xed5f('0xe'),_0x185830);this[_0xed5f('0xf')]=!![];}_0x58cb03++;}this[_0xed5f('0x2')]=_0xf9ac71;}else{while((_0x281196=_0xf9ac71[_0xed5f('0x7')](_0x20a6b9))!=-0x1){_0x4f941d=_0xf9ac71[_0xed5f('0x8')](0x0,_0x281196);this['emit'](_0xed5f('0x10'),_0x4f941d);_0xf9ac71=_0xf9ac71[_0xed5f('0x8')](_0x281196+_0x20a6b9[_0xed5f('0x9')]);}this['_localBuffer']=_0xf9ac71;}_0x467a03();};module[_0xed5f('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f46674e..f3165db 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 _0x76bb=['CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact'];(function(_0x1b9805,_0x5f065f){var _0x3ccea0=function(_0x36036b){while(--_0x36036b){_0x1b9805['push'](_0x1b9805['shift']());}};_0x3ccea0(++_0x5f065f);}(_0x76bb,0x16a));var _0xb76b=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x76bb[_0x2179f1];return _0x176ec9;};'use strict';var _=require('lodash');var moment=require(_0xb76b('0x0'));var jayson=require(_0xb76b('0x1'));var client=jayson[_0xb76b('0x2')][_0xb76b('0x3')]({'port':0x2329});function request(_0x4cd8bc,_0x3045e6){return new Promise(function(_0x1f5d45,_0x4e5042){return client[_0xb76b('0x4')](_0x4cd8bc,_0x3045e6)[_0xb76b('0x5')](function(_0x5c732e){if(_0x5c732e[_0xb76b('0x6')]){return _0x4e5042(_0x5c732e[_0xb76b('0x6')][_0xb76b('0x7')]);}else{return _0x1f5d45(_0x5c732e[_0xb76b('0x8')]);}})[_0xb76b('0x9')](function(_0x4f0c27){return _0x4e5042(_0x4f0c27);});});}exports[_0xb76b('0xa')]=function(){return request(_0xb76b('0xb'),{'options':{'raw':![],'attributes':['id',_0xb76b('0xc'),_0xb76b('0xd')]}});};exports['getSquareProject']=function(_0x53b43c){return request(_0xb76b('0xe'),{'options':{'raw':![],'where':{'name':_0x53b43c},'attributes':[_0xb76b('0xd')]}});};exports[_0xb76b('0xf')]=function(_0x2ebb61){return request(_0xb76b('0x10'),{'options':{'raw':![],'where':{'id':_0x2ebb61},'include':[{'model':_0xb76b('0x11'),'as':_0xb76b('0x12'),'include':[{'model':_0xb76b('0x13'),'as':'CloudProvider'}]}],'attributes':['id',_0xb76b('0xc'),'email'],'smtp':!![]}});};exports[_0xb76b('0x14')]=function(_0x3f8bc7){return request(_0xb76b('0xe'),{'options':{'where':{'id':_0x3f8bc7},'attributes':[_0xb76b('0xc')]}});};exports['getVoiceQueueById']=function(_0x10a6aa){return request(_0xb76b('0x15'),{'options':{'where':{'id':_0x10a6aa},'attributes':['name']}});};exports[_0xb76b('0x16')]=function(_0x4c642d){return request(_0xb76b('0x17'),{'options':{'where':{'id':_0x4c642d},'attributes':[_0xb76b('0xc')]}});};exports[_0xb76b('0x18')]=function(_0x4618b7){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4618b7},'attributes':['dsn']}});};exports[_0xb76b('0x19')]=function(_0x1a6b2f){return request('ShowUser',{'options':{'where':{'id':_0x1a6b2f},'attributes':[_0xb76b('0xc')]}});};exports[_0xb76b('0x1a')]=function(_0xe67ff4){return request(_0xb76b('0x1b'),{'options':{'where':{'phone':_0xe67ff4[_0xb76b('0x1c')]},'attributes':['id']}});};exports[_0xb76b('0x1d')]=function(_0x1c4d0a){return request('ShowTrunk',{'options':{'where':{'id':_0x1c4d0a},'attributes':['name']}});};exports[_0xb76b('0x1e')]=function(_0x3c1e38){return request(_0xb76b('0x1f'),{'options':{'where':{'id':_0x3c1e38},'attributes':[_0xb76b('0x20')]}});};exports[_0xb76b('0x21')]=function(_0x5c142d){return request(_0xb76b('0x22'),{'options':{'raw':![],'where':{'id':_0x5c142d},'include':[{'model':'Interval','as':_0xb76b('0x23')}]}});};exports[_0xb76b('0x24')]=function(_0x18dc90){return request(_0xb76b('0x25'),{'options':{'where':{'id':_0x18dc90},'attributes':['id','name']}});};exports[_0xb76b('0x26')]=function(_0x2b4f3f){return request(_0xb76b('0x27'),{'body':_0x2b4f3f});};exports[_0xb76b('0x28')]=function(_0x844a15){return request('CreateSquareDetailsReport',{'body':_0x844a15});};exports[_0xb76b('0x29')]=function(_0x44ec61){return request('CreateSquareReport',{'body':_[_0xb76b('0x2a')](_0x44ec61,{'project_name':_0x44ec61['arg_1'],'prev_project_name':_0x44ec61['arg_2']||'','is_subproject':_0x44ec61[_0xb76b('0x2b')]?!![]:![],'leaveAt':moment()[_0xb76b('0x2c')](_0xb76b('0x2d'))})});};exports[_0xb76b('0x2e')]=function(_0x49f53c){return request(_0xb76b('0x2f'),{'body':_0x49f53c});};exports[_0xb76b('0x30')]=function(_0x1ebda2){return request(_0xb76b('0x31'),{'body':_0x1ebda2});};exports[_0xb76b('0x32')]=function(_0x1cf72b){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1cf72b[_0xb76b('0x1c')],'ListId':_0x1cf72b['ListId']}}})['then'](function(_0x130263){if(_0x130263){return _0x130263;}return request(_0xb76b('0x33'),{'body':_0x1cf72b});});};exports['getPauseById']=function(_0x5b56e4){return request(_0xb76b('0x34'),{'options':{'where':{'id':_0x5b56e4},'attributes':[_0xb76b('0xc')]}});};exports['agentLogin']=function(_0x2a60db,_0x25189c){return request(_0xb76b('0x35'),{'body':{'interface':_0x25189c},'options':{'where':_0x2a60db}});};exports[_0xb76b('0x36')]=function(_0x5c4469,_0x3425bd,_0x36e586){return request(_0xb76b('0x37'),{'body':{'type':_0x3425bd,'uniqueid':_0x36e586},'options':{'where':_0x5c4469}});};exports[_0xb76b('0x38')]=function(_0x4ee758){return request('UnpauseUser',{'body':{},'options':{'where':_0x4ee758}});};exports[_0xb76b('0x39')]=function(_0x4db2b1){return request(_0xb76b('0x3a'),{'body':{},'options':{'where':_0x4db2b1}});}; \ No newline at end of file +var _0x8743=['agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','then','error','message','catch','getSquareProjects','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','agentPause'];(function(_0x2a2a08,_0xe94437){var _0x9d3d37=function(_0x4cdc9a){while(--_0x4cdc9a){_0x2a2a08['push'](_0x2a2a08['shift']());}};_0x9d3d37(++_0xe94437);}(_0x8743,0x7a));var _0x3874=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8743[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3874('0x0'));var moment=require(_0x3874('0x1'));var jayson=require(_0x3874('0x2'));var client=jayson['client'][_0x3874('0x3')]({'port':0x2329});function request(_0x2c398d,_0x4bc542){return new Promise(function(_0x511fe6,_0x35cd1b){return client[_0x3874('0x4')](_0x2c398d,_0x4bc542)[_0x3874('0x5')](function(_0x531cb6){if(_0x531cb6['error']){return _0x35cd1b(_0x531cb6[_0x3874('0x6')][_0x3874('0x7')]);}else{return _0x511fe6(_0x531cb6['result']);}})[_0x3874('0x8')](function(_0x3ecd70){return _0x35cd1b(_0x3ecd70);});});}exports[_0x3874('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x3874('0xa')]=function(_0x5294db){return request(_0x3874('0xb'),{'options':{'raw':![],'where':{'name':_0x5294db},'attributes':[_0x3874('0xc')]}});};exports['getMailAccountById']=function(_0x5017c2){return request(_0x3874('0xd'),{'options':{'raw':![],'where':{'id':_0x5017c2},'include':[{'model':_0x3874('0xe'),'as':_0x3874('0xf'),'include':[{'model':_0x3874('0x10'),'as':_0x3874('0x10')}]}],'attributes':['id',_0x3874('0x11'),'email'],'smtp':!![]}});};exports[_0x3874('0x12')]=function(_0xcaa466){return request(_0x3874('0xb'),{'options':{'where':{'id':_0xcaa466},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x13')]=function(_0xb75788){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xb75788},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x14')]=function(_0x389320){return request(_0x3874('0x15'),{'options':{'where':{'id':_0x389320},'attributes':[_0x3874('0x11')]}});};exports['getSquareOdbcById']=function(_0x2518ef){return request(_0x3874('0x16'),{'options':{'where':{'id':_0x2518ef},'attributes':['dsn']}});};exports[_0x3874('0x17')]=function(_0x121540){return request(_0x3874('0x18'),{'options':{'where':{'id':_0x121540},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x19')]=function(_0x2798ae){return request(_0x3874('0x1a'),{'options':{'where':{'phone':_0x2798ae[_0x3874('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x56b53f){return request(_0x3874('0x1c'),{'options':{'where':{'id':_0x56b53f},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x1d')]=function(_0x2f45bc){return request(_0x3874('0x1e'),{'options':{'where':{'id':_0x2f45bc},'attributes':[_0x3874('0x1f')]}});};exports[_0x3874('0x20')]=function(_0x4be207){return request(_0x3874('0x21'),{'options':{'raw':![],'where':{'id':_0x4be207},'include':[{'model':'Interval','as':_0x3874('0x22')}]}});};exports[_0x3874('0x23')]=function(_0x5c7819){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5c7819},'attributes':['id',_0x3874('0x11')]}});};exports[_0x3874('0x24')]=function(_0x104d3e){return request('CreateSmsMessage',{'body':_0x104d3e});};exports[_0x3874('0x25')]=function(_0x13dfd4){return request('CreateSquareDetailsReport',{'body':_0x13dfd4});};exports[_0x3874('0x26')]=function(_0x2abf25){return request(_0x3874('0x27'),{'body':_[_0x3874('0x28')](_0x2abf25,{'project_name':_0x2abf25[_0x3874('0x29')],'prev_project_name':_0x2abf25[_0x3874('0x2a')]||'','is_subproject':_0x2abf25[_0x3874('0x2a')]?!![]:![],'leaveAt':moment()[_0x3874('0x2b')](_0x3874('0x2c'))})});};exports[_0x3874('0x2d')]=function(_0x51e084){return request(_0x3874('0x2e'),{'body':_0x51e084});};exports[_0x3874('0x2f')]=function(_0x547c3d){return request('CreateSquareMessage',{'body':_0x547c3d});};exports[_0x3874('0x30')]=function(_0x415dc2){return request(_0x3874('0x31'),{'options':{'raw':![],'where':{'phone':_0x415dc2[_0x3874('0x1b')],'ListId':_0x415dc2[_0x3874('0x32')]}}})[_0x3874('0x5')](function(_0x4eb71e){if(_0x4eb71e){return _0x4eb71e;}return request('CreateCmContact',{'body':_0x415dc2});});};exports[_0x3874('0x33')]=function(_0x29d99f){return request(_0x3874('0x34'),{'options':{'where':{'id':_0x29d99f},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x35')]=function(_0x2ea0ca,_0x13e6dd){return request('LoginUser',{'body':{'interface':_0x13e6dd},'options':{'where':_0x2ea0ca}});};exports[_0x3874('0x36')]=function(_0x58c1a6,_0x2b8e1f,_0x30cb2c){return request('PauseUser',{'body':{'type':_0x2b8e1f,'uniqueid':_0x30cb2c},'options':{'where':_0x58c1a6}});};exports[_0x3874('0x37')]=function(_0x8b49b8){return request(_0x3874('0x38'),{'body':{},'options':{'where':_0x8b49b8}});};exports[_0x3874('0x39')]=function(_0x54e00b){return request(_0x3874('0x3a'),{'body':{},'options':{'where':_0x54e00b}});}; \ 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 a892d34..2e06af5 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 _0x7fd6=['exports','./polly'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x7fd6,0x157));var _0x67fd=function(_0x295329,_0x26ca89){_0x295329=_0x295329-0x0;var _0x4f3258=_0x7fd6[_0x295329];return _0x4f3258;};var polly=require(_0x67fd('0x0'));var lex=require('./lex');module[_0x67fd('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xe599=['./lex','exports','./polly'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe599,0x1e5));var _0x9e59=function(_0x5a474f,_0x1336ca){_0x5a474f=_0x5a474f-0x0;var _0x58f2bd=_0xe599[_0x5a474f];return _0x58f2bd;};var polly=require(_0x9e59('0x0'));var lex=require(_0x9e59('0x1'));module[_0x9e59('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 058d0c6..72296e1 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 _0x5b02=['exports','./lib/api'];(function(_0xb74ef8,_0x3402cf){var _0x4ff3a4=function(_0x26c5a){while(--_0x26c5a){_0xb74ef8['push'](_0xb74ef8['shift']());}};_0x4ff3a4(++_0x3402cf);}(_0x5b02,0xe9));var _0x25b0=function(_0x4885cd,_0xef6787){_0x4885cd=_0x4885cd-0x0;var _0x169220=_0x5b02[_0x4885cd];return _0x169220;};'use strict';var lex=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e){return lex(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e);}; \ No newline at end of file +var _0xb688=['exports'];(function(_0x3ce522,_0x3b550e){var _0x3cec1a=function(_0x25f50f){while(--_0x25f50f){_0x3ce522['push'](_0x3ce522['shift']());}};_0x3cec1a(++_0x3b550e);}(_0xb688,0xcf));var _0x8b68=function(_0x1f07c9,_0x170120){_0x1f07c9=_0x1f07c9-0x0;var _0x34aaf5=_0xb688[_0x1f07c9];return _0x34aaf5;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);}; \ 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 80941c5..ee9b83c 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 _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5815c6,_0x2cd5d7){var _0x1605f1=function(_0x3b5a11){while(--_0x3b5a11){_0x5815c6['push'](_0x5815c6['shift']());}};_0x1605f1(++_0x2cd5d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x28211a,_0xb8a582){var _0x453aaa=function(_0xa4c76d){while(--_0xa4c76d){_0x28211a['push'](_0x28211a['shift']());}};_0x453aaa(++_0xb8a582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ 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 6d42e6f..eb21c84 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 _0xaf8b=['exports','./lib/api'];(function(_0x480f14,_0x36d818){var _0x3c0829=function(_0x33bafc){while(--_0x33bafc){_0x480f14['push'](_0x480f14['shift']());}};_0x3c0829(++_0x36d818);}(_0xaf8b,0x1ab));var _0xbaf8=function(_0x5aa49b,_0x207dd1){_0x5aa49b=_0x5aa49b-0x0;var _0x2239fd=_0xaf8b[_0x5aa49b];return _0x2239fd;};'use strict';var polly=require(_0xbaf8('0x0'));module[_0xbaf8('0x1')]=function(_0x25032d,_0x429f2a,_0x324320,_0x4a5d58,_0x2c53c5,_0x3cbf69,_0xf460f7){return polly(_0x25032d,_0x429f2a,_0x324320,_0x4a5d58,_0x2c53c5,_0x3cbf69,_0xf460f7);}; \ No newline at end of file +var _0x438e=['./lib/api'];(function(_0x5ebcc2,_0x7ac56b){var _0xb43585=function(_0x1d999b){while(--_0x1d999b){_0x5ebcc2['push'](_0x5ebcc2['shift']());}};_0xb43585(++_0x7ac56b);}(_0x438e,0xf0));var _0xe438=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x438e[_0x3902c1];return _0x1266cc;};'use strict';var polly=require(_0xe438('0x0'));module['exports']=function(_0x56f09a,_0x505048,_0x517c89,_0x5dc497,_0x18877f,_0x450ad8,_0x4d8015){return polly(_0x56f09a,_0x505048,_0x517c89,_0x5dc497,_0x18877f,_0x450ad8,_0x4d8015);}; \ 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 820cae6..7f80780 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 _0xe019=['exports','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3245d4,_0x380f8f){var _0x359f5e=function(_0x1d4890){while(--_0x1d4890){_0x3245d4['push'](_0x3245d4['shift']());}};_0x359f5e(++_0x380f8f);}(_0xe019,0x163));var _0x9e01=function(_0x5d6e8a,_0x169065){_0x5d6e8a=_0x5d6e8a-0x0;var _0x166ece=_0xe019[_0x5d6e8a];return _0x166ece;};'use strict';var fs=require('fs');var path=require(_0x9e01('0x0'));var BPromise=require('bluebird');var rs=require(_0x9e01('0x1'));var AWS=require(_0x9e01('0x2'));function pollyResult(_0x5bc260,_0x1a8b09,_0x260bf0){return new BPromise(function(_0x3adf2c,_0x8d7c0f){_0x5bc260[_0x9e01('0x3')](_0x1a8b09,function(_0xc0baf6,_0x1784b){if(_0xc0baf6){_0x8d7c0f(_0xc0baf6);}else if(_0x1784b){if(_0x1784b[_0x9e01('0x4')]instanceof Buffer){fs[_0x9e01('0x5')](_0x260bf0,_0x1784b[_0x9e01('0x4')],function(_0x50a356){if(_0x50a356){_0x8d7c0f(_0x50a356);}else{_0x3adf2c();}});}else{_0x8d7c0f(new Error(_0x9e01('0x6')));}}else{_0x8d7c0f(new Error(_0x9e01('0x7')));}});});}module[_0x9e01('0x8')]=function(_0x34d201,_0x2281db,_0x338b58,_0x32fd25,_0x30b432,_0x520b5e,_0x1fe329){var _0x360529=new AWS['Polly']({'accessKeyId':_0x34d201,'secretAccessKey':_0x2281db,'region':_0x338b58});var _0x1559bf={'Text':_0x30b432,'TextType':_0x520b5e||_0x9e01('0x9'),'OutputFormat':_0x9e01('0xa'),'VoiceId':_0x32fd25};return pollyResult(_0x360529,_0x1559bf,_0x1fe329);}; \ No newline at end of file +var _0xf418=['mp3','path','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf418,0xd0));var _0x8f41=function(_0x267136,_0x249002){_0x267136=_0x267136-0x0;var _0x2b102e=_0xf418[_0x267136];return _0x2b102e;};'use strict';var fs=require('fs');var path=require(_0x8f41('0x0'));var BPromise=require('bluebird');var rs=require(_0x8f41('0x1'));var AWS=require(_0x8f41('0x2'));function pollyResult(_0x1f96a4,_0x51b316,_0x9fb03a){return new BPromise(function(_0xf39878,_0x259976){_0x1f96a4[_0x8f41('0x3')](_0x51b316,function(_0x4d29ab,_0x4083d4){if(_0x4d29ab){_0x259976(_0x4d29ab);}else if(_0x4083d4){if(_0x4083d4['AudioStream']instanceof Buffer){fs[_0x8f41('0x4')](_0x9fb03a,_0x4083d4[_0x8f41('0x5')],function(_0x447c0e){if(_0x447c0e){_0x259976(_0x447c0e);}else{_0xf39878();}});}else{_0x259976(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x259976(new Error(_0x8f41('0x6')));}});});}module['exports']=function(_0x3ae8f8,_0x13545e,_0x338df6,_0xc0c2d0,_0x5b3fda,_0xbb6a9,_0x4ce095){var _0x2973fb=new AWS[(_0x8f41('0x7'))]({'accessKeyId':_0x3ae8f8,'secretAccessKey':_0x13545e,'region':_0x338df6});var _0x3cc893={'Text':_0x5b3fda,'TextType':_0xbb6a9||'text','OutputFormat':_0x8f41('0x8'),'VoiceId':_0xc0c2d0};return pollyResult(_0x2973fb,_0x3cc893,_0x4ce095);}; \ 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 805584a..709dac5 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 _0xf04b=['./lib/api'];(function(_0x5cc652,_0x45dd0a){var _0x136031=function(_0x20298c){while(--_0x20298c){_0x5cc652['push'](_0x5cc652['shift']());}};_0x136031(++_0x45dd0a);}(_0xf04b,0x6a));var _0xbf04=function(_0x1c5b3d,_0x53463b){_0x1c5b3d=_0x1c5b3d-0x0;var _0x4f55f7=_0xf04b[_0x1c5b3d];return _0x4f55f7;};'use strict';var asr=require(_0xbf04('0x0'));module['exports']=function(_0x36281f,_0x62d9ab,_0x329ef1,_0x5f361c){return asr(_0x36281f,_0x62d9ab,_0x329ef1);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x51663d,_0x534aef,_0x191272,_0x4d1399){return asr(_0x51663d,_0x534aef,_0x191272);}; \ 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 bbc21cd..cac6875 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 _0x0c6d=['length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string'];(function(_0x105a9d,_0x5a66f3){var _0x17b1b7=function(_0x39f7fb){while(--_0x39f7fb){_0x105a9d['push'](_0x105a9d['shift']());}};_0x17b1b7(++_0x5a66f3);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x5137c6,_0x43a1ea){_0x5137c6=_0x5137c6-0x0;var _0x454ea2=_0x0c6d[_0x5137c6];return _0x454ea2;};'use strict';var url=require('url');var BPromise=require(_0xd0c6('0x0'));var fs=require('fs');var host=_0xd0c6('0x1');module[_0xd0c6('0x2')]=function(_0x42a166,_0x18ccf3,_0x3d5f2b){return new BPromise(function(_0x5790fc,_0x434cdd){var _0x511921;if(typeof _0x42a166!=='string'||_0x42a166['length']===0x0){return _0x434cdd(_0xd0c6('0x3'));}if(typeof _0x18ccf3!==_0xd0c6('0x4')||_0x18ccf3[_0xd0c6('0x5')]===0x0){return _0x434cdd('key\x20should\x20be\x20a\x20string');}if(typeof _0x3d5f2b!==_0xd0c6('0x6')&&(typeof _0x3d5f2b!=='string'||_0x3d5f2b[_0xd0c6('0x5')]===0x0)){return _0x434cdd(_0xd0c6('0x7'));}try{_0x511921=fs[_0xd0c6('0x8')](_0x42a166)[_0xd0c6('0x9')](_0xd0c6('0xa'));}catch(_0x2a1be){return _0x434cdd(_0x2a1be);}return _0x5790fc({'method':_0xd0c6('0xb'),'uri':host+_0xd0c6('0xc')+_0x18ccf3,'body':{'config':{'encoding':_0xd0c6('0xd'),'sampleRateHertz':'8000','languageCode':_0x3d5f2b},'audio':{'content':_0x511921}},'json':!![]});});}; \ No newline at end of file +var _0x7119=['base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7119,0x1c7));var _0x9711=function(_0x2f36d2,_0x24285c){_0x2f36d2=_0x2f36d2-0x0;var _0x147f7f=_0x7119[_0x2f36d2];return _0x147f7f;};'use strict';var url=require('url');var BPromise=require(_0x9711('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x9711('0x1')]=function(_0x5843e8,_0x347925,_0x443d8f){return new BPromise(function(_0x36cd4d,_0x2de7dd){var _0x47dda0;if(typeof _0x5843e8!==_0x9711('0x2')||_0x5843e8[_0x9711('0x3')]===0x0){return _0x2de7dd(_0x9711('0x4'));}if(typeof _0x347925!==_0x9711('0x2')||_0x347925[_0x9711('0x3')]===0x0){return _0x2de7dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x443d8f!==_0x9711('0x5')&&(typeof _0x443d8f!==_0x9711('0x2')||_0x443d8f[_0x9711('0x3')]===0x0)){return _0x2de7dd('lang\x20should\x20be\x20a\x20string');}try{_0x47dda0=fs[_0x9711('0x6')](_0x5843e8)['toString'](_0x9711('0x7'));}catch(_0x16e820){return _0x2de7dd(_0x16e820);}return _0x36cd4d({'method':_0x9711('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x347925,'body':{'config':{'encoding':_0x9711('0x9'),'sampleRateHertz':_0x9711('0xa'),'languageCode':_0x443d8f},'audio':{'content':_0x47dda0}},'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 07ba886..5ea50fc 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 _0xa96a=['./asr','exports'];(function(_0x4efd3d,_0x2b9694){var _0x1293f2=function(_0x14b90f){while(--_0x14b90f){_0x4efd3d['push'](_0x4efd3d['shift']());}};_0x1293f2(++_0x2b9694);}(_0xa96a,0x6a));var _0xaa96=function(_0x17812e,_0x429028){_0x17812e=_0x17812e-0x0;var _0x256192=_0xa96a[_0x17812e];return _0x256192;};var asr=require(_0xaa96('0x0'));module[_0xaa96('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2c29=['./asr','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c29,0x17e));var _0x92c2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2c29[_0x502c7d];return _0x30b7ed;};var asr=require(_0x92c2('0x0'));module[_0x92c2('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 8cf7862..994dc3f 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 _0xd61f=['readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','chmodSync','then','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','null','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','message','googleDialogflow','result','source','speech','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','path','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','protocol','https:','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','unlink','777'];(function(_0x580f82,_0x30981b){var _0x52cc9a=function(_0x477a12){while(--_0x477a12){_0x580f82['push'](_0x580f82['shift']());}};_0x52cc9a(++_0x30981b);}(_0xd61f,0x1e9));var _0xfd61=function(_0x262c30,_0x210c8e){_0x262c30=_0x262c30-0x0;var _0x42bee3=_0xd61f[_0x262c30];return _0x42bee3;};'use strict';var apiai=require(_0xfd61('0x0'));var BPromise=require(_0xfd61('0x1'));var dialogflow=require(_0xfd61('0x2'));var fs=require('fs');var http=require(_0xfd61('0x3'));var https=require('https');var md5=require('md5');var path=require(_0xfd61('0x4'));var querystring=require('querystring');var rp=require(_0xfd61('0x5'));var rs=require(_0xfd61('0x6'));var sox=require(_0xfd61('0x7'));var tts=require(_0xfd61('0x8'));var urlParse=require(_0xfd61('0x9'))[_0xfd61('0xa')];var util=require('util');var aws=require(_0xfd61('0xb'));var google=require(_0xfd61('0xc'));var sestek=require(_0xfd61('0xd'));var tilde=require('./tilde');var logger=require(_0xfd61('0xe'))(_0xfd61('0xf'));var ISPEECH_API=_0xfd61('0x10');function downloadFile(_0x3e0979,_0x5e2808){return new BPromise(function(_0x4ef025,_0x38d034){var _0x26ea3d=urlParse(_0x3e0979);var _0x1f800d=_0x26ea3d['protocol']==='https:'?https:http;var _0x4ad766={'host':_0x26ea3d[_0xfd61('0x11')],'path':_0x26ea3d[_0xfd61('0x4')],'headers':{'user-agent':_0xfd61('0x12')}};_0x1f800d[_0xfd61('0x13')](_0x4ad766,function(_0xed64dd){if(_0xed64dd[_0xfd61('0x14')]!==0xc8){logger['error'](_0xfd61('0x15')+_0x3e0979+_0xfd61('0x16')+_0xed64dd[_0xfd61('0x14')]+'\x20('+_0xed64dd[_0xfd61('0x17')]+')');_0x38d034(new Error('request\x20to\x20'+_0x3e0979+'\x20failed,\x20status\x20code\x20=\x20'+_0xed64dd[_0xfd61('0x14')]+'\x20('+_0xed64dd['statusMessage']+')'));return;}var _0x493279=fs['createWriteStream'](_0x5e2808);_0x493279['on'](_0xfd61('0x18'),function(){logger[_0xfd61('0x19')](_0xfd61('0x1a'));_0x493279[_0xfd61('0x1b')](_0x4ef025);});_0x493279['on'](_0xfd61('0x1c'),function(_0x2946e4){fs['unlink'](_0x5e2808);logger['error'](_0xfd61('0x1d'),_0x2946e4);_0x38d034(_0x2946e4);});_0xed64dd[_0xfd61('0x1e')](_0x493279);})['on']('error',function(_0x28530f){logger[_0xfd61('0x1c')](_0x28530f);_0x38d034(_0x28530f);})[_0xfd61('0x1f')]();});}function uploadFile(_0x419ee0){return new BPromise(function(_0x52e272,_0x18e3b7){var _0x20503e=urlParse(_0x419ee0);var _0x2f8f85=_0x20503e[_0xfd61('0x20')]===_0xfd61('0x21')?https:http;var _0x179969={'host':_0x20503e[_0xfd61('0x11')],'path':_0x20503e['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x2f8f85[_0xfd61('0x13')](_0x179969,function(_0x433d47){if(_0x433d47['statusCode']!==0xc8){_0x18e3b7(new Error(_0xfd61('0x15')+_0x419ee0+_0xfd61('0x16')+_0x433d47[_0xfd61('0x14')]+'\x20('+_0x433d47['statusMessage']+')'));return;}var _0x39a1a8='';_0x433d47['on'](_0xfd61('0x22'),function(_0x476e9c){_0x39a1a8+=_0x476e9c;});_0x433d47['on'](_0xfd61('0x1f'),function(){_0x52e272(_0x39a1a8);});})['on'](_0xfd61('0x1c'),function(_0x50a9e9){_0x18e3b7(_0x50a9e9);})['end']();});}function convertFile(_0x1d51a2,_0x20b57f){return new BPromise(function(_0x85d353,_0x59df9d){var _0x1918cd=sox[_0xfd61('0x23')](_0x1d51a2,_0x20b57f,{'sampleRate':0x1f40,'format':_0xfd61('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1918cd['on'](_0xfd61('0x1c'),function(_0x2ee663){logger[_0xfd61('0x1c')]('error\x20convert',_0x2ee663);_0x59df9d(_0x2ee663);});_0x1918cd['on'](_0xfd61('0x1f'),function(){logger[_0xfd61('0x19')](_0xfd61('0x25'));_0x85d353();});_0x1918cd[_0xfd61('0x26')]();});}function base64Decode(_0x444928,_0x26d04a){var _0x1f4853=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+_0xfd61('0x2a'));fs[_0xfd61('0x2b')](_0x1f4853,_0x444928,_0xfd61('0x2c'));return convertFile(_0x1f4853,_0x26d04a)['then'](function(){try{fs[_0xfd61('0x2d')](_0x1f4853);fs['chmodSync'](_0x26d04a,_0xfd61('0x2e'));}catch(_0x592ee0){logger['error'](_0x592ee0);}return _0x26d04a['split']('.')[0x0];});}function base64Encode(_0x2d0b41){var _0x461ef9=fs[_0xfd61('0x2f')](_0x2d0b41);return new Buffer(_0x461ef9)[_0xfd61('0x30')](_0xfd61('0x2c'));}exports[_0xfd61('0x31')]=function(_0x1b32a9,_0x4dfd41,_0x5c3b4c,_0x25d1b4,_0x5b5935,_0x40e6dd){var _0x1cd273,_0x51b22f;var _0x184fa7='https://texttospeech.googleapis.com/v1/';var _0x33c596=_0xfd61('0x32')+_0x1b32a9;var _0x308ea9={};if(_0x4dfd41===_0xfd61('0x33')){_0x308ea9['input']={'ssml':_0x5c3b4c};}else{_0x308ea9[_0xfd61('0x34')]={'text':_0x5c3b4c};};_0x308ea9[_0xfd61('0x35')]={'languageCode':_0x25d1b4,'ssmlGender':_0x5b5935};_0x308ea9[_0xfd61('0x36')]={'audioEncoding':_0xfd61('0x37'),'sampleRateHertz':0x1f40};var _0x56d824={'url':_0x184fa7+'text:synthesize'+_0x33c596,'method':_0xfd61('0x38'),'json':!![],'body':_0x308ea9};return rp(_0x56d824)['then'](function(_0x243fa6){return new BPromise(function(_0x59780c,_0x4358c2){_0x1cd273=path[_0xfd61('0x27')](__dirname,'tmp',rs[_0xfd61('0x29')](0x4)+_0xfd61('0x39'));var _0x285e28=Buffer[_0xfd61('0x3a')](_0x243fa6[_0xfd61('0x3b')],_0xfd61('0x2c'));return fs[_0xfd61('0x3c')](_0x1cd273,_0x285e28,function(_0x133e6e){_0x4358c2(_0x133e6e);},function(_0x22f365){fs[_0xfd61('0x3d')](_0x1cd273,'777');_0x59780c(_0x22f365);});});})[_0xfd61('0x3e')](function(_0x42fb55){_0x51b22f=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs['generate'](0x4)+_0xfd61('0x2a'));return convertFile(_0x1cd273,_0x51b22f);})['then'](function(){try{fs[_0xfd61('0x2d')](_0x1cd273);fs[_0xfd61('0x3d')](_0x51b22f,'777');}catch(_0x375301){logger['error'](_0x375301);}logger[_0xfd61('0x19')]('googleCloudTTS\x20path',_0x51b22f[_0xfd61('0x3f')]('.')[0x0]);return _0x51b22f[_0xfd61('0x3f')]('.')[0x0];});};exports[_0xfd61('0x40')]=function(_0x33796e,_0x153abf){var _0x31ef7e=_0xfd61('0x41');var _0x3915e0,_0x5f0504;var _0x3e1399;var _0x32b4d8={'encoding':_0xfd61('0x42'),'method':_0xfd61('0x38'),'timeout':0x2710,'url':_0x31ef7e,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xfd61('0x43')+encodeURIComponent(JSON[_0xfd61('0x44')]([[['jQ1olc',JSON[_0xfd61('0x44')]([_0x33796e,_0x153abf||'en',![],_0xfd61('0x45')]),null,'generic']]]))};return rp(_0x32b4d8)[_0xfd61('0x3e')](function(_0x6ac5db){try{_0x3e1399=eval(_0x6ac5db['slice'](0x5))[0x0][0x2];}catch(_0x4b9915){throw new Error(_0xfd61('0x46')+_0x6ac5db[_0xfd61('0x22')]);}if(!_0x3e1399){if(_0x33796e[_0xfd61('0x47')]>0xc8){throw new Error(_0xfd61('0x48'));}else{throw new Error(_0xfd61('0x49')+_0x153abf+_0xfd61('0x4a'));}}try{_0x3e1399=eval(_0x3e1399)[0x0];}catch(_0x1fb441){throw new Error(_0xfd61('0x46')+res[_0xfd61('0x22')]);}const _0x4b2ce7=_0x3e1399;_0x3915e0=path['resolve'](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+_0xfd61('0x39'));fs[_0xfd61('0x2b')](_0x3915e0,_0x3e1399,{'encoding':_0xfd61('0x2c')});_0x5f0504=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+'.wav');return convertFile(_0x3915e0,_0x5f0504);})['then'](function(){try{fs[_0xfd61('0x2d')](_0x3915e0);fs[_0xfd61('0x3d')](_0x5f0504,_0xfd61('0x2e'));}catch(_0x1ac6c0){logger[_0xfd61('0x1c')](_0x1ac6c0);}logger['info'](_0xfd61('0x4b'),_0x5f0504[_0xfd61('0x3f')]('.')[0x0]);return _0x5f0504[_0xfd61('0x3f')]('.')[0x0];});};exports[_0xfd61('0x4c')]=function(_0x282e60,_0x52a05f,_0x2239ca){return google[_0xfd61('0x4d')](_0x282e60,_0x52a05f,_0x2239ca)[_0xfd61('0x3e')](function(_0x1e1cfb){logger[_0xfd61('0x19')](_0x1e1cfb[_0xfd61('0x4e')]);return rp(_0x1e1cfb);})[_0xfd61('0x3e')](function(_0x5c3e37){var _0xa60a07='';var _0x402d80=0x0;try{fs['unlink'](_0x282e60);}catch(_0x10ad6c){logger[_0xfd61('0x1c')](_0x10ad6c);}if(_0x5c3e37&&_0x5c3e37[_0xfd61('0x4f')]){_0xa60a07=_0x5c3e37['results']['map'](function(_0x3dbd42){return _0x3dbd42&&_0x3dbd42['alternatives'][0x0]&&_0x3dbd42[_0xfd61('0x50')][0x0]['transcript']?_0x3dbd42['alternatives'][0x0][_0xfd61('0x51')]:'';})[_0xfd61('0x52')]('\x0a');_0x402d80=_0x5c3e37[_0xfd61('0x4f')][_0xfd61('0x53')](function(_0x4fe50e){return _0x4fe50e&&_0x4fe50e['alternatives'][0x0]&&_0x4fe50e[_0xfd61('0x50')][0x0][_0xfd61('0x54')]?_0x4fe50e[_0xfd61('0x50')][0x0][_0xfd61('0x54')]:0x0;})[_0xfd61('0x52')]('\x0a');}logger['info'](_0xfd61('0x55'),_0xa60a07);logger[_0xfd61('0x19')]('googleASR\x20confidence',_0x402d80);return{'transcript':_0xa60a07,'confidence':_0x402d80};})[_0xfd61('0x56')](function(_0x3d94d0){logger['error'](_0xfd61('0x57'),_0x3d94d0[_0xfd61('0x14')],_0x3d94d0['name'],_0x3d94d0[_0xfd61('0x58')]);});};exports[_0xfd61('0x59')]=function(_0x4223b0,_0x4eaa22,_0x200c1a,_0x53d9a9){var _0x359ad5=apiai(_0x4eaa22,{'language':_0x53d9a9||'en'});return _0x359ad5['textRequest'](_0x200c1a,{'sessionId':md5(_0x4223b0)})['then'](function(_0x22d5ba){logger[_0xfd61('0x19')](JSON['stringify'](_0x22d5ba));return{'source':_0x22d5ba[_0xfd61('0x5a')][_0xfd61('0x5b')],'resolvedQuery':_0x22d5ba[_0xfd61('0x5a')]['resolvedQuery'],'action':_0x22d5ba[_0xfd61('0x5a')]['action'],'actionIncomplete':_0x22d5ba[_0xfd61('0x5a')]['actionIncomplete'],'speech':_0x22d5ba[_0xfd61('0x5a')]['fulfillment'][_0xfd61('0x5c')],'score':_0x22d5ba[_0xfd61('0x5a')]['score'],'statusCode':_0x22d5ba['status'][_0xfd61('0x5d')],'endConversation':_0x22d5ba[_0xfd61('0x5a')][_0xfd61('0x5e')][_0xfd61('0x5f')]||![],'isFallbackIntent':_0x22d5ba['result'][_0xfd61('0x5e')]['isFallbackIntent']};});};exports[_0xfd61('0x60')]=function(_0x267b25,_0x111649,_0x479740,_0x256dbb,_0x41e0b9,_0x2951df){var _0x2959a9=_0x256dbb[_0xfd61('0x61')](/\\n/g,'\x0a');var _0x48e407={'credentials':{'private_key':_0x2959a9,'client_email':_0x479740}};var _0x2dee9a=new dialogflow[(_0xfd61('0x62'))](_0x48e407);var _0x1b0818=_0x2dee9a[_0xfd61('0x63')](_0x111649,md5(_0x267b25));var _0x371e2c={'session':_0x1b0818,'queryInput':{'text':{'text':_0x41e0b9,'languageCode':_0x2951df}}};return _0x2dee9a[_0xfd61('0x64')](_0x371e2c)[_0xfd61('0x3e')](function(_0x24ade3){if(_0x24ade3&&_0x24ade3['length']){logger[_0xfd61('0x19')](_0xfd61('0x65'),JSON[_0xfd61('0x44')](_0x24ade3));var _0x42b6fb=_0x24ade3[0x0];if(_0x42b6fb){var _0x2e909c={'action':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x67')],'allRequiredParamsPresent':_0x42b6fb['queryResult'][_0xfd61('0x68')],'endConversation':_0x42b6fb['queryResult'][_0xfd61('0x69')]&&_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x69')][_0xfd61('0x6a')]?_0x42b6fb[_0xfd61('0x66')]['diagnosticInfo'][_0xfd61('0x6a')][_0xfd61('0x6b')][_0xfd61('0x6c')]:![],'fulfillmentText':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x6d')],'intentName':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x6e')][_0xfd61('0x6f')],'intentDisplayName':_0x42b6fb['queryResult']['intent']['displayName'],'isFallbackIntent':_0x42b6fb['queryResult'][_0xfd61('0x6e')]['isFallback'],'languageCode':_0x42b6fb[_0xfd61('0x66')]['languageCode'],'queryText':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x70')],'responseId':_0x42b6fb[_0xfd61('0x71')],'score':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x72')],'speech':_0x42b6fb[_0xfd61('0x66')][_0xfd61('0x6d')],'providerResponse':JSON[_0xfd61('0x44')](_0x24ade3)};return _0x2e909c;}}});};exports['tildeASR']=function(_0x484de5,_0x241d4,_0x33293b,_0x2875db){return tilde[_0xfd61('0x4d')](_0x484de5,_0x241d4,_0x33293b,_0x2875db)[_0xfd61('0x3e')](function(_0x2ff56f){try{fs[_0xfd61('0x2d')](_0x484de5);}catch(_0x180399){logger['error'](_0x180399);}logger[_0xfd61('0x19')](_0xfd61('0x73'),_0x2ff56f[_0xfd61('0x51')]);logger[_0xfd61('0x19')](_0xfd61('0x74'),_0x2ff56f['confidence']);return _0x2ff56f;});};exports[_0xfd61('0x75')]=function(_0x1ebe31,_0x2e55dd,_0x58adf4,_0x18387e,_0x136bb2,_0x46a27c){var _0x2c695c=path['resolve'](__dirname,'tmp',rs[_0xfd61('0x29')](0x4)+_0xfd61('0x39'));var _0x20496e;return aws['polly'](_0x1ebe31,_0x2e55dd,_0x58adf4,_0x18387e,_0x136bb2,_0x46a27c,_0x2c695c)[_0xfd61('0x3e')](function(){_0x20496e=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+_0xfd61('0x2a'));return convertFile(_0x2c695c,_0x20496e);})['then'](function(){try{fs[_0xfd61('0x2d')](_0x2c695c);fs['chmodSync'](_0x20496e,_0xfd61('0x2e'));}catch(_0x1f0241){logger['error'](_0x1f0241);}return _0x20496e[_0xfd61('0x3f')]('.')[0x0];});};exports[_0xfd61('0x76')]=function(_0x862c4,_0xf49cf1,_0x54ddda,_0x27ab67,_0x4208cf,_0x5be232){return aws[_0xfd61('0x77')](_0x862c4,_0xf49cf1,_0x54ddda,_0x27ab67,_0x4208cf,_0x5be232)['then'](function(_0x23413b){logger[_0xfd61('0x19')](JSON['stringify'](_0x23413b));return _0x23413b;});};exports[_0xfd61('0x78')]=function(_0x451b4a,_0x396a6d,_0x1f6b1d,_0x5f4349){var _0x17c690=util[_0xfd61('0x79')](_0xfd61('0x7a'),ISPEECH_API,_0x451b4a,encodeURIComponent(_0x396a6d),_0x1f6b1d,_0x5f4349);var _0x2a3145=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+_0xfd61('0x39'));var _0x8999d2;return downloadFile(_0x17c690,_0x2a3145)[_0xfd61('0x3e')](function(){_0x8999d2=path[_0xfd61('0x27')](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+_0xfd61('0x2a'));return convertFile(_0x2a3145,_0x8999d2);})[_0xfd61('0x3e')](function(){try{fs[_0xfd61('0x2d')](_0x2a3145);fs[_0xfd61('0x3d')](_0x8999d2,'777');}catch(_0x22b90d){logger[_0xfd61('0x1c')](_0x22b90d);}return _0x8999d2[_0xfd61('0x3f')]('.')[0x0];});};exports['ispeechASR']=function(_0x4719bb,_0x4d4fad,_0x216db8,_0x3b4e93){var _0x3dc1ca=util[_0xfd61('0x79')](_0xfd61('0x7b'),ISPEECH_API,_0x4d4fad,_0x216db8,base64Encode(_0x4719bb),_0x3b4e93?util[_0xfd61('0x79')](_0xfd61('0x7c'),encodeURIComponent(_0x3b4e93)):_0xfd61('0x7d'));return uploadFile(_0x3dc1ca)['then'](function(_0x178b6d){return querystring['parse'](_0x178b6d);});};exports[_0xfd61('0x7e')]=function(_0xe66b75,_0x2217a3){return sestek[_0xfd61('0x7f')](_0xe66b75,_0x2217a3)[_0xfd61('0x3e')](function(_0x59bdec){logger[_0xfd61('0x19')](JSON['stringify'](_0x59bdec));var _0x2025cf={'speech':_0x59bdec[_0xfd61('0x80')],'action':_0x59bdec[_0xfd61('0x81')]?_0x59bdec[_0xfd61('0x81')]['CustomAction']:undefined,'actiondata':_0x59bdec[_0xfd61('0x81')]?_0x59bdec['channelData'][_0xfd61('0x82')]:undefined};if(_0x59bdec[_0xfd61('0x81')]&&_0x59bdec['channelData'][_0xfd61('0x83')]){return base64Decode(_0x59bdec[_0xfd61('0x81')][_0xfd61('0x83')][_0xfd61('0x84')],path['resolve'](__dirname,_0xfd61('0x28'),rs[_0xfd61('0x29')](0x4)+'.wav'))[_0xfd61('0x3e')](function(_0x4ecbcc){_0x2025cf[_0xfd61('0x85')]=_0x4ecbcc;return _0x2025cf;});}return _0x2025cf;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x70dd=['status','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','queryText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','data','transcode','error\x20convert','start','tmp','generate','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','text:synthesize','resolve','.mp3','audioContent','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.wav','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','source','action','fulfillment'];(function(_0x195be9,_0x3655fc){var _0x476dd1=function(_0x476a39){while(--_0x476a39){_0x195be9['push'](_0x195be9['shift']());}};_0x476dd1(++_0x3655fc);}(_0x70dd,0xa5));var _0xd70d=function(_0x223948,_0x792cf8){_0x223948=_0x223948-0x0;var _0x5193ef=_0x70dd[_0x223948];return _0x5193ef;};'use strict';var apiai=require(_0xd70d('0x0'));var BPromise=require(_0xd70d('0x1'));var dialogflow=require(_0xd70d('0x2'));var fs=require('fs');var http=require(_0xd70d('0x3'));var https=require(_0xd70d('0x4'));var md5=require(_0xd70d('0x5'));var path=require(_0xd70d('0x6'));var querystring=require('querystring');var rp=require(_0xd70d('0x7'));var rs=require('randomstring');var sox=require(_0xd70d('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xd70d('0x9'))[_0xd70d('0xa')];var util=require(_0xd70d('0xb'));var aws=require(_0xd70d('0xc'));var google=require(_0xd70d('0xd'));var sestek=require(_0xd70d('0xe'));var tilde=require(_0xd70d('0xf'));var logger=require(_0xd70d('0x10'))(_0xd70d('0x11'));var ISPEECH_API=_0xd70d('0x12');function downloadFile(_0x299bbf,_0x2308be){return new BPromise(function(_0x52ae23,_0x427754){var _0x5d388c=urlParse(_0x299bbf);var _0x2f1c7a=_0x5d388c[_0xd70d('0x13')]===_0xd70d('0x14')?https:http;var _0x3d74af={'host':_0x5d388c[_0xd70d('0x15')],'path':_0x5d388c['path'],'headers':{'user-agent':_0xd70d('0x16')}};_0x2f1c7a[_0xd70d('0x17')](_0x3d74af,function(_0x2ea8d5){if(_0x2ea8d5[_0xd70d('0x18')]!==0xc8){logger['error'](_0xd70d('0x19')+_0x299bbf+_0xd70d('0x1a')+_0x2ea8d5[_0xd70d('0x18')]+'\x20('+_0x2ea8d5[_0xd70d('0x1b')]+')');_0x427754(new Error('request\x20to\x20'+_0x299bbf+_0xd70d('0x1a')+_0x2ea8d5[_0xd70d('0x18')]+'\x20('+_0x2ea8d5[_0xd70d('0x1b')]+')'));return;}var _0x5c767a=fs['createWriteStream'](_0x2308be);_0x5c767a['on'](_0xd70d('0x1c'),function(){logger[_0xd70d('0x1d')](_0xd70d('0x1e'));_0x5c767a[_0xd70d('0x1f')](_0x52ae23);});_0x5c767a['on'](_0xd70d('0x20'),function(_0x561735){fs['unlink'](_0x2308be);logger['error'](_0xd70d('0x21'),_0x561735);_0x427754(_0x561735);});_0x2ea8d5[_0xd70d('0x22')](_0x5c767a);})['on']('error',function(_0x8d311a){logger['error'](_0x8d311a);_0x427754(_0x8d311a);})[_0xd70d('0x23')]();});}function uploadFile(_0x3a813c){return new BPromise(function(_0x39ae5f,_0x4bcc25){var _0x43c0f1=urlParse(_0x3a813c);var _0x573d7e=_0x43c0f1[_0xd70d('0x13')]===_0xd70d('0x14')?https:http;var _0x59b188={'host':_0x43c0f1[_0xd70d('0x15')],'path':_0x43c0f1[_0xd70d('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x573d7e[_0xd70d('0x17')](_0x59b188,function(_0x52cb70){if(_0x52cb70[_0xd70d('0x18')]!==0xc8){_0x4bcc25(new Error(_0xd70d('0x19')+_0x3a813c+_0xd70d('0x1a')+_0x52cb70[_0xd70d('0x18')]+'\x20('+_0x52cb70['statusMessage']+')'));return;}var _0x25665c='';_0x52cb70['on'](_0xd70d('0x24'),function(_0x40b770){_0x25665c+=_0x40b770;});_0x52cb70['on'](_0xd70d('0x23'),function(){_0x39ae5f(_0x25665c);});})['on'](_0xd70d('0x20'),function(_0xc6c6f5){_0x4bcc25(_0xc6c6f5);})[_0xd70d('0x23')]();});}function convertFile(_0x5dc319,_0x4de068){return new BPromise(function(_0x158c98,_0x353723){var _0x9c8906=sox[_0xd70d('0x25')](_0x5dc319,_0x4de068,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x9c8906['on']('error',function(_0x574a98){logger[_0xd70d('0x20')](_0xd70d('0x26'),_0x574a98);_0x353723(_0x574a98);});_0x9c8906['on'](_0xd70d('0x23'),function(){logger['info']('finish\x20to\x20convert');_0x158c98();});_0x9c8906[_0xd70d('0x27')]();});}function base64Decode(_0x285f60,_0x5b7746){var _0x556597=path['resolve'](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+'.wav');fs[_0xd70d('0x2a')](_0x556597,_0x285f60,_0xd70d('0x2b'));return convertFile(_0x556597,_0x5b7746)[_0xd70d('0x2c')](function(){try{fs[_0xd70d('0x2d')](_0x556597);fs[_0xd70d('0x2e')](_0x5b7746,_0xd70d('0x2f'));}catch(_0x47e885){logger[_0xd70d('0x20')](_0x47e885);}return _0x5b7746[_0xd70d('0x30')]('.')[0x0];});}function base64Encode(_0x1ff75c){var _0x5c4f40=fs[_0xd70d('0x31')](_0x1ff75c);return new Buffer(_0x5c4f40)[_0xd70d('0x32')](_0xd70d('0x2b'));}exports[_0xd70d('0x33')]=function(_0x3d5515,_0x1202e2,_0x115832,_0x1194df,_0x4fb5bc,_0x160d62){var _0x810594,_0x28f9be;var _0x48dd73='https://texttospeech.googleapis.com/v1/';var _0x1bb579=_0xd70d('0x34')+_0x3d5515;var _0x56ce76={};if(_0x1202e2===_0xd70d('0x35')){_0x56ce76[_0xd70d('0x36')]={'ssml':_0x115832};}else{_0x56ce76[_0xd70d('0x36')]={'text':_0x115832};};_0x56ce76[_0xd70d('0x37')]={'languageCode':_0x1194df,'ssmlGender':_0x4fb5bc};_0x56ce76[_0xd70d('0x38')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x29b15b={'url':_0x48dd73+_0xd70d('0x39')+_0x1bb579,'method':'POST','json':!![],'body':_0x56ce76};return rp(_0x29b15b)[_0xd70d('0x2c')](function(_0x5be8cc){return new BPromise(function(_0x23b2a7,_0x371752){_0x810594=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));var _0x2a2795=Buffer['from'](_0x5be8cc[_0xd70d('0x3c')],_0xd70d('0x2b'));return fs[_0xd70d('0x3d')](_0x810594,_0x2a2795,function(_0x129e4b){_0x371752(_0x129e4b);},function(_0x18584d){fs[_0xd70d('0x2e')](_0x810594,_0xd70d('0x2f'));_0x23b2a7(_0x18584d);});});})[_0xd70d('0x2c')](function(_0x574a0a){_0x28f9be=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+'.wav');return convertFile(_0x810594,_0x28f9be);})[_0xd70d('0x2c')](function(){try{fs[_0xd70d('0x2d')](_0x810594);fs[_0xd70d('0x2e')](_0x28f9be,_0xd70d('0x2f'));}catch(_0x59ef87){logger[_0xd70d('0x20')](_0x59ef87);}logger[_0xd70d('0x1d')]('googleCloudTTS\x20path',_0x28f9be[_0xd70d('0x30')]('.')[0x0]);return _0x28f9be['split']('.')[0x0];});};exports[_0xd70d('0x3e')]=function(_0x51dee4,_0x43a81e){var _0x5ec921=_0xd70d('0x3f');var _0x5342e8,_0x1bbfeb;var _0x596e66;var _0x386bd3={'encoding':_0xd70d('0x40'),'method':_0xd70d('0x41'),'timeout':0x2710,'url':_0x5ec921,'headers':{'Content-Type':_0xd70d('0x42')},'body':_0xd70d('0x43')+encodeURIComponent(JSON['stringify']([[[_0xd70d('0x44'),JSON[_0xd70d('0x45')]([_0x51dee4,_0x43a81e||'en',![],_0xd70d('0x46')]),null,_0xd70d('0x47')]]]))};return rp(_0x386bd3)['then'](function(_0x811aac){try{_0x596e66=eval(_0x811aac['slice'](0x5))[0x0][0x2];}catch(_0x1d454b){throw new Error('parse\x20response\x20failed:\x0a'+_0x811aac[_0xd70d('0x24')]);}if(!_0x596e66){if(_0x51dee4['length']>0xc8){throw new Error(_0xd70d('0x48'));}else{throw new Error(_0xd70d('0x49')+_0x43a81e+_0xd70d('0x4a'));}}try{_0x596e66=eval(_0x596e66)[0x0];}catch(_0x272c2d){throw new Error(_0xd70d('0x4b')+res[_0xd70d('0x24')]);}const _0x12e5e7=_0x596e66;_0x5342e8=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));fs[_0xd70d('0x2a')](_0x5342e8,_0x596e66,{'encoding':_0xd70d('0x2b')});_0x1bbfeb=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x5342e8,_0x1bbfeb);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x5342e8);fs[_0xd70d('0x2e')](_0x1bbfeb,_0xd70d('0x2f'));}catch(_0x5c816b){logger[_0xd70d('0x20')](_0x5c816b);}logger[_0xd70d('0x1d')]('goggleTTS\x20path',_0x1bbfeb[_0xd70d('0x30')]('.')[0x0]);return _0x1bbfeb[_0xd70d('0x30')]('.')[0x0];});};exports['googleASR']=function(_0xbc3c8b,_0x436348,_0x4a8b78){return google[_0xd70d('0x4d')](_0xbc3c8b,_0x436348,_0x4a8b78)[_0xd70d('0x2c')](function(_0x4c74ae){logger['info'](_0x4c74ae[_0xd70d('0x4e')]);return rp(_0x4c74ae);})[_0xd70d('0x2c')](function(_0x34b675){var _0x4a91e4='';var _0x40438c=0x0;try{fs[_0xd70d('0x2d')](_0xbc3c8b);}catch(_0x5c78bd){logger[_0xd70d('0x20')](_0x5c78bd);}if(_0x34b675&&_0x34b675[_0xd70d('0x4f')]){_0x4a91e4=_0x34b675[_0xd70d('0x4f')][_0xd70d('0x50')](function(_0x10b41f){return _0x10b41f&&_0x10b41f[_0xd70d('0x51')][0x0]&&_0x10b41f[_0xd70d('0x51')][0x0]['transcript']?_0x10b41f[_0xd70d('0x51')][0x0][_0xd70d('0x52')]:'';})[_0xd70d('0x53')]('\x0a');_0x40438c=_0x34b675[_0xd70d('0x4f')][_0xd70d('0x50')](function(_0x86c817){return _0x86c817&&_0x86c817['alternatives'][0x0]&&_0x86c817[_0xd70d('0x51')][0x0][_0xd70d('0x54')]?_0x86c817[_0xd70d('0x51')][0x0][_0xd70d('0x54')]:0x0;})[_0xd70d('0x53')]('\x0a');}logger[_0xd70d('0x1d')](_0xd70d('0x55'),_0x4a91e4);logger[_0xd70d('0x1d')](_0xd70d('0x56'),_0x40438c);return{'transcript':_0x4a91e4,'confidence':_0x40438c};})[_0xd70d('0x57')](function(_0x47b9a4){logger[_0xd70d('0x20')](_0xd70d('0x58'),_0x47b9a4[_0xd70d('0x18')],_0x47b9a4[_0xd70d('0x59')],_0x47b9a4['message']);});};exports[_0xd70d('0x5a')]=function(_0xbd0428,_0x3b2820,_0x2c8561,_0x4792cf){var _0x12decd=apiai(_0x3b2820,{'language':_0x4792cf||'en'});return _0x12decd['textRequest'](_0x2c8561,{'sessionId':md5(_0xbd0428)})[_0xd70d('0x2c')](function(_0x1f5adb){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x1f5adb));return{'source':_0x1f5adb[_0xd70d('0x5b')][_0xd70d('0x5c')],'resolvedQuery':_0x1f5adb[_0xd70d('0x5b')]['resolvedQuery'],'action':_0x1f5adb['result'][_0xd70d('0x5d')],'actionIncomplete':_0x1f5adb[_0xd70d('0x5b')]['actionIncomplete'],'speech':_0x1f5adb['result'][_0xd70d('0x5e')]['speech'],'score':_0x1f5adb[_0xd70d('0x5b')]['score'],'statusCode':_0x1f5adb[_0xd70d('0x5f')]['code'],'endConversation':_0x1f5adb['result'][_0xd70d('0x60')]['endConversation']||![],'isFallbackIntent':_0x1f5adb['result'][_0xd70d('0x60')][_0xd70d('0x61')]};});};exports[_0xd70d('0x62')]=function(_0x3755fd,_0x4f1ed8,_0x5291a3,_0x57f637,_0x3761b6,_0x191821){var _0x43335f=_0x57f637[_0xd70d('0x63')](/\\n/g,'\x0a');var _0x1af8a4={'credentials':{'private_key':_0x43335f,'client_email':_0x5291a3}};var _0x49eedc=new dialogflow[(_0xd70d('0x64'))](_0x1af8a4);var _0x51a14d=_0x49eedc[_0xd70d('0x65')](_0x4f1ed8,md5(_0x3755fd));var _0x200bd1={'session':_0x51a14d,'queryInput':{'text':{'text':_0x3761b6,'languageCode':_0x191821}}};return _0x49eedc['detectIntent'](_0x200bd1)['then'](function(_0x485a13){if(_0x485a13&&_0x485a13[_0xd70d('0x66')]){logger[_0xd70d('0x1d')](_0xd70d('0x67'),JSON[_0xd70d('0x45')](_0x485a13));var _0x62e5db=_0x485a13[0x0];if(_0x62e5db){var _0x3dd597={'action':_0x62e5db['queryResult'][_0xd70d('0x5d')],'allRequiredParamsPresent':_0x62e5db['queryResult'][_0xd70d('0x68')],'endConversation':_0x62e5db[_0xd70d('0x69')]['diagnosticInfo']&&_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6a')][_0xd70d('0x6b')]?_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6a')][_0xd70d('0x6b')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x62e5db['queryResult'][_0xd70d('0x6c')],'intentName':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6d')]['name'],'intentDisplayName':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6d')][_0xd70d('0x6e')],'isFallbackIntent':_0x62e5db['queryResult'][_0xd70d('0x6d')]['isFallback'],'languageCode':_0x62e5db[_0xd70d('0x69')]['languageCode'],'queryText':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6f')],'responseId':_0x62e5db['responseId'],'score':_0x62e5db[_0xd70d('0x69')]['intentDetectionConfidence'],'speech':_0x62e5db['queryResult'][_0xd70d('0x6c')],'providerResponse':JSON[_0xd70d('0x45')](_0x485a13)};return _0x3dd597;}}});};exports[_0xd70d('0x70')]=function(_0x278493,_0x2b15db,_0x4436cb,_0x2e8490){return tilde['asr'](_0x278493,_0x2b15db,_0x4436cb,_0x2e8490)['then'](function(_0x14c98d){try{fs[_0xd70d('0x2d')](_0x278493);}catch(_0x4f668a){logger[_0xd70d('0x20')](_0x4f668a);}logger[_0xd70d('0x1d')](_0xd70d('0x71'),_0x14c98d['transcript']);logger[_0xd70d('0x1d')]('Tilde\x20ASR\x20confidence',_0x14c98d[_0xd70d('0x54')]);return _0x14c98d;});};exports[_0xd70d('0x72')]=function(_0x15b705,_0x5ef55d,_0x13d05d,_0x2cc207,_0x193d0c,_0x4446a9){var _0x4da3be=path[_0xd70d('0x3a')](__dirname,'tmp',rs[_0xd70d('0x29')](0x4)+'.mp3');var _0x55b3cc;return aws['polly'](_0x15b705,_0x5ef55d,_0x13d05d,_0x2cc207,_0x193d0c,_0x4446a9,_0x4da3be)['then'](function(){_0x55b3cc=path['resolve'](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x4da3be,_0x55b3cc);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x4da3be);fs[_0xd70d('0x2e')](_0x55b3cc,_0xd70d('0x2f'));}catch(_0x35c5d9){logger[_0xd70d('0x20')](_0x35c5d9);}return _0x55b3cc[_0xd70d('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x1f8df9,_0x16f580,_0x950adb,_0x22513a,_0xc76d34,_0x7174f0){return aws['lex'](_0x1f8df9,_0x16f580,_0x950adb,_0x22513a,_0xc76d34,_0x7174f0)[_0xd70d('0x2c')](function(_0x4d206b){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x4d206b));return _0x4d206b;});};exports['ispeechTTS']=function(_0xf78ce,_0x16706b,_0x27b212,_0x3f7565){var _0x5274aa=util[_0xd70d('0x73')](_0xd70d('0x74'),ISPEECH_API,_0xf78ce,encodeURIComponent(_0x16706b),_0x27b212,_0x3f7565);var _0x250f76=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));var _0x55b335;return downloadFile(_0x5274aa,_0x250f76)[_0xd70d('0x2c')](function(){_0x55b335=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x250f76,_0x55b335);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x250f76);fs[_0xd70d('0x2e')](_0x55b335,_0xd70d('0x2f'));}catch(_0x2329e2){logger[_0xd70d('0x20')](_0x2329e2);}return _0x55b335[_0xd70d('0x30')]('.')[0x0];});};exports[_0xd70d('0x75')]=function(_0x36196a,_0x57687a,_0x5b7e7b,_0x229177){var _0x2af24f=util[_0xd70d('0x73')](_0xd70d('0x76'),ISPEECH_API,_0x57687a,_0x5b7e7b,base64Encode(_0x36196a),_0x229177?util[_0xd70d('0x73')](_0xd70d('0x77'),encodeURIComponent(_0x229177)):'freeform=3');return uploadFile(_0x2af24f)[_0xd70d('0x2c')](function(_0x2f2b02){return querystring[_0xd70d('0xa')](_0x2f2b02);});};exports[_0xd70d('0x78')]=function(_0x1a362c,_0x215828){return sestek[_0xd70d('0x79')](_0x1a362c,_0x215828)[_0xd70d('0x2c')](function(_0x1fbf58){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x1fbf58));var _0x41f963={'speech':_0x1fbf58[_0xd70d('0x7a')],'action':_0x1fbf58[_0xd70d('0x7b')]?_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7c')]:undefined,'actiondata':_0x1fbf58[_0xd70d('0x7b')]?_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7d')]:undefined};if(_0x1fbf58[_0xd70d('0x7b')]&&_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7e')]){return base64Decode(_0x1fbf58['channelData'][_0xd70d('0x7e')][_0xd70d('0x7f')],path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c')))[_0xd70d('0x2c')](function(_0x5cbf31){_0x41f963[_0xd70d('0x80')]=_0x5cbf31;return _0x41f963;});}return _0x41f963;});};exports[_0xd70d('0x81')]=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 19b1bd1..eb9d04c 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 _0x9955=['exports'];(function(_0x1702e1,_0x3a8949){var _0x2bdc8c=function(_0x362a55){while(--_0x362a55){_0x1702e1['push'](_0x1702e1['shift']());}};_0x2bdc8c(++_0x3a8949);}(_0x9955,0xa4));var _0x5995=function(_0xf737af,_0x9be8cb){_0xf737af=_0xf737af-0x0;var _0x2f4a47=_0x9955[_0xf737af];return _0x2f4a47;};var nda=require('./nda');module[_0x5995('0x0')]={'nda':nda}; \ No newline at end of file +var _0x68f2=['exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x68f2,0x145));var _0x268f=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x68f2[_0x139a3c];return _0x2b375b;};var nda=require('./nda');module[_0x268f('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 960e646..f063419 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 _0x5e30=['POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','channelData','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5e30,0x7b));var _0x05e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e30[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x05e3('0x0'));var url=require(_0x05e3('0x1'));var logger=require(_0x05e3('0x2'))(_0x05e3('0x3'));module[_0x05e3('0x4')]=function(_0x5c88b3,_0x5136f8){var _0x5675cc={'method':_0x05e3('0x5'),'uri':url[_0x05e3('0x6')](_0x5136f8[_0x05e3('0x7')],_0x05e3('0x8')),'form':{'grant_type':_0x05e3('0x9'),'username':_0x5136f8[_0x05e3('0xa')],'password':_0x5136f8['password']},'json':!![]};return rp(_0x5675cc)['then'](function(_0xa03016){var _0x2eb9fa={'method':'POST','uri':url[_0x05e3('0x6')](_0x5136f8[_0x05e3('0xb')],_0x05e3('0xc')),'body':{'type':_0x5136f8[_0x05e3('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x5c88b3[_0x05e3('0xe')]},'from':{'id':_0x5c88b3['callerid'],'name':_0x5c88b3[_0x05e3('0xf')]},'recipient':{'id':_0x5c88b3[_0x05e3('0x10')],'name':_0x5c88b3[_0x05e3('0x11')]},'text':_0x5136f8['text'],'channelData':{}},'headers':{'Authorization':_0x05e3('0x12')+_0xa03016[_0x05e3('0x13')]},'json':!![]};if(_0x5136f8['project']){_0x2eb9fa[_0x05e3('0x14')]['channelData'][_0x05e3('0x15')]=_0x5136f8[_0x05e3('0x16')];}if(_0x5136f8[_0x05e3('0x17')]=='1'){_0x2eb9fa[_0x05e3('0x14')]['channelData'][_0x05e3('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5136f8[_0x05e3('0x19')]){_0x2eb9fa['body']['channelData'][_0x05e3('0x1a')]=_0x5136f8[_0x05e3('0x19')];if(_0x5136f8[_0x05e3('0x1b')]){_0x2eb9fa['body'][_0x05e3('0x1c')][_0x05e3('0x1d')]=_0x5136f8[_0x05e3('0x1b')];}}logger[_0x05e3('0x1e')](JSON[_0x05e3('0x1f')](_0x2eb9fa));return rp(_0x2eb9fa);});}; \ No newline at end of file +var _0x1d90=['ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','request-promise','../../../../../config/logger','exports','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData'];(function(_0x88399a,_0x331342){var _0x87af24=function(_0x549907){while(--_0x549907){_0x88399a['push'](_0x88399a['shift']());}};_0x87af24(++_0x331342);}(_0x1d90,0x13e));var _0x01d9=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x1d90[_0x5c2cd5];return _0x5180e9;};'use strict';var rp=require(_0x01d9('0x0'));var url=require('url');var logger=require(_0x01d9('0x1'))('agi');module[_0x01d9('0x2')]=function(_0x5525be,_0x1d6da0){var _0x40b43e={'method':'POST','uri':url[_0x01d9('0x3')](_0x1d6da0[_0x01d9('0x4')],_0x01d9('0x5')),'form':{'grant_type':'password','username':_0x1d6da0[_0x01d9('0x6')],'password':_0x1d6da0[_0x01d9('0x7')]},'json':!![]};return rp(_0x40b43e)[_0x01d9('0x8')](function(_0x598409){var _0xef9d5b={'method':'POST','uri':url['resolve'](_0x1d6da0[_0x01d9('0x9')],_0x01d9('0xa')),'body':{'type':_0x1d6da0[_0x01d9('0xb')]||'message','channelId':_0x01d9('0xc'),'conversation':{'id':_0x5525be[_0x01d9('0xd')]},'from':{'id':_0x5525be[_0x01d9('0xe')],'name':_0x5525be['calleridname']},'recipient':{'id':_0x5525be[_0x01d9('0xf')],'name':_0x5525be[_0x01d9('0x10')]},'text':_0x1d6da0[_0x01d9('0x11')],'channelData':{}},'headers':{'Authorization':_0x01d9('0x12')+_0x598409[_0x01d9('0x13')]},'json':!![]};if(_0x1d6da0[_0x01d9('0x14')]){_0xef9d5b[_0x01d9('0x15')][_0x01d9('0x16')][_0x01d9('0x17')]=_0x1d6da0[_0x01d9('0x14')];}if(_0x1d6da0[_0x01d9('0x18')]=='1'){_0xef9d5b[_0x01d9('0x15')]['channelData'][_0x01d9('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x01d9('0x1a')};}if(_0x1d6da0[_0x01d9('0x1b')]){_0xef9d5b[_0x01d9('0x15')]['channelData'][_0x01d9('0x1c')]=_0x1d6da0[_0x01d9('0x1b')];if(_0x1d6da0[_0x01d9('0x1d')]){_0xef9d5b[_0x01d9('0x15')][_0x01d9('0x16')]['CustomActionData']=_0x1d6da0[_0x01d9('0x1d')];}}logger[_0x01d9('0x1e')](JSON['stringify'](_0xef9d5b));return rp(_0xef9d5b);});}; \ 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 c6655bf..ccb16ba 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 _0x553f=['exports','./lib/api'];(function(_0x2cb93c,_0x3f29b7){var _0x3ad00d=function(_0x2ff10b){while(--_0x2ff10b){_0x2cb93c['push'](_0x2cb93c['shift']());}};_0x3ad00d(++_0x3f29b7);}(_0x553f,0x195));var _0xf553=function(_0x25d2ee,_0x3ea750){_0x25d2ee=_0x25d2ee-0x0;var _0xa8bca7=_0x553f[_0x25d2ee];return _0xa8bca7;};'use strict';var asr=require(_0xf553('0x0'));module[_0xf553('0x1')]=function(_0x3a1f2f,_0x120393,_0x286196,_0x29a1ab){return asr(_0x3a1f2f,_0x120393,_0x286196,_0x29a1ab);}; \ No newline at end of file +var _0x5476=['exports','./lib/api'];(function(_0x56c0cf,_0x14262f){var _0x2c8b9e=function(_0x1bacb0){while(--_0x1bacb0){_0x56c0cf['push'](_0x56c0cf['shift']());}};_0x2c8b9e(++_0x14262f);}(_0x5476,0x13f));var _0x6547=function(_0x3bc9ff,_0x2c1c2d){_0x3bc9ff=_0x3bc9ff-0x0;var _0x2cad4e=_0x5476[_0x3bc9ff];return _0x2cad4e;};'use strict';var asr=require(_0x6547('0x0'));module[_0x6547('0x1')]=function(_0x5e3882,_0x40b235,_0x4dc8a1,_0x4976ef){return asr(_0x5e3882,_0x40b235,_0x4dc8a1,_0x4976ef);}; \ 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 7ab2234..aab0d16 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 _0x351e=['close','bluebird','lodash','moment','crypto','../../../../../../config/logger','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','stringify','transcript','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','message'];(function(_0x3130b5,_0x23faf7){var _0xa6d8a3=function(_0x175be7){while(--_0x175be7){_0x3130b5['push'](_0x3130b5['shift']());}};_0xa6d8a3(++_0x23faf7);}(_0x351e,0xba));var _0xe351=function(_0x401620,_0x445233){_0x401620=_0x401620-0x0;var _0x14e3b4=_0x351e[_0x401620];return _0x14e3b4;};'use strict';var BPromise=require(_0xe351('0x0'));var _=require(_0xe351('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe351('0x2'));var crypto=require(_0xe351('0x3'));var logger=require(_0xe351('0x4'))('agi');module['exports']=function(_0x376b6b,_0x1abbc3,_0x130ccf,_0x416b5f){return new BPromise(function(_0x3e9cd7,_0x52e4a0){logger['info'](_0xe351('0x5'),_0x416b5f||_0xe351('0x6'));var _0x41606d=new WebSocket(_0x416b5f||_0xe351('0x6'),{'perMessageDeflate':![]});var _0x1a4145='';var _0x208b1b='0';var _0x30850b='1';var _0x559e1c=_0xe351('0x7');function _0x54725d(_0x55e8ff){var _0x5ba97b=crypto[_0xe351('0x8')](_0xe351('0x9'));_0x5ba97b[_0xe351('0xa')](_0x55e8ff);return _0x5ba97b['digest'](_0xe351('0xb'));}function _0x1da15b(){try{logger[_0xe351('0xc')](_0xe351('0xd'));var _0x2a0cc3=moment()[_0xe351('0xe')]();var _0x1720e0=_0x54725d(_0x2a0cc3+_0x1abbc3+_0x130ccf);_0x41606d[_0xe351('0xf')](JSON['stringify']({'appID':_0x1abbc3,'timestamp':_0x2a0cc3,'appKey':_0x1720e0}));var _0x5f28e6=fs['createReadStream'](_0x376b6b);_0x5f28e6['on'](_0xe351('0x10'),function(_0x1ee62){_0x41606d[_0xe351('0xf')](_0x1ee62);});_0x5f28e6['on']('close',function(){_0x41606d[_0xe351('0xf')](_0xe351('0x11'));});}catch(_0x27ac61){logger[_0xe351('0x12')](_0xe351('0x13'),JSON['stringify'](_0x27ac61));_0x41606d[_0xe351('0x14')]();}}function _0x577923(_0x53c56a){try{if(_0x53c56a){var _0x52d056=JSON[_0xe351('0x15')](_0x53c56a);switch(_0x52d056['status']){case 0x0:if(_0x52d056[_0xe351('0x16')]){if(_0x52d056[_0xe351('0x16')]['final']){logger[_0xe351('0xc')]('Tilde\x20ASR\x20hypoteses',JSON[_0xe351('0x17')](_0x52d056['result']['hypotheses']));_0x1a4145=_0x52d056['result']['hypotheses'][0x0][_0xe351('0x18')];_0x208b1b=_0x52d056[_0xe351('0x16')][_0xe351('0x19')][0x0][_0xe351('0x1a')];_0x30850b='0';_0x559e1c='Success.';_0x41606d[_0xe351('0x14')]();}}break;case 0x1:logger[_0xe351('0xc')](_0xe351('0x7'));_0x30850b='1';_0x559e1c=_0xe351('0x7');break;case 0x2:logger[_0xe351('0xc')](_0xe351('0x1b'));_0x30850b='2';_0x559e1c=_0xe351('0x1b');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x30850b='9';_0x559e1c=_0xe351('0x1c');break;case 0xa:logger[_0xe351('0xc')]('Authentication\x20failed.');_0x30850b='10';_0x559e1c=_0xe351('0x1d');break;case 0xb:logger[_0xe351('0xc')](_0xe351('0x1e'));_0x30850b='11';_0x559e1c=_0xe351('0x1e');}}}catch(_0xb0f777){logger[_0xe351('0x12')](_0xe351('0x1f'),JSON['stringify'](_0xb0f777));_0x41606d[_0xe351('0x14')]();}}function _0x1f00f5(){logger[_0xe351('0xc')]('Close\x20Tilde\x20ASR\x20socket');_0x3e9cd7({'transcript':_0x1a4145,'confidence':_0x208b1b,'status':_0x30850b,'status_message':_0x559e1c});}function _0x519eff(_0x4459be){logger['error'](_0xe351('0x20'));if(!_['isNil'](_0x4459be)){logger[_0xe351('0x12')](_[_0xe351('0x21')](_0x4459be)?JSON[_0xe351('0x17')](_0x4459be):_0x4459be);}}_0x41606d['on'](_0xe351('0x22'),_0x1da15b);_0x41606d['on'](_0xe351('0x23'),_0x577923);_0x41606d['on'](_0xe351('0x24'),_0x1f00f5);_0x41606d['on'](_0xe351('0x12'),_0x519eff);});}; \ No newline at end of file +var _0x329b=['Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','close','bluebird','crypto','../../../../../../config/logger','agi','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','update','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x329b,0xf8));var _0xb329=function(_0x4fa4fd,_0x4c656b){_0x4fa4fd=_0x4fa4fd-0x0;var _0x3c50d0=_0x329b[_0x4fa4fd];return _0x3c50d0;};'use strict';var BPromise=require(_0xb329('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xb329('0x1'));var logger=require(_0xb329('0x2'))(_0xb329('0x3'));module['exports']=function(_0x25cc94,_0x492ab7,_0x41a0b8,_0x320361){return new BPromise(function(_0x42fc77,_0x4dc5ef){logger[_0xb329('0x4')](_0xb329('0x5'),_0x320361||_0xb329('0x6'));var _0x4380bd=new WebSocket(_0x320361||_0xb329('0x6'),{'perMessageDeflate':![]});var _0x358f84='';var _0x5b1896='0';var _0x11cf92='1';var _0xb93733=_0xb329('0x7');function _0x4aabeb(_0x3ebd1b){var _0x508fa4=crypto['createHash']('sha1');_0x508fa4[_0xb329('0x8')](_0x3ebd1b);return _0x508fa4['digest'](_0xb329('0x9'));}function _0x293398(){try{logger[_0xb329('0x4')](_0xb329('0xa'));var _0x9bb736=moment()['unix']();var _0xaa12d2=_0x4aabeb(_0x9bb736+_0x492ab7+_0x41a0b8);_0x4380bd[_0xb329('0xb')](JSON[_0xb329('0xc')]({'appID':_0x492ab7,'timestamp':_0x9bb736,'appKey':_0xaa12d2}));var _0x287b60=fs[_0xb329('0xd')](_0x25cc94);_0x287b60['on'](_0xb329('0xe'),function(_0x55fbd9){_0x4380bd[_0xb329('0xb')](_0x55fbd9);});_0x287b60['on']('close',function(){_0x4380bd[_0xb329('0xb')](_0xb329('0xf'));});}catch(_0x4a3c22){logger['error'](_0xb329('0x10'),JSON['stringify'](_0x4a3c22));_0x4380bd[_0xb329('0x11')]();}}function _0x381d3e(_0x271263){try{if(_0x271263){var _0x5ebddd=JSON[_0xb329('0x12')](_0x271263);switch(_0x5ebddd[_0xb329('0x13')]){case 0x0:if(_0x5ebddd[_0xb329('0x14')]){if(_0x5ebddd['result'][_0xb329('0x15')]){logger[_0xb329('0x4')](_0xb329('0x16'),JSON[_0xb329('0xc')](_0x5ebddd[_0xb329('0x14')]['hypotheses']));_0x358f84=_0x5ebddd[_0xb329('0x14')][_0xb329('0x17')][0x0]['transcript'];_0x5b1896=_0x5ebddd[_0xb329('0x14')][_0xb329('0x17')][0x0][_0xb329('0x18')];_0x11cf92='0';_0xb93733='Success.';_0x4380bd[_0xb329('0x11')]();}}break;case 0x1:logger[_0xb329('0x4')](_0xb329('0x7'));_0x11cf92='1';_0xb93733=_0xb329('0x7');break;case 0x2:logger[_0xb329('0x4')](_0xb329('0x19'));_0x11cf92='2';_0xb93733=_0xb329('0x19');break;case 0x9:logger[_0xb329('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x11cf92='9';_0xb93733='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xb329('0x4')]('Authentication\x20failed.');_0x11cf92='10';_0xb93733=_0xb329('0x1a');break;case 0xb:logger[_0xb329('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x11cf92='11';_0xb93733='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5536fa){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xb329('0xc')](_0x5536fa));_0x4380bd[_0xb329('0x11')]();}}function _0x3cd92a(){logger[_0xb329('0x4')](_0xb329('0x1b'));_0x42fc77({'transcript':_0x358f84,'confidence':_0x5b1896,'status':_0x11cf92,'status_message':_0xb93733});}function _0x8532bb(_0xc3f6a8){logger[_0xb329('0x1c')](_0xb329('0x1d'));if(!_[_0xb329('0x1e')](_0xc3f6a8)){logger[_0xb329('0x1c')](_[_0xb329('0x1f')](_0xc3f6a8)?JSON[_0xb329('0xc')](_0xc3f6a8):_0xc3f6a8);}}_0x4380bd['on']('open',_0x293398);_0x4380bd['on']('message',_0x381d3e);_0x4380bd['on'](_0xb329('0x20'),_0x3cd92a);_0x4380bd['on'](_0xb329('0x1c'),_0x8532bb);});}; \ 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 486cc4b..f6702a1 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 _0xa398=['exports','./asr'];(function(_0x51d078,_0x30f4f5){var _0x4427b8=function(_0x3a1592){while(--_0x3a1592){_0x51d078['push'](_0x51d078['shift']());}};_0x4427b8(++_0x30f4f5);}(_0xa398,0x73));var _0x8a39=function(_0x1a0138,_0x18cdc8){_0x1a0138=_0x1a0138-0x0;var _0x4cab9a=_0xa398[_0x1a0138];return _0x4cab9a;};var asr=require(_0x8a39('0x0'));module[_0x8a39('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8df7=['./asr'];(function(_0x1b8063,_0x274b41){var _0x529a24=function(_0x18e90e){while(--_0x18e90e){_0x1b8063['push'](_0x1b8063['shift']());}};_0x529a24(++_0x274b41);}(_0x8df7,0x1ba));var _0x78df=function(_0x277e5e,_0x4a0bfc){_0x277e5e=_0x277e5e-0x0;var _0x1bc0f0=_0x8df7[_0x277e5e];return _0x1bc0f0;};var asr=require(_0x78df('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 191495c..7a9e90f 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x4d150a,_0x25f904){var _0x885bd4=function(_0x552a7d){while(--_0x552a7d){_0x4d150a['push'](_0x4d150a['shift']());}};_0x885bd4(++_0x25f904);}(_0x34e8,0x12c));var _0x834e=function(_0x1a6b43,_0x597ba7){_0x1a6b43=_0x1a6b43-0x0;var _0xfb59c8=_0x34e8[_0x1a6b43];return _0xfb59c8;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 5453568..e6723d3 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 _0x557d=['Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','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','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','debug','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','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','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','util','lodash','shelljs','odbc','mustache','request-promise','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','url','method','number','timeout','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','%s.%s','replaceObjectAllVariables','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','createSquareDetailsReport','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','setVariable','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda'];(function(_0xcb8cb1,_0x253cb1){var _0x3309a5=function(_0xcc79f){while(--_0xcc79f){_0xcb8cb1['push'](_0xcb8cb1['shift']());}};_0x3309a5(++_0x253cb1);}(_0x557d,0xcb));var _0xd557=function(_0x4ae48c,_0x5bfa54){_0x4ae48c=_0x4ae48c-0x0;var _0x39cdc2=_0x557d[_0x4ae48c];return _0x39cdc2;};'use strict';var fs=require('fs');var util=require(_0xd557('0x0'));var _=require(_0xd557('0x1'));var sh=require(_0xd557('0x2'));var odbc=require(_0xd557('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xd557('0x4'));var rp=require(_0xd557('0x5'));var logger=require('../../config/logger')('agi');var config=require('../../config/environment');var shared=require(_0xd557('0x6'));var scripts=require('./scripts');var FILES_PATH=_0xd557('0x7');var recursiveMapAttributes=[_0xd557('0x8'),_0xd557('0x9')];var verticesWithRetry=['menu',_0xd557('0xa'),'getsecretdigits'];var AGIVertices=function(_0x1379a1,_0x550cab,_0x4c7cb8){this[_0xd557('0xb')]=_0x1379a1;this[_0xd557('0xc')]=_0x550cab;this[_0xd557('0xd')]=_0x4c7cb8;};AGIVertices[_0xd557('0xe')][_0xd557('0xf')]=function(_0x13ac24,_0x4a0522){this[_0xd557('0xc')][_0xd557('0x10')](_0x13ac24)[_0xd557('0x11')](function(_0x2fd036){_0x4a0522(null,_0x2fd036?_0x2fd036[_0xd557('0x12')]:![]);})[_0xd557('0x13')](function(_0x1cf73c){_0x4a0522(_0x1cf73c);});};AGIVertices[_0xd557('0xe')][_0xd557('0x14')]=function(_0x413e84,_0x48c933){this[_0xd557('0xc')][_0xd557('0x15')](_0x413e84)[_0xd557('0x11')](function(_0xc64671){_0x48c933(null,_0xc64671?_0xc64671[_0xd557('0x12')]:![]);})[_0xd557('0x13')](function(_0x208348){_0x48c933(_0x208348);});};AGIVertices[_0xd557('0xe')][_0xd557('0x16')]=function(_0x28d212,_0x38e628){this[_0xd557('0xc')][_0xd557('0x17')](_0x28d212)['then'](function(_0x3992be){_0x38e628(null,_0x3992be?_0x3992be[_0xd557('0x12')]:![]);})[_0xd557('0x13')](function(_0x233294){_0x38e628(_0x233294);});};AGIVertices[_0xd557('0xe')]['getSquareOdbc']=function(_0xf2ff6a,_0x4ecf3b){this[_0xd557('0xc')]['getSquareOdbcById'](_0xf2ff6a)['then'](function(_0x23ff28){_0x4ecf3b(null,_0x23ff28?_0x23ff28[_0xd557('0x18')]:![]);})[_0xd557('0x13')](function(_0x3421c2){_0x4ecf3b(_0x3421c2);});};AGIVertices['prototype'][_0xd557('0x19')]=function(_0x497454,_0x246790){this['rpc']['getUserById'](_0x497454)[_0xd557('0x11')](function(_0x48819d){_0x246790(null,_0x48819d?_0x48819d[_0xd557('0x12')]:![]);})[_0xd557('0x13')](function(_0x4aeeb1){_0x246790(_0x4aeeb1);});};AGIVertices[_0xd557('0xe')][_0xd557('0x1a')]=function(_0x549285,_0x4d7b36){this[_0xd557('0xc')][_0xd557('0x1b')](_0x549285)['then'](function(_0x44bd00){_0x4d7b36(null,_0x44bd00?_0x44bd00['name']:![]);})[_0xd557('0x13')](function(_0x462f39){_0x4d7b36(_0x462f39);});};AGIVertices[_0xd557('0xe')][_0xd557('0x1c')]=function(_0x4dfb80,_0x176088){var _0x577e46=this;this['rpc'][_0xd557('0x1d')](_0x4dfb80)[_0xd557('0x11')](function(_0x2bb78d){_0x176088(null,_0x2bb78d?_0x577e46[_0xd557('0x1e')](_0x2bb78d[_0xd557('0x1f')]):![]);})[_0xd557('0x13')](function(_0x14b17b){_0x176088(_0x14b17b);});};AGIVertices[_0xd557('0xe')]['getMailAccount']=function(_0x5b3be1,_0x4fddf0){this[_0xd557('0xc')]['getMailAccountById'](_0x5b3be1)[_0xd557('0x11')](function(_0x4fec06){_0x4fddf0(null,_0x4fec06?_0x4fec06:![]);})[_0xd557('0x13')](function(_0x1fc41a){_0x4fddf0(_0x1fc41a);});};AGIVertices[_0xd557('0xe')][_0xd557('0x20')]=function(_0x27ec83,_0x5c2165,_0x5e490e){this[_0xd557('0xd')][_0xd557('0x20')](_0x27ec83,_0x5c2165)['then'](function(){_0x5e490e(null);})[_0xd557('0x13')](function(_0x2d3542){_0x5e490e(_0x2d3542);});};AGIVertices[_0xd557('0xe')][_0xd557('0x21')]=function(_0x245664,_0x33dcb1){this[_0xd557('0xc')][_0xd557('0x22')](_0x245664)['then'](function(_0x54a72e){if(_0x54a72e){if(_0x54a72e[_0xd557('0x23')]){_0x33dcb1(null,[_0x54a72e[_0xd557('0x24')]]);}else{_0x33dcb1(null,_['map'](_0x54a72e[_0xd557('0x25')],_0xd557('0x24')));}}else{_0x33dcb1(null,![]);}})[_0xd557('0x13')](function(_0x2f7cde){_0x33dcb1(_0x2f7cde);});};AGIVertices[_0xd557('0xe')][_0xd557('0x1e')]=function(_0x6c94e9){return util[_0xd557('0x26')](_0xd557('0x27'),FILES_PATH,_0x6c94e9);};AGIVertices[_0xd557('0xe')][_0xd557('0x28')]=function(_0x4d5dfd,_0x1233ba,_0x3ce461){odbc[_0xd557('0x29')](_0x4d5dfd,function(_0x2c57d2){if(_0x2c57d2){logger['error'](_0xd557('0x2a'),_0x2c57d2);_0x3ce461(_0x2c57d2);}else{logger[_0xd557('0x2b')](_0xd557('0x2c'));odbc[_0xd557('0x2d')](_0x1233ba,function(_0xb3add6,_0x307023){if(_0xb3add6){logger[_0xd557('0x2b')](_0xd557('0x2e'),_0x1233ba);_0x3ce461(_0xb3add6);}else{logger[_0xd557('0x2b')](_0xd557('0x2f'),_0x1233ba);odbc['close'](function(_0x37ad05){if(_0x37ad05){logger[_0xd557('0x30')](_0xd557('0x31'),_0x37ad05);}_0x3ce461(null,_0x307023);});}});}});};AGIVertices[_0xd557('0xe')][_0xd557('0x32')]=function(_0x510158,_0x4ac59e){this[_0xd557('0xc')][_0xd557('0x33')](_0x510158)['then'](function(_0x539936){_0x4ac59e(null,_0x539936?_0x539936:![]);})[_0xd557('0x13')](function(_0x36c264){_0x4ac59e(_0x36c264);});};AGIVertices[_0xd557('0xe')][_0xd557('0x34')]=function(_0x5394d7,_0x1efc24){this[_0xd557('0xc')][_0xd557('0x34')](_0x5394d7)[_0xd557('0x11')](function(_0x4fcf12){_0x1efc24(null,_0x4fcf12);})['catch'](function(_0x375cd7){_0x1efc24(_0x375cd7);});};AGIVertices[_0xd557('0xe')]['createSquareDetailsReport']=function(_0x2c4506,_0x18560e,_0x19e0aa){this[_0xd557('0xc')]['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x2c4506[_0xd557('0x35')],'application':_0x2c4506['agicommand'],'data':_0x18560e||null,'project_name':this['channel'][_0xd557('0x36')],'callerid':this['channel'][_0xd557('0x37')]})[_0xd557('0x11')](function(_0xecc3b5){if(_0x19e0aa){_0x19e0aa(null,_0xecc3b5);}})[_0xd557('0x13')](function(_0x4b511a){if(_0x19e0aa){_0x19e0aa(_0x4b511a);}});};AGIVertices[_0xd557('0xe')][_0xd557('0x38')]=function(_0x1c5425,_0xcec449,_0x53d9d4,_0x5eb3d3){this[_0xd557('0xc')][_0xd557('0x38')]({'uniqueid':this[_0xd557('0xb')][_0xd557('0x39')],'callerid':this[_0xd557('0xb')]['callerid'],'calleridname':this[_0xd557('0xb')][_0xd557('0x3a')],'context':this[_0xd557('0xb')][_0xd557('0x3b')],'extension':this['channel'][_0xd557('0x3c')],'priority':this['channel'][_0xd557('0x3d')],'accountcode':this[_0xd557('0xb')]['accountcode'],'dnid':this[_0xd557('0xb')]['dnid'],'projectName':this[_0xd557('0xb')][_0xd557('0x36')],'saveName':_0xcec449,'filename':_0x1c5425[_0xd557('0x3e')]||_0xcec449,'savePath':_0x53d9d4})[_0xd557('0x11')](function(_0xefc8b3){_0x5eb3d3(null,_0xefc8b3);})[_0xd557('0x13')](function(_0x58da01){_0x5eb3d3(_0x58da01);});};AGIVertices[_0xd557('0xe')][_0xd557('0x3f')]=function(_0x3dd3ea,_0x46c467,_0x41ea55,_0x3baadb,_0x5d1bc2){this['rpc'][_0xd557('0x3f')]({'uniqueid':this[_0xd557('0xb')][_0xd557('0x39')],'body':_0x3dd3ea,'direction':_0x46c467,'providerName':_0x41ea55,'providerResponse':_0x3baadb})[_0xd557('0x11')](function(_0x5e8bac){if(_0x5d1bc2){_0x5d1bc2(null,_0x5e8bac);}})[_0xd557('0x13')](function(_0x4aceea){if(_0x5d1bc2){_0x5d1bc2(_0x4aceea);}});};AGIVertices[_0xd557('0xe')][_0xd557('0x40')]=function(_0x29ac27,_0x3dec80){this[_0xd557('0xc')][_0xd557('0x40')]({'firstName':_[_0xd557('0x41')](_0x29ac27[_0xd557('0x12')])||_[_0xd557('0x42')](_0x29ac27[_0xd557('0x12')])?_0xd557('0x43')+Math['random']():_0x29ac27[_0xd557('0x12')],'lastName':_[_0xd557('0x41')](_0x29ac27['lastName'])||_['isNil'](_0x29ac27[_0xd557('0x44')])?null:_0x29ac27[_0xd557('0x44')],'phone':_0x29ac27[_0xd557('0x45')],'ListId':_0x29ac27[_0xd557('0x46')],'scheduledat':_0x29ac27['scheduledAt'],'callbackUniqueid':this[_0xd557('0xb')][_0xd557('0x39')],'tags':'callback','description':_0xd557('0x47')+_0x29ac27[_0xd557('0x48')][_0xd557('0x49')](),'priority':_0x29ac27[_0xd557('0x4a')]})[_0xd557('0x11')](function(_0x538166){_0x3dec80(null,_0x538166);})[_0xd557('0x13')](function(_0x5575d1){_0x3dec80(_0x5575d1);});};AGIVertices['prototype']['getPause']=function(_0x279d77,_0x56397f){this[_0xd557('0xc')][_0xd557('0x4b')](_0x279d77)[_0xd557('0x11')](function(_0x2cd8d6){_0x56397f(null,_0x2cd8d6?_0x2cd8d6[_0xd557('0x12')]:![]);})[_0xd557('0x13')](function(_0x5b0790){_0x56397f(_0x5b0790);});};AGIVertices['prototype'][_0xd557('0x4c')]=function(_0x44d7b9,_0x41ca6a,_0x4e604a){var _0x3f7533={'role':_0xd557('0x4d')};_0x3f7533[_0x44d7b9]=this[_0xd557('0xb')][_0xd557('0x37')];this[_0xd557('0xc')][_0xd557('0x4c')](_0x3f7533,_0x41ca6a,this[_0xd557('0xb')][_0xd557('0x39')])['then'](function(_0x18d40c){_0x4e604a(null,_['isNil'](_0x18d40c)?![]:!![]);})[_0xd557('0x13')](function(_0x3ccee0){logger[_0xd557('0x30')](_0x3ccee0);_0x4e604a(null,![]);});};AGIVertices[_0xd557('0xe')]['agentUnpause']=function(_0x45958c,_0x432852){var _0x331d14={'role':'agent'};_0x331d14[_0x45958c]=this[_0xd557('0xb')]['callerid'];this['rpc'][_0xd557('0x4e')](_0x331d14)['then'](function(_0xb51d42){_0x432852(null,_['isNil'](_0xb51d42)?![]:!![]);})[_0xd557('0x13')](function(_0x36ebdb){logger['error'](_0x36ebdb);_0x432852(null,![]);});};AGIVertices[_0xd557('0xe')][_0xd557('0x4f')]=function(_0x28d0ea,_0x4b1ef6){var _0x1f9ad2={'role':'agent'};_0x1f9ad2[_0x28d0ea]=this[_0xd557('0xb')][_0xd557('0x37')];this[_0xd557('0xc')][_0xd557('0x4f')](_0x1f9ad2)[_0xd557('0x11')](function(_0x5b5a3b){_0x4b1ef6(null,_['isNil'](_0x5b5a3b)?![]:!![]);})[_0xd557('0x13')](function(_0xd1521){logger[_0xd557('0x30')](_0xd1521);_0x4b1ef6(null,![]);});};AGIVertices[_0xd557('0xe')][_0xd557('0x50')]=function(_0x58e05b,_0xfbaae6){var _0x4b3253={'role':'agent'};_0x4b3253[_0x58e05b]=this['channel'][_0xd557('0x37')];var _0x5d493a=_0x58e05b!=_0xd557('0x51')?util[_0xd557('0x26')](_0xd557('0x52'),'LOCAL',this[_0xd557('0xb')][_0xd557('0x37')]):undefined;this[_0xd557('0xc')][_0xd557('0x50')](_0x4b3253,_0x5d493a)[_0xd557('0x11')](function(_0x123b9a){_0xfbaae6(null,_[_0xd557('0x42')](_0x123b9a)?![]:!![]);})[_0xd557('0x13')](function(_0x3d05ff){logger[_0xd557('0x30')](_0x3d05ff);_0xfbaae6(null,![]);});};AGIVertices[_0xd557('0xe')]['shellCommand']=function(_0x3d612a,_0xb7516b){sh[_0xd557('0x53')](_[_0xd557('0x54')](_0x3d612a),function(_0x158e21,_0x2e9426){var _0x148fe6=_0x2e9426[_0xd557('0x55')](/(\r\n|\n|\r)/gm,'');_0xb7516b(null,_0x148fe6);});};AGIVertices[_0xd557('0xe')][_0xd557('0x56')]=function(_0x3b6ac7,_0x116479){scripts[_0xd557('0x56')](_0x3b6ac7[_0xd557('0x57')],_0x3b6ac7[_0xd557('0x58')]||_0xd557('0x59'),_0x3b6ac7[_0xd557('0x59')],_0x3b6ac7[_0xd557('0x5a')]||_0xd557('0x5b'),_0x3b6ac7[_0xd557('0x5c')]||'MALE',_0x3b6ac7[_0xd557('0x5d')]||_0xd557('0x5e'))[_0xd557('0x11')](function(_0xca360c){_0x116479(null,_0xca360c);})['catch'](function(_0x10d34d){_0x116479(_0x10d34d);});};AGIVertices[_0xd557('0xe')][_0xd557('0x5f')]=function(_0x5e7fc4,_0x6de577){scripts[_0xd557('0x5f')](_0x5e7fc4[_0xd557('0x59')],_0x5e7fc4['google_tts_language']||'en',0x1)['then'](function(_0x35cd48){_0x6de577(null,_0x35cd48);})['catch'](function(_0x551cab){_0x6de577(_0x551cab);});};AGIVertices['prototype']['restAPI']=function(_0x5eef96,_0x3f57b7){var _0x382c6f={'uri':_0x5eef96[_0xd557('0x60')],'method':_0x5eef96[_0xd557('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5eef96['timeout'])===_0xd557('0x62')&&parseInt(_0x5eef96['timeout'])>=0x1?parseInt(_0x5eef96[_0xd557('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xd557('0x64')](['POST',_0xd557('0x65')],_0x382c6f[_0xd557('0x61')][_0xd557('0x66')]())){try{_0x382c6f[_0xd557('0x67')]=_0x5eef96['rawBody']?JSON[_0xd557('0x68')](_0x5eef96[_0xd557('0x9')]):{};}catch(_0x13fef7){logger[_0xd557('0x30')](_0xd557('0x69'),_0x13fef7);}}try{_0x382c6f[_0xd557('0x6a')]=_0x5eef96[_0xd557('0x8')]?JSON[_0xd557('0x68')](_0x5eef96[_0xd557('0x8')]):{};}catch(_0x58d3f9){logger['error'](_0xd557('0x6b'),_0x58d3f9);}if(_0x5eef96['computedVariables']){try{var _0x181764=require(_0x5eef96['computedVariables'])[_0xd557('0x6c')](this,_0x382c6f);_0x382c6f['uri']=Mustache[_0xd557('0x6d')](_0x5eef96[_0xd557('0x60')],_0x181764,{},['$$','$$']);if(_0x382c6f[_0xd557('0x6a')]){_0x382c6f['headers']=JSON[_0xd557('0x68')](Mustache[_0xd557('0x6d')](JSON[_0xd557('0x6e')](_0x382c6f[_0xd557('0x6a')]),_0x181764,{},['$$','$$']));}if(_0x382c6f[_0xd557('0x67')]){_0x382c6f[_0xd557('0x67')]=JSON['parse'](Mustache['render'](JSON[_0xd557('0x6e')](_0x382c6f[_0xd557('0x67')]),_0x181764,{},['$$','$$']));}}catch(_0x34de42){logger[_0xd557('0x30')](_0xd557('0x6f'),_0x34de42);}}rp(_0x382c6f)['then'](function(_0x51daba){var _0x29af82={'statusCode':_0x51daba[_0xd557('0x70')]||0xc8,'statusMessage':_0x51daba[_0xd557('0x71')]||'OK','headers':_0x51daba[_0xd557('0x6a')]||{},'body':_0x51daba[_0xd557('0x67')]||{}};_0x3f57b7(null,_0x29af82);})[_0xd557('0x13')](function(_0x167c88){var _0x12f329={'statusCode':_0x167c88['statusCode']||0x1f4,'statusMessage':_0x167c88[_0xd557('0x72')]||_0xd557('0x73'),'headers':_0x167c88[_0xd557('0x74')][_0xd557('0x6a')]||{},'body':_0x167c88[_0xd557('0x74')]['body']||{}};_0x3f57b7(null,_0x12f329);});};AGIVertices[_0xd557('0xe')]['googleDialogflow']=function(_0x210d5b,_0x3493c5){scripts[_0xd557('0x75')](this['channel'][_0xd557('0x39')],_0x210d5b[_0xd557('0x76')],_0x210d5b[_0xd557('0x59')],_0x210d5b['dialogflow_language']||'en')[_0xd557('0x11')](function(_0x4f9705){_0x3493c5(null,_0x4f9705);})[_0xd557('0x13')](function(_0x3c6d9d){_0x3493c5(_0x3c6d9d);});};AGIVertices[_0xd557('0xe')][_0xd557('0x77')]=function(_0x3d43b3,_0x5512a1){scripts['googleDialogflowV2'](this[_0xd557('0xb')]['uniqueid'],_0x3d43b3[_0xd557('0x78')],_0x3d43b3[_0xd557('0x79')],_0x3d43b3[_0xd557('0x7a')],_0x3d43b3[_0xd557('0x59')],_0x3d43b3[_0xd557('0x7b')]||'en')[_0xd557('0x11')](function(_0x40f6ff){_0x5512a1(null,_0x40f6ff);})[_0xd557('0x13')](function(_0x4bcbde){_0x5512a1(_0x4bcbde);});};AGIVertices['prototype'][_0xd557('0x7c')]=function(_0x2f0f12,_0x27e917){scripts[_0xd557('0x7c')](this[_0xd557('0xb')],_0x2f0f12)[_0xd557('0x11')](function(_0x5ef37c){_0x27e917(null,_0x5ef37c);})[_0xd557('0x13')](function(_0x529297){_0x27e917(_0x529297);});};AGIVertices[_0xd557('0xe')]['ispeechTTS']=function(_0x12899c,_0x29dcdd){scripts[_0xd557('0x7d')](_0x12899c['key'],_0x12899c[_0xd557('0x59')],_0x12899c[_0xd557('0x7e')]||_0xd557('0x5b'),_0x12899c[_0xd557('0x7f')])['then'](function(_0x59ff61){_0x29dcdd(null,_0x59ff61);})[_0xd557('0x13')](function(_0x490b2c){_0x29dcdd(_0x490b2c);});};AGIVertices[_0xd557('0xe')][_0xd557('0x80')]=function(_0x15b3e9,_0x3bc725,_0x402fe8){scripts[_0xd557('0x80')](_0x3bc725,_0x15b3e9[_0xd557('0x76')],_0x15b3e9[_0xd557('0x81')]||_0xd557('0x5b'),this[_0xd557('0x82')](_0x15b3e9['model'])?_0x15b3e9[_0xd557('0x83')]:undefined)['then'](function(_0x462237){_0x402fe8(null,_0x462237);})[_0xd557('0x13')](function(_0xb9796f){_0x402fe8(_0xb9796f);});};AGIVertices[_0xd557('0xe')][_0xd557('0x84')]=function(_0x4e963b,_0x28cadf){scripts[_0xd557('0x84')](_0x4e963b[_0xd557('0x85')],_0x4e963b['aws_secret_access_key'],_0x4e963b[_0xd557('0x86')],_0x4e963b[_0xd557('0x87')]||_0xd557('0x88'),_0x4e963b[_0xd557('0x59')],_0x4e963b[_0xd557('0x89')]||'text')[_0xd557('0x11')](function(_0x1eefb8){_0x28cadf(null,_0x1eefb8);})[_0xd557('0x13')](function(_0xeeee17){_0x28cadf(_0xeeee17);});};AGIVertices[_0xd557('0xe')][_0xd557('0x8a')]=function(_0x426ad8,_0x284304){scripts['awsLex'](this[_0xd557('0xb')][_0xd557('0x39')],_0x426ad8[_0xd557('0x85')],_0x426ad8[_0xd557('0x8b')],_0x426ad8['aws_lex_region'],_0x426ad8[_0xd557('0x59')],_0x426ad8[_0xd557('0x8c')])[_0xd557('0x11')](function(_0x5c21f2){_0x284304(null,_0x5c21f2);})[_0xd557('0x13')](function(_0x3773cd){_0x284304(_0x3773cd);});};AGIVertices['prototype'][_0xd557('0x8d')]=function(_0x279a1b,_0x18f9a6,_0x2e2df2){scripts['googleASR'](_0x18f9a6,_0x279a1b['key'],_0x279a1b[_0xd557('0x8e')]||'en-US')[_0xd557('0x11')](function(_0x1cb097){_0x2e2df2(null,_0x1cb097);})[_0xd557('0x13')](function(_0x39b646){_0x2e2df2(_0x39b646);});};AGIVertices[_0xd557('0xe')][_0xd557('0x8f')]=function(_0x4bcd93,_0x4940c9,_0x436207){scripts[_0xd557('0x8f')](_0x4940c9,_0x4bcd93[_0xd557('0x90')],_0x4bcd93[_0xd557('0x91')],_0x4bcd93[_0xd557('0x92')])[_0xd557('0x11')](function(_0x5ef6ba){_0x436207(null,_0x5ef6ba);})[_0xd557('0x13')](function(_0x574d9d){_0x436207(_0x574d9d);});};AGIVertices[_0xd557('0xe')][_0xd557('0x93')]=function(_0x4abc5d){var _0xaf087=_[_0xd557('0x64')](verticesWithRetry,_0x4abc5d['agicommand'])?_0x4abc5d:_[_0xd557('0x94')](_0x4abc5d);for(var _0xa2a1c5 in _0xaf087){if(_0xaf087['hasOwnProperty'](_0xa2a1c5)){if(_0xaf087[_0xa2a1c5]&&_[_0xd557('0x95')](_0xaf087[_0xa2a1c5])){if(_[_0xd557('0x64')](recursiveMapAttributes,_0xa2a1c5)){_0xaf087[_0xa2a1c5]=this['replaceObjectAllVariables'](_0xaf087[_0xa2a1c5]);}else{_0xaf087[_0xa2a1c5]=this[_0xd557('0x96')](_0xaf087[_0xa2a1c5]);}}}}return _0xaf087;};AGIVertices[_0xd557('0xe')][_0xd557('0x97')]=function(_0x19ea84){for(var _0x1229d8 in _0x19ea84){if(_0x19ea84[_0xd557('0x98')](_0x1229d8)){if(_[_0xd557('0x99')](_0x19ea84[_0x1229d8])){this[_0xd557('0x97')](_0x19ea84[_0x1229d8]);}else if(_['isArray'](_0x19ea84[_0x1229d8])){for(var _0x431879=0x0;_0x431879<_0x19ea84[_0x1229d8][_0xd557('0x9a')];_0x431879++){this[_0xd557('0x97')](_0x19ea84[_0x1229d8][_0x431879]);}}else if(_[_0xd557('0x95')](_0x19ea84[_0x1229d8])){_0x19ea84[_0x1229d8]=this['replaceAllVariables'](_0x19ea84[_0x1229d8]);}}}};AGIVertices[_0xd557('0xe')]['saveRestApiResult']=function(_0x40445d,_0x79d33c){for(var _0x353a69 in _0x40445d){if(_0x40445d[_0xd557('0x98')](_0x353a69)){if(_[_0xd557('0x99')](_0x40445d[_0x353a69])){if(!_['isEmpty'](_0x40445d[_0x353a69])){this['saveRestApiResult'](_0x40445d[_0x353a69],util[_0xd557('0x26')](_0xd557('0x9b'),_0x79d33c,_0x353a69));}}else if(_['isArray'](_0x40445d[_0x353a69])){for(var _0x3c0fbf=0x0;_0x3c0fbf<_0x40445d[_0x353a69][_0xd557('0x9a')];_0x3c0fbf++){this['saveRestApiResult'](_0x40445d[_0x353a69][_0x3c0fbf],util[_0xd557('0x26')](_0xd557('0x9b'),_0x79d33c,_0x353a69+'['+_0x3c0fbf+']'));}}else{if(!_[_0xd557('0x42')](_0x40445d[_0x353a69])){this[_0xd557('0xb')]['setVariable'](util[_0xd557('0x26')](_0xd557('0x9b'),_0x79d33c,_0x353a69),_0x40445d[_0x353a69]);}}}}};AGIVertices[_0xd557('0xe')][_0xd557('0x9c')]=function(_0x13faf0){try{var _0x309346=JSON[_0xd557('0x68')](_0x13faf0);this[_0xd557('0x97')](_0x309346);return JSON['stringify'](_0x309346);}catch(_0x51422f){return this[_0xd557('0x96')](_0x13faf0);}};AGIVertices['prototype'][_0xd557('0x96')]=function(_0x4346f6){var _0x2281f6=_0x4346f6[_0xd557('0x9d')]('{');for(var _0x5e74b7=0x1;_0x5e74b7<_0x2281f6[_0xd557('0x9a')];_0x5e74b7+=0x1){var _0x4c8ef6=_0x2281f6[_0x5e74b7][_0xd557('0x9d')]('}');if(_0x4c8ef6[_0xd557('0x9a')]>0x1){_0x4346f6=_0x4346f6['replaceAll']('{'+_0x4c8ef6[0x0]+'}',this['channel'][_0xd557('0xf')](_0x4c8ef6[0x0])[_0xd557('0x9e')]||_0x4c8ef6[0x0]);}}if(_0x2281f6[_0xd557('0x9a')]===0x1){return _0x4346f6[_0xd557('0x49')]();}return this[_0xd557('0x96')](_0x4346f6);};AGIVertices[_0xd557('0xe')][_0xd557('0x9f')]=function(_0x4b1cd3,_0x35539c){var _0x27da8b=this[_0xd557('0xb')][_0xd557('0xf')](_0x4b1cd3);if(_0x27da8b[_0xd557('0xa0')]===-0x1){return _0x27da8b;}logger[_0xd557('0x2b')](util['format'](_0xd557('0xa1'),_0x35539c,_0x27da8b[_0xd557('0x9e')]));return this[_0xd557('0xb')]['setVariable'](_0x35539c,_0x27da8b[_0xd557('0x9e')]);};AGIVertices['prototype'][_0xd557('0x82')]=function(_0x112f5d){return _0x112f5d&&_0x112f5d!=='0'&&_0x112f5d!=='-1'&&_0x112f5d!=='';};AGIVertices['prototype'][_0xd557('0xa2')]=function(_0x14cace){this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x14cace,'-');_0x14cace[_0xd557('0xa4')]=_0x14cace[_0xd557('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x104e6d){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xa5'),_0x104e6d[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x104e6d[_0xd557('0x59')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xa7'));}var _0x33a691='\x22'+_0x104e6d['text']+'\x22';if(this[_0xd557('0x82')](_0x104e6d[_0xd557('0x74')])){_0x33a691+=','+_0x104e6d[_0xd557('0x74')];}var _0x2a6e84=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0xa8'),_0x33a691);if(_0x2a6e84[_0xd557('0xa0')]===-0x1){return _0x2a6e84;}return this[_0xd557('0xb')][_0xd557('0xa6')](util['format'](_0xd557('0xa9'),_0x33a691));};AGIVertices['prototype'][_0xd557('0xaa')]=function(_0x465f22){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x465f22[_0xd557('0x35')]));if(!this['isConfigured'](_0x465f22[_0xd557('0xab')])){return this[_0xd557('0xb')]['noop'](_0xd557('0xac'));}var _0x404ba7=_0x465f22['grammar'];if(this[_0xd557('0x82')](_0x465f22[_0xd557('0x74')])){_0x404ba7+=','+_0x465f22[_0xd557('0x74')];}var _0x2a50a4=this[_0xd557('0xb')]['exec']('MRCPRecog',_0x404ba7);if(_0x2a50a4['result']===-0x1){return _0x2a50a4;}var _0x23285f=this[_0xd557('0x9f')](_0xd557('0xad'),_0xd557('0xae'));if(_0x23285f[_0xd557('0xa0')]===-0x1){return _0x23285f;}var _0x10f810=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x10f810[_0xd557('0xa0')]===-0x1){return _0x10f810;}var _0xcc891e=this[_0xd557('0x9f')](_0xd557('0xaf'),'MRCP_RECOG_INSTANCE');if(_0xcc891e[_0xd557('0xa0')]===-0x1){return _0xcc891e;}return this[_0xd557('0xb')][_0xd557('0xa6')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x404ba7));};AGIVertices[_0xd557('0xe')]['agi']=function(_0x3e8136){logger[_0xd557('0x2b')](util['format'](_0xd557('0xb0'),_0x3e8136[_0xd557('0x35')]));return this[_0xd557('0xb')][_0xd557('0xb1')]([_0x3e8136[_0xd557('0xb2')],_0x3e8136[_0xd557('0xb3')]]);};AGIVertices['prototype'][_0xd557('0xb4')]=function(_0x4409ae){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4409ae['label']));if(this[_0xd557('0x82')](_0x4409ae[_0xd557('0x63')])){logger['info'](util[_0xd557('0x26')](_0xd557('0xb5'),_0x4409ae[_0xd557('0x63')]));var _0x285a33=this[_0xd557('0xb')]['wait'](_0x4409ae[_0xd557('0x63')]);if(_0x285a33[_0xd557('0xa0')]===-0x1){return _0x285a33;}}return this['channel'][_0xd557('0xb4')]();};AGIVertices[_0xd557('0xe')][_0xd557('0xb6')]=function(_0x2997ac){logger['info'](util['format'](_0xd557('0xb7'),_0x2997ac['label']));if(!this['isConfigured'](_0x2997ac['list_id'])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x2997ac,_0xd557('0xb8'));}_0x2997ac['scheduledAt']=moment();if(this['isConfigured'](_0x2997ac[_0xd557('0xb9')])){_0x2997ac[_0xd557('0x48')]=moment()[_0xd557('0xba')](_0x2997ac[_0xd557('0xb9')],'minutes');}if(!this[_0xd557('0x82')](_0x2997ac[_0xd557('0x4a')])){_0x2997ac['callback_priority']=0x2;}this[_0xd557('0x40')]['sync'](this,_0x2997ac);return this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2997ac[_0xd557('0x45')],_0x2997ac[_0xd557('0x46')],_0x2997ac[_0xd557('0x48')]));};AGIVertices[_0xd557('0xe')]['custom_app']=function(_0x24e06a){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xbb'),_0x24e06a[_0xd557('0x35')]));var _0x3e72aa=this[_0xd557('0xb')][_0xd557('0x53')](_0x24e06a[_0xd557('0xbc')],_0x24e06a[_0xd557('0x74')]);if(_0x3e72aa['result']===-0x1){return _0x3e72aa;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xbd'),_0x24e06a['application'],_0x24e06a[_0xd557('0x74')]));};AGIVertices[_0xd557('0xe')]['lumenvoxtts']=function(_0xbbc4c2){logger[_0xd557('0x2b')](util['format'](_0xd557('0xbe'),_0xbbc4c2[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0xbbc4c2[_0xd557('0x59')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20text\x20configured');}var _0x4455ac='\x22'+_0xbbc4c2[_0xd557('0x59')]+'\x22';if(this[_0xd557('0x82')](_0xbbc4c2[_0xd557('0x74')])){_0x4455ac+=','+_0xbbc4c2[_0xd557('0x74')];}var _0x25133f=this[_0xd557('0xb')]['exec'](_0xd557('0xa8'),_0x4455ac);if(_0x25133f[_0xd557('0xa0')]===-0x1){return _0x25133f;}return this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0xa9'),_0x4455ac));};AGIVertices[_0xd557('0xe')][_0xd557('0xbf')]=function(_0x169567){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xc0'),_0x169567[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x169567[_0xd557('0x59')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xa7'));}var _0x2c1ad3='\x22'+_0x169567[_0xd557('0x59')]+'\x22';if(this[_0xd557('0x82')](_0x169567[_0xd557('0x74')])){_0x2c1ad3+=','+_0x169567[_0xd557('0x74')];}var _0x17a261=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0xa8'),_0x2c1ad3);if(_0x17a261[_0xd557('0xa0')]===-0x1){return _0x17a261;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xa9'),_0x2c1ad3));};AGIVertices[_0xd557('0xe')][_0xd557('0xc1')]=function(_0x63dae5){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xc2'),_0x63dae5[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x63dae5[_0xd557('0xab')])){return this[_0xd557('0xb')]['noop']('no\x20grammar\x20configured');}var _0x81587b=_0x63dae5[_0xd557('0xab')];if(this[_0xd557('0x82')](_0x63dae5[_0xd557('0x74')])){_0x81587b+=','+_0x63dae5[_0xd557('0x74')];}var _0x3decae=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0xc3'),_0x81587b);if(_0x3decae[_0xd557('0xa0')]===-0x1){return _0x3decae;}var _0x38b804=this['getAndSetVariable'](_0xd557('0xad'),_0xd557('0xc4'));if(_0x38b804['result']===-0x1){return _0x38b804;}var _0x767a9a=this[_0xd557('0x9f')](_0xd557('0xc5'),_0xd557('0xc6'));if(_0x767a9a['result']===-0x1){return _0x767a9a;}var _0x4dc6d0=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x4dc6d0[_0xd557('0xa0')]===-0x1){return _0x4dc6d0;}return this[_0xd557('0xb')][_0xd557('0xa6')](util['format'](_0xd557('0xc7'),_0x81587b));};AGIVertices[_0xd557('0xe')][_0xd557('0xc8')]=function(_0x333c98){logger[_0xd557('0x2b')](util['format'](_0xd557('0xc9'),_0x333c98[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x333c98['grammar'])){return this['channel'][_0xd557('0xa6')](_0xd557('0xac'));}var _0x533fac=_0x333c98[_0xd557('0xab')];if(this[_0xd557('0x82')](_0x333c98['options'])){_0x533fac+=','+_0x333c98[_0xd557('0x74')];}var _0x51e467=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0xc3'),_0x533fac);if(_0x51e467[_0xd557('0xa0')]===-0x1){return _0x51e467;}var _0x5aea81=this[_0xd557('0x9f')](_0xd557('0xad'),_0xd557('0xca'));if(_0x5aea81[_0xd557('0xa0')]===-0x1){return _0x5aea81;}var _0x51393a=this[_0xd557('0x9f')](_0xd557('0xc5'),'SESTEK_ASR_TRANSCRIPT');if(_0x51393a[_0xd557('0xa0')]===-0x1){return _0x51393a;}var _0x50363b=this['getAndSetVariable'](_0xd557('0xaf'),_0xd557('0xcb'));if(_0x50363b[_0xd557('0xa0')]===-0x1){return _0x50363b;}return this['channel'][_0xd557('0xa6')](util['format'](_0xd557('0xc7'),_0x533fac));};AGIVertices[_0xd557('0xe')][_0xd557('0xcc')]=function(_0x5f31fe){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5f31fe[_0xd557('0x35')]));if(!this['isConfigured'](_0x5f31fe[_0xd557('0xcd')])){return this[_0xd557('0xb')]['error'](_0x5f31fe,_0xd557('0xce'));}var _0xa66101=this[_0xd557('0xcf')][_0xd557('0x6c')](this,_0x5f31fe[_0xd557('0xcd')]);if(!_0xa66101){return this[_0xd557('0xb')][_0xd557('0x30')](_0x5f31fe,_0xd557('0xd0'));}if(!this['isConfigured'](_0x5f31fe[_0xd557('0x2d')])){return this[_0xd557('0xb')]['error'](_0x5f31fe,_0xd557('0xd1'));}var _0x25acaa=_0x5f31fe[_0xd557('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xd2'),_0x25acaa));var _0x5d19f0=this['getQueryOdbc']['sync'](this,_0xa66101,_0x25acaa);this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x5f31fe,_0x25acaa);if(!this[_0xd557('0x82')](_0x5f31fe['variable_id'])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xd3'));}var _0x4c93f8=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x5f31fe[_0xd557('0xd4')]);if(!_0x4c93f8){return this['channel'][_0xd557('0x30')](_0x5f31fe,'no\x20variable\x20found');}var _0x5a117b=this;_0x5d19f0[_0xd557('0xd5')](function(_0x4282f2,_0x1d0ace){Object[_0xd557('0xd6')](_0x4282f2)[_0xd557('0xd5')](function(_0x55487e){_0x5a117b[_0xd557('0xb')]['setVariable'](util[_0xd557('0x26')]('%s[%s][%s]',_0x4c93f8,_0x1d0ace,_0x55487e),_0x4282f2[_0x55487e]);});});this['channel'][_0xd557('0xd7')](util[_0xd557('0x26')]('%s_ROWS_COUNT',_0x4c93f8),_0x5d19f0[_0xd557('0x9a')]);return this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')]('variable\x20%s\x20set',_0x4c93f8));};AGIVertices[_0xd557('0xe')][_0xd557('0xd8')]=function(_0x46a747){logger['debug'](util[_0xd557('0x26')](_0xd557('0xd9'),_0x46a747['label']));if(!this[_0xd557('0x82')](_0x46a747[_0xd557('0xda')])){return this[_0xd557('0xb')]['error'](_0x46a747,'no\x20user\x20selected');}var _0x1a1213=this[_0xd557('0x19')][_0xd557('0x6c')](this,_0x46a747[_0xd557('0xda')]);if(!_0x1a1213){return this[_0xd557('0xb')][_0xd557('0x30')](_0x46a747,_0xd557('0xdb'));}var _0x385019=this[_0xd557('0xb')][_0xd557('0x53')]('DIAL',[util[_0xd557('0x26')]('SIP/%s',_0x1a1213),_0x46a747[_0xd557('0x63')],_0x46a747['opts'],_0x46a747[_0xd557('0x60')]]);if(_0x385019[_0xd557('0xa0')]===-0x1){return _0x385019;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xdc'),_0xd557('0xdd')));};AGIVertices[_0xd557('0xe')][_0xd557('0xde')]=function(_0x4a91af){logger['info'](util[_0xd557('0x26')](_0xd557('0xdf'),_0x4a91af[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x4a91af[_0xd557('0x76')])){return this['channel'][_0xd557('0xa6')](_0xd557('0xe0'));}if(!this['isConfigured'](_0x4a91af[_0xd557('0x59')])){return this['channel']['noop'](_0xd557('0xa7'));}this[_0xd557('0xb')][_0xd557('0xe1')]=!![];this[_0xd557('0xa3')](_0x4a91af);this['createSquareMessage'](_0x4a91af['text'],'in','','');this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xe2'),_0x4a91af[_0xd557('0x59')]));var _0x420994=this[_0xd557('0x75')][_0xd557('0x6c')](this,_0x4a91af);if(_0x420994){for(var _0x10583c in _0x420994){if(_0x420994[_0xd557('0x98')](_0x10583c)){this[_0xd557('0xb')]['setVariable'](util[_0xd557('0x26')](_0xd557('0xe3'),_0x10583c[_0xd557('0x66')]()),_0x420994[_0x10583c]);}}this[_0xd557('0x3f')](_0x420994[_0xd557('0xe4')],_0xd557('0xe5'),_0xd557('0xde'),'');return this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')]('Dialogflow\x20Result\x20%s',_0x420994['speech']));}return this[_0xd557('0xb')]['error'](_0x4a91af,_0xd557('0xe6'));};AGIVertices[_0xd557('0xe')][_0xd557('0xe7')]=function(_0x12bb7a){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xe8'),_0x12bb7a[_0xd557('0x35')]));if(!this['isConfigured'](_0x12bb7a[_0xd557('0x78')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20project_id\x20configured');}if(!this[_0xd557('0x82')](_0x12bb7a[_0xd557('0x79')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xe9'));}if(!this['isConfigured'](_0x12bb7a[_0xd557('0x7a')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20private_key\x20configured');}if(!this[_0xd557('0x82')](_0x12bb7a[_0xd557('0x7b')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xea'));}if(!this[_0xd557('0x82')](_0x12bb7a[_0xd557('0x59')])){return this['channel'][_0xd557('0xa6')](_0xd557('0xa7'));}this[_0xd557('0xb')][_0xd557('0xe1')]=!![];this[_0xd557('0xa3')](_0x12bb7a);this['createSquareMessage'](_0x12bb7a[_0xd557('0x59')],'in','','');this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xeb'),_0x12bb7a[_0xd557('0x59')]));var _0x24d957=this[_0xd557('0x77')][_0xd557('0x6c')](this,_0x12bb7a);if(_0x24d957){for(var _0x43a4e2 in _0x24d957){if(_0x24d957[_0xd557('0x98')](_0x43a4e2)){if(_0x43a4e2!==_0xd557('0xec')){this[_0xd557('0xb')]['setVariable'](util['format'](_0xd557('0xe3'),_0x43a4e2[_0xd557('0x66')]()),_0x24d957[_0x43a4e2]);}}}this[_0xd557('0x3f')](_0x24d957[_0xd557('0xe4')],'out',_0xd557('0xe7'),_0x24d957['providerResponse']);return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xed'),_0x24d957['speech']));}return this[_0xd557('0xb')][_0xd557('0x30')](_0x12bb7a,_0xd557('0xee'));};AGIVertices[_0xd557('0xe')][_0xd557('0xef')]=function(_0x27641b){logger['info'](util['format'](_0xd557('0xf0'),_0x27641b[_0xd557('0x35')]));if(!this['isConfigured'](_0x27641b[_0xd557('0xf1')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xf2'));}if(!this[_0xd557('0x82')](_0x27641b[_0xd557('0xf3')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xf4'));}if(!this[_0xd557('0x82')](_0x27641b[_0xd557('0xf5')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20password\x20configured');}if(!this[_0xd557('0x82')](_0x27641b['ndassistant_url'])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xa7'));}this[_0xd557('0xb')][_0xd557('0xe1')]=!![];this[_0xd557('0xa3')](_0x27641b);this[_0xd557('0x3f')](_0x27641b[_0xd557('0x59')],'in','','');this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0xf6'),_0x27641b[_0xd557('0x59')]));var _0xcc171=this['sestekNDA'][_0xd557('0x6c')](this,_0x27641b);if(_0xcc171){for(var _0x368660 in _0xcc171){if(_0xcc171['hasOwnProperty'](_0x368660)){this[_0xd557('0xb')]['setVariable'](util[_0xd557('0x26')]('SESTEK_NDA_%s',_0x368660[_0xd557('0x66')]()),_0xcc171[_0x368660]);}}this[_0xd557('0x3f')](_0xcc171['speech'],_0xd557('0xe5'),_0xd557('0xef'),'');if(_0xcc171[_0xd557('0xf7')]){this[_0xd557('0xb')][_0xd557('0xa6')](util['format'](_0xd557('0xf8'),_0xcc171['audiofile']));var _0x2c1a89=this[_0xd557('0xb')]['streamFile'](_0xcc171[_0xd557('0xf7')]);try{fs[_0xd557('0xf9')](_0xcc171[_0xd557('0xf7')]+_0xd557('0xfa'));}catch(_0x2225ca){logger[_0xd557('0x30')](_0x2225ca);}return _0x2c1a89;}else{return this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0xfb'),_0xcc171[_0xd557('0xe4')]));}}return this[_0xd557('0xb')]['error'](_0x27641b,_0xd557('0xfc'));};AGIVertices[_0xd557('0xe')][_0xd557('0xfd')]=function(_0x2ff262){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0xfe'),_0x2ff262['label']));return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xfd'));};AGIVertices['prototype']['ext_dial']=function(_0x3ddc33){logger['info'](util[_0xd557('0x26')](_0xd557('0xff'),_0x3ddc33[_0xd557('0x35')]));var _0x4b25d0='';if(_0x3ddc33[_0xd557('0x100')]){if(!this[_0xd557('0x82')](_0x3ddc33[_0xd557('0x100')])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x3ddc33,_0xd557('0x101'));}else{var _0xde3053=parseInt(_0x3ddc33[_0xd557('0x100')],0xa);if(isNaN(_0xde3053)){_0x4b25d0=_0x3ddc33[_0xd557('0x100')];}else{_0x4b25d0=this[_0xd557('0x1a')][_0xd557('0x6c')](this,_0x3ddc33[_0xd557('0x100')]);if(!_0x4b25d0){return this[_0xd557('0xb')][_0xd557('0x30')](_0x3ddc33,_0xd557('0x102'));}}}}else if(_0x3ddc33['trunk_name']){_0x4b25d0=_0x3ddc33[_0xd557('0x103')];}else{return this[_0xd557('0xb')]['error'](_0x3ddc33,_0xd557('0x101'));}var _0x4b1c79=this['channel'][_0xd557('0x53')](_0xd557('0xdd'),[util[_0xd557('0x26')]('SIP/%s/%s',_0x4b25d0,_0x3ddc33[_0xd557('0x45')]),_0x3ddc33[_0xd557('0x63')],_0x3ddc33[_0xd557('0x104')],_0x3ddc33['url']]);if(_0x4b1c79['result']===-0x1){return _0x4b1c79;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xdc'),'DIAL'));};AGIVertices[_0xd557('0xe')][_0xd557('0x105')]=function(_0x498112){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x498112[_0xd557('0x35')]));return this['channel'][_0xd557('0xa6')](_0xd557('0x105'));};AGIVertices['prototype']['getdigits']=function(_0x2cfb02){logger[_0xd557('0x2b')](util['format'](_0xd557('0x106'),_0x2cfb02[_0xd557('0x35')]));if(_0x2cfb02['retry']===0x0){return this['maxRetry'](_0x2cfb02);}_0x2cfb02['retry']-=0x1;if(!this[_0xd557('0x82')](_0x2cfb02[_0xd557('0x107')])){return this[_0xd557('0xb')]['error'](_0x2cfb02,_0xd557('0x108'));}var _0x4c0236=this[_0xd557('0x1c')][_0xd557('0x6c')](this,_0x2cfb02[_0xd557('0x107')]);if(!_0x4c0236){return this['channel'][_0xd557('0x30')](_0x2cfb02,_0xd557('0x109'));}if(!this[_0xd557('0x82')](_0x2cfb02[_0xd557('0xd4')])){return this['channel'][_0xd557('0x30')](_0xd557('0xd3'));}var _0x187904=this[_0xd557('0xb')][_0xd557('0x10a')](_0x4c0236,_0x2cfb02[_0xd557('0x10b')],_0x2cfb02[_0xd557('0x10c')]);var _0x38f67b=_0x187904[_0xd557('0xa0')]?_0x187904[_0xd557('0xa0')][_0xd557('0x49')]():'';logger[_0xd557('0x2b')](_0xd557('0x10d'),JSON['stringify'](_0x187904));if(_0x187904['result']===-0x1){this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x2cfb02,_0x38f67b);return _0x187904;}else if(_0x187904[_0xd557('0x9e')]===_0xd557('0x63')){_0x187904['result']=_0x38f67b['length']>=parseInt(_0x2cfb02[_0xd557('0x10e')])?'x':'i';}else{_0x187904[_0xd557('0xa0')]=_0x38f67b[_0xd557('0x9a')]>=parseInt(_0x2cfb02[_0xd557('0x10e')])&&_0x38f67b[_0xd557('0x9a')]<=parseInt(_0x2cfb02['maxdigit'])?'x':'i';}var _0x3515c9=this['getVariable'][_0xd557('0x6c')](this,_0x2cfb02['variable_id']);if(!_0x3515c9){return this[_0xd557('0xb')][_0xd557('0x30')](_0x2cfb02,_0xd557('0x10f'));}this[_0xd557('0xb')][_0xd557('0xd7')](_0x3515c9,_0x38f67b);if(this['isConfigured'](_0x2cfb02[_0xd557('0x110')])){var _0x3fa966=parseInt(_0x2cfb02[_0xd557('0x110')],0xa);var _0x553c83=rs[_0xd557('0x111')]({'charset':'*','length':_0x3fa966});var _0x4782ea=_0x38f67b['length'];if(_0x4782ea>0x0){if(_0x4782ea>_0x3fa966){this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x2cfb02,_0x2cfb02[_0xd557('0x112')]===_0xd557('0x113')?_0x553c83+_0x38f67b[_0xd557('0x114')](_0x3fa966):_0x38f67b['substr'](0x0,_0x4782ea-_0x3fa966)+_0x553c83);}else{this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x2cfb02,rs[_0xd557('0x111')]({'charset':'*','length':_0x4782ea}));}}else{this[_0xd557('0xa3')]['sync'](this,_0x2cfb02,'');}}else{this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x2cfb02,_0x38f67b);}return _0x187904;};AGIVertices[_0xd557('0xe')][_0xd557('0x115')]=function(_0x2bf4c0){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2bf4c0[_0xd557('0x35')]));return this[_0xd557('0xa')](_0x2bf4c0);};AGIVertices['prototype'][_0xd557('0x116')]=function(_0x5accdf){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x117'),_0x5accdf[_0xd557('0x35')]));this[_0xd557('0xa3')]['sync'](this,_0x5accdf,_0x5accdf[_0xd557('0x118')]);return this[_0xd557('0xb')][_0xd557('0xa6')](util['format'](_0xd557('0x119'),_0x5accdf[_0xd557('0x118')]));};AGIVertices['prototype'][_0xd557('0x11a')]=function(_0x50990e){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x11b'),_0x50990e['label']));if(!this[_0xd557('0x82')](_0x50990e[_0xd557('0x85')])||!this[_0xd557('0x82')](_0x50990e[_0xd557('0x8b')])){return this[_0xd557('0xb')]['noop'](_0xd557('0x11c'));}if(!this[_0xd557('0x82')](_0x50990e[_0xd557('0x59')])){return this['channel'][_0xd557('0xa6')](_0xd557('0xa7'));}this[_0xd557('0xb')]['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x50990e['text']));var _0x3a03d7=this['awsPolly']['sync'](this,_0x50990e);if(_0x3a03d7){this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x11d'),_0x3a03d7));var _0x53ee43=this[_0xd557('0xb')]['streamFile'](_0x3a03d7);try{fs['unlink'](_0x3a03d7+_0xd557('0xfa'));}catch(_0x2cd865){logger[_0xd557('0x30')](_0x2cd865);}return _0x53ee43;}return this[_0xd557('0xb')][_0xd557('0x30')](_0x50990e,_0xd557('0x11e'));};AGIVertices['prototype']['awslex']=function(_0x422d8b){logger['info'](util[_0xd557('0x26')](_0xd557('0x11f'),_0x422d8b[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x422d8b[_0xd557('0x85')])||!this[_0xd557('0x82')](_0x422d8b[_0xd557('0x8b')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xd557('0x82')](_0x422d8b['aws_bot_name'])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x120'));}if(!this['isConfigured'](_0x422d8b['text'])){return this[_0xd557('0xb')]['noop'](_0xd557('0xa7'));}this['channel'][_0xd557('0xe1')]=!![];this[_0xd557('0xa3')](_0x422d8b);this[_0xd557('0x3f')](_0x422d8b[_0xd557('0x59')],'in','','');this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('Trying\x20Amazon\x20Lex:\x20%s',_0x422d8b[_0xd557('0x59')]));var _0x513780=this['awsLex'][_0xd557('0x6c')](this,_0x422d8b);if(_0x513780){for(var _0x2f5273 in _0x513780){if(_0x513780[_0xd557('0x98')](_0x2f5273)&&_[_0xd557('0x95')](_0x513780[_0x2f5273])){this[_0xd557('0xb')][_0xd557('0xd7')](util[_0xd557('0x26')]('AWS_LEX_%s',_0x2f5273['toUpperCase']()),_0x513780[_0x2f5273]);}}if(_['isNil'](_0x513780[_0xd557('0x72')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x121'));}else{this[_0xd557('0x3f')](_0x513780['message'],_0xd557('0xe5'),_0xd557('0x122'),'');return this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0x123'),_0x513780[_0xd557('0x72')]));}}return this['channel'][_0xd557('0x30')](_0x422d8b,_0xd557('0x124'));};AGIVertices['prototype'][_0xd557('0x125')]=function(_0x5df196){logger[_0xd557('0x2b')](util['format'](_0xd557('0x126'),_0x5df196[_0xd557('0x35')],_0x5df196[_0xd557('0x63')]));if(!this[_0xd557('0x82')](_0x5df196[_0xd557('0x76')])){return this['channel'][_0xd557('0xa6')]('no\x20key\x20configured');}var _0x5ae355=_0xd557('0x127');var _0x54c2f1=util[_0xd557('0x26')](_0xd557('0x128'),FILES_PATH,rs[_0xd557('0x111')](0x4));var _0xce1be4=util[_0xd557('0x26')](_0xd557('0x9b'),_0x54c2f1,_0x5ae355);var _0x4ae1ca=!![];if(_0x5df196[_0xd557('0x129')]===_0xd557('0x12a')){_0x4ae1ca=![];}var _0xbf4b94=this[_0xd557('0xb')][_0xd557('0x12b')](_0x54c2f1,_0x5ae355,_0x5df196[_0xd557('0x12c')],_0x5df196[_0xd557('0x63')],undefined,_0x4ae1ca);if(_0xbf4b94[_0xd557('0xa0')]!==-0x1){this['channel']['noop'](util[_0xd557('0x26')]('google\x20%s\x20file\x20created',_0xce1be4));var _0x33261c=this[_0xd557('0x8d')][_0xd557('0x6c')](this,_0x5df196,_0xce1be4);if(_0x33261c){for(var _0x2cad1f in _0x33261c){if(_0x33261c[_0xd557('0x98')](_0x2cad1f)){this['channel'][_0xd557('0xd7')](util['format'](_0xd557('0x12d'),_0x2cad1f[_0xd557('0x66')]()),_0x33261c[_0x2cad1f]);}}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x12e'),JSON[_0xd557('0x6e')](_0x33261c)));}}return _0xbf4b94;};AGIVertices[_0xd557('0xe')][_0xd557('0x12f')]=function(_0x2b934a){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x130'),_0x2b934a['label']));if(!this[_0xd557('0x82')](_0x2b934a[_0xd557('0x90')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x131'));}if(!this[_0xd557('0x82')](_0x2b934a['appsecret'])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x132'));}var _0x2de273=_0xd557('0x127');var _0x93556b=util[_0xd557('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xd557('0x111')](0x4));var _0x3404ab=util['format'](_0xd557('0x9b'),_0x93556b,_0x2de273);var _0x85d5aa=!![];if(_0x2b934a[_0xd557('0x129')]===_0xd557('0x12a')){_0x85d5aa=![];}var _0x44ec2c=this[_0xd557('0xb')][_0xd557('0x12b')](_0x93556b,_0x2de273,_0x2b934a['intKey'],_0x2b934a[_0xd557('0x63')],undefined,_0x85d5aa);if(_0x44ec2c[_0xd557('0xa0')]!==-0x1){this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0x133'),_0x3404ab));var _0x5daa21=this[_0xd557('0x8f')][_0xd557('0x6c')](this,_0x2b934a,_0x3404ab);if(_0x5daa21){for(var _0x185304 in _0x5daa21){if(_0x5daa21[_0xd557('0x98')](_0x185304)){this[_0xd557('0xb')][_0xd557('0xd7')](util[_0xd557('0x26')]('TILDE_ASR_%s',_0x185304['toUpperCase']()),_0x5daa21[_0x185304]);}}return this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x134'),JSON[_0xd557('0x6e')](_0x5daa21)));}}return _0x44ec2c;};AGIVertices['prototype']['gotoc']=function(_0x168c78){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x135'),_0x168c78[_0xd557('0x35')]));return this['channel']['continueAt'](_0x168c78[_0xd557('0x3b')],_0x168c78[_0xd557('0x3c')],_0x168c78[_0xd557('0x3d')]);};AGIVertices[_0xd557('0xe')]['gotoif']=function(_0xb4d504){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x136'),_0xb4d504[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0xb4d504['condition'])){return this[_0xd557('0xb')][_0xd557('0x30')](_0xb4d504,_0xd557('0x137'));}try{var _0x328567=eval(_0xb4d504[_0xd557('0x138')])?'true':'false';this[_0xd557('0xb')][_0xd557('0xa6')](util['format'](_0xd557('0x139'),_0xb4d504[_0xd557('0x138')],_0x328567));return{'code':0xc8,'result':_0x328567};}catch(_0x30b64c){return{'code':0xc8,'result':_0xd557('0x13a')};}};AGIVertices['prototype'][_0xd557('0x13b')]=function(_0x176bdc){logger[_0xd557('0x2b')](util['format'](_0xd557('0x13c'),_0x176bdc['label']));if(!this[_0xd557('0x82')](_0x176bdc[_0xd557('0x13d')])){return this[_0xd557('0xb')]['error'](_0x176bdc,_0xd557('0x13e'));}var _0x3e2c3e=this[_0xd557('0x21')][_0xd557('0x6c')](this,_0x176bdc[_0xd557('0x13d')]);if(!_0x3e2c3e){return this[_0xd557('0xb')][_0xd557('0x30')](_0x176bdc,_0xd557('0x13f'));}for(var _0x354465=0x0;_0x354465<_0x3e2c3e[_0xd557('0x9a')];_0x354465+=0x1){var _0x5e87a6=this[_0xd557('0xb')][_0xd557('0xf')](util[_0xd557('0x26')](_0xd557('0x140'),_0x3e2c3e[_0x354465]));if(_0x5e87a6[_0xd557('0xa0')]===-0x1){return _0x5e87a6;}logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x141'),_0x3e2c3e[_0x354465],_0x5e87a6[_0xd557('0x9e')]));if(_0x5e87a6[_0xd557('0x9e')]===_0xd557('0x142')){logger['info'](util[_0xd557('0x26')](_0xd557('0x141'),_0x3e2c3e[_0x354465],'true'));this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')](_0xd557('0x141'),_0x3e2c3e[_0x354465],'true'));return{'code':0xc8,'result':_0xd557('0x142')};}else{logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x141'),_0x3e2c3e[_0x354465],_0xd557('0x13a')));this['channel']['noop'](util[_0xd557('0x26')](_0xd557('0x141'),_0x3e2c3e[_0x354465],_0xd557('0x13a')));}}return{'code':0xc8,'result':_0xd557('0x13a')};};AGIVertices['prototype'][_0xd557('0x143')]=function(_0x58d3fc){logger['info'](util[_0xd557('0x26')](_0xd557('0x144'),_0x58d3fc[_0xd557('0x35')]));return this['channel']['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x41b7a6){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x145'),_0x41b7a6[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x41b7a6[_0xd557('0x76')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20key\x20configured');}var _0x2ff7be=_0xd557('0x127');var _0x3533ce=util[_0xd557('0x26')](_0xd557('0x128'),FILES_PATH,rs['generate'](0x4));var _0x5dfa29=util[_0xd557('0x26')]('%s.%s',_0x3533ce,_0x2ff7be);var _0x65955b=!![];if(_0x41b7a6['beep']===_0xd557('0x12a')){_0x65955b=![];}var _0x4523c1=this[_0xd557('0xb')][_0xd557('0x12b')](_0x3533ce,_0x2ff7be,_0x41b7a6[_0xd557('0x12c')],_0x41b7a6[_0xd557('0x63')],undefined,_0x65955b);if(_0x4523c1[_0xd557('0xa0')]!==-0x1){this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x146'),_0x5dfa29));var _0x319fb6=this[_0xd557('0x80')][_0xd557('0x6c')](this,_0x41b7a6,_0x5dfa29);if(_0x319fb6){for(var _0x39751a in _0x319fb6){if(_0x319fb6['hasOwnProperty'](_0x39751a)){this[_0xd557('0xb')][_0xd557('0xd7')](util['format'](_0xd557('0x147'),_0x39751a[_0xd557('0x66')]()),_0x319fb6[_0x39751a]);}}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x148'),JSON[_0xd557('0x6e')](_0x319fb6)));}}return _0x4523c1;};AGIVertices[_0xd557('0xe')][_0xd557('0x149')]=function(_0x3f319b){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x14a'),_0x3f319b[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x3f319b['key'])){return this[_0xd557('0xb')]['noop'](_0xd557('0xe0'));}if(!this['isConfigured'](_0x3f319b[_0xd557('0x59')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20text\x20configured');}this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x14b'),_0x3f319b[_0xd557('0x59')]));var _0x43a24f=this['ispeechTTS'][_0xd557('0x6c')](this,_0x3f319b);if(_0x43a24f){this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')]('ispeech\x20%s\x20file\x20created',_0x43a24f));var _0x295dbf=this[_0xd557('0xb')][_0xd557('0x14c')](_0x43a24f,_0x3f319b[_0xd557('0x12c')]);try{fs['unlink'](_0x43a24f+_0xd557('0xfa'));}catch(_0x44b62d){logger[_0xd557('0x30')](_0x44b62d);}return _0x295dbf;}return this[_0xd557('0xb')][_0xd557('0x30')](_0x3f319b,_0xd557('0x14d'));};AGIVertices[_0xd557('0xe')]['login']=function(_0x402054){logger['info'](util[_0xd557('0x26')](_0xd557('0x14e'),_0x402054[_0xd557('0x35')]));if(!this['isConfigured'](_0x402054[_0xd557('0x14f')])){return this['channel'][_0xd557('0x30')](_0x402054,_0xd557('0x150'));}logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x151'),this['channel'][_0xd557('0x37')],_0x402054[_0xd557('0x14f')]));var _0x58ec18=this[_0xd557('0x50')][_0xd557('0x6c')](this,_0x402054[_0xd557('0x14f')]);if(_0x58ec18){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x152'),this[_0xd557('0xb')]['callerid'],_0x402054['findBy']));this[_0xd557('0xb')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd557('0xb')][_0xd557('0x37')],_0x402054[_0xd557('0x14f')]));return{'code':0xc8,'result':_0xd557('0x153')};}else{logger[_0xd557('0x2b')](util['format'](_0xd557('0x154'),this['channel'][_0xd557('0x37')],_0x402054['findBy']));this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd557('0xb')][_0xd557('0x37')],_0x402054['findBy']));return{'code':0xc8,'result':_0xd557('0x155')};}};AGIVertices[_0xd557('0xe')][_0xd557('0x156')]=function(_0x238707){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x157'),_0x238707['label']));if(!this[_0xd557('0x82')](_0x238707['findBy'])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x238707,'no\x20find\x20by\x20configured');}logger[_0xd557('0x2b')](util['format'](_0xd557('0x151'),this[_0xd557('0xb')][_0xd557('0x37')],_0x238707[_0xd557('0x14f')]));var _0x4bec19=this[_0xd557('0x4f')]['sync'](this,_0x238707[_0xd557('0x14f')]);if(_0x4bec19){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x152'),this[_0xd557('0xb')][_0xd557('0x37')],_0x238707[_0xd557('0x14f')]));this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x238707[_0xd557('0x14f')]));return{'code':0xc8,'result':_0xd557('0x153')};}else{logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x154'),this['channel'][_0xd557('0x37')],_0x238707['findBy']));this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd557('0xb')][_0xd557('0x37')],_0x238707[_0xd557('0x14f')]));return{'code':0xc8,'result':_0xd557('0x155')};}};AGIVertices['prototype'][_0xd557('0x158')]=function(_0x5d8b0f){logger['info'](util['format'](_0xd557('0x159'),_0x5d8b0f['label']));if(!this[_0xd557('0x82')](_0x5d8b0f[_0xd557('0x15a')])){return this[_0xd557('0xb')]['error'](_0x5d8b0f,_0xd557('0x15b'));}this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('math\x20%s',_0x5d8b0f['operation']));var _0x468452=eval(_0x5d8b0f['operation']);if(!this['isConfigured'](_0x5d8b0f[_0xd557('0xd4')])){return this[_0xd557('0xb')]['noop'](_0xd557('0xd3'));}var _0x25261e=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x5d8b0f['variable_id']);if(!_0x25261e){return this[_0xd557('0xb')][_0xd557('0x30')](_0x5d8b0f,_0xd557('0x10f'));}if(_['isArray'](_0x468452)){var _0x1be57c=this;_0x468452[_0xd557('0xd5')](function(_0x2d9ca6,_0x1dfeaf){_0x1be57c[_0xd557('0xb')][_0xd557('0xd7')](util[_0xd557('0x26')]('%s[%s]',_0x25261e,_0x1dfeaf),_0x2d9ca6);});return this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x15c'),_0x25261e));}else{return this[_0xd557('0xb')]['setVariable'](_0x25261e,_0x468452);}};AGIVertices[_0xd557('0xe')][_0xd557('0x15d')]=function(_0x11074e){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x15e'),_0x11074e[_0xd557('0x35')]));if(_0x11074e[_0xd557('0xa4')]===0x0){return this[_0xd557('0xa2')](_0x11074e);}_0x11074e[_0xd557('0xa4')]-=0x1;if(!this[_0xd557('0x82')](_0x11074e[_0xd557('0x107')])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x11074e,'no\x20file\x20audio\x20selected');}var _0x100957=this[_0xd557('0x1c')]['sync'](this,_0x11074e['file_id']);if(!_0x100957){return this[_0xd557('0xb')][_0xd557('0x30')](_0x11074e,_0xd557('0x109'));}var _0x3a944f=this[_0xd557('0xb')][_0xd557('0x10a')](_0x100957,_0x11074e[_0xd557('0x10b')],_0x11074e['digit']);var _0x1805ef=_0x3a944f[_0xd557('0xa0')];if(_0x3a944f[_0xd557('0xa0')]===-0x1){this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x11074e,'-1');return _0x3a944f;}else if(_0x3a944f['extra']===_0xd557('0x63')){_0x3a944f['result']=_0x3a944f[_0xd557('0xa0')][_0xd557('0x9a')]>0x0?_0x3a944f['result']:'t';}else if(_[_0xd557('0x41')](_0x3a944f[_0xd557('0xa0')])){_0x3a944f[_0xd557('0xa0')]='#';_0x1805ef='#';}if(!this[_0xd557('0x82')](_0x11074e[_0xd557('0xd4')])){this['channel']['noop'](_0xd557('0xd3'));}else{var _0x585534=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x11074e['variable_id']);if(!_0x585534){return this['channel'][_0xd557('0x30')](_0x11074e,_0xd557('0x10f'));}this[_0xd557('0xb')][_0xd557('0xd7')](_0x585534,_0x1805ef);}this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x11074e,_0x1805ef);return _0x3a944f;};AGIVertices[_0xd557('0xe')]['noop']=function(_0x59bd6b){logger['info'](util[_0xd557('0x26')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x59bd6b['label']));return this[_0xd557('0xb')][_0xd557('0xa6')](_0x59bd6b[_0xd557('0x15f')]||_0x59bd6b[_0xd557('0x35')]);};AGIVertices[_0xd557('0xe')]['pause']=function(_0x4bff85){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x160'),_0x4bff85[_0xd557('0x35')]));if(!this['isConfigured'](_0x4bff85[_0xd557('0x14f')])){return this['channel']['error'](_0x4bff85,_0xd557('0x150'));}logger[_0xd557('0x2b')](util[_0xd557('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x4bff85[_0xd557('0x14f')]));var _0x454cc8=this[_0xd557('0x161')][_0xd557('0x6c')](this,_0x4bff85[_0xd557('0x162')]);var _0x29828b=this['agentPause'][_0xd557('0x6c')](this,_0x4bff85[_0xd557('0x14f')],_0x454cc8);if(_0x29828b){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x152'),this[_0xd557('0xb')]['callerid'],_0x4bff85[_0xd557('0x14f')]));this['channel'][_0xd557('0xa6')](util['format'](_0xd557('0x152'),this[_0xd557('0xb')][_0xd557('0x37')],_0x4bff85['findBy']));return{'code':0xc8,'result':_0xd557('0x153')};}else{logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x154'),this['channel']['callerid'],_0x4bff85[_0xd557('0x14f')]));this[_0xd557('0xb')]['noop'](util[_0xd557('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd557('0xb')][_0xd557('0x37')],_0x4bff85[_0xd557('0x14f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd557('0xe')]['playback']=function(_0x2bd250){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x163'),_0x2bd250['label']));if(!this[_0xd557('0x82')](_0x2bd250[_0xd557('0x107')])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x2bd250,'no\x20file\x20audio\x20selected');}var _0x5ce576=this[_0xd557('0x1c')][_0xd557('0x6c')](this,_0x2bd250[_0xd557('0x107')]);if(!_0x5ce576){return this[_0xd557('0xb')][_0xd557('0x30')](_0x2bd250,'no\x20file\x20audio\x20found');}var _0x729d57=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0x164'),[_0x5ce576,_0x2bd250['opts']]);if(_0x729d57[_0xd557('0xa0')]===-0x1){return _0x729d57;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xbd'),_0xd557('0x164'),_0x5ce576));};AGIVertices[_0xd557('0xe')][_0xd557('0x165')]=function(_0x4af945){logger[_0xd557('0x2b')](util['format'](_0xd557('0x166'),_0x4af945[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x4af945[_0xd557('0x167')])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x4af945,_0xd557('0x168'));}var _0x40503b='';var _0x23a3d3=parseInt(_0x4af945[_0xd557('0x167')],0xa);if(isNaN(_0x23a3d3)){_0x40503b=_0x4af945['queue_id'];}else{_0x40503b=this[_0xd557('0x14')]['sync'](this,_0x4af945[_0xd557('0x167')]);if(!_0x40503b){return this[_0xd557('0xb')][_0xd557('0x30')](_0x4af945,_0xd557('0x169'));}}var _0xe07879='';if(this['isConfigured'](_0x4af945[_0xd557('0x107')])){var _0x1bc799=this[_0xd557('0x1c')]['sync'](this,_0x4af945[_0xd557('0x107')]);if(_0x1bc799){_0xe07879=_0x1bc799;}}this[_0xd557('0xa3')]['sync'](this,_0x4af945,_0x40503b);if(_0x4af945[_0xd557('0x104')][_0xd557('0x16a')]('x')<0x0){_0x4af945[_0xd557('0x104')]+='x';}if(_0x4af945[_0xd557('0x104')][_0xd557('0x16a')]('X')<0x0){_0x4af945[_0xd557('0x104')]+='X';}this[_0xd557('0xb')][_0xd557('0xd7')](_0xd557('0x16b'),_0x40503b?_0x40503b[_0xd557('0x16c')]():'');var _0x6f3d52=this[_0xd557('0xb')][_0xd557('0x53')](_0xd557('0x16d'),[_0x40503b,_0x4af945[_0xd557('0x104')],_0x4af945[_0xd557('0x60')],_0xe07879,_0x4af945['timeout'],_0x4af945[_0xd557('0xb1')],_0x4af945[_0xd557('0x16e')],_0x4af945[_0xd557('0x16f')],'',_0x4af945[_0xd557('0x170')]]);if(_0x6f3d52['result']===-0x1){return _0x6f3d52;}return this['channel']['noop'](util['format'](_0xd557('0xbd'),_0xd557('0x16d'),_0x40503b));};AGIVertices[_0xd557('0xe')]['record']=function(_0x29d676){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x171'),_0x29d676[_0xd557('0x35')]));var _0x49b70f=_0x29d676[_0xd557('0x172')]||_0xd557('0x127');var _0x439a62=util[_0xd557('0x26')]('%s_%s',this[_0xd557('0xb')][_0xd557('0x39')],rs[_0xd557('0x111')](0x5));var _0x279b4e=util[_0xd557('0x26')]('%s/recordings/%s.%s',FILES_PATH,_0x439a62,_0x49b70f);var _0x19faa=util['format']('%s/recordings/%s',FILES_PATH,_0x439a62);this['createSquareRecording'][_0xd557('0x6c')](this,_0x29d676,_0x439a62,_0x279b4e);this[_0xd557('0xb')][_0xd557('0xd7')]('RECORDING_SAVENAME',_0x439a62);logger[_0xd557('0x2b')](_0xd557('0x173'),_0x19faa,_0x49b70f,_0x29d676[_0xd557('0x174')],_0x29d676[_0xd557('0x63')]);return this['channel'][_0xd557('0x12b')](_0x19faa,_0x49b70f,_0x29d676[_0xd557('0x174')],_0x29d676['timeout'],undefined,!![]);};AGIVertices[_0xd557('0xe')][_0xd557('0x175')]=function(_0x2c8145){logger['info'](util[_0xd557('0x26')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2c8145['label']));if(!this[_0xd557('0x82')](_0x2c8145[_0xd557('0x60')])){return this['channel']['noop'](_0xd557('0x176'));}var _0x582ac2=this[_0xd557('0x177')]['sync'](this,_0x2c8145);logger['info'](util[_0xd557('0x26')](_0xd557('0x178'),util[_0xd557('0x179')](_0x582ac2,{'showHidden':![],'depth':null})));if(!this[_0xd557('0x82')](_0x2c8145[_0xd557('0xd4')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x19ddfc=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x2c8145[_0xd557('0xd4')]);if(!_0x19ddfc){return this[_0xd557('0xb')][_0xd557('0x30')](_0x2c8145,_0xd557('0x10f'));}this['channel'][_0xd557('0xd7')](util[_0xd557('0x26')](_0xd557('0x17a'),_0x19ddfc),_0x582ac2[_0xd557('0x70')]?_0x582ac2[_0xd557('0x70')]:_0xd557('0x17b'));this[_0xd557('0xb')][_0xd557('0xd7')](util[_0xd557('0x26')](_0xd557('0x17c'),_0x19ddfc),_0x582ac2['statusMessage']?_0x582ac2['statusMessage']:'OK');if(_0x582ac2[_0xd557('0x67')]){try{this['saveRestApiResult'](_0x582ac2[_0xd557('0x67')],_0x19ddfc);}catch(_0x574f6b){logger['error'](util[_0xd557('0x26')](_0xd557('0x17d'),_0x19ddfc));}}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('variable\x20%s\x20set',_0x19ddfc));};AGIVertices[_0xd557('0xe')]['saydigits']=function(_0x4eeeb2){logger[_0xd557('0x2b')](util['format'](_0xd557('0x17e'),_0x4eeeb2[_0xd557('0x35')]));return this[_0xd557('0xb')][_0xd557('0x17f')](_0x4eeeb2[_0xd557('0x180')][_0xd557('0x55')](/\s+/g,''),_0x4eeeb2[_0xd557('0x174')]);};AGIVertices['prototype']['saynumber']=function(_0x3c8122){logger['info'](util[_0xd557('0x26')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3c8122['label']));return this[_0xd557('0xb')]['sayNumber'](_0x3c8122[_0xd557('0x62')]['replace'](/\s+/g,''),_0x3c8122[_0xd557('0x174')]);};AGIVertices[_0xd557('0xe')]['sayphonetic']=function(_0x475b1e){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x475b1e[_0xd557('0x35')]));return this[_0xd557('0xb')][_0xd557('0x181')](_0x475b1e[_0xd557('0x59')],_0x475b1e[_0xd557('0x174')]);};AGIVertices[_0xd557('0xe')][_0xd557('0x182')]=function(_0x9cc853){logger['info'](util[_0xd557('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x9cc853[_0xd557('0x35')]));if(!this['isConfigured'](_0x9cc853[_0xd557('0x183')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x184'));}var _0x38858f=this[_0xd557('0x185')][_0xd557('0x6c')](this,_0x9cc853[_0xd557('0x183')]);if(!_0x38858f||!_0x38858f[_0xd557('0x186')]){return this[_0xd557('0xb')][_0xd557('0x30')](_0x9cc853,'no\x20mail\x20account\x20found');}var _0x15a080={'from':util[_0xd557('0x26')](_0xd557('0x187'),_0x38858f[_0xd557('0x12')],_0x38858f[_0xd557('0x188')]||_0x38858f[_0xd557('0x186')][_0xd557('0x189')]),'to':_0x9cc853['to']||'','cc':_0x9cc853['cc']||'','bcc':_0x9cc853[_0xd557('0x18a')]||'','subject':_0x9cc853[_0xd557('0x18b')],'html':_0x9cc853[_0xd557('0x59')],'text':_0x9cc853[_0xd557('0x59')]};if(this[_0xd557('0x82')](_0x9cc853[_0xd557('0x18c')])){}logger[_0xd557('0x18d')]('sendMail\x20message',JSON[_0xd557('0x6e')](_0x15a080));this['createSquareDetailsReport'][_0xd557('0x6c')](this,_0x9cc853,_0x9cc853[_0xd557('0x183')]);this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x38858f['name']));this[_0xd557('0x20')][_0xd557('0x6c')](this,_0x38858f['smtpOptions'],_0x15a080);return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x18e'));};AGIVertices['prototype']['sendFax']=function(_0x4f6f99){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x18f'),_0x4f6f99['label']));return this['channel']['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xd557('0xe')][_0xd557('0x190')]=function(_0x5f01c3){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5f01c3[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x5f01c3['sms_account_id'])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x191'));}var _0x4c36ac=this[_0xd557('0x32')][_0xd557('0x6c')](this,_0x5f01c3[_0xd557('0x192')]);if(!_0x4c36ac){return this['channel'][_0xd557('0x30')](_0x5f01c3,_0xd557('0x193'));}var _0x96cf30={'body':_0x5f01c3[_0xd557('0x194')],'phone':_0x5f01c3['to']||'','SmsAccountId':_0x4c36ac['id']};logger[_0xd557('0x18d')](_0xd557('0x195'),JSON[_0xd557('0x6e')](_0x96cf30));this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x5f01c3,_0x5f01c3['sms_account_id']);this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x196'),_0x4c36ac[_0xd557('0x12')]));this[_0xd557('0x34')][_0xd557('0x6c')](this,_0x96cf30);return this[_0xd557('0xb')]['noop'](_0xd557('0x197'));};AGIVertices[_0xd557('0xe')][_0xd557('0x198')]=function(_0xeb629f){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x199'),_0xeb629f[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0xeb629f[_0xd557('0xd4')])){return this['channel'][_0xd557('0x30')](_0xeb629f,'no\x20variable\x20selected');}var _0x3cf10b=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0xeb629f[_0xd557('0xd4')]);if(!_0x3cf10b){return this['channel'][_0xd557('0x30')](_0xeb629f,_0xd557('0x10f'));}return this[_0xd557('0xb')][_0xd557('0xd7')](_0x3cf10b,_0xeb629f[_0xd557('0x19a')]);};AGIVertices[_0xd557('0xe')][_0xd557('0x19b')]=function(_0x501091){logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x19c'),_0x501091[_0xd557('0x35')]));this[_0xd557('0xb')][_0xd557('0xa6')]('START\x20CALLY\x20SQUARE');if(_0x501091[_0xd557('0xb4')]==='yes'){this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0x19d'));return this[_0xd557('0xb')][_0xd557('0xb4')]();}return this['channel'][_0xd557('0xa6')](_0xd557('0x19e'));};AGIVertices[_0xd557('0xe')]['subproject']=function(_0x5e3e11){logger[_0xd557('0x2b')](util['format'](_0xd557('0x19f'),_0x5e3e11[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x5e3e11[_0xd557('0x1a0')])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x5e3e11,_0xd557('0x1a1'));}var _0x4281d6=this[_0xd557('0x16')][_0xd557('0x6c')](this,_0x5e3e11[_0xd557('0x1a0')]);if(!this[_0xd557('0x82')](_0x4281d6)){return this[_0xd557('0xb')][_0xd557('0x30')](_0x5e3e11,util[_0xd557('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5e3e11['project_id']));}if(_0x4281d6===this['channel'][_0xd557('0x36')]){return this['channel'][_0xd557('0x30')](_0x5e3e11,_0xd557('0x1a2'));}this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x5e3e11,_0x4281d6);var _0x462b6c=this['channel']['exec'](_0xd557('0x1a3'),util[_0xd557('0x26')](_0xd557('0x1a4'),config[_0xd557('0xb1')]['host']||_0xd557('0x1a5'),_0x4281d6,this[_0xd557('0xb')][_0xd557('0x36')]));if(_0x462b6c[_0xd557('0xa0')]===-0x1){return _0x462b6c;}return this[_0xd557('0xb')][_0xd557('0xa6')](util['format']('Executed\x20command\x20%s\x20%s',_0xd557('0x1a3'),_0x4281d6));};AGIVertices[_0xd557('0xe')][_0xd557('0x1a6')]=function(_0x36b28d){logger['info'](util[_0xd557('0x26')](_0xd557('0x1a7'),_0x36b28d[_0xd557('0x35')]));var _0x3e735a=this[_0xd557('0x1a8')]['sync'](this,_0x36b28d[_0xd557('0xb2')]);this[_0xd557('0xa3')][_0xd557('0x6c')](this,_0x36b28d,_0x36b28d['command']);if(this[_0xd557('0x82')](_0x36b28d[_0xd557('0xd4')])){var _0x20b2ce=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x36b28d[_0xd557('0xd4')]);if(_0x20b2ce){this[_0xd557('0xb')][_0xd557('0xd7')](_0x20b2ce,_0x3e735a);return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x36b28d['command'],_0x20b2ce));}}return this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x1a9'),_0x36b28d[_0xd557('0xb2')]));};AGIVertices[_0xd557('0xe')]['google_cloud_tts']=function(_0x26e7eb){logger['info'](util[_0xd557('0x26')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x26e7eb[_0xd557('0x35')]));_0x26e7eb['text']=_0x26e7eb[_0xd557('0x59')][_0xd557('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd557('0x82')](_0x26e7eb[_0xd557('0x57')])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20apiKey\x20configured');}if(!this[_0xd557('0x82')](_0x26e7eb['text'])){return this[_0xd557('0xb')][_0xd557('0xa6')]('no\x20text\x20configured');}this['channel'][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x1aa'),_0x26e7eb['text']));var _0x3edc6d=this[_0xd557('0x56')]['sync'](this,_0x26e7eb);if(_0x3edc6d){this[_0xd557('0xb')]['noop'](util['format'](_0xd557('0x1ab'),_0x3edc6d));var _0x1d28ff=this['channel'][_0xd557('0x14c')](_0x3edc6d);try{fs[_0xd557('0xf9')](_0x3edc6d+_0xd557('0xfa'));}catch(_0x2ced51){logger['error'](_0x2ced51);}return _0x1d28ff;}return this['channel'][_0xd557('0x30')](_0x26e7eb,_0xd557('0x1ac'));};AGIVertices[_0xd557('0xe')][_0xd557('0x1ad')]=function(_0x2c8de5){logger[_0xd557('0x2b')](util['format'](_0xd557('0x1ae'),_0x2c8de5['label']));_0x2c8de5[_0xd557('0x59')]=_0x2c8de5['text'][_0xd557('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd557('0x82')](_0x2c8de5[_0xd557('0x59')])){return this[_0xd557('0xb')][_0xd557('0xa6')](_0xd557('0xa7'));}this[_0xd557('0xb')]['noop'](util['format'](_0xd557('0x1af'),_0x2c8de5[_0xd557('0x59')]));var _0x1d1251=this[_0xd557('0x5f')]['sync'](this,_0x2c8de5);if(_0x1d1251){this[_0xd557('0xb')]['noop'](util['format'](_0xd557('0x1b0'),_0x1d1251));var _0x1f427f=this['channel']['streamFile'](_0x1d1251);try{fs[_0xd557('0xf9')](_0x1d1251+_0xd557('0xfa'));}catch(_0x397dbb){logger[_0xd557('0x30')](_0x397dbb);}return _0x1f427f;}return this[_0xd557('0xb')][_0xd557('0x30')](_0x2c8de5,_0xd557('0x1b1'));};AGIVertices[_0xd557('0xe')]['unpause']=function(_0x488ea3){logger[_0xd557('0x2b')](util['format'](_0xd557('0x1b2'),_0x488ea3['label']));if(!this[_0xd557('0x82')](_0x488ea3['findBy'])){return this[_0xd557('0xb')][_0xd557('0x30')](_0x488ea3,_0xd557('0x150'));}logger['info'](util['format'](_0xd557('0x151'),this[_0xd557('0xb')][_0xd557('0x37')],_0x488ea3[_0xd557('0x14f')]));var _0x3bfd92=this['agentUnpause'][_0xd557('0x6c')](this,_0x488ea3[_0xd557('0x14f')]);if(_0x3bfd92){logger['info'](util[_0xd557('0x26')](_0xd557('0x152'),this['channel'][_0xd557('0x37')],_0x488ea3[_0xd557('0x14f')]));this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x152'),this['channel'][_0xd557('0x37')],_0x488ea3['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xd557('0x2b')](util[_0xd557('0x26')](_0xd557('0x154'),this[_0xd557('0xb')][_0xd557('0x37')],_0x488ea3[_0xd557('0x14f')]));this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0x154'),this[_0xd557('0xb')][_0xd557('0x37')],_0x488ea3[_0xd557('0x14f')]));return{'code':0xc8,'result':_0xd557('0x155')};}};AGIVertices[_0xd557('0xe')][_0xd557('0x1b3')]=function(_0x1c6c01){logger['info'](util[_0xd557('0x26')](_0xd557('0x1b4'),_0x1c6c01[_0xd557('0x35')]));var _0x1fb81d=this['channel'][_0xd557('0x53')](_0xd557('0x1b5'),[_0x1c6c01['mailbox'],_0x1c6c01['options']]);if(_0x1fb81d[_0xd557('0xa0')]===-0x1){return _0x1fb81d;}return this[_0xd557('0xb')][_0xd557('0xa6')](util[_0xd557('0x26')](_0xd557('0xbd'),'VOICEMAIL',_0x1c6c01[_0xd557('0x1b6')]));};AGIVertices[_0xd557('0xe')][_0xd557('0x1b7')]=function(_0x2422eb){logger[_0xd557('0x2b')](util[_0xd557('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2422eb[_0xd557('0x35')]));if(!this[_0xd557('0x82')](_0x2422eb['variable_id'])){return this[_0xd557('0xb')]['error'](_0x2422eb,'no\x20variable\x20selected');}var _0x4de515=this[_0xd557('0xf')][_0xd557('0x6c')](this,_0x2422eb['variable_id']);if(!_0x4de515){return this['channel']['error'](_0x2422eb,'no\x20variable\x20found');}var _0x4f7110=this[_0xd557('0xb')]['getVariable'](_0x4de515);return{'code':0xc8,'result':_0x4f7110[_0xd557('0x9e')]?_0x4f7110[_0xd557('0x9e')]:'-'};};String[_0xd557('0xe')][_0xd557('0x1b8')]=function(_0x412def,_0x5c1e02){return this[_0xd557('0x9d')](_0x412def)[_0xd557('0x1b9')](_0x5c1e02);};module[_0xd557('0x1ba')]=AGIVertices; \ No newline at end of file +var _0x9c32=['restAPI','url','method','timeout','number','includes','PUT','toUpperCase','body','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','parse','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','no\x20key\x20configured','bot','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','variable_id','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','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','logout','math','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','failure','playback','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','email','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','host','AGI','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','request-promise','../../config/logger','../../config/environment','./scripts','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','isNil','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9c32,0x15d));var _0x29c3=function(_0x375a67,_0x3e678a){_0x375a67=_0x375a67-0x0;var _0x1138ab=_0x9c32[_0x375a67];return _0x1138ab;};'use strict';var fs=require('fs');var util=require(_0x29c3('0x0'));var _=require(_0x29c3('0x1'));var sh=require(_0x29c3('0x2'));var odbc=require('odbc')();var rs=require(_0x29c3('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x29c3('0x4'));var logger=require(_0x29c3('0x5'))('agi');var config=require(_0x29c3('0x6'));var shared=require('../../config/environment/shared');var scripts=require(_0x29c3('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x29c3('0x8')];var verticesWithRetry=[_0x29c3('0x9'),_0x29c3('0xa'),'getsecretdigits'];var AGIVertices=function(_0x4fdba0,_0x480f7b,_0x1e9797){this[_0x29c3('0xb')]=_0x4fdba0;this[_0x29c3('0xc')]=_0x480f7b;this[_0x29c3('0xd')]=_0x1e9797;};AGIVertices[_0x29c3('0xe')][_0x29c3('0xf')]=function(_0xb8345f,_0xa666cf){this[_0x29c3('0xc')][_0x29c3('0x10')](_0xb8345f)['then'](function(_0x3dfaa5){_0xa666cf(null,_0x3dfaa5?_0x3dfaa5[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x17eaae){_0xa666cf(_0x17eaae);});};AGIVertices[_0x29c3('0xe')]['getVoiceQueue']=function(_0x5c0e60,_0x49453d){this[_0x29c3('0xc')]['getVoiceQueueById'](_0x5c0e60)[_0x29c3('0x13')](function(_0x2312a9){_0x49453d(null,_0x2312a9?_0x2312a9[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x4314a){_0x49453d(_0x4314a);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x14')]=function(_0x46bf7e,_0x15d85b){this['rpc'][_0x29c3('0x15')](_0x46bf7e)[_0x29c3('0x13')](function(_0x5570dd){_0x15d85b(null,_0x5570dd?_0x5570dd[_0x29c3('0x11')]:![]);})['catch'](function(_0x23e4ce){_0x15d85b(_0x23e4ce);});};AGIVertices['prototype'][_0x29c3('0x16')]=function(_0x1a5ae6,_0x5937aa){this[_0x29c3('0xc')][_0x29c3('0x17')](_0x1a5ae6)[_0x29c3('0x13')](function(_0x2bbe49){_0x5937aa(null,_0x2bbe49?_0x2bbe49['dsn']:![]);})[_0x29c3('0x12')](function(_0x5843da){_0x5937aa(_0x5843da);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x18')]=function(_0x25ae6a,_0x1e4ae9){this['rpc']['getUserById'](_0x25ae6a)[_0x29c3('0x13')](function(_0x220059){_0x1e4ae9(null,_0x220059?_0x220059[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x4016ff){_0x1e4ae9(_0x4016ff);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x19')]=function(_0x4d048f,_0xbb6330){this[_0x29c3('0xc')]['getTrunkById'](_0x4d048f)['then'](function(_0x53cf8b){_0xbb6330(null,_0x53cf8b?_0x53cf8b['name']:![]);})[_0x29c3('0x12')](function(_0x2d7905){_0xbb6330(_0x2d7905);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1a')]=function(_0x2736c9,_0x25fed2){var _0x471e2b=this;this[_0x29c3('0xc')][_0x29c3('0x1b')](_0x2736c9)[_0x29c3('0x13')](function(_0x2c02cc){_0x25fed2(null,_0x2c02cc?_0x471e2b['getSoundPath'](_0x2c02cc['save_name']):![]);})[_0x29c3('0x12')](function(_0x4a425a){_0x25fed2(_0x4a425a);});};AGIVertices[_0x29c3('0xe')]['getMailAccount']=function(_0x277d7c,_0x4baad6){this[_0x29c3('0xc')][_0x29c3('0x1c')](_0x277d7c)[_0x29c3('0x13')](function(_0x3e0ef4){_0x4baad6(null,_0x3e0ef4?_0x3e0ef4:![]);})[_0x29c3('0x12')](function(_0x169fe0){_0x4baad6(_0x169fe0);});};AGIVertices[_0x29c3('0xe')]['sendMailMessage']=function(_0x3a94c1,_0x3a26e6,_0x5cd6fc){this['mailRpc'][_0x29c3('0x1d')](_0x3a94c1,_0x3a26e6)[_0x29c3('0x13')](function(){_0x5cd6fc(null);})[_0x29c3('0x12')](function(_0x5d460b){_0x5cd6fc(_0x5d460b);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1e')]=function(_0x5e61e7,_0x3c73cf){this[_0x29c3('0xc')]['getIntervalById'](_0x5e61e7)[_0x29c3('0x13')](function(_0x4eea80){if(_0x4eea80){if(_0x4eea80['IntervalId']){_0x3c73cf(null,[_0x4eea80[_0x29c3('0x1f')]]);}else{_0x3c73cf(null,_[_0x29c3('0x20')](_0x4eea80[_0x29c3('0x21')],_0x29c3('0x1f')));}}else{_0x3c73cf(null,![]);}})[_0x29c3('0x12')](function(_0x48adc5){_0x3c73cf(_0x48adc5);});};AGIVertices['prototype']['getSoundPath']=function(_0xbd8816){return util[_0x29c3('0x22')]('%s/sounds/converted/%s',FILES_PATH,_0xbd8816);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x23')]=function(_0x4af7c0,_0x455ce8,_0x37c2bc){odbc[_0x29c3('0x24')](_0x4af7c0,function(_0x770918){if(_0x770918){logger[_0x29c3('0x25')](_0x29c3('0x26'),_0x770918);_0x37c2bc(_0x770918);}else{logger[_0x29c3('0x27')](_0x29c3('0x28'));odbc[_0x29c3('0x29')](_0x455ce8,function(_0x1b272e,_0x1ae855){if(_0x1b272e){logger[_0x29c3('0x27')](_0x29c3('0x2a'),_0x455ce8);_0x37c2bc(_0x1b272e);}else{logger[_0x29c3('0x27')](_0x29c3('0x2b'),_0x455ce8);odbc['close'](function(_0x5886f6){if(_0x5886f6){logger['error'](_0x29c3('0x2c'),_0x5886f6);}_0x37c2bc(null,_0x1ae855);});}});}});};AGIVertices[_0x29c3('0xe')]['getSmsAccount']=function(_0x4b9633,_0xff5466){this[_0x29c3('0xc')]['getSmsAccountById'](_0x4b9633)['then'](function(_0x19388a){_0xff5466(null,_0x19388a?_0x19388a:![]);})[_0x29c3('0x12')](function(_0x43beb4){_0xff5466(_0x43beb4);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x2d')]=function(_0x480397,_0x48330b){this[_0x29c3('0xc')]['createSmsMessage'](_0x480397)[_0x29c3('0x13')](function(_0x255ec5){_0x48330b(null,_0x255ec5);})[_0x29c3('0x12')](function(_0x117976){_0x48330b(_0x117976);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x2e')]=function(_0x482ee1,_0x1c7422,_0x4c2687){this[_0x29c3('0xc')][_0x29c3('0x2e')]({'uniqueid':this[_0x29c3('0xb')]['uniqueid'],'node':_0x482ee1[_0x29c3('0x2f')],'application':_0x482ee1[_0x29c3('0x30')],'data':_0x1c7422||null,'project_name':this[_0x29c3('0xb')]['arg_1'],'callerid':this[_0x29c3('0xb')][_0x29c3('0x31')]})['then'](function(_0x5b3b40){if(_0x4c2687){_0x4c2687(null,_0x5b3b40);}})[_0x29c3('0x12')](function(_0x49764b){if(_0x4c2687){_0x4c2687(_0x49764b);}});};AGIVertices[_0x29c3('0xe')]['createSquareRecording']=function(_0xe306de,_0x374ea1,_0x2a674a,_0x2d1084){this[_0x29c3('0xc')][_0x29c3('0x32')]({'uniqueid':this[_0x29c3('0xb')][_0x29c3('0x33')],'callerid':this[_0x29c3('0xb')][_0x29c3('0x31')],'calleridname':this[_0x29c3('0xb')][_0x29c3('0x34')],'context':this[_0x29c3('0xb')][_0x29c3('0x35')],'extension':this[_0x29c3('0xb')][_0x29c3('0x36')],'priority':this['channel'][_0x29c3('0x37')],'accountcode':this[_0x29c3('0xb')][_0x29c3('0x38')],'dnid':this[_0x29c3('0xb')][_0x29c3('0x39')],'projectName':this[_0x29c3('0xb')][_0x29c3('0x3a')],'saveName':_0x374ea1,'filename':_0xe306de[_0x29c3('0x3b')]||_0x374ea1,'savePath':_0x2a674a})[_0x29c3('0x13')](function(_0x5a145e){_0x2d1084(null,_0x5a145e);})[_0x29c3('0x12')](function(_0x567ee0){_0x2d1084(_0x567ee0);});};AGIVertices['prototype'][_0x29c3('0x3c')]=function(_0x28d09f,_0x3f98ae,_0x42604e,_0x5cd3d7,_0x4ce964){this[_0x29c3('0xc')][_0x29c3('0x3c')]({'uniqueid':this[_0x29c3('0xb')][_0x29c3('0x33')],'body':_0x28d09f,'direction':_0x3f98ae,'providerName':_0x42604e,'providerResponse':_0x5cd3d7})[_0x29c3('0x13')](function(_0x21da22){if(_0x4ce964){_0x4ce964(null,_0x21da22);}})[_0x29c3('0x12')](function(_0x4d7b9f){if(_0x4ce964){_0x4ce964(_0x4d7b9f);}});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x3d')]=function(_0x12c2a7,_0xa3edd0){this[_0x29c3('0xc')][_0x29c3('0x3d')]({'firstName':_[_0x29c3('0x3e')](_0x12c2a7[_0x29c3('0x11')])||_['isNil'](_0x12c2a7['name'])?_0x29c3('0x3f')+Math['random']():_0x12c2a7[_0x29c3('0x11')],'lastName':_['isEmpty'](_0x12c2a7[_0x29c3('0x40')])||_[_0x29c3('0x41')](_0x12c2a7['lastName'])?null:_0x12c2a7[_0x29c3('0x40')],'phone':_0x12c2a7[_0x29c3('0x42')],'ListId':_0x12c2a7[_0x29c3('0x43')],'scheduledat':_0x12c2a7[_0x29c3('0x44')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x29c3('0x45'),'description':'Callback\x20scheduled\x20at\x20'+_0x12c2a7['scheduledAt']['toString'](),'priority':_0x12c2a7[_0x29c3('0x46')]})[_0x29c3('0x13')](function(_0x1258cc){_0xa3edd0(null,_0x1258cc);})['catch'](function(_0x42f988){_0xa3edd0(_0x42f988);});};AGIVertices['prototype'][_0x29c3('0x47')]=function(_0x1db157,_0x551d06){this['rpc'][_0x29c3('0x48')](_0x1db157)[_0x29c3('0x13')](function(_0x21f91b){_0x551d06(null,_0x21f91b?_0x21f91b[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x1b9b25){_0x551d06(_0x1b9b25);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x49')]=function(_0x599f68,_0x2b1017,_0x288218){var _0x4430a6={'role':_0x29c3('0x4a')};_0x4430a6[_0x599f68]=this[_0x29c3('0xb')]['callerid'];this['rpc'][_0x29c3('0x49')](_0x4430a6,_0x2b1017,this[_0x29c3('0xb')][_0x29c3('0x33')])[_0x29c3('0x13')](function(_0x5dca32){_0x288218(null,_[_0x29c3('0x41')](_0x5dca32)?![]:!![]);})[_0x29c3('0x12')](function(_0x5fb069){logger[_0x29c3('0x25')](_0x5fb069);_0x288218(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4b')]=function(_0x4536df,_0x15c4a6){var _0x14c82b={'role':'agent'};_0x14c82b[_0x4536df]=this['channel'][_0x29c3('0x31')];this[_0x29c3('0xc')][_0x29c3('0x4b')](_0x14c82b)['then'](function(_0x3a7331){_0x15c4a6(null,_['isNil'](_0x3a7331)?![]:!![]);})[_0x29c3('0x12')](function(_0xec1004){logger[_0x29c3('0x25')](_0xec1004);_0x15c4a6(null,![]);});};AGIVertices[_0x29c3('0xe')]['agentLogout']=function(_0x92e5ea,_0x5e9553){var _0x452093={'role':'agent'};_0x452093[_0x92e5ea]=this[_0x29c3('0xb')][_0x29c3('0x31')];this[_0x29c3('0xc')]['agentLogout'](_0x452093)[_0x29c3('0x13')](function(_0x407020){_0x5e9553(null,_[_0x29c3('0x41')](_0x407020)?![]:!![]);})['catch'](function(_0x4d8913){logger[_0x29c3('0x25')](_0x4d8913);_0x5e9553(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4c')]=function(_0x4b2745,_0x3c9df5){var _0x41a811={'role':'agent'};_0x41a811[_0x4b2745]=this[_0x29c3('0xb')][_0x29c3('0x31')];var _0x263a36=_0x4b2745!=_0x29c3('0x4d')?util['format']('%s/%s@from-sip/n',_0x29c3('0x4e'),this[_0x29c3('0xb')][_0x29c3('0x31')]):undefined;this[_0x29c3('0xc')]['agentLogin'](_0x41a811,_0x263a36)['then'](function(_0x3d082a){_0x3c9df5(null,_[_0x29c3('0x41')](_0x3d082a)?![]:!![]);})[_0x29c3('0x12')](function(_0x5469a8){logger[_0x29c3('0x25')](_0x5469a8);_0x3c9df5(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4f')]=function(_0x292828,_0x5067f3){sh[_0x29c3('0x50')](_[_0x29c3('0x51')](_0x292828),function(_0x4549d3,_0x14ed4f){var _0x4a8ff0=_0x14ed4f[_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'');_0x5067f3(null,_0x4a8ff0);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x53')]=function(_0x51e777,_0x115a5a){scripts[_0x29c3('0x53')](_0x51e777['apiKey'],_0x51e777['google_cloud_tts_text_type']||_0x29c3('0x54'),_0x51e777[_0x29c3('0x54')],_0x51e777[_0x29c3('0x55')]||_0x29c3('0x56'),_0x51e777[_0x29c3('0x57')]||'MALE',_0x51e777[_0x29c3('0x58')]||_0x29c3('0x59'))[_0x29c3('0x13')](function(_0x4d035e){_0x115a5a(null,_0x4d035e);})[_0x29c3('0x12')](function(_0x2567ea){_0x115a5a(_0x2567ea);});};AGIVertices[_0x29c3('0xe')]['googleTTS']=function(_0x39b27e,_0x5cd506){scripts[_0x29c3('0x5a')](_0x39b27e[_0x29c3('0x54')],_0x39b27e[_0x29c3('0x5b')]||'en',0x1)[_0x29c3('0x13')](function(_0x2d1e91){_0x5cd506(null,_0x2d1e91);})[_0x29c3('0x12')](function(_0x1a42bf){_0x5cd506(_0x1a42bf);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x5c')]=function(_0x48e334,_0x1085fb){var _0x5f4817={'uri':_0x48e334[_0x29c3('0x5d')],'method':_0x48e334[_0x29c3('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x48e334[_0x29c3('0x5f')])===_0x29c3('0x60')&&parseInt(_0x48e334['timeout'])>=0x1?parseInt(_0x48e334['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x29c3('0x61')](['POST',_0x29c3('0x62')],_0x5f4817[_0x29c3('0x5e')][_0x29c3('0x63')]())){try{_0x5f4817[_0x29c3('0x64')]=_0x48e334[_0x29c3('0x8')]?JSON['parse'](_0x48e334[_0x29c3('0x8')]):{};}catch(_0x19ce50){logger[_0x29c3('0x25')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x19ce50);}}try{_0x5f4817[_0x29c3('0x65')]=_0x48e334[_0x29c3('0x66')]?JSON['parse'](_0x48e334[_0x29c3('0x66')]):{};}catch(_0xb83961){logger[_0x29c3('0x25')](_0x29c3('0x67'),_0xb83961);}if(_0x48e334[_0x29c3('0x68')]){try{var _0x36a1f3=require(_0x48e334['computedVariables'])[_0x29c3('0x69')](this,_0x5f4817);_0x5f4817[_0x29c3('0x6a')]=Mustache['render'](_0x48e334[_0x29c3('0x5d')],_0x36a1f3,{},['$$','$$']);if(_0x5f4817[_0x29c3('0x65')]){_0x5f4817[_0x29c3('0x65')]=JSON[_0x29c3('0x6b')](Mustache[_0x29c3('0x6c')](JSON[_0x29c3('0x6d')](_0x5f4817[_0x29c3('0x65')]),_0x36a1f3,{},['$$','$$']));}if(_0x5f4817[_0x29c3('0x64')]){_0x5f4817[_0x29c3('0x64')]=JSON[_0x29c3('0x6b')](Mustache[_0x29c3('0x6c')](JSON[_0x29c3('0x6d')](_0x5f4817[_0x29c3('0x64')]),_0x36a1f3,{},['$$','$$']));}}catch(_0x3b3610){logger[_0x29c3('0x25')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3b3610);}}rp(_0x5f4817)[_0x29c3('0x13')](function(_0x3a5817){var _0x29318f={'statusCode':_0x3a5817[_0x29c3('0x6e')]||0xc8,'statusMessage':_0x3a5817[_0x29c3('0x6f')]||'OK','headers':_0x3a5817[_0x29c3('0x65')]||{},'body':_0x3a5817[_0x29c3('0x64')]||{}};_0x1085fb(null,_0x29318f);})[_0x29c3('0x12')](function(_0x11a7fa){var _0x2feb2d={'statusCode':_0x11a7fa[_0x29c3('0x6e')]||0x1f4,'statusMessage':_0x11a7fa[_0x29c3('0x70')]||_0x29c3('0x71'),'headers':_0x11a7fa[_0x29c3('0x72')][_0x29c3('0x65')]||{},'body':_0x11a7fa[_0x29c3('0x72')]['body']||{}};_0x1085fb(null,_0x2feb2d);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x73')]=function(_0x42923e,_0x32cdd0){scripts[_0x29c3('0x73')](this[_0x29c3('0xb')][_0x29c3('0x33')],_0x42923e[_0x29c3('0x74')],_0x42923e[_0x29c3('0x54')],_0x42923e[_0x29c3('0x75')]||'en')[_0x29c3('0x13')](function(_0x20fc3c){_0x32cdd0(null,_0x20fc3c);})[_0x29c3('0x12')](function(_0xe3ee56){_0x32cdd0(_0xe3ee56);});};AGIVertices['prototype'][_0x29c3('0x76')]=function(_0x18611c,_0x406f92){scripts[_0x29c3('0x76')](this['channel'][_0x29c3('0x33')],_0x18611c[_0x29c3('0x77')],_0x18611c[_0x29c3('0x78')],_0x18611c['private_key'],_0x18611c['text'],_0x18611c[_0x29c3('0x79')]||'en')[_0x29c3('0x13')](function(_0x21d243){_0x406f92(null,_0x21d243);})['catch'](function(_0x5bc936){_0x406f92(_0x5bc936);});};AGIVertices['prototype'][_0x29c3('0x7a')]=function(_0x509120,_0x432773){scripts[_0x29c3('0x7a')](this['channel'],_0x509120)['then'](function(_0x1c72e4){_0x432773(null,_0x1c72e4);})[_0x29c3('0x12')](function(_0x2586a1){_0x432773(_0x2586a1);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x7b')]=function(_0x3a3b3c,_0x51989e){scripts[_0x29c3('0x7b')](_0x3a3b3c['key'],_0x3a3b3c['text'],_0x3a3b3c[_0x29c3('0x7c')]||_0x29c3('0x56'),_0x3a3b3c[_0x29c3('0x7d')])[_0x29c3('0x13')](function(_0x102e78){_0x51989e(null,_0x102e78);})[_0x29c3('0x12')](function(_0x195210){_0x51989e(_0x195210);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x7e')]=function(_0x51f48d,_0x4e63b3,_0x887d3d){scripts[_0x29c3('0x7e')](_0x4e63b3,_0x51f48d[_0x29c3('0x74')],_0x51f48d[_0x29c3('0x7f')]||_0x29c3('0x56'),this[_0x29c3('0x80')](_0x51f48d[_0x29c3('0x81')])?_0x51f48d[_0x29c3('0x81')]:undefined)[_0x29c3('0x13')](function(_0x53fbe7){_0x887d3d(null,_0x53fbe7);})[_0x29c3('0x12')](function(_0x408b1e){_0x887d3d(_0x408b1e);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x82')]=function(_0x570f33,_0x1d2d71){scripts['awsPolly'](_0x570f33[_0x29c3('0x83')],_0x570f33[_0x29c3('0x84')],_0x570f33[_0x29c3('0x85')],_0x570f33[_0x29c3('0x86')]||_0x29c3('0x87'),_0x570f33['text'],_0x570f33[_0x29c3('0x88')]||_0x29c3('0x54'))[_0x29c3('0x13')](function(_0x4d7065){_0x1d2d71(null,_0x4d7065);})[_0x29c3('0x12')](function(_0x362df5){_0x1d2d71(_0x362df5);});};AGIVertices[_0x29c3('0xe')]['awsLex']=function(_0x26e820,_0x35b5a2){scripts[_0x29c3('0x89')](this[_0x29c3('0xb')]['uniqueid'],_0x26e820[_0x29c3('0x83')],_0x26e820[_0x29c3('0x84')],_0x26e820['aws_lex_region'],_0x26e820[_0x29c3('0x54')],_0x26e820[_0x29c3('0x8a')])[_0x29c3('0x13')](function(_0x32f744){_0x35b5a2(null,_0x32f744);})[_0x29c3('0x12')](function(_0x327373){_0x35b5a2(_0x327373);});};AGIVertices['prototype']['googleASR']=function(_0x2af260,_0x182c6f,_0x2f8d69){scripts[_0x29c3('0x8b')](_0x182c6f,_0x2af260[_0x29c3('0x74')],_0x2af260[_0x29c3('0x8c')]||_0x29c3('0x56'))[_0x29c3('0x13')](function(_0x9c0566){_0x2f8d69(null,_0x9c0566);})['catch'](function(_0x2ddd40){_0x2f8d69(_0x2ddd40);});};AGIVertices[_0x29c3('0xe')]['tildeASR']=function(_0x175910,_0x52b8b7,_0x1ff3d8){scripts['tildeASR'](_0x52b8b7,_0x175910[_0x29c3('0x8d')],_0x175910[_0x29c3('0x8e')],_0x175910[_0x29c3('0x6a')])[_0x29c3('0x13')](function(_0x42e3f7){_0x1ff3d8(null,_0x42e3f7);})[_0x29c3('0x12')](function(_0x38d74e){_0x1ff3d8(_0x38d74e);});};AGIVertices['prototype'][_0x29c3('0x8f')]=function(_0x32746c){var _0x6717e0=_[_0x29c3('0x61')](verticesWithRetry,_0x32746c[_0x29c3('0x30')])?_0x32746c:_[_0x29c3('0x90')](_0x32746c);for(var _0x5d2c73 in _0x6717e0){if(_0x6717e0['hasOwnProperty'](_0x5d2c73)){if(_0x6717e0[_0x5d2c73]&&_[_0x29c3('0x91')](_0x6717e0[_0x5d2c73])){if(_['includes'](recursiveMapAttributes,_0x5d2c73)){_0x6717e0[_0x5d2c73]=this[_0x29c3('0x92')](_0x6717e0[_0x5d2c73]);}else{_0x6717e0[_0x5d2c73]=this[_0x29c3('0x93')](_0x6717e0[_0x5d2c73]);}}}}return _0x6717e0;};AGIVertices[_0x29c3('0xe')]['recursiveNodeIndex']=function(_0x1bdd37){for(var _0x59379e in _0x1bdd37){if(_0x1bdd37[_0x29c3('0x94')](_0x59379e)){if(_[_0x29c3('0x95')](_0x1bdd37[_0x59379e])){this[_0x29c3('0x96')](_0x1bdd37[_0x59379e]);}else if(_[_0x29c3('0x97')](_0x1bdd37[_0x59379e])){for(var _0x5c11b3=0x0;_0x5c11b3<_0x1bdd37[_0x59379e][_0x29c3('0x98')];_0x5c11b3++){this[_0x29c3('0x96')](_0x1bdd37[_0x59379e][_0x5c11b3]);}}else if(_[_0x29c3('0x91')](_0x1bdd37[_0x59379e])){_0x1bdd37[_0x59379e]=this[_0x29c3('0x93')](_0x1bdd37[_0x59379e]);}}}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x99')]=function(_0x42e832,_0x3f7664){for(var _0x12eb9f in _0x42e832){if(_0x42e832['hasOwnProperty'](_0x12eb9f)){if(_['isPlainObject'](_0x42e832[_0x12eb9f])){if(!_['isEmpty'](_0x42e832[_0x12eb9f])){this[_0x29c3('0x99')](_0x42e832[_0x12eb9f],util[_0x29c3('0x22')]('%s.%s',_0x3f7664,_0x12eb9f));}}else if(_[_0x29c3('0x97')](_0x42e832[_0x12eb9f])){for(var _0x3879f3=0x0;_0x3879f3<_0x42e832[_0x12eb9f][_0x29c3('0x98')];_0x3879f3++){this['saveRestApiResult'](_0x42e832[_0x12eb9f][_0x3879f3],util['format'](_0x29c3('0x9a'),_0x3f7664,_0x12eb9f+'['+_0x3879f3+']'));}}else{if(!_[_0x29c3('0x41')](_0x42e832[_0x12eb9f])){this['channel']['setVariable'](util['format'](_0x29c3('0x9a'),_0x3f7664,_0x12eb9f),_0x42e832[_0x12eb9f]);}}}}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x92')]=function(_0x291e1e){try{var _0x2bcb23=JSON[_0x29c3('0x6b')](_0x291e1e);this[_0x29c3('0x96')](_0x2bcb23);return JSON[_0x29c3('0x6d')](_0x2bcb23);}catch(_0x2e1c7b){return this[_0x29c3('0x93')](_0x291e1e);}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x93')]=function(_0x317c25){var _0x19fe05=_0x317c25[_0x29c3('0x9b')]('{');for(var _0x4532c1=0x1;_0x4532c1<_0x19fe05[_0x29c3('0x98')];_0x4532c1+=0x1){var _0x2854c3=_0x19fe05[_0x4532c1][_0x29c3('0x9b')]('}');if(_0x2854c3[_0x29c3('0x98')]>0x1){_0x317c25=_0x317c25[_0x29c3('0x9c')]('{'+_0x2854c3[0x0]+'}',this['channel'][_0x29c3('0xf')](_0x2854c3[0x0])[_0x29c3('0x9d')]||_0x2854c3[0x0]);}}if(_0x19fe05[_0x29c3('0x98')]===0x1){return _0x317c25[_0x29c3('0x9e')]();}return this[_0x29c3('0x93')](_0x317c25);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x9f')]=function(_0x17acf5,_0x26e939){var _0x34c87e=this[_0x29c3('0xb')][_0x29c3('0xf')](_0x17acf5);if(_0x34c87e[_0x29c3('0xa0')]===-0x1){return _0x34c87e;}logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xa1'),_0x26e939,_0x34c87e[_0x29c3('0x9d')]));return this['channel']['setVariable'](_0x26e939,_0x34c87e[_0x29c3('0x9d')]);};AGIVertices[_0x29c3('0xe')]['isConfigured']=function(_0x35347a){return _0x35347a&&_0x35347a!=='0'&&_0x35347a!=='-1'&&_0x35347a!=='';};AGIVertices[_0x29c3('0xe')]['maxRetry']=function(_0x53ceab){this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x53ceab,'-');_0x53ceab[_0x29c3('0xa2')]=_0x53ceab[_0x29c3('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x29c3('0xe')][_0x29c3('0xa4')]=function(_0x13f95a){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xa5'),_0x13f95a['label']));if(!this[_0x29c3('0x80')](_0x13f95a['text'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20text\x20configured');}var _0x20e342='\x22'+_0x13f95a[_0x29c3('0x54')]+'\x22';if(this['isConfigured'](_0x13f95a[_0x29c3('0x72')])){_0x20e342+=','+_0x13f95a['options'];}var _0x2c95e2=this[_0x29c3('0xb')][_0x29c3('0x50')]('MRCPSynth',_0x20e342);if(_0x2c95e2[_0x29c3('0xa0')]===-0x1){return _0x2c95e2;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x20e342));};AGIVertices['prototype']['mrcprecog']=function(_0x62c103){logger['info'](util['format'](_0x29c3('0xa8'),_0x62c103[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x62c103[_0x29c3('0xa9')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x60b65a=_0x62c103[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x62c103[_0x29c3('0x72')])){_0x60b65a+=','+_0x62c103[_0x29c3('0x72')];}var _0x13bb9f=this['channel']['exec']('MRCPRecog',_0x60b65a);if(_0x13bb9f[_0x29c3('0xa0')]===-0x1){return _0x13bb9f;}var _0x4feae1=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xab'));if(_0x4feae1[_0x29c3('0xa0')]===-0x1){return _0x4feae1;}var _0x160809=this['getAndSetVariable'](_0x29c3('0xac'),'MRCP_RECOG_TRANSCRIPT');if(_0x160809['result']===-0x1){return _0x160809;}var _0x9ebcc5=this[_0x29c3('0x9f')](_0x29c3('0xad'),_0x29c3('0xae'));if(_0x9ebcc5[_0x29c3('0xa0')]===-0x1){return _0x9ebcc5;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xaf'),_0x60b65a));};AGIVertices['prototype'][_0x29c3('0xb0')]=function(_0x1176fe){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1176fe[_0x29c3('0x2f')]));return this['channel']['agi']([_0x1176fe[_0x29c3('0xb1')],_0x1176fe[_0x29c3('0xb2')]]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0xb3')]=function(_0x1687bc){logger['info'](util[_0x29c3('0x22')](_0x29c3('0xb4'),_0x1687bc[_0x29c3('0x2f')]));if(this[_0x29c3('0x80')](_0x1687bc[_0x29c3('0x5f')])){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xb5'),_0x1687bc[_0x29c3('0x5f')]));var _0xb05863=this[_0x29c3('0xb')][_0x29c3('0xb6')](_0x1687bc[_0x29c3('0x5f')]);if(_0xb05863[_0x29c3('0xa0')]===-0x1){return _0xb05863;}}return this[_0x29c3('0xb')]['answer']();};AGIVertices[_0x29c3('0xe')][_0x29c3('0x45')]=function(_0x486b05){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xb7'),_0x486b05[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x486b05['list_id'])){return this['channel'][_0x29c3('0x25')](_0x486b05,_0x29c3('0xb8'));}_0x486b05[_0x29c3('0x44')]=moment();if(this[_0x29c3('0x80')](_0x486b05[_0x29c3('0xb9')])){_0x486b05[_0x29c3('0x44')]=moment()[_0x29c3('0xba')](_0x486b05[_0x29c3('0xb9')],_0x29c3('0xbb'));}if(!this[_0x29c3('0x80')](_0x486b05[_0x29c3('0x46')])){_0x486b05[_0x29c3('0x46')]=0x2;}this[_0x29c3('0x3d')][_0x29c3('0x69')](this,_0x486b05);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xbc'),_0x486b05[_0x29c3('0x42')],_0x486b05['list_id'],_0x486b05['scheduledAt']));};AGIVertices[_0x29c3('0xe')]['custom_app']=function(_0x4f9cba){logger['info'](util['format'](_0x29c3('0xbd'),_0x4f9cba[_0x29c3('0x2f')]));var _0x5b761f=this[_0x29c3('0xb')][_0x29c3('0x50')](_0x4f9cba['application'],_0x4f9cba[_0x29c3('0x72')]);if(_0x5b761f[_0x29c3('0xa0')]===-0x1){return _0x5b761f;}return this['channel']['noop'](util[_0x29c3('0x22')]('Executed\x20command\x20%s\x20%s',_0x4f9cba[_0x29c3('0xbe')],_0x4f9cba['options']));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xbf')]=function(_0x394c8d){logger['info'](util[_0x29c3('0x22')](_0x29c3('0xc0'),_0x394c8d[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x394c8d[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20text\x20configured');}var _0x43ca79='\x22'+_0x394c8d['text']+'\x22';if(this[_0x29c3('0x80')](_0x394c8d[_0x29c3('0x72')])){_0x43ca79+=','+_0x394c8d['options'];}var _0x1d8517=this[_0x29c3('0xb')]['exec'](_0x29c3('0xc1'),_0x43ca79);if(_0x1d8517[_0x29c3('0xa0')]===-0x1){return _0x1d8517;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x43ca79));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xc2')]=function(_0x476934){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xc3'),_0x476934[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x476934[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}var _0x3f3fdc='\x22'+_0x476934[_0x29c3('0x54')]+'\x22';if(this[_0x29c3('0x80')](_0x476934[_0x29c3('0x72')])){_0x3f3fdc+=','+_0x476934[_0x29c3('0x72')];}var _0x2cc5e8=this['channel']['exec'](_0x29c3('0xc1'),_0x3f3fdc);if(_0x2cc5e8[_0x29c3('0xa0')]===-0x1){return _0x2cc5e8;}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x3f3fdc));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xc5')]=function(_0x51cb1a){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xc6'),_0x51cb1a[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x51cb1a[_0x29c3('0xa9')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc7'));}var _0x3fbf5c=_0x51cb1a[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x51cb1a['options'])){_0x3fbf5c+=','+_0x51cb1a[_0x29c3('0x72')];}var _0x5b1976=this['channel'][_0x29c3('0x50')]('MRCPRecog',_0x3fbf5c);if(_0x5b1976[_0x29c3('0xa0')]===-0x1){return _0x5b1976;}var _0x2d6366=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xc8'));if(_0x2d6366['result']===-0x1){return _0x2d6366;}var _0xe6b122=this[_0x29c3('0x9f')](_0x29c3('0xac'),_0x29c3('0xc9'));if(_0xe6b122['result']===-0x1){return _0xe6b122;}var _0x1fb04e=this[_0x29c3('0x9f')]('RECOG_INSTANCE()',_0x29c3('0xca'));if(_0x1fb04e[_0x29c3('0xa0')]===-0x1){return _0x1fb04e;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3fbf5c));};AGIVertices['prototype'][_0x29c3('0xcb')]=function(_0x35dfc4){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xcc'),_0x35dfc4['label']));if(!this[_0x29c3('0x80')](_0x35dfc4[_0x29c3('0xa9')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc7'));}var _0x1de558=_0x35dfc4[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x35dfc4[_0x29c3('0x72')])){_0x1de558+=','+_0x35dfc4[_0x29c3('0x72')];}var _0x14d09f=this[_0x29c3('0xb')]['exec'](_0x29c3('0xcd'),_0x1de558);if(_0x14d09f[_0x29c3('0xa0')]===-0x1){return _0x14d09f;}var _0x4b9b5=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xce'));if(_0x4b9b5[_0x29c3('0xa0')]===-0x1){return _0x4b9b5;}var _0x775de5=this['getAndSetVariable'](_0x29c3('0xac'),_0x29c3('0xcf'));if(_0x775de5['result']===-0x1){return _0x775de5;}var _0x43859c=this[_0x29c3('0x9f')](_0x29c3('0xad'),_0x29c3('0xd0'));if(_0x43859c[_0x29c3('0xa0')]===-0x1){return _0x43859c;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xaf'),_0x1de558));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xd1')]=function(_0x27e186){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x27e186['label']));if(!this[_0x29c3('0x80')](_0x27e186[_0x29c3('0xd2')])){return this[_0x29c3('0xb')]['error'](_0x27e186,'no\x20database\x20selected');}var _0x22a1f6=this[_0x29c3('0x16')][_0x29c3('0x69')](this,_0x27e186[_0x29c3('0xd2')]);if(!_0x22a1f6){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd3'));}if(!this['isConfigured'](_0x27e186[_0x29c3('0x29')])){return this['channel'][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd4'));}var _0x5685a2=_0x27e186[_0x29c3('0x29')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xd5'),_0x5685a2));var _0x5848e9=this[_0x29c3('0x23')][_0x29c3('0x69')](this,_0x22a1f6,_0x5685a2);this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x27e186,_0x5685a2);if(!this['isConfigured'](_0x27e186['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xd6'));}var _0x397001=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x27e186['variable_id']);if(!_0x397001){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd7'));}var _0x9c68ea=this;_0x5848e9[_0x29c3('0xd8')](function(_0x3eccbd,_0x3d50a8){Object[_0x29c3('0xd9')](_0x3eccbd)[_0x29c3('0xd8')](function(_0x54a18b){_0x9c68ea['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0xdb'),_0x397001,_0x3d50a8,_0x54a18b),_0x3eccbd[_0x54a18b]);});});this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0xdc'),_0x397001),_0x5848e9['length']);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xdd'),_0x397001));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xde')]=function(_0x52f69b){logger[_0x29c3('0xdf')](util[_0x29c3('0x22')](_0x29c3('0xe0'),_0x52f69b['label']));if(!this[_0x29c3('0x80')](_0x52f69b[_0x29c3('0xe1')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x52f69b,'no\x20user\x20selected');}var _0x10e913=this[_0x29c3('0x18')]['sync'](this,_0x52f69b['sip_id']);if(!_0x10e913){return this[_0x29c3('0xb')]['error'](_0x52f69b,_0x29c3('0xe2'));}var _0x61d058=this[_0x29c3('0xb')]['exec'](_0x29c3('0xe3'),[util[_0x29c3('0x22')]('SIP/%s',_0x10e913),_0x52f69b[_0x29c3('0x5f')],_0x52f69b[_0x29c3('0xe4')],_0x52f69b['url']]);if(_0x61d058[_0x29c3('0xa0')]===-0x1){return _0x61d058;}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xe5'),_0x29c3('0xe3')));};AGIVertices[_0x29c3('0xe')]['dialogflow']=function(_0x3f5c3f){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3f5c3f['label']));if(!this[_0x29c3('0x80')](_0x3f5c3f[_0x29c3('0x74')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xe6'));}if(!this[_0x29c3('0x80')](_0x3f5c3f[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xe7')]=!![];this['createSquareDetailsReport'](_0x3f5c3f);this['createSquareMessage'](_0x3f5c3f[_0x29c3('0x54')],'in','','');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('Trying\x20Dialogflow:\x20%s',_0x3f5c3f['text']));var _0x54f0c2=this[_0x29c3('0x73')]['sync'](this,_0x3f5c3f);if(_0x54f0c2){for(var _0x25fd68 in _0x54f0c2){if(_0x54f0c2[_0x29c3('0x94')](_0x25fd68)){this['channel']['setVariable'](util[_0x29c3('0x22')]('DIALOGFLOW_%s',_0x25fd68['toUpperCase']()),_0x54f0c2[_0x25fd68]);}}this[_0x29c3('0x3c')](_0x54f0c2[_0x29c3('0xe8')],_0x29c3('0xe9'),_0x29c3('0xea'),'');return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xeb'),_0x54f0c2[_0x29c3('0xe8')]));}return this['channel'][_0x29c3('0x25')](_0x3f5c3f,_0x29c3('0xec'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xed')]=function(_0x589976){logger['info'](util['format'](_0x29c3('0xee'),_0x589976[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x589976[_0x29c3('0x77')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xef'));}if(!this['isConfigured'](_0x589976[_0x29c3('0x78')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20client_email\x20configured');}if(!this[_0x29c3('0x80')](_0x589976[_0x29c3('0xf0')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x29c3('0x80')](_0x589976['dialogflowV2_language'])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xf1'));}if(!this['isConfigured'](_0x589976[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xe7')]=!![];this[_0x29c3('0x2e')](_0x589976);this['createSquareMessage'](_0x589976['text'],'in','','');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xf2'),_0x589976['text']));var _0x9cedb9=this[_0x29c3('0x76')][_0x29c3('0x69')](this,_0x589976);if(_0x9cedb9){for(var _0x714659 in _0x9cedb9){if(_0x9cedb9[_0x29c3('0x94')](_0x714659)){if(_0x714659!==_0x29c3('0xf3')){this[_0x29c3('0xb')]['setVariable'](util[_0x29c3('0x22')]('DIALOGFLOW_%s',_0x714659[_0x29c3('0x63')]()),_0x9cedb9[_0x714659]);}}}this[_0x29c3('0x3c')](_0x9cedb9[_0x29c3('0xe8')],_0x29c3('0xe9'),_0x29c3('0xed'),_0x9cedb9[_0x29c3('0xf3')]);return this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0xf4'),_0x9cedb9['speech']));}return this['channel'][_0x29c3('0x25')](_0x589976,_0x29c3('0xf5'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xf6')]=function(_0x22f765){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xf7'),_0x22f765['label']));if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xf8')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xf9'));}if(!this[_0x29c3('0x80')](_0x22f765['username'])){return this['channel']['noop'](_0x29c3('0xfa'));}if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xfb')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20password\x20configured');}if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xfc')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xc4'));}this['channel'][_0x29c3('0xe7')]=!![];this['createSquareDetailsReport'](_0x22f765);this[_0x29c3('0x3c')](_0x22f765[_0x29c3('0x54')],'in','','');this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xfd'),_0x22f765[_0x29c3('0x54')]));var _0x85e50a=this[_0x29c3('0x7a')][_0x29c3('0x69')](this,_0x22f765);if(_0x85e50a){for(var _0x210579 in _0x85e50a){if(_0x85e50a['hasOwnProperty'](_0x210579)){this[_0x29c3('0xb')][_0x29c3('0xda')](util['format']('SESTEK_NDA_%s',_0x210579['toUpperCase']()),_0x85e50a[_0x210579]);}}this['createSquareMessage'](_0x85e50a[_0x29c3('0xe8')],'out',_0x29c3('0xf6'),'');if(_0x85e50a['audiofile']){this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0xfe'),_0x85e50a[_0x29c3('0xff')]));var _0x36534a=this[_0x29c3('0xb')][_0x29c3('0x100')](_0x85e50a[_0x29c3('0xff')]);try{fs['unlink'](_0x85e50a[_0x29c3('0xff')]+_0x29c3('0x101'));}catch(_0x2b13be){logger[_0x29c3('0x25')](_0x2b13be);}return _0x36534a;}else{return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x102'),_0x85e50a[_0x29c3('0xe8')]));}}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x22f765,_0x29c3('0x103'));};AGIVertices[_0x29c3('0xe')]['end']=function(_0x1f095a){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x104'),_0x1f095a['label']));return this['channel']['noop'](_0x29c3('0x105'));};AGIVertices['prototype'][_0x29c3('0x106')]=function(_0x174fda){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x107'),_0x174fda[_0x29c3('0x2f')]));var _0x20ea6a='';if(_0x174fda[_0x29c3('0x108')]){if(!this[_0x29c3('0x80')](_0x174fda['trunk_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x174fda,'no\x20trunk\x20selected');}else{var _0xf2781a=parseInt(_0x174fda['trunk_id'],0xa);if(isNaN(_0xf2781a)){_0x20ea6a=_0x174fda[_0x29c3('0x108')];}else{_0x20ea6a=this[_0x29c3('0x19')][_0x29c3('0x69')](this,_0x174fda[_0x29c3('0x108')]);if(!_0x20ea6a){return this['channel'][_0x29c3('0x25')](_0x174fda,'no\x20trunk\x20found');}}}}else if(_0x174fda[_0x29c3('0x109')]){_0x20ea6a=_0x174fda['trunk_name'];}else{return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x174fda,_0x29c3('0x10a'));}var _0x173f8a=this[_0x29c3('0xb')][_0x29c3('0x50')]('DIAL',[util[_0x29c3('0x22')](_0x29c3('0x10b'),_0x20ea6a,_0x174fda['phone']),_0x174fda['timeout'],_0x174fda[_0x29c3('0xe4')],_0x174fda[_0x29c3('0x5d')]]);if(_0x173f8a[_0x29c3('0xa0')]===-0x1){return _0x173f8a;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0xe5'),_0x29c3('0xe3')));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x10c')]=function(_0x2cd0d3){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2cd0d3[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x10c'));};AGIVertices['prototype']['getdigits']=function(_0x1f747b){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x10d'),_0x1f747b[_0x29c3('0x2f')]));if(_0x1f747b[_0x29c3('0xa2')]===0x0){return this['maxRetry'](_0x1f747b);}_0x1f747b[_0x29c3('0xa2')]-=0x1;if(!this[_0x29c3('0x80')](_0x1f747b[_0x29c3('0x10e')])){return this['channel'][_0x29c3('0x25')](_0x1f747b,'no\x20file\x20audio\x20selected');}var _0x2c4ec7=this[_0x29c3('0x1a')]['sync'](this,_0x1f747b['file_id']);if(!_0x2c4ec7){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x1f747b,_0x29c3('0x10f'));}if(!this[_0x29c3('0x80')](_0x1f747b['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b7c91=this[_0x29c3('0xb')][_0x29c3('0x110')](_0x2c4ec7,_0x1f747b[_0x29c3('0x111')],_0x1f747b['maxdigit']);var _0x3878f5=_0x3b7c91[_0x29c3('0xa0')]?_0x3b7c91[_0x29c3('0xa0')][_0x29c3('0x9e')]():'';logger['info']('test',JSON[_0x29c3('0x6d')](_0x3b7c91));if(_0x3b7c91['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x1f747b,_0x3878f5);return _0x3b7c91;}else if(_0x3b7c91[_0x29c3('0x9d')]===_0x29c3('0x5f')){_0x3b7c91[_0x29c3('0xa0')]=_0x3878f5[_0x29c3('0x98')]>=parseInt(_0x1f747b['mindigit'])?'x':'i';}else{_0x3b7c91[_0x29c3('0xa0')]=_0x3878f5[_0x29c3('0x98')]>=parseInt(_0x1f747b['mindigit'])&&_0x3878f5[_0x29c3('0x98')]<=parseInt(_0x1f747b[_0x29c3('0x112')])?'x':'i';}var _0xf7c510=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x1f747b[_0x29c3('0x113')]);if(!_0xf7c510){return this[_0x29c3('0xb')]['error'](_0x1f747b,'no\x20variable\x20found');}this[_0x29c3('0xb')][_0x29c3('0xda')](_0xf7c510,_0x3878f5);if(this['isConfigured'](_0x1f747b[_0x29c3('0x114')])){var _0x5351ab=parseInt(_0x1f747b[_0x29c3('0x114')],0xa);var _0x461a00=rs[_0x29c3('0x115')]({'charset':'*','length':_0x5351ab});var _0x52ea8e=_0x3878f5[_0x29c3('0x98')];if(_0x52ea8e>0x0){if(_0x52ea8e>_0x5351ab){this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x1f747b,_0x1f747b[_0x29c3('0x116')]===_0x29c3('0x117')?_0x461a00+_0x3878f5['substr'](_0x5351ab):_0x3878f5[_0x29c3('0x118')](0x0,_0x52ea8e-_0x5351ab)+_0x461a00);}else{this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x1f747b,rs['generate']({'charset':'*','length':_0x52ea8e}));}}else{this[_0x29c3('0x2e')]['sync'](this,_0x1f747b,'');}}else{this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x1f747b,_0x3878f5);}return _0x3b7c91;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x119')]=function(_0x54953f){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x11a'),_0x54953f[_0x29c3('0x2f')]));return this['getdigits'](_0x54953f);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x11b')]=function(_0x457dca){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x11c'),_0x457dca[_0x29c3('0x2f')]));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x457dca,_0x457dca[_0x29c3('0x11d')]);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('GOAL\x20%s',_0x457dca['goalname']));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x11e')]=function(_0x113716){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x11f'),_0x113716[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x113716['aws_access_key_id'])||!this[_0x29c3('0x80')](_0x113716[_0x29c3('0x84')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0x120'));}if(!this[_0x29c3('0x80')](_0x113716['text'])){return this[_0x29c3('0xb')]['noop']('no\x20text\x20configured');}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x121'),_0x113716[_0x29c3('0x54')]));var _0x3d20d3=this[_0x29c3('0x82')][_0x29c3('0x69')](this,_0x113716);if(_0x3d20d3){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x122'),_0x3d20d3));var _0x2cdced=this[_0x29c3('0xb')][_0x29c3('0x100')](_0x3d20d3);try{fs[_0x29c3('0x123')](_0x3d20d3+_0x29c3('0x101'));}catch(_0x2b95bd){logger[_0x29c3('0x25')](_0x2b95bd);}return _0x2cdced;}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x113716,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x29c3('0x124')]=function(_0xffc0af){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x125'),_0xffc0af[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0xffc0af[_0x29c3('0x83')])||!this[_0x29c3('0x80')](_0xffc0af['aws_secret_access_key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x29c3('0x80')](_0xffc0af['aws_bot_name'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x126'));}if(!this[_0x29c3('0x80')](_0xffc0af['text'])){return this[_0x29c3('0xb')]['noop']('no\x20text\x20configured');}this[_0x29c3('0xb')]['bot']=!![];this[_0x29c3('0x2e')](_0xffc0af);this[_0x29c3('0x3c')](_0xffc0af[_0x29c3('0x54')],'in','','');this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x127'),_0xffc0af[_0x29c3('0x54')]));var _0xf1e192=this[_0x29c3('0x89')][_0x29c3('0x69')](this,_0xffc0af);if(_0xf1e192){for(var _0x166928 in _0xf1e192){if(_0xf1e192[_0x29c3('0x94')](_0x166928)&&_[_0x29c3('0x91')](_0xf1e192[_0x166928])){this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x128'),_0x166928['toUpperCase']()),_0xf1e192[_0x166928]);}}if(_['isNil'](_0xf1e192[_0x29c3('0x70')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x129'));}else{this[_0x29c3('0x3c')](_0xf1e192[_0x29c3('0x70')],_0x29c3('0xe9'),'amazonlex','');return this[_0x29c3('0xb')]['noop'](util['format'](_0x29c3('0x12a'),_0xf1e192[_0x29c3('0x70')]));}}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0xffc0af,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x29c3('0xe')][_0x29c3('0x12b')]=function(_0x46a590){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x12c'),_0x46a590['label'],_0x46a590['timeout']));if(!this['isConfigured'](_0x46a590[_0x29c3('0x74')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xe6'));}var _0x527ef8=_0x29c3('0x12d');var _0xca2505=util[_0x29c3('0x22')]('%s/recordings/%s',FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x47516b=util['format'](_0x29c3('0x9a'),_0xca2505,_0x527ef8);var _0x106307=!![];if(_0x46a590[_0x29c3('0x12e')]===_0x29c3('0x12f')){_0x106307=![];}var _0xd1f691=this[_0x29c3('0xb')]['recordFile'](_0xca2505,_0x527ef8,_0x46a590[_0x29c3('0x130')],_0x46a590[_0x29c3('0x5f')],undefined,_0x106307);if(_0xd1f691[_0x29c3('0xa0')]!==-0x1){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x131'),_0x47516b));var _0x331e00=this[_0x29c3('0x8b')][_0x29c3('0x69')](this,_0x46a590,_0x47516b);if(_0x331e00){for(var _0xfa8972 in _0x331e00){if(_0x331e00[_0x29c3('0x94')](_0xfa8972)){this['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x132'),_0xfa8972[_0x29c3('0x63')]()),_0x331e00[_0xfa8972]);}}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x133'),JSON[_0x29c3('0x6d')](_0x331e00)));}}return _0xd1f691;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x134')]=function(_0x604846){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x604846[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x604846[_0x29c3('0x8d')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20appid\x20configured');}if(!this[_0x29c3('0x80')](_0x604846['appsecret'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x135'));}var _0x115cd4=_0x29c3('0x12d');var _0x446dd4=util[_0x29c3('0x22')](_0x29c3('0x136'),FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x37a883=util[_0x29c3('0x22')](_0x29c3('0x9a'),_0x446dd4,_0x115cd4);var _0x1848fc=!![];if(_0x604846['beep']===_0x29c3('0x12f')){_0x1848fc=![];}var _0xcc032f=this[_0x29c3('0xb')][_0x29c3('0x137')](_0x446dd4,_0x115cd4,_0x604846[_0x29c3('0x130')],_0x604846['timeout'],undefined,_0x1848fc);if(_0xcc032f['result']!==-0x1){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('tilde\x20%s\x20file\x20created',_0x37a883));var _0x479e52=this['tildeASR'][_0x29c3('0x69')](this,_0x604846,_0x37a883);if(_0x479e52){for(var _0x1c1358 in _0x479e52){if(_0x479e52[_0x29c3('0x94')](_0x1c1358)){this[_0x29c3('0xb')]['setVariable'](util[_0x29c3('0x22')](_0x29c3('0x138'),_0x1c1358[_0x29c3('0x63')]()),_0x479e52[_0x1c1358]);}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x139'),JSON[_0x29c3('0x6d')](_0x479e52)));}}return _0xcc032f;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x13a')]=function(_0x200d46){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x200d46['label']));return this[_0x29c3('0xb')][_0x29c3('0x13b')](_0x200d46[_0x29c3('0x35')],_0x200d46[_0x29c3('0x36')],_0x200d46[_0x29c3('0x37')]);};AGIVertices['prototype'][_0x29c3('0x13c')]=function(_0xb19b88){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x13d'),_0xb19b88[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0xb19b88[_0x29c3('0x13e')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0xb19b88,_0x29c3('0x13f'));}try{var _0x57bd12=eval(_0xb19b88['condition'])?_0x29c3('0x140'):_0x29c3('0x141');this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x142'),_0xb19b88[_0x29c3('0x13e')],_0x57bd12));return{'code':0xc8,'result':_0x57bd12};}catch(_0x40bfa7){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x4cdb6e){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4cdb6e[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x4cdb6e[_0x29c3('0x143')])){return this['channel'][_0x29c3('0x25')](_0x4cdb6e,_0x29c3('0x144'));}var _0x5aa04d=this[_0x29c3('0x1e')]['sync'](this,_0x4cdb6e[_0x29c3('0x143')]);if(!_0x5aa04d){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4cdb6e,_0x29c3('0x145'));}for(var _0x573969=0x0;_0x573969<_0x5aa04d[_0x29c3('0x98')];_0x573969+=0x1){var _0x3de380=this[_0x29c3('0xb')][_0x29c3('0xf')](util['format'](_0x29c3('0x146'),_0x5aa04d[_0x573969]));if(_0x3de380[_0x29c3('0xa0')]===-0x1){return _0x3de380;}logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('IFTIME\x20%s\x20%s',_0x5aa04d[_0x573969],_0x3de380[_0x29c3('0x9d')]));if(_0x3de380['extra']==='true'){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],_0x29c3('0x140')));this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')]('IFTIME\x20%s\x20%s',_0x5aa04d[_0x573969],_0x29c3('0x140')));return{'code':0xc8,'result':_0x29c3('0x140')};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],_0x29c3('0x141')));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],'false'));}}return{'code':0xc8,'result':_0x29c3('0x141')};};AGIVertices['prototype'][_0x29c3('0x148')]=function(_0x5736b7){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5736b7[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0x148')]();};AGIVertices[_0x29c3('0xe')][_0x29c3('0x149')]=function(_0x443a28){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x14a'),_0x443a28[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x443a28['key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20key\x20configured');}var _0x1eaa1e=_0x29c3('0x12d');var _0x15fe33=util[_0x29c3('0x22')](_0x29c3('0x136'),FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x22a43f=util[_0x29c3('0x22')](_0x29c3('0x9a'),_0x15fe33,_0x1eaa1e);var _0x45cae6=!![];if(_0x443a28[_0x29c3('0x12e')]===_0x29c3('0x12f')){_0x45cae6=![];}var _0x511600=this['channel'][_0x29c3('0x137')](_0x15fe33,_0x1eaa1e,_0x443a28['intKey'],_0x443a28[_0x29c3('0x5f')],undefined,_0x45cae6);if(_0x511600[_0x29c3('0xa0')]!==-0x1){this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14b'),_0x22a43f));var _0x35bf86=this['ispeechASR'][_0x29c3('0x69')](this,_0x443a28,_0x22a43f);if(_0x35bf86){for(var _0x589895 in _0x35bf86){if(_0x35bf86['hasOwnProperty'](_0x589895)){this['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x14c'),_0x589895[_0x29c3('0x63')]()),_0x35bf86[_0x589895]);}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14d'),JSON[_0x29c3('0x6d')](_0x35bf86)));}}return _0x511600;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x14e')]=function(_0x4b07ee){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x14f'),_0x4b07ee['label']));if(!this[_0x29c3('0x80')](_0x4b07ee['key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20key\x20configured');}if(!this[_0x29c3('0x80')](_0x4b07ee[_0x29c3('0x54')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x150'),_0x4b07ee['text']));var _0x43f53e=this[_0x29c3('0x7b')]['sync'](this,_0x4b07ee);if(_0x43f53e){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14b'),_0x43f53e));var _0x52c71a=this['channel'][_0x29c3('0x100')](_0x43f53e,_0x4b07ee[_0x29c3('0x130')]);try{fs[_0x29c3('0x123')](_0x43f53e+_0x29c3('0x101'));}catch(_0x10fdd5){logger[_0x29c3('0x25')](_0x10fdd5);}return _0x52c71a;}return this[_0x29c3('0xb')]['error'](_0x4b07ee,_0x29c3('0x151'));};AGIVertices[_0x29c3('0xe')]['login']=function(_0x2d2625){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x152'),_0x2d2625[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x2d2625[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2d2625,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x155'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));var _0x38ac25=this[_0x29c3('0x4c')]['sync'](this,_0x2d2625['findBy']);if(_0x38ac25){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x156'),this[_0x29c3('0xb')]['callerid'],_0x2d2625['findBy']));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x157')};}else{logger['info'](util['format'](_0x29c3('0x158'),this[_0x29c3('0xb')]['callerid'],_0x2d2625[_0x29c3('0x153')]));this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x159')]=function(_0x4bdfd6){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4bdfd6[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x4bdfd6[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4bdfd6,_0x29c3('0x154'));}logger['info'](util[_0x29c3('0x22')](_0x29c3('0x155'),this['channel']['callerid'],_0x4bdfd6['findBy']));var _0x584488=this['agentLogout']['sync'](this,_0x4bdfd6[_0x29c3('0x153')]);if(_0x584488){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x156'),this[_0x29c3('0xb')]['callerid'],_0x4bdfd6[_0x29c3('0x153')]));this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x156'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x4bdfd6['findBy']));return{'code':0xc8,'result':_0x29c3('0x157')};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x29c3('0x31')],_0x4bdfd6['findBy']));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x29c3('0xb')][_0x29c3('0x31')],_0x4bdfd6[_0x29c3('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x29c3('0x15a')]=function(_0x199786){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x199786['label']));if(!this['isConfigured'](_0x199786[_0x29c3('0x15b')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x199786,'no\x20operation\x20configured');}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('math\x20%s',_0x199786[_0x29c3('0x15b')]));var _0x374006=eval(_0x199786['operation']);if(!this[_0x29c3('0x80')](_0x199786[_0x29c3('0x113')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xd6'));}var _0x20b449=this[_0x29c3('0xf')]['sync'](this,_0x199786[_0x29c3('0x113')]);if(!_0x20b449){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x199786,_0x29c3('0xd7'));}if(_[_0x29c3('0x97')](_0x374006)){var _0x20dbad=this;_0x374006[_0x29c3('0xd8')](function(_0x241615,_0x3dc722){_0x20dbad[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x15c'),_0x20b449,_0x3dc722),_0x241615);});return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x15d'),_0x20b449));}else{return this['channel'][_0x29c3('0xda')](_0x20b449,_0x374006);}};AGIVertices[_0x29c3('0xe')]['menu']=function(_0x5016b0){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x15e'),_0x5016b0[_0x29c3('0x2f')]));if(_0x5016b0[_0x29c3('0xa2')]===0x0){return this[_0x29c3('0xa3')](_0x5016b0);}_0x5016b0[_0x29c3('0xa2')]-=0x1;if(!this[_0x29c3('0x80')](_0x5016b0[_0x29c3('0x10e')])){return this['channel'][_0x29c3('0x25')](_0x5016b0,_0x29c3('0x15f'));}var _0x28ea4b=this['getSound'][_0x29c3('0x69')](this,_0x5016b0[_0x29c3('0x10e')]);if(!_0x28ea4b){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5016b0,_0x29c3('0x10f'));}var _0x8c8da6=this['channel'][_0x29c3('0x110')](_0x28ea4b,_0x5016b0['response'],_0x5016b0[_0x29c3('0x160')]);var _0x52fb5c=_0x8c8da6[_0x29c3('0xa0')];if(_0x8c8da6[_0x29c3('0xa0')]===-0x1){this[_0x29c3('0x2e')]['sync'](this,_0x5016b0,'-1');return _0x8c8da6;}else if(_0x8c8da6[_0x29c3('0x9d')]===_0x29c3('0x5f')){_0x8c8da6[_0x29c3('0xa0')]=_0x8c8da6[_0x29c3('0xa0')]['length']>0x0?_0x8c8da6['result']:'t';}else if(_[_0x29c3('0x3e')](_0x8c8da6['result'])){_0x8c8da6[_0x29c3('0xa0')]='#';_0x52fb5c='#';}if(!this[_0x29c3('0x80')](_0x5016b0[_0x29c3('0x113')])){this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xc7d593=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x5016b0[_0x29c3('0x113')]);if(!_0xc7d593){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5016b0,'no\x20variable\x20found');}this[_0x29c3('0xb')][_0x29c3('0xda')](_0xc7d593,_0x52fb5c);}this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x5016b0,_0x52fb5c);return _0x8c8da6;};AGIVertices[_0x29c3('0xe')][_0x29c3('0xa6')]=function(_0x326d26){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x326d26[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x326d26[_0x29c3('0x161')]||_0x326d26[_0x29c3('0x2f')]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x162')]=function(_0x1695e6){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x163'),_0x1695e6[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x1695e6[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x1695e6,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util['format'](_0x29c3('0x155'),this[_0x29c3('0xb')]['callerid'],_0x1695e6[_0x29c3('0x153')]));var _0x478807=this[_0x29c3('0x47')][_0x29c3('0x69')](this,_0x1695e6['pause_id']);var _0x37be0d=this['agentPause'][_0x29c3('0x69')](this,_0x1695e6[_0x29c3('0x153')],_0x478807);if(_0x37be0d){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x29c3('0xb')]['callerid'],_0x1695e6[_0x29c3('0x153')]));this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x164')};}};AGIVertices['prototype'][_0x29c3('0x165')]=function(_0x450b0e){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x450b0e[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x450b0e[_0x29c3('0x10e')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x450b0e,'no\x20file\x20audio\x20selected');}var _0x327504=this[_0x29c3('0x1a')][_0x29c3('0x69')](this,_0x450b0e[_0x29c3('0x10e')]);if(!_0x327504){return this[_0x29c3('0xb')]['error'](_0x450b0e,'no\x20file\x20audio\x20found');}var _0x133bef=this[_0x29c3('0xb')]['exec']('PLAYBACK',[_0x327504,_0x450b0e['opts']]);if(_0x133bef[_0x29c3('0xa0')]===-0x1){return _0x133bef;}return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x166'),'PLAYBACK',_0x327504));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x167')]=function(_0x4046a0){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x168'),_0x4046a0[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x4046a0['queue_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046a0,_0x29c3('0x169'));}var _0x2bf445='';var _0x5e1960=parseInt(_0x4046a0[_0x29c3('0x16a')],0xa);if(isNaN(_0x5e1960)){_0x2bf445=_0x4046a0['queue_id'];}else{_0x2bf445=this[_0x29c3('0x16b')]['sync'](this,_0x4046a0[_0x29c3('0x16a')]);if(!_0x2bf445){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046a0,_0x29c3('0x16c'));}}var _0x50c5f8='';if(this[_0x29c3('0x80')](_0x4046a0[_0x29c3('0x10e')])){var _0x2be117=this[_0x29c3('0x1a')]['sync'](this,_0x4046a0[_0x29c3('0x10e')]);if(_0x2be117){_0x50c5f8=_0x2be117;}}this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x4046a0,_0x2bf445);if(_0x4046a0[_0x29c3('0xe4')][_0x29c3('0x16d')]('x')<0x0){_0x4046a0[_0x29c3('0xe4')]+='x';}if(_0x4046a0[_0x29c3('0xe4')][_0x29c3('0x16d')]('X')<0x0){_0x4046a0[_0x29c3('0xe4')]+='X';}this[_0x29c3('0xb')][_0x29c3('0xda')](_0x29c3('0x16e'),_0x2bf445?_0x2bf445[_0x29c3('0x16f')]():'');var _0xa87e3a=this[_0x29c3('0xb')][_0x29c3('0x50')](_0x29c3('0x170'),[_0x2bf445,_0x4046a0[_0x29c3('0xe4')],_0x4046a0['url'],_0x50c5f8,_0x4046a0[_0x29c3('0x5f')],_0x4046a0[_0x29c3('0xb0')],_0x4046a0['macro'],_0x4046a0[_0x29c3('0x171')],'',_0x4046a0['position']]);if(_0xa87e3a[_0x29c3('0xa0')]===-0x1){return _0xa87e3a;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x166'),'QUEUE',_0x2bf445));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x172')]=function(_0xbb0351){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xbb0351[_0x29c3('0x2f')]));var _0x39f599=_0xbb0351['recordingFormat']||_0x29c3('0x12d');var _0x1e84f8=util[_0x29c3('0x22')](_0x29c3('0x173'),this[_0x29c3('0xb')][_0x29c3('0x33')],rs[_0x29c3('0x115')](0x5));var _0x4797f6=util[_0x29c3('0x22')](_0x29c3('0x174'),FILES_PATH,_0x1e84f8,_0x39f599);var _0x100390=util['format'](_0x29c3('0x136'),FILES_PATH,_0x1e84f8);this[_0x29c3('0x32')]['sync'](this,_0xbb0351,_0x1e84f8,_0x4797f6);this[_0x29c3('0xb')][_0x29c3('0xda')](_0x29c3('0x175'),_0x1e84f8);logger[_0x29c3('0x27')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x100390,_0x39f599,_0xbb0351[_0x29c3('0x176')],_0xbb0351['timeout']);return this['channel']['recordFile'](_0x100390,_0x39f599,_0xbb0351[_0x29c3('0x176')],_0xbb0351[_0x29c3('0x5f')],undefined,!![]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x177')]=function(_0x51376f){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x178'),_0x51376f[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x51376f[_0x29c3('0x5d')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0x179'));}var _0x3dd0c5=this[_0x29c3('0x5c')][_0x29c3('0x69')](this,_0x51376f);logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x17a'),util['inspect'](_0x3dd0c5,{'showHidden':![],'depth':null})));if(!this[_0x29c3('0x80')](_0x51376f[_0x29c3('0x113')])){return this[_0x29c3('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3308a4=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x51376f[_0x29c3('0x113')]);if(!_0x3308a4){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x51376f,_0x29c3('0xd7'));}this['channel']['setVariable'](util[_0x29c3('0x22')](_0x29c3('0x17b'),_0x3308a4),_0x3dd0c5['statusCode']?_0x3dd0c5[_0x29c3('0x6e')]:_0x29c3('0x17c'));this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x17d'),_0x3308a4),_0x3dd0c5['statusMessage']?_0x3dd0c5['statusMessage']:'OK');if(_0x3dd0c5[_0x29c3('0x64')]){try{this[_0x29c3('0x99')](_0x3dd0c5[_0x29c3('0x64')],_0x3308a4);}catch(_0x1fa911){logger[_0x29c3('0x25')](util[_0x29c3('0x22')](_0x29c3('0x17e'),_0x3308a4));}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0xdd'),_0x3308a4));};AGIVertices[_0x29c3('0xe')]['saydigits']=function(_0x39fa5c){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x17f'),_0x39fa5c[_0x29c3('0x2f')]));return this['channel'][_0x29c3('0x180')](_0x39fa5c[_0x29c3('0x181')][_0x29c3('0x52')](/\s+/g,''),_0x39fa5c[_0x29c3('0x176')]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x182')]=function(_0x4fda58){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4fda58[_0x29c3('0x2f')]));return this[_0x29c3('0xb')]['sayNumber'](_0x4fda58[_0x29c3('0x60')][_0x29c3('0x52')](/\s+/g,''),_0x4fda58['escape_digits']);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x183')]=function(_0x3a536c){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x184'),_0x3a536c[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0x185')](_0x3a536c['text'],_0x3a536c[_0x29c3('0x176')]);};AGIVertices['prototype']['sendMail']=function(_0x15c106){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x15c106[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x15c106['account_id'])){return this['channel'][_0x29c3('0xa6')]('no\x20mail\x20account\x20configured');}var _0x169d6c=this[_0x29c3('0x186')]['sync'](this,_0x15c106[_0x29c3('0x187')]);if(!_0x169d6c||!_0x169d6c[_0x29c3('0x188')]){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x15c106,_0x29c3('0x189'));}var _0x2cc2cd={'from':util[_0x29c3('0x22')]('\x22%s\x22\x20<%s>',_0x169d6c[_0x29c3('0x11')],_0x169d6c[_0x29c3('0x18a')]||_0x169d6c[_0x29c3('0x188')]['user']),'to':_0x15c106['to']||'','cc':_0x15c106['cc']||'','bcc':_0x15c106[_0x29c3('0x18b')]||'','subject':_0x15c106[_0x29c3('0x18c')],'html':_0x15c106['text'],'text':_0x15c106[_0x29c3('0x54')]};if(this[_0x29c3('0x80')](_0x15c106[_0x29c3('0x18d')])){}logger[_0x29c3('0xdf')]('sendMail\x20message',JSON[_0x29c3('0x6d')](_0x2cc2cd));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x15c106,_0x15c106[_0x29c3('0x187')]);this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x18e'),_0x169d6c[_0x29c3('0x11')]));this['sendMailMessage'][_0x29c3('0x69')](this,_0x169d6c[_0x29c3('0x18f')],_0x2cc2cd);return this[_0x29c3('0xb')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x29c3('0x190')]=function(_0x218ffb){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x191'),_0x218ffb[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x192'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x193')]=function(_0x2189bd){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2189bd['label']));if(!this[_0x29c3('0x80')](_0x2189bd[_0x29c3('0x194')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x195'));}var _0x5cb95d=this[_0x29c3('0x196')][_0x29c3('0x69')](this,_0x2189bd[_0x29c3('0x194')]);if(!_0x5cb95d){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2189bd,_0x29c3('0x197'));}var _0x56a798={'body':_0x2189bd['sms_text'],'phone':_0x2189bd['to']||'','SmsAccountId':_0x5cb95d['id']};logger[_0x29c3('0xdf')](_0x29c3('0x198'),JSON[_0x29c3('0x6d')](_0x56a798));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x2189bd,_0x2189bd[_0x29c3('0x194')]);this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x199'),_0x5cb95d[_0x29c3('0x11')]));this['createSmsMessage'][_0x29c3('0x69')](this,_0x56a798);return this['channel']['noop'](_0x29c3('0x19a'));};AGIVertices['prototype'][_0x29c3('0x19b')]=function(_0x2f9907){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x19c'),_0x2f9907[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x2f9907['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2f9907,_0x29c3('0x19d'));}var _0x5539ef=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x2f9907[_0x29c3('0x113')]);if(!_0x5539ef){return this['channel'][_0x29c3('0x25')](_0x2f9907,_0x29c3('0xd7'));}return this[_0x29c3('0xb')]['setVariable'](_0x5539ef,_0x2f9907[_0x29c3('0x19e')]);};AGIVertices[_0x29c3('0xe')]['start']=function(_0x485253){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x19f'),_0x485253[_0x29c3('0x2f')]));this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x1a0'));if(_0x485253[_0x29c3('0xb3')]==='yes'){this[_0x29c3('0xb')]['noop'](_0x29c3('0x1a1'));return this[_0x29c3('0xb')]['answer']();}return this[_0x29c3('0xb')][_0x29c3('0xa6')]('Skipped\x20Answer');};AGIVertices[_0x29c3('0xe')]['subproject']=function(_0x5cad66){logger['info'](util['format'](_0x29c3('0x1a2'),_0x5cad66[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x5cad66[_0x29c3('0x1a3')])){return this['channel'][_0x29c3('0x25')](_0x5cad66,_0x29c3('0x1a4'));}var _0x97412c=this[_0x29c3('0x14')][_0x29c3('0x69')](this,_0x5cad66[_0x29c3('0x1a3')]);if(!this['isConfigured'](_0x97412c)){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5cad66,util[_0x29c3('0x22')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5cad66[_0x29c3('0x1a3')]));}if(_0x97412c===this[_0x29c3('0xb')][_0x29c3('0x3a')]){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5cad66,_0x29c3('0x1a5'));}this['createSquareDetailsReport']['sync'](this,_0x5cad66,_0x97412c);var _0x1d736f=this[_0x29c3('0xb')]['exec']('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x29c3('0xb0')][_0x29c3('0x1a6')]||'127.0.0.1',_0x97412c,this[_0x29c3('0xb')][_0x29c3('0x3a')]));if(_0x1d736f[_0x29c3('0xa0')]===-0x1){return _0x1d736f;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0x166'),_0x29c3('0x1a7'),_0x97412c));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1a8')]=function(_0x2d1d48){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2d1d48['label']));var _0x813065=this[_0x29c3('0x4f')][_0x29c3('0x69')](this,_0x2d1d48['command']);this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x2d1d48,_0x2d1d48['command']);if(this[_0x29c3('0x80')](_0x2d1d48[_0x29c3('0x113')])){var _0x9ade88=this[_0x29c3('0xf')]['sync'](this,_0x2d1d48[_0x29c3('0x113')]);if(_0x9ade88){this[_0x29c3('0xb')][_0x29c3('0xda')](_0x9ade88,_0x813065);return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2d1d48[_0x29c3('0xb1')],_0x9ade88));}}return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x1a9'),_0x2d1d48['command']));};AGIVertices['prototype'][_0x29c3('0x1aa')]=function(_0x2c593e){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1ab'),_0x2c593e[_0x29c3('0x2f')]));_0x2c593e[_0x29c3('0x54')]=_0x2c593e[_0x29c3('0x54')][_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x29c3('0x80')](_0x2c593e['apiKey'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20apiKey\x20configured');}if(!this[_0x29c3('0x80')](_0x2c593e[_0x29c3('0x54')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2c593e['text']));var _0x3b1b6f=this[_0x29c3('0x53')][_0x29c3('0x69')](this,_0x2c593e);if(_0x3b1b6f){this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x1ac'),_0x3b1b6f));var _0x3e506b=this['channel'][_0x29c3('0x100')](_0x3b1b6f);try{fs['unlink'](_0x3b1b6f+_0x29c3('0x101'));}catch(_0x4ce46e){logger['error'](_0x4ce46e);}return _0x3e506b;}return this['channel']['error'](_0x2c593e,_0x29c3('0x1ad'));};AGIVertices['prototype']['tts']=function(_0x4046ec){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1ae'),_0x4046ec[_0x29c3('0x2f')]));_0x4046ec['text']=_0x4046ec['text'][_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x29c3('0x80')](_0x4046ec['text'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x1af'),_0x4046ec[_0x29c3('0x54')]));var _0x1eae53=this[_0x29c3('0x5a')][_0x29c3('0x69')](this,_0x4046ec);if(_0x1eae53){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x1b0'),_0x1eae53));var _0xcdf791=this['channel'][_0x29c3('0x100')](_0x1eae53);try{fs['unlink'](_0x1eae53+_0x29c3('0x101'));}catch(_0x31b5cd){logger[_0x29c3('0x25')](_0x31b5cd);}return _0xcdf791;}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046ec,_0x29c3('0x1b1'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1b2')]=function(_0x16277b){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16277b[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x16277b[_0x29c3('0x153')])){return this['channel']['error'](_0x16277b,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util['format'](_0x29c3('0x155'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));var _0x1b66f7=this[_0x29c3('0x4b')][_0x29c3('0x69')](this,_0x16277b[_0x29c3('0x153')]);if(_0x1b66f7){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x156'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel']['callerid'],_0x16277b[_0x29c3('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x29c3('0xb')]['callerid'],_0x16277b[_0x29c3('0x153')]));this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x164')};}};AGIVertices['prototype'][_0x29c3('0x1b3')]=function(_0x1f2017){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1f2017[_0x29c3('0x2f')]));var _0x3b451a=this[_0x29c3('0xb')][_0x29c3('0x50')]('VOICEMAIL',[_0x1f2017[_0x29c3('0x1b4')],_0x1f2017[_0x29c3('0x72')]]);if(_0x3b451a['result']===-0x1){return _0x3b451a;}return this[_0x29c3('0xb')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x1f2017[_0x29c3('0x1b4')]));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1b5')]=function(_0x550f1d){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1b6'),_0x550f1d[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x550f1d[_0x29c3('0x113')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x550f1d,_0x29c3('0x19d'));}var _0x412163=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x550f1d[_0x29c3('0x113')]);if(!_0x412163){return this[_0x29c3('0xb')]['error'](_0x550f1d,_0x29c3('0xd7'));}var _0x17ff44=this[_0x29c3('0xb')][_0x29c3('0xf')](_0x412163);return{'code':0xc8,'result':_0x17ff44[_0x29c3('0x9d')]?_0x17ff44[_0x29c3('0x9d')]:'-'};};String[_0x29c3('0xe')][_0x29c3('0x9c')]=function(_0x1b70a5,_0x4f4e68){return this[_0x29c3('0x9b')](_0x1b70a5)[_0x29c3('0x1b7')](_0x4f4e68);};module[_0x29c3('0x1b8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 7c3a648..bd87c32 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 _0x5365=['then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid'];(function(_0x490815,_0x28bb61){var _0x1f5f52=function(_0x1997b8){while(--_0x1997b8){_0x490815['push'](_0x490815['shift']());}};_0x1f5f52(++_0x28bb61);}(_0x5365,0x13c));var _0x5536=function(_0x2fb9e8,_0x9d4f2){_0x2fb9e8=_0x2fb9e8-0x0;var _0xc45d8d=_0x5365[_0x2fb9e8];return _0xc45d8d;};'use strict';var _=require('lodash');var moment=require(_0x5536('0x0'));var ami=require(_0x5536('0x1'));var logger=require('../../../config/logger')(_0x5536('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5536('0x3'));function Acw(_0x115e57){this[_0x5536('0x4')]=_0x115e57[_0x5536('0x4')];this['agents']=_0x115e57[_0x5536('0x5')];this[_0x5536('0x6')]=_0x115e57[_0x5536('0x6')];this['channels']={};ami['on'](_0x5536('0x7'),this['syncAgentConnect'][_0x5536('0x8')](this));ami['on'](_0x5536('0x9'),this[_0x5536('0xa')][_0x5536('0x8')](this));ami['on'](_0x5536('0xb'),this[_0x5536('0xc')][_0x5536('0x8')](this));ami['on'](_0x5536('0xd'),this[_0x5536('0xe')][_0x5536('0x8')](this));ami['on']('attendedtransfer',this[_0x5536('0xf')]['bind'](this));ami['on'](_0x5536('0x10'),this['syncBlindTransfer'][_0x5536('0x8')](this));ami['on'](_0x5536('0x11'),this[_0x5536('0x12')]['bind'](this));}function getDiff(_0x3c24e6){var _0x3e4239=moment()[_0x5536('0x13')](0x0);var _0x117a0c=moment(_0x3c24e6)[_0x5536('0x13')](0x0);return _0x3e4239[_0x5536('0x14')](_0x117a0c,_0x5536('0x15'));}Acw['prototype'][_0x5536('0x16')]=function(_0x521545){try{var _0xa7e311=this;var _0xdf7e42=this[_0x5536('0x17')][_0x521545][_0x5536('0x18')];var _0x1c0e93=this[_0x5536('0x17')][_0x521545][_0x5536('0x19')];var _0xd8a1e4=this[_0x5536('0x4')][_0x1c0e93];var _0x2f7a24=![];var _0x55fe21='ACW';if(_0xd8a1e4[_0x5536('0x1a')]){if(_0xd8a1e4[_0x5536('0x1b')][_0x5536('0x1c')]){_0x2f7a24=!![];_0x55fe21=_0xd8a1e4['mandatoryDispositionPause'][_0x5536('0x1c')];}}return ami[_0x5536('0x1d')]({'action':_0x5536('0x1e'),'interface':_0xdf7e42,'paused':!![],'reason':_0x55fe21})['then'](function(){if(_0xa7e311['agents'][_0xdf7e42]){return RpcUser['getAgent'](_0xa7e311['agents'][_0xdf7e42]['id'])['then'](function(_0x176aed){if(_0x176aed&&!_0x176aed[_0x5536('0x1f')]){logger[_0x5536('0x20')](_0x5536('0x21'),_0x521545,_0xdf7e42,_0x1c0e93);var _0x5a347f=_0xa7e311[_0x5536('0x17')][_0x521545][_0x5536('0x22')]&&_0xa7e311[_0x5536('0x17')][_0x521545][_0x5536('0x23')]?_0xa7e311['channels'][_0x521545][_0x5536('0x23')]:_0x521545;return RpcUser['savePause'](_0xa7e311[_0x5536('0x5')][_0xdf7e42],_0x55fe21,_0x5a347f)[_0x5536('0x24')](function(){if(!_0x2f7a24){_0xa7e311[_0x5536('0x6')][_0xdf7e42]={};logger[_0x5536('0x20')](_0x5536('0x25'),_0x521545,_0xa7e311['voiceQueues'][_0x1c0e93][_0x5536('0x26')],_0xdf7e42,_0x1c0e93);_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x27')]=setTimeout(_0xa7e311[_0x5536('0x28')][_0x5536('0x8')](_0xa7e311,_0xdf7e42),_0xa7e311[_0x5536('0x4')][_0x1c0e93][_0x5536('0x26')]*0x3e8);_0xa7e311['timers'][_0xdf7e42]['lastPauseAt']=moment()[_0x5536('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x2a')]=_0x521545;_0xa7e311['timers'][_0xdf7e42]['queue']=_0x1c0e93;_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x2b')]=function(){var _0x4ae1c6=getDiff(_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x2c')]);clearTimeout(_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x27')]);_0xa7e311[_0x5536('0x6')][_0xdf7e42]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x4ae1c6},_0xa7e311[_0x5536('0x6')][_0xdf7e42][_0x5536('0x2a')],_0xdf7e42)[_0x5536('0x24')](function(_0x35b68c){logger[_0x5536('0x20')](_0x5536('0x2d'),_0x521545,_0x4ae1c6,_0x35b68c);})[_0x5536('0x2e')](function(_0x3a1c26){logger[_0x5536('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x521545,_0x3a1c26);});delete _0xa7e311[_0x5536('0x6')][_0xdf7e42];};}});}else{logger[_0x5536('0x20')](_0x5536('0x30'),_0x521545,_0xdf7e42,_0x1c0e93);}});}})[_0x5536('0x2e')](function(){logger[_0x5536('0x2f')](_0x5536('0x25'),_0x521545,_0xa7e311[_0x5536('0x4')][_0x1c0e93][_0x5536('0x26')],_0xdf7e42,_0x1c0e93);})[_0x5536('0x31')](function(){delete _0xa7e311[_0x5536('0x17')][_0x521545];});}catch(_0x9bb1b){logger[_0x5536('0x2f')](_0x5536('0x32'),_0x9bb1b[_0x5536('0x33')]);}};Acw[_0x5536('0x34')][_0x5536('0x28')]=function(_0x4ee7d6){try{var _0x19f136=this;if(_0x19f136['timers'][_0x4ee7d6]){_0x19f136[_0x5536('0x6')][_0x4ee7d6]['timer']=![];var _0x4d7bf0=_0x19f136[_0x5536('0x6')][_0x4ee7d6][_0x5536('0x2a')];var _0x3f7720=_0x19f136[_0x5536('0x6')][_0x4ee7d6][_0x5536('0x19')];var _0xad50f=_0x19f136[_0x5536('0x4')][_0x3f7720][_0x5536('0x26')];logger[_0x5536('0x20')](_0x5536('0x35'),_0x4d7bf0,_0x4ee7d6);RpcUser[_0x5536('0x36')](this[_0x5536('0x5')][_0x4ee7d6]);RpcVoiceAgentReport[_0x5536('0x37')]({'acwtime':_0xad50f,'agentacw':!![]},_0x4d7bf0,_0x4ee7d6)[_0x5536('0x24')](function(_0x1cdb0d){logger[_0x5536('0x20')](_0x5536('0x2d'),_0x4d7bf0,_0xad50f,_0x1cdb0d);})['catch'](function(_0x124a66){logger[_0x5536('0x2f')](_0x5536('0x38'),_0x4d7bf0,_0x124a66);});}else{logger[_0x5536('0x2f')](_0x5536('0x39'),_0x4ee7d6);if(_0x19f136[_0x5536('0x6')]){logger[_0x5536('0x20')](_0x5536('0x3a'),JSON[_0x5536('0x3b')](_0x19f136['timers']));}}}catch(_0x22a603){logger['error'](_0x5536('0x3c'),_0x22a603[_0x5536('0x33')]);}};Acw[_0x5536('0x34')][_0x5536('0x3d')]=function(_0x21126b){try{if(this['voiceQueues'][_0x21126b[_0x5536('0x19')]]&&(this['voiceQueues'][_0x21126b[_0x5536('0x19')]][_0x5536('0x2')]||this[_0x5536('0x4')][_0x21126b[_0x5536('0x19')]]['mandatoryDisposition'])){if(this[_0x5536('0x5')][_0x21126b['interface']]){this['channels'][_0x21126b[_0x5536('0x2a')]]={'queue':_0x21126b[_0x5536('0x19')],'interface':_0x21126b[_0x5536('0x18')],'destlinkedid':_0x21126b['destlinkedid']};}}}catch(_0x503d89){logger['error'](_0x5536('0x3e'),_0x503d89[_0x5536('0x33')]);}};Acw[_0x5536('0x34')][_0x5536('0x12')]=function(_0x210945){try{if(this[_0x5536('0x4')][_0x210945['queue']]&&(this[_0x5536('0x4')][_0x210945[_0x5536('0x19')]][_0x5536('0x2')]||this[_0x5536('0x4')][_0x210945[_0x5536('0x19')]][_0x5536('0x1a')])){if(this[_0x5536('0x5')][_0x210945[_0x5536('0x18')]]){this[_0x5536('0x17')][_0x210945[_0x5536('0x2a')]]={'queue':_0x210945[_0x5536('0x19')],'interface':_0x210945[_0x5536('0x18')]};}}}catch(_0x336285){logger[_0x5536('0x2f')](_0x5536('0x3f'),_0x336285[_0x5536('0x33')]);}};Acw['prototype'][_0x5536('0xa')]=function(_0x1d4f19){try{if(this[_0x5536('0x17')][_0x1d4f19[_0x5536('0x2a')]]&&_[_0x5536('0x40')](this[_0x5536('0x17')][_0x1d4f19[_0x5536('0x2a')]][_0x5536('0x22')])){logger[_0x5536('0x20')]('[%s][HANGUP:UNIQUEID]',_0x1d4f19['uniqueid']);this[_0x5536('0x16')](_0x1d4f19[_0x5536('0x2a')]);}else if(this[_0x5536('0x17')][_0x1d4f19[_0x5536('0x41')]]&&_[_0x5536('0x40')](this[_0x5536('0x17')][_0x1d4f19[_0x5536('0x41')]][_0x5536('0x22')])){logger['info'](_0x5536('0x42'),_0x1d4f19['linkedid']);this[_0x5536('0x16')](_0x1d4f19[_0x5536('0x41')]);}}catch(_0x585d13){logger[_0x5536('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x585d13[_0x5536('0x33')]);}};Acw['prototype'][_0x5536('0xc')]=function(_0x5d3018){try{if(this['channels'][_0x5d3018[_0x5536('0x2a')]]&&this[_0x5536('0x17')][_0x5d3018[_0x5536('0x2a')]][_0x5536('0x22')]){logger['info'](_0x5536('0x43'),_0x5d3018[_0x5536('0x2a')]);this['startAcw'](_0x5d3018[_0x5536('0x2a')]);}else if(this[_0x5536('0x17')][_0x5d3018[_0x5536('0x41')]]&&this[_0x5536('0x17')][_0x5d3018[_0x5536('0x41')]]['attended']){logger['info'](_0x5536('0x44'),_0x5d3018['linkedid']);this[_0x5536('0x16')](_0x5d3018[_0x5536('0x41')]);}}catch(_0x4542ad){logger[_0x5536('0x2f')](_0x5536('0x45'),_0x4542ad[_0x5536('0x33')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x317915){try{if(!_[_0x5536('0x46')](this[_0x5536('0x17')][_0x317915[_0x5536('0x47')]])){this['startAcw'](_0x317915[_0x5536('0x47')]);if(this[_0x5536('0x17')][_0x317915[_0x5536('0x48')]]){this['channels'][_0x317915['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x317915[_0x5536('0x49')]]=this[_0x5536('0x17')][_0x317915['secondtransfereruniqueid']];delete this[_0x5536('0x17')][_0x317915[_0x5536('0x48')]];}}else if(!_['isNil'](this['channels'][_0x317915['transfertargetuniqueid']])){this[_0x5536('0x16')](_0x317915[_0x5536('0x49')]);if(this[_0x5536('0x17')][_0x317915[_0x5536('0x4a')]]){this[_0x5536('0x17')][_0x317915[_0x5536('0x4a')]][_0x5536('0x22')]=!![];this[_0x5536('0x17')][_0x317915['transfereeuniqueid']]=this[_0x5536('0x17')][_0x317915[_0x5536('0x4a')]];delete this['channels'][_0x317915['origtransfereruniqueid']];}}}catch(_0x1b7bf2){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x1b7bf2['message']);}};Acw[_0x5536('0x34')][_0x5536('0x4b')]=function(_0x5c38a7){try{if(this['channels'][_0x5c38a7['transfereruniqueid']]){logger[_0x5536('0x20')](_0x5536('0x4c'),JSON['stringify'](_0x5c38a7['transfereruniqueid']));this[_0x5536('0x16')](_0x5c38a7[_0x5536('0x4d')]);}else if(this[_0x5536('0x17')][_0x5c38a7[_0x5536('0x4e')]]){logger['info'](_0x5536('0x4f'),JSON[_0x5536('0x3b')](_0x5c38a7[_0x5536('0x4e')]));this[_0x5536('0x16')](_0x5c38a7[_0x5536('0x4e')]);}}catch(_0x56fabe){logger[_0x5536('0x2f')](_0x5536('0x50'),_0x56fabe[_0x5536('0x33')]);}};Acw[_0x5536('0x34')]['syncAgentRingNoAnswer']=function(_0x45319b){try{if(this['voiceQueues'][_0x45319b[_0x5536('0x19')]]&&this['voiceQueues'][_0x45319b['queue']][_0x5536('0x51')]===_0x5536('0x52')){if(this['agents'][_0x45319b[_0x5536('0x18')]]){logger[_0x5536('0x20')](_0x5536('0x53'),_0x45319b['uniqueid'],_0x45319b[_0x5536('0x18')],_0x45319b[_0x5536('0x19')]);return RpcUser[_0x5536('0x54')](this[_0x5536('0x5')][_0x45319b[_0x5536('0x18')]],_0x5536('0x55'),_0x45319b[_0x5536('0x2a')]);}}}catch(_0x45963c){logger[_0x5536('0x2f')](_0x5536('0x56'),_0x45963c[_0x5536('0x33')]);}};module[_0x5536('0x57')]=Acw; \ No newline at end of file +var _0xc7d6=['[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','prototype','startAcw','interface','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','queue','updateAcw','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','syncAgentConnect','mandatoryDisposition','destlinkedid','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]'];(function(_0x414e29,_0x2b6db2){var _0x1b7033=function(_0x315de5){while(--_0x315de5){_0x414e29['push'](_0x414e29['shift']());}};_0x1b7033(++_0x2b6db2);}(_0xc7d6,0x1c0));var _0x6c7d=function(_0x3fb9e4,_0xe718d5){_0x3fb9e4=_0x3fb9e4-0x0;var _0x5a230c=_0xc7d6[_0x3fb9e4];return _0x5a230c;};'use strict';var _=require(_0x6c7d('0x0'));var moment=require(_0x6c7d('0x1'));var ami=require('../ami');var logger=require(_0x6c7d('0x2'))(_0x6c7d('0x3'));var RpcUser=require(_0x6c7d('0x4'));var RpcVoiceAgentReport=require(_0x6c7d('0x5'));function Acw(_0x4e7349){this[_0x6c7d('0x6')]=_0x4e7349['voiceQueues'];this['agents']=_0x4e7349[_0x6c7d('0x7')];this['timers']=_0x4e7349[_0x6c7d('0x8')];this[_0x6c7d('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x6c7d('0xa')](this));ami['on'](_0x6c7d('0xb'),this[_0x6c7d('0xc')]['bind'](this));ami['on']('hangup',this[_0x6c7d('0xd')][_0x6c7d('0xa')](this));ami['on'](_0x6c7d('0xe'),this[_0x6c7d('0xf')]['bind'](this));ami['on'](_0x6c7d('0x10'),this[_0x6c7d('0x11')][_0x6c7d('0xa')](this));ami['on']('blindtransfer',this[_0x6c7d('0x12')]['bind'](this));ami['on'](_0x6c7d('0x13'),this[_0x6c7d('0x14')][_0x6c7d('0xa')](this));}function getDiff(_0x55aa7d){var _0x35ba57=moment()['milliseconds'](0x0);var _0x58ea40=moment(_0x55aa7d)['milliseconds'](0x0);return _0x35ba57[_0x6c7d('0x15')](_0x58ea40,'seconds');}Acw[_0x6c7d('0x16')][_0x6c7d('0x17')]=function(_0x2caa0d){try{var _0x374368=this;var _0x4bb929=this[_0x6c7d('0x9')][_0x2caa0d][_0x6c7d('0x18')];var _0x2d4b84=this['channels'][_0x2caa0d]['queue'];var _0x624f77=this[_0x6c7d('0x6')][_0x2d4b84];var _0x14c665=![];var _0xdc09ec=_0x6c7d('0x19');if(_0x624f77['mandatoryDisposition']){if(_0x624f77[_0x6c7d('0x1a')][_0x6c7d('0x1b')]){_0x14c665=!![];_0xdc09ec=_0x624f77[_0x6c7d('0x1a')][_0x6c7d('0x1b')];}}return ami[_0x6c7d('0x1c')]({'action':_0x6c7d('0x1d'),'interface':_0x4bb929,'paused':!![],'reason':_0xdc09ec})[_0x6c7d('0x1e')](function(){if(_0x374368[_0x6c7d('0x7')][_0x4bb929]){return RpcUser[_0x6c7d('0x1f')](_0x374368[_0x6c7d('0x7')][_0x4bb929]['id'])[_0x6c7d('0x1e')](function(_0x372b60){if(_0x372b60&&!_0x372b60[_0x6c7d('0x20')]){logger['info'](_0x6c7d('0x21'),_0x2caa0d,_0x4bb929,_0x2d4b84);var _0x2bc2e3=_0x374368[_0x6c7d('0x9')][_0x2caa0d]['attended']&&_0x374368['channels'][_0x2caa0d]['destlinkedid']?_0x374368[_0x6c7d('0x9')][_0x2caa0d]['destlinkedid']:_0x2caa0d;return RpcUser[_0x6c7d('0x22')](_0x374368['agents'][_0x4bb929],_0xdc09ec,_0x2bc2e3)['then'](function(){if(!_0x14c665){_0x374368[_0x6c7d('0x8')][_0x4bb929]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2caa0d,_0x374368['voiceQueues'][_0x2d4b84][_0x6c7d('0x23')],_0x4bb929,_0x2d4b84);_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x24')]=setTimeout(_0x374368[_0x6c7d('0x25')][_0x6c7d('0xa')](_0x374368,_0x4bb929),_0x374368[_0x6c7d('0x6')][_0x2d4b84]['acwTimeout']*0x3e8);_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x26')]=moment()[_0x6c7d('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x374368['timers'][_0x4bb929]['uniqueid']=_0x2caa0d;_0x374368['timers'][_0x4bb929][_0x6c7d('0x28')]=_0x2d4b84;_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x29')]=function(){var _0x38e22f=getDiff(_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x26')]);clearTimeout(_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x24')]);_0x374368['timers'][_0x4bb929][_0x6c7d('0x24')]=![];RpcVoiceAgentReport[_0x6c7d('0x2a')]({'acwtime':_0x38e22f},_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x2b')],_0x4bb929)[_0x6c7d('0x1e')](function(_0x22a072){logger[_0x6c7d('0x2c')](_0x6c7d('0x2d'),_0x2caa0d,_0x38e22f,_0x22a072);})['catch'](function(_0x2152ec){logger['error'](_0x6c7d('0x2e'),_0x2caa0d,_0x2152ec);});delete _0x374368['timers'][_0x4bb929];};}});}else{logger[_0x6c7d('0x2c')](_0x6c7d('0x2f'),_0x2caa0d,_0x4bb929,_0x2d4b84);}});}})[_0x6c7d('0x30')](function(){logger[_0x6c7d('0x31')](_0x6c7d('0x32'),_0x2caa0d,_0x374368[_0x6c7d('0x6')][_0x2d4b84]['acwTimeout'],_0x4bb929,_0x2d4b84);})['finally'](function(){delete _0x374368[_0x6c7d('0x9')][_0x2caa0d];});}catch(_0x12bac8){logger['error'](_0x6c7d('0x33'),_0x12bac8['message']);}};Acw['prototype'][_0x6c7d('0x25')]=function(_0x404b1f){try{var _0xce1782=this;if(_0xce1782[_0x6c7d('0x8')][_0x404b1f]){_0xce1782[_0x6c7d('0x8')][_0x404b1f][_0x6c7d('0x24')]=![];var _0x2cd691=_0xce1782['timers'][_0x404b1f][_0x6c7d('0x2b')];var _0xfc486f=_0xce1782[_0x6c7d('0x8')][_0x404b1f][_0x6c7d('0x28')];var _0x246b76=_0xce1782[_0x6c7d('0x6')][_0xfc486f][_0x6c7d('0x23')];logger[_0x6c7d('0x2c')](_0x6c7d('0x34'),_0x2cd691,_0x404b1f);RpcUser[_0x6c7d('0x35')](this[_0x6c7d('0x7')][_0x404b1f]);RpcVoiceAgentReport[_0x6c7d('0x2a')]({'acwtime':_0x246b76,'agentacw':!![]},_0x2cd691,_0x404b1f)['then'](function(_0x56c6d9){logger[_0x6c7d('0x2c')](_0x6c7d('0x2d'),_0x2cd691,_0x246b76,_0x56c6d9);})[_0x6c7d('0x30')](function(_0x5426ae){logger[_0x6c7d('0x31')](_0x6c7d('0x2e'),_0x2cd691,_0x5426ae);});}else{logger[_0x6c7d('0x31')](_0x6c7d('0x36'),_0x404b1f);if(_0xce1782['timers']){logger['info'](_0x6c7d('0x37'),JSON['stringify'](_0xce1782[_0x6c7d('0x8')]));}}}catch(_0x14d880){logger[_0x6c7d('0x31')](_0x6c7d('0x38'),_0x14d880[_0x6c7d('0x39')]);}};Acw['prototype'][_0x6c7d('0x3a')]=function(_0x48b102){try{if(this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]]&&(this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]][_0x6c7d('0x3')]||this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]][_0x6c7d('0x3b')])){if(this[_0x6c7d('0x7')][_0x48b102['interface']]){this[_0x6c7d('0x9')][_0x48b102[_0x6c7d('0x2b')]]={'queue':_0x48b102['queue'],'interface':_0x48b102['interface'],'destlinkedid':_0x48b102[_0x6c7d('0x3c')]};}}}catch(_0x4e6ff2){logger['error'](_0x6c7d('0x3d'),_0x4e6ff2['message']);}};Acw['prototype'][_0x6c7d('0x14')]=function(_0x3246bb){try{if(this['voiceQueues'][_0x3246bb[_0x6c7d('0x28')]]&&(this[_0x6c7d('0x6')][_0x3246bb[_0x6c7d('0x28')]]['acw']||this[_0x6c7d('0x6')][_0x3246bb[_0x6c7d('0x28')]][_0x6c7d('0x3b')])){if(this[_0x6c7d('0x7')][_0x3246bb[_0x6c7d('0x18')]]){this[_0x6c7d('0x9')][_0x3246bb[_0x6c7d('0x2b')]]={'queue':_0x3246bb[_0x6c7d('0x28')],'interface':_0x3246bb[_0x6c7d('0x18')]};}}}catch(_0x372c54){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x372c54[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xc')]=function(_0x47b452){try{if(this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x2b')]]&&_[_0x6c7d('0x3e')](this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x2b')]][_0x6c7d('0x3f')])){logger['info'](_0x6c7d('0x40'),_0x47b452[_0x6c7d('0x2b')]);this[_0x6c7d('0x17')](_0x47b452[_0x6c7d('0x2b')]);}else if(this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x41')]]&&_[_0x6c7d('0x3e')](this['channels'][_0x47b452[_0x6c7d('0x41')]][_0x6c7d('0x3f')])){logger[_0x6c7d('0x2c')]('[%s][HANGUP:LINKEDID]',_0x47b452[_0x6c7d('0x41')]);this[_0x6c7d('0x17')](_0x47b452[_0x6c7d('0x41')]);}}catch(_0x2d8728){logger[_0x6c7d('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x2d8728[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xd')]=function(_0x332fc0){try{if(this[_0x6c7d('0x9')][_0x332fc0[_0x6c7d('0x2b')]]&&this['channels'][_0x332fc0[_0x6c7d('0x2b')]][_0x6c7d('0x3f')]){logger[_0x6c7d('0x2c')](_0x6c7d('0x42'),_0x332fc0[_0x6c7d('0x2b')]);this[_0x6c7d('0x17')](_0x332fc0[_0x6c7d('0x2b')]);}else if(this['channels'][_0x332fc0[_0x6c7d('0x41')]]&&this[_0x6c7d('0x9')][_0x332fc0['linkedid']]['attended']){logger[_0x6c7d('0x2c')](_0x6c7d('0x43'),_0x332fc0[_0x6c7d('0x41')]);this[_0x6c7d('0x17')](_0x332fc0['linkedid']);}}catch(_0x4d6acf){logger[_0x6c7d('0x31')](_0x6c7d('0x44'),_0x4d6acf[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0x11')]=function(_0x44c3c3){try{if(!_[_0x6c7d('0x45')](this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x46')]])){this[_0x6c7d('0x17')](_0x44c3c3[_0x6c7d('0x46')]);if(this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]]){this['channels'][_0x44c3c3[_0x6c7d('0x47')]][_0x6c7d('0x3f')]=!![];this['channels'][_0x44c3c3['transfertargetuniqueid']]=this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]];delete this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]];}}else if(!_['isNil'](this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x48')]])){this['startAcw'](_0x44c3c3[_0x6c7d('0x48')]);if(this[_0x6c7d('0x9')][_0x44c3c3['origtransfereruniqueid']]){this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x49')]][_0x6c7d('0x3f')]=!![];this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x46')]]=this[_0x6c7d('0x9')][_0x44c3c3['origtransfereruniqueid']];delete this['channels'][_0x44c3c3[_0x6c7d('0x49')]];}}}catch(_0x2b58ab){logger['error'](_0x6c7d('0x4a'),_0x2b58ab[_0x6c7d('0x39')]);}};Acw['prototype'][_0x6c7d('0x12')]=function(_0x9f9d87){try{if(this[_0x6c7d('0x9')][_0x9f9d87['transfereruniqueid']]){logger[_0x6c7d('0x2c')](_0x6c7d('0x4b'),JSON[_0x6c7d('0x4c')](_0x9f9d87[_0x6c7d('0x4d')]));this[_0x6c7d('0x17')](_0x9f9d87['transfereruniqueid']);}else if(this[_0x6c7d('0x9')][_0x9f9d87[_0x6c7d('0x4e')]]){logger[_0x6c7d('0x2c')](_0x6c7d('0x4f'),JSON[_0x6c7d('0x4c')](_0x9f9d87['transfererlinkedid']));this[_0x6c7d('0x17')](_0x9f9d87['transfererlinkedid']);}}catch(_0x40331c){logger['error'](_0x6c7d('0x50'),_0x40331c[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xf')]=function(_0x3b69e7){try{if(this[_0x6c7d('0x6')][_0x3b69e7[_0x6c7d('0x28')]]&&this[_0x6c7d('0x6')][_0x3b69e7[_0x6c7d('0x28')]]['autopause']===_0x6c7d('0x51')){if(this[_0x6c7d('0x7')][_0x3b69e7[_0x6c7d('0x18')]]){logger['info'](_0x6c7d('0x52'),_0x3b69e7[_0x6c7d('0x2b')],_0x3b69e7[_0x6c7d('0x18')],_0x3b69e7[_0x6c7d('0x28')]);return RpcUser['savePause'](this[_0x6c7d('0x7')][_0x3b69e7[_0x6c7d('0x18')]],_0x6c7d('0x53'),_0x3b69e7[_0x6c7d('0x2b')]);}}}catch(_0x253374){logger['error'](_0x6c7d('0x54'),_0x253374['message']);}};module[_0x6c7d('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e41f09c..54b041e 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 _0xc2ad=['exports','asterisk-manager','bluebird','ami','../../config/environment','asterisk','username','password','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xc2ad,0x155));var _0xdc2a=function(_0x2eb9f9,_0x46d52e){_0x2eb9f9=_0x2eb9f9-0x0;var _0x3a039b=_0xc2ad[_0x2eb9f9];return _0x3a039b;};'use strict';var Manager=require(_0xdc2a('0x0'));var BPromise=require(_0xdc2a('0x1'));var util=require('util');var logger=require('../../config/logger')(_0xdc2a('0x2'));var config=require(_0xdc2a('0x3'));var ami=new Manager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xdc2a('0x4')][_0xdc2a('0x5')],config[_0xdc2a('0x4')][_0xdc2a('0x6')],!![]);ami['keepConnected']();ami[_0xdc2a('0x7')]=BPromise['promisify'](ami[_0xdc2a('0x8')]);function error(_0x554b85){logger[_0xdc2a('0x9')](util[_0xdc2a('0xa')](_0xdc2a('0xb'),config['asterisk']['username'],config['asterisk']['ip'],config['asterisk'][_0xdc2a('0xc')],util['inspect'](_0x554b85,![],null)));}function close(){logger['error'](util[_0xdc2a('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0xdc2a('0x5')],config[_0xdc2a('0x4')]['ip'],config[_0xdc2a('0x4')]['port']));}ami[_0xdc2a('0xd')]=function(){return function(){return ami['Action']({'action':_0xdc2a('0xe')});};};ami[_0xdc2a('0xf')]=function(){return function(){return ami['Action']({'action':_0xdc2a('0x10')});};};ami[_0xdc2a('0x11')]=function(){return function(){return ami[_0xdc2a('0x7')]({'action':'sippeerstatus'});};};ami[_0xdc2a('0x12')]=function(){return function(){return ami[_0xdc2a('0x7')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0xdc2a('0x13')});};};function connect(){logger[_0xdc2a('0x14')](util[_0xdc2a('0xa')](_0xdc2a('0x15'),config[_0xdc2a('0x4')][_0xdc2a('0x5')],config['asterisk']['ip'],config[_0xdc2a('0x4')][_0xdc2a('0xc')]));ami[_0xdc2a('0x16')](_0xdc2a('0x9'),error);ami[_0xdc2a('0x16')](_0xdc2a('0x17'),close);}ami['on'](_0xdc2a('0x18'),connect);ami['on'](_0xdc2a('0x19'),function(_0x3a0ad8){logger['info'](util[_0xdc2a('0xa')](_0xdc2a('0x1a'),config[_0xdc2a('0x4')][_0xdc2a('0x5')],config['asterisk']['ip'],config[_0xdc2a('0x4')][_0xdc2a('0xc')],util[_0xdc2a('0x1b')](_0x3a0ad8,![],null)));});ami['on'](_0xdc2a('0x1c'),function(){logger[_0xdc2a('0x14')](util[_0xdc2a('0xa')](_0xdc2a('0x1d'),config['asterisk']['username'],config[_0xdc2a('0x4')]['ip'],config[_0xdc2a('0x4')][_0xdc2a('0xc')]));return Promise[_0xdc2a('0x1e')]()['then'](ami[_0xdc2a('0xd')]())[_0xdc2a('0x1f')](ami[_0xdc2a('0xf')]())[_0xdc2a('0x1f')](ami[_0xdc2a('0x11')]())['then'](ami['actionQueueSummary']())[_0xdc2a('0x1f')](ami['actionCoreShowChannels']())['catch'](function(_0x4856ec){logger[_0xdc2a('0x9')](_0xdc2a('0x20'),util['inspect'](_0x4856ec,{'showHidden':![],'depth':null}));});});ami[_0xdc2a('0x16')](_0xdc2a('0x9'),error);ami[_0xdc2a('0x16')](_0xdc2a('0x17'),close);module[_0xdc2a('0x21')]=ami; \ No newline at end of file +var _0x8f4b=['username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f4b,0xc6));var _0xb8f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f4b[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0xb8f4('0x0'));var BPromise=require(_0xb8f4('0x1'));var util=require(_0xb8f4('0x2'));var logger=require(_0xb8f4('0x3'))(_0xb8f4('0x4'));var config=require(_0xb8f4('0x5'));var ami=new Manager(config[_0xb8f4('0x6')]['port'],config['asterisk']['ip'],config['asterisk'][_0xb8f4('0x7')],config[_0xb8f4('0x6')][_0xb8f4('0x8')],!![]);ami[_0xb8f4('0x9')]();ami[_0xb8f4('0xa')]=BPromise[_0xb8f4('0xb')](ami[_0xb8f4('0xc')]);function error(_0x5a25e1){logger[_0xb8f4('0xd')](util['format'](_0xb8f4('0xe'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config['asterisk'][_0xb8f4('0xf')],util['inspect'](_0x5a25e1,![],null)));}function close(){logger[_0xb8f4('0xd')](util['format'](_0xb8f4('0x10'),config['asterisk'][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x11')});};};ami[_0xb8f4('0x12')]=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x14')});};};ami[_0xb8f4('0x15')]=function(){return function(){return ami['Action']({'action':_0xb8f4('0x16')});};};ami[_0xb8f4('0x17')]=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x18')});};};function connect(){logger[_0xb8f4('0x19')](util[_0xb8f4('0x1a')](_0xb8f4('0x1b'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));ami[_0xb8f4('0x1c')](_0xb8f4('0xd'),error);ami['once'](_0xb8f4('0x1d'),close);}ami['on'](_0xb8f4('0x1e'),connect);ami['on'](_0xb8f4('0x1f'),function(_0x153ab3){logger[_0xb8f4('0x19')](util['format'](_0xb8f4('0x20'),config[_0xb8f4('0x6')]['username'],config[_0xb8f4('0x6')]['ip'],config['asterisk'][_0xb8f4('0xf')],util[_0xb8f4('0x21')](_0x153ab3,![],null)));});ami['on'](_0xb8f4('0x22'),function(){logger[_0xb8f4('0x19')](util[_0xb8f4('0x1a')](_0xb8f4('0x23'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));return Promise[_0xb8f4('0x24')]()[_0xb8f4('0x25')](ami['actionSipShowRegistry']())[_0xb8f4('0x25')](ami[_0xb8f4('0x12')]())['then'](ami[_0xb8f4('0x26')]())[_0xb8f4('0x25')](ami[_0xb8f4('0x15')]())[_0xb8f4('0x25')](ami['actionCoreShowChannels']())['catch'](function(_0x142986){logger['error'](_0xb8f4('0x27'),util[_0xb8f4('0x21')](_0x142986,{'showHidden':![],'depth':null}));});});ami[_0xb8f4('0x1c')](_0xb8f4('0xd'),error);ami[_0xb8f4('0x1c')](_0xb8f4('0x1d'),close);module[_0xb8f4('0x28')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 4f23d42..cb3d70d 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 _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x9a51b3,_0x34ac18){var _0x4ca7b1=function(_0x455c6d){while(--_0x455c6d){_0x9a51b3['push'](_0x9a51b3['shift']());}};_0x4ca7b1(++_0x34ac18);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x549d16,_0x4d069a){var _0x344ccc=function(_0x1d992a){while(--_0x1d992a){_0x549d16['push'](_0x549d16['shift']());}};_0x344ccc(++_0x4d069a);}(_0xac4a,0x13f));var _0xaac4=function(_0xa177f8,_0x54f9e5){_0xa177f8=_0xa177f8-0x0;var _0x184280=_0xac4a[_0xa177f8];return _0x184280;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 2452774..ef7d24c 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 _0x341d=['newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangCalls','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','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','getSeconds','debug','name','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isEmpty','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','type','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','outboundDropCallsDayTimeout','state','Drop','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','createHistory','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','ListId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','agents','stateinterface','locked','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','paused','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','countagentrejectretry','dialMachineRetryFrequency','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','inUse','talking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','clearZombieChannels','[actions]','No\x20such\x20channel','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','merge','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handleIvr','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','originate\x20action\x20Error','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','handlePredictive','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','checkContactBlack','recallme','[booked][checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','available','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','getContactDialer','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\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]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x341d,0x1ea));var _0xd341=function(_0x3315e3,_0x1a3a64){_0x3315e3=_0x3315e3-0x0;var _0x704101=_0x341d[_0x3315e3];return _0x704101;};'use strict';var util=require(_0xd341('0x0'));var _=require(_0xd341('0x1'));var uuid=require('uuid');var moment=require(_0xd341('0x2'));var rr=require('rr');var Redis=require(_0xd341('0x3'));var utils=require(_0xd341('0x4'));var hopperUtils=require(_0xd341('0x5'));var ut=require(_0xd341('0x6'));var config=require(_0xd341('0x7'));var logger=require('../../../config/logger')(_0xd341('0x8'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0xd341('0x9'))(_0xd341('0xa'));var loggerPredictiveCalls=require(_0xd341('0x9'))(_0xd341('0xb'));var loggerSyncQueueSummary=require(_0xd341('0x9'))(_0xd341('0xc'));var ami=require(_0xd341('0xd'));config[_0xd341('0xe')]=_[_0xd341('0xf')](config[_0xd341('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xd341('0x10'))(new Redis(config[_0xd341('0xe')]));var cmHopper=require(_0xd341('0x11'));var voiceQueueRt=require(_0xd341('0x12'));var RpcSetting=require(_0xd341('0x13'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0xd341('0x14'));var Final=require(_0xd341('0x15'));var AgentComplete=require(_0xd341('0x16'));var QueueCallerAbandon=require(_0xd341('0x17'));var Hangup=require(_0xd341('0x18'));var ipAgi=process[_0xd341('0x19')][_0xd341('0x1a')]||_0xd341('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xd341('0x1c')][_0xd341('0x1d')]=function(_0x318c83){this[_0xd341('0x1e')]=this[_0xd341('0x1e')]?this[_0xd341('0x1e')][_0xd341('0x1f')](_0x318c83):_0x318c83();};function Dialer(_0x45d85c,_0x2088c2){this[_0xd341('0x20')]=new Sequence();this[_0xd341('0x21')]=_0x2088c2;this['voiceQueues']=_0x45d85c[_0xd341('0x22')];this[_0xd341('0x23')]=_0x45d85c[_0xd341('0x23')];this['agents']=_0x45d85c['agents'];this[_0xd341('0x24')]=_0x45d85c[_0xd341('0x24')];this[_0xd341('0x25')]=config[_0xd341('0x25')]||0x2;this[_0xd341('0x26')]={};this[_0xd341('0x27')]={};this[_0xd341('0x28')]={};this[_0xd341('0x29')]={};this[_0xd341('0x2a')]={};this['startPredictive']={};this[_0xd341('0x2b')]={};this[_0xd341('0x2c')]={};this[_0xd341('0x2d')]={};this['queueBookedRR']={};this[_0xd341('0x2e')]={};ami['on']('agentconnect',this[_0xd341('0x2f')][_0xd341('0x30')](this));ami['on']('queuecallerabandon',this[_0xd341('0x31')]['bind'](this));ami['on'](_0xd341('0x32'),this[_0xd341('0x33')][_0xd341('0x30')](this));ami['on'](_0xd341('0x34'),this[_0xd341('0x35')][_0xd341('0x30')](this));ami['on'](_0xd341('0x36'),this[_0xd341('0xc')][_0xd341('0x30')](this));ami['on'](_0xd341('0x37'),this[_0xd341('0x38')][_0xd341('0x30')](this));ami['on']('hangup',this['syncHangup'][_0xd341('0x30')](this));ami['on'](_0xd341('0x39'),this['syncNewExten'][_0xd341('0x30')](this));ami['on'](_0xd341('0x3a'),this[_0xd341('0x3b')][_0xd341('0x30')](this));ami['on'](_0xd341('0x3c'),this['syncQueueMember']['bind'](this));ami['on'](_0xd341('0x3d'),this[_0xd341('0x3e')][_0xd341('0x30')](this));this['loopCampaigns']();this[_0xd341('0x3f')]();RpcSetting[_0xd341('0x40')]()[_0xd341('0x41')](function(_0x24e384){previewRecallmeReminderInterval=_0x24e384[_0xd341('0x42')];});}function isNotNull(_0xccfe38){return _0xccfe38!==null&&!_[_0xd341('0x43')](_0xccfe38);}function msgResponse(_0x4dc1a0,_0xdced6d,_0x410979){return{'action':_0x4dc1a0,'response':_0xdced6d,'message':_0x410979,'stack':_0x410979};}function emit(_0x33161f,_0x16cf19,_0x6fb4a0){io['to'](_0x33161f)[_0xd341('0x44')](_0x16cf19,_0x6fb4a0);}function emitOutboundVoiceQueueSummary(_0x3d76e6){if(_0x3d76e6['type']===_0xd341('0x45')){logger['debug'](_0xd341('0x46'),util[_0xd341('0x47')](_0x3d76e6,{'showHidden':![],'depth':null}));emit(util[_0xd341('0x48')](_0xd341('0x49'),_0x3d76e6['name']),_0xd341('0x4a'),_0x3d76e6);}}function checkGetDataPredictive(_0x2536af){if(isNotNull(_0x2536af)&&!_['isEmpty'](_0x2536af)){loggerPredictive[_0xd341('0x4b')](_0xd341('0x4c'));loggerPredictive[_0xd341('0x4b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2536af[_0xd341('0x4d')]);loggerPredictive[_0xd341('0x4b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2536af[_0xd341('0x4e')]);loggerPredictive['info'](_0xd341('0x4f'),_0x2536af[_0xd341('0x50')]);loggerPredictive[_0xd341('0x4b')](_0xd341('0x51'),_0x2536af[_0xd341('0x52')]);loggerPredictive[_0xd341('0x4b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2536af[_0xd341('0x53')]);loggerPredictive[_0xd341('0x4b')](_0xd341('0x54'),_0x2536af[_0xd341('0x55')]);loggerPredictive[_0xd341('0x4b')]('---------------------------');if(_0x2536af[_0xd341('0x4d')]>0x0){if(!_['isUndefined'](_0x2536af['predictiveIntervalAvgTalktime'])&&_0x2536af[_0xd341('0x55')]>0x0){return!![];}loggerPredictive[_0xd341('0x4b')](_0xd341('0x56'));if(!_[_0xd341('0x43')](_0x2536af[_0xd341('0x53')])&&_0x2536af[_0xd341('0x53')]>0x0){return!![];}loggerPredictive[_0xd341('0x4b')](_0xd341('0x57'));}else{loggerPredictive[_0xd341('0x4b')](_0xd341('0x58'));}}else{loggerPredictive[_0xd341('0x4b')](_0xd341('0x59'));}return![];}function mergeDataErlangB(_0x40e679){return function(_0x39ac4e){loggerPredictive['info'](_0xd341('0x5a'));loggerPredictive[_0xd341('0x4b')](_0xd341('0x5b'),_0x39ac4e[_0xd341('0x5c')]);loggerPredictive['info'](_0xd341('0x5d'),_0x39ac4e['erlangCallToSecond']);loggerPredictive[_0xd341('0x4b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39ac4e['erlangAbandonmentRate']);loggerPredictive[_0xd341('0x4b')](_0xd341('0x5e'),_0x39ac4e[_0xd341('0x5f')]);loggerPredictive[_0xd341('0x4b')](_0xd341('0x60'),_0x39ac4e[_0xd341('0x61')]);loggerPredictive[_0xd341('0x4b')](_0xd341('0x62'));_['merge'](_0x40e679,_0x39ac4e);};}function ifInterval(_0x37aaf5,_0xaa0057){if(_[_0xd341('0x43')](_0xaa0057)){return![];}return utils[_0xd341('0x63')](undefined,_0xaa0057)<_0x37aaf5*0x3c;}function clearPredictiveAttributes(_0x314f08){if(_0x314f08[_0xd341('0x2b')]){_0x314f08['startProgressive']=undefined;loggerPredictive[_0xd341('0x64')](_0x314f08[_0xd341('0x65')],_0xd341('0x66'));}if(_0x314f08[_0xd341('0x67')]){_0x314f08[_0xd341('0x67')]=undefined;loggerPredictive[_0xd341('0x64')](_0x314f08[_0xd341('0x65')],_0xd341('0x68'));}if(_0x314f08['handlePredictive']){clearInterval(_0x314f08['handlePredictive']);_0x314f08['handlePredictive']=undefined;loggerPredictive[_0xd341('0x64')](_0x314f08[_0xd341('0x65')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x358ca5,_0x78a7dd){return function(_0x5d2c14){loggerPredictive['error'](_0x78a7dd[_0xd341('0x65')],_0x358ca5);loggerPredictive[_0xd341('0x69')](_0x5d2c14[_0xd341('0x6a')]);clearPredictiveAttributes(_0x78a7dd);};}function loggerCatch(_0x479af8){return function(_0x42e2a2){logger['error'](_0x479af8,util['inspect'](_0x42e2a2,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xf19c64,_0x16d00e,_0x1baf2c){return function(_0xa18cdd){utils[_0xd341('0x6b')](_0x16d00e,_0x1baf2c,0x0);logger[_0xd341('0x69')](_0xf19c64,util['inspect'](_0xa18cdd,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x32c88d){return function(_0x596b65){if(isNotNull(_0x596b65)&&isNotNull(_0x596b65[0x0])){if(_0x596b65[0x0][_0xd341('0x6c')]>0x0){_0x32c88d[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS'][_0xd341('0x6e')];logger['info'](_0xd341('0x6f')+_0x32c88d[_0xd341('0x65')],_0x596b65[0x0][_0xd341('0x6c')],_0xd341('0x70'));}else{_0x32c88d[_0xd341('0x6d')]=utils[_0xd341('0x71')]['NO_AVAILABLE_CONTACTS'];logger[_0xd341('0x4b')]('[getContactDialer2][Empty]'+_0x32c88d['name']);}}};}function createObjHistory(_0x5b832c,_0x4175d3,_0x582f53,_0xef251f,_0x3bc108){_0x5b832c[_0xd341('0x6d')]=_0x582f53;var _0x40d3aa=new Action(_0x5b832c,_0x4175d3);var _0x4ce0a0=new History(_0x40d3aa);_0x4ce0a0['state']=_0xef251f;_0x4ce0a0[_0xd341('0x72')]=_0x3bc108;_0x4ce0a0[_0xd341('0x73')]=_0x40d3aa[_0xd341('0x74')];return _0x4ce0a0;}function unlockQueueStatus(_0x48f5c1,_0x3e421f){setTimeout(function(){if(_[_0xd341('0x43')](_0x48f5c1[_0xd341('0x75')])){loggerBooked['error'](_0xd341('0x76'),_0x3e421f);}_0x48f5c1[_0xd341('0x75')]=!![];loggerBooked[_0xd341('0x4b')](_0xd341('0x77'),_0x3e421f,JSON[_0xd341('0x78')](_[_0xd341('0x79')](_0x48f5c1,[_0xd341('0x65'),_0xd341('0x75')])));},0x1f3);}function checkInterval(_0x358768){return function(){if(!isNotNull(_0x358768[_0xd341('0x7a')])){_0x358768['message']=utils[_0xd341('0x71')][_0xd341('0x7b')];throw _0x358768[_0xd341('0x65')]+_0xd341('0x7c');}if(!isNotNull(_0x358768['Interval']['Intervals'])){_0x358768['message']=utils[_0xd341('0x71')][_0xd341('0x7b')];throw _0x358768[_0xd341('0x65')]+_0xd341('0x7c');}if(!isNotNull(_[_0xd341('0x7d')](_0x358768['Interval']['Intervals']))){_0x358768['message']=utils['CAMPAIGN_STATUS'][_0xd341('0x7b')];throw _0x358768['name']+_0xd341('0x7c');}};}function checkIsIVRCampaignActive(_0x2b8475){return function(){if(!utils['isIVRCampaignActive'](_0x2b8475)){_0x2b8475['message']=utils['CAMPAIGN_STATUS'][_0xd341('0x7e')];throw _0x2b8475[_0xd341('0x65')]+_0xd341('0x7f');}};}function emitCampaignSummary(_0x2c2965){if(utils[_0xd341('0x80')](_0x2c2965)){emit(util[_0xd341('0x48')](_0xd341('0x81'),_0x2c2965[_0xd341('0x65')]),'campaign:save',_0x2c2965);}}function loggerCatchQueueSummary(_0x1c2363,_0x9e7c4a){return function(_0x5afdee){clearPredictiveAttributes(_0x9e7c4a);emitCampaignSummary(_0x9e7c4a);loggerSyncQueueSummary[_0xd341('0x64')](_0x1c2363,util[_0xd341('0x47')](_0x5afdee,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x58b90d){if(_0x58b90d['sendMessageOneNotActive']){if(_0x58b90d[_0xd341('0x82')]===0x0){_0x58b90d[_0xd341('0x83')]=![];_0x58b90d[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0xd341('0x64')](_0xd341('0x84'),_0x58b90d[_0xd341('0x65')],_0xd341('0x85'));}else{_0x58b90d[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary['debug'](_0xd341('0x84'),_0x58b90d[_0xd341('0x65')],_0xd341('0x86'));}emitCampaignSummary(_0x58b90d);}}function myreject(_0x4b3770){return function(_0x4201e4){return _0x4b3770(msgResponse(_0xd341('0x87'),_0xd341('0x88'),JSON[_0xd341('0x78')](_0x4201e4)));};}Dialer[_0xd341('0x1c')][_0xd341('0x89')]=function(_0x1c73e2){return!_['isUndefined'](_0x1c73e2)&&_0x1c73e2&&!_['isUndefined'](_0x1c73e2[_0xd341('0x65')])&&!_[_0xd341('0x43')](_0x1c73e2[_0xd341('0x8a')])&&_0x1c73e2[_0xd341('0x8a')]&&(this[_0xd341('0x24')][util['format'](_0xd341('0x8b'),_0x1c73e2[_0xd341('0x65')])]['status']==='reachable'||this[_0xd341('0x24')][util['format'](_0xd341('0x8b'),_0x1c73e2[_0xd341('0x65')])][_0xd341('0x8c')]===_0xd341('0x8d'));};Dialer[_0xd341('0x1c')][_0xd341('0x8e')]=function(_0x343902){var _0xfd9984=this;return function(){if(!_0xfd9984['isTrunkReachable'](_0x343902[_0xd341('0x8f')])){if(!_0xfd9984[_0xd341('0x89')](_0x343902['TrunkBackup'])){_0x343902[_0xd341('0x6d')]=utils[_0xd341('0x71')][_0xd341('0x90')];throw _0x343902[_0xd341('0x65')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xd341('0x1c')][_0xd341('0x91')]=function(_0xd8f25,_0x12aa14,_0x5bd43f,_0x537e4e){var _0x4952d3=this;return function(){var _0x280d1f=!![];return _0x4952d3[_0xd341('0x92')](_0xd8f25,_0x12aa14,_0x5bd43f,_0x537e4e,_0x280d1f);};};Dialer[_0xd341('0x1c')][_0xd341('0x93')]=function(_0x3e034d,_0x4c05b3,_0xd2be2a,_0x365c86){var _0x1555c8=this;return function(){var _0x14209e=![];return _0x1555c8[_0xd341('0x92')](_0x3e034d['Intervals'],_0x4c05b3,_0xd2be2a,_0x365c86,_0x14209e);};};Dialer[_0xd341('0x1c')][_0xd341('0x92')]=function(_0x5770d3,_0x2b7b3c,_0x198117,_0x358251,_0x51c731){var _0xb2066a=[];return new Promise(function(_0x18580a,_0x5eca0e){if(!isNotNull(_0x5770d3)){_0x358251[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x5eca0e(msgResponse(_0xd341('0x94'),_0xd341('0x95'),_0x198117+_0xd341('0x96')));}if(_[_0xd341('0x7d')](_0x5770d3)){_0x358251[_0xd341('0x6d')]=utils[_0xd341('0x71')][_0xd341('0x97')];return _0x5eca0e(msgResponse(_0xd341('0x94'),_0xd341('0x95'),_0x198117+'\x20Intervals\x20is\x20empty\x20'));}if(_0x2b7b3c&&_[_0xd341('0x43')](config[_0xd341('0x98')][_0x2b7b3c])){_0x358251['message']=utils['CAMPAIGN_STATUS'][_0xd341('0x99')];return _0x5eca0e(msgResponse(_0xd341('0x94'),_0xd341('0x95'),_0x198117+_0xd341('0x9a')+_0x2b7b3c));}if(_[_0xd341('0x9b')](_0x5770d3)){for(var _0x3c8ff0=0x0;_0x3c8ff0<_0x5770d3[_0xd341('0x9c')];_0x3c8ff0+=0x1){_0xb2066a[_0xd341('0x9d')](ami[_0xd341('0x9e')]({'action':_0xd341('0x9f'),'command':util[_0xd341('0x48')](_0xd341('0xa0'),_0x5770d3[_0x3c8ff0][_0xd341('0xa1')],!_[_0xd341('0x43')](config['timezones'][_0x2b7b3c])?_0x2b7b3c:'')})[_0xd341('0x41')](function(_0x20c9c8){return _0x20c9c8[_0xd341('0xa2')][_0xd341('0xa3')](_0xd341('0xa4'))>=0x0;})[_0xd341('0xa5')](myreject(_0x5eca0e)));}}else{_0xb2066a[_0xd341('0x9d')](ami['Action']({'action':'command','command':util['format']('iftime\x20%s,%s',_0x5770d3,!_[_0xd341('0x43')](config[_0xd341('0x98')][_0x2b7b3c])?_0x2b7b3c:'')})[_0xd341('0x41')](function(_0x4faa58){return _0x4faa58['content']['indexOf']('true')>=0x0;})[_0xd341('0xa5')](myreject(_0x5eca0e)));}Promise['all'](_0xb2066a)[_0xd341('0x41')](function(_0x23e8e0){var _0x41fa3f=_[_0xd341('0xa6')](_0x23e8e0);if(_0x41fa3f){return _0x18580a(_0x41fa3f);}else{_0x358251['message']=_0x51c731?utils[_0xd341('0x71')][_0xd341('0xa7')]:utils[_0xd341('0x71')][_0xd341('0xa8')];return _0x5eca0e(msgResponse(_0xd341('0xa9'),'Failure',_0xd341('0xaa')+_0x51c731+'\x20'+_0x198117+_0xd341('0xab')+util[_0xd341('0x47')](_0x5770d3,{'showHidden':![],'depth':null})+_0xd341('0xac')+_0x2b7b3c));}})[_0xd341('0xa5')](function(_0x5879d5){return _0x5eca0e(msgResponse(_0xd341('0x94'),_0xd341('0x95'),JSON[_0xd341('0x78')](_0x5879d5)));});});};Dialer[_0xd341('0x1c')][_0xd341('0xad')]=function(){var _0x5b0592=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5b0592[_0xd341('0xae')]();},0x3e8);});};Dialer[_0xd341('0x1c')][_0xd341('0xae')]=function(){var _0x45fce1=this;var _0x1a1f57;for(var _0xea99c1 in this[_0xd341('0x23')]){if(typeof this['campaigns'][_0xea99c1]!==_0xd341('0xaf')){_0x1a1f57=this[_0xd341('0x23')][_0xea99c1];if(utils[_0xd341('0x80')](_0x1a1f57)&&utils['isIVRCampaignActive'](_0x1a1f57)){_0x1a1f57[_0xd341('0x83')]=!![];Promise[_0xd341('0xb0')]()[_0xd341('0x41')](checkIsIVRCampaignActive(_0x1a1f57))[_0xd341('0x41')](checkInterval(_0x1a1f57))[_0xd341('0x41')](_0x45fce1['checkIsTrunkReachable'](_0x1a1f57))[_0xd341('0x41')](_0x45fce1['checkIfTime'](_0x1a1f57[_0xd341('0xb1')],_0x1a1f57[_0xd341('0xb2')],_0x1a1f57[_0xd341('0x65')],_0x1a1f57))[_0xd341('0x41')](_0x45fce1[_0xd341('0x93')](_0x1a1f57[_0xd341('0x7a')],_0x1a1f57[_0xd341('0xb2')],_0x1a1f57['name'],_0x1a1f57))[_0xd341('0x41')](_0x45fce1[_0xd341('0xb3')](_0x1a1f57))[_0xd341('0xa5')](loggerCatchQueueSummary(_0xd341('0xb4'),_0x1a1f57));}else{notSendMessagesCampaign(_0x1a1f57);}}}};Dialer[_0xd341('0x1c')][_0xd341('0xb5')]=function(_0x5e6430){if(_0x5e6430[_0xd341('0xb6')]!==_0xd341('0xa')){clearPredictiveAttributes(_0x5e6430);}switch(_0x5e6430[_0xd341('0xb6')]){case'progressive':this[_0xd341('0xb7')](_0x5e6430,0x1);break;case _0xd341('0xb8'):this[_0xd341('0xb7')](_0x5e6430,_0x5e6430[_0xd341('0xb9')]);break;case _0xd341('0xa'):this[_0xd341('0xa')](_0x5e6430);break;case _0xd341('0xba'):this[_0xd341('0xb7')](_0x5e6430,0x1);break;default:logger[_0xd341('0x69')](_0xd341('0xbb'),_0x5e6430['name'],'method\x20not\x20recognized');}};Dialer[_0xd341('0x1c')][_0xd341('0x94')]=function(_0x22feef,_0x5c8386){var _0x40a589=_0x22feef[_0xd341('0xb2')];var _0x2e0e24=_0x5c8386?_0x22feef[_0xd341('0xb1')]:_0x22feef[_0xd341('0x7a')]['Intervals'];logger[_0xd341('0xbc')](_0xd341('0xbd'),_0x2e0e24,_0x40a589,_0x22feef[_0xd341('0x65')],util['format'](_0xd341('0xbe'),_0x22feef[_0xd341('0x65')],_0x22feef['id']));var _0x4917fe=null;return Interval[_0xd341('0xbf')](_0x2e0e24,_0x40a589)[_0xd341('0x41')](function(_0x1f02d2){if(_0x1f02d2===!![]){return _0x1f02d2;}else{_0x22feef[_0xd341('0x6d')]=_0x5c8386?utils[_0xd341('0x71')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xd341('0x71')][_0xd341('0xa8')];_0x4917fe=msgResponse('[ifTime][promiseAll]',_0xd341('0x95'),'Global:\x20'+_0x5c8386+'\x20'+_0x22feef['name']+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x2e0e24,{'showHidden':![],'depth':null})+_0xd341('0xac')+_0x40a589);}if(_0x4917fe!==null){logger['silly'](_0xd341('0xc0'),_0x4917fe);_0x4917fe[_0xd341('0xc1')]=_0x5c8386;throw _0x4917fe;}})[_0xd341('0xa5')](function(_0x186442){logger['error']('AMI\x20IfTime',_0x186442);throw msgResponse('[ifTime][Action]','Error',util[_0xd341('0x47')](_0x186442,{'showHidden':![],'depth':null}));});};Dialer[_0xd341('0x1c')][_0xd341('0x2f')]=function(_0x59ea62){if(this[_0xd341('0x22')][_0x59ea62[_0xd341('0xc2')]]){if(this[_0xd341('0x29')][_0x59ea62[_0xd341('0xc3')]]&&this[_0xd341('0x29')][_0x59ea62[_0xd341('0xc3')]][_0xd341('0xc4')]!==_0xd341('0xc5')){this['updateOriginated'](this['voiceQueues'][_0x59ea62[_0xd341('0xc2')]]);this[_0xd341('0x29')][_0x59ea62['uniqueid']][_0xd341('0xc6')]=moment()[_0xd341('0x48')](_0xd341('0xc7'));}}};Dialer[_0xd341('0x1c')][_0xd341('0x35')]=function(_0x5808f8){var _0x1a1816=this[_0xd341('0x29')][_0x5808f8[_0xd341('0xc3')]];if(this[_0xd341('0x22')][_0x5808f8[_0xd341('0xc2')]]){if(_0x1a1816&&_0x1a1816[_0xd341('0xc4')]!=='ivr'){delete this['uniqueId'][_0x5808f8[_0xd341('0xc3')]];this[_0xd341('0x22')][_0x5808f8[_0xd341('0xc2')]][_0xd341('0xc8')]+=0x1;var _0x4a1cad=new AgentComplete(_0x1a1816,_0x5808f8);if(_0x5808f8[_0xd341('0xc9')]===_0xd341('0xca')){_0x4a1cad[_0xd341('0xcb')]=this['voiceQueues'][_0x5808f8[_0xd341('0xc2')]][_0xd341('0xcc')]&&this[_0xd341('0x22')][_0x5808f8[_0xd341('0xc2')]][_0xd341('0xcd')]?moment()[_0xd341('0x48')](_0xd341('0xc7')):undefined;}hopperUtils['createHistory'](_0x4a1cad)['catch'](loggerCatch(_0xd341('0xce')));hopperUtils[_0xd341('0xcf')](_0x4a1cad)['catch'](loggerCatch(_0xd341('0xd0')));}}};Dialer[_0xd341('0x1c')][_0xd341('0x31')]=function(_0x111b91){var _0x2c38b4=this[_0xd341('0x29')][_0x111b91[_0xd341('0xc3')]];var _0x2a2573=this;var _0x3843ec=![];var _0x5d8155;var _0x4a50e8;if(this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]){if(_0x2c38b4&&_0x2c38b4[_0xd341('0xc4')]!==_0xd341('0xc5')){delete this[_0xd341('0x29')][_0x111b91[_0xd341('0xc3')]];this[_0xd341('0xd1')](this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]);_0x2c38b4[_0xd341('0xd2')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x28784c=new QueueCallerAbandon(_0x2c38b4,_0x111b91);if(utils[_0xd341('0x63')](_0x2c38b4[_0xd341('0xd2')],_0x2c38b4[_0xd341('0xd3')])>=_0x2c38b4['dialQueueTimeout']){this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xd341('0x22')][_0x111b91['queue']][_0xd341('0xd4')]+=0x1;this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x28784c[_0xd341('0xd5')]=0xa;_0x28784c[_0xd341('0x72')]=_0xd341('0xd6');_0x28784c['dropreason']=_0xd341('0xd7');_0x28784c[_0xd341('0xcb')]=this['voiceQueues'][_0x111b91[_0xd341('0xc2')]][_0xd341('0xcc')]?moment()[_0xd341('0x48')](_0xd341('0xc7')):undefined;_0x28784c[_0xd341('0xd8')]+=0x1;_0x28784c[_0xd341('0xd9')]+=0x1;_0x5d8155=this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]['dialDropRetryFrequency'];_0x4a50e8=this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]][_0xd341('0xda')];hopperUtils['verifyAdditionalPhones'](_0x28784c,_0x28784c[_0xd341('0xd5')],_0x2c38b4[_0xd341('0xdb')])[_0xd341('0x41')](function(_0x2bdaa9){_0x3843ec=_0x2bdaa9[_0xd341('0xdc')]==0x1;if(_0x28784c[_0xd341('0xd8')]>=_0x2a2573[_0xd341('0x22')][_0x111b91['queue']][_0xd341('0xdd')]){_0x2a2573[_0xd341('0xde')](_0x28784c,_0x2bdaa9[_0xd341('0xdc')]);}else{hopperUtils[_0xd341('0xdf')]({'active':![],'countdropretry':_0x28784c[_0xd341('0xd8')],'scheduledat':moment()[_0xd341('0xe0')](_0x2a2573[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]]['dialDropRetryFrequency'],_0xd341('0xe1'))[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x2c38b4[_0xd341('0xe2')],'ListId':_0x2c38b4['ListId'],'VoiceQueueId':_0x2c38b4[_0xd341('0xe3')]||undefined,'CampaignId':_0x2c38b4[_0xd341('0xe4')]||undefined})['catch'](loggerCatch(_0xd341('0xe5')));var _0x4e5d99=new History(_0x28784c);_0x4e5d99[_0xd341('0xd5')]=0xa;_0x4e5d99[_0xd341('0x72')]='Drop';_0x4e5d99[_0xd341('0x74')]=moment()[_0xd341('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e5d99['endtime']=_0x4e5d99['starttime'];_0x4e5d99[_0xd341('0xe6')]=_0x28784c['calleridname'];_0x4e5d99[_0xd341('0xe7')]=_0x28784c[_0xd341('0xe7')];hopperUtils[_0xd341('0xe8')](_0x4e5d99)[_0xd341('0xa5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xd341('0x41')](function(){if(_0x3843ec)hopperUtils[_0xd341('0xe9')](_0x28784c,_0x5d8155,_0x4a50e8)['then'](function(){return 0x1;});});}else{this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]][_0xd341('0x52')]+=0x1;this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]][_0xd341('0xea')]+=0x1;_0x28784c[_0xd341('0xd5')]=0xb;_0x28784c[_0xd341('0x72')]=_0xd341('0xeb');_0x28784c[_0xd341('0xec')]='CALLEREXIT';_0x28784c[_0xd341('0xed')]+=0x1;_0x28784c[_0xd341('0xd9')]+=0x1;_0x5d8155=this['voiceQueues'][_0x111b91[_0xd341('0xc2')]][_0xd341('0xee')];_0x4a50e8=this[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]][_0xd341('0xda')];hopperUtils[_0xd341('0xef')](_0x28784c,_0x28784c[_0xd341('0xd5')],_0x2c38b4[_0xd341('0xdb')])[_0xd341('0x41')](function(_0x1f9ccf){if(_0x28784c[_0xd341('0xed')]>=_0x2a2573[_0xd341('0x22')][_0x111b91[_0xd341('0xc2')]][_0xd341('0xf0')]){_0x2a2573['queueCallerAbandonCreateState'](_0x28784c,_0x1f9ccf['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x28784c[_0xd341('0xed')],'scheduledat':moment()[_0xd341('0xe0')](_0x2a2573[_0xd341('0x22')][_0x111b91['queue']][_0xd341('0xee')],_0xd341('0xe1'))['format'](_0xd341('0xc7')),'ContactId':_0x2c38b4[_0xd341('0xe2')],'ListId':_0x2c38b4[_0xd341('0xf1')],'VoiceQueueId':_0x2c38b4[_0xd341('0xe3')]||undefined,'CampaignId':_0x2c38b4['CampaignId']||undefined})['catch'](loggerCatch(_0xd341('0xf2')));var _0x464a61=new History(_0x28784c);_0x464a61[_0xd341('0xd5')]=0xb;_0x464a61['statedesc']=_0xd341('0xeb');_0x464a61[_0xd341('0x74')]=moment()['format'](_0xd341('0xc7'));_0x464a61[_0xd341('0x73')]=_0x464a61[_0xd341('0x74')];_0x464a61['calleridname']=_0x28784c[_0xd341('0xe6')];_0x464a61[_0xd341('0xe7')]=_0x28784c[_0xd341('0xe7')];hopperUtils[_0xd341('0xe8')](_0x464a61)[_0xd341('0xa5')](loggerCatch(_0xd341('0xf3')));}})['then'](function(){if(_0x3843ec)hopperUtils[_0xd341('0xe9')](_0x28784c,_0x5d8155,_0x4a50e8)[_0xd341('0x41')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x19a28a){if(this[_0xd341('0x27')][_0x19a28a[_0xd341('0xc3')]]){this['actions'][_0x19a28a[_0xd341('0xc3')]][_0xd341('0xf4')]=_0x19a28a[_0xd341('0xf4')];}if(this[_0xd341('0x29')][_0x19a28a['uniqueid']]){this[_0xd341('0x29')][_0x19a28a['uniqueid']][_0xd341('0xf4')]=_0x19a28a[_0xd341('0xf4')];}};Dialer[_0xd341('0x1c')]['syncQueueMember']=function(_0x30bd6c){if(!this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]]){return;}var _0x10c1c6=this[_0xd341('0x22')][this[_0xd341('0x27')][_0x30bd6c['actionid']]['queue']][_0xd341('0xf6')]||_0xd341('0xf7');if(_0x10c1c6===_0xd341('0xf8')){if(this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]]&&_[_0xd341('0xf9')](this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]]['locked'])&&_0x30bd6c[_0xd341('0x8c')]==='1'&&_0x30bd6c['paused']==='0'){if(this[_0xd341('0xfa')][_0x30bd6c[_0xd341('0xfb')]]){if(!this[_0xd341('0xfa')][_0x30bd6c[_0xd341('0xfb')]][_0xd341('0xfc')]){this[_0xd341('0xfa')][_0x30bd6c[_0xd341('0xfb')]][_0xd341('0xfc')]=!![];this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]][_0xd341('0xfc')]=!![];this['actions'][_0x30bd6c['actionid']][_0xd341('0xfb')]=_0x30bd6c[_0xd341('0xfb')];}}}}else if(_0x10c1c6===_0xd341('0xf7')){if(this['actions'][_0x30bd6c[_0xd341('0xf5')]]){if(this[_0xd341('0xfa')][_0x30bd6c[_0xd341('0xfb')]]){this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]][_0xd341('0xfb')]=_0x30bd6c['stateinterface'];if(_[_0xd341('0xf9')](this[_0xd341('0x2d')][this['actions'][_0x30bd6c[_0xd341('0xf5')]]['queue']])){this[_0xd341('0x2d')][this['actions'][_0x30bd6c[_0xd341('0xf5')]][_0xd341('0xc2')]]=[];}this[_0xd341('0x2d')][this['actions'][_0x30bd6c[_0xd341('0xf5')]][_0xd341('0xc2')]][_0xd341('0x9d')](_['merge'](_[_0xd341('0x79')](this[_0xd341('0x27')][_0x30bd6c[_0xd341('0xf5')]],['idHopper',_0xd341('0xfb')]),{'status':_0x30bd6c['status'],'paused':_0x30bd6c['paused']}));}}}};Dialer[_0xd341('0x1c')][_0xd341('0x3e')]=function(_0x57a2be){if(!this['actions'][_0x57a2be[_0xd341('0xf5')]]){return;}var _0xf475bf=this;var _0x23f718=this['voiceQueues'][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]];var _0x33e9b8=_0x23f718[_0xd341('0xf6')]||_0xd341('0xf7');if(_0x33e9b8===_0xd341('0xf8')){if(this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]&&this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['stateinterface']){this[_0xd341('0x21')][_0xd341('0xfd')](this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xfe')],this[_0xd341('0x27')][_0x57a2be['actionid']][_0xd341('0xfb')])['catch'](function(_0xa294b2){logger[_0xd341('0x69')](_0xd341('0xff'),util[_0xd341('0x47')](_0xa294b2,{'showHidden':![],'depth':null}));})[_0xd341('0x1f')](function(){_0xf475bf[_0xd341('0xd1')](_0xf475bf[_0xd341('0x22')][_0xf475bf[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]]);_0xf475bf[_0xd341('0xfa')][_0xf475bf[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['stateinterface']][_0xd341('0xfc')]=![];delete _0xf475bf['actions'][_0x57a2be[_0xd341('0xf5')]];unlockQueueStatus(_0x23f718);});}else{this[_0xd341('0xd1')](this[_0xd341('0x22')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]]);hopperUtils[_0xd341('0xdf')]({'active':![],'ContactId':this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xe2')],'ListId':this['actions'][_0x57a2be[_0xd341('0xf5')]]['ListId'],'VoiceQueueId':this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xd341('0x27')][_0x57a2be['actionid']];unlockQueueStatus(_0x23f718);}}else if(_0x33e9b8==='rrmemory'){var _0x4ce00e;if(this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]&&!_[_0xd341('0x7d')](this[_0xd341('0x2d')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['queue']])){if(this[_0xd341('0x100')][_0xf475bf[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['queue']]){this[_0xd341('0x100')][_0xf475bf['actions'][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]]=this[_0xd341('0x100')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]]?this[_0xd341('0x100')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]]:this[_0xd341('0x2d')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['queue']]?this[_0xd341('0x2d')][this[_0xd341('0x27')][_0x57a2be['actionid']][_0xd341('0xc2')]][_0xd341('0x101')]||0x0:0x0;}this[_0xd341('0x2d')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]][_0xd341('0xc2')]][_0xd341('0x101')]=this[_0xd341('0x100')][this[_0xd341('0x27')][_0x57a2be[_0xd341('0xf5')]]['queue']];for(var _0x843742=0x0;_0x843742=_0x14aed6[_0xd341('0x123')]){_0x4cd2db[_0xd341('0x124')](_0x4b932e,_0x3f6012,_0x148c68,_0xd341('0x125'));}else{if(_0x4b932e[_0xd341('0x120')]>=_0x14aed6[_0xd341('0x126')]){_0x4cd2db[_0xd341('0x127')](_0x4b932e,_0x3f6012,_0x148c68,_0xd341('0x128'));}else{hopperUtils[_0xd341('0xdf')]({'active':![],'countmachineretry':_0x4b932e[_0xd341('0x120')],'scheduledat':moment()[_0xd341('0xe0')](_0x14aed6['dialMachineRetryFrequency'],_0xd341('0xe1'))[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x4b932e[_0xd341('0xe2')],'ListId':_0x4b932e[_0xd341('0xf1')],'VoiceQueueId':_0x4b932e[_0xd341('0xe3')]||undefined,'CampaignId':_0x4b932e[_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x129')));_0x3f6012({'reschedule':0x1});}}});}if(_0x563ac8[_0xd341('0xc4')]===_0xd341('0xc5')&&this[_0xd341('0x23')][_0x563ac8['queue']][_0xd341('0x11d')]&&_0x1e915a['value']==='HANGUP'){delete this[_0xd341('0x29')][_0x1e915a['uniqueid']];this[_0xd341('0xd1')](this['campaigns'][_0x563ac8[_0xd341('0xc2')]]);_0xaae5bc=new Hangup(_0x563ac8,_0x1e915a);_0xaae5bc['state']=0x12;_0xaae5bc[_0xd341('0x72')]='HangupInAMD';_0xaae5bc[_0xd341('0x117')]=_0xd341('0x118');ami['emit'](_0xd341('0x119'),ut['buildObj'](_0xaae5bc,_0xd341('0x11b')));this[_0xd341('0x11c')](_0xaae5bc,_0xd341('0x12a'),_0xd341('0x12b'));}if(_0x563ac8[_0xd341('0xc4')]==='ivr'&&this[_0xd341('0x23')][_0x563ac8['queue']][_0xd341('0x11d')]&&_0x1e915a[_0xd341('0x113')]===_0xd341('0x11e')){return new Promise(function(_0x3d6140,_0x160612){delete _0x4cd2db[_0xd341('0x29')][_0x1e915a[_0xd341('0xc3')]];_0x4cd2db[_0xd341('0xd1')](_0x4cd2db[_0xd341('0x23')][_0x563ac8[_0xd341('0xc2')]]);_0x4cd2db[_0xd341('0x23')][_0x563ac8[_0xd341('0xc2')]]['outboundAnswerCallsDay']+=0x1;_0x4cd2db['campaigns'][_0x563ac8[_0xd341('0xc2')]][_0xd341('0x115')]+=0x1;var _0x1de2d4=_0x4cd2db['campaigns'][_0x563ac8[_0xd341('0xc2')]];var _0x551747=new Hangup(_0x563ac8,_0x1e915a);_0x551747[_0xd341('0xd5')]=0x13;_0x551747[_0xd341('0x72')]='Machine';_0x551747[_0xd341('0x117')]=_0xd341('0x118');_0x551747[_0xd341('0x120')]+=0x1;_0x551747['countglobal']+=0x1;_0x551747[_0xd341('0x11b')]=!![];ami[_0xd341('0x44')]('custom:amd',ut[_0xd341('0x11a')](_0x551747,_0xd341('0x11b')));hopperUtils[_0xd341('0xe8')](_0x551747)[_0xd341('0xa5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x551747[_0xd341('0x12c')]+_0x551747[_0xd341('0x12d')]+_0x551747['countnoanswerretry']+_0x551747[_0xd341('0x122')]+_0x551747[_0xd341('0xd8')]+_0x551747[_0xd341('0xed')]+_0x551747[_0xd341('0x120')]+_0x551747[_0xd341('0x12e')]>=_0x1de2d4['dialGlobalMaxRetry']){_0x4cd2db[_0xd341('0x124')](_0x551747,_0x3d6140,_0x160612,_0xd341('0x125'));}else{if(_0x551747[_0xd341('0x120')]>=_0x1de2d4[_0xd341('0x126')]){_0x4cd2db['createStateFinal'](_0x551747,_0x3d6140,_0x160612,_0xd341('0x128'));}else{hopperUtils[_0xd341('0xdf')]({'active':![],'countmachineretry':_0x551747[_0xd341('0x120')],'scheduledat':moment()[_0xd341('0xe0')](_0x1de2d4[_0xd341('0x12f')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x551747[_0xd341('0xe2')],'ListId':_0x551747['ListId'],'VoiceQueueId':_0x551747[_0xd341('0xe3')]||undefined,'CampaignId':_0x551747[_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x129')));_0x3d6140({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xd341('0x130')]=function(_0x146b98){var _0x433e02=this['uniqueId'][_0x146b98[_0xd341('0xc3')]];var _0x1c267a;if(_0x433e02&&_0x433e02[_0xd341('0xc4')]==='ivr'){delete this['uniqueId'][_0x146b98['uniqueid']];this['updateOriginated'](this[_0xd341('0x23')][_0x433e02[_0xd341('0xc2')]]);this[_0xd341('0x23')][_0x433e02[_0xd341('0xc2')]][_0xd341('0x131')]+=0x1;_0x1c267a=new Hangup(_0x433e02,_0x146b98);hopperUtils['createHistory'](_0x1c267a)[_0xd341('0xa5')](loggerCatch(_0xd341('0x132')));hopperUtils[_0xd341('0xcf')](_0x1c267a)[_0xd341('0xa5')](loggerCatch(_0xd341('0x133')));}if(_0x433e02&&_0x433e02['type']!=='ivr'&&isNotNull(this[_0xd341('0x22')][_0x433e02['queue']][_0xd341('0x134')])){delete this['uniqueId'][_0x146b98[_0xd341('0xc3')]];this[_0xd341('0xd1')](this[_0xd341('0x22')][_0x433e02[_0xd341('0xc2')]]);this[_0xd341('0x22')][_0x433e02[_0xd341('0xc2')]][_0xd341('0xc8')]+=0x1;this['voiceQueues'][_0x433e02[_0xd341('0xc2')]][_0xd341('0x115')]+=0x1;_0x1c267a=new Hangup(_0x433e02,_0x146b98);_0x1c267a[_0xd341('0xd5')]=0x10;_0x1c267a['statedesc']='AnswerAGI';_0x1c267a[_0xd341('0x117')]=_0xd341('0x135');hopperUtils[_0xd341('0xe8')](_0x1c267a)[_0xd341('0xa5')](loggerCatch(_0xd341('0x132')));hopperUtils[_0xd341('0xcf')](_0x1c267a)[_0xd341('0xa5')](loggerCatch(_0xd341('0x133')));}if(_0x433e02&&_0x433e02['type']!==_0xd341('0xc5')&&!isNotNull(this[_0xd341('0x22')][_0x433e02[_0xd341('0xc2')]]['dialQueueProject'])){delete this['uniqueId'][_0x146b98['uniqueid']];this[_0xd341('0xd1')](this['voiceQueues'][_0x433e02['queue']]);this[_0xd341('0x22')][_0x433e02[_0xd341('0xc2')]][_0xd341('0x136')]+=0x1;_0x1c267a=new Hangup(_0x433e02,_0x146b98);_0x1c267a['state']=0xc;_0x1c267a['statedesc']=_0x146b98[_0xd341('0x137')];_0x1c267a[_0xd341('0x117')]=_0xd341('0x138');hopperUtils['createHistory'](_0x1c267a)[_0xd341('0xa5')](loggerCatch(_0xd341('0x132')));hopperUtils[_0xd341('0xcf')](_0x1c267a)[_0xd341('0xa5')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xd341('0xc')]=function(_0x4a9c59){var _0x38be35=this;if(!_0x38be35[_0xd341('0x2e')][_0x4a9c59[_0xd341('0x65')]]){_0x38be35[_0xd341('0x2e')][_0x4a9c59['name']]={'running':![]};}else if(_0x38be35[_0xd341('0x2e')][_0x4a9c59['name']][_0xd341('0x139')]===!![]){return;}else if(_0x38be35[_0xd341('0x2e')][_0x4a9c59[_0xd341('0x65')]]['running']===![]){_0x38be35[_0xd341('0x2e')][_0x4a9c59['name']]['running']=!![];}var _0x1c6156=_0x38be35[_0xd341('0x22')][_0x4a9c59['name']];var _0x1420a2=_0x1c6156[_0xd341('0x6d')]!==utils[_0xd341('0x71')][_0xd341('0x7e')];var _0x5425a6=utils[_0xd341('0x13a')](_0x1c6156);_0x1c6156['statusMessage']=utils[_0xd341('0x13b')](_0x1c6156,_0x38be35[_0xd341('0x24')]);Promise[_0xd341('0xb0')]()[_0xd341('0x41')](function(){if(_0x1c6156[_0xd341('0x13c')]===utils[_0xd341('0x71')][_0xd341('0x7e')]){if(_0x1420a2){clearPredictiveAttributes(_0x1c6156);_0x4a9c59[_0xd341('0x67')]=undefined;_0x4a9c59[_0xd341('0x2b')]=undefined;}if(_0x1c6156[_0xd341('0x13c')]===utils[_0xd341('0x71')][_0xd341('0x7e')]){_0x4a9c59['available']=0x0;_0x4a9c59[_0xd341('0x102')]=0x0;_0x4a9c59[_0xd341('0x13d')]=0x0;_0x4a9c59[_0xd341('0x13e')]=0x0;_0x4a9c59['pTalking']=0x0;}}else if(_0x1c6156[_0xd341('0x13c')]===utils[_0xd341('0x71')][_0xd341('0x13f')]&&!_0x5425a6){return _0x38be35[_0xd341('0x94')](_0x1c6156,!![])[_0xd341('0x41')](function(){return _0x38be35['ifTime'](_0x1c6156,![]);})[_0xd341('0x41')](function(){return _0x38be35['checkDialMethod'](_0x1c6156);})[_0xd341('0xa5')](function(_0x26b522){loggerSyncQueueSummary['debug'](_0xd341('0x140'),util[_0xd341('0x47')](_0x26b522,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1c6156);});}else{clearPredictiveAttributes(_0x1c6156);}})['then'](function(){var _0x5a9945=_0x4a9c59['compareToOutboundQueue'](_0x1c6156);if(_0x5a9945||_0x1c6156[_0xd341('0x141')]){_0x1c6156[_0xd341('0x141')]=![];_0x4a9c59[_0xd341('0x142')](_0x1c6156);Object[_0xd341('0x143')](_0x1c6156,_0x4a9c59);emitOutboundVoiceQueueSummary(_0x4a9c59);}_0x38be35[_0xd341('0x2e')][_0x1c6156[_0xd341('0x65')]][_0xd341('0x139')]=![];})[_0xd341('0xa5')](function(_0xc1ac42){logger[_0xd341('0x69')](_0xd341('0x140'),util['inspect'](_0xc1ac42,{'showHidden':![],'depth':null}));_0x38be35[_0xd341('0x2e')][_0x1c6156[_0xd341('0x65')]]['running']=![];});};Dialer[_0xd341('0x1c')]['syncQueueSummaryComplete']=_[_0xd341('0x144')](function(){var _0xb517a7=_[_0xd341('0x145')](this['voiceQueues'],function(_0x2a7f0c){return _0x2a7f0c[_0xd341('0x146')];});var _0x9b3a97=_['filter'](this[_0xd341('0xfa')],function(_0x5c874e){return _0x5c874e[_0xd341('0x147')]&&_0x5c874e['status']===_0xd341('0x148');});if(_0xb517a7[_0xd341('0x9c')]>0x0&&_0x9b3a97[_0xd341('0x9c')]>0x0){return Promise[_0xd341('0xb0')]()['then'](cmHopper[_0xd341('0x149')](_[_0xd341('0x14a')](_0xb517a7,'id'),previewRecallmeReminderInterval,_[_0xd341('0x14a')](_0x9b3a97,'id')))[_0xd341('0x41')](function(_0x52eb7b){for(var _0x5db282=0x0;_0x5db282<_0x52eb7b['length'];_0x5db282++){var _0x4f7286=_0x52eb7b[_0x5db282][_0xd341('0x14b')][_0xd341('0x65')];if(_0x4f7286)io['to'](util['format'](_0xd341('0x14c'),_0x4f7286))[_0xd341('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x52eb7b[_0x5db282]});}})[_0xd341('0xa5')](function(_0x2b740f){logger[_0xd341('0x69')]('checkPreviewRecallReminder',_0x2b740f);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xd341('0x3f')]=function(){var _0x395015=this;setInterval(function(){_0x395015['clearZombieChannels'](_0x395015[_0xd341('0x29')],'[uniqueid]');_0x395015[_0xd341('0x14d')](_0x395015[_0xd341('0x27')],_0xd341('0x14e'));},0x32c8);};Dialer[_0xd341('0x1c')][_0xd341('0x14d')]=function(_0x49a195,_0x3c9707){var _0x496a17=this;for(var _0x23b93b in _0x49a195){if(typeof _0x49a195[_0x23b93b]!=='undefined'){this[_0xd341('0x20')][_0xd341('0x1d')](function(){if(!_[_0xd341('0xf9')](_0x49a195[_0x23b93b])){return ami['Action']({'action':_0xd341('0x8c'),'channel':_0x49a195[_0x23b93b][_0xd341('0xf4')]})[_0xd341('0xa5')](function(_0xdbd0c9){if(_0xdbd0c9[_0xd341('0x6d')]===_0xd341('0x14f')){setTimeout(function(){if(_0x49a195[_0x23b93b]&&_0x49a195[_0x23b93b][_0xd341('0xc4')]!==_0xd341('0xc5')){_0x496a17[_0xd341('0xd1')](_0x496a17[_0xd341('0x22')][_0x49a195[_0x23b93b][_0xd341('0xc2')]]);logger[_0xd341('0x69')]('[Dialer][checkChannel]',_0x3c9707,_0x23b93b,_0x49a195[_0x23b93b][_0xd341('0xc2')]);delete _0x49a195[_0x23b93b];}if(_0x49a195[_0x23b93b]&&_0x49a195[_0x23b93b][_0xd341('0xc4')]==='ivr'){_0x496a17[_0xd341('0xd1')](_0x496a17['campaigns'][_0x49a195[_0x23b93b][_0xd341('0xc2')]]);logger[_0xd341('0x69')]('[Dialer][checkChannel][ivr]',_0x3c9707,_0x23b93b,_0x49a195[_0x23b93b][_0xd341('0xc2')]);delete _0x49a195[_0x23b93b];}},0x2328);}});}});}}};Dialer[_0xd341('0x1c')][_0xd341('0x150')]=function(_0x3821b7){return Promise[_0xd341('0xb0')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x3821b7))[_0xd341('0xa5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xd341('0x1c')][_0xd341('0xd1')]=function(_0x112f39){if(!_[_0xd341('0x43')](_0x112f39)&&_0x112f39!==null){if(typeof _0x112f39[_0xd341('0x82')]!==_0xd341('0xaf')){if(_0x112f39[_0xd341('0x82')]>0x0){_0x112f39[_0xd341('0x82')]-=0x1;}else{logger[_0xd341('0x69')](_0xd341('0x151'));}}}else{logger['error'](_0xd341('0x152'));}};Dialer[_0xd341('0x1c')]['loggerHandler']=function(_0x21e471,_0x26763b){var _0x5bfdb2=this;return function(_0xd984da){_0x5bfdb2[_0xd341('0xd1')](_0x26763b);logger[_0xd341('0x69')](_0x21e471,util[_0xd341('0x47')](_0xd984da,{'showHidden':![],'depth':null}));};};Dialer[_0xd341('0x1c')]['emptyContact']=function(_0x3bb7f9,_0x4fcf65,_0x1ea693){var _0x2bf1cb={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x4fcf65);this[_0xd341('0x11c')](_[_0xd341('0x153')](_0x2bf1cb,_['pick'](_0x1ea693,[_0xd341('0xe2'),_0xd341('0xf1'),_0xd341('0x154'),_0xd341('0xe3'),_0xd341('0xe4')])),'[emptyContact][createHistory]',_0xd341('0x155'));logger[_0xd341('0x69')](_0x3bb7f9);};Dialer[_0xd341('0x1c')]['saveInDb']=function(_0x28b2a3,_0xbb4698,_0x2c2d50){hopperUtils[_0xd341('0xe8')](_0x28b2a3)[_0xd341('0xa5')](loggerCatch(_0xbb4698));hopperUtils[_0xd341('0xcf')](_0x28b2a3)[_0xd341('0xa5')](loggerCatch(_0x2c2d50));};Dialer[_0xd341('0x1c')]['queueCallerAbandonCreateState']=function(_0x540d33,_0x5b6468){hopperUtils[_0xd341('0xe8')](_0x540d33)[_0xd341('0xa5')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5b6468==0x0){hopperUtils['moveContactManagedDialer'](_0x540d33)[_0xd341('0xa5')](loggerCatch(_0xd341('0x156')));}};Dialer['prototype'][_0xd341('0x157')]=function(_0x44048c){return Promise['resolve']()['then'](cmHopper[_0xd341('0x149')](_0x44048c['id'],previewRecallmeReminderInterval))[_0xd341('0x41')](function(_0x3083bc){for(var _0x1a63c0=0x0;_0x1a63c0<_0x3083bc[_0xd341('0x9c')];_0x1a63c0++){var _0x24e720=_0x3083bc[_0x1a63c0][_0xd341('0x14b')][_0xd341('0x65')];if(_0x24e720)io['to'](util['format'](_0xd341('0x14c'),_0x24e720))[_0xd341('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x3083bc[_0x1a63c0]});}})[_0xd341('0xa5')](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x57f0eb){var _0x45865f=this;return function(){_0x45865f[_0xd341('0x158')](_0x57f0eb);};};Dialer['prototype']['actionOriginate']=function(_0x121c95,_0x5827ff){var _0x2555ae=this;var _0x3395ef=uuid['v4']();this[_0xd341('0x27')][_0x3395ef]=new Action(_0x121c95,_0x5827ff,_0x3395ef);return new Promise(function(_0x5ed757,_0x3d3f65){if(_[_0xd341('0x43')](_0x121c95)&&typeof _0x121c95!==_0xd341('0x159')){return _0x3d3f65(msgResponse(_0xd341('0x15a'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xd341('0x43')](_0x5827ff[_0xd341('0x15b')])||_0x5827ff['phone']===null){return _0x3d3f65(msgResponse(_0xd341('0x15a'),_0xd341('0x95'),_0xd341('0x15c')));}var _0x75e8b1={'XMD-CALLERID':_0x2555ae['actions'][_0x3395ef][_0xd341('0x15d')](),'XMD-AGI':_0x121c95[_0xd341('0x134')]?util['format'](_0xd341('0x15e'),ipAgi,_0x121c95[_0xd341('0x134')]):_0xd341('0x15f'),'XMD-AGIAFTER':_0x121c95['dialQueueProject2']?util[_0xd341('0x48')](_0xd341('0x15e'),ipAgi,_0x121c95[_0xd341('0xcc')]):'NONE','XMD-QUEUE':utils[_0xd341('0x160')](_0x121c95)?util[_0xd341('0x48')]('\x22%s,%s%s,,,%s\x22',_0x121c95['name'],_0x121c95['dialQueueOptions']||'',_0x121c95['dialAgiAfterHangupAgent']?'c':'',_0x121c95[_0xd341('0x161')]||0x3):_0xd341('0x15f'),'XMD-CONTACTID':_0x5827ff['ContactId'],'XMD-CDRTYPE':_0xd341('0x8'),'CALLERID(all)':_0x2555ae[_0xd341('0x27')][_0x3395ef]['getCaller'](),'XMD-AMD':_0x121c95['dialAMDActive']?_0xd341('0x13f'):_0xd341('0x15f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x121c95[_0xd341('0x11d')]){_0x75e8b1[_0xd341('0x162')]=_0x121c95[_0xd341('0x163')]||0x9c4;_0x75e8b1[_0xd341('0x164')]=_0x121c95[_0xd341('0x165')]||0x5dc;_0x75e8b1[_0xd341('0x166')]=_0x121c95[_0xd341('0x167')]||0x320;_0x75e8b1[_0xd341('0x168')]=_0x121c95['dialAMDTotalAnalysisTime']||0x1388;_0x75e8b1[_0xd341('0x169')]=_0x121c95[_0xd341('0x16a')]||0x64;_0x75e8b1['XMD-AMDBETWEENWORDSSILENCE']=_0x121c95[_0xd341('0x16b')]||0x32;_0x75e8b1[_0xd341('0x16c')]=_0x121c95[_0xd341('0x16d')]||0x3;_0x75e8b1[_0xd341('0x16e')]=_0x121c95[_0xd341('0x16f')]||0x100;_0x75e8b1['XMD-AMDMAXIMUMWORDLENGTH']=_0x121c95[_0xd341('0x170')]||0x1388;}if(utils[_0xd341('0x160')](_0x121c95)){_0x75e8b1[_0xd341('0x171')]=_0x5827ff[_0xd341('0xe3')];}else{_0x75e8b1[_0xd341('0x172')]=_0x5827ff[_0xd341('0xe4')];}for(var _0x30936f in _0x5827ff['Contact']){if(typeof _0x5827ff[_0xd341('0x173')][_0x30936f]!==_0xd341('0xaf')){if(isNotNull(_0x5827ff['Contact'][_0x30936f])&&_0x30936f!=='id'&&_0x30936f!==_0xd341('0x174')&&_0x30936f!==_0xd341('0x175')&&_0x30936f!==_0xd341('0x176')){_0x75e8b1[util['format'](_0xd341('0x177'),'XMD-',_[_0xd341('0x178')](_0x30936f))]=_0x5827ff[_0xd341('0x173')][_0x30936f];}}}var _0x2b942b=_0x2555ae[_0xd341('0x89')](_0x121c95['Trunk'])?utils[_0xd341('0x179')](_0x121c95[_0xd341('0x8f')]['callerid'],_0x121c95[_0xd341('0x17a')],_0x121c95[_0xd341('0x17b')]>0x0?utils['getCallerIdRandom'](_0x121c95[_0xd341('0x17c')],_0x121c95['dialRandomLastDigitCallerIdNumber']):_0x121c95[_0xd341('0x17c')]):utils['getCallerId'](_[_0xd341('0xf9')](_0x121c95[_0xd341('0x17d')])?_0x121c95[_0xd341('0x8f')][_0xd341('0x17e')]:_0x121c95['TrunkBackup']['callerid'],_0x121c95[_0xd341('0x17a')],_0x121c95[_0xd341('0x17b')]>0x0?utils[_0xd341('0x17f')](_0x121c95[_0xd341('0x17c')],_0x121c95[_0xd341('0x17b')]):_0x121c95[_0xd341('0x17c')]);if(_0x2b942b){_0x75e8b1[_0xd341('0x180')]=_0x2555ae[_0xd341('0x27')][_0x3395ef][_0xd341('0x181')]=utils[_0xd341('0x182')](_0x2b942b);_0x75e8b1[_0xd341('0x183')]=_0x5827ff[_0xd341('0x15b')];}_0x121c95['variables']=_0x75e8b1;return ami[_0xd341('0x9e')]({'actionid':_0x3395ef,'action':_0xd341('0x15a'),'channel':_0x2555ae['isTrunkReachable'](_0x121c95[_0xd341('0x8f')])?util[_0xd341('0x48')](_0xd341('0x184'),_0x121c95[_0xd341('0x8f')][_0xd341('0x65')],isNotNull(_0x121c95[_0xd341('0x185')])?_0x121c95[_0xd341('0x185')]['trim']()||'':'',_0x121c95[_0xd341('0x186')]>0x0?_0x5827ff['phone'][_0xd341('0x187')](_0x121c95[_0xd341('0x186')]):_0x5827ff[_0xd341('0x15b')]):util[_0xd341('0x48')]('SIP/%s/%s%s',_[_0xd341('0xf9')](_0x121c95[_0xd341('0x17d')])?_0x121c95['Trunk'][_0xd341('0x65')]:_0x121c95[_0xd341('0x17d')][_0xd341('0x65')],isNotNull(_0x121c95['dialPrefix'])?_0x121c95[_0xd341('0x185')][_0xd341('0x188')]()||'':'',_0x121c95[_0xd341('0x186')]>0x0?_0x5827ff['phone'][_0xd341('0x187')](_0x121c95[_0xd341('0x186')]):_0x5827ff[_0xd341('0x15b')]),'callerid':_0x2b942b,'Exten':_0xd341('0x112'),'Context':_0xd341('0x189'),'Priority':'1','variable':_0x75e8b1,'timeout':(_0x121c95['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3395ef})[_0xd341('0x41')](function(_0x4fc65b){return _0x5ed757(_0x4fc65b);})[_0xd341('0xa5')](function(_0x349ecc){_0x121c95[_0xd341('0x18a')]+=0x1;var _0x244b06=new History(_0x2555ae[_0xd341('0x27')][_0x3395ef]);logger[_0xd341('0x69')](util[_0xd341('0x48')](_0xd341('0x18b'),JSON[_0xd341('0x78')](_0x349ecc)));_0x244b06[_0xd341('0xd5')]=0xe;_0x244b06[_0xd341('0x72')]='OriginateError';_0x244b06[_0xd341('0x74')]=moment()[_0xd341('0x48')](_0xd341('0xc7'));_0x244b06['endtime']=_0x244b06[_0xd341('0x74')];hopperUtils[_0xd341('0xe8')](_0x244b06)[_0xd341('0xa5')](loggerCatch('[originate][error]'));_0x2555ae['moveContactManagedDialer'](_0x244b06)[_0xd341('0xa5')](loggerCatch('[originate][error]'))[_0xd341('0x1f')](function(){delete _0x2555ae['actions'][_0x3395ef];return _0x3d3f65(msgResponse(_0xd341('0x15a'),_0xd341('0x88'),_0xd341('0x18c')));});});});};Dialer[_0xd341('0x1c')][_0xd341('0x18d')]=function(_0x5db5d4,_0x709ccf,_0x10a0d1){var _0x3874c0=new History(_0x709ccf);if(_0x3874c0[_0xd341('0x12c')]+_0x3874c0[_0xd341('0x12d')]+_0x3874c0[_0xd341('0x18e')]+_0x3874c0[_0xd341('0x122')]+_0x3874c0[_0xd341('0xd8')]+_0x3874c0[_0xd341('0xed')]+_0x3874c0[_0xd341('0x120')]+_0x3874c0[_0xd341('0x12e')]>=_0x10a0d1[_0xd341('0x123')]-0x1){return!![];}switch(_0x5db5d4){case 0x3:if(_0x3874c0[_0xd341('0x18e')]>=_0x10a0d1[_0xd341('0x18f')]-0x1){return!![];}hopperUtils[_0xd341('0xdf')]({'active':![],'countnoanswerretry':_0x3874c0[_0xd341('0x18e')]+=0x1,'scheduledat':moment()['add'](_0x10a0d1[_0xd341('0x190')],'minutes')[_0xd341('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0[_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3874c0[_0xd341('0x12c')]>=_0x10a0d1[_0xd341('0x191')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x3874c0['countbusyretry']+=0x1,'scheduledat':moment()[_0xd341('0xe0')](_0x10a0d1[_0xd341('0x192')],_0xd341('0xe1'))[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x3874c0['ContactId'],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0[_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3874c0[_0xd341('0x12d')]>=_0x10a0d1[_0xd341('0x193')]-0x1){return!![];}hopperUtils[_0xd341('0xdf')]({'active':![],'countcongestionretry':_0x3874c0[_0xd341('0x12d')]+=0x1,'scheduledat':moment()[_0xd341('0xe0')](_0x10a0d1[_0xd341('0x194')],'minutes')[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x195')));break;case 0x0:if(_0x3874c0[_0xd341('0x122')]>=_0x10a0d1[_0xd341('0x196')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3874c0['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd341('0xe0')](_0x10a0d1['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0xd341('0xc7')),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0['ListId'],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0[_0xd341('0xe4')]||undefined})['catch'](loggerCatch(_0xd341('0x197')));}break;case 0xa:if(_0x3874c0[_0xd341('0xd8')]>=_0x10a0d1[_0xd341('0xdd')]-0x1){return!![];}hopperUtils[_0xd341('0xdf')]({'active':![],'countdropretry':_0x3874c0[_0xd341('0xd8')]+=0x1,'scheduledat':moment()['add'](_0x10a0d1[_0xd341('0x198')],_0xd341('0xe1'))[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x3874c0[_0xd341('0xed')]>=_0x10a0d1['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xd341('0xdf')]({'active':![],'countabandonedretry':_0x3874c0[_0xd341('0xed')]+=0x1,'scheduledat':moment()[_0xd341('0xe0')](_0x10a0d1[_0xd341('0xee')],_0xd341('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0xf2')));break;case 0x13:if(_0x3874c0[_0xd341('0x120')]>=_0x10a0d1[_0xd341('0x126')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3874c0[_0xd341('0x120')]+=0x1,'scheduledat':moment()['add'](_0x10a0d1[_0xd341('0x12f')],_0xd341('0xe1'))[_0xd341('0x48')](_0xd341('0xc7')),'ContactId':_0x3874c0['ContactId'],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0[_0xd341('0xe3')]||undefined,'CampaignId':_0x3874c0[_0xd341('0xe4')]||undefined})['catch'](loggerCatch(_0xd341('0x129')));break;case 0x14:if(_0x3874c0[_0xd341('0x12e')]>=_0x10a0d1[_0xd341('0x199')]-0x1){return!![];}hopperUtils[_0xd341('0xdf')]({'active':![],'countagentrejectretry':_0x3874c0[_0xd341('0x12e')]+=0x1,'scheduledat':moment()['add'](_0x10a0d1[_0xd341('0x19a')],_0xd341('0xe1'))['format'](_0xd341('0xc7')),'ContactId':_0x3874c0[_0xd341('0xe2')],'ListId':_0x3874c0[_0xd341('0xf1')],'VoiceQueueId':_0x3874c0['VoiceQueueId']||undefined,'CampaignId':_0x3874c0['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xd341('0x1c')][_0xd341('0x10d')]=function(_0x35e3d7,_0x53374b,_0x2276f6){var _0x2e3fdc=this;var _0x528d74=new History(_0x35e3d7);var _0x4eb3d7=![];var _0x15dd00;var _0x38898f;return new Promise(function(_0x567d89,_0x247488){if(_['isUndefined'](_0x53374b)&&typeof _0x53374b!==_0xd341('0x159')){return _0x247488(msgResponse('[callProgressDetecting]',_0xd341('0x95'),_0xd341('0x19b')));}if(_['isUndefined'](_0x2276f6)&&typeof _0x2276f6!==_0xd341('0x159')){return _0x247488(msgResponse(_0xd341('0x19c'),_0xd341('0x95'),_0xd341('0x19d')));}hopperUtils[_0xd341('0xef')](_0x528d74,_0x2276f6['reason'],_0x53374b)[_0xd341('0x41')](function(_0x2e46d3){if(_0x2e46d3[_0xd341('0xdc')]==0x1)_0x4eb3d7=!![];switch(_0x2276f6[_0xd341('0xc9')]){case'0':_0x53374b[_0xd341('0x19e')]+=0x1;_0x528d74[_0xd341('0xd5')]=0x0;_0x528d74['statedesc']=_0xd341('0x19f');_0x528d74['countnosuchnumberretry']+=0x1;_0x528d74['countglobal']+=0x1;ami[_0xd341('0x44')](_0xd341('0x1a0'),ut[_0xd341('0x11a')](_0x35e3d7,_0xd341('0x1a1')));_0x15dd00=_0x53374b['dialNoSuchNumberRetryFrequency'];_0x38898f=_0x53374b['callAdditionalPhoneAfterMin'];hopperUtils[_0xd341('0xe8')](_0x528d74)[_0xd341('0xa5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2e3fdc[_0xd341('0x18d')](0x0,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74[_0xd341('0x122')]>=_0x53374b['dialNoSuchNumberMaxRetry']){_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1a2'));}else{_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1a2'));}}break;case'3':_0x53374b[_0xd341('0x1a3')]+=0x1;_0x528d74[_0xd341('0xd5')]=0x3;_0x528d74['statedesc']='NoAnswer';_0x528d74['countnoanswerretry']+=0x1;_0x528d74[_0xd341('0xd9')]+=0x1;var _0x191e31=ut[_0xd341('0x1a4')](_0x35e3d7,_0x53374b);ami[_0xd341('0x44')](_0xd341('0x1a5'),_0x191e31);_0x15dd00=_0x53374b[_0xd341('0x190')];_0x38898f=_0x53374b[_0xd341('0xda')];hopperUtils[_0xd341('0xe8')](_0x528d74)[_0xd341('0xa5')](loggerCatch(_0xd341('0x1a6')));if(_0x2e3fdc['checkRetriveMax'](0x3,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74['countnoanswerretry']>=_0x53374b[_0xd341('0x18f')]){_0x2e3fdc['createStateFinal'](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1a7'));}else{_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1a7'));}}break;case'5':_0x53374b[_0xd341('0x1a8')]+=0x1;_0x528d74[_0xd341('0xd5')]=0x5;_0x528d74[_0xd341('0x72')]=_0xd341('0x1a9');_0x528d74[_0xd341('0x12c')]+=0x1;_0x528d74[_0xd341('0xd9')]+=0x1;ami['emit'](_0xd341('0x1aa'),ut[_0xd341('0x11a')](_0x35e3d7,'busy'));_0x15dd00=_0x53374b['dialBusyRetryFrequency'];_0x38898f=_0x53374b[_0xd341('0xda')];hopperUtils[_0xd341('0xe8')](_0x528d74)[_0xd341('0xa5')](loggerCatch(_0xd341('0x1ab')));if(_0x2e3fdc[_0xd341('0x18d')](0x5,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74['countbusyretry']>=_0x53374b['dialBusyMaxRetry']){_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,'reason\x205\x20busy');}else{_0x2e3fdc['stateGlobal'](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1ac'));}}break;case'8':_0x53374b[_0xd341('0x1ad')]+=0x1;_0x528d74[_0xd341('0xd5')]=0x8;_0x528d74[_0xd341('0x72')]='Congestion';_0x528d74[_0xd341('0x12d')]+=0x1;_0x528d74['countglobal']+=0x1;_0x15dd00=_0x53374b[_0xd341('0x194')];_0x38898f=_0x53374b[_0xd341('0xda')];ami['emit'](_0xd341('0x1ae'),ut[_0xd341('0x11a')](_0x35e3d7,_0xd341('0x1af')));hopperUtils[_0xd341('0xe8')](_0x528d74)['catch'](loggerCatch(_0xd341('0x1b0')));if(_0x2e3fdc[_0xd341('0x18d')](0x8,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74[_0xd341('0x12d')]>=_0x53374b[_0xd341('0x193')]){_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,'reason\x208\x20congestion');}else{_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1b1'));}}break;case'11':_0x53374b[_0xd341('0x1b2')]+=0x1;_0x528d74[_0xd341('0xd5')]=0xb;_0x528d74[_0xd341('0x72')]=_0xd341('0xeb');_0x528d74['countabandonedretry']+=0x1;_0x528d74[_0xd341('0xd9')]+=0x1;_0x15dd00=_0x53374b['dialAbandonedRetryFrequency'];_0x38898f=_0x53374b[_0xd341('0xda')];hopperUtils[_0xd341('0xe8')](_0x528d74)[_0xd341('0xa5')](loggerCatch(_0xd341('0xf3')));if(_0x2e3fdc[_0xd341('0x18d')](0xb,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74[_0xd341('0xed')]>=_0x53374b['dialAbandonedMaxRetry']){_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,'reason\x2011\x20abandoned');}else{_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,'reason\x2011\x20abandoned');}}break;case'20':_0x53374b[_0xd341('0x1b3')]+=0x1;_0x528d74['state']=0x14;_0x528d74[_0xd341('0x72')]=_0xd341('0x1b4');_0x528d74[_0xd341('0x12e')]+=0x1;_0x528d74['countglobal']+=0x1;_0x15dd00=_0x53374b[_0xd341('0x19a')];_0x38898f=_0x53374b[_0xd341('0xda')];ami['emit'](_0xd341('0x1b5'),ut[_0xd341('0x11a')](_0x35e3d7,_0xd341('0x1b6')));hopperUtils[_0xd341('0xe8')](_0x528d74)['catch'](loggerCatch(_0xd341('0x1b7')));if(_0x2e3fdc[_0xd341('0x18d')](0x14,_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74['countagentrejectretry']>=_0x53374b[_0xd341('0x199')]){_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,_0xd341('0x1b8'));}else{_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,'reason\x2020\x20agentreject');}}break;default:_0x53374b['outboundUnknownCallsDay']+=0x1;_0x528d74[_0xd341('0xd5')]=0xc;_0x528d74['statedesc']=_0x2276f6['reason'];_0x15dd00=_0x53374b[_0xd341('0x19a')];_0x38898f=_0x53374b[_0xd341('0xda')];hopperUtils[_0xd341('0xe8')](_0x528d74)['catch'](loggerCatch(_0xd341('0x1b9')));if(_0x2e3fdc[_0xd341('0x18d')](_0x2276f6[_0xd341('0xc9')],_0x35e3d7,_0x53374b)&&!_0x4eb3d7){if(_0x528d74[_0xd341('0x12c')]+_0x528d74[_0xd341('0x12d')]+_0x528d74['countnoanswerretry']+_0x528d74[_0xd341('0x122')]+_0x528d74['countdropretry']+_0x528d74['countabandonedretry']+_0x528d74[_0xd341('0x120')]+_0x528d74['countagentrejectretry']>=_0x53374b[_0xd341('0x123')]){_0x2e3fdc[_0xd341('0x124')](_0x528d74,_0x567d89,_0x247488,_0x2276f6[_0xd341('0xc9')]);}else{_0x2e3fdc[_0xd341('0x127')](_0x528d74,_0x567d89,_0x247488,_0x2276f6[_0xd341('0xc9')]);}}}})[_0xd341('0x41')](function(){if(_0x4eb3d7){hopperUtils[_0xd341('0xe9')](_0x528d74,_0x15dd00,_0x38898f)['then'](function(){return _0x567d89(0x1);});}});});};Dialer[_0xd341('0x1c')]['stateGlobal']=function(_0x4886dd,_0x4cb9a0,_0x4480a3,_0x58b16e){var _0x1aba83=new Final(_0x4886dd);_0x1aba83['state']=0xf;_0x1aba83['statedesc']=_0xd341('0x1ba');this['createStateFinal'](_0x1aba83,_0x4cb9a0,_0x4480a3,_0x58b16e);};Dialer['prototype']['createStateFinal']=function(_0x38017a,_0x3e10ac,_0x3f5137,_0x1d9275){hopperUtils[_0xd341('0xcf')](_0x38017a)[_0xd341('0x41')](function(){return _0x3e10ac(msgResponse(_0xd341('0x19c'),_0xd341('0x10c'),_0x1d9275));})[_0xd341('0xa5')](function(){return _0x3f5137(msgResponse(_0xd341('0x1bb'),_0xd341('0x95'),'contact\x20not\x20moved'));});};Dialer[_0xd341('0x1c')]['predictive']=function(_0x46b92a){var _0x3abbe4=_0x46b92a['dialPredictiveOptimizationPercentage']/0x64;var _0x1a21a3=_0x46b92a[_0xd341('0xd4')]/(_0x46b92a['outboundDropCallsDayTimeout']+_0x46b92a[_0xd341('0xc8')]);var _0x49649c=Math[_0xd341('0x1bc')](_0x46b92a[_0xd341('0x1bd')]*(_0x46b92a[_0xd341('0x1be')]/0x64));var _0x3b4aeb=Math[_0xd341('0x1bc')](_0x46b92a[_0xd341('0x1bd')]*(_0x46b92a[_0xd341('0x1bf')]/0x64));var _0x123ae5=_0x46b92a['available']+_0x46b92a[_0xd341('0x13e')];var _0x461aa3=Math[_0xd341('0x1c0')](_0x46b92a['erlangCalls']*_0x46b92a[_0xd341('0x61')]*_0x46b92a[_0xd341('0x1c1')]*_0x46b92a['predictiveIntervalMultiplicativeFactor']);if(_[_0xd341('0x43')](_0x46b92a['startProgressive'])){if(!_[_0xd341('0x43')](_0x46b92a[_0xd341('0x67')])){_0x46b92a[_0xd341('0x67')]=undefined;loggerPredictive[_0xd341('0x69')]('[startMethodPredictive][StartProgressive]',_0xd341('0x1c2'));}if(!_['isUndefined'](_0x46b92a[_0xd341('0x1c3')])){loggerPredictive[_0xd341('0x69')](_0xd341('0x1c4'),_0xd341('0x1c5'));clearInterval(_0x46b92a[_0xd341('0x1c3')]);_0x46b92a['handlePredictive']=undefined;}_0x46b92a['startProgressive']=moment()[_0xd341('0x48')](_0xd341('0xc7'));loggerPredictive['info'](_0x46b92a[_0xd341('0x65')],'collection\x20data\x20in\x20progressive\x20at',_0x46b92a[_0xd341('0x2b')]);this[_0xd341('0xb7')](_0x46b92a,0x1);}else if(ifInterval(_0x46b92a['dialPredictiveInterval'],_0x46b92a[_0xd341('0x2b')])){this[_0xd341('0xb7')](_0x46b92a,0x1);loggerPredictiveCalls['info'](_0xd341('0x1c6'),_0x46b92a['startProgressive'],_0x46b92a[_0xd341('0x65')]);_0x46b92a['erlangCalls']=0x0;_0x46b92a[_0xd341('0x1c7')]=0x0;}else if(_0x3abbe4<_0x1a21a3&&_0x46b92a[_0xd341('0x1c8')]===_0xd341('0x1c9')){clearPredictiveAttributes(_0x46b92a);loggerPredictive[_0xd341('0x4b')](_0xd341('0x1ca'),_0xd341('0x1cb'),_0x1a21a3,_0xd341('0x2b'),_0x46b92a[_0xd341('0x65')]);}else if(_0x461aa3<_0x46b92a[_0xd341('0x1c7')]&&_0x46b92a[_0xd341('0x1c8')]===_0xd341('0x1c9')){clearPredictiveAttributes(_0x46b92a);loggerPredictive[_0xd341('0x4b')](_0xd341('0x1cc'),_0xd341('0x1cd'),_0x461aa3,_0xd341('0x1ce'),_0x46b92a[_0xd341('0x1c7')],_0xd341('0x2b'),_0x46b92a[_0xd341('0x65')]);}else if(!ifInterval(_0x46b92a['dialPredictiveInterval'],_0x46b92a['startProgressive'])&&_[_0xd341('0x43')](_0x46b92a['startPredictive'])&&!_[_0xd341('0x43')](_0x46b92a[_0xd341('0x2b')])){_0x46b92a[_0xd341('0x67')]=moment()[_0xd341('0x48')](_0xd341('0xc7'));loggerPredictive[_0xd341('0x4b')](_0x46b92a['name'],_0xd341('0x1cf'),_0x46b92a['startPredictive']);hopperUtils[_0xd341('0x1d0')](_0x46b92a[_0xd341('0x1d1')])['then'](this[_0xd341('0x1d2')](_0x46b92a))[_0xd341('0x41')](mergeDataErlangB(_0x46b92a))[_0xd341('0x41')](this['startMethodPredictive'](_0x46b92a))[_0xd341('0xa5')](loggerCatchPredictive(_0xd341('0x1d3'),_0x46b92a));}else if(!ifInterval(_0x46b92a['dialPredictiveInterval'],_0x46b92a[_0xd341('0x67')])){_0x46b92a[_0xd341('0x1c7')]=0x0;_0x46b92a[_0xd341('0x67')]=moment()[_0xd341('0x48')](_0xd341('0xc7'));loggerPredictive['info'](_0x46b92a[_0xd341('0x65')],_0xd341('0x1d4'),_0x46b92a[_0xd341('0x67')]);clearInterval(_0x46b92a[_0xd341('0x1c3')]);_0x46b92a[_0xd341('0x1c3')]=undefined;hopperUtils['avgHandleTime'](_0x46b92a[_0xd341('0x1d1')])[_0xd341('0x41')](this['getDataPredictive'](_0x46b92a))[_0xd341('0x41')](mergeDataErlangB(_0x46b92a))[_0xd341('0x41')](this[_0xd341('0x1d5')](_0x46b92a))[_0xd341('0xa5')](loggerCatchPredictive(_0xd341('0x1d6'),_0x46b92a));}else if(_0x46b92a['predictiveIntervalAvailable']&&_0x123ae5<_0x46b92a[_0xd341('0x1bd')]-_0x3b4aeb){clearPredictiveAttributes(_0x46b92a);loggerPredictive[_0xd341('0x4b')](_0x46b92a[_0xd341('0x65')],_0xd341('0x1d7'),_0x123ae5,_0xd341('0x1d8'),_0x46b92a[_0xd341('0x1bd')],'-',_0x3b4aeb,'=',_0x46b92a['predictiveIntervalAvailable']-_0x3b4aeb,')');}else if(_0x46b92a[_0xd341('0x1bd')]&&_0x123ae5>_0x46b92a[_0xd341('0x1bd')]+_0x49649c){clearPredictiveAttributes(_0x46b92a);loggerPredictive[_0xd341('0x4b')](_0x46b92a[_0xd341('0x65')],_0xd341('0x1d7'),_0x123ae5,_0xd341('0x1d9'),_0x46b92a[_0xd341('0x1bd')],'+',_0x49649c,'=',_0x46b92a[_0xd341('0x1bd')]+_0x49649c,')');}};Dialer[_0xd341('0x1c')]['getDataPredictive']=function(_0x3b3597){var _0xe8ae66=this;return function(_0xd163ba){return new Promise(function(_0x3b1dd1,_0x38bb6c){_[_0xd341('0x153')](_0x3b3597,_0xd163ba[0x0]);if(checkGetDataPredictive(_0xd163ba[0x0])){var _0x11fad6=_0x3b3597[_0xd341('0x1bd')]=_0x3b3597['talking']+_0x3b3597['available'];var _0x1eb674=_0x3b3597[_0xd341('0x1d1')]*0x3c;var _0x5e14e0=_0xd163ba[0x0][_0xd341('0x55')]+_0xd163ba[0x0][_0xd341('0x53')];var _0x406751=(_0xd163ba[0x0][_0xd341('0x4e')]+_0xd163ba[0x0][_0xd341('0x50')]+_0xd163ba[0x0][_0xd341('0x52')])/_0xd163ba[0x0][_0xd341('0x4d')];_0x3b3597['predictiveIntervalHitRate']=_0x406751>0x0?_0x406751:0x1;switch(_0x3b3597[_0xd341('0x1c8')]){case'dropRate':var _0x128c5b=_0x3b3597['dialPredictiveOptimizationPercentage']/0x64;return _0xe8ae66[_0xd341('0x1da')](_0x11fad6,_0x1eb674,_0x5e14e0,_0x406751,_0x128c5b)['then'](function(_0x314362){return _0x3b1dd1(_0x314362);});case _0xd341('0x1db'):var _0x462514=_0x3b3597[_0xd341('0x1dc')]/0x64;return _0xe8ae66[_0xd341('0x1dd')](_0x11fad6,_0x1eb674,_0x5e14e0,_0x406751,_0x462514)['then'](function(_0x172597){return _0x3b1dd1(_0x172597);});default:return _0x38bb6c(msgResponse(_0xd341('0x1de'),_0xd341('0x95'),'Unknown\x20Predictive'));}}else{return _0x38bb6c(msgResponse(_0xd341('0x1de'),_0xd341('0x95'),_0xd341('0x1df')));}});};};Dialer[_0xd341('0x1c')][_0xd341('0x1e0')]=function(_0x21daaf){var _0x3d4aa4=this;return function(_0x396035){return new Promise(function(_0xd43b02,_0x4a5e0f){_[_0xd341('0x153')](_0x21daaf,_0x396035[0x0]);if(checkGetDataPredictive(_0x396035[0x0])){loggerPredictive['info'](JSON[_0xd341('0x78')](_0x396035[0x0]));if(_0x21daaf[_0xd341('0x1c8')]===_0xd341('0x1c9')){return _0x3d4aa4[_0xd341('0x150')](_0x21daaf['id'])[_0xd341('0x41')](function(_0x232533){var _0x2eb177=_0x21daaf[_0xd341('0x1e1')]-_0x232533[0x0]['outboundQueuePauses'];var _0x251994=_0x21daaf[_0xd341('0x1d1')]*0x3c;var _0x241f9f=_0x396035[0x0][_0xd341('0x55')]+_0x396035[0x0][_0xd341('0x53')];var _0x4b44a5=(_0x396035[0x0]['predictiveIntervalAnsweredCalls']+_0x396035[0x0][_0xd341('0x50')]+_0x396035[0x0][_0xd341('0x52')])/_0x396035[0x0][_0xd341('0x4d')];var _0x1d33e5=_0x21daaf[_0xd341('0x1dc')]/0x64;_0x21daaf[_0xd341('0x1e2')]=_0x232533[0x0][_0xd341('0x1e3')]||0x0;_0x21daaf[_0xd341('0x1c1')]=_0x4b44a5>0x0?_0x4b44a5:0x1;return _0x3d4aa4[_0xd341('0x1da')](_0x2eb177,_0x251994,_0x241f9f,_0x4b44a5,_0x1d33e5);})[_0xd341('0x41')](function(_0x2241b6){return _0xd43b02(_0x2241b6);})[_0xd341('0xa5')](function(_0x422249){return _0x4a5e0f(msgResponse(_0xd341('0x1e4'),_0xd341('0x95'),JSON[_0xd341('0x78')](_0x422249)));});}if(_0x21daaf[_0xd341('0x1c8')]===_0xd341('0x1db')){return _0x3d4aa4[_0xd341('0x150')](_0x21daaf['id'])[_0xd341('0x41')](function(_0x340034){var _0xe0f593=_0x21daaf[_0xd341('0x1e1')]-_0x340034[0x0]['outboundQueuePauses'];var _0x47a82d=_0x21daaf[_0xd341('0x1d1')]*0x3c;var _0x68c203=_0x396035[0x0][_0xd341('0x55')]+_0x396035[0x0][_0xd341('0x53')];var _0x5c7af1=(_0x396035[0x0][_0xd341('0x4e')]+_0x396035[0x0][_0xd341('0x50')]+_0x396035[0x0][_0xd341('0x52')])/_0x396035[0x0]['predictiveIntervalTotalCalls'];var _0x16edaa=_0x21daaf[_0xd341('0x1dc')]/0x64;_0x21daaf[_0xd341('0x1e2')]=_0x340034[0x0]['outboundQueuePauses']||0x0;_0x21daaf['predictiveIntervalHitRate']=_0x5c7af1>0x0?_0x5c7af1:0x1;return _0x3d4aa4['busyFactor'](_0xe0f593,_0x47a82d,_0x68c203,_0x5c7af1,_0x16edaa);})['then'](function(_0x178f18){return _0xd43b02(_0x178f18);})[_0xd341('0xa5')](function(_0x285969){return _0x4a5e0f(msgResponse('[CatchErlangB]',_0xd341('0x95'),JSON[_0xd341('0x78')](_0x285969)));});}}else{return _0x4a5e0f(msgResponse('[getDataPredictive]','Failure',_0xd341('0x1df')));}});};};Dialer['prototype'][_0xd341('0x1d5')]=function(_0x129e59){var _0x11ec23=this;return function(){var _0x240946=0x0;var _0x27f68d=Math[_0xd341('0x1c0')](_0x129e59[_0xd341('0x1e5')]*0x3e8);if(_0x27f68d>0x0){_0x27f68d=_0x27f68d<0x64?0x64:_0x27f68d;loggerPredictive['info'](_0x129e59['name'],'one\x20call\x20every:',_0x27f68d,'milliseconds');_0x129e59[_0xd341('0x1c3')]=setInterval(function(){_0x11ec23[_0xd341('0x1c3')](_0x129e59);loggerPredictiveCalls[_0xd341('0x4b')]('[handlePredictive]',_0x240946+=0x1);},_0x27f68d);}else{loggerPredictive[_0xd341('0x4b')](_0x129e59[_0xd341('0x65')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xd341('0x1c')][_0xd341('0x1e6')]=function(_0x215024,_0x13ba10){var _0x44c00c=this;return function(_0x25bfb3){if(_[_0xd341('0x7d')](_0x25bfb3)){if(_[_0xd341('0xf9')](_0x13ba10[_0xd341('0x154')])||!_0x13ba10[_0xd341('0x1e7')]){if(_0x215024[_0xd341('0xb6')]==='booked'){_0x215024[_0xd341('0x75')]=_['isUndefined'](_0x215024['queueStatusComplete'])?!![]:_0x215024[_0xd341('0x75')];var _0x2aa634=uuid['v4']();_0x44c00c[_0xd341('0x27')][_0x2aa634]=new Action(_0x215024,_0x13ba10,_0x2aa634);loggerBooked['info'](_0xd341('0x1e8'),_0x2aa634,'queueStatusComplete:\x20',JSON[_0xd341('0x78')](_0x215024[_0xd341('0x75')]),'Queue:\x20',_0x215024[_0xd341('0x65')]);if(_0x215024[_0xd341('0x75')]){_0x215024['queueStatusComplete']=![];_0x44c00c[_0xd341('0x2d')][_0x44c00c[_0xd341('0x27')][_0x2aa634]['queue']]=[];ami['Action']({'actionid':_0x2aa634,'action':'queuestatus','queue':_0x215024[_0xd341('0x65')]})['catch'](function(){_0x44c00c[_0xd341('0xd1')](_0x215024);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe2')],'ListId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xf1')],'VoiceQueueId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe3')]||undefined,'CampaignId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x1e9')));delete _0x44c00c[_0xd341('0x27')][_0x2aa634];});}else{loggerBooked[_0xd341('0x4b')](_0xd341('0x1ea'),JSON[_0xd341('0x78')](_0x215024[_0xd341('0x75')]),_0xd341('0x1eb'),_0x215024[_0xd341('0x65')]);_0x44c00c[_0xd341('0xd1')](_0x215024);hopperUtils[_0xd341('0xdf')]({'active':![],'ContactId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe2')],'ListId':_0x44c00c[_0xd341('0x27')][_0x2aa634]['ListId'],'VoiceQueueId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe3')]||undefined,'CampaignId':_0x44c00c[_0xd341('0x27')][_0x2aa634][_0xd341('0xe4')]||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x1e9')));delete _0x44c00c[_0xd341('0x27')][_0x2aa634];}}else{return _0x44c00c[_0xd341('0x1ec')](_0x215024,_0x13ba10);}}else{if(utils[_0xd341('0x63')](undefined,_0x13ba10['scheduledat'])<_0x215024['dialRecallMeTimeout']*0x3c){if(_0x13ba10[_0xd341('0x14b')]&&!_0x13ba10[_0xd341('0x14b')][_0xd341('0x1ed')]){_0x44c00c[_0xd341('0x21')][_0xd341('0xfd')](_0x13ba10['id'])[_0xd341('0x1f')](function(){_0x44c00c[_0xd341('0xd1')](_0x215024);});}else{hopperUtils[_0xd341('0x1ee')]({'active':![]},_0x13ba10['id'],0x1)[_0xd341('0x1f')](function(){_0x44c00c[_0xd341('0xd1')](_0x215024);});}}else{_0x215024[_0xd341('0x1ef')]+=0x1;_0x44c00c['updateOriginated'](_0x215024);if(_0x215024[_0xd341('0x1f0')]){hopperUtils[_0xd341('0xdf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x13ba10[_0xd341('0xe2')],'ListId':_0x13ba10[_0xd341('0xf1')],'VoiceQueueId':_0x13ba10[_0xd341('0xe3')]||undefined,'CampaignId':_0x13ba10['CampaignId']||undefined})[_0xd341('0xa5')](loggerCatch(_0xd341('0x1f1')));hopperUtils[_0xd341('0xe8')](createObjHistory(_0x215024,_0x13ba10,utils[_0xd341('0x71')][_0xd341('0x1f2')],0x17,'RecallInQueue'))[_0xd341('0xa5')](loggerCatch(_0xd341('0x1f3')));}else{_0x44c00c[_0xd341('0x11c')](createObjHistory(_0x215024,_0x13ba10,utils['CAMPAIGN_STATUS'][_0xd341('0x1f4')],0x16,_0xd341('0x1f5')),_0xd341('0x1f6'),'[Originate][HistoryRecallClose]');}}}}else{_0x215024[_0xd341('0x1f7')]+=0x1;_0x44c00c[_0xd341('0x11c')](createObjHistory(_0x215024,_0x13ba10,utils[_0xd341('0x71')][_0xd341('0x1f8')],0xd,_0xd341('0x1f9')),_0xd341('0x1fa'),_0xd341('0x1fb'));throw'inBlackList';}};};Dialer[_0xd341('0x1c')][_0xd341('0x158')]=function(_0x11905e){var _0x28e461=this;var _0x421e8b=_0x11905e[_0xd341('0x1fc')]-_0x11905e['originated']-_0x11905e[_0xd341('0x1fd')];emitCampaignSummary(_0x11905e);if(_0x421e8b>0x0){if(_0x421e8b>this[_0xd341('0x25')]){_0x421e8b=this['maxNumberOriginate'];}_0x11905e[_0xd341('0x1fd')]+=_0x421e8b;hopperUtils[_0xd341('0x1fe')](_0x11905e['id'],_0x421e8b,_0x11905e['dialOrderByScheduledAt'],_0x11905e)['then'](function(_0x5e7ad9){_0x11905e['temp']-=_0x421e8b;_0x11905e[_0xd341('0x1fd')]=_0x11905e['temp']>0x0?_0x11905e[_0xd341('0x1fd')]:0x0;if(!utils[_0xd341('0x1ff')](_0x5e7ad9)){_0x11905e[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS'][_0xd341('0x200')];logger[_0xd341('0x4b')](_0xd341('0x201')+_0x11905e['name']);}else{_0x11905e[_0xd341('0x82')]+=_0x5e7ad9[_0xd341('0x9c')];_0x11905e[_0xd341('0x6d')]=utils['CAMPAIGN_STATUS'][_0xd341('0x202')];for(var _0x493a41=0x0;_0x493a41<_0x5e7ad9[_0xd341('0x9c')];_0x493a41+=0x1){_0x11905e['ivrTotalCallsDays']+=0x1;if(_[_0xd341('0xf9')](_0x5e7ad9[_0x493a41])||_['isNil'](_0x5e7ad9[_0x493a41][_0xd341('0x173')])||_[_0xd341('0xf9')](_0x5e7ad9[_0x493a41][_0xd341('0x15b')])){_0x28e461[_0xd341('0x203')](_0xd341('0x204'),_0x11905e,_0x5e7ad9[_0x493a41]);}else{hopperUtils[_0xd341('0x205')](_[_0xd341('0x79')](_0x5e7ad9[_0x493a41],[_0xd341('0xe4'),'phone']))[_0xd341('0x41')](_0x28e461[_0xd341('0x1e6')](_0x11905e,_0x5e7ad9[_0x493a41]))[_0xd341('0xa5')](_0x28e461[_0xd341('0x206')](_0xd341('0x207'),_0x11905e));}}}})[_0xd341('0xa5')](loggerGetContactDialer(_0xd341('0x208'),_0x11905e,_0x421e8b));}};Dialer[_0xd341('0x1c')][_0xd341('0xb7')]=function(_0x4599b6,_0x15c399){var _0x2cc516=this;var _0x23d13a=[];if(_0x15c399<0x1||_0x4599b6[_0xd341('0xb6')]==='booked'){_0x15c399=0x1;}var _0x208fa4=Math[_0xd341('0x1c0')](_0x4599b6[_0xd341('0x209')]*_0x15c399)-_0x4599b6[_0xd341('0x82')]-_0x4599b6[_0xd341('0x1fd')];if(_0x4599b6[_0xd341('0x20a')]>0x0){var _0x33f737=_0x4599b6[_0xd341('0x20a')]-_0x4599b6[_0xd341('0x82')]-_0x4599b6[_0xd341('0x13e')]-_0x4599b6[_0xd341('0x1fd')]-_0x4599b6['pTalking'];if(_0x208fa4>_0x33f737){_0x208fa4=_0x33f737;}}if(_0x208fa4>0x0){if(_0x4599b6[_0xd341('0xb6')]===_0xd341('0xba')){_0x208fa4=0x1;}if(_0x208fa4>this[_0xd341('0x25')]){_0x208fa4=this['maxNumberOriginate'];}_0x4599b6[_0xd341('0x1fd')]+=_0x208fa4;for(var _0x1f91ef in this['agents']){if(typeof this['agents'][_0x1f91ef]!==_0xd341('0xaf')){if(this[_0xd341('0xfa')][_0x1f91ef][_0xd341('0xd5')]===_0xd341('0x20b')&&this[_0xd341('0xfa')][_0x1f91ef]['status']===_0xd341('0x148')){_0x23d13a[_0xd341('0x9d')](this[_0xd341('0xfa')][_0x1f91ef]['id']);}}}hopperUtils['getContactDialer'](_0x4599b6,_0x23d13a,_0x208fa4)[_0xd341('0x41')](function(_0x1a093f){_0x4599b6[_0xd341('0x1fd')]-=_0x208fa4;_0x4599b6[_0xd341('0x1fd')]=_0x4599b6['temp']>0x0?_0x4599b6[_0xd341('0x1fd')]:0x0;if(!utils[_0xd341('0x1ff')](_0x1a093f)){hopperUtils[_0xd341('0x20c')](_0x4599b6)[_0xd341('0x41')](sendMessageReschedule(_0x4599b6))[_0xd341('0xa5')](loggerCatch(_0xd341('0x20d')));}else{_0x4599b6[_0xd341('0x82')]+=_0x1a093f[_0xd341('0x9c')];_0x4599b6[_0xd341('0x6d')]=_0x4599b6[_0xd341('0xb6')]===_0xd341('0xba')?utils[_0xd341('0x71')]['ACTIVE']:utils[_0xd341('0x71')][_0xd341('0x202')];for(var _0x3a96da=0x0;_0x3a96da<_0x1a093f[_0xd341('0x9c')];_0x3a96da+=0x1){if(_[_0xd341('0xf9')](_0x1a093f[_0x3a96da])||_[_0xd341('0xf9')](_0x1a093f[_0x3a96da][_0xd341('0x173')])||_[_0xd341('0xf9')](_0x1a093f[_0x3a96da][_0xd341('0x15b')])){_0x2cc516['emptyContact'](_0xd341('0x204'),_0x4599b6,_0x1a093f[_0x3a96da]);}else{hopperUtils[_0xd341('0x20e')](_[_0xd341('0x79')](_0x1a093f[_0x3a96da],[_0xd341('0xe3'),'phone']))['then'](_0x2cc516[_0xd341('0x1e6')](_0x4599b6,_0x1a093f[_0x3a96da]))[_0xd341('0xa5')](_0x2cc516[_0xd341('0x206')]('[actionOriginate]\x20',_0x4599b6));}}}})[_0xd341('0xa5')](loggerGetContactDialer('[getContactDialer2]',_0x4599b6,_0x208fa4));}};Dialer[_0xd341('0x1c')]['handlePredictive']=function(_0x39cf66){if(_0x39cf66['dialLimitQueue']>0x0){var _0x521642=_0x39cf66[_0xd341('0x20a')]-_0x39cf66[_0xd341('0x82')]-_0x39cf66['talking'];if(_0x521642>0x0){this['tryOriginatePredictive'](_0x39cf66);}else{loggerPredictiveCalls[_0xd341('0x4b')]('[handlePredictive][limitChannel]');}}else{this[_0xd341('0x20f')](_0x39cf66);}};Dialer['prototype'][_0xd341('0x20f')]=function(_0x250f97){var _0x2a4a9b=this;var _0x3d3d1e=[];_0x250f97[_0xd341('0x82')]+=0x1;for(var _0x1bc4c9 in this[_0xd341('0xfa')]){if(typeof this[_0xd341('0xfa')][_0x1bc4c9]!==_0xd341('0xaf')){if(this[_0xd341('0xfa')][_0x1bc4c9][_0xd341('0xd5')]===_0xd341('0x20b')&&this[_0xd341('0xfa')][_0x1bc4c9][_0xd341('0x8c')]===_0xd341('0x148')){_0x3d3d1e['push'](this[_0xd341('0xfa')][_0x1bc4c9]['id']);}}}return this[_0xd341('0x210')](_0x250f97['id'],_0x3d3d1e,0x1,_0x250f97['dialOrderByScheduledAt'],_0x250f97)[_0xd341('0x41')](function(_0x45eeb1){if(!utils[_0xd341('0x1ff')](_0x45eeb1)){utils[_0xd341('0x6b')](_0x250f97,0x1,0x0);return hopperUtils['countReScheduled'](_0x250f97)[_0xd341('0x41')](sendMessageReschedule(_0x250f97))[_0xd341('0xa5')](loggerCatch('[countReScheduled]\x20'));}else{_0x250f97['message']=utils[_0xd341('0x71')][_0xd341('0x202')];if(_[_0xd341('0xf9')](_0x45eeb1[0x0])||_[_0xd341('0xf9')](_0x45eeb1[0x0][_0xd341('0x173')])||_['isNil'](_0x45eeb1[0x0][_0xd341('0x15b')])){_0x2a4a9b[_0xd341('0x203')](_0xd341('0x204'),_0x250f97,_0x45eeb1[0x0]);}else{return hopperUtils[_0xd341('0x20e')](_[_0xd341('0x79')](_0x45eeb1[0x0],[_0xd341('0xe3'),_0xd341('0x15b')]))['then'](_0x2a4a9b[_0xd341('0x1e6')](_0x250f97,_0x45eeb1[0x0]))[_0xd341('0xa5')](_0x2a4a9b['loggerHandler'](_0xd341('0x211'),_0x250f97));}}})[_0xd341('0xa5')](loggerGetContactDialer(_0xd341('0x212'),_0x250f97,0x1));};Dialer[_0xd341('0x1c')][_0xd341('0x1da')]=function(_0x5cc92f,_0x82c37b,_0x459a18,_0x407d0f,_0x3ffd25,_0x55ef63){loggerPredictive['info'](_0xd341('0x213'));loggerPredictive['info'](_0xd341('0x214'),_0x5cc92f);loggerPredictive[_0xd341('0x4b')](_0xd341('0x215'),_0x82c37b);loggerPredictive[_0xd341('0x4b')](_0xd341('0x216'),_0x459a18);loggerPredictive[_0xd341('0x4b')](_0xd341('0x217'),_0x407d0f);loggerPredictive[_0xd341('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ffd25);loggerPredictive[_0xd341('0x4b')](_0xd341('0x62'));return new Promise(function(_0x3ad183,_0x3bb009){if(_0x5cc92f<=0x0||isNaN(_0x5cc92f)){return _0x3bb009(msgResponse(_0xd341('0x218'),'Error',_0xd341('0x219')+_0x5cc92f));}if(_0x459a18<=0x0||isNaN(_0x459a18)){return _0x3bb009(msgResponse(_0xd341('0x218'),'Error','Ts\x20=\x20'+_0x459a18));}if(_0x407d0f<=0x0||isNaN(_0x407d0f)){return _0x3bb009(msgResponse(_0xd341('0x218'),'Error',_0xd341('0x21a')+_0x407d0f));}if(_0x82c37b<=0x0||isNaN(_0x82c37b)){return _0x3bb009(msgResponse('[abandonmentRate]',_0xd341('0x88'),_0xd341('0x21b')+_0x82c37b));}if(_0x3ffd25<=0x0||isNaN(_0x3ffd25)){return _0x3bb009(msgResponse('[abandonmentRate]','Error',_0xd341('0x21c')+_0x3ffd25));}_0x55ef63=_0x55ef63||0x0;var _0x22907d=0x1/_0x459a18;var _0x8ce297=0x0;var _0x3258ee=0x0;var _0x2e93a5=0x0;var _0x14b009=0x0;for(var _0x3ac485=0x0;_0x2e93a5<_0x3ffd25;_0x3ac485+=0x1){_0x3258ee=_0x3ac485/_0x82c37b;_0x8ce297=(_0x407d0f*_0x3258ee+_0x55ef63)/_0x22907d;_0x2e93a5=utils[_0xd341('0x21d')](_0x8ce297,_0x5cc92f);_0x14b009=_0x8ce297/_0x5cc92f*(0x1-utils[_0xd341('0x21d')](_0x8ce297,_0x5cc92f));}return _0x3ad183({'erlangCalls':_0x3ac485,'erlangCallToSecond':_0x82c37b/_0x3ac485,'erlangAbandonmentRate':_0x2e93a5,'erlangBusyFactor':_0x14b009});});};Dialer[_0xd341('0x1c')][_0xd341('0x1dd')]=function(_0x23c9db,_0x3b3255,_0xbd269f,_0x183e84,_0x382e02,_0x156e1b){loggerPredictive['info'](_0xd341('0x21e'));loggerPredictive[_0xd341('0x4b')](_0xd341('0x214'),_0x23c9db);loggerPredictive[_0xd341('0x4b')](_0xd341('0x215'),_0x3b3255);loggerPredictive[_0xd341('0x4b')](_0xd341('0x216'),_0xbd269f);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',_0x183e84);loggerPredictive[_0xd341('0x4b')](_0xd341('0x21f'),_0x382e02);loggerPredictive[_0xd341('0x4b')]('---------------------------');return new Promise(function(_0x52b8a0,_0x47b177){if(_0x23c9db<=0x0||isNaN(_0x23c9db)){return _0x47b177(msgResponse(_0xd341('0x220'),_0xd341('0x88'),_0xd341('0x219')+_0x23c9db));}if(_0xbd269f<=0x0||isNaN(_0xbd269f)){return _0x47b177(msgResponse(_0xd341('0x220'),'Error',_0xd341('0x221')+_0xbd269f));}if(_0x183e84<=0x0||isNaN(_0x183e84)){return _0x47b177(msgResponse('[busyFactor]',_0xd341('0x88'),_0xd341('0x21a')+_0x183e84));}if(_0x3b3255<=0x0||isNaN(_0x3b3255)){return _0x47b177(msgResponse(_0xd341('0x220'),_0xd341('0x88'),'interval\x20=\x20'+_0x3b3255));}if(_0x382e02<=0x0||isNaN(_0x382e02)){return _0x47b177(msgResponse(_0xd341('0x220'),_0xd341('0x88'),_0xd341('0x222')+_0x382e02));}_0x156e1b=_0x156e1b||0x0;var _0x2e9c44=0x1/_0xbd269f;var _0x4b318a=0x0;var _0x2e1320=0x0;var _0x200675=0x0;var _0x18b093=0x0;for(var _0x16e83d=0x0;_0x18b093<_0x382e02;_0x16e83d+=0x1){_0x2e1320=_0x16e83d/_0x3b3255;_0x4b318a=(_0x183e84*_0x2e1320+_0x156e1b)/_0x2e9c44;_0x200675=utils['erlangb'](_0x4b318a,_0x23c9db);_0x18b093=_0x4b318a/_0x23c9db*(0x1-utils[_0xd341('0x21d')](_0x4b318a,_0x23c9db));}return _0x52b8a0({'erlangCalls':_0x16e83d,'erlangCallToSecond':_0x3b3255/_0x16e83d,'erlangAbandonmentRate':_0x200675,'erlangBusyFactor':_0x18b093});});};module['exports']=Dialer; \ No newline at end of file +var _0xa0a3=['reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','predictiveIntervalHitRate','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','getSeconds','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','getContactDialer','checkIsBlackList','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\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]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','varset','queuemember','queuestatuscomplete','getSettings','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','predictiveIntervalAvgHoldtime','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','erlangCallToSecond','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','startProgressive','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','message','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','isArray','length','push','command','iftime\x20%s,%s','content','indexOf','true','catch','Action','then','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','campaigns','undefined','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','answertime','ivr','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','VoiceQueueId','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','isNil','locked','paused','stateinterface','rrmemory','idHopper','syncQueueStatusComplete','strategy','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','membername','AMD','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','stateGlobal','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','moveContactManagedDialer','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','launchHandleIvr','handleIvr','actionOriginate','object','originate','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','updatedAt','%s%s','XMD-','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','dialCutDigit','substring','SIP/%s/%s%s','dialPrefix','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]'];(function(_0x1caa4b,_0x3e3bd2){var _0x2a8a13=function(_0x41d224){while(--_0x41d224){_0x1caa4b['push'](_0x1caa4b['shift']());}};_0x2a8a13(++_0x3e3bd2);}(_0xa0a3,0x7b));var _0x3a0a=function(_0x2b0a0c,_0x435ea6){_0x2b0a0c=_0x2b0a0c-0x0;var _0xf5bdfc=_0xa0a3[_0x2b0a0c];return _0xf5bdfc;};'use strict';var util=require('util');var _=require(_0x3a0a('0x0'));var uuid=require('uuid');var moment=require(_0x3a0a('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3a0a('0x2'));var hopperUtils=require(_0x3a0a('0x3'));var ut=require(_0x3a0a('0x4'));var config=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var loggerBooked=require(_0x3a0a('0x6'))('booked');var loggerPredictive=require(_0x3a0a('0x6'))(_0x3a0a('0x8'));var loggerPredictiveCalls=require(_0x3a0a('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x3a0a('0x6'))(_0x3a0a('0x9'));var ami=require(_0x3a0a('0xa'));config[_0x3a0a('0xb')]=_[_0x3a0a('0xc')](config['redis'],{'host':_0x3a0a('0xd'),'port':0x18eb});var io=require(_0x3a0a('0xe'))(new Redis(config[_0x3a0a('0xb')]));var cmHopper=require(_0x3a0a('0xf'));var voiceQueueRt=require(_0x3a0a('0x10'));var RpcSetting=require('../rpc/setting');var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x3a0a('0x11'));var Final=require(_0x3a0a('0x12'));var AgentComplete=require(_0x3a0a('0x13'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x3a0a('0x14'));var ipAgi=process[_0x3a0a('0x15')][_0x3a0a('0x16')]||_0x3a0a('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3a0a('0x18')]['enqueue']=function(_0x2aa802){this['tail']=this[_0x3a0a('0x19')]?this[_0x3a0a('0x19')][_0x3a0a('0x1a')](_0x2aa802):_0x2aa802();};function Dialer(_0x39cca4,_0x29d35e){this[_0x3a0a('0x1b')]=new Sequence();this[_0x3a0a('0x1c')]=_0x29d35e;this[_0x3a0a('0x1d')]=_0x39cca4[_0x3a0a('0x1d')];this['campaigns']=_0x39cca4['campaigns'];this[_0x3a0a('0x1e')]=_0x39cca4[_0x3a0a('0x1e')];this['trunks']=_0x39cca4[_0x3a0a('0x1f')];this[_0x3a0a('0x20')]=config[_0x3a0a('0x20')]||0x2;this['channels']={};this[_0x3a0a('0x21')]={};this[_0x3a0a('0x22')]={};this[_0x3a0a('0x23')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0x3a0a('0x24')]={};this[_0x3a0a('0x25')]={};this[_0x3a0a('0x26')]={};this[_0x3a0a('0x27')]={};ami['on'](_0x3a0a('0x28'),this[_0x3a0a('0x29')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x2b'),this[_0x3a0a('0x2c')]['bind'](this));ami['on'](_0x3a0a('0x2d'),this[_0x3a0a('0x2e')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x2f'),this[_0x3a0a('0x30')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x31'),this['syncQueueSummary']['bind'](this));ami['on'](_0x3a0a('0x32'),this[_0x3a0a('0x33')]['bind'](this));ami['on'](_0x3a0a('0x34'),this['syncHangup'][_0x3a0a('0x2a')](this));ami['on']('newexten',this[_0x3a0a('0x35')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x36'),this['syncVarSet'][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x37'),this['syncQueueMember'][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x38'),this['syncQueueStatusComplete'][_0x3a0a('0x2a')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x3a0a('0x39')]()['then'](function(_0x232ba5){previewRecallmeReminderInterval=_0x232ba5[_0x3a0a('0x3a')];});}function isNotNull(_0x5884df){return _0x5884df!==null&&!_['isUndefined'](_0x5884df);}function msgResponse(_0x40e1d5,_0x395ed1,_0x55ee4d){return{'action':_0x40e1d5,'response':_0x395ed1,'message':_0x55ee4d,'stack':_0x55ee4d};}function emit(_0x3f4cec,_0x2d1d68,_0x1d7bf6){io['to'](_0x3f4cec)[_0x3a0a('0x3b')](_0x2d1d68,_0x1d7bf6);}function emitOutboundVoiceQueueSummary(_0x339d1b){if(_0x339d1b[_0x3a0a('0x3c')]===_0x3a0a('0x3d')){logger[_0x3a0a('0x3e')](_0x3a0a('0x3f'),util[_0x3a0a('0x40')](_0x339d1b,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x339d1b[_0x3a0a('0x41')]),_0x3a0a('0x42'),_0x339d1b);}}function checkGetDataPredictive(_0x5b1172){if(isNotNull(_0x5b1172)&&!_[_0x3a0a('0x43')](_0x5b1172)){loggerPredictive[_0x3a0a('0x44')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x45'),_0x5b1172[_0x3a0a('0x46')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x47'),_0x5b1172[_0x3a0a('0x48')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x49'),_0x5b1172[_0x3a0a('0x4a')]);loggerPredictive[_0x3a0a('0x44')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b1172[_0x3a0a('0x4b')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x4c'),_0x5b1172['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x3a0a('0x4d'),_0x5b1172[_0x3a0a('0x4e')]);loggerPredictive['info']('---------------------------');if(_0x5b1172['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x5b1172[_0x3a0a('0x4e')])&&_0x5b1172[_0x3a0a('0x4e')]>0x0){return!![];}loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x4f'));if(!_[_0x3a0a('0x50')](_0x5b1172[_0x3a0a('0x51')])&&_0x5b1172[_0x3a0a('0x51')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x3a0a('0x44')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x3a0a('0x52'));}return![];}function mergeDataErlangB(_0x57d0e5){return function(_0x37999b){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x53'));loggerPredictive['info'](_0x3a0a('0x54'),_0x37999b['erlangCalls']);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x55'),_0x37999b[_0x3a0a('0x56')]);loggerPredictive[_0x3a0a('0x44')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37999b['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37999b[_0x3a0a('0x57')]);loggerPredictive['info'](_0x3a0a('0x58'),_0x37999b[_0x3a0a('0x59')]);loggerPredictive['info'](_0x3a0a('0x5a'));_[_0x3a0a('0x5b')](_0x57d0e5,_0x37999b);};}function ifInterval(_0x22803c,_0x3d769b){if(_[_0x3a0a('0x50')](_0x3d769b)){return![];}return utils['getSeconds'](undefined,_0x3d769b)<_0x22803c*0x3c;}function clearPredictiveAttributes(_0xccb1f4){if(_0xccb1f4['startProgressive']){_0xccb1f4[_0x3a0a('0x5c')]=undefined;loggerPredictive[_0x3a0a('0x3e')](_0xccb1f4[_0x3a0a('0x41')],_0x3a0a('0x5d'));}if(_0xccb1f4[_0x3a0a('0x5e')]){_0xccb1f4[_0x3a0a('0x5e')]=undefined;loggerPredictive[_0x3a0a('0x3e')](_0xccb1f4['name'],_0x3a0a('0x5f'));}if(_0xccb1f4['handlePredictive']){clearInterval(_0xccb1f4['handlePredictive']);_0xccb1f4[_0x3a0a('0x60')]=undefined;loggerPredictive['debug'](_0xccb1f4['name'],_0x3a0a('0x61'));}}function loggerCatchPredictive(_0x3b6f54,_0x1c0fee){return function(_0x194ec8){loggerPredictive['error'](_0x1c0fee[_0x3a0a('0x41')],_0x3b6f54);loggerPredictive[_0x3a0a('0x62')](_0x194ec8[_0x3a0a('0x63')]);clearPredictiveAttributes(_0x1c0fee);};}function loggerCatch(_0x569095){return function(_0x39aae1){logger[_0x3a0a('0x62')](_0x569095,util['inspect'](_0x39aae1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x17fc3f,_0x28937e,_0x1c330f){return function(_0x22b845){utils[_0x3a0a('0x64')](_0x28937e,_0x1c330f,0x0);logger[_0x3a0a('0x62')](_0x17fc3f,util[_0x3a0a('0x40')](_0x22b845,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x58467c){return function(_0x5e79c1){if(isNotNull(_0x5e79c1)&&isNotNull(_0x5e79c1[0x0])){if(_0x5e79c1[0x0]['contactsRescheduled']>0x0){_0x58467c['message']=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x3a0a('0x44')](_0x3a0a('0x65')+_0x58467c['name'],_0x5e79c1[0x0][_0x3a0a('0x66')],_0x3a0a('0x67'));}else{_0x58467c[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x6a')];logger[_0x3a0a('0x44')]('[getContactDialer2][Empty]'+_0x58467c[_0x3a0a('0x41')]);}}};}function createObjHistory(_0x55fb62,_0x4b7a42,_0x17262f,_0x35e0bd,_0x5b2496){_0x55fb62[_0x3a0a('0x68')]=_0x17262f;var _0x1edc36=new Action(_0x55fb62,_0x4b7a42);var _0x31fb77=new History(_0x1edc36);_0x31fb77[_0x3a0a('0x6b')]=_0x35e0bd;_0x31fb77[_0x3a0a('0x6c')]=_0x5b2496;_0x31fb77[_0x3a0a('0x6d')]=_0x1edc36['starttime'];return _0x31fb77;}function unlockQueueStatus(_0x4592d9,_0xe39578){setTimeout(function(){if(_[_0x3a0a('0x50')](_0x4592d9['queueStatusComplete'])){loggerBooked[_0x3a0a('0x62')](_0x3a0a('0x6e'),_0xe39578);}_0x4592d9['queueStatusComplete']=!![];loggerBooked[_0x3a0a('0x44')](_0x3a0a('0x6f'),_0xe39578,JSON[_0x3a0a('0x70')](_[_0x3a0a('0x71')](_0x4592d9,[_0x3a0a('0x41'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x53f9b6){return function(){if(!isNotNull(_0x53f9b6[_0x3a0a('0x72')])){_0x53f9b6['message']=utils[_0x3a0a('0x69')]['NULL_INTERVAL'];throw _0x53f9b6[_0x3a0a('0x41')]+_0x3a0a('0x73');}if(!isNotNull(_0x53f9b6[_0x3a0a('0x72')][_0x3a0a('0x74')])){_0x53f9b6[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x75')];throw _0x53f9b6['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x3a0a('0x43')](_0x53f9b6[_0x3a0a('0x72')][_0x3a0a('0x74')]))){_0x53f9b6[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x75')];throw _0x53f9b6[_0x3a0a('0x41')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x46ffa5){return function(){if(!utils[_0x3a0a('0x76')](_0x46ffa5)){_0x46ffa5['message']=utils[_0x3a0a('0x69')][_0x3a0a('0x77')];throw _0x46ffa5[_0x3a0a('0x41')]+_0x3a0a('0x78');}};}function emitCampaignSummary(_0x384dc5){if(utils[_0x3a0a('0x79')](_0x384dc5)){emit(util[_0x3a0a('0x7a')](_0x3a0a('0x7b'),_0x384dc5['name']),_0x3a0a('0x7c'),_0x384dc5);}}function loggerCatchQueueSummary(_0x575516,_0x48996e){return function(_0x55e5e4){clearPredictiveAttributes(_0x48996e);emitCampaignSummary(_0x48996e);loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x575516,util[_0x3a0a('0x40')](_0x55e5e4,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x6159f3){if(_0x6159f3[_0x3a0a('0x7d')]){if(_0x6159f3[_0x3a0a('0x7e')]===0x0){_0x6159f3[_0x3a0a('0x7d')]=![];_0x6159f3[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x77')];loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x7f'),_0x6159f3[_0x3a0a('0x41')],_0x3a0a('0x80'));}else{_0x6159f3[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x81')];loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x7f'),_0x6159f3[_0x3a0a('0x41')],_0x3a0a('0x82'));}emitCampaignSummary(_0x6159f3);}}function myreject(_0x20a6c1){return function(_0x18b58d){return _0x20a6c1(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x18b58d)));};}Dialer[_0x3a0a('0x18')][_0x3a0a('0x83')]=function(_0x1eb594){return!_[_0x3a0a('0x50')](_0x1eb594)&&_0x1eb594&&!_[_0x3a0a('0x50')](_0x1eb594['name'])&&!_[_0x3a0a('0x50')](_0x1eb594[_0x3a0a('0x84')])&&_0x1eb594[_0x3a0a('0x84')]&&(this[_0x3a0a('0x1f')][util[_0x3a0a('0x7a')](_0x3a0a('0x85'),_0x1eb594[_0x3a0a('0x41')])][_0x3a0a('0x86')]===_0x3a0a('0x87')||this['trunks'][util[_0x3a0a('0x7a')](_0x3a0a('0x85'),_0x1eb594['name'])][_0x3a0a('0x86')]===_0x3a0a('0x88'));};Dialer[_0x3a0a('0x18')]['checkIsTrunkReachable']=function(_0x44a18b){var _0x1a7908=this;return function(){if(!_0x1a7908[_0x3a0a('0x83')](_0x44a18b[_0x3a0a('0x89')])){if(!_0x1a7908['isTrunkReachable'](_0x44a18b[_0x3a0a('0x8a')])){_0x44a18b['message']=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x44a18b[_0x3a0a('0x41')]+_0x3a0a('0x8b');}}};};Dialer['prototype'][_0x3a0a('0x8c')]=function(_0x2ee2ac,_0x3839fa,_0x475f1f,_0x1561a3){var _0x411875=this;return function(){var _0x4a0ad6=!![];return _0x411875[_0x3a0a('0x8d')](_0x2ee2ac,_0x3839fa,_0x475f1f,_0x1561a3,_0x4a0ad6);};};Dialer['prototype'][_0x3a0a('0x8e')]=function(_0x58af3c,_0x38f6b3,_0x31b986,_0x280ce9){var _0x10276c=this;return function(){var _0x319257=![];return _0x10276c[_0x3a0a('0x8d')](_0x58af3c['Intervals'],_0x38f6b3,_0x31b986,_0x280ce9,_0x319257);};};Dialer['prototype']['ifTimeIvr']=function(_0x3d2861,_0x3bf807,_0x54ca82,_0x469f32,_0xecc9f3){var _0x4064d9=[];return new Promise(function(_0xc0da49,_0x413d66){if(!isNotNull(_0x3d2861)){_0x469f32[_0x3a0a('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x413d66(msgResponse(_0x3a0a('0x8f'),_0x3a0a('0x90'),_0x54ca82+_0x3a0a('0x91')));}if(_['isEmpty'](_0x3d2861)){_0x469f32['message']=utils[_0x3a0a('0x69')]['EMPTY_INTERVAL'];return _0x413d66(msgResponse(_0x3a0a('0x8f'),_0x3a0a('0x90'),_0x54ca82+_0x3a0a('0x92')));}if(_0x3bf807&&_[_0x3a0a('0x50')](config[_0x3a0a('0x93')][_0x3bf807])){_0x469f32[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x94')];return _0x413d66(msgResponse('ifTime',_0x3a0a('0x90'),_0x54ca82+'\x20Timezone\x20unknow\x20'+_0x3bf807));}if(_[_0x3a0a('0x95')](_0x3d2861)){for(var _0x1fa2d2=0x0;_0x1fa2d2<_0x3d2861[_0x3a0a('0x96')];_0x1fa2d2+=0x1){_0x4064d9[_0x3a0a('0x97')](ami['Action']({'action':_0x3a0a('0x98'),'command':util['format'](_0x3a0a('0x99'),_0x3d2861[_0x1fa2d2]['interval'],!_[_0x3a0a('0x50')](config['timezones'][_0x3bf807])?_0x3bf807:'')})['then'](function(_0x53fe1c){return _0x53fe1c[_0x3a0a('0x9a')][_0x3a0a('0x9b')](_0x3a0a('0x9c'))>=0x0;})[_0x3a0a('0x9d')](myreject(_0x413d66)));}}else{_0x4064d9[_0x3a0a('0x97')](ami[_0x3a0a('0x9e')]({'action':_0x3a0a('0x98'),'command':util[_0x3a0a('0x7a')]('iftime\x20%s,%s',_0x3d2861,!_['isUndefined'](config[_0x3a0a('0x93')][_0x3bf807])?_0x3bf807:'')})[_0x3a0a('0x9f')](function(_0x450b67){return _0x450b67[_0x3a0a('0x9a')][_0x3a0a('0x9b')](_0x3a0a('0x9c'))>=0x0;})[_0x3a0a('0x9d')](myreject(_0x413d66)));}Promise[_0x3a0a('0xa0')](_0x4064d9)[_0x3a0a('0x9f')](function(_0x350592){var _0x3b22f2=_[_0x3a0a('0xa1')](_0x350592);if(_0x3b22f2){return _0xc0da49(_0x3b22f2);}else{_0x469f32[_0x3a0a('0x68')]=_0xecc9f3?utils[_0x3a0a('0x69')][_0x3a0a('0xa2')]:utils['CAMPAIGN_STATUS'][_0x3a0a('0xa3')];return _0x413d66(msgResponse(_0x3a0a('0xa4'),_0x3a0a('0x90'),_0x3a0a('0xa5')+_0xecc9f3+'\x20'+_0x54ca82+_0x3a0a('0xa6')+util[_0x3a0a('0x40')](_0x3d2861,{'showHidden':![],'depth':null})+_0x3a0a('0xa7')+_0x3bf807));}})['catch'](function(_0x1ebe1b){return _0x413d66(msgResponse('ifTime',_0x3a0a('0x90'),JSON['stringify'](_0x1ebe1b)));});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0xa8')]=function(){var _0x5d9b05=this;return cmHopper[_0x3a0a('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0x3a0a('0x9f')](function(){setInterval(function(){_0x5d9b05[_0x3a0a('0xaa')]();},0x3e8);});};Dialer[_0x3a0a('0x18')][_0x3a0a('0xaa')]=function(){var _0x2ddc7c=this;var _0xeed980;for(var _0xdab3a8 in this[_0x3a0a('0xab')]){if(typeof this[_0x3a0a('0xab')][_0xdab3a8]!==_0x3a0a('0xac')){_0xeed980=this[_0x3a0a('0xab')][_0xdab3a8];if(utils['isIVRCampaign'](_0xeed980)&&utils[_0x3a0a('0x76')](_0xeed980)){_0xeed980[_0x3a0a('0x7d')]=!![];Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](checkIsIVRCampaignActive(_0xeed980))[_0x3a0a('0x9f')](checkInterval(_0xeed980))['then'](_0x2ddc7c['checkIsTrunkReachable'](_0xeed980))['then'](_0x2ddc7c['checkIfTime'](_0xeed980[_0x3a0a('0xae')],_0xeed980[_0x3a0a('0xaf')],_0xeed980[_0x3a0a('0x41')],_0xeed980))[_0x3a0a('0x9f')](_0x2ddc7c[_0x3a0a('0x8e')](_0xeed980[_0x3a0a('0x72')],_0xeed980[_0x3a0a('0xaf')],_0xeed980[_0x3a0a('0x41')],_0xeed980))['then'](_0x2ddc7c['launchHandleIvr'](_0xeed980))[_0x3a0a('0x9d')](loggerCatchQueueSummary(_0x3a0a('0xb0'),_0xeed980));}else{notSendMessagesCampaign(_0xeed980);}}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0xb1')]=function(_0x2a085a){if(_0x2a085a[_0x3a0a('0xb2')]!==_0x3a0a('0x8')){clearPredictiveAttributes(_0x2a085a);}switch(_0x2a085a['dialMethod']){case _0x3a0a('0xb3'):this[_0x3a0a('0xb4')](_0x2a085a,0x1);break;case _0x3a0a('0xb5'):this['handlePower'](_0x2a085a,_0x2a085a[_0x3a0a('0xb6')]);break;case'predictive':this[_0x3a0a('0x8')](_0x2a085a);break;case _0x3a0a('0xb7'):this['handlePower'](_0x2a085a,0x1);break;default:logger[_0x3a0a('0x62')](_0x3a0a('0xb8'),_0x2a085a[_0x3a0a('0x41')],'method\x20not\x20recognized');}};Dialer['prototype'][_0x3a0a('0x8f')]=function(_0x54f92a,_0x1b0fa3){var _0x42afaf=_0x54f92a[_0x3a0a('0xaf')];var _0x10b89a=_0x1b0fa3?_0x54f92a[_0x3a0a('0xae')]:_0x54f92a['Interval']['Intervals'];logger[_0x3a0a('0xb9')](_0x3a0a('0xba'),_0x10b89a,_0x42afaf,_0x54f92a[_0x3a0a('0x41')],util[_0x3a0a('0x7a')]('Voice\x20Queue\x20%s\x20$s',_0x54f92a['name'],_0x54f92a['id']));var _0x46516b=null;return Interval[_0x3a0a('0xbb')](_0x10b89a,_0x42afaf)[_0x3a0a('0x9f')](function(_0x3cb287){if(_0x3cb287===!![]){return _0x3cb287;}else{_0x54f92a[_0x3a0a('0x68')]=_0x1b0fa3?utils['CAMPAIGN_STATUS'][_0x3a0a('0xa2')]:utils['CAMPAIGN_STATUS'][_0x3a0a('0xa3')];_0x46516b=msgResponse(_0x3a0a('0xa4'),'Failure',_0x3a0a('0xa5')+_0x1b0fa3+'\x20'+_0x54f92a['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3a0a('0x40')](_0x10b89a,{'showHidden':![],'depth':null})+_0x3a0a('0xa7')+_0x42afaf);}if(_0x46516b!==null){logger['silly'](_0x3a0a('0xbc'),_0x46516b);_0x46516b[_0x3a0a('0xbd')]=_0x1b0fa3;throw _0x46516b;}})[_0x3a0a('0x9d')](function(_0x175d38){logger[_0x3a0a('0x62')](_0x3a0a('0xbe'),_0x175d38);throw msgResponse(_0x3a0a('0xbf'),'Error',util[_0x3a0a('0x40')](_0x175d38,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x3a0a('0x29')]=function(_0x1b48b8){if(this['voiceQueues'][_0x1b48b8[_0x3a0a('0xc0')]]){if(this[_0x3a0a('0x23')][_0x1b48b8[_0x3a0a('0xc1')]]&&this[_0x3a0a('0x23')][_0x1b48b8[_0x3a0a('0xc1')]][_0x3a0a('0x3c')]!=='ivr'){this['updateOriginated'](this['voiceQueues'][_0x1b48b8['queue']]);this[_0x3a0a('0x23')][_0x1b48b8['uniqueid']][_0x3a0a('0xc2')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3a0a('0x18')]['syncAgentComplete']=function(_0x12039e){var _0x1ade9d=this['uniqueId'][_0x12039e['uniqueid']];if(this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]){if(_0x1ade9d&&_0x1ade9d[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x12039e[_0x3a0a('0xc1')]];this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]['outboundAnswerCallsDay']+=0x1;var _0x243786=new AgentComplete(_0x1ade9d,_0x12039e);if(_0x12039e[_0x3a0a('0xc4')]===_0x3a0a('0xc5')){_0x243786[_0x3a0a('0xc6')]=this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]['dialQueueProject2']&&this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]][_0x3a0a('0xc7')]?moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8')):undefined;}hopperUtils[_0x3a0a('0xc9')](_0x243786)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xca')));hopperUtils['moveContactManagedDialer'](_0x243786)['catch'](loggerCatch(_0x3a0a('0xcb')));}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x2c')]=function(_0x38e14c){var _0x995e71=this[_0x3a0a('0x23')][_0x38e14c[_0x3a0a('0xc1')]];var _0x3454ac=this;var _0x543227=![];var _0x211944;var _0x577c4c;if(this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]]){if(_0x995e71&&_0x995e71[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x38e14c[_0x3a0a('0xc1')]];this['updateOriginated'](this[_0x3a0a('0x1d')][_0x38e14c['queue']]);_0x995e71[_0x3a0a('0xcc')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x503f95=new QueueCallerAbandon(_0x995e71,_0x38e14c);if(utils['getSeconds'](_0x995e71['droptime'],_0x995e71['responsetime'])>=_0x995e71[_0x3a0a('0xcd')]){this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0x4a')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xce')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xcf')]+=0x1;_0x503f95[_0x3a0a('0x6b')]=0xa;_0x503f95[_0x3a0a('0x6c')]=_0x3a0a('0xd0');_0x503f95[_0x3a0a('0xd1')]=_0x3a0a('0xd2');_0x503f95[_0x3a0a('0xc6')]=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd3')]?moment()['format'](_0x3a0a('0xc8')):undefined;_0x503f95[_0x3a0a('0xd4')]+=0x1;_0x503f95[_0x3a0a('0xd5')]+=0x1;_0x211944=this['voiceQueues'][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd6')];_0x577c4c=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xd8')](_0x503f95,_0x503f95[_0x3a0a('0x6b')],_0x995e71[_0x3a0a('0xd9')])[_0x3a0a('0x9f')](function(_0x4aeafd){_0x543227=_0x4aeafd[_0x3a0a('0xda')]==0x1;if(_0x503f95['countdropretry']>=_0x3454ac[_0x3a0a('0x1d')][_0x38e14c['queue']][_0x3a0a('0xdb')]){_0x3454ac[_0x3a0a('0xdc')](_0x503f95,_0x4aeafd['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x503f95[_0x3a0a('0xd4')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3454ac[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd6')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x995e71[_0x3a0a('0xdf')],'ListId':_0x995e71[_0x3a0a('0xe0')],'VoiceQueueId':_0x995e71['VoiceQueueId']||undefined,'CampaignId':_0x995e71['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe1')));var _0x4fafc2=new History(_0x503f95);_0x4fafc2[_0x3a0a('0x6b')]=0xa;_0x4fafc2[_0x3a0a('0x6c')]=_0x3a0a('0xd0');_0x4fafc2[_0x3a0a('0xe2')]=moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8'));_0x4fafc2[_0x3a0a('0x6d')]=_0x4fafc2[_0x3a0a('0xe2')];_0x4fafc2['calleridname']=_0x503f95[_0x3a0a('0xe3')];_0x4fafc2[_0x3a0a('0xe4')]=_0x503f95['calleridnum'];hopperUtils['createHistory'](_0x4fafc2)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe5')));}})[_0x3a0a('0x9f')](function(){if(_0x543227)hopperUtils[_0x3a0a('0xe6')](_0x503f95,_0x211944,_0x577c4c)[_0x3a0a('0x9f')](function(){return 0x1;});});}else{this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0x4b')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xe7')]+=0x1;_0x503f95[_0x3a0a('0x6b')]=0xb;_0x503f95[_0x3a0a('0x6c')]=_0x3a0a('0xe8');_0x503f95[_0x3a0a('0xd1')]='CALLEREXIT';_0x503f95[_0x3a0a('0xe9')]+=0x1;_0x503f95[_0x3a0a('0xd5')]+=0x1;_0x211944=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]]['dialAbandonedRetryFrequency'];_0x577c4c=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xd8')](_0x503f95,_0x503f95[_0x3a0a('0x6b')],_0x995e71[_0x3a0a('0xd9')])[_0x3a0a('0x9f')](function(_0x1c4d2a){if(_0x503f95[_0x3a0a('0xe9')]>=_0x3454ac[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xea')]){_0x3454ac[_0x3a0a('0xdc')](_0x503f95,_0x1c4d2a[_0x3a0a('0xda')]);}else{hopperUtils[_0x3a0a('0xeb')]({'active':![],'countabandonedretry':_0x503f95[_0x3a0a('0xe9')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3454ac[_0x3a0a('0x1d')][_0x38e14c['queue']][_0x3a0a('0xec')],'minutes')[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x995e71[_0x3a0a('0xdf')],'ListId':_0x995e71['ListId'],'VoiceQueueId':_0x995e71[_0x3a0a('0xed')]||undefined,'CampaignId':_0x995e71[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xef')));var _0xbad4ad=new History(_0x503f95);_0xbad4ad[_0x3a0a('0x6b')]=0xb;_0xbad4ad[_0x3a0a('0x6c')]=_0x3a0a('0xe8');_0xbad4ad['starttime']=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0xbad4ad[_0x3a0a('0x6d')]=_0xbad4ad[_0x3a0a('0xe2')];_0xbad4ad['calleridname']=_0x503f95[_0x3a0a('0xe3')];_0xbad4ad[_0x3a0a('0xe4')]=_0x503f95[_0x3a0a('0xe4')];hopperUtils[_0x3a0a('0xc9')](_0xbad4ad)['catch'](loggerCatch(_0x3a0a('0xf0')));}})[_0x3a0a('0x9f')](function(){if(_0x543227)hopperUtils['swapAdditionalPhones'](_0x503f95,_0x211944,_0x577c4c)[_0x3a0a('0x9f')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x48e80b){if(this[_0x3a0a('0x21')][_0x48e80b['uniqueid']]){this[_0x3a0a('0x21')][_0x48e80b['uniqueid']][_0x3a0a('0xf1')]=_0x48e80b[_0x3a0a('0xf1')];}if(this[_0x3a0a('0x23')][_0x48e80b[_0x3a0a('0xc1')]]){this['uniqueId'][_0x48e80b['uniqueid']][_0x3a0a('0xf1')]=_0x48e80b[_0x3a0a('0xf1')];}};Dialer[_0x3a0a('0x18')][_0x3a0a('0xf2')]=function(_0x35ba1e){if(!this[_0x3a0a('0x21')][_0x35ba1e['actionid']]){return;}var _0x23e8ea=this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]['strategy']||'rrmemory';if(_0x23e8ea==='roundrobin'){if(this[_0x3a0a('0x21')][_0x35ba1e['actionid']]&&_[_0x3a0a('0xf4')](this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf5')])&&_0x35ba1e[_0x3a0a('0x86')]==='1'&&_0x35ba1e[_0x3a0a('0xf6')]==='0'){if(this[_0x3a0a('0x1e')][_0x35ba1e[_0x3a0a('0xf7')]]){if(!this[_0x3a0a('0x1e')][_0x35ba1e['stateinterface']]['locked']){this[_0x3a0a('0x1e')][_0x35ba1e['stateinterface']][_0x3a0a('0xf5')]=!![];this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf5')]=!![];this['actions'][_0x35ba1e[_0x3a0a('0xf3')]]['stateinterface']=_0x35ba1e[_0x3a0a('0xf7')];}}}}else if(_0x23e8ea===_0x3a0a('0xf8')){if(this['actions'][_0x35ba1e['actionid']]){if(this[_0x3a0a('0x1e')][_0x35ba1e[_0x3a0a('0xf7')]]){this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]=_0x35ba1e['stateinterface'];if(_['isNil'](this[_0x3a0a('0x25')][this['actions'][_0x35ba1e['actionid']][_0x3a0a('0xc0')]])){this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]]['queue']]=[];}this[_0x3a0a('0x25')][this['actions'][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]['push'](_[_0x3a0a('0x5b')](_[_0x3a0a('0x71')](this[_0x3a0a('0x21')][_0x35ba1e['actionid']],[_0x3a0a('0xf9'),_0x3a0a('0xf7')]),{'status':_0x35ba1e[_0x3a0a('0x86')],'paused':_0x35ba1e[_0x3a0a('0xf6')]}));}}}};Dialer['prototype'][_0x3a0a('0xfa')]=function(_0x5a18f1){if(!this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]){return;}var _0x1f9d1e=this;var _0x245d6a=this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]];var _0x1ec865=_0x245d6a[_0x3a0a('0xfb')]||_0x3a0a('0xf8');if(_0x1ec865===_0x3a0a('0xfc')){if(this['actions'][_0x5a18f1['actionid']]&&this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]){this[_0x3a0a('0x1c')][_0x3a0a('0xfd')](this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['idHopper'],this['actions'][_0x5a18f1['actionid']][_0x3a0a('0xf7')])[_0x3a0a('0x9d')](function(_0x1a849e){logger[_0x3a0a('0x62')](_0x3a0a('0xfe'),util[_0x3a0a('0x40')](_0x1a849e,{'showHidden':![],'depth':null}));})[_0x3a0a('0x1a')](function(){_0x1f9d1e['updateOriginated'](_0x1f9d1e['voiceQueues'][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]]['queue']]);_0x1f9d1e[_0x3a0a('0x1e')][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]]['locked']=![];delete _0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1['actionid']];unlockQueueStatus(_0x245d6a);});}else{this[_0x3a0a('0xff')](this['voiceQueues'][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xdf')],'ListId':this[_0x3a0a('0x21')][_0x5a18f1['actionid']]['ListId'],'VoiceQueueId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xed')]||undefined,'CampaignId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x100')));delete this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]];unlockQueueStatus(_0x245d6a);}}else if(_0x1ec865===_0x3a0a('0xf8')){var _0x2d67fb;if(this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]&&!_[_0x3a0a('0x43')](this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]])){if(this['queueBookedRR'][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]){this[_0x3a0a('0x26')][_0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]=this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]?this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']]['queue']]:this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['queue']]?this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]['_rr']||0x0:0x0;}this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]][_0x3a0a('0x101')]=this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]];for(var _0x4c95a1=0x0;_0x4c95a1=_0x507882[_0x3a0a('0x12a')]){_0x46be5d['stateGlobal'](_0x1011b8,_0x262836,_0x28f485,_0x3a0a('0x12b'));}else{if(_0x1011b8['countmachineretry']>=_0x507882[_0x3a0a('0x12c')]){_0x46be5d[_0x3a0a('0x12d')](_0x1011b8,_0x262836,_0x28f485,_0x3a0a('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1011b8['countmachineretry'],'scheduledat':moment()['add'](_0x507882[_0x3a0a('0x12f')],_0x3a0a('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1011b8[_0x3a0a('0xdf')],'ListId':_0x1011b8[_0x3a0a('0xe0')],'VoiceQueueId':_0x1011b8['VoiceQueueId']||undefined,'CampaignId':_0x1011b8['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x130')));_0x262836({'reschedule':0x1});}}});}if(_0x39568a[_0x3a0a('0x3c')]===_0x3a0a('0xc3')&&this[_0x3a0a('0xab')][_0x39568a['queue']][_0x3a0a('0x114')]&&_0x2f157b[_0x3a0a('0x115')]==='HANGUP'){delete this[_0x3a0a('0x23')][_0x2f157b[_0x3a0a('0xc1')]];this['updateOriginated'](this[_0x3a0a('0xab')][_0x39568a[_0x3a0a('0xc0')]]);_0x4339be=new Hangup(_0x39568a,_0x2f157b);_0x4339be[_0x3a0a('0x6b')]=0x12;_0x4339be['statedesc']=_0x3a0a('0x118');_0x4339be[_0x3a0a('0x120')]=_0x3a0a('0x121');ami[_0x3a0a('0x3b')]('custom:amd',ut[_0x3a0a('0x11a')](_0x4339be,_0x3a0a('0x122')));this['saveInDb'](_0x4339be,_0x3a0a('0x131'),'[syncHangupInAMDIvr]');}if(_0x39568a[_0x3a0a('0x3c')]==='ivr'&&this['campaigns'][_0x39568a['queue']][_0x3a0a('0x114')]&&_0x2f157b[_0x3a0a('0x115')]===_0x3a0a('0x11e')){return new Promise(function(_0x146e38,_0x4747c8){delete _0x46be5d['uniqueId'][_0x2f157b[_0x3a0a('0xc1')]];_0x46be5d[_0x3a0a('0xff')](_0x46be5d[_0x3a0a('0xab')][_0x39568a[_0x3a0a('0xc0')]]);_0x46be5d[_0x3a0a('0xab')][_0x39568a['queue']]['outboundAnswerCallsDay']+=0x1;_0x46be5d[_0x3a0a('0xab')][_0x39568a['queue']][_0x3a0a('0x11f')]+=0x1;var _0x3cf273=_0x46be5d['campaigns'][_0x39568a['queue']];var _0x40294c=new Hangup(_0x39568a,_0x2f157b);_0x40294c[_0x3a0a('0x6b')]=0x13;_0x40294c[_0x3a0a('0x6c')]='Machine';_0x40294c[_0x3a0a('0x120')]='AMD';_0x40294c[_0x3a0a('0x128')]+=0x1;_0x40294c[_0x3a0a('0xd5')]+=0x1;_0x40294c['amd']=!![];ami[_0x3a0a('0x3b')]('custom:amd',ut['buildObj'](_0x40294c,'amd'));hopperUtils['createHistory'](_0x40294c)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x123')));if(_0x40294c[_0x3a0a('0x124')]+_0x40294c['countcongestionretry']+_0x40294c[_0x3a0a('0x126')]+_0x40294c[_0x3a0a('0x127')]+_0x40294c[_0x3a0a('0xd4')]+_0x40294c[_0x3a0a('0xe9')]+_0x40294c[_0x3a0a('0x128')]+_0x40294c[_0x3a0a('0x129')]>=_0x3cf273[_0x3a0a('0x12a')]){_0x46be5d[_0x3a0a('0x132')](_0x40294c,_0x146e38,_0x4747c8,_0x3a0a('0x12b'));}else{if(_0x40294c[_0x3a0a('0x128')]>=_0x3cf273['dialMachineMaxRetry']){_0x46be5d[_0x3a0a('0x12d')](_0x40294c,_0x146e38,_0x4747c8,_0x3a0a('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x40294c[_0x3a0a('0x128')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3cf273[_0x3a0a('0x12f')],_0x3a0a('0xde'))[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40294c[_0x3a0a('0xdf')],'ListId':_0x40294c[_0x3a0a('0xe0')],'VoiceQueueId':_0x40294c['VoiceQueueId']||undefined,'CampaignId':_0x40294c[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x130')));_0x146e38({'reschedule':0x1});}}});}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x133')]=function(_0x36ccb0){var _0x3abe28=this[_0x3a0a('0x23')][_0x36ccb0[_0x3a0a('0xc1')]];var _0x2c642e;if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]===_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x36ccb0['uniqueid']];this['updateOriginated'](this[_0x3a0a('0xab')][_0x3abe28['queue']]);this[_0x3a0a('0xab')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x134')]+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);hopperUtils[_0x3a0a('0xc9')](_0x2c642e)['catch'](loggerCatch(_0x3a0a('0x135')));hopperUtils['moveContactManagedDialer'](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x136')));}if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')&&isNotNull(this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x137')])){delete this['uniqueId'][_0x36ccb0['uniqueid']];this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][_0x3abe28['queue']]);this['voiceQueues'][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x117')]+=0x1;this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x11f')]+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);_0x2c642e['state']=0x10;_0x2c642e[_0x3a0a('0x6c')]=_0x3a0a('0x138');_0x2c642e[_0x3a0a('0x120')]=_0x3a0a('0x139');hopperUtils['createHistory'](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x135')));hopperUtils[_0x3a0a('0x13a')](_0x2c642e)['catch'](loggerCatch(_0x3a0a('0x136')));}if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]!=='ivr'&&!isNotNull(this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x137')])){delete this[_0x3a0a('0x23')][_0x36ccb0[_0x3a0a('0xc1')]];this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][_0x3abe28['queue']]);this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]]['outboundUnknownCallsDay']+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);_0x2c642e[_0x3a0a('0x6b')]=0xc;_0x2c642e[_0x3a0a('0x6c')]=_0x36ccb0[_0x3a0a('0x13b')];_0x2c642e[_0x3a0a('0x120')]=_0x3a0a('0x13c');hopperUtils[_0x3a0a('0xc9')](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x3a0a('0x13a')](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x136')));}};Dialer['prototype'][_0x3a0a('0x9')]=function(_0x407003){var _0x4b1d3c=this;if(!_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]]){_0x4b1d3c['queuesSummary'][_0x407003[_0x3a0a('0x41')]]={'running':![]};}else if(_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]][_0x3a0a('0x13d')]===!![]){return;}else if(_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]][_0x3a0a('0x13d')]===![]){_0x4b1d3c[_0x3a0a('0x27')][_0x407003['name']]['running']=!![];}var _0x1c2a73=_0x4b1d3c[_0x3a0a('0x1d')][_0x407003[_0x3a0a('0x41')]];var _0x270fd6=_0x1c2a73[_0x3a0a('0x68')]!==utils['CAMPAIGN_STATUS'][_0x3a0a('0x77')];var _0x277061=utils[_0x3a0a('0x13e')](_0x1c2a73);_0x1c2a73[_0x3a0a('0x13f')]=utils[_0x3a0a('0x140')](_0x1c2a73,_0x4b1d3c[_0x3a0a('0x1f')]);Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](function(){if(_0x1c2a73[_0x3a0a('0x13f')]===utils[_0x3a0a('0x69')][_0x3a0a('0x77')]){if(_0x270fd6){clearPredictiveAttributes(_0x1c2a73);_0x407003[_0x3a0a('0x5e')]=undefined;_0x407003[_0x3a0a('0x5c')]=undefined;}if(_0x1c2a73['statusMessage']===utils[_0x3a0a('0x69')][_0x3a0a('0x77')]){_0x407003[_0x3a0a('0x141')]=0x0;_0x407003[_0x3a0a('0xf6')]=0x0;_0x407003[_0x3a0a('0x142')]=0x0;_0x407003[_0x3a0a('0x143')]=0x0;_0x407003[_0x3a0a('0x144')]=0x0;}}else if(_0x1c2a73[_0x3a0a('0x13f')]===utils['CAMPAIGN_STATUS'][_0x3a0a('0x145')]&&!_0x277061){return _0x4b1d3c[_0x3a0a('0x8f')](_0x1c2a73,!![])['then'](function(){return _0x4b1d3c['ifTime'](_0x1c2a73,![]);})[_0x3a0a('0x9f')](function(){return _0x4b1d3c['checkDialMethod'](_0x1c2a73);})[_0x3a0a('0x9d')](function(_0x3e494a){loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x146'),util[_0x3a0a('0x40')](_0x3e494a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1c2a73);});}else{clearPredictiveAttributes(_0x1c2a73);}})[_0x3a0a('0x9f')](function(){var _0x34c88b=_0x407003[_0x3a0a('0x147')](_0x1c2a73);if(_0x34c88b||_0x1c2a73[_0x3a0a('0x148')]){_0x1c2a73[_0x3a0a('0x148')]=![];_0x407003[_0x3a0a('0x149')](_0x1c2a73);Object[_0x3a0a('0x14a')](_0x1c2a73,_0x407003);emitOutboundVoiceQueueSummary(_0x407003);}_0x4b1d3c[_0x3a0a('0x27')][_0x1c2a73[_0x3a0a('0x41')]][_0x3a0a('0x13d')]=![];})[_0x3a0a('0x9d')](function(_0xc91641){logger[_0x3a0a('0x62')](_0x3a0a('0x146'),util[_0x3a0a('0x40')](_0xc91641,{'showHidden':![],'depth':null}));_0x4b1d3c[_0x3a0a('0x27')][_0x1c2a73[_0x3a0a('0x41')]][_0x3a0a('0x13d')]=![];});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x33')]=_[_0x3a0a('0x14b')](function(){var _0x2ca91e=_['filter'](this[_0x3a0a('0x1d')],function(_0xf7b557){return _0xf7b557[_0x3a0a('0x14c')];});var _0x552460=_['filter'](this[_0x3a0a('0x1e')],function(_0x5f35cc){return _0x5f35cc[_0x3a0a('0x14d')]&&_0x5f35cc[_0x3a0a('0x86')]===_0x3a0a('0x87');});if(_0x2ca91e[_0x3a0a('0x96')]>0x0&&_0x552460['length']>0x0){return Promise[_0x3a0a('0xad')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x3a0a('0x14e')](_0x2ca91e,'id'),previewRecallmeReminderInterval,_['map'](_0x552460,'id')))[_0x3a0a('0x9f')](function(_0x526b11){for(var _0x100b81=0x0;_0x100b81<_0x526b11['length'];_0x100b81++){var _0x434992=_0x526b11[_0x100b81][_0x3a0a('0x14f')][_0x3a0a('0x41')];if(_0x434992)io['to'](util[_0x3a0a('0x7a')](_0x3a0a('0x150'),_0x434992))[_0x3a0a('0x3b')](_0x3a0a('0x151'),{'hopper':_0x526b11[_0x100b81]});}})['catch'](function(_0xaba4d0){logger[_0x3a0a('0x62')](_0x3a0a('0x152'),_0xaba4d0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3a0a('0x18')][_0x3a0a('0x153')]=function(){var _0x117113=this;setInterval(function(){_0x117113['clearZombieChannels'](_0x117113[_0x3a0a('0x23')],_0x3a0a('0x154'));_0x117113[_0x3a0a('0x155')](_0x117113['actions'],_0x3a0a('0x156'));},0x32c8);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x155')]=function(_0x5a56da,_0x204af5){var _0x2638fd=this;for(var _0x58c877 in _0x5a56da){if(typeof _0x5a56da[_0x58c877]!==_0x3a0a('0xac')){this[_0x3a0a('0x1b')][_0x3a0a('0x157')](function(){if(!_[_0x3a0a('0xf4')](_0x5a56da[_0x58c877])){return ami[_0x3a0a('0x9e')]({'action':_0x3a0a('0x86'),'channel':_0x5a56da[_0x58c877][_0x3a0a('0xf1')]})[_0x3a0a('0x9d')](function(_0x41914b){if(_0x41914b[_0x3a0a('0x68')]===_0x3a0a('0x158')){setTimeout(function(){if(_0x5a56da[_0x58c877]&&_0x5a56da[_0x58c877]['type']!==_0x3a0a('0xc3')){_0x2638fd['updateOriginated'](_0x2638fd[_0x3a0a('0x1d')][_0x5a56da[_0x58c877][_0x3a0a('0xc0')]]);logger[_0x3a0a('0x62')](_0x3a0a('0x159'),_0x204af5,_0x58c877,_0x5a56da[_0x58c877][_0x3a0a('0xc0')]);delete _0x5a56da[_0x58c877];}if(_0x5a56da[_0x58c877]&&_0x5a56da[_0x58c877][_0x3a0a('0x3c')]===_0x3a0a('0xc3')){_0x2638fd['updateOriginated'](_0x2638fd[_0x3a0a('0xab')][_0x5a56da[_0x58c877][_0x3a0a('0xc0')]]);logger['error'](_0x3a0a('0x15a'),_0x204af5,_0x58c877,_0x5a56da[_0x58c877][_0x3a0a('0xc0')]);delete _0x5a56da[_0x58c877];}},0x2328);}});}});}}};Dialer['prototype'][_0x3a0a('0x15b')]=function(_0xfbc377){return Promise['resolve']()['then'](voiceQueueRt[_0x3a0a('0x15b')](_0xfbc377))[_0x3a0a('0x9d')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x55ac75){if(!_[_0x3a0a('0x50')](_0x55ac75)&&_0x55ac75!==null){if(typeof _0x55ac75['originated']!=='undefined'){if(_0x55ac75[_0x3a0a('0x7e')]>0x0){_0x55ac75[_0x3a0a('0x7e')]-=0x1;}else{logger[_0x3a0a('0x62')](_0x3a0a('0x15c'));}}}else{logger['error'](_0x3a0a('0x15d'));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x15e')]=function(_0x4041c0,_0x47ebca){var _0x117110=this;return function(_0x58932b){_0x117110[_0x3a0a('0xff')](_0x47ebca);logger[_0x3a0a('0x62')](_0x4041c0,util[_0x3a0a('0x40')](_0x58932b,{'showHidden':![],'depth':null}));};};Dialer[_0x3a0a('0x18')]['emptyContact']=function(_0x7a96df,_0x3b888e,_0x2e8b9c){var _0x3594a0={'state':0x19,'statedesc':'notFound'};this[_0x3a0a('0xff')](_0x3b888e);this['saveInDb'](_[_0x3a0a('0x5b')](_0x3594a0,_['pick'](_0x2e8b9c,[_0x3a0a('0xdf'),_0x3a0a('0xe0'),'UserId',_0x3a0a('0xed'),_0x3a0a('0xee')])),_0x3a0a('0x15f'),'[emptyContact]');logger['error'](_0x7a96df);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x11b')]=function(_0x2141b4,_0x32c4f7,_0x12c078){hopperUtils['createHistory'](_0x2141b4)['catch'](loggerCatch(_0x32c4f7));hopperUtils[_0x3a0a('0x13a')](_0x2141b4)[_0x3a0a('0x9d')](loggerCatch(_0x12c078));};Dialer[_0x3a0a('0x18')][_0x3a0a('0xdc')]=function(_0x242a36,_0x2e766f){hopperUtils[_0x3a0a('0xc9')](_0x242a36)['catch'](loggerCatch(_0x3a0a('0xca')));if(_0x2e766f==0x0){hopperUtils[_0x3a0a('0x13a')](_0x242a36)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x160')));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x152')]=function(_0x19f671){return Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](cmHopper[_0x3a0a('0x161')](_0x19f671['id'],previewRecallmeReminderInterval))[_0x3a0a('0x9f')](function(_0x119760){for(var _0x3e7304=0x0;_0x3e7304<_0x119760['length'];_0x3e7304++){var _0x572ef8=_0x119760[_0x3e7304][_0x3a0a('0x14f')][_0x3a0a('0x41')];if(_0x572ef8)io['to'](util[_0x3a0a('0x7a')](_0x3a0a('0x150'),_0x572ef8))['emit'](_0x3a0a('0x151'),{'hopper':_0x119760[_0x3e7304]});}})[_0x3a0a('0x9d')](function(){});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x162')]=function(_0x5a7e4b){var _0x430f6b=this;return function(){_0x430f6b[_0x3a0a('0x163')](_0x5a7e4b);};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x164')]=function(_0x258178,_0x597547){var _0x797f94=this;var _0x4d2015=uuid['v4']();this['actions'][_0x4d2015]=new Action(_0x258178,_0x597547,_0x4d2015);return new Promise(function(_0xac5d11,_0x208dbe){if(_[_0x3a0a('0x50')](_0x258178)&&typeof _0x258178!==_0x3a0a('0x165')){return _0x208dbe(msgResponse(_0x3a0a('0x166'),_0x3a0a('0x90'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3a0a('0x50')](_0x597547['phone'])||_0x597547[_0x3a0a('0x167')]===null){return _0x208dbe(msgResponse(_0x3a0a('0x166'),_0x3a0a('0x90'),'contact\x20is\x20undefine'));}var _0x96099c={'XMD-CALLERID':_0x797f94[_0x3a0a('0x21')][_0x4d2015][_0x3a0a('0x168')](),'XMD-AGI':_0x258178[_0x3a0a('0x137')]?util[_0x3a0a('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x258178['dialQueueProject']):_0x3a0a('0x169'),'XMD-AGIAFTER':_0x258178[_0x3a0a('0xd3')]?util['format'](_0x3a0a('0x16a'),ipAgi,_0x258178['dialQueueProject2']):_0x3a0a('0x169'),'XMD-QUEUE':utils['isOutboundQueue'](_0x258178)?util[_0x3a0a('0x7a')](_0x3a0a('0x16b'),_0x258178[_0x3a0a('0x41')],_0x258178[_0x3a0a('0x16c')]||'',_0x258178['dialAgiAfterHangupAgent']?'c':'',_0x258178[_0x3a0a('0xcd')]||0x3):_0x3a0a('0x169'),'XMD-CONTACTID':_0x597547[_0x3a0a('0xdf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x797f94['actions'][_0x4d2015][_0x3a0a('0x168')](),'XMD-AMD':_0x258178['dialAMDActive']?_0x3a0a('0x145'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x258178[_0x3a0a('0x114')]){_0x96099c['XMD-AMDINITIALSILENCE']=_0x258178[_0x3a0a('0x16d')]||0x9c4;_0x96099c[_0x3a0a('0x16e')]=_0x258178[_0x3a0a('0x16f')]||0x5dc;_0x96099c[_0x3a0a('0x170')]=_0x258178['dialAMDAfterGreetingSilence']||0x320;_0x96099c[_0x3a0a('0x171')]=_0x258178[_0x3a0a('0x172')]||0x1388;_0x96099c[_0x3a0a('0x173')]=_0x258178[_0x3a0a('0x174')]||0x64;_0x96099c[_0x3a0a('0x175')]=_0x258178[_0x3a0a('0x176')]||0x32;_0x96099c[_0x3a0a('0x177')]=_0x258178[_0x3a0a('0x178')]||0x3;_0x96099c['XMD-AMDSILENCETHRESHOLD']=_0x258178[_0x3a0a('0x179')]||0x100;_0x96099c[_0x3a0a('0x17a')]=_0x258178[_0x3a0a('0x17b')]||0x1388;}if(utils['isOutboundQueue'](_0x258178)){_0x96099c[_0x3a0a('0x17c')]=_0x597547[_0x3a0a('0xed')];}else{_0x96099c['XMD-CAMPAIGNID']=_0x597547[_0x3a0a('0xee')];}for(var _0x53bc5d in _0x597547[_0x3a0a('0x17d')]){if(typeof _0x597547['Contact'][_0x53bc5d]!=='undefined'){if(isNotNull(_0x597547[_0x3a0a('0x17d')][_0x53bc5d])&&_0x53bc5d!=='id'&&_0x53bc5d!=='tags'&&_0x53bc5d!=='createdAt'&&_0x53bc5d!==_0x3a0a('0x17e')){_0x96099c[util[_0x3a0a('0x7a')](_0x3a0a('0x17f'),_0x3a0a('0x180'),_['toUpper'](_0x53bc5d))]=_0x597547[_0x3a0a('0x17d')][_0x53bc5d];}}}var _0x10692c=_0x797f94[_0x3a0a('0x83')](_0x258178[_0x3a0a('0x89')])?utils[_0x3a0a('0x181')](_0x258178[_0x3a0a('0x89')][_0x3a0a('0x182')],_0x258178[_0x3a0a('0x183')],_0x258178[_0x3a0a('0x184')]>0x0?utils[_0x3a0a('0x185')](_0x258178['dialOriginateCallerIdNumber'],_0x258178[_0x3a0a('0x184')]):_0x258178['dialOriginateCallerIdNumber']):utils[_0x3a0a('0x181')](_[_0x3a0a('0xf4')](_0x258178[_0x3a0a('0x8a')])?_0x258178[_0x3a0a('0x89')][_0x3a0a('0x182')]:_0x258178[_0x3a0a('0x8a')][_0x3a0a('0x182')],_0x258178['dialOriginateCallerIdName'],_0x258178[_0x3a0a('0x184')]>0x0?utils[_0x3a0a('0x185')](_0x258178[_0x3a0a('0x186')],_0x258178[_0x3a0a('0x184')]):_0x258178[_0x3a0a('0x186')]);if(_0x10692c){_0x96099c[_0x3a0a('0x187')]=_0x797f94[_0x3a0a('0x21')][_0x4d2015]['originatecalleridname']=utils[_0x3a0a('0x188')](_0x10692c);_0x96099c[_0x3a0a('0x189')]=_0x597547['phone'];}_0x258178['variables']=_0x96099c;return ami[_0x3a0a('0x9e')]({'actionid':_0x4d2015,'action':_0x3a0a('0x166'),'channel':_0x797f94[_0x3a0a('0x83')](_0x258178[_0x3a0a('0x89')])?util[_0x3a0a('0x7a')]('SIP/%s/%s%s',_0x258178[_0x3a0a('0x89')][_0x3a0a('0x41')],isNotNull(_0x258178['dialPrefix'])?_0x258178['dialPrefix']['trim']()||'':'',_0x258178[_0x3a0a('0x18a')]>0x0?_0x597547['phone'][_0x3a0a('0x18b')](_0x258178[_0x3a0a('0x18a')]):_0x597547[_0x3a0a('0x167')]):util['format'](_0x3a0a('0x18c'),_['isNil'](_0x258178[_0x3a0a('0x8a')])?_0x258178[_0x3a0a('0x89')][_0x3a0a('0x41')]:_0x258178[_0x3a0a('0x8a')]['name'],isNotNull(_0x258178[_0x3a0a('0x18d')])?_0x258178[_0x3a0a('0x18d')][_0x3a0a('0x18e')]()||'':'',_0x258178[_0x3a0a('0x18a')]>0x0?_0x597547[_0x3a0a('0x167')][_0x3a0a('0x18b')](_0x258178[_0x3a0a('0x18a')]):_0x597547['phone']),'callerid':_0x10692c,'Exten':_0x3a0a('0x113'),'Context':'from-sip','Priority':'1','variable':_0x96099c,'timeout':(_0x258178[_0x3a0a('0x18f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d2015})[_0x3a0a('0x9f')](function(_0x3337ad){return _0xac5d11(_0x3337ad);})[_0x3a0a('0x9d')](function(_0x25481e){_0x258178[_0x3a0a('0x190')]+=0x1;var _0xe89b72=new History(_0x797f94[_0x3a0a('0x21')][_0x4d2015]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x3a0a('0x70')](_0x25481e)));_0xe89b72[_0x3a0a('0x6b')]=0xe;_0xe89b72[_0x3a0a('0x6c')]=_0x3a0a('0x191');_0xe89b72['starttime']=moment()['format'](_0x3a0a('0xc8'));_0xe89b72[_0x3a0a('0x6d')]=_0xe89b72['starttime'];hopperUtils[_0x3a0a('0xc9')](_0xe89b72)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x192')));_0x797f94['moveContactManagedDialer'](_0xe89b72)[_0x3a0a('0x9d')](loggerCatch('[originate][error]'))[_0x3a0a('0x1a')](function(){delete _0x797f94[_0x3a0a('0x21')][_0x4d2015];return _0x208dbe(msgResponse('originate',_0x3a0a('0x193'),_0x3a0a('0x194')));});});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x195')]=function(_0x55c29a,_0x33de3d,_0x291119){var _0x51ba9b=new History(_0x33de3d);if(_0x51ba9b[_0x3a0a('0x124')]+_0x51ba9b['countcongestionretry']+_0x51ba9b[_0x3a0a('0x126')]+_0x51ba9b['countnosuchnumberretry']+_0x51ba9b[_0x3a0a('0xd4')]+_0x51ba9b['countabandonedretry']+_0x51ba9b[_0x3a0a('0x128')]+_0x51ba9b[_0x3a0a('0x129')]>=_0x291119['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x55c29a){case 0x3:if(_0x51ba9b['countnoanswerretry']>=_0x291119[_0x3a0a('0x196')]-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countnoanswerretry':_0x51ba9b[_0x3a0a('0x126')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119['dialNoAnswerRetryFrequency'],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x197')));break;case 0x5:if(_0x51ba9b[_0x3a0a('0x124')]>=_0x291119[_0x3a0a('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x51ba9b[_0x3a0a('0x124')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x199')],'minutes')[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x19a')));break;case 0x8:if(_0x51ba9b[_0x3a0a('0x125')]>=_0x291119[_0x3a0a('0x19b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x51ba9b[_0x3a0a('0x125')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x19c')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x19d')));break;case 0x0:if(_0x51ba9b[_0x3a0a('0x127')]>=_0x291119[_0x3a0a('0x19e')]-0x1){return!![];}else{hopperUtils[_0x3a0a('0xeb')]({'active':![],'countnosuchnumberretry':_0x51ba9b[_0x3a0a('0x127')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x19f')],_0x3a0a('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1a0')));}break;case 0xa:if(_0x51ba9b[_0x3a0a('0xd4')]>=_0x291119['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countdropretry':_0x51ba9b['countdropretry']+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0xd6')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe1')));break;case 0xb:if(_0x51ba9b[_0x3a0a('0xe9')]>=_0x291119[_0x3a0a('0xea')]-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countabandonedretry':_0x51ba9b[_0x3a0a('0xe9')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119['dialAbandonedRetryFrequency'],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xef')));break;case 0x13:if(_0x51ba9b['countmachineretry']>=_0x291119[_0x3a0a('0x12c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x51ba9b[_0x3a0a('0x128')]+=0x1,'scheduledat':moment()['add'](_0x291119[_0x3a0a('0x12f')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x51ba9b[_0x3a0a('0x129')]>=_0x291119[_0x3a0a('0x1a1')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x51ba9b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x1a2')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})['catch'](loggerCatch(_0x3a0a('0x1a3')));break;default:return!![];}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x10d')]=function(_0x2eb920,_0x4fe05d,_0x548864){var _0x2d18ac=this;var _0x2083a4=new History(_0x2eb920);var _0x571ef4=![];var _0x14a652;var _0x57eb8d;return new Promise(function(_0x352b42,_0x1e415e){if(_['isUndefined'](_0x4fe05d)&&typeof _0x4fe05d!==_0x3a0a('0x165')){return _0x1e415e(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x3a0a('0x50')](_0x548864)&&typeof _0x548864!=='object'){return _0x1e415e(msgResponse('[callProgressDetecting]',_0x3a0a('0x90'),_0x3a0a('0x1a4')));}hopperUtils['verifyAdditionalPhones'](_0x2083a4,_0x548864[_0x3a0a('0xc4')],_0x4fe05d)['then'](function(_0x10aca3){if(_0x10aca3['additional']==0x1)_0x571ef4=!![];switch(_0x548864[_0x3a0a('0xc4')]){case'0':_0x4fe05d[_0x3a0a('0x1a5')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x0;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1a6');_0x2083a4['countnosuchnumberretry']+=0x1;_0x2083a4['countglobal']+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1a7')));_0x14a652=_0x4fe05d['dialNoSuchNumberRetryFrequency'];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils['createHistory'](_0x2083a4)['catch'](loggerCatch(_0x3a0a('0x123')));if(_0x2d18ac[_0x3a0a('0x195')](0x0,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x127')]>=_0x4fe05d[_0x3a0a('0x19e')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x200\x20no\x20such\x20number....');}else{_0x2d18ac['stateGlobal'](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1a8'));}}break;case'3':_0x4fe05d[_0x3a0a('0x1a9')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x3;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1aa');_0x2083a4[_0x3a0a('0x126')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;var _0xddedf0=ut[_0x3a0a('0x1ab')](_0x2eb920,_0x4fe05d);ami[_0x3a0a('0x3b')](_0x3a0a('0x1ac'),_0xddedf0);_0x14a652=_0x4fe05d['dialNoAnswerRetryFrequency'];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils['createHistory'](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1ad')));if(_0x2d18ac[_0x3a0a('0x195')](0x3,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4['countnoanswerretry']>=_0x4fe05d[_0x3a0a('0x196')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1ae'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1ae'));}}break;case'5':_0x4fe05d['outboundBusyCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x5;_0x2083a4[_0x3a0a('0x6c')]='Busy';_0x2083a4[_0x3a0a('0x124')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;ami['emit'](_0x3a0a('0x1af'),ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1b0')));_0x14a652=_0x4fe05d[_0x3a0a('0x199')];_0x57eb8d=_0x4fe05d['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1b1')));if(_0x2d18ac[_0x3a0a('0x195')](0x5,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x124')]>=_0x4fe05d[_0x3a0a('0x198')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b2'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x205\x20busy');}}break;case'8':_0x4fe05d['outboundCongestionCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x8;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1b3');_0x2083a4[_0x3a0a('0x125')]+=0x1;_0x2083a4['countglobal']+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0x19c')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];ami['emit'](_0x3a0a('0x1b4'),ut['buildObj'](_0x2eb920,_0x3a0a('0x1b5')));hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1b6')));if(_0x2d18ac[_0x3a0a('0x195')](0x8,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4['countcongestionretry']>=_0x4fe05d['dialCongestionMaxRetry']){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b7'));}else{_0x2d18ac['stateGlobal'](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b7'));}}break;case'11':_0x4fe05d[_0x3a0a('0x1b8')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0xb;_0x2083a4[_0x3a0a('0x6c')]='Abandoned';_0x2083a4[_0x3a0a('0xe9')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0xec')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xf0')));if(_0x2d18ac[_0x3a0a('0x195')](0xb,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0xe9')]>=_0x4fe05d[_0x3a0a('0xea')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b9'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x2011\x20abandoned');}}break;case'20':_0x4fe05d['outboundRejectCallsDay']+=0x1;_0x2083a4['state']=0x14;_0x2083a4[_0x3a0a('0x6c')]='AgentReject';_0x2083a4[_0x3a0a('0x129')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0x1a2')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];ami[_0x3a0a('0x3b')](_0x3a0a('0x1ba'),ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1bb')));hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2d18ac['checkRetriveMax'](0x14,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x129')]>=_0x4fe05d[_0x3a0a('0x1a1')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x2020\x20agentreject');}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1bc'));}}break;default:_0x4fe05d['outboundUnknownCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0xc;_0x2083a4[_0x3a0a('0x6c')]=_0x548864['reason'];_0x14a652=_0x4fe05d[_0x3a0a('0x1a2')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xc9')](_0x2083a4)['catch'](loggerCatch(_0x3a0a('0x1bd')));if(_0x2d18ac[_0x3a0a('0x195')](_0x548864[_0x3a0a('0xc4')],_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x124')]+_0x2083a4['countcongestionretry']+_0x2083a4[_0x3a0a('0x126')]+_0x2083a4[_0x3a0a('0x127')]+_0x2083a4['countdropretry']+_0x2083a4['countabandonedretry']+_0x2083a4['countmachineretry']+_0x2083a4[_0x3a0a('0x129')]>=_0x4fe05d[_0x3a0a('0x12a')]){_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x548864['reason']);}else{_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x548864[_0x3a0a('0xc4')]);}}}})[_0x3a0a('0x9f')](function(){if(_0x571ef4){hopperUtils[_0x3a0a('0xe6')](_0x2083a4,_0x14a652,_0x57eb8d)[_0x3a0a('0x9f')](function(){return _0x352b42(0x1);});}});});};Dialer['prototype'][_0x3a0a('0x132')]=function(_0x4c0955,_0x346f88,_0xd350d1,_0x66bf1d){var _0x3ec6b2=new Final(_0x4c0955);_0x3ec6b2['state']=0xf;_0x3ec6b2[_0x3a0a('0x6c')]=_0x3a0a('0x1be');this[_0x3a0a('0x12d')](_0x3ec6b2,_0x346f88,_0xd350d1,_0x66bf1d);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x12d')]=function(_0x49be30,_0x2bdea7,_0x293b04,_0xd0a979){hopperUtils[_0x3a0a('0x13a')](_0x49be30)['then'](function(){return _0x2bdea7(msgResponse(_0x3a0a('0x1bf'),_0x3a0a('0x10c'),_0xd0a979));})[_0x3a0a('0x9d')](function(){return _0x293b04(msgResponse(_0x3a0a('0x1c0'),_0x3a0a('0x90'),_0x3a0a('0x1c1')));});};Dialer['prototype']['predictive']=function(_0x1c557b){var _0x3cacce=_0x1c557b[_0x3a0a('0x1c2')]/0x64;var _0xa9ae30=_0x1c557b['outboundDropCallsDayTimeout']/(_0x1c557b[_0x3a0a('0xce')]+_0x1c557b[_0x3a0a('0x117')]);var _0x102327=Math[_0x3a0a('0x1c3')](_0x1c557b[_0x3a0a('0x1c4')]*(_0x1c557b['predictiveIntervalMaxThreshold']/0x64));var _0x59e2ec=Math['round'](_0x1c557b['predictiveIntervalAvailable']*(_0x1c557b[_0x3a0a('0x1c5')]/0x64));var _0x267c78=_0x1c557b[_0x3a0a('0x141')]+_0x1c557b[_0x3a0a('0x143')];var _0x196bb4=Math['floor'](_0x1c557b[_0x3a0a('0x1c6')]*_0x1c557b[_0x3a0a('0x59')]*_0x1c557b['predictiveIntervalHitRate']*_0x1c557b[_0x3a0a('0x1c7')]);if(_[_0x3a0a('0x50')](_0x1c557b['startProgressive'])){if(!_[_0x3a0a('0x50')](_0x1c557b[_0x3a0a('0x5e')])){_0x1c557b[_0x3a0a('0x5e')]=undefined;loggerPredictive[_0x3a0a('0x62')](_0x3a0a('0x1c8'),_0x3a0a('0x1c9'));}if(!_[_0x3a0a('0x50')](_0x1c557b['handlePredictive'])){loggerPredictive[_0x3a0a('0x62')](_0x3a0a('0x1c8'),_0x3a0a('0x1ca'));clearInterval(_0x1c557b[_0x3a0a('0x60')]);_0x1c557b[_0x3a0a('0x60')]=undefined;}_0x1c557b[_0x3a0a('0x5c')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x1c557b[_0x3a0a('0x5c')]);this['handlePower'](_0x1c557b,0x1);}else if(ifInterval(_0x1c557b['dialPredictiveInterval'],_0x1c557b[_0x3a0a('0x5c')])){this['handlePower'](_0x1c557b,0x1);loggerPredictiveCalls[_0x3a0a('0x44')](_0x3a0a('0x1cb'),_0x1c557b['startProgressive'],_0x1c557b[_0x3a0a('0x41')]);_0x1c557b['erlangCalls']=0x0;_0x1c557b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3cacce<_0xa9ae30&&_0x1c557b[_0x3a0a('0x1cc')]===_0x3a0a('0x1cd')){clearPredictiveAttributes(_0x1c557b);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x1ce'),_0x3a0a('0x1cf'),_0xa9ae30,_0x3a0a('0x5c'),_0x1c557b['name']);}else if(_0x196bb4<_0x1c557b[_0x3a0a('0xcf')]&&_0x1c557b[_0x3a0a('0x1cc')]===_0x3a0a('0x1cd')){clearPredictiveAttributes(_0x1c557b);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x1d0'),_0x3a0a('0x1d1'),_0x196bb4,_0x3a0a('0x1d2'),_0x1c557b[_0x3a0a('0xcf')],_0x3a0a('0x5c'),_0x1c557b['name']);}else if(!ifInterval(_0x1c557b[_0x3a0a('0x1d3')],_0x1c557b[_0x3a0a('0x5c')])&&_[_0x3a0a('0x50')](_0x1c557b['startPredictive'])&&!_[_0x3a0a('0x50')](_0x1c557b[_0x3a0a('0x5c')])){_0x1c557b['startPredictive']=moment()['format'](_0x3a0a('0xc8'));loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'started\x20in\x20predictive\x20at',_0x1c557b[_0x3a0a('0x5e')]);hopperUtils[_0x3a0a('0x1d4')](_0x1c557b[_0x3a0a('0x1d3')])[_0x3a0a('0x9f')](this[_0x3a0a('0x1d5')](_0x1c557b))[_0x3a0a('0x9f')](mergeDataErlangB(_0x1c557b))[_0x3a0a('0x9f')](this['startMethodPredictive'](_0x1c557b))[_0x3a0a('0x9d')](loggerCatchPredictive(_0x3a0a('0x1d6'),_0x1c557b));}else if(!ifInterval(_0x1c557b[_0x3a0a('0x1d3')],_0x1c557b[_0x3a0a('0x5e')])){_0x1c557b[_0x3a0a('0xcf')]=0x0;_0x1c557b[_0x3a0a('0x5e')]=moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8'));loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'recalculate\x20predictive\x20at',_0x1c557b[_0x3a0a('0x5e')]);clearInterval(_0x1c557b[_0x3a0a('0x60')]);_0x1c557b['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x1c557b[_0x3a0a('0x1d3')])[_0x3a0a('0x9f')](this[_0x3a0a('0x1d5')](_0x1c557b))[_0x3a0a('0x9f')](mergeDataErlangB(_0x1c557b))[_0x3a0a('0x9f')](this[_0x3a0a('0x1d7')](_0x1c557b))[_0x3a0a('0x9d')](loggerCatchPredictive(_0x3a0a('0x1d8'),_0x1c557b));}else if(_0x1c557b[_0x3a0a('0x1c4')]&&_0x267c78<_0x1c557b[_0x3a0a('0x1c4')]-_0x59e2ec){clearPredictiveAttributes(_0x1c557b);loggerPredictive['info'](_0x1c557b[_0x3a0a('0x41')],_0x3a0a('0x1d9'),_0x267c78,_0x3a0a('0x1da'),_0x1c557b['predictiveIntervalAvailable'],'-',_0x59e2ec,'=',_0x1c557b[_0x3a0a('0x1c4')]-_0x59e2ec,')');}else if(_0x1c557b['predictiveIntervalAvailable']&&_0x267c78>_0x1c557b['predictiveIntervalAvailable']+_0x102327){clearPredictiveAttributes(_0x1c557b);loggerPredictive['info'](_0x1c557b[_0x3a0a('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x267c78,_0x3a0a('0x1db'),_0x1c557b['predictiveIntervalAvailable'],'+',_0x102327,'=',_0x1c557b[_0x3a0a('0x1c4')]+_0x102327,')');}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1d5')]=function(_0x5289d4){var _0x39dc0d=this;return function(_0x59a682){return new Promise(function(_0x5b9f66,_0x53dd49){_['merge'](_0x5289d4,_0x59a682[0x0]);if(checkGetDataPredictive(_0x59a682[0x0])){var _0xf8e9c4=_0x5289d4[_0x3a0a('0x1c4')]=_0x5289d4['talking']+_0x5289d4['available'];var _0x19d742=_0x5289d4[_0x3a0a('0x1d3')]*0x3c;var _0x19888f=_0x59a682[0x0][_0x3a0a('0x4e')]+_0x59a682[0x0]['predictiveIntervalAvgHoldtime'];var _0x40b70f=(_0x59a682[0x0][_0x3a0a('0x48')]+_0x59a682[0x0][_0x3a0a('0x4a')]+_0x59a682[0x0][_0x3a0a('0x4b')])/_0x59a682[0x0][_0x3a0a('0x46')];_0x5289d4['predictiveIntervalHitRate']=_0x40b70f>0x0?_0x40b70f:0x1;switch(_0x5289d4[_0x3a0a('0x1cc')]){case _0x3a0a('0x1cd'):var _0x2483e9=_0x5289d4['dialPredictiveOptimizationPercentage']/0x64;return _0x39dc0d[_0x3a0a('0x1dc')](_0xf8e9c4,_0x19d742,_0x19888f,_0x40b70f,_0x2483e9)[_0x3a0a('0x9f')](function(_0x3b6bf3){return _0x5b9f66(_0x3b6bf3);});case _0x3a0a('0x1dd'):var _0x467d75=_0x5289d4[_0x3a0a('0x1c2')]/0x64;return _0x39dc0d[_0x3a0a('0x1de')](_0xf8e9c4,_0x19d742,_0x19888f,_0x40b70f,_0x467d75)[_0x3a0a('0x9f')](function(_0x1606f9){return _0x5b9f66(_0x1606f9);});default:return _0x53dd49(msgResponse(_0x3a0a('0x1df'),_0x3a0a('0x90'),_0x3a0a('0x1e0')));}}else{return _0x53dd49(msgResponse(_0x3a0a('0x1df'),_0x3a0a('0x90'),_0x3a0a('0x1e1')));}});};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1e2')]=function(_0x3366a5){var _0x519a3a=this;return function(_0x3602db){return new Promise(function(_0xe571f1,_0x3855cc){_[_0x3a0a('0x5b')](_0x3366a5,_0x3602db[0x0]);if(checkGetDataPredictive(_0x3602db[0x0])){loggerPredictive[_0x3a0a('0x44')](JSON['stringify'](_0x3602db[0x0]));if(_0x3366a5[_0x3a0a('0x1cc')]==='dropRate'){return _0x519a3a[_0x3a0a('0x15b')](_0x3366a5['id'])[_0x3a0a('0x9f')](function(_0x53fb11){var _0x3af896=_0x3366a5[_0x3a0a('0x1e3')]-_0x53fb11[0x0][_0x3a0a('0x1e4')];var _0x55017a=_0x3366a5[_0x3a0a('0x1d3')]*0x3c;var _0x2f7db4=_0x3602db[0x0][_0x3a0a('0x4e')]+_0x3602db[0x0][_0x3a0a('0x51')];var _0x481e1a=(_0x3602db[0x0]['predictiveIntervalAnsweredCalls']+_0x3602db[0x0][_0x3a0a('0x4a')]+_0x3602db[0x0][_0x3a0a('0x4b')])/_0x3602db[0x0][_0x3a0a('0x46')];var _0x120d31=_0x3366a5['dialPredictiveOptimizationPercentage']/0x64;_0x3366a5[_0x3a0a('0x1e5')]=_0x53fb11[0x0][_0x3a0a('0x1e4')]||0x0;_0x3366a5[_0x3a0a('0x1e6')]=_0x481e1a>0x0?_0x481e1a:0x1;return _0x519a3a[_0x3a0a('0x1dc')](_0x3af896,_0x55017a,_0x2f7db4,_0x481e1a,_0x120d31);})[_0x3a0a('0x9f')](function(_0x3ce71d){return _0xe571f1(_0x3ce71d);})['catch'](function(_0x498cc9){return _0x3855cc(msgResponse(_0x3a0a('0x1e7'),'Failure',JSON[_0x3a0a('0x70')](_0x498cc9)));});}if(_0x3366a5[_0x3a0a('0x1cc')]===_0x3a0a('0x1dd')){return _0x519a3a[_0x3a0a('0x15b')](_0x3366a5['id'])[_0x3a0a('0x9f')](function(_0x59b82a){var _0x2b0216=_0x3366a5[_0x3a0a('0x1e3')]-_0x59b82a[0x0][_0x3a0a('0x1e4')];var _0x24e62a=_0x3366a5[_0x3a0a('0x1d3')]*0x3c;var _0x573739=_0x3602db[0x0][_0x3a0a('0x4e')]+_0x3602db[0x0]['predictiveIntervalAvgHoldtime'];var _0x19b419=(_0x3602db[0x0][_0x3a0a('0x48')]+_0x3602db[0x0][_0x3a0a('0x4a')]+_0x3602db[0x0][_0x3a0a('0x4b')])/_0x3602db[0x0][_0x3a0a('0x46')];var _0x21958e=_0x3366a5[_0x3a0a('0x1c2')]/0x64;_0x3366a5[_0x3a0a('0x1e5')]=_0x59b82a[0x0][_0x3a0a('0x1e4')]||0x0;_0x3366a5[_0x3a0a('0x1e6')]=_0x19b419>0x0?_0x19b419:0x1;return _0x519a3a[_0x3a0a('0x1de')](_0x2b0216,_0x24e62a,_0x573739,_0x19b419,_0x21958e);})[_0x3a0a('0x9f')](function(_0x45e244){return _0xe571f1(_0x45e244);})[_0x3a0a('0x9d')](function(_0x23c3c3){return _0x3855cc(msgResponse(_0x3a0a('0x1e7'),'Failure',JSON[_0x3a0a('0x70')](_0x23c3c3)));});}}else{return _0x3855cc(msgResponse('[getDataPredictive]',_0x3a0a('0x90'),_0x3a0a('0x1e1')));}});};};Dialer[_0x3a0a('0x18')]['startMethodPredictive']=function(_0x2dc084){var _0x20bec0=this;return function(){var _0x1a3255=0x0;var _0x214780=Math[_0x3a0a('0x1e8')](_0x2dc084[_0x3a0a('0x56')]*0x3e8);if(_0x214780>0x0){_0x214780=_0x214780<0x64?0x64:_0x214780;loggerPredictive['info'](_0x2dc084['name'],_0x3a0a('0x1e9'),_0x214780,_0x3a0a('0x1ea'));_0x2dc084['handlePredictive']=setInterval(function(){_0x20bec0['handlePredictive'](_0x2dc084);loggerPredictiveCalls[_0x3a0a('0x44')](_0x3a0a('0x1eb'),_0x1a3255+=0x1);},_0x214780);}else{loggerPredictive[_0x3a0a('0x44')](_0x2dc084['name'],_0x3a0a('0x1ec'));}};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1ed')]=function(_0x25c6f5,_0x41f419){var _0x20165c=this;return function(_0x54bdab){if(_[_0x3a0a('0x43')](_0x54bdab)){if(_[_0x3a0a('0xf4')](_0x41f419[_0x3a0a('0x1ee')])||!_0x41f419[_0x3a0a('0x1ef')]){if(_0x25c6f5[_0x3a0a('0xb2')]===_0x3a0a('0xb7')){_0x25c6f5['queueStatusComplete']=_['isUndefined'](_0x25c6f5[_0x3a0a('0x1f0')])?!![]:_0x25c6f5[_0x3a0a('0x1f0')];var _0x542ae8=uuid['v4']();_0x20165c['actions'][_0x542ae8]=new Action(_0x25c6f5,_0x41f419,_0x542ae8);loggerBooked['info'](_0x3a0a('0x1f1'),_0x542ae8,_0x3a0a('0x1f2'),JSON[_0x3a0a('0x70')](_0x25c6f5[_0x3a0a('0x1f0')]),_0x3a0a('0x1f3'),_0x25c6f5[_0x3a0a('0x41')]);if(_0x25c6f5[_0x3a0a('0x1f0')]){_0x25c6f5[_0x3a0a('0x1f0')]=![];_0x20165c['queueBooked'][_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xc0')]]=[];ami['Action']({'actionid':_0x542ae8,'action':'queuestatus','queue':_0x25c6f5[_0x3a0a('0x41')]})[_0x3a0a('0x9d')](function(){_0x20165c[_0x3a0a('0xff')](_0x25c6f5);hopperUtils[_0x3a0a('0xeb')]({'active':![],'ContactId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xdf')],'ListId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['ListId'],'VoiceQueueId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xed')]||undefined,'CampaignId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1f4')));delete _0x20165c[_0x3a0a('0x21')][_0x542ae8];});}else{loggerBooked[_0x3a0a('0x44')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x25c6f5['queueStatusComplete']),'Queue:\x20',_0x25c6f5['name']);_0x20165c[_0x3a0a('0xff')](_0x25c6f5);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xdf')],'ListId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['ListId'],'VoiceQueueId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['VoiceQueueId']||undefined,'CampaignId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1f4')));delete _0x20165c[_0x3a0a('0x21')][_0x542ae8];}}else{return _0x20165c['actionOriginate'](_0x25c6f5,_0x41f419);}}else{if(utils[_0x3a0a('0x1f5')](undefined,_0x41f419[_0x3a0a('0x1f6')])<_0x25c6f5[_0x3a0a('0x1f7')]*0x3c){if(_0x41f419['Agent']&&!_0x41f419[_0x3a0a('0x14f')][_0x3a0a('0x1f8')]){_0x20165c[_0x3a0a('0x1c')][_0x3a0a('0xfd')](_0x41f419['id'])['finally'](function(){_0x20165c['updateOriginated'](_0x25c6f5);});}else{hopperUtils['unlockContact']({'active':![]},_0x41f419['id'],0x1)['finally'](function(){_0x20165c[_0x3a0a('0xff')](_0x25c6f5);});}}else{_0x25c6f5[_0x3a0a('0x1f9')]+=0x1;_0x20165c['updateOriginated'](_0x25c6f5);if(_0x25c6f5[_0x3a0a('0x1fa')]){hopperUtils[_0x3a0a('0xeb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x41f419[_0x3a0a('0xdf')],'ListId':_0x41f419[_0x3a0a('0xe0')],'VoiceQueueId':_0x41f419[_0x3a0a('0xed')]||undefined,'CampaignId':_0x41f419['CampaignId']||undefined})['catch'](loggerCatch(_0x3a0a('0x1fb')));hopperUtils[_0x3a0a('0xc9')](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')][_0x3a0a('0x1fc')],0x17,_0x3a0a('0x1fd')))['catch'](loggerCatch(_0x3a0a('0x1fe')));}else{_0x20165c['saveInDb'](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x3a0a('0x1ff'),_0x3a0a('0x200'));}}}}else{_0x25c6f5['outboundBlacklistCallsDay']+=0x1;_0x20165c[_0x3a0a('0x11b')](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')]['BLACKLIST'],0xd,_0x3a0a('0x201')),'[Originate][historyBlacklist]',_0x3a0a('0x202'));throw _0x3a0a('0x203');}};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x163')]=function(_0x6ec426){var _0x329cc8=this;var _0x33204b=_0x6ec426[_0x3a0a('0x204')]-_0x6ec426[_0x3a0a('0x7e')]-_0x6ec426['temp'];emitCampaignSummary(_0x6ec426);if(_0x33204b>0x0){if(_0x33204b>this[_0x3a0a('0x20')]){_0x33204b=this[_0x3a0a('0x20')];}_0x6ec426[_0x3a0a('0x205')]+=_0x33204b;hopperUtils[_0x3a0a('0x206')](_0x6ec426['id'],_0x33204b,_0x6ec426[_0x3a0a('0x207')],_0x6ec426)[_0x3a0a('0x9f')](function(_0x55e09f){_0x6ec426['temp']-=_0x33204b;_0x6ec426[_0x3a0a('0x205')]=_0x6ec426['temp']>0x0?_0x6ec426[_0x3a0a('0x205')]:0x0;if(!utils[_0x3a0a('0x208')](_0x55e09f)){_0x6ec426['message']=utils[_0x3a0a('0x69')][_0x3a0a('0x6a')];logger[_0x3a0a('0x44')](_0x3a0a('0x209')+_0x6ec426[_0x3a0a('0x41')]);}else{_0x6ec426[_0x3a0a('0x7e')]+=_0x55e09f[_0x3a0a('0x96')];_0x6ec426[_0x3a0a('0x68')]=utils['CAMPAIGN_STATUS'][_0x3a0a('0x20a')];for(var _0x1c27f2=0x0;_0x1c27f2<_0x55e09f['length'];_0x1c27f2+=0x1){_0x6ec426[_0x3a0a('0x20b')]+=0x1;if(_[_0x3a0a('0xf4')](_0x55e09f[_0x1c27f2])||_[_0x3a0a('0xf4')](_0x55e09f[_0x1c27f2][_0x3a0a('0x17d')])||_['isNil'](_0x55e09f[_0x1c27f2][_0x3a0a('0x167')])){_0x329cc8[_0x3a0a('0x20c')](_0x3a0a('0x20d'),_0x6ec426,_0x55e09f[_0x1c27f2]);}else{hopperUtils[_0x3a0a('0x20e')](_[_0x3a0a('0x71')](_0x55e09f[_0x1c27f2],[_0x3a0a('0xee'),_0x3a0a('0x167')]))['then'](_0x329cc8[_0x3a0a('0x1ed')](_0x6ec426,_0x55e09f[_0x1c27f2]))[_0x3a0a('0x9d')](_0x329cc8[_0x3a0a('0x15e')](_0x3a0a('0x20f'),_0x6ec426));}}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x210'),_0x6ec426,_0x33204b));}};Dialer[_0x3a0a('0x18')]['handlePower']=function(_0x5383e5,_0x4420f2){var _0x434ccd=this;var _0x34971d=[];if(_0x4420f2<0x1||_0x5383e5['dialMethod']===_0x3a0a('0xb7')){_0x4420f2=0x1;}var _0x322964=Math['floor'](_0x5383e5[_0x3a0a('0x141')]*_0x4420f2)-_0x5383e5[_0x3a0a('0x7e')]-_0x5383e5[_0x3a0a('0x205')];if(_0x5383e5['dialLimitQueue']>0x0){var _0x78ed3f=_0x5383e5[_0x3a0a('0x211')]-_0x5383e5[_0x3a0a('0x7e')]-_0x5383e5['talking']-_0x5383e5[_0x3a0a('0x205')]-_0x5383e5['pTalking'];if(_0x322964>_0x78ed3f){_0x322964=_0x78ed3f;}}if(_0x322964>0x0){if(_0x5383e5['dialMethod']===_0x3a0a('0xb7')){_0x322964=0x1;}if(_0x322964>this['maxNumberOriginate']){_0x322964=this[_0x3a0a('0x20')];}_0x5383e5[_0x3a0a('0x205')]+=_0x322964;for(var _0x2ecd62 in this[_0x3a0a('0x1e')]){if(typeof this['agents'][_0x2ecd62]!==_0x3a0a('0xac')){if(this['agents'][_0x2ecd62][_0x3a0a('0x6b')]===_0x3a0a('0x212')&&this[_0x3a0a('0x1e')][_0x2ecd62][_0x3a0a('0x86')]===_0x3a0a('0x87')){_0x34971d[_0x3a0a('0x97')](this[_0x3a0a('0x1e')][_0x2ecd62]['id']);}}}hopperUtils['getContactDialer'](_0x5383e5,_0x34971d,_0x322964)[_0x3a0a('0x9f')](function(_0x3d75b3){_0x5383e5[_0x3a0a('0x205')]-=_0x322964;_0x5383e5['temp']=_0x5383e5[_0x3a0a('0x205')]>0x0?_0x5383e5[_0x3a0a('0x205')]:0x0;if(!utils[_0x3a0a('0x208')](_0x3d75b3)){hopperUtils[_0x3a0a('0x213')](_0x5383e5)['then'](sendMessageReschedule(_0x5383e5))['catch'](loggerCatch(_0x3a0a('0x214')));}else{_0x5383e5[_0x3a0a('0x7e')]+=_0x3d75b3[_0x3a0a('0x96')];_0x5383e5[_0x3a0a('0x68')]=_0x5383e5[_0x3a0a('0xb2')]===_0x3a0a('0xb7')?utils['CAMPAIGN_STATUS'][_0x3a0a('0x145')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x970d36=0x0;_0x970d36<_0x3d75b3['length'];_0x970d36+=0x1){if(_[_0x3a0a('0xf4')](_0x3d75b3[_0x970d36])||_[_0x3a0a('0xf4')](_0x3d75b3[_0x970d36][_0x3a0a('0x17d')])||_['isNil'](_0x3d75b3[_0x970d36]['phone'])){_0x434ccd['emptyContact'](_0x3a0a('0x20d'),_0x5383e5,_0x3d75b3[_0x970d36]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x3d75b3[_0x970d36],['VoiceQueueId',_0x3a0a('0x167')]))[_0x3a0a('0x9f')](_0x434ccd[_0x3a0a('0x1ed')](_0x5383e5,_0x3d75b3[_0x970d36]))[_0x3a0a('0x9d')](_0x434ccd[_0x3a0a('0x15e')](_0x3a0a('0x20d'),_0x5383e5));}}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x215'),_0x5383e5,_0x322964));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x60')]=function(_0xc11a57){if(_0xc11a57[_0x3a0a('0x211')]>0x0){var _0x1348c6=_0xc11a57['dialLimitQueue']-_0xc11a57[_0x3a0a('0x7e')]-_0xc11a57[_0x3a0a('0x143')];if(_0x1348c6>0x0){this[_0x3a0a('0x216')](_0xc11a57);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x3a0a('0x216')](_0xc11a57);}};Dialer[_0x3a0a('0x18')]['tryOriginatePredictive']=function(_0x435514){var _0x41f806=this;var _0x26bb89=[];_0x435514[_0x3a0a('0x7e')]+=0x1;for(var _0x3d0b7f in this['agents']){if(typeof this['agents'][_0x3d0b7f]!==_0x3a0a('0xac')){if(this[_0x3a0a('0x1e')][_0x3d0b7f][_0x3a0a('0x6b')]==='not_inuse'&&this[_0x3a0a('0x1e')][_0x3d0b7f]['status']===_0x3a0a('0x87')){_0x26bb89[_0x3a0a('0x97')](this['agents'][_0x3d0b7f]['id']);}}}return this[_0x3a0a('0x217')](_0x435514['id'],_0x26bb89,0x1,_0x435514[_0x3a0a('0x207')],_0x435514)['then'](function(_0x45eab){if(!utils['checkContactEmpty'](_0x45eab)){utils[_0x3a0a('0x64')](_0x435514,0x1,0x0);return hopperUtils[_0x3a0a('0x213')](_0x435514)[_0x3a0a('0x9f')](sendMessageReschedule(_0x435514))[_0x3a0a('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x435514[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x20a')];if(_['isNil'](_0x45eab[0x0])||_[_0x3a0a('0xf4')](_0x45eab[0x0][_0x3a0a('0x17d')])||_['isNil'](_0x45eab[0x0][_0x3a0a('0x167')])){_0x41f806['emptyContact'](_0x3a0a('0x20d'),_0x435514,_0x45eab[0x0]);}else{return hopperUtils[_0x3a0a('0x218')](_[_0x3a0a('0x71')](_0x45eab[0x0],[_0x3a0a('0xed'),'phone']))[_0x3a0a('0x9f')](_0x41f806[_0x3a0a('0x1ed')](_0x435514,_0x45eab[0x0]))[_0x3a0a('0x9d')](_0x41f806['loggerHandler'](_0x3a0a('0x219'),_0x435514));}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x21a'),_0x435514,0x1));};Dialer[_0x3a0a('0x18')]['abandonmentRate']=function(_0x17b2e2,_0x3da2e9,_0x29e3d9,_0x1bd4d2,_0x4624b9,_0x4f6bd9){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21b'));loggerPredictive['info'](_0x3a0a('0x21c'),_0x17b2e2);loggerPredictive['info'](_0x3a0a('0x21d'),_0x3da2e9);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21e'),_0x29e3d9);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21f'),_0x1bd4d2);loggerPredictive['info'](_0x3a0a('0x220'),_0x4624b9);loggerPredictive[_0x3a0a('0x44')]('---------------------------');return new Promise(function(_0x5a28e8,_0xe2ee27){if(_0x17b2e2<=0x0||isNaN(_0x17b2e2)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x222')+_0x17b2e2));}if(_0x29e3d9<=0x0||isNaN(_0x29e3d9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),'Ts\x20=\x20'+_0x29e3d9));}if(_0x1bd4d2<=0x0||isNaN(_0x1bd4d2)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),'p\x20=\x20'+_0x1bd4d2));}if(_0x3da2e9<=0x0||isNaN(_0x3da2e9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x223')+_0x3da2e9));}if(_0x4624b9<=0x0||isNaN(_0x4624b9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x224')+_0x4624b9));}_0x4f6bd9=_0x4f6bd9||0x0;var _0x5751f4=0x1/_0x29e3d9;var _0xc696e5=0x0;var _0x41506c=0x0;var _0x156b80=0x0;var _0x568a31=0x0;for(var _0x33569c=0x0;_0x156b80<_0x4624b9;_0x33569c+=0x1){_0x41506c=_0x33569c/_0x3da2e9;_0xc696e5=(_0x1bd4d2*_0x41506c+_0x4f6bd9)/_0x5751f4;_0x156b80=utils[_0x3a0a('0x225')](_0xc696e5,_0x17b2e2);_0x568a31=_0xc696e5/_0x17b2e2*(0x1-utils['erlangb'](_0xc696e5,_0x17b2e2));}return _0x5a28e8({'erlangCalls':_0x33569c,'erlangCallToSecond':_0x3da2e9/_0x33569c,'erlangAbandonmentRate':_0x156b80,'erlangBusyFactor':_0x568a31});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1de')]=function(_0x218d83,_0x11004a,_0x3c8740,_0x2ebdb5,_0x675a48,_0x551e8f){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x226'));loggerPredictive['info'](_0x3a0a('0x21c'),_0x218d83);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11004a);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21e'),_0x3c8740);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21f'),_0x2ebdb5);loggerPredictive['info'](_0x3a0a('0x227'),_0x675a48);loggerPredictive[_0x3a0a('0x44')]('---------------------------');return new Promise(function(_0x53a9b7,_0x46af32){if(_0x218d83<=0x0||isNaN(_0x218d83)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x222')+_0x218d83));}if(_0x3c8740<=0x0||isNaN(_0x3c8740)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x229')+_0x3c8740));}if(_0x2ebdb5<=0x0||isNaN(_0x2ebdb5)){return _0x46af32(msgResponse(_0x3a0a('0x228'),'Error',_0x3a0a('0x22a')+_0x2ebdb5));}if(_0x11004a<=0x0||isNaN(_0x11004a)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x223')+_0x11004a));}if(_0x675a48<=0x0||isNaN(_0x675a48)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x22b')+_0x675a48));}_0x551e8f=_0x551e8f||0x0;var _0x3aa421=0x1/_0x3c8740;var _0x14136f=0x0;var _0x331b3f=0x0;var _0x9d4f09=0x0;var _0x5c4d0b=0x0;for(var _0x2fe722=0x0;_0x5c4d0b<_0x675a48;_0x2fe722+=0x1){_0x331b3f=_0x2fe722/_0x11004a;_0x14136f=(_0x2ebdb5*_0x331b3f+_0x551e8f)/_0x3aa421;_0x9d4f09=utils[_0x3a0a('0x225')](_0x14136f,_0x218d83);_0x5c4d0b=_0x14136f/_0x218d83*(0x1-utils[_0x3a0a('0x225')](_0x14136f,_0x218d83));}return _0x53a9b7({'erlangCalls':_0x2fe722,'erlangCallToSecond':_0x11004a/_0x2fe722,'erlangAbandonmentRate':_0x9d4f09,'erlangBusyFactor':_0x5c4d0b});});};module[_0x3a0a('0x22c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 289e983..9c23770 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe41=['originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x435df5,_0x405a75){var _0x14576f=function(_0x38b625){while(--_0x38b625){_0x435df5['push'](_0x435df5['shift']());}};_0x14576f(++_0x405a75);}(_0xfe41,0x169));var _0x1fe4=function(_0x338a58,_0x2d5ac5){_0x338a58=_0x338a58-0x0;var _0x92bd1d=_0xfe41[_0x338a58];return _0x92bd1d;};'use strict';var util=require(_0x1fe4('0x0'));var _=require(_0x1fe4('0x1'));var moment=require(_0x1fe4('0x2'));function checkNameSurname(_0x5c1de3,_0x393aca,_0x2ccbde){var _0x4ab231='';if(!_[_0x1fe4('0x3')](_0x393aca)&&_0x1fe4('0x4')===typeof _0x393aca){_0x4ab231+=_0x393aca;}if(!_[_0x1fe4('0x3')](_0x2ccbde)&&_0x1fe4('0x4')===typeof _0x2ccbde){_0x4ab231+='\x20'+_0x2ccbde;}if(_0x4ab231!==''){return _0x4ab231;}return _0x5c1de3;}function Action(_0x882322,_0x4ff7ec,_0x4cfc07){this[_0x1fe4('0x5')]=_0x882322;this[_0x1fe4('0x6')]=_0x4cfc07||undefined;this[_0x1fe4('0x7')]=checkNameSurname(_0x4ff7ec[_0x1fe4('0x8')][_0x1fe4('0x9')],_0x4ff7ec[_0x1fe4('0x8')]['firstName'],_0x4ff7ec[_0x1fe4('0x8')][_0x1fe4('0xa')]);this[_0x1fe4('0xb')]=_0x4ff7ec['phone'];this['queue']=_0x882322[_0x1fe4('0x7')];this['active']=_0x4ff7ec[_0x1fe4('0xc')]||![];this[_0x1fe4('0xd')]=_0x882322['type'];this[_0x1fe4('0xe')]=_0x882322[_0x1fe4('0xe')]||0x3;this[_0x1fe4('0xf')]=_0x4ff7ec[_0x1fe4('0xf')];this['countbusyretry']=_0x4ff7ec[_0x1fe4('0x10')];this[_0x1fe4('0x11')]=_0x4ff7ec['countcongestionretry'];this[_0x1fe4('0x12')]=_0x4ff7ec[_0x1fe4('0x12')];this[_0x1fe4('0x13')]=_0x4ff7ec[_0x1fe4('0x13')];this[_0x1fe4('0x14')]=_0x4ff7ec['countdropretry'];this[_0x1fe4('0x15')]=_0x4ff7ec[_0x1fe4('0x15')];this[_0x1fe4('0x16')]=_0x4ff7ec['countmachineretry'];this['countagentrejectretry']=_0x4ff7ec['countagentrejectretry'];this[_0x1fe4('0x17')]=_0x4ff7ec[_0x1fe4('0x17')];this[_0x1fe4('0x18')]=_0x4ff7ec[_0x1fe4('0x18')];this[_0x1fe4('0x19')]=_0x4ff7ec[_0x1fe4('0x19')];this['VoiceQueueId']=_0x4ff7ec['VoiceQueueId'];this[_0x1fe4('0x1a')]=_0x4ff7ec['CampaignId'];this[_0x1fe4('0x1b')]=_0x4ff7ec['id'];this[_0x1fe4('0x1c')]=_0x4ff7ec[_0x1fe4('0x8')]['firstName']||'';this[_0x1fe4('0x1d')]=moment()['format'](_0x1fe4('0x1e'));this[_0x1fe4('0x1f')]=_0x4ff7ec['callback'];this[_0x1fe4('0x20')]=_0x4ff7ec[_0x1fe4('0x20')];this[_0x1fe4('0x21')]=_0x4ff7ec[_0x1fe4('0x21')];this[_0x1fe4('0x22')]=_0x4ff7ec[_0x1fe4('0x22')];this['originatecalleridnum']='';this[_0x1fe4('0x23')]='';}Action['prototype'][_0x1fe4('0x24')]=function(){return util[_0x1fe4('0x25')](_0x1fe4('0x26'),this[_0x1fe4('0x7')],this['voiceQueue'][_0x1fe4('0x27')]>0x0?this[_0x1fe4('0xb')]['substring'](this[_0x1fe4('0x5')]['dialCutDigit']):this[_0x1fe4('0xb')]);};Action[_0x1fe4('0x28')][_0x1fe4('0x29')]=function(){return this[_0x1fe4('0x2a')];};module[_0x1fe4('0x2b')]=Action; \ No newline at end of file +var _0x032a=['countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','dialCutDigit','substring','exports','util','lodash','moment','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry'];(function(_0x7ad6c4,_0x22b0f2){var _0x21eef2=function(_0x48aee2){while(--_0x48aee2){_0x7ad6c4['push'](_0x7ad6c4['shift']());}};_0x21eef2(++_0x22b0f2);}(_0x032a,0x135));var _0xa032=function(_0x257017,_0x330627){_0x257017=_0x257017-0x0;var _0x38536d=_0x032a[_0x257017];return _0x38536d;};'use strict';var util=require(_0xa032('0x0'));var _=require(_0xa032('0x1'));var moment=require(_0xa032('0x2'));function checkNameSurname(_0x33cae8,_0x4a5177,_0x33e78f){var _0x10cb6b='';if(!_['isNil'](_0x4a5177)&&_0xa032('0x3')===typeof _0x4a5177){_0x10cb6b+=_0x4a5177;}if(!_['isNil'](_0x33e78f)&&_0xa032('0x3')===typeof _0x33e78f){_0x10cb6b+='\x20'+_0x33e78f;}if(_0x10cb6b!==''){return _0x10cb6b;}return _0x33cae8;}function Action(_0x3b24df,_0x434465,_0x1228fd){this[_0xa032('0x4')]=_0x3b24df;this[_0xa032('0x5')]=_0x1228fd||undefined;this['name']=checkNameSurname(_0x434465[_0xa032('0x6')][_0xa032('0x7')],_0x434465[_0xa032('0x6')][_0xa032('0x8')],_0x434465['Contact'][_0xa032('0x9')]);this[_0xa032('0xa')]=_0x434465[_0xa032('0x7')];this[_0xa032('0xb')]=_0x3b24df[_0xa032('0xc')];this['active']=_0x434465['active']||![];this[_0xa032('0xd')]=_0x3b24df[_0xa032('0xd')];this[_0xa032('0xe')]=_0x3b24df[_0xa032('0xe')]||0x3;this[_0xa032('0xf')]=_0x434465['scheduledat'];this[_0xa032('0x10')]=_0x434465[_0xa032('0x10')];this[_0xa032('0x11')]=_0x434465['countcongestionretry'];this['countnoanswerretry']=_0x434465['countnoanswerretry'];this[_0xa032('0x12')]=_0x434465[_0xa032('0x12')];this['countdropretry']=_0x434465['countdropretry'];this[_0xa032('0x13')]=_0x434465[_0xa032('0x13')];this['countmachineretry']=_0x434465[_0xa032('0x14')];this[_0xa032('0x15')]=_0x434465[_0xa032('0x15')];this[_0xa032('0x16')]=_0x434465[_0xa032('0x16')];this[_0xa032('0x17')]=_0x434465[_0xa032('0x17')];this['UserId']=_0x434465[_0xa032('0x18')];this[_0xa032('0x19')]=_0x434465[_0xa032('0x19')];this[_0xa032('0x1a')]=_0x434465['CampaignId'];this[_0xa032('0x1b')]=_0x434465['id'];this[_0xa032('0x1c')]=_0x434465['Contact'][_0xa032('0x8')]||'';this['starttime']=moment()[_0xa032('0x1d')](_0xa032('0x1e'));this[_0xa032('0x1f')]=_0x434465[_0xa032('0x1f')];this[_0xa032('0x20')]=_0x434465['callbackuniqueid'];this[_0xa032('0x21')]=_0x434465['callbackat'];this[_0xa032('0x22')]=_0x434465['recallme'];this['originatecalleridnum']='';this[_0xa032('0x23')]='';}Action[_0xa032('0x24')][_0xa032('0x25')]=function(){return util[_0xa032('0x1d')]('\x22%s\x22\x20<%s>',this['name'],this[_0xa032('0x4')][_0xa032('0x26')]>0x0?this[_0xa032('0xa')][_0xa032('0x27')](this[_0xa032('0x4')][_0xa032('0x26')]):this[_0xa032('0xa')]);};Action[_0xa032('0x24')]['getQueue']=function(){return this[_0xa032('0xb')];};module[_0xa032('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index c7feea3..d2f52b0 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2419=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','statedesc','Answer','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2419,0xd3));var _0x9241=function(_0x521391,_0x4edca9){_0x521391=_0x521391-0x0;var _0x283148=_0x2419[_0x521391];return _0x283148;};'use strict';var moment=require('moment');var utils=require(_0x9241('0x0'));function AgentComplete(_0x511654,_0x3a7c36){this['state']=0x4;this[_0x9241('0x1')]=_0x9241('0x2');this['scheduledat']=_0x511654['scheduledat'];this['type']=_0x511654[_0x9241('0x3')];this[_0x9241('0x4')]=_0x511654[_0x9241('0x3')]===_0x9241('0x5')?_0x9241('0x6'):_0x511654[_0x9241('0x3')];this[_0x9241('0x7')]=_0x511654[_0x9241('0x7')];this[_0x9241('0x8')]=_0x511654[_0x9241('0x8')];this[_0x9241('0x9')]=_0x511654[_0x9241('0x9')];this['countglobal']=_0x511654[_0x9241('0x7')]+_0x511654[_0x9241('0x8')]+_0x511654[_0x9241('0x9')]+_0x511654[_0x9241('0xa')]+_0x511654[_0x9241('0xb')]+_0x511654[_0x9241('0xc')]+_0x511654['countmachineretry']+_0x511654['countagentrejectretry'];this[_0x9241('0xa')]=_0x511654['countnosuchnumberretry'];this[_0x9241('0xb')]=_0x511654[_0x9241('0xb')];this[_0x9241('0xc')]=_0x511654[_0x9241('0xc')];this[_0x9241('0xd')]=_0x511654[_0x9241('0xd')];this[_0x9241('0xe')]=_0x511654[_0x9241('0xe')];this[_0x9241('0xf')]=_0x3a7c36[_0x9241('0xf')];this[_0x9241('0x10')]=_0x511654[_0x9241('0x11')];this[_0x9241('0x12')]=_0x511654[_0x9241('0x13')];this[_0x9241('0x14')]=_0x511654[_0x9241('0x14')];this[_0x9241('0x15')]=_0x511654['responsetime'];this[_0x9241('0x16')]=_0x511654[_0x9241('0x16')];this[_0x9241('0x17')]=moment()[_0x9241('0x18')](_0x9241('0x19'));this[_0x9241('0x1a')]=utils[_0x9241('0x1b')](_0x511654[_0x9241('0x15')],_0x511654[_0x9241('0x14')]);this[_0x9241('0x1c')]=utils[_0x9241('0x1b')](_0x511654[_0x9241('0x16')],_0x511654['responsetime']);this['talktime']=utils[_0x9241('0x1b')](this[_0x9241('0x17')],_0x511654[_0x9241('0x16')]);this[_0x9241('0x6')]=_0x3a7c36[_0x9241('0x6')];this[_0x9241('0x1d')]=_0x3a7c36[_0x9241('0x1d')];this[_0x9241('0x1e')]=_0x3a7c36[_0x9241('0x1e')];this[_0x9241('0x1f')]=_0x511654['callback'];this[_0x9241('0x20')]=_0x511654[_0x9241('0x20')];this[_0x9241('0x21')]=_0x511654[_0x9241('0x21')];this[_0x9241('0x22')]=_0x511654[_0x9241('0x22')];this['ContactId']=_0x511654[_0x9241('0x23')];this['ListId']=_0x511654['ListId'];this[_0x9241('0x24')]=_0x511654['UserId'];this[_0x9241('0x25')]=_0x511654[_0x9241('0x25')];this[_0x9241('0x26')]=_0x511654[_0x9241('0x26')];this[_0x9241('0x27')]=_0x511654[_0x9241('0x27')]||'';this[_0x9241('0x28')]=_0x511654[_0x9241('0x28')]||'';this[_0x9241('0x29')]=_0x511654['agiafterat'];}module[_0x9241('0x2a')]=AgentComplete; \ No newline at end of file +var _0xa511=['originatecalleridnum','originatecalleridname','agiafterat','exports','state','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','answertime','format','ringtime','getSeconds','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xa511,0x144));var _0x1a51=function(_0x5ddef9,_0x263512){_0x5ddef9=_0x5ddef9-0x0;var _0x416904=_0xa511[_0x5ddef9];return _0x416904;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0x3bc979,_0x37c7ec){this[_0x1a51('0x0')]=0x4;this['statedesc']='Answer';this[_0x1a51('0x1')]=_0x3bc979[_0x1a51('0x1')];this[_0x1a51('0x2')]=_0x3bc979[_0x1a51('0x2')];this[_0x1a51('0x3')]=_0x3bc979[_0x1a51('0x2')]===_0x1a51('0x4')?'queue':_0x3bc979['type'];this['countbusyretry']=_0x3bc979[_0x1a51('0x5')];this['countcongestionretry']=_0x3bc979[_0x1a51('0x6')];this[_0x1a51('0x7')]=_0x3bc979[_0x1a51('0x7')];this[_0x1a51('0x8')]=_0x3bc979[_0x1a51('0x5')]+_0x3bc979['countcongestionretry']+_0x3bc979[_0x1a51('0x7')]+_0x3bc979['countnosuchnumberretry']+_0x3bc979[_0x1a51('0x9')]+_0x3bc979[_0x1a51('0xa')]+_0x3bc979[_0x1a51('0xb')]+_0x3bc979['countagentrejectretry'];this[_0x1a51('0xc')]=_0x3bc979[_0x1a51('0xc')];this[_0x1a51('0x9')]=_0x3bc979['countdropretry'];this[_0x1a51('0xa')]=_0x3bc979['countabandonedretry'];this[_0x1a51('0xb')]=_0x3bc979[_0x1a51('0xb')];this['countagentrejectretry']=_0x3bc979[_0x1a51('0xd')];this['uniqueid']=_0x37c7ec['uniqueid'];this[_0x1a51('0xe')]=_0x3bc979['name'];this[_0x1a51('0xf')]=_0x3bc979[_0x1a51('0x10')];this[_0x1a51('0x11')]=_0x3bc979['starttime'];this['responsetime']=_0x3bc979[_0x1a51('0x12')];this[_0x1a51('0x13')]=_0x3bc979[_0x1a51('0x13')];this['endtime']=moment()[_0x1a51('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a51('0x15')]=utils[_0x1a51('0x16')](_0x3bc979['responsetime'],_0x3bc979[_0x1a51('0x11')]);this[_0x1a51('0x17')]=utils[_0x1a51('0x16')](_0x3bc979[_0x1a51('0x13')],_0x3bc979['responsetime']);this['talktime']=utils[_0x1a51('0x16')](this[_0x1a51('0x18')],_0x3bc979[_0x1a51('0x13')]);this['queue']=_0x37c7ec[_0x1a51('0x19')];this[_0x1a51('0x1a')]=_0x37c7ec[_0x1a51('0x1a')];this[_0x1a51('0x1b')]=_0x37c7ec[_0x1a51('0x1b')];this['callback']=_0x3bc979[_0x1a51('0x1c')];this[_0x1a51('0x1d')]=_0x3bc979[_0x1a51('0x1d')];this[_0x1a51('0x1e')]=_0x3bc979['callbackat'];this[_0x1a51('0x1f')]=_0x3bc979[_0x1a51('0x1f')];this['ContactId']=_0x3bc979['ContactId'];this[_0x1a51('0x20')]=_0x3bc979[_0x1a51('0x20')];this[_0x1a51('0x21')]=_0x3bc979[_0x1a51('0x21')];this['VoiceQueueId']=_0x3bc979[_0x1a51('0x22')];this[_0x1a51('0x23')]=_0x3bc979['CampaignId'];this[_0x1a51('0x24')]=_0x3bc979['originatecalleridnum']||'';this[_0x1a51('0x25')]=_0x3bc979[_0x1a51('0x25')]||'';this[_0x1a51('0x26')]=_0x3bc979['agiafterat'];}module[_0x1a51('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 27f66db..57535eb 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe272=['exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xe272,0x121));var _0x2e27=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xe272[_0xd1d19a];return _0x52a79d;};'use strict';function Final(_0x318779){this[_0x2e27('0x0')]=_0x318779[_0x2e27('0x0')];this[_0x2e27('0x1')]=_0x318779[_0x2e27('0x1')];this[_0x2e27('0x2')]=_0x318779['type'];this['campaigntype']=_0x318779[_0x2e27('0x2')]===_0x2e27('0x3')?_0x2e27('0x4'):_0x318779[_0x2e27('0x2')];this[_0x2e27('0x5')]=_0x318779[_0x2e27('0x5')];this[_0x2e27('0x6')]=_0x318779['countcongestionretry'];this['countnoanswerretry']=_0x318779['countnoanswerretry'];this[_0x2e27('0x7')]=_0x318779[_0x2e27('0x5')]+_0x318779['countcongestionretry']+_0x318779[_0x2e27('0x8')]+_0x318779[_0x2e27('0x9')]+_0x318779[_0x2e27('0xa')]+_0x318779['countabandonedretry']+_0x318779[_0x2e27('0xb')]+_0x318779[_0x2e27('0xc')];this[_0x2e27('0x9')]=_0x318779[_0x2e27('0x9')];this[_0x2e27('0xa')]=_0x318779[_0x2e27('0xa')];this['countabandonedretry']=_0x318779['countabandonedretry'];this[_0x2e27('0xb')]=_0x318779[_0x2e27('0xb')];this['countagentrejectretry']=_0x318779[_0x2e27('0xc')];this[_0x2e27('0x4')]=_0x318779[_0x2e27('0x4')];this[_0x2e27('0xd')]=_0x318779[_0x2e27('0xd')];this[_0x2e27('0xe')]=_0x318779[_0x2e27('0xe')];this['starttime']=_0x318779['starttime'];this[_0x2e27('0xf')]=_0x318779[_0x2e27('0xf')];this['endtime']=_0x318779['responsetime'];this[_0x2e27('0x10')]=_0x318779[_0x2e27('0x10')]||0x0;this['holdtime']=_0x318779[_0x2e27('0x11')]||0x0;this[_0x2e27('0x12')]=_0x318779[_0x2e27('0x12')]||0x0;this[_0x2e27('0x13')]=_0x318779[_0x2e27('0x13')];this[_0x2e27('0x14')]=_0x318779[_0x2e27('0x14')];this['callbackat']=_0x318779[_0x2e27('0x15')];this['recallme']=_0x318779['recallme'];this[_0x2e27('0x16')]=_0x318779[_0x2e27('0x16')];this[_0x2e27('0x17')]=_0x318779[_0x2e27('0x17')];this['UserId']=_0x318779[_0x2e27('0x18')];this[_0x2e27('0x19')]=_0x318779[_0x2e27('0x19')];this[_0x2e27('0x1a')]=_0x318779['CampaignId'];this[_0x2e27('0x1b')]=_0x318779[_0x2e27('0x1b')]||'';this[_0x2e27('0x1c')]=_0x318779[_0x2e27('0x1c')]||'';this[_0x2e27('0x1d')]=_0x318779['state'];this[_0x2e27('0x1e')]=_0x318779[_0x2e27('0x1e')];}module[_0x2e27('0x1f')]=Final; \ No newline at end of file +var _0x37de=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x1b7d85,_0x38e492){var _0x529046=function(_0x15c714){while(--_0x15c714){_0x1b7d85['push'](_0x1b7d85['shift']());}};_0x529046(++_0x38e492);}(_0x37de,0xba));var _0xe37d=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0x37de[_0x3388d8];return _0x2bbe73;};'use strict';function Final(_0x375f58){this[_0xe37d('0x0')]=_0x375f58[_0xe37d('0x0')];this[_0xe37d('0x1')]=_0x375f58[_0xe37d('0x1')];this[_0xe37d('0x2')]=_0x375f58[_0xe37d('0x2')];this[_0xe37d('0x3')]=_0x375f58[_0xe37d('0x2')]===_0xe37d('0x4')?_0xe37d('0x5'):_0x375f58[_0xe37d('0x2')];this[_0xe37d('0x6')]=_0x375f58[_0xe37d('0x6')];this['countcongestionretry']=_0x375f58['countcongestionretry'];this[_0xe37d('0x7')]=_0x375f58[_0xe37d('0x7')];this['countglobal']=_0x375f58['countbusyretry']+_0x375f58[_0xe37d('0x8')]+_0x375f58['countnoanswerretry']+_0x375f58[_0xe37d('0x9')]+_0x375f58[_0xe37d('0xa')]+_0x375f58[_0xe37d('0xb')]+_0x375f58[_0xe37d('0xc')]+_0x375f58[_0xe37d('0xd')];this[_0xe37d('0x9')]=_0x375f58[_0xe37d('0x9')];this[_0xe37d('0xa')]=_0x375f58[_0xe37d('0xa')];this[_0xe37d('0xb')]=_0x375f58[_0xe37d('0xb')];this[_0xe37d('0xc')]=_0x375f58[_0xe37d('0xc')];this[_0xe37d('0xd')]=_0x375f58[_0xe37d('0xd')];this[_0xe37d('0x5')]=_0x375f58[_0xe37d('0x5')];this[_0xe37d('0xe')]=_0x375f58[_0xe37d('0xe')];this[_0xe37d('0xf')]=_0x375f58['calleridnum'];this['starttime']=_0x375f58[_0xe37d('0x10')];this[_0xe37d('0x11')]=_0x375f58[_0xe37d('0x11')];this[_0xe37d('0x12')]=_0x375f58[_0xe37d('0x11')];this[_0xe37d('0x13')]=_0x375f58[_0xe37d('0x13')]||0x0;this[_0xe37d('0x14')]=_0x375f58[_0xe37d('0x14')]||0x0;this['talktime']=_0x375f58[_0xe37d('0x15')]||0x0;this[_0xe37d('0x16')]=_0x375f58[_0xe37d('0x16')];this['callbackuniqueid']=_0x375f58[_0xe37d('0x17')];this[_0xe37d('0x18')]=_0x375f58['callbackat'];this[_0xe37d('0x19')]=_0x375f58[_0xe37d('0x19')];this[_0xe37d('0x1a')]=_0x375f58[_0xe37d('0x1a')];this[_0xe37d('0x1b')]=_0x375f58['ListId'];this['UserId']=_0x375f58[_0xe37d('0x1c')];this[_0xe37d('0x1d')]=_0x375f58[_0xe37d('0x1d')];this[_0xe37d('0x1e')]=_0x375f58[_0xe37d('0x1e')];this[_0xe37d('0x1f')]=_0x375f58[_0xe37d('0x1f')]||'';this[_0xe37d('0x20')]=_0x375f58[_0xe37d('0x20')]||'';this['state']=_0x375f58['state'];this['statedesc']=_0x375f58[_0xe37d('0x21')];}module[_0xe37d('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 219a29c..2d324bb 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8fb=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0xb8fb,0xb3));var _0xbb8f=function(_0x2c6c64,_0x59948e){_0x2c6c64=_0x2c6c64-0x0;var _0x40c118=_0xb8fb[_0x2c6c64];return _0x40c118;};'use strict';var moment=require(_0xbb8f('0x0'));var utils=require(_0xbb8f('0x1'));function Hangup(_0x1b4b3d,_0x3599c8){this[_0xbb8f('0x2')]=0x4;this[_0xbb8f('0x3')]=_0xbb8f('0x4');this[_0xbb8f('0x5')]=_0x1b4b3d['scheduledat'];this['type']=_0x1b4b3d[_0xbb8f('0x6')];this['campaigntype']=_0x1b4b3d[_0xbb8f('0x6')]==='outbound'?_0xbb8f('0x7'):_0x1b4b3d[_0xbb8f('0x6')];this[_0xbb8f('0x8')]=_0x1b4b3d[_0xbb8f('0x8')]||![];this[_0xbb8f('0x9')]=_0x1b4b3d['countbusyretry'];this[_0xbb8f('0xa')]=_0x1b4b3d[_0xbb8f('0xa')];this['countnoanswerretry']=_0x1b4b3d['countnoanswerretry'];this['countglobal']=_0x1b4b3d['countbusyretry']+_0x1b4b3d[_0xbb8f('0xa')]+_0x1b4b3d[_0xbb8f('0xb')]+_0x1b4b3d[_0xbb8f('0xc')]+_0x1b4b3d[_0xbb8f('0xd')]+_0x1b4b3d[_0xbb8f('0xe')]+_0x1b4b3d[_0xbb8f('0xf')]+_0x1b4b3d['countagentrejectretry'];this[_0xbb8f('0xc')]=_0x1b4b3d[_0xbb8f('0xc')];this[_0xbb8f('0xd')]=_0x1b4b3d[_0xbb8f('0xd')];this['countabandonedretry']=_0x1b4b3d[_0xbb8f('0xe')];this[_0xbb8f('0xf')]=_0x1b4b3d[_0xbb8f('0xf')];this['countagentrejectretry']=_0x1b4b3d[_0xbb8f('0x10')];this[_0xbb8f('0x11')]=_0x3599c8[_0xbb8f('0x11')];this[_0xbb8f('0x12')]=_0x1b4b3d[_0xbb8f('0x13')];this[_0xbb8f('0x14')]=_0x1b4b3d[_0xbb8f('0x15')];this['starttime']=_0x1b4b3d[_0xbb8f('0x16')];this[_0xbb8f('0x17')]=_0x1b4b3d[_0xbb8f('0x17')];this[_0xbb8f('0x18')]=moment()['format'](_0xbb8f('0x19'));this[_0xbb8f('0x1a')]=utils[_0xbb8f('0x1b')](_0x1b4b3d[_0xbb8f('0x17')],_0x1b4b3d[_0xbb8f('0x16')]);this[_0xbb8f('0x1c')]=0x0;this[_0xbb8f('0x1d')]=utils['getSeconds'](this[_0xbb8f('0x18')],_0x1b4b3d[_0xbb8f('0x17')]);this[_0xbb8f('0x7')]=_0x1b4b3d[_0xbb8f('0x7')];this['membername']=_0xbb8f('0x1e');this[_0xbb8f('0x1f')]=_0x3599c8[_0xbb8f('0x20')];this[_0xbb8f('0x21')]=_0x1b4b3d[_0xbb8f('0x21')];this[_0xbb8f('0x22')]=_0x1b4b3d['callbackuniqueid'];this[_0xbb8f('0x23')]=_0x1b4b3d[_0xbb8f('0x23')];this[_0xbb8f('0x24')]=_0x1b4b3d[_0xbb8f('0x24')];this[_0xbb8f('0x25')]=_0x1b4b3d[_0xbb8f('0x25')];this[_0xbb8f('0x26')]=_0x1b4b3d[_0xbb8f('0x26')];this[_0xbb8f('0x27')]=_0x1b4b3d[_0xbb8f('0x27')];this[_0xbb8f('0x28')]=_0x1b4b3d[_0xbb8f('0x28')];this['CampaignId']=_0x1b4b3d[_0xbb8f('0x29')];}module[_0xbb8f('0x2a')]=Hangup; \ No newline at end of file +var _0x0668=['ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0xccc579,_0x3def9a){var _0x33d5ae=function(_0x43bbd6){while(--_0x43bbd6){_0xccc579['push'](_0xccc579['shift']());}};_0x33d5ae(++_0x3def9a);}(_0x0668,0x7d));var _0x8066=function(_0x403160,_0x33497f){_0x403160=_0x403160-0x0;var _0x50c5a2=_0x0668[_0x403160];return _0x50c5a2;};'use strict';var moment=require(_0x8066('0x0'));var utils=require(_0x8066('0x1'));function Hangup(_0x3bc881,_0x3852f3){this['state']=0x4;this['statedesc']=_0x8066('0x2');this[_0x8066('0x3')]=_0x3bc881[_0x8066('0x3')];this[_0x8066('0x4')]=_0x3bc881[_0x8066('0x4')];this['campaigntype']=_0x3bc881[_0x8066('0x4')]===_0x8066('0x5')?_0x8066('0x6'):_0x3bc881[_0x8066('0x4')];this[_0x8066('0x7')]=_0x3bc881['amd']||![];this[_0x8066('0x8')]=_0x3bc881[_0x8066('0x8')];this[_0x8066('0x9')]=_0x3bc881['countcongestionretry'];this[_0x8066('0xa')]=_0x3bc881['countnoanswerretry'];this[_0x8066('0xb')]=_0x3bc881[_0x8066('0x8')]+_0x3bc881[_0x8066('0x9')]+_0x3bc881[_0x8066('0xa')]+_0x3bc881['countnosuchnumberretry']+_0x3bc881[_0x8066('0xc')]+_0x3bc881[_0x8066('0xd')]+_0x3bc881[_0x8066('0xe')]+_0x3bc881[_0x8066('0xf')];this['countnosuchnumberretry']=_0x3bc881[_0x8066('0x10')];this[_0x8066('0xc')]=_0x3bc881[_0x8066('0xc')];this[_0x8066('0xd')]=_0x3bc881['countabandonedretry'];this['countmachineretry']=_0x3bc881[_0x8066('0xe')];this[_0x8066('0xf')]=_0x3bc881[_0x8066('0xf')];this[_0x8066('0x11')]=_0x3852f3[_0x8066('0x11')];this['calleridname']=_0x3bc881[_0x8066('0x12')];this[_0x8066('0x13')]=_0x3bc881[_0x8066('0x14')];this['starttime']=_0x3bc881[_0x8066('0x15')];this[_0x8066('0x16')]=_0x3bc881[_0x8066('0x16')];this[_0x8066('0x17')]=moment()[_0x8066('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8066('0x19')]=utils[_0x8066('0x1a')](_0x3bc881[_0x8066('0x16')],_0x3bc881[_0x8066('0x15')]);this[_0x8066('0x1b')]=0x0;this['talktime']=utils[_0x8066('0x1a')](this['endtime'],_0x3bc881[_0x8066('0x16')]);this[_0x8066('0x6')]=_0x3bc881[_0x8066('0x6')];this['membername']='IVR';this[_0x8066('0x1c')]=_0x3852f3[_0x8066('0x1d')];this[_0x8066('0x1e')]=_0x3bc881[_0x8066('0x1e')];this[_0x8066('0x1f')]=_0x3bc881[_0x8066('0x1f')];this[_0x8066('0x20')]=_0x3bc881['callbackat'];this[_0x8066('0x21')]=_0x3bc881[_0x8066('0x21')];this['ContactId']=_0x3bc881[_0x8066('0x22')];this['ListId']=_0x3bc881[_0x8066('0x23')];this[_0x8066('0x24')]=_0x3bc881[_0x8066('0x24')];this[_0x8066('0x25')]=_0x3bc881['VoiceQueueId'];this['CampaignId']=_0x3bc881[_0x8066('0x26')];}module[_0x8066('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 7c712a0..8746716 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56c7=['countagentrejectretry','countnosuchnumberretry','name','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countabandonedretry','countmachineretry'];(function(_0x3a49ed,_0x5942c0){var _0xfc681=function(_0x11d26b){while(--_0x11d26b){_0x3a49ed['push'](_0x3a49ed['shift']());}};_0xfc681(++_0x5942c0);}(_0x56c7,0x1d6));var _0x756c=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x56c7[_0x305b20];return _0x26d64a;};'use strict';var utils=require('../utils');function History(_0xce1ce8){this[_0x756c('0x0')]=_0xce1ce8[_0x756c('0x0')];this[_0x756c('0x1')]=_0xce1ce8['scheduledat']||undefined;this[_0x756c('0x2')]=_0xce1ce8['type'];this['campaigntype']=_0xce1ce8[_0x756c('0x2')]==='outbound'?_0x756c('0x3'):_0xce1ce8[_0x756c('0x2')];this['countbusyretry']=_0xce1ce8['countbusyretry'];this[_0x756c('0x4')]=_0xce1ce8[_0x756c('0x4')];this[_0x756c('0x5')]=_0xce1ce8[_0x756c('0x5')];this[_0x756c('0x6')]=_0xce1ce8[_0x756c('0x7')]+_0xce1ce8[_0x756c('0x4')]+_0xce1ce8[_0x756c('0x5')]+_0xce1ce8['countnosuchnumberretry']+_0xce1ce8['countdropretry']+_0xce1ce8[_0x756c('0x8')]+_0xce1ce8[_0x756c('0x9')]+_0xce1ce8[_0x756c('0xa')];this['countnosuchnumberretry']=_0xce1ce8[_0x756c('0xb')];this['countdropretry']=_0xce1ce8['countdropretry'];this[_0x756c('0x8')]=_0xce1ce8['countabandonedretry'];this[_0x756c('0x9')]=_0xce1ce8['countmachineretry'];this['countagentrejectretry']=_0xce1ce8[_0x756c('0xa')];this[_0x756c('0x3')]=_0xce1ce8[_0x756c('0x3')];this['calleridname']=_0xce1ce8[_0x756c('0xc')];this['calleridnum']=_0xce1ce8[_0x756c('0xd')];this[_0x756c('0xe')]=_0xce1ce8[_0x756c('0xe')];this['responsetime']=_0xce1ce8[_0x756c('0xf')];this[_0x756c('0x10')]=_0xce1ce8[_0x756c('0xf')];this[_0x756c('0x11')]=utils[_0x756c('0x12')](_0xce1ce8[_0x756c('0xf')],_0xce1ce8[_0x756c('0xe')]);this['holdtime']=0x0;this[_0x756c('0x13')]=0x0;this[_0x756c('0x14')]=_0xce1ce8[_0x756c('0x14')];this[_0x756c('0x15')]=_0xce1ce8['callbackuniqueid'];this['callbackat']=_0xce1ce8['callbackat'];this[_0x756c('0x16')]=_0xce1ce8[_0x756c('0x16')];this[_0x756c('0x17')]=_0xce1ce8[_0x756c('0x17')];this[_0x756c('0x18')]=_0xce1ce8['ListId'];this['UserId']=_0xce1ce8['UserId'];this[_0x756c('0x19')]=_0xce1ce8[_0x756c('0x19')];this[_0x756c('0x1a')]=_0xce1ce8[_0x756c('0x1a')];this[_0x756c('0x1b')]=_0xce1ce8['originatecalleridnum']||'';this[_0x756c('0x1c')]=_0xce1ce8[_0x756c('0x1c')]||'';this['state']=_0xce1ce8[_0x756c('0x1d')];this['statedesc']=_0xce1ce8[_0x756c('0x1e')];}module[_0x756c('0x1f')]=History; \ No newline at end of file +var _0x943f=['ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x105a1a,_0x40e12c){var _0x586215=function(_0x292fcd){while(--_0x292fcd){_0x105a1a['push'](_0x105a1a['shift']());}};_0x586215(++_0x40e12c);}(_0x943f,0xa7));var _0xf943=function(_0x232eae,_0x125c74){_0x232eae=_0x232eae-0x0;var _0x265692=_0x943f[_0x232eae];return _0x265692;};'use strict';var utils=require('../utils');function History(_0x37cbad){this[_0xf943('0x0')]=_0x37cbad[_0xf943('0x0')];this['scheduledat']=_0x37cbad[_0xf943('0x1')]||undefined;this['type']=_0x37cbad[_0xf943('0x2')];this['campaigntype']=_0x37cbad[_0xf943('0x2')]===_0xf943('0x3')?_0xf943('0x4'):_0x37cbad[_0xf943('0x2')];this[_0xf943('0x5')]=_0x37cbad['countbusyretry'];this[_0xf943('0x6')]=_0x37cbad['countcongestionretry'];this[_0xf943('0x7')]=_0x37cbad[_0xf943('0x7')];this[_0xf943('0x8')]=_0x37cbad[_0xf943('0x5')]+_0x37cbad[_0xf943('0x6')]+_0x37cbad['countnoanswerretry']+_0x37cbad[_0xf943('0x9')]+_0x37cbad[_0xf943('0xa')]+_0x37cbad['countabandonedretry']+_0x37cbad[_0xf943('0xb')]+_0x37cbad['countagentrejectretry'];this[_0xf943('0x9')]=_0x37cbad[_0xf943('0x9')];this[_0xf943('0xa')]=_0x37cbad[_0xf943('0xa')];this['countabandonedretry']=_0x37cbad[_0xf943('0xc')];this[_0xf943('0xb')]=_0x37cbad[_0xf943('0xb')];this['countagentrejectretry']=_0x37cbad[_0xf943('0xd')];this[_0xf943('0x4')]=_0x37cbad[_0xf943('0x4')];this['calleridname']=_0x37cbad['name'];this[_0xf943('0xe')]=_0x37cbad['number'];this[_0xf943('0xf')]=_0x37cbad[_0xf943('0xf')];this[_0xf943('0x10')]=_0x37cbad[_0xf943('0x10')];this['endtime']=_0x37cbad[_0xf943('0x10')];this[_0xf943('0x11')]=utils[_0xf943('0x12')](_0x37cbad[_0xf943('0x10')],_0x37cbad['starttime']);this[_0xf943('0x13')]=0x0;this[_0xf943('0x14')]=0x0;this['callback']=_0x37cbad[_0xf943('0x15')];this[_0xf943('0x16')]=_0x37cbad[_0xf943('0x16')];this[_0xf943('0x17')]=_0x37cbad[_0xf943('0x17')];this[_0xf943('0x18')]=_0x37cbad[_0xf943('0x18')];this[_0xf943('0x19')]=_0x37cbad[_0xf943('0x19')];this['ListId']=_0x37cbad['ListId'];this[_0xf943('0x1a')]=_0x37cbad[_0xf943('0x1a')];this[_0xf943('0x1b')]=_0x37cbad[_0xf943('0x1b')];this['CampaignId']=_0x37cbad[_0xf943('0x1c')];this['originatecalleridnum']=_0x37cbad['originatecalleridnum']||'';this[_0xf943('0x1d')]=_0x37cbad['originatecalleridname']||'';this[_0xf943('0x1e')]=_0x37cbad[_0xf943('0x1e')];this['statedesc']=_0x37cbad['statedesc'];}module[_0xf943('0x1f')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 366c07c..47ddc3c 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbce4=['callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','connectedlinename','callbackuniqueid'];(function(_0x4ef8bc,_0x5eb00d){var _0x5d4d56=function(_0x57b3cd){while(--_0x57b3cd){_0x4ef8bc['push'](_0x4ef8bc['shift']());}};_0x5d4d56(++_0x5eb00d);}(_0xbce4,0x83));var _0x4bce=function(_0x3e606d,_0x42af49){_0x3e606d=_0x3e606d-0x0;var _0x30ad20=_0xbce4[_0x3e606d];return _0x30ad20;};'use strict';var utils=require(_0x4bce('0x0'));function QueueCallerAbandon(_0x1e7efb,_0x529eea){this[_0x4bce('0x1')]=_0x1e7efb[_0x4bce('0x1')];this[_0x4bce('0x2')]=_0x1e7efb[_0x4bce('0x2')];this[_0x4bce('0x3')]=_0x1e7efb[_0x4bce('0x2')]===_0x4bce('0x4')?_0x4bce('0x5'):_0x1e7efb['type'];this['countbusyretry']=_0x1e7efb[_0x4bce('0x6')];this[_0x4bce('0x7')]=_0x1e7efb[_0x4bce('0x7')];this[_0x4bce('0x8')]=_0x1e7efb[_0x4bce('0x8')];this[_0x4bce('0x9')]=_0x1e7efb[_0x4bce('0x6')]+_0x1e7efb['countcongestionretry']+_0x1e7efb[_0x4bce('0x8')]+_0x1e7efb[_0x4bce('0xa')]+_0x1e7efb['countdropretry']+_0x1e7efb[_0x4bce('0xb')]+_0x1e7efb['countmachineretry']+_0x1e7efb['countagentrejectretry'];this[_0x4bce('0xa')]=_0x1e7efb[_0x4bce('0xa')];this[_0x4bce('0xc')]=_0x1e7efb[_0x4bce('0xc')];this[_0x4bce('0xb')]=_0x1e7efb[_0x4bce('0xb')];this[_0x4bce('0xd')]=_0x1e7efb[_0x4bce('0xd')];this[_0x4bce('0xe')]=_0x1e7efb[_0x4bce('0xe')];this[_0x4bce('0xf')]=_0x529eea['uniqueid'];this[_0x4bce('0x10')]=_0x1e7efb['name'];this[_0x4bce('0x11')]=_0x1e7efb['number'];this[_0x4bce('0x12')]=_0x1e7efb['starttime'];this[_0x4bce('0x13')]=_0x1e7efb[_0x4bce('0x13')];this[_0x4bce('0x14')]=_0x1e7efb['droptime'];this[_0x4bce('0x15')]=_0x1e7efb['dropreason'];this[_0x4bce('0x16')]=this[_0x4bce('0x14')];this[_0x4bce('0x17')]=utils[_0x4bce('0x18')](_0x1e7efb[_0x4bce('0x13')],_0x1e7efb[_0x4bce('0x12')]);this[_0x4bce('0x19')]=utils[_0x4bce('0x18')](this[_0x4bce('0x14')],_0x1e7efb[_0x4bce('0x13')]);this[_0x4bce('0x1a')]=0x0;this[_0x4bce('0x5')]=_0x529eea['queue'];this['membername']=_0x529eea[_0x4bce('0x1b')];this['reason']=_0x529eea['reason'];this['callback']=_0x1e7efb['callback'];this[_0x4bce('0x1c')]=_0x1e7efb['callbackuniqueid'];this['callbackat']=_0x1e7efb[_0x4bce('0x1d')];this['recallme']=_0x1e7efb[_0x4bce('0x1e')];this[_0x4bce('0x1f')]=_0x1e7efb[_0x4bce('0x1f')];this['ListId']=_0x1e7efb['ListId'];this[_0x4bce('0x20')]=_0x1e7efb[_0x4bce('0x20')];this[_0x4bce('0x21')]=_0x1e7efb['VoiceQueueId'];this[_0x4bce('0x22')]=_0x1e7efb[_0x4bce('0x22')];this[_0x4bce('0x23')]=_0x1e7efb[_0x4bce('0x23')]||'';this[_0x4bce('0x24')]=_0x1e7efb[_0x4bce('0x24')]||'';this['agiafterat']=_0x1e7efb['agiafterat'];this['state']=_0x1e7efb[_0x4bce('0x25')];this[_0x4bce('0x26')]=_0x1e7efb[_0x4bce('0x26')];}module[_0x4bce('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x8cdf=['droptime','dropreason','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime'];(function(_0x24360c,_0x49fdc5){var _0x427d13=function(_0x520f25){while(--_0x520f25){_0x24360c['push'](_0x24360c['shift']());}};_0x427d13(++_0x49fdc5);}(_0x8cdf,0x10d));var _0xf8cd=function(_0x186cea,_0x57db8f){_0x186cea=_0x186cea-0x0;var _0x37303d=_0x8cdf[_0x186cea];return _0x37303d;};'use strict';var utils=require(_0xf8cd('0x0'));function QueueCallerAbandon(_0x484996,_0xe7d7cd){this[_0xf8cd('0x1')]=_0x484996[_0xf8cd('0x1')];this[_0xf8cd('0x2')]=_0x484996['type'];this['campaigntype']=_0x484996[_0xf8cd('0x2')]===_0xf8cd('0x3')?_0xf8cd('0x4'):_0x484996[_0xf8cd('0x2')];this[_0xf8cd('0x5')]=_0x484996[_0xf8cd('0x5')];this[_0xf8cd('0x6')]=_0x484996[_0xf8cd('0x6')];this[_0xf8cd('0x7')]=_0x484996['countnoanswerretry'];this['countglobal']=_0x484996[_0xf8cd('0x5')]+_0x484996['countcongestionretry']+_0x484996['countnoanswerretry']+_0x484996[_0xf8cd('0x8')]+_0x484996[_0xf8cd('0x9')]+_0x484996['countabandonedretry']+_0x484996[_0xf8cd('0xa')]+_0x484996[_0xf8cd('0xb')];this[_0xf8cd('0x8')]=_0x484996['countnosuchnumberretry'];this[_0xf8cd('0x9')]=_0x484996[_0xf8cd('0x9')];this['countabandonedretry']=_0x484996['countabandonedretry'];this[_0xf8cd('0xa')]=_0x484996[_0xf8cd('0xa')];this['countagentrejectretry']=_0x484996[_0xf8cd('0xb')];this['uniqueid']=_0xe7d7cd[_0xf8cd('0xc')];this[_0xf8cd('0xd')]=_0x484996[_0xf8cd('0xe')];this['calleridnum']=_0x484996[_0xf8cd('0xf')];this[_0xf8cd('0x10')]=_0x484996[_0xf8cd('0x10')];this[_0xf8cd('0x11')]=_0x484996['responsetime'];this['droptime']=_0x484996[_0xf8cd('0x12')];this[_0xf8cd('0x13')]=_0x484996[_0xf8cd('0x13')];this['endtime']=this[_0xf8cd('0x12')];this[_0xf8cd('0x14')]=utils[_0xf8cd('0x15')](_0x484996[_0xf8cd('0x11')],_0x484996['starttime']);this[_0xf8cd('0x16')]=utils[_0xf8cd('0x15')](this['droptime'],_0x484996[_0xf8cd('0x11')]);this[_0xf8cd('0x17')]=0x0;this[_0xf8cd('0x4')]=_0xe7d7cd[_0xf8cd('0x4')];this[_0xf8cd('0x18')]=_0xe7d7cd['connectedlinename'];this['reason']=_0xe7d7cd[_0xf8cd('0x19')];this[_0xf8cd('0x1a')]=_0x484996[_0xf8cd('0x1a')];this[_0xf8cd('0x1b')]=_0x484996[_0xf8cd('0x1b')];this[_0xf8cd('0x1c')]=_0x484996[_0xf8cd('0x1c')];this[_0xf8cd('0x1d')]=_0x484996[_0xf8cd('0x1d')];this[_0xf8cd('0x1e')]=_0x484996['ContactId'];this[_0xf8cd('0x1f')]=_0x484996[_0xf8cd('0x1f')];this[_0xf8cd('0x20')]=_0x484996[_0xf8cd('0x20')];this[_0xf8cd('0x21')]=_0x484996[_0xf8cd('0x21')];this[_0xf8cd('0x22')]=_0x484996['CampaignId'];this[_0xf8cd('0x23')]=_0x484996['originatecalleridnum']||'';this[_0xf8cd('0x24')]=_0x484996[_0xf8cd('0x24')]||'';this[_0xf8cd('0x25')]=_0x484996[_0xf8cd('0x25')];this[_0xf8cd('0x26')]=_0x484996['state'];this['statedesc']=_0x484996[_0xf8cd('0x27')];}module[_0xf8cd('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index a63cbdc..9f9e0ee 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x26b62a,_0x527246){var _0x122717=function(_0x588622){while(--_0x588622){_0x26b62a['push'](_0x26b62a['shift']());}};_0x122717(++_0x527246);}(_0xb10b,0x12a));var _0xbb10=function(_0x45bee0,_0x42bf09){_0x45bee0=_0x45bee0-0x0;var _0x1fcfd5=_0xb10b[_0x45bee0];return _0x1fcfd5;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x5369c2,_0x565c6e){var _0x1308be=function(_0x4f6cc4){while(--_0x4f6cc4){_0x5369c2['push'](_0x5369c2['shift']());}};_0x1308be(++_0x565c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index d32fcee..51f1c65 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cab=['dialActive','message','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','Trunk','name','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','pTalking','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','util','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','getSeconds'];(function(_0x5597a0,_0x35c11e){var _0x2fc8d6=function(_0x492dcb){while(--_0x492dcb){_0x5597a0['push'](_0x5597a0['shift']());}};_0x2fc8d6(++_0x35c11e);}(_0x4cab,0x15e));var _0xb4ca=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x4cab[_0x1b828b];return _0x98da1a;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xb4ca('0x0'));var logger=require(_0xb4ca('0x1'))(_0xb4ca('0x2'));var timezones=require('../../../../config/environment/shared')[_0xb4ca('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0xb4ca('0x4'),'BLACKLIST':_0xb4ca('0x5'),'CONTACTS_RESCHEDULED':_0xb4ca('0x6'),'DEACTIVATED':_0xb4ca('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0xb4ca('0x8'),'INACTIVE':_0xb4ca('0x9'),'NO_AGENTS_LOGGED':_0xb4ca('0xa'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xb4ca('0xb'),'QUEUE_RECALL':_0xb4ca('0xc'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xb4ca('0xd'),'UNREACHABLE_TRUNK':_0xb4ca('0xe')};exports[_0xb4ca('0xf')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4d9c8b){return _0x4d9c8b[_0xb4ca('0x10')]==='preview';}exports[_0xb4ca('0x11')]=isPreviewCampaign;function isIVRCampaign(_0x855cb9){return _0x855cb9[_0xb4ca('0x12')]==='ivr';}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x1f4b5a){return _0x1f4b5a[_0xb4ca('0x12')]==='outbound';}exports[_0xb4ca('0x13')]=isOutboundQueue;function isQueueCampaignActive(_0x17797e){return _0x17797e['dialActive'];}exports[_0xb4ca('0x14')]=isQueueCampaignActive;function isIVRCampaignActive(_0x339485){return _0x339485[_0xb4ca('0x15')];}exports[_0xb4ca('0x16')]=isIVRCampaignActive;function getSeconds(_0x9575cd,_0x4ed21f){var _0x5ee725=moment(_0x9575cd)[_0xb4ca('0x17')](0x0);var _0x237504=moment(_0x4ed21f)['milliseconds'](0x0);return _0x5ee725['diff'](_0x237504,'seconds');}exports[_0xb4ca('0x18')]=getSeconds;function hasQueueCampaignDataChanged(_0x17b198,_0x7b528d){var _0x52c23a=![];var _0x458e3b=_0x17b198['dialMethod']!==_0x7b528d[_0xb4ca('0x10')]||_0x17b198[_0xb4ca('0x19')]!==_0x7b528d[_0xb4ca('0x19')]||_0x17b198[_0xb4ca('0x1a')]!==_0x7b528d['message'];var _0x27395f=_0x17b198[_0xb4ca('0x1b')]!==_0x7b528d[_0xb4ca('0x1b')]||_0x17b198[_0xb4ca('0x1c')]!==_0x7b528d[_0xb4ca('0x1c')]||_0x17b198['loggedInDb']!==_0x7b528d[_0xb4ca('0x1d')]||_0x17b198[_0xb4ca('0x1e')]!==_0x7b528d[_0xb4ca('0x1e')]||_0x17b198[_0xb4ca('0x1f')]!==_0x7b528d[_0xb4ca('0x1f')]||_0x17b198['pTalking']!==_0x7b528d['pTalking']||_0x17b198[_0xb4ca('0x20')]!==_0x7b528d[_0xb4ca('0x20')]||_0x17b198[_0xb4ca('0x21')]!==_0x7b528d[_0xb4ca('0x21')]||_0x17b198[_0xb4ca('0x22')]!==_0x7b528d[_0xb4ca('0x22')];if(_0x17b198[_0xb4ca('0x23')]&&_0x7b528d['Trunk']){_0x52c23a=_0x17b198['Trunk'][_0xb4ca('0x24')]!==_0x7b528d[_0xb4ca('0x23')]['name']||_0x17b198['Trunk'][_0xb4ca('0x15')]!==_0x7b528d[_0xb4ca('0x23')][_0xb4ca('0x15')];}return _0x458e3b||_0x27395f||_0x52c23a;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2af10f){var _0x2ee7d8=null;var _0x205218=_0x2af10f['dialTimezone'];if(_['isNil'](_0x2af10f['dialGlobalInterval'])||_[_0xb4ca('0x25')](_0x2af10f[_0xb4ca('0x26')])||_[_0xb4ca('0x25')](_0x2af10f[_0xb4ca('0x26')][_0xb4ca('0x27')])){_0x2ee7d8=CAMPAIGN_STATUS[_0xb4ca('0x28')];}else if(_[_0xb4ca('0x29')](_0x2af10f[_0xb4ca('0x2a')])||_['isEmpty'](_0x2af10f[_0xb4ca('0x26')][_0xb4ca('0x27')])){_0x2ee7d8=CAMPAIGN_STATUS[_0xb4ca('0x2b')];}else if(_0x205218&&!timezones[_0x205218]){_0x2ee7d8=CAMPAIGN_STATUS[_0xb4ca('0x2c')];}return _0x2ee7d8;}function checkAnyValidTrunk(_0xfb39f,_0x2419e0){var _0x321c76=null;var _0x45c67d=_0xb4ca('0x2d');var _0x5ce2f5=[_0xb4ca('0x2e'),_0xb4ca('0x2f')];var _0x2797b4=!![];if(_0xfb39f[_0xb4ca('0x23')]&&_0xfb39f[_0xb4ca('0x23')][_0xb4ca('0x15')]){_0x45c67d+=_0xfb39f[_0xb4ca('0x23')][_0xb4ca('0x24')];_0x321c76=_0x2419e0[_0x45c67d];_0x2797b4=_0x5ce2f5[_0xb4ca('0x30')](_0x321c76[_0xb4ca('0x31')]);}else if(_0xfb39f['TrunkBackup']&&_0xfb39f[_0xb4ca('0x32')][_0xb4ca('0x15')]){_0x45c67d+=_0xfb39f[_0xb4ca('0x32')]['name'];_0x321c76=_0x2419e0[_0x45c67d];_0x2797b4=_0x5ce2f5[_0xb4ca('0x30')](_0x321c76[_0xb4ca('0x31')]);}return _0x2797b4;}function getQueueCampaignStatusMessage(_0x62c813,_0x28ee23){var _0x5fbaa7=CAMPAIGN_STATUS[_0xb4ca('0x4')];var _0x5787bd=isPreviewCampaign(_0x62c813);if(!isQueueCampaignActive(_0x62c813)){if(_0x5787bd){_0x5fbaa7=CAMPAIGN_STATUS[_0xb4ca('0x33')];}else{if(_0x62c813[_0xb4ca('0x22')]===0x0&&_0x62c813['talking']===0x0&&_0x62c813[_0xb4ca('0x20')]===0x0&&(_0x62c813[_0xb4ca('0x34')]||0x0)===0x0){_0x5fbaa7=CAMPAIGN_STATUS[_0xb4ca('0x33')];}else{_0x5fbaa7=CAMPAIGN_STATUS[_0xb4ca('0x35')];}}}else if(_0x62c813[_0xb4ca('0x1c')]===0x0){_0x5fbaa7=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x62c813,_0x28ee23)){_0x5fbaa7=CAMPAIGN_STATUS[_0xb4ca('0x36')];}else if(!isPreviewCampaign(_0x62c813)){var _0x24fd08=checkAnyValidQueueCampaignInterval(_0x62c813);if(_0x24fd08){_0x5fbaa7=_0x24fd08;}}return _0x5fbaa7;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4872a0){var _0x4f5c77=CAMPAIGN_STATUS[_0xb4ca('0x35')];if(_0x4872a0[_0xb4ca('0x22')]===0x0&&_0x4872a0[_0xb4ca('0x1f')]===0x0&&_0x4872a0['waiting']===0x0&&(_0x4872a0[_0xb4ca('0x34')]||0x0)===0x0){_0x4f5c77=CAMPAIGN_STATUS['INACTIVE'];}return _0x4f5c77;}exports[_0xb4ca('0x37')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2ca412){var _0x58887=_0x2ca412[_0xb4ca('0x38')](/"(.*?)"/);return _0x58887?_0x58887[0x1]:_0x2ca412;}exports[_0xb4ca('0x39')]=extractCalleridName;function getCallerId(_0x2a21fc,_0x26d33b,_0x4b6fef){if(!_['isUndefined'](_0x4b6fef)&&typeof _0x4b6fef===_0xb4ca('0x3a')&&!_[_0xb4ca('0x29')](_0x4b6fef)){if(!_[_0xb4ca('0x3b')](_0x26d33b)&&typeof _0x26d33b==='string'&&!_[_0xb4ca('0x29')](_0x26d33b)){return util[_0xb4ca('0x3c')]('\x22%s\x22\x20<%s>',_0x26d33b,_0x4b6fef);}return util['format'](_0xb4ca('0x3d'),_0x4b6fef,_0x4b6fef);}if(!_['isUndefined'](_0x2a21fc)&&typeof _0x2a21fc===_0xb4ca('0x3a')&&!_[_0xb4ca('0x29')](_0x2a21fc)){return _0x2a21fc;}return'\x22\x22\x20<>';}exports[_0xb4ca('0x3e')]=getCallerId;function getCallerIdRandom(_0x2eaf6e,_0xee7463){var _0x22ccd2;var _0x351e7b;var _0x391959;if(_0xee7463<=0x0){_0xee7463=0x1;}_0x22ccd2=new RegExp('\x5cw{0,'+_0xee7463+'}$');_0x351e7b=Math[_0xb4ca('0x3f')](0xa,_0xee7463-0x1);_0x391959=Math[_0xb4ca('0x3f')](0xa,_0xee7463)-0x1;return util['format']('%s',_[_0xb4ca('0x40')](_0x2eaf6e,_0x22ccd2,_[_0xb4ca('0x41')](_0x351e7b,_0x391959)[_0xb4ca('0x42')]()));}exports[_0xb4ca('0x43')]=getCallerIdRandom;function decrementOriginate(_0x2f5dee){if(_0x2f5dee['originated']&&_0x2f5dee['originated']>0x0){_0x2f5dee[_0xb4ca('0x22')]-=0x1;}else{logger[_0xb4ca('0x44')](_0xb4ca('0x45'));}}exports[_0xb4ca('0x46')]=decrementOriginate;function checkContactEmpty(_0x46a230){return _0x46a230&&_0x46a230[_0xb4ca('0x47')]>0x0;}exports[_0xb4ca('0x48')]=checkContactEmpty;function erlangb(_0x26f669,_0x4089b3){if(_0x4089b3===0x0){return 0x0;}var _0x32c5a3=0x1;for(var _0x403dda=0x1;_0x403dda<=_0x4089b3;_0x403dda+=0x1){_0x32c5a3=0x1+_0x32c5a3*_0x403dda/_0x26f669;}return 0x1/_0x32c5a3;}exports[_0xb4ca('0x49')]=erlangb;function checkContactLowerLimitOriginate(_0x2b9d09,_0x533c7b,_0x3bfe5d){if(_0x533c7b>_0x3bfe5d){for(var _0x10c63d=0x0;_0x10c63d<_0x533c7b-_0x3bfe5d;_0x10c63d+=0x1){decrementOriginate(_0x2b9d09);}}}exports[_0xb4ca('0x4a')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xd593=['seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','SIP/','reachable','unmonitored','includes','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xd593,0x1b2));var _0x3d59=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xd593[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x3d59('0x0'));var moment=require(_0x3d59('0x1'));var util=require('util');var logger=require(_0x3d59('0x2'))(_0x3d59('0x3'));var timezones=require(_0x3d59('0x4'))[_0x3d59('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x3d59('0x6'),'BLACKLIST':_0x3d59('0x7'),'CONTACTS_RESCHEDULED':_0x3d59('0x8'),'DEACTIVATED':_0x3d59('0x9'),'DISACTIVED':_0x3d59('0xa'),'EMPTY_INTERVAL':_0x3d59('0xb'),'INACTIVE':_0x3d59('0xc'),'NO_AGENTS_LOGGED':_0x3d59('0xd'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x3d59('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x3d59('0xf'),'QUEUE_RECALL':_0x3d59('0x10'),'RECALL_TIMEOUT':_0x3d59('0x11'),'RUNNING':_0x3d59('0x12'),'UNKNOWN_TIMEZONE':_0x3d59('0x13'),'UNREACHABLE_TRUNK':_0x3d59('0x14')};exports[_0x3d59('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x18317b){return _0x18317b[_0x3d59('0x16')]===_0x3d59('0x17');}exports[_0x3d59('0x18')]=isPreviewCampaign;function isIVRCampaign(_0x34b7eb){return _0x34b7eb[_0x3d59('0x19')]===_0x3d59('0x1a');}exports[_0x3d59('0x1b')]=isIVRCampaign;function isOutboundQueue(_0x354ec1){return _0x354ec1[_0x3d59('0x19')]===_0x3d59('0x1c');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x13a0a0){return _0x13a0a0[_0x3d59('0x1d')];}exports[_0x3d59('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x2d8f87){return _0x2d8f87[_0x3d59('0x1f')];}exports[_0x3d59('0x20')]=isIVRCampaignActive;function getSeconds(_0x2cb020,_0x53bb42){var _0x390b05=moment(_0x2cb020)[_0x3d59('0x21')](0x0);var _0x58e68b=moment(_0x53bb42)[_0x3d59('0x21')](0x0);return _0x390b05['diff'](_0x58e68b,_0x3d59('0x22'));}exports[_0x3d59('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x2dbd45,_0xdc0d67){var _0x2925f8=![];var _0x49d124=_0x2dbd45[_0x3d59('0x16')]!==_0xdc0d67[_0x3d59('0x16')]||_0x2dbd45[_0x3d59('0x1d')]!==_0xdc0d67[_0x3d59('0x1d')]||_0x2dbd45[_0x3d59('0x24')]!==_0xdc0d67[_0x3d59('0x24')];var _0x4fd38a=_0x2dbd45[_0x3d59('0x25')]!==_0xdc0d67[_0x3d59('0x25')]||_0x2dbd45['loggedIn']!==_0xdc0d67[_0x3d59('0x26')]||_0x2dbd45[_0x3d59('0x27')]!==_0xdc0d67['loggedInDb']||_0x2dbd45[_0x3d59('0x28')]!==_0xdc0d67[_0x3d59('0x28')]||_0x2dbd45['talking']!==_0xdc0d67[_0x3d59('0x29')]||_0x2dbd45[_0x3d59('0x2a')]!==_0xdc0d67[_0x3d59('0x2a')]||_0x2dbd45['waiting']!==_0xdc0d67[_0x3d59('0x2b')]||_0x2dbd45[_0x3d59('0x2c')]!==_0xdc0d67[_0x3d59('0x2c')]||_0x2dbd45[_0x3d59('0x2d')]!==_0xdc0d67[_0x3d59('0x2d')];if(_0x2dbd45[_0x3d59('0x2e')]&&_0xdc0d67[_0x3d59('0x2e')]){_0x2925f8=_0x2dbd45['Trunk'][_0x3d59('0x2f')]!==_0xdc0d67[_0x3d59('0x2e')][_0x3d59('0x2f')]||_0x2dbd45['Trunk'][_0x3d59('0x1f')]!==_0xdc0d67[_0x3d59('0x2e')][_0x3d59('0x1f')];}return _0x49d124||_0x4fd38a||_0x2925f8;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2fe2d6){var _0x50ddd2=null;var _0xca166=_0x2fe2d6[_0x3d59('0x30')];if(_['isNil'](_0x2fe2d6[_0x3d59('0x31')])||_[_0x3d59('0x32')](_0x2fe2d6[_0x3d59('0x33')])||_[_0x3d59('0x32')](_0x2fe2d6[_0x3d59('0x33')][_0x3d59('0x34')])){_0x50ddd2=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x2fe2d6[_0x3d59('0x31')])||_[_0x3d59('0x35')](_0x2fe2d6[_0x3d59('0x33')]['Intervals'])){_0x50ddd2=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0xca166&&!timezones[_0xca166]){_0x50ddd2=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x50ddd2;}function checkAnyValidTrunk(_0x352f77,_0x49ff38){var _0x378973=null;var _0x30842b=_0x3d59('0x36');var _0x1c83db=[_0x3d59('0x37'),_0x3d59('0x38')];var _0x335768=!![];if(_0x352f77[_0x3d59('0x2e')]&&_0x352f77['Trunk']['active']){_0x30842b+=_0x352f77[_0x3d59('0x2e')]['name'];_0x378973=_0x49ff38[_0x30842b];_0x335768=_0x1c83db[_0x3d59('0x39')](_0x378973[_0x3d59('0x3a')]);}else if(_0x352f77['TrunkBackup']&&_0x352f77['TrunkBackup'][_0x3d59('0x1f')]){_0x30842b+=_0x352f77['TrunkBackup'][_0x3d59('0x2f')];_0x378973=_0x49ff38[_0x30842b];_0x335768=_0x1c83db[_0x3d59('0x39')](_0x378973[_0x3d59('0x3a')]);}return _0x335768;}function getQueueCampaignStatusMessage(_0x486473,_0xd13811){var _0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x6')];var _0x5aa550=isPreviewCampaign(_0x486473);if(!isQueueCampaignActive(_0x486473)){if(_0x5aa550){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3b')];}else{if(_0x486473[_0x3d59('0x2d')]===0x0&&_0x486473[_0x3d59('0x29')]===0x0&&_0x486473['waiting']===0x0&&(_0x486473['pTalking']||0x0)===0x0){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3b')];}else{_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3c')];}}}else if(_0x486473['loggedIn']===0x0){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3d')];}else if(!checkAnyValidTrunk(_0x486473,_0xd13811)){_0x189e8f=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x486473)){var _0x21978d=checkAnyValidQueueCampaignInterval(_0x486473);if(_0x21978d){_0x189e8f=_0x21978d;}}return _0x189e8f;}exports[_0x3d59('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x233ea8){var _0x2430f9=CAMPAIGN_STATUS['DISACTIVED'];if(_0x233ea8['originated']===0x0&&_0x233ea8[_0x3d59('0x29')]===0x0&&_0x233ea8[_0x3d59('0x2b')]===0x0&&(_0x233ea8['pTalking']||0x0)===0x0){_0x2430f9=CAMPAIGN_STATUS['INACTIVE'];}return _0x2430f9;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x37487f){var _0x178c2a=_0x37487f[_0x3d59('0x3f')](/"(.*?)"/);return _0x178c2a?_0x178c2a[0x1]:_0x37487f;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x18a9f9,_0x397544,_0x3ff121){if(!_[_0x3d59('0x40')](_0x3ff121)&&typeof _0x3ff121==='string'&&!_[_0x3d59('0x35')](_0x3ff121)){if(!_[_0x3d59('0x40')](_0x397544)&&typeof _0x397544===_0x3d59('0x41')&&!_[_0x3d59('0x35')](_0x397544)){return util[_0x3d59('0x42')](_0x3d59('0x43'),_0x397544,_0x3ff121);}return util[_0x3d59('0x42')](_0x3d59('0x43'),_0x3ff121,_0x3ff121);}if(!_['isUndefined'](_0x18a9f9)&&typeof _0x18a9f9===_0x3d59('0x41')&&!_[_0x3d59('0x35')](_0x18a9f9)){return _0x18a9f9;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x409a25,_0x48b57d){var _0x177e7a;var _0xff3e51;var _0x549c4b;if(_0x48b57d<=0x0){_0x48b57d=0x1;}_0x177e7a=new RegExp(_0x3d59('0x44')+_0x48b57d+'}$');_0xff3e51=Math[_0x3d59('0x45')](0xa,_0x48b57d-0x1);_0x549c4b=Math['pow'](0xa,_0x48b57d)-0x1;return util['format']('%s',_[_0x3d59('0x46')](_0x409a25,_0x177e7a,_['random'](_0xff3e51,_0x549c4b)[_0x3d59('0x47')]()));}exports[_0x3d59('0x48')]=getCallerIdRandom;function decrementOriginate(_0x286081){if(_0x286081[_0x3d59('0x2d')]&&_0x286081[_0x3d59('0x2d')]>0x0){_0x286081[_0x3d59('0x2d')]-=0x1;}else{logger['error'](_0x3d59('0x49'));}}exports[_0x3d59('0x4a')]=decrementOriginate;function checkContactEmpty(_0x47e8dc){return _0x47e8dc&&_0x47e8dc[_0x3d59('0x4b')]>0x0;}exports[_0x3d59('0x4c')]=checkContactEmpty;function erlangb(_0x4b9449,_0x3507bd){if(_0x3507bd===0x0){return 0x0;}var _0x593cf9=0x1;for(var _0x52e036=0x1;_0x52e036<=_0x3507bd;_0x52e036+=0x1){_0x593cf9=0x1+_0x593cf9*_0x52e036/_0x4b9449;}return 0x1/_0x593cf9;}exports[_0x3d59('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x484376,_0x1aaa86,_0x25704e){if(_0x1aaa86>_0x25704e){for(var _0x4e1a5e=0x0;_0x4e1a5e<_0x1aaa86-_0x25704e;_0x4e1a5e+=0x1){decrementOriginate(_0x484376);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 22493f3..80fd4e9 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 _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x1625db,_0x58dc81){var _0x45d1ab=function(_0x31d81f){while(--_0x31d81f){_0x1625db['push'](_0x1625db['shift']());}};_0x45d1ab(++_0x58dc81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3bf29b,_0x32c9b1){var _0x10d5d0=function(_0x38601e){while(--_0x38601e){_0x3bf29b['push'](_0x3bf29b['shift']());}};_0x10d5d0(++_0x32c9b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 039e122..fd7fd74 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 _0xadf3=['resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','notify','.pdf','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','bluebird','uuid','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred'];(function(_0xf73a3e,_0x26d4c3){var _0x43a535=function(_0x14dc3f){while(--_0x14dc3f){_0xf73a3e['push'](_0xf73a3e['shift']());}};_0x43a535(++_0x26d4c3);}(_0xadf3,0x19d));var _0x3adf=function(_0x3ad1d9,_0x4b7f98){_0x3ad1d9=_0x3ad1d9-0x0;var _0xd2066c=_0xadf3[_0x3ad1d9];return _0xd2066c;};'use strict';var util=require(_0x3adf('0x0'));var _=require('lodash');var BPromise=require(_0x3adf('0x1'));var uuid=require(_0x3adf('0x2'));var moment=require('moment');var path=require(_0x3adf('0x3'));var tiff2pdf=require(_0x3adf('0x4'));var gs=require(_0x3adf('0x5'));var logger=require('../../../config/logger')(_0x3adf('0x6'));var ami=require('../ami');var rpcDb=require(_0x3adf('0x7'));var Channel=require(_0x3adf('0x8'));var ut=require(_0x3adf('0x9'));var Action=require(_0x3adf('0xa'));var faxAccount=require(_0x3adf('0xb'));var attachment=require(_0x3adf('0xc'));var faxMessage=require(_0x3adf('0xd'));function Fax(_0x24256e){this[_0x3adf('0xe')]={};this['faxAccounts']=_0x24256e['faxAccounts'];this[_0x3adf('0xf')]=_0x24256e[_0x3adf('0xf')];this[_0x3adf('0x10')]={};ami['on']('newchannel',this[_0x3adf('0x11')][_0x3adf('0x12')](this));ami['on'](_0x3adf('0x13'),this[_0x3adf('0x14')]['bind'](this));ami['on'](_0x3adf('0x15'),this[_0x3adf('0x16')][_0x3adf('0x12')](this));ami['on']('newexten',this[_0x3adf('0x17')][_0x3adf('0x12')](this));ami['on'](_0x3adf('0x18'),this['syncFaxStatus'][_0x3adf('0x12')](this));ami['on'](_0x3adf('0x19'),this[_0x3adf('0x1a')]['bind'](this));ami['on'](_0x3adf('0x1b'),this['syncHangup'][_0x3adf('0x12')](this));ami['on'](_0x3adf('0x1c'),this[_0x3adf('0x1d')][_0x3adf('0x12')](this));}Fax[_0x3adf('0x1e')][_0x3adf('0x11')]=function(_0x5e00e1){if(_0x5e00e1[_0x3adf('0x1f')]==='from-voip-provider'){for(var _0x1bb094 in this['faxAccounts']){if(this[_0x3adf('0x20')][_0x3adf('0x21')](_0x1bb094)){if(_0x5e00e1[_0x3adf('0x22')]===this[_0x3adf('0x20')][_0x1bb094][_0x3adf('0x23')]){this[_0x3adf('0xe')][_0x5e00e1['uniqueid']]={};this[_0x3adf('0xe')][_0x5e00e1[_0x3adf('0x24')]][_0x3adf('0x25')]=_0x5e00e1[_0x3adf('0x25')];this['channels'][_0x5e00e1[_0x3adf('0x24')]]['id']=this[_0x3adf('0x20')][_0x1bb094]['id'];this[_0x3adf('0xe')][_0x5e00e1['uniqueid']][_0x3adf('0x26')]=this[_0x3adf('0x20')][_0x1bb094][_0x3adf('0x26')];logger['info'](_0x5e00e1[_0x3adf('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0x3adf('0x10')][_0x5e00e1[_0x3adf('0x24')]]){this[_0x3adf('0xe')][_0x5e00e1['uniqueid']]={};this[_0x3adf('0xe')][_0x5e00e1[_0x3adf('0x24')]]['channel']=_0x5e00e1['channel'];logger[_0x3adf('0x27')](_0x5e00e1[_0x3adf('0x24')],_0x3adf('0x28'));}};Fax[_0x3adf('0x1e')][_0x3adf('0x14')]=function(_0x5f55bd){if(this[_0x3adf('0xe')][_0x5f55bd[_0x3adf('0x24')]]){for(var _0x48f90e in _0x5f55bd['variable']){if(_0x5f55bd[_0x3adf('0x29')][_0x3adf('0x21')](_0x48f90e)){this['channels'][_0x5f55bd[_0x3adf('0x24')]][_0x48f90e]=_0x5f55bd[_0x3adf('0x2a')];}}}};Fax[_0x3adf('0x1e')][_0x3adf('0x16')]=function(_0x4ffac9){if(this[_0x3adf('0xe')][_0x4ffac9['uniqueid']]){this[_0x3adf('0xe')][_0x4ffac9[_0x3adf('0x24')]][_0x3adf('0x2b')]=_0x4ffac9[_0x3adf('0x2b')];this[_0x3adf('0xe')][_0x4ffac9['uniqueid']]['channelstatedesc']=_0x4ffac9[_0x3adf('0x2c')];}};Fax['prototype']['syncNewExten']=function(_0x9acfce){if(this[_0x3adf('0xe')][_0x9acfce[_0x3adf('0x24')]]){for(var _0x2186f8 in _0x9acfce[_0x3adf('0x29')]){if(_0x9acfce['variable'][_0x3adf('0x21')](_0x2186f8)){this[_0x3adf('0xe')][_0x9acfce[_0x3adf('0x24')]][_0x2186f8]=_0x9acfce['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x304106){if(this[_0x3adf('0xe')][_0x304106[_0x3adf('0x24')]]){this['channels'][_0x304106[_0x3adf('0x24')]][_0x3adf('0x2d')]=_0x304106[_0x3adf('0x2d')];this['channels'][_0x304106['uniqueid']][_0x3adf('0x2e')]=_0x304106[_0x3adf('0x2e')];this[_0x3adf('0xe')][_0x304106[_0x3adf('0x24')]][_0x3adf('0x23')]=_0x304106[_0x3adf('0x23')];this['channels'][_0x304106[_0x3adf('0x24')]][_0x3adf('0x2f')]=_0x304106[_0x3adf('0x2f')];logger['info'](_0x304106['uniqueid'],_0x3adf('0x30'));}};Fax[_0x3adf('0x1e')]['syncReceiveFax']=function(_0x3b9ddc){var _0x512113=this;if(this['channels'][_0x3b9ddc[_0x3adf('0x24')]]){var _0x45ef60=this['channels'][_0x3b9ddc[_0x3adf('0x24')]]['id'];this[_0x3adf('0xe')][_0x3b9ddc[_0x3adf('0x24')]][_0x3adf('0x31')]=_0x3b9ddc[_0x3adf('0x31')];this[_0x3adf('0xe')][_0x3b9ddc[_0x3adf('0x24')]][_0x3adf('0x32')]=_0x3b9ddc[_0x3adf('0x32')];this['channels'][_0x3b9ddc['uniqueid']][_0x3adf('0x23')]=_0x3b9ddc['localstationid'];this[_0x3adf('0xe')][_0x3b9ddc[_0x3adf('0x24')]][_0x3adf('0x33')]=_0x3b9ddc[_0x3adf('0x33')];this[_0x3adf('0xe')][_0x3b9ddc[_0x3adf('0x24')]]['transferrate']=_0x3b9ddc['transferrate'];this[_0x3adf('0xe')][_0x3b9ddc[_0x3adf('0x24')]]['filename']=_0x3b9ddc[_0x3adf('0x2f')];this[_0x3adf('0xe')][_0x3b9ddc['uniqueid']][_0x3adf('0x34')]=_0x3b9ddc[_0x3adf('0x34')];if(this['channels'][_0x3b9ddc['uniqueid']][_0x3adf('0x32')]>0x0){tiff2pdf(_0x3b9ddc[_0x3adf('0x2f')],_0x3adf('0x35'),function(_0x33415e){logger[_0x3adf('0x27')](_0x3b9ddc['uniqueid'],_0x3adf('0x36'),_0x33415e[_0x3adf('0x37')]);attachment[_0x3adf('0x38')]({'name':path[_0x3adf('0x39')](_0x3b9ddc[_0x3adf('0x2f')])['name'],'basename':path[_0x3adf('0x39')](_0x3b9ddc[_0x3adf('0x2f')])[_0x3adf('0x26')]+'.pdf','type':_0x3adf('0x3a')})['then'](function(_0x16779f){faxAccount[_0x3adf('0x3b')](_0x45ef60,{'from':_0x3b9ddc[_0x3adf('0x34')],'mapKey':_0x3adf('0x6'),'body':path['parse'](_0x3b9ddc[_0x3adf('0x2f')])[_0x3adf('0x26')]+_0x3adf('0x3c'),'AttachmentId':_0x16779f['id']})[_0x3adf('0x3d')](function(_0x5c3780){logger['error'](_0x3b9ddc['uniqueid'],_0x3adf('0x3e'),JSON['stringify'](_0x5c3780));});})['catch'](function(_0x4d4894){logger['error'](_0x3b9ddc[_0x3adf('0x24')],'\x20receiveFax\x20',JSON[_0x3adf('0x3f')](_0x4d4894));});});}logger[_0x3adf('0x27')](_0x3b9ddc[_0x3adf('0x24')],_0x3adf('0x40'));}};Fax[_0x3adf('0x1e')][_0x3adf('0x1d')]=function(_0x4d12fe){if(this[_0x3adf('0x10')][_0x4d12fe[_0x3adf('0x24')]]){_[_0x3adf('0x41')](this[_0x3adf('0xe')][_0x4d12fe['uniqueid']],_[_0x3adf('0x42')](_0x4d12fe,['response',_0x3adf('0x43')]));}};function updateStatus(_0x1497c3){if(_0x1497c3['AttachmentId']){faxMessage[_0x3adf('0x44')](_0x1497c3[_0x3adf('0x45')],{'failMessage':_0x3adf('0x46')})[_0x3adf('0x47')](function(_0x5f118f){ut[_0x3adf('0x48')](_0x3adf('0x49'),_0x5f118f);})['catch'](function(_0x24ed1a){ut[_0x3adf('0x48')](_0x3adf('0x4a'),_0x24ed1a);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x3adf('0x1e')]['updateStatus']=function(_0x466d02,_0x29bf5b,_0x407bb9){var _0x875900=this;var _0x2ae315={};if(_0x29bf5b){_0x2ae315={'read':_0x29bf5b};}else{_0x2ae315={'failMessage':_0x407bb9};}if(this['actions'][_0x466d02][_0x3adf('0x45')]){faxMessage[_0x3adf('0x44')](this[_0x3adf('0x10')][_0x466d02][_0x3adf('0x45')],_0x2ae315)[_0x3adf('0x47')](function(_0x572f39){ut[_0x3adf('0x48')](_0x3adf('0x4b'),_0x572f39);})['catch'](function(_0xebf3d){ut['logger'](_0x3adf('0x4c'),_0xebf3d);})[_0x3adf('0x4d')](function(){delete _0x875900[_0x3adf('0xe')][_0x466d02];delete _0x875900[_0x3adf('0x10')][_0x466d02];});}else{ut[_0x3adf('0x48')](_0x3adf('0x4e'));delete this[_0x3adf('0xe')][_0x466d02];delete this[_0x3adf('0x10')][_0x466d02];}};Fax[_0x3adf('0x1e')][_0x3adf('0x4f')]=function(_0x2fc4b5){var _0x47d6c3=this;if(this[_0x3adf('0xe')][_0x2fc4b5[_0x3adf('0x24')]]){if(this[_0x3adf('0x10')][_0x2fc4b5[_0x3adf('0x24')]]){this['channels'][_0x2fc4b5['uniqueid']]['id']=this[_0x3adf('0x10')][_0x2fc4b5[_0x3adf('0x24')]]['id'];this[_0x3adf('0xe')][_0x2fc4b5['uniqueid']][_0x3adf('0x26')]=this[_0x3adf('0x10')][_0x2fc4b5[_0x3adf('0x24')]][_0x3adf('0x26')];}logger[_0x3adf('0x27')](_0x2fc4b5[_0x3adf('0x24')],this['actions'][_0x2fc4b5[_0x3adf('0x24')]]?_0x3adf('0x50'):_0x3adf('0x51'),JSON['stringify'](this[_0x3adf('0xe')][_0x2fc4b5[_0x3adf('0x24')]]));if(this[_0x3adf('0x10')][_0x2fc4b5['uniqueid']]){if(this['channels'][_0x2fc4b5['uniqueid']][_0x3adf('0x52')]>0x0&&this[_0x3adf('0xe')][_0x2fc4b5[_0x3adf('0x24')]]['faxstatus']===_0x3adf('0x53')){this[_0x3adf('0x54')](_0x2fc4b5[_0x3adf('0x24')],!![]);}else{this[_0x3adf('0x54')](_0x2fc4b5[_0x3adf('0x24')],![],this[_0x3adf('0xe')][_0x2fc4b5[_0x3adf('0x24')]][_0x3adf('0x55')]?_0x3adf('0x56')+this[_0x3adf('0xe')][_0x2fc4b5[_0x3adf('0x24')]][_0x3adf('0x55')]:_0x3adf('0x57'));}}}};Fax[_0x3adf('0x1e')]['send']=function(_0x57e55d){var _0xfa4152=this;return new BPromise(function(_0x94b7ac,_0x1c3e1b){_0xfa4152[_0x3adf('0x58')](_0x57e55d,_0xfa4152[_0x3adf('0x20')][_0x57e55d[_0x3adf('0x59')]])[_0x3adf('0x47')](function(_0x4c5b2d){ut[_0x3adf('0x48')]('[Fax][execOriginate][success]',_0x4c5b2d);_0x94b7ac(ut['message'](_0x3adf('0x5a')));})[_0x3adf('0x3d')](function(_0x268a78){ut[_0x3adf('0x48')]('[Fax][execOriginate][failure]',_0x268a78);updateStatus(_0x57e55d);_0x1c3e1b(ut['message'](_0x3adf('0x5b')));});});};Fax[_0x3adf('0x1e')][_0x3adf('0x5c')]=function(_0x41846a){var _0x4797da=this;return new BPromise(function(_0x582ccf,_0x35c943){var _0x2be8e2=_0x4797da[_0x3adf('0x5d')](_0x4797da[_0x3adf('0x20')][_0x41846a[_0x3adf('0x59')]][_0x3adf('0x5e')],_0x41846a);if(_0x2be8e2[_0x3adf('0x5f')]){_0x582ccf(ut[_0x3adf('0x37')]('Trunk\x20Reachable'));}else{_0x35c943(ut[_0x3adf('0x37')](_0x2be8e2[_0x3adf('0x37')]));}});};function originate(_0x3aa076,_0x5966cf,_0x2aef66){return new BPromise(function(_0x1abcd7,_0x568ffa){if(_0x2aef66){var _0x1e52b4=util[_0x3adf('0x60')](_0x3adf('0x61'),path['parse'](_0x3aa076[_0x3adf('0x3')])[_0x3adf('0x26')],_0x3aa076['path']);gs[_0x3adf('0x62')](_0x1e52b4)[_0x3adf('0x47')](function(){_0x3aa076[_0x3adf('0x3')]=util[_0x3adf('0x60')](_0x3adf('0x63'),path['parse'](_0x3aa076[_0x3adf('0x3')])[_0x3adf('0x64')],path['parse'](_0x3aa076[_0x3adf('0x3')])['name']);_0x5966cf[_0x3adf('0x65')]=_0x3aa076[_0x3adf('0x3')];ut[_0x3adf('0x48')](_0x3adf('0x66'),'');ami[_0x3adf('0x67')](ut['variablesAction'](_0x3aa076,_0x5966cf))[_0x3adf('0x47')](function(_0x35d068){_0x1abcd7(_0x35d068);})['catch'](function(_0x2abc74){_0x568ffa(_0x2abc74);});})[_0x3adf('0x3d')](function(_0x4e33df){_0x568ffa(_0x4e33df);});}else{ami[_0x3adf('0x67')](ut['variablesAction'](_0x3aa076,_0x5966cf))['then'](function(_0x8bbc71){_0x1abcd7(_0x8bbc71);})[_0x3adf('0x3d')](function(_0x482df3){_0x568ffa(_0x482df3);});}});}Fax[_0x3adf('0x1e')][_0x3adf('0x58')]=function(_0x126554,_0x162bef){var _0x2a4de1=this;return new BPromise(function(_0x1ca89f,_0xe43565){var _0x35a366=uuid['v4']();var _0x2edc93=ut['addVariables'](_0x126554,_0x162bef);_0x2a4de1[_0x3adf('0x10')][_0x35a366]=new Action(_0x35a366,_0x162bef,_0x126554);var _0x824862=_0x2a4de1['actions'][_0x35a366];if(path['parse'](_0x126554[_0x3adf('0x3')])[_0x3adf('0x68')]===_0x3adf('0x3c')){originate(_0x824862,_0x2edc93,!![])['then'](function(_0x2a601d){_0x1ca89f(_0x2a601d);})['catch'](function(_0x32d63e){_0xe43565(_0x32d63e);});}else{originate(_0x824862,_0x2edc93,![])[_0x3adf('0x47')](function(_0x5dfe11){_0x1ca89f(_0x5dfe11);})[_0x3adf('0x3d')](function(_0xe3f986){_0xe43565(_0xe3f986);});}});};Fax['prototype'][_0x3adf('0x69')]=function(_0x54747c){return!_[_0x3adf('0x6a')](_0x54747c)&&!_[_0x3adf('0x6a')](_0x54747c[_0x3adf('0x26')])&&!_[_0x3adf('0x6a')](_0x54747c[_0x3adf('0x6b')])&&_0x54747c[_0x3adf('0x6b')]&&!_[_0x3adf('0x6a')](this['trunks'][util[_0x3adf('0x60')](_0x3adf('0x6c'),_0x54747c[_0x3adf('0x26')])])&&!_[_0x3adf('0x6a')](this[_0x3adf('0xf')][util['format'](_0x3adf('0x6c'),_0x54747c[_0x3adf('0x26')])]['status'])&&(this[_0x3adf('0xf')][util[_0x3adf('0x60')](_0x3adf('0x6c'),_0x54747c['name'])][_0x3adf('0x2e')]===_0x3adf('0x6d')||this[_0x3adf('0xf')][util['format'](_0x3adf('0x6c'),_0x54747c['name'])]['status']==='unmonitored');};Fax['prototype'][_0x3adf('0x5d')]=function(_0x210592,_0x39e5f1){if(!this[_0x3adf('0x69')](_0x210592)){ut[_0x3adf('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x3adf('0x6a')](_0x210592)?'':_0x210592[_0x3adf('0x26')]+_0x3adf('0x6e'));return{'isValid':![],'message':_0x3adf('0x6f')};}if(_[_0x3adf('0x6a')](_0x39e5f1[_0x3adf('0x6')])){ut['logger'](_0x3adf('0x70'),JSON[_0x3adf('0x3f')](_0x39e5f1));return{'isValid':![],'message':_0x3adf('0x71')};}if(_[_0x3adf('0x6a')](_0x39e5f1[_0x3adf('0x3')])){ut[_0x3adf('0x48')](_0x3adf('0x72'),JSON[_0x3adf('0x3f')](_0x39e5f1));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3adf('0x73')};};module['exports']=Fax; \ No newline at end of file +var _0x21a9=['channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','merge','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncNewState','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x21a9,0x12f));var _0x921a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x21a9[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x921a('0x0'));var _=require(_0x921a('0x1'));var BPromise=require(_0x921a('0x2'));var uuid=require(_0x921a('0x3'));var moment=require(_0x921a('0x4'));var path=require(_0x921a('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x921a('0x6'));var logger=require(_0x921a('0x7'))(_0x921a('0x8'));var ami=require(_0x921a('0x9'));var rpcDb=require(_0x921a('0xa'));var Channel=require('./channel');var ut=require(_0x921a('0xb'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x921a('0xc'));function Fax(_0x57b635){this[_0x921a('0xd')]={};this[_0x921a('0xe')]=_0x57b635[_0x921a('0xe')];this[_0x921a('0xf')]=_0x57b635['trunks'];this[_0x921a('0x10')]={};ami['on'](_0x921a('0x11'),this[_0x921a('0x12')][_0x921a('0x13')](this));ami['on'](_0x921a('0x14'),this['syncVarSet'][_0x921a('0x13')](this));ami['on']('newstate',this[_0x921a('0x15')][_0x921a('0x13')](this));ami['on']('newexten',this[_0x921a('0x16')][_0x921a('0x13')](this));ami['on'](_0x921a('0x17'),this[_0x921a('0x18')][_0x921a('0x13')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x921a('0x19'),this[_0x921a('0x1a')][_0x921a('0x13')](this));ami['on'](_0x921a('0x1b'),this[_0x921a('0x1c')][_0x921a('0x13')](this));}Fax[_0x921a('0x1d')][_0x921a('0x12')]=function(_0x1ddd39){if(_0x1ddd39[_0x921a('0x1e')]===_0x921a('0x1f')){for(var _0x1d477a in this[_0x921a('0xe')]){if(this[_0x921a('0xe')][_0x921a('0x20')](_0x1d477a)){if(_0x1ddd39[_0x921a('0x21')]===this[_0x921a('0xe')][_0x1d477a][_0x921a('0x22')]){this['channels'][_0x1ddd39[_0x921a('0x23')]]={};this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]][_0x921a('0x24')]=_0x1ddd39['channel'];this['channels'][_0x1ddd39['uniqueid']]['id']=this['faxAccounts'][_0x1d477a]['id'];this[_0x921a('0xd')][_0x1ddd39['uniqueid']]['name']=this['faxAccounts'][_0x1d477a][_0x921a('0x25')];logger[_0x921a('0x26')](_0x1ddd39['uniqueid'],_0x921a('0x27'));}}}}if(this[_0x921a('0x10')][_0x1ddd39['uniqueid']]){this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]]={};this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]][_0x921a('0x24')]=_0x1ddd39[_0x921a('0x24')];logger['info'](_0x1ddd39['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x921a('0x1d')]['syncVarSet']=function(_0x4ae1eb){if(this[_0x921a('0xd')][_0x4ae1eb['uniqueid']]){for(var _0xdceb93 in _0x4ae1eb[_0x921a('0x28')]){if(_0x4ae1eb[_0x921a('0x28')][_0x921a('0x20')](_0xdceb93)){this['channels'][_0x4ae1eb[_0x921a('0x23')]][_0xdceb93]=_0x4ae1eb[_0x921a('0x29')];}}}};Fax[_0x921a('0x1d')][_0x921a('0x15')]=function(_0x4c1e5d){if(this[_0x921a('0xd')][_0x4c1e5d[_0x921a('0x23')]]){this[_0x921a('0xd')][_0x4c1e5d['uniqueid']][_0x921a('0x2a')]=_0x4c1e5d[_0x921a('0x2a')];this[_0x921a('0xd')][_0x4c1e5d[_0x921a('0x23')]][_0x921a('0x2b')]=_0x4c1e5d['channelstatedesc'];}};Fax[_0x921a('0x1d')][_0x921a('0x16')]=function(_0x588607){if(this[_0x921a('0xd')][_0x588607[_0x921a('0x23')]]){for(var _0x1ba2c3 in _0x588607[_0x921a('0x28')]){if(_0x588607[_0x921a('0x28')][_0x921a('0x20')](_0x1ba2c3)){this[_0x921a('0xd')][_0x588607['uniqueid']][_0x1ba2c3]=_0x588607[_0x921a('0x29')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x13a54){if(this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]]){this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]]['operation']=_0x13a54[_0x921a('0x2c')];this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]][_0x921a('0x2d')]=_0x13a54[_0x921a('0x2d')];this['channels'][_0x13a54['uniqueid']][_0x921a('0x22')]=_0x13a54[_0x921a('0x22')];this['channels'][_0x13a54[_0x921a('0x23')]]['filename']=_0x13a54[_0x921a('0x2e')];logger[_0x921a('0x26')](_0x13a54[_0x921a('0x23')],_0x921a('0x2f'));}};Fax[_0x921a('0x1d')][_0x921a('0x30')]=function(_0x364fdc){var _0x3df654=this;if(this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]]){var _0x7e9780=this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]]['id'];this['channels'][_0x364fdc['uniqueid']][_0x921a('0x31')]=_0x364fdc[_0x921a('0x31')];this['channels'][_0x364fdc[_0x921a('0x23')]][_0x921a('0x32')]=_0x364fdc[_0x921a('0x32')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x22')]=_0x364fdc[_0x921a('0x22')];this['channels'][_0x364fdc[_0x921a('0x23')]][_0x921a('0x33')]=_0x364fdc[_0x921a('0x33')];this[_0x921a('0xd')][_0x364fdc['uniqueid']][_0x921a('0x34')]=_0x364fdc[_0x921a('0x34')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x2e')]=_0x364fdc[_0x921a('0x2e')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x35')]=_0x364fdc[_0x921a('0x35')];if(this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x32')]>0x0){tiff2pdf(_0x364fdc['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x403eb9){logger['info'](_0x364fdc[_0x921a('0x23')],_0x921a('0x36'),_0x403eb9[_0x921a('0x37')]);attachment['create']({'name':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')],'basename':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')]+_0x921a('0x39'),'type':_0x921a('0x3a')})[_0x921a('0x3b')](function(_0x1922fb){faxAccount[_0x921a('0x3c')](_0x7e9780,{'from':_0x364fdc[_0x921a('0x35')],'mapKey':_0x921a('0x8'),'body':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')]+_0x921a('0x39'),'AttachmentId':_0x1922fb['id']})[_0x921a('0x3d')](function(_0x1eede1){logger['error'](_0x364fdc[_0x921a('0x23')],_0x921a('0x3e'),JSON['stringify'](_0x1eede1));});})['catch'](function(_0x59b651){logger[_0x921a('0x3f')](_0x364fdc[_0x921a('0x23')],_0x921a('0x40'),JSON[_0x921a('0x41')](_0x59b651));});});}logger[_0x921a('0x26')](_0x364fdc['uniqueid'],_0x921a('0x40'));}};Fax[_0x921a('0x1d')][_0x921a('0x1c')]=function(_0x115538){if(this['actions'][_0x115538[_0x921a('0x23')]]){_[_0x921a('0x42')](this['channels'][_0x115538[_0x921a('0x23')]],_['pick'](_0x115538,[_0x921a('0x43'),_0x921a('0x44')]));}};function updateStatus(_0x34ad8f){if(_0x34ad8f[_0x921a('0x45')]){faxMessage[_0x921a('0x46')](_0x34ad8f[_0x921a('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x921a('0x3b')](function(_0x283238){ut[_0x921a('0x47')](_0x921a('0x48'),_0x283238);})[_0x921a('0x3d')](function(_0x4bd52b){ut[_0x921a('0x47')](_0x921a('0x49'),_0x4bd52b);});}else{ut[_0x921a('0x47')](_0x921a('0x4a'));}}Fax[_0x921a('0x1d')]['updateStatus']=function(_0x51c368,_0x331172,_0x221f09){var _0x5e3551=this;var _0x257b66={};if(_0x331172){_0x257b66={'read':_0x331172};}else{_0x257b66={'failMessage':_0x221f09};}if(this[_0x921a('0x10')][_0x51c368][_0x921a('0x45')]){faxMessage[_0x921a('0x46')](this[_0x921a('0x10')][_0x51c368]['AttachmentId'],_0x257b66)['then'](function(_0xe19377){ut[_0x921a('0x47')](_0x921a('0x4b'),_0xe19377);})[_0x921a('0x3d')](function(_0x216551){ut[_0x921a('0x47')](_0x921a('0x4c'),_0x216551);})[_0x921a('0x4d')](function(){delete _0x5e3551['channels'][_0x51c368];delete _0x5e3551['actions'][_0x51c368];});}else{ut[_0x921a('0x47')](_0x921a('0x4e'));delete this[_0x921a('0xd')][_0x51c368];delete this[_0x921a('0x10')][_0x51c368];}};Fax[_0x921a('0x1d')][_0x921a('0x1a')]=function(_0xdca9a0){var _0x57b457=this;if(this['channels'][_0xdca9a0[_0x921a('0x23')]]){if(this[_0x921a('0x10')][_0xdca9a0[_0x921a('0x23')]]){this['channels'][_0xdca9a0[_0x921a('0x23')]]['id']=this[_0x921a('0x10')][_0xdca9a0[_0x921a('0x23')]]['id'];this[_0x921a('0xd')][_0xdca9a0[_0x921a('0x23')]][_0x921a('0x25')]=this['actions'][_0xdca9a0[_0x921a('0x23')]]['name'];}logger[_0x921a('0x26')](_0xdca9a0[_0x921a('0x23')],this[_0x921a('0x10')][_0xdca9a0['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x921a('0x4f'),JSON[_0x921a('0x41')](this[_0x921a('0xd')][_0xdca9a0['uniqueid']]));if(this[_0x921a('0x10')][_0xdca9a0['uniqueid']]){if(this[_0x921a('0xd')][_0xdca9a0[_0x921a('0x23')]][_0x921a('0x50')]>0x0&&this[_0x921a('0xd')][_0xdca9a0['uniqueid']][_0x921a('0x17')]==='SUCCESS'){this['updateStatus'](_0xdca9a0[_0x921a('0x23')],!![]);}else{this[_0x921a('0x51')](_0xdca9a0['uniqueid'],![],this['channels'][_0xdca9a0[_0x921a('0x23')]]['faxstatusstring']?_0x921a('0x52')+this['channels'][_0xdca9a0['uniqueid']][_0x921a('0x53')]:_0x921a('0x54'));}}}};Fax[_0x921a('0x1d')][_0x921a('0x55')]=function(_0x4abeea){var _0x49dc10=this;return new BPromise(function(_0x246794,_0x1f78d5){_0x49dc10[_0x921a('0x56')](_0x4abeea,_0x49dc10[_0x921a('0xe')][_0x4abeea[_0x921a('0x57')]])[_0x921a('0x3b')](function(_0x261570){ut[_0x921a('0x47')]('[Fax][execOriginate][success]',_0x261570);_0x246794(ut[_0x921a('0x37')](_0x921a('0x58')));})['catch'](function(_0x38733a){ut[_0x921a('0x47')](_0x921a('0x59'),_0x38733a);updateStatus(_0x4abeea);_0x1f78d5(ut[_0x921a('0x37')](_0x921a('0x5a')));});});};Fax[_0x921a('0x1d')][_0x921a('0x5b')]=function(_0x4e4d8e){var _0x549c36=this;return new BPromise(function(_0x542e9c,_0x4d5ccd){var _0x1c4d94=_0x549c36[_0x921a('0x5c')](_0x549c36[_0x921a('0xe')][_0x4e4d8e[_0x921a('0x57')]][_0x921a('0x5d')],_0x4e4d8e);if(_0x1c4d94['isValid']){_0x542e9c(ut[_0x921a('0x37')](_0x921a('0x5e')));}else{_0x4d5ccd(ut[_0x921a('0x37')](_0x1c4d94[_0x921a('0x37')]));}});};function originate(_0xef9164,_0x19668b,_0x38c964){return new BPromise(function(_0xdbbc2b,_0x58e54d){if(_0x38c964){var _0x5d7d31=util[_0x921a('0x5f')](_0x921a('0x60'),path[_0x921a('0x38')](_0xef9164[_0x921a('0x5')])[_0x921a('0x25')],_0xef9164[_0x921a('0x5')]);gs['execute'](_0x5d7d31)[_0x921a('0x3b')](function(){_0xef9164[_0x921a('0x5')]=util['format'](_0x921a('0x61'),path['parse'](_0xef9164[_0x921a('0x5')])[_0x921a('0x62')],path[_0x921a('0x38')](_0xef9164[_0x921a('0x5')])[_0x921a('0x25')]);_0x19668b['XMF-PATH']=_0xef9164[_0x921a('0x5')];ut[_0x921a('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x921a('0x63')](ut['variablesAction'](_0xef9164,_0x19668b))[_0x921a('0x3b')](function(_0x68831e){_0xdbbc2b(_0x68831e);})[_0x921a('0x3d')](function(_0x2062ec){_0x58e54d(_0x2062ec);});})[_0x921a('0x3d')](function(_0x4cc65e){_0x58e54d(_0x4cc65e);});}else{ami[_0x921a('0x63')](ut[_0x921a('0x64')](_0xef9164,_0x19668b))['then'](function(_0x50cea5){_0xdbbc2b(_0x50cea5);})[_0x921a('0x3d')](function(_0x545d74){_0x58e54d(_0x545d74);});}});}Fax[_0x921a('0x1d')][_0x921a('0x56')]=function(_0x4a0373,_0x1723e6){var _0x2ad577=this;return new BPromise(function(_0x3ca1e0,_0x2e343e){var _0x15d142=uuid['v4']();var _0x403b98=ut['addVariables'](_0x4a0373,_0x1723e6);_0x2ad577['actions'][_0x15d142]=new Action(_0x15d142,_0x1723e6,_0x4a0373);var _0x1f980f=_0x2ad577['actions'][_0x15d142];if(path[_0x921a('0x38')](_0x4a0373[_0x921a('0x5')])['ext']===_0x921a('0x39')){originate(_0x1f980f,_0x403b98,!![])[_0x921a('0x3b')](function(_0x4549d9){_0x3ca1e0(_0x4549d9);})[_0x921a('0x3d')](function(_0x3e97b4){_0x2e343e(_0x3e97b4);});}else{originate(_0x1f980f,_0x403b98,![])[_0x921a('0x3b')](function(_0x5c3772){_0x3ca1e0(_0x5c3772);})[_0x921a('0x3d')](function(_0x80fa42){_0x2e343e(_0x80fa42);});}});};Fax['prototype'][_0x921a('0x65')]=function(_0x36ead1){return!_['isNil'](_0x36ead1)&&!_[_0x921a('0x66')](_0x36ead1['name'])&&!_[_0x921a('0x66')](_0x36ead1[_0x921a('0x67')])&&_0x36ead1[_0x921a('0x67')]&&!_[_0x921a('0x66')](this[_0x921a('0xf')][util['format'](_0x921a('0x68'),_0x36ead1[_0x921a('0x25')])])&&!_[_0x921a('0x66')](this['trunks'][util[_0x921a('0x5f')]('SIP/%s',_0x36ead1[_0x921a('0x25')])][_0x921a('0x2d')])&&(this['trunks'][util[_0x921a('0x5f')](_0x921a('0x68'),_0x36ead1[_0x921a('0x25')])]['status']===_0x921a('0x69')||this[_0x921a('0xf')][util[_0x921a('0x5f')]('SIP/%s',_0x36ead1[_0x921a('0x25')])][_0x921a('0x2d')]==='unmonitored');};Fax[_0x921a('0x1d')]['checkTrunk']=function(_0x97ed0,_0x401b03){if(!this[_0x921a('0x65')](_0x97ed0)){ut[_0x921a('0x47')](_0x921a('0x6a'),_[_0x921a('0x66')](_0x97ed0)?'':_0x97ed0[_0x921a('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x921a('0x6b')};}if(_[_0x921a('0x66')](_0x401b03['fax'])){ut[_0x921a('0x47')](_0x921a('0x6c'),JSON[_0x921a('0x41')](_0x401b03));return{'isValid':![],'message':_0x921a('0x6d')};}if(_[_0x921a('0x66')](_0x401b03['path'])){ut[_0x921a('0x47')](_0x921a('0x6e'),JSON['stringify'](_0x401b03));return{'isValid':![],'message':_0x921a('0x6f')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x921a('0x70')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f3b9f5e..e728c0b 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 _0xe367=['../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','preview','lodash'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe367,0xcd));var _0x7e36=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xe367[_0x51020b];return _0x371e47;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x7e36('0x0'));var _=require(_0x7e36('0x1'));var faxAccount=require(_0x7e36('0x2'));function loggerCatch(_0x274bc9){return function(_0x51d9b5){logger[_0x7e36('0x3')](_0x274bc9,util[_0x7e36('0x4')](_0x51d9b5,{'showHidden':![],'depth':null}));};}exports[_0x7e36('0x5')]=function(_0x5b8e75,_0x5810d0){return BPromise[_0x7e36('0x6')]()[_0x7e36('0x7')](faxAccount[_0x7e36('0x5')](_0x5b8e75,_0x5810d0))['catch'](loggerCatch(_0x7e36('0x8')));}; \ No newline at end of file +var _0xeee8=['error','inspect','notify','resolve','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x17dbbe,_0x1e095d){var _0x5bffa0=function(_0x4aa2f3){while(--_0x4aa2f3){_0x17dbbe['push'](_0x17dbbe['shift']());}};_0x5bffa0(++_0x1e095d);}(_0xeee8,0x9b));var _0x8eee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeee8[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x8eee('0x0'));var BPromise=require(_0x8eee('0x1'));var logger=require('../../../config/logger')(_0x8eee('0x2'));var _=require(_0x8eee('0x3'));var faxAccount=require(_0x8eee('0x4'));function loggerCatch(_0x1f6ad1){return function(_0x534355){logger[_0x8eee('0x5')](_0x1f6ad1,util[_0x8eee('0x6')](_0x534355,{'showHidden':![],'depth':null}));};}exports[_0x8eee('0x7')]=function(_0x112ce5,_0x4607f6){return BPromise[_0x8eee('0x8')]()['then'](faxAccount[_0x8eee('0x7')](_0x112ce5,_0x4607f6))['catch'](loggerCatch(_0x8eee('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 1b06fb6..0eea200 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 _0xe6b4=['util','fax','bluebird','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect'];(function(_0x2885be,_0x4847c2){var _0x410aab=function(_0x2d35de){while(--_0x2d35de){_0x2885be['push'](_0x2885be['shift']());}};_0x410aab(++_0x4847c2);}(_0xe6b4,0x1f4));var _0x4e6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe6b4[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x4e6b('0x0'));var logger=require('../../../../config/logger')(_0x4e6b('0x1'));var BPromise=require(_0x4e6b('0x2'));var exec=require(_0x4e6b('0x3'))[_0x4e6b('0x4')];exports[_0x4e6b('0x5')]=function(_0x301557){return new BPromise(function(_0x4ba3ff,_0x14f89b){exec(_0x301557,function(_0x50b6ba,_0x279b87,_0x198fc3){logger['info'](_0x4e6b('0x6'),_0x279b87);if(_0x50b6ba){logger[_0x4e6b('0x7')](_0x4e6b('0x6'),_0x4e6b('0x8'),util[_0x4e6b('0x9')](_0x50b6ba,{'showHidden':![],'depth':null}),_0x279b87,_0x198fc3);_0x14f89b(_0x50b6ba);}_0x4ba3ff(_0x279b87);});});}; \ No newline at end of file +var _0x0a34=['info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x4af012,_0x2c7c1c){var _0x1e05b1=function(_0x5508d8){while(--_0x5508d8){_0x4af012['push'](_0x4af012['shift']());}};_0x1e05b1(++_0x2c7c1c);}(_0x0a34,0x107));var _0x40a3=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x0a34[_0x1992f1];return _0x413dfe;};'use strict';var util=require(_0x40a3('0x0'));var logger=require(_0x40a3('0x1'))(_0x40a3('0x2'));var BPromise=require(_0x40a3('0x3'));var exec=require(_0x40a3('0x4'))[_0x40a3('0x5')];exports[_0x40a3('0x6')]=function(_0x285df7){return new BPromise(function(_0x758b7d,_0x204890){exec(_0x285df7,function(_0x433f0f,_0x1fc670,_0xbf6268){logger[_0x40a3('0x7')](_0x40a3('0x8'),_0x1fc670);if(_0x433f0f){logger[_0x40a3('0x7')](_0x40a3('0x8'),_0x40a3('0x9'),util['inspect'](_0x433f0f,{'showHidden':![],'depth':null}),_0x1fc670,_0xbf6268);_0x204890(_0x433f0f);}_0x758b7d(_0x1fc670);});});}; \ 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 7bc4c71..8440e5b 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 _0xb493=['moment','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','gateway','t38timeout','localstationid','variablesAction','originate','channel','xcally-motion-fax','from-sip','format','util'];(function(_0x335a9a,_0x23a909){var _0x3cc723=function(_0x5cce89){while(--_0x5cce89){_0x335a9a['push'](_0x335a9a['shift']());}};_0x3cc723(++_0x23a909);}(_0xb493,0x99));var _0x3b49=function(_0x1b753c,_0x59fe55){_0x1b753c=_0x1b753c-0x0;var _0x4b2078=_0xb493[_0x1b753c];return _0x4b2078;};'use strict';var util=require(_0x3b49('0x0'));var _=require('lodash');var moment=require(_0x3b49('0x1'));var logger=require('../../../../config/logger')(_0x3b49('0x2'));exports[_0x3b49('0x3')]=function(_0x15db00){return{'message':_0x15db00};};exports[_0x3b49('0x4')]=function(_0x8229c8,_0x131e79){logger[_0x3b49('0x5')](_0x8229c8,util[_0x3b49('0x6')](_0x131e79,{'showHidden':![],'depth':null}));};exports[_0x3b49('0x7')]=function(_0x20a770,_0x41d638){var _0x1919c6={'XMF-ECM':_0x41d638[_0x3b49('0x8')],'XMF-HEADERINFO':_0x41d638[_0x3b49('0x9')],'XMF-MINRATE':_0x41d638[_0x3b49('0xa')],'XMF-MAXRATE':_0x41d638[_0x3b49('0xb')],'XMF-MODEM':util['format'](_0x3b49('0xc'),_0x41d638['modem']),'XMF-GATEWAY':_0x41d638[_0x3b49('0xd')],'XMF-FAXDETECT':_0x41d638['faxdetect'],'XMF-T38TIMEOUT':_0x41d638[_0x3b49('0xe')],'XMF-LOCALSTATIONID':_0x41d638[_0x3b49('0xf')],'XMF-PATH':_0x20a770['path']};return _0x1919c6;};exports[_0x3b49('0x10')]=function(_0x110a4e,_0x40706d){return{'actionid':_0x110a4e['uniqueid'],'action':_0x3b49('0x11'),'channel':_0x110a4e[_0x3b49('0x12')],'Exten':_0x3b49('0x13'),'Context':_0x3b49('0x14'),'Priority':'1','callerid':util[_0x3b49('0x15')]('\x22%s\x22\x20<%s>',_0x110a4e[_0x3b49('0x9')]?_0x110a4e['headerinfo']:'',_0x110a4e[_0x3b49('0xf')]),'variable':_0x40706d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x110a4e['uniqueid']};}; \ No newline at end of file +var _0x5217=['faxdetect','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','gateway'];(function(_0x4588bd,_0x57222b){var _0x1becaa=function(_0x2ec59d){while(--_0x2ec59d){_0x4588bd['push'](_0x4588bd['shift']());}};_0x1becaa(++_0x57222b);}(_0x5217,0xfa));var _0x7521=function(_0x45e0f7,_0x2c731e){_0x45e0f7=_0x45e0f7-0x0;var _0x2319de=_0x5217[_0x45e0f7];return _0x2319de;};'use strict';var util=require(_0x7521('0x0'));var _=require(_0x7521('0x1'));var moment=require(_0x7521('0x2'));var logger=require(_0x7521('0x3'))(_0x7521('0x4'));exports['message']=function(_0x2a90a1){return{'message':_0x2a90a1};};exports[_0x7521('0x5')]=function(_0x336a1e,_0x3289ae){logger[_0x7521('0x6')](_0x336a1e,util[_0x7521('0x7')](_0x3289ae,{'showHidden':![],'depth':null}));};exports[_0x7521('0x8')]=function(_0x50c94a,_0x5d7c81){var _0x470823={'XMF-ECM':_0x5d7c81[_0x7521('0x9')],'XMF-HEADERINFO':_0x5d7c81[_0x7521('0xa')],'XMF-MINRATE':_0x5d7c81['minrate'],'XMF-MAXRATE':_0x5d7c81['maxrate'],'XMF-MODEM':util[_0x7521('0xb')](_0x7521('0xc'),_0x5d7c81['modem']),'XMF-GATEWAY':_0x5d7c81[_0x7521('0xd')],'XMF-FAXDETECT':_0x5d7c81[_0x7521('0xe')],'XMF-T38TIMEOUT':_0x5d7c81['t38timeout'],'XMF-LOCALSTATIONID':_0x5d7c81[_0x7521('0xf')],'XMF-PATH':_0x50c94a[_0x7521('0x10')]};return _0x470823;};exports[_0x7521('0x11')]=function(_0x29a7f6,_0x5379d8){return{'actionid':_0x29a7f6['uniqueid'],'action':_0x7521('0x12'),'channel':_0x29a7f6[_0x7521('0x13')],'Exten':_0x7521('0x14'),'Context':_0x7521('0x15'),'Priority':'1','callerid':util['format'](_0x7521('0x16'),_0x29a7f6[_0x7521('0xa')]?_0x29a7f6[_0x7521('0xa')]:'',_0x29a7f6[_0x7521('0xf')]),'variable':_0x5379d8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x29a7f6[_0x7521('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9524b08..d04e60a 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 _0x1b05=['ami','get','hour','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x1b05,0x119));var _0x51b0=function(_0x3cf836,_0x125305){_0x3cf836=_0x3cf836-0x0;var _0x1fbc90=_0x1b05[_0x3cf836];return _0x1fbc90;};'use strict';var util=require(_0x51b0('0x0'));var moment=require(_0x51b0('0x1'));var server=require(_0x51b0('0x2'));var Realtime=require('./realtime');var Report=require(_0x51b0('0x3'));var Acw=require(_0x51b0('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x51b0('0x5'));var Preview=require(_0x51b0('0x6'));var Fax=require(_0x51b0('0x7'));var user=require(_0x51b0('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x51b0('0x9'));var trunk=require(_0x51b0('0xa'));var trigger=require(_0x51b0('0xb'));var template=require(_0x51b0('0xc'));var cmHopperHistory=require(_0x51b0('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x51b0('0xe'));var faxAccount=require(_0x51b0('0xf'));var zendesk=require(_0x51b0('0x10'));var salesforce=require(_0x51b0('0x11'));var sugarcrm=require(_0x51b0('0x12'));var freshdesk=require(_0x51b0('0x13'));var desk=require(_0x51b0('0x14'));var zoho=require(_0x51b0('0x15'));var vtiger=require(_0x51b0('0x16'));var freshsales=require(_0x51b0('0x17'));var servicenow=require(_0x51b0('0x18'));var dynamics365=require(_0x51b0('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x51b0('0x1a'))(_0x51b0('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x51b0('0x1c')](_0x51b0('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x51b0('0x1c')](_0x51b0('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x51b0('0x1e')](user[_0x51b0('0x1f')]())['then'](realtime['initAgents']())[_0x51b0('0x1e')](user[_0x51b0('0x20')]())['then'](realtime[_0x51b0('0x21')]())[_0x51b0('0x1e')](trunk['getTrunks']())[_0x51b0('0x1e')](realtime[_0x51b0('0x22')]())[_0x51b0('0x1e')](voiceQueue[_0x51b0('0x23')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x24')]())[_0x51b0('0x1e')](trigger['getTriggers']())['then'](realtime[_0x51b0('0x25')]())[_0x51b0('0x1e')](template[_0x51b0('0x26')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x27')]())[_0x51b0('0x1e')](zendesk[_0x51b0('0x28')]())['then'](realtime[_0x51b0('0x29')]())[_0x51b0('0x1e')](salesforce[_0x51b0('0x2a')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x2b')]())[_0x51b0('0x1e')](sugarcrm[_0x51b0('0x2c')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x2d')]())[_0x51b0('0x1e')](freshdesk[_0x51b0('0x2e')]())['then'](realtime[_0x51b0('0x2f')]())[_0x51b0('0x1e')](desk[_0x51b0('0x30')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x31')]())[_0x51b0('0x1e')](zoho[_0x51b0('0x32')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x33')]())[_0x51b0('0x1e')](vtiger[_0x51b0('0x34')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x35')]())[_0x51b0('0x1e')](freshsales[_0x51b0('0x36')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x37')]())[_0x51b0('0x1e')](servicenow['getServicenowAccounts']())[_0x51b0('0x1e')](realtime[_0x51b0('0x38')]())[_0x51b0('0x1e')](dynamics365['getDynamics365Accounts']())[_0x51b0('0x1e')](realtime[_0x51b0('0x39')]())[_0x51b0('0x1e')](campaign['getCampaigns']())[_0x51b0('0x1e')](realtime[_0x51b0('0x3a')]())['then'](voiceExtension[_0x51b0('0x3b')]())['then'](realtime[_0x51b0('0x3c')]())[_0x51b0('0x1e')](faxAccount[_0x51b0('0x3d')]())['then'](realtime[_0x51b0('0x3e')]())[_0x51b0('0x1e')](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0x51b0('0x3f')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x40')]())[_0x51b0('0x1e')](cmHopperHistory[_0x51b0('0x41')]())[_0x51b0('0x1e')](realtime[_0x51b0('0x42')]())[_0x51b0('0x1e')](cmHopperHistory[_0x51b0('0x43')]())['then'](realtime[_0x51b0('0x44')]())[_0x51b0('0x1e')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x51b0('0x45')]())[_0x51b0('0x46')](function(_0x539192){logger[_0x51b0('0x47')](_0x51b0('0x48'),util[_0x51b0('0x49')](_0x539192,{'showHidden':![],'depth':null}));});}function main(){return server[_0x51b0('0x4a')](realtime,preview,fax)[_0x51b0('0x1e')](function(){return initRealtime();})[_0x51b0('0x1e')](function(){return initParams();})['then'](function(){report[_0x51b0('0x4b')]();setInterval(initRealtime,0x1388);})[_0x51b0('0x46')](function(_0x24c153){logger[_0x51b0('0x47')](_0x51b0('0x4c'),util[_0x51b0('0x49')](_0x24c153,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf458=['getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers'];(function(_0x3ab370,_0x55c92b){var _0x18bbd8=function(_0xa33b){while(--_0xa33b){_0x3ab370['push'](_0x3ab370['shift']());}};_0x18bbd8(++_0x55c92b);}(_0xf458,0x17f));var _0x8f45=function(_0x544da3,_0x564963){_0x544da3=_0x544da3-0x0;var _0x509883=_0xf458[_0x544da3];return _0x509883;};'use strict';var util=require(_0x8f45('0x0'));var moment=require('moment');var server=require(_0x8f45('0x1'));var Realtime=require(_0x8f45('0x2'));var Report=require(_0x8f45('0x3'));var Acw=require(_0x8f45('0x4'));var Trigger=require(_0x8f45('0x5'));var Dialer=require('./dialer');var Preview=require(_0x8f45('0x6'));var Fax=require('./fax');var user=require(_0x8f45('0x7'));var voiceQueue=require(_0x8f45('0x8'));var voiceQueueReport=require(_0x8f45('0x9'));var voiceCallReport=require(_0x8f45('0xa'));var trunk=require(_0x8f45('0xb'));var trigger=require(_0x8f45('0xc'));var template=require(_0x8f45('0xd'));var cmHopperHistory=require(_0x8f45('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8f45('0xf'));var faxAccount=require(_0x8f45('0x10'));var zendesk=require(_0x8f45('0x11'));var salesforce=require(_0x8f45('0x12'));var sugarcrm=require(_0x8f45('0x13'));var freshdesk=require(_0x8f45('0x14'));var desk=require(_0x8f45('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x8f45('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x8f45('0x17'));var dynamics365=require(_0x8f45('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 logger=require(_0x8f45('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8f45('0x1a')](_0x8f45('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8f45('0x1a')](_0x8f45('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x8f45('0x1c')]()[_0x8f45('0x1d')](user[_0x8f45('0x1e')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x1f')]())[_0x8f45('0x1d')](user[_0x8f45('0x20')]())[_0x8f45('0x1d')](realtime['initTelephones']())[_0x8f45('0x1d')](trunk['getTrunks']())[_0x8f45('0x1d')](realtime[_0x8f45('0x21')]())['then'](voiceQueue[_0x8f45('0x22')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x23')]())[_0x8f45('0x1d')](trigger[_0x8f45('0x24')]())[_0x8f45('0x1d')](realtime['initTriggers']())[_0x8f45('0x1d')](template['getTemplates']())[_0x8f45('0x1d')](realtime['initTemplates']())[_0x8f45('0x1d')](zendesk[_0x8f45('0x25')]())['then'](realtime[_0x8f45('0x26')]())[_0x8f45('0x1d')](salesforce[_0x8f45('0x27')]())['then'](realtime[_0x8f45('0x28')]())[_0x8f45('0x1d')](sugarcrm[_0x8f45('0x29')]())[_0x8f45('0x1d')](realtime['initSugarcrmAccounts']())[_0x8f45('0x1d')](freshdesk[_0x8f45('0x2a')]())['then'](realtime[_0x8f45('0x2b')]())['then'](desk[_0x8f45('0x2c')]())[_0x8f45('0x1d')](realtime['initDeskAccounts']())['then'](zoho[_0x8f45('0x2d')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x2e')]())[_0x8f45('0x1d')](vtiger[_0x8f45('0x2f')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x30')]())[_0x8f45('0x1d')](freshsales[_0x8f45('0x31')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x32')]())[_0x8f45('0x1d')](servicenow[_0x8f45('0x33')]())[_0x8f45('0x1d')](realtime['initServicenowAccounts']())[_0x8f45('0x1d')](dynamics365[_0x8f45('0x34')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x35')]())[_0x8f45('0x1d')](campaign[_0x8f45('0x36')]())[_0x8f45('0x1d')](realtime['initCampaigns']())['then'](voiceExtension[_0x8f45('0x37')]())['then'](realtime[_0x8f45('0x38')]())[_0x8f45('0x1d')](faxAccount[_0x8f45('0x39')]())['then'](realtime[_0x8f45('0x3a')]())[_0x8f45('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0x8f45('0x1c')]()[_0x8f45('0x1d')](voiceQueueReport[_0x8f45('0x3b')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x3c')]())[_0x8f45('0x1d')](cmHopperHistory[_0x8f45('0x3d')]())['then'](realtime[_0x8f45('0x3e')]())[_0x8f45('0x1d')](cmHopperHistory[_0x8f45('0x3f')]())['then'](realtime[_0x8f45('0x40')]())[_0x8f45('0x1d')](voiceCallReport[_0x8f45('0x41')]())['then'](realtime[_0x8f45('0x42')]())[_0x8f45('0x43')](function(_0x61f1e9){logger['error']('[index.js][initParams]',util[_0x8f45('0x44')](_0x61f1e9,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x8f45('0x1d')](function(){return initParams();})[_0x8f45('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8f45('0x43')](function(_0xad6219){logger['error'](_0x8f45('0x45'),util[_0x8f45('0x44')](_0xad6219,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 765bf4b..3cec01d 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 _0xb618=['redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone','mobile','online','voiceStatus','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','inuse','talking','voiceStatusTime','toNumber','format','stateTime','voiceStatusCallerIdNumber','interface','stringify','emit','user:save','user:presence','lodash','util','moment','md5','../../../config/environment'];(function(_0x2c22d2,_0x399ce1){var _0x42988c=function(_0xfa94f4){while(--_0xfa94f4){_0x2c22d2['push'](_0x2c22d2['shift']());}};_0x42988c(++_0x399ce1);}(_0xb618,0x15a));var _0x8b61=function(_0x28f814,_0x1c61e1){_0x28f814=_0x28f814-0x0;var _0x4b39b1=_0xb618[_0x28f814];return _0x4b39b1;};'use strict';var _=require(_0x8b61('0x0'));var util=require(_0x8b61('0x1'));var moment=require(_0x8b61('0x2'));var md5=require(_0x8b61('0x3'));var Redis=require('ioredis');var config=require(_0x8b61('0x4'));config[_0x8b61('0x5')]=_[_0x8b61('0x6')](config[_0x8b61('0x5')],{'host':_0x8b61('0x7'),'port':0x18eb});var io=require(_0x8b61('0x8'))(new Redis(config[_0x8b61('0x5')]));function Agent(_0x3655ae){this['id']=_0x3655ae['id']||0x0;this[_0x8b61('0x9')]=_0x3655ae[_0x8b61('0x9')]||'';this['email']=_0x3655ae[_0x8b61('0xa')]||'';this['accountcode']=_0x3655ae[_0x8b61('0xb')]||'';this[_0x8b61('0xc')]=_0x3655ae['fullname']||'';this[_0x8b61('0xd')]=_0x8b61('0xe');this['stateTime']=0x0;this[_0x8b61('0xf')]=_0x8b61('0xe');this[_0x8b61('0x10')]='';this[_0x8b61('0x11')]='';this[_0x8b61('0x12')]='';this['interface']='';this[_0x8b61('0x13')]=_0x3655ae['online']||![];this[_0x8b61('0x14')]=_0x8b61('0xe');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x8b61('0x15')]='';this[_0x8b61('0x16')]=![];this[_0x8b61('0x17')]=![];this['md5']='';}Agent[_0x8b61('0x18')][_0x8b61('0x19')]=function(_0x2ff5a1){var _0x5b1869;if(_0x2ff5a1&&_0x2ff5a1['state']){_0x5b1869=_0x2ff5a1[_0x8b61('0xd')]['toLowerCase']();switch(_0x5b1869){case _0x8b61('0x1a'):_0x5b1869='idle';break;case _0x8b61('0x1b'):_0x5b1869=_0x8b61('0x1c');break;}}if(_0x5b1869&&this['voiceStatus']!==_0x5b1869||_0x2ff5a1['statePause']){this[_0x8b61('0x1d')]=_[_0x8b61('0x1e')](moment()[_0x8b61('0x1f')]('x'));}if(_0x5b1869){this[_0x8b61('0x14')]=_0x5b1869;}var _0x32c7fe={'id':this['id'],'name':this[_0x8b61('0x9')],'email':this[_0x8b61('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x8b61('0xc')],'state':this[_0x8b61('0xd')],'stateTime':this[_0x8b61('0x20')],'status':this[_0x8b61('0xf')],'address':this[_0x8b61('0x10')],'online':this[_0x8b61('0x13')],'voiceStatus':this[_0x8b61('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x8b61('0x21')],'voiceStatusQueue':this[_0x8b61('0x15')],'interface':this[_0x8b61('0x22')],'onhold':this[_0x8b61('0x16')]};var _0xc7ba85=md5(JSON[_0x8b61('0x23')](_0x32c7fe));if(this[_0x8b61('0x3')]!==_0xc7ba85){this[_0x8b61('0x3')]=_0xc7ba85;io['to'](util[_0x8b61('0x1f')]('user:%s',_0x32c7fe['name']))[_0x8b61('0x24')](_0x8b61('0x25'),_0x32c7fe);io[_0x8b61('0x24')](_0x8b61('0x26'),_0x32c7fe);}};module['exports']=Agent; \ No newline at end of file +var _0xb0ee=['talking','statePause','toNumber','voiceStatusCallerIdNumber','voiceStatusQueue','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse'];(function(_0x515846,_0x3ebfad){var _0x38c2ea=function(_0x415d59){while(--_0x415d59){_0x515846['push'](_0x515846['shift']());}};_0x38c2ea(++_0x3ebfad);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xb0ee[_0x4ed520];return _0x4415a6;};'use strict';var _=require('lodash');var util=require(_0xeb0e('0x0'));var moment=require(_0xeb0e('0x1'));var md5=require(_0xeb0e('0x2'));var Redis=require(_0xeb0e('0x3'));var config=require(_0xeb0e('0x4'));config[_0xeb0e('0x5')]=_[_0xeb0e('0x6')](config[_0xeb0e('0x5')],{'host':_0xeb0e('0x7'),'port':0x18eb});var io=require(_0xeb0e('0x8'))(new Redis(config['redis']));function Agent(_0x1a95ad){this['id']=_0x1a95ad['id']||0x0;this[_0xeb0e('0x9')]=_0x1a95ad[_0xeb0e('0x9')]||'';this[_0xeb0e('0xa')]=_0x1a95ad['email']||'';this[_0xeb0e('0xb')]=_0x1a95ad[_0xeb0e('0xb')]||'';this[_0xeb0e('0xc')]=_0x1a95ad[_0xeb0e('0xc')]||'';this[_0xeb0e('0xd')]=_0xeb0e('0xe');this[_0xeb0e('0xf')]=0x0;this[_0xeb0e('0x10')]=_0xeb0e('0xe');this[_0xeb0e('0x11')]='';this[_0xeb0e('0x12')]='';this[_0xeb0e('0x13')]='';this[_0xeb0e('0x14')]='';this[_0xeb0e('0x15')]=_0x1a95ad[_0xeb0e('0x15')]||![];this[_0xeb0e('0x16')]=_0xeb0e('0xe');this[_0xeb0e('0x17')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0xeb0e('0x18')]=![];this['local']=![];this['md5']='';}Agent[_0xeb0e('0x19')][_0xeb0e('0x1a')]=function(_0x324125){var _0x235ac5;if(_0x324125&&_0x324125['state']){_0x235ac5=_0x324125[_0xeb0e('0xd')][_0xeb0e('0x1b')]();switch(_0x235ac5){case'not_inuse':_0x235ac5=_0xeb0e('0x1c');break;case _0xeb0e('0x1d'):_0x235ac5=_0xeb0e('0x1e');break;}}if(_0x235ac5&&this[_0xeb0e('0x16')]!==_0x235ac5||_0x324125[_0xeb0e('0x1f')]){this[_0xeb0e('0x17')]=_[_0xeb0e('0x20')](moment()['format']('x'));}if(_0x235ac5){this[_0xeb0e('0x16')]=_0x235ac5;}var _0x972b84={'id':this['id'],'name':this[_0xeb0e('0x9')],'email':this[_0xeb0e('0xa')],'accountcode':this[_0xeb0e('0xb')],'fullname':this[_0xeb0e('0xc')],'state':this[_0xeb0e('0xd')],'stateTime':this[_0xeb0e('0xf')],'status':this['status'],'address':this[_0xeb0e('0x11')],'online':this[_0xeb0e('0x15')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xeb0e('0x21')],'voiceStatusQueue':this[_0xeb0e('0x22')],'interface':this['interface'],'onhold':this[_0xeb0e('0x18')]};var _0x346fa8=md5(JSON['stringify'](_0x972b84));if(this[_0xeb0e('0x2')]!==_0x346fa8){this['md5']=_0x346fa8;io['to'](util['format']('user:%s',_0x972b84[_0xeb0e('0x9')]))['emit'](_0xeb0e('0x23'),_0x972b84);io[_0xeb0e('0x24')](_0xeb0e('0x25'),_0x972b84);}};module[_0xeb0e('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 0053bac..f56c8de 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 _0xeb44=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0xeb44,0x134));var _0x4eb4=function(_0x11be7d,_0x58724b){_0x11be7d=_0x11be7d-0x0;var _0x3384b0=_0xeb44[_0x11be7d];return _0x3384b0;};'use strict';function Campaign(_0x1d1f8f){this['id']=_0x1d1f8f['id']||0x0;this[_0x4eb4('0x0')]=_0x1d1f8f[_0x4eb4('0x0')]||'';this[_0x4eb4('0x1')]=_0x1d1f8f[_0x4eb4('0x1')]||_0x4eb4('0x2');this[_0x4eb4('0x3')]=0x0;this['temp']=0x0;this[_0x4eb4('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x4eb4('0x5')]='';this[_0x4eb4('0x6')]=!![];this[_0x4eb4('0x7')]=_0x1d1f8f[_0x4eb4('0x7')];this[_0x4eb4('0x8')]=_0x1d1f8f[_0x4eb4('0x8')];this[_0x4eb4('0x9')]=_0x1d1f8f[_0x4eb4('0x9')]||null;this[_0x4eb4('0xa')]=_0x1d1f8f[_0x4eb4('0xa')]?_0x1d1f8f[_0x4eb4('0xa')]:null;this[_0x4eb4('0xb')]=_0x1d1f8f[_0x4eb4('0xb')];this[_0x4eb4('0xc')]=_0x1d1f8f[_0x4eb4('0xc')];this[_0x4eb4('0xd')]=_0x1d1f8f[_0x4eb4('0xd')]||0x1e;this[_0x4eb4('0xe')]=_0x1d1f8f[_0x4eb4('0xe')];this[_0x4eb4('0xf')]=_0x1d1f8f['dialCongestionRetryFrequency'];this[_0x4eb4('0x10')]=_0x1d1f8f[_0x4eb4('0x10')];this[_0x4eb4('0x11')]=_0x1d1f8f[_0x4eb4('0x11')];this[_0x4eb4('0x12')]=_0x1d1f8f['dialNoAnswerMaxRetry'];this[_0x4eb4('0x13')]=_0x1d1f8f['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1d1f8f[_0x4eb4('0x14')];this[_0x4eb4('0x15')]=_0x1d1f8f['dialNoSuchNumberMaxRetry']||0x3;this[_0x4eb4('0x16')]=_0x1d1f8f[_0x4eb4('0x16')]||0x96;this['dialDropMaxRetry']=_0x1d1f8f['dialDropMaxRetry']||0x3;this[_0x4eb4('0x17')]=_0x1d1f8f[_0x4eb4('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x1d1f8f[_0x4eb4('0x18')]||0x3;this[_0x4eb4('0x19')]=_0x1d1f8f[_0x4eb4('0x19')]||0x96;this[_0x4eb4('0x1a')]=_0x1d1f8f[_0x4eb4('0x1a')]||0x3;this[_0x4eb4('0x1b')]=_0x1d1f8f['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1d1f8f[_0x4eb4('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1d1f8f[_0x4eb4('0x1d')]||0x96;this[_0x4eb4('0x1e')]=_0x1d1f8f[_0x4eb4('0x1e')]||'DESC';this[_0x4eb4('0x1f')]=_0x1d1f8f[_0x4eb4('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1d1f8f[_0x4eb4('0x20')]||undefined;this['dialCutDigit']=_0x1d1f8f['dialCutDigit']||undefined;this[_0x4eb4('0x21')]=_0x1d1f8f['TrunkBackup']?_0x1d1f8f[_0x4eb4('0x21')]:undefined;this[_0x4eb4('0x22')]=_0x1d1f8f[_0x4eb4('0x22')]?_0x1d1f8f[_0x4eb4('0x22')]:undefined;this[_0x4eb4('0x23')]=_0x1d1f8f[_0x4eb4('0x23')]?_0x1d1f8f[_0x4eb4('0x23')]:undefined;this[_0x4eb4('0x24')]=_0x1d1f8f[_0x4eb4('0x24')]?_0x1d1f8f['SquareProject']:undefined;this[_0x4eb4('0x25')]=_0x1d1f8f[_0x4eb4('0x24')]?_0x1d1f8f['SquareProject'][_0x4eb4('0x0')]:undefined;this[_0x4eb4('0x26')]=_0x1d1f8f[_0x4eb4('0x26')]||![];this[_0x4eb4('0x27')]=_0x1d1f8f[_0x4eb4('0x27')];this[_0x4eb4('0x28')]=_0x1d1f8f[_0x4eb4('0x28')];this[_0x4eb4('0x29')]=_0x1d1f8f['dialAMDAfterGreetingSilence'];this[_0x4eb4('0x2a')]=_0x1d1f8f[_0x4eb4('0x2a')];this['dialAMDMinWordLength']=_0x1d1f8f[_0x4eb4('0x2b')];this[_0x4eb4('0x2c')]=_0x1d1f8f[_0x4eb4('0x2c')];this[_0x4eb4('0x2d')]=_0x1d1f8f[_0x4eb4('0x2d')];this[_0x4eb4('0x2e')]=_0x1d1f8f[_0x4eb4('0x2e')];this[_0x4eb4('0x2f')]=_0x1d1f8f['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x4c2b=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls'];(function(_0xa3dffc,_0x29cb5b){var _0x113e6e=function(_0x389c3c){while(--_0x389c3c){_0xa3dffc['push'](_0xa3dffc['shift']());}};_0x113e6e(++_0x29cb5b);}(_0x4c2b,0xe7));var _0xb4c2=function(_0x2bfe4a,_0x56489a){_0x2bfe4a=_0x2bfe4a-0x0;var _0x4ce1ed=_0x4c2b[_0x2bfe4a];return _0x4ce1ed;};'use strict';function Campaign(_0x201c4c){this['id']=_0x201c4c['id']||0x0;this[_0xb4c2('0x0')]=_0x201c4c[_0xb4c2('0x0')]||'';this[_0xb4c2('0x1')]=_0x201c4c[_0xb4c2('0x1')]||'campaign';this[_0xb4c2('0x2')]=0x0;this['temp']=0x0;this[_0xb4c2('0x3')]=0x0;this[_0xb4c2('0x4')]=0x0;this[_0xb4c2('0x5')]='';this[_0xb4c2('0x6')]=!![];this[_0xb4c2('0x7')]=_0x201c4c[_0xb4c2('0x7')];this[_0xb4c2('0x8')]=_0x201c4c[_0xb4c2('0x8')];this[_0xb4c2('0x9')]=_0x201c4c[_0xb4c2('0x9')]||null;this[_0xb4c2('0xa')]=_0x201c4c[_0xb4c2('0xa')]?_0x201c4c[_0xb4c2('0xa')]:null;this[_0xb4c2('0xb')]=_0x201c4c[_0xb4c2('0xb')];this[_0xb4c2('0xc')]=_0x201c4c[_0xb4c2('0xc')];this[_0xb4c2('0xd')]=_0x201c4c[_0xb4c2('0xd')]||0x1e;this[_0xb4c2('0xe')]=_0x201c4c[_0xb4c2('0xe')];this['dialCongestionRetryFrequency']=_0x201c4c['dialCongestionRetryFrequency'];this[_0xb4c2('0xf')]=_0x201c4c[_0xb4c2('0xf')];this[_0xb4c2('0x10')]=_0x201c4c[_0xb4c2('0x10')];this[_0xb4c2('0x11')]=_0x201c4c[_0xb4c2('0x11')];this[_0xb4c2('0x12')]=_0x201c4c[_0xb4c2('0x12')];this['dialGlobalMaxRetry']=_0x201c4c['dialGlobalMaxRetry'];this[_0xb4c2('0x13')]=_0x201c4c['dialNoSuchNumberMaxRetry']||0x3;this[_0xb4c2('0x14')]=_0x201c4c[_0xb4c2('0x14')]||0x96;this[_0xb4c2('0x15')]=_0x201c4c[_0xb4c2('0x15')]||0x3;this[_0xb4c2('0x16')]=_0x201c4c[_0xb4c2('0x16')]||0x96;this[_0xb4c2('0x17')]=_0x201c4c[_0xb4c2('0x17')]||0x3;this[_0xb4c2('0x18')]=_0x201c4c[_0xb4c2('0x18')]||0x96;this[_0xb4c2('0x19')]=_0x201c4c[_0xb4c2('0x19')]||0x3;this[_0xb4c2('0x1a')]=_0x201c4c[_0xb4c2('0x1a')]||0x96;this[_0xb4c2('0x1b')]=_0x201c4c[_0xb4c2('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x201c4c[_0xb4c2('0x1c')]||0x96;this[_0xb4c2('0x1d')]=_0x201c4c['dialOrderByScheduledAt']||_0xb4c2('0x1e');this[_0xb4c2('0x1f')]=_0x201c4c[_0xb4c2('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x201c4c[_0xb4c2('0x20')]||undefined;this[_0xb4c2('0x21')]=_0x201c4c[_0xb4c2('0x21')]||undefined;this[_0xb4c2('0x22')]=_0x201c4c[_0xb4c2('0x22')]?_0x201c4c[_0xb4c2('0x22')]:undefined;this['Trunk']=_0x201c4c[_0xb4c2('0x23')]?_0x201c4c[_0xb4c2('0x23')]:undefined;this[_0xb4c2('0x24')]=_0x201c4c[_0xb4c2('0x24')]?_0x201c4c['Interval']:undefined;this['SquareProject']=_0x201c4c['SquareProject']?_0x201c4c[_0xb4c2('0x25')]:undefined;this[_0xb4c2('0x26')]=_0x201c4c[_0xb4c2('0x25')]?_0x201c4c[_0xb4c2('0x25')][_0xb4c2('0x0')]:undefined;this[_0xb4c2('0x27')]=_0x201c4c[_0xb4c2('0x27')]||![];this[_0xb4c2('0x28')]=_0x201c4c[_0xb4c2('0x28')];this[_0xb4c2('0x29')]=_0x201c4c['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x201c4c['dialAMDAfterGreetingSilence'];this[_0xb4c2('0x2a')]=_0x201c4c['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x201c4c[_0xb4c2('0x2b')];this[_0xb4c2('0x2c')]=_0x201c4c[_0xb4c2('0x2c')];this[_0xb4c2('0x2d')]=_0x201c4c[_0xb4c2('0x2d')];this['dialAMDSilenceThreshold']=_0x201c4c[_0xb4c2('0x2e')];this['dialAMDMaximumWordLength']=_0x201c4c[_0xb4c2('0x2f')];}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 05002dc..2dff9ec 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 _0x1af1=['tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime','abandoned','lastdata','billableseconds','holdtime','type'];(function(_0xb4d24a,_0x57953e){var _0x1e65b5=function(_0x5a47f9){while(--_0x5a47f9){_0xb4d24a['push'](_0xb4d24a['shift']());}};_0x1e65b5(++_0x57953e);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0x11af('0x0')]=null;this[_0x11af('0x1')]='';this[_0x11af('0x2')]='';this[_0x11af('0x3')]=0x0;this[_0x11af('0x4')]='';this[_0x11af('0x5')]=undefined;this[_0x11af('0x6')]=undefined;this[_0x11af('0x7')]=0x0;this[_0x11af('0x8')]='';this[_0x11af('0x9')]=0x0;this['linkedid']=0x0;this[_0x11af('0xa')]=0x0;this['answered']=![];this[_0x11af('0xb')]=null;this['endtime']=null;this['unmanaged']=![];this[_0x11af('0xc')]=![];this['lastapplication']='';this[_0x11af('0xd')]='';this['duration']=0x0;this[_0x11af('0xe')]=0x0;this[_0x11af('0xf')]=0x0;this[_0x11af('0x10')]=null;this[_0x11af('0x11')]=null;this['disposition']=null;this[_0x11af('0x12')]=![];this[_0x11af('0x13')]=null;this[_0x11af('0x14')]=null;this[_0x11af('0x15')]=[];this[_0x11af('0x16')]=undefined;this[_0x11af('0x17')]=undefined;this[_0x11af('0x18')]=undefined;this[_0x11af('0x19')]=0x0;}module[_0x11af('0x1a')]=Channel; \ No newline at end of file +var _0x130d=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x1ddefc,_0xa2b97f){var _0x3cc12d=function(_0x2fd42d){while(--_0x2fd42d){_0x1ddefc['push'](_0x1ddefc['shift']());}};_0x3cc12d(++_0xa2b97f);}(_0x130d,0x19d));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0xd130('0x0')]=null;this[_0xd130('0x1')]='';this[_0xd130('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xd130('0x3')]=undefined;this[_0xd130('0x4')]=undefined;this[_0xd130('0x5')]=0x0;this[_0xd130('0x6')]='';this[_0xd130('0x7')]=0x0;this[_0xd130('0x8')]=0x0;this[_0xd130('0x9')]=0x0;this[_0xd130('0xa')]=![];this['answertime']=null;this[_0xd130('0xb')]=null;this[_0xd130('0xc')]=![];this['abandoned']=![];this[_0xd130('0xd')]='';this['lastdata']='';this[_0xd130('0xe')]=0x0;this[_0xd130('0xf')]=0x0;this[_0xd130('0x10')]=0x0;this['type']=null;this[_0xd130('0x11')]=null;this['disposition']=null;this[_0xd130('0x12')]=![];this[_0xd130('0x13')]=null;this[_0xd130('0x14')]=null;this['monitors']=[];this[_0xd130('0x15')]=undefined;this[_0xd130('0x16')]=undefined;this[_0xd130('0x17')]=undefined;this[_0xd130('0x18')]=0x0;}module[_0xd130('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5074451..597d9b3 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 _0x132d=['tokenSecret','type','serverUrl','name','username','remoteUri','authType','password','consumerSecret','token'];(function(_0xcca4,_0x2b6351){var _0x432a4a=function(_0x2388bf){while(--_0x2388bf){_0xcca4['push'](_0xcca4['shift']());}};_0x432a4a(++_0x2b6351);}(_0x132d,0x107));var _0xd132=function(_0x2bed2f,_0x6f4d5f){_0x2bed2f=_0x2bed2f-0x0;var _0x2c70be=_0x132d[_0x2bed2f];return _0x2c70be;};'use strict';function DeskAccount(_0x187a9a){this['id']=_0x187a9a['id']||0x0;this[_0xd132('0x0')]=_0x187a9a[_0xd132('0x0')]||'';this[_0xd132('0x1')]=_0x187a9a[_0xd132('0x1')]||'';this[_0xd132('0x2')]=_0x187a9a[_0xd132('0x2')]||'';this[_0xd132('0x3')]=_0x187a9a['authType']||'';this['password']=_0x187a9a[_0xd132('0x4')]||'';this['consumerKey']=_0x187a9a['consumerKey']||'';this[_0xd132('0x5')]=_0x187a9a[_0xd132('0x5')]||'';this[_0xd132('0x6')]=_0x187a9a[_0xd132('0x6')]||'';this[_0xd132('0x7')]=_0x187a9a['tokenSecret']||'';this[_0xd132('0x8')]=_0x187a9a[_0xd132('0x8')]||'';this[_0xd132('0x9')]=_0x187a9a[_0xd132('0x9')]||'';this['Configurations']=_0x187a9a['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x7f3e=['serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x1688bc,_0x43de16){var _0x546480=function(_0x3a747c){while(--_0x3a747c){_0x1688bc['push'](_0x1688bc['shift']());}};_0x546480(++_0x43de16);}(_0x7f3e,0x1e2));var _0xe7f3=function(_0x1c50f7,_0x291af7){_0x1c50f7=_0x1c50f7-0x0;var _0x2d4878=_0x7f3e[_0x1c50f7];return _0x2d4878;};'use strict';function DeskAccount(_0x4c5fe1){this['id']=_0x4c5fe1['id']||0x0;this[_0xe7f3('0x0')]=_0x4c5fe1[_0xe7f3('0x0')]||'';this['username']=_0x4c5fe1[_0xe7f3('0x1')]||'';this[_0xe7f3('0x2')]=_0x4c5fe1[_0xe7f3('0x2')]||'';this[_0xe7f3('0x3')]=_0x4c5fe1['authType']||'';this[_0xe7f3('0x4')]=_0x4c5fe1[_0xe7f3('0x4')]||'';this[_0xe7f3('0x5')]=_0x4c5fe1[_0xe7f3('0x5')]||'';this[_0xe7f3('0x6')]=_0x4c5fe1[_0xe7f3('0x6')]||'';this['token']=_0x4c5fe1[_0xe7f3('0x7')]||'';this[_0xe7f3('0x8')]=_0x4c5fe1[_0xe7f3('0x8')]||'';this[_0xe7f3('0x9')]=_0x4c5fe1['type']||'';this[_0xe7f3('0xa')]=_0x4c5fe1[_0xe7f3('0xa')]||'';this[_0xe7f3('0xb')]=_0x4c5fe1[_0xe7f3('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 4bffe79..498b102 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 _0x467a=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x467a,0x13c));var _0xa467=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x467a[_0x2dafbe];return _0x58a45a;};'use strict';function Dynamics365Account(_0x1cdd36){this['id']=_0x1cdd36['id']||0x0;this[_0xa467('0x0')]=_0x1cdd36[_0xa467('0x0')]||'';this['username']=_0x1cdd36[_0xa467('0x1')]||'';this[_0xa467('0x2')]=_0x1cdd36['password']||'';this['remoteUri']=_0x1cdd36[_0xa467('0x3')]||'';this[_0xa467('0x4')]=_0x1cdd36[_0xa467('0x4')]||'';this[_0xa467('0x5')]=_0x1cdd36[_0xa467('0x5')]||'';this[_0xa467('0x6')]=_0x1cdd36[_0xa467('0x6')]||{};this[_0xa467('0x7')]=_0x1cdd36[_0xa467('0x7')]||'';this[_0xa467('0x8')]=_0x1cdd36['modernAuthentication']||![];this[_0xa467('0x9')]=_0x1cdd36['Configurations']||{};this[_0xa467('0xa')]=_0x1cdd36[_0xa467('0xa')]||{};}module[_0xa467('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x16a8=['name','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x40899c,_0x506ae7){var _0x1198d2=function(_0x47c9bf){while(--_0x47c9bf){_0x40899c['push'](_0x40899c['shift']());}};_0x1198d2(++_0x506ae7);}(_0x16a8,0xfd));var _0x816a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x16a8[_0x3b380d];return _0x54502b;};'use strict';function Dynamics365Account(_0xc10a0f){this['id']=_0xc10a0f['id']||0x0;this[_0x816a('0x0')]=_0xc10a0f['name']||'';this[_0x816a('0x1')]=_0xc10a0f[_0x816a('0x1')]||'';this[_0x816a('0x2')]=_0xc10a0f[_0x816a('0x2')]||'';this['remoteUri']=_0xc10a0f[_0x816a('0x3')]||'';this['tenantId']=_0xc10a0f[_0x816a('0x4')]||'';this[_0x816a('0x5')]=_0xc10a0f[_0x816a('0x5')]||'';this[_0x816a('0x6')]=_0xc10a0f[_0x816a('0x6')]||{};this['serverUrl']=_0xc10a0f['serverUrl']||'';this[_0x816a('0x7')]=_0xc10a0f[_0x816a('0x7')]||![];this[_0x816a('0x8')]=_0xc10a0f[_0x816a('0x8')]||{};this[_0x816a('0x9')]=_0xc10a0f[_0x816a('0x9')]||{};}module[_0x816a('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 3716518..44358b4 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 _0x4633=['faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x9e2651,_0x13adf6){var _0x41d7b6=function(_0x236dd7){while(--_0x236dd7){_0x9e2651['push'](_0x9e2651['shift']());}};_0x41d7b6(++_0x13adf6);}(_0x4633,0xa7));var _0x3463=function(_0x312978,_0x5cc3e9){_0x312978=_0x312978-0x0;var _0x3c53af=_0x4633[_0x312978];return _0x3c53af;};'use strict';function FaxAccount(_0x4ad9ad){this['id']=_0x4ad9ad['id']||0x0;this['name']=_0x4ad9ad[_0x3463('0x0')]||'';this['description']=_0x4ad9ad['description'];this['ecm']=_0x4ad9ad[_0x3463('0x1')];this['headerinfo']=_0x4ad9ad[_0x3463('0x2')];this[_0x3463('0x3')]=_0x4ad9ad['localstationid'];this['minrate']=_0x4ad9ad[_0x3463('0x4')]||0x960;this[_0x3463('0x5')]=_0x4ad9ad['maxrate']||0x3840;this[_0x3463('0x6')]=_0x4ad9ad[_0x3463('0x6')]||_0x3463('0x7');this['gateway']=_0x4ad9ad[_0x3463('0x8')]||'no';this[_0x3463('0x9')]=_0x4ad9ad[_0x3463('0x9')]||'no';this[_0x3463('0xa')]=_0x4ad9ad[_0x3463('0xa')]||0x1388;this['tech']=_0x4ad9ad['tech']||_0x3463('0xb');this[_0x3463('0xc')]=_0x4ad9ad[_0x3463('0xc')]?_0x4ad9ad[_0x3463('0xc')]:undefined;this[_0x3463('0xd')]=_0x4ad9ad['ListId'];this['key']=_0x4ad9ad[_0x3463('0xe')];}module[_0x3463('0xf')]=FaxAccount; \ No newline at end of file +var _0x4a15=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0x4f5c0e,_0x27d3cd){var _0x24c9e0=function(_0x37a81a){while(--_0x37a81a){_0x4f5c0e['push'](_0x4f5c0e['shift']());}};_0x24c9e0(++_0x27d3cd);}(_0x4a15,0x7e));var _0x54a1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4a15[_0x618414];return _0x21c19a;};'use strict';function FaxAccount(_0x2e4a96){this['id']=_0x2e4a96['id']||0x0;this[_0x54a1('0x0')]=_0x2e4a96[_0x54a1('0x0')]||'';this[_0x54a1('0x1')]=_0x2e4a96['description'];this[_0x54a1('0x2')]=_0x2e4a96[_0x54a1('0x2')];this[_0x54a1('0x3')]=_0x2e4a96[_0x54a1('0x3')];this[_0x54a1('0x4')]=_0x2e4a96['localstationid'];this[_0x54a1('0x5')]=_0x2e4a96[_0x54a1('0x5')]||0x960;this[_0x54a1('0x6')]=_0x2e4a96[_0x54a1('0x6')]||0x3840;this[_0x54a1('0x7')]=_0x2e4a96[_0x54a1('0x7')]||'v17,v27,v29';this[_0x54a1('0x8')]=_0x2e4a96['gateway']||'no';this[_0x54a1('0x9')]=_0x2e4a96['faxdetect']||'no';this[_0x54a1('0xa')]=_0x2e4a96['t38timeout']||0x1388;this[_0x54a1('0xb')]=_0x2e4a96[_0x54a1('0xb')]||_0x54a1('0xc');this['Trunk']=_0x2e4a96[_0x54a1('0xd')]?_0x2e4a96[_0x54a1('0xd')]:undefined;this['ListId']=_0x2e4a96[_0x54a1('0xe')];this[_0x54a1('0xf')]=_0x2e4a96['key'];}module[_0x54a1('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ebfa4ba..e5867dd 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 _0xf676=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x38a6c6,_0x4062ca){var _0x142f0a=function(_0x1531ce){while(--_0x1531ce){_0x38a6c6['push'](_0x38a6c6['shift']());}};_0x142f0a(++_0x4062ca);}(_0xf676,0x193));var _0x6f67=function(_0x33048a,_0x19e683){_0x33048a=_0x33048a-0x0;var _0x459b03=_0xf676[_0x33048a];return _0x459b03;};'use strict';function FreshdeskAccount(_0x30d8e4){this['id']=_0x30d8e4['id']||0x0;this[_0x6f67('0x0')]=_0x30d8e4['name']||'';this[_0x6f67('0x1')]=_0x30d8e4[_0x6f67('0x1')]||'';this[_0x6f67('0x2')]=_0x30d8e4[_0x6f67('0x3')]||'';this[_0x6f67('0x4')]=_0x30d8e4[_0x6f67('0x4')]||'';this[_0x6f67('0x5')]=_0x30d8e4[_0x6f67('0x5')]||'';this[_0x6f67('0x6')]=_0x30d8e4[_0x6f67('0x6')]||{};}module[_0x6f67('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xbf69=['exports','name','username','apiKey','token','serverUrl','Configurations'];(function(_0x2fce71,_0x1b697e){var _0x3e764e=function(_0xf37504){while(--_0xf37504){_0x2fce71['push'](_0x2fce71['shift']());}};_0x3e764e(++_0x1b697e);}(_0xbf69,0x190));var _0x9bf6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xbf69[_0x2aea9e];return _0x430b92;};'use strict';function FreshdeskAccount(_0x509fbe){this['id']=_0x509fbe['id']||0x0;this[_0x9bf6('0x0')]=_0x509fbe[_0x9bf6('0x0')]||'';this[_0x9bf6('0x1')]=_0x509fbe['username']||'';this[_0x9bf6('0x2')]=_0x509fbe[_0x9bf6('0x3')]||'';this['remoteUri']=_0x509fbe['remoteUri']||'';this[_0x9bf6('0x4')]=_0x509fbe[_0x9bf6('0x4')]||'';this[_0x9bf6('0x5')]=_0x509fbe[_0x9bf6('0x5')]||{};}module[_0x9bf6('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9b1f3f8..e4ef11b 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdded=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x11d47e,_0x797086){var _0x148d43=function(_0x203ee5){while(--_0x203ee5){_0x11d47e['push'](_0x11d47e['shift']());}};_0x148d43(++_0x797086);}(_0xdded,0x17a));var _0xddde=function(_0xed6ddf,_0x5dd72d){_0xed6ddf=_0xed6ddf-0x0;var _0x2cba1c=_0xdded[_0xed6ddf];return _0x2cba1c;};'use strict';function FreshsalesAccount(_0x2b234e){this['id']=_0x2b234e['id']||0x0;this[_0xddde('0x0')]=_0x2b234e[_0xddde('0x0')]||'';this[_0xddde('0x1')]=_0x2b234e[_0xddde('0x1')]||'';this[_0xddde('0x2')]=_0x2b234e['token']||'';this[_0xddde('0x3')]=_0x2b234e[_0xddde('0x3')]||'';this[_0xddde('0x4')]=_0x2b234e[_0xddde('0x4')]||'';this[_0xddde('0x5')]=_0x2b234e[_0xddde('0x5')]||{};}module[_0xddde('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x4fe0=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x29f0a9,_0xe416a2){var _0x1918eb=function(_0x52445c){while(--_0x52445c){_0x29f0a9['push'](_0x29f0a9['shift']());}};_0x1918eb(++_0xe416a2);}(_0x4fe0,0x195));var _0x04fe=function(_0x3e9c37,_0x3a8a4d){_0x3e9c37=_0x3e9c37-0x0;var _0x2ee6d8=_0x4fe0[_0x3e9c37];return _0x2ee6d8;};'use strict';function FreshsalesAccount(_0x1de6df){this['id']=_0x1de6df['id']||0x0;this[_0x04fe('0x0')]=_0x1de6df[_0x04fe('0x0')]||'';this[_0x04fe('0x1')]=_0x1de6df[_0x04fe('0x1')]||'';this[_0x04fe('0x2')]=_0x1de6df[_0x04fe('0x3')]||'';this['remoteUri']=_0x1de6df[_0x04fe('0x4')]||'';this['serverUrl']=_0x1de6df[_0x04fe('0x5')]||'';this[_0x04fe('0x6')]=_0x1de6df[_0x04fe('0x6')]||{};}module[_0x04fe('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index b72d89f..46a8036 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 _0x0740=['inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','assigned','routealias','type'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x0740,0x1a3));var _0x0074=function(_0x5734fb,_0x2f2e4e){_0x5734fb=_0x5734fb-0x0;var _0x40d296=_0x0740[_0x5734fb];return _0x40d296;};'use strict';function QueueReport(){this[_0x0074('0x0')]=_0x0074('0x1');this[_0x0074('0x2')]='';this[_0x0074('0x3')]='';this['calleridname']='';this['queue']='';this[_0x0074('0x4')]=null;this[_0x0074('0x5')]=null;this['position']=0x1;this[_0x0074('0x6')]=0x1;this[_0x0074('0x7')]=![];this[_0x0074('0x8')]=null;this['queuecallercomplete']=![];this[_0x0074('0x9')]=null;this[_0x0074('0xa')]=![];this[_0x0074('0xb')]=null;this[_0x0074('0xc')]=0x1;this[_0x0074('0xd')]='';this[_0x0074('0xe')]='';this[_0x0074('0xf')]='';this[_0x0074('0x10')]='';this[_0x0074('0x11')]='';this[_0x0074('0x12')]='';this['priority']='';this['holdtime']=0x0;this[_0x0074('0x13')]=![];this['lastAssignedTo']='';this['motionChannel']='voice';this[_0x0074('0x14')]=null;this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0xf289=['motionChannel','voice','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','priority','assigned','lastAssignedTo'];(function(_0x313c92,_0x5d9943){var _0x8ddf39=function(_0x5c8fe7){while(--_0x5c8fe7){_0x313c92['push'](_0x313c92['shift']());}};_0x8ddf39(++_0x5d9943);}(_0xf289,0x18e));var _0x9f28=function(_0x10451f,_0x5e94d6){_0x10451f=_0x10451f-0x0;var _0x3028a8=_0xf289[_0x10451f];return _0x3028a8;};'use strict';function QueueReport(){this['type']=_0x9f28('0x0');this[_0x9f28('0x1')]='';this[_0x9f28('0x2')]='';this[_0x9f28('0x3')]='';this[_0x9f28('0x4')]='';this[_0x9f28('0x5')]=null;this[_0x9f28('0x6')]=null;this['position']=0x1;this[_0x9f28('0x7')]=0x1;this[_0x9f28('0x8')]=![];this[_0x9f28('0x9')]=null;this[_0x9f28('0xa')]=![];this[_0x9f28('0xb')]=null;this[_0x9f28('0xc')]=![];this[_0x9f28('0xd')]=null;this[_0x9f28('0xe')]=0x1;this['channel']='';this[_0x9f28('0xf')]='';this[_0x9f28('0x10')]='';this[_0x9f28('0x11')]='';this[_0x9f28('0x12')]='';this['exten']='';this[_0x9f28('0x13')]='';this['holdtime']=0x0;this[_0x9f28('0x14')]=![];this[_0x9f28('0x15')]='';this[_0x9f28('0x16')]=_0x9f28('0x17');this[_0x9f28('0x18')]=null;this[_0x9f28('0x19')]=0x0;this[_0x9f28('0x1a')]={};}module[_0x9f28('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 76f0ed2..91a10f3 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 _0x46cb=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','Configurations','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x46cb,0x84));var _0xb46c=function(_0x570e73,_0x538538){_0x570e73=_0x570e73-0x0;var _0x13134b=_0x46cb[_0x570e73];return _0x13134b;};'use strict';function SalesforceAccount(_0xeb1592){this['id']=_0xeb1592['id']||0x0;this[_0xb46c('0x0')]=_0xeb1592[_0xb46c('0x0')]||'';this[_0xb46c('0x1')]=_0xeb1592['username']||'';this[_0xb46c('0x2')]=_0xeb1592[_0xb46c('0x2')]||'';this[_0xb46c('0x3')]=_0xeb1592[_0xb46c('0x3')]||'';this['clientId']=_0xeb1592[_0xb46c('0x4')]||'';this[_0xb46c('0x5')]=_0xeb1592[_0xb46c('0x5')]||'';this['securityToken']=_0xeb1592[_0xb46c('0x6')]||'';this['type']=_0xeb1592[_0xb46c('0x7')]||_0xb46c('0x8');this['serverUrl']=_0xeb1592['serverUrl']||'';this[_0xb46c('0x9')]=_0xeb1592[_0xb46c('0x9')]||{};}module[_0xb46c('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x8e5f=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','password','clientId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e5f,0xd8));var _0xf8e5=function(_0x26ebfc,_0x4a7f59){_0x26ebfc=_0x26ebfc-0x0;var _0x3d450b=_0x8e5f[_0x26ebfc];return _0x3d450b;};'use strict';function SalesforceAccount(_0x140263){this['id']=_0x140263['id']||0x0;this[_0xf8e5('0x0')]=_0x140263[_0xf8e5('0x0')]||'';this[_0xf8e5('0x1')]=_0x140263[_0xf8e5('0x1')]||'';this['remoteUri']=_0x140263['remoteUri']||'';this[_0xf8e5('0x2')]=_0x140263['password']||'';this[_0xf8e5('0x3')]=_0x140263['clientId']||'';this[_0xf8e5('0x4')]=_0x140263[_0xf8e5('0x4')]||'';this[_0xf8e5('0x5')]=_0x140263[_0xf8e5('0x5')]||'';this['type']=_0x140263[_0xf8e5('0x6')]||_0xf8e5('0x7');this[_0xf8e5('0x8')]=_0x140263['serverUrl']||'';this[_0xf8e5('0x9')]=_0x140263[_0xf8e5('0x9')]||{};}module[_0xf8e5('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 25768ad..32df87b 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 _0x9b46=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x40c7f7,_0x42bc78){var _0x479755=function(_0x502b1e){while(--_0x502b1e){_0x40c7f7['push'](_0x40c7f7['shift']());}};_0x479755(++_0x42bc78);}(_0x9b46,0xba));var _0x69b4=function(_0x1c1f3e,_0x665593){_0x1c1f3e=_0x1c1f3e-0x0;var _0x325903=_0x9b46[_0x1c1f3e];return _0x325903;};'use strict';function ServicenowAccount(_0x498103){this['id']=_0x498103['id']||0x0;this['name']=_0x498103[_0x69b4('0x0')]||'';this[_0x69b4('0x1')]=_0x498103[_0x69b4('0x1')]||'';this[_0x69b4('0x2')]=_0x498103[_0x69b4('0x2')]||'';this[_0x69b4('0x3')]=_0x498103[_0x69b4('0x3')]||'';this['serverUrl']=_0x498103[_0x69b4('0x4')]||'';this[_0x69b4('0x5')]=_0x498103['Configurations']||{};}module[_0x69b4('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xac65=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xac65,0x1e9));var _0x5ac6=function(_0x3a2ede,_0x38ff82){_0x3a2ede=_0x3a2ede-0x0;var _0x415094=_0xac65[_0x3a2ede];return _0x415094;};'use strict';function ServicenowAccount(_0x415f94){this['id']=_0x415f94['id']||0x0;this[_0x5ac6('0x0')]=_0x415f94[_0x5ac6('0x0')]||'';this[_0x5ac6('0x1')]=_0x415f94[_0x5ac6('0x1')]||'';this['password']=_0x415f94['password']||'';this[_0x5ac6('0x2')]=_0x415f94[_0x5ac6('0x2')]||'';this[_0x5ac6('0x3')]=_0x415f94[_0x5ac6('0x3')]||'';this['Configurations']=_0x415f94[_0x5ac6('0x4')]||{};}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 b7e6a77..88fc631 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 _0xd492=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xafa601,_0x115bf1){var _0x45cadd=function(_0x1e71be){while(--_0x1e71be){_0xafa601['push'](_0xafa601['shift']());}};_0x45cadd(++_0x115bf1);}(_0xd492,0x152));var _0x2d49=function(_0x527a91,_0x10a151){_0x527a91=_0x527a91-0x0;var _0x3a7486=_0xd492[_0x527a91];return _0x3a7486;};'use strict';function SugarcrmAccount(_0x528f4e){this['id']=_0x528f4e['id']||0x0;this[_0x2d49('0x0')]=_0x528f4e[_0x2d49('0x0')]||'';this[_0x2d49('0x1')]=_0x528f4e[_0x2d49('0x1')]||'';this[_0x2d49('0x2')]=_0x528f4e['password']||'';this[_0x2d49('0x3')]=_0x528f4e[_0x2d49('0x3')]||'';this['serverUrl']=_0x528f4e[_0x2d49('0x4')]||'';this[_0x2d49('0x5')]=_0x528f4e['Configurations']||{};}module[_0x2d49('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x5292=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0x149));var _0x2529=function(_0x5bf019,_0x375a83){_0x5bf019=_0x5bf019-0x0;var _0x42497e=_0x5292[_0x5bf019];return _0x42497e;};'use strict';function SugarcrmAccount(_0x5aed51){this['id']=_0x5aed51['id']||0x0;this[_0x2529('0x0')]=_0x5aed51[_0x2529('0x0')]||'';this['username']=_0x5aed51[_0x2529('0x1')]||'';this[_0x2529('0x2')]=_0x5aed51[_0x2529('0x2')]||'';this[_0x2529('0x3')]=_0x5aed51[_0x2529('0x3')]||'';this[_0x2529('0x4')]=_0x5aed51['serverUrl']||'';this['Configurations']=_0x5aed51[_0x2529('0x5')]||{};}module[_0x2529('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 7a6bdb2..532558c 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 _0xb612=['stateTime','status','exports','name','accountcode','state','unknown'];(function(_0xa7a177,_0x30a749){var _0x58338f=function(_0x5a3854){while(--_0x5a3854){_0xa7a177['push'](_0xa7a177['shift']());}};_0x58338f(++_0x30a749);}(_0xb612,0x1a7));var _0x2b61=function(_0x279732,_0x2c13af){_0x279732=_0x279732-0x0;var _0x576ce2=_0xb612[_0x279732];return _0x576ce2;};'use strict';function Telephone(_0x399d73){this['id']=_0x399d73['id']||0x0;this[_0x2b61('0x0')]=_0x399d73[_0x2b61('0x0')]||'';this[_0x2b61('0x1')]=_0x399d73[_0x2b61('0x1')]||'';this[_0x2b61('0x2')]=_0x2b61('0x3');this[_0x2b61('0x4')]=0x0;this[_0x2b61('0x5')]=_0x2b61('0x3');this['address']='';}module[_0x2b61('0x6')]=Telephone; \ No newline at end of file +var _0xe605=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x27b17c,_0x4dea39){var _0x3237bc=function(_0x484b0a){while(--_0x484b0a){_0x27b17c['push'](_0x27b17c['shift']());}};_0x3237bc(++_0x4dea39);}(_0xe605,0x92));var _0x5e60=function(_0x5855be,_0x370316){_0x5855be=_0x5855be-0x0;var _0x21d0ea=_0xe605[_0x5855be];return _0x21d0ea;};'use strict';function Telephone(_0x4cf32c){this['id']=_0x4cf32c['id']||0x0;this[_0x5e60('0x0')]=_0x4cf32c['name']||'';this[_0x5e60('0x1')]=_0x4cf32c[_0x5e60('0x1')]||'';this[_0x5e60('0x2')]=_0x5e60('0x3');this[_0x5e60('0x4')]=0x0;this[_0x5e60('0x5')]=_0x5e60('0x3');this[_0x5e60('0x6')]='';}module[_0x5e60('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ab820b6..7703979 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 _0xb10b=['name','html'];(function(_0x4bf0ba,_0x26dcac){var _0x157d6b=function(_0x2b580b){while(--_0x2b580b){_0x4bf0ba['push'](_0x4bf0ba['shift']());}};_0x157d6b(++_0x26dcac);}(_0xb10b,0x12a));var _0xbb10=function(_0x23118b,_0x562da3){_0x23118b=_0x23118b-0x0;var _0x3636cf=_0xb10b[_0x23118b];return _0x3636cf;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x3aab4f,_0x4ffbb6){var _0x551503=function(_0xead478){while(--_0xead478){_0x3aab4f['push'](_0x3aab4f['shift']());}};_0x551503(++_0x4ffbb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 2cb8465..c4e091e 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 _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x3aaa4d,_0x2e7dec){var _0xb0bd1a=function(_0x412962){while(--_0x412962){_0x3aaa4d['push'](_0x3aaa4d['shift']());}};_0xb0bd1a(++_0x2e7dec);}(_0x757a,0xde));var _0xa757=function(_0x18629a,_0x3b3baa){_0x18629a=_0x18629a-0x0;var _0x4f6803=_0x757a[_0x18629a];return _0x4f6803;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x22c8b5,_0x296a12){var _0x474ea9=function(_0x441d03){while(--_0x441d03){_0x22c8b5['push'](_0x22c8b5['shift']());}};_0x474ea9(++_0x296a12);}(_0x2032,0xd9));var _0x2203=function(_0x2ac9d2,_0x538bd1){_0x2ac9d2=_0x2ac9d2-0x0;var _0x2a0ab8=_0x2032[_0x2ac9d2];return _0x2a0ab8;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('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 1ee1b2d..b36b0e5 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 _0xa6d8=['indexOf','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x3721d8,_0x1bfa47){var _0x341f0b=function(_0x118c58){while(--_0x118c58){_0x3721d8['push'](_0x3721d8['shift']());}};_0x341f0b(++_0x1bfa47);}(_0xa6d8,0x1a2));var _0x8a6d=function(_0x5bbf6a,_0x29460a){_0x5bbf6a=_0x5bbf6a-0x0;var _0x5d051a=_0xa6d8[_0x5bbf6a];return _0x5d051a;};'use strict';function Trunk(_0xcad304){this['id']=_0xcad304['id']||0x0;this[_0x8a6d('0x0')]=_0xcad304[_0x8a6d('0x0')]||![];this[_0x8a6d('0x1')]=_0xcad304[_0x8a6d('0x1')]||'';this[_0x8a6d('0x2')]=_0x8a6d('0x3');this[_0x8a6d('0x4')]=0x0;this[_0x8a6d('0x5')]='unknown';this['registry']=_0xcad304[_0x8a6d('0x6')]&&_0xcad304['registry'][_0x8a6d('0x7')](':')?_0xcad304[_0x8a6d('0x6')]['split'](':')[0x0]:'';this[_0x8a6d('0x8')]='';this[_0x8a6d('0x9')]='';this[_0x8a6d('0xa')]='';this[_0x8a6d('0xb')]='';this[_0x8a6d('0xc')]='';this['stateRegistry']=_0x8a6d('0x3');this[_0x8a6d('0xd')]='';this[_0x8a6d('0xe')]='';this[_0x8a6d('0xf')]=_0xcad304[_0x8a6d('0xf')]||'';}module[_0x8a6d('0x10')]=Trunk; \ No newline at end of file +var _0xa4fc=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','unknown','status','registry','indexOf','split'];(function(_0x4f9a98,_0x10b6a5){var _0x110360=function(_0x3689ef){while(--_0x3689ef){_0x4f9a98['push'](_0x4f9a98['shift']());}};_0x110360(++_0x10b6a5);}(_0xa4fc,0x168));var _0xca4f=function(_0x2480be,_0x209617){_0x2480be=_0x2480be-0x0;var _0x3e7123=_0xa4fc[_0x2480be];return _0x3e7123;};'use strict';function Trunk(_0x5452f2){this['id']=_0x5452f2['id']||0x0;this[_0xca4f('0x0')]=_0x5452f2['active']||![];this[_0xca4f('0x1')]=_0x5452f2[_0xca4f('0x1')]||'';this[_0xca4f('0x2')]=_0xca4f('0x3');this['stateTime']=0x0;this[_0xca4f('0x4')]=_0xca4f('0x3');this[_0xca4f('0x5')]=_0x5452f2[_0xca4f('0x5')]&&_0x5452f2['registry'][_0xca4f('0x6')](':')?_0x5452f2[_0xca4f('0x5')][_0xca4f('0x7')](':')[0x0]:'';this['host']='';this[_0xca4f('0x8')]='';this[_0xca4f('0x9')]='';this[_0xca4f('0xa')]='';this[_0xca4f('0xb')]='';this[_0xca4f('0xc')]=_0xca4f('0x3');this[_0xca4f('0xd')]='';this[_0xca4f('0xe')]='';this[_0xca4f('0xf')]=_0x5452f2['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0477672..f09d8d5 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 _0x092b=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x50ab95,_0x480438){var _0x2c62cd=function(_0x2af369){while(--_0x2af369){_0x50ab95['push'](_0x50ab95['shift']());}};_0x2c62cd(++_0x480438);}(_0x092b,0x142));var _0xb092=function(_0x3d5f7b,_0x42a99b){_0x3d5f7b=_0x3d5f7b-0x0;var _0xc4a45c=_0x092b[_0x3d5f7b];return _0xc4a45c;};'use strict';function voiceExtension(_0x5676e1){this['id']=_0x5676e1['id']||0x0;this['exten']=_0x5676e1[_0xb092('0x0')]||'';this[_0xb092('0x1')]=_0x5676e1[_0xb092('0x1')]||'none';this[_0xb092('0x2')]=_0x5676e1[_0xb092('0x2')]||![];}module[_0xb092('0x3')]=voiceExtension; \ No newline at end of file +var _0xb681=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5b3c90,_0x21c65d){var _0x510052=function(_0x194140){while(--_0x194140){_0x5b3c90['push'](_0x5b3c90['shift']());}};_0x510052(++_0x21c65d);}(_0xb681,0x113));var _0x1b68=function(_0x52fe6c,_0xe5929c){_0x52fe6c=_0x52fe6c-0x0;var _0x5d8037=_0xb681[_0x52fe6c];return _0x5d8037;};'use strict';function voiceExtension(_0x1c925e){this['id']=_0x1c925e['id']||0x0;this['exten']=_0x1c925e[_0x1b68('0x0')]||'';this[_0x1b68('0x1')]=_0x1c925e[_0x1b68('0x1')]||_0x1b68('0x2');this[_0x1b68('0x3')]=_0x1c925e[_0x1b68('0x3')]||![];}module[_0x1b68('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index f9de2dd..f4ee4eb 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 _0xc144=['paused','ringing','talking','unknown','acw','acwTimeout','sendMessageOneNotActive','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrordered','name','monitor_format','type','inbound','answered','sumDuration','abandoned','inUse','invalid','loggedIn','notInUse'];(function(_0x171813,_0x3af225){var _0x11058c=function(_0xb749ac){while(--_0xb749ac){_0x171813['push'](_0x171813['shift']());}};_0x11058c(++_0x3af225);}(_0xc144,0x1d8));var _0x4c14=function(_0xab9f47,_0x220c4e){_0xab9f47=_0xab9f47-0x0;var _0x582de5=_0xc144[_0xab9f47];return _0x582de5;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x4c14('0x0'),'gsm':_0x4c14('0x1')};var strategy={'fewestcalls':_0x4c14('0x2'),'leastrecent':_0x4c14('0x3'),'linear':_0x4c14('0x4'),'random':_0x4c14('0x5'),'ringall':_0x4c14('0x6'),'rr':_0x4c14('0x7'),'rrmemory':'rrmemory','rrordered':_0x4c14('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0x468f65){this['id']=_0x468f65['id']||0x0;this[_0x4c14('0x9')]=_0x468f65[_0x4c14('0x9')]||'';this['monitor_format']=_0x468f65[_0x4c14('0xa')]||'';this['type']=_0x468f65[_0x4c14('0xb')]||_0x4c14('0xc');this['waiting']=0x0;this['total']=0x0;this[_0x4c14('0xd')]=0x0;this[_0x4c14('0xe')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x4c14('0xf')]=0x0;this['available']=0x0;this['busy']=0x0;this[_0x4c14('0x10')]=0x0;this[_0x4c14('0x11')]=0x0;this[_0x4c14('0x12')]=0x0;this[_0x4c14('0x13')]=0x0;this['onHold']=0x0;this[_0x4c14('0x14')]=0x0;this[_0x4c14('0x15')]=0x0;this['ringInUse']=0x0;this[_0x4c14('0x16')]=0x0;this['unavailable']=0x0;this[_0x4c14('0x17')]=0x0;this[_0x4c14('0x18')]=_0x468f65[_0x4c14('0x18')]||![];this[_0x4c14('0x19')]=_0x468f65[_0x4c14('0x19')]||0xa;this['autopause']=_0x468f65['autopause']||'no';this[_0x4c14('0x1a')]=!![];this['message']='';this[_0x4c14('0x1b')]='';this['originated']=0x0;this[_0x4c14('0x1c')]=0x0;this[_0x4c14('0x1d')]=_0x468f65[_0x4c14('0x1d')]||null;this[_0x4c14('0x1e')]=_0x468f65[_0x4c14('0x1e')]?_0x468f65[_0x4c14('0x1e')]:null;this['dialActive']=_0x468f65[_0x4c14('0x1f')];this[_0x4c14('0x20')]=_0x468f65[_0x4c14('0x20')]||_0x4c14('0x21');this[_0x4c14('0x22')]=_0x468f65[_0x4c14('0x22')]||0x0;this[_0x4c14('0x23')]=_0x468f65[_0x4c14('0x23')]||0x0;this['dialPowerLevel']=_0x468f65[_0x4c14('0x24')]||0x1;this[_0x4c14('0x25')]=_0x468f65['dialPredictiveOptimization']||_0x4c14('0x26');this['dialPredictiveOptimizationPercentage']=_0x468f65[_0x4c14('0x27')]||0.03;this[_0x4c14('0x28')]=_0x468f65[_0x4c14('0x28')]||0x258;this[_0x4c14('0x29')]=_0x468f65[_0x4c14('0x29')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x468f65[_0x4c14('0x2a')]||_0x4c14('0x2b');this[_0x4c14('0x2c')]=_0x468f65['dialOriginateTimeout']||0x1e;this[_0x4c14('0x2d')]=_0x468f65['dialQueueOptions']||_0x4c14('0x2e');this['dialQueueTimeout']=_0x468f65[_0x4c14('0x2f')]||0x3;this[_0x4c14('0x30')]=_0x468f65['dialQueueProject']||undefined;this[_0x4c14('0x31')]=_0x468f65[_0x4c14('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x468f65[_0x4c14('0x32')]||0x96;this[_0x4c14('0x33')]=_0x468f65[_0x4c14('0x33')]||0x3;this[_0x4c14('0x34')]=_0x468f65[_0x4c14('0x34')]||0x96;this[_0x4c14('0x35')]=_0x468f65['dialNoAnswerMaxRetry']||0x3;this[_0x4c14('0x36')]=_0x468f65[_0x4c14('0x36')]||0x96;this[_0x4c14('0x37')]=_0x468f65[_0x4c14('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x468f65[_0x4c14('0x38')]||0x96;this['dialDropMaxRetry']=_0x468f65[_0x4c14('0x39')]||0x3;this[_0x4c14('0x3a')]=_0x468f65[_0x4c14('0x3a')]||0x96;this[_0x4c14('0x3b')]=_0x468f65[_0x4c14('0x3b')]||0x3;this[_0x4c14('0x3c')]=_0x468f65[_0x4c14('0x3c')]||0x96;this[_0x4c14('0x3d')]=_0x468f65[_0x4c14('0x3d')]||0x3;this[_0x4c14('0x3e')]=_0x468f65[_0x4c14('0x3e')]||0x96;this[_0x4c14('0x3f')]=_0x468f65['dialAgentRejectMaxRetry']||0x3;this[_0x4c14('0x40')]=_0x468f65['dialAgentRejectRetryFrequency']||0x96;this[_0x4c14('0x41')]=_0x468f65[_0x4c14('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x468f65['dialGlobalMaxRetry']||0x4;this[_0x4c14('0x42')]=_0x468f65[_0x4c14('0x42')]?_0x468f65[_0x4c14('0x42')]:undefined;this[_0x4c14('0x43')]=_0x468f65['TrunkBackup']?_0x468f65[_0x4c14('0x43')]:undefined;this['dialPrefix']=_0x468f65['dialPrefix']||undefined;this[_0x4c14('0x44')]=_0x468f65[_0x4c14('0x44')]?_0x468f65['Interval']:undefined;this[_0x4c14('0x45')]=_0x468f65['dialOrderByScheduledAt']||_0x4c14('0x46');this[_0x4c14('0x47')]=_0x468f65[_0x4c14('0x47')]||undefined;this['dialCutDigit']=_0x468f65[_0x4c14('0x48')]||undefined;this[_0x4c14('0x49')]=strategy[_0x468f65[_0x4c14('0x49')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x468f65[_0x4c14('0x4a')]||![];this[_0x4c14('0x4b')]=_0x468f65[_0x4c14('0x4b')];this[_0x4c14('0x4c')]=_0x468f65[_0x4c14('0x4c')];this[_0x4c14('0x4d')]=_0x468f65['dialAMDAfterGreetingSilence'];this[_0x4c14('0x4e')]=_0x468f65['dialAMDTotalAnalysisTime'];this[_0x4c14('0x4f')]=_0x468f65[_0x4c14('0x4f')];this[_0x4c14('0x50')]=_0x468f65[_0x4c14('0x50')];this[_0x4c14('0x51')]=_0x468f65[_0x4c14('0x51')];this['dialAMDSilenceThreshold']=_0x468f65['dialAMDSilenceThreshold'];this[_0x4c14('0x52')]=_0x468f65['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x4c14('0x53')]=0x0;this[_0x4c14('0x54')]=_0x468f65['timeout'];this[_0x4c14('0x55')]=0x0;this[_0x4c14('0x56')]=0x0;this[_0x4c14('0x57')]=0x0;this[_0x4c14('0x58')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x4c14('0x59')]=0x0;this[_0x4c14('0x5a')]=0x0;this[_0x4c14('0x5b')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x4c14('0x5c')]=0x0;this[_0x4c14('0x5d')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x4c14('0x5e')]=0x0;this[_0x4c14('0x5f')]=0x0;this[_0x4c14('0x60')]=undefined;this[_0x4c14('0x61')]=undefined;this[_0x4c14('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x4c14('0x63')]=0x0;this[_0x4c14('0x64')]=0x0;this[_0x4c14('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x4c14('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x4c14('0x67')]=0x0;this[_0x4c14('0x68')]=_0x468f65['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x4c14('0x69')]=_0x468f65[_0x4c14('0x6a')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x4c14('0x6b')]=0x0;this[_0x4c14('0x6c')]=0x1;this[_0x4c14('0x6d')]=0x0;this[_0x4c14('0x6e')]=0x0;this[_0x4c14('0x6f')]=0x0;this[_0x4c14('0x70')]=0x0;this[_0x4c14('0x71')]=_0x468f65[_0x4c14('0x71')]||0x1e;this[_0x4c14('0x72')]=_0x468f65[_0x4c14('0x72')]||![];this[_0x4c14('0x73')]=!!_0x468f65[_0x4c14('0x73')]||![];this['dialPreviewRecallmeReminder']=!!_0x468f65['dialPreviewRecallmeReminder']||![];this[_0x4c14('0x74')]=_0x468f65[_0x4c14('0x74')]||undefined;this[_0x4c14('0x75')]=_0x468f65[_0x4c14('0x75')]||![];this[_0x4c14('0x76')]=_0x468f65['dialAgiAfterHangupAgent']||![];this[_0x4c14('0xa')]=monitorFormat[_0x468f65[_0x4c14('0xa')]]?monitorFormat[_0x468f65[_0x4c14('0xa')]]:undefined;this['mandatoryDisposition']=_0x468f65[_0x4c14('0x77')]||![];this[_0x4c14('0x78')]=_0x468f65[_0x4c14('0x78')]?_0x468f65[_0x4c14('0x78')]:undefined;this[_0x4c14('0x79')]=![];}module[_0x4c14('0x7a')]=VoiceQueue; \ No newline at end of file +var _0x5844=['invalid','onHold','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x5844,0x6a));var _0x4584=function(_0x5e2983,_0x74d125){_0x5e2983=_0x5e2983-0x0;var _0x2e1e22=_0x5844[_0x5e2983];return _0x2e1e22;};'use strict';var monitorFormat={'wav':_0x4584('0x0'),'wav49':_0x4584('0x1'),'gsm':_0x4584('0x2')};var strategy={'fewestcalls':_0x4584('0x3'),'leastrecent':_0x4584('0x4'),'linear':_0x4584('0x5'),'random':'random','ringall':_0x4584('0x6'),'rr':_0x4584('0x7'),'rrmemory':_0x4584('0x8'),'rrordered':_0x4584('0x9'),'wrandom':_0x4584('0xa')};function VoiceQueue(_0x20c39f){this['id']=_0x20c39f['id']||0x0;this[_0x4584('0xb')]=_0x20c39f[_0x4584('0xb')]||'';this[_0x4584('0xc')]=_0x20c39f[_0x4584('0xc')]||'';this[_0x4584('0xd')]=_0x20c39f['type']||_0x4584('0xe');this[_0x4584('0xf')]=0x0;this[_0x4584('0x10')]=0x0;this[_0x4584('0x11')]=0x0;this[_0x4584('0x12')]=0x0;this[_0x4584('0x13')]=0x0;this[_0x4584('0x14')]=0x0;this[_0x4584('0x15')]=0x0;this[_0x4584('0x16')]=0x0;this[_0x4584('0x17')]=0x0;this[_0x4584('0x18')]=0x0;this[_0x4584('0x19')]=0x0;this[_0x4584('0x1a')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x4584('0x1b')]=0x0;this['paused']=0x0;this[_0x4584('0x1c')]=0x0;this[_0x4584('0x1d')]=0x0;this[_0x4584('0x1e')]=0x0;this['unavailable']=0x0;this[_0x4584('0x1f')]=0x0;this['acw']=_0x20c39f[_0x4584('0x20')]||![];this[_0x4584('0x21')]=_0x20c39f[_0x4584('0x21')]||0xa;this[_0x4584('0x22')]=_0x20c39f[_0x4584('0x22')]||'no';this[_0x4584('0x23')]=!![];this[_0x4584('0x24')]='';this[_0x4584('0x25')]='';this[_0x4584('0x26')]=0x0;this['temp']=0x0;this[_0x4584('0x27')]=_0x20c39f['dialTimezone']||null;this[_0x4584('0x28')]=_0x20c39f[_0x4584('0x28')]?_0x20c39f[_0x4584('0x28')]:null;this[_0x4584('0x29')]=_0x20c39f['dialActive'];this[_0x4584('0x2a')]=_0x20c39f[_0x4584('0x2a')]||_0x4584('0x2b');this[_0x4584('0x2c')]=_0x20c39f[_0x4584('0x2c')]||0x0;this[_0x4584('0x2d')]=_0x20c39f[_0x4584('0x2d')]||0x0;this[_0x4584('0x2e')]=_0x20c39f[_0x4584('0x2e')]||0x1;this[_0x4584('0x2f')]=_0x20c39f[_0x4584('0x2f')]||_0x4584('0x30');this['dialPredictiveOptimizationPercentage']=_0x20c39f['dialPredictiveOptimizationPercentage']||0.03;this[_0x4584('0x31')]=_0x20c39f[_0x4584('0x31')]||0x258;this[_0x4584('0x32')]=_0x20c39f[_0x4584('0x32')]||'anonymous';this[_0x4584('0x33')]=_0x20c39f[_0x4584('0x33')]||'anonymous';this['dialOriginateTimeout']=_0x20c39f[_0x4584('0x34')]||0x1e;this[_0x4584('0x35')]=_0x20c39f[_0x4584('0x35')]||_0x4584('0x36');this[_0x4584('0x37')]=_0x20c39f[_0x4584('0x37')]||0x3;this['dialQueueProject']=_0x20c39f[_0x4584('0x38')]||undefined;this[_0x4584('0x39')]=_0x20c39f[_0x4584('0x39')]||0x3;this[_0x4584('0x3a')]=_0x20c39f['dialCongestionRetryFrequency']||0x96;this[_0x4584('0x3b')]=_0x20c39f[_0x4584('0x3b')]||0x3;this[_0x4584('0x3c')]=_0x20c39f[_0x4584('0x3c')]||0x96;this[_0x4584('0x3d')]=_0x20c39f[_0x4584('0x3d')]||0x3;this['dialNoAnswerRetryFrequency']=_0x20c39f['dialNoAnswerRetryFrequency']||0x96;this[_0x4584('0x3e')]=_0x20c39f['dialNoSuchNumberMaxRetry']||0x3;this[_0x4584('0x3f')]=_0x20c39f[_0x4584('0x3f')]||0x96;this[_0x4584('0x40')]=_0x20c39f[_0x4584('0x40')]||0x3;this[_0x4584('0x41')]=_0x20c39f[_0x4584('0x41')]||0x96;this[_0x4584('0x42')]=_0x20c39f[_0x4584('0x42')]||0x3;this[_0x4584('0x43')]=_0x20c39f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x20c39f[_0x4584('0x44')]||0x3;this['dialMachineRetryFrequency']=_0x20c39f[_0x4584('0x45')]||0x96;this[_0x4584('0x46')]=_0x20c39f[_0x4584('0x46')]||0x3;this[_0x4584('0x47')]=_0x20c39f[_0x4584('0x47')]||0x96;this[_0x4584('0x48')]=_0x20c39f[_0x4584('0x48')]||0x3;this[_0x4584('0x49')]=_0x20c39f[_0x4584('0x49')]||0x4;this[_0x4584('0x4a')]=_0x20c39f[_0x4584('0x4a')]?_0x20c39f[_0x4584('0x4a')]:undefined;this['TrunkBackup']=_0x20c39f[_0x4584('0x4b')]?_0x20c39f[_0x4584('0x4b')]:undefined;this[_0x4584('0x4c')]=_0x20c39f['dialPrefix']||undefined;this[_0x4584('0x4d')]=_0x20c39f[_0x4584('0x4d')]?_0x20c39f['Interval']:undefined;this[_0x4584('0x4e')]=_0x20c39f['dialOrderByScheduledAt']||_0x4584('0x4f');this['dialRandomLastDigitCallerIdNumber']=_0x20c39f['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x20c39f[_0x4584('0x50')]||undefined;this[_0x4584('0x51')]=strategy[_0x20c39f['strategy']];this['queueStatusComplete']=!![];this[_0x4584('0x52')]=_0x20c39f[_0x4584('0x52')]||![];this[_0x4584('0x53')]=_0x20c39f['dialAMDInitialSilence'];this[_0x4584('0x54')]=_0x20c39f[_0x4584('0x54')];this['dialAMDAfterGreetingSilence']=_0x20c39f[_0x4584('0x55')];this[_0x4584('0x56')]=_0x20c39f[_0x4584('0x56')];this[_0x4584('0x57')]=_0x20c39f['dialAMDMinWordLength'];this[_0x4584('0x58')]=_0x20c39f['dialAMDBetweenWordsSilence'];this[_0x4584('0x59')]=_0x20c39f[_0x4584('0x59')];this[_0x4584('0x5a')]=_0x20c39f[_0x4584('0x5a')];this['dialAMDMaximumWordLength']=_0x20c39f['dialAMDMaximumWordLength'];this[_0x4584('0x5b')]=0x0;this['pTalking']=0x0;this[_0x4584('0x5c')]=_0x20c39f[_0x4584('0x5c')];this[_0x4584('0x5d')]=0x0;this[_0x4584('0x5e')]=0x0;this[_0x4584('0x5f')]=0x0;this[_0x4584('0x60')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x4584('0x61')]=0x0;this[_0x4584('0x62')]=0x0;this[_0x4584('0x63')]=0x0;this[_0x4584('0x64')]=0x0;this[_0x4584('0x65')]=0x0;this[_0x4584('0x66')]=0x0;this[_0x4584('0x67')]=0x0;this[_0x4584('0x68')]=0x0;this['startProgressive']=undefined;this[_0x4584('0x69')]=undefined;this[_0x4584('0x6a')]=undefined;this[_0x4584('0x6b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x4584('0x6c')]=0x0;this[_0x4584('0x6d')]=0x0;this[_0x4584('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x4584('0x6f')]=0x0;this[_0x4584('0x70')]=0x0;this[_0x4584('0x71')]=_0x20c39f[_0x4584('0x72')]||0x14;this[_0x4584('0x73')]=_0x20c39f[_0x4584('0x72')]||0xa;this[_0x4584('0x74')]=0x0;this[_0x4584('0x75')]=0x0;this[_0x4584('0x76')]=0x1;this[_0x4584('0x77')]=0x0;this['erlangCallToSecond']=0x0;this[_0x4584('0x78')]=0x0;this[_0x4584('0x79')]=0x0;this[_0x4584('0x7a')]=_0x20c39f['dialRecallMeTimeout']||0x1e;this[_0x4584('0x7b')]=_0x20c39f[_0x4584('0x7b')]||![];this['dialPreviewAutoRecallMe']=!!_0x20c39f['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x20c39f[_0x4584('0x7c')]||![];this[_0x4584('0x7d')]=_0x20c39f['dialQueueProject2']||undefined;this[_0x4584('0x7e')]=_0x20c39f[_0x4584('0x7e')]||![];this[_0x4584('0x7f')]=_0x20c39f[_0x4584('0x7f')]||![];this[_0x4584('0xc')]=monitorFormat[_0x20c39f['monitor_format']]?monitorFormat[_0x20c39f['monitor_format']]:undefined;this['mandatoryDisposition']=_0x20c39f[_0x4584('0x80')]||![];this['mandatoryDispositionPause']=_0x20c39f[_0x4584('0x81')]?_0x20c39f[_0x4584('0x81')]:undefined;this[_0x4584('0x82')]=![];}module[_0x4584('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 1ed716d..0ae72fa 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f72=['waiting','answered','inUse','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','total','name','strategy','abandoned','available','busy','invalid','onHold','notInUse','ringing','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','status','booked','keys','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAnswerCallsDay','preview','exports','loggedIn','loggedInDb','paused','talking'];(function(_0x52b19f,_0xe4c367){var _0x11caf2=function(_0x212ef){while(--_0x212ef){_0x52b19f['push'](_0x52b19f['shift']());}};_0x11caf2(++_0xe4c367);}(_0x6f72,0xae));var _0x26f7=function(_0x2ff980,_0xf5e589){_0x2ff980=_0x2ff980-0x0;var _0x3e4a63=_0x6f72[_0x2ff980];return _0x3e4a63;};'use strict';var INBOUND_COUNTERS=['available',_0x26f7('0x0'),_0x26f7('0x1'),_0x26f7('0x2'),'ringing',_0x26f7('0x3'),_0x26f7('0x4')];var OUTBOUND_COUNTERS=['available',_0x26f7('0x5'),_0x26f7('0x6'),'loggedIn',_0x26f7('0x1'),'originated',_0x26f7('0x7'),'outboundAnswerCallsDay',_0x26f7('0x8'),_0x26f7('0x9'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x26f7('0xa'),_0x26f7('0xb'),_0x26f7('0xc'),_0x26f7('0xd'),_0x26f7('0x2'),_0x26f7('0xe'),_0x26f7('0x3'),_0x26f7('0xf'),'sumDuration',_0x26f7('0x10'),'waiting'];function VoiceQueueSummary(_0x11d2f0){this['id']=_0x11d2f0['id'];this[_0x26f7('0x11')]=_0x11d2f0[_0x26f7('0x11')];this[_0x26f7('0x12')]=_0x11d2f0[_0x26f7('0x12')];this[_0x26f7('0x13')]=_0x11d2f0[_0x26f7('0x13')]||0x0;this[_0x26f7('0x5')]=_0x11d2f0[_0x26f7('0x5')]||0x0;this[_0x26f7('0x14')]=_0x11d2f0[_0x26f7('0x14')]||0x0;this[_0x26f7('0x15')]=_0x11d2f0['busy']||0x0;this[_0x26f7('0x6')]=_0x11d2f0[_0x26f7('0x6')]||0x0;this[_0x26f7('0x16')]=_0x11d2f0[_0x26f7('0x16')]||0x0;this['loggedIn']=_0x11d2f0[_0x26f7('0x0')]||0x0;this['loggedInDb']=_0x11d2f0[_0x26f7('0x1')]||0x0;this[_0x26f7('0x17')]=_0x11d2f0[_0x26f7('0x17')]||0x0;this[_0x26f7('0x18')]=_0x11d2f0['notInUse']||0x0;this['paused']=_0x11d2f0[_0x26f7('0x2')]||0x0;this['ringing']=_0x11d2f0[_0x26f7('0x19')]||0x0;this[_0x26f7('0x1a')]=_0x11d2f0[_0x26f7('0x1a')];this[_0x26f7('0xf')]=_0x11d2f0[_0x26f7('0xf')];this[_0x26f7('0x1b')]=_0x11d2f0[_0x26f7('0x1b')];this[_0x26f7('0x1c')]=_0x11d2f0[_0x26f7('0x1c')]||0x0;this[_0x26f7('0x3')]=_0x11d2f0['talking']||0x0;this[_0x26f7('0x10')]=_0x11d2f0[_0x26f7('0x10')]||0x0;this[_0x26f7('0x1d')]=_0x11d2f0[_0x26f7('0x1d')];this[_0x26f7('0x1e')]=_0x11d2f0[_0x26f7('0x1e')]||0x0;this[_0x26f7('0x1f')]=_0x11d2f0[_0x26f7('0x1f')]||0x0;this[_0x26f7('0x20')]=_0x11d2f0[_0x26f7('0x20')]||0x0;this[_0x26f7('0x4')]=_0x11d2f0['waiting']||0x0;if(_0x11d2f0[_0x26f7('0x1d')]==='outbound'){this['pTalking']=_0x11d2f0[_0x26f7('0xe')]||0x0;this[_0x26f7('0x21')]=_0x11d2f0[_0x26f7('0x21')];this[_0x26f7('0x22')]=_0x11d2f0[_0x26f7('0x22')];this['dialOriginateCallerIdName']=_0x11d2f0[_0x26f7('0x23')];this[_0x26f7('0x24')]=_0x11d2f0[_0x26f7('0x24')];this[_0x26f7('0x25')]=_0x11d2f0[_0x26f7('0x25')];this[_0x26f7('0x26')]=_0x11d2f0['dialPrefix'];this[_0x26f7('0x27')]=_0x11d2f0['temp'];this['outboundAnswerAgiCallsDay']=_0x11d2f0[_0x26f7('0x28')];this['outboundAnswerCallsDay']=_0x11d2f0['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x11d2f0[_0x26f7('0x8')];this[_0x26f7('0x9')]=_0x11d2f0[_0x26f7('0x9')];this[_0x26f7('0x29')]=_0x11d2f0[_0x26f7('0x29')];this['outboundDropCallsDayACS']=_0x11d2f0[_0x26f7('0x2a')];this['outboundDropCallsDayCallersExit']=_0x11d2f0['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x11d2f0[_0x26f7('0x2b')];this[_0x26f7('0x2c')]=_0x11d2f0[_0x26f7('0x2c')];this[_0x26f7('0xa')]=_0x11d2f0['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x11d2f0['outboundOriginateFailureCallsDay'];this[_0x26f7('0xb')]=_0x11d2f0[_0x26f7('0xb')];this['outboundRejectCallsDay']=_0x11d2f0[_0x26f7('0xc')];this[_0x26f7('0xd')]=_0x11d2f0[_0x26f7('0xd')];this[_0x26f7('0x2d')]=_0x11d2f0[_0x26f7('0x2d')];this[_0x26f7('0x2e')]=_0x11d2f0['predictiveIntervalAvgHoldtime'];this[_0x26f7('0x2f')]=_0x11d2f0[_0x26f7('0x2f')];this[_0x26f7('0x30')]=_0x11d2f0['predictiveIntervalDroppedCallsCallersExit'];this[_0x26f7('0x31')]=_0x11d2f0[_0x26f7('0x31')];this['predictiveIntervalErlangCalls']=_0x11d2f0[_0x26f7('0x32')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x11d2f0[_0x26f7('0x33')];this[_0x26f7('0x34')]=_0x11d2f0['predictiveIntervalHitRate'];this[_0x26f7('0x35')]=_0x11d2f0[_0x26f7('0x35')];this[_0x26f7('0x36')]=_0x11d2f0['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x11d2f0[_0x26f7('0x37')];this['predictiveIntervalTotalCalls']=_0x11d2f0[_0x26f7('0x38')];this[_0x26f7('0x39')]=_0x11d2f0[_0x26f7('0x39')];this[_0x26f7('0x3a')]=_0x11d2f0['erlangCalls'];this[_0x26f7('0x3b')]=_0x11d2f0[_0x26f7('0x3b')];this[_0x26f7('0x3c')]=_0x11d2f0[_0x26f7('0x3c')];this[_0x26f7('0x3d')]=_0x11d2f0[_0x26f7('0x3d')];this[_0x26f7('0x3e')]=_0x11d2f0[_0x26f7('0x3e')];this[_0x26f7('0x3f')]=_0x11d2f0[_0x26f7('0x3f')];this[_0x26f7('0x40')]=_0x11d2f0['message'];this[_0x26f7('0x41')]=_0x11d2f0[_0x26f7('0x41')];}if(_0x11d2f0['Trunk']){this[_0x26f7('0x42')]={'id':_0x11d2f0['Trunk']['id'],'name':_0x11d2f0[_0x26f7('0x42')][_0x26f7('0x11')],'active':_0x11d2f0[_0x26f7('0x42')][_0x26f7('0x43')],'callerid':_0x11d2f0[_0x26f7('0x42')][_0x26f7('0x44')]};}}VoiceQueueSummary[_0x26f7('0x45')][_0x26f7('0x46')]=function(_0x478764,_0x130988,_0x1bd16e,_0x2aea16){this['loggedInDb']=0x0;this[_0x26f7('0x3')]=0x0;this['paused']=0x0;this['unknown']=0x0;this[_0x26f7('0x18')]=0x0;this['inUse']=0x0;this['busy']=0x0;this[_0x26f7('0x16')]=0x0;this['unavailable']=0x0;this[_0x26f7('0x19')]=0x0;this[_0x26f7('0x1a')]=0x0;this[_0x26f7('0x17')]=0x0;if(_0x1bd16e){if(_0x1bd16e[_0x26f7('0x14')]){this[_0x26f7('0x14')]=Number(_0x1bd16e[_0x26f7('0x14')]);}if(_0x1bd16e[_0x26f7('0x47')]){this[_0x26f7('0x0')]=Number(_0x1bd16e[_0x26f7('0x47')]);}if(_0x1bd16e[_0x26f7('0x48')]){this['waiting']=Number(_0x1bd16e[_0x26f7('0x48')]);}}for(var _0x14890b=0x0;_0x14890b<_0x478764[_0x26f7('0x49')];_0x14890b++){var _0x4bf2a2=_0x130988[_0x26f7('0x4a')+_0x478764[_0x14890b][_0x26f7('0x11')]];if(_0x4bf2a2&&_0x4bf2a2[_0x26f7('0x4b')]){this[_0x26f7('0x1')]+=0x1;}if(_0x478764[_0x14890b][_0x26f7('0x4c')]==='1'){this[_0x26f7('0x3')]+=0x1;}if(_0x478764[_0x14890b]['paused']==='1'&&!['2','7','8']['includes'](_0x478764[_0x14890b][_0x26f7('0x4d')])){this[_0x26f7('0x2')]+=0x1;}switch(_0x478764[_0x14890b][_0x26f7('0x4d')]){case'0':this[_0x26f7('0x1f')]+=0x1;break;case'1':this[_0x26f7('0x18')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x26f7('0x15')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x26f7('0x1e')]+=0x1;break;case'6':this[_0x26f7('0x19')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x26f7('0x17')]+=0x1;break;}}if(this['dialMethod']===_0x26f7('0x4e')){var _0x4f4e2b=Object[_0x26f7('0x4f')](_0x2aea16);for(var _0x5d4c93=0x0;_0x5d4c93<_0x4f4e2b[_0x26f7('0x49')];_0x5d4c93++){var _0x37023f=_0x4f4e2b[_0x5d4c93];var _0x121de3=_0x2aea16[_0x37023f];if(_0x121de3['queue']===this[_0x26f7('0x11')]&&_0x121de3[_0x26f7('0x1d')]===_0x26f7('0x50')&&_0x121de3[_0x26f7('0x51')]==='xcally-motion-preview'){this[_0x26f7('0x3')]+=0x1;}}if(this[_0x26f7('0x3')]>this[_0x26f7('0x6')]){this[_0x26f7('0x3')]=this[_0x26f7('0x6')];}this[_0x26f7('0xe')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x26f7('0x52')]=function(_0xa65a9c){var _0x1f4592=![];if(_0xa65a9c){_0x1f4592=INBOUND_COUNTERS[_0x26f7('0x53')](function(_0x5344c8){return this[_0x5344c8]!==_0xa65a9c[_0x5344c8];},this);}return _0x1f4592;};VoiceQueueSummary['prototype'][_0x26f7('0x54')]=function(_0x2c7918){var _0x4f0223=![];var _0x4394c7=![];var _0x410e8e=![];if(_0x2c7918){_0x4f0223=this[_0x26f7('0x22')]!==_0x2c7918[_0x26f7('0x22')]||this[_0x26f7('0x21')]!==_0x2c7918[_0x26f7('0x21')]||this['message']!==_0x2c7918[_0x26f7('0x40')]||this[_0x26f7('0x41')]!==_0x2c7918[_0x26f7('0x41')];_0x4394c7=OUTBOUND_COUNTERS[_0x26f7('0x53')](function(_0x1adf4e){return this[_0x1adf4e]!==_0x2c7918[_0x1adf4e];},this);if(this[_0x26f7('0x42')]&&_0x2c7918['Trunk']){_0x410e8e=this[_0x26f7('0x42')]['name']!==_0x2c7918['Trunk']['name']||this[_0x26f7('0x42')]['active']!==_0x2c7918[_0x26f7('0x42')][_0x26f7('0x43')];}}return _0x4f0223||_0x4394c7||_0x410e8e;};VoiceQueueSummary['prototype'][_0x26f7('0x55')]=function(_0x29ec12){this[_0x26f7('0x5')]=_0x29ec12[_0x26f7('0x5')];this[_0x26f7('0x40')]=_0x29ec12[_0x26f7('0x40')];this[_0x26f7('0x41')]=_0x29ec12[_0x26f7('0x41')];this[_0x26f7('0x39')]=_0x29ec12['originated'];this[_0x26f7('0x7')]=_0x29ec12['outboundAbandonedCallsDay'];this[_0x26f7('0x56')]=_0x29ec12[_0x26f7('0x56')];this[_0x26f7('0x8')]=_0x29ec12[_0x26f7('0x8')];this['outboundBusyCallsDay']=_0x29ec12[_0x26f7('0x9')];this[_0x26f7('0x29')]=_0x29ec12[_0x26f7('0x29')];this[_0x26f7('0x2c')]=_0x29ec12[_0x26f7('0x2c')];this['outboundNoSuchCallsDay']=_0x29ec12[_0x26f7('0xa')];this[_0x26f7('0xb')]=_0x29ec12['outboundReCallsDay'];this[_0x26f7('0xc')]=_0x29ec12['outboundRejectCallsDay'];this[_0x26f7('0xd')]=_0x29ec12['outboundUnknownCallsDay'];this['sumBillable']=_0x29ec12[_0x26f7('0xf')];this[_0x26f7('0x1b')]=_0x29ec12[_0x26f7('0x1b')];this[_0x26f7('0x10')]=_0x29ec12[_0x26f7('0x10')];if(this['dialMethod']===_0x26f7('0x57')){this['pTalking']=_0x29ec12[_0x26f7('0xe')];}};module[_0x26f7('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0xae1c=['strategy','abandoned','busy','invalid','onHold','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','notInUse','loggedin','callers','length','SIP/','incall','status','booked','keys','queue','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundCongestionCallsDay','preview','exports','ringing','talking','waiting','available','answered','inUse','loggedIn','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumDuration','total','name'];(function(_0x48bf27,_0x5849c8){var _0x15c620=function(_0x57d915){while(--_0x57d915){_0x48bf27['push'](_0x48bf27['shift']());}};_0x15c620(++_0x5849c8);}(_0xae1c,0xff));var _0xcae1=function(_0x4b366e,_0x479e1f){_0x4b366e=_0x4b366e-0x0;var _0x464dff=_0xae1c[_0x4b366e];return _0x464dff;};'use strict';var INBOUND_COUNTERS=['available','loggedIn','loggedInDb','paused',_0xcae1('0x0'),_0xcae1('0x1'),_0xcae1('0x2')];var OUTBOUND_COUNTERS=[_0xcae1('0x3'),_0xcae1('0x4'),_0xcae1('0x5'),_0xcae1('0x6'),_0xcae1('0x7'),_0xcae1('0x8'),_0xcae1('0x9'),_0xcae1('0xa'),_0xcae1('0xb'),_0xcae1('0xc'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xcae1('0xd'),_0xcae1('0xe'),_0xcae1('0xf'),'outboundUnknownCallsDay',_0xcae1('0x10'),_0xcae1('0x11'),_0xcae1('0x1'),'sumBillable',_0xcae1('0x12'),_0xcae1('0x13'),'waiting'];function VoiceQueueSummary(_0x4e24fb){this['id']=_0x4e24fb['id'];this[_0xcae1('0x14')]=_0x4e24fb[_0xcae1('0x14')];this[_0xcae1('0x15')]=_0x4e24fb[_0xcae1('0x15')];this[_0xcae1('0x16')]=_0x4e24fb[_0xcae1('0x16')]||0x0;this[_0xcae1('0x4')]=_0x4e24fb[_0xcae1('0x4')]||0x0;this[_0xcae1('0x3')]=_0x4e24fb[_0xcae1('0x3')]||0x0;this[_0xcae1('0x17')]=_0x4e24fb[_0xcae1('0x17')]||0x0;this[_0xcae1('0x5')]=_0x4e24fb[_0xcae1('0x5')]||0x0;this[_0xcae1('0x18')]=_0x4e24fb['invalid']||0x0;this[_0xcae1('0x6')]=_0x4e24fb[_0xcae1('0x6')]||0x0;this['loggedInDb']=_0x4e24fb['loggedInDb']||0x0;this[_0xcae1('0x19')]=_0x4e24fb[_0xcae1('0x19')]||0x0;this['notInUse']=_0x4e24fb['notInUse']||0x0;this[_0xcae1('0x10')]=_0x4e24fb['paused']||0x0;this[_0xcae1('0x0')]=_0x4e24fb[_0xcae1('0x0')]||0x0;this[_0xcae1('0x1a')]=_0x4e24fb[_0xcae1('0x1a')];this[_0xcae1('0x1b')]=_0x4e24fb[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x4e24fb[_0xcae1('0x12')];this[_0xcae1('0x1c')]=_0x4e24fb[_0xcae1('0x1c')]||0x0;this[_0xcae1('0x1')]=_0x4e24fb[_0xcae1('0x1')]||0x0;this[_0xcae1('0x13')]=_0x4e24fb[_0xcae1('0x13')]||0x0;this['type']=_0x4e24fb[_0xcae1('0x1d')];this[_0xcae1('0x1e')]=_0x4e24fb[_0xcae1('0x1e')]||0x0;this[_0xcae1('0x1f')]=_0x4e24fb['unknown']||0x0;this[_0xcae1('0x20')]=_0x4e24fb[_0xcae1('0x20')]||0x0;this[_0xcae1('0x2')]=_0x4e24fb[_0xcae1('0x2')]||0x0;if(_0x4e24fb[_0xcae1('0x1d')]===_0xcae1('0x21')){this[_0xcae1('0x11')]=_0x4e24fb[_0xcae1('0x11')]||0x0;this['dialActive']=_0x4e24fb[_0xcae1('0x22')];this['dialMethod']=_0x4e24fb[_0xcae1('0x23')];this[_0xcae1('0x24')]=_0x4e24fb['dialOriginateCallerIdName'];this[_0xcae1('0x25')]=_0x4e24fb[_0xcae1('0x25')];this[_0xcae1('0x26')]=_0x4e24fb['dialOriginateTimeout'];this['dialPrefix']=_0x4e24fb[_0xcae1('0x27')];this[_0xcae1('0x28')]=_0x4e24fb[_0xcae1('0x28')];this[_0xcae1('0x29')]=_0x4e24fb[_0xcae1('0x29')];this[_0xcae1('0xa')]=_0x4e24fb[_0xcae1('0xa')];this['outboundBlacklistCallsDay']=_0x4e24fb[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x4e24fb[_0xcae1('0xc')];this['outboundCongestionCallsDay']=_0x4e24fb['outboundCongestionCallsDay'];this[_0xcae1('0x2a')]=_0x4e24fb['outboundDropCallsDayACS'];this[_0xcae1('0x2b')]=_0x4e24fb[_0xcae1('0x2b')];this[_0xcae1('0x2c')]=_0x4e24fb[_0xcae1('0x2c')];this[_0xcae1('0x2d')]=_0x4e24fb[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x4e24fb[_0xcae1('0xd')];this[_0xcae1('0x2e')]=_0x4e24fb[_0xcae1('0x2e')];this['outboundReCallsDay']=_0x4e24fb[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x4e24fb[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x4e24fb['outboundUnknownCallsDay'];this[_0xcae1('0x30')]=_0x4e24fb['predictiveIntervalAnsweredCalls'];this[_0xcae1('0x31')]=_0x4e24fb['predictiveIntervalAvgHoldtime'];this[_0xcae1('0x32')]=_0x4e24fb[_0xcae1('0x32')];this[_0xcae1('0x33')]=_0x4e24fb[_0xcae1('0x33')];this[_0xcae1('0x34')]=_0x4e24fb[_0xcae1('0x34')];this[_0xcae1('0x35')]=_0x4e24fb[_0xcae1('0x35')];this[_0xcae1('0x36')]=_0x4e24fb[_0xcae1('0x36')];this['predictiveIntervalHitRate']=_0x4e24fb[_0xcae1('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x4e24fb[_0xcae1('0x38')];this['predictiveIntervalPauses']=_0x4e24fb[_0xcae1('0x39')];this[_0xcae1('0x3a')]=_0x4e24fb['predictiveIntervalAvailable'];this[_0xcae1('0x3b')]=_0x4e24fb[_0xcae1('0x3b')];this[_0xcae1('0x8')]=_0x4e24fb[_0xcae1('0x8')];this['erlangCalls']=_0x4e24fb[_0xcae1('0x3c')];this[_0xcae1('0x3d')]=_0x4e24fb['erlangCallToSecond'];this[_0xcae1('0x3e')]=_0x4e24fb[_0xcae1('0x3e')];this[_0xcae1('0x3f')]=_0x4e24fb['erlangBusyFactor'];this[_0xcae1('0x40')]=_0x4e24fb['startPredictive'];this[_0xcae1('0x41')]=_0x4e24fb[_0xcae1('0x41')];this[_0xcae1('0x42')]=_0x4e24fb['message'];this[_0xcae1('0x43')]=_0x4e24fb[_0xcae1('0x43')];}if(_0x4e24fb[_0xcae1('0x44')]){this[_0xcae1('0x44')]={'id':_0x4e24fb[_0xcae1('0x44')]['id'],'name':_0x4e24fb[_0xcae1('0x44')]['name'],'active':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x45')],'callerid':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x46')]};}}VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x48')]=function(_0x349a18,_0x1d6700,_0x145fd7,_0x43f389){this[_0xcae1('0x7')]=0x0;this['talking']=0x0;this[_0xcae1('0x10')]=0x0;this[_0xcae1('0x1f')]=0x0;this[_0xcae1('0x49')]=0x0;this[_0xcae1('0x5')]=0x0;this[_0xcae1('0x17')]=0x0;this[_0xcae1('0x18')]=0x0;this[_0xcae1('0x1e')]=0x0;this['ringing']=0x0;this[_0xcae1('0x1a')]=0x0;this[_0xcae1('0x19')]=0x0;if(_0x145fd7){if(_0x145fd7[_0xcae1('0x3')]){this[_0xcae1('0x3')]=Number(_0x145fd7['available']);}if(_0x145fd7['loggedin']){this['loggedIn']=Number(_0x145fd7[_0xcae1('0x4a')]);}if(_0x145fd7[_0xcae1('0x4b')]){this[_0xcae1('0x2')]=Number(_0x145fd7[_0xcae1('0x4b')]);}}for(var _0x11bacb=0x0;_0x11bacb<_0x349a18[_0xcae1('0x4c')];_0x11bacb++){var _0x5b95ab=_0x1d6700[_0xcae1('0x4d')+_0x349a18[_0x11bacb][_0xcae1('0x14')]];if(_0x5b95ab&&_0x5b95ab['online']){this[_0xcae1('0x7')]+=0x1;}if(_0x349a18[_0x11bacb][_0xcae1('0x4e')]==='1'){this[_0xcae1('0x1')]+=0x1;}if(_0x349a18[_0x11bacb]['paused']==='1'&&!['2','7','8']['includes'](_0x349a18[_0x11bacb][_0xcae1('0x4f')])){this[_0xcae1('0x10')]+=0x1;}switch(_0x349a18[_0x11bacb][_0xcae1('0x4f')]){case'0':this[_0xcae1('0x1f')]+=0x1;break;case'1':this[_0xcae1('0x49')]+=0x1;break;case'2':this[_0xcae1('0x5')]+=0x1;break;case'3':this[_0xcae1('0x17')]+=0x1;break;case'4':this[_0xcae1('0x18')]+=0x1;break;case'5':this[_0xcae1('0x1e')]+=0x1;break;case'6':this[_0xcae1('0x0')]+=0x1;break;case'7':this[_0xcae1('0x1a')]+=0x1;break;case'8':this[_0xcae1('0x19')]+=0x1;break;}}if(this['dialMethod']===_0xcae1('0x50')){var _0xcad695=Object[_0xcae1('0x51')](_0x43f389);for(var _0x258630=0x0;_0x258630<_0xcad695[_0xcae1('0x4c')];_0x258630++){var _0x3ccfb4=_0xcad695[_0x258630];var _0x9ef6d4=_0x43f389[_0x3ccfb4];if(_0x9ef6d4[_0xcae1('0x52')]===this[_0xcae1('0x14')]&&_0x9ef6d4[_0xcae1('0x1d')]===_0xcae1('0x53')&&_0x9ef6d4[_0xcae1('0x54')]==='xcally-motion-preview'){this[_0xcae1('0x1')]+=0x1;}}if(this[_0xcae1('0x1')]>this[_0xcae1('0x5')]){this['talking']=this[_0xcae1('0x5')];}this[_0xcae1('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x55')]=function(_0x5282ac){var _0x2efd37=![];if(_0x5282ac){_0x2efd37=INBOUND_COUNTERS[_0xcae1('0x56')](function(_0x1b40b9){return this[_0x1b40b9]!==_0x5282ac[_0x1b40b9];},this);}return _0x2efd37;};VoiceQueueSummary['prototype'][_0xcae1('0x57')]=function(_0x16b1b2){var _0x90b0ad=![];var _0x4e5d01=![];var _0x303b98=![];if(_0x16b1b2){_0x90b0ad=this[_0xcae1('0x23')]!==_0x16b1b2['dialMethod']||this[_0xcae1('0x22')]!==_0x16b1b2[_0xcae1('0x22')]||this[_0xcae1('0x42')]!==_0x16b1b2['message']||this[_0xcae1('0x43')]!==_0x16b1b2[_0xcae1('0x43')];_0x4e5d01=OUTBOUND_COUNTERS['some'](function(_0x4b68d1){return this[_0x4b68d1]!==_0x16b1b2[_0x4b68d1];},this);if(this[_0xcae1('0x44')]&&_0x16b1b2[_0xcae1('0x44')]){_0x303b98=this[_0xcae1('0x44')][_0xcae1('0x14')]!==_0x16b1b2['Trunk'][_0xcae1('0x14')]||this[_0xcae1('0x44')]['active']!==_0x16b1b2[_0xcae1('0x44')][_0xcae1('0x45')];}}return _0x90b0ad||_0x4e5d01||_0x303b98;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x58')]=function(_0x1de80e){this[_0xcae1('0x4')]=_0x1de80e[_0xcae1('0x4')];this[_0xcae1('0x42')]=_0x1de80e[_0xcae1('0x42')];this['statusMessage']=_0x1de80e['statusMessage'];this[_0xcae1('0x8')]=_0x1de80e['originated'];this['outboundAbandonedCallsDay']=_0x1de80e[_0xcae1('0x9')];this[_0xcae1('0xa')]=_0x1de80e[_0xcae1('0xa')];this[_0xcae1('0xb')]=_0x1de80e[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x1de80e[_0xcae1('0xc')];this[_0xcae1('0x59')]=_0x1de80e[_0xcae1('0x59')];this[_0xcae1('0x2d')]=_0x1de80e[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x1de80e['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x1de80e[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x1de80e[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x1de80e[_0xcae1('0x2f')];this['sumBillable']=_0x1de80e[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x1de80e[_0xcae1('0x12')];this[_0xcae1('0x13')]=_0x1de80e[_0xcae1('0x13')];if(this[_0xcae1('0x23')]===_0xcae1('0x5a')){this[_0xcae1('0x11')]=_0x1de80e[_0xcae1('0x11')];}};module[_0xcae1('0x5b')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0ce995f..1f82a40 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 _0x19dd=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0x337631,_0x436102){var _0xcc1f6c=function(_0x2836da){while(--_0x2836da){_0x337631['push'](_0x337631['shift']());}};_0xcc1f6c(++_0x436102);}(_0x19dd,0x1b2));var _0xd19d=function(_0x232f4b,_0x2377bd){_0x232f4b=_0x232f4b-0x0;var _0x2df97f=_0x19dd[_0x232f4b];return _0x2df97f;};'use strict';function VtigerAccount(_0x38df3b){this['id']=_0x38df3b['id']||0x0;this[_0xd19d('0x0')]=_0x38df3b[_0xd19d('0x0')]||'';this[_0xd19d('0x1')]=_0x38df3b[_0xd19d('0x1')]||'';this[_0xd19d('0x2')]=_0x38df3b[_0xd19d('0x2')]||'';this[_0xd19d('0x3')]=_0x38df3b[_0xd19d('0x3')]||'';this[_0xd19d('0x4')]=_0x38df3b[_0xd19d('0x4')]||'';this['Configurations']=_0x38df3b[_0xd19d('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xcc5f=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x4e3ddd,_0x354180){var _0x1298a7=function(_0x276982){while(--_0x276982){_0x4e3ddd['push'](_0x4e3ddd['shift']());}};_0x1298a7(++_0x354180);}(_0xcc5f,0x162));var _0xfcc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc5f[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x13396a){this['id']=_0x13396a['id']||0x0;this[_0xfcc5('0x0')]=_0x13396a['name']||'';this[_0xfcc5('0x1')]=_0x13396a[_0xfcc5('0x1')]||'';this['accessKey']=_0x13396a['accessKey']||'';this['remoteUri']=_0x13396a[_0xfcc5('0x2')]||'';this[_0xfcc5('0x3')]=_0x13396a[_0xfcc5('0x3')]||'';this[_0xfcc5('0x4')]=_0x13396a[_0xfcc5('0x4')]||{};}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 a868847..8301c94 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 _0xa821=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x4e3b9c,_0x1ba5f4){var _0x3cf031=function(_0x2f1b5d){while(--_0x2f1b5d){_0x4e3b9c['push'](_0x4e3b9c['shift']());}};_0x3cf031(++_0x1ba5f4);}(_0xa821,0x156));var _0x1a82=function(_0x3e5e60,_0x5ed4f0){_0x3e5e60=_0x3e5e60-0x0;var _0x3b7a2b=_0xa821[_0x3e5e60];return _0x3b7a2b;};'use strict';function ZendeskAccount(_0x43775b){this['id']=_0x43775b['id']||0x0;this[_0x1a82('0x0')]=_0x43775b[_0x1a82('0x0')]||'';this[_0x1a82('0x1')]=_0x43775b[_0x1a82('0x1')]||'';this[_0x1a82('0x2')]=_0x43775b[_0x1a82('0x2')]||'';this[_0x1a82('0x3')]=_0x43775b[_0x1a82('0x3')]||'';this['remoteUri']=_0x43775b[_0x1a82('0x4')]||'';this['authType']=_0x43775b[_0x1a82('0x5')]||'';this[_0x1a82('0x6')]=_0x43775b[_0x1a82('0x6')]||'integrationTab';this['serverUrl']=_0x43775b[_0x1a82('0x7')]||'';this['Configurations']=_0x43775b[_0x1a82('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5404=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5404,0xdd));var _0x4540=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5404[_0x19950b];return _0x3c6b41;};'use strict';function ZendeskAccount(_0xae2598){this['id']=_0xae2598['id']||0x0;this[_0x4540('0x0')]=_0xae2598[_0x4540('0x0')]||'';this[_0x4540('0x1')]=_0xae2598['username']||'';this[_0x4540('0x2')]=_0xae2598[_0x4540('0x2')]||'';this[_0x4540('0x3')]=_0xae2598[_0x4540('0x3')]||'';this['remoteUri']=_0xae2598[_0x4540('0x4')]||'';this[_0x4540('0x5')]=_0xae2598['authType']||'';this[_0x4540('0x6')]=_0xae2598['type']||_0x4540('0x7');this[_0x4540('0x8')]=_0xae2598['serverUrl']||'';this[_0x4540('0x9')]=_0xae2598[_0x4540('0x9')]||{};}module[_0x4540('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 34b5ca4..f61cab5 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 _0xf19f=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x2bd4f0,_0x398d13){var _0x4e794e=function(_0x59be89){while(--_0x59be89){_0x2bd4f0['push'](_0x2bd4f0['shift']());}};_0x4e794e(++_0x398d13);}(_0xf19f,0xfd));var _0xff19=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xf19f[_0x31ced5];return _0x10d9e5;};'use strict';function ZohoAccount(_0x1d2857){this['id']=_0x1d2857['id']||0x0;this[_0xff19('0x0')]=_0x1d2857[_0xff19('0x0')]||'';this[_0xff19('0x1')]=_0x1d2857[_0xff19('0x1')]||'';this[_0xff19('0x2')]=_0x1d2857['host']||'';this[_0xff19('0x3')]=_0x1d2857[_0xff19('0x3')]||'';this[_0xff19('0x4')]=_0x1d2857['clientId']||'';this[_0xff19('0x5')]=_0x1d2857[_0xff19('0x5')]||'';this[_0xff19('0x6')]=_0x1d2857[_0xff19('0x6')]||'';this[_0xff19('0x7')]=_0x1d2857[_0xff19('0x7')]||'';this[_0xff19('0x8')]=_0x1d2857[_0xff19('0x8')]||'';this[_0xff19('0x9')]=_0x1d2857[_0xff19('0x9')]||{};}module[_0xff19('0xa')]=ZohoAccount; \ No newline at end of file +var _0xf5ff=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4b304b,_0x3ca867){var _0x2a1baf=function(_0x9fb7eb){while(--_0x9fb7eb){_0x4b304b['push'](_0x4b304b['shift']());}};_0x2a1baf(++_0x3ca867);}(_0xf5ff,0xff));var _0xff5f=function(_0x3d7e29,_0x962572){_0x3d7e29=_0x3d7e29-0x0;var _0x10eedb=_0xf5ff[_0x3d7e29];return _0x10eedb;};'use strict';function ZohoAccount(_0x399f56){this['id']=_0x399f56['id']||0x0;this[_0xff5f('0x0')]=_0x399f56['name']||'';this[_0xff5f('0x1')]=_0x399f56[_0xff5f('0x1')]||'';this[_0xff5f('0x2')]=_0x399f56[_0xff5f('0x2')]||'';this['zone']=_0x399f56[_0xff5f('0x3')]||'';this[_0xff5f('0x4')]=_0x399f56[_0xff5f('0x4')]||'';this[_0xff5f('0x5')]=_0x399f56[_0xff5f('0x5')]||'';this[_0xff5f('0x6')]=_0x399f56['serverUrl']||'';this[_0xff5f('0x7')]=_0x399f56[_0xff5f('0x7')]||'';this[_0xff5f('0x8')]=_0x399f56[_0xff5f('0x8')]||'';this[_0xff5f('0x9')]=_0x399f56[_0xff5f('0x9')]||{};}module[_0xff5f('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 90ce7d2..117c5bd 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 _0x4bd3=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','queue'];(function(_0x51a970,_0xcd4a22){var _0xdd4315=function(_0x222142){while(--_0x222142){_0x51a970['push'](_0x51a970['shift']());}};_0xdd4315(++_0xcd4a22);}(_0x4bd3,0x174));var _0x34bd=function(_0x45d3de,_0x3b5c71){_0x45d3de=_0x45d3de-0x0;var _0x272ddc=_0x4bd3[_0x45d3de];return _0x272ddc;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));function checkNameSurname(_0x22a9f9,_0x5369c1,_0x4997bc){var _0x4cad21='';if(!_[_0x34bd('0x2')](_0x5369c1)&&_0x34bd('0x3')===typeof _0x5369c1){_0x4cad21+=_0x5369c1;}if(!_[_0x34bd('0x2')](_0x4997bc)&&'string'===typeof _0x4997bc){_0x4cad21+='\x20'+_0x4997bc;}if(_0x4cad21!==''){return _0x4cad21;}return _0x22a9f9;}function Action(_0x2133c5,_0x2a15a2,_0x5c2a7a,_0x3e8744,_0x213716){this['uniqueid']=_0x5c2a7a||undefined;this[_0x34bd('0x4')]=_0x2133c5['id'];this[_0x34bd('0x5')]=_0x2a15a2[_0x34bd('0x6')];this[_0x34bd('0x7')]=_0x2a15a2[_0x34bd('0x7')];this[_0x34bd('0x8')]='queue';this[_0x34bd('0x9')]=![];this[_0x34bd('0xa')]=_[_0x34bd('0x2')](_0x2133c5[_0x34bd('0xb')])?undefined:_0x2133c5['Agent']['name'];this[_0x34bd('0xc')]=this['membername']?util['format'](_0x34bd('0xd'),this[_0x34bd('0xa')]):_0x3e8744||undefined;this[_0x34bd('0xe')]=checkNameSurname(_0x2133c5[_0x34bd('0xf')][_0x34bd('0x10')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x11')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x12')]);this['active']=_0x2133c5[_0x34bd('0x13')]||![];this['calleridnum']=_0x2133c5['phone'];this[_0x34bd('0x14')]=_0x2133c5[_0x34bd('0x14')];this[_0x34bd('0x15')]=_0x2133c5[_0x34bd('0x15')]||0x0;this[_0x34bd('0x16')]=_0x2133c5[_0x34bd('0x16')]||0x0;this[_0x34bd('0x17')]=_0x2133c5[_0x34bd('0x17')]||0x0;this[_0x34bd('0x18')]=(_0x2133c5[_0x34bd('0x15')]||0x0)+(_0x2133c5[_0x34bd('0x16')]||0x0)+(_0x2133c5['countnoanswerretry']||0x0)+(_0x2133c5[_0x34bd('0x19')]||0x0)+(_0x2133c5[_0x34bd('0x1a')]||0x0)+(_0x2133c5[_0x34bd('0x1b')]||0x0)+(_0x2133c5[_0x34bd('0x1c')]||0x0)+(_0x2133c5[_0x34bd('0x1d')]||0x0);this[_0x34bd('0x19')]=_0x2133c5[_0x34bd('0x19')]||0x0;this[_0x34bd('0x1a')]=_0x2133c5[_0x34bd('0x1a')]||0x0;this['countabandonedretry']=_0x2133c5[_0x34bd('0x1b')]||0x0;this[_0x34bd('0x1c')]=_0x2133c5[_0x34bd('0x1c')]||0x0;this[_0x34bd('0x1d')]=_0x2133c5[_0x34bd('0x1d')]||0x0;this['callback']=_0x2133c5['callback'];this['callbackuniqueid']=_0x2133c5['callbackuniqueid'];this[_0x34bd('0x1e')]=_0x2133c5['callbackat'];this[_0x34bd('0x1f')]=_0x2133c5[_0x34bd('0x1f')];this[_0x34bd('0x20')]=_0x2133c5['ContactId'];this[_0x34bd('0x21')]=_0x2133c5[_0x34bd('0x21')];this[_0x34bd('0x22')]=_[_0x34bd('0x2')](_0x2133c5['Agent'])?_0x2133c5[_0x34bd('0x22')]:_0x2133c5[_0x34bd('0xb')]['id'];this[_0x34bd('0x23')]=_0x2133c5[_0x34bd('0x23')];this['originatecalleridnum']='';this[_0x34bd('0x24')]='';}Action[_0x34bd('0x25')]['getCaller']=function(){return util[_0x34bd('0x26')](_0x34bd('0x27'),this[_0x34bd('0xe')],this[_0x34bd('0x28')]);};module[_0x34bd('0x29')]=Action; \ No newline at end of file +var _0xb78e=['Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname'];(function(_0x40e74c,_0x1883a2){var _0x3a8c6b=function(_0x1a4ae4){while(--_0x1a4ae4){_0x40e74c['push'](_0x40e74c['shift']());}};_0x3a8c6b(++_0x1883a2);}(_0xb78e,0x1c9));var _0xeb78=function(_0x22552e,_0x240b36){_0x22552e=_0x22552e-0x0;var _0x2decbb=_0xb78e[_0x22552e];return _0x2decbb;};'use strict';var util=require(_0xeb78('0x0'));var _=require(_0xeb78('0x1'));var moment=require('moment');function checkNameSurname(_0x1570f5,_0x2785f9,_0xb198c1){var _0x2520cf='';if(!_[_0xeb78('0x2')](_0x2785f9)&&_0xeb78('0x3')===typeof _0x2785f9){_0x2520cf+=_0x2785f9;}if(!_[_0xeb78('0x2')](_0xb198c1)&&_0xeb78('0x3')===typeof _0xb198c1){_0x2520cf+='\x20'+_0xb198c1;}if(_0x2520cf!==''){return _0x2520cf;}return _0x1570f5;}function Action(_0x57ec6b,_0x3c35e7,_0x17a736,_0x1ccc2f,_0x30c884){this[_0xeb78('0x4')]=_0x17a736||undefined;this[_0xeb78('0x5')]=_0x57ec6b['id'];this[_0xeb78('0x6')]=_0x3c35e7['name'];this[_0xeb78('0x7')]=_0x3c35e7[_0xeb78('0x7')];this[_0xeb78('0x8')]=_0xeb78('0x6');this[_0xeb78('0x9')]=![];this[_0xeb78('0xa')]=_[_0xeb78('0x2')](_0x57ec6b[_0xeb78('0xb')])?undefined:_0x57ec6b[_0xeb78('0xb')]['name'];this[_0xeb78('0xc')]=this[_0xeb78('0xa')]?util[_0xeb78('0xd')](_0xeb78('0xe'),this[_0xeb78('0xa')]):_0x1ccc2f||undefined;this[_0xeb78('0xf')]=checkNameSurname(_0x57ec6b[_0xeb78('0x10')][_0xeb78('0x11')],_0x57ec6b[_0xeb78('0x10')][_0xeb78('0x12')],_0x57ec6b['Contact'][_0xeb78('0x13')]);this[_0xeb78('0x14')]=_0x57ec6b['active']||![];this['calleridnum']=_0x57ec6b['phone'];this[_0xeb78('0x15')]=_0x57ec6b['scheduledat'];this[_0xeb78('0x16')]=_0x57ec6b[_0xeb78('0x16')]||0x0;this['countcongestionretry']=_0x57ec6b[_0xeb78('0x17')]||0x0;this['countnoanswerretry']=_0x57ec6b[_0xeb78('0x18')]||0x0;this[_0xeb78('0x19')]=(_0x57ec6b['countbusyretry']||0x0)+(_0x57ec6b[_0xeb78('0x17')]||0x0)+(_0x57ec6b[_0xeb78('0x18')]||0x0)+(_0x57ec6b[_0xeb78('0x1a')]||0x0)+(_0x57ec6b['countdropretry']||0x0)+(_0x57ec6b[_0xeb78('0x1b')]||0x0)+(_0x57ec6b[_0xeb78('0x1c')]||0x0)+(_0x57ec6b['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x57ec6b[_0xeb78('0x1a')]||0x0;this[_0xeb78('0x1d')]=_0x57ec6b[_0xeb78('0x1d')]||0x0;this[_0xeb78('0x1b')]=_0x57ec6b[_0xeb78('0x1b')]||0x0;this[_0xeb78('0x1c')]=_0x57ec6b[_0xeb78('0x1c')]||0x0;this[_0xeb78('0x1e')]=_0x57ec6b[_0xeb78('0x1e')]||0x0;this['callback']=_0x57ec6b['callback'];this['callbackuniqueid']=_0x57ec6b['callbackuniqueid'];this[_0xeb78('0x1f')]=_0x57ec6b['callbackat'];this[_0xeb78('0x20')]=_0x57ec6b[_0xeb78('0x20')];this['ContactId']=_0x57ec6b[_0xeb78('0x21')];this['ListId']=_0x57ec6b[_0xeb78('0x22')];this[_0xeb78('0x23')]=_[_0xeb78('0x2')](_0x57ec6b[_0xeb78('0xb')])?_0x57ec6b['UserId']:_0x57ec6b[_0xeb78('0xb')]['id'];this['VoiceQueueId']=_0x57ec6b[_0xeb78('0x24')];this[_0xeb78('0x25')]='';this[_0xeb78('0x26')]='';}Action['prototype'][_0xeb78('0x27')]=function(){return util[_0xeb78('0xd')](_0xeb78('0x28'),this[_0xeb78('0xf')],this[_0xeb78('0x29')]);};module[_0xeb78('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 0e8307d..474d7be 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 _0x00bb=['swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','run','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','syncVarSet','filterKey','keys','variable','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./util/util','../dialer/utils','redis','defaults','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','syncHangupRequest','syncDialEnd','bind','newexten','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','paused','INACTIVE','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','queue','originated:\x20','stringify','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','loggedIn','NO_AGENTS_LOGGED','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','\x20Queue','pTalking:\x20','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var uuid=require(_0xb00b('0x2'));var moment=require('moment');var Redis=require(_0xb00b('0x3'));var config=require('../../../config/environment');var logger=require(_0xb00b('0x4'))(_0xb00b('0x5'));var loggerAction=require('../../../config/logger')(_0xb00b('0x6'));var ami=require(_0xb00b('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0xb00b('0x8'));var utils=require(_0xb00b('0x9'));config[_0xb00b('0xa')]=_[_0xb00b('0xb')](config[_0xb00b('0xa')],{'host':_0xb00b('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb00b('0xd')][_0xb00b('0xe')]=function(_0x5851d4){this[_0xb00b('0xf')]=this[_0xb00b('0xf')]?this['tail'][_0xb00b('0x10')](_0x5851d4):_0x5851d4();};function Preview(_0x5a63ed){this['sequence']=new Sequence();this['campaignsPreview']=_0x5a63ed[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x5a63ed[_0xb00b('0x12')];this[_0xb00b('0x13')]={};this[_0xb00b('0x14')]=_0x5a63ed[_0xb00b('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0xb00b('0x15'),this[_0xb00b('0x16')]['bind'](this));ami['on'](_0xb00b('0x17'),this[_0xb00b('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xb00b('0x19')]['bind'](this));ami['on']('dialend',this[_0xb00b('0x1a')][_0xb00b('0x1b')](this));ami['on'](_0xb00b('0x1c'),this[_0xb00b('0x1d')]['bind'](this));ami['on'](_0xb00b('0x1e'),this['syncVarSet'][_0xb00b('0x1b')](this));ami['on']('attendedtransfer',this[_0xb00b('0x1f')]['bind'](this));ami['on'](_0xb00b('0x20'),this[_0xb00b('0x21')]['bind'](this));this['loopCampaigns'](this[_0xb00b('0x22')]);}function emit(_0x4a334b,_0x1344c4,_0x43da66){io['to'](_0x4a334b)[_0xb00b('0x23')](_0x1344c4,_0x43da66);}function emitVoiceQueueChannelRemove(_0x3501af){logger['info'](_0xb00b('0x24'),JSON['stringify'](_0x3501af));emit(util[_0xb00b('0x25')](_0xb00b('0x26'),_0x3501af['name']),_0xb00b('0x27'),_0x3501af);io[_0xb00b('0x23')]('voice_queue_presence:remove',_0x3501af);}function notSendMessagesQueue(_0x3ab3cc){if(_0x3ab3cc[_0xb00b('0x28')]){if(_0x3ab3cc['originated']===0x0&&_0x3ab3cc[_0xb00b('0x29')]===0x0){_0x3ab3cc[_0xb00b('0x28')]=![];_0x3ab3cc[_0xb00b('0x2a')]=0x0;_0x3ab3cc[_0xb00b('0x2b')]=0x0;_0x3ab3cc['message']=utils['CAMPAIGN_STATUS'][_0xb00b('0x2c')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3ab3cc['name']+_0xb00b('0x2d'));}else{_0x3ab3cc[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x30')];ut[_0xb00b('0x31')](_0xb00b('0x32'),_0x3ab3cc[_0xb00b('0x33')]+'\x20is\x20deactivated');}}}Preview[_0xb00b('0xd')]['loopCampaigns']=function(){var _0x450129=this;setInterval(function(){_0x450129[_0xb00b('0x34')]();},0x7cf);};Preview[_0xb00b('0xd')]['syncCampaigns']=function(){var _0x2fc11a=this[_0xb00b('0x22')];this[_0xb00b('0x35')]+=0x1;for(var _0x183233 in _0x2fc11a){if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&(_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x5')||_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x38'))&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(this[_0xb00b('0x35')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xb00b('0x3a')]();}}if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&_0x2fc11a[_0x183233]['dialMethod']===_0xb00b('0x5')&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(_0x2fc11a[_0x183233][_0xb00b('0x3b')]){this[_0xb00b('0x3c')](_0x2fc11a[_0x183233]);if(_0x2fc11a[_0x183233][_0xb00b('0x3d')])this[_0xb00b('0x3e')](_0x2fc11a[_0x183233]);}else{notSendMessagesQueue(_0x2fc11a[_0x183233]);}}}};Preview[_0xb00b('0xd')][_0xb00b('0x3f')]=function(_0x594840){var _0x57e8f9=this;this['sequence'][_0xb00b('0xe')](function(){if(!_[_0xb00b('0x40')](_0x57e8f9[_0xb00b('0x13')][_0x594840])){loggerAction[_0xb00b('0x41')]('[clearZombieChannels][talking]',_0x594840,_0xb00b('0x42'),_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')],_0xb00b('0x44'),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]]['originated']),'pTalking:\x20',JSON[_0xb00b('0x45')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]][_0xb00b('0x29')]),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x46')]),JSON[_0xb00b('0x45')](_['pick'](_0x57e8f9[_0xb00b('0x13')][_0x594840],[_0xb00b('0x47'),_0xb00b('0x48'),_0xb00b('0x49'),_0xb00b('0x4a')])));return ami[_0xb00b('0x4b')]({'action':'status','channel':_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x4c')]})['catch'](function(_0x17ff34){if(_0x17ff34[_0xb00b('0x2e')]===_0xb00b('0x4d')){setTimeout(function(){if(_0x57e8f9[_0xb00b('0x13')][_0x594840]){ut[_0xb00b('0x4e')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));if(_0x57e8f9[_0xb00b('0x13')][_0x594840]['dialAnswer']===!![]){ut['decrementTalkink'](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));ut[_0xb00b('0x50')](_0xb00b('0x51')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840]['queue']);}ut[_0xb00b('0x50')](_0xb00b('0x52')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]);delete _0x57e8f9[_0xb00b('0x13')][_0x594840];}},0x2328);}});}});};Preview[_0xb00b('0xd')][_0xb00b('0x3a')]=function(){var _0x974a29=this;loggerAction[_0xb00b('0x41')](_0xb00b('0x53'),_[_0xb00b('0x54')](this[_0xb00b('0x13')]));for(var _0x577bad in this[_0xb00b('0x13')]){if(_0x974a29[_0xb00b('0x13')][_0xb00b('0x36')](_0x577bad)){_0x974a29[_0xb00b('0x3f')](_0x577bad);}}};Preview[_0xb00b('0xd')][_0xb00b('0x3e')]=function(_0xd97f49){var _0x1b4f09=this;rpcDb[_0xb00b('0x55')](_0xd97f49['id'],ut[_0xb00b('0x56')](this[_0xb00b('0x14')]))[_0xb00b('0x57')](function(_0x5dbe00){if(!_['isNil'](_0x5dbe00)){for(var _0x47c6c0=0x0;_0x47c6c0<_0x5dbe00[_0xb00b('0x58')];_0x47c6c0+=0x1){if(ut[_0xb00b('0x59')](_0x5dbe00[_0x47c6c0]['scheduledat'])<_0xd97f49[_0xb00b('0x5a')]*0x3c){if(_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')]&&!_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')][_0xb00b('0x5c')]){_0x1b4f09['run'](_0x5dbe00[_0x47c6c0]['id'])['then'](ut[_0xb00b('0x5d')](_0xb00b('0x5e')))['catch'](ut['logger2'](_0xb00b('0x5e')));}else{rpcDb[_0xb00b('0x5f')](_0x5dbe00[_0x47c6c0]['id']);}}else{var _0x4e0be4=new Action(_0x5dbe00[_0x47c6c0],_0xd97f49);_0x4e0be4[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd97f49['outboundReCallsDay']+=0x1;ut[_0xb00b('0x61')](_0x4e0be4,0x17,'RecallInQueue');if(_0xd97f49[_0xb00b('0x62')]){rpcDb[_0xb00b('0x63')](ut[_0xb00b('0x64')](_0x5dbe00[_0x47c6c0]));rpcDb[_0xb00b('0x65')](_0x4e0be4,_0xb00b('0x66'));}else{ut[_0xb00b('0x61')](_0x4e0be4,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x4e0be4,_0xb00b('0x67'));rpcDb[_0xb00b('0x68')](_0x4e0be4,'[HistoryRecallClose]');}}}}})[_0xb00b('0x69')](ut[_0xb00b('0x5d')]('[getContactRecallMe]'));};Preview[_0xb00b('0xd')][_0xb00b('0x3c')]=function(_0x3b5d82){_0x3b5d82['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x3b5d82[_0xb00b('0x6a')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6b')];}else if(!ut['isActive'](_0x3b5d82[_0xb00b('0x3b')])){_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS']['INACTIVE'];}else if(!this[_0xb00b('0x6c')](_0x3b5d82['Trunk'])){if(!this[_0xb00b('0x6c')](_0x3b5d82[_0xb00b('0x6d')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6e')];}else{_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS'][_0xb00b('0x6f')];}}else{_0x3b5d82['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];}};Preview[_0xb00b('0xd')]['callProgressDetectingCustomer']=function(_0x248335,_0x25f1f6,_0x4ba53a){var _0x598a55=this;var _0x24e826=this[_0xb00b('0x13')][_0x25f1f6];var _0x219b74=this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]];var _0x279467;var _0x347949=![];var _0x3a0b90=0x2;var _0x4c3067=0x3;if(_0x219b74){switch(_0x4ba53a){case'1':_0x219b74[_0xb00b('0x70')]+=0x1;_0x24e826[_0xb00b('0x71')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x0,_0xb00b('0x73'));ami[_0xb00b('0x23')](_0xb00b('0x74'),ut[_0xb00b('0x75')](_0x24e826,'nosuchnumber'));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x76'));_0x598a55[_0xb00b('0x77')](_0x24e826,'0',_0x219b74)[_0xb00b('0x57')](function(_0x4b1e5f){_0x347949=_0x4b1e5f[_0xb00b('0x78')]==0x1;_0x3a0b90=_0x219b74[_0xb00b('0x79')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb['createCustomerFinal'](_0x279467,_0xb00b('0x7f'));}else{if(_0x24e826['countnosuchnumberretry']>=_0x219b74[_0xb00b('0x80')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0x7f'));}else{rpcDb['rescheduleContact'](ut[_0xb00b('0x81')](_0x24e826,'countnosuchnumberretry',_0x219b74[_0xb00b('0x79')]),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}delete this['actions'][_0x248335['linkedid']];}else{_0x24e826['countnosuchnumberretry']++;logger[_0xb00b('0x41')](_0xb00b('0x84'),_0x24e826[_0xb00b('0x71')]);logger['info']('id',_0x24e826[_0xb00b('0x85')]);_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnosuchnumberretry':_0x24e826[_0xb00b('0x71')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0x87'):var _0x5622a4=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x24e826[_0xb00b('0x89')]=_0x5622a4;_0x24e826['answertime']=_0x5622a4;_0x24e826['dialAnswer']=!![];_0x219b74[_0xb00b('0x29')]+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x8a'),_0x24e826['uniqueid'],'\x20Queue',_0x219b74['name'],'pTalking:\x20',_0x219b74[_0xb00b('0x29')]);ami['emit'](_0xb00b('0x8b'),ut[_0xb00b('0x75')](_0x24e826,'connect',this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));if(_0x219b74[_0xb00b('0x8c')]){ami[_0xb00b('0x23')](_0xb00b('0x8d'),ut['buildAcw'](_0x24e826));}break;case'16':ami[_0xb00b('0x23')](_0xb00b('0x8e'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0x8f'),this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));emitVoiceQueueChannelRemove(ut[_0xb00b('0x75')](_0x24e826,'complete'));_0x219b74[_0xb00b('0x90')]+=0x1;_0x219b74[_0xb00b('0x91')]+=0x1;_0x219b74[_0xb00b('0x92')]+=0x1;ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0x94'));_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x4,'Answer');rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x95'));rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0x96'));rpcDb[_0xb00b('0x97')](_0x24e826);_0x219b74[_0xb00b('0x98')]+=_0x24e826[_0xb00b('0x99')];_0x219b74[_0xb00b('0x9a')]+=_0x24e826['talktime'];logger[_0xb00b('0x41')](_0xb00b('0x9b'),_0x24e826[_0xb00b('0x9c')],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x9e'),_0x219b74[_0xb00b('0x29')]);delete this['actions'][_0x248335[_0xb00b('0x9f')]];break;case _0xb00b('0xa0'):_0x219b74[_0xb00b('0xa1')]+=0x1;_0x24e826[_0xb00b('0xa2')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x5,_0xb00b('0xa3'));_0x3a0b90=_0x219b74['dialBusyRetryFrequency'];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami['emit'](_0xb00b('0xa4'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xa5')));rpcDb['createCustomerHistory'](_0x24e826,'[callProgressDetectingCustomer][logBusy]');_0x598a55[_0xb00b('0x77')](_0x24e826,'5',_0x219b74)[_0xb00b('0x57')](function(_0x33a483){_0x347949=_0x33a483[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xa6'));}else{if(_0x24e826[_0xb00b('0xa2')]>=_0x219b74[_0xb00b('0xa7')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xa8'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x24e826,_0xb00b('0xa2'),_0x219b74[_0xb00b('0xa9')]),_0x24e826['unlockAgent'],_0x24e826['activeContact']);}}}else{_0x24e826[_0xb00b('0xa2')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countbusyretry':_0x24e826['countbusyretry']}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xab'):_0x219b74[_0xb00b('0xac')]+=0x1;_0x24e826[_0xb00b('0xad')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x3,'NoAnswer');_0x3a0b90=_0x219b74[_0xb00b('0xae')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];var _0x545dfd=ut[_0xb00b('0xaf')](_0x24e826,_0x219b74);ami[_0xb00b('0x23')](_0xb00b('0xb0'),_0x545dfd);rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xb1'));_0x598a55[_0xb00b('0x77')](_0x24e826,'3',_0x219b74)[_0xb00b('0x57')](function(_0x2423b2){_0x347949=_0x2423b2[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,'Global');rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xb2'));}else{if(_0x24e826[_0xb00b('0xad')]>=_0x219b74[_0xb00b('0xb3')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0xb1'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xad'),_0x219b74[_0xb00b('0xae')]),_0x24e826['unlockAgent'],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826['countnoanswerretry']}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xb5'):_0x219b74[_0xb00b('0xb6')]+=0x1;_0x24e826[_0xb00b('0xb7')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x8,_0xb00b('0xb8'));_0x3a0b90=_0x219b74[_0xb00b('0xb9')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami[_0xb00b('0x23')]('custom:agentcongestion',ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xba')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xbb'));_0x598a55['verifyAdditionalPhones'](_0x24e826,'8',_0x219b74)[_0xb00b('0x57')](function(_0xb27b8b){_0x347949=_0xb27b8b['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x24e826[_0xb00b('0xb7')]>=_0x219b74[_0xb00b('0xbc')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xbb'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xb7'),_0x219b74[_0xb00b('0xa9')]),_0x24e826[_0xb00b('0x82')],_0x24e826['activeContact']);}}}else{_0x24e826['countcongestionretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countcongestionretry':_0x24e826[_0xb00b('0xb7')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xbd'):_0x219b74['outboundRejectCallsDay']+=0x1;_0x24e826[_0xb00b('0xbe')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x14,_0xb00b('0xbf'));_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74['callAdditionalPhoneAfterMin'];ami[_0xb00b('0x23')](_0xb00b('0xc1'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xc2')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xc3'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x55ea09){_0x347949=_0x55ea09[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x14,'AgentReject');rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x24e826[_0xb00b('0xbe')]>=_0x219b74['dialAgentRejectMaxRetry']){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xc4'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xbe'),_0x219b74['dialAgentRejectRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826['countnoanswerretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826['idContact'],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'ABANDONED':_0x219b74[_0xb00b('0xc5')]+=0x1;_0x24e826[_0xb00b('0xc6')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xc7'));_0x598a55[_0xb00b('0x77')](_0x24e826,'11',_0x219b74)[_0xb00b('0x57')](function(_0x2d5652){_0x347949=_0x2d5652[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut['totalGlobal'](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xc7'));}else{if(_0x24e826[_0xb00b('0xc8')]>=_0x219b74[_0xb00b('0xc9')]){rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb00b('0xb4')](ut['scheduledAt'](_0x24e826,_0xb00b('0xc6'),_0x219b74['dialAbandonedRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'18':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0xcb')]+=0x1;_0x24e826['countglobal']=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x12,_0x248335[_0xb00b('0xcc')]||_0x248335[_0xb00b('0xcd')]);ami['emit'](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,'amd'));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');_0x598a55[_0xb00b('0x77')](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x49fe3f){_0x347949=_0x49fe3f[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x12,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})['then'](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335['linkedid']];break;case'19':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x13,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);ami[_0xb00b('0x23')](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xcf')));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][machine]');_0x598a55['verifyAdditionalPhones'](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x23d306){_0x347949=_0x23d306[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut['cloneAction'](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd0'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd0'));}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55['incrementPreviewCounters']({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];break;default:if(_0x24e826[_0xb00b('0x46')]){ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0xd1'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x219b74[_0xb00b('0x33')],_0x248335);}_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut['logCustomer'](_0x24e826,0xc,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xd2'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x142674){_0x347949=_0x142674['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd3'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd3'));}delete this['actions'][_0x248335[_0xb00b('0x9f')]];}else{_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});}});}if(!(_0x24e826[_0xb00b('0x46')]&&_0x4ba53a==='16')){ut[_0xb00b('0x4e')](_0x219b74,_0xb00b('0xd4'));logger[_0xb00b('0x41')](_0xb00b('0xd5'),_0x24e826['uniqueid'],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x44'),_0x219b74[_0xb00b('0xd6')]);}if(_0x4ba53a!=='ANSWER'){delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0xd7')]];}_0x219b74[_0xb00b('0xd8')]=!![];}};Preview[_0xb00b('0xd')][_0xb00b('0xd9')]=function(_0x3184de,_0x48ac4b,_0x5f0fab){if(_[_0xb00b('0xda')](_0x48ac4b)&&_0xb00b('0xdb')!==typeof _0x48ac4b){return;}if(_[_0xb00b('0xda')](_0x5f0fab)&&'object'!==typeof _0x5f0fab){return;}switch(_0x5f0fab[_0xb00b('0xdc')]){case'0':ut[_0xb00b('0xdd')](_0x3184de,0x0,_0xb00b('0x73'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xde'));break;case'3':ut[_0xb00b('0xdd')](_0x3184de,0x3,_0xb00b('0xdf'));rpcDb['createAgentHistory'](_0x3184de,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb00b('0xdd')](_0x3184de,0x5,'Busy');rpcDb[_0xb00b('0xe0')](_0x3184de,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x3184de,0x8,_0xb00b('0xb8'));rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));break;case'22':ut[_0xb00b('0xdd')](_0x3184de,0x16,_0xb00b('0xe2'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xe3'));break;default:ut['logAgent'](_0x3184de,0xc,_0x5f0fab['reason']);rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));}ut[_0xb00b('0x4e')](_0x48ac4b,_0xb00b('0xe4'));logger[_0xb00b('0x41')](_0xb00b('0xe5'),_0x3184de['uniqueid'],_0xb00b('0x9d'),_0x48ac4b['name'],_0xb00b('0x44'),_0x48ac4b[_0xb00b('0xd6')]);delete this[_0xb00b('0x13')][_0x3184de['uniqueid']];};Preview[_0xb00b('0xd')][_0xb00b('0x77')]=function(_0x20790f,_0x3dc8d2,_0x5d224c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20790f,_0x3dc8d2,_0x5d224c)[_0xb00b('0x69')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')]['swapAdditionalPhones']=function(_0x505ae2,_0x2fecca,_0x330bc7){return cmHopperAdditionalPhone[_0xb00b('0xaa')](_0x505ae2,_0x2fecca,_0x330bc7)[_0xb00b('0x69')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')][_0xb00b('0x86')]=function(_0x9facaf){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xb00b('0x86')](_0x9facaf))['catch'](logger['info'](_0xb00b('0xe6')));};Preview['prototype'][_0xb00b('0xe7')]=function(_0x481671,_0x1b751e,_0x5712fd,_0x3de808,_0x3289aa){var _0x1ec560=this;return new Promise(function(_0x54498c,_0x442b28){if(_['isNil'](_0x1b751e)||_[_0xb00b('0x40')](_0x1b751e[_0xb00b('0xe8')])||_['isNil'](_0x1b751e['phone'])||_['isNil'](_0x1b751e['VoiceQueueId'])){_0x442b28(ut[_0xb00b('0x2e')]('Contact\x20is\x20undefined',_0x3de808,_0x3289aa));return;}var _0x134d17=uuid['v4']();var _0x5ad4d4=_0x1ec560[_0xb00b('0x22')][_0x1b751e[_0xb00b('0x42')][_0xb00b('0x33')]];var _0x44b2f1=_0x5712fd?_0x1ec560[_0xb00b('0x14')][_0x5712fd]['id']:undefined;_0x1ec560['actions'][_0x134d17]=new Action(_0x1b751e,_0x5ad4d4,_0x134d17,_0x5712fd,_0x44b2f1);var _0x8292fe=_0x1ec560[_0xb00b('0x13')][_0x134d17];_0x8292fe[_0xb00b('0x82')]=_0x3de808;_0x8292fe[_0xb00b('0x83')]=_0x3289aa;_0x8292fe['lookAgent']=_0x5712fd;if(_['isEmpty'](_0x481671)){_0x1ec560[_0xb00b('0xe9')](_0x8292fe,_0x5ad4d4,_0x1b751e,_0x5712fd)[_0xb00b('0x57')](function(_0x181393){logger[_0xb00b('0x41')](_0xb00b('0xea'),_0xb00b('0xeb')+_0x8292fe[_0xb00b('0x43')]+_0xb00b('0xec')+_0x8292fe[_0xb00b('0x85')],JSON['stringify'](_0x181393));ami[_0xb00b('0x23')](_0xb00b('0xed'),ut['buildObj'](_0x8292fe,_0xb00b('0xee'),_0x1ec560['campaignsPreview'][_0x8292fe[_0xb00b('0x43')]]));_0x54498c(ut[_0xb00b('0x2e')]('Calling'));})['catch'](function(_0x32264a){ut[_0xb00b('0x31')](_0xb00b('0xef'),_0x32264a);_0x442b28(ut['message'](_0xb00b('0xf0'),_0x3de808,_0x3289aa));});}else{_0x5ad4d4[_0xb00b('0xf1')]+=0x1;ut[_0xb00b('0xf2')](_0x8292fe);rpcDb['createHistory'](_0x8292fe,_0xb00b('0xf3'));delete _0x1ec560['actions'][_0x134d17];_0x442b28(ut['message']('Contact\x20in\x20black\x20List',_0x3de808,_0x3289aa));}});};Preview[_0xb00b('0xd')]['isTrunkReachable']=function(_0x1b8d45){return!_[_0xb00b('0x40')](_0x1b8d45)&&!_['isNil'](_0x1b8d45['name'])&&!_[_0xb00b('0x40')](_0x1b8d45[_0xb00b('0xf4')])&&_0x1b8d45['active']&&!_[_0xb00b('0x40')](this[_0xb00b('0x12')][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45[_0xb00b('0x33')])])&&!_[_0xb00b('0x40')](this['trunks'][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')])&&(this['trunks'][util['format'](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf7')||this[_0xb00b('0x12')][util['format']('SIP/%s',_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf8'));};Preview['prototype'][_0xb00b('0xf9')]=function(_0x18e86f,_0x3aa8c0){return this[_0xb00b('0xfa')](_0x18e86f,_0x3aa8c0)[_0xb00b('0x57')](function(_0x166ff5){return _[_0xb00b('0xfb')](_0x166ff5,[_0xb00b('0x2e')]);})['catch'](function(_0x1b097a){if(_0x1b097a[_0xb00b('0xfc')]){rpcDb[_0xb00b('0xfd')](_0x18e86f);}if(_0x1b097a['active']){rpcDb['disableContact'](_0x18e86f);}throw _['pick'](_0x1b097a,[_0xb00b('0x2e')]);});};Preview[_0xb00b('0xd')][_0xb00b('0xfa')]=function(_0x4bc6df,_0x399902){var _0x34985d=this;var _0x2057d1,_0xdee547;return rpcDb[_0xb00b('0xfe')](_0x4bc6df)['then'](function(_0x1674ab){if(!_['isNil'](_0x1674ab[0x0])){_0xdee547=_0x1674ab[0x0][_0xb00b('0xff')]?![]:!![];_0x2057d1=_0x1674ab[0x0][_0xb00b('0xff')]?!![]:![];_0x2057d1=_0x399902?!![]:_0x2057d1;}var _0xde6b5=_0x34985d[_0xb00b('0x100')](_0x1674ab);if(_0xde6b5[_0xb00b('0x101')]){rpcDb[_0xb00b('0x102')](_['pick'](_0x1674ab[0x0],[_0xb00b('0x49'),_0xb00b('0x103')]))[_0xb00b('0x57')](function(_0x278d9e){_0x34985d[_0xb00b('0xe7')](_0x278d9e,_0x1674ab[0x0],_0x399902,_0xdee547,_0x2057d1)[_0xb00b('0x57')](function(_0x26cd15){return _0x26cd15;})[_0xb00b('0x69')](function(_0xd2f1ba){throw _0xd2f1ba;});})[_0xb00b('0x69')](function(_0x5f1258){ut[_0xb00b('0x31')](_0xb00b('0x104'),_0x5f1258);throw ut['message'](_0xb00b('0x105'),_0xdee547,_0x2057d1);});}else{throw ut['message'](_0xde6b5['message'],_0xdee547,_0x2057d1);}})['catch'](function(_0x384a16){ut['logger'](_0xb00b('0x106'),_0x384a16);throw ut[_0xb00b('0x2e')](_0xb00b('0x105'),![],!![]);});};Preview[_0xb00b('0xd')][_0xb00b('0x100')]=function(_0x116ced){if(_[_0xb00b('0x40')](_0x116ced)||_[_0xb00b('0x107')](_0x116ced)||!_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')])&&_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')][_0xb00b('0x33')])){ut[_0xb00b('0x31')]('[Preview][validateContact][Empty\x20Contact]',_0x116ced);return{'isValid':![],'message':_0xb00b('0x108')};}var _0x15f9cd=this[_0xb00b('0x22')][_0x116ced[0x0][_0xb00b('0x42')][_0xb00b('0x33')]];_0x15f9cd['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];if(_['isNil'](_0x15f9cd)){ut['logger'](_0xb00b('0x109'),_0x15f9cd);return{'isValid':![],'message':_0xb00b('0x10a')};}if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x10b')])){ut[_0xb00b('0x31')](_0xb00b('0x10c'),_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x10e'));if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x6d')])){ut['logger'](_0xb00b('0x10c'),_0x15f9cd['name']+_0xb00b('0x10f'));return{'isValid':![],'message':_0xb00b('0x110')};}}if(!ut[_0xb00b('0x111')](_0x15f9cd[_0xb00b('0x3b')])){ut[_0xb00b('0x31')](_0xb00b('0x112'),_0x15f9cd['name']+_0xb00b('0x113'));return{'isValid':![],'message':_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x113')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xb00b('0xd')][_0xb00b('0xe9')]=function(_0x58dbf6,_0x199ba1,_0x16cca9,_0x3c57b2){var _0xca4a87=this;return new Promise(function(_0x456515,_0x26145a){var _0x31fa5b=_0x58dbf6[_0xb00b('0x9c')];var _0x1ba141=_0xca4a87['isTrunkReachable'](_0x199ba1[_0xb00b('0x10b')])?util[_0xb00b('0x25')]('SIP/%s/%s%s',_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x114')])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1[_0xb00b('0x116')]>0x0?_0x16cca9[_0xb00b('0x103')][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9[_0xb00b('0x103')]):util['format'](_0xb00b('0x118'),_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1['Trunk'][_0xb00b('0x33')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1['dialPrefix'])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1['dialCutDigit']>0x0?_0x16cca9['phone'][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9['phone']);var _0x1256a8=_0xca4a87['isTrunkReachable'](_0x199ba1['Trunk'])?ut[_0xb00b('0x119')](_0x199ba1['Trunk']['callerid'],_0x199ba1[_0xb00b('0x11a')],_0x199ba1[_0xb00b('0x11b')]>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1[_0xb00b('0x11b')]):_0x199ba1[_0xb00b('0x11d')]):ut[_0xb00b('0x119')](_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x11e')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x11e')],_0x199ba1[_0xb00b('0x11a')],_0x199ba1['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1['dialRandomLastDigitCallerIdNumber']):_0x199ba1[_0xb00b('0x11d')]);if(_0x1256a8){_0x58dbf6['originatecalleridname']=ut[_0xb00b('0x11f')](_0x1256a8);_0x58dbf6[_0xb00b('0x120')]=ut[_0xb00b('0x121')](_0x1256a8);}var _0x5657ee=ut[_0xb00b('0x122')](_0x199ba1,_0x16cca9,_0x1ba141,_0x1256a8,_0x31fa5b,_0x58dbf6);_[_0xb00b('0x123')](_0x58dbf6,ut['toLowerVariables'](_0x5657ee));_0x58dbf6[_0xb00b('0x60')]=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x199ba1[_0xb00b('0x124')]=_0x5657ee;var _0x57bfab=ut[_0xb00b('0x125')](_0x58dbf6,_0x199ba1,_0x5657ee,_0x58dbf6[_0xb00b('0x83')],_0x3c57b2);return ami[_0xb00b('0x4b')](_0x57bfab)['then'](function(_0x571811){_0x199ba1['originated']+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x126'),_0x31fa5b,_0xb00b('0x9d'),_0x199ba1[_0xb00b('0x33')],_0xb00b('0x44'),_0x199ba1[_0xb00b('0xd6')]);_0x456515(_0x571811);})[_0xb00b('0x69')](function(_0x39b4c6){ut[_0xb00b('0xdd')](_0x58dbf6,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x58dbf6,_0xb00b('0x127'));_0x26145a(_0x39b4c6);});});};Preview[_0xb00b('0xd')]['syncNewExten']=function(_0x42fdce){if(this['actions'][_0x42fdce[_0xb00b('0x9f')]]){this['actions'][_0x42fdce[_0xb00b('0x9f')]][_0xb00b('0x4c')]=_0x42fdce['channel'];}};Preview[_0xb00b('0xd')][_0xb00b('0x16')]=function(_0x5573c9){var _0x44767a=this;var _0x4d4dbe=this[_0xb00b('0x13')][_0x5573c9[_0xb00b('0x128')]];if(_0x4d4dbe){if(_0x4d4dbe[_0xb00b('0x129')]&&this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]]){ut[_0xb00b('0x12a')](_0x4d4dbe,this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]][_0xb00b('0x33')],this[_0xb00b('0x14')][_0x4d4dbe['lookAgent']]['id']);}var _0x4cff99=_[_0xb00b('0x12b')](_0x4d4dbe);_0x4cff99['responsetime']=moment()[_0xb00b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');var _0x198536=_0x44767a[_0xb00b('0x22')][_0x4d4dbe['queue']];if(ut[_0xb00b('0x12c')](_0x5573c9['response'])){if(_0x4d4dbe[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x4d4dbe['idContact']);}if(_0x4d4dbe[_0xb00b('0x83')]){rpcDb[_0xb00b('0x5f')](_0x4d4dbe[_0xb00b('0x85')]);}ami[_0xb00b('0x23')](_0xb00b('0x12d'),ut['buildObj'](_0x4d4dbe,_0xb00b('0x12e'),this[_0xb00b('0x22')][_0x4d4dbe['queue']]));this['callProgressDetectingAgent'](_0x4cff99,_0x198536,_0x5573c9);}else{_0x4d4dbe[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x4cff99,0x4,_0xb00b('0x12f'));rpcDb[_0xb00b('0xe0')](_0x4cff99,_0xb00b('0x130'));}}};Preview[_0xb00b('0xd')]['syncHangup']=function(_0xcaefbd){var _0x482fc4=this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]];var _0x22f2f6;if(_0x482fc4){_0x22f2f6=this[_0xb00b('0x22')][_0x482fc4['queue']];logger[_0xb00b('0x41')](_0xb00b('0x131'),_0xcaefbd['linkedid'],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6['pTalking']);}if(this['actions'][_0xcaefbd[_0xb00b('0x9f')]]&&_0xcaefbd[_0xb00b('0x9f')]!==_0xcaefbd[_0xb00b('0x9c')]){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){this['callProgressDetectingCustomer'](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this['actions'][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger[_0xb00b('0x41')]('[syncHangup][talking][cause]',_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6['name'],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}else if(_0x482fc4&&_[_0xb00b('0x40')](_0x482fc4[_0xb00b('0x134')])&&_0x22f2f6['dialQueueProject']&&_0xcaefbd[_0xb00b('0x9f')]===_0xcaefbd[_0xb00b('0x9c')]&&_['isNil'](_0xcaefbd['reason'])&&_0xcaefbd['cause']==='16'&&_0xcaefbd[_0xb00b('0x135')]==='6'&&_[_0xb00b('0xda')](_0x482fc4[_0xb00b('0x136')])){if(_0x482fc4[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x482fc4[_0xb00b('0x85')]);}if(_0x482fc4[_0xb00b('0x83')]){rpcDb['disableContact'](_0x482fc4['idContact']);}_0xcaefbd[_0xb00b('0xdc')]='22';this[_0xb00b('0xd9')](_0x482fc4,_0x22f2f6,_0xcaefbd);}else if(_0x482fc4&&_0x482fc4['transfer']){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger['info'](_0xb00b('0x137'),_0xcaefbd['linkedid'],_0xcaefbd['cause'],'\x20Queue',_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){logger[_0xb00b('0x41')](_0xb00b('0x138'),_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],'pTalking:\x20',_0x22f2f6['pTalking']);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x1a')]=function(_0x1e0206){if(this[_0xb00b('0x13')][_0x1e0206[_0xb00b('0xd7')]]&&_0x1e0206[_0xb00b('0xd7')]!==_0x1e0206['destuniqueid']){this[_0xb00b('0x133')](_0x1e0206,_0x1e0206[_0xb00b('0xd7')],_0x1e0206[_0xb00b('0xcd')]);}};Preview[_0xb00b('0xd')]['syncHangupRequest']=function(_0x45ad1f){if(this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]]&&_0x45ad1f[_0xb00b('0x9f')]!==_0x45ad1f[_0xb00b('0x9c')]&&!this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]][_0xb00b('0x46')]){if(_0x45ad1f[_0xb00b('0x132')]==='1'){this['callProgressDetectingCustomer'](_0x45ad1f,_0x45ad1f['linkedid'],_0x45ad1f[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x139')]=function(_0x121451,_0x2e9604,_0x19fce8){if(this[_0xb00b('0x13')][_0x121451]){if(_['isNil'](this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')])){this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')]={};}this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')][_0x2e9604]=_0x19fce8;}};Preview['prototype'][_0xb00b('0x13a')]=function(_0x1ec1c7){try{if(!_['isNil'](_0x1ec1c7)){if(ut[_0xb00b('0x13b')](_[_0xb00b('0x13c')](_0x1ec1c7[_0xb00b('0x13d')])[0x0])){this[_0xb00b('0x139')](_0x1ec1c7[_0xb00b('0x9c')],_[_0xb00b('0x13c')](_0x1ec1c7['variable'])[0x0],_0x1ec1c7['value']);}}}catch(_0x465238){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x465238,{'showHidden':![],'depth':null}));}};Preview[_0xb00b('0xd')][_0xb00b('0x1f')]=function(_0x5a400c){if(_0x5a400c){if(this['actions'][_0x5a400c[_0xb00b('0x13e')]]){this[_0xb00b('0x13')][_0x5a400c[_0xb00b('0x13e')]][_0xb00b('0x136')]=!![];}}};Preview[_0xb00b('0xd')][_0xb00b('0x21')]=function(_0x3fd141){if(_0x3fd141){if(this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]){this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]['transfer']=!![];}}};module[_0xb00b('0x140')]=Preview; \ No newline at end of file +var _0x4b84=['countbusyretry','scheduledAt','unlockAgent','idContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','checkInBlack','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','custom:agentcalled','[Preview][execCall][failure]','logBlacklist','createHistory','active','SIP/%s','format','reachable','unmonitored','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','logger','[Preview][validateContact][Empty\x20Contact]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdNumber','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','filterKey','keys','variable','addVariable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','ioredis','preview','../../../config/logger','actionPreview','./action','../dialer/utils','defaults','socket.io-emitter','redis','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncNewExten','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','available','paused','message','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','CAMPAIGN_STATUS','DEACTIVATED','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','actioncountonusuch','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x133989,_0x1c254){var _0xcc6824=function(_0x3c8a0a){while(--_0x3c8a0a){_0x133989['push'](_0x133989['shift']());}};_0xcc6824(++_0x1c254);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x4b84[_0x2a238a];return _0xeef802;};'use strict';var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require(_0x44b8('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x44b8('0x3'));var loggerAction=require(_0x44b8('0x4'))(_0x44b8('0x5'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x44b8('0x6'));var ut=require('./util/util');var utils=require(_0x44b8('0x7'));config['redis']=_[_0x44b8('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x44b8('0x9'))(new Redis(config[_0x44b8('0xa')]));var Sequence=function(){};Sequence[_0x44b8('0xb')]['enqueue']=function(_0xc650ec){this[_0x44b8('0xc')]=this[_0x44b8('0xc')]?this[_0x44b8('0xc')][_0x44b8('0xd')](_0xc650ec):_0xc650ec();};function Preview(_0x37e471){this[_0x44b8('0xe')]=new Sequence();this['campaignsPreview']=_0x37e471[_0x44b8('0xf')];this[_0x44b8('0x10')]=_0x37e471['trunks'];this[_0x44b8('0x11')]={};this['agents']=_0x37e471[_0x44b8('0x12')];this[_0x44b8('0x13')]=0x0;ami['on']('originateresponse',this[_0x44b8('0x14')]['bind'](this));ami['on']('hangup',this[_0x44b8('0x15')][_0x44b8('0x16')](this));ami['on'](_0x44b8('0x17'),this[_0x44b8('0x18')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0x44b8('0x16')](this));ami['on']('newexten',this[_0x44b8('0x19')][_0x44b8('0x16')](this));ami['on']('varset',this[_0x44b8('0x1a')][_0x44b8('0x16')](this));ami['on']('attendedtransfer',this[_0x44b8('0x1b')][_0x44b8('0x16')](this));ami['on']('blindtransfer',this[_0x44b8('0x1c')][_0x44b8('0x16')](this));this[_0x44b8('0x1d')](this[_0x44b8('0x1e')]);}function emit(_0x102ef9,_0x369c09,_0x452f2f){io['to'](_0x102ef9)[_0x44b8('0x1f')](_0x369c09,_0x452f2f);}function emitVoiceQueueChannelRemove(_0x429461){logger[_0x44b8('0x20')](_0x44b8('0x21'),JSON[_0x44b8('0x22')](_0x429461));emit(util['format'](_0x44b8('0x23'),_0x429461[_0x44b8('0x24')]),_0x44b8('0x25'),_0x429461);io[_0x44b8('0x1f')](_0x44b8('0x26'),_0x429461);}function notSendMessagesQueue(_0x51a34a){if(_0x51a34a[_0x44b8('0x27')]){if(_0x51a34a['originated']===0x0&&_0x51a34a[_0x44b8('0x28')]===0x0){_0x51a34a[_0x44b8('0x27')]=![];_0x51a34a[_0x44b8('0x29')]=0x0;_0x51a34a[_0x44b8('0x2a')]=0x0;_0x51a34a[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20not\x20active');}else{_0x51a34a[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x2f')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20deactivated');}}}Preview[_0x44b8('0xb')]['loopCampaigns']=function(){var _0xfb0028=this;setInterval(function(){_0xfb0028['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x387293=this[_0x44b8('0x1e')];this[_0x44b8('0x13')]+=0x1;for(var _0x1bd1be in _0x387293){if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&(_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x3')||_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x32'))&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(this[_0x44b8('0x13')]>0x7){this[_0x44b8('0x13')]=0x0;this['clearZombieChannels']();}}if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&_0x387293[_0x1bd1be]['dialMethod']===_0x44b8('0x3')&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(_0x387293[_0x1bd1be][_0x44b8('0x35')]){this[_0x44b8('0x36')](_0x387293[_0x1bd1be]);if(_0x387293[_0x1bd1be]['dialPreviewAutoRecallMe'])this[_0x44b8('0x37')](_0x387293[_0x1bd1be]);}else{notSendMessagesQueue(_0x387293[_0x1bd1be]);}}}};Preview[_0x44b8('0xb')][_0x44b8('0x38')]=function(_0x339f0f){var _0x46b008=this;this['sequence'][_0x44b8('0x39')](function(){if(!_[_0x44b8('0x3a')](_0x46b008[_0x44b8('0x11')][_0x339f0f])){loggerAction[_0x44b8('0x20')](_0x44b8('0x3b'),_0x339f0f,_0x44b8('0x3c'),_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')],_0x44b8('0x3e'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x3f')]),_0x44b8('0x40'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x28')]),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x11')][_0x339f0f]['dialAnswer']),JSON[_0x44b8('0x22')](_[_0x44b8('0x41')](_0x46b008['actions'][_0x339f0f],[_0x44b8('0x42'),_0x44b8('0x43'),_0x44b8('0x44'),_0x44b8('0x45')])));return ami['Action']({'action':_0x44b8('0x46'),'channel':_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x47')]})[_0x44b8('0x48')](function(_0x9cb2a){if(_0x9cb2a[_0x44b8('0x2b')]===_0x44b8('0x49')){setTimeout(function(){if(_0x46b008[_0x44b8('0x11')][_0x339f0f]){ut[_0x44b8('0x4a')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));if(_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x4c')]===!![]){ut[_0x44b8('0x4d')](_0x46b008['campaignsPreview'][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));ut['loggerError'](_0x44b8('0x4e')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);}ut['loggerError'](_0x44b8('0x4f')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);delete _0x46b008[_0x44b8('0x11')][_0x339f0f];}},0x2328);}});}});};Preview[_0x44b8('0xb')]['clearZombieChannels']=function(){var _0x5ae5f9=this;loggerAction[_0x44b8('0x20')](_0x44b8('0x50'),_[_0x44b8('0x51')](this[_0x44b8('0x11')]));for(var _0x43906b in this[_0x44b8('0x11')]){if(_0x5ae5f9[_0x44b8('0x11')][_0x44b8('0x30')](_0x43906b)){_0x5ae5f9[_0x44b8('0x38')](_0x43906b);}}};Preview[_0x44b8('0xb')][_0x44b8('0x37')]=function(_0x2a9b2a){var _0xc1b9de=this;rpcDb[_0x44b8('0x52')](_0x2a9b2a['id'],ut[_0x44b8('0x53')](this[_0x44b8('0x12')]))[_0x44b8('0x54')](function(_0x3b3d5d){if(!_[_0x44b8('0x3a')](_0x3b3d5d)){for(var _0x49c507=0x0;_0x49c507<_0x3b3d5d['length'];_0x49c507+=0x1){if(ut[_0x44b8('0x55')](_0x3b3d5d[_0x49c507][_0x44b8('0x56')])<_0x2a9b2a[_0x44b8('0x57')]*0x3c){if(_0x3b3d5d[_0x49c507][_0x44b8('0x58')]&&!_0x3b3d5d[_0x49c507][_0x44b8('0x58')][_0x44b8('0x59')]){_0xc1b9de[_0x44b8('0x5a')](_0x3b3d5d[_0x49c507]['id'])['then'](ut[_0x44b8('0x5b')]('[RecallMe]'))[_0x44b8('0x48')](ut[_0x44b8('0x5b')](_0x44b8('0x5c')));}else{rpcDb[_0x44b8('0x5d')](_0x3b3d5d[_0x49c507]['id']);}}else{var _0x103d57=new Action(_0x3b3d5d[_0x49c507],_0x2a9b2a);_0x103d57[_0x44b8('0x5e')]=moment()['format'](_0x44b8('0x5f'));_0x2a9b2a[_0x44b8('0x60')]+=0x1;ut[_0x44b8('0x61')](_0x103d57,0x17,_0x44b8('0x62'));if(_0x2a9b2a['dialRecallInQueue']){rpcDb[_0x44b8('0x63')](ut[_0x44b8('0x64')](_0x3b3d5d[_0x49c507]));rpcDb[_0x44b8('0x65')](_0x103d57,_0x44b8('0x66'));}else{ut[_0x44b8('0x61')](_0x103d57,0x16,_0x44b8('0x67'));rpcDb['createCustomerHistory'](_0x103d57,_0x44b8('0x68'));rpcDb[_0x44b8('0x69')](_0x103d57,_0x44b8('0x68'));}}}}})[_0x44b8('0x48')](ut[_0x44b8('0x5b')]('[getContactRecallMe]'));};Preview['prototype'][_0x44b8('0x36')]=function(_0x4eb344){_0x4eb344[_0x44b8('0x27')]=!![];if(ut['IsNotLoggedIn'](_0x4eb344[_0x44b8('0x6a')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x6b')];}else if(!ut[_0x44b8('0x6c')](_0x4eb344[_0x44b8('0x35')])){_0x4eb344[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];}else if(!this[_0x44b8('0x6d')](_0x4eb344[_0x44b8('0x6e')])){if(!this['isTrunkReachable'](_0x4eb344[_0x44b8('0x6f')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x70')];}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}};Preview[_0x44b8('0xb')][_0x44b8('0x72')]=function(_0xe86e34,_0x546a50,_0x5b99a3){var _0xc181d2=this;var _0x3154bc=this[_0x44b8('0x11')][_0x546a50];var _0x4358aa=this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]];var _0x3c9534;var _0xf0fb0d=![];var _0x10bbd9=0x2;var _0xdff81b=0x3;if(_0x4358aa){switch(_0x5b99a3){case'1':_0x4358aa[_0x44b8('0x73')]+=0x1;_0x3154bc[_0x44b8('0x74')]+=0x1;_0x3154bc['countglobal']=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x0,_0x44b8('0x76'));ami[_0x44b8('0x1f')](_0x44b8('0x77'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x79')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0x7a'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'0',_0x4358aa)[_0x44b8('0x54')](function(_0x15bcba){_0xf0fb0d=_0x15bcba[_0x44b8('0x7c')]==0x1;_0x10bbd9=_0x4358aa[_0x44b8('0x7d')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,'Global');rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0x81'));}else{if(_0x3154bc[_0x44b8('0x74')]>=_0x4358aa[_0x44b8('0x82')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x81'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,_0x44b8('0x74'),_0x4358aa[_0x44b8('0x7d')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0x3154bc[_0x44b8('0x74')]++;logger[_0x44b8('0x20')](_0x44b8('0x85'),_0x3154bc['countnosuchnumberretry']);logger[_0x44b8('0x20')]('id',_0x3154bc['idContact']);_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnosuchnumberretry':_0x3154bc[_0x44b8('0x74')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0x88'):var _0x230b6a=moment()['format'](_0x44b8('0x5f'));_0x3154bc['responsetime']=_0x230b6a;_0x3154bc[_0x44b8('0x89')]=_0x230b6a;_0x3154bc[_0x44b8('0x4c')]=!![];_0x4358aa['pTalking']+=0x1;logger[_0x44b8('0x20')](_0x44b8('0x8a'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa[_0x44b8('0x24')],_0x44b8('0x40'),_0x4358aa[_0x44b8('0x28')]);ami[_0x44b8('0x1f')](_0x44b8('0x8d'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x8e'),this[_0x44b8('0x1e')][_0x3154bc['queue']]));if(_0x4358aa[_0x44b8('0x8f')]){ami[_0x44b8('0x1f')](_0x44b8('0x90'),ut['buildAcw'](_0x3154bc));}break;case'16':ami[_0x44b8('0x1f')](_0x44b8('0x91'),ut['buildObj'](_0x3154bc,_0x44b8('0x92'),this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]]));emitVoiceQueueChannelRemove(ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x92')));_0x4358aa['outboundAnswerCallsDay']+=0x1;_0x4358aa[_0x44b8('0x93')]+=0x1;_0x4358aa[_0x44b8('0x94')]+=0x1;ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0x95'));_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x4,_0x44b8('0x97'));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0x98'));rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x99'));rpcDb[_0x44b8('0x9a')](_0x3154bc);_0x4358aa['sumDuration']+=_0x3154bc['talktime'];_0x4358aa['sumBillable']+=_0x3154bc[_0x44b8('0x9b')];logger[_0x44b8('0x20')](_0x44b8('0x9c'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa['name'],_0x44b8('0x40'),_0x4358aa['pTalking']);delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];break;case _0x44b8('0x9e'):_0x4358aa['outboundBusyCallsDay']+=0x1;_0x3154bc['countbusyretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x5,'Busy');_0x10bbd9=_0x4358aa[_0x44b8('0x9f')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xa0'),ut[_0x44b8('0x78')](_0x3154bc,'busy'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xa1'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'5',_0x4358aa)[_0x44b8('0x54')](function(_0x220f1b){_0xf0fb0d=_0x220f1b['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xa3'));}else{if(_0x3154bc[_0x44b8('0xa4')]>=_0x4358aa['dialBusyMaxRetry']){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xa4'),_0x4358aa['dialBusyRetryFrequency']),_0x3154bc[_0x44b8('0xa6')],_0x3154bc['activeContact']);}}}else{_0x3154bc['countbusyretry']++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countbusyretry':_0x3154bc[_0x44b8('0xa4')]}})['then'](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case _0x44b8('0xa8'):_0x4358aa[_0x44b8('0xa9')]+=0x1;_0x3154bc[_0x44b8('0xaa')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x3,_0x44b8('0xab'));_0x10bbd9=_0x4358aa[_0x44b8('0xac')];_0xdff81b=_0x4358aa['callAdditionalPhoneAfterMin'];var _0x388c4c=ut['buildNoAnswerEventPayload'](_0x3154bc,_0x4358aa);ami['emit']('custom:agentnoanswer',_0x388c4c);rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logNoAnswer]');_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'3',_0x4358aa)[_0x44b8('0x54')](function(_0x268e1e){_0xf0fb0d=_0x268e1e[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb['createCustomerFinal'](_0x3c9534,_0x44b8('0xad'));}else{if(_0x3154bc[_0x44b8('0xaa')]>=_0x4358aa[_0x44b8('0xae')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xaf'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xaa'),_0x4358aa[_0x44b8('0xac')]),_0x3154bc['unlockAgent'],_0x3154bc['activeContact']);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'CONGESTION':_0x4358aa[_0x44b8('0xb0')]+=0x1;_0x3154bc['countcongestionretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x8,_0x44b8('0xb1'));_0x10bbd9=_0x4358aa[_0x44b8('0xb2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xb3'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xb4')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xb5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'8',_0x4358aa)[_0x44b8('0x54')](function(_0x5de033){_0xf0fb0d=_0x5de033[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xb6'));}else{if(_0x3154bc[_0x44b8('0xb7')]>=_0x4358aa[_0x44b8('0xb8')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xb5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,'countcongestionretry',_0x4358aa[_0x44b8('0x9f')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc['countcongestionretry']++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countcongestionretry':_0x3154bc[_0x44b8('0xb7')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0xb9'):_0x4358aa[_0x44b8('0xba')]+=0x1;_0x3154bc[_0x44b8('0xbb')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x14,_0x44b8('0xbc'));_0x10bbd9=_0x4358aa['dialAgentRejectRetryFrequency'];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xbd'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xbe')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xbf'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0x478f17){_0xf0fb0d=_0x478f17[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0x14,_0x44b8('0xbc'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc0'));}else{if(_0x3154bc[_0x44b8('0xbb')]>=_0x4358aa[_0x44b8('0xc1')]){rpcDb['createCustomerFinal'](_0x3154bc,_0x44b8('0xc0'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,'countagentrejectretry',_0x4358aa[_0x44b8('0xc2')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case'ABANDONED':_0x4358aa[_0x44b8('0xc3')]+=0x1;_0x3154bc['countabandonedretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xb,_0x44b8('0xc4'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xc5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'11',_0x4358aa)['then'](function(_0x4d3b82){_0xf0fb0d=_0x4d3b82['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc5'));}else{if(_0x3154bc[_0x44b8('0xc6')]>=_0x4358aa[_0x44b8('0xc7')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xc5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xc8'),_0x4358aa[_0x44b8('0xc9')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'18':_0x4358aa['outboundUnknownCallsDay']+=0x1;_0x3154bc[_0x44b8('0xca')]+=0x1;_0x3154bc['countglobal']=ut['totalGlobal'](_0x3154bc);ut['logCustomer'](_0x3154bc,0x12,_0xe86e34['cause-txt']||_0xe86e34['dialstatus']);ami[_0x44b8('0x1f')](_0x44b8('0xcb'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0xcd'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'18',_0x4358aa)['then'](function(_0x572e5c){_0xf0fb0d=_0x572e5c[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut['cloneAction'](_0x3154bc,0x12,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xcd'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xcd'));}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;case'19':_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut['totalGlobal'](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x13,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);ami[_0x44b8('0x1f')]('custom:amd',ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xd0'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'18',_0x4358aa)[_0x44b8('0x54')](function(_0xf73cde){_0xf0fb0d=_0xf73cde[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd0'));}else{rpcDb['createCustomerFinal'](_0x3154bc,'[callProgressDetectingCustomer][machine]');}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;default:if(_0x3154bc['dialAnswer']){ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0xd1'));ut[_0x44b8('0xd2')](_0x44b8('0xd3')+_0x4358aa[_0x44b8('0x24')],_0xe86e34);}_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xc,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);_0x10bbd9=_0x4358aa[_0x44b8('0xc2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logUnknown]');_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0xf5e39){_0xf0fb0d=_0xf5e39['additional']==0x1;if(!_0xf0fb0d){if(ut['totalGlobal'](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd4'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xd4'));}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});}});}if(!(_0x3154bc[_0x44b8('0x4c')]&&_0x5b99a3==='16')){ut[_0x44b8('0x4a')](_0x4358aa,'[callProgressDetectingCustomer]');logger[_0x44b8('0x20')](_0x44b8('0xd5'),_0x3154bc[_0x44b8('0x8b')],'\x20Queue',_0x4358aa['name'],_0x44b8('0x3e'),_0x4358aa[_0x44b8('0x3f')]);}if(_0x5b99a3!==_0x44b8('0x88')){delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];delete this['actions'][_0xe86e34[_0x44b8('0xd6')]];}_0x4358aa[_0x44b8('0xd7')]=!![];}};Preview['prototype'][_0x44b8('0xd8')]=function(_0x13942e,_0xcb4c9b,_0x237f67){if(_['isUndefined'](_0xcb4c9b)&&_0x44b8('0xd9')!==typeof _0xcb4c9b){return;}if(_['isUndefined'](_0x237f67)&&_0x44b8('0xd9')!==typeof _0x237f67){return;}switch(_0x237f67[_0x44b8('0xda')]){case'0':ut[_0x44b8('0xdb')](_0x13942e,0x0,_0x44b8('0x76'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xdd'));break;case'3':ut[_0x44b8('0xdb')](_0x13942e,0x3,_0x44b8('0xab'));rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xde'));break;case'5':ut[_0x44b8('0xdb')](_0x13942e,0x5,_0x44b8('0xdf'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe0'));break;case'8':ut[_0x44b8('0xdb')](_0x13942e,0x8,'Congestion');rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xe1'));break;case'22':ut[_0x44b8('0xdb')](_0x13942e,0x16,'AnswerAGI');rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe2'));break;default:ut['logAgent'](_0x13942e,0xc,_0x237f67[_0x44b8('0xda')]);rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe1'));}ut[_0x44b8('0x4a')](_0xcb4c9b,_0x44b8('0xe3'));logger[_0x44b8('0x20')](_0x44b8('0xe4'),_0x13942e[_0x44b8('0x8b')],_0x44b8('0x8c'),_0xcb4c9b[_0x44b8('0x24')],_0x44b8('0x3e'),_0xcb4c9b[_0x44b8('0x3f')]);delete this[_0x44b8('0x11')][_0x13942e[_0x44b8('0x8b')]];};Preview[_0x44b8('0xb')]['verifyAdditionalPhones']=function(_0x30fca,_0x3d92a9,_0x13ab7b){return cmHopperAdditionalPhone[_0x44b8('0x7b')](_0x30fca,_0x3d92a9,_0x13ab7b)['catch'](logger[_0x44b8('0x20')](_0x44b8('0xe5')));};Preview['prototype'][_0x44b8('0x87')]=function(_0x4b9731,_0x1cd645,_0x3fee20){return cmHopperAdditionalPhone[_0x44b8('0x87')](_0x4b9731,_0x1cd645,_0x3fee20)[_0x44b8('0x48')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x44b8('0xb')][_0x44b8('0x86')]=function(_0x5a2a9f){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x44b8('0x86')](_0x5a2a9f))[_0x44b8('0x48')](logger[_0x44b8('0x20')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0x44b8('0xe6')]=function(_0x289fbd,_0x12f78b,_0x24a6a6,_0x2f5451,_0xc54e64){var _0x100295=this;return new Promise(function(_0x287902,_0x2675e9){if(_['isNil'](_0x12f78b)||_[_0x44b8('0x3a')](_0x12f78b['Contact'])||_[_0x44b8('0x3a')](_0x12f78b['phone'])||_['isNil'](_0x12f78b[_0x44b8('0x44')])){_0x2675e9(ut[_0x44b8('0x2b')](_0x44b8('0xe7'),_0x2f5451,_0xc54e64));return;}var _0x13c741=uuid['v4']();var _0x2eec38=_0x100295[_0x44b8('0x1e')][_0x12f78b[_0x44b8('0x3c')][_0x44b8('0x24')]];var _0x17b749=_0x24a6a6?_0x100295['agents'][_0x24a6a6]['id']:undefined;_0x100295[_0x44b8('0x11')][_0x13c741]=new Action(_0x12f78b,_0x2eec38,_0x13c741,_0x24a6a6,_0x17b749);var _0x1e3b5f=_0x100295[_0x44b8('0x11')][_0x13c741];_0x1e3b5f['unlockAgent']=_0x2f5451;_0x1e3b5f['activeContact']=_0xc54e64;_0x1e3b5f[_0x44b8('0xe8')]=_0x24a6a6;if(_['isEmpty'](_0x289fbd)){_0x100295[_0x44b8('0xe9')](_0x1e3b5f,_0x2eec38,_0x12f78b,_0x24a6a6)['then'](function(_0x1ae0bb){logger['info']('[Preview][execCall][success]',_0x44b8('0xea')+_0x1e3b5f[_0x44b8('0x3d')]+'\x20IdHopper:\x20'+_0x1e3b5f[_0x44b8('0xa7')],JSON[_0x44b8('0x22')](_0x1ae0bb));ami[_0x44b8('0x1f')](_0x44b8('0xeb'),ut[_0x44b8('0x78')](_0x1e3b5f,'called',_0x100295[_0x44b8('0x1e')][_0x1e3b5f['queue']]));_0x287902(ut['message']('Calling'));})[_0x44b8('0x48')](function(_0x2818ec){ut['logger'](_0x44b8('0xec'),_0x2818ec);_0x2675e9(ut[_0x44b8('0x2b')]('Call\x20failed',_0x2f5451,_0xc54e64));});}else{_0x2eec38['outboundBlacklistCallsDay']+=0x1;ut[_0x44b8('0xed')](_0x1e3b5f);rpcDb[_0x44b8('0xee')](_0x1e3b5f,'[Blacklist][error]');delete _0x100295[_0x44b8('0x11')][_0x13c741];_0x2675e9(ut[_0x44b8('0x2b')]('Contact\x20in\x20black\x20List',_0x2f5451,_0xc54e64));}});};Preview[_0x44b8('0xb')][_0x44b8('0x6d')]=function(_0x5ce5ed){return!_[_0x44b8('0x3a')](_0x5ce5ed)&&!_[_0x44b8('0x3a')](_0x5ce5ed[_0x44b8('0x24')])&&!_['isNil'](_0x5ce5ed[_0x44b8('0xef')])&&_0x5ce5ed['active']&&!_[_0x44b8('0x3a')](this['trunks'][util['format'](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])])&&!_[_0x44b8('0x3a')](this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')])&&(this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed['name'])][_0x44b8('0x46')]===_0x44b8('0xf2')||this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')]===_0x44b8('0xf3'));};Preview['prototype'][_0x44b8('0x5a')]=function(_0x3f33a9,_0x561645){return this[_0x44b8('0xf4')](_0x3f33a9,_0x561645)[_0x44b8('0x54')](function(_0x2a40a3){return _['pick'](_0x2a40a3,['message']);})[_0x44b8('0x48')](function(_0x133da8){if(_0x133da8['unlock']){rpcDb['unlockContact'](_0x3f33a9);}if(_0x133da8[_0x44b8('0xef')]){rpcDb[_0x44b8('0x5d')](_0x3f33a9);}throw _[_0x44b8('0x41')](_0x133da8,[_0x44b8('0x2b')]);});};Preview[_0x44b8('0xb')]['execRun']=function(_0x2ded38,_0x4fbf1d){var _0x444f66=this;var _0x1386c6,_0x36537c;return rpcDb[_0x44b8('0xf5')](_0x2ded38)[_0x44b8('0x54')](function(_0x180c33){if(!_['isNil'](_0x180c33[0x0])){_0x36537c=_0x180c33[0x0][_0x44b8('0xf6')]?![]:!![];_0x1386c6=_0x180c33[0x0]['recallme']?!![]:![];_0x1386c6=_0x4fbf1d?!![]:_0x1386c6;}var _0x2c3e11=_0x444f66[_0x44b8('0xf7')](_0x180c33);if(_0x2c3e11['isValid']){rpcDb[_0x44b8('0xf8')](_['pick'](_0x180c33[0x0],[_0x44b8('0x44'),_0x44b8('0xf9')]))[_0x44b8('0x54')](function(_0x4b0aa0){_0x444f66[_0x44b8('0xe6')](_0x4b0aa0,_0x180c33[0x0],_0x4fbf1d,_0x36537c,_0x1386c6)[_0x44b8('0x54')](function(_0x4ff63e){return _0x4ff63e;})[_0x44b8('0x48')](function(_0x5af83d){throw _0x5af83d;});})['catch'](function(_0x4220b5){ut['logger'](_0x44b8('0xfa'),_0x4220b5);throw ut['message'](_0x44b8('0xfb'),_0x36537c,_0x1386c6);});}else{throw ut[_0x44b8('0x2b')](_0x2c3e11['message'],_0x36537c,_0x1386c6);}})[_0x44b8('0x48')](function(_0x39507e){ut['logger']('[Preview][getContactPreview]',_0x39507e);throw ut[_0x44b8('0x2b')](_0x44b8('0xfb'),![],!![]);});};Preview[_0x44b8('0xb')][_0x44b8('0xf7')]=function(_0x596fa4){if(_[_0x44b8('0x3a')](_0x596fa4)||_[_0x44b8('0xfc')](_0x596fa4)||!_[_0x44b8('0x3a')](_0x596fa4[0x0][_0x44b8('0x58')])&&_['isNil'](_0x596fa4[0x0]['Agent'][_0x44b8('0x24')])){ut[_0x44b8('0xfd')](_0x44b8('0xfe'),_0x596fa4);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1443bd=this[_0x44b8('0x1e')][_0x596fa4[0x0]['Queue'][_0x44b8('0x24')]];_0x1443bd[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x71')];if(_[_0x44b8('0x3a')](_0x1443bd)){ut[_0x44b8('0xfd')]('[Preview][validateContact][Empty\x20Campaign]',_0x1443bd);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x44b8('0x6d')](_0x1443bd['Trunk'])){ut[_0x44b8('0xfd')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x44b8('0xff')+_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x100'));if(!this[_0x44b8('0x6d')](_0x1443bd[_0x44b8('0x6f')])){ut[_0x44b8('0xfd')](_0x44b8('0x101'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x102'));return{'isValid':![],'message':_0x44b8('0x103')};}}if(!ut[_0x44b8('0x6c')](_0x1443bd[_0x44b8('0x35')])){ut[_0x44b8('0xfd')](_0x44b8('0x104'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x105'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1443bd[_0x44b8('0x24')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x44b8('0x106')};};Preview[_0x44b8('0xb')][_0x44b8('0xe9')]=function(_0x10fd21,_0x420a61,_0x22e5ae,_0x2f3340){var _0x4d98de=this;return new Promise(function(_0x597139,_0x2fffd5){var _0x3c90c2=_0x10fd21[_0x44b8('0x8b')];var _0x43c7ac=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?util[_0x44b8('0xf1')](_0x44b8('0x107'),_0x420a61[_0x44b8('0x6e')][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61['dialPrefix'][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61[_0x44b8('0x10a')]):_0x22e5ae['phone']):util['format'](_0x44b8('0x107'),_[_0x44b8('0x3a')](_0x420a61['TrunkBackup'])?_0x420a61['Trunk'][_0x44b8('0x24')]:_0x420a61['TrunkBackup'][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61[_0x44b8('0x108')][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61['dialCutDigit']):_0x22e5ae[_0x44b8('0xf9')]);var _0xf24cdd=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?ut[_0x44b8('0x10c')](_0x420a61[_0x44b8('0x6e')]['callerid'],_0x420a61['dialOriginateCallerIdName'],_0x420a61['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x420a61[_0x44b8('0x10d')],_0x420a61['dialRandomLastDigitCallerIdNumber']):_0x420a61['dialOriginateCallerIdNumber']):ut[_0x44b8('0x10c')](_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x6f')])?_0x420a61['Trunk'][_0x44b8('0x10e')]:_0x420a61['TrunkBackup'][_0x44b8('0x10e')],_0x420a61[_0x44b8('0x10f')],_0x420a61[_0x44b8('0x110')]>0x0?ut[_0x44b8('0x111')](_0x420a61['dialOriginateCallerIdNumber'],_0x420a61[_0x44b8('0x110')]):_0x420a61[_0x44b8('0x10d')]);if(_0xf24cdd){_0x10fd21[_0x44b8('0x112')]=ut[_0x44b8('0x113')](_0xf24cdd);_0x10fd21['originatecalleridnum']=ut['extractCalleridNumber'](_0xf24cdd);}var _0x35a564=ut[_0x44b8('0x114')](_0x420a61,_0x22e5ae,_0x43c7ac,_0xf24cdd,_0x3c90c2,_0x10fd21);_['merge'](_0x10fd21,ut[_0x44b8('0x115')](_0x35a564));_0x10fd21[_0x44b8('0x5e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));_0x420a61[_0x44b8('0x116')]=_0x35a564;var _0x2da727=ut[_0x44b8('0x117')](_0x10fd21,_0x420a61,_0x35a564,_0x10fd21[_0x44b8('0x84')],_0x2f3340);return ami['Action'](_0x2da727)[_0x44b8('0x54')](function(_0x3e5fa8){_0x420a61[_0x44b8('0x3f')]+=0x1;logger['info'](_0x44b8('0x118'),_0x3c90c2,'\x20Queue',_0x420a61[_0x44b8('0x24')],'originated:\x20',_0x420a61[_0x44b8('0x3f')]);_0x597139(_0x3e5fa8);})[_0x44b8('0x48')](function(_0x1f5c08){ut[_0x44b8('0xdb')](_0x10fd21,0xe,_0x44b8('0x119'));rpcDb[_0x44b8('0xdc')](_0x10fd21,_0x44b8('0x11a'));_0x2fffd5(_0x1f5c08);});});};Preview[_0x44b8('0xb')][_0x44b8('0x19')]=function(_0x31913d){if(this[_0x44b8('0x11')][_0x31913d[_0x44b8('0x9d')]]){this['actions'][_0x31913d[_0x44b8('0x9d')]]['channel']=_0x31913d[_0x44b8('0x47')];}};Preview['prototype'][_0x44b8('0x14')]=function(_0x31132c){var _0xdfc44b=this;var _0x2c8438=this[_0x44b8('0x11')][_0x31132c[_0x44b8('0x11b')]];if(_0x2c8438){if(_0x2c8438[_0x44b8('0xe8')]&&this['agents'][_0x2c8438[_0x44b8('0xe8')]]){ut[_0x44b8('0x11c')](_0x2c8438,this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]][_0x44b8('0x24')],this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]]['id']);}var _0x46cdee=_[_0x44b8('0x11d')](_0x2c8438);_0x46cdee[_0x44b8('0x11e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));var _0xbbc40d=_0xdfc44b[_0x44b8('0x1e')][_0x2c8438['queue']];if(ut[_0x44b8('0x11f')](_0x31132c[_0x44b8('0x120')])){if(_0x2c8438['unlockAgent']){rpcDb[_0x44b8('0x121')](_0x2c8438[_0x44b8('0xa7')]);}if(_0x2c8438[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x2c8438[_0x44b8('0xa7')]);}ami['emit'](_0x44b8('0x122'),ut[_0x44b8('0x78')](_0x2c8438,_0x44b8('0x123'),this[_0x44b8('0x1e')][_0x2c8438['queue']]));this[_0x44b8('0xd8')](_0x46cdee,_0xbbc40d,_0x31132c);}else{_0x2c8438[_0x44b8('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x46cdee,0x4,'Answer');rpcDb[_0x44b8('0xdc')](_0x46cdee,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x44b8('0x15')]=function(_0xb5c212){var _0x87a38=this['actions'][_0xb5c212[_0x44b8('0x9d')]];var _0x32dafb;if(_0x87a38){_0x32dafb=this[_0x44b8('0x1e')][_0x87a38[_0x44b8('0x3d')]];logger['info'](_0x44b8('0x124'),_0xb5c212['linkedid'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],'pTalking:\x20',_0x32dafb[_0x44b8('0x28')]);}if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]]&&_0xb5c212[_0x44b8('0x9d')]!==_0xb5c212[_0x44b8('0x8b')]){if(_0xb5c212['cause']==='16'&&this['actions'][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb['pTalking']);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}else if(_0x87a38&&_['isNil'](_0x87a38[_0x44b8('0x127')])&&_0x32dafb[_0x44b8('0x128')]&&_0xb5c212[_0x44b8('0x9d')]===_0xb5c212[_0x44b8('0x8b')]&&_[_0x44b8('0x3a')](_0xb5c212[_0x44b8('0xda')])&&_0xb5c212['cause']==='16'&&_0xb5c212[_0x44b8('0x129')]==='6'&&_[_0x44b8('0x12a')](_0x87a38['transfer'])){if(_0x87a38[_0x44b8('0xa6')]){rpcDb[_0x44b8('0x121')](_0x87a38[_0x44b8('0xa7')]);}if(_0x87a38[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x87a38['idContact']);}_0xb5c212[_0x44b8('0xda')]='22';this[_0x44b8('0xd8')](_0x87a38,_0x32dafb,_0xb5c212);}else if(_0x87a38&&_0x87a38[_0x44b8('0x12b')]){if(_0xb5c212[_0x44b8('0x125')]==='16'&&this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x12c'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],_0x44b8('0x40'),_0x32dafb['pTalking']);this['callProgressDetectingCustomer'](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause']);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb[_0x44b8('0x28')]);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}};Preview[_0x44b8('0xb')]['syncDialEnd']=function(_0x4d88a6){if(this[_0x44b8('0x11')][_0x4d88a6[_0x44b8('0xd6')]]&&_0x4d88a6[_0x44b8('0xd6')]!==_0x4d88a6[_0x44b8('0x12d')]){this[_0x44b8('0x72')](_0x4d88a6,_0x4d88a6[_0x44b8('0xd6')],_0x4d88a6[_0x44b8('0xcf')]);}};Preview['prototype'][_0x44b8('0x18')]=function(_0x1f6244){if(this[_0x44b8('0x11')][_0x1f6244['linkedid']]&&_0x1f6244[_0x44b8('0x9d')]!==_0x1f6244[_0x44b8('0x8b')]&&!this[_0x44b8('0x11')][_0x1f6244[_0x44b8('0x9d')]]['dialAnswer']){if(_0x1f6244[_0x44b8('0x125')]==='1'){this[_0x44b8('0x72')](_0x1f6244,_0x1f6244[_0x44b8('0x9d')],_0x1f6244['cause']);}}};Preview['prototype']['addVariable']=function(_0x4b3c64,_0x59a43a,_0x355c5c){if(this[_0x44b8('0x11')][_0x4b3c64]){if(_[_0x44b8('0x3a')](this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')])){this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')]={};}this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')][_0x59a43a]=_0x355c5c;}};Preview[_0x44b8('0xb')][_0x44b8('0x1a')]=function(_0x56aecf){try{if(!_[_0x44b8('0x3a')](_0x56aecf)){if(ut[_0x44b8('0x12e')](_[_0x44b8('0x12f')](_0x56aecf[_0x44b8('0x130')])[0x0])){this[_0x44b8('0x131')](_0x56aecf['uniqueid'],_[_0x44b8('0x12f')](_0x56aecf['variable'])[0x0],_0x56aecf[_0x44b8('0x132')]);}}}catch(_0x3432da){logger[_0x44b8('0x133')]('[syncVarSet][Preview]',util[_0x44b8('0x134')](_0x3432da,{'showHidden':![],'depth':null}));}};Preview[_0x44b8('0xb')]['syncAttendedTransfer']=function(_0xc8e8f4){if(_0xc8e8f4){if(this[_0x44b8('0x11')][_0xc8e8f4[_0x44b8('0x135')]]){this['actions'][_0xc8e8f4[_0x44b8('0x135')]]['transfer']=!![];}}};Preview[_0x44b8('0xb')][_0x44b8('0x1c')]=function(_0x280fe1){if(_0x280fe1){if(this['actions'][_0x280fe1[_0x44b8('0x136')]]){this['actions'][_0x280fe1[_0x44b8('0x136')]][_0x44b8('0x12b')]=!![];}}};module[_0x44b8('0x137')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 062f3ed..f269125 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 _0xaace=['active','[rescheduleContact]\x20','countReScheduled','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','then','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId'];(function(_0x38c6ff,_0x442ac9){var _0xfbea01=function(_0x28ad7c){while(--_0x28ad7c){_0x38c6ff['push'](_0x38c6ff['shift']());}};_0xfbea01(++_0x442ac9);}(_0xaace,0x122));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xeaac('0x0'));var BPromise=require(_0xeaac('0x1'));var logger=require(_0xeaac('0x2'))(_0xeaac('0x3'));var cmHopper=require(_0xeaac('0x4'));var cmHopperHistory=require(_0xeaac('0x5'));var cmHopperBlack=require(_0xeaac('0x6'));var agentReportPreview=require(_0xeaac('0x7'));var voiceQueueReport=require(_0xeaac('0x8'));function loggerCatch(_0x4a6ee0){return function(_0x561bdd){logger[_0xeaac('0x9')](_0x4a6ee0,util[_0xeaac('0xa')](_0x561bdd,{'showHidden':![],'depth':null}));};}function create(_0x2fa6d8){return cmHopperHistory[_0xeaac('0xb')](_0x2fa6d8)[_0xeaac('0xc')](loggerCatch(_0xeaac('0xd')));}function createAgent(_0x4192af){return BPromise[_0xeaac('0xe')]()['then'](agentReportPreview[_0xeaac('0xb')](_0x4192af))['catch'](loggerCatch(_0xeaac('0xd')));}function moveContact(_0x1c238f){return cmHopper['moveContactManagedDialer'](_0x1c238f,!![])[_0xeaac('0xc')](loggerCatch(_0xeaac('0xf')));}exports['checkIsBlackList']=function(_0x2f048d){return cmHopperBlack[_0xeaac('0x10')](_0x2f048d)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xeaac('0x11')]=function(_0x940a8){return BPromise[_0xeaac('0xe')]()['then'](cmHopper[_0xeaac('0x11')](_0x940a8))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xeaac('0xb')]=function(_0x5d9700,_0x31054a){create(_0x5d9700)[_0xeaac('0xc')](loggerCatch(_0x31054a));moveContact(_0x5d9700)[_0xeaac('0xc')](loggerCatch(_0x31054a));};exports[_0xeaac('0x12')]=function(_0x497363,_0x2e5e2c){createAgent(_0x497363)[_0xeaac('0xc')](loggerCatch(_0x2e5e2c));};exports['createCustomerHistory']=function(_0x8f8b57,_0x4018a6){create(_0x8f8b57)[_0xeaac('0xc')](loggerCatch(_0x4018a6));};exports[_0xeaac('0x13')]=function(_0x446a33,_0x3d2be1){moveContact(_0x446a33)[_0xeaac('0xc')](loggerCatch(_0x3d2be1));};exports[_0xeaac('0x14')]=function(_0x2f3ee7,_0x2e3f06,_0x2dcf7b){if(_0x2e3f06){_0x2f3ee7[_0xeaac('0x15')]=null;}if(_0x2dcf7b){_0x2f3ee7[_0xeaac('0x16')]=![];}return cmHopper[_0xeaac('0x14')](_0x2f3ee7)['catch'](loggerCatch(_0xeaac('0x17')));};exports[_0xeaac('0x18')]=function(_0x2968ed){return cmHopper[_0xeaac('0x18')](_0x2968ed)[_0xeaac('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x3fcd28){return cmHopper[_0xeaac('0x19')]({'UserId':null},_0x3fcd28,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x26741e){return cmHopper[_0xeaac('0x19')]({'active':![]},_0x26741e,0x1)[_0xeaac('0xc')](loggerCatch(_0xeaac('0x1a')));};exports['crateCustomerReportQueue']=function(_0x440039){var _0xf62edf={};_0xf62edf[_0xeaac('0x1b')]=_0x440039[_0xeaac('0x1b')];_0xf62edf[_0xeaac('0x1c')]=_0x440039['uniqueid'];_0xf62edf[_0xeaac('0x1d')]=_0x440039[_0xeaac('0x1d')];_0xf62edf[_0xeaac('0x1e')]=_0x440039[_0xeaac('0x1e')];_0xf62edf[_0xeaac('0x1f')]=_0x440039[_0xeaac('0x1f')];_0xf62edf[_0xeaac('0x20')]=_0x440039[_0xeaac('0x21')];_0xf62edf[_0xeaac('0x22')]=_0x440039[_0xeaac('0x21')];_0xf62edf[_0xeaac('0x23')]=0x1;_0xf62edf['queuecallercompleteAt']=_0x440039[_0xeaac('0x24')];_0xf62edf['connectedlinename']=_0x440039[_0xeaac('0x25')];_0xf62edf[_0xeaac('0x26')]=_0xeaac('0x27');_0xf62edf[_0xeaac('0x28')]=_0xeaac('0x29');_0xf62edf[_0xeaac('0x2a')]=0x0;_0xf62edf[_0xeaac('0x2b')]=0x1;_0xf62edf[_0xeaac('0x2c')]=_0x440039[_0xeaac('0x25')];_0xf62edf[_0xeaac('0x2d')]=_0xeaac('0x2e');return BPromise[_0xeaac('0xe')]()[_0xeaac('0x2f')](voiceQueueReport['create'](_0xf62edf))['catch'](loggerCatch(_0xeaac('0x30')));};exports[_0xeaac('0x31')]=function(_0x156b9d,_0x5b6f84){return BPromise['resolve']()[_0xeaac('0x2f')](cmHopper['getContactRecallMe'](_0x156b9d,_0x5b6f84))['catch'](loggerCatch(_0xeaac('0x32')));};exports[_0xeaac('0x33')]=function(_0x2ffbbd){return cmHopper['rescheduleContact'](_0x2ffbbd,!![],!![])[_0xeaac('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x0b19=['queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0x0b19,0x88));var _0x90b1=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x0b19[_0x3b9149];return _0x2067f4;};'use strict';var util=require(_0x90b1('0x0'));var BPromise=require(_0x90b1('0x1'));var logger=require(_0x90b1('0x2'))(_0x90b1('0x3'));var cmHopper=require(_0x90b1('0x4'));var cmHopperHistory=require(_0x90b1('0x5'));var cmHopperBlack=require(_0x90b1('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x90b1('0x7'));function loggerCatch(_0x3db6d6){return function(_0x5e2801){logger[_0x90b1('0x8')](_0x3db6d6,util[_0x90b1('0x9')](_0x5e2801,{'showHidden':![],'depth':null}));};}function create(_0x49c1bf){return cmHopperHistory[_0x90b1('0xa')](_0x49c1bf)[_0x90b1('0xb')](loggerCatch(_0x90b1('0xc')));}function createAgent(_0x48ddb9){return BPromise[_0x90b1('0xd')]()['then'](agentReportPreview['createHistory'](_0x48ddb9))['catch'](loggerCatch(_0x90b1('0xc')));}function moveContact(_0x4234e1){return cmHopper[_0x90b1('0xe')](_0x4234e1,!![])[_0x90b1('0xb')](loggerCatch(_0x90b1('0xf')));}exports['checkIsBlackList']=function(_0x302ae0){return cmHopperBlack['checkIsBlackList'](_0x302ae0)['catch'](loggerCatch(_0x90b1('0x10')));};exports[_0x90b1('0x11')]=function(_0x17e4a5){return BPromise['resolve']()[_0x90b1('0x12')](cmHopper['getContactPreview'](_0x17e4a5))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x13')));};exports['createHistory']=function(_0x192567,_0x5b9ed6){create(_0x192567)[_0x90b1('0xb')](loggerCatch(_0x5b9ed6));moveContact(_0x192567)[_0x90b1('0xb')](loggerCatch(_0x5b9ed6));};exports[_0x90b1('0x14')]=function(_0x23e9f5,_0x28bc8a){createAgent(_0x23e9f5)[_0x90b1('0xb')](loggerCatch(_0x28bc8a));};exports[_0x90b1('0x15')]=function(_0x2f8e09,_0x1f88cd){create(_0x2f8e09)[_0x90b1('0xb')](loggerCatch(_0x1f88cd));};exports[_0x90b1('0x16')]=function(_0x51ec02,_0x3232dc){moveContact(_0x51ec02)['catch'](loggerCatch(_0x3232dc));};exports[_0x90b1('0x17')]=function(_0x950ece,_0xefc747,_0x338397){if(_0xefc747){_0x950ece['UserId']=null;}if(_0x338397){_0x950ece[_0x90b1('0x18')]=![];}return cmHopper[_0x90b1('0x17')](_0x950ece)[_0x90b1('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0xb6e360){return cmHopper[_0x90b1('0x19')](_0xb6e360)[_0x90b1('0xb')](loggerCatch(_0x90b1('0x1a')));};exports[_0x90b1('0x1b')]=function(_0x5eb63a){return cmHopper['unlockContact']({'UserId':null},_0x5eb63a,0x1)[_0x90b1('0xb')](loggerCatch(_0x90b1('0x1c')));};exports[_0x90b1('0x1d')]=function(_0x2b0c1a){return cmHopper[_0x90b1('0x1b')]({'active':![]},_0x2b0c1a,0x1)['catch'](loggerCatch(_0x90b1('0x1e')));};exports[_0x90b1('0x1f')]=function(_0x46fe8b){var _0x2e8b05={};_0x2e8b05[_0x90b1('0x20')]=_0x46fe8b[_0x90b1('0x20')];_0x2e8b05[_0x90b1('0x21')]=_0x46fe8b[_0x90b1('0x21')];_0x2e8b05[_0x90b1('0x22')]=_0x46fe8b[_0x90b1('0x22')];_0x2e8b05[_0x90b1('0x23')]=_0x46fe8b['calleridname'];_0x2e8b05[_0x90b1('0x24')]=_0x46fe8b[_0x90b1('0x24')];_0x2e8b05[_0x90b1('0x25')]=_0x46fe8b[_0x90b1('0x26')];_0x2e8b05[_0x90b1('0x27')]=_0x46fe8b[_0x90b1('0x26')];_0x2e8b05[_0x90b1('0x28')]=0x1;_0x2e8b05[_0x90b1('0x29')]=_0x46fe8b[_0x90b1('0x2a')];_0x2e8b05[_0x90b1('0x2b')]=_0x46fe8b[_0x90b1('0x2c')];_0x2e8b05[_0x90b1('0x2d')]=_0x90b1('0x2e');_0x2e8b05[_0x90b1('0x2f')]=_0x90b1('0x30');_0x2e8b05['holdtime']=0x0;_0x2e8b05[_0x90b1('0x31')]=0x1;_0x2e8b05[_0x90b1('0x32')]=_0x46fe8b['membername'];_0x2e8b05[_0x90b1('0x33')]=_0x90b1('0x34');return BPromise[_0x90b1('0xd')]()[_0x90b1('0x12')](voiceQueueReport[_0x90b1('0x35')](_0x2e8b05))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x36')));};exports[_0x90b1('0x37')]=function(_0x42e759,_0x375659){return BPromise['resolve']()['then'](cmHopper[_0x90b1('0x37')](_0x42e759,_0x375659))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x38')));};exports[_0x90b1('0x39')]=function(_0x6a99d){return cmHopper[_0x90b1('0x17')](_0x6a99d,!![],!![])['catch'](loggerCatch(_0x90b1('0x3a')));}; \ 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 360e59b..dd8f8cb 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 _0xec2e=['127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','%s%s','XMD-','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','getSeconds','UserId','logCustomer','talktime','isFailure','Failure','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','milliseconds','diff','seconds','createBody','idContact','campaigntype','dialAnswer','membername','countglobal','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI'];(function(_0x5646bc,_0x51ca71){var _0x37d217=function(_0x3d4d50){while(--_0x3d4d50){_0x5646bc['push'](_0x5646bc['shift']());}};_0x37d217(++_0x51ca71);}(_0xec2e,0x82));var _0xeec2=function(_0x52f868,_0x4b8187){_0x52f868=_0x52f868-0x0;var _0x5113e0=_0xec2e[_0x52f868];return _0x5113e0;};'use strict';var util=require('util');var _=require(_0xeec2('0x0'));var moment=require(_0xeec2('0x1'));var logger=require(_0xeec2('0x2'))(_0xeec2('0x3'));var ipAgi=process[_0xeec2('0x4')][_0xeec2('0x5')]||_0xeec2('0x6');var utils=require(_0xeec2('0x7'));exports[_0xeec2('0x8')]=function(_0x40032f){return function(_0x15f46b){logger['error'](_0x40032f,util[_0xeec2('0x9')](_0x15f46b,{'showHidden':![],'depth':null}));};};exports[_0xeec2('0xa')]=function(_0x215698,_0x396187){logger[_0xeec2('0xb')](_0x215698,util[_0xeec2('0x9')](_0x396187,{'showHidden':![],'depth':null}));};exports[_0xeec2('0xc')]=function(_0x472311,_0x31210a){logger['error'](_0x472311,util[_0xeec2('0x9')](_0x31210a,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x243d48){return function(_0x284e69){logger['info'](_0x243d48,util[_0xeec2('0x9')](_0x284e69,{'showHidden':![],'depth':null}));};};exports[_0xeec2('0xd')]=function(_0x5367d3,_0x21480d,_0x5446f9){return{'message':_0x5367d3,'unlock':_0x21480d,'active':_0x5446f9};};exports['getCallerId']=function(_0x3ff7f6,_0xf893a,_0x2507c8){if(!_[_0xeec2('0xe')](_0x2507c8)&&_0xeec2('0xf')===typeof _0x2507c8&&!_[_0xeec2('0x10')](_0x2507c8)){if(!_['isUndefined'](_0xf893a)&&_0xeec2('0xf')===typeof _0xf893a&&!_[_0xeec2('0x10')](_0xf893a)){return util[_0xeec2('0x11')]('\x22%s\x22\x20<%s>',_0xf893a,_0x2507c8);}return util['format'](_0xeec2('0x12'),_0x2507c8,_0x2507c8);}if(!_[_0xeec2('0xe')](_0x3ff7f6)&&'string'===typeof _0x3ff7f6&&!_[_0xeec2('0x10')](_0x3ff7f6)){return _0x3ff7f6;}return _0xeec2('0x13');};exports[_0xeec2('0x14')]=function(_0xc9a91b){if(_[_0xeec2('0x15')](_0xc9a91b)){return![];}return _0xc9a91b;};exports[_0xeec2('0x16')]=function(_0x54f915,_0x36b832,_0x26def8,_0x18bff8,_0x1b3c03,_0xb7575){var _0x2b5987={'XMD-QUEUE':_0x36b832[_0xeec2('0x17')]?_0x36b832['Queue']['name']:'','XMD-CALLERID':_0x18bff8,'XMD-CALLERID-PREVIEW':_0xb7575?util[_0xeec2('0x11')](_0xeec2('0x12'),_0xb7575[_0xeec2('0x18')],_0xb7575[_0xeec2('0x19')]):_0x18bff8,'XMD-DIALID':_0x1b3c03,'XMD-CONTACTID':_0x36b832[_0xeec2('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x18bff8,'XMD-VOICEQUEUEID':_0x36b832[_0xeec2('0x1b')],'XMD-DIALCHANNEL':_0x26def8,'XMD-DIALTIMEOUT':_0x54f915['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xeec2('0x11')]('\x22rtTxX%s%s\x22',_0x54f915[_0xeec2('0x1c')]?'g':'',_[_0xeec2('0x10')](_0x54f915[_0xeec2('0x1d')])?'':_0xeec2('0x1e')),'XMD-DIALURL':_0x54f915[_0xeec2('0x1f')]||'','XMD-AGI':_0x54f915['dialQueueProject']?util[_0xeec2('0x11')](_0xeec2('0x20'),ipAgi,_0x54f915[_0xeec2('0x21')]):_0xeec2('0x22'),'XMD-AGIAFTER':_0x54f915['dialQueueProject2']?util['format'](_0xeec2('0x20'),ipAgi,_0x54f915[_0xeec2('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xb7575?_0xb7575[_0xeec2('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0xb7575?_0xb7575[_0xeec2('0x24')]:'','XMD-DESTINATION':_0xeec2('0x25'),'SIPADDHEADER':_0xeec2('0x26')};if(!_[_0xeec2('0x10')](_0x54f915[_0xeec2('0x1d')])){_0x2b5987[util[_0xeec2('0x11')]('%s',_0xeec2('0x27'))]=_0x54f915[_0xeec2('0x1d')];_0x2b5987[util[_0xeec2('0x11')]('%s',_0xeec2('0x28'))]=_0x1b3c03;}if(_0x36b832&&_0x36b832[_0xeec2('0x29')]){for(var _0x18a605 in _0x36b832[_0xeec2('0x29')]){if(_0x36b832[_0xeec2('0x29')]['hasOwnProperty'](_0x18a605)){if(!_['isNil'](_0x36b832['Contact'][_0x18a605])&&_0x18a605!=='id'&&_0x18a605!=='tags'&&_0x18a605!=='createdAt'&&_0x18a605!=='updatedAt'){_0x2b5987[util[_0xeec2('0x11')](_0xeec2('0x2a'),_0xeec2('0x2b'),_['toUpper'](_0x18a605))]=_0x36b832[_0xeec2('0x29')][_0x18a605];}}}}return _0x2b5987;};exports[_0xeec2('0x2c')]=function(_0x481bb2){var _0x1c8b40={};for(var _0xfdb456 in _0x481bb2){if(_0x481bb2[_0xeec2('0x2d')](_0xfdb456)){_0x1c8b40[util[_0xeec2('0x11')]('%s',_['toLower'](_0xfdb456))]=_0x481bb2[_0xfdb456];}}return{'variables':_0x1c8b40};};exports['updateOriginated']=function(_0x46597d,_0xa8419c){if(!_['isNil'](_0x46597d)){if(_0x46597d[_0xeec2('0x2d')](_0xeec2('0x2e'))){if(_0x46597d[_0xeec2('0x2e')]>0x0){_0x46597d[_0xeec2('0x2e')]-=0x1;}else{logger['error'](_0xeec2('0x2f'),_0xa8419c);}}}else{logger[_0xeec2('0x30')](_0xeec2('0x31'),_0xa8419c);}};exports[_0xeec2('0x32')]=function(_0xdfa362){var _0x7c0323=moment()[_0xeec2('0x11')](_0xeec2('0x33'));_0xdfa362[_0xeec2('0x34')]=0xd;_0xdfa362[_0xeec2('0x35')]=_0xeec2('0x36');_0xdfa362[_0xeec2('0x37')]=_0x7c0323;_0xdfa362['responsetime']=_0x7c0323;_0xdfa362[_0xeec2('0x38')]=_0x7c0323;};exports[_0xeec2('0x39')]=function(_0x33a2a0,_0x4333c5,_0x3c5da9){var _0xdb593a=moment()['format'](_0xeec2('0x33'));_0x33a2a0['state']=_0x4333c5;_0x33a2a0[_0xeec2('0x35')]=_0x3c5da9;_0x33a2a0[_0xeec2('0x3a')]=_0xdb593a;_0x33a2a0['ringtime']=utils[_0xeec2('0x3b')](_0x33a2a0[_0xeec2('0x3a')],_0x33a2a0[_0xeec2('0x37')]);};exports['logLookAgent']=function(_0xf00ad,_0x28b4cc,_0x3fb47c){_0xf00ad['membername']=_0x28b4cc;_0xf00ad[_0xeec2('0x3c')]=_0x3fb47c;};exports[_0xeec2('0x3d')]=function(_0x5516a6,_0x34b8ea,_0x305dd2){var _0x28accc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5516a6[_0xeec2('0x34')]=_0x34b8ea;_0x5516a6[_0xeec2('0x35')]=_0x305dd2;_0x5516a6[_0xeec2('0x3a')]=_0x5516a6['responsetime']?_0x5516a6[_0xeec2('0x3a')]:_0x28accc;_0x5516a6['endtime']=_0x5516a6[_0xeec2('0x38')]?_0x5516a6[_0xeec2('0x38')]:_0x28accc;_0x5516a6['ringtime']=utils['getSeconds'](_0x5516a6[_0xeec2('0x3a')]||0x0,_0x5516a6[_0xeec2('0x37')]||0x0);_0x5516a6[_0xeec2('0x3e')]=_0x5516a6['answertime']?utils[_0xeec2('0x3b')](_0x5516a6[_0xeec2('0x38')],_0x5516a6['answertime']):0x0;};exports[_0xeec2('0x3f')]=function(_0x5c6aff){return _0x5c6aff===_0xeec2('0x40');};exports['variablesAction']=function(_0xed9ab6,_0x14b3f3,_0x227de3,_0x25e652,_0x4655f4){var _0x1a1097=_0x25e652?'RECALL':_0xed9ab6['calleridname'];_0x1a1097=_0x4655f4?'BOOKED':_0x1a1097;return{'actionid':_0xed9ab6['uniqueid'],'action':'originate','channel':_0xed9ab6[_0xeec2('0x41')],'callerid':util[_0xeec2('0x11')](_0xeec2('0x12'),_0x1a1097,_0xed9ab6[_0xeec2('0x19')]),'Exten':_0xeec2('0x25'),'Context':_0xeec2('0x42'),'Priority':'1','variable':_0x227de3,'timeout':(_0x14b3f3[_0xeec2('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0xed9ab6[_0xeec2('0x44')]};};exports[_0xeec2('0x45')]=function(_0x46b205){return _0x46b205['countbusyretry']+_0x46b205[_0xeec2('0x46')]+_0x46b205[_0xeec2('0x47')]+_0x46b205['countagentrejectretry']+_0x46b205['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4f7e51){var _0x50805d=_[_0xeec2('0x48')](_0x4f7e51);_0x50805d[_0xeec2('0x34')]=0xf;_0x50805d[_0xeec2('0x35')]=_0xeec2('0x49');return _0x50805d;};exports[_0xeec2('0x4a')]=function(_0x50e95b,_0x4278c4,_0x5b2f04){var _0x3b2965={};_0x3b2965[_0x4278c4]=_0x50e95b[_0x4278c4];_0x3b2965[_0xeec2('0x4b')]=![];_0x3b2965[_0xeec2('0x4c')]=moment()['add'](_0x5b2f04,_0xeec2('0x4d'))[_0xeec2('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b2965[_0xeec2('0x1a')]=_0x50e95b[_0xeec2('0x1a')];_0x3b2965[_0xeec2('0x4e')]=_0x50e95b[_0xeec2('0x4e')];_0x3b2965[_0xeec2('0x1b')]=_0x50e95b['VoiceQueueId']||undefined;return _0x3b2965;};exports['decrementTalkink']=function(_0x24892d,_0x1d584c){if(!_['isNil'](_0x24892d)){if(_0x24892d[_0xeec2('0x4f')]>0x0){_0x24892d[_0xeec2('0x4f')]-=0x1;}else{logger[_0xeec2('0x30')](_0x1d584c,_0xeec2('0x50'));}}else{logger[_0xeec2('0x30')](_0x1d584c,_0xeec2('0x51'));}};exports['IsNotLoggedIn']=function(_0x5180d4){if(_0x5180d4<=0x0){return!![];}return![];};function buildObj(_0x57ee7e,_0x368be1,_0x454f39){_0x57ee7e[_0xeec2('0x52')]=_0x368be1;_0x57ee7e[_0xeec2('0x53')]=_0x57ee7e[_0xeec2('0x54')];_0x57ee7e[_0xeec2('0x55')]=_0x57ee7e[_0xeec2('0x41')];_0x57ee7e['motionChannel']=_0xeec2('0x56');if(_0x454f39){_0x57ee7e[_0xeec2('0x57')]=_0x454f39['mandatoryDisposition'];}return _0x57ee7e;}exports['buildObj']=buildObj;exports[_0xeec2('0x58')]=function(_0x5e7cbc){var _0x1aae6b={};_0x1aae6b['queue']=_0x5e7cbc['queue'];_0x1aae6b[_0xeec2('0x55')]=_0x5e7cbc[_0xeec2('0x41')];_0x1aae6b[_0xeec2('0x44')]=_0x5e7cbc[_0xeec2('0x44')];return _0x1aae6b;};exports[_0xeec2('0x59')]=function(_0x7db79f){var _0x4a6dff=[];for(var _0x24724d in _0x7db79f){if(_0x7db79f[_0xeec2('0x2d')](_0x24724d)){if(!_[_0xeec2('0x15')](_0x7db79f[_0x24724d])&&_0x7db79f[_0x24724d]['state']===_0xeec2('0x5a')&&_0x7db79f[_0x24724d][_0xeec2('0x5b')]==='reachable'){_0x4a6dff['push'](_0x7db79f[_0x24724d]['id']);}}}return _0x4a6dff;};exports['getDiff']=function(_0x9a901a){var _0x34414b=moment()[_0xeec2('0x5c')](0x0);var _0x4ce477=moment(_0x9a901a)['milliseconds'](0x0);return _0x34414b[_0xeec2('0x5d')](_0x4ce477,_0xeec2('0x5e'));};exports[_0xeec2('0x5f')]=function(_0xec6373){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xec6373[_0xeec2('0x1a')],'ListId':_0xec6373[_0xeec2('0x4e')],'VoiceQueueId':_0xec6373[_0xeec2('0x1b')]||undefined,'CampaignId':_0xec6373['CampaignId']||undefined};};exports['filterKey']=function(_0x454f4e){if(_0x454f4e===_0xeec2('0x44')||_0x454f4e===_0xeec2('0x60')||_0x454f4e==='queue'||_0x454f4e==='type'||_0x454f4e===_0xeec2('0x61')||_0x454f4e===_0xeec2('0x62')||_0x454f4e===_0xeec2('0x63')||_0x454f4e===_0xeec2('0x41')||_0x454f4e===_0xeec2('0x18')||_0x454f4e===_0xeec2('0x4b')||_0x454f4e===_0xeec2('0x19')||_0x454f4e===_0xeec2('0x4c')||_0x454f4e==='countbusyretry'||_0x454f4e===_0xeec2('0x46')||_0x454f4e===_0xeec2('0x47')||_0x454f4e===_0xeec2('0x64')||_0x454f4e==='callback'||_0x454f4e===_0xeec2('0x65')||_0x454f4e==='callbackat'||_0x454f4e===_0xeec2('0x66')||_0x454f4e===_0xeec2('0x1a')||_0x454f4e===_0xeec2('0x4e')||_0x454f4e===_0xeec2('0x3c')||_0x454f4e===_0xeec2('0x1b')||_0x454f4e===_0xeec2('0x67')||_0x454f4e==='xmd-voicequeueid'||_0x454f4e===_0xeec2('0x68')||_0x454f4e===_0xeec2('0x69')||_0x454f4e===_0xeec2('0x6a')||_0x454f4e===_0xeec2('0x6b')||_0x454f4e===_0xeec2('0x6c')||_0x454f4e===_0xeec2('0x6d')||_0x454f4e===_0xeec2('0x6e')||_0x454f4e===_0xeec2('0x6f')||_0x454f4e===_0xeec2('0x70')||_0x454f4e==='xmd-cdrtype'||_0x454f4e===_0xeec2('0x71')||_0x454f4e===_0xeec2('0x72')||_0x454f4e===_0xeec2('0x73')||_0x454f4e===_0xeec2('0x74')||_0x454f4e===_0xeec2('0x75')||_0x454f4e===_0xeec2('0x76')||_0x454f4e==='rtpaudioqosjitterbridged'||_0x454f4e===_0xeec2('0x77')||_0x454f4e===_0xeec2('0x78')||_0x454f4e===_0xeec2('0x79')||_0x454f4e===_0xeec2('0x7a')||_0x454f4e===_0xeec2('0x74')||_0x454f4e==='rtpaudioqosbridged'||_0x454f4e===_0xeec2('0x76')||_0x454f4e==='rtpaudioqosjitterbridged'||_0x454f4e===_0xeec2('0x77')||_0x454f4e===_0xeec2('0x78')||_0x454f4e==='rtpaudioqosrtt'||_0x454f4e===_0xeec2('0x7a')||_0x454f4e===_0xeec2('0x7b')||_0x454f4e==='bridgepvtcallid'||_0x454f4e===_0xeec2('0x34')||_0x454f4e===_0xeec2('0x35')){return![];}return!![];};exports[_0xeec2('0x7c')]=function(_0x4d83e2,_0x2521cc){var _0x52990b,_0x5e6c42,_0x15106d;if(_0x2521cc<=0x0){_0x2521cc=0x1;}_0x52990b=new RegExp('\x5cw{0,'+_0x2521cc+'}$');_0x5e6c42=Math[_0xeec2('0x7d')](0xa,_0x2521cc-0x1);_0x15106d=Math['pow'](0xa,_0x2521cc)-0x1;return util[_0xeec2('0x11')]('%s',_[_0xeec2('0x7e')](_0x4d83e2,_0x52990b,_[_0xeec2('0x7f')](_0x5e6c42,_0x15106d)));};exports[_0xeec2('0x80')]=function(_0x45c22d){var _0x372689=_0x45c22d[_0xeec2('0x81')](/"(.*?)"/);return _0x372689?_0x372689[0x1]:_0x45c22d;};exports[_0xeec2('0x82')]=function(_0x45bc1e){var _0x396082=_0x45bc1e['match'](/<(.*?)>/);return _0x396082?_0x396082[0x1]:_0x45bc1e;};function buildNoAnswerEventPayload(_0x1614fa,_0x4c9e7a){var _0x5a1103=buildObj(_0x1614fa,_0xeec2('0x83'));if(!_[_0xeec2('0x10')](_0x4c9e7a[_0xeec2('0x84')])){Object[_0xeec2('0x85')](_0x4c9e7a['variables'])[_0xeec2('0x86')](function(_0xccd2fe){_0x5a1103[_0xccd2fe[_0xeec2('0x87')]()]=_0x4c9e7a[_0xeec2('0x84')][_0xccd2fe];});}return _0x5a1103;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x48cf=['callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','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','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','extractCalleridNumber','match','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','Queue','name','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLower','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','getSeconds','UserId','endtime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','add','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','type','campaigntype','scheduledat','countglobal','callback'];(function(_0xa8ce53,_0x529d2d){var _0x4d8bf9=function(_0x13fa1b){while(--_0x13fa1b){_0xa8ce53['push'](_0xa8ce53['shift']());}};_0x4d8bf9(++_0x529d2d);}(_0x48cf,0xba));var _0xf48c=function(_0x3ac9b4,_0x17bba8){_0x3ac9b4=_0x3ac9b4-0x0;var _0x20655d=_0x48cf[_0x3ac9b4];return _0x20655d;};'use strict';var util=require(_0xf48c('0x0'));var _=require(_0xf48c('0x1'));var moment=require(_0xf48c('0x2'));var logger=require(_0xf48c('0x3'))(_0xf48c('0x4'));var ipAgi=process[_0xf48c('0x5')][_0xf48c('0x6')]||_0xf48c('0x7');var utils=require(_0xf48c('0x8'));exports['loggerCatch']=function(_0x1365cf){return function(_0x351c05){logger[_0xf48c('0x9')](_0x1365cf,util[_0xf48c('0xa')](_0x351c05,{'showHidden':![],'depth':null}));};};exports[_0xf48c('0xb')]=function(_0x45aff2,_0x207b96){logger['info'](_0x45aff2,util[_0xf48c('0xa')](_0x207b96,{'showHidden':![],'depth':null}));};exports[_0xf48c('0xc')]=function(_0x425fca,_0x1d19b9){logger['error'](_0x425fca,util[_0xf48c('0xa')](_0x1d19b9,{'showHidden':![],'depth':null}));};exports[_0xf48c('0xd')]=function(_0x2a54c7){return function(_0x376b1e){logger[_0xf48c('0xe')](_0x2a54c7,util[_0xf48c('0xa')](_0x376b1e,{'showHidden':![],'depth':null}));};};exports[_0xf48c('0xf')]=function(_0x119f98,_0x368ab2,_0x4b5b25){return{'message':_0x119f98,'unlock':_0x368ab2,'active':_0x4b5b25};};exports[_0xf48c('0x10')]=function(_0x2f5322,_0x51ad4f,_0x38cb4d){if(!_[_0xf48c('0x11')](_0x38cb4d)&&_0xf48c('0x12')===typeof _0x38cb4d&&!_[_0xf48c('0x13')](_0x38cb4d)){if(!_['isUndefined'](_0x51ad4f)&&_0xf48c('0x12')===typeof _0x51ad4f&&!_[_0xf48c('0x13')](_0x51ad4f)){return util['format'](_0xf48c('0x14'),_0x51ad4f,_0x38cb4d);}return util[_0xf48c('0x15')]('\x22%s\x22\x20<%s>',_0x38cb4d,_0x38cb4d);}if(!_['isUndefined'](_0x2f5322)&&_0xf48c('0x12')===typeof _0x2f5322&&!_['isEmpty'](_0x2f5322)){return _0x2f5322;}return _0xf48c('0x16');};exports[_0xf48c('0x17')]=function(_0x4d9353){if(_['isNil'](_0x4d9353)){return![];}return _0x4d9353;};exports['addVariables']=function(_0x1e9de0,_0xa38bcd,_0x508969,_0x4ffbfa,_0x5448ad,_0x379ca4){var _0xfb189b={'XMD-QUEUE':_0xa38bcd[_0xf48c('0x18')]?_0xa38bcd[_0xf48c('0x18')][_0xf48c('0x19')]:'','XMD-CALLERID':_0x4ffbfa,'XMD-CALLERID-PREVIEW':_0x379ca4?util['format']('\x22%s\x22\x20<%s>',_0x379ca4['calleridname'],_0x379ca4[_0xf48c('0x1a')]):_0x4ffbfa,'XMD-DIALID':_0x5448ad,'XMD-CONTACTID':_0xa38bcd['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4ffbfa,'XMD-VOICEQUEUEID':_0xa38bcd[_0xf48c('0x1b')],'XMD-DIALCHANNEL':_0x508969,'XMD-DIALTIMEOUT':_0x1e9de0[_0xf48c('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xf48c('0x15')](_0xf48c('0x1d'),_0x1e9de0['dialQueueProject2']?'g':'',_[_0xf48c('0x13')](_0x1e9de0[_0xf48c('0x1e')])?'':_0xf48c('0x1f')),'XMD-DIALURL':_0x1e9de0[_0xf48c('0x20')]||'','XMD-AGI':_0x1e9de0[_0xf48c('0x21')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1e9de0[_0xf48c('0x21')]):'NONE','XMD-AGIAFTER':_0x1e9de0['dialQueueProject2']?util[_0xf48c('0x15')](_0xf48c('0x22'),ipAgi,_0x1e9de0[_0xf48c('0x23')]):_0xf48c('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x379ca4?_0x379ca4[_0xf48c('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x379ca4?_0x379ca4[_0xf48c('0x26')]:'','XMD-DESTINATION':_0xf48c('0x27'),'SIPADDHEADER':_0xf48c('0x28')};if(!_[_0xf48c('0x13')](_0x1e9de0[_0xf48c('0x1e')])){_0xfb189b[util[_0xf48c('0x15')]('%s',_0xf48c('0x29'))]=_0x1e9de0[_0xf48c('0x1e')];_0xfb189b[util[_0xf48c('0x15')]('%s',_0xf48c('0x2a'))]=_0x5448ad;}if(_0xa38bcd&&_0xa38bcd[_0xf48c('0x2b')]){for(var _0x15aceb in _0xa38bcd[_0xf48c('0x2b')]){if(_0xa38bcd['Contact']['hasOwnProperty'](_0x15aceb)){if(!_[_0xf48c('0x2c')](_0xa38bcd[_0xf48c('0x2b')][_0x15aceb])&&_0x15aceb!=='id'&&_0x15aceb!==_0xf48c('0x2d')&&_0x15aceb!==_0xf48c('0x2e')&&_0x15aceb!=='updatedAt'){_0xfb189b[util[_0xf48c('0x15')](_0xf48c('0x2f'),_0xf48c('0x30'),_[_0xf48c('0x31')](_0x15aceb))]=_0xa38bcd[_0xf48c('0x2b')][_0x15aceb];}}}}return _0xfb189b;};exports['toLowerVariables']=function(_0x2dcc64){var _0x4dda30={};for(var _0x526a6e in _0x2dcc64){if(_0x2dcc64['hasOwnProperty'](_0x526a6e)){_0x4dda30[util[_0xf48c('0x15')]('%s',_[_0xf48c('0x32')](_0x526a6e))]=_0x2dcc64[_0x526a6e];}}return{'variables':_0x4dda30};};exports['updateOriginated']=function(_0x5192f4,_0x4c162e){if(!_[_0xf48c('0x2c')](_0x5192f4)){if(_0x5192f4['hasOwnProperty'](_0xf48c('0x33'))){if(_0x5192f4[_0xf48c('0x33')]>0x0){_0x5192f4[_0xf48c('0x33')]-=0x1;}else{logger[_0xf48c('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4c162e);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4c162e);}};exports['logBlacklist']=function(_0x28bd71){var _0xc525b=moment()['format'](_0xf48c('0x34'));_0x28bd71[_0xf48c('0x35')]=0xd;_0x28bd71['statedesc']=_0xf48c('0x36');_0x28bd71[_0xf48c('0x37')]=_0xc525b;_0x28bd71[_0xf48c('0x38')]=_0xc525b;_0x28bd71['endtime']=_0xc525b;};exports[_0xf48c('0x39')]=function(_0x1ca715,_0x1bd246,_0x42c636){var _0x361069=moment()['format'](_0xf48c('0x34'));_0x1ca715[_0xf48c('0x35')]=_0x1bd246;_0x1ca715[_0xf48c('0x3a')]=_0x42c636;_0x1ca715[_0xf48c('0x38')]=_0x361069;_0x1ca715[_0xf48c('0x3b')]=utils[_0xf48c('0x3c')](_0x1ca715['responsetime'],_0x1ca715[_0xf48c('0x37')]);};exports['logLookAgent']=function(_0x2b93ad,_0x30fb91,_0x448087){_0x2b93ad['membername']=_0x30fb91;_0x2b93ad[_0xf48c('0x3d')]=_0x448087;};exports['logCustomer']=function(_0xcabe4f,_0x185eda,_0x25698f){var _0x43367c=moment()[_0xf48c('0x15')](_0xf48c('0x34'));_0xcabe4f['state']=_0x185eda;_0xcabe4f[_0xf48c('0x3a')]=_0x25698f;_0xcabe4f[_0xf48c('0x38')]=_0xcabe4f[_0xf48c('0x38')]?_0xcabe4f[_0xf48c('0x38')]:_0x43367c;_0xcabe4f[_0xf48c('0x3e')]=_0xcabe4f[_0xf48c('0x3e')]?_0xcabe4f[_0xf48c('0x3e')]:_0x43367c;_0xcabe4f['ringtime']=utils['getSeconds'](_0xcabe4f[_0xf48c('0x38')]||0x0,_0xcabe4f[_0xf48c('0x37')]||0x0);_0xcabe4f['talktime']=_0xcabe4f[_0xf48c('0x3f')]?utils[_0xf48c('0x3c')](_0xcabe4f[_0xf48c('0x3e')],_0xcabe4f[_0xf48c('0x3f')]):0x0;};exports[_0xf48c('0x40')]=function(_0x462602){return _0x462602===_0xf48c('0x41');};exports[_0xf48c('0x42')]=function(_0x3c454f,_0x42dd6f,_0x555bc7,_0x2a3ff8,_0xe290a5){var _0x16d42d=_0x2a3ff8?_0xf48c('0x43'):_0x3c454f[_0xf48c('0x44')];_0x16d42d=_0xe290a5?_0xf48c('0x45'):_0x16d42d;return{'actionid':_0x3c454f[_0xf48c('0x46')],'action':_0xf48c('0x47'),'channel':_0x3c454f[_0xf48c('0x48')],'callerid':util[_0xf48c('0x15')](_0xf48c('0x14'),_0x16d42d,_0x3c454f[_0xf48c('0x1a')]),'Exten':_0xf48c('0x27'),'Context':_0xf48c('0x49'),'Priority':'1','variable':_0x555bc7,'timeout':(_0x42dd6f[_0xf48c('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3c454f[_0xf48c('0x46')]};};exports[_0xf48c('0x4b')]=function(_0x3680fe){return _0x3680fe[_0xf48c('0x4c')]+_0x3680fe[_0xf48c('0x4d')]+_0x3680fe[_0xf48c('0x4e')]+_0x3680fe[_0xf48c('0x4f')]+_0x3680fe[_0xf48c('0x50')];};exports[_0xf48c('0x51')]=function(_0x5ad609){var _0x505b63=_[_0xf48c('0x52')](_0x5ad609);_0x505b63[_0xf48c('0x35')]=0xf;_0x505b63['statedesc']='Global';return _0x505b63;};exports['scheduledAt']=function(_0x5e91ed,_0x40b9a7,_0xa9932d){var _0x30c981={};_0x30c981[_0x40b9a7]=_0x5e91ed[_0x40b9a7];_0x30c981[_0xf48c('0x53')]=![];_0x30c981['scheduledat']=moment()[_0xf48c('0x54')](_0xa9932d,_0xf48c('0x55'))['format'](_0xf48c('0x34'));_0x30c981[_0xf48c('0x56')]=_0x5e91ed['ContactId'];_0x30c981[_0xf48c('0x57')]=_0x5e91ed[_0xf48c('0x57')];_0x30c981[_0xf48c('0x1b')]=_0x5e91ed[_0xf48c('0x1b')]||undefined;return _0x30c981;};exports[_0xf48c('0x58')]=function(_0x3df361,_0x46ec7f){if(!_['isNil'](_0x3df361)){if(_0x3df361['pTalking']>0x0){_0x3df361['pTalking']-=0x1;}else{logger[_0xf48c('0x9')](_0x46ec7f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xf48c('0x9')](_0x46ec7f,_0xf48c('0x59'));}};exports[_0xf48c('0x5a')]=function(_0x591707){if(_0x591707<=0x0){return!![];}return![];};function buildObj(_0x4f6609,_0x2d26cb,_0x1c2013){_0x4f6609[_0xf48c('0x5b')]=_0x2d26cb;_0x4f6609[_0xf48c('0x19')]=_0x4f6609[_0xf48c('0x5c')];_0x4f6609[_0xf48c('0x5d')]=_0x4f6609[_0xf48c('0x48')];_0x4f6609[_0xf48c('0x5e')]=_0xf48c('0x5f');if(_0x1c2013){_0x4f6609[_0xf48c('0x60')]=_0x1c2013[_0xf48c('0x60')];}return _0x4f6609;}exports[_0xf48c('0x61')]=buildObj;exports[_0xf48c('0x62')]=function(_0x5daf1d){var _0x334c7d={};_0x334c7d[_0xf48c('0x5c')]=_0x5daf1d[_0xf48c('0x5c')];_0x334c7d[_0xf48c('0x5d')]=_0x5daf1d[_0xf48c('0x48')];_0x334c7d['uniqueid']=_0x5daf1d[_0xf48c('0x46')];return _0x334c7d;};exports[_0xf48c('0x63')]=function(_0xee46a1){var _0x13dc21=[];for(var _0x241eae in _0xee46a1){if(_0xee46a1['hasOwnProperty'](_0x241eae)){if(!_[_0xf48c('0x2c')](_0xee46a1[_0x241eae])&&_0xee46a1[_0x241eae][_0xf48c('0x35')]===_0xf48c('0x64')&&_0xee46a1[_0x241eae]['status']===_0xf48c('0x65')){_0x13dc21[_0xf48c('0x66')](_0xee46a1[_0x241eae]['id']);}}}return _0x13dc21;};exports[_0xf48c('0x67')]=function(_0x19d73d){var _0x28115f=moment()[_0xf48c('0x68')](0x0);var _0xc441c4=moment(_0x19d73d)[_0xf48c('0x68')](0x0);return _0x28115f[_0xf48c('0x69')](_0xc441c4,'seconds');};exports[_0xf48c('0x6a')]=function(_0xa5157c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xa5157c['ContactId'],'ListId':_0xa5157c[_0xf48c('0x57')],'VoiceQueueId':_0xa5157c[_0xf48c('0x1b')]||undefined,'CampaignId':_0xa5157c[_0xf48c('0x6b')]||undefined};};exports[_0xf48c('0x6c')]=function(_0x246e05){if(_0x246e05==='uniqueid'||_0x246e05==='idContact'||_0x246e05===_0xf48c('0x5c')||_0x246e05===_0xf48c('0x6d')||_0x246e05===_0xf48c('0x6e')||_0x246e05==='dialAnswer'||_0x246e05==='membername'||_0x246e05==='channelAgent'||_0x246e05===_0xf48c('0x44')||_0x246e05==='active'||_0x246e05===_0xf48c('0x1a')||_0x246e05===_0xf48c('0x6f')||_0x246e05===_0xf48c('0x4c')||_0x246e05==='countcongestionretry'||_0x246e05===_0xf48c('0x4e')||_0x246e05===_0xf48c('0x70')||_0x246e05===_0xf48c('0x71')||_0x246e05===_0xf48c('0x72')||_0x246e05===_0xf48c('0x73')||_0x246e05===_0xf48c('0x74')||_0x246e05==='ContactId'||_0x246e05===_0xf48c('0x57')||_0x246e05===_0xf48c('0x3d')||_0x246e05===_0xf48c('0x1b')||_0x246e05===_0xf48c('0x75')||_0x246e05===_0xf48c('0x76')||_0x246e05===_0xf48c('0x77')||_0x246e05===_0xf48c('0x78')||_0x246e05==='xmd-listid'||_0x246e05===_0xf48c('0x79')||_0x246e05===_0xf48c('0x7a')||_0x246e05===_0xf48c('0x7b')||_0x246e05===_0xf48c('0x7c')||_0x246e05===_0xf48c('0x7d')||_0x246e05===_0xf48c('0x7e')||_0x246e05===_0xf48c('0x7f')||_0x246e05===_0xf48c('0x80')||_0x246e05===_0xf48c('0x81')||_0x246e05===_0xf48c('0x82')||_0x246e05===_0xf48c('0x83')||_0x246e05===_0xf48c('0x84')||_0x246e05===_0xf48c('0x85')||_0x246e05===_0xf48c('0x86')||_0x246e05===_0xf48c('0x87')||_0x246e05===_0xf48c('0x88')||_0x246e05===_0xf48c('0x89')||_0x246e05===_0xf48c('0x8a')||_0x246e05===_0xf48c('0x83')||_0x246e05===_0xf48c('0x84')||_0x246e05===_0xf48c('0x85')||_0x246e05===_0xf48c('0x86')||_0x246e05===_0xf48c('0x87')||_0x246e05===_0xf48c('0x88')||_0x246e05==='rtpaudioqosrtt'||_0x246e05==='rtpaudioqosrttbridged'||_0x246e05===_0xf48c('0x8b')||_0x246e05==='bridgepvtcallid'||_0x246e05==='state'||_0x246e05===_0xf48c('0x3a')){return![];}return!![];};exports[_0xf48c('0x8c')]=function(_0x1587b6,_0x303b0d){var _0x82e68f,_0x5dbe0c,_0x32daee;if(_0x303b0d<=0x0){_0x303b0d=0x1;}_0x82e68f=new RegExp(_0xf48c('0x8d')+_0x303b0d+'}$');_0x5dbe0c=Math[_0xf48c('0x8e')](0xa,_0x303b0d-0x1);_0x32daee=Math[_0xf48c('0x8e')](0xa,_0x303b0d)-0x1;return util[_0xf48c('0x15')]('%s',_['replace'](_0x1587b6,_0x82e68f,_['random'](_0x5dbe0c,_0x32daee)));};exports[_0xf48c('0x8f')]=function(_0x2ed93e){var _0x271c0f=_0x2ed93e['match'](/"(.*?)"/);return _0x271c0f?_0x271c0f[0x1]:_0x2ed93e;};exports[_0xf48c('0x90')]=function(_0x8e0240){var _0x125781=_0x8e0240[_0xf48c('0x91')](/<(.*?)>/);return _0x125781?_0x125781[0x1]:_0x8e0240;};function buildNoAnswerEventPayload(_0x4c5c55,_0x205d0a){var _0x3c32f9=buildObj(_0x4c5c55,'noanswer');if(!_[_0xf48c('0x13')](_0x205d0a[_0xf48c('0x92')])){Object[_0xf48c('0x93')](_0x205d0a[_0xf48c('0x92')])['forEach'](function(_0x4c01ea){_0x3c32f9[_0x4c01ea[_0xf48c('0x94')]()]=_0x205d0a[_0xf48c('0x92')][_0x4c01ea];});}return _0x3c32f9;}exports[_0xf48c('0x95')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 64370dc..631fcd5 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 _0x6906=['queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x6906,0x76));var _0x6690=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6906[_0x3b380d];return _0x54502b;};'use strict';exports[_0x6690('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6690('0x1'),'required':!![]},'membername':{'type':_0x6690('0x1'),'required':!![]},'penalty':{'type':_0x6690('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6690('0x3')]={'queue':{'type':_0x6690('0x1'),'required':!![]},'interface':{'type':_0x6690('0x1'),'required':!![]}};exports[_0x6690('0x4')]={'interface':{'type':_0x6690('0x1'),'required':!![]},'paused':{'type':_0x6690('0x5')},'reason':{'type':_0x6690('0x1'),'required':![]}};exports[_0x6690('0x6')]={'module':{'type':_0x6690('0x1'),'required':![]}};exports[_0x6690('0x7')]={'uniqueid':{'type':_0x6690('0x1'),'required':!![]}};exports[_0x6690('0x8')]={'uniqueid':{'type':_0x6690('0x1'),'required':!![]},'filename':{'type':_0x6690('0x1')},'format':{'type':_0x6690('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x6690('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6690('0xa')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x2866=['queueremove','queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4c4bf6,_0x78115f){var _0x206ad4=function(_0x543957){while(--_0x543957){_0x4c4bf6['push'](_0x4c4bf6['shift']());}};_0x206ad4(++_0x78115f);}(_0x2866,0x129));var _0x6286=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x2866[_0x2dc7c9];return _0x3e6536;};'use strict';exports[_0x6286('0x0')]={'queue':{'type':_0x6286('0x1'),'required':!![]},'interface':{'type':_0x6286('0x1'),'required':!![]},'membername':{'type':_0x6286('0x1'),'required':!![]},'penalty':{'type':_0x6286('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6286('0x3')]={'queue':{'type':_0x6286('0x1'),'required':!![]},'interface':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x6286('0x5')},'reason':{'type':_0x6286('0x1'),'required':![]}};exports[_0x6286('0x6')]={'module':{'type':_0x6286('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x7')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]},'filename':{'type':_0x6286('0x1')},'format':{'type':_0x6286('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x6286('0x8')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x9')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]},'exten':{'type':_0x6286('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ab35fad..0a7b26e 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x550832,_0xc90caa){var _0x216d51=function(_0x52e7f6){while(--_0x52e7f6){_0x550832['push'](_0x550832['shift']());}};_0x216d51(++_0xc90caa);}(_0xadb5,0xad));var _0x5adb=function(_0x59571a,_0xb390dd){_0x59571a=_0x59571a-0x0;var _0x2e014a=_0xadb5[_0x59571a];return _0x2e014a;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x3acef7,_0x52f2ae){var _0x7e935a=function(_0x55ddc1){while(--_0x55ddc1){_0x3acef7['push'](_0x3acef7['shift']());}};_0x7e935a(++_0x52f2ae);}(_0x757a,0xde));var _0xa757=function(_0xc70213,_0x450c05){_0xc70213=_0xc70213-0x0;var _0x45f9d9=_0x757a[_0xc70213];return _0x45f9d9;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index e710f26..87c3d0a 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c50=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x33dde2,_0x4b214a){var _0x5d55ef=function(_0x10268b){while(--_0x10268b){_0x33dde2['push'](_0x33dde2['shift']());}};_0x5d55ef(++_0x4b214a);}(_0x1c50,0xf3));var _0x01c5=function(_0x2622d2,_0xaf12f9){_0x2622d2=_0x2622d2-0x0;var _0x52ddb9=_0x1c50[_0x2622d2];return _0x52ddb9;};'use strict';function mergeDBDataToRealtime(_0x1dc234,_0x3b152f){var _0x22f001=Object[_0x01c5('0x0')]({},_0x1dc234);for(var _0x51c2f2 in _0x3b152f){if(_0x22f001[_0x01c5('0x1')](_0x51c2f2)){_0x22f001[_0x51c2f2]=_0x3b152f[_0x51c2f2];}}return _0x22f001;}exports[_0x01c5('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x1a5a=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x19527a,_0x1857f6){var _0x95df0a=function(_0x518ae8){while(--_0x518ae8){_0x19527a['push'](_0x19527a['shift']());}};_0x95df0a(++_0x1857f6);}(_0x1a5a,0x114));var _0xa1a5=function(_0x5c5fe7,_0x2a64eb){_0x5c5fe7=_0x5c5fe7-0x0;var _0xd817f=_0x1a5a[_0x5c5fe7];return _0xd817f;};'use strict';function mergeDBDataToRealtime(_0x1932df,_0x356780){var _0x27d75c=Object[_0xa1a5('0x0')]({},_0x1932df);for(var _0x447f87 in _0x356780){if(_0x27d75c[_0xa1a5('0x1')](_0x447f87)){_0x27d75c[_0x447f87]=_0x356780[_0x447f87];}}return _0x27d75c;}exports[_0xa1a5('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d18076b..d8d77e6 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 _0xc8fb=['membername','monitor','monitors','monitorFilename','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','phone','lastIndexOf','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','keys','channel','split','getAgentByInternal','calleridnum','outbound','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xc8fb,0xc0));var _0xbc8f=function(_0x1ec3e3,_0x1b1301){_0x1ec3e3=_0x1ec3e3-0x0;var _0x45178d=_0xc8fb[_0x1ec3e3];return _0x45178d;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xbc8f('0x0'));var config=require(_0xbc8f('0x1'));var ami=require(_0xbc8f('0x2'));var RpcVoiceAgentReport=require(_0xbc8f('0x3'));var RpcVoiceCallReport=require(_0xbc8f('0x4'));var RpcVoiceDialReport=require(_0xbc8f('0x5'));var RpcMemberReport=require(_0xbc8f('0x6'));var RpcVoiceQueueReport=require(_0xbc8f('0x7'));var RpcVoiceRecording=require(_0xbc8f('0x8'));var RpcVoiceTransferReport=require(_0xbc8f('0x9'));var VoiceQueueReport=require(_0xbc8f('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xbc8f('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3a85b5){this[_0xbc8f('0xc')]=_0x3a85b5;this[_0xbc8f('0xd')]=_0x3a85b5['agents'];this[_0xbc8f('0xe')]=_0x3a85b5['telephones'];}Report[_0xbc8f('0xf')][_0xbc8f('0x10')]=function(_0x19eeed){var _0x5087a6=new VoiceQueueReport(this[_0xbc8f('0xc')]);var _0x21a20b=new VoiceAgentReport(this[_0xbc8f('0xc')]);var _0x5eee8b=new VoiceDialReport(this[_0xbc8f('0xc')]);var _0x2ba14a=new VoiceCallReport(this['realtime']);var _0x50bd53=new UserReport(this['realtime']);if(config[_0xbc8f('0x11')]&&config[_0xbc8f('0x11')][_0xbc8f('0x12')]){ami['on'](_0xbc8f('0x13'),this[_0xbc8f('0x14')][_0xbc8f('0x15')](this));ami['on']('custom:voiceCallReport',this[_0xbc8f('0x16')][_0xbc8f('0x15')](this));ami['on'](_0xbc8f('0x17'),this[_0xbc8f('0x18')][_0xbc8f('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xbc8f('0x19')][_0xbc8f('0x15')](this));ami['on'](_0xbc8f('0x1a'),this[_0xbc8f('0x1b')][_0xbc8f('0x15')](this));ami['on'](_0xbc8f('0x1c'),this[_0xbc8f('0x1d')][_0xbc8f('0x15')](this));}};Report[_0xbc8f('0xf')][_0xbc8f('0x1e')]=function(_0x1de202){var _0x381771;_0x381771=_[_0xbc8f('0x1f')](this[_0xbc8f('0xd')],function(_0x5ed0e6){return _0x5ed0e6[_0xbc8f('0x20')]==_0x1de202||_0x5ed0e6['name']==_0x1de202;});if(_[_0xbc8f('0x21')](_0x381771)){var _0x51eebf=_[_0xbc8f('0x1f')](this[_0xbc8f('0xe')],function(_0x2f05af){return _0x2f05af[_0xbc8f('0x20')]==_0x1de202||_0x2f05af[_0xbc8f('0x22')]==_0x1de202;});if(_0x51eebf){_0x381771=_['find'](this['agents'],function(_0x38a574){return _0x38a574[_0xbc8f('0x23')]==util['format'](_0xbc8f('0x24'),_0x51eebf[_0xbc8f('0x22')]);});}}return _0x381771;};Report[_0xbc8f('0xf')][_0xbc8f('0x14')]=function(_0x4861bf){for(var _0x5a0352=0x0;_0x5a0352<_0x4861bf[_0xbc8f('0x25')];_0x5a0352+=0x1){var _0x33f180=this[_0xbc8f('0x1e')](_0x4861bf[_0x5a0352][_0xbc8f('0x26')]);if(_0x33f180){_0x4861bf[_0x5a0352][_0xbc8f('0x20')]=_0x33f180[_0xbc8f('0x20')];_0x4861bf[_0x5a0352][_0xbc8f('0x27')]=!![];_0x4861bf[_0x5a0352][_0xbc8f('0x28')]=_0x33f180['name'];_0x4861bf[_0x5a0352][_0xbc8f('0x23')]=_[_0xbc8f('0x21')](_0x33f180[_0xbc8f('0x23')])?util[_0xbc8f('0x29')](_0xbc8f('0x24'),_0x33f180['name']):_0x33f180[_0xbc8f('0x23')];if(_0x4861bf[_0x5a0352][_0xbc8f('0x2a')]){_0x4861bf[_0x5a0352][_0xbc8f('0x2b')]=moment()[_0xbc8f('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4861bf[_0x5a0352][_0xbc8f('0x2c')]){_0x4861bf[_0x5a0352][_0xbc8f('0x2d')]=moment()[_0xbc8f('0x29')](_0xbc8f('0x2e'));}RpcMemberReport[_0xbc8f('0x14')](_0x4861bf[_0x5a0352]);}RpcVoiceQueueReport[_0xbc8f('0x2f')](_0x4861bf[_0x5a0352]);}};function extractCalleridNumber(_0x284bb5){var _0x1514e0=_0x284bb5[_0xbc8f('0x30')](/<(.*?)>/);return _0x1514e0?_0x1514e0[0x1]:_0x284bb5;}Report[_0xbc8f('0xf')]['getAgentByInternal']=function(_0x5ab4c5){for(var _0x10b6aa=0x0;_0x10b6aa/);return _0x5a7703?_0x5a7703[0x1]:_0x30091f;}Report[_0x4ef7('0x1e')][_0x4ef7('0x30')]=function(_0x484316){for(var _0x1aa87c=0x0;_0x1aa87c',_0x26665a[_0x4ef7('0x47')],_0x26665a[_0x4ef7('0x44')]);}if(RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a['linkedid']]){var _0x49dd19=RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a['linkedid']];_0x49dd19[_0x4ef7('0x49')]=_0x26665a[_0x4ef7('0x4a')];RpcVoiceTransferReport['blindTransfer'](_0x49dd19);delete RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a[_0x4ef7('0x4b')]];}if(_[_0x4ef7('0x22')](_0x26665a[_0x4ef7('0x37')])){_0x26665a[_0x4ef7('0x37')]=this[_0x4ef7('0x32')](_0x26665a);}if(_[_0x4ef7('0x22')](_0x26665a[_0x4ef7('0x4c')])){var _0x5df507=_0x26665a[_0x4ef7('0x33')][_0x4ef7('0x4d')]('-')[0x0];var _0x5d790b=this[_0x4ef7('0xe')][_0x5df507];if(!_0x5d790b)_0x5d790b=this['getAgentByInternal'](_0x26665a[_0x4ef7('0x23')]);if(_0x5d790b){_0x26665a['UserId']=_0x5d790b['id'];_0x26665a['membername']=_0x5d790b[_0x4ef7('0x21')];}}RpcVoiceCallReport[_0x4ef7('0x2e')](_0x26665a);if(_0x26665a[_0x4ef7('0x4e')]){for(var _0x52ce38=0x0;_0x52ce38<_0x26665a[_0x4ef7('0x4f')][_0x4ef7('0x27')];_0x52ce38+=0x1){_0x26665a[_0x4ef7('0x50')]=_0x26665a[_0x4ef7('0x4f')][_0x52ce38][_0x4ef7('0x51')];_0x26665a[_0x4ef7('0x52')]=_0x26665a['monitors'][_0x52ce38][_0x4ef7('0x52')];if(_0x26665a[_0x4ef7('0x36')]==_0x4ef7('0x40')){_0x26665a[_0x4ef7('0x44')]=_0x26665a[_0x4ef7('0x28')];_0x26665a['calleridname']=_0x26665a[_0x4ef7('0x53')];_0x26665a['connectedlinenum']=_0x26665a[_0x4ef7('0x23')];_0x26665a[_0x4ef7('0x53')]=_0x26665a['membername'];_0x26665a[_0x4ef7('0x36')]=_0x26665a[_0x4ef7('0x42')];}else if(_0x26665a[_0x4ef7('0x36')]==_0x4ef7('0x54')){_0x26665a['calleridnum']=_0x26665a[_0x4ef7('0x35')];_0x26665a[_0x4ef7('0x36')]=_0x26665a[_0x4ef7('0x42')];}RpcVoiceRecording['create'](_0x26665a);}}};Report[_0x4ef7('0x1e')][_0x4ef7('0x18')]=function(_0x391f51){if(_[_0x4ef7('0x55')](_0x391f51)){_0x391f51[_0x4ef7('0x56')](function(_0x3e3a9d){RpcVoiceAgentReport['create'](_0x3e3a9d);});}else{RpcVoiceAgentReport[_0x4ef7('0x2e')](_0x391f51);}};Report['prototype']['voiceDialReport']=function(_0x1e57bd){RpcVoiceDialReport[_0x4ef7('0x2e')](_0x1e57bd);var _0x3df7a0;var _0x1565de;var _0x47956f=_0x1e57bd[_0x4ef7('0x33')];if(_[_0x4ef7('0x57')](_0x47956f,_0x4ef7('0x58'))){_0x1565de=_0x47956f[_0x4ef7('0x59')](_0x47956f['indexOf']('/')+0x1,_0x47956f[_0x4ef7('0x5a')]('@'));_0x3df7a0=_[_0x4ef7('0x20')](this['agents'],function(_0x578096){return _0x578096[_0x4ef7('0x5b')]==_0x1565de||_0x578096[_0x4ef7('0x5c')]==_0x1565de||_0x578096[_0x4ef7('0x23')]==_0x1565de;});}else{_0x1565de=_0x47956f[_0x4ef7('0x59')](_0x47956f['indexOf']('/')+0x1,_0x47956f[_0x4ef7('0x5d')]('-'));_0x3df7a0=this[_0x4ef7('0x1f')](_0x1565de);}if(_0x3df7a0){_0x1e57bd['interface']=_[_0x4ef7('0x22')](_0x3df7a0['interface'])?util[_0x4ef7('0x25')](_0x4ef7('0x26'),_0x3df7a0['name']):_0x3df7a0[_0x4ef7('0x24')];_0x1e57bd[_0x4ef7('0x5e')]=_0x3df7a0[_0x4ef7('0x21')];_0x1e57bd[_0x4ef7('0x23')]=_0x3df7a0[_0x4ef7('0x23')];RpcMemberReport[_0x4ef7('0x1a')](_0x1e57bd);}};Report[_0x4ef7('0x1e')]['blindTransfer']=function(_0x4847e8){RpcVoiceTransferReport[_0x4ef7('0x48')][_0x4847e8[_0x4ef7('0x5f')]]=_0x4847e8;};Report[_0x4ef7('0x1e')][_0x4ef7('0x1d')]=function(_0x5c8fd4){RpcVoiceTransferReport[_0x4ef7('0x1d')](_0x5c8fd4);};module[_0x4ef7('0x60')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 273768c..9ae6da6 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 _0xf117=['../ami','redis','defaults','localhost','socket.io-emitter','agents','telephones','registryentry','syncRegistry','bind','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','inspect','actionDeviceStateList','catch','error','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','state','debug','[userReport][registry]','find','trunks','username','stateRegistry','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','startsWith','Local','substring','indexOf','mobile','accountcode','local','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','util','ioredis','../../../config/environment','ami'];(function(_0x1dff83,_0x2eab20){var _0x1ede0a=function(_0x2d8898){while(--_0x2d8898){_0x1dff83['push'](_0x1dff83['shift']());}};_0x1ede0a(++_0x2eab20);}(_0xf117,0x11b));var _0x7f11=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xf117[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x7f11('0x0'));var moment=require('moment');var util=require(_0x7f11('0x1'));var Redis=require(_0x7f11('0x2'));var BPromise=require('bluebird');var config=require(_0x7f11('0x3'));var logger=require('../../../config/logger')(_0x7f11('0x4'));var ami=require(_0x7f11('0x5'));config[_0x7f11('0x6')]=_[_0x7f11('0x7')](config['redis'],{'host':_0x7f11('0x8'),'port':0x18eb});var io=require(_0x7f11('0x9'))(new Redis(config['redis']));function UserReport(_0x372134){this['trunks']=_0x372134['trunks'];this[_0x7f11('0xa')]=_0x372134['agents'];this['telephones']=_0x372134[_0x7f11('0xb')];ami['on'](_0x7f11('0xc'),this[_0x7f11('0xd')]['bind'](this));ami['on']('registry',this[_0x7f11('0xd')][_0x7f11('0xe')](this));ami['on']('devicestatechange',this[_0x7f11('0xf')]['bind'](this));ami['on'](_0x7f11('0x10'),this[_0x7f11('0x11')][_0x7f11('0xe')](this));return this[_0x7f11('0x12')]();}function showSipRegistrations(){Promise[_0x7f11('0x13')]()[_0x7f11('0x14')](ami[_0x7f11('0x15')]())['catch'](function(_0x27d028){logger['error']('[userReport][sipshowregistry]',util[_0x7f11('0x16')](_0x27d028,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0x7f11('0x17')]())[_0x7f11('0x18')](function(_0x43db07){logger[_0x7f11('0x19')](_0x7f11('0x1a'),util['inspect'](_0x43db07,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x7f11('0x14')](ami['actionSipPeerStatus']())[_0x7f11('0x18')](function(_0x1b6e0b){logger['error'](_0x7f11('0x1b'),util['inspect'](_0x1b6e0b,{'showHidden':![],'depth':null}));});}UserReport[_0x7f11('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x7f11('0x13')]()[_0x7f11('0x14')](showSipRegistrations())[_0x7f11('0x14')](listDeviceStates())[_0x7f11('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x7f11('0x1c')][_0x7f11('0x1d')]=function(_0x3572d1){return _0x3572d1!==null&&!_[_0x7f11('0x1e')](_0x3572d1);};UserReport['prototype'][_0x7f11('0x1f')]=function(_0x10a8f2,_0x505658,_0x1748c0){io['to'](_0x10a8f2)[_0x7f11('0x1f')](_0x505658,_0x1748c0);};UserReport[_0x7f11('0x1c')][_0x7f11('0xd')]=function(_0x14ee0c){try{if(this[_0x7f11('0x1d')](_0x14ee0c)){logger[_0x7f11('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x14ee0c['username'],_0x14ee0c[_0x7f11('0x21')]);logger[_0x7f11('0x22')](_0x7f11('0x23'),util['inspect'](_0x14ee0c,{'showHidden':![],'depth':null}));var _0x5c2996=_[_0x7f11('0x24')](this[_0x7f11('0x25')],{'defaultuser':_0x14ee0c[_0x7f11('0x26')]});if(_0x5c2996){_0x14ee0c[_0x7f11('0x27')]=_0x14ee0c[_0x7f11('0x21')];_['merge'](_0x5c2996,_[_0x7f11('0x28')](_0x14ee0c,['event',_0x7f11('0x29'),_0x7f11('0x26'),_0x7f11('0x21')]));logger[_0x7f11('0x22')](_0x7f11('0x2a'),util[_0x7f11('0x16')](_0x5c2996,{'showHidden':![],'depth':null}));this[_0x7f11('0x1f')](util['format'](_0x7f11('0x2b'),_0x5c2996[_0x7f11('0x2c')]),_0x7f11('0x2d'),_0x5c2996);}}}catch(_0x777e9a){logger[_0x7f11('0x19')](_0x7f11('0x23'),util[_0x7f11('0x16')](_0x777e9a,{'showHidden':![],'depth':null}));}};UserReport[_0x7f11('0x1c')][_0x7f11('0xf')]=function(_0x2ed8a7){try{if(this[_0x7f11('0x1d')](_0x2ed8a7)){logger['info'](_0x7f11('0x2e'),_0x2ed8a7[_0x7f11('0x2f')],_0x2ed8a7[_0x7f11('0x21')]);logger[_0x7f11('0x22')](_0x7f11('0x30'),util[_0x7f11('0x16')](_0x2ed8a7,{'showHidden':![],'depth':null}));if(this[_0x7f11('0xa')][_0x2ed8a7[_0x7f11('0x2f')]]){if(!this[_0x7f11('0xa')][_0x2ed8a7[_0x7f11('0x2f')]]['local']||_0x2ed8a7['state'][_0x7f11('0x31')]()==_0x7f11('0x32')){this[_0x7f11('0xa')][_0x2ed8a7['device']]['local']=![];if(this[_0x7f11('0xa')][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x21')]!==_0x2ed8a7[_0x7f11('0x21')][_0x7f11('0x31')]()){this[_0x7f11('0xa')][_0x2ed8a7['device']][_0x7f11('0x33')]=_[_0x7f11('0x34')](moment()['format']('x'));}this['agents'][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x21')]=_0x2ed8a7[_0x7f11('0x21')][_0x7f11('0x31')]();this[_0x7f11('0xa')][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x35')](_0x2ed8a7);}}else if(this[_0x7f11('0xb')][_0x2ed8a7['device']]){if(this[_0x7f11('0xb')][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x21')]!==_0x2ed8a7['state'][_0x7f11('0x31')]()){this[_0x7f11('0xb')][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x33')]=_[_0x7f11('0x34')](moment()[_0x7f11('0x36')]('x'));}this[_0x7f11('0xb')][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x21')]=_0x2ed8a7[_0x7f11('0x21')]['toLowerCase']();logger[_0x7f11('0x22')](_0x7f11('0x37'),util[_0x7f11('0x16')](this[_0x7f11('0xb')][_0x2ed8a7['device']],{'showHidden':![],'depth':null}));this[_0x7f11('0x1f')](util[_0x7f11('0x36')](_0x7f11('0x38'),this[_0x7f11('0xb')][_0x2ed8a7['device']][_0x7f11('0x2c')]),_0x7f11('0x39'),this[_0x7f11('0xb')][_0x2ed8a7[_0x7f11('0x2f')]]);}else if(this['trunks'][_0x2ed8a7[_0x7f11('0x2f')]]){if(this['trunks'][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x21')]!==_0x2ed8a7[_0x7f11('0x21')]['toLowerCase']()){this['trunks'][_0x2ed8a7[_0x7f11('0x2f')]][_0x7f11('0x33')]=_['toNumber'](moment()[_0x7f11('0x36')]('x'));}this[_0x7f11('0x25')][_0x2ed8a7['device']]['state']=_0x2ed8a7[_0x7f11('0x21')]['toLowerCase']();logger[_0x7f11('0x22')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x7f11('0x25')][_0x2ed8a7['device']],{'showHidden':![],'depth':null}));this[_0x7f11('0x1f')](util['format'](_0x7f11('0x2b'),this[_0x7f11('0x25')][_0x2ed8a7['device']][_0x7f11('0x2c')]),'trunk:save',this['trunks'][_0x2ed8a7[_0x7f11('0x2f')]]);}else if(_[_0x7f11('0x3a')](_0x2ed8a7['device'],_0x7f11('0x3b'))){var _0x20b29c=_0x2ed8a7[_0x7f11('0x2f')];var _0x3af28f=_0x20b29c[_0x7f11('0x3c')](_0x20b29c[_0x7f11('0x3d')]('/')+0x1,_0x20b29c['indexOf']('@'));var _0x5acd69=_['find'](this[_0x7f11('0xa')],function(_0x4c7636){return _0x4c7636[_0x7f11('0x3e')]==_0x3af28f||_0x4c7636['phone']==_0x3af28f||_0x4c7636[_0x7f11('0x3f')]==_0x3af28f;});if(_0x5acd69){if(_0x5acd69[_0x7f11('0x21')]!==_0x2ed8a7['state'][_0x7f11('0x31')]()){_0x5acd69['stateTime']=_['toNumber'](moment()['format']('x'));}_0x5acd69[_0x7f11('0x21')]=_0x2ed8a7['state']['toLowerCase']();_0x5acd69[_0x7f11('0x40')]=!![];_0x5acd69[_0x7f11('0x35')](_0x2ed8a7);}}}}catch(_0x260246){logger[_0x7f11('0x19')](_0x7f11('0x30'),util[_0x7f11('0x16')](_0x260246,{'showHidden':![],'depth':null}));}};UserReport[_0x7f11('0x1c')]['syncPeerStatus']=function(_0x2797c2){try{if(this['isNotNull'](_0x2797c2)&&this[_0x7f11('0x1d')](_0x2797c2['peerstatus'])){logger[_0x7f11('0x20')](_0x7f11('0x41'),_0x2797c2['peer'],_0x2797c2[_0x7f11('0x42')],_0x2797c2[_0x7f11('0x10')]);logger[_0x7f11('0x22')](_0x7f11('0x43'),util[_0x7f11('0x16')](_0x2797c2,{'showHidden':![],'depth':null}));if(this[_0x7f11('0xa')][_0x2797c2[_0x7f11('0x44')]]){if(!this[_0x7f11('0xa')][_0x2797c2[_0x7f11('0x44')]]['local']||_0x2797c2[_0x7f11('0x10')][_0x7f11('0x31')]()=='registered'){this[_0x7f11('0xa')][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x40')]=![];this[_0x7f11('0xa')][_0x2797c2['peer']][_0x7f11('0x45')]=_0x2797c2[_0x7f11('0x10')]['toLowerCase']();this[_0x7f11('0xa')][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x42')]=_0x2797c2[_0x7f11('0x42')];this[_0x7f11('0xa')][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x35')](_0x2797c2);}}else if(this[_0x7f11('0xb')][_0x2797c2['peer']]){this['telephones'][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x45')]=_0x2797c2[_0x7f11('0x10')][_0x7f11('0x31')]();this[_0x7f11('0xb')][_0x2797c2['peer']][_0x7f11('0x42')]=_0x2797c2['address'];logger[_0x7f11('0x22')](_0x7f11('0x46'),util[_0x7f11('0x16')](this[_0x7f11('0xb')][_0x2797c2['peer']],{'showHidden':![],'depth':null}));this[_0x7f11('0x1f')](util[_0x7f11('0x36')](_0x7f11('0x38'),this[_0x7f11('0xb')][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x2c')]),'telephone:save',this['telephones'][_0x2797c2[_0x7f11('0x44')]]);}else if(this[_0x7f11('0x25')][_0x2797c2[_0x7f11('0x44')]]){this[_0x7f11('0x25')][_0x2797c2['peer']][_0x7f11('0x45')]=_0x2797c2[_0x7f11('0x10')][_0x7f11('0x31')]();this[_0x7f11('0x25')][_0x2797c2[_0x7f11('0x44')]]['address']=_0x2797c2[_0x7f11('0x42')];logger[_0x7f11('0x22')](_0x7f11('0x47'),util[_0x7f11('0x16')](this[_0x7f11('0x25')][_0x2797c2[_0x7f11('0x44')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x7f11('0x36')]('trunk:%s',this[_0x7f11('0x25')][_0x2797c2[_0x7f11('0x44')]][_0x7f11('0x2c')]),_0x7f11('0x2d'),this[_0x7f11('0x25')][_0x2797c2[_0x7f11('0x44')]]);}}}catch(_0x550365){logger[_0x7f11('0x19')](_0x7f11('0x43'),util['inspect'](_0x550365,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xa177=['trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','username','state','debug','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter'];(function(_0x149414,_0x1535de){var _0x5f07ff=function(_0x5e0c04){while(--_0x5e0c04){_0x149414['push'](_0x149414['shift']());}};_0x5f07ff(++_0x1535de);}(_0xa177,0x1be));var _0x7a17=function(_0x3f934f,_0x5c1a72){_0x3f934f=_0x3f934f-0x0;var _0x385975=_0xa177[_0x3f934f];return _0x385975;};'use strict';var _=require(_0x7a17('0x0'));var moment=require(_0x7a17('0x1'));var util=require(_0x7a17('0x2'));var Redis=require('ioredis');var BPromise=require(_0x7a17('0x3'));var config=require('../../../config/environment');var logger=require(_0x7a17('0x4'))(_0x7a17('0x5'));var ami=require(_0x7a17('0x6'));config['redis']=_[_0x7a17('0x7')](config['redis'],{'host':_0x7a17('0x8'),'port':0x18eb});var io=require(_0x7a17('0x9'))(new Redis(config['redis']));function UserReport(_0x2f7640){this[_0x7a17('0xa')]=_0x2f7640['trunks'];this[_0x7a17('0xb')]=_0x2f7640[_0x7a17('0xb')];this[_0x7a17('0xc')]=_0x2f7640[_0x7a17('0xc')];ami['on']('registryentry',this[_0x7a17('0xd')][_0x7a17('0xe')](this));ami['on'](_0x7a17('0xf'),this['syncRegistry'][_0x7a17('0xe')](this));ami['on'](_0x7a17('0x10'),this[_0x7a17('0x11')][_0x7a17('0xe')](this));ami['on'](_0x7a17('0x12'),this[_0x7a17('0x13')][_0x7a17('0xe')](this));return this[_0x7a17('0x14')]();}function showSipRegistrations(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x17')]())[_0x7a17('0x18')](function(_0x401c4b){logger[_0x7a17('0x19')]('[userReport][sipshowregistry]',util[_0x7a17('0x1a')](_0x401c4b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x1b')]())['catch'](function(_0x240702){logger[_0x7a17('0x19')](_0x7a17('0x1c'),util[_0x7a17('0x1a')](_0x240702,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x1d')]())[_0x7a17('0x18')](function(_0x35212c){logger[_0x7a17('0x19')](_0x7a17('0x1e'),util['inspect'](_0x35212c,{'showHidden':![],'depth':null}));});}UserReport[_0x7a17('0x1f')][_0x7a17('0x14')]=function(){setInterval(function(){BPromise[_0x7a17('0x15')]()[_0x7a17('0x16')](showSipRegistrations())[_0x7a17('0x16')](listDeviceStates())[_0x7a17('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x7a17('0x1f')][_0x7a17('0x20')]=function(_0x11a24f){return _0x11a24f!==null&&!_['isUndefined'](_0x11a24f);};UserReport[_0x7a17('0x1f')][_0x7a17('0x21')]=function(_0x488d26,_0x5b121c,_0x400b8d){io['to'](_0x488d26)[_0x7a17('0x21')](_0x5b121c,_0x400b8d);};UserReport[_0x7a17('0x1f')][_0x7a17('0xd')]=function(_0x5e3ddb){try{if(this[_0x7a17('0x20')](_0x5e3ddb)){logger[_0x7a17('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5e3ddb[_0x7a17('0x23')],_0x5e3ddb[_0x7a17('0x24')]);logger[_0x7a17('0x25')]('[userReport][registry]',util[_0x7a17('0x1a')](_0x5e3ddb,{'showHidden':![],'depth':null}));var _0x10a899=_[_0x7a17('0x26')](this[_0x7a17('0xa')],{'defaultuser':_0x5e3ddb['username']});if(_0x10a899){_0x5e3ddb[_0x7a17('0x27')]=_0x5e3ddb[_0x7a17('0x24')];_[_0x7a17('0x28')](_0x10a899,_[_0x7a17('0x29')](_0x5e3ddb,[_0x7a17('0x2a'),_0x7a17('0x2b'),'username',_0x7a17('0x24')]));logger[_0x7a17('0x25')](_0x7a17('0x2c'),util[_0x7a17('0x1a')](_0x10a899,{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),_0x10a899[_0x7a17('0x2f')]),_0x7a17('0x30'),_0x10a899);}}}catch(_0x4791f0){logger[_0x7a17('0x19')](_0x7a17('0x31'),util[_0x7a17('0x1a')](_0x4791f0,{'showHidden':![],'depth':null}));}};UserReport[_0x7a17('0x1f')]['syncDeviceState']=function(_0x28e3b9){try{if(this['isNotNull'](_0x28e3b9)){logger[_0x7a17('0x22')](_0x7a17('0x32'),_0x28e3b9['device'],_0x28e3b9[_0x7a17('0x24')]);logger[_0x7a17('0x25')](_0x7a17('0x33'),util[_0x7a17('0x1a')](_0x28e3b9,{'showHidden':![],'depth':null}));if(this[_0x7a17('0xb')][_0x28e3b9['device']]){if(!this['agents'][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x35')]||_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()==_0x7a17('0x36')){this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x35')]=![];if(this[_0x7a17('0xb')][_0x28e3b9['device']][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]()){this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]]['state']=_0x28e3b9[_0x7a17('0x24')]['toLowerCase']();this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x3a')](_0x28e3b9);}}else if(this['telephones'][_0x28e3b9[_0x7a17('0x34')]]){if(this[_0x7a17('0xc')][_0x28e3b9['device']][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()){this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]]['state']=_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]();logger[_0x7a17('0x25')](_0x7a17('0x3b'),util[_0x7a17('0x1a')](this['telephones'][_0x28e3b9['device']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')]('telephone:%s',this[_0x7a17('0xc')][_0x28e3b9['device']][_0x7a17('0x2f')]),_0x7a17('0x3c'),this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]]);}else if(this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]){if(this['trunks'][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]()){this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]['stateTime']=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x24')]=_0x28e3b9['state'][_0x7a17('0x37')]();logger[_0x7a17('0x25')](_0x7a17('0x3d'),util[_0x7a17('0x1a')](this[_0x7a17('0xa')][_0x28e3b9['device']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x2f')]),_0x7a17('0x30'),this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]);}else if(_[_0x7a17('0x3e')](_0x28e3b9[_0x7a17('0x34')],_0x7a17('0x3f'))){var _0x422890=_0x28e3b9['device'];var _0x59fa75=_0x422890['substring'](_0x422890[_0x7a17('0x40')]('/')+0x1,_0x422890[_0x7a17('0x40')]('@'));var _0x4aa77e=_[_0x7a17('0x26')](this['agents'],function(_0x4ce17c){return _0x4ce17c[_0x7a17('0x41')]==_0x59fa75||_0x4ce17c['phone']==_0x59fa75||_0x4ce17c['accountcode']==_0x59fa75;});if(_0x4aa77e){if(_0x4aa77e['state']!==_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()){_0x4aa77e[_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}_0x4aa77e['state']=_0x28e3b9['state'][_0x7a17('0x37')]();_0x4aa77e['local']=!![];_0x4aa77e['updateStatusRealtime'](_0x28e3b9);}}}}catch(_0x55cd42){logger['error'](_0x7a17('0x33'),util[_0x7a17('0x1a')](_0x55cd42,{'showHidden':![],'depth':null}));}};UserReport[_0x7a17('0x1f')][_0x7a17('0x13')]=function(_0x5edcce){try{if(this[_0x7a17('0x20')](_0x5edcce)&&this[_0x7a17('0x20')](_0x5edcce[_0x7a17('0x12')])){logger[_0x7a17('0x22')](_0x7a17('0x42'),_0x5edcce[_0x7a17('0x43')],_0x5edcce[_0x7a17('0x44')],_0x5edcce[_0x7a17('0x12')]);logger[_0x7a17('0x25')](_0x7a17('0x45'),util[_0x7a17('0x1a')](_0x5edcce,{'showHidden':![],'depth':null}));if(this[_0x7a17('0xb')][_0x5edcce['peer']]){if(!this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x35')]||_0x5edcce[_0x7a17('0x12')]['toLowerCase']()==_0x7a17('0x46')){this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]]['local']=![];this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce[_0x7a17('0x12')][_0x7a17('0x37')]();this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x44')]=_0x5edcce[_0x7a17('0x44')];this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x3a')](_0x5edcce);}}else if(this[_0x7a17('0xc')][_0x5edcce['peer']]){this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce['peerstatus'][_0x7a17('0x37')]();this[_0x7a17('0xc')][_0x5edcce['peer']][_0x7a17('0x44')]=_0x5edcce[_0x7a17('0x44')];logger['debug'](_0x7a17('0x48'),util[_0x7a17('0x1a')](this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x7a17('0x2d')](_0x7a17('0x49'),this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x2f')]),_0x7a17('0x3c'),this[_0x7a17('0xc')][_0x5edcce['peer']]);}else if(this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]){this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce[_0x7a17('0x12')][_0x7a17('0x37')]();this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]['address']=_0x5edcce[_0x7a17('0x44')];logger['debug'](_0x7a17('0x4a'),util[_0x7a17('0x1a')](this[_0x7a17('0xa')][_0x5edcce['peer']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),this['trunks'][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x2f')]),_0x7a17('0x30'),this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]);}}}catch(_0x522907){logger[_0x7a17('0x19')](_0x7a17('0x45'),util[_0x7a17('0x1a')](_0x522907,{'showHidden':![],'depth':null}));}};module[_0x7a17('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index ceb1eac..192abeb 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 _0x1082=['called','mandatoryDisposition','type','inbound','voice','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','queue','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','interface','pick','destconnectedlinenum','channel','split','name','accountcode','exten','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','isUndefined','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c5edc,_0x5cbfe9){var _0x2b7a89=function(_0x54d297){while(--_0x54d297){_0x1c5edc['push'](_0x1c5edc['shift']());}};_0x2b7a89(++_0x5cbfe9);}(_0x1082,0x7b));var _0x2108=function(_0x3fdc4c,_0x42ec50){_0x3fdc4c=_0x3fdc4c-0x0;var _0x206e98=_0x1082[_0x3fdc4c];return _0x206e98;};'use strict';var _=require('lodash');var moment=require(_0x2108('0x0'));var util=require(_0x2108('0x1'));var Redis=require(_0x2108('0x2'));var config=require(_0x2108('0x3'));var logger=require(_0x2108('0x4'))(_0x2108('0x5'));var ami=require('../ami');config[_0x2108('0x6')]=_[_0x2108('0x7')](config[_0x2108('0x6')],{'host':_0x2108('0x8'),'port':0x18eb});var io=require(_0x2108('0x9'))(new Redis(config[_0x2108('0x6')]));function VoiceAgentReport(_0x5dba86){this['channels']={};this[_0x2108('0xa')]=_0x5dba86[_0x2108('0xb')];this['voiceQueues']=_0x5dba86[_0x2108('0xc')];this[_0x2108('0xd')]=_0x5dba86['agents'];this[_0x2108('0xe')]={};ami['on'](_0x2108('0xf'),this['syncAgentCalled']['bind'](this));ami['on']('agentconnect',this[_0x2108('0x10')][_0x2108('0x11')](this));ami['on'](_0x2108('0x12'),this[_0x2108('0x13')][_0x2108('0x11')](this));ami['on'](_0x2108('0x14'),this[_0x2108('0x15')][_0x2108('0x11')](this));ami['on'](_0x2108('0x16'),this[_0x2108('0x17')]['bind'](this));ami['on']('varset',this[_0x2108('0x18')]['bind'](this));ami['on']('hangup',this[_0x2108('0x19')][_0x2108('0x11')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x2108('0x11')](this));ami['on'](_0x2108('0x1a'),this[_0x2108('0x1b')][_0x2108('0x11')](this));ami['on'](_0x2108('0x1c'),this['syncAttendedTransfer'][_0x2108('0x11')](this));ami['on'](_0x2108('0x1d'),this[_0x2108('0x1e')][_0x2108('0x11')](this));}VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x20')]=function(_0x2bc56b,_0x3e35dd,_0x28135d){io['to'](_0x2bc56b)[_0x2108('0x20')](_0x3e35dd,_0x28135d);};VoiceAgentReport[_0x2108('0x1f')]['isNotNull']=function(_0x574f1e){return _0x574f1e!==null&&!_['isUndefined'](_0x574f1e);};VoiceAgentReport[_0x2108('0x1f')]['syncAgentCalled']=function(_0x5d5331){try{if(this['isNotNull'](_0x5d5331)){logger[_0x2108('0x21')](_0x2108('0x22'),_0x5d5331['uniqueid'],_0x5d5331[_0x2108('0x23')],_0x5d5331[_0x2108('0x24')]);logger[_0x2108('0x25')](_0x2108('0x26'),_0x5d5331[_0x2108('0x27')],util[_0x2108('0x28')](_0x5d5331,{'showHidden':![],'depth':null}));if(_[_0x2108('0x29')](this[_0x2108('0xb')][_0x5d5331['uniqueid']])){this[_0x2108('0xb')][_0x5d5331[_0x2108('0x27')]]={};}var _0xf9a9fb=this['agents'][_0x5d5331['interface']];var _0x2be99f=this['channels'][_0x5d5331[_0x2108('0x27')]][_0x5d5331[_0x2108('0x24')]];var _0x52e096=this[_0x2108('0xc')][_0x5d5331['queue']];var _0xc1736d=this[_0x2108('0xe')][_0x5d5331[_0x2108('0x27')]];if(_[_0x2108('0x29')](_0x2be99f)){_0x2be99f={'agentcalledAt':moment()['format'](_0x2108('0x2a')),'lastevent':_0x2108('0x2b'),'mandatoryDisposition':_0x52e096&&_0x52e096[_0x2108('0x2c')]?_0x52e096['mandatoryDisposition']:![],'type':_0x52e096&&_0x52e096[_0x2108('0x2d')]?_0x52e096['type']:_0x2108('0x2e'),'variables':_0xc1736d,'motionChannel':_0x2108('0x2f')};}_[_0x2108('0x30')](_0x2be99f,_['omit'](_0x5d5331,[_0x2108('0x31'),_0x2108('0x32')]));logger[_0x2108('0x25')](_0x2108('0x33'),_0x5d5331['uniqueid'],util[_0x2108('0x28')](_0x2be99f,{'showHidden':![],'depth':null}));ami['emit'](_0x2108('0x34'),_0x2be99f);var _0x45298d={'id':_0xf9a9fb['id'],'calleridnum':_0x2be99f[_0x2108('0x35')],'queue':_0x2be99f[_0x2108('0x36')],'variables':_0x2be99f['variables'],'uniqueid':_0x5d5331[_0x2108('0x27')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x5d5331[_0x2108('0x27')],util['inspect'](_0x45298d,{'showHidden':![],'depth':null}));this[_0x2108('0x20')](util[_0x2108('0x37')](_0x2108('0x38'),_0x5d5331[_0x2108('0x23')]),_0x2108('0x39'),_0x45298d);}}catch(_0x338994){logger[_0x2108('0x3a')](_0x2108('0x3b'),_0x5d5331[_0x2108('0x27')],util[_0x2108('0x28')](_0x338994,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x10')]=function(_0x4c20ff){try{if(this[_0x2108('0x3c')](_0x4c20ff)){if(this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]]){logger[_0x2108('0x25')](_0x2108('0x3d'),_0x4c20ff[_0x2108('0x27')],util[_0x2108('0x28')](_0x4c20ff,{'showHidden':![],'depth':null}));for(var _0x3aad82 in this['channels'][_0x4c20ff[_0x2108('0x27')]]){if(this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x2108('0x3e')](_0x3aad82)){if(_0x4c20ff[_0x2108('0x24')]===_0x3aad82){logger['info'](_0x2108('0x3f'),_0x4c20ff['uniqueid'],_0x4c20ff[_0x2108('0x23')],_0x4c20ff[_0x2108('0x24')]);this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x40')]=moment()[_0x2108('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x41')]=_0x4c20ff['connectedlinename'];this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x42')]=_0x4c20ff['connectedlinenum'];this['channels'][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x43')]=_0x4c20ff[_0x2108('0x43')];this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x44')]=_0x4c20ff[_0x2108('0x44')];this[_0x2108('0xb')][_0x4c20ff['uniqueid']][_0x3aad82][_0x2108('0x45')]=_0x4c20ff[_0x2108('0x45')];this[_0x2108('0xb')][_0x4c20ff['uniqueid']][_0x3aad82]['lastevent']=_0x2108('0x46');if(this[_0x2108('0xa')][this['channels'][_0x4c20ff['uniqueid']][_0x3aad82][_0x2108('0x27')]]){var _0x315e0c=this[_0x2108('0xa')][this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x27')]][_0x2108('0x47')];this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x47')]=_0x315e0c;_0x4c20ff[_0x2108('0x47')]=_0x315e0c;}_[_0x2108('0x30')](this[_0x2108('0xd')][_0x4c20ff[_0x2108('0x48')]],_[_0x2108('0x49')](_0x4c20ff,['queue',_0x2108('0x4a'),_0x2108('0x47')]));var _0x301729=this[_0x2108('0xd')][_0x4c20ff[_0x2108('0x4b')][_0x2108('0x4c')]('-')[0x0]];var _0x55c273={'id':_0x301729['id'],'name':_0x301729[_0x2108('0x4d')],'agentconnected':!![],'destaccountcode':_0x301729[_0x2108('0x4e')],'destconnectedlinenum':this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x4c20ff['destuniqueid']][_0x2108('0x4f')],'queue':this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x4c20ff[_0x2108('0x24')]][_0x2108('0x36')],'routealias':this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x4c20ff[_0x2108('0x24')]][_0x2108('0x47')],'uniqueid':this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x4c20ff[_0x2108('0x24')]]['uniqueid']};logger[_0x2108('0x25')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x4c20ff['uniqueid'],util[_0x2108('0x28')](_0x55c273,{'showHidden':![],'depth':null}));ami[_0x2108('0x20')](_0x2108('0x50'),_0x55c273);logger[_0x2108('0x25')](_0x2108('0x51'),_0x4c20ff[_0x2108('0x27')],util[_0x2108('0x28')](_0x55c273,{'showHidden':![],'depth':null}));this[_0x2108('0x20')](util[_0x2108('0x37')](_0x2108('0x38'),_0x4c20ff['membername']),_0x2108('0x52'),_0x55c273);}else if(!this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x12')]&&!this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82]['agentcomplete']){logger['info'](_0x2108('0x53'),_0x4c20ff['uniqueid'],this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82]['membername'],_0x3aad82);this['channels'][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x12')]=!![];this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x54')]=moment()[_0x2108('0x37')](_0x2108('0x2a'));this['channels'][_0x4c20ff[_0x2108('0x27')]][_0x3aad82]['answeredelsewheredestinationuniqueid']=_0x4c20ff[_0x2108('0x24')];this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x55')]=_0x4c20ff[_0x2108('0x23')];this[_0x2108('0xb')][_0x4c20ff['uniqueid']][_0x3aad82][_0x2108('0x56')]=_0x2108('0x57');this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82][_0x2108('0x58')]='answered_elsewhere';logger[_0x2108('0x25')](_0x2108('0x59'),_0x4c20ff[_0x2108('0x27')],util[_0x2108('0x28')](this[_0x2108('0xb')][_0x4c20ff[_0x2108('0x27')]][_0x3aad82],{'showHidden':![],'depth':null}));ami[_0x2108('0x20')](_0x2108('0x5a'),this['channels'][_0x4c20ff[_0x2108('0x27')]][_0x3aad82]);}}}}}}catch(_0x51fb9a){logger[_0x2108('0x3a')](_0x2108('0x5b'),_0x4c20ff['uniqueid'],util[_0x2108('0x28')](_0x51fb9a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2108('0x13')]=function(_0x188d4b){try{if(this[_0x2108('0x3c')](_0x188d4b)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x188d4b[_0x2108('0x27')],util['inspect'](_0x188d4b,{'showHidden':![],'depth':null}));if(this[_0x2108('0xb')][_0x188d4b[_0x2108('0x27')]]&&this['channels'][_0x188d4b[_0x2108('0x27')]][_0x188d4b[_0x2108('0x24')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x188d4b[_0x2108('0x27')],_0x188d4b[_0x2108('0x23')],_0x188d4b[_0x2108('0x24')]);var _0x339374=this['agents'][_0x188d4b['interface']];var _0x47fed1=this['channels'][_0x188d4b['uniqueid']][_0x188d4b[_0x2108('0x24')]];_0x47fed1[_0x2108('0x12')]=!![];_0x47fed1[_0x2108('0x54')]=moment()['format'](_0x2108('0x2a'));_0x47fed1[_0x2108('0x56')]=_0x2108('0x5c');_0x47fed1[_0x2108('0x58')]='rejected';var _0x24a11e={'id':_0x339374['id'],'name':_0x339374['name'],'queue':_0x47fed1['queue'],'uniqueid':_0x47fed1[_0x2108('0x27')]};logger[_0x2108('0x25')](_0x2108('0x5d'),_0x188d4b['uniqueid'],util[_0x2108('0x28')](_0x24a11e,{'showHidden':![],'depth':null}));this[_0x2108('0x20')](util[_0x2108('0x37')](_0x2108('0x38'),_0x339374[_0x2108('0x4d')]),_0x2108('0x5e'),_0x24a11e);ami[_0x2108('0x20')](_0x2108('0x5f'),_0x47fed1);}}}catch(_0x3cd41e){logger['error'](_0x2108('0x60'),_0x188d4b[_0x2108('0x27')],util[_0x2108('0x28')](_0x3cd41e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x15')]=function(_0x1d0664){try{if(this[_0x2108('0x3c')](_0x1d0664)){logger[_0x2108('0x25')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x1d0664[_0x2108('0x27')],util[_0x2108('0x28')](_0x1d0664,{'showHidden':![],'depth':null}));if(this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]]){for(var _0x4e9e56 in this['channels'][_0x1d0664[_0x2108('0x27')]]){if(this[_0x2108('0xb')][_0x1d0664['uniqueid']][_0x2108('0x3e')](_0x4e9e56)&&!this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56][_0x2108('0x12')]&&!this['channels'][_0x1d0664[_0x2108('0x27')]][_0x4e9e56][_0x2108('0x16')]){logger[_0x2108('0x21')](_0x2108('0x61'),_0x1d0664['uniqueid'],this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56]['membername'],_0x4e9e56);this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56][_0x2108('0x12')]=!![];this['channels'][_0x1d0664['uniqueid']][_0x4e9e56][_0x2108('0x54')]=moment()[_0x2108('0x37')](_0x2108('0x2a'));this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56][_0x2108('0x56')]='abandoned';this['channels'][_0x1d0664[_0x2108('0x27')]][_0x4e9e56][_0x2108('0x58')]=_0x2108('0x62');logger['debug'](_0x2108('0x63'),_0x1d0664[_0x2108('0x27')],util[_0x2108('0x28')](this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56],{'showHidden':![],'depth':null}));ami['emit'](_0x2108('0x64'),this[_0x2108('0xb')][_0x1d0664[_0x2108('0x27')]][_0x4e9e56]);}}}}}catch(_0x30bb81){logger[_0x2108('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]',_0x1d0664[_0x2108('0x27')],util[_0x2108('0x28')](_0x30bb81,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x17')]=function(_0x157df2){try{if(this[_0x2108('0x3c')](_0x157df2)){logger[_0x2108('0x25')](_0x2108('0x65'),_0x157df2[_0x2108('0x27')],util['inspect'](_0x157df2,{'showHidden':![],'depth':null}));if(this[_0x2108('0xb')][_0x157df2['uniqueid']]){for(var _0x2f4ce4 in this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]]){if(this[_0x2108('0xb')][_0x157df2['uniqueid']][_0x2108('0x3e')](_0x2f4ce4)){if(this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4][_0x2108('0x40')]&&!this[_0x2108('0xb')][_0x157df2['uniqueid']][_0x2f4ce4]['agentcomplete']){logger['info'](_0x2108('0x66'),_0x157df2['uniqueid'],this['channels'][_0x157df2['uniqueid']][_0x2f4ce4][_0x2108('0x23')],_0x2f4ce4);this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4]['agentcomplete']=!![];this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4][_0x2108('0x67')]=moment()[_0x2108('0x37')](_0x2108('0x2a'));this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4]['lastevent']='complete';this[_0x2108('0xb')][_0x157df2['uniqueid']][_0x2f4ce4]['reason']=_0x157df2['reason']==_0x2108('0x68')?_0x2108('0x69'):_0x157df2[_0x2108('0x58')];this[_0x2108('0xb')][_0x157df2['uniqueid']][_0x2f4ce4]['talktime']=_0x157df2[_0x2108('0x6a')];if(this[_0x2108('0xc')][_0x157df2[_0x2108('0x36')]]&&this[_0x2108('0xc')][_0x157df2['queue']]['acw']){this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4][_0x2108('0x6b')]=this[_0x2108('0xc')][_0x157df2[_0x2108('0x36')]][_0x2108('0x6c')];this[_0x2108('0xb')][_0x157df2[_0x2108('0x27')]][_0x2f4ce4][_0x2108('0x6d')]=!![];}this[_0x2108('0xd')][_0x157df2[_0x2108('0x48')]]=_[_0x2108('0x6e')](this['agents'][_0x157df2[_0x2108('0x48')]],[_0x2108('0x36'),_0x2108('0x4a')]);logger[_0x2108('0x25')](_0x2108('0x6f'),_0x157df2['uniqueid'],util[_0x2108('0x28')](this[_0x2108('0xb')][_0x157df2['uniqueid']][_0x2f4ce4],{'showHidden':![],'depth':null}));ami[_0x2108('0x20')]('custom:agentcomplete',this['channels'][_0x157df2[_0x2108('0x27')]][_0x2f4ce4]);logger[_0x2108('0x25')](_0x2108('0x70'),_0x157df2[_0x2108('0x27')],util['inspect']({'id':this[_0x2108('0xd')][_0x157df2[_0x2108('0x48')]]['id'],'destaccountcode':_0x157df2[_0x2108('0x71')]},{'showHidden':![],'depth':null}));this[_0x2108('0x20')](util[_0x2108('0x37')](_0x2108('0x38'),_0x157df2[_0x2108('0x23')]),_0x2108('0x72'),{'id':this['agents'][_0x157df2[_0x2108('0x48')]]['id'],'destaccountcode':Number(_0x157df2[_0x2108('0x71')])});}}}}}}catch(_0x549811){logger[_0x2108('0x3a')](_0x2108('0x73'),_0x157df2[_0x2108('0x27')],util[_0x2108('0x28')](_0x549811,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x18')]=function(_0x36cefc){try{if(this[_0x2108('0x3c')](_0x36cefc)){logger[_0x2108('0x25')]('[%s][voiceAgentReport][varset]\x20event:',_0x36cefc[_0x2108('0x27')],util[_0x2108('0x28')](_0x36cefc,{'showHidden':![],'depth':null}));this[_0x2108('0x74')](_0x36cefc[_0x2108('0x27')],_[_0x2108('0x75')](_0x36cefc[_0x2108('0x76')])[0x0],_0x36cefc[_0x2108('0x77')]);if(this[_0x2108('0xb')][_0x36cefc[_0x2108('0x27')]]){for(var _0x3b93ee in this[_0x2108('0xb')][_0x36cefc[_0x2108('0x27')]]){if(this['channels'][_0x36cefc[_0x2108('0x27')]][_0x2108('0x3e')](_0x3b93ee)){logger[_0x2108('0x21')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x36cefc[_0x2108('0x27')],_0x3b93ee,_[_0x2108('0x75')](_0x36cefc['variable'])[0x0],_0x36cefc[_0x2108('0x77')]);if(_[_0x2108('0x29')](this[_0x2108('0xb')][_0x36cefc['uniqueid']][_0x3b93ee][_0x2108('0xe')])){this['channels'][_0x36cefc[_0x2108('0x27')]][_0x3b93ee][_0x2108('0xe')]={};}this[_0x2108('0xb')][_0x36cefc[_0x2108('0x27')]][_0x3b93ee]['variables']=this[_0x2108('0xe')][_0x36cefc[_0x2108('0x27')]];}}}}}catch(_0x2fa917){logger[_0x2108('0x3a')](_0x2108('0x78'),_0x36cefc[_0x2108('0x27')],util[_0x2108('0x28')](_0x2fa917,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x74')]=function(_0xf9afe,_0x76e7fb,_0x3db5ee){var _0x2a7ac5=[_0x2108('0x79'),_0x2108('0x7a'),_0x2108('0x7b'),_0x2108('0x7c'),_0x2108('0x7d'),_0x2108('0x7e'),_0x2108('0x7f'),_0x2108('0x80'),_0x2108('0x81'),_0x2108('0x82'),_0x2108('0x83'),_0x2108('0x84'),_0x2108('0x85'),_0x2108('0x86'),'memberinterface',_0x2108('0x87'),_0x2108('0x23'),_0x2108('0x88'),_0x2108('0x89')];if(!_[_0x2108('0x8a')](_0x76e7fb)&&!_[_0x2108('0x8b')](_0x2a7ac5,_0x76e7fb)){if(_[_0x2108('0x29')](this[_0x2108('0xe')][_0xf9afe])){this[_0x2108('0xe')][_0xf9afe]={};}this['variables'][_0xf9afe][_0x76e7fb]=_0x3db5ee;}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x19')]=function(_0x48504e){try{if(this[_0x2108('0x3c')](_0x48504e)){logger[_0x2108('0x25')](_0x2108('0x8c'),_0x48504e[_0x2108('0x27')],util[_0x2108('0x28')](_0x48504e,{'showHidden':![],'depth':null}));if(this[_0x2108('0xb')][_0x48504e['uniqueid']]){for(var _0x23b77c in this[_0x2108('0xb')][_0x48504e[_0x2108('0x27')]]){if(this['channels'][_0x48504e['uniqueid']][_0x2108('0x3e')](_0x23b77c)){if(this[_0x2108('0xb')][_0x48504e['uniqueid']][_0x23b77c][_0x2108('0x58')]==_0x2108('0x68')&&this[_0x2108('0xb')][_0x48504e['uniqueid']][_0x23b77c][_0x2108('0x16')]){logger['info'](_0x2108('0x8d'),_0x48504e[_0x2108('0x27')],_0x23b77c);this[_0x2108('0xb')][_0x48504e[_0x2108('0x27')]][_0x23b77c][_0x2108('0x67')]=moment()[_0x2108('0x37')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x2108('0x25')](_0x2108('0x8e'),_0x48504e['uniqueid'],util[_0x2108('0x28')](_['values'](this[_0x2108('0xb')][_0x48504e['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x2108('0x20')](_0x2108('0x8f'),_[_0x2108('0x90')](this[_0x2108('0xb')][_0x48504e[_0x2108('0x27')]]));delete this[_0x2108('0xb')][_0x48504e[_0x2108('0x27')]];}if(this[_0x2108('0xe')][_0x48504e[_0x2108('0x27')]]){delete this['variables'][_0x48504e[_0x2108('0x27')]];}}}catch(_0x450ce4){logger[_0x2108('0x3a')]('[%s][voiceAgentReport][hangup]',_0x48504e[_0x2108('0x27')],util[_0x2108('0x28')](_0x450ce4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2108('0x91')]=function(_0x3940bb){try{if(this[_0x2108('0x3c')](_0x3940bb)){logger[_0x2108('0x25')](_0x2108('0x92'),_0x3940bb[_0x2108('0x27')],util['inspect'](_0x3940bb,{'showHidden':![],'depth':null}));if(this['channels'][_0x3940bb[_0x2108('0x93')]]){for(var _0x1dd938 in this[_0x2108('0xb')][_0x3940bb[_0x2108('0x93')]]){if(this['channels'][_0x3940bb[_0x2108('0x93')]]['hasOwnProperty'](_0x1dd938)){if(_0x3940bb[_0x2108('0x94')]===_0x1dd938){logger[_0x2108('0x21')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3940bb['uniqueid'],this['channels'][_0x3940bb[_0x2108('0x93')]][_0x1dd938]['membername'],_0x1dd938);var _0x31c297=moment();this[_0x2108('0xb')][_0x3940bb['transfereeuniqueid']][_0x1dd938][_0x2108('0x16')]=!![];this[_0x2108('0xb')][_0x3940bb[_0x2108('0x93')]][_0x1dd938][_0x2108('0x67')]=moment()[_0x2108('0x37')](_0x2108('0x2a'));this[_0x2108('0xb')][_0x3940bb[_0x2108('0x93')]][_0x1dd938][_0x2108('0x56')]=_0x2108('0x95');this[_0x2108('0xb')][_0x3940bb['transfereeuniqueid']][_0x1dd938][_0x2108('0x58')]='transfer';this[_0x2108('0xb')][_0x3940bb[_0x2108('0x93')]][_0x1dd938][_0x2108('0x6a')]=_0x31c297['diff'](this[_0x2108('0xb')][_0x3940bb[_0x2108('0x93')]][_0x1dd938][_0x2108('0x40')],_0x2108('0x96'));}}}}if(this[_0x2108('0xb')][_0x3940bb[_0x2108('0x97')]]){var _0x4e08c1=this[_0x2108('0xb')][_0x3940bb['secondtransfereruniqueid']];this[_0x2108('0xb')][_0x3940bb[_0x2108('0x97')]]=this['channels'][_0x3940bb['transfereeuniqueid']];this[_0x2108('0xb')][_0x3940bb['transfereeuniqueid']]=_0x4e08c1;}}}catch(_0x5a5dba){logger['error'](_0x2108('0x98'),_0x3940bb[_0x2108('0x27')],util[_0x2108('0x28')](_0x5a5dba,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x1e')]=function(_0x1949f9){try{if(this['isNotNull'](_0x1949f9)){logger[_0x2108('0x25')](_0x2108('0x99'),_0x1949f9[_0x2108('0x27')],util[_0x2108('0x28')](_0x1949f9,{'showHidden':![],'depth':null}));if(this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]]){for(var _0xc94705 in this[_0x2108('0xb')][_0x1949f9['transfereeuniqueid']]){if(this[_0x2108('0xb')][_0x1949f9['transfereeuniqueid']][_0x2108('0x3e')](_0xc94705)){if(_0x1949f9[_0x2108('0x9a')]===_0xc94705){logger[_0x2108('0x21')](_0x2108('0x9b'),_0x1949f9[_0x2108('0x27')],this[_0x2108('0xb')][_0x1949f9['transfereeuniqueid']][_0xc94705]['membername'],_0xc94705);var _0x1ab5e0=moment();this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]][_0xc94705]['agentcomplete']=!![];this['channels'][_0x1949f9[_0x2108('0x93')]][_0xc94705]['agentcompleteAt']=_0x1ab5e0;this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]][_0xc94705][_0x2108('0x56')]=_0x2108('0x95');this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]][_0xc94705][_0x2108('0x58')]=_0x2108('0x68');this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]][_0xc94705]['talktime']=_0x1ab5e0[_0x2108('0x9c')](this[_0x2108('0xb')][_0x1949f9[_0x2108('0x93')]][_0xc94705]['agentconnectAt'],_0x2108('0x96'));}}}}}}catch(_0x5cd6a1){logger[_0x2108('0x3a')]('[%s][voiceAgentReport][blindtransfer]',_0x1949f9[_0x2108('0x27')],util[_0x2108('0x28')](_0x5cd6a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2108('0x1f')][_0x2108('0x9d')]=function(_0x949e23){var _0x422912='';try{if(this['isNotNull'](_0x949e23)){logger['debug'](_0x2108('0x9e'),_0x949e23[_0x2108('0x27')],util[_0x2108('0x28')](_0x949e23,{'showHidden':![],'depth':null}));if(_0x949e23['channel']){_0x422912=_0x949e23[_0x2108('0x4b')]['substring'](0x0,_0x949e23[_0x2108('0x4b')]['lastIndexOf']('-'));if(this['agents'][_0x422912]){logger[_0x2108('0x21')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x949e23[_0x2108('0x27')],_0x422912);this[_0x2108('0xd')][_0x422912]['onhold']=!![];}}}}catch(_0x206e4d){logger[_0x2108('0x3a')](_0x2108('0x9f'),_0x949e23[_0x2108('0x27')],util['inspect'](_0x206e4d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x470dc2){var _0x5c029a='';try{if(this[_0x2108('0x3c')](_0x470dc2)){logger[_0x2108('0x25')](_0x2108('0xa0'),_0x470dc2['uniqueid'],util['inspect'](_0x470dc2,{'showHidden':![],'depth':null}));if(_0x470dc2['channel']){_0x5c029a=_0x470dc2[_0x2108('0x4b')][_0x2108('0xa1')](0x0,_0x470dc2[_0x2108('0x4b')][_0x2108('0xa2')]('-'));if(this[_0x2108('0xd')][_0x5c029a]){logger[_0x2108('0x21')](_0x2108('0xa3'),_0x470dc2[_0x2108('0x27')],_0x5c029a);this[_0x2108('0xd')][_0x5c029a]['onhold']=![];}}}}catch(_0x48b2e4){logger[_0x2108('0x3a')](_0x2108('0xa4'),_0x470dc2[_0x2108('0x27')],util[_0x2108('0x28')](_0x48b2e4,{'showHidden':![],'depth':null}));}};module[_0x2108('0xa5')]=VoiceAgentReport; \ No newline at end of file +var _0x7660=['privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','variables','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','routealias','pick','destconnectedlinenum','channel','split','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','voice','merge','event'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7660,0x1ac));var _0x0766=function(_0x4a4b45,_0x16bc77){_0x4a4b45=_0x4a4b45-0x0;var _0x3d9e27=_0x7660[_0x4a4b45];return _0x3d9e27;};'use strict';var _=require('lodash');var moment=require(_0x0766('0x0'));var util=require(_0x0766('0x1'));var Redis=require(_0x0766('0x2'));var config=require('../../../config/environment');var logger=require(_0x0766('0x3'))(_0x0766('0x4'));var ami=require(_0x0766('0x5'));config['redis']=_[_0x0766('0x6')](config[_0x0766('0x7')],{'host':_0x0766('0x8'),'port':0x18eb});var io=require(_0x0766('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x11e7a4){this['channels']={};this[_0x0766('0xa')]=_0x11e7a4[_0x0766('0xb')];this[_0x0766('0xc')]=_0x11e7a4[_0x0766('0xc')];this['agents']=_0x11e7a4[_0x0766('0xd')];this['variables']={};ami['on'](_0x0766('0xe'),this['syncAgentCalled'][_0x0766('0xf')](this));ami['on'](_0x0766('0x10'),this[_0x0766('0x11')][_0x0766('0xf')](this));ami['on'](_0x0766('0x12'),this[_0x0766('0x13')][_0x0766('0xf')](this));ami['on']('queuecallerabandon',this[_0x0766('0x14')]['bind'](this));ami['on'](_0x0766('0x15'),this[_0x0766('0x16')][_0x0766('0xf')](this));ami['on'](_0x0766('0x17'),this[_0x0766('0x18')][_0x0766('0xf')](this));ami['on'](_0x0766('0x19'),this[_0x0766('0x1a')]['bind'](this));ami['on'](_0x0766('0x1b'),this[_0x0766('0x1c')][_0x0766('0xf')](this));ami['on'](_0x0766('0x1d'),this[_0x0766('0x1e')][_0x0766('0xf')](this));ami['on'](_0x0766('0x1f'),this[_0x0766('0x20')][_0x0766('0xf')](this));ami['on'](_0x0766('0x21'),this[_0x0766('0x22')][_0x0766('0xf')](this));}VoiceAgentReport[_0x0766('0x23')][_0x0766('0x24')]=function(_0x2f06ec,_0x51c74d,_0x58ddc4){io['to'](_0x2f06ec)['emit'](_0x51c74d,_0x58ddc4);};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x25')]=function(_0x1c8e06){return _0x1c8e06!==null&&!_[_0x0766('0x26')](_0x1c8e06);};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x27')]=function(_0xfb949d){try{if(this[_0x0766('0x25')](_0xfb949d)){logger[_0x0766('0x28')](_0x0766('0x29'),_0xfb949d[_0x0766('0x2a')],_0xfb949d[_0x0766('0x2b')],_0xfb949d[_0x0766('0x2c')]);logger[_0x0766('0x2d')](_0x0766('0x2e'),_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0xfb949d,{'showHidden':![],'depth':null}));if(_[_0x0766('0x26')](this[_0x0766('0xb')][_0xfb949d[_0x0766('0x2a')]])){this['channels'][_0xfb949d[_0x0766('0x2a')]]={};}var _0xa964d7=this[_0x0766('0xd')][_0xfb949d[_0x0766('0x30')]];var _0x122d1e=this['channels'][_0xfb949d[_0x0766('0x2a')]][_0xfb949d[_0x0766('0x2c')]];var _0x26991c=this[_0x0766('0xc')][_0xfb949d[_0x0766('0x31')]];var _0x24b078=this['variables'][_0xfb949d[_0x0766('0x2a')]];if(_['isUndefined'](_0x122d1e)){_0x122d1e={'agentcalledAt':moment()[_0x0766('0x32')](_0x0766('0x33')),'lastevent':_0x0766('0x34'),'mandatoryDisposition':_0x26991c&&_0x26991c['mandatoryDisposition']?_0x26991c[_0x0766('0x35')]:![],'type':_0x26991c&&_0x26991c[_0x0766('0x36')]?_0x26991c['type']:'inbound','variables':_0x24b078,'motionChannel':_0x0766('0x37')};}_[_0x0766('0x38')](_0x122d1e,_['omit'](_0xfb949d,[_0x0766('0x39'),_0x0766('0x3a')]));logger['debug'](_0x0766('0x3b'),_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x122d1e,{'showHidden':![],'depth':null}));ami[_0x0766('0x24')]('custom:agentcalled',_0x122d1e);var _0x42bc85={'id':_0xa964d7['id'],'calleridnum':_0x122d1e['calleridnum'],'queue':_0x122d1e['queue'],'variables':_0x122d1e[_0x0766('0x3c')],'uniqueid':_0xfb949d[_0x0766('0x2a')]};logger[_0x0766('0x2d')](_0x0766('0x3d'),_0xfb949d['uniqueid'],util['inspect'](_0x42bc85,{'showHidden':![],'depth':null}));this['emit'](util[_0x0766('0x32')](_0x0766('0x3e'),_0xfb949d[_0x0766('0x2b')]),_0x0766('0x3f'),_0x42bc85);}}catch(_0x4d24c8){logger[_0x0766('0x40')]('[%s][voiceAgentReport][agentcalled]',_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x4d24c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')]['syncAgentConnect']=function(_0x16074a){try{if(this[_0x0766('0x25')](_0x16074a)){if(this['channels'][_0x16074a[_0x0766('0x2a')]]){logger[_0x0766('0x2d')](_0x0766('0x41'),_0x16074a[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x16074a,{'showHidden':![],'depth':null}));for(var _0x4adafd in this['channels'][_0x16074a[_0x0766('0x2a')]]){if(this['channels'][_0x16074a[_0x0766('0x2a')]][_0x0766('0x42')](_0x4adafd)){if(_0x16074a[_0x0766('0x2c')]===_0x4adafd){logger[_0x0766('0x28')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16074a['uniqueid'],_0x16074a['membername'],_0x16074a[_0x0766('0x2c')]);this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x43')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x16074a['uniqueid']][_0x4adafd]['connectedlinename']=_0x16074a[_0x0766('0x44')];this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x45')]=_0x16074a['connectedlinenum'];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x46')]=_0x16074a[_0x0766('0x46')];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x47')]=_0x16074a[_0x0766('0x47')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['holdtime']=_0x16074a['holdtime'];this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x48')]=_0x0766('0x49');if(this[_0x0766('0xa')][this['channels'][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x2a')]]){var _0x2c76e0=this[_0x0766('0xa')][this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x2a')]][_0x0766('0x4a')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x4a')]=_0x2c76e0;_0x16074a[_0x0766('0x4a')]=_0x2c76e0;}_[_0x0766('0x38')](this[_0x0766('0xd')][_0x16074a['interface']],_[_0x0766('0x4b')](_0x16074a,['queue',_0x0766('0x4c'),_0x0766('0x4a')]));var _0x2ce675=this['agents'][_0x16074a[_0x0766('0x4d')][_0x0766('0x4e')]('-')[0x0]];var _0xfda657={'id':_0x2ce675['id'],'name':_0x2ce675['name'],'agentconnected':!![],'destaccountcode':_0x2ce675['accountcode'],'destconnectedlinenum':this['channels'][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x4f')],'queue':this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x16074a['destuniqueid']][_0x0766('0x31')],'routealias':this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x4a')],'uniqueid':this['channels'][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x2a')]};logger['debug'](_0x0766('0x50'),_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0xfda657,{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x51'),_0xfda657);logger[_0x0766('0x2d')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0xfda657,{'showHidden':![],'depth':null}));this['emit'](util[_0x0766('0x32')](_0x0766('0x3e'),_0x16074a[_0x0766('0x2b')]),_0x0766('0x52'),_0xfda657);}else if(!this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['agentringnoanswer']&&!this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['agentcomplete']){logger[_0x0766('0x28')](_0x0766('0x53'),_0x16074a[_0x0766('0x2a')],this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x2b')],_0x4adafd);this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x12')]=!![];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x54')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x55')]=_0x16074a[_0x0766('0x2c')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['answeredelsewheremembername']=_0x16074a[_0x0766('0x2b')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x48')]=_0x0766('0x56');this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x57')]=_0x0766('0x56');logger[_0x0766('0x2d')](_0x0766('0x58'),_0x16074a[_0x0766('0x2a')],util['inspect'](this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd],{'showHidden':![],'depth':null}));ami[_0x0766('0x24')]('custom:agentansweredelsewhere',this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd]);}}}}}}catch(_0x36e6a5){logger[_0x0766('0x40')](_0x0766('0x59'),_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0x36e6a5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')]['syncAgentRingNoAnswer']=function(_0x3d1c91){try{if(this[_0x0766('0x25')](_0x3d1c91)){logger[_0x0766('0x2d')](_0x0766('0x5a'),_0x3d1c91[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3d1c91,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]]&&this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]][_0x3d1c91[_0x0766('0x2c')]]){logger[_0x0766('0x28')](_0x0766('0x5b'),_0x3d1c91[_0x0766('0x2a')],_0x3d1c91[_0x0766('0x2b')],_0x3d1c91[_0x0766('0x2c')]);var _0x12c051=this[_0x0766('0xd')][_0x3d1c91[_0x0766('0x30')]];var _0x176bdc=this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]][_0x3d1c91['destuniqueid']];_0x176bdc[_0x0766('0x12')]=!![];_0x176bdc[_0x0766('0x54')]=moment()[_0x0766('0x32')](_0x0766('0x33'));_0x176bdc[_0x0766('0x48')]=_0x0766('0x5c');_0x176bdc[_0x0766('0x57')]=_0x0766('0x5c');var _0x127a59={'id':_0x12c051['id'],'name':_0x12c051[_0x0766('0x5d')],'queue':_0x176bdc[_0x0766('0x31')],'uniqueid':_0x176bdc[_0x0766('0x2a')]};logger[_0x0766('0x2d')](_0x0766('0x5e'),_0x3d1c91[_0x0766('0x2a')],util['inspect'](_0x127a59,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0766('0x3e'),_0x12c051[_0x0766('0x5d')]),_0x0766('0x5f'),_0x127a59);ami[_0x0766('0x24')](_0x0766('0x60'),_0x176bdc);}}}catch(_0x5a5915){logger[_0x0766('0x40')](_0x0766('0x61'),_0x3d1c91['uniqueid'],util[_0x0766('0x2f')](_0x5a5915,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x14')]=function(_0x192937){try{if(this[_0x0766('0x25')](_0x192937)){logger[_0x0766('0x2d')](_0x0766('0x62'),_0x192937[_0x0766('0x2a')],util['inspect'](_0x192937,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]){for(var _0x326313 in this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]){if(this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]['hasOwnProperty'](_0x326313)&&!this['channels'][_0x192937['uniqueid']][_0x326313][_0x0766('0x12')]&&!this['channels'][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x15')]){logger[_0x0766('0x28')](_0x0766('0x63'),_0x192937[_0x0766('0x2a')],this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x2b')],_0x326313);this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x12')]=!![];this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x54')]=moment()['format'](_0x0766('0x33'));this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x48')]=_0x0766('0x64');this[_0x0766('0xb')][_0x192937['uniqueid']][_0x326313][_0x0766('0x57')]=_0x0766('0x64');logger['debug'](_0x0766('0x65'),_0x192937[_0x0766('0x2a')],util[_0x0766('0x2f')](this[_0x0766('0xb')][_0x192937['uniqueid']][_0x326313],{'showHidden':![],'depth':null}));ami['emit'](_0x0766('0x66'),this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313]);}}}}}catch(_0x3d8488){logger[_0x0766('0x40')]('[%s][voiceAgentReport][queuecallerabandon]',_0x192937[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3d8488,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x16')]=function(_0x1fd2cf){try{if(this['isNotNull'](_0x1fd2cf)){logger[_0x0766('0x2d')](_0x0766('0x67'),_0x1fd2cf[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x1fd2cf,{'showHidden':![],'depth':null}));if(this['channels'][_0x1fd2cf[_0x0766('0x2a')]]){for(var _0xbe5627 in this[_0x0766('0xb')][_0x1fd2cf['uniqueid']]){if(this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0x0766('0x42')](_0xbe5627)){if(this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]['agentconnectAt']&&!this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x15')]){logger[_0x0766('0x28')](_0x0766('0x68'),_0x1fd2cf[_0x0766('0x2a')],this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x2b')],_0xbe5627);this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627]['agentcomplete']=!![];this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x69')]=moment()[_0x0766('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x48')]=_0x0766('0x6a');this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x57')]=_0x1fd2cf[_0x0766('0x57')]==_0x0766('0x6b')?_0x0766('0x6c'):_0x1fd2cf['reason'];this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]['talktime']=_0x1fd2cf[_0x0766('0x6d')];if(this[_0x0766('0xc')][_0x1fd2cf[_0x0766('0x31')]]&&this[_0x0766('0xc')][_0x1fd2cf[_0x0766('0x31')]][_0x0766('0x6e')]){this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x6f')]=this[_0x0766('0xc')][_0x1fd2cf['queue']][_0x0766('0x70')];this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627][_0x0766('0x71')]=!![];}this[_0x0766('0xd')][_0x1fd2cf['interface']]=_[_0x0766('0x72')](this[_0x0766('0xd')][_0x1fd2cf[_0x0766('0x30')]],[_0x0766('0x31'),_0x0766('0x4c')]);logger[_0x0766('0x2d')](_0x0766('0x73'),_0x1fd2cf[_0x0766('0x2a')],util[_0x0766('0x2f')](this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627],{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x74'),this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]);logger[_0x0766('0x2d')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1fd2cf['uniqueid'],util['inspect']({'id':this[_0x0766('0xd')][_0x1fd2cf[_0x0766('0x30')]]['id'],'destaccountcode':_0x1fd2cf[_0x0766('0x75')]},{'showHidden':![],'depth':null}));this[_0x0766('0x24')](util[_0x0766('0x32')](_0x0766('0x3e'),_0x1fd2cf[_0x0766('0x2b')]),_0x0766('0x76'),{'id':this['agents'][_0x1fd2cf[_0x0766('0x30')]]['id'],'destaccountcode':Number(_0x1fd2cf[_0x0766('0x75')])});}}}}}}catch(_0xfa7d45){logger[_0x0766('0x40')](_0x0766('0x77'),_0x1fd2cf[_0x0766('0x2a')],util['inspect'](_0xfa7d45,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x18')]=function(_0x4f187f){try{if(this[_0x0766('0x25')](_0x4f187f)){logger[_0x0766('0x2d')](_0x0766('0x78'),_0x4f187f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x4f187f,{'showHidden':![],'depth':null}));this[_0x0766('0x79')](_0x4f187f[_0x0766('0x2a')],_['keys'](_0x4f187f[_0x0766('0x7a')])[0x0],_0x4f187f['value']);if(this[_0x0766('0xb')][_0x4f187f[_0x0766('0x2a')]]){for(var _0x3e99fa in this['channels'][_0x4f187f['uniqueid']]){if(this['channels'][_0x4f187f['uniqueid']]['hasOwnProperty'](_0x3e99fa)){logger[_0x0766('0x28')](_0x0766('0x7b'),_0x4f187f['uniqueid'],_0x3e99fa,_['keys'](_0x4f187f['variable'])[0x0],_0x4f187f[_0x0766('0x7c')]);if(_[_0x0766('0x26')](this[_0x0766('0xb')][_0x4f187f['uniqueid']][_0x3e99fa]['variables'])){this[_0x0766('0xb')][_0x4f187f[_0x0766('0x2a')]][_0x3e99fa][_0x0766('0x3c')]={};}this['channels'][_0x4f187f['uniqueid']][_0x3e99fa][_0x0766('0x3c')]=this[_0x0766('0x3c')][_0x4f187f['uniqueid']];}}}}}catch(_0x1d52f3){logger[_0x0766('0x40')]('[%s][voiceAgentReport][varset]',_0x4f187f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x1d52f3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x79')]=function(_0x1424e4,_0x1d22e7,_0x5105e8){var _0x44c2a6=[_0x0766('0x7d'),_0x0766('0x7e'),'rtpaudioqosjitter',_0x0766('0x7f'),_0x0766('0x80'),'rtpaudioqoslossbridged',_0x0766('0x81'),'rtpaudioqosrttbridged',_0x0766('0x82'),_0x0766('0x83'),_0x0766('0x84'),'bridgepvtcallid',_0x0766('0x85'),_0x0766('0x86'),'memberinterface',_0x0766('0x87'),_0x0766('0x2b'),_0x0766('0x88'),'memberrealtime'];if(!_[_0x0766('0x89')](_0x1d22e7)&&!_['includes'](_0x44c2a6,_0x1d22e7)){if(_[_0x0766('0x26')](this['variables'][_0x1424e4])){this[_0x0766('0x3c')][_0x1424e4]={};}this['variables'][_0x1424e4][_0x1d22e7]=_0x5105e8;}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x1a')]=function(_0x3d3b65){try{if(this[_0x0766('0x25')](_0x3d3b65)){logger[_0x0766('0x2d')]('[%s][voiceAgentReport][hangup]\x20event:',_0x3d3b65['uniqueid'],util[_0x0766('0x2f')](_0x3d3b65,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]){for(var _0x1622e4 in this[_0x0766('0xb')][_0x3d3b65['uniqueid']]){if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]['hasOwnProperty'](_0x1622e4)){if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]][_0x1622e4][_0x0766('0x57')]==_0x0766('0x6b')&&this[_0x0766('0xb')][_0x3d3b65['uniqueid']][_0x1622e4]['agentcomplete']){logger[_0x0766('0x28')](_0x0766('0x8a'),_0x3d3b65['uniqueid'],_0x1622e4);this['channels'][_0x3d3b65[_0x0766('0x2a')]][_0x1622e4][_0x0766('0x69')]=moment()[_0x0766('0x32')](_0x0766('0x33'));}}}logger['debug'](_0x0766('0x8b'),_0x3d3b65['uniqueid'],util['inspect'](_[_0x0766('0x8c')](this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]),{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x8d'),_[_0x0766('0x8c')](this[_0x0766('0xb')][_0x3d3b65['uniqueid']]));delete this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]];}if(this[_0x0766('0x3c')][_0x3d3b65[_0x0766('0x2a')]]){delete this['variables'][_0x3d3b65['uniqueid']];}}}catch(_0x9ff4e0){logger['error'](_0x0766('0x8e'),_0x3d3b65[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x9ff4e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x20')]=function(_0x35ef43){try{if(this[_0x0766('0x25')](_0x35ef43)){logger[_0x0766('0x2d')](_0x0766('0x8f'),_0x35ef43['uniqueid'],util[_0x0766('0x2f')](_0x35ef43,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']]){for(var _0x1caa65 in this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]){if(this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]['hasOwnProperty'](_0x1caa65)){if(_0x35ef43[_0x0766('0x91')]===_0x1caa65){logger[_0x0766('0x28')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x35ef43['uniqueid'],this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']][_0x1caa65][_0x0766('0x2b')],_0x1caa65);var _0x3302e3=moment();this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']][_0x1caa65]['agentcomplete']=!![];this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x69')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x48')]='complete';this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x57')]=_0x0766('0x6b');this['channels'][_0x35ef43['transfereeuniqueid']][_0x1caa65][_0x0766('0x6d')]=_0x3302e3[_0x0766('0x92')](this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65]['agentconnectAt'],_0x0766('0x93'));}}}}if(this[_0x0766('0xb')][_0x35ef43['secondtransfereruniqueid']]){var _0x7b9eb1=this[_0x0766('0xb')][_0x35ef43[_0x0766('0x94')]];this[_0x0766('0xb')][_0x35ef43['secondtransfereruniqueid']]=this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]];this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]=_0x7b9eb1;}}}catch(_0xb4d7f2){logger['error'](_0x0766('0x95'),_0x35ef43['uniqueid'],util[_0x0766('0x2f')](_0xb4d7f2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x22')]=function(_0x3971fb){try{if(this['isNotNull'](_0x3971fb)){logger[_0x0766('0x2d')](_0x0766('0x96'),_0x3971fb[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3971fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x3971fb[_0x0766('0x90')]]){for(var _0x315b86 in this['channels'][_0x3971fb[_0x0766('0x90')]]){if(this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x0766('0x42')](_0x315b86)){if(_0x3971fb[_0x0766('0x97')]===_0x315b86){logger[_0x0766('0x28')](_0x0766('0x98'),_0x3971fb['uniqueid'],this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x2b')],_0x315b86);var _0x3d5e67=moment();this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x15')]=!![];this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x69')]=_0x3d5e67;this['channels'][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x48')]='complete';this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x57')]=_0x0766('0x6b');this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x6d')]=_0x3d5e67[_0x0766('0x92')](this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x43')],_0x0766('0x93'));}}}}}}catch(_0xf8e291){logger[_0x0766('0x40')](_0x0766('0x99'),_0x3971fb[_0x0766('0x2a')],util[_0x0766('0x2f')](_0xf8e291,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x1c')]=function(_0x2d807f){var _0x36f6f8='';try{if(this['isNotNull'](_0x2d807f)){logger['debug'](_0x0766('0x9a'),_0x2d807f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x2d807f,{'showHidden':![],'depth':null}));if(_0x2d807f[_0x0766('0x4d')]){_0x36f6f8=_0x2d807f[_0x0766('0x4d')][_0x0766('0x9b')](0x0,_0x2d807f[_0x0766('0x4d')]['lastIndexOf']('-'));if(this['agents'][_0x36f6f8]){logger[_0x0766('0x28')](_0x0766('0x9c'),_0x2d807f[_0x0766('0x2a')],_0x36f6f8);this[_0x0766('0xd')][_0x36f6f8][_0x0766('0x9d')]=!![];}}}}catch(_0x19f1dd){logger[_0x0766('0x40')](_0x0766('0x9e'),_0x2d807f['uniqueid'],util[_0x0766('0x2f')](_0x19f1dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x438498){var _0x245c5a='';try{if(this[_0x0766('0x25')](_0x438498)){logger[_0x0766('0x2d')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x438498['uniqueid'],util[_0x0766('0x2f')](_0x438498,{'showHidden':![],'depth':null}));if(_0x438498[_0x0766('0x4d')]){_0x245c5a=_0x438498[_0x0766('0x4d')][_0x0766('0x9b')](0x0,_0x438498[_0x0766('0x4d')][_0x0766('0x9f')]('-'));if(this['agents'][_0x245c5a]){logger[_0x0766('0x28')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x438498[_0x0766('0x2a')],_0x245c5a);this[_0x0766('0xd')][_0x245c5a][_0x0766('0x9d')]=![];}}}}catch(_0xccd749){logger[_0x0766('0x40')](_0x0766('0xa0'),_0x438498[_0x0766('0x2a')],util['inspect'](_0xccd749,{'showHidden':![],'depth':null}));}};module[_0x0766('0xa1')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index a5ed687..16a3c5b 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 _0xeafa=['[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','uniqueid','inspect','linkedid','merge','pick','keys','context','from-sip','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','channel','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','starttime','disposition','toNumber','undefined','exten','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','toLowerCase','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','connectedlinename','destinationchannel','channelstate','UserId','membername','name','answertime','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','user:agentcomplete','transferType','then','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','exports','moment','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit'];(function(_0x3eaeac,_0x55fe0c){var _0x33fbe6=function(_0x4c3044){while(--_0x4c3044){_0x3eaeac['push'](_0x3eaeac['shift']());}};_0x33fbe6(++_0x55fe0c);}(_0xeafa,0x98));var _0xaeaf=function(_0x5f1aec,_0x13b64b){_0x5f1aec=_0x5f1aec-0x0;var _0x488646=_0xeafa[_0x5f1aec];return _0x488646;};'use strict';var _=require('lodash');var moment=require(_0xaeaf('0x0'));var util=require('util');var path=require(_0xaeaf('0x1'));var Redis=require(_0xaeaf('0x2'));var config=require(_0xaeaf('0x3'));var logger=require(_0xaeaf('0x4'))('ami');var ami=require(_0xaeaf('0x5'));var Channel=require(_0xaeaf('0x6'));var RpcSetting=require(_0xaeaf('0x7'));var applications=[_0xaeaf('0x8'),_0xaeaf('0x9'),_0xaeaf('0xa'),_0xaeaf('0xb'),_0xaeaf('0xc'),'voicemail'];var dispositions=[_0xaeaf('0xd'),_0xaeaf('0xe'),'FAILED',_0xaeaf('0xd'),_0xaeaf('0xd'),'NO\x20ANSWER',_0xaeaf('0xf'),'BUSY',_0xaeaf('0xe'),_0xaeaf('0xe'),'FAILED'];config[_0xaeaf('0x10')]=_['defaults'](config[_0xaeaf('0x10')],{'host':_0xaeaf('0x11'),'port':0x18eb});var io=require(_0xaeaf('0x12'))(new Redis(config[_0xaeaf('0x10')]));function VoiceCallReport(_0x5143b2){this['channels']=_0x5143b2[_0xaeaf('0x13')];this[_0xaeaf('0x14')]=_0x5143b2[_0xaeaf('0x14')];this[_0xaeaf('0x15')]={};ami['on'](_0xaeaf('0x16'),this[_0xaeaf('0x17')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x19'),this[_0xaeaf('0x17')]['bind'](this));ami['on']('newchannel',this[_0xaeaf('0x1a')]['bind'](this));ami['on'](_0xaeaf('0x1b'),this[_0xaeaf('0x1c')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x1d'),this[_0xaeaf('0x1e')]['bind'](this));ami['on']('hangup',this[_0xaeaf('0x1f')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x20'),this[_0xaeaf('0x21')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x22'),this['syncAttendedTransfer'][_0xaeaf('0x18')](this));ami['on']('blindtransfer',this[_0xaeaf('0x23')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x24'),this[_0xaeaf('0x25')][_0xaeaf('0x18')](this));ami['on'](_0xaeaf('0x26'),this[_0xaeaf('0x27')][_0xaeaf('0x18')](this));try{logger[_0xaeaf('0x28')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xaeaf('0x29')]();}catch(_0xd60761){logger['error'](_0xaeaf('0x2a'),util['inspect'](_0xd60761,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x2c')]=function(_0x2138a6){return _0x2138a6!==null&&!_[_0xaeaf('0x2d')](_0x2138a6);};VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x2e')]=function(_0x564103,_0x52fd03,_0x5003a1){io['to'](_0x564103)[_0xaeaf('0x2e')](_0x52fd03,_0x5003a1);};VoiceCallReport[_0xaeaf('0x2b')]['syncNewCallerId']=function(_0x20fdc0){try{if(this[_0xaeaf('0x2c')](_0x20fdc0)){logger[_0xaeaf('0x28')](_0xaeaf('0x2f'),_0x20fdc0['uniqueid'],_0x20fdc0[_0xaeaf('0x30')],_0x20fdc0[_0xaeaf('0x31')]);logger[_0xaeaf('0x32')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x20fdc0[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x20fdc0,{'showHidden':![],'depth':null}));if(_0x20fdc0[_0xaeaf('0x33')]===_0x20fdc0[_0xaeaf('0x35')]){if(!_[_0xaeaf('0x2d')](this[_0xaeaf('0x13')][_0x20fdc0[_0xaeaf('0x33')]])){_[_0xaeaf('0x36')](this[_0xaeaf('0x13')][_0x20fdc0['uniqueid']],_[_0xaeaf('0x37')](_0x20fdc0,_[_0xaeaf('0x38')](this[_0xaeaf('0x13')][_0x20fdc0['uniqueid']])));}}if(_0x20fdc0[_0xaeaf('0x39')]===_0xaeaf('0x3a')){if(this[_0xaeaf('0x14')][_0x20fdc0['channel'][_0xaeaf('0x3b')]('-')[0x0]]){if(_0x20fdc0['exten']==_0xaeaf('0x3c')){this[_0xaeaf('0x14')][_0x20fdc0['channel']['split']('-')[0x0]][_0xaeaf('0x3d')]=_0x20fdc0[_0xaeaf('0x3e')];this[_0xaeaf('0x2e')](util[_0xaeaf('0x3f')](_0xaeaf('0x40'),this[_0xaeaf('0x14')][_0x20fdc0[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]['name']),_0xaeaf('0x42'),{'destaccountcode':this[_0xaeaf('0x14')][_0x20fdc0[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]][_0xaeaf('0x43')],'destconnectedlinenum':_0x20fdc0[_0xaeaf('0x3e')]});}}}}}catch(_0x3dd9cc){logger[_0xaeaf('0x44')](_0xaeaf('0x45'),_0x20fdc0[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x3dd9cc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaeaf('0x1a')]=function(_0x59777f){try{if(this[_0xaeaf('0x2c')](_0x59777f)){logger[_0xaeaf('0x32')](_0xaeaf('0x46'),_0x59777f[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x59777f,{'showHidden':![],'depth':null}));if(this[_0xaeaf('0x13')][_0x59777f[_0xaeaf('0x33')]]){return;}if(_0x59777f[_0xaeaf('0x41')]===_0xaeaf('0x47')){return;}if(_0x59777f[_0xaeaf('0x33')]!==_0x59777f[_0xaeaf('0x35')]&&!this['blindTransfers'][_0x59777f[_0xaeaf('0x35')]]){return;}logger[_0xaeaf('0x28')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x59777f['uniqueid'],_0x59777f['context'],_0x59777f['exten']);this[_0xaeaf('0x13')][_0x59777f[_0xaeaf('0x33')]]=new Channel();this['channels'][_0x59777f[_0xaeaf('0x33')]][_0xaeaf('0x48')]=moment()[_0xaeaf('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaeaf('0x13')][_0x59777f['uniqueid']][_0xaeaf('0x49')]=dispositions[_[_0xaeaf('0x4a')](_0x59777f['channelstate'])];_[_0xaeaf('0x36')](this[_0xaeaf('0x13')][_0x59777f[_0xaeaf('0x33')]],_[_0xaeaf('0x37')](_0x59777f,_[_0xaeaf('0x38')](this[_0xaeaf('0x13')][_0x59777f[_0xaeaf('0x33')]])));if(_0x59777f[_0xaeaf('0x39')]===_0xaeaf('0x3a')){var _0x171058=this[_0xaeaf('0x14')][_0x59777f['channel'][_0xaeaf('0x3b')]('-')[0x0]];if(_0x171058&&typeof _0x171058['destconnectedlinenum']===_0xaeaf('0x4b')){_0x171058[_0xaeaf('0x3d')]=_0x59777f[_0xaeaf('0x4c')];logger[_0xaeaf('0x32')](_0xaeaf('0x4d'),_0x59777f[_0xaeaf('0x33')],util['inspect']({'id':_0x171058['id'],'destaccountcode':_0x171058[_0xaeaf('0x43')],'destconnectedlinenum':_0x59777f[_0xaeaf('0x4c')]},{'showHidden':![],'depth':null}));this[_0xaeaf('0x2e')](util['format']('user:%s',_0x171058['name']),_0xaeaf('0x42'),{'id':_0x171058['id'],'destaccountcode':_0x171058[_0xaeaf('0x43')],'destconnectedlinenum':_0x59777f[_0xaeaf('0x4c')]});}}}}catch(_0x3b1361){logger[_0xaeaf('0x44')](_0xaeaf('0x4e'),_0x59777f[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x3b1361,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x17')]=function(_0x4e8dab){try{if(this[_0xaeaf('0x2c')](_0x4e8dab)){logger['debug'](_0xaeaf('0x4f'),_0x4e8dab[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x4e8dab,{'showHidden':![],'depth':null}));if(_0x4e8dab[_0xaeaf('0x41')]===_0xaeaf('0x47')||_0x4e8dab[_0xaeaf('0x4c')]==='h')return;if(_0x4e8dab[_0xaeaf('0x33')]===_0x4e8dab['linkedid']||this['blindTransfers'][_0x4e8dab[_0xaeaf('0x35')]]){_0x4e8dab[_0xaeaf('0x50')]=_0x4e8dab[_0xaeaf('0x50')]?_0x4e8dab[_0xaeaf('0x50')]['toLowerCase']():undefined;_0x4e8dab[_0xaeaf('0x51')]=_0x4e8dab[_0xaeaf('0x52')]||_0x4e8dab['applicationdata'];if(_0x4e8dab[_0xaeaf('0x52')]&&!_0x4e8dab[_0xaeaf('0x52')][_0xaeaf('0x53')](_0xaeaf('0x54'))&&_0x4e8dab[_0xaeaf('0x50')]!==_0xaeaf('0x9')){_0x4e8dab[_0xaeaf('0x51')]=_0x4e8dab[_0xaeaf('0x51')]['toLowerCase']();}logger['info'](_0xaeaf('0x55'),_0x4e8dab[_0xaeaf('0x33')],_0x4e8dab[_0xaeaf('0x50')],_0x4e8dab[_0xaeaf('0x51')]);if(_[_0xaeaf('0x2d')](this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]])){this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]]=new Channel();this[_0xaeaf('0x13')][_0x4e8dab['uniqueid']][_0xaeaf('0x48')]=_0x4e8dab[_0xaeaf('0x56')]?moment()[_0xaeaf('0x57')](moment['duration'](_0x4e8dab[_0xaeaf('0x56')])[_0xaeaf('0x58')](),_0xaeaf('0x58'))[_0xaeaf('0x3f')](_0xaeaf('0x59')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]][_0xaeaf('0x49')]='NO\x20ANSWER';}_[_0xaeaf('0x36')](this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]],_[_0xaeaf('0x37')](_0x4e8dab,_['keys'](this[_0xaeaf('0x13')][_0x4e8dab['uniqueid']])));if(_['includes'](applications,_0x4e8dab['application'])){this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]][_0xaeaf('0x5a')]=_0x4e8dab[_0xaeaf('0x50')];this['channels'][_0x4e8dab[_0xaeaf('0x33')]][_0xaeaf('0x5b')]=_0x4e8dab[_0xaeaf('0x51')];if(_0x4e8dab[_0xaeaf('0x50')]===_0xaeaf('0x8')&&_[_0xaeaf('0x53')](_0x4e8dab[_0xaeaf('0x51')][_0xaeaf('0x5c')](),_0xaeaf('0x5d'))){var _0x54d64a=_0x4e8dab[_0xaeaf('0x51')][_0xaeaf('0x3b')]('=');var _0x48b013=_0x54d64a[0x0][_0xaeaf('0x5c')]()[_0xaeaf('0x5e')](/cdr\((.*)\)/);if(_0x48b013){if(_0x48b013[0x1]===_0xaeaf('0x5f')&&!_[_0xaeaf('0x60')](this[_0xaeaf('0x13')][_0x4e8dab['uniqueid']][_0x48b013[0x1]]))return;this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]][_0x48b013[0x1]]=_0x54d64a[0x1];}}else if(_0x4e8dab[_0xaeaf('0x50')]===_0xaeaf('0x9')){this[_0xaeaf('0x13')][_0x4e8dab[_0xaeaf('0x33')]][_0xaeaf('0x9')]=_0x4e8dab[_0xaeaf('0x51')][_0xaeaf('0x3b')](',')[0x0];}}}}}catch(_0x176843){logger['error'](_0xaeaf('0x61'),_0x4e8dab['uniqueid'],util['inspect'](_0x176843,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x1c')]=function(_0x11b00f){try{if(this[_0xaeaf('0x2c')](_0x11b00f)){logger[_0xaeaf('0x28')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x11b00f[_0xaeaf('0x33')],_0x11b00f[_0xaeaf('0x35')],_0x11b00f[_0xaeaf('0x30')],_0x11b00f[_0xaeaf('0x31')]);logger[_0xaeaf('0x32')](_0xaeaf('0x62'),_0x11b00f[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x11b00f,{'showHidden':![],'depth':null}));if(_0x11b00f['channelstate']!=='6')return;var _0x259e8a=this[_0xaeaf('0x14')][_0x11b00f['channel'][_0xaeaf('0x3b')]('-')[0x0]];if(_0x11b00f[_0xaeaf('0x33')]!==_0x11b00f['linkedid']){var _0x5c6ae3=moment();if(this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]]){if(!this[_0xaeaf('0x13')][_0x11b00f['linkedid']][_0xaeaf('0x63')]){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]]['answered']=!![];this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]]['answertime']=_0x5c6ae3[_0xaeaf('0x3f')](_0xaeaf('0x59'));if(this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x48')]){this['channels'][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x64')]=_0x5c6ae3[_0xaeaf('0x65')](this[_0xaeaf('0x13')][_0x11b00f['linkedid']][_0xaeaf('0x48')],_0xaeaf('0x58'));}}this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x35')]=_0x11b00f[_0xaeaf('0x33')];if(_0x11b00f[_0xaeaf('0x31')]!==_0xaeaf('0x3c')){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x3e')]=_0x11b00f['calleridnum'];}this[_0xaeaf('0x13')][_0x11b00f['linkedid']][_0xaeaf('0x66')]=_0x11b00f['calleridname'];this['channels'][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x67')]=_0x11b00f['channel'];this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]]['disposition']=dispositions[_['toNumber'](_0x11b00f[_0xaeaf('0x68')])];if(_0x259e8a){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x69')]=_0x259e8a['id'];this['channels'][_0x11b00f['linkedid']][_0xaeaf('0x6a')]=_0x259e8a[_0xaeaf('0x6b')];}}if(this['channels'][_0x11b00f[_0xaeaf('0x33')]]){if(!this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x63')]){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x63')]=!![];this[_0xaeaf('0x13')][_0x11b00f['uniqueid']][_0xaeaf('0x6c')]=_0x5c6ae3[_0xaeaf('0x3f')](_0xaeaf('0x59'));if(this[_0xaeaf('0x13')][_0x11b00f['uniqueid']][_0xaeaf('0x48')]){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x64')]=_0x5c6ae3['diff'](this['channels'][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x48')],_0xaeaf('0x58'));}}if(_0x11b00f[_0xaeaf('0x31')]!=='xcally-motion-preview'){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x3e')]=_0x11b00f[_0xaeaf('0x31')];}this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]]['connectedlinename']=_0x11b00f['calleridname'];this['channels'][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x67')]=_0x11b00f['channel'];this[_0xaeaf('0x13')][_0x11b00f['uniqueid']][_0xaeaf('0x49')]=dispositions[_[_0xaeaf('0x4a')](_0x11b00f[_0xaeaf('0x68')])];}}else{if(this['channels'][_0x11b00f['uniqueid']]){if(_0x259e8a){this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]]['UserId']=_0x259e8a['id'];this[_0xaeaf('0x13')][_0x11b00f['uniqueid']][_0xaeaf('0x6a')]=_0x259e8a[_0xaeaf('0x6b')];}}}if(_0x11b00f[_0xaeaf('0x39')]===_0xaeaf('0x3a')){if(_0x259e8a){_0x259e8a[_0xaeaf('0x3d')]=_0x11b00f['exten'];var _0x1f2465,_0x5537fe;if(this[_0xaeaf('0x13')][_0x11b00f['uniqueid']]){_0x1f2465=this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]]['routealias'];_0x5537fe=this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x33')]][_0xaeaf('0x9')];}else if(this[_0xaeaf('0x13')][_0x11b00f[_0xaeaf('0x35')]]){_0x1f2465=this['channels'][_0x11b00f[_0xaeaf('0x35')]][_0xaeaf('0x6d')];_0x5537fe=this[_0xaeaf('0x13')][_0x11b00f['linkedid']][_0xaeaf('0x9')];}_0x259e8a['queue']=_0x5537fe;_0x259e8a[_0xaeaf('0x6d')]=_0x1f2465;var _0x11fff5={'id':_0x259e8a['id'],'name':_0x259e8a[_0xaeaf('0x6b')],'agentconnected':!![],'destaccountcode':_0x259e8a[_0xaeaf('0x43')],'destconnectedlinenum':_0x11b00f['exten'],'queue':_0x5537fe||undefined,'routealias':_0x1f2465,'uniqueid':_0x11b00f[_0xaeaf('0x35')]};logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x11b00f[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x11fff5,{'showHidden':![],'depth':null}));this[_0xaeaf('0x2e')](util[_0xaeaf('0x3f')](_0xaeaf('0x40'),_0x259e8a[_0xaeaf('0x6b')]),'user:agentconnect',_0x11fff5);}}}}catch(_0x2e2685){logger['error'](_0xaeaf('0x6e'),_0x11b00f['uniqueid'],util[_0xaeaf('0x34')](_0x2e2685,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x6f')]=function(_0x3b51ea,_0x13ac61){try{if(this[_0xaeaf('0x13')][_0x3b51ea]){logger['info'](_0xaeaf('0x70'),_0x3b51ea,_0x13ac61);this[_0xaeaf('0x13')][_0x3b51ea][_0xaeaf('0x71')]=!![];if(_['endsWith'](_0x13ac61,'.wav49')){_0x13ac61=_0x13ac61['replace'](_0xaeaf('0x72'),_0xaeaf('0x73'));}this['channels'][_0x3b51ea][_0xaeaf('0x74')]=_0x13ac61;var _0x286ab4=_[_0xaeaf('0x75')](this['channels'][_0x3b51ea][_0xaeaf('0x76')],{'filename':_0x13ac61});if(_[_0xaeaf('0x60')](_0x286ab4)){this['channels'][_0x3b51ea][_0xaeaf('0x76')][_0xaeaf('0x77')]({'filename':_0x13ac61,'createdAt':moment()[_0xaeaf('0x3f')](_0xaeaf('0x59')),'mixmonitorid':'','status':_0xaeaf('0x78')});}}}catch(_0x1825c6){logger[_0xaeaf('0x44')](_0xaeaf('0x79'),_0x3b51ea,util['inspect'](_0x1825c6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaeaf('0x1e')]=function(_0x166ac7){try{if(this[_0xaeaf('0x2c')](_0x166ac7)){logger[_0xaeaf('0x32')](_0xaeaf('0x7a'),_0x166ac7[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x166ac7,{'showHidden':![],'depth':null}));if(this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]]&&_0x166ac7[_0xaeaf('0x41')]!=_0xaeaf('0x47')){if(this['isNotNull'](_0x166ac7[_0xaeaf('0x7b')])){if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')]['mixmonitor_filename'])){logger[_0xaeaf('0x28')](_0xaeaf('0x7c'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7[_0xaeaf('0x7d')]);this[_0xaeaf('0x6f')](_0x166ac7[_0xaeaf('0x33')],_0x166ac7[_0xaeaf('0x7d')]);}else if(this[_0xaeaf('0x2c')](_0x166ac7['variable'][_0xaeaf('0x7e')])){logger[_0xaeaf('0x28')](_0xaeaf('0x7f'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7['value']);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]][_0xaeaf('0x31')]=_0x166ac7[_0xaeaf('0x7d')];}else if(this['isNotNull'](_0x166ac7[_0xaeaf('0x7b')][_0xaeaf('0x80')])){logger[_0xaeaf('0x28')](_0xaeaf('0x81'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7['value']);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]][_0xaeaf('0x82')]=_0x166ac7[_0xaeaf('0x7d')];}else if(this['isNotNull'](_0x166ac7[_0xaeaf('0x7b')][_0xaeaf('0x83')])){logger[_0xaeaf('0x28')](_0xaeaf('0x84'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7['value']);this['channels'][_0x166ac7['uniqueid']]['type']=_0x166ac7[_0xaeaf('0x7d')];}else if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')][_0xaeaf('0x85')])){logger[_0xaeaf('0x28')](_0xaeaf('0x86'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7[_0xaeaf('0x7d')]['split'](',')[0x0]);this[_0xaeaf('0x13')][_0x166ac7['uniqueid']]['queue']=_0x166ac7['value'][_0xaeaf('0x3b')](',')[0x0];}else if(this['isNotNull'](_0x166ac7[_0xaeaf('0x7b')][_0xaeaf('0x87')])){logger[_0xaeaf('0x28')](_0xaeaf('0x88'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7[_0xaeaf('0x7d')]);this['channels'][_0x166ac7[_0xaeaf('0x33')]][_0xaeaf('0x89')]=_0x166ac7[_0xaeaf('0x7d')];}else if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')][_0xaeaf('0x8a')])){logger['info'](_0xaeaf('0x8b'),_0x166ac7[_0xaeaf('0x33')],_0x166ac7[_0xaeaf('0x7d')]);this[_0xaeaf('0x13')][_0x166ac7['uniqueid']][_0xaeaf('0x8c')]=_0x166ac7[_0xaeaf('0x7d')];}else if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')]['xmd-callerid-preview'])){logger[_0xaeaf('0x28')](_0xaeaf('0x8d'),_0x166ac7['uniqueid'],_0x166ac7['value']);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]]['calleridpreview']=_0x166ac7[_0xaeaf('0x7d')];}else if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')]['xmcs-queue'])){logger[_0xaeaf('0x28')](_0xaeaf('0x8e'),_0x166ac7['uniqueid'],_0x166ac7['value']);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]][_0xaeaf('0x9')]=_0x166ac7[_0xaeaf('0x7d')];}else if(this['isNotNull'](_0x166ac7['variable'][_0xaeaf('0x8f')])){logger['info'](_0xaeaf('0x90'),_0x166ac7['uniqueid'],_0x166ac7[_0xaeaf('0x7d')]);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x33')]][_0xaeaf('0x91')]=_0x166ac7[_0xaeaf('0x7d')];}}}else if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')]['mixmonitor_filename'])){if(_0x166ac7['value']){var _0x3b9593=path[_0xaeaf('0x92')](_0x166ac7['value'])['name'];logger[_0xaeaf('0x28')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x3b9593,_0x166ac7[_0xaeaf('0x7d')]);this[_0xaeaf('0x6f')](_0x3b9593,_0x166ac7[_0xaeaf('0x7d')]);}}else if(this[_0xaeaf('0x13')][_0x166ac7['linkedid']]){if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')])){if(this[_0xaeaf('0x2c')](_0x166ac7[_0xaeaf('0x7b')]['sipcallid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x166ac7[_0xaeaf('0x35')],_0x166ac7[_0xaeaf('0x7d')]);this[_0xaeaf('0x13')][_0x166ac7[_0xaeaf('0x35')]][_0xaeaf('0x93')]=_0x166ac7[_0xaeaf('0x7d')];}}}}}catch(_0x28621b){logger[_0xaeaf('0x44')](_0xaeaf('0x94'),_0x166ac7[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x28621b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaeaf('0x2b')][_0xaeaf('0x1f')]=function(_0x2afcb6){try{if(this[_0xaeaf('0x2c')](_0x2afcb6)){logger[_0xaeaf('0x32')](_0xaeaf('0x95'),_0x2afcb6[_0xaeaf('0x33')],util[_0xaeaf('0x34')](_0x2afcb6,{'showHidden':![],'depth':null}));if(this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]]){if(this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]]){this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]]['uniqueid']=_0x2afcb6['uniqueid'];this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]][_0xaeaf('0x63')]=this[_0xaeaf('0x13')][_0x2afcb6['uniqueid']][_0xaeaf('0x63')];this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]][_0xaeaf('0x6c')]=this['channels'][_0x2afcb6['uniqueid']][_0xaeaf('0x6c')];this['channels'][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]][_0xaeaf('0x67')]=this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]]['channel'];this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]]['linkedid']][_0xaeaf('0x49')]=this['channels'][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x49')];this[_0xaeaf('0x13')][_0x2afcb6['uniqueid']]=this['channels'][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]]['linkedid']];delete this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x35')]];}else if(this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6['linkedid']]['uniqueid']]){this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6['linkedid']][_0xaeaf('0x33')]][_0xaeaf('0x33')]=[this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]]['linkedid'],this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]]['linkedid']=this[_0xaeaf('0x13')][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]][_0xaeaf('0x33')]][0x0];this[_0xaeaf('0x13')][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]]['uniqueid']][_0xaeaf('0x63')]=this['channels'][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x63')];this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]]['uniqueid']]['answertime']=this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]]['answertime'];this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6['linkedid']][_0xaeaf('0x33')]]['destinationchannel']=this[_0xaeaf('0x13')][this[_0xaeaf('0x15')][_0x2afcb6['linkedid']][_0xaeaf('0x33')]]['channel'];this[_0xaeaf('0x13')][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]]['disposition']=this[_0xaeaf('0x13')][_0x2afcb6['uniqueid']][_0xaeaf('0x49')];this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]]=this[_0xaeaf('0x13')][this['blindTransfers'][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]];delete this['channels'][this[_0xaeaf('0x15')][_0x2afcb6[_0xaeaf('0x35')]][_0xaeaf('0x33')]];}}if(this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x2afcb6['uniqueid'],_0x2afcb6[_0xaeaf('0x96')]);var _0x48dc96=moment();this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x97')]=_0x48dc96[_0xaeaf('0x3f')](_0xaeaf('0x59'));this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x56')]=_0x48dc96[_0xaeaf('0x65')](this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x48')],_0xaeaf('0x58'));if(this['channels'][_0x2afcb6['uniqueid']][_0xaeaf('0x63')]){this['channels'][_0x2afcb6[_0xaeaf('0x33')]]['billableseconds']=_0x48dc96[_0xaeaf('0x65')](this['channels'][_0x2afcb6['uniqueid']][_0xaeaf('0x6c')],_0xaeaf('0x58'));this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x64')]=this['channels'][_0x2afcb6['uniqueid']][_0xaeaf('0x56')]-this[_0xaeaf('0x13')][_0x2afcb6[_0xaeaf('0x33')]][_0xaeaf('0x98')];}if(_0x2afcb6[_0xaeaf('0x39')]===_0xaeaf('0x3a')){if(this[_0xaeaf('0x14')][_0x2afcb6[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]){this['agents'][_0x2afcb6[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]=_[_0xaeaf('0x99')](this['agents'][_0x2afcb6['channel']['split']('-')[0x0]],['destconnectedlinenum']);logger[_0xaeaf('0x32')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2afcb6[_0xaeaf('0x33')],util[_0xaeaf('0x34')]({'id':this[_0xaeaf('0x14')][_0x2afcb6[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xaeaf('0x14')][_0x2afcb6[_0xaeaf('0x41')]['split']('-')[0x0]][_0xaeaf('0x43')]},{'showHidden':![],'depth':null}));this[_0xaeaf('0x2e')](util[_0xaeaf('0x3f')]('user:%s',this[_0xaeaf('0x14')][_0x2afcb6[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]['name']),_0xaeaf('0x9a'),{'id':this[_0xaeaf('0x14')][_0x2afcb6[_0xaeaf('0x41')][_0xaeaf('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2afcb6[_0xaeaf('0x41')]['split']('-')[0x0]][_0xaeaf('0x43')]});for(var _0x513556=0x0;_0x5135560x0?!![]:![];if(!_0x553576){return this['syncQueueSummaryComplete'](this[_0xeb9a('0x13')][_0xeb9a('0x6f')]);}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x70')]=function(_0x38a168){var _0x327687=this[_0xeb9a('0x13')]['id'];if(this['summary'][_0xeb9a('0x65')][_0x327687]&&this[_0xeb9a('0x13')][_0xeb9a('0x65')][_0x327687][_0x38a168[_0xeb9a('0x66')]]){this['summary']['queuestatus'][_0x327687][_0x38a168[_0xeb9a('0x66')]][_0xeb9a('0xe')][_0xeb9a('0x71')](_0x38a168);}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x16')]=function(_0x3e49e9){var _0x5aa1d7=this;try{if(this['isNotNull'](_0x3e49e9)&&this[_0xeb9a('0x5e')](_0x3e49e9['queue'])){logger[_0xeb9a('0x4b')](_0xeb9a('0x72'),util[_0xeb9a('0x45')](_0x3e49e9,{'showHidden':![],'depth':null}));var _0x23115d=this[_0xeb9a('0x11')][_0x3e49e9['queue']];if(_0x23115d){logger[_0xeb9a('0x73')](_0xeb9a('0x74'),_0x23115d['name']);this['summary']['queues'][_0x23115d[_0xeb9a('0x5c')]]={'summaryEvent':_0x3e49e9};this[_0xeb9a('0x13')][_0xeb9a('0x6e')]+=0x1;return ami[_0xeb9a('0x3c')]({'action':_0xeb9a('0x65'),'queue':_0x23115d['name']})[_0xeb9a('0x64')](function(_0x57c2da){if(!_0x5aa1d7[_0xeb9a('0x13')][_0xeb9a('0x65')][_0x3e49e9[_0xeb9a('0x66')]]){_0x5aa1d7['summary'][_0xeb9a('0x65')][_0x3e49e9['actionid']]={};}_0x5aa1d7['summary'][_0xeb9a('0x65')][_0x3e49e9[_0xeb9a('0x66')]][_0x57c2da[_0xeb9a('0x66')]]={'queue':_0x23115d[_0xeb9a('0x5c')],'agents':[]};})[_0xeb9a('0x61')](function(_0x5a8ca7){throw _0x5a8ca7;});}}}catch(_0x50451f){logger[_0xeb9a('0x41')](_0xeb9a('0x67'),util['inspect'](_0x50451f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb9a('0x37')]['syncQueueSummaryComplete']=function(_0x376bd7){if(this[_0xeb9a('0x13')][_0xeb9a('0x6e')]>0x0){this[_0xeb9a('0x13')][_0xeb9a('0x6f')]=_0x376bd7;return;}logger[_0xeb9a('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xeb9a('0x45')](_0x376bd7,{'showHidden':![],'depth':null}));this[_0xeb9a('0x13')]=initializeSummary();ami[_0xeb9a('0x49')](_0xeb9a('0x75'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x561789){try{if(this[_0xeb9a('0x5e')](_0x561789)){logger[_0xeb9a('0x4b')](_0xeb9a('0x76'),_0x561789[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x561789,{'showHidden':![],'depth':null}));if(_[_0xeb9a('0x5f')](this[_0xeb9a('0xc')][_0x561789[_0xeb9a('0x4e')]])){this[_0xeb9a('0xc')][_0x561789[_0xeb9a('0x4e')]]=[];}if(_[_0xeb9a('0x5f')](this[_0xeb9a('0xf')][_0x561789['uniqueid']])){this[_0xeb9a('0xf')][_0x561789['uniqueid']]={};}var _0x53ae42=new QueueReport();_0x53ae42[_0xeb9a('0x4f')]=_0x561789['queue'];_0x53ae42['type']=this[_0xeb9a('0x11')][_0x53ae42[_0xeb9a('0x4f')]]&&this['voiceQueues'][_0x53ae42[_0xeb9a('0x4f')]][_0xeb9a('0x59')]?this['voiceQueues'][_0x53ae42[_0xeb9a('0x4f')]][_0xeb9a('0x59')]||_0xeb9a('0x5a'):_0xeb9a('0x5a');_0x53ae42[_0xeb9a('0x77')]=moment()[_0xeb9a('0x54')](_0xeb9a('0x78'));_0x53ae42[_0xeb9a('0x79')]=_0x561789[_0xeb9a('0x79')];_0x53ae42[_0xeb9a('0x7a')]=_0x561789[_0xeb9a('0x7a')];_0x53ae42['uniqueid']=_0x561789[_0xeb9a('0x4e')];_0x53ae42['routealias']=this[_0xeb9a('0xf')][_0x561789[_0xeb9a('0x4e')]][_0xeb9a('0x7b')];logger[_0xeb9a('0x73')](_0xeb9a('0x7c'),_0x53ae42[_0xeb9a('0x4f')],_0x53ae42[_0xeb9a('0x59')]);_[_0xeb9a('0x7d')](_0x53ae42,_[_0xeb9a('0x7e')](_0x561789,_[_0xeb9a('0x7f')](_0x53ae42)));this[_0xeb9a('0xc')][_0x561789['uniqueid']][_0xeb9a('0x71')](_0x53ae42);this[_0xeb9a('0xf')][_0x561789['uniqueid']]=_0x53ae42;this[_0xeb9a('0x4a')](_0x53ae42,'queuecallerjoin');}}catch(_0x246193){logger[_0xeb9a('0x41')](_0xeb9a('0x76'),_0x561789[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x246193,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x80')]=function(_0x1cace3){try{if(this[_0xeb9a('0x5e')](_0x1cace3)){logger[_0xeb9a('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1cace3[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x1cace3,{'showHidden':![],'depth':null}));if(this[_0xeb9a('0xc')][_0x1cace3[_0xeb9a('0x4e')]]){var _0x117a0f=_['last'](this[_0xeb9a('0xc')][_0x1cace3[_0xeb9a('0x4e')]]);_0x117a0f['queuecallercomplete']=![];_0x117a0f[_0xeb9a('0x81')]=null;_0x117a0f['holdtime']=_0x1cace3['holdtime'];_0x117a0f[_0xeb9a('0x82')]=_0x1cace3[_0xeb9a('0x82')];_0x117a0f[_0xeb9a('0x1e')]=!![];_0x117a0f[_0xeb9a('0x83')]=moment()[_0xeb9a('0x54')](_0xeb9a('0x78'));_0x117a0f['queuecallerexitreason']='ABANDONED';_0x117a0f[_0xeb9a('0x84')]=null;logger[_0xeb9a('0x73')](_0xeb9a('0x85'),_0x117a0f[_0xeb9a('0x4f')],_0x117a0f[_0xeb9a('0x59')]);this['channels'][_0x1cace3[_0xeb9a('0x4e')]]=_0x117a0f;this[_0xeb9a('0x86')](_0x117a0f,'queuecallerabandon');}}}catch(_0x5a5af9){logger[_0xeb9a('0x41')](_0xeb9a('0x87'),_0x1cace3['uniqueid'],util[_0xeb9a('0x45')](_0x5a5af9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x20')]=function(_0x3e7f5a){try{if(this['isNotNull'](_0x3e7f5a)){logger['debug'](_0xeb9a('0x88'),_0x3e7f5a[_0xeb9a('0x4e')],util['inspect'](_0x3e7f5a,{'showHidden':![],'depth':null}));if(this[_0xeb9a('0xc')][_0x3e7f5a['uniqueid']]){var _0x4f892b=_[_0xeb9a('0x89')](this['queueReports'][_0x3e7f5a[_0xeb9a('0x4e')]]);_0x4f892b[_0xeb9a('0x8a')]=moment()[_0xeb9a('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f892b['connectedlinenum']=_0x3e7f5a[_0xeb9a('0x8b')];_0x4f892b[_0xeb9a('0x8c')]=_0x3e7f5a[_0xeb9a('0x8c')];logger[_0xeb9a('0x73')](_0xeb9a('0x8d'),_0x4f892b[_0xeb9a('0x4f')],_0x4f892b[_0xeb9a('0x59')],_0x3e7f5a[_0xeb9a('0x8b')],_0x3e7f5a[_0xeb9a('0x8c')]);this[_0xeb9a('0xf')][_0x3e7f5a[_0xeb9a('0x4e')]]=_0x4f892b;this[_0xeb9a('0x4a')](_0x4f892b,_0xeb9a('0x1f'));}}}catch(_0x253ebb){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x3e7f5a['uniqueid'],util[_0xeb9a('0x45')](_0x253ebb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x23')]=function(_0x470263){try{if(this[_0xeb9a('0x5e')](_0x470263)){logger[_0xeb9a('0x4b')](_0xeb9a('0x8e'),_0x470263[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x470263,{'showHidden':![],'depth':null}));if(this[_0xeb9a('0xc')][_0x470263[_0xeb9a('0x4e')]]){var _0x480f15=_['last'](this['queueReports'][_0x470263[_0xeb9a('0x4e')]]);_0x480f15['queuecallercomplete']=!![];_0x480f15[_0xeb9a('0x8f')]=_0xeb9a('0x90');logger['info'](_0xeb9a('0x91'),_0x480f15[_0xeb9a('0x4f')],_0x480f15[_0xeb9a('0x59')]);}}}catch(_0x1c07cf){logger['error'](_0xeb9a('0x8e'),_0x470263[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x1c07cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb9a('0x22')]=function(_0x11c1ed){try{if(this[_0xeb9a('0x5e')](_0x11c1ed)){logger[_0xeb9a('0x4b')]('[%s][voiceQueueReport][agentcomplete]',_0x11c1ed[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x11c1ed,{'showHidden':![],'depth':null}));if(this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x4e')]]){var _0x1b0212=_[_0xeb9a('0x89')](this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x4e')]]);_0x1b0212[_0xeb9a('0x1e')]=![];_0x1b0212[_0xeb9a('0x83')]=null;_0x1b0212['assigned']=!![];_0x1b0212['lastAssignedTo']=_0x11c1ed['membername'];_0x1b0212['holdtime']=_0x11c1ed[_0xeb9a('0x92')];_0x1b0212['queuecallercomplete']=!![];_0x1b0212[_0xeb9a('0x93')]=![];_0x1b0212[_0xeb9a('0x94')]=null;if(!_0x1b0212['transfer']){if(_0x11c1ed[_0xeb9a('0x95')]=='transfer'){_0x1b0212['queuecallerexitreason']=_0xeb9a('0x96');logger['info'](_0xeb9a('0x97'),_0x1b0212['queue'],_0x1b0212['type']);}else{if(_['startsWith'](_0x11c1ed['channel']['toLowerCase'](),_0xeb9a('0x98'))){if(this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x99')]]){var _0xcdfbd0=_[_0xeb9a('0x89')](this[_0xeb9a('0xc')][_0x11c1ed['linkedid']]);_0xcdfbd0['queuecallercomplete']=![];_0xcdfbd0['queuecallerexit']=!![];_0xcdfbd0['queuecallerexitAt']=moment(_0x1b0212[_0xeb9a('0x77')])[_0xeb9a('0x9a')](_0x11c1ed[_0xeb9a('0x92')],_0xeb9a('0x9b'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0xcdfbd0['queuecallerexitreason']='FORWARDTRANSFER';_0xcdfbd0['transfer']=!![];_0xcdfbd0['transfertype']=_0xeb9a('0x9c');_0xcdfbd0['transferexten']=_0x11c1ed['destexten'];_0xcdfbd0[_0xeb9a('0x9d')]=_0x11c1ed['uniqueid'];logger[_0xeb9a('0x73')](_0xeb9a('0x9e'),_0xcdfbd0[_0xeb9a('0x4f')],_0xcdfbd0[_0xeb9a('0x59')]);var _0x3cabf0=this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x99')]];this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x99')]]=this[_0xeb9a('0xc')][_0x11c1ed[_0xeb9a('0x4e')]];this['queueReports'][_0x11c1ed[_0xeb9a('0x4e')]]=_0x3cabf0;}}else{_0x1b0212[_0xeb9a('0x8f')]=_0xeb9a('0x9f')+_0x11c1ed[_0xeb9a('0x95')][_0xeb9a('0xa0')]();logger[_0xeb9a('0x73')](_0xeb9a('0xa1'),_0x1b0212[_0xeb9a('0x4f')],_0x1b0212[_0xeb9a('0x59')],_0x1b0212[_0xeb9a('0x8f')]);}}}this[_0xeb9a('0xf')][_0x11c1ed['uniqueid']]=_0x1b0212;this[_0xeb9a('0x86')](_0x1b0212,'agentcomplete');}}}catch(_0x43a996){logger[_0xeb9a('0x41')](_0xeb9a('0xa2'),_0x11c1ed[_0xeb9a('0x4e')],util[_0xeb9a('0x45')](_0x43a996,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0x25')]=function(_0x368695){try{if(this['isNotNull'](_0x368695)){logger[_0xeb9a('0x4b')](_0xeb9a('0xa3'),_0x368695['uniqueid'],util['inspect'](_0x368695,{'showHidden':![],'depth':null}));this[_0xeb9a('0xa4')](_0x368695['uniqueid'],_[_0xeb9a('0x7f')](_0x368695['variable'])[0x0],_0x368695['value']);if(this['queueReports'][_0x368695[_0xeb9a('0x4e')]]){var _0x2888df=_['last'](this['queueReports'][_0x368695[_0xeb9a('0x4e')]]);if(_0x2888df){if(this['isNotNull'](_0x368695['variable'])&&this[_0xeb9a('0x5e')](_0x368695[_0xeb9a('0xa5')][_0xeb9a('0x65')])){switch(_0x368695[_0xeb9a('0xa6')]){case _0xeb9a('0xa7'):_0x2888df[_0xeb9a('0x93')]=![];_0x2888df[_0xeb9a('0x94')]=null;break;case _0xeb9a('0xa8'):_0x2888df[_0xeb9a('0xa9')]='timeout';_0x2888df[_0xeb9a('0x93')]=!![];_0x2888df['queuecallerexitAt']=moment()['format'](_0xeb9a('0x78'));_0x2888df[_0xeb9a('0x8a')]=moment()['format'](_0xeb9a('0x78'));logger[_0xeb9a('0x4b')](_0xeb9a('0xaa'),_0x368695['uniqueid'],util[_0xeb9a('0x45')](_0x2888df,{'showHidden':![],'depth':null}));ami[_0xeb9a('0x49')]('custom:timeout',_0x2888df);break;default:_0x2888df[_0xeb9a('0x93')]=!![];_0x2888df['queuecallerexitAt']=moment()[_0xeb9a('0x54')](_0xeb9a('0x78'));_0x2888df[_0xeb9a('0x8a')]=moment()[_0xeb9a('0x54')](_0xeb9a('0x78'));}_0x2888df[_0xeb9a('0x1e')]=![];_0x2888df[_0xeb9a('0x83')]=null;_0x2888df[_0xeb9a('0x8f')]=_0x368695[_0xeb9a('0xa6')];this[_0xeb9a('0xf')][_0x368695['uniqueid']]=_0x2888df;this[_0xeb9a('0x86')](_0x2888df,_0xeb9a('0x24'));}else if(this[_0xeb9a('0x5e')](_0x368695[_0xeb9a('0xa5')])&&this[_0xeb9a('0x5e')](_0x368695[_0xeb9a('0xa5')][_0xeb9a('0xab')])){if(!_0x2888df[_0xeb9a('0x1e')]){_0x2888df[_0xeb9a('0x93')]=!![];_0x2888df[_0xeb9a('0x94')]=moment()['format'](_0xeb9a('0x78'));_0x2888df[_0xeb9a('0x8f')]=_0xeb9a('0xac');_0x2888df[_0xeb9a('0x8a')]=moment()[_0xeb9a('0x54')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xeb9a('0xf')][_0x368695['uniqueid']]=_0x2888df;}}logger[_0xeb9a('0x73')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x368695[_0xeb9a('0x4e')],_0x2888df[_0xeb9a('0x4f')],_0x2888df[_0xeb9a('0x59')],_[_0xeb9a('0x7f')](_0x368695[_0xeb9a('0xa5')])[0x0],_0x368695[_0xeb9a('0xa6')]);_0x2888df[_0xeb9a('0x14')]=this[_0xeb9a('0x14')][_0x368695[_0xeb9a('0x4e')]];}}}}catch(_0x545236){logger['error'](_0xeb9a('0xa3'),_0x368695['uniqueid'],util[_0xeb9a('0x45')](_0x545236,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb9a('0xa4')]=function(_0x285f7d,_0x26f496,_0x180ae4){var _0x10abb9=[_0xeb9a('0xad'),_0xeb9a('0xae'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xeb9a('0xaf'),'rtpaudioqoslossbridged',_0xeb9a('0xb0'),_0xeb9a('0xb1'),'sipcallid','sipuri',_0xeb9a('0xb2'),_0xeb9a('0xb3'),'membercalls',_0xeb9a('0xb4'),_0xeb9a('0xb5'),'memberlastcall',_0xeb9a('0xb6'),_0xeb9a('0xb7'),'memberrealtime'];if(!_[_0xeb9a('0x3b')](_0x26f496)&&!_[_0xeb9a('0xb8')](_0x10abb9,_0x26f496)){if(_[_0xeb9a('0x5f')](this[_0xeb9a('0x14')][_0x285f7d])){this[_0xeb9a('0x14')][_0x285f7d]={};}this[_0xeb9a('0x14')][_0x285f7d][_0x26f496]=_0x180ae4;}};VoiceQueueReport[_0xeb9a('0x37')][_0xeb9a('0xb9')]=function(_0x26cd26,_0x5992b7,_0x1c9e60){var _0x2fa51b={};for(var _0x9d6ac6=0x0;_0x9d6ac60x0?!![]:![];if(!_0x1a05e0){return this['syncQueueSummaryComplete'](this[_0x7a00('0x15')][_0x7a00('0x6e')]);}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x1c')]=function(_0x100e45){var _0x476620=this['summary']['id'];if(this[_0x7a00('0x15')][_0x7a00('0x63')][_0x476620]&&this['summary'][_0x7a00('0x63')][_0x476620][_0x100e45[_0x7a00('0x61')]]){this[_0x7a00('0x15')][_0x7a00('0x63')][_0x476620][_0x100e45[_0x7a00('0x61')]][_0x7a00('0x43')]['push'](_0x100e45);}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x17')]=function(_0x2be616){var _0x5dcc98=this;try{if(this[_0x7a00('0x5b')](_0x2be616)&&this['isNotNull'](_0x2be616[_0x7a00('0x4a')])){logger[_0x7a00('0x4e')](_0x7a00('0x6f'),util['inspect'](_0x2be616,{'showHidden':![],'depth':null}));var _0x55cf7f=this[_0x7a00('0x13')][_0x2be616[_0x7a00('0x4a')]];if(_0x55cf7f){logger[_0x7a00('0x70')](_0x7a00('0x71'),_0x55cf7f[_0x7a00('0x59')]);this['summary'][_0x7a00('0x5d')][_0x55cf7f[_0x7a00('0x59')]]={'summaryEvent':_0x2be616};this[_0x7a00('0x15')][_0x7a00('0x6d')]+=0x1;return ami[_0x7a00('0x37')]({'action':_0x7a00('0x63'),'queue':_0x55cf7f[_0x7a00('0x59')]})['then'](function(_0x44d248){if(!_0x5dcc98[_0x7a00('0x15')][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]]){_0x5dcc98['summary'][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]]={};}_0x5dcc98['summary'][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]][_0x44d248[_0x7a00('0x61')]]={'queue':_0x55cf7f[_0x7a00('0x59')],'agents':[]};})['catch'](function(_0x382a15){throw _0x382a15;});}}}catch(_0xff8083){logger[_0x7a00('0x3d')](_0x7a00('0x64'),util[_0x7a00('0x40')](_0xff8083,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x1a')]=function(_0x1dd6a8){if(this[_0x7a00('0x15')][_0x7a00('0x6d')]>0x0){this[_0x7a00('0x15')]['completeEvent']=_0x1dd6a8;return;}logger[_0x7a00('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x7a00('0x40')](_0x1dd6a8,{'showHidden':![],'depth':null}));this[_0x7a00('0x15')]=initializeSummary();ami[_0x7a00('0x45')](_0x7a00('0x72'),{});};VoiceQueueReport['prototype'][_0x7a00('0x1e')]=function(_0x1f5c13){try{if(this[_0x7a00('0x5b')](_0x1f5c13)){logger['debug'](_0x7a00('0x73'),_0x1f5c13[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x1f5c13,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]])){this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]]=[];}if(_[_0x7a00('0x74')](this[_0x7a00('0x11')][_0x1f5c13[_0x7a00('0x49')]])){this[_0x7a00('0x11')][_0x1f5c13['uniqueid']]={};}var _0x5c4dc5=new QueueReport();_0x5c4dc5[_0x7a00('0x4a')]=_0x1f5c13[_0x7a00('0x4a')];_0x5c4dc5['type']=this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]]&&this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]][_0x7a00('0x57')]?this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]][_0x7a00('0x57')]||'inbound':_0x7a00('0x58');_0x5c4dc5[_0x7a00('0x75')]=moment()['format'](_0x7a00('0x76'));_0x5c4dc5[_0x7a00('0x77')]=_0x1f5c13['position'];_0x5c4dc5[_0x7a00('0x78')]=_0x1f5c13[_0x7a00('0x78')];_0x5c4dc5[_0x7a00('0x49')]=_0x1f5c13[_0x7a00('0x49')];_0x5c4dc5['routealias']=this['channels'][_0x1f5c13[_0x7a00('0x49')]][_0x7a00('0x79')];logger[_0x7a00('0x70')](_0x7a00('0x7a'),_0x5c4dc5['queue'],_0x5c4dc5['type']);_[_0x7a00('0x7b')](_0x5c4dc5,_[_0x7a00('0x7c')](_0x1f5c13,_['keys'](_0x5c4dc5)));this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]]['push'](_0x5c4dc5);this['channels'][_0x1f5c13['uniqueid']]=_0x5c4dc5;this[_0x7a00('0x46')](_0x5c4dc5,_0x7a00('0x7d'));}}catch(_0x56b2bb){logger[_0x7a00('0x3d')](_0x7a00('0x73'),_0x1f5c13['uniqueid'],util[_0x7a00('0x40')](_0x56b2bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x7e')]=function(_0xbd895e){try{if(this['isNotNull'](_0xbd895e)){logger[_0x7a00('0x4e')](_0x7a00('0x7f'),_0xbd895e[_0x7a00('0x49')],util[_0x7a00('0x40')](_0xbd895e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xbd895e['uniqueid']]){var _0x4e4a44=_[_0x7a00('0x80')](this['queueReports'][_0xbd895e[_0x7a00('0x49')]]);_0x4e4a44[_0x7a00('0x81')]=![];_0x4e4a44[_0x7a00('0x82')]=null;_0x4e4a44[_0x7a00('0x83')]=_0xbd895e[_0x7a00('0x83')];_0x4e4a44[_0x7a00('0x84')]=_0xbd895e['originalposition'];_0x4e4a44['queuecallerabandon']=!![];_0x4e4a44[_0x7a00('0x85')]=moment()[_0x7a00('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e4a44[_0x7a00('0x50')]=_0x7a00('0x86');_0x4e4a44[_0x7a00('0x87')]=null;logger[_0x7a00('0x70')](_0x7a00('0x88'),_0x4e4a44[_0x7a00('0x4a')],_0x4e4a44[_0x7a00('0x57')]);this[_0x7a00('0x11')][_0xbd895e[_0x7a00('0x49')]]=_0x4e4a44;this[_0x7a00('0x4d')](_0x4e4a44,_0x7a00('0x1f'));}}}catch(_0x5c1c4c){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0xbd895e['uniqueid'],util['inspect'](_0x5c1c4c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5f54b0){try{if(this[_0x7a00('0x5b')](_0x5f54b0)){logger[_0x7a00('0x4e')](_0x7a00('0x89'),_0x5f54b0[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x5f54b0,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x5f54b0[_0x7a00('0x49')]]){var _0x16e427=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x5f54b0[_0x7a00('0x49')]]);_0x16e427[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x16e427[_0x7a00('0x8b')]=_0x5f54b0[_0x7a00('0x8b')];_0x16e427['connectedlinename']=_0x5f54b0['connectedlinename'];logger[_0x7a00('0x70')](_0x7a00('0x8c'),_0x16e427[_0x7a00('0x4a')],_0x16e427[_0x7a00('0x57')],_0x5f54b0['connectedlinenum'],_0x5f54b0[_0x7a00('0x8d')]);this[_0x7a00('0x11')][_0x5f54b0['uniqueid']]=_0x16e427;this[_0x7a00('0x46')](_0x16e427,'queuecallerleave');}}}catch(_0x34f234){logger['error'](_0x7a00('0x89'),_0x5f54b0['uniqueid'],util['inspect'](_0x34f234,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x24')]=function(_0x30b380){try{if(this[_0x7a00('0x5b')](_0x30b380)){logger[_0x7a00('0x4e')](_0x7a00('0x8e'),_0x30b380[_0x7a00('0x49')],util['inspect'](_0x30b380,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x30b380[_0x7a00('0x49')]]){var _0x5a9d61=_[_0x7a00('0x80')](this['queueReports'][_0x30b380[_0x7a00('0x49')]]);_0x5a9d61['queuecallercomplete']=!![];_0x5a9d61[_0x7a00('0x50')]=_0x7a00('0x8f');logger['info'](_0x7a00('0x90'),_0x5a9d61[_0x7a00('0x4a')],_0x5a9d61[_0x7a00('0x57')]);}}}catch(_0x4ba577){logger['error'](_0x7a00('0x8e'),_0x30b380['uniqueid'],util[_0x7a00('0x40')](_0x4ba577,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x91')]=function(_0x26d953){try{if(this['isNotNull'](_0x26d953)){logger[_0x7a00('0x4e')](_0x7a00('0x92'),_0x26d953[_0x7a00('0x49')],util['inspect'](_0x26d953,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x49')]]){var _0x21ba18=_['last'](this['queueReports'][_0x26d953[_0x7a00('0x49')]]);_0x21ba18['queuecallerabandon']=![];_0x21ba18[_0x7a00('0x85')]=null;_0x21ba18[_0x7a00('0x93')]=!![];_0x21ba18[_0x7a00('0x87')]=_0x26d953['membername'];_0x21ba18[_0x7a00('0x83')]=_0x26d953['holdtime'];_0x21ba18[_0x7a00('0x81')]=!![];_0x21ba18[_0x7a00('0x94')]=![];_0x21ba18[_0x7a00('0x95')]=null;if(!_0x21ba18[_0x7a00('0x96')]){if(_0x26d953['reason']==_0x7a00('0x96')){_0x21ba18[_0x7a00('0x50')]=_0x7a00('0x97');logger[_0x7a00('0x70')](_0x7a00('0x98'),_0x21ba18[_0x7a00('0x4a')],_0x21ba18[_0x7a00('0x57')]);}else{if(_[_0x7a00('0x99')](_0x26d953[_0x7a00('0x39')][_0x7a00('0x9a')](),_0x7a00('0x9b'))){if(this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x9c')]]){var _0xb74566=_['last'](this['queueReports'][_0x26d953[_0x7a00('0x9c')]]);_0xb74566[_0x7a00('0x81')]=![];_0xb74566[_0x7a00('0x94')]=!![];_0xb74566[_0x7a00('0x95')]=moment(_0x21ba18[_0x7a00('0x75')])['add'](_0x26d953[_0x7a00('0x83')],_0x7a00('0x9d'))['format'](_0x7a00('0x76'));_0xb74566[_0x7a00('0x50')]=_0x7a00('0x9e');_0xb74566[_0x7a00('0x96')]=!![];_0xb74566['transfertype']=_0x7a00('0x9f');_0xb74566[_0x7a00('0xa0')]=_0x26d953[_0x7a00('0xa1')];_0xb74566['transferuniqueid']=_0x26d953['uniqueid'];logger[_0x7a00('0x70')](_0x7a00('0xa2'),_0xb74566[_0x7a00('0x4a')],_0xb74566[_0x7a00('0x57')]);var _0x59d373=this['queueReports'][_0x26d953['linkedid']];this['queueReports'][_0x26d953['linkedid']]=this['queueReports'][_0x26d953[_0x7a00('0x49')]];this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x49')]]=_0x59d373;}}else{_0x21ba18[_0x7a00('0x50')]=_0x7a00('0xa3')+_0x26d953[_0x7a00('0xa4')][_0x7a00('0xa5')]();logger[_0x7a00('0x70')](_0x7a00('0xa6'),_0x21ba18[_0x7a00('0x4a')],_0x21ba18[_0x7a00('0x57')],_0x21ba18[_0x7a00('0x50')]);}}}this[_0x7a00('0x11')][_0x26d953[_0x7a00('0x49')]]=_0x21ba18;this['emitVoiceQueueChannelRemove'](_0x21ba18,_0x7a00('0x22'));}}}catch(_0x166eff){logger[_0x7a00('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x26d953[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x166eff,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0xa7')]=function(_0x168351){try{if(this[_0x7a00('0x5b')](_0x168351)){logger[_0x7a00('0x4e')](_0x7a00('0xa8'),_0x168351[_0x7a00('0x49')],util['inspect'](_0x168351,{'showHidden':![],'depth':null}));this[_0x7a00('0xa9')](_0x168351[_0x7a00('0x49')],_[_0x7a00('0xaa')](_0x168351['variable'])[0x0],_0x168351[_0x7a00('0xab')]);if(this[_0x7a00('0x10')][_0x168351['uniqueid']]){var _0x3c9276=_['last'](this['queueReports'][_0x168351[_0x7a00('0x49')]]);if(_0x3c9276){if(this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')])&&this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')][_0x7a00('0x63')])){switch(_0x168351[_0x7a00('0xab')]){case _0x7a00('0xad'):_0x3c9276['queuecallerexit']=![];_0x3c9276[_0x7a00('0x95')]=null;break;case _0x7a00('0xae'):_0x3c9276['lastevent']='timeout';_0x3c9276[_0x7a00('0x94')]=!![];_0x3c9276[_0x7a00('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3c9276['queuecallerleaveAt']=moment()[_0x7a00('0x52')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7a00('0x4e')](_0x7a00('0xaf'),_0x168351[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x3c9276,{'showHidden':![],'depth':null}));ami[_0x7a00('0x45')](_0x7a00('0xb0'),_0x3c9276);break;default:_0x3c9276['queuecallerexit']=!![];_0x3c9276[_0x7a00('0x95')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x3c9276[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));}_0x3c9276['queuecallerabandon']=![];_0x3c9276[_0x7a00('0x85')]=null;_0x3c9276[_0x7a00('0x50')]=_0x168351[_0x7a00('0xab')];this['channels'][_0x168351['uniqueid']]=_0x3c9276;this[_0x7a00('0x4d')](_0x3c9276,_0x7a00('0xb1'));}else if(this[_0x7a00('0x5b')](_0x168351['variable'])&&this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')][_0x7a00('0xb2')])){if(!_0x3c9276[_0x7a00('0x1f')]){_0x3c9276[_0x7a00('0x94')]=!![];_0x3c9276[_0x7a00('0x95')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x3c9276[_0x7a00('0x50')]=_0x7a00('0xb3');_0x3c9276[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));this[_0x7a00('0x11')][_0x168351[_0x7a00('0x49')]]=_0x3c9276;}}logger['info'](_0x7a00('0xb4'),_0x168351[_0x7a00('0x49')],_0x3c9276['queue'],_0x3c9276[_0x7a00('0x57')],_[_0x7a00('0xaa')](_0x168351[_0x7a00('0xac')])[0x0],_0x168351['value']);_0x3c9276[_0x7a00('0x3e')]=this[_0x7a00('0x3e')][_0x168351['uniqueid']];}}}}catch(_0x31ae83){logger['error'](_0x7a00('0xa8'),_0x168351[_0x7a00('0x49')],util['inspect'](_0x31ae83,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x259249,_0x4c8ce8,_0x40e01a){var _0x3b0d74=['rtpaudioqos',_0x7a00('0xb5'),_0x7a00('0xb6'),'rtpaudioqosjitterbridged',_0x7a00('0xb7'),_0x7a00('0xb8'),_0x7a00('0xb9'),_0x7a00('0xba'),_0x7a00('0xbb'),'sipuri','bridgepeer','bridgepvtcallid',_0x7a00('0xbc'),_0x7a00('0xbd'),'memberinterface',_0x7a00('0xbe'),_0x7a00('0xbf'),'memberpenalty',_0x7a00('0xc0')];if(!_[_0x7a00('0x36')](_0x4c8ce8)&&!_[_0x7a00('0xc1')](_0x3b0d74,_0x4c8ce8)){if(_['isUndefined'](this['variables'][_0x259249])){this[_0x7a00('0x3e')][_0x259249]={};}this[_0x7a00('0x3e')][_0x259249][_0x4c8ce8]=_0x40e01a;}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0xc2')]=function(_0x514e82,_0xd43160,_0x7ae4c8){var _0x37c2d5={};for(var _0x314d48=0x0;_0x314d48=0x0?moment(_0x45f23a[_0x8360('0x18')])[_0x8360('0xd')](_0x45f23a[_0x8360('0x17')],_0x8360('0xe')):null,'data1':'outbound','data2':_0x45f23a[_0x8360('0x12')],'data3':_0x45f23a[_0x8360('0x11')],'data4':_0x45f23a[_0x8360('0x19')]||null,'role':_0x8360('0x1a'),'internal':_0x45f23a[_0x8360('0x12')]?_[_0x8360('0x1b')](_0x45f23a[_0x8360('0x12')]):undefined,'uniqueid':_0x45f23a[_0x8360('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x8547=['queue','agent','accountcode','toNumber','voiceDialReport','Request','membername','endtime','starttime','dialstring','uniqueid','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8547,0xa1));var _0x7854=function(_0x20e51f,_0x140609){_0x20e51f=_0x20e51f-0x0;var _0x1b22b1=_0x8547[_0x20e51f];return _0x1b22b1;};'use strict';var moment=require(_0x7854('0x0'));var _=require(_0x7854('0x1'));var util=require(_0x7854('0x2'));var client=require('../client');exports[_0x7854('0x3')]=function(_0x131f29){var _0xd7d8a9=_0x131f29[_0x7854('0x4')]||_0x131f29[_0x7854('0x5')];return client['Request'](_0x7854('0x6'),{'body':{'channel':_0x7854('0x7'),'membername':_0x131f29[_0x7854('0x8')],'interface':_[_0x7854('0x9')](_0x131f29[_0x7854('0xa')])?util[_0x7854('0xb')](_0x7854('0xc'),_0x131f29[_0x7854('0x8')]):_0x131f29[_0x7854('0xa')],'type':_0x7854('0xd'),'enterAt':_0x131f29[_0x7854('0xe')],'exitAt':_0xd7d8a9,'duration':moment(_0xd7d8a9)[_0x7854('0xf')](_0x131f29['queuecallerleaveAt'],_0x7854('0x10')),'data1':_0x7854('0x11'),'data2':_0x131f29['calleridnum'],'data3':_0x131f29[_0x7854('0x12')],'data4':null,'data5':_0x131f29[_0x7854('0x13')],'role':_0x7854('0x14'),'internal':_0x131f29[_0x7854('0x15')]?_[_0x7854('0x16')](_0x131f29[_0x7854('0x15')]):undefined,'uniqueid':_0x131f29['uniqueid']},'log':_0x7854('0x6')});};exports[_0x7854('0x17')]=function(_0x3cb816){return client[_0x7854('0x18')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3cb816[_0x7854('0x19')],'interface':_0x3cb816[_0x7854('0xa')],'type':_0x7854('0xd'),'enterAt':_0x3cb816['starttime'],'exitAt':_0x3cb816['endtime'],'duration':moment(_0x3cb816[_0x7854('0x1a')])[_0x7854('0xf')](_0x3cb816[_0x7854('0x1b')],_0x7854('0x10'))>=0x0?moment(_0x3cb816[_0x7854('0x1a')])[_0x7854('0xf')](_0x3cb816[_0x7854('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x3cb816['accountcode'],'data3':_0x3cb816[_0x7854('0x12')],'data4':_0x3cb816[_0x7854('0x1c')]||null,'role':'agent','internal':_0x3cb816[_0x7854('0x15')]?_[_0x7854('0x16')](_0x3cb816['accountcode']):undefined,'uniqueid':_0x3cb816[_0x7854('0x1d')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 0bd5c3b..04c0f5c 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcce8=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x74f906,_0x16ba8c){var _0x10531a=function(_0x3b3535){while(--_0x3b3535){_0x74f906['push'](_0x74f906['shift']());}};_0x10531a(++_0x16ba8c);}(_0xcce8,0x1a5));var _0x8cce=function(_0xc050c3,_0x12a439){_0xc050c3=_0xc050c3-0x0;var _0x55e0d5=_0xcce8[_0xc050c3];return _0x55e0d5;};'use strict';var client=require(_0x8cce('0x0'));exports[_0x8cce('0x1')]=function(){return client[_0x8cce('0x2')](_0x8cce('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8cce('0x4'),_0x8cce('0x5')]},'log':_0x8cce('0x6')});}; \ No newline at end of file +var _0x1ab1=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1ab1,0x83));var _0x11ab=function(_0x11cff4,_0x1c1ef4){_0x11cff4=_0x11cff4-0x0;var _0x537a12=_0x1ab1[_0x11cff4];return _0x537a12;};'use strict';var client=require('../client');exports[_0x11ab('0x0')]=function(){return client[_0x11ab('0x1')](_0x11ab('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x11ab('0x3'),_0x11ab('0x4')]},'log':_0x11ab('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index bb66da5..de0be08 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 _0x7215=['GetTemplate','html','../client','getTemplates','Request'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0x7215,0x138));var _0x5721=function(_0x250602,_0x2ff70e){_0x250602=_0x250602-0x0;var _0x52aa48=_0x7215[_0x250602];return _0x52aa48;};'use strict';var client=require(_0x5721('0x0'));exports[_0x5721('0x1')]=function(_0x58d68a){return function(_0x4e245e){return client[_0x5721('0x2')](_0x5721('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x5721('0x4')]},'log':_0x5721('0x3')});};}; \ No newline at end of file +var _0xeec6=['name','../client','Request','GetTemplate'];(function(_0x19ee96,_0x48b7d5){var _0x57aaf0=function(_0x26f332){while(--_0x26f332){_0x19ee96['push'](_0x19ee96['shift']());}};_0x57aaf0(++_0x48b7d5);}(_0xeec6,0x125));var _0x6eec=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0xeec6[_0x387603];return _0x55ea9e;};'use strict';var client=require(_0x6eec('0x0'));exports['getTemplates']=function(_0x50fed5){return function(_0xf95fb8){return client[_0x6eec('0x1')](_0x6eec('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6eec('0x3'),'html']},'log':_0x6eec('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index c15f101..64c337c 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 _0xba73=['AnyConditions','operator','Action','Actions','data1','data2','data3','data4','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','value'];(function(_0x29ac4f,_0x56f797){var _0xbf1f6c=function(_0x431aca){while(--_0x431aca){_0x29ac4f['push'](_0x29ac4f['shift']());}};_0xbf1f6c(++_0x56f797);}(_0xba73,0x131));var _0x3ba7=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xba73[_0x346737];return _0x1ade2e;};'use strict';var client=require('../client');exports[_0x3ba7('0x0')]=function(_0x1c5841){return function(_0x571708){return client[_0x3ba7('0x1')](_0x3ba7('0x2'),{'options':{'raw':![],'attributes':['id',_0x3ba7('0x3'),_0x3ba7('0x4'),_0x3ba7('0x5')],'include':[{'model':_0x3ba7('0x6'),'as':_0x3ba7('0x7'),'attributes':['id',_0x3ba7('0x8'),'operator',_0x3ba7('0x9')]},{'model':_0x3ba7('0x6'),'as':_0x3ba7('0xa'),'attributes':['id',_0x3ba7('0x8'),_0x3ba7('0xb'),_0x3ba7('0x9')]},{'model':_0x3ba7('0xc'),'as':_0x3ba7('0xd'),'attributes':['id','action',_0x3ba7('0xe'),_0x3ba7('0xf'),_0x3ba7('0x10'),_0x3ba7('0x11'),_0x3ba7('0x12'),_0x3ba7('0x13'),_0x3ba7('0x14')]}]},'log':_0x3ba7('0x2')});};}; \ No newline at end of file +var _0xb244=['value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data6','GetTrigger','getTriggers','name','channel','status','Condition','AllConditions','field','operator'];(function(_0x1d4cde,_0x20916a){var _0x3061ea=function(_0x103f6d){while(--_0x103f6d){_0x1d4cde['push'](_0x1d4cde['shift']());}};_0x3061ea(++_0x20916a);}(_0xb244,0x1d3));var _0x4b24=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb244[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0x4b24('0x0')]=function(_0x1fdb35){return function(_0x33a364){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x4b24('0x1'),_0x4b24('0x2'),_0x4b24('0x3')],'include':[{'model':_0x4b24('0x4'),'as':_0x4b24('0x5'),'attributes':['id',_0x4b24('0x6'),_0x4b24('0x7'),_0x4b24('0x8')]},{'model':_0x4b24('0x4'),'as':_0x4b24('0x9'),'attributes':['id',_0x4b24('0x6'),_0x4b24('0x7'),'value']},{'model':_0x4b24('0xa'),'as':_0x4b24('0xb'),'attributes':['id',_0x4b24('0xc'),_0x4b24('0xd'),_0x4b24('0xe'),_0x4b24('0xf'),_0x4b24('0x10'),'data5',_0x4b24('0x11'),'data7']}]},'log':_0x4b24('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 1f5abe6..73d96c4 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 _0xa8eb=['name','defaultuser','../client','Request','GetTrunk'];(function(_0x276167,_0x21086e){var _0x27a866=function(_0xa47f17){while(--_0xa47f17){_0x276167['push'](_0x276167['shift']());}};_0x27a866(++_0x21086e);}(_0xa8eb,0x179));var _0xba8e=function(_0x5ed8f8,_0x245c75){_0x5ed8f8=_0x5ed8f8-0x0;var _0x1eddd2=_0xa8eb[_0x5ed8f8];return _0x1eddd2;};'use strict';var client=require(_0xba8e('0x0'));exports['getTrunks']=function(_0x26595f){return function(_0x5757ad){return client[_0xba8e('0x1')](_0xba8e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xba8e('0x3'),'registry',_0xba8e('0x4')]},'log':_0xba8e('0x2')});};}; \ No newline at end of file +var _0x48fb=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0xbdf091,_0x35a06c){var _0x129fd5=function(_0x529abd){while(--_0x529abd){_0xbdf091['push'](_0xbdf091['shift']());}};_0x129fd5(++_0x35a06c);}(_0x48fb,0xad));var _0xb48f=function(_0x94960e,_0xa3c367){_0x94960e=_0x94960e-0x0;var _0x300058=_0x48fb[_0x94960e];return _0x300058;};'use strict';var client=require(_0xb48f('0x0'));exports[_0xb48f('0x1')]=function(_0xade7ad){return function(_0x328618){return client[_0xb48f('0x2')](_0xb48f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb48f('0x4'),_0xb48f('0x5'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 587eee7..6dad4b8 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe706,0xa3));var _0x6e70=function(_0x599318,_0x319486){_0x599318=_0x599318-0x0;var _0x7b06fa=_0xe706[_0x599318];return _0x7b06fa;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index fbc3ef3..8d188ce 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 _0xfc37=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x47571a,_0x4e4352){var _0x1dd34d=function(_0x48ecd0){while(--_0x48ecd0){_0x47571a['push'](_0x47571a['shift']());}};_0x1dd34d(++_0x4e4352);}(_0xfc37,0x165));var _0x7fc3=function(_0x495d52,_0x568f11){_0x495d52=_0x495d52-0x0;var _0x589830=_0xfc37[_0x495d52];return _0x589830;};'use strict';var client=require(_0x7fc3('0x0'));exports[_0x7fc3('0x1')]=function(_0x31fe5f){return client[_0x7fc3('0x2')](_0x7fc3('0x3'),{'body':_0x31fe5f,'log':_0x7fc3('0x3')});};exports[_0x7fc3('0x4')]=function(_0x40cda8,_0x2f7e5f,_0xc63989){return client[_0x7fc3('0x2')](_0x7fc3('0x5'),{'body':_0x40cda8,'options':{'where':{'uniqueid':_0x2f7e5f,'interface':_0xc63989,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xe01b=['update','Request','UpdateVoiceAgentReport','../client','CreateVoiceAgentReport'];(function(_0xa099e9,_0x1c9201){var _0x493711=function(_0x1c5bba){while(--_0x1c5bba){_0xa099e9['push'](_0xa099e9['shift']());}};_0x493711(++_0x1c9201);}(_0xe01b,0xf8));var _0xbe01=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xe01b[_0x456fb1];return _0x4083d6;};'use strict';var client=require(_0xbe01('0x0'));exports['create']=function(_0x198e42){return client['Request'](_0xbe01('0x1'),{'body':_0x198e42,'log':_0xbe01('0x1')});};exports[_0xbe01('0x2')]=function(_0x170cfc,_0x253356,_0x5c7018){return client[_0xbe01('0x3')](_0xbe01('0x4'),{'body':_0x170cfc,'options':{'where':{'uniqueid':_0x253356,'interface':_0x5c7018,'agentcomplete':!![]}},'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 2ae03e6..1bd5045 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 _0x1388=['endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x1388,0xb1));var _0x8138=function(_0x4cfd4a,_0x340a41){_0x4cfd4a=_0x4cfd4a-0x0;var _0x42a03c=_0x1388[_0x4cfd4a];return _0x42a03c;};'use strict';var moment=require(_0x8138('0x0'));var util=require(_0x8138('0x1'));var _=require('lodash');var client=require('../client');exports[_0x8138('0x2')]=function(_0x437ccf){return client[_0x8138('0x3')](_0x8138('0x4'),{'body':_[_0x8138('0x5')](_0x437ccf,{'source':_0x437ccf[_0x8138('0x6')],'destinationcontext':_0x437ccf[_0x8138('0x7')],'callerid':_0x437ccf['callerid'],'amaflags':_0x8138('0x8')}),'log':_0x8138('0x4')});};exports[_0x8138('0x9')]=function(){return function(){return client[_0x8138('0x3')](_0x8138('0xa'),{'options':{'where':{'type':[_0x8138('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8138('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x8138('0xd')](_0x8138('0xc'))[_0x8138('0xe')](_0x8138('0xf'))]}},'attributes':[_0x8138('0x10'),'disposition',_0x8138('0x11'),_0x8138('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x8dcd=['GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','../client','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0xc517fb,_0x5690fd){var _0x5b057f=function(_0x8c706f){while(--_0x8c706f){_0xc517fb['push'](_0xc517fb['shift']());}};_0x5b057f(++_0x5690fd);}(_0x8dcd,0x1e5));var _0xd8dc=function(_0x5e713f,_0x5e62e4){_0x5e713f=_0x5e713f-0x0;var _0x4d5637=_0x8dcd[_0x5e713f];return _0x4d5637;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0xd8dc('0x0'));exports[_0xd8dc('0x1')]=function(_0x156bde){return client[_0xd8dc('0x2')](_0xd8dc('0x3'),{'body':_['merge'](_0x156bde,{'source':_0x156bde['calleridnum'],'destinationcontext':_0x156bde[_0xd8dc('0x4')],'callerid':_0x156bde[_0xd8dc('0x5')],'amaflags':_0xd8dc('0x6')}),'log':_0xd8dc('0x3')});};exports[_0xd8dc('0x7')]=function(){return function(){return client['Request'](_0xd8dc('0x8'),{'options':{'where':{'type':[_0xd8dc('0x9')],'createdAt':{'$between':[moment()[_0xd8dc('0xa')](_0xd8dc('0xb'))['format'](_0xd8dc('0xc')),moment()[_0xd8dc('0xd')](_0xd8dc('0xb'))['format'](_0xd8dc('0xc'))]}},'attributes':[_0xd8dc('0xe'),'disposition',_0xd8dc('0xf'),'billableseconds']},'log':_0xd8dc('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2e33f30..93d5a18 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 _0xe91b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe91b,0xc6));var _0xbe91=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0xe91b[_0xa1e3ca];return _0x5005ab;};'use strict';var client=require(_0xbe91('0x0'));exports[_0xbe91('0x1')]=function(_0x381f9f){return client[_0xbe91('0x2')]('CreateVoiceDialReport',{'body':_0x381f9f,'log':_0xbe91('0x3')});}; \ No newline at end of file +var _0xa44b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xa44b,0x151));var _0xba44=function(_0x527a6c,_0x15b18d){_0x527a6c=_0x527a6c-0x0;var _0x4c780d=_0xa44b[_0x527a6c];return _0x4c780d;};'use strict';var client=require(_0xba44('0x0'));exports[_0xba44('0x1')]=function(_0x3178f3){return client[_0xba44('0x2')](_0xba44('0x3'),{'body':_0x3178f3,'log':_0xba44('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5018635..312e779 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 _0x9c2c=['recordingFormat','../client','getVoiceExtensions'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc9c2('0x0'));exports[_0xc9c2('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xc9c2('0x2')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xe812=['getVoiceExtensions','Request','recordingFormat'];(function(_0x42c14a,_0x233473){var _0x1f0ca3=function(_0x5bd548){while(--_0x5bd548){_0x42c14a['push'](_0x42c14a['shift']());}};_0x1f0ca3(++_0x233473);}(_0xe812,0x1f2));var _0x2e81=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe812[_0x397e5f];return _0x5302b8;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(){return function(){return client[_0x2e81('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x2e81('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x2e81('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4be7273..ae6118f 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 _0xa321=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject'];(function(_0x1214f8,_0x18b942){var _0x3db3f8=function(_0x5284a7){while(--_0x5284a7){_0x1214f8['push'](_0x1214f8['shift']());}};_0x3db3f8(++_0x18b942);}(_0xa321,0x101));var _0x1a32=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xa321[_0x487b0c];return _0x1adbdc;};'use strict';var client=require(_0x1a32('0x0'));exports[_0x1a32('0x1')]=function(){return function(){return client[_0x1a32('0x2')](_0x1a32('0x3'),{'options':{'raw':![],'attributes':['id',_0x1a32('0x4'),_0x1a32('0x5'),_0x1a32('0x6'),_0x1a32('0x7'),_0x1a32('0x8'),_0x1a32('0x9'),'dialActive',_0x1a32('0xa'),_0x1a32('0xb'),_0x1a32('0xc'),_0x1a32('0xd'),_0x1a32('0xe'),_0x1a32('0xf'),_0x1a32('0x10'),_0x1a32('0x11'),_0x1a32('0x12'),_0x1a32('0x13'),_0x1a32('0x14'),_0x1a32('0x15'),_0x1a32('0x16'),_0x1a32('0x17'),_0x1a32('0x18'),_0x1a32('0x19'),_0x1a32('0x1a'),_0x1a32('0x1b'),_0x1a32('0x1c'),_0x1a32('0x1d'),_0x1a32('0x1e'),_0x1a32('0x1f'),_0x1a32('0x20'),_0x1a32('0x21'),'dialAMDActive',_0x1a32('0x22'),_0x1a32('0x23'),'dialAMDAfterGreetingSilence',_0x1a32('0x24'),_0x1a32('0x25'),'dialAMDBetweenWordsSilence',_0x1a32('0x26'),_0x1a32('0x27'),_0x1a32('0x28'),_0x1a32('0x29'),_0x1a32('0x2a'),_0x1a32('0x2b'),'dialOrderByScheduledAt',_0x1a32('0x2c'),_0x1a32('0x2d'),_0x1a32('0x2e'),_0x1a32('0x8'),'strategy',_0x1a32('0x2f'),_0x1a32('0x30'),'dialNoSuchNumberMaxRetry',_0x1a32('0x31'),_0x1a32('0x32'),_0x1a32('0x33'),_0x1a32('0x34'),_0x1a32('0x35'),_0x1a32('0x36'),_0x1a32('0x37'),_0x1a32('0x38'),_0x1a32('0x39'),'mandatoryDisposition',_0x1a32('0x3a'),_0x1a32('0x3b'),_0x1a32('0x3c'),_0x1a32('0x3d')],'include':[{'model':_0x1a32('0x3e'),'as':_0x1a32('0x3e'),'attributes':['id',_0x1a32('0x4'),_0x1a32('0x3f'),'active']},{'model':_0x1a32('0x40'),'as':_0x1a32('0x41'),'attributes':['id',_0x1a32('0x4')]},{'model':'Trunk','as':_0x1a32('0x42'),'attributes':['id',_0x1a32('0x4'),_0x1a32('0x3f'),_0x1a32('0x43')]},{'model':_0x1a32('0x44'),'as':_0x1a32('0x44'),'attributes':['id',_0x1a32('0x4')],'include':[{'model':'Interval','as':_0x1a32('0x45'),'attributes':['id',_0x1a32('0x4'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x89d3=['dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x482611,_0x33356d){var _0x4aeb3a=function(_0x44feae){while(--_0x44feae){_0x482611['push'](_0x482611['shift']());}};_0x4aeb3a(++_0x33356d);}(_0x89d3,0xa5));var _0x389d=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x89d3[_0x21eb3c];return _0x4bd2aa;};'use strict';var client=require(_0x389d('0x0'));exports[_0x389d('0x1')]=function(){return function(){return client[_0x389d('0x2')](_0x389d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x389d('0x4'),_0x389d('0x5'),_0x389d('0x6'),'monitor_format',_0x389d('0x7'),_0x389d('0x8'),_0x389d('0x9'),_0x389d('0xa'),_0x389d('0xb'),_0x389d('0xc'),_0x389d('0xd'),_0x389d('0xe'),_0x389d('0xf'),'dialOriginateCallerIdName',_0x389d('0x10'),_0x389d('0x11'),'dialQueueOptions',_0x389d('0x12'),_0x389d('0x13'),_0x389d('0x14'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x389d('0x15'),_0x389d('0x16'),_0x389d('0x17'),_0x389d('0x18'),'dialTimezone',_0x389d('0x19'),_0x389d('0x1a'),_0x389d('0x1b'),_0x389d('0x1c'),_0x389d('0x1d'),_0x389d('0x1e'),_0x389d('0x1f'),'dialAMDTotalAnalysisTime',_0x389d('0x20'),_0x389d('0x21'),_0x389d('0x22'),_0x389d('0x23'),_0x389d('0x24'),_0x389d('0x25'),_0x389d('0x26'),'dialRecallInQueue',_0x389d('0x27'),_0x389d('0x28'),_0x389d('0x29'),_0x389d('0x2a'),_0x389d('0x2b'),_0x389d('0x2c'),_0x389d('0x2d'),_0x389d('0x2e'),_0x389d('0x2f'),_0x389d('0x30'),_0x389d('0x31'),_0x389d('0x32'),_0x389d('0x33'),_0x389d('0x34'),_0x389d('0x35'),_0x389d('0x36'),_0x389d('0x37'),'dialAgentRejectRetryFrequency',_0x389d('0x38'),_0x389d('0x39'),'dialPredictiveIntervalMinThreshold',_0x389d('0x3a'),_0x389d('0x3b')],'include':[{'model':_0x389d('0x3c'),'as':_0x389d('0x3c'),'attributes':['id',_0x389d('0x3d'),_0x389d('0x3e'),_0x389d('0x3f')]},{'model':_0x389d('0x40'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x389d('0x3c'),'as':_0x389d('0x41'),'attributes':['id',_0x389d('0x3d'),'callerid',_0x389d('0x3f')]},{'model':_0x389d('0x42'),'as':_0x389d('0x42'),'attributes':['id',_0x389d('0x3d')],'include':[{'model':_0x389d('0x42'),'as':_0x389d('0x43'),'attributes':['id','name',_0x389d('0x44')]}]}]},'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 a7ff22d..b3c81d5 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 _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x369c70,_0x5892f0){var _0xb7e463=function(_0x3822c8){while(--_0x3822c8){_0x369c70['push'](_0x369c70['shift']());}};_0xb7e463(++_0x5892f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4ad619,_0x49d73f){var _0x1ecf73=function(_0x599e15){while(--_0x599e15){_0x4ad619['push'](_0x4ad619['shift']());}};_0x1ecf73(++_0x49d73f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 8457c44..929b203 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 _0x658d=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x4c1ae7,_0x51a14a){var _0x70a7f9=function(_0x27b0b3){while(--_0x27b0b3){_0x4c1ae7['push'](_0x4c1ae7['shift']());}};_0x70a7f9(++_0x51a14a);}(_0x658d,0x128));var _0xd658=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x658d[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xd658('0x0'));exports[_0xd658('0x1')]=function(_0x3fc6c9){return function(){return client['Request'](_0xd658('0x2'),{'options':{'where':{'VoiceQueueId':_0x3fc6c9,'paused':!![]},'raw':!![]},'log':_0xd658('0x1')});};}; \ No newline at end of file +var _0x4fca=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x4fca,0x19f));var _0xa4fc=function(_0x3f03eb,_0xf7ff5b){_0x3f03eb=_0x3f03eb-0x0;var _0x330edc=_0x4fca[_0x3f03eb];return _0x330edc;};'use strict';var client=require(_0xa4fc('0x0'));exports[_0xa4fc('0x1')]=function(_0x302e48){return function(){return client[_0xa4fc('0x2')](_0xa4fc('0x3'),{'options':{'where':{'VoiceQueueId':_0x302e48,'paused':!![]},'raw':!![]},'log':_0xa4fc('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c028d33..85a0450 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x229907,_0x25dfc4){var _0x7df92d=function(_0x5947e3){while(--_0x5947e3){_0x229907['push'](_0x229907['shift']());}};_0x7df92d(++_0x25dfc4);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x20f4cd,_0x10f2be){var _0x254f40=function(_0x2b0b5c){while(--_0x2b0b5c){_0x20f4cd['push'](_0x20f4cd['shift']());}};_0x254f40(++_0x10f2be);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index a4b6e18..998621a 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 _0xbe75=['transferercontext','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode'];(function(_0x2c8721,_0x3fc894){var _0x418aa0=function(_0x4f3da7){while(--_0x4f3da7){_0x2c8721['push'](_0x2c8721['shift']());}};_0x418aa0(++_0x3fc894);}(_0xbe75,0x1a5));var _0x5be7=function(_0x40eb34,_0x573c32){_0x40eb34=_0x40eb34-0x0;var _0x4bcb07=_0xbe75[_0x40eb34];return _0x4bcb07;};'use strict';var client=require(_0x5be7('0x0'));exports[_0x5be7('0x1')]={};exports['blindTransfer']=function(_0x369ba8){return client['Request'](_0x5be7('0x2'),{'body':{'result':_0x369ba8[_0x5be7('0x3')],'transfererchannel':_0x369ba8['transfererchannel'],'transferercalleridnum':_0x369ba8[_0x5be7('0x4')],'transferercalleridname':_0x369ba8[_0x5be7('0x5')],'transfererconnectedlinenum':_0x369ba8[_0x5be7('0x6')],'transfererconnectedlinename':_0x369ba8['transfererconnectedlinename'],'transfereraccountcode':_0x369ba8[_0x5be7('0x7')],'transferercontext':_0x369ba8[_0x5be7('0x8')],'transfererexten':_0x369ba8['transfererexten'],'transfererlinkedid':_0x369ba8['transfererlinkedid'],'transfereechannel':_0x369ba8['transfereechannel'],'transfereecalleridnum':_0x369ba8[_0x5be7('0x9')],'transfereecalleridname':_0x369ba8['transfereecalleridname'],'transfereeconnectedlinenum':_0x369ba8[_0x5be7('0xa')],'transfereeconnectedlinename':_0x369ba8[_0x5be7('0xb')],'transfereeaccountcode':_0x369ba8[_0x5be7('0xc')],'transfereecontext':_0x369ba8['transfereecontext'],'transfereeexten':_0x369ba8[_0x5be7('0xd')],'transfereelinkedid':_0x369ba8[_0x5be7('0xe')],'isexternal':_0x369ba8[_0x5be7('0xf')],'context':_0x369ba8[_0x5be7('0x10')],'extension':_0x369ba8['extension'],'type':_0x5be7('0x11')},'log':_0x5be7('0x2')});};exports['attendedTransfer']=function(_0x230493){return client['Request'](_0x5be7('0x2'),{'body':{'result':_0x230493[_0x5be7('0x3')],'transfererchannel':_0x230493[_0x5be7('0x12')],'transferercalleridnum':_0x230493[_0x5be7('0x13')],'transferercalleridname':_0x230493[_0x5be7('0x14')],'transfererconnectedlinenum':_0x230493[_0x5be7('0x15')],'transfererconnectedlinename':_0x230493[_0x5be7('0x16')],'transfereraccountcode':_0x230493['origtransfereraccountcode'],'transferercontext':_0x230493[_0x5be7('0x17')],'transfererexten':_0x230493['secondtransfererexten'],'transfererlinkedid':_0x230493[_0x5be7('0x18')],'transfereechannel':_0x230493[_0x5be7('0x19')],'transfereecalleridnum':_0x230493['transfertargetcalleridnum'],'transfereecalleridname':_0x230493['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x230493[_0x5be7('0x1a')],'transfereeconnectedlinename':_0x230493[_0x5be7('0x1b')],'transfereeaccountcode':_0x230493['transfertargetaccountcode'],'transfereecontext':_0x230493[_0x5be7('0x1c')],'transfereeexten':_0x230493[_0x5be7('0x1d')],'transfereelinkedid':_0x230493[_0x5be7('0x1e')],'isexternal':_0x230493[_0x5be7('0xf')],'context':_0x230493[_0x5be7('0x1f')],'extension':_0x230493[_0x5be7('0x20')],'type':'attended'},'log':_0x5be7('0x2')});}; \ No newline at end of file +var _0x300b=['attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten'];(function(_0x59754c,_0x10123b){var _0x1ed675=function(_0x530a9e){while(--_0x530a9e){_0x59754c['push'](_0x59754c['shift']());}};_0x1ed675(++_0x10123b);}(_0x300b,0x172));var _0xb300=function(_0x1b821f,_0x2ebd1d){_0x1b821f=_0x1b821f-0x0;var _0x16c3ff=_0x300b[_0x1b821f];return _0x16c3ff;};'use strict';var client=require(_0xb300('0x0'));exports['transfers']={};exports[_0xb300('0x1')]=function(_0x2e57cf){return client[_0xb300('0x2')](_0xb300('0x3'),{'body':{'result':_0x2e57cf['result'],'transfererchannel':_0x2e57cf[_0xb300('0x4')],'transferercalleridnum':_0x2e57cf[_0xb300('0x5')],'transferercalleridname':_0x2e57cf[_0xb300('0x6')],'transfererconnectedlinenum':_0x2e57cf[_0xb300('0x7')],'transfererconnectedlinename':_0x2e57cf[_0xb300('0x8')],'transfereraccountcode':_0x2e57cf[_0xb300('0x9')],'transferercontext':_0x2e57cf[_0xb300('0xa')],'transfererexten':_0x2e57cf[_0xb300('0xb')],'transfererlinkedid':_0x2e57cf[_0xb300('0xc')],'transfereechannel':_0x2e57cf[_0xb300('0xd')],'transfereecalleridnum':_0x2e57cf['transfereecalleridnum'],'transfereecalleridname':_0x2e57cf[_0xb300('0xe')],'transfereeconnectedlinenum':_0x2e57cf[_0xb300('0xf')],'transfereeconnectedlinename':_0x2e57cf[_0xb300('0x10')],'transfereeaccountcode':_0x2e57cf[_0xb300('0x11')],'transfereecontext':_0x2e57cf[_0xb300('0x12')],'transfereeexten':_0x2e57cf[_0xb300('0x13')],'transfereelinkedid':_0x2e57cf[_0xb300('0x14')],'isexternal':_0x2e57cf['isexternal'],'context':_0x2e57cf['context'],'extension':_0x2e57cf['extension'],'type':_0xb300('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0xb300('0x16')]=function(_0x2e37da){return client[_0xb300('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2e37da[_0xb300('0x17')],'transfererchannel':_0x2e37da[_0xb300('0x18')],'transferercalleridnum':_0x2e37da[_0xb300('0x19')],'transferercalleridname':_0x2e37da[_0xb300('0x1a')],'transfererconnectedlinenum':_0x2e37da['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2e37da[_0xb300('0x1b')],'transfereraccountcode':_0x2e37da[_0xb300('0x1c')],'transferercontext':_0x2e37da['secondtransferercontext'],'transfererexten':_0x2e37da[_0xb300('0x1d')],'transfererlinkedid':_0x2e37da['origtransfererlinkedid'],'transfereechannel':_0x2e37da['transfertargetchannel'],'transfereecalleridnum':_0x2e37da[_0xb300('0x1e')],'transfereecalleridname':_0x2e37da[_0xb300('0x1f')],'transfereeconnectedlinenum':_0x2e37da[_0xb300('0x20')],'transfereeconnectedlinename':_0x2e37da[_0xb300('0x21')],'transfereeaccountcode':_0x2e37da[_0xb300('0x22')],'transfereecontext':_0x2e37da[_0xb300('0x23')],'transfereeexten':_0x2e37da['transfertargetexten'],'transfereelinkedid':_0x2e37da[_0xb300('0x24')],'isexternal':_0x2e37da[_0xb300('0x25')],'context':_0x2e37da[_0xb300('0x26')],'extension':_0x2e37da[_0xb300('0x27')],'type':_0xb300('0x28')},'log':_0xb300('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 97062f4..992698a 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 _0x032e=['voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','event','custom:','faxAccounts','send','checkAfterSend','http','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','reload','module','action','Reload','Action','message','catch','command','Command','then','content','voiceQueues','hasOwnProperty','push','omit','undefined','values','channels','length','uniqueid','%s.%s','filename','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','channel','StopMixMonitor','destinationchannel','wav','stop','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel'];(function(_0x5411a8,_0x36ddb1){var _0x2c047c=function(_0x235fbf){while(--_0x235fbf){_0x5411a8['push'](_0x5411a8['shift']());}};_0x2c047c(++_0x36ddb1);}(_0x032e,0x124));var _0xe032=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x032e[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var jayson=require(_0xe032('0x1'));var schema=require(_0xe032('0x2'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xe032('0x3'));var ami=require(_0xe032('0x4'));var VoiceQueueSummary=require(_0xe032('0x5'));exports[_0xe032('0x6')]=function(_0x306f3d,_0x420020,_0x2ba8a0){return new Promise(function(_0x33ad0b,_0x37432f){var _0x1576c8={'QueuePause':function(_0x3289b0){return new Promise(function(_0xd84027){var _0xaf3907=util[_0xe032('0x7')](_0xe032('0x8'),_0xe032('0x9'),_0x3289b0[_0xe032('0xa')]);if(_0x306f3d[_0xe032('0xb')]&&_0x306f3d['timers'][_0xaf3907]&&_0x306f3d[_0xe032('0xb')][_0xaf3907][_0xe032('0xc')]){_0x306f3d[_0xe032('0xb')][_0xaf3907][_0xe032('0xd')]();}if(_0x306f3d[_0xe032('0xe')][_0xaf3907]){_0x306f3d[_0xe032('0xe')][_0xaf3907][_0xe032('0xf')]({'statePause':_0x3289b0['pause']?!![]:![]});}_0xd84027({'code':0xc8,'message':_0xe032('0x10')});});},'Reload':function(_0x266d71){var _0x28c2b6=this;return new Promise(function(_0x1a53ab,_0x4aee44){if(ami[_0xe032('0x11')]()==![]){return _0x4aee44(_0x28c2b6[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config[_0xe032('0x13')][_0xe032('0x14')],_0xe032('0x15')][_0xe032('0x16')]('\x20')));}_0x266d71=_['pick'](_0x266d71,_[_0xe032('0x17')](properties[_0xe032('0x18')][_0xe032('0x19')]));_0x266d71[_0xe032('0x1a')]=_0xe032('0x1b');return ami[_0xe032('0x1c')](_0x266d71)['then'](function(_0x155f72){_0x1a53ab({'code':0xc8,'message':_0x155f72[_0xe032('0x1d')]});})[_0xe032('0x1e')](function(_0x41d2a5){_0x4aee44(_0x28c2b6[_0xe032('0x12')](0x1f5,_0x41d2a5['message']));});});},'Command':function(_0x4b644b){var _0x484e6c=this;return new Promise(function(_0x15475c,_0x505d8c){if(ami[_0xe032('0x11')]()==![]){return _0x505d8c(_0x484e6c[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config[_0xe032('0x13')][_0xe032('0x14')],_0xe032('0x15')][_0xe032('0x16')]('\x20')));}_0x4b644b=_['pick'](_0x4b644b,_0xe032('0x1f'));_0x4b644b[_0xe032('0x1a')]=_0xe032('0x20');return ami[_0xe032('0x1c')](_0x4b644b)[_0xe032('0x21')](function(_0x33d89a){_0x15475c({'code':0xc8,'message':_0x33d89a[_0xe032('0x22')]});})[_0xe032('0x1e')](function(_0x499da5){_0x505d8c(_0x484e6c['error'](0x1f5,_0x499da5['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x4ef536){var _0x2568ce=[];for(var _0x302559 in _0x306f3d[_0xe032('0x23')]){if(_0x306f3d[_0xe032('0x23')][_0xe032('0x24')](_0x302559)){var _0x36ece7=_0x306f3d[_0xe032('0x23')][_0x302559];var _0x4dcbf1=new VoiceQueueSummary(_0x36ece7);_0x2568ce[_0xe032('0x25')](_0x4dcbf1);}}_0x4ef536({'count':_0x2568ce['length'],'rows':_0x2568ce});});},'UpdateVoiceQueue':function(_0x189ed4){return new Promise(function(_0x1af097,_0x3106aa){var _0x2a521b=_['find'](_0x306f3d['voiceQueues'],{'id':parseInt(_0x189ed4['id'])});var _0x3e2575=_[_0xe032('0x26')](_0x189ed4,['id']);if(_0x2a521b){for(var _0x469290 in _0x3e2575){if(typeof _0x3e2575[_0x469290]!==_0xe032('0x27')&&typeof _0x2a521b[_0x469290]!=='undefined'){_0x2a521b[_0x469290]=_0x3e2575[_0x469290];}}_0x1af097(_0x2a521b);}else{_0x3106aa();}});},'VoiceChannels':function(){return new Promise(function(_0x541aa8){var _0x4fe00e=_[_0xe032('0x28')](_0x306f3d[_0xe032('0x29')]);_0x541aa8({'count':_0x4fe00e[_0xe032('0x2a')],'rows':_0x4fe00e});});},'VoiceChannelMixMonitor':function(_0x707b){var _0x50db2d=this;return new Promise(function(_0x3b93e3,_0x236da9){if(ami[_0xe032('0x11')]()==![]){return _0x236da9(_0x50db2d[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config['asterisk'][_0xe032('0x14')],_0xe032('0x15')][_0xe032('0x16')]('\x20')));}var _0x2cc18c=schema(properties['voicechannel'])[_0xe032('0x2')](_0x707b);if(_0x2cc18c['length']>0x0){return _0x236da9(_0x50db2d[_0xe032('0x12')](0x1f4,_['map'](_0x2cc18c,_0xe032('0x1d'))['join'](',\x20')));}var _0x2c1ec0=_['find'](_0x306f3d[_0xe032('0x29')],{'uniqueid':_0x707b[_0xe032('0x2b')]});if(_0x2c1ec0&&_0x2c1ec0['channel']){var _0x3e3598=util[_0xe032('0x7')](_0xe032('0x2c'),_0x707b[_0xe032('0x2d')]||_0x707b['uniqueid'],_0x707b[_0xe032('0x7')]||'wav');return ami[_0xe032('0x1c')]({'action':_0xe032('0x2e'),'channel':_0x2c1ec0['channel'],'file':_0x3e3598,'options':_0xe032('0x2f')})[_0xe032('0x21')](function(_0x4a4447){var _0x3efdef=_[_0xe032('0x30')](_0x2c1ec0[_0xe032('0x31')],{'filename':_0xe032('0x32')+_0x3e3598[_0xe032('0x33')]()});if(_[_0xe032('0x34')](_0x3efdef)){_0x2c1ec0[_0xe032('0x31')][_0xe032('0x25')]({'filename':_0xe032('0x32')+_0x3e3598[_0xe032('0x33')](),'createdAt':moment()[_0xe032('0x7')](_0xe032('0x35')),'mixmonitorid':_0x4a4447[_0xe032('0x36')],'status':_0xe032('0x37')});}else{_0x3efdef[_0xe032('0x36')]=_0x4a4447[_0xe032('0x36')];_0x3efdef[_0xe032('0x38')]='rec';}_0x3b93e3({'code':0xc8,'message':[_0x707b[_0xe032('0x2b')],'MixMonitor\x20Success',_0x4a4447[_0xe032('0x36')]][_0xe032('0x16')]('\x20'),'mixmonitorid':_0x4a4447[_0xe032('0x36')]});})[_0xe032('0x1e')](function(_0x468d47){_0x236da9(_0x50db2d['error'](0x1f5,[_0x707b[_0xe032('0x2b')],_0x468d47['message'][_0xe032('0x33')]()]['join']('\x20')));});}else{return _0x236da9(_0x50db2d[_0xe032('0x12')](0x1f5,_0xe032('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x2644a1){var _0x236198=this;return new Promise(function(_0x4dc836,_0x477360){if(ami['isConnected']()==![]){return _0x477360(_0x236198[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config[_0xe032('0x13')][_0xe032('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x45345d=schema(properties[_0xe032('0x3a')])['validate'](_0x2644a1);if(_0x45345d[_0xe032('0x2a')]>0x0){return _0x477360(_0x236198[_0xe032('0x12')](0x1f4,_[_0xe032('0x3b')](_0x45345d,_0xe032('0x1d'))[_0xe032('0x16')](',\x20')));}var _0x4dafef=_[_0xe032('0x30')](_0x306f3d[_0xe032('0x29')],{'uniqueid':_0x2644a1[_0xe032('0x2b')]});if(_0x4dafef){return Promise[_0xe032('0x3c')]()[_0xe032('0x21')](function(){if(_0x4dafef[_0xe032('0x3d')]){return ami[_0xe032('0x1c')]({'action':_0xe032('0x3e'),'channel':_0x4dafef['channel'],'mixmonitorid':_0x2644a1['mixmonitorid']})[_0xe032('0x1e')](function(){});}})['then'](function(){if(_0x4dafef[_0xe032('0x3f')]){return ami[_0xe032('0x1c')]({'action':_0xe032('0x3e'),'channel':_0x4dafef[_0xe032('0x3f')],'mixmonitorid':_0x2644a1[_0xe032('0x36')]})[_0xe032('0x1e')](function(){});}})[_0xe032('0x21')](function(){var _0x4659c8=_[_0xe032('0x30')](_0x4dafef['monitors'],{'mixmonitorid':_0x2644a1[_0xe032('0x36')]});if(_0x4659c8){_0x4659c8['status']='stop';}})[_0xe032('0x21')](function(){var _0x2583e9=util[_0xe032('0x7')](_0xe032('0x2c'),_0x2644a1['filename']||_0x2644a1[_0xe032('0x2b')],_0x2644a1[_0xe032('0x7')]||_0xe032('0x40'));var _0x39ffb7=_[_0xe032('0x30')](_0x4dafef[_0xe032('0x31')],{'filename':_0xe032('0x32')+_0x2583e9['toLowerCase']()});if(_0x39ffb7){_0x39ffb7[_0xe032('0x38')]=_0xe032('0x41');}})['then'](function(){_0x4dc836({'code':0xc8,'message':[_0x2644a1[_0xe032('0x2b')],_0xe032('0x42')][_0xe032('0x16')]('\x20')});})[_0xe032('0x1e')](function(_0x1c509c){_0x477360(_0x236198[_0xe032('0x12')](0x1f5,[_0x2644a1[_0xe032('0x2b')],_0x1c509c[_0xe032('0x1d')][_0xe032('0x33')]()][_0xe032('0x16')]('\x20')));});}else{return _0x477360(_0x236198[_0xe032('0x12')](0x1f5,_0xe032('0x39')));}});},'VoiceQueuesChannels':function(_0x11beda){var _0x2f8114=this;return new Promise(function(_0x4eabfc){var _0x1c8b32=_['values'](_0x306f3d[_0xe032('0x43')]);var _0x36ec12={'count':_0x1c8b32[_0xe032('0x2a')],'rows':_0x1c8b32};if(_0x11beda&&_0x11beda[_0xe032('0x44')]){if(![_0xe032('0x45'),_0xe032('0x46')][_0xe032('0x47')](_0x11beda[_0xe032('0x44')])){return _0x37432f(_0x2f8114[_0xe032('0x12')](0x190,_0xe032('0x48')));}var _0x1b9012=_['filter'](_0x1c8b32,function(_0x414b73){return _0x414b73[_0xe032('0x44')]===_0x11beda['type'];});_0x36ec12[_0xe032('0x49')]=_0x1b9012['length'];_0x36ec12[_0xe032('0x4a')]=_0x1b9012;}_0x4eabfc(_0x36ec12);});},'VoiceQueuesChannel':function(_0x1f2422){var _0x20f25b=this;return new Promise(function(_0x414243,_0x467d0c){var _0x5f11f9=schema(properties[_0xe032('0x4b')])[_0xe032('0x2')](_0x1f2422);if(_0x5f11f9[_0xe032('0x2a')]>0x0){return _0x467d0c(_0x20f25b[_0xe032('0x12')](0x1f4,_[_0xe032('0x3b')](_0x5f11f9,_0xe032('0x1d'))[_0xe032('0x16')](',\x20')));}var _0x5c0423=_[_0xe032('0x30')](_0x306f3d[_0xe032('0x43')],{'uniqueid':_0x1f2422[_0xe032('0x2b')]});if(_0x5c0423){_0x414243(_0x5c0423);}else{return _0x467d0c(_0x20f25b[_0xe032('0x12')](0x1f5,_0xe032('0x39')));}});},'VoiceQueuesChannelHangup':function(_0x42c0d7){var _0x2c07e4=this;return new Promise(function(_0x3a8adb,_0x80d181){if(ami['isConnected']()==![]){return _0x80d181(_0x2c07e4[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config[_0xe032('0x13')]['username'],_0xe032('0x15')][_0xe032('0x16')]('\x20')));}var _0x49a8bd=schema(properties[_0xe032('0x4c')])[_0xe032('0x2')](_0x42c0d7);if(_0x49a8bd[_0xe032('0x2a')]>0x0){return _0x80d181(_0x2c07e4[_0xe032('0x12')](0x1f4,_[_0xe032('0x3b')](_0x49a8bd,_0xe032('0x1d'))[_0xe032('0x16')](',\x20')));}var _0x202d8f=_[_0xe032('0x30')](_0x306f3d[_0xe032('0x43')],{'uniqueid':_0x42c0d7[_0xe032('0x2b')]});if(_0x202d8f&&_0x202d8f['channel']){return ami[_0xe032('0x1c')]({'action':_0xe032('0x4d'),'channel':_0x202d8f[_0xe032('0x3d')]})[_0xe032('0x21')](function(_0x3d7a3f){_0x3a8adb({'code':0xc8,'message':[_0x42c0d7['uniqueid'],_0x3d7a3f[_0xe032('0x1d')]['toLowerCase']()][_0xe032('0x16')]('\x20')});})[_0xe032('0x1e')](function(_0x26d358){_0x80d181(_0x2c07e4[_0xe032('0x12')](0x1f5,[_0x42c0d7[_0xe032('0x2b')],_0x26d358[_0xe032('0x1d')][_0xe032('0x33')]()][_0xe032('0x16')]('\x20')));});}else{return _0x80d181(_0x2c07e4[_0xe032('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x54711e){var _0x5c516a=this;return new Promise(function(_0x221473,_0x3c534b){if(ami[_0xe032('0x11')]()==![]){return _0x3c534b(_0x5c516a[_0xe032('0x12')](0x1f4,[config[_0xe032('0x13')]['ip'],config[_0xe032('0x13')]['username'],_0xe032('0x15')][_0xe032('0x16')]('\x20')));}var _0x1018d4=schema(properties['voicequeuechannelredirect'])[_0xe032('0x2')](_0x54711e);if(_0x1018d4['length']>0x0){return _0x3c534b(_0x5c516a[_0xe032('0x12')](0x1f4,_[_0xe032('0x3b')](_0x1018d4,'message')['join'](',\x20')));}var _0x542fcd=_[_0xe032('0x30')](_0x306f3d['queueChannels'],{'uniqueid':_0x54711e['uniqueid']});if(_0x542fcd&&_0x542fcd[_0xe032('0x3d')]){return ami[_0xe032('0x1c')]({'action':_0xe032('0x4e'),'channel':_0x542fcd['channel'],'exten':_0x54711e[_0xe032('0x4f')],'context':_0x54711e['context']||_0x542fcd[_0xe032('0x50')],'priority':0x1})[_0xe032('0x21')](function(_0x3b9dee){_0x221473({'code':0xc8,'message':[_0x54711e[_0xe032('0x2b')],_0x3b9dee[_0xe032('0x1d')][_0xe032('0x33')]()][_0xe032('0x16')]('\x20')});})[_0xe032('0x1e')](function(_0xc18f6f){_0x3c534b(_0x5c516a[_0xe032('0x12')](0x1f5,[_0x54711e[_0xe032('0x2b')],_0xc18f6f['message'][_0xe032('0x33')]()][_0xe032('0x16')]('\x20')));});}else{return _0x3c534b(_0x5c516a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x228df8){return new Promise(function(_0xffd314){var _0x3b89b8=_[_0xe032('0x28')](_0x306f3d[_0xe032('0xe')]);if(_0x228df8&&_0x228df8['id']){var _0x23922e=_['find'](_0x3b89b8,function(_0x163aab){return _0x163aab['id']===_0x228df8['id'];});_0xffd314(_0x23922e);}else{_0xffd314({'count':_0x3b89b8[_0xe032('0x2a')],'rows':_0x3b89b8});}});},'Telephones':function(){return new Promise(function(_0x4fe7a6){var _0x97e141=_[_0xe032('0x28')](_0x306f3d[_0xe032('0x51')]);_0x4fe7a6({'count':_0x97e141['length'],'rows':_0x97e141});});},'Trunks':function(){return new Promise(function(_0x3e893b){var _0x3e63b3=_[_0xe032('0x28')](_0x306f3d['trunks']);_0x3e893b({'count':_0x3e63b3['length'],'rows':_0x3e63b3});});},'OutboundChannels':function(){return new Promise(function(_0xdd691c){var _0x529c5f=_[_0xe032('0x28')](_0x306f3d[_0xe032('0x52')]);_0xdd691c({'count':_0x529c5f[_0xe032('0x2a')],'rows':_0x529c5f});});},'Outbound':function(){return new Promise(function(_0x168dae){_0x168dae(_0x306f3d[_0xe032('0x46')]);});},'Campaigns':function(){return new Promise(function(_0x443fcc){var _0x5a893f=_[_0xe032('0x28')](_0x306f3d[_0xe032('0x53')]);_0x443fcc({'count':_0x5a893f[_0xe032('0x2a')],'rows':_0x5a893f});});},'VoiceQueuesPreview':function(_0x5b5ab9){var _0x2467ea=this;return new Promise(function(_0x48e9c9,_0x14c811){_0x420020['run'](_0x5b5ab9['id'])[_0xe032('0x21')](function(_0xa9d9a4){_0x48e9c9({'code':0xc8,'message':_0xa9d9a4[_0xe032('0x1d')]});})['catch'](function(_0x325925){_0x14c811(_0x2467ea[_0xe032('0x12')](0x1f4,_0x325925[_0xe032('0x1d')]));});});},'EventManager':function(_0x11ddd4){var _0x29de94=this;return new Promise(function(_0x2a2c98,_0x57b321){if(!_0x11ddd4[_0xe032('0x54')]){return _0x57b321(_0x29de94[_0xe032('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xe032('0x55')+_0x11ddd4[_0xe032('0x54')],_0x11ddd4[_0xe032('0x1d')]);_0x2a2c98({'code':0xc8,'message':_0x11ddd4});});},'FaxAccounts':function(){return new Promise(function(_0x3a06c0){var _0x33dd57=_['values'](_0x306f3d[_0xe032('0x56')]);_0x3a06c0({'count':_0x33dd57['length'],'rows':_0x33dd57});});},'SendFax':function(_0xbd3ae2){var _0x5b594d=this;return new Promise(function(_0x7106c5,_0xac9584){_0x2ba8a0[_0xe032('0x57')](_0xbd3ae2)[_0xe032('0x21')](function(_0x644b58){_0x7106c5({'code':0xc8,'message':_0x644b58[_0xe032('0x1d')]});})['catch'](function(_0x2b8435){_0xac9584(_0x5b594d['error'](0x1f4,_0x2b8435['message']));});});},'CheckAfterSend':function(_0x485458){var _0x37f53b=this;return new Promise(function(_0x22728c,_0x50cd07){_0x2ba8a0[_0xe032('0x58')](_0x485458)['then'](function(_0x5f42b1){_0x22728c({'code':0xc8,'message':_0x5f42b1[_0xe032('0x1d')]});})[_0xe032('0x1e')](function(_0x577f56){_0x50cd07(_0x37f53b['error'](0x1f4,_0x577f56[_0xe032('0x1d')]));});});}};var _0x476120=jayson['server'](_0x1576c8)[_0xe032('0x59')]();_0x476120['on'](_0xe032('0x12'),function(_0x1a0f96){return _0x37432f(_0x1a0f96);});_0x476120[_0xe032('0x6')](0x232a,'127.0.0.1',function(){console[_0xe032('0x5a')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x33ad0b(_0xe032('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xf072=['outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','voiceQueues','push','length','find','omit','undefined','channels','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','rec','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','inbound','outbound','filter','type','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks'];(function(_0x642029,_0xb900a){var _0x22596f=function(_0x139b30){while(--_0x139b30){_0x642029['push'](_0x642029['shift']());}};_0x22596f(++_0xb900a);}(_0xf072,0x1cf));var _0x2f07=function(_0x59fd95,_0x226b4c){_0x59fd95=_0x59fd95-0x0;var _0x998034=_0xf072[_0x59fd95];return _0x998034;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var jayson=require(_0x2f07('0x2'));var schema=require('validate');var moment=require(_0x2f07('0x3'));var config=require('../../../config/environment');var properties=require(_0x2f07('0x4'));var ami=require(_0x2f07('0x5'));var VoiceQueueSummary=require(_0x2f07('0x6'));exports['listen']=function(_0x1d5a33,_0x14d6e6,_0x3643bb){return new Promise(function(_0x2e6422,_0x235418){var _0xf73d1a={'QueuePause':function(_0x33b99c){return new Promise(function(_0x379b2e){var _0x4746c2=util[_0x2f07('0x7')](_0x2f07('0x8'),_0x2f07('0x9'),_0x33b99c[_0x2f07('0xa')]);if(_0x1d5a33[_0x2f07('0xb')]&&_0x1d5a33[_0x2f07('0xb')][_0x4746c2]&&_0x1d5a33['timers'][_0x4746c2][_0x2f07('0xc')]){_0x1d5a33[_0x2f07('0xb')][_0x4746c2][_0x2f07('0xd')]();}if(_0x1d5a33[_0x2f07('0xe')][_0x4746c2]){_0x1d5a33['agents'][_0x4746c2]['updateStatusRealtime']({'statePause':_0x33b99c[_0x2f07('0xf')]?!![]:![]});}_0x379b2e({'code':0xc8,'message':_0x2f07('0x10')});});},'Reload':function(_0x58549c){var _0x6eb88a=this;return new Promise(function(_0x34dbd4,_0x26edfa){if(ami['isConnected']()==![]){return _0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}_0x58549c=_['pick'](_0x58549c,_[_0x2f07('0x16')](properties['reload'][_0x2f07('0x17')]));_0x58549c[_0x2f07('0x18')]=_0x2f07('0x19');return ami[_0x2f07('0x1a')](_0x58549c)[_0x2f07('0x1b')](function(_0x46c9b4){_0x34dbd4({'code':0xc8,'message':_0x46c9b4[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x55bd60){_0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f5,_0x55bd60['message']));});});},'Command':function(_0x3cd3c0){var _0x2df6ed=this;return new Promise(function(_0x119b68,_0xd944d6){if(ami[_0x2f07('0x1e')]()==![]){return _0xd944d6(_0x2df6ed['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}_0x3cd3c0=_['pick'](_0x3cd3c0,_0x2f07('0x1f'));_0x3cd3c0['action']=_0x2f07('0x20');return ami[_0x2f07('0x1a')](_0x3cd3c0)[_0x2f07('0x1b')](function(_0x307888){_0x119b68({'code':0xc8,'message':_0x307888['content']});})[_0x2f07('0x1d')](function(_0x428d8c){_0xd944d6(_0x2df6ed[_0x2f07('0x11')](0x1f5,_0x428d8c['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x111376){var _0x113916=[];for(var _0x522006 in _0x1d5a33[_0x2f07('0x21')]){if(_0x1d5a33[_0x2f07('0x21')]['hasOwnProperty'](_0x522006)){var _0x427e13=_0x1d5a33['voiceQueues'][_0x522006];var _0x894cd4=new VoiceQueueSummary(_0x427e13);_0x113916[_0x2f07('0x22')](_0x894cd4);}}_0x111376({'count':_0x113916[_0x2f07('0x23')],'rows':_0x113916});});},'UpdateVoiceQueue':function(_0x18f599){return new Promise(function(_0x20e4f8,_0x139ea8){var _0x787aad=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x21')],{'id':parseInt(_0x18f599['id'])});var _0x468cd8=_[_0x2f07('0x25')](_0x18f599,['id']);if(_0x787aad){for(var _0x279eb3 in _0x468cd8){if(typeof _0x468cd8[_0x279eb3]!=='undefined'&&typeof _0x787aad[_0x279eb3]!==_0x2f07('0x26')){_0x787aad[_0x279eb3]=_0x468cd8[_0x279eb3];}}_0x20e4f8(_0x787aad);}else{_0x139ea8();}});},'VoiceChannels':function(){return new Promise(function(_0x2b806a){var _0xada137=_['values'](_0x1d5a33[_0x2f07('0x27')]);_0x2b806a({'count':_0xada137[_0x2f07('0x23')],'rows':_0xada137});});},'VoiceChannelMixMonitor':function(_0x115c97){var _0x5ad0de=this;return new Promise(function(_0xcd91be,_0x368e3d){if(ami[_0x2f07('0x1e')]()==![]){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}var _0x5b0407=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x115c97);if(_0x5b0407[_0x2f07('0x23')]>0x0){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5b0407,_0x2f07('0x1c'))[_0x2f07('0x15')](',\x20')));}var _0x3a2bb7=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x115c97[_0x2f07('0x2b')]});if(_0x3a2bb7&&_0x3a2bb7[_0x2f07('0x2c')]){var _0xa74d2c=util[_0x2f07('0x7')](_0x2f07('0x2d'),_0x115c97[_0x2f07('0x2e')]||_0x115c97['uniqueid'],_0x115c97['format']||_0x2f07('0x2f'));return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x30'),'channel':_0x3a2bb7['channel'],'file':_0xa74d2c,'options':'ai(mixmonitorid)'})[_0x2f07('0x1b')](function(_0x4acfb6){var _0x35c4e2=_[_0x2f07('0x24')](_0x3a2bb7[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0xa74d2c[_0x2f07('0x33')]()});if(_['isNil'](_0x35c4e2)){_0x3a2bb7[_0x2f07('0x31')]['push']({'filename':_0x2f07('0x32')+_0xa74d2c['toLowerCase'](),'createdAt':moment()[_0x2f07('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x4acfb6['mixmonitorid'],'status':_0x2f07('0x34')});}else{_0x35c4e2[_0x2f07('0x35')]=_0x4acfb6['mixmonitorid'];_0x35c4e2[_0x2f07('0x36')]=_0x2f07('0x34');}_0xcd91be({'code':0xc8,'message':[_0x115c97[_0x2f07('0x2b')],'MixMonitor\x20Success',_0x4acfb6[_0x2f07('0x35')]][_0x2f07('0x15')]('\x20'),'mixmonitorid':_0x4acfb6[_0x2f07('0x35')]});})[_0x2f07('0x1d')](function(_0x25b1a9){_0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,[_0x115c97[_0x2f07('0x2b')],_0x25b1a9[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')));});}else{return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x3f1b6b){var _0x46c665=this;return new Promise(function(_0x2ded2e,_0x5129c){if(ami['isConnected']()==![]){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x4d5932=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x3f1b6b);if(_0x4d5932[_0x2f07('0x23')]>0x0){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,_['map'](_0x4d5932,'message')[_0x2f07('0x15')](',\x20')));}var _0x437e94=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x3f1b6b['uniqueid']});if(_0x437e94){return Promise[_0x2f07('0x38')]()[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x39'),'channel':_0x437e94[_0x2f07('0x2c')],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x3a')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x437e94['destinationchannel'],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})['then'](function(){var _0x97c166=_['find'](_0x437e94[_0x2f07('0x31')],{'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]});if(_0x97c166){_0x97c166[_0x2f07('0x36')]='stop';}})[_0x2f07('0x1b')](function(){var _0x350ace=util['format']('%s.%s',_0x3f1b6b[_0x2f07('0x2e')]||_0x3f1b6b[_0x2f07('0x2b')],_0x3f1b6b[_0x2f07('0x7')]||_0x2f07('0x2f'));var _0x1596f8=_[_0x2f07('0x24')](_0x437e94[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0x350ace[_0x2f07('0x33')]()});if(_0x1596f8){_0x1596f8[_0x2f07('0x36')]=_0x2f07('0x3b');}})[_0x2f07('0x1b')](function(){_0x2ded2e({'code':0xc8,'message':[_0x3f1b6b[_0x2f07('0x2b')],_0x2f07('0x3c')][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x47ea61){_0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,[_0x3f1b6b[_0x2f07('0x2b')],_0x47ea61[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceQueuesChannels':function(_0x23a8ee){var _0x146d70=this;return new Promise(function(_0x5b920b){var _0x3354e0=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x3e')]);var _0x12523d={'count':_0x3354e0['length'],'rows':_0x3354e0};if(_0x23a8ee&&_0x23a8ee['type']){if(![_0x2f07('0x3f'),_0x2f07('0x40')]['includes'](_0x23a8ee['type'])){return _0x235418(_0x146d70[_0x2f07('0x11')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x2bfb93=_[_0x2f07('0x41')](_0x3354e0,function(_0x236e61){return _0x236e61[_0x2f07('0x42')]===_0x23a8ee[_0x2f07('0x42')];});_0x12523d[_0x2f07('0x43')]=_0x2bfb93[_0x2f07('0x23')];_0x12523d[_0x2f07('0x44')]=_0x2bfb93;}_0x5b920b(_0x12523d);});},'VoiceQueuesChannel':function(_0x418be3){var _0x3b381a=this;return new Promise(function(_0x49dfeb,_0x42fa33){var _0x399072=schema(properties[_0x2f07('0x45')])[_0x2f07('0x29')](_0x418be3);if(_0x399072['length']>0x0){return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f4,_['map'](_0x399072,'message')['join'](',\x20')));}var _0x43fa9b=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x3e')],{'uniqueid':_0x418be3[_0x2f07('0x2b')]});if(_0x43fa9b){_0x49dfeb(_0x43fa9b);}else{return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x13c1b0){var _0x4084d6=this;return new Promise(function(_0x402da6,_0x56e9be){if(ami[_0x2f07('0x1e')]()==![]){return _0x56e9be(_0x4084d6['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk'][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0xcef3d2=schema(properties[_0x2f07('0x46')])[_0x2f07('0x29')](_0x13c1b0);if(_0xcef3d2[_0x2f07('0x23')]>0x0){return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0xcef3d2,_0x2f07('0x1c'))['join'](',\x20')));}var _0x5c2dd2=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x13c1b0['uniqueid']});if(_0x5c2dd2&&_0x5c2dd2['channel']){return ami['Action']({'action':_0x2f07('0x47'),'channel':_0x5c2dd2['channel']})[_0x2f07('0x1b')](function(_0x41e88f){_0x402da6({'code':0xc8,'message':[_0x13c1b0[_0x2f07('0x2b')],_0x41e88f[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x16fab3){_0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,[_0x13c1b0['uniqueid'],_0x16fab3[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x7d22f5){var _0x365298=this;return new Promise(function(_0x939049,_0x28b3c3){if(ami['isConnected']()==![]){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x5990d5=schema(properties[_0x2f07('0x48')])[_0x2f07('0x29')](_0x7d22f5);if(_0x5990d5['length']>0x0){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5990d5,'message')[_0x2f07('0x15')](',\x20')));}var _0x71df4d=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x7d22f5['uniqueid']});if(_0x71df4d&&_0x71df4d[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':'Redirect','channel':_0x71df4d[_0x2f07('0x2c')],'exten':_0x7d22f5[_0x2f07('0x49')],'context':_0x7d22f5[_0x2f07('0x4a')]||_0x71df4d[_0x2f07('0x4a')],'priority':0x1})[_0x2f07('0x1b')](function(_0x26f986){_0x939049({'code':0xc8,'message':[_0x7d22f5[_0x2f07('0x2b')],_0x26f986[_0x2f07('0x1c')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x58e5ee){_0x28b3c3(_0x365298['error'](0x1f5,[_0x7d22f5['uniqueid'],_0x58e5ee['message'][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'Agents':function(_0x49ae15){return new Promise(function(_0x2fb109){var _0xed7e01=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0xe')]);if(_0x49ae15&&_0x49ae15['id']){var _0x5b68f9=_[_0x2f07('0x24')](_0xed7e01,function(_0x3dc5ee){return _0x3dc5ee['id']===_0x49ae15['id'];});_0x2fb109(_0x5b68f9);}else{_0x2fb109({'count':_0xed7e01['length'],'rows':_0xed7e01});}});},'Telephones':function(){return new Promise(function(_0x5cbc28){var _0x5da460=_['values'](_0x1d5a33[_0x2f07('0x4b')]);_0x5cbc28({'count':_0x5da460[_0x2f07('0x23')],'rows':_0x5da460});});},'Trunks':function(){return new Promise(function(_0x127a39){var _0x5db1db=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4c')]);_0x127a39({'count':_0x5db1db[_0x2f07('0x23')],'rows':_0x5db1db});});},'OutboundChannels':function(){return new Promise(function(_0x455841){var _0x285df7=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4d')]);_0x455841({'count':_0x285df7[_0x2f07('0x23')],'rows':_0x285df7});});},'Outbound':function(){return new Promise(function(_0x4d8bf0){_0x4d8bf0(_0x1d5a33['outbound']);});},'Campaigns':function(){return new Promise(function(_0x417618){var _0x1ab958=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4e')]);_0x417618({'count':_0x1ab958[_0x2f07('0x23')],'rows':_0x1ab958});});},'VoiceQueuesPreview':function(_0x220236){var _0xc4c1c6=this;return new Promise(function(_0x3650d9,_0x1eda37){_0x14d6e6[_0x2f07('0x4f')](_0x220236['id'])[_0x2f07('0x1b')](function(_0x5effb2){_0x3650d9({'code':0xc8,'message':_0x5effb2[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x4d738e){_0x1eda37(_0xc4c1c6[_0x2f07('0x11')](0x1f4,_0x4d738e[_0x2f07('0x1c')]));});});},'EventManager':function(_0x5b8f8c){var _0x1cc1f7=this;return new Promise(function(_0x31dd3,_0x212d68){if(!_0x5b8f8c[_0x2f07('0x50')]){return _0x212d68(_0x1cc1f7[_0x2f07('0x11')](0x1f4,_0x2f07('0x51')));}ami['emit'](_0x2f07('0x52')+_0x5b8f8c[_0x2f07('0x50')],_0x5b8f8c['message']);_0x31dd3({'code':0xc8,'message':_0x5b8f8c});});},'FaxAccounts':function(){return new Promise(function(_0xabe7e7){var _0x22c670=_[_0x2f07('0x3d')](_0x1d5a33['faxAccounts']);_0xabe7e7({'count':_0x22c670[_0x2f07('0x23')],'rows':_0x22c670});});},'SendFax':function(_0x4393bd){var _0x4d141f=this;return new Promise(function(_0x31d816,_0x4c182c){_0x3643bb[_0x2f07('0x53')](_0x4393bd)[_0x2f07('0x1b')](function(_0x1a0f5c){_0x31d816({'code':0xc8,'message':_0x1a0f5c[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x3a99ce){_0x4c182c(_0x4d141f[_0x2f07('0x11')](0x1f4,_0x3a99ce[_0x2f07('0x1c')]));});});},'CheckAfterSend':function(_0xbdb45c){var _0x4e7f9f=this;return new Promise(function(_0x2443d7,_0x199440){_0x3643bb[_0x2f07('0x54')](_0xbdb45c)[_0x2f07('0x1b')](function(_0x10f5bf){_0x2443d7({'code':0xc8,'message':_0x10f5bf[_0x2f07('0x1c')]});})['catch'](function(_0x52d5c6){_0x199440(_0x4e7f9f[_0x2f07('0x11')](0x1f4,_0x52d5c6[_0x2f07('0x1c')]));});});}};var _0x410a53=jayson[_0x2f07('0x55')](_0xf73d1a)['http']();_0x410a53['on'](_0x2f07('0x11'),function(_0x51db42){return _0x235418(_0x51db42);});_0x410a53[_0x2f07('0x56')](0x232a,'127.0.0.1',function(){console[_0x2f07('0x57')](_0x2f07('0x58'),0x232a);return _0x2e6422(_0x2f07('0x59')+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 626781f..9176dd0 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 _0xf211=['phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','data5','xmd-contactid','data3','split'];(function(_0x56c22a,_0x3b0b7f){var _0x572548=function(_0x2e15e2){while(--_0x2e15e2){_0x56c22a['push'](_0x56c22a['shift']());}};_0x572548(++_0x3b0b7f);}(_0xf211,0x198));var _0x1f21=function(_0x310dc2,_0x2299c4){_0x310dc2=_0x310dc2-0x0;var _0x24980f=_0xf211[_0x310dc2];return _0x24980f;};'use strict';var _=require(_0x1f21('0x0'));var BPromise=require(_0x1f21('0x1'));var Redis=require('ioredis');var util=require(_0x1f21('0x2'));var config=require(_0x1f21('0x3'));var logger=require('../../../../config/logger')(_0x1f21('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1f21('0x5')]=_[_0x1f21('0x6')](config[_0x1f21('0x5')],{'host':_0x1f21('0x7'),'port':0x18eb});var io=require(_0x1f21('0x8'))(new Redis(config['redis']));function emit(_0x49282d,_0x3345a9,_0x100282,_0x1dab05,_0x343b54){logger[_0x1f21('0x9')](_0x1f21('0xa'),_0x49282d,_0x3345a9['id'],_0x100282,_0x1dab05,JSON[_0x1f21('0xb')](_0x343b54));io['to'](_0x100282)[_0x1f21('0xc')](_0x1dab05,_0x343b54);}exports['exec']=function(_0x587575,_0x521a34,_0x255a0f,_0x3f0fd7){var _0x38e22c,_0x178e7d;var _0x2ddb0f={};var _0x1ef292;var _0x4d2ed1=Number(_0x255a0f[_0x1f21('0xd')]);var _0x406916=_0x255a0f[_0x1f21('0xe')]?Boolean(Number(_0x255a0f[_0x1f21('0xe')])):![];var _0x15c480;var _0x30c6d4=![];if(!_['isNil'](_0x255a0f['data5'])){if(_0x255a0f[_0x1f21('0xf')]=='1')_0x30c6d4=!![];}if(!_0x30c6d4){if(_0x3f0fd7[_0x1f21('0x10')]){_0x2ddb0f['id']=_0x3f0fd7['xmd-contactid'];}}if(!_0x2ddb0f['id']){_0x2ddb0f['ListId']=_0x4d2ed1;_0x15c480=_0x255a0f[_0x1f21('0x11')]&&_0x255a0f['data3']!=='0'?_0x255a0f[_0x1f21('0x11')][_0x1f21('0x12')](','):[_0x1f21('0x13')];_0x2ddb0f[_0x1f21('0x14')]=_[_0x1f21('0x15')](_0x15c480,function(_0x4db5db){var _0x234d11={};_0x234d11[_0x4db5db]=_0x3f0fd7[_0x1f21('0x16')]?_0x3f0fd7[_0x1f21('0x17')]:_0x3f0fd7[_0x1f21('0x18')];return _0x234d11;});_0x1ef292=_0x3f0fd7[_0x1f21('0x16')]?_0x3f0fd7[_0x1f21('0x17')]:_0x3f0fd7[_0x1f21('0x18')];}var _0x2adca4=['id',_0x1f21('0x19'),_0x1f21('0x1a'),_0x1f21('0x13'),_0x1f21('0x1b'),_0x1f21('0x1c'),_0x1f21('0x1d'),_0x1f21('0x1e'),_0x1f21('0x1f'),_0x1f21('0x20')];var _0x55f970=_[_0x1f21('0x21')](_0x2adca4,_0x15c480);BPromise[_0x1f21('0x22')]()[_0x1f21('0x23')](cmContactRpc[_0x1f21('0x24')]({'attributes':_0x55f970,'where':_0x2ddb0f,'phone':_0x1ef292}))['then'](function(_0x38f657){_0x178e7d=_0x38f657;if(!_[_0x1f21('0x25')](_0x178e7d)){if(_0x178e7d[_0x1f21('0x26')]===0x1){_0x38e22c=_0x178e7d[0x0];logger[_0x1f21('0x9')](_0x1f21('0x27'),_0x3f0fd7[_0x1f21('0x28')],_0x521a34['id'],_0x38e22c['id']);}else{logger[_0x1f21('0x9')](_0x1f21('0x29'),_0x3f0fd7['uniqueid'],_0x521a34['id'],_[_0x1f21('0x15')](_0x178e7d,'id')[_0x1f21('0x2a')](','));}return;}else{logger[_0x1f21('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x3f0fd7[_0x1f21('0x28')],_0x521a34['id']);var _0xa6c67f={'ListId':_0x4d2ed1};var _0x2b71c3=_0x255a0f[_0x1f21('0x2b')]&&_0x255a0f['data4']!=='0'?_0x255a0f[_0x1f21('0x2b')]:_0x1f21('0x13');if(_0x406916){logger['info'](_0x1f21('0x2c'),_0x3f0fd7['uniqueid'],_0x521a34['id']);_0xa6c67f[_0x2b71c3]=_['isNil'](_0x3f0fd7[_0x1f21('0x16')])?_0x3f0fd7[_0x1f21('0x18')]:_0x3f0fd7[_0x1f21('0x17')];if(_[_0x1f21('0x2d')](_0x3f0fd7[_0x1f21('0x16')])){_0xa6c67f[_0x1f21('0x19')]=_0x3f0fd7['calleridname']&&_0x3f0fd7[_0x1f21('0x2e')]!==''?_0x3f0fd7['calleridname']:_0x1f21('0x2f');}else{_0xa6c67f[_0x1f21('0x19')]=_0x3f0fd7[_0x1f21('0x30')]&&_0x3f0fd7[_0x1f21('0x30')]!==''?_0x3f0fd7[_0x1f21('0x30')]:'Unknown';}return BPromise[_0x1f21('0x22')]()['then'](cmContactRpc[_0x1f21('0x31')](_0xa6c67f))['then'](function(_0x126781){_0x38e22c=_0x126781;_0x178e7d[_0x1f21('0x32')](_0x126781);if(_0x38e22c){logger['info'](_0x1f21('0x33'),_0x3f0fd7[_0x1f21('0x28')],_0x521a34['id'],_0x38e22c['id']);}return;});}else{logger[_0x1f21('0x9')](_0x1f21('0x34'),_0x3f0fd7[_0x1f21('0x28')],_0x521a34['id']);_0xa6c67f[_0x2b71c3]=_['isNil'](_0x3f0fd7['routeId'])?_0x3f0fd7[_0x1f21('0x18')]:_0x3f0fd7[_0x1f21('0x17')];if(_[_0x1f21('0x2d')](_0x3f0fd7[_0x1f21('0x16')])){_0xa6c67f[_0x1f21('0x19')]=_0x3f0fd7[_0x1f21('0x2e')]&&_0x3f0fd7[_0x1f21('0x2e')]!==_0x1f21('0x35')?_0x3f0fd7[_0x1f21('0x2e')]:_0x1f21('0x2f');}else{_0xa6c67f[_0x1f21('0x19')]=_0x3f0fd7[_0x1f21('0x30')]&&_0x3f0fd7[_0x1f21('0x30')]!==_0x1f21('0x35')?_0x3f0fd7[_0x1f21('0x30')]:_0x1f21('0x2f');}_0x38e22c=_0xa6c67f;_0x178e7d[_0x1f21('0x32')](_0xa6c67f);return;}}})[_0x1f21('0x23')](function(){if(_0x587575){emit(_0x3f0fd7[_0x1f21('0x28')],_0x521a34,util[_0x1f21('0x36')](_0x1f21('0x37'),_0x587575[_0x1f21('0x38')]),util[_0x1f21('0x36')](_0x1f21('0x39'),_0x255a0f[_0x1f21('0x3a')][_0x1f21('0x3b')]()),{'evt':_[_0x1f21('0x3c')](_0x3f0fd7,{'autoCreate':_0x406916}),'contact':_0x38e22c===undefined?{}:_0x38e22c,'contacts':_0x178e7d[_0x1f21('0x26')]===0x0?undefined:_0x178e7d});}});}; \ No newline at end of file +var _0xe5e9=['$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','ListId','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','Unknown','format','user:%s','name','trigger:%s','action','merge','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','data1','data2','isNil','xmd-contactid','data3','phone'];(function(_0x3a8eb7,_0x3ce969){var _0x1d16ac=function(_0xf5931){while(--_0xf5931){_0x3a8eb7['push'](_0x3a8eb7['shift']());}};_0x1d16ac(++_0x3ce969);}(_0xe5e9,0x1e4));var _0x9e5e=function(_0x301486,_0x27b799){_0x301486=_0x301486-0x0;var _0x418d16=_0xe5e9[_0x301486];return _0x418d16;};'use strict';var _=require(_0x9e5e('0x0'));var BPromise=require(_0x9e5e('0x1'));var Redis=require(_0x9e5e('0x2'));var util=require(_0x9e5e('0x3'));var config=require(_0x9e5e('0x4'));var logger=require(_0x9e5e('0x5'))(_0x9e5e('0x6'));var cmContactRpc=require(_0x9e5e('0x7'));config[_0x9e5e('0x8')]=_[_0x9e5e('0x9')](config[_0x9e5e('0x8')],{'host':_0x9e5e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e5e('0x8')]));function emit(_0x46a8f8,_0xcbf45a,_0x27e56c,_0x54d2a6,_0x5eb525){logger[_0x9e5e('0xb')]('[CM][%s][%s]',_0x46a8f8,_0xcbf45a['id'],_0x27e56c,_0x54d2a6,JSON[_0x9e5e('0xc')](_0x5eb525));io['to'](_0x27e56c)[_0x9e5e('0xd')](_0x54d2a6,_0x5eb525);}exports['exec']=function(_0x426d4e,_0x550eb2,_0x1c3fd3,_0x31c74b){var _0x59f761,_0xfa8a35;var _0x1f35f3={};var _0x5289a8;var _0x5d0d8f=Number(_0x1c3fd3[_0x9e5e('0xe')]);var _0x1698f3=_0x1c3fd3['data2']?Boolean(Number(_0x1c3fd3[_0x9e5e('0xf')])):![];var _0x40b1ea;var _0x309d58=![];if(!_[_0x9e5e('0x10')](_0x1c3fd3['data5'])){if(_0x1c3fd3['data5']=='1')_0x309d58=!![];}if(!_0x309d58){if(_0x31c74b[_0x9e5e('0x11')]){_0x1f35f3['id']=_0x31c74b[_0x9e5e('0x11')];}}if(!_0x1f35f3['id']){_0x1f35f3['ListId']=_0x5d0d8f;_0x40b1ea=_0x1c3fd3['data3']&&_0x1c3fd3[_0x9e5e('0x12')]!=='0'?_0x1c3fd3[_0x9e5e('0x12')]['split'](','):[_0x9e5e('0x13')];_0x1f35f3[_0x9e5e('0x14')]=_[_0x9e5e('0x15')](_0x40b1ea,function(_0x4bd9ad){var _0x45918d={};_0x45918d[_0x4bd9ad]=_0x31c74b[_0x9e5e('0x16')]?_0x31c74b['destcalleridnum']:_0x31c74b[_0x9e5e('0x17')];return _0x45918d;});_0x5289a8=_0x31c74b[_0x9e5e('0x16')]?_0x31c74b[_0x9e5e('0x18')]:_0x31c74b[_0x9e5e('0x17')];}var _0x1b153a=['id',_0x9e5e('0x19'),_0x9e5e('0x1a'),_0x9e5e('0x13'),_0x9e5e('0x1b'),'fax',_0x9e5e('0x1c'),_0x9e5e('0x1d'),_0x9e5e('0x1e'),_0x9e5e('0x1f')];var _0xe2ac11=_['union'](_0x1b153a,_0x40b1ea);BPromise[_0x9e5e('0x20')]()[_0x9e5e('0x21')](cmContactRpc[_0x9e5e('0x22')]({'attributes':_0xe2ac11,'where':_0x1f35f3,'phone':_0x5289a8}))[_0x9e5e('0x21')](function(_0x2327a0){_0xfa8a35=_0x2327a0;if(!_[_0x9e5e('0x23')](_0xfa8a35)){if(_0xfa8a35['length']===0x1){_0x59f761=_0xfa8a35[0x0];logger[_0x9e5e('0xb')](_0x9e5e('0x24'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id'],_0x59f761['id']);}else{logger[_0x9e5e('0xb')](_0x9e5e('0x26'),_0x31c74b['uniqueid'],_0x550eb2['id'],_['map'](_0xfa8a35,'id')[_0x9e5e('0x27')](','));}return;}else{logger['info'](_0x9e5e('0x28'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id']);var _0xb521fc={'ListId':_0x5d0d8f};var _0x2b280d=_0x1c3fd3['data4']&&_0x1c3fd3[_0x9e5e('0x29')]!=='0'?_0x1c3fd3[_0x9e5e('0x29')]:_0x9e5e('0x13');if(_0x1698f3){logger['info'](_0x9e5e('0x2a'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id']);_0xb521fc[_0x2b280d]=_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])?_0x31c74b[_0x9e5e('0x17')]:_0x31c74b['destcalleridnum'];if(_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])){_0xb521fc['firstName']=_0x31c74b['calleridname']&&_0x31c74b[_0x9e5e('0x2b')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2b')]:'Unknown';}else{_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2d')]&&_0x31c74b[_0x9e5e('0x2d')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2d')]:'Unknown';}return BPromise['resolve']()[_0x9e5e('0x21')](cmContactRpc['createContact'](_0xb521fc))[_0x9e5e('0x21')](function(_0x5a2c4b){_0x59f761=_0x5a2c4b;_0xfa8a35[_0x9e5e('0x2e')](_0x5a2c4b);if(_0x59f761){logger['info'](_0x9e5e('0x2f'),_0x31c74b['uniqueid'],_0x550eb2['id'],_0x59f761['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x31c74b['uniqueid'],_0x550eb2['id']);_0xb521fc[_0x2b280d]=_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])?_0x31c74b[_0x9e5e('0x17')]:_0x31c74b[_0x9e5e('0x18')];if(_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])){_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2b')]&&_0x31c74b[_0x9e5e('0x2b')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2b')]:_0x9e5e('0x30');}else{_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2d')]&&_0x31c74b[_0x9e5e('0x2d')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2d')]:_0x9e5e('0x30');}_0x59f761=_0xb521fc;_0xfa8a35[_0x9e5e('0x2e')](_0xb521fc);return;}}})['then'](function(){if(_0x426d4e){emit(_0x31c74b['uniqueid'],_0x550eb2,util[_0x9e5e('0x31')](_0x9e5e('0x32'),_0x426d4e[_0x9e5e('0x33')]),util[_0x9e5e('0x31')](_0x9e5e('0x34'),_0x1c3fd3[_0x9e5e('0x35')]['toLowerCase']()),{'evt':_[_0x9e5e('0x36')](_0x31c74b,{'autoCreate':_0x1698f3}),'contact':_0x59f761===undefined?{}:_0x59f761,'contacts':_0xfa8a35[_0x9e5e('0x37')]===0x0?undefined:_0xfa8a35});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 87a2c3c..0b0d8c7 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 _0xe9f2=['length','action','contactmanager','motionbar','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','uriLocation','data4','data5','800','windowHeight','data6','winArguments','emit','user:%s','format','trigger:%s:%s','toLowerCase','trigger:%s','exec','accounts','queue','routeId','urlforward','script','buildUri','parse','query','replace','channel','AllConditions','every','checkConditions','AnyConditions','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','undefined','substatus','offlineMessage','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','defaults','redis','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','clone','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions'];(function(_0x84dd42,_0xba5fe0){var _0x31ca2a=function(_0x3f7e21){while(--_0x3f7e21){_0x84dd42['push'](_0x84dd42['shift']());}};_0x31ca2a(++_0xba5fe0);}(_0xe9f2,0xba));var _0x2e9f=function(_0x545912,_0x2e89d2){_0x545912=_0x545912-0x0;var _0x18e1f7=_0xe9f2[_0x545912];return _0x18e1f7;};'use strict';var util=require(_0x2e9f('0x0'));var _=require(_0x2e9f('0x1'));var url=require(_0x2e9f('0x2'));var Mustache=require(_0x2e9f('0x3'));var Redis=require('ioredis');var urlforward=require(_0x2e9f('0x4'));var integration=require(_0x2e9f('0x5'));var cmContact=require(_0x2e9f('0x6'));var script=require(_0x2e9f('0x7'));var config=require('../../../config/environment');var logger=require(_0x2e9f('0x8'))(_0x2e9f('0x9'));var ami=require(_0x2e9f('0xa'));config['redis']=_[_0x2e9f('0xb')](config[_0x2e9f('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2e9f('0xc')]));var operators={'equals':function(_0x89d75a,_0x19b9e8){return _0x89d75a==_0x19b9e8;},'not_equals':function(_0x5f3c66,_0x21a8cd){return _0x5f3c66!=_0x21a8cd;}};var barAndWebActions=['popup',_0x2e9f('0x2'),_0x2e9f('0xd')];function Trigger(_0x54ace4){this[_0x2e9f('0xe')]=_0x54ace4['triggers'];this[_0x2e9f('0xf')]=_0x54ace4[_0x2e9f('0xf')];this['voiceQueues']=_0x54ace4[_0x2e9f('0x10')];this[_0x2e9f('0x11')]=_0x54ace4[_0x2e9f('0x11')];this[_0x2e9f('0x12')]=_0x54ace4[_0x2e9f('0x12')];this[_0x2e9f('0x13')]=_0x54ace4[_0x2e9f('0x13')];this[_0x2e9f('0x14')]=_0x54ace4['freshdeskAccounts'];this['salesforceAccounts']=_0x54ace4[_0x2e9f('0x15')];this[_0x2e9f('0x16')]=_0x54ace4[_0x2e9f('0x16')];this[_0x2e9f('0x17')]=_0x54ace4[_0x2e9f('0x17')];this[_0x2e9f('0x18')]=_0x54ace4[_0x2e9f('0x18')];this['vtigerAccounts']=_0x54ace4['vtigerAccounts'];this[_0x2e9f('0x19')]=_0x54ace4[_0x2e9f('0x19')];this[_0x2e9f('0x1a')]=_0x54ace4['dynamics365Accounts'];this[_0x2e9f('0x1b')]=_0x54ace4[_0x2e9f('0x1b')];this['accounts']={'zendesk':this[_0x2e9f('0x13')],'salesforce':this[_0x2e9f('0x15')],'freshdesk':this[_0x2e9f('0x14')],'sugarcrm':this[_0x2e9f('0x16')],'zoho':this[_0x2e9f('0x17')],'desk':this[_0x2e9f('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x2e9f('0x1a')],'freshsales':this[_0x2e9f('0x1b')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x1e'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x1f'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on']('custom:agentcomplete',this[_0x2e9f('0x1c')]['bind'](this));ami['on'](_0x2e9f('0x20'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x21'),this[_0x2e9f('0x1c')]['bind'](this));ami['on'](_0x2e9f('0x22'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x23'),this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x24'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on']('custom:amd',this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x25'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x26'),this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x27'),this[_0x2e9f('0x28')][_0x2e9f('0x1d')](this));ami['on']('custom:dialconnect',this[_0x2e9f('0x28')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x29'),this[_0x2e9f('0x28')][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x2a'),this[_0x2e9f('0x1c')]['bind'](this));ami['on'](_0x2e9f('0x2b'),this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x2c'),this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on']('custom:incomingmessage',this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x2d'),this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on'](_0x2e9f('0x2e'),this['syncCustomEvent'][_0x2e9f('0x1d')](this));ami['on']('custom:offlineMessage',this[_0x2e9f('0x1c')][_0x2e9f('0x1d')](this));}Trigger[_0x2e9f('0x2f')]['emit']=function(_0x5971a1,_0x3282dd,_0x1cd3d7){logger[_0x2e9f('0x30')](_0x5971a1,_0x3282dd,JSON[_0x2e9f('0x31')](_0x1cd3d7));io['to'](_0x5971a1)['emit'](_0x3282dd,_0x1cd3d7);};Trigger['prototype']['syncCustomEvent']=function(_0xf28102){var _0x5d0fa1=_[_0x2e9f('0x32')](_0xf28102);if(typeof _0x5d0fa1[_0x2e9f('0x33')]==='undefined'){_0x5d0fa1['motionChannel']='voice';}this[_0x2e9f('0x34')](_0x5d0fa1);};Trigger['prototype']['syncAgentDial']=function(_0x26043a){if(this[_0x2e9f('0xf')][_0x26043a[_0x2e9f('0x35')]]){this[_0x2e9f('0x1c')](_0x26043a);}};Trigger['prototype'][_0x2e9f('0x34')]=function(_0x378770){var _0x21f4cc;for(var _0x547452 in this[_0x2e9f('0xe')]){if(this['triggers'][_0x2e9f('0x36')](_0x547452)){if(this[_0x2e9f('0xe')][_0x547452][_0x2e9f('0x37')]){_0x21f4cc=this[_0x2e9f('0x38')](this[_0x2e9f('0xe')][_0x547452],_0x378770);if(_0x21f4cc){_[_0x2e9f('0x39')](_0x378770,_0x378770[_0x2e9f('0x3a')]);for(var _0x545476=0x0,_0x4bfb76,_0x294584,_0xdf3e6;_0x5454760x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x326f,0xd1));var _0xf326=function(_0x11c120,_0x27509b){_0x11c120=_0x11c120-0x0;var _0x42eead=_0x326f[_0x11c120];return _0x42eead;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 7ede9a6..74e4661 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 _0x9125=['userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','message','toLowerCase','outbound','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','GET','contacts?$select=','\x20eq\x20\x27','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','idField','indexOf','content','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','queue','callDirection','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','data5','POST','clientId','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','Bearer\x20','4.0','value','isNil','validateEmail','email'];(function(_0x1810c7,_0x1ad306){var _0x3d4b7a=function(_0x2f92f3){while(--_0x2f92f3){_0x1810c7['push'](_0x1810c7['shift']());}};_0x3d4b7a(++_0x1ad306);}(_0x9125,0xb9));var _0x5912=function(_0x1e928b,_0x7cb412){_0x1e928b=_0x1e928b-0x0;var _0x3e26c3=_0x9125[_0x1e928b];return _0x3e26c3;};'use strict';var _=require(_0x5912('0x0'));var rp=require('request-promise');var util=require(_0x5912('0x1'));var intUtil=require(_0x5912('0x2'));var md5=require(_0x5912('0x3'));var Redis=require(_0x5912('0x4'));var logger=require(_0x5912('0x5'))('dynamics365');var config=require('../../../../config/environment');config[_0x5912('0x6')]=_['defaults'](config[_0x5912('0x6')],{'host':_0x5912('0x7'),'port':0x18eb});var io=require(_0x5912('0x8'))(new Redis(config[_0x5912('0x6')]));function getAuthToken(_0x33ff30,_0x41594a,_0x427770){if(_0x33ff30[_0x5912('0x9')]){_0x33ff30[_0x5912('0xa')]=_0x33ff30[_0x5912('0xb')]['data7'];_0x33ff30[_0x5912('0xc')]=_0x33ff30[_0x5912('0xb')][_0x5912('0xd')];return Promise[_0x5912('0xe')](_0x33ff30[_0x5912('0xb')][_0x5912('0xf')]);}var _0xfc9597={'method':_0x5912('0x10'),'uri':_0x41594a,'form':{'client_id':_0x33ff30[_0x5912('0x11')],'resource':_0x33ff30[_0x5912('0xa')],'username':_0x33ff30['username'],'password':_0x33ff30[_0x5912('0x12')],'grant_type':_0x5912('0x12'),'client_secret':_0x33ff30[_0x5912('0x13')]},'json':!![]};return rp(_0xfc9597)[_0x5912('0x14')](function(_0x4acfbd){return _0x4acfbd[_0x5912('0x15')];})[_0x5912('0x16')](function(_0x49697e){logger[_0x5912('0x17')]('['+[_0x427770['toUpperCase']()]+_0x5912('0x18'));return _0x49697e['message'];});}function getUser(_0x2d2a84,_0xafa94d,_0x576dd7,_0x4873b5,_0x19717f,_0x3654ba){return new Promise(function(_0x1a2f60,_0x379e9f){return getAuthToken(_0xafa94d,_0x4873b5,_0x3654ba)[_0x5912('0x14')](function(_0x4d705a){var _0x1d935e={'method':'GET','uri':_0x19717f+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x5912('0x19')+_0x4d705a,'OData-Version':_0x5912('0x1a')},'json':!![]};return rp(_0x1d935e);})[_0x5912('0x14')](function(_0x9fda52){var _0x28da0b=_0x9fda52[_0x5912('0x1b')];var _0x5ef2af=![];var _0x1db47c=null;if(!_[_0x5912('0x1c')](_0x576dd7)){if(intUtil[_0x5912('0x1d')](_0x576dd7[_0x5912('0x1e')])){_0x2d2a84[_0x5912('0x1f')]=_0x576dd7[_0x5912('0x1e')];for(_0x1db47c=0x0;_0x1db47c<_0x28da0b['length'];_0x1db47c++){if(_0x28da0b[_0x1db47c][_0x5912('0x20')]===_0x576dd7[_0x5912('0x1e')]&&!_0x28da0b[_0x1db47c][_0x5912('0x21')]){_0x5ef2af=!![];logger[_0x5912('0x22')]('['+[_0x3654ba[_0x5912('0x23')]()]+_0x5912('0x24')+_0x28da0b[_0x1db47c][_0x5912('0x25')]+'!');_0x2d2a84[_0x5912('0x26')]=_0x28da0b[_0x1db47c]['systemuserid'];}}}}if(!_0x5ef2af){logger[_0x5912('0x22')]('['+[_0x3654ba['toUpperCase']()]+_0x5912('0x27'));_0x2d2a84[_0x5912('0x1f')]=_0xafa94d[_0x5912('0x28')];for(_0x1db47c=0x0;_0x1db47c<_0x28da0b[_0x5912('0x29')];_0x1db47c++){if(_0x28da0b[_0x1db47c][_0x5912('0x20')]===_0xafa94d[_0x5912('0x28')]){_0x2d2a84[_0x5912('0x26')]=_0x28da0b[_0x1db47c][_0x5912('0x25')];}}}_0x1a2f60(_0x2d2a84);})[_0x5912('0x16')](function(_0x2477ea){_0x379e9f(_0x2477ea[_0x5912('0x2a')]);});});}function createEndUser(_0x585e07,_0x4cb9d1,_0x143fa1,_0x278fa7,_0x5a7b07,_0x13d91c,_0x1bec17){return new Promise(function(_0xa4c926,_0x47c042){return getAuthToken(_0x4cb9d1,_0x143fa1,_0x13d91c)[_0x5912('0x14')](function(_0x32fe48){var _0x4ac42e=_0x13d91c[_0x5912('0x2b')]()===_0x5912('0x2c')?_0x5a7b07['destcalleridnum']:_0x5a7b07[_0x5912('0x2d')];var _0x419826={'method':_0x5912('0x10'),'uri':_0x278fa7+'contacts','body':{'fullname':_0x4ac42e,'firstname':_0x4ac42e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5912('0x2e')+_0x585e07[_0x5912('0x26')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x32fe48,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x419826[_0x5912('0x2f')][_0x1bec17]=_0x4ac42e;return rp(_0x419826);})[_0x5912('0x14')](function(_0x3b01c4){var _0x36529b=_0x3b01c4[_0x5912('0x30')][_0x5912('0x31')];var _0x1c5324=_0x36529b[_0x5912('0x32')](_0x36529b[_0x5912('0x33')]('(')+0x1,_0x36529b['lastIndexOf'](')'));_0x585e07[_0x5912('0x34')]=_0x1c5324;_0xa4c926(_0x585e07);})[_0x5912('0x16')](function(_0x1de72a){_0x47c042(_0x1de72a[_0x5912('0x2a')]);});});}function getEndUser(_0x1b7ac9,_0x448b76,_0x4c1e04,_0x5c74f4,_0x4dad06,_0x13fb08,_0x5b6c1d,_0x3a1fca){var _0x1a50ab=_0x13fb08[_0x5912('0x2b')]()===_0x5912('0x2c')?_0x4dad06[_0x5912('0x35')]:_0x4dad06[_0x5912('0x2d')];return getAuthToken(_0x448b76,_0x4c1e04,_0x13fb08)[_0x5912('0x14')](function(_0x309e37){_0x3a1fca=_0x3a1fca?_0x3a1fca:_0x5912('0x36');var _0x2224a0={'method':_0x5912('0x37'),'uri':_0x5c74f4+_0x5912('0x38')+_0x3a1fca+'&$filter='+_0x3a1fca+_0x5912('0x39')+_0x1a50ab['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x5912('0x19')+_0x309e37,'If-None-Match':null,'OData-Version':_0x5912('0x1a')},'json':!![]};return rp(_0x2224a0);})[_0x5912('0x14')](function(_0x1a8b32){var _0x46940e=![];if(!_0x1a8b32)return _0x46940e;var _0x1b891b=_0x1a8b32[_0x5912('0x1b')];for(var _0x5c44cc=0x0;_0x5c44cc<_0x1b891b[_0x5912('0x29')];_0x5c44cc++){if(_0x1b891b[_0x5c44cc][_0x3a1fca]===_0x1a50ab){_0x46940e=!![];_0x1b7ac9[_0x5912('0x34')]=_0x1b891b[_0x5c44cc][_0x5912('0x3a')];}}return _0x46940e;})[_0x5912('0x14')](function(_0x555bda){if(_0x555bda)return _0x1b7ac9;if(_0x5b6c1d==='nothing'){logger[_0x5912('0x22')]('['+[_0x13fb08['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1b7ac9;}return createEndUser(_0x1b7ac9,_0x448b76,_0x4c1e04,_0x5c74f4,_0x4dad06,_0x13fb08,_0x3a1fca)['then'](function(_0x46500d){logger[_0x5912('0x22')]('['+[_0x13fb08[_0x5912('0x23')]()]+_0x5912('0x3b'),_0x46500d[_0x5912('0x34')]);return _0x46500d;});});}function getCustomFields(_0x59845e,_0x1ffa80,_0x56c940){var _0xfe5adb={};if(_0x59845e[_0x5912('0x29')]>0x0){_[_0x5912('0x3c')](_0x59845e,function(_0x1c4470){if(_[_0x5912('0x3d')]([_0x5912('0x3e'),_0x5912('0x3f')],_0x1c4470['type'])&&_0x1c4470[_0x5912('0x40')]&&!_0x1c4470['customField']){var _0x180ceb=_0x1c4470[_0x5912('0x41')]['toLowerCase']();var _0x3e0893=_0x180ceb['substring'](0x0,_0x180ceb['indexOf']('_'));var _0x45d25a=_0x180ceb[_0x5912('0x32')](_0x180ceb[_0x5912('0x42')]('_')+0x1);if(_0x3e0893===_0x56c940){_0xfe5adb[_0x45d25a]=_0x1c4470[_0x5912('0x43')];}}});}return _0xfe5adb;}function getTicket(_0x53f181,_0x18c349,_0x5086b6,_0xdd8684,_0x12a061,_0x3668d6,_0x17cc4b){return new Promise(function(_0x4f7d37,_0x469e6b){var _0x109b58;return getAuthToken(_0x18c349,_0x5086b6,_0x17cc4b)['then'](function(_0x5cf1ad){if(_0x3668d6['ticketType']===_0x5912('0x44')){_0x109b58={'method':_0x5912('0x10'),'uri':_0xdd8684+'incidents','body':Object[_0x5912('0x45')]({},{'title':intUtil[_0x5912('0x46')](_0x3668d6[_0x5912('0x47')],_0x12a061,'\x20'),'description':intUtil[_0x5912('0x46')](_0x3668d6[_0x5912('0x48')],_0x12a061,'\x0a'),'customerid_contact@odata.bind':_0x53f181[_0x5912('0x34')]?_0x5912('0x49')+_0x53f181[_0x5912('0x34')]+')':undefined,'ownerid@odata.bind':_0x5912('0x2e')+_0x53f181[_0x5912('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x3668d6[_0x5912('0x4a')],_0x12a061,_0x3668d6['ticketType'])),'headers':{'Authorization':_0x5912('0x19')+_0x5cf1ad,'OData-Version':_0x5912('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3668d6[_0x5912('0x4b')]===_0x5912('0x4c')){var _0x2971fb=_0x53f181[_0x5912('0x34')]?[{'partyid_systemuser@odata.bind':_0x5912('0x2e')+_0x53f181[_0x5912('0x26')]+')','participationtypemask':_0x53f181['callDirection']===_0x5912('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x53f181[_0x5912('0x34')]+')','participationtypemask':_0x53f181[_0x5912('0x4e')]===_0x5912('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5912('0x2e')+_0x53f181[_0x5912('0x26')]+')','participationtypemask':_0x53f181[_0x5912('0x4e')]===_0x5912('0x4d')?0x2:0x1}];_0x109b58={'method':_0x5912('0x10'),'uri':_0xdd8684+_0x5912('0x4f'),'body':Object[_0x5912('0x45')]({},{'subject':intUtil[_0x5912('0x46')](_0x3668d6[_0x5912('0x47')],_0x12a061,'\x20'),'phonenumber':String(_0x12a061[_0x5912('0x2d')]),'description':intUtil[_0x5912('0x46')](_0x3668d6[_0x5912('0x48')],_0x12a061,'\x0a'),'regardingobjectid_contact@odata.bind':_0x53f181['enduserId']?'/contacts('+_0x53f181[_0x5912('0x34')]+')':undefined,'ownerid@odata.bind':_0x5912('0x2e')+_0x53f181[_0x5912('0x26')]+')','directioncode':_0x53f181[_0x5912('0x4e')]===_0x5912('0x4d')?![]:!![],'phonecall_activity_parties':_0x2971fb},getCustomFields(_0x3668d6['Fields'],_0x12a061,_0x3668d6['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x5cf1ad,'OData-Version':_0x5912('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x109b58);})['then'](function(_0x308868){var _0x26ffe5=_0x308868['headers']['odata-entityid'];var _0x8f24e3=_0x26ffe5[_0x5912('0x32')](_0x26ffe5['lastIndexOf']('(')+0x1,_0x26ffe5['lastIndexOf'](')'));_0x53f181[_0x5912('0x50')]=_0x8f24e3;_0x4f7d37(_0x53f181);})[_0x5912('0x16')](function(_0xc365e3){_0x469e6b(_0xc365e3[_0x5912('0x2a')]);});});}function emit(_0x511dc8,_0x3db87e,_0x189590,_0x2e93ad){var _0x373e5c={'uri':util[_0x5912('0x51')](_0x5912('0x52'),_0x511dc8,_0x189590,_0x2e93ad)};io['to'](util[_0x5912('0x51')](_0x5912('0x53'),_0x3db87e))[_0x5912('0x54')]('trigger:browser:url',_0x373e5c);}exports['cs']=function(_0x22fb11,_0x1f1c88,_0x2fb19f,_0x3d4f1c,_0x4920d5,_0x5f5ad7,_0x158b75,_0x273fca){var _0x14e217={};_0x5f5ad7[_0x5912('0xa')]=_0x5f5ad7[_0x5912('0x9')]?intUtil[_0x5912('0x55')](_0x5f5ad7[_0x5912('0xb')][_0x5912('0x56')]):intUtil[_0x5912('0x55')](_0x5f5ad7[_0x5912('0xa')]);_0x5f5ad7[_0x5912('0x57')]=intUtil[_0x5912('0x55')](_0x5f5ad7['serverUrl']);_0x14e217[_0x5912('0x4e')]=_0x273fca===_0x5912('0x4d')||_0x273fca===_0x5912('0x58')?_0x5912('0x4d'):'outbound';var _0x37ad54=_0x5f5ad7[_0x5912('0x9')]?util[_0x5912('0x51')](_0x5912('0x59'),_0x5f5ad7[_0x5912('0xb')][_0x5912('0x56')]):util[_0x5912('0x51')]('%s/api/data/v9.0/',_0x5f5ad7[_0x5912('0xa')]);var _0x1b0e47=util[_0x5912('0x51')](_0x5912('0x5a'),_0x5f5ad7[_0x5912('0xc')]);var _0x260d34=util[_0x5912('0x51')](_0x5912('0x5b'),_0x5f5ad7[_0x5912('0x57')],_0x1f1c88[_0x5912('0x5c')],md5(_0x1f1c88[_0x5912('0x5c')]));if(_0x4920d5&&_0x4920d5[_0x5912('0x5d')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x1f1c88[_0x5912('0x5e')]=_0x260d34;}else if(_0x158b75&&_0x158b75[_0x5912('0x5f')]&&_0x158b75[_0x5912('0x5f')]!=='none'){logger['info'](_0x5912('0x60'),_0x5912('0x61'));_0x1f1c88['recordingURL']=_0x260d34;}else{_0x1f1c88[_0x5912('0x5e')]='';}return getUser(_0x14e217,_0x5f5ad7,_0x3d4f1c,_0x1b0e47,_0x37ad54,_0x273fca)[_0x5912('0x14')](function(_0xbaf547){logger[_0x5912('0x22')]('['+_0x273fca[_0x5912('0x23')]()+']\x20The\x20User\x20ID\x20is:',_0xbaf547[_0x5912('0x26')]);logger['info']('['+_0x273fca[_0x5912('0x23')]()+_0x5912('0x62'),_0xbaf547['userEmail']);return getEndUser(_0xbaf547,_0x5f5ad7,_0x1b0e47,_0x37ad54,_0x1f1c88,_0x273fca,_0x2fb19f[_0x5912('0x63')],_0x2fb19f[_0x5912('0x64')]);})[_0x5912('0x14')](function(_0x4612d0){logger[_0x5912('0x22')]('['+_0x273fca[_0x5912('0x23')]()+_0x5912('0x65'),_0x4612d0['enduserId']);logger[_0x5912('0x22')]('['+_0x273fca[_0x5912('0x23')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x1f1c88['calleridnum']);return getTicket(_0x4612d0,_0x5f5ad7,_0x1b0e47,_0x37ad54,_0x1f1c88,_0x2fb19f,_0x273fca);})[_0x5912('0x14')](function(_0x2a97c6){logger['info'](util[_0x5912('0x51')]('['+_0x273fca[_0x5912('0x23')]()+_0x5912('0x66'),_0x2fb19f[_0x5912('0x4b')],_0x2a97c6[_0x5912('0x50')]));logger[_0x5912('0x22')](util['format']('['+_0x273fca['toUpperCase']()+_0x5912('0x67'),_0x273fca));if(_0x273fca!==_0x5912('0x58')&&_0x2fb19f[_0x5912('0x68')]){logger[_0x5912('0x22')]('['+_0x273fca['toUpperCase']()+']',_0x5912('0x69'));emit(_0x5f5ad7[_0x5912('0xa')],_0x3d4f1c['name'],_0x2fb19f['ticketType'],_0x2a97c6[_0x5912('0x50')]);}})['catch'](function(_0xa6cd21){logger[_0x5912('0x17')]('['+_0x273fca[_0x5912('0x23')]()+_0x5912('0x6a'),_0xa6cd21['message']);console[_0x5912('0x17')](_0x5912('0x6b'),_0xa6cd21);});}; \ No newline at end of file +var _0xeb7f=['destcalleridnum','/systemusers(','body','headers','odata-entityid','lastIndexOf','calleridnum','telephone1','contacts?$select=','replace','%2b','Bearer\x20','contactid','nothing',']\x20Enduser\x20created!','enduserId','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','incident','POST','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','substring','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','%s/api/data/v9.0/','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','data2','resolve','data5','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase','then','GET','4.0','value','isNil','validateEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','message','toLowerCase','outbound'];(function(_0x198164,_0x4269db){var _0x351451=function(_0xef73da){while(--_0xef73da){_0x198164['push'](_0x198164['shift']());}};_0x351451(++_0x4269db);}(_0xeb7f,0x185));var _0xfeb7=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xeb7f[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xfeb7('0x0'));var rp=require(_0xfeb7('0x1'));var util=require(_0xfeb7('0x2'));var intUtil=require(_0xfeb7('0x3'));var md5=require(_0xfeb7('0x4'));var Redis=require(_0xfeb7('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config[_0xfeb7('0x6')]=_[_0xfeb7('0x7')](config[_0xfeb7('0x6')],{'host':_0xfeb7('0x8'),'port':0x18eb});var io=require(_0xfeb7('0x9'))(new Redis(config[_0xfeb7('0x6')]));function getAuthToken(_0x471805,_0x1d8017,_0x446b55){if(_0x471805[_0xfeb7('0xa')]){_0x471805['remoteUri']=_0x471805[_0xfeb7('0xb')]['data7'];_0x471805[_0xfeb7('0xc')]=_0x471805[_0xfeb7('0xb')][_0xfeb7('0xd')];return Promise[_0xfeb7('0xe')](_0x471805[_0xfeb7('0xb')][_0xfeb7('0xf')]);}var _0x3c65d4={'method':'POST','uri':_0x1d8017,'form':{'client_id':_0x471805[_0xfeb7('0x10')],'resource':_0x471805[_0xfeb7('0x11')],'username':_0x471805['username'],'password':_0x471805[_0xfeb7('0x12')],'grant_type':_0xfeb7('0x12'),'client_secret':_0x471805[_0xfeb7('0x13')]},'json':!![]};return rp(_0x3c65d4)['then'](function(_0x323b7e){return _0x323b7e[_0xfeb7('0x14')];})[_0xfeb7('0x15')](function(_0x52956e){logger[_0xfeb7('0x16')]('['+[_0x446b55[_0xfeb7('0x17')]()]+']\x20Wrong\x20credentials!');return _0x52956e['message'];});}function getUser(_0x461614,_0x1cfca3,_0x24ed4a,_0x540201,_0xd52811,_0x3a42ac){return new Promise(function(_0x35ffdf,_0x508fe2){return getAuthToken(_0x1cfca3,_0x540201,_0x3a42ac)[_0xfeb7('0x18')](function(_0xe8a0b9){var _0x50aa03={'method':_0xfeb7('0x19'),'uri':_0xd52811+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0xe8a0b9,'OData-Version':_0xfeb7('0x1a')},'json':!![]};return rp(_0x50aa03);})['then'](function(_0x281d9e){var _0x20cb06=_0x281d9e[_0xfeb7('0x1b')];var _0x300bcd=![];var _0x2d9231=null;if(!_[_0xfeb7('0x1c')](_0x24ed4a)){if(intUtil[_0xfeb7('0x1d')](_0x24ed4a[_0xfeb7('0x1e')])){_0x461614['userEmail']=_0x24ed4a[_0xfeb7('0x1e')];for(_0x2d9231=0x0;_0x2d9231<_0x20cb06[_0xfeb7('0x1f')];_0x2d9231++){if(_0x20cb06[_0x2d9231][_0xfeb7('0x20')]===_0x24ed4a[_0xfeb7('0x1e')]&&!_0x20cb06[_0x2d9231]['isdisabled']){_0x300bcd=!![];logger[_0xfeb7('0x21')]('['+[_0x3a42ac[_0xfeb7('0x17')]()]+_0xfeb7('0x22')+_0x20cb06[_0x2d9231][_0xfeb7('0x23')]+'!');_0x461614[_0xfeb7('0x24')]=_0x20cb06[_0x2d9231][_0xfeb7('0x23')];}}}}if(!_0x300bcd){logger[_0xfeb7('0x21')]('['+[_0x3a42ac['toUpperCase']()]+_0xfeb7('0x25'));_0x461614[_0xfeb7('0x26')]=_0x1cfca3[_0xfeb7('0x27')];for(_0x2d9231=0x0;_0x2d9231<_0x20cb06[_0xfeb7('0x1f')];_0x2d9231++){if(_0x20cb06[_0x2d9231][_0xfeb7('0x20')]===_0x1cfca3[_0xfeb7('0x27')]){_0x461614[_0xfeb7('0x24')]=_0x20cb06[_0x2d9231]['systemuserid'];}}}_0x35ffdf(_0x461614);})[_0xfeb7('0x15')](function(_0x3740f1){_0x508fe2(_0x3740f1[_0xfeb7('0x28')]);});});}function createEndUser(_0x232e45,_0x5c4fdd,_0x2fae97,_0x59e909,_0x190481,_0x3bc544,_0x54b2bc){return new Promise(function(_0x5f2861,_0x4b7ab2){return getAuthToken(_0x5c4fdd,_0x2fae97,_0x3bc544)[_0xfeb7('0x18')](function(_0x2dc835){var _0x2128c0=_0x3bc544[_0xfeb7('0x29')]()===_0xfeb7('0x2a')?_0x190481[_0xfeb7('0x2b')]:_0x190481['calleridnum'];var _0x5879a6={'method':'POST','uri':_0x59e909+'contacts','body':{'fullname':_0x2128c0,'firstname':_0x2128c0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfeb7('0x2c')+_0x232e45[_0xfeb7('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2dc835,'OData-Version':_0xfeb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x5879a6[_0xfeb7('0x2d')][_0x54b2bc]=_0x2128c0;return rp(_0x5879a6);})['then'](function(_0xd3a15a){var _0x402ad3=_0xd3a15a[_0xfeb7('0x2e')][_0xfeb7('0x2f')];var _0x4f1dfd=_0x402ad3['substring'](_0x402ad3[_0xfeb7('0x30')]('(')+0x1,_0x402ad3[_0xfeb7('0x30')](')'));_0x232e45['enduserId']=_0x4f1dfd;_0x5f2861(_0x232e45);})[_0xfeb7('0x15')](function(_0x30816f){_0x4b7ab2(_0x30816f[_0xfeb7('0x28')]);});});}function getEndUser(_0x3133bf,_0xdd148a,_0x12de00,_0x1836de,_0x40a912,_0x1f4c5e,_0xcf100c,_0x19ee41){var _0xf877c1=_0x1f4c5e[_0xfeb7('0x29')]()===_0xfeb7('0x2a')?_0x40a912[_0xfeb7('0x2b')]:_0x40a912[_0xfeb7('0x31')];return getAuthToken(_0xdd148a,_0x12de00,_0x1f4c5e)[_0xfeb7('0x18')](function(_0x2d9666){_0x19ee41=_0x19ee41?_0x19ee41:_0xfeb7('0x32');var _0x40a5a9={'method':_0xfeb7('0x19'),'uri':_0x1836de+_0xfeb7('0x33')+_0x19ee41+'&$filter='+_0x19ee41+'\x20eq\x20\x27'+_0xf877c1[_0xfeb7('0x34')]('+',_0xfeb7('0x35'))+'\x27','headers':{'Authorization':_0xfeb7('0x36')+_0x2d9666,'If-None-Match':null,'OData-Version':_0xfeb7('0x1a')},'json':!![]};return rp(_0x40a5a9);})[_0xfeb7('0x18')](function(_0x3fb1c0){var _0x8fa789=![];if(!_0x3fb1c0)return _0x8fa789;var _0x5a062d=_0x3fb1c0[_0xfeb7('0x1b')];for(var _0x1c3cb0=0x0;_0x1c3cb0<_0x5a062d[_0xfeb7('0x1f')];_0x1c3cb0++){if(_0x5a062d[_0x1c3cb0][_0x19ee41]===_0xf877c1){_0x8fa789=!![];_0x3133bf['enduserId']=_0x5a062d[_0x1c3cb0][_0xfeb7('0x37')];}}return _0x8fa789;})[_0xfeb7('0x18')](function(_0x4d5f18){if(_0x4d5f18)return _0x3133bf;if(_0xcf100c===_0xfeb7('0x38')){logger[_0xfeb7('0x21')]('['+[_0x1f4c5e[_0xfeb7('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x3133bf;}return createEndUser(_0x3133bf,_0xdd148a,_0x12de00,_0x1836de,_0x40a912,_0x1f4c5e,_0x19ee41)[_0xfeb7('0x18')](function(_0x1c6f16){logger[_0xfeb7('0x21')]('['+[_0x1f4c5e['toUpperCase']()]+_0xfeb7('0x39'),_0x1c6f16[_0xfeb7('0x3a')]);return _0x1c6f16;});});}function getCustomFields(_0x33a331,_0x50615d,_0x39bcf3){var _0x49680d={};if(_0x33a331[_0xfeb7('0x1f')]>0x0){_[_0xfeb7('0x3b')](_0x33a331,function(_0x1d7202){if(_[_0xfeb7('0x3c')](['string',_0xfeb7('0x3d')],_0x1d7202[_0xfeb7('0x3e')])&&_0x1d7202[_0xfeb7('0x3f')]&&!_0x1d7202[_0xfeb7('0x40')]){var _0x3a9ad0=_0x1d7202[_0xfeb7('0x41')]['toLowerCase']();var _0x2cf4e9=_0x3a9ad0['substring'](0x0,_0x3a9ad0['indexOf']('_'));var _0x576da2=_0x3a9ad0['substring'](_0x3a9ad0[_0xfeb7('0x42')]('_')+0x1);if(_0x2cf4e9===_0x39bcf3){_0x49680d[_0x576da2]=_0x1d7202[_0xfeb7('0x43')];}}});}return _0x49680d;}function getTicket(_0xb32a21,_0x338e1b,_0x363935,_0x367508,_0x3db2ea,_0x2f5512,_0x3dc0c8){return new Promise(function(_0x429d2b,_0x3b1f99){var _0x5aa500;return getAuthToken(_0x338e1b,_0x363935,_0x3dc0c8)[_0xfeb7('0x18')](function(_0x21093a){if(_0x2f5512['ticketType']===_0xfeb7('0x44')){_0x5aa500={'method':_0xfeb7('0x45'),'uri':_0x367508+_0xfeb7('0x46'),'body':Object[_0xfeb7('0x47')]({},{'title':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x49')],_0x3db2ea,'\x20'),'description':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x4a')],_0x3db2ea,'\x0a'),'customerid_contact@odata.bind':_0xb32a21[_0xfeb7('0x3a')]?_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')':undefined,'ownerid@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2f5512[_0xfeb7('0x4c')],_0x3db2ea,_0x2f5512[_0xfeb7('0x4d')])),'headers':{'Authorization':_0xfeb7('0x36')+_0x21093a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2f5512[_0xfeb7('0x4d')]===_0xfeb7('0x4e')){var _0xee54c2=_0xb32a21[_0xfeb7('0x3a')]?[{'partyid_systemuser@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','participationtypemask':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?0x2:0x1},{'partyid_contact@odata.bind':_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')','participationtypemask':_0xb32a21['callDirection']===_0xfeb7('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','participationtypemask':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?0x2:0x1}];_0x5aa500={'method':_0xfeb7('0x45'),'uri':_0x367508+_0xfeb7('0x51'),'body':Object['assign']({},{'subject':intUtil[_0xfeb7('0x48')](_0x2f5512['Subjects'],_0x3db2ea,'\x20'),'phonenumber':String(_0x3db2ea['calleridnum']),'description':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x4a')],_0x3db2ea,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb32a21['enduserId']?_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')':undefined,'ownerid@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','directioncode':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?![]:!![],'phonecall_activity_parties':_0xee54c2},getCustomFields(_0x2f5512[_0xfeb7('0x4c')],_0x3db2ea,_0x2f5512[_0xfeb7('0x4d')])),'headers':{'Authorization':'Bearer\x20'+_0x21093a,'OData-Version':_0xfeb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5aa500);})['then'](function(_0x145f2e){var _0x1678e6=_0x145f2e[_0xfeb7('0x2e')][_0xfeb7('0x2f')];var _0xc495ed=_0x1678e6[_0xfeb7('0x52')](_0x1678e6['lastIndexOf']('(')+0x1,_0x1678e6[_0xfeb7('0x30')](')'));_0xb32a21['ticketId']=_0xc495ed;_0x429d2b(_0xb32a21);})['catch'](function(_0x335312){_0x3b1f99(_0x335312[_0xfeb7('0x28')]);});});}function emit(_0x4e3224,_0x284466,_0x1af222,_0x327d88){var _0x3b6d66={'uri':util[_0xfeb7('0x53')](_0xfeb7('0x54'),_0x4e3224,_0x1af222,_0x327d88)};io['to'](util[_0xfeb7('0x53')]('user:%s',_0x284466))[_0xfeb7('0x55')](_0xfeb7('0x56'),_0x3b6d66);}exports['cs']=function(_0x11e19b,_0x18fa04,_0xbe215b,_0x44385e,_0x47f104,_0xf91878,_0x484b0d,_0x5c955f){var _0x459a8b={};_0xf91878['remoteUri']=_0xf91878[_0xfeb7('0xa')]?intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0xb')][_0xfeb7('0x58')]):intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0x11')]);_0xf91878[_0xfeb7('0x59')]=intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0x59')]);_0x459a8b[_0xfeb7('0x4f')]=_0x5c955f==='queue'||_0x5c955f==='unmanaged'?_0xfeb7('0x50'):'outbound';var _0x5cc5bf=_0xf91878[_0xfeb7('0xa')]?util[_0xfeb7('0x53')](_0xfeb7('0x5a'),_0xf91878[_0xfeb7('0xb')][_0xfeb7('0x58')]):util[_0xfeb7('0x53')]('%s/api/data/v9.0/',_0xf91878[_0xfeb7('0x11')]);var _0x1aa2f8=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0xf91878[_0xfeb7('0xc')]);var _0x21f273=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf91878[_0xfeb7('0x59')],_0x18fa04['uniqueid'],md5(_0x18fa04[_0xfeb7('0x5b')]));if(_0x47f104&&_0x47f104[_0xfeb7('0x5c')]){logger[_0xfeb7('0x21')]('[QUEUE]','Recording\x20is\x20enabled!');_0x18fa04[_0xfeb7('0x5d')]=_0x21f273;}else if(_0x484b0d&&_0x484b0d[_0xfeb7('0x5e')]&&_0x484b0d[_0xfeb7('0x5e')]!==_0xfeb7('0x5f')){logger[_0xfeb7('0x21')](_0xfeb7('0x60'),_0xfeb7('0x61'));_0x18fa04[_0xfeb7('0x5d')]=_0x21f273;}else{_0x18fa04[_0xfeb7('0x5d')]='';}return getUser(_0x459a8b,_0xf91878,_0x44385e,_0x1aa2f8,_0x5cc5bf,_0x5c955f)[_0xfeb7('0x18')](function(_0x1bd0df){logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x62'),_0x1bd0df['userId']);logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+']\x20The\x20User\x20email\x20is:',_0x1bd0df['userEmail']);return getEndUser(_0x1bd0df,_0xf91878,_0x1aa2f8,_0x5cc5bf,_0x18fa04,_0x5c955f,_0xbe215b['moduleCreate'],_0xbe215b[_0xfeb7('0x63')]);})[_0xfeb7('0x18')](function(_0x5db8f3){logger['info']('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x64'),_0x5db8f3['enduserId']);logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x65'),_0x18fa04[_0xfeb7('0x31')]);return getTicket(_0x5db8f3,_0xf91878,_0x1aa2f8,_0x5cc5bf,_0x18fa04,_0xbe215b,_0x5c955f);})[_0xfeb7('0x18')](function(_0x239476){logger[_0xfeb7('0x21')](util['format']('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x66'),_0xbe215b[_0xfeb7('0x4d')],_0x239476['ticketId']));logger['info'](util[_0xfeb7('0x53')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x67'),_0x5c955f));if(_0x5c955f!==_0xfeb7('0x68')&&_0xbe215b[_0xfeb7('0x69')]){logger['info']('['+_0x5c955f[_0xfeb7('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xf91878[_0xfeb7('0x11')],_0x44385e[_0xfeb7('0x6a')],_0xbe215b[_0xfeb7('0x4d')],_0x239476['ticketId']);}})[_0xfeb7('0x15')](function(_0x3de77d){logger[_0xfeb7('0x16')]('['+_0x5c955f['toUpperCase']()+_0xfeb7('0x6b'),_0x3de77d[_0xfeb7('0x28')]);console[_0xfeb7('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x3de77d);});}; \ 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 31f69ce..78760b5 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 _0x48d4=['unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','getString','Subjects','
','name','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','stringify','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','catch'];(function(_0x5dcdca,_0x1f2b6c){var _0x9ad7a1=function(_0x59311f){while(--_0x59311f){_0x5dcdca['push'](_0x5dcdca['shift']());}};_0x9ad7a1(++_0x1f2b6c);}(_0x48d4,0x167));var _0x448d=function(_0x42dde7,_0x108cab){_0x42dde7=_0x42dde7-0x0;var _0x13fc94=_0x48d4[_0x42dde7];return _0x13fc94;};'use strict';var _=require(_0x448d('0x0'));var rp=require(_0x448d('0x1'));var md5=require('md5');var util=require(_0x448d('0x2'));var Redis=require(_0x448d('0x3'));var intUtil=require(_0x448d('0x4'));var config=require(_0x448d('0x5'));var logger=require(_0x448d('0x6'))(_0x448d('0x7'));config[_0x448d('0x8')]=_['defaults'](config['redis'],{'host':_0x448d('0x9'),'port':0x18eb});var io=require(_0x448d('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x448d('0xb'),'Accept':_0x448d('0xb')};function emit(_0x269a7b,_0x3f8132,_0x180b96){io['to'](_0x269a7b)['emit'](_0x3f8132,_0x180b96);}function getTicket(_0x11f918,_0x534d1c,_0x5df2eb,_0x1e529a,_0x3c0794){logger[_0x448d('0xc')](_0x448d('0xd'));var _0x4ae3ed=_[_0x448d('0xe')]({'responder_id':_0x534d1c['id'],'requester_id':_0x5df2eb['id'],'name':util['format']('Caller\x20-\x20%s',_0x3c0794[_0x448d('0xf')]),'phone':_0x3c0794[_0x448d('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x448d('0x11')](_0x1e529a[_0x448d('0x12')],_0x3c0794,'\x20'),'description':intUtil[_0x448d('0x11')](_0x1e529a['Descriptions'],_0x3c0794,_0x448d('0x13')),'tags':getTags(_0x1e529a['Tags'],_0x448d('0x14'))},getCustomFields(_0x1e529a[_0x448d('0x15')],_0x3c0794));_0x4ae3ed[_0x448d('0x16')]=_[_0x448d('0x17')](_['keyBy'](_0x4ae3ed[_0x448d('0x16')],'id'),_0x448d('0x18'));return request({'uri':util[_0x448d('0x19')](_0x448d('0x1a'),_0x11f918[_0x448d('0x1b')]),'method':_0x448d('0x1c'),'body':_0x4ae3ed})[_0x448d('0x1d')](function(_0x9858db){logger['info'](_0x448d('0x1e'));return _0x9858db;});}function getUser(_0x4ea6ba,_0x385d5a){if(intUtil[_0x448d('0x1f')](_0x385d5a)){return request({'uri':util['format'](_0x448d('0x20'),_0x4ea6ba[_0x448d('0x1b')]),'qs':{'email':_0x385d5a}})[_0x448d('0x1d')](function(_0x45c7fd){if(_0x45c7fd[_0x448d('0x21')]){logger['info']('Agent\x20found!');return _[_0x448d('0x22')](_0x45c7fd,function(_0x7aab3e){return _0x7aab3e[_0x448d('0x23')][_0x448d('0x24')]===_0x385d5a;});}else{logger['info'](_0x448d('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x4ea6ba['remoteUri'])})[_0x448d('0x1d')](function(_0x19b6fd){logger[_0x448d('0xc')](_0x448d('0x26'));return _0x19b6fd;});}});}else{logger['info'](_0x448d('0x27'));return request({'uri':util[_0x448d('0x19')](_0x448d('0x28'),_0x4ea6ba[_0x448d('0x1b')])})['then'](function(_0x3446ce){logger['info']('Admin\x20account\x20selected.');return _0x3446ce;});}}function getEndUser(_0x23bd7f,_0x464fbe,_0x464f76){logger[_0x448d('0xc')](_0x448d('0x29'),_0x464f76);return request({'uri':util[_0x448d('0x19')](_0x448d('0x2a'),_0x23bd7f[_0x448d('0x1b')]),'qs':{'phone':_0x464f76}})[_0x448d('0x1d')](function(_0x2436a6){if(_0x2436a6[_0x448d('0x21')]){logger[_0x448d('0xc')](_0x448d('0x2b'));return _[_0x448d('0x22')](_0x2436a6,{'phone':_0x464f76});}else{logger[_0x448d('0xc')](_0x448d('0x2c'));return request({'uri':util[_0x448d('0x19')](_0x448d('0x2a'),_0x23bd7f['remoteUri']),'method':_0x448d('0x1c'),'body':{'name':_0x464fbe,'phone':_0x464f76}})[_0x448d('0x1d')](function(_0x5b2ab4){logger[_0x448d('0xc')]('Enduser\x20created.');return _0x5b2ab4;});}});}function getAuth(_0x65f911){return util[_0x448d('0x19')]('Basic\x20%s',new Buffer(_0x65f911[_0x448d('0x2d')]+':X')[_0x448d('0x2e')]('base64'));}function request(_0x5a3577){logger['debug']('[HTTP]',JSON[_0x448d('0x2f')](_0x5a3577));return rp(_['defaults'](_0x5a3577,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x27f785,_0x19439d){var _0x358667=[];if(_0x27f785&&_0x27f785[_0x448d('0x21')]>0x0){_0x358667=_[_0x448d('0x30')](_0x27f785,_0x19439d);}return _0x358667;}function getCustomFields(_0x44a356,_0x15c985){var _0x27fe42=[];var _0x3afa9b={'custom_fields':[]};if(_0x44a356[_0x448d('0x21')]>0x0){_[_0x448d('0x31')](_0x44a356,function(_0x27f554){if(_[_0x448d('0x32')]([_0x448d('0x33'),_0x448d('0x34')],_0x27f554['type'])&&_0x27f554[_0x448d('0x35')]&&!_0x27f554[_0x448d('0x36')]){_0x3afa9b[_0x27f554[_0x448d('0x35')][_0x448d('0x37')]()]=_0x27f554[_0x448d('0x38')][_0x448d('0x2e')]();}else if(_[_0x448d('0x32')]([_0x448d('0x33'),_0x448d('0x34')],_0x27f554[_0x448d('0x39')])&&_0x27f554[_0x448d('0x3a')]&&_0x27f554[_0x448d('0x36')]){_0x3afa9b[_0x448d('0x16')][_0x448d('0x3b')]({'id':_0x27f554[_0x448d('0x3a')],'value':_0x27f554[_0x448d('0x38')]['toString']()});}else if(_0x27f554[_0x448d('0x39')]===_0x448d('0x3c')&&_0x27f554[_0x448d('0x3d')]&&_0x27f554['idField']&&_0x27f554[_0x448d('0x36')]){_0x15c985[_0x27f554[_0x448d('0x3d')]]&&_0x3afa9b[_0x448d('0x16')][_0x448d('0x3b')]({'id':_0x27f554[_0x448d('0x3a')],'value':_0x15c985[_0x27f554[_0x448d('0x3d')]]['toString']()});}else if(_0x27f554[_0x448d('0x39')]===_0x448d('0x3e')&&_0x27f554[_0x448d('0x3f')]&&_0x27f554[_0x448d('0x3f')][_0x448d('0x14')]&&_0x27f554[_0x448d('0x3a')]&&_0x27f554[_0x448d('0x36')]){_0x15c985[_0x27f554[_0x448d('0x3f')][_0x448d('0x14')][_0x448d('0x37')]()]&&_0x3afa9b[_0x448d('0x16')][_0x448d('0x3b')]({'id':_0x27f554[_0x448d('0x3a')],'value':_0x15c985[_0x27f554[_0x448d('0x3f')]['name'][_0x448d('0x37')]()][_0x448d('0x2e')]()});}});}return _0x3afa9b;}exports[_0x448d('0x40')]=function(_0x59e5d4,_0x2bb226,_0x412489,_0x677042,_0x3f72f0,_0x5a77ce){var _0xfd1078,_0x29ef67;_0x5a77ce[_0x448d('0x1b')]=intUtil[_0x448d('0x41')](_0x5a77ce[_0x448d('0x1b')]);_0x5a77ce[_0x448d('0x42')]=intUtil['stripTrailingSlash'](_0x5a77ce[_0x448d('0x42')]);if(_0x3f72f0&&_0x3f72f0[_0x448d('0x43')]){logger[_0x448d('0xc')](_0x448d('0x44'),_0x448d('0x45'));_0x2bb226[_0x448d('0x46')]=util[_0x448d('0x19')](_0x448d('0x47'),_0x5a77ce[_0x448d('0x42')],_0x2bb226[_0x448d('0x48')],md5(_0x2bb226[_0x448d('0x48')]));}else{_0x2bb226[_0x448d('0x46')]='';}headers[_0x448d('0x49')]=getAuth(_0x5a77ce);return getUser(_0x5a77ce,_0x677042[_0x448d('0x24')])[_0x448d('0x1d')](function(_0x394a33){_0xfd1078=_0x394a33;logger['info'](_0x448d('0x4a'),_0xfd1078['id']);return getEndUser(_0x5a77ce,_0x2bb226['calleridname'],_0x2bb226[_0x448d('0x10')]);})[_0x448d('0x1d')](function(_0x4ea399){_0x29ef67=_0x4ea399;logger[_0x448d('0xc')](_0x448d('0x4b'),_0x29ef67['id']);return getTicket(_0x5a77ce,_0xfd1078,_0x29ef67,_0x412489,_0x2bb226);})[_0x448d('0x1d')](function(_0xb1f1cc){if(_0xb1f1cc&&_0xb1f1cc['id']){logger['info'](_0x448d('0x1e'));logger[_0x448d('0xc')]('The\x20Ticket\x20ID\x20is:',_0xb1f1cc['id']);logger[_0x448d('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x448d('0x19')](_0x448d('0x4c'),_0x677042[_0x448d('0x14')]),_0x448d('0x4d'),{'uri':util[_0x448d('0x19')](_0x448d('0x4e'),_0x5a77ce[_0x448d('0x1b')],_0xb1f1cc['id'])});}})['catch'](function(_0x3f4d10){logger[_0x448d('0x4f')](_0x448d('0x44'),JSON[_0x448d('0x2f')](_0x3f4d10));});};exports['outbound']=function(_0x82a309,_0x2aa1bb,_0x251363,_0x5ea164,_0x5086eb,_0x398378,_0xe5b094){var _0x40644c,_0x5f5d9c;_0x398378[_0x448d('0x1b')]=intUtil[_0x448d('0x41')](_0x398378[_0x448d('0x1b')]);_0x398378['serverUrl']=intUtil[_0x448d('0x41')](_0x398378['serverUrl']);if(_0xe5b094&&_0xe5b094[_0x448d('0x50')]&&_0xe5b094['recordingFormat']!==_0x448d('0x51')){logger[_0x448d('0xc')](_0x448d('0x52'),_0x448d('0x45'));_0x2aa1bb['recordingURL']=util[_0x448d('0x19')](_0x448d('0x47'),_0x398378[_0x448d('0x42')],_0x2aa1bb[_0x448d('0x48')],md5(_0x2aa1bb['uniqueid']));}headers[_0x448d('0x49')]=getAuth(_0x398378);return getUser(_0x398378,_0x5ea164[_0x448d('0x24')])[_0x448d('0x1d')](function(_0xaed084){_0x40644c=_0xaed084;logger[_0x448d('0xc')](_0x448d('0x4a'),_0x40644c['id']);return getEndUser(_0x398378,_0x2aa1bb[_0x448d('0x53')],_0x2aa1bb['destcalleridnum']);})[_0x448d('0x1d')](function(_0x275f45){_0x5f5d9c=_0x275f45;logger[_0x448d('0xc')](_0x448d('0x4b'),_0x5f5d9c['id']);return getTicket(_0x398378,_0x40644c,_0x5f5d9c,_0x251363,_0x2aa1bb);})[_0x448d('0x1d')](function(_0x58d971){if(_0x58d971&&_0x58d971['id']){logger[_0x448d('0xc')]('Ticket\x20created!');logger[_0x448d('0xc')](_0x448d('0x54'),_0x58d971['id']);logger['info'](_0x448d('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x448d('0x19')]('user:%s',_0x5ea164[_0x448d('0x14')]),'trigger:browser:url',{'uri':util[_0x448d('0x19')](_0x448d('0x4e'),_0x398378['remoteUri'],_0x58d971['id'])});}})[_0x448d('0x55')](function(_0x5c4ad3){logger['error']('[OUTBOUND]',JSON[_0x448d('0x2f')](_0x5c4ad3));});};exports[_0x448d('0x56')]=function(_0x454004,_0x5523c9,_0x226de2,_0x51d1a1,_0x276f0f,_0xf11189){var _0x2c114b,_0x2bd804;_0xf11189['remoteUri']=intUtil[_0x448d('0x41')](_0xf11189['remoteUri']);_0xf11189[_0x448d('0x42')]=intUtil['stripTrailingSlash'](_0xf11189[_0x448d('0x42')]);if(_0x276f0f&&_0x276f0f[_0x448d('0x43')]){logger[_0x448d('0xc')]('['+_0x5523c9[_0x448d('0x57')][_0x448d('0x58')]()+']',_0x448d('0x45'));_0x5523c9[_0x448d('0x46')]=util[_0x448d('0x19')](_0x448d('0x47'),_0xf11189[_0x448d('0x42')],_0x5523c9[_0x448d('0x48')],md5(_0x5523c9[_0x448d('0x48')]));}else{_0x5523c9[_0x448d('0x46')]='';}headers[_0x448d('0x49')]=getAuth(_0xf11189);return getUser(_0xf11189,'')[_0x448d('0x1d')](function(_0x591297){_0x2c114b=_0x591297;logger[_0x448d('0xc')](_0x448d('0x4a'),_0x2c114b['id']);return getEndUser(_0xf11189,_0x5523c9[_0x448d('0xf')],_0x5523c9['calleridnum']);})[_0x448d('0x1d')](function(_0x38a71a){_0x2bd804=_0x38a71a;logger['info'](_0x448d('0x4b'),_0x2bd804['id']);return getTicket(_0xf11189,_0x2c114b,_0x2bd804,_0x226de2,_0x5523c9);})['then'](function(_0x593037){if(_0x593037){logger['info'](_0x448d('0x1e'));logger[_0x448d('0xc')](_0x448d('0x54'),_0x593037['id']);}})['catch'](function(_0x993a9){logger['error']('['+_0x5523c9[_0x448d('0x57')]['toUpperCase']()+']',JSON[_0x448d('0x2f')](_0x993a9));});}; \ No newline at end of file +var _0xd951=['serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','calleridname','stringify','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','POST','then','info','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xd951,0xe3));var _0x1d95=function(_0x218fb6,_0x92897c){_0x218fb6=_0x218fb6-0x0;var _0x26d570=_0xd951[_0x218fb6];return _0x26d570;};'use strict';var _=require(_0x1d95('0x0'));var rp=require(_0x1d95('0x1'));var md5=require(_0x1d95('0x2'));var util=require('util');var Redis=require(_0x1d95('0x3'));var intUtil=require(_0x1d95('0x4'));var config=require(_0x1d95('0x5'));var logger=require(_0x1d95('0x6'))(_0x1d95('0x7'));config['redis']=_[_0x1d95('0x8')](config[_0x1d95('0x9')],{'host':_0x1d95('0xa'),'port':0x18eb});var io=require(_0x1d95('0xb'))(new Redis(config[_0x1d95('0x9')]));var headers={'Content-Type':_0x1d95('0xc'),'Accept':'application/json'};function emit(_0x382de1,_0xaf0c52,_0x52623f){io['to'](_0x382de1)[_0x1d95('0xd')](_0xaf0c52,_0x52623f);}function getTicket(_0x150830,_0x551f81,_0x4c0f45,_0x2527ad,_0x2e73e3){logger['info'](_0x1d95('0xe'));var _0x41d10c=_[_0x1d95('0xf')]({'responder_id':_0x551f81['id'],'requester_id':_0x4c0f45['id'],'name':util['format'](_0x1d95('0x10'),_0x2e73e3['calleridname']),'phone':_0x2e73e3[_0x1d95('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1d95('0x12')](_0x2527ad[_0x1d95('0x13')],_0x2e73e3,'\x20'),'description':intUtil[_0x1d95('0x12')](_0x2527ad[_0x1d95('0x14')],_0x2e73e3,_0x1d95('0x15')),'tags':getTags(_0x2527ad[_0x1d95('0x16')],_0x1d95('0x17'))},getCustomFields(_0x2527ad[_0x1d95('0x18')],_0x2e73e3));_0x41d10c['custom_fields']=_[_0x1d95('0x19')](_[_0x1d95('0x1a')](_0x41d10c[_0x1d95('0x1b')],'id'),_0x1d95('0x1c'));return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x1e'),_0x150830['remoteUri']),'method':_0x1d95('0x1f'),'body':_0x41d10c})[_0x1d95('0x20')](function(_0x4b2c6f){logger[_0x1d95('0x21')]('Ticket\x20created!');return _0x4b2c6f;});}function getUser(_0x57d17a,_0x2db7de){if(intUtil['validateEmail'](_0x2db7de)){return request({'uri':util['format'](_0x1d95('0x22'),_0x57d17a['remoteUri']),'qs':{'email':_0x2db7de}})[_0x1d95('0x20')](function(_0x4fabfb){if(_0x4fabfb[_0x1d95('0x23')]){logger[_0x1d95('0x21')](_0x1d95('0x24'));return _[_0x1d95('0x25')](_0x4fabfb,function(_0x387958){return _0x387958[_0x1d95('0x26')][_0x1d95('0x27')]===_0x2db7de;});}else{logger[_0x1d95('0x21')](_0x1d95('0x28'));return request({'uri':util[_0x1d95('0x1d')]('%s/api/v2/agents/me',_0x57d17a[_0x1d95('0x29')])})[_0x1d95('0x20')](function(_0x20f81d){logger[_0x1d95('0x21')](_0x1d95('0x2a'));return _0x20f81d;});}});}else{logger[_0x1d95('0x21')](_0x1d95('0x2b'));return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x2c'),_0x57d17a[_0x1d95('0x29')])})[_0x1d95('0x20')](function(_0x3ed40f){logger[_0x1d95('0x21')](_0x1d95('0x2a'));return _0x3ed40f;});}}function getEndUser(_0x1532cb,_0x43e408,_0x30e9f6){logger[_0x1d95('0x21')]('Searching\x20enduser\x20with\x20phone',_0x30e9f6);return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x2d'),_0x1532cb['remoteUri']),'qs':{'phone':_0x30e9f6}})[_0x1d95('0x20')](function(_0x2f7d58){if(_0x2f7d58[_0x1d95('0x23')]){logger[_0x1d95('0x21')](_0x1d95('0x2e'));return _[_0x1d95('0x25')](_0x2f7d58,{'phone':_0x30e9f6});}else{logger[_0x1d95('0x21')](_0x1d95('0x2f'));return request({'uri':util['format'](_0x1d95('0x2d'),_0x1532cb[_0x1d95('0x29')]),'method':_0x1d95('0x1f'),'body':{'name':_0x43e408,'phone':_0x30e9f6}})[_0x1d95('0x20')](function(_0x72e3d4){logger['info'](_0x1d95('0x30'));return _0x72e3d4;});}});}function getAuth(_0x10be9c){return util[_0x1d95('0x1d')](_0x1d95('0x31'),new Buffer(_0x10be9c[_0x1d95('0x32')]+':X')[_0x1d95('0x33')](_0x1d95('0x34')));}function request(_0x215baf){logger[_0x1d95('0x35')](_0x1d95('0x36'),JSON['stringify'](_0x215baf));return rp(_[_0x1d95('0x8')](_0x215baf,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x36c4a1,_0xe5322d){var _0xaae517=[];if(_0x36c4a1&&_0x36c4a1[_0x1d95('0x23')]>0x0){_0xaae517=_[_0x1d95('0x37')](_0x36c4a1,_0xe5322d);}return _0xaae517;}function getCustomFields(_0x5b726a,_0x50e763){var _0x28759e=[];var _0x59b1b9={'custom_fields':[]};if(_0x5b726a[_0x1d95('0x23')]>0x0){_[_0x1d95('0x38')](_0x5b726a,function(_0x450b7b){if(_[_0x1d95('0x39')]([_0x1d95('0x3a'),_0x1d95('0x3b')],_0x450b7b[_0x1d95('0x3c')])&&_0x450b7b[_0x1d95('0x3d')]&&!_0x450b7b[_0x1d95('0x3e')]){_0x59b1b9[_0x450b7b[_0x1d95('0x3d')][_0x1d95('0x3f')]()]=_0x450b7b[_0x1d95('0x40')][_0x1d95('0x33')]();}else if(_[_0x1d95('0x39')]([_0x1d95('0x3a'),'picklist'],_0x450b7b[_0x1d95('0x3c')])&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b[_0x1d95('0x3e')]){_0x59b1b9['custom_fields']['push']({'id':_0x450b7b[_0x1d95('0x41')],'value':_0x450b7b[_0x1d95('0x40')][_0x1d95('0x33')]()});}else if(_0x450b7b[_0x1d95('0x3c')]===_0x1d95('0x42')&&_0x450b7b[_0x1d95('0x43')]&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b[_0x1d95('0x3e')]){_0x50e763[_0x450b7b[_0x1d95('0x43')]]&&_0x59b1b9[_0x1d95('0x1b')][_0x1d95('0x44')]({'id':_0x450b7b[_0x1d95('0x41')],'value':_0x50e763[_0x450b7b[_0x1d95('0x43')]][_0x1d95('0x33')]()});}else if(_0x450b7b[_0x1d95('0x3c')]===_0x1d95('0x45')&&_0x450b7b['Variable']&&_0x450b7b[_0x1d95('0x46')][_0x1d95('0x17')]&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b['customField']){_0x50e763[_0x450b7b[_0x1d95('0x46')][_0x1d95('0x17')][_0x1d95('0x3f')]()]&&_0x59b1b9[_0x1d95('0x1b')][_0x1d95('0x44')]({'id':_0x450b7b['idField'],'value':_0x50e763[_0x450b7b['Variable'][_0x1d95('0x17')]['toLowerCase']()][_0x1d95('0x33')]()});}});}return _0x59b1b9;}exports[_0x1d95('0x47')]=function(_0x91fb30,_0x4736cf,_0xba1003,_0x20b3e0,_0x47865d,_0x5d1cf5){var _0x24a287,_0x13fd68;_0x5d1cf5['remoteUri']=intUtil[_0x1d95('0x48')](_0x5d1cf5[_0x1d95('0x29')]);_0x5d1cf5['serverUrl']=intUtil[_0x1d95('0x48')](_0x5d1cf5[_0x1d95('0x49')]);if(_0x47865d&&_0x47865d[_0x1d95('0x4a')]){logger[_0x1d95('0x21')](_0x1d95('0x4b'),_0x1d95('0x4c'));_0x4736cf[_0x1d95('0x4d')]=util[_0x1d95('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d1cf5[_0x1d95('0x49')],_0x4736cf[_0x1d95('0x4e')],md5(_0x4736cf[_0x1d95('0x4e')]));}else{_0x4736cf[_0x1d95('0x4d')]='';}headers['Authorization']=getAuth(_0x5d1cf5);return getUser(_0x5d1cf5,_0x20b3e0[_0x1d95('0x27')])[_0x1d95('0x20')](function(_0x3ec88d){_0x24a287=_0x3ec88d;logger[_0x1d95('0x21')]('The\x20User\x20ID\x20is:',_0x24a287['id']);return getEndUser(_0x5d1cf5,_0x4736cf['calleridname'],_0x4736cf[_0x1d95('0x11')]);})[_0x1d95('0x20')](function(_0x104c4f){_0x13fd68=_0x104c4f;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x13fd68['id']);return getTicket(_0x5d1cf5,_0x24a287,_0x13fd68,_0xba1003,_0x4736cf);})[_0x1d95('0x20')](function(_0x660545){if(_0x660545&&_0x660545['id']){logger[_0x1d95('0x21')]('Ticket\x20created!');logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x660545['id']);logger[_0x1d95('0x21')](_0x1d95('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1d95('0x50'),_0x20b3e0[_0x1d95('0x17')]),_0x1d95('0x51'),{'uri':util[_0x1d95('0x1d')]('%s/helpdesk/tickets/%d',_0x5d1cf5[_0x1d95('0x29')],_0x660545['id'])});}})[_0x1d95('0x52')](function(_0x17ae7b){logger[_0x1d95('0x53')](_0x1d95('0x4b'),JSON['stringify'](_0x17ae7b));});};exports[_0x1d95('0x54')]=function(_0x3abfba,_0x2c53dc,_0x35e8be,_0x13acf0,_0x4a69ed,_0x3c2a5a,_0x223045){var _0x42d93b,_0x110578;_0x3c2a5a[_0x1d95('0x29')]=intUtil['stripTrailingSlash'](_0x3c2a5a[_0x1d95('0x29')]);_0x3c2a5a['serverUrl']=intUtil[_0x1d95('0x48')](_0x3c2a5a[_0x1d95('0x49')]);if(_0x223045&&_0x223045[_0x1d95('0x55')]&&_0x223045[_0x1d95('0x55')]!==_0x1d95('0x56')){logger[_0x1d95('0x21')](_0x1d95('0x57'),_0x1d95('0x4c'));_0x2c53dc[_0x1d95('0x4d')]=util[_0x1d95('0x1d')](_0x1d95('0x58'),_0x3c2a5a[_0x1d95('0x49')],_0x2c53dc['uniqueid'],md5(_0x2c53dc[_0x1d95('0x4e')]));}headers[_0x1d95('0x59')]=getAuth(_0x3c2a5a);return getUser(_0x3c2a5a,_0x13acf0[_0x1d95('0x27')])['then'](function(_0xca3413){_0x42d93b=_0xca3413;logger[_0x1d95('0x21')](_0x1d95('0x5a'),_0x42d93b['id']);return getEndUser(_0x3c2a5a,_0x2c53dc[_0x1d95('0x5b')],_0x2c53dc[_0x1d95('0x5c')]);})[_0x1d95('0x20')](function(_0x3f3a0a){_0x110578=_0x3f3a0a;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x110578['id']);return getTicket(_0x3c2a5a,_0x42d93b,_0x110578,_0x35e8be,_0x2c53dc);})[_0x1d95('0x20')](function(_0x20af09){if(_0x20af09&&_0x20af09['id']){logger[_0x1d95('0x21')](_0x1d95('0x5d'));logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x20af09['id']);logger['info']('[OUTBOUND]',_0x1d95('0x5e'));emit(util[_0x1d95('0x1d')](_0x1d95('0x50'),_0x13acf0[_0x1d95('0x17')]),_0x1d95('0x51'),{'uri':util[_0x1d95('0x1d')]('%s/helpdesk/tickets/%d',_0x3c2a5a[_0x1d95('0x29')],_0x20af09['id'])});}})[_0x1d95('0x52')](function(_0x5e67d5){logger['error'](_0x1d95('0x57'),JSON['stringify'](_0x5e67d5));});};exports[_0x1d95('0x5f')]=function(_0x681aa7,_0x2fe095,_0x2634aa,_0xd6f8e0,_0x1409a1,_0x2ea1e7){var _0x4439d2,_0x454dc5;_0x2ea1e7[_0x1d95('0x29')]=intUtil[_0x1d95('0x48')](_0x2ea1e7['remoteUri']);_0x2ea1e7[_0x1d95('0x49')]=intUtil[_0x1d95('0x48')](_0x2ea1e7['serverUrl']);if(_0x1409a1&&_0x1409a1['monitor_format']){logger[_0x1d95('0x21')]('['+_0x2fe095[_0x1d95('0x60')][_0x1d95('0x61')]()+']','Recording\x20is\x20enabled!');_0x2fe095[_0x1d95('0x4d')]=util['format'](_0x1d95('0x58'),_0x2ea1e7[_0x1d95('0x49')],_0x2fe095[_0x1d95('0x4e')],md5(_0x2fe095[_0x1d95('0x4e')]));}else{_0x2fe095[_0x1d95('0x4d')]='';}headers[_0x1d95('0x59')]=getAuth(_0x2ea1e7);return getUser(_0x2ea1e7,'')['then'](function(_0x4cb965){_0x4439d2=_0x4cb965;logger[_0x1d95('0x21')](_0x1d95('0x5a'),_0x4439d2['id']);return getEndUser(_0x2ea1e7,_0x2fe095[_0x1d95('0x62')],_0x2fe095[_0x1d95('0x11')]);})[_0x1d95('0x20')](function(_0x34188a){_0x454dc5=_0x34188a;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x454dc5['id']);return getTicket(_0x2ea1e7,_0x4439d2,_0x454dc5,_0x2634aa,_0x2fe095);})['then'](function(_0x2126e1){if(_0x2126e1){logger['info'](_0x1d95('0x5d'));logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x2126e1['id']);}})[_0x1d95('0x52')](function(_0x27450d){logger['error']('['+_0x2fe095['lastevent'][_0x1d95('0x61')]()+']',JSON[_0x1d95('0x63')](_0x27450d));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index f229522..8c6e30d 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f66=['adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','work_number','contactNumber','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail'];(function(_0xe818fc,_0x321099){var _0x194d41=function(_0x5af855){while(--_0x5af855){_0xe818fc['push'](_0xe818fc['shift']());}};_0x194d41(++_0x321099);}(_0x9f66,0x8e));var _0x69f6=function(_0x323fff,_0x38f93e){_0x323fff=_0x323fff-0x0;var _0x326de5=_0x9f66[_0x323fff];return _0x326de5;};'use strict';var _=require(_0x69f6('0x0'));var rp=require(_0x69f6('0x1'));var md5=require(_0x69f6('0x2'));var util=require(_0x69f6('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x69f6('0x4'));var intUtil=require(_0x69f6('0x5'));var config=require(_0x69f6('0x6'));var logger=require(_0x69f6('0x7'))(_0x69f6('0x8'));config[_0x69f6('0x9')]=_[_0x69f6('0xa')](config[_0x69f6('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x69f6('0xb'))(new Redis(config[_0x69f6('0x9')]));function getAdminId(_0x16c15a,_0xe75248,_0x58397c,_0x3101b7){return new Promise(function(_0x1540db,_0x282843){var _0x143a72=![];var _0x521bbf={'method':_0x69f6('0xc'),'uri':_0x3101b7+_0x69f6('0xd'),'json':!![]};_0x521bbf[_0x69f6('0xe')]=_0x58397c;logger[_0x69f6('0xf')](_0x69f6('0x10'));return rp(_0x521bbf)[_0x69f6('0x11')](function(_0x36d402){if(_0x36d402){var _0x33a6c2=_0x36d402[_0x69f6('0x12')];var _0x2a0d48=null;for(_0x2a0d48=0x0;_0x2a0d48<_0x33a6c2[_0x69f6('0x13')];_0x2a0d48++){if(_0x33a6c2[_0x2a0d48][_0x69f6('0x14')]===_0x16c15a[_0x69f6('0x15')]){_0x16c15a[_0x69f6('0x16')]=_0x33a6c2[_0x2a0d48]['id'];_0x143a72=!![];}}if(_0x143a72){logger[_0x69f6('0xf')](_0x69f6('0x17'),_0x16c15a[_0x69f6('0x16')]);_0x1540db(_0x16c15a);}else{_0x282843({'statusCode':0x194,'message':_0x69f6('0x18')});}}else{_0x282843({'statusCode':0x194,'message':_0x69f6('0x18')});}})[_0x69f6('0x19')](function(_0x2b2ee9){logger[_0x69f6('0x1a')]('['+[_0xe75248['toUpperCase']()]+']',_0x2b2ee9[_0x69f6('0x1b')]);_0x282843(_0x2b2ee9);});});}function getUser(_0x9f0633,_0x80631d,_0x22f382){return function(_0x5cef3f){return new Promise(function(_0x180599,_0x5d0280){var _0x219804={'method':_0x69f6('0xc'),'uri':_0x22f382+_0x69f6('0xd'),'json':!![]};_0x219804['headers']=_0x80631d;logger[_0x69f6('0xf')]('Getting\x20user\x20list');return rp(_0x219804)[_0x69f6('0x11')](function(_0x178d04){if(_0x178d04){var _0x47e33b=_0x178d04[_0x69f6('0x12')];var _0x10731a=![];var _0x482e83=null;if(_0x5cef3f[_0x69f6('0x1c')]!==null){logger[_0x69f6('0xf')](_0x69f6('0x1d'),_0x5cef3f[_0x69f6('0x1c')]);_0x5cef3f[_0x69f6('0x1e')]=_0x5cef3f[_0x69f6('0x1c')];for(_0x482e83=0x0;_0x482e83<_0x47e33b['length'];_0x482e83++){if(_0x47e33b[_0x482e83]['email']===_0x5cef3f[_0x69f6('0x1c')]){_0x10731a=!![];_0x5cef3f[_0x69f6('0x1f')]=_0x47e33b[_0x482e83]['id'];logger[_0x69f6('0xf')](_0x69f6('0x20'),_0x5cef3f['userId']);}}}if(!_0x10731a){logger[_0x69f6('0xf')](_0x69f6('0x21'));_0x5cef3f[_0x69f6('0x1e')]=_0x5cef3f[_0x69f6('0x15')];_0x5cef3f[_0x69f6('0x1f')]=_0x5cef3f[_0x69f6('0x16')];_0x10731a=!![];}if(_0x10731a){_0x180599(_0x5cef3f);}else{_0x5d0280({'statusCode':0x194,'message':_0x69f6('0x18')});}}else{_0x5d0280({'statusCode':0x194,'message':_0x69f6('0x18')});}})[_0x69f6('0x19')](function(_0x457bd3){logger['error']('['+[_0x9f0633[_0x69f6('0x22')]()]+']',_0x457bd3[_0x69f6('0x1b')]);_0x5d0280(_0x457bd3);});});};}function searchContact(_0x2e200c,_0x2bbaa7,_0x25b10b,_0x812375){return new Promise(function(_0x2704d5,_0x2604a7){var _0xbffcc9={'method':_0x69f6('0xc'),'headers':_0x2bbaa7,'uri':_0x2e200c+'/api/lookup?q='+_0x812375+_0x69f6('0x23')+_0x25b10b+_0x69f6('0x24'),'json':!![]};rp(_0xbffcc9)[_0x69f6('0x11')](function(_0x1d5d68){var _0x5908d4=_[_0x69f6('0x25')](_0x1d5d68['contacts'][_0x69f6('0x26')],[_0x25b10b,_0x812375]);_0x2704d5(_0x5908d4);})[_0x69f6('0x19')](function(_0x5dc0fd){_0x2604a7(_0x5dc0fd);});});}function getEndUser(_0x5e4ac0,_0x3e75cc,_0x24e6db){return function(_0x403466){return new Promise(function(_0x372330,_0xb23127){logger[_0x69f6('0xf')](util[_0x69f6('0x27')](_0x69f6('0x28'),_0x403466['contactNumber']));searchContact(_0x24e6db,_0x3e75cc,_0x69f6('0x29'),_0x403466['contactNumber'])[_0x69f6('0x11')](function(_0x52bc07){if(_0x52bc07){_0x403466[_0x69f6('0x2a')]=_0x52bc07['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x403466[_0x69f6('0x2a')]);return _0x372330(_0x403466);}searchContact(_0x24e6db,_0x3e75cc,_0x69f6('0x2b'),_0x403466[_0x69f6('0x2c')])[_0x69f6('0x11')](function(_0x12255a){if(_0x12255a){_0x403466[_0x69f6('0x2a')]=_0x12255a['id'];logger[_0x69f6('0xf')]('Contact\x20found\x20work_number:',_0x403466[_0x69f6('0x2a')]);return _0x372330(_0x403466);}createEndUser(_0x403466,_0x5e4ac0,_0x3e75cc,_0x24e6db)[_0x69f6('0x11')](function(_0x53195d){logger['info']('Contact\x20created:',_0x53195d[_0x69f6('0x2a')]);return _0x372330(_0x53195d);});});})[_0x69f6('0x19')](function(_0x31a9be){_0xb23127(_0x31a9be);});});};}function createEndUser(_0x5b7054,_0x3c106c,_0x18d3da,_0x150495){return new Promise(function(_0xaa5f03,_0x1a2462){var _0x4cd6b1=moment();var _0x5b8716={'method':_0x69f6('0x2d'),'uri':_0x150495+_0x69f6('0x2e'),'body':{'contact':{'last_name':_0x5b7054[_0x69f6('0x2c')],'work_number':_0x5b7054[_0x69f6('0x2c')],'mobile_number':_0x5b7054[_0x69f6('0x2c')],'owner_id':_0x5b7054['userId'],'created_at':_0x4cd6b1['format'](_0x69f6('0x2f'))}},'json':!![]};_0x5b8716[_0x69f6('0xe')]=_0x18d3da;logger[_0x69f6('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x5b8716)[_0x69f6('0x11')](function(_0xabae69){_0x5b7054['endUserId']=_0xabae69['contact']['id'];_0xaa5f03(_0x5b7054);})[_0x69f6('0x19')](function(_0xa54521){logger['error']('['+[_0x3c106c[_0x69f6('0x22')]()]+']',_0xa54521[_0x69f6('0x1b')]);_0x1a2462(_0xa54521[_0x69f6('0x1b')]);});});}function getTicket(_0x560c34,_0x23d093,_0x27db6a,_0x233b10,_0x1b9316){return function(_0x1072b3){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x448902,_0x42b626){var _0xd5b8cb=moment();var _0x368101={'method':_0x69f6('0x2d'),'uri':_0x27db6a+_0x69f6('0x30'),'body':{'title':intUtil[_0x69f6('0x31')](_0x233b10[_0x69f6('0x32')],_0x1b9316,'\x20'),'description':intUtil['getString'](_0x233b10[_0x69f6('0x33')],_0x1b9316,'\x0a'),'owner_id':_0x1072b3[_0x69f6('0x1f')],'creater_id':_0x1072b3[_0x69f6('0x16')],'targetable_id':_0x1072b3[_0x69f6('0x2a')],'targetable_type':_0x69f6('0x34'),'created_at':_0xd5b8cb[_0x69f6('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0xd5b8cb[_0x69f6('0x35')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x368101['headers']=_0x23d093;return rp(_0x368101)[_0x69f6('0x11')](function(_0x4227ac){_0x1072b3[_0x69f6('0x36')]=_0x4227ac[_0x69f6('0x37')]['id'];logger[_0x69f6('0xf')](_0x69f6('0x38'),_0x1072b3[_0x69f6('0x36')]);_0x448902(_0x1072b3);})[_0x69f6('0x19')](function(_0x92822a){logger['error']('['+[_0x560c34[_0x69f6('0x22')]()]+']',_0x92822a[_0x69f6('0x1b')]);_0x42b626(_0x92822a[_0x69f6('0x1b')]);});});};}function emit(_0x5e94f8,_0x4a79ed,_0x96b2c7){var _0x44f4a8={'uri':_0x5e94f8+'/contacts/'+_0x96b2c7};io['to'](util[_0x69f6('0x27')](_0x69f6('0x39'),_0x4a79ed))['emit'](_0x69f6('0x3a'),_0x44f4a8);}exports['cs']=function(_0x50c0b3,_0x391326,_0x40488d,_0x39b5c6,_0x538809,_0x3009a7,_0x409047,_0xf3f835){var _0x9dab2a={};var _0x5897f5={'Authorization':_0x69f6('0x3b')+_0x3009a7[_0x69f6('0x3c')]};_0x3009a7[_0x69f6('0x3d')]=intUtil[_0x69f6('0x3e')](_0x3009a7[_0x69f6('0x3d')]);_0x3009a7[_0x69f6('0x3f')]=intUtil[_0x69f6('0x3e')](_0x3009a7[_0x69f6('0x3f')]);var _0x30d2ae=_0x3009a7[_0x69f6('0x3d')];_0x9dab2a['adminEmail']=_0x3009a7['username'];_0x9dab2a[_0x69f6('0x2c')]=_0xf3f835[_0x69f6('0x40')]()===_0x69f6('0x41')?_0x391326[_0x69f6('0x42')]:_0x391326[_0x69f6('0x43')];_0x9dab2a[_0x69f6('0x44')]=_0xf3f835==='queue'||_0xf3f835==='unmanaged'?'queue':'outbound';if(_0x39b5c6){_0x9dab2a[_0x69f6('0x1c')]=_0x39b5c6['email'];}var _0x3bb711=util[_0x69f6('0x27')](_0x69f6('0x45'),_0x3009a7[_0x69f6('0x3f')],_0x391326[_0x69f6('0x46')],md5(_0x391326['uniqueid']));if(_0x538809&&_0x538809[_0x69f6('0x47')]){logger[_0x69f6('0xf')]('[QUEUE]',_0x69f6('0x48'));_0x391326[_0x69f6('0x49')]=_0x3bb711;}else if(_0x409047&&_0x409047[_0x69f6('0x4a')]&&_0x409047['recordingFormat']!==_0x69f6('0x4b')){logger[_0x69f6('0xf')](_0x69f6('0x4c'),'Recording\x20is\x20enabled!');_0x391326[_0x69f6('0x49')]=_0x3bb711;}else{_0x391326[_0x69f6('0x49')]='';}return getAdminId(_0x9dab2a,_0xf3f835,_0x5897f5,_0x30d2ae)[_0x69f6('0x11')](getUser(_0xf3f835,_0x5897f5,_0x30d2ae))[_0x69f6('0x11')](getEndUser(_0xf3f835,_0x5897f5,_0x30d2ae))[_0x69f6('0x11')](getTicket(_0xf3f835,_0x5897f5,_0x30d2ae,_0x40488d,_0x391326))[_0x69f6('0x11')](function(_0xc8a324){logger[_0x69f6('0xf')](util['format'](_0x69f6('0x4d'),_0xc8a324[_0x69f6('0x36')]));if(_0xf3f835!==_0x69f6('0x4e')){logger['info']('['+[_0xf3f835['toUpperCase']()]+']',_0x69f6('0x4f'));emit(_0x30d2ae,_0x39b5c6[_0x69f6('0x50')],_0xc8a324[_0x69f6('0x2a')]);}})[_0x69f6('0x19')](function(_0x5c8885){logger[_0x69f6('0x1a')]('['+[_0xf3f835[_0x69f6('0x22')]()]+_0x69f6('0x51'),util['inspect'](_0x5c8885,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb3ea=['util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','adminEmail','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise'];(function(_0x30be59,_0xb414fd){var _0x23d4cd=function(_0x3e11a5){while(--_0x3e11a5){_0x30be59['push'](_0x30be59['shift']());}};_0x23d4cd(++_0xb414fd);}(_0xb3ea,0x109));var _0xab3e=function(_0x502bf9,_0x372b11){_0x502bf9=_0x502bf9-0x0;var _0x3768ac=_0xb3ea[_0x502bf9];return _0x3768ac;};'use strict';var _=require(_0xab3e('0x0'));var rp=require(_0xab3e('0x1'));var md5=require('md5');var util=require(_0xab3e('0x2'));var moment=require(_0xab3e('0x3'));var Promise=require(_0xab3e('0x4'));var Redis=require(_0xab3e('0x5'));var intUtil=require(_0xab3e('0x6'));var config=require(_0xab3e('0x7'));var logger=require(_0xab3e('0x8'))(_0xab3e('0x9'));config['redis']=_[_0xab3e('0xa')](config[_0xab3e('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xab3e('0xc'))(new Redis(config[_0xab3e('0xb')]));function getAdminId(_0x284c32,_0x32e329,_0x2a0f2f,_0x432c4e){return new Promise(function(_0x20ed5d,_0x2f5f87){var _0x1db8d3=![];var _0xd25eea={'method':'GET','uri':_0x432c4e+_0xab3e('0xd'),'json':!![]};_0xd25eea[_0xab3e('0xe')]=_0x2a0f2f;logger['info'](_0xab3e('0xf'));return rp(_0xd25eea)[_0xab3e('0x10')](function(_0x50c92b){if(_0x50c92b){var _0x4fa588=_0x50c92b[_0xab3e('0x11')];var _0x1e0ac6=null;for(_0x1e0ac6=0x0;_0x1e0ac6<_0x4fa588[_0xab3e('0x12')];_0x1e0ac6++){if(_0x4fa588[_0x1e0ac6]['email']===_0x284c32[_0xab3e('0x13')]){_0x284c32['adminId']=_0x4fa588[_0x1e0ac6]['id'];_0x1db8d3=!![];}}if(_0x1db8d3){logger[_0xab3e('0x14')]('Admin\x20found:',_0x284c32[_0xab3e('0x15')]);_0x20ed5d(_0x284c32);}else{_0x2f5f87({'statusCode':0x194,'message':_0xab3e('0x16')});}}else{_0x2f5f87({'statusCode':0x194,'message':_0xab3e('0x16')});}})[_0xab3e('0x17')](function(_0x5ef29f){logger[_0xab3e('0x18')]('['+[_0x32e329[_0xab3e('0x19')]()]+']',_0x5ef29f[_0xab3e('0x1a')]);_0x2f5f87(_0x5ef29f);});});}function getUser(_0x3d8259,_0x4d1729,_0x138a8a){return function(_0x4ad799){return new Promise(function(_0x5d6bf9,_0xcd8c33){var _0x1ca261={'method':'GET','uri':_0x138a8a+_0xab3e('0xd'),'json':!![]};_0x1ca261['headers']=_0x4d1729;logger['info']('Getting\x20user\x20list');return rp(_0x1ca261)['then'](function(_0x2bcae8){if(_0x2bcae8){var _0x5f5305=_0x2bcae8[_0xab3e('0x11')];var _0x210f90=![];var _0x39ea97=null;if(_0x4ad799[_0xab3e('0x1b')]!==null){logger['info'](_0xab3e('0x1c'),_0x4ad799[_0xab3e('0x1b')]);_0x4ad799[_0xab3e('0x1d')]=_0x4ad799[_0xab3e('0x1b')];for(_0x39ea97=0x0;_0x39ea97<_0x5f5305['length'];_0x39ea97++){if(_0x5f5305[_0x39ea97][_0xab3e('0x1e')]===_0x4ad799[_0xab3e('0x1b')]){_0x210f90=!![];_0x4ad799[_0xab3e('0x1f')]=_0x5f5305[_0x39ea97]['id'];logger[_0xab3e('0x14')](_0xab3e('0x20'),_0x4ad799['userId']);}}}if(!_0x210f90){logger['info'](_0xab3e('0x21'));_0x4ad799['userEmail']=_0x4ad799[_0xab3e('0x13')];_0x4ad799['userId']=_0x4ad799[_0xab3e('0x15')];_0x210f90=!![];}if(_0x210f90){_0x5d6bf9(_0x4ad799);}else{_0xcd8c33({'statusCode':0x194,'message':_0xab3e('0x16')});}}else{_0xcd8c33({'statusCode':0x194,'message':_0xab3e('0x16')});}})[_0xab3e('0x17')](function(_0x4343f1){logger[_0xab3e('0x18')]('['+[_0x3d8259[_0xab3e('0x19')]()]+']',_0x4343f1[_0xab3e('0x1a')]);_0xcd8c33(_0x4343f1);});});};}function searchContact(_0x2c87a6,_0xb9949b,_0x1196a9,_0x1a9520){return new Promise(function(_0x511ac0,_0x39308c){var _0xe0b7e6={'method':'GET','headers':_0xb9949b,'uri':_0x2c87a6+'/api/lookup?q='+_0x1a9520+_0xab3e('0x22')+_0x1196a9+_0xab3e('0x23'),'json':!![]};rp(_0xe0b7e6)[_0xab3e('0x10')](function(_0x451900){var _0x51385c=_[_0xab3e('0x24')](_0x451900['contacts'][_0xab3e('0x25')],[_0x1196a9,_0x1a9520]);_0x511ac0(_0x51385c);})[_0xab3e('0x17')](function(_0x2d92ff){_0x39308c(_0x2d92ff);});});}function getEndUser(_0x41e256,_0x53e40d,_0xa9b809){return function(_0x60b892){return new Promise(function(_0x2aad8d,_0x1953f6){logger[_0xab3e('0x14')](util[_0xab3e('0x26')](_0xab3e('0x27'),_0x60b892['contactNumber']));searchContact(_0xa9b809,_0x53e40d,_0xab3e('0x28'),_0x60b892[_0xab3e('0x29')])[_0xab3e('0x10')](function(_0x27c527){if(_0x27c527){_0x60b892[_0xab3e('0x2a')]=_0x27c527['id'];logger[_0xab3e('0x14')]('Contact\x20found\x20mobile_number:',_0x60b892[_0xab3e('0x2a')]);return _0x2aad8d(_0x60b892);}searchContact(_0xa9b809,_0x53e40d,_0xab3e('0x2b'),_0x60b892[_0xab3e('0x29')])[_0xab3e('0x10')](function(_0x47b56b){if(_0x47b56b){_0x60b892[_0xab3e('0x2a')]=_0x47b56b['id'];logger[_0xab3e('0x14')](_0xab3e('0x2c'),_0x60b892[_0xab3e('0x2a')]);return _0x2aad8d(_0x60b892);}createEndUser(_0x60b892,_0x41e256,_0x53e40d,_0xa9b809)[_0xab3e('0x10')](function(_0x521917){logger[_0xab3e('0x14')]('Contact\x20created:',_0x521917[_0xab3e('0x2a')]);return _0x2aad8d(_0x521917);});});})[_0xab3e('0x17')](function(_0x4ecb48){_0x1953f6(_0x4ecb48);});});};}function createEndUser(_0x5142c4,_0xf52593,_0x294945,_0x2e5285){return new Promise(function(_0x3ea68a,_0x45e53d){var _0x5ba92a=moment();var _0x251577={'method':_0xab3e('0x2d'),'uri':_0x2e5285+_0xab3e('0x2e'),'body':{'contact':{'last_name':_0x5142c4[_0xab3e('0x29')],'work_number':_0x5142c4[_0xab3e('0x29')],'mobile_number':_0x5142c4[_0xab3e('0x29')],'owner_id':_0x5142c4[_0xab3e('0x1f')],'created_at':_0x5ba92a[_0xab3e('0x26')](_0xab3e('0x2f'))}},'json':!![]};_0x251577['headers']=_0x294945;logger['info'](_0xab3e('0x30'));return rp(_0x251577)[_0xab3e('0x10')](function(_0x4c3665){_0x5142c4[_0xab3e('0x2a')]=_0x4c3665[_0xab3e('0x31')]['id'];_0x3ea68a(_0x5142c4);})[_0xab3e('0x17')](function(_0x1bdbcc){logger['error']('['+[_0xf52593[_0xab3e('0x19')]()]+']',_0x1bdbcc[_0xab3e('0x1a')]);_0x45e53d(_0x1bdbcc[_0xab3e('0x1a')]);});});}function getTicket(_0x4cee74,_0x202ca7,_0x1733d6,_0x2922b1,_0x4efb90){return function(_0x1fc95f){logger[_0xab3e('0x14')](_0xab3e('0x32'));return new Promise(function(_0x13ecb1,_0x598b15){var _0x1ddb81=moment();var _0x46324c={'method':_0xab3e('0x2d'),'uri':_0x1733d6+_0xab3e('0x33'),'body':{'title':intUtil[_0xab3e('0x34')](_0x2922b1[_0xab3e('0x35')],_0x4efb90,'\x20'),'description':intUtil[_0xab3e('0x34')](_0x2922b1['Descriptions'],_0x4efb90,'\x0a'),'owner_id':_0x1fc95f[_0xab3e('0x1f')],'creater_id':_0x1fc95f['adminId'],'targetable_id':_0x1fc95f[_0xab3e('0x2a')],'targetable_type':_0xab3e('0x36'),'created_at':_0x1ddb81[_0xab3e('0x26')](_0xab3e('0x2f')),'due_date':_0x1ddb81[_0xab3e('0x37')](0x1e,'m')[_0xab3e('0x26')](_0xab3e('0x2f'))},'json':!![]};_0x46324c[_0xab3e('0xe')]=_0x202ca7;return rp(_0x46324c)[_0xab3e('0x10')](function(_0xd7a225){_0x1fc95f[_0xab3e('0x38')]=_0xd7a225[_0xab3e('0x39')]['id'];logger[_0xab3e('0x14')](_0xab3e('0x3a'),_0x1fc95f[_0xab3e('0x38')]);_0x13ecb1(_0x1fc95f);})[_0xab3e('0x17')](function(_0x1ba36d){logger['error']('['+[_0x4cee74[_0xab3e('0x19')]()]+']',_0x1ba36d[_0xab3e('0x1a')]);_0x598b15(_0x1ba36d[_0xab3e('0x1a')]);});});};}function emit(_0x1fff8c,_0xf4c048,_0x1a7edf){var _0x48daaa={'uri':_0x1fff8c+_0xab3e('0x3b')+_0x1a7edf};io['to'](util[_0xab3e('0x26')](_0xab3e('0x3c'),_0xf4c048))[_0xab3e('0x3d')](_0xab3e('0x3e'),_0x48daaa);}exports['cs']=function(_0x40a996,_0x1fc9dd,_0x12fef2,_0x272413,_0x1e4ef6,_0x52ff37,_0xbdb075,_0x180d15){var _0x2c52bd={};var _0xd84297={'Authorization':_0xab3e('0x3f')+_0x52ff37[_0xab3e('0x40')]};_0x52ff37[_0xab3e('0x41')]=intUtil[_0xab3e('0x42')](_0x52ff37[_0xab3e('0x41')]);_0x52ff37[_0xab3e('0x43')]=intUtil['stripTrailingSlash'](_0x52ff37['serverUrl']);var _0x13b661=_0x52ff37[_0xab3e('0x41')];_0x2c52bd[_0xab3e('0x13')]=_0x52ff37[_0xab3e('0x44')];_0x2c52bd[_0xab3e('0x29')]=_0x180d15[_0xab3e('0x45')]()==='outbound'?_0x1fc9dd[_0xab3e('0x46')]:_0x1fc9dd[_0xab3e('0x47')];_0x2c52bd[_0xab3e('0x48')]=_0x180d15===_0xab3e('0x49')||_0x180d15===_0xab3e('0x4a')?_0xab3e('0x49'):_0xab3e('0x4b');if(_0x272413){_0x2c52bd[_0xab3e('0x1b')]=_0x272413[_0xab3e('0x1e')];}var _0x3b8c18=util[_0xab3e('0x26')](_0xab3e('0x4c'),_0x52ff37['serverUrl'],_0x1fc9dd[_0xab3e('0x4d')],md5(_0x1fc9dd['uniqueid']));if(_0x1e4ef6&&_0x1e4ef6['monitor_format']){logger[_0xab3e('0x14')](_0xab3e('0x4e'),_0xab3e('0x4f'));_0x1fc9dd[_0xab3e('0x50')]=_0x3b8c18;}else if(_0xbdb075&&_0xbdb075[_0xab3e('0x51')]&&_0xbdb075[_0xab3e('0x51')]!==_0xab3e('0x52')){logger[_0xab3e('0x14')](_0xab3e('0x53'),_0xab3e('0x4f'));_0x1fc9dd[_0xab3e('0x50')]=_0x3b8c18;}else{_0x1fc9dd[_0xab3e('0x50')]='';}return getAdminId(_0x2c52bd,_0x180d15,_0xd84297,_0x13b661)['then'](getUser(_0x180d15,_0xd84297,_0x13b661))[_0xab3e('0x10')](getEndUser(_0x180d15,_0xd84297,_0x13b661))[_0xab3e('0x10')](getTicket(_0x180d15,_0xd84297,_0x13b661,_0x12fef2,_0x1fc9dd))['then'](function(_0x240dd0){logger[_0xab3e('0x14')](util['format'](_0xab3e('0x54'),_0x240dd0[_0xab3e('0x38')]));if(_0x180d15!==_0xab3e('0x4a')){logger[_0xab3e('0x14')]('['+[_0x180d15['toUpperCase']()]+']',_0xab3e('0x55'));emit(_0x13b661,_0x272413[_0xab3e('0x56')],_0x240dd0[_0xab3e('0x2a')]);}})[_0xab3e('0x17')](function(_0x209ebb){logger[_0xab3e('0x18')]('['+[_0x180d15['toUpperCase']()]+_0xab3e('0x57'),util[_0xab3e('0x58')](_0x209ebb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index af60f0d..cac2793 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 _0x8009=['[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./desk','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','desk','unknown\x20integration','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8009,0x19c));var _0x9800=function(_0x3d2fb4,_0x2b3019){_0x3d2fb4=_0x3d2fb4-0x0;var _0xe52e4=_0x8009[_0x3d2fb4];return _0xe52e4;};'use strict';var _=require(_0x9800('0x0'));var util=require(_0x9800('0x1'));var zendesk=require(_0x9800('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x9800('0x3'));var freshdesk=require(_0x9800('0x4'));var zoho=require('./zoho');var desk=require(_0x9800('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x9800('0x6'));var dynamics365=require(_0x9800('0x7'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x9800('0x8'),_0x9800('0x9'),_0x9800('0xa'),_0x9800('0xb'),'desk',_0x9800('0xc'),_0x9800('0xd'),_0x9800('0xe'),_0x9800('0xf')];exports[_0x9800('0x10')]=function(_0x33665b,_0x37d5fd,_0x5c5f81,_0x57dda3,_0x543395,_0x28dedd){if(_0x5c5f81){if(_[_0x9800('0x11')](integrations,_0x33665b[_0x9800('0x12')][_0x9800('0x13')]())){try{var _0x30d2a3=null;var _0x272dc7='';var _0x5534ea=_0x5c5f81[_0x33665b[_0x9800('0x12')][_0x9800('0x13')]()];if(_0x5534ea){var _0x2d5a02=_0x5534ea[_0x33665b[_0x9800('0x14')]];if(_0x2d5a02){var _0x5edc79=_[_0x9800('0x15')](_0x2d5a02['Configurations'],{'id':parseInt(_0x33665b[_0x9800('0x16')],0xa)});if(_0x5edc79){if(_0x57dda3){if(_0x543395&&_0x37d5fd['queue']){_0x272dc7='queue';}else if(_0x37d5fd[_0x9800('0x17')]){_0x272dc7=_0x9800('0x18');}else{console[_0x9800('0x19')](_0x9800('0x1a'),_0x37d5fd);}}else{_0x272dc7=_0x9800('0x1b');}switch(_0x33665b[_0x9800('0x12')][_0x9800('0x13')]()){case _0x9800('0x1c'):zendesk[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0x8'):salesforce[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0x9'):sugarcrm[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0xa'):freshdesk[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0xb'):zoho[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0x1d'):desk[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case'vtiger':vtiger[_0x272dc7](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd);break;case _0x9800('0xe'):freshsales['cs'](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd,_0x272dc7);break;case _0x9800('0xf'):servicenow['cs'](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd,_0x272dc7);break;case _0x9800('0xd'):dynamics365['cs'](_0x33665b,_0x37d5fd,_0x5edc79,_0x57dda3,_0x543395,_0x2d5a02,_0x28dedd,_0x272dc7);break;default:console['log'](_0x9800('0x1e'));}}else{_0x30d2a3=require('../../../../config/logger')(_0x33665b['data1'][_0x9800('0x13')]());_0x30d2a3[_0x9800('0x1f')](_0x9800('0x20'),util['format'](_0x9800('0x21'),_0x33665b[_0x9800('0x12')][_0x9800('0x13')](),_0x33665b[_0x9800('0x16')]));}}else{_0x30d2a3=require(_0x9800('0x22'))(_0x33665b[_0x9800('0x12')][_0x9800('0x13')]());_0x30d2a3[_0x9800('0x1f')](_0x9800('0x20'),util[_0x9800('0x23')](_0x9800('0x24'),_0x33665b[_0x9800('0x12')][_0x9800('0x13')](),_0x33665b['data2']));}}else{}}catch(_0x5b4bf8){console[_0x9800('0x1f')](_0x5b4bf8);}}}}; \ No newline at end of file +var _0x76df=['./servicenow','./dynamics365','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','find','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','freshdesk','servicenow','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger'];(function(_0x22c247,_0x3a015e){var _0x2e6877=function(_0x59374e){while(--_0x59374e){_0x22c247['push'](_0x22c247['shift']());}};_0x2e6877(++_0x3a015e);}(_0x76df,0x87));var _0xf76d=function(_0x49a4b5,_0x420d0c){_0x49a4b5=_0x49a4b5-0x0;var _0x343547=_0x76df[_0x49a4b5];return _0x343547;};'use strict';var _=require(_0xf76d('0x0'));var util=require(_0xf76d('0x1'));var zendesk=require(_0xf76d('0x2'));var salesforce=require(_0xf76d('0x3'));var sugarcrm=require(_0xf76d('0x4'));var freshdesk=require(_0xf76d('0x5'));var zoho=require(_0xf76d('0x6'));var desk=require(_0xf76d('0x7'));var vtiger=require(_0xf76d('0x8'));var servicenow=require(_0xf76d('0x9'));var dynamics365=require(_0xf76d('0xa'));var freshsales=require('./freshsales');var integrations=['zendesk',_0xf76d('0xb'),_0xf76d('0xc'),'freshdesk',_0xf76d('0xd'),_0xf76d('0xe'),_0xf76d('0xf'),_0xf76d('0x10'),_0xf76d('0x11'),'servicenow'];exports[_0xf76d('0x12')]=function(_0x3226ea,_0x28a9ef,_0x3ff905,_0x3cd3cb,_0x46eba8,_0x5e03c8){if(_0x3ff905){if(_[_0xf76d('0x13')](integrations,_0x3226ea[_0xf76d('0x14')]['toLowerCase']())){try{var _0x2752b5=null;var _0x47d49e='';var _0x2afea4=_0x3ff905[_0x3226ea['data1']['toLowerCase']()];if(_0x2afea4){var _0x4b58fc=_0x2afea4[_0x3226ea['data2']];if(_0x4b58fc){var _0x4108e6=_[_0xf76d('0x15')](_0x4b58fc['Configurations'],{'id':parseInt(_0x3226ea[_0xf76d('0x16')],0xa)});if(_0x4108e6){if(_0x3cd3cb){if(_0x46eba8&&_0x28a9ef['queue']){_0x47d49e=_0xf76d('0x17');}else if(_0x28a9ef[_0xf76d('0x18')]){_0x47d49e='outbound';}else{console[_0xf76d('0x19')](_0xf76d('0x1a'),_0x28a9ef);}}else{_0x47d49e=_0xf76d('0x1b');}switch(_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')]()){case'zendesk':zendesk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'salesforce':salesforce[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xc'):sugarcrm[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0x1d'):freshdesk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'zoho':zoho[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xe'):desk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xf'):vtiger[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'freshsales':freshsales['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;case _0xf76d('0x1e'):servicenow['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;case _0xf76d('0x10'):dynamics365['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;default:console[_0xf76d('0x19')]('unknown\x20integration');}}else{_0x2752b5=require(_0xf76d('0x1f'))(_0x3226ea[_0xf76d('0x14')]['toLowerCase']());_0x2752b5[_0xf76d('0x20')](_0xf76d('0x21'),util[_0xf76d('0x22')](_0xf76d('0x23'),_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')](),_0x3226ea['data3']));}}else{_0x2752b5=require('../../../../config/logger')(_0x3226ea['data1'][_0xf76d('0x1c')]());_0x2752b5[_0xf76d('0x20')](_0xf76d('0x21'),util[_0xf76d('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')](),_0x3226ea['data2']));}}else{}}catch(_0x53403e){console[_0xf76d('0x20')](_0x53403e);}}}}; \ 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 7f4eeae..1acef36 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 _0x8dcc=['ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','catch','outbound','recordingFormat','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','%s/%s/e','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','defaults','localhost','redis','emit','getString','Subjects','Descriptions','ticketType','Task'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x8dcc,0x1e6));var _0xc8dc=function(_0x90bbb3,_0x5139b6){_0x90bbb3=_0x90bbb3-0x0;var _0x2ea8fd=_0x8dcc[_0x90bbb3];return _0x2ea8fd;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xc8dc('0x0'));var BPromise=require(_0xc8dc('0x1'));var md5=require(_0xc8dc('0x2'));var jsforce=require(_0xc8dc('0x3'));var util=require(_0xc8dc('0x4'));var Redis=require(_0xc8dc('0x5'));var intUtil=require(_0xc8dc('0x6'));var config=require(_0xc8dc('0x7'));var logger=require('../../../../config/logger')(_0xc8dc('0x8'));config['redis']=_[_0xc8dc('0x9')](config['redis'],{'host':_0xc8dc('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc8dc('0xb')]));function emit(_0x4aab58,_0x40239a,_0x18f406){io['to'](_0x4aab58)[_0xc8dc('0xc')](_0x40239a,_0x18f406);}function getTicket(_0x2ba46c,_0x402b6a,_0x3c0a95,_0x321057,_0x3d740e,_0xd5873f,_0x3993a1,_0x4e1618){var _0x1b7231=Object['assign']({},{'OwnerId':_0x402b6a['id'],'Subject':intUtil[_0xc8dc('0xd')](_0x321057[_0xc8dc('0xe')],_0x3d740e,'\x20'),'Description':intUtil[_0xc8dc('0xd')](_0x321057[_0xc8dc('0xf')],_0x3d740e,'\x0a')},getCustomFields(_0xd5873f,_0x3d740e));if(_0x3c0a95){if(_0x321057[_0xc8dc('0x10')]===_0xc8dc('0x11')){_0x1b7231[_0xc8dc('0x12')]=moment[_0xc8dc('0x13')]();_0x1b7231[_0xc8dc('0x14')]=![];_0x1b7231['IsRecurrence']=![];if(_0x3c0a95[_0xc8dc('0x15')]===_0xc8dc('0x16')||_0x3c0a95[_0xc8dc('0x15')]===_0xc8dc('0x17')){_0x1b7231[_0xc8dc('0x18')]=_0x3c0a95['id'];}else if(_0x3c0a95[_0xc8dc('0x15')]===_0xc8dc('0x19')){_0x1b7231['WhatId']=_0x3c0a95['id'];}}else if(_0x321057['ticketType']===_0xc8dc('0x1a')){if(_0x3c0a95[_0xc8dc('0x15')]==='contact'){_0x1b7231[_0xc8dc('0x1b')]=_0x3c0a95['id'];}else if(_0x3c0a95['endUserType']==='account'){_0x1b7231[_0xc8dc('0x1c')]=_0x3c0a95['id'];}else if(_0x3c0a95[_0xc8dc('0x15')]===_0xc8dc('0x17')&&_0x321057[_0xc8dc('0x1d')]){_0x1b7231[_0x321057[_0xc8dc('0x1d')]]=_0x3c0a95['id'];}else{logger[_0xc8dc('0x1e')](_0xc8dc('0x1f'));}}}return _0x3993a1[_0xc8dc('0x20')](_0x321057[_0xc8dc('0x10')])[_0xc8dc('0x21')](_0x1b7231);}function getUser(_0x548452,_0x398cea,_0x52ab8c){if(!_[_0xc8dc('0x22')](_0x398cea)&&intUtil[_0xc8dc('0x23')](_0x398cea)){var _0x51a941={'Email':_0x398cea};var _0x15af18={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52ab8c['sobject'](_0xc8dc('0x24'))[_0xc8dc('0x25')](_0x51a941,_0x15af18)[_0xc8dc('0x26')]()[_0xc8dc('0x27')](function(_0x4b4ea6){if(_0x4b4ea6[_0xc8dc('0x28')]){var _0x325b5a=_[_0xc8dc('0x25')](_0x4b4ea6,function(_0x583c55){return _0x583c55[_0xc8dc('0x29')]===_0x398cea;});if(_0x325b5a){logger['info']('Agent\x20%s\x20found.',_0x398cea);return BPromise[_0xc8dc('0x2a')]({'id':_0x325b5a['Id'],'name':_0x325b5a[_0xc8dc('0x2b')]});}}else{logger[_0xc8dc('0x1e')](_0xc8dc('0x2c'),_0x398cea);return _0x52ab8c[_0xc8dc('0x2d')]()[_0xc8dc('0x27')](function(_0x26efab){return BPromise[_0xc8dc('0x2a')]({'id':_0x26efab[_0xc8dc('0x2e')],'name':_0x26efab[_0xc8dc('0x2f')]});});}});}else{logger[_0xc8dc('0x1e')](_0xc8dc('0x2c'),_0x398cea);return _0x52ab8c[_0xc8dc('0x2d')]()[_0xc8dc('0x27')](function(_0x116eba){return BPromise[_0xc8dc('0x2a')]({'id':_0x116eba[_0xc8dc('0x2e')],'name':_0x116eba['display_name']});});}}function getEndUser(_0x467356,_0x4af547,_0x3eca81,_0x27f86f,_0x312b5c){var _0x57ddc7={'$or':{'Phone':_0x27f86f}};var _0x11679e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc8dc('0x2a')]()['then'](function(){logger[_0xc8dc('0x1e')](_0xc8dc('0x30'),_0x27f86f,_0x4af547[_0xc8dc('0x31')]);switch(_0x4af547[_0xc8dc('0x31')]){case'contact_lead':var _0x57a33d=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547['additionalSearchContact']){var _0x4c69de={};_0x4c69de[_0x4af547[_0xc8dc('0x33')]]=_0x27f86f;_[_0xc8dc('0x34')](_0x57a33d[_0xc8dc('0x35')],_0x4c69de);}return _0x312b5c['sobject'](_0xc8dc('0x36'))[_0xc8dc('0x25')](_0x57a33d,_0x11679e)['execute']()[_0xc8dc('0x27')](function(_0x917930){if(_0x917930&&_0x917930[_0xc8dc('0x28')]){return _0x917930;}else{var _0x3e2278=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x37')]){var _0x208dc5={};_0x208dc5[_0x4af547[_0xc8dc('0x37')]]=_0x27f86f;_['merge'](_0x3e2278[_0xc8dc('0x35')],_0x208dc5);}return _0x312b5c[_0xc8dc('0x20')](_0xc8dc('0x38'))[_0xc8dc('0x25')](_0x3e2278,_0x11679e);}});case _0xc8dc('0x39'):var _0x5dbec1=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x3a')]){var _0x4c69de={};_0x4c69de[_0x4af547['additionalSearchAccount']]=_0x27f86f;_['merge'](_0x5dbec1[_0xc8dc('0x35')],_0x4c69de);}return _0x312b5c['sobject']('Account')[_0xc8dc('0x25')](_0x5dbec1,_0x11679e)[_0xc8dc('0x26')]()[_0xc8dc('0x27')](function(_0x4e46af){if(_0x4e46af&&_0x4e46af[_0xc8dc('0x28')]){return _0x4e46af;}else{var _0x542498=_['cloneDeep'](_0x57ddc7);if(_0x4af547[_0xc8dc('0x33')]){var _0x4ec993={};_0x4ec993[_0x4af547[_0xc8dc('0x33')]]=_0x27f86f;_[_0xc8dc('0x34')](_0x542498['$or'],_0x4ec993);}return _0x312b5c[_0xc8dc('0x20')]('Contact')[_0xc8dc('0x25')](_0x542498,_0x11679e)[_0xc8dc('0x27')](function(_0x1dd6c9){if(_0x1dd6c9&&_0x1dd6c9['length']){return _0x1dd6c9;}else{var _0x2b7cb3=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x37')]){var _0x3d7c46={};_0x3d7c46[_0x4af547[_0xc8dc('0x37')]]=_0x27f86f;_[_0xc8dc('0x34')](_0x2b7cb3['$or'],_0x3d7c46);}return _0x312b5c[_0xc8dc('0x20')](_0xc8dc('0x38'))[_0xc8dc('0x25')](_0x2b7cb3,_0x11679e);}});}});case _0xc8dc('0x16'):var _0x57a33d=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x33')]){var _0x4c69de={};_0x4c69de[_0x4af547[_0xc8dc('0x33')]]=_0x27f86f;_[_0xc8dc('0x34')](_0x57a33d[_0xc8dc('0x35')],_0x4c69de);}return _0x312b5c[_0xc8dc('0x20')](_0xc8dc('0x36'))[_0xc8dc('0x25')](_0x57a33d,_0x11679e)[_0xc8dc('0x26')]();case _0xc8dc('0x17'):var _0x3ff965=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x37')]){var _0x4c69de={};_0x4c69de[_0x4af547[_0xc8dc('0x37')]]=_0x27f86f;_['merge'](_0x3ff965[_0xc8dc('0x35')],_0x4c69de);}return _0x312b5c[_0xc8dc('0x20')](_0xc8dc('0x38'))[_0xc8dc('0x25')](_0x3ff965,_0x11679e);case'account':var _0x5dbec1=_[_0xc8dc('0x32')](_0x57ddc7);if(_0x4af547[_0xc8dc('0x3a')]){var _0x4c69de={};_0x4c69de[_0x4af547['additionalSearchAccount']]=_0x27f86f;_[_0xc8dc('0x34')](_0x5dbec1[_0xc8dc('0x35')],_0x4c69de);}return _0x312b5c[_0xc8dc('0x20')](_0xc8dc('0x3b'))[_0xc8dc('0x25')](_0x5dbec1,_0x11679e);default:return null;}})[_0xc8dc('0x27')](function(_0x3577d0){if(_0x3577d0&&_0x3577d0[_0xc8dc('0x28')]){var _0x356069=_[_0xc8dc('0x3c')](_0x3577d0);if(_0x356069){return BPromise['resolve']({'id':_0x356069['Id'],'name':_0x356069[_0xc8dc('0x2b')],'phone':_0x356069[_0xc8dc('0x3d')],'endUserType':_0x356069['attributes']['type']['toLowerCase']()});}}})[_0xc8dc('0x27')](function(_0x515bfb){if(_0x515bfb){logger['info'](_0xc8dc('0x3e'),_0x515bfb[_0xc8dc('0x15')],_0x27f86f);return BPromise[_0xc8dc('0x2a')](_0x515bfb);}else{logger['info'](_0xc8dc('0x3f'),_0x27f86f);var _0x704ea3={'Phone':_0x27f86f};if(_0x4af547[_0xc8dc('0x40')]){if(_0x4af547[_0xc8dc('0x40')]===_0xc8dc('0x16')){logger['info'](_0xc8dc('0x41'),_0x27f86f,_0x4af547[_0xc8dc('0x40')]);_0x704ea3['LastName']=_0x3eca81!==_0xc8dc('0x42')?_0x3eca81:util[_0xc8dc('0x43')](_0xc8dc('0x44'),_0x27f86f);}else if(_0x4af547[_0xc8dc('0x40')]===_0xc8dc('0x17')){logger[_0xc8dc('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x27f86f,_0x4af547['moduleCreate']);_0x704ea3['LastName']=_0x3eca81!==_0xc8dc('0x42')?_0x3eca81:util[_0xc8dc('0x43')](_0xc8dc('0x44'),_0x27f86f);_0x704ea3[_0xc8dc('0x45')]=_0xc8dc('0x46');}else if(_0x4af547[_0xc8dc('0x40')]===_0xc8dc('0x19')){logger[_0xc8dc('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x27f86f,_0x4af547['moduleCreate']);_0x704ea3[_0xc8dc('0x2b')]=_0x3eca81!==_0xc8dc('0x42')?_0x3eca81:util[_0xc8dc('0x43')](_0xc8dc('0x44'),_0x27f86f);}else{return null;}}return _0x312b5c[_0xc8dc('0x20')](_[_0xc8dc('0x47')](_0x4af547[_0xc8dc('0x40')]))['create'](_0x704ea3)[_0xc8dc('0x27')](function(_0x569aea){return BPromise['resolve']({'id':_0x569aea['id'],'endUserType':_0x4af547[_0xc8dc('0x40')]});});}});}function getCustomFields(_0x35cb94,_0x13575c){var _0x1fe03d={};if(_0x35cb94[_0xc8dc('0x28')]>0x0){_[_0xc8dc('0x48')](_0x35cb94,function(_0x41c5e3){if(_[_0xc8dc('0x49')]([_0xc8dc('0x4a'),_0xc8dc('0x4b')],_0x41c5e3[_0xc8dc('0x4c')])&&_0x41c5e3[_0xc8dc('0x4d')]){_0x1fe03d[_0x41c5e3['idField']]=_0x41c5e3[_0xc8dc('0x4e')][_0xc8dc('0x4f')]();}else if(_0x41c5e3[_0xc8dc('0x4c')]===_0xc8dc('0x50')&&_0x41c5e3[_0xc8dc('0x51')]&&_0x41c5e3[_0xc8dc('0x4d')]){_0x13575c[_0x41c5e3[_0xc8dc('0x51')]]&&(_0x1fe03d[_0x41c5e3['idField']]=_0x13575c[_0x41c5e3['variableName']][_0xc8dc('0x4f')]());}else if(_0x41c5e3[_0xc8dc('0x4c')]===_0xc8dc('0x52')&&_0x41c5e3[_0xc8dc('0x53')]&&_0x41c5e3[_0xc8dc('0x53')][_0xc8dc('0x54')]&&_0x41c5e3[_0xc8dc('0x4d')]){_0x13575c[_0x41c5e3[_0xc8dc('0x53')][_0xc8dc('0x54')]['toLowerCase']()]&&(_0x1fe03d[_0x41c5e3[_0xc8dc('0x4d')]]=_0x13575c[_0x41c5e3[_0xc8dc('0x53')][_0xc8dc('0x54')][_0xc8dc('0x55')]()][_0xc8dc('0x4f')]());}});}return _0x1fe03d;}function getConnection(_0x4c7b80){var _0x7d01d0=_0x4c7b80['password']['concat'](_0x4c7b80['securityToken']);var _0x4710d2=new jsforce[(_0xc8dc('0x56'))]({'oauth2':{'loginUrl':_0x4c7b80['remoteUri']||_0xc8dc('0x57'),'clientId':_0x4c7b80[_0xc8dc('0x58')],'clientSecret':_0x4c7b80[_0xc8dc('0x59')]}});return _0x4710d2[_0xc8dc('0x5a')](_0x4c7b80[_0xc8dc('0x5b')],_0x7d01d0)['then'](function(){logger[_0xc8dc('0x1e')]('Connection\x20established.');return _0x4710d2;});}exports[_0xc8dc('0x5c')]=function(_0x4b5427,_0x1e8220,_0x872b61,_0x2bdd5b,_0x4735ea,_0x239d30){var _0x2af231,_0xe7e653,_0x256c7d,_0x3476bd;_0x239d30[_0xc8dc('0x5d')]=intUtil[_0xc8dc('0x5e')](_0x239d30['serverUrl']);_0x239d30[_0xc8dc('0x5f')]=intUtil[_0xc8dc('0x5e')](_0x239d30[_0xc8dc('0x5f')]);if(_0x4735ea&&_0x4735ea['monitor_format']){logger['info']('[QUEUE]',_0xc8dc('0x60'));_0x1e8220[_0xc8dc('0x61')]=util[_0xc8dc('0x43')](_0xc8dc('0x62'),_0x239d30[_0xc8dc('0x5d')],_0x1e8220[_0xc8dc('0x63')],md5(_0x1e8220[_0xc8dc('0x63')]));}else{_0x1e8220['recordingURL']='';}return getConnection(_0x239d30)[_0xc8dc('0x27')](function(_0x455f6e){_0x3476bd=_0x455f6e;return getUser(_0x239d30,_0x2bdd5b[_0xc8dc('0x64')],_0x3476bd);})[_0xc8dc('0x27')](function(_0x7862dc){_0x2af231=_0x7862dc;return getEndUser(_0x239d30,_0x872b61,_0x1e8220[_0xc8dc('0x65')],_0x1e8220[_0xc8dc('0x66')],_0x3476bd);})[_0xc8dc('0x27')](function(_0x2525c3){_0xe7e653=_0x2525c3;return getTicket(_0x239d30,_0x2af231,_0xe7e653,_0x872b61,_0x1e8220,_0x872b61[_0xc8dc('0x67')],_0x3476bd,_0xc8dc('0x5c'));})[_0xc8dc('0x27')](function(_0xdb5778){_0x256c7d=_0xdb5778;logger[_0xc8dc('0x1e')](_0xc8dc('0x68'),_0x256c7d['id']);logger[_0xc8dc('0x1e')](_0xc8dc('0x69'),_0x256c7d['id'],_0x2bdd5b[_0xc8dc('0x54')],_0x239d30[_0xc8dc('0x4c')]);switch(_0x239d30['type']){case'integrationTab':emit(util[_0xc8dc('0x43')](_0xc8dc('0x6a'),_0x2bdd5b[_0xc8dc('0x54')]),_0xc8dc('0x6b'),{'recordId':_0x256c7d['id']});break;case _0xc8dc('0x6c'):emit(util[_0xc8dc('0x43')](_0xc8dc('0x6a'),_0x2bdd5b['name']),_0xc8dc('0x6d'),{'uri':util[_0xc8dc('0x43')]('%s/%s/e',_0x3476bd[_0xc8dc('0x6e')],_0x256c7d['id'])});break;default:logger[_0xc8dc('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xc8dc('0x70')](function(_0x23d3a7){logger['error']('[QUEUE]',_0x23d3a7);});};exports[_0xc8dc('0x71')]=function(_0x4e77f3,_0x19c25f,_0x419e37,_0x5c05b7,_0x395ed6,_0x3d327e,_0x4d5f08){var _0x42bfec,_0x32777d,_0x981f8b,_0x11426e;_0x3d327e[_0xc8dc('0x5d')]=intUtil[_0xc8dc('0x5e')](_0x3d327e['serverUrl']);_0x3d327e[_0xc8dc('0x5f')]=intUtil[_0xc8dc('0x5e')](_0x3d327e[_0xc8dc('0x5f')]);if(_0x4d5f08&&_0x4d5f08[_0xc8dc('0x72')]&&_0x4d5f08[_0xc8dc('0x72')]!=='none'){logger[_0xc8dc('0x1e')]('[OUTBOUND]',_0xc8dc('0x60'));_0x19c25f[_0xc8dc('0x61')]=util['format'](_0xc8dc('0x62'),_0x3d327e[_0xc8dc('0x5d')],_0x19c25f['uniqueid'],md5(_0x19c25f[_0xc8dc('0x63')]));}return getConnection(_0x3d327e)[_0xc8dc('0x27')](function(_0x3516ea){_0x11426e=_0x3516ea;return getUser(_0x3d327e,_0x5c05b7[_0xc8dc('0x64')],_0x11426e);})['then'](function(_0x5879d6){_0x42bfec=_0x5879d6;return getEndUser(_0x3d327e,_0x419e37,_0x19c25f['destcalleridname'],_0x19c25f[_0xc8dc('0x73')],_0x11426e);})['then'](function(_0x5a2f12){_0x32777d=_0x5a2f12;return getTicket(_0x3d327e,_0x42bfec,_0x32777d,_0x419e37,_0x19c25f,_0x419e37[_0xc8dc('0x67')],_0x11426e,_0xc8dc('0x71'));})['then'](function(_0x2d6efe){_0x981f8b=_0x2d6efe;logger[_0xc8dc('0x1e')](_0xc8dc('0x74'),_0x981f8b['id']);logger[_0xc8dc('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x981f8b['id'],_0x5c05b7['name'],_0x3d327e[_0xc8dc('0x4c')]);switch(_0x3d327e[_0xc8dc('0x4c')]){case _0xc8dc('0x75'):emit(util['format'](_0xc8dc('0x6a'),_0x5c05b7[_0xc8dc('0x54')]),'trigger:salesforce:display',{'recordId':_0x981f8b['id']});break;case _0xc8dc('0x6c'):emit(util['format'](_0xc8dc('0x6a'),_0x5c05b7['name']),_0xc8dc('0x6d'),{'uri':util[_0xc8dc('0x43')](_0xc8dc('0x76'),_0x11426e[_0xc8dc('0x6e')],_0x981f8b['id'])});break;default:logger[_0xc8dc('0x6f')](_0xc8dc('0x77'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xc8dc('0x70')](function(_0x2757ce){logger['error'](_0xc8dc('0x77'),_0x2757ce);});};exports[_0xc8dc('0x78')]=function(_0x4a8583,_0x40125a,_0x51b10c,_0x5de428,_0x225581,_0x36052b){var _0x589e3e,_0x318b0b,_0x452642,_0x35a083;_0x36052b[_0xc8dc('0x5d')]=intUtil[_0xc8dc('0x5e')](_0x36052b[_0xc8dc('0x5d')]);_0x36052b['remoteUri']=intUtil[_0xc8dc('0x5e')](_0x36052b[_0xc8dc('0x5f')]);if(_0x225581&&_0x225581[_0xc8dc('0x79')]){logger[_0xc8dc('0x1e')]('['+_0x40125a[_0xc8dc('0x7a')][_0xc8dc('0x7b')]()+']',_0xc8dc('0x60'));_0x40125a[_0xc8dc('0x61')]=util[_0xc8dc('0x43')](_0xc8dc('0x62'),_0x36052b[_0xc8dc('0x5d')],_0x40125a[_0xc8dc('0x63')],md5(_0x40125a['uniqueid']));}else{_0x40125a[_0xc8dc('0x61')]='';}return getConnection(_0x36052b)[_0xc8dc('0x27')](function(_0xa2ccf2){_0x35a083=_0xa2ccf2;if(!_[_0xc8dc('0x22')](_0x5de428)){return getUser(_0x36052b,_0x5de428['name'],_0x35a083);}else{return getUser(_0x36052b,null,_0x35a083);}})['then'](function(_0x5548b8){_0x589e3e=_0x5548b8;return getEndUser(_0x36052b,_0x51b10c,_0x40125a[_0xc8dc('0x65')],_0x40125a['calleridnum'],_0x35a083);})[_0xc8dc('0x27')](function(_0x43596f){_0x318b0b=_0x43596f;return getTicket(_0x36052b,_0x589e3e,_0x318b0b,_0x51b10c,_0x40125a,_0x51b10c['Fields'],_0x35a083);})[_0xc8dc('0x27')](function(_0x16204d){_0x452642=_0x16204d;logger['info']('['+_0x40125a['lastevent'][_0xc8dc('0x7b')]()+_0xc8dc('0x7c'),_0x452642['id']);logger['info']('['+_0x40125a['lastevent'][_0xc8dc('0x7b')]()+_0xc8dc('0x7d'),_0x36052b[_0xc8dc('0x4c')]);})[_0xc8dc('0x70')](function(_0x11f342){logger[_0xc8dc('0x6f')]('['+_0x40125a[_0xc8dc('0x7a')][_0xc8dc('0x7b')]()+']',_0x11f342);});}; \ No newline at end of file +var _0x0828=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','customVariable','name','Variable','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','calleridname','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','display_name'];(function(_0xb927e4,_0x1ced6a){var _0x3b333c=function(_0x12e8eb){while(--_0x12e8eb){_0xb927e4['push'](_0xb927e4['shift']());}};_0x3b333c(++_0x1ced6a);}(_0x0828,0x14e));var _0x8082=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0828[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x8082('0x0'));var BPromise=require(_0x8082('0x1'));var md5=require(_0x8082('0x2'));var jsforce=require(_0x8082('0x3'));var util=require('util');var Redis=require(_0x8082('0x4'));var intUtil=require(_0x8082('0x5'));var config=require(_0x8082('0x6'));var logger=require(_0x8082('0x7'))('salesforce');config['redis']=_['defaults'](config[_0x8082('0x8')],{'host':_0x8082('0x9'),'port':0x18eb});var io=require(_0x8082('0xa'))(new Redis(config['redis']));function emit(_0xef4bfe,_0x3e0092,_0x8f699d){io['to'](_0xef4bfe)[_0x8082('0xb')](_0x3e0092,_0x8f699d);}function getTicket(_0xd28fbd,_0x2013fa,_0x4f7b8a,_0x22bc2f,_0x21400f,_0x2385be,_0x1edb40,_0x31c3b0){var _0x300b8d=Object['assign']({},{'OwnerId':_0x2013fa['id'],'Subject':intUtil[_0x8082('0xc')](_0x22bc2f[_0x8082('0xd')],_0x21400f,'\x20'),'Description':intUtil[_0x8082('0xc')](_0x22bc2f[_0x8082('0xe')],_0x21400f,'\x0a')},getCustomFields(_0x2385be,_0x21400f));if(_0x4f7b8a){if(_0x22bc2f[_0x8082('0xf')]===_0x8082('0x10')){_0x300b8d[_0x8082('0x11')]=moment['utc']();_0x300b8d['IsReminderSet']=![];_0x300b8d['IsRecurrence']=![];if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x13')||_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x14')){_0x300b8d[_0x8082('0x15')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x16')){_0x300b8d[_0x8082('0x17')]=_0x4f7b8a['id'];}}else if(_0x22bc2f['ticketType']===_0x8082('0x18')){if(_0x4f7b8a[_0x8082('0x12')]==='contact'){_0x300b8d[_0x8082('0x19')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x16')){_0x300b8d[_0x8082('0x1a')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]==='lead'&&_0x22bc2f['leadId']){_0x300b8d[_0x22bc2f[_0x8082('0x1b')]]=_0x4f7b8a['id'];}else{logger[_0x8082('0x1c')](_0x8082('0x1d'));}}}return _0x1edb40[_0x8082('0x1e')](_0x22bc2f[_0x8082('0xf')])[_0x8082('0x1f')](_0x300b8d);}function getUser(_0x326cf3,_0x4f623d,_0x4e7a99){if(!_[_0x8082('0x20')](_0x4f623d)&&intUtil['validateEmail'](_0x4f623d)){var _0x4686ed={'Email':_0x4f623d};var _0x4fa941={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e7a99[_0x8082('0x1e')](_0x8082('0x21'))[_0x8082('0x22')](_0x4686ed,_0x4fa941)[_0x8082('0x23')]()[_0x8082('0x24')](function(_0x5a26e4){if(_0x5a26e4[_0x8082('0x25')]){var _0x3a4f8d=_[_0x8082('0x22')](_0x5a26e4,function(_0x34e8ec){return _0x34e8ec[_0x8082('0x26')]===_0x4f623d;});if(_0x3a4f8d){logger[_0x8082('0x1c')](_0x8082('0x27'),_0x4f623d);return BPromise[_0x8082('0x28')]({'id':_0x3a4f8d['Id'],'name':_0x3a4f8d[_0x8082('0x29')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4f623d);return _0x4e7a99[_0x8082('0x2a')]()[_0x8082('0x24')](function(_0x4d2483){return BPromise[_0x8082('0x28')]({'id':_0x4d2483['user_id'],'name':_0x4d2483[_0x8082('0x2b')]});});}});}else{logger[_0x8082('0x1c')](_0x8082('0x2c'),_0x4f623d);return _0x4e7a99[_0x8082('0x2a')]()[_0x8082('0x24')](function(_0x396d14){return BPromise[_0x8082('0x28')]({'id':_0x396d14[_0x8082('0x2d')],'name':_0x396d14[_0x8082('0x2b')]});});}}function getEndUser(_0x4a61e5,_0x45ff84,_0x422dc1,_0x26c646,_0x4878eb){var _0x7a6abc={'$or':{'Phone':_0x26c646}};var _0x3bb366={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8082('0x28')]()[_0x8082('0x24')](function(){logger[_0x8082('0x1c')](_0x8082('0x2e'),_0x26c646,_0x45ff84[_0x8082('0x2f')]);switch(_0x45ff84[_0x8082('0x2f')]){case _0x8082('0x30'):var _0x5e2d65=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_['merge'](_0x5e2d65[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x34'))['find'](_0x5e2d65,_0x3bb366)['execute']()[_0x8082('0x24')](function(_0x17d3d1){if(_0x17d3d1&&_0x17d3d1[_0x8082('0x25')]){return _0x17d3d1;}else{var _0x2f2e5d=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x152e8b={};_0x152e8b[_0x45ff84[_0x8082('0x35')]]=_0x26c646;_[_0x8082('0x36')](_0x2f2e5d[_0x8082('0x33')],_0x152e8b);}return _0x4878eb['sobject'](_0x8082('0x37'))[_0x8082('0x22')](_0x2f2e5d,_0x3bb366);}});case _0x8082('0x38'):var _0x20dc21=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84['additionalSearchAccount']){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x39')]]=_0x26c646;_[_0x8082('0x36')](_0x20dc21[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x3a'))['find'](_0x20dc21,_0x3bb366)[_0x8082('0x23')]()[_0x8082('0x24')](function(_0x127264){if(_0x127264&&_0x127264['length']){return _0x127264;}else{var _0x100b68=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x12e10f={};_0x12e10f[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_['merge'](_0x100b68[_0x8082('0x33')],_0x12e10f);}return _0x4878eb['sobject'](_0x8082('0x34'))[_0x8082('0x22')](_0x100b68,_0x3bb366)['then'](function(_0x292f34){if(_0x292f34&&_0x292f34[_0x8082('0x25')]){return _0x292f34;}else{var _0x3c36cf=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x4831a9={};_0x4831a9[_0x45ff84[_0x8082('0x35')]]=_0x26c646;_[_0x8082('0x36')](_0x3c36cf[_0x8082('0x33')],_0x4831a9);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x37'))['find'](_0x3c36cf,_0x3bb366);}});}});case _0x8082('0x13'):var _0x5e2d65=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_[_0x8082('0x36')](_0x5e2d65['$or'],_0x789523);}return _0x4878eb[_0x8082('0x1e')]('Contact')[_0x8082('0x22')](_0x5e2d65,_0x3bb366)['execute']();case _0x8082('0x14'):var _0xfe9bbe=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x789523={};_0x789523[_0x45ff84['additionalSearchLead']]=_0x26c646;_[_0x8082('0x36')](_0xfe9bbe['$or'],_0x789523);}return _0x4878eb['sobject'](_0x8082('0x37'))[_0x8082('0x22')](_0xfe9bbe,_0x3bb366);case _0x8082('0x16'):var _0x20dc21=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x39')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x39')]]=_0x26c646;_['merge'](_0x20dc21[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x3a'))[_0x8082('0x22')](_0x20dc21,_0x3bb366);default:return null;}})[_0x8082('0x24')](function(_0x4e1ea9){if(_0x4e1ea9&&_0x4e1ea9['length']){var _0x239d01=_['first'](_0x4e1ea9);if(_0x239d01){return BPromise['resolve']({'id':_0x239d01['Id'],'name':_0x239d01[_0x8082('0x29')],'phone':_0x239d01[_0x8082('0x3b')],'endUserType':_0x239d01[_0x8082('0x3c')][_0x8082('0x3d')][_0x8082('0x3e')]()});}}})[_0x8082('0x24')](function(_0x3ad309){if(_0x3ad309){logger[_0x8082('0x1c')](_0x8082('0x3f'),_0x3ad309[_0x8082('0x12')],_0x26c646);return BPromise['resolve'](_0x3ad309);}else{logger['info'](_0x8082('0x40'),_0x26c646);var _0x44aa39={'Phone':_0x26c646};if(_0x45ff84[_0x8082('0x41')]){if(_0x45ff84[_0x8082('0x41')]==='contact'){logger[_0x8082('0x1c')](_0x8082('0x42'),_0x26c646,_0x45ff84[_0x8082('0x41')]);_0x44aa39[_0x8082('0x43')]=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')](_0x8082('0x46'),_0x26c646);}else if(_0x45ff84[_0x8082('0x41')]===_0x8082('0x14')){logger[_0x8082('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x26c646,_0x45ff84[_0x8082('0x41')]);_0x44aa39[_0x8082('0x43')]=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')]('Caller\x20-\x20%s',_0x26c646);_0x44aa39[_0x8082('0x47')]=_0x8082('0x48');}else if(_0x45ff84[_0x8082('0x41')]===_0x8082('0x16')){logger[_0x8082('0x1c')](_0x8082('0x42'),_0x26c646,_0x45ff84['moduleCreate']);_0x44aa39['Name']=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')](_0x8082('0x46'),_0x26c646);}else{return null;}}return _0x4878eb[_0x8082('0x1e')](_[_0x8082('0x49')](_0x45ff84[_0x8082('0x41')]))[_0x8082('0x1f')](_0x44aa39)[_0x8082('0x24')](function(_0x5c8888){return BPromise[_0x8082('0x28')]({'id':_0x5c8888['id'],'endUserType':_0x45ff84[_0x8082('0x41')]});});}});}function getCustomFields(_0xcf8ea8,_0x46843c){var _0x1eac58={};if(_0xcf8ea8[_0x8082('0x25')]>0x0){_[_0x8082('0x4a')](_0xcf8ea8,function(_0x140009){if(_[_0x8082('0x4b')]([_0x8082('0x4c'),_0x8082('0x4d')],_0x140009['type'])&&_0x140009[_0x8082('0x4e')]){_0x1eac58[_0x140009['idField']]=_0x140009[_0x8082('0x4f')][_0x8082('0x50')]();}else if(_0x140009[_0x8082('0x3d')]==='variable'&&_0x140009[_0x8082('0x51')]&&_0x140009[_0x8082('0x4e')]){_0x46843c[_0x140009[_0x8082('0x51')]]&&(_0x1eac58[_0x140009['idField']]=_0x46843c[_0x140009['variableName']][_0x8082('0x50')]());}else if(_0x140009[_0x8082('0x3d')]===_0x8082('0x52')&&_0x140009['Variable']&&_0x140009['Variable']['name']&&_0x140009['idField']){_0x46843c[_0x140009['Variable'][_0x8082('0x53')]['toLowerCase']()]&&(_0x1eac58[_0x140009['idField']]=_0x46843c[_0x140009[_0x8082('0x54')][_0x8082('0x53')][_0x8082('0x3e')]()][_0x8082('0x50')]());}});}return _0x1eac58;}function getConnection(_0x62d804){var _0x171c37=_0x62d804['password'][_0x8082('0x55')](_0x62d804['securityToken']);var _0x536c53=new jsforce['Connection']({'oauth2':{'loginUrl':_0x62d804[_0x8082('0x56')]||_0x8082('0x57'),'clientId':_0x62d804[_0x8082('0x58')],'clientSecret':_0x62d804[_0x8082('0x59')]}});return _0x536c53[_0x8082('0x5a')](_0x62d804[_0x8082('0x5b')],_0x171c37)[_0x8082('0x24')](function(){logger['info'](_0x8082('0x5c'));return _0x536c53;});}exports[_0x8082('0x5d')]=function(_0x5a1202,_0x5a02ac,_0x3a4011,_0x498af0,_0x40c864,_0x4a0b09){var _0x44fadf,_0x38093c,_0x3f218e,_0x4265af;_0x4a0b09[_0x8082('0x5e')]=intUtil[_0x8082('0x5f')](_0x4a0b09[_0x8082('0x5e')]);_0x4a0b09[_0x8082('0x56')]=intUtil['stripTrailingSlash'](_0x4a0b09[_0x8082('0x56')]);if(_0x40c864&&_0x40c864[_0x8082('0x60')]){logger['info'](_0x8082('0x61'),_0x8082('0x62'));_0x5a02ac['recordingURL']=util['format'](_0x8082('0x63'),_0x4a0b09[_0x8082('0x5e')],_0x5a02ac[_0x8082('0x64')],md5(_0x5a02ac[_0x8082('0x64')]));}else{_0x5a02ac['recordingURL']='';}return getConnection(_0x4a0b09)[_0x8082('0x24')](function(_0xd5a50c){_0x4265af=_0xd5a50c;return getUser(_0x4a0b09,_0x498af0[_0x8082('0x65')],_0x4265af);})[_0x8082('0x24')](function(_0x5ace68){_0x44fadf=_0x5ace68;return getEndUser(_0x4a0b09,_0x3a4011,_0x5a02ac['calleridname'],_0x5a02ac[_0x8082('0x66')],_0x4265af);})[_0x8082('0x24')](function(_0xc5370e){_0x38093c=_0xc5370e;return getTicket(_0x4a0b09,_0x44fadf,_0x38093c,_0x3a4011,_0x5a02ac,_0x3a4011[_0x8082('0x67')],_0x4265af,_0x8082('0x5d'));})[_0x8082('0x24')](function(_0x1b2210){_0x3f218e=_0x1b2210;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x3f218e['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3f218e['id'],_0x498af0[_0x8082('0x53')],_0x4a0b09[_0x8082('0x3d')]);switch(_0x4a0b09[_0x8082('0x3d')]){case _0x8082('0x68'):emit(util[_0x8082('0x45')](_0x8082('0x69'),_0x498af0[_0x8082('0x53')]),_0x8082('0x6a'),{'recordId':_0x3f218e['id']});break;case _0x8082('0x6b'):emit(util[_0x8082('0x45')]('user:%s',_0x498af0[_0x8082('0x53')]),_0x8082('0x6c'),{'uri':util[_0x8082('0x45')](_0x8082('0x6d'),_0x4265af[_0x8082('0x6e')],_0x3f218e['id'])});break;default:logger[_0x8082('0x6f')](_0x8082('0x70'));}})['catch'](function(_0x2d5e2b){logger['error']('[QUEUE]',_0x2d5e2b);});};exports[_0x8082('0x71')]=function(_0x3b929e,_0x4a6e7f,_0x239be2,_0x7eb418,_0x45be70,_0x40bbfe,_0x3fadd0){var _0x140093,_0x5e7e59,_0x54b217,_0x5b5c8f;_0x40bbfe['serverUrl']=intUtil[_0x8082('0x5f')](_0x40bbfe[_0x8082('0x5e')]);_0x40bbfe['remoteUri']=intUtil[_0x8082('0x5f')](_0x40bbfe[_0x8082('0x56')]);if(_0x3fadd0&&_0x3fadd0[_0x8082('0x72')]&&_0x3fadd0[_0x8082('0x72')]!==_0x8082('0x73')){logger[_0x8082('0x1c')](_0x8082('0x74'),'Recording\x20is\x20enabled!');_0x4a6e7f[_0x8082('0x75')]=util[_0x8082('0x45')](_0x8082('0x63'),_0x40bbfe['serverUrl'],_0x4a6e7f[_0x8082('0x64')],md5(_0x4a6e7f[_0x8082('0x64')]));}return getConnection(_0x40bbfe)[_0x8082('0x24')](function(_0x98d644){_0x5b5c8f=_0x98d644;return getUser(_0x40bbfe,_0x7eb418['email'],_0x5b5c8f);})['then'](function(_0x557817){_0x140093=_0x557817;return getEndUser(_0x40bbfe,_0x239be2,_0x4a6e7f[_0x8082('0x76')],_0x4a6e7f['destcalleridnum'],_0x5b5c8f);})[_0x8082('0x24')](function(_0x4626bf){_0x5e7e59=_0x4626bf;return getTicket(_0x40bbfe,_0x140093,_0x5e7e59,_0x239be2,_0x4a6e7f,_0x239be2[_0x8082('0x67')],_0x5b5c8f,_0x8082('0x71'));})[_0x8082('0x24')](function(_0x532f43){_0x54b217=_0x532f43;logger[_0x8082('0x1c')](_0x8082('0x77'),_0x54b217['id']);logger[_0x8082('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x54b217['id'],_0x7eb418['name'],_0x40bbfe['type']);switch(_0x40bbfe[_0x8082('0x3d')]){case _0x8082('0x68'):emit(util['format'](_0x8082('0x69'),_0x7eb418[_0x8082('0x53')]),_0x8082('0x6a'),{'recordId':_0x54b217['id']});break;case _0x8082('0x6b'):emit(util[_0x8082('0x45')](_0x8082('0x69'),_0x7eb418[_0x8082('0x53')]),'trigger:browser:url',{'uri':util[_0x8082('0x45')](_0x8082('0x6d'),_0x5b5c8f[_0x8082('0x6e')],_0x54b217['id'])});break;default:logger['error'](_0x8082('0x74'),_0x8082('0x78'));}})[_0x8082('0x79')](function(_0x20a9a2){logger['error'](_0x8082('0x74'),_0x20a9a2);});};exports[_0x8082('0x7a')]=function(_0x520cd7,_0x39bf44,_0x1d32ff,_0x4b59ea,_0x2e0599,_0x509cfa){var _0x287d32,_0x598a06,_0x3fbb8e,_0x3af86c;_0x509cfa[_0x8082('0x5e')]=intUtil['stripTrailingSlash'](_0x509cfa[_0x8082('0x5e')]);_0x509cfa[_0x8082('0x56')]=intUtil[_0x8082('0x5f')](_0x509cfa['remoteUri']);if(_0x2e0599&&_0x2e0599[_0x8082('0x60')]){logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')][_0x8082('0x7c')]()+']',_0x8082('0x62'));_0x39bf44[_0x8082('0x75')]=util[_0x8082('0x45')](_0x8082('0x63'),_0x509cfa[_0x8082('0x5e')],_0x39bf44[_0x8082('0x64')],md5(_0x39bf44['uniqueid']));}else{_0x39bf44[_0x8082('0x75')]='';}return getConnection(_0x509cfa)[_0x8082('0x24')](function(_0x19184c){_0x3af86c=_0x19184c;if(!_[_0x8082('0x20')](_0x4b59ea)){return getUser(_0x509cfa,_0x4b59ea['name'],_0x3af86c);}else{return getUser(_0x509cfa,null,_0x3af86c);}})[_0x8082('0x24')](function(_0x51c6f4){_0x287d32=_0x51c6f4;return getEndUser(_0x509cfa,_0x1d32ff,_0x39bf44[_0x8082('0x7d')],_0x39bf44[_0x8082('0x66')],_0x3af86c);})['then'](function(_0x1f32be){_0x598a06=_0x1f32be;return getTicket(_0x509cfa,_0x287d32,_0x598a06,_0x1d32ff,_0x39bf44,_0x1d32ff[_0x8082('0x67')],_0x3af86c);})['then'](function(_0x124965){_0x3fbb8e=_0x124965;logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')][_0x8082('0x7c')]()+']\x20Ticket\x20%s\x20created.',_0x3fbb8e['id']);logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x509cfa['type']);})[_0x8082('0x79')](function(_0x5b3ceb){logger['error']('['+_0x39bf44[_0x8082('0x7b')]['toUpperCase']()+']',_0x5b3ceb);});}; \ 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 df948de..2c066a9 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 _0x0201=['all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','socket.io-emitter','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20'];(function(_0x32d443,_0x48cf49){var _0x454ac3=function(_0x544980){while(--_0x544980){_0x32d443['push'](_0x32d443['shift']());}};_0x454ac3(++_0x48cf49);}(_0x0201,0x8a));var _0x1020=function(_0x58ddbf,_0x2e663b){_0x58ddbf=_0x58ddbf-0x0;var _0x1bab56=_0x0201[_0x58ddbf];return _0x1bab56;};'use strict';var _=require(_0x1020('0x0'));var Promise=require(_0x1020('0x1'));var rp=require(_0x1020('0x2'));var util=require(_0x1020('0x3'));var md5=require('md5');var Redis=require(_0x1020('0x4'));var intUtil=require(_0x1020('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1020('0x6'))(new Redis(config[_0x1020('0x7')]));function getAdminUser(_0x31c8d8,_0xd0d0d1,_0x456f4c,_0x229a3e,_0x3137f7,_0x274883){return new Promise(function(_0xa4f243,_0x4ce23d){var _0x581b8e={'method':_0x1020('0x8'),'uri':_0x229a3e+_0x1020('0x9')+'&'+_0x3137f7+'&'+_0x274883,'auth':_0xd0d0d1,'json':!![]};return rp(_0x581b8e)[_0x1020('0xa')](function(_0x2a69c6){if(_0x2a69c6['result'][_0x1020('0xb')]>0x0){_0x456f4c[_0x1020('0xc')]=_0x2a69c6[_0x1020('0xd')][0x0][_0x1020('0xe')];}logger[_0x1020('0xf')]('['+[_0x31c8d8['toUpperCase']()]+_0x1020('0x10'),_0x456f4c);_0xa4f243(_0x456f4c);})[_0x1020('0x11')](function(_0x3c562c){logger[_0x1020('0x12')]('['+[_0x31c8d8['toUpperCase']()]+']',_0x3c562c[_0x1020('0x13')]);_0x4ce23d(_0x3c562c[_0x1020('0x13')]);});});}function getUser(_0x3068bb,_0x3a87d7,_0x2ef947,_0x51c279,_0xc32abe){return function(_0x233f10){logger[_0x1020('0xf')]('['+[_0x3068bb[_0x1020('0x14')]()]+_0x1020('0x15'),_0x233f10);return new Promise(function(_0x4de33c,_0x116314){if(intUtil[_0x1020('0x16')](_0x233f10[_0x1020('0x17')])){var _0x23ba87={'method':_0x1020('0x8'),'uri':_0x2ef947+'sys_user?sysparm_query=email%3D'+_0x233f10[_0x1020('0x17')]+'&'+_0x51c279+'&'+_0xc32abe,'auth':_0x3a87d7,'json':!![]};logger['info']('['+[_0x3068bb[_0x1020('0x14')]()]+_0x1020('0x18'),_0x23ba87);return rp(_0x23ba87)[_0x1020('0xa')](function(_0x56b29c){logger[_0x1020('0xf')]('['+[_0x3068bb['toUpperCase']()]+'],\x20getUser\x20entity',_0x56b29c);if(_0x56b29c[_0x1020('0xd')][_0x1020('0xb')]>0x0&&String(_0x56b29c[_0x1020('0xd')][0x0][_0x1020('0x19')])===_0x1020('0x1a')){_0x233f10[_0x1020('0x1b')]=_0x56b29c[_0x1020('0xd')][0x0]['sys_id'];}else{_0x233f10[_0x1020('0x1b')]=_0x233f10[_0x1020('0xc')];_0x233f10[_0x1020('0x17')]=_0x233f10[_0x1020('0x1c')];}logger[_0x1020('0xf')]('['+[_0x3068bb[_0x1020('0x14')]()]+_0x1020('0x1d'),_0x233f10);_0x4de33c(_0x233f10);})[_0x1020('0x11')](function(_0x305c0a){logger['error']('['+[_0x3068bb[_0x1020('0x14')]()]+']',_0x305c0a['message']);_0x116314(_0x305c0a[_0x1020('0x13')]);});}else{logger[_0x1020('0xf')]('['+[_0x3068bb['toUpperCase']()]+_0x1020('0x1e'));_0x233f10[_0x1020('0x1b')]=_0x233f10[_0x1020('0xc')];_0x233f10['userEmail']=_0x233f10[_0x1020('0x1c')];_0x4de33c(_0x233f10);}});};}function createEndUser(_0xe2e2e3,_0x5f4184,_0x1371b4,_0xcddb8a,_0x2ab3fc){logger[_0x1020('0xf')]('['+[_0xe2e2e3[_0x1020('0x14')]()]+'],\x20createEndUser\x20input\x20crm',_0x1371b4);return new Promise(function(_0x31f501,_0x5b823d){var _0xc938ad={'method':_0x1020('0x1f'),'uri':_0xcddb8a+_0x1020('0x20')+_0x2ab3fc,'body':{'user_name':_0x1371b4[_0x1020('0x21')],'roles':_0x1020('0x22'),'first_name':_0x1371b4[_0x1020('0x21')],'active':_0x1020('0x1a'),'date_format':_0x1020('0x23'),'phone':_0x1371b4[_0x1020('0x21')]},'auth':_0x5f4184,'json':!![]};return rp(_0xc938ad)['then'](function(_0x27f7c2){logger[_0x1020('0xf')]('['+[_0xe2e2e3[_0x1020('0x14')]()]+'],\x20EndUser\x20schema',_0x27f7c2[_0x1020('0xd')]);_0x1371b4[_0x1020('0x24')]=_0x27f7c2[_0x1020('0xd')][_0x1020('0xe')];_0x31f501(_0x1371b4);})[_0x1020('0x11')](function(_0x28444e){logger[_0x1020('0x12')]('['+[_0xe2e2e3[_0x1020('0x14')]()]+']',_0x28444e['message']);_0x5b823d(_0x28444e[_0x1020('0x13')]);});});}function getEndUser(_0x13c638,_0x140728,_0x3457d9,_0x1a35bb,_0x3ed5da){return function(_0x3761d6){logger[_0x1020('0xf')]('['+[_0x13c638['toUpperCase']()]+_0x1020('0x25'),_0x3761d6);return new Promise(function(_0x3de15e,_0x10c79a){var _0x430ee2={'method':_0x1020('0x8'),'uri':_0x3457d9+_0x1020('0x26')+_0x3761d6[_0x1020('0x21')]+'&'+_0x1a35bb+'&'+_0x3ed5da,'auth':_0x140728,'json':!![]};return rp(_0x430ee2)['then'](function(_0x598756){if(_0x598756['result'][_0x1020('0xb')]>0x0){_0x3761d6[_0x1020('0x24')]=_0x598756[_0x1020('0xd')][0x0]['sys_id'];logger[_0x1020('0xf')]('['+[_0x13c638[_0x1020('0x14')]()]+'],\x20getEndUser\x20crm',_0x3761d6);_0x3de15e(_0x3761d6);}else{return createEndUser(_0x13c638,_0x140728,_0x3761d6,_0x3457d9,_0x1a35bb)[_0x1020('0xa')](function(_0xd80606){logger['info']('['+[_0x13c638[_0x1020('0x14')]()]+_0x1020('0x27'),_0xd80606);_0x3de15e(_0xd80606);});}})[_0x1020('0x11')](function(_0x2fcce8){logger[_0x1020('0x12')]('['+[_0x13c638[_0x1020('0x14')]()]+']',_0x2fcce8['message']);_0x10c79a(_0x2fcce8['message']);});});};}function getCustomFields(_0x4a2d37,_0x346dc3){var _0x59e80b={};if(_0x4a2d37[_0x1020('0xb')]>0x0){_[_0x1020('0x28')](_0x4a2d37,function(_0x32c8cd){if(_[_0x1020('0x29')](['string',_0x1020('0x2a')],_0x32c8cd[_0x1020('0x2b')])&&_0x32c8cd[_0x1020('0x2c')]&&!_0x32c8cd[_0x1020('0x2d')]){_0x59e80b[_0x32c8cd[_0x1020('0x2c')][_0x1020('0x2e')]()]=_0x32c8cd[_0x1020('0x2f')][_0x1020('0x30')]();}else if(_[_0x1020('0x29')]([_0x1020('0x31'),_0x1020('0x2a')],_0x32c8cd['type'])&&_0x32c8cd[_0x1020('0x32')]&&_0x32c8cd[_0x1020('0x2d')]){_0x59e80b[_0x32c8cd[_0x1020('0x32')][_0x1020('0x2e')]()]=_0x32c8cd[_0x1020('0x2f')][_0x1020('0x30')]();}else if(_0x32c8cd['type']===_0x1020('0x33')&&_0x32c8cd[_0x1020('0x34')]&&_0x32c8cd[_0x1020('0x32')]&&_0x32c8cd['customField']){_0x59e80b[_0x32c8cd[_0x1020('0x32')][_0x1020('0x2e')]()]=_0x346dc3[_0x32c8cd[_0x1020('0x34')]][_0x1020('0x30')]();}else if(_0x32c8cd['type']===_0x1020('0x35')&&_0x32c8cd[_0x1020('0x36')]&&_0x32c8cd[_0x1020('0x36')]['name']&&_0x32c8cd[_0x1020('0x32')]&&_0x32c8cd[_0x1020('0x2d')]){_0x59e80b[_0x32c8cd['idField'][_0x1020('0x2e')]()]=_0x346dc3[_0x32c8cd[_0x1020('0x36')][_0x1020('0x37')][_0x1020('0x2e')]()][_0x1020('0x30')]();}});}return _0x59e80b;}function getTicket(_0x2ec4f2,_0x29dc60,_0xfe6bca,_0x1f4f5a,_0x36da69,_0x59b072){return function(_0x49fe62){logger[_0x1020('0xf')]('['+[_0x2ec4f2[_0x1020('0x14')]()]+_0x1020('0x38'),_0x49fe62);return new Promise(function(_0x584d49,_0x4daa55){var _0x559e57=_0x2ec4f2[_0x1020('0x2e')]()===_0x1020('0x39')?_0x49fe62['userId']:_0x49fe62['endUserId'];var _0x4ae4d1={'method':_0x1020('0x1f'),'uri':_0xfe6bca+_0x1020('0x3a')+'?'+_0x59b072,'body':Object[_0x1020('0x3b')]({},{'active':_0x1020('0x1a'),'caller_id':_0x559e57,'assigned_to':_0x49fe62[_0x1020('0x1b')],'short_description':intUtil['getString'](_0x1f4f5a['Subjects'],_0x36da69,'\x20'),'description':intUtil[_0x1020('0x3c')](_0x1f4f5a['Descriptions'],_0x36da69,'\x0a')},getCustomFields(_0x1f4f5a[_0x1020('0x3d')],_0x36da69)),'auth':_0x29dc60,'json':!![]};return rp(_0x4ae4d1)[_0x1020('0xa')](function(_0x11ffd3){logger[_0x1020('0xf')]('['+[_0x2ec4f2['toUpperCase']()]+_0x1020('0x3e'),_0x11ffd3[_0x1020('0xd')]);_0x49fe62[_0x1020('0x3f')]=_0x11ffd3[_0x1020('0xd')][_0x1020('0xe')];_0x49fe62[_0x1020('0x40')]=_0x11ffd3['result'][_0x1020('0x41')];logger[_0x1020('0xf')]('['+[_0x2ec4f2[_0x1020('0x14')]()]+']\x20getTicket\x20crm',_0x49fe62);_0x584d49(_0x49fe62);})['catch'](function(_0x233213){logger[_0x1020('0x12')]('['+[_0x2ec4f2[_0x1020('0x14')]()]+']',_0x233213[_0x1020('0x13')]);_0x4daa55(_0x233213[_0x1020('0x13')]);});});};}function createRemoteTag(_0x5d16a8,_0x13e67f,_0x58cd86,_0xce3fd6){return new Promise(function(_0x5cbc14,_0x375f49){var _0x58dd04={'method':_0x1020('0x1f'),'uri':_0x58cd86+'label'+'?'+_0xce3fd6,'body':{'short_description':_0x5d16a8,'global':!![],'active':!![],'name':_0x5d16a8},'auth':_0x13e67f,'json':!![]};return rp(_0x58dd04)[_0x1020('0xa')](function(_0xa81ef9){var _0x198b35=_0xa81ef9[_0x1020('0xd')]['sys_id'];_0x5cbc14(_0x198b35);});});}function getRemoteTag(_0x9a209b,_0x4fd5e8,_0x1e99d4,_0x3bf152,_0x3dff7b){return new Promise(function(_0x25def8,_0x5a6cee){var _0x34ca69={'method':'GET','uri':_0x1e99d4+_0x1020('0x42')+_0x1020('0x43')+_0x9a209b+'&'+_0x3bf152,'auth':_0x4fd5e8,'json':!![]};return rp(_0x34ca69)['then'](function(_0x91bd8f){if(_0x91bd8f['result'][_0x1020('0xb')]>0x0){var _0x106fde=_0x91bd8f[_0x1020('0xd')][0x0][_0x1020('0xe')];_0x25def8(_0x106fde);}else{return createRemoteTag(_0x9a209b,_0x4fd5e8,_0x1e99d4,_0x3bf152)[_0x1020('0xa')](function(_0x1758ea){_0x25def8(_0x1758ea);});}});});}function assignTagToIncident(_0x10fdea,_0x59c1af,_0x8d47c,_0x5903d9,_0x3b8ccb){return new Promise(function(_0x23e9d8,_0x10b69c){var _0x3df45b={'method':_0x1020('0x1f'),'uri':_0x8d47c+'label_entry'+'?'+_0x3b8ccb,'body':{'label':_0x10fdea,'table':_0x1020('0x3a'),'id_type':_0x1020('0x44'),'table_key':_0x5903d9[_0x1020('0x3f')],'title':_0x1020('0x45')+_0x5903d9[_0x1020('0x40')],'id_display':_0x5903d9['ticketNumber']},'auth':_0x59c1af,'json':!![]};return rp(_0x3df45b)[_0x1020('0xa')](function(_0x4e3805){_0x23e9d8();})[_0x1020('0x11')](function(){_0x23e9d8();});});}function manageTags(_0x2c0826,_0x586a45,_0x9ece17,_0x2183b2,_0x320a67,_0x36b6f8,_0x1a6d56){return new Promise(function(_0x3a3d60,_0x26d88a){var _0x3eefec=[];_0x586a45[_0x1020('0x28')](function(_0x22d905){_0x3eefec['push'](getRemoteTag(_0x22d905,_0x9ece17,_0x2183b2,_0x36b6f8,_0x1a6d56));});return Promise[_0x1020('0x46')](_0x3eefec)[_0x1020('0xa')](function(_0x40a5dd){if(_0x40a5dd[_0x1020('0xb')]){logger['info']('['+[_0x2c0826['toUpperCase']()]+_0x1020('0x47'),_0x40a5dd);var _0x4b4b8d=[];_0x40a5dd[_0x1020('0x28')](function(_0x944626){_0x4b4b8d[_0x1020('0x48')](assignTagToIncident(_0x944626,_0x9ece17,_0x2183b2,_0x320a67,_0x36b6f8));});return Promise[_0x1020('0x46')](_0x4b4b8d)[_0x1020('0xa')](function(){_0x3a3d60();})[_0x1020('0x11')](function(){_0x3a3d60();});}else{_0x3a3d60();}});});}function getTags(_0x47a7a1,_0x5c95e0,_0x1c8255,_0x3f0ac2,_0x2398d5,_0x5baa28){return function(_0x566728){return new Promise(function(_0x4b2d92,_0x570776){var _0x49a2f4=[];var _0x294b18=_0x3f0ac2[_0x1020('0x49')];if(_0x294b18&&_0x294b18[_0x1020('0xb')]>0x0){_0x49a2f4=_['map'](_0x294b18,_0x1020('0x37'));}if(_0x49a2f4[_0x1020('0xb')]>0x0){return manageTags(_0x47a7a1,_0x49a2f4,_0x5c95e0,_0x1c8255,_0x566728,_0x2398d5,_0x5baa28)[_0x1020('0xa')](function(){_0x4b2d92(_0x566728);});}else{_0x4b2d92(_0x566728);}});};}function emit(_0x5696a7,_0x7fa968,_0x42c260){var _0x330df4='%26sysparm_record_target%3Dincident'+_0x1020('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x1020('0x4b');var _0x276310={'uri':_0x5696a7+_0x1020('0x4c')+_0x42c260+_0x330df4};io['to'](util[_0x1020('0x4d')](_0x1020('0x4e'),_0x7fa968))['emit'](_0x1020('0x4f'),_0x276310);}exports['cs']=function(_0x394257,_0x45faa6,_0x87717b,_0x2f9a7b,_0x1f9d39,_0x3286bb,_0x5eee81,_0x1be9e3){var _0x928351={};var _0x567fb1={'user':_0x3286bb[_0x1020('0x50')],'pass':_0x3286bb[_0x1020('0x51')]};var _0x352fb6=_0x1020('0x52');var _0x5083b0=_0x1020('0x53');_0x3286bb[_0x1020('0x54')]=intUtil[_0x1020('0x55')](_0x3286bb[_0x1020('0x54')]);_0x3286bb[_0x1020('0x56')]=intUtil['stripTrailingSlash'](_0x3286bb['serverUrl']);var _0xe8fd89=util[_0x1020('0x4d')](_0x1020('0x57'),_0x3286bb['remoteUri']);_0x928351['userEmail']=!_[_0x1020('0x58')](_0x2f9a7b)?_0x2f9a7b[_0x1020('0x59')]:null;_0x928351['adminEmail']=_0x3286bb['email'];_0x928351[_0x1020('0x21')]=_0x1be9e3[_0x1020('0x2e')]()===_0x1020('0x39')?_0x45faa6[_0x1020('0x5a')]:_0x45faa6[_0x1020('0x5b')];_0x928351['callDirection']=_0x1be9e3===_0x1020('0x5c')||_0x1be9e3===_0x1020('0x5d')?_0x1020('0x5c'):_0x1020('0x39');var _0x4b656d=util[_0x1020('0x4d')](_0x1020('0x5e'),_0x3286bb['serverUrl'],_0x45faa6[_0x1020('0x5f')],md5(_0x45faa6[_0x1020('0x5f')]));if(_0x1f9d39&&_0x1f9d39[_0x1020('0x60')]){logger[_0x1020('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x45faa6[_0x1020('0x61')]=_0x4b656d;}else if(_0x5eee81&&_0x5eee81['recordingFormat']&&_0x5eee81[_0x1020('0x62')]!=='none'){logger[_0x1020('0xf')]('[OUTBOUND]',_0x1020('0x63'));_0x45faa6[_0x1020('0x61')]=_0x4b656d;}else{_0x45faa6[_0x1020('0x61')]='';}return getAdminUser(_0x1be9e3,_0x567fb1,_0x928351,_0xe8fd89,_0x5083b0,_0x352fb6)[_0x1020('0xa')](getUser(_0x1be9e3,_0x567fb1,_0xe8fd89,_0x5083b0,_0x352fb6))[_0x1020('0xa')](getEndUser(_0x1be9e3,_0x567fb1,_0xe8fd89,_0x5083b0,_0x352fb6))[_0x1020('0xa')](getTicket(_0x1be9e3,_0x567fb1,_0xe8fd89,_0x87717b,_0x45faa6,_0x5083b0))['then'](function(_0x3d6166){logger[_0x1020('0xf')](util['format'](_0x1020('0x64'),_0x3d6166[_0x1020('0x3f')]));logger['info'](util[_0x1020('0x4d')](_0x1020('0x65'),_0x1be9e3));if(_0x1be9e3!==_0x1020('0x5d')){logger[_0x1020('0xf')]('['+[_0x1be9e3[_0x1020('0x14')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3286bb['remoteUri'],_0x2f9a7b[_0x1020('0x37')],_0x3d6166['ticketId']);}})['catch'](function(_0x3eb51a){logger[_0x1020('0x12')]('['+[_0x1be9e3[_0x1020('0x14')]()]+_0x1020('0x66'),util[_0x1020('0x67')](_0x3eb51a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6829=['remoteUri','stripTrailingSlash','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','queue','unmanaged','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toString','idField','variable','variableName','toLowerCase','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','all','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x6829,0x164));var _0x9682=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6829[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x9682('0x0'));var Promise=require(_0x9682('0x1'));var rp=require(_0x9682('0x2'));var util=require(_0x9682('0x3'));var md5=require(_0x9682('0x4'));var Redis=require(_0x9682('0x5'));var intUtil=require(_0x9682('0x6'));var config=require(_0x9682('0x7'));var logger=require(_0x9682('0x8'))(_0x9682('0x9'));config['redis']=_[_0x9682('0xa')](config[_0x9682('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9682('0xb')]));function getAdminUser(_0x294c65,_0x12c509,_0x238b68,_0x269a7e,_0x35c928,_0x5630b){return new Promise(function(_0x26a956,_0x407e97){var _0x2e7bf5={'method':'GET','uri':_0x269a7e+_0x9682('0xc')+'&'+_0x35c928+'&'+_0x5630b,'auth':_0x12c509,'json':!![]};return rp(_0x2e7bf5)[_0x9682('0xd')](function(_0x5d82f3){if(_0x5d82f3[_0x9682('0xe')][_0x9682('0xf')]>0x0){_0x238b68[_0x9682('0x10')]=_0x5d82f3['result'][0x0][_0x9682('0x11')];}logger[_0x9682('0x12')]('['+[_0x294c65[_0x9682('0x13')]()]+_0x9682('0x14'),_0x238b68);_0x26a956(_0x238b68);})['catch'](function(_0x2e5173){logger[_0x9682('0x15')]('['+[_0x294c65['toUpperCase']()]+']',_0x2e5173['message']);_0x407e97(_0x2e5173[_0x9682('0x16')]);});});}function getUser(_0x3abb67,_0x1a916b,_0x36f8d9,_0x2cc921,_0x158505){return function(_0x966376){logger['info']('['+[_0x3abb67[_0x9682('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x966376);return new Promise(function(_0x117613,_0x23ef2a){if(intUtil[_0x9682('0x17')](_0x966376[_0x9682('0x18')])){var _0x1061bc={'method':_0x9682('0x19'),'uri':_0x36f8d9+_0x9682('0x1a')+_0x966376['userEmail']+'&'+_0x2cc921+'&'+_0x158505,'auth':_0x1a916b,'json':!![]};logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1061bc);return rp(_0x1061bc)['then'](function(_0x5cf413){logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+_0x9682('0x1b'),_0x5cf413);if(_0x5cf413[_0x9682('0xe')][_0x9682('0xf')]>0x0&&String(_0x5cf413[_0x9682('0xe')][0x0][_0x9682('0x1c')])===_0x9682('0x1d')){_0x966376[_0x9682('0x1e')]=_0x5cf413[_0x9682('0xe')][0x0][_0x9682('0x11')];}else{_0x966376['userId']=_0x966376[_0x9682('0x10')];_0x966376[_0x9682('0x18')]=_0x966376[_0x9682('0x1f')];}logger[_0x9682('0x12')]('['+[_0x3abb67['toUpperCase']()]+_0x9682('0x20'),_0x966376);_0x117613(_0x966376);})[_0x9682('0x21')](function(_0x1a5bf4){logger[_0x9682('0x15')]('['+[_0x3abb67['toUpperCase']()]+']',_0x1a5bf4[_0x9682('0x16')]);_0x23ef2a(_0x1a5bf4[_0x9682('0x16')]);});}else{logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+_0x9682('0x22'));_0x966376[_0x9682('0x1e')]=_0x966376[_0x9682('0x10')];_0x966376[_0x9682('0x18')]=_0x966376['adminEmail'];_0x117613(_0x966376);}});};}function createEndUser(_0x54a808,_0xa98aab,_0x548197,_0x235b14,_0x226e85){logger[_0x9682('0x12')]('['+[_0x54a808[_0x9682('0x13')]()]+_0x9682('0x23'),_0x548197);return new Promise(function(_0x20daeb,_0x4c46e9){var _0x4c5121={'method':_0x9682('0x24'),'uri':_0x235b14+_0x9682('0x25')+_0x226e85,'body':{'user_name':_0x548197[_0x9682('0x26')],'roles':_0x9682('0x27'),'first_name':_0x548197[_0x9682('0x26')],'active':_0x9682('0x1d'),'date_format':_0x9682('0x28'),'phone':_0x548197[_0x9682('0x26')]},'auth':_0xa98aab,'json':!![]};return rp(_0x4c5121)[_0x9682('0xd')](function(_0x37cfc8){logger[_0x9682('0x12')]('['+[_0x54a808['toUpperCase']()]+_0x9682('0x29'),_0x37cfc8['result']);_0x548197[_0x9682('0x2a')]=_0x37cfc8['result'][_0x9682('0x11')];_0x20daeb(_0x548197);})[_0x9682('0x21')](function(_0x53cab5){logger[_0x9682('0x15')]('['+[_0x54a808['toUpperCase']()]+']',_0x53cab5['message']);_0x4c46e9(_0x53cab5[_0x9682('0x16')]);});});}function getEndUser(_0x17fe89,_0x8ccdcd,_0x11806d,_0x2bf386,_0x1fc7fd){return function(_0x571054){logger[_0x9682('0x12')]('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2b'),_0x571054);return new Promise(function(_0x8a64e7,_0x11272d){var _0xa85bc4={'method':'GET','uri':_0x11806d+_0x9682('0x2c')+_0x571054[_0x9682('0x26')]+'&'+_0x2bf386+'&'+_0x1fc7fd,'auth':_0x8ccdcd,'json':!![]};return rp(_0xa85bc4)[_0x9682('0xd')](function(_0x4acbd7){if(_0x4acbd7[_0x9682('0xe')]['length']>0x0){_0x571054[_0x9682('0x2a')]=_0x4acbd7[_0x9682('0xe')][0x0][_0x9682('0x11')];logger[_0x9682('0x12')]('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2d'),_0x571054);_0x8a64e7(_0x571054);}else{return createEndUser(_0x17fe89,_0x8ccdcd,_0x571054,_0x11806d,_0x2bf386)[_0x9682('0xd')](function(_0x5899e9){logger['info']('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2e'),_0x5899e9);_0x8a64e7(_0x5899e9);});}})['catch'](function(_0x20bf4e){logger[_0x9682('0x15')]('['+[_0x17fe89[_0x9682('0x13')]()]+']',_0x20bf4e[_0x9682('0x16')]);_0x11272d(_0x20bf4e['message']);});});};}function getCustomFields(_0x46d187,_0x16ea9b){var _0x82f20e={};if(_0x46d187[_0x9682('0xf')]>0x0){_[_0x9682('0x2f')](_0x46d187,function(_0x3a55f3){if(_[_0x9682('0x30')]([_0x9682('0x31'),_0x9682('0x32')],_0x3a55f3[_0x9682('0x33')])&&_0x3a55f3[_0x9682('0x34')]&&!_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x34')]['toLowerCase']()]=_0x3a55f3['content'][_0x9682('0x36')]();}else if(_[_0x9682('0x30')](['string',_0x9682('0x32')],_0x3a55f3[_0x9682('0x33')])&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x37')]['toLowerCase']()]=_0x3a55f3['content'][_0x9682('0x36')]();}else if(_0x3a55f3[_0x9682('0x33')]===_0x9682('0x38')&&_0x3a55f3[_0x9682('0x39')]&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3['idField'][_0x9682('0x3a')]()]=_0x16ea9b[_0x3a55f3[_0x9682('0x39')]][_0x9682('0x36')]();}else if(_0x3a55f3[_0x9682('0x33')]==='customVariable'&&_0x3a55f3[_0x9682('0x3b')]&&_0x3a55f3[_0x9682('0x3b')][_0x9682('0x3c')]&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x37')][_0x9682('0x3a')]()]=_0x16ea9b[_0x3a55f3[_0x9682('0x3b')][_0x9682('0x3c')][_0x9682('0x3a')]()][_0x9682('0x36')]();}});}return _0x82f20e;}function getTicket(_0xcffb8f,_0x1743e3,_0x9ea681,_0x512e51,_0x1dbc75,_0x4991ea){return function(_0x3da836){logger[_0x9682('0x12')]('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x3d'),_0x3da836);return new Promise(function(_0x49d2b7,_0xf43402){var _0x1318ec=_0xcffb8f[_0x9682('0x3a')]()==='outbound'?_0x3da836[_0x9682('0x1e')]:_0x3da836[_0x9682('0x2a')];var _0x3b4e0f={'method':_0x9682('0x24'),'uri':_0x9ea681+'incident'+'?'+_0x4991ea,'body':Object[_0x9682('0x3e')]({},{'active':'true','caller_id':_0x1318ec,'assigned_to':_0x3da836[_0x9682('0x1e')],'short_description':intUtil[_0x9682('0x3f')](_0x512e51['Subjects'],_0x1dbc75,'\x20'),'description':intUtil[_0x9682('0x3f')](_0x512e51['Descriptions'],_0x1dbc75,'\x0a')},getCustomFields(_0x512e51[_0x9682('0x40')],_0x1dbc75)),'auth':_0x1743e3,'json':!![]};return rp(_0x3b4e0f)[_0x9682('0xd')](function(_0x4308df){logger[_0x9682('0x12')]('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x41'),_0x4308df[_0x9682('0xe')]);_0x3da836[_0x9682('0x42')]=_0x4308df[_0x9682('0xe')][_0x9682('0x11')];_0x3da836[_0x9682('0x43')]=_0x4308df[_0x9682('0xe')][_0x9682('0x44')];logger['info']('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x45'),_0x3da836);_0x49d2b7(_0x3da836);})['catch'](function(_0x2a7a65){logger[_0x9682('0x15')]('['+[_0xcffb8f[_0x9682('0x13')]()]+']',_0x2a7a65['message']);_0xf43402(_0x2a7a65[_0x9682('0x16')]);});});};}function createRemoteTag(_0xc58fd3,_0x1ea04a,_0x1b11f1,_0x381d17){return new Promise(function(_0x19a734,_0x11b33d){var _0x421a5c={'method':'POST','uri':_0x1b11f1+_0x9682('0x46')+'?'+_0x381d17,'body':{'short_description':_0xc58fd3,'global':!![],'active':!![],'name':_0xc58fd3},'auth':_0x1ea04a,'json':!![]};return rp(_0x421a5c)['then'](function(_0x1f51ca){var _0x27b639=_0x1f51ca[_0x9682('0xe')]['sys_id'];_0x19a734(_0x27b639);});});}function getRemoteTag(_0x4aa8b7,_0x11ab4c,_0x2a201d,_0x1a064a,_0x38133d){return new Promise(function(_0x24bf6c,_0x248415){var _0x398485={'method':_0x9682('0x19'),'uri':_0x2a201d+'label'+'?sysparm_query=name%3D'+_0x4aa8b7+'&'+_0x1a064a,'auth':_0x11ab4c,'json':!![]};return rp(_0x398485)[_0x9682('0xd')](function(_0x27ab83){if(_0x27ab83[_0x9682('0xe')]['length']>0x0){var _0x3f6962=_0x27ab83['result'][0x0][_0x9682('0x11')];_0x24bf6c(_0x3f6962);}else{return createRemoteTag(_0x4aa8b7,_0x11ab4c,_0x2a201d,_0x1a064a)[_0x9682('0xd')](function(_0x276583){_0x24bf6c(_0x276583);});}});});}function assignTagToIncident(_0x108295,_0x11aa9d,_0x34bc1a,_0x4c2483,_0x15da87){return new Promise(function(_0x17bcb8,_0x54f08c){var _0x33869a={'method':_0x9682('0x24'),'uri':_0x34bc1a+_0x9682('0x47')+'?'+_0x15da87,'body':{'label':_0x108295,'table':_0x9682('0x48'),'id_type':_0x9682('0x49'),'table_key':_0x4c2483[_0x9682('0x42')],'title':_0x9682('0x4a')+_0x4c2483[_0x9682('0x43')],'id_display':_0x4c2483[_0x9682('0x43')]},'auth':_0x11aa9d,'json':!![]};return rp(_0x33869a)['then'](function(_0x28f75a){_0x17bcb8();})[_0x9682('0x21')](function(){_0x17bcb8();});});}function manageTags(_0x320d16,_0x464d6d,_0x280c94,_0x1c6f2f,_0x1d89fd,_0xcd8c40,_0x525057){return new Promise(function(_0x3882b7,_0x2a4dbf){var _0xc4d987=[];_0x464d6d[_0x9682('0x2f')](function(_0x2668e2){_0xc4d987['push'](getRemoteTag(_0x2668e2,_0x280c94,_0x1c6f2f,_0xcd8c40,_0x525057));});return Promise[_0x9682('0x4b')](_0xc4d987)[_0x9682('0xd')](function(_0x372d18){if(_0x372d18[_0x9682('0xf')]){logger[_0x9682('0x12')]('['+[_0x320d16[_0x9682('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x372d18);var _0x37eb64=[];_0x372d18[_0x9682('0x2f')](function(_0xd9b5e5){_0x37eb64[_0x9682('0x4c')](assignTagToIncident(_0xd9b5e5,_0x280c94,_0x1c6f2f,_0x1d89fd,_0xcd8c40));});return Promise[_0x9682('0x4b')](_0x37eb64)[_0x9682('0xd')](function(){_0x3882b7();})[_0x9682('0x21')](function(){_0x3882b7();});}else{_0x3882b7();}});});}function getTags(_0x192ad2,_0x3e858c,_0x1458d6,_0x5f09f2,_0x4afc82,_0x4e4b17){return function(_0x4ab20a){return new Promise(function(_0x593eb2,_0x48e5bf){var _0x531755=[];var _0x1bb4fa=_0x5f09f2[_0x9682('0x4d')];if(_0x1bb4fa&&_0x1bb4fa[_0x9682('0xf')]>0x0){_0x531755=_['map'](_0x1bb4fa,_0x9682('0x3c'));}if(_0x531755[_0x9682('0xf')]>0x0){return manageTags(_0x192ad2,_0x531755,_0x3e858c,_0x1458d6,_0x4ab20a,_0x4afc82,_0x4e4b17)[_0x9682('0xd')](function(){_0x593eb2(_0x4ab20a);});}else{_0x593eb2(_0x4ab20a);}});};}function emit(_0xe95812,_0x2caebf,_0x221c1a){var _0x30ad6b=_0x9682('0x4e')+_0x9682('0x4f')+_0x9682('0x50')+_0x9682('0x51');var _0x2c5f98={'uri':_0xe95812+_0x9682('0x52')+_0x221c1a+_0x30ad6b};io['to'](util['format'](_0x9682('0x53'),_0x2caebf))[_0x9682('0x54')](_0x9682('0x55'),_0x2c5f98);}exports['cs']=function(_0x26ebb9,_0xcc4310,_0x2a6173,_0x2e845f,_0x1c3077,_0x4430c5,_0x3e70fc,_0x4895a1){var _0x4cbf53={};var _0x49bbeb={'user':_0x4430c5[_0x9682('0x56')],'pass':_0x4430c5[_0x9682('0x57')]};var _0x225190='sysparm_limit=1';var _0x2a6527='sysparm_display_value=true';_0x4430c5[_0x9682('0x58')]=intUtil[_0x9682('0x59')](_0x4430c5[_0x9682('0x58')]);_0x4430c5['serverUrl']=intUtil['stripTrailingSlash'](_0x4430c5['serverUrl']);var _0x3ff1a6=util[_0x9682('0x5a')](_0x9682('0x5b'),_0x4430c5[_0x9682('0x58')]);_0x4cbf53['userEmail']=!_[_0x9682('0x5c')](_0x2e845f)?_0x2e845f['email']:null;_0x4cbf53[_0x9682('0x1f')]=_0x4430c5[_0x9682('0x5d')];_0x4cbf53[_0x9682('0x26')]=_0x4895a1['toLowerCase']()===_0x9682('0x5e')?_0xcc4310[_0x9682('0x5f')]:_0xcc4310['calleridnum'];_0x4cbf53[_0x9682('0x60')]=_0x4895a1===_0x9682('0x61')||_0x4895a1===_0x9682('0x62')?'queue':_0x9682('0x5e');var _0x17236c=util[_0x9682('0x5a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4430c5[_0x9682('0x63')],_0xcc4310[_0x9682('0x64')],md5(_0xcc4310[_0x9682('0x64')]));if(_0x1c3077&&_0x1c3077[_0x9682('0x65')]){logger[_0x9682('0x12')]('[QUEUE]',_0x9682('0x66'));_0xcc4310[_0x9682('0x67')]=_0x17236c;}else if(_0x3e70fc&&_0x3e70fc[_0x9682('0x68')]&&_0x3e70fc[_0x9682('0x68')]!==_0x9682('0x69')){logger[_0x9682('0x12')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xcc4310[_0x9682('0x67')]=_0x17236c;}else{_0xcc4310[_0x9682('0x67')]='';}return getAdminUser(_0x4895a1,_0x49bbeb,_0x4cbf53,_0x3ff1a6,_0x2a6527,_0x225190)['then'](getUser(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6527,_0x225190))[_0x9682('0xd')](getEndUser(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6527,_0x225190))[_0x9682('0xd')](getTicket(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6173,_0xcc4310,_0x2a6527))[_0x9682('0xd')](function(_0x4e4c24){logger[_0x9682('0x12')](util[_0x9682('0x5a')](_0x9682('0x6a'),_0x4e4c24[_0x9682('0x42')]));logger[_0x9682('0x12')](util['format'](_0x9682('0x6b'),_0x4895a1));if(_0x4895a1!==_0x9682('0x62')){logger[_0x9682('0x12')]('['+[_0x4895a1[_0x9682('0x13')]()]+']',_0x9682('0x6c'));emit(_0x4430c5[_0x9682('0x58')],_0x2e845f['name'],_0x4e4c24[_0x9682('0x42')]);}})['catch'](function(_0x1b4258){logger[_0x9682('0x15')]('['+[_0x4895a1[_0x9682('0x13')]()]+_0x9682('0x6d'),util[_0x9682('0x6e')](_0x1b4258,{'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 b33fbfe..61b68c2 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 _0x8906=['find','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Contacts','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','debug','[HTTP]','map','type','string','nameField','customField','content','toString','custom_fields','variable','customVariable','Variable','toLowerCase','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','charAt','unmanaged','%s/service/v4_1/rest.php','toUpperCase','Recording\x20is\x20enabled!','lastevent','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','info','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','parent_id','parent_type','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','format','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','user_name'];(function(_0x44eb51,_0x2498f1){var _0x565da8=function(_0x4283de){while(--_0x4283de){_0x44eb51['push'](_0x44eb51['shift']());}};_0x565da8(++_0x2498f1);}(_0x8906,0x1ad));var _0x6890=function(_0x429620,_0x24cc86){_0x429620=_0x429620-0x0;var _0x2cfb64=_0x8906[_0x429620];return _0x2cfb64;};'use strict';var _=require(_0x6890('0x0'));var rp=require(_0x6890('0x1'));var BPromise=require('bluebird');var md5=require(_0x6890('0x2'));var util=require(_0x6890('0x3'));var Redis=require(_0x6890('0x4'));var intUtil=require('./util');var config=require(_0x6890('0x5'));var logger=require(_0x6890('0x6'))(_0x6890('0x7'));config['redis']=_['defaults'](config[_0x6890('0x8')],{'host':_0x6890('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6890('0x8')]));var def={'method':_0x6890('0xa'),'json':!![]};function emit(_0x4ce73c,_0x590df3,_0x50a83b){io['to'](_0x4ce73c)['emit'](_0x590df3,_0x50a83b);}function getTicket(_0x35c53c,_0x5e19b3,_0x48b826,_0x25c2a4,_0x39e174,_0x4018c4,_0x3ad54e,_0x45993b){logger[_0x6890('0xb')]('Creating\x20new\x20ticket...');var _0x38edbf=new Date();var _0x1b943d=[{'name':_0x6890('0xc'),'value':intUtil[_0x6890('0xd')](_0x25c2a4[_0x6890('0xe')],_0x39e174,'\x20')},{'name':_0x6890('0xf'),'value':_0x5e19b3['id']},{'name':'created_by','value':_0x5e19b3['id']},{'name':_0x6890('0x10'),'value':intUtil[_0x6890('0xd')](_0x25c2a4[_0x6890('0x11')],_0x39e174,'\x0a')},{'name':_0x6890('0x12'),'value':_0x38edbf[_0x6890('0x13')]()[_0x6890('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x6890('0x15'),'value':_0x48b826['id']},{'name':_0x6890('0x16'),'value':'Contacts'},{'name':_0x6890('0x17'),'value':_0x48b826[_0x6890('0xc')]},{'name':_0x6890('0x18'),'value':_0x45993b}];if(_0x4018c4[_0x6890('0x19')]){_['forEach'](_0x4018c4,function(_0x25ae28){if(_0x39e174[_0x25ae28[_0x6890('0x1a')]]){_0x1b943d[_0x6890('0x1b')]({'name':_0x25ae28[_0x6890('0x1c')],'value':_0x39e174[_0x25ae28[_0x6890('0x1a')]]});}});}return request({'form':{'method':_0x6890('0x1d'),'input_type':_0x6890('0x1e'),'response_type':_0x6890('0x1e'),'rest_data':JSON[_0x6890('0x1f')]({'session':_0x3ad54e['id'],'module_name':'Calls','name_value_list':_0x1b943d})}});}function getAuth(_0x2cd3d8){return util[_0x6890('0x20')]('Basic\x20%s',new Buffer(_0x2cd3d8[_0x6890('0x21')]+':X')['toString']('base64'));}function getServerInfo(_0x21d454){return request({'form':{'method':_0x6890('0x22'),'input_type':_0x6890('0x1e'),'response_type':_0x6890('0x1e'),'rest_data':JSON[_0x6890('0x1f')]({'session':_0x21d454['id']})}});}function getUser(_0x9be5e2,_0x4f282c,_0x2e5a52){if(!_[_0x6890('0x23')](_0x4f282c)){logger[_0x6890('0xb')](_0x6890('0x24'),_0x4f282c);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6890('0x1f')]({'session':_0x2e5a52['id'],'module_name':_0x6890('0x25'),'query':util[_0x6890('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4f282c),'order_by':'','offset':'0','select_fields':['id',_0x6890('0xc'),_0x6890('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2c1231){if(_0x2c1231['entry_list'][_0x6890('0x19')]){var _0x521ad7=_[_0x6890('0x27')](_0x2c1231[_0x6890('0x28')],function(_0x2a632e){return _0x2a632e['name_value_list']['user_name'][_0x6890('0x29')]===_0x4f282c;});if(_0x521ad7){logger['info'](_0x6890('0x2a'));return BPromise[_0x6890('0x2b')]({'id':_0x521ad7[_0x6890('0x2c')]['id']['value'],'name':_0x521ad7[_0x6890('0x2c')]['name'][_0x6890('0x29')]});}}logger[_0x6890('0xb')](_0x6890('0x2d'));return BPromise[_0x6890('0x2b')]({'id':_0x2e5a52[_0x6890('0x2c')]['user_id']['value'],'name':_0x2e5a52['name_value_list']['user_name'][_0x6890('0x29')]});});}else{logger[_0x6890('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2e5a52[_0x6890('0x2c')][_0x6890('0x2e')][_0x6890('0x29')],'name':_0x2e5a52[_0x6890('0x2c')][_0x6890('0x26')]['value']});}}function getEndUser(_0x2c8b60,_0x114d62,_0x2de3ed,_0x43929d){logger[_0x6890('0xb')]('Searching\x20enduser\x20with\x20phone',_0x2de3ed);return request({'form':{'method':'get_entry_list','input_type':_0x6890('0x1e'),'response_type':'JSON','rest_data':JSON[_0x6890('0x1f')]({'session':_0x43929d['id'],'module_name':_0x6890('0x2f'),'query':util[_0x6890('0x20')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2de3ed),'order_by':'','offset':'0','select_fields':['id',_0x6890('0xc'),_0x6890('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6890('0x31')](function(_0x275a5d){if(_0x275a5d[_0x6890('0x28')]['length']){var _0x2a2dd5=_[_0x6890('0x27')](_0x275a5d[_0x6890('0x28')],function(_0x399e74){return _0x399e74[_0x6890('0x2c')][_0x6890('0x30')][_0x6890('0x29')]===_0x2de3ed;});if(_0x2a2dd5){logger[_0x6890('0xb')](_0x6890('0x32'));return BPromise[_0x6890('0x2b')]({'id':_0x2a2dd5[_0x6890('0x2c')]['id'][_0x6890('0x29')],'name':_0x2a2dd5[_0x6890('0x2c')][_0x6890('0xc')][_0x6890('0x29')],'phone':_0x2a2dd5[_0x6890('0x2c')]['phone_home'][_0x6890('0x29')]});}}else{logger[_0x6890('0xb')](_0x6890('0x33'));return request({'form':{'method':_0x6890('0x1d'),'input_type':_0x6890('0x1e'),'response_type':_0x6890('0x1e'),'rest_data':JSON[_0x6890('0x1f')]({'session':_0x43929d['id'],'module_name':_0x6890('0x2f'),'name_value_list':[{'name':'first_name','value':_0x114d62!==_0x6890('0x34')?_0x114d62:util[_0x6890('0x20')](_0x6890('0x35'),_0x2de3ed)},{'name':_0x6890('0x30'),'value':_0x2de3ed}]})}})[_0x6890('0x31')](function(_0x657ecd){logger[_0x6890('0xb')]('Enduser\x20created.');return BPromise[_0x6890('0x2b')]({'id':_0x657ecd['id'],'name':_0x657ecd[_0x6890('0x28')][_0x6890('0x36')]['value'],'phone':_0x657ecd[_0x6890('0x28')]['phone_home']['value']});});}});}function request(_0x40ccfa){logger[_0x6890('0x37')](_0x6890('0x38'),JSON['stringify'](_0x40ccfa));return rp(_['merge'](def,_0x40ccfa));}function getTags(_0x1bcbb4,_0xd59d4c){var _0x341f12=[];if(_0x1bcbb4&&_0x1bcbb4[_0x6890('0x19')]>0x0){_0x341f12=_[_0x6890('0x39')](_0x1bcbb4,_0xd59d4c);}return _0x341f12;}function getCustomFields(_0x4a79db,_0x2c4015){var _0x5743f2=[];var _0x3e9b1f={'custom_fields':[]};if(_0x4a79db[_0x6890('0x19')]>0x0){_['forEach'](_0x4a79db,function(_0x4b3f19){if(_0x4b3f19[_0x6890('0x3a')]===_0x6890('0x3b')&&_0x4b3f19[_0x6890('0x3c')]&&!_0x4b3f19[_0x6890('0x3d')]){_0x3e9b1f[_0x4b3f19[_0x6890('0x3c')]['toLowerCase']()]=_0x4b3f19[_0x6890('0x3e')][_0x6890('0x3f')]();}else if(_0x4b3f19[_0x6890('0x3a')]===_0x6890('0x3b')&&_0x4b3f19['idField']&&_0x4b3f19[_0x6890('0x3d')]){_0x3e9b1f[_0x6890('0x40')][_0x6890('0x1b')]({'id':_0x4b3f19[_0x6890('0x1c')],'value':_0x4b3f19['content'][_0x6890('0x3f')]()});}else if(_0x4b3f19[_0x6890('0x3a')]===_0x6890('0x41')&&_0x4b3f19['variableName']&&_0x4b3f19['idField']&&_0x4b3f19[_0x6890('0x3d')]){_0x2c4015[_0x4b3f19[_0x6890('0x1a')]]&&_0x3e9b1f['custom_fields']['push']({'id':_0x4b3f19[_0x6890('0x1c')],'value':_0x2c4015[_0x4b3f19[_0x6890('0x1a')]][_0x6890('0x3f')]()});}else if(_0x4b3f19[_0x6890('0x3a')]===_0x6890('0x42')&&_0x4b3f19['Variable']&&_0x4b3f19[_0x6890('0x43')][_0x6890('0xc')]&&_0x4b3f19['idField']&&_0x4b3f19[_0x6890('0x3d')]){_0x2c4015[_0x4b3f19[_0x6890('0x43')][_0x6890('0xc')][_0x6890('0x44')]()]&&_0x3e9b1f[_0x6890('0x40')][_0x6890('0x1b')]({'id':_0x4b3f19[_0x6890('0x1c')],'value':_0x2c4015[_0x4b3f19[_0x6890('0x43')][_0x6890('0xc')][_0x6890('0x44')]()][_0x6890('0x3f')]()});}});}return _0x3e9b1f;}function getConnection(_0x450749){return request({'method':_0x6890('0xa'),'form':{'method':_0x6890('0x45'),'input_type':_0x6890('0x1e'),'response_type':'JSON','rest_data':JSON[_0x6890('0x1f')]({'user_auth':{'user_name':_0x450749['username'],'password':_0x450749[_0x6890('0x46')],'encryption':_0x6890('0x47')},'application':_0x6890('0x48')})}})['then'](function(_0x27cd2e){var _0x1e957e=_0x27cd2e;if(_0x1e957e['id']){def[_0x6890('0x49')]=_0x1e957e['id'];return BPromise[_0x6890('0x2b')](_0x1e957e);}else{throw new Error(util[_0x6890('0x20')](_0x6890('0x4a'),_0x450749['id']));}});}function setRelationship(_0x1919f1,_0x5f25f9,_0x5db5ff,_0x147d3c){return request({'form':{'method':_0x6890('0x4b'),'input_type':_0x6890('0x1e'),'response_type':'JSON','rest_data':JSON[_0x6890('0x1f')]({'session':_0x1919f1['id'],'module_name':_0x6890('0x4c'),'module_id':_0x5db5ff['id'],'link_field_name':_0x147d3c,'related_ids':[_0x5f25f9['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4cccf2,_0x41ee91,_0x45de6e,_0x55bb18,_0x192971,_0x2cbfa8){var _0x1b6668,_0x49742c,_0x4483b8,_0x3a9650;_0x2cbfa8[_0x6890('0x4d')]=intUtil['stripTrailingSlash'](_0x2cbfa8[_0x6890('0x4d')]);_0x2cbfa8[_0x6890('0x4e')]=intUtil[_0x6890('0x4f')](_0x2cbfa8[_0x6890('0x4e')]);def[_0x6890('0x50')]=util['format']('%s/service/v4_1/rest.php',_0x2cbfa8[_0x6890('0x4d')]);if(_0x192971&&_0x192971[_0x6890('0x51')]){logger['info'](_0x6890('0x52'),'Recording\x20is\x20enabled!');_0x41ee91['recordingURL']=util['format'](_0x6890('0x53'),_0x2cbfa8[_0x6890('0x4e')],_0x41ee91[_0x6890('0x54')],md5(_0x41ee91[_0x6890('0x54')]));}else{_0x41ee91[_0x6890('0x55')]='';}return getConnection(_0x2cbfa8)[_0x6890('0x31')](function(_0x2484f8){_0x3a9650=_0x2484f8;return getUser(_0x2cbfa8,_0x55bb18[_0x6890('0xc')],_0x3a9650);})[_0x6890('0x31')](function(_0x3b6d7c){_0x1b6668=_0x3b6d7c;logger[_0x6890('0xb')](_0x6890('0x56'),_0x1b6668['id']);return getEndUser(_0x2cbfa8,_0x41ee91[_0x6890('0x57')],_0x41ee91[_0x6890('0x58')],_0x3a9650);})[_0x6890('0x31')](function(_0x17bb9e){_0x49742c=_0x17bb9e;logger[_0x6890('0xb')](_0x6890('0x59'),_0x49742c['id']);return getTicket(_0x2cbfa8,_0x1b6668,_0x49742c,_0x45de6e,_0x41ee91,_0x45de6e[_0x6890('0x5a')],_0x3a9650,_0x6890('0x5b'));})[_0x6890('0x31')](function(_0x224341){_0x4483b8=_0x224341;logger['info'](_0x6890('0x5c'));logger[_0x6890('0xb')](_0x6890('0x5d'),_0x4483b8['id']);return setRelationship(_0x3a9650,_0x1b6668,_0x4483b8,_0x6890('0x5e'));})[_0x6890('0x31')](function(){return setRelationship(_0x3a9650,_0x49742c,_0x4483b8,_0x6890('0x5f'));})[_0x6890('0x31')](function(){return getServerInfo(_0x3a9650);})['then'](function(_0x53e738){var _0x2fba69=parseInt(_0x53e738[_0x6890('0x60')]['charAt'](0x0));var _0x4b68fb=util[_0x6890('0x20')](_0x6890('0x61'),_0x2cbfa8[_0x6890('0x4d')],_0x4483b8['id']);if(_0x2fba69>0x6){_0x4b68fb=util[_0x6890('0x20')](_0x6890('0x62'),_0x2cbfa8[_0x6890('0x4d')],_0x4483b8['id']);}logger[_0x6890('0xb')](_0x6890('0x52'),_0x6890('0x63'));emit(util[_0x6890('0x20')](_0x6890('0x64'),_0x55bb18[_0x6890('0xc')]),_0x6890('0x65'),{'uri':_0x4b68fb});})[_0x6890('0x66')](function(_0x4c6603){logger[_0x6890('0x67')](_0x6890('0x52'),JSON[_0x6890('0x1f')](_0x4c6603));});};exports[_0x6890('0x68')]=function(_0x37e0ba,_0x6a87c1,_0x1cceef,_0x289fc9,_0x433fae,_0x3c6c80,_0x24c81d){var _0x16d3e7,_0x202e05,_0x25d9dd,_0x1ac290;_0x3c6c80[_0x6890('0x4d')]=intUtil['stripTrailingSlash'](_0x3c6c80['remoteUri']);_0x3c6c80[_0x6890('0x4e')]=intUtil[_0x6890('0x4f')](_0x3c6c80[_0x6890('0x4e')]);def[_0x6890('0x50')]=util['format']('%s/service/v4_1/rest.php',_0x3c6c80[_0x6890('0x4d')]);if(_0x24c81d&&_0x24c81d[_0x6890('0x69')]&&_0x24c81d[_0x6890('0x69')]!==_0x6890('0x6a')){logger['info'](_0x6890('0x6b'),'Recording\x20is\x20enabled!');_0x6a87c1[_0x6890('0x55')]=util[_0x6890('0x20')](_0x6890('0x53'),_0x3c6c80[_0x6890('0x4e')],_0x6a87c1['uniqueid'],md5(_0x6a87c1['uniqueid']));}return getConnection(_0x3c6c80)[_0x6890('0x31')](function(_0x4a164c){_0x1ac290=_0x4a164c;return getUser(_0x3c6c80,_0x289fc9[_0x6890('0xc')],_0x1ac290);})[_0x6890('0x31')](function(_0x1c5ca2){_0x16d3e7=_0x1c5ca2;logger[_0x6890('0xb')]('The\x20User\x20ID\x20is:',_0x16d3e7['id']);return getEndUser(_0x3c6c80,_0x6a87c1[_0x6890('0x6c')],_0x6a87c1[_0x6890('0x6d')],_0x1ac290);})[_0x6890('0x31')](function(_0x5ce428){_0x202e05=_0x5ce428;logger[_0x6890('0xb')](_0x6890('0x59'),_0x202e05['id']);return getTicket(_0x3c6c80,_0x16d3e7,_0x202e05,_0x1cceef,_0x6a87c1,_0x1cceef[_0x6890('0x5a')],_0x1ac290,_0x6890('0x6e'));})[_0x6890('0x31')](function(_0x2c3a0c){_0x25d9dd=_0x2c3a0c;logger[_0x6890('0xb')](_0x6890('0x5c'));logger[_0x6890('0xb')](_0x6890('0x5d'),_0x25d9dd['id']);return setRelationship(_0x1ac290,_0x16d3e7,_0x25d9dd,_0x6890('0x5e'));})[_0x6890('0x31')](function(){return setRelationship(_0x1ac290,_0x202e05,_0x25d9dd,_0x6890('0x5f'));})[_0x6890('0x31')](function(){return getServerInfo(_0x1ac290);})[_0x6890('0x31')](function(_0x3356cb){var _0x138ce8=parseInt(_0x3356cb[_0x6890('0x60')][_0x6890('0x6f')](0x0));var _0xd3c0f7=util[_0x6890('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3c6c80[_0x6890('0x4d')],_0x25d9dd['id']);if(_0x138ce8>0x6){_0xd3c0f7=util[_0x6890('0x20')](_0x6890('0x62'),_0x3c6c80[_0x6890('0x4d')],_0x25d9dd['id']);}logger[_0x6890('0xb')](_0x6890('0x6b'),_0x6890('0x63'));emit(util['format'](_0x6890('0x64'),_0x289fc9['name']),_0x6890('0x65'),{'uri':_0xd3c0f7});})[_0x6890('0x66')](function(_0x59e47d){logger['error'](_0x6890('0x6b'),JSON['stringify'](_0x59e47d));});};exports[_0x6890('0x70')]=function(_0x11b1fa,_0x5a92b1,_0x4893ad,_0x53a3ce,_0x53fd73,_0x271066){var _0x34b3a4,_0x5492f9,_0x5d0a72,_0x266ac0;_0x271066[_0x6890('0x4d')]=intUtil[_0x6890('0x4f')](_0x271066[_0x6890('0x4d')]);_0x271066[_0x6890('0x4e')]=intUtil[_0x6890('0x4f')](_0x271066[_0x6890('0x4e')]);def[_0x6890('0x50')]=util[_0x6890('0x20')](_0x6890('0x71'),_0x271066[_0x6890('0x4d')]);if(_0x53fd73&&_0x53fd73[_0x6890('0x51')]){logger[_0x6890('0xb')]('['+_0x5a92b1['lastevent'][_0x6890('0x72')]()+']',_0x6890('0x73'));_0x5a92b1[_0x6890('0x55')]=util[_0x6890('0x20')](_0x6890('0x53'),_0x271066[_0x6890('0x4e')],_0x5a92b1[_0x6890('0x54')],md5(_0x5a92b1[_0x6890('0x54')]));}else{_0x5a92b1['recordingURL']='';}return getConnection(_0x271066)['then'](function(_0x5b47fc){_0x266ac0=_0x5b47fc;if(!_[_0x6890('0x23')](_0x53a3ce)){return getUser(_0x271066,_0x53a3ce[_0x6890('0xc')],_0x266ac0);}else{return getUser(_0x271066,null,_0x266ac0);}})[_0x6890('0x31')](function(_0x5a6589){_0x34b3a4=_0x5a6589;logger[_0x6890('0xb')](_0x6890('0x56'),_0x34b3a4['id']);return getEndUser(_0x271066,_0x5a92b1[_0x6890('0x57')],_0x5a92b1[_0x6890('0x58')],_0x266ac0);})[_0x6890('0x31')](function(_0x5df79f){_0x5492f9=_0x5df79f;logger[_0x6890('0xb')](_0x6890('0x59'),_0x5492f9['id']);return getTicket(_0x271066,_0x34b3a4,_0x5492f9,_0x4893ad,_0x5a92b1,_0x4893ad[_0x6890('0x5a')],_0x266ac0,'Inbound');})[_0x6890('0x31')](function(_0x3b5e7f){_0x5d0a72=_0x3b5e7f;logger[_0x6890('0xb')](_0x6890('0x5c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5d0a72['id']);return setRelationship(_0x266ac0,_0x34b3a4,_0x5d0a72,_0x6890('0x5e'));})['then'](function(){return setRelationship(_0x266ac0,_0x5492f9,_0x5d0a72,_0x6890('0x5f'));})[_0x6890('0x31')](function(){return getServerInfo(_0x266ac0);})[_0x6890('0x66')](function(_0x70d644){logger[_0x6890('0x67')]('['+_0x5a92b1[_0x6890('0x74')][_0x6890('0x72')]()+']',JSON[_0x6890('0x1f')](_0x70d644));});}; \ No newline at end of file +var _0x3a73=['idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','get_entry_list','Employees','then','entry_list','length','find','name_value_list','user_name','Agent\x20found!','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','map','type','string','customField','nameField','content','custom_fields','variable','variableName','push','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[QUEUE]','outbound','recordingFormat','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','user:%s','trigger:browser:url','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','localhost','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction','forEach'];(function(_0x1a8ec2,_0x54754b){var _0x3ff96f=function(_0x43163c){while(--_0x43163c){_0x1a8ec2['push'](_0x1a8ec2['shift']());}};_0x3ff96f(++_0x54754b);}(_0x3a73,0xcd));var _0x33a7=function(_0x125b16,_0x28d5a7){_0x125b16=_0x125b16-0x0;var _0x4c26c2=_0x3a73[_0x125b16];return _0x4c26c2;};'use strict';var _=require(_0x33a7('0x0'));var rp=require(_0x33a7('0x1'));var BPromise=require(_0x33a7('0x2'));var md5=require(_0x33a7('0x3'));var util=require(_0x33a7('0x4'));var Redis=require(_0x33a7('0x5'));var intUtil=require(_0x33a7('0x6'));var config=require('../../../../config/environment');var logger=require(_0x33a7('0x7'))(_0x33a7('0x8'));config['redis']=_[_0x33a7('0x9')](config['redis'],{'host':_0x33a7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33a7('0xb')]));var def={'method':_0x33a7('0xc'),'json':!![]};function emit(_0x480ed3,_0x1e1cf3,_0x2985a0){io['to'](_0x480ed3)[_0x33a7('0xd')](_0x1e1cf3,_0x2985a0);}function getTicket(_0x352e75,_0xf97db7,_0x4fdd5d,_0x137f1f,_0x347c12,_0x47fdd1,_0xa8ac78,_0x293142){logger[_0x33a7('0xe')](_0x33a7('0xf'));var _0x3369bb=new Date();var _0x275b5b=[{'name':_0x33a7('0x10'),'value':intUtil[_0x33a7('0x11')](_0x137f1f[_0x33a7('0x12')],_0x347c12,'\x20')},{'name':'assigned_user_id','value':_0xf97db7['id']},{'name':_0x33a7('0x13'),'value':_0xf97db7['id']},{'name':_0x33a7('0x14'),'value':intUtil[_0x33a7('0x11')](_0x137f1f[_0x33a7('0x15')],_0x347c12,'\x0a')},{'name':'date_start','value':_0x3369bb[_0x33a7('0x16')]()[_0x33a7('0x17')](0x0,0x13)[_0x33a7('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x33a7('0x19'),'value':'15'},{'name':_0x33a7('0x1a'),'value':_0x4fdd5d['id']},{'name':_0x33a7('0x1b'),'value':_0x33a7('0x1c')},{'name':'parent_name','value':_0x4fdd5d[_0x33a7('0x10')]},{'name':_0x33a7('0x1d'),'value':_0x293142}];if(_0x47fdd1['length']){_[_0x33a7('0x1e')](_0x47fdd1,function(_0x4720d8){if(_0x347c12[_0x4720d8['variableName']]){_0x275b5b['push']({'name':_0x4720d8[_0x33a7('0x1f')],'value':_0x347c12[_0x4720d8['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0xa8ac78['id'],'module_name':_0x33a7('0x22'),'name_value_list':_0x275b5b})}});}function getAuth(_0x1d7af7){return util[_0x33a7('0x23')](_0x33a7('0x24'),new Buffer(_0x1d7af7[_0x33a7('0x25')]+':X')[_0x33a7('0x26')]('base64'));}function getServerInfo(_0x27a81e){return request({'form':{'method':_0x33a7('0x27'),'input_type':'JSON','response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x27a81e['id']})}});}function getUser(_0x45b63d,_0x2473b4,_0x57ac96){if(!_[_0x33a7('0x28')](_0x2473b4)){logger['info']('Getting\x20agent\x20with\x20name',_0x2473b4);return request({'form':{'method':_0x33a7('0x29'),'input_type':_0x33a7('0x20'),'response_type':'JSON','rest_data':JSON[_0x33a7('0x21')]({'session':_0x57ac96['id'],'module_name':_0x33a7('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2473b4),'order_by':'','offset':'0','select_fields':['id',_0x33a7('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33a7('0x2b')](function(_0x2b92ae){if(_0x2b92ae[_0x33a7('0x2c')][_0x33a7('0x2d')]){var _0x54cfeb=_[_0x33a7('0x2e')](_0x2b92ae[_0x33a7('0x2c')],function(_0x4c3464){return _0x4c3464[_0x33a7('0x2f')][_0x33a7('0x30')]['value']===_0x2473b4;});if(_0x54cfeb){logger[_0x33a7('0xe')](_0x33a7('0x31'));return BPromise['resolve']({'id':_0x54cfeb[_0x33a7('0x2f')]['id'][_0x33a7('0x32')],'name':_0x54cfeb[_0x33a7('0x2f')][_0x33a7('0x10')]['value']});}}logger[_0x33a7('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x33a7('0x33')]({'id':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x34')]['value'],'name':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x30')][_0x33a7('0x32')]});});}else{logger[_0x33a7('0xe')](_0x33a7('0x35'));return BPromise['resolve']({'id':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x34')][_0x33a7('0x32')],'name':_0x57ac96[_0x33a7('0x2f')]['user_name'][_0x33a7('0x32')]});}}function getEndUser(_0x29f206,_0x365b44,_0x32d1eb,_0x2a9d3f){logger[_0x33a7('0xe')](_0x33a7('0x36'),_0x32d1eb);return request({'form':{'method':_0x33a7('0x29'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON['stringify']({'session':_0x2a9d3f['id'],'module_name':_0x33a7('0x1c'),'query':util['format'](_0x33a7('0x37'),_0x32d1eb),'order_by':'','offset':'0','select_fields':['id',_0x33a7('0x10'),_0x33a7('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33a7('0x2b')](function(_0x517749){if(_0x517749[_0x33a7('0x2c')][_0x33a7('0x2d')]){var _0x4a78f8=_[_0x33a7('0x2e')](_0x517749['entry_list'],function(_0x369a81){return _0x369a81[_0x33a7('0x2f')][_0x33a7('0x38')][_0x33a7('0x32')]===_0x32d1eb;});if(_0x4a78f8){logger['info']('Enduser\x20found!');return BPromise[_0x33a7('0x33')]({'id':_0x4a78f8['name_value_list']['id'][_0x33a7('0x32')],'name':_0x4a78f8[_0x33a7('0x2f')][_0x33a7('0x10')][_0x33a7('0x32')],'phone':_0x4a78f8[_0x33a7('0x2f')][_0x33a7('0x38')][_0x33a7('0x32')]});}}else{logger['info'](_0x33a7('0x39'));return request({'form':{'method':_0x33a7('0x3a'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x2a9d3f['id'],'module_name':_0x33a7('0x1c'),'name_value_list':[{'name':_0x33a7('0x3b'),'value':_0x365b44!==_0x33a7('0x3c')?_0x365b44:util['format']('Caller\x20-\x20%s',_0x32d1eb)},{'name':_0x33a7('0x38'),'value':_0x32d1eb}]})}})[_0x33a7('0x2b')](function(_0x368e20){logger[_0x33a7('0xe')]('Enduser\x20created.');return BPromise[_0x33a7('0x33')]({'id':_0x368e20['id'],'name':_0x368e20['entry_list'][_0x33a7('0x3b')]['value'],'phone':_0x368e20[_0x33a7('0x2c')][_0x33a7('0x38')][_0x33a7('0x32')]});});}});}function request(_0x115e80){logger['debug']('[HTTP]',JSON[_0x33a7('0x21')](_0x115e80));return rp(_['merge'](def,_0x115e80));}function getTags(_0x480265,_0x43f0d3){var _0x3197d0=[];if(_0x480265&&_0x480265['length']>0x0){_0x3197d0=_[_0x33a7('0x3d')](_0x480265,_0x43f0d3);}return _0x3197d0;}function getCustomFields(_0x3afbb5,_0x2ea44e){var _0x13095b=[];var _0x2adc78={'custom_fields':[]};if(_0x3afbb5[_0x33a7('0x2d')]>0x0){_[_0x33a7('0x1e')](_0x3afbb5,function(_0x3783e7){if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x3f')&&_0x3783e7['nameField']&&!_0x3783e7[_0x33a7('0x40')]){_0x2adc78[_0x3783e7[_0x33a7('0x41')]['toLowerCase']()]=_0x3783e7[_0x33a7('0x42')]['toString']();}else if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x3f')&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2adc78[_0x33a7('0x43')]['push']({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x3783e7[_0x33a7('0x42')][_0x33a7('0x26')]()});}else if(_0x3783e7['type']===_0x33a7('0x44')&&_0x3783e7[_0x33a7('0x45')]&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2ea44e[_0x3783e7[_0x33a7('0x45')]]&&_0x2adc78[_0x33a7('0x43')][_0x33a7('0x46')]({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x2ea44e[_0x3783e7[_0x33a7('0x45')]][_0x33a7('0x26')]()});}else if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x47')&&_0x3783e7['Variable']&&_0x3783e7[_0x33a7('0x48')][_0x33a7('0x10')]&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2ea44e[_0x3783e7['Variable'][_0x33a7('0x10')][_0x33a7('0x49')]()]&&_0x2adc78['custom_fields'][_0x33a7('0x46')]({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x2ea44e[_0x3783e7[_0x33a7('0x48')]['name'][_0x33a7('0x49')]()][_0x33a7('0x26')]()});}});}return _0x2adc78;}function getConnection(_0x816e0f){return request({'method':_0x33a7('0xc'),'form':{'method':'login','input_type':'JSON','response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'user_auth':{'user_name':_0x816e0f[_0x33a7('0x4a')],'password':_0x816e0f[_0x33a7('0x4b')],'encryption':_0x33a7('0x4c')},'application':_0x33a7('0x4d')})}})[_0x33a7('0x2b')](function(_0x2472ef){var _0x45eeeb=_0x2472ef;if(_0x45eeeb['id']){def[_0x33a7('0x4e')]=_0x45eeeb['id'];return BPromise[_0x33a7('0x33')](_0x45eeeb);}else{throw new Error(util[_0x33a7('0x23')](_0x33a7('0x4f'),_0x816e0f['id']));}});}function setRelationship(_0x5aad68,_0x82427a,_0x26e961,_0x46ce28){return request({'form':{'method':_0x33a7('0x50'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x5aad68['id'],'module_name':_0x33a7('0x22'),'module_id':_0x26e961['id'],'link_field_name':_0x46ce28,'related_ids':[_0x82427a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0xf42159,_0x138905,_0x5f35ef,_0x17baad,_0x11c2f5,_0xe58509){var _0x4206e7,_0xb654d8,_0x586ca4,_0x22f846;_0xe58509[_0x33a7('0x51')]=intUtil[_0x33a7('0x52')](_0xe58509[_0x33a7('0x51')]);_0xe58509['serverUrl']=intUtil[_0x33a7('0x52')](_0xe58509[_0x33a7('0x53')]);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0xe58509[_0x33a7('0x51')]);if(_0x11c2f5&&_0x11c2f5[_0x33a7('0x56')]){logger[_0x33a7('0xe')]('[QUEUE]',_0x33a7('0x57'));_0x138905[_0x33a7('0x58')]=util[_0x33a7('0x23')](_0x33a7('0x59'),_0xe58509[_0x33a7('0x53')],_0x138905[_0x33a7('0x5a')],md5(_0x138905[_0x33a7('0x5a')]));}else{_0x138905[_0x33a7('0x58')]='';}return getConnection(_0xe58509)[_0x33a7('0x2b')](function(_0x73905f){_0x22f846=_0x73905f;return getUser(_0xe58509,_0x17baad[_0x33a7('0x10')],_0x22f846);})[_0x33a7('0x2b')](function(_0x4e9203){_0x4206e7=_0x4e9203;logger[_0x33a7('0xe')]('The\x20User\x20ID\x20is:',_0x4206e7['id']);return getEndUser(_0xe58509,_0x138905[_0x33a7('0x5b')],_0x138905[_0x33a7('0x5c')],_0x22f846);})[_0x33a7('0x2b')](function(_0x3ac3ae){_0xb654d8=_0x3ac3ae;logger['info'](_0x33a7('0x5d'),_0xb654d8['id']);return getTicket(_0xe58509,_0x4206e7,_0xb654d8,_0x5f35ef,_0x138905,_0x5f35ef[_0x33a7('0x5e')],_0x22f846,_0x33a7('0x5f'));})[_0x33a7('0x2b')](function(_0x311ea7){_0x586ca4=_0x311ea7;logger[_0x33a7('0xe')](_0x33a7('0x60'));logger[_0x33a7('0xe')]('The\x20Ticket\x20ID\x20is:',_0x586ca4['id']);return setRelationship(_0x22f846,_0x4206e7,_0x586ca4,_0x33a7('0x61'));})[_0x33a7('0x2b')](function(){return setRelationship(_0x22f846,_0xb654d8,_0x586ca4,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0x22f846);})[_0x33a7('0x2b')](function(_0x44bfb1){var _0x2fc0d4=parseInt(_0x44bfb1['version'][_0x33a7('0x63')](0x0));var _0x23115e=util[_0x33a7('0x23')](_0x33a7('0x64'),_0xe58509[_0x33a7('0x51')],_0x586ca4['id']);if(_0x2fc0d4>0x6){_0x23115e=util[_0x33a7('0x23')](_0x33a7('0x65'),_0xe58509[_0x33a7('0x51')],_0x586ca4['id']);}logger['info']('[QUEUE]',_0x33a7('0x66'));emit(util[_0x33a7('0x23')]('user:%s',_0x17baad['name']),'trigger:browser:url',{'uri':_0x23115e});})[_0x33a7('0x67')](function(_0x144906){logger['error'](_0x33a7('0x68'),JSON[_0x33a7('0x21')](_0x144906));});};exports[_0x33a7('0x69')]=function(_0x4324f3,_0x42948f,_0x1d736d,_0x2c7c89,_0x19c5f3,_0x2f9ac7,_0x2559a4){var _0x30e7d5,_0x1329eb,_0x46f951,_0xebd283;_0x2f9ac7[_0x33a7('0x51')]=intUtil['stripTrailingSlash'](_0x2f9ac7[_0x33a7('0x51')]);_0x2f9ac7[_0x33a7('0x53')]=intUtil[_0x33a7('0x52')](_0x2f9ac7['serverUrl']);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0x2f9ac7['remoteUri']);if(_0x2559a4&&_0x2559a4[_0x33a7('0x6a')]&&_0x2559a4['recordingFormat']!=='none'){logger[_0x33a7('0xe')]('[OUTBOUND]',_0x33a7('0x57'));_0x42948f[_0x33a7('0x58')]=util[_0x33a7('0x23')](_0x33a7('0x59'),_0x2f9ac7[_0x33a7('0x53')],_0x42948f[_0x33a7('0x5a')],md5(_0x42948f[_0x33a7('0x5a')]));}return getConnection(_0x2f9ac7)[_0x33a7('0x2b')](function(_0x42aa22){_0xebd283=_0x42aa22;return getUser(_0x2f9ac7,_0x2c7c89[_0x33a7('0x10')],_0xebd283);})[_0x33a7('0x2b')](function(_0x37c2bf){_0x30e7d5=_0x37c2bf;logger[_0x33a7('0xe')](_0x33a7('0x6b'),_0x30e7d5['id']);return getEndUser(_0x2f9ac7,_0x42948f['destcalleridname'],_0x42948f[_0x33a7('0x6c')],_0xebd283);})[_0x33a7('0x2b')](function(_0x2c741c){_0x1329eb=_0x2c741c;logger['info'](_0x33a7('0x5d'),_0x1329eb['id']);return getTicket(_0x2f9ac7,_0x30e7d5,_0x1329eb,_0x1d736d,_0x42948f,_0x1d736d['Fields'],_0xebd283,_0x33a7('0x6d'));})[_0x33a7('0x2b')](function(_0x170c4d){_0x46f951=_0x170c4d;logger['info'](_0x33a7('0x60'));logger[_0x33a7('0xe')](_0x33a7('0x6e'),_0x46f951['id']);return setRelationship(_0xebd283,_0x30e7d5,_0x46f951,_0x33a7('0x61'));})['then'](function(){return setRelationship(_0xebd283,_0x1329eb,_0x46f951,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0xebd283);})[_0x33a7('0x2b')](function(_0x5a6b83){var _0x214b9b=parseInt(_0x5a6b83['version'][_0x33a7('0x63')](0x0));var _0x18aafc=util['format'](_0x33a7('0x64'),_0x2f9ac7['remoteUri'],_0x46f951['id']);if(_0x214b9b>0x6){_0x18aafc=util[_0x33a7('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2f9ac7[_0x33a7('0x51')],_0x46f951['id']);}logger[_0x33a7('0xe')](_0x33a7('0x6f'),_0x33a7('0x66'));emit(util[_0x33a7('0x23')](_0x33a7('0x70'),_0x2c7c89[_0x33a7('0x10')]),_0x33a7('0x71'),{'uri':_0x18aafc});})[_0x33a7('0x67')](function(_0x49a450){logger[_0x33a7('0x72')](_0x33a7('0x6f'),JSON['stringify'](_0x49a450));});};exports[_0x33a7('0x73')]=function(_0x5c3ad7,_0x3a8afb,_0xdf5713,_0x930408,_0x151771,_0x55b335){var _0xf2511e,_0xf72c18,_0x2ab153,_0x22227c;_0x55b335[_0x33a7('0x51')]=intUtil[_0x33a7('0x52')](_0x55b335[_0x33a7('0x51')]);_0x55b335[_0x33a7('0x53')]=intUtil['stripTrailingSlash'](_0x55b335[_0x33a7('0x53')]);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0x55b335['remoteUri']);if(_0x151771&&_0x151771[_0x33a7('0x56')]){logger[_0x33a7('0xe')]('['+_0x3a8afb[_0x33a7('0x74')][_0x33a7('0x75')]()+']','Recording\x20is\x20enabled!');_0x3a8afb['recordingURL']=util[_0x33a7('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55b335['serverUrl'],_0x3a8afb[_0x33a7('0x5a')],md5(_0x3a8afb[_0x33a7('0x5a')]));}else{_0x3a8afb['recordingURL']='';}return getConnection(_0x55b335)[_0x33a7('0x2b')](function(_0x36ea8d){_0x22227c=_0x36ea8d;if(!_[_0x33a7('0x28')](_0x930408)){return getUser(_0x55b335,_0x930408[_0x33a7('0x10')],_0x22227c);}else{return getUser(_0x55b335,null,_0x22227c);}})[_0x33a7('0x2b')](function(_0x326407){_0xf2511e=_0x326407;logger['info']('The\x20User\x20ID\x20is:',_0xf2511e['id']);return getEndUser(_0x55b335,_0x3a8afb[_0x33a7('0x5b')],_0x3a8afb['calleridnum'],_0x22227c);})[_0x33a7('0x2b')](function(_0x96dc77){_0xf72c18=_0x96dc77;logger['info'](_0x33a7('0x5d'),_0xf72c18['id']);return getTicket(_0x55b335,_0xf2511e,_0xf72c18,_0xdf5713,_0x3a8afb,_0xdf5713['Fields'],_0x22227c,'Inbound');})[_0x33a7('0x2b')](function(_0x2094b6){_0x2ab153=_0x2094b6;logger[_0x33a7('0xe')]('Ticket\x20created!');logger['info'](_0x33a7('0x6e'),_0x2ab153['id']);return setRelationship(_0x22227c,_0xf2511e,_0x2ab153,'users');})[_0x33a7('0x2b')](function(){return setRelationship(_0x22227c,_0xf72c18,_0x2ab153,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0x22227c);})[_0x33a7('0x67')](function(_0xca35f5){logger[_0x33a7('0x72')]('['+_0x3a8afb[_0x33a7('0x74')][_0x33a7('0x75')]()+']',JSON['stringify'](_0xca35f5));});}; \ 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 f4abf76..3d06db4 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 _0xe17f=['%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe17f,0x191));var _0xfe17=function(_0x2661a5,_0x383a0b){_0x2661a5=_0x2661a5-0x0;var _0x1c5597=_0xe17f[_0x2661a5];return _0x1c5597;};'use strict';var _=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));exports['getString']=function(_0x295163,_0x558e8a,_0x261615){var _0x58fe08=[];if(_0x295163[_0xfe17('0x2')]>0x0){var _0x2a9a68=_[_0xfe17('0x3')](_0x295163,['id']);for(var _0x456bf6=0x0;_0x456bf6<_0x2a9a68[_0xfe17('0x2')];_0x456bf6++){var _0x28e7df=_0x2a9a68[_0x456bf6];if(_0x28e7df[_0xfe17('0x4')]===_0xfe17('0x5')){_0x58fe08[_0xfe17('0x6')](_0x28e7df[_0xfe17('0x7')]);}else if(_0x28e7df['type']===_0xfe17('0x8')&&_0x28e7df[_0xfe17('0x9')]){_0x558e8a[_0x28e7df[_0xfe17('0x9')]]&&_0x58fe08[_0xfe17('0x6')](_0x558e8a[_0x28e7df[_0xfe17('0x9')]][_0xfe17('0xa')]());}else if(_0x28e7df[_0xfe17('0x4')]===_0xfe17('0xb')&&_0x28e7df[_0xfe17('0xc')]&&_0x28e7df['Variable'][_0xfe17('0xd')]){_0x558e8a[_0x28e7df[_0xfe17('0xc')][_0xfe17('0xd')][_0xfe17('0xe')]()]&&_0x58fe08[_0xfe17('0x6')](_0x558e8a[_0x28e7df[_0xfe17('0xc')]['name'][_0xfe17('0xe')]()]['toString']());}else if(_0x28e7df[_0xfe17('0x4')]===_0xfe17('0xf')){if(_0x28e7df[_0xfe17('0x10')]==='string'&&_0x28e7df[_0xfe17('0x11')]){_0x58fe08[_0xfe17('0x6')](util[_0xfe17('0x12')](_0xfe17('0x13'),_0x28e7df['key'],_0x28e7df[_0xfe17('0x14')]));}else if(_0x28e7df['keyType']==='variable'&&_0x28e7df[_0xfe17('0x9')]&&_0x28e7df['key']){_0x558e8a[_0x28e7df[_0xfe17('0x9')]]&&_0x58fe08[_0xfe17('0x6')](util[_0xfe17('0x12')]('%s:\x20%s',_0x28e7df[_0xfe17('0x11')],_0x558e8a[_0x28e7df['variableName']]));}else if(_0x28e7df['keyType']===_0xfe17('0xb')&&_0x28e7df['Variable']&&_0x28e7df[_0xfe17('0xc')][_0xfe17('0xd')]&&_0x28e7df[_0xfe17('0x11')]){_0x558e8a[_0x28e7df[_0xfe17('0xc')]['name'][_0xfe17('0xe')]()]&&_0x58fe08['push'](util[_0xfe17('0x12')](_0xfe17('0x13'),_0x28e7df['key'],_0x558e8a[_0x28e7df[_0xfe17('0xc')]['name'][_0xfe17('0xe')]()]));}}}}return _0x58fe08[_0xfe17('0x15')](_0x261615);};exports[_0xfe17('0x16')]=function(_0x220146){var _0x3a2f93=_0x220146[_0xfe17('0x17')](-0x1);if(_0x3a2f93==='/'){_0x220146=_0x220146['substring'](0x0,_0x220146[_0xfe17('0x18')](_0x3a2f93));}return _0x220146;};exports[_0xfe17('0x19')]=function(_0x4a434e){if(!_[_0xfe17('0x1a')](_0x4a434e)&&_0x4a434e!==''){var _0x8cb98f=/^(([^<>()\[\]\\.,;:\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 _0x8cb98f[_0xfe17('0x1b')](String(_0x4a434e)[_0xfe17('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x3d0e=['push','content','variable','variableName','type','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','string'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x3d0e,0xa9));var _0xe3d0=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3d0e[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xe3d0('0x0'));exports[_0xe3d0('0x1')]=function(_0x4bef12,_0x5a9f15,_0x2423d0){var _0x40cbf5=[];if(_0x4bef12[_0xe3d0('0x2')]>0x0){var _0x885650=_[_0xe3d0('0x3')](_0x4bef12,['id']);for(var _0x569d5a=0x0;_0x569d5a<_0x885650[_0xe3d0('0x2')];_0x569d5a++){var _0x9b14bf=_0x885650[_0x569d5a];if(_0x9b14bf['type']===_0xe3d0('0x4')){_0x40cbf5[_0xe3d0('0x5')](_0x9b14bf[_0xe3d0('0x6')]);}else if(_0x9b14bf['type']===_0xe3d0('0x7')&&_0x9b14bf[_0xe3d0('0x8')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]&&_0x40cbf5['push'](_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]['toString']());}else if(_0x9b14bf[_0xe3d0('0x9')]===_0xe3d0('0xa')&&_0x9b14bf[_0xe3d0('0xb')]&&_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')]['name'][_0xe3d0('0xd')]()]&&_0x40cbf5['push'](_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')][_0xe3d0('0xd')]()][_0xe3d0('0xe')]());}else if(_0x9b14bf[_0xe3d0('0x9')]===_0xe3d0('0xf')){if(_0x9b14bf[_0xe3d0('0x10')]===_0xe3d0('0x4')&&_0x9b14bf[_0xe3d0('0x11')]){_0x40cbf5['push'](util[_0xe3d0('0x12')](_0xe3d0('0x13'),_0x9b14bf[_0xe3d0('0x11')],_0x9b14bf[_0xe3d0('0x14')]));}else if(_0x9b14bf[_0xe3d0('0x10')]===_0xe3d0('0x7')&&_0x9b14bf['variableName']&&_0x9b14bf[_0xe3d0('0x11')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]&&_0x40cbf5['push'](util[_0xe3d0('0x12')](_0xe3d0('0x13'),_0x9b14bf['key'],_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]));}else if(_0x9b14bf[_0xe3d0('0x10')]==='customVariable'&&_0x9b14bf[_0xe3d0('0xb')]&&_0x9b14bf['Variable'][_0xe3d0('0xc')]&&_0x9b14bf[_0xe3d0('0x11')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')][_0xe3d0('0xd')]()]&&_0x40cbf5[_0xe3d0('0x5')](util['format'](_0xe3d0('0x13'),_0x9b14bf[_0xe3d0('0x11')],_0x5a9f15[_0x9b14bf['Variable'][_0xe3d0('0xc')]['toLowerCase']()]));}}}}return _0x40cbf5[_0xe3d0('0x15')](_0x2423d0);};exports[_0xe3d0('0x16')]=function(_0xf7715c){var _0x58344=_0xf7715c[_0xe3d0('0x17')](-0x1);if(_0x58344==='/'){_0xf7715c=_0xf7715c[_0xe3d0('0x18')](0x0,_0xf7715c[_0xe3d0('0x19')](_0x58344));}return _0xf7715c;};exports[_0xe3d0('0x1a')]=function(_0x41205c){if(!_[_0xe3d0('0x1b')](_0x41205c)&&_0x41205c!==''){var _0x3460af=/^(([^<>()\[\]\\.,;:\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 _0x3460af[_0xe3d0('0x1c')](String(_0x41205c)[_0xe3d0('0xd')]());}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 3ac0aa6..3974387 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x34f04f,_0x4961ce){var _0x3ac958=function(_0x4eee05){while(--_0x4eee05){_0x34f04f['push'](_0x34f04f['shift']());}};_0x3ac958(++_0x4961ce);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 c72c066..e459f76 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 _0x05e7=['%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','stringify','GET','map','forEach','includes','string','picklist','type','nameField','content','idField','customField','custom_fields','variable','variableName','customVariable','Variable','toLowerCase','push','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','./util','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','Subjects','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','then','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x05e7,0xb5));var _0x705e=function(_0x95743f,_0x178f68){_0x95743f=_0x95743f-0x0;var _0xfb4b3c=_0x05e7[_0x95743f];return _0xfb4b3c;};'use strict';var _=require('lodash');var rp=require(_0x705e('0x0'));var md5=require(_0x705e('0x1'));var util=require('util');var Redis=require(_0x705e('0x2'));var intUtil=require(_0x705e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x705e('0x4'))('zendesk');config[_0x705e('0x5')]=_[_0x705e('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x705e('0x7'))(new Redis(config[_0x705e('0x5')]));function emit(_0x5a7e41,_0x493367,_0x4f4857){io['to'](_0x5a7e41)[_0x705e('0x8')](_0x493367,_0x4f4857);}var headers={'Content-Type':_0x705e('0x9'),'Accept':'application/json'};function getTicket(_0x17e1ba,_0x3c51e7,_0x11b912,_0x612244,_0x590418){logger[_0x705e('0xa')](_0x705e('0xb'));return request({'uri':util[_0x705e('0xc')](_0x705e('0xd'),_0x17e1ba[_0x705e('0xe')]),'method':_0x705e('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x11b912['id'],'submitter_id':_0x3c51e7?_0x3c51e7['id']:undefined,'assignee_id':_0x3c51e7?_0x3c51e7['id']:undefined,'tags':getTags(_0x612244[_0x705e('0x10')],_0x705e('0x11')),'subject':intUtil['getString'](_0x612244[_0x705e('0x12')],_0x590418,'\x20'),'description':intUtil[_0x705e('0x13')](_0x612244[_0x705e('0x14')],_0x590418,'\x0a'),'comment':{'public':![],'body':intUtil[_0x705e('0x13')](_0x612244[_0x705e('0x14')],_0x590418,'\x0a')}},getCustomFields(_0x612244[_0x705e('0x15')],_0x590418))}})['then'](function(_0x1c5a3b){logger['info'](_0x705e('0x16'));return _0x1c5a3b[_0x705e('0x17')];});}function getUser(_0xde4bbe,_0x147583){if(intUtil[_0x705e('0x18')](_0x147583)){logger[_0x705e('0xa')](_0x705e('0x19'),_0x147583);return request({'uri':util['format'](_0x705e('0x1a'),_0xde4bbe['remoteUri']),'qs':{'query':util[_0x705e('0xc')]('type:user\x20role:agent\x20email:%s',_0x147583)}})[_0x705e('0x1b')](function(_0x2c65aa){if(_0x2c65aa[_0x705e('0x1c')]){logger['info'](_0x705e('0x1d'));return _[_0x705e('0x1e')](_0x2c65aa[_0x705e('0x1f')],{'email':_0x147583,'role':_0x705e('0x20')});}else{logger[_0x705e('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x705e('0x21'),_0xde4bbe[_0x705e('0xe')])})['then'](function(_0x775860){logger[_0x705e('0xa')](_0x705e('0x22'));return _0x775860[_0x705e('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x705e('0xc')]('%s/users/me.json',_0xde4bbe['remoteUri'])})[_0x705e('0x1b')](function(_0x1e10ef){logger[_0x705e('0xa')](_0x705e('0x22'));return _0x1e10ef['user'];});}}function getEndUser(_0x5d852f,_0x18e13a,_0x292d65){logger[_0x705e('0xa')](_0x705e('0x24'),_0x292d65);return request({'uri':util[_0x705e('0xc')]('%s/search.json',_0x5d852f[_0x705e('0xe')]),'qs':{'query':util['format'](_0x705e('0x25'),_0x292d65)}})['then'](function(_0x2931e2){var _0x545cac;if(_0x2931e2[_0x705e('0x1f')]['length']){_0x2931e2['results']=_[_0x705e('0x26')](_0x2931e2['results'],{'suspended':![],'role':_0x705e('0x27')});if(_0x2931e2['results'][_0x705e('0x28')]){_0x545cac=_[_0x705e('0x29')](_0x2931e2[_0x705e('0x1f')]);}}if(_0x545cac){logger[_0x705e('0xa')]('Enduser\x20found!');return _0x545cac;}else{logger[_0x705e('0xa')](_0x705e('0x2a'));return request({'uri':util[_0x705e('0xc')](_0x705e('0x2b'),_0x5d852f[_0x705e('0xe')]),'method':'POST','body':{'user':{'role':_0x705e('0x27'),'name':util['format'](_0x705e('0x2c'),_0x18e13a||_0x292d65),'phone':_0x292d65}}})['then'](function(_0xb1fca0){logger['info'](_0x705e('0x2d'));return _0xb1fca0[_0x705e('0x23')];});}});}function getAuth(_0x28603a){var _0x41b545;if(_0x28603a[_0x705e('0x2e')]===_0x705e('0x2f')){_0x41b545=util[_0x705e('0xc')](_0x705e('0x30'),_0x28603a[_0x705e('0x31')],_0x28603a['password']);}else if(_0x28603a[_0x705e('0x2e')]===_0x705e('0x32')){_0x41b545=util[_0x705e('0xc')](_0x705e('0x33'),_0x28603a[_0x705e('0x31')],_0x28603a['token']);}return util[_0x705e('0xc')](_0x705e('0x34'),new Buffer(_0x41b545)[_0x705e('0x35')]('base64'));}function request(_0x4bb15d){logger[_0x705e('0x36')]('[HTTP]',JSON[_0x705e('0x37')](_0x4bb15d));return rp(_['defaults'](_0x4bb15d,{'method':_0x705e('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x526b86,_0x48f2fe){var _0x4b62c9=[];if(_0x526b86&&_0x526b86['length']>0x0){_0x4b62c9=_[_0x705e('0x39')](_0x526b86,_0x48f2fe);}return _0x4b62c9;}function getCustomFields(_0x3d5213,_0x4b28b4){var _0x467868=[];var _0x15ff1f={'custom_fields':[]};if(_0x3d5213[_0x705e('0x28')]>0x0){_[_0x705e('0x3a')](_0x3d5213,function(_0xc34e2e){if(_[_0x705e('0x3b')]([_0x705e('0x3c'),_0x705e('0x3d')],_0xc34e2e[_0x705e('0x3e')])&&_0xc34e2e[_0x705e('0x3f')]&&!_0xc34e2e['customField']){_0x15ff1f[_0xc34e2e[_0x705e('0x3f')]['toLowerCase']()]=_0xc34e2e[_0x705e('0x40')]['toString']();}else if(_[_0x705e('0x3b')](['string',_0x705e('0x3d')],_0xc34e2e['type'])&&_0xc34e2e[_0x705e('0x41')]&&_0xc34e2e[_0x705e('0x42')]){_0x15ff1f[_0x705e('0x43')]['push']({'id':_0xc34e2e[_0x705e('0x41')],'value':_0xc34e2e['content']['toString']()});}else if(_0xc34e2e['type']===_0x705e('0x44')&&_0xc34e2e[_0x705e('0x45')]&&_0xc34e2e[_0x705e('0x41')]&&_0xc34e2e[_0x705e('0x42')]){_0x4b28b4[_0xc34e2e[_0x705e('0x45')]]&&_0x15ff1f[_0x705e('0x43')]['push']({'id':_0xc34e2e[_0x705e('0x41')],'value':_0x4b28b4[_0xc34e2e[_0x705e('0x45')]][_0x705e('0x35')]()});}else if(_0xc34e2e[_0x705e('0x3e')]===_0x705e('0x46')&&_0xc34e2e[_0x705e('0x47')]&&_0xc34e2e['Variable']['name']&&_0xc34e2e[_0x705e('0x41')]&&_0xc34e2e[_0x705e('0x42')]){_0x4b28b4[_0xc34e2e[_0x705e('0x47')][_0x705e('0x11')][_0x705e('0x48')]()]&&_0x15ff1f['custom_fields'][_0x705e('0x49')]({'id':_0xc34e2e[_0x705e('0x41')],'value':_0x4b28b4[_0xc34e2e[_0x705e('0x47')][_0x705e('0x11')][_0x705e('0x48')]()]['toString']()});}});}return _0x15ff1f;}exports['queue']=function(_0x46dfc2,_0x339f0d,_0x3a8878,_0x5b8acb,_0x5267b9,_0x2ed97c){var _0x19c1ad,_0x2d0984;_0x2ed97c[_0x705e('0xe')]=intUtil['stripTrailingSlash'](_0x2ed97c[_0x705e('0xe')]);_0x2ed97c[_0x705e('0x4a')]=intUtil[_0x705e('0x4b')](_0x2ed97c[_0x705e('0x4a')]);if(_0x5267b9&&_0x5267b9['monitor_format']){logger[_0x705e('0xa')]('[QUEUE]',_0x705e('0x4c'));_0x339f0d['recordingURL']=util[_0x705e('0xc')](_0x705e('0x4d'),_0x2ed97c[_0x705e('0x4a')],_0x339f0d[_0x705e('0x4e')],md5(_0x339f0d['uniqueid']));}else{_0x339f0d[_0x705e('0x4f')]='';}headers[_0x705e('0x50')]=getAuth(_0x2ed97c);return getUser(_0x2ed97c,_0x5b8acb['email'])['then'](function(_0xd7b849){_0x19c1ad=_0xd7b849;logger[_0x705e('0xa')](_0x705e('0x51'),_0x19c1ad['id']);return getEndUser(_0x2ed97c,_0x339f0d[_0x705e('0x52')],_0x339f0d['calleridnum']);})[_0x705e('0x1b')](function(_0x51ea84){_0x2d0984=_0x51ea84;logger[_0x705e('0xa')](_0x705e('0x53'),_0x2d0984['id']);return getTicket(_0x2ed97c,_0x19c1ad,_0x2d0984,_0x3a8878,_0x339f0d);})[_0x705e('0x1b')](function(_0x1eb1d7){if(_0x1eb1d7){logger['info']('The\x20Ticket\x20ID\x20is:',_0x1eb1d7['id']);switch(_0x2ed97c[_0x705e('0x3e')]){case'integrationTab':logger[_0x705e('0xa')](_0x705e('0x54'),_0x705e('0x55'));return request({'uri':util[_0x705e('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2ed97c[_0x705e('0xe')],_0x19c1ad['id'],_0x1eb1d7['id']),'method':'POST'});case _0x705e('0x56'):logger[_0x705e('0xa')](_0x705e('0x54'),_0x705e('0x57'));emit(util[_0x705e('0xc')]('user:%s',_0x5b8acb['name']),_0x705e('0x58'),{'uri':util['format'](_0x705e('0x59'),_0x2ed97c[_0x705e('0xe')][_0x705e('0x5a')](_0x705e('0x5b'),''),_0x1eb1d7['id'])});break;default:logger['error'](_0x705e('0x54'),_0x705e('0x5c'));}}})[_0x705e('0x5d')](function(_0x2c260d){logger['error'](_0x705e('0x5e'),util[_0x705e('0x5f')](_0x2c260d,{'showHidden':!![],'depth':null}));});};exports[_0x705e('0x60')]=function(_0x14682d,_0x3b6d53,_0x537256,_0x52f8dc,_0x283acb,_0xcd613e,_0x23af62){var _0x5df8dd,_0x3e7b6d;_0xcd613e[_0x705e('0xe')]=intUtil[_0x705e('0x4b')](_0xcd613e[_0x705e('0xe')]);_0xcd613e[_0x705e('0x4a')]=intUtil[_0x705e('0x4b')](_0xcd613e[_0x705e('0x4a')]);if(_0x23af62&&_0x23af62[_0x705e('0x61')]&&_0x23af62[_0x705e('0x61')]!=='none'){logger[_0x705e('0xa')](_0x705e('0x62'),'Recording\x20is\x20enabled!');_0x3b6d53[_0x705e('0x4f')]=util[_0x705e('0xc')](_0x705e('0x4d'),_0xcd613e[_0x705e('0x4a')],_0x3b6d53[_0x705e('0x4e')],md5(_0x3b6d53[_0x705e('0x4e')]));}headers[_0x705e('0x50')]=getAuth(_0xcd613e);return getUser(_0xcd613e,_0x52f8dc[_0x705e('0x63')])[_0x705e('0x1b')](function(_0x2bc7cd){_0x5df8dd=_0x2bc7cd;logger[_0x705e('0xa')]('The\x20User\x20ID\x20is:',_0x5df8dd['id']);return getEndUser(_0xcd613e,_0x3b6d53['destcalleridname'],_0x3b6d53[_0x705e('0x64')]);})['then'](function(_0x2c0c01){_0x3e7b6d=_0x2c0c01;logger[_0x705e('0xa')](_0x705e('0x53'),_0x3e7b6d['id']);return getTicket(_0xcd613e,_0x5df8dd,_0x3e7b6d,_0x537256,_0x3b6d53);})[_0x705e('0x1b')](function(_0x3441e4){if(_0x3441e4){logger['info'](_0x705e('0x65'),_0x3441e4['id']);switch(_0xcd613e[_0x705e('0x3e')]){case _0x705e('0x66'):logger[_0x705e('0xa')](_0x705e('0x62'),_0x705e('0x55'));return request({'uri':util[_0x705e('0xc')](_0x705e('0x67'),_0xcd613e[_0x705e('0xe')],_0x5df8dd['id'],_0x3441e4['id']),'method':_0x705e('0xf')});case _0x705e('0x56'):logger[_0x705e('0xa')](_0x705e('0x62'),_0x705e('0x57'));emit(util[_0x705e('0xc')](_0x705e('0x68'),_0x52f8dc['name']),_0x705e('0x58'),{'uri':util[_0x705e('0xc')](_0x705e('0x59'),_0xcd613e[_0x705e('0xe')]['replace']('/api/v2',''),_0x3441e4['id'])});break;default:logger[_0x705e('0x69')](_0x705e('0x62'),_0x705e('0x5c'));}}})[_0x705e('0x5d')](function(_0xbc142d){logger[_0x705e('0x69')](_0x705e('0x6a'),util[_0x705e('0x5f')](_0xbc142d,{'showHidden':!![],'depth':null}));});};exports[_0x705e('0x6b')]=function(_0x195e37,_0x5c2fe8,_0x27b1e7,_0x31cbc0,_0x496937,_0x4ab404){var _0x3bb0be,_0x27e204;_0x4ab404[_0x705e('0xe')]=intUtil['stripTrailingSlash'](_0x4ab404[_0x705e('0xe')]);_0x4ab404[_0x705e('0x4a')]=intUtil['stripTrailingSlash'](_0x4ab404['serverUrl']);if(_0x496937&&_0x496937[_0x705e('0x6c')]){logger['info']('['+_0x5c2fe8[_0x705e('0x6d')][_0x705e('0x6e')]()+']','Recording\x20is\x20enabled!');_0x5c2fe8[_0x705e('0x4f')]=util[_0x705e('0xc')](_0x705e('0x4d'),_0x4ab404['serverUrl'],_0x5c2fe8[_0x705e('0x4e')],md5(_0x5c2fe8[_0x705e('0x4e')]));}else{_0x5c2fe8['recordingURL']='';}headers[_0x705e('0x50')]=getAuth(_0x4ab404);return getUser(_0x4ab404)[_0x705e('0x1b')](function(_0x37e26a){_0x3bb0be=_0x37e26a;logger[_0x705e('0xa')](_0x705e('0x51'),_0x3bb0be['id']);return getEndUser(_0x4ab404,_0x5c2fe8['calleridname'],_0x5c2fe8['calleridnum']);})[_0x705e('0x1b')](function(_0x33fa12){_0x27e204=_0x33fa12;logger['info'](_0x705e('0x53'),_0x27e204['id']);return getTicket(_0x4ab404,_0x3bb0be,_0x27e204,_0x27b1e7,_0x5c2fe8);})['then'](function(_0x177742){if(_0x177742){logger[_0x705e('0xa')](_0x705e('0x65'),_0x177742['id']);}})[_0x705e('0x5d')](function(_0x180aa6){logger[_0x705e('0x69')]('['+_0x5c2fe8[_0x705e('0x6d')][_0x705e('0x6e')]()+']'+_0x705e('0x6f'),util[_0x705e('0x5f')](_0x180aa6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf066=['content','push','variable','variableName','idField','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','[HTTP]','GET','map','includes','string','picklist','type','customField','toLowerCase'];(function(_0x3e5f6e,_0x415244){var _0x3ba20e=function(_0x2cccc5){while(--_0x2cccc5){_0x3e5f6e['push'](_0x3e5f6e['shift']());}};_0x3ba20e(++_0x415244);}(_0xf066,0x169));var _0x6f06=function(_0x955747,_0xd1ab29){_0x955747=_0x955747-0x0;var _0x3ff6d5=_0xf066[_0x955747];return _0x3ff6d5;};'use strict';var _=require(_0x6f06('0x0'));var rp=require(_0x6f06('0x1'));var md5=require(_0x6f06('0x2'));var util=require('util');var Redis=require(_0x6f06('0x3'));var intUtil=require('./util');var config=require(_0x6f06('0x4'));var logger=require(_0x6f06('0x5'))('zendesk');config[_0x6f06('0x6')]=_[_0x6f06('0x7')](config[_0x6f06('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f06('0x6')]));function emit(_0x34c25d,_0xf2eee6,_0x3e8eff){io['to'](_0x34c25d)['emit'](_0xf2eee6,_0x3e8eff);}var headers={'Content-Type':'application/json','Accept':_0x6f06('0x8')};function getTicket(_0x17dba5,_0x189c81,_0x44d4b8,_0xcdb556,_0xe8820b){logger[_0x6f06('0x9')](_0x6f06('0xa'));return request({'uri':util['format'](_0x6f06('0xb'),_0x17dba5[_0x6f06('0xc')]),'method':'POST','body':{'ticket':_[_0x6f06('0xd')]({'requester_id':_0x44d4b8['id'],'submitter_id':_0x189c81?_0x189c81['id']:undefined,'assignee_id':_0x189c81?_0x189c81['id']:undefined,'tags':getTags(_0xcdb556[_0x6f06('0xe')],_0x6f06('0xf')),'subject':intUtil[_0x6f06('0x10')](_0xcdb556[_0x6f06('0x11')],_0xe8820b,'\x20'),'description':intUtil['getString'](_0xcdb556[_0x6f06('0x12')],_0xe8820b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6f06('0x10')](_0xcdb556['Descriptions'],_0xe8820b,'\x0a')}},getCustomFields(_0xcdb556[_0x6f06('0x13')],_0xe8820b))}})[_0x6f06('0x14')](function(_0x4563be){logger[_0x6f06('0x9')]('Ticket\x20created!');return _0x4563be['ticket'];});}function getUser(_0x51a319,_0x5a4db6){if(intUtil[_0x6f06('0x15')](_0x5a4db6)){logger[_0x6f06('0x9')](_0x6f06('0x16'),_0x5a4db6);return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x18'),_0x51a319['remoteUri']),'qs':{'query':util[_0x6f06('0x17')](_0x6f06('0x19'),_0x5a4db6)}})[_0x6f06('0x14')](function(_0xc2adbe){if(_0xc2adbe[_0x6f06('0x1a')]){logger[_0x6f06('0x9')]('Agent\x20found!');return _[_0x6f06('0x1b')](_0xc2adbe[_0x6f06('0x1c')],{'email':_0x5a4db6,'role':'agent'});}else{logger[_0x6f06('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x6f06('0x1d'),_0x51a319[_0x6f06('0xc')])})[_0x6f06('0x14')](function(_0x22dba8){logger[_0x6f06('0x9')](_0x6f06('0x1e'));return _0x22dba8[_0x6f06('0x1f')];});}});}else{logger[_0x6f06('0x9')](_0x6f06('0x20'));return request({'uri':util['format'](_0x6f06('0x1d'),_0x51a319[_0x6f06('0xc')])})['then'](function(_0x304c11){logger[_0x6f06('0x9')](_0x6f06('0x1e'));return _0x304c11[_0x6f06('0x1f')];});}}function getEndUser(_0x184da3,_0x38f3d7,_0x2cecff){logger[_0x6f06('0x9')]('Searching\x20enduser\x20with\x20phone',_0x2cecff);return request({'uri':util['format'](_0x6f06('0x18'),_0x184da3[_0x6f06('0xc')]),'qs':{'query':util[_0x6f06('0x17')](_0x6f06('0x21'),_0x2cecff)}})[_0x6f06('0x14')](function(_0x174ecf){var _0x345f68;if(_0x174ecf[_0x6f06('0x1c')]['length']){_0x174ecf[_0x6f06('0x1c')]=_[_0x6f06('0x22')](_0x174ecf[_0x6f06('0x1c')],{'suspended':![],'role':_0x6f06('0x23')});if(_0x174ecf[_0x6f06('0x1c')][_0x6f06('0x24')]){_0x345f68=_['first'](_0x174ecf[_0x6f06('0x1c')]);}}if(_0x345f68){logger[_0x6f06('0x9')](_0x6f06('0x25'));return _0x345f68;}else{logger[_0x6f06('0x9')](_0x6f06('0x26'));return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x27'),_0x184da3['remoteUri']),'method':_0x6f06('0x28'),'body':{'user':{'role':_0x6f06('0x23'),'name':util[_0x6f06('0x17')](_0x6f06('0x29'),_0x38f3d7||_0x2cecff),'phone':_0x2cecff}}})['then'](function(_0x3a599e){logger[_0x6f06('0x9')](_0x6f06('0x2a'));return _0x3a599e[_0x6f06('0x1f')];});}});}function getAuth(_0xb2eaf4){var _0x3703ae;if(_0xb2eaf4[_0x6f06('0x2b')]===_0x6f06('0x2c')){_0x3703ae=util[_0x6f06('0x17')](_0x6f06('0x2d'),_0xb2eaf4[_0x6f06('0x2e')],_0xb2eaf4[_0x6f06('0x2c')]);}else if(_0xb2eaf4[_0x6f06('0x2b')]===_0x6f06('0x2f')){_0x3703ae=util['format']('%s/token:%s',_0xb2eaf4[_0x6f06('0x2e')],_0xb2eaf4[_0x6f06('0x2f')]);}return util[_0x6f06('0x17')](_0x6f06('0x30'),new Buffer(_0x3703ae)[_0x6f06('0x31')]('base64'));}function request(_0x19e9b5){logger['debug'](_0x6f06('0x32'),JSON['stringify'](_0x19e9b5));return rp(_[_0x6f06('0x7')](_0x19e9b5,{'method':_0x6f06('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x416387,_0x43acab){var _0x46fa39=[];if(_0x416387&&_0x416387['length']>0x0){_0x46fa39=_[_0x6f06('0x34')](_0x416387,_0x43acab);}return _0x46fa39;}function getCustomFields(_0x4e105e,_0x2afe92){var _0xc33e79=[];var _0x53f69f={'custom_fields':[]};if(_0x4e105e[_0x6f06('0x24')]>0x0){_['forEach'](_0x4e105e,function(_0x57b9d3){if(_[_0x6f06('0x35')]([_0x6f06('0x36'),_0x6f06('0x37')],_0x57b9d3[_0x6f06('0x38')])&&_0x57b9d3['nameField']&&!_0x57b9d3[_0x6f06('0x39')]){_0x53f69f[_0x57b9d3['nameField'][_0x6f06('0x3a')]()]=_0x57b9d3[_0x6f06('0x3b')]['toString']();}else if(_[_0x6f06('0x35')]([_0x6f06('0x36'),_0x6f06('0x37')],_0x57b9d3[_0x6f06('0x38')])&&_0x57b9d3['idField']&&_0x57b9d3[_0x6f06('0x39')]){_0x53f69f['custom_fields'][_0x6f06('0x3c')]({'id':_0x57b9d3['idField'],'value':_0x57b9d3[_0x6f06('0x3b')][_0x6f06('0x31')]()});}else if(_0x57b9d3[_0x6f06('0x38')]===_0x6f06('0x3d')&&_0x57b9d3[_0x6f06('0x3e')]&&_0x57b9d3[_0x6f06('0x3f')]&&_0x57b9d3[_0x6f06('0x39')]){_0x2afe92[_0x57b9d3[_0x6f06('0x3e')]]&&_0x53f69f[_0x6f06('0x40')][_0x6f06('0x3c')]({'id':_0x57b9d3[_0x6f06('0x3f')],'value':_0x2afe92[_0x57b9d3['variableName']]['toString']()});}else if(_0x57b9d3[_0x6f06('0x38')]===_0x6f06('0x41')&&_0x57b9d3['Variable']&&_0x57b9d3['Variable'][_0x6f06('0xf')]&&_0x57b9d3[_0x6f06('0x3f')]&&_0x57b9d3[_0x6f06('0x39')]){_0x2afe92[_0x57b9d3['Variable']['name'][_0x6f06('0x3a')]()]&&_0x53f69f[_0x6f06('0x40')][_0x6f06('0x3c')]({'id':_0x57b9d3[_0x6f06('0x3f')],'value':_0x2afe92[_0x57b9d3[_0x6f06('0x42')][_0x6f06('0xf')][_0x6f06('0x3a')]()][_0x6f06('0x31')]()});}});}return _0x53f69f;}exports[_0x6f06('0x43')]=function(_0x4df8fb,_0x2cbc38,_0x2ffbab,_0x592879,_0x2b0199,_0x32e309){var _0x4162e0,_0x39450e;_0x32e309['remoteUri']=intUtil[_0x6f06('0x44')](_0x32e309[_0x6f06('0xc')]);_0x32e309[_0x6f06('0x45')]=intUtil[_0x6f06('0x44')](_0x32e309[_0x6f06('0x45')]);if(_0x2b0199&&_0x2b0199['monitor_format']){logger[_0x6f06('0x9')](_0x6f06('0x46'),'Recording\x20is\x20enabled!');_0x2cbc38[_0x6f06('0x47')]=util[_0x6f06('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x32e309[_0x6f06('0x45')],_0x2cbc38['uniqueid'],md5(_0x2cbc38[_0x6f06('0x48')]));}else{_0x2cbc38[_0x6f06('0x47')]='';}headers[_0x6f06('0x49')]=getAuth(_0x32e309);return getUser(_0x32e309,_0x592879[_0x6f06('0x4a')])[_0x6f06('0x14')](function(_0x4e9da2){_0x4162e0=_0x4e9da2;logger['info'](_0x6f06('0x4b'),_0x4162e0['id']);return getEndUser(_0x32e309,_0x2cbc38['calleridname'],_0x2cbc38['calleridnum']);})[_0x6f06('0x14')](function(_0x7b77f8){_0x39450e=_0x7b77f8;logger[_0x6f06('0x9')](_0x6f06('0x4c'),_0x39450e['id']);return getTicket(_0x32e309,_0x4162e0,_0x39450e,_0x2ffbab,_0x2cbc38);})['then'](function(_0x513a65){if(_0x513a65){logger[_0x6f06('0x9')]('The\x20Ticket\x20ID\x20is:',_0x513a65['id']);switch(_0x32e309[_0x6f06('0x38')]){case _0x6f06('0x4d'):logger[_0x6f06('0x9')](_0x6f06('0x46'),_0x6f06('0x4e'));return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x4f'),_0x32e309['remoteUri'],_0x4162e0['id'],_0x513a65['id']),'method':'POST'});case _0x6f06('0x50'):logger[_0x6f06('0x9')](_0x6f06('0x46'),_0x6f06('0x51'));emit(util[_0x6f06('0x17')]('user:%s',_0x592879[_0x6f06('0xf')]),_0x6f06('0x52'),{'uri':util[_0x6f06('0x17')](_0x6f06('0x53'),_0x32e309[_0x6f06('0xc')][_0x6f06('0x54')]('/api/v2',''),_0x513a65['id'])});break;default:logger[_0x6f06('0x55')](_0x6f06('0x46'),_0x6f06('0x56'));}}})[_0x6f06('0x57')](function(_0x6873c){logger[_0x6f06('0x55')](_0x6f06('0x58'),util[_0x6f06('0x59')](_0x6873c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x372b47,_0x3c6632,_0x292d43,_0x2728e7,_0x2ee51f,_0x28536b,_0x286d3a){var _0x1536dd,_0x3adad0;_0x28536b[_0x6f06('0xc')]=intUtil['stripTrailingSlash'](_0x28536b[_0x6f06('0xc')]);_0x28536b[_0x6f06('0x45')]=intUtil[_0x6f06('0x44')](_0x28536b[_0x6f06('0x45')]);if(_0x286d3a&&_0x286d3a[_0x6f06('0x5a')]&&_0x286d3a[_0x6f06('0x5a')]!==_0x6f06('0x5b')){logger['info'](_0x6f06('0x5c'),'Recording\x20is\x20enabled!');_0x3c6632[_0x6f06('0x47')]=util[_0x6f06('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28536b[_0x6f06('0x45')],_0x3c6632[_0x6f06('0x48')],md5(_0x3c6632[_0x6f06('0x48')]));}headers[_0x6f06('0x49')]=getAuth(_0x28536b);return getUser(_0x28536b,_0x2728e7['email'])['then'](function(_0x1e6feb){_0x1536dd=_0x1e6feb;logger[_0x6f06('0x9')](_0x6f06('0x4b'),_0x1536dd['id']);return getEndUser(_0x28536b,_0x3c6632[_0x6f06('0x5d')],_0x3c6632[_0x6f06('0x5e')]);})['then'](function(_0x386841){_0x3adad0=_0x386841;logger[_0x6f06('0x9')]('The\x20Enduser\x20ID\x20is:',_0x3adad0['id']);return getTicket(_0x28536b,_0x1536dd,_0x3adad0,_0x292d43,_0x3c6632);})[_0x6f06('0x14')](function(_0x381e97){if(_0x381e97){logger['info'](_0x6f06('0x5f'),_0x381e97['id']);switch(_0x28536b[_0x6f06('0x38')]){case _0x6f06('0x4d'):logger[_0x6f06('0x9')](_0x6f06('0x5c'),_0x6f06('0x4e'));return request({'uri':util[_0x6f06('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x28536b['remoteUri'],_0x1536dd['id'],_0x381e97['id']),'method':'POST'});case _0x6f06('0x50'):logger[_0x6f06('0x9')](_0x6f06('0x5c'),_0x6f06('0x51'));emit(util[_0x6f06('0x17')](_0x6f06('0x60'),_0x2728e7[_0x6f06('0xf')]),_0x6f06('0x52'),{'uri':util['format'](_0x6f06('0x53'),_0x28536b[_0x6f06('0xc')][_0x6f06('0x54')](_0x6f06('0x61'),''),_0x381e97['id'])});break;default:logger['error'](_0x6f06('0x5c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6f06('0x57')](function(_0x22f293){logger[_0x6f06('0x55')](_0x6f06('0x62'),util[_0x6f06('0x59')](_0x22f293,{'showHidden':!![],'depth':null}));});};exports[_0x6f06('0x63')]=function(_0x6680b1,_0x250a30,_0x2bf2ec,_0x48a3b0,_0x19b68a,_0x3a8ccd){var _0x5866b3,_0x5c3fdb;_0x3a8ccd['remoteUri']=intUtil[_0x6f06('0x44')](_0x3a8ccd[_0x6f06('0xc')]);_0x3a8ccd['serverUrl']=intUtil[_0x6f06('0x44')](_0x3a8ccd[_0x6f06('0x45')]);if(_0x19b68a&&_0x19b68a[_0x6f06('0x64')]){logger['info']('['+_0x250a30[_0x6f06('0x65')][_0x6f06('0x66')]()+']','Recording\x20is\x20enabled!');_0x250a30[_0x6f06('0x47')]=util['format'](_0x6f06('0x67'),_0x3a8ccd[_0x6f06('0x45')],_0x250a30[_0x6f06('0x48')],md5(_0x250a30['uniqueid']));}else{_0x250a30[_0x6f06('0x47')]='';}headers[_0x6f06('0x49')]=getAuth(_0x3a8ccd);return getUser(_0x3a8ccd)[_0x6f06('0x14')](function(_0x4d7cb1){_0x5866b3=_0x4d7cb1;logger[_0x6f06('0x9')](_0x6f06('0x4b'),_0x5866b3['id']);return getEndUser(_0x3a8ccd,_0x250a30['calleridname'],_0x250a30[_0x6f06('0x68')]);})['then'](function(_0x472060){_0x5c3fdb=_0x472060;logger[_0x6f06('0x9')](_0x6f06('0x4c'),_0x5c3fdb['id']);return getTicket(_0x3a8ccd,_0x5866b3,_0x5c3fdb,_0x2bf2ec,_0x250a30);})[_0x6f06('0x14')](function(_0x252863){if(_0x252863){logger[_0x6f06('0x9')](_0x6f06('0x5f'),_0x252863['id']);}})[_0x6f06('0x57')](function(_0x3305f1){logger['error']('['+_0x250a30[_0x6f06('0x65')][_0x6f06('0x66')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x6f06('0x59')](_0x3305f1,{'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 3b2f811..97caab4 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 _0x4c63=['Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','first_name','last_name','code','details','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','role','administrator','Subject','getString','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','Call_Result','complete','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','unmanaged','toUpperCase','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','stringify','includes','picklist','type','idField','content','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','isNil','findIndex','email','Agent\x20found!','info'];(function(_0x3e19f2,_0x263ac8){var _0x57ad87=function(_0x47b811){while(--_0x47b811){_0x3e19f2['push'](_0x3e19f2['shift']());}};_0x57ad87(++_0x263ac8);}(_0x4c63,0xf2));var _0x34c6=function(_0x36b3aa,_0x3096d7){_0x36b3aa=_0x36b3aa-0x0;var _0x829dd3=_0x4c63[_0x36b3aa];return _0x829dd3;};'use strict';var _=require(_0x34c6('0x0'));var rp=require('request-promise');var md5=require(_0x34c6('0x1'));var util=require(_0x34c6('0x2'));var intUtil=require(_0x34c6('0x3'));var moment=require(_0x34c6('0x4'));var Redis=require(_0x34c6('0x5'));var BPromise=require(_0x34c6('0x6'));var config=require(_0x34c6('0x7'));var logger=require(_0x34c6('0x8'))(_0x34c6('0x9'));config[_0x34c6('0xa')]=_[_0x34c6('0xb')](config[_0x34c6('0xa')],{'host':_0x34c6('0xc'),'port':0x18eb});var io=require(_0x34c6('0xd'))(new Redis(config['redis']));function emit(_0x46883f,_0x5a7c20,_0x129fb1){io['to'](_0x46883f)['emit'](_0x5a7c20,_0x129fb1);}function request(_0x3f2790){logger['debug'](_0x34c6('0xe'),JSON[_0x34c6('0xf')](_0x3f2790));return rp(_0x3f2790);}function getCustomFields(_0x435bc3,_0x5d0de1){var _0x4b8283={};if(_0x435bc3['length']>0x0){_['forEach'](_0x435bc3,function(_0x15a40b){if(_[_0x34c6('0x10')](['string',_0x34c6('0x11')],_0x15a40b[_0x34c6('0x12')])&&_0x15a40b['idField']){_0x4b8283[_0x15a40b[_0x34c6('0x13')]]=_0x15a40b[_0x34c6('0x14')]['toString']();}else if(_0x15a40b[_0x34c6('0x12')]==='variable'&&_0x15a40b['variableName']&&_0x15a40b[_0x34c6('0x13')]&&_0x5d0de1[_0x15a40b[_0x34c6('0x15')]]){_0x4b8283[_0x15a40b['idField']]=_0x5d0de1[_0x15a40b['variableName']]['toString']();}else if(_0x15a40b['type']===_0x34c6('0x16')&&_0x15a40b[_0x34c6('0x17')]&&_0x15a40b[_0x34c6('0x17')][_0x34c6('0x18')]&&_0x15a40b['idField']&&_0x5d0de1[_0x15a40b[_0x34c6('0x17')]['name'][_0x34c6('0x19')]()]){_0x4b8283[_0x15a40b[_0x34c6('0x13')]]=_0x5d0de1[_0x15a40b[_0x34c6('0x17')][_0x34c6('0x18')][_0x34c6('0x19')]()][_0x34c6('0x1a')]();}});}return _0x4b8283;}function getName(_0x5fe241){if(_0x5fe241[_0x34c6('0x1b')]('\x20')>0x0){var _0x19fb24=_0x5fe241['split'](/ (.+)/);if(_0x19fb24[0x1]){return _0x19fb24;}}return[_0x5fe241,_0x5fe241];}var accountsTokens={};function getAccessToken(_0x37e6d9){return new Promise(function(_0x42a868,_0x108624){if(!_['isNil'](accountsTokens[_0x37e6d9['id']])&&!_['isNil'](accountsTokens[_0x37e6d9['id']][_0x34c6('0x1c')])){if(moment()[_0x34c6('0x1d')](accountsTokens[_0x37e6d9['id']][_0x34c6('0x1e')])){_0x42a868(accountsTokens[_0x37e6d9['id']][_0x34c6('0x1c')]);}}var _0x4db037;switch(_0x37e6d9[_0x34c6('0x1f')]){case'US':_0x4db037=_0x34c6('0x20');break;case'AU':_0x4db037=_0x34c6('0x21');break;case'EU':_0x4db037=_0x34c6('0x22');break;case'IN':_0x4db037=_0x34c6('0x23');break;case'CN':_0x4db037=_0x34c6('0x24');break;default:_0x4db037=_0x34c6('0x22');break;}var _0xbecf4b={'method':_0x34c6('0x25'),'uri':_0x4db037+'/oauth/v2/token','qs':{'refresh_token':_0x37e6d9[_0x34c6('0x26')],'client_id':_0x37e6d9[_0x34c6('0x27')],'client_secret':_0x37e6d9[_0x34c6('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xbecf4b)['then'](function(_0x109b9f){accountsTokens[_0x37e6d9['id']]={'access_token':_0x109b9f[_0x34c6('0x1c')],'expires_in':moment()[_0x34c6('0x29')](_0x109b9f[_0x34c6('0x1e')],_0x34c6('0x2a'))};_0x42a868(_0x109b9f['access_token']);})[_0x34c6('0x2b')](function(_0x16603c){logger[_0x34c6('0x2c')](_0x34c6('0x2d'),_0x16603c[_0x34c6('0x2e')]);_0x108624(_0x16603c);});});}function getUser(_0x4ecf64,_0x5fd795,_0x4d77fc,_0x49d09f){logger['info']('Search\x20user');return request({'method':_0x34c6('0x2f'),'uri':util[_0x34c6('0x30')](_0x34c6('0x31'),_0x5fd795),'qs':{'type':_0x34c6('0x32')},'headers':{'Authorization':_0x34c6('0x33')+_0x4ecf64},'json':!![]})[_0x34c6('0x34')](function(_0x438ef3){if(_0x438ef3[_0x34c6('0x35')]){var _0x4a1058=-0x1;if(_[_0x34c6('0x36')](_0x438ef3[_0x34c6('0x35')])){if(!_[_0x34c6('0x37')](_0x49d09f)){_0x4a1058=_[_0x34c6('0x38')](_0x438ef3[_0x34c6('0x35')],function(_0x2b8b92){return _0x2b8b92[_0x34c6('0x39')]===_0x49d09f;});}if(_0x4a1058>=0x0){logger['info'](_0x34c6('0x3a'));}else{logger[_0x34c6('0x3b')](_0x34c6('0x3c'));_0x4a1058=_[_0x34c6('0x38')](_0x438ef3[_0x34c6('0x35')],function(_0x157059){return _0x157059[_0x34c6('0x3d')]['name']===_0x34c6('0x3e');});}return _0x438ef3['users'][_0x4a1058];}else{if(_0x438ef3[_0x34c6('0x3f')][_0x34c6('0x3d')][_0x34c6('0x18')]===_0x34c6('0x3e')){logger[_0x34c6('0x3b')]('Using\x20the\x20admin\x20account!');user=_0x438ef3['user'];return user;}else{logger['error'](_0x34c6('0x40'),JSON[_0x34c6('0xf')](_0x438ef3));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x34c6('0xf')](_0x438ef3));}}}else{logger[_0x34c6('0x2c')](_0x34c6('0x40'),JSON[_0x34c6('0xf')](_0x438ef3));throw new Error(_0x34c6('0x41')+JSON[_0x34c6('0xf')](_0x438ef3));}})[_0x34c6('0x2b')](function(_0x21cf75){console[_0x34c6('0x2c')](_0x21cf75);});}function getZohoUser(_0x8b93fb,_0x45bdf8){return new BPromise(function(_0x29387a,_0x13ce85){request(_0x8b93fb)['then'](function(_0x36511d){var _0x2ccca6=null;if(_0x36511d){_0x2ccca6=_0x36511d[_0x34c6('0x42')][0x0];_0x2ccca6['enduserType']=_0x45bdf8;}_0x29387a(_0x2ccca6);})[_0x34c6('0x2b')](function(_0x178af2){_0x13ce85(_0x178af2);});});}function createEndUser(_0x562b98,_0x3016e8,_0x1c7048,_0x653c4e,_0x52c007,_0x2ac58c){var _0x1c7048=getName(_0x1c7048);return request({'method':'POST','uri':_0x34c6('0x43')+_0x3016e8+_0x34c6('0x44')+_[_0x34c6('0x45')](_0x2ac58c[_0x34c6('0x46')])+'s','body':{'data':[{'Last_Name':_0x1c7048[0x1],'First_Name':_0x1c7048[0x0],'Phone':_0x653c4e,'Owner':{'name':!_[_0x34c6('0x37')](_0x52c007['role'][_0x34c6('0x18')])?_0x52c007['role'][_0x34c6('0x18')]:!_['isNil'](_0x52c007['first_name'])?_0x52c007[_0x34c6('0x47')]+'\x20'+_0x52c007[_0x34c6('0x48')]:_0x52c007['last_name'],'id':_0x52c007['id']}}]},'headers':{'Authorization':_0x34c6('0x33')+_0x562b98},'json':!![]})[_0x34c6('0x34')](function(_0xd4bb6c){if(_0xd4bb6c&&_0xd4bb6c[_0x34c6('0x42')][0x0][_0x34c6('0x49')]==='SUCCESS'){var _0x339760=_0xd4bb6c[_0x34c6('0x42')][0x0][_0x34c6('0x4a')];_0x339760['enduserType']=_[_0x34c6('0x45')](_0x2ac58c[_0x34c6('0x46')])+'s';return _0x339760;}logger[_0x34c6('0x2c')](_0x34c6('0x40'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x34c6('0x2b')](function(_0xbf8f21){console[_0x34c6('0x4b')](_0x34c6('0x4c'),_0xbf8f21);});}function getEndUser(_0x4b3b53,_0x96a145,_0x2e770d,_0x2160fd,_0x847dde,_0x269cc3,_0x1aed60){var _0x1abd97={'method':_0x34c6('0x2f'),'uri':'','headers':{'Authorization':_0x34c6('0x33')+_0x4b3b53},'json':!![]};switch(_0x1aed60['moduleSearch']){case _0x34c6('0x4d'):_0x1abd97[_0x34c6('0x4e')]=_0x34c6('0x43')+_0x96a145+_0x34c6('0x4f')+_0x847dde+'))';return getZohoUser(_0x1abd97,_0x34c6('0x50'))['then'](function(_0x2100a1){if(_0x2100a1)return _0x2100a1;_0x1abd97[_0x34c6('0x4e')]='https://www.zohoapis.'+_0x96a145+_0x34c6('0x51')+_0x847dde+'))';return getZohoUser(_0x1abd97,_0x34c6('0x52'))['then'](function(_0x4ec94a){if(_0x4ec94a)return _0x4ec94a;if(_0x1aed60['moduleCreate']!=_0x34c6('0x53')){return createEndUser(_0x4b3b53,_0x96a145,_0x2160fd,_0x847dde,_0x269cc3,_0x1aed60);}else{return{};}});});break;case _0x34c6('0x54'):_0x1abd97[_0x34c6('0x4e')]='https://www.zohoapis.'+_0x96a145+_0x34c6('0x4f')+_0x847dde+'))';return getZohoUser(_0x1abd97,_0x34c6('0x50'))[_0x34c6('0x34')](function(_0x5f2524){if(_0x5f2524)return _0x5f2524;if(_0x1aed60[_0x34c6('0x46')]!=_0x34c6('0x53')){return createEndUser(_0x4b3b53,_0x96a145,_0x2160fd,_0x847dde,_0x269cc3,_0x1aed60);}else{return{};}});break;case _0x34c6('0x55'):_0x1abd97[_0x34c6('0x4e')]=_0x34c6('0x43')+_0x96a145+_0x34c6('0x51')+_0x847dde+'))';return getZohoUser(_0x1abd97,'Leads')[_0x34c6('0x34')](function(_0x411286){if(_0x411286)return _0x411286;if(_0x1aed60[_0x34c6('0x46')]!='nothing'){return createEndUser(_0x4b3b53,_0x96a145,_0x2160fd,_0x847dde,_0x269cc3,_0x1aed60);}else{return{};}});break;}}function getCall(_0x1eda18,_0x19a9a4,_0x56ce3b,_0x1b8377,_0x5d3c61,_0x503ab0,_0x47ec46,_0x158a8a){logger['info'](_0x34c6('0x56'));var _0x187cfc={};_0x187cfc['Owner']={'name':!_[_0x34c6('0x37')](_0x1b8377[_0x34c6('0x57')][_0x34c6('0x18')])&&!_[_0x34c6('0x37')](_0x1b8377['profile'][_0x34c6('0x18')])&&_0x1b8377[_0x34c6('0x3d')][_0x34c6('0x18')]===_0x34c6('0x58')?_0x1b8377[_0x34c6('0x57')][_0x34c6('0x18')]:!_[_0x34c6('0x37')](_0x1b8377['first_name'])?_0x1b8377[_0x34c6('0x47')]+'\x20'+_0x1b8377[_0x34c6('0x48')]:_0x1b8377[_0x34c6('0x48')],'id':_0x1b8377['id']};_0x187cfc[_0x34c6('0x59')]=intUtil[_0x34c6('0x5a')](_0x503ab0['Subjects'],_0x47ec46,'\x20');_0x187cfc['Description']=intUtil['getString'](_0x503ab0[_0x34c6('0x5b')],_0x47ec46,'\x0a');if(_0x5d3c61[_0x34c6('0x5c')]===_0x34c6('0x50')){_0x187cfc[_0x34c6('0x5d')]={'name':!_[_0x34c6('0x37')](_0x5d3c61['Full_Name'])?_0x5d3c61[_0x34c6('0x5e')]:!_['isNil'](_0x5d3c61[_0x34c6('0x5f')])?_0x5d3c61[_0x34c6('0x5f')]+'\x20'+_0x5d3c61[_0x34c6('0x60')]:_0x5d3c61['Last_Name'],'id':_0x5d3c61['id']};}if(_0x5d3c61[_0x34c6('0x5c')]==='Leads'){_0x187cfc[_0x34c6('0x61')]={'name':!_[_0x34c6('0x37')](_0x5d3c61[_0x34c6('0x5e')])?_0x5d3c61[_0x34c6('0x5e')]:!_[_0x34c6('0x37')](_0x5d3c61[_0x34c6('0x5f')])?_0x5d3c61['First_Name']+'\x20'+_0x5d3c61[_0x34c6('0x60')]:_0x5d3c61[_0x34c6('0x60')],'id':_0x5d3c61['id']};_0x187cfc[_0x34c6('0x62')]=_[_0x34c6('0x45')](_0x5d3c61['enduserType']);}if(_0x47ec46['talktime']){_0x187cfc[_0x34c6('0x63')]=moment[_0x34c6('0x64')](parseInt(_0x47ec46['talktime'])*0x3e8)[_0x34c6('0x30')]('mm:ss');}else if(_0x47ec46[_0x34c6('0x65')]&&_0x47ec46[_0x34c6('0x66')]){_0x187cfc[_0x34c6('0x63')]=moment[_0x34c6('0x64')](moment(_0x47ec46[_0x34c6('0x66')],_0x34c6('0x67'))['diff'](moment(_0x47ec46[_0x34c6('0x68')],_0x34c6('0x67'))))[_0x34c6('0x30')](_0x34c6('0x69'));}switch(_0x47ec46[_0x34c6('0x6a')]){case _0x34c6('0x6b'):_0x187cfc[_0x34c6('0x6c')]='Called';break;case _0x34c6('0x6d'):case'connect':_0x187cfc[_0x34c6('0x6c')]='Answered';break;case _0x34c6('0x6e'):_0x187cfc[_0x34c6('0x6c')]='Rejected';break;case _0x34c6('0x6f'):_0x187cfc[_0x34c6('0x6c')]=_0x34c6('0x70');break;case'timeout':_0x187cfc[_0x34c6('0x6c')]=_0x34c6('0x71');default:}_0x187cfc[_0x34c6('0x72')]=(_0x158a8a===_0x34c6('0x73')?moment(_0x47ec46[_0x34c6('0x68')])[_0x34c6('0x30')](_0x34c6('0x67')):moment(_0x47ec46[_0x34c6('0x74')])[_0x34c6('0x30')](_0x34c6('0x67')))||moment()[_0x34c6('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x187cfc['Call_Type']=_0x158a8a||_0x34c6('0x75');_0x187cfc=_[_0x34c6('0x76')](_0x187cfc,getCustomFields(_0x503ab0[_0x34c6('0x77')],_0x47ec46));return request({'method':_0x34c6('0x25'),'uri':_0x34c6('0x43')+_0x19a9a4+'/crm/v2/Calls','headers':{'Authorization':_0x34c6('0x33')+_0x1eda18},'body':{'data':[_0x187cfc]},'json':!![]})[_0x34c6('0x34')](function(_0x4dbc25){if(_0x4dbc25&&_0x4dbc25[_0x34c6('0x42')][0x0][_0x34c6('0x49')]===_0x34c6('0x78')){logger['info'](_0x34c6('0x79'));return{'id':_0x4dbc25[_0x34c6('0x42')][0x0][_0x34c6('0x4a')]['id']};}})[_0x34c6('0x2b')](function(_0x4d2e32){logger[_0x34c6('0x3b')](_0x34c6('0x7a'),_0x4d2e32['stack']);console['log'](_0x34c6('0x7a'),_0x4d2e32);});}exports['queue']=function(_0x553e57,_0x4e567d,_0xded031,_0x50f044,_0x84a85d,_0x50aff4){var _0x42a8ad,_0x266453,_0x10ac61;_0x50aff4[_0x34c6('0x7b')]=intUtil[_0x34c6('0x7c')](_0x50aff4[_0x34c6('0x7b')]);_0x50aff4['serverUrl']=intUtil['stripTrailingSlash'](_0x50aff4[_0x34c6('0x7d')]);if(_0x84a85d&&_0x84a85d[_0x34c6('0x7e')]){logger[_0x34c6('0x3b')]('[QUEUE]',_0x34c6('0x7f'));_0x4e567d[_0x34c6('0x80')]=_0x50aff4[_0x34c6('0x7d')]+_0x34c6('0x81')+_0x4e567d[_0x34c6('0x82')]+_0x34c6('0x83')+md5(_0x4e567d[_0x34c6('0x82')]);}else{_0x4e567d['recordingURL']='';}var _0x41731f=_0x50aff4['host']===_0x34c6('0x84')?'eu':_0x34c6('0x85');return getAccessToken(_0x50aff4)[_0x34c6('0x34')](function(_0x1f1fe0){_0x10ac61=_0x1f1fe0;return getUser(_0x10ac61,_0x41731f,_0x50aff4,_0x50f044[_0x34c6('0x39')]);})[_0x34c6('0x34')](function(_0x45b6b5){_0x42a8ad=_0x45b6b5;logger[_0x34c6('0x3b')](_0x34c6('0x86'),_0x42a8ad['id']);return getEndUser(_0x10ac61,_0x41731f,_0x50aff4,_0x4e567d[_0x34c6('0x87')],_0x4e567d[_0x34c6('0x88')],_0x42a8ad,_0xded031);})[_0x34c6('0x34')](function(_0x3c247a){_0x266453=_0x3c247a;return getCall(_0x10ac61,_0x41731f,_0x50aff4,_0x42a8ad,_0x266453,_0xded031,_0x4e567d,_0x34c6('0x75'));})[_0x34c6('0x34')](function(_0x2fd7ed){if(_0x2fd7ed){logger['info'](_0x34c6('0x89'),_0x2fd7ed['id']);logger[_0x34c6('0x3b')](_0x34c6('0x8a'),_0x34c6('0x8b'));emit(util[_0x34c6('0x30')](_0x34c6('0x8c'),_0x50f044[_0x34c6('0x18')]),_0x34c6('0x8d'),{'uri':_0x34c6('0x8e')+_0x50aff4[_0x34c6('0x7b')]+_0x34c6('0x8f')+_0x2fd7ed['id']});}})[_0x34c6('0x2b')](function(_0x5e1d1a){logger['error'](_0x34c6('0x8a'),JSON[_0x34c6('0xf')](_0x5e1d1a));});};exports['outbound']=function(_0x168c5e,_0x1266de,_0x1f38c0,_0x769d81,_0x32880f,_0x1d5ca4,_0x49ffc6){var _0x4d26b5,_0x5b12a8,_0x114247;_0x1d5ca4[_0x34c6('0x7b')]=intUtil[_0x34c6('0x7c')](_0x1d5ca4[_0x34c6('0x7b')]);_0x1d5ca4[_0x34c6('0x7d')]=intUtil['stripTrailingSlash'](_0x1d5ca4[_0x34c6('0x7d')]);if(_0x49ffc6&&_0x49ffc6[_0x34c6('0x90')]&&_0x49ffc6[_0x34c6('0x90')]!==_0x34c6('0x91')){logger['info'](_0x34c6('0x92'),'Recording\x20is\x20enabled!');_0x1266de['recordingURL']=_0x1d5ca4[_0x34c6('0x7d')]+_0x34c6('0x81')+_0x1266de[_0x34c6('0x82')]+_0x34c6('0x83')+md5(_0x1266de[_0x34c6('0x82')]);}var _0x266c6d=_0x1d5ca4[_0x34c6('0x7b')]===_0x34c6('0x84')?'eu':_0x34c6('0x85');return getAccessToken(_0x1d5ca4)['then'](function(_0x457aa3){_0x114247=_0x457aa3;return getUser(_0x114247,_0x266c6d,_0x1d5ca4,_0x769d81[_0x34c6('0x39')]);})[_0x34c6('0x34')](function(_0x1737db){_0x4d26b5=_0x1737db;logger[_0x34c6('0x3b')](_0x34c6('0x86'),_0x4d26b5['id']);return getEndUser(_0x114247,_0x266c6d,_0x1d5ca4,_0x1266de[_0x34c6('0x93')],_0x1266de['destcalleridnum'],_0x4d26b5,_0x1f38c0);})['then'](function(_0x54ac2b){_0x5b12a8=_0x54ac2b;return getCall(_0x114247,_0x266c6d,_0x1d5ca4,_0x4d26b5,_0x5b12a8,_0x1f38c0,_0x1266de,_0x34c6('0x94'));})[_0x34c6('0x34')](function(_0x2f51b1){if(_0x2f51b1){logger[_0x34c6('0x3b')]('The\x20Call\x20ID\x20is:',_0x2f51b1['id']);logger[_0x34c6('0x3b')](_0x34c6('0x92'),_0x34c6('0x8b'));emit(util[_0x34c6('0x30')](_0x34c6('0x8c'),_0x769d81[_0x34c6('0x18')]),'trigger:browser:url',{'uri':_0x34c6('0x8e')+_0x1d5ca4[_0x34c6('0x7b')]+_0x34c6('0x8f')+_0x2f51b1['id']});}})[_0x34c6('0x2b')](function(_0x2b6b13){logger[_0x34c6('0x2c')](_0x34c6('0x92'),JSON['stringify'](_0x2b6b13));});};exports[_0x34c6('0x95')]=function(_0x2f793a,_0x2739aa,_0x17dafd,_0x4ec4c9,_0xfa557f,_0x311096){var _0x475ade,_0x2c2442,_0x1de848;_0x311096[_0x34c6('0x7b')]=intUtil['stripTrailingSlash'](_0x311096[_0x34c6('0x7b')]);_0x311096[_0x34c6('0x7d')]=intUtil[_0x34c6('0x7c')](_0x311096[_0x34c6('0x7d')]);if(_0xfa557f&&_0xfa557f['monitor_format']){logger[_0x34c6('0x3b')]('['+_0x2739aa['lastevent']['toUpperCase']()+']',_0x34c6('0x7f'));_0x2739aa[_0x34c6('0x80')]=_0x311096[_0x34c6('0x7d')]+'/api/voice/recordings/'+_0x2739aa[_0x34c6('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x2739aa['uniqueid']);}else{_0x2739aa['recordingURL']='';}var _0x3db942=_0x311096[_0x34c6('0x7b')]==='zoho.eu'?'eu':_0x34c6('0x85');return getAccessToken(_0x311096)['then'](function(_0x459677){_0x1de848=_0x459677;return getUser(_0x1de848,_0x3db942,_0x311096);})[_0x34c6('0x34')](function(_0x5537a6){_0x475ade=_0x5537a6;logger[_0x34c6('0x3b')]('The\x20User\x20ID\x20is:',_0x475ade['id']);return getEndUser(_0x1de848,_0x3db942,_0x311096,_0x2739aa[_0x34c6('0x87')],_0x2739aa[_0x34c6('0x88')],_0x475ade,_0x17dafd);})[_0x34c6('0x34')](function(_0xe03413){_0x2c2442=_0xe03413;return getCall(_0x1de848,_0x3db942,_0x311096,_0x475ade,_0x2c2442,_0x17dafd,_0x2739aa,_0x34c6('0x75'));})[_0x34c6('0x34')](function(_0x4b71fb){if(_0x4b71fb){logger[_0x34c6('0x3b')](_0x34c6('0x89'),_0x4b71fb['id']);}})[_0x34c6('0x2b')](function(_0x3b80ac){logger[_0x34c6('0x2c')]('['+_0x2739aa[_0x34c6('0x6a')][_0x34c6('0x96')]()+']',JSON['stringify'](_0x3b80ac));});}; \ No newline at end of file +var _0x0737=['split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','email','Agent\x20found!','profile','name','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','moduleCreate','contact','nothing','lead','Leads','Creating\x20new\x20call...','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','startCase','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','/api/voice/recordings/','destcalleridname','Outbound','[OUTBOUND]','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','../../../../config/environment','redis','localhost','emit','debug','[HTTP]','stringify','length','includes','string','idField','content','toString','type','variable','variableName','Variable','toLowerCase'];(function(_0x225915,_0x2eaa2f){var _0x3b8d10=function(_0x4c9dd5){while(--_0x4c9dd5){_0x225915['push'](_0x225915['shift']());}};_0x3b8d10(++_0x2eaa2f);}(_0x0737,0x116));var _0x7073=function(_0x60dc78,_0x371ada){_0x60dc78=_0x60dc78-0x0;var _0x39b56b=_0x0737[_0x60dc78];return _0x39b56b;};'use strict';var _=require(_0x7073('0x0'));var rp=require(_0x7073('0x1'));var md5=require(_0x7073('0x2'));var util=require(_0x7073('0x3'));var intUtil=require(_0x7073('0x4'));var moment=require('moment');var Redis=require(_0x7073('0x5'));var BPromise=require('bluebird');var config=require(_0x7073('0x6'));var logger=require('../../../../config/logger')('zoho');config[_0x7073('0x7')]=_['defaults'](config['redis'],{'host':_0x7073('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3161cc,_0x589b08,_0x1a5f71){io['to'](_0x3161cc)[_0x7073('0x9')](_0x589b08,_0x1a5f71);}function request(_0x1d4323){logger[_0x7073('0xa')](_0x7073('0xb'),JSON[_0x7073('0xc')](_0x1d4323));return rp(_0x1d4323);}function getCustomFields(_0x36574d,_0x498b65){var _0x5b5e13={};if(_0x36574d[_0x7073('0xd')]>0x0){_['forEach'](_0x36574d,function(_0xf14e75){if(_[_0x7073('0xe')]([_0x7073('0xf'),'picklist'],_0xf14e75['type'])&&_0xf14e75[_0x7073('0x10')]){_0x5b5e13[_0xf14e75['idField']]=_0xf14e75[_0x7073('0x11')][_0x7073('0x12')]();}else if(_0xf14e75[_0x7073('0x13')]===_0x7073('0x14')&&_0xf14e75['variableName']&&_0xf14e75[_0x7073('0x10')]&&_0x498b65[_0xf14e75[_0x7073('0x15')]]){_0x5b5e13[_0xf14e75[_0x7073('0x10')]]=_0x498b65[_0xf14e75[_0x7073('0x15')]][_0x7073('0x12')]();}else if(_0xf14e75['type']==='customVariable'&&_0xf14e75[_0x7073('0x16')]&&_0xf14e75[_0x7073('0x16')]['name']&&_0xf14e75[_0x7073('0x10')]&&_0x498b65[_0xf14e75['Variable']['name'][_0x7073('0x17')]()]){_0x5b5e13[_0xf14e75['idField']]=_0x498b65[_0xf14e75['Variable']['name'][_0x7073('0x17')]()]['toString']();}});}return _0x5b5e13;}function getName(_0x21551c){if(_0x21551c['indexOf']('\x20')>0x0){var _0x4e0aae=_0x21551c[_0x7073('0x18')](/ (.+)/);if(_0x4e0aae[0x1]){return _0x4e0aae;}}return[_0x21551c,_0x21551c];}var accountsTokens={};function getAccessToken(_0x6af429){return new Promise(function(_0x34f13e,_0x25b491){if(!_[_0x7073('0x19')](accountsTokens[_0x6af429['id']])&&!_[_0x7073('0x19')](accountsTokens[_0x6af429['id']][_0x7073('0x1a')])){if(moment()[_0x7073('0x1b')](accountsTokens[_0x6af429['id']][_0x7073('0x1c')])){_0x34f13e(accountsTokens[_0x6af429['id']][_0x7073('0x1a')]);}}var _0x225632;switch(_0x6af429[_0x7073('0x1d')]){case'US':_0x225632=_0x7073('0x1e');break;case'AU':_0x225632=_0x7073('0x1f');break;case'EU':_0x225632=_0x7073('0x20');break;case'IN':_0x225632=_0x7073('0x21');break;case'CN':_0x225632=_0x7073('0x22');break;default:_0x225632=_0x7073('0x20');break;}var _0x116885={'method':_0x7073('0x23'),'uri':_0x225632+_0x7073('0x24'),'qs':{'refresh_token':_0x6af429[_0x7073('0x25')],'client_id':_0x6af429[_0x7073('0x26')],'client_secret':_0x6af429['clientSecret'],'grant_type':_0x7073('0x27')},'json':!![]};return rp(_0x116885)[_0x7073('0x28')](function(_0x486e88){accountsTokens[_0x6af429['id']]={'access_token':_0x486e88[_0x7073('0x1a')],'expires_in':moment()[_0x7073('0x29')](_0x486e88[_0x7073('0x1c')],'seconds')};_0x34f13e(_0x486e88['access_token']);})[_0x7073('0x2a')](function(_0xeab550){logger[_0x7073('0x2b')](_0x7073('0x2c'),_0xeab550['stack']);_0x25b491(_0xeab550);});});}function getUser(_0x230b07,_0x2f770b,_0x2442ca,_0x31116a){logger[_0x7073('0x2d')](_0x7073('0x2e'));return request({'method':_0x7073('0x2f'),'uri':util[_0x7073('0x30')](_0x7073('0x31'),_0x2f770b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x7073('0x32')+_0x230b07},'json':!![]})[_0x7073('0x28')](function(_0x12ce6b){if(_0x12ce6b['users']){var _0x3325a2=-0x1;if(_['isArrayLikeObject'](_0x12ce6b[_0x7073('0x33')])){if(!_[_0x7073('0x19')](_0x31116a)){_0x3325a2=_['findIndex'](_0x12ce6b[_0x7073('0x33')],function(_0x4ebcb2){return _0x4ebcb2[_0x7073('0x34')]===_0x31116a;});}if(_0x3325a2>=0x0){logger[_0x7073('0x2d')](_0x7073('0x35'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x3325a2=_['findIndex'](_0x12ce6b['users'],function(_0x448c78){return _0x448c78[_0x7073('0x36')][_0x7073('0x37')]==='Administrator';});}return _0x12ce6b[_0x7073('0x33')][_0x3325a2];}else{if(_0x12ce6b['user'][_0x7073('0x36')]['name']===_0x7073('0x38')){logger[_0x7073('0x2d')]('Using\x20the\x20admin\x20account!');user=_0x12ce6b[_0x7073('0x39')];return user;}else{logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](_0x12ce6b));throw new Error(_0x7073('0x3b')+JSON['stringify'](_0x12ce6b));}}}else{logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](_0x12ce6b));throw new Error(_0x7073('0x3b')+JSON[_0x7073('0xc')](_0x12ce6b));}})[_0x7073('0x2a')](function(_0x196f9c){console[_0x7073('0x2b')](_0x196f9c);});}function getZohoUser(_0x3675a5,_0xe66a4b){return new BPromise(function(_0x312455,_0xbba8a8){request(_0x3675a5)['then'](function(_0x3096c1){var _0x57a990=null;if(_0x3096c1){_0x57a990=_0x3096c1[_0x7073('0x3c')][0x0];_0x57a990[_0x7073('0x3d')]=_0xe66a4b;}_0x312455(_0x57a990);})[_0x7073('0x2a')](function(_0x3ebc33){_0xbba8a8(_0x3ebc33);});});}function createEndUser(_0x1284c9,_0x32df14,_0x3927cb,_0x357f45,_0x1fd39a,_0x222905){var _0x3927cb=getName(_0x3927cb);return request({'method':'POST','uri':_0x7073('0x3e')+_0x32df14+_0x7073('0x3f')+_['startCase'](_0x222905['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3927cb[0x1],'First_Name':_0x3927cb[0x0],'Phone':_0x357f45,'Owner':{'name':!_[_0x7073('0x19')](_0x1fd39a[_0x7073('0x40')][_0x7073('0x37')])?_0x1fd39a[_0x7073('0x40')][_0x7073('0x37')]:!_[_0x7073('0x19')](_0x1fd39a[_0x7073('0x41')])?_0x1fd39a['first_name']+'\x20'+_0x1fd39a['last_name']:_0x1fd39a[_0x7073('0x42')],'id':_0x1fd39a['id']}}]},'headers':{'Authorization':_0x7073('0x32')+_0x1284c9},'json':!![]})[_0x7073('0x28')](function(_0x90d659){if(_0x90d659&&_0x90d659[_0x7073('0x3c')][0x0][_0x7073('0x43')]==='SUCCESS'){var _0x129cda=_0x90d659[_0x7073('0x3c')][0x0][_0x7073('0x44')];_0x129cda['enduserType']=_['startCase'](_0x222905['moduleCreate'])+'s';return _0x129cda;}logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](data));throw new Error(_0x7073('0x45')+JSON['stringify'](data));})[_0x7073('0x2a')](function(_0x5f13e9){console[_0x7073('0x46')](_0x7073('0x47'),_0x5f13e9);});}function getEndUser(_0x203018,_0x8b8053,_0x57b7be,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2){var _0x99dbde={'method':'GET','uri':'','headers':{'Authorization':_0x7073('0x32')+_0x203018},'json':!![]};switch(_0x43c9c2[_0x7073('0x48')]){case _0x7073('0x49'):_0x99dbde[_0x7073('0x4a')]=_0x7073('0x3e')+_0x8b8053+_0x7073('0x4b')+_0x517b84+'))';return getZohoUser(_0x99dbde,_0x7073('0x4c'))['then'](function(_0x49c99d){if(_0x49c99d)return _0x49c99d;_0x99dbde['uri']=_0x7073('0x3e')+_0x8b8053+_0x7073('0x4d')+_0x517b84+'))';return getZohoUser(_0x99dbde,'Leads')[_0x7073('0x28')](function(_0x2fa7cb){if(_0x2fa7cb)return _0x2fa7cb;if(_0x43c9c2[_0x7073('0x4e')]!='nothing'){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});});break;case _0x7073('0x4f'):_0x99dbde[_0x7073('0x4a')]=_0x7073('0x3e')+_0x8b8053+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x517b84+'))';return getZohoUser(_0x99dbde,'Contacts')[_0x7073('0x28')](function(_0x43d03f){if(_0x43d03f)return _0x43d03f;if(_0x43c9c2[_0x7073('0x4e')]!=_0x7073('0x50')){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});break;case _0x7073('0x51'):_0x99dbde[_0x7073('0x4a')]='https://www.zohoapis.'+_0x8b8053+_0x7073('0x4d')+_0x517b84+'))';return getZohoUser(_0x99dbde,_0x7073('0x52'))['then'](function(_0x27bb04){if(_0x27bb04)return _0x27bb04;if(_0x43c9c2[_0x7073('0x4e')]!=_0x7073('0x50')){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});break;}}function getCall(_0x3a8326,_0x447b44,_0x4472d1,_0x45fd24,_0x5d8afa,_0x157ad5,_0x4a0fdb,_0x371f14){logger[_0x7073('0x2d')](_0x7073('0x53'));var _0x302ec9={};_0x302ec9['Owner']={'name':!_['isNil'](_0x45fd24[_0x7073('0x40')][_0x7073('0x37')])&&!_[_0x7073('0x19')](_0x45fd24[_0x7073('0x36')]['name'])&&_0x45fd24['profile'][_0x7073('0x37')]==='administrator'?_0x45fd24['role']['name']:!_[_0x7073('0x19')](_0x45fd24['first_name'])?_0x45fd24[_0x7073('0x41')]+'\x20'+_0x45fd24[_0x7073('0x42')]:_0x45fd24[_0x7073('0x42')],'id':_0x45fd24['id']};_0x302ec9['Subject']=intUtil[_0x7073('0x54')](_0x157ad5[_0x7073('0x55')],_0x4a0fdb,'\x20');_0x302ec9[_0x7073('0x56')]=intUtil[_0x7073('0x54')](_0x157ad5[_0x7073('0x57')],_0x4a0fdb,'\x0a');if(_0x5d8afa[_0x7073('0x3d')]==='Contacts'){_0x302ec9[_0x7073('0x58')]={'name':!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x59')])?_0x5d8afa[_0x7073('0x59')]:!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x5a')])?_0x5d8afa[_0x7073('0x5a')]+'\x20'+_0x5d8afa[_0x7073('0x5b')]:_0x5d8afa[_0x7073('0x5b')],'id':_0x5d8afa['id']};}if(_0x5d8afa[_0x7073('0x3d')]===_0x7073('0x52')){_0x302ec9['What_Id']={'name':!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x59')])?_0x5d8afa['Full_Name']:!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x5a')])?_0x5d8afa[_0x7073('0x5a')]+'\x20'+_0x5d8afa['Last_Name']:_0x5d8afa[_0x7073('0x5b')],'id':_0x5d8afa['id']};_0x302ec9[_0x7073('0x5c')]=_[_0x7073('0x5d')](_0x5d8afa['enduserType']);}if(_0x4a0fdb[_0x7073('0x5e')]){_0x302ec9[_0x7073('0x5f')]=moment['utc'](parseInt(_0x4a0fdb[_0x7073('0x5e')])*0x3e8)[_0x7073('0x30')]('mm:ss');}else if(_0x4a0fdb[_0x7073('0x60')]&&_0x4a0fdb[_0x7073('0x61')]){_0x302ec9[_0x7073('0x5f')]=moment[_0x7073('0x62')](moment(_0x4a0fdb['endtime'],_0x7073('0x63'))[_0x7073('0x64')](moment(_0x4a0fdb[_0x7073('0x65')],_0x7073('0x63'))))[_0x7073('0x30')](_0x7073('0x66'));}switch(_0x4a0fdb[_0x7073('0x67')]){case _0x7073('0x68'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x6a');break;case'complete':case _0x7073('0x6b'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x6c');break;case _0x7073('0x6d'):_0x302ec9['Call_Result']=_0x7073('0x6e');break;case _0x7073('0x6f'):_0x302ec9['Call_Result']=_0x7073('0x70');break;case _0x7073('0x71'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x72');default:}_0x302ec9['Call_Start_Time']=(_0x371f14===_0x7073('0x73')?moment(_0x4a0fdb[_0x7073('0x65')])['format'](_0x7073('0x63')):moment(_0x4a0fdb[_0x7073('0x74')])[_0x7073('0x30')](_0x7073('0x63')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x302ec9[_0x7073('0x75')]=_0x371f14||_0x7073('0x76');_0x302ec9=_['merge'](_0x302ec9,getCustomFields(_0x157ad5[_0x7073('0x77')],_0x4a0fdb));return request({'method':_0x7073('0x23'),'uri':_0x7073('0x3e')+_0x447b44+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3a8326},'body':{'data':[_0x302ec9]},'json':!![]})[_0x7073('0x28')](function(_0x1e183d){if(_0x1e183d&&_0x1e183d[_0x7073('0x3c')][0x0][_0x7073('0x43')]==='SUCCESS'){logger['info'](_0x7073('0x78'));return{'id':_0x1e183d[_0x7073('0x3c')][0x0][_0x7073('0x44')]['id']};}})['catch'](function(_0x5ce921){logger[_0x7073('0x2d')]('err',_0x5ce921['stack']);console[_0x7073('0x46')](_0x7073('0x79'),_0x5ce921);});}exports[_0x7073('0x7a')]=function(_0xa17245,_0x4a8893,_0x4dfb6f,_0x5ab27e,_0x38ed3f,_0x4a913b){var _0x32df28,_0x196244,_0x4246c8;_0x4a913b[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x4a913b[_0x7073('0x7b')]);_0x4a913b['serverUrl']=intUtil[_0x7073('0x7c')](_0x4a913b[_0x7073('0x7d')]);if(_0x38ed3f&&_0x38ed3f['monitor_format']){logger['info']('[QUEUE]',_0x7073('0x7e'));_0x4a8893[_0x7073('0x7f')]=_0x4a913b[_0x7073('0x7d')]+'/api/voice/recordings/'+_0x4a8893[_0x7073('0x80')]+_0x7073('0x81')+md5(_0x4a8893[_0x7073('0x80')]);}else{_0x4a8893[_0x7073('0x7f')]='';}var _0x42f390=_0x4a913b[_0x7073('0x7b')]===_0x7073('0x82')?'eu':_0x7073('0x83');return getAccessToken(_0x4a913b)[_0x7073('0x28')](function(_0x1c130c){_0x4246c8=_0x1c130c;return getUser(_0x4246c8,_0x42f390,_0x4a913b,_0x5ab27e['email']);})[_0x7073('0x28')](function(_0x12bc8e){_0x32df28=_0x12bc8e;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x32df28['id']);return getEndUser(_0x4246c8,_0x42f390,_0x4a913b,_0x4a8893[_0x7073('0x85')],_0x4a8893[_0x7073('0x86')],_0x32df28,_0x4dfb6f);})[_0x7073('0x28')](function(_0x595868){_0x196244=_0x595868;return getCall(_0x4246c8,_0x42f390,_0x4a913b,_0x32df28,_0x196244,_0x4dfb6f,_0x4a8893,_0x7073('0x76'));})[_0x7073('0x28')](function(_0x463c6e){if(_0x463c6e){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x463c6e['id']);logger[_0x7073('0x2d')](_0x7073('0x88'),_0x7073('0x89'));emit(util[_0x7073('0x30')](_0x7073('0x8a'),_0x5ab27e[_0x7073('0x37')]),_0x7073('0x8b'),{'uri':_0x7073('0x8c')+_0x4a913b[_0x7073('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x463c6e['id']});}})[_0x7073('0x2a')](function(_0x506028){logger[_0x7073('0x2b')](_0x7073('0x88'),JSON[_0x7073('0xc')](_0x506028));});};exports['outbound']=function(_0x4f6c20,_0x1d3871,_0x34ba7d,_0x3278af,_0x1b2c15,_0x1d3fdd,_0x18a08f){var _0x42fde6,_0x592a33,_0xd93281;_0x1d3fdd[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x1d3fdd[_0x7073('0x7b')]);_0x1d3fdd[_0x7073('0x7d')]=intUtil['stripTrailingSlash'](_0x1d3fdd['serverUrl']);if(_0x18a08f&&_0x18a08f[_0x7073('0x8d')]&&_0x18a08f['recordingFormat']!==_0x7073('0x8e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1d3871[_0x7073('0x7f')]=_0x1d3fdd[_0x7073('0x7d')]+_0x7073('0x8f')+_0x1d3871[_0x7073('0x80')]+_0x7073('0x81')+md5(_0x1d3871[_0x7073('0x80')]);}var _0x589ab4=_0x1d3fdd['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x1d3fdd)[_0x7073('0x28')](function(_0x3b8d17){_0xd93281=_0x3b8d17;return getUser(_0xd93281,_0x589ab4,_0x1d3fdd,_0x3278af['email']);})['then'](function(_0x13871d){_0x42fde6=_0x13871d;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x42fde6['id']);return getEndUser(_0xd93281,_0x589ab4,_0x1d3fdd,_0x1d3871[_0x7073('0x90')],_0x1d3871['destcalleridnum'],_0x42fde6,_0x34ba7d);})[_0x7073('0x28')](function(_0x151b44){_0x592a33=_0x151b44;return getCall(_0xd93281,_0x589ab4,_0x1d3fdd,_0x42fde6,_0x592a33,_0x34ba7d,_0x1d3871,_0x7073('0x91'));})[_0x7073('0x28')](function(_0x5e2215){if(_0x5e2215){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x5e2215['id']);logger[_0x7073('0x2d')](_0x7073('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7073('0x30')](_0x7073('0x8a'),_0x3278af[_0x7073('0x37')]),_0x7073('0x8b'),{'uri':_0x7073('0x8c')+_0x1d3fdd['host']+_0x7073('0x93')+_0x5e2215['id']});}})[_0x7073('0x2a')](function(_0x1c336d){logger['error']('[OUTBOUND]',JSON[_0x7073('0xc')](_0x1c336d));});};exports[_0x7073('0x94')]=function(_0x29af29,_0x40095f,_0x31e7d3,_0x53d4d1,_0x2115a1,_0x246818){var _0x2d397e,_0x15d060,_0x41f223;_0x246818[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x246818['host']);_0x246818[_0x7073('0x7d')]=intUtil['stripTrailingSlash'](_0x246818[_0x7073('0x7d')]);if(_0x2115a1&&_0x2115a1[_0x7073('0x95')]){logger['info']('['+_0x40095f[_0x7073('0x67')][_0x7073('0x96')]()+']','Recording\x20is\x20enabled!');_0x40095f[_0x7073('0x7f')]=_0x246818[_0x7073('0x7d')]+'/api/voice/recordings/'+_0x40095f['uniqueid']+_0x7073('0x81')+md5(_0x40095f['uniqueid']);}else{_0x40095f[_0x7073('0x7f')]='';}var _0x3fb1ec=_0x246818[_0x7073('0x7b')]===_0x7073('0x82')?'eu':'com';return getAccessToken(_0x246818)[_0x7073('0x28')](function(_0x437e81){_0x41f223=_0x437e81;return getUser(_0x41f223,_0x3fb1ec,_0x246818);})[_0x7073('0x28')](function(_0x38eee8){_0x2d397e=_0x38eee8;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x2d397e['id']);return getEndUser(_0x41f223,_0x3fb1ec,_0x246818,_0x40095f[_0x7073('0x85')],_0x40095f[_0x7073('0x86')],_0x2d397e,_0x31e7d3);})['then'](function(_0x156eaa){_0x15d060=_0x156eaa;return getCall(_0x41f223,_0x3fb1ec,_0x246818,_0x2d397e,_0x15d060,_0x31e7d3,_0x40095f,'Inbound');})[_0x7073('0x28')](function(_0x1867c4){if(_0x1867c4){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x1867c4['id']);}})[_0x7073('0x2a')](function(_0x198981){logger['error']('['+_0x40095f[_0x7073('0x67')][_0x7073('0x96')]()+']',JSON[_0x7073('0xc')](_0x198981));});}; \ 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 15cf645..f2d6950 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 _0xa78d=['format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0xa0f9e1,_0x409b3d){var _0x432ee9=function(_0x1b28f9){while(--_0x1b28f9){_0xa0f9e1['push'](_0xa0f9e1['shift']());}};_0x432ee9(++_0x409b3d);}(_0xa78d,0xd3));var _0xda78=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xa78d[_0x22b68a];return _0x1ac67a;};'use strict';var util=require(_0xda78('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xda78('0x1'))(_0xda78('0x2'));exports[_0xda78('0x3')]=function(_0x5d1319,_0x1598ce){var _0x31cbf4=_0x5d1319[_0xda78('0x4')]?_0x5d1319[_0xda78('0x4')]:_0xda78('0x5');var _0x1bcb5c=_0x5d1319['data3']?Mustache['render'](_0x5d1319[_0xda78('0x6')],_0x1598ce):_0x1598ce;sh[_0xda78('0x3')](_0x1bcb5c,function(_0x24924e,_0x5c3e2b,_0x36318d){if(_0x24924e!==0x0){logger['error'](util['format'](_0xda78('0x7'),_0x31cbf4,_0x1bcb5c,_0x24924e,_0x36318d));}else{logger[_0xda78('0x8')](util[_0xda78('0x9')](_0xda78('0xa'),_0x31cbf4,_0x1bcb5c,_0x5c3e2b));}});}; \ No newline at end of file +var _0xe06e=['format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3','render','exec','error'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe06e,0xd5));var _0xee06=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xe06e[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require(_0xee06('0x0'));var sh=require(_0xee06('0x1'));var Mustache=require(_0xee06('0x2'));var logger=require(_0xee06('0x3'))(_0xee06('0x4'));exports['exec']=function(_0x3d5a11,_0x29e3aa){var _0xe277a0=_0x3d5a11[_0xee06('0x5')]?_0x3d5a11[_0xee06('0x5')]:_0xee06('0x6');var _0x3cc268=_0x3d5a11[_0xee06('0x7')]?Mustache[_0xee06('0x8')](_0x3d5a11[_0xee06('0x7')],_0x29e3aa):_0x29e3aa;sh[_0xee06('0x9')](_0x3cc268,function(_0x366467,_0x3271a7,_0x382661){if(_0x366467!==0x0){logger[_0xee06('0xa')](util[_0xee06('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xe277a0,_0x3cc268,_0x366467,_0x382661));}else{logger[_0xee06('0xc')](util['format'](_0xee06('0xd'),_0xe277a0,_0x3cc268,_0x3271a7));}});}; \ 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 6812d67..af76231 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 _0x9bc4=['stack','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','info','data2','statusCode','catch','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','number','data5','headers','data6','render','error','GET','POST','PUT','data7','parse','body'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9bc4,0x14b));var _0x49bc=function(_0xf5cdac,_0x1648fd){_0xf5cdac=_0xf5cdac-0x0;var _0x4a23f1=_0x9bc4[_0xf5cdac];return _0x4a23f1;};'use strict';var rp=require(_0x49bc('0x0'));var util=require(_0x49bc('0x1'));var _=require(_0x49bc('0x2'));var Mustache=require(_0x49bc('0x3'));var logger=require(_0x49bc('0x4'))(_0x49bc('0x5'));exports[_0x49bc('0x6')]=function(_0x1ab011,_0x32a8e5){var _0x5b1f36,_0x167b26;var _0x591fff={'method':_0x1ab011[_0x49bc('0x7')][_0x49bc('0x8')](),'uri':Mustache['render'](_0x1ab011['data2'],_0x32a8e5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1ab011['data5'])===_0x49bc('0x9')&&parseInt(_0x1ab011[_0x49bc('0xa')])>=0x1&&parseInt(_0x1ab011[_0x49bc('0xa')])<=0xa?parseInt(_0x1ab011['data5'])*0x3e8:0x5*0x3e8};try{_0x591fff[_0x49bc('0xb')]=_0x1ab011[_0x49bc('0xc')]?JSON['parse'](Mustache[_0x49bc('0xd')](_0x1ab011['data6'],_0x32a8e5)):{};}catch(_0x7a8148){logger[_0x49bc('0xe')](_0x7a8148['stack']);}switch(_0x1ab011[_0x49bc('0x7')][_0x49bc('0x8')]()){case _0x49bc('0xf'):case'DELETE':_0x5b1f36=null;_0x591fff['qs']=_0x32a8e5;break;case _0x49bc('0x10'):case _0x49bc('0x11'):if(_0x1ab011[_0x49bc('0x12')]){try{_0x5b1f36=JSON[_0x49bc('0x13')](Mustache[_0x49bc('0xd')](_0x1ab011[_0x49bc('0x12')],_0x32a8e5));_0x591fff[_0x49bc('0x14')]=_0x5b1f36;}catch(_0x4fe797){logger[_0x49bc('0xe')](_0x4fe797[_0x49bc('0x15')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5b1f36=_0x32a8e5;_0x591fff[_0x49bc('0x14')]=_0x5b1f36;}break;}logger['info'](util[_0x49bc('0x16')](_0x49bc('0x17'),_0x1ab011[_0x49bc('0x7')],_0x1ab011['data2'],JSON[_0x49bc('0x18')](_0x591fff)));rp(_0x591fff)['then'](function(_0x383afe){_0x5b1f36=!_[_0x49bc('0x19')](_0x5b1f36)?_0x49bc('0x1a')+_0x5b1f36:'';_0x167b26=typeof _0x383afe[_0x49bc('0x14')]==='object'?JSON['stringify'](_0x383afe[_0x49bc('0x14')]):_0x383afe['body'];logger[_0x49bc('0x1b')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x1ab011['data1'],_0x1ab011[_0x49bc('0x1c')],_0x383afe[_0x49bc('0x1d')],_0x167b26));})[_0x49bc('0x1e')](function(_0x28a3ad){logger['error'](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1ab011[_0x49bc('0x7')],_0x1ab011['data2'],_0x28a3ad[_0x49bc('0x1d')],_0x28a3ad['name'],_0x28a3ad[_0x49bc('0x1f')]));});}; \ No newline at end of file +var _0xf62d=[',\x20request\x20body:\x20','object','statusCode','catch','name','message','request-promise','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xf62d,0x17c));var _0xdf62=function(_0x3dbdf3,_0x24618e){_0x3dbdf3=_0x3dbdf3-0x0;var _0x3ed9a8=_0xf62d[_0x3dbdf3];return _0x3ed9a8;};'use strict';var rp=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var _=require(_0xdf62('0x2'));var Mustache=require('mustache');var logger=require(_0xdf62('0x3'))(_0xdf62('0x4'));exports['exec']=function(_0x4baa0c,_0x1b7334){var _0x2ff1c5,_0x3e4469;var _0x4cb43b={'method':_0x4baa0c[_0xdf62('0x5')][_0xdf62('0x6')](),'uri':Mustache[_0xdf62('0x7')](_0x4baa0c[_0xdf62('0x8')],_0x1b7334),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4baa0c[_0xdf62('0x9')])===_0xdf62('0xa')&&parseInt(_0x4baa0c[_0xdf62('0x9')])>=0x1&&parseInt(_0x4baa0c['data5'])<=0xa?parseInt(_0x4baa0c['data5'])*0x3e8:0x5*0x3e8};try{_0x4cb43b[_0xdf62('0xb')]=_0x4baa0c[_0xdf62('0xc')]?JSON[_0xdf62('0xd')](Mustache[_0xdf62('0x7')](_0x4baa0c[_0xdf62('0xc')],_0x1b7334)):{};}catch(_0x2a75d9){logger[_0xdf62('0xe')](_0x2a75d9[_0xdf62('0xf')]);}switch(_0x4baa0c[_0xdf62('0x5')]['toUpperCase']()){case _0xdf62('0x10'):case _0xdf62('0x11'):_0x2ff1c5=null;_0x4cb43b['qs']=_0x1b7334;break;case _0xdf62('0x12'):case'PUT':if(_0x4baa0c['data7']){try{_0x2ff1c5=JSON[_0xdf62('0xd')](Mustache['render'](_0x4baa0c[_0xdf62('0x13')],_0x1b7334));_0x4cb43b['body']=_0x2ff1c5;}catch(_0x20aa48){logger[_0xdf62('0xe')](_0x20aa48[_0xdf62('0xf')]);logger['error'](_0xdf62('0x14'));}}else{_0x2ff1c5=_0x1b7334;_0x4cb43b[_0xdf62('0x15')]=_0x2ff1c5;}break;}logger[_0xdf62('0x16')](util[_0xdf62('0x17')](_0xdf62('0x18'),_0x4baa0c[_0xdf62('0x5')],_0x4baa0c[_0xdf62('0x8')],JSON[_0xdf62('0x19')](_0x4cb43b)));rp(_0x4cb43b)[_0xdf62('0x1a')](function(_0x2274f1){_0x2ff1c5=!_[_0xdf62('0x1b')](_0x2ff1c5)?_0xdf62('0x1c')+_0x2ff1c5:'';_0x3e4469=typeof _0x2274f1[_0xdf62('0x15')]===_0xdf62('0x1d')?JSON[_0xdf62('0x19')](_0x2274f1[_0xdf62('0x15')]):_0x2274f1[_0xdf62('0x15')];logger['info'](util[_0xdf62('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4baa0c[_0xdf62('0x5')],_0x4baa0c[_0xdf62('0x8')],_0x2274f1[_0xdf62('0x1e')],_0x3e4469));})[_0xdf62('0x1f')](function(_0xdd9a61){logger[_0xdf62('0xe')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x4baa0c['data1'],_0x4baa0c[_0xdf62('0x8')],_0xdd9a61[_0xdf62('0x1e')],_0xdd9a61[_0xdf62('0x20')],_0xdd9a61[_0xdf62('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b6f4b14..985d5be 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 _0xf4ff=['routing','client','http','Request','then','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf4ff,0x135));var _0xff4f=function(_0x4d0f7b,_0x3b9981){_0x4d0f7b=_0x4d0f7b-0x0;var _0x37ed34=_0xf4ff[_0x4d0f7b];return _0x37ed34;};'use strict';var jayson=require(_0xff4f('0x0'));var BPromise=require(_0xff4f('0x1'));var logger=require(_0xff4f('0x2'))(_0xff4f('0x3'));var client=jayson[_0xff4f('0x4')][_0xff4f('0x5')]({'port':0x2329});client[_0xff4f('0x6')]=function(_0x2315d2,_0x443f99){return new BPromise(function(_0x12f8ba,_0xea7135){return client['request'](_0x2315d2,_0x443f99)[_0xff4f('0x7')](function(_0x5e7a42){logger['debug'](_0xff4f('0x8'),_0xff4f('0x3'),_0x2315d2,_0x443f99,_0x5e7a42);if(_0x5e7a42[_0xff4f('0x9')]){logger[_0xff4f('0x9')](_0xff4f('0x8'),_0xff4f('0x3'),_0x2315d2,_0x5e7a42[_0xff4f('0x9')][_0xff4f('0xa')],_0x443f99);return _0xea7135(_0x5e7a42[_0xff4f('0x9')]['message']);}else{return _0x12f8ba(_0x5e7a42[_0xff4f('0xb')]);}})['catch'](function(_0x513b73){logger[_0xff4f('0x9')]('rpc',_0xff4f('0x3'),_0x2315d2,_0x513b73,_0x443f99);return _0xea7135(_0x513b73);});});};module[_0xff4f('0xc')]=client; \ No newline at end of file +var _0x6f77=['Request','request','then','debug','rpc','error','routing','message','result','bluebird','../../config/logger','http'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0x6f77,0x189));var _0x76f7=function(_0x3746fe,_0x30b6b0){_0x3746fe=_0x3746fe-0x0;var _0xb3093d=_0x6f77[_0x3746fe];return _0xb3093d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x76f7('0x0'));var logger=require(_0x76f7('0x1'))('routing');var client=jayson['client'][_0x76f7('0x2')]({'port':0x2329});client[_0x76f7('0x3')]=function(_0x2acc6d,_0x4f8962){return new BPromise(function(_0x3ec5ca,_0x3451d7){return client[_0x76f7('0x4')](_0x2acc6d,_0x4f8962)[_0x76f7('0x5')](function(_0x7169ac){logger[_0x76f7('0x6')](_0x76f7('0x7'),'routing',_0x2acc6d,_0x4f8962,_0x7169ac);if(_0x7169ac['error']){logger[_0x76f7('0x8')](_0x76f7('0x7'),_0x76f7('0x9'),_0x2acc6d,_0x7169ac['error'][_0x76f7('0xa')],_0x4f8962);return _0x3451d7(_0x7169ac[_0x76f7('0x8')][_0x76f7('0xa')]);}else{return _0x3ec5ca(_0x7169ac[_0x76f7('0xb')]);}})['catch'](function(_0x404aeb){logger[_0x76f7('0x8')](_0x76f7('0x7'),'routing',_0x2acc6d,_0x404aeb,_0x4f8962);return _0x3451d7(_0x404aeb);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 96b9d13..cc2d6cb 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 _0x1fb2=['./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x1fb2,0x1ef));var _0x21fb=function(_0x53d69d,_0x15cc2d){_0x53d69d=_0x53d69d-0x0;var _0x3aace8=_0x1fb2[_0x53d69d];return _0x3aace8;};'use strict';var server=require(_0x21fb('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x21fb('0x1'));var mailAccount=require(_0x21fb('0x2'));var setting=require(_0x21fb('0x3'));var logger=require(_0x21fb('0x4'))(_0x21fb('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x21fb('0x6')]()['then'](mailAccount['getMailAccounts']())[_0x21fb('0x7')](realtime[_0x21fb('0x8')]())[_0x21fb('0x7')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x21fb('0x9')](realtime,email)[_0x21fb('0x7')](function(){return initRealtime();})[_0x21fb('0x7')](function(){return setting[_0x21fb('0xa')]();})[_0x21fb('0x7')](function(_0x68cec6){return setInterval(initRealtime,_0x68cec6[_0x21fb('0xb')]*0x3e8);})[_0x21fb('0xc')](function(_0x479e11){logger[_0x21fb('0xd')](_0x21fb('0xe'),_0x479e11);});}main(); \ No newline at end of file +var _0x853f=['getMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then'];(function(_0x71f9ca,_0x326e46){var _0x16ac94=function(_0x4fbf07){while(--_0x4fbf07){_0x71f9ca['push'](_0x71f9ca['shift']());}};_0x16ac94(++_0x326e46);}(_0x853f,0x1cd));var _0xf853=function(_0x142434,_0x5e630d){_0x142434=_0x142434-0x0;var _0x2ca867=_0x853f[_0x142434];return _0x2ca867;};'use strict';var server=require(_0xf853('0x0'));var Realtime=require(_0xf853('0x1'));var EmailChannel=require(_0xf853('0x2'));var mailAccount=require(_0xf853('0x3'));var setting=require(_0xf853('0x4'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf853('0x5')]()[_0xf853('0x6')](mailAccount[_0xf853('0x7')]())[_0xf853('0x6')](realtime['initMailAccounts']())[_0xf853('0x6')](function(){email[_0xf853('0x8')](realtime[_0xf853('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf853('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xf853('0xa')]();})[_0xf853('0x6')](function(_0x2271ec){return setInterval(initRealtime,_0x2271ec[_0xf853('0xb')]*0x3e8);})['catch'](function(_0x4b9678){logger[_0xf853('0xc')]('Email\x20service\x20initialization',_0x4b9678);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a881e03..9a95e26 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 _0xb758=['Smtp','verify','verified','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','md5','service','provider','custom','hasOwnProperty','email','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','messageStatus','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp'];(function(_0x1889b0,_0x21be93){var _0x238187=function(_0x53671a){while(--_0x53671a){_0x1889b0['push'](_0x1889b0['shift']());}};_0x238187(++_0x21be93);}(_0xb758,0x1dc));var _0x8b75=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xb758[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x8b75('0x0'));var moment=require(_0x8b75('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x8b75('0x2'));var config=require(_0x8b75('0x3'));var logger=require(_0x8b75('0x4'))('email');config[_0x8b75('0x5')]=_[_0x8b75('0x6')](config['redis'],{'host':_0x8b75('0x7'),'port':0x18eb});var io=require(_0x8b75('0x8'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x8b75('0x9'));var mailAccount=require(_0x8b75('0xa'));var md5Accounts={};function EmailChannel(_0x1d7a7a){logger['info'](_0x8b75('0xb'));this[_0x8b75('0xc')]=_0x1d7a7a[_0x8b75('0xc')];this[_0x8b75('0xd')]={};this[_0x8b75('0xe')]=new EmailSmtp();}EmailChannel[_0x8b75('0xf')][_0x8b75('0x10')]=function(_0x11a305){var _0x1047be=this[_0x8b75('0xc')][_0x11a305];var _0x5f526a={'id':_0x1047be['id'],'name':_0x1047be[_0x8b75('0x11')],'key':_0x1047be[_0x8b75('0x12')],'active':_0x1047be[_0x8b75('0x13')],'Imap':{'status':_0x1047be[_0x8b75('0x14')][_0x8b75('0x15')],'messageStatus':_0x1047be[_0x8b75('0x14')]['messageStatus'],'total':_0x1047be[_0x8b75('0x14')][_0x8b75('0x16')]}};if(_[_0x8b75('0x17')](md5Accounts[_0x11a305])){md5Accounts[_0x11a305]={};}var _0x584220=md5(JSON['stringify'](_0x5f526a));if(md5Accounts[_0x11a305][_0x8b75('0x18')]!==_0x584220){md5Accounts[_0x11a305]['md5']=_0x584220;io[_0x8b75('0x10')]('mailAccount:update',_0x5f526a);}};EmailChannel[_0x8b75('0xf')]['refresh']=function(_0x2e39f8){for(var _0x2b3f00 in _0x2e39f8){if(_0x2e39f8['hasOwnProperty'](_0x2b3f00)){if(_0x2e39f8[_0x2b3f00][_0x8b75('0x14')]&&_0x2e39f8[_0x2b3f00]['active']){var _0x578cab=_0x2e39f8[_0x2b3f00]['Imap'];if(!_0x578cab[_0x8b75('0x19')]&&_0x2e39f8[_0x2b3f00][_0x8b75('0x1a')]!==_0x8b75('0x1b'))_0x578cab[_0x8b75('0x19')]=_0x2e39f8[_0x2b3f00][_0x8b75('0x1a')];if(!this[_0x8b75('0xd')][_0x8b75('0x1c')](_0x578cab['id'])){this[_0x8b75('0xd')][_0x578cab['id']]=new EmailImap(_0x578cab,_0x2e39f8[_0x2b3f00][_0x8b75('0x1d')]);this['imapAccounts'][_0x578cab['id']]['on'](_0x8b75('0x1e'),this[_0x8b75('0x1f')][_0x8b75('0x20')](this,_0x2b3f00));this[_0x8b75('0xd')][_0x578cab['id']]['on'](_0x8b75('0x1d'),this['handleImapEmail'][_0x8b75('0x20')](this,_0x2b3f00));this[_0x8b75('0xd')][_0x578cab['id']]['on'](_0x8b75('0x21'),this[_0x8b75('0x22')][_0x8b75('0x20')](this,_0x2b3f00));this[_0x8b75('0xd')][_0x578cab['id']]['on'](_0x8b75('0x23'),this[_0x8b75('0x24')][_0x8b75('0x20')](this,_0x2b3f00));}}else{if(_[_0x8b75('0x17')](this[_0x8b75('0xc')][_0x2b3f00][_0x8b75('0x14')])){this['mailAccounts'][_0x2b3f00][_0x8b75('0x14')]={};}this[_0x8b75('0xc')][_0x2b3f00][_0x8b75('0x14')][_0x8b75('0x15')]='disabled';this[_0x8b75('0xc')][_0x2b3f00][_0x8b75('0x14')][_0x8b75('0x25')]='';this[_0x8b75('0x10')](_0x2b3f00);}}}};EmailChannel['prototype'][_0x8b75('0x1f')]=function(_0x3cb5c2,_0x2c8ef5){if(this[_0x8b75('0xc')][_0x3cb5c2]){this[_0x8b75('0xc')][_0x3cb5c2][_0x8b75('0x14')][_0x8b75('0x15')]=_0x8b75('0x26');this[_0x8b75('0xc')][_0x3cb5c2]['Imap'][_0x8b75('0x25')]=_0x2c8ef5[_0x8b75('0x11')];if(_0x2c8ef5[_0x8b75('0x27')]){this[_0x8b75('0xc')][_0x3cb5c2]['Imap'][_0x8b75('0x16')]=_0x2c8ef5['messages'][_0x8b75('0x16')];}return this[_0x8b75('0x10')](_0x3cb5c2);}};EmailChannel[_0x8b75('0xf')]['handleImapEmail']=function(_0x1cd94d,_0x28a431){logger[_0x8b75('0x28')](_0x8b75('0x29'),_0x28a431[_0x8b75('0x2a')],_0x28a431[_0x8b75('0x2b')],_0x28a431[_0x8b75('0x2c')],_0x1cd94d);if(this[_0x8b75('0xc')][_0x1cd94d]){return mailAccount[_0x8b75('0x2d')](_0x1cd94d,_0x28a431)[_0x8b75('0x2e')](function(_0x10de45){if(_0x10de45){logger['info'](_0x8b75('0x2f'));}})[_0x8b75('0x30')](function(_0x98426a){logger['error'](_0x8b75('0x31'),JSON[_0x8b75('0x32')](_0x98426a));});}};EmailChannel[_0x8b75('0xf')][_0x8b75('0x22')]=function(_0x5efaf1){if(this[_0x8b75('0xc')][_0x5efaf1]&&this['mailAccounts'][_0x5efaf1][_0x8b75('0x14')]){if(this[_0x8b75('0xd')][this[_0x8b75('0xc')][_0x5efaf1][_0x8b75('0x14')]['id']]){delete this[_0x8b75('0xd')][this[_0x8b75('0xc')][_0x5efaf1][_0x8b75('0x14')]['id']];}this[_0x8b75('0xc')][_0x5efaf1][_0x8b75('0x14')][_0x8b75('0x33')]=moment();this['emit'](_0x5efaf1);}};EmailChannel[_0x8b75('0xf')][_0x8b75('0x24')]=function(_0x156de4,_0x6e680f){if(this['mailAccounts'][_0x156de4]){this[_0x8b75('0xc')][_0x156de4][_0x8b75('0x14')][_0x8b75('0x15')]=_0x8b75('0x23');this[_0x8b75('0xc')][_0x156de4]['Imap'][_0x8b75('0x25')]=_0x6e680f;return this[_0x8b75('0x10')](_0x156de4);}};EmailChannel['prototype'][_0x8b75('0x34')]=function(_0x3174d0,_0x1d1e87){return this['smtp'][_0x8b75('0x35')](_0x3174d0,_0x1d1e87);};EmailChannel[_0x8b75('0xf')][_0x8b75('0x36')]=function(_0x1ab251){var _0x37beb5=this;if(this[_0x8b75('0xc')][_0x1ab251['id']]){if(_[_0x8b75('0x17')](this[_0x8b75('0xc')][_0x1ab251['id']][_0x8b75('0x37')])){this['mailAccounts'][_0x1ab251['id']][_0x8b75('0x37')]={};}this[_0x8b75('0xc')][_0x1ab251['id']][_0x8b75('0x37')]['lastSync']=moment();return new BPromise(function(_0x50d59d,_0x5d16c3){return _0x37beb5['smtp'][_0x8b75('0x38')](_0x1ab251)[_0x8b75('0x2e')](function(_0x4a8017){_0x37beb5[_0x8b75('0xc')][_0x1ab251['id']][_0x8b75('0x37')][_0x8b75('0x15')]=_0x8b75('0x39');_0x37beb5[_0x8b75('0xc')][_0x1ab251['id']][_0x8b75('0x37')][_0x8b75('0x25')]='';_0x37beb5[_0x8b75('0x10')](_0x1ab251['id']);_0x50d59d(_0x4a8017);})['catch'](function(_0x212e68){_0x37beb5[_0x8b75('0xc')][_0x1ab251['id']]['Smtp']['status']=_0x8b75('0x23');_0x37beb5[_0x8b75('0xc')][_0x1ab251['id']][_0x8b75('0x37')]['messageStatus']=_0x212e68;_0x37beb5['emit'](_0x1ab251['id']);_0x5d16c3(_0x212e68);});});}return this[_0x8b75('0xe')][_0x8b75('0x38')](_0x1ab251);};module[_0x8b75('0x3a')]=EmailChannel; \ No newline at end of file +var _0xec4c=['active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','provider','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key'];(function(_0x23889b,_0x588ae1){var _0x3b38c2=function(_0x4d614f){while(--_0x4d614f){_0x23889b['push'](_0x23889b['shift']());}};_0x3b38c2(++_0x588ae1);}(_0xec4c,0xd0));var _0xcec4=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xec4c[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var moment=require(_0xcec4('0x0'));var BPromise=require(_0xcec4('0x1'));var md5=require(_0xcec4('0x2'));var Redis=require(_0xcec4('0x3'));var config=require(_0xcec4('0x4'));var logger=require('../../../config/logger')(_0xcec4('0x5'));config[_0xcec4('0x6')]=_[_0xcec4('0x7')](config['redis'],{'host':_0xcec4('0x8'),'port':0x18eb});var io=require(_0xcec4('0x9'))(new Redis(config[_0xcec4('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xcec4('0xa'));var mailAccount=require(_0xcec4('0xb'));var md5Accounts={};function EmailChannel(_0x48a464){logger[_0xcec4('0xc')](_0xcec4('0xd'));this[_0xcec4('0xe')]=_0x48a464['mailAccounts'];this[_0xcec4('0xf')]={};this[_0xcec4('0x10')]=new EmailSmtp();}EmailChannel[_0xcec4('0x11')][_0xcec4('0x12')]=function(_0x30ccc7){var _0x27db38=this[_0xcec4('0xe')][_0x30ccc7];var _0x3e58c3={'id':_0x27db38['id'],'name':_0x27db38['name'],'key':_0x27db38[_0xcec4('0x13')],'active':_0x27db38[_0xcec4('0x14')],'Imap':{'status':_0x27db38[_0xcec4('0x15')][_0xcec4('0x16')],'messageStatus':_0x27db38['Imap'][_0xcec4('0x17')],'total':_0x27db38['Imap'][_0xcec4('0x18')]}};if(_[_0xcec4('0x19')](md5Accounts[_0x30ccc7])){md5Accounts[_0x30ccc7]={};}var _0x167b2e=md5(JSON[_0xcec4('0x1a')](_0x3e58c3));if(md5Accounts[_0x30ccc7][_0xcec4('0x2')]!==_0x167b2e){md5Accounts[_0x30ccc7][_0xcec4('0x2')]=_0x167b2e;io['emit'](_0xcec4('0x1b'),_0x3e58c3);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x1c')]=function(_0x5775f7){for(var _0x19f04b in _0x5775f7){if(_0x5775f7['hasOwnProperty'](_0x19f04b)){if(_0x5775f7[_0x19f04b][_0xcec4('0x15')]&&_0x5775f7[_0x19f04b][_0xcec4('0x14')]){var _0x5bd2e2=_0x5775f7[_0x19f04b][_0xcec4('0x15')];if(!_0x5bd2e2[_0xcec4('0x1d')]&&_0x5775f7[_0x19f04b][_0xcec4('0x1e')]!=='custom')_0x5bd2e2['service']=_0x5775f7[_0x19f04b]['provider'];if(!this[_0xcec4('0xf')]['hasOwnProperty'](_0x5bd2e2['id'])){this[_0xcec4('0xf')][_0x5bd2e2['id']]=new EmailImap(_0x5bd2e2,_0x5775f7[_0x19f04b][_0xcec4('0x5')]);this[_0xcec4('0xf')][_0x5bd2e2['id']]['on']('box',this[_0xcec4('0x1f')]['bind'](this,_0x19f04b));this[_0xcec4('0xf')][_0x5bd2e2['id']]['on']('email',this[_0xcec4('0x20')][_0xcec4('0x21')](this,_0x19f04b));this[_0xcec4('0xf')][_0x5bd2e2['id']]['on'](_0xcec4('0x22'),this[_0xcec4('0x23')][_0xcec4('0x21')](this,_0x19f04b));this['imapAccounts'][_0x5bd2e2['id']]['on'](_0xcec4('0x24'),this[_0xcec4('0x25')][_0xcec4('0x21')](this,_0x19f04b));}}else{if(_[_0xcec4('0x19')](this[_0xcec4('0xe')][_0x19f04b][_0xcec4('0x15')])){this[_0xcec4('0xe')][_0x19f04b][_0xcec4('0x15')]={};}this['mailAccounts'][_0x19f04b][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x26');this['mailAccounts'][_0x19f04b][_0xcec4('0x15')][_0xcec4('0x17')]='';this[_0xcec4('0x12')](_0x19f04b);}}}};EmailChannel[_0xcec4('0x11')]['handleImapBox']=function(_0x358a3a,_0x2b3909){if(this[_0xcec4('0xe')][_0x358a3a]){this['mailAccounts'][_0x358a3a][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x27');this['mailAccounts'][_0x358a3a][_0xcec4('0x15')]['messageStatus']=_0x2b3909[_0xcec4('0x28')];if(_0x2b3909[_0xcec4('0x29')]){this[_0xcec4('0xe')][_0x358a3a]['Imap'][_0xcec4('0x18')]=_0x2b3909[_0xcec4('0x29')]['total'];}return this[_0xcec4('0x12')](_0x358a3a);}};EmailChannel[_0xcec4('0x11')]['handleImapEmail']=function(_0x5ab8fb,_0x19d660){logger[_0xcec4('0xc')](_0xcec4('0x2a'),_0x19d660['firstName'],_0x19d660[_0xcec4('0x2b')],_0x19d660[_0xcec4('0x2c')],_0x5ab8fb);if(this[_0xcec4('0xe')][_0x5ab8fb]){return mailAccount[_0xcec4('0x2d')](_0x5ab8fb,_0x19d660)['then'](function(_0x35ebbd){if(_0x35ebbd){logger[_0xcec4('0xc')](_0xcec4('0x2e'));}})[_0xcec4('0x2f')](function(_0x885802){logger[_0xcec4('0x24')](_0xcec4('0x30'),JSON[_0xcec4('0x1a')](_0x885802));});}};EmailChannel[_0xcec4('0x11')]['handleImapEnd']=function(_0x3ea2f8){if(this[_0xcec4('0xe')][_0x3ea2f8]&&this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')]){if(this[_0xcec4('0xf')][this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')]['id']]){delete this[_0xcec4('0xf')][this[_0xcec4('0xe')][_0x3ea2f8]['Imap']['id']];}this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')][_0xcec4('0x31')]=moment();this[_0xcec4('0x12')](_0x3ea2f8);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x25')]=function(_0x1c2d42,_0x252f19){if(this[_0xcec4('0xe')][_0x1c2d42]){this[_0xcec4('0xe')][_0x1c2d42][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x24');this[_0xcec4('0xe')][_0x1c2d42][_0xcec4('0x15')][_0xcec4('0x17')]=_0x252f19;return this['emit'](_0x1c2d42);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x32')]=function(_0x4f9067,_0x169e46){return this[_0xcec4('0x10')][_0xcec4('0x33')](_0x4f9067,_0x169e46);};EmailChannel[_0xcec4('0x11')][_0xcec4('0x34')]=function(_0x25d9c3){var _0xb68636=this;if(this[_0xcec4('0xe')][_0x25d9c3['id']]){if(_[_0xcec4('0x19')](this[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')])){this[_0xcec4('0xe')][_0x25d9c3['id']]['Smtp']={};}this[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')]['lastSync']=moment();return new BPromise(function(_0x1ac7b7,_0x3c0776){return _0xb68636['smtp'][_0xcec4('0x36')](_0x25d9c3)[_0xcec4('0x37')](function(_0x20a288){_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x16')]=_0xcec4('0x38');_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']]['Smtp']['messageStatus']='';_0xb68636[_0xcec4('0x12')](_0x25d9c3['id']);_0x1ac7b7(_0x20a288);})[_0xcec4('0x2f')](function(_0xe0dc52){_0xb68636['mailAccounts'][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x16')]=_0xcec4('0x24');_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x17')]=_0xe0dc52;_0xb68636[_0xcec4('0x12')](_0x25d9c3['id']);_0x3c0776(_0xe0dc52);});});}return this[_0xcec4('0x10')][_0xcec4('0x36')](_0x25d9c3);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 2672cbd..cdb5532 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 _0x5cd3=['once','end','handleEnd','error','handleError','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','handleReady','bind'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x5cd3,0x65));var _0x35cd=function(_0x59dd54,_0x495d0a){_0x59dd54=_0x59dd54-0x0;var _0x1025d3=_0x5cd3[_0x59dd54];return _0x1025d3;};'use strict';var _=require(_0x35cd('0x0'));var util=require('util');var Imap=require(_0x35cd('0x1'));var simpleParser=require(_0x35cd('0x2'))[_0x35cd('0x3')];var Iconv=require(_0x35cd('0x4'))[_0x35cd('0x5')];var EventEmitter=require(_0x35cd('0x6'))[_0x35cd('0x7')];var utils=require(_0x35cd('0x8'));var logger=require('../../../config/logger')(_0x35cd('0x9'));function EmailImap(_0x3308a1,_0x2c3c1e){this['mailbox']=_0x3308a1[_0x35cd('0xa')];this[_0x35cd('0xb')]=this[_0x35cd('0xc')](_0x3308a1,_0x2c3c1e);this['imap']=new Imap(this[_0x35cd('0xb')]);this[_0x35cd('0x1')]['once']('ready',this[_0x35cd('0xd')][_0x35cd('0xe')](this));this[_0x35cd('0x1')][_0x35cd('0xf')](_0x35cd('0x10'),this[_0x35cd('0x11')]['bind'](this));this['imap']['on'](_0x35cd('0x12'),this[_0x35cd('0x13')][_0x35cd('0xe')](this));this[_0x35cd('0x1')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x35cd('0x14')][_0x35cd('0xc')]=function(_0x3ad599,_0x3873a8){var _0xbbcda4={'connTimeout':_0x3ad599[_0x35cd('0x15')]?_0x3ad599[_0x35cd('0x15')]*0x3e8:0x2710,'authTimeout':_0x3ad599['authTimeout']?_0x3ad599[_0x35cd('0x16')]*0x3e8:0x1388};if(_0x3ad599[_0x35cd('0x17')]){_0xbbcda4['user']=_0x3ad599[_0x35cd('0x18')];if(_0x3ad599[_0x35cd('0x19')]){_0xbbcda4[_0x35cd('0x1a')]=utils[_0x35cd('0x1b')](_0x3ad599[_0x35cd('0x1c')][_0x35cd('0x1d')],_0x3ad599[_0x35cd('0x18')]);}else{_0xbbcda4['password']=_0x3ad599['password'];}}else{if(_0x3ad599['authentication']){_0xbbcda4['user']=_0x3ad599['user'];_0xbbcda4[_0x35cd('0x1e')]=_0x3ad599[_0x35cd('0x1e')];}}_0xbbcda4[_0x35cd('0x9')]=_0x3873a8||_0x3ad599[_0x35cd('0x18')]||'anonymous@xcally.com';_0xbbcda4[_0x35cd('0x1f')]=_0x3ad599['host'];_0xbbcda4[_0x35cd('0x20')]=_0x3ad599[_0x35cd('0x20')]||0x3e1;if(_0x3ad599[_0x35cd('0x21')]){_0xbbcda4[_0x35cd('0x21')]=!![];}else{_0xbbcda4[_0x35cd('0x21')]=![];_0xbbcda4[_0x35cd('0x22')]='required';}return _0xbbcda4;};EmailImap[_0x35cd('0x14')][_0x35cd('0xd')]=function(){this[_0x35cd('0x1')]['openBox'](this[_0x35cd('0xa')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x35cd('0x14')]['handleOpenBox']=function(_0x2c40c0,_0x4178f0){if(_0x2c40c0){this[_0x35cd('0x13')](_0x2c40c0,!![]);}else{this[_0x35cd('0x23')](_0x35cd('0x24'),_0x4178f0);this[_0x35cd('0x25')]();}};EmailImap[_0x35cd('0x14')]['handleCloseBox']=function(_0x14442b){if(_0x14442b){this[_0x35cd('0x13')](_0x14442b,!![]);}else{this[_0x35cd('0x1')]['end']();}};EmailImap['prototype'][_0x35cd('0x25')]=function(){this[_0x35cd('0x1')][_0x35cd('0x26')]([_0x35cd('0x27')],this[_0x35cd('0x28')]['bind'](this));};EmailImap[_0x35cd('0x14')][_0x35cd('0x28')]=function(_0x5757d3,_0x10b6ff){if(_0x5757d3){this['handleError'](_0x5757d3,!![]);}else{if(_0x10b6ff[_0x35cd('0x29')]){try{var _0x48b576=this[_0x35cd('0x1')][_0x35cd('0x2a')](_0x10b6ff,{'bodies':'','markSeen':!![]});_0x48b576['on']('message',this['handleFetchMessage']['bind'](this));_0x48b576[_0x35cd('0xf')]('error',this[_0x35cd('0x2b')][_0x35cd('0xe')](this));_0x48b576[_0x35cd('0xf')](_0x35cd('0x10'),this[_0x35cd('0x2c')][_0x35cd('0xe')](this));}catch(_0x3b4675){logger['error'](_0x3b4675);}}else{this[_0x35cd('0x1')][_0x35cd('0x2d')](!![],this['handleCloseBox'][_0x35cd('0xe')](this));}}};EmailImap[_0x35cd('0x14')][_0x35cd('0x2e')]=function(_0x3a5379){_0x3a5379['on']('body',this[_0x35cd('0x2f')][_0x35cd('0xe')](this));_0x3a5379[_0x35cd('0xf')](_0x35cd('0x30'),this[_0x35cd('0x31')][_0x35cd('0xe')](this));_0x3a5379[_0x35cd('0xf')](_0x35cd('0x10'),this['handleMessageEnd'][_0x35cd('0xe')](this));};EmailImap[_0x35cd('0x14')][_0x35cd('0x2f')]=function(_0x2eb5bb){simpleParser(_0x2eb5bb,{'Iconv':Iconv},this[_0x35cd('0x32')][_0x35cd('0xe')](this));};EmailImap[_0x35cd('0x14')][_0x35cd('0x31')]=function(){};EmailImap['prototype'][_0x35cd('0x33')]=function(){};EmailImap[_0x35cd('0x14')]['handleSimpleParser']=function(_0x1924b1,_0x4dbc92){if(_0x1924b1){logger[_0x35cd('0x12')](_0x1924b1);}else{var _0x552d01=this;utils['parser'](this['account'],_0x4dbc92,function(_0x51fad9){_0x552d01[_0x35cd('0x23')](_0x35cd('0x9'),_0x51fad9);});}};EmailImap[_0x35cd('0x14')][_0x35cd('0x2c')]=function(){this['imap'][_0x35cd('0x2d')](!![],this[_0x35cd('0x34')][_0x35cd('0xe')](this));};EmailImap[_0x35cd('0x14')][_0x35cd('0x2b')]=function(_0x3f3e1e){this['handleError'](_0x3f3e1e);this[_0x35cd('0x1')][_0x35cd('0x2d')](!![],this[_0x35cd('0x34')]['bind'](this));};EmailImap[_0x35cd('0x14')]['handleEnd']=function(){this['emit'](_0x35cd('0x10'));};EmailImap[_0x35cd('0x14')][_0x35cd('0x13')]=function(_0x3e7672,_0x4db87c){logger[_0x35cd('0x12')]('handleError',this[_0x35cd('0xb')]['email'],JSON[_0x35cd('0x35')](_0x3e7672));var _0x112630='';if(_0x3e7672){if(_0x3e7672['textCode']){_0x112630=_0x3e7672[_0x35cd('0x36')];}else{for(var _0x2a823a in _0x3e7672){if(_0x3e7672[_0x35cd('0x37')](_0x2a823a)){_0x112630+=_[_0x35cd('0x38')](_0x2a823a)+':\x20'+_0x3e7672[_0x2a823a]+'\x0a';}}}}if(_0x4db87c){this[_0x35cd('0x1')][_0x35cd('0x10')]();}else{this[_0x35cd('0x23')](_0x35cd('0x12'),_0x112630);this[_0x35cd('0x23')](_0x35cd('0x10'));}};module[_0x35cd('0x39')]=EmailImap; \ No newline at end of file +var _0x6866=['end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','once','bind'];(function(_0x1d0e71,_0x1aaecd){var _0x16376e=function(_0x472cf9){while(--_0x472cf9){_0x1d0e71['push'](_0x1d0e71['shift']());}};_0x16376e(++_0x1aaecd);}(_0x6866,0xe4));var _0x6686=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6866[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x6686('0x0'));var util=require(_0x6686('0x1'));var Imap=require(_0x6686('0x2'));var simpleParser=require(_0x6686('0x3'))[_0x6686('0x4')];var Iconv=require(_0x6686('0x5'))[_0x6686('0x6')];var EventEmitter=require(_0x6686('0x7'))['EventEmitter'];var utils=require(_0x6686('0x8'));var logger=require(_0x6686('0x9'))(_0x6686('0xa'));function EmailImap(_0x1df4a8,_0x59d0f5){this[_0x6686('0xb')]=_0x1df4a8[_0x6686('0xb')];this[_0x6686('0xc')]=this[_0x6686('0xd')](_0x1df4a8,_0x59d0f5);this[_0x6686('0x2')]=new Imap(this[_0x6686('0xc')]);this[_0x6686('0x2')][_0x6686('0xe')]('ready',this['handleReady'][_0x6686('0xf')](this));this[_0x6686('0x2')][_0x6686('0xe')](_0x6686('0x10'),this[_0x6686('0x11')][_0x6686('0xf')](this));this[_0x6686('0x2')]['on'](_0x6686('0x12'),this[_0x6686('0x13')][_0x6686('0xf')](this));this[_0x6686('0x2')][_0x6686('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x6686('0x15')][_0x6686('0xd')]=function(_0x546993,_0x2926ae){var _0x124350={'connTimeout':_0x546993[_0x6686('0x16')]?_0x546993[_0x6686('0x16')]*0x3e8:0x2710,'authTimeout':_0x546993[_0x6686('0x17')]?_0x546993[_0x6686('0x17')]*0x3e8:0x1388};if(_0x546993[_0x6686('0x18')]){_0x124350[_0x6686('0x19')]=_0x546993['user'];if(_0x546993[_0x6686('0x1a')]){_0x124350['xoauth2']=utils[_0x6686('0x1b')](_0x546993[_0x6686('0x1c')][_0x6686('0x1d')],_0x546993[_0x6686('0x19')]);}else{_0x124350[_0x6686('0x1e')]=_0x546993[_0x6686('0x1e')];}}else{if(_0x546993[_0x6686('0x1f')]){_0x124350[_0x6686('0x19')]=_0x546993[_0x6686('0x19')];_0x124350[_0x6686('0x1e')]=_0x546993[_0x6686('0x1e')];}}_0x124350['email']=_0x2926ae||_0x546993[_0x6686('0x19')]||_0x6686('0x20');_0x124350[_0x6686('0x21')]=_0x546993[_0x6686('0x21')];_0x124350[_0x6686('0x22')]=_0x546993[_0x6686('0x22')]||0x3e1;if(_0x546993[_0x6686('0x23')]){_0x124350[_0x6686('0x23')]=!![];}else{_0x124350[_0x6686('0x23')]=![];_0x124350[_0x6686('0x24')]=_0x6686('0x25');}return _0x124350;};EmailImap[_0x6686('0x15')][_0x6686('0x26')]=function(){this[_0x6686('0x2')][_0x6686('0x27')](this[_0x6686('0xb')],![],this[_0x6686('0x28')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x28')]=function(_0x24915e,_0x40a48f){if(_0x24915e){this[_0x6686('0x13')](_0x24915e,!![]);}else{this[_0x6686('0x29')](_0x6686('0x2a'),_0x40a48f);this['readUnseen']();}};EmailImap[_0x6686('0x15')]['handleCloseBox']=function(_0x2d5ed2){if(_0x2d5ed2){this[_0x6686('0x13')](_0x2d5ed2,!![]);}else{this['imap']['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x6686('0x2')][_0x6686('0x2b')]([_0x6686('0x2c')],this[_0x6686('0x2d')][_0x6686('0xf')](this));};EmailImap['prototype'][_0x6686('0x2d')]=function(_0x4af678,_0x1e9e54){if(_0x4af678){this[_0x6686('0x13')](_0x4af678,!![]);}else{if(_0x1e9e54[_0x6686('0x2e')]){try{var _0x170f5f=this['imap'][_0x6686('0x2f')](_0x1e9e54,{'bodies':'','markSeen':!![]});_0x170f5f['on']('message',this[_0x6686('0x30')][_0x6686('0xf')](this));_0x170f5f[_0x6686('0xe')](_0x6686('0x12'),this['handleFetchError'][_0x6686('0xf')](this));_0x170f5f[_0x6686('0xe')]('end',this[_0x6686('0x31')]['bind'](this));}catch(_0x16c948){logger[_0x6686('0x12')](_0x16c948);}}else{this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));}}};EmailImap[_0x6686('0x15')][_0x6686('0x30')]=function(_0x5cf931){_0x5cf931['on']('body',this[_0x6686('0x34')]['bind'](this));_0x5cf931[_0x6686('0xe')](_0x6686('0x35'),this['handleMessageAttributes'][_0x6686('0xf')](this));_0x5cf931[_0x6686('0xe')](_0x6686('0x10'),this['handleMessageEnd'][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x34')]=function(_0x3bc346){simpleParser(_0x3bc346,{'Iconv':Iconv},this['handleSimpleParser'][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x6686('0x15')][_0x6686('0x36')]=function(){};EmailImap[_0x6686('0x15')][_0x6686('0x37')]=function(_0x29b508,_0x3fbfe1){if(_0x29b508){logger[_0x6686('0x12')](_0x29b508);}else{var _0x47e0cf=this;utils[_0x6686('0x38')](this['account'],_0x3fbfe1,function(_0x537cea){_0x47e0cf['emit']('email',_0x537cea);});}};EmailImap[_0x6686('0x15')][_0x6686('0x31')]=function(){this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x39')]=function(_0x10cc79){this[_0x6686('0x13')](_0x10cc79);this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x11')]=function(){this[_0x6686('0x29')](_0x6686('0x10'));};EmailImap[_0x6686('0x15')][_0x6686('0x13')]=function(_0x598970,_0x3ba0ab){logger['error'](_0x6686('0x13'),this[_0x6686('0xc')][_0x6686('0xa')],JSON['stringify'](_0x598970));var _0x4113fb='';if(_0x598970){if(_0x598970[_0x6686('0x3a')]){_0x4113fb=_0x598970[_0x6686('0x3a')];}else{for(var _0x223e26 in _0x598970){if(_0x598970[_0x6686('0x3b')](_0x223e26)){_0x4113fb+=_['upperFirst'](_0x223e26)+':\x20'+_0x598970[_0x223e26]+'\x0a';}}}}if(_0x3ba0ab){this[_0x6686('0x2')][_0x6686('0x10')]();}else{this[_0x6686('0x29')](_0x6686('0x12'),_0x4113fb);this[_0x6686('0x29')](_0x6686('0x10'));}};module[_0x6686('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 038d11f..e8f25b5 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 _0x9def=['nodemailer-plugin-inline-base64','prototype','send','compile','sendMail','verify','exports','nodemailer'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x9def,0x167));var _0xf9de=function(_0x5e947e,_0x19ccc8){_0x5e947e=_0x5e947e-0x0;var _0x3a8c3b=_0x9def[_0x5e947e];return _0x3a8c3b;};'use strict';var nodemailer=require(_0xf9de('0x0'));var inlineBase64=require(_0xf9de('0x1'));function EmailSmtp(){}EmailSmtp[_0xf9de('0x2')][_0xf9de('0x3')]=function(_0x35fc6b,_0x5acd02){return new Promise(function(_0x2f55f4,_0x43639f){var _0x591d02=nodemailer['createTransport'](_0x35fc6b);_0x591d02['use'](_0xf9de('0x4'),inlineBase64());_0x591d02[_0xf9de('0x5')](_0x5acd02,function(_0x26859d,_0x450171){if(_0x26859d){_0x43639f(_0x26859d['toString']());}else{_0x2f55f4(_0x450171);}});});};EmailSmtp[_0xf9de('0x2')][_0xf9de('0x6')]=function(_0x3cc15f){return new Promise(function(_0x48cf90,_0x1e3337){var _0xf622ec=nodemailer['createTransport'](_0x3cc15f);_0xf622ec['verify'](function(_0x3019c2,_0x10ec04){if(_0x3019c2){_0x1e3337(_0x3019c2['toString']());}else{if(_0x10ec04){_0x48cf90(_0x10ec04);}else{_0x1e3337('Not\x20verifired');}}});});};module[_0xf9de('0x7')]=EmailSmtp; \ No newline at end of file +var _0x4804=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','use','sendMail','prototype','verify','createTransport'];(function(_0x122633,_0x22057b){var _0x2d02e5=function(_0x420024){while(--_0x420024){_0x122633['push'](_0x122633['shift']());}};_0x2d02e5(++_0x22057b);}(_0x4804,0x1e2));var _0x4480=function(_0x2908b7,_0x21d35e){_0x2908b7=_0x2908b7-0x0;var _0x5ab26f=_0x4804[_0x2908b7];return _0x5ab26f;};'use strict';var nodemailer=require(_0x4480('0x0'));var inlineBase64=require(_0x4480('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x4480('0x2')]=function(_0x306276,_0x55feae){return new Promise(function(_0x204ab9,_0x3fb92f){var _0x1355c8=nodemailer['createTransport'](_0x306276);_0x1355c8[_0x4480('0x3')]('compile',inlineBase64());_0x1355c8[_0x4480('0x4')](_0x55feae,function(_0x50a40e,_0x406115){if(_0x50a40e){_0x3fb92f(_0x50a40e['toString']());}else{_0x204ab9(_0x406115);}});});};EmailSmtp[_0x4480('0x5')][_0x4480('0x6')]=function(_0x2ced78){return new Promise(function(_0x7ce473,_0x367289){var _0x232179=nodemailer[_0x4480('0x7')](_0x2ced78);_0x232179[_0x4480('0x6')](function(_0x118da4,_0x1a2a9c){if(_0x118da4){_0x367289(_0x118da4['toString']());}else{if(_0x1a2a9c){_0x7ce473(_0x1a2a9c);}else{_0x367289(_0x4480('0x8'));}}});});};module[_0x4480('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 2403435..8ba3fc7 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 _0x28cb=['../../../config/environment','head','address','generate','@xcally.com','value','name','substring','indexOf','length','slice','join','split','pop','anonymous','html','includes','','body','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','utf-8','toString','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email'];(function(_0x5837b2,_0x404be4){var _0x56435d=function(_0x2f5d4d){while(--_0x2f5d4d){_0x5837b2['push'](_0x5837b2['shift']());}};_0x56435d(++_0x404be4);}(_0x28cb,0xce));var _0xb28c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x28cb[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xb28c('0x0'));var moment=require(_0xb28c('0x1'));var random=require(_0xb28c('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xb28c('0x3'));var tnef=require(_0xb28c('0x4'));var logger=require(_0xb28c('0x5'))(_0xb28c('0x6'));var config=require(_0xb28c('0x7'));function getAddress(_0x34184b){var _0x8fc7ba=_[_0xb28c('0x8')](_0x34184b['value']);return _0x8fc7ba&&_0x8fc7ba[_0xb28c('0x9')]?_0x8fc7ba[_0xb28c('0x9')]:'anonymous'+random[_0xb28c('0xa')](0x6)+_0xb28c('0xb');}function getFirstName(_0x56291b){var _0x4174ba=_[_0xb28c('0x8')](_0x56291b[_0xb28c('0xc')]);if(_0x4174ba&&_0x4174ba[_0xb28c('0xd')]){if(_0x4174ba['name']==_0x4174ba['address']){return _0x4174ba[_0xb28c('0xd')][_0xb28c('0xe')](0x0,_0x4174ba[_0xb28c('0xd')][_0xb28c('0xf')]('@'));}var _0x422cf9=_0x4174ba['name']['split'](/\s+/);return _0x422cf9[_0xb28c('0x10')]>0x1?_0x422cf9[_0xb28c('0x11')](0x0,-0x1)[_0xb28c('0x12')]('\x20'):_0x4174ba['name'];}return'Anonymous';}function getLastName(_0x2e578f){var _0x3d19bb=_['head'](_0x2e578f[_0xb28c('0xc')]);if(_0x3d19bb&&_0x3d19bb['name']){var _0x467af0=_0x3d19bb[_0xb28c('0xd')][_0xb28c('0x13')](/\s+/);return _0x467af0[_0xb28c('0x10')]>0x1?_0x467af0[_0xb28c('0x14')]():'';}return'';}function getMails(_0x338983,_0x4ac793){var _0x103b2d='';for(var _0x51feb1=0x0;_0x51feb1<_0x4ac793[_0xb28c('0xc')][_0xb28c('0x10')];_0x51feb1+=0x1){if(_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]!==_0x338983){if(!_['isEmpty'](_0x103b2d)){_0x103b2d+=',';}_0x103b2d+=_0x4ac793['value'][_0x51feb1]['name']||_0x4ac793[_0xb28c('0xc')][_0x51feb1]['address']||'';_0x103b2d+='\x20<';_0x103b2d+=_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]?_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]:_0xb28c('0x15')+random[_0xb28c('0xa')](0x6)+_0xb28c('0xb');_0x103b2d+='>';}}return _0x103b2d;}function parseEmail(_0x2fb1cf,_0x561237,_0x17d832){if(_0x561237[_0xb28c('0x16')]){var _0xc8345b=/)<[^<]*)*<\/script>/gi;while(_0xc8345b['test'](_0x561237[_0xb28c('0x16')])){_0x561237[_0xb28c('0x16')]=_0x561237['html']['replace'](_0xc8345b,'');}if(_0x561237[_0xb28c('0x16')][_0xb28c('0x17')](_0xb28c('0x18'))){var _0x39cca9=[];_0x561237[_0xb28c('0x19')][_0xb28c('0x1a')](_0x180fdb=>{_0x39cca9[_0xb28c('0x1b')](_0x180fdb['filename']);});var _0x5c8033=/]+>/g;var _0x445fdf=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5594f5=_0x561237[_0xb28c('0x16')][_0xb28c('0x1c')](_0x445fdf,'_SRC');var _0x3c5b2e=_0x5594f5[_0xb28c('0x1c')](_0x5c8033,_0xb28c('0x1d'));for(let _0x3587c4=0x0;_0x3587c4<_0x39cca9[_0xb28c('0x10')];_0x3587c4++){var _0x146bb5=_0x3c5b2e[_0xb28c('0x1c')](_0xb28c('0x1d'),'\x20[Attachment:\x20'+_0x39cca9[_0x3587c4]+_0xb28c('0x1e'));_0x3c5b2e=_0x146bb5;}_0x561237['html']=_0x3c5b2e;}_0x17d832['body']=_0x561237[_0xb28c('0x16')];}else{_0x17d832[_0xb28c('0x1f')]=_0x561237['textAsHtml'];}if(_0x17d832[_0xb28c('0x1f')]){_0x17d832[_0xb28c('0x1f')]=_0x17d832[_0xb28c('0x1f')][_0xb28c('0x1c')](/0x0){var _0x15b8bb=[_0xb28c('0x31'),'X-Auto-Response-Suppress:\x20All',_0xb28c('0x32')];for(var _0x48424d=0x0;_0x48424d<_0x561237[_0xb28c('0x30')]['length'];_0x48424d++){var _0x478e87=_['indexOf'](_0x15b8bb,_0x561237[_0xb28c('0x30')][_0x48424d][_0xb28c('0x33')]);if(_0x478e87>=0x0){_0x17d832[_0xb28c('0x34')]=!![];}}}return _0x17d832;}exports[_0xb28c('0x35')]=function(_0x511f12,_0x48b470,_0x57cd9f){var _0x3d3410={'from':getAddress(_0x48b470[_0xb28c('0x36')]),'firstName':getFirstName(_0x48b470[_0xb28c('0x36')]),'lastName':getLastName(_0x48b470['from']),'mapKey':_0xb28c('0x6'),'message':{'from':getMails(_0x511f12['email'],_0x48b470[_0xb28c('0x36')]),'to':_0x511f12['email'],'cc':'','subject':_0x48b470[_0xb28c('0x37')]||'','messageId':_0x48b470[_0xb28c('0x38')],'inReplyTo':_0x48b470['inReplyTo'],'sentAt':moment(_0x48b470[_0xb28c('0x39')])[_0xb28c('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x48b470[_0xb28c('0x16')]&&!_0x48b470[_0xb28c('0x3a')]){var _0x38a5c8=_[_0xb28c('0x3b')](_0x48b470[_0xb28c('0x19')],{'contentType':_0xb28c('0x3c')});if(_0x38a5c8['length']){logger[_0xb28c('0x3d')](util[_0xb28c('0x28')](_0xb28c('0x3e'),_0x48b470[_0xb28c('0x38')]));tnef[_0xb28c('0x3f')](_['first'](_0x38a5c8)['content'],function(_0x157e55,_0x1b1b34){if(_0x1b1b34){_0x48b470['html']=_0x1b1b34['BodyHTML']||_0xb28c('0x40');if(_0x1b1b34['Attachments']){for(var _0x25e34e=0x0;_0x25e34e<_0x1b1b34[_0xb28c('0x41')][_0xb28c('0x10')];_0x25e34e++){var _0xeef56=_0x1b1b34[_0xb28c('0x41')][_0x25e34e];_0x3d3410[_0xb28c('0x21')]['attachments'][_0xb28c('0x1b')]({'filename':_0xeef56[_0xb28c('0x42')],'content':Buffer['from'](_0xeef56['Data'])});}}}_0x57cd9f(parseEmail(_0x511f12,_0x48b470,_0x3d3410));});}else{_0x48b470[_0xb28c('0x16')]=_0xb28c('0x40');_0x57cd9f(parseEmail(_0x511f12,_0x48b470,_0x3d3410));}}else{_0x57cd9f(parseEmail(_0x511f12,_0x48b470,_0x3d3410));}};exports[_0xb28c('0x43')]=function(_0x4f190e,_0x4b6057){var _0x2691fd=[_0xb28c('0x44')+(_0x4b6057||''),'auth=Bearer\x20'+_0x4f190e,'',''];return Buffer['from'](_0x2691fd[_0xb28c('0x12')](''),_0xb28c('0x45'))[_0xb28c('0x46')]('base64');}; \ No newline at end of file +var _0xd5ce=['indexOf','split','length','join','pop','isEmpty','html','test','replace','includes','Empty\x20message

','Attachments','generateXOAuth2Token','user=','utf-8','base64','lodash','moment','path','util','node-tnef','../../../config/logger','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd5ce,0xc3));var _0xed5c=function(_0x119bb1,_0x1fb2f4){_0x119bb1=_0x119bb1-0x0;var _0x510da7=_0xd5ce[_0x119bb1];return _0x510da7;};'use strict';var _=require(_0xed5c('0x0'));var moment=require(_0xed5c('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xed5c('0x2'));var util=require(_0xed5c('0x3'));var tnef=require(_0xed5c('0x4'));var logger=require(_0xed5c('0x5'))('email');var config=require(_0xed5c('0x6'));function getAddress(_0x277c72){var _0xcf336b=_[_0xed5c('0x7')](_0x277c72['value']);return _0xcf336b&&_0xcf336b[_0xed5c('0x8')]?_0xcf336b[_0xed5c('0x8')]:_0xed5c('0x9')+random[_0xed5c('0xa')](0x6)+_0xed5c('0xb');}function getFirstName(_0x228d53){var _0x4c3e07=_[_0xed5c('0x7')](_0x228d53[_0xed5c('0xc')]);if(_0x4c3e07&&_0x4c3e07['name']){if(_0x4c3e07[_0xed5c('0xd')]==_0x4c3e07[_0xed5c('0x8')]){return _0x4c3e07['name'][_0xed5c('0xe')](0x0,_0x4c3e07[_0xed5c('0xd')][_0xed5c('0xf')]('@'));}var _0x2c656e=_0x4c3e07['name'][_0xed5c('0x10')](/\s+/);return _0x2c656e[_0xed5c('0x11')]>0x1?_0x2c656e['slice'](0x0,-0x1)[_0xed5c('0x12')]('\x20'):_0x4c3e07[_0xed5c('0xd')];}return'Anonymous';}function getLastName(_0x41f64a){var _0x36e9aa=_['head'](_0x41f64a[_0xed5c('0xc')]);if(_0x36e9aa&&_0x36e9aa[_0xed5c('0xd')]){var _0x4e422e=_0x36e9aa[_0xed5c('0xd')][_0xed5c('0x10')](/\s+/);return _0x4e422e[_0xed5c('0x11')]>0x1?_0x4e422e[_0xed5c('0x13')]():'';}return'';}function getMails(_0x5727d1,_0x194280){var _0x128cb2='';for(var _0x5d9b08=0x0;_0x5d9b08<_0x194280[_0xed5c('0xc')][_0xed5c('0x11')];_0x5d9b08+=0x1){if(_0x194280[_0xed5c('0xc')][_0x5d9b08]['address']!==_0x5727d1){if(!_[_0xed5c('0x14')](_0x128cb2)){_0x128cb2+=',';}_0x128cb2+=_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0xd')]||_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]||'';_0x128cb2+='\x20<';_0x128cb2+=_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]?_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]:'anonymous'+random[_0xed5c('0xa')](0x6)+_0xed5c('0xb');_0x128cb2+='>';}}return _0x128cb2;}function parseEmail(_0xebd1d3,_0x1b1097,_0x994aaa){if(_0x1b1097[_0xed5c('0x15')]){var _0x2b0254=/)<[^<]*)*<\/script>/gi;while(_0x2b0254[_0xed5c('0x16')](_0x1b1097[_0xed5c('0x15')])){_0x1b1097[_0xed5c('0x15')]=_0x1b1097['html'][_0xed5c('0x17')](_0x2b0254,'');}if(_0x1b1097['html'][_0xed5c('0x18')](_0xed5c('0x19'))){var _0x3796ff=[];_0x1b1097[_0xed5c('0x1a')][_0xed5c('0x1b')](_0x388bc4=>{_0x3796ff[_0xed5c('0x1c')](_0x388bc4[_0xed5c('0x1d')]);});var _0x30a2f1=/]+>/g;var _0xab2877=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1249ba=_0x1b1097[_0xed5c('0x15')][_0xed5c('0x17')](_0xab2877,_0xed5c('0x1e'));var _0x340c15=_0x1249ba[_0xed5c('0x17')](_0x30a2f1,_0xed5c('0x1f'));for(let _0x1429e5=0x0;_0x1429e5<_0x3796ff[_0xed5c('0x11')];_0x1429e5++){var _0x5f2425=_0x340c15[_0xed5c('0x17')](_0xed5c('0x1f'),'\x20[Attachment:\x20'+_0x3796ff[_0x1429e5]+'\x20]');_0x340c15=_0x5f2425;}_0x1b1097[_0xed5c('0x15')]=_0x340c15;}_0x994aaa['body']=_0x1b1097['html'];}else{_0x994aaa[_0xed5c('0x20')]=_0x1b1097[_0xed5c('0x21')];}if(_0x994aaa['body']){_0x994aaa['body']=_0x994aaa['body'][_0xed5c('0x17')](/0x0){var _0x50caff=[_0xed5c('0x32'),_0xed5c('0x33'),_0xed5c('0x34')];for(var _0x159f90=0x0;_0x159f90<_0x1b1097[_0xed5c('0x35')]['length'];_0x159f90++){var _0x53a835=_[_0xed5c('0xf')](_0x50caff,_0x1b1097[_0xed5c('0x35')][_0x159f90][_0xed5c('0x36')]);if(_0x53a835>=0x0){_0x994aaa[_0xed5c('0x37')]=!![];}}}return _0x994aaa;}exports[_0xed5c('0x38')]=function(_0x35e8f0,_0x3b2dca,_0x16b407){var _0x44c156={'from':getAddress(_0x3b2dca[_0xed5c('0x39')]),'firstName':getFirstName(_0x3b2dca[_0xed5c('0x39')]),'lastName':getLastName(_0x3b2dca[_0xed5c('0x39')]),'mapKey':_0xed5c('0x25'),'message':{'from':getMails(_0x35e8f0['email'],_0x3b2dca[_0xed5c('0x39')]),'to':_0x35e8f0[_0xed5c('0x25')],'cc':'','subject':_0x3b2dca[_0xed5c('0x3a')]||'','messageId':_0x3b2dca['messageId'],'inReplyTo':_0x3b2dca[_0xed5c('0x3b')],'sentAt':moment(_0x3b2dca[_0xed5c('0x3c')])[_0xed5c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3b2dca[_0xed5c('0x15')]&&!_0x3b2dca[_0xed5c('0x21')]){var _0x45b8d5=_['filter'](_0x3b2dca[_0xed5c('0x1a')],{'contentType':'application/ms-tnef'});if(_0x45b8d5[_0xed5c('0x11')]){logger['info'](util[_0xed5c('0x2b')](_0xed5c('0x3d'),_0x3b2dca[_0xed5c('0x3e')]));tnef[_0xed5c('0x3f')](_['first'](_0x45b8d5)[_0xed5c('0x30')],function(_0x44b238,_0x246209){if(_0x246209){_0x3b2dca['html']=_0x246209['BodyHTML']||_0xed5c('0x40');if(_0x246209[_0xed5c('0x41')]){for(var _0xfa5f7a=0x0;_0xfa5f7a<_0x246209['Attachments']['length'];_0xfa5f7a++){var _0x501884=_0x246209[_0xed5c('0x41')][_0xfa5f7a];_0x44c156['message'][_0xed5c('0x1a')][_0xed5c('0x1c')]({'filename':_0x501884['Title'],'content':Buffer[_0xed5c('0x39')](_0x501884['Data'])});}}}_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));});}else{_0x3b2dca[_0xed5c('0x15')]='

Empty\x20message

';_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));}}else{_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));}};exports[_0xed5c('0x42')]=function(_0x3b9074,_0x4bcdb7){var _0xa53e19=[_0xed5c('0x43')+(_0x4bcdb7||''),'auth=Bearer\x20'+_0x3b9074,'',''];return Buffer[_0xed5c('0x39')](_0xa53e19[_0xed5c('0x12')](''),_0xed5c('0x44'))['toString'](_0xed5c('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 9eed77c..ed597eb 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56fd=['SERV','active','Imap','Smtp','exports','name','key'];(function(_0x4d0373,_0x3ad5ea){var _0x2f301d=function(_0x372302){while(--_0x372302){_0x4d0373['push'](_0x4d0373['shift']());}};_0x2f301d(++_0x3ad5ea);}(_0x56fd,0x101));var _0xd56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56fd[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');function MailAccount(_0x47d69c){this['id']=_0x47d69c['id']||0x0;this[_0xd56f('0x0')]=_0x47d69c['name']||'Service';this[_0xd56f('0x1')]=_0x47d69c[_0xd56f('0x1')]||_0xd56f('0x2');this[_0xd56f('0x3')]=_0x47d69c['active']||![];this[_0xd56f('0x4')]=_0x47d69c[_0xd56f('0x4')]||[];this[_0xd56f('0x5')]=_0x47d69c['Smtp']||[];}module[_0xd56f('0x6')]=MailAccount; \ No newline at end of file +var _0x9f20=['lodash','name','active','Imap','Smtp','exports'];(function(_0xb8dcd7,_0x5d832b){var _0x121a74=function(_0x5af714){while(--_0x5af714){_0xb8dcd7['push'](_0xb8dcd7['shift']());}};_0x121a74(++_0x5d832b);}(_0x9f20,0x18c));var _0x09f2=function(_0x6ddeb1,_0x55784d){_0x6ddeb1=_0x6ddeb1-0x0;var _0x38ebbe=_0x9f20[_0x6ddeb1];return _0x38ebbe;};'use strict';var _=require(_0x09f2('0x0'));function MailAccount(_0x27bab9){this['id']=_0x27bab9['id']||0x0;this[_0x09f2('0x1')]=_0x27bab9[_0x09f2('0x1')]||'Service';this['key']=_0x27bab9['key']||'SERV';this[_0x09f2('0x2')]=_0x27bab9[_0x09f2('0x2')]||![];this[_0x09f2('0x3')]=_0x27bab9[_0x09f2('0x3')]||[];this[_0x09f2('0x4')]=_0x27bab9['Smtp']||[];}module[_0x09f2('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 85f7b57..a5d4966 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f77=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x525f73,_0x5cf7e6){var _0xbc7f27=function(_0x28c9c3){while(--_0x28c9c3){_0x525f73['push'](_0x525f73['shift']());}};_0xbc7f27(++_0x5cf7e6);}(_0x9f77,0x1b6));var _0x79f7=function(_0x2b08ea,_0x28ad45){_0x2b08ea=_0x2b08ea-0x0;var _0x46474d=_0x9f77[_0x2b08ea];return _0x46474d;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x79f7('0x0')]={};};function freeIsNotKey(_0x14a7dd,_0x3bd5eb,_0x302de0){var _0x6372d9=_[_0x79f7('0x1')](_0x14a7dd,function(_0x4dbf91,_0x5d36c4){return _0x4dbf91[_0x302de0];});for(var _0x53af1c in _0x3bd5eb){if(_0x3bd5eb[_0x79f7('0x2')](_0x53af1c)){if(!_0x6372d9[_0x53af1c]){delete _0x3bd5eb[_0x53af1c];}}}}Realtime[_0x79f7('0x3')][_0x79f7('0x4')]=function(_0x3d4dcc,_0x21d6c7){for(var _0x4bc861 in _0x21d6c7){if(_0x3d4dcc[_0x79f7('0x2')](_0x4bc861)){_0x3d4dcc[_0x4bc861]=_0x21d6c7[_0x4bc861];}}};Realtime['prototype'][_0x79f7('0x5')]=function(){var _0x180e1d=this;return function(_0x148a29){if(_0x148a29){freeIsNotKey(_0x148a29,_0x180e1d['mailAccounts'],'id');for(var _0xe6fbf2=0x0,_0x2afed9={},_0x5bcb3a={};_0xe6fbf2<_0x148a29[_0x79f7('0x6')];_0xe6fbf2+=0x1){_0x2afed9=_0x148a29[_0xe6fbf2];if(_[_0x79f7('0x7')](_0x180e1d[_0x79f7('0x0')][_0x2afed9['id']])){_0x180e1d[_0x79f7('0x0')][_0x2afed9['id']]=new MailAccount(_0x2afed9);}else{_[_0x79f7('0x8')](_0x180e1d[_0x79f7('0x0')][_0x2afed9['id']],_0x2afed9);}}}return _0x180e1d[_0x79f7('0x0')];};};module['exports']=Realtime; \ No newline at end of file +var _0xff29=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x19d8be,_0x2e4c8d){var _0x1b75bc=function(_0x1225bd){while(--_0x1225bd){_0x19d8be['push'](_0x19d8be['shift']());}};_0x1b75bc(++_0x2e4c8d);}(_0xff29,0x182));var _0x9ff2=function(_0x2a8404,_0x565c19){_0x2a8404=_0x2a8404-0x0;var _0x534563=_0xff29[_0x2a8404];return _0x534563;};'use strict';var _=require(_0x9ff2('0x0'));var MailAccount=require(_0x9ff2('0x1'));var Realtime=function(){this[_0x9ff2('0x2')]={};};function freeIsNotKey(_0x48c77f,_0x46c5de,_0x52abba){var _0x5002d5=_[_0x9ff2('0x3')](_0x48c77f,function(_0x31d069,_0x7cda65){return _0x31d069[_0x52abba];});for(var _0x76db54 in _0x46c5de){if(_0x46c5de[_0x9ff2('0x4')](_0x76db54)){if(!_0x5002d5[_0x76db54]){delete _0x46c5de[_0x76db54];}}}}Realtime[_0x9ff2('0x5')][_0x9ff2('0x6')]=function(_0x2133de,_0x4f1bc7){for(var _0x27a172 in _0x4f1bc7){if(_0x2133de[_0x9ff2('0x4')](_0x27a172)){_0x2133de[_0x27a172]=_0x4f1bc7[_0x27a172];}}};Realtime[_0x9ff2('0x5')][_0x9ff2('0x7')]=function(){var _0x1a3140=this;return function(_0x3f3970){if(_0x3f3970){freeIsNotKey(_0x3f3970,_0x1a3140[_0x9ff2('0x2')],'id');for(var _0x18b6f6=0x0,_0x491aa5={},_0x1bafd9={};_0x18b6f6<_0x3f3970[_0x9ff2('0x8')];_0x18b6f6+=0x1){_0x491aa5=_0x3f3970[_0x18b6f6];if(_[_0x9ff2('0x9')](_0x1a3140[_0x9ff2('0x2')][_0x491aa5['id']])){_0x1a3140[_0x9ff2('0x2')][_0x491aa5['id']]=new MailAccount(_0x491aa5);}else{_[_0x9ff2('0xa')](_0x1a3140['mailAccounts'][_0x491aa5['id']],_0x491aa5);}}}return _0x1a3140['mailAccounts'];};};module[_0x9ff2('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 80048ea..9c54729 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd20=['TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','notify','Request','NotifyMailAccount','getMailAccounts','name','provider','email','key','ListId'];(function(_0x1d66d3,_0x5df4ab){var _0x4e1775=function(_0x882329){while(--_0x882329){_0x1d66d3['push'](_0x1d66d3['shift']());}};_0x4e1775(++_0x5df4ab);}(_0xfd20,0x66));var _0x0fd2=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0xfd20[_0x4cfc1d];return _0x1c01a0;};'use strict';var client=require('../client');exports[_0x0fd2('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x2'),'service',_0x0fd2('0x3'),'active',_0x0fd2('0x4'),_0x0fd2('0x5'),_0x0fd2('0x6')],'raw':![],'include':[{'model':_0x0fd2('0x7'),'as':_0x0fd2('0x8'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x0fd2('0x9'),_0x0fd2('0xa'),_0x0fd2('0xb')],'as':_0x0fd2('0xc')}]},{'model':_0x0fd2('0xd'),'as':_0x0fd2('0xe'),'include':[{'model':_0x0fd2('0xc'),'attributes':['id','name',_0x0fd2('0x9'),_0x0fd2('0xa'),'data5'],'as':_0x0fd2('0xc')}]}]},'log':'getMailAccount'});};};exports[_0x0fd2('0xf')]=function(_0x2222c4,_0x42ea5c){return client[_0x0fd2('0x10')](_0x0fd2('0x11'),{'account':{'id':_0x2222c4},'body':_0x42ea5c,'log':_0x0fd2('0x11')});}; \ No newline at end of file +var _0x39bd=['provider','service','email','active','key','ListId','Imap','CloudProvider','name','type','data5','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','GetMailAccount'];(function(_0x188f19,_0x40e555){var _0x466996=function(_0x11c62e){while(--_0x11c62e){_0x188f19['push'](_0x188f19['shift']());}};_0x466996(++_0x40e555);}(_0x39bd,0x7c));var _0xd39b=function(_0x16ed21,_0x4ecef0){_0x16ed21=_0x16ed21-0x0;var _0x63c47b=_0x39bd[_0x16ed21];return _0x63c47b;};'use strict';var client=require(_0xd39b('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xd39b('0x1'),{'options':{'attributes':['id','name',_0xd39b('0x2'),_0xd39b('0x3'),_0xd39b('0x4'),_0xd39b('0x5'),_0xd39b('0x6'),_0xd39b('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xd39b('0x8'),'include':[{'model':_0xd39b('0x9'),'attributes':['id',_0xd39b('0xa'),_0xd39b('0x3'),_0xd39b('0xb'),_0xd39b('0xc')],'as':_0xd39b('0x9')}]},{'model':'MailServerOut','as':_0xd39b('0xd'),'include':[{'model':_0xd39b('0x9'),'attributes':['id',_0xd39b('0xa'),_0xd39b('0x3'),_0xd39b('0xb'),'data5'],'as':_0xd39b('0x9')}]}]},'log':_0xd39b('0xe')});};};exports[_0xd39b('0xf')]=function(_0xfcdb02,_0x319ba7){return client[_0xd39b('0x10')](_0xd39b('0x11'),{'account':{'id':_0xfcdb02},'body':_0x319ba7,'log':_0xd39b('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8ffa850..035c80e 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7446=['ShowSetting','loginMailFrequency','../client','getSettings'];(function(_0x4e8d1f,_0x3d69f9){var _0x1badc8=function(_0x47a205){while(--_0x47a205){_0x4e8d1f['push'](_0x4e8d1f['shift']());}};_0x1badc8(++_0x3d69f9);}(_0x7446,0x16a));var _0x6744=function(_0x1060bf,_0x3a6714){_0x1060bf=_0x1060bf-0x0;var _0x29a948=_0x7446[_0x1060bf];return _0x29a948;};'use strict';var client=require(_0x6744('0x0'));exports[_0x6744('0x1')]=function(){return client['Request'](_0x6744('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6744('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xaf53=['getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x3e8d4d,_0x55cd8f){var _0x3f4d24=function(_0x1cf516){while(--_0x1cf516){_0x3e8d4d['push'](_0x3e8d4d['shift']());}};_0x3f4d24(++_0x55cd8f);}(_0xaf53,0xc4));var _0x3af5=function(_0x324f5c,_0x19e1f0){_0x324f5c=_0x324f5c-0x0;var _0x2c81c4=_0xaf53[_0x324f5c];return _0x2c81c4;};'use strict';var client=require('../client');exports[_0x3af5('0x0')]=function(){return client[_0x3af5('0x1')](_0x3af5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3af5('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 715c701..c077b3d 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 4290e95..ee71bd0 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3ee=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','ioredis','../../config/environment','timeout','listen','port','socket.io','polling','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log'];(function(_0x3d7ebf,_0x20b6e8){var _0x3fe0d7=function(_0x2701bd){while(--_0x2701bd){_0x3d7ebf['push'](_0x3d7ebf['shift']());}};_0x3fe0d7(++_0x20b6e8);}(_0xe3ee,0x162));var _0xee3e=function(_0x54ff19,_0x5757f2){_0x54ff19=_0x54ff19-0x0;var _0x31fbac=_0xe3ee[_0x54ff19];return _0x31fbac;};'use strict';var _=require(_0xee3e('0x0'));var http=require(_0xee3e('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xee3e('0x2'));var config=require(_0xee3e('0x3'));var app=express();var server=http['createServer'](app);server[_0xee3e('0x4')]=0xdbba0;if(sticky[_0xee3e('0x5')](server,config[_0xee3e('0x6')])){var socketio=require(_0xee3e('0x7'))(server,{'transports':['websocket',_0xee3e('0x8')]});config[_0xee3e('0x9')]=_['defaults'](config[_0xee3e('0x9')],{'host':_0xee3e('0xa'),'port':0x18eb});socketio['adapter'](require(_0xee3e('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xee3e('0xc'))[_0xee3e('0xd')]();require(_0xee3e('0xe'))[_0xee3e('0xd')](socketio);require(_0xee3e('0xf'))[_0xee3e('0xd')](app);require(_0xee3e('0x10'))[_0xee3e('0xd')](app);}else{server[_0xee3e('0x11')](_0xee3e('0x12'),function(){console[_0xee3e('0x13')](_0xee3e('0x14'),config[_0xee3e('0x6')]);});}exports=module[_0xee3e('0x15')]=app; \ No newline at end of file +var _0x2b22=['exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log'];(function(_0x40ecb9,_0xd4cf49){var _0x300143=function(_0x110792){while(--_0x110792){_0x40ecb9['push'](_0x40ecb9['shift']());}};_0x300143(++_0xd4cf49);}(_0x2b22,0xb9));var _0x22b2=function(_0x2d3c82,_0x929c2f){_0x2d3c82=_0x2d3c82-0x0;var _0x3172ab=_0x2b22[_0x2d3c82];return _0x3172ab;};'use strict';var _=require(_0x22b2('0x0'));var http=require(_0x22b2('0x1'));var express=require('express');var sticky=require(_0x22b2('0x2'));var Redis=require(_0x22b2('0x3'));var config=require(_0x22b2('0x4'));var app=express();var server=http[_0x22b2('0x5')](app);server[_0x22b2('0x6')]=0xdbba0;if(sticky[_0x22b2('0x7')](server,config[_0x22b2('0x8')])){var socketio=require(_0x22b2('0x9'))(server,{'transports':[_0x22b2('0xa'),'polling']});config[_0x22b2('0xb')]=_[_0x22b2('0xc')](config[_0x22b2('0xb')],{'host':_0x22b2('0xd'),'port':0x18eb});socketio[_0x22b2('0xe')](require(_0x22b2('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x22b2('0xb')])}));require(_0x22b2('0x10'))[_0x22b2('0x11')]();require(_0x22b2('0x12'))['default'](socketio);require(_0x22b2('0x13'))[_0x22b2('0x11')](app);require(_0x22b2('0x14'))['default'](app);}else{server['once']('listening',function(){console[_0x22b2('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x22b2('0x8')]);});}exports=module[_0x22b2('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 41e684c..e2eee26 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69b9=['error','message','result','catch','exports','bluebird','client','http','Request','debug','rpc','routing'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x69b9,0xdd));var _0x969b=function(_0x4cbac4,_0xd048c9){_0x4cbac4=_0x4cbac4-0x0;var _0x49203b=_0x69b9[_0x4cbac4];return _0x49203b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x969b('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x969b('0x1')][_0x969b('0x2')]({'port':0x2329});client[_0x969b('0x3')]=function(_0x5649df,_0x2a2c76){return new BPromise(function(_0x385d11,_0x445832){return client['request'](_0x5649df,_0x2a2c76)['then'](function(_0x2426c6){logger[_0x969b('0x4')](_0x969b('0x5'),_0x969b('0x6'),_0x5649df,_0x2a2c76,_0x2426c6);if(_0x2426c6[_0x969b('0x7')]){logger['error']('rpc','routing',_0x5649df,_0x2426c6[_0x969b('0x7')]['message'],_0x2a2c76);return _0x445832(_0x2426c6[_0x969b('0x7')][_0x969b('0x8')]);}else{return _0x385d11(_0x2426c6[_0x969b('0x9')]);}})[_0x969b('0xa')](function(_0x2273de){logger[_0x969b('0x7')](_0x969b('0x5'),'routing',_0x5649df,_0x2273de,_0x2a2c76);return _0x445832(_0x2273de);});});};module[_0x969b('0xb')]=client; \ No newline at end of file +var _0x57a3=['result','catch','exports','jayson/promise','bluebird','client','http','Request','request','debug','rpc','routing','error','message'];(function(_0x13a900,_0x43b7be){var _0x5e613d=function(_0x5ccf09){while(--_0x5ccf09){_0x13a900['push'](_0x13a900['shift']());}};_0x5e613d(++_0x43b7be);}(_0x57a3,0x8f));var _0x357a=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x57a3[_0x3da832];return _0xe602f2;};'use strict';var jayson=require(_0x357a('0x0'));var BPromise=require(_0x357a('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x357a('0x2')][_0x357a('0x3')]({'port':0x2329});client[_0x357a('0x4')]=function(_0x27bc34,_0x5683aa){return new BPromise(function(_0x4afa8c,_0x23ab89){return client[_0x357a('0x5')](_0x27bc34,_0x5683aa)['then'](function(_0x41fb92){logger[_0x357a('0x6')](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x5683aa,_0x41fb92);if(_0x41fb92[_0x357a('0x9')]){logger['error'](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x41fb92['error'][_0x357a('0xa')],_0x5683aa);return _0x23ab89(_0x41fb92[_0x357a('0x9')][_0x357a('0xa')]);}else{return _0x4afa8c(_0x41fb92[_0x357a('0xb')]);}})[_0x357a('0xc')](function(_0x5c3482){logger[_0x357a('0x9')](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x5c3482,_0x5683aa);return _0x23ab89(_0x5c3482);});});};module[_0x357a('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 621e735..5312411 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa831=['listen','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','initAgents','then','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues'];(function(_0x24f18b,_0x71b965){var _0x290399=function(_0x1e126a){while(--_0x1e126a){_0x24f18b['push'](_0x24f18b['shift']());}};_0x290399(++_0x71b965);}(_0xa831,0x1dd));var _0x1a83=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0xa831[_0x5341ff];return _0x53be58;};'use strict';var BPromise=require(_0x1a83('0x0'));var server=require(_0x1a83('0x1'));var Realtime=require('./realtime');var user=require(_0x1a83('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x1a83('0x3'));var chatQueue=require(_0x1a83('0x4'));var smsQueue=require(_0x1a83('0x5'));var mailQueue=require(_0x1a83('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x1a83('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1a83('0x8')]()['then'](user['getAgents']())['then'](realtime[_0x1a83('0x9')]())[_0x1a83('0xa')](interval[_0x1a83('0xb')]())[_0x1a83('0xa')](realtime[_0x1a83('0xc')]())[_0x1a83('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x1a83('0xa')](realtime[_0x1a83('0xd')]())[_0x1a83('0xa')](chatQueue[_0x1a83('0xe')]())[_0x1a83('0xa')](realtime['initChatQueues']())[_0x1a83('0xa')](smsQueue[_0x1a83('0xf')]())[_0x1a83('0xa')](realtime[_0x1a83('0x10')]())[_0x1a83('0xa')](mailQueue[_0x1a83('0x11')]())[_0x1a83('0xa')](realtime[_0x1a83('0x12')]())['then'](faxQueue[_0x1a83('0x13')]())[_0x1a83('0xa')](realtime[_0x1a83('0x14')]())[_0x1a83('0xa')](whatsappQueue[_0x1a83('0x15')]())[_0x1a83('0xa')](realtime[_0x1a83('0x16')]())[_0x1a83('0xa')](function(){return realtime;});}function main(){return server[_0x1a83('0x17')](realtime)[_0x1a83('0xa')](function(_0xe03227){return initRealtime();})['then'](function(_0x17b502){return setInterval(initRealtime,0x1388);})['catch'](function(_0x38a8f6){console[_0x1a83('0x18')](_0x38a8f6);});}main(); \ No newline at end of file +var _0xe507=['bluebird','./server','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','catch'];(function(_0x2f48a7,_0x54ea3c){var _0x3546f6=function(_0x2323d4){while(--_0x2323d4){_0x2f48a7['push'](_0x2f48a7['shift']());}};_0x3546f6(++_0x54ea3c);}(_0xe507,0x13b));var _0x7e50=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0xe507[_0x120bc2];return _0x454a41;};'use strict';var BPromise=require(_0x7e50('0x0'));var server=require(_0x7e50('0x1'));var Realtime=require(_0x7e50('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x7e50('0x3'));var chatQueue=require(_0x7e50('0x4'));var smsQueue=require(_0x7e50('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x7e50('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7e50('0x7')]()[_0x7e50('0x8')](user[_0x7e50('0x9')]())[_0x7e50('0x8')](realtime[_0x7e50('0xa')]())[_0x7e50('0x8')](interval[_0x7e50('0xb')]())[_0x7e50('0x8')](realtime['initIntervals']())[_0x7e50('0x8')](openchannelQueue[_0x7e50('0xc')]())[_0x7e50('0x8')](realtime[_0x7e50('0xd')]())[_0x7e50('0x8')](chatQueue[_0x7e50('0xe')]())[_0x7e50('0x8')](realtime['initChatQueues']())[_0x7e50('0x8')](smsQueue[_0x7e50('0xf')]())[_0x7e50('0x8')](realtime['initSmsQueues']())[_0x7e50('0x8')](mailQueue[_0x7e50('0x10')]())[_0x7e50('0x8')](realtime[_0x7e50('0x11')]())[_0x7e50('0x8')](faxQueue['getFaxQueues']())[_0x7e50('0x8')](realtime[_0x7e50('0x12')]())[_0x7e50('0x8')](whatsappQueue['getWhatsappQueues']())[_0x7e50('0x8')](realtime[_0x7e50('0x13')]())[_0x7e50('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7e50('0x8')](function(_0x469e14){return initRealtime();})[_0x7e50('0x8')](function(_0x20724d){return setInterval(initRealtime,0x1388);})[_0x7e50('0x14')](function(_0x331fb8){console['log'](_0x331fb8);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 7806996..fcd8285 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x399719,_0x232b0f){var _0x1bd3e9=function(_0x2fad56){while(--_0x2fad56){_0x399719['push'](_0x399719['shift']());}};_0x1bd3e9(++_0x232b0f);}(_0x326f,0xd1));var _0xf326=function(_0x4f4484,_0x28dc23){_0x4f4484=_0x4f4484-0x0;var _0x3a3bb1=_0x326f[_0x4f4484];return _0x3a3bb1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5aadc2,_0x3ff7c1){var _0x1c2d03=function(_0x55ffab){while(--_0x55ffab){_0x5aadc2['push'](_0x5aadc2['shift']());}};_0x1c2d03(++_0x3ff7c1);}(_0x814b,0x1a2));var _0xb814=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x814b[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 61a0b28..8e4d76d 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e57=['error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','request','then'];(function(_0x3a4397,_0x13e650){var _0x1a8c44=function(_0x46713f){while(--_0x46713f){_0x3a4397['push'](_0x3a4397['shift']());}};_0x1a8c44(++_0x13e650);}(_0x0e57,0x95));var _0x70e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e57[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x70e5('0x0'));var jayson=require(_0x70e5('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x5c563c,_0x5c9eea){return new BPromise(function(_0x2830ae,_0x2e7193){return client[_0x70e5('0x2')](_0x5c563c,_0x5c9eea)[_0x70e5('0x3')](function(_0x434ad5){if(_0x434ad5[_0x70e5('0x4')]){return _0x2e7193(_0x434ad5[_0x70e5('0x4')]['message']);}else{return _0x2830ae(_0x434ad5[_0x70e5('0x5')]);}})[_0x70e5('0x6')](function(_0x3b5719){return _0x2e7193(_0x3b5719);});});}exports[_0x70e5('0x7')]=function(_0x3798e1,_0x3afe11){return request(_0x70e5('0x8'),{'account':_0x3798e1,'message':_0x3afe11});}; \ No newline at end of file +var _0x8b19=['jayson/promise','client','http','request','then','error','message','result','sendMailMessage','SendMail','bluebird'];(function(_0x311bc7,_0x390f57){var _0x3ec959=function(_0x415275){while(--_0x415275){_0x311bc7['push'](_0x311bc7['shift']());}};_0x3ec959(++_0x390f57);}(_0x8b19,0x149));var _0x98b1=function(_0x4e866b,_0x519cb0){_0x4e866b=_0x4e866b-0x0;var _0x32eddd=_0x8b19[_0x4e866b];return _0x32eddd;};'use strict';var BPromise=require(_0x98b1('0x0'));var jayson=require(_0x98b1('0x1'));var client=jayson[_0x98b1('0x2')][_0x98b1('0x3')]({'port':0x232b});function request(_0x2f0eb5,_0x39c810){return new BPromise(function(_0x23d73c,_0x510b77){return client[_0x98b1('0x4')](_0x2f0eb5,_0x39c810)[_0x98b1('0x5')](function(_0x1f288e){if(_0x1f288e[_0x98b1('0x6')]){return _0x510b77(_0x1f288e[_0x98b1('0x6')][_0x98b1('0x7')]);}else{return _0x23d73c(_0x1f288e[_0x98b1('0x8')]);}})['catch'](function(_0x21de65){return _0x510b77(_0x21de65);});});}exports[_0x98b1('0x9')]=function(_0x44a40a,_0x1811c6){return request(_0x98b1('0xa'),{'account':_0x44a40a,'message':_0x1811c6});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index fd3e5d2..70a9cd4 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x654b=['mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','Status','toNumber','chatStatus','chatStatusTime','chatCapacity','emit','user:save','exports','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity'];(function(_0xe2057,_0x90980){var _0x25f2ed=function(_0x1185ce){while(--_0x1185ce){_0xe2057['push'](_0xe2057['shift']());}};_0x25f2ed(++_0x90980);}(_0x654b,0xa9));var _0xb654=function(_0x55ff21,_0x1540f0){_0x55ff21=_0x55ff21-0x0;var _0x4baf37=_0x654b[_0x55ff21];return _0x4baf37;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xb654('0x0')](config[_0xb654('0x1')],{'host':_0xb654('0x2'),'port':0x18eb});var io=require(_0xb654('0x3'))(new Redis(config[_0xb654('0x1')]));function Agent(_0x56760a){this['id']=_0x56760a['id']||0x0;this[_0xb654('0x4')]=_0x56760a[_0xb654('0x4')]||'';this[_0xb654('0x5')]=_0x56760a['online']||!![];this[_0xb654('0x6')]=_0x56760a[_0xb654('0x6')]||![];this['chatPause']=_0x56760a[_0xb654('0x7')]||![];this[_0xb654('0x8')]=_0x56760a[_0xb654('0x8')]||![];this[_0xb654('0x9')]=_0x56760a[_0xb654('0x9')]||![];this[_0xb654('0xa')]=_0x56760a[_0xb654('0xa')]||![];this[_0xb654('0xb')]=_0x56760a[_0xb654('0xb')]||![];this['chatStatus']=_0xb654('0xc');this['chatStatusTime']=0x0;this['chatCapacity']=_0x56760a['chatCapacity']||0x0;this[_0xb654('0xd')]=0x0;this[_0xb654('0xe')]='unknown';this[_0xb654('0xf')]=0x0;this[_0xb654('0x10')]=_0x56760a[_0xb654('0x10')]||0x0;this[_0xb654('0x11')]=0x0;this[_0xb654('0x12')]=_0xb654('0xc');this[_0xb654('0x13')]=0x0;this[_0xb654('0x14')]=_0x56760a[_0xb654('0x14')]||0x0;this[_0xb654('0x15')]=0x0;this[_0xb654('0x16')]=_0xb654('0xc');this[_0xb654('0x17')]=0x0;this['smsCapacity']=_0x56760a[_0xb654('0x18')]||0x0;this[_0xb654('0x19')]=0x0;this[_0xb654('0x1a')]=_0xb654('0xc');this[_0xb654('0x1b')]=0x0;this[_0xb654('0x1c')]=_0x56760a['whatsappCapacity']||0x0;this[_0xb654('0x1d')]=0x0;this[_0xb654('0x1e')]=_0xb654('0xc');this[_0xb654('0x1f')]=0x0;this['openchannelCapacity']=_0x56760a[_0xb654('0x20')]||0x0;this[_0xb654('0x21')]=0x0;this[_0xb654('0x22')]=![];this[_0xb654('0x23')]=undefined;this[_0xb654('0x24')]='';this[_0xb654('0x25')]={};this[_0xb654('0x26')]={};this[_0xb654('0x27')]={};this[_0xb654('0x28')]={};this['smsWaitingInteractions']={};this[_0xb654('0x29')]={};this[_0xb654('0x2a')]();}Agent[_0xb654('0x2b')][_0xb654('0x2c')]=function(_0x4ef248){if(this[_0x4ef248+'CurrentCapacity']>0x0){if(this[_0x4ef248+_0xb654('0x2d')]>0x0&&this[_0x4ef248+'CurrentCapacity']>=this[_0x4ef248+'Capacity']){return _0xb654('0x2e');}else{return _0xb654('0x2f');}}else{return _0xb654('0x30');}};Agent['prototype'][_0xb654('0x2a')]=function(){var _0x550973=[_0xb654('0x31'),_0xb654('0x32'),'openchannel',_0xb654('0x33'),_0xb654('0x34'),_0xb654('0x35')];for(var _0x3a4d22=0x0;_0x3a4d22<_0x550973['length'];_0x3a4d22+=0x1){var _0x4acaaa=this[_0xb654('0x2c')](_0x550973[_0x3a4d22]);if(this[_0x550973[_0x3a4d22]+_0xb654('0x36')]!==_0x4acaaa){this[_0x550973[_0x3a4d22]+'StatusTime']=_[_0xb654('0x37')](moment()['format']('x'));}this[_0x550973[_0x3a4d22]+_0xb654('0x36')]=_0x4acaaa;}var _0x39044d={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xb654('0x6')],'chatPause':this[_0xb654('0x7')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xb654('0x9')],'openchannelPause':this[_0xb654('0xb')],'chatStatus':this[_0xb654('0x38')],'chatStatusTime':this[_0xb654('0x39')],'chatCapacity':this[_0xb654('0x3a')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xb654('0xe')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xb654('0x10')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xb654('0x13')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xb654('0x15')],'smsStatus':this[_0xb654('0x16')],'smsStatusTime':this[_0xb654('0x17')],'smsCapacity':this[_0xb654('0x18')],'smsCurrentCapacity':this[_0xb654('0x19')],'whatsappStatus':this[_0xb654('0x1a')],'whatsappStatusTime':this[_0xb654('0x1b')],'whatsappCapacity':this[_0xb654('0x1c')],'whatsappCurrentCapacity':this[_0xb654('0x1d')],'openchannelStatus':this[_0xb654('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xb654('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xb654('0x22')],'busyQueue':this[_0xb654('0x23')],'chatWaitingInteractions':this[_0xb654('0x25')],'faxWaitingInteractions':this[_0xb654('0x26')],'mailWaitingInteractions':this[_0xb654('0x27')],'openchannelWaitingInteractions':this[_0xb654('0x28')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xb654('0x29')]};var _0x3032cc=md5(JSON['stringify'](_0x39044d));if(this['md5']!==_0x3032cc){this[_0xb654('0x24')]=_0x3032cc;io[_0xb654('0x3b')](_0xb654('0x3c'),_0x39044d);}};module[_0xb654('0x3d')]=Agent; \ No newline at end of file +var _0x15d5=['mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','chatCurrentCapacity','mailCurrentCapacity','faxStatusTime','whatsappStatus','whatsappCurrentCapacity','mailWaitingInteractions','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x15d5,0xbe));var _0x515d=function(_0xd51a95,_0x24d8dc){_0xd51a95=_0xd51a95-0x0;var _0x1634be=_0x15d5[_0xd51a95];return _0x1634be;};'use strict';var _=require(_0x515d('0x0'));var moment=require(_0x515d('0x1'));var md5=require(_0x515d('0x2'));var Redis=require(_0x515d('0x3'));var config=require(_0x515d('0x4'));config[_0x515d('0x5')]=_[_0x515d('0x6')](config[_0x515d('0x5')],{'host':_0x515d('0x7'),'port':0x18eb});var io=require(_0x515d('0x8'))(new Redis(config[_0x515d('0x5')]));function Agent(_0x1c04e){this['id']=_0x1c04e['id']||0x0;this[_0x515d('0x9')]=_0x1c04e[_0x515d('0x9')]||'';this[_0x515d('0xa')]=_0x1c04e[_0x515d('0xa')]||!![];this[_0x515d('0xb')]=_0x1c04e[_0x515d('0xb')]||![];this[_0x515d('0xc')]=_0x1c04e[_0x515d('0xc')]||![];this['mailPause']=_0x1c04e['mailPause']||![];this['faxPause']=_0x1c04e[_0x515d('0xd')]||![];this[_0x515d('0xe')]=_0x1c04e[_0x515d('0xe')]||![];this['openchannelPause']=_0x1c04e[_0x515d('0xf')]||![];this[_0x515d('0x10')]=_0x515d('0x11');this[_0x515d('0x12')]=0x0;this[_0x515d('0x13')]=_0x1c04e[_0x515d('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x515d('0x14')]=_0x515d('0x11');this[_0x515d('0x15')]=0x0;this[_0x515d('0x16')]=_0x1c04e[_0x515d('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x515d('0x17')]=_0x515d('0x11');this['faxStatusTime']=0x0;this[_0x515d('0x18')]=_0x1c04e[_0x515d('0x18')]||0x0;this[_0x515d('0x19')]=0x0;this[_0x515d('0x1a')]=_0x515d('0x11');this[_0x515d('0x1b')]=0x0;this[_0x515d('0x1c')]=_0x1c04e[_0x515d('0x1c')]||0x0;this[_0x515d('0x1d')]=0x0;this['whatsappStatus']=_0x515d('0x11');this[_0x515d('0x1e')]=0x0;this[_0x515d('0x1f')]=_0x1c04e[_0x515d('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x515d('0x20')]=_0x515d('0x11');this[_0x515d('0x21')]=0x0;this[_0x515d('0x22')]=_0x1c04e[_0x515d('0x22')]||0x0;this[_0x515d('0x23')]=0x0;this[_0x515d('0x24')]=![];this[_0x515d('0x25')]=undefined;this['md5']='';this[_0x515d('0x26')]={};this[_0x515d('0x27')]={};this['mailWaitingInteractions']={};this[_0x515d('0x28')]={};this[_0x515d('0x29')]={};this[_0x515d('0x2a')]={};this[_0x515d('0x2b')]();}Agent[_0x515d('0x2c')][_0x515d('0x2d')]=function(_0x5f4d95){if(this[_0x5f4d95+'CurrentCapacity']>0x0){if(this[_0x5f4d95+_0x515d('0x2e')]>0x0&&this[_0x5f4d95+_0x515d('0x2f')]>=this[_0x5f4d95+'Capacity']){return _0x515d('0x30');}else{return _0x515d('0x31');}}else{return _0x515d('0x32');}};Agent[_0x515d('0x2c')]['updateRealtime']=function(){var _0x1cb960=[_0x515d('0x33'),_0x515d('0x34'),'openchannel',_0x515d('0x35'),_0x515d('0x36'),_0x515d('0x37')];for(var _0x321454=0x0;_0x321454<_0x1cb960[_0x515d('0x38')];_0x321454+=0x1){var _0xafbfd7=this[_0x515d('0x2d')](_0x1cb960[_0x321454]);if(this[_0x1cb960[_0x321454]+_0x515d('0x39')]!==_0xafbfd7){this[_0x1cb960[_0x321454]+_0x515d('0x3a')]=_[_0x515d('0x3b')](moment()[_0x515d('0x3c')]('x'));}this[_0x1cb960[_0x321454]+_0x515d('0x39')]=_0xafbfd7;}var _0x108217={'id':this['id'],'name':this[_0x515d('0x9')],'online':this[_0x515d('0xa')],'voicePause':this[_0x515d('0xb')],'chatPause':this[_0x515d('0xc')],'mailPause':this[_0x515d('0x3d')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x515d('0xf')],'chatStatus':this[_0x515d('0x10')],'chatStatusTime':this[_0x515d('0x12')],'chatCapacity':this[_0x515d('0x13')],'chatCurrentCapacity':this[_0x515d('0x3e')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x515d('0x15')],'mailCapacity':this[_0x515d('0x16')],'mailCurrentCapacity':this[_0x515d('0x3f')],'faxStatus':this[_0x515d('0x17')],'faxStatusTime':this[_0x515d('0x40')],'faxCapacity':this[_0x515d('0x18')],'faxCurrentCapacity':this[_0x515d('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x515d('0x1b')],'smsCapacity':this[_0x515d('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x515d('0x41')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x515d('0x1f')],'whatsappCurrentCapacity':this[_0x515d('0x42')],'openchannelStatus':this[_0x515d('0x20')],'openchannelStatusTime':this[_0x515d('0x21')],'openchannelCapacity':this[_0x515d('0x22')],'openchannelCurrentCapacity':this[_0x515d('0x23')],'busy':this[_0x515d('0x24')],'busyQueue':this[_0x515d('0x25')],'chatWaitingInteractions':this[_0x515d('0x26')],'faxWaitingInteractions':this[_0x515d('0x27')],'mailWaitingInteractions':this[_0x515d('0x43')],'openchannelWaitingInteractions':this[_0x515d('0x28')],'smsWaitingInteractions':this[_0x515d('0x29')],'whatsappWaitingInteractions':this[_0x515d('0x2a')]};var _0xec0968=md5(JSON['stringify'](_0x108217));if(this[_0x515d('0x2')]!==_0xec0968){this[_0x515d('0x2')]=_0xec0968;io[_0x515d('0x44')](_0x515d('0x45'),_0x108217);}};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 b20164c..d7f2313 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 _0xe0d1=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0xb4d947,_0x16b719){var _0x8c85d0=function(_0x2cb6fc){while(--_0x2cb6fc){_0xb4d947['push'](_0xb4d947['shift']());}};_0x8c85d0(++_0x16b719);}(_0xe0d1,0x14b));var _0x1e0d=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xe0d1[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0x1e0d('0x0'));var md5=require(_0x1e0d('0x1'));var util=require(_0x1e0d('0x2'));var Redis=require('ioredis');var config=require(_0x1e0d('0x3'));config[_0x1e0d('0x4')]=_['defaults'](config['redis'],{'host':_0x1e0d('0x5'),'port':0x18eb});var io=require(_0x1e0d('0x6'))(new Redis(config[_0x1e0d('0x4')]));function ChatQueue(_0xb604bb){this['id']=_0xb604bb['id']||0x0;this['name']=_0xb604bb[_0x1e0d('0x7')]||'';this['timeout']=_0xb604bb[_0x1e0d('0x8')]||0xa;this[_0x1e0d('0x9')]=_0xb604bb[_0x1e0d('0x9')]||'beepall';this[_0x1e0d('0xa')]=_0xb604bb[_0x1e0d('0xa')];this[_0x1e0d('0xb')]={};this[_0x1e0d('0xc')]=0x0;this[_0x1e0d('0x1')]='';this[_0x1e0d('0xd')]();this[_0x1e0d('0xe')]();}ChatQueue[_0x1e0d('0xf')][_0x1e0d('0xd')]=function(){var _0x267b41=this[_0x1e0d('0xb')][_0x1e0d('0x10')];this[_0x1e0d('0xb')]=_[_0x1e0d('0x11')](this[_0x1e0d('0xa')],'id');this['mapAgentsId'][_0x1e0d('0x10')]=_0x267b41;};ChatQueue['prototype'][_0x1e0d('0xe')]=function(){this[_0x1e0d('0x12')]=0x0;this[_0x1e0d('0x13')]=0x0;for(var _0x1bfbf9=0x0;_0x1bfbf9=0x0?this[_0x1e0d('0x16')]:0x0;var _0x4742c7={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1e0d('0x12')],'name':this[_0x1e0d('0x7')],'paused':this[_0x1e0d('0x13')],'waiting':this[_0x1e0d('0xc')]};var _0x1782d6=md5(JSON[_0x1e0d('0x17')](_0x4742c7));if(this[_0x1e0d('0x1')]!==_0x1782d6){this['md5']=_0x1782d6;io['to'](util[_0x1e0d('0x18')](_0x1e0d('0x19'),_0x4742c7['name']))[_0x1e0d('0x1a')]('chat_queue:save',_0x4742c7);}};module[_0x1e0d('0x1b')]=ChatQueue; \ No newline at end of file +var _0x1123=['map','paused','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','_rr','mapAgentsId'];(function(_0x8d065b,_0x4c6115){var _0x1244e3=function(_0x2555ff){while(--_0x2555ff){_0x8d065b['push'](_0x8d065b['shift']());}};_0x1244e3(++_0x4c6115);}(_0x1123,0xe3));var _0x3112=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1123[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var md5=require(_0x3112('0x0'));var util=require(_0x3112('0x1'));var Redis=require(_0x3112('0x2'));var config=require('../../../config/environment');config[_0x3112('0x3')]=_[_0x3112('0x4')](config[_0x3112('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x3112('0x5'))(new Redis(config[_0x3112('0x3')]));function ChatQueue(_0x5e3df6){this['id']=_0x5e3df6['id']||0x0;this['name']=_0x5e3df6[_0x3112('0x6')]||'';this[_0x3112('0x7')]=_0x5e3df6[_0x3112('0x7')]||0xa;this[_0x3112('0x8')]=_0x5e3df6[_0x3112('0x8')]||_0x3112('0x9');this['Agents']=_0x5e3df6[_0x3112('0xa')];this['mapAgentsId']={};this[_0x3112('0xb')]=0x0;this[_0x3112('0x0')]='';this['updateRouting']();this[_0x3112('0xc')]();}ChatQueue[_0x3112('0xd')]['updateRouting']=function(){var _0x3db583=this['mapAgentsId'][_0x3112('0xe')];this[_0x3112('0xf')]=_[_0x3112('0x10')](this['Agents'],'id');this[_0x3112('0xf')][_0x3112('0xe')]=_0x3db583;};ChatQueue[_0x3112('0xd')][_0x3112('0xc')]=function(){this['loggedIn']=0x0;this[_0x3112('0x11')]=0x0;for(var _0x122b00=0x0;_0x122b00=0x0?this[_0x3112('0x15')]:0x0;var _0x37419c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3112('0x13')],'name':this[_0x3112('0x6')],'paused':this[_0x3112('0x11')],'waiting':this[_0x3112('0xb')]};var _0x4bc59e=md5(JSON[_0x3112('0x16')](_0x37419c));if(this[_0x3112('0x0')]!==_0x4bc59e){this[_0x3112('0x0')]=_0x4bc59e;io['to'](util[_0x3112('0x17')](_0x3112('0x18'),_0x37419c[_0x3112('0x6')]))['emit'](_0x3112('0x19'),_0x37419c);}};module[_0x3112('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1264e28..be69765 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 _0xa865=['exports','lodash','md5','util','ioredis','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','loggedIn','length','online','paused','available','stringify','format','emit','fax_queue:save'];(function(_0x24ac51,_0x2145ba){var _0x13a5fe=function(_0x402e80){while(--_0x402e80){_0x24ac51['push'](_0x24ac51['shift']());}};_0x13a5fe(++_0x2145ba);}(_0xa865,0x97));var _0x5a86=function(_0x230c9f,_0x22831f){_0x230c9f=_0x230c9f-0x0;var _0x288a9c=_0xa865[_0x230c9f];return _0x288a9c;};'use strict';var _=require(_0x5a86('0x0'));var md5=require(_0x5a86('0x1'));var util=require(_0x5a86('0x2'));var Redis=require(_0x5a86('0x3'));var config=require('../../../config/environment');config[_0x5a86('0x4')]=_[_0x5a86('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5a86('0x4')]));function FaxQueue(_0x1ac3f0){this['id']=_0x1ac3f0['id']||0x0;this[_0x5a86('0x6')]=_0x1ac3f0[_0x5a86('0x6')]||'';this[_0x5a86('0x7')]=_0x1ac3f0[_0x5a86('0x7')]||0xa;this[_0x5a86('0x8')]=_0x1ac3f0[_0x5a86('0x8')]||'beepall';this[_0x5a86('0x9')]=_0x1ac3f0[_0x5a86('0x9')];this[_0x5a86('0xa')]={};this[_0x5a86('0xb')]=0x0;this[_0x5a86('0x1')]='';this[_0x5a86('0xc')]();this['updateRealtime']();}FaxQueue[_0x5a86('0xd')][_0x5a86('0xc')]=function(){var _0x114587=this[_0x5a86('0xa')]['_rr'];this[_0x5a86('0xa')]=_[_0x5a86('0xe')](this[_0x5a86('0x9')],'id');this[_0x5a86('0xa')]['_rr']=_0x114587;};FaxQueue[_0x5a86('0xd')]['updateRealtime']=function(){this[_0x5a86('0xf')]=0x0;this['paused']=0x0;for(var _0x4795f7=0x0;_0x4795f7=0x0?this[_0x5a86('0x13')]:0x0;var _0x5c6093={'id':this['id'],'available':this[_0x5a86('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x5a86('0x6')],'paused':this[_0x5a86('0x12')],'waiting':this['waiting']};var _0xcd9542=md5(JSON[_0x5a86('0x14')](_0x5c6093));if(this[_0x5a86('0x1')]!==_0xcd9542){this[_0x5a86('0x1')]=_0xcd9542;io['to'](util[_0x5a86('0x15')]('fax:queue:%s',_0x5c6093[_0x5a86('0x6')]))[_0x5a86('0x16')](_0x5a86('0x17'),_0x5c6093);}};module[_0x5a86('0x18')]=FaxQueue; \ No newline at end of file +var _0xc275=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','faxPause','available','loggedIn','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc275,0x8d));var _0x5c27=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc275[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5c27('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5c27('0x1'));var config=require(_0x5c27('0x2'));config[_0x5c27('0x3')]=_['defaults'](config['redis'],{'host':_0x5c27('0x4'),'port':0x18eb});var io=require(_0x5c27('0x5'))(new Redis(config['redis']));function FaxQueue(_0x559f7d){this['id']=_0x559f7d['id']||0x0;this[_0x5c27('0x6')]=_0x559f7d[_0x5c27('0x6')]||'';this[_0x5c27('0x7')]=_0x559f7d[_0x5c27('0x7')]||0xa;this[_0x5c27('0x8')]=_0x559f7d[_0x5c27('0x8')]||_0x5c27('0x9');this[_0x5c27('0xa')]=_0x559f7d['Agents'];this[_0x5c27('0xb')]={};this[_0x5c27('0xc')]=0x0;this['md5']='';this[_0x5c27('0xd')]();this[_0x5c27('0xe')]();}FaxQueue[_0x5c27('0xf')][_0x5c27('0xd')]=function(){var _0x2e23a7=this[_0x5c27('0xb')][_0x5c27('0x10')];this[_0x5c27('0xb')]=_[_0x5c27('0x11')](this[_0x5c27('0xa')],'id');this[_0x5c27('0xb')][_0x5c27('0x10')]=_0x2e23a7;};FaxQueue['prototype'][_0x5c27('0xe')]=function(){this['loggedIn']=0x0;this[_0x5c27('0x12')]=0x0;for(var _0x40c646=0x0;_0x40c646=0x0?this['available']:0x0;var _0x46340d={'id':this['id'],'available':this[_0x5c27('0x16')],'loggedIn':this[_0x5c27('0x17')],'name':this[_0x5c27('0x6')],'paused':this['paused'],'waiting':this[_0x5c27('0xc')]};var _0x1b2a5b=md5(JSON[_0x5c27('0x18')](_0x46340d));if(this[_0x5c27('0x19')]!==_0x1b2a5b){this[_0x5c27('0x19')]=_0x1b2a5b;io['to'](util[_0x5c27('0x1a')](_0x5c27('0x1b'),_0x46340d['name']))[_0x5c27('0x1c')](_0x5c27('0x1d'),_0x46340d);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9630dfb..eb3830a 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 _0x8979=['name','Intervals','exports'];(function(_0x247a5e,_0x40b75d){var _0x16e004=function(_0x4e38c7){while(--_0x4e38c7){_0x247a5e['push'](_0x247a5e['shift']());}};_0x16e004(++_0x40b75d);}(_0x8979,0x123));var _0x9897=function(_0x472772,_0x2ed865){_0x472772=_0x472772-0x0;var _0x551db8=_0x8979[_0x472772];return _0x551db8;};'use strict';function Interval(_0xbbb9e1){this['id']=_0xbbb9e1['id']||0x0;this[_0x9897('0x0')]=_0xbbb9e1[_0x9897('0x0')]||'';this['Intervals']=_0xbbb9e1[_0x9897('0x1')]||{};}module[_0x9897('0x2')]=Interval; \ No newline at end of file +var _0xcd2d=['exports','name','Intervals'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xcd2d,0xf7));var _0xdcd2=function(_0x5a6594,_0xefbdf5){_0x5a6594=_0x5a6594-0x0;var _0x1eddce=_0xcd2d[_0x5a6594];return _0x1eddce;};'use strict';function Interval(_0x4e4e19){this['id']=_0x4e4e19['id']||0x0;this[_0xdcd2('0x0')]=_0x4e4e19['name']||'';this['Intervals']=_0x4e4e19[_0xdcd2('0x1')]||{};}module[_0xdcd2('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 e0d567b..fa0d7d0 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 _0x088b=['waiting','updateRouting','updateRealtime','map','_rr','loggedIn','online','mailPause','available','stringify','format','emit','mail_queue:save','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x485c5b,_0x3bdac4){var _0x5798c7=function(_0x346001){while(--_0x346001){_0x485c5b['push'](_0x485c5b['shift']());}};_0x5798c7(++_0x3bdac4);}(_0x088b,0xa9));var _0xb088=function(_0x48bc0d,_0x30becd){_0x48bc0d=_0x48bc0d-0x0;var _0x35f641=_0x088b[_0x48bc0d];return _0x35f641;};'use strict';var _=require('lodash');var md5=require(_0xb088('0x0'));var util=require('util');var Redis=require(_0xb088('0x1'));var config=require(_0xb088('0x2'));config[_0xb088('0x3')]=_[_0xb088('0x4')](config[_0xb088('0x3')],{'host':_0xb088('0x5'),'port':0x18eb});var io=require(_0xb088('0x6'))(new Redis(config[_0xb088('0x3')]));function MailQueue(_0x562cb2){this['id']=_0x562cb2['id']||0x0;this[_0xb088('0x7')]=_0x562cb2[_0xb088('0x7')]||'';this[_0xb088('0x8')]=_0x562cb2['timeout']||0xa;this[_0xb088('0x9')]=_0x562cb2[_0xb088('0x9')]||_0xb088('0xa');this[_0xb088('0xb')]=_0x562cb2[_0xb088('0xb')];this[_0xb088('0xc')]={};this[_0xb088('0xd')]=0x0;this[_0xb088('0x0')]='';this[_0xb088('0xe')]();this[_0xb088('0xf')]();}MailQueue['prototype'][_0xb088('0xe')]=function(){var _0x47fd3c=this[_0xb088('0xc')]['_rr'];this['mapAgentsId']=_[_0xb088('0x10')](this['Agents'],'id');this['mapAgentsId'][_0xb088('0x11')]=_0x47fd3c;};MailQueue['prototype'][_0xb088('0xf')]=function(){this[_0xb088('0x12')]=0x0;this['paused']=0x0;for(var _0x5a8b1b=0x0;_0x5a8b1b=0x0?this[_0xb088('0x15')]:0x0;var _0x3d46ab={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb088('0x12')],'name':this[_0xb088('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0xcb4768=md5(JSON[_0xb088('0x16')](_0x3d46ab));if(this[_0xb088('0x0')]!==_0xcb4768){this[_0xb088('0x0')]=_0xcb4768;io['to'](util[_0xb088('0x17')]('mail:queue:%s',_0x3d46ab[_0xb088('0x7')]))[_0xb088('0x18')](_0xb088('0x19'),_0x3d46ab);}};module['exports']=MailQueue; \ No newline at end of file +var _0x367b=['updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x935478,_0x7f6768){var _0x3972d9=function(_0x176d5d){while(--_0x176d5d){_0x935478['push'](_0x935478['shift']());}};_0x3972d9(++_0x7f6768);}(_0x367b,0x128));var _0xb367=function(_0x57771b,_0x382386){_0x57771b=_0x57771b-0x0;var _0x3b4571=_0x367b[_0x57771b];return _0x3b4571;};'use strict';var _=require(_0xb367('0x0'));var md5=require(_0xb367('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xb367('0x2'));config[_0xb367('0x3')]=_['defaults'](config['redis'],{'host':_0xb367('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb367('0x3')]));function MailQueue(_0x34c890){this['id']=_0x34c890['id']||0x0;this[_0xb367('0x5')]=_0x34c890['name']||'';this[_0xb367('0x6')]=_0x34c890[_0xb367('0x6')]||0xa;this[_0xb367('0x7')]=_0x34c890[_0xb367('0x7')]||_0xb367('0x8');this[_0xb367('0x9')]=_0x34c890['Agents'];this[_0xb367('0xa')]={};this[_0xb367('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xb367('0xc')]();}MailQueue['prototype'][_0xb367('0xd')]=function(){var _0x36a2b7=this[_0xb367('0xa')][_0xb367('0xe')];this[_0xb367('0xa')]=_['map'](this[_0xb367('0x9')],'id');this[_0xb367('0xa')][_0xb367('0xe')]=_0x36a2b7;};MailQueue[_0xb367('0xf')]['updateRealtime']=function(){this[_0xb367('0x10')]=0x0;this[_0xb367('0x11')]=0x0;for(var _0x554dbf=0x0;_0x554dbf=0x0?this[_0xb367('0x15')]:0x0;var _0x5df47e={'id':this['id'],'available':this[_0xb367('0x15')],'loggedIn':this[_0xb367('0x10')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb367('0xb')]};var _0x3e8e55=md5(JSON[_0xb367('0x16')](_0x5df47e));if(this['md5']!==_0x3e8e55){this[_0xb367('0x1')]=_0x3e8e55;io['to'](util[_0xb367('0x17')](_0xb367('0x18'),_0x5df47e[_0xb367('0x5')]))[_0xb367('0x19')](_0xb367('0x1a'),_0x5df47e);}};module[_0xb367('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index bdcff38..93f440d 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x326f,0xd1));var _0xf326=function(_0x4003e9,_0x23d01b){_0x4003e9=_0x4003e9-0x0;var _0x2243b6=_0x326f[_0x4003e9];return _0x2243b6;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 2f99397..89f8c62 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 _0xe739=['sms_queue:save','lodash','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','loggedIn','paused','length','smsPause','available','stringify','md5','format'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xe739,0x105));var _0x9e73=function(_0x4955c0,_0x328ba4){_0x4955c0=_0x4955c0-0x0;var _0x3d26eb=_0xe739[_0x4955c0];return _0x3d26eb;};'use strict';var _=require(_0x9e73('0x0'));var md5=require('md5');var util=require(_0x9e73('0x1'));var Redis=require(_0x9e73('0x2'));var config=require(_0x9e73('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x9e73('0x4'),'port':0x18eb});var io=require(_0x9e73('0x5'))(new Redis(config[_0x9e73('0x6')]));function SmsQueue(_0x2b0acc){this['id']=_0x2b0acc['id']||0x0;this['name']=_0x2b0acc[_0x9e73('0x7')]||'';this[_0x9e73('0x8')]=_0x2b0acc[_0x9e73('0x8')]||0xa;this['strategy']=_0x2b0acc[_0x9e73('0x9')]||_0x9e73('0xa');this[_0x9e73('0xb')]=_0x2b0acc[_0x9e73('0xb')];this[_0x9e73('0xc')]={};this[_0x9e73('0xd')]=0x0;this['md5']='';this[_0x9e73('0xe')]();this['updateRealtime']();}SmsQueue['prototype'][_0x9e73('0xe')]=function(){var _0x530e27=this[_0x9e73('0xc')][_0x9e73('0xf')];this[_0x9e73('0xc')]=_['map'](this[_0x9e73('0xb')],'id');this[_0x9e73('0xc')][_0x9e73('0xf')]=_0x530e27;};SmsQueue[_0x9e73('0x10')]['updateRealtime']=function(){this[_0x9e73('0x11')]=0x0;this[_0x9e73('0x12')]=0x0;for(var _0x3a7bd5=0x0;_0x3a7bd5=0x0?this['available']:0x0;var _0x4dabb2={'id':this['id'],'available':this[_0x9e73('0x15')],'loggedIn':this[_0x9e73('0x11')],'name':this[_0x9e73('0x7')],'paused':this[_0x9e73('0x12')],'waiting':this[_0x9e73('0xd')]};var _0x398a0d=md5(JSON[_0x9e73('0x16')](_0x4dabb2));if(this[_0x9e73('0x17')]!==_0x398a0d){this[_0x9e73('0x17')]=_0x398a0d;io['to'](util[_0x9e73('0x18')]('sms:queue:%s',_0x4dabb2[_0x9e73('0x7')]))['emit'](_0x9e73('0x19'),_0x4dabb2);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xc6d8=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','sms_queue:save','lodash','util','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','beepall'];(function(_0x534a4b,_0x44c67a){var _0x311ed6=function(_0x48b06a){while(--_0x48b06a){_0x534a4b['push'](_0x534a4b['shift']());}};_0x311ed6(++_0x44c67a);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x5bdbfd,_0x3aaf24){_0x5bdbfd=_0x5bdbfd-0x0;var _0x5711c0=_0xc6d8[_0x5bdbfd];return _0x5711c0;};'use strict';var _=require(_0x8c6d('0x0'));var md5=require('md5');var util=require(_0x8c6d('0x1'));var Redis=require('ioredis');var config=require(_0x8c6d('0x2'));config['redis']=_[_0x8c6d('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8c6d('0x4'))(new Redis(config[_0x8c6d('0x5')]));function SmsQueue(_0x17781d){this['id']=_0x17781d['id']||0x0;this[_0x8c6d('0x6')]=_0x17781d[_0x8c6d('0x6')]||'';this[_0x8c6d('0x7')]=_0x17781d[_0x8c6d('0x7')]||0xa;this['strategy']=_0x17781d[_0x8c6d('0x8')]||_0x8c6d('0x9');this[_0x8c6d('0xa')]=_0x17781d['Agents'];this[_0x8c6d('0xb')]={};this[_0x8c6d('0xc')]=0x0;this[_0x8c6d('0xd')]='';this[_0x8c6d('0xe')]();this[_0x8c6d('0xf')]();}SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xe')]=function(){var _0x392a6b=this['mapAgentsId'][_0x8c6d('0x11')];this['mapAgentsId']=_['map'](this[_0x8c6d('0xa')],'id');this[_0x8c6d('0xb')][_0x8c6d('0x11')]=_0x392a6b;};SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xf')]=function(){this[_0x8c6d('0x12')]=0x0;this[_0x8c6d('0x13')]=0x0;for(var _0x103699=0x0;_0x103699=0x0?this[_0x8c6d('0x16')]:0x0;var _0x5a22de={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8c6d('0x12')],'name':this['name'],'paused':this[_0x8c6d('0x13')],'waiting':this[_0x8c6d('0xc')]};var _0x1d0f0a=md5(JSON[_0x8c6d('0x17')](_0x5a22de));if(this[_0x8c6d('0xd')]!==_0x1d0f0a){this['md5']=_0x1d0f0a;io['to'](util['format']('sms:queue:%s',_0x5a22de[_0x8c6d('0x6')]))['emit'](_0x8c6d('0x18'),_0x5a22de);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 3ac1489..2fe8ae7 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9038=['exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','updateRouting','_rr','mapAgentsId','map','loggedIn','paused','online','available','waiting','stringify','emit','whatsapp_queue:save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9038,0x1a5));var _0x8903=function(_0x511aa5,_0x3b3dc4){_0x511aa5=_0x511aa5-0x0;var _0x4539ad=_0x9038[_0x511aa5];return _0x4539ad;};'use strict';var _=require('lodash');var md5=require(_0x8903('0x0'));var util=require(_0x8903('0x1'));var Redis=require(_0x8903('0x2'));var config=require(_0x8903('0x3'));config[_0x8903('0x4')]=_[_0x8903('0x5')](config[_0x8903('0x4')],{'host':_0x8903('0x6'),'port':0x18eb});var io=require(_0x8903('0x7'))(new Redis(config[_0x8903('0x4')]));function WhatsappQueue(_0x29cf63){this['id']=_0x29cf63['id']||0x0;this[_0x8903('0x8')]=_0x29cf63[_0x8903('0x8')]||'';this[_0x8903('0x9')]=_0x29cf63['timeout']||0xa;this[_0x8903('0xa')]=_0x29cf63[_0x8903('0xa')]||_0x8903('0xb');this['Agents']=_0x29cf63[_0x8903('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8903('0x0')]='';this['updateRouting']();this[_0x8903('0xd')]();}WhatsappQueue[_0x8903('0xe')][_0x8903('0xf')]=function(){var _0xa91e87=this['mapAgentsId'][_0x8903('0x10')];this[_0x8903('0x11')]=_[_0x8903('0x12')](this[_0x8903('0xc')],'id');this['mapAgentsId'][_0x8903('0x10')]=_0xa91e87;};WhatsappQueue[_0x8903('0xe')][_0x8903('0xd')]=function(){this[_0x8903('0x13')]=0x0;this[_0x8903('0x14')]=0x0;for(var _0x3476fe=0x0;_0x3476fe=0x0?this[_0x8903('0x16')]:0x0;var _0x279ccf={'id':this['id'],'available':this[_0x8903('0x16')],'loggedIn':this[_0x8903('0x13')],'name':this[_0x8903('0x8')],'paused':this['paused'],'waiting':this[_0x8903('0x17')]};var _0xda937e=md5(JSON[_0x8903('0x18')](_0x279ccf));if(this[_0x8903('0x0')]!==_0xda937e){this['md5']=_0xda937e;io['to'](util['format']('whatsapp:queue:%s',_0x279ccf[_0x8903('0x8')]))[_0x8903('0x19')](_0x8903('0x1a'),_0x279ccf);}};module[_0x8903('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x9198=['whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','whatsappPause','available','format','whatsapp:queue:%s','emit'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x9198,0xfa));var _0x8919=function(_0x5f60a6,_0x966173){_0x5f60a6=_0x5f60a6-0x0;var _0x3e1227=_0x9198[_0x5f60a6];return _0x3e1227;};'use strict';var _=require(_0x8919('0x0'));var md5=require(_0x8919('0x1'));var util=require(_0x8919('0x2'));var Redis=require(_0x8919('0x3'));var config=require(_0x8919('0x4'));config['redis']=_[_0x8919('0x5')](config['redis'],{'host':_0x8919('0x6'),'port':0x18eb});var io=require(_0x8919('0x7'))(new Redis(config[_0x8919('0x8')]));function WhatsappQueue(_0x169d79){this['id']=_0x169d79['id']||0x0;this['name']=_0x169d79[_0x8919('0x9')]||'';this['timeout']=_0x169d79[_0x8919('0xa')]||0xa;this['strategy']=_0x169d79[_0x8919('0xb')]||_0x8919('0xc');this[_0x8919('0xd')]=_0x169d79[_0x8919('0xd')];this[_0x8919('0xe')]={};this[_0x8919('0xf')]=0x0;this[_0x8919('0x1')]='';this['updateRouting']();this[_0x8919('0x10')]();}WhatsappQueue[_0x8919('0x11')][_0x8919('0x12')]=function(){var _0x2984a6=this[_0x8919('0xe')][_0x8919('0x13')];this['mapAgentsId']=_[_0x8919('0x14')](this[_0x8919('0xd')],'id');this[_0x8919('0xe')][_0x8919('0x13')]=_0x2984a6;};WhatsappQueue[_0x8919('0x11')]['updateRealtime']=function(){this[_0x8919('0x15')]=0x0;this[_0x8919('0x16')]=0x0;for(var _0x531ac4=0x0;_0x531ac4=0x0?this[_0x8919('0x19')]:0x0;var _0x533607={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8919('0x15')],'name':this[_0x8919('0x9')],'paused':this[_0x8919('0x16')],'waiting':this['waiting']};var _0x40a521=md5(JSON['stringify'](_0x533607));if(this[_0x8919('0x1')]!==_0x40a521){this[_0x8919('0x1')]=_0x40a521;io['to'](util[_0x8919('0x1a')](_0x8919('0x1b'),_0x533607[_0x8919('0x9')]))[_0x8919('0x1c')](_0x8919('0x1d'),_0x533607);}};module[_0x8919('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 2e5e09a..3170f82 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4c95ec,_0x280e75){var _0x4caf06=function(_0x1e31ab){while(--_0x1e31ab){_0x4c95ec['push'](_0x4c95ec['shift']());}};_0x4caf06(++_0x280e75);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ddb6d,_0x25d45b){_0x2ddb6d=_0x2ddb6d-0x0;var _0x56c103=_0xb10b[_0x2ddb6d];return _0x56c103;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 92da5a1..a892ebb 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 _0x4d70=['../client','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d70,0x136));var _0x04d7=function(_0x498acf,_0x5183ac){_0x498acf=_0x498acf-0x0;var _0x2a1d12=_0x4d70[_0x498acf];return _0x2a1d12;};'use strict';var client=require(_0x04d7('0x0'));exports['update']=function(_0x192566,_0x2f6ba5){return client[_0x04d7('0x1')](_0x04d7('0x2'),{'body':_0x2f6ba5,'options':{'where':{'id':_0x192566}},'log':'updateChatInteraction'});};exports[_0x04d7('0x3')]=function(_0x45f628,_0x4920ea){return client[_0x04d7('0x1')](_0x04d7('0x4'),{'body':_0x4920ea,'options':{'where':{'id':_0x45f628}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x996f=['addTagsToChatInteraction','../client','update','Request','updateChatInteraction','addTags'];(function(_0xdf52ab,_0x558085){var _0x2399be=function(_0x4d4932){while(--_0x4d4932){_0xdf52ab['push'](_0xdf52ab['shift']());}};_0x2399be(++_0x558085);}(_0x996f,0x97));var _0xf996=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x996f[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xf996('0x0'));exports[_0xf996('0x1')]=function(_0xc448a8,_0x5d5f14){return client[_0xf996('0x2')]('UpdateChatInteraction',{'body':_0x5d5f14,'options':{'where':{'id':_0xc448a8}},'log':_0xf996('0x3')});};exports[_0xf996('0x4')]=function(_0x53035e,_0x14e50c){return client['Request']('AddTagsToChatInteraction',{'body':_0x14e50c,'options':{'where':{'id':_0x53035e}},'log':_0xf996('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0c4b696..db6cc63 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 _0x2fd8=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x3f9807,_0x56b121){var _0xe5d31f=function(_0x50c0d8){while(--_0x50c0d8){_0x3f9807['push'](_0x3f9807['shift']());}};_0xe5d31f(++_0x56b121);}(_0x2fd8,0x157));var _0x82fd=function(_0x3d16c2,_0x2702bc){_0x3d16c2=_0x3d16c2-0x0;var _0x267bc7=_0x2fd8[_0x3d16c2];return _0x267bc7;};'use strict';var client=require(_0x82fd('0x0'));exports[_0x82fd('0x1')]=function(_0x1bacbc){return client[_0x82fd('0x2')](_0x82fd('0x3'),{'body':_0x1bacbc,'log':_0x82fd('0x4')});}; \ No newline at end of file +var _0xd03f=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x266e80,_0xc5183a){var _0x26cbaa=function(_0x59c43a){while(--_0x59c43a){_0x266e80['push'](_0x266e80['shift']());}};_0x26cbaa(++_0xc5183a);}(_0xd03f,0x1f2));var _0xfd03=function(_0x12bcac,_0x246c45){_0x12bcac=_0x12bcac-0x0;var _0x5ab2e0=_0xd03f[_0x12bcac];return _0x5ab2e0;};'use strict';var client=require(_0xfd03('0x0'));exports['create']=function(_0x5d08eb){return client[_0xfd03('0x1')](_0xfd03('0x2'),{'body':_0x5d08eb,'log':_0xfd03('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0b9e423..f90edc5 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 _0x5162=['name','online','chatPause','../client','timeout','strategy','User','Agents'];(function(_0x3136a0,_0x446c5c){var _0x7483d5=function(_0xe4adea){while(--_0xe4adea){_0x3136a0['push'](_0x3136a0['shift']());}};_0x7483d5(++_0x446c5c);}(_0x5162,0x103));var _0x2516=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0x5162[_0x406fbb];return _0x8e921d;};'use strict';var client=require(_0x2516('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x2516('0x1'),_0x2516('0x2')],'include':[{'model':_0x2516('0x3'),'as':_0x2516('0x4'),'attributes':['id',_0x2516('0x5'),_0x2516('0x6'),_0x2516('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x16d8=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x148629,_0x512b37){var _0x1f9858=function(_0x3fb49e){while(--_0x3fb49e){_0x148629['push'](_0x148629['shift']());}};_0x1f9858(++_0x512b37);}(_0x16d8,0xa3));var _0x816d=function(_0x4398da,_0xfe0269){_0x4398da=_0x4398da-0x0;var _0x1e6a6c=_0x16d8[_0x4398da];return _0x1e6a6c;};'use strict';var client=require('../client');exports[_0x816d('0x0')]=function(){return function(){return client[_0x816d('0x1')](_0x816d('0x2'),{'options':{'raw':![],'attributes':['id',_0x816d('0x3'),_0x816d('0x4'),_0x816d('0x5')],'include':[{'model':_0x816d('0x6'),'as':_0x816d('0x7'),'attributes':['id',_0x816d('0x3'),'online',_0x816d('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 72b835e..c708710 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 _0x50c1=['DESC','../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x524996,_0x4b9012){var _0x2bb426=function(_0x44aeb1){while(--_0x44aeb1){_0x524996['push'](_0x524996['shift']());}};_0x2bb426(++_0x4b9012);}(_0x50c1,0x1a5));var _0x150c=function(_0x1fc108,_0x1fe1b5){_0x1fc108=_0x1fc108-0x0;var _0x15a7ec=_0x50c1[_0x1fc108];return _0x15a7ec;};'use strict';var client=require(_0x150c('0x0'));exports['create']=function(_0x47d48d){return client[_0x150c('0x1')](_0x150c('0x2'),{'body':_0x47d48d,'log':_0x150c('0x2')});};exports[_0x150c('0x3')]=function(_0x24cd1b,_0x18c0bd){return client[_0x150c('0x1')](_0x150c('0x4'),{'body':_0x18c0bd,'options':{'where':{'uniqueid':_0x24cd1b},'order':[['id',_0x150c('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x43f3=['UpdateChatQueueReport','create','CreateChatQueueReport','update','Request'];(function(_0x2c219a,_0x113ab1){var _0x54c0be=function(_0xb160c8){while(--_0xb160c8){_0x2c219a['push'](_0x2c219a['shift']());}};_0x54c0be(++_0x113ab1);}(_0x43f3,0xab));var _0x343f=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x43f3[_0x3c8e9a];return _0x2d4c57;};'use strict';var client=require('../client');exports[_0x343f('0x0')]=function(_0x177f01){return client['Request'](_0x343f('0x1'),{'body':_0x177f01,'log':'CreateChatQueueReport'});};exports[_0x343f('0x2')]=function(_0x48008f,_0x3339a9){return client[_0x343f('0x3')](_0x343f('0x4'),{'body':_0x3339a9,'options':{'where':{'uniqueid':_0x48008f},'order':[['id','DESC']],'limit':0x1},'log':_0x343f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8fce687..87068f9 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5b8052,_0x57c477){var _0x1f7025=function(_0x3ac0d1){while(--_0x3ac0d1){_0x5b8052['push'](_0x5b8052['shift']());}};_0x1f7025(++_0x57c477);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0x7a54,0x106));var _0x47a5=function(_0x52dd6a,_0x1eaa06){_0x52dd6a=_0x52dd6a-0x0;var _0x3023e7=_0x7a54[_0x52dd6a];return _0x3023e7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'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 d44daa3..387e20f 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 _0xc662=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x301021,_0x4f0387){var _0x2e9251=function(_0x108f13){while(--_0x108f13){_0x301021['push'](_0x301021['shift']());}};_0x2e9251(++_0x4f0387);}(_0xc662,0x170));var _0x2c66=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xc662[_0x47e7cb];return _0x2a8874;};'use strict';var client=require(_0x2c66('0x0'));exports[_0x2c66('0x1')]=function(_0x4c46cc){return client[_0x2c66('0x2')](_0x2c66('0x3'),{'body':_0x4c46cc,'log':_0x2c66('0x4')});}; \ No newline at end of file +var _0xe98a=['../client','createFaxMessage'];(function(_0x192e16,_0x4280b1){var _0x335f79=function(_0x4b5028){while(--_0x4b5028){_0x192e16['push'](_0x192e16['shift']());}};_0x335f79(++_0x4280b1);}(_0xe98a,0x106));var _0xae98=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0xe98a[_0x213518];return _0x1baf75;};'use strict';var client=require(_0xae98('0x0'));exports['create']=function(_0xc7680e){return client['Request']('CreateFaxMessage',{'body':_0xc7680e,'log':_0xae98('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ff06e32..67eddb6 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 _0x37f7=['online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x1a1546,_0x427fbc){var _0x4d1dba=function(_0x1de810){while(--_0x1de810){_0x1a1546['push'](_0x1a1546['shift']());}};_0x4d1dba(++_0x427fbc);}(_0x37f7,0x8e));var _0x737f=function(_0x439593,_0x588227){_0x439593=_0x439593-0x0;var _0x296ef7=_0x37f7[_0x439593];return _0x296ef7;};'use strict';var client=require('../client');exports[_0x737f('0x0')]=function(){return function(){return client[_0x737f('0x1')](_0x737f('0x2'),{'options':{'raw':![],'attributes':['id',_0x737f('0x3'),_0x737f('0x4'),_0x737f('0x5')],'include':[{'model':_0x737f('0x6'),'as':_0x737f('0x7'),'attributes':['id',_0x737f('0x3'),_0x737f('0x8'),_0x737f('0x9')]}]},'log':_0x737f('0x0')});};}; \ No newline at end of file +var _0xecd7=['strategy','Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x38924a,_0x5923c6){var _0x2c85db=function(_0xe7ce60){while(--_0xe7ce60){_0x38924a['push'](_0x38924a['shift']());}};_0x2c85db(++_0x5923c6);}(_0xecd7,0xf3));var _0x7ecd=function(_0x323e11,_0x3d9a92){_0x323e11=_0x323e11-0x0;var _0x4e27ca=_0xecd7[_0x323e11];return _0x4e27ca;};'use strict';var client=require(_0x7ecd('0x0'));exports[_0x7ecd('0x1')]=function(){return function(){return client[_0x7ecd('0x2')](_0x7ecd('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7ecd('0x4'),_0x7ecd('0x5')],'include':[{'model':'User','as':_0x7ecd('0x6'),'attributes':['id','name','online',_0x7ecd('0x7')]}]},'log':_0x7ecd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 61d8a8e..475dc2b 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 _0x68e1=['../client','create','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x4c660c,_0x4f03e4){var _0x55eaf7=function(_0x333520){while(--_0x333520){_0x4c660c['push'](_0x4c660c['shift']());}};_0x55eaf7(++_0x4f03e4);}(_0x68e1,0x180));var _0x168e=function(_0x45ed88,_0x1413bf){_0x45ed88=_0x45ed88-0x0;var _0x199ff3=_0x68e1[_0x45ed88];return _0x199ff3;};'use strict';var client=require(_0x168e('0x0'));exports[_0x168e('0x1')]=function(_0x36cdec){return client['Request'](_0x168e('0x2'),{'body':_0x36cdec,'log':_0x168e('0x2')});};exports[_0x168e('0x3')]=function(_0x44c3d3,_0x30e37e){return client['Request'](_0x168e('0x4'),{'body':_0x30e37e,'options':{'where':{'uniqueid':_0x44c3d3},'order':[['id',_0x168e('0x5')]],'limit':0x1},'log':_0x168e('0x4')});}; \ No newline at end of file +var _0x27b9=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x4db668,_0x2c146a){var _0x3420e1=function(_0x48b218){while(--_0x48b218){_0x4db668['push'](_0x4db668['shift']());}};_0x3420e1(++_0x2c146a);}(_0x27b9,0x1b5));var _0x927b=function(_0xf55c2c,_0xc63455){_0xf55c2c=_0xf55c2c-0x0;var _0x5c4c58=_0x27b9[_0xf55c2c];return _0x5c4c58;};'use strict';var client=require(_0x927b('0x0'));exports[_0x927b('0x1')]=function(_0x2043df){return client[_0x927b('0x2')](_0x927b('0x3'),{'body':_0x2043df,'log':_0x927b('0x3')});};exports[_0x927b('0x4')]=function(_0x3068db,_0x3006a9){return client[_0x927b('0x2')](_0x927b('0x5'),{'body':_0x3006a9,'options':{'where':{'uniqueid':_0x3068db},'order':[['id','DESC']],'limit':0x1},'log':_0x927b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index afef038..adfe7c8 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 _0xd122=['Request','name','Interval','Intervals','../client','getIntervals'];(function(_0x45c8f5,_0x18b017){var _0x248f5b=function(_0x1570bb){while(--_0x1570bb){_0x45c8f5['push'](_0x45c8f5['shift']());}};_0x248f5b(++_0x18b017);}(_0xd122,0x7c));var _0x2d12=function(_0xace89,_0x1de0d3){_0xace89=_0xace89-0x0;var _0x41d1c5=_0xd122[_0xace89];return _0x41d1c5;};'use strict';var client=require(_0x2d12('0x0'));exports[_0x2d12('0x1')]=function(){return function(){return client[_0x2d12('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2d12('0x3')],'include':[{'model':_0x2d12('0x4'),'as':_0x2d12('0x5'),'attributes':['id',_0x2d12('0x3'),'interval']}]},'log':_0x2d12('0x1')});};}; \ No newline at end of file +var _0x6aa0=['getIntervals','Request','GetInterval','Interval','name','interval','../client'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6aa0,0x1bf));var _0x06aa=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x6aa0[_0xc8db6b];return _0x12cb81;};'use strict';var client=require(_0x06aa('0x0'));exports[_0x06aa('0x1')]=function(){return function(){return client[_0x06aa('0x2')](_0x06aa('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x06aa('0x4'),'as':'Intervals','attributes':['id',_0x06aa('0x5'),_0x06aa('0x6')]}]},'log':_0x06aa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 8c5e5cc..1a9173b 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 _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x33af,0xec));var _0xf33a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x33af[_0x4baae2];return _0x1a2285;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x5d997d,_0x4e3d5b){var _0x37dda1=function(_0x48eee5){while(--_0x48eee5){_0x5d997d['push'](_0x5d997d['shift']());}};_0x37dda1(++_0x4e3d5b);}(_0xdb28,0x106));var _0x8db2=function(_0xba4859,_0x5bad78){_0xba4859=_0xba4859-0x0;var _0x14a59a=_0xdb28[_0xba4859];return _0x14a59a;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1b60316..f6f3081 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 _0xa78e=['../client','create','Request','createMailMessage'];(function(_0x14ca7c,_0x58c436){var _0x47a76e=function(_0x487d5c){while(--_0x487d5c){_0x14ca7c['push'](_0x14ca7c['shift']());}};_0x47a76e(++_0x58c436);}(_0xa78e,0x124));var _0xea78=function(_0x35055e,_0x45902e){_0x35055e=_0x35055e-0x0;var _0xe9834e=_0xa78e[_0x35055e];return _0xe9834e;};'use strict';var client=require(_0xea78('0x0'));exports[_0xea78('0x1')]=function(_0x523637){return client[_0xea78('0x2')]('CreateMailMessage',{'body':_0x523637,'log':_0xea78('0x3')});}; \ No newline at end of file +var _0x0bdf=['create','Request','CreateMailMessage','../client'];(function(_0x447d69,_0x58c94e){var _0x194f34=function(_0x994c18){while(--_0x994c18){_0x447d69['push'](_0x447d69['shift']());}};_0x194f34(++_0x58c94e);}(_0x0bdf,0x153));var _0xf0bd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0bdf[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0xf0bd('0x0'));exports[_0xf0bd('0x1')]=function(_0x2a3135){return client[_0xf0bd('0x2')](_0xf0bd('0x3'),{'body':_0x2a3135,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 6eec98a..49f2b39 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 _0xc198=['User','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy'];(function(_0x27ebfc,_0x120069){var _0x1e70c3=function(_0x2a5309){while(--_0x2a5309){_0x27ebfc['push'](_0x27ebfc['shift']());}};_0x1e70c3(++_0x120069);}(_0xc198,0xc9));var _0x8c19=function(_0x501b14,_0x55ecb4){_0x501b14=_0x501b14-0x0;var _0x2e2917=_0xc198[_0x501b14];return _0x2e2917;};'use strict';var client=require(_0x8c19('0x0'));exports[_0x8c19('0x1')]=function(){return function(){return client[_0x8c19('0x2')](_0x8c19('0x3'),{'options':{'raw':![],'attributes':['id',_0x8c19('0x4'),'timeout',_0x8c19('0x5')],'include':[{'model':_0x8c19('0x6'),'as':'Agents','attributes':['id','name',_0x8c19('0x7'),_0x8c19('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x7434=['getMailQueues','Request','GetMailQueue','name','timeout','User','Agents','online','mailPause','../client'];(function(_0x37feae,_0x540cfc){var _0x5be5db=function(_0x3e9ffe){while(--_0x3e9ffe){_0x37feae['push'](_0x37feae['shift']());}};_0x5be5db(++_0x540cfc);}(_0x7434,0x15d));var _0x4743=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7434[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x4743('0x0'));exports[_0x4743('0x1')]=function(){return function(){return client[_0x4743('0x2')](_0x4743('0x3'),{'options':{'raw':![],'attributes':['id',_0x4743('0x4'),_0x4743('0x5'),'strategy'],'include':[{'model':_0x4743('0x6'),'as':_0x4743('0x7'),'attributes':['id',_0x4743('0x4'),_0x4743('0x8'),_0x4743('0x9')]}]},'log':_0x4743('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 45382aa..fc5263f 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 _0xbaa5=['../client','create','Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport'];(function(_0x34674e,_0x1cb456){var _0x5845fd=function(_0x30d755){while(--_0x30d755){_0x34674e['push'](_0x34674e['shift']());}};_0x5845fd(++_0x1cb456);}(_0xbaa5,0x1d5));var _0x5baa=function(_0x37e75c,_0x4b222e){_0x37e75c=_0x37e75c-0x0;var _0x1d5c68=_0xbaa5[_0x37e75c];return _0x1d5c68;};'use strict';var client=require(_0x5baa('0x0'));exports[_0x5baa('0x1')]=function(_0x22068a){return client[_0x5baa('0x2')](_0x5baa('0x3'),{'body':_0x22068a,'log':_0x5baa('0x3')});};exports[_0x5baa('0x4')]=function(_0x26cde5,_0x443d2d){return client[_0x5baa('0x2')]('UpdateMailQueueReport',{'body':_0x443d2d,'options':{'where':{'uniqueid':_0x26cde5},'order':[['id',_0x5baa('0x5')]],'limit':0x1},'log':_0x5baa('0x6')});}; \ No newline at end of file +var _0x7c65=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x7c65,0x15c));var _0x57c6=function(_0x4ff8d9,_0x22762b){_0x4ff8d9=_0x4ff8d9-0x0;var _0x290486=_0x7c65[_0x4ff8d9];return _0x290486;};'use strict';var client=require(_0x57c6('0x0'));exports[_0x57c6('0x1')]=function(_0xe1e147){return client[_0x57c6('0x2')](_0x57c6('0x3'),{'body':_0xe1e147,'log':'CreateMailQueueReport'});};exports[_0x57c6('0x4')]=function(_0xcd112d,_0x44e5e8){return client[_0x57c6('0x2')](_0x57c6('0x5'),{'body':_0x44e5e8,'options':{'where':{'uniqueid':_0xcd112d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2aba518..4717fef 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 _0x2df8=['UpdateOpenchannelInteraction','update','Request'];(function(_0x4c8497,_0x2021fc){var _0xb9303c=function(_0x2ea962){while(--_0x2ea962){_0x4c8497['push'](_0x4c8497['shift']());}};_0xb9303c(++_0x2021fc);}(_0x2df8,0x6a));var _0x82df=function(_0x34ce23,_0x2c518e){_0x34ce23=_0x34ce23-0x0;var _0x13681f=_0x2df8[_0x34ce23];return _0x13681f;};'use strict';var client=require('../client');exports[_0x82df('0x0')]=function(_0x3c3a82,_0x620045){return client[_0x82df('0x1')](_0x82df('0x2'),{'body':_0x620045,'options':{'where':{'id':_0x3c3a82}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x550d6f,_0x392855){return client[_0x82df('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x392855,'options':{'where':{'id':_0x550d6f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9086=['Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x41812a,_0x3a3ebb){var _0x218597=function(_0x24d6f1){while(--_0x24d6f1){_0x41812a['push'](_0x41812a['shift']());}};_0x218597(++_0x3a3ebb);}(_0x9086,0x72));var _0x6908=function(_0x4db190,_0x572393){_0x4db190=_0x4db190-0x0;var _0x1e579a=_0x9086[_0x4db190];return _0x1e579a;};'use strict';var client=require('../client');exports[_0x6908('0x0')]=function(_0x48ab51,_0x79e93){return client[_0x6908('0x1')]('UpdateOpenchannelInteraction',{'body':_0x79e93,'options':{'where':{'id':_0x48ab51}},'log':_0x6908('0x2')});};exports['addTags']=function(_0x1a99ae,_0x26c037){return client[_0x6908('0x1')](_0x6908('0x3'),{'body':_0x26c037,'options':{'where':{'id':_0x1a99ae}},'log':_0x6908('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 820c107..9f41384 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 _0x0bd4=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x4bccda,_0x4252a8){var _0x2d4c53=function(_0x5df70a){while(--_0x5df70a){_0x4bccda['push'](_0x4bccda['shift']());}};_0x2d4c53(++_0x4252a8);}(_0x0bd4,0x1ca));var _0x40bd=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x0bd4[_0x4b2b03];return _0x1bf0ed;};'use strict';var client=require(_0x40bd('0x0'));exports[_0x40bd('0x1')]=function(_0x16736e){return client[_0x40bd('0x2')](_0x40bd('0x3'),{'body':_0x16736e,'log':_0x40bd('0x4')});}; \ No newline at end of file +var _0x68a2=['Request','../client'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x68a2,0x15d));var _0x268a=function(_0x568363,_0x2e79a7){_0x568363=_0x568363-0x0;var _0x47f0ed=_0x68a2[_0x568363];return _0x47f0ed;};'use strict';var client=require(_0x268a('0x0'));exports['create']=function(_0x229cb5){return client[_0x268a('0x1')]('CreateOpenchannelMessage',{'body':_0x229cb5,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 0b4ee63..7859002 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 _0x4be8=['name','timeout','strategy','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0x4be8,0x17f));var _0x84be=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x4be8[_0x59c301];return _0x3866b9;};'use strict';var client=require(_0x84be('0x0'));exports[_0x84be('0x1')]=function(){return function(){return client[_0x84be('0x2')](_0x84be('0x3'),{'options':{'raw':![],'attributes':['id',_0x84be('0x4'),_0x84be('0x5'),_0x84be('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x84be('0x4'),_0x84be('0x7'),_0x84be('0x8')]}]},'log':_0x84be('0x1')});};}; \ No newline at end of file +var _0xbac7=['Request','GetOpenchannelQueue','name','strategy','User','Agents','online','../client','getOpenchannelQueues'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbac7,0x1ae));var _0x7bac=function(_0x3aafec,_0x3f8e8a){_0x3aafec=_0x3aafec-0x0;var _0x250266=_0xbac7[_0x3aafec];return _0x250266;};'use strict';var client=require(_0x7bac('0x0'));exports[_0x7bac('0x1')]=function(){return function(){return client[_0x7bac('0x2')](_0x7bac('0x3'),{'options':{'raw':![],'attributes':['id',_0x7bac('0x4'),'timeout',_0x7bac('0x5')],'include':[{'model':_0x7bac('0x6'),'as':_0x7bac('0x7'),'attributes':['id',_0x7bac('0x4'),_0x7bac('0x8'),'openchannelPause']}]},'log':_0x7bac('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 1d8252f..34a106e 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 _0x205d=['DESC','../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x4f152e,_0x35162a){var _0x9b2c79=function(_0x152076){while(--_0x152076){_0x4f152e['push'](_0x4f152e['shift']());}};_0x9b2c79(++_0x35162a);}(_0x205d,0xf6));var _0xd205=function(_0xfc36d8,_0x233b0b){_0xfc36d8=_0xfc36d8-0x0;var _0x234f42=_0x205d[_0xfc36d8];return _0x234f42;};'use strict';var client=require(_0xd205('0x0'));exports[_0xd205('0x1')]=function(_0x11d0ff){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x11d0ff,'log':_0xd205('0x2')});};exports[_0xd205('0x3')]=function(_0x3f3c23,_0x4bc52b){return client[_0xd205('0x4')](_0xd205('0x5'),{'body':_0x4bc52b,'options':{'where':{'uniqueid':_0x3f3c23},'order':[['id',_0xd205('0x6')]],'limit':0x1},'log':_0xd205('0x5')});}; \ No newline at end of file +var _0xdae9=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x1254fb,_0x227094){var _0x3055d0=function(_0x4a0b0){while(--_0x4a0b0){_0x1254fb['push'](_0x1254fb['shift']());}};_0x3055d0(++_0x227094);}(_0xdae9,0x15e));var _0x9dae=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xdae9[_0x373dee];return _0x46798f;};'use strict';var client=require('../client');exports[_0x9dae('0x0')]=function(_0x59890e){return client[_0x9dae('0x1')](_0x9dae('0x2'),{'body':_0x59890e,'log':_0x9dae('0x2')});};exports[_0x9dae('0x3')]=function(_0x38403b,_0x2261ba){return client[_0x9dae('0x1')](_0x9dae('0x4'),{'body':_0x2261ba,'options':{'where':{'uniqueid':_0x38403b},'order':[['id',_0x9dae('0x5')]],'limit':0x1},'log':_0x9dae('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 191b19d..6a6e487 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 _0x1247=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1247,0xb6));var _0x7124=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x1247[_0x1304c6];return _0x2e6654;};'use strict';var client=require(_0x7124('0x0'));exports[_0x7124('0x1')]=function(_0x498325,_0x4d37c0){return client[_0x7124('0x2')](_0x7124('0x3'),{'body':_0x4d37c0,'options':{'where':{'id':_0x498325}},'log':_0x7124('0x4')});};exports['addTags']=function(_0x3bdce3,_0x3ab32e){return client[_0x7124('0x2')](_0x7124('0x5'),{'body':_0x3ab32e,'options':{'where':{'id':_0x3bdce3}},'log':_0x7124('0x6')});}; \ No newline at end of file +var _0x04f1=['addTags','../client','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x04f1,0x92));var _0x104f=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x04f1[_0x414297];return _0x51ea47;};'use strict';var client=require(_0x104f('0x0'));exports[_0x104f('0x1')]=function(_0x3978b8,_0x4daefc){return client['Request'](_0x104f('0x2'),{'body':_0x4daefc,'options':{'where':{'id':_0x3978b8}},'log':_0x104f('0x3')});};exports[_0x104f('0x4')]=function(_0x55c56e,_0x4b4197){return client['Request']('AddTagsToSmsInteraction',{'body':_0x4b4197,'options':{'where':{'id':_0x55c56e}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9da9050..fa26920 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 _0xe4cb=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0xe039c,_0x10192a){var _0x450db7=function(_0x44e4ca){while(--_0x44e4ca){_0xe039c['push'](_0xe039c['shift']());}};_0x450db7(++_0x10192a);}(_0xe4cb,0x16a));var _0xbe4c=function(_0x59bf40,_0xa0353){_0x59bf40=_0x59bf40-0x0;var _0xb51f68=_0xe4cb[_0x59bf40];return _0xb51f68;};'use strict';var client=require(_0xbe4c('0x0'));exports[_0xbe4c('0x1')]=function(_0x2c5b93){return client[_0xbe4c('0x2')](_0xbe4c('0x3'),{'body':_0x2c5b93,'log':_0xbe4c('0x4')});}; \ No newline at end of file +var _0x4465=['createSmsMessage','CreateSmsMessage'];(function(_0xfdb740,_0x14c2da){var _0x4a837d=function(_0x4b4f8a){while(--_0x4b4f8a){_0xfdb740['push'](_0xfdb740['shift']());}};_0x4a837d(++_0x14c2da);}(_0x4465,0x161));var _0x5446=function(_0x2561b9,_0x402710){_0x2561b9=_0x2561b9-0x0;var _0x4d9c94=_0x4465[_0x2561b9];return _0x4d9c94;};'use strict';var client=require('../client');exports['create']=function(_0x38cf10){return client['Request'](_0x5446('0x0'),{'body':_0x38cf10,'log':_0x5446('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6f4120b..356a086 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0xfd4cd3,_0x3e4ac9){var _0x448ebd=function(_0x17d75e){while(--_0x17d75e){_0xfd4cd3['push'](_0xfd4cd3['shift']());}};_0x448ebd(++_0x3e4ac9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0xb1680e,_0xea33e8){var _0x31cd58=function(_0xee461a){while(--_0xee461a){_0xb1680e['push'](_0xb1680e['shift']());}};_0x31cd58(++_0xea33e8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcb91[_0x2f6f50];return _0x2cf365;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c687000..2af386c 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x73d817,_0x54eed1){var _0x178cf8=function(_0x3cdf24){while(--_0x3cdf24){_0x73d817['push'](_0x73d817['shift']());}};_0x178cf8(++_0x54eed1);}(_0x008c,0x188));var _0xc008=function(_0x5678c2,_0xd8cb89){_0x5678c2=_0x5678c2-0x0;var _0x263105=_0x008c[_0x5678c2];return _0x263105;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1e8972,_0x12b85d){var _0x353f33=function(_0x16f1da){while(--_0x16f1da){_0x1e8972['push'](_0x1e8972['shift']());}};_0x353f33(++_0x12b85d);}(_0x008c,0x188));var _0xc008=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x008c[_0x3a833e];return _0xdff445;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 84b4170..1626c8c 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 _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3afece,_0x112b15){var _0x1dcdc2=function(_0x513a2c){while(--_0x513a2c){_0x3afece['push'](_0x3afece['shift']());}};_0x1dcdc2(++_0x112b15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2915b7,_0xc66b75){var _0x4a0368=function(_0x1f0e7d){while(--_0x1f0e7d){_0x2915b7['push'](_0x2915b7['shift']());}};_0x4a0368(++_0xc66b75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index e759315..02ad8cf 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x199c=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x199c,0x1d8));var _0xc199=function(_0xfcba87,_0x221462){_0xfcba87=_0xfcba87-0x0;var _0x58e4b1=_0x199c[_0xfcba87];return _0x58e4b1;};'use strict';var client=require('../client');exports['update']=function(_0x240cb4,_0x3fdf87){return client[_0xc199('0x0')](_0xc199('0x1'),{'body':_0x3fdf87,'options':{'where':{'id':_0x240cb4}},'log':_0xc199('0x2')});};exports[_0xc199('0x3')]=function(_0x3f06cc,_0x1eecc2){return client['Request'](_0xc199('0x4'),{'body':_0x1eecc2,'options':{'where':{'id':_0x3f06cc}},'log':_0xc199('0x5')});}; \ No newline at end of file +var _0xacf4=['AddTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0xacf4,0xe7));var _0x4acf=function(_0x3e2c3c,_0x3fcf4e){_0x3e2c3c=_0x3e2c3c-0x0;var _0x5a79a6=_0xacf4[_0x3e2c3c];return _0x5a79a6;};'use strict';var client=require('../client');exports['update']=function(_0x867c40,_0x14a022){return client[_0x4acf('0x0')](_0x4acf('0x1'),{'body':_0x14a022,'options':{'where':{'id':_0x867c40}},'log':_0x4acf('0x2')});};exports[_0x4acf('0x3')]=function(_0x145264,_0x5cf22d){return client[_0x4acf('0x0')](_0x4acf('0x4'),{'body':_0x5cf22d,'options':{'where':{'id':_0x145264}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 7f6aacf..cfa8f7a 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6f0=['Request','createWhatsappMessage'];(function(_0x281c44,_0x367e13){var _0x44b209=function(_0x255bca){while(--_0x255bca){_0x281c44['push'](_0x281c44['shift']());}};_0x44b209(++_0x367e13);}(_0xa6f0,0x10a));var _0x0a6f=function(_0x329203,_0x16453a){_0x329203=_0x329203-0x0;var _0xa1be8c=_0xa6f0[_0x329203];return _0xa1be8c;};'use strict';var client=require('../client');exports['create']=function(_0x482cb5){return client[_0x0a6f('0x0')]('CreateWhatsappMessage',{'body':_0x482cb5,'log':_0x0a6f('0x1')});}; \ No newline at end of file +var _0xc727=['Request','createWhatsappMessage','../client','create'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0xc727,0x166));var _0x7c72=function(_0x4275d0,_0x3a05c5){_0x4275d0=_0x4275d0-0x0;var _0x31d88a=_0xc727[_0x4275d0];return _0x31d88a;};'use strict';var client=require(_0x7c72('0x0'));exports[_0x7c72('0x1')]=function(_0x467a5c){return client[_0x7c72('0x2')]('CreateWhatsappMessage',{'body':_0x467a5c,'log':_0x7c72('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index ca659ca..623b751 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe17=['timeout','strategy','User','Agents','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x11accf,_0x5cf3e3){var _0x43de4c=function(_0x1897e5){while(--_0x1897e5){_0x11accf['push'](_0x11accf['shift']());}};_0x43de4c(++_0x5cf3e3);}(_0xfe17,0x170));var _0x7fe1=function(_0xb40cd3,_0x33b6b5){_0xb40cd3=_0xb40cd3-0x0;var _0x5b733d=_0xfe17[_0xb40cd3];return _0x5b733d;};'use strict';var client=require('../client');exports[_0x7fe1('0x0')]=function(){return function(){return client['Request'](_0x7fe1('0x1'),{'options':{'raw':![],'attributes':['id',_0x7fe1('0x2'),_0x7fe1('0x3'),_0x7fe1('0x4')],'include':[{'model':_0x7fe1('0x5'),'as':_0x7fe1('0x6'),'attributes':['id',_0x7fe1('0x2'),'online','whatsappPause']}]},'log':_0x7fe1('0x0')});};}; \ No newline at end of file +var _0x08cb=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','User','Agents','online'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x08cb,0x122));var _0xb08c=function(_0x44676e,_0x1ac4fc){_0x44676e=_0x44676e-0x0;var _0x17eee0=_0x08cb[_0x44676e];return _0x17eee0;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xb08c('0x0')](_0xb08c('0x1'),{'options':{'raw':![],'attributes':['id',_0xb08c('0x2'),_0xb08c('0x3'),'strategy'],'include':[{'model':_0xb08c('0x4'),'as':_0xb08c('0x5'),'attributes':['id',_0xb08c('0x2'),_0xb08c('0x6'),_0xb08c('0x7')]}]},'log':_0xb08c('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7b44268..7b120de 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c7a=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x54dda3,_0x3667e3){var _0xf617d5=function(_0x216a4a){while(--_0x216a4a){_0x54dda3['push'](_0x54dda3['shift']());}};_0xf617d5(++_0x3667e3);}(_0x5c7a,0xcb));var _0xa5c7=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x5c7a[_0x545a3a];return _0x5a5493;};'use strict';var client=require(_0xa5c7('0x0'));exports[_0xa5c7('0x1')]=function(_0x215416){return client[_0xa5c7('0x2')](_0xa5c7('0x3'),{'body':_0x215416,'log':_0xa5c7('0x3')});};exports[_0xa5c7('0x4')]=function(_0x502aa5,_0x58b4c5){return client[_0xa5c7('0x2')](_0xa5c7('0x5'),{'body':_0x58b4c5,'options':{'where':{'uniqueid':_0x502aa5},'order':[['id',_0xa5c7('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x2cb7=['DESC','../client','create','Request','UpdateWhatsappQueueReport'];(function(_0x5a11a1,_0x311e46){var _0x34a9a2=function(_0x234831){while(--_0x234831){_0x5a11a1['push'](_0x5a11a1['shift']());}};_0x34a9a2(++_0x311e46);}(_0x2cb7,0xfb));var _0x72cb=function(_0x122e42,_0x222609){_0x122e42=_0x122e42-0x0;var _0x4c019e=_0x2cb7[_0x122e42];return _0x4c019e;};'use strict';var client=require(_0x72cb('0x0'));exports[_0x72cb('0x1')]=function(_0x5f1343){return client[_0x72cb('0x2')]('CreateWhatsappQueueReport',{'body':_0x5f1343,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x3e15a0,_0x3c27ed){return client[_0x72cb('0x2')](_0x72cb('0x3'),{'body':_0x3c27ed,'options':{'where':{'uniqueid':_0x3e15a0},'order':[['id',_0x72cb('0x4')]],'limit':0x1},'log':_0x72cb('0x3')});}; \ 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 b09417c..53f62ef 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 _0x7d1d=['toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x7d1d,0x1af));var _0xd7d1=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x7d1d[_0x3c22e0];return _0x215811;};'use strict';var schema=require(_0xd7d1('0x0'));var _=require(_0xd7d1('0x1'));var util=require(_0xd7d1('0x2'));var seqqueue=require(_0xd7d1('0x3'));var logger=require(_0xd7d1('0x4'))(_0xd7d1('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xd7d1('0x6'),'required':!![],'message':_0xd7d1('0x7')},'timeout':{'type':_0xd7d1('0x8'),'message':_0xd7d1('0x9')}});function writeLog(_0x1d7428,_0xcdf9ff,_0x10ab0c){return logger[_0xd7d1('0xa')](util['format'](_0xd7d1('0xb'),_0x1d7428,_0xcdf9ff[_0xd7d1('0xc')],_0x10ab0c));}function handleFindAgent(_0x47c232){return function(_0xddfa72){return _0xddfa72[_0xd7d1('0xc')]['toLowerCase']()===_0x47c232[_0xd7d1('0xd')]();};}exports[_0xd7d1('0xe')]=function(_0x187634,_0x55dc8f,_0x545e4b,_0x48a987){return function(_0x1a0ca0){try{var _0x12504e={'name':_0x55dc8f[0x0],'timeout':_0x55dc8f[0x1]};var _0x15bfa8=queue[_0xd7d1('0x0')](_0x12504e,{'typecast':!![]});if(_0x15bfa8[_0xd7d1('0xf')]){logger[_0xd7d1('0x10')](_0xd7d1('0x11'),_0x187634,_['map'](_0x15bfa8,_0xd7d1('0x12'))['join'](',\x20'));_0x1a0ca0['stop']();}else{var _0x101986=_[_0xd7d1('0x13')](_0x545e4b[_0xd7d1('0x14')],handleFindAgent(_0x12504e[_0xd7d1('0xc')]));if(_0x101986){var _0x589109=(_0x12504e[_0xd7d1('0x15')]||0xa)*0x3e8;var _0x124167,_0x2fb585;var _0x326ce0=seqqueue[_0xd7d1('0x16')](_0x589109);_0x326ce0['id']=_0x187634;_0x326ce0[_0xd7d1('0x17')]=_0x589109;_0x326ce0[_0xd7d1('0x18')]=_0x48a987[_0xd7d1('0x18')];writeLog(_0x187634,_0x101986,util['format'](_0xd7d1('0x19'),_0x589109));_0x545e4b[_0xd7d1('0x1a')][_0x187634]['on'](_0xd7d1('0x1b'),function(){logger[_0xd7d1('0xa')](_0xd7d1('0x1c'),_0x187634);clearTimeout(_0x2fb585);_0x2fb585=undefined;_0x326ce0['close']();if(_0x545e4b[_0xd7d1('0x1a')][_0x187634]){delete _0x545e4b[_0xd7d1('0x1a')][_0x187634];}_0x1a0ca0[_0xd7d1('0x1d')]();});_0x545e4b[_0xd7d1('0x1a')][_0x187634]['on'](_0xd7d1('0x1e'),function(){if(_0x545e4b[_0xd7d1('0x1a')][_0x187634]){delete _0x545e4b['rules'][_0x187634];}});_0x2fb585=setTimeout(function(){logger[_0xd7d1('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x187634);clearTimeout(_0x2fb585);_0x326ce0[_0xd7d1('0x1f')]();_0x1a0ca0[_0xd7d1('0x20')]();},_0x589109);strategy[_0xd7d1('0x21')](_0x326ce0,_0x101986,_0x545e4b,_0x48a987);}else{logger[_0xd7d1('0x10')](_0xd7d1('0x22'),_0x187634,_0x12504e['name']);_0x1a0ca0[_0xd7d1('0x1d')]();}}}catch(_0x10b213){console[_0xd7d1('0x23')](_0x10b213);logger[_0xd7d1('0x10')](_0xd7d1('0x24'),_0x187634,_0x10b213['stack']);_0x1a0ca0['stop']();}};}; \ No newline at end of file +var _0xdc3c=['next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','join','find','agents','createQueue','atimeout','channel','START:%s','end','close','rules','stop','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x258a70,_0x5eea18){var _0x8bbdb9=function(_0x484c07){while(--_0x484c07){_0x258a70['push'](_0x258a70['shift']());}};_0x8bbdb9(++_0x5eea18);}(_0xdc3c,0x1e7));var _0xcdc3=function(_0x4e876a,_0x314ef1){_0x4e876a=_0x4e876a-0x0;var _0xd369fe=_0xdc3c[_0x4e876a];return _0xd369fe;};'use strict';var schema=require(_0xcdc3('0x0'));var _=require(_0xcdc3('0x1'));var util=require(_0xcdc3('0x2'));var seqqueue=require(_0xcdc3('0x3'));var logger=require(_0xcdc3('0x4'))('routing');var strategy=require(_0xcdc3('0x5'));var queue=schema({'name':{'type':_0xcdc3('0x6'),'required':!![],'message':_0xcdc3('0x7')},'timeout':{'type':_0xcdc3('0x8'),'message':_0xcdc3('0x9')}});function writeLog(_0x550abe,_0x18c9dd,_0x47eb8e){return logger[_0xcdc3('0xa')](util[_0xcdc3('0xb')](_0xcdc3('0xc'),_0x550abe,_0x18c9dd[_0xcdc3('0xd')],_0x47eb8e));}function handleFindAgent(_0x2c16a6){return function(_0x188d17){return _0x188d17['name'][_0xcdc3('0xe')]()===_0x2c16a6[_0xcdc3('0xe')]();};}exports[_0xcdc3('0xf')]=function(_0x5fb64f,_0x4a631a,_0x54c29e,_0x6c52a9){return function(_0x428a9a){try{var _0x2c4367={'name':_0x4a631a[0x0],'timeout':_0x4a631a[0x1]};var _0x130bd4=queue[_0xcdc3('0x0')](_0x2c4367,{'typecast':!![]});if(_0x130bd4[_0xcdc3('0x10')]){logger['error'](_0xcdc3('0x11'),_0x5fb64f,_[_0xcdc3('0x12')](_0x130bd4,'message')[_0xcdc3('0x13')](',\x20'));_0x428a9a['stop']();}else{var _0x89dda=_[_0xcdc3('0x14')](_0x54c29e[_0xcdc3('0x15')],handleFindAgent(_0x2c4367['name']));if(_0x89dda){var _0x10c271=(_0x2c4367['timeout']||0xa)*0x3e8;var _0x3044b3,_0xd2189f;var _0x59ea98=seqqueue[_0xcdc3('0x16')](_0x10c271);_0x59ea98['id']=_0x5fb64f;_0x59ea98[_0xcdc3('0x17')]=_0x10c271;_0x59ea98[_0xcdc3('0x18')]=_0x6c52a9[_0xcdc3('0x18')];writeLog(_0x5fb64f,_0x89dda,util[_0xcdc3('0xb')](_0xcdc3('0x19'),_0x10c271));_0x54c29e['rules'][_0x5fb64f]['on'](_0xcdc3('0x1a'),function(){logger[_0xcdc3('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5fb64f);clearTimeout(_0xd2189f);_0xd2189f=undefined;_0x59ea98[_0xcdc3('0x1b')]();if(_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]){delete _0x54c29e[_0xcdc3('0x1c')][_0x5fb64f];}_0x428a9a[_0xcdc3('0x1d')]();});_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]['on']('complete',function(){if(_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]){delete _0x54c29e[_0xcdc3('0x1c')][_0x5fb64f];}});_0xd2189f=setTimeout(function(){logger[_0xcdc3('0xa')](_0xcdc3('0x1e'),_0x5fb64f);clearTimeout(_0xd2189f);_0x59ea98[_0xcdc3('0x1b')]();_0x428a9a[_0xcdc3('0x1f')]();},_0x10c271);strategy[_0xcdc3('0x20')](_0x59ea98,_0x89dda,_0x54c29e,_0x6c52a9);}else{logger[_0xcdc3('0x21')](_0xcdc3('0x22'),_0x5fb64f,_0x2c4367['name']);_0x428a9a[_0xcdc3('0x1d')]();}}}catch(_0x5ec35c){console[_0xcdc3('0x23')](_0x5ec35c);logger[_0xcdc3('0x21')](_0xcdc3('0x24'),_0x5fb64f,_0x5ec35c['stack']);_0x428a9a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 86c82e5..4d9fcad 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 _0xde60=['contact','format','channel','sms','whatsapp','interaction','phone','chat','account','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','then','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','next'];(function(_0x232be7,_0xaf078a){var _0x28728d=function(_0x217f10){while(--_0x217f10){_0x232be7['push'](_0x232be7['shift']());}};_0x28728d(++_0xaf078a);}(_0xde60,0x1e0));var _0x0de6=function(_0x735da9,_0x38b186){_0x735da9=_0x735da9-0x0;var _0x39160b=_0xde60[_0x735da9];return _0x39160b;};'use strict';var _=require(_0x0de6('0x0'));var moment=require(_0x0de6('0x1'));var AWS=require('aws-sdk');var utils=require(_0x0de6('0x2'));var logger=require(_0x0de6('0x3'))('routing');var rpc={'chatMessage':require(_0x0de6('0x4')),'openchannelMessage':require(_0x0de6('0x5')),'mailMessage':require(_0x0de6('0x6')),'smsMessage':require(_0x0de6('0x7')),'faxMessage':require(_0x0de6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x0de6('0x9')]=function(_0x2213cf,_0x46a555){return function(_0x1d68be){try{if(!_[_0x0de6('0xa')](this['interaction'][_0x0de6('0xb')])){logger[_0x0de6('0xc')](_0x0de6('0xd'),_0x2213cf,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d68be[_0x0de6('0xe')]();}var _0x43fc29={'ContactId':this[_0x0de6('0xf')]['id'],'sentAt':moment()[_0x0de6('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x0de6('0x11')]===_0x0de6('0x12')||this[_0x0de6('0x11')]===_0x0de6('0x13')){_0x43fc29['phone']=this[_0x0de6('0x14')][_0x0de6('0x15')];}var _0x397f15=this[_0x0de6('0x11')];if(_0x397f15===_0x0de6('0x16')){_0x43fc29['ChatWebsiteId']=this[_0x0de6('0x17')]['id'];}else{_0x43fc29[_[_0x0de6('0x18')](_0x397f15)+'AccountId']=this[_0x0de6('0x17')]['id'];}_0x43fc29[_[_0x0de6('0x18')](_0x397f15)+_0x0de6('0x19')]=this[_0x0de6('0x14')]['id'];if(this['interaction']['created']){var _0x2f1dc5=_0x46a555[0x4];if(!_[_0x0de6('0x1a')](_0x2f1dc5)){_0x43fc29['body']=utils[_0x0de6('0x1b')](_0x2f1dc5,this);return rpc[_0x397f15+_0x0de6('0x1c')][_0x0de6('0x1d')](_0x43fc29)['then'](function(_0x3c0b95){logger[_0x0de6('0xc')](_0x0de6('0xd'),_0x2213cf,_0x43fc29[_0x0de6('0x1e')]);})[_0x0de6('0x1f')](function(_0x5a6197){logger[_0x0de6('0x20')]('[%s][AMAZONLEX]\x20%s',_0x2213cf,JSON[_0x0de6('0x21')](_0x5a6197));})[_0x0de6('0x22')](function(){logger[_0x0de6('0xc')](_0x0de6('0x23'),_0x2213cf);_0x1d68be[_0x0de6('0x24')]();});}else{logger[_0x0de6('0xc')](_0x0de6('0x25'),_0x2213cf);_0x1d68be[_0x0de6('0x24')]();}}else{var _0x255c32=this;var _0x2993ed=new AWS['LexRuntime']({'accessKeyId':_0x46a555[0x0],'secretAccessKey':_0x46a555[0x1],'region':_0x46a555[0x2]});var _0x332ab5={'botAlias':_0x0de6('0x26'),'botName':_0x46a555[0x3],'inputText':this[_0x0de6('0x27')][_0x0de6('0x1e')],'userId':this[_0x0de6('0x11')]+':'+this['interaction']['id'][_0x0de6('0x28')]()};_0x2993ed[_0x0de6('0x29')](_0x332ab5,function(_0x37df27,_0x1cac45){if(_0x37df27){logger[_0x0de6('0x20')](_0x0de6('0xd'),_0x2213cf,_0x37df27['message']);_0x1d68be['next']();}else if(_0x1cac45&&_0x1cac45[_0x0de6('0x27')]){_0x255c32[_0x0de6('0x1e')]['amazonlex']=_0x1cac45;_0x43fc29[_0x0de6('0x1e')]=_0x1cac45[_0x0de6('0x27')];_0x43fc29['providerName']=_0x0de6('0x2a');_0x43fc29[_0x0de6('0x2b')]=JSON[_0x0de6('0x21')](_0x1cac45);return rpc[_0x397f15+'Message'][_0x0de6('0x1d')](_0x43fc29)[_0x0de6('0x2c')](function(_0x2667ca){logger[_0x0de6('0xc')](_0x0de6('0xd'),_0x2213cf,_0x43fc29['body']);if(_0x1cac45['dialogState']=='Failed'){_0x1d68be[_0x0de6('0xe')]();}else{_0x1d68be[_0x0de6('0x24')]();}})[_0x0de6('0x1f')](function(_0x5d3ced){logger['error'](_0x0de6('0xd'),_0x2213cf,JSON['stringify'](_0x5d3ced));_0x1d68be[_0x0de6('0xe')]();});}else{_0x1d68be[_0x0de6('0xe')]();}});}}catch(_0x4aaf74){logger[_0x0de6('0x20')]('[%s][AMAZONLEX]\x20%s',_0x2213cf,JSON[_0x0de6('0x21')](_0x4aaf74));_0x1d68be['stop']();}};}; \ No newline at end of file +var _0x82eb=['UserId','info','[%s][AMAZONLEX]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','providerName','amazonlex','providerResponse','Message','dialogState','next','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x494ab9,_0x5dfb88){var _0xbbe59f=function(_0x5b12c9){while(--_0x5b12c9){_0x494ab9['push'](_0x494ab9['shift']());}};_0xbbe59f(++_0x5dfb88);}(_0x82eb,0x19d));var _0xb82e=function(_0x561066,_0x522b77){_0x561066=_0x561066-0x0;var _0x5a3420=_0x82eb[_0x561066];return _0x5a3420;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xb82e('0x0'));var utils=require('./utils');var logger=require(_0xb82e('0x1'))(_0xb82e('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb82e('0x3')),'mailMessage':require(_0xb82e('0x4')),'smsMessage':require(_0xb82e('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb82e('0x6'))};exports[_0xb82e('0x7')]=function(_0x5065ff,_0x1e8a6a){return function(_0x381f51){try{if(!_[_0xb82e('0x8')](this[_0xb82e('0x9')][_0xb82e('0xa')])){logger[_0xb82e('0xb')](_0xb82e('0xc'),_0x5065ff,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x381f51['next']();}var _0x5f2b75={'ContactId':this[_0xb82e('0xd')]['id'],'sentAt':moment()[_0xb82e('0xe')](_0xb82e('0xf')),'direction':_0xb82e('0x10')};if(this[_0xb82e('0x11')]===_0xb82e('0x12')||this[_0xb82e('0x11')]===_0xb82e('0x13')){_0x5f2b75['phone']=this[_0xb82e('0x9')][_0xb82e('0x14')];}var _0x4be938=this[_0xb82e('0x11')];if(_0x4be938===_0xb82e('0x15')){_0x5f2b75['ChatWebsiteId']=this[_0xb82e('0x16')]['id'];}else{_0x5f2b75[_[_0xb82e('0x17')](_0x4be938)+_0xb82e('0x18')]=this['account']['id'];}_0x5f2b75[_['upperFirst'](_0x4be938)+_0xb82e('0x19')]=this[_0xb82e('0x9')]['id'];if(this[_0xb82e('0x9')][_0xb82e('0x1a')]){var _0x2f9edd=_0x1e8a6a[0x4];if(!_[_0xb82e('0x1b')](_0x2f9edd)){_0x5f2b75['body']=utils[_0xb82e('0x1c')](_0x2f9edd,this);return rpc[_0x4be938+'Message'][_0xb82e('0x1d')](_0x5f2b75)[_0xb82e('0x1e')](function(_0x4e5af1){logger[_0xb82e('0xb')]('[%s][AMAZONLEX]\x20%s',_0x5065ff,_0x5f2b75[_0xb82e('0x1f')]);})['catch'](function(_0x2cf03d){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,JSON[_0xb82e('0x21')](_0x2cf03d));})[_0xb82e('0x22')](function(){logger[_0xb82e('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5065ff);_0x381f51[_0xb82e('0x23')]();});}else{logger[_0xb82e('0xb')](_0xb82e('0x24'),_0x5065ff);_0x381f51[_0xb82e('0x23')]();}}else{var _0x118c23=this;var _0x63cab5=new AWS[(_0xb82e('0x25'))]({'accessKeyId':_0x1e8a6a[0x0],'secretAccessKey':_0x1e8a6a[0x1],'region':_0x1e8a6a[0x2]});var _0x238c6d={'botAlias':_0xb82e('0x26'),'botName':_0x1e8a6a[0x3],'inputText':this[_0xb82e('0x27')][_0xb82e('0x1f')],'userId':this['channel']+':'+this['interaction']['id'][_0xb82e('0x28')]()};_0x63cab5['postText'](_0x238c6d,function(_0x4ca8ef,_0xe621df){if(_0x4ca8ef){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,_0x4ca8ef['message']);_0x381f51['next']();}else if(_0xe621df&&_0xe621df[_0xb82e('0x27')]){_0x118c23[_0xb82e('0x1f')]['amazonlex']=_0xe621df;_0x5f2b75[_0xb82e('0x1f')]=_0xe621df['message'];_0x5f2b75[_0xb82e('0x29')]=_0xb82e('0x2a');_0x5f2b75[_0xb82e('0x2b')]=JSON[_0xb82e('0x21')](_0xe621df);return rpc[_0x4be938+_0xb82e('0x2c')][_0xb82e('0x1d')](_0x5f2b75)[_0xb82e('0x1e')](function(_0x2f5a03){logger[_0xb82e('0xb')](_0xb82e('0xc'),_0x5065ff,_0x5f2b75[_0xb82e('0x1f')]);if(_0xe621df[_0xb82e('0x2d')]=='Failed'){_0x381f51[_0xb82e('0x2e')]();}else{_0x381f51[_0xb82e('0x23')]();}})['catch'](function(_0x19cf31){logger[_0xb82e('0x20')]('[%s][AMAZONLEX]\x20%s',_0x5065ff,JSON[_0xb82e('0x21')](_0x19cf31));_0x381f51[_0xb82e('0x2e')]();});}else{_0x381f51[_0xb82e('0x2e')]();}});}}catch(_0x453b73){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,JSON['stringify'](_0x453b73));_0x381f51['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 8e0f0be..f81111f 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 _0x0ada=['../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','autoreplyExecuted','Interaction','update','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x0ada,0x10f));var _0xa0ad=function(_0x3b6502,_0x152883){_0x3b6502=_0x3b6502-0x0;var _0x216fc9=_0x0ada[_0x3b6502];return _0x216fc9;};'use strict';var _=require(_0xa0ad('0x0'));var moment=require('moment');var utils=require(_0xa0ad('0x1'));var logger=require(_0xa0ad('0x2'))(_0xa0ad('0x3'));var rpc={'chatMessage':require(_0xa0ad('0x4')),'openchannelMessage':require(_0xa0ad('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa0ad('0x6')),'faxMessage':require(_0xa0ad('0x7')),'whatsappMessage':require(_0xa0ad('0x8')),'chatInteraction':require(_0xa0ad('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xa0ad('0xa')),'smsInteraction':require(_0xa0ad('0xb')),'faxInteraction':require(_0xa0ad('0xc')),'whatsappInteraction':require(_0xa0ad('0xd'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x5a2bbf,_0x43a8bf,_0x31679a,_0x190a4b){return function(_0x3085ab){try{var _0x480618=this['channel'];if(_0x480618===_0xa0ad('0xe')&&_0x190a4b[_0xa0ad('0xf')][_0xa0ad('0x10')]){logger[_0xa0ad('0x11')](_0xa0ad('0x12'),_0x5a2bbf,_0xa0ad('0x13'));return _0x3085ab[_0xa0ad('0x14')]();}if(_0x43a8bf[0x0]==='1'&&(_[_0xa0ad('0x15')](this['interaction'][_0xa0ad('0x16')])||!this[_0xa0ad('0x17')][_0xa0ad('0x16')])){logger[_0xa0ad('0x11')](_0xa0ad('0x12'),_0x5a2bbf,_0xa0ad('0x18'));return _0x3085ab[_0xa0ad('0x14')]();}if(_0x43a8bf[0x0]==='2'&&this[_0xa0ad('0x17')]['autoreplyExecuted']){logger[_0xa0ad('0x11')](_0xa0ad('0x19'),_0x5a2bbf,_0xa0ad('0x1a'));return _0x3085ab['next']();}var _0x3c95e3={'ContactId':this[_0xa0ad('0x1b')]['id'],'sentAt':moment()[_0xa0ad('0x1c')](_0xa0ad('0x1d')),'direction':_0xa0ad('0x1e')};if(this[_0xa0ad('0x1f')]===_0xa0ad('0xe')){_0x3c95e3['body']=utils[_0xa0ad('0x20')](_0x43a8bf[0x2],this);}else{_0x3c95e3[_0xa0ad('0xf')]=utils[_0xa0ad('0x20')](_0x43a8bf[0x1],this);}if(this[_0xa0ad('0x21')]){_0x3c95e3['to']=this[_0xa0ad('0x21')]['from']||'';if(this[_0xa0ad('0x1f')]===_0xa0ad('0xe')&&_0x43a8bf[0x1]==='1'){_0x3c95e3['cc']=this[_0xa0ad('0x21')]['cc']||'';}_0x3c95e3[_0xa0ad('0x22')]=this[_0xa0ad('0x21')]['to']||'';_0x3c95e3[_0xa0ad('0x23')]=this[_0xa0ad('0x21')][_0xa0ad('0x23')]||'';_0x3c95e3[_0xa0ad('0x24')]=!![];if(this[_0xa0ad('0x21')][_0xa0ad('0x25')]){_0x3c95e3['subject']='';_0x3c95e3[_0xa0ad('0x25')]+=_['startsWith'](this['message']['subject'],_0xa0ad('0x26'))?'':_0xa0ad('0x27');_0x3c95e3[_0xa0ad('0x25')]+=this['message']['subject'];}}if(this[_0xa0ad('0x1f')]==='chat'){_0x3c95e3[_0xa0ad('0x28')]=this[_0xa0ad('0x29')]['id'];}else{_0x3c95e3[_[_0xa0ad('0x2a')](this[_0xa0ad('0x1f')])+_0xa0ad('0x2b')]=this[_0xa0ad('0x29')]['id'];}_0x3c95e3[_[_0xa0ad('0x2a')](this[_0xa0ad('0x1f')])+_0xa0ad('0x2c')]=this[_0xa0ad('0x17')]['id'];var _0xbacb6a=this[_0xa0ad('0x17')];if(rpc[this['channel']+_0xa0ad('0x2d')]){if(this[_0xa0ad('0x1f')]===_0xa0ad('0xe')){_0x3c95e3[_0xa0ad('0x2e')]=this[_0xa0ad('0x21')]['messageId'];_0x3c95e3[_0xa0ad('0x2f')]=''+_['replace'](_0x3c95e3[_0xa0ad('0xf')],_0xa0ad('0x30'),_0xa0ad('0x31'))+_0xa0ad('0x32');_0x3c95e3['headers']={'Auto-Submitted':_0xa0ad('0x33'),'X-Auto-Response-Suppress':_0xa0ad('0x34'),'Precedence':_0xa0ad('0x35')};return mailRpc[_0xa0ad('0x36')](this['account']['smtpOptions'],_0x3c95e3)[_0xa0ad('0x37')](function(_0x322a7c){logger[_0xa0ad('0x11')](_0xa0ad('0x38'),_0x5a2bbf);_0x3c95e3['messageId']=_0x322a7c['message'][_0xa0ad('0x39')];return rpc[_0x480618+_0xa0ad('0x2d')][_0xa0ad('0x3a')](_0x3c95e3);})[_0xa0ad('0x37')](function(_0x1a127a){logger[_0xa0ad('0x11')]('[%s][AUTOREPLY]\x20%s',_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x1a127a));})['catch'](function(_0x5100cf){logger['error'](_0xa0ad('0x3c'),_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x5100cf));})[_0xa0ad('0x3d')](function(){Promise['resolve']()[_0xa0ad('0x37')](function(){if(_0x43a8bf[0x0]!=='2'||_0xbacb6a[_0xa0ad('0x3e')])return;return rpc[_0x480618+_0xa0ad('0x3f')][_0xa0ad('0x40')](_0xbacb6a['id'],{'autoreplyExecuted':!![]})[_0xa0ad('0x37')](function(_0x1b29c7){logger[_0xa0ad('0x11')](_0xa0ad('0x19'),_0x5a2bbf,JSON['stringify'](_0x1b29c7));})[_0xa0ad('0x41')](function(_0x56e7cc){logger[_0xa0ad('0x42')](_0xa0ad('0x43'),_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x56e7cc));});})[_0xa0ad('0x37')](function(){_0x3085ab[_0xa0ad('0x14')]();});});}else{return rpc[this[_0xa0ad('0x1f')]+'Message'][_0xa0ad('0x3a')](_0x3c95e3)[_0xa0ad('0x37')](function(){logger['info'](_0xa0ad('0x12'),_0x5a2bbf,_0x3c95e3[_0xa0ad('0xf')]);})['catch'](function(_0x18a712){logger[_0xa0ad('0x42')](_0xa0ad('0x12'),_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x18a712));})[_0xa0ad('0x3d')](function(){Promise['resolve']()[_0xa0ad('0x37')](function(){if(_0x43a8bf[0x0]!=='2'||_0xbacb6a[_0xa0ad('0x3e')])return;return rpc[_0x480618+_0xa0ad('0x3f')][_0xa0ad('0x40')](_0xbacb6a['id'],{'autoreplyExecuted':!![]})[_0xa0ad('0x37')](function(_0x2a8a3e){logger[_0xa0ad('0x11')](_0xa0ad('0x19'),_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x2a8a3e));})[_0xa0ad('0x41')](function(_0x3e56fd){logger[_0xa0ad('0x42')](_0xa0ad('0x43'),_0x5a2bbf,JSON[_0xa0ad('0x3b')](_0x3e56fd));});})[_0xa0ad('0x37')](function(){_0x3085ab[_0xa0ad('0x14')]();});});}}}catch(_0x7d6d03){logger['error']('[%s][AUTOREPLY]\x20%s',_0x5a2bbf,JSON['stringify'](_0x7d6d03));_0x3085ab[_0xa0ad('0x44')]();}};}; \ No newline at end of file +var _0x51d7=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','replace','';_0x3342ce[_0x751d('0x31')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x751d('0x32'),'Precedence':'auto_reply'};return mailRpc[_0x751d('0x33')](this[_0x751d('0x34')][_0x751d('0x35')],_0x3342ce)[_0x751d('0x36')](function(_0x2b36b0){logger[_0x751d('0x13')](_0x751d('0x37'),_0x5c8e62);_0x3342ce[_0x751d('0x38')]=_0x2b36b0[_0x751d('0x20')][_0x751d('0x38')];return rpc[_0x47c6f7+_0x751d('0x2a')][_0x751d('0x39')](_0x3342ce);})[_0x751d('0x36')](function(_0x191c98){logger[_0x751d('0x13')](_0x751d('0x14'),_0x5c8e62,JSON['stringify'](_0x191c98));})[_0x751d('0x3a')](function(_0x35cdca){logger[_0x751d('0x3b')](_0x751d('0x3c'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x35cdca));})['finally'](function(){Promise['resolve']()[_0x751d('0x36')](function(){if(_0x465910[0x0]!=='2'||_0x125017[_0x751d('0x19')])return;return rpc[_0x47c6f7+_0x751d('0x3e')][_0x751d('0x3f')](_0x125017['id'],{'autoreplyExecuted':!![]})[_0x751d('0x36')](function(_0xbc7925){logger[_0x751d('0x13')](_0x751d('0x1a'),_0x5c8e62,JSON['stringify'](_0xbc7925));})['catch'](function(_0x9ff067){logger[_0x751d('0x3b')](_0x751d('0x40'),_0x5c8e62,JSON['stringify'](_0x9ff067));});})[_0x751d('0x36')](function(){_0x430755[_0x751d('0x15')]();});});}else{return rpc[this[_0x751d('0xf')]+_0x751d('0x2a')][_0x751d('0x39')](_0x3342ce)['then'](function(){logger['info'](_0x751d('0x14'),_0x5c8e62,_0x3342ce[_0x751d('0x11')]);})[_0x751d('0x3a')](function(_0x814f71){logger[_0x751d('0x3b')](_0x751d('0x14'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x814f71));})['finally'](function(){Promise[_0x751d('0x41')]()['then'](function(){if(_0x465910[0x0]!=='2'||_0x125017['autoreplyExecuted'])return;return rpc[_0x47c6f7+_0x751d('0x3e')][_0x751d('0x3f')](_0x125017['id'],{'autoreplyExecuted':!![]})[_0x751d('0x36')](function(_0x383836){logger[_0x751d('0x13')](_0x751d('0x1a'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x383836));})[_0x751d('0x3a')](function(_0x165db7){logger[_0x751d('0x3b')](_0x751d('0x40'),_0x5c8e62,JSON['stringify'](_0x165db7));});})['then'](function(){_0x430755['next']();});});}}}catch(_0x259579){logger[_0x751d('0x3b')](_0x751d('0x14'),_0x5c8e62,JSON['stringify'](_0x259579));_0x430755[_0x751d('0x42')]();}};}; \ 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 d0388bc..c2a4a81 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 _0x6606=['moment','../../../../config/logger','routing','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x199469,_0x661c68){var _0x3a72df=function(_0x2b8265){while(--_0x2b8265){_0x199469['push'](_0x199469['shift']());}};_0x3a72df(++_0x661c68);}(_0x6606,0x1b8));var _0x6660=function(_0x1ec6b5,_0x362903){_0x1ec6b5=_0x1ec6b5-0x0;var _0x1666b0=_0x6606[_0x1ec6b5];return _0x1666b0;};'use strict';var moment=require(_0x6660('0x0'));var logger=require(_0x6660('0x1'))(_0x6660('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6660('0x3')),'mailInteraction':require(_0x6660('0x4')),'faxInteraction':require(_0x6660('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x902af4,_0x29be3b,_0x3dbc90,_0x367917){return function(_0xec7847){try{logger[_0x6660('0x6')](_0x6660('0x7'),_0x902af4,_0x29be3b[0x0]);var _0x20052a={'closed':0x1,'closedAt':moment()[_0x6660('0x8')](_0x6660('0x9')),'closeReason':_0x6660('0xa'),'disposition':_0x29be3b[0x0]};if(rpc[_0x367917['channel']+'Interaction']){rpc[_0x367917[_0x6660('0xb')]+_0x6660('0xc')][_0x6660('0xd')](_0x367917['interaction']['id'],_0x20052a)[_0x6660('0xe')](function(_0x510834){logger[_0x6660('0x6')](_0x6660('0xf'),_0x902af4,_0x367917[_0x6660('0x10')]['id']);})[_0x6660('0x11')](function(_0x41c4a5){logger[_0x6660('0x12')](_0x6660('0x13'),_0x902af4,JSON[_0x6660('0x14')](_0x41c4a5));})[_0x6660('0x15')](function(){_0xec7847['stop']();});}}catch(_0x321814){logger[_0x6660('0x12')](_0x6660('0x13'),_0x902af4,JSON[_0x6660('0x14')](_0x321814));_0xec7847['stop']();}};}; \ No newline at end of file +var _0x6bb0=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing'];(function(_0x30817f,_0x487653){var _0x1ec8c1=function(_0xf6bbc9){while(--_0xf6bbc9){_0x30817f['push'](_0x30817f['shift']());}};_0x1ec8c1(++_0x487653);}(_0x6bb0,0x7b));var _0x06bb=function(_0x394b03,_0x3cecf5){_0x394b03=_0x394b03-0x0;var _0x5c420d=_0x6bb0[_0x394b03];return _0x5c420d;};'use strict';var moment=require(_0x06bb('0x0'));var logger=require(_0x06bb('0x1'))(_0x06bb('0x2'));var rpc={'chatInteraction':require(_0x06bb('0x3')),'openchannelInteraction':require(_0x06bb('0x4')),'smsInteraction':require(_0x06bb('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x06bb('0x6'))};exports[_0x06bb('0x7')]=function(_0xa4f207,_0x138ccc,_0x485d34,_0x2d8808){return function(_0x189bf2){try{logger[_0x06bb('0x8')](_0x06bb('0x9'),_0xa4f207,_0x138ccc[0x0]);var _0x4f8c78={'closed':0x1,'closedAt':moment()['format'](_0x06bb('0xa')),'closeReason':'system','disposition':_0x138ccc[0x0]};if(rpc[_0x2d8808[_0x06bb('0xb')]+'Interaction']){rpc[_0x2d8808[_0x06bb('0xb')]+_0x06bb('0xc')][_0x06bb('0xd')](_0x2d8808[_0x06bb('0xe')]['id'],_0x4f8c78)['then'](function(_0x549a54){logger[_0x06bb('0x8')](_0x06bb('0xf'),_0xa4f207,_0x2d8808[_0x06bb('0xe')]['id']);})[_0x06bb('0x10')](function(_0x2e4429){logger[_0x06bb('0x11')]('[%s][CLOSE]\x20%s',_0xa4f207,JSON['stringify'](_0x2e4429));})['finally'](function(){_0x189bf2['stop']();});}}catch(_0x1f708d){logger[_0x06bb('0x11')](_0x06bb('0x12'),_0xa4f207,JSON[_0x06bb('0x13')](_0x1f708d));_0x189bf2[_0x06bb('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 0ffab53..650a368 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 _0xad78=['[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','fulfillment','speech','providerName','providerResponse','stringify','metadata','endConversation','catch','lodash','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info'];(function(_0x5d88eb,_0x1bfc59){var _0x143caa=function(_0x12e837){while(--_0x12e837){_0x5d88eb['push'](_0x5d88eb['shift']());}};_0x143caa(++_0x1bfc59);}(_0xad78,0x149));var _0x8ad7=function(_0x44636e,_0x43bd10){_0x44636e=_0x44636e-0x0;var _0x38735d=_0xad78[_0x44636e];return _0x38735d;};'use strict';var _=require(_0x8ad7('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x8ad7('0x1'));var utils=require(_0x8ad7('0x2'));var logger=require('../../../../config/logger')(_0x8ad7('0x3'));var rpc={'chatMessage':require(_0x8ad7('0x4')),'openchannelMessage':require(_0x8ad7('0x5')),'mailMessage':require(_0x8ad7('0x6')),'smsMessage':require(_0x8ad7('0x7')),'faxMessage':require(_0x8ad7('0x8')),'whatsappMessage':require(_0x8ad7('0x9'))};exports[_0x8ad7('0xa')]=function(_0x415e9c,_0x3daa2d){return function(_0x49aeb1){try{if(!_['isNil'](this[_0x8ad7('0xb')][_0x8ad7('0xc')])){logger[_0x8ad7('0xd')](_0x8ad7('0xe'),_0x415e9c,_0x8ad7('0xf'));return _0x49aeb1[_0x8ad7('0x10')]();}var _0x22e528={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8ad7('0x11')](_0x8ad7('0x12')),'direction':_0x8ad7('0x13')};if(this['channel']===_0x8ad7('0x14')||this[_0x8ad7('0x15')]===_0x8ad7('0x16')){_0x22e528[_0x8ad7('0x17')]=this[_0x8ad7('0xb')][_0x8ad7('0x17')];}var _0x218072=this[_0x8ad7('0x15')];if(_0x218072===_0x8ad7('0x18')){_0x22e528[_0x8ad7('0x19')]=this[_0x8ad7('0x1a')]['id'];}else{_0x22e528[_['upperFirst'](_0x218072)+'AccountId']=this[_0x8ad7('0x1a')]['id'];}_0x22e528[_['upperFirst'](_0x218072)+_0x8ad7('0x1b')]=this[_0x8ad7('0xb')]['id'];if(this['interaction']['created']){var _0x2d17a0=_0x3daa2d[0x2];if(!_[_0x8ad7('0x1c')](_0x2d17a0)){_0x22e528[_0x8ad7('0x1d')]=utils[_0x8ad7('0x1e')](_0x2d17a0,this);return rpc[_0x218072+_0x8ad7('0x1f')][_0x8ad7('0x20')](_0x22e528)[_0x8ad7('0x21')](function(_0x4aaef9){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x415e9c,_0x22e528[_0x8ad7('0x1d')]);})['catch'](function(_0x11b081){logger[_0x8ad7('0x22')](_0x8ad7('0xe'),_0x415e9c,JSON['stringify'](_0x11b081));})['finally'](function(){logger['info'](_0x8ad7('0x23'),_0x415e9c);_0x49aeb1['stop']();});}else{logger['info'](_0x8ad7('0x24'),_0x415e9c);_0x49aeb1[_0x8ad7('0x25')]();}}else{var _0x46edc1=this;var _0x4f75a7=apiai(_0x3daa2d[0x0],{'language':_0x3daa2d[0x1]||'en'});return _0x4f75a7[_0x8ad7('0x26')](this[_0x8ad7('0x27')][_0x8ad7('0x1d')],{'sessionId':md5(this[_0x8ad7('0xb')]['id'])})[_0x8ad7('0x21')](function(_0x429b7f){_0x46edc1['body'][_0x8ad7('0x28')]=_0x429b7f;_0x22e528[_0x8ad7('0x1d')]=_0x429b7f['result'][_0x8ad7('0x29')][_0x8ad7('0x2a')];_0x22e528[_0x8ad7('0x2b')]=_0x8ad7('0x28');_0x22e528[_0x8ad7('0x2c')]=JSON[_0x8ad7('0x2d')](_0x429b7f);return rpc[_0x218072+_0x8ad7('0x1f')]['create'](_0x22e528)['then'](function(_0x2c10a7){logger['info'](_0x8ad7('0xe'),_0x415e9c,_0x22e528[_0x8ad7('0x1d')]);if(_0x429b7f['result'][_0x8ad7('0x2e')][_0x8ad7('0x2f')]){_0x49aeb1[_0x8ad7('0x10')]();}else{_0x49aeb1['stop']();}})[_0x8ad7('0x30')](function(_0x5cf1c5){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x415e9c,JSON[_0x8ad7('0x2d')](_0x5cf1c5));_0x49aeb1[_0x8ad7('0x10')]();});})[_0x8ad7('0x30')](function(_0x38f101){logger[_0x8ad7('0x22')](_0x8ad7('0xe'),_0x415e9c,_0x38f101[_0x8ad7('0x27')]);_0x49aeb1[_0x8ad7('0x10')]();});}}catch(_0x363a15){logger[_0x8ad7('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x415e9c,JSON[_0x8ad7('0x2d')](_0x363a15));_0x49aeb1[_0x8ad7('0x25')]();}};}; \ No newline at end of file +var _0xab9f=['channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','body','Message','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out'];(function(_0x3cae04,_0x44456b){var _0x325f6b=function(_0xb1f961){while(--_0xb1f961){_0x3cae04['push'](_0x3cae04['shift']());}};_0x325f6b(++_0x44456b);}(_0xab9f,0x1bd));var _0xfab9=function(_0x69a748,_0x7e2ee1){_0x69a748=_0x69a748-0x0;var _0x116db0=_0xab9f[_0x69a748];return _0x116db0;};'use strict';var _=require(_0xfab9('0x0'));var moment=require('moment');var apiai=require(_0xfab9('0x1'));var md5=require(_0xfab9('0x2'));var utils=require(_0xfab9('0x3'));var logger=require('../../../../config/logger')(_0xfab9('0x4'));var rpc={'chatMessage':require(_0xfab9('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfab9('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfab9('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfab9('0x8')]=function(_0x341aaf,_0x1918e4){return function(_0x27e769){try{if(!_['isNil'](this[_0xfab9('0x9')][_0xfab9('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xfab9('0xb'));return _0x27e769[_0xfab9('0xc')]();}var _0xcc59f9={'ContactId':this[_0xfab9('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xfab9('0xe')};if(this[_0xfab9('0xf')]===_0xfab9('0x10')||this[_0xfab9('0xf')]===_0xfab9('0x11')){_0xcc59f9[_0xfab9('0x12')]=this[_0xfab9('0x9')][_0xfab9('0x12')];}var _0x3a39c0=this[_0xfab9('0xf')];if(_0x3a39c0==='chat'){_0xcc59f9[_0xfab9('0x13')]=this[_0xfab9('0x14')]['id'];}else{_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+_0xfab9('0x16')]=this[_0xfab9('0x14')]['id'];}_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+'InteractionId']=this[_0xfab9('0x9')]['id'];if(this[_0xfab9('0x9')][_0xfab9('0x17')]){var _0x479db4=_0x1918e4[0x2];if(!_['isEmpty'](_0x479db4)){_0xcc59f9[_0xfab9('0x18')]=utils['getMustacheRender'](_0x479db4,this);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)[_0xfab9('0x1b')](function(_0x41509f){logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);})[_0xfab9('0x1d')](function(_0x3f3180){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x3f3180));})[_0xfab9('0x21')](function(){logger[_0xfab9('0x1c')](_0xfab9('0x22'),_0x341aaf);_0x27e769[_0xfab9('0x23')]();});}else{logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x341aaf);_0x27e769[_0xfab9('0x23')]();}}else{var _0x2ba794=this;var _0x39ef03=apiai(_0x1918e4[0x0],{'language':_0x1918e4[0x1]||'en'});return _0x39ef03[_0xfab9('0x24')](this['message'][_0xfab9('0x18')],{'sessionId':md5(this[_0xfab9('0x9')]['id'])})[_0xfab9('0x1b')](function(_0x1dd605){_0x2ba794[_0xfab9('0x18')][_0xfab9('0x25')]=_0x1dd605;_0xcc59f9[_0xfab9('0x18')]=_0x1dd605[_0xfab9('0x26')][_0xfab9('0x27')][_0xfab9('0x28')];_0xcc59f9[_0xfab9('0x29')]=_0xfab9('0x25');_0xcc59f9[_0xfab9('0x2a')]=JSON[_0xfab9('0x20')](_0x1dd605);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)['then'](function(_0x1bb377){logger[_0xfab9('0x1c')](_0xfab9('0x1f'),_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);if(_0x1dd605['result'][_0xfab9('0x2b')][_0xfab9('0x2c')]){_0x27e769[_0xfab9('0xc')]();}else{_0x27e769[_0xfab9('0x23')]();}})[_0xfab9('0x1d')](function(_0x155440){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x155440));_0x27e769[_0xfab9('0xc')]();});})[_0xfab9('0x1d')](function(_0x34b04e){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,_0x34b04e[_0xfab9('0x2d')]);_0x27e769[_0xfab9('0xc')]();});}}catch(_0x10cca4){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x10cca4));_0x27e769[_0xfab9('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 5aadcaa..828207c 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb3a=['whatsapp','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','isEmpty','getMustacheRender','then','error','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_SCORE','intentDetectionConfidence','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x451426,_0x437afb){var _0x1baaa4=function(_0x5691e9){while(--_0x5691e9){_0x451426['push'](_0x451426['shift']());}};_0x1baaa4(++_0x437afb);}(_0xeb3a,0x12f));var _0xaeb3=function(_0x698949,_0x3ae507){_0x698949=_0x698949-0x0;var _0x1dc953=_0xeb3a[_0x698949];return _0x1dc953;};'use strict';var _=require(_0xaeb3('0x0'));var dialogflow=require(_0xaeb3('0x1'));var md5=require(_0xaeb3('0x2'));var moment=require(_0xaeb3('0x3'));var Promise=require(_0xaeb3('0x4'));var logger=require('../../../../config/logger')('routing');var utils=require(_0xaeb3('0x5'));var rpc={'chatMessage':require(_0xaeb3('0x6')),'openchannelMessage':require(_0xaeb3('0x7')),'mailMessage':require(_0xaeb3('0x8')),'smsMessage':require(_0xaeb3('0x9')),'faxMessage':require(_0xaeb3('0xa')),'whatsappMessage':require(_0xaeb3('0xb'))};function createMessage(_0x41f3aa,_0x5dc556,_0x35e622,_0x4decc6){return new Promise(function(_0x24827f,_0x11d76c){var _0x187701=_[_0xaeb3('0xc')](_0x35e622);_0x187701[_0xaeb3('0xd')]=_0x4decc6;return rpc[_0x5dc556+_0xaeb3('0xe')][_0xaeb3('0xf')](_0x187701)['then'](function(){logger[_0xaeb3('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x41f3aa,_0x187701[_0xaeb3('0xd')]);_0x24827f();})[_0xaeb3('0x11')](function(_0x35c30e){logger['error'](_0xaeb3('0x12'),_0x41f3aa,JSON[_0xaeb3('0x13')](_0x35c30e));_0x11d76c(_0x35c30e);});});}exports[_0xaeb3('0x14')]=function(_0x1d8535,_0x8c2161){return function(_0x173b28){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0xaeb3('0x10')](_0xaeb3('0x12'),_0x1d8535,_0xaeb3('0x15'));return _0x173b28[_0xaeb3('0x16')]();}var _0x3a7131={'ContactId':this[_0xaeb3('0x17')]['id'],'sentAt':moment()['format'](_0xaeb3('0x18')),'direction':_0xaeb3('0x19')};if(this['channel']==='sms'||this[_0xaeb3('0x1a')]===_0xaeb3('0x1b')){_0x3a7131['phone']=this['interaction']['phone'];}var _0x35245d=this[_0xaeb3('0x1a')];if(_0x35245d===_0xaeb3('0x1c')){_0x3a7131[_0xaeb3('0x1d')]=this[_0xaeb3('0x1e')]['id'];}else{_0x3a7131[_['upperFirst'](_0x35245d)+_0xaeb3('0x1f')]=this[_0xaeb3('0x1e')]['id'];}_0x3a7131[_[_0xaeb3('0x20')](_0x35245d)+_0xaeb3('0x21')]=this[_0xaeb3('0x22')]['id'];if(this['interaction']['created']){var _0x1f6e4c=_0x8c2161[0x4];if(!_[_0xaeb3('0x23')](_0x1f6e4c)){_0x3a7131[_0xaeb3('0xd')]=utils[_0xaeb3('0x24')](_0x1f6e4c,this);return rpc[_0x35245d+_0xaeb3('0xe')][_0xaeb3('0xf')](_0x3a7131)[_0xaeb3('0x25')](function(_0x1dcd25){logger[_0xaeb3('0x10')](_0xaeb3('0x12'),_0x1d8535,_0x3a7131[_0xaeb3('0xd')]);})['catch'](function(_0xe56ec8){logger[_0xaeb3('0x26')](_0xaeb3('0x12'),_0x1d8535,JSON[_0xaeb3('0x13')](_0xe56ec8));})['finally'](function(){logger[_0xaeb3('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1d8535);_0x173b28[_0xaeb3('0x27')]();});}else{logger[_0xaeb3('0x10')](_0xaeb3('0x28'),_0x1d8535);_0x173b28['stop']();}}else{var _0xb10cd4=this;var _0x588592=_0x8c2161[0x2][_0xaeb3('0x29')](/\\n/g,'\x0a');var _0x3543b0={'credentials':{'private_key':_0x588592,'client_email':_0x8c2161[0x1]}};var _0x51701e=new dialogflow[(_0xaeb3('0x2a'))](_0x3543b0);var _0x23dd08=_0x51701e[_0xaeb3('0x2b')](_0x8c2161[0x0],md5(_0xb10cd4['interaction']['id']));var _0x1bdbea={'session':_0x23dd08,'queryInput':{'text':{'text':_0xb10cd4[_0xaeb3('0x2c')]['body'],'languageCode':_0x8c2161[0x3]||'en'}}};return _0x51701e[_0xaeb3('0x2d')](_0x1bdbea)['then'](function(_0x455fa9){if(_0x455fa9&&_0x455fa9[_0xaeb3('0x2e')]){_0xb10cd4['body'][_0xaeb3('0x2f')]=_0x455fa9;var _0x36974b=_0x455fa9[0x0];var _0x1608ef=_0x36974b[_0xaeb3('0x30')]['diagnosticInfo']&&_0x36974b['queryResult'][_0xaeb3('0x31')][_0xaeb3('0x32')]?_0x36974b['queryResult'][_0xaeb3('0x31')][_0xaeb3('0x32')][_0xaeb3('0x33')][_0xaeb3('0x34')]:![];_0xb10cd4[_0xaeb3('0xd')][_0xaeb3('0x35')]=_0x36974b['queryResult']['action'];_0xb10cd4[_0xaeb3('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x36')];_0xb10cd4[_0xaeb3('0xd')][_0xaeb3('0x37')]=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x31')]&&_0x36974b['queryResult'][_0xaeb3('0x31')][_0xaeb3('0x32')]?_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x31')]['fields']['end_conversation']['boolValue']:![];_0xb10cd4[_0xaeb3('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x38')][_0xaeb3('0x39')];_0xb10cd4[_0xaeb3('0xd')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x38')][_0xaeb3('0x3a')];_0xb10cd4['body'][_0xaeb3('0x3b')]=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x38')][_0xaeb3('0x3c')];_0xb10cd4[_0xaeb3('0xd')]['DIALOGFLOWV2_LANGUAGECODE']=_0x36974b[_0xaeb3('0x30')]['languageCode'];_0xb10cd4[_0xaeb3('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x36974b[_0xaeb3('0x30')]['queryText'];_0xb10cd4[_0xaeb3('0xd')][_0xaeb3('0x3d')]=_0x36974b[_0xaeb3('0x30')][_0xaeb3('0x3e')];_0x3a7131['providerName']=_0xaeb3('0x2f');_0x3a7131['providerResponse']=JSON['stringify'](_0x455fa9);var _0x323308=[];for(var _0x53c38b=0x0;_0x53c38b<_0x455fa9[_0xaeb3('0x2e')];_0x53c38b++){var _0x3a73a6=_0x455fa9[_0x53c38b];if(_0x3a73a6&&_0x3a73a6[_0xaeb3('0x30')]&&_0x3a73a6[_0xaeb3('0x30')][_0xaeb3('0x3f')]){_0x323308[_0xaeb3('0x40')](createMessage(_0x1d8535,_0x35245d,_0x3a7131,_0x3a73a6[_0xaeb3('0x30')][_0xaeb3('0x3f')]));}}return Promise[_0xaeb3('0x41')](_0x323308)[_0xaeb3('0x25')](function(){if(_0x1608ef){_0x173b28[_0xaeb3('0x16')]();}else{_0x173b28[_0xaeb3('0x27')]();}})['catch'](function(_0x5da7ed){logger[_0xaeb3('0x26')](_0xaeb3('0x12'),_0x1d8535,JSON[_0xaeb3('0x13')](_0x5da7ed));_0x173b28[_0xaeb3('0x16')]();});}})['catch'](function(_0x419f05){logger[_0xaeb3('0x26')](_0xaeb3('0x12'),_0x1d8535,_0x419f05[_0xaeb3('0x2c')]);_0x173b28[_0xaeb3('0x16')]();});}}catch(_0x4b8947){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1d8535,JSON['stringify'](_0x4b8947));_0x173b28[_0xaeb3('0x27')]();}};}; \ No newline at end of file +var _0x4b98=['DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','fulfillmentText','push','all','stop','lodash','dialogflow','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4b98,0x186));var _0x84b9=function(_0x402075,_0x567fe4){_0x402075=_0x402075-0x0;var _0x2e87b3=_0x4b98[_0x402075];return _0x2e87b3;};'use strict';var _=require(_0x84b9('0x0'));var dialogflow=require(_0x84b9('0x1'));var md5=require('md5');var moment=require(_0x84b9('0x2'));var Promise=require(_0x84b9('0x3'));var logger=require('../../../../config/logger')(_0x84b9('0x4'));var utils=require(_0x84b9('0x5'));var rpc={'chatMessage':require(_0x84b9('0x6')),'openchannelMessage':require(_0x84b9('0x7')),'mailMessage':require(_0x84b9('0x8')),'smsMessage':require(_0x84b9('0x9')),'faxMessage':require(_0x84b9('0xa')),'whatsappMessage':require(_0x84b9('0xb'))};function createMessage(_0x155250,_0xa652d1,_0x3dd09d,_0x24ce8b){return new Promise(function(_0x3e96f4,_0x311703){var _0x38fa9c=_[_0x84b9('0xc')](_0x3dd09d);_0x38fa9c['body']=_0x24ce8b;return rpc[_0xa652d1+_0x84b9('0xd')][_0x84b9('0xe')](_0x38fa9c)[_0x84b9('0xf')](function(){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x155250,_0x38fa9c[_0x84b9('0x12')]);_0x3e96f4();})['catch'](function(_0x1d9886){logger['error'](_0x84b9('0x11'),_0x155250,JSON[_0x84b9('0x13')](_0x1d9886));_0x311703(_0x1d9886);});});}exports[_0x84b9('0x14')]=function(_0x2c10da,_0x2fb9f2){return function(_0x39f6b0){try{if(!_[_0x84b9('0x15')](this[_0x84b9('0x16')][_0x84b9('0x17')])){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x2c10da,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x39f6b0[_0x84b9('0x18')]();}var _0x2fa957={'ContactId':this[_0x84b9('0x19')]['id'],'sentAt':moment()[_0x84b9('0x1a')](_0x84b9('0x1b')),'direction':_0x84b9('0x1c')};if(this[_0x84b9('0x1d')]===_0x84b9('0x1e')||this[_0x84b9('0x1d')]===_0x84b9('0x1f')){_0x2fa957[_0x84b9('0x20')]=this[_0x84b9('0x16')][_0x84b9('0x20')];}var _0x1c206e=this[_0x84b9('0x1d')];if(_0x1c206e==='chat'){_0x2fa957[_0x84b9('0x21')]=this['account']['id'];}else{_0x2fa957[_[_0x84b9('0x22')](_0x1c206e)+_0x84b9('0x23')]=this[_0x84b9('0x24')]['id'];}_0x2fa957[_[_0x84b9('0x22')](_0x1c206e)+_0x84b9('0x25')]=this[_0x84b9('0x16')]['id'];if(this['interaction'][_0x84b9('0x26')]){var _0xc3d745=_0x2fb9f2[0x4];if(!_[_0x84b9('0x27')](_0xc3d745)){_0x2fa957[_0x84b9('0x12')]=utils[_0x84b9('0x28')](_0xc3d745,this);return rpc[_0x1c206e+'Message'][_0x84b9('0xe')](_0x2fa957)[_0x84b9('0xf')](function(_0x42c290){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x2c10da,_0x2fa957[_0x84b9('0x12')]);})[_0x84b9('0x29')](function(_0x2a0a64){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x2a0a64));})[_0x84b9('0x2b')](function(){logger[_0x84b9('0x10')](_0x84b9('0x2c'),_0x2c10da);_0x39f6b0['stop']();});}else{logger[_0x84b9('0x10')](_0x84b9('0x2d'),_0x2c10da);_0x39f6b0['stop']();}}else{var _0x4bcf3f=this;var _0x1b9640=_0x2fb9f2[0x2]['replace'](/\\n/g,'\x0a');var _0x2d356d={'credentials':{'private_key':_0x1b9640,'client_email':_0x2fb9f2[0x1]}};var _0x3c9b52=new dialogflow['SessionsClient'](_0x2d356d);var _0x228419=_0x3c9b52[_0x84b9('0x2e')](_0x2fb9f2[0x0],md5(_0x4bcf3f[_0x84b9('0x16')]['id']));var _0x437394={'session':_0x228419,'queryInput':{'text':{'text':_0x4bcf3f[_0x84b9('0x2f')][_0x84b9('0x12')],'languageCode':_0x2fb9f2[0x3]||'en'}}};return _0x3c9b52[_0x84b9('0x30')](_0x437394)['then'](function(_0x92f21){if(_0x92f21&&_0x92f21[_0x84b9('0x31')]){_0x4bcf3f['body'][_0x84b9('0x32')]=_0x92f21;var _0x3bb3c2=_0x92f21[0x0];var _0x54d638=_0x3bb3c2[_0x84b9('0x33')]['diagnosticInfo']&&_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')][_0x84b9('0x35')]?_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')]['fields']['end_conversation'][_0x84b9('0x36')]:![];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x37')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x38')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x39')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x3a')]=_0x3bb3c2['queryResult'][_0x84b9('0x34')]&&_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')][_0x84b9('0x35')]?_0x3bb3c2['queryResult']['diagnosticInfo'][_0x84b9('0x35')][_0x84b9('0x3b')][_0x84b9('0x36')]:![];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x3c')]=_0x3bb3c2['queryResult'][_0x84b9('0x3d')][_0x84b9('0x3e')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x3d')][_0x84b9('0x3f')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x40')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x3d')][_0x84b9('0x41')];_0x4bcf3f['body'][_0x84b9('0x42')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x43')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x44')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x45')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_SCORE']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x46')];_0x2fa957[_0x84b9('0x47')]=_0x84b9('0x32');_0x2fa957['providerResponse']=JSON[_0x84b9('0x13')](_0x92f21);var _0xf5ed55=[];for(var _0x5614a0=0x0;_0x5614a0<_0x92f21[_0x84b9('0x31')];_0x5614a0++){var _0xccc6c7=_0x92f21[_0x5614a0];if(_0xccc6c7&&_0xccc6c7[_0x84b9('0x33')]&&_0xccc6c7[_0x84b9('0x33')][_0x84b9('0x48')]){_0xf5ed55[_0x84b9('0x49')](createMessage(_0x2c10da,_0x1c206e,_0x2fa957,_0xccc6c7[_0x84b9('0x33')][_0x84b9('0x48')]));}}return Promise[_0x84b9('0x4a')](_0xf5ed55)[_0x84b9('0xf')](function(){if(_0x54d638){_0x39f6b0[_0x84b9('0x18')]();}else{_0x39f6b0['stop']();}})['catch'](function(_0x169bfc){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x169bfc));_0x39f6b0['next']();});}})[_0x84b9('0x29')](function(_0x362926){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,_0x362926['message']);_0x39f6b0['next']();});}}catch(_0x58446f){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x58446f));_0x39f6b0[_0x84b9('0x4b')]();}};}; \ 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 f7e0a44..7c550d9 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 _0x19ab=['join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x19ab,0x12b));var _0xb19a=function(_0x47d44c,_0x31da6b){_0x47d44c=_0x47d44c-0x0;var _0x333a30=_0x19ab[_0x47d44c];return _0x333a30;};'use strict';var schema=require(_0xb19a('0x0'));var _=require(_0xb19a('0x1'));var htmlToText=require(_0xb19a('0x2'));var utils=require('./utils');var logger=require(_0xb19a('0x3'))(_0xb19a('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xb19a('0x5')},'priorityTrue':{'type':'number','message':_0xb19a('0x6')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x2f389c,_0x280ad1){return function(_0x39b28e){try{var _0x34f8d0={'condition':htmlToText[_0xb19a('0x7')](utils['getMustacheRender'](_0x280ad1[0x0],this),{'wordwrap':![]})[_0xb19a('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x280ad1[0x1],'priorityFalse':_0x280ad1[0x2]};var _0x28b5c2=gotoif['validate'](_0x34f8d0,{'typecast':!![]});if(_0x28b5c2[_0xb19a('0x9')]){logger[_0xb19a('0xa')](_0xb19a('0xb'),_0x2f389c,_[_0xb19a('0xc')](_0x28b5c2,'message')[_0xb19a('0xd')](',\x20'));_0x39b28e[_0xb19a('0xe')]();}else{try{var _0x28ef15=eval('('+_0x34f8d0[_0xb19a('0xf')]+')');var _0x575255=_0x28ef15?_0x34f8d0[_0xb19a('0x10')]:_0x34f8d0[_0xb19a('0x11')];logger[_0xb19a('0x12')](_0xb19a('0x13'),_0x2f389c,_0x34f8d0['condition'],_0x28ef15,_0x575255||'next');if(_0x575255){var _0x143492=_[_0xb19a('0x14')](_0x39b28e[_0xb19a('0x15')](),{'p':_0x575255});if(_0x143492>=0x0){logger[_0xb19a('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2f389c,_0x575255||_0xb19a('0x16'),_0x143492);_0x39b28e[_0xb19a('0x16')](_0x143492);}else{logger[_0xb19a('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2f389c,_0x575255||'next');_0x39b28e['stop']();}}else{_0x39b28e['next']();}}catch(_0x4291f5){logger[_0xb19a('0xa')](_0xb19a('0x17'),_0x2f389c,_0x4291f5[_0xb19a('0x18')]);_0x39b28e[_0xb19a('0xe')]();}}}catch(_0x5f1927){logger[_0xb19a('0xa')](_0xb19a('0xb'),_0x2f389c,JSON[_0xb19a('0x19')](_0x5f1927));_0x39b28e['stop']();}};}; \ No newline at end of file +var _0x8838=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','[%s][GOTOIF]\x20%s','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','next','error','stringify'];(function(_0x388794,_0x443c2a){var _0x51b475=function(_0x5641ad){while(--_0x5641ad){_0x388794['push'](_0x388794['shift']());}};_0x51b475(++_0x443c2a);}(_0x8838,0xa8));var _0x8883=function(_0x5d6085,_0x1a5a81){_0x5d6085=_0x5d6085-0x0;var _0x750d19=_0x8838[_0x5d6085];return _0x750d19;};'use strict';var schema=require('validate');var _=require(_0x8883('0x0'));var htmlToText=require(_0x8883('0x1'));var utils=require(_0x8883('0x2'));var logger=require(_0x8883('0x3'))(_0x8883('0x4'));var gotoif=schema({'condition':{'type':_0x8883('0x5'),'required':!![],'message':_0x8883('0x6')},'priorityTrue':{'type':_0x8883('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x8883('0x7'),'message':_0x8883('0x8')}});exports[_0x8883('0x9')]=function(_0x4c790d,_0x571dff){return function(_0x2691c8){try{var _0x2e343f={'condition':htmlToText[_0x8883('0xa')](utils['getMustacheRender'](_0x571dff[0x0],this),{'wordwrap':![]})[_0x8883('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x571dff[0x1],'priorityFalse':_0x571dff[0x2]};var _0x210500=gotoif['validate'](_0x2e343f,{'typecast':!![]});if(_0x210500['length']){logger['error'](_0x8883('0xc'),_0x4c790d,_['map'](_0x210500,_0x8883('0xd'))['join'](',\x20'));_0x2691c8[_0x8883('0xe')]();}else{try{var _0x2f654c=eval('('+_0x2e343f[_0x8883('0xf')]+')');var _0x424690=_0x2f654c?_0x2e343f[_0x8883('0x10')]:_0x2e343f[_0x8883('0x11')];logger[_0x8883('0x12')](_0x8883('0x13'),_0x4c790d,_0x2e343f[_0x8883('0xf')],_0x2f654c,_0x424690||'next');if(_0x424690){var _0xb47786=_[_0x8883('0x14')](_0x2691c8['rules'](),{'p':_0x424690});if(_0xb47786>=0x0){logger[_0x8883('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4c790d,_0x424690||_0x8883('0x15'),_0xb47786);_0x2691c8[_0x8883('0x15')](_0xb47786);}else{logger[_0x8883('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4c790d,_0x424690||_0x8883('0x15'));_0x2691c8[_0x8883('0xe')]();}}else{_0x2691c8[_0x8883('0x15')]();}}catch(_0x1db505){logger[_0x8883('0x16')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4c790d,_0x1db505[_0x8883('0xd')]);_0x2691c8[_0x8883('0xe')]();}}}catch(_0x269077){logger[_0x8883('0x16')](_0x8883('0xc'),_0x4c790d,JSON[_0x8883('0x17')](_0x269077));_0x2691c8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 1d55b89..0b276a7 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 _0xd99b=['map','message','join','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd99b,0xa3));var _0xbd99=function(_0x138fce,_0x304267){_0x138fce=_0x138fce-0x0;var _0x593cb0=_0xd99b[_0x138fce];return _0x593cb0;};'use strict';var schema=require(_0xbd99('0x0'));var _=require('lodash');var logger=require(_0xbd99('0x1'))(_0xbd99('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xbd99('0x3')}});exports[_0xbd99('0x4')]=function(_0x6c1af,_0x15a979){return function(_0x249da1){try{var _0x5dbb92={'priority':_0x15a979[0x0]};var _0xad5198=gotop[_0xbd99('0x0')](_0x5dbb92,{'typecast':!![]});if(_0xad5198[_0xbd99('0x5')]){logger[_0xbd99('0x6')](_0xbd99('0x7'),_0x6c1af,_[_0xbd99('0x8')](_0xad5198,_0xbd99('0x9'))[_0xbd99('0xa')](',\x20'));_0x249da1[_0xbd99('0xb')]();}else{logger[_0xbd99('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x6c1af,_0x5dbb92['priority']);if(_0x5dbb92[_0xbd99('0xd')]){var _0x1cdbf8=_['findIndex'](_0x249da1[_0xbd99('0xe')](),{'p':_0x5dbb92[_0xbd99('0xd')]});if(_0x1cdbf8>=0x0){logger['info'](_0xbd99('0xf'),_0x6c1af,_0x5dbb92[_0xbd99('0xd')]||_0xbd99('0x10'),_0x1cdbf8);_0x249da1[_0xbd99('0x10')](_0x1cdbf8);}else{logger[_0xbd99('0xc')](_0xbd99('0x11'),_0x6c1af,_0x5dbb92['priority']||_0xbd99('0x10'));_0x249da1[_0xbd99('0xb')]();}}else{_0x249da1['next']();}}}catch(_0x5079db){logger[_0xbd99('0x6')](_0xbd99('0x7'),_0x6c1af,JSON[_0xbd99('0x12')](_0x5079db));_0x249da1['stop']();}};}; \ No newline at end of file +var _0x7f5f=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x7f5f,0x1e2));var _0xf7f5=function(_0x3b1da4,_0x1ba706){_0x3b1da4=_0x3b1da4-0x0;var _0x2dba6d=_0x7f5f[_0x3b1da4];return _0x2dba6d;};'use strict';var schema=require(_0xf7f5('0x0'));var _=require(_0xf7f5('0x1'));var logger=require(_0xf7f5('0x2'))(_0xf7f5('0x3'));var gotop=schema({'priority':{'type':_0xf7f5('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xf7f5('0x5')]=function(_0x1e0981,_0x23d5cb){return function(_0x23a13c){try{var _0x1097aa={'priority':_0x23d5cb[0x0]};var _0x887688=gotop['validate'](_0x1097aa,{'typecast':!![]});if(_0x887688[_0xf7f5('0x6')]){logger[_0xf7f5('0x7')](_0xf7f5('0x8'),_0x1e0981,_['map'](_0x887688,_0xf7f5('0x9'))[_0xf7f5('0xa')](',\x20'));_0x23a13c[_0xf7f5('0xb')]();}else{logger[_0xf7f5('0xc')](_0xf7f5('0xd'),_0x1e0981,_0x1097aa[_0xf7f5('0xe')]);if(_0x1097aa[_0xf7f5('0xe')]){var _0x38a783=_[_0xf7f5('0xf')](_0x23a13c[_0xf7f5('0x10')](),{'p':_0x1097aa[_0xf7f5('0xe')]});if(_0x38a783>=0x0){logger[_0xf7f5('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1e0981,_0x1097aa[_0xf7f5('0xe')]||_0xf7f5('0x11'),_0x38a783);_0x23a13c[_0xf7f5('0x11')](_0x38a783);}else{logger[_0xf7f5('0xc')](_0xf7f5('0x12'),_0x1e0981,_0x1097aa[_0xf7f5('0xe')]||_0xf7f5('0x11'));_0x23a13c[_0xf7f5('0xb')]();}}else{_0x23a13c['next']();}}}catch(_0x52054d){logger[_0xf7f5('0x7')](_0xf7f5('0x8'),_0x1e0981,JSON[_0xf7f5('0x13')](_0x52054d));_0x23a13c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index d6cc257..ae97019 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 _0x2182=['Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','AccountId','channel','interaction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2182,0xea));var _0x2218=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2182[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2218('0x0'));var utils=require(_0x2218('0x1'));var logger=require(_0x2218('0x2'))(_0x2218('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2218('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2218('0x5')),'faxMessage':require(_0x2218('0x6')),'whatsappMessage':require(_0x2218('0x7'))};exports[_0x2218('0x8')]=function(_0xf3271d,_0x1e2df1){return function(_0x199cb3){try{var _0x22eab9={'body':utils[_0x2218('0x9')](_0x1e2df1[0x0],this),'ContactId':this[_0x2218('0xa')]['id']};if(this['channel']===_0x2218('0xb')){_0x22eab9[_0x2218('0xc')]=this[_0x2218('0xd')]['id'];}else{_0x22eab9[_[_0x2218('0xe')](this['channel'])+_0x2218('0xf')]=this[_0x2218('0xd')]['id'];}_0x22eab9[_[_0x2218('0xe')](this[_0x2218('0x10')])+'InteractionId']=this[_0x2218('0x11')]['id'];if(rpc[this[_0x2218('0x10')]+_0x2218('0x12')]){return rpc[this[_0x2218('0x10')]+_0x2218('0x12')]['create'](_0x22eab9)[_0x2218('0x13')](function(_0x5d7d24){logger[_0x2218('0x14')](_0x2218('0x15'),_0xf3271d,_0x22eab9[_0x2218('0x16')]);_0x199cb3[_0x2218('0x17')]();})[_0x2218('0x18')](function(_0x27fde4){logger[_0x2218('0x19')](_0x2218('0x15'),_0xf3271d,JSON[_0x2218('0x1a')](_0x27fde4));_0x199cb3[_0x2218('0x1b')]();});}}catch(_0x466d80){logger[_0x2218('0x19')](_0x2218('0x15'),_0xf3271d,JSON[_0x2218('0x1a')](_0x466d80));_0x199cb3[_0x2218('0x1b')]();}};}; \ No newline at end of file +var _0xac7a=['next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','body'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xac7a,0x128));var _0xaac7=function(_0x400eb4,_0x229c79){_0x400eb4=_0x400eb4-0x0;var _0x544f8e=_0xac7a[_0x400eb4];return _0x544f8e;};'use strict';var _=require(_0xaac7('0x0'));var utils=require(_0xaac7('0x1'));var logger=require(_0xaac7('0x2'))(_0xaac7('0x3'));var rpc={'chatMessage':require(_0xaac7('0x4')),'openchannelMessage':require(_0xaac7('0x5')),'mailMessage':require(_0xaac7('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaac7('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xaac7('0x8')]=function(_0x1bcbe0,_0x4264b2){return function(_0x3be7be){try{var _0x2239bc={'body':utils[_0xaac7('0x9')](_0x4264b2[0x0],this),'ContactId':this[_0xaac7('0xa')]['id']};if(this[_0xaac7('0xb')]===_0xaac7('0xc')){_0x2239bc[_0xaac7('0xd')]=this[_0xaac7('0xe')]['id'];}else{_0x2239bc[_[_0xaac7('0xf')](this[_0xaac7('0xb')])+_0xaac7('0x10')]=this[_0xaac7('0xe')]['id'];}_0x2239bc[_[_0xaac7('0xf')](this[_0xaac7('0xb')])+_0xaac7('0x11')]=this[_0xaac7('0x12')]['id'];if(rpc[this[_0xaac7('0xb')]+_0xaac7('0x13')]){return rpc[this['channel']+_0xaac7('0x13')][_0xaac7('0x14')](_0x2239bc)[_0xaac7('0x15')](function(_0xe50e0){logger['info']('[%s][MESSAGE]\x20%s',_0x1bcbe0,_0x2239bc[_0xaac7('0x16')]);_0x3be7be[_0xaac7('0x17')]();})[_0xaac7('0x18')](function(_0x1f6e62){logger[_0xaac7('0x19')](_0xaac7('0x1a'),_0x1bcbe0,JSON[_0xaac7('0x1b')](_0x1f6e62));_0x3be7be[_0xaac7('0x1c')]();});}}catch(_0x5d4833){logger[_0xaac7('0x19')]('[%s][MESSAGE]\x20%s',_0x1bcbe0,JSON[_0xaac7('0x1b')](_0x5d4833));_0x3be7be['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 7a70fc9..b55648b 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 _0xc3de=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','./utils','../../../../config/logger'];(function(_0x26da08,_0x30429f){var _0x73eb9d=function(_0x3149dd){while(--_0x3149dd){_0x26da08['push'](_0x26da08['shift']());}};_0x73eb9d(++_0x30429f);}(_0xc3de,0x130));var _0xec3d=function(_0x56c075,_0x33dfe9){_0x56c075=_0x56c075-0x0;var _0x304258=_0xc3de[_0x56c075];return _0x304258;};'use strict';var utils=require(_0xec3d('0x0'));var logger=require(_0xec3d('0x1'))(_0xec3d('0x2'));exports[_0xec3d('0x3')]=function(_0xe552e0,_0x36f0c9){return function(_0x35c7f5){try{logger[_0xec3d('0x4')](_0xec3d('0x5'),_0xe552e0,utils[_0xec3d('0x6')](_0x36f0c9[0x0],this));_0x35c7f5['next']();}catch(_0xf01107){logger['error'](_0xec3d('0x5'),_0xe552e0,JSON[_0xec3d('0x7')](_0xf01107));_0x35c7f5[_0xec3d('0x8')]();}};}; \ No newline at end of file +var _0xfe73=['next','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xfe73,0x12f));var _0x3fe7=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xfe73[_0x5a9c0c];return _0x53c77d;};'use strict';var utils=require(_0x3fe7('0x0'));var logger=require(_0x3fe7('0x1'))(_0x3fe7('0x2'));exports[_0x3fe7('0x3')]=function(_0x53a864,_0x5540b4){return function(_0x32ec33){try{logger[_0x3fe7('0x4')]('[%s][NOOP]\x20%s',_0x53a864,utils['getMustacheRender'](_0x5540b4[0x0],this));_0x32ec33[_0x3fe7('0x5')]();}catch(_0x560fd4){logger['error']('[%s][NOOP]\x20%s',_0x53a864,JSON['stringify'](_0x560fd4));_0x32ec33[_0x3fe7('0x6')]();}};}; \ 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 f90a095..1dd79c8 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 _0x720d=['create','error','create\x20queue\x20report','accepted','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','timeout','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','next','strategy','rrmemory','beepall','log','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x720d,0x1b1));var _0xd720=function(_0x8bfc33,_0x25509f){_0x8bfc33=_0x8bfc33-0x0;var _0x52862a=_0x720d[_0x8bfc33];return _0x52862a;};'use strict';var schema=require(_0xd720('0x0'));var _=require(_0xd720('0x1'));var util=require(_0xd720('0x2'));var seqqueue=require(_0xd720('0x3'));var moment=require(_0xd720('0x4'));var Redis=require(_0xd720('0x5'));var config=require('../../../../config/environment');var logger=require(_0xd720('0x6'))(_0xd720('0x7'));var strategy=require(_0xd720('0x8'));config[_0xd720('0x9')]=_['defaults'](config['redis'],{'host':_0xd720('0xa'),'port':0x18eb});var io=require(_0xd720('0xb'))(new Redis(config[_0xd720('0x9')]));var attributes=['id',_0xd720('0xc'),_0xd720('0xd'),_0xd720('0xe'),_0xd720('0xf'),_0xd720('0x10')];function emit(_0x2d3f5b,_0x5071fd,_0x44f44a){io['to'](_0x2d3f5b)['emit'](_0x5071fd,_0x44f44a);}function emitChannelQueueInteraction(_0x2e0dd4,_0x35635f,_0xf0bf3,_0x5b5302,_0x2ae3a1,_0x43c830,_0x3828b2,_0x7f781b){var _0x51e17b=_[_0xd720('0x11')](_0xf0bf3);_0x51e17b[_0xd720('0xc')]=_0x7f781b;_0x51e17b[_0xd720('0xe')]=_0x35635f;_0x51e17b[_0xd720('0xd')]=_0x5b5302;_0x51e17b['id']=_0x2ae3a1;if(_0x43c830){attributes[_0xd720('0x12')](_[_0xd720('0x13')](_0x2e0dd4)+_0xd720('0x14'));_0x3828b2[util[_0xd720('0x15')](_0xd720('0x16'),_0x2e0dd4)][_0x2ae3a1]=_['pick'](_0x51e17b,attributes);}else{delete _0x3828b2[util[_0xd720('0x15')](_0xd720('0x16'),_0x2e0dd4)][_0x2ae3a1];}emit(util['format'](_0xd720('0x17'),_0x2e0dd4,_0x35635f),util[_0xd720('0x15')]('%s_queue_waiting_interaction:%s',_0x2e0dd4,_0x43c830?_0xd720('0x18'):_0xd720('0x19')),_[_0xd720('0x1a')](_0x51e17b,attributes));}var rpc={'openchannelQueueReport':require(_0xd720('0x1b')),'mailQueueReport':require(_0xd720('0x1c')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xd720('0x1d')),'faxQueueReport':require(_0xd720('0x1e')),'whatsappQueueReport':require(_0xd720('0x1f'))};var queue=schema({'name':{'type':_0xd720('0x20'),'required':!![],'message':_0xd720('0x21')},'timeout':{'type':_0xd720('0x22'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x288363,_0x5a9e7e,_0x2ee749,_0x728f85){if(_0x288363&&_0x5a9e7e&&_0x2ee749){_0x5a9e7e[_0xd720('0x23')]+=0x1;var _0x50464c={'uniqueid':_0x288363,'from':_0x2ee749['body']?_0x2ee749[_0xd720('0x24')][_0xd720('0xf')]:'','joinAt':moment()[_0xd720('0x15')](_0xd720('0x25')),'ContactId':_0x2ee749[_0xd720('0x26')]?_0x2ee749[_0xd720('0x26')]['id']:null,'ListId':_0x2ee749['list']?_0x2ee749[_0xd720('0x27')]['id']:null};_0x50464c[_[_0xd720('0x28')](_0x2ee749[_0xd720('0x29')])+_0xd720('0x2a')]=_0x5a9e7e['id']||null;_0x50464c[_[_0xd720('0x28')](_0x2ee749[_0xd720('0x29')])+_0xd720('0x14')]=_0x2ee749[_0xd720('0x2b')]?_0x2ee749[_0xd720('0x2b')]['id']:null;_0x50464c[_[_0xd720('0x28')](_0x2ee749[_0xd720('0x29')])+_0xd720('0x2c')]=_0x2ee749[_0xd720('0x2d')]?_0x2ee749[_0xd720('0x2d')]['id']:null;_0x50464c[_[_0xd720('0x28')](_0x2ee749[_0xd720('0x29')])+(_0x2ee749['channel']!==_0xd720('0x2e')?_0xd720('0x2f'):_0xd720('0x30'))]=_0x2ee749[_0xd720('0xd')]?_0x2ee749['account']['id']:null;logger[_0xd720('0x31')](util[_0xd720('0x15')](_0xd720('0x32'),_0x288363,_0x5a9e7e[_0xd720('0x33')]));emitChannelQueueInteraction(_0x2ee749[_0xd720('0x29')],_0x5a9e7e[_0xd720('0x33')],_0x50464c,_0x2ee749['account'][_0xd720('0x33')],_0x2ee749[_0xd720('0x2d')]['id'],!![],_0x728f85,_0x5a9e7e['id']);if(rpc[_0x2ee749[_0xd720('0x29')]+_0xd720('0x34')]){return rpc[_0x2ee749['channel']+_0xd720('0x34')][_0xd720('0x35')](_0x50464c)['catch'](function(_0x3e02e0){logger[_0xd720('0x36')](_0xd720('0x37'));});}}}function stopRouting(_0x4ac19b,_0xade0d9,_0x22fa81,_0x37d882){if(_0x4ac19b&&_0xade0d9){_0xade0d9[_0xd720('0x23')]-=0x1;var _0xcbdfea={'leaveAt':moment()['format'](_0xd720('0x25')),'acceptAt':moment()[_0xd720('0x15')](_0xd720('0x25')),'reason':_0xd720('0x38')};logger[_0xd720('0x31')](util[_0xd720('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x4ac19b,_0xade0d9['name']));emitChannelQueueInteraction(_0x22fa81['channel'],_0xade0d9[_0xd720('0x33')],_0x22fa81[_0xd720('0x24')],_0x22fa81[_0xd720('0xd')]['name'],_0x22fa81[_0xd720('0x2d')]['id'],![],_0x37d882,_0xade0d9['id']);if(rpc[_0x22fa81[_0xd720('0x29')]+_0xd720('0x34')]){return rpc[_0x22fa81[_0xd720('0x29')]+_0xd720('0x34')][_0xd720('0x39')](_0x4ac19b,_0xcbdfea)[_0xd720('0x3a')](function(_0x2c5b5e){logger[_0xd720('0x36')](_0xd720('0x3b'));});}}}function endRouting(_0x7bc77d,_0x501bee,_0x254763,_0x5d8b80){if(_0x7bc77d&&_0x501bee){_0x501bee['waiting']-=0x1;var _0x2187f1={'leaveAt':moment()[_0xd720('0x15')](_0xd720('0x25')),'exitAt':moment()[_0xd720('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0xd720('0x31')](util[_0xd720('0x15')](_0xd720('0x3c'),_0x7bc77d,_0x501bee[_0xd720('0x33')]));emitChannelQueueInteraction(_0x254763[_0xd720('0x29')],_0x501bee['name'],_0x254763[_0xd720('0x24')],_0x254763[_0xd720('0xd')]['name'],_0x254763[_0xd720('0x2d')]['id'],![],_0x5d8b80);if(rpc[_0x254763['channel']+_0xd720('0x34')]){return rpc[_0x254763['channel']+'QueueReport'][_0xd720('0x39')](_0x7bc77d,_0x2187f1)['catch'](function(_0x5ab34d){logger[_0xd720('0x36')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x294a8e){return function(_0x73dc2e){return _0x73dc2e['name'][_0xd720('0x3d')]()===_0x294a8e[_0xd720('0x3d')]();};}exports[_0xd720('0x3e')]=function(_0x3748b0,_0x24e7ed,_0x1f9df9,_0x9998b5){return function(_0x363d27){try{var _0x5f5b66={'name':_0x24e7ed[0x0],'timeout':_0x24e7ed[0x1]};var _0x4abecf=queue[_0xd720('0x0')](_0x5f5b66,{'typecast':!![]});if(_0x4abecf[_0xd720('0x3f')]){logger[_0xd720('0x36')]('[%s][QUEUE]\x20%s',_0x3748b0,_[_0xd720('0x40')](_0x4abecf,_0xd720('0x2d'))[_0xd720('0x41')](',\x20'));_0x363d27[_0xd720('0x42')]();}else{var _0xacdf32=_[_0xd720('0x43')](_0x1f9df9[_0x9998b5['channel']+_0xd720('0x44')],handleFindQueue(_0x5f5b66['name']));if(_0xacdf32){startRouting(_0x3748b0,_0xacdf32,_0x9998b5,_0x1f9df9);var _0x3107d3=(_0xacdf32[_0xd720('0x45')]||0xa)*0x3e8;var _0x4291a8=(_0x5f5b66[_0xd720('0x45')]||0x14)*0x3e8;var _0x3758ec;if(_0x3107d3>_0x4291a8){_0x4291a8=_0x3107d3;}var _0x31a403=seqqueue[_0xd720('0x46')](_0x3107d3);_0x31a403['id']=_0x3748b0;_0x31a403[_0xd720('0x47')]=_0x3107d3;_0x31a403['qtimeout']=_0x4291a8;_0x31a403['channel']=_0x9998b5[_0xd720('0x29')];_0x1f9df9[_0xd720('0x48')][_0x3748b0]['on'](_0xd720('0x49'),function(){logger['info'](_0xd720('0x4a'),_0x3748b0);stopRouting(_0x3748b0,_0xacdf32,_0x9998b5,_0x1f9df9);clearTimeout(_0x3758ec);_0x3758ec=undefined;_0x31a403['close'](!![]);if(_0x1f9df9[_0xd720('0x48')][_0x3748b0]){delete _0x1f9df9[_0xd720('0x48')][_0x3748b0];}_0x363d27[_0xd720('0x42')]();});_0x1f9df9[_0xd720('0x48')][_0x3748b0]['on'](_0xd720('0x4b'),function(){if(_0x1f9df9[_0xd720('0x48')][_0x3748b0]){delete _0x1f9df9[_0xd720('0x48')][_0x3748b0];}});_0x3758ec=setTimeout(function(){logger[_0xd720('0x31')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3748b0);endRouting(_0x3748b0,_0xacdf32,_0x9998b5,_0x1f9df9);clearTimeout(_0x3758ec);_0x31a403['close'](!![]);_0x363d27[_0xd720('0x4c')]();},_0x4291a8);switch(_0xacdf32[_0xd720('0x4d')]){case _0xd720('0x4e'):strategy[_0xd720('0x4e')](_0x31a403,_0xacdf32,_0x1f9df9,_0x9998b5);break;default:strategy[_0xd720('0x4f')](_0x31a403,_0xacdf32,_0x1f9df9,_0x9998b5);}}else{logger[_0xd720('0x36')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3748b0,_0x5f5b66['name']);_0x363d27['stop']();}}}catch(_0x3d1cfe){console[_0xd720('0x50')](_0x3d1cfe);logger[_0xd720('0x36')]('[%s][QUEUE]\x20%s',_0x3748b0,_0x3d1cfe['stack']);_0x363d27[_0xd720('0x42')]();}};}; \ No newline at end of file +var _0xe336=['map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue','from','joinAt','clone','queue_id','account','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','list','QueueId','upperFirst','channel','interaction','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','length','[%s][QUEUE]\x20%s'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe336,0xf7));var _0x6e33=function(_0x56c7ae,_0x94d752){_0x56c7ae=_0x56c7ae-0x0;var _0x478cba=_0xe336[_0x56c7ae];return _0x478cba;};'use strict';var schema=require(_0x6e33('0x0'));var _=require(_0x6e33('0x1'));var util=require(_0x6e33('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x6e33('0x3'));var Redis=require(_0x6e33('0x4'));var config=require(_0x6e33('0x5'));var logger=require(_0x6e33('0x6'))(_0x6e33('0x7'));var strategy=require(_0x6e33('0x8'));config[_0x6e33('0x9')]=_[_0x6e33('0xa')](config[_0x6e33('0x9')],{'host':_0x6e33('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e33('0x9')]));var attributes=['id','queue_id','account',_0x6e33('0xc'),_0x6e33('0xd'),_0x6e33('0xe')];function emit(_0x425be6,_0x44f8b9,_0x1584b4){io['to'](_0x425be6)['emit'](_0x44f8b9,_0x1584b4);}function emitChannelQueueInteraction(_0x1d290d,_0x2fc78f,_0x2f7e28,_0x39c89b,_0x2133cf,_0x37e2c8,_0x26f286,_0x56a2c3){var _0x4b56bb=_[_0x6e33('0xf')](_0x2f7e28);_0x4b56bb[_0x6e33('0x10')]=_0x56a2c3;_0x4b56bb[_0x6e33('0xc')]=_0x2fc78f;_0x4b56bb[_0x6e33('0x11')]=_0x39c89b;_0x4b56bb['id']=_0x2133cf;if(_0x37e2c8){attributes['push'](_[_0x6e33('0x12')](_0x1d290d)+_0x6e33('0x13'));_0x26f286[util[_0x6e33('0x14')](_0x6e33('0x15'),_0x1d290d)][_0x2133cf]=_['pick'](_0x4b56bb,attributes);}else{delete _0x26f286[util[_0x6e33('0x14')](_0x6e33('0x15'),_0x1d290d)][_0x2133cf];}emit(util[_0x6e33('0x14')](_0x6e33('0x16'),_0x1d290d,_0x2fc78f),util[_0x6e33('0x14')]('%s_queue_waiting_interaction:%s',_0x1d290d,_0x37e2c8?_0x6e33('0x17'):'remove'),_[_0x6e33('0x18')](_0x4b56bb,attributes));}var rpc={'openchannelQueueReport':require(_0x6e33('0x19')),'mailQueueReport':require(_0x6e33('0x1a')),'chatQueueReport':require(_0x6e33('0x1b')),'smsQueueReport':require(_0x6e33('0x1c')),'faxQueueReport':require(_0x6e33('0x1d')),'whatsappQueueReport':require(_0x6e33('0x1e'))};var queue=schema({'name':{'type':_0x6e33('0x1f'),'required':!![],'message':_0x6e33('0x20')},'timeout':{'type':'number','message':_0x6e33('0x21')}});function startRouting(_0x266e3c,_0x380768,_0x328f69,_0x485760){if(_0x266e3c&&_0x380768&&_0x328f69){_0x380768['waiting']+=0x1;var _0x3f7d5f={'uniqueid':_0x266e3c,'from':_0x328f69[_0x6e33('0x22')]?_0x328f69[_0x6e33('0x22')][_0x6e33('0xd')]:'','joinAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'ContactId':_0x328f69['contact']?_0x328f69['contact']['id']:null,'ListId':_0x328f69[_0x6e33('0x24')]?_0x328f69[_0x6e33('0x24')]['id']:null};_0x3f7d5f[_['upperFirst'](_0x328f69['channel'])+_0x6e33('0x25')]=_0x380768['id']||null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+'InteractionId']=_0x328f69[_0x6e33('0x28')]?_0x328f69[_0x6e33('0x28')]['id']:null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+'MessageId']=_0x328f69['message']?_0x328f69[_0x6e33('0x29')]['id']:null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+(_0x328f69[_0x6e33('0x27')]!==_0x6e33('0x2a')?'AccountId':'WebsiteId')]=_0x328f69[_0x6e33('0x11')]?_0x328f69[_0x6e33('0x11')]['id']:null;logger[_0x6e33('0x2b')](util[_0x6e33('0x14')](_0x6e33('0x2c'),_0x266e3c,_0x380768[_0x6e33('0x2d')]));emitChannelQueueInteraction(_0x328f69[_0x6e33('0x27')],_0x380768['name'],_0x3f7d5f,_0x328f69[_0x6e33('0x11')]['name'],_0x328f69[_0x6e33('0x29')]['id'],!![],_0x485760,_0x380768['id']);if(rpc[_0x328f69['channel']+_0x6e33('0x2e')]){return rpc[_0x328f69['channel']+'QueueReport']['create'](_0x3f7d5f)[_0x6e33('0x2f')](function(_0x5adf95){logger[_0x6e33('0x30')](_0x6e33('0x31'));});}}}function stopRouting(_0x3fc9a6,_0x48578d,_0x27adb0,_0x58508e){if(_0x3fc9a6&&_0x48578d){_0x48578d[_0x6e33('0x32')]-=0x1;var _0x2d2ae0={'leaveAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'acceptAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'reason':'accepted'};logger[_0x6e33('0x2b')](util[_0x6e33('0x14')](_0x6e33('0x33'),_0x3fc9a6,_0x48578d['name']));emitChannelQueueInteraction(_0x27adb0[_0x6e33('0x27')],_0x48578d['name'],_0x27adb0[_0x6e33('0x22')],_0x27adb0[_0x6e33('0x11')][_0x6e33('0x2d')],_0x27adb0[_0x6e33('0x29')]['id'],![],_0x58508e,_0x48578d['id']);if(rpc[_0x27adb0[_0x6e33('0x27')]+_0x6e33('0x2e')]){return rpc[_0x27adb0[_0x6e33('0x27')]+_0x6e33('0x2e')][_0x6e33('0x34')](_0x3fc9a6,_0x2d2ae0)[_0x6e33('0x2f')](function(_0x41ff69){logger[_0x6e33('0x30')](_0x6e33('0x35'));});}}}function endRouting(_0x4e41dc,_0x231a29,_0x22159b,_0x1979c4){if(_0x4e41dc&&_0x231a29){_0x231a29['waiting']-=0x1;var _0x7d9ada={'leaveAt':moment()['format'](_0x6e33('0x23')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6e33('0x36')};logger[_0x6e33('0x2b')](util[_0x6e33('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x4e41dc,_0x231a29[_0x6e33('0x2d')]));emitChannelQueueInteraction(_0x22159b['channel'],_0x231a29[_0x6e33('0x2d')],_0x22159b['body'],_0x22159b['account'][_0x6e33('0x2d')],_0x22159b['message']['id'],![],_0x1979c4);if(rpc[_0x22159b['channel']+'QueueReport']){return rpc[_0x22159b[_0x6e33('0x27')]+_0x6e33('0x2e')][_0x6e33('0x34')](_0x4e41dc,_0x7d9ada)[_0x6e33('0x2f')](function(_0x1e0520){logger[_0x6e33('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4b54a1){return function(_0x1c2186){return _0x1c2186[_0x6e33('0x2d')]['toLowerCase']()===_0x4b54a1['toLowerCase']();};}exports['consequence']=function(_0xfab1fb,_0x1bd614,_0x3dab8c,_0x23f8f9){return function(_0x12e89d){try{var _0x1f16f1={'name':_0x1bd614[0x0],'timeout':_0x1bd614[0x1]};var _0x498372=queue[_0x6e33('0x0')](_0x1f16f1,{'typecast':!![]});if(_0x498372[_0x6e33('0x37')]){logger['error'](_0x6e33('0x38'),_0xfab1fb,_[_0x6e33('0x39')](_0x498372,_0x6e33('0x29'))[_0x6e33('0x3a')](',\x20'));_0x12e89d[_0x6e33('0x3b')]();}else{var _0x1b7a63=_[_0x6e33('0x3c')](_0x3dab8c[_0x23f8f9[_0x6e33('0x27')]+_0x6e33('0x3d')],handleFindQueue(_0x1f16f1[_0x6e33('0x2d')]));if(_0x1b7a63){startRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);var _0x5713aa=(_0x1b7a63['timeout']||0xa)*0x3e8;var _0x2eb2b4=(_0x1f16f1[_0x6e33('0x36')]||0x14)*0x3e8;var _0x4d2ca5;if(_0x5713aa>_0x2eb2b4){_0x2eb2b4=_0x5713aa;}var _0x546a99=seqqueue[_0x6e33('0x3e')](_0x5713aa);_0x546a99['id']=_0xfab1fb;_0x546a99[_0x6e33('0x3f')]=_0x5713aa;_0x546a99[_0x6e33('0x40')]=_0x2eb2b4;_0x546a99['channel']=_0x23f8f9[_0x6e33('0x27')];_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]['on'](_0x6e33('0x42'),function(){logger['info'](_0x6e33('0x43'),_0xfab1fb);stopRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);clearTimeout(_0x4d2ca5);_0x4d2ca5=undefined;_0x546a99['close'](!![]);if(_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]){delete _0x3dab8c[_0x6e33('0x41')][_0xfab1fb];}_0x12e89d[_0x6e33('0x3b')]();});_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]['on']('complete',function(){if(_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]){delete _0x3dab8c['rules'][_0xfab1fb];}});_0x4d2ca5=setTimeout(function(){logger[_0x6e33('0x2b')](_0x6e33('0x44'),_0xfab1fb);endRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);clearTimeout(_0x4d2ca5);_0x546a99['close'](!![]);_0x12e89d[_0x6e33('0x45')]();},_0x2eb2b4);switch(_0x1b7a63[_0x6e33('0x46')]){case _0x6e33('0x47'):strategy[_0x6e33('0x47')](_0x546a99,_0x1b7a63,_0x3dab8c,_0x23f8f9);break;default:strategy[_0x6e33('0x48')](_0x546a99,_0x1b7a63,_0x3dab8c,_0x23f8f9);}}else{logger[_0x6e33('0x30')](_0x6e33('0x49'),_0xfab1fb,_0x1f16f1[_0x6e33('0x2d')]);_0x12e89d[_0x6e33('0x3b')]();}}}catch(_0xc5cfab){console[_0x6e33('0x4a')](_0xc5cfab);logger[_0x6e33('0x30')](_0x6e33('0x38'),_0xfab1fb,_0xc5cfab[_0x6e33('0x4b')]);_0x12e89d[_0x6e33('0x3b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 5676e11..c4f1414 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 _0x7dfd=['notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x46b90d,_0xd6e4c0){var _0xf7e8df=function(_0x4e6d83){while(--_0x4e6d83){_0x46b90d['push'](_0x46b90d['shift']());}};_0xf7e8df(++_0xd6e4c0);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var uuid=require(_0xd7df('0x1'));var util=require(_0xd7df('0x2'));var logger=require(_0xd7df('0x3'))(_0xd7df('0x4'));var Agent=function(_0x28c3c9,_0x176418,_0x38eee7,_0x3ef231){this[_0xd7df('0x5')]=uuid['v4']();this[_0xd7df('0x6')]=_0x28c3c9;this[_0xd7df('0x7')]=_0x176418;this[_0xd7df('0x8')]=_0x38eee7;this[_0xd7df('0x4')]=_0x3ef231;this[_0xd7df('0x6')][_0xd7df('0x9')](this[_0xd7df('0xa')]['bind'](this),this[_0xd7df('0xb')][_0xd7df('0xc')](this));this[_0xd7df('0x6')]['on'](_0xd7df('0xd'),this['handleTimeout'][_0xd7df('0xc')](this));this['squeue']['on'](_0xd7df('0xe'),this['handleDrained'][_0xd7df('0xc')](this));};Agent[_0xd7df('0xf')][_0xd7df('0x9')]=function(){this[_0xd7df('0x6')][_0xd7df('0x9')](this[_0xd7df('0xa')][_0xd7df('0xc')](this),this[_0xd7df('0xb')][_0xd7df('0xc')](this));};Agent[_0xd7df('0xf')][_0xd7df('0x10')]=function(){this[_0xd7df('0xb')](!![]);};Agent[_0xd7df('0xf')][_0xd7df('0xa')]=function(){logger[_0xd7df('0x11')](_0xd7df('0x12'),this[_0xd7df('0x6')]['id'],this['agent']['id']);if(_[_0xd7df('0x13')](this[_0xd7df('0x8')]['agents'][this[_0xd7df('0x7')]['id']])){logger[_0xd7df('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd7df('0x6')]['id'],this[_0xd7df('0x7')]['id']);setTimeout(this[_0xd7df('0x9')]['bind'](this),0x3e8);}else{if(this[_0xd7df('0x4')][_0xd7df('0x14')]||util[_0xd7df('0x15')](this['squeue']['id'],this[_0xd7df('0x8')][_0xd7df('0x16')][this[_0xd7df('0x7')]['id']],this['squeue'][_0xd7df('0x17')],![])){this['realtime'][_0xd7df('0x16')][this['agent']['id']][_0xd7df('0x18')]=!![];this[_0xd7df('0x8')][_0xd7df('0x16')][this['agent']['id']][_0xd7df('0x19')]=undefined;util['saveWaitingNotification'](this[_0xd7df('0x8')],this[_0xd7df('0x4')],this[_0xd7df('0x7')],this[_0xd7df('0x6')][_0xd7df('0x17')]);util[_0xd7df('0x1a')](this[_0xd7df('0x5')],this['squeue']['id'],this['realtime'][_0xd7df('0x16')][this[_0xd7df('0x7')]['id']],null,this[_0xd7df('0x4')]);util[_0xd7df('0x1b')](this[_0xd7df('0x6')]['id'],this[_0xd7df('0x8')][_0xd7df('0x16')][this[_0xd7df('0x7')]['id']],_0xd7df('0x1c')+(this['routing'][_0xd7df('0x14')]?_0xd7df('0x1d'):''));}else{logger[_0xd7df('0x11')](_0xd7df('0x1e'),this[_0xd7df('0x6')]['id'],this[_0xd7df('0x7')]['id']);setTimeout(this[_0xd7df('0x9')][_0xd7df('0xc')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x52b56a){if(_['isNil'](this['realtime'][_0xd7df('0x16')][this['agent']['id']])){return logger[_0xd7df('0x11')](_0xd7df('0x1f'),this['squeue']['id'],this[_0xd7df('0x7')]['id']);}else{logger[_0xd7df('0x11')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xd7df('0x6')]['id'],this[_0xd7df('0x7')]['id']);util[_0xd7df('0x20')](this[_0xd7df('0x5')],this[_0xd7df('0x6')]['id'],this[_0xd7df('0x8')]['agents'][this[_0xd7df('0x7')]['id']],null,this[_0xd7df('0x4')]);this[_0xd7df('0x8')][_0xd7df('0x16')][this[_0xd7df('0x7')]['id']][_0xd7df('0x18')]=![];this[_0xd7df('0x8')][_0xd7df('0x16')][this[_0xd7df('0x7')]['id']][_0xd7df('0x19')]=undefined;util[_0xd7df('0x21')](this['realtime'],this['routing'],this[_0xd7df('0x7')],this['squeue'][_0xd7df('0x17')]);util[_0xd7df('0x1b')](this[_0xd7df('0x6')]['id'],this[_0xd7df('0x8')]['agents'][this['agent']['id']],_0x52b56a?'STOP':_0xd7df('0x22'));}if(!_0x52b56a){setTimeout(this[_0xd7df('0x9')]['bind'](this),0x3e8);}};function agent(_0x27c57c,_0x1a8b40,_0x4bda0e,_0x574567){return new Agent(_0x27c57c,_0x1a8b40,_0x4bda0e,_0x574567);}module['exports']=agent; \ No newline at end of file +var _0x3eea=['STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','timeout','drained','prototype','handleRun','handleTimeout','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification'];(function(_0x24304c,_0x5c5332){var _0x457533=function(_0x340cdf){while(--_0x340cdf){_0x24304c['push'](_0x24304c['shift']());}};_0x457533(++_0x5c5332);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x7b3af,_0x5edd84){_0x7b3af=_0x7b3af-0x0;var _0x16bc36=_0x3eea[_0x7b3af];return _0x16bc36;};'use strict';var _=require(_0xa3ee('0x0'));var uuid=require('uuid');var util=require(_0xa3ee('0x1'));var logger=require(_0xa3ee('0x2'))(_0xa3ee('0x3'));var Agent=function(_0x1c6a49,_0x46acfa,_0x269141,_0x104913){this[_0xa3ee('0x4')]=uuid['v4']();this[_0xa3ee('0x5')]=_0x1c6a49;this[_0xa3ee('0x6')]=_0x46acfa;this[_0xa3ee('0x7')]=_0x269141;this['routing']=_0x104913;this['squeue'][_0xa3ee('0x8')](this['handleRun'][_0xa3ee('0x9')](this),this['handleTimeout'][_0xa3ee('0x9')](this));this['squeue']['on'](_0xa3ee('0xa'),this['handleTimeout'][_0xa3ee('0x9')](this));this[_0xa3ee('0x5')]['on'](_0xa3ee('0xb'),this['handleDrained'][_0xa3ee('0x9')](this));};Agent[_0xa3ee('0xc')]['push']=function(){this['squeue'][_0xa3ee('0x8')](this[_0xa3ee('0xd')][_0xa3ee('0x9')](this),this[_0xa3ee('0xe')]['bind'](this));};Agent[_0xa3ee('0xc')]['handleDrained']=function(){this[_0xa3ee('0xe')](!![]);};Agent[_0xa3ee('0xc')][_0xa3ee('0xd')]=function(){logger[_0xa3ee('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0xa3ee('0x6')]['id']])){logger[_0xa3ee('0xf')](_0xa3ee('0x10'),this[_0xa3ee('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa3ee('0x8')][_0xa3ee('0x9')](this),0x3e8);}else{if(this[_0xa3ee('0x3')][_0xa3ee('0x11')]||util[_0xa3ee('0x12')](this['squeue']['id'],this[_0xa3ee('0x7')][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],this[_0xa3ee('0x5')][_0xa3ee('0x14')],![])){this[_0xa3ee('0x7')]['agents'][this[_0xa3ee('0x6')]['id']][_0xa3ee('0x15')]=!![];this['realtime'][_0xa3ee('0x13')][this['agent']['id']][_0xa3ee('0x16')]=undefined;util[_0xa3ee('0x17')](this[_0xa3ee('0x7')],this[_0xa3ee('0x3')],this[_0xa3ee('0x6')],this[_0xa3ee('0x5')][_0xa3ee('0x14')]);util[_0xa3ee('0x18')](this[_0xa3ee('0x4')],this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],null,this[_0xa3ee('0x3')]);util[_0xa3ee('0x19')](this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],_0xa3ee('0x1a')+(this[_0xa3ee('0x3')][_0xa3ee('0x11')]?_0xa3ee('0x1b'):''));}else{logger[_0xa3ee('0xf')](_0xa3ee('0x1c'),this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype'][_0xa3ee('0xe')]=function(_0x481358){if(_[_0xa3ee('0x1d')](this[_0xa3ee('0x7')][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']])){return logger[_0xa3ee('0xf')](_0xa3ee('0x10'),this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);}else{logger[_0xa3ee('0xf')](_0xa3ee('0x1e'),this['squeue']['id'],this[_0xa3ee('0x6')]['id']);util['hideNotification'](this[_0xa3ee('0x4')],this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this['agent']['id']],null,this[_0xa3ee('0x3')]);this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']][_0xa3ee('0x15')]=![];this[_0xa3ee('0x7')][_0xa3ee('0x13')][this['agent']['id']][_0xa3ee('0x16')]=undefined;util[_0xa3ee('0x1f')](this[_0xa3ee('0x7')],this['routing'],this[_0xa3ee('0x6')],this['squeue'][_0xa3ee('0x14')]);util['writeLog'](this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],_0x481358?_0xa3ee('0x20'):_0xa3ee('0x21'));}if(!_0x481358){setTimeout(this[_0xa3ee('0x8')][_0xa3ee('0x9')](this),0x3e8);}};function agent(_0xcc8e71,_0x42c66f,_0x256c63,_0x218317){return new Agent(_0xcc8e71,_0x42c66f,_0x256c63,_0x218317);}module[_0xa3ee('0x22')]=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 e48002d..4ef05be 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 _0xd5ae=['agents','writeLog','busyQueue','name','channel','showNotification','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','busy','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','Agents','length','debug','isAgentAvailable'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd5ae,0x16b));var _0xed5a=function(_0x19652f,_0x2d4042){_0x19652f=_0x19652f-0x0;var _0x1a3110=_0xd5ae[_0x19652f];return _0x1a3110;};'use strict';var _=require(_0xed5a('0x0'));var uuid=require(_0xed5a('0x1'));var util=require(_0xed5a('0x2'));var logger=require(_0xed5a('0x3'))('routing');var Beepall=function(_0x1a4f4a,_0x73c92d,_0x46f049,_0x458919){this[_0xed5a('0x4')]=uuid['v4']();this[_0xed5a('0x5')]=_0x1a4f4a;this[_0xed5a('0x6')]=_0x73c92d;this[_0xed5a('0x7')]=_0x46f049;this[_0xed5a('0x8')]=_0x458919;this[_0xed5a('0x5')][_0xed5a('0x9')](this[_0xed5a('0xa')][_0xed5a('0xb')](this),this[_0xed5a('0xc')][_0xed5a('0xb')](this));this['squeue']['on'](_0xed5a('0xd'),this['handleTimeout'][_0xed5a('0xb')](this));this[_0xed5a('0x5')]['on'](_0xed5a('0xe'),this['handleDrained'][_0xed5a('0xb')](this));};Beepall[_0xed5a('0xf')]['push']=function(){this[_0xed5a('0x5')][_0xed5a('0x9')](this[_0xed5a('0xa')]['bind'](this),this[_0xed5a('0xc')][_0xed5a('0xb')](this));};Beepall['prototype'][_0xed5a('0x10')]=function(){this[_0xed5a('0xc')](!![]);};Beepall[_0xed5a('0xf')][_0xed5a('0xa')]=function(){var _0x3fab85=!![];if(!_[_0xed5a('0x11')](this[_0xed5a('0x6')])&&!_[_0xed5a('0x11')](this[_0xed5a('0x6')][_0xed5a('0x12')])&&this[_0xed5a('0x6')][_0xed5a('0x12')][_0xed5a('0x13')]>0x0){for(var _0x54b66e=0x0,_0x4a111b;_0x54b66e0x0){for(var _0x16321a=0x0,_0x4d9368;_0x16321a0x0&&_0x48d8fb[_0x2e9344+'CurrentCapacity']>=_0x48d8fb[_0x2e9344+'Capacity']){writeLog(_0x3c0d82,_0x48d8fb,_0x2e9344[_0xb010('0x25')]()+_0xb010('0x26'));return![];}}return!![];};exports[_0xb010('0x27')]=function(_0x283816,_0x4476a6,_0x50aa55,_0xcde956,_0x7672db){return sendNotification(!![],_0x283816,_0x4476a6,_0x50aa55,_0xcde956,_0x7672db);};exports[_0xb010('0x28')]=function(_0x3e4e35,_0x1175c4,_0x42a14a,_0x21c5a3,_0x559274){return sendNotification(![],_0x3e4e35,_0x1175c4,_0x42a14a,_0x21c5a3,_0x559274);};exports[_0xb010('0x29')]=function(_0x511fcb,_0x325314,_0x2e53c1){var _0x5cba74=_0x325314[_0xb010('0x2a')][_0xb010('0x2b')];if(!_0x5cba74&&_0x2e53c1){_0x5cba74=_0x2e53c1['id'];}var _0x301ed3=_[_0xb010('0x2c')](_0x511fcb[_0x325314[_0xb010('0x2d')]+_0xb010('0x2e')],function(_0x3c94b9){var _0x3779aa=_[_0xb010('0x2f')](_0x325314[_0xb010('0x2d')])+_0xb010('0x30');return _0x3c94b9[_0x3779aa]===_0x325314['interaction']['id'];});if(!_0x301ed3&&_0x5cba74){_0x301ed3=_['some'](_0x511fcb[_0xb010('0x31')][_0x5cba74][_0x325314['channel']+_0xb010('0x32')],function(_0x17d0dc){return _0x17d0dc['id']===_0x325314[_0xb010('0x2a')]['id'];});}return _0x301ed3;};exports[_0xb010('0x33')]=function(_0x4b96cb,_0x17522a,_0x5ce189,_0x1bb9cd){_0x4b96cb[_0xb010('0x31')][_0x5ce189['id']][_0x1bb9cd+_0xb010('0x32')][_0x17522a['message']['id']]={'id':_0x17522a[_0xb010('0x2a')]['id']};};exports['removeWaitingNotification']=function(_0x274cc9,_0x3f2bd4,_0x3f7c73,_0xc5ba45){delete _0x274cc9[_0xb010('0x31')][_0x3f7c73['id']][_0xc5ba45+_0xb010('0x32')][_0x3f2bd4['message']['id']];};exports[_0xb010('0x34')]=writeLog; \ No newline at end of file +var _0x5aa5=['channel','some','saveWaitingNotification','agents','removeWaitingNotification','WaitingInteractions','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','body','queue','getMustacheRender','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','QueuesWaitingInteractions'];(function(_0x2b1041,_0x28297f){var _0x57cd82=function(_0x1086c0){while(--_0x1086c0){_0x2b1041['push'](_0x2b1041['shift']());}};_0x57cd82(++_0x28297f);}(_0x5aa5,0xa3));var _0x55aa=function(_0x5d6ec7,_0x283e2f){_0x5d6ec7=_0x5d6ec7-0x0;var _0x5a2401=_0x5aa5[_0x5d6ec7];return _0x5a2401;};'use strict';var _=require(_0x55aa('0x0'));var util=require(_0x55aa('0x1'));var utils=require(_0x55aa('0x2'));var Redis=require(_0x55aa('0x3'));var config=require(_0x55aa('0x4'));var logger=require(_0x55aa('0x5'))(_0x55aa('0x6'));config['redis']=_[_0x55aa('0x7')](config[_0x55aa('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x55aa('0x9'))(new Redis(config['redis']));function sendNotification(_0x4fd8cf,_0x15c00a,_0x21349e,_0x3d7eee,_0x5a7888,_0x413fa5){io['to'](util[_0x55aa('0xa')](_0x55aa('0xb'),_0x3d7eee[_0x55aa('0xc')]))[_0x55aa('0xd')](_0x55aa('0xe'),_0x3d7eee);var _0x55ff7c=_0x413fa5||{};var _0x358d1f=_0x21349e[_0x55aa('0xf')]('.');var _0x4ce894={'uniqueid':_0x15c00a,'channel':_0x358d1f[0x0],'id':_0x358d1f[0x1],'title':_0x358d1f[0x0]+_0x55aa('0x10'),'interactionId':_0x358d1f[0x2],'queue':_0x5a7888?_0x5a7888['name']:null,'sound':_0x55ff7c['account'][_0x55aa('0x11')],'shake':_0x55ff7c[_0x55aa('0x12')]['notificationShake']};try{if(!_0x55ff7c[_0x55aa('0x13')]){_0x55ff7c[_0x55aa('0x13')]={};}if(_0x5a7888){_0x55ff7c['body'][_0x55aa('0x14')]=_0x5a7888;}else if(_0x55ff7c[_0x55aa('0x13')][_0x55aa('0x14')]){delete _0x55ff7c[_0x55aa('0x13')][_0x55aa('0x14')];}_0x4ce894['msg']=utils[_0x55aa('0x15')](_0x55ff7c[_0x55aa('0x12')]['notificationTemplate'],_0x55ff7c);}catch(_0x2fd62b){_0x4ce894[_0x55aa('0x16')]=_0x55aa('0x17');logger[_0x55aa('0x18')](util[_0x55aa('0xa')](_0x55aa('0x19'),_0x15c00a,_0x2fd62b[_0x55aa('0x1a')]));}io['to'](util[_0x55aa('0xa')](_0x55aa('0xb'),_0x3d7eee[_0x55aa('0xc')]))[_0x55aa('0xd')](util[_0x55aa('0xa')]('notification:%s',_0x4fd8cf?_0x55aa('0x1b'):'remove'),_0x4ce894);}function writeLog(_0x3396e6,_0x4630f3,_0x10deaa){return logger[_0x55aa('0x1c')](util[_0x55aa('0xa')](_0x55aa('0x1d'),_0x3396e6,_0x4630f3['name'],_0x10deaa));}exports[_0x55aa('0x1e')]=function(_0x31338a,_0x305674,_0x527eb5,_0x27c20c){if(_0x305674[_0x55aa('0x1f')]){writeLog(_0x31338a,_0x305674,'BUSY');return![];}if(!_0x305674['online']){writeLog(_0x31338a,_0x305674,'OFFLINE');return![];}if(_0x305674[_0x527eb5+_0x55aa('0x20')]){writeLog(_0x31338a,_0x305674,_0x55aa('0x21'));return![];}if(_0x27c20c&&_0x305674[_0x55aa('0x22')](_0x527eb5+_0x55aa('0x23'))&&_0x305674['hasOwnProperty'](_0x527eb5+_0x55aa('0x24'))){if(_0x305674[_0x527eb5+'Capacity']>0x0&&_0x305674[_0x527eb5+_0x55aa('0x24')]>=_0x305674[_0x527eb5+_0x55aa('0x23')]){writeLog(_0x31338a,_0x305674,_0x527eb5[_0x55aa('0x25')]()+_0x55aa('0x26'));return![];}}return!![];};exports[_0x55aa('0x27')]=function(_0x2c4ee9,_0x299e8f,_0x2a3d53,_0x5e23a1,_0x3c708c){return sendNotification(!![],_0x2c4ee9,_0x299e8f,_0x2a3d53,_0x5e23a1,_0x3c708c);};exports[_0x55aa('0x28')]=function(_0x27235e,_0x1e80b3,_0x383b23,_0x4aa734,_0x54bb51){return sendNotification(![],_0x27235e,_0x1e80b3,_0x383b23,_0x4aa734,_0x54bb51);};exports[_0x55aa('0x29')]=function(_0x33a309,_0x240f9e,_0x10bdc7){var _0x4b7fe0=_0x240f9e[_0x55aa('0x2a')][_0x55aa('0x2b')];if(!_0x4b7fe0&&_0x10bdc7){_0x4b7fe0=_0x10bdc7['id'];}var _0x29397e=_['some'](_0x33a309[_0x240f9e['channel']+_0x55aa('0x2c')],function(_0x556a03){var _0x4ac6bf=_['capitalize'](_0x240f9e[_0x55aa('0x2d')])+'InteractionId';return _0x556a03[_0x4ac6bf]===_0x240f9e[_0x55aa('0x2a')]['id'];});if(!_0x29397e&&_0x4b7fe0){_0x29397e=_[_0x55aa('0x2e')](_0x33a309['agents'][_0x4b7fe0][_0x240f9e[_0x55aa('0x2d')]+'WaitingInteractions'],function(_0x28723a){return _0x28723a['id']===_0x240f9e['interaction']['id'];});}return _0x29397e;};exports[_0x55aa('0x2f')]=function(_0x458ea1,_0x2a85c8,_0x2b49ff,_0x2a8b79){_0x458ea1[_0x55aa('0x30')][_0x2b49ff['id']][_0x2a8b79+'WaitingInteractions'][_0x2a85c8[_0x55aa('0x1a')]['id']]={'id':_0x2a85c8[_0x55aa('0x2a')]['id']};};exports[_0x55aa('0x31')]=function(_0x47ca31,_0x3b7adc,_0x5529a3,_0x508654){delete _0x47ca31[_0x55aa('0x30')][_0x5529a3['id']][_0x508654+_0x55aa('0x32')][_0x3b7adc[_0x55aa('0x1a')]['id']];};exports[_0x55aa('0x33')]=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 3f406e1..a15af1a 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 _0x2445=['routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','validate','shelljs','lodash'];(function(_0x236227,_0xb44846){var _0x224ecb=function(_0x1ab9bd){while(--_0x1ab9bd){_0x236227['push'](_0x236227['shift']());}};_0x224ecb(++_0xb44846);}(_0x2445,0xfa));var _0x5244=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x2445[_0x12f688];return _0x59c3de;};'use strict';var schema=require(_0x5244('0x0'));var sh=require(_0x5244('0x1'));var _=require(_0x5244('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x5244('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x5244('0x4')}});exports['consequence']=function(_0x35ebd0,_0x5451fe){return function(_0x3ce83d){try{var _0x3ffc72={'command':_0x5451fe[0x0]};var _0x3d8be8=system[_0x5244('0x0')](_0x3ffc72,{'typecast':!![]});if(_0x3d8be8[_0x5244('0x5')]){logger[_0x5244('0x6')](_0x5244('0x7'),_0x35ebd0,_[_0x5244('0x8')](_0x3d8be8,'message')[_0x5244('0x9')](',\x20'));logger[_0x5244('0xa')](_0x5244('0xb'),_0x35ebd0);_0x3ce83d['next']();}else{var _0x44754b=this;var _0x145fb2=utils[_0x5244('0xc')](_0x5451fe[0x0],this);logger[_0x5244('0xa')](_0x5244('0xd'),_0x35ebd0,_0x145fb2);sh[_0x5244('0xe')](_[_0x5244('0xf')](_0x145fb2),function(_0x20acad,_0x293a70){logger[_0x5244('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x35ebd0,_0x20acad);if(_0x20acad==0x0){var _0xe66a80=_0x293a70[_0x5244('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x5244('0x11')](_0x5451fe[0x1])||_[_0x5244('0x12')](_0x5451fe[0x1])){logger[_0x5244('0xa')](_0x5244('0x13'),_0x35ebd0);_0x44754b[_0x5244('0x14')][_0x5451fe[0x1]]=_0xe66a80;}else{logger[_0x5244('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x35ebd0,_0x5451fe[0x1],_0xe66a80);_0x44754b['body'][_0x5451fe[0x1]]=_0xe66a80;}}_0x3ce83d[_0x5244('0x15')]();});}}catch(_0x4eab25){logger[_0x5244('0x6')]('[%s][SYSTEM]\x20%s',_0x35ebd0,_['isObject'](_0x4eab25)?JSON[_0x5244('0x16')](_0x4eab25):_0x4eab25);logger[_0x5244('0xa')](_0x5244('0xb'),_0x35ebd0);_0x3ce83d[_0x5244('0x15')]();}};}; \ No newline at end of file +var _0xd9de=['message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0xf80808,_0x675e16){var _0x3c9420=function(_0x1f0f50){while(--_0x1f0f50){_0xf80808['push'](_0xf80808['shift']());}};_0x3c9420(++_0x675e16);}(_0xd9de,0x160));var _0xed9d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd9de[_0x397e5f];return _0x5302b8;};'use strict';var schema=require('validate');var sh=require(_0xed9d('0x0'));var _=require(_0xed9d('0x1'));var utils=require('./utils');var logger=require(_0xed9d('0x2'))(_0xed9d('0x3'));var system=schema({'command':{'type':_0xed9d('0x4'),'required':!![],'message':_0xed9d('0x5')}});exports[_0xed9d('0x6')]=function(_0x2b3dbd,_0x33c751){return function(_0x2e1718){try{var _0xcadc38={'command':_0x33c751[0x0]};var _0x4a1d46=system[_0xed9d('0x7')](_0xcadc38,{'typecast':!![]});if(_0x4a1d46[_0xed9d('0x8')]){logger[_0xed9d('0x9')](_0xed9d('0xa'),_0x2b3dbd,_[_0xed9d('0xb')](_0x4a1d46,_0xed9d('0xc'))[_0xed9d('0xd')](',\x20'));logger[_0xed9d('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2b3dbd);_0x2e1718['next']();}else{var _0x4e1d68=this;var _0x139d19=utils[_0xed9d('0xf')](_0x33c751[0x0],this);logger[_0xed9d('0xe')](_0xed9d('0x10'),_0x2b3dbd,_0x139d19);sh[_0xed9d('0x11')](_[_0xed9d('0x12')](_0x139d19),function(_0x38277c,_0x1bd156){logger[_0xed9d('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2b3dbd,_0x38277c);if(_0x38277c==0x0){var _0x142269=_0x1bd156[_0xed9d('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x33c751[0x1])||_[_0xed9d('0x14')](_0x33c751[0x1])){logger[_0xed9d('0xe')](_0xed9d('0x15'),_0x2b3dbd);_0x4e1d68[_0xed9d('0x16')][_0x33c751[0x1]]=_0x142269;}else{logger[_0xed9d('0xe')](_0xed9d('0x17'),_0x2b3dbd,_0x33c751[0x1],_0x142269);_0x4e1d68['body'][_0x33c751[0x1]]=_0x142269;}}_0x2e1718[_0xed9d('0x18')]();});}}catch(_0x565f8b){logger[_0xed9d('0x9')](_0xed9d('0xa'),_0x2b3dbd,_[_0xed9d('0x19')](_0x565f8b)?JSON[_0xed9d('0x1a')](_0x565f8b):_0x565f8b);logger[_0xed9d('0xe')](_0xed9d('0x1b'),_0x2b3dbd);_0x2e1718[_0xed9d('0x18')]();}};}; \ 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 77698e8..89c09b3 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 _0xec97=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','stringify','finally','[%s][TAG]\x20%s','isObject','validate','lodash'];(function(_0x2f6519,_0x3abf6e){var _0x5da39a=function(_0x85f6bc){while(--_0x85f6bc){_0x2f6519['push'](_0x2f6519['shift']());}};_0x5da39a(++_0x3abf6e);}(_0xec97,0x12a));var _0x7ec9=function(_0x39e8f5,_0x21462f){_0x39e8f5=_0x39e8f5-0x0;var _0x568054=_0xec97[_0x39e8f5];return _0x568054;};'use strict';var schema=require(_0x7ec9('0x0'));var _=require(_0x7ec9('0x1'));var rpc={'chatInteraction':require(_0x7ec9('0x2')),'openchannelInteraction':require(_0x7ec9('0x3')),'smsInteraction':require(_0x7ec9('0x4')),'mailInteraction':require(_0x7ec9('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7ec9('0x6'))};var logger=require(_0x7ec9('0x7'))(_0x7ec9('0x8'));var tag=schema({'tag':{'type':_0x7ec9('0x9'),'required':!![],'message':_0x7ec9('0xa')}});exports[_0x7ec9('0xb')]=function(_0x1cb1bc,_0x10a88e,_0x5e8273,_0x16837b){return function(_0x600b5f){try{var _0x9833a7={'tag':_0x10a88e[0x0]};var _0x78ec82=tag[_0x7ec9('0x0')](_0x9833a7,{'typecast':!![]});if(_0x78ec82[_0x7ec9('0xc')]){logger[_0x7ec9('0xd')]('[%s][TAG]\x20%s',_0x1cb1bc,_[_0x7ec9('0xe')](_0x78ec82,_0x7ec9('0xf'))[_0x7ec9('0x10')](',\x20'));logger['info'](_0x7ec9('0x11'),_0x1cb1bc);_0x600b5f[_0x7ec9('0x12')]();}else{var _0x422eb6={'ids':[_0x10a88e[0x0]]};if(rpc[_0x16837b[_0x7ec9('0x13')]+_0x7ec9('0x14')]){rpc[_0x16837b[_0x7ec9('0x13')]+_0x7ec9('0x14')][_0x7ec9('0x15')](_0x16837b['interaction']['id'],_0x422eb6)[_0x7ec9('0x16')](function(_0x197d8b){logger[_0x7ec9('0x17')](_0x7ec9('0x18'),_0x1cb1bc,_0x10a88e[0x1],_0x16837b['channel'],_0x16837b[_0x7ec9('0x19')]['id']);})['catch'](function(_0x3616f9){logger[_0x7ec9('0xd')]('[%s][TAG]\x20%s',_0x1cb1bc,JSON[_0x7ec9('0x1a')](_0x3616f9));logger[_0x7ec9('0x17')](_0x7ec9('0x11'),_0x1cb1bc);})[_0x7ec9('0x1b')](function(){_0x600b5f['next']();});}}}catch(_0x33ce0c){logger['error'](_0x7ec9('0x1c'),_0x1cb1bc,_[_0x7ec9('0x1d')](_0x33ce0c)?JSON['stringify'](_0x33ce0c):_0x33ce0c);logger[_0x7ec9('0x17')](_0x7ec9('0x11'),_0x1cb1bc);_0x600b5f[_0x7ec9('0x12')]();}};}; \ No newline at end of file +var _0x9075=['catch','stringify','isObject','validate','lodash','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction'];(function(_0x34e885,_0x3a67a4){var _0x138046=function(_0x4b2a48){while(--_0x4b2a48){_0x34e885['push'](_0x34e885['shift']());}};_0x138046(++_0x3a67a4);}(_0x9075,0xd2));var _0x5907=function(_0x5d547f,_0x50a029){_0x5d547f=_0x5d547f-0x0;var _0x66efe3=_0x9075[_0x5d547f];return _0x66efe3;};'use strict';var schema=require(_0x5907('0x0'));var _=require(_0x5907('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x5907('0x2')),'mailInteraction':require(_0x5907('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x5907('0x4'))};var logger=require('../../../../config/logger')(_0x5907('0x5'));var tag=schema({'tag':{'type':_0x5907('0x6'),'required':!![],'message':_0x5907('0x7')}});exports['consequence']=function(_0x2cfe90,_0x4348bf,_0x33abb,_0x4c3f55){return function(_0x2c472a){try{var _0x3fa7ab={'tag':_0x4348bf[0x0]};var _0x5bacaa=tag[_0x5907('0x0')](_0x3fa7ab,{'typecast':!![]});if(_0x5bacaa['length']){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,_[_0x5907('0xa')](_0x5bacaa,_0x5907('0xb'))[_0x5907('0xc')](',\x20'));logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);_0x2c472a[_0x5907('0xf')]();}else{var _0x1d07a9={'ids':[_0x4348bf[0x0]]};if(rpc[_0x4c3f55[_0x5907('0x10')]+'Interaction']){rpc[_0x4c3f55[_0x5907('0x10')]+_0x5907('0x11')]['addTags'](_0x4c3f55['interaction']['id'],_0x1d07a9)['then'](function(_0x1837d5){logger[_0x5907('0xd')](_0x5907('0x12'),_0x2cfe90,_0x4348bf[0x1],_0x4c3f55[_0x5907('0x10')],_0x4c3f55[_0x5907('0x13')]['id']);})[_0x5907('0x14')](function(_0x5b5cc1){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,JSON[_0x5907('0x15')](_0x5b5cc1));logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);})['finally'](function(){_0x2c472a['next']();});}}}catch(_0x273e0d){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,_[_0x5907('0x16')](_0x273e0d)?JSON[_0x5907('0x15')](_0x273e0d):_0x273e0d);logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);_0x2c472a[_0x5907('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index d441d3c..77d6a03 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe398=['Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','login','params','stringify','utf8','POST','then','parse','result'];(function(_0x2ed90d,_0x1460ff){var _0x2fa50c=function(_0xc3a9a6){while(--_0xc3a9a6){_0x2ed90d['push'](_0x2ed90d['shift']());}};_0x2fa50c(++_0x1460ff);}(_0xe398,0x8c));var _0x8e39=function(_0x17974f,_0x431507){_0x17974f=_0x17974f-0x0;var _0x4a1c51=_0xe398[_0x17974f];return _0x4a1c51;};'use strict';var rp=require(_0x8e39('0x0'));var logger=require(_0x8e39('0x1'))(_0x8e39('0x2'));var _=require('lodash');var arr=[];exports[_0x8e39('0x3')]=function(_0x13334,_0x1448ae){return function(_0x42eaf8){var _0x21b64d=_0x1448ae[0xa];var _0x3b880a=_0x1448ae[0xb];var _0x4fc9f0=_0x1448ae[0xc];var _0x5704fe=_0x1448ae[0xd];var _0x1bb288=_0x1448ae[0xe];var _0xab6b40=_0x1448ae[0xf][_0x8e39('0x4')](/\n/g,'\x20-\x20');var _0x204a6a=_0x1448ae[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x8e39('0x5')](_0x3b880a)){arr[_0x8e39('0x6')](_0x3b880a);var _0x4d9c33=_0x1448ae[0x3];var _0x4027b2=_0x1448ae[0x4];var _0x15c969=_0x1448ae[0x1];var _0x3458a2=_0x1448ae[0x0];var _0x164250={};_0x164250[_0x8e39('0x7')]=_0x1448ae[0x8]+_0x8e39('0x8')+_0x4fc9f0+'|'+_0x21b64d+'|'+_0x5704fe+'|'+_0x3b880a+'|'+_0x1bb288;_0x164250[_0x8e39('0x9')]=_0x1448ae[0x7]+_0x8e39('0x8')+_0x4fc9f0+'|'+_0x21b64d+'|'+_0x5704fe+'|'+_0x3b880a+'|'+_0x1bb288+'|'+_0xab6b40+'|'+_0x204a6a;_0x164250['title']=_0x1448ae[0x9];var _0x26ae04={};_0x26ae04[_0x8e39('0xa')]=_0x8e39('0xb');_0x26ae04['method']=_0x8e39('0xc');var _0x255104=[];_0x255104[_0x8e39('0x6')](_0x1448ae[0x2]);_0x255104[_0x8e39('0x6')](_0x1448ae[0x5]);_0x255104['push'](_0x1448ae[0x6]);_0x26ae04[_0x8e39('0xd')]=_0x255104;_0x26ae04['id']=0x1;var _0x1dfa43=JSON[_0x8e39('0xe')](_0x26ae04);var _0x2483af={'encoding':_0x8e39('0xf'),'method':_0x8e39('0x10'),'timeout':0x2710,'url':_0x4d9c33,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1dfa43};return rp(_0x2483af)[_0x8e39('0x11')](function(_0x100bdd){const _0x546c6a=JSON[_0x8e39('0x12')](_0x100bdd);if(!_0x546c6a[_0x8e39('0x13')]['logged']){throw new Error(_0x8e39('0x14'));}var _0x22ac5c=_0x3b880a;var _0x1aa99a=_0x8e39('0x15')+_0x15c969+'&serviceId='+_0x3458a2+_0x8e39('0x16')+_0x22ac5c+_0x8e39('0x17')+JSON[_0x8e39('0xe')](_0x164250);var _0x39a97c=_0x4027b2+'?'+_0x1aa99a;return rp(_0x39a97c);})[_0x8e39('0x11')](function(_0x3da94e){logger[_0x8e39('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x13334,_0x3da94e);_0x42eaf8[_0x8e39('0x19')]();})[_0x8e39('0x1a')](function(_0x1ef275){logger[_0x8e39('0x1b')](_0x8e39('0x1c'),_0x13334,_[_0x8e39('0x1d')](_0x1ef275)?JSON['stringify'](_0x1ef275):_0x1ef275);_0x42eaf8['stop']();});}else{logger[_0x8e39('0x18')](_0x8e39('0x1e'),_0x13334);_0x42eaf8[_0x8e39('0x1f')]();}};}; \ No newline at end of file +var _0x3cc0=['&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes','?params=','title','2.0','method','login','push','params','stringify','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId='];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3cc0,0x10d));var _0x03cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3cc0[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var logger=require(_0x03cc('0x0'))(_0x03cc('0x1'));var _=require(_0x03cc('0x2'));var arr=[];exports['consequence']=function(_0x5495fd,_0x401b97){return function(_0x1ff7ef){var _0x214c0f=_0x401b97[0xa];var _0x188f66=_0x401b97[0xb];var _0x51477e=_0x401b97[0xc];var _0x274156=_0x401b97[0xd];var _0x23b4a4=_0x401b97[0xe];var _0x355f7b=_0x401b97[0xf][_0x03cc('0x3')](/\n/g,_0x03cc('0x4'));var _0x2c5418=_0x401b97[0x10][_0x03cc('0x3')](/\n/g,'\x20');if(!arr[_0x03cc('0x5')](_0x188f66)){arr['push'](_0x188f66);var _0x12514c=_0x401b97[0x3];var _0x109e70=_0x401b97[0x4];var _0x369ccc=_0x401b97[0x1];var _0x561861=_0x401b97[0x0];var _0x4e3123={};_0x4e3123['urlOnAnswer']=_0x401b97[0x8]+_0x03cc('0x6')+_0x51477e+'|'+_0x214c0f+'|'+_0x274156+'|'+_0x188f66+'|'+_0x23b4a4;_0x4e3123['urlOnRing']=_0x401b97[0x7]+_0x03cc('0x6')+_0x51477e+'|'+_0x214c0f+'|'+_0x274156+'|'+_0x188f66+'|'+_0x23b4a4+'|'+_0x355f7b+'|'+_0x2c5418;_0x4e3123[_0x03cc('0x7')]=_0x401b97[0x9];var _0x15ed96={};_0x15ed96['jsonrpc']=_0x03cc('0x8');_0x15ed96[_0x03cc('0x9')]=_0x03cc('0xa');var _0x1bdb3a=[];_0x1bdb3a[_0x03cc('0xb')](_0x401b97[0x2]);_0x1bdb3a[_0x03cc('0xb')](_0x401b97[0x5]);_0x1bdb3a['push'](_0x401b97[0x6]);_0x15ed96[_0x03cc('0xc')]=_0x1bdb3a;_0x15ed96['id']=0x1;var _0x1e1175=JSON[_0x03cc('0xd')](_0x15ed96);var _0x230f3f={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x12514c,'headers':{'Content-Type':_0x03cc('0xe')},'body':_0x1e1175};return rp(_0x230f3f)[_0x03cc('0xf')](function(_0x197a62){const _0x2927ed=JSON[_0x03cc('0x10')](_0x197a62);if(!_0x2927ed[_0x03cc('0x11')]['logged']){throw new Error(_0x03cc('0x12'));}var _0x397bc6=_0x188f66;var _0x54f6a8=_0x03cc('0x13')+_0x369ccc+'&serviceId='+_0x561861+_0x03cc('0x14')+_0x397bc6+_0x03cc('0x15')+JSON[_0x03cc('0xd')](_0x4e3123);var _0x1db891=_0x109e70+'?'+_0x54f6a8;return rp(_0x1db891);})['then'](function(_0x3658a5){logger[_0x03cc('0x16')](_0x03cc('0x17'),_0x5495fd,_0x3658a5);_0x1ff7ef[_0x03cc('0x18')]();})['catch'](function(_0x22fc8a){logger[_0x03cc('0x19')](_0x03cc('0x1a'),_0x5495fd,_[_0x03cc('0x1b')](_0x22fc8a)?JSON[_0x03cc('0xd')](_0x22fc8a):_0x22fc8a);_0x1ff7ef['stop']();});}else{logger[_0x03cc('0x16')](_0x03cc('0x1c'),_0x5495fd);_0x1ff7ef['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 f3d5404..3f04436 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x4db4e5,_0x55bf6f){var _0x7e80a1=function(_0xf9b1d6){while(--_0xf9b1d6){_0x4db4e5['push'](_0x4db4e5['shift']());}};_0x7e80a1(++_0x55bf6f);}(_0xe706,0xa3));var _0x6e70=function(_0x57c601,_0x3293a2){_0x57c601=_0x57c601-0x0;var _0x10d301=_0xe706[_0x57c601];return _0x10d301;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x543e81,_0x447282){var _0xcef42a=function(_0x1c499c){while(--_0x1c499c){_0x543e81['push'](_0x543e81['shift']());}};_0xcef42a(++_0x447282);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index a3c4efc..2c4e957 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 _0xb4c1=['channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','TagId','tvox','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','app','consequence','priority','\x20|\x20','error','.js','execute','info','Applications\x20executed','stringify','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules'];(function(_0x5c2bec,_0x4a4ca1){var _0x497e4f=function(_0xe9d8d2){while(--_0xe9d8d2){_0x5c2bec['push'](_0x5c2bec['shift']());}};_0x497e4f(++_0x4a4ca1);}(_0xb4c1,0xba));var _0x1b4c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb4c1[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x1b4c('0x0'));var path=require(_0x1b4c('0x1'));var fs=require('fs');var jayson=require(_0x1b4c('0x2'));var BPromise=require('bluebird');var utils=require(_0x1b4c('0x3'));var sUtils=require(_0x1b4c('0x4'));var logger=require(_0x1b4c('0x5'))(_0x1b4c('0x6'));var rpc={'openchannelQueueReport':require(_0x1b4c('0x7')),'mailQueueReport':require(_0x1b4c('0x8')),'chatQueueReport':require(_0x1b4c('0x9')),'smsQueueReport':require(_0x1b4c('0xa')),'faxQueueReport':require(_0x1b4c('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x1b4c('0xc'));function getId(_0x3d386e,_0x39ee28,_0x1bfba1){return util[_0x1b4c('0xd')](_0x1b4c('0xe'),_0x3d386e,_0x39ee28||0x0,_0x1bfba1||0x0);}function getIntervals(_0x468ca3,_0x22f588){var _0x1e6281=[];if(!_[_0x1b4c('0xf')](_0x22f588[_0x1b4c('0x10')])&&!_[_0x1b4c('0xf')](_0x468ca3[_0x22f588[_0x1b4c('0x10')]])&&!_[_0x1b4c('0xf')](_0x468ca3[_0x22f588[_0x1b4c('0x10')]][_0x1b4c('0x11')])){_0x1e6281=_[_0x1b4c('0x12')](_0x468ca3[_0x22f588[_0x1b4c('0x10')]][_0x1b4c('0x11')],_0x1b4c('0x13'));}else if(!_[_0x1b4c('0xf')](_0x22f588[_0x1b4c('0x13')])){_0x1e6281=[_0x22f588[_0x1b4c('0x13')]];}return _0x1e6281;}exports[_0x1b4c('0x14')]=function(_0x51fb93){_0x51fb93[_0x1b4c('0x15')]={};return new BPromise(function(_0x89c73b,_0x52c782){var _0x243d51={'Start':function(_0x754134){var _0xe5e34b=this;return new Promise(function(_0x4dd9f3,_0x4a4dac){if(_0x754134){try{var _0x1a3922=[];var _0x2ff603=getId(_0x754134[_0x1b4c('0x16')],_0x754134[_0x1b4c('0x17')]?_0x754134[_0x1b4c('0x17')]['id']:0x0,_0x754134[_0x1b4c('0x18')]?_0x754134[_0x1b4c('0x18')]['id']:0x0);var _0x5d13f8=sUtils[_0x1b4c('0x19')](_0x51fb93,_0x754134);if(!_0x5d13f8&&_0x754134[_0x1b4c('0x1a')]&&_['isArray'](_0x754134[_0x1b4c('0x1a')])&&_0x754134[_0x1b4c('0x1a')]['length']){for(var _0x1578c1=0x0;_0x1578c1<_0x754134[_0x1b4c('0x1a')][_0x1b4c('0x1b')];_0x1578c1+=0x1){var _0x5bc814=_0x754134['applications'][_0x1578c1];if(fs[_0x1b4c('0x1c')](path[_0x1b4c('0x1d')](__dirname,_0x1b4c('0x1a'),_0x5bc814['app']+'.js'))){var _0x39f47e=[];switch(_0x5bc814['app']['toLowerCase']()){case _0x1b4c('0x1e'):var _0x194dfa=_0x5bc814[_0x1b4c('0x1f')][_0x1b4c('0x20')](',');if(_0x754134[_0x1b4c('0x16')]===_0x1b4c('0x21')){_0x39f47e[_0x1b4c('0x22')](_0x194dfa[0x0]);_0x39f47e['push'](_0x194dfa[0x1]);_0x39f47e['push'](_0x194dfa[_0x1b4c('0x23')](0x2,_0x194dfa[_0x1b4c('0x1b')])[_0x1b4c('0x1d')](','));}else{_0x39f47e[_0x1b4c('0x22')](_0x194dfa[0x0]);_0x39f47e[_0x1b4c('0x22')](_0x194dfa['slice'](0x1,_0x194dfa[_0x1b4c('0x1b')])['join'](','));}break;case _0x1b4c('0x24'):var _0x4a3c4a=_0x5bc814[_0x1b4c('0x1f')][_0x1b4c('0x20')](',');_0x39f47e[_0x1b4c('0x22')](_0x4a3c4a[0x0]);_0x39f47e['push'](_0x4a3c4a[0x1]);_0x39f47e[_0x1b4c('0x22')](_0x4a3c4a['slice'](0x2,_0x4a3c4a[_0x1b4c('0x1b')])['join'](','));break;case _0x1b4c('0x25'):var _0x55f614=_0x5bc814[_0x1b4c('0x1f')][_0x1b4c('0x20')](',');_0x39f47e['push'](_0x55f614[0x0]);_0x39f47e[_0x1b4c('0x22')](_0x55f614[0x1]);_0x39f47e[_0x1b4c('0x22')](_0x55f614[0x2]);_0x39f47e[_0x1b4c('0x22')](_0x55f614[0x3]);_0x39f47e[_0x1b4c('0x22')](_0x55f614['slice'](0x4,_0x55f614['length'])['join'](','));break;case'amazonlex':var _0x5693e4=_0x5bc814[_0x1b4c('0x1f')]['split'](',');_0x39f47e[_0x1b4c('0x22')](_0x5693e4[0x0]);_0x39f47e['push'](_0x5693e4[0x1]);_0x39f47e[_0x1b4c('0x22')](_0x5693e4[0x2]);_0x39f47e['push'](_0x5693e4[0x3]);_0x39f47e['push'](_0x5693e4[_0x1b4c('0x23')](0x4,_0x5693e4[_0x1b4c('0x1b')])[_0x1b4c('0x1d')](','));break;case _0x1b4c('0x17'):_0x39f47e[_0x1b4c('0x22')](_0x5bc814[_0x1b4c('0x1f')]);break;case'tag':_0x39f47e['push'](_0x5bc814[_0x1b4c('0x26')]);_0x39f47e[_0x1b4c('0x22')](_0x5bc814[_0x1b4c('0x1f')]);break;case _0x1b4c('0x27'):var _0x5ebdbf=utils['getMustacheRender'](_0x754134[_0x1b4c('0x28')][_0x1b4c('0x29')],_0x754134);var _0x2553ce=_0x5bc814['appdata']['split'](',');_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x0]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x1]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x2]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x3]);_0x39f47e['push'](_0x2553ce[0x4]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x5]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x6]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x7]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0x8]);_0x39f47e['push'](_0x2553ce[0x9]);_0x39f47e[_0x1b4c('0x22')](_0x2553ce[0xa]);_0x39f47e['push'](_0x754134[_0x1b4c('0x18')]['id']);_0x39f47e['push'](_0x754134[_0x1b4c('0x17')]['id']);_0x39f47e[_0x1b4c('0x22')](_0x5bc814[_0x1b4c('0x2a')]);_0x39f47e[_0x1b4c('0x22')](_0x754134[_0x1b4c('0x18')]['ContactId']);_0x39f47e[_0x1b4c('0x22')](_0x754134[_0x1b4c('0x2b')][_0x1b4c('0x2b')]);_0x39f47e['push'](_0x5ebdbf);break;default:_0x39f47e=_[_0x1b4c('0xf')](_0x5bc814[_0x1b4c('0x1f')])?[]:_0x5bc814[_0x1b4c('0x1f')][_0x1b4c('0x20')](',');}var _0x5dd8ef={'id':util[_0x1b4c('0xd')](_0x1b4c('0x2c'),_0x2ff603,_0x5bc814['id'],_0x5bc814['app']),'condition':require(_0x1b4c('0x2d'))[_0x1b4c('0x2e')](_0x2ff603,getIntervals(_0x51fb93[_0x1b4c('0x2f')],_0x5bc814),_0x51fb93),'consequence':require(_0x1b4c('0x30')+_0x5bc814[_0x1b4c('0x31')])[_0x1b4c('0x32')](_0x2ff603,_0x39f47e,_0x51fb93,_0x754134),'p':_0x5bc814[_0x1b4c('0x33')]||0x0};logger['info']('Push\x20new\x20rule',_0x5dd8ef['id'],'on\x20interval',getIntervals(_0x51fb93[_0x1b4c('0x2f')],_0x5bc814)[_0x1b4c('0x1d')](_0x1b4c('0x34')));_0x1a3922[_0x1b4c('0x22')](_0x5dd8ef);}else{logger[_0x1b4c('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x5bc814['app']+_0x1b4c('0x36')));}}_0x51fb93[_0x1b4c('0x15')][_0x2ff603]=new RuleEngine(_0x1a3922);_0x51fb93[_0x1b4c('0x15')][_0x2ff603][_0x1b4c('0x37')](_0x754134,function(_0x36abbb){logger[_0x1b4c('0x38')](_0x1b4c('0x39'),JSON[_0x1b4c('0x3a')](_0x36abbb[_0x1b4c('0x3b')]));if(_0x51fb93['rules'][_0x2ff603]){_0x51fb93[_0x1b4c('0x15')][_0x2ff603]['emit'](_0x1b4c('0x3c'));}});return _0x4dd9f3({'code':0xc8,'message':_0x754134});}else{if(_0x5d13f8){logger[_0x1b4c('0x38')](util[_0x1b4c('0xd')](_0x1b4c('0x3d'),_0x2ff603));}else{logger['info'](_0x1b4c('0x3e'));}return _0x4dd9f3({'code':0xc8,'message':_0x754134});}}catch(_0x1e6591){logger['error'](_0x1e6591[_0x1b4c('0x3f')]);return _0x4a4dac(_0xe5e34b[_0x1b4c('0x35')](0x1f4,_0x1e6591));}}return _0x4a4dac(_0x1b4c('0x40'));});},'AcceptMessage':function(_0x1adac9){var _0x2d1b90=this;return new Promise(function(_0x4cab8a,_0x16d599){if(_0x1adac9[_0x1b4c('0x41')]&&_0x1adac9[_0x1b4c('0x41')]['id']){if(_0x51fb93['agents'][_0x1adac9[_0x1b4c('0x41')]['id']]){_0x51fb93['agents'][_0x1adac9[_0x1b4c('0x41')]['id']][_0x1b4c('0x42')]=![];_0x51fb93['agents'][_0x1adac9[_0x1b4c('0x41')]['id']][_0x1b4c('0x43')]=undefined;}}if(_0x1adac9['message']&&_0x1adac9[_0x1b4c('0x17')]['id']){try{var _0x22e5fb=getId(_0x1adac9['channel'],_0x1adac9[_0x1b4c('0x17')]?_0x1adac9[_0x1b4c('0x17')]['id']:0x0,_0x1adac9['interaction']?_0x1adac9[_0x1b4c('0x18')]['id']:0x0);if(_0x51fb93[_0x1b4c('0x15')][_0x22e5fb]){_0x51fb93[_0x1b4c('0x15')][_0x22e5fb][_0x1b4c('0x44')](_0x1b4c('0x45'));if(rpc[_0x1adac9[_0x1b4c('0x16')]+'QueueReport']){rpc[_0x1adac9[_0x1b4c('0x16')]+_0x1b4c('0x46')][_0x1b4c('0x47')](_0x22e5fb,{'UserId':_0x1adac9['message'][_0x1b4c('0x48')]})[_0x1b4c('0x49')](function(){logger[_0x1b4c('0x35')](_0x1b4c('0x4a'));});}}return _0x4cab8a({'code':0xc8,'message':_0x1adac9});}catch(_0x534929){logger[_0x1b4c('0x35')](_0x534929[_0x1b4c('0x3f')]);return _0x16d599(_0x2d1b90[_0x1b4c('0x35')](0x1f4,_0x534929));}}logger[_0x1b4c('0x35')](_0x1b4c('0x4b'));return _0x16d599(_0x2d1b90['error'](0x1f4,_0x1b4c('0x4b')));});},'RejectMessage':function(_0x2b7736){var _0x1be00e=this;return new Promise(function(_0x1c7cb6,_0x1c0834){if(_0x2b7736['agent']&&_0x2b7736[_0x1b4c('0x41')]['id']){try{if(_0x51fb93[_0x1b4c('0x4c')][_0x2b7736['agent']['id']]){_0x51fb93[_0x1b4c('0x4c')][_0x2b7736['agent']['id']]['busy']=![];_0x51fb93[_0x1b4c('0x4c')][_0x2b7736[_0x1b4c('0x41')]['id']][_0x1b4c('0x43')]=undefined;}return _0x1c7cb6({'code':0xc8,'message':_0x2b7736});}catch(_0x57ec01){logger[_0x1b4c('0x35')](_0x57ec01['stack']);return _0x1c0834(_0x1be00e['error'](0x1f4,_0x57ec01));}}logger[_0x1b4c('0x35')](_0x1b4c('0x4b'));return _0x1c0834(_0x1be00e[_0x1b4c('0x35')](0x1f4,_0x1b4c('0x4b')));});},'AbandonInteraction':function(_0x28479d){var _0x538f24=this;return new Promise(function(_0x2e11e5,_0x1ac49c){if(_0x28479d[_0x1b4c('0x16')]&&_0x28479d[_0x1b4c('0x18')]&&_0x28479d[_0x1b4c('0x18')]['id']){try{var _0x541201=getId(_0x28479d[_0x1b4c('0x16')],_0x28479d[_0x1b4c('0x17')]?_0x28479d['message']['id']:0x0,_0x28479d[_0x1b4c('0x18')]?_0x28479d[_0x1b4c('0x18')]['id']:0x0);if(_0x51fb93[_0x1b4c('0x15')][_0x541201]){_0x51fb93['rules'][_0x541201][_0x1b4c('0x44')](_0x1b4c('0x45'));}return _0x2e11e5({'code':0xc8,'message':_0x28479d});}catch(_0x47ea84){logger['error'](_0x47ea84[_0x1b4c('0x3f')]);return _0x1ac49c(_0x538f24[_0x1b4c('0x35')](0x1f4,_0x47ea84));}}logger[_0x1b4c('0x35')](_0x1b4c('0x4b'));return _0x1ac49c(_0x538f24[_0x1b4c('0x35')](0x1f4,_0x1b4c('0x4b')));});},'AgentCapacity':function(_0x32b5b1){var _0x142f35=this;return new Promise(function(_0x2e5d02,_0x1bd4e4){if(_0x51fb93[_0x1b4c('0x4c')][_0x1b4c('0x4d')](_0x32b5b1['id'])){for(var _0x239d8b in _0x32b5b1[_0x1b4c('0x4e')]){if(_0x32b5b1['capacity'][_0x1b4c('0x4d')](_0x239d8b)){if(_0x51fb93[_0x1b4c('0x4c')][_0x32b5b1['id']][_0x1b4c('0x4d')](_0x239d8b+_0x1b4c('0x4f'))){_0x51fb93[_0x1b4c('0x4c')][_0x32b5b1['id']][_0x239d8b+_0x1b4c('0x4f')]=parseInt(_0x32b5b1['capacity'][_0x239d8b],0xa);}}}_0x51fb93[_0x1b4c('0x4c')][_0x32b5b1['id']][_0x1b4c('0x50')]();return _0x2e5d02({'code':0xc8,'message':_0x51fb93[_0x1b4c('0x4c')][_0x32b5b1['id']]});}else{return _0x1bd4e4(_0x142f35[_0x1b4c('0x35')](0x1f4,_0x1b4c('0x51')));}});},'Agents':function(_0x1bf5b1){return new Promise(function(_0x330295){var _0x42431d=_[_0x1b4c('0x52')](_0x51fb93[_0x1b4c('0x4c')]);if(_0x1bf5b1&&_0x1bf5b1['id']){var _0x30353f=_['find'](_0x42431d,function(_0x3a7f1d){return _0x3a7f1d['id']===_0x1bf5b1['id'];});_0x330295(_0x30353f);}else{_0x330295({'count':_0x42431d[_0x1b4c('0x1b')],'rows':_0x42431d});}});},'ChatQueues':function(){return new Promise(function(_0x43c872){var _0x1c1eb5=[];for(var _0x2b6082 in _0x51fb93[_0x1b4c('0x53')]){if(_0x51fb93[_0x1b4c('0x53')]['hasOwnProperty'](_0x2b6082)){var _0x40af55=_0x51fb93[_0x1b4c('0x53')][_0x2b6082];var _0x11110f={'id':_0x40af55['id'],'available':_0x40af55[_0x1b4c('0x54')],'loggedIn':_0x40af55[_0x1b4c('0x55')],'name':_0x40af55[_0x1b4c('0x56')],'paused':_0x40af55[_0x1b4c('0x57')],'waiting':_0x40af55[_0x1b4c('0x58')]};_0x1c1eb5['push'](_0x11110f);}}_0x43c872({'count':_0x1c1eb5[_0x1b4c('0x1b')],'rows':_0x1c1eb5});});},'MailQueues':function(){return new Promise(function(_0x153932){var _0x1ec47c=[];for(var _0x17e6ac in _0x51fb93['mailQueues']){if(_0x51fb93['mailQueues'][_0x1b4c('0x4d')](_0x17e6ac)){var _0xb8ec9f=_0x51fb93['mailQueues'][_0x17e6ac];var _0x4eacb2={'id':_0xb8ec9f['id'],'available':_0xb8ec9f[_0x1b4c('0x54')],'loggedIn':_0xb8ec9f[_0x1b4c('0x55')],'name':_0xb8ec9f[_0x1b4c('0x56')],'paused':_0xb8ec9f[_0x1b4c('0x57')],'waiting':_0xb8ec9f[_0x1b4c('0x58')]};_0x1ec47c[_0x1b4c('0x22')](_0x4eacb2);}}_0x153932({'count':_0x1ec47c[_0x1b4c('0x1b')],'rows':_0x1ec47c});});},'OpenchannelQueues':function(){return new Promise(function(_0x101ae4){var _0x5b7e53=[];for(var _0xb2b818 in _0x51fb93['openchannelQueues']){if(_0x51fb93['openchannelQueues']['hasOwnProperty'](_0xb2b818)){var _0x47d976=_0x51fb93[_0x1b4c('0x59')][_0xb2b818];var _0x281066={'id':_0x47d976['id'],'available':_0x47d976[_0x1b4c('0x54')],'loggedIn':_0x47d976['loggedIn'],'name':_0x47d976[_0x1b4c('0x56')],'paused':_0x47d976[_0x1b4c('0x57')],'waiting':_0x47d976[_0x1b4c('0x58')]};_0x5b7e53[_0x1b4c('0x22')](_0x281066);}}_0x101ae4({'count':_0x5b7e53[_0x1b4c('0x1b')],'rows':_0x5b7e53});});},'SmsQueues':function(){return new Promise(function(_0x51bdf8){var _0x18c0cf=[];for(var _0x157d11 in _0x51fb93[_0x1b4c('0x5a')]){if(_0x51fb93[_0x1b4c('0x5a')][_0x1b4c('0x4d')](_0x157d11)){var _0x5cdf73=_0x51fb93[_0x1b4c('0x5a')][_0x157d11];var _0x16692d={'id':_0x5cdf73['id'],'available':_0x5cdf73[_0x1b4c('0x54')],'loggedIn':_0x5cdf73[_0x1b4c('0x55')],'name':_0x5cdf73[_0x1b4c('0x56')],'paused':_0x5cdf73[_0x1b4c('0x57')],'waiting':_0x5cdf73[_0x1b4c('0x58')]};_0x18c0cf[_0x1b4c('0x22')](_0x16692d);}}_0x51bdf8({'count':_0x18c0cf[_0x1b4c('0x1b')],'rows':_0x18c0cf});});},'FaxQueues':function(){return new Promise(function(_0x4d1583){var _0x2ac930=[];for(var _0x11486b in _0x51fb93[_0x1b4c('0x5b')]){if(_0x51fb93[_0x1b4c('0x5b')]['hasOwnProperty'](_0x11486b)){var _0x1515e4=_0x51fb93[_0x1b4c('0x5b')][_0x11486b];var _0x2958af={'id':_0x1515e4['id'],'available':_0x1515e4[_0x1b4c('0x54')],'loggedIn':_0x1515e4[_0x1b4c('0x55')],'name':_0x1515e4['name'],'paused':_0x1515e4[_0x1b4c('0x57')],'waiting':_0x1515e4[_0x1b4c('0x58')]};_0x2ac930[_0x1b4c('0x22')](_0x2958af);}}_0x4d1583({'count':_0x2ac930['length'],'rows':_0x2ac930});});},'WhatsappQueues':function(){return new Promise(function(_0x7169d){var _0x192a94=[];for(var _0x305632 in _0x51fb93[_0x1b4c('0x5c')]){if(_0x51fb93[_0x1b4c('0x5c')][_0x1b4c('0x4d')](_0x305632)){var _0x49e89a=_0x51fb93[_0x1b4c('0x5c')][_0x305632];var _0x230528={'id':_0x49e89a['id'],'available':_0x49e89a[_0x1b4c('0x54')],'loggedIn':_0x49e89a['loggedIn'],'name':_0x49e89a[_0x1b4c('0x56')],'paused':_0x49e89a[_0x1b4c('0x57')],'waiting':_0x49e89a[_0x1b4c('0x58')]};_0x192a94[_0x1b4c('0x22')](_0x230528);}}_0x7169d({'count':_0x192a94[_0x1b4c('0x1b')],'rows':_0x192a94});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x52be24){var _0x4f6ee3=_[_0x1b4c('0x52')](_0x51fb93[_0x1b4c('0x5d')]);_0x52be24({'count':_0x4f6ee3[_0x1b4c('0x1b')],'rows':_0x4f6ee3});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x15f6ef){var _0x5a3ed2=_[_0x1b4c('0x52')](_0x51fb93[_0x1b4c('0x5e')]);_0x15f6ef({'count':_0x5a3ed2['length'],'rows':_0x5a3ed2});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x217107){var _0x542f96=_['values'](_0x51fb93[_0x1b4c('0x5f')]);_0x217107({'count':_0x542f96[_0x1b4c('0x1b')],'rows':_0x542f96});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2d4a8b){var _0x321af5=_[_0x1b4c('0x52')](_0x51fb93[_0x1b4c('0x60')]);_0x2d4a8b({'count':_0x321af5['length'],'rows':_0x321af5});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2b1725){var _0x5bc3d1=_[_0x1b4c('0x52')](_0x51fb93['faxQueuesWaitingInteractions']);_0x2b1725({'count':_0x5bc3d1[_0x1b4c('0x1b')],'rows':_0x5bc3d1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x547e18){var _0x3859f9=_[_0x1b4c('0x52')](_0x51fb93[_0x1b4c('0x61')]);_0x547e18({'count':_0x3859f9[_0x1b4c('0x1b')],'rows':_0x3859f9});});}};var _0x3ef448=jayson[_0x1b4c('0x62')](_0x243d51)[_0x1b4c('0x63')]();_0x3ef448['on'](_0x1b4c('0x35'),function(_0x10cffa){logger[_0x1b4c('0x35')](JSON[_0x1b4c('0x3a')](_0x10cffa));return _0x52c782(_0x10cffa);});_0x3ef448[_0x1b4c('0x14')](0x232c,_0x1b4c('0x64'),function(){console[_0x1b4c('0x65')](_0x1b4c('0x66'),0x232c);return _0x89c73b(_0x1b4c('0x67')+0x232c);});});}; \ No newline at end of file +var _0xf7a8=['server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','join','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf7a8,0x71));var _0x8f7a=function(_0x16cd43,_0x5a7e02){_0x16cd43=_0x16cd43-0x0;var _0xbc906a=_0xf7a8[_0x16cd43];return _0xbc906a;};'use strict';var _=require(_0x8f7a('0x0'));var util=require(_0x8f7a('0x1'));var path=require(_0x8f7a('0x2'));var fs=require('fs');var jayson=require(_0x8f7a('0x3'));var BPromise=require(_0x8f7a('0x4'));var utils=require(_0x8f7a('0x5'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x8f7a('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8f7a('0x7')),'chatQueueReport':require(_0x8f7a('0x8')),'smsQueueReport':require(_0x8f7a('0x9')),'faxQueueReport':require(_0x8f7a('0xa')),'whatsappQueueReport':require(_0x8f7a('0xb'))};var RuleEngine=require(_0x8f7a('0xc'));function getId(_0x1981b1,_0x2dd4a4,_0x4993b7){return util[_0x8f7a('0xd')](_0x8f7a('0xe'),_0x1981b1,_0x2dd4a4||0x0,_0x4993b7||0x0);}function getIntervals(_0xc32962,_0x5ce80f){var _0x6afc96=[];if(!_[_0x8f7a('0xf')](_0x5ce80f[_0x8f7a('0x10')])&&!_[_0x8f7a('0xf')](_0xc32962[_0x5ce80f[_0x8f7a('0x10')]])&&!_[_0x8f7a('0xf')](_0xc32962[_0x5ce80f['IntervalId']][_0x8f7a('0x11')])){_0x6afc96=_[_0x8f7a('0x12')](_0xc32962[_0x5ce80f[_0x8f7a('0x10')]][_0x8f7a('0x11')],_0x8f7a('0x13'));}else if(!_[_0x8f7a('0xf')](_0x5ce80f[_0x8f7a('0x13')])){_0x6afc96=[_0x5ce80f['interval']];}return _0x6afc96;}exports[_0x8f7a('0x14')]=function(_0x15534b){_0x15534b[_0x8f7a('0x15')]={};return new BPromise(function(_0x2b4613,_0x2e1dda){var _0x3c7252={'Start':function(_0x592869){var _0x4b5395=this;return new Promise(function(_0x15c5de,_0x221405){if(_0x592869){try{var _0x4b5fd8=[];var _0x58bbdc=getId(_0x592869[_0x8f7a('0x16')],_0x592869['message']?_0x592869[_0x8f7a('0x17')]['id']:0x0,_0x592869[_0x8f7a('0x18')]?_0x592869[_0x8f7a('0x18')]['id']:0x0);var _0x502fe5=sUtils['checkWaitingNotifications'](_0x15534b,_0x592869);if(!_0x502fe5&&_0x592869[_0x8f7a('0x19')]&&_[_0x8f7a('0x1a')](_0x592869[_0x8f7a('0x19')])&&_0x592869[_0x8f7a('0x19')][_0x8f7a('0x1b')]){for(var _0x20bc98=0x0;_0x20bc98<_0x592869['applications']['length'];_0x20bc98+=0x1){var _0x12f705=_0x592869[_0x8f7a('0x19')][_0x20bc98];if(fs[_0x8f7a('0x1c')](path['join'](__dirname,'applications',_0x12f705[_0x8f7a('0x1d')]+_0x8f7a('0x1e')))){var _0x479e9e=[];switch(_0x12f705['app'][_0x8f7a('0x1f')]()){case'autoreply':var _0x52ed1a=_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');if(_0x592869[_0x8f7a('0x16')]===_0x8f7a('0x22')){_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a['slice'](0x2,_0x52ed1a[_0x8f7a('0x1b')])['join'](','));}else{_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[_0x8f7a('0x24')](0x1,_0x52ed1a[_0x8f7a('0x1b')])['join'](','));}break;case _0x8f7a('0x25'):var _0x228c95=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x228c95[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x228c95[0x1]);_0x479e9e['push'](_0x228c95['slice'](0x2,_0x228c95[_0x8f7a('0x1b')])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x27'):var _0x543248=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x543248[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x543248[_0x8f7a('0x24')](0x4,_0x543248[_0x8f7a('0x1b')])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x28'):var _0x3b7d04=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04['slice'](0x4,_0x3b7d04['length'])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x17'):_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x20')]);break;case _0x8f7a('0x29'):_0x479e9e['push'](_0x12f705[_0x8f7a('0x2a')]);_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x20')]);break;case _0x8f7a('0x2b'):var _0xe94d89=utils[_0x8f7a('0x2c')](_0x592869[_0x8f7a('0x2d')]['notificationTemplate'],_0x592869);var _0x390ae1=_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x0]);_0x479e9e['push'](_0x390ae1[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x4]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x5]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x6]);_0x479e9e['push'](_0x390ae1[0x7]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x8]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x9]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0xa]);_0x479e9e['push'](_0x592869[_0x8f7a('0x18')]['id']);_0x479e9e['push'](_0x592869['message']['id']);_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x2e')]);_0x479e9e['push'](_0x592869['interaction'][_0x8f7a('0x2f')]);_0x479e9e[_0x8f7a('0x23')](_0x592869[_0x8f7a('0x30')][_0x8f7a('0x30')]);_0x479e9e[_0x8f7a('0x23')](_0xe94d89);break;default:_0x479e9e=_[_0x8f7a('0xf')](_0x12f705[_0x8f7a('0x20')])?[]:_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');}var _0x561b06={'id':util[_0x8f7a('0xd')](_0x8f7a('0x31'),_0x58bbdc,_0x12f705['id'],_0x12f705[_0x8f7a('0x1d')]),'condition':require(_0x8f7a('0x32'))[_0x8f7a('0x33')](_0x58bbdc,getIntervals(_0x15534b['intervals'],_0x12f705),_0x15534b),'consequence':require('./applications/'+_0x12f705['app'])[_0x8f7a('0x34')](_0x58bbdc,_0x479e9e,_0x15534b,_0x592869),'p':_0x12f705[_0x8f7a('0x35')]||0x0};logger[_0x8f7a('0x36')](_0x8f7a('0x37'),_0x561b06['id'],_0x8f7a('0x38'),getIntervals(_0x15534b[_0x8f7a('0x39')],_0x12f705)[_0x8f7a('0x26')](_0x8f7a('0x3a')));_0x4b5fd8[_0x8f7a('0x23')](_0x561b06);}else{logger[_0x8f7a('0x3b')](_0x8f7a('0x3c'),path[_0x8f7a('0x26')](__dirname,'applications',_0x12f705[_0x8f7a('0x1d')]+_0x8f7a('0x1e')));}}_0x15534b['rules'][_0x58bbdc]=new RuleEngine(_0x4b5fd8);_0x15534b[_0x8f7a('0x15')][_0x58bbdc][_0x8f7a('0x3d')](_0x592869,function(_0x42b948){logger[_0x8f7a('0x36')](_0x8f7a('0x3e'),JSON[_0x8f7a('0x3f')](_0x42b948['matchPath']));if(_0x15534b[_0x8f7a('0x15')][_0x58bbdc]){_0x15534b[_0x8f7a('0x15')][_0x58bbdc][_0x8f7a('0x40')](_0x8f7a('0x41'));}});return _0x15c5de({'code':0xc8,'message':_0x592869});}else{if(_0x502fe5){logger['info'](util[_0x8f7a('0xd')](_0x8f7a('0x42'),_0x58bbdc));}else{logger['info'](_0x8f7a('0x43'));}return _0x15c5de({'code':0xc8,'message':_0x592869});}}catch(_0x954833){logger[_0x8f7a('0x3b')](_0x954833[_0x8f7a('0x44')]);return _0x221405(_0x4b5395[_0x8f7a('0x3b')](0x1f4,_0x954833));}}return _0x221405(_0x8f7a('0x45'));});},'AcceptMessage':function(_0x30cc51){var _0x68327=this;return new Promise(function(_0x5718ee,_0x47eb4c){if(_0x30cc51[_0x8f7a('0x46')]&&_0x30cc51['agent']['id']){if(_0x15534b[_0x8f7a('0x47')][_0x30cc51[_0x8f7a('0x46')]['id']]){_0x15534b[_0x8f7a('0x47')][_0x30cc51[_0x8f7a('0x46')]['id']]['busy']=![];_0x15534b['agents'][_0x30cc51[_0x8f7a('0x46')]['id']][_0x8f7a('0x48')]=undefined;}}if(_0x30cc51[_0x8f7a('0x17')]&&_0x30cc51[_0x8f7a('0x17')]['id']){try{var _0x53056e=getId(_0x30cc51[_0x8f7a('0x16')],_0x30cc51['message']?_0x30cc51[_0x8f7a('0x17')]['id']:0x0,_0x30cc51[_0x8f7a('0x18')]?_0x30cc51[_0x8f7a('0x18')]['id']:0x0);if(_0x15534b[_0x8f7a('0x15')][_0x53056e]){_0x15534b[_0x8f7a('0x15')][_0x53056e]['emit'](_0x8f7a('0x49'));if(rpc[_0x30cc51['channel']+_0x8f7a('0x4a')]){rpc[_0x30cc51[_0x8f7a('0x16')]+'QueueReport'][_0x8f7a('0x4b')](_0x53056e,{'UserId':_0x30cc51[_0x8f7a('0x17')][_0x8f7a('0x4c')]})[_0x8f7a('0x4d')](function(){logger[_0x8f7a('0x3b')](_0x8f7a('0x4e'));});}}return _0x5718ee({'code':0xc8,'message':_0x30cc51});}catch(_0x10d010){logger[_0x8f7a('0x3b')](_0x10d010[_0x8f7a('0x44')]);return _0x47eb4c(_0x68327[_0x8f7a('0x3b')](0x1f4,_0x10d010));}}logger[_0x8f7a('0x3b')]('message\x20is\x20empty');return _0x47eb4c(_0x68327['error'](0x1f4,_0x8f7a('0x4f')));});},'RejectMessage':function(_0x4c9587){var _0x3a1d00=this;return new Promise(function(_0x3c3d15,_0x1f0d32){if(_0x4c9587[_0x8f7a('0x46')]&&_0x4c9587[_0x8f7a('0x46')]['id']){try{if(_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']]){_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']][_0x8f7a('0x50')]=![];_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']][_0x8f7a('0x48')]=undefined;}return _0x3c3d15({'code':0xc8,'message':_0x4c9587});}catch(_0x2ae862){logger['error'](_0x2ae862['stack']);return _0x1f0d32(_0x3a1d00[_0x8f7a('0x3b')](0x1f4,_0x2ae862));}}logger[_0x8f7a('0x3b')](_0x8f7a('0x4f'));return _0x1f0d32(_0x3a1d00[_0x8f7a('0x3b')](0x1f4,_0x8f7a('0x4f')));});},'AbandonInteraction':function(_0x466487){var _0x25f6b2=this;return new Promise(function(_0x54f50e,_0x4a47d3){if(_0x466487[_0x8f7a('0x16')]&&_0x466487['interaction']&&_0x466487['interaction']['id']){try{var _0x56a92d=getId(_0x466487[_0x8f7a('0x16')],_0x466487[_0x8f7a('0x17')]?_0x466487['message']['id']:0x0,_0x466487[_0x8f7a('0x18')]?_0x466487[_0x8f7a('0x18')]['id']:0x0);if(_0x15534b[_0x8f7a('0x15')][_0x56a92d]){_0x15534b[_0x8f7a('0x15')][_0x56a92d][_0x8f7a('0x40')](_0x8f7a('0x49'));}return _0x54f50e({'code':0xc8,'message':_0x466487});}catch(_0x5a3089){logger['error'](_0x5a3089['stack']);return _0x4a47d3(_0x25f6b2[_0x8f7a('0x3b')](0x1f4,_0x5a3089));}}logger['error']('message\x20is\x20empty');return _0x4a47d3(_0x25f6b2[_0x8f7a('0x3b')](0x1f4,_0x8f7a('0x4f')));});},'AgentCapacity':function(_0x475522){var _0x58308a=this;return new Promise(function(_0x1c8728,_0x1b142a){if(_0x15534b[_0x8f7a('0x47')][_0x8f7a('0x51')](_0x475522['id'])){for(var _0x57366e in _0x475522[_0x8f7a('0x52')]){if(_0x475522[_0x8f7a('0x52')]['hasOwnProperty'](_0x57366e)){if(_0x15534b[_0x8f7a('0x47')][_0x475522['id']][_0x8f7a('0x51')](_0x57366e+_0x8f7a('0x53'))){_0x15534b[_0x8f7a('0x47')][_0x475522['id']][_0x57366e+_0x8f7a('0x53')]=parseInt(_0x475522[_0x8f7a('0x52')][_0x57366e],0xa);}}}_0x15534b[_0x8f7a('0x47')][_0x475522['id']]['updateRealtime']();return _0x1c8728({'code':0xc8,'message':_0x15534b['agents'][_0x475522['id']]});}else{return _0x1b142a(_0x58308a['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4493dd){return new Promise(function(_0x592af8){var _0x4836ed=_['values'](_0x15534b[_0x8f7a('0x47')]);if(_0x4493dd&&_0x4493dd['id']){var _0x56cbbf=_[_0x8f7a('0x54')](_0x4836ed,function(_0x3c3ba0){return _0x3c3ba0['id']===_0x4493dd['id'];});_0x592af8(_0x56cbbf);}else{_0x592af8({'count':_0x4836ed['length'],'rows':_0x4836ed});}});},'ChatQueues':function(){return new Promise(function(_0x39f5ff){var _0x1c0c97=[];for(var _0x56c3d9 in _0x15534b[_0x8f7a('0x55')]){if(_0x15534b['chatQueues'][_0x8f7a('0x51')](_0x56c3d9)){var _0x555a61=_0x15534b['chatQueues'][_0x56c3d9];var _0x4b6013={'id':_0x555a61['id'],'available':_0x555a61[_0x8f7a('0x56')],'loggedIn':_0x555a61[_0x8f7a('0x57')],'name':_0x555a61[_0x8f7a('0x58')],'paused':_0x555a61[_0x8f7a('0x59')],'waiting':_0x555a61[_0x8f7a('0x5a')]};_0x1c0c97[_0x8f7a('0x23')](_0x4b6013);}}_0x39f5ff({'count':_0x1c0c97[_0x8f7a('0x1b')],'rows':_0x1c0c97});});},'MailQueues':function(){return new Promise(function(_0x340e6f){var _0x53c2fc=[];for(var _0x38313c in _0x15534b[_0x8f7a('0x5b')]){if(_0x15534b[_0x8f7a('0x5b')][_0x8f7a('0x51')](_0x38313c)){var _0x517584=_0x15534b['mailQueues'][_0x38313c];var _0x58d185={'id':_0x517584['id'],'available':_0x517584[_0x8f7a('0x56')],'loggedIn':_0x517584[_0x8f7a('0x57')],'name':_0x517584[_0x8f7a('0x58')],'paused':_0x517584[_0x8f7a('0x59')],'waiting':_0x517584[_0x8f7a('0x5a')]};_0x53c2fc[_0x8f7a('0x23')](_0x58d185);}}_0x340e6f({'count':_0x53c2fc[_0x8f7a('0x1b')],'rows':_0x53c2fc});});},'OpenchannelQueues':function(){return new Promise(function(_0x2b7fa1){var _0x3fd061=[];for(var _0xb07cae in _0x15534b[_0x8f7a('0x5c')]){if(_0x15534b[_0x8f7a('0x5c')][_0x8f7a('0x51')](_0xb07cae)){var _0x30923c=_0x15534b[_0x8f7a('0x5c')][_0xb07cae];var _0x3a49f4={'id':_0x30923c['id'],'available':_0x30923c[_0x8f7a('0x56')],'loggedIn':_0x30923c[_0x8f7a('0x57')],'name':_0x30923c[_0x8f7a('0x58')],'paused':_0x30923c[_0x8f7a('0x59')],'waiting':_0x30923c[_0x8f7a('0x5a')]};_0x3fd061[_0x8f7a('0x23')](_0x3a49f4);}}_0x2b7fa1({'count':_0x3fd061['length'],'rows':_0x3fd061});});},'SmsQueues':function(){return new Promise(function(_0x2270fa){var _0x5364c7=[];for(var _0x37b821 in _0x15534b[_0x8f7a('0x5d')]){if(_0x15534b[_0x8f7a('0x5d')]['hasOwnProperty'](_0x37b821)){var _0x4a8ece=_0x15534b[_0x8f7a('0x5d')][_0x37b821];var _0x5c91f9={'id':_0x4a8ece['id'],'available':_0x4a8ece[_0x8f7a('0x56')],'loggedIn':_0x4a8ece[_0x8f7a('0x57')],'name':_0x4a8ece[_0x8f7a('0x58')],'paused':_0x4a8ece[_0x8f7a('0x59')],'waiting':_0x4a8ece[_0x8f7a('0x5a')]};_0x5364c7[_0x8f7a('0x23')](_0x5c91f9);}}_0x2270fa({'count':_0x5364c7['length'],'rows':_0x5364c7});});},'FaxQueues':function(){return new Promise(function(_0x5431a0){var _0x5ad99a=[];for(var _0x4c7775 in _0x15534b['faxQueues']){if(_0x15534b[_0x8f7a('0x5e')]['hasOwnProperty'](_0x4c7775)){var _0x37f41e=_0x15534b['faxQueues'][_0x4c7775];var _0x1d483d={'id':_0x37f41e['id'],'available':_0x37f41e['available'],'loggedIn':_0x37f41e['loggedIn'],'name':_0x37f41e[_0x8f7a('0x58')],'paused':_0x37f41e[_0x8f7a('0x59')],'waiting':_0x37f41e[_0x8f7a('0x5a')]};_0x5ad99a['push'](_0x1d483d);}}_0x5431a0({'count':_0x5ad99a['length'],'rows':_0x5ad99a});});},'WhatsappQueues':function(){return new Promise(function(_0xfcb7e2){var _0x4ff7e2=[];for(var _0x4a5bc5 in _0x15534b[_0x8f7a('0x5f')]){if(_0x15534b[_0x8f7a('0x5f')]['hasOwnProperty'](_0x4a5bc5)){var _0x2807c5=_0x15534b[_0x8f7a('0x5f')][_0x4a5bc5];var _0x19e523={'id':_0x2807c5['id'],'available':_0x2807c5[_0x8f7a('0x56')],'loggedIn':_0x2807c5[_0x8f7a('0x57')],'name':_0x2807c5[_0x8f7a('0x58')],'paused':_0x2807c5['paused'],'waiting':_0x2807c5['waiting']};_0x4ff7e2[_0x8f7a('0x23')](_0x19e523);}}_0xfcb7e2({'count':_0x4ff7e2['length'],'rows':_0x4ff7e2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x41c548){var _0x45c87c=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x61')]);_0x41c548({'count':_0x45c87c['length'],'rows':_0x45c87c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x36f1f4){var _0x13a781=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x62')]);_0x36f1f4({'count':_0x13a781[_0x8f7a('0x1b')],'rows':_0x13a781});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x51209b){var _0x542500=_['values'](_0x15534b[_0x8f7a('0x63')]);_0x51209b({'count':_0x542500[_0x8f7a('0x1b')],'rows':_0x542500});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x581ecc){var _0x1721d5=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x64')]);_0x581ecc({'count':_0x1721d5[_0x8f7a('0x1b')],'rows':_0x1721d5});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x55ee7d){var _0x5eba8a=_[_0x8f7a('0x60')](_0x15534b['faxQueuesWaitingInteractions']);_0x55ee7d({'count':_0x5eba8a[_0x8f7a('0x1b')],'rows':_0x5eba8a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4be253){var _0x57d553=_[_0x8f7a('0x60')](_0x15534b['whatsappQueuesWaitingInteractions']);_0x4be253({'count':_0x57d553[_0x8f7a('0x1b')],'rows':_0x57d553});});}};var _0xb9ca31=jayson[_0x8f7a('0x65')](_0x3c7252)[_0x8f7a('0x66')]();_0xb9ca31['on']('error',function(_0x4d4939){logger[_0x8f7a('0x3b')](JSON[_0x8f7a('0x3f')](_0x4d4939));return _0x2e1dda(_0x4d4939);});_0xb9ca31['listen'](0x232c,_0x8f7a('0x67'),function(){console[_0x8f7a('0x68')](_0x8f7a('0x69'),0x232c);return _0x2b4613(_0x8f7a('0x6a')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 118fb37..ab3827b 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 _0xeb5a=['bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb5a,0x1bf));var _0xaeb5=function(_0x4176cc,_0x35766d){_0x4176cc=_0x4176cc-0x0;var _0x4e5532=_0xeb5a[_0x4176cc];return _0x4e5532;};'use strict';var util=require(_0xaeb5('0x0'));var BPromise=require(_0xaeb5('0x1'));var jayson=require(_0xaeb5('0x2'));var _=require(_0xaeb5('0x3'));var logger=require('../../../config/logger')(_0xaeb5('0x4'));var client=jayson[_0xaeb5('0x5')][_0xaeb5('0x6')]({'port':0x232a});function request(_0x30a632,_0x3827ab){return new BPromise(function(_0x54a5c9,_0xf60152){return client[_0xaeb5('0x7')](_0x30a632,_0x3827ab)[_0xaeb5('0x8')](function(_0x4d36ad){if(_0x4d36ad[_0xaeb5('0x9')]){return _0xf60152(_0x4d36ad[_0xaeb5('0x9')][_0xaeb5('0xa')]);}else{return _0x54a5c9(_0x4d36ad[_0xaeb5('0xb')]);}})[_0xaeb5('0xc')](function(_0x6eef57){return _0xf60152(_0x6eef57);});});}exports[_0xaeb5('0xd')]=function(_0x4078cd,_0x165145,_0xd13b11){return function(_0x2bd060){if(_0xd13b11[_0xaeb5('0xe')]&&!_0xd13b11[_0xaeb5('0xe')][_0x4078cd]){logger[_0xaeb5('0xf')](_0xaeb5('0x10'),_0x4078cd);return _0x2bd060[_0xaeb5('0x11')]();}var _0x357a50=[];for(var _0x240055=0x0;_0x240055<_0x165145[_0xaeb5('0x12')];_0x240055+=0x1){_0x357a50[_0xaeb5('0x13')](request('Command',{'command':util['format'](_0xaeb5('0x14'),_0x165145[_0x240055])})[_0xaeb5('0x8')](function(_0x18f5c4){return _0x18f5c4&&_0x18f5c4['message']&&_0x18f5c4[_0xaeb5('0xa')][_0xaeb5('0x15')]('true')>=0x0?!![]:![];})[_0xaeb5('0xc')](function(_0x13a085){logger[_0xaeb5('0x9')](_0xaeb5('0x16'),_0x4078cd,_0x165145[_0x240055]);}));}BPromise[_0xaeb5('0x17')](_0x357a50)[_0xaeb5('0x8')](function(_0x522e53){var _0x1170a8=_['some'](_0x522e53);logger['info'](_0xaeb5('0x18'),_0x4078cd,_0x165145['join']('\x20|\x20'),_0x1170a8);_0x2bd060['when'](_0x1170a8);})[_0xaeb5('0xc')](function(_0x5eb4f5){console['log'](_0x5eb4f5);logger['error'](_0xaeb5('0x18'),_0x4078cd,_0x165145[_0xaeb5('0x19')](_0xaeb5('0x1a')),_0x5eb4f5[_0xaeb5('0x1b')]);_0x2bd060[_0xaeb5('0x11')]();});};}; \ No newline at end of file +var _0x34f5=['iftime\x20%s','indexOf','true','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format'];(function(_0x451f95,_0x565322){var _0x310906=function(_0x52b37d){while(--_0x52b37d){_0x451f95['push'](_0x451f95['shift']());}};_0x310906(++_0x565322);}(_0x34f5,0x122));var _0x534f=function(_0x361521,_0x4312d7){_0x361521=_0x361521-0x0;var _0x508e53=_0x34f5[_0x361521];return _0x508e53;};'use strict';var util=require(_0x534f('0x0'));var BPromise=require(_0x534f('0x1'));var jayson=require(_0x534f('0x2'));var _=require(_0x534f('0x3'));var logger=require(_0x534f('0x4'))(_0x534f('0x5'));var client=jayson['client'][_0x534f('0x6')]({'port':0x232a});function request(_0xa39cb4,_0x10e74d){return new BPromise(function(_0x9c117b,_0x1b3e05){return client[_0x534f('0x7')](_0xa39cb4,_0x10e74d)[_0x534f('0x8')](function(_0x2fec80){if(_0x2fec80['error']){return _0x1b3e05(_0x2fec80[_0x534f('0x9')][_0x534f('0xa')]);}else{return _0x9c117b(_0x2fec80[_0x534f('0xb')]);}})[_0x534f('0xc')](function(_0x1ce6f2){return _0x1b3e05(_0x1ce6f2);});});}exports['condition']=function(_0x2ec4c1,_0x18e4a6,_0x3e9273){return function(_0x557ecf){if(_0x3e9273[_0x534f('0xd')]&&!_0x3e9273[_0x534f('0xd')][_0x2ec4c1]){logger[_0x534f('0xe')](_0x534f('0xf'),_0x2ec4c1);return _0x557ecf[_0x534f('0x10')]();}var _0x2613bb=[];for(var _0x4d0168=0x0;_0x4d0168<_0x18e4a6[_0x534f('0x11')];_0x4d0168+=0x1){_0x2613bb['push'](request(_0x534f('0x12'),{'command':util[_0x534f('0x13')](_0x534f('0x14'),_0x18e4a6[_0x4d0168])})[_0x534f('0x8')](function(_0xbcb590){return _0xbcb590&&_0xbcb590[_0x534f('0xa')]&&_0xbcb590[_0x534f('0xa')][_0x534f('0x15')](_0x534f('0x16'))>=0x0?!![]:![];})[_0x534f('0xc')](function(_0x13a179){logger[_0x534f('0x9')]('[%s][INTERVAL]\x20%s',_0x2ec4c1,_0x18e4a6[_0x4d0168]);}));}BPromise[_0x534f('0x17')](_0x2613bb)['then'](function(_0x1cdafd){var _0x35c857=_[_0x534f('0x18')](_0x1cdafd);logger[_0x534f('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x2ec4c1,_0x18e4a6[_0x534f('0x19')](_0x534f('0x1a')),_0x35c857);_0x557ecf[_0x534f('0x1b')](_0x35c857);})['catch'](function(_0x512343){console[_0x534f('0x1c')](_0x512343);logger[_0x534f('0x9')](_0x534f('0x1d'),_0x2ec4c1,_0x18e4a6[_0x534f('0x19')](_0x534f('0x1a')),_0x512343[_0x534f('0x1e')]);_0x557ecf['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 60162e8..34d9c00 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 _0x9ffd=['interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agentcalledAt','[%s][agents][attendedtransfer]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x370088,_0x398682){_0x370088=_0x370088-0x0;var _0x19512b=_0x9ffd[_0x370088];return _0x19512b;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var utils=require(_0xd9ff('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5802a6,_0x3480c0){utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x5'),_0x5802a6['uniqueid'],_0x5802a6[_0xd9ff('0x6')],_0x5802a6[_0xd9ff('0x7')],_0x5802a6['membername'],_0x5802a6[_0xd9ff('0x8')],_0x5802a6[_0xd9ff('0x9')],_0x5802a6[_0xd9ff('0xa')],_0x5802a6[_0xd9ff('0xb')]));if(_0x5802a6[_0xd9ff('0x7')]){utils[_0xd9ff('0xc')](_0x5802a6[_0xd9ff('0x7')])[_0xd9ff('0xd')](function(_0x977487){if(_0x977487){_0x5802a6['type']=_0x977487['type'];_0x5802a6['agentacw']=_0x5802a6['agentcomplete']?_0x977487[_0xd9ff('0xe')]:![];_0x5802a6[_0xd9ff('0xf')]=_0x5802a6[_0xd9ff('0x10')]?_0x977487[_0xd9ff('0x11')]:0x0;}utils[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x5802a6);});}else{utils[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x5802a6);}if(_0x3480c0){delete transfers[_0x5802a6['uniqueid']];}else{delete agents[_0x5802a6['destuniqueid']];}}exports[_0xd9ff('0x14')]=function(_0x16a0d9){try{utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')](_0xd9ff('0x16'),_0x16a0d9['uniqueid']),_0x16a0d9);agents[_0x16a0d9[_0xd9ff('0x17')]]=_0x16a0d9;agents[_0x16a0d9[_0xd9ff('0x17')]]['agentcalledAt']=utils[_0xd9ff('0x18')]();agents[_0x16a0d9['destuniqueid']]['lastevent']='called';agents[_0x16a0d9['destuniqueid']][_0xd9ff('0xa')]=null;agents[_0x16a0d9['destuniqueid']][_0xd9ff('0x19')]=null;utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x1a'),_0x16a0d9[_0xd9ff('0x1b')],agents[_0x16a0d9[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x16a0d9[_0xd9ff('0x17')]));}catch(_0x182775){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x16'),_0x16a0d9[_0xd9ff('0x1b')]),_0x182775);}};exports['agentringnoanswer']=function(_0x4cf8ec){try{if(!_[_0xd9ff('0x1e')](agents[_0x4cf8ec[_0xd9ff('0x17')]])){utils['debug'](util['format']('[%s][agents][agentringnoanswer]',_0x4cf8ec['uniqueid']),_0x4cf8ec);utils[_0xd9ff('0x3')](util['format'](_0xd9ff('0x1f'),_0x4cf8ec[_0xd9ff('0x1b')],agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x4cf8ec[_0xd9ff('0x17')]));agents[_0x4cf8ec[_0xd9ff('0x17')]]['agentringnoanswer']=!![];agents[_0x4cf8ec['destuniqueid']][_0xd9ff('0x20')]=utils['now']();agents[_0x4cf8ec[_0xd9ff('0x17')]]['lastevent']=_0xd9ff('0x21');agents[_0x4cf8ec['destuniqueid']][_0xd9ff('0x22')]=_0xd9ff('0x21');agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x23')]=_0x4cf8ec['ringtime']?parseInt(_0x4cf8ec[_0xd9ff('0x24')])/0x3e8:0x0;agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x25')]=0x0;unanswered[_0xd9ff('0x26')](_0x4cf8ec['destuniqueid']);}}catch(_0x1d3684){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x27'),_0x4cf8ec[_0xd9ff('0x1b')]),_0x1d3684);}};exports[_0xd9ff('0x28')]=function(_0x420ffa){try{_[_0xd9ff('0x29')](agents,function(_0x3dc443,_0x5706cf){if(_0x3dc443[_0xd9ff('0x1b')]==_0x420ffa['uniqueid']&&!_[_0xd9ff('0x2a')](unanswered,_0x3dc443[_0xd9ff('0x17')])){utils[_0xd9ff('0x15')](util['format'](_0xd9ff('0x2b'),_0x420ffa[_0xd9ff('0x1b')]),_0x420ffa);utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x420ffa[_0xd9ff('0x1b')],_0x3dc443['membername'],_0x3dc443[_0xd9ff('0x17')]));_0x3dc443[_0xd9ff('0x2c')]=!![];_0x3dc443[_0xd9ff('0x20')]=utils[_0xd9ff('0x18')]();_0x3dc443[_0xd9ff('0xb')]=_0xd9ff('0x2d');_0x3dc443[_0xd9ff('0x22')]=_0xd9ff('0x2d');_0x3dc443[_0xd9ff('0x23')]=_0x420ffa[_0xd9ff('0x23')];_0x3dc443[_0xd9ff('0x25')]=0x0;writeDB(_0x3dc443);}});}catch(_0x34e9a9){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')]('[%s][agents][queuecallerabandon]',_0x420ffa[_0xd9ff('0x1b')]),_0x34e9a9);}};exports[_0xd9ff('0x2e')]=function(_0x2bde85){try{if(agents[_0x2bde85['destuniqueid']]){utils[_0xd9ff('0x15')](util['format'](_0xd9ff('0x2f'),_0x2bde85['uniqueid']),_0x2bde85);utils[_0xd9ff('0x3')](util['format'](_0xd9ff('0x30'),_0x2bde85[_0xd9ff('0x1b')],agents[_0x2bde85[_0xd9ff('0x17')]]['membername'],_0x2bde85['destuniqueid']));agents[_0x2bde85['destuniqueid']][_0xd9ff('0x31')]=utils[_0xd9ff('0x18')]();agents[_0x2bde85[_0xd9ff('0x17')]][_0xd9ff('0xa')]=_0x2bde85[_0xd9ff('0xa')];agents[_0x2bde85[_0xd9ff('0x17')]]['connectedlinename']=_0x2bde85['connectedlinename'];agents[_0x2bde85['destuniqueid']][_0xd9ff('0x23')]=_0x2bde85[_0xd9ff('0x24')];agents[_0x2bde85[_0xd9ff('0x17')]][_0xd9ff('0xb')]='connect';_[_0xd9ff('0x29')](agents,function(_0x5b8e17,_0x3cff52){if(_0x5b8e17[_0xd9ff('0x17')]!=_0x2bde85[_0xd9ff('0x17')]&&_0x5b8e17[_0xd9ff('0x1b')]==_0x2bde85['uniqueid']){_0x5b8e17[_0xd9ff('0x25')]=0x0;_0x5b8e17[_0xd9ff('0x23')]=_0x2bde85['ringtime'];_0x5b8e17[_0xd9ff('0x2c')]=!![];_0x5b8e17[_0xd9ff('0x20')]=utils[_0xd9ff('0x18')]();_0x5b8e17[_0xd9ff('0xb')]=_0xd9ff('0x32');_0x5b8e17[_0xd9ff('0x22')]='answered_elsewhere';_0x5b8e17[_0xd9ff('0x33')]=_0x2bde85[_0xd9ff('0x17')];_0x5b8e17[_0xd9ff('0x34')]=_0x2bde85[_0xd9ff('0x1c')];writeDB(_0x5b8e17);}});}}catch(_0x472724){utils['error'](util[_0xd9ff('0x4')](_0xd9ff('0x2f'),_0x2bde85[_0xd9ff('0x1b')]),_0x472724);}};exports['agentcomplete']=function(_0x5d06dd){try{if(!_[_0xd9ff('0x1e')](agents[_0x5d06dd[_0xd9ff('0x17')]])){utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')](_0xd9ff('0x35'),_0x5d06dd[_0xd9ff('0x1b')]),_0x5d06dd);utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x36'),_0x5d06dd['uniqueid'],agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x5d06dd[_0xd9ff('0x17')]));agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x37')]=!![];agents[_0x5d06dd['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x5d06dd[_0xd9ff('0x17')]]['talktime']=utils[_0xd9ff('0x38')](agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x39')],agents[_0x5d06dd['destuniqueid']][_0xd9ff('0x31')]);agents[_0x5d06dd[_0xd9ff('0x17')]]['reason']=_0x5d06dd[_0xd9ff('0x22')];agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0xb')]=_0xd9ff('0x3a');writeDB(agents[_0x5d06dd['destuniqueid']]);}}catch(_0x38b5b6){utils['error'](util[_0xd9ff('0x4')]('[%s][agents][agentcomplete]',_0x5d06dd[_0xd9ff('0x1b')]),_0x38b5b6);}};exports[_0xd9ff('0x3b')]=function(_0x2bf37a){try{if(!_[_0xd9ff('0x1e')](agents[_0x2bf37a[_0xd9ff('0x3c')]])){utils['debug'](util[_0xd9ff('0x4')](_0xd9ff('0x3d'),_0x2bf37a[_0xd9ff('0x1b')]),_0x2bf37a);utils[_0xd9ff('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x2bf37a['uniqueid'],agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x1c')],agents[_0x2bf37a[_0xd9ff('0x3c')]]['uniqueid']));agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x3e')]=!![];agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x3f')]=_0xd9ff('0x40');agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x41')]=_0x2bf37a[_0xd9ff('0x42')];agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x43')]=agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x1b')];}}catch(_0x2533d7){utils['error'](util[_0xd9ff('0x4')]('[%s][agents][blindtransfer]',_0x2bf37a[_0xd9ff('0x1b')]),_0x2533d7);}};exports['attendedtransfer']=function(_0x2953d7){try{utils['debug'](util[_0xd9ff('0x4')]('[%s][agents][attendedtransfer]',_0x2953d7[_0xd9ff('0x44')]),_0x2953d7);if(_0x2953d7['origtransfereruniqueid']==_0x2953d7[_0xd9ff('0x45')]){if(!_['isNil'](agents[_0x2953d7[_0xd9ff('0x46')]])){utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x47'),_0x2953d7[_0xd9ff('0x44')],agents[_0x2953d7[_0xd9ff('0x46')]]['membername']));agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x3e')]=!![];agents[_0x2953d7[_0xd9ff('0x46')]]['transfertype']=_0xd9ff('0x48');agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x41')]=_0x2953d7[_0xd9ff('0x49')];agents[_0x2953d7[_0xd9ff('0x46')]]['transferuniqueid']=_0x2953d7[_0xd9ff('0x44')];}if(_0x2953d7[_0xd9ff('0x4a')]&&agents[_0x2953d7[_0xd9ff('0x4a')]]){agents[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x4b')]=0x1;transfers[_0x2953d7[_0xd9ff('0x4a')]]=_[_0xd9ff('0x4c')](agents[_0x2953d7['transfereeuniqueid']]);transfers[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x9')]=agents[_0x2953d7['secondtransfereruniqueid']][_0xd9ff('0x9')];transfers[_0x2953d7[_0xd9ff('0x4a')]]['calleridname']=agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x4d')];transfers[_0x2953d7[_0xd9ff('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x2953d7[_0xd9ff('0x4a')]]['agentconnectAt']=utils[_0xd9ff('0x18')]();transfers[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x23')]=0x0;transfers[_0x2953d7[_0xd9ff('0x4a')]]['agententerreason']=0x2;}}else if(_0x2953d7['secondtransfereruniqueid']==_0x2953d7['secondtransfererlinkedid']){if(!_[_0xd9ff('0x1e')](agents[_0x2953d7[_0xd9ff('0x44')]])){utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x47'),_0x2953d7['origtransfereruniqueid'],agents[_0x2953d7[_0xd9ff('0x44')]]['membername']));agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x3e')]=!![];agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x3f')]=_0xd9ff('0x48');agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x41')]=_0x2953d7[_0xd9ff('0x4e')];agents[_0x2953d7['origtransfereruniqueid']][_0xd9ff('0x43')]=_0x2953d7[_0xd9ff('0x46')];}if(_0x2953d7['transfertargetuniqueid']&&agents[_0x2953d7['transfertargetuniqueid']]){agents[_0x2953d7[_0xd9ff('0x4f')]]['agententerreason']=0x1;transfers[_0x2953d7[_0xd9ff('0x4f')]]=_[_0xd9ff('0x4c')](agents[_0x2953d7['transfertargetuniqueid']]);transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x9')]=agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x9')];transfers[_0x2953d7[_0xd9ff('0x4f')]]['calleridname']=agents[_0x2953d7[_0xd9ff('0x44')]]['calleridname'];transfers[_0x2953d7['transfertargetuniqueid']][_0xd9ff('0x50')]=utils[_0xd9ff('0x18')]();transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x31')]=utils['now']();transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x23')]=0x0;transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x4b')]=0x2;}}}catch(_0x1bb042){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x51'),_0x2953d7['origtransfereruniqueid']),_0x1bb042);}};exports['hangup']=function(_0x5e04d3){try{utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')]('[%s][agents][hangup]',_0x5e04d3[_0xd9ff('0x1b')]),_0x5e04d3);if(agents[_0x5e04d3[_0xd9ff('0x1b')]]&&agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]===_0xd9ff('0x21')){if(_0x5e04d3[_0xd9ff('0x52')]==='21'){agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]='rejected';agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]=_0xd9ff('0x53');}utils['info'](util[_0xd9ff('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5e04d3[_0xd9ff('0x1b')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],agents[_0x5e04d3['uniqueid']][_0xd9ff('0x22')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]));writeDB(agents[_0x5e04d3[_0xd9ff('0x1b')]]);var _0x56a74c=unanswered[_0xd9ff('0x54')](_0x5e04d3[_0xd9ff('0x1b')]);if(_0x56a74c>-0x1){unanswered[_0xd9ff('0x55')](_0x56a74c,0x1);}}if(transfers[_0x5e04d3['uniqueid']]){transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x37')]=!![];transfers[_0x5e04d3[_0xd9ff('0x1b')]]['agentcompleteAt']=utils[_0xd9ff('0x18')]();transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x25')]=utils[_0xd9ff('0x38')](transfers[_0x5e04d3[_0xd9ff('0x1b')]]['agentcompleteAt'],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x31')]);transfers[_0x5e04d3['uniqueid']][_0xd9ff('0x22')]=_0xd9ff('0x56');transfers[_0x5e04d3[_0xd9ff('0x1b')]]['lastevent']=_0xd9ff('0x3a');utils['info'](util[_0xd9ff('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5e04d3[_0xd9ff('0x1b')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]));writeDB(transfers[_0x5e04d3[_0xd9ff('0x1b')]],!![]);}if(agents[_0x5e04d3[_0xd9ff('0x1b')]]&&agents[_0x5e04d3[_0xd9ff('0x1b')]]['agentconnectAt']){agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x37')]=!![];agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x39')]=utils[_0xd9ff('0x18')]();agents[_0x5e04d3[_0xd9ff('0x1b')]]['talktime']=utils['diffTime'](agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x39')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x31')]);agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]=agents[_0x5e04d3['uniqueid']][_0xd9ff('0x3e')]?_0xd9ff('0x3e'):_0xd9ff('0x56');agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]=_0xd9ff('0x3a');utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x57'),_0x5e04d3[_0xd9ff('0x1b')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')],agents[_0x5e04d3[_0xd9ff('0x1b')]]['lastevent']));writeDB(agents[_0x5e04d3[_0xd9ff('0x1b')]]);}}catch(_0x4c2ad5){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x58'),_0x5e04d3[_0xd9ff('0x1b')]),_0x4c2ad5);}}; \ No newline at end of file +var _0xf109=['transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','now','called','info','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer'];(function(_0xb22d18,_0x16ac56){var _0x4cf9a1=function(_0x4fc67b){while(--_0x4fc67b){_0xb22d18['push'](_0xb22d18['shift']());}};_0x4cf9a1(++_0x16ac56);}(_0xf109,0xce));var _0x9f10=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf109[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var utils=require(_0x9f10('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5d2950,_0x5b381d){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4'),_0x5d2950[_0x9f10('0x5')],_0x5d2950[_0x9f10('0x6')],_0x5d2950[_0x9f10('0x7')],_0x5d2950[_0x9f10('0x8')],_0x5d2950[_0x9f10('0x9')],_0x5d2950[_0x9f10('0xa')],_0x5d2950[_0x9f10('0xb')],_0x5d2950[_0x9f10('0xc')]));if(_0x5d2950[_0x9f10('0x7')]){utils['getVoiceQueueByName'](_0x5d2950[_0x9f10('0x7')])[_0x9f10('0xd')](function(_0x1a0668){if(_0x1a0668){_0x5d2950[_0x9f10('0xe')]=_0x1a0668[_0x9f10('0xe')];_0x5d2950['agentacw']=_0x5d2950[_0x9f10('0xf')]?_0x1a0668[_0x9f10('0x10')]:![];_0x5d2950[_0x9f10('0x11')]=_0x5d2950['agentacw']?_0x1a0668['acwTimeout']:0x0;}utils[_0x9f10('0x12')](_0x9f10('0x13'),_0x5d2950);});}else{utils[_0x9f10('0x12')]('CreateVoiceAgentReport',_0x5d2950);}if(_0x5b381d){delete transfers[_0x5d2950[_0x9f10('0x5')]];}else{delete agents[_0x5d2950[_0x9f10('0x14')]];}}exports[_0x9f10('0x15')]=function(_0x58067f){try{utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]',_0x58067f[_0x9f10('0x5')]),_0x58067f);agents[_0x58067f[_0x9f10('0x14')]]=_0x58067f;agents[_0x58067f['destuniqueid']]['agentcalledAt']=utils[_0x9f10('0x17')]();agents[_0x58067f[_0x9f10('0x14')]]['lastevent']=_0x9f10('0x18');agents[_0x58067f['destuniqueid']][_0x9f10('0xb')]=null;agents[_0x58067f[_0x9f10('0x14')]]['connectedlinename']=null;utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x58067f[_0x9f10('0x5')],agents[_0x58067f['destuniqueid']][_0x9f10('0x8')],_0x58067f['destuniqueid']));}catch(_0x2c5064){utils['error'](util['format'](_0x9f10('0x1a'),_0x58067f[_0x9f10('0x5')]),_0x2c5064);}};exports[_0x9f10('0x1b')]=function(_0x3a78be){try{if(!_[_0x9f10('0x1c')](agents[_0x3a78be[_0x9f10('0x14')]])){utils[_0x9f10('0x16')](util['format'](_0x9f10('0x1d'),_0x3a78be['uniqueid']),_0x3a78be);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x1e'),_0x3a78be['uniqueid'],agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x8')],_0x3a78be[_0x9f10('0x14')]));agents[_0x3a78be['destuniqueid']][_0x9f10('0x1b')]=!![];agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x1f')]=utils['now']();agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x20');agents[_0x3a78be[_0x9f10('0x14')]]['reason']='timeout';agents[_0x3a78be['destuniqueid']][_0x9f10('0x21')]=_0x3a78be['ringtime']?parseInt(_0x3a78be[_0x9f10('0x22')])/0x3e8:0x0;agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x23')]=0x0;unanswered[_0x9f10('0x24')](_0x3a78be[_0x9f10('0x14')]);}}catch(_0x4f6b0c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x1d'),_0x3a78be[_0x9f10('0x5')]),_0x4f6b0c);}};exports[_0x9f10('0x26')]=function(_0x2c4373){try{_['forIn'](agents,function(_0x358d3f,_0x501ee){if(_0x358d3f[_0x9f10('0x5')]==_0x2c4373[_0x9f10('0x5')]&&!_['includes'](unanswered,_0x358d3f[_0x9f10('0x14')])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x2c4373);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x27'),_0x2c4373[_0x9f10('0x5')],_0x358d3f['membername'],_0x358d3f[_0x9f10('0x14')]));_0x358d3f[_0x9f10('0x1b')]=!![];_0x358d3f[_0x9f10('0x1f')]=utils[_0x9f10('0x17')]();_0x358d3f[_0x9f10('0xc')]='abandoned';_0x358d3f[_0x9f10('0x28')]='abandoned';_0x358d3f[_0x9f10('0x21')]=_0x2c4373[_0x9f10('0x21')];_0x358d3f[_0x9f10('0x23')]=0x0;writeDB(_0x358d3f);}});}catch(_0x11ee9c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x11ee9c);}};exports[_0x9f10('0x29')]=function(_0x1b8018){try{if(agents[_0x1b8018['destuniqueid']]){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentconnect]',_0x1b8018[_0x9f10('0x5')]),_0x1b8018);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x2a'),_0x1b8018[_0x9f10('0x5')],agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x8')],_0x1b8018[_0x9f10('0x14')]));agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x2b')]=utils['now']();agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0xb')]=_0x1b8018[_0x9f10('0xb')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x2c')]=_0x1b8018[_0x9f10('0x2c')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];agents[_0x1b8018[_0x9f10('0x14')]]['lastevent']='connect';_[_0x9f10('0x2d')](agents,function(_0x2ff98d,_0x1deed4){if(_0x2ff98d[_0x9f10('0x14')]!=_0x1b8018[_0x9f10('0x14')]&&_0x2ff98d[_0x9f10('0x5')]==_0x1b8018[_0x9f10('0x5')]){_0x2ff98d[_0x9f10('0x23')]=0x0;_0x2ff98d[_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];_0x2ff98d[_0x9f10('0x1b')]=!![];_0x2ff98d[_0x9f10('0x1f')]=utils['now']();_0x2ff98d['lastevent']='answered_elsewhere';_0x2ff98d[_0x9f10('0x28')]='answered_elsewhere';_0x2ff98d[_0x9f10('0x2e')]=_0x1b8018[_0x9f10('0x14')];_0x2ff98d[_0x9f10('0x2f')]=_0x1b8018['membername'];writeDB(_0x2ff98d);}});}}catch(_0x3cfce6){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x5')]),_0x3cfce6);}};exports['agentcomplete']=function(_0x578368){try{if(!_['isNil'](agents[_0x578368[_0x9f10('0x14')]])){utils['debug'](util[_0x9f10('0x3')]('[%s][agents][agentcomplete]',_0x578368[_0x9f10('0x5')]),_0x578368);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x31'),_0x578368['uniqueid'],agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x8')],_0x578368['destuniqueid']));agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xf')]=!![];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x23')]=utils[_0x9f10('0x33')](agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')],agents[_0x578368['destuniqueid']][_0x9f10('0x2b')]);agents[_0x578368[_0x9f10('0x14')]]['reason']=_0x578368[_0x9f10('0x28')];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x34');writeDB(agents[_0x578368['destuniqueid']]);}}catch(_0x283f04){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x35'),_0x578368[_0x9f10('0x5')]),_0x283f04);}};exports[_0x9f10('0x36')]=function(_0x479b46){try{if(!_[_0x9f10('0x1c')](agents[_0x479b46[_0x9f10('0x37')]])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46[_0x9f10('0x5')]),_0x479b46);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x39'),_0x479b46[_0x9f10('0x5')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x8')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x5')]));agents[_0x479b46[_0x9f10('0x37')]]['transfer']=!![];agents[_0x479b46[_0x9f10('0x37')]]['transfertype']=_0x9f10('0x3a');agents[_0x479b46['transfereruniqueid']][_0x9f10('0x3b')]=_0x479b46[_0x9f10('0x3c')];agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x3d')]=agents[_0x479b46[_0x9f10('0x37')]]['uniqueid'];}}catch(_0x12cf34){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46['uniqueid']),_0x12cf34);}};exports['attendedtransfer']=function(_0x265f69){try{utils[_0x9f10('0x16')](util['format']('[%s][agents][attendedtransfer]',_0x265f69[_0x9f10('0x3e')]),_0x265f69);if(_0x265f69[_0x9f10('0x3e')]==_0x265f69[_0x9f10('0x3f')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x40')]])){utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x8')]));agents[_0x265f69['secondtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x40')]]['transfertype']=_0x9f10('0x42');agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x43')];agents[_0x265f69[_0x9f10('0x40')]]['transferuniqueid']=_0x265f69[_0x9f10('0x3e')];}if(_0x265f69['transfereeuniqueid']&&agents[_0x265f69['transfereeuniqueid']]){agents[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x44')]]=_[_0x9f10('0x46')](agents[_0x265f69[_0x9f10('0x44')]]);transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0xa')]=agents[_0x265f69['secondtransfereruniqueid']]['calleridnum'];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x47')]=agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x48')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x21')]=0x0;transfers[_0x265f69[_0x9f10('0x44')]]['agententerreason']=0x2;}}else if(_0x265f69[_0x9f10('0x40')]==_0x265f69[_0x9f10('0x49')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x3e')]])){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4a'),_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x8')]));agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x4b')]='ATTENDED';agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x4c')];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x3d')]=_0x265f69[_0x9f10('0x40')];}if(_0x265f69[_0x9f10('0x4d')]&&agents[_0x265f69[_0x9f10('0x4d')]]){agents[_0x265f69['transfertargetuniqueid']][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x4d')]]=_['clone'](agents[_0x265f69[_0x9f10('0x4d')]]);transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0xa')]=agents[_0x265f69[_0x9f10('0x3e')]]['calleridnum'];transfers[_0x265f69[_0x9f10('0x4d')]]['calleridname']=agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x4d')]]['agentcalledAt']=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69[_0x9f10('0x4d')]]['holdtime']=0x0;transfers[_0x265f69[_0x9f10('0x4d')]]['agententerreason']=0x2;}}}catch(_0x5708c1){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x4e'),_0x265f69['origtransfereruniqueid']),_0x5708c1);}};exports[_0x9f10('0x4f')]=function(_0x5a64ae){try{utils['debug'](util[_0x9f10('0x3')]('[%s][agents][hangup]',_0x5a64ae['uniqueid']),_0x5a64ae);if(agents[_0x5a64ae[_0x9f10('0x5')]]&&agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]===_0x9f10('0x20')){if(_0x5a64ae[_0x9f10('0x50')]==='21'){agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]=_0x9f10('0x51');agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]='rejected';}utils['info'](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);var _0x27f337=unanswered[_0x9f10('0x53')](_0x5a64ae[_0x9f10('0x5')]);if(_0x27f337>-0x1){unanswered[_0x9f10('0x54')](_0x27f337,0x1);}}if(transfers[_0x5a64ae[_0x9f10('0x5')]]){transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xf')]=!![];transfers[_0x5a64ae['uniqueid']][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x23')]=utils['diffTime'](transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]);transfers[_0x5a64ae['uniqueid']]['reason']=_0x9f10('0x55');transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]=_0x9f10('0x34');utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(transfers[_0x5a64ae[_0x9f10('0x5')]],!![]);}if(agents[_0x5a64ae['uniqueid']]&&agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]){agents[_0x5a64ae['uniqueid']][_0x9f10('0xf')]=!![];agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x5a64ae['uniqueid']][_0x9f10('0x23')]=utils['diffTime'](agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],agents[_0x5a64ae[_0x9f10('0x5')]]['agentconnectAt']);agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')]=agents[_0x5a64ae[_0x9f10('0x5')]]['transfer']?_0x9f10('0x41'):_0x9f10('0x55');agents[_0x5a64ae[_0x9f10('0x5')]]['lastevent']='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a64ae['uniqueid'],agents[_0x5a64ae['uniqueid']][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]]['reason'],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);}}catch(_0x3b3dd8){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x56'),_0x5a64ae[_0x9f10('0x5')]),_0x3b3dd8);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 84d1230..daeb953 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 _0xc051=['calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','endtime','billableseconds','diffTime','answertime','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','localtwolinkedid','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','xmd-originatecalleridnum','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmcs-queue','xmd-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','includes','execif','lastdata','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface'];(function(_0x39d89b,_0x413243){var _0x477b21=function(_0x5ea8bf){while(--_0x5ea8bf){_0x39d89b['push'](_0x39d89b['shift']());}};_0x477b21(++_0x413243);}(_0xc051,0xb5));var _0x1c05=function(_0x436017,_0x47c412){_0x436017=_0x436017-0x0;var _0x50ed01=_0xc051[_0x436017];return _0x50ed01;};'use strict';var _=require(_0x1c05('0x0'));var util=require(_0x1c05('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0x1c05('0x2'),_0x1c05('0x3'),_0x1c05('0x3'),_0x1c05('0x2'),'NO\x20ANSWER',_0x1c05('0x2'),_0x1c05('0x4'),_0x1c05('0x5'),_0x1c05('0x3'),_0x1c05('0x3'),_0x1c05('0x3')];var channels={};function writeDB(_0x3a9ba8){var _0x44d233;if(transfers[_0x1c05('0x6')][_0x3a9ba8['uniqueid']]){_0x44d233=_0x3a9ba8[_0x1c05('0x7')];_0x3a9ba8[_0x1c05('0x7')]=transfers[_0x1c05('0x6')][_0x3a9ba8[_0x1c05('0x7')]]['transfereeuniqueid'];}utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0xa'),_0x3a9ba8[_0x1c05('0x7')],_0x3a9ba8['channel'],_0x3a9ba8[_0x1c05('0xb')],_0x3a9ba8['membername'],_0x3a9ba8[_0x1c05('0xc')],_0x3a9ba8[_0x1c05('0xd')],_0x3a9ba8[_0x1c05('0xe')],_0x3a9ba8[_0x1c05('0xf')]));if(_0x3a9ba8[_0x1c05('0x10')]){utils[_0x1c05('0x11')](_0x3a9ba8[_0x1c05('0x10')])[_0x1c05('0x12')](function(_0x4de1c8){if(_0x4de1c8){_0x3a9ba8[_0x1c05('0x13')]=_0x4de1c8['id'];}utils[_0x1c05('0x14')](_0x1c05('0x15'),_0x3a9ba8);});}else{utils['request'](_0x1c05('0x15'),_0x3a9ba8);}if(channels[_0x3a9ba8[_0x1c05('0x7')]]){delete channels[_0x3a9ba8[_0x1c05('0x7')]];}else if(_0x44d233&&channels[_0x44d233]){if(!transfers['blinds'][_0x44d233][_0x1c05('0x16')])delete transfers['blinds'][_0x44d233];delete channels[_0x44d233];}}exports[_0x1c05('0x17')]=function(_0x439aa5){try{utils[_0x1c05('0x18')](util[_0x1c05('0x9')](_0x1c05('0x19'),_0x439aa5['uniqueid']),_0x439aa5);if(_0x439aa5[_0x1c05('0x7')]==_0x439aa5[_0x1c05('0x1a')]&&_0x439aa5[_0x1c05('0x1b')]!='OutgoingSpoolFailed'){utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0x1c'),_0x439aa5['uniqueid'],_0x439aa5[_0x1c05('0x1d')],_0x439aa5[_0x1c05('0x1e')]));channels[_0x439aa5['uniqueid']]={'uniqueid':_0x439aa5['uniqueid'],'accountcode':_0x439aa5[_0x1c05('0x10')],'source':_0x439aa5['calleridnum'],'destination':_0x439aa5['exten'],'destinationcontext':_0x439aa5['context'],'channel':_0x439aa5[_0x1c05('0x1b')],'starttime':utils[_0x1c05('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x1c05('0x20')};}}catch(_0x357401){utils[_0x1c05('0x21')](util[_0x1c05('0x9')]('[%s][calls][newchannel]',_0x439aa5[_0x1c05('0x7')]),_0x357401);}};exports[_0x1c05('0x22')]=function(_0x3ed2bc){try{utils[_0x1c05('0x18')](util[_0x1c05('0x9')](_0x1c05('0x23'),_0x3ed2bc['uniqueid']),_0x3ed2bc);if(!_[_0x1c05('0x24')](channels[_0x3ed2bc[_0x1c05('0x7')]])&&_0x3ed2bc[_0x1c05('0x25')]==0x6){utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0x26'),_0x3ed2bc[_0x1c05('0x7')],_0x3ed2bc['context'],_0x3ed2bc[_0x1c05('0x1b')]));if(_[_0x1c05('0x24')](channels[_0x3ed2bc[_0x1c05('0x7')]]['systemanswertime'])){channels[_0x3ed2bc['uniqueid']][_0x1c05('0x27')]=utils[_0x1c05('0x1f')]();}}else if(!_[_0x1c05('0x24')](channels[_0x3ed2bc[_0x1c05('0x1a')]])&&_0x3ed2bc[_0x1c05('0x25')]==0x6&&_0x3ed2bc[_0x1c05('0x1d')]!=_0x1c05('0x28')){utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0x29'),_0x3ed2bc[_0x1c05('0x7')],_0x3ed2bc[_0x1c05('0x1a')],_0x3ed2bc[_0x1c05('0x1d')],_0x3ed2bc[_0x1c05('0x1b')]));channels[_0x3ed2bc['linkedid']][_0x1c05('0x10')]=_0x3ed2bc['accountcode'];channels[_0x3ed2bc['linkedid']][_0x1c05('0x2a')]=_0x3ed2bc[_0x1c05('0x1b')];if(_[_0x1c05('0x24')](channels[_0x3ed2bc[_0x1c05('0x1a')]]['answertime'])){channels[_0x3ed2bc[_0x1c05('0x1a')]]['answertime']=utils[_0x1c05('0x1f')]();}channels[_0x3ed2bc['linkedid']][_0x1c05('0x2b')]=dispositions[_[_0x1c05('0x2c')](_0x3ed2bc[_0x1c05('0x25')])]||_0x1c05('0x4');}}catch(_0x230f48){utils[_0x1c05('0x21')](util[_0x1c05('0x9')](_0x1c05('0x23'),_0x3ed2bc[_0x1c05('0x7')]),_0x230f48);}};exports[_0x1c05('0x2d')]=function(_0x2f6c3a){try{if(!_[_0x1c05('0x24')](channels[_0x2f6c3a[_0x1c05('0x7')]])){utils[_0x1c05('0x18')](util[_0x1c05('0x9')](_0x1c05('0x2e'),_0x2f6c3a[_0x1c05('0x7')]),_0x2f6c3a);if(_[_0x1c05('0x24')](channels[_0x2f6c3a['uniqueid']][_0x1c05('0x2f')])){channels[_0x2f6c3a[_0x1c05('0x7')]]['callerid']=_0x2f6c3a['calleridname']+'\x20<'+_0x2f6c3a[_0x1c05('0xd')]+'>';}utils[_0x1c05('0x8')](util[_0x1c05('0x9')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2f6c3a[_0x1c05('0x7')],channels[_0x2f6c3a[_0x1c05('0x7')]][_0x1c05('0x2f')],_0x2f6c3a['cause-txt']));channels[_0x2f6c3a[_0x1c05('0x7')]][_0x1c05('0x30')]=utils[_0x1c05('0x1f')]();channels[_0x2f6c3a['uniqueid']]['duration']=utils['diffTime'](channels[_0x2f6c3a['uniqueid']][_0x1c05('0x30')],channels[_0x2f6c3a['uniqueid']]['starttime']);channels[_0x2f6c3a[_0x1c05('0x7')]][_0x1c05('0x31')]=channels[_0x2f6c3a[_0x1c05('0x7')]]['answertime']?utils[_0x1c05('0x32')](channels[_0x2f6c3a[_0x1c05('0x7')]][_0x1c05('0x30')],channels[_0x2f6c3a[_0x1c05('0x7')]][_0x1c05('0x33')]):0x0;writeDB(channels[_0x2f6c3a[_0x1c05('0x7')]]);}}catch(_0x1cc1eb){utils[_0x1c05('0x21')](util['format'](_0x1c05('0x2e'),_0x2f6c3a[_0x1c05('0x7')]),_0x1cc1eb);}};exports['attendedtransfer']=function(_0x4b6ae4){try{if(!_[_0x1c05('0x24')](channels[_0x4b6ae4['localtwolinkedid']])){utils[_0x1c05('0x18')](util[_0x1c05('0x9')](_0x1c05('0x34'),_0x4b6ae4[_0x1c05('0x35')]),_0x4b6ae4);if(channels[_0x4b6ae4['localtwolinkedid']][_0x1c05('0x1b')]==_0x4b6ae4['transfereechannel']){utils['info'](util[_0x1c05('0x9')](_0x1c05('0x36'),_0x4b6ae4[_0x1c05('0x35')],_0x4b6ae4['localtwolinkedid'],_0x4b6ae4[_0x1c05('0x37')]));channels[_0x4b6ae4['localtwolinkedid']][_0x1c05('0x2a')]=_0x4b6ae4['secondtransfererchannel'];channels[_0x4b6ae4[_0x1c05('0x38')]][_0x1c05('0x39')]='_attended';}else if(channels[_0x4b6ae4[_0x1c05('0x38')]][_0x1c05('0x1b')]=_0x4b6ae4[_0x1c05('0x3a')]){utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0x36'),_0x4b6ae4[_0x1c05('0x35')],_0x4b6ae4[_0x1c05('0x38')],_0x4b6ae4[_0x1c05('0x3b')]));channels[_0x4b6ae4['localtwolinkedid']][_0x1c05('0x2a')]=_0x4b6ae4[_0x1c05('0x3b')];channels[_0x4b6ae4[_0x1c05('0x38')]]['userfield']=_0x1c05('0x3c');}}}catch(_0x20efb2){utils[_0x1c05('0x21')](util[_0x1c05('0x9')](_0x1c05('0x34'),_0x4b6ae4[_0x1c05('0x35')]),_0x20efb2);}};exports[_0x1c05('0x3d')]=function(_0x7df08e){try{if(!_[_0x1c05('0x24')](channels[_0x7df08e[_0x1c05('0x7')]])){utils[_0x1c05('0x18')](util['format'](_0x1c05('0x3e'),_0x7df08e['uniqueid']),_0x7df08e);channels[_0x7df08e[_0x1c05('0x7')]][_0x1c05('0x3f')]=utils[_0x1c05('0x1f')]();utils['info'](util[_0x1c05('0x9')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x7df08e[_0x1c05('0x7')],channels[_0x7df08e[_0x1c05('0x7')]][_0x1c05('0x3f')]));}}catch(_0x8bf796){utils[_0x1c05('0x21')](util[_0x1c05('0x9')](_0x1c05('0x3e'),_0x7df08e[_0x1c05('0x7')]),_0x8bf796);}};exports[_0x1c05('0x40')]=function(_0x518c5c){try{if(!_[_0x1c05('0x24')](channels[_0x518c5c[_0x1c05('0x7')]])){utils[_0x1c05('0x18')](util[_0x1c05('0x9')](_0x1c05('0x41'),_0x518c5c[_0x1c05('0x7')]),_0x518c5c);if(!_[_0x1c05('0x24')](channels[_0x518c5c[_0x1c05('0x7')]][_0x1c05('0x3f')])){channels[_0x518c5c[_0x1c05('0x7')]][_0x1c05('0x42')]+=utils[_0x1c05('0x32')](utils[_0x1c05('0x1f')](),channels[_0x518c5c[_0x1c05('0x7')]][_0x1c05('0x3f')]);utils[_0x1c05('0x8')](util[_0x1c05('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x518c5c[_0x1c05('0x7')],channels[_0x518c5c['uniqueid']][_0x1c05('0x42')]));delete channels[_0x518c5c[_0x1c05('0x7')]]['musiconholdstartAt'];}}}catch(_0x4077d9){utils[_0x1c05('0x21')](util[_0x1c05('0x9')](_0x1c05('0x41'),_0x518c5c[_0x1c05('0x7')]),_0x4077d9);}};exports['varset']=function(_0x45b9ff){try{if(!_['isNil'](channels[_0x45b9ff[_0x1c05('0x7')]])){utils['debug'](util[_0x1c05('0x9')]('[%s][calls][varset]',_0x45b9ff[_0x1c05('0x7')]),_0x45b9ff);if(!_[_0x1c05('0x24')](_0x45b9ff['variable'][_0x1c05('0x43')])){utils[_0x1c05('0x8')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x45b9ff[_0x1c05('0x7')],_0x45b9ff[_0x1c05('0x44')]));channels[_0x45b9ff[_0x1c05('0x7')]]['source']=_0x45b9ff[_0x1c05('0x44')];}if(!_['isNil'](_0x45b9ff[_0x1c05('0x45')][_0x1c05('0x46')])){utils[_0x1c05('0x8')](util['format'](_0x1c05('0x47'),_0x45b9ff[_0x1c05('0x7')],_0x45b9ff[_0x1c05('0x44')]));channels[_0x45b9ff['uniqueid']][_0x1c05('0x48')]=_0x45b9ff['value'];channels[_0x45b9ff[_0x1c05('0x7')]][_0x1c05('0x2f')]='\x22'+_0x45b9ff['value']+'\x22\x20<'+_0x45b9ff[_0x1c05('0x44')]+'>';}if(!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')][_0x1c05('0x49')])||!_[_0x1c05('0x24')](_0x45b9ff['variable'][_0x1c05('0x4a')])){utils[_0x1c05('0x8')](util[_0x1c05('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x45b9ff['uniqueid'],!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')]['xmd-callerid-preview'])?_0x1c05('0x49'):'xmd-callerid',_0x45b9ff[_0x1c05('0x44')]));channels[_0x45b9ff[_0x1c05('0x7')]][_0x1c05('0x2f')]=_0x45b9ff[_0x1c05('0x44')];}if(!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')]['xmd-queue'])||!_['isNil'](_0x45b9ff[_0x1c05('0x45')][_0x1c05('0x4b')])){utils['info'](util[_0x1c05('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x45b9ff['uniqueid'],!_[_0x1c05('0x24')](_0x45b9ff['variable'][_0x1c05('0x4c')])?_0x1c05('0x4c'):'xmcs-queue',_0x45b9ff[_0x1c05('0x44')]));channels[_0x45b9ff[_0x1c05('0x7')]][_0x1c05('0x4d')]=_0x1c05('0x4e');channels[_0x45b9ff['uniqueid']]['lastdata']=_0x45b9ff['value'];channels[_0x45b9ff[_0x1c05('0x7')]]['queue']=!![];}if(!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')][_0x1c05('0x4f')])){utils[_0x1c05('0x8')](util[_0x1c05('0x9')](_0x1c05('0x50'),_0x45b9ff[_0x1c05('0x7')],_0x45b9ff['value']));channels[_0x45b9ff[_0x1c05('0x7')]]['ContactId']=_0x45b9ff[_0x1c05('0x44')];}if(!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')]['xmd-cdrtype'])){utils[_0x1c05('0x8')](util[_0x1c05('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x45b9ff[_0x1c05('0x7')],_0x45b9ff[_0x1c05('0x44')]));channels[_0x45b9ff[_0x1c05('0x7')]][_0x1c05('0x51')]=_0x45b9ff['value'];}if(!_[_0x1c05('0x24')](_0x45b9ff['variable'][_0x1c05('0x52')])){utils['info'](util[_0x1c05('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x45b9ff[_0x1c05('0x7')],_0x45b9ff['value']));channels[_0x45b9ff['uniqueid']][_0x1c05('0x53')]=_0x45b9ff['value'];}if(!_[_0x1c05('0x24')](_0x45b9ff[_0x1c05('0x45')][_0x1c05('0x54')])){utils['info'](util[_0x1c05('0x9')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x45b9ff['uniqueid'],_0x45b9ff['value']));channels[_0x45b9ff['uniqueid']]['sipcallid']=_0x45b9ff[_0x1c05('0x44')];}}}catch(_0x347540){utils[_0x1c05('0x21')](util['format'](_0x1c05('0x55'),_0x45b9ff[_0x1c05('0x7')]),_0x347540);}};exports['newexten']=function(_0x3d5582){try{if(!_['isNil'](channels[_0x3d5582['uniqueid']])){utils[_0x1c05('0x18')](util[_0x1c05('0x9')]('[%s][calls][newexten]',_0x3d5582[_0x1c05('0x7')]),_0x3d5582);utils[_0x1c05('0x8')](util[_0x1c05('0x9')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3d5582[_0x1c05('0x7')],_0x3d5582[_0x1c05('0x56')],_0x3d5582[_0x1c05('0x57')]));if(_0x3d5582[_0x1c05('0x56')][_0x1c05('0x58')]()==_0x1c05('0x59')&&_[_0x1c05('0x5a')](_0x3d5582[_0x1c05('0x57')][_0x1c05('0x58')](),_0x1c05('0x5b'))){var _0x1fd224=_0x3d5582[_0x1c05('0x57')]['split']('=');var _0x4e8185=_0x1fd224[0x0]['substring'](_0x1fd224[0x0][_0x1c05('0x5c')]('(')+0x1,_0x1fd224[0x0][_0x1c05('0x5c')](')'));var _0x2675c5=_0x1fd224[0x1];channels[_0x3d5582['uniqueid']][_0x4e8185]=_0x2675c5;}if(!_[_0x1c05('0x5d')]([_0x1c05('0x2d'),'noop',_0x1c05('0x5e'),_0x1c05('0x59'),'gotoif'],_0x3d5582['application']['toLowerCase']())){channels[_0x3d5582[_0x1c05('0x7')]][_0x1c05('0x4d')]=_0x3d5582[_0x1c05('0x56')];channels[_0x3d5582[_0x1c05('0x7')]][_0x1c05('0x5f')]=_0x3d5582[_0x1c05('0x57')];}}}catch(_0x6397dd){utils[_0x1c05('0x21')](util['format'](_0x1c05('0x60'),_0x3d5582[_0x1c05('0x7')]),_0x6397dd);}}; \ No newline at end of file +var _0x0023=['origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','linkedid','OutgoingSpoolFailed','exten','calleridnum','context','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','billableseconds','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]'];(function(_0x5cdb77,_0x55d284){var _0x2a05a6=function(_0xe5f717){while(--_0xe5f717){_0x5cdb77['push'](_0x5cdb77['shift']());}};_0x2a05a6(++_0x55d284);}(_0x0023,0x10a));var _0x3002=function(_0x59809d,_0x321327){_0x59809d=_0x59809d-0x0;var _0x5922c9=_0x0023[_0x59809d];return _0x5922c9;};'use strict';var _=require(_0x3002('0x0'));var util=require('util');var utils=require(_0x3002('0x1'));var transfers=require(_0x3002('0x2'));var dispositions=[_0x3002('0x3'),_0x3002('0x4'),'FAILED',_0x3002('0x3'),_0x3002('0x3'),'NO\x20ANSWER',_0x3002('0x5'),'BUSY',_0x3002('0x4'),_0x3002('0x4'),_0x3002('0x4')];var channels={};function writeDB(_0x77f084){var _0x1f7523;if(transfers[_0x3002('0x6')][_0x77f084['uniqueid']]){_0x1f7523=_0x77f084[_0x3002('0x7')];_0x77f084['uniqueid']=transfers[_0x3002('0x6')][_0x77f084[_0x3002('0x7')]][_0x3002('0x8')];}utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0xb'),_0x77f084['uniqueid'],_0x77f084[_0x3002('0xc')],_0x77f084[_0x3002('0xd')],_0x77f084[_0x3002('0xe')],_0x77f084[_0x3002('0xf')],_0x77f084['calleridnum'],_0x77f084[_0x3002('0x10')],_0x77f084[_0x3002('0x11')]));if(_0x77f084[_0x3002('0x12')]){utils[_0x3002('0x13')](_0x77f084[_0x3002('0x12')])[_0x3002('0x14')](function(_0x2148b6){if(_0x2148b6){_0x77f084[_0x3002('0x15')]=_0x2148b6['id'];}utils[_0x3002('0x16')](_0x3002('0x17'),_0x77f084);});}else{utils[_0x3002('0x16')](_0x3002('0x17'),_0x77f084);}if(channels[_0x77f084['uniqueid']]){delete channels[_0x77f084[_0x3002('0x7')]];}else if(_0x1f7523&&channels[_0x1f7523]){if(!transfers['blinds'][_0x1f7523][_0x3002('0x18')])delete transfers['blinds'][_0x1f7523];delete channels[_0x1f7523];}}exports['newchannel']=function(_0x3628f9){try{utils['debug'](util[_0x3002('0xa')]('[%s][calls][newchannel]',_0x3628f9['uniqueid']),_0x3628f9);if(_0x3628f9[_0x3002('0x7')]==_0x3628f9[_0x3002('0x19')]&&_0x3628f9[_0x3002('0xc')]!=_0x3002('0x1a')){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3628f9[_0x3002('0x7')],_0x3628f9['context'],_0x3628f9[_0x3002('0x1b')]));channels[_0x3628f9[_0x3002('0x7')]]={'uniqueid':_0x3628f9[_0x3002('0x7')],'accountcode':_0x3628f9['accountcode'],'source':_0x3628f9[_0x3002('0x1c')],'destination':_0x3628f9[_0x3002('0x1b')],'destinationcontext':_0x3628f9[_0x3002('0x1d')],'channel':_0x3628f9['channel'],'starttime':utils[_0x3002('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x3002('0x3'),'amaflags':_0x3002('0x1f')};}}catch(_0xe953f9){utils['error'](util[_0x3002('0xa')](_0x3002('0x20'),_0x3628f9[_0x3002('0x7')]),_0xe953f9);}};exports[_0x3002('0x21')]=function(_0x14cdb4){try{utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x23'),_0x14cdb4[_0x3002('0x7')]),_0x14cdb4);if(!_['isNil'](channels[_0x14cdb4[_0x3002('0x7')]])&&_0x14cdb4[_0x3002('0x24')]==0x6){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x14cdb4[_0x3002('0x7')],_0x14cdb4[_0x3002('0x1d')],_0x14cdb4[_0x3002('0xc')]));if(_[_0x3002('0x25')](channels[_0x14cdb4[_0x3002('0x7')]][_0x3002('0x26')])){channels[_0x14cdb4['uniqueid']][_0x3002('0x26')]=utils[_0x3002('0x1e')]();}}else if(!_[_0x3002('0x25')](channels[_0x14cdb4[_0x3002('0x19')]])&&_0x14cdb4[_0x3002('0x24')]==0x6&&_0x14cdb4['context']!=_0x3002('0x27')){utils['info'](util['format'](_0x3002('0x28'),_0x14cdb4[_0x3002('0x7')],_0x14cdb4[_0x3002('0x19')],_0x14cdb4[_0x3002('0x1d')],_0x14cdb4[_0x3002('0xc')]));channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x12')]=_0x14cdb4['accountcode'];channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x29')]=_0x14cdb4['channel'];if(_[_0x3002('0x25')](channels[_0x14cdb4['linkedid']][_0x3002('0x2a')])){channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x2a')]=utils[_0x3002('0x1e')]();}channels[_0x14cdb4['linkedid']][_0x3002('0x2b')]=dispositions[_[_0x3002('0x2c')](_0x14cdb4[_0x3002('0x24')])]||_0x3002('0x5');}}catch(_0x1822d6){utils['error'](util[_0x3002('0xa')](_0x3002('0x23'),_0x14cdb4[_0x3002('0x7')]),_0x1822d6);}};exports[_0x3002('0x2d')]=function(_0x52e27c){try{if(!_[_0x3002('0x25')](channels[_0x52e27c['uniqueid']])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x2e'),_0x52e27c['uniqueid']),_0x52e27c);if(_['isNil'](channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')])){channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')]=_0x52e27c[_0x3002('0x30')]+'\x20<'+_0x52e27c[_0x3002('0x1c')]+'>';}utils['info'](util[_0x3002('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x52e27c[_0x3002('0x7')],channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')],_0x52e27c[_0x3002('0x31')]));channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x32')]=utils[_0x3002('0x1e')]();channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x33')]=utils[_0x3002('0x34')](channels[_0x52e27c['uniqueid']][_0x3002('0x32')],channels[_0x52e27c[_0x3002('0x7')]]['starttime']);channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x35')]=channels[_0x52e27c[_0x3002('0x7')]]['answertime']?utils[_0x3002('0x34')](channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x32')],channels[_0x52e27c[_0x3002('0x7')]]['answertime']):0x0;writeDB(channels[_0x52e27c[_0x3002('0x7')]]);}}catch(_0x40c899){utils[_0x3002('0x36')](util[_0x3002('0xa')](_0x3002('0x2e'),_0x52e27c[_0x3002('0x7')]),_0x40c899);}};exports[_0x3002('0x37')]=function(_0x3cbf07){try{if(!_['isNil'](channels[_0x3cbf07[_0x3002('0x38')]])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x39'),_0x3cbf07[_0x3002('0x3a')]),_0x3cbf07);if(channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0xc')]==_0x3cbf07[_0x3002('0x3b')]){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x3c'),_0x3cbf07[_0x3002('0x3a')],_0x3cbf07[_0x3002('0x38')],_0x3cbf07[_0x3002('0x3d')]));channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0x29')]=_0x3cbf07[_0x3002('0x3d')];channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0x3e')]=_0x3002('0x3f');}else if(channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0xc')]=_0x3cbf07['transfertargetchannel']){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x3c'),_0x3cbf07[_0x3002('0x3a')],_0x3cbf07[_0x3002('0x38')],_0x3cbf07['origtransfererchannel']));channels[_0x3cbf07[_0x3002('0x38')]]['destinationchannel']=_0x3cbf07[_0x3002('0x40')];channels[_0x3cbf07['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x265d73){utils['error'](util[_0x3002('0xa')](_0x3002('0x39'),_0x3cbf07[_0x3002('0x3a')]),_0x265d73);}};exports['musiconholdstart']=function(_0x550755){try{if(!_[_0x3002('0x25')](channels[_0x550755[_0x3002('0x7')]])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x41'),_0x550755[_0x3002('0x7')]),_0x550755);channels[_0x550755[_0x3002('0x7')]][_0x3002('0x42')]=utils[_0x3002('0x1e')]();utils['info'](util['format'](_0x3002('0x43'),_0x550755[_0x3002('0x7')],channels[_0x550755[_0x3002('0x7')]][_0x3002('0x42')]));}}catch(_0x2af362){utils['error'](util[_0x3002('0xa')]('[%s][calls][musiconholdstart]',_0x550755[_0x3002('0x7')]),_0x2af362);}};exports['musiconholdstop']=function(_0x653622){try{if(!_[_0x3002('0x25')](channels[_0x653622['uniqueid']])){utils[_0x3002('0x22')](util['format']('[%s][calls][musiconholdstop]',_0x653622[_0x3002('0x7')]),_0x653622);if(!_[_0x3002('0x25')](channels[_0x653622[_0x3002('0x7')]]['musiconholdstartAt'])){channels[_0x653622[_0x3002('0x7')]][_0x3002('0x44')]+=utils[_0x3002('0x34')](utils['now'](),channels[_0x653622['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0x3002('0xa')](_0x3002('0x45'),_0x653622[_0x3002('0x7')],channels[_0x653622[_0x3002('0x7')]][_0x3002('0x44')]));delete channels[_0x653622[_0x3002('0x7')]]['musiconholdstartAt'];}}}catch(_0x32838b){utils['error'](util[_0x3002('0xa')](_0x3002('0x46'),_0x653622[_0x3002('0x7')]),_0x32838b);}};exports['varset']=function(_0x349c38){try{if(!_[_0x3002('0x25')](channels[_0x349c38[_0x3002('0x7')]])){utils[_0x3002('0x22')](util['format'](_0x3002('0x47'),_0x349c38[_0x3002('0x7')]),_0x349c38);if(!_['isNil'](_0x349c38['variable']['xmd-originatecalleridnum'])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x349c38[_0x3002('0x7')],_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x48')]=_0x349c38[_0x3002('0x49')];}if(!_['isNil'](_0x349c38['variable'][_0x3002('0x4a')])){utils[_0x3002('0x9')](util['format'](_0x3002('0x4b'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x4c')]=_0x349c38['value'];channels[_0x349c38[_0x3002('0x7')]]['callerid']='\x22'+_0x349c38['value']+_0x3002('0x4d')+_0x349c38['value']+'>';}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x4f')])||!_[_0x3002('0x25')](_0x349c38['variable']['xmd-callerid'])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x50'),_0x349c38[_0x3002('0x7')],!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')]['xmd-callerid-preview'])?_0x3002('0x4f'):_0x3002('0x51'),_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x2f')]=_0x349c38['value'];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x52')])||!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x53')])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x349c38[_0x3002('0x7')],!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x52')])?_0x3002('0x52'):_0x3002('0x53'),_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]]['lastapplication']=_0x3002('0x54');channels[_0x349c38['uniqueid']][_0x3002('0x55')]=_0x349c38[_0x3002('0x49')];channels[_0x349c38[_0x3002('0x7')]][_0x3002('0xd')]=!![];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x56')])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x57'),_0x349c38[_0x3002('0x7')],_0x349c38['value']));channels[_0x349c38['uniqueid']][_0x3002('0x58')]=_0x349c38[_0x3002('0x49')];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x59')])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x5a'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x5b')]=_0x349c38[_0x3002('0x49')];}if(!_[_0x3002('0x25')](_0x349c38['variable'][_0x3002('0x5c')])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x349c38['uniqueid'],_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x5d')]=_0x349c38['value'];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')]['sipcallid'])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x5e'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38['uniqueid']][_0x3002('0x5f')]=_0x349c38['value'];}}}catch(_0x4dbd4c){utils[_0x3002('0x36')](util[_0x3002('0xa')](_0x3002('0x47'),_0x349c38[_0x3002('0x7')]),_0x4dbd4c);}};exports['newexten']=function(_0x5f32fd){try{if(!_[_0x3002('0x25')](channels[_0x5f32fd[_0x3002('0x7')]])){utils[_0x3002('0x22')](util['format'](_0x3002('0x60'),_0x5f32fd[_0x3002('0x7')]),_0x5f32fd);utils['info'](util['format'](_0x3002('0x61'),_0x5f32fd[_0x3002('0x7')],_0x5f32fd[_0x3002('0x62')],_0x5f32fd['appdata']));if(_0x5f32fd[_0x3002('0x62')][_0x3002('0x63')]()=='set'&&_['startsWith'](_0x5f32fd[_0x3002('0x64')][_0x3002('0x63')](),'cdr')){var _0x19dc51=_0x5f32fd[_0x3002('0x64')]['split']('=');var _0x1ebc14=_0x19dc51[0x0][_0x3002('0x65')](_0x19dc51[0x0][_0x3002('0x66')]('(')+0x1,_0x19dc51[0x0]['lastIndexOf'](')'));var _0x183256=_0x19dc51[0x1];channels[_0x5f32fd[_0x3002('0x7')]][_0x1ebc14]=_0x183256;}if(!_[_0x3002('0x67')](['hangup',_0x3002('0x68'),_0x3002('0x69'),_0x3002('0x6a'),_0x3002('0x6b')],_0x5f32fd[_0x3002('0x62')][_0x3002('0x63')]())){channels[_0x5f32fd['uniqueid']]['lastapplication']=_0x5f32fd[_0x3002('0x62')];channels[_0x5f32fd['uniqueid']][_0x3002('0x55')]=_0x5f32fd[_0x3002('0x64')];}}}catch(_0x5b62bf){utils[_0x3002('0x36')](util['format'](_0x3002('0x60'),_0x5f32fd[_0x3002('0x7')]),_0x5b62bf);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 20c055e..7ac5858 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 _0x875d=['managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x594e00,_0x2b26e5){var _0x393663=function(_0xd47c49){while(--_0xd47c49){_0x594e00['push'](_0x594e00['shift']());}};_0x393663(++_0x2b26e5);}(_0x875d,0x191));var _0xd875=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x875d[_0xd0b415];return _0x2bdf2c;};'use strict';var utils=require(_0xd875('0x0'));exports[_0xd875('0x1')]=function(){utils[_0xd875('0x2')](_0xd875('0x3'));};exports['shutdown']=function(){utils[_0xd875('0x2')](_0xd875('0x4'));};exports[_0xd875('0x5')]=function(){utils['info'](_0xd875('0x6'));};exports[_0xd875('0x7')]=function(_0x24d049){utils['error'](_0xd875('0x8'),_0x24d049);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0xd875('0x9')]=function(_0x3449d4){}; \ No newline at end of file +var _0xa720=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x6bddeb,_0x1eea53){var _0x6285cb=function(_0x1bef1f){while(--_0x1bef1f){_0x6bddeb['push'](_0x6bddeb['shift']());}};_0x6285cb(++_0x1eea53);}(_0xa720,0x115));var _0x0a72=function(_0x11d418,_0xba2735){_0x11d418=_0x11d418-0x0;var _0x57677d=_0xa720[_0x11d418];return _0x57677d;};'use strict';var utils=require(_0x0a72('0x0'));exports[_0x0a72('0x1')]=function(){utils[_0x0a72('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils['info'](_0x0a72('0x3'));};exports[_0x0a72('0x4')]=function(){utils[_0x0a72('0x2')](_0x0a72('0x5'));};exports['error']=function(_0x2131ec){utils[_0x0a72('0x6')](_0x0a72('0x7'),_0x2131ec);};exports[_0x0a72('0x8')]=function(){utils[_0x0a72('0x2')](_0x0a72('0x9'));};exports[_0x0a72('0xa')]=function(_0x449cd5){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 31dbd6d..548f2ad 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 _0x2d00=['channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','diffTime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid'];(function(_0xbf2674,_0x330e49){var _0x13a65a=function(_0x11c096){while(--_0x11c096){_0xbf2674['push'](_0xbf2674['shift']());}};_0x13a65a(++_0x330e49);}(_0x2d00,0xef));var _0x02d0=function(_0x4c0989,_0x6bc56d){_0x4c0989=_0x4c0989-0x0;var _0x3bcd00=_0x2d00[_0x4c0989];return _0x3bcd00;};'use strict';var _=require(_0x02d0('0x0'));var util=require(_0x02d0('0x1'));var utils=require(_0x02d0('0x2'));var dials={};function writeDB(_0x80826e){utils[_0x02d0('0x3')](util['format'](_0x02d0('0x4'),_0x80826e[_0x02d0('0x5')],_0x80826e[_0x02d0('0x6')],_0x80826e[_0x02d0('0x7')],_0x80826e[_0x02d0('0x8')],_0x80826e[_0x02d0('0x9')],_0x80826e['dialstatus']));utils['request'](_0x02d0('0xa'),_0x80826e);delete dials[_0x80826e[_0x02d0('0x5')]];}exports[_0x02d0('0xb')]=function(_0x8b01a3){try{utils[_0x02d0('0xc')](util[_0x02d0('0xd')](_0x02d0('0xe'),_0x8b01a3[_0x02d0('0x5')]),_0x8b01a3);utils[_0x02d0('0x3')](util[_0x02d0('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x8b01a3['uniqueid'],_0x8b01a3[_0x02d0('0xf')],_0x8b01a3[_0x02d0('0x10')]));if(_0x8b01a3[_0x02d0('0xf')][_0x02d0('0x11')]()=='set'&&_['startsWith'](_0x8b01a3[_0x02d0('0x10')][_0x02d0('0x11')](),_0x02d0('0x12'))){var _0x43e29f=_0x8b01a3[_0x02d0('0x10')][_0x02d0('0x13')]('=');dials[_0x8b01a3[_0x02d0('0x5')]]={'routeId':_0x43e29f[0x1]};}}catch(_0xd46f06){utils[_0x02d0('0x14')](util[_0x02d0('0xd')](_0x02d0('0xe'),_0x8b01a3[_0x02d0('0x5')]),_0xd46f06);}};exports[_0x02d0('0x15')]=function(_0x347b31){try{utils[_0x02d0('0xc')](util[_0x02d0('0xd')](_0x02d0('0x16'),_0x347b31[_0x02d0('0x5')]),_0x347b31);if(!_[_0x02d0('0x17')](_0x347b31['variable']['outboundrouteid'])){utils[_0x02d0('0x3')](util['format'](_0x02d0('0x18'),_0x347b31['uniqueid'],_0x347b31['value']));dials[_0x347b31[_0x02d0('0x5')]]={'routeId':_0x347b31[_0x02d0('0x19')]};}}catch(_0x5d1770){utils[_0x02d0('0x14')](util[_0x02d0('0xd')](_0x02d0('0x16'),_0x347b31[_0x02d0('0x5')]),_0x5d1770);}};exports[_0x02d0('0x1a')]=function(_0x1018aa){try{if(!_[_0x02d0('0x17')](dials[_0x1018aa[_0x02d0('0x5')]])){utils[_0x02d0('0xc')](util[_0x02d0('0xd')](_0x02d0('0x1b'),_0x1018aa['uniqueid']),_0x1018aa);dials[_0x1018aa[_0x02d0('0x5')]]=_[_0x02d0('0x1c')](dials[_0x1018aa['uniqueid']],_0x1018aa);dials[_0x1018aa[_0x02d0('0x5')]][_0x02d0('0x1d')]=utils['now']();dials[_0x1018aa['uniqueid']][_0x02d0('0x1e')]=_0x02d0('0x1f');utils[_0x02d0('0x3')](util['format'](_0x02d0('0x20'),_0x1018aa[_0x02d0('0x5')],dials[_0x1018aa[_0x02d0('0x5')]]['starttime']));}}catch(_0x21eb9b){utils[_0x02d0('0x14')](util[_0x02d0('0xd')]('[%s][dials][dialbegin]',_0x1018aa[_0x02d0('0x5')]),_0x21eb9b);}};exports[_0x02d0('0x21')]=function(_0x1e2ed2){try{if(!_[_0x02d0('0x17')](dials[_0x1e2ed2[_0x02d0('0x5')]])){utils['debug'](util[_0x02d0('0xd')](_0x02d0('0x22'),_0x1e2ed2[_0x02d0('0x5')]),_0x1e2ed2);dials[_0x1e2ed2[_0x02d0('0x5')]][_0x02d0('0x23')]=_0x1e2ed2[_0x02d0('0x23')];if(_0x1e2ed2[_0x02d0('0x23')]=='ANSWER'){dials[_0x1e2ed2[_0x02d0('0x5')]]=_[_0x02d0('0x1c')](dials[_0x1e2ed2[_0x02d0('0x5')]],_0x1e2ed2);dials[_0x1e2ed2[_0x02d0('0x5')]]['answertime']=utils['now']();dials[_0x1e2ed2[_0x02d0('0x5')]]['lastevent']=_0x02d0('0x24');utils['info'](util['format'](_0x02d0('0x25'),_0x1e2ed2[_0x02d0('0x5')],_0x1e2ed2[_0x02d0('0x23')],dials[_0x1e2ed2[_0x02d0('0x5')]][_0x02d0('0x26')]));}else{utils[_0x02d0('0x3')](util[_0x02d0('0xd')](_0x02d0('0x27'),_0x1e2ed2['uniqueid'],_0x1e2ed2[_0x02d0('0x23')]));}}}catch(_0xcc4860){utils['error'](util[_0x02d0('0xd')]('[%s][dials][dialend]',_0x1e2ed2['uniqueid']),_0xcc4860);}};exports[_0x02d0('0x28')]=function(_0x17ccc9){try{if(!_[_0x02d0('0x17')](dials[_0x17ccc9[_0x02d0('0x5')]])){utils[_0x02d0('0xc')](util[_0x02d0('0xd')](_0x02d0('0x29'),_0x17ccc9[_0x02d0('0x5')]),_0x17ccc9);utils['info'](util[_0x02d0('0xd')](_0x02d0('0x2a'),_0x17ccc9['uniqueid'],_0x17ccc9['calleridnum'],_0x17ccc9[_0x02d0('0x2b')],_0x17ccc9[_0x02d0('0x2c')]));dials[_0x17ccc9[_0x02d0('0x5')]]=_[_0x02d0('0x1c')](dials[_0x17ccc9[_0x02d0('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x17ccc9[_0x02d0('0x5')]][_0x02d0('0x2d')]=utils['diffTime'](dials[_0x17ccc9[_0x02d0('0x5')]][_0x02d0('0x2e')],dials[_0x17ccc9['uniqueid']]['starttime']);dials[_0x17ccc9[_0x02d0('0x5')]]['holdtime']=utils[_0x02d0('0x2f')](dials[_0x17ccc9[_0x02d0('0x5')]]['answertime']||dials[_0x17ccc9[_0x02d0('0x5')]][_0x02d0('0x2e')],dials[_0x17ccc9[_0x02d0('0x5')]]['starttime']);dials[_0x17ccc9['uniqueid']][_0x02d0('0x30')]=dials[_0x17ccc9[_0x02d0('0x5')]]['answertime']?utils[_0x02d0('0x2f')](dials[_0x17ccc9[_0x02d0('0x5')]][_0x02d0('0x2e')],dials[_0x17ccc9[_0x02d0('0x5')]][_0x02d0('0x26')]):0x0;writeDB(dials[_0x17ccc9['uniqueid']]);}}catch(_0x46b0c3){utils['error'](util[_0x02d0('0xd')](_0x02d0('0x29'),_0x17ccc9[_0x02d0('0x5')]),_0x46b0c3);}}; \ No newline at end of file +var _0xc790=['connectedlinenum','CreateVoiceDialReport','newexten','[%s][dials][newexten]','application','set','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','debug','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xc790,0x11c));var _0x0c79=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc790[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x0c79('0x0'));var util=require(_0x0c79('0x1'));var utils=require(_0x0c79('0x2'));var dials={};function writeDB(_0x471a93){utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x5'),_0x471a93[_0x0c79('0x6')],_0x471a93[_0x0c79('0x7')],_0x471a93[_0x0c79('0x8')],_0x471a93[_0x0c79('0x9')],_0x471a93[_0x0c79('0xa')],_0x471a93['dialstatus']));utils['request'](_0x0c79('0xb'),_0x471a93);delete dials[_0x471a93[_0x0c79('0x6')]];}exports[_0x0c79('0xc')]=function(_0x4326d3){try{utils['debug'](util['format'](_0x0c79('0xd'),_0x4326d3['uniqueid']),_0x4326d3);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4326d3['uniqueid'],_0x4326d3['application'],_0x4326d3['appdata']));if(_0x4326d3[_0x0c79('0xe')]['toLowerCase']()==_0x0c79('0xf')&&_['startsWith'](_0x4326d3['appdata']['toLowerCase'](),_0x0c79('0x10'))){var _0x223b15=_0x4326d3[_0x0c79('0x11')][_0x0c79('0x12')]('=');dials[_0x4326d3['uniqueid']]={'routeId':_0x223b15[0x1]};}}catch(_0x47955e){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0xd'),_0x4326d3[_0x0c79('0x6')]),_0x47955e);}};exports[_0x0c79('0x14')]=function(_0x17af5){try{utils['debug'](util['format'](_0x0c79('0x15'),_0x17af5[_0x0c79('0x6')]),_0x17af5);if(!_['isNil'](_0x17af5[_0x0c79('0x16')][_0x0c79('0x17')])){utils[_0x0c79('0x3')](util['format'](_0x0c79('0x18'),_0x17af5[_0x0c79('0x6')],_0x17af5[_0x0c79('0x19')]));dials[_0x17af5[_0x0c79('0x6')]]={'routeId':_0x17af5[_0x0c79('0x19')]};}}catch(_0x891f4d){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x15'),_0x17af5['uniqueid']),_0x891f4d);}};exports[_0x0c79('0x1a')]=function(_0x8f03fa){try{if(!_[_0x0c79('0x1b')](dials[_0x8f03fa[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util['format'](_0x0c79('0x1d'),_0x8f03fa[_0x0c79('0x6')]),_0x8f03fa);dials[_0x8f03fa[_0x0c79('0x6')]]=_[_0x0c79('0x1e')](dials[_0x8f03fa[_0x0c79('0x6')]],_0x8f03fa);dials[_0x8f03fa['uniqueid']][_0x0c79('0x1f')]=utils['now']();dials[_0x8f03fa[_0x0c79('0x6')]][_0x0c79('0x20')]=_0x0c79('0x21');utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x22'),_0x8f03fa[_0x0c79('0x6')],dials[_0x8f03fa[_0x0c79('0x6')]][_0x0c79('0x1f')]));}}catch(_0x268dc8){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x1d'),_0x8f03fa[_0x0c79('0x6')]),_0x268dc8);}};exports['dialend']=function(_0x4dae53){try{if(!_[_0x0c79('0x1b')](dials[_0x4dae53[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util[_0x0c79('0x4')](_0x0c79('0x23'),_0x4dae53[_0x0c79('0x6')]),_0x4dae53);dials[_0x4dae53['uniqueid']][_0x0c79('0x24')]=_0x4dae53[_0x0c79('0x24')];if(_0x4dae53[_0x0c79('0x24')]==_0x0c79('0x25')){dials[_0x4dae53[_0x0c79('0x6')]]=_['assign'](dials[_0x4dae53['uniqueid']],_0x4dae53);dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x26')]=utils[_0x0c79('0x27')]();dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x20')]=_0x0c79('0x28');utils[_0x0c79('0x3')](util[_0x0c79('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4dae53[_0x0c79('0x6')],_0x4dae53[_0x0c79('0x24')],dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x26')]));}else{utils[_0x0c79('0x3')](util['format'](_0x0c79('0x29'),_0x4dae53['uniqueid'],_0x4dae53[_0x0c79('0x24')]));}}}catch(_0x31cbdc){utils['error'](util[_0x0c79('0x4')](_0x0c79('0x23'),_0x4dae53['uniqueid']),_0x31cbdc);}};exports['hangup']=function(_0x1cdaea){try{if(!_[_0x0c79('0x1b')](dials[_0x1cdaea[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util['format'](_0x0c79('0x2a'),_0x1cdaea[_0x0c79('0x6')]),_0x1cdaea);utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x2b'),_0x1cdaea[_0x0c79('0x6')],_0x1cdaea[_0x0c79('0x9')],_0x1cdaea['calleridname'],_0x1cdaea[_0x0c79('0x2c')]));dials[_0x1cdaea[_0x0c79('0x6')]]=_[_0x0c79('0x1e')](dials[_0x1cdaea[_0x0c79('0x6')]],{'endtime':utils[_0x0c79('0x27')](),'lastevent':'complete'});dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x2d')]=utils[_0x0c79('0x2e')](dials[_0x1cdaea['uniqueid']][_0x0c79('0x2f')],dials[_0x1cdaea['uniqueid']][_0x0c79('0x1f')]);dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x30')]=utils[_0x0c79('0x2e')](dials[_0x1cdaea['uniqueid']][_0x0c79('0x26')]||dials[_0x1cdaea['uniqueid']]['endtime'],dials[_0x1cdaea['uniqueid']][_0x0c79('0x1f')]);dials[_0x1cdaea[_0x0c79('0x6')]]['billableseconds']=dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x26')]?utils[_0x0c79('0x2e')](dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x2f')],dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x26')]):0x0;writeDB(dials[_0x1cdaea[_0x0c79('0x6')]]);}}catch(_0x22a5b6){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x2a'),_0x1cdaea[_0x0c79('0x6')]),_0x22a5b6);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f65ffed..a68c1ea 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 _0xb0e6=['./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','env','production','local','asterisk','port','username','password','keepConnected','info','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller'];(function(_0x548f68,_0x2db63e){var _0x1adf80=function(_0x5b08e6){while(--_0x5b08e6){_0x548f68['push'](_0x548f68['shift']());}};_0x1adf80(++_0x2db63e);}(_0xb0e6,0x145));var _0x6b0e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb0e6[_0x46698a];return _0x356db0;};var AsteriskManager=require(_0x6b0e('0x0'));var config=require(_0x6b0e('0x1'));var utils=require(_0x6b0e('0x2'));var util=require(_0x6b0e('0x3'));var isXDREnabled=config[_0x6b0e('0x4')]&&config[_0x6b0e('0x4')]['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x6b0e('0x5')]===_0x6b0e('0x6')||![];var isLocalAsterisk=config[_0x6b0e('0x4')]&&config[_0x6b0e('0x4')][_0x6b0e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x6b0e('0x8')][_0x6b0e('0x9')],config[_0x6b0e('0x8')]['ip'],config[_0x6b0e('0x8')][_0x6b0e('0xa')],config[_0x6b0e('0x8')][_0x6b0e('0xb')],!![]);ami[_0x6b0e('0xc')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x6b0e('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x6b0e('0xe'));var calls=require(_0x6b0e('0xf'));var queues=require('./queues.controller');var recordings=require(_0x6b0e('0x10'));var members=require(_0x6b0e('0x11'));var dials=require(_0x6b0e('0x12'));var transfers=require(_0x6b0e('0x13'));var core=require(_0x6b0e('0x14'));ami['on'](_0x6b0e('0x15'),core['connect']);ami['on'](_0x6b0e('0x16'),core[_0x6b0e('0x16')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x6b0e('0x17'),core['error']);ami['on']('close',core[_0x6b0e('0x18')]);ami['on'](_0x6b0e('0x19'),core['managerevent']);ami['on'](_0x6b0e('0x1a'),function(_0x4ef40d){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')]('[%s][index][devicestatechange]',_0x4ef40d[_0x6b0e('0x1d')]),_0x4ef40d);members[_0x6b0e('0x1a')](_0x4ef40d);}catch(_0x68d1a){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x1e'),_0x4ef40d['device']),_0x68d1a);}});ami['on'](_0x6b0e('0x1f'),function(_0x2218ff){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x20'),_0x2218ff[_0x6b0e('0x21')]),_0x2218ff);agents[_0x6b0e('0x1f')](_0x2218ff);}catch(_0x178144){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x20'),_0x2218ff[_0x6b0e('0x21')]),_0x178144);}});ami['on'](_0x6b0e('0x22'),function(_0x329862){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x23'),_0x329862[_0x6b0e('0x21')]),_0x329862);agents[_0x6b0e('0x22')](_0x329862);}catch(_0x473fc8){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x23'),_0x329862['uniqueid']),_0x473fc8);}});ami['on']('agentconnect',function(_0x29c05c){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x24'),_0x29c05c[_0x6b0e('0x21')]),_0x29c05c);agents[_0x6b0e('0x25')](_0x29c05c);queues['agentconnect'](_0x29c05c);}catch(_0x397da1){utils['error'](util['format'](_0x6b0e('0x24'),_0x29c05c[_0x6b0e('0x21')]),_0x397da1);}});ami['on'](_0x6b0e('0x26'),function(_0x10d0c3){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x27'),_0x10d0c3[_0x6b0e('0x21')]),_0x10d0c3);agents['agentcomplete'](_0x10d0c3);queues['agentcomplete'](_0x10d0c3);members['agentcomplete'](_0x10d0c3);}catch(_0x285c56){utils[_0x6b0e('0x17')](util['format'](_0x6b0e('0x27'),_0x10d0c3[_0x6b0e('0x21')]),_0x285c56);}});ami['on'](_0x6b0e('0x28'),function(_0x42c285){try{utils['debug'](util['format'](_0x6b0e('0x29'),_0x42c285[_0x6b0e('0x21')]),_0x42c285);agents[_0x6b0e('0x28')](_0x42c285);queues['queuecallerabandon'](_0x42c285);}catch(_0x242530){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x29'),_0x42c285['uniqueid']),_0x242530);}});ami['on'](_0x6b0e('0x2a'),function(_0x2b60d0){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x2b'),_0x2b60d0[_0x6b0e('0x21')]),_0x2b60d0);queues['queuecallerjoin'](_0x2b60d0);recordings['queuecallerjoin'](_0x2b60d0);}catch(_0x31d8c6){utils[_0x6b0e('0x17')](util['format'](_0x6b0e('0x2b'),_0x2b60d0[_0x6b0e('0x21')]),_0x31d8c6);}});ami['on'](_0x6b0e('0x2c'),function(_0xccab20){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x2d'),_0xccab20[_0x6b0e('0x21')]),_0xccab20);queues[_0x6b0e('0x2c')](_0xccab20);}catch(_0x4b3a1b){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x2d'),_0xccab20[_0x6b0e('0x21')]),_0x4b3a1b);}});ami['on'](_0x6b0e('0x2e'),function(_0x3a0a98){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x2f'),_0x3a0a98['uniqueid']),_0x3a0a98);queues[_0x6b0e('0x2e')](_0x3a0a98);calls[_0x6b0e('0x2e')](_0x3a0a98);}catch(_0x4bf4ff){utils[_0x6b0e('0x17')](util['format']('[%s][index][musiconholdstart]',_0x3a0a98[_0x6b0e('0x21')]),_0x4bf4ff);}});ami['on'](_0x6b0e('0x30'),function(_0x22aa86){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x31'),_0x22aa86['uniqueid']),_0x22aa86);queues[_0x6b0e('0x30')](_0x22aa86);calls[_0x6b0e('0x30')](_0x22aa86);}catch(_0x430548){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x31'),_0x22aa86['uniqueid']),_0x430548);}});ami['on'](_0x6b0e('0x32'),function(_0x5e0417){try{utils[_0x6b0e('0x1b')](util['format']('[%s][index][newstate]',_0x5e0417['uniqueid']),_0x5e0417);calls[_0x6b0e('0x32')](_0x5e0417);recordings[_0x6b0e('0x32')](_0x5e0417);}catch(_0x1e8fe3){utils['error'](util[_0x6b0e('0x1c')](_0x6b0e('0x33'),_0x5e0417[_0x6b0e('0x21')]),_0x1e8fe3);}});ami['on']('hangup',function(_0x9a7cf8){try{utils['debug'](util[_0x6b0e('0x1c')]('[%s][index][hangup]',_0x9a7cf8['uniqueid']),_0x9a7cf8);calls['hangup'](_0x9a7cf8);recordings['hangup'](_0x9a7cf8);dials['hangup'](_0x9a7cf8);agents[_0x6b0e('0x34')](_0x9a7cf8);queues[_0x6b0e('0x34')](_0x9a7cf8);}catch(_0x3b9be3){utils[_0x6b0e('0x17')](util['format'](_0x6b0e('0x35'),_0x9a7cf8[_0x6b0e('0x21')]),_0x3b9be3);}});ami['on'](_0x6b0e('0x36'),function(_0x13f316){try{utils[_0x6b0e('0x1b')](util['format']('[%s][index][cdr]',_0x13f316['uniqueid']),_0x13f316);members[_0x6b0e('0x36')](_0x13f316);}catch(_0x3e2983){utils['error'](util['format']('[%s][index][cdr]',_0x13f316[_0x6b0e('0x21')]),_0x3e2983);}});ami['on']('blindtransfer',function(_0x11663c){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')]('[%s][index][blindtransfer]',_0x11663c[_0x6b0e('0x21')]),_0x11663c);queues['blindtransfer'](_0x11663c);agents[_0x6b0e('0x37')](_0x11663c);transfers[_0x6b0e('0x37')](_0x11663c);recordings[_0x6b0e('0x37')](_0x11663c);}catch(_0xe10059){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')]('[%s][index][blindtransfer]',_0x11663c[_0x6b0e('0x21')]),_0xe10059);}});ami['on'](_0x6b0e('0x38'),function(_0x52e0c){try{utils[_0x6b0e('0x1b')](util['format'](_0x6b0e('0x39'),_0x52e0c[_0x6b0e('0x3a')]),_0x52e0c);queues[_0x6b0e('0x38')](_0x52e0c);transfers[_0x6b0e('0x38')](_0x52e0c);agents[_0x6b0e('0x38')](_0x52e0c);calls[_0x6b0e('0x38')](_0x52e0c);}catch(_0x47494c){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')]('[%s][index][attendedtransfer]',_0x52e0c[_0x6b0e('0x3a')]),_0x47494c);}});ami['on'](_0x6b0e('0x3b'),function(_0xa35f29){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x3c'),_0xa35f29['uniqueid']),_0xa35f29);queues[_0x6b0e('0x3b')](_0xa35f29);recordings[_0x6b0e('0x3b')](_0xa35f29);calls[_0x6b0e('0x3b')](_0xa35f29);dials[_0x6b0e('0x3b')](_0xa35f29);}catch(_0x3c2aa3){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x3c'),_0xa35f29[_0x6b0e('0x21')]),_0x3c2aa3);}});ami['on'](_0x6b0e('0x3d'),function(_0x1666c0){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x3e'),_0x1666c0[_0x6b0e('0x21')]),_0x1666c0);calls[_0x6b0e('0x3d')](_0x1666c0);recordings[_0x6b0e('0x3d')](_0x1666c0);dials[_0x6b0e('0x3d')](_0x1666c0);}catch(_0x3f5b4b){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x3e'),_0x1666c0['uniqueid']),_0x3f5b4b);}});ami['on'](_0x6b0e('0x3f'),function(_0x505921){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x40'),_0x505921[_0x6b0e('0x21')]),_0x505921);calls[_0x6b0e('0x3f')](_0x505921);recordings[_0x6b0e('0x3f')](_0x505921);}catch(_0x401566){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x40'),_0x505921[_0x6b0e('0x21')]),_0x401566);}});ami['on'](_0x6b0e('0x41'),function(_0xeb09b7){try{utils[_0x6b0e('0x1b')](util[_0x6b0e('0x1c')](_0x6b0e('0x42'),_0xeb09b7[_0x6b0e('0x21')]),_0xeb09b7);dials[_0x6b0e('0x41')](_0xeb09b7);}catch(_0x377dbd){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x43'),_0xeb09b7['uniqueid']),_0x377dbd);}});ami['on']('dialend',function(_0x32d578){try{utils[_0x6b0e('0x1b')](util['format'](_0x6b0e('0x44'),_0x32d578['uniqueid']),_0x32d578);dials['dialend'](_0x32d578);}catch(_0x59dc1b){utils[_0x6b0e('0x17')](util[_0x6b0e('0x1c')](_0x6b0e('0x44'),_0x32d578[_0x6b0e('0x21')]),_0x59dc1b);}});} \ No newline at end of file +var _0x6bb9=['format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange'];(function(_0x2da45d,_0x35397b){var _0x1012a0=function(_0x2babc3){while(--_0x2babc3){_0x2da45d['push'](_0x2da45d['shift']());}};_0x1012a0(++_0x35397b);}(_0x6bb9,0x142));var _0x96bb=function(_0xd0809d,_0x434817){_0xd0809d=_0xd0809d-0x0;var _0x2c8946=_0x6bb9[_0xd0809d];return _0x2c8946;};var AsteriskManager=require(_0x96bb('0x0'));var config=require(_0x96bb('0x1'));var utils=require('./utils');var util=require(_0x96bb('0x2'));var isXDREnabled=config[_0x96bb('0x3')]&&config[_0x96bb('0x3')][_0x96bb('0x4')]?!config[_0x96bb('0x3')][_0x96bb('0x4')]:!![];var isProduction=config[_0x96bb('0x5')]===_0x96bb('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x96bb('0x3')][_0x96bb('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x96bb('0x8')][_0x96bb('0x9')],config[_0x96bb('0x8')]['ip'],config[_0x96bb('0x8')][_0x96bb('0xa')],config['asterisk'][_0x96bb('0xb')],!![]);ami[_0x96bb('0xc')]();if(!isXDREnabled){utils[_0x96bb('0xd')](_0x96bb('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x96bb('0xd')](_0x96bb('0xf'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x96bb('0x10'));var transfers=require('./transfers.controller');var core=require(_0x96bb('0x11'));ami['on'](_0x96bb('0x12'),core[_0x96bb('0x12')]);ami['on'](_0x96bb('0x13'),core[_0x96bb('0x13')]);ami['on'](_0x96bb('0x14'),core[_0x96bb('0x14')]);ami['on'](_0x96bb('0x15'),core[_0x96bb('0x15')]);ami['on'](_0x96bb('0x16'),core['close']);ami['on'](_0x96bb('0x17'),core[_0x96bb('0x17')]);ami['on']('devicestatechange',function(_0x2d55b8){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x19'),_0x2d55b8[_0x96bb('0x1a')]),_0x2d55b8);members[_0x96bb('0x1b')](_0x2d55b8);}catch(_0x3cd8b){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x19'),_0x2d55b8[_0x96bb('0x1a')]),_0x3cd8b);}});ami['on'](_0x96bb('0x1d'),function(_0x19343c){try{utils['debug'](util[_0x96bb('0x1c')](_0x96bb('0x1e'),_0x19343c[_0x96bb('0x1f')]),_0x19343c);agents[_0x96bb('0x1d')](_0x19343c);}catch(_0xa03a9){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')]('[%s][index][agentcalled]',_0x19343c[_0x96bb('0x1f')]),_0xa03a9);}});ami['on'](_0x96bb('0x20'),function(_0x33401f){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x21'),_0x33401f[_0x96bb('0x1f')]),_0x33401f);agents['agentringnoanswer'](_0x33401f);}catch(_0x4841db){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x21'),_0x33401f[_0x96bb('0x1f')]),_0x4841db);}});ami['on'](_0x96bb('0x22'),function(_0x1b37f9){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x23'),_0x1b37f9[_0x96bb('0x1f')]),_0x1b37f9);agents[_0x96bb('0x22')](_0x1b37f9);queues[_0x96bb('0x22')](_0x1b37f9);}catch(_0x3177c8){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x23'),_0x1b37f9['uniqueid']),_0x3177c8);}});ami['on'](_0x96bb('0x24'),function(_0x19e10f){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x25'),_0x19e10f[_0x96bb('0x1f')]),_0x19e10f);agents[_0x96bb('0x24')](_0x19e10f);queues[_0x96bb('0x24')](_0x19e10f);members['agentcomplete'](_0x19e10f);}catch(_0x23c442){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x25'),_0x19e10f['uniqueid']),_0x23c442);}});ami['on'](_0x96bb('0x26'),function(_0x5ad765){try{utils['debug'](util['format']('[%s][index][queuecallerabandon]',_0x5ad765[_0x96bb('0x1f')]),_0x5ad765);agents[_0x96bb('0x26')](_0x5ad765);queues['queuecallerabandon'](_0x5ad765);}catch(_0x5e7a53){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x27'),_0x5ad765['uniqueid']),_0x5e7a53);}});ami['on'](_0x96bb('0x28'),function(_0x5c81a7){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x29'),_0x5c81a7[_0x96bb('0x1f')]),_0x5c81a7);queues[_0x96bb('0x28')](_0x5c81a7);recordings[_0x96bb('0x28')](_0x5c81a7);}catch(_0x1ae5f8){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x29'),_0x5c81a7[_0x96bb('0x1f')]),_0x1ae5f8);}});ami['on'](_0x96bb('0x2a'),function(_0x43f6b6){try{utils['debug'](util['format'](_0x96bb('0x2b'),_0x43f6b6['uniqueid']),_0x43f6b6);queues[_0x96bb('0x2a')](_0x43f6b6);}catch(_0xbf1acb){utils['error'](util['format'](_0x96bb('0x2b'),_0x43f6b6[_0x96bb('0x1f')]),_0xbf1acb);}});ami['on'](_0x96bb('0x2c'),function(_0x31eba6){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x2d'),_0x31eba6[_0x96bb('0x1f')]),_0x31eba6);queues[_0x96bb('0x2c')](_0x31eba6);calls[_0x96bb('0x2c')](_0x31eba6);}catch(_0x599405){utils['error'](util['format'](_0x96bb('0x2d'),_0x31eba6[_0x96bb('0x1f')]),_0x599405);}});ami['on'](_0x96bb('0x2e'),function(_0x1457a7){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x2f'),_0x1457a7[_0x96bb('0x1f')]),_0x1457a7);queues[_0x96bb('0x2e')](_0x1457a7);calls[_0x96bb('0x2e')](_0x1457a7);}catch(_0x4234c2){utils[_0x96bb('0x15')](util['format'](_0x96bb('0x2f'),_0x1457a7[_0x96bb('0x1f')]),_0x4234c2);}});ami['on']('newstate',function(_0xed9a57){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x30'),_0xed9a57['uniqueid']),_0xed9a57);calls[_0x96bb('0x31')](_0xed9a57);recordings['newstate'](_0xed9a57);}catch(_0x3638a8){utils[_0x96bb('0x15')](util['format'](_0x96bb('0x30'),_0xed9a57[_0x96bb('0x1f')]),_0x3638a8);}});ami['on'](_0x96bb('0x32'),function(_0x2128fd){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x33'),_0x2128fd[_0x96bb('0x1f')]),_0x2128fd);calls[_0x96bb('0x32')](_0x2128fd);recordings[_0x96bb('0x32')](_0x2128fd);dials['hangup'](_0x2128fd);agents[_0x96bb('0x32')](_0x2128fd);queues[_0x96bb('0x32')](_0x2128fd);}catch(_0x4481ba){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x33'),_0x2128fd[_0x96bb('0x1f')]),_0x4481ba);}});ami['on'](_0x96bb('0x34'),function(_0x1f42fb){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x35'),_0x1f42fb['uniqueid']),_0x1f42fb);members[_0x96bb('0x34')](_0x1f42fb);}catch(_0x44c84f){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x35'),_0x1f42fb[_0x96bb('0x1f')]),_0x44c84f);}});ami['on']('blindtransfer',function(_0x327678){try{utils[_0x96bb('0x18')](util['format']('[%s][index][blindtransfer]',_0x327678[_0x96bb('0x1f')]),_0x327678);queues[_0x96bb('0x36')](_0x327678);agents['blindtransfer'](_0x327678);transfers['blindtransfer'](_0x327678);recordings[_0x96bb('0x36')](_0x327678);}catch(_0x5bbb60){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x37'),_0x327678[_0x96bb('0x1f')]),_0x5bbb60);}});ami['on']('attendedtransfer',function(_0x3371da){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x38'),_0x3371da[_0x96bb('0x39')]),_0x3371da);queues[_0x96bb('0x3a')](_0x3371da);transfers[_0x96bb('0x3a')](_0x3371da);agents['attendedtransfer'](_0x3371da);calls[_0x96bb('0x3a')](_0x3371da);}catch(_0x10e894){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x38'),_0x3371da[_0x96bb('0x39')]),_0x10e894);}});ami['on'](_0x96bb('0x3b'),function(_0x2cd953){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x3c'),_0x2cd953[_0x96bb('0x1f')]),_0x2cd953);queues[_0x96bb('0x3b')](_0x2cd953);recordings[_0x96bb('0x3b')](_0x2cd953);calls[_0x96bb('0x3b')](_0x2cd953);dials[_0x96bb('0x3b')](_0x2cd953);}catch(_0x350a40){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x3c'),_0x2cd953[_0x96bb('0x1f')]),_0x350a40);}});ami['on'](_0x96bb('0x3d'),function(_0x16f7ba){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x3e'),_0x16f7ba['uniqueid']),_0x16f7ba);calls[_0x96bb('0x3d')](_0x16f7ba);recordings[_0x96bb('0x3d')](_0x16f7ba);dials['newexten'](_0x16f7ba);}catch(_0x4f3dbc){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x3e'),_0x16f7ba[_0x96bb('0x1f')]),_0x4f3dbc);}});ami['on'](_0x96bb('0x3f'),function(_0x5ae00c){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')]('[%s][index][newchannel]',_0x5ae00c[_0x96bb('0x1f')]),_0x5ae00c);calls[_0x96bb('0x3f')](_0x5ae00c);recordings[_0x96bb('0x3f')](_0x5ae00c);}catch(_0x263fdd){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x40'),_0x5ae00c['uniqueid']),_0x263fdd);}});ami['on'](_0x96bb('0x41'),function(_0x98e088){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x42'),_0x98e088[_0x96bb('0x1f')]),_0x98e088);dials['dialbegin'](_0x98e088);}catch(_0x426130){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x43'),_0x98e088[_0x96bb('0x1f')]),_0x426130);}});ami['on']('dialend',function(_0x38dcfa){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x44'),_0x38dcfa[_0x96bb('0x1f')]),_0x38dcfa);dials[_0x96bb('0x45')](_0x38dcfa);}catch(_0x3ecf8e){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x44'),_0x38dcfa[_0x96bb('0x1f')]),_0x3ecf8e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5b215fa..1df9275 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 _0x6fad=['[%s][members][devicestatechange]','debug','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','name','internal','getUserByName','split','then','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6fad,0x174));var _0xd6fa=function(_0x4d389d,_0xec145d){_0x4d389d=_0x4d389d-0x0;var _0x22bd25=_0x6fad[_0x4d389d];return _0x22bd25;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var utils=require(_0xd6fa('0x2'));var members={};var exclude=[_0xd6fa('0x3'),'Queue:'];function writeDB(_0x2f5f9b){utils['info'](util[_0xd6fa('0x4')](_0xd6fa('0x5'),_0x2f5f9b[_0xd6fa('0x6')],_0x2f5f9b[_0xd6fa('0x7')],_0x2f5f9b['channel'],_0x2f5f9b[_0xd6fa('0x8')],_0x2f5f9b[_0xd6fa('0x9')],_0x2f5f9b[_0xd6fa('0xa')]));if(_0x2f5f9b[_0xd6fa('0x7')]){utils['getUserByInterface'](_0x2f5f9b[_0xd6fa('0x7')])['then'](function(_0x92911b){if(_0x92911b){_0x2f5f9b[_0xd6fa('0x9')]=_0x92911b[_0xd6fa('0xb')];_0x2f5f9b[_0xd6fa('0xc')]=_0x92911b[_0xd6fa('0xc')];utils['request']('CreateMemberReport',_0x2f5f9b);}else{utils[_0xd6fa('0xd')](_0x2f5f9b[_0xd6fa('0x7')][_0xd6fa('0xe')]('/')[0x1])[_0xd6fa('0xf')](function(_0x3dd6bb){if(_0x3dd6bb){_0x2f5f9b['membername']=_0x3dd6bb['name'];_0x2f5f9b[_0xd6fa('0xc')]=_0x3dd6bb['internal'];utils['request'](_0xd6fa('0x10'),_0x2f5f9b);}});}})[_0xd6fa('0x11')](function(_0x1bcecd){utils[_0xd6fa('0x12')](util[_0xd6fa('0x4')](_0xd6fa('0x13'),_0x2f5f9b[_0xd6fa('0x6')]),_0x1bcecd);});}delete members[_0x2f5f9b[_0xd6fa('0x7')]];}function startsWith(_0x45f777,_0x5b853a){return _[_0xd6fa('0x14')](_0x45f777,function(_0x4082c5){return _[_0xd6fa('0x15')](_0x5b853a,_0x4082c5);});}exports[_0xd6fa('0x16')]=function(_0x47e70a){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x47e70a['device']]?members[_0x47e70a[_0xd6fa('0x17')]]['uniqueid']:_0x47e70a[_0xd6fa('0x17')]),_0x47e70a);utils['info'](util[_0xd6fa('0x4')](_0xd6fa('0x18'),members[_0x47e70a[_0xd6fa('0x17')]]?members[_0x47e70a[_0xd6fa('0x17')]][_0xd6fa('0x6')]:_0x47e70a[_0xd6fa('0x17')],_0x47e70a[_0xd6fa('0x19')],_0x47e70a[_0xd6fa('0x17')]));switch(_0x47e70a[_0xd6fa('0x19')]){case _0xd6fa('0x1a'):case _0xd6fa('0x1b'):if(!startsWith(exclude,_0x47e70a[_0xd6fa('0x17')])){members[_0x47e70a[_0xd6fa('0x17')]]={'channel':_0xd6fa('0x1c'),'interface':_0x47e70a[_0xd6fa('0x17')],'type':_0xd6fa('0x1d'),'enterAt':utils[_0xd6fa('0x1e')](),'role':_0xd6fa('0x1f')};}break;case _0xd6fa('0x20'):if(!_['isNil'](members[_0x47e70a['device']])){members[_0x47e70a[_0xd6fa('0x17')]][_0xd6fa('0x21')]=utils[_0xd6fa('0x1e')]();members[_0x47e70a[_0xd6fa('0x17')]][_0xd6fa('0x22')]=utils[_0xd6fa('0x23')](members[_0x47e70a['device']][_0xd6fa('0x21')],members[_0x47e70a[_0xd6fa('0x17')]]['enterAt']);if(members[_0x47e70a[_0xd6fa('0x17')]][_0xd6fa('0x6')]){writeDB(members[_0x47e70a[_0xd6fa('0x17')]]);}}break;default:break;}}catch(_0x47b073){utils[_0xd6fa('0x12')](util[_0xd6fa('0x4')](_0xd6fa('0x24'),members[_0x47e70a[_0xd6fa('0x17')]]?members[_0x47e70a[_0xd6fa('0x17')]][_0xd6fa('0x6')]:_0x47e70a[_0xd6fa('0x17')]),_0x47b073);}};exports['agentcomplete']=function(_0x2a59c0){try{if(!_['isNil'](members[_0x2a59c0[_0xd6fa('0x7')]])){utils[_0xd6fa('0x25')](util['format'](_0xd6fa('0x26'),_0x2a59c0[_0xd6fa('0x6')]),_0x2a59c0);utils[_0xd6fa('0x27')](util[_0xd6fa('0x4')](_0xd6fa('0x28'),_0x2a59c0[_0xd6fa('0x6')],_0x2a59c0[_0xd6fa('0x7')],_0x2a59c0[_0xd6fa('0x29')]));members[_0x2a59c0[_0xd6fa('0x7')]]=_['assign'](members[_0x2a59c0[_0xd6fa('0x7')]],{'data4':_0x2a59c0[_0xd6fa('0x29')],'uniqueid':_0x2a59c0['uniqueid']});}}catch(_0x27b9ed){utils[_0xd6fa('0x12')](util[_0xd6fa('0x4')](_0xd6fa('0x26'),_0x2a59c0[_0xd6fa('0x6')]),_0x27b9ed);}};exports[_0xd6fa('0x2a')]=function(_0x3c6af2){try{utils[_0xd6fa('0x25')](util[_0xd6fa('0x4')](_0xd6fa('0x2b'),_0x3c6af2[_0xd6fa('0x6')]),_0x3c6af2);if(_0x3c6af2['channel']){var _0x2d934d=_0x3c6af2['channel'][_0xd6fa('0xe')]('-')[0x0];if(!_['isNil'](members[_0x2d934d])){members[_0x2d934d]=_[_0xd6fa('0x2c')](members[_0x2d934d],{'data1':members[_0x2d934d][_0xd6fa('0x2d')]||_0x3c6af2['type'],'data2':members[_0x2d934d][_0xd6fa('0x8')]||_0x3c6af2['source'],'data3':members[_0x2d934d][_0xd6fa('0x2e')]||_0x3c6af2[_0xd6fa('0x2f')],'uniqueid':members[_0x2d934d][_0xd6fa('0x6')]||_0x3c6af2['uniqueid']});utils['info'](util[_0xd6fa('0x4')](_0xd6fa('0x30'),_0x3c6af2[_0xd6fa('0x6')],members[_0x2d934d]['data1'],members[_0x2d934d][_0xd6fa('0x8')],members[_0x2d934d][_0xd6fa('0x2e')]));if(members[_0x2d934d][_0xd6fa('0x21')]){writeDB(members[_0x2d934d]);}}}if(_0x3c6af2[_0xd6fa('0x31')]){var _0x2bd852=_0x3c6af2[_0xd6fa('0x31')][_0xd6fa('0xe')]('-')[0x0];if(!_['isNil'](members[_0x2bd852])){members[_0x2bd852]=_[_0xd6fa('0x2c')](members[_0x2bd852],{'data1':members[_0x2bd852][_0xd6fa('0x2d')]||_0x3c6af2[_0xd6fa('0xa')],'data2':members[_0x2bd852][_0xd6fa('0x8')]||_0x3c6af2[_0xd6fa('0x32')],'data3':members[_0x2bd852][_0xd6fa('0x2e')]||_0x3c6af2[_0xd6fa('0x2f')],'uniqueid':members[_0x2bd852][_0xd6fa('0x6')]||_0x3c6af2['uniqueid']});utils[_0xd6fa('0x27')](util[_0xd6fa('0x4')](_0xd6fa('0x30'),_0x3c6af2[_0xd6fa('0x6')],members[_0x2bd852][_0xd6fa('0x2d')],members[_0x2bd852][_0xd6fa('0x8')],members[_0x2bd852][_0xd6fa('0x2e')]));if(members[_0x2bd852][_0xd6fa('0x21')]){writeDB(members[_0x2bd852]);}}}}catch(_0x141f13){utils['error'](util[_0xd6fa('0x4')](_0xd6fa('0x2b'),_0x3c6af2[_0xd6fa('0x6')]),_0x141f13);}}; \ No newline at end of file +var _0x1689=['debug','device','info','state','INUSE','voice','now','agent','NOT_INUSE','isNil','duration','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','data1','type','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','membername','catch','error','format','[%s][members][writeDB]','some','startsWith'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x1689,0x19a));var _0x9168=function(_0x200f29,_0x3af579){_0x200f29=_0x200f29-0x0;var _0x200077=_0x1689[_0x200f29];return _0x200077;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9168('0x0'));var members={};var exclude=[_0x9168('0x1'),_0x9168('0x2')];function writeDB(_0x4b45a4){utils['info'](util['format'](_0x9168('0x3'),_0x4b45a4[_0x9168('0x4')],_0x4b45a4[_0x9168('0x5')],_0x4b45a4[_0x9168('0x6')],_0x4b45a4[_0x9168('0x7')],_0x4b45a4['membername'],_0x4b45a4['type']));if(_0x4b45a4[_0x9168('0x5')]){utils[_0x9168('0x8')](_0x4b45a4['interface'])[_0x9168('0x9')](function(_0xbf9054){if(_0xbf9054){_0x4b45a4['membername']=_0xbf9054['name'];_0x4b45a4['internal']=_0xbf9054[_0x9168('0xa')];utils[_0x9168('0xb')](_0x9168('0xc'),_0x4b45a4);}else{utils[_0x9168('0xd')](_0x4b45a4[_0x9168('0x5')][_0x9168('0xe')]('/')[0x1])[_0x9168('0x9')](function(_0x3cd31f){if(_0x3cd31f){_0x4b45a4[_0x9168('0xf')]=_0x3cd31f['name'];_0x4b45a4[_0x9168('0xa')]=_0x3cd31f[_0x9168('0xa')];utils[_0x9168('0xb')](_0x9168('0xc'),_0x4b45a4);}});}})[_0x9168('0x10')](function(_0x215f1b){utils[_0x9168('0x11')](util[_0x9168('0x12')](_0x9168('0x13'),_0x4b45a4[_0x9168('0x4')]),_0x215f1b);});}delete members[_0x4b45a4[_0x9168('0x5')]];}function startsWith(_0x2bf469,_0x1d15df){return _[_0x9168('0x14')](_0x2bf469,function(_0x5885cd){return _[_0x9168('0x15')](_0x1d15df,_0x5885cd);});}exports['devicestatechange']=function(_0x479fa8){try{utils[_0x9168('0x16')](util['format']('[%s][members][devicestatechange]',members[_0x479fa8['device']]?members[_0x479fa8[_0x9168('0x17')]]['uniqueid']:_0x479fa8[_0x9168('0x17')]),_0x479fa8);utils[_0x9168('0x18')](util[_0x9168('0x12')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x479fa8['device']]?members[_0x479fa8['device']]['uniqueid']:_0x479fa8[_0x9168('0x17')],_0x479fa8['state'],_0x479fa8['device']));switch(_0x479fa8[_0x9168('0x19')]){case _0x9168('0x1a'):case'BUSY':if(!startsWith(exclude,_0x479fa8[_0x9168('0x17')])){members[_0x479fa8[_0x9168('0x17')]]={'channel':_0x9168('0x1b'),'interface':_0x479fa8[_0x9168('0x17')],'type':'TALKING','enterAt':utils[_0x9168('0x1c')](),'role':_0x9168('0x1d')};}break;case _0x9168('0x1e'):if(!_[_0x9168('0x1f')](members[_0x479fa8['device']])){members[_0x479fa8[_0x9168('0x17')]]['exitAt']=utils[_0x9168('0x1c')]();members[_0x479fa8['device']][_0x9168('0x20')]=utils['diffTime'](members[_0x479fa8[_0x9168('0x17')]][_0x9168('0x21')],members[_0x479fa8[_0x9168('0x17')]][_0x9168('0x22')]);if(members[_0x479fa8[_0x9168('0x17')]]['uniqueid']){writeDB(members[_0x479fa8[_0x9168('0x17')]]);}}break;default:break;}}catch(_0x3e09ff){utils['error'](util[_0x9168('0x12')](_0x9168('0x23'),members[_0x479fa8[_0x9168('0x17')]]?members[_0x479fa8['device']][_0x9168('0x4')]:_0x479fa8[_0x9168('0x17')]),_0x3e09ff);}};exports[_0x9168('0x24')]=function(_0x57929d){try{if(!_[_0x9168('0x1f')](members[_0x57929d[_0x9168('0x5')]])){utils['debug'](util['format'](_0x9168('0x25'),_0x57929d['uniqueid']),_0x57929d);utils['info'](util['format'](_0x9168('0x26'),_0x57929d['uniqueid'],_0x57929d[_0x9168('0x5')],_0x57929d['queue']));members[_0x57929d['interface']]=_[_0x9168('0x27')](members[_0x57929d['interface']],{'data4':_0x57929d['queue'],'uniqueid':_0x57929d[_0x9168('0x4')]});}}catch(_0x4aa9cf){utils[_0x9168('0x11')](util[_0x9168('0x12')](_0x9168('0x25'),_0x57929d[_0x9168('0x4')]),_0x4aa9cf);}};exports[_0x9168('0x28')]=function(_0x43c5c6){try{utils[_0x9168('0x16')](util[_0x9168('0x12')]('[%s][members][cdr]',_0x43c5c6['uniqueid']),_0x43c5c6);if(_0x43c5c6['channel']){var _0xcd9213=_0x43c5c6[_0x9168('0x6')][_0x9168('0xe')]('-')[0x0];if(!_[_0x9168('0x1f')](members[_0xcd9213])){members[_0xcd9213]=_[_0x9168('0x27')](members[_0xcd9213],{'data1':members[_0xcd9213]['data1']||_0x43c5c6['type'],'data2':members[_0xcd9213][_0x9168('0x7')]||_0x43c5c6[_0x9168('0x29')],'data3':members[_0xcd9213]['data3']||_0x43c5c6[_0x9168('0x2a')],'uniqueid':members[_0xcd9213][_0x9168('0x4')]||_0x43c5c6['uniqueid']});utils['info'](util[_0x9168('0x12')](_0x9168('0x2b'),_0x43c5c6[_0x9168('0x4')],members[_0xcd9213]['data1'],members[_0xcd9213]['data2'],members[_0xcd9213][_0x9168('0x2c')]));if(members[_0xcd9213][_0x9168('0x21')]){writeDB(members[_0xcd9213]);}}}if(_0x43c5c6['destinationchannel']){var _0x2fbcbe=_0x43c5c6[_0x9168('0x2d')][_0x9168('0xe')]('-')[0x0];if(!_['isNil'](members[_0x2fbcbe])){members[_0x2fbcbe]=_['assign'](members[_0x2fbcbe],{'data1':members[_0x2fbcbe][_0x9168('0x2e')]||_0x43c5c6[_0x9168('0x2f')],'data2':members[_0x2fbcbe]['data2']||_0x43c5c6[_0x9168('0x29')],'data3':members[_0x2fbcbe][_0x9168('0x2c')]||_0x43c5c6[_0x9168('0x2a')],'uniqueid':members[_0x2fbcbe][_0x9168('0x4')]||_0x43c5c6['uniqueid']});utils[_0x9168('0x18')](util[_0x9168('0x12')](_0x9168('0x2b'),_0x43c5c6[_0x9168('0x4')],members[_0x2fbcbe][_0x9168('0x2e')],members[_0x2fbcbe][_0x9168('0x7')],members[_0x2fbcbe][_0x9168('0x2c')]));if(members[_0x2fbcbe][_0x9168('0x21')]){writeDB(members[_0x2fbcbe]);}}}}catch(_0xe4b4c4){utils[_0x9168('0x11')](util[_0x9168('0x12')]('[%s][members][cdr]',_0x43c5c6[_0x9168('0x4')]),_0xe4b4c4);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3815829..708923e 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 _0x3e5c=['secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','info','name','queuecallerenterreason','varset','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','queuecallercomplete','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x3a4938,_0x2d38bc){var _0x2ce7ca=function(_0x269969){while(--_0x269969){_0x3a4938['push'](_0x3a4938['shift']());}};_0x2ce7ca(++_0x2d38bc);}(_0x3e5c,0x70));var _0xc3e5=function(_0x5ca726,_0x5ee330){_0x5ca726=_0x5ca726-0x0;var _0x2c5c8a=_0x3e5c[_0x5ca726];return _0x2c5c8a;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var utils=require(_0xc3e5('0x2'));var queues={};function writeDB(_0x5e0240){utils['info'](util[_0xc3e5('0x3')](_0xc3e5('0x4'),_0x5e0240[_0xc3e5('0x5')],_0x5e0240[_0xc3e5('0x6')],_0x5e0240['queue'],_0x5e0240[_0xc3e5('0x7')],_0x5e0240[_0xc3e5('0x8')],_0x5e0240[_0xc3e5('0x9')],_0x5e0240[_0xc3e5('0xa')]));if(_0x5e0240['queue']){utils[_0xc3e5('0xb')](_0x5e0240[_0xc3e5('0xc')])['then'](function(_0x77b057){if(_0x77b057){_0x5e0240[_0xc3e5('0xd')]=_0x77b057[_0xc3e5('0xd')];}utils[_0xc3e5('0xe')](_0xc3e5('0xf'),_0x5e0240);});}else{utils[_0xc3e5('0xe')]('CreateVoiceQueueReport',_0x5e0240);}if(_0x5e0240[_0xc3e5('0x10')]){delete queues[_0x5e0240[_0xc3e5('0x10')]];}else{delete queues[_0x5e0240[_0xc3e5('0x5')]];}}exports[_0xc3e5('0x11')]=function(_0x8c50d7){try{utils['debug'](util[_0xc3e5('0x3')](_0xc3e5('0x12'),_0x8c50d7[_0xc3e5('0x5')]),_0x8c50d7);utils['info'](util[_0xc3e5('0x3')](_0xc3e5('0x13'),_0x8c50d7[_0xc3e5('0x5')],_0x8c50d7[_0xc3e5('0xc')],_0x8c50d7[_0xc3e5('0x14')]));queues[_0x8c50d7[_0xc3e5('0x5')]]=_[_0xc3e5('0x15')](_0x8c50d7,{'originalposition':_0x8c50d7[_0xc3e5('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x15f7e8){utils[_0xc3e5('0x16')](util[_0xc3e5('0x3')](_0xc3e5('0x12'),_0x8c50d7[_0xc3e5('0x5')]),_0x15f7e8);}};exports[_0xc3e5('0x17')]=function(_0x30b164){try{if(!_[_0xc3e5('0x18')](queues[_0x30b164[_0xc3e5('0x5')]])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x1a'),_0x30b164[_0xc3e5('0x5')]),_0x30b164);if(queues[_0x30b164[_0xc3e5('0x5')]]['queuecallerleaveAt']){if(!queues[_0x30b164[_0xc3e5('0x5')]]['queuecallerabandon']&&!queues[_0x30b164[_0xc3e5('0x5')]]['queuecallerexit']){queues[_0x30b164[_0xc3e5('0x5')]]['queuecallercomplete']=!![];queues[_0x30b164[_0xc3e5('0x5')]][_0xc3e5('0x1b')]=utils['now']();queues[_0x30b164[_0xc3e5('0x5')]][_0xc3e5('0xa')]='COMPLETEDBYAGENT';}utils['info'](util['format'](_0xc3e5('0x1c'),_0x30b164[_0xc3e5('0x5')],queues[_0x30b164[_0xc3e5('0x5')]]['name'],queues[_0x30b164['uniqueid']][_0xc3e5('0xa')]));writeDB(queues[_0x30b164[_0xc3e5('0x5')]]);}else if(queues[_0x30b164[_0xc3e5('0x5')]][_0xc3e5('0x10')]){utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x30b164['uniqueid'],queues[_0x30b164[_0xc3e5('0x5')]][_0xc3e5('0x1e')],queues[_0x30b164['uniqueid']]['transfereduniqueid']));queues[queues[_0x30b164[_0xc3e5('0x5')]]['transfereduniqueid']]=queues[_0x30b164['uniqueid']];queues[queues[_0x30b164[_0xc3e5('0x5')]]['transfereduniqueid']][_0xc3e5('0x1f')]=0x2;delete queues[_0x30b164[_0xc3e5('0x5')]];}}}catch(_0x3933e6){utils[_0xc3e5('0x16')](util['format']('[%s][queues][hangup]',_0x30b164[_0xc3e5('0x5')]),_0x3933e6);}};exports[_0xc3e5('0x20')]=function(_0x1c3ebd){try{utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')]('[%s][queues][varset]',_0x1c3ebd[_0xc3e5('0x5')]),_0x1c3ebd);if(!_[_0xc3e5('0x18')](_0x1c3ebd['variable'][_0xc3e5('0x21')])&&_0x1c3ebd['value'][_0xc3e5('0x22')]()!==_0xc3e5('0x23')){if(!_[_0xc3e5('0x18')](queues[_0x1c3ebd[_0xc3e5('0x5')]])){queues[_0x1c3ebd['uniqueid']][_0xc3e5('0x24')]=![];queues[_0x1c3ebd['uniqueid']][_0xc3e5('0x25')]=null;queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x26')]=!![];queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x27')]=utils[_0xc3e5('0x28')]();queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0xa')]=_0x1c3ebd['value']['toUpperCase']();utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x29'),_0x1c3ebd['uniqueid'],queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x1e')],_0x1c3ebd[_0xc3e5('0x2a')],queues[_0x1c3ebd[_0xc3e5('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1c3ebd[_0xc3e5('0x5')]]);}}else if(!_['isNil'](_0x1c3ebd[_0xc3e5('0x2b')][_0xc3e5('0x2c')])){if(!_[_0xc3e5('0x18')](queues[_0x1c3ebd[_0xc3e5('0x5')]])&&!queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x24')]){queues[_0x1c3ebd[_0xc3e5('0x5')]]['queuecallerabandon']=![];queues[_0x1c3ebd['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x26')]=!![];queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x27')]=utils['now']();queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0xa')]=_0xc3e5('0x2d');utils[_0xc3e5('0x1d')](util['format'](_0xc3e5('0x2e'),_0x1c3ebd['uniqueid'],queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0x1e')],_0x1c3ebd['value'],queues[_0x1c3ebd[_0xc3e5('0x5')]][_0xc3e5('0xa')]));}}}catch(_0x11d2a8){utils['error'](util['format'](_0xc3e5('0x2f'),_0x1c3ebd[_0xc3e5('0x5')]),_0x11d2a8);}};exports[_0xc3e5('0x24')]=function(_0x30b871){try{if(!_[_0xc3e5('0x18')](queues[_0x30b871[_0xc3e5('0x5')]])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')]('[%s][queues][queuecallerabandon]',_0x30b871[_0xc3e5('0x5')]),_0x30b871);queues[_0x30b871[_0xc3e5('0x5')]]['queuecallerexit']=![];queues[_0x30b871['uniqueid']][_0xc3e5('0x27')]=null;queues[_0x30b871[_0xc3e5('0x5')]][_0xc3e5('0x24')]=!![];queues[_0x30b871[_0xc3e5('0x5')]][_0xc3e5('0x25')]=utils[_0xc3e5('0x28')]();queues[_0x30b871['uniqueid']][_0xc3e5('0xa')]='ABANDONED';utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x30'),_0x30b871[_0xc3e5('0x5')],queues[_0x30b871['uniqueid']][_0xc3e5('0x1e')],queues[_0x30b871[_0xc3e5('0x5')]]['queuecallerexitreason']));}}catch(_0x47509b){utils[_0xc3e5('0x16')](util['format'](_0xc3e5('0x31'),_0x30b871[_0xc3e5('0x5')]),_0x47509b);}};exports['queuecallerleave']=function(_0x4745f5){try{if(!_[_0xc3e5('0x18')](queues[_0x4745f5['uniqueid']])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x32'),_0x4745f5[_0xc3e5('0x5')]),_0x4745f5);utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x33'),_0x4745f5[_0xc3e5('0x5')],queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x1e')],_0x4745f5[_0xc3e5('0x34')],_0x4745f5['connectedlinename']));queues[_0x4745f5['uniqueid']][_0xc3e5('0x35')]=!![];queues[_0x4745f5[_0xc3e5('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x4745f5['uniqueid']][_0xc3e5('0x36')]=utils['diffTime'](queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x37')],queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x38')]);queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x14')]=_0x4745f5['position'];queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x39')]=_0x4745f5[_0xc3e5('0x39')];queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x34')]=_0x4745f5[_0xc3e5('0x34')];queues[_0x4745f5[_0xc3e5('0x5')]][_0xc3e5('0x3a')]=_0x4745f5[_0xc3e5('0x3a')];}}catch(_0x478520){utils[_0xc3e5('0x16')](util['format'](_0xc3e5('0x32'),_0x4745f5[_0xc3e5('0x5')]),_0x478520);}};exports['agentconnect']=function(_0x443ad1){try{if(!_['isNil'](queues[_0x443ad1[_0xc3e5('0x5')]])){utils['debug'](util[_0xc3e5('0x3')](_0xc3e5('0x3b'),_0x443ad1[_0xc3e5('0x5')]),_0x443ad1);utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x443ad1[_0xc3e5('0x5')],queues[_0x443ad1[_0xc3e5('0x5')]]['name'],_0x443ad1['membername'],_0x443ad1[_0xc3e5('0x3c')]));queues[_0x443ad1['uniqueid']][_0xc3e5('0x24')]=![];queues[_0x443ad1['uniqueid']][_0xc3e5('0x24')]=![];queues[_0x443ad1['uniqueid']][_0xc3e5('0x25')]=null;queues[_0x443ad1[_0xc3e5('0x5')]][_0xc3e5('0x26')]=![];queues[_0x443ad1[_0xc3e5('0x5')]]['queuecallerexitreason']=null;queues[_0x443ad1[_0xc3e5('0x5')]]['queuecallerexitAt']=null;queues[_0x443ad1[_0xc3e5('0x5')]][_0xc3e5('0x3d')]=!![];queues[_0x443ad1[_0xc3e5('0x5')]]['accountcode']=_0x443ad1['destaccountcode'];queues[_0x443ad1[_0xc3e5('0x5')]][_0xc3e5('0x7')]=_0x443ad1[_0xc3e5('0x3e')];}}catch(_0xed8caf){utils['error'](util['format'](_0xc3e5('0x3b'),_0x443ad1[_0xc3e5('0x5')]),_0xed8caf);}};exports[_0xc3e5('0x3f')]=function(_0x3ec9ad){try{if(!_[_0xc3e5('0x18')](queues[_0x3ec9ad['uniqueid']])){if(queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x37')]){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')]('[%s][queues][agentcomplete]',_0x3ec9ad[_0xc3e5('0x5')]),_0x3ec9ad);queues[_0x3ec9ad['uniqueid']][_0xc3e5('0x24')]=![];queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x24')]=![];queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x25')]=null;queues[_0x3ec9ad['uniqueid']][_0xc3e5('0x26')]=![];queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x27')]=null;queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x3d')]=!![];queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x7')]=_0x3ec9ad[_0xc3e5('0x3e')];queues[_0x3ec9ad['uniqueid']][_0xc3e5('0x40')]=!![];queues[_0x3ec9ad['uniqueid']]['queuecallercompleteAt']=utils[_0xc3e5('0x28')]();if(_0x3ec9ad['reason']==_0xc3e5('0x41')){if(!queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x41')]){queues[_0x3ec9ad['uniqueid']][_0xc3e5('0xa')]=_0xc3e5('0x42');}}else{queues[_0x3ec9ad[_0xc3e5('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x3ec9ad[_0xc3e5('0x43')][_0xc3e5('0x22')]();}utils[_0xc3e5('0x1d')](util['format'](_0xc3e5('0x44'),_0x3ec9ad[_0xc3e5('0x5')],queues[_0x3ec9ad[_0xc3e5('0x5')]][_0xc3e5('0x1e')],_0x3ec9ad[_0xc3e5('0x3e')],queues[_0x3ec9ad[_0xc3e5('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x3ec9ad[_0xc3e5('0x5')]]);}}}catch(_0x49f327){utils[_0xc3e5('0x16')](util['format'](_0xc3e5('0x45'),_0x3ec9ad[_0xc3e5('0x5')]),_0x49f327);}};exports['blindtransfer']=function(_0x2df337){try{if(!_['isNil'](queues[_0x2df337[_0xc3e5('0x46')]])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x47'),_0x2df337[_0xc3e5('0x5')]),_0x2df337);queues[_0x2df337[_0xc3e5('0x46')]][_0xc3e5('0x41')]=!![];queues[_0x2df337['transfereeuniqueid']][_0xc3e5('0x48')]='BLIND';queues[_0x2df337['transfereeuniqueid']][_0xc3e5('0x49')]=_0x2df337[_0xc3e5('0x4a')];queues[_0x2df337[_0xc3e5('0x46')]][_0xc3e5('0x4b')]=_0x2df337[_0xc3e5('0x46')];queues[_0x2df337[_0xc3e5('0x46')]][_0xc3e5('0xa')]=_0xc3e5('0x4c');utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x2df337[_0xc3e5('0x5')],queues[_0x2df337[_0xc3e5('0x46')]][_0xc3e5('0x1e')],_0x2df337['transfereeuniqueid'],_0x2df337[_0xc3e5('0x4a')]));}}catch(_0x2e7291){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x2df337[_0xc3e5('0x5')]),_0x2e7291);}};exports[_0xc3e5('0x4d')]=function(_0x1a6acf){try{utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x4e'),_0x1a6acf[_0xc3e5('0x4f')]),_0x1a6acf);if(_0x1a6acf[_0xc3e5('0x4f')]==_0x1a6acf[_0xc3e5('0x50')]){if(!_['isNil'](queues[_0x1a6acf[_0xc3e5('0x51')]])){utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x52'),_0x1a6acf['origtransfereruniqueid'],queues[_0x1a6acf['secondtransfererlinkedid']][_0xc3e5('0x1e')],_0x1a6acf[_0xc3e5('0x53')]));queues[_0x1a6acf['secondtransfererlinkedid']][_0xc3e5('0x41')]=!![];queues[_0x1a6acf['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x1a6acf[_0xc3e5('0x51')]][_0xc3e5('0x49')]=_0x1a6acf[_0xc3e5('0x53')];queues[_0x1a6acf[_0xc3e5('0x51')]][_0xc3e5('0x4b')]=_0x1a6acf['origtransfereruniqueid'];queues[_0x1a6acf[_0xc3e5('0x51')]][_0xc3e5('0xa')]=_0xc3e5('0x54');}if(!_[_0xc3e5('0x18')](queues[_0x1a6acf[_0xc3e5('0x50')]])){if(_0x1a6acf['transfereelinkedid']&&queues[_0x1a6acf['transfereelinkedid']]){queues[_0x1a6acf[_0xc3e5('0x55')]][_0xc3e5('0x1f')]=0x1;queues[_0x1a6acf[_0xc3e5('0x46')]]=_[_0xc3e5('0x56')](queues[_0x1a6acf[_0xc3e5('0x55')]]);queues[_0x1a6acf['transfereeuniqueid']][_0xc3e5('0x10')]=_0x1a6acf[_0xc3e5('0x57')];queues[_0x1a6acf[_0xc3e5('0x46')]][_0xc3e5('0x1f')]=0x2;queues[_0x1a6acf[_0xc3e5('0x46')]][_0xc3e5('0x8')]=queues[_0x1a6acf['secondtransfererlinkedid']][_0xc3e5('0x8')];queues[_0x1a6acf[_0xc3e5('0x46')]]['calleridname']=queues[_0x1a6acf[_0xc3e5('0x51')]][_0xc3e5('0x58')];queues[_0x1a6acf[_0xc3e5('0x46')]][_0xc3e5('0x38')]=utils[_0xc3e5('0x28')]();queues[_0x1a6acf['transfereeuniqueid']][_0xc3e5('0x37')]=utils[_0xc3e5('0x28')]();queues[_0x1a6acf['transfereeuniqueid']][_0xc3e5('0x36')]=0x0;queues[_0x1a6acf[_0xc3e5('0x46')]][_0xc3e5('0x59')]=0x0;utils['info'](util[_0xc3e5('0x3')](_0xc3e5('0x5a'),_0x1a6acf[_0xc3e5('0x4f')],queues[_0x1a6acf['transfereeuniqueid']][_0xc3e5('0x1e')],queues[_0x1a6acf['transfereeuniqueid']]['calleridnum'],queues[_0x1a6acf[_0xc3e5('0x46')]][_0xc3e5('0x58')]));}else{utils['info'](util[_0xc3e5('0x3')](_0xc3e5('0x5b'),_0x1a6acf[_0xc3e5('0x4f')],queues[_0x1a6acf[_0xc3e5('0x50')]][_0xc3e5('0x1e')],_0x1a6acf[_0xc3e5('0x51')]));queues[_0x1a6acf['origtransfererlinkedid']][_0xc3e5('0x10')]=_0x1a6acf[_0xc3e5('0x51')];}}}else if(_0x1a6acf[_0xc3e5('0x5c')]==_0x1a6acf['secondtransfererlinkedid']){if(!_[_0xc3e5('0x18')](queues[_0x1a6acf[_0xc3e5('0x50')]])){utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x5d'),_0x1a6acf[_0xc3e5('0x4f')],queues[_0x1a6acf['origtransfererlinkedid']][_0xc3e5('0x1e')],_0x1a6acf['secondtransfereruniqueid'],_0x1a6acf[_0xc3e5('0x5e')]));queues[_0x1a6acf['origtransfererlinkedid']]['transfer']=!![];queues[_0x1a6acf[_0xc3e5('0x50')]][_0xc3e5('0x48')]='ATTENDED';queues[_0x1a6acf[_0xc3e5('0x50')]][_0xc3e5('0x49')]=_0x1a6acf[_0xc3e5('0x5e')];queues[_0x1a6acf[_0xc3e5('0x50')]][_0xc3e5('0x4b')]=_0x1a6acf[_0xc3e5('0x5c')];queues[_0x1a6acf[_0xc3e5('0x50')]]['queuecallerexitreason']=_0xc3e5('0x54');}if(!_[_0xc3e5('0x18')](queues[_0x1a6acf[_0xc3e5('0x51')]])){if(_0x1a6acf[_0xc3e5('0x5f')]&&queues[_0x1a6acf[_0xc3e5('0x5f')]]){queues[_0x1a6acf['transfertargetlinkedid']][_0xc3e5('0x1f')]=0x1;queues[_0x1a6acf[_0xc3e5('0x57')]]=_[_0xc3e5('0x56')](queues[_0x1a6acf[_0xc3e5('0x5f')]]);queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x10')]=_0x1a6acf['transfertargetuniqueid'];queues[_0x1a6acf[_0xc3e5('0x57')]]['queuecallerenterreason']=0x2;queues[_0x1a6acf['transfertargetuniqueid']][_0xc3e5('0x8')]=queues[_0x1a6acf[_0xc3e5('0x50')]][_0xc3e5('0x8')];queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x58')]=queues[_0x1a6acf['origtransfererlinkedid']][_0xc3e5('0x58')];queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x38')]=utils[_0xc3e5('0x28')]();queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x37')]=utils['now']();queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x36')]=0x0;queues[_0x1a6acf[_0xc3e5('0x57')]]['mohtime']=0x0;utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1a6acf[_0xc3e5('0x4f')],queues[_0x1a6acf['transfertargetuniqueid']][_0xc3e5('0x1e')],queues[_0x1a6acf['transfertargetuniqueid']][_0xc3e5('0x10')],queues[_0x1a6acf[_0xc3e5('0x57')]][_0xc3e5('0x8')],queues[_0x1a6acf['transfertargetuniqueid']][_0xc3e5('0x58')]));}else{utils['info'](util[_0xc3e5('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1a6acf[_0xc3e5('0x4f')],queues[_0x1a6acf[_0xc3e5('0x51')]]['name'],_0x1a6acf[_0xc3e5('0x50')]));queues[_0x1a6acf[_0xc3e5('0x51')]][_0xc3e5('0x10')]=_0x1a6acf[_0xc3e5('0x50')];}}}}catch(_0x153f7d){utils[_0xc3e5('0x16')](util[_0xc3e5('0x3')](_0xc3e5('0x4e'),_0x1a6acf['origtransfereruniqueid']),_0x153f7d);}};exports[_0xc3e5('0x60')]=function(_0x1cda02){try{if(!_[_0xc3e5('0x18')](queues[_0x1cda02['uniqueid']])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x61'),_0x1cda02['uniqueid']),_0x1cda02);queues[_0x1cda02[_0xc3e5('0x5')]][_0xc3e5('0x62')]=utils[_0xc3e5('0x28')]();utils[_0xc3e5('0x1d')](util[_0xc3e5('0x3')](_0xc3e5('0x63'),_0x1cda02['uniqueid'],queues[_0x1cda02['uniqueid']][_0xc3e5('0x1e')],queues[_0x1cda02[_0xc3e5('0x5')]][_0xc3e5('0x62')]));}}catch(_0x12b2a1){utils[_0xc3e5('0x16')](util[_0xc3e5('0x3')](_0xc3e5('0x61'),_0x1cda02[_0xc3e5('0x5')]),_0x12b2a1);}};exports[_0xc3e5('0x64')]=function(_0x10bcf6){try{if(!_['isNil'](queues[_0x10bcf6[_0xc3e5('0x5')]])){if(!_[_0xc3e5('0x18')](queues[_0x10bcf6[_0xc3e5('0x5')]][_0xc3e5('0x62')])){utils[_0xc3e5('0x19')](util[_0xc3e5('0x3')](_0xc3e5('0x65'),_0x10bcf6['uniqueid']),_0x10bcf6);queues[_0x10bcf6['uniqueid']][_0xc3e5('0x59')]+=utils[_0xc3e5('0x66')](utils[_0xc3e5('0x28')](),queues[_0x10bcf6[_0xc3e5('0x5')]][_0xc3e5('0x62')]);utils['info'](util[_0xc3e5('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x10bcf6[_0xc3e5('0x5')],queues[_0x10bcf6[_0xc3e5('0x5')]]['name'],queues[_0x10bcf6[_0xc3e5('0x5')]][_0xc3e5('0x59')]));delete queues[_0x10bcf6[_0xc3e5('0x5')]][_0xc3e5('0x62')];}}}catch(_0x425d34){utils['error'](util[_0xc3e5('0x3')](_0xc3e5('0x65'),_0x10bcf6[_0xc3e5('0x5')]),_0x425d34);}}; \ No newline at end of file +var _0x8ca3=['[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','count'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x8ca3,0x15d));var _0x38ca=function(_0x3130b5,_0x23faf7){_0x3130b5=_0x3130b5-0x0;var _0xa6d8a3=_0x8ca3[_0x3130b5];return _0xa6d8a3;};'use strict';var _=require(_0x38ca('0x0'));var util=require(_0x38ca('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1f661f){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x4'),_0x1f661f[_0x38ca('0x5')],_0x1f661f[_0x38ca('0x6')],_0x1f661f[_0x38ca('0x7')],_0x1f661f[_0x38ca('0x8')],_0x1f661f[_0x38ca('0x9')],_0x1f661f['accountcode'],_0x1f661f['queuecallerexitreason']));if(_0x1f661f[_0x38ca('0x7')]){utils[_0x38ca('0xa')](_0x1f661f[_0x38ca('0x7')])[_0x38ca('0xb')](function(_0x15547a){if(_0x15547a){_0x1f661f[_0x38ca('0xc')]=_0x15547a[_0x38ca('0xc')];}utils['request'](_0x38ca('0xd'),_0x1f661f);});}else{utils[_0x38ca('0xe')](_0x38ca('0xd'),_0x1f661f);}if(_0x1f661f['transfereduniqueid']){delete queues[_0x1f661f[_0x38ca('0xf')]];}else{delete queues[_0x1f661f[_0x38ca('0x5')]];}}exports[_0x38ca('0x10')]=function(_0x1c3632){try{utils['debug'](util[_0x38ca('0x3')]('[%s][queues][queuecallerjoin]',_0x1c3632[_0x38ca('0x5')]),_0x1c3632);utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x11'),_0x1c3632[_0x38ca('0x5')],_0x1c3632[_0x38ca('0x7')],_0x1c3632[_0x38ca('0x12')]));queues[_0x1c3632[_0x38ca('0x5')]]=_[_0x38ca('0x13')](_0x1c3632,{'originalposition':_0x1c3632[_0x38ca('0x12')],'queuecallerjoinAt':utils[_0x38ca('0x14')](),'mohtime':0x0});}catch(_0x93088b){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x16'),_0x1c3632['uniqueid']),_0x93088b);}};exports[_0x38ca('0x17')]=function(_0x194b5c){try{if(!_['isNil'](queues[_0x194b5c['uniqueid']])){utils['debug'](util[_0x38ca('0x3')](_0x38ca('0x18'),_0x194b5c[_0x38ca('0x5')]),_0x194b5c);if(queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x19')]){if(!queues[_0x194b5c['uniqueid']][_0x38ca('0x1a')]&&!queues[_0x194b5c[_0x38ca('0x5')]]['queuecallerexit']){queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1b')]=!![];queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1c')]=utils[_0x38ca('0x14')]();queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1d')]='COMPLETEDBYAGENT';}utils[_0x38ca('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x194b5c[_0x38ca('0x5')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1d')]));writeDB(queues[_0x194b5c[_0x38ca('0x5')]]);}else if(queues[_0x194b5c['uniqueid']][_0x38ca('0xf')]){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x1f'),_0x194b5c[_0x38ca('0x5')],queues[_0x194b5c['uniqueid']][_0x38ca('0x1e')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]));queues[queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]]=queues[_0x194b5c[_0x38ca('0x5')]];queues[queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]][_0x38ca('0x20')]=0x2;delete queues[_0x194b5c[_0x38ca('0x5')]];}}}catch(_0xc181dd){utils['error'](util['format'](_0x38ca('0x18'),_0x194b5c[_0x38ca('0x5')]),_0xc181dd);}};exports[_0x38ca('0x21')]=function(_0x110278){try{utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x23'),_0x110278[_0x38ca('0x5')]),_0x110278);if(!_[_0x38ca('0x24')](_0x110278['variable'][_0x38ca('0x25')])&&_0x110278[_0x38ca('0x26')][_0x38ca('0x27')]()!==_0x38ca('0x28')){if(!_['isNil'](queues[_0x110278[_0x38ca('0x5')]])){queues[_0x110278[_0x38ca('0x5')]]['queuecallerabandon']=![];queues[_0x110278['uniqueid']][_0x38ca('0x29')]=null;queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2a')]=!![];queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2b')]=utils[_0x38ca('0x14')]();queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitreason']=_0x110278['value'][_0x38ca('0x27')]();utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x2c'),_0x110278[_0x38ca('0x5')],queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x110278['value'],queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x110278[_0x38ca('0x5')]]);}}else if(!_[_0x38ca('0x24')](_0x110278['variable'][_0x38ca('0x2d')])){if(!_[_0x38ca('0x24')](queues[_0x110278[_0x38ca('0x5')]])&&!queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1a')]){queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x110278[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2a')]=!![];queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitAt']=utils[_0x38ca('0x14')]();queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x2e');utils[_0x38ca('0x2')](util[_0x38ca('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x110278[_0x38ca('0x5')],queues[_0x110278['uniqueid']][_0x38ca('0x1e')],_0x110278[_0x38ca('0x26')],queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1d')]));}}}catch(_0x113a0b){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x23'),_0x110278[_0x38ca('0x5')]),_0x113a0b);}};exports[_0x38ca('0x1a')]=function(_0x2f18b5){try{if(!_[_0x38ca('0x24')](queues[_0x2f18b5[_0x38ca('0x5')]])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')]('[%s][queues][queuecallerabandon]',_0x2f18b5[_0x38ca('0x5')]),_0x2f18b5);queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerexit']=![];queues[_0x2f18b5['uniqueid']][_0x38ca('0x2b')]=null;queues[_0x2f18b5['uniqueid']][_0x38ca('0x1a')]=!![];queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerabandonAt']=utils['now']();queues[_0x2f18b5[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x2f');utils[_0x38ca('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2f18b5['uniqueid'],queues[_0x2f18b5[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerexitreason']));}}catch(_0x1e9a9f){utils[_0x38ca('0x15')](util[_0x38ca('0x3')]('[%s][queues][queuecallerabandon]',_0x2f18b5[_0x38ca('0x5')]),_0x1e9a9f);}};exports['queuecallerleave']=function(_0x33b1c0){try{if(!_[_0x38ca('0x24')](queues[_0x33b1c0['uniqueid']])){utils[_0x38ca('0x22')](util['format']('[%s][queues][queuecallerleave]',_0x33b1c0[_0x38ca('0x5')]),_0x33b1c0);utils['info'](util[_0x38ca('0x3')](_0x38ca('0x30'),_0x33b1c0[_0x38ca('0x5')],queues[_0x33b1c0['uniqueid']][_0x38ca('0x1e')],_0x33b1c0[_0x38ca('0x31')],_0x33b1c0[_0x38ca('0x32')]));queues[_0x33b1c0['uniqueid']][_0x38ca('0x33')]=!![];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x19')]=utils[_0x38ca('0x14')]();queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x34')]=utils[_0x38ca('0x35')](queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x19')],queues[_0x33b1c0[_0x38ca('0x5')]]['queuecallerjoinAt']);queues[_0x33b1c0['uniqueid']][_0x38ca('0x12')]=_0x33b1c0[_0x38ca('0x12')];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x36')]=_0x33b1c0['count'];queues[_0x33b1c0['uniqueid']][_0x38ca('0x31')]=_0x33b1c0[_0x38ca('0x31')];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x32')]=_0x33b1c0['connectedlinename'];}}catch(_0x42b387){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x37'),_0x33b1c0['uniqueid']),_0x42b387);}};exports[_0x38ca('0x38')]=function(_0x2d23fc){try{if(!_[_0x38ca('0x24')](queues[_0x2d23fc[_0x38ca('0x5')]])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x39'),_0x2d23fc[_0x38ca('0x5')]),_0x2d23fc);utils[_0x38ca('0x2')](util['format'](_0x38ca('0x3a'),_0x2d23fc[_0x38ca('0x5')],queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x2d23fc[_0x38ca('0x3b')],_0x2d23fc['destaccountcode']));queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerabandon']=![];queues[_0x2d23fc['uniqueid']][_0x38ca('0x1a')]=![];queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x2a')]=![];queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerexitreason']=null;queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerexitAt']=null;queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x3c')]=!![];queues[_0x2d23fc['uniqueid']]['accountcode']=_0x2d23fc[_0x38ca('0x3d')];queues[_0x2d23fc[_0x38ca('0x5')]]['lastAssignedTo']=_0x2d23fc['membername'];}}catch(_0x3c9bc5){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x39'),_0x2d23fc['uniqueid']),_0x3c9bc5);}};exports['agentcomplete']=function(_0x43662b){try{if(!_[_0x38ca('0x24')](queues[_0x43662b[_0x38ca('0x5')]])){if(queues[_0x43662b['uniqueid']][_0x38ca('0x19')]){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x3e'),_0x43662b[_0x38ca('0x5')]),_0x43662b);queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x43662b[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x43662b['uniqueid']][_0x38ca('0x2a')]=![];queues[_0x43662b['uniqueid']][_0x38ca('0x2b')]=null;queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x3c')]=!![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x8')]=_0x43662b[_0x38ca('0x3b')];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1b')]=!![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1c')]=utils[_0x38ca('0x14')]();if(_0x43662b['reason']==_0x38ca('0x3f')){if(!queues[_0x43662b['uniqueid']]['transfer']){queues[_0x43662b[_0x38ca('0x5')]]['queuecallerexitreason']=_0x38ca('0x40');}}else{queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x41')+_0x43662b[_0x38ca('0x42')]['toUpperCase']();}utils[_0x38ca('0x2')](util['format'](_0x38ca('0x43'),_0x43662b[_0x38ca('0x5')],queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x43662b[_0x38ca('0x3b')],queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1d')]));writeDB(queues[_0x43662b[_0x38ca('0x5')]]);}}}catch(_0x429eb6){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x3e'),_0x43662b[_0x38ca('0x5')]),_0x429eb6);}};exports[_0x38ca('0x44')]=function(_0x2097df){try{if(!_[_0x38ca('0x24')](queues[_0x2097df[_0x38ca('0x45')]])){utils[_0x38ca('0x22')](util['format']('[%s][queues][blindtransfer]',_0x2097df[_0x38ca('0x5')]),_0x2097df);queues[_0x2097df[_0x38ca('0x45')]]['transfer']=!![];queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x46')]=_0x38ca('0x47');queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x48')]=_0x2097df['extension'];queues[_0x2097df[_0x38ca('0x45')]][_0x38ca('0x49')]=_0x2097df['transfereeuniqueid'];queues[_0x2097df[_0x38ca('0x45')]][_0x38ca('0x1d')]=_0x38ca('0x4a');utils[_0x38ca('0x2')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x2097df['uniqueid'],queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x1e')],_0x2097df['transfereeuniqueid'],_0x2097df[_0x38ca('0x4b')]));}}catch(_0x36b016){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x4c'),_0x2097df['uniqueid']),_0x36b016);}};exports[_0x38ca('0x4d')]=function(_0x57f955){try{utils['debug'](util[_0x38ca('0x3')](_0x38ca('0x4e'),_0x57f955[_0x38ca('0x4f')]),_0x57f955);if(_0x57f955[_0x38ca('0x4f')]==_0x57f955[_0x38ca('0x50')]){if(!_['isNil'](queues[_0x57f955['secondtransfererlinkedid']])){utils[_0x38ca('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x51')]][_0x38ca('0x1e')],_0x57f955['origtransfererexten']));queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x3f')]=!![];queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x46')]=_0x38ca('0x52');queues[_0x57f955['secondtransfererlinkedid']]['transferexten']=_0x57f955[_0x38ca('0x53')];queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x49')]=_0x57f955[_0x38ca('0x4f')];queues[_0x57f955[_0x38ca('0x51')]][_0x38ca('0x1d')]=_0x38ca('0x54');}if(!_[_0x38ca('0x24')](queues[_0x57f955['origtransfererlinkedid']])){if(_0x57f955[_0x38ca('0x55')]&&queues[_0x57f955[_0x38ca('0x55')]]){queues[_0x57f955[_0x38ca('0x55')]][_0x38ca('0x20')]=0x1;queues[_0x57f955[_0x38ca('0x45')]]=_['clone'](queues[_0x57f955[_0x38ca('0x55')]]);queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x56')];queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x20')]=0x2;queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x9')]=queues[_0x57f955[_0x38ca('0x51')]]['calleridnum'];queues[_0x57f955[_0x38ca('0x45')]]['calleridname']=queues[_0x57f955[_0x38ca('0x51')]]['calleridname'];queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x57')]=utils[_0x38ca('0x14')]();queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x19')]=utils[_0x38ca('0x14')]();queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x34')]=0x0;queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x58')]=0x0;utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x59'),_0x57f955['origtransfereruniqueid'],queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x1e')],queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x9')],queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x5a')]));}else{utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5b'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x1e')],_0x57f955[_0x38ca('0x51')]));queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x51')];}}}else if(_0x57f955[_0x38ca('0x5c')]==_0x57f955[_0x38ca('0x51')]){if(!_[_0x38ca('0x24')](queues[_0x57f955[_0x38ca('0x50')]])){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5d'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x50')]]['name'],_0x57f955[_0x38ca('0x5c')],_0x57f955[_0x38ca('0x5e')]));queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x3f')]=!![];queues[_0x57f955['origtransfererlinkedid']]['transfertype']=_0x38ca('0x52');queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x48')]=_0x57f955[_0x38ca('0x5e')];queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x49')]=_0x57f955[_0x38ca('0x5c')];queues[_0x57f955[_0x38ca('0x50')]]['queuecallerexitreason']=_0x38ca('0x54');}if(!_[_0x38ca('0x24')](queues[_0x57f955[_0x38ca('0x51')]])){if(_0x57f955[_0x38ca('0x5f')]&&queues[_0x57f955[_0x38ca('0x5f')]]){queues[_0x57f955['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x57f955[_0x38ca('0x56')]]=_[_0x38ca('0x60')](queues[_0x57f955['transfertargetlinkedid']]);queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x56')];queues[_0x57f955[_0x38ca('0x56')]]['queuecallerenterreason']=0x2;queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x9')]=queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x9')];queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x5a')]=queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x5a')];queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x57')]=utils[_0x38ca('0x14')]();queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0x19')]=utils['now']();queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x34')]=0x0;queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x58')]=0x0;utils['info'](util[_0x38ca('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x1e')],queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0xf')],queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x9')],queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0x5a')]));}else{utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5b'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x51')]]['name'],_0x57f955[_0x38ca('0x50')]));queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x50')];}}}}catch(_0x50dcb1){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x4e'),_0x57f955[_0x38ca('0x4f')]),_0x50dcb1);}};exports['musiconholdstart']=function(_0x2e4e37){try{if(!_[_0x38ca('0x24')](queues[_0x2e4e37[_0x38ca('0x5')]])){utils['debug'](util['format'](_0x38ca('0x61'),_0x2e4e37[_0x38ca('0x5')]),_0x2e4e37);queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x62')]=utils[_0x38ca('0x14')]();utils[_0x38ca('0x2')](util[_0x38ca('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2e4e37[_0x38ca('0x5')],queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x62')]));}}catch(_0x43961f){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x61'),_0x2e4e37[_0x38ca('0x5')]),_0x43961f);}};exports[_0x38ca('0x63')]=function(_0x454573){try{if(!_[_0x38ca('0x24')](queues[_0x454573[_0x38ca('0x5')]])){if(!_[_0x38ca('0x24')](queues[_0x454573[_0x38ca('0x5')]]['musiconholdstartAt'])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x64'),_0x454573[_0x38ca('0x5')]),_0x454573);queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x58')]+=utils[_0x38ca('0x35')](utils[_0x38ca('0x14')](),queues[_0x454573['uniqueid']]['musiconholdstartAt']);utils[_0x38ca('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x454573[_0x38ca('0x5')],queues[_0x454573[_0x38ca('0x5')]]['name'],queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x58')]));delete queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x62')];}}}catch(_0x121d01){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x64'),_0x454573[_0x38ca('0x5')]),_0x121d01);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 429fdc6..1c29016 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 _0x3937=['request','CreateVoiceRecording','debug','format','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','application','toLowerCase','startsWith','appdata','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','util','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','getUserByInternal','accountcode','then','membername','name','UserId'];(function(_0x5c338d,_0x2c9274){var _0x28f8f5=function(_0x3b0562){while(--_0x3b0562){_0x5c338d['push'](_0x5c338d['shift']());}};_0x28f8f5(++_0x2c9274);}(_0x3937,0xc2));var _0x7393=function(_0x59bf43,_0x545ba8){_0x59bf43=_0x59bf43-0x0;var _0x236cd9=_0x3937[_0x59bf43];return _0x236cd9;};'use strict';var _=require('lodash');var util=require(_0x7393('0x0'));var utils=require('./utils');var transfers=require(_0x7393('0x1'));var recordings={};function writeDB(_0x42010a){var _0x5d68b5;utils[_0x7393('0x2')](util['format'](_0x7393('0x3'),_0x42010a['uniqueid']));if(transfers[_0x7393('0x4')][_0x42010a[_0x7393('0x5')]]){_0x5d68b5=_0x42010a[_0x7393('0x5')];_0x42010a['uniqueid']=transfers[_0x7393('0x4')][_0x42010a['uniqueid']][_0x7393('0x6')];}if(_0x42010a['accountcode']){utils[_0x7393('0x7')](_0x42010a[_0x7393('0x8')])[_0x7393('0x9')](function(_0x5ec89a){if(_0x5ec89a){_0x42010a[_0x7393('0xa')]=_0x5ec89a[_0x7393('0xb')];_0x42010a[_0x7393('0xc')]=_0x5ec89a['id'];}utils[_0x7393('0xd')](_0x7393('0xe'),_0x42010a);});}else{utils[_0x7393('0xd')](_0x7393('0xe'),_0x42010a);}if(_0x5d68b5)delete transfers[_0x7393('0x4')][_0x5d68b5];}exports['newchannel']=function(_0x79df3a){try{utils[_0x7393('0xf')](util[_0x7393('0x10')](_0x7393('0x11'),_0x79df3a[_0x7393('0x5')]),_0x79df3a);if(_0x79df3a[_0x7393('0x5')]==_0x79df3a['linkedid']){utils[_0x7393('0x2')](util[_0x7393('0x10')](_0x7393('0x12'),_0x79df3a[_0x7393('0x5')],_0x79df3a[_0x7393('0x13')],_0x79df3a[_0x7393('0x14')]));recordings[_0x79df3a[_0x7393('0x5')]]={'uniqueid':_0x79df3a[_0x7393('0x5')],'accountcode':_0x79df3a[_0x7393('0x8')],'exten':_0x79df3a[_0x7393('0x14')],'context':_0x79df3a[_0x7393('0x13')],'channel':_0x79df3a['channel'],'monitors':[]};}}catch(_0x21d50f){utils[_0x7393('0x15')](util['format'](_0x7393('0x11'),_0x79df3a[_0x7393('0x5')]),_0x21d50f);}};exports[_0x7393('0x16')]=function(_0x50c05a){try{utils[_0x7393('0xf')](util[_0x7393('0x10')]('[%s][recordings][newstate]',_0x50c05a['uniqueid']),_0x50c05a);if(!_['isNil'](recordings[_0x50c05a[_0x7393('0x5')]])&&_0x50c05a[_0x7393('0x17')]==0x6){utils[_0x7393('0x2')](util[_0x7393('0x10')](_0x7393('0x18'),_0x50c05a['uniqueid'],_0x50c05a[_0x7393('0x13')],_0x50c05a[_0x7393('0x19')]));}else if(!_[_0x7393('0x1a')](recordings[_0x50c05a[_0x7393('0x1b')]])&&_0x50c05a[_0x7393('0x17')]==0x6&&_0x50c05a['context']!=_0x7393('0x1c')){utils['info'](util[_0x7393('0x10')](_0x7393('0x1d'),_0x50c05a[_0x7393('0x5')],_0x50c05a[_0x7393('0x1b')],_0x50c05a[_0x7393('0x13')],_0x50c05a[_0x7393('0x19')]));recordings[_0x50c05a[_0x7393('0x1b')]][_0x7393('0x8')]=_0x50c05a[_0x7393('0x8')];}}catch(_0x2051cb){utils[_0x7393('0x15')](util[_0x7393('0x10')]('[%s][recordings][newstate]',_0x50c05a[_0x7393('0x5')]),_0x2051cb);}};exports['varset']=function(_0x14d9ce){try{if(!_[_0x7393('0x1a')](_0x14d9ce['variable'])&&!_[_0x7393('0x1a')](_0x14d9ce['variable'][_0x7393('0x1e')])){utils[_0x7393('0xf')](util[_0x7393('0x10')](_0x7393('0x1f'),_0x14d9ce[_0x7393('0x5')]),_0x14d9ce);utils[_0x7393('0x2')](util[_0x7393('0x10')](_0x7393('0x20'),_0x14d9ce[_0x7393('0x5')],_0x14d9ce['variable'],_0x14d9ce[_0x7393('0x21')]));if(_[_0x7393('0x22')](_0x14d9ce[_0x7393('0x21')],_0x7393('0x23'))){_0x14d9ce[_0x7393('0x21')]=_0x14d9ce['value'][_0x7393('0x24')](_0x7393('0x23'),_0x7393('0x25'));}if(recordings[_0x14d9ce['linkedid']]){var _0x27a508=_['find'](recordings[_0x14d9ce[_0x7393('0x1b')]][_0x7393('0x26')],{'value':_0x14d9ce[_0x7393('0x21')]});if(_['isNil'](_0x27a508)){recordings[_0x14d9ce[_0x7393('0x1b')]][_0x7393('0x26')][_0x7393('0x27')]({'value':_0x14d9ce[_0x7393('0x21')]});}}}}catch(_0x3f8a85){utils[_0x7393('0x15')](util[_0x7393('0x10')](_0x7393('0x1f'),_0x14d9ce['uniqueid']),_0x3f8a85);}};exports['hangup']=function(_0xd9dcd4){try{if(!_['isNil'](recordings[_0xd9dcd4['uniqueid']])){utils[_0x7393('0xf')](util[_0x7393('0x10')](_0x7393('0x28'),_0xd9dcd4[_0x7393('0x5')]),_0xd9dcd4);utils[_0x7393('0x2')](util[_0x7393('0x10')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0xd9dcd4[_0x7393('0x5')],_0xd9dcd4[_0x7393('0x29')],_0xd9dcd4[_0x7393('0x2a')],_0xd9dcd4[_0x7393('0x2b')]));recordings[_0xd9dcd4[_0x7393('0x5')]]['calleridnum']=_0xd9dcd4[_0x7393('0x29')];recordings[_0xd9dcd4[_0x7393('0x5')]][_0x7393('0x2a')]=_0xd9dcd4[_0x7393('0x2a')];recordings[_0xd9dcd4[_0x7393('0x5')]][_0x7393('0x2c')]=_0xd9dcd4[_0x7393('0x2c')];recordings[_0xd9dcd4[_0x7393('0x5')]][_0x7393('0x2d')]=_0xd9dcd4[_0x7393('0x2d')];if(recordings[_0xd9dcd4[_0x7393('0x5')]][_0x7393('0x2e')]==_0x7393('0x2f')&&recordings[_0xd9dcd4['uniqueid']][_0x7393('0x8')]){recordings[_0xd9dcd4['uniqueid']][_0x7393('0x2c')]=recordings[_0xd9dcd4[_0x7393('0x5')]][_0x7393('0x8')];recordings[_0xd9dcd4['uniqueid']][_0x7393('0x2d')]='';}recordings[_0xd9dcd4['uniqueid']][_0x7393('0x26')][_0x7393('0x30')](function(_0x5e060c){var _0x436290=_['clone'](recordings[_0xd9dcd4[_0x7393('0x5')]]);_0x436290[_0x7393('0x21')]=_0x5e060c[_0x7393('0x21')];writeDB(_0x436290);});delete recordings[_0xd9dcd4[_0x7393('0x5')]];}}catch(_0x16e569){utils['error'](util[_0x7393('0x10')]('[%s][recordings][hangup]',_0xd9dcd4[_0x7393('0x5')]),_0x16e569);}};exports[_0x7393('0x31')]=function(_0x370e26){try{if(!_[_0x7393('0x1a')](recordings[_0x370e26['uniqueid']])){utils[_0x7393('0xf')](util[_0x7393('0x10')](_0x7393('0x32'),_0x370e26[_0x7393('0x5')]),_0x370e26);utils[_0x7393('0x2')](util[_0x7393('0x10')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x370e26[_0x7393('0x5')],_0x370e26[_0x7393('0x33')],_0x370e26['appdata']));if(_0x370e26[_0x7393('0x33')][_0x7393('0x34')]()=='set'&&_[_0x7393('0x35')](_0x370e26[_0x7393('0x36')][_0x7393('0x34')](),_0x7393('0x37'))){var _0x1d1e4d=_0x370e26[_0x7393('0x36')]['split']('=');var _0x1f35a8=_0x1d1e4d[0x0][_0x7393('0x38')](_0x1d1e4d[0x0][_0x7393('0x39')]('(')+0x1,_0x1d1e4d[0x0][_0x7393('0x39')](')'));var _0x1cc19c=_0x1d1e4d[0x1];recordings[_0x370e26[_0x7393('0x5')]][_0x1f35a8]=_0x1cc19c;}}}catch(_0x659549){utils[_0x7393('0x15')](util[_0x7393('0x10')](_0x7393('0x32'),_0x370e26[_0x7393('0x5')]),_0x659549);}};exports[_0x7393('0x3a')]=function(_0x58b4d8){try{if(!_['isNil'](recordings[_0x58b4d8[_0x7393('0x5')]])){utils[_0x7393('0xf')](util['format'](_0x7393('0x3b'),_0x58b4d8[_0x7393('0x5')]),_0x58b4d8);utils['info'](util['format'](_0x7393('0x3c'),_0x58b4d8[_0x7393('0x5')],_0x58b4d8[_0x7393('0x3d')]));recordings[_0x58b4d8[_0x7393('0x5')]][_0x7393('0x3d')]=_0x58b4d8['queue'];}}catch(_0xd45a13){utils[_0x7393('0x15')](util[_0x7393('0x10')](_0x7393('0x3b'),_0x58b4d8['uniqueid']),_0xd45a13);}};exports[_0x7393('0x3e')]=function(_0x3cb6a5){try{utils[_0x7393('0xf')](util[_0x7393('0x10')]('[%s][recordings][blindtransfer]',_0x3cb6a5[_0x7393('0x5')]),_0x3cb6a5);utils[_0x7393('0x2')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3cb6a5['uniqueid'],_0x3cb6a5[_0x7393('0x3f')],_0x3cb6a5[_0x7393('0x40')],_0x3cb6a5['transfereecalleridnum'],_0x3cb6a5[_0x7393('0x41')]));if(recordings[_0x3cb6a5[_0x7393('0x42')]]&&transfers[_0x7393('0x4')][_0x3cb6a5[_0x7393('0x42')]]){transfers['blinds'][_0x3cb6a5[_0x7393('0x42')]][_0x7393('0x43')]=!![];}}catch(_0x3b120a){utils[_0x7393('0x15')](util[_0x7393('0x10')](_0x7393('0x44'),_0x3cb6a5[_0x7393('0x5')]),_0x3b120a);}}; \ No newline at end of file +var _0xf5b9=['request','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','accountcode','channel','error','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','toLowerCase','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording'];(function(_0x308c6a,_0xe04d64){var _0x257b4d=function(_0x31125c){while(--_0x31125c){_0x308c6a['push'](_0x308c6a['shift']());}};_0x257b4d(++_0xe04d64);}(_0xf5b9,0x7d));var _0x9f5b=function(_0x2e10b7,_0x51a536){_0x2e10b7=_0x2e10b7-0x0;var _0x381d16=_0xf5b9[_0x2e10b7];return _0x381d16;};'use strict';var _=require(_0x9f5b('0x0'));var util=require(_0x9f5b('0x1'));var utils=require('./utils');var transfers=require(_0x9f5b('0x2'));var recordings={};function writeDB(_0x50ea0a){var _0x5e9d51;utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')](_0x9f5b('0x5'),_0x50ea0a['uniqueid']));if(transfers[_0x9f5b('0x6')][_0x50ea0a[_0x9f5b('0x7')]]){_0x5e9d51=_0x50ea0a[_0x9f5b('0x7')];_0x50ea0a[_0x9f5b('0x7')]=transfers[_0x9f5b('0x6')][_0x50ea0a[_0x9f5b('0x7')]][_0x9f5b('0x8')];}if(_0x50ea0a['accountcode']){utils[_0x9f5b('0x9')](_0x50ea0a['accountcode'])[_0x9f5b('0xa')](function(_0x1d771a){if(_0x1d771a){_0x50ea0a[_0x9f5b('0xb')]=_0x1d771a[_0x9f5b('0xc')];_0x50ea0a[_0x9f5b('0xd')]=_0x1d771a['id'];}utils['request'](_0x9f5b('0xe'),_0x50ea0a);});}else{utils[_0x9f5b('0xf')](_0x9f5b('0xe'),_0x50ea0a);}if(_0x5e9d51)delete transfers[_0x9f5b('0x6')][_0x5e9d51];}exports[_0x9f5b('0x10')]=function(_0x3c5b08){try{utils[_0x9f5b('0x11')](util[_0x9f5b('0x4')](_0x9f5b('0x12'),_0x3c5b08[_0x9f5b('0x7')]),_0x3c5b08);if(_0x3c5b08[_0x9f5b('0x7')]==_0x3c5b08[_0x9f5b('0x13')]){utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3c5b08['uniqueid'],_0x3c5b08[_0x9f5b('0x14')],_0x3c5b08[_0x9f5b('0x15')]));recordings[_0x3c5b08[_0x9f5b('0x7')]]={'uniqueid':_0x3c5b08[_0x9f5b('0x7')],'accountcode':_0x3c5b08[_0x9f5b('0x16')],'exten':_0x3c5b08['exten'],'context':_0x3c5b08['context'],'channel':_0x3c5b08[_0x9f5b('0x17')],'monitors':[]};}}catch(_0x9fec98){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')]('[%s][recordings][newchannel]',_0x3c5b08['uniqueid']),_0x9fec98);}};exports['newstate']=function(_0x6adbad){try{utils['debug'](util[_0x9f5b('0x4')]('[%s][recordings][newstate]',_0x6adbad[_0x9f5b('0x7')]),_0x6adbad);if(!_[_0x9f5b('0x19')](recordings[_0x6adbad[_0x9f5b('0x7')]])&&_0x6adbad['channelstate']==0x6){utils['info'](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x6adbad['uniqueid'],_0x6adbad['context'],_0x6adbad[_0x9f5b('0x17')]));}else if(!_['isNil'](recordings[_0x6adbad[_0x9f5b('0x13')]])&&_0x6adbad[_0x9f5b('0x1a')]==0x6&&_0x6adbad[_0x9f5b('0x14')]!=_0x9f5b('0x1b')){utils['info'](util['format'](_0x9f5b('0x1c'),_0x6adbad[_0x9f5b('0x7')],_0x6adbad['linkedid'],_0x6adbad[_0x9f5b('0x14')],_0x6adbad[_0x9f5b('0x17')]));recordings[_0x6adbad[_0x9f5b('0x13')]][_0x9f5b('0x16')]=_0x6adbad['accountcode'];}}catch(_0x195e4f){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x1d'),_0x6adbad[_0x9f5b('0x7')]),_0x195e4f);}};exports[_0x9f5b('0x1e')]=function(_0x4d9b23){try{if(!_['isNil'](_0x4d9b23[_0x9f5b('0x1f')])&&!_[_0x9f5b('0x19')](_0x4d9b23[_0x9f5b('0x1f')][_0x9f5b('0x20')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x4d9b23[_0x9f5b('0x7')]),_0x4d9b23);utils['info'](util[_0x9f5b('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4d9b23[_0x9f5b('0x7')],_0x4d9b23['variable'],_0x4d9b23[_0x9f5b('0x21')]));if(_[_0x9f5b('0x22')](_0x4d9b23[_0x9f5b('0x21')],_0x9f5b('0x23'))){_0x4d9b23[_0x9f5b('0x21')]=_0x4d9b23[_0x9f5b('0x21')][_0x9f5b('0x24')](_0x9f5b('0x23'),_0x9f5b('0x25'));}if(recordings[_0x4d9b23[_0x9f5b('0x13')]]){var _0x1f672d=_['find'](recordings[_0x4d9b23[_0x9f5b('0x13')]][_0x9f5b('0x26')],{'value':_0x4d9b23[_0x9f5b('0x21')]});if(_[_0x9f5b('0x19')](_0x1f672d)){recordings[_0x4d9b23[_0x9f5b('0x13')]][_0x9f5b('0x26')][_0x9f5b('0x27')]({'value':_0x4d9b23[_0x9f5b('0x21')]});}}}}catch(_0x302fab){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x28'),_0x4d9b23[_0x9f5b('0x7')]),_0x302fab);}};exports[_0x9f5b('0x29')]=function(_0x133fa2){try{if(!_[_0x9f5b('0x19')](recordings[_0x133fa2['uniqueid']])){utils[_0x9f5b('0x11')](util[_0x9f5b('0x4')](_0x9f5b('0x2a'),_0x133fa2[_0x9f5b('0x7')]),_0x133fa2);utils[_0x9f5b('0x3')](util['format'](_0x9f5b('0x2b'),_0x133fa2[_0x9f5b('0x7')],_0x133fa2[_0x9f5b('0x2c')],_0x133fa2[_0x9f5b('0x2d')],_0x133fa2[_0x9f5b('0x2e')]));recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x2c')]=_0x133fa2[_0x9f5b('0x2c')];recordings[_0x133fa2[_0x9f5b('0x7')]]['calleridname']=_0x133fa2['calleridname'];recordings[_0x133fa2[_0x9f5b('0x7')]]['connectedlinenum']=_0x133fa2[_0x9f5b('0x2f')];recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x30')]=_0x133fa2[_0x9f5b('0x30')];if(recordings[_0x133fa2[_0x9f5b('0x7')]]['type']==_0x9f5b('0x31')&&recordings[_0x133fa2[_0x9f5b('0x7')]]['accountcode']){recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x2f')]=recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x16')];recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x30')]='';}recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x26')][_0x9f5b('0x32')](function(_0x4cc684){var _0x21528a=_[_0x9f5b('0x33')](recordings[_0x133fa2['uniqueid']]);_0x21528a[_0x9f5b('0x21')]=_0x4cc684[_0x9f5b('0x21')];writeDB(_0x21528a);});delete recordings[_0x133fa2[_0x9f5b('0x7')]];}}catch(_0x570d5c){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x2a'),_0x133fa2[_0x9f5b('0x7')]),_0x570d5c);}};exports[_0x9f5b('0x34')]=function(_0x23a130){try{if(!_[_0x9f5b('0x19')](recordings[_0x23a130['uniqueid']])){utils['debug'](util[_0x9f5b('0x4')](_0x9f5b('0x35'),_0x23a130[_0x9f5b('0x7')]),_0x23a130);utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x23a130[_0x9f5b('0x7')],_0x23a130[_0x9f5b('0x36')],_0x23a130['appdata']));if(_0x23a130['application'][_0x9f5b('0x37')]()=='set'&&_['startsWith'](_0x23a130[_0x9f5b('0x38')][_0x9f5b('0x37')](),'cdr')){var _0x493683=_0x23a130['appdata'][_0x9f5b('0x39')]('=');var _0x1b00bf=_0x493683[0x0][_0x9f5b('0x3a')](_0x493683[0x0]['lastIndexOf']('(')+0x1,_0x493683[0x0][_0x9f5b('0x3b')](')'));var _0x5a0a6b=_0x493683[0x1];recordings[_0x23a130['uniqueid']][_0x1b00bf]=_0x5a0a6b;}}}catch(_0x1e097b){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x35'),_0x23a130[_0x9f5b('0x7')]),_0x1e097b);}};exports[_0x9f5b('0x3c')]=function(_0x342b43){try{if(!_[_0x9f5b('0x19')](recordings[_0x342b43[_0x9f5b('0x7')]])){utils[_0x9f5b('0x11')](util['format'](_0x9f5b('0x3d'),_0x342b43[_0x9f5b('0x7')]),_0x342b43);utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')](_0x9f5b('0x3e'),_0x342b43['uniqueid'],_0x342b43['queue']));recordings[_0x342b43[_0x9f5b('0x7')]]['queue']=_0x342b43['queue'];}}catch(_0x2ae27d){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x3d'),_0x342b43[_0x9f5b('0x7')]),_0x2ae27d);}};exports[_0x9f5b('0x3f')]=function(_0x6f4f83){try{utils[_0x9f5b('0x11')](util['format']('[%s][recordings][blindtransfer]',_0x6f4f83['uniqueid']),_0x6f4f83);utils['info'](util[_0x9f5b('0x4')](_0x9f5b('0x40'),_0x6f4f83[_0x9f5b('0x7')],_0x6f4f83[_0x9f5b('0x41')],_0x6f4f83[_0x9f5b('0x42')],_0x6f4f83[_0x9f5b('0x43')],_0x6f4f83['transfereecalleridname']));if(recordings[_0x6f4f83['transfereruniqueid']]&&transfers[_0x9f5b('0x6')][_0x6f4f83[_0x9f5b('0x44')]]){transfers[_0x9f5b('0x6')][_0x6f4f83[_0x9f5b('0x44')]][_0x9f5b('0x45')]=!![];}}catch(_0x403e71){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')]('[%s][recordings][blindtransfer]',_0x6f4f83['uniqueid']),_0x403e71);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ddfc4b8..dc262b5 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 _0x93e9=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x3ee8e,_0x7b7547){var _0x3ef9b7=function(_0x274fee){while(--_0x274fee){_0x3ee8e['push'](_0x3ee8e['shift']());}};_0x3ef9b7(++_0x7b7547);}(_0x93e9,0x137));var _0x993e=function(_0x20498d,_0x12b87f){_0x20498d=_0x20498d-0x0;var _0xb34430=_0x93e9[_0x20498d];return _0xb34430;};'use strict';var _=require('lodash');var util=require(_0x993e('0x0'));var utils=require(_0x993e('0x1'));function writeDB(_0x353db7){utils['info'](util[_0x993e('0x2')](_0x993e('0x3'),_0x353db7[_0x993e('0x4')]==='attended'?_0x353db7['origtransfereruniqueid']:_0x353db7['uniqueid'],_0x353db7['type']));utils[_0x993e('0x5')](_0x993e('0x6'),_0x353db7);}exports['blinds']={};exports[_0x993e('0x7')]=function(_0x4a73d9){try{utils[_0x993e('0x8')](util[_0x993e('0x2')](_0x993e('0x9'),_0x4a73d9[_0x993e('0xa')]),_0x4a73d9);utils[_0x993e('0xb')](util[_0x993e('0x2')](_0x993e('0xc'),_0x4a73d9[_0x993e('0xa')],_0x4a73d9[_0x993e('0xd')],_0x4a73d9[_0x993e('0xe')],_0x4a73d9[_0x993e('0xf')],_0x4a73d9['transfereecalleridname']));_0x4a73d9[_0x993e('0x4')]=_0x993e('0x10');exports['blinds'][_0x4a73d9[_0x993e('0x11')]]=_0x4a73d9;writeDB(_0x4a73d9);}catch(_0x14496d){utils[_0x993e('0x12')](util[_0x993e('0x2')](_0x993e('0x9'),_0x4a73d9[_0x993e('0xa')]),_0x14496d);}};exports[_0x993e('0x13')]=function(_0x5b049d){try{utils[_0x993e('0x8')](util[_0x993e('0x2')](_0x993e('0x14'),_0x5b049d[_0x993e('0x15')]),_0x5b049d);utils['info'](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5b049d[_0x993e('0x15')],_0x5b049d[_0x993e('0x16')],_0x5b049d[_0x993e('0x17')],_0x5b049d[_0x993e('0x18')],_0x5b049d[_0x993e('0x19')]));_0x5b049d=_[_0x993e('0x1a')](_0x5b049d,{'transfererchannel':_0x5b049d[_0x993e('0x1b')],'transferercalleridnum':_0x5b049d[_0x993e('0x16')],'transferercalleridname':_0x5b049d[_0x993e('0x17')],'transfererconnectedlinenum':_0x5b049d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5b049d[_0x993e('0x1c')],'transfereraccountcode':_0x5b049d[_0x993e('0x1d')],'transferercontext':_0x5b049d['secondtransferercontext'],'transfererexten':_0x5b049d[_0x993e('0x1e')],'transfererlinkedid':_0x5b049d[_0x993e('0x1f')],'context':_0x5b049d[_0x993e('0x20')],'extension':_0x5b049d[_0x993e('0x21')],'type':_0x993e('0x22')});if(_[_0x993e('0x23')](_0x5b049d[_0x993e('0x24')])){_0x5b049d=_[_0x993e('0x1a')](_0x5b049d,{'transfereechannel':_0x5b049d[_0x993e('0x25')],'transfereecalleridnum':_0x5b049d['transfertargetcalleridnum'],'transfereecalleridname':_0x5b049d[_0x993e('0x19')],'transfereeconnectedlinenum':_0x5b049d[_0x993e('0x26')],'transfereeconnectedlinename':_0x5b049d[_0x993e('0x27')],'transfereeaccountcode':_0x5b049d[_0x993e('0x28')],'transfereecontext':_0x5b049d['transfertargetcontext'],'transfereeexten':_0x5b049d[_0x993e('0x29')],'transfereelinkedid':_0x5b049d['transfertargetlinkedid']});}writeDB(_0x5b049d);}catch(_0x371170){utils[_0x993e('0x12')](util['format'](_0x993e('0x14'),_0x5b049d[_0x993e('0x15')]),_0x371170);}}; \ No newline at end of file +var _0x6553=['type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','format','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info'];(function(_0xfeb97e,_0x31427a){var _0x26b720=function(_0x1ec7b8){while(--_0x1ec7b8){_0xfeb97e['push'](_0xfeb97e['shift']());}};_0x26b720(++_0x31427a);}(_0x6553,0x177));var _0x3655=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6553[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x3655('0x0'));var utils=require(_0x3655('0x1'));function writeDB(_0x2c99c4){utils[_0x3655('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x2c99c4[_0x3655('0x3')]===_0x3655('0x4')?_0x2c99c4[_0x3655('0x5')]:_0x2c99c4[_0x3655('0x6')],_0x2c99c4['type']));utils['request'](_0x3655('0x7'),_0x2c99c4);}exports[_0x3655('0x8')]={};exports[_0x3655('0x9')]=function(_0x2b35ba){try{utils[_0x3655('0xa')](util['format'](_0x3655('0xb'),_0x2b35ba[_0x3655('0x6')]),_0x2b35ba);utils[_0x3655('0x2')](util[_0x3655('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2b35ba['uniqueid'],_0x2b35ba[_0x3655('0xd')],_0x2b35ba['transferercalleridname'],_0x2b35ba[_0x3655('0xe')],_0x2b35ba[_0x3655('0xf')]));_0x2b35ba[_0x3655('0x3')]='blind';exports[_0x3655('0x8')][_0x2b35ba[_0x3655('0x10')]]=_0x2b35ba;writeDB(_0x2b35ba);}catch(_0x289c22){utils[_0x3655('0x11')](util[_0x3655('0xc')](_0x3655('0xb'),_0x2b35ba[_0x3655('0x6')]),_0x289c22);}};exports[_0x3655('0x12')]=function(_0x10efda){try{utils[_0x3655('0xa')](util[_0x3655('0xc')](_0x3655('0x13'),_0x10efda[_0x3655('0x5')]),_0x10efda);utils[_0x3655('0x2')](util[_0x3655('0xc')](_0x3655('0x14'),_0x10efda[_0x3655('0x5')],_0x10efda[_0x3655('0x15')],_0x10efda[_0x3655('0x16')],_0x10efda[_0x3655('0x17')],_0x10efda[_0x3655('0x18')]));_0x10efda=_['assign'](_0x10efda,{'transfererchannel':_0x10efda[_0x3655('0x19')],'transferercalleridnum':_0x10efda[_0x3655('0x15')],'transferercalleridname':_0x10efda[_0x3655('0x16')],'transfererconnectedlinenum':_0x10efda[_0x3655('0x1a')],'transfererconnectedlinename':_0x10efda[_0x3655('0x1b')],'transfereraccountcode':_0x10efda['origtransfereraccountcode'],'transferercontext':_0x10efda[_0x3655('0x1c')],'transfererexten':_0x10efda[_0x3655('0x1d')],'transfererlinkedid':_0x10efda[_0x3655('0x1e')],'context':_0x10efda[_0x3655('0x1f')],'extension':_0x10efda[_0x3655('0x20')],'type':_0x3655('0x4')});if(_[_0x3655('0x21')](_0x10efda[_0x3655('0x22')])){_0x10efda=_['assign'](_0x10efda,{'transfereechannel':_0x10efda[_0x3655('0x23')],'transfereecalleridnum':_0x10efda[_0x3655('0x17')],'transfereecalleridname':_0x10efda[_0x3655('0x18')],'transfereeconnectedlinenum':_0x10efda[_0x3655('0x24')],'transfereeconnectedlinename':_0x10efda[_0x3655('0x25')],'transfereeaccountcode':_0x10efda[_0x3655('0x26')],'transfereecontext':_0x10efda[_0x3655('0x27')],'transfereeexten':_0x10efda[_0x3655('0x28')],'transfereelinkedid':_0x10efda[_0x3655('0x29')]});}writeDB(_0x10efda);}catch(_0x2665cf){utils['error'](util[_0x3655('0xc')](_0x3655('0x13'),_0x10efda[_0x3655('0x5')]),_0x2665cf);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 0467aa2..524d184 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 _0xa75c=['now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','format','diffTime','diff','seconds'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa75c,0x183));var _0xca75=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0xa75c[_0x3a4318];return _0x36d746;};'use strict';var BPromise=require(_0xca75('0x0'));var jayson=require('jayson/promise');var moment=require(_0xca75('0x1'));var util=require(_0xca75('0x2'));var client=jayson[_0xca75('0x3')][_0xca75('0x4')]({'port':0x2329});var logger=require(_0xca75('0x5'))('xdr');exports['info']=function(_0x43605a,_0x113796){logger[_0xca75('0x6')](_0x43605a,_0x113796?util[_0xca75('0x7')](_0x113796,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4a4d13,_0x10d7d9){logger[_0xca75('0x8')](_0x4a4d13,_0x10d7d9?util[_0xca75('0x7')](_0x10d7d9,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x3da6e7,_0x51667a){logger[_0xca75('0x9')](_0x3da6e7,_0x51667a?util[_0xca75('0x7')](_0x51667a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4dd8d0,_0x1300f8){return client[_0xca75('0xa')](_0x4dd8d0,{'body':_0x1300f8})[_0xca75('0xb')](function(_0x106940){logger[_0xca75('0x8')]('[utils][request]\x20name:%s',_0x4dd8d0,_0x106940?util[_0xca75('0x7')](_0x106940,{'showHidden':![],'depth':null}):'');})[_0xca75('0xc')](function(_0x87580a){logger[_0xca75('0x9')](_0xca75('0xd'),_0x4dd8d0,_0x87580a?util['inspect'](_0x87580a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1a418e){return client[_0xca75('0xa')](_0xca75('0xe'),{'options':{'raw':!![],'attributes':['id',_0xca75('0xf'),_0xca75('0x10'),_0xca75('0x11')],'where':_0x1a418e,'limit':0x1}})[_0xca75('0xb')](function(_0x55c0a3){logger[_0xca75('0x8')](_0xca75('0x12'),JSON[_0xca75('0x13')](_0x1a418e),_0x55c0a3?util['inspect'](_0x55c0a3,{'showHidden':![],'depth':null}):'');return _0x55c0a3[_0xca75('0x14')][_0xca75('0x15')]?_0x55c0a3[_0xca75('0x14')][0x0]:null;});}exports[_0xca75('0x16')]=function(_0x2afc87){return new BPromise(function(_0x57136e,_0x449b06){if(_0x2afc87){return getUser({'internal':_0x2afc87})[_0xca75('0xb')](function(_0x40fd0f){logger['info'](_0xca75('0x17'),_0x2afc87,_0x40fd0f?_0xca75('0x18'):_0xca75('0x19'));return _0x57136e(_0x40fd0f);})[_0xca75('0xc')](function(_0x174193){logger[_0xca75('0x9')]('[utils][getUserByInternal]',_0x174193?util[_0xca75('0x7')](_0x174193,{'showHidden':![],'depth':null}):'');return _0x57136e(null);});}return _0x57136e(null);});};exports[_0xca75('0x1a')]=function(_0x2befe8){return new BPromise(function(_0x592c01,_0x2d8784){if(_0x2befe8){return getUser({'interface':_0x2befe8})[_0xca75('0xb')](function(_0x29e9ab){logger['info'](_0xca75('0x1b'),_0x2befe8,_0x29e9ab?_0xca75('0x18'):_0xca75('0x19'));return _0x592c01(_0x29e9ab);})[_0xca75('0xc')](function(_0x49c5ed){logger['error'](_0xca75('0x1c'),_0x49c5ed?util[_0xca75('0x7')](_0x49c5ed,{'showHidden':![],'depth':null}):'');return _0x592c01(null);});}return _0x592c01(null);});};exports[_0xca75('0x1d')]=function(_0x292c69){return new BPromise(function(_0x59f53e,_0x81e2e2){if(_0x292c69){return getUser({'name':_0x292c69})[_0xca75('0xb')](function(_0x2349d1){logger[_0xca75('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x292c69,_0x2349d1?_0xca75('0x18'):_0xca75('0x19'));return _0x59f53e(_0x2349d1);})[_0xca75('0xc')](function(_0x41e2c5){logger[_0xca75('0x9')]('[utils][getUserByName]',_0x41e2c5?util[_0xca75('0x7')](_0x41e2c5,{'showHidden':![],'depth':null}):'');return _0x59f53e(null);});}return _0x59f53e(null);});};exports[_0xca75('0x1e')]=function(_0x2f23d4){return new BPromise(function(_0x1a5955,_0x5e94fd){if(_0x2f23d4){return client[_0xca75('0xa')](_0xca75('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xca75('0x10'),_0xca75('0x20'),_0xca75('0x21'),_0xca75('0x22')],'where':{'name':_0x2f23d4},'limit':0x1}})[_0xca75('0xb')](function(_0x4e584f){logger[_0xca75('0x8')](_0xca75('0x23'),_0x2f23d4,_0x4e584f?util[_0xca75('0x7')](_0x4e584f,{'showHidden':![],'depth':null}):'');logger['info'](_0xca75('0x24'),_0x2f23d4,_0x4e584f?_0xca75('0x18'):_0xca75('0x19'));return _0x1a5955(_0x4e584f['result'][_0xca75('0x15')]?_0x4e584f['result'][0x0]:null);})[_0xca75('0xc')](function(_0x5594bf){logger[_0xca75('0x9')](_0xca75('0x25'),_0x5594bf?util['inspect'](_0x5594bf,{'showHidden':![],'depth':null}):'');return _0x1a5955(null);});}return _0x1a5955(null);});};exports[_0xca75('0x26')]=function(_0x8b6a2,_0x2f0718){return moment(_0x8b6a2)[_0xca75('0x27')](_0x2f0718,'seconds')['format'](_0xca75('0x28'));};exports['subtractTime']=function(_0x3c0b46,_0x4fdf5d){return moment(_0x3c0b46)['subtract'](_0x4fdf5d,'seconds')[_0xca75('0x29')](_0xca75('0x28'));};exports[_0xca75('0x2a')]=function(_0x2a19f9,_0x271654){return moment(_0x2a19f9)[_0xca75('0x2b')](moment(_0x271654),_0xca75('0x2c'));};exports['sumTime']=function(_0xebbd92,_0x27a6ca){return parseInt(_0xebbd92,0xa)+parseInt(_0x27a6ca,0xa);};exports[_0xca75('0x2d')]=function(){return moment()['format'](_0xca75('0x28'));};exports[_0xca75('0x2e')]=function(_0x5cab70,_0x42b6ac){if(_0x42b6ac){return moment(_0x5cab70)[_0xca75('0x2e')](_0x42b6ac);}return!![];};exports[_0xca75('0x2f')]=function(_0x39bb14,_0x5045eb){if(_0x5045eb){return moment(_0x39bb14)[_0xca75('0x2f')](_0x5045eb);}else if(_0x39bb14){return!![];}return![];}; \ No newline at end of file +var _0xe4ce=['catch','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','sumTime','isAfter','isBefore','bluebird','moment','util','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','notfound'];(function(_0x5565a5,_0x340a20){var _0x25a05d=function(_0x3d0d2c){while(--_0x3d0d2c){_0x5565a5['push'](_0x5565a5['shift']());}};_0x25a05d(++_0x340a20);}(_0xe4ce,0x198));var _0xee4c=function(_0x7f04a3,_0x2294ce){_0x7f04a3=_0x7f04a3-0x0;var _0x50def=_0xe4ce[_0x7f04a3];return _0x50def;};'use strict';var BPromise=require(_0xee4c('0x0'));var jayson=require('jayson/promise');var moment=require(_0xee4c('0x1'));var util=require(_0xee4c('0x2'));var client=jayson[_0xee4c('0x3')]['http']({'port':0x2329});var logger=require(_0xee4c('0x4'))(_0xee4c('0x5'));exports[_0xee4c('0x6')]=function(_0x39ebf4,_0x4e2abe){logger[_0xee4c('0x6')](_0x39ebf4,_0x4e2abe?util['inspect'](_0x4e2abe,{'showHidden':![],'depth':null}):'');};exports[_0xee4c('0x7')]=function(_0x52a051,_0x2b7f31){logger[_0xee4c('0x7')](_0x52a051,_0x2b7f31?util[_0xee4c('0x8')](_0x2b7f31,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x24fdc3,_0x3be7df){logger[_0xee4c('0x9')](_0x24fdc3,_0x3be7df?util[_0xee4c('0x8')](_0x3be7df,{'showHidden':![],'depth':null}):'');};exports[_0xee4c('0xa')]=function(_0xc61b2,_0x3e8b73){return client[_0xee4c('0xa')](_0xc61b2,{'body':_0x3e8b73})[_0xee4c('0xb')](function(_0x13f45d){logger[_0xee4c('0x7')](_0xee4c('0xc'),_0xc61b2,_0x13f45d?util[_0xee4c('0x8')](_0x13f45d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x59e4cd){logger[_0xee4c('0x9')](_0xee4c('0xc'),_0xc61b2,_0x59e4cd?util[_0xee4c('0x8')](_0x59e4cd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x40655b){return client[_0xee4c('0xa')](_0xee4c('0xd'),{'options':{'raw':!![],'attributes':['id',_0xee4c('0xe'),_0xee4c('0xf'),'interface'],'where':_0x40655b,'limit':0x1}})['then'](function(_0x3b8b3e){logger[_0xee4c('0x7')](_0xee4c('0x10'),JSON[_0xee4c('0x11')](_0x40655b),_0x3b8b3e?util[_0xee4c('0x8')](_0x3b8b3e,{'showHidden':![],'depth':null}):'');return _0x3b8b3e[_0xee4c('0x12')]['length']?_0x3b8b3e[_0xee4c('0x12')][0x0]:null;});}exports[_0xee4c('0x13')]=function(_0x5b0195){return new BPromise(function(_0x4da0ed,_0x4c8656){if(_0x5b0195){return getUser({'internal':_0x5b0195})[_0xee4c('0xb')](function(_0x45eb10){logger[_0xee4c('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5b0195,_0x45eb10?_0xee4c('0x14'):_0xee4c('0x15'));return _0x4da0ed(_0x45eb10);})[_0xee4c('0x16')](function(_0x1440b4){logger[_0xee4c('0x9')](_0xee4c('0x17'),_0x1440b4?util[_0xee4c('0x8')](_0x1440b4,{'showHidden':![],'depth':null}):'');return _0x4da0ed(null);});}return _0x4da0ed(null);});};exports['getUserByInterface']=function(_0x424659){return new BPromise(function(_0x2cc05f,_0x3354c1){if(_0x424659){return getUser({'interface':_0x424659})['then'](function(_0x13f31a){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x424659,_0x13f31a?'found':_0xee4c('0x15'));return _0x2cc05f(_0x13f31a);})['catch'](function(_0x573d3e){logger[_0xee4c('0x9')](_0xee4c('0x18'),_0x573d3e?util[_0xee4c('0x8')](_0x573d3e,{'showHidden':![],'depth':null}):'');return _0x2cc05f(null);});}return _0x2cc05f(null);});};exports[_0xee4c('0x19')]=function(_0x31e4f6){return new BPromise(function(_0x46fe1d,_0x2d9f36){if(_0x31e4f6){return getUser({'name':_0x31e4f6})[_0xee4c('0xb')](function(_0x2df7da){logger['info'](_0xee4c('0x1a'),_0x31e4f6,_0x2df7da?'found':_0xee4c('0x15'));return _0x46fe1d(_0x2df7da);})[_0xee4c('0x16')](function(_0x13a7b9){logger[_0xee4c('0x9')](_0xee4c('0x1b'),_0x13a7b9?util[_0xee4c('0x8')](_0x13a7b9,{'showHidden':![],'depth':null}):'');return _0x46fe1d(null);});}return _0x46fe1d(null);});};exports[_0xee4c('0x1c')]=function(_0x427684){return new BPromise(function(_0x1992c6,_0x4cf6a6){if(_0x427684){return client[_0xee4c('0xa')](_0xee4c('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xee4c('0xf'),'type',_0xee4c('0x1e'),'acwTimeout'],'where':{'name':_0x427684},'limit':0x1}})['then'](function(_0x2eb92f){logger['debug'](_0xee4c('0x1f'),_0x427684,_0x2eb92f?util['inspect'](_0x2eb92f,{'showHidden':![],'depth':null}):'');logger['info'](_0xee4c('0x20'),_0x427684,_0x2eb92f?'found':_0xee4c('0x15'));return _0x1992c6(_0x2eb92f[_0xee4c('0x12')]['length']?_0x2eb92f[_0xee4c('0x12')][0x0]:null);})[_0xee4c('0x16')](function(_0x385765){logger['error'](_0xee4c('0x21'),_0x385765?util[_0xee4c('0x8')](_0x385765,{'showHidden':![],'depth':null}):'');return _0x1992c6(null);});}return _0x1992c6(null);});};exports[_0xee4c('0x22')]=function(_0x3dc51d,_0x5390ef){return moment(_0x3dc51d)['add'](_0x5390ef,_0xee4c('0x23'))[_0xee4c('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xee4c('0x25')]=function(_0x22ac60,_0x47652b){return moment(_0x22ac60)[_0xee4c('0x26')](_0x47652b,'seconds')[_0xee4c('0x24')](_0xee4c('0x27'));};exports['diffTime']=function(_0x3eb1ed,_0x4cea39){return moment(_0x3eb1ed)['diff'](moment(_0x4cea39),_0xee4c('0x23'));};exports[_0xee4c('0x28')]=function(_0x1fffbb,_0xe1905){return parseInt(_0x1fffbb,0xa)+parseInt(_0xe1905,0xa);};exports['now']=function(){return moment()[_0xee4c('0x24')](_0xee4c('0x27'));};exports[_0xee4c('0x29')]=function(_0x472c03,_0x1dbcc2){if(_0x1dbcc2){return moment(_0x472c03)[_0xee4c('0x29')](_0x1dbcc2);}return!![];};exports[_0xee4c('0x2a')]=function(_0x3c5fc3,_0x46a0a6){if(_0x46a0a6){return moment(_0x3c5fc3)['isBefore'](_0x46a0a6);}else if(_0x3c5fc3){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index c99827b..0fb1513 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ebd=['responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','url','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','client','role','name','ensureDir','then','catch','user','no-user','timestamp','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','connection','statusCode'];(function(_0x2e64c5,_0x2da1f7){var _0x265a78=function(_0x3bf823){while(--_0x3bf823){_0x2e64c5['push'](_0x2e64c5['shift']());}};_0x265a78(++_0x2da1f7);}(_0x5ebd,0x173));var _0xd5eb=function(_0x25a7ec,_0xd03926){_0x25a7ec=_0x25a7ec-0x0;var _0x41675b=_0x5ebd[_0x25a7ec];return _0x41675b;};var fs=require(_0xd5eb('0x0'));var _=require(_0xd5eb('0x1'));var ewinston=require('express-winston');var path=require(_0xd5eb('0x2'));var util=require(_0xd5eb('0x3'));var fileLogger=require(_0xd5eb('0x4'))[_0xd5eb('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0xd5eb('0x6'))[_0xd5eb('0x7')];function ClientSideLogger(){function _0x4a8648(_0x3d084e){var _0x53522a=path[_0xd5eb('0x8')](_0xd5eb('0x9'),'log',_0xd5eb('0xa'));var _0x571d35=path[_0xd5eb('0x8')](_0xd5eb('0xb'),_0x3d084e[_0xd5eb('0xc')]+'-'+_0x3d084e[_0xd5eb('0xd')]);return fs[_0xd5eb('0xe')](path[_0xd5eb('0x8')](_0x53522a,_0x571d35))[_0xd5eb('0xf')](function(){var _0x136731=fileLogger('client',path['join'](_0x53522a,_0x571d35));return _0x136731;})[_0xd5eb('0x10')](function(_0x3bec07){throw _0x3bec07;});}this['log']=function(_0x107f3d,_0x105af9,_0x248e34,_0xd50628){return _0x4a8648(_0x107f3d[_0xd5eb('0x11')])[_0xd5eb('0xf')](function(_0x9fe7df){var _0x11f1cf=_0x9fe7df[_0x105af9];return _0x11f1cf;})[_0xd5eb('0xf')](function(_0x5df35a){var _0xff8ff2=_0x107f3d['user']?_0x107f3d[_0xd5eb('0x11')]['id']:_0xd5eb('0x12');var _0x45615c=_0xd50628['data'];var _0x208313=_0xd50628[_0xd5eb('0x13')];var _0x503bc8=new Date(Number(_0x208313));return _0x5df35a(_0xff8ff2,_0x503bc8,_0x248e34,_0x45615c);})['catch'](function(_0x1ebcde){fileLogger(_0xd5eb('0xb'))['error'](_0x1ebcde);});};}function setupLoggers(_0x16502e){return new Promise(function(_0x4a738b){var _0xd6b40c=new ClientSideLogger();var _0x41af64=fileLogger(_0xd5eb('0x14'));var _0x2e5d73=fileLogger(_0xd5eb('0x15'));_0x16502e[_0xd5eb('0x16')](_0xd5eb('0x17'),_0xd6b40c);_0x16502e[_0xd5eb('0x18')](ewinston[_0xd5eb('0x19')]({'winstonInstance':_0x41af64,'meta':![],'statusLevels':!![],'msg':function(_0x251cb3,_0x28aba9){var _0x2a3e37=_0xd5eb('0x1a');if(!_[_0xd5eb('0x1b')](_0x251cb3[_0xd5eb('0x1c')])){_0x2a3e37+=_0xd5eb('0x1d');var _0x2329fb=_0x251cb3[_0xd5eb('0x1c')];maskSensitiveData(_0x2329fb);}return safeTemplate(util['format'](_0x2a3e37,_0x251cb3['method'],_0x251cb3[_0xd5eb('0x1e')][_0xd5eb('0x1f')]?_0x251cb3[_0xd5eb('0x1e')][_0xd5eb('0x1f')]:_0x251cb3[_0xd5eb('0x20')]['remoteAddress']||_0x251cb3['ip'],_0x251cb3['url'],_0x28aba9[_0xd5eb('0x21')],_0x28aba9[_0xd5eb('0x22')],_0x251cb3[_0xd5eb('0x11')]?_0x251cb3['user']['id']:null,_0x251cb3[_0xd5eb('0x11')]?_0x251cb3[_0xd5eb('0x11')][_0xd5eb('0xd')]:null,_0x251cb3[_0xd5eb('0x11')]?_0x251cb3[_0xd5eb('0x11')][_0xd5eb('0xc')]:null,_0x2329fb?util[_0xd5eb('0x23')](_0x2329fb,![],null):''));}}));_0x16502e[_0xd5eb('0x18')](ewinston['logger']({'winstonInstance':_0x2e5d73,'meta':![],'statusLevels':!![],'msg':function(_0x1bfbd7,_0x59b3c6){var _0x390733=_0xd5eb('0x24');if(_0x1bfbd7['body']&&_0x1bfbd7['body'][_0xd5eb('0x25')]&&_0x1bfbd7[_0xd5eb('0x1c')][_0xd5eb('0x26')]){_0x390733=_0xd5eb('0x27');}return util['format'](_0x390733,_0x1bfbd7[_0xd5eb('0x28')],_0x1bfbd7[_0xd5eb('0x1e')]['x-forwarded-for']?_0x1bfbd7[_0xd5eb('0x1e')]['x-forwarded-for']:_0x1bfbd7[_0xd5eb('0x20')]['remoteAddress']||_0x1bfbd7['ip'],_0x1bfbd7[_0xd5eb('0x29')],_0x59b3c6[_0xd5eb('0x21')],_0x59b3c6[_0xd5eb('0x22')],_0x1bfbd7[_0xd5eb('0x11')]?_0x1bfbd7[_0xd5eb('0x11')]['id']:null,_0x1bfbd7[_0xd5eb('0x11')]?_0x1bfbd7[_0xd5eb('0x11')][_0xd5eb('0xd')]:null,_0x1bfbd7[_0xd5eb('0x11')]?_0x1bfbd7[_0xd5eb('0x11')]['role']:null,_0x1bfbd7[_0xd5eb('0x1c')]&&_0x1bfbd7[_0xd5eb('0x1c')][_0xd5eb('0x25')]?_0x1bfbd7[_0xd5eb('0x1c')]['device']:'other',_0x1bfbd7[_0xd5eb('0x1c')]&&_0x1bfbd7[_0xd5eb('0x1c')]['agent_id']?_0x1bfbd7[_0xd5eb('0x1c')][_0xd5eb('0x26')]:'',_0x1bfbd7[_0xd5eb('0x1c')]&&_0x1bfbd7['body'][_0xd5eb('0x2a')]?_0x1bfbd7[_0xd5eb('0x1c')][_0xd5eb('0x2a')]:'');},'ignoreRoute':function(_0x54e654){var _0x2ebe06=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2ebe06[_0xd5eb('0x2b')](_0x54e654[_0xd5eb('0x29')]);}}));return _0x4a738b();});}exports[_0xd5eb('0x2c')]=setupLoggers; \ No newline at end of file +var _0x10da=['body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','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)','format','other','agent_name','test','setupLoggers','lodash','express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir','then','user','no-user','data','error','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x10da,0xf5));var _0xa10d=function(_0x40ee34,_0x35f6aa){_0x40ee34=_0x40ee34-0x0;var _0x1ef672=_0x10da[_0x40ee34];return _0x1ef672;};var fs=require('fs-extra');var _=require(_0xa10d('0x0'));var ewinston=require(_0xa10d('0x1'));var path=require(_0xa10d('0x2'));var util=require('util');var fileLogger=require(_0xa10d('0x3'))['fileLogger'];var safeTemplate=require(_0xa10d('0x4'))[_0xa10d('0x5')];var maskSensitiveData=require(_0xa10d('0x6'))[_0xa10d('0x7')];function ClientSideLogger(){function _0x3cd3be(_0xc280ff){var _0x4c846c=path['join'](_0xa10d('0x8'),_0xa10d('0x9'),_0xa10d('0xa'));var _0x1afdcc=path[_0xa10d('0xb')](_0xa10d('0xc'),_0xc280ff['role']+'-'+_0xc280ff[_0xa10d('0xd')]);return fs[_0xa10d('0xe')](path[_0xa10d('0xb')](_0x4c846c,_0x1afdcc))[_0xa10d('0xf')](function(){var _0x3d3ea6=fileLogger(_0xa10d('0xc'),path[_0xa10d('0xb')](_0x4c846c,_0x1afdcc));return _0x3d3ea6;})['catch'](function(_0x152707){throw _0x152707;});}this[_0xa10d('0x9')]=function(_0x3bbde5,_0x4be6e0,_0x58d2ce,_0x3e9fd4){return _0x3cd3be(_0x3bbde5['user'])[_0xa10d('0xf')](function(_0x1e6f93){var _0x1af619=_0x1e6f93[_0x4be6e0];return _0x1af619;})[_0xa10d('0xf')](function(_0x4f7611){var _0x54843b=_0x3bbde5[_0xa10d('0x10')]?_0x3bbde5[_0xa10d('0x10')]['id']:_0xa10d('0x11');var _0x145df5=_0x3e9fd4[_0xa10d('0x12')];var _0x23560f=_0x3e9fd4['timestamp'];var _0x2406d1=new Date(Number(_0x23560f));return _0x4f7611(_0x54843b,_0x2406d1,_0x58d2ce,_0x145df5);})['catch'](function(_0x504f2d){fileLogger(_0xa10d('0xc'))[_0xa10d('0x13')](_0x504f2d);});};}function setupLoggers(_0x1bb8f2){return new Promise(function(_0x11baf5){var _0x13c9fd=new ClientSideLogger();var _0x245a4d=fileLogger('api');var _0x1a796f=fileLogger(_0xa10d('0x14'));_0x1bb8f2[_0xa10d('0x15')]('client-side-logger',_0x13c9fd);_0x1bb8f2[_0xa10d('0x16')](ewinston['logger']({'winstonInstance':_0x245a4d,'meta':![],'statusLevels':!![],'msg':function(_0x582801,_0x131ce7){var _0x36ba75=_0xa10d('0x17');if(!_[_0xa10d('0x18')](_0x582801[_0xa10d('0x19')])){_0x36ba75+='\x20body=%s';var _0x22fcad=_0x582801['body'];maskSensitiveData(_0x22fcad);}return safeTemplate(util['format'](_0x36ba75,_0x582801[_0xa10d('0x1a')],_0x582801[_0xa10d('0x1b')][_0xa10d('0x1c')]?_0x582801['headers'][_0xa10d('0x1c')]:_0x582801[_0xa10d('0x1d')][_0xa10d('0x1e')]||_0x582801['ip'],_0x582801[_0xa10d('0x1f')],_0x131ce7[_0xa10d('0x20')],_0x131ce7[_0xa10d('0x21')],_0x582801[_0xa10d('0x10')]?_0x582801[_0xa10d('0x10')]['id']:null,_0x582801[_0xa10d('0x10')]?_0x582801[_0xa10d('0x10')][_0xa10d('0xd')]:null,_0x582801[_0xa10d('0x10')]?_0x582801['user'][_0xa10d('0x22')]:null,_0x22fcad?util[_0xa10d('0x23')](_0x22fcad,![],null):''));}}));_0x1bb8f2[_0xa10d('0x16')](ewinston['logger']({'winstonInstance':_0x1a796f,'meta':![],'statusLevels':!![],'msg':function(_0x503f86,_0x4443a5){var _0x3a7718=_0xa10d('0x24');if(_0x503f86[_0xa10d('0x19')]&&_0x503f86['body'][_0xa10d('0x25')]&&_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]){_0x3a7718=_0xa10d('0x27');}return util[_0xa10d('0x28')](_0x3a7718,_0x503f86[_0xa10d('0x1a')],_0x503f86['headers'][_0xa10d('0x1c')]?_0x503f86[_0xa10d('0x1b')]['x-forwarded-for']:_0x503f86[_0xa10d('0x1d')]['remoteAddress']||_0x503f86['ip'],_0x503f86[_0xa10d('0x1f')],_0x4443a5[_0xa10d('0x20')],_0x4443a5[_0xa10d('0x21')],_0x503f86['user']?_0x503f86[_0xa10d('0x10')]['id']:null,_0x503f86['user']?_0x503f86['user'][_0xa10d('0xd')]:null,_0x503f86['user']?_0x503f86[_0xa10d('0x10')][_0xa10d('0x22')]:null,_0x503f86[_0xa10d('0x19')]&&_0x503f86['body'][_0xa10d('0x25')]?_0x503f86[_0xa10d('0x19')][_0xa10d('0x25')]:_0xa10d('0x29'),_0x503f86[_0xa10d('0x19')]&&_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]?_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]:'',_0x503f86[_0xa10d('0x19')]&&_0x503f86[_0xa10d('0x19')]['agent_name']?_0x503f86[_0xa10d('0x19')][_0xa10d('0x2a')]:'');},'ignoreRoute':function(_0x509f04){var _0x5a4f67=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5a4f67[_0xa10d('0x2b')](_0x509f04[_0xa10d('0x1f')]);}}));return _0x11baf5();});}exports[_0xa10d('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 546384a..a3e2580 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd179=['iftime','lodash','moment-timezone','map','join','Date\x20not\x20valid','split','locale','weekdaysShort','indexOf','slice','concat','exports','monthsShort','toLowerCase','clone','minutes','hours','startOf','day','isBetween','format','ddd','includes','dowCompare','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length'];(function(_0x364a36,_0x1e2677){var _0x5cd6fa=function(_0x58d692){while(--_0x58d692){_0x364a36['push'](_0x364a36['shift']());}};_0x5cd6fa(++_0x1e2677);}(_0xd179,0x18d));var _0x9d17=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xd179[_0xd1d19a];return _0x52a79d;};var _=require(_0x9d17('0x0'));var moment=require(_0x9d17('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x9d17('0x2')](function(_0xc2cec9){return _0xc2cec9['source'];})[_0x9d17('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x9d17('0x4');function throwIfDateNotValid(_0xca5a75){if(!_0xca5a75['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3de798){var _0x5e0b98=_0x3de798[_0x9d17('0x5')](':')[_0x9d17('0x2')](function(_0x3199f5){return parseInt(_0x3199f5,0xa);});var _0x4b5344=_0x5e0b98[0x0];var _0x58ac29=_0x5e0b98[0x1];if(_0x4b5344<0x0||_0x4b5344>0x17||_0x58ac29<0x0||_0x58ac29>0x3b){throw new Error(EINVALID_DATE);}return[_0x4b5344,_0x58ac29];}function circularDoWInterval(_0x22e668,_0x5ac6ee){if(_0x22e668===_0x5ac6ee){return[_0x22e668];}else{var _0x5c8e96=moment[_0x9d17('0x6')]();moment[_0x9d17('0x6')]('en');var _0x35d11f=moment[_0x9d17('0x7')]()[_0x9d17('0x2')](function(_0x500fc6){return _0x500fc6['toLowerCase']();});moment[_0x9d17('0x6')](_0x5c8e96);var _0x296915=_0x35d11f[_0x9d17('0x8')](_0x22e668);var _0xf3314b=_0x35d11f[_0x9d17('0x8')](_0x5ac6ee);if(_0xf3314b>_0x296915){return _0x35d11f['slice'](_0x296915,_0xf3314b+0x1);}else{var _0x4ae640=_0x35d11f[_0x9d17('0x9')](0x0,_0xf3314b+0x1);var _0x2d3dcb=_0x35d11f[_0x9d17('0x9')](_0x296915);return _0x2d3dcb[_0x9d17('0xa')](_0x4ae640);}}}module[_0x9d17('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x27143,_0x185d87){if(_0x27143===_0x185d87){return[_0x27143];}else{var _0x200875=moment[_0x9d17('0x6')]();moment[_0x9d17('0x6')]('en');var _0x2d7666=moment[_0x9d17('0xc')]()[_0x9d17('0x2')](function(_0x3d09ca){return _0x3d09ca[_0x9d17('0xd')]();});moment['locale'](_0x200875);var _0x2908c5=_0x2d7666[_0x9d17('0x8')](_0x27143);var _0x488d6a=_0x2d7666['indexOf'](_0x185d87);if(_0x488d6a>_0x2908c5){return _0x2d7666['slice'](_0x2908c5,_0x488d6a+0x1);}else{var _0x4d9386=_0x2d7666['slice'](0x0,_0x488d6a+0x1);var _0x981b12=_0x2d7666[_0x9d17('0x9')](_0x2908c5);return _0x981b12[_0x9d17('0xa')](_0x4d9386);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x465a4e){var _0x5e1800=parseInt(_0x465a4e,0xa);if(_0x5e1800<0x1||_0x5e1800>0x1f){throw new Error(EINVALID_DATE);}return _0x5e1800;}function timeCompare(_0x44afce,_0x46309b,_0x535c21){var _0x32d93f=_0x44afce[_0x9d17('0xe')]();var _0x245c3d=extractTime(_0x46309b);var _0x2824c5=_0x245c3d[0x0];var _0x1d09d7=_0x245c3d[0x1];var _0x2e51d8=_0x44afce[_0x9d17('0xe')]()['hours'](_0x2824c5)[_0x9d17('0xf')](_0x1d09d7);throwIfDateNotValid(_0x2e51d8);var _0x13891a=extractTime(_0x535c21);var _0x2f4df2=_0x13891a[0x0];var _0x4dae8e=_0x13891a[0x1];var _0x52f605=_0x44afce[_0x9d17('0xe')]()[_0x9d17('0x10')](_0x2f4df2)['minutes'](_0x4dae8e);throwIfDateNotValid(_0x52f605);if(_0x52f605['isBefore'](_0x2e51d8)){var _0x5bfe15=_0x32d93f[_0x9d17('0xe')]()[_0x9d17('0x11')](_0x9d17('0x12'));var _0x106673=_0x32d93f['clone']()['endOf'](_0x9d17('0x12'));return _0x32d93f[_0x9d17('0x13')](_0x2e51d8,_0x106673,undefined,'[]')||_0x32d93f['isBetween'](_0x5bfe15,_0x52f605,undefined,'[]');}else{return _0x32d93f[_0x9d17('0x13')](_0x2e51d8,_0x52f605,undefined,'[]');}}module[_0x9d17('0xb')]['timeCompare']=timeCompare;function dowCompare(_0xfb7435,_0x3eaf12,_0x3bd96c){var _0x4446b0=_0xfb7435['locale']('en')[_0x9d17('0x14')](_0x9d17('0x15'))[_0x9d17('0xd')]();return circularDoWInterval(_0x3eaf12,_0x3bd96c)[_0x9d17('0x16')](_0x4446b0);}module[_0x9d17('0xb')][_0x9d17('0x17')]=dowCompare;function domCompare(_0x30bd55,_0x1d940f,_0x197535){var _0x35af16=_0x30bd55['date']();if(_0x1d940f===_0x197535){return _0x35af16===_0x1d940f;}else{var _0x169b2a=_0x30bd55[_0x9d17('0x18')]();var _0x4623cc=_0x1d940f<_0x197535;let _0x2976c2=![];var _0x2888d2=0x0;var _0x13ae0a=0x0;if(_0x4623cc){_0x2888d2=Math[_0x9d17('0x19')](0x1,_0x1d940f);_0x13ae0a=Math[_0x9d17('0x1a')](_0x197535,_0x169b2a);_0x2976c2=_0x35af16>=_0x2888d2&&_0x35af16<=_0x13ae0a;}else{_0x2888d2=Math[_0x9d17('0x1a')](_0x1d940f,_0x169b2a);_0x13ae0a=Math[_0x9d17('0x19')](0x1,_0x197535);_0x2976c2=_0x35af16>=_0x2888d2||_0x35af16<=_0x13ae0a;}return _0x2976c2;}}module[_0x9d17('0xb')][_0x9d17('0x1b')]=domCompare;function monthCompare(_0x515ab6,_0x25944d,_0x37bd53){var _0x191799=_0x515ab6[_0x9d17('0x6')]('en')['format'](_0x9d17('0x1c'))[_0x9d17('0xd')]();return circularMonthInterval(_0x25944d,_0x37bd53)['includes'](_0x191799);}module[_0x9d17('0xb')][_0x9d17('0x1d')]=monthCompare;function iftime(_0x4b6605,_0x42a9a7=moment['tz'][_0x9d17('0x1e')](),_0x58c2b5=moment()){if(!validateRx[_0x9d17('0x1f')](_0x4b6605)){throw new Error(EINVALID_STRING);}else{var _0x807927=(moment[_0x9d17('0x20')](_0x58c2b5)?_0x58c2b5[_0x9d17('0xe')]():moment(_0x58c2b5))['tz'](_0x42a9a7)['locale']('en');throwIfDateNotValid(_0x807927);var _0x91b5da=_0x4b6605[_0x9d17('0x5')](',');var _0x397b87=_0x91b5da[0x0];var _0xa2f181=_0x91b5da[0x1];var _0x5ce874=_0x91b5da[0x2];var _0x36547e=_0x91b5da[0x3];let _0x3dd214=!![];if(_0x397b87!=='*'){var _0x521dac=_0x397b87[_0x9d17('0x5')]('-');var _0xb3c4bb=_[_0x9d17('0x21')](_0x521dac[0x0],0x5,'0');var _0x45aea5=_0x521dac['length']===0x2?_[_0x9d17('0x21')](_0x521dac[0x1],0x5,'0'):_0xb3c4bb;_0x3dd214=timeCompare(_0x807927,_0xb3c4bb,_0x45aea5);}let _0x1138be=!![];if(_0xa2f181!=='*'){var _0x240757=_0xa2f181[_0x9d17('0x5')]('-');var _0x497271=_0x240757[0x0];var _0x18e96e=_0x240757[_0x9d17('0x22')]===0x2?_0x240757[0x1]:_0x497271;_0x1138be=dowCompare(_0x807927,_0x497271,_0x18e96e);}let _0x451319=!![];if(_0x5ce874!=='*'){var _0xdcbaec=_0x5ce874['split']('-');var _0x2aabc7=parseDom(_0xdcbaec[0x0]);var _0x46a286=_0xdcbaec[_0x9d17('0x22')]===0x2?parseDom(_0xdcbaec[0x1]):_0x2aabc7;_0x451319=domCompare(_0x807927,_0x2aabc7,_0x46a286);}let _0x4f3d6b=!![];if(_0x36547e!=='*'){var _0x4da695=_0x36547e[_0x9d17('0x5')]('-');var _0x56c4f0=_0x4da695[0x0];var _0x5f3e72=_0x4da695[_0x9d17('0x22')]===0x2?_0x4da695[0x1]:_0x4da695[0x0];_0x4f3d6b=monthCompare(_0x807927,_0x56c4f0,_0x5f3e72);}return _0x3dd214&&_0x1138be&&_0x451319&&_0x4f3d6b;}}module[_0x9d17('0xb')][_0x9d17('0x23')]=iftime; \ No newline at end of file +var _0xaf61=['isBefore','startOf','day','endOf','isBetween','exports','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','circularMonthInterval','clone','hours','minutes'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0xaf61,0x145));var _0x1af6=function(_0x289907,_0x240685){_0x289907=_0x289907-0x0;var _0x261df9=_0xaf61[_0x289907];return _0x261df9;};var _=require(_0x1af6('0x0'));var moment=require(_0x1af6('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x1af6('0x2')](function(_0x596ef5){return _0x596ef5['source'];})[_0x1af6('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x1af6('0x4');var EINVALID_DATE=_0x1af6('0x5');function throwIfDateNotValid(_0x333686){if(!_0x333686[_0x1af6('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x47e115){var _0x593eb8=_0x47e115[_0x1af6('0x7')](':')[_0x1af6('0x2')](function(_0x5af546){return parseInt(_0x5af546,0xa);});var _0x23a9a8=_0x593eb8[0x0];var _0x3df14e=_0x593eb8[0x1];if(_0x23a9a8<0x0||_0x23a9a8>0x17||_0x3df14e<0x0||_0x3df14e>0x3b){throw new Error(EINVALID_DATE);}return[_0x23a9a8,_0x3df14e];}function circularDoWInterval(_0x3962ac,_0xf7fa13){if(_0x3962ac===_0xf7fa13){return[_0x3962ac];}else{var _0x123860=moment[_0x1af6('0x8')]();moment['locale']('en');var _0x1f405a=moment[_0x1af6('0x9')]()[_0x1af6('0x2')](function(_0x232a74){return _0x232a74[_0x1af6('0xa')]();});moment['locale'](_0x123860);var _0x38c23a=_0x1f405a[_0x1af6('0xb')](_0x3962ac);var _0x56505e=_0x1f405a[_0x1af6('0xb')](_0xf7fa13);if(_0x56505e>_0x38c23a){return _0x1f405a[_0x1af6('0xc')](_0x38c23a,_0x56505e+0x1);}else{var _0x25b2c8=_0x1f405a[_0x1af6('0xc')](0x0,_0x56505e+0x1);var _0x3cb8d7=_0x1f405a['slice'](_0x38c23a);return _0x3cb8d7[_0x1af6('0xd')](_0x25b2c8);}}}module['exports'][_0x1af6('0xe')]=circularDoWInterval;function circularMonthInterval(_0x3afec3,_0x3fe2f2){if(_0x3afec3===_0x3fe2f2){return[_0x3afec3];}else{var _0x3a4e83=moment['locale']();moment[_0x1af6('0x8')]('en');var _0x25130b=moment['monthsShort']()[_0x1af6('0x2')](function(_0x636f25){return _0x636f25[_0x1af6('0xa')]();});moment['locale'](_0x3a4e83);var _0xafdbbe=_0x25130b[_0x1af6('0xb')](_0x3afec3);var _0x7f85b8=_0x25130b[_0x1af6('0xb')](_0x3fe2f2);if(_0x7f85b8>_0xafdbbe){return _0x25130b[_0x1af6('0xc')](_0xafdbbe,_0x7f85b8+0x1);}else{var _0x155bd0=_0x25130b[_0x1af6('0xc')](0x0,_0x7f85b8+0x1);var _0x50bd0a=_0x25130b[_0x1af6('0xc')](_0xafdbbe);return _0x50bd0a['concat'](_0x155bd0);}}}module['exports'][_0x1af6('0xf')]=circularMonthInterval;function parseDom(_0x4177d0){var _0x3e96a5=parseInt(_0x4177d0,0xa);if(_0x3e96a5<0x1||_0x3e96a5>0x1f){throw new Error(EINVALID_DATE);}return _0x3e96a5;}function timeCompare(_0x494a4d,_0xb1b343,_0x125ba0){var _0x298f92=_0x494a4d[_0x1af6('0x10')]();var _0x333e1f=extractTime(_0xb1b343);var _0x58106e=_0x333e1f[0x0];var _0x296225=_0x333e1f[0x1];var _0x20cf9a=_0x494a4d[_0x1af6('0x10')]()[_0x1af6('0x11')](_0x58106e)[_0x1af6('0x12')](_0x296225);throwIfDateNotValid(_0x20cf9a);var _0x581036=extractTime(_0x125ba0);var _0x252cad=_0x581036[0x0];var _0x39f2b6=_0x581036[0x1];var _0x3509ef=_0x494a4d['clone']()[_0x1af6('0x11')](_0x252cad)[_0x1af6('0x12')](_0x39f2b6);throwIfDateNotValid(_0x3509ef);if(_0x3509ef[_0x1af6('0x13')](_0x20cf9a)){var _0x88b6fd=_0x298f92['clone']()[_0x1af6('0x14')](_0x1af6('0x15'));var _0x5bbd65=_0x298f92[_0x1af6('0x10')]()[_0x1af6('0x16')](_0x1af6('0x15'));return _0x298f92[_0x1af6('0x17')](_0x20cf9a,_0x5bbd65,undefined,'[]')||_0x298f92[_0x1af6('0x17')](_0x88b6fd,_0x3509ef,undefined,'[]');}else{return _0x298f92[_0x1af6('0x17')](_0x20cf9a,_0x3509ef,undefined,'[]');}}module[_0x1af6('0x18')][_0x1af6('0x19')]=timeCompare;function dowCompare(_0x350df9,_0x2450a5,_0x2fe545){var _0x3a92ec=_0x350df9['locale']('en')[_0x1af6('0x1a')](_0x1af6('0x1b'))['toLowerCase']();return circularDoWInterval(_0x2450a5,_0x2fe545)[_0x1af6('0x1c')](_0x3a92ec);}module['exports'][_0x1af6('0x1d')]=dowCompare;function domCompare(_0x4288c0,_0x2a6c19,_0x54a894){var _0x22161e=_0x4288c0[_0x1af6('0x1e')]();if(_0x2a6c19===_0x54a894){return _0x22161e===_0x2a6c19;}else{var _0x35b902=_0x4288c0[_0x1af6('0x1f')]();var _0x5be95b=_0x2a6c19<_0x54a894;let _0x4e301f=![];var _0x501119=0x0;var _0x4f1d76=0x0;if(_0x5be95b){_0x501119=Math[_0x1af6('0x20')](0x1,_0x2a6c19);_0x4f1d76=Math[_0x1af6('0x21')](_0x54a894,_0x35b902);_0x4e301f=_0x22161e>=_0x501119&&_0x22161e<=_0x4f1d76;}else{_0x501119=Math[_0x1af6('0x21')](_0x2a6c19,_0x35b902);_0x4f1d76=Math['max'](0x1,_0x54a894);_0x4e301f=_0x22161e>=_0x501119||_0x22161e<=_0x4f1d76;}return _0x4e301f;}}module[_0x1af6('0x18')][_0x1af6('0x22')]=domCompare;function monthCompare(_0x341002,_0x5df487,_0x13e762){var _0x56aea7=_0x341002[_0x1af6('0x8')]('en')['format'](_0x1af6('0x23'))['toLowerCase']();return circularMonthInterval(_0x5df487,_0x13e762)[_0x1af6('0x1c')](_0x56aea7);}module['exports'][_0x1af6('0x24')]=monthCompare;function iftime(_0x16bf27,_0x412de4=moment['tz'][_0x1af6('0x25')](),_0x334056=moment()){if(!validateRx[_0x1af6('0x26')](_0x16bf27)){throw new Error(EINVALID_STRING);}else{var _0x44b9a2=(moment[_0x1af6('0x27')](_0x334056)?_0x334056[_0x1af6('0x10')]():moment(_0x334056))['tz'](_0x412de4)[_0x1af6('0x8')]('en');throwIfDateNotValid(_0x44b9a2);var _0xb2e132=_0x16bf27[_0x1af6('0x7')](',');var _0x29cc97=_0xb2e132[0x0];var _0x14af49=_0xb2e132[0x1];var _0x3eb86a=_0xb2e132[0x2];var _0x13cd40=_0xb2e132[0x3];let _0x55b7a1=!![];if(_0x29cc97!=='*'){var _0x5ff9da=_0x29cc97[_0x1af6('0x7')]('-');var _0x58a2af=_[_0x1af6('0x28')](_0x5ff9da[0x0],0x5,'0');var _0x588f52=_0x5ff9da['length']===0x2?_[_0x1af6('0x28')](_0x5ff9da[0x1],0x5,'0'):_0x58a2af;_0x55b7a1=timeCompare(_0x44b9a2,_0x58a2af,_0x588f52);}let _0x4e8ca0=!![];if(_0x14af49!=='*'){var _0x24e798=_0x14af49['split']('-');var _0x465d93=_0x24e798[0x0];var _0x329e0d=_0x24e798[_0x1af6('0x29')]===0x2?_0x24e798[0x1]:_0x465d93;_0x4e8ca0=dowCompare(_0x44b9a2,_0x465d93,_0x329e0d);}let _0x5760cb=!![];if(_0x3eb86a!=='*'){var _0x312585=_0x3eb86a[_0x1af6('0x7')]('-');var _0x266d07=parseDom(_0x312585[0x0]);var _0x16e522=_0x312585['length']===0x2?parseDom(_0x312585[0x1]):_0x266d07;_0x5760cb=domCompare(_0x44b9a2,_0x266d07,_0x16e522);}let _0x5d8c93=!![];if(_0x13cd40!=='*'){var _0x22c213=_0x13cd40[_0x1af6('0x7')]('-');var _0x5f0b11=_0x22c213[0x0];var _0x22a62d=_0x22c213[_0x1af6('0x29')]===0x2?_0x22c213[0x1]:_0x22c213[0x0];_0x5d8c93=monthCompare(_0x44b9a2,_0x5f0b11,_0x22a62d);}return _0x55b7a1&&_0x4e8ca0&&_0x5760cb&&_0x5d8c93;}}module[_0x1af6('0x18')][_0x1af6('0x2a')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index d186504..6c798e6 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6620=['path','util','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','Logger','Console','transports','File','%s-%s','error','warn','consoleLogger','fileLogger'];(function(_0x35f4f3,_0x437876){var _0x5e9941=function(_0x15ed37){while(--_0x15ed37){_0x35f4f3['push'](_0x35f4f3['shift']());}};_0x5e9941(++_0x437876);}(_0x6620,0xea));var _0x0662=function(_0x43028b,_0x46246d){_0x43028b=_0x43028b-0x0;var _0x9396b8=_0x6620[_0x43028b];return _0x9396b8;};'use strict';var path=require(_0x0662('0x0'));var util=require(_0x0662('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0x0662('0x2'));var debugLevel=config[_0x0662('0x3')]?config['debugLevel'][_0x0662('0x4')]():_0x0662('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x0662('0x6'),'error':_0x0662('0x7'),'warn':_0x0662('0x8'),'info':_0x0662('0x9'),'print':_0x0662('0xa'),'success':_0x0662('0xb'),'http':_0x0662('0xc'),'verbose':_0x0662('0xd'),'debug':_0x0662('0xe'),'silly':_0x0662('0xf')};winston[_0x0662('0x10')](XC_LOG_COLORS);function getLogFileName(_0x36d7d5,_0x28c3b1,_0x3ecde4){var _0x47aae0=_0x36d7d5||_0x0662('0x11');return path['join'](_0x47aae0,util['format']('%s-%s.log',_0x28c3b1,_0x3ecde4));}function formatter(_0x157926,_0x440ae0){_0x440ae0[_0x0662('0x12')]=_0x440ae0[_0x0662('0x12')][_0x0662('0x13')](/@@{/g,_0x0662('0x14'))['replace'](/}@@/g,_0x0662('0x15'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x0662('0x16')](_0x0662('0x17'),moment()[_0x0662('0x16')](_0x0662('0x18')),_0x440ae0[_0x0662('0x19')][_0x0662('0x1a')](),_0x157926,_0x440ae0[_0x0662('0x12')]);}function fileFormat(_0x7ced99,_0x45be44){_0x45be44['message']=_0x45be44[_0x0662('0x12')]['replace'](/@@{/g,_0x0662('0x14'))[_0x0662('0x13')](/}@@/g,_0x0662('0x15'))['replace'](/@{/g,'{{')[_0x0662('0x13')](/}@/g,'}}');var _0x4cb0d8=_0x45be44[_0x0662('0x1b')]&&Object[_0x0662('0x1c')](_0x45be44[_0x0662('0x1b')])[_0x0662('0x1d')]?'\x0a\x09'+JSON['stringify'](_0x45be44['meta']):'';return util[_0x0662('0x16')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x0662('0x16')](_0x0662('0x18')),_0x45be44[_0x0662('0x19')]['toUpperCase'](),_0x7ced99,_0x45be44['message'],_0x4cb0d8);}function consoleLogger(){var _0x46d92f=new winston[(_0x0662('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x0662('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x2e23e1){return formatter('',_0x2e23e1);}})]});return _0x46d92f;}function fileLogger(_0x60e455,_0x5ee89e){var _0x36e11b=new winston[(_0x0662('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0662('0x20'))][(_0x0662('0x21'))]({'name':util[_0x0662('0x16')](_0x0662('0x22'),_0x60e455,_0x0662('0x23')),'filename':getLogFileName(_0x5ee89e,_0x60e455,'error'),'level':_0x0662('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd720a1){return fileFormat(_0x60e455,_0xd720a1);}}),new winston['transports'][(_0x0662('0x21'))]({'name':util[_0x0662('0x16')](_0x0662('0x22'),_0x60e455,debugLevel),'filename':getLogFileName(_0x5ee89e,_0x60e455,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24e108){return fileFormat(_0x60e455,_0x24e108);}}),new winston['transports'][(_0x0662('0x1f'))]({'level':_0x0662('0x24'),'json':![],'formatter':function(_0x3b93e8){return fileFormat(_0x60e455,_0x3b93e8);}})]});return _0x36e11b;}exports[_0x0662('0x25')]=consoleLogger;exports[_0x0662('0x26')]=fileLogger; \ No newline at end of file +var _0xc828=['red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info'];(function(_0x2b5ad1,_0x9cbdd6){var _0x1495b9=function(_0x3cc312){while(--_0x3cc312){_0x2b5ad1['push'](_0x2b5ad1['shift']());}};_0x1495b9(++_0x9cbdd6);}(_0xc828,0x1f0));var _0x8c82=function(_0x1313c0,_0x440849){_0x1313c0=_0x1313c0-0x0;var _0x504022=_0xc828[_0x1313c0];return _0x504022;};'use strict';var path=require(_0x8c82('0x0'));var util=require(_0x8c82('0x1'));var moment=require(_0x8c82('0x2'));var winston=require(_0x8c82('0x3'));var config=require(_0x8c82('0x4'));var debugLevel=config[_0x8c82('0x5')]?config[_0x8c82('0x5')][_0x8c82('0x6')]():_0x8c82('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x8c82('0x8'),'warn':_0x8c82('0x9'),'info':_0x8c82('0xa'),'print':_0x8c82('0xb'),'success':_0x8c82('0xc'),'http':_0x8c82('0xd'),'verbose':_0x8c82('0xe'),'debug':_0x8c82('0xf'),'silly':_0x8c82('0x10')};winston[_0x8c82('0x11')](XC_LOG_COLORS);function getLogFileName(_0x35f93d,_0xf02565,_0x6434ea){var _0x2da170=_0x35f93d||_0x8c82('0x12');return path[_0x8c82('0x13')](_0x2da170,util[_0x8c82('0x14')]('%s-%s.log',_0xf02565,_0x6434ea));}function formatter(_0x323481,_0x568424){_0x568424[_0x8c82('0x15')]=_0x568424[_0x8c82('0x15')][_0x8c82('0x16')](/@@{/g,_0x8c82('0x17'))['replace'](/}@@/g,_0x8c82('0x18'))[_0x8c82('0x16')](/@{/g,'{{')[_0x8c82('0x16')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x8c82('0x14')](_0x8c82('0x19')),_0x568424[_0x8c82('0x1a')][_0x8c82('0x1b')](),_0x323481,_0x568424['message']);}function fileFormat(_0x247507,_0x19dc49){_0x19dc49[_0x8c82('0x15')]=_0x19dc49[_0x8c82('0x15')][_0x8c82('0x16')](/@@{/g,_0x8c82('0x17'))[_0x8c82('0x16')](/}@@/g,'}}}')[_0x8c82('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x1a3736=_0x19dc49[_0x8c82('0x1c')]&&Object[_0x8c82('0x1d')](_0x19dc49['meta'])[_0x8c82('0x1e')]?'\x0a\x09'+JSON[_0x8c82('0x1f')](_0x19dc49[_0x8c82('0x1c')]):'';return util['format'](_0x8c82('0x20'),moment()[_0x8c82('0x14')](_0x8c82('0x19')),_0x19dc49[_0x8c82('0x1a')][_0x8c82('0x1b')](),_0x247507,_0x19dc49['message'],_0x1a3736);}function consoleLogger(){var _0x268f43=new winston[(_0x8c82('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8c82('0x22'))][(_0x8c82('0x23'))]({'level':_0x8c82('0x24'),'json':![],'formatter':function(_0x1ef3ed){return formatter('',_0x1ef3ed);}})]});return _0x268f43;}function fileLogger(_0xd734d3,_0x4adc15){var _0x1f344a=new winston[(_0x8c82('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8c82('0x22'))][(_0x8c82('0x25'))]({'name':util['format']('%s-%s',_0xd734d3,_0x8c82('0x26')),'filename':getLogFileName(_0x4adc15,_0xd734d3,'error'),'level':_0x8c82('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x264c2f){return fileFormat(_0xd734d3,_0x264c2f);}}),new winston[(_0x8c82('0x22'))]['File']({'name':util[_0x8c82('0x14')](_0x8c82('0x27'),_0xd734d3,debugLevel),'filename':getLogFileName(_0x4adc15,_0xd734d3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ad540){return fileFormat(_0xd734d3,_0x3ad540);}}),new winston[(_0x8c82('0x22'))][(_0x8c82('0x23'))]({'level':'warn','json':![],'formatter':function(_0x12ff44){return fileFormat(_0xd734d3,_0x12ff44);}})]});return _0x1f344a;}exports[_0x8c82('0x28')]=consoleLogger;exports[_0x8c82('0x29')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index ee88697..238001a 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0xbdf0de,_0x139344){var _0x590248=function(_0x7798fa){while(--_0x7798fa){_0xbdf0de['push'](_0xbdf0de['shift']());}};_0x590248(++_0x139344);}(_0xadb5,0xad));var _0x5adb=function(_0x210fb1,_0x3a1f89){_0x210fb1=_0x210fb1-0x0;var _0x4ee917=_0xadb5[_0x210fb1];return _0x4ee917;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0x4975,0x86));var _0x5497=function(_0x58bdc2,_0x444bd5){_0x58bdc2=_0x58bdc2-0x0;var _0x51227d=_0x4975[_0x58bdc2];return _0x51227d;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7d18340..58cd2d8 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map','keys'];(function(_0x8cac34,_0x1c5c1a){var _0x54a344=function(_0x4b1399){while(--_0x4b1399){_0x8cac34['push'](_0x8cac34['shift']());}};_0x54a344(++_0x1c5c1a);}(_0x4fc2,0x111));var _0x24fc=function(_0x110d59,_0x50c4fb){_0x110d59=_0x110d59-0x0;var _0x2fce64=_0x4fc2[_0x110d59];return _0x2fce64;};var _=require(_0x24fc('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b05a5){return _0x2b05a5==='{{'?_0x24fc('0x1'):_0x24fc('0x2');}function safeTemplate(_0x5aaa74){var _0x365c56=_0x5aaa74;if(typeof _0x5aaa74===_0x24fc('0x3')){_0x365c56=_0x5aaa74[_0x24fc('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x5aaa74)){_0x365c56=_0x5aaa74[_0x24fc('0x5')](function(_0x3772eb){return safeTemplate(_0x3772eb);});}else if(_['isPlainObject'](_0x5aaa74)){_0x365c56=Object[_0x24fc('0x6')](_0x5aaa74)[_0x24fc('0x7')](function(_0x4889f4,_0x115851){_0x4889f4[_0x115851]=safeTemplate(_0x5aaa74[_0x115851]);return _0x4889f4;},{});}return _0x365c56;}module[_0x24fc('0x8')][_0x24fc('0x9')]=safeTemplate; \ No newline at end of file +var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x5a81a0,_0x4f006e){var _0x172074=function(_0x3eace5){while(--_0x3eace5){_0x5a81a0['push'](_0x5a81a0['shift']());}};_0x172074(++_0x4f006e);}(_0xef0f,0x168));var _0xfef0=function(_0xf09399,_0x14686c){_0xf09399=_0xf09399-0x0;var _0x45646b=_0xef0f[_0xf09399];return _0x45646b;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate; \ No newline at end of file